query
stringlengths
7
5.25k
document
stringlengths
15
1.06M
metadata
dict
negatives
sequencelengths
3
101
negative_scores
sequencelengths
3
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Escapes characters that work as wildcard characters in a LIKE pattern.
public function escapeLike($string);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function escapeLikePattern($text){\r\n\t\t\t$text = str_replace('\\\\', '', $text);//apparently a backslash is ignored when using the LIKE operator\r\n\t\t\t$text = self::escape($text);\r\n\t\t\tif($text !==false){\r\n\t\t\t\t$text = str_replace('%', '\\%', $text);\r\n\t\t\t\t$text = str_replace('_', '\\_', $text);\r\n\t\t\t\tif(mb_strlen($text)>=3) $text .= '%';\r\n\t\t\t}\r\n\t\t\treturn $text;\r\n\t\t}", "abstract public function escapeStr($str, $like = false);", "protected static function _escapeChar($matches) {}", "function esc_like($text)\n{\n return addcslashes($text, '_%\\\\');\n}", "function like_escape($text)\n {\n }", "function escapeSQL($string, $wildcard=false)\n{\n\t$db = &atkGetDb();\n\treturn $db->escapeSQL($string, $wildcard);\n}", "function escapeForRegex($pattern)\n{\n\t$escaped='';\n\t$escapechars = array(\"/\",\"?\",'\"', \"(\", \")\", \"'\",\"*\",\".\",\"[\",\"]\");\n\tfor ($counter = 0; $counter<strlen($pattern);$counter++)\n\t{\n\t\t$curchar = substr($pattern, $counter, 1);\n\t\tif (in_array($curchar,$escapechars))\n\t\t$escaped .= \"\\\\\";\n\t\t$escaped.=$curchar;\n\t}\n\treturn $escaped;\n}", "public static function escapeMatchPattern($text){\r\n\t\t$text = str_replace('*', '', trim($text));\r\n\t\tif(mb_strlen($text)>=3){\r\n\t\t\tif(!strstr($text,'\"')){\r\n\t\t\t\tif(!strstr($text,\"'\")){\r\n\t\t\t\t\t//not exact phrase\r\n\t\t\t\t\tif(!strstr($text,' ')){\r\n\t\t\t\t\t\t//one word\r\n\t\t\t\t\t\t$text.='*';//truncation\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn self::escape($text);\r\n\t}", "public static function safe_sql_like($string){\n global $wpdb;\n\n // safe\n $string = $wpdb->prepare(\"%s\", $string);\n // trim '\n $tmp = explode(\"'\", $string);\n array_shift($tmp);\n array_pop($tmp);\n $string = implode(\"'\", $tmp);\n\n // Safe for LIKE'...'\n $string = str_replace( array(\"%\", \"[\", \"]\", \"^\", \"_\"), array(\"\\%\", \"\\[\", \"\\]\", \"\\^\", \"\\_\"), $string);\n\n return $string;\n }", "public function escapeLikeStringDirect($str)\n\t{\n\t\t//log_message('error', 'escapeLikeStringDirect');\n\n\t\tif (is_array($str))\n\t\t{\n\t\t\tforeach ($str as $key => $val)\n\t\t\t{\n\t\t\t\t$str[$key] = $this->escapeLikeStringDirect($val);\n\t\t\t}\n\n\t\t\treturn $str;\n\t\t}\n\n\t\t$str = $this->_escapeString($str);\n\n\t\t// Escape LIKE condition wildcards\n\t\treturn str_replace([\n\t\t\t$this->likeEscapeChar,\n\t\t\t'%',\n\t\t\t'_',\n\t\t], [\n\t\t\t'\\\\' . $this->likeEscapeChar,\n\t\t\t'\\\\' . '%',\n\t\t\t'\\\\' . '_',\n\t\t], $str\n\t\t);\n\t}", "function preg_wildcard($pat) {\n return str_replace(array('*', '?', '/'),array('.*', '.', '\\/'), $pat);\n}", "protected function escapeLike(string $str): string {\n return addcslashes($str, '_%');\n }", "function wildcardify($s, $wrap = '%') {\n\n\n $result = '';\n $escape = false;\n $len = strlen($s);\n $foundWildcard = false;\n\n for($i = 0; $i < $len; $i++) {\n\n $c = substr($s, $i, 1);\n\n if ($escape) {\n $result .= $c;\n $escape = false;\n continue;\n } else if ($c === '\\\\') {\n $escape = true;\n continue;\n }\n\n if ($c === '%') $c = '\\\\%';\n if ($c === '_') $c = '\\\\_';\n\n $foundWildcard = $foundWildcard || ($c === '*' || $c === '?');\n\n if ($c === '*') $c = '%';\n if ($c === '?') $c = '_';\n\n $result .= $c;\n }\n\n if ($wrap && !$foundWildcard) {\n $result = \"{$wrap}{$result}{$wrap}\";\n }\n\n return $result;\n }", "public function anyString() {\n\t\treturn new LikeMatch( '%' );\n\t}", "protected function _escape($text)\n {\n static $list;\n if (! $list) {\n $list = array(\n '%' => '%%',\n );\n \n for ($i = 0; $i < 32; $i ++) {\n $list[chr($i)] = \"\\\\$i\";\n }\n \n $list[chr(127)] = \"\\\\127\";\n }\n \n return strtr($text, $list);\n }", "function escapeSQL($string, $wildcard=false)\n\t{\n\t\tif ($this->connect('r') === DB_SUCCESS)\n\t\t{\n\t\t\tif ($wildcard == true)\n\t\t\t{\n\t\t\t\t$string = str_replace('%', '\\%', $string);\n\t\t\t}\n\t\t\treturn mysqli_real_escape_string($this->m_link_id, $string);\n\t\t}\n\n\t\treturn null;\n\t}", "function ldap_filterescape($string){\n return preg_replace_callback(\n '/([\\x00-\\x1F\\*\\(\\)\\\\\\\\])/',\n function ($matches) {\n return \"\\\\\" . implode(\"\", unpack(\"H2\", $matches[1]));\n },\n $string\n );\n}", "protected function escape($value): string\n {\n $value = strtr(\n $value,\n [\n '%' => '\\%',\n '_' => '\\_',\n '\\\\' => '\\\\\\\\',\n ]\n );\n\n return '%' . $value . '%';\n }", "function like($pattern, $subject)\t{\n\t\t$pattern = str_replace('%', '.*', preg_quote($pattern));\n\t\treturn (bool) preg_match(\"/^{$pattern}$/i\", $subject);\n\t}", "protected function toLikeSearchString($text)\n {\n $str = preg_replace('#[\\s%]+#', '%', $text);\n\n // Remove all wildcard character at the head and tail\n $str = preg_replace('#^%+#', '', $str);\n $str = preg_replace('#%+$#', '', $str);\n \n return $str;\n }", "public function bindLikeValue($value)\n {\n return '%' . $value . '%';\n }", "public function likeEscape(string $keyword): string;", "public function like($stringWithWildCardCharacter){\n $this->debugBacktrace();\n\n $value = $this->_real_escape_string($stringWithWildCardCharacter);\n\n if($this->last_call_where_or_having == \"where\"){\n $this->whereClause .= \" LIKE $value\";\n }\n else{\n $this->havingClause .= \" LIKE $value\";\n }\n return $this;\n }", "function checkRealEscapeString($value);", "function LikeWhereClause ($field, $value)\n\t{\n\t\t$this->field = $field;\n\t\t$this->regexp = '/^' . str_replace('%','.*', preg_quote($value)) . '$/i';\n\t}", "public function escapeString($stringToEscape);", "protected function _wildcardize($field) {\r\n // TODO: Need to be improve, protection caracter should be found \r\n\t\t$where = array();\r\n\t\tif (strpos($value, '*') !== false) {\r\n\t\t\t$where[\"{$field} LIKE ?\"] = str_replace('*', '%', $value);\r\n\t\t} \r\n\t\telse {\r\n\t\t\t$where[\"{$column} = ?\"] = $value;\r\n\t\t}\r\n \t\r\n\t\treturn $where;\r\n }", "abstract protected function _escape($s);", "public function placeholder_escape()\n {\n }", "public function anyChar() {\n\t\treturn new LikeMatch( '_' );\n\t}", "public function escape($string);", "public function escape($string);", "protected function fullTextWildcards($term)\n {\n return str_replace(' ', '*', $term) . '*';\n \n }", "public function escape($text);", "function simulated_wildcard_match($context, $word, $full_cover = false)\n{\n $rexp = str_replace('%', '.*', str_replace('_', '.', str_replace('\\\\?', '.', str_replace('\\\\*', '.*', preg_quote($word)))));\n if ($full_cover) {\n $rexp = '^' . $rexp . '$';\n }\n\n return preg_match('#' . str_replace('#', '\\#', $rexp) . '#i', $context) != 0;\n}", "function like ($value) {\n return ' like \\''.$value.'\\'';\n }", "protected function _filterEscape($string) {\n // see https://github.com/adldap/adLDAP/issues/22\n return preg_replace_callback(\n '/([\\x00-\\x1F\\*\\(\\)\\\\\\\\])/',\n function ($matches) {\n return \"\\\\\".join(\"\", unpack(\"H2\", $matches[1]));\n },\n $string\n );\n }", "private function escapeLikeString(string $haystack): string\n\t{\n\t\treturn str_replace('\\\\\\'', '\\'\\'', addslashes($haystack));\n\t}", "public static function wildcardSearchstring( $sSearchString ) {\n\t\t// remove beginning\n\t\t$sSearchString = trim( $sSearchString );\n\t\tif ( empty( $sSearchString ) ) {\n\t\t\treturn $sSearchString;\n\t\t}\n\n\t\tif ( self::containsStringUnescapedCharsOf( $sSearchString, '~' ) ) {\n\t\t\treturn $sSearchString;\n\t\t}\n\t\tif ( self::containsStringUnescapedCharsOf( $sSearchString, '\"' ) ) {\n\t\t\treturn $sSearchString;\n\t\t}\n\t\tif ( self::containsStringUnescapedCharsOf( $sSearchString, '^' ) ) {\n\t\t\treturn $sSearchString;\n\t\t}\n\t\tif ( self::containsStringUnescapedCharsOf( $sSearchString, '*' ) ) {\n\t\t\treturn $sSearchString;\n\t\t}\n\n\t\tif ( strpos( $sSearchString, ' ' ) !== false ) {\n\t\t\t$sSearchString = str_replace( ' ', '*', $sSearchString );\n\t\t}\n\n\t\treturn '*' . $sSearchString . '*';\n\t}", "function convertToSqlLikeValue($input) {\n $result = $input;\n\n // escape special chars\n $replace_Step1 = array(\n '%' => '\\%',\n '_' => '\\_',\n );\n // replace chars given by surfer\n $replace_Step2 = array(\n '?' => '_',\n '*' => '%',\n );\n\n $result = strtr($result, $replace_Step1);\n $result = strtr($result, $replace_Step2);\n\n return $result;\n }", "abstract public function escape_string( $str );", "public function globalStringConditionMatchesWildcardExpression() {}", "public function globalStringConditionMatchesWildcardExpression() {}", "public function escapeString($string);", "public abstract function escape($string);", "public function buildLike() {\n\t\t$params = func_get_args();\n\n\t\tif ( count( $params ) > 0 && is_array( $params[0] ) ) {\n\t\t\t$params = $params[0];\n\t\t}\n\n\t\t$s = '';\n\n\t\tforeach ( $params as $value ) {\n\t\t\tif ( $value instanceof LikeMatch ) {\n\t\t\t\t$s .= $value->toString();\n\t\t\t} else {\n\t\t\t\t$s .= $this->escapeLikeInternal( $value );\n\t\t\t}\n\t\t}\n\n\t\treturn \" LIKE '\" . $s . \"' \";\n\t}", "public function searchLike($searchField, $value)\n {\n return \" UPPER($searchField) LIKE UPPER('%{$value}%') \";\n }", "public\r\n\tfunction buildLike( $string ) {\r\n\t\treturn $string . '%';\r\n\t}", "public static function escape($s) {}", "function escapeLdapFilter($str = '') {\n //\n // NOTE: It’s important that the slash is the first character replaced.\n // Otherwise the slash added by other replacements will then be\n // replaced as well, resulted in double-escaping all characters\n // replaced before the slashes were replaced.\n //\n $metaChars = array(\n chr(0x5c), // \\\n chr(0x2a), // *\n chr(0x28), // (\n chr(0x29), // )\n chr(0x00) // NUL\n );\n\n // Build the list of the escaped versions of those characters.\n $quotedMetaChars = array ();\n foreach ($metaChars as $key => $value) {\n $quotedMetaChars[$key] = '\\\\' .\n str_pad(dechex(ord($value)), 2, '0', STR_PAD_LEFT);\n }\n\n // Make all the necessary replacements in the input string and return\n // the result.\n return str_replace($metaChars, $quotedMetaChars, $str);\n}", "protected function prepare_term_regex( $term ) {\n $term = str_replace('\\\\\\'', '\\'', $term);\n $term = preg_quote( $term, '/' );\n $search = array( ' ', '&', ',' );\n $replace = array( '\\s', '\\&', '\\,' );\n\t $term = str_replace( $search, $replace, $term );\n return preg_replace( '/(\\\"|\\\\\\'|\\“|\\”|\\‘|\\’|\\«|\\»)/i', '[\\\"\\\\\\'\\“\\”\\‘\\’\\«\\»]', $term );\n }", "abstract public function escapeString($string);", "public function escapeLikeValue($value, $options = array()) {\n $value = str_replace('\\\\', '\\\\\\\\', $value);\n\n $from = array();\n $to = array();\n if (empty($options['allow_symbol_mask'])) {\n $from[] = '_';\n $to[] = '\\_';\n }\n if (empty($options['allow_string_mask'])) {\n $from[] = '%';\n $to[] = '\\%';\n }\n if ($from) {\n $value = str_replace($from, $to, $value);\n }\n\n if (isset($options['position'])) {\n switch ($options['position']) {\n case 'any':\n $value = '%' . $value . '%';\n break;\n case 'start':\n $value = $value . '%';\n break;\n case 'end':\n $value = '%' . $value;\n break;\n }\n }\n return $value;\n }", "public function EscapeString($argString, $argEscapeUnderscorePercentCharacters = false)\r\n {\r\n $this->checkDatabaseManager();\r\n $escapedString = $this->_DatabaseHandler->real_escape_string($argString);\r\n if($argEscapeUnderscorePercentCharacters)\r\n {\r\n $escapedString = addcslashes($escapedString, '%_');\r\n }\r\n return $escapedString;\r\n }", "private function escape_string($in_string)\n {\n // $str = $in_string;\n return preg_replace('([%;])', '\\\\\\1', $in_string);\n //return $in_string;\n }", "private function escape ($string, $regex='@', $reconnect_attempt = FALSE) {\n\t\tif ($reconnect_attempt) {\n\t\t\t// If the connection is lost, try to reconnect.\n\t\t\tif ( !isset( $this->dbcon ) || ! $this->dbcon ) {\n\t\t\t\t$this->db_connect();\n\t\t\t}\n\t\t}\n\t\tif (is_string($string)) {\n\t\t\t$string = mysqli_real_escape_string($this->dbcon, $string);\n\t\t\t// $string = addcslashes($string, '%_');\n\t\t\t$string = \"'\" . str_replace('@', $string, $regex) . \"'\";\n\t\t}\n\t\treturn $string;\n\t}", "public function formatWildcards(string $value): string\n {\n $from = $to = $substFrom = $substTo = [];\n if ($this->getConfig('wildcardAny') !== '%') {\n $from[] = $this->getConfig('fromWildCardAny');\n $to[] = $this->getConfig('toWildCardAny');\n $substFrom[] = $this->getConfig('wildcardAny');\n $substTo[] = '%';\n }\n if ($this->getConfig('wildcardOne') !== '_') {\n $from[] = $this->getConfig('fromWildCardOne');\n $to[] = $this->getConfig('toWildCardOne');\n $substFrom[] = $this->getConfig('wildcardOne');\n $substTo[] = '_';\n }\n if ($from) {\n // Escape first\n $value = str_replace($from, $to, $value);\n // Replace wildcards\n $value = str_replace($substFrom, $substTo, $value);\n }\n\n return $value;\n }", "protected function escapeForRegex($regex) {\n // $regex = str_replace('.', '\\\\.', $regex);\n $regex = str_replace('?', '\\\\\\\\?', $regex);\n $regex = str_replace('[', '\\\\\\\\[', $regex);\n $regex = str_replace(']', '\\\\\\\\]', $regex);\n $regex = str_replace('*', '([\\\\\\\\w\\\\\\\\-])*', $regex);\n\n return $regex;\n }", "public function notLike($stringWithWildCardCharacter){\n $this->debugBacktrace();\n $value = $this->_real_escape_string($stringWithWildCardCharacter);\n\n if($this->last_call_where_or_having == \"where\"){\n $this->whereClause .= \" NOT LIKE $value\";\n }\n else{\n $this->havingClause .= \" NOT LIKE $value\";\n }\n return $this;\n }", "public function whereLike($table, $column, $value);", "public function like($column,$data,$wildCardPlacement);", "public function addEscape($func);", "public static function escape($value) {}", "static public function real_escape_string($s) { return self::escape($s); }", "public static function escape($som) {}", "private static function _escapeTagChar($matches) {}", "public function orLike($column,$data,$wildCardPlacement);", "protected abstract function escape($string);", "protected static function replaceWildcards($regex)\n\t{\n\t\tpreg_match_all(chr(1) . '\\(\\\\*([a-z][a-zA-Z0-9]*)\\)' . chr(1), $regex, $matches, PREG_SET_ORDER);\n\n\t\tforeach ($matches as $match)\n\t\t{\n\t\t\t$name = $match[1];\n\n\t\t\t$regex = str_replace(\"(*{$name})\", \"(?P<{$name}>.*)\", $regex);\n\t\t}\n\n\t\treturn $regex;\n\t}", "public function escape($value);", "public function escape($value);", "function _escape($s)\n\t\t{\n\t\t\treturn str_replace(')','\\\\)',str_replace('(','\\\\(',str_replace('\\\\','\\\\\\\\',$s)));\n\t\t}", "protected function remove_iunreserved_percent_encoded($regex_match)\n {\n }", "public static function wildcardString($str, $wildcard, $lowercase = true)\n {\n $wild = $wildcard;\n $chars = (array) preg_split('//u', $str, -1, PREG_SPLIT_NO_EMPTY);\n\n if (count($chars) > 0) {\n foreach ($chars as $char) {\n $wild .= $char.$wildcard;\n }\n }\n\n if ($lowercase) {\n $wild = Str::lower($wild);\n }\n\n return $wild;\n }", "public static function contains($word)\n {\n return '%' . str_replace(' ', '%', $word) . '%';\n }", "function convertFromSqlLikeValue($input) {\n $result = $input;\n\n $pattern1a = '/(?<!\\\\\\)(%)/i';\n $result = preg_replace($pattern1a, '*', $result);\n $pattern1b = '/(?<!\\\\\\)(\\_)/i';\n $result = preg_replace($pattern1b, '?', $result);\n\n $pattern2a = '/(\\\\\\%)/i';\n $result = preg_replace($pattern2a, '%', $result);\n $pattern2b = '/(\\\\\\\\_)/i';\n $result = preg_replace($pattern2b, '_', $result);\n\n return $result;\n }", "function glob_to_regex($glob) {\n\n $glob = str_replace('.', '\\.', $glob);\n $glob = str_replace('+', '\\+', $glob);\n $glob = str_replace('*', '.+', $glob);\n $glob = str_replace('?', '.', $glob);\n\n return $glob ? \"^$glob$\" : $glob;\n }", "function addslashes_mssql($str,$inlike=false,$escape='!')\n\t{\n\n\t\tif (is_array($str))\n\t\t{\n\t\t\tforeach($str AS $id => $value) {\n\t\t\t\t$str[$id] = addslashes_mssql($value,$inlike);\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\n\t\t\t$str\t= str_replace(\"'\", \"''\", $str);\n\n\t\t\tif ($inlike)\n\t\t\t{\n\t\t\t\t$str\t= str_replace($escape, $escape.$escape, $str);\n\t\t\t\t$str\t= str_replace('%', $escape.'%', $str);\n\t\t\t\t$str\t= str_replace('[', $escape.'[', $str);\n\t\t\t\t$str\t= str_replace(']', $escape.']', $str);\n\t\t\t\t$str\t= str_replace('_', $escape.'_', $str);\n\t\t\t}\n\n\t\t}\n\n\t\treturn $str;\n\n\t}", "public static function SqlEscString($str)\n {\n try {\n $ret = str_replace([ '%', '_' ], [ '\\%', '\\_' ], DB::getPdo()->quote($str));\n return $ret && strlen($ret) >= 2 ? substr($ret, 1, strlen($ret)-2) : $ret;\n } catch (Exception $e) {\n return $str;\n }\n }", "public function testEscape() {\n\t\t$string = 'Tom \"&/Or\" \\'Jerry\\' <[email protected]>';\n\t\t$expected = 'Tom &quot;&amp;&#x2F;Or&quot; &#x27;Jerry&#x27; &lt;[email protected]&gt;';\n\t\t$result = _::escape($string);\n\t\t$this->assertEquals($expected, $result);\n\n\t\t// test unescaping a string\n\t\t$result = _::escape($result, false);\n\t\t$this->assertEquals($string, $result);\n\t}", "abstract public function escapeString($value);", "public function escape($stringValue);", "public static function escapeString($val)\n {\n $toRepl = self::getReservedSymbols();\n \n $with = array();\n \n foreach($toRepl as $char)\n {\n $with[] = \"\\\\$char\";\n }\n\n return str_replace($toRepl, $with, $val);\n }", "public abstract function escapeString($value);", "public static function like(string $subject, string $pattern, bool $caseSensitivity = true): bool\n {\n if (!$caseSensitivity) {\n $subject = strtolower($subject);\n $pattern = strtolower($pattern);\n }\n $preparedPattern = str_replace('%', '.*', preg_quote($pattern, '/'));\n return (bool) preg_match(\"/^{$preparedPattern}$/\", $subject);\n }", "function pdo_escape_string($str, $link=NULL) {\r\n return pdo_real_escape_string($str, $link);\r\n }", "private function actionscriptEscape($text) {\n\t\t$needles = array('_','-','.');\n\t\t$replaces = array('%5F','%2D','%2E');\n\t\treturn str_replace($needles,$replaces,rawurlencode($text));\n\t}", "function specialChar($password)\n{\n $specialChars = array('!', '@', '#', '$', '%', '^', '&', '*', '(', ')');\n foreach ($specialChars as $char) {\n if (strpos($password, $char) != 0) {\n return true;\n }\n }\n return false;\n}", "public static function PregUnQuote($pattern)\n\t{\n\t\t// Fast check, because most parent pattern like 'DefaultProperties' don't need a replacement\n\t\tif (preg_match('/[^a-z\\s]/i', $pattern)) {\n\t\t\t// Undo the \\\\x replacement, that is a fix for \"Der gro\\xdfe BilderSauger 2.00u\" user agent match\n\t\t\t// @source https://github.com/browscap/browscap-php\n\t\t\t$pattern = preg_replace(\n\t\t\t\t['/(?<!\\\\\\\\)\\\\.\\\\*/', '/(?<!\\\\\\\\)\\\\./', '/(?<!\\\\\\\\)\\\\\\\\x/'],\n\t\t\t\t['\\\\*', '\\\\?', '\\\\x'],\n\t\t\t\t$pattern\n\t\t\t);\n\t\n\t\t\t// Undo preg_quote\n\t\t\t$pattern = str_replace(\n\t\t\t\t[\n\t\t\t\t\t'\\\\\\\\', '\\\\+', '\\\\*', '\\\\?', '\\\\[', '\\\\^', '\\\\]', '\\\\$', '\\\\(', '\\\\)', '\\\\{', '\\\\}', '\\\\=',\n\t\t\t\t\t'\\\\!', '\\\\<', '\\\\>', '\\\\|', '\\\\:', '\\\\-', '\\\\.', '\\\\/',\n\t\t\t\t],\n\t\t\t\t[\n\t\t\t\t\t'\\\\', '+', '*', '?', '[', '^', ']', '$', '(', ')', '{', '}', '=', '!', '<', '>', '|', ':',\n\t\t\t\t\t'-', '.', '/',\n\t\t\t\t],\n\t\t\t\t$pattern\n\t\t\t);\n\t\t}\n\t\n\t\treturn $pattern;\n\t}", "public function escape(string $str): string;", "private function checkPatternFilter(array $attributes, QueryBuilder $builder)\n {\n if (!array_key_exists('pattern', $attributes) || $attributes['pattern'] == null) {\n return;\n }\n\n $builder\n //->where('q.tags LIKE :pattern')\n ->where('q.title LIKE :pattern')\n ->orWhere('u.email LIKE :pattern')\n ->orWhere('u.name LIKE :pattern')\n ->orWhere('q.body LIKE :pattern')\n\n ->setParameter('pattern', \"%{$attributes['pattern']}%\")\n ;\n }", "function qescape($str)\n{\n $str = str_replace('\\\\', '\\\\\\\\', $str);\n return str_replace('\"', '\\\\\"', $str);\n}", "public function add_placeholder_escape($query)\n {\n }", "public function esc_like($text)\n {\n }", "static function escapeRegexReplacement($string)\n\t{\n\t\t$string = str_replace('\\\\', '\\\\\\\\', $string);\n\t\t$string = str_replace('$', '\\\\$', $string);\n\t\treturn $string;\n\t}", "function escapeString($string) {\nreturn preg_replace('/([\\,;])/','\\\\\\$1', $string);\n}", "function buildLikeClause($requestKey, $columnName, array &$params, array &$clauses) {\n if (isset($_GET[$requestKey])) {\n $val = trim($_GET[$requestKey]);\n if (strlen($val)) {\n $clauses[] = \"$columnName like concat('%', ?, '%')\";\n $params[] = addcslashes($val, '%_');\n }\n }\n}", "function filter( $str ){\r\n\t\treturn addslashes( $str );\r\n\t}", "function sqlite_escape_string($string)\n{\n $string = SQLite3::escapeString($string);\n $string = filter_var($string, FILTER_SANITIZE_STRING);\n return $string;\n}", "public static function specialchars($string) {\n $sanitized=array(\n '\\\\' => '\\5c',\n '*' => '\\2a',\n '(' => '\\28',\n ')' => '\\29',\n \"\\x00\" => '\\00');\n \n return str_replace(array_keys($sanitized),array_values($sanitized),$string);\n }" ]
[ "0.7615724", "0.6679104", "0.64715123", "0.6388895", "0.63864124", "0.6353176", "0.6335272", "0.631977", "0.6205899", "0.6171898", "0.6113325", "0.60980946", "0.6023556", "0.5989543", "0.5975944", "0.5967675", "0.5912313", "0.58984905", "0.57821065", "0.577939", "0.576991", "0.5763595", "0.57352304", "0.5732939", "0.5716451", "0.5695214", "0.5680009", "0.56583774", "0.5644973", "0.56354225", "0.55522555", "0.55522555", "0.5532044", "0.551565", "0.54936695", "0.54838395", "0.54746485", "0.5468881", "0.5465262", "0.5439909", "0.5430245", "0.54193896", "0.5418367", "0.5398898", "0.53953075", "0.5390893", "0.5389789", "0.53709763", "0.53573793", "0.5348481", "0.5340507", "0.53365785", "0.5327507", "0.5325217", "0.53251266", "0.5317707", "0.53070694", "0.5304899", "0.53047895", "0.53038377", "0.5299787", "0.5294489", "0.5275706", "0.5273137", "0.5268173", "0.52563256", "0.5235382", "0.52308375", "0.521317", "0.5197824", "0.5197824", "0.518931", "0.5179971", "0.51763284", "0.5174528", "0.5164934", "0.5139546", "0.5125057", "0.5103255", "0.5082768", "0.50691646", "0.506774", "0.50622565", "0.5057565", "0.5047161", "0.5041327", "0.50325245", "0.50305754", "0.50257236", "0.5019781", "0.5011049", "0.50066733", "0.5003435", "0.5003207", "0.50031865", "0.49971494", "0.49952096", "0.49929", "0.4990161", "0.49714157" ]
0.72575366
1
Escapes a field name string. Force all field names to be strictly alphanumericplusunderscore. For some database drivers, it may also wrap the field name in databasespecific escape characters.
public function escapeField($string);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function escapeField(string $field)\n {\n $field = trim($field);\n\n // do not backtick if a MySQL Function is called\n if (stripos($field, '(') !== false && stripos($field, ')') !== false) {\n return $field;\n }\n\n // do not backtick if a comma ', ' exists in the field\n if (stripos($field, ',') !== false) {\n return $field;\n }\n\n // do not backtick if a backtick '`' exists in the field\n if (stripos($field, '`') !== false) {\n return $field;\n }\n\n // split the field and alias if the field is aliased\n if (stripos($field, ' as ') != false) {\n list($field, $alias) = preg_split('/ as /i', $field);\n }\n\n if (stripos($field, '.') === false) {\n $field = '`' . $field . '`';\n } else {\n list($table, $field) = explode('.', $field);\n $field = '`' . $table . '`.`' . $field . '`';\n }\n\n if (isset($alias)) {\n $field = $field . ' as ' . $alias;\n }\n\n return $field;\n }", "public static function format_field_name(string $field_name)\n {\n }", "public static function SqlEscString($str)\n {\n try {\n $ret = str_replace([ '%', '_' ], [ '\\%', '\\_' ], DB::getPdo()->quote($str));\n return $ret && strlen($ret) >= 2 ? substr($ret, 1, strlen($ret)-2) : $ret;\n } catch (Exception $e) {\n return $str;\n }\n }", "public function testEscapeField() {\n\t\t$TestModel = new Test();\n\t\t$db = $TestModel->getDataSource();\n\n\t\t$result = $TestModel->escapeField('test_field');\n\t\t$expected = $db->name('Test.test_field');\n\t\t$this->assertEquals($expected, $result);\n\n\t\t$result = $TestModel->escapeField('TestField');\n\t\t$expected = $db->name('Test.TestField');\n\t\t$this->assertEquals($expected, $result);\n\n\t\t$result = $TestModel->escapeField('DomainHandle', 'Domain');\n\t\t$expected = $db->name('Domain.DomainHandle');\n\t\t$this->assertEquals($expected, $result);\n\n\t\tConnectionManager::create('mock', array('datasource' => 'DboMock'));\n\t\t$TestModel->setDataSource('mock');\n\t\t$db = $TestModel->getDataSource();\n\n\t\t$result = $TestModel->escapeField('DomainHandle', 'Domain');\n\t\t$expected = $db->name('Domain.DomainHandle');\n\t\t$this->assertEquals($expected, $result);\n\t\tConnectionManager::drop('mock');\n\t}", "public function EscapeString($argString, $argEscapeUnderscorePercentCharacters = false)\r\n {\r\n $this->checkDatabaseManager();\r\n $escapedString = $this->_DatabaseHandler->real_escape_string($argString);\r\n if($argEscapeUnderscorePercentCharacters)\r\n {\r\n $escapedString = addcslashes($escapedString, '%_');\r\n }\r\n return $escapedString;\r\n }", "function db_escape($input)\n{\n\tglobal $db;\n\treturn $db->real_escape_string($input);\n}", "function _fixName($field_or_value_name) {\r\n if ($field_or_value_name == \"\")\r\n return \"\";\r\n // convert space into underscore\r\n $result = preg_replace(\"/ /\", \"_\", strtolower($field_or_value_name));\r\n // strip all non alphanumeric chars\r\n $result = preg_replace(\"/\\W/\", \"\", $result);\r\n return $result;\r\n }", "function safe_name($name) {\n return preg_replace(\"/\\W/\", \"_\", $name);\n }", "public function escapeDbIdentifier($string)\n {\n $string = str_replace('`', '``', $string);\n if (preg_match('/[^a-z0-9_]+/i', $string) || in_array(strtoupper($string), $this->KEYWORDS)) {\n $string = \"`$string`\";\n }\n return $string;\n }", "function escape($str) {\n $str = get_magic_quotes_gpc()?stripslashes($str):$str;\n $str = $this->db->escape($str);\n return $str;\n }", "public function escField($key,$default_val = null){\n return new Escape($this->getField($key,$default_val));\n }", "abstract public function escape_string( $str );", "public function preventAddSlashes( $fields=array() );", "public static function prep($str = '', $field_name = '')\n {\n static $prepped_fields = array();\n\n // if the field name is an array we do this recursively\n if (is_array($str)) {\n foreach ($str as $key => $val) {\n $str[$key] = self::prep($val);\n }\n return $str;\n }\n\n if ($str === '') {\n return '';\n }\n\n // we've already prepped a field with this name\n // @todo need to figure out a way to namespace this so\n // that we know the *exact* field and not just one with\n // the same name\n if (isset($prepped_fields[$field_name])) {\n return $str;\n }\n\n $str = htmlspecialchars($str);\n\n // In case htmlspecialchars misses these.\n $str = str_replace(array(\"'\", '\"'), array(\"&#39;\", \"&quot;\"), $str);\n\n if ($field_name != '') {\n $prepped_fields[$field_name] = $field_name;\n }\n\n return $str;\n }", "public function escapeString($stringToEscape);", "public static function quote_name($key)\n {\n if (is_object($key))\n return '('.strval($key).')';\n\n if (preg_match('/^[a-zA-Z]+[a-zA-Z0-9_]*$/', $key))\n return sprintf('`%s`', trim($key));\n\n return trim($key);\n }", "function db_driver_escape($data)\n{\n global $_db;\n\n return '\\'' . str_replace('\\'', '\\'\\'', $data) . '\\'';\n}", "private function _prepareName($name)\n {\n return urlencode($name);\n\n }", "static public function real_escape_string($s) { return self::escape($s); }", "public abstract function escape($string);", "function make_fieldname_text($fieldname) {\n\t$fieldname=str_replace(\"_\", \" \",$fieldname);\n\t$fieldname=ucfirst($fieldname);\n\treturn $fieldname;\t\t\n}", "public function preventAddSlashes( $fields=array() )\n\t{\n\t\t$this->no_escape_fields = $fields;\n\t}", "function graphql_format_field_name($field_name)\n {\n }", "abstract public function escapeString($string);", "abstract protected function _escape($s);", "protected abstract function escape($string);", "function prepare_field($field)\n{\n return trim(preg_replace(\"/[<>&=%:'“]/i\", \"\", $field));\n}", "public function getDbFieldName($field_name);", "function removeSpecial($field)\n{\n\t$in_str = str_replace(array('<', '>', '&', '{', '}', '*', '/', '(', '[', ']', '@', '!', ')', '&', '*', '#', '$', '%', '^', '|', '?', '+', '=',\n\t\t'\"', ','), array(''), $field);\n\t$cur_encoding = mb_detect_encoding($in_str);\n\tif ($cur_encoding == 'UTF-8' && mb_check_encoding($in_str, 'UTF-8'))\n\t\t$name = $in_str;\n\telse\n\t\t$name = utf8_encode($in_str);\n\tif (!Validate::isName($name))\n\t{\n\t\t$len = Tools::strlen($name);\n\t\t$return_val = '';\n\t\tfor ($i = 0; $i < $len; $i++)\n\t\t{\n\t\t\tif (ctype_alpha($name[$i]))\n\t\t\t\t$return_val .= $name[$i];\n\t\t}\n\t\t$name = $return_val;\n\t\tif (empty($name))\n\t\t{\n\t\t\t$letters = range('a', 'z');\n\t\t\tfor ($i = 0; $i < 5; $i++)\n\t\t\t\t$name .= $letters[rand(0, 26)];\n\t\t}\n\t}\n\treturn $name;\n}", "private function escapeColumn($name)\n {\n if (strpos($name, '.') || strpos($name, '`') || strpos($name, ' ')) {\n return $name;\n }\n\n if ($name == '*') {\n return $name;\n }\n\n return '`'.$name.'`';\n }", "public function quoteAndEscape(string $str): string;", "function esc_like($text)\n{\n return addcslashes($text, '_%\\\\');\n}", "function sqlFormatField($field)\n\t{\n\t\tif(is_string($field))\n\t\t{\n $f=addslashes($field);\n\t\t\treturn \"'\" . $f . \"'\";\n\t\t}\n\t\tif(is_numeric($field))\n\t\t{\n\t\t\treturn $field;\n\t\t}\n\t\telseif(empty($field))\n\t\t{\n\t\t\treturn \"null\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn \"'\" . $field . \"'\";\n\t\t}\n\t}", "public function escape($string);", "public function escape($string);", "function quote_field($sql, $fieldname, $fieldvalue){\r\n\t\t$rs = $this->select_limit($sql, 1, 1);\r\n $fm_type = $this->field_metatype($rs, $this->field_index($rs, str_replace('`', '', $fieldname)));\r\n\t\tswitch ($fm_type) {\r\n\t\t\tcase 'I':\r\n\t\t\tcase 'N':\r\n\t\t\tcase 'R':\r\n\t\t\tcase 'L':\r\n\t\t\t\t$qstr = $fieldname .\"=\". $fieldvalue; \r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\t$qstr = $fieldname .\"='\". $fieldvalue .\"'\"; \r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t\t\r\n\t\treturn $qstr;\r\n\t}", "function field2name($field) {\n return str_replace(\n array('_a', '_b', '_c', '_d', '_e', '_f', '_g', '_h', '_i', '_j', '_k', '_l', '_m', '_n', '_o', '_p', '_q', '_r', '_s', '_t', '_u', '_v', '_w', '_x', '_y', '_z'), array('A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'), lcfirst($field)\n );\n}", "function escaped_str($string)\n{\n $safe_string = Database::getInstance()->getConnection()->real_escape_string($string);\n return $safe_string;\n}", "public function sql_escape_string($str) {\n return @mysql_escape_string($str);\n }", "abstract public function escapeStr($str, $like = false);", "public function escapeString($string);", "public function setDBColName(string $field): self\r\n {\r\n $this->field = trim($field);\r\n return $this;\r\n }", "function esc(String $value){\n\t// bring the global db connect object into function\n\tglobal $connection;\n\t// remove empty space sorrounding string\n\t$val = trim($value); \n\t$val = mysqli_real_escape_string($connection, $value);\n\treturn $val;\n}", "public function escape($str)\n {\n if ($str == '') {\n return '';\n }\n\n if (function_exists('db2_escape_string')) {\n $str = db2_escape_string($str);\n } else {\n $str = addslashes($str);\n }\n\n return trim($str);\n }", "public function insertEscaped(...$field_values);", "public function getEscapedString(string $str) {\n return $this->dbConnection->real_escape_string($str);\n }", "function MakeSafeString ($str) {\n\tif ($str == null) return $str;\n\treturn str_replace(\"'\", '_', str_replace('\"', '_', str_replace('`', '_', $str)));\n}", "function sanitize_name( $name ) {\r\n\t\t$name = sanitize_title( $name ); // taken from WP's wp-includes/functions-formatting.php\r\n\t\t$name = str_replace( '-', '_', $name );\r\n\r\n\t\treturn $name;\r\n\t}", "protected function backtickAlias($fields) {\n\t\treturn preg_replace('/\\b(\\w+)\\./i', '`${1}`.',$fields);\n\t}", "protected static function nameprep($text)\n {\n }", "function mysqli_fake_escape_string($input) { return $input; }", "protected function adjustFields(){\n\t\tforeach($this->fields as $key => $field)\n\t\t{\n\t\t\t$this->fields[$key] = sprintf(\"`%s`\", $field);\n\t\t}\n\t\treturn join(FuriousExpressionsDB::FieldSeparator, $this->fields);\n\t}", "public function escape(string $str): string;", "public function name($name)\n\t{\n\t\t$open = reset($this->_quotes);\n\t\t$close = next($this->_quotes);\n\n\t\tlist($first, $second) = $this->_splitFieldname($name);\n\t\tif ($first) {\n\t\t\treturn \"{$open}{$first}{$close}.{$open}{$second}{$close}\";\n\t\t}\n\t\treturn preg_match('/^[a-z0-9_-]+$/i', $name) ? \"{$open}{$name}{$close}\" : $name;\n\t}", "static function formatName($name){\n return htmlspecialchars($name);\n }", "protected static function getBindName($field)\n {\n return \"{$field}\";\n }", "function esc(String $value){\n global $conn;\n $val = trim($value); // remove empty space sorrounding string\n $val = mysqli_real_escape_string($conn, $value);\n return $val;\n }", "function bfa_escape($string) {\r\n\t$string = str_replace('\"', '&#34;', $string);\r\n\t$string = str_replace(\"'\", '&#39;', $string);\r\n\treturn $string;\r\n}", "public function esc($string)\n {\n return $this->mysqli->real_escape_string($string);\n }", "protected function escape($value): string\n {\n $value = strtr(\n $value,\n [\n '%' => '\\%',\n '_' => '\\_',\n '\\\\' => '\\\\\\\\',\n ]\n );\n\n return '%' . $value . '%';\n }", "public function escapeString($s)\r\n {\r\n return @mysql_real_escape_string(str_replace('`', '\\`', stripslashes($s)));\r\n }", "public abstract function escapeIdentifier($identifier);", "public function escapeLike($string);", "function sqlite_escape_string($string)\n{\n $string = SQLite3::escapeString($string);\n $string = filter_var($string, FILTER_SANITIZE_STRING);\n return $string;\n}", "static public function Escape($var, $db='mysql') {\r\n\r\n\t\tif (get_magic_quotes_gpc()) $var = stripslashes($var);\r\n\r\n\t\tswitch(strtolower($db)) {\r\n\t\t\tcase 'mysql': return mysqli_real_escape_string($var);\r\n\t\t\tcase 'postgresql':\r\n\t\t\tcase 'postgre': return pg_escape_string($var);\r\n\t\t\tdefault: return addslashes($var);\r\n\t\t}\r\n\r\n\t}", "public static function safeName($name) {\n\t\t\tif(!preg_match('/^[A-Z_][\\.A-Z0-9_]*$/i', $name)){\n\t\t\t\t$pieces = explode('.', $name);\n\t\t\t\tforeach($pieces as $i => $piece) {\n\t\t\t\t\t$pieces[$i] = '`'. str_replace('`', '``', $piece) . '`';\n\t\t\t\t}\n\t\t\t\treturn implode('.', $pieces);\n\t\t\t} else {\n\t\t\t\treturn $name;\n\t\t\t}\n\t\t}", "function _escapeString($str)\n {\n return strtr($str,array(\n \"\\r\" => '\\r',\n \"\\n\" => '\\n',\n \"\\t\" => '\\t',\n \"'\" => \"\\\\'\",\n '\"' => '\\\"',\n '\\\\' => '\\\\\\\\'\n ));\n }", "protected function db_escape($string)\n {\n return mysqli_real_escape_string($this->db, $string);\n }", "public function Escape($text) {\n if ($GLOBALS['app']['dbEncoding'] && !is_numeric($text)) {\n return base64_encode($text);\n }\n return addslashes($text);\n }", "protected function escape(string $str)\n {\n // If there is no existing database connection then try to connect\n if ( ! isset($this->dbh) || ! $this->dbh )\n {\n $this->connect($this->dbuser, $this->dbpassword, $this->dbhost, $this->dbport);\n $this->select($this->dbname, $this->encoding);\n }\n\n if ( get_magic_quotes_gpc() ) {\n $str = stripslashes($str);\n }\n\n return $this->dbh->escape_string($str);\n }", "function dbEscape($string) {\n\t$db = dbConn();\n\treturn(mysqli_real_escape_string($db,$string));\n}", "static public function escape ( $str )\n\t{\n\t\treturn trim(self::instance(0)->quote($str), '\\'');\n\t}", "function name2field($name) {\n return str_replace(\n array('A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'), array('_a', '_b', '_c', '_d', '_e', '_f', '_g', '_h', '_i', '_j', '_k', '_l', '_m', '_n', '_o', '_p', '_q', '_r', '_s', '_t', '_u', '_v', '_w', '_x', '_y', '_z'), lcfirst($name)\n );\n}", "function escape($_str) {\n\t\treturn str_replace('\"', '&quot;', $_str);\n\t}", "function wikiArticleNameEncode($articlename)\n\t{\n\t\t$articlename = str_replace(' ','_',$articlename);\n\t\t\n\t\treturn ($articlename);\n\t}", "public function prep($str = '', $field = '')\n {\n static $preppedFields = array();\n\n if (is_array($str)) { // If the field name is an array we do this recursively\n foreach ($str as $key => $val) {\n $str[$key] = $this->prep($val);\n }\n return $str;\n }\n if ($str === '') {\n return '';\n }\n if (isset($preppedFields[$field])) { // We've already prepped a field with this name\n return $str;\n }\n $str = htmlspecialchars($str, ENT_QUOTES, $this->charset, false);\n if ($field != '') {\n $preppedFields[$field] = $field;\n }\n return $str;\n }", "function sanitiseString($strField)\n{\n\t$strOut = filter_var($strField, FILTER_SANITIZE_STRING);\n\treturn $strOut;\n}", "function escapeString($string) {\r\n\treturn \\wcf\\system\\WCF::getDB()->escapeString($string);\r\n}", "public abstract function escapeString($value);", "private function _fieldNameToCamelCase($field) {\n $field_parts = explode('_', $field);\n $out = '';\n foreach ($field_parts as $part) {\n $out .= ucfirst($part);\n }\n return $out;\n }", "protected function escapeLike(string $str): string {\n return addcslashes($str, '_%');\n }", "function qescape($str)\n{\n $str = str_replace('\\\\', '\\\\\\\\', $str);\n return str_replace('\"', '\\\\\"', $str);\n}", "function escape($string)\n\t{\n\t\tswitch($this->dbtype)\n\t\t{\n\t\t\tcase 'mysql':\n\t\t\t\treturn @mysql_escape_string($string);\n\t\t\t\tbreak;\n\n\t\t\tcase 'mysqli':\n\t\t\t\treturn @mysqli_escape_string($string);\n\t\t\t\tbreak;\n\t\t}\n\n\t}", "protected static function _escapeChar($matches) {}", "abstract public function escapeString($value);", "function dbescape($str) {\r\n\tglobal $msq;\r\n\treturn mysqli_real_escape_string($msq, $str);\r\n}", "function escape_string($string) {\r\n\t\tglobal $db;\r\n\t\t\r\n\t\t$escaped_string = mysqli_real_escape_string($db, $string);\r\n\t\treturn $escaped_string;\r\n\t}", "function db_escape($connection, $string) {\n return mysqli_real_escape_string($connection, $string);\n}", "private function makeEscapedString() {\n\t\t# -- so, call this function after makeConnection() called -- #\n\t\t\n\t\ttry {\n\t\t\t$this->_code = $this->_mysqli->real_escape_string($this->_code);\n\t\t\t$this->_name = $this->_mysqli->real_escape_string($this->_name);\n\t\t\t$this->_description = $this->_mysqli->real_escape_string($this->_description);\n\t\t\t$this->_color = $this->_mysqli->real_escape_string($this->_color);\n\t\t}\n\t\tcatch (Exception $e) {\n\t\t\t# do nothing\n\t\t}\n\t\t\n\t}", "public static function escape($s) {}", "public static function escapeSql($str)\n {\n return StringUtils::replace($str, '\\'', '\\'\\'');\n }", "public function escape_string($string) {\n $escaped_string = $this->connection->real_escape_string($string);\n return $escaped_string;\n }", "private function _escape_filename($filename)\n {\n return str_replace('/', '', $filename);\n }", "public function getAllowedCharsInNamePattern() {\n //alphanums, underscores and dash\n return 'a-zA-Z0-9_.-';\n }", "public function escape_string($string) {\n $escaped_string = $this->connection->real_escape_string($string);\n return $escaped_string;\n }", "public function escape(string $str): string\n {\n $escaped = \"\\\\\";\n if ($this->stringQuotingCharacter !== $escaped) {\n $escaped .= $this->stringQuotingCharacter;\n }\n return addcslashes($str, $escaped);\n }", "public function escapeBrandName(string $brandName): string\n {\n return str_replace(\" \", \"\", $brandName);\n }", "public function quoteAndEscape(string $str): string\n {\n return $this->stringQuotingCharacter . $this->escape($str) . $this->stringQuotingCharacter;\n }", "public function escapeIdentifier($identifier){ }", "function MCW_make_name_acceptable($name) {\n \n $name = strtr($name,\" \",\"_\");\n $name=preg_replace(\"/[^a-zA-Z0-9_äöüÄÖÜ]/\" , \"\" , $name);\n return $name;\n }" ]
[ "0.66678315", "0.63153297", "0.63135165", "0.62421423", "0.62020165", "0.598713", "0.59577703", "0.5862742", "0.5858427", "0.58363247", "0.57445717", "0.5736223", "0.56559825", "0.56531894", "0.5618645", "0.56140554", "0.5601697", "0.5594234", "0.5554159", "0.5548157", "0.55473155", "0.554646", "0.55443895", "0.5517067", "0.5479627", "0.54761523", "0.5457091", "0.54532266", "0.54529893", "0.5445472", "0.54454714", "0.54404736", "0.5439293", "0.5437147", "0.5437147", "0.54252255", "0.54197794", "0.54140925", "0.5413951", "0.54112536", "0.54104084", "0.53959805", "0.5359759", "0.53357023", "0.5332221", "0.53293794", "0.53278804", "0.5326626", "0.5325655", "0.53209966", "0.53198737", "0.53171027", "0.5312622", "0.5307801", "0.5288241", "0.528496", "0.5269771", "0.52498585", "0.524293", "0.52422166", "0.5231259", "0.52209616", "0.52015984", "0.51994634", "0.5195801", "0.5194246", "0.5191587", "0.5184969", "0.5184444", "0.5179079", "0.5171202", "0.51656926", "0.51611197", "0.51607305", "0.5156427", "0.5149398", "0.51430285", "0.51388395", "0.5138836", "0.51387966", "0.51357275", "0.51271105", "0.51236176", "0.5122706", "0.51210815", "0.5117286", "0.5114072", "0.5109836", "0.51078045", "0.5101181", "0.51006234", "0.50908005", "0.50905037", "0.5085593", "0.50830925", "0.50808847", "0.50690114", "0.50566655", "0.5052744", "0.5050548" ]
0.7223695
0
Compiles and returns an associative array of the arguments for this prepared statement.
public function getArguments(PlaceholderInterface $queryPlaceholder = NULL);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function compile()\r\n\t{\r\n\t\t// We assume that if the column is compiled, its loaded.\r\n\t\t$this->_loaded = TRUE;\r\n\t\t\r\n\t\t// Bring everything together and return the array\r\n\t\treturn array(\r\n\t\t\t'name' => $this->name,\r\n\t\t\t'datatype' => array($this->datatype => $this->_compile_parameters()),\r\n\t\t\t'constraints' => $this->_compile_constraints()\r\n\t\t);\r\n\t}", "protected function _compile_parameters()\r\n\t{\r\n\t\t// Return the column's parameters\r\n\t\treturn $this->parameters;\r\n\t}", "public function get_compiled_sql()\n {\n $sql = $this->compile();\n $this->reset();\n return $sql;\n }", "private function compileParameters()\n {\n $params = [\n 'queueName' => property_exists($this, 'queueName') ? $this->queueName : null,\n 'exchangeName' => property_exists($this, 'exchangeName') ? $this->exchangeName : null,\n 'exchangeType' => property_exists($this, 'exchangeType') ? $this->exchangeType : null,\n 'passive' => property_exists($this, 'passive') ? $this->passive : null,\n 'durable' => property_exists($this, 'durable') ? $this->durable : null,\n 'autoDelete' => property_exists($this, 'autoDelete') ? $this->autoDelete : null,\n 'deliveryMode' => property_exists($this, 'deliveryMode') ? $this->deliveryMode : null,\n ];\n\n return array_filter($params);\n }", "protected function prepareArguments()\n {\n if ($this->type != 'enum') {\n return $this->arguments;\n }\n\n $arguments = array_map(function ($arg) {\n return '\\'' . $arg . '\\'';\n }, $this->arguments);\n\n return [\n '[' . join(',', $arguments) . ']'\n ];\n }", "public function getArgsArray(){\n\t\t$this->prepareArgs();\n\t\treturn $this->argsArray;\n\t}", "protected function _compile_constraints()\r\n\t{\r\n\t\t// Prepare the constraints array\r\n\t\t$constraints = array();\r\n\t\t\r\n\t\t// Compile the not null constraint\r\n\t\tif( ! $this->is_nullable)\r\n\t\t{\r\n\t\t\t$constraints[] = 'not null';\r\n\t\t}\r\n\t\t\r\n\t\t// Compile the default constraint\r\n\t\tif(isset($this->default) AND ( ! is_null($this->default) AND $this->default != ''))\r\n\t\t{\r\n\t\t\t$constraints['default'] = $this->table->database->quote($this->default);\r\n\t\t}\r\n\t\t\r\n\t\t// Return the constraints array\r\n\t\treturn $constraints;\r\n\t}", "function get_args( array $consts, array $vars ){\n\t\t$args = array();\n\t\t// limit depth of search to avoid collecting nested func calls\n\t\t$argnodes = $this->get_nodes_by_symbol( NT_ARG, 3 );\n\t\tforeach( $argnodes as $i => $arg ){\n\t\t\t$args[] = $arg->compile_string( $consts, $vars );\n\t\t}\n\t\treturn $args;\n\t}", "protected function getStatementStructure()\n {\n return [\n 'statement',\n 'optimizer',\n 'table',\n '(',\n 'fields',\n self::VALUES_DELIMITER,\n 'keys',\n ')',\n 'engine',\n 'charset',\n 'collate',\n ];\n }", "public function compile()\n {\n // 如果不是通过query执行的SQL,下面执行拼凑\n if ( empty($this->_sql)) \n {\n switch ($this->_type) \n {\n case db::SELECT:\n $this->_sql = $this->get_compiled_select();\n break;\n case db::INSERT:\n $this->_sql = $this->get_compiled_insert();\n break;\n case db::UPDATE:\n $this->_sql = $this->get_compiled_update();\n break;\n case db::DELETE:\n $this->_sql = $this->get_compiled_delete();\n break;\n default:\n break;\n }\n }\n \n // function bind()、param()、parameters()\n if ( ! empty($this->_parameters))\n {\n // Quote all of the values\n $values = array_map(array($this, 'quote'), $this->_parameters);\n\n // Replace the values in the SQL\n $this->_sql = $this->tr($this->_sql, $values);\n }\n\n if ( $this->_as_row || $this->_as_field ) \n {\n if (!preg_match(\"/limit/i\", $this->_sql))\n {\n $this->_sql = preg_replace(\"/[,;]$/i\", '', trim($this->_sql)) . \" LIMIT 1 \";\n }\n\n if( !empty($this->_atts['lock']) )\n {\n $this->_atts['lock'] = false;//用过一次后释放\n $this->_sql .= \" FOR UPDATE\";\n }\n else if( !empty($this->_atts['share']) )\n {\n $this->_atts['share'] = false;//用过一次后释放\n $this->_sql .= \" LOCK IN SHARE MODE\";\n }\n }\n\n //兼容字段中有复杂计算不替换#PB#的情况\n $this->_sql = $this->table_prefix($this->_sql);\n static::log_query($this->_sql);\n return $this->_sql;\n }", "public function compile()\n {\n $aOut = [];\n foreach ($this->aTriggers as $mTrigger) {\n if ($mTrigger instanceof self) {\n $aOut = array_merge($aOut, $mTrigger->compile());\n } else {\n $aOut[] = $mTrigger->compile();\n }\n }\n\n return $aOut;\n }", "function getParamaters() {\n\t\treturn $this->preparedvalues;\n\t}", "public function getAssembledParams()\r\n {\r\n return array();\r\n }", "private function ExtractParameters(){\n $pattern = '/:[A-z0-9]*/'; // Parameter format.\n $matches = null;\n\n // Return all matches\n preg_match_all($pattern, $this->sqlStatement, $matches);\n\n return $matches;\n }", "protected function compileParameterNames()\n {\n preg_match_all('/\\{(.*?)\\}/', $this->getDomain() . $this->uri, $matches);\n\n return array_map(function ($m) {\n return trim($m, '?');\n }, $matches[1]);\n }", "#[Pure] public function getParameters(): array\n {\n $array = [];\n foreach ($this->parameters as $name => $parameter) {\n $array[$this->dbc->makeParameterLabel($name)] = $parameter;\n }\n return $array;\n }", "protected function _prep_args() {\n\t\t// this is the data prepared for binding.\n\t\t// these fields are ordered as they are in the table\n\t\t$args = array(\n\t\t\t'the_id' => $this->id,\n\t\t\t'date_created' => $this->date_created,\n\t\t\t'completed' => $this->completed,\n\t\t\t'template_id' => $this->template_id,\n\t\t);\n\n\t\treturn $args;\n\t}", "public function getSqlPreparedValues()\n {\n return $this->sqlPreparedValues;\n }", "public function compile()\n {\n $compiled = $this->dumper()->getCompiledRoutes();\n /* This line is added in order to compile `conditions` into cache file. */\n $compiled[4] = $this->dumper()->getCompiledRoutes(true)[4];\n\n $attributes = [];\n\n foreach ($this->getRoutes() as $route) {\n $attributes[$route->getName()] = [\n 'methods' => $route->methods(),\n 'uri' => $route->uri(),\n 'action' => $route->getAction(),\n 'fallback' => $route->isFallback,\n 'defaults' => $route->defaults,\n 'wheres' => $route->wheres,\n 'bindingFields' => $route->bindingFields(),\n 'lockSeconds' => $route->locksFor(),\n 'waitSeconds' => $route->waitsFor(),\n 'withTrashed' => $route->allowsTrashedBindings(),\n ];\n }\n\n return compact('compiled', 'attributes');\n }", "public function execute(): array\n {\n if (!$this->table) {\n return Array();\n }\n $where = $this->getWhere();\n\n $this->statement($where);\n $this->statement($this->order);\n $this->statement($this->limit);\n \n $query = $this->prepare();\n \n if ($query) {\n try {\n $query->execute();\n\n return $query->fetchAll();\n } catch (\\PDOException $e) {\n $this->mydatabase->handleError($e, \"SELECT-EXECUTE\", $this->statement);\n }\n }\n \n return Array();\n }", "function execute_params($sql, $param_array)\n\t{\n\t\t// Using an empty string as stmtname here overwrites any\n\t\t// previous prepared statement making multiple prepares\n\t\t// easily doable\n\t\t$q = pg_prepare($this->connection, '', $sql);\n\t\t$q = pg_execute($this->connection, '', $param_array);\n\t\t$rows = array();\n while($r = pg_fetch_array($q, null, PGSQL_ASSOC))\n {\n array_push($rows, $r);\n }\n\t\tpg_free_result($q);\n\n\t\treturn $rows;\n\t}", "public function asArray()\n {\n return $this->compile();\n }", "public function arguments(): array\n {\n return $this->arguments;\n }", "protected function getArguments() {\n\t\treturn array(\n\t\t);\n\t}", "protected function getArguments()\n\t{\n\t\treturn array(\n\t\t\t\n\t\t);\n\t}", "protected function getArguments()\n\t{\n\t\treturn array(\n\t\t\t\n\t\t);\n\t}", "protected function getArguments()\n\t{\n\t\treturn array(\n\t\t\t\n\t\t);\n\t}", "protected function getArguments()\n\t{\n\t\treturn array(\n\t\t\t\n\t\t);\n\t}", "protected function getArguments()\n\t{\n\t\treturn array(\n\t\t);\n\t}", "protected function getArguments()\n\t{\n\t\treturn array(\n\t\t);\n\t}", "protected function getArguments()\n\t{\n\t\treturn array(\n\t\t);\n\t}", "protected function getArguments()\n\t{\n\t\treturn array(\n\t\t);\n\t}", "protected function getArguments()\n\t{\n\t\treturn array(\n\t\t);\n\t}", "protected function getArguments()\n\t{\n\t\treturn array(\n\t\t);\n\t}", "protected function getArguments()\n\t{\n\t\treturn array(\n\t\t);\n\t}", "public function prepare()\n {\n // Define column parameters\n $columns = func_get_args();\n if (!empty($columns)){\n\n // clear current parameters\n unset($this->parameters);\n $this->parameters = array();\n foreach ($columns as $column) {\n $this->parameters[$column] = null;\n } \n }\n\n // build query\n parent::prepare(); \n return $this;\n }", "private function getTemplateArgs(): array\n {\n $envelope_id= isset($_SESSION['envelope_id']) ? $_SESSION['envelope_id'] : false;\n $envelope_documents = isset($_SESSION['envelope_documents']) ? $_SESSION['envelope_documents'] : false;\n $document_id = preg_replace('/([^\\w \\-\\@\\.\\,])+/', '', $_POST['document_id' ]);\n $args = [\n 'account_id' => $_SESSION['ds_account_id'],\n 'base_path' => $_SESSION['ds_base_path'],\n 'ds_access_token' => $_SESSION['ds_access_token'],\n 'envelope_id' => $envelope_id,\n 'document_id' => $document_id,\n 'envelope_documents' => $envelope_documents\n ];\n\n return $args;\n }", "protected function prepare( $sql, $func = 'DatabaseBase::prepare' ) {\n\t\t/* MySQL doesn't support prepared statements (yet), so just\n\t\t * pack up the query for reference. We'll manually replace\n\t\t * the bits later.\n\t\t */\n\t\treturn array( 'query' => $sql, 'func' => $func );\n\t}", "protected function getArguments()\n\t{\n\t\treturn [\n\n\t\t];\n\t}", "protected function getArguments()\n\t{\n\t\treturn [\n\n\t\t];\n\t}", "protected function get_arguments(): array {\n\t\treturn [];\n\t}", "protected function preparedPlaceholders(): array\n {\n $placeholders = [];\n foreach ($this->placeholders() as $placeholder => $var) {\n $placeholders['{{' . $placeholder . '}}'] = strpos($var, '--') !== 0 \n ? $this->arg($var) \n : $this->opt(substr($var, 0, 2));\n }\n\n return $placeholders;\n }", "public function compile()\n {\n if (!isset($this->class))\n {\n return $this->function;\n }\n\n if (is_string($this->class))\n {\n return $this->class . '::' . $this->function;\n }\n\n return array($this->class, $this->function);\n }", "public function getArguments(): array\n {\n return $this->_arguments;\n }", "protected function getArguments()\r\n\t{\r\n\t\treturn array();\r\n\t}", "protected function getArguments()\r\n\t{\r\n\t\treturn array();\r\n\t}", "public function getArguments(): array {\n return $this->arguments;\n }", "protected function getArguments()\n\t{\n\t\treturn [\n\t\t];\n\t}", "public function get_bound_variables() {\n $bound_variables = [];\n //odbc doesn't support named parameters, only numerically indexed ones\n //We go through the query string, find the named parameters\n $query_bound_variables = $this->query_bound_variables;\n#\t\t\tFB::log($query_bound_variables, 'named_parameters');\n foreach ($query_bound_variables as $index => $parameter) {\n $_bv = isset($this->bound_variables[$parameter]) ? $this->bound_variables[$parameter] : false;\n if (!$_bv) {\n $parameter_name = (string)$parameter;\n throw new PDOException(\"SQLSTATE[HY093]: Invalid parameter number: parameter {$parameter_name} was not defined\", (int)'HY093');\n }\n \n $data_type = $_bv[1];\n $_bv_value = $_bv[0];\n switch ($data_type) {\n case PDO::PARAM_BOOL:\n $value = !isset($_bv_value) ? null : (bool)$_bv_value ? 1 : 0;\n break;\n case PDO::PARAM_NULL:\n $value = null;\n break;\n case PDO::PARAM_INT:\n $value = (int)$_bv_value;\n break;\n case PDO::PARAM_STR:\n #todo todo todo todo todo todo todo: This probably is not adequate enough to prevent SQL injection\n $_bv_value = ODBC::ms_escape_string($_bv_value);\n $value = \"'{$_bv_value}'\";\n break;\n case PDO::PARAM_LOB:\n case PDO::PARAM_STMT:\n case PDO::PARAM_INPUT_OUTPUT:\n default:\n //Not sure what the default value should be\n $value = null;\n break;\n }\n \n $bound_variables[] = $value;\n }\n return $bound_variables;\n }", "public function getArguments(): array\n {\n return $this->arguments;\n }", "public function getArguments(): array\n {\n return $this->arguments;\n }", "public function getArguments(): array\n {\n return $this->arguments;\n }", "public function exec($prepared_values = null) {\n if (!empty($this->_parts['query'])) {\n $res = null;\n foreach($this->_parts['query'] as $one) {\n $res = $this->_connection->query($one);\n }\n $this->_parts['query'] = array();\n return $res;\n }\n return $this->_connection->processQuery($this);\n }", "protected function getArguments() {\n\t\treturn array();\n\t}", "protected function getArguments()\n\t{\n\t\treturn array();\n\t}", "protected function getArguments()\n\t{\n\t\treturn array();\n\t}", "protected function getArguments()\n\t{\n\t\treturn array();\n\t}", "protected function getArguments()\n\t{\n\t\treturn array();\n\t}", "protected function getArguments()\n\t{\n\t\treturn array();\n\t}", "protected function getArguments()\n\t{\n\t\treturn array();\n\t}", "protected function getArguments()\n\t{\n\t\treturn array();\n\t}", "protected function getArguments()\n\t{\n\t\treturn array();\n\t}", "protected function getArguments()\n\t{\n\t\treturn array();\n\t}", "protected function getArguments()\n\t{\n\t\treturn array();\n\t}", "protected function getArguments()\n\t{\n\t\treturn array();\n\t}", "protected function getArguments()\n\t{\n\t\treturn array();\n\t}", "function _getSQL(){\n\t\tif ( !isset($this->sql) ){\n\t\t\t$compiler =& $this->_getCompiler();\n\t\t\t$this->sql = $compiler->compile($this->sql_data);\n\t\t}\n\t\treturn $this->sql;\n\t}", "public function Prepare(){\n $connection = $this->Connection();\n $databaseQuery = $connection->prepare($this->sqlStatement);\n\n $connection->beginTransaction();\n\n $parameterNames = $this->ExtractParameters();\n\n // Binding values as necessary\n for($i = 0; $i < count($this->parameter); $i++) {\n $databaseQuery->bindValue($parameterNames[0][$i], $this->parameter[$i]);\n }\n\n // Creating database array\n $databaseObj['connection'] = $connection;\n $databaseObj['databaseQuery'] = $databaseQuery;\n return $databaseObj;\n }", "protected function getArguments()\n {\n return array(\n );\n }", "public function getArguments()\n {\n $args = $this->getArgs();\n $this->arguments = array();\n if (empty($this->arguments) && !empty($args) && count($args) > 0) {\n $this->arguments = array();\n $cls_name = $this->getClassName();\n $fct_name = $this->getFunctionName();\n\n if (\n empty($cls_name) &&\n !empty($fct_name) &&\n in_array($fct_name, self::$not_real_fcts)\n ) {\n return $this->arguments;\n }\n\n $methodReflect = $this->getFunction();\n if (!empty($methodReflect)) {\n $argumentsReflect = $methodReflect->getParameters();\n foreach ($this->getArgs() as $index => $value) {\n $ghost = false;\n if (isset($argumentsReflect[$index])) {\n $paramReflect = $argumentsReflect[$index];\n } else {\n $ghost = create_function('$param', 'return true;');\n $paramReflect = new \\ReflectionParameter($ghost, 'param');\n }\n if ($ghost!==false) {\n $this->arguments[$index] = new ReflectionParameterValue(\n $ghost, $paramReflect->getName(), $value\n );\n } elseif (!empty($cls_name)) {\n $this->arguments[$index] = new ReflectionParameterValue(\n array($cls_name, $fct_name), $paramReflect->getName(), $value\n );\n } else {\n $this->arguments[$index] = new ReflectionParameterValue(\n $fct_name, $paramReflect->getName(), $value\n );\n }\n }\n }\n }\n return $this->arguments;\n }", "public function arguments(): array;", "static function preparedSql (String $query, array $arguments): String {\n $statement = \"SET @query = '$query';\" .\n \"PREPARE stmt1 FROM @query;\";\n\n $alphabet = 'abcdefghijklmnopqrstuvwxyz';\n $varNames = [];\n foreach ($arguments as $i => $arg) {\n $varName = \"@$i\";\n array_push($varNames, $varName);\n $statement .= \"SET $varName = \";\n switch (gettype($arg)) {\n case \"string\":\n $statement .= \"'$arg'\";\n break;\n default:\n $statement .= $arg;\n }\n $statement .= \";\";\n }\n\n $statement .= \"EXECUTE stmt1 USING \" . join(', ', $varNames) . ';';\n $statement .= \"DEALLOCATE PREPARE stmt1;\";\n return $statement;\n }", "protected function getAllArgs()\n {\n $this->methodExpectsRequest(__METHOD__);\n $params = [];\n foreach ($this->getRequest()->getAllArgs() as $index => $value) {\n if (isset($this->argument_position_name[$index])) {\n $param_name = $this->argument_position_name[$index];\n $params[$param_name] = $value;\n }\n }\n return $params;\n }", "private function getTemplateArgs(): array\n {\n $starting_view = preg_replace('/([^\\w \\-\\@\\.\\,])+/', '', $_POST['starting_view']);\n $envelope_id= isset($_SESSION['envelope_id']) ? $_SESSION['envelope_id'] : false;\n $args = [\n 'envelope_id' => $envelope_id,\n 'account_id' => $_SESSION['ds_account_id'],\n 'base_path' => $_SESSION['ds_base_path'],\n 'ds_access_token' => $_SESSION['ds_access_token'],\n 'starting_view' => $starting_view,\n 'ds_return_url' => $GLOBALS['app_url'] . 'index.php?page=ds_return'\n ];\n\n return $args;\n }", "private function getPrepared()\n {\n $array = $this->ToArray();\n unset($array['currentPage']);\n unset($array['pageCount']);\n unset($array['errors']);\n unset($array['insert']);\n unset($array['table']);\n unset($array['Adapter']);\n unset($array['pdoFetch']);\n unset($array['cmsFetchMode']);\n unset($array[$this->primaryName]);\n unset($array['primaryName']);\n $prepared['update'] = '';\n foreach($array as $k=>$v)\n {\n $prepared['values'][':'.$k] = $v;\n $prepared['update'] .= '`'.$k.'`'.\"=\".':'.$k.',';\n }\n if ($prepared['update']{strlen($prepared['update'])-1} == ',')\n {\n $prepared['update'] = substr($prepared['update'],0,-1);\n }\n $prepared['set'] = implode(', ', array_keys($array));\n return $prepared;\n }", "protected function getStatementParts(/**\n * The queryParser will preparse the query to get the query's hash and parameters.\n * If the hash is found in the cache and useQueryCaching is enabled, extbase will\n * then take the string representation from cache and build a prepared query with\n * the parameters found.\n *\n * Otherwise extbase will parse the complete query, build the string representation\n * and run a usual query.\n */\n$query, /**\n * The queryParser will preparse the query to get the query's hash and parameters.\n * If the hash is found in the cache and useQueryCaching is enabled, extbase will\n * then take the string representation from cache and build a prepared query with\n * the parameters found.\n *\n * Otherwise extbase will parse the complete query, build the string representation\n * and run a usual query.\n */\n$resolveParameterPlaceholders = true) {}", "public function getPreparedParams(){\n\t\tthrow new Exception(\"Method \".__CLASS__.\"::\".__METHOD__.\" not implemented yet!\");\n\t}", "public function compile()\n {\n // set every condition in the query array\n $this->query['body']['query'] = [];\n foreach ($this->constraints as $constraint) {\n $this->query['body']['query'] = array_merge($this->query['body']['query'], $this->compileConstraint($constraint));\n }\n\n foreach ($this->bools as $bool) {\n if (array_key_exists('constraint', $bool)) {\n $this->query['body']['query']['bool'][$bool['type']][] = $this->compileConstraint($bool['constraint']);\n }\n if (array_key_exists('query_string', $bool)) {\n $this->query['body']['query']['bool'][$bool['type']][] = $bool['query_string'];\n }\n if (array_key_exists('script', $bool)) {\n $this->query['body']['query']['bool'][$bool['type']][] = $bool['script'];\n }\n if (array_key_exists('bool', $bool)) {\n $this->query['body']['query']['bool'][$bool['type']][] = array('bool' => $bool['bool']);\n }\n }\n if (!empty($this->aggs)) {\n $this->query['body']['aggs'] = $this->aggs;\n }\n if ($this->sort) {\n $this->query['body']['sort'] = $this->sort;\n }\n if ($this->scroll_param) {\n $this->query['scroll'] = $this->scroll_param;\n }\n if ($this->highlight) {\n $this->query['body']['highlight'] = $this->highlight;\n }\n if ($this->filter) {\n $this->query['body']['query']['bool']['filter'] = $this->filter;\n }\n if ($this->query_string) {\n $this->query['body']['query']['query_string'] = $this->query_string;\n }\n if ($this->script) {\n $this->query['body']['query']['script']['script'] = $this->script;\n }\n if ($this->fromType) {\n $this->query['type'] = $this->fromType;\n }\n if ($this->fromIndex) {\n $this->query['index'] = $this->fromIndex;\n } elseif (isset($this->model) && $this->model) {\n $this->query[\"index\"] = $this->model->getIndex();\n }\n return $this->query;\n }", "public function getConstructorArguments() {}", "public function params()\n\t{\n\t\t$r = array();\n\t\tforeach (func_get_args() as $name)\n\t\t\t$r[] = @$this->params[$name];\n\t\treturn $r;\n\t}", "public function toArray(): array\n {\n return $this->grammar->compileQuery($this);\n }", "public function get_compiled_select($reset = TRUE)\n {\n $quote_ident = array($this, 'quote_identifier');\n\n // Callback to quote tables\n $quote_table = array($this, 'quote_table');\n\n // Callback to quote tables\n $quote_field = array($this, 'quote_field');\n\n // Start a selection query\n $sql = 'SELECT ';\n\n if ($this->_distinct === TRUE)\n {\n // Select only unique results\n $sql .= 'DISTINCT ';\n }\n\n if (empty($this->_select))\n {\n // Select all columns\n $sql .= '*';\n }\n else\n {\n $sql .= implode(', ', array_unique(array_map($quote_field, $this->_select)));\n }\n\n if ( ! empty($this->_from))\n {\n // Set tables to select from\n $sql .= ' FROM '.implode(', ', array_unique(array_map($quote_table, $this->_from)));\n }\n\n if( !empty($this->_atts['index_name']) )\n {\n $sql .= ' FORCE INDEX('.$this->_atts['index_name'].')';\n $this->_atts['index_name'] = '';\n }\n\n if ( ! empty($this->_join))\n {\n // Add tables to join[$table]\n $sql .= ' '.$this->_compile_join($this->_join);\n }\n\n if ( ! empty($this->_where))\n {\n // Add selection conditions\n $sql .= ' WHERE '.$this->_compile_conditions($this->_where);\n }\n\n if ( ! empty($this->_group_by))\n {\n // Add sorting\n $sql .= ' GROUP BY '.implode(', ', array_map($quote_ident, $this->_group_by));\n }\n\n if ( ! empty($this->_having))\n {\n // Add filtering conditions\n $sql .= ' HAVING '.$this->_compile_conditions($this->_having);\n }\n\n if ( ! empty($this->_order_by))\n {\n // Add sorting\n $sql .= ' '.$this->_compile_order_by($this->_order_by);\n }\n\n if ( $this->_as_row || $this->_as_field ) \n {\n $this->_limit = 1; \n }\n\n if ($this->_limit !== NULL)\n {\n // Add limiting\n $sql .= ' LIMIT '.$this->_limit;\n }\n\n if ($this->_offset !== NULL)\n {\n // Add offsets\n $sql .= ' OFFSET '.$this->_offset;\n }\n\n if( !empty($this->_atts['lock']) && empty($this->_as_row) ) \n {\n $this->_atts['lock'] = false;//用过一次后释放\n $sql .= ' FOR UPDATE';\n }\n else if( !empty($this->_atts['share']) && empty($this->_as_row) ) \n {\n $this->_atts['share'] = false;//用过一次后释放\n $sql .= ' LOCK IN SHARE MODE';\n }\n\n return $sql;\n }", "public function compile() {\n\t\t$file = new CompiledFile();\n\t\treturn array($file);\n\t}", "protected function getArguments()\n {\n return [\n\n ];\n }", "protected function getArguments()\n {\n return [\n\n ];\n }", "private function parameters(): array\n {\n try {\n $reflection = new \\ReflectionClass($this->class);\n }\n\n catch (\\ReflectionException $e) {\n return [];\n }\n\n $constructor = $reflection->getConstructor();\n\n return is_null($constructor) ? [] : $constructor->getParameters();\n }", "protected function getArguments()\n {\n return array();\n }", "protected function getArguments()\n {\n return array();\n }", "protected function getArguments()\n {\n return array();\n }", "protected function getArguments()\n {\n return array();\n }", "protected function getArguments()\n {\n return array();\n }", "protected function getArguments()\n {\n return array();\n }", "private function getTemplateArgs(): array\n {\n $envelope_id= isset($_SESSION['envelope_id']) ? $_SESSION['envelope_id'] : false;\n $args = [\n 'account_id' => $_SESSION['ds_account_id'],\n 'base_path' => $_SESSION['ds_base_path'],\n 'ds_access_token' => $_SESSION['ds_access_token'],\n 'envelope_id' => $envelope_id\n ];\n\n return $args;\n }", "private function prepareStatement()\n {\n $columns = '';\n $fields = '';\n foreach ($this->fields as $key => $f) {\n if ($key == 0) {\n $columns .= \"$f\";\n $fields .= \":$f\";\n continue;\n }\n\n $columns .= \", $f\";\n $fields .= \", :$f\";\n }\n\n $this->statement = $this->pdo->prepare(\n 'INSERT INTO `' . $this->table . '` (' . $columns . ') VALUES (' . $fields . ')'\n );\n }", "protected function getArguments()\r\n\t{\r\n\t\treturn isset($this->arguments) ? $this->arguments : array();\r\n\t}", "public function debugDumpParams()\r\n\t{\r\n\t\tif(!is_resource($this->resource))\r\n\t\t{\r\n\t\t\tthrow new LikePDOException(\"There is no active statement\");\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$parameters = array();\r\n\t\t\t\r\n\t\t\tif(count($this->parametersBound) > 0)\r\n\t\t\t{\r\n\t\t\t\tforeach($this->parametersBound as $key => $param)\r\n\t\t\t\t{\r\n\t\t\t\t\tif(!isset($this->parameters[$key]))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$parameters[] = array\r\n\t\t\t\t\t\t(\r\n\t\t\t\t\t\t\t\"key\" => is_string($key) == true ? \"Name: [\".strlen($key).\"] \".$key : \"Position #\".$key,\r\n\t\t\t\t\t\t\t\"paramno\" => is_string($key) == true ? -1 : $key,\r\n\t\t\t\t\t\t\t\"name\" => is_string($key) == true ? \"[\".strlen($key).\"] \\\"\".$key.\"\\\"\" : \"[0] \\\"\\\"\",\r\n\t\t\t\t\t\t\t\"is_param\" => 1,\r\n\t\t\t\t\t\t\t\"param_type\" => $param['data_type']\r\n\t\t\t\t\t\t);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(count($this->parameters) > 0)\r\n\t\t\t{\r\n\t\t\t\tforeach($this->parameters as $key => $param)\r\n\t\t\t\t{\r\n\t\t\t\t\tif(!isset($this->parametersBound[$key]))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$parameters[] = array\r\n\t\t\t\t\t\t(\r\n\t\t\t\t\t\t\t\"key\" => is_string($key) == true ? \"Name: [\".strlen($key).\"] \".$key : \"Position #\".$key.\":\",\r\n\t\t\t\t\t\t\t\"paramno\" => is_string($key) == true ? -1 : $key,\r\n\t\t\t\t\t\t\t\"name\" => is_string($key) == true ? \"[\".strlen($key).\"] \\\"\".$key.\"\\\"\" : \"[0] \\\"\\\"\",\r\n\t\t\t\t\t\t\t\"is_param\" => 1,\r\n\t\t\t\t\t\t\t\"param_type\" => $param['data_type']\r\n\t\t\t\t\t\t);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tprintf(\"SQL: [%d] %s\".PHP_EOL.\"Params: %d\".PHP_EOL.PHP_EOL, strlen($this->queryString), $this->queryString, count($parameters));\r\n\t\t\t\r\n\t\t\tif(count($parameters) > 0)\r\n\t\t\t{\r\n\t\t\t\tforeach($parameters as $param)\r\n\t\t\t\t{\r\n\t\t\t\t\tprintf(\"Key: %s\".PHP_EOL, $param['key']);\r\n\t\t\t\t\tprintf(\"paramno=%d\".PHP_EOL, $param['paramno']);\r\n\t\t\t\t\tprintf(\"name=%s\".PHP_EOL, $param['name']);\r\n\t\t\t\t\tprintf(\"is_param=%d\".PHP_EOL, $param['is_param']);\r\n\t\t\t\t\tprintf(\"param_type=%d\".PHP_EOL, $param['param_type']);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}", "public function preparedExec(string $query, array $args) :array{\n static::getInstance();\n if($this->connection === null){\n return [\"error\" => \"Error with DB connection\"];\n }\n try{\n $stmt = $this->connection->prepare($query);\n $stmt->execute($args);\n return [];\n }\n catch(PDOException $e){\n return [\"error\" => $e->getMessage()];\n }\n }", "public function getClosureParams() : array {\n return $this->closureParams;\n }", "public function execute($bind_array);", "protected function getArguments()\n\t{\n\t\treturn [];\n\t}", "protected function getArguments()\n\t{\n\t\treturn [];\n\t}" ]
[ "0.68336827", "0.67588377", "0.6099495", "0.59512085", "0.5750824", "0.56238097", "0.56099963", "0.5569485", "0.5554021", "0.5526451", "0.5464415", "0.544518", "0.5402852", "0.5386359", "0.5385195", "0.5363937", "0.5353804", "0.5352009", "0.53272957", "0.53004515", "0.5267564", "0.5263401", "0.5262706", "0.5240319", "0.52339244", "0.52339244", "0.52339244", "0.52339244", "0.5209167", "0.5209167", "0.5209167", "0.5209167", "0.5209167", "0.5209167", "0.5209167", "0.5196383", "0.5191026", "0.51857126", "0.5183371", "0.5183371", "0.51702106", "0.5157249", "0.5155089", "0.51376295", "0.51362187", "0.51362187", "0.5128628", "0.5123698", "0.5123301", "0.51195645", "0.51195645", "0.51195645", "0.5117395", "0.51115274", "0.5111294", "0.5111294", "0.5111294", "0.5111294", "0.5111294", "0.5111294", "0.5111294", "0.5111294", "0.5111294", "0.5111294", "0.5111294", "0.5111294", "0.51076895", "0.5100153", "0.509748", "0.50818825", "0.5063414", "0.50629646", "0.50546515", "0.50485563", "0.50475293", "0.50113875", "0.50075966", "0.50038296", "0.4999938", "0.49985898", "0.49943224", "0.49942714", "0.49777886", "0.49775183", "0.49775183", "0.4971328", "0.49702418", "0.49702418", "0.49702418", "0.49702418", "0.49702418", "0.49702418", "0.49591863", "0.49584404", "0.49436384", "0.49358413", "0.49340507", "0.49313536", "0.49195477", "0.49185643", "0.49185643" ]
0.0
-1
/ Query building operations Sets this query to be DISTINCT.
public function distinct($distinct = TRUE);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function distinct(){\r\n\r\n if(starts_with($this->queryString, 'SELECT')){\r\n\r\n $this->queryString = str_replace(' <;distinct>', ' DISTINCT', $this->queryString);\r\n \r\n } \r\n return $this;\r\n }", "public function distinct()\r\n {\r\n $this->query->distinct();\r\n \r\n return $this;\r\n }", "public function distinct(): QueryBuilderInterface\n\t{\n\t\t// Prepend the keyword to the select string\n\t\t$this->state->setSelectString(' DISTINCT' . $this->state->getSelectString());\n\t\treturn $this;\n\t}", "public function distinct();", "public function distinct()\n\t{\n\t\t$this->distinct = true;\n\t\treturn $this;\n\t}", "public static function distinct();", "public function distinct()\n {\n $this->distinct = true;\n return $this;\n }", "public function distinct(): Base;", "public function enableDistinct() {\r\n $this->myCRUD()->enableDistinct();\r\n return $this;\r\n }", "public function distinct() {\n $this->distinctValues = true;\n return $this;\n }", "public function buildQuery()\n {\n if (!$this->query) {\n $this->query = $this->getMapper()->buildAssociationQuery($this);\n }\n\n return clone $this->query;\n }", "protected function _buildItemsQuery() {\n\n $query=\"SELECT b.id, b.title, b.alias, b.state, b.create_date, b.public_date, u.name AS author_name, c.title AS category_title, c.alias AS category_alias\n FROM `#__blog` AS b\n LEFT JOIN `#__categories` AS c\n ON b.category_id = c.id \n LEFT JOIN `#__users` AS u\n ON b.author_id = u.id\";\n\n return $query;\n\n }", "protected function _buildQuery()\r\n {\r\n \t\r\n $db = JFactory::getDBO();\r\n $query = $db->getQuery(TRUE);\r\n\r\n $query->select('proptype.ddcbookit_proptype_id, proptype.proptype_title, proptype.proptype_description');\r\n $query->from('#__ddcbookit_proptypes as proptype');\r\n return $query;\r\n \r\n }", "function _buildQuery()\n\t{\n\t\t$where\t\t= $this->_buildContentWhere();\n\t\t$orderby\t= $this->_buildContentOrderBy();\n\n\t\t$query = 'SELECT c.*, g.name AS groupname, cc.title as name, u.name AS editor, f.ordering AS fpordering, v.name AS author'\n\t\t\t. ' FROM #__content AS c'\n\t\t\t. ' LEFT JOIN #__categories AS cc ON cc.id = c.catid'\n\t\t\t. ' INNER JOIN #__content_frontpage AS f ON f.content_id = c.id'\n\t\t\t. ' LEFT JOIN #__users AS u ON u.id = c.checked_out'\n\t\t\t. ' LEFT JOIN #__users AS v ON v.id = c.created_by'\n\t\t\t. $where\n\t\t\t. $orderby\n\t\t;\n\n\t\treturn $query;\n\t}", "private function build_query_by_properties()\n {\n $l_sql = '';\n\n foreach ($this->m_view_properties as $l_category_type_id => $l_categories) {\n foreach ($l_categories as $l_category_id => $l_properties) {\n if (isset($l_properties['table'])) {\n $l_table = $l_properties['table'];\n $l_obj_field = $l_properties['obj_id'];\n\n $l_sql .= 'LEFT JOIN ' . $l_table . ' ON ' . $l_obj_field . ' = main.isys_obj__id ';\n\n if (isset($l_properties['join'])) {\n $l_sql .= $l_properties['join']['join_type'] . ' JOIN ' . $l_properties['join']['table'] . ' AS ' . $l_properties['join']['alias'] . ' ON ';\n $l_sql .= $l_properties['join']['join_field'] . ' = ' . $l_properties['join']['alias'] . '.' . $l_properties['join']['field'] . ' ';\n }\n\n foreach ($l_properties['properties'] as $l_property_key => $l_property_info) {\n $this->m_headers[$l_property_key] = $l_property_info;\n }\n\n if (isset($l_properties['helper'])) {\n foreach ($l_properties['helper'] as $l_field => $l_helper) {\n $this->m_helpers[$l_field] = $l_helper;\n }\n }\n } else {\n // Dynamic property.\n foreach ($l_properties['properties'] as $l_property_key => $l_property_info) {\n $this->m_dynamic_headers[$l_property_key] = $l_property_info;\n }\n\n if (isset($l_properties['helper'])) {\n foreach ($l_properties['helper'] as $l_field => $l_helper) {\n $this->m_helpers[$l_field] = $l_helper;\n }\n }\n }\n }\n }\n\n $l_selection = '*';\n\n if (count($this->m_headers) > 0) {\n $l_selection = '';\n foreach ($this->m_headers as $l_field_alias => $l_field) {\n $l_selection .= $l_field . ' AS ' . $l_field_alias . ',';\n }\n\n $l_selection = rtrim($l_selection, ',');\n }\n\n $this->m_headers = array_merge_recursive($this->m_headers, $this->m_dynamic_headers);\n\n $l_sql_main = 'SELECT ' . $l_selection . ', main.isys_obj__id AS __objid__ FROM isys_obj AS main ' .\n 'INNER JOIN isys_obj_type ON main.isys_obj__isys_obj_type__id = isys_obj_type__id ' . $l_sql;\n\n $this->m_sql = $l_sql_main;\n }", "public function _buildQuery()\n {\n $app = \\Cobalt\\Container::get('app');\n\n $this->db->setQuery(\"SET SQL_BIG_SELECTS=1\")->execute();\n\n $user = $this->_user;\n $team = $this->_team;\n $id = $this->_id;\n $type = $this->_type;\n $view = $app->input->get('view');\n\n if (!$id) {\n\n $session = $app->getSession();\n\n //determine whether we are searching for a team or user\n if ($user) {\n $session->set('company_team_filter', null);\n }\n if ($team) {\n $session->set('company_user_filter', null);\n }\n\n //set user session data\n if ($type != null) {\n $session->set('company_type_filter',$type);\n } else {\n $sess_type = $session->get('company_type_filter');\n $type = $sess_type;\n }\n if ($user != null) {\n $session->set('company_user_filter',$user);\n } else {\n $sess_user = $session->get('company_user_filter');\n $user = $sess_user;\n }\n if ($team != null) {\n $session->set('company_team_filter',$team);\n } else {\n $sess_team = $session->get('company_team_filter');\n $team = $sess_team;\n }\n\n }\n\n //generate query for base companies\n $query = $this->db->getQuery(true);\n $export = $app->input->get('export');\n\n if ($export) {\n\n $select_string = 'c.name,c.description,c.address_1,c.address_2,c.address_city,';\n $select_string .= 'c.address_state,c.address_zip,c.address_country,c.website,c.created,c.modified';\n\n $query\n ->select($select_string)\n ->from(\"#__companies as c\")\n ->leftJoin(\"#__users AS u on u.id = c.owner_id\");\n } else {\n $query\n ->select('c.*')\n ->from(\"#__companies as c\")\n ->leftJoin(\"#__users AS u on u.id = c.owner_id\");\n }\n\n if (!$id) {\n\n //get current date\n $date = DateHelper::formatDBDate(date('Y-m-d 00:00:00'));\n\n //filter for type\n if ($type != null && $type != \"all\") {\n\n //filter for companies with tasks due today\n if ($type == 'today') {\n $query->leftJoin(\"#__events_cf as event_company_cf on event_company_cf.association_id = c.id AND event_company_cf.association_type='company'\");\n $query->join('INNER',\"#__events as event on event.id = event_company_cf.event_id\");\n $query->where(\"event.due_date='$date'\");\n $query->where(\"event.published>0\");\n }\n\n //filter for companies and deals//tasks due tomorrow\n if ($type == \"tomorrow\") {\n $tomorrow = DateHelper::formatDBDate(date('Y-m-d 00:00:00',time() + (1*24*60*60)));\n $query->leftJoin(\"#__events_cf as event_company_cf on event_company_cf.association_id = c.id AND event_company_cf.association_type='company'\");\n $query->join('INNER',\"#__events as event on event.id = event_company_cf.event_id\");\n $query->where(\"event.due_date='$tomorrow'\");\n $query->where(\"event.published>0\");\n }\n\n //filter for companies updated in the last 30 days\n if ($type == \"updated_thirty\") {\n $last_thirty_days = DateHelper::formatDBDate(date('Y-m-d 00:00:00',time() - (30*24*60*60)));\n $query->where(\"c.modified >'$last_thirty_days'\");\n }\n\n //filter for past companies// last contacted 30 days ago or longer\n if ($type == \"past\") {\n $last_thirty_days = DateHelper::formatDBDate(date('Y-m-d 00:00:00',time() - (30*24*60*60)));\n $query->where(\"c.modified <'$last_thirty_days'\");\n }\n\n //filter for recent companies\n if ($type == \"recent\") {\n $last_thirty_days = DateHelper::formatDBDate(date('Y-m-d 00:00:00',time() - (30*24*60*60)));\n $query->where(\"c.modified >'$last_thirty_days'\");\n }\n\n $query->group(\"c.id\");\n\n }\n\n /** company name filter **/\n $company_name = $this->getState('Company.'.$view.'_name');\n if ($company_name != null) {\n $query->where(\"( c.name LIKE '%\".$company_name.\"%' )\");\n }\n\n }\n\n //search for specific companies\n if ($id != null) {\n if ( is_array($id) ) {\n $query->where(\"c.id IN (\".implode(',', $id).\")\");\n } else {\n $query->where(\"c.id=$id\");\n }\n }\n\n //filter based on member access roles\n $user_id = UsersHelper::getUserId();\n $member_role = UsersHelper::getRole();\n $team_id = UsersHelper::getTeamId();\n\n //filter based on specified user\n if ($user && $user != 'all') {\n $query->where(\"c.owner_id = \".$user);\n }\n\n //filter based on team\n if ($team) {\n $team_members = UsersHelper::getTeamUsers($team, true);\n $query->where(\"c.owner_id IN (\".implode(',', $team_members).\")\");\n }\n\n //set user state requests\n $query\n ->order($this->getState('Company.filter_order').' '.$this->getState('Company.filter_order_Dir'))\n ->where(\"c.published=\".$this->published);\n\n return $query;\n }", "protected static function buildSelectionQuery() \n {\n return Query::select()->\n from(self::getTableName());\n }", "public function buildSelect()\n {\n $this->query->select(\"DISTINCT(p.id),p.*,\n u.first_name as owner_first_name,u.last_name as owner_last_name,\n c.id as company_id,c.name as company_name,IF(p.id=d2.primary_contact_id, 1, 0) AS is_primary_contact\");\n\n $this->query->from(\"#__people AS p\");\n $this->query->leftJoin(\"#__people_cf as cf ON cf.person_id = p.id\");\n $this->query->leftJoin(\"#__users AS u ON u.id = p.owner_id\");\n $this->query->leftJoin(\"#__companies AS c ON c.id = p.company_id\");\n $this->query->leftJoin(\"#__deals AS d ON d.id = cf.association_id AND cf.association_type = 'deal'\");\n $this->query->leftJoin(\"#__deals AS d2 ON d2.primary_contact_id = p.id\");\n\n }", "public function buildQuery() {\n\t\t\tif (isset($this->postTypes[$this->postType])) {\n\t\t\t\t$this->SetFilter('type', array($this->postTypes[$this->postType] + 1));\n\t\t\t}\n\t\t\t$this->SetFilter('status', array(1));\n\t\t\tswitch ($this->matchMode) {\n\t\t\t\tcase 'any';\n\t\t\t\tdefault:\n\t\t\t\t\t$this->SetMatchMode(SPH_MATCH_ALL);\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\tswitch ($this->sortMode) {\n\t\t\t\tcase 'posted':\n\t\t\t\t\t$this->SetSortMode(SPH_SORT_EXTENDED, 'posted DESC');\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'relevance':\n\t\t\t\t\t$this->SetSortMode(SPH_SORT_EXTENDED, '@relevance DESC, posted DESC');\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'top':\n\t\t\t\tdefault:\n\t\t\t\t\t$this->SetSortMode(SPH_SORT_EXPR, 'upvotes - downvotes + @weight + LN(posted) * 1000');\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\t$this->SetLimits((int) $this->currentPage, (int) $this->pageLimit, (int) $this->resultLimit);\n\t\t}", "public function composeQuery()\n {\n $this->initQueryBody();\n if ($this->selectedFields) {\n array_set($this->queryBody, 'body._source', $this->selectedFields);\n $this->clearSelect();\n }\n if ($this->range) {\n $filter = array_get($this->queryBody, 'body.query.bool.filter');\n array_push($filter, $this->range);\n array_set($this->queryBody, 'body.query.bool.filter', $filter);\n\n }\n if ($this->terms) {\n foreach($this->terms as $condition => $conditionTerms) {\n $$condition = array_get($this->queryBody, \"body.query.bool.{$condition}\");\n $$condition = $$condition ?: [];\n foreach ($conditionTerms as $key => $value) {\n array_push($$condition, [\"term\" => [$key => $value]]);\n }\n array_set($this->queryBody, \"body.query.bool.{$condition}\", $$condition);\n }\n\n }\n if ($this->from) {\n array_set($this->queryBody, 'body.from', $this->from);\n }\n if ($this->size) {\n array_set($this->queryBody, 'body.size', $this->size);\n }\n if ($this->scrollSize) {\n array_set($this->queryBody, 'size', $this->scrollSize);\n }\n if ($this->scrollKeepTime) {\n array_set($this->queryBody, 'scroll', $this->scrollKeepTime);\n }\n if ($this->orders) {\n $orders = [];\n foreach($this->orders as $field => $value) {\n array_push($orders, [$field => [\"order\" => $value]]);\n }\n array_set($this->queryBody, 'body.sort', $orders);\n }\n }", "public function disableDistinct() {\r\n $this->myCRUD()->disableDistinct();\r\n return $this;\r\n }", "public function buildQuery() {\n\t\t$where = (sizeof($this->wheres) > 0) ? ' WHERE '.implode(\" \\n AND \\n\\t\", $this->wheres) : '';\n\t\t$order = (sizeof($this->orders) > 0) ? ' ORDER BY '.implode(\", \", $this->orders) : '' ;\n\t\t$group = (sizeof($this->groups) > 0) ? ' GROUP BY '.implode(\", \", $this->groups) : '' ;\n\t\t$query = 'SELECT '.implode(\", \\n\\t\", $this->fields).\"\\n FROM \\n\\t\".$this->class->table.\"\\n \".implode(\"\\n \", $this->joins).$where.' '.$group.' '.$order.' '.$this->limit;\n\t\treturn($query);\n\t}", "function _buildQuery()\n\t{\t\t\n\t\t// Get the WHERE and ORDER BY clauses for the query\n\t\t$where\t\t= $this->_buildContentWhere();\n\t\t$orderby\t= $this->_buildContentOrderBy();\n\t\t$query = 'SELECT a.*, DATEDIFF(a.early_bird_discount_date, NOW()) AS date_diff, c.name AS location_name, IFNULL(SUM(b.number_registrants), 0) AS total_registrants FROM #__eb_events AS a '\n\t\t\t. ' LEFT JOIN #__eb_registrants AS b '\n\t\t\t. ' ON (a.id = b.event_id AND b.group_id=0 AND (b.published = 1 OR (b.payment_method=\"os_offline\" AND b.published != 2))) '\n\t\t\t. ' LEFT JOIN #__eb_locations AS c '\n\t\t\t. ' ON a.location_id = c.id '\t\t\t\t\t\n\t\t\t. $where\t\t\n\t\t\t. ' GROUP BY a.id '\n\t\t\t. $orderby\n\t\t;\n\t\treturn $query;\n\t}", "public function getDistinctOn()\n {\n return $this->distinct_on;\n }", "public function __clone()\n {\n $this->query = clone $this->query;\n }", "public function distinct($params=''){\n\t\t$this->_connect();\n\t\tif($this->_schema){\n\t\t\t$table = $this->_schema.'.'.$this->_source;\n\t\t} else {\n\t\t\t$table = $this->_source;\n\t\t}\n\t\t$numberArguments = func_num_args();\n\t\t$params = Utils::getParams(func_get_args(), $numberArguments);\n\t\tif(!isset($params['column'])){\n\t\t\t$params['column'] = $params['0'];\n\t\t} else {\n\t\t\tif(!$params['column']) {\n\t\t\t\t$params['column'] = $params['0'];\n\t\t\t}\n\t\t}\n\t\t$select = 'SELECT DISTINCT '.$params['column'].' FROM '.$table;\n\t\tif(isset($params['conditions'])&&$params['conditions']) {\n\t\t\t$select.=' WHERE '.$params[\"conditions\"];\n\t\t}\n\t\tif(isset($params['order'])&&$params['order']) {\n\t\t\t$select.=' ORDER BY '.$params[\"order\"].' ';\n\t\t} else {\n\t\t\t$select.=' ORDER BY 1 ';\n\t\t}\n\t\tif(isset($params['limit'])&&$params['limit']) {\n\t\t\t$select = $this->_limit($select, $params['limit']);\n\t\t}\n\t\t$results = array();\n\t\t$this->_db->setFetchMode(DbBase::DB_NUM);\n\t\tforeach($this->_db->fetchAll($select) as $result){\n\t\t\t$results[] = $result[0];\n\t\t}\n\t\t$this->_db->setFetchMode(DbBase::DB_ASSOC);\n\t\treturn $results;\n\t}", "public function getDistinct() {\n\t\tif(is_null($this->distinct)) {\n\t\t\t$query = \"\";\n\t\t\t$query .= 'SELECT DISTINCT ';\n\t\t\t$query .= $this->getCodeField() . ' AS code, ';\n\t\t\t$query .= $this->getLabelField() . ' AS label';\n\t\t\t$query .= ' FROM ' . $this->getDatasourceName();\n\t\t\t$has_where = false;\n\t\t\tif(is_array($this->filter_value) && !in_array('-1', $this->filter_value)) {\n\t\t\t\t$select = \"\";\n\t\t\t\t$first = true;\n\t\t\t\tforeach($this->filter_value as $value) {\n\t\t\t\t\t$first ? $first = false : $select .= \",\";\n\t\t\t\t\t$select .= \"'\" . $value . \"'\";\n\t\t\t\t}\n\t\t\t\t$query .= ' WHERE ' . $this->getCodeField() . ' IN (' . $select . ')';\n\t\t\t\t$has_where = true;\n\t\t\t}\n\t\t\t$query .= ' ORDER BY ' . $this->getLabelField();\n\t\t\t$this->exploitResultset($this->execute($query));\n\t\t}\n\t\treturn $this->distinct;\n\t}", "function joinQuery()\n {\n }", "public function prepareQuery()\n {\n //prepare where conditions\n foreach ($this->where as $where) {\n $this->prepareWhereCondition($where);\n }\n\n //prepare where not conditions\n foreach ($this->whereNot as $whereNot) {\n $this->prepareWhereNotCondition($whereNot);\n }\n\n // Add a basic range clause to the query\n foreach ($this->inRange as $inRange) {\n $this->prepareInRangeCondition($inRange);\n }\n\n // Add a basic not in range clause to the query\n foreach ($this->notInRange as $notInRange) {\n $this->prepareNotInRangeCondition($notInRange);\n }\n\n // add Terms to main query\n foreach ($this->whereTerms as $term) {\n $this->prepareWhereTermsCondition($term);\n }\n\n // add exists constrains to the query\n foreach ($this->exist as $exist) {\n $this->prepareExistCondition($exist);\n }\n\n // add matcher queries\n foreach ($this->match as $match) {\n $this->prepareMatchQueries($match);\n }\n\n $this->query->addFilter($this->filter);\n\n return $this->query;\n }", "function mDISTINCT(){\n try {\n $_type = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$DISTINCT;\n $_channel = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$DEFAULT_TOKEN_CHANNEL;\n // Tokenizer11.g:121:3: ( 'distinct' ) \n // Tokenizer11.g:122:3: 'distinct' \n {\n $this->matchString(\"distinct\"); \n\n\n }\n\n $this->state->type = $_type;\n $this->state->channel = $_channel;\n }\n catch(Exception $e){\n throw $e;\n }\n }", "private function _getDatatablesQuery()\n {\n $this->query = DB::table($this->table);\n $this->query->leftJoin('categories', 'categories.id', '=', 'documents.category_id');\n $this->query->select('documents.stt', 'documents.id', 'documents.title','documents.updated_at');\n\n if (strpos(URL::current(), 'admin') < 0) {\n $this->query->where('categories.searchable', 1);\n }\n\n if (Input::get('cat'))\n $this->query->where('documents.category_id', Input::get('cat'));\n\n if (Input::get('isBuyed')) {\n $this->query->join('users_documents', 'users_documents.document_id', '=', 'documents.stt');\n $this->query->where('users_documents.user_id', Auth::user()->id);\n }\n\n if(Input::has('search.value')) {\n $this->_getSearchStringQuery();\n }\n\n // here order processing\n if (isset($_GET['order'])) {\n $this->query->orderBy(\n $this->column_order[$_GET['order']['0']['column']],\n $_GET['order']['0']['dir']\n );\n } else if (isset($this->order)) {\n $order = $this->order;\n $this->query->orderBy(key($order), $order[key($order)]);\n }\n }", "public final function isDistinct()\n {\n $this->distinct = true;\n return $this;\n }", "protected function buildQuery()\n\t{\n\t\t$this->query = count($this->conditions) ? 'WHERE ' . implode(' AND ', $this->conditions) : '';\n\t}", "final public function getDistinctUserCriteria() {\n return [\n 'FIELDS' => [\n User::getTable() . '.id AS users_id',\n User::getTable() . '.language AS language'\n ],\n 'DISTINCT' => true,\n ];\n }", "protected function sourceQuery(){\n $query = parent::sourceQuery();\n $query->condition('i.field_name', array_keys($this->getFieldNameMappings()), 'NOT IN');\n return $query;\n }", "private function _generateQuery() {\n\t\t// vyhodnoceni odeslanych filtracnich dat\n\t\t$filterObj = $this->getRequest()->getParam(\"_filter\", null);\n\t\t$uuid = $this->getRequest()->getParam(\"id\", null);\n\t\t$uuids = $this->getRequest()->getParam(\"_uuids\", null);\n\t\t\n\t\t// vyhodnoceni stavu\n\t\tif ($uuid) {\n\t\t\t// uuid byl odeslan primo v requestu\n\t\t\t$this->_queryObject = array($uuid);\n\t\t\t\n\t\t\treturn;\n\t\t} elseif ($uuids) {\n\t\t\t// byl odeslan seznam uuid\n\t\t\t$this->_queryObject = (array) $uuids;\n\t\t\t\n\t\t\treturn;\n\t\t} elseif (!$filterObj) {\n\t\t\t// zadna z moznosti nebyla vyuzita\n\t\t\t$this->_queryObject = array();\n\t\t}\n\t\t\n\t\t/**\n\t\t * pokud program dosel az sem, byl odeslan plnohodnotny filtracni objekt\n\t\t */ \n\t\t\n\t\t// reset referenci\n\t\tBB_Db_Query_Reference::clearTables();\n\t\t\n\t\t// vytvoreni filtracniho objektu a ziskani seznamu tabulek\n\t\t$queryObj = BB_Db_Query_Factory::factory($filterObj);\n\t\t$tableNames = BB_Db_Query_Reference::getTables();\n\t\t\n\t\t// vygenerovani seznamu pouzitych sloupcu z index\n\t\t$usedColumns = $this->getRequest()->getParam(\"_uuidColumns\", array());\n\t\t$usedColumns = (array) $usedColumns;\n\t\t\n\t\tif (!$usedColumns) {\n\t\t\t// seznam pouzitych sloupci je prazdny - toto neni pripustne\n\t\t\tthrow new Zend_Exception(\"UUID_COLUMNS_NOT_SET\", 400);\n\t\t}\n\t\t\n\t\t$usedReferences = array();\n\t\t\n\t\tforeach ($usedColumns as $column) {\n\t\t\t$reference = new BB_Db_Query_Reference($column);\n\t\t\t\n\t\t\t// kontrola jestli je tabulka v seznamu\n\t\t\tif (!in_array($reference->getTable(), $tableNames)) {\n\t\t\t\t// tabulka neni v seznamu, vyhodi se chyba\n\t\t\t\tthrow new Zend_Exception(\"UNKNOWN_INDEX_UUID_COLUMN\", 400);\n\t\t\t}\n\t\t\t\n\t\t\t$usedReferences[] = new BB_Db_Query_Reference($column);\n\t\t}\n\t\t\n\t\t// anulace statickych vlastnosti reference\n\t\tBB_Db_Query_Reference::clearTables();\n\t\t\n\t\t// vygenerovani infomraci pro filtraci dat\n\t\t$filterData = new stdClass;\n\t\t\n\t\t$filterData->columns = $usedReferences;\n\t\t$filterData->query = $queryObj;\n\t\t$filterData->tables = $tableNames;\n\t\t\n\t\t// nastaveni objektu\n\t\t$this->_queryObject = $filterData;\n\t\t\n\t\treturn $this;\n\t}", "protected function toQuery() {\n\t\t$query = $this->mapper()->all($this->entityName(), $this->conditions())->order($this->relationOrder());\n\t\t$query->snapshot();\n\t\treturn $query;\n\t}", "protected function toQuery()\n\t{\n\t\treturn $this->mapper()->all($this->entityName(), $this->conditions())->order($this->relationOrder())->first();\n\t}", "protected function _prepareCollection() {\n $collection = Config::get()->collectionTransaction();\n $asTrnx = 'main_table';\n $collection->addFieldToSelect(Transaction::ATTR_ID, self::AS_TRAN_ID);\n $collection->addFieldToSelect(Transaction::ATTR_DATE_APPLIED, self::AS_DATE_APPLIED);\n $collection->addFieldToSelect(Transaction::ATTR_VALUE, self::AS_VALUE);\n /* LEFT JOIN prxgt_bonus_operation oper ON trnx.operation_id = oper.id */\n $asOper = 'oper';\n $tbl = array( $asOper => Config::ENTITY_OPERATION );\n $cond = $asTrnx . '.' . Transaction::ATTR_OPERATION_ID . '=' . $asOper . '.' . Operation::ATTR_ID;\n $cols = array(\n self::AS_OPER_ID => Operation::ATTR_ID,\n self::AS_DATE_PERFORMED => Operation::ATTR_DATE_PERFORMED\n );\n $collection->join($tbl, $cond, $cols);\n /* LEFT JOIN prxgt_bonus_account credit ON trnx.credit_acc_id = credit.id */\n $asCredit = 'credit';\n $tbl = array( $asCredit => Config::ENTITY_ACCOUNT );\n $cond = $asTrnx . '.' . Transaction::ATTR_CREDIT_ACC_ID . '=' . $asCredit . '.' . Account::ATTR_ID;\n $cols = array();\n $collection->join($tbl, $cond, $cols);\n /* LEFT JOIN prxgt_bonus_account debit ON trnx.debit_acc_id = debit.id */\n $asDebit = 'debit';\n $tbl = array( $asDebit => Config::ENTITY_ACCOUNT );\n $cond = $asTrnx . '.' . Transaction::ATTR_DEBIT_ACC_ID . '=' . $asDebit . '.' . Account::ATTR_ID;\n $cols = array();\n $collection->join($tbl, $cond, $cols);\n /* LEFT JOIN customer_entity custCred ON credit.customer_id = custCred.entity_id */\n $asCreditCust = 'creditCust';\n $tbl = array( $asCreditCust => 'customer/entity' );\n $cond = $asCredit . '.' . Account::ATTR_CUSTOMER_ID . '=' . $asCreditCust . '.' . Eav::DEFAULT_ENTITY_ID_FIELD;\n $cols = array( self::AS_CREDIT_CUST => ConfigCore::ATTR_CUST_MLM_ID );\n $collection->join($tbl, $cond, $cols);\n /* LEFT JOIN customer_entity custDeb ON debit.customer_id = custDeb.entity_id */\n $asDebitCust = 'debitCust';\n $tbl = array( $asDebitCust => 'customer/entity' );\n $cond = $asDebit . '.' . Account::ATTR_CUSTOMER_ID . '=' . $asDebitCust . '.' . Eav::DEFAULT_ENTITY_ID_FIELD;\n $cols = array( self::AS_DEBIT_CUST => ConfigCore::ATTR_CUST_MLM_ID );\n $collection->join($tbl, $cond, $cols);\n /* LEFT JOIN prxgt_bonus_type_asset asset ON credit.asset_id = asset.id */\n $asAsset = 'asset';\n $tbl = array( $asAsset => Config::ENTITY_TYPE_ASSET );\n $cond = $asCredit . '.' . Account::ATTR_ASSET_ID . '=' . $asAsset . '.' . TypeAsset::ATTR_ID;\n $cols = array( self::AS_ASSET_CODE => TypeAsset::ATTR_CODE );\n $collection->join($tbl, $cond, $cols);\n /* LEFT JOIN prxgt_bonus_type_oper operType ON oper.type_id = operType.id */\n $asOperType = 'operType';\n $tbl = array( $asOperType => Config::ENTITY_TYPE_OPER );\n $cond = $asOper . '.' . Operation::ATTR_TYPE_ID . '=' . $asOperType . '.' . TypeOper::ATTR_ID;\n $cols = array( self::AS_OPER_CODE => TypeOper::ATTR_CODE );\n $collection->join($tbl, $cond, $cols);\n /* prepare collection */\n $sql = $collection->getSelectSql(true);\n $this->setCollection($collection);\n parent::_prepareCollection();\n return $this;\n }", "protected function build_sql() {\n\n\t\t$builder = new Builder();\n\n\t\t$select = $this->parse_select();\n\t\t$from = new From( $this->table->get_table_name( $GLOBALS['wpdb'] ), 'q' );\n\n\t\t$where = new Where( 1, true, 1 );\n\n\t\tif ( ( $id = $this->parse_id() ) !== null ) {\n\t\t\t$where->qAnd( $id );\n\t\t}\n\n\t\tif ( ( $transaction = $this->parse_transaction() ) !== null ) {\n\t\t\t$where->qAnd( $transaction );\n\t\t}\n\n\t\tif ( ( $customer = $this->parse_customer() ) !== null ) {\n\t\t\t$where->qAnd( $customer );\n\t\t}\n\n\t\tif ( ( $membership = $this->parse_membership() ) !== null ) {\n\t\t\t$where->qAnd( $membership );\n\t\t}\n\n\t\tif ( ( $seats = $this->parse_seats() ) !== null ) {\n\t\t\t$where->qAnd( $seats );\n\t\t}\n\n\t\tif ( ( $seats_gt = $this->parse_seats_gt() ) !== null ) {\n\t\t\t$where->qAnd( $seats_gt );\n\t\t}\n\n\t\tif ( ( $seats_lt = $this->parse_seats_lt() ) !== null ) {\n\t\t\t$where->qAnd( $seats_lt );\n\t\t}\n\n\t\tif ( ( $active = $this->parse_active() ) !== null ) {\n\t\t\t$where->qAnd( $active );\n\t\t}\n\n\t\t$order = $this->parse_order();\n\t\t$limit = $this->parse_pagination();\n\n\t\tif ( $this->args['return_value'] == 'relationships' ) {\n\n\t\t\t$match = new Where_Raw( 'r.purchase = q.id' );\n\t\t\t$match->qAnd( $where );\n\n\t\t\t$select = $this->parse_select( 'r' );\n\t\t\t$join = new Join( $from, $match );\n\n\t\t\t$from = new From(\n\t\t\t\tManager::get( 'itegms-relationships' )->get_table_name( $GLOBALS['wpdb'] ), 'r'\n\t\t\t);\n\t\t\t$where = $join;\n\t\t}\n\n\t\t$builder->append( $select );\n\t\t$builder->append( $from );\n\t\t$builder->append( $where );\n\t\t$builder->append( $order );\n\n\t\tif ( $limit !== null ) {\n\t\t\t$builder->append( $limit );\n\t\t}\n\n\t\treturn $builder->build();\n\t}", "private function sql_resAllItemsFilterWiRelation()\n {\n // Don't count hits\n $bool_count = false;\n\n // Query for all filter items\n $select = $this->sql_select( $bool_count );\n $from = $this->sql_from();\n $where = $this->sql_whereAllItems();\n $groupBy = $this->curr_tableField;\n $orderBy = $this->sql_orderBy();\n $limit = $this->sql_limit();\n\n// $query = $GLOBALS['TYPO3_DB']->SELECTquery\n// (\n// $select,\n// $from,\n// $where,\n// $groupBy,\n// $orderBy,\n// $limit\n// );\n//$this->pObj->dev_var_dump( $query );\n // Execute query\n $arr_return = $this->pObj->objSqlFun->exec_SELECTquery\n (\n $select, $from, $where, $groupBy, $orderBy, $limit\n );\n // Execute query\n\n return $arr_return;\n }", "public function prepareQueryForCategory()\n {\n $sql = new SqlStatement();\n $sql->select(array('p.*'))\n ->from(array('p' => self::RESULTS_TABLE))\n ->innerJoin(array('pp' => 'product'), 'p.product_id = pp.product_id')\n ->innerJoin(array('pd' => 'product_description'), 'p.product_id = pd.product_id')\n ->where('pd.language_id = ?', (int)$this->config->get('config_language_id'))\n ->order($this->sortOrder)\n ->limit($this->productsLimit, $this->productsStart);\n \n if ($this->conditions->price) {\n if ($this->conditions->price->min) {\n $sql->where(\"{$this->subquery->actualPrice} >= ?\", array($this->conditions->price->min));\n }\n if ($this->conditions->price->max) {\n $sql->where(\"{$this->subquery->actualPrice} <= ?\", array($this->conditions->price->max));\n }\n }\n \n if ($this->conditions->rating) {\n $sql->where('ROUND(total) IN ('. implode(',', $this->conditions->rating[0]) . ')');\n } \n \n return $sql;\n }", "protected function _prepareSubset() {}", "function _buildQueryUsers()\n\t{\n\t\t// Get the WHERE and ORDER BY clauses for the query\n\t\t$where = $this->_pending\n\t\t\t? $this->_buildContentWherePending()\n\t\t\t: $this->_buildContentWhere();\n\t\tif ($where === false)\n\t\t{\n\t\t\treturn 'SELECT 1 FROM #__users WHERE 1=0';\n\t\t}\n\n\t\t$query = 'SELECT ua.id, ua.name'\n\t\t\t. ' FROM #__flexicontent_files AS a'\n\t\t\t. ' LEFT JOIN #__users AS ua ON ua.id = a.uploaded_by'\n\t\t\t. $where\n\t\t\t. ' GROUP BY ua.id'\n\t\t\t. ' ORDER BY ua.name'\n\t\t\t;\n\t\treturn $query;\n\t}", "public function distinct() {\n return $this->attribute('distinct', true);\n }", "protected function getListQuery() {\n // Create a new query object.\n $db = $this->getDbo();\n $query = $db->getQuery(true);\n\n // Select the required fields from the table.\n $query->select(\n $this->getState('DISTINCT ' .\n 'list.select', ' a.id,a.guid,a.ordering,a.name,a.alias,a.ordertype_id,a.orderstate_id,a.archived,a.user_id,a.sent,a.completed,a.created_by,a.created'\n )\n );\n\n $query->from('#__sdi_order AS a');\n\n // Join over the users for the checked out user.\n $query->select('uc.name AS editor');\n $query->join('LEFT', '#__users AS uc ON uc.id=a.checked_out');\n\n // Join over the user field 'user'\n $query->select($db->quoteName('users2.name', 'user'))\n ->select($db->quoteName('users2.username', 'username'))\n ->innerJoin('#__sdi_user AS sdi_user ON sdi_user.id = a.user_id')\n ->innerJoin('#__users AS users2 ON users2.id = sdi_user.user_id');\n\n // Join over the orderstate field 'orderstate'\n $query->select('orderstate.value AS orderstate')\n ->innerJoin('#__sdi_sys_orderstate AS orderstate ON orderstate.id = a.orderstate_id');\n\n $query->group('orderstate.value');\n\n // Join over the ordertype field 'ordertype'\n $query->select('ordertype.value AS ordertype')\n ->innerJoin('#__sdi_sys_ordertype AS ordertype ON ordertype.id = a.ordertype_id');\n\n $query->group('ordertype.value');\n // Filter by ordertype type\n $ordertype = $this->getState('filter.ordertype');\n if (is_numeric($ordertype)) {\n $query->where('a.ordertype_id = ' . (int) $ordertype);\n }\n\n // Filter by orderstate state\n $orderstate = $this->getState('filter.orderstate');\n if (is_numeric($orderstate)) {\n $query->where('a.orderstate_id = ' . (int) $orderstate);\n }\n\n // Filter by order archived state\n $orderarchived = $this->getState('filter.orderarchived');\n if (is_numeric($orderarchived)) {\n $query->where('a.archived = ' . (int) $orderarchived);\n }\n\n // Filter by order user\n $orderuser = $this->getState('filter.orderuser');\n if (is_numeric($orderuser)) {\n $query->where('a.user_id = ' . (int) $orderuser);\n }\n\n // Filter by order user's organism\n $orderuserorganism = $this->getState('filter.orderuserorganism');\n if (is_numeric($orderuserorganism)) {\n $query->innerJoin('#__sdi_user_role_organism AS uro ON sdi_user.id = uro.user_id AND uro.role_id = 1');\n $query->where('uro.organism_id = ' . (int) $orderuserorganism);\n }\n\n // Filter by orderprovider state\n $orderprovider = $this->getState('filter.orderprovider');\n if (is_numeric($orderprovider)) {\n $query\n ->innerJoin('#__sdi_order_diffusion AS order_diffusion2 ON order_diffusion2.order_id = a.id')\n ->innerJoin('#__sdi_diffusion AS diffusion2 ON diffusion2.id = order_diffusion2.diffusion_id')\n ->innerJoin('#__sdi_version AS version2 ON version2.id = diffusion2.version_id')\n ->innerJoin('#__sdi_resource AS resource2 ON resource2.id = version2.resource_id')\n ->where('resource2.organism_id = ' . (int) $orderprovider);\n }\n\n // Filter by orderdiffusion state\n $orderdiffusion = $this->getState('filter.orderdiffusion');\n if (is_numeric($orderdiffusion)) {\n $query\n ->innerJoin('#__sdi_order_diffusion AS order_diffusion3 ON order_diffusion3.order_id =a.id')\n ->where('order_diffusion3.diffusion_id = ' . (int) $orderdiffusion);\n }\n\n // Filter by ordersent state\n $ordersent = $this->getState('filter.ordersent');\n if ($ordersent !== '') {\n // Get UTC for now.\n $dNow = new JDate;\n $dStart = clone $dNow;\n\n switch ($ordersent) {\n case 'past_week':\n $dStart->modify('-7 day');\n break;\n\n case 'past_1month':\n $dStart->modify('-1 month');\n break;\n\n case 'past_3month':\n $dStart->modify('-3 month');\n break;\n\n case 'past_6month':\n $dStart->modify('-6 month');\n break;\n\n case 'post_year':\n case 'past_year':\n $dStart->modify('-1 year');\n break;\n\n case 'today':\n // Ranges that need to align with local 'days' need special treatment.\n $app = JFactory::getApplication();\n $offset = $app->getCfg('offset');\n\n // Reset the start time to be the beginning of today, local time.\n $dStart = new JDate('now', $offset);\n $dStart->setTime(0, 0, 0);\n\n // Now change the timezone back to UTC.\n $tz = new DateTimeZone('GMT');\n $dStart->setTimezone($tz);\n break;\n }\n\n if ($ordersent == 'post_year') {\n $query->where(\n 'a.sent < ' . $db->quote($dStart->format('Y-m-d H:i:s'))\n );\n } else {\n $query->where(\n 'a.sent >= ' . $db->quote($dStart->format('Y-m-d H:i:s')) .\n ' AND a.sent <=' . $db->quote($dNow->format('Y-m-d H:i:s'))\n );\n }\n }\n\n // Filter by ordercompleted state\n $ordercompleted = $this->getState('filter.ordercompleted');\n if ($ordercompleted !== '') {\n // Get UTC for now.\n $dNow = new JDate;\n $dStart = clone $dNow;\n\n switch ($ordercompleted) {\n case 'past_week':\n $dStart->modify('-7 day');\n break;\n\n case 'past_1month':\n $dStart->modify('-1 month');\n break;\n\n case 'past_3month':\n $dStart->modify('-3 month');\n break;\n\n case 'past_6month':\n $dStart->modify('-6 month');\n break;\n\n case 'post_year':\n case 'past_year':\n $dStart->modify('-1 year');\n break;\n\n case 'today':\n // Ranges that need to align with local 'days' need special treatment.\n $app = JFactory::getApplication();\n $offset = $app->getCfg('offset');\n\n // Reset the start time to be the beginning of today, local time.\n $dStart = new JDate('now', $offset);\n $dStart->setTime(0, 0, 0);\n\n // Now change the timezone back to UTC.\n $tz = new DateTimeZone('GMT');\n $dStart->setTimezone($tz);\n break;\n }\n\n if ($ordercompleted == 'post_year') {\n $query->where(\n 'a.completed < ' . $db->quote($dStart->format('Y-m-d H:i:s'))\n );\n } else {\n $query->where(\n 'a.completed >= ' . $db->quote($dStart->format('Y-m-d H:i:s')) .\n ' AND a.completed <=' . $db->quote($dNow->format('Y-m-d H:i:s'))\n );\n }\n }\n\n // Filter by search in title\n $search = $this->getState('filter.search');\n if (!empty($search)) {\n $searchOnId = '';\n if (is_numeric($search)) {\n $searchOnId = ' OR (a.id = ' . (int) $search . ')';\n }\n $search = $db->Quote('%' . $db->escape($search, true) . '%');\n $query->where('(( a.name LIKE ' . $search . ' ) ' . $searchOnId . ' )');\n }\n\n // Add the list ordering clause.\n $orderCol = $this->state->get('list.ordering');\n $orderDirn = $this->state->get('list.direction');\n if ($orderCol && $orderDirn) {\n $query->order($db->escape($orderCol . ' ' . $orderDirn));\n }\n\n //group by order_id\n $query->group('a.id');\n $query->group('a.guid');\n $query->group('a.alias');\n $query->group('a.created_by');\n $query->group('a.created');\n $query->group('a.name');\n $query->group('users2.name');\n $query->group('uc.name');\n $query->group('users2.username');\n\n return $query;\n }", "protected function getListQuery()\r\n\t{\r\n\t\t// Create a new query object.\r\n\t\t$db = $this->getDbo();\r\n\t\t$query = $db->getQuery(true);\r\n\r\n\t\t// Select the required fields from the table.\r\n\t\t$query->select(\r\n\t\t\t$this->getState(\r\n\t\t\t\t'list.select', 'DISTINCT a.*'\r\n\t\t\t)\r\n\t\t);\r\n\t\t$query->from('`#__programas` AS a');\r\n\r\n\t\t// Join over the users for the checked out user\r\n\t\t$query->select(\"uc.name AS editor\");\r\n\t\t$query->join(\"LEFT\", \"#__users AS uc ON uc.id=a.checked_out\");\r\n\r\n\t\t// Join over the user field 'created_by'\r\n\t\t$query->select('`created_by`.name AS `created_by`');\r\n\t\t$query->join('LEFT', '#__users AS `created_by` ON `created_by`.id = a.`created_by`');\r\n\r\n\t\t// Join over the user field 'modified_by'\r\n\t\t$query->select('`modified_by`.name AS `modified_by`');\r\n\t\t$query->join('LEFT', '#__users AS `modified_by` ON `modified_by`.id = a.`modified_by`');\r\n\t\t// Join over the category 'category'\r\n\t\t$query->select('`category`.title AS `category`');\r\n\t\t$query->join('LEFT', '#__categories AS `category` ON `category`.id = a.`category`');\r\n\r\n\t\t// Filter by published state\r\n\t\t$published = $this->getState('filter.state');\r\n\r\n\t\tif (is_numeric($published))\r\n\t\t{\r\n\t\t\t$query->where('a.state = ' . (int) $published);\r\n\t\t}\r\n\t\telseif ($published === '')\r\n\t\t{\r\n\t\t\t$query->where('(a.state IN (0, 1))');\r\n\t\t}\r\n\r\n\t\t// Filter by search in title\r\n\t\t$search = $this->getState('filter.search');\r\n\r\n\t\tif (!empty($search))\r\n\t\t{\r\n\t\t\tif (stripos($search, 'id:') === 0)\r\n\t\t\t{\r\n\t\t\t\t$query->where('a.id = ' . (int) substr($search, 3));\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t$search = $db->Quote('%' . $db->escape($search, true) . '%');\r\n\t\t\t\t$query->where('( a.program_name LIKE ' . $search . ' OR a.category LIKE ' . $search . ' OR a.genre LIKE ' . $search . ' OR a.start_time LIKE ' . $search . ' OR a.end_time LIKE ' . $search . ' OR a.days_of_the_week LIKE ' . $search . ' OR a.broadcaster_name LIKE ' . $search . ' OR a.broadcaster_email LIKE ' . $search . ' )');\r\n\t\t\t}\r\n\t\t}\r\n\r\n\r\n\t\t//Filtering category\r\n\t\t$filter_category = $this->state->get(\"filter.category\");\r\n\t\tif ($filter_category)\r\n\t\t{\r\n\t\t\t$query->where(\"a.`category` = '\".$db->escape($filter_category).\"'\");\r\n\t\t}\r\n\r\n\t\t//Filtering days_of_the_week\r\n\t\t$filter_days_of_the_week = $this->state->get(\"filter.days_of_the_week\");\r\n\t\tif ($filter_days_of_the_week)\r\n\t\t{\r\n\t\t\t$query->where(\"a.`days_of_the_week` LIKE '%\\\"\".$db->escape($filter_days_of_the_week).\"\\\"%'\");\r\n\t\t}\r\n\t\t// Add the list ordering clause.\r\n\t\t$orderCol = $this->state->get('list.ordering');\r\n\t\t$orderDirn = $this->state->get('list.direction');\r\n\r\n\t\tif ($orderCol && $orderDirn)\r\n\t\t{\r\n\t\t\t$query->order($db->escape($orderCol . ' ' . $orderDirn));\r\n\t\t}\r\n\r\n\t\treturn $query;\r\n\t}", "public function prepareQuery()\n {\n $query = $this->model->newQuery();\n $primaryTable = $this->model->getTable();\n $selects = [$primaryTable.'.*'];\n $joins = [];\n $withs = [];\n\n /**\n * @event backend.list.extendQueryBefore\n * Provides an opportunity to modify the `$query` object before the List widget applies its scopes to it.\n *\n * Example usage:\n *\n * Event::listen('backend.list.extendQueryBefore', function($listWidget, $query) {\n * $query->whereNull('deleted_at');\n * });\n *\n * Or\n *\n * $listWidget->bindEvent('list.extendQueryBefore', function ($query) {\n * $query->whereNull('deleted_at');\n * });\n *\n */\n $this->fireSystemEvent('backend.list.extendQueryBefore', [$query]);\n\n /*\n * Prepare searchable column names\n */\n $primarySearchable = [];\n $relationSearchable = [];\n\n $columnsToSearch = [];\n if (!empty($this->searchTerm) && ($searchableColumns = $this->getSearchableColumns())) {\n foreach ($searchableColumns as $column) {\n /*\n * Related\n */\n if ($this->isColumnRelated($column)) {\n $table = $this->model->makeRelation($column->relation)->getTable();\n $columnName = isset($column->sqlSelect)\n ? DbDongle::raw($this->parseTableName($column->sqlSelect, $table))\n : $table . '.' . $column->valueFrom;\n\n $relationSearchable[$column->relation][] = $columnName;\n }\n /*\n * Primary\n */\n else {\n $columnName = isset($column->sqlSelect)\n ? DbDongle::raw($this->parseTableName($column->sqlSelect, $primaryTable))\n : DbDongle::cast(Db::getTablePrefix() . $primaryTable . '.' . $column->columnName, 'TEXT');\n\n $primarySearchable[] = $columnName;\n }\n }\n }\n\n /*\n * Prepare related eager loads (withs) and custom selects (joins)\n */\n foreach ($this->getVisibleColumns() as $column) {\n\n // If useRelationCount is enabled, eager load the count of the relation into $relation_count\n if ($column->relation && @$column->config['useRelationCount']) {\n $query->withCount($column->relation);\n }\n\n if (!$this->isColumnRelated($column) || (!isset($column->sqlSelect) && !isset($column->valueFrom))) {\n continue;\n }\n\n if (isset($column->valueFrom)) {\n $withs[] = $column->relation;\n }\n\n $joins[] = $column->relation;\n }\n\n /*\n * Add eager loads to the query\n */\n if ($withs) {\n $query->with(array_unique($withs));\n }\n\n /*\n * Apply search term\n */\n $query->where(function ($innerQuery) use ($primarySearchable, $relationSearchable, $joins) {\n\n /*\n * Search primary columns\n */\n if (count($primarySearchable) > 0) {\n $this->applySearchToQuery($innerQuery, $primarySearchable, 'or');\n }\n\n /*\n * Search relation columns\n */\n if ($joins) {\n foreach (array_unique($joins) as $join) {\n /*\n * Apply a supplied search term for relation columns and\n * constrain the query only if there is something to search for\n */\n $columnsToSearch = array_get($relationSearchable, $join, []);\n\n if (count($columnsToSearch) > 0) {\n $innerQuery->orWhereHas($join, function ($_query) use ($columnsToSearch) {\n $this->applySearchToQuery($_query, $columnsToSearch);\n });\n }\n }\n }\n\n });\n\n /*\n * Custom select queries\n */\n foreach ($this->getVisibleColumns() as $column) {\n if (!isset($column->sqlSelect)) {\n continue;\n }\n\n $alias = $query->getQuery()->getGrammar()->wrap($column->columnName);\n\n /*\n * Relation column\n */\n if (isset($column->relation)) {\n\n // @todo Find a way...\n $relationType = $this->model->getRelationType($column->relation);\n if ($relationType == 'morphTo') {\n throw new ApplicationException('The relationship morphTo is not supported for list columns.');\n }\n\n $table = $this->model->makeRelation($column->relation)->getTable();\n $sqlSelect = $this->parseTableName($column->sqlSelect, $table);\n\n /*\n * Manipulate a count query for the sub query\n */\n $relationObj = $this->model->{$column->relation}();\n $countQuery = $relationObj->getRelationExistenceQuery($relationObj->getRelated()->newQueryWithoutScopes(), $query);\n\n $joinSql = $this->isColumnRelated($column, true)\n ? DbDongle::raw(\"group_concat(\" . $sqlSelect . \" separator ', ')\")\n : DbDongle::raw($sqlSelect);\n\n $joinSql = $countQuery->select($joinSql)->toSql();\n\n $selects[] = Db::raw(\"(\".$joinSql.\") as \".$alias);\n }\n /*\n * Primary column\n */\n else {\n $sqlSelect = $this->parseTableName($column->sqlSelect, $primaryTable);\n $selects[] = DbDongle::raw($sqlSelect . ' as '. $alias);\n }\n }\n\n /*\n * Apply sorting\n */\n if (($sortColumn = $this->getSortColumn()) && !$this->showTree) {\n if (($column = array_get($this->allColumns, $sortColumn)) && $column->valueFrom) {\n $sortColumn = $this->isColumnPivot($column)\n ? 'pivot_' . $column->valueFrom\n : $column->valueFrom;\n }\n\n // Set the sorting column to $relation_count if useRelationCount enabled\n if (isset($column->relation) && @$column->config['useRelationCount']) {\n $sortColumn = $column->relation . '_count';\n }\n\n $query->orderBy($sortColumn, $this->sortDirection);\n }\n\n /*\n * Apply filters\n */\n foreach ($this->filterCallbacks as $callback) {\n $callback($query);\n }\n\n /*\n * Add custom selects\n */\n $query->addSelect($selects);\n\n /**\n * @event backend.list.extendQuery\n * Provides an opportunity to modify and / or return the `$query` object after the List widget has applied its scopes to it and before it's used to get the records.\n *\n * Example usage:\n *\n * Event::listen('backend.list.extendQuery', function($listWidget, $query) {\n * $newQuery = MyModel::newQuery();\n * return $newQuery;\n * });\n *\n * Or\n *\n * $listWidget->bindEvent('list.extendQuery', function ($query) {\n * $query->whereNull('deleted_at');\n * });\n *\n */\n if ($event = $this->fireSystemEvent('backend.list.extendQuery', [$query])) {\n return $event;\n }\n\n return $query;\n }", "function distinct($value = TRUE)\r\n\t{\r\n\t\t$this->db->distinct($value);\r\n\r\n\t\t// For method chaining\r\n\t\treturn $this;\r\n\t}", "protected function query() {\n $query = Database::getConnection('default', $this->sourceConnection)\n ->select('og_uid', 'ogu')\n // we have a user 0 here for some stupid reason\n ->condition('uid', 0, '>')\n ->fields('ogu', array('nid', 'is_active', 'is_admin', 'uid'));\n return $query;\n }", "public function query() {\n if (isset($this->value, $this->definition['trovequery'])) {\n $this->query->args['method'] = $this->definition['trovequery']['method'];\n if (is_array($this->value)) {\n $this->query->add_where($this->options['group'], $this->definition['trovequery']['arg'], implode($this->value, ','));\n }\n else {\n $this->query->add_where($this->options['group'], $this->definition['trovequery']['arg'], $this->value);\n }\n }\n }", "function query() {\n \n $this->ensure_my_table();\n \n if ($this->options['operator'] == 'in') {\n $keys = array_keys($this->value);\n\n $this->query->add_where(0, $this->table_alias.'.id IN ('. implode(',', $keys).')' );\n }\n\n }", "private function buildQuery()\n {\n $params = JComponentHelper::getParams('com_easybookreloaded');\n\n // If type is feed, then the order has to be DESC to get the latest entries in the feed reader\n $document = JFactory::getDocument();\n\n if($document->getType() == 'feed')\n {\n $order = 'DESC';\n }\n else\n {\n $order = $params->get('entries_order', 'DESC');\n }\n\n // Check whether limit is already set - e.g. from feed function\n $limit = JFactory::getApplication()->input->getInt('limit', 0);\n\n if(empty($limit))\n {\n $limit = (int)$params->get('entries_perpage', 5);\n }\n\n $start = JFactory::getApplication()->input->getInt('limitstart', 0);\n\n if(_EASYBOOK_CANEDIT)\n {\n $query = \"SELECT * FROM \".$this->_db->quoteName('#__easybook').\" ORDER BY \".$this->_db->quoteName('gbdate').\" \".$order.\" LIMIT \".$start.\", \".$limit;\n }\n else\n {\n $query = \"SELECT * FROM \".$this->_db->quoteName('#__easybook').\" WHERE \".$this->_db->quoteName('published').\" = 1 ORDER BY \".$this->_db->quoteName('gbdate').\" \".$order.\" LIMIT \".$start.\", \".$limit;\n }\n\n return $query;\n }", "public function queryAll($campos=\"*\",$criterio=\"\");", "protected function getListQuery() {\n // Create a new query object.\n $db = $this->getDbo();\n $query = $db->getQuery(true);\n $userid = JFactory::getUser()->id;\n\n // Select the required fields from the table.\n $query\n ->select(\n $this->getState(\n 'list.select', 'DISTINCT a.id, a.title, a.time_created, a.category_id, a.state'\n )\n );\n\n $query->from('`#__adverts79_adverts` AS a');\n\n $query->select('userApproval.link AS link');\n $query->join('INNER', '#__auto79_articles AS userApproval ON a.id = userApproval.postid');\n //$query->where('userApproval.user_approval = ' . $userid);\n \n $query->where('a.state = 0');\n \n $app = JFactory::getApplication();\n $getTemplate = $app->getTemplate('template');\n\n $province = $getTemplate->params['province'];\n if ($province) {\n $query->where('a.add_province = ' . $province);\n }\n\n // Add the list ordering clause.\n $orderCol = $this->state->get('list.ordering');\n $orderDirn = $this->state->get('list.direction');\n if ($orderCol == '') {\n $orderCol = \"a.time_updated\";\n }\n if ($orderDirn == '') {\n $orderDirn = \"DESC\";\n }\n if ($orderCol && $orderDirn) {\n $query->order($db->escape($orderCol . ' ' . $orderDirn));\n }\n// echo $query;\n// exit();\n return $query;\n }", "protected function _getQuery()\n {\n $sArticleTable = $this->_getViewName('oxarticles');\n $sCategoryTable = $this->_getViewName('oxobject2category');\n $sJoinTable = $this->_getViewName('ettm_project2article');\n $oConfig = \\OxidEsales\\Eshop\\Core\\Registry::getConfig();\n $sContainerName = $oConfig->getRequestParameter('cmpid');\n $sProjectId = \\OxidEsales\\Eshop\\Core\\DatabaseProvider::getDb()->quote($oConfig->getRequestParameter('projectid'));\n\n // Has target langs selected?\n $sJoins = '';\n if ($oConfig->getRequestParameter('targetlangs') && 1 !== intval($oConfig->getRequestParameter('nofilter'))) {\n $aTargetLangIds = explode(',', $oConfig->getRequestParameter('targetlangs'));\n foreach ($aTargetLangIds as $iTargetLangId) {\n // Get view and create join statement\n $sTableName = getViewName('oxarticles', $iTargetLangId);\n $sJoins .= \"JOIN $sTableName ON $sTableName.OXID = $sArticleTable.OXID AND $sTableName.OXTITLE = ''\";\n }\n }\n\n if ('container1' === $sContainerName) {\n $sAddtionalJoint = '';\n if (\\OxidEsales\\Eshop\\Core\\Registry::getConfig()->getRequestParameter('catid')) {\n // A category is selected\n $sCatId = \\OxidEsales\\Eshop\\Core\\DatabaseProvider::getDb()->quote(\n \\OxidEsales\\Eshop\\Core\\Registry::getConfig()->getRequestParameter('catid')\n );\n $sQAdd = \" from $sArticleTable\n LEFT JOIN $sJoinTable\n ON $sJoinTable.OXARTICLEID = $sArticleTable.OXID AND $sJoinTable.PROJECT_ID = $sProjectId\n INNER JOIN $sCategoryTable\n ON $sCategoryTable.OXOBJECTID = $sArticleTable.OXID AND $sCategoryTable.OXCATNID = $sCatId\n $sJoins\n WHERE $sJoinTable.OXID IS NULL\";\n } else {\n // No category is selected.\n $sQAdd = \" from $sArticleTable\n LEFT JOIN $sJoinTable\n ON $sJoinTable.OXARTICLEID = $sArticleTable.OXID AND $sJoinTable.PROJECT_ID = $sProjectId\n $sJoins\n WHERE $sJoinTable.OXID IS NULL\";\n }\n\n\n\n } else {\n $sQAdd = \" from $sArticleTable\n LEFT JOIN $sJoinTable\n ON $sJoinTable.OXARTICLEID = $sArticleTable.OXID\n WHERE $sJoinTable.OXID IS NOT NULL AND $sJoinTable.PROJECT_ID = $sProjectId\";\n }\n\n return $sQAdd;\n }", "public function distinct($val = TRUE)\n\t{\n\t\t$this->qb_distinct = is_bool($val) ? $val : TRUE;\n\t\treturn $this;\n\t}", "function buildQuery () {\n $select = array();\n $from = array();\n $where = array();\n $join = '';\n $rowLimit = '';\n $tables = array();\n\n if (!empty ($this->checkTables)) {\n\n foreach ($this->checkTables as $table) {\n\n // only include tables that have selected columns\n $columns = self::getCheckTableColumns( $table );\n\n if (!empty ($columns)) {\n\n $tables[] = $this->removeQuotes($table);\n\n // Assign select and where clauses\n //go through each column\n foreach ($columns as $column) {\n //Add is column to constraint if selected\n if (!empty( $this->formTableColumnFilterHash[$table][$column]['checkColumn'] )) {\n $select[] = $this->removeQuotes($table) . \".\" . $this->removeQuotes($column);\n }\n\n self::getColumnFilter ( $where,\n $table,\n $column,\n $this->formTableColumnFilterHash[$table][$column]['selectMinOper'],\n $this->formTableColumnFilterHash[$table][$column]['textMinValue'],\n $this->formTableColumnFilterHash[$table][$column]['selectMaxOper'],\n $this->formTableColumnFilterHash[$table][$column]['textMaxValue']);\n } // foreach $column\n } //if (!empty ($columns))\n } // foreach $table\n } //if (!empty ($this->checkTables))\n\n // If there is only one table add from clause to that, otherwise only add the join table\n\n //Calculate joins before FROM\n $join = $this->joinTables($this->checkTables);\n\n $fromStatement = \"FROM \";\n $tblCounter = 0;\n $joinarray = array();\n $uniqueJoinArray= array_unique($this->JOINARRAY);\n $tblTotal = count($tables) - count($uniqueJoinArray);\n\n // build the FROM statement using all tables and not just tables that have selected columns\n foreach ($this->checkTables as $t) {\n $tblCounter++;\n\n # don't add a table to the FROM statement if it is used in a JOIN\n if(!(in_array($t, $this->JOINARRAY))){\n $fromStatement .= $t;\n\n //if($tblCounter < $tblTotal){\n $fromStatement .= \", \";\n //} // if\n\n } // if\n } // foreach tables\n\n $fromStatement = preg_replace(\"/\\,\\s*$/\",\"\",$fromStatement);\n $from[] = $fromStatement;\n\n // Add something if there are no columns selected\n if ( count( $select ) == 0 ) {\n $select[] = '42==42';\n }\n\n // Let's combine all the factors into one big query\n $query = \"SELECT \" . join(', ',$select) . \"\\n\" . join(', ', $from) . \"\\n\" . $join;\n\n # Case non-empty where clause\n if ( count( $where ) > 0 ) {\n $query .= 'WHERE ' . join( \" AND \", $where );\n $query .= \"\\n\";\n }\n\n // Add Row Limit\n if ( !empty( $this->selectRowLimit ) ) {\n $rowLimit = \"LIMIT \" . $this->selectRowLimit;\n $query .= $rowLimit;\n $query .= \"\\n\";\n }\n\n return $query;\n }", "public function distinct($on = [], $overwrite = false);", "function buildQuery () {\n $select = array();\n $from = array();\n $where = array();\n $join = '';\n $rowLimit = '';\n\n if (!empty ($this->checkTables)) {\n foreach ($this->checkTables as $table) {\n $columns = self::getCheckTableColumns( $table );\n //go through each column\n if (!empty ($columns)) {\n //try to join tables\n if ( count ($this->checkTables) > 1 && $this->checkTables[0] != $table) {\n // Add JOIN condition\n $join .= self::buildQueryJoin( $this->checkTables[0], $table );\n }\n\n // Assign select and where clauses\n foreach ($columns as $column) {\n //Add is column to constraint if selected\n if (!empty( $this->formTableColumnFilterHash[$table][$column]['checkColumn'] )) {\n $select[] = self::getTableAlias ($table).\".\".$column.\" AS \".self::getTableAlias ($table).\"_\".$column;\n }\n\n self::getColumnFilter ( $where,\n $table,\n $column,\n $this->formTableColumnFilterHash[$table][$column]['selectColumnLogicOper'],\n $this->formTableColumnFilterHash[$table][$column]['selectMinOper'],\n $this->formTableColumnFilterHash[$table][$column]['textMinValue'],\n $this->formTableColumnFilterHash[$table][$column]['selectRangeLogicOper'],\n $this->formTableColumnFilterHash[$table][$column]['selectMaxOper'],\n $this->formTableColumnFilterHash[$table][$column]['textMaxValue']);\n\n } // foreach $column\n } //if (!empty ($columns))\n } // foreach $table\n // If there is only one table add from cluase to that else just the join table\n\t $from[] = \" FROM \".$this->checkTables[0].\" AS \".self::getTableAlias($this->checkTables[0]).\" \\n\"; //assign single table\n } //if (!empty ($this->checkTables))\n\n\n\n if ( $this->radioSpacialConstraint == 'Cone') {\n $join .= self::getConeSearch ($this->textConeRa,\n $this->textConeDec,\n $this->textConeRadius,\n $this->selectConeUnits);\n } //if\n\n else if ($this->radioSpacialConstraint == 'Box') {\n $join .= self::getBoxSearch ($this->textBoxRa,\n $this->textBoxDec,\n $this->textBoxSize,\n $this->selectBoxUnits);\n } // if\n\n // Assign survey filter\n if ( isset( $this->selectSurvey ) && $this->selectSurvey > 0 ) {\n $surveyFilter = self::getSurveyFilter();\n if ( !empty( $surveyFilter ) )\n $where[] = self::getSurveyFilter();\n }\n // Figure out the Astro Filter join\n if (!empty( $this->checkAstroFilterIDs ) ) {\n $astroFilter = self::getAstroFilterJoin();\n if ( !empty( $astroFilter ) )\n $where[] = $astroFilter;\n }\n\n // Add Row Limit\n if ( !empty( $this->selectRowLimit ) ) {\n $rowLimit = \"TOP \".$this->selectRowLimit.\" \";\n }\n // Add something if there are no columns selected\n if ( count( $select ) == 0 ) {\n $select[] = '42==42';\n }\n\n // Let's combine all the factors into one big query\n $query = \"SELECT \".$rowLimit.join(', ',$select).\"\\n\".join(', ', $from).$join;\n\n # Case non-empty where clause\n if ( count( $where ) > 0 ) {\n #Get rid of the first columns that starts with a logical operator of AND/OR\n $where[0] = preg_replace('/^\\s*(AND)|(OR)|(\\^)/', '', $where[0]);\n $query .= ' WHERE '.join( \"\\n \",$where );\n }\n return $query;\n }", "public function distinct($distinct = true) {\n\t\t$this->distinct = $distinct;\n\t}", "protected function getListQuery() {\n // Create a new query object.\n $db = $this->getDbo();\n $query = $db->getQuery(true);\n\n // Select the required fields from the table.\n $query->select(\n $this->getState(\n 'list.select', 'a.*'\n )\n );\n $query->from('`#__breedable` AS a');\n\n \n\t\t// Join over the users for the checked out user\n\t\t$query->select(\"uc.name AS editor\");\n\t\t$query->join(\"LEFT\", \"#__users AS uc ON uc.id=a.checked_out\");\n\t\t// Join over the category 'breedable_type'\n\t\t$query->select('breedable_type.title AS breedable_type');\n\t\t$query->join('LEFT', '#__categories AS breedable_type ON breedable_type.id = a.breedable_type');\n\t\t// Join over the user field 'created_by'\n\t\t$query->select('created_by.name AS created_by');\n\t\t$query->join('LEFT', '#__users AS created_by ON created_by.id = a.created_by');\n\n \n\n // Filter by search in title\n $search = $this->getState('filter.search');\n if (!empty($search)) {\n if (stripos($search, 'id:') === 0) {\n $query->where('a.id = ' . (int) substr($search, 3));\n } else {\n $search = $db->Quote('%' . $db->escape($search, true) . '%');\n\t\t\t\t$query->where('( a.status LIKE '.$search.' OR a.id LIKE '.$search.' OR a.breedable_name LIKE '.$search.' OR a.mother_name LIKE '.$search.' OR a.father_name LIKE '.$search.' OR a.owner_name LIKE '.$search.' OR a.owner_key LIKE '.$search.' OR a.breedable_gender LIKE '.$search.' )');\n \n }\n }\n\n\t\t//Filtering owner_name\n\t\t$filter_owner_name = $this->state->get(\"filter.owner_name\");\n\t\tif ($filter_owner_name != '') {\n\t\t\t$query->where(\"a.owner_name = '\".$db->escape($filter_owner_name).\"'\");\n\t\t}\n\t\t//Filtering status\n\n\t\t//Filtering generation\n\n\t\t//Filtering breedable_gender\n\t\t$filter_breedable_gender = $this->state->get(\"filter.breedable_gender\");\n\t\tif ($filter_breedable_gender != '') {\n\t\t\t$query->where(\"a.breedable_gender = '\".$db->escape($filter_breedable_gender).\"'\");\n\t\t}\n\n\t\t//Filtering breedable_eyes\n\n\t\t//Filtering breedable_fevor\n\n\t\t//Filtering breedable_pregnant\n\n\n // Add the list ordering clause.\n $orderCol = $this->state->get('list.ordering');\n $orderDirn = $this->state->get('list.direction');\n if ($orderCol && $orderDirn) {\n $query->order($db->escape($orderCol . ' ' . $orderDirn));\n }\n\n return $query;\n }", "public function queryAll();", "public function queryAll();", "public function queryAll();", "public function queryAll();", "public function queryAll();", "public function queryAll();", "public function queryAll();", "public function queryAll();", "public function queryAll();", "public function queryAll();", "public function queryAll();", "public function queryAll();", "public function queryAll();", "public function queryAll();", "public function queryAll();", "public function queryAll();", "public function queryAll();", "public function queryAll();", "public function queryAll();", "public function queryAll();", "public function queryAll();", "public function queryAll();", "public function queryAll();", "public function queryAll();", "public function queryAll();", "private function __select() {\n $from_str = $this->getFromStr();\n $field = $this->field_str;\n if (empty($field)) {\n $field = '*';\n }\n $sql = \"SELECT {$field} FROM {$from_str}\";\n if (!empty($this->join_str_list)) {\n $temp = implode(' ', $this->join_str_list);\n $sql .= \" {$temp}\";\n }\n if (!empty($this->where_str)) {\n $sql .= \" WHERE {$this->where_str}\";\n }\n if (!empty($this->group_str)) {\n $sql .= \" GROUP BY {$this->group_str}\";\n }\n if (!empty($this->order_str)) {\n $sql .= \" ORDER BY {$this->order_str}\";\n }\n if (!empty($this->limit_str)) {\n $sql .= \" LIMIT {$this->limit_str}\";\n }\n $list = $this->query($sql);\n return $list;\n }", "private function init_consolidationAndSelect()\n {\n // RETURN : there isn't any filter\n if ( !$this->bool_isFilter )\n {\n return;\n }\n // RETURN : there isn't any filter\n // Add tableUids to the consolidation array\n $this->init_consolidationAndSelect_setArrayConsolidation();\n\n // Add tableFields to the ts property SELECT\n $this->init_consolidationAndSelect_setTsSelect();\n }", "public function getCollectionQuery(): Builder;", "public function build_query(/* ... */)\n {\n $query = [\"SELECT\"];\n $model = $this->get_model();\n // Field selection\n $fields = [];\n foreach ($this->_fields as $_field) {\n $fields[] = $this->_build_select_field($_field);\n }\n $query[] = implode(', ', $fields);\n // Table Selection\n $query[] = 'FROM';\n $query[] = '`' . $model->get_table() . '`';\n // WHERE lookup\n $query[] = $this->build_where();\n if (null !== $this->_orderby) {\n $query[] = $this->_orderby;\n }\n if (null !== $this->_limit) {\n $query[] = $this->_limit;\n }\n return $model->get_connection()->prepare(implode(\" \", $query));\n }", "public function assemble()\n {\n $queryString = array();\n\n $queryString[] = $this->query['type'];\n\n // Select query\n if ($this->query['type'] == \"SELECT\"\n or $this->query['type'] == \"SELECT DISTINCT\") {\n // Build columns to select\n $queryString[] = $this->buildSelectColumns();\n\n // From\n $queryString[] = \"FROM `{$this->query['table']}`\";\n\n // Joins\n if (array_key_exists('joins', $this->query)) {\n $queryString[] = $this->buildJoins();\n }\n\n // Where\n $queryString[] = $this->buildWhere();\n\n // Custom SQL\n if (array_key_exists('sql', $this->query)) {\n $queryString[] = $this->query['sql'];\n }\n\n // Order by\n if (array_key_exists('order_by', $this->query)) {\n $queryString[] = \"ORDER BY \" . implode(\", \", $this->query['order_by']);\n }\n }\n // Insert\n elseif ($this->query['type'] == \"INSERT INTO\") {\n // Table\n $queryString[] = \"`{$this->query['table']}`\";\n\n // Get the columns and values\n $columns = $values = array();\n foreach ($this->query['data'] as $column => $value) {\n $columns[] = $this->columnName($column);\n $values[] = $this->processValue($value);\n }\n\n // Add columns and values to query\n $queryString[] = \"(\" . implode(',', $columns) . \")\";\n $queryString[] = \"VALUES (\" . implode(',', $values) . \")\";\n }\n // Update\n elseif ($this->query['type'] == \"UPDATE\") {\n // Table\n $queryString[] = \"`{$this->query['table']}`\";\n\n // Set values\n $values = array();\n foreach ($this->query['data'] as $column => $value) {\n // Process column name\n $column = $this->columnName($column);\n\n // Add value to bind queue\n $valueBindKey = \"new_\" . str_replace(array('.', '`'), array('_', ''), $column);\n $this->valuesToBind[$valueBindKey] = $value;\n\n // Add to values\n $values[] = $column . \" = :{$valueBindKey}\";\n }\n\n // Add values to query\n $queryString[] = \"SET \" . implode(\", \", $values);\n\n $queryString[] = $this->buildWhere();\n }\n // Delete from\n elseif ($this->query['type'] == \"DELETE\") {\n // Table\n $queryString[] = \"FROM `{$this->query['table']}`\";\n\n // Where\n $queryString[] = $this->buildWhere();\n }\n\n return implode(\" \", str_replace(\"{prefix}\", $this->prefix, $queryString));\n }", "private function makeQuerySplit(){\n\t\t\n\t\t$this->searchQ['select'] = array('l.name','l.level_id AS levelId','l.summary','l.sum_approach','l.sum_problems','l.address_line_1','l.address_line_2','l.town','l.county','l.postcode','l.country','l.phone','l.image','l.latitude','l.longitude','l.publish_address','l.publish_phone','l.approved','p.uri','p.urlname','e.level','y.listing_type');\n\t\t$this->searchQ['orderby'][] = 'levelId DESC';\n\t\t$this->searchQ['from'] = 'listing l, listing_level e, listing_type y, pages p'; //should always be the same...\n\t\t$this->searchQ['where'] = array('e.level_id = l.level_id','y.listing_type_id = l.listing_type_id','l.page_id = p.page_id','l.publish = 1');//,'p.publish = 1');\n\t\t\n\t\t\n\t\t//! freetext\n\t\tif( strlen($this->vars['term']) ){\n\t\t\t$this->searchQ['select'][] = \"MATCH(\" . $this->ftfields . \") AGAINST ('\" . $this->booleanAndTerm($this->vars['term']) . \"' IN BOOLEAN MODE) AS score\";\n\t\t\t//$this->searchQ['where'][] = \"MATCH(\" . $ftfields . \") AGAINST ('\" . $this->booleanAndTerm($this->vars['term']) . \"' IN BOOLEAN MODE)\";\n\t\t\t// use having rather than where\n\t\t\t$this->searchQ['having'][] = \"score > 0\";\n\t\t\t$this->searchQ['orderby'][] = 'score DESC';\n\t\t\t$this->doSearch = true;\n\t\t}\n\t\t\n\t\t\n\t\t//! **** FILTERS ****\n\t\t//! profession\n\t\tif( isset($this->vars['profession']) && strlen($this->vars['profession']) ){\n\t\t\n\t\t\t//$this->searchQ['where'][] = \" l.listing_type_id IN (\" . implode(',', $this->vars['profession']) . \") \";\n\t\t\t$this->searchQ['where'][] = \" l.listing_type_id = \" . (int)$this->vars['profession'] . \" \";\n\t\t\t$this->doSearch = true;\n\t\t}\n\t\t//! max price\n\t\tif( isset($this->vars['maxprice']) && is_numeric($this->vars['maxprice']) ){\n\t\t\n\t\t\t$this->searchQ['where'][] = \" l.hourly_rate <= \" . (int)$this->vars['maxprice'] . \" \";\n\t\t\t$this->doSearch = true;\n\t\t}\n\t\t\n\t\t//! gender\n\t\tif( isset($this->vars['gender']) && in_array($this->vars['gender'] , array('M','F')) ){\n\t\t\n\t\t\t$this->searchQ['from'] .= ', listing_to_gender ltg';\n\t\t\t$this->searchQ['where'][] = \" ltg.listing_id = l.listing_id \";\n\t\t\t$this->searchQ['where'][] = \" ltg.gender = '\" . $this->vars['gender'] . \"' \";\n\t\t\t$this->doSearch = true;\n\t\t}\n\t\n\t\t//! speciality\n\t\tif( isset($this->vars['speciality']) && is_numeric($this->vars['speciality']) ){\n\t\t\n\t\t\t$this->searchQ['from'] .= ', listing_to_age ltag';\n\t\t\t$this->searchQ['where'][] = \" ltag.listing_id = l.listing_id \";\n\t\t\t$this->searchQ['where'][] = \" ltag.age_id = \" . (int)$this->vars['speciality'] . \" \";\n\t\t\t$this->doSearch = true;\n\t\t}\n\t\t\n\t\tif( strlen($this->vars['location']) ){\n\t\t\t//! ** build the location query **\n\t\t\t\n\t\t\t$this->Geocode = new Geolocation( $this->vars['location']. ', UK' );\n\t\t\t$this->Geocode->lookup();\n\t\t\t$union = array();\n\t\t\t\n\t\t\t$this->doSearch = true;\n\t\t\t$this->searchQ['orderby'][] = 'distance ASC';\n\t\t\t$c = 1;\t\n\t\t\tforeach($this->searchLevels as $level_id => $distance){\n\t\t\t// set up the initial search variables\t\t\n\t\t\t//! location\n\t\t\t\t\n\t\t\t\t//load in current other query info for this level\n\t\t\t\t$l_select = $this->searchQ['select'];\n\t\t\t\t$l_where = $this->searchQ['where'];\n\t\t\t\t$l_having = $this->searchQ['having'];\n\t\t\t\t\n\t\t\t\t// using the OS grid as makes calculation simpler than using lng/lat - can use simple pythag rather than calculus functions\n\t\t\t\t// we shorten the list of rows needing the calculation by the greater / less than in the where\n\t\t\t\t\n\t\t\t\t$calculation = ' SQRT(POW(( l.easting - ' . round($this->Geocode->getOSEast()) . '),2) + POW((l.northing - ' . round($this->Geocode->getOSNorth()) . '),2)) ';\n\t\t\t\t$l_select[] = $calculation . \" AS distance\";\n\t\t\t\t$l_where[] = \"l.level_id = \" . $level_id;\n\t\t\t\t$l_where[] = \"northing < \" . round( $this->Geocode->getOSNorth() + $distance ) ; \n\t\t\t\t$l_where[] = \"northing > \" . round( $this->Geocode->getOSNorth() - $distance ) ;\n\t\t\t\t$l_where[] = \"easting < \" . round( $this->Geocode->getOSEast() + $distance ) ;\n\t\t\t\t$l_where[] = \"easting > \" . round( $this->Geocode->getOSEast() - $distance ) ;\n\t\t\t//\t$this->searchQ['where'][] = \"(\" . $calculation . \") <= \" . $this->searchDistance ;\n\t\t\t// use having rather than where\n\t\t\t\t$l_having[] = \"distance <= \" . $distance;\n\t\t\t\t//$this->searchQ['orderby'][] = 'distance ASC';\n\t\t\t\t\n\t\t\t\t$l_q = \"SELECT \" . (($this->numRows) && 1 == $c ?' SQL_CALC_FOUND_ROWS ':'') . implode(',', $l_select). \"\n\t\t\t\t\tFROM \" . $this->searchQ['from'] . \"\n\t\t\t\t\tWHERE\n\t\t\t\t\t\t\" . implode(' AND ', $l_where) ;\n\t\n\t\t\t\tif( count($l_having) ){\n\t\t\t\t\t$l_q .= \" HAVING \" . implode(' AND ' , $l_having);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$union[] = $l_q;\n\t\t\t\t$c++;\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t$q = '(' . implode(' ) UNION ALL (', $union) . ') ';\n\t\t\t\n\t\t\t$q .= \"\tORDER BY \" . implode(',', $this->searchQ['orderby']) . \" \";\n\t\t\t$q .= \"\tLIMIT \" . ( ($this->page-1)* $this->limit) . \",\" . $this->limit . \" \";\n\t\t\n\t\t\n\t\t}else{\n\t\t\n\t\t\n\t\t\t//! ** build the non-location query **\n\t\t\t$q = \"SELECT \" . (($this->numRows)?' SQL_CALC_FOUND_ROWS ':'') . implode(',', $this->searchQ['select']). \"\n\t\t\t\t\tFROM \" . $this->searchQ['from'] . \"\n\t\t\t\t\tWHERE\n\t\t\t\t\t\t\" . implode(' AND ', $this->searchQ['where']) ;\n\t\t\t\t\t\t\n\t\t\tif( isset($this->searchQ['having']) && count($this->searchQ['having']) ){\n\t\t\t\t$q .= \" HAVING \" . implode(' AND ' , $this->searchQ['having']);\n\t\t\t}\n\t\t\t\n\t\t\t$q .= \"\tORDER BY \" . implode(',', $this->searchQ['orderby']) . \" \";\n\t\n\t\t\t$q .= \"\tLIMIT \" . ( ($this->page-1)* $this->limit) . \",\" . $this->limit . \" \"; \n\t\t}\n\t\t//echo $q;\t\t\n\t\treturn $q;\n\t\t\n\t}", "public function buildUnionQuery($type = 'DISTINCT') {\n if (empty($this->union)) {\n throw new \\Exception('Cannot build a union query', 500);\n }\n\n $this->query = implode(\" UNION {$type} \", $this->union);\n $this->union = [];\n\n return $this;\n }", "private function cleanQuery()\n {\n $this->where = [];\n $this->bind = [];\n\n return $this;\n }", "protected function prepareQuery()\n {\n if (false === $this->isQueryPrepared) {\n $options = array(\n SelectorSourceInterface::RESULT => SelectorSourceInterface::RESULT_IDENTIFIERS,\n SelectorSourceInterface::LIMIT => $this->limit,\n SelectorSourceInterface::OFFSET => $this->offset,\n SelectorSourceInterface::ORDERBY => $this->orderBy,\n SelectorSourceInterface::GROUPBY => $this->groupBy,\n );\n $this->setIdsArray(\n $this->source->loadIds(\n $this->criterias,\n array_merge($this->options, $options)\n ),\n array_merge($this->options, $options)\n );\n $this->isQueryPrepared = true;\n }\n\n return $this;\n }", "public function query() {\n // Leave empty to avoid a query on this field.\n }", "public function distinct(array $fields, $as = null);", "public function query() {\n\n // new, more inclusive\n $query = parent::query();\n // Add in book parent child relationships.\n $query->leftJoin('book', 'b', 'n.nid = b.nid');\n $query->addField('b', 'bid', 'book_id');\n $query->leftJoin('menu_links', 'ml', 'b.mlid = ml.mlid');\n $query->addField('ml', 'weight', 'book_weight');\n $query->addField('ml', 'mlid', 'mlid');\n $query->addField('ml', 'plid', 'plid');\n $query->orderBy('mlid');\n\n // dpq($query);\n return $query;\n }", "protected function getListQuery() {\n // Create a new query object.\n $db = $this->getDbo();\n $query = $db->getQuery(true);\n\n // Select the required fields from the table.\n $query->select(\n $this->getState(\n 'list.select', 'DISTINCT a.*'\n )\n );\n $query->from('`#__pedigree_dogs` AS a');\n\n \n\t\t// Join over the users for the checked out user\n\t\t$query->select(\"uc.name AS editor\");\n\t\t$query->join(\"LEFT\", \"#__users AS uc ON uc.id=a.checked_out\");\n\t\t// Join over the foreign key 'id_sire'\n\t\t$query->select('#__pedigree_dogs_1067710.name AS dogs_name_1067710');\n\t\t$query->join('LEFT', '#__pedigree_dogs AS #__pedigree_dogs_1067710 ON #__pedigree_dogs_1067710.id = a.id_sire');\n\t\t// Join over the foreign key 'id_dam'\n\t\t$query->select('#__pedigree_dogs_1067711.name AS dogs_name_1067711');\n\t\t$query->join('LEFT', '#__pedigree_dogs AS #__pedigree_dogs_1067711 ON #__pedigree_dogs_1067711.id = a.id_dam');\n\t\t// Join over the foreign key 'id_color'\n\t\t$query->select('#__pedigree_colors_1067722.color AS colors_color_1067722');\n\t\t$query->join('LEFT', '#__pedigree_colors AS #__pedigree_colors_1067722 ON #__pedigree_colors_1067722.id = a.id_color');\n\t\t// Join over the foreign key 'id_pattern'\n\t\t$query->select('#__pedigree_patterns_1067724.pattern AS patterns_pattern_1067724');\n\t\t$query->join('LEFT', '#__pedigree_patterns AS #__pedigree_patterns_1067724 ON #__pedigree_patterns_1067724.id = a.id_pattern');\n\t\t// Join over the user field 'created_by'\n\t\t$query->select('created_by.name AS created_by');\n\t\t$query->join('LEFT', '#__users AS created_by ON created_by.id = a.created_by');\n\n \n\n\t\t// Filter by published state\n\t\t$published = $this->getState('filter.state');\n\t\tif (is_numeric($published)) {\n\t\t\t$query->where('a.state = ' . (int) $published);\n\t\t} else if ($published === '') {\n\t\t\t$query->where('(a.state IN (0, 1))');\n\t\t}\n\n // Filter by search in title\n $search = $this->getState('filter.search');\n if (!empty($search)) {\n if (stripos($search, 'id:') === 0) {\n $query->where('a.id = ' . (int) substr($search, 3));\n } else {\n $search = $db->Quote('%' . $db->escape($search, true) . '%');\n $query->where('( a.name LIKE '.$search.' OR a.id_sire LIKE '.$search.' OR a.id_dam LIKE '.$search.' OR a.birth_date LIKE '.$search.' OR a.titles_prefix LIKE '.$search.' OR a.titles_suffix LIKE '.$search.' )');\n }\n }\n\n \n\n\t\t//Filtering sex\n\t\t$filter_sex = $this->state->get(\"filter.sex\");\n\t\tif ($filter_sex) {\n\t\t\t$query->where(\"a.sex = '\".$db->escape($filter_sex).\"'\");\n\t\t}\n\n\t\t//Filtering id_color\n\t\t$filter_id_color = $this->state->get(\"filter.id_color\");\n\t\tif ($filter_id_color) {\n\t\t\t$query->where(\"a.id_color = '\".$db->escape($filter_id_color).\"'\");\n\t\t}\n\n\t\t//Filtering id_pattern\n\t\t$filter_id_pattern = $this->state->get(\"filter.id_pattern\");\n\t\tif ($filter_id_pattern) {\n\t\t\t$query->where(\"a.id_pattern = '\".$db->escape($filter_id_pattern).\"'\");\n\t\t}\n\n\n // Add the list ordering clause.\n $orderCol = $this->state->get('list.ordering');\n $orderDirn = $this->state->get('list.direction');\n if ($orderCol && $orderDirn) {\n $query->order($db->escape($orderCol . ' ' . $orderDirn));\n }\n\n return $query;\n }" ]
[ "0.73801637", "0.68905646", "0.66596866", "0.65796715", "0.63142896", "0.625318", "0.6240564", "0.62214226", "0.6062473", "0.60508835", "0.59552556", "0.5913799", "0.5882746", "0.58796746", "0.5861371", "0.57754207", "0.5745056", "0.5741512", "0.5731788", "0.5678753", "0.56777763", "0.56756085", "0.5640071", "0.56381637", "0.56266165", "0.562357", "0.5615215", "0.5609552", "0.5557246", "0.5539765", "0.5537887", "0.5534348", "0.55125105", "0.54932666", "0.5492121", "0.54851866", "0.5478592", "0.5461602", "0.5457406", "0.54566395", "0.5444018", "0.54363865", "0.54344064", "0.5426388", "0.541383", "0.54131067", "0.5390881", "0.5382327", "0.53706706", "0.5352921", "0.53376484", "0.5332928", "0.5327937", "0.53226024", "0.5320427", "0.53138286", "0.53117216", "0.5304577", "0.5303843", "0.52948195", "0.5290392", "0.52792215", "0.5275944", "0.5275944", "0.5275944", "0.5275944", "0.5275944", "0.5275944", "0.5275944", "0.5275944", "0.5275944", "0.5275944", "0.5275944", "0.5275944", "0.5275944", "0.5275944", "0.5275944", "0.5275944", "0.5275944", "0.5275944", "0.5275944", "0.5275944", "0.5275944", "0.5275944", "0.5275944", "0.5275944", "0.5275944", "0.52697426", "0.5269477", "0.5265578", "0.5262862", "0.52504414", "0.524163", "0.5229909", "0.52262896", "0.52191657", "0.52080196", "0.51980656", "0.51876366", "0.5185808" ]
0.5750942
16
Adds a field to the list to be SELECTed.
public function addField($table_alias, $field, $alias = NULL);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function addField();", "public function addField($field) {\n\t\t$this->fields[] = $field;\n\t}", "public function add_field(form_item $field) {\n $this->_fields[] = $field;\n }", "public function addField(Field $field);", "public function addField(Field $field);", "function addToField(\\Foundation\\Form\\Field $field);", "public function add_selector_field($field) {\n $this->selector_fields[]=$field;\n }", "public function addField(Field $field) {\n\t\t$this->fields[] = $field;\n\t}", "function fill_in_additional_list_fields()\r\n\t{\r\n\t}", "public function add(Field $field)\n\t{\n\t\t$this->addItem($field);\n\t}", "public function add(Field $field)\n\t{\n\t\t$this->addItem($field);\n\t}", "public function addField(string $field)\n {\n // verify if it exists\n if (!in_array($field, $this->fields, true)) {\n $this->fields[] = $field;\n }\n }", "public function addExtraField($field,$value){\n $this->extraFields[$field] = $value;\n }", "public function testBuildSelectWithAddField()\n {\n $query = $this->getQuery()\n ->addField('user@email', 'email')\n ;\n\n $this->assertSame(\n \"*, 'user@email' AS email\",\n $query->buildSelectFields()\n );\n }", "public function makeFieldList() {}", "public function addField(DataField $field)\r\n\t{\r\n\t\t$this->fields[] = $field;\r\n\t\tif ($field instanceOf TableField && $field->isPrimaryKey)\r\n\t\t{\r\n\t\t\t$this->primaryKey = $field->name;\r\n\t\t}\r\n\t}", "public function addField(Element &$field)\n {\n $this->fields[] = $field;\n }", "public function addField($field, $value=null) {\n $this->fields[] = $field;\n if ($value != null) $this->set($field, $value);\n }", "public function addField($field, array $data)\n {\n $this->fields[$field] = $this->prepareField($data);\n }", "function add(){\n global $wpdb;\n global $DOPBSP;\n \n $field_id = $_POST['field_id'];\n $position = $_POST['position'];\n $language = $_POST['language'];\n \n $wpdb->insert($DOPBSP->tables->forms_fields_options, array('field_id' => $field_id,\n 'position' => $position,\n 'translation' => $DOPBSP->classes->translation->encodeJSON('FORMS_FORM_FIELD_SELECT_ADD_OPTION_LABEL')));\n $id = $wpdb->insert_id;\n $select_option = $wpdb->get_row($wpdb->prepare('SELECT * FROM '.$DOPBSP->tables->forms_fields_options.' WHERE id=%d',\n $id));\n \n $DOPBSP->views->backend_form_field_select_option->template(array('select_option' => $select_option,\n 'language' => $language));\n \n die();\n }", "public function add_field( $read = false, $sel = false ) {\n\t\t$this->read_only = $read;\n\t\t$this->selectable = $sel;\n\t\tparent::add_field();\n\t}", "public function addField(Field $field){\n $getter = 'get' . ucfirst($field->getName());\n $field->setValue($this->getEntity()->$getter());\n $this->fields[] = $field;\n return $this;\n }", "public function addField($field_name){\n\t\t$this->Fields[$field_name] = new Field($field_name);\n\t}", "function add_field($field, $value) {\n // sent to paypal as POST variables. If the value is already in the\n // array, it will be overwritten.\n\n $this->fields[\"$field\"] = $value;\n }", "public function field($field)\n {\n $prefix = $this->containsSQLParts('field') ? self::LIST_DELIMITER : '';\n $this->unsafeAppendSQLPart('field', $prefix . $this->asTickedString($field));\n return $this;\n }", "public function addField( $table, $field, $type, $default=NULL );", "public function setSelectFields()\r\n\t{\r\n\t\t$fields = func_get_args();\r\n\t\tif (empty($fields))\r\n\t\t{\r\n\t\t\tthrow new \\Exception('Select fields list is not an array or empty.');\r\n\t\t}\r\n\t\r\n\t\t// Check if fields exist in fields collection\r\n\t\tforeach($fields as &$item)\r\n\t\t{\r\n\t\t\t$found = false;\r\n\t\t\tforeach ($this->fields as &$field)\r\n\t\t\t{\r\n\t\t\t\tif ($item == $field->name)\r\n\t\t\t\t{\r\n\t\t\t\t\t$found = true;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\t\r\n\t\t\tif (!$found)\r\n\t\t\t{\r\n\t\t\t\tthrow new \\Exception('There is no field \"' . $item . '\" in table ' . $this->name . '.');\r\n\t\t\t}\r\n\t\r\n\t\t\t// Add to list\r\n\t\t\tif ($this->hasForeignFields())\r\n\t\t\t{\r\n\t\t\t\t$item = 't1.`' . $item . '`';\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t$item = '`' . $this->name . '`.`' . $item . '`';\r\n\t\t\t}\r\n\t\t}\r\n\t\r\n\t\t$this->selectFields = $fields;\r\n\t}", "public function field($field)\n {\n $this->fields[] = $field;\n\n return $this;\n }", "public function addField($field, $xpath) {\n $this->extraFields[$field] = $xpath;\n }", "function add_form_field($field, $error = \"\", $prefill = \"\"){\n\t\t$this->form_row($field, $error , $prefill );\n\t}", "function add_field($field, $value) {\n // sent to paypal as POST variables. If the value is already in the \n // array, it will be overwritten.\n \n $this->fields[\"$field\"] = $value;\n }", "public function select($field);", "public function addField($field)\n {\n $this->fields[] = $field;\n\n return $this;\n }", "public function addField(FieldDescriptor $field)\n {\n $this->_fields[] = $field;\n }", "function add_field($field, $value) \n {\n // sent to paypal as POST variables. If the value is already in the \n // array, it will be overwritten.\n \n $this->fields[\"$field\"] = $value;\n }", "function addField($f, $as=null) {\n\t\tif ($f != \"*\") {\n\t\t\t$f = \"`\".$f.\"`\";\n\t\t}\n\t\t$this->fields[] = array($this->getTable().\".\".$this->db->escape_string($f), $this->db->escape_string($as));\n\t\treturn $this;\n\t}", "public function add_field( $name, $field ) {\n\n\t\t$this->custom_fields[ $name ] = $field;\n\n\t}", "public function addField ($name)\n {\n return $this->addFieldFromSource($name, DataModel_Definition::SOURCE_DB);\n }", "public function testBuildSelectWithAddFieldExpression()\n {\n $query = $this->getQuery()\n ->addField(Expression::apishka('NOW()'), 'current_time')\n ;\n\n $this->assertSame(\n '*, NOW() AS current_time',\n $query->buildSelectFields()\n );\n }", "public function addField($data) {\n $field = $data['field'];\n $class = 'AetherORM' . ucfirst($data['type']) . 'Field';\n $this->fields[$field] = new $class($data['default'], $data['null']);\n }", "public function addFieldToModel($field)\n {\n\t$sql= $this->sql('insert into [fields] values( null, %s, %s, %s, %s)',\n\t $field->getName(),\n\t $field->getModel()->getTableName(),\n\t $field->getHash(),\n\t get_class($field));\n\n\t$this->queue(\n\t PerfORMStorage::FIELD_ADD,\n\t $field->getName().'|'.$field->getModel()->getTableName(),\n\t $sql,\n\t array(\n\t\t'field' => $field,\n\t\t)\n\t);\n\n\t$key= $field->getHash().'|'.$field->getModel()->getTableName();\n\tif ( key_exists($key, $this->renamedFields))\n\t{\n\t $array= $this->renamedFields[$key];\n\t $array->counter++;\n\t $array->to= $field->getName();\n\t}\n\telse\n\t{\n\t $this->renamedFields[$key]= (object) array(\n\t 'counter' => 1,\n\t 'to' => $field->getName(),\n\t 'modelName' => $field->getModel()->getTableName(),\n\t );\n\t}\n }", "public function addField( $field=null )\n {\n if( is_string( $field ) )\n $field = new WebLab_Data_Field( $field );\n\n if( empty( $field ) )\n \treturn null;\n \n $field->setTable( $this );\n $name = $field->getAlias();\n if( empty( $name ) ) {\n $name = $field->getName();\n }\n $this->_fields[ $name ] = $field;\n\n return $field;\n }", "public function AddField()\n {\n echo 'Создалась VirtualCategory - метод Field <hr>';\n }", "public function addSelect($fieldName, $enforcedFieldType = null);", "public function add(UpdateFieldInterface $field)\n {\n $this->add[] = $field;\n }", "function acf_add_local_field($field, $prepared = \\false)\n{\n}", "function addFieldToForm($field, $bAddToMap = true){\r\n\t\treturn $this->fields->addFieldToForm($field, $bAddToMap);\r\n\t}", "private function push_select_field(string $field = '', $data): self\n\t{\n\t\tif ($field != '' && isset($data))\n\t\t{\n\t\t\tif (!array_key_exists($field, $this->selects))\n\t\t\t{\n\t\t\t\t$this->selects[$field] = [];\n\t\t\t}\n\n\t\t\tif (is_array($data))\n\t\t\t{\n\t\t\t\t$this->selects[$field] = array_replace_recursive($this->selects[$field], $data);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->selects[$field] = $data;\n\t\t\t}\n\t\t}\n\n\t\treturn $this;\n\t}", "function render_field_select($field)\n {\n }", "public function addField(MappedField $field, string $key): void\n {\n $this->fields[$key] = $field;\n }", "public function field($field)\n {\n $this->fields[] = self::quote_name($field);\n return $this;\n }", "public function setFieldList($aFieldList)\n {\n $this->_aFieldList = $aFieldList;\n }", "public function select ( \\r8\\Form\\Select $field )\n {\n $this->addField( \"select\", $field );\n }", "public function addFields($fields ) {\n foreach( $fields as $field ) {\n $this->addField( $field );\n }\n }", "public function register_field()\n {\n }", "public function addSelect($column);", "public function field($field) {\n\t array_push($this->parameters['field'], $field);\n\t $this->parameters['field'] = array_unique($this->parameters['field']);\n\t\treturn $this;\n\t}", "function add_additional_field($details) {\r\n\t\t$sql = \"INSERT INTO sys_man_additional_fields (field_name, field_type, field_placement, group_id) VALUES (?, ?, ?, ?)\";\r\n\t\t$data=array(\"$details->field_name\", \"$details->field_type\", \"$details->field_placement\", \"$details->group_id\");\r\n\t\t$query = $this->db->query($sql, $data);\r\n\t\treturn;\r\n\t}", "public final function addField($val)\n {\n // array as func param?\n if (is_array($val))\n foreach ( $val as $fld )\n $this->fields[] = $fld;\n else\n $this->fields[] = $val;\n\n return $this;\n }", "public function testBuildSelectWithEmptyFieldsAndAddField()\n {\n $query = $this->getQuery()\n ->fields()\n ->addField('user@email', 'email')\n ;\n\n $this->assertSame(\n \"'user@email' AS email\",\n $query->buildSelectFields()\n );\n }", "public function actionAdd()\n\t{\n\t\t$formId = $this->_input->filterSingle('form_id', XenForo_Input::UINT);\n\t\t$type = $this->_input->filterSingle('type', XenForo_Input::STRING);\n\t\t\n\t\t$fieldModel = $this->_getFieldModel();\n\t\t$fieldTypes = $fieldModel->getCountByType();\n\t\t\n\t\t$options = array();\n\t\t$options[] = array(\n\t\t 'value' => 'user',\n\t\t 'label' => new XenForo_Phrase('field'),\n\t\t 'selected' => true\n\t\t);\n\t\t\n\t\t// if global fields exist, include in the types\n\t\tif (array_key_exists('global', $fieldTypes))\n\t\t{\n\t\t\t$options[] = array(\n\t\t\t 'value' => 'global',\n\t\t\t 'label' => new XenForo_Phrase('global_field')\n\t\t\t);\n\t\t}\n\t\t\n\t\t// if template fields exist, include in the types\n\t\tif (array_key_exists('template', $fieldTypes))\n\t\t{\n\t\t\t$options[] = array(\n\t\t\t 'value' => 'template',\n\t\t\t 'label' => new XenForo_Phrase('template_field') \n\t\t\t);\n\t\t}\n\t\t\n\t\t// if there are no options other than user, just send them to the add field page\n\t\tif (!$type && count($options) == 1)\n\t\t{\n\t\t\t$type = 'user';\n\t\t}\n\t\t\n\t\t// association a field to a form\n\t\tif ($formId && $type)\n\t\t{\n\t\t\t$default = array(\n\t\t\t\t'field_id' => null,\n\t\t\t\t'form_id' => $this->_input->filterSingle('form_id', XenForo_Input::UINT),\n\t\t\t\t'display_order' => $this->_getFieldModel()->getGreatestDisplayOrderByFormId($formId) + 10,\n\t\t\t\t'field_type' => 'textbox',\n\t\t\t\t'field_choices' => '',\n\t\t\t\t'match_type' => 'none',\n\t\t\t\t'match_regex' => '',\n\t\t\t\t'match_callback_class' => '',\n\t\t\t\t'match_callback_method' => '',\n\t\t\t\t'max_length' => 0,\n\t\t\t\t'min_length' => 0,\n\t\t\t\t'required' => 0,\n\t\t\t\t'type' => $type,\n\t\t\t\t'active' => 1,\n\t\t\t\t'pre_text' => '',\n\t\t\t\t'post_text' => ''\n\t\t\t);\n\t\t\t\n\t\t\tswitch ($type)\n\t\t\t{\n\t\t\t case 'global':\n\t\t {\n\t\t return $this->responseReroute('KomuKu_SimpleForms_ControllerAdmin_Form', 'add-global-field');\n\t\t }\n\t\t\t case 'template':\n\t\t {\n\t\t return $this->responseReroute('KomuKu_SimpleForms_ControllerAdmin_Form', 'add-template-field');\n\t\t }\n\t\t\t default:\n\t\t {\n\t\t return $this->_getFieldAddEditResponse($default);\n\t\t }\n\t\t\t}\n\t\t}\n\t\t\n\t\t// adding a global/template field\n\t\telse if (!$formId && $type)\n\t\t{\n\t\t $default = array(\n\t 'field_id' => null,\n\t 'field_type' => 'textbox',\n\t 'field_choices' => '',\n\t 'match_type' => 'none',\n\t 'match_regex' => '',\n\t 'match_callback_class' => '',\n\t 'match_callback_method' => '',\n\t 'max_length' => 0,\n\t\t \t'min_length' => 0,\n\t 'type' => $type,\n\t\t \t'pre_text' => '',\n\t\t \t'post_text' => ''\n\t\t );\n\t\t \n\t\t if ($type != 'global')\n\t\t {\n\t\t \t$default['display_order'] = 1;\n\t\t \t$default['required'] = 0;\n\t\t \t$default['active'] = 1;\n\t\t }\n\t\t \n\t\t return $this->_getFieldAddEditResponse($default);\n\t\t}\n\t\t\n\t\t// association type\n\t\telse\n\t\t{\n\t\t\t$viewParams = array(\n\t\t\t\t'formId' => $formId,\n\t\t\t\t'options' => $options\n\t\t\t);\n\t\t\t\n\t\t\treturn $this->responseView('KomuKu_SimpleForms_ViewAdmin_Field_AddType', 'kmkform__field_add_type', $viewParams);\n\t\t}\n\t}", "public function add(string $fieldName): static;", "public function addField(string $card, \\stdClass $field): void\n {\n if (false === $this->hasCard($card)) {\n $this->addCard($card);\n }\n\n $this->getGroup($card)->fields[] = $field;\n }", "public function addColumn($field, $alias = null, $mutator = null)\n\t{\n\t\t$this->_type = self::SELECT;\n\t\t\n\t\tif (empty($field)) {\n\t\t\treturn $this;\n\t\t}\n\t\t\n\t\tif(reset($this->_dqlParts[\"select\"][0]->getParts()) == self::SQL_STAR)\n\t\t\t$this->_dqlParts[\"select\"] = array();\n\t\t\n\t\t$selects = is_array($field) ? $field : func_get_args();\n\t\t$this->add('select', new Expr\\Select($selects), true);\n\t\treturn $this;\n\t}", "public function addMultiField($baseField, $field, MultiFieldProperty $property);", "function add_extra_field_to_checkout( $fields ) {\n\n\t$depto_args = wp_parse_args( array(\n\t\t'type' => 'select',\n\t\t'options' => array(\n\t\t\t'Seleccione' => 'Seleccione',\n\t\t\t'Francisco Morazan' => 'Francisco Morazan',\n\t\t\t'Olancho' => 'Olancho',\n\t\t\t'Valle' => 'Valle',\n\t\t),\n\t), $fields['shipping']['shipping_depto'] );\n\n\t$fields['shipping']['shipping_depto'] = $depto_args;\n\t$fields['billing']['billing_depto'] = $depto_args; \n\t$fields['billing']['billing_depto']['priority'] = 80;\n\n\treturn $fields;\n\n}", "public function addFieldToFilter($field, $condition = null)\n {\n if (isset($this->_fields[$field])) {\n $field = $this->_fields[$field];\n }\n\n return parent::addFieldToFilter($field, $condition);\n }", "protected function _addInventoryItemFieldToSelect($field, $alias = null)\n {\n if (empty($alias)) {\n $alias = $field;\n }\n\n if (isset($this->_joinFields[$alias])) {\n return $this;\n }\n\n $this->_joinFields[$alias] = array(\n 'table' => $this->_getInventoryItemTableAlias(),\n 'field' => $field\n );\n\n $this->getSelect()->columns(array($alias => $field), $this->_getInventoryItemTableAlias());\n return $this;\n }", "function db_add_field(&$ret, $table, $field, $spec, $keys_new = array()) {\n $fixnull = FALSE;\n if (!empty($spec['not null']) && !isset($spec['default'])) {\n $fixnull = TRUE;\n $spec['not null'] = FALSE;\n }\n $query = 'ALTER TABLE {'. $table .'} ADD ';\n $query .= _db_create_field_sql($field, _db_process_field($spec));\n if (count($keys_new)) {\n $query .= ', ADD '. implode(', ADD ', _db_create_keys_sql($keys_new));\n }\n $ret[] = update_sql($query);\n if (isset($spec['initial'])) {\n // All this because update_sql does not support %-placeholders.\n $sql = 'UPDATE {'. $table .'} SET '. $field .' = '. db_type_placeholder($spec['type']);\n $result = db_query($sql, $spec['initial']);\n $ret[] = array('success' => $result !== FALSE, 'query' => check_plain($sql .' ('. $spec['initial'] .')'));\n }\n if ($fixnull) {\n $spec['not null'] = TRUE;\n db_change_field($ret, $table, $field, $field, $spec);\n }\n}", "public function addColumn($fieldData)\n {\n $this->columns[$fieldData['name']] = $fieldData;\n }", "public function addFieldToFilter($field, $condition = null)\n {\n return parent::addFieldToFilter($field, $condition);\n }", "public function buildFields()\n {\n $this->addField('name', 'kuma_menu.menu.adminlist.field.name', true);\n }", "public function addField(TranslationField $field) {\n\t\t$this->data->fields[] = $field->toArray();\n\t\treturn $this;\n\t}", "public function getSelectableField($fieldName);", "function add_local_field_group(){\n // ...\n }", "public function addField( $field, $config = array() ) {\r\n return $this->addFields($field, $config);\r\n\r\n }", "public function setValForEachItem(string $field_name, $field_val, bool $add_field_if_not_present=false): CollectionInterface;", "public function add_custom_list_field_type($input, $param, $param_value = '') {\n\t\t\n\t\tif ($param['type'] == 'custom_list') {\n\t\t\n\t\t\t$param['content_field'] = true;\n\t\t\t\t\t\t\n\t\t\t$input .= '<label for=\"fsn_'. esc_attr($param['param_name']) .'\">'. esc_html($param['label']) .'</label>';\n\t\t\t$input .= !empty($param['help']) ? '<p class=\"help-block\">'. esc_html($param['help']) .'</p>' : '';\n\t\t\t//drag and drop interface\n\t\t\t$input .= '<div class=\"custom-list-sort\" data-list-id=\"'. esc_attr($param['id']) .'\">';\n\t\t\t\t//output existing custom list items\n\t\t \tif ( !empty($param_value) ) {\n\t\t \t\t$input .= do_shortcode($param_value);\n\t\t \t}\n\t\t $input .= '</div>';\n\t\t //custom list items content (nested shortcodes)\n\t\t\t$input .= '<input type=\"hidden\" class=\"form-control element-input content-field custom-list-items\" name=\"'. $param['param_name'] .'\" value=\"'. esc_attr($param_value) .'\">';\n\n\t\t //add item button\n\t\t $input .= '<a href=\"#\" class=\"button add-custom-list-item\">'. __('Add Item', 'fusion') .'</a>';\n\t\t $input .= '<a href=\"#\" class=\"button expand-all-list-items\">'. __('Expand All', 'fusion') .'</a>';\n\t\t $input .= '<a href=\"#\" class=\"button collapse-all-list-items\">'. __('Collapse All', 'fusion') .'</a>';\n\t\t}\n\t\t\n\t\treturn $input;\n\t}", "function hundope_select_field_render() { \n\t\n}", "function addFieldRow($colName,$colLabel,$colValue) {\n global $theme, $app_list_strings;\n \n static $operator_options;\n if (empty($operator_options)) {\n $operator_options= get_select_options_with_id($app_list_strings['merge_operators_dom'],'');\n }\n\n $LBL_REMOVE = translate('LBL_REMOVE');\n $deleteInlineImage = SugarThemeRegistry::current()->getImageURL('delete_inline.gif');\n $snippet=<<<EOQ\n <span id=filter_{$colName} style='visibility:visible' value=\"{$colLabel}\" valueId=\"{$colName}\">\n <table width='100%' border='0' cellpadding='0'>\n <tr>\n <td width='2%'><a class=\"listViewTdToolsS1\" href=\"javascript:remove_filter('filter_{$colName}')\"><!--not_in_theme!--><img src='{$deleteInlineImage}' align='absmiddle' alt='{$LBL_REMOVE}' border='0' height='12' width='12'>&nbsp;</a></td>\n <td width='20%'>{$colLabel}:&nbsp;</td>\n <td width='10%'><select name='{$colName}SearchType'>{$operator_options}</select></td>\n <td width='68%'><input value=\"{$colValue}\" id=\"{$colName}SearchField\" name=\"{$colName}SearchField\" type=\"text\"></td> \n </tr> \n </table>\n </span>\nEOQ;\n\n return $snippet;\n}", "public function addField(FieldDataProvider $provider)\n {\n $this->fields[] = $provider;\n return $this;\n }", "final public function addUserByField($field, $search_in_object = false) {\n global $DB;\n\n $id = [];\n if (!$search_in_object) {\n $id[] = $this->obj->getField($field);\n\n } else if (!empty($this->target_object)) {\n foreach ($this->target_object as $val) {\n $id[] = $val->fields[$field];\n }\n }\n\n if (!empty($id)) {\n //Look for the user by his id\n $criteria = $this->getDistinctUserCriteria() + $this->getProfileJoinCriteria();\n $criteria['FROM'] = User::getTable();\n $criteria['WHERE'][User::getTable() . '.id'] = $id;\n $iterator = $DB->request($criteria);\n\n while ($data = $iterator->next()) {\n //Add the user email and language in the notified users list\n $this->addToRecipientsList($data);\n }\n }\n }", "public function add_field($name, $type)\n {\n $this->fields[$name] = $type;\n }", "protected function buildFieldsList()\n {\n if (empty($this->selectFieldsList)) {\n return \"*\";\n }\n\n return join(\", \", $this->selectFieldsList);\n }", "public function field($what)\n\t\t{\n\t\t\t$this->fields[] = $what;\n\t\t\treturn $this;\n\t\t}", "function add_custom_field($args) {\n register_rest_field( array(\"post\", \"page\"), 'wpnext', \n array(\n 'get_callback' => array( &$this, 'custom_field_get' ),\n 'update_callback' => array( &$this, 'custom_field_update' ),\n 'schema' => array(\n 'description' => \"Components and listed values.\",\n 'type' => 'object',\n 'context' => array('view', 'edit')\n )\n )\n );\n }", "public function addField($field)\r\n {\r\n $field = trim($field);\r\n $this->fields[$field] = true;\r\n\r\n return $this;\r\n }", "public function addFilterFields($fields=array()){\n \tif(empty($fields)) return ;\n\n \t$this->filterFields = !is_array($fields) ? explode(',',$fields) : $fields;\n \t\n }", "public function addField($fieldName, $fieldValue, $fieldBoostValue = 0.0) {}", "public function addSelect($fields)\n {\n if (func_num_args() > 1) {\n $fields = func_get_args();\n } elseif (!is_array($fields)) {\n $fields = [$fields];\n }\n foreach ($fields as $idx => $field) {\n $this->selectField($field, is_numeric($idx) ? null : $idx);\n }\n\n return $this;\n }", "protected function fetch_fields()\n {\n if(empty($this->table_fields))\n {\n $fields = $this->_database->list_fields($this->table);\n foreach ($fields as $field) {\n $this->table_fields[] = $field;\n }\n }\n }", "function ListWhereClause ($field, $list, $compare_type = DEFAULT_COMPARISON) {\n\t\t$this->list = $list;\n\t\t$this->field = (int)$field;\n\t\t$this->compareAs = $compare_type;\n\t}", "public function addFilterField($filterField, $operator = 'like', $formFilter = NULL, $filterTransformer = NULL)\n {\n $this->filterFields[] = $filterField;\n $this->operators[] = $operator;\n $this->formFilters[] = isset($formFilter) ? $formFilter : $filterField;\n $this->filterTransformers[] = $filterTransformer;\n }", "function create_field( $field )\n\t{\n\t\tif( 'object' == $field['save_format'] && 'null' !== $field['value'] )\n\t\t\t$field['value'] = array( $field['value']->class );\n\n\t\t// value must be array\n\t\tif( !is_array($field['value']) )\n\t\t{\n\t\t\t// perhaps this is a default value with new lines in it?\n\t\t\tif( strpos($field['value'], \"\\n\") !== false )\n\t\t\t{\n\t\t\t\t// found multiple lines, explode it\n\t\t\t\t$field['value'] = explode(\"\\n\", $field['value']);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$field['value'] = array( $field['value'] );\n\t\t\t}\n\t\t}\n\t\t\n\t\t// trim value\n\t\t$field['value'] = array_map('trim', $field['value']);\n\t\t\n\t\t// html\n\t\techo '<div class=\"fa-field-wrapper\">';\n\t\techo '<div class=\"fa-live-preview\"></div>';\n\t\techo '<select id=\"' . $field['id'] . '\" class=\"' . $field['class'] . ' fa-select2-field\" name=\"' . $field['name'] . '\" >';\t\n\t\t\n\t\t// null\n\t\tif( $field['allow_null'] )\n\t\t{\n\t\t\techo '<option value=\"null\">- ' . __(\"Select\",'acf') . ' -</option>';\n\t\t}\n\t\t\n\t\t// loop through values and add them as options\n\t\tif( is_array($field['choices']) )\n\t\t{\n\t\t\tunset( $field['choices']['null'] );\n\n\t\t\tforeach( $field['choices'] as $key => $value )\n\t\t\t{\n\t\t\t\t$selected = $this->find_selected( $key, $field['value'], $field['save_format'], $field['choices'] );\n\t\t\t\techo '<option value=\"'.$key.'\" '.$selected.'>'.$value.'</option>';\n\t\t\t}\n\t\t}\n\n\t\techo '</select>';\n\t\techo '</div>';\n\t}", "public function setField($field);", "public function setField($field);", "public function add_field(string $key, $value, string $type = null, string $order = null, \\WPGraphQL\\Data\\Cursor\\PostObjectCursor $object_cursor = null)\n {\n }", "function AdminListAddFilterFields($entityId, &$arFilterFields)\n\t{\n\t\t$arUserFields = $this->GetUserFields($entityId);\n\t\tforeach($arUserFields as $fieldName => $arUserField)\n\t\t{\n\t\t\tif($arUserField['SHOW_FILTER'] != 'N' && $arUserField['USER_TYPE']['BASE_TYPE'] != 'file')\n\t\t\t{\n\t\t\t\t$arFilterFields[] = 'find_' . $fieldName;\n\t\t\t\tif($arUserField['USER_TYPE']['BASE_TYPE'] == 'datetime')\n\t\t\t\t{\n\t\t\t\t\t$arFilterFields[] = 'find_' . $fieldName . '_from';\n\t\t\t\t\t$arFilterFields[] = 'find_' . $fieldName . '_to';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "function addSelectList2($name, $option_list, $header = NULL, $attr_ar = array(),$OBJ,$slted = NULL) { \n $str = \"<select name=\\\"$name\\\" id=\\\"$name\\\" \"; \n if ($attr_ar) { \n $str .= addAttributes( $attr_ar ); \n } \n $str .= \">\\n\"; \n if ( isset($header) ) { \n $str .= \" <option value=\\\"\\\">$header</option>\\n\"; \n } \n foreach ( $option_list as $val => $text ) { \n $str .= \"<option value=\\\"$val\\\" \"; \n if ( isset($_POST[$name]) && ( trim($_POST[$name]) === trim($val) || trim($_POST[$name]) === trim($text) ) || trim($slted) === trim($val) ) { \n $str .= ' selected '; \n } \n $str .= \">$text</option>\\n\"; \n } \n $str .= \"</select>\"; \n\t\t$OBJ->assign('_'.$name,$str);\n return $str; \n }", "public function fetchField();" ]
[ "0.70189977", "0.68114954", "0.6788346", "0.6780603", "0.6780603", "0.67425394", "0.6603159", "0.65664744", "0.6362792", "0.63491416", "0.63491416", "0.6274043", "0.6199806", "0.614157", "0.61019003", "0.6096005", "0.6093581", "0.60926235", "0.60800743", "0.60668844", "0.60255885", "0.59830755", "0.5904927", "0.5896955", "0.588516", "0.58718765", "0.5871425", "0.58700377", "0.58682376", "0.58277196", "0.5787272", "0.5771495", "0.5766736", "0.5756817", "0.5742216", "0.5736924", "0.57134813", "0.5697017", "0.5686102", "0.56285906", "0.5614522", "0.5556385", "0.55540806", "0.5545728", "0.553671", "0.55289954", "0.5510562", "0.54882866", "0.54852265", "0.5482684", "0.5473605", "0.54698944", "0.54689956", "0.5402494", "0.5392474", "0.53906626", "0.5370948", "0.5367363", "0.5356505", "0.5355992", "0.53487295", "0.5346143", "0.5342084", "0.53397584", "0.533583", "0.5311728", "0.52984256", "0.5288486", "0.52692163", "0.5260146", "0.5253684", "0.52499914", "0.524897", "0.52484024", "0.52349174", "0.5222326", "0.5217299", "0.51965904", "0.5195426", "0.5189719", "0.5167315", "0.51551205", "0.51501024", "0.5135858", "0.5133069", "0.512995", "0.5125688", "0.51113206", "0.5109372", "0.5100784", "0.5091948", "0.5088188", "0.5086651", "0.5085664", "0.50633425", "0.50633425", "0.50606143", "0.50553983", "0.50544053", "0.505381" ]
0.5972985
22
Add multiple fields from the same table to be SELECTed. This method does not return the aliases set for the passed fields. In the majority of cases that is not a problem, as the alias will be the field name. However, if you do need to know the alias you can call getFields() and examine the result to determine what alias was created. Alternatively, simply use addField() for the few fields you care about and this method for the rest.
public function fields($table_alias, array $fields = []);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function fields($alias, $fields = array('*'))\t{\n\n\t\tif (!is_string($alias) || empty($alias)) {\n\t\t\tthrow new InvalidArgumentException('Invalid table alias.');\n\t\t}\n\t\tif (!is_array($fields) || empty($fields)) {\n\t\t\tthrow new InvalidArgumentException('Invalid fields list.');\n\t\t}\n\n\t\tforeach ($fields as $name) {\n\t\t\t$this->fields[] = \"$alias.$name\";\n\t\t}\n\t\treturn $this;\n\t}", "public function addField($table_alias, $field, $alias = NULL);", "private function addFields( array $aFields )\n\t{\n\t\t// FIELDS\n\t\t$this->query .= \" (\";\n\t\t$i = 1;\n\t\tforeach ($aFields as $field)\n\t\t{\n\t\t\t$this->query .= \" \" . $field;\n\t\t\tif ($i < count( $aFields ))\n\t\t\t{\n\t\t\t\t$this->query .= \",\"; // last fields should not end with a ,\n\t\t\t}\n\t\t\t\n\t\t\t$i ++;\n\t\t}\n\t\t$this->query .= \")\";\n\t\t\n\t\t// VALUES\n\t\t$this->query .= \" VALUES(\";\n\t\t$i = 1;\n\t\tforeach ($aFields as $field)\n\t\t{\n\t\t\t$this->query .= \":\".$field;\n\t\t\tif ($i < count( $aFields ))\n\t\t\t{\n\t\t\t\t$this->query .= \",\"; // last fields should not end with a ,\n\t\t\t}\n\t\t\t\n\t\t\t$i ++;\n\t\t}\n\t\t$this->query .= \")\";\n\t}", "public function addSelect($fields)\n {\n if (func_num_args() > 1) {\n $fields = func_get_args();\n } elseif (!is_array($fields)) {\n $fields = [$fields];\n }\n foreach ($fields as $idx => $field) {\n $this->selectField($field, is_numeric($idx) ? null : $idx);\n }\n\n return $this;\n }", "public function testBuildSelectWithFieldsAndAlias()\n {\n $query = $this->getQuery()\n ->alias('alias')\n ->fields('id', 'name', 'email')\n ;\n\n $this->assertSame(\n 'alias.id AS alias__id, alias.name AS alias__name, alias.email AS alias__email',\n $query->buildSelectFields()\n );\n }", "public function add(...$fields): self\n {\n foreach ($fields as $field) {\n $this->fields[] = $field;\n }\n\n return $this;\n }", "public function fields($fields) {\n $this->_active_query->fields($fields);\n }", "public function addFields($fields ) {\n foreach( $fields as $field ) {\n $this->addField( $field );\n }\n }", "protected function _addDefaultFields()\n {\n $select = $this->clause('select');\n $this->_hasFields = true;\n\n if (!count($select) || $this->_autoFields === true) {\n $this->_hasFields = false;\n $this->select($this->repository()->getSchema()->columns());\n $select = $this->clause('select');\n }\n\n $aliased = $this->aliasFields($select, $this->repository()->getAlias());\n $this->select($aliased, true);\n }", "public function field($columns)\n {\n if (!is_array($columns)) {\n $columns = func_get_args();\n }\n foreach ($columns as $column) {\n $field = new SugarQuery_Builder_Field_Select($column, $this->query);\n $key = empty($field->alias) ? $field->field : $field->alias;\n if(!$field->isNonDb()) {\n $this->select[$key] = $field;\n $this->fieldsByTable[$field->table][$field->field] = true;\n }\n }\n return $this;\n }", "public function setFields($fields) {\r\n if( is_array($fields) ) {\r\n $this->sqlFields = array_merge($this->sqlFields, $fields);\r\n } elseif( is_string($fields) ) {\r\n $this->sqlFields[] = $fields;\r\n }\r\n return $this;\r\n }", "public function setSelectFields()\r\n\t{\r\n\t\t$fields = func_get_args();\r\n\t\tif (empty($fields))\r\n\t\t{\r\n\t\t\tthrow new \\Exception('Select fields list is not an array or empty.');\r\n\t\t}\r\n\t\r\n\t\t// Check if fields exist in fields collection\r\n\t\tforeach($fields as &$item)\r\n\t\t{\r\n\t\t\t$found = false;\r\n\t\t\tforeach ($this->fields as &$field)\r\n\t\t\t{\r\n\t\t\t\tif ($item == $field->name)\r\n\t\t\t\t{\r\n\t\t\t\t\t$found = true;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\t\r\n\t\t\tif (!$found)\r\n\t\t\t{\r\n\t\t\t\tthrow new \\Exception('There is no field \"' . $item . '\" in table ' . $this->name . '.');\r\n\t\t\t}\r\n\t\r\n\t\t\t// Add to list\r\n\t\t\tif ($this->hasForeignFields())\r\n\t\t\t{\r\n\t\t\t\t$item = 't1.`' . $item . '`';\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t$item = '`' . $this->name . '`.`' . $item . '`';\r\n\t\t\t}\r\n\t\t}\r\n\t\r\n\t\t$this->selectFields = $fields;\r\n\t}", "public function testBuildSelectWithAddField()\n {\n $query = $this->getQuery()\n ->addField('user@email', 'email')\n ;\n\n $this->assertSame(\n \"*, 'user@email' AS email\",\n $query->buildSelectFields()\n );\n }", "public function testBuildSelectWithAddFieldAndAlias()\n {\n $query = $this->getQuery()\n ->alias('alias')\n ->addField(Expression::apishka('NOW()'), 'current_time')\n ;\n\n $this->assertSame(\n 'alias.*, NOW() AS alias__current_time',\n $query->buildSelectFields()\n );\n }", "public function aliasFields(array $fields, ?string $defaultAlias): array;", "public function addFields($fields)\n {\n if( !is_array( $fields ) )\n $fields = func_get_args();\n \n if( count( $fields ) === 1 && is_array( $fields[0] ) )\n \t$fields = $fields[0];\n \n foreach( $fields as &$field )\n $this->addField( $field );\n\n return $this;\n }", "public function setSelect($fields)\n {\n $this->select = [];\n if (func_num_args() > 1) {\n $fields = func_get_args();\n } elseif (!is_array($fields)) {\n $fields = [$fields];\n }\n return $this->addSelect($fields);\n }", "public function addFields($fields)\r\n {\r\n if (is_string($fields)) {\r\n $fields = explode(',', $fields);\r\n }\r\n\r\n foreach ($fields as $field) {\r\n $this->addField($field);\r\n }\r\n\r\n return $this;\r\n }", "public function fields($fields, $merge = false) {\n if (!is_array($fields)) {\n $fields = func_get_args();\n $merge = false;\n }\n\n if ($merge) {\n $fields = array_merge($this->_fields, $fields);\n }\n\n // When doing a select, unique the field list\n if ($this->getType() === self::SELECT) {\n $fields = array_values(array_unique($fields, SORT_REGULAR)); // SORT_REGULAR allows for objects\n }\n\n $this->_fields = $fields;\n\n return $this;\n }", "public function fields($fields = NULL)\n {\n if(isset($fields))\n {\n $fields = (is_array($fields)) ? implode(',',$fields) : $fields;\n $this->_database->select($fields);\n }\n return $this;\n }", "public function fields(array $fields)\n {\n $this->unsafeAppendSQLPart('field', $this->asTickedList($fields));\n return $this;\n }", "public function select($fields = [], $overwrite = false);", "abstract public function getAllFieldsAliases(): array;", "public function getAddFieldsDDL($fields)\n {\n $ret = '';\n $pattern = \"\nALTER TABLE %s ADD %s;\n\";\n foreach ($fields as $field) {\n $ret .= sprintf($pattern,\n $this->quoteIdentifier($field->getEntity()->getFQTableName()),\n $this->getFieldDDL($field)\n );\n }\n\n return $ret;\n }", "public function select($fields) {\n\n $fields = self::check_fields_of_table_list(array_map('trim', explode(',', $fields)));\n\n // varsayılan olarak ekle, objeler yüklenirken her zaman id olmalıdır.\n $table_and_primary_key = $this->_table . \".id\";\n if (!in_array($table_and_primary_key, $fields))\n array_push($fields, $table_and_primary_key);\n\n $this->_select = $fields; // [\"User.first_name\", \"User.last_name\", \"Comment.name\"]\n return $this;\n }", "private function makeSelectAndFrom()\r\n\t{\r\n\t\t// Build SQL\r\n\t\t$sql = 'SELECT ';\r\n\t\r\n\t\t// Add custom fields (subqueries)\r\n\t\tif ($this->hasCustomFields())\r\n\t\t{\r\n\t\t\t// Find custom fields\r\n\t\t\tforeach ($this->fields as $field)\r\n\t\t\t{\r\n\t\t\t\tif ($field instanceOf CustomField)\r\n\t\t\t\t{\r\n\t\t\t\t\t$sql .= '(' . $field->query . ') AS `' . $field->name . '`, ';\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\r\n\t\tif (!$this->hasForeignFields())\r\n\t\t{\r\n\t\t\tif (isset($this->selectFields))\r\n\t\t\t{\r\n\t\t\t\t// Use custom field selection\r\n\t\t\t\t$sql .= implode(', ', $this->selectFields) . ' ';\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t// Take all fields\r\n\t\t\t\t$sql .= '`'.$this->name.'`.* ';\r\n\t\t\t}\r\n\t\t\t\t\r\n\t\t\t$sql .= 'FROM `'.$this->name.'` ';\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t// Get foreign fields\r\n\t\t\t$cols = array();\r\n\t\r\n\t\t\tif (isset($this->selectFields))\r\n\t\t\t{\r\n\t\t\t\t// Use custom field selection\r\n\t\t\t\tforeach ($this->selectFields as $field)\r\n\t\t\t\t{\r\n\t\t\t\t\t$cols[] = $field;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t// Take all fields\r\n\t\t\t\t$cols[] = 't1.*';\r\n\t\t\t}\r\n\t\r\n\t\t\t$from_sql = 'FROM `'.$this->name.'` t1 ';\r\n\t\t\t$joined = array();\r\n\t\t\t$joins = array();\r\n\t\t\t$alias_no = 2;\r\n\t\t\t$tables[] = array('table' => $this->name, 'alias' => 't1');\r\n\t\r\n\t\t\t// Iterate over fields\r\n\t\t\tforeach ($this->fields as &$field)\r\n\t\t\t{\r\n\t\t\t\t$use_alias = false;\r\n\t\r\n\t\t\t\tif ($field instanceof ForeignField)\r\n\t\t\t\t{\r\n\t\t\t\t\t// Check if foreign field should be included, if select fields were set\r\n\t\t\t\t\tif (isset($this->selectFields))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$found = false;\r\n\t\t\t\t\t\tforeach ($this->selectFields as $sel_field)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tif (str_contains($sel_field, $field->name))\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t$found = true;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (!$found)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\r\n\t\t\t\t\t// Find out what kind of join it should be (INNER or LEFT)\r\n\t\t\t\t\t$join_type = strtoupper($field->joinType);\r\n\t\r\n\t\t\t\t\t// Check if it's a join between two foreign tables\r\n\t\t\t\t\tif ($field->joinFromTable == null)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t// Join between this table and other table\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t// Check if we need to make a new join\r\n\t\t\t\t\t\t$this_join = array(\r\n\t\t\t\t\t\t\t'from_table' => $this->name, \r\n\t\t\t\t\t\t\t'to_table' => $field->table,\r\n\t\t\t\t\t\t\t'from' => $field->joinFrom, \r\n\t\t\t\t\t\t\t'to' => $field->joinTo\r\n\t\t\t\t\t\t);\r\n\t\t\t\t\t\tif (!$this->CheckJoinExists($this_join, $joins))\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$from_sql .= $join_type.' JOIN `'.$field->table .'` t'.$alias_no.' ON t1.`'.$field->joinFrom.'` = t'.$alias_no.'.`'.$field->joinTo.'` ';\r\n\t\t\t\t\t\t\t$joins[] = $this_join;\r\n\t\t\t\t\t\t\t$use_alias = true;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t// Join between two other tables\r\n\t\r\n\t\t\t\t\t\t// Check if we need to make a new join\r\n\t\t\t\t\t\t$this_join = array(\r\n\t\t\t\t\t\t\t'from_table' \t=> $this->table_name, \r\n\t\t\t\t\t\t\t'to_table' \t\t=> $field->foreign_field->table,\r\n\t\t\t\t\t\t\t'from' \t\t\t=> $field->foreign_field->join_from, \r\n\t\t\t\t\t\t\t'to' \t\t\t=> $field->foreign_field->join_to\r\n\t\t\t\t\t\t);\r\n\t\t\t\t\t\tif (!$this->checkJoinExists($this_join, $joins)) \r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tif (($alias = $this->tableHasAlias($field->table, $tables)) !== false) \r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t$from_sql .= $join_type.' JOIN `'.$field->table.'` t'.$alias_no.' ON '.$alias.'.`'.$field->joinFrom.'` = t'.$alias_no.'.`'.$field->joinTo.'` ';\r\n\t\t\t\t\t\t\t} \r\n\t\t\t\t\t\t\telse \r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t$from_sql .= $join_type.' JOIN `'.$field->table.'` t'.$alias_no.' ON `'.$field->joinFromTable.'`.`'.$field->joinFrom.'` = t'.$alias_no.'.`'.$field->joinTo.'` ';\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t$joins[] = $this_join;\r\n\t\t\t\t\t\t\t$use_alias = true;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\r\n\t\t\t\t\tif ($use_alias)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$cols[] = 't'.$alias_no.'.`'.$field->foreignFieldName .'` AS `'.$field->name.'`';\r\n\t\t\t\t\t\t$tables[] = array('table' => $field->table, 'alias' => 't'.$alias_no);\r\n\t\t\t\t\t\t$alias_no++;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t// Check if table has alias\r\n\t\t\t\t\t\tif (($alias = $this->tableHasAlias($field->table, $tables)) !== false)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$cols[] = $alias.'.`'.$field->foreignFieldName.'` AS `'.$field->name .'`';\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$cols[] = '`'.$field->table.'`.`'.$field->foreignFieldName.'` AS `'.$field->name.'`';\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$this->tableAliases = $tables;\r\n\t\r\n\t\t\t$sql .= implode(', ', $cols).' '.$from_sql;\r\n\t\r\n\t\t\t$this->table_aliases = $tables;\r\n\t\t}\r\n\t\r\n\t\treturn $sql;\r\n\t}", "public static function selectOverlayFields($table, $selectFields) {\n\t\t$additionalFields = self::selectOverlayFieldsArray($table, $selectFields);\n\t\tif (count($additionalFields) > 0) {\n\t\t\tforeach ($additionalFields as $aField) {\n\t\t\t\t$selectFields .= ', ' . $table . '.' . $aField;\n\t\t\t}\n\t\t}\n\t\treturn $selectFields;\n\t}", "public function addParamsSelected($fields = null, $props = null)\n {\n if (is_array($fields) && !empty($fields))\n {\n $this->arParams['SELECT_FIELDS'] = array_merge($this->arParams['SELECT_FIELDS'], $fields);\n }\n\n if (is_array($props) && !empty($props))\n {\n $this->arParams['SELECT_PROPS'] = array_merge($this->arParams['SELECT_PROPS'], $props);\n }\n }", "public function select(string $fields): QueryBuilderInterface\n\t{\n\t\t// Split fields by comma\n\t\t$fieldsArray = explode(',', $fields);\n\t\t$fieldsArray = array_map('mb_trim', $fieldsArray);\n\n\t\t// Split on 'As'\n\t\tforeach ($fieldsArray as $key => $field)\n\t\t{\n\t\t\tif (stripos($field, 'as') !== FALSE)\n\t\t\t{\n\t\t\t\t$fieldsArray[$key] = preg_split('` as `i', $field);\n\t\t\t\t$fieldsArray[$key] = array_map('mb_trim', $fieldsArray[$key]);\n\t\t\t}\n\t\t}\n\n\t\t// Quote the identifiers\n\t\t$safeArray = $this->driver->quoteIdent($fieldsArray);\n\n\t\tunset($fieldsArray);\n\n\t\t// Join the strings back together\n\t\tfor($i = 0, $c = count($safeArray); $i < $c; $i++)\n\t\t{\n\t\t\tif (\\is_array($safeArray[$i]))\n\t\t\t{\n\t\t\t\t$safeArray[$i] = implode(' AS ', $safeArray[$i]);\n\t\t\t}\n\t\t}\n\n\t\t$this->state->appendSelectString(implode(', ', $safeArray));\n\n\t\treturn $this;\n\t}", "public function fields(string ...$fields): static\n {\n return $this->withPropertyItem('opts', new FieldsOption($fields));\n }", "public function addSelect(string ...$columns)\n {\n $this->select = array_merge($this->select, $columns);\n\n return $this;\n }", "public static function selectVersioningFields($table, $selectFields) {\n\t\t$additionalFields = self::selectVersioningFieldsArray($table, $selectFields);\n\t\tif (count($additionalFields) > 0) {\n\t\t\tforeach ($additionalFields as $aField) {\n\t\t\t\t$selectFields .= ', ' . $table . '.' . $aField;\n\t\t\t}\n\t\t}\n\t\treturn $selectFields;\n\t}", "public function select(string ...$fields): self\n {\n $this->select = $fields;\n return $this;\n }", "public function select($fields);", "public function testBuildSelectWithFields()\n {\n $query = $this->getQuery()\n ->fields('id', 'name', 'email')\n ;\n\n $this->assertSame(\n 'id, name, email',\n $query->buildSelectFields()\n );\n }", "public function addField();", "public function addFields(array $field_map){\n \n if(!empty($field_map)){\n $this->field_map = array_merge($this->field_map,$field_map);\n }//if\n return $this;\n \n }", "public function select($field = '*', $escape = null)\n {\n // If the escape value was not set, we will base it on the global setting\n is_bool($escape) || $escape = $this->conn->protectIdentifiers;\n\n if (is_string($field)) {\n $field = str_replace(' as ', ' AS ', $field);\n\n if (strpos($field, '+') !== false || strpos($field, '(') !== false) {\n $field = [$field];\n } else {\n $field = explode(',', $field);\n }\n\n foreach ($field as $name) {\n $name = trim($name);\n\n $this->builderCache->select[] = $name;\n $this->builderCache->noEscape[] = $escape;\n }\n } elseif (is_array($field)) {\n foreach ($field as $fieldName => $fieldAlias) {\n if (is_numeric($fieldName)) {\n $fieldName = $fieldAlias;\n } elseif (is_string($fieldName)) {\n if (is_string($fieldAlias)) {\n $fieldName = $fieldName . ' AS ' . $fieldAlias;\n } elseif (is_array($fieldAlias)) {\n $countFieldAlias = count($fieldAlias);\n\n for ($i = 0; $i < $countFieldAlias; $i++) {\n if ($i == 0) {\n $fieldAlias[ $i ] = $fieldAlias[ $i ] . \"'+\";\n } elseif ($i == ($countFieldAlias - 1)) {\n $fieldAlias[ $i ] = \"'+\" . $fieldAlias[ $i ];\n } else {\n $fieldAlias[ $i ] = \"'+\" . $fieldAlias[ $i ] . \"'+\";\n }\n }\n\n $fieldName = implode(', ', $fieldAlias) . ' AS ' . $fieldName;\n } elseif ($fieldAlias instanceof AbstractQueryBuilder) {\n $fieldName = '( ' . $fieldAlias->getSqlStatement() . ' ) AS ' . $fieldName;\n }\n }\n\n $this->select($fieldName, $escape);\n }\n }\n\n return $this;\n }", "public function select(array $fields): SQL\n {\n $this->fields = $fields;\n return $this;\n }", "public abstract function getSelectSQL($fields, $from, $joins, $where, $having, $group, $order, $limit, $values, $forupdate);", "private function setFields(): string\n {\n $sql = '';\n\n foreach (array_keys($this->data) as $key) {\n $sql .= '`' . $key . '` = ? , ';\n }\n return rtrim($sql, ', ');\n }", "public function testDecorateQuery_SQL_SelectFields() {\n /* Single field */\n $originalQuery = \"SELECT `emp_firstname`, `emp_lastname` FROM `hs_hr_employee` WHERE `emp_number` = '10'\";\n $expectedQuery = \"SELECT `emp_firstname`, `emp_lastname`, `emp_middle_name` FROM `hs_hr_employee` WHERE `emp_number` = '10'\";\n $resultQuery = $this->baseService->decorateQuery('SampleService_ForSelect', 'sampleMethod1', $originalQuery);\n $this->assertEquals($expectedQuery, $resultQuery);\n\n /* Multiple fields */\n $originalQuery = \"SELECT `emp_firstname`, `emp_lastname` FROM `hs_hr_employee` WHERE `emp_number` = '10'\";\n $expectedQuery = \"SELECT `emp_firstname`, `emp_lastname`, `emp_middle_name`, `job_title_code`, `joined_date` FROM `hs_hr_employee` WHERE `emp_number` = '10'\";\n $resultQuery = $this->baseService->decorateQuery('SampleService_ForSelect', 'sampleMethod2', $originalQuery);\n $this->assertEquals($expectedQuery, $resultQuery);\n\n /* Single field with alias */\n $originalQuery = \"SELECT `emp_firstname`, `emp_lastname` FROM `hs_hr_employee` WHERE `emp_number` = '10'\";\n $expectedQuery = \"SELECT `emp_firstname`, `emp_lastname`, `emp_middle_name` AS `middleName` FROM `hs_hr_employee` WHERE `emp_number` = '10'\";\n $resultQuery = $this->baseService->decorateQuery('SampleService_ForSelect', 'sampleMethod3', $originalQuery);\n $this->assertEquals($expectedQuery, $resultQuery);\n\n /* Multiple fields with aliases */\n $originalQuery = \"SELECT `emp_firstname`, `emp_lastname` FROM `hs_hr_employee` WHERE `emp_number` = '10'\";\n $expectedQuery = \"SELECT `emp_firstname`, `emp_lastname`, `emp_middle_name` AS `middleName`, `job_title_code`, `joined_date` AS `active` FROM `hs_hr_employee` WHERE `emp_number` = '10'\";\n $resultQuery = $this->baseService->decorateQuery('SampleService_ForSelect', 'sampleMethod4', $originalQuery);\n $this->assertEquals($expectedQuery, $resultQuery);\n\n /* Single field with table id */\n\n /* Multiple fields with table ids */\n }", "public function addFields(array $fields)\n {\n foreach ($fields as $field) {\n $this->addField($field);\n }\n }", "protected function addFields()\n {\n $groupCustomOptionsName = CustomOptions::GROUP_CUSTOM_OPTIONS_NAME;\n $optionContainerName = CustomOptions::CONTAINER_OPTION;\n $commonOptionContainerName = CustomOptions::CONTAINER_COMMON_NAME;\n\n // Add fields to the option\n $this->meta[$groupCustomOptionsName]['children']['options']['children']['record']['children']\n [$optionContainerName]['children'][$commonOptionContainerName]['children'] = array_replace_recursive(\n $this->meta[$groupCustomOptionsName]['children']['options']['children']['record']['children']\n [$optionContainerName]['children'][$commonOptionContainerName]['children'],\n $this->getOptionFieldsConfig()\n );\n\n // Add fields to the values\n // $this->meta[$groupCustomOptionsName]['children']['options']['children']['record']['children']\n // [$optionContainerName]['children']['values']['children']['record']['children'] = array_replace_recursive(\n // $this->meta[$groupCustomOptionsName]['children']['options']['children']['record']['children']\n // [$optionContainerName]['children']['values']['children']['record']['children'],\n // $this->getValueFieldsConfig()\n // );\n }", "public function fields($fields = array(), $include = 1)\n {\n if($this->_cursor) throw new MongoCursorException('The cursor has already started iterating.');\n\n // Map array to hash\n if($fields == array_values($fields))\n {\n $fields = array_fill_keys($fields, (int) $include);\n }\n\n // Translate field aliases\n foreach($fields as $field => $value)\n {\n $this->_fields[$this->get_field_name($field)] = $value;\n }\n\n return $this;\n }", "public function resolveFields($fields)\n {\n $all = [];\n if (is_array($fields)) {\n foreach ($fields as $k => $v) {\n if (is_numeric($k)) {\n $all[] = $this->quoteColumn($v);\n }\n else {\n $all[] = $this->quoteColumn($k) . \" AS \" . $this->quoteColumn($v);\n }\n }\n }\n else {\n return $fields;\n }\n\n return implode(\", \", $all);\n }", "private function setFields()\n\t{\t\n\t\t$sql = '';\n\t\t\n\t\tforeach (array_keys($this->data) as $key)\n\t\t{\n\t\t\t$sql .= '`' . $key . '` = ? , ';\n\t\t}\n\t\t\n\t\t$sql = rtrim($sql, ', ');\n\t\t\n\t\treturn $sql;\n\t}", "public function testBuildSelectWithAddFieldExpression()\n {\n $query = $this->getQuery()\n ->addField(Expression::apishka('NOW()'), 'current_time')\n ;\n\n $this->assertSame(\n '*, NOW() AS current_time',\n $query->buildSelectFields()\n );\n }", "public function build_select( $fields = array() ) {\n if ( empty( $fields ) ) {\n return ' SELECT * ';\n }\n\n return ' SELECT ' . implode( ', ', $fields );\n }", "public function selectFields($selectFields)\n\t{\n\t\t$this->select = $selectFields ? $selectFields : '*';\n\t}", "function query() {\n $this->field_alias = $this->real_field;\n }", "function query() {\n $this->field_alias = $this->real_field;\n }", "public function fields($fields)\n {\n if (is_array($fields)) {\n $this->options['fields'] = implode(', ', $fields);\n } else $this->options['fields'] = $fields;\n return $this;\n }", "public function addFields(array $fields)\n\t{\n\t\tforeach ($fields as $field) $this->addField($field);\n\n\t\treturn $this;\n\t}", "function _get_select_fields()\r\n\t{\r\n\t\t$sql_exec_fields = array();\r\n\t\tforeach ($this->_params as $key => $val)\r\n\t\t{\r\n\t\t\t$tmp_field = $this->_node_table . '.' . $key . ' AS ' . $val;\r\n\t\t\t$sql_exec_fields[] = $tmp_field;\r\n\t\t} \r\n\r\n\t\t$fields = implode(', ', $sql_exec_fields);\r\n\t\treturn $fields;\r\n\t}", "public function select($fields): self\n\t{\n\t\t$this->select = array_merge(\n\t\t\t$this->select,\n\t\t\tArr::wrap($fields)\n\t\t);\n\n\t\treturn $this;\n\t}", "public static function selectOverlayFieldsArray($table, $selectFields) {\n\t\t$additionalFields = array();\n\n\t\t// If all fields are selected anyway, no need to worry\n\t\tif ($selectFields != '*') {\n\t\t\t// Check if the table indeed has a TCA\n\t\t\tif (isset($GLOBALS['TCA'][$table]['ctrl'])) {\n\n\t\t\t\t// Continue only if table is not using foreign tables for translations\n\t\t\t\t// (in this case no additional field is needed) and has a language field\n\t\t\t\tif (empty($GLOBALS['TCA'][$table]['ctrl']['transForeignTable']) && !empty($GLOBALS['TCA'][$table]['ctrl']['languageField'])) {\n\t\t\t\t\t$languageField = $GLOBALS['TCA'][$table]['ctrl']['languageField'];\n\n\t\t\t\t\t// In order to be properly overlaid, a table has to have a given languageField\n\t\t\t\t\t$hasLanguageField = strpos($selectFields, $languageField);\n\t\t\t\t\tif ($hasLanguageField === FALSE) {\n\t\t\t\t\t\t// Get the list of fields for the given table\n\t\t\t\t\t\t$tableFields = self::getAllFieldsForTable($table);\n\t\t\t\t\t\tif (isset($tableFields[$languageField])) {\n\t\t\t\t\t\t\t$additionalFields[] = $languageField;\n\t\t\t\t\t\t\t$hasLanguageField = TRUE;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t// If language field is still missing after that, throw an exception\n\t\t\t\t\tif ($hasLanguageField === FALSE) {\n\t\t\t\t\t\tthrow new Exception('Language field not available.', 1284463837);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// The table has no TCA, throw an exception\n\t\t\t} else {\n\t\t\t\tthrow new Exception('No TCA for table, cannot add overlay fields.', 1284474025);\n\t\t\t}\n\t\t}\n\t\treturn $additionalFields;\n\t}", "public function extra_columns_joins($params, $fields = []) {\n $sqljoins = \"\";\n\n if (isset($params->extra_columns) and $params->extra_columns) {\n $extra_columns = explode(\",\", $params->extra_columns);\n\n foreach ($extra_columns as $index) {\n if (class_exists('\\local_intelliboard\\extra_columns\\column' . $index)) {\n $classname = '\\local_intelliboard\\extra_columns\\column' . $index;\n /** @var \\local_intelliboard\\extra_columns\\base_column $columnbuilder */\n $columnbuilder = new $classname($params, $fields);\n list($sql, $params) = $columnbuilder->get_join();\n $sqljoins .= \" {$sql}\";\n $this->params = array_merge($this->params, $params);\n } else {\n if ($index == 11) {\n $usertablealias = isset($fields[0]) ? $fields[0] : \"u.id\";\n\n $sqljoins .= \" LEFT JOIN (SELECT lg.objectid,\n CASE WHEN u.id IS NOT NULL THEN CONCAT(u.firstname, ' ', u.lastname) ELSE '' END AS name\n FROM {logstore_standard_log} lg\n JOIN {user} u ON u.id = lg.userid\n WHERE lg.component = 'core' AND lg.action = 'created' AND lg.target = 'user'\n ) creator ON creator.objectid = {$usertablealias}\";\n }else if ($index == 12){\n $usertablealias = isset($fields[0]) ? $fields[0] : \"u.id\";\n $coursetablealias = isset($fields[1]) ? $fields[1] : \"c.id\";\n $roles = get_operator('GROUP_CONCAT', \"DISTINCT(CASE WHEN r.name='' THEN r.shortname ELSE r.name END)\", ['separator' => ', ']);\n $course_filter = $this->get_filter_in_sql($params->courseid, \"c.instanceid\");\n\n $sqljoins .= \" LEFT JOIN (SELECT\n c.instanceid, ra.userid,\n $roles AS roles\n FROM {context} c\n LEFT JOIN {role_assignments} ra ON ra.contextid=c.id\n LEFT JOIN {role} r ON r.id=ra.roleid\n WHERE c.contextlevel=50\n {$course_filter}\n GROUP BY c.instanceid, ra.userid) course_roles ON course_roles.instanceid={$coursetablealias} AND course_roles.userid={$usertablealias}\";\n }else if ($index == 13){\n $usertablealias = isset($fields[0]) ? $fields[0] : \"u.id\";\n $roles = get_operator('GROUP_CONCAT', \"DISTINCT(CASE WHEN r.name='' THEN r.shortname ELSE r.name END)\", ['separator' => ', ']);\n $contextid = (defined('SYSCONTEXTID')) ? SYSCONTEXTID : 0;\n\n $sqljoins .= \" LEFT JOIN (SELECT\n ra.userid,\n $roles AS roles\n FROM {role_assignments} ra\n LEFT JOIN {role} r ON r.id=ra.roleid\n WHERE ra.contextid={$contextid}\n GROUP BY ra.userid) system_roles ON system_roles.userid={$usertablealias} \";\n } elseif ($index == 14) {\n $userEnrolTableAlias = isset($fields[2]) ? $fields[2] : \"ue.modifierid\";\n\n $sqljoins .= \" LEFT JOIN {user} enrol_by ON enrol_by.id={$userEnrolTableAlias} \";\n }\n }\n }\n }\n\n return $sqljoins;\n }", "public function select(...$fields) {\n\t\t$select = (new Selectable($this->table))->select($fields);\n\t\t\n\t\tif ($this->softDelete) {\n\t\t\t$select->where((new Where)->isNull('`'. $this->table .'`.`deleted_at`'));\n\t\t}\n\n\t\treturn $select;\n\t}", "public function query() {\n $this->field_alias = $this->real_field;\n }", "public function setFields($fields = []);", "protected function fetch_fields()\n {\n if(empty($this->table_fields))\n {\n $fields = $this->_database->list_fields($this->table);\n foreach ($fields as $field) {\n $this->table_fields[] = $field;\n }\n }\n }", "function update_fields($fields){\n //\n //Get the indexed columns \n //\n //loop through all the columns in this entity \n foreach ($this->entity->columns as $column) {\n //\n //Get the name of the column\n $name= $column->name;\n //\n //if the column is foreign or primary return\n if($column->type==!'primary' || $column->type==!'foreign' ){\n //\n //Test if the column already exist in the fields array\n //first map the columns to get the column names\n $names= array_map(function ($f){return $f->column->name;}, $fields);\n //\n $enn= array_search($name, $names);\n //\n //If the culumn is an indexed column do nothing if false do the following\n if ($enn === false){\n //\n //Test if it is called a name \n if ($name== 'name'){\n //\n array_push($fields, $column);\n }\n //\n //Test if it is called a description \n if ($name== 'description'){\n //\n array_push($fields, $column);\n }\n //\n //Test if it is called a title \n if ($name== 'title'){\n //\n array_push($fields, $column);\n }\n //\n //Test if it is called a id \n if ($name== 'id'){\n //\n array_push($fields, $column);\n }\n }\n }\n }\n //\n //\n return $fields;\n }", "public function add_field($name, $value, $aliases = array())\n\t{\n\t\t//$name = strtoupper($name);\n\t\t$this->_fields[$name] = $value;\n\t\t\n\t\t// check for variable binding\n\t\tif (is_array($value))\n\t\t{\n\t\t\t$this->bind_field($name, $value);\n\t\t}\n\t\t\n\t\t// check for aliases\n\t\tif (count($aliases) > 0)\n\t\t{\n\t\t\tforeach ($aliases as $alias)\n\t\t\t{\n\t\t\t\tif (array_key_exists('store_id', $alias))\n\t\t\t\t{\n\t\t\t\t\t// add an alias for a specific store - this will override store type aliases\n\t\t\t\t\t$this->add_store_id_alias($alias['store_id'], $name, $alias['alias']);\n\t\t\t\t}\n\t\t\t\telseif (array_key_exists('store_type', $alias))\n\t\t\t\t{\n\t\t\t\t\t// add an alias for a store type\n\t\t\t\t\t$this->add_store_type_alias($alias['store_type'], $name, $alias['alias']);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function fieldRaw($columns, $alias = '')\n {\n $field = new SugarQuery_Builder_Field_Raw($columns, $this->query);\n if (!empty($alias)) {\n $field->alias = $alias;\n } else {\n $alias = md5($columns);\n }\n $this->select[$alias] = $field;\n return $this;\n }", "function getFields($table,$fields=\"\",$condition=\"\",$limit=\"\",$calculateRows=false,$fastHint=false);", "public function set_extra_fields($fields) {\n $this->extrafields = $fields;\n }", "public static function selectBaseFields($table, $selectFields) {\n\t\t$select = $selectFields;\n\t\t// Don't bother if all fields are selected anyway\n\t\tif ($selectFields != '*') {\n\t\t\t$hasUidField = FALSE;\n\t\t\t$hasPidField = FALSE;\n\t\t\t// Get the list of fields for the given table\n\t\t\t$tableFields = self::getAllFieldsForTable($table);\n\n\t\t\t// Add the fields, if available\n\t\t\t// NOTE: this may add the fields twice if they are already\n\t\t\t// in the list of selected fields, but that doesn't hurt\n\t\t\t// It doesn't seem worth making a very precise parsing of the list\n\t\t\t// of selected fields just to avoid duplicates\n\t\t\tif (isset($tableFields['uid'])) {\n\t\t\t\t$select .= ', ' . $table . '.uid';\n\t\t\t\t$hasUidField = TRUE;\n\t\t\t}\n\t\t\tif (isset($tableFields['pid'])) {\n\t\t\t\t$select .= ', ' . $table . '.pid';\n\t\t\t\t$hasPidField = TRUE;\n\t\t\t}\n\t\t\t// If one of the fields is still missing after that, throw an exception\n\t\t\tif ($hasUidField === FALSE || $hasPidField === FALSE) {\n\t\t\t\tthrow new Exception('Not all base fields are available.', 1284463019);\n\t\t\t}\n\t\t}\n\t\treturn $select;\n\t}", "function db_add_field(&$ret, $table, $field, $spec, $keys_new = array()) {\n $fixnull = FALSE;\n if (!empty($spec['not null']) && !isset($spec['default'])) {\n $fixnull = TRUE;\n $spec['not null'] = FALSE;\n }\n $query = 'ALTER TABLE {'. $table .'} ADD ';\n $query .= _db_create_field_sql($field, _db_process_field($spec));\n if (count($keys_new)) {\n $query .= ', ADD '. implode(', ADD ', _db_create_keys_sql($keys_new));\n }\n $ret[] = update_sql($query);\n if (isset($spec['initial'])) {\n // All this because update_sql does not support %-placeholders.\n $sql = 'UPDATE {'. $table .'} SET '. $field .' = '. db_type_placeholder($spec['type']);\n $result = db_query($sql, $spec['initial']);\n $ret[] = array('success' => $result !== FALSE, 'query' => check_plain($sql .' ('. $spec['initial'] .')'));\n }\n if ($fixnull) {\n $spec['not null'] = TRUE;\n db_change_field($ret, $table, $field, $field, $spec);\n }\n}", "public function testBuildSelectWithJoinDefaultFields()\n {\n $query = $this->getQuery()\n ->table('table1')\n ->fields()\n ->addField('user@email', 'email')\n ->join(\n $this->getQuery()\n ->table('table2')\n ->joinOn('id', 'id')\n )\n ;\n\n $this->assertSame(\n \"'user@email' AS table1__email, table2.*\",\n $query->buildSelectFields()\n );\n }", "function selectOnly($fields) {\n\t $this->result = null;\n \n\t if(is_array($fields)) {\n\t $this->select = $fields;\n\t } else {\n\t $args = func_get_args();\n\t\t array_shift($args);\n\t\t \n\t $this->select = array();\n\t\t\t$this->select[] = $this->escapeArray($fields, $args);\n\t }\n\t return $this; \n\t}", "function addField($f, $as=null) {\n\t\tif ($f != \"*\") {\n\t\t\t$f = \"`\".$f.\"`\";\n\t\t}\n\t\t$this->fields[] = array($this->getTable().\".\".$this->db->escape_string($f), $this->db->escape_string($as));\n\t\treturn $this;\n\t}", "public function getAllFields() {\n return $this->allFieldsAlias;\n }", "public function testBuildSelectWithEmptyFieldsAndAddField()\n {\n $query = $this->getQuery()\n ->fields()\n ->addField('user@email', 'email')\n ;\n\n $this->assertSame(\n \"'user@email' AS email\",\n $query->buildSelectFields()\n );\n }", "public function add_fields($query) {\n $documentclass = $this->get_document_classname();\n $fields = $documentclass::get_default_fields_definition();\n\n $dismax = false;\n if ($query instanceof \\SolrDisMaxQuery) {\n $dismax = true;\n }\n\n foreach ($fields as $key => $field) {\n $query->addField($key);\n if ($dismax && !empty($field['mainquery'])) {\n // Add fields the main query should be run against.\n // Due to a regression in the PECL solr extension, https://bugs.php.net/bug.php?id=72740,\n // a boost value is required, even if it is optional; to avoid boosting one among other fields,\n // the explicit boost value will be the default one, for every field.\n $query->addQueryField($key, 1);\n }\n }\n }", "protected function adjustFields(){\n\t\tforeach($this->fields as $key => $field)\n\t\t{\n\t\t\t$this->fields[$key] = sprintf(\"`%s`\", $field);\n\t\t}\n\t\treturn join(FuriousExpressionsDB::FieldSeparator, $this->fields);\n\t}", "public function select($fields=null) { if ($fields) $this->fields($fields); return $this->execute($this->get_select()); }", "public function aliasField(string $field, ?string $alias): array;", "public function fields(array $fields)\n {\n $prefix = $this->containsSQLParts('fields') ? self::LIST_DELIMITER : '';\n $fields = $prefix . implode(self::LIST_DELIMITER, General::array_map(function ($k, $field) {\n return $this->buildColumnDefinitionFromArray($k, $field);\n }, $fields));\n $this->unsafeAppendSQLPart('fields', $fields);\n return $this;\n }", "protected function buildFields(): string\n {\n $sql = '';\n\n // A set of fields isn't really required, even if it's a good\n // idea to have them. If nothing is there, leave it empty.\n if ( $this->fieldValueSet->isEmpty() )\n {\n return $sql;\n }\n\n $fieldNames = [];\n\n foreach ( $this->fieldValueSet->getFieldNames() as $fn )\n {\n $fieldNames[] = $this->quoter()->quoteField($fn);\n }\n\n $sql .= $this->indent() . '(';\n $sql .= implode(', ', $fieldNames);\n $sql .= ')' . PHP_EOL;\n\n return $sql;\n }", "public function addColumn($field, $alias = null, $mutator = null)\n\t{\n\t\t$this->_type = self::SELECT;\n\t\t\n\t\tif (empty($field)) {\n\t\t\treturn $this;\n\t\t}\n\t\t\n\t\tif(reset($this->_dqlParts[\"select\"][0]->getParts()) == self::SQL_STAR)\n\t\t\t$this->_dqlParts[\"select\"] = array();\n\t\t\n\t\t$selects = is_array($field) ? $field : func_get_args();\n\t\t$this->add('select', new Expr\\Select($selects), true);\n\t\treturn $this;\n\t}", "public function addFilterFields($fields=array()){\n \tif(empty($fields)) return ;\n\n \t$this->filterFields = !is_array($fields) ? explode(',',$fields) : $fields;\n \t\n }", "public function addAllVerboseFields($fields = array(), $edit = array()) {\n $i = 2;\n foreach ($fields as $field) {\n $edit['settings[verbose_fields][' . $i++ . ']'] = $field;\n }\n return $edit;\n }", "public function setSelectFields(array $selectFields = null)\n {\n $this->query->setSelectFields($selectFields);\n }", "public function fields($fields) {\n\t\tforeach($fields as $field) {\n\t\t\t$this->field($field);\n\t\t}\n\t\treturn $this;\n\t}", "public function addFields(array $fields)\n {\n foreach ($fields as $field) {\n $this->addField($field);\n }\n\n return $this;\n }", "public function fieldNamesWithAlias( $fields ) {\n\t\t$retval = array();\n\t\tforeach ( $fields as $alias => $field ) {\n\t\t\tif ( is_numeric( $alias ) ) {\n\t\t\t\t$alias = $field;\n\t\t\t}\n\t\t\t$retval[] = $this->fieldNameWithAlias( $field, $alias );\n\t\t}\n\n\t\treturn $retval;\n\t}", "public function addCustomFields( $fields )\n {\n\n $customFields = $this->getCustomFields();\n\n foreach ( $fields as $field ) {\n\n if ( ! isset( $customFields[ $field->handle ] ) ) {\n $customFields[ $field->handle ] = $field;\n }\n\n }\n\n $this->_customFields = $customFields;\n\n }", "function QueryBuilder($tableName, $returnFields) {\n\t\t$first = true;\n\t\tforeach ($returnFields as $fieldName) {\n\t\t\tif ($first) {\n\t\t\t\t$list = $fieldName;\n\t\t\t\t$first = false;\n\t\t\t} else {\n\t\t\t\t$list .= ', ' . $fieldName;\n\t\t\t}\n\t\t}\n\t\t$this->baseQuery = \"SELECT $list FROM $tableName\";\n\t}", "public function select($table, array $fields = null);", "private function selectFormat(array $fields, string $tableName){\n $query = \"\";\n foreach ($fields as $field){\n $query .= $tableName . \".\" . $field . \" AS \" . $tableName . $field . \",\";\n }\n return $query;\n }", "public function select($fields = [], bool $overwrite = false)\n {\n if (!is_string($fields) && is_callable($fields)) {\n $fields = $fields($this);\n }\n\n if (!is_array($fields)) {\n $fields = [$fields];\n }\n\n if ($overwrite) {\n $this->_parts['select'] = $fields;\n } else {\n $this->_parts['select'] = array_merge($this->_parts['select'], $fields);\n }\n\n return $this;\n }", "public function SQL_SelectFields($withPrimaryKey=true) {\n $sql = \"\";\n foreach ($this->fields as $f) {\n if ( ($f->isPrimary && $withPrimaryKey) || !$f->isPrimary ) {\n $sql .= (($sql == \"\")?\"\":\", \").$f->name;\n }\n }\n return $sql;\n }", "public function selectFields(array $fields) {\r\n\t\tforeach($fields as $f) {\r\n\t\t\t$this->selectField($f);\r\n\t\t}\r\n\t}", "public abstract function getSelect(\n $fields, $from, $where = '', $groupby = '', $limit = 0, $offset = 0\n );", "public function fields(array $fields)\n {\n if ($this instanceof ParameterBuilder) {\n $this->setParameter('fields', implode(',', $fields));\n }\n\n return $this;\n }", "public function select($fields) {\n\t\tif($fields === null) {\n\t\t\tunset($this->query['select']);\n\t\t\treturn $this;\n\t\t}\n\t\t$this->setParam($fields, 'select');\n\t\treturn $this;\n\t}", "public function getQueryFields ($table);", "public function groupBy($fields, $overwrite = false);", "public static function addSelectColumns(Criteria $criteria, $alias = null)\n {\n if (null === $alias) {\n $criteria->addSelectColumn(ArtistTableMap::ID);\n $criteria->addSelectColumn(ArtistTableMap::NAME);\n $criteria->addSelectColumn(ArtistTableMap::DOB);\n $criteria->addSelectColumn(ArtistTableMap::DOD);\n $criteria->addSelectColumn(ArtistTableMap::ISBAND);\n $criteria->addSelectColumn(ArtistTableMap::DATE_FORMED);\n $criteria->addSelectColumn(ArtistTableMap::DATE_ENDED);\n $criteria->addSelectColumn(ArtistTableMap::MEMBERS);\n $criteria->addSelectColumn(ArtistTableMap::ALBUMS);\n $criteria->addSelectColumn(ArtistTableMap::LABEL_ID);\n } else {\n $criteria->addSelectColumn($alias . '.ID');\n $criteria->addSelectColumn($alias . '.NAME');\n $criteria->addSelectColumn($alias . '.DOB');\n $criteria->addSelectColumn($alias . '.DOD');\n $criteria->addSelectColumn($alias . '.ISBAND');\n $criteria->addSelectColumn($alias . '.DATE_FORMED');\n $criteria->addSelectColumn($alias . '.DATE_ENDED');\n $criteria->addSelectColumn($alias . '.MEMBERS');\n $criteria->addSelectColumn($alias . '.ALBUMS');\n $criteria->addSelectColumn($alias . '.LABEL_ID');\n }\n }" ]
[ "0.64746785", "0.63453346", "0.6126913", "0.6121657", "0.5990967", "0.5975487", "0.5907302", "0.59042746", "0.5858502", "0.5830783", "0.5812014", "0.5801033", "0.57887346", "0.5742645", "0.5711914", "0.5651747", "0.5630977", "0.5619376", "0.55957603", "0.5575508", "0.55608964", "0.5559922", "0.55419564", "0.5541103", "0.553333", "0.54791236", "0.5462921", "0.54624516", "0.54567313", "0.54547197", "0.54506314", "0.5439308", "0.5432351", "0.5428315", "0.54232967", "0.538917", "0.5373199", "0.536499", "0.53466684", "0.5344071", "0.5340652", "0.53342515", "0.5323271", "0.5302796", "0.52988833", "0.52889735", "0.52879554", "0.52696705", "0.5256749", "0.52528", "0.5249108", "0.5249108", "0.5242818", "0.52389586", "0.5238615", "0.5229649", "0.5226059", "0.52237856", "0.5220091", "0.52118486", "0.52087337", "0.51941884", "0.51834184", "0.51794946", "0.5173035", "0.5172588", "0.51678485", "0.51556927", "0.5147242", "0.51422393", "0.5138475", "0.5137685", "0.51327723", "0.512721", "0.51267695", "0.5121773", "0.512154", "0.5119623", "0.51165223", "0.5115716", "0.51155", "0.5109419", "0.5107786", "0.5097958", "0.50832325", "0.50785226", "0.5058594", "0.5049064", "0.5045598", "0.50451857", "0.5035202", "0.50339216", "0.5007132", "0.5002191", "0.49975705", "0.49932066", "0.49918982", "0.4984755", "0.49832645", "0.49766383" ]
0.6792545
0
Adds an expression to the list of "fields" to be SELECTed. An expression can be any arbitrary string that is valid SQL. That includes various functions, which may in some cases be databasedependent. This method makes no effort to correct for databasespecific functions.
public function addExpression($expression, $alias = NULL, $arguments = []);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testBuildSelectWithAddFieldExpression()\n {\n $query = $this->getQuery()\n ->addField(Expression::apishka('NOW()'), 'current_time')\n ;\n\n $this->assertSame(\n '*, NOW() AS current_time',\n $query->buildSelectFields()\n );\n }", "protected function _stringFieldsSelect(array $fields) \n\t{\n\t\t$result = '';\n\n\t\tforeach ($fields as $key => $value) {\n\t\t\tif (in_array($value, $this->_fields)) {\n\t\t\t\t$result .= '`' . $value . '`,';\n\t\t\t}\n\t\t}\n\t\t//remove last ',' from sql\n\t\t$result = substr($result, 0, -1);\n\n\t\treturn $result;\n\t}", "public function testBuildSelectWithAddField()\n {\n $query = $this->getQuery()\n ->addField('user@email', 'email')\n ;\n\n $this->assertSame(\n \"*, 'user@email' AS email\",\n $query->buildSelectFields()\n );\n }", "protected function buildFields(): string\n {\n $sql = '';\n\n // A set of fields isn't really required, even if it's a good\n // idea to have them. If nothing is there, leave it empty.\n if ( $this->fieldValueSet->isEmpty() )\n {\n return $sql;\n }\n\n $fieldNames = [];\n\n foreach ( $this->fieldValueSet->getFieldNames() as $fn )\n {\n $fieldNames[] = $this->quoter()->quoteField($fn);\n }\n\n $sql .= $this->indent() . '(';\n $sql .= implode(', ', $fieldNames);\n $sql .= ')' . PHP_EOL;\n\n return $sql;\n }", "private function addFields( array $aFields )\n\t{\n\t\t// FIELDS\n\t\t$this->query .= \" (\";\n\t\t$i = 1;\n\t\tforeach ($aFields as $field)\n\t\t{\n\t\t\t$this->query .= \" \" . $field;\n\t\t\tif ($i < count( $aFields ))\n\t\t\t{\n\t\t\t\t$this->query .= \",\"; // last fields should not end with a ,\n\t\t\t}\n\t\t\t\n\t\t\t$i ++;\n\t\t}\n\t\t$this->query .= \")\";\n\t\t\n\t\t// VALUES\n\t\t$this->query .= \" VALUES(\";\n\t\t$i = 1;\n\t\tforeach ($aFields as $field)\n\t\t{\n\t\t\t$this->query .= \":\".$field;\n\t\t\tif ($i < count( $aFields ))\n\t\t\t{\n\t\t\t\t$this->query .= \",\"; // last fields should not end with a ,\n\t\t\t}\n\t\t\t\n\t\t\t$i ++;\n\t\t}\n\t\t$this->query .= \")\";\n\t}", "public function getAddFieldsDDL($fields)\n {\n $ret = '';\n $pattern = \"\nALTER TABLE %s ADD %s;\n\";\n foreach ($fields as $field) {\n $ret .= sprintf($pattern,\n $this->quoteIdentifier($field->getEntity()->getFQTableName()),\n $this->getFieldDDL($field)\n );\n }\n\n return $ret;\n }", "public function build_select( $fields = array() ) {\n if ( empty( $fields ) ) {\n return ' SELECT * ';\n }\n\n return ' SELECT ' . implode( ', ', $fields );\n }", "public function addSelect($expression)\n\t{\n\t\tif (!is_string($expression)) {\n\t\t\tthrow new InvalidArgumentException('Select expression has to be a string.');\n\t\t}\n\t\t$this->dirty();\n\t\t$this->select[] = $expression;\n\t\t$this->pushArgs('select', array_slice(func_get_args(), 1));\n\t\treturn $this;\n\t}", "function getReportColumnSQL($selectedfields) {\n\t\t$reportRunObject = $this->getReportRunObject();\n\t\t$append_currency_symbol_to_value = $reportRunObject->append_currency_symbol_to_value;\n\t\t$reportRunObject->append_currency_symbol_to_value = array();\n\n\t\t$columnSQL = $reportRunObject->getColumnSQL($selectedfields);\n\n\t\t$reportRunObject->append_currency_symbol_to_value = $append_currency_symbol_to_value;\n\t\treturn $columnSQL;\n\t}", "public function addFieldsWithVariables($expression, array $variables) {\n $expression = $this->parseVariables($expression, $variables);\n\n parent::addFieldsWithVariables($expression, array());\n }", "public abstract function getSelectSQL($fields, $from, $joins, $where, $having, $group, $order, $limit, $values, $forupdate);", "public function testBuildSelectWithAddFieldAndAlias()\n {\n $query = $this->getQuery()\n ->alias('alias')\n ->addField(Expression::apishka('NOW()'), 'current_time')\n ;\n\n $this->assertSame(\n 'alias.*, NOW() AS alias__current_time',\n $query->buildSelectFields()\n );\n }", "public function select(array $fields): SQL\n {\n $this->fields = $fields;\n return $this;\n }", "public static function expression($expression) {\n\t\treturn new \\db\\expression($expression);\n\t}", "function _get_select_fields()\r\n\t{\r\n\t\t$sql_exec_fields = array();\r\n\t\tforeach ($this->_params as $key => $val)\r\n\t\t{\r\n\t\t\t$tmp_field = $this->_node_table . '.' . $key . ' AS ' . $val;\r\n\t\t\t$sql_exec_fields[] = $tmp_field;\r\n\t\t} \r\n\r\n\t\t$fields = implode(', ', $sql_exec_fields);\r\n\t\treturn $fields;\r\n\t}", "private function setFields()\n\t{\t\n\t\t$sql = '';\n\t\t\n\t\tforeach (array_keys($this->data) as $key)\n\t\t{\n\t\t\t$sql .= '`' . $key . '` = ? , ';\n\t\t}\n\t\t\n\t\t$sql = rtrim($sql, ', ');\n\t\t\n\t\treturn $sql;\n\t}", "private function setField()\n {\n $sql = '';\n $sql = rtrim($sql , ', ');\n\n foreach (array_keys($this->data) as $key){\n $sql .= '`' . $key . '` = ?, ';\n }\n\n $sql = rtrim($sql , ', ');\n return $sql;\n }", "private function setFields(): string\n {\n $sql = '';\n\n foreach (array_keys($this->data) as $key) {\n $sql .= '`' . $key . '` = ? , ';\n }\n return rtrim($sql, ', ');\n }", "public function select(string $fields): QueryBuilderInterface\n\t{\n\t\t// Split fields by comma\n\t\t$fieldsArray = explode(',', $fields);\n\t\t$fieldsArray = array_map('mb_trim', $fieldsArray);\n\n\t\t// Split on 'As'\n\t\tforeach ($fieldsArray as $key => $field)\n\t\t{\n\t\t\tif (stripos($field, 'as') !== FALSE)\n\t\t\t{\n\t\t\t\t$fieldsArray[$key] = preg_split('` as `i', $field);\n\t\t\t\t$fieldsArray[$key] = array_map('mb_trim', $fieldsArray[$key]);\n\t\t\t}\n\t\t}\n\n\t\t// Quote the identifiers\n\t\t$safeArray = $this->driver->quoteIdent($fieldsArray);\n\n\t\tunset($fieldsArray);\n\n\t\t// Join the strings back together\n\t\tfor($i = 0, $c = count($safeArray); $i < $c; $i++)\n\t\t{\n\t\t\tif (\\is_array($safeArray[$i]))\n\t\t\t{\n\t\t\t\t$safeArray[$i] = implode(' AS ', $safeArray[$i]);\n\t\t\t}\n\t\t}\n\n\t\t$this->state->appendSelectString(implode(', ', $safeArray));\n\n\t\treturn $this;\n\t}", "public function fields(array $fields)\n {\n $this->unsafeAppendSQLPart('field', $this->asTickedList($fields));\n return $this;\n }", "public function testFunctionWithDatabaseQuery(): void\n {\n $query = ConnectionManager::get('test')\n ->selectQuery(['column']);\n\n $binder = new ValueBinder();\n $function = new $this->expressionClass('MyFunction', [$query]);\n $this->assertSame(\n 'MyFunction((SELECT column))',\n preg_replace('/[`\"\\[\\]]/', '', $function->sql($binder))\n );\n }", "public function setSelectFields()\r\n\t{\r\n\t\t$fields = func_get_args();\r\n\t\tif (empty($fields))\r\n\t\t{\r\n\t\t\tthrow new \\Exception('Select fields list is not an array or empty.');\r\n\t\t}\r\n\t\r\n\t\t// Check if fields exist in fields collection\r\n\t\tforeach($fields as &$item)\r\n\t\t{\r\n\t\t\t$found = false;\r\n\t\t\tforeach ($this->fields as &$field)\r\n\t\t\t{\r\n\t\t\t\tif ($item == $field->name)\r\n\t\t\t\t{\r\n\t\t\t\t\t$found = true;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\t\r\n\t\t\tif (!$found)\r\n\t\t\t{\r\n\t\t\t\tthrow new \\Exception('There is no field \"' . $item . '\" in table ' . $this->name . '.');\r\n\t\t\t}\r\n\t\r\n\t\t\t// Add to list\r\n\t\t\tif ($this->hasForeignFields())\r\n\t\t\t{\r\n\t\t\t\t$item = 't1.`' . $item . '`';\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t$item = '`' . $this->name . '`.`' . $item . '`';\r\n\t\t\t}\r\n\t\t}\r\n\t\r\n\t\t$this->selectFields = $fields;\r\n\t}", "public function addSelect($fields)\n {\n if (func_num_args() > 1) {\n $fields = func_get_args();\n } elseif (!is_array($fields)) {\n $fields = [$fields];\n }\n foreach ($fields as $idx => $field) {\n $this->selectField($field, is_numeric($idx) ? null : $idx);\n }\n\n return $this;\n }", "public function select($fields);", "public function setFields($fields) {\r\n if( is_array($fields) ) {\r\n $this->sqlFields = array_merge($this->sqlFields, $fields);\r\n } elseif( is_string($fields) ) {\r\n $this->sqlFields[] = $fields;\r\n }\r\n return $this;\r\n }", "public function createExpression()\n {\n return new ezcQueryExpressionPgsql( $this );\n }", "protected function appendSql($string)\n {\n $this->selectSQL .= $string;\n return $this;\n }", "public static function createExpression($sql_expression) {\r\n\t return new LazyDBExpressionType($sql_expression);\r\n\t}", "public static function expr($string = '')\n\t{\n\t\treturn new Expression($string);\n\t}", "public function fields($fields) {\n $this->_active_query->fields($fields);\n }", "public function fields($fields = NULL)\n {\n if(isset($fields))\n {\n $fields = (is_array($fields)) ? implode(',',$fields) : $fields;\n $this->_database->select($fields);\n }\n return $this;\n }", "public function addFieldToFilter($fields, $condition)\n {\n foreach ($fields as $index => $field) {\n $this->addFilter($field, $condition[$index]);\n }\n }", "function selectFunction($primaryField,$polarityField,$textField,$tableName) {\n\t$sql=\"SELECT \" . $primaryField . \" AS ID, \" . $polarityField . \" AS field1,\" . $textField . \" AS field2 FROM \" . $tableName ;\n\treturn $sql ; \n}", "private function GeneraSelectQuery($fields,$where)\r\n\t{\r\n\t\t$sql=\"select \r\n\t\t\t\".$fields.\" \r\n\t\t\tfrom Tabla\r\n\t\t\tinner join Tabla1 on Tabla1.id=Tabla.idTabla1\r\n\t\t\t\".(($where)?\" WHERE \".$where:\"\");\r\n\t\treturn $sql;\r\n\t}", "protected function adjustFields(){\n\t\tforeach($this->fields as $key => $field)\n\t\t{\n\t\t\t$this->fields[$key] = sprintf(\"`%s`\", $field);\n\t\t}\n\t\treturn join(FuriousExpressionsDB::FieldSeparator, $this->fields);\n\t}", "private function sql_whereAnd_enableFields()\n {\n // Get table and field\n list( $table ) = explode( '.', $this->curr_tableField );\n\n $andWhere = $this->pObj->cObj->enableFields( $table );\n\n // RETURN AND WHERE statement\n return $andWhere;\n }", "protected function buildSelectClause() {\r\n\t\t$sql='';\r\n\t\t$fields=array();\r\n\t\tforeach($this->_salt_fields as $data) {\r\n\t\t\t/** @var SqlExpr $expr */\r\n\t\t\tlist($expr, $alias) = $data;\r\n\r\n\t\t\t$fields[]=$expr->toSQL().' as '.self::escapeName($alias);\r\n\t\t\t$this->linkBindsOf($expr, ClauseType::SELECT);\r\n\t\t}\r\n\t\t$sql.=implode(', ', $fields);\r\n\t\treturn $sql;\r\n\t}", "public function select($fields=null) { if ($fields) $this->fields($fields); return $this->execute($this->get_select()); }", "public function expressionFunction();", "private function selectFormat(array $fields, string $tableName){\n $query = \"\";\n foreach ($fields as $field){\n $query .= $tableName . \".\" . $field . \" AS \" . $tableName . $field . \",\";\n }\n return $query;\n }", "function quoteFields($fields) {\n\t\tforeach($fields as $field) $result[] = '{' . $field . '}';\n\t\treturn $result;\n\t}", "public function selectFields($selectFields)\n\t{\n\t\t$this->select = $selectFields ? $selectFields : '*';\n\t}", "public function select(...$fields) {\n\t\t$select = (new Selectable($this->table))->select($fields);\n\t\t\n\t\tif ($this->softDelete) {\n\t\t\t$select->where((new Where)->isNull('`'. $this->table .'`.`deleted_at`'));\n\t\t}\n\n\t\treturn $select;\n\t}", "public function field($columns)\n {\n if (!is_array($columns)) {\n $columns = func_get_args();\n }\n foreach ($columns as $column) {\n $field = new SugarQuery_Builder_Field_Select($column, $this->query);\n $key = empty($field->alias) ? $field->field : $field->alias;\n if(!$field->isNonDb()) {\n $this->select[$key] = $field;\n $this->fieldsByTable[$field->table][$field->field] = true;\n }\n }\n return $this;\n }", "public function testBuildSelectWithEmptyFieldsAndAddField()\n {\n $query = $this->getQuery()\n ->fields()\n ->addField('user@email', 'email')\n ;\n\n $this->assertSame(\n \"'user@email' AS email\",\n $query->buildSelectFields()\n );\n }", "public function select($field = '*', $escape = null)\n {\n // If the escape value was not set, we will base it on the global setting\n is_bool($escape) || $escape = $this->conn->protectIdentifiers;\n\n if (is_string($field)) {\n $field = str_replace(' as ', ' AS ', $field);\n\n if (strpos($field, '+') !== false || strpos($field, '(') !== false) {\n $field = [$field];\n } else {\n $field = explode(',', $field);\n }\n\n foreach ($field as $name) {\n $name = trim($name);\n\n $this->builderCache->select[] = $name;\n $this->builderCache->noEscape[] = $escape;\n }\n } elseif (is_array($field)) {\n foreach ($field as $fieldName => $fieldAlias) {\n if (is_numeric($fieldName)) {\n $fieldName = $fieldAlias;\n } elseif (is_string($fieldName)) {\n if (is_string($fieldAlias)) {\n $fieldName = $fieldName . ' AS ' . $fieldAlias;\n } elseif (is_array($fieldAlias)) {\n $countFieldAlias = count($fieldAlias);\n\n for ($i = 0; $i < $countFieldAlias; $i++) {\n if ($i == 0) {\n $fieldAlias[ $i ] = $fieldAlias[ $i ] . \"'+\";\n } elseif ($i == ($countFieldAlias - 1)) {\n $fieldAlias[ $i ] = \"'+\" . $fieldAlias[ $i ];\n } else {\n $fieldAlias[ $i ] = \"'+\" . $fieldAlias[ $i ] . \"'+\";\n }\n }\n\n $fieldName = implode(', ', $fieldAlias) . ' AS ' . $fieldName;\n } elseif ($fieldAlias instanceof AbstractQueryBuilder) {\n $fieldName = '( ' . $fieldAlias->getSqlStatement() . ' ) AS ' . $fieldName;\n }\n }\n\n $this->select($fieldName, $escape);\n }\n }\n\n return $this;\n }", "public function getSQLExpression()\n {\n return $this->getDriver()->getColumnSQLExpression($this);\n }", "public abstract function getSelect(\n $fields, $from, $where = '', $groupby = '', $limit = 0, $offset = 0\n );", "public function addFilterFields($fields=array()){\n \tif(empty($fields)) return ;\n\n \t$this->filterFields = !is_array($fields) ? explode(',',$fields) : $fields;\n \t\n }", "protected function parseFields( $fieldsString )\n {\n $fields = explode( ',', $fieldsString );\n $expansions = array( );\n\n if ( strpos( $fieldsString, '.' ) !== false )\n {\n $s = -1;\n $directive = null;\n\n foreach ( $fields as $index => $field )\n {\n if ( strpos( $field, '.' ) !== false )\n {\n list( $fieldName, $expansionData ) = explode( '.', $field );\n $fields[ $index ] = $fieldName;\n list( $directive, $data ) = $this->parseExpansions( $expansionData );\n $expansions[ $fieldName ][ $directive ][] = $data;\n\n if ( strpos( $field, ')' ) === false )\n {\n $s = $fieldName;\n }\n }\n else if ( $s !== -1 )\n {\n if ( strpos( $field, ')' ) !== false )\n {\n list( , $data ) = $this->parseExpansions( $field );\n $expansions[ $s ][ $directive ][] = $data;\n $s = -1;\n $directive = null;\n unset( $fields[ $index ] );\n }\n else\n {\n $expansions[ $s ][ $directive ][] = $field;\n unset( $fields[ $index ] );\n }\n }\n }\n }\n\n // TODO: Remove json decode/encode silliness\n return array( $fields, $expansions );\n }", "function selectOnly($fields) {\n\t $this->result = null;\n \n\t if(is_array($fields)) {\n\t $this->select = $fields;\n\t } else {\n\t $args = func_get_args();\n\t\t array_shift($args);\n\t\t \n\t $this->select = array();\n\t\t\t$this->select[] = $this->escapeArray($fields, $args);\n\t }\n\t return $this; \n\t}", "public function testBuildSelectWithFields()\n {\n $query = $this->getQuery()\n ->fields('id', 'name', 'email')\n ;\n\n $this->assertSame(\n 'id, name, email',\n $query->buildSelectFields()\n );\n }", "public function select($fields) {\n\n $fields = self::check_fields_of_table_list(array_map('trim', explode(',', $fields)));\n\n // varsayılan olarak ekle, objeler yüklenirken her zaman id olmalıdır.\n $table_and_primary_key = $this->_table . \".id\";\n if (!in_array($table_and_primary_key, $fields))\n array_push($fields, $table_and_primary_key);\n\n $this->_select = $fields; // [\"User.first_name\", \"User.last_name\", \"Comment.name\"]\n return $this;\n }", "public function setSelect($fields)\n {\n $this->select = [];\n if (func_num_args() > 1) {\n $fields = func_get_args();\n } elseif (!is_array($fields)) {\n $fields = [$fields];\n }\n return $this->addSelect($fields);\n }", "public function SELECT_string($str) {\n\t\t$field_name = $str;\n\t\t$field_alias = null;\n\t\t$table_alias = null;\n\n\t\t/* Parse string to extract possible field alias (in form `field alias` or `field AS alias`) */\n\t\t$pot_field_aliases = preg_split(\"# AS |\\s#\", $field_name);\n\t\tif (count($pot_field_aliases) > 1) {\n\t\t\t$field_alias = $pot_field_aliases[1];\n\t\t\t$field_name = $pot_field_aliases[0];\n\t\t}\n\t\t/* Parse string to extract possible table alias (in form `table.field`) */\n\t\t$pot_table_aliases = preg_split(\"#\\.#\", $field_name);\n\t\tif (count($pot_table_aliases) > 1) {\n\t\t\t$table_alias = $pot_table_aliases[0];\n\t\t\t$field_name = $pot_field_aliases[1];\n\t\t}\n\n\t\t/* Actual function to do it is SELECT_once */\n\t\t$this->SELECT_once($field_name, $field_alias, $table_alias);\n\t}", "public function fields(array $fields)\n {\n $prefix = $this->containsSQLParts('fields') ? self::LIST_DELIMITER : '';\n $fields = $prefix . implode(self::LIST_DELIMITER, General::array_map(function ($k, $field) {\n return $this->buildColumnDefinitionFromArray($k, $field);\n }, $fields));\n $this->unsafeAppendSQLPart('fields', $fields);\n return $this;\n }", "public function select(string ...$fields): self\n {\n $this->select = $fields;\n return $this;\n }", "public function resolveFields($fields)\n {\n $all = [];\n if (is_array($fields)) {\n foreach ($fields as $k => $v) {\n if (is_numeric($k)) {\n $all[] = $this->quoteColumn($v);\n }\n else {\n $all[] = $this->quoteColumn($k) . \" AS \" . $this->quoteColumn($v);\n }\n }\n }\n else {\n return $fields;\n }\n\n return implode(\", \", $all);\n }", "public function getSelectExpr()\n {\n return $this->readOneof(5);\n }", "public function checkSafety($expression) {\n\t\tif (preg_match('/\\b(\\w+)\\s*\\(/', $expression, $m)) {\n\t\t\tif (!in_array($m[1], array_keys($this->allowed)) && ! strcasecmp($m[1], 'and') && ! strcasecmp($m[1], 'or')) {\n\t\t\t\t// A not allowed function is found\n\t\t\t\tthrow new SQLSelectTokenizerException(\"syntax error near : \".$m[1]);\n\t\t\t}\n\t\t}\n\t\tif (strpos($expression, chr(10))) {\n\t\t\t// newline is forbidden\n\t\t\tthrow new SQLSelectTokenizerException(\"syntax error\");\n\t\t}\n\t\tif (preg_match('/[`\\{\\}\\[\\]\\;]/', $expression, $m)) {\n\t\t\t// metacharacters are forbidden\n\t\t\tthrow new SQLSelectTokenizerException(\"syntax error near : \".$m[1]);\n\t\t}\n\t\tif (preg_match('/\\$\\$([^\\s]+)/', $expression, $m)) {\n\t\t\t// $$ is forbidden\n\t\t\tthrow new SQLSelectTokenizerException(\"syntax error near : \".$m[1]);\n\t\t}\n\t}", "public function select($field);", "function select($fields = NULL)\n {\n // Create a fresh slate\n $this->object->_init();\n if (!$fields or $fields == '*') {\n $fields = $this->get_table_name() . '.*';\n }\n $this->object->_select_clause = \"SELECT {$fields}\";\n return $this->object;\n }", "protected function buildValuesFromSelect(): string\n {\n $sql = '';\n\n // Check for a SELECT statement and append if available\n if ( isset($this->select) )\n {\n $sql .= $this->indentStatement($this->select, 1);\n\n $this->mergeBindings($this->select);\n }\n\n return $sql;\n }", "public function fields($table_alias, array $fields = []);", "public function addColumn($field, $alias = null, $mutator = null)\n\t{\n\t\t$this->_type = self::SELECT;\n\t\t\n\t\tif (empty($field)) {\n\t\t\treturn $this;\n\t\t}\n\t\t\n\t\tif(reset($this->_dqlParts[\"select\"][0]->getParts()) == self::SQL_STAR)\n\t\t\t$this->_dqlParts[\"select\"] = array();\n\t\t\n\t\t$selects = is_array($field) ? $field : func_get_args();\n\t\t$this->add('select', new Expr\\Select($selects), true);\n\t\treturn $this;\n\t}", "public function getExpression();", "public function get_select()\n {\n $flags = $this->sql_no_cache ? 'sql_no_cache' : '';\n $flags .= $this->sql_calc_found ? 'sql_calc_found_rows' : '';\n\n $fields_table = $this->alias ? $this->alias: self::quote_name($this->table);\n\n $fields = $this->fields ? join(', ', $this->fields): $fields_table.'.*';\n $from = $this->get_from();\n $join = $this->get_join();\n $where = $this->get_where();\n $having = $this->get_having();\n $order = $this->get_order();\n $group = $this->get_group();\n $limit = $this->get_limit();\n $mode = $this->for_update ? 'for update': '';\n $mode = $this->share_mode ? 'lock in share mode': '';\n // MySQL runs a needless filesort when grouping without an order clause. disable it.\n if ($group && !$order) $order = 'order by null';\n return \"select $flags $fields $from $join $where $group $having $order $limit $mode\";\n }", "private function formatFields($tableName, $fieldsArr) {\n\n\t\tif(is_array($fieldsArr)){\n if(count($fieldsArr) > 0){\n foreach ($fieldsArr as $func => $field) {\n if(is_array($field)){\n $condition = $this->where($tableName, $field,array('prepend' => FALSE));\n $pos = -1;\n foreach ($this->_operators as $key => $value) {\n $pos = strpos($condition, $key);\n if($pos !== FALSE){\n break;\n }\n }\n $endPart = substr($condition, $pos);\n $startPart = trim(substr($condition, 0, $pos));\n $fields[] = \"{$func}({$startPart}) {$endPart}\";\n }else{\n//\t\t\t\t\t\t\t\t\tpr($field);\n if(is_string($func)){\n $func = strtoupper($func);\n if(array_key_exists($func, $this->_func)){\n $fields[] = \"{$func}({$tableName}.{$field})\";\n }\n else{\n $fields[] = \"{$tableName}.{$field}\";\n }\n }\n else if(array_key_exists ($field,$this->schema[$tableName])){\n\t\t\t\t\t\t\t\t\t\t\t$fields[] = \"{$tableName}.{$field}\";\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t\t\t\t\t$fields[] = $field;\n\t\t\t\t\t\t\t\t\t\t}\n }\n }\n }\n\t\t}\n\t\telse if(strpos('*', $fieldsArr) !== FALSE || $fieldsArr == NULL){\n if(count($this->schema) > 0){\n foreach ($this->schema[$tableName] as $field => $attr) {\n $fields[] = $tableName.\".\".$field;\n }\n }\n\t\t}else{\n\t\t\tif(array_key_exists ($fieldsArr,$this->schema[$tableName])){\n\t\t\t\t$fields[] = \"{$tableName}.{$fieldsArr}\";\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$fields[] = $fieldsArr;\n\t\t\t}\n\t\t}\n\t\treturn $fields;\n\t}", "private function __select() {\n $from_str = $this->getFromStr();\n $field = $this->field_str;\n if (empty($field)) {\n $field = '*';\n }\n $sql = \"SELECT {$field} FROM {$from_str}\";\n if (!empty($this->join_str_list)) {\n $temp = implode(' ', $this->join_str_list);\n $sql .= \" {$temp}\";\n }\n if (!empty($this->where_str)) {\n $sql .= \" WHERE {$this->where_str}\";\n }\n if (!empty($this->group_str)) {\n $sql .= \" GROUP BY {$this->group_str}\";\n }\n if (!empty($this->order_str)) {\n $sql .= \" ORDER BY {$this->order_str}\";\n }\n if (!empty($this->limit_str)) {\n $sql .= \" LIMIT {$this->limit_str}\";\n }\n $list = $this->query($sql);\n return $list;\n }", "function parsingSql()\r\n\t{\r\n\t\tif ( preg_match(\"/{(.*?)}/\",$this->sql,$match) )\r\n\t\t{\r\n\t\t\t$this->valueToReplace = $match[0]; // {blabla}\r\n\t\t\t$this->fieldToSelect = $match[1]; // nama field yang akan di cek\r\n\t\t}else{\r\n\t\t\tdie(\"SQL query yg anda masukan harus mengandung {}\");\r\n\t\t\treturn ;\r\n\t\t}\r\n\t}", "protected function getExpressionCreated() {\n return implode( \", \", \n array_map( \n function ( $var ) {\n if ( is_object( $var ) && is_a( $var, SqlbuilderDbCore::class_() ) ) {\n return SB::par( SqlbuilderDbCore::get_( $var )->build() );\n }\n return $var;\n }, array_filter( $this->getExpression() ) ) );\n }", "protected function _addDefaultFields()\n {\n $select = $this->clause('select');\n $this->_hasFields = true;\n\n if (!count($select) || $this->_autoFields === true) {\n $this->_hasFields = false;\n $this->select($this->repository()->getSchema()->columns());\n $select = $this->clause('select');\n }\n\n $aliased = $this->aliasFields($select, $this->repository()->getAlias());\n $this->select($aliased, true);\n }", "function addSqlFields($currentNode, $branchDepth = 0, $isFirstField = true, $sqlAndSelectedObjects = [\"sql\" => \"SELECT \", \"selectedObjects\" => []])\n {\n $selections = $currentNode[\"selectionSet\"][\"selections\"];\n $rootFieldName = $currentNode[\"name\"][\"value\"];\n\n $sql = $sqlAndSelectedObjects[\"sql\"];\n $selectedObjects = $sqlAndSelectedObjects[\"selectedObjects\"];\n\n //$selectedObjects = [];\n //$sql .= \"SELECT \";\n //return $selections;\n // Add fields to SQL query\n\n $sql .= $isFirstField ?\n $rootFieldName . \".\" . \"id\" :\n \", \" . $rootFieldName . \".\" . \"id\";\n\n $sql .= \" AS \" . \"'\" . $rootFieldName . \".\" . \"id\" . \"'\";\n $isFirstField = false;\n\n for ($i = 0; $i < count($selections); $i++) {\n $field = $selections[$i];\n $fieldName = $field[\"name\"][\"value\"];\n\n if ($fieldName == \"id\") {\n continue;\n }\n\n if (self::isSpread($field)) {\n // Requested fieldname exists as column in table\n if (self::columnExistsInTable($fieldName . \"_id\", $rootFieldName)) {\n //if (!in_array([\"type\" => \"one-to-one\", \"from\" => $rootFieldName, \"to\" => $fieldName], $this->selectedObjects))\n // array_push($this->selectedObjects, [\"type\" => \"one-to-one\", \"from\" => $rootFieldName, \"to\" => $fieldName]);\n\n if (!in_array([\"type\" => \"one-to-one\", \"from\" => $rootFieldName, \"to\" => $fieldName], $selectedObjects))\n array_push($selectedObjects, [\"type\" => \"one-to-one\", \"from\" => $rootFieldName, \"to\" => $fieldName]);\n\n //$sql .= $this->addSqlFields($field, $branchDepth + 1, \"\", $isFirstField, $selectedObjects)[\"sql\"];\n $new = $this->addSqlFields($field, $branchDepth, $isFirstField, [\"sql\" => $sql, \"selectedObjects\" => $selectedObjects]);\n\n $sql = $new[\"sql\"];\n $selectedObjects = $new[\"selectedObjects\"];\n\n } else {\n // Many to many (for now) TODO\n //if (!in_array([\"type\" => \"many-to-many\", \"from\" => $rootFieldName, \"to\" => $fieldName], $this->selectedObjects))\n // array_push($this->selectedObjects, [\"type\" => \"many-to-many\", \"from\" => $rootFieldName, \"to\" => $fieldName]);\n if (!in_array([\"type\" => \"many-to-many\", \"from\" => $rootFieldName, \"to\" => $fieldName], $selectedObjects))\n array_push($selectedObjects, [\"type\" => \"many-to-many\", \"from\" => $rootFieldName, \"to\" => $fieldName]);\n }\n } else {\n // Current node is not object but scalar type field\n $sql .= $isFirstField ?\n $rootFieldName . \".\" . $fieldName :\n \", \" . $rootFieldName . \".\" . $fieldName;\n\n $sql .= \" AS \" . \"'\" . $rootFieldName . \".\" . $fieldName . \"'\";\n $isFirstField = false;\n }\n }\n\n //return $sql;\n return [\"sql\" => $sql, \"selectedObjects\" => $selectedObjects];\n }", "protected function buildSql()\n {\n $this->selectSQL = ''; // reset query string\n\n $this->appendSql(\"SELECT \" . $this->buildFieldsList() . \" FROM \" . $this->fromTable)\n ->appendSql(!empty($this->joinsString) ? \" \" . $this->joinsString : \"\")\n ->appendSql(\" WHERE \" . (!empty($this->whereString) ? \" \" . $this->whereString : \" 1\"))\n ->appendSql(!empty($this->groupbyString) ? \" GROUP BY \" . $this->groupbyString : \"\")\n ->appendSql(!empty($this->orderbyString) ? \" ORDER BY \" . $this->orderbyString : \"\")\n ->appendSql(!empty($this->limitString) ? \" \" . $this->limitString : \"\");\n }", "public function fields($alias, $fields = array('*'))\t{\n\n\t\tif (!is_string($alias) || empty($alias)) {\n\t\t\tthrow new InvalidArgumentException('Invalid table alias.');\n\t\t}\n\t\tif (!is_array($fields) || empty($fields)) {\n\t\t\tthrow new InvalidArgumentException('Invalid fields list.');\n\t\t}\n\n\t\tforeach ($fields as $name) {\n\t\t\t$this->fields[] = \"$alias.$name\";\n\t\t}\n\t\treturn $this;\n\t}", "public function add_sql_token(&$buffer, $field, $value, $seperator = ', ', $use_quotation = true, $operator = '=')\r\n\t{\r\n\t\tif ($value !== false) {\r\n\t\t\tif ($buffer <> '') $buffer .= $seperator;\r\n\t\t\tif ($use_quotation) {\r\n\t\t\t\tif (strtoupper($operator) == 'LIKE'){\r\n\t\t\t\t\t$buffer .= \"$field LIKE '%$value%'\";\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\telse{\r\n\t\t\t\t\t$buffer .= \"$field $operator '$value'\";\t\t\t\t\r\n\t\t\t\t}\t\t\t\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\t$buffer .= \"$field $operator $value\";\r\n\t\t\t}\r\n\t\t}\r\n\t}", "function quote_field($sql, $fieldname, $fieldvalue){\r\n\t\t$rs = $this->select_limit($sql, 1, 1);\r\n $fm_type = $this->field_metatype($rs, $this->field_index($rs, str_replace('`', '', $fieldname)));\r\n\t\tswitch ($fm_type) {\r\n\t\t\tcase 'I':\r\n\t\t\tcase 'N':\r\n\t\t\tcase 'R':\r\n\t\t\tcase 'L':\r\n\t\t\t\t$qstr = $fieldname .\"=\". $fieldvalue; \r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\t$qstr = $fieldname .\"='\". $fieldvalue .\"'\"; \r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t\t\r\n\t\treturn $qstr;\r\n\t}", "function getFields($table,$fields=\"\",$condition=\"\",$limit=\"\",$calculateRows=false,$fastHint=false);", "protected function buildFieldsList()\n {\n if (empty($this->selectFieldsList)) {\n return \"*\";\n }\n\n return join(\", \", $this->selectFieldsList);\n }", "public function expr(Model $m, $expr, $args = []) : Expression\n {\n if (!is_string($expr)) {\n return $this->connection->expr($expr, $args);\n }\n preg_replace_callback(\n '/\\[[a-z0-9_]*\\]|{[a-z0-9_]*}/i',\n function ($matches) use (&$args, $m) {\n $identifier = substr($matches[0], 1, -1);\n if ($identifier && !isset($args[$identifier])) {\n $args[$identifier] = $m->getField($identifier);\n }\n\n return $matches[0];\n },\n $expr\n );\n\n return $this->connection->expr($expr, $args);\n }", "public function sql_select_where( $sql, $where_expression)\n {\n // split sql at the level of main clauses\n $sql_parts = $this->sql_split_at_where_end($sql);\n\n $sql_parts[0] .= substr_count($sql_parts[0], \"WHERE\") ? \" AND \" : \" WHERE \";\n $sql_parts[0] .= $where_expression;\n\n // rebuild full SQL\n $sql = $sql_parts[0] . \" \" . $sql_parts[1];\n\n return $sql;\n }", "public function addSelect($column);", "public function select($expression)\n\t{\n\t\tif (!($expression === NULL || is_string($expression))) {\n\t\t\tthrow new InvalidArgumentException('Select expression has to be a string or NULL.');\n\t\t}\n\t\t$this->dirty();\n\t\t$this->select = $expression === NULL ? NULL : [$expression];\n\t\t$this->args['select'] = array_slice(func_get_args(), 1);\n\t\treturn $this;\n\t}", "public function select(string $fields, $where, $bind = null, $fetchAll = true)\n {\n $fields = is_array($fields) ? $fields : explode(',', $fields);\n $sql = \"SELECT \" . join(',', $fields) . \" FROM \" . $this->table;\n\n if (!empty($where)) {\n if (is_array($where)) {\n $whereConvert = '';\n foreach ($where as $key => $value) {\n $whereConvert .= empty($whereConvert) ? '' : ' AND ';\n $whereConvert .= $key . ' = ' . (is_string($value) ? \"'$value'\" : $value);\n }\n $where = $whereConvert;\n }\n $sql .= \" WHERE \" . $where;\n }\n $sql .= \";\";\n\n return $this->executeQuery($sql, $bind, $fetchAll);\n }", "public function select_where_with_fields($table , $where_clause , $fields)\n\t\t{\n\t\t\t$whereSQL = '';\n\t\t\tif(!empty($where_clause))\n\t\t\t{\n\t\t\t\t// check to see if the 'where' keyword exists\n\t\t\t\tif(substr(strtoupper(trim($where_clause)), 0, 5) != 'WHERE')\n\t\t\t\t{\n\t\t\t\t\t// not found, add keyword\n\t\t\t\t\t$whereSQL = \" WHERE \".$where_clause;\n\t\t\t\t} else\n\t\t\t\t{\n\t\t\t\t\t$whereSQL = \" \".trim($where_clause);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$qry = \"SELECT $fields FROM $table\".$whereSQL; \n\t\t\n\t\t\t\n\t\t\t\n\t\t\t$result = $this->conn->query($qry);\n\t\t\t\n\t\t\t$data = array();\n\t\t\t\n\t\t\tif($result==TRUE)\n\t\t\t {\n\t\t\t\twhile($row = $result->fetch_assoc()) \n\t\t\t\t{\n\t\t\t\t\t$data[] = $row;\n\t\t\t\t}\n\t\t\t\treturn $data;\n\t\t\t }\n\t\t}", "public function testTupleWithExpressionFields(): void\n {\n $field1 = new QueryExpression(['a' => 1]);\n $f = new TupleComparison([$field1, 'field2'], [4, 5], ['integer', 'integer'], '>');\n $binder = new ValueBinder();\n $this->assertSame('(a = :c0, field2) > (:tuple1, :tuple2)', $f->sql($binder));\n $this->assertSame(1, $binder->bindings()[':c0']['value']);\n $this->assertSame(4, $binder->bindings()[':tuple1']['value']);\n $this->assertSame(5, $binder->bindings()[':tuple2']['value']);\n }", "function select_sql($table='', $fields='*', ...$get_args) {\n\t\t$this->select_result = false;\n return $this->selecting($table, $fields, ...$get_args);\t \n }", "public function conditionsToSql(string $fieldName, $value, $func = '', string $tablePrefix = ''): ?string\n {\n $ands = [];\n \n if (!is_array($value)) {\n $value = [$value];\n }\n\n $operator_str = is_array($func) && $func['operator'] == 'not in' ? 'IS NULL' : 'IS NOT NULL';\n \n foreach($value as $val) {\n $ors = [];\n \n if (!is_array($val)) {\n $val = [$val]; \n }\n \n foreach ($val as $v) {\n \t $ors[] = 'JSON_SEARCH(' . $tablePrefix . $fieldName . \", 'all', '\" . escape($v) . \"') \" . $operator_str;\n }\n \t\n \t$ands[] = '(\n \t' . implode(\" OR\\n\", $ors) . '\n )';\n }\n \n return '(\n \t' . implode(\" AND\\n\", $ands) . '\n )';\n }", "function addConditionalsToQuery($query, $filledFormFields) {\n\t// Testing if we have to fill the conditional of our SQL statement\n\tif(count($filledFormFields) > 0) {\n\t\t$query .= \" WHERE \";\n\n\n\t\t// Adding the conditionals to the query\n\t\t$i = 0;\n\t\tforeach($filledFormFields as $fieldKey => $fieldValue) {\n\t\t\t// Appending the new conditional\n\t\t\t$queryAppendage = $fieldKey . \" LIKE :\" . $fieldKey . \" \";\n\n\t\t\t$query .= $queryAppendage;\n\t\t\t\n\t\t\t// If there's more conditionals after this, append an \"AND\" as well.\n\t\t\tif($i < count($filledFormFields) - 1) \n\t\t\t\t$query .= \" AND \";\n\n\t\t\t$i++;\n\t\t}\n\t}\n\n\treturn $query;\n}", "public function testDecorateQuery_SQL_SelectFields() {\n /* Single field */\n $originalQuery = \"SELECT `emp_firstname`, `emp_lastname` FROM `hs_hr_employee` WHERE `emp_number` = '10'\";\n $expectedQuery = \"SELECT `emp_firstname`, `emp_lastname`, `emp_middle_name` FROM `hs_hr_employee` WHERE `emp_number` = '10'\";\n $resultQuery = $this->baseService->decorateQuery('SampleService_ForSelect', 'sampleMethod1', $originalQuery);\n $this->assertEquals($expectedQuery, $resultQuery);\n\n /* Multiple fields */\n $originalQuery = \"SELECT `emp_firstname`, `emp_lastname` FROM `hs_hr_employee` WHERE `emp_number` = '10'\";\n $expectedQuery = \"SELECT `emp_firstname`, `emp_lastname`, `emp_middle_name`, `job_title_code`, `joined_date` FROM `hs_hr_employee` WHERE `emp_number` = '10'\";\n $resultQuery = $this->baseService->decorateQuery('SampleService_ForSelect', 'sampleMethod2', $originalQuery);\n $this->assertEquals($expectedQuery, $resultQuery);\n\n /* Single field with alias */\n $originalQuery = \"SELECT `emp_firstname`, `emp_lastname` FROM `hs_hr_employee` WHERE `emp_number` = '10'\";\n $expectedQuery = \"SELECT `emp_firstname`, `emp_lastname`, `emp_middle_name` AS `middleName` FROM `hs_hr_employee` WHERE `emp_number` = '10'\";\n $resultQuery = $this->baseService->decorateQuery('SampleService_ForSelect', 'sampleMethod3', $originalQuery);\n $this->assertEquals($expectedQuery, $resultQuery);\n\n /* Multiple fields with aliases */\n $originalQuery = \"SELECT `emp_firstname`, `emp_lastname` FROM `hs_hr_employee` WHERE `emp_number` = '10'\";\n $expectedQuery = \"SELECT `emp_firstname`, `emp_lastname`, `emp_middle_name` AS `middleName`, `job_title_code`, `joined_date` AS `active` FROM `hs_hr_employee` WHERE `emp_number` = '10'\";\n $resultQuery = $this->baseService->decorateQuery('SampleService_ForSelect', 'sampleMethod4', $originalQuery);\n $this->assertEquals($expectedQuery, $resultQuery);\n\n /* Single field with table id */\n\n /* Multiple fields with table ids */\n }", "function ToSql ($field, $oper, $val) {\n\tswitch ($field) {\n\t\tcase 'id':\n\t\t\treturn intval($val);\n\t\t\tbreak;\n\t\tcase 'amount':\n\t\tcase 'tax':\n\t\tcase 'total':\n\t\t\treturn floatval($val);\n\t\t\tbreak;\n\t\tdefault :\n\t\t\t//mysql_real_escape_string is better\n\t\t\tif($oper=='bw' || $oper=='bn') return \"'\" . addslashes($val) . \"%'\";\n\t\t\telse if ($oper=='ew' || $oper=='en') return \"'%\" . addcslashes($val) . \"'\";\n\t\t\telse if ($oper=='cn' || $oper=='nc') return \"'%\" . addslashes($val) . \"%'\";\n\t\t\telse return \"'\" . addslashes($val) . \"'\";\n\t}\n}", "public function fieldQuery($fields, $value, $quorum = 0.8, $operator = '/')\n\t{\n\t\tif (is_array($fields))\n\t\t{\n\t\t\t$field_string = '@(' . implode(',', $fields) . ')';\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$field_string = '@' . $fields;\n\t\t}\n\n\t\t$this->query .= $field_string . ' \"' . $this->escapeString($value) . '\"' . ($quorum ? $operator . $quorum : '') . ' ';\n\t}", "public function addSelect(string ...$columns)\n {\n $this->select = array_merge($this->select, $columns);\n\n return $this;\n }", "public function addFields($fields)\r\n {\r\n if (is_string($fields)) {\r\n $fields = explode(',', $fields);\r\n }\r\n\r\n foreach ($fields as $field) {\r\n $this->addField($field);\r\n }\r\n\r\n return $this;\r\n }", "public function addExpression( $expression ) {\n if ( !$expression ) {\n return;\n }\n else if ( is_array( $expression ) ) {\n $this->expression = array_merge( $this->getExpression(), $expression );\n }\n else {\n $this->expression[] = $expression;\n }\n }", "public function select($table, $fields, $where, $order, $start);", "private function buildSelectString () \n {\n $this->selectSql = \"SELECT \";\n $this->selectSql .= $this->columns;\n $this->selectSql .= \" FROM \" . $this->tableName;\n if ($this->where !== null && $this->where !== \"\") {\n $this->selectSql .= \" WHERE \" . $this->where;\n }\n if ($this->order !== null && $this->order !== \"\") {\n $this->selectSql .= \" ORDER BY \" . $this->order;\n }\n if ($this->other !== null && $this->other !== \"\") {\n $this->selectSql .= $this->other;\n }\n }", "public function getExpressions();", "public function select($table_name, $fields = array(), $where = array(), $order_by = '')\r\n {\r\n }", "function _create_add_sql($params) {\n\t\t$tables_shorts\t= array_flip($this->_user_tables);\n\t\t$add_sql = \" \";\n\t\tif (empty($params)) {\n\t\t\treturn \"\";\n\t\t}\n\t\tforeach ((array)$params as $mod => $val) {\n\t\t\t$mod = strtoupper($mod);\n\t\t\tif (!in_array($mod, $this->_allowed_sql_params)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (in_array($mod, array(\"LIMIT\", \"OFFSET\"))) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif ($mod == \"WHERE\") {\n\t\t\t\t$add_sql .= \"AND \";\n\t\t\t} else {\n\t\t\t\t$add_sql .= $mod.\" \";\n\t\t\t}\n\t\t\tif ($this->MODE != \"SIMPLE\") {\n\t\t\t\tif (is_array($val)) {\n\t\t\t\t\t$table_names = $this->_arrange_fields(array_keys($val), $this->_user_tables);\n\t\t\t\t\t$i = count($val);\n\t\t\t\t\tforeach ((array)$val as $fld => $v) {\n\t\t\t\t\t\tforeach ((array)$table_names as $_table_name => $fields) {\n\t\t\t\t\t\t\tif (in_array($fld, $fields)) {\n\t\t\t\t\t\t\t\t$table = $_table_name;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (strpos($v, \" \")) {\n\t\t\t\t\t\t// $v is a statement (\"LIKE value%\")\n\t\t\t\t\t\t\t$add_sql .= \" \".$tables_shorts[$table].\".\".$fld.\" \".$v.\" \"; \n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t// $v is the value\n\t\t\t\t\t\t\t$add_sql .= \" \".$tables_shorts[$table].\".\".$fld.\"='\".$v.\"' \";\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (--$i) {\n\t\t\t\t\t\t\t$add_sql .= \"AND\";\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} elseif (!$val) {\n\t\t\t\t\t$add_sql .= \"\";\n\t\t\t\t} else {\n\t\t\t\t// for constructions like \"ORDER BY field\"\n\t\t\t\t\t$table_names = $this->_arrange_fields($val, $this->_user_tables);\n\t\t\t\t\tforeach ((array)$table_names as $_table_name => $fields) {\n\t\t\t\t\t\tif (in_array($val, $fields)) {\n\t\t\t\t\t\t\t$table = $_table_name;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$add_sql .= \" \".$tables_shorts[$table].\".\".$val.\" \";\n\t\t\t\t}\t\n\t\t\t} else {\n\t\t\t\tif (is_array($val)) {\n\t\t\t\t\t$i = count($val);\n\t\t\t\t\tforeach ((array)$val as $fld => $v) {\n\t\t\t\t\t\tif (strpos($v, \" \")) {\n\t\t\t\t\t\t// $v is a statement (\"LIKE value%\")\n\t\t\t\t\t\t\t$add_sql .= \" \".$fld.\" \".$v.\" \"; \n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t// $v is the value\n\t\t\t\t\t\t\t$add_sql .= \" \".$fld.\"='\".$v.\"' \";\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (--$i) {\n\t\t\t\t\t\t\t$add_sql .= \"AND\";\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} elseif (!$val) {\n\t\t\t\t\t$add_sql .= \"\";\n\t\t\t\t} else {\n\t\t\t\t// for constructions like \"ORDER BY field\"\n\t\t\t\t\t$add_sql .= \" \".$val.\" \";\n\t\t\t\t}\t\n\t\t\t}\n\t\t}\n\t\treturn $add_sql;\n\t}" ]
[ "0.6236182", "0.57708466", "0.57471234", "0.57445025", "0.56484216", "0.56343627", "0.56066155", "0.56058186", "0.55608624", "0.55605835", "0.55376655", "0.5525016", "0.5460511", "0.54307705", "0.5401793", "0.5372282", "0.53721946", "0.53477025", "0.532767", "0.531808", "0.53167796", "0.5253993", "0.5248916", "0.520507", "0.5193414", "0.5191396", "0.51734483", "0.51667416", "0.516325", "0.51601666", "0.5158213", "0.51436055", "0.51063156", "0.51056415", "0.50960344", "0.50940835", "0.5082607", "0.5082235", "0.50793236", "0.50767595", "0.5061416", "0.5053097", "0.5042833", "0.504124", "0.50380075", "0.50315595", "0.5029315", "0.5025037", "0.50189054", "0.50150067", "0.5014", "0.5009033", "0.5007691", "0.50042975", "0.4993111", "0.4992961", "0.49902117", "0.4985521", "0.49748978", "0.49584356", "0.49559185", "0.49546188", "0.49391273", "0.49373704", "0.4930905", "0.4929225", "0.4927488", "0.49198008", "0.49068868", "0.48934817", "0.4890963", "0.48779523", "0.4871363", "0.48652318", "0.4863487", "0.4857437", "0.48495507", "0.48423052", "0.48406836", "0.48323455", "0.48285002", "0.4823347", "0.48221403", "0.48211756", "0.48176765", "0.48169076", "0.48105994", "0.47922608", "0.4786685", "0.47822535", "0.4779076", "0.47731197", "0.47661725", "0.47634307", "0.4750168", "0.47431383", "0.47281268", "0.47262058", "0.47259206", "0.47153032" ]
0.48957393
69
Default Join against another table in the database. This method is a convenience method for innerJoin().
public function join($table, $alias = NULL, $condition = NULL, $arguments = []);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function innerJoin($table);", "public function join($table, $on, $field = null, $comparitor = null);", "public function join($table, $key, ?string $operator = null, $foreign = null, string $type = self::INNER_JOIN);", "public function join($table, $one, $operator = null, $two = null, $type = 'inner', $where = false)\n {\n throw new NotImplementedException('Joins are not implemented in Crate');\n }", "public function fullOuterJoin($table);", "public function joinOn($tableJoin, $columnJoin, $tableOn, $columnOn);", "public function testBuildJoinDefault()\n {\n $query = $this->getQuery()\n ->table('table1')\n ->join(\n $this->getQuery()\n ->table('table2')\n ->joinOn('id', 'id')\n )\n ;\n\n $this->assertSame(\n 'LEFT JOIN table2 ON table1.id = table2.id',\n $query->buildJoin()\n );\n }", "public function innerJoin($table, $alias = NULL, $condition = NULL, $arguments = []);", "public function join(Select $table, $alias, $on)\n {\n return $this->innerJoin($table, $alias, $on);\n }", "public function rightOuterJoin($table);", "public function testBuildJoinDefaultWithTwoJoinOn()\n {\n $query = $this->getQuery()\n ->table('table1')\n ->join(\n $this->getQuery()\n ->table('table2')\n ->joinOn('id', 'id')\n ->joinOn('user_id', 'type_id')\n )\n ;\n\n $this->assertSame(\n 'LEFT JOIN table2 ON table1.id = table2.id AND table1.user_id = table2.type_id',\n $query->buildJoin()\n );\n }", "public function leftOuterJoin($table);", "public function innerJoin($table, $conditions = []);", "public function innerJoin() {\r\n\t\t$args = func_get_args();\r\n\t\t$name = array_shift($args);\r\n\t\t$joined = array_shift($args);\r\n\t\tif (!$name) $name = '___' . $joined;\r\n\t\t//if (count(array_keys(self::$_joinStack, $joined)) > 1) {\r\n\t\tif (get_class($this) == $joined || in_array($joined, self::$_joinStack)) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tself::$_joinStack[] = get_class($this);\r\n\t\tself::$_joinStack[] = $joined;\r\n\t\t$model = null;\r\n\t\tif (is_string($joined)) {\r\n\t\t\tif (is_subclass_of($joined, 'Dbi_Model')) {\r\n\t\t\t\t$model = new $joined();\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tif (is_subclass_of($joined, 'Dbi_Model')) {\r\n\t\t\t\t$model = $joined;\r\n\t\t\t}\r\n\t\t}\r\n\t\tarray_pop(self::$_joinStack);\r\n\t\tarray_pop(self::$_joinStack);\r\n\t\tif (is_null($model)) {\r\n\t\t\tthrow new Exception('Queries can only join models.');\r\n\t\t}\r\n\t\t$this->_innerJoins[] = array(\r\n\t\t\t'name' => $name,\r\n\t\t\t'model' => $model,\r\n\t\t\t'args' => $args\r\n\t\t);\r\n\t}", "public function join($table, $condition = [], $join = '')\n\t{\n\t\tif(count($condition) == 3)\n\t\t\t$this->_query .= strtoupper($join) . // convert $join to upper case (left -> LEFT)\n\t\t\t\t\" JOIN {$table} ON {$condition[0]} {$condition[1]} {$condition[2]}\";\n\n\t\t// that's it now return object from this class\n\t\treturn $this;\n }", "final public static function innerJoin(string $table, string $primaryKey, string $foreignKey)\n {\n //inicia o select\n self::$query .= \" INNER JOIN \" . $table . \" ON $table.$primaryKey = \" . self::tableName() . \".$foreignKey \";\n return (new static);\n }", "function joinQuery()\n {\n }", "public function naturalJoin($table);", "protected function joining_table()\n {\n return $this->connection()->table($this->joining);\n }", "private static function sqlJoining() : string {\n $relations = self::getsRelationsHasOne();\n\n $baseTable = static::tableName();\n $baseProperties = self::getProperties();\n foreach ($baseProperties as &$property) {\n $property = $baseTable . '.' . $property;\n }\n $colsFromBaseTabel = implode(', ', $baseProperties);\n $colsFromJoinedTables = '';\n foreach ($relations as $relation) {\n $modelNamespace = '\\\\' . $relation['model'];\n $modelTableName = $modelNamespace::tableName();\n $modelProperties = $modelNamespace::getProperties();\n foreach ($modelProperties as $key => &$value) {\n $value = $modelTableName . '.' . $value . ' AS ' . $modelTableName . '_' . $value;\n }\n $colsFromJoinedTables .= ', ' . implode(', ', $modelProperties);\n\n }\n $sql = 'SELECT ' . $colsFromBaseTabel . ' ' . $colsFromJoinedTables . ' FROM ' . $baseTable;\n\n foreach ($relations as $relation) {\n $modelNamespace = '\\\\' . $relation['model'];\n $modelTableName = $modelNamespace::tableName();\n $sql .= ' INNER JOIN ' . $modelTableName . ' ON ' . $baseTable . '.' . $relation['column'] . ' = ' . $modelTableName . '.' . $relation['joined-table-column'];\n }\n\n return $sql . ' WHERE ' . $baseTable . '.';\n }", "protected function innerJoin() {\n return \" INNER JOIN ImageDetails ON MainPostImage = ImageID\n INNER JOIN Users ON Posts.UserID = Users.UserID\"; }", "function joinClause( $join ) {\n\t global $wpdb;\n\t $join .= \" INNER JOIN $wpdb->postmeta dm ON (dm.post_id = $wpdb->posts.ID AND dm.meta_key = '$this->orderby') \";\n\t return $join;\n\t}", "public function testBuildJoinDefaultWithAliases()\n {\n $query = $this->getQuery()\n ->table('table1')\n ->alias('table1_alias')\n ->join(\n $this->getQuery()\n ->table('table2')\n ->alias('table2_alias')\n ->joinOn('id', 'id')\n )\n ;\n\n $this->assertSame(\n 'LEFT JOIN table2 AS table2_alias ON table1_alias.id = table2_alias.id',\n $query->buildJoin()\n );\n }", "protected function getJoinTable(): string\n {\n return \"{$this->define(SchemaInterface::TABLE)} AS {$this->getAlias()}\";\n }", "public function constructInnerJoinSql(Table $fromTable, $usingThrough=false, $alias=null)\n\t{\n\t\tif ($usingThrough)\n\t\t{\n\t\t\t$joinTable = $fromTable;\n\t\t\t$joinTableName = $fromTable->getFullyQualifiedTableName();\n\t\t\t$fromTableName = Table::load($this->className)->getFullyQualifiedTableName();\n \t\t}\n\t\telse\n\t\t{\n\t\t\t$joinTable = Table::load($this->className);\n\t\t\t$joinTableName = $joinTable->getFullyQualifiedTableName();\n\t\t\t$fromTableName = $fromTable->getFullyQualifiedTableName();\n\t\t}\n\n\t\t// need to flip the logic when the key is on the other table\n\t\tif ($this instanceof HasMany || $this instanceof HasOne)\n\t\t{\n\t\t\t$this->setKeys($fromTable->class->getName());\n\n\t\t\tif ($usingThrough)\n\t\t\t{\n\t\t\t\t$foreignKey = $this->primaryKey[0];\n\t\t\t\t$joinPrimaryKey = $this->foreignKey[0];\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$joinPrimaryKey = $this->foreignKey[0];\n\t\t\t\t$foreignKey = $this->primaryKey[0];\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$foreignKey = $this->foreignKey[0];\n\t\t\t$joinPrimaryKey = $this->primaryKey[0];\n\t\t}\n\n\t\tif (!is_null($alias))\n\t\t{\n\t\t\t$aliasedJoinTableName = $alias = $this->getTable()->conn->quoteName($alias);\n\t\t\t$alias .= ' ';\n\t\t}\n\t\telse\n\t\t\t$aliasedJoinTableName = $joinTableName;\n\n\t\treturn \"INNER JOIN $joinTableName {$alias}ON($fromTableName.$foreignKey = $aliasedJoinTableName.$joinPrimaryKey)\";\n\t}", "function innerJoin($conditions)\n\t{\n\t\treturn $this->join('INNER', $conditions);\n\t}", "function join($table, &$query) {\r\n $left = $query->get_table_info($this->left_table);\r\n $output = \" $this->type JOIN {\" . $this->table . \"} $table[alias] ON ($this->left_query) = $table[alias].$this->field\";\r\n\r\n // Tack on the extra.\r\n if (isset($this->extra)) {\r\n if (is_array($this->extra)) {\r\n $extras = array();\r\n foreach ($this->extra as $info) {\r\n $extra = '';\r\n // Figure out the table name. Remember, only use aliases provided\r\n // if at all possible.\r\n $join_table = '';\r\n if (!array_key_exists('table', $info)) {\r\n $join_table = $table['alias'] . '.';\r\n }\r\n elseif (isset($info['table'])) {\r\n $join_table = $info['table'] . '.';\r\n }\r\n\r\n // And now deal with the value and the operator. Set $q to\r\n // a single-quote for non-numeric values and the\r\n // empty-string for numeric values, then wrap all values in $q.\r\n $raw_value = $this->db_safe($info['value']);\r\n $q = (empty($info['numeric']) ? \"'\" : '');\r\n\r\n if (is_array($raw_value)) {\r\n $operator = !empty($info['operator']) ? $info['operator'] : 'IN';\r\n // Transform from IN() notation to = notation if just one value.\r\n if (count($raw_value) == 1) {\r\n $value = $q . array_shift($raw_value) . $q;\r\n $operator = $operator == 'NOT IN' ? '!=' : '=';\r\n }\r\n else {\r\n $value = \"($q\" . implode(\"$q, $q\", $raw_value) . \"$q)\";\r\n }\r\n }\r\n else {\r\n $operator = !empty($info['operator']) ? $info['operator'] : '=';\r\n $value = \"$q$raw_value$q\";\r\n }\r\n $extras[] = \"$join_table$info[field] $operator $value\";\r\n }\r\n\r\n if ($extras) {\r\n if (count($extras) == 1) {\r\n $output .= ' AND ' . array_shift($extras);\r\n }\r\n else {\r\n $output .= ' AND (' . implode(' ' . $this->extra_type . ' ', $extras) . ')';\r\n }\r\n }\r\n }\r\n else if ($this->extra && is_string($this->extra)) {\r\n $output .= \" AND ($this->extra)\";\r\n }\r\n }\r\n return $output;\r\n }", "public function join()\n {\n $this->defaultjoinsetted = true;\n if (!empty($this->entity_link_list)) {\n foreach ($this->entity_link_list as $entity_link) {\n $this->defaultjoin .= \" left join `\" . strtolower(get_class($entity_link)) . \"` on \" . strtolower(get_class($entity_link)) . \".id = \" . $this->table . \".\" . strtolower(get_class($entity_link)) . \"_id\";\n }\n }\n return $this;\n }", "public static function doInnerJoin($table2, $params=NULL, $fields=array()) {\n\t\t$conn = parent::_initwgConnector($params, self::PRIMARY_KEY);\n\t\t$what = parent::_getSelectFields($fields);\n\t\t$conn->innerJoin(self::TABLE_NAME, $table2, $what);\n\t\treturn DbModel::doSelect($conn, new ProjectsListingsModel());\n\t}", "function buildJoin()\n\t{\n\t\tif ($this->table_obj_reference)\n\t\t{\n\t\t\t// Use inner join instead of left join to improve performance\n\t\t\treturn \"JOIN \".$this->table_obj_reference.\" ON \".$this->table_tree.\".child=\".$this->table_obj_reference.\".\".$this->ref_pk.\" \".\n\t\t\t\t \"JOIN \".$this->table_obj_data.\" ON \".$this->table_obj_reference.\".\".$this->obj_pk.\"=\".$this->table_obj_data.\".\".$this->obj_pk.\" \";\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Use inner join instead of left join to improve performance\n\t\t\treturn \"JOIN \".$this->table_obj_data.\" ON \".$this->table_tree.\".child=\".$this->table_obj_data.\".\".$this->obj_pk.\" \";\n\t\t}\n\t}", "public function join(\n $table,\n $column1,\n $operator,\n $column2,\n $type\n );", "public function join($sql) {\n $this->__join__ = $sql;\n return $this;\n }", "public function addJoin(Builder $queryBuilder) : void\n {\n $queryBuilder->join(\n $this->_relatedTable . ' AS ' . $this->name,\n $this->_baseTable . '.' . $this->_baseKey,\n '=',\n $this->name . '.' . $this->_foreignKey\n );\n }", "public function join($tbl_name, array $condition, $type = Operator::JOIN_INNTER)\n {\n $output = array();\n $func = function ($value) use (&$output)\n {\n $value = $this->escapeString($value);\n $output[] = \"`{$value}`\";\n };\n $temp = explode('.', $tbl_name);\n $output = array();\n array_walk($temp, $func);\n $tbl_name = implode('.', $output);\n $target_str = $tbl_name;\n $on_str_list = array();\n foreach ($condition as $item) {\n $temp = explode('.', $item);\n $output = array();\n array_walk($temp, $func);\n $on_str_list[] = implode('.', $output);\n }\n $type = ltrim($type, '$');\n $on_str = implode(' = ', $on_str_list);\n $join_str = \"{$type} {$target_str} ON {$on_str}\";\n $this->join_str_list[] = $join_str;\n return $this;\n }", "public function innerJoin($table, $on = null)\n {\n $this->joinTokens[$this->activeJoin = $table] = ['type' => 'INNER', 'on' => []];\n\n return call_user_func_array([$this, 'on'], array_slice(func_get_args(), 1));\n }", "public function addJoin($type, $table, $alias = NULL, $condition = NULL, $arguments = []);", "public function join(Query $other, $fieldOrExpr, $operator, $valueOrExpr, $type = 'INNER') {\r\n\t\t$this->addJoin($other, $fieldOrExpr, $operator, $valueOrExpr, $type, $other->resolveTable());\r\n\t}", "public function crossJoin($table);", "public function getJoin()\n {\n return $this->get(self::_JOIN);\n }", "public function innerJoin($table, array $fields = [], array $on = []) {\n return $this->_addJoin(Join::INNER, $table, $fields, $on);\n }", "public function compile()\n {\n if (null !== $this->type) {\n $sql = strtoupper($this->type).' JOIN';\n } else {\n $sql = 'JOIN';\n }\n\n $sql .= ' '.$this->quoter->quoteTable($this->table);\n\n if (!empty($this->using)) {\n $sql .= ' USING ('.implode(', ', array_map(array($this->quoter, 'quoteColumn'), $this->using)).')';\n } else {\n $conditions = array();\n\n foreach ($this->on as $condition) {\n list($c1, $op, $c2) = $condition;\n\n if ($op) {\n $op = ' '.strtoupper($op);\n }\n\n $conditions[] = $this->quoter->quoteColumn($c1).$op.' '.$this->quoter->quoteColumn($c2);\n }\n\n $sql .= ' ON ('.implode(' AND ', $conditions).')';\n }\n\n return $sql;\n }", "public function getJoinExpression();", "public function join($table, $type = NULL){\n $this->_last_join = new Join($table, $type);\n $this->_last_join->setQuoter($this->quoter);\n $this->_join[] = $this->_last_join;\n return $this;\n }", "protected function performJoin(Builder $query = null)\n {\n $query = $query ?: $this->query;\n\n $ownerKey = $this->getQualifiedOwnerKeyName();\n\n $query->join($this->throughChild->getTable(), $ownerKey , '=', $this->getQualifiedFirstKeyName());\n $query->select([\n '*' => $this->related->qualifyColumn('*'),\n $this->secondKey => $this->throughChild->getQualifiedKeyName().' as '.$this->secondKey\n ]);\n\n if ($this->throughChildSoftDeletes()) {\n $query->whereNull($this->throughChild->getQualifiedDeletedAtColumn());\n }\n }", "public function innerJoin(Select $table, $alias, $on)\n {\n $this->joins[] = array(\"subject\"=>$table, \"ali\"=>$alias, \"on\"=>$on, \"join\"=>\"INNER JOIN\");\n //var_dump($this);\n return $this;\n \n }", "public function innerJoin(string $name, ?string $alias = null, ?string $condition = null): Query\n {\n $this->resetStatement();\n $key = $alias ?? $name;\n $this->tables[$key] = new Table($name, $alias, 'INNER JOIN', $condition);\n return $this;\n }", "function sql_inner_join_statement(string $table_name, string $coloum_name, int $count)\n {\n $sql = \" FROM \" . $table_name . \" AS T1 \";\n for($i = 1; $i < $count; $i++){\n\n $t_index = $i + 1;\n $t_name = \"T$t_index\";\n \n $sql .= \"INNER JOIN $table_name AS $t_name USING ( \" . $coloum_name . \" ) \";\n }\n return $sql;\n }", "private function addJoin(Query $other, $fieldOrExpr, $operator, $valueOrExpr, $type = 'INNER', $table, $withOtherDatas=TRUE) {\r\n\t\tif (isset($this->_salt_joins[$other->_salt_alias])) {\r\n\t\t\tthrow new SaltException(L::error_query_duplicate_join($other->_salt_alias));\r\n\t\t}\r\n\r\n\t\t$this->_salt_joins[$other->_salt_alias]=array(\r\n\t\t\t'type'=>strtoupper($type),\r\n\t\t\t'table'=>$table,\r\n\t\t\t'on'=>array(),\r\n\t\t);\r\n\r\n\t\t$absoluteField = $this->resolveFieldName(ClauseType::JOIN, $fieldOrExpr);\r\n\r\n\t\t$valueOrExpr = $this->resolveFieldName(ClauseType::JOIN, $valueOrExpr, $fieldOrExpr);\r\n\t\tif (is_array($valueOrExpr)) {\r\n\t\t\t$valueOrExpr = '('.implode(', ', $valueOrExpr).')';\r\n\t\t}\r\n\t\t$clause = $absoluteField.' '.$operator.' '.$valueOrExpr;\r\n\r\n\t\t$this->addJoinOnClause($other, 'AND', $clause);\r\n\r\n\t\tif ($withOtherDatas) {\r\n\t\t\t// Merge of others parameters\r\n\t\t\tif (count($other->_salt_fields) > 0) {\r\n\t\t\t\t$this->_salt_fields=array_merge($this->_salt_fields, $other->_salt_fields);\r\n\t\t\t\t$this->linkBindsOf($other, ClauseType::JOIN, ClauseType::SELECT);\r\n\t\t\t}\r\n\t\t\tif (count($other->_salt_wheres) > 0) {\r\n\t\t\t\t//$this->addWhereClause('AND', $other->wheres);\r\n\t\t\t\t$this->addJoinOnClause($other, 'AND', $other->_salt_wheres);\r\n\t\t\t\t$this->linkBindsOf($other, ClauseType::JOIN, ClauseType::WHERE);\r\n\t\t\t}\r\n\t\t\tif (count($other->_salt_groups) > 0) {\r\n\t\t\t\t$this->_salt_groups=array_merge($this->_salt_groups, $other->_salt_groups);\r\n\t\t\t\t$this->linkBindsOf($other, ClauseType::JOIN, ClauseType::GROUP);\r\n\t\t\t}\r\n\t\t\tif (count($other->_salt_orders) > 0) {\r\n\t\t\t\t$this->_salt_orders=array_merge($this->_salt_orders, $other->_salt_orders);\r\n\t\t\t\t$this->linkBindsOf($other, ClauseType::JOIN, ClauseType::ORDER);\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\t// join (Select ...) : link ALL binds, because we include full query text\r\n\t\t\t$this->linkBindsOf($other, ClauseType::JOIN);\r\n\t\t}\r\n\t}", "function addJoin($name, $joinType, $tableA, $tableB, $fieldA, $fieldB) {\n\t\t$this->addBlock('from', $name, array(array($joinType, $tableA, $tableB, $fieldA, $fieldB)));\n\t\treturn $this;\n\t}", "public function addJoin($assocTable, $col1, $col2, $last = true, $type = \"left\") {\n // Joins will always be on selects\n list($this->sql, $this->from) = splitString($this->sql, \"FROM\");\n // Take care of aliased columns\n if (!empty($assocTable->aliases)) {\n $this->sql .= \", \";\n foreach($assocTable->aliases as $c => $a) {\n $this->sql .= $assocTable->name . \".$c as $a,\";\n }\n // Take the comma off the end\n $this->sql = trim($this->sql, \",\");\n }\n $type = strtoupper($type);\n $this->join .= \" $type JOIN \" . $assocTable->name;\n $this->join .= \" ON \" . $this->table->name . \".\" . $col1 . \" = \" . $assocTable->name . \".\" . $col2;\n if ($last) {\n $this->sql .= \" $this->from\";\n $this->sql .= $this->join;\n }\n }", "public function joinUsing($table, $column, $type = 'INNER')\n\t{\n\t\treturn $this->join($table, $this->from . '.' . $column, '=', $table . '.' . $column, $type);\n\t}", "public function joinSelect(Query $other, $fieldOrExpr, $operator, $valueOrExpr, $type = 'INNER') {\r\n\t\t$this->addJoin($other, $fieldOrExpr, $operator, $valueOrExpr, $type, '( '.$other->toSQL().' ) '.$other->_salt_alias, FALSE);\r\n\t}", "public function testJoinWithoutAlias()\n {\n $query = (new Select($this->mockConnection))->join('join', 'join.tableId', '=', 'table.id');\n $array = $query->toArray();\n\n $this->assertInstanceOf(Select::class, $query);\n $this->assertArrayHasKey('join', $array);\n $this->assertCount(1, $array['join']);\n $this->assertEquals([\n 'type' => 'inner',\n 'table' => 'join',\n 'alias' => null,\n 'statement' => [\n 'where' => [\n [\n 'column' => 'join.tableId',\n 'operator' => '=',\n 'value' => 'table.id',\n 'boolean' => 'and',\n ]\n ],\n ]\n ], $array['join'][0]);\n $this->assertInstanceOf(Column::class, $array['join'][0]['statement']['where'][0]['value']);\n }", "protected function set_join($other)\n {\n $this->table->join($this->joining, $this->associated_key(), '=', $this->joining . '.' . $other);\n return $this;\n }", "public static function join($joinTable, $joinCondition, $joinType = '')\r\n {\r\n return self::$PDO->join($joinTable, $joinCondition, $joinType);\r\n }", "public function join($table, $type = NULL)\n {\n if ($type !== '')\n {\n $type = strtoupper(trim($type));\n\n if ( ! in_array($type, array('LEFT', 'RIGHT', 'OUTER', 'INNER', 'LEFT OUTER', 'RIGHT OUTER'), TRUE))\n {\n $type = '';\n }\n else\n {\n $type .= ' ';\n }\n }\n\n // Assemble the JOIN statement\n $table = $this->table_prefix($table);\n $table = $this->quote_identifier($table);\n $this->_join[] = $type.'JOIN '.$table;\n\n return $this;\n }", "public function joinBookings()\n {\n $this->builder->join('bookings', 'book_id', 'bil_booking');\n }", "public function joinBase()\n {\n return $this->_joins[0];\n }", "protected function innerJoinImages(){\n return ' INNER JOIN ImageDetails ON PostImages.ImageID = ImageDetails.ImageID';\n }", "abstract public function join($alias_from, $rel_name, $alias_to);", "public function join($table, $column1, $operator = null, $column2 = null, $type = 'INNER')\n\t{\n\t\t// If the \"column\" is really an instance of a Closure, the developer is\n\t\t// trying to create a join with a complex \"ON\" clause. So, we will add\n\t\t// the join, and then call the Closure with the join/\n\t\tif ($column1 instanceof \\Closure)\n\t\t{\n\t\t\t$this->joins[] = new Query\\Join($type, $table);\n\n\t\t\t$column1(end($this->joins));\n\t\t}\n\n\t\t// If the column is just a string, we can assume that the join just\n\t\t// has a simple on clause, and we'll create the join instance and\n\t\t// add the clause automatically for the develoepr.\n\t\telse\n\t\t{\n\t\t\t$join = new Query\\Join($type, $table);\n\n\t\t\t$join->on($column1, $operator, $column2);\n\n\t\t\t$this->joins[] = $join;\n\t\t}\n\n\t\treturn $this;\n\t}", "public function basic_join_setup()\r\n {\r\n \r\n }", "function cf_search_join( $join ) {\n\t\tglobal $wpdb;\n\n\t\tif ( is_search() ) {\n\t\t\t$join .= ' LEFT JOIN ' . $wpdb->postmeta . ' ON ' . $wpdb->posts . '.ID = ' . $wpdb->postmeta . '.post_id ';\n\t\t}\n\n\t\treturn $join;\n\t}", "public function join($fromAlias, $join, $alias, $condition = null)\n {\n return $this->innerJoin($fromAlias, $join, $alias, $condition);\n }", "public function innerJoin(string $tableName, string $tableAlias = null, string $conditions = null): self {\r\n return $this -> addJoin('inner', $tableName, $tableAlias, $conditions);\r\n }", "function query_main_join( $sql, $engine ) {\n\t\tglobal $wpdb;\n\n\t\tif ( isset( $engine ) ) {\n\t\t\t$engine = null;\n\t\t}\n\n\t\t// if WooCommerce is sorting results we need to tell SearchWP to return them in that order\n\t\tif ( $this->is_woocommerce_search() ) {\n\n\t\t\tif ( ! isset( $this->ordering['wc_orderby'] ) ) {\n\t\t\t\t$this->get_woocommerce_ordering();\n\t\t\t}\n\n\t\t\t// depending on the sorting we need to do different things\n\t\t\tif ( isset( $this->ordering['wc_orderby'] ) ) {\n\t\t\t\tswitch ( $this->ordering['wc_orderby'] ) {\n\t\t\t\t\tcase 'price':\n\t\t\t\t\tcase 'price-desc':\n\t\t\t\t\tcase 'popularity':\n\t\t\t\t\t\t$meta_key = 'price' === $this->ordering['wc_orderby'] ? '_price' : 'total_sales';\n\t\t\t\t\t\t$sql = $sql . $wpdb->prepare( \" LEFT JOIN {$wpdb->postmeta} AS swpwc ON {$wpdb->posts}.ID = swpwc.post_id AND swpwc.meta_key = %s\", $meta_key );\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'rating':\n\t\t\t\t\t\t$sql = $sql . \" LEFT OUTER JOIN {$wpdb->comments} swpwpcom ON({$wpdb->posts}.ID = swpwpcom.comment_post_ID) LEFT JOIN {$wpdb->commentmeta} swpwpcommeta ON(swpwpcom.comment_ID = swpwpcommeta.comment_id) \";\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// for visibility we always need to join postmeta\n\t\t\tif ( function_exists( 'WC' ) && ! empty( WC()->version ) && version_compare( WC()->version, '2.6.0', '<' ) ) { // Moved to a taxonomy\n\t\t\t\t$sql = $sql . \" INNER JOIN {$wpdb->postmeta} as woovisibility ON {$wpdb->posts}.ID = woovisibility.post_id \";\n\t\t\t}\n\n\t\t}\n\n\t\treturn $sql;\n\t}", "public function innerJoin($fromAlias, $join, $alias, $condition = null)\n {\n return $this->add('join', array(\n $fromAlias => array(\n 'joinType' => 'inner',\n 'joinTable' => $join,\n 'joinAlias' => $alias,\n 'joinCondition' => $condition\n )\n ), true);\n }", "public function testJoinWithAlias()\n {\n $query = (new Select($this->mockConnection))->join('join', 'j.tableId', '=', 'table.id', 'j');\n $array = $query->toArray();\n\n $this->assertInstanceOf(Select::class, $query);\n $this->assertArrayHasKey('join', $array);\n $this->assertCount(1, $array['join']);\n $this->assertEquals([\n 'type' => 'inner',\n 'table' => 'join',\n 'alias' => 'j',\n 'statement' => [\n 'where' => [\n [\n 'column' => 'j.tableId',\n 'operator' => '=',\n 'value' => 'table.id',\n 'boolean' => 'and',\n ]\n ],\n ]\n ], $array['join'][0]);\n $this->assertInstanceOf(Column::class, $array['join'][0]['statement']['where'][0]['value']);\n }", "public function innerJoin($fromAlias, $join, $alias, $condition = null)\n\t{\n\t\t$join = $this->getTableName($join, ConnectionManager::MODE_READ);\n\n\t\treturn parent::innerJoin($fromAlias, $join, $alias, $condition);\n\t}", "public function outerJoin($className, $field = null) {\n return $this->joinHelper($className, $field, $this->outerJoin);\n }", "public function innerjoin($classname, $classnameon = \"\")\n {\n $this->join = strtolower(get_class($classname));\n\n if (!$classnameon)\n $classnameon = $this->objectName;\n\n $this->query .= \" inner join `\" . $this->join . \"` on \" . $this->join . \".id = \" . strtolower($classnameon) . \".\" . $this->join . \"_id\";\n// $this->query .= \" inner join `\" . $this->join . \"` \";\n\n return $this;\n }", "private function addJoinOnQuery($type, Query $other, Query $whereQuery) {\r\n\t\t//$this->joins[$other->alias]['on'][]=' '.$type.' ('.implode(' ', $whereQuery->wheres).')';\r\n\t\t$this->addJoinOnClause($other, $type, '('.implode(' ',$whereQuery->_salt_wheres).')');\r\n\t\t$this->linkBindsOf($other, ClauseType::JOIN, ClauseType::WHERE);\r\n\t}", "public function join($tables, $columnName, $joinType = 'JOIN')\r\n\t\t{\r\n\t\t\t\r\n\t\t\t$totalTables = count($tables);\r\n\t\t\t\r\n\t\t\tif(is_array($columnName)){\r\n\t\t\t\t$colsIsArray = true;\r\n\t\t\t\tif(count($columnName) != $totalTables){\r\n\t\t\t\t\techo \"DB Join error. columnName passed as an array but does not match tables count. \";\r\n\t\t\t\t\techo \"columnName is an array of: \" . count($colsIsArray) . \" while tables is an array of: \" . $totalTables;\r\n\t\t\t\t\tdie();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse $colsIsArray = false;\r\n\t\t\t$c = 0;\r\n\r\n//SELECT column_list\r\n//FROM t1\r\n//INNER JOIN t2 ON join_condition1\r\n//INNER JOIN t3 ON join_condition2\r\n\r\n\t\t\t$joinSQL = \"`{$this->_prefix}{$tables[0]}` \";\r\n\r\n\t\t\tfor($n = 0; $n < $totalTables; $n += 1){\r\n\r\n\t\t\t\tif($n+1 < $totalTables){\r\n\t\t\t\t\t$joinSQL .= \"{$joinType} `{$this->_prefix}{$tables[$n+1]}` \";\r\n\t\t\t\t\tif($colsIsArray) $joinSQL .= \"ON `{$this->_prefix}{$tables[$n]}`.`{$columnName[$c]}` = `{$this->_prefix}{$tables[$n+1]}`.`{$columnName[$c+1]}` \";\r\n\t\t\t\t\telse $joinSQL .= \"ON `{$this->_prefix}{$tables[$n]}`.`{$columnName}` = `{$this->_prefix}{$tables[$n+1]}`.`{$columnName}` \";\r\n\t\t\t\t\t$c += 1;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t//lets prepare our query string\r\n\t\t\t$this->_sql = \"SELECT {$this->_select} FROM \" . $joinSQL . $this->_where . $this->_orderBy . $this->_limit;\r\n\r\n\t\t\t//build an additional query string for our count ready for numRows() method\r\n\t\t\t$this->_sqlCount = \"SELECT COUNT(*) FROM \" . $joinSQL . $this->_where;\r\n\r\n\t\t\t//let the server prepare, execute and check for errors\r\n\t\t\t$this->_query = $this->_prepare($this->_sql);\r\n\t\t\t$this->_execute($this->_query);\r\n\t\t\t$this->_errors($this->_query);\r\n\r\n\t\t\treturn $this;\r\n\t\t}", "public function rightJoin($table, $conditions = []);", "final public static function rightJoin(string $table, string $primaryKey, string $foreignKey)\n {\n //inicia o select\n self::$query .= \" RIGHT JOIN \" . $table . \" ON $table.$primaryKey = \" . self::tableName() . \".$foreignKey \";\n return (new static);\n }", "public function paged_join($table = '', $second_table = '', $fields = '*', $join = '', $limit = 0, $offset = 0, $where = FALSE, $order_by = FALSE)\n {\n $this->db->select($fields);\n $this->db->from($table);\n\n if ($second_table && $join) {\n $this->db->join($second_table, $join);\n }\n\n if ($limit > 0) {\n $this->db->limit($limit, $offset);\n }\n\n if ($where) {\n $this->db->where($where);\n }\n\n if ($order_by !== FALSE) {\n $this->db->order_by($order_by);\n }\n\n return $this->get();\n }", "function cf_search_join( $join ) {\n\t global $wpdb;\n\n\t if ( is_search() ) { \n\t $join .=' LEFT JOIN '.$wpdb->postmeta. ' ON '. $wpdb->posts . '.ID = ' . $wpdb->postmeta . '.post_id ';\n\t }\n\t \n\t return $join;\n\t}", "public function rightJoin($table, $key, ?string $operator = null, $foreign = null);", "public function outerJoin($table, array $fields = [], array $on = []) {\n return $this->_addJoin(Join::OUTER, $table, $fields, $on);\n }", "private function joins()\r\n {\r\n /* SELECT* FROM DOCUMENT WHERE DOCUMENT.\"id\" IN ( SELECT ID FROM scholar WHERE user_company_id = 40 )*/\r\n\r\n $query = EyufScholar::find()\r\n ->select('id')\r\n ->where([\r\n 'user_company_id' => 40\r\n ])\r\n ->sql();\r\n\r\n $table = EyufDocument::find()\r\n ->where('\"id\" IN ' . $query)\r\n ->all();\r\n\r\n $second = EyufDocument::findAll(EyufScholar::find()\r\n ->select('id')\r\n ->where([\r\n 'user_company_id' => 40\r\n ])\r\n );\r\n\r\n vdd($second);\r\n }", "private function addJoinOn($type, Query $other, $fieldOrExpr, $operator, $valueOrExpr) {\r\n\t\tif (!array_key_exists($other->_salt_alias, $this->_salt_joins)) {\r\n\t\t\tthrow new SaltException(L::error_query_missing_join($other->_salt_alias));\r\n\t\t}\r\n\r\n\t\t$absoluteField = $this->resolveFieldName(ClauseType::JOIN, $fieldOrExpr);\r\n\r\n\t\t$valueOrExpr = $this->resolveFieldName(ClauseType::JOIN, $valueOrExpr, $fieldOrExpr);\r\n\t\tif (is_array($valueOrExpr)) {\r\n\t\t\t$valueOrExpr = '('.implode(', ', $valueOrExpr).')';\r\n\t\t}\r\n\t\t$clause = $absoluteField.' '.$operator.' '.$valueOrExpr;\r\n\r\n\t\t$this->addJoinOnClause($other, $type, $clause);\r\n// \t\t$this->joins[$other->alias]['on'][]=' '.$type.' '.$clause;\r\n\t}", "public function addJoin($type, $table, $alias, $on_statement, $using_statement = '', $use_index = '', $ignore_index = '')\n\t{\n\t\t// @todo: verify join type\n\t\tif (is_object($table))\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\t$table = $table->getName();\n\t\t\t} catch (Exception $e)\n\t\t\t{\n\t\t\t\tthrow(new UnvalidObjectException(\"Table must be an object of type Table or a string\"));\n\t\t\t}\n\t\t}\n\n\t\t$this->joins[] = array('type' => $type, 'table' => $table, 'on_statement' => $on_statement, 'using_statement' => $using_statement, 'alias' => $alias, 'use_index' => $use_index, 'ignore_index' => $ignore_index);\n\t\treturn $this;\n\t}", "protected function build_join_on( $join, $table ) {\n\n $field_1 = $table . '.' . $join['on']['field'];\n $compare = $join['on']['compare'];\n $field_2 = ( $this->table_short !== '' ) ? $this->table_short : $this->table;\n $field_2 .= '.' . $join['on']['join_field'];\n\n return ' ON ' . $field_1 . ' ' . $compare . ' ' . $field_2;\n }", "public function join($tabela1 = null, $tabela2 = null, $para=null) {\n \n \n }", "function outerJoin($conditions)\n\t{\n\t\treturn $this->join('OUTER', $conditions);\n\t}", "function get_table_join($select_data, $table, $join_table, $join_data, $join_type, $where_data){\n\t\n\t$this->db->select($select_data);\n\t$this->db->from($table);\n\t$this->db->join($join_table, $join_data, $join_type);\n\t$this->db->where($where_data);\n\t$this->db->order_by(\"sub1_id\",\"asc\");\n\t\n\t$query = $this->db->get();\n\t$result = $query->result_array(); \n\treturn $result;\t\n}", "public function join($table, $on, $type){\n\t\t$this->joins[] = array($table, $on, $type);\n\t\treturn $this;\n\t}", "protected function setJoin($query = null)\n {\n $query = $query ? : $this->query;\n $baseTable = $this->related->getTable ();\n $key = $baseTable . '.' . $this->related->getKeyName ();\n $query->join ( $this->table, $key, '=', $this->getOtherKey () );\n return $this;\n }", "public function join(string $name, ?string $alias = null, ?string $condition = null): Query\n {\n $this->resetStatement();\n $key = $alias ?? $name;\n $this->tables[$key] = new Table($name, $alias, 'JOIN', $condition);\n return $this;\n }", "public function joinLeasedOutUser() {\n $sqlSelect = $this->tableGateway->getSql()->select();\n\t\t$sqlSelect\n ->columns(array('Id','requestedTime','returnedTime','userId','returnedTime','assetId'));\n $sqlSelect\n ->join('UserInfoTable', 'UserInfoTable.Id = leasedoutuserTable.userId', array('firstname','email'), 'inner');\n $sqlSelect\n ->join('AssetInfoTable', 'AssetInfoTable.AssetId = leasedoutuserTable.assetId', array('AssetName','AssetStatus','AssetDesc'), 'inner');\n $statement \n = $this->tableGateway->getSql()->prepareStatementForSqlObject($sqlSelect);\n\t\t$resultSet = $statement->execute();\n\t\treturn $resultSet;\n\n }", "public function getRelationTableForJoin($fullName) {\n if (!$this->tableName) {\n $class = $this->model;\n $this->tableName = $class::getTableName();\n }\n return \"`\" . $this->tableName . \"` as `\" . ($this->tableAlias = str_replace('.', '_', $fullName)) . \"`\";\n }", "public function set_join($table_or_alias, $on = null, $type='LEFT')\n { \n $table = $this->getJoinableTable($table_or_alias);\n if(!$this->is_used_table($table))\n {\n $table = (MormConf::isInConf($table_or_alias)) ? $this->add_table($table_or_alias) : $this->add_table($table);\n $this->join_tables[] = $table;\n }\n if(!is_null($on))\n {\n $tables = array_keys($on);\n $this->joins[] = array(array($tables[0] => $tables[1]), $on);\n }\n else\n {\n $key = $this->base_models[$this->base_table]->getForeignKeyFrom($table_or_alias);\n try\n {\n $ft_key = $this->base_models[$this->base_table]->getForeignTableKey($key);\n }\n catch (Exception $e)\n {\n if($this->base_models[$this->base_table]->isForeignUsingTable ($table))\n $ft_key = $this->base_models[$this->base_table]->getForeignMormonsUsingKey($table);\n else\n $ft_key = $this->base_models[$this->base_table]->getForeignMormonsKey($table);\n }\n $this->joins[] = array(array($this->base_table => $table), array($this->base_table => $key, $table => $ft_key));\n }\n //@todo put executed tu false only when join has changed\n $this->_executed = false;\n // switch($type)\n // {\n // case 'LEFT':\n // break;\n // case 'RIGHT':\n // break;\n // default:\n // throw new Exception(\"The join type \".$type.\" does not exist or is not yet supported by Mormons\");\n // break;\n // }\n }", "protected function buildJoinClause() {\r\n\t\t$sql='';\r\n\t\tif (count($this->_salt_joins)>0) {\r\n\t\t\tforeach($this->_salt_joins as $alias => $join) {\r\n\t\t\t\t$sql.=' '.$join['type'].' JOIN '.$join['table'].' ON '.implode(' ', $join['on']);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $sql;\r\n\t}", "private function joinInternal($type, $table, $conditions = '', $params = array())\n\t{\n\t\tif (strpos($table, '(') === false)\n\t\t{\n\t\t\tif (preg_match('/^(.*?)(?i:\\s+as\\s+|\\s+)(.*)$/', $table, $matches))\t// with alias\n\t\t\t\t$table = $this->_connection->quoteTableName($matches[1]) . ' ' . $this->_connection->quoteTableName($matches[2]);\n\t\t\telse\n\t\t\t\t$table = $this->_connection->quoteTableName($table);\n\t\t}\n\n\t\t$conditions = $this->processConditions($conditions);\n\t\tif ($conditions != '')\n\t\t\t$conditions = ' ON ' . $conditions;\n\n\t\tif (isset($this->_query['join']) && is_string($this->_query['join']))\n\t\t\t$this->_query['join'] = array($this->_query['join']);\n\n\t\t$this->_query['join'][] = strtoupper($type) . ' ' . $table . $conditions;\n\n\t\tforeach ($params as $name => $value)\n\t\t\t$this->params[$name] = $value;\n\t\treturn $this;\n\t}", "function joinon_Contact_and_Vehicle_singlerecord($rID, $where = NULL) {\r\n if ($where != NULL) { $this->db->where($where); } \r\n $this->db->join(\r\n 'contact', \r\n 'contact.Id = ' . $this->table_name. '.' . $this->contactId_fieldname, \r\n 'left outer'\r\n ); \r\n $this->db->join(\r\n '__vehicles', \r\n '__vehicles.__Id = ' . $this->table_name. '._VehicleId', \r\n 'left outer'\r\n ); \r\n return $this->get($rID);\r\n }", "private function getJoin() {\n return $this->join;\n }", "public function addJoin($table, $condition, $joinType)\n {\n $this->appendSql($this->filterJoinType($joinType))->\n appendSql(' JOIN ')->\n appendSql($table)->\n appendSql(' ON ')->\n appendSql(\"({$condition})\");\n return $this;\n }", "public function join(string $table, string $condition, string $type=''): QueryBuilderInterface\n\t{\n\t\t// Prefix and quote table name\n\t\t$table = explode(' ', mb_trim($table));\n\t\t$table[0] = $this->driver->quoteTable($table[0]);\n\t\t$table = $this->driver->quoteIdent($table);\n\t\t$table = implode(' ', $table);\n\n\t\t// Parse out the join condition\n\t\t$parsedCondition = $this->parser->compileJoin($condition);\n\t\t$condition = $table . ' ON ' . $parsedCondition;\n\n\t\t$this->state->appendMap(\"\\n\" . strtoupper($type) . ' JOIN ', $condition, 'join');\n\n\t\treturn $this;\n\t}", "public function join($type, $col1, $col2) \n {\n // Make sure we have a valid type\n $type = strtoupper( \" \".$type );\n switch($type)\n {\n case \" INNER\":\n case \" LEFT\":\n case \" RIGHT\":\n case \" FULL\":\n break;\n default:\n $type = \" INNER\";\n break;\n }\n \n // Build our statement\n $this->sql .= $type .\" JOIN `\". $col1 .\"` ON `\". $col2 .\"`\";\n return $this;\n }", "public function getMockJoin ( $table, $on = null )\n {\n return $this->getMock(\n '\\r8\\Query\\Join',\n array('getJoinType'),\n array( $table, $on )\n );\n }" ]
[ "0.7320104", "0.689887", "0.68611526", "0.66816366", "0.6673843", "0.66419625", "0.66364264", "0.6623377", "0.6588677", "0.6577466", "0.65542626", "0.6542131", "0.6534982", "0.6523109", "0.65183616", "0.6515419", "0.649044", "0.6484886", "0.6457852", "0.63942474", "0.6372787", "0.6300184", "0.6293934", "0.6248392", "0.62336683", "0.620172", "0.61983585", "0.6178353", "0.617276", "0.61486775", "0.61394054", "0.61216795", "0.60731137", "0.6052133", "0.6026598", "0.60019433", "0.59746903", "0.591769", "0.5916439", "0.5912123", "0.590914", "0.58990926", "0.5895877", "0.5894681", "0.5888957", "0.58860755", "0.587415", "0.5857786", "0.58472943", "0.5846872", "0.5841068", "0.58388484", "0.583673", "0.58366287", "0.58332807", "0.5831942", "0.5826154", "0.5818682", "0.5813987", "0.58097994", "0.58076555", "0.58016837", "0.5798035", "0.5789228", "0.5789168", "0.5777745", "0.5767973", "0.5760875", "0.57607406", "0.5760237", "0.57460296", "0.5744068", "0.5740735", "0.5736973", "0.572353", "0.5691827", "0.56648934", "0.5641722", "0.5627528", "0.562211", "0.5622018", "0.5615907", "0.56087804", "0.56081295", "0.5606252", "0.5602922", "0.55909926", "0.5589961", "0.55831635", "0.5577614", "0.5573368", "0.5563023", "0.5559158", "0.5556673", "0.55559415", "0.5553444", "0.55442834", "0.5543021", "0.55091745", "0.54926455" ]
0.69065106
1
Inner Join against another table in the database.
public function innerJoin($table, $alias = NULL, $condition = NULL, $arguments = []);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function innerJoin($table);", "public function innerJoin($table, $conditions = []);", "final public static function innerJoin(string $table, string $primaryKey, string $foreignKey)\n {\n //inicia o select\n self::$query .= \" INNER JOIN \" . $table . \" ON $table.$primaryKey = \" . self::tableName() . \".$foreignKey \";\n return (new static);\n }", "public static function doInnerJoin($table2, $params=NULL, $fields=array()) {\n\t\t$conn = parent::_initwgConnector($params, self::PRIMARY_KEY);\n\t\t$what = parent::_getSelectFields($fields);\n\t\t$conn->innerJoin(self::TABLE_NAME, $table2, $what);\n\t\treturn DbModel::doSelect($conn, new ProjectsListingsModel());\n\t}", "public function innerJoin($table, array $fields = [], array $on = []) {\n return $this->_addJoin(Join::INNER, $table, $fields, $on);\n }", "protected function innerJoin() {\n return \" INNER JOIN ImageDetails ON MainPostImage = ImageID\n INNER JOIN Users ON Posts.UserID = Users.UserID\"; }", "public function fullOuterJoin($table);", "public function innerJoin() {\r\n\t\t$args = func_get_args();\r\n\t\t$name = array_shift($args);\r\n\t\t$joined = array_shift($args);\r\n\t\tif (!$name) $name = '___' . $joined;\r\n\t\t//if (count(array_keys(self::$_joinStack, $joined)) > 1) {\r\n\t\tif (get_class($this) == $joined || in_array($joined, self::$_joinStack)) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tself::$_joinStack[] = get_class($this);\r\n\t\tself::$_joinStack[] = $joined;\r\n\t\t$model = null;\r\n\t\tif (is_string($joined)) {\r\n\t\t\tif (is_subclass_of($joined, 'Dbi_Model')) {\r\n\t\t\t\t$model = new $joined();\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tif (is_subclass_of($joined, 'Dbi_Model')) {\r\n\t\t\t\t$model = $joined;\r\n\t\t\t}\r\n\t\t}\r\n\t\tarray_pop(self::$_joinStack);\r\n\t\tarray_pop(self::$_joinStack);\r\n\t\tif (is_null($model)) {\r\n\t\t\tthrow new Exception('Queries can only join models.');\r\n\t\t}\r\n\t\t$this->_innerJoins[] = array(\r\n\t\t\t'name' => $name,\r\n\t\t\t'model' => $model,\r\n\t\t\t'args' => $args\r\n\t\t);\r\n\t}", "public function innerJoin(Select $table, $alias, $on)\n {\n $this->joins[] = array(\"subject\"=>$table, \"ali\"=>$alias, \"on\"=>$on, \"join\"=>\"INNER JOIN\");\n //var_dump($this);\n return $this;\n \n }", "public function innerJoin($table, $on = null)\n {\n $this->joinTokens[$this->activeJoin = $table] = ['type' => 'INNER', 'on' => []];\n\n return call_user_func_array([$this, 'on'], array_slice(func_get_args(), 1));\n }", "public function rightOuterJoin($table);", "function innerJoin($conditions)\n\t{\n\t\treturn $this->join('INNER', $conditions);\n\t}", "public function constructInnerJoinSql(Table $fromTable, $usingThrough=false, $alias=null)\n\t{\n\t\tif ($usingThrough)\n\t\t{\n\t\t\t$joinTable = $fromTable;\n\t\t\t$joinTableName = $fromTable->getFullyQualifiedTableName();\n\t\t\t$fromTableName = Table::load($this->className)->getFullyQualifiedTableName();\n \t\t}\n\t\telse\n\t\t{\n\t\t\t$joinTable = Table::load($this->className);\n\t\t\t$joinTableName = $joinTable->getFullyQualifiedTableName();\n\t\t\t$fromTableName = $fromTable->getFullyQualifiedTableName();\n\t\t}\n\n\t\t// need to flip the logic when the key is on the other table\n\t\tif ($this instanceof HasMany || $this instanceof HasOne)\n\t\t{\n\t\t\t$this->setKeys($fromTable->class->getName());\n\n\t\t\tif ($usingThrough)\n\t\t\t{\n\t\t\t\t$foreignKey = $this->primaryKey[0];\n\t\t\t\t$joinPrimaryKey = $this->foreignKey[0];\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$joinPrimaryKey = $this->foreignKey[0];\n\t\t\t\t$foreignKey = $this->primaryKey[0];\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$foreignKey = $this->foreignKey[0];\n\t\t\t$joinPrimaryKey = $this->primaryKey[0];\n\t\t}\n\n\t\tif (!is_null($alias))\n\t\t{\n\t\t\t$aliasedJoinTableName = $alias = $this->getTable()->conn->quoteName($alias);\n\t\t\t$alias .= ' ';\n\t\t}\n\t\telse\n\t\t\t$aliasedJoinTableName = $joinTableName;\n\n\t\treturn \"INNER JOIN $joinTableName {$alias}ON($fromTableName.$foreignKey = $aliasedJoinTableName.$joinPrimaryKey)\";\n\t}", "protected function innerJoinImages(){\n return ' INNER JOIN ImageDetails ON PostImages.ImageID = ImageDetails.ImageID';\n }", "function sql_inner_join_statement(string $table_name, string $coloum_name, int $count)\n {\n $sql = \" FROM \" . $table_name . \" AS T1 \";\n for($i = 1; $i < $count; $i++){\n\n $t_index = $i + 1;\n $t_name = \"T$t_index\";\n \n $sql .= \"INNER JOIN $table_name AS $t_name USING ( \" . $coloum_name . \" ) \";\n }\n return $sql;\n }", "private function joins()\r\n {\r\n /* SELECT* FROM DOCUMENT WHERE DOCUMENT.\"id\" IN ( SELECT ID FROM scholar WHERE user_company_id = 40 )*/\r\n\r\n $query = EyufScholar::find()\r\n ->select('id')\r\n ->where([\r\n 'user_company_id' => 40\r\n ])\r\n ->sql();\r\n\r\n $table = EyufDocument::find()\r\n ->where('\"id\" IN ' . $query)\r\n ->all();\r\n\r\n $second = EyufDocument::findAll(EyufScholar::find()\r\n ->select('id')\r\n ->where([\r\n 'user_company_id' => 40\r\n ])\r\n );\r\n\r\n vdd($second);\r\n }", "function joinQuery()\n {\n }", "public function naturalJoin($table);", "public function join($table, $key, ?string $operator = null, $foreign = null, string $type = self::INNER_JOIN);", "public function join($table, $on, $field = null, $comparitor = null);", "public function joinLeasedOutUser() {\n $sqlSelect = $this->tableGateway->getSql()->select();\n\t\t$sqlSelect\n ->columns(array('Id','requestedTime','returnedTime','userId','returnedTime','assetId'));\n $sqlSelect\n ->join('UserInfoTable', 'UserInfoTable.Id = leasedoutuserTable.userId', array('firstname','email'), 'inner');\n $sqlSelect\n ->join('AssetInfoTable', 'AssetInfoTable.AssetId = leasedoutuserTable.assetId', array('AssetName','AssetStatus','AssetDesc'), 'inner');\n $statement \n = $this->tableGateway->getSql()->prepareStatementForSqlObject($sqlSelect);\n\t\t$resultSet = $statement->execute();\n\t\treturn $resultSet;\n\n }", "public function crossJoin($table);", "protected function joining_table()\n {\n return $this->connection()->table($this->joining);\n }", "public function leftOuterJoin($table);", "private static function sqlJoining() : string {\n $relations = self::getsRelationsHasOne();\n\n $baseTable = static::tableName();\n $baseProperties = self::getProperties();\n foreach ($baseProperties as &$property) {\n $property = $baseTable . '.' . $property;\n }\n $colsFromBaseTabel = implode(', ', $baseProperties);\n $colsFromJoinedTables = '';\n foreach ($relations as $relation) {\n $modelNamespace = '\\\\' . $relation['model'];\n $modelTableName = $modelNamespace::tableName();\n $modelProperties = $modelNamespace::getProperties();\n foreach ($modelProperties as $key => &$value) {\n $value = $modelTableName . '.' . $value . ' AS ' . $modelTableName . '_' . $value;\n }\n $colsFromJoinedTables .= ', ' . implode(', ', $modelProperties);\n\n }\n $sql = 'SELECT ' . $colsFromBaseTabel . ' ' . $colsFromJoinedTables . ' FROM ' . $baseTable;\n\n foreach ($relations as $relation) {\n $modelNamespace = '\\\\' . $relation['model'];\n $modelTableName = $modelNamespace::tableName();\n $sql .= ' INNER JOIN ' . $modelTableName . ' ON ' . $baseTable . '.' . $relation['column'] . ' = ' . $modelTableName . '.' . $relation['joined-table-column'];\n }\n\n return $sql . ' WHERE ' . $baseTable . '.';\n }", "public function joinOn($tableJoin, $columnJoin, $tableOn, $columnOn);", "public function join(Select $table, $alias, $on)\n {\n return $this->innerJoin($table, $alias, $on);\n }", "public function join($table, $one, $operator = null, $two = null, $type = 'inner', $where = false)\n {\n throw new NotImplementedException('Joins are not implemented in Crate');\n }", "public function join($table, $alias = NULL, $condition = NULL, $arguments = []);", "public function addInnerJoinOn($table, $where)\n {\n //argument test\n Argument::i()\n //Argument 1 must be a string\n ->test(1, 'string')\n //Argument 2 must be a string\n ->test(2, 'string');\n \n $where = func_get_args();\n $table = array_shift($where);\n \n $this->join[] = array(self::INNER, $table, $where, false);\n \n return $this;\n }", "public function innerJoin(string $tableName, string $tableAlias = null, string $conditions = null): self {\r\n return $this -> addJoin('inner', $tableName, $tableAlias, $conditions);\r\n }", "public function innerJoinOn($table, $where)\n {\n //argument test\n Argument::i()\n //Argument 1 must be a string\n ->test(1, 'string')\n //Argument 2 must be a string\n ->test(2, 'string');\n \n $where = func_get_args();\n $table = array_shift($where);\n \n $this->join[] = array(self::INNER, $table, $where, false);\n \n return $this;\n }", "public function innerJoinUsing($table, $where)\n {\n //argument test\n Argument::i()\n //Argument 1 must be a string\n ->test(1, 'string')\n //Argument 2 must be a string\n ->test(2, 'string');\n \n $where = func_get_args();\n $table = array_shift($where);\n \n $this->join[] = array(self::INNER, $table, $where, true);\n \n return $this;\n }", "public function innerjoin($classname, $classnameon = \"\")\n {\n $this->join = strtolower(get_class($classname));\n\n if (!$classnameon)\n $classnameon = $this->objectName;\n\n $this->query .= \" inner join `\" . $this->join . \"` on \" . $this->join . \".id = \" . strtolower($classnameon) . \".\" . $this->join . \"_id\";\n// $this->query .= \" inner join `\" . $this->join . \"` \";\n\n return $this;\n }", "public function addInnerJoinUsing($table, $where)\n {\n //argument test\n Argument::i()\n //Argument 1 must be a string\n ->test(1, 'string')\n //Argument 2 must be a string\n ->test(2, 'string');\n \n $where = func_get_args();\n $table = array_shift($where);\n \n $this->join[] = array(self::INNER, $table, $where, true);\n \n return $this;\n }", "function join($table, &$query) {\r\n $left = $query->get_table_info($this->left_table);\r\n $output = \" $this->type JOIN {\" . $this->table . \"} $table[alias] ON ($this->left_query) = $table[alias].$this->field\";\r\n\r\n // Tack on the extra.\r\n if (isset($this->extra)) {\r\n if (is_array($this->extra)) {\r\n $extras = array();\r\n foreach ($this->extra as $info) {\r\n $extra = '';\r\n // Figure out the table name. Remember, only use aliases provided\r\n // if at all possible.\r\n $join_table = '';\r\n if (!array_key_exists('table', $info)) {\r\n $join_table = $table['alias'] . '.';\r\n }\r\n elseif (isset($info['table'])) {\r\n $join_table = $info['table'] . '.';\r\n }\r\n\r\n // And now deal with the value and the operator. Set $q to\r\n // a single-quote for non-numeric values and the\r\n // empty-string for numeric values, then wrap all values in $q.\r\n $raw_value = $this->db_safe($info['value']);\r\n $q = (empty($info['numeric']) ? \"'\" : '');\r\n\r\n if (is_array($raw_value)) {\r\n $operator = !empty($info['operator']) ? $info['operator'] : 'IN';\r\n // Transform from IN() notation to = notation if just one value.\r\n if (count($raw_value) == 1) {\r\n $value = $q . array_shift($raw_value) . $q;\r\n $operator = $operator == 'NOT IN' ? '!=' : '=';\r\n }\r\n else {\r\n $value = \"($q\" . implode(\"$q, $q\", $raw_value) . \"$q)\";\r\n }\r\n }\r\n else {\r\n $operator = !empty($info['operator']) ? $info['operator'] : '=';\r\n $value = \"$q$raw_value$q\";\r\n }\r\n $extras[] = \"$join_table$info[field] $operator $value\";\r\n }\r\n\r\n if ($extras) {\r\n if (count($extras) == 1) {\r\n $output .= ' AND ' . array_shift($extras);\r\n }\r\n else {\r\n $output .= ' AND (' . implode(' ' . $this->extra_type . ' ', $extras) . ')';\r\n }\r\n }\r\n }\r\n else if ($this->extra && is_string($this->extra)) {\r\n $output .= \" AND ($this->extra)\";\r\n }\r\n }\r\n return $output;\r\n }", "private function addJoin(Query $other, $fieldOrExpr, $operator, $valueOrExpr, $type = 'INNER', $table, $withOtherDatas=TRUE) {\r\n\t\tif (isset($this->_salt_joins[$other->_salt_alias])) {\r\n\t\t\tthrow new SaltException(L::error_query_duplicate_join($other->_salt_alias));\r\n\t\t}\r\n\r\n\t\t$this->_salt_joins[$other->_salt_alias]=array(\r\n\t\t\t'type'=>strtoupper($type),\r\n\t\t\t'table'=>$table,\r\n\t\t\t'on'=>array(),\r\n\t\t);\r\n\r\n\t\t$absoluteField = $this->resolveFieldName(ClauseType::JOIN, $fieldOrExpr);\r\n\r\n\t\t$valueOrExpr = $this->resolveFieldName(ClauseType::JOIN, $valueOrExpr, $fieldOrExpr);\r\n\t\tif (is_array($valueOrExpr)) {\r\n\t\t\t$valueOrExpr = '('.implode(', ', $valueOrExpr).')';\r\n\t\t}\r\n\t\t$clause = $absoluteField.' '.$operator.' '.$valueOrExpr;\r\n\r\n\t\t$this->addJoinOnClause($other, 'AND', $clause);\r\n\r\n\t\tif ($withOtherDatas) {\r\n\t\t\t// Merge of others parameters\r\n\t\t\tif (count($other->_salt_fields) > 0) {\r\n\t\t\t\t$this->_salt_fields=array_merge($this->_salt_fields, $other->_salt_fields);\r\n\t\t\t\t$this->linkBindsOf($other, ClauseType::JOIN, ClauseType::SELECT);\r\n\t\t\t}\r\n\t\t\tif (count($other->_salt_wheres) > 0) {\r\n\t\t\t\t//$this->addWhereClause('AND', $other->wheres);\r\n\t\t\t\t$this->addJoinOnClause($other, 'AND', $other->_salt_wheres);\r\n\t\t\t\t$this->linkBindsOf($other, ClauseType::JOIN, ClauseType::WHERE);\r\n\t\t\t}\r\n\t\t\tif (count($other->_salt_groups) > 0) {\r\n\t\t\t\t$this->_salt_groups=array_merge($this->_salt_groups, $other->_salt_groups);\r\n\t\t\t\t$this->linkBindsOf($other, ClauseType::JOIN, ClauseType::GROUP);\r\n\t\t\t}\r\n\t\t\tif (count($other->_salt_orders) > 0) {\r\n\t\t\t\t$this->_salt_orders=array_merge($this->_salt_orders, $other->_salt_orders);\r\n\t\t\t\t$this->linkBindsOf($other, ClauseType::JOIN, ClauseType::ORDER);\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\t// join (Select ...) : link ALL binds, because we include full query text\r\n\t\t\t$this->linkBindsOf($other, ClauseType::JOIN);\r\n\t\t}\r\n\t}", "public function testJoinWithAlias()\n {\n $query = (new Select($this->mockConnection))->join('join', 'j.tableId', '=', 'table.id', 'j');\n $array = $query->toArray();\n\n $this->assertInstanceOf(Select::class, $query);\n $this->assertArrayHasKey('join', $array);\n $this->assertCount(1, $array['join']);\n $this->assertEquals([\n 'type' => 'inner',\n 'table' => 'join',\n 'alias' => 'j',\n 'statement' => [\n 'where' => [\n [\n 'column' => 'j.tableId',\n 'operator' => '=',\n 'value' => 'table.id',\n 'boolean' => 'and',\n ]\n ],\n ]\n ], $array['join'][0]);\n $this->assertInstanceOf(Column::class, $array['join'][0]['statement']['where'][0]['value']);\n }", "public function joinBookings()\n {\n $this->builder->join('bookings', 'book_id', 'bil_booking');\n }", "public function join(\n $table,\n $column1,\n $operator,\n $column2,\n $type\n );", "public function innerJoin($fromAlias, $join, $alias, $condition = null)\n {\n return $this->add('join', array(\n $fromAlias => array(\n 'joinType' => 'inner',\n 'joinTable' => $join,\n 'joinAlias' => $alias,\n 'joinCondition' => $condition\n )\n ), true);\n }", "public function inner($table, $on, $field = null, $comparitor = null);", "public function cpJoin() {\n $sql=\"select packages.packageName, prices.id, prices.price, products.productName, products.cid, prices.productID, prices.areaID, prices.packageID \"\n . \"from prices\"\n . \" inner join packages on packages.packageID=prices.packageID\"\n . \" inner join products on prices.productID=products.productID where products.cid='9'\";\n $sth=$this->dbh->prepare($sql);\n \n $sth->execute();\n $result = $sth->fetchAll(PDO::FETCH_ASSOC);\n return $result;\n}", "public function testImplicitJoinInWhereOnSingleValuedAssociationPathExpression(): void\n {\n // SQL: SELECT ... FROM forum_user fu INNER JOIN forum_avatar fa ON fu.avatar_id = fa.id WHERE fa.id = ?\n $this->assertValidDQL('SELECT u FROM Doctrine\\Tests\\Models\\Forum\\ForumUser u JOIN u.avatar a WHERE a.id = ?1');\n }", "public function innerJoin($fromAlias, $join, $alias, $condition = null)\n\t{\n\t\t$join = $this->getTableName($join, ConnectionManager::MODE_READ);\n\n\t\treturn parent::innerJoin($fromAlias, $join, $alias, $condition);\n\t}", "protected function getJoinTable(): string\n {\n return \"{$this->define(SchemaInterface::TABLE)} AS {$this->getAlias()}\";\n }", "public function inner($table, array $optionalTables = array())\n\t{\n\t\t$preparedTablesArray = $this->_getPreparedTableObjects($table, $optionalTables);\n\t\t$this->join->inner($preparedTablesArray['table'], $preparedTablesArray['optionalTables']);\n\n\t\treturn $this;\n\t}", "function sql_inner_join_select_statement(int $count, array $keys)\n {\n $sql = \"\";\n for($i = 0; $i < $count; $i++ ) {\n\n $t_index = $i + 1;\n $t_name = \"T$t_index\";\n\n $sql .= $t_name . \".value AS \" . $keys[$i];\n $sql .= ($i != $count - 1) ? \", \" : \"\";\n }\n return $sql;\n }", "public function testJoinWithoutAlias()\n {\n $query = (new Select($this->mockConnection))->join('join', 'join.tableId', '=', 'table.id');\n $array = $query->toArray();\n\n $this->assertInstanceOf(Select::class, $query);\n $this->assertArrayHasKey('join', $array);\n $this->assertCount(1, $array['join']);\n $this->assertEquals([\n 'type' => 'inner',\n 'table' => 'join',\n 'alias' => null,\n 'statement' => [\n 'where' => [\n [\n 'column' => 'join.tableId',\n 'operator' => '=',\n 'value' => 'table.id',\n 'boolean' => 'and',\n ]\n ],\n ]\n ], $array['join'][0]);\n $this->assertInstanceOf(Column::class, $array['join'][0]['statement']['where'][0]['value']);\n }", "function yy_r71(){ $this->_retvalue = new Stmt\\Join('INNER', $this->yystack[$this->yyidx + 0]->minor); }", "public function testImplicitJoinWithCartesianProductAndConditionInWhere(): void\n {\n $this->assertValidDQL('SELECT u, a FROM Doctrine\\Tests\\Models\\CMS\\CmsUser u, Doctrine\\Tests\\Models\\CMS\\CmsArticle a WHERE u.name = a.topic');\n }", "public function joinUsing($table, $column, $type = 'INNER')\n\t{\n\t\treturn $this->join($table, $this->from . '.' . $column, '=', $table . '.' . $column, $type);\n\t}", "function yy_r68(){ $this->_retvalue = new Stmt\\Join('INNER', $this->yystack[$this->yyidx + -1]->minor); }", "public function innerJoin(string $name, ?string $alias = null, ?string $condition = null): Query\n {\n $this->resetStatement();\n $key = $alias ?? $name;\n $this->tables[$key] = new Table($name, $alias, 'INNER JOIN', $condition);\n return $this;\n }", "private function hasMany($table, $foreignTableName) {\n $foreignTableName = strtolower($foreignTableName);\n assert('!empty($table->primaryKey); // table needs to have primary key defined for table join');\n\n // can we load the foreign table?\n if (class_exists(ucfirst($foreignTableName))) {\n // capitalize\n $foreignTableName = ucfirst($foreignTableName);\n // note the foreign table might have relationships of its own...\n $foreignTable = new $foreignTableName();\n assert('!empty($foreignTable->primaryKey); // foreign table needs to have primary key defined');\n\n // create the join where \"ourTable.ourId=foreignTable.ourTable_ourId\"\n $table->join($foreignTable->tableName, array(\n \"{$table->tableName}.{$table->primaryKey}\"\n => \"{$foreignTable->tableName}.{$table->tableName}_{$table->primaryKey}\"\n ));\n // as an added bonus, we might have a relationship in the foreign table, add it...\n $table->join .= $foreignTable->join;\n } else {\n // we will have to rely on our primary key\n // create the join where \"ourTable.ourId=foreignTable.ourTable_ourId\"\n $table->join($foreignTableName->tableName, array(\n \"{$table->tableName}.{$table->primaryKey}\"\n => \"{$foreignTableName->tableName}.{$table->tableName}_{$table->primaryKey}\"\n ));\n }\n }", "private static function selectAndJoins()\n {\n $sql = \"SELECT * FROM \" . dbPerformance::DBNAME;\n\n $sql .= \" INNER JOIN \" . dbCompetition::DBNAME . \" ON \" . dbPerformance::DBNAME . \".\" . dbPerformance::COMPETITOINID . \" = \" . dbCompetition::DBNAME . \".\" . dbCompetition::ID;\n $sql .= \" INNER JOIN \" . dbDisziplin::DBNAME . \" ON \" . dbPerformance::DBNAME . \".\" . dbPerformance::DISZIPLINID . \" = \" . dbDisziplin::DBNAME . \".\" . dbDisziplin::ID;\n $sql .= \" INNER JOIN \" . dbAthletes::DBNAME . \" ON \" . dbPerformance::DBNAME . \".\" . dbPerformance::ATHLETEID . \" = \" . dbAthletes::DBNAME . \".\" . dbAthletes::ID;\n $sql .= \" LEFT JOIN \" . dbPerformanceDetail::DBNAME . \" ON \" . dbPerformance::DBNAME . \".\" . dbPerformance::ID . \" = \" . dbPerformanceDetail::DBNAME . \".\" . dbPerformanceDetail::PERFORMANCEID;\n\n $sql .= \" INNER JOIN \" . dbCompetitionLocations::DBNAME . \" ON \" . dbCompetition::DBNAME . \".\" . dbCompetition::LOCATIONID . \" = \" . dbCompetitionLocations::DBNAME . \".\" . dbCompetitionLocations::ID;\n $sql .= \" INNER JOIN \" . dbCompetitionNames::DBNAME . \" ON \" . dbCompetition::DBNAME . \".\" . dbCompetition::NAMEID . \" = \" . dbCompetitionNames::DBNAME . \".\" . dbCompetitionNames::ID;\n return $sql;\n }", "public function getJoin()\n {\n return $this->get(self::_JOIN);\n }", "public function crossJoin($table)\n\t{\n\t\treturn $this->joinInternal('CROSS JOIN', $table);\n\t}", "public function outerJoin($table, array $fields = [], array $on = []) {\n return $this->_addJoin(Join::OUTER, $table, $fields, $on);\n }", "function joinClause( $join ) {\n\t global $wpdb;\n\t $join .= \" INNER JOIN $wpdb->postmeta dm ON (dm.post_id = $wpdb->posts.ID AND dm.meta_key = '$this->orderby') \";\n\t return $join;\n\t}", "private function hasOne($table, $foreignTableName) {\n $foreignTableName = strtolower($foreignTableName);\n assert('!empty($table->primaryKey); // table needs to have primary key defined for table join');\n\n // can we load the foreign table?\n if (class_exists(ucfirst($foreignTableName))) {\n // capitalize\n $foreignTableName = ucfirst($foreignTableName);\n // note the foreign table might have relationships of its own...\n $foreignTable = new $foreignTableName();\n assert('!empty($foreignTable->primaryKey); // foreign table needs to have primary key defined');\n\n // create the join on custom primary key and (optionally) custom table name\n $table->join($foreignTable->tableName, array(\n \"{$table->tableName}.{$foreignTable->tableName}_{$table->primaryKey}\"\n => \"{$foreignTable->tableName}.{$foreignTable->primaryKey}\"\n ));\n // as an added bonus, we might have a relationship in the foreign table, add it...\n $table->join .= $foreignTable->join;\n } else {\n // we will have to rely on our primary key\n // create the join where \"foreignTable_id = id\"\n $table->join($foreignTableName, array(\n \"{$table->tableName}.{$foreignTableName}_{$table->primaryKey}\"\n => \"{$foreignTableName}.{$table->primaryKey}\"\n ));\n }\n }", "function query() {\n dpm($this);\n $this->ensure_my_table();\n\n // First, relate our current table to the link table via the field\n $first = array(\n 'left_table' => $this->table_alias,\n 'left_field' => $this->field, // @TODO real_field?\n 'table' => $this->definition['link table'],\n 'field' => $this->definition['link field'],\n );\n\n if (!empty($this->options['required'])) {\n $first['type'] = 'INNER';\n }\n\n if (!empty($this->definition['link_join_extra'])) {\n $first['extra'] = $this->definition['link_join_extra'];\n }\n\n if (!empty($this->definition['join_handler']) && class_exists($this->definition['join_handler'])) {\n $first_join = new $this->definition['join_handler'];\n }\n else {\n $first_join = new views_join();\n }\n $first_join->definition = $first;\n $first_join->construct();\n $first_join->adjusted = TRUE;\n\n $this->first_alias = $this->query->add_table($this->definition['link table'], $this->relationship, $first_join);\n\n // Second, relate the link table to the entity specified using\n // the specified base fields on the base and link tables.\n $second = array(\n 'left_table' => $this->first_alias,\n 'left_field' => $this->definition['base link field'],\n 'table' => $this->definition['base'],\n 'field' => $this->definition['base field'],\n );\n\n if (!empty($this->options['required'])) {\n $second['type'] = 'INNER';\n }\n\n if (!empty($this->definition['base_join_extra'])) {\n $second['extra'] = $this->definition['base_join_extra'];\n }\n\n if (!empty($this->definition['join_handler']) && class_exists($this->definition['join_handler'])) {\n $second_join = new $this->definition['join_handler'];\n }\n else {\n $second_join = new views_join();\n }\n $second_join->definition = $second;\n $second_join->construct();\n $second_join->adjusted = TRUE;\n\n // use a short alias for this:\n // @TODO real_field?\n $alias = $this->field . '_' . $this->definition['base'];\n\n $this->alias = $this->query->add_relationship($alias, $second_join, $this->definition['base'], $this->relationship);\n }", "public function join($id);", "public function joinSelect(Query $other, $fieldOrExpr, $operator, $valueOrExpr, $type = 'INNER') {\r\n\t\t$this->addJoin($other, $fieldOrExpr, $operator, $valueOrExpr, $type, '( '.$other->toSQL().' ) '.$other->_salt_alias, FALSE);\r\n\t}", "public function getJoinExpression();", "function getJoinFK($col,$tab1,$tab2,$key1,$key2){\n $array=array();\n $conn=connectDB();\n $query=\"SELECT $tab2.$col FROM $tab1 JOIN $tab2 ON $tab1.$key1 = $tab2.$key2\";\n foreach ($conn->query($query)as $row){\n array_push($array,$row[$col]);\n }\n return $array;\n }", "public function join(Query $other, $fieldOrExpr, $operator, $valueOrExpr, $type = 'INNER') {\r\n\t\t$this->addJoin($other, $fieldOrExpr, $operator, $valueOrExpr, $type, $other->resolveTable());\r\n\t}", "public function addJoin(Builder $queryBuilder) : void\n {\n $queryBuilder->join(\n $this->_relatedTable . ' AS ' . $this->name,\n $this->_baseTable . '.' . $this->_baseKey,\n '=',\n $this->name . '.' . $this->_foreignKey\n );\n }", "function operasiJoin2(){\n\t\t$date = date('Y-m-d');\n\t\t$query = $this->db->query(\"SELECT o.id_operasi, o.operasi, o.id_alat, a.id_kategori, o.tanggal, o.keterangan, a.nama_alat FROM operasi o INNER JOIN alat a ON o.id_alat = a.id_alat\"); \n\t\treturn $query->result();\n\t}", "public function getTableAlias() ;", "function sql_inner_join_where_clause(int $count, array $keys)\n {\n $sql = \" WHERE \";\n for($i = 0; $i < $count; $i++ ) {\n\n $t_index = $i + 1;\n $t_name = \"T$t_index\";\n\n $sql .= \"$t_name.field = '\" . $keys[$i];\n $sql .= ($i != $count - 1) ? \"' AND \" : \"'\";\n }\n $sql .= \") TmpTable\";\n return $sql;\n }", "public function testJoinStmt()\n {\n $join = $this->joinTemplate()();\n return $this->assertEquals($join, \"SELECT blog.blog_text, blog.token_id, tokens.token_id, tokens.token_string FROM blog JOIN tokens ON blog.token_id = tokens.token_id\");\n }", "function GetTable($target)\r\n\t{\r\n\t\tif ($this->Behavior->Search)\r\n\t\t{\r\n\t\t\t$sq = Server::GetVar($this->Name.'_q');\r\n\t\t\tif (!isset($sq)) return;\r\n\t\t}\r\n\r\n\t\t$ret = null;\r\n\t\tif (empty($this->ds->DisplayColumns)) return;\r\n\t\tif ($this->type == CONTROL_BOUND)\r\n\t\t{\r\n\t\t\t$cols = array();\r\n\r\n\t\t\t# Build columns so nothing overlaps (eg. id of this and child table)\r\n\r\n\t\t\t$cols[$this->ds->table.'_'.$this->ds->id] =\r\n\t\t\t\t$this->ds->table.'.'.$this->ds->id;\r\n\r\n\t\t\tif (!empty($this->ds->DisplayColumns))\r\n\t\t\tforeach ($this->ds->DisplayColumns as $col => $disp)\r\n\t\t\t{\r\n\t\t\t\tif (is_numeric($col)) continue;\r\n\r\n\t\t\t\tif (strpos($col, '.')) // Referencing a joined table.\r\n\t\t\t\t{\r\n\t\t\t\t\t$st = $this->ds->StripTable($col);\r\n\t\t\t\t\t$cols[$st] = $st;\r\n\t\t\t\t}\r\n\t\t\t\telse // A table from this dataset.\r\n\t\t\t\t\t$cols[$this->ds->table.'_'.$col] =\r\n\t\t\t\t\t\t$this->ds->table.'.'.$col;\r\n\t\t\t}\r\n\r\n\t\t\t$joins = null;\r\n\t\t\tif (!empty($this->ds->children))\r\n\t\t\tforeach ($this->ds->children as $child)\r\n\t\t\t{\r\n\t\t\t\t$joins = array();\r\n\r\n\t\t\t\t# Parent column of the child...\r\n\t\t\t\t$cols[$child->ds->table.'.'.$child->child_key] =\r\n\t\t\t\t\t$child->ds->table.'_'.$child->child_key;\r\n\r\n\t\t\t\t# Coming from another table, we gotta join it in.\r\n\t\t\t\tif ($child->ds->table != $this->ds->table)\r\n\t\t\t\t{\r\n\t\t\t\t\t$joins[$child->ds->table] = \"{$child->ds->table}.\r\n\t\t\t\t\t\t{$child->child_key} = {$this->ds->table}.\r\n\t\t\t\t\t\t{$child->parent_key}\";\r\n\r\n\t\t\t\t\t//We also need to get the column names that we'll need...\r\n\t\t\t\t\t$cols[$child->ds->table.'.'.$child->ds->id] =\r\n\t\t\t\t\t\t$child->ds->table.'_'.$child->ds->id;\r\n\t\t\t\t\tif (!empty($child->ds->DisplayColumns))\r\n\t\t\t\t\tforeach ($child->ds->DisplayColumns as $col => $disp)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$cols[$child->ds->table.'_'.$col] =\r\n\t\t\t\t\t\t\t$child->ds->table.'.'.$col;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t# Search\r\n\r\n\t\t\t$q['match'] = array();\r\n\t\t\tif (!empty($sq))\r\n\t\t\t\tforeach($cols as $c)\r\n\t\t\t\t\t$q['match'][$c] = Database::SqlOr(Database::SqlLike(\"%$sq%\"));\r\n\r\n\t\t\t$q['columns'] = $cols;\r\n\t\t\t$q['order'] = $this->sort;\r\n\t\t\t$q['limit'] = $this->filter;\r\n\t\t\t$q['match'] += $this->match;\r\n\t\t\t$items = $this->ds->Get($q);\r\n\r\n\t\t\t$root = $this->BuildTree($items);\r\n\t\t}\r\n\r\n\t\tif (isset($root))\r\n\t\t{\r\n\t\t\t$cols = array('&nbsp;');\r\n\t\t\t$atrs = array();\r\n\r\n\t\t\t//Columns and column attributes.\r\n\t\t\tif (!empty($this->ds->DisplayColumns))\r\n\t\t\tforeach ($this->ds->DisplayColumns as $col => $disp)\r\n\t\t\t{\r\n\t\t\t\t$cols[$col] = $disp->text;\r\n\t\t\t\t$atrs[] = $disp->attribs;\r\n\t\t\t}\r\n\r\n\t\t\t//Gather children columns.\r\n\t\t\tif (!empty($this->ds->children))\r\n\t\t\tforeach ($this->ds->children as $child)\r\n\t\t\t{\r\n\t\t\t\tif ($child->ds->table != $this->ds->table)\r\n\t\t\t\tif (!empty($child->ds->DisplayColumns))\r\n\t\t\t\tforeach ($child->ds->DisplayColumns as $col => $disp)\r\n\t\t\t\t{\r\n\t\t\t\t\t$cols[$col] = $disp->text;\r\n\t\t\t\t\t$atrs[] = $disp->attribs;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif ($this->sorting == ED_SORT_TABLE)\r\n\t\t\t\t$table = new SortTable($this->Name.'_table', $cols, $atrs);\r\n\t\t\telse\r\n\t\t\t\t$table = new Table($this->Name.'_table', $cols, $atrs);\r\n\r\n\t\t\t$rows = array();\r\n\t\t\t$this->AddRows($rows, $target, $root, 0);\r\n\r\n\t\t\tforeach ($rows as $ix => $row)\r\n\t\t\t{\r\n\t\t\t\t$class = $ix % 2 ? 'even' : 'odd';\r\n\t\t\t\t$table->AddRow($row, array('CLASS' => $class));\r\n\t\t\t}\r\n\r\n\t\t\t$ret .= $table->Get(array('CLASS' => 'editor table table-striped table-bordered'));\r\n\t\t}\r\n\t\treturn $ret;\r\n\t}", "function getJoin($table,$col,$join){\n $array=array();\n $conn=connectDB();\n $query=\"SELECT $table.$col FROM $join\";\n foreach ($conn->query($query)as $row){\n array_push($array,$row[$col]);\n }\n return $array;\n }", "public function join($tables, $overwrite = false);", "public function outer($table, $on, $field = null, $comparitor = null);", "function GetMultipleDataJoin($table1=false,$table2=false,$filter1=false,$filter2=false)\n\t{\t//echo $table1; echo $table2; echo $filter1; echo $filter2;die;\n\t\t$qry=$this->db->query(\"select $table1.*,$table2.* from $table1,$table2 where $table1.$filter1=$table2.$filter1 \");//print_r($qry);die;\n\t\treturn $qry->result();\n\t}", "public function join(AssocValue $other): AssocValue;", "abstract public function join($alias_from, $rel_name, $alias_to);", "private function addJoinOn($type, Query $other, $fieldOrExpr, $operator, $valueOrExpr) {\r\n\t\tif (!array_key_exists($other->_salt_alias, $this->_salt_joins)) {\r\n\t\t\tthrow new SaltException(L::error_query_missing_join($other->_salt_alias));\r\n\t\t}\r\n\r\n\t\t$absoluteField = $this->resolveFieldName(ClauseType::JOIN, $fieldOrExpr);\r\n\r\n\t\t$valueOrExpr = $this->resolveFieldName(ClauseType::JOIN, $valueOrExpr, $fieldOrExpr);\r\n\t\tif (is_array($valueOrExpr)) {\r\n\t\t\t$valueOrExpr = '('.implode(', ', $valueOrExpr).')';\r\n\t\t}\r\n\t\t$clause = $absoluteField.' '.$operator.' '.$valueOrExpr;\r\n\r\n\t\t$this->addJoinOnClause($other, $type, $clause);\r\n// \t\t$this->joins[$other->alias]['on'][]=' '.$type.' '.$clause;\r\n\t}", "public function join($tb1,$tb2,$on=[],$mod=\"inner\"){\n\n\t\tif($this->name!=\"\"){\n\t\t\t$mod=$on;$on = $tb2;$tb2= $tb1;$tb1 = $this;\n\t\t}\n\n\t\tif(gettype($on)==\"string\") $on = [$on ,$on];\n\t\tif(gettype($mod)!=\"string\") $mod= \"inner\";\n\t\treturn new $this::$tclass($tb1,$tb2,$on,$mod);\n\n\t}", "public function naturalJoin($table)\n\t{\n\t\treturn $this->joinInternal('NATURAL JOIN', $table);\n\t}", "public function join(string $externalTable, string $externalColumn, string $localTable, string $localColumn)\n {\n return $this->innerJoin($externalTable, $externalColumn, $localTable, $localColumn);\n }", "public function __toString()\n {\n if (!isset($this->_from[0]['table']) || !$this->_from[0]['table']) {\n //sanity check\n return '';\n }\n\n $sql = \"SELECT \";\n\n $column_parts = array();\n $from_parts = array();\n\n foreach ($this->_from as $from) {\n $table_key = (is_array($from['table'])) ? key($from['table']) : $from['table'];\n\n foreach ($from['columns'] as $column_key => $column_name) {\n if (strpos($column_name, '(') === false && strpos($column_name, '.') === false) {\n //This is NOT an expression and does not yet have \".\", add tbl name\n $column_name = $table_key . '.' . $column_name;\n }\n\n if (!geoString::isInt($column_key)) {\n $column_name .= ' AS ' . $column_key;\n }\n $column_parts[] = $column_name;\n }\n\n //figure out from\n switch ($from['join_type']) {\n case 'primary':\n //special case, this is first table, don't need to add join type\n $from_str = '';\n break;\n\n case self::JOIN_LEFT:\n $from_str = 'LEFT JOIN ';\n break;\n\n case self::JOIN_INNER:\n //break ommitted on purpose\n default:\n $from_str = 'INNER JOIN ';\n break;\n }\n\n if (is_array($from['table'])) {\n //using array(table_alias => table_name)\n $table = $from['table'];\n reset($table);\n $from_str .= current($table) . ' AS ' . key($table);\n } else {\n //simple string for table\n $from_str .= $from['table'];\n }\n if ($from['on'] && is_array($from['on'])) {\n $from_str .= ' ON ' . implode(' AND ', $from['on']);\n } elseif ($from['on']) {\n $from_str .= ' ON ' . $from['on'];\n }\n $from_parts [] = $from_str;\n }\n $sql .= implode(', ', $column_parts) . \"\\n\\tFROM \" . implode(\"\\n\\t\\t\", $from_parts);\n\n $where = $this->_where;\n\n if ($this->_orWhere) {\n //add all the OR's to the thingy\n foreach ($this->_orWhere as $name => $orWhere) {\n $where[$name] = \"(\" . implode(' OR ', $orWhere) . \")\";\n }\n }\n\n if ($where) {\n $sql .= \"\\n\\tWHERE \" . implode(' AND ', $where);\n }\n\n if ($this->_group) {\n $sql .= \"\\n\\tGROUP BY \" . implode(', ', $this->_group);\n }\n\n if ($this->_order) {\n $sql .= \"\\n\\tORDER BY \" . implode(', ', $this->_order);\n }\n\n if ($this->_count || $this->_offset) {\n $sql .= \"\\n\\tLIMIT {$this->_count}\";\n if ($this->_offset) {\n $sql .= \", {$this->_offset}\";\n }\n }\n\n return $sql;\n }", "public function join($sql) {\n $this->__join__ = $sql;\n return $this;\n }", "public function join($tabela1 = null, $tabela2 = null, $para=null) {\n \n \n }", "public function join($tables, $columnName, $joinType = 'JOIN')\r\n\t\t{\r\n\t\t\t\r\n\t\t\t$totalTables = count($tables);\r\n\t\t\t\r\n\t\t\tif(is_array($columnName)){\r\n\t\t\t\t$colsIsArray = true;\r\n\t\t\t\tif(count($columnName) != $totalTables){\r\n\t\t\t\t\techo \"DB Join error. columnName passed as an array but does not match tables count. \";\r\n\t\t\t\t\techo \"columnName is an array of: \" . count($colsIsArray) . \" while tables is an array of: \" . $totalTables;\r\n\t\t\t\t\tdie();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse $colsIsArray = false;\r\n\t\t\t$c = 0;\r\n\r\n//SELECT column_list\r\n//FROM t1\r\n//INNER JOIN t2 ON join_condition1\r\n//INNER JOIN t3 ON join_condition2\r\n\r\n\t\t\t$joinSQL = \"`{$this->_prefix}{$tables[0]}` \";\r\n\r\n\t\t\tfor($n = 0; $n < $totalTables; $n += 1){\r\n\r\n\t\t\t\tif($n+1 < $totalTables){\r\n\t\t\t\t\t$joinSQL .= \"{$joinType} `{$this->_prefix}{$tables[$n+1]}` \";\r\n\t\t\t\t\tif($colsIsArray) $joinSQL .= \"ON `{$this->_prefix}{$tables[$n]}`.`{$columnName[$c]}` = `{$this->_prefix}{$tables[$n+1]}`.`{$columnName[$c+1]}` \";\r\n\t\t\t\t\telse $joinSQL .= \"ON `{$this->_prefix}{$tables[$n]}`.`{$columnName}` = `{$this->_prefix}{$tables[$n+1]}`.`{$columnName}` \";\r\n\t\t\t\t\t$c += 1;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t//lets prepare our query string\r\n\t\t\t$this->_sql = \"SELECT {$this->_select} FROM \" . $joinSQL . $this->_where . $this->_orderBy . $this->_limit;\r\n\r\n\t\t\t//build an additional query string for our count ready for numRows() method\r\n\t\t\t$this->_sqlCount = \"SELECT COUNT(*) FROM \" . $joinSQL . $this->_where;\r\n\r\n\t\t\t//let the server prepare, execute and check for errors\r\n\t\t\t$this->_query = $this->_prepare($this->_sql);\r\n\t\t\t$this->_execute($this->_query);\r\n\t\t\t$this->_errors($this->_query);\r\n\r\n\t\t\treturn $this;\r\n\t\t}", "public function rightJoin($table, $key, ?string $operator = null, $foreign = null);", "function joinon_Contact_and_Vehicle_singlerecord($rID, $where = NULL) {\r\n if ($where != NULL) { $this->db->where($where); } \r\n $this->db->join(\r\n 'contact', \r\n 'contact.Id = ' . $this->table_name. '.' . $this->contactId_fieldname, \r\n 'left outer'\r\n ); \r\n $this->db->join(\r\n '__vehicles', \r\n '__vehicles.__Id = ' . $this->table_name. '._VehicleId', \r\n 'left outer'\r\n ); \r\n return $this->get($rID);\r\n }", "public function view_join_one($table1, $table2, $field, $order, $ordering)\n {\n $this->db->select('*');\n $this->db->from($table1);\n $this->db->join($table2, $table1 . '.' . $field . '=' . $table2 . '.' . $field);\n $this->db->order_by($order, $ordering);\n return $this->db->get()->result();\n }", "public function testCrossDatabaseJoins() {\n\t\t$config = ConnectionManager::enumConnectionObjects();\n\n\t\t$skip = (!isset($config['test']) || !isset($config['test2']));\n\t\tif ($skip) {\n\t\t\t$this->markTestSkipped('Primary and secondary test databases not configured, skipping cross-database\n\t\t\t\tjoin tests. To run theses tests defined $test and $test2 in your database configuration.'\n\t\t\t);\n\t\t}\n\n\t\t$this->loadFixtures('Article', 'Tag', 'ArticlesTag', 'User', 'Comment');\n\t\t$TestModel = new Article();\n\n\t\t$expected = array(\n\t\t\tarray(\n\t\t\t\t'Article' => array(\n\t\t\t\t\t'id' => '1',\n\t\t\t\t\t'user_id' => '1',\n\t\t\t\t\t'title' => 'First Article',\n\t\t\t\t\t'body' => 'First Article Body',\n\t\t\t\t\t'published' => 'Y',\n\t\t\t\t\t'created' => '2007-03-18 10:39:23',\n\t\t\t\t\t'updated' => '2007-03-18 10:41:31'\n\t\t\t\t),\n\t\t\t\t'User' => array(\n\t\t\t\t\t'id' => '1',\n\t\t\t\t\t'user' => 'mariano',\n\t\t\t\t\t'password' => '5f4dcc3b5aa765d61d8327deb882cf99',\n\t\t\t\t\t'created' => '2007-03-17 01:16:23',\n\t\t\t\t\t'updated' => '2007-03-17 01:18:31'\n\t\t\t\t),\n\t\t\t\t'Comment' => array(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'id' => '1',\n\t\t\t\t\t\t'article_id' => '1',\n\t\t\t\t\t\t'user_id' => '2',\n\t\t\t\t\t\t'comment' => 'First Comment for First Article',\n\t\t\t\t\t\t'published' => 'Y',\n\t\t\t\t\t\t'created' => '2007-03-18 10:45:23',\n\t\t\t\t\t\t'updated' => '2007-03-18 10:47:31'\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'id' => '2',\n\t\t\t\t\t\t'article_id' => '1',\n\t\t\t\t\t\t'user_id' => '4',\n\t\t\t\t\t\t'comment' => 'Second Comment for First Article',\n\t\t\t\t\t\t'published' => 'Y',\n\t\t\t\t\t\t'created' => '2007-03-18 10:47:23',\n\t\t\t\t\t\t'updated' => '2007-03-18 10:49:31'\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'id' => '3',\n\t\t\t\t\t\t'article_id' => '1',\n\t\t\t\t\t\t'user_id' => '1',\n\t\t\t\t\t\t'comment' => 'Third Comment for First Article',\n\t\t\t\t\t\t'published' => 'Y',\n\t\t\t\t\t\t'created' => '2007-03-18 10:49:23',\n\t\t\t\t\t\t'updated' => '2007-03-18 10:51:31'\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'id' => '4',\n\t\t\t\t\t\t'article_id' => '1',\n\t\t\t\t\t\t'user_id' => '1',\n\t\t\t\t\t\t'comment' => 'Fourth Comment for First Article',\n\t\t\t\t\t\t'published' => 'N',\n\t\t\t\t\t\t'created' => '2007-03-18 10:51:23',\n\t\t\t\t\t\t'updated' => '2007-03-18 10:53:31'\n\t\t\t\t)),\n\t\t\t\t'Tag' => array(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'id' => '1',\n\t\t\t\t\t\t'tag' => 'tag1',\n\t\t\t\t\t\t'created' => '2007-03-18 12:22:23',\n\t\t\t\t\t\t'updated' => '2007-03-18 12:24:31'\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'id' => '2',\n\t\t\t\t\t\t'tag' => 'tag2',\n\t\t\t\t\t\t'created' => '2007-03-18 12:24:23',\n\t\t\t\t\t\t'updated' => '2007-03-18 12:26:31'\n\t\t\t))),\n\t\t\tarray(\n\t\t\t\t'Article' => array(\n\t\t\t\t\t'id' => '2',\n\t\t\t\t\t'user_id' => '3',\n\t\t\t\t\t'title' => 'Second Article',\n\t\t\t\t\t'body' => 'Second Article Body',\n\t\t\t\t\t'published' => 'Y',\n\t\t\t\t\t'created' => '2007-03-18 10:41:23',\n\t\t\t\t\t'updated' => '2007-03-18 10:43:31'\n\t\t\t\t),\n\t\t\t\t'User' => array(\n\t\t\t\t\t'id' => '3',\n\t\t\t\t\t'user' => 'larry',\n\t\t\t\t\t'password' => '5f4dcc3b5aa765d61d8327deb882cf99',\n\t\t\t\t\t'created' => '2007-03-17 01:20:23',\n\t\t\t\t\t'updated' => '2007-03-17 01:22:31'\n\t\t\t\t),\n\t\t\t\t'Comment' => array(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'id' => '5',\n\t\t\t\t\t\t'article_id' => '2',\n\t\t\t\t\t\t'user_id' => '1',\n\t\t\t\t\t\t'comment' => 'First Comment for Second Article',\n\t\t\t\t\t\t'published' => 'Y',\n\t\t\t\t\t\t'created' => '2007-03-18 10:53:23',\n\t\t\t\t\t\t'updated' => '2007-03-18 10:55:31'\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'id' => '6',\n\t\t\t\t\t\t'article_id' => '2',\n\t\t\t\t\t\t'user_id' => '2',\n\t\t\t\t\t\t'comment' => 'Second Comment for Second Article',\n\t\t\t\t\t\t'published' => 'Y',\n\t\t\t\t\t\t'created' => '2007-03-18 10:55:23',\n\t\t\t\t\t\t'updated' => '2007-03-18 10:57:31'\n\t\t\t\t)),\n\t\t\t\t'Tag' => array(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'id' => '1',\n\t\t\t\t\t\t'tag' => 'tag1',\n\t\t\t\t\t\t'created' => '2007-03-18 12:22:23',\n\t\t\t\t\t\t'updated' => '2007-03-18 12:24:31'\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'id' => '3',\n\t\t\t\t\t\t'tag' => 'tag3',\n\t\t\t\t\t\t'created' => '2007-03-18 12:26:23',\n\t\t\t\t\t\t'updated' => '2007-03-18 12:28:31'\n\t\t\t))),\n\t\t\tarray(\n\t\t\t\t'Article' => array(\n\t\t\t\t\t'id' => '3',\n\t\t\t\t\t'user_id' => '1',\n\t\t\t\t\t'title' => 'Third Article',\n\t\t\t\t\t'body' => 'Third Article Body',\n\t\t\t\t\t'published' => 'Y',\n\t\t\t\t\t'created' => '2007-03-18 10:43:23',\n\t\t\t\t\t'updated' => '2007-03-18 10:45:31'\n\t\t\t\t),\n\t\t\t\t'User' => array(\n\t\t\t\t\t'id' => '1',\n\t\t\t\t\t'user' => 'mariano',\n\t\t\t\t\t'password' => '5f4dcc3b5aa765d61d8327deb882cf99',\n\t\t\t\t\t'created' => '2007-03-17 01:16:23',\n\t\t\t\t\t'updated' => '2007-03-17 01:18:31'\n\t\t\t\t),\n\t\t\t\t'Comment' => array(),\n\t\t\t\t'Tag' => array()\n\t\t));\n\t\t$this->assertEquals($expected, $TestModel->find('all'));\n\n\t\t$db2 = ConnectionManager::getDataSource('test2');\n\t\t$this->fixtureManager->loadSingle('User', $db2);\n\t\t$this->fixtureManager->loadSingle('Comment', $db2);\n\t\t$this->assertEquals(3, $TestModel->find('count'));\n\n\t\t$TestModel->User->setDataSource('test2');\n\t\t$TestModel->Comment->setDataSource('test2');\n\n\t\tforeach ($expected as $key => $value) {\n\t\t\tunset($value['Comment'], $value['Tag']);\n\t\t\t$expected[$key] = $value;\n\t\t}\n\n\t\t$TestModel->recursive = 0;\n\t\t$result = $TestModel->find('all');\n\t\t$this->assertEquals($expected, $result);\n\n\t\tforeach ($expected as $key => $value) {\n\t\t\tunset($value['Comment'], $value['Tag']);\n\t\t\t$expected[$key] = $value;\n\t\t}\n\n\t\t$TestModel->recursive = 0;\n\t\t$result = $TestModel->find('all');\n\t\t$this->assertEquals($expected, $result);\n\n\t\t$result = Hash::extract($TestModel->User->find('all'), '{n}.User.id');\n\t\t$this->assertEquals(array('1', '2', '3', '4'), $result);\n\t\t$this->assertEquals($expected, $TestModel->find('all'));\n\n\t\t$TestModel->Comment->unbindModel(array('hasOne' => array('Attachment')));\n\t\t$expected = array(\n\t\t\tarray(\n\t\t\t\t'Comment' => array(\n\t\t\t\t\t'id' => '1',\n\t\t\t\t\t'article_id' => '1',\n\t\t\t\t\t'user_id' => '2',\n\t\t\t\t\t'comment' => 'First Comment for First Article',\n\t\t\t\t\t'published' => 'Y',\n\t\t\t\t\t'created' => '2007-03-18 10:45:23',\n\t\t\t\t\t'updated' => '2007-03-18 10:47:31'\n\t\t\t\t),\n\t\t\t\t'User' => array(\n\t\t\t\t\t'id' => '2',\n\t\t\t\t\t'user' => 'nate',\n\t\t\t\t\t'password' => '5f4dcc3b5aa765d61d8327deb882cf99',\n\t\t\t\t\t'created' => '2007-03-17 01:18:23',\n\t\t\t\t\t'updated' => '2007-03-17 01:20:31'\n\t\t\t\t),\n\t\t\t\t'Article' => array(\n\t\t\t\t\t'id' => '1',\n\t\t\t\t\t'user_id' => '1',\n\t\t\t\t\t'title' => 'First Article',\n\t\t\t\t\t'body' => 'First Article Body',\n\t\t\t\t\t'published' => 'Y',\n\t\t\t\t\t'created' => '2007-03-18 10:39:23',\n\t\t\t\t\t'updated' => '2007-03-18 10:41:31'\n\t\t\t)),\n\t\t\tarray(\n\t\t\t\t'Comment' => array(\n\t\t\t\t\t'id' => '2',\n\t\t\t\t\t'article_id' => '1',\n\t\t\t\t\t'user_id' => '4',\n\t\t\t\t\t'comment' => 'Second Comment for First Article',\n\t\t\t\t\t'published' => 'Y',\n\t\t\t\t\t'created' => '2007-03-18 10:47:23',\n\t\t\t\t\t'updated' => '2007-03-18 10:49:31'\n\t\t\t\t),\n\t\t\t\t'User' => array(\n\t\t\t\t\t'id' => '4',\n\t\t\t\t\t'user' => 'garrett',\n\t\t\t\t\t'password' => '5f4dcc3b5aa765d61d8327deb882cf99',\n\t\t\t\t\t'created' => '2007-03-17 01:22:23',\n\t\t\t\t\t'updated' => '2007-03-17 01:24:31'\n\t\t\t\t),\n\t\t\t\t'Article' => array(\n\t\t\t\t\t'id' => '1',\n\t\t\t\t\t'user_id' => '1',\n\t\t\t\t\t'title' => 'First Article',\n\t\t\t\t\t'body' => 'First Article Body',\n\t\t\t\t\t'published' => 'Y',\n\t\t\t\t\t'created' => '2007-03-18 10:39:23',\n\t\t\t\t\t'updated' => '2007-03-18 10:41:31'\n\t\t\t)),\n\t\t\tarray(\n\t\t\t\t'Comment' => array(\n\t\t\t\t\t'id' => '3',\n\t\t\t\t\t'article_id' => '1',\n\t\t\t\t\t'user_id' => '1',\n\t\t\t\t\t'comment' => 'Third Comment for First Article',\n\t\t\t\t\t'published' => 'Y',\n\t\t\t\t\t'created' => '2007-03-18 10:49:23',\n\t\t\t\t\t'updated' => '2007-03-18 10:51:31'\n\t\t\t\t),\n\t\t\t\t'User' => array(\n\t\t\t\t\t'id' => '1',\n\t\t\t\t\t'user' => 'mariano',\n\t\t\t\t\t'password' => '5f4dcc3b5aa765d61d8327deb882cf99',\n\t\t\t\t\t'created' => '2007-03-17 01:16:23',\n\t\t\t\t\t'updated' => '2007-03-17 01:18:31'\n\t\t\t\t),\n\t\t\t\t'Article' => array(\n\t\t\t\t\t'id' => '1',\n\t\t\t\t\t'user_id' => '1',\n\t\t\t\t\t'title' => 'First Article',\n\t\t\t\t\t'body' => 'First Article Body',\n\t\t\t\t\t'published' => 'Y',\n\t\t\t\t\t'created' => '2007-03-18 10:39:23',\n\t\t\t\t\t'updated' => '2007-03-18 10:41:31'\n\t\t\t)),\n\t\t\tarray(\n\t\t\t\t'Comment' => array(\n\t\t\t\t\t'id' => '4',\n\t\t\t\t\t'article_id' => '1',\n\t\t\t\t\t'user_id' => '1',\n\t\t\t\t\t'comment' => 'Fourth Comment for First Article',\n\t\t\t\t\t'published' => 'N',\n\t\t\t\t\t'created' => '2007-03-18 10:51:23',\n\t\t\t\t\t'updated' => '2007-03-18 10:53:31'\n\t\t\t\t),\n\t\t\t\t'User' => array(\n\t\t\t\t\t'id' => '1',\n\t\t\t\t\t'user' => 'mariano',\n\t\t\t\t\t'password' => '5f4dcc3b5aa765d61d8327deb882cf99',\n\t\t\t\t\t'created' => '2007-03-17 01:16:23',\n\t\t\t\t\t'updated' => '2007-03-17 01:18:31'\n\t\t\t\t),\n\t\t\t\t'Article' => array(\n\t\t\t\t\t'id' => '1',\n\t\t\t\t\t'user_id' => '1',\n\t\t\t\t\t'title' => 'First Article',\n\t\t\t\t\t'body' => 'First Article Body',\n\t\t\t\t\t'published' => 'Y',\n\t\t\t\t\t'created' => '2007-03-18 10:39:23',\n\t\t\t\t\t'updated' => '2007-03-18 10:41:31'\n\t\t\t)),\n\t\t\tarray(\n\t\t\t\t'Comment' => array(\n\t\t\t\t\t'id' => '5',\n\t\t\t\t\t'article_id' => '2',\n\t\t\t\t\t'user_id' => '1',\n\t\t\t\t\t'comment' => 'First Comment for Second Article',\n\t\t\t\t\t'published' => 'Y',\n\t\t\t\t\t'created' => '2007-03-18 10:53:23',\n\t\t\t\t\t'updated' => '2007-03-18 10:55:31'\n\t\t\t\t),\n\t\t\t\t'User' => array(\n\t\t\t\t\t'id' => '1',\n\t\t\t\t\t'user' => 'mariano',\n\t\t\t\t\t'password' => '5f4dcc3b5aa765d61d8327deb882cf99',\n\t\t\t\t\t'created' => '2007-03-17 01:16:23',\n\t\t\t\t\t'updated' => '2007-03-17 01:18:31'\n\t\t\t\t),\n\t\t\t\t'Article' => array(\n\t\t\t\t\t'id' => '2',\n\t\t\t\t\t'user_id' => '3',\n\t\t\t\t\t'title' => 'Second Article',\n\t\t\t\t\t'body' => 'Second Article Body',\n\t\t\t\t\t'published' => 'Y',\n\t\t\t\t\t'created' => '2007-03-18 10:41:23',\n\t\t\t\t\t'updated' => '2007-03-18 10:43:31'\n\t\t\t)),\n\t\t\tarray(\n\t\t\t\t'Comment' => array(\n\t\t\t\t\t'id' => '6',\n\t\t\t\t\t'article_id' => '2',\n\t\t\t\t\t'user_id' => '2',\n\t\t\t\t\t'comment' => 'Second Comment for Second Article',\n\t\t\t\t\t'published' => 'Y',\n\t\t\t\t\t'created' => '2007-03-18 10:55:23',\n\t\t\t\t\t'updated' => '2007-03-18 10:57:31'\n\t\t\t\t),\n\t\t\t\t'User' => array(\n\t\t\t\t\t'id' => '2',\n\t\t\t\t\t'user' => 'nate',\n\t\t\t\t\t'password' => '5f4dcc3b5aa765d61d8327deb882cf99',\n\t\t\t\t\t'created' => '2007-03-17 01:18:23',\n\t\t\t\t\t'updated' => '2007-03-17 01:20:31'\n\t\t\t\t),\n\t\t\t\t'Article' => array(\n\t\t\t\t\t'id' => '2',\n\t\t\t\t\t'user_id' => '3',\n\t\t\t\t\t'title' => 'Second Article',\n\t\t\t\t\t'body' => 'Second Article Body',\n\t\t\t\t\t'published' => 'Y',\n\t\t\t\t\t'created' => '2007-03-18 10:41:23',\n\t\t\t\t\t'updated' => '2007-03-18 10:43:31'\n\t\t)));\n\t\t$this->assertEquals($expected, $TestModel->Comment->find('all'));\n\t}", "public function rightJoin($table, $conditions = []);", "public function testBuildSelectWithJoin()\n {\n $query = $this->getQuery()\n ->table('table1')\n ->fields()\n ->addField('user@email', 'email')\n ->join(\n $this->getQuery()\n ->table('table2')\n ->fields()\n ->addField('user@email', 'email')\n ->joinOn('id', 'id')\n )\n ;\n\n $this->assertSame(\n \"'user@email' AS table1__email, 'user@email' AS table2__email\",\n $query->buildSelectFields()\n );\n }", "function query_main_join( $sql, $engine ) {\n\t\tglobal $wpdb;\n\n\t\tif ( isset( $engine ) ) {\n\t\t\t$engine = null;\n\t\t}\n\n\t\t// if WooCommerce is sorting results we need to tell SearchWP to return them in that order\n\t\tif ( $this->is_woocommerce_search() ) {\n\n\t\t\tif ( ! isset( $this->ordering['wc_orderby'] ) ) {\n\t\t\t\t$this->get_woocommerce_ordering();\n\t\t\t}\n\n\t\t\t// depending on the sorting we need to do different things\n\t\t\tif ( isset( $this->ordering['wc_orderby'] ) ) {\n\t\t\t\tswitch ( $this->ordering['wc_orderby'] ) {\n\t\t\t\t\tcase 'price':\n\t\t\t\t\tcase 'price-desc':\n\t\t\t\t\tcase 'popularity':\n\t\t\t\t\t\t$meta_key = 'price' === $this->ordering['wc_orderby'] ? '_price' : 'total_sales';\n\t\t\t\t\t\t$sql = $sql . $wpdb->prepare( \" LEFT JOIN {$wpdb->postmeta} AS swpwc ON {$wpdb->posts}.ID = swpwc.post_id AND swpwc.meta_key = %s\", $meta_key );\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'rating':\n\t\t\t\t\t\t$sql = $sql . \" LEFT OUTER JOIN {$wpdb->comments} swpwpcom ON({$wpdb->posts}.ID = swpwpcom.comment_post_ID) LEFT JOIN {$wpdb->commentmeta} swpwpcommeta ON(swpwpcom.comment_ID = swpwpcommeta.comment_id) \";\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// for visibility we always need to join postmeta\n\t\t\tif ( function_exists( 'WC' ) && ! empty( WC()->version ) && version_compare( WC()->version, '2.6.0', '<' ) ) { // Moved to a taxonomy\n\t\t\t\t$sql = $sql . \" INNER JOIN {$wpdb->postmeta} as woovisibility ON {$wpdb->posts}.ID = woovisibility.post_id \";\n\t\t\t}\n\n\t\t}\n\n\t\treturn $sql;\n\t}", "public function addJoin($assocTable, $col1, $col2, $last = true, $type = \"left\") {\n // Joins will always be on selects\n list($this->sql, $this->from) = splitString($this->sql, \"FROM\");\n // Take care of aliased columns\n if (!empty($assocTable->aliases)) {\n $this->sql .= \", \";\n foreach($assocTable->aliases as $c => $a) {\n $this->sql .= $assocTable->name . \".$c as $a,\";\n }\n // Take the comma off the end\n $this->sql = trim($this->sql, \",\");\n }\n $type = strtoupper($type);\n $this->join .= \" $type JOIN \" . $assocTable->name;\n $this->join .= \" ON \" . $this->table->name . \".\" . $col1 . \" = \" . $assocTable->name . \".\" . $col2;\n if ($last) {\n $this->sql .= \" $this->from\";\n $this->sql .= $this->join;\n }\n }", "function get_ons(){\n //\n //Map for each and return an on clause \n $col_str=array_map(array($this, 'map'), $this->foreigns); //\n //\n //Return on joined on \n return implode(\"AND \\t\",$col_str);\n }", "public function joinOrderItemObjects();", "private static function join(Table $table1, $rows1, Table $table2, $rows2, array $relation)\n {\n if ($relation[0] === Scheme::HAS_ONE) {\n list($table2, $rows2, $table1, $rows1) = [$table1, $rows1, $table2, $rows2];\n }\n\n foreach ($rows1 as $row) {\n $row->{$table2->getName()} = $table2->createCollection();\n }\n\n foreach ($rows2 as $row) {\n $id = $row->{$relation[1]};\n\n if (isset($rows1[$id])) {\n $rows1[$id]->{$table2->getName()}[] = $row;\n $row->{$table1->getName()} = $rows1[$id];\n } else {\n $row->{$table1->getName()} = null;\n }\n }\n }", "public function addJoin($type, $table, $alias = NULL, $condition = NULL, $arguments = []);", "public function joinBase()\n {\n return $this->_joins[0];\n }" ]
[ "0.7855616", "0.69143456", "0.6906889", "0.6693231", "0.6540781", "0.6399488", "0.6365789", "0.62832123", "0.61936826", "0.6154552", "0.61103463", "0.61045766", "0.6093693", "0.6091997", "0.607035", "0.6068486", "0.60190237", "0.59645736", "0.5866002", "0.5849044", "0.5828236", "0.5811383", "0.57701486", "0.5702071", "0.5680053", "0.5662528", "0.5633718", "0.5624465", "0.56207633", "0.55707526", "0.55603766", "0.5553996", "0.5550628", "0.55067986", "0.549168", "0.5469657", "0.5417744", "0.53983366", "0.5391961", "0.5368586", "0.53596884", "0.5353059", "0.533646", "0.532936", "0.5324378", "0.5284415", "0.5254113", "0.524347", "0.5199675", "0.5197075", "0.51964176", "0.5187499", "0.51825106", "0.5175253", "0.5146883", "0.513754", "0.5124468", "0.5104931", "0.50791794", "0.50543827", "0.5051283", "0.50496227", "0.5044998", "0.50352156", "0.50330675", "0.5017441", "0.49859574", "0.49851897", "0.49698937", "0.4969", "0.49652156", "0.49600804", "0.49407712", "0.49266326", "0.4901292", "0.48895377", "0.48834875", "0.487644", "0.48578134", "0.48543963", "0.48451075", "0.48306996", "0.4829769", "0.4824268", "0.4808986", "0.4804555", "0.47994334", "0.47837463", "0.47806022", "0.47742516", "0.47733244", "0.476096", "0.47570318", "0.4751703", "0.47513717", "0.47442088", "0.47414857", "0.47400784", "0.4739495", "0.47370005" ]
0.696181
1
Left Outer Join against another table in the database.
public function leftJoin($table, $alias = NULL, $condition = NULL, $arguments = []);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function leftOuterJoin($table);", "public function fullOuterJoin($table);", "public function leftJoin($table, $conditions = []);", "public function leftJoin($table, $key, ?string $operator = null, $foreign = null);", "public static function leftJoin($source, $on, $alias = null, array $bindings = []);", "public function rightOuterJoin($table);", "public static function doLeftJoin($table2, $params=NULL, $fields=array()) {\n\t\t$conn = parent::_initwgConnector($params, self::PRIMARY_KEY);\n\t\t$what = parent::_getSelectFields($fields);\n\t\t$conn->leftJoin(self::TABLE_NAME, $table2, $what);\n\t\treturn DbModel::doSelect($conn, new ProjectsListingsModel());\n\t}", "public function outerJoin($table, array $fields = [], array $on = []) {\n return $this->_addJoin(Join::OUTER, $table, $fields, $on);\n }", "final public static function leftJoin(string $table, string $primaryKey, string $foreignKey)\n {\n //Init the select\n self::$query .= \" LEFT JOIN \" . $table . \" ON $table.$primaryKey = \" . self::tableName() . \".$foreignKey \";\n return (new static);\n }", "function leftJoin($conditions)\n\t{\n\t\treturn $this->join('LEFT', $conditions);\n\t}", "public function leftJoin($table, $column1, $operator = null, $column2 = null)\n\t{\n\t\treturn $this->join($table, $column1, $operator, $column2, 'LEFT');\n\t}", "public function testLeftJoinStmt()\n {\n $leftJoin = $this->joinTemplate()('LEFT');\n return $this->assertEquals($leftJoin, \"SELECT blog.blog_text, blog.token_id, tokens.token_id, tokens.token_string FROM blog LEFT JOIN tokens ON blog.token_id = tokens.token_id\");\n }", "public function left_join($table, $on=null)\n {\n $alias = null;\n\n if (is_string($table) && strpos($table, ' ') && !preg_match('/^\\s*\\(/i', $table))\n {\n list ($table, $alias) = preg_split('/\\s+/', trim($table));\n $table = self::quote_name($table);\n }\n\n $args = func_get_args(); array_shift($args);\n $clause = call_user_func_array('self::clause', $args);\n\n $this->join[] = sprintf('left join '. $table .($alias ? ' '.$alias:'') . ' on ' . $clause);\n\n return $this;\n }", "public function leftJoin($table, array $fields = [], array $on = []) {\n return $this->_addJoin(Join::LEFT, $table, $fields, $on);\n }", "public function leftJoin($table, $condition)\n {\n return $this->addJoin($table, $condition, 'LEFT');\n }", "public function leftJoin($table, $foreign_key, $operator, $local_key)\r\n\t{\r\n\t\t$this->model = $this->model\r\n\t\t\t\t\t\t\t->leftJoin($table, $foreign_key, $operator, $local_key);\r\n\t\treturn $this;\r\n\t}", "public function leftJoin(Select $table, $alias, $on)\n {\n $this->joins[] = array(\"subject\"=>$table, \"ali\"=>$alias, \"on\"=>$on, \"join\"=>\"LEFT JOIN\");\n return $this;\n }", "function outerJoin($conditions)\n\t{\n\t\treturn $this->join('OUTER', $conditions);\n\t}", "public function leftJoin($table, $on = null)\n {\n $this->joinTokens[$this->activeJoin = $table] = ['type' => 'LEFT', 'on' => []];\n\n return call_user_func_array([$this, 'on'], array_slice(func_get_args(), 1));\n }", "function sql_leftJoin(){\n\t\t$dbconnection = $this->db_connect();\n\t\tif($dbconnection !=1)\n\t\t{\n\t\t\t$result=\"MySql Connection Error\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\t//LIST OF SELECTIONS\n\t\t\t//INSTEAD of a listOfFields I need a listOfSelections like \"db.tbl_1.fld_1\"\n\t\t\t// a_selections = array(\"db.tbl_1.fld_1\",\"db.tbl_1.fld_2\",\"db.tbl_2.fld_1\");\n\t\t\t\n\t\t\tif($this->a_fields !=\" \"){\n\t\t\t\t$a_selections = $this->arraySELECTIONS($this->db,$this->table,$this->a_fields);\n\t\t\t}else{\n\t\t\t\t$a_selections = $this->db.\".\".$this->table.\" \";\n\t\t\t}\n\t\t\t\n\t\t\tif($this->a_fields2 !=\" \"){\n\t\t\t\t$a_selections2 = $this->arraySELECTIONS($this->db2,$this->table2,$this->a_fields2);\n\t\t\t}else{\n\t\t\t\t$a_selections2 = $this->db2.\".\".$this->table2.\" *\";\n\t\t\t}\n\t\t\t\n \t\t\t$listOfSelections = $this->arrayFieldsToList($a_selections);\n\t\t\t$listOfSelections2 = $this->arrayFieldsToList($a_selections2);\n\t\t\t\n \t\t\t$sql = mysql_query(\"SELECT \".$listOfSelections.\",\".$listOfSelections2.\" FROM \".$this->db.\".\".$this->table.\" LEFT JOIN \".$this->db2.\".\".$this->table2.\" ON \".$this->db.\".\".$this->table.\".\".$this->relation.\" = \".$this->db2.\".\".$this->table2.\".\".$this->relation2.\"\");\n\t\t\t\n \t\t\t //echo(\"SELECT \".$listOfSelections.\",\".$listOfSelections2.\" FROM \".$this->db.\".\".$this->table.\" LEFT JOIN \".$this->db2.\".\".$this->table2.\" ON \".$this->db.\".\".$this->table.\".\".$this->relation.\" = \".$this->db2.\".\".$this->table2.\".\".$this->relation2.\"\");\n \t\t\t\tif (mysql_num_rows($sql) > 0) \n\t\t\t \t{\n\t\t\t \twhile ($row = mysql_fetch_assoc($sql)) \n\t\t\t \t{\n\t\t\t \t$a_data[]=$row ;\n\t\t\t \t}\n\t\t \t\t$result= $a_data;\t\n\t\t\t\t}else{\n\t\t\t\t\t$result=\"NO DATA AVAILABLE\";\n\t\t\t\t}\n\t\t}\n\t\treturn $result;\n\t\n\t}", "public function leftOuter($table, array $optionalTables = array())\n\t{\n\t\t$preparedTablesArray = $this->_getPreparedTableObjects($table, $optionalTables);\n\t\t$this->join->leftOuter($preparedTablesArray['table'], $preparedTablesArray['optionalTables']);\n\n\t\treturn $this;\n\t}", "public function naturalJoin($table);", "public function testBuildJoinDefault()\n {\n $query = $this->getQuery()\n ->table('table1')\n ->join(\n $this->getQuery()\n ->table('table2')\n ->joinOn('id', 'id')\n )\n ;\n\n $this->assertSame(\n 'LEFT JOIN table2 ON table1.id = table2.id',\n $query->buildJoin()\n );\n }", "function joinLeft($field, $select, $foreign) {\n\t\tif ($select instanceof LinqSelect) {\n\t\t\t$this->join[] = array(\"LEFT\", $field, $select, $foreign);\n\t\t} else {\n\t\t\tdie(\"Not valid table\");\n\t\t}\n\t\treturn $this;\n\t}", "public function outerJoin($className, $field = null) {\n return $this->joinHelper($className, $field, $this->outerJoin);\n }", "public function leftJoin() {\r\n\t\t$args = func_get_args();\r\n\t\t$name = array_shift($args);\r\n\t\t$joined = array_shift($args);\r\n\t\tif (!$name) $name = '___' . $joined;\r\n\t\t//if (count(array_keys(self::$_joinStack, $joined)) > 1) {\r\n\t\tif (in_array($joined, self::$_joinStack)) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tself::$_joinStack[] = get_class($this);\r\n\t\tself::$_joinStack[] = $joined;\r\n\t\t$model = null;\r\n\t\tif (is_string($joined)) {\r\n\t\t\tif (is_subclass_of($joined, 'Dbi_Model')) {\r\n\t\t\t\t$model = new $joined();\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tif (is_subclass_of($joined, 'Dbi_Model')) {\r\n\t\t\t\t$model = $joined;\r\n\t\t\t}\r\n\t\t}\r\n\t\tarray_pop(self::$_joinStack);\r\n\t\tarray_pop(self::$_joinStack);\r\n\t\tif (is_null($model)) {\r\n\t\t\tthrow new Exception('Queries can only join models.');\r\n\t\t}\r\n\t\t$this->_leftJoins[] = array(\r\n\t\t\t'name' => $name,\r\n\t\t\t'model' => $model,\r\n\t\t\t'args' => $args\r\n\t\t);\r\n\t}", "public function leftJoin(string $table, string $local_column, string $operator, string $joined_column, bool $is_pivot = false)\n {\n $this->join($table, $local_column, $operator, $joined_column, $is_pivot, 'left join');\n \n return $this;\n }", "function joinQuery()\n {\n }", "public function leftJoin(string $tableName, string $tableAlias = null, string $conditions = null): self {\r\n return $this -> addJoin('left', $tableName, $tableAlias, $conditions);\r\n }", "function return_join_table_data($rt_or_left_or_none,$tableleft,$tableright,$on_a_and_b,$whereby=null,$orderby=null,$returnrows=\"a.*,b.*\") {\n\t$q = \"\n\tSELECT \".$returnrows.\"\n\tFROM \".$tableleft.\" AS a \".$rt_or_left_or_none.\" JOIN \".$tableright.\" AS b ON \".$on_a_and_b.\" \n\t\".$whereby.\" \n\t\".$orderby.\" \n\t\";\n\t//echo $q;\n\t$r = mysql_query($q) or die(\"return_join_table_data($rt_or_left_or_none,$tableleft,$tableright): \".mysql_error());\n\treturn check_results($r);\n}", "function join($table, &$query) {\r\n $left = $query->get_table_info($this->left_table);\r\n $output = \" $this->type JOIN {\" . $this->table . \"} $table[alias] ON ($this->left_query) = $table[alias].$this->field\";\r\n\r\n // Tack on the extra.\r\n if (isset($this->extra)) {\r\n if (is_array($this->extra)) {\r\n $extras = array();\r\n foreach ($this->extra as $info) {\r\n $extra = '';\r\n // Figure out the table name. Remember, only use aliases provided\r\n // if at all possible.\r\n $join_table = '';\r\n if (!array_key_exists('table', $info)) {\r\n $join_table = $table['alias'] . '.';\r\n }\r\n elseif (isset($info['table'])) {\r\n $join_table = $info['table'] . '.';\r\n }\r\n\r\n // And now deal with the value and the operator. Set $q to\r\n // a single-quote for non-numeric values and the\r\n // empty-string for numeric values, then wrap all values in $q.\r\n $raw_value = $this->db_safe($info['value']);\r\n $q = (empty($info['numeric']) ? \"'\" : '');\r\n\r\n if (is_array($raw_value)) {\r\n $operator = !empty($info['operator']) ? $info['operator'] : 'IN';\r\n // Transform from IN() notation to = notation if just one value.\r\n if (count($raw_value) == 1) {\r\n $value = $q . array_shift($raw_value) . $q;\r\n $operator = $operator == 'NOT IN' ? '!=' : '=';\r\n }\r\n else {\r\n $value = \"($q\" . implode(\"$q, $q\", $raw_value) . \"$q)\";\r\n }\r\n }\r\n else {\r\n $operator = !empty($info['operator']) ? $info['operator'] : '=';\r\n $value = \"$q$raw_value$q\";\r\n }\r\n $extras[] = \"$join_table$info[field] $operator $value\";\r\n }\r\n\r\n if ($extras) {\r\n if (count($extras) == 1) {\r\n $output .= ' AND ' . array_shift($extras);\r\n }\r\n else {\r\n $output .= ' AND (' . implode(' ' . $this->extra_type . ' ', $extras) . ')';\r\n }\r\n }\r\n }\r\n else if ($this->extra && is_string($this->extra)) {\r\n $output .= \" AND ($this->extra)\";\r\n }\r\n }\r\n return $output;\r\n }", "public function naturalJoin($table)\n\t{\n\t\treturn $this->joinInternal('NATURAL JOIN', $table);\n\t}", "public function leftJoin($fromAlias, $join, $alias, $condition = null)\n\t{\n\t\t$join = $this->getTableName($join, ConnectionManager::MODE_READ);\n\n\t\treturn parent::leftJoin($fromAlias, $join, $alias, $condition);\n\t}", "public function crossJoin($table);", "public function testBuildJoinDefaultWithTwoJoinOn()\n {\n $query = $this->getQuery()\n ->table('table1')\n ->join(\n $this->getQuery()\n ->table('table2')\n ->joinOn('id', 'id')\n ->joinOn('user_id', 'type_id')\n )\n ;\n\n $this->assertSame(\n 'LEFT JOIN table2 ON table1.id = table2.id AND table1.user_id = table2.type_id',\n $query->buildJoin()\n );\n }", "function dt_core_join_left_filter( $parts ) {\n\tif( isset($parts['join']) && !empty($parts['join']) ) {\n\t\t$parts['join'] = str_replace( 'INNER', 'LEFT', $parts['join']);\n\t}\n\treturn $parts;\n}", "public function addLeftJoinOn($table, $where)\n {\n //argument test\n Argument::i()\n //Argument 1 must be a string\n ->test(1, 'string')\n //Argument 2 must be a string\n ->test(2, 'string');\n \n $where = func_get_args();\n $table = array_shift($where);\n \n $this->join[] = array(self::LEFT, $table, $where, false);\n \n return $this;\n }", "public function outer($table, $on, $field = null, $comparitor = null);", "public function leftJoin($fromAlias, $join, $alias, $condition = null)\n {\n return $this->add('join', array(\n $fromAlias => array(\n 'joinType' => 'left',\n 'joinTable' => $join,\n 'joinAlias' => $alias,\n 'joinCondition' => $condition\n )\n ), true);\n }", "public function join()\n {\n $this->defaultjoinsetted = true;\n if (!empty($this->entity_link_list)) {\n foreach ($this->entity_link_list as $entity_link) {\n $this->defaultjoin .= \" left join `\" . strtolower(get_class($entity_link)) . \"` on \" . strtolower(get_class($entity_link)) . \".id = \" . $this->table . \".\" . strtolower(get_class($entity_link)) . \"_id\";\n }\n }\n return $this;\n }", "public function join($table, $alias = NULL, $condition = NULL, $arguments = []);", "public function leftjoin($classname, $classnameon = \"\")\n {\n $this->join = strtolower($classname);\n\n if (!$classnameon)\n $classnameon = $this->objectName;\n\n $from = '';\n// if($this->sequence == 'delete')\n// $from = \" from `\" . $this->table . \"` \";\n // on \".strtolower(get_class($entity)).\".id = \".strtolower(get_class($entity_owner)).\".\".strtolower(get_class($entity)).\"_id\n $this->query .= $from . \" left join `\" . $this->join . \"` on \" . $this->join . \".id = \" . strtolower($classnameon) . \".\" . $this->join . \"_id\";\n// $this->query .= \" left join `\" . $this->join . \"` \";\n $this->sequence = '';\n\n return $this;\n }", "public function outerJoin(string $name, ?string $alias = null, ?string $condition = null): Query\n {\n $this->resetStatement();\n $key = $alias ?? $name;\n $this->tables[$key] = new Table($name, $alias, 'OUTER JOIN', $condition);\n return $this;\n }", "public function innerJoin($table);", "public function leftJoin(\n $joined,\n $on = null,\n $fields = [],\n $additionalJoins = [],\n $grouped = false,\n $iterator = null\n ) {\n $relations = explode('~', $joined, 2);\n $modelClass = $relations[0];\n if (!class_exists($modelClass)) {\n throw new Exceptions\\ModelNotFoundException($modelClass);\n }\n if (count($relations) === 2) { // Index\n throw new Exceptions\\UnsupportedActionException('Cannot perform LEFT JOIN <index>');\n } else {// Model\n if (is_string($on)) {\n $on = new Expressions\\Conditions\\Generic($on, null, $this);\n }\n $this->withVirtualFields(\n $fields,\n function ($model, $field) use ($modelClass, $joined, $on, $grouped, $additionalJoins) {\n $mongoNotationOn = $on->mongoNotation;\n $modelName = ClassFinder::getClassBasename(get_class($this));\n\n $queryData = [];\n $fieldsInConditions = [];\n // @TODO: optimization: move this out of the callback\n $joinedModelKey = null;\n foreach ($mongoNotationOn as $left => $right) {\n // @TODO: nested conditions\n $leftField = (new \\Zer0\\Model\\Subtypes\\Field($left))->parseName();\n if ($right instanceof \\Zer0\\Model\\Subtypes\\Field) {\n // Field - Field predicate\n $rightField = $right->parseName();\n\n // If 'base.field = joined.field'\n if (isset($leftField['model']) && $modelName === $leftField['model']) {\n // then reverse it\n unset($mongoNotationOn[$left]);\n $mongoNotationOn[(string)$right] = new \\Zer0\\Model\\Subtypes\\Field($left);\n [$left, $right] = [$right, $left];\n [$leftField, $rightField] = [$rightField, $leftField];\n }\n unset($mongoNotationOn[(string)$left]);\n $mongoNotationOn[$leftField['name']] =\n new \\Zer0\\Model\\Subtypes\\Placeholder(count($queryData));\n // Base (right) model values to pass to where() on joined model\n if (is_array($model)) {\n throw new \\Exception('generic model array problem');\n }\n $queryData[] = $model->values($rightField['name']);\n $fieldsInConditions[] = $rightField['name'];\n $joinedModelKey = $leftField['name'];\n } else {\n // Field - Value predicate\n unset($mongoNotationOn[(string)$left]);\n $mongoNotationOn[$leftField['name']] = $right;\n }\n }\n\n $origModelKey = $fieldsInConditions[0]; // @TODO: foreach\n $on->setValues($queryData);\n $on = $on->mutateWithMongoNotation($mongoNotationOn);\n $joinedData = [];\n\n // Fetch data from joined model\n $models = $modelClass::where((string)$on, $on->getValues());\n if (isset($additionalJoins) && count($additionalJoins)) {\n foreach ($additionalJoins as $joinItem) {\n $models = $models->withVirtualFields($joinItem);\n }\n }\n $models = $models->load();\n foreach ($models as $item) {\n if ($grouped) {\n if (!isset($joinedData[$item[$joinedModelKey]])) {\n $joinedData[$item[$joinedModelKey]] = [];\n }\n $joinedData[$item[$joinedModelKey]] [] = $item;\n } else {\n $joinedData[$item[$joinedModelKey]] = $item;\n }\n }\n if ($grouped) {\n foreach ($model->values($joinedModelKey) as $k) {\n if (!isset($joinedData[$k])) {\n $joinedData[$k] = [];\n }\n }\n }\n $model->addDataFromJoin(\n $origModelKey,\n $joinedData,\n $field\n );\n },\n $iterator\n );\n }\n return $this;\n }", "private function joins()\r\n {\r\n /* SELECT* FROM DOCUMENT WHERE DOCUMENT.\"id\" IN ( SELECT ID FROM scholar WHERE user_company_id = 40 )*/\r\n\r\n $query = EyufScholar::find()\r\n ->select('id')\r\n ->where([\r\n 'user_company_id' => 40\r\n ])\r\n ->sql();\r\n\r\n $table = EyufDocument::find()\r\n ->where('\"id\" IN ' . $query)\r\n ->all();\r\n\r\n $second = EyufDocument::findAll(EyufScholar::find()\r\n ->select('id')\r\n ->where([\r\n 'user_company_id' => 40\r\n ])\r\n );\r\n\r\n vdd($second);\r\n }", "public function crossJoin($table)\n\t{\n\t\treturn $this->joinInternal('CROSS JOIN', $table);\n\t}", "function buildJoin()\n\t{\n\t\tif ($this->table_obj_reference)\n\t\t{\n\t\t\t// Use inner join instead of left join to improve performance\n\t\t\treturn \"JOIN \".$this->table_obj_reference.\" ON \".$this->table_tree.\".child=\".$this->table_obj_reference.\".\".$this->ref_pk.\" \".\n\t\t\t\t \"JOIN \".$this->table_obj_data.\" ON \".$this->table_obj_reference.\".\".$this->obj_pk.\"=\".$this->table_obj_data.\".\".$this->obj_pk.\" \";\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Use inner join instead of left join to improve performance\n\t\t\treturn \"JOIN \".$this->table_obj_data.\" ON \".$this->table_tree.\".child=\".$this->table_obj_data.\".\".$this->obj_pk.\" \";\n\t\t}\n\t}", "private static function sqlJoining() : string {\n $relations = self::getsRelationsHasOne();\n\n $baseTable = static::tableName();\n $baseProperties = self::getProperties();\n foreach ($baseProperties as &$property) {\n $property = $baseTable . '.' . $property;\n }\n $colsFromBaseTabel = implode(', ', $baseProperties);\n $colsFromJoinedTables = '';\n foreach ($relations as $relation) {\n $modelNamespace = '\\\\' . $relation['model'];\n $modelTableName = $modelNamespace::tableName();\n $modelProperties = $modelNamespace::getProperties();\n foreach ($modelProperties as $key => &$value) {\n $value = $modelTableName . '.' . $value . ' AS ' . $modelTableName . '_' . $value;\n }\n $colsFromJoinedTables .= ', ' . implode(', ', $modelProperties);\n\n }\n $sql = 'SELECT ' . $colsFromBaseTabel . ' ' . $colsFromJoinedTables . ' FROM ' . $baseTable;\n\n foreach ($relations as $relation) {\n $modelNamespace = '\\\\' . $relation['model'];\n $modelTableName = $modelNamespace::tableName();\n $sql .= ' INNER JOIN ' . $modelTableName . ' ON ' . $baseTable . '.' . $relation['column'] . ' = ' . $modelTableName . '.' . $relation['joined-table-column'];\n }\n\n return $sql . ' WHERE ' . $baseTable . '.';\n }", "public function addLeftJoinUsing($table, $where)\n {\n //argument test\n Argument::i()\n //Argument 1 must be a string\n ->test(1, 'string')\n //Argument 2 must be a string\n ->test(2, 'string');\n \n $where = func_get_args();\n $table = array_shift($where);\n \n $this->join[] = array(self::LEFT, $table, $where, true);\n \n return $this;\n }", "public function testBuildJoinDefaultWithAliases()\n {\n $query = $this->getQuery()\n ->table('table1')\n ->alias('table1_alias')\n ->join(\n $this->getQuery()\n ->table('table2')\n ->alias('table2_alias')\n ->joinOn('id', 'id')\n )\n ;\n\n $this->assertSame(\n 'LEFT JOIN table2 AS table2_alias ON table1_alias.id = table2_alias.id',\n $query->buildJoin()\n );\n }", "public function joinLeasedOutUser() {\n $sqlSelect = $this->tableGateway->getSql()->select();\n\t\t$sqlSelect\n ->columns(array('Id','requestedTime','returnedTime','userId','returnedTime','assetId'));\n $sqlSelect\n ->join('UserInfoTable', 'UserInfoTable.Id = leasedoutuserTable.userId', array('firstname','email'), 'inner');\n $sqlSelect\n ->join('AssetInfoTable', 'AssetInfoTable.AssetId = leasedoutuserTable.assetId', array('AssetName','AssetStatus','AssetDesc'), 'inner');\n $statement \n = $this->tableGateway->getSql()->prepareStatementForSqlObject($sqlSelect);\n\t\t$resultSet = $statement->execute();\n\t\treturn $resultSet;\n\n }", "public function leftJoin(string $name, ?string $alias = null, ?string $condition = null): Query\n {\n $this->resetStatement();\n $key = $alias ?? $name;\n $this->tables[$key] = new Table($name, $alias, 'LEFT JOIN', $condition);\n return $this;\n }", "protected function joining_table()\n {\n return $this->connection()->table($this->joining);\n }", "protected function left_join($new_column, $column, $operator, $column2){\n\n\t\tlist($this_table, $this_table_coulmn) = explode('.', $column);\n\t\tlist($second_table, $second_table_column) = explode('.', $column2);\n\n\t\t$this_results = $this->_t();\n\n\t\tif($this_results){\n\n\t\t\tforeach($this_results as $file_id => &$row){\n\t\t\t\t\n\t\t\t\tif($new_column == '*'){\n\n\t\t\t\t\t$selection = $second_table::where($second_table_column, $operator, $row->$this_table_coulmn)->get();\n\n\t\t\t\t\tif($selection){\n\n\t\t\t\t\t\t$selection_qty = count(static::object_to_array($selection));\n\n\t\t\t\t\t\tforeach ($selection as $selected_file_id => &$selected_row) {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tforeach ($selected_row as $column => $value) {\n\n\t\t\t\t\t\t\t\tif($selection_qty > 1){\n\n\t\t\t\t\t\t\t\t\t$this_results[$file_id]->{$second_table.'.'.$column}[$selected_file_id] = $value;\n\n\t\t\t\t\t\t\t\t}else{\n\n\t\t\t\t\t\t\t\t\t$this_results[$file_id]->{$second_table.'.'.$column} = $value;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tunset($selected_file_id, $selected_row);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t}else{\n\n\t\t\t\t\tif(is_array($new_column)){\n\n\t\t\t\t\t\t$selection = $second_table::where($second_table_column, $operator, $row->$this_table_coulmn)->only($new_column);\n\n\t\t\t\t\t\tif($selection){\n\n\t\t\t\t\t\t\t$selection_qty = count(static::object_to_array($selection));\n\n\t\t\t\t\t\t\tforeach ($selection as $key => &$selected_array){\n\n\t\t\t\t\t\t\t\tforeach ($selected_array as $column => &$value) {\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t$this_results[$file_id]->{$second_table.'.'.$column}[$key] = $selected_array[$column];\n\n\t\t\t\t\t\t\t\t\tunset($column, $value);\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tunset($key, $selected_array);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}else{\n\n\t\t\t\t\t\t$selection = $second_table::where($second_table_column, $operator, $row->$this_table_coulmn)->only($new_column);\n\n\t\t\t\t\t\tif($selection){\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t$this_results[$file_id]->{$second_table.'.'.$new_column} = $selection;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tunset($file_id, $row);\n\t\t\t}\n\t\t}\n\n\t\tif($this_results){\n\n\t\t\t$this->_t_set($this_results);\n\t\t}\n\n\t\tunset($this_results);\n\n\t\treturn $this;\n\t}", "public function get_additional_joins()\n {\n return 'LEFT JOIN isys_catg_its_type_list AS cat_rel\n\t\t\tON cat_rel.isys_catg_its_type_list__isys_obj__id = obj_main.isys_obj__id';\n }", "public function basic_join_setup()\r\n {\r\n \r\n }", "public function ON($left_field_name, $right_field_name, $left_table_offset = -2, $right_table_offset = null) {\n\t\t$jointset = $this->lastSet('joint') ;\n\t\tif (!$jointset) $jointset = $this->add_SET('joint');\n\n\t\t$left_ptr = $this->fieldByAlias($left_field_name);\n\t\tif (!$left_ptr) $left_ptr = $this->add_FIELD($left_field_name, null, $this->lastTable($left_table_offset), null);\n\n\t\t$right_ptr = $this->fieldByAlias($right_field_name);\n\t\tif (!$right_ptr) $right_ptr = $this->add_FIELD($right_field_name, null, $this->lastTable($right_table_offset), null);\n\n\t\t//remove right_ptr->table from tableset?\n\t\t$this->rem_TABLE($right_ptr->asTable());\n\n\t\t$this->add_JOIN($left_ptr, $right_ptr, $jointset);\n\t}", "public function join($table, $on, $field = null, $comparitor = null);", "public function ADD_ON($left_right_map, $left_table_offset = -2, $right_table_offset = null) {\n\t\t$left_field_name = key($left_right_map);\n\t\t$right_field_name = current($left_right_map); \n\t\treturn $this->ON($left_field_name, $right_field_name, $left_table_offset, $right_table_offset);\n\t}", "public function join($table, $one, $operator = null, $two = null, $type = 'inner', $where = false)\n {\n throw new NotImplementedException('Joins are not implemented in Crate');\n }", "public function view_join_one($table1, $table2, $field, $order, $ordering)\n {\n $this->db->select('*');\n $this->db->from($table1);\n $this->db->join($table2, $table1 . '.' . $field . '=' . $table2 . '.' . $field);\n $this->db->order_by($order, $ordering);\n return $this->db->get()->result();\n }", "public function left($table, array $optionalTables = array())\n\t{\n\t\t$preparedTablesArray = $this->_getPreparedTableObjects($table, $optionalTables);\n\t\t$this->join->left($preparedTablesArray['table'], $preparedTablesArray['optionalTables']);\n\n\t\treturn $this;\n\t}", "public function leftJoinOn($table, $where)\n {\n //argument test\n Argument::i()\n //Argument 1 must be a string\n ->test(1, 'string')\n //Argument 2 must be a string\n ->test(2, 'string');\n \n $where = func_get_args();\n $table = array_shift($where);\n \n $this->join[] = array(self::LEFT, $table, $where, false);\n \n return $this;\n }", "public function straightJoin($table, array $fields, array $on = []) {\n return $this->_addJoin(Join::STRAIGHT, $table, $fields, $on);\n }", "function query_main_join( $sql, $engine ) {\n\t\tglobal $wpdb;\n\n\t\tif ( isset( $engine ) ) {\n\t\t\t$engine = null;\n\t\t}\n\n\t\t// if WooCommerce is sorting results we need to tell SearchWP to return them in that order\n\t\tif ( $this->is_woocommerce_search() ) {\n\n\t\t\tif ( ! isset( $this->ordering['wc_orderby'] ) ) {\n\t\t\t\t$this->get_woocommerce_ordering();\n\t\t\t}\n\n\t\t\t// depending on the sorting we need to do different things\n\t\t\tif ( isset( $this->ordering['wc_orderby'] ) ) {\n\t\t\t\tswitch ( $this->ordering['wc_orderby'] ) {\n\t\t\t\t\tcase 'price':\n\t\t\t\t\tcase 'price-desc':\n\t\t\t\t\tcase 'popularity':\n\t\t\t\t\t\t$meta_key = 'price' === $this->ordering['wc_orderby'] ? '_price' : 'total_sales';\n\t\t\t\t\t\t$sql = $sql . $wpdb->prepare( \" LEFT JOIN {$wpdb->postmeta} AS swpwc ON {$wpdb->posts}.ID = swpwc.post_id AND swpwc.meta_key = %s\", $meta_key );\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'rating':\n\t\t\t\t\t\t$sql = $sql . \" LEFT OUTER JOIN {$wpdb->comments} swpwpcom ON({$wpdb->posts}.ID = swpwpcom.comment_post_ID) LEFT JOIN {$wpdb->commentmeta} swpwpcommeta ON(swpwpcom.comment_ID = swpwpcommeta.comment_id) \";\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// for visibility we always need to join postmeta\n\t\t\tif ( function_exists( 'WC' ) && ! empty( WC()->version ) && version_compare( WC()->version, '2.6.0', '<' ) ) { // Moved to a taxonomy\n\t\t\t\t$sql = $sql . \" INNER JOIN {$wpdb->postmeta} as woovisibility ON {$wpdb->posts}.ID = woovisibility.post_id \";\n\t\t\t}\n\n\t\t}\n\n\t\treturn $sql;\n\t}", "public function testJoinWithoutAlias()\n {\n $query = (new Select($this->mockConnection))->join('join', 'join.tableId', '=', 'table.id');\n $array = $query->toArray();\n\n $this->assertInstanceOf(Select::class, $query);\n $this->assertArrayHasKey('join', $array);\n $this->assertCount(1, $array['join']);\n $this->assertEquals([\n 'type' => 'inner',\n 'table' => 'join',\n 'alias' => null,\n 'statement' => [\n 'where' => [\n [\n 'column' => 'join.tableId',\n 'operator' => '=',\n 'value' => 'table.id',\n 'boolean' => 'and',\n ]\n ],\n ]\n ], $array['join'][0]);\n $this->assertInstanceOf(Column::class, $array['join'][0]['statement']['where'][0]['value']);\n }", "protected function append_product_sorting_table_join( $sql ) {\n\t\tglobal $wpdb;\n\n\t\tif ( ! strstr( $sql, 'wc_product_meta_lookup' ) ) {\n\t\t\t$sql .= \" LEFT JOIN {$wpdb->wc_product_meta_lookup} wc_product_meta_lookup ON $wpdb->posts.ID = wc_product_meta_lookup.product_id \";\n\t\t}\n\t\treturn $sql;\n\t}", "public function rightJoin($table, $conditions = []);", "private static function selectAndJoins()\n {\n $sql = \"SELECT * FROM \" . dbPerformance::DBNAME;\n\n $sql .= \" INNER JOIN \" . dbCompetition::DBNAME . \" ON \" . dbPerformance::DBNAME . \".\" . dbPerformance::COMPETITOINID . \" = \" . dbCompetition::DBNAME . \".\" . dbCompetition::ID;\n $sql .= \" INNER JOIN \" . dbDisziplin::DBNAME . \" ON \" . dbPerformance::DBNAME . \".\" . dbPerformance::DISZIPLINID . \" = \" . dbDisziplin::DBNAME . \".\" . dbDisziplin::ID;\n $sql .= \" INNER JOIN \" . dbAthletes::DBNAME . \" ON \" . dbPerformance::DBNAME . \".\" . dbPerformance::ATHLETEID . \" = \" . dbAthletes::DBNAME . \".\" . dbAthletes::ID;\n $sql .= \" LEFT JOIN \" . dbPerformanceDetail::DBNAME . \" ON \" . dbPerformance::DBNAME . \".\" . dbPerformance::ID . \" = \" . dbPerformanceDetail::DBNAME . \".\" . dbPerformanceDetail::PERFORMANCEID;\n\n $sql .= \" INNER JOIN \" . dbCompetitionLocations::DBNAME . \" ON \" . dbCompetition::DBNAME . \".\" . dbCompetition::LOCATIONID . \" = \" . dbCompetitionLocations::DBNAME . \".\" . dbCompetitionLocations::ID;\n $sql .= \" INNER JOIN \" . dbCompetitionNames::DBNAME . \" ON \" . dbCompetition::DBNAME . \".\" . dbCompetition::NAMEID . \" = \" . dbCompetitionNames::DBNAME . \".\" . dbCompetitionNames::ID;\n return $sql;\n }", "public function leftJoinUsing($table, $where)\n {\n //argument test\n Argument::i()\n //Argument 1 must be a string\n ->test(1, 'string')\n //Argument 2 must be a string\n ->test(2, 'string');\n \n $where = func_get_args();\n $table = array_shift($where);\n \n $this->join[] = array(self::LEFT, $table, $where, true);\n \n return $this;\n }", "public function _complex_join()\n {\n // LEFT JOIN `%1$sauth_group` on `%1$spro`.`depid` = `%1$sauth_group`.`id`\n // LEFT JOIN (SELECT a.* FROM `%1$sproout` as a INNER JOIN (SELECT max(`id`) as id FROM `%1$sproout` group by `jpid`) as b on a.id = b.id) as `%1$sproout` on `%1$spro`.`id` = `%1$sproout`.`jpid`\n // LEFT JOIN `%1$scust` on `%1$spro`.`cid` = `%1$scust`.`id`', C('DB_PREFIX'));\n\n $join = sprintf('LEFT JOIN `%1$sproin` ON `%1$spro`.`id` = `%1$sproin`.`jpid`\n LEFT JOIN `%1$sauth_group` on `%1$spro`.`depid` = `%1$sauth_group`.`id`\n LEFT JOIN `%1$sproout` on `%1$sproout`.`jpid` = `%1$spro`.`id`\n LEFT JOIN `%1$sproout` tmp_out on tmp_out.`jpid` = `%1$sproout`.`jpid` and tmp_out.`id` > `%1$sproout`.`id`\n LEFT JOIN `%1$scust` on `%1$spro`.`cid` = `%1$scust`.`id`', C('DB_PREFIX'));\n return $join;\n }", "protected function applyPrejoin($query)\n {\n if (count($this->prejoin)>0) {\n foreach ($this->prejoin as $prejoin) {\n $DBColumn = QueryColumnFactoryStorage::byValueKey($prejoin);\n\n if (!$DBColumn->isFetchable()) {\n continue;\n }\n\n if ($DBColumn->needsJoin()) {\n $query->join($DBColumn);\n }\n }\n }\n }", "function cf_search_join( $join ) {\n\t\tglobal $wpdb;\n\n\t\tif ( is_search() ) {\n\t\t\t$join .= ' LEFT JOIN ' . $wpdb->postmeta . ' ON ' . $wpdb->posts . '.ID = ' . $wpdb->postmeta . '.post_id ';\n\t\t}\n\n\t\treturn $join;\n\t}", "public function join($sql) {\n $this->__join__ = $sql;\n return $this;\n }", "public function outerJoinOn($table, $where)\n {\n //argument test\n Argument::i()\n //Argument 1 must be a string\n ->test(1, 'string')\n //Argument 2 must be a string\n ->test(2, 'string');\n \n $where = func_get_args();\n $table = array_shift($where);\n \n $this->join[] = array(self::OUTER, $table, $where, false);\n \n return $this;\n }", "public function joinBase()\n {\n return $this->_joins[0];\n }", "protected function get_join_sql(array $filters=array()) {\n $joinsql = parent::get_join_sql($filters);\n $joinsql[] = 'LEFT JOIN {'.clusterassignment::TABLE.'} clstass\n ON clstass.clusterid='.$this->usersetid.'\n AND clstass.userid = element.id';\n return $joinsql;\n }", "function cf_search_join( $join ) {\n\t global $wpdb;\n\n\t if ( is_search() ) { \n\t $join .=' LEFT JOIN '.$wpdb->postmeta. ' ON '. $wpdb->posts . '.ID = ' . $wpdb->postmeta . '.post_id ';\n\t }\n\t \n\t return $join;\n\t}", "public function join($tables, $overwrite = false);", "protected function getLeftJoins()\n {\n return array(\n \"rr\" => \"entity.requiredExerciseResources\",\n \"rk\" => \"entity.requiredKnowledges\"\n );\n }", "public function joinOn($tableJoin, $columnJoin, $tableOn, $columnOn);", "public function addOuterJoinOn($table, $where)\n {\n //argument test\n Argument::i()\n //Argument 1 must be a string\n ->test(1, 'string')\n //Argument 2 must be a string\n ->test(2, 'string');\n \n $where = func_get_args();\n $table = array_shift($where);\n \n $this->join[] = array(self::OUTER, $table, $where, false);\n \n return $this;\n }", "public function __toString()\n {\n if (!isset($this->_from[0]['table']) || !$this->_from[0]['table']) {\n //sanity check\n return '';\n }\n\n $sql = \"SELECT \";\n\n $column_parts = array();\n $from_parts = array();\n\n foreach ($this->_from as $from) {\n $table_key = (is_array($from['table'])) ? key($from['table']) : $from['table'];\n\n foreach ($from['columns'] as $column_key => $column_name) {\n if (strpos($column_name, '(') === false && strpos($column_name, '.') === false) {\n //This is NOT an expression and does not yet have \".\", add tbl name\n $column_name = $table_key . '.' . $column_name;\n }\n\n if (!geoString::isInt($column_key)) {\n $column_name .= ' AS ' . $column_key;\n }\n $column_parts[] = $column_name;\n }\n\n //figure out from\n switch ($from['join_type']) {\n case 'primary':\n //special case, this is first table, don't need to add join type\n $from_str = '';\n break;\n\n case self::JOIN_LEFT:\n $from_str = 'LEFT JOIN ';\n break;\n\n case self::JOIN_INNER:\n //break ommitted on purpose\n default:\n $from_str = 'INNER JOIN ';\n break;\n }\n\n if (is_array($from['table'])) {\n //using array(table_alias => table_name)\n $table = $from['table'];\n reset($table);\n $from_str .= current($table) . ' AS ' . key($table);\n } else {\n //simple string for table\n $from_str .= $from['table'];\n }\n if ($from['on'] && is_array($from['on'])) {\n $from_str .= ' ON ' . implode(' AND ', $from['on']);\n } elseif ($from['on']) {\n $from_str .= ' ON ' . $from['on'];\n }\n $from_parts [] = $from_str;\n }\n $sql .= implode(', ', $column_parts) . \"\\n\\tFROM \" . implode(\"\\n\\t\\t\", $from_parts);\n\n $where = $this->_where;\n\n if ($this->_orWhere) {\n //add all the OR's to the thingy\n foreach ($this->_orWhere as $name => $orWhere) {\n $where[$name] = \"(\" . implode(' OR ', $orWhere) . \")\";\n }\n }\n\n if ($where) {\n $sql .= \"\\n\\tWHERE \" . implode(' AND ', $where);\n }\n\n if ($this->_group) {\n $sql .= \"\\n\\tGROUP BY \" . implode(', ', $this->_group);\n }\n\n if ($this->_order) {\n $sql .= \"\\n\\tORDER BY \" . implode(', ', $this->_order);\n }\n\n if ($this->_count || $this->_offset) {\n $sql .= \"\\n\\tLIMIT {$this->_count}\";\n if ($this->_offset) {\n $sql .= \", {$this->_offset}\";\n }\n }\n\n return $sql;\n }", "public function outerJoinUsing($table, $where)\n {\n //argument test\n Argument::i()\n //Argument 1 must be a string\n ->test(1, 'string')\n //Argument 2 must be a string\n ->test(2, 'string');\n \n $where = func_get_args();\n $table = array_shift($where);\n \n $this->join[] = array(self::OUTER, $table, $where, true);\n \n return $this;\n }", "function cf_search_join($join) {\n global $wpdb;\n\n if (is_search()) {\n $join .=' LEFT JOIN ' . $wpdb->postmeta . ' ON ' . $wpdb->posts . '.ID = ' . $wpdb->postmeta . '.post_id ';\n }\n\n return $join;\n}", "protected function performJoins()\n {\n $query = $this->query;\n\n $predecessor = $this->related;\n\n $this->through_parents->each(function ($model) use ($query, &$predecessor) {\n $first = $predecessor->getQualifiedKeyName();\n $joined = $model->qualifyColumn($this->getForeignKeyName($predecessor));\n\n $query->join($model->getTable(), $first, '=', $joined);\n\n if ($this->hasSoftDeletes($model)) {\n $this->query->whereNull($model->getQualifiedDeletedAtColumn());\n }\n\n $predecessor = $model;\n });\n }", "private function sql_join($filter, $structure) {\n\t\t$sql = \"\";\n\t\t$table = $structure['table'];\n\t\t$class = $structure['class'];\n\t\t$pool_class = $class . 'Pool_Model';\n\t\t$full_structure = $pool_class::get_full_structure();\n\t\tforeach ($structure['relations'] as $relation) {\n\t\t\tlist($foreign_key, $foreign_table, $key) = $relation;\n\t\t\t$foreign_structure = $full_structure[$foreign_table];\n\t\t\t$ftable = $foreign_structure['table'];\n\t\t\t$join_expr = ' LEFT JOIN '.$ftable.' AS '.$key;\n\t\t\t$join_expr .= ' ON '.implode(' AND ',array_map(function($fk,$lk) use($key,$table) {\n\t\t\t\treturn \"$key.$fk = $table.$lk\";\n\t\t\t}, $foreign_structure['key'], $foreign_key));\n\t\t\t$sql .= $join_expr;\n\t\t}\n\t\treturn $sql;\n\t}", "public function leftjoinrecto($classname, $classnameon = \"\")\n {\n $this->join = strtolower($classname);\n\n if (!$classnameon)\n $classnameon = $this->objectName;\n\n $from = '';\n// if($this->sequence == 'delete')\n// $from = \" from `\" . $this->table . \"` \";\n // on \".strtolower(get_class($entity)).\".id = \".strtolower(get_class($entity_owner)).\".\".strtolower(get_class($entity)).\"_id\n $this->query .= $from . \" left join `\" . $this->join . \"` on \" . $this->join . \".\" . strtolower($classnameon) . \"_id = \" . strtolower($classnameon) . \".id\";\n// $this->query .= \" left join `\" . $this->join . \"` \";\n $this->sequence = '';\n\n return $this;\n }", "public function join(Select $table, $alias, $on)\n {\n return $this->innerJoin($table, $alias, $on);\n }", "function carton_exclude_order_comments_from_feed_join( $join ) {\n\tglobal $wpdb;\n\n if ( ! $join )\n \t$join = \" LEFT JOIN $wpdb->posts ON $wpdb->comments.\\\"comment_post_ID\\\" = $wpdb->posts.\\\"ID\\\" \";\n\n return $join;\n}", "function cf_search_join( $join ) {\n global $wpdb;\n if ( is_search() ) {\n $join .=' LEFT JOIN '.$wpdb->postmeta. ' ON '. $wpdb->posts . '.ID = ' . $wpdb->postmeta . '.post_id ';\n }\n return $join;\n}", "public function fullJoin($table, $on = null)\n {\n $this->joinTokens[$this->activeJoin = $table] = ['type' => 'FULL', 'on' => []];\n\n return call_user_func_array([$this, 'on'], array_slice(func_get_args(), 1));\n }", "public function left($table, $on, $field = null, $comparitor = null);", "function cf_search_join( $join ) {\n global $wpdb;\n\n if ( is_search() ) { \n $join .=' LEFT JOIN '.$wpdb->postmeta. ' ON '. $wpdb->posts . '.ID = ' . $wpdb->postmeta . '.post_id ';\n }\n\n return $join;\n}", "public function constructInnerJoinSql(Table $fromTable, $usingThrough=false, $alias=null)\n\t{\n\t\tif ($usingThrough)\n\t\t{\n\t\t\t$joinTable = $fromTable;\n\t\t\t$joinTableName = $fromTable->getFullyQualifiedTableName();\n\t\t\t$fromTableName = Table::load($this->className)->getFullyQualifiedTableName();\n \t\t}\n\t\telse\n\t\t{\n\t\t\t$joinTable = Table::load($this->className);\n\t\t\t$joinTableName = $joinTable->getFullyQualifiedTableName();\n\t\t\t$fromTableName = $fromTable->getFullyQualifiedTableName();\n\t\t}\n\n\t\t// need to flip the logic when the key is on the other table\n\t\tif ($this instanceof HasMany || $this instanceof HasOne)\n\t\t{\n\t\t\t$this->setKeys($fromTable->class->getName());\n\n\t\t\tif ($usingThrough)\n\t\t\t{\n\t\t\t\t$foreignKey = $this->primaryKey[0];\n\t\t\t\t$joinPrimaryKey = $this->foreignKey[0];\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$joinPrimaryKey = $this->foreignKey[0];\n\t\t\t\t$foreignKey = $this->primaryKey[0];\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$foreignKey = $this->foreignKey[0];\n\t\t\t$joinPrimaryKey = $this->primaryKey[0];\n\t\t}\n\n\t\tif (!is_null($alias))\n\t\t{\n\t\t\t$aliasedJoinTableName = $alias = $this->getTable()->conn->quoteName($alias);\n\t\t\t$alias .= ' ';\n\t\t}\n\t\telse\n\t\t\t$aliasedJoinTableName = $joinTableName;\n\n\t\treturn \"INNER JOIN $joinTableName {$alias}ON($fromTableName.$foreignKey = $aliasedJoinTableName.$joinPrimaryKey)\";\n\t}", "private function addJoin(Query $other, $fieldOrExpr, $operator, $valueOrExpr, $type = 'INNER', $table, $withOtherDatas=TRUE) {\r\n\t\tif (isset($this->_salt_joins[$other->_salt_alias])) {\r\n\t\t\tthrow new SaltException(L::error_query_duplicate_join($other->_salt_alias));\r\n\t\t}\r\n\r\n\t\t$this->_salt_joins[$other->_salt_alias]=array(\r\n\t\t\t'type'=>strtoupper($type),\r\n\t\t\t'table'=>$table,\r\n\t\t\t'on'=>array(),\r\n\t\t);\r\n\r\n\t\t$absoluteField = $this->resolveFieldName(ClauseType::JOIN, $fieldOrExpr);\r\n\r\n\t\t$valueOrExpr = $this->resolveFieldName(ClauseType::JOIN, $valueOrExpr, $fieldOrExpr);\r\n\t\tif (is_array($valueOrExpr)) {\r\n\t\t\t$valueOrExpr = '('.implode(', ', $valueOrExpr).')';\r\n\t\t}\r\n\t\t$clause = $absoluteField.' '.$operator.' '.$valueOrExpr;\r\n\r\n\t\t$this->addJoinOnClause($other, 'AND', $clause);\r\n\r\n\t\tif ($withOtherDatas) {\r\n\t\t\t// Merge of others parameters\r\n\t\t\tif (count($other->_salt_fields) > 0) {\r\n\t\t\t\t$this->_salt_fields=array_merge($this->_salt_fields, $other->_salt_fields);\r\n\t\t\t\t$this->linkBindsOf($other, ClauseType::JOIN, ClauseType::SELECT);\r\n\t\t\t}\r\n\t\t\tif (count($other->_salt_wheres) > 0) {\r\n\t\t\t\t//$this->addWhereClause('AND', $other->wheres);\r\n\t\t\t\t$this->addJoinOnClause($other, 'AND', $other->_salt_wheres);\r\n\t\t\t\t$this->linkBindsOf($other, ClauseType::JOIN, ClauseType::WHERE);\r\n\t\t\t}\r\n\t\t\tif (count($other->_salt_groups) > 0) {\r\n\t\t\t\t$this->_salt_groups=array_merge($this->_salt_groups, $other->_salt_groups);\r\n\t\t\t\t$this->linkBindsOf($other, ClauseType::JOIN, ClauseType::GROUP);\r\n\t\t\t}\r\n\t\t\tif (count($other->_salt_orders) > 0) {\r\n\t\t\t\t$this->_salt_orders=array_merge($this->_salt_orders, $other->_salt_orders);\r\n\t\t\t\t$this->linkBindsOf($other, ClauseType::JOIN, ClauseType::ORDER);\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\t// join (Select ...) : link ALL binds, because we include full query text\r\n\t\t\t$this->linkBindsOf($other, ClauseType::JOIN);\r\n\t\t}\r\n\t}", "public function testCrossDatabaseJoins() {\n\t\t$config = ConnectionManager::enumConnectionObjects();\n\n\t\t$skip = (!isset($config['test']) || !isset($config['test2']));\n\t\tif ($skip) {\n\t\t\t$this->markTestSkipped('Primary and secondary test databases not configured, skipping cross-database\n\t\t\t\tjoin tests. To run theses tests defined $test and $test2 in your database configuration.'\n\t\t\t);\n\t\t}\n\n\t\t$this->loadFixtures('Article', 'Tag', 'ArticlesTag', 'User', 'Comment');\n\t\t$TestModel = new Article();\n\n\t\t$expected = array(\n\t\t\tarray(\n\t\t\t\t'Article' => array(\n\t\t\t\t\t'id' => '1',\n\t\t\t\t\t'user_id' => '1',\n\t\t\t\t\t'title' => 'First Article',\n\t\t\t\t\t'body' => 'First Article Body',\n\t\t\t\t\t'published' => 'Y',\n\t\t\t\t\t'created' => '2007-03-18 10:39:23',\n\t\t\t\t\t'updated' => '2007-03-18 10:41:31'\n\t\t\t\t),\n\t\t\t\t'User' => array(\n\t\t\t\t\t'id' => '1',\n\t\t\t\t\t'user' => 'mariano',\n\t\t\t\t\t'password' => '5f4dcc3b5aa765d61d8327deb882cf99',\n\t\t\t\t\t'created' => '2007-03-17 01:16:23',\n\t\t\t\t\t'updated' => '2007-03-17 01:18:31'\n\t\t\t\t),\n\t\t\t\t'Comment' => array(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'id' => '1',\n\t\t\t\t\t\t'article_id' => '1',\n\t\t\t\t\t\t'user_id' => '2',\n\t\t\t\t\t\t'comment' => 'First Comment for First Article',\n\t\t\t\t\t\t'published' => 'Y',\n\t\t\t\t\t\t'created' => '2007-03-18 10:45:23',\n\t\t\t\t\t\t'updated' => '2007-03-18 10:47:31'\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'id' => '2',\n\t\t\t\t\t\t'article_id' => '1',\n\t\t\t\t\t\t'user_id' => '4',\n\t\t\t\t\t\t'comment' => 'Second Comment for First Article',\n\t\t\t\t\t\t'published' => 'Y',\n\t\t\t\t\t\t'created' => '2007-03-18 10:47:23',\n\t\t\t\t\t\t'updated' => '2007-03-18 10:49:31'\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'id' => '3',\n\t\t\t\t\t\t'article_id' => '1',\n\t\t\t\t\t\t'user_id' => '1',\n\t\t\t\t\t\t'comment' => 'Third Comment for First Article',\n\t\t\t\t\t\t'published' => 'Y',\n\t\t\t\t\t\t'created' => '2007-03-18 10:49:23',\n\t\t\t\t\t\t'updated' => '2007-03-18 10:51:31'\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'id' => '4',\n\t\t\t\t\t\t'article_id' => '1',\n\t\t\t\t\t\t'user_id' => '1',\n\t\t\t\t\t\t'comment' => 'Fourth Comment for First Article',\n\t\t\t\t\t\t'published' => 'N',\n\t\t\t\t\t\t'created' => '2007-03-18 10:51:23',\n\t\t\t\t\t\t'updated' => '2007-03-18 10:53:31'\n\t\t\t\t)),\n\t\t\t\t'Tag' => array(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'id' => '1',\n\t\t\t\t\t\t'tag' => 'tag1',\n\t\t\t\t\t\t'created' => '2007-03-18 12:22:23',\n\t\t\t\t\t\t'updated' => '2007-03-18 12:24:31'\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'id' => '2',\n\t\t\t\t\t\t'tag' => 'tag2',\n\t\t\t\t\t\t'created' => '2007-03-18 12:24:23',\n\t\t\t\t\t\t'updated' => '2007-03-18 12:26:31'\n\t\t\t))),\n\t\t\tarray(\n\t\t\t\t'Article' => array(\n\t\t\t\t\t'id' => '2',\n\t\t\t\t\t'user_id' => '3',\n\t\t\t\t\t'title' => 'Second Article',\n\t\t\t\t\t'body' => 'Second Article Body',\n\t\t\t\t\t'published' => 'Y',\n\t\t\t\t\t'created' => '2007-03-18 10:41:23',\n\t\t\t\t\t'updated' => '2007-03-18 10:43:31'\n\t\t\t\t),\n\t\t\t\t'User' => array(\n\t\t\t\t\t'id' => '3',\n\t\t\t\t\t'user' => 'larry',\n\t\t\t\t\t'password' => '5f4dcc3b5aa765d61d8327deb882cf99',\n\t\t\t\t\t'created' => '2007-03-17 01:20:23',\n\t\t\t\t\t'updated' => '2007-03-17 01:22:31'\n\t\t\t\t),\n\t\t\t\t'Comment' => array(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'id' => '5',\n\t\t\t\t\t\t'article_id' => '2',\n\t\t\t\t\t\t'user_id' => '1',\n\t\t\t\t\t\t'comment' => 'First Comment for Second Article',\n\t\t\t\t\t\t'published' => 'Y',\n\t\t\t\t\t\t'created' => '2007-03-18 10:53:23',\n\t\t\t\t\t\t'updated' => '2007-03-18 10:55:31'\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'id' => '6',\n\t\t\t\t\t\t'article_id' => '2',\n\t\t\t\t\t\t'user_id' => '2',\n\t\t\t\t\t\t'comment' => 'Second Comment for Second Article',\n\t\t\t\t\t\t'published' => 'Y',\n\t\t\t\t\t\t'created' => '2007-03-18 10:55:23',\n\t\t\t\t\t\t'updated' => '2007-03-18 10:57:31'\n\t\t\t\t)),\n\t\t\t\t'Tag' => array(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'id' => '1',\n\t\t\t\t\t\t'tag' => 'tag1',\n\t\t\t\t\t\t'created' => '2007-03-18 12:22:23',\n\t\t\t\t\t\t'updated' => '2007-03-18 12:24:31'\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'id' => '3',\n\t\t\t\t\t\t'tag' => 'tag3',\n\t\t\t\t\t\t'created' => '2007-03-18 12:26:23',\n\t\t\t\t\t\t'updated' => '2007-03-18 12:28:31'\n\t\t\t))),\n\t\t\tarray(\n\t\t\t\t'Article' => array(\n\t\t\t\t\t'id' => '3',\n\t\t\t\t\t'user_id' => '1',\n\t\t\t\t\t'title' => 'Third Article',\n\t\t\t\t\t'body' => 'Third Article Body',\n\t\t\t\t\t'published' => 'Y',\n\t\t\t\t\t'created' => '2007-03-18 10:43:23',\n\t\t\t\t\t'updated' => '2007-03-18 10:45:31'\n\t\t\t\t),\n\t\t\t\t'User' => array(\n\t\t\t\t\t'id' => '1',\n\t\t\t\t\t'user' => 'mariano',\n\t\t\t\t\t'password' => '5f4dcc3b5aa765d61d8327deb882cf99',\n\t\t\t\t\t'created' => '2007-03-17 01:16:23',\n\t\t\t\t\t'updated' => '2007-03-17 01:18:31'\n\t\t\t\t),\n\t\t\t\t'Comment' => array(),\n\t\t\t\t'Tag' => array()\n\t\t));\n\t\t$this->assertEquals($expected, $TestModel->find('all'));\n\n\t\t$db2 = ConnectionManager::getDataSource('test2');\n\t\t$this->fixtureManager->loadSingle('User', $db2);\n\t\t$this->fixtureManager->loadSingle('Comment', $db2);\n\t\t$this->assertEquals(3, $TestModel->find('count'));\n\n\t\t$TestModel->User->setDataSource('test2');\n\t\t$TestModel->Comment->setDataSource('test2');\n\n\t\tforeach ($expected as $key => $value) {\n\t\t\tunset($value['Comment'], $value['Tag']);\n\t\t\t$expected[$key] = $value;\n\t\t}\n\n\t\t$TestModel->recursive = 0;\n\t\t$result = $TestModel->find('all');\n\t\t$this->assertEquals($expected, $result);\n\n\t\tforeach ($expected as $key => $value) {\n\t\t\tunset($value['Comment'], $value['Tag']);\n\t\t\t$expected[$key] = $value;\n\t\t}\n\n\t\t$TestModel->recursive = 0;\n\t\t$result = $TestModel->find('all');\n\t\t$this->assertEquals($expected, $result);\n\n\t\t$result = Hash::extract($TestModel->User->find('all'), '{n}.User.id');\n\t\t$this->assertEquals(array('1', '2', '3', '4'), $result);\n\t\t$this->assertEquals($expected, $TestModel->find('all'));\n\n\t\t$TestModel->Comment->unbindModel(array('hasOne' => array('Attachment')));\n\t\t$expected = array(\n\t\t\tarray(\n\t\t\t\t'Comment' => array(\n\t\t\t\t\t'id' => '1',\n\t\t\t\t\t'article_id' => '1',\n\t\t\t\t\t'user_id' => '2',\n\t\t\t\t\t'comment' => 'First Comment for First Article',\n\t\t\t\t\t'published' => 'Y',\n\t\t\t\t\t'created' => '2007-03-18 10:45:23',\n\t\t\t\t\t'updated' => '2007-03-18 10:47:31'\n\t\t\t\t),\n\t\t\t\t'User' => array(\n\t\t\t\t\t'id' => '2',\n\t\t\t\t\t'user' => 'nate',\n\t\t\t\t\t'password' => '5f4dcc3b5aa765d61d8327deb882cf99',\n\t\t\t\t\t'created' => '2007-03-17 01:18:23',\n\t\t\t\t\t'updated' => '2007-03-17 01:20:31'\n\t\t\t\t),\n\t\t\t\t'Article' => array(\n\t\t\t\t\t'id' => '1',\n\t\t\t\t\t'user_id' => '1',\n\t\t\t\t\t'title' => 'First Article',\n\t\t\t\t\t'body' => 'First Article Body',\n\t\t\t\t\t'published' => 'Y',\n\t\t\t\t\t'created' => '2007-03-18 10:39:23',\n\t\t\t\t\t'updated' => '2007-03-18 10:41:31'\n\t\t\t)),\n\t\t\tarray(\n\t\t\t\t'Comment' => array(\n\t\t\t\t\t'id' => '2',\n\t\t\t\t\t'article_id' => '1',\n\t\t\t\t\t'user_id' => '4',\n\t\t\t\t\t'comment' => 'Second Comment for First Article',\n\t\t\t\t\t'published' => 'Y',\n\t\t\t\t\t'created' => '2007-03-18 10:47:23',\n\t\t\t\t\t'updated' => '2007-03-18 10:49:31'\n\t\t\t\t),\n\t\t\t\t'User' => array(\n\t\t\t\t\t'id' => '4',\n\t\t\t\t\t'user' => 'garrett',\n\t\t\t\t\t'password' => '5f4dcc3b5aa765d61d8327deb882cf99',\n\t\t\t\t\t'created' => '2007-03-17 01:22:23',\n\t\t\t\t\t'updated' => '2007-03-17 01:24:31'\n\t\t\t\t),\n\t\t\t\t'Article' => array(\n\t\t\t\t\t'id' => '1',\n\t\t\t\t\t'user_id' => '1',\n\t\t\t\t\t'title' => 'First Article',\n\t\t\t\t\t'body' => 'First Article Body',\n\t\t\t\t\t'published' => 'Y',\n\t\t\t\t\t'created' => '2007-03-18 10:39:23',\n\t\t\t\t\t'updated' => '2007-03-18 10:41:31'\n\t\t\t)),\n\t\t\tarray(\n\t\t\t\t'Comment' => array(\n\t\t\t\t\t'id' => '3',\n\t\t\t\t\t'article_id' => '1',\n\t\t\t\t\t'user_id' => '1',\n\t\t\t\t\t'comment' => 'Third Comment for First Article',\n\t\t\t\t\t'published' => 'Y',\n\t\t\t\t\t'created' => '2007-03-18 10:49:23',\n\t\t\t\t\t'updated' => '2007-03-18 10:51:31'\n\t\t\t\t),\n\t\t\t\t'User' => array(\n\t\t\t\t\t'id' => '1',\n\t\t\t\t\t'user' => 'mariano',\n\t\t\t\t\t'password' => '5f4dcc3b5aa765d61d8327deb882cf99',\n\t\t\t\t\t'created' => '2007-03-17 01:16:23',\n\t\t\t\t\t'updated' => '2007-03-17 01:18:31'\n\t\t\t\t),\n\t\t\t\t'Article' => array(\n\t\t\t\t\t'id' => '1',\n\t\t\t\t\t'user_id' => '1',\n\t\t\t\t\t'title' => 'First Article',\n\t\t\t\t\t'body' => 'First Article Body',\n\t\t\t\t\t'published' => 'Y',\n\t\t\t\t\t'created' => '2007-03-18 10:39:23',\n\t\t\t\t\t'updated' => '2007-03-18 10:41:31'\n\t\t\t)),\n\t\t\tarray(\n\t\t\t\t'Comment' => array(\n\t\t\t\t\t'id' => '4',\n\t\t\t\t\t'article_id' => '1',\n\t\t\t\t\t'user_id' => '1',\n\t\t\t\t\t'comment' => 'Fourth Comment for First Article',\n\t\t\t\t\t'published' => 'N',\n\t\t\t\t\t'created' => '2007-03-18 10:51:23',\n\t\t\t\t\t'updated' => '2007-03-18 10:53:31'\n\t\t\t\t),\n\t\t\t\t'User' => array(\n\t\t\t\t\t'id' => '1',\n\t\t\t\t\t'user' => 'mariano',\n\t\t\t\t\t'password' => '5f4dcc3b5aa765d61d8327deb882cf99',\n\t\t\t\t\t'created' => '2007-03-17 01:16:23',\n\t\t\t\t\t'updated' => '2007-03-17 01:18:31'\n\t\t\t\t),\n\t\t\t\t'Article' => array(\n\t\t\t\t\t'id' => '1',\n\t\t\t\t\t'user_id' => '1',\n\t\t\t\t\t'title' => 'First Article',\n\t\t\t\t\t'body' => 'First Article Body',\n\t\t\t\t\t'published' => 'Y',\n\t\t\t\t\t'created' => '2007-03-18 10:39:23',\n\t\t\t\t\t'updated' => '2007-03-18 10:41:31'\n\t\t\t)),\n\t\t\tarray(\n\t\t\t\t'Comment' => array(\n\t\t\t\t\t'id' => '5',\n\t\t\t\t\t'article_id' => '2',\n\t\t\t\t\t'user_id' => '1',\n\t\t\t\t\t'comment' => 'First Comment for Second Article',\n\t\t\t\t\t'published' => 'Y',\n\t\t\t\t\t'created' => '2007-03-18 10:53:23',\n\t\t\t\t\t'updated' => '2007-03-18 10:55:31'\n\t\t\t\t),\n\t\t\t\t'User' => array(\n\t\t\t\t\t'id' => '1',\n\t\t\t\t\t'user' => 'mariano',\n\t\t\t\t\t'password' => '5f4dcc3b5aa765d61d8327deb882cf99',\n\t\t\t\t\t'created' => '2007-03-17 01:16:23',\n\t\t\t\t\t'updated' => '2007-03-17 01:18:31'\n\t\t\t\t),\n\t\t\t\t'Article' => array(\n\t\t\t\t\t'id' => '2',\n\t\t\t\t\t'user_id' => '3',\n\t\t\t\t\t'title' => 'Second Article',\n\t\t\t\t\t'body' => 'Second Article Body',\n\t\t\t\t\t'published' => 'Y',\n\t\t\t\t\t'created' => '2007-03-18 10:41:23',\n\t\t\t\t\t'updated' => '2007-03-18 10:43:31'\n\t\t\t)),\n\t\t\tarray(\n\t\t\t\t'Comment' => array(\n\t\t\t\t\t'id' => '6',\n\t\t\t\t\t'article_id' => '2',\n\t\t\t\t\t'user_id' => '2',\n\t\t\t\t\t'comment' => 'Second Comment for Second Article',\n\t\t\t\t\t'published' => 'Y',\n\t\t\t\t\t'created' => '2007-03-18 10:55:23',\n\t\t\t\t\t'updated' => '2007-03-18 10:57:31'\n\t\t\t\t),\n\t\t\t\t'User' => array(\n\t\t\t\t\t'id' => '2',\n\t\t\t\t\t'user' => 'nate',\n\t\t\t\t\t'password' => '5f4dcc3b5aa765d61d8327deb882cf99',\n\t\t\t\t\t'created' => '2007-03-17 01:18:23',\n\t\t\t\t\t'updated' => '2007-03-17 01:20:31'\n\t\t\t\t),\n\t\t\t\t'Article' => array(\n\t\t\t\t\t'id' => '2',\n\t\t\t\t\t'user_id' => '3',\n\t\t\t\t\t'title' => 'Second Article',\n\t\t\t\t\t'body' => 'Second Article Body',\n\t\t\t\t\t'published' => 'Y',\n\t\t\t\t\t'created' => '2007-03-18 10:41:23',\n\t\t\t\t\t'updated' => '2007-03-18 10:43:31'\n\t\t)));\n\t\t$this->assertEquals($expected, $TestModel->Comment->find('all'));\n\t}", "public function join($table, $key, ?string $operator = null, $foreign = null, string $type = self::INNER_JOIN);", "protected function _getFetchJoins() {\n\t\treturn 'LEFT JOIN series se ON se.series_id = s.series_id\n\t\t\tLEFT JOIN series_settings stpl ON (se.series_id = stpl.series_id AND stpl.setting_name = ? AND stpl.locale = ?)\n\t\t\tLEFT JOIN series_settings stl ON (se.series_id = stl.series_id AND stl.setting_name = ? AND stl.locale = ?)\n\t\t\tLEFT JOIN series_settings sapl ON (se.series_id = sapl.series_id AND sapl.setting_name = ? AND sapl.locale = ?)\n\t\t\tLEFT JOIN series_settings sal ON (se.series_id = sal.series_id AND sal.setting_name = ? AND sal.locale = ?)';\n\t}" ]
[ "0.7984447", "0.70945233", "0.6838962", "0.6714497", "0.6494691", "0.641035", "0.6347749", "0.624795", "0.62446976", "0.61500067", "0.6140522", "0.61082", "0.60867786", "0.60806125", "0.5950938", "0.5945585", "0.59404397", "0.5932984", "0.5900534", "0.5809094", "0.57769877", "0.5776001", "0.5765332", "0.57294786", "0.5707794", "0.5659629", "0.56174654", "0.5515686", "0.5500073", "0.5437024", "0.54280615", "0.5427959", "0.5412371", "0.54075056", "0.53999406", "0.5377694", "0.53538793", "0.53413194", "0.5334771", "0.52733845", "0.52613187", "0.5253974", "0.52239937", "0.52182287", "0.5202693", "0.519346", "0.518521", "0.5182243", "0.5181815", "0.5179284", "0.513363", "0.510313", "0.5090217", "0.5078444", "0.5068705", "0.5059458", "0.5038923", "0.50333935", "0.50290465", "0.5026853", "0.50069416", "0.5000842", "0.49920022", "0.49864015", "0.49746627", "0.4948131", "0.49345914", "0.4912996", "0.49118838", "0.49099565", "0.4905387", "0.48940092", "0.48856813", "0.4880081", "0.48788846", "0.48700398", "0.48690918", "0.48626143", "0.48592028", "0.4839088", "0.48191157", "0.48166466", "0.4809228", "0.48034707", "0.47985348", "0.47927555", "0.4791478", "0.47821832", "0.4775108", "0.4773143", "0.47714052", "0.47449178", "0.4729228", "0.47206423", "0.47196895", "0.46990183", "0.46859217", "0.46822417", "0.46814916", "0.46710858" ]
0.65748876
4
Join against another table in the database. This method does the "hard" work of queuing up a table to be joined against. In some cases, that may include dipping into the Schema API to find the necessary fields on which to join.
public function addJoin($type, $table, $alias = NULL, $condition = NULL, $arguments = []);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function joinQuery()\n {\n }", "public function join($table, $on, $field = null, $comparitor = null);", "public function joinOn($tableJoin, $columnJoin, $tableOn, $columnOn);", "public function join($table, $alias = NULL, $condition = NULL, $arguments = []);", "public function join($table, $key, ?string $operator = null, $foreign = null, string $type = self::INNER_JOIN);", "public function basic_join_setup()\r\n {\r\n \r\n }", "protected function joining_table()\n {\n return $this->connection()->table($this->joining);\n }", "function query() {\n dpm($this);\n $this->ensure_my_table();\n\n // First, relate our current table to the link table via the field\n $first = array(\n 'left_table' => $this->table_alias,\n 'left_field' => $this->field, // @TODO real_field?\n 'table' => $this->definition['link table'],\n 'field' => $this->definition['link field'],\n );\n\n if (!empty($this->options['required'])) {\n $first['type'] = 'INNER';\n }\n\n if (!empty($this->definition['link_join_extra'])) {\n $first['extra'] = $this->definition['link_join_extra'];\n }\n\n if (!empty($this->definition['join_handler']) && class_exists($this->definition['join_handler'])) {\n $first_join = new $this->definition['join_handler'];\n }\n else {\n $first_join = new views_join();\n }\n $first_join->definition = $first;\n $first_join->construct();\n $first_join->adjusted = TRUE;\n\n $this->first_alias = $this->query->add_table($this->definition['link table'], $this->relationship, $first_join);\n\n // Second, relate the link table to the entity specified using\n // the specified base fields on the base and link tables.\n $second = array(\n 'left_table' => $this->first_alias,\n 'left_field' => $this->definition['base link field'],\n 'table' => $this->definition['base'],\n 'field' => $this->definition['base field'],\n );\n\n if (!empty($this->options['required'])) {\n $second['type'] = 'INNER';\n }\n\n if (!empty($this->definition['base_join_extra'])) {\n $second['extra'] = $this->definition['base_join_extra'];\n }\n\n if (!empty($this->definition['join_handler']) && class_exists($this->definition['join_handler'])) {\n $second_join = new $this->definition['join_handler'];\n }\n else {\n $second_join = new views_join();\n }\n $second_join->definition = $second;\n $second_join->construct();\n $second_join->adjusted = TRUE;\n\n // use a short alias for this:\n // @TODO real_field?\n $alias = $this->field . '_' . $this->definition['base'];\n\n $this->alias = $this->query->add_relationship($alias, $second_join, $this->definition['base'], $this->relationship);\n }", "function addJoin($name, $joinType, $tableA, $tableB, $fieldA, $fieldB) {\n\t\t$this->addBlock('from', $name, array(array($joinType, $tableA, $tableB, $fieldA, $fieldB)));\n\t\treturn $this;\n\t}", "protected function performJoin(Builder $query = null)\n {\n $query = $query ?: $this->query;\n\n $ownerKey = $this->getQualifiedOwnerKeyName();\n\n $query->join($this->throughChild->getTable(), $ownerKey , '=', $this->getQualifiedFirstKeyName());\n $query->select([\n '*' => $this->related->qualifyColumn('*'),\n $this->secondKey => $this->throughChild->getQualifiedKeyName().' as '.$this->secondKey\n ]);\n\n if ($this->throughChildSoftDeletes()) {\n $query->whereNull($this->throughChild->getQualifiedDeletedAtColumn());\n }\n }", "function join($table, &$query) {\r\n $left = $query->get_table_info($this->left_table);\r\n $output = \" $this->type JOIN {\" . $this->table . \"} $table[alias] ON ($this->left_query) = $table[alias].$this->field\";\r\n\r\n // Tack on the extra.\r\n if (isset($this->extra)) {\r\n if (is_array($this->extra)) {\r\n $extras = array();\r\n foreach ($this->extra as $info) {\r\n $extra = '';\r\n // Figure out the table name. Remember, only use aliases provided\r\n // if at all possible.\r\n $join_table = '';\r\n if (!array_key_exists('table', $info)) {\r\n $join_table = $table['alias'] . '.';\r\n }\r\n elseif (isset($info['table'])) {\r\n $join_table = $info['table'] . '.';\r\n }\r\n\r\n // And now deal with the value and the operator. Set $q to\r\n // a single-quote for non-numeric values and the\r\n // empty-string for numeric values, then wrap all values in $q.\r\n $raw_value = $this->db_safe($info['value']);\r\n $q = (empty($info['numeric']) ? \"'\" : '');\r\n\r\n if (is_array($raw_value)) {\r\n $operator = !empty($info['operator']) ? $info['operator'] : 'IN';\r\n // Transform from IN() notation to = notation if just one value.\r\n if (count($raw_value) == 1) {\r\n $value = $q . array_shift($raw_value) . $q;\r\n $operator = $operator == 'NOT IN' ? '!=' : '=';\r\n }\r\n else {\r\n $value = \"($q\" . implode(\"$q, $q\", $raw_value) . \"$q)\";\r\n }\r\n }\r\n else {\r\n $operator = !empty($info['operator']) ? $info['operator'] : '=';\r\n $value = \"$q$raw_value$q\";\r\n }\r\n $extras[] = \"$join_table$info[field] $operator $value\";\r\n }\r\n\r\n if ($extras) {\r\n if (count($extras) == 1) {\r\n $output .= ' AND ' . array_shift($extras);\r\n }\r\n else {\r\n $output .= ' AND (' . implode(' ' . $this->extra_type . ' ', $extras) . ')';\r\n }\r\n }\r\n }\r\n else if ($this->extra && is_string($this->extra)) {\r\n $output .= \" AND ($this->extra)\";\r\n }\r\n }\r\n return $output;\r\n }", "public function joinLeasedOutUser() {\n $sqlSelect = $this->tableGateway->getSql()->select();\n\t\t$sqlSelect\n ->columns(array('Id','requestedTime','returnedTime','userId','returnedTime','assetId'));\n $sqlSelect\n ->join('UserInfoTable', 'UserInfoTable.Id = leasedoutuserTable.userId', array('firstname','email'), 'inner');\n $sqlSelect\n ->join('AssetInfoTable', 'AssetInfoTable.AssetId = leasedoutuserTable.assetId', array('AssetName','AssetStatus','AssetDesc'), 'inner');\n $statement \n = $this->tableGateway->getSql()->prepareStatementForSqlObject($sqlSelect);\n\t\t$resultSet = $statement->execute();\n\t\treturn $resultSet;\n\n }", "protected function performJoins()\n {\n $query = $this->query;\n\n $predecessor = $this->related;\n\n $this->through_parents->each(function ($model) use ($query, &$predecessor) {\n $first = $predecessor->getQualifiedKeyName();\n $joined = $model->qualifyColumn($this->getForeignKeyName($predecessor));\n\n $query->join($model->getTable(), $first, '=', $joined);\n\n if ($this->hasSoftDeletes($model)) {\n $this->query->whereNull($model->getQualifiedDeletedAtColumn());\n }\n\n $predecessor = $model;\n });\n }", "public function addJoin(Builder $queryBuilder) : void\n {\n $queryBuilder->join(\n $this->_relatedTable . ' AS ' . $this->name,\n $this->_baseTable . '.' . $this->_baseKey,\n '=',\n $this->name . '.' . $this->_foreignKey\n );\n }", "public function fullOuterJoin($table);", "public function join($table, $type = NULL){\n $this->_last_join = new Join($table, $type);\n $this->_last_join->setQuoter($this->quoter);\n $this->_join[] = $this->_last_join;\n return $this;\n }", "public function join($table, $one, $operator = null, $two = null, $type = 'inner', $where = false)\n {\n throw new NotImplementedException('Joins are not implemented in Crate');\n }", "public function set_join($table_or_alias, $on = null, $type='LEFT')\n { \n $table = $this->getJoinableTable($table_or_alias);\n if(!$this->is_used_table($table))\n {\n $table = (MormConf::isInConf($table_or_alias)) ? $this->add_table($table_or_alias) : $this->add_table($table);\n $this->join_tables[] = $table;\n }\n if(!is_null($on))\n {\n $tables = array_keys($on);\n $this->joins[] = array(array($tables[0] => $tables[1]), $on);\n }\n else\n {\n $key = $this->base_models[$this->base_table]->getForeignKeyFrom($table_or_alias);\n try\n {\n $ft_key = $this->base_models[$this->base_table]->getForeignTableKey($key);\n }\n catch (Exception $e)\n {\n if($this->base_models[$this->base_table]->isForeignUsingTable ($table))\n $ft_key = $this->base_models[$this->base_table]->getForeignMormonsUsingKey($table);\n else\n $ft_key = $this->base_models[$this->base_table]->getForeignMormonsKey($table);\n }\n $this->joins[] = array(array($this->base_table => $table), array($this->base_table => $key, $table => $ft_key));\n }\n //@todo put executed tu false only when join has changed\n $this->_executed = false;\n // switch($type)\n // {\n // case 'LEFT':\n // break;\n // case 'RIGHT':\n // break;\n // default:\n // throw new Exception(\"The join type \".$type.\" does not exist or is not yet supported by Mormons\");\n // break;\n // }\n }", "public function join(\n $table,\n $column1,\n $operator,\n $column2,\n $type\n );", "protected function getJoinTable(): string\n {\n return \"{$this->define(SchemaInterface::TABLE)} AS {$this->getAlias()}\";\n }", "public function testBuildJoinDefaultWithTwoJoinOn()\n {\n $query = $this->getQuery()\n ->table('table1')\n ->join(\n $this->getQuery()\n ->table('table2')\n ->joinOn('id', 'id')\n ->joinOn('user_id', 'type_id')\n )\n ;\n\n $this->assertSame(\n 'LEFT JOIN table2 ON table1.id = table2.id AND table1.user_id = table2.type_id',\n $query->buildJoin()\n );\n }", "public function join($tables, $overwrite = false);", "public function join($tables, $columnName, $joinType = 'JOIN')\r\n\t\t{\r\n\t\t\t\r\n\t\t\t$totalTables = count($tables);\r\n\t\t\t\r\n\t\t\tif(is_array($columnName)){\r\n\t\t\t\t$colsIsArray = true;\r\n\t\t\t\tif(count($columnName) != $totalTables){\r\n\t\t\t\t\techo \"DB Join error. columnName passed as an array but does not match tables count. \";\r\n\t\t\t\t\techo \"columnName is an array of: \" . count($colsIsArray) . \" while tables is an array of: \" . $totalTables;\r\n\t\t\t\t\tdie();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse $colsIsArray = false;\r\n\t\t\t$c = 0;\r\n\r\n//SELECT column_list\r\n//FROM t1\r\n//INNER JOIN t2 ON join_condition1\r\n//INNER JOIN t3 ON join_condition2\r\n\r\n\t\t\t$joinSQL = \"`{$this->_prefix}{$tables[0]}` \";\r\n\r\n\t\t\tfor($n = 0; $n < $totalTables; $n += 1){\r\n\r\n\t\t\t\tif($n+1 < $totalTables){\r\n\t\t\t\t\t$joinSQL .= \"{$joinType} `{$this->_prefix}{$tables[$n+1]}` \";\r\n\t\t\t\t\tif($colsIsArray) $joinSQL .= \"ON `{$this->_prefix}{$tables[$n]}`.`{$columnName[$c]}` = `{$this->_prefix}{$tables[$n+1]}`.`{$columnName[$c+1]}` \";\r\n\t\t\t\t\telse $joinSQL .= \"ON `{$this->_prefix}{$tables[$n]}`.`{$columnName}` = `{$this->_prefix}{$tables[$n+1]}`.`{$columnName}` \";\r\n\t\t\t\t\t$c += 1;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t//lets prepare our query string\r\n\t\t\t$this->_sql = \"SELECT {$this->_select} FROM \" . $joinSQL . $this->_where . $this->_orderBy . $this->_limit;\r\n\r\n\t\t\t//build an additional query string for our count ready for numRows() method\r\n\t\t\t$this->_sqlCount = \"SELECT COUNT(*) FROM \" . $joinSQL . $this->_where;\r\n\r\n\t\t\t//let the server prepare, execute and check for errors\r\n\t\t\t$this->_query = $this->_prepare($this->_sql);\r\n\t\t\t$this->_execute($this->_query);\r\n\t\t\t$this->_errors($this->_query);\r\n\r\n\t\t\treturn $this;\r\n\t\t}", "private static function sqlJoining() : string {\n $relations = self::getsRelationsHasOne();\n\n $baseTable = static::tableName();\n $baseProperties = self::getProperties();\n foreach ($baseProperties as &$property) {\n $property = $baseTable . '.' . $property;\n }\n $colsFromBaseTabel = implode(', ', $baseProperties);\n $colsFromJoinedTables = '';\n foreach ($relations as $relation) {\n $modelNamespace = '\\\\' . $relation['model'];\n $modelTableName = $modelNamespace::tableName();\n $modelProperties = $modelNamespace::getProperties();\n foreach ($modelProperties as $key => &$value) {\n $value = $modelTableName . '.' . $value . ' AS ' . $modelTableName . '_' . $value;\n }\n $colsFromJoinedTables .= ', ' . implode(', ', $modelProperties);\n\n }\n $sql = 'SELECT ' . $colsFromBaseTabel . ' ' . $colsFromJoinedTables . ' FROM ' . $baseTable;\n\n foreach ($relations as $relation) {\n $modelNamespace = '\\\\' . $relation['model'];\n $modelTableName = $modelNamespace::tableName();\n $sql .= ' INNER JOIN ' . $modelTableName . ' ON ' . $baseTable . '.' . $relation['column'] . ' = ' . $modelTableName . '.' . $relation['joined-table-column'];\n }\n\n return $sql . ' WHERE ' . $baseTable . '.';\n }", "public function rightOuterJoin($table);", "abstract public function join($alias_from, $rel_name, $alias_to);", "public function join(Select $table, $alias, $on)\n {\n return $this->innerJoin($table, $alias, $on);\n }", "public function testBuildJoinDefault()\n {\n $query = $this->getQuery()\n ->table('table1')\n ->join(\n $this->getQuery()\n ->table('table2')\n ->joinOn('id', 'id')\n )\n ;\n\n $this->assertSame(\n 'LEFT JOIN table2 ON table1.id = table2.id',\n $query->buildJoin()\n );\n }", "protected function _addJoin($type, $table, $fields, $on = []) {\n $repo = $this->getRepository();\n $join = new Join($type);\n $conditions = [];\n\n if (is_array($table)) {\n $alias = $table[1];\n $table = $table[0];\n } else {\n $alias = $table;\n }\n\n foreach ($on as $pfk => $rfk) {\n if (strpos($pfk, '.') === false) {\n $pfk = $repo->getAlias() . '.' . $pfk;\n }\n\n if (strpos($rfk, '.') === false) {\n $rfk = $alias . '.' . $rfk;\n }\n\n $conditions[$pfk] = $rfk;\n }\n\n $this->_joins[] = $join->from($table, $alias)->on($conditions)->fields($fields);\n\n return $this;\n }", "public function joinBookings()\n {\n $this->builder->join('bookings', 'book_id', 'bil_booking');\n }", "public function getMockJoin ( $table, $on = null )\n {\n return $this->getMock(\n '\\r8\\Query\\Join',\n array('getJoinType'),\n array( $table, $on )\n );\n }", "protected function joinStoreRelationTable(string $tableName, ?string $linkField): void\n {\n if ($this->getFilter('store')) {\n $this->getSelect()->joinLeft(\n ['store_table' => $this->getTable($tableName)],\n 'main_table.' . $this->getIdFieldName() . ' = store_table.' . $linkField,\n []\n )->group(\n 'main_table.' . $this->getIdFieldName()\n );\n }\n }", "public function innerJoin($table);", "public function leftOuterJoin($table);", "public function join($table, $condition = [], $join = '')\n\t{\n\t\tif(count($condition) == 3)\n\t\t\t$this->_query .= strtoupper($join) . // convert $join to upper case (left -> LEFT)\n\t\t\t\t\" JOIN {$table} ON {$condition[0]} {$condition[1]} {$condition[2]}\";\n\n\t\t// that's it now return object from this class\n\t\treturn $this;\n }", "public function testBuildSelectWithJoin()\n {\n $query = $this->getQuery()\n ->table('table1')\n ->fields()\n ->addField('user@email', 'email')\n ->join(\n $this->getQuery()\n ->table('table2')\n ->fields()\n ->addField('user@email', 'email')\n ->joinOn('id', 'id')\n )\n ;\n\n $this->assertSame(\n \"'user@email' AS table1__email, 'user@email' AS table2__email\",\n $query->buildSelectFields()\n );\n }", "public function join($sql) {\n $this->__join__ = $sql;\n return $this;\n }", "public function addJoin($type, $table, $alias, $on_statement, $using_statement = '', $use_index = '', $ignore_index = '')\n\t{\n\t\t// @todo: verify join type\n\t\tif (is_object($table))\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\t$table = $table->getName();\n\t\t\t} catch (Exception $e)\n\t\t\t{\n\t\t\t\tthrow(new UnvalidObjectException(\"Table must be an object of type Table or a string\"));\n\t\t\t}\n\t\t}\n\n\t\t$this->joins[] = array('type' => $type, 'table' => $table, 'on_statement' => $on_statement, 'using_statement' => $using_statement, 'alias' => $alias, 'use_index' => $use_index, 'ignore_index' => $ignore_index);\n\t\treturn $this;\n\t}", "function buildJoin()\n\t{\n\t\tif ($this->table_obj_reference)\n\t\t{\n\t\t\t// Use inner join instead of left join to improve performance\n\t\t\treturn \"JOIN \".$this->table_obj_reference.\" ON \".$this->table_tree.\".child=\".$this->table_obj_reference.\".\".$this->ref_pk.\" \".\n\t\t\t\t \"JOIN \".$this->table_obj_data.\" ON \".$this->table_obj_reference.\".\".$this->obj_pk.\"=\".$this->table_obj_data.\".\".$this->obj_pk.\" \";\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Use inner join instead of left join to improve performance\n\t\t\treturn \"JOIN \".$this->table_obj_data.\" ON \".$this->table_tree.\".child=\".$this->table_obj_data.\".\".$this->obj_pk.\" \";\n\t\t}\n\t}", "public function ON($left_field_name, $right_field_name, $left_table_offset = -2, $right_table_offset = null) {\n\t\t$jointset = $this->lastSet('joint') ;\n\t\tif (!$jointset) $jointset = $this->add_SET('joint');\n\n\t\t$left_ptr = $this->fieldByAlias($left_field_name);\n\t\tif (!$left_ptr) $left_ptr = $this->add_FIELD($left_field_name, null, $this->lastTable($left_table_offset), null);\n\n\t\t$right_ptr = $this->fieldByAlias($right_field_name);\n\t\tif (!$right_ptr) $right_ptr = $this->add_FIELD($right_field_name, null, $this->lastTable($right_table_offset), null);\n\n\t\t//remove right_ptr->table from tableset?\n\t\t$this->rem_TABLE($right_ptr->asTable());\n\n\t\t$this->add_JOIN($left_ptr, $right_ptr, $jointset);\n\t}", "public function joinResources()\n {\n $this->builder->join('resources', 'rs_id', '=', 'add_resource');\n }", "private function addJoin(Query $other, $fieldOrExpr, $operator, $valueOrExpr, $type = 'INNER', $table, $withOtherDatas=TRUE) {\r\n\t\tif (isset($this->_salt_joins[$other->_salt_alias])) {\r\n\t\t\tthrow new SaltException(L::error_query_duplicate_join($other->_salt_alias));\r\n\t\t}\r\n\r\n\t\t$this->_salt_joins[$other->_salt_alias]=array(\r\n\t\t\t'type'=>strtoupper($type),\r\n\t\t\t'table'=>$table,\r\n\t\t\t'on'=>array(),\r\n\t\t);\r\n\r\n\t\t$absoluteField = $this->resolveFieldName(ClauseType::JOIN, $fieldOrExpr);\r\n\r\n\t\t$valueOrExpr = $this->resolveFieldName(ClauseType::JOIN, $valueOrExpr, $fieldOrExpr);\r\n\t\tif (is_array($valueOrExpr)) {\r\n\t\t\t$valueOrExpr = '('.implode(', ', $valueOrExpr).')';\r\n\t\t}\r\n\t\t$clause = $absoluteField.' '.$operator.' '.$valueOrExpr;\r\n\r\n\t\t$this->addJoinOnClause($other, 'AND', $clause);\r\n\r\n\t\tif ($withOtherDatas) {\r\n\t\t\t// Merge of others parameters\r\n\t\t\tif (count($other->_salt_fields) > 0) {\r\n\t\t\t\t$this->_salt_fields=array_merge($this->_salt_fields, $other->_salt_fields);\r\n\t\t\t\t$this->linkBindsOf($other, ClauseType::JOIN, ClauseType::SELECT);\r\n\t\t\t}\r\n\t\t\tif (count($other->_salt_wheres) > 0) {\r\n\t\t\t\t//$this->addWhereClause('AND', $other->wheres);\r\n\t\t\t\t$this->addJoinOnClause($other, 'AND', $other->_salt_wheres);\r\n\t\t\t\t$this->linkBindsOf($other, ClauseType::JOIN, ClauseType::WHERE);\r\n\t\t\t}\r\n\t\t\tif (count($other->_salt_groups) > 0) {\r\n\t\t\t\t$this->_salt_groups=array_merge($this->_salt_groups, $other->_salt_groups);\r\n\t\t\t\t$this->linkBindsOf($other, ClauseType::JOIN, ClauseType::GROUP);\r\n\t\t\t}\r\n\t\t\tif (count($other->_salt_orders) > 0) {\r\n\t\t\t\t$this->_salt_orders=array_merge($this->_salt_orders, $other->_salt_orders);\r\n\t\t\t\t$this->linkBindsOf($other, ClauseType::JOIN, ClauseType::ORDER);\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\t// join (Select ...) : link ALL binds, because we include full query text\r\n\t\t\t$this->linkBindsOf($other, ClauseType::JOIN);\r\n\t\t}\r\n\t}", "public function innerJoin() {\r\n\t\t$args = func_get_args();\r\n\t\t$name = array_shift($args);\r\n\t\t$joined = array_shift($args);\r\n\t\tif (!$name) $name = '___' . $joined;\r\n\t\t//if (count(array_keys(self::$_joinStack, $joined)) > 1) {\r\n\t\tif (get_class($this) == $joined || in_array($joined, self::$_joinStack)) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tself::$_joinStack[] = get_class($this);\r\n\t\tself::$_joinStack[] = $joined;\r\n\t\t$model = null;\r\n\t\tif (is_string($joined)) {\r\n\t\t\tif (is_subclass_of($joined, 'Dbi_Model')) {\r\n\t\t\t\t$model = new $joined();\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tif (is_subclass_of($joined, 'Dbi_Model')) {\r\n\t\t\t\t$model = $joined;\r\n\t\t\t}\r\n\t\t}\r\n\t\tarray_pop(self::$_joinStack);\r\n\t\tarray_pop(self::$_joinStack);\r\n\t\tif (is_null($model)) {\r\n\t\t\tthrow new Exception('Queries can only join models.');\r\n\t\t}\r\n\t\t$this->_innerJoins[] = array(\r\n\t\t\t'name' => $name,\r\n\t\t\t'model' => $model,\r\n\t\t\t'args' => $args\r\n\t\t);\r\n\t}", "public function straightJoin($table, array $fields, array $on = []) {\n return $this->_addJoin(Join::STRAIGHT, $table, $fields, $on);\n }", "public function constructInnerJoinSql(Table $fromTable, $usingThrough=false, $alias=null)\n\t{\n\t\tif ($usingThrough)\n\t\t{\n\t\t\t$joinTable = $fromTable;\n\t\t\t$joinTableName = $fromTable->getFullyQualifiedTableName();\n\t\t\t$fromTableName = Table::load($this->className)->getFullyQualifiedTableName();\n \t\t}\n\t\telse\n\t\t{\n\t\t\t$joinTable = Table::load($this->className);\n\t\t\t$joinTableName = $joinTable->getFullyQualifiedTableName();\n\t\t\t$fromTableName = $fromTable->getFullyQualifiedTableName();\n\t\t}\n\n\t\t// need to flip the logic when the key is on the other table\n\t\tif ($this instanceof HasMany || $this instanceof HasOne)\n\t\t{\n\t\t\t$this->setKeys($fromTable->class->getName());\n\n\t\t\tif ($usingThrough)\n\t\t\t{\n\t\t\t\t$foreignKey = $this->primaryKey[0];\n\t\t\t\t$joinPrimaryKey = $this->foreignKey[0];\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$joinPrimaryKey = $this->foreignKey[0];\n\t\t\t\t$foreignKey = $this->primaryKey[0];\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$foreignKey = $this->foreignKey[0];\n\t\t\t$joinPrimaryKey = $this->primaryKey[0];\n\t\t}\n\n\t\tif (!is_null($alias))\n\t\t{\n\t\t\t$aliasedJoinTableName = $alias = $this->getTable()->conn->quoteName($alias);\n\t\t\t$alias .= ' ';\n\t\t}\n\t\telse\n\t\t\t$aliasedJoinTableName = $joinTableName;\n\n\t\treturn \"INNER JOIN $joinTableName {$alias}ON($fromTableName.$foreignKey = $aliasedJoinTableName.$joinPrimaryKey)\";\n\t}", "protected function _joinFields()\n {\n $reviewTable = $this->_resource->getTableName('review');\n $reviewDetailTable = $this->_resource->getTableName('review_detail');\n\n $this->addAttributeToSelect('name')->addAttributeToSelect('sku');\n\n $this->getSelect()->join(\n ['rt' => $reviewTable],\n 'rt.entity_pk_value = e.entity_id',\n ['rt.review_id', 'review_created_at' => 'rt.created_at', 'rt.entity_pk_value', 'rt.status_id', 'rt.vendor_id']\n )->join(\n ['rdt' => $reviewDetailTable],\n 'rdt.review_id = rt.review_id',\n ['rdt.title', 'rdt.nickname', 'rdt.detail', 'rdt.customer_id', 'rdt.store_id']\n );\n return $this;\n }", "private function addJoinOnQuery($type, Query $other, Query $whereQuery) {\r\n\t\t//$this->joins[$other->alias]['on'][]=' '.$type.' ('.implode(' ', $whereQuery->wheres).')';\r\n\t\t$this->addJoinOnClause($other, $type, '('.implode(' ',$whereQuery->_salt_wheres).')');\r\n\t\t$this->linkBindsOf($other, ClauseType::JOIN, ClauseType::WHERE);\r\n\t}", "function test_getJoin()\n {\n $question = new MDB_QT(TABLE_QUESTION);\n $joinOn1 = TABLE_QUESTION.'.id='.TABLE_ANSWER.'.question_id';\n $question->setJoin(TABLE_ANSWER, $joinOn1);\n\n $all = array(\n 'default' => array(TABLE_ANSWER => $joinOn1),\n );\n $tables = array(TABLE_ANSWER);\n $right = array();\n $left = array();\n\n $this->assertEqual($all, $question->getJoin());\n $this->assertEqual($tables, $question->getJoin('tables'));\n $this->assertEqual($right, $question->getJoin('right'));\n $this->assertEqual($left, $question->getJoin('left'));\n\n //--------------------------------------------------------\n\n $joinOn2 = TABLE_USER.'.id='.TABLE_ANSWER.'.question_id';\n $question->setRightJoin(TABLE_USER, $joinOn2);\n\n $all = array(\n 'default' => array(TABLE_ANSWER => $joinOn1),\n 'right' => array(TABLE_USER => $joinOn2),\n );\n $tables = array(TABLE_ANSWER, TABLE_USER);\n $right = array(TABLE_USER => $joinOn2);\n $left = array();\n\n $this->assertEqual($all, $question->getJoin());\n $this->assertEqual($tables, $question->getJoin('tables'));\n $this->assertEqual($right, $question->getJoin('right'));\n $this->assertEqual($left, $question->getJoin('left'));\n }", "public function join($type, $table, $on = null)\n {\n $this->joinTokens[$this->activeJoin = $table] = ['type' => strtoupper($type), 'on' => []];\n\n return call_user_func_array([$this, 'on'], array_slice(func_get_args(), 2));\n }", "public function addJoin($assocTable, $col1, $col2, $last = true, $type = \"left\") {\n // Joins will always be on selects\n list($this->sql, $this->from) = splitString($this->sql, \"FROM\");\n // Take care of aliased columns\n if (!empty($assocTable->aliases)) {\n $this->sql .= \", \";\n foreach($assocTable->aliases as $c => $a) {\n $this->sql .= $assocTable->name . \".$c as $a,\";\n }\n // Take the comma off the end\n $this->sql = trim($this->sql, \",\");\n }\n $type = strtoupper($type);\n $this->join .= \" $type JOIN \" . $assocTable->name;\n $this->join .= \" ON \" . $this->table->name . \".\" . $col1 . \" = \" . $assocTable->name . \".\" . $col2;\n if ($last) {\n $this->sql .= \" $this->from\";\n $this->sql .= $this->join;\n }\n }", "public function join($tbl_name, array $condition, $type = Operator::JOIN_INNTER)\n {\n $output = array();\n $func = function ($value) use (&$output)\n {\n $value = $this->escapeString($value);\n $output[] = \"`{$value}`\";\n };\n $temp = explode('.', $tbl_name);\n $output = array();\n array_walk($temp, $func);\n $tbl_name = implode('.', $output);\n $target_str = $tbl_name;\n $on_str_list = array();\n foreach ($condition as $item) {\n $temp = explode('.', $item);\n $output = array();\n array_walk($temp, $func);\n $on_str_list[] = implode('.', $output);\n }\n $type = ltrim($type, '$');\n $on_str = implode(' = ', $on_str_list);\n $join_str = \"{$type} {$target_str} ON {$on_str}\";\n $this->join_str_list[] = $join_str;\n return $this;\n }", "abstract protected function appendJoins(QueryBuilder $queryBuilder);", "private function hasOne($table, $foreignTableName) {\n $foreignTableName = strtolower($foreignTableName);\n assert('!empty($table->primaryKey); // table needs to have primary key defined for table join');\n\n // can we load the foreign table?\n if (class_exists(ucfirst($foreignTableName))) {\n // capitalize\n $foreignTableName = ucfirst($foreignTableName);\n // note the foreign table might have relationships of its own...\n $foreignTable = new $foreignTableName();\n assert('!empty($foreignTable->primaryKey); // foreign table needs to have primary key defined');\n\n // create the join on custom primary key and (optionally) custom table name\n $table->join($foreignTable->tableName, array(\n \"{$table->tableName}.{$foreignTable->tableName}_{$table->primaryKey}\"\n => \"{$foreignTable->tableName}.{$foreignTable->primaryKey}\"\n ));\n // as an added bonus, we might have a relationship in the foreign table, add it...\n $table->join .= $foreignTable->join;\n } else {\n // we will have to rely on our primary key\n // create the join where \"foreignTable_id = id\"\n $table->join($foreignTableName, array(\n \"{$table->tableName}.{$foreignTableName}_{$table->primaryKey}\"\n => \"{$foreignTableName}.{$table->primaryKey}\"\n ));\n }\n }", "public function join($tabela1 = null, $tabela2 = null, $para=null) {\n \n \n }", "public function join(Query $other, $fieldOrExpr, $operator, $valueOrExpr, $type = 'INNER') {\r\n\t\t$this->addJoin($other, $fieldOrExpr, $operator, $valueOrExpr, $type, $other->resolveTable());\r\n\t}", "public function join(string $externalTable, string $externalColumn, string $localTable, string $localColumn)\n {\n return $this->innerJoin($externalTable, $externalColumn, $localTable, $localColumn);\n }", "public function naturalJoin($table);", "function joinClause( $join ) {\n\t global $wpdb;\n\t $join .= \" INNER JOIN $wpdb->postmeta dm ON (dm.post_id = $wpdb->posts.ID AND dm.meta_key = '$this->orderby') \";\n\t return $join;\n\t}", "public function join($table, $on, $type){\n\t\t$this->joins[] = array($table, $on, $type);\n\t\treturn $this;\n\t}", "public function compile()\n {\n if (null !== $this->type) {\n $sql = strtoupper($this->type).' JOIN';\n } else {\n $sql = 'JOIN';\n }\n\n $sql .= ' '.$this->quoter->quoteTable($this->table);\n\n if (!empty($this->using)) {\n $sql .= ' USING ('.implode(', ', array_map(array($this->quoter, 'quoteColumn'), $this->using)).')';\n } else {\n $conditions = array();\n\n foreach ($this->on as $condition) {\n list($c1, $op, $c2) = $condition;\n\n if ($op) {\n $op = ' '.strtoupper($op);\n }\n\n $conditions[] = $this->quoter->quoteColumn($c1).$op.' '.$this->quoter->quoteColumn($c2);\n }\n\n $sql .= ' ON ('.implode(' AND ', $conditions).')';\n }\n\n return $sql;\n }", "function return_join_table_data($rt_or_left_or_none,$tableleft,$tableright,$on_a_and_b,$whereby=null,$orderby=null,$returnrows=\"a.*,b.*\") {\n\t$q = \"\n\tSELECT \".$returnrows.\"\n\tFROM \".$tableleft.\" AS a \".$rt_or_left_or_none.\" JOIN \".$tableright.\" AS b ON \".$on_a_and_b.\" \n\t\".$whereby.\" \n\t\".$orderby.\" \n\t\";\n\t//echo $q;\n\t$r = mysql_query($q) or die(\"return_join_table_data($rt_or_left_or_none,$tableleft,$tableright): \".mysql_error());\n\treturn check_results($r);\n}", "public function joinBills()\n {\n $this->builder->join('bills', 'bil_id', 'rc_bill');\n }", "public function paged_join($table = '', $second_table = '', $fields = '*', $join = '', $limit = 0, $offset = 0, $where = FALSE, $order_by = FALSE)\n {\n $this->db->select($fields);\n $this->db->from($table);\n\n if ($second_table && $join) {\n $this->db->join($second_table, $join);\n }\n\n if ($limit > 0) {\n $this->db->limit($limit, $offset);\n }\n\n if ($where) {\n $this->db->where($where);\n }\n\n if ($order_by !== FALSE) {\n $this->db->order_by($order_by);\n }\n\n return $this->get();\n }", "public static function doRightJoin($table2, $params=NULL, $fields=array()) {\n\t\t$conn = parent::_initwgConnector($params, self::PRIMARY_KEY);\n\t\t$what = parent::_getSelectFields($fields);\n\t\t$conn->rightJoin(self::TABLE_NAME, $table2, $what);\n\t\treturn DbModel::doSelect($conn, new ProjectsListingsModel());\n\t}", "public static function join($joinTable, $joinCondition, $joinType = '')\r\n {\r\n return self::$PDO->join($joinTable, $joinCondition, $joinType);\r\n }", "public function joinUsing($table, $column, $type = 'INNER')\n\t{\n\t\treturn $this->join($table, $this->from . '.' . $column, '=', $table . '.' . $column, $type);\n\t}", "public function crossJoin($table);", "public function testJoinWithAlias()\n {\n $query = (new Select($this->mockConnection))->join('join', 'j.tableId', '=', 'table.id', 'j');\n $array = $query->toArray();\n\n $this->assertInstanceOf(Select::class, $query);\n $this->assertArrayHasKey('join', $array);\n $this->assertCount(1, $array['join']);\n $this->assertEquals([\n 'type' => 'inner',\n 'table' => 'join',\n 'alias' => 'j',\n 'statement' => [\n 'where' => [\n [\n 'column' => 'j.tableId',\n 'operator' => '=',\n 'value' => 'table.id',\n 'boolean' => 'and',\n ]\n ],\n ]\n ], $array['join'][0]);\n $this->assertInstanceOf(Column::class, $array['join'][0]['statement']['where'][0]['value']);\n }", "public function testJoinStmt()\n {\n $join = $this->joinTemplate()();\n return $this->assertEquals($join, \"SELECT blog.blog_text, blog.token_id, tokens.token_id, tokens.token_string FROM blog JOIN tokens ON blog.token_id = tokens.token_id\");\n }", "public function join($id);", "function cf_search_join( $join ) {\n\t\tglobal $wpdb;\n\n\t\tif ( is_search() ) {\n\t\t\t$join .= ' LEFT JOIN ' . $wpdb->postmeta . ' ON ' . $wpdb->posts . '.ID = ' . $wpdb->postmeta . '.post_id ';\n\t\t}\n\n\t\treturn $join;\n\t}", "protected function set_join($other)\n {\n $this->table->join($this->joining, $this->associated_key(), '=', $this->joining . '.' . $other);\n return $this;\n }", "public function join($table, $type = NULL)\n {\n if ($type !== '')\n {\n $type = strtoupper(trim($type));\n\n if ( ! in_array($type, array('LEFT', 'RIGHT', 'OUTER', 'INNER', 'LEFT OUTER', 'RIGHT OUTER'), TRUE))\n {\n $type = '';\n }\n else\n {\n $type .= ' ';\n }\n }\n\n // Assemble the JOIN statement\n $table = $this->table_prefix($table);\n $table = $this->quote_identifier($table);\n $this->_join[] = $type.'JOIN '.$table;\n\n return $this;\n }", "function query_main_join( $sql, $engine ) {\n\t\tglobal $wpdb;\n\n\t\tif ( isset( $engine ) ) {\n\t\t\t$engine = null;\n\t\t}\n\n\t\t// if WooCommerce is sorting results we need to tell SearchWP to return them in that order\n\t\tif ( $this->is_woocommerce_search() ) {\n\n\t\t\tif ( ! isset( $this->ordering['wc_orderby'] ) ) {\n\t\t\t\t$this->get_woocommerce_ordering();\n\t\t\t}\n\n\t\t\t// depending on the sorting we need to do different things\n\t\t\tif ( isset( $this->ordering['wc_orderby'] ) ) {\n\t\t\t\tswitch ( $this->ordering['wc_orderby'] ) {\n\t\t\t\t\tcase 'price':\n\t\t\t\t\tcase 'price-desc':\n\t\t\t\t\tcase 'popularity':\n\t\t\t\t\t\t$meta_key = 'price' === $this->ordering['wc_orderby'] ? '_price' : 'total_sales';\n\t\t\t\t\t\t$sql = $sql . $wpdb->prepare( \" LEFT JOIN {$wpdb->postmeta} AS swpwc ON {$wpdb->posts}.ID = swpwc.post_id AND swpwc.meta_key = %s\", $meta_key );\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'rating':\n\t\t\t\t\t\t$sql = $sql . \" LEFT OUTER JOIN {$wpdb->comments} swpwpcom ON({$wpdb->posts}.ID = swpwpcom.comment_post_ID) LEFT JOIN {$wpdb->commentmeta} swpwpcommeta ON(swpwpcom.comment_ID = swpwpcommeta.comment_id) \";\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// for visibility we always need to join postmeta\n\t\t\tif ( function_exists( 'WC' ) && ! empty( WC()->version ) && version_compare( WC()->version, '2.6.0', '<' ) ) { // Moved to a taxonomy\n\t\t\t\t$sql = $sql . \" INNER JOIN {$wpdb->postmeta} as woovisibility ON {$wpdb->posts}.ID = woovisibility.post_id \";\n\t\t\t}\n\n\t\t}\n\n\t\treturn $sql;\n\t}", "private function joins()\r\n {\r\n /* SELECT* FROM DOCUMENT WHERE DOCUMENT.\"id\" IN ( SELECT ID FROM scholar WHERE user_company_id = 40 )*/\r\n\r\n $query = EyufScholar::find()\r\n ->select('id')\r\n ->where([\r\n 'user_company_id' => 40\r\n ])\r\n ->sql();\r\n\r\n $table = EyufDocument::find()\r\n ->where('\"id\" IN ' . $query)\r\n ->all();\r\n\r\n $second = EyufDocument::findAll(EyufScholar::find()\r\n ->select('id')\r\n ->where([\r\n 'user_company_id' => 40\r\n ])\r\n );\r\n\r\n vdd($second);\r\n }", "public static function doInnerJoin($table2, $params=NULL, $fields=array()) {\n\t\t$conn = parent::_initwgConnector($params, self::PRIMARY_KEY);\n\t\t$what = parent::_getSelectFields($fields);\n\t\t$conn->innerJoin(self::TABLE_NAME, $table2, $what);\n\t\treturn DbModel::doSelect($conn, new ProjectsListingsModel());\n\t}", "function test_setJoin()\n {\n $theQuestion = 'Why does this not work?';\n $theAnswer = 'I dont know!';\n\n $question = new MDB_QT(TABLE_QUESTION);\n $newQuest = array(TABLE_QUESTION => $theQuestion);\n $qid = $question->add($newQuest);\n $this->assertTrue($qid != false);\n\n $answer = new MDB_QT(TABLE_ANSWER);\n $newAnswer = array(TABLE_QUESTION.'_id' => $qid, TABLE_ANSWER => $theAnswer);\n $aid = $answer->add($newAnswer);\n $this->assertTrue($aid != false);\n\n $joinOn = TABLE_QUESTION.'.id='.TABLE_ANSWER.'.question_id';\n $question->setJoin(TABLE_ANSWER, $joinOn);\n \n if (DB_TYPE == 'ibase') {\n $expected = array(\n 't_answer_id' => $aid,\n 't_answer_answer' => $theAnswer,\n 't_answer_question_id' => $qid,\n 'id' => $qid,\n 'question' => $theQuestion,\n );\n } else {\n $expected = array(\n '_answer_id' => $aid,\n '_answer_answer' => $theAnswer,\n '_answer_question_id' => $qid,\n 'id' => $qid,\n 'question' => $theQuestion,\n );\n }\n $this->assertEqual($expected, $question->get($qid));\n }", "public function join($type, $col1, $col2) \n {\n // Make sure we have a valid type\n $type = strtoupper( \" \".$type );\n switch($type)\n {\n case \" INNER\":\n case \" LEFT\":\n case \" RIGHT\":\n case \" FULL\":\n break;\n default:\n $type = \" INNER\";\n break;\n }\n \n // Build our statement\n $this->sql .= $type .\" JOIN `\". $col1 .\"` ON `\". $col2 .\"`\";\n return $this;\n }", "public static function posts_join( $join_sql, $query ) {\n\t\t\tglobal $wpdb;\n\t\t\t$joins = array();\n\n\t\t\t$postmeta_table = self::postmeta_table( $query );\n\n\t\t\t$event_start_key = '_EventStartDate';\n\t\t\t$event_end_key = '_EventEndDate';\n\n\t\t\t/**\n\t\t\t * When the \"Use site timezone everywhere\" option is checked in events settings,\n\t\t\t * the UTC time for event start and end times will be used. This filter allows the\n\t\t\t * disabling of that in certain contexts, so that local (not UTC) event times are used.\n\t\t\t *\n\t\t\t * @since 4.6.10\n\t\t\t *\n\t\t\t * @param boolean $force_local_tz Whether to force the local TZ.\n\t\t\t */\n\t\t\t$force_local_tz = apply_filters( 'tribe_events_query_force_local_tz', false );\n\n\t\t\tif ( Tribe__Events__Timezones::is_mode( 'site' ) && ! $force_local_tz ) {\n\t\t\t\t$event_start_key .= 'UTC';\n\t\t\t\t$event_end_key .= 'UTC';\n\t\t\t}\n\n\t\t\t// if it's a true event query then we want create a join for where conditions\n\t\t\tif ( $query->tribe_is_event || $query->tribe_is_event_category || $query->tribe_is_multi_posttype ) {\n\t\t\t\tif ( $query->tribe_is_multi_posttype ) {\n\t\t\t\t\t// if we're getting multiple post types, we don't need the end date, just get the start date\n\t\t\t\t\t// for events-only post type queries, the start date postmeta join is already added by the main query args\n\t\t\t\t\t$joins['event_start_date'] = \" LEFT JOIN {$wpdb->postmeta} as {$postmeta_table} on {$wpdb->posts}.ID = {$postmeta_table}.post_id AND {$postmeta_table}.meta_key = '$event_start_key'\";\n\t\t\t\t} else {\n\t\t\t\t\t// for events-only post type queries, we should also get the end date for display\n\t\t\t\t\t$joins['event_end_date'] = \" LEFT JOIN {$wpdb->postmeta} as tribe_event_end_date ON ( {$wpdb->posts}.ID = tribe_event_end_date.post_id AND tribe_event_end_date.meta_key = '$event_end_key' ) \";\n\t\t\t\t}\n\t\t\t\t$joins = apply_filters( 'tribe_events_query_posts_joins', $joins, $query );\n\n\t\t\t\treturn $join_sql . implode( '', $joins );\n\t\t\t}\n\n\t\t\treturn $join_sql;\n\t\t}", "protected function build_join_on( $join, $table ) {\n\n $field_1 = $table . '.' . $join['on']['field'];\n $compare = $join['on']['compare'];\n $field_2 = ( $this->table_short !== '' ) ? $this->table_short : $this->table;\n $field_2 .= '.' . $join['on']['join_field'];\n\n return ' ON ' . $field_1 . ' ' . $compare . ' ' . $field_2;\n }", "public function join(SourceInterface $left, SourceInterface $right,\n $joinType, JoinConditionInterface $joinCondition);", "public function joinTable($joinTableName, $joinCondition, $joinType = \"INNER JOIN\") {\r\n $this->joinTable[] = array(\r\n \"table\" => $joinTableName,\r\n \"condition\" => $joinCondition,\r\n \"type\" => $joinType\r\n );\r\n return $this;\r\n }", "function cf_search_join( $join ) {\n\t global $wpdb;\n\n\t if ( is_search() ) { \n\t $join .=' LEFT JOIN '.$wpdb->postmeta. ' ON '. $wpdb->posts . '.ID = ' . $wpdb->postmeta . '.post_id ';\n\t }\n\t \n\t return $join;\n\t}", "protected function _addJoinTables()\n {\n $this->addTable('gems__respondents', array('gap_id_user' => 'grs_id_user'));\n\n if ($this->has('gap_id_organization')) {\n $this->addTable(\n 'gems__organizations',\n array('gap_id_organization' => 'gor_id_organization'),\n 'gor',\n false\n );\n }\n if ($this->has('gap_id_attended_by')) {\n $this->addLeftTable(\n 'gems__agenda_staff',\n array('gap_id_attended_by' => 'gas_id_staff'),\n 'gas',\n false\n );\n }\n /*\n if ($this->has('gap_id_referred_by')) {\n $this->addLeftTable(\n array('ref_staff' => 'gems__agenda_staff'),\n array('gap_id_referred_by' => 'ref_staff.gas_id_staff')\n );\n } // */\n if ($this->has('gap_id_activity')) {\n $this->addLeftTable(\n 'gems__agenda_activities',\n array('gap_id_activity' => 'gaa_id_activity'),\n 'gap',\n false\n );\n }\n if ($this->has('gap_id_procedure')) {\n $this->addLeftTable(\n 'gems__agenda_procedures',\n array('gap_id_procedure' => 'gapr_id_procedure'),\n 'gapr',\n false\n );\n }\n if ($this->has('gap_id_location')) {\n $this->addLeftTable(\n 'gems__locations',\n array('gap_id_location' => 'glo_id_location'),\n 'glo',\n false\n );\n }\n }", "public function create_join_table($model_one, $model_two) {\n $table_name = NimbleAssociation::generate_join_table_name(array($model_one, $model_two));\n $table = $this->create_table($table_name, array('id' => false));\n $table->references($model_one);\n $table->references($model_two);\n $table->go();\n }", "public function join($table, $column_one = null, $column_two = null, $type = '')\r\n {\r\n if (func_num_args() < 3) {\r\n @list($query, $params) = func_get_args();\r\n\r\n $params = (array) $params;\r\n\r\n $this->join[] = compact('query', 'params');\r\n\r\n $this->add_bind('join', $params);\r\n }\r\n\r\n else {\r\n $this->join[] = compact('table', 'column_one', 'column_two', 'type');\r\n }\r\n\r\n return $this;\r\n }", "public function addJoin($table, $condition, $joinType)\n {\n $this->appendSql($this->filterJoinType($joinType))->\n appendSql(' JOIN ')->\n appendSql($table)->\n appendSql(' ON ')->\n appendSql(\"({$condition})\");\n return $this;\n }", "public function _complex_join()\n {\n // LEFT JOIN `%1$sauth_group` on `%1$spro`.`depid` = `%1$sauth_group`.`id`\n // LEFT JOIN (SELECT a.* FROM `%1$sproout` as a INNER JOIN (SELECT max(`id`) as id FROM `%1$sproout` group by `jpid`) as b on a.id = b.id) as `%1$sproout` on `%1$spro`.`id` = `%1$sproout`.`jpid`\n // LEFT JOIN `%1$scust` on `%1$spro`.`cid` = `%1$scust`.`id`', C('DB_PREFIX'));\n\n $join = sprintf('LEFT JOIN `%1$sproin` ON `%1$spro`.`id` = `%1$sproin`.`jpid`\n LEFT JOIN `%1$sauth_group` on `%1$spro`.`depid` = `%1$sauth_group`.`id`\n LEFT JOIN `%1$sproout` on `%1$sproout`.`jpid` = `%1$spro`.`id`\n LEFT JOIN `%1$sproout` tmp_out on tmp_out.`jpid` = `%1$sproout`.`jpid` and tmp_out.`id` > `%1$sproout`.`id`\n LEFT JOIN `%1$scust` on `%1$spro`.`cid` = `%1$scust`.`id`', C('DB_PREFIX'));\n return $join;\n }", "private static function join(Table $table1, $rows1, Table $table2, $rows2, array $relation)\n {\n if ($relation[0] === Scheme::HAS_ONE) {\n list($table2, $rows2, $table1, $rows1) = [$table1, $rows1, $table2, $rows2];\n }\n\n foreach ($rows1 as $row) {\n $row->{$table2->getName()} = $table2->createCollection();\n }\n\n foreach ($rows2 as $row) {\n $id = $row->{$relation[1]};\n\n if (isset($rows1[$id])) {\n $rows1[$id]->{$table2->getName()}[] = $row;\n $row->{$table1->getName()} = $rows1[$id];\n } else {\n $row->{$table1->getName()} = null;\n }\n }\n }", "public function join($tb1,$tb2,$on=[],$mod=\"inner\"){\n\n\t\tif($this->name!=\"\"){\n\t\t\t$mod=$on;$on = $tb2;$tb2= $tb1;$tb1 = $this;\n\t\t}\n\n\t\tif(gettype($on)==\"string\") $on = [$on ,$on];\n\t\tif(gettype($mod)!=\"string\") $mod= \"inner\";\n\t\treturn new $this::$tclass($tb1,$tb2,$on,$mod);\n\n\t}", "private function hasMany($table, $foreignTableName) {\n $foreignTableName = strtolower($foreignTableName);\n assert('!empty($table->primaryKey); // table needs to have primary key defined for table join');\n\n // can we load the foreign table?\n if (class_exists(ucfirst($foreignTableName))) {\n // capitalize\n $foreignTableName = ucfirst($foreignTableName);\n // note the foreign table might have relationships of its own...\n $foreignTable = new $foreignTableName();\n assert('!empty($foreignTable->primaryKey); // foreign table needs to have primary key defined');\n\n // create the join where \"ourTable.ourId=foreignTable.ourTable_ourId\"\n $table->join($foreignTable->tableName, array(\n \"{$table->tableName}.{$table->primaryKey}\"\n => \"{$foreignTable->tableName}.{$table->tableName}_{$table->primaryKey}\"\n ));\n // as an added bonus, we might have a relationship in the foreign table, add it...\n $table->join .= $foreignTable->join;\n } else {\n // we will have to rely on our primary key\n // create the join where \"ourTable.ourId=foreignTable.ourTable_ourId\"\n $table->join($foreignTableName->tableName, array(\n \"{$table->tableName}.{$table->primaryKey}\"\n => \"{$foreignTableName->tableName}.{$table->tableName}_{$table->primaryKey}\"\n ));\n }\n }", "public function testWriteJoinSnippets()\n\t{\n\t\t$queryWriter = R::getWriter();\n\t\tasrt( ( $queryWriter instanceof SQLiteT ), TRUE );\n\t\t$snippet = $queryWriter->writeJoin( 'book', 'page' ); //default must be LEFT\n\t\tasrt( is_string( $snippet ), TRUE );\n\t\tasrt( ( strlen( $snippet ) > 0 ), TRUE );\n\t\tasrt( ' LEFT JOIN `page` ON `page`.id = `book`.page_id ', $snippet );\n\t\t$snippet = $queryWriter->writeJoin( 'book', 'page', 'LEFT' );\n\t\tasrt( is_string( $snippet ), TRUE );\n\t\tasrt( ( strlen( $snippet ) > 0 ), TRUE );\n\t\tasrt( ' LEFT JOIN `page` ON `page`.id = `book`.page_id ', $snippet );\n\t\t$snippet = $queryWriter->writeJoin( 'book', 'page', 'RIGHT' );\n\t\tasrt( is_string( $snippet ), TRUE );\n\t\tasrt( ( strlen( $snippet ) > 0 ), TRUE );\n\t\tasrt( ' RIGHT JOIN `page` ON `page`.id = `book`.page_id ', $snippet );\n\t\t$snippet = $queryWriter->writeJoin( 'book', 'page', 'INNER' );\n\t\tasrt( ' INNER JOIN `page` ON `page`.id = `book`.page_id ', $snippet );\n\t\t$exception = NULL;\n\t\ttry {\n\t\t\t$snippet = $queryWriter->writeJoin( 'book', 'page', 'MIDDLE' );\n\t\t}\n\t\tcatch(\\Exception $e) {\n\t\t\t$exception = $e;\n\t\t}\n\t\tasrt( ( $exception instanceof RedException ), TRUE );\n\t\t$errorMessage = $exception->getMessage();\n\t\tasrt( is_string( $errorMessage ), TRUE );\n\t\tasrt( ( strlen( $errorMessage ) > 0 ), TRUE );\n\t\tasrt( $errorMessage, 'Invalid JOIN.' );\n\t}", "public function testJoinWithoutAlias()\n {\n $query = (new Select($this->mockConnection))->join('join', 'join.tableId', '=', 'table.id');\n $array = $query->toArray();\n\n $this->assertInstanceOf(Select::class, $query);\n $this->assertArrayHasKey('join', $array);\n $this->assertCount(1, $array['join']);\n $this->assertEquals([\n 'type' => 'inner',\n 'table' => 'join',\n 'alias' => null,\n 'statement' => [\n 'where' => [\n [\n 'column' => 'join.tableId',\n 'operator' => '=',\n 'value' => 'table.id',\n 'boolean' => 'and',\n ]\n ],\n ]\n ], $array['join'][0]);\n $this->assertInstanceOf(Column::class, $array['join'][0]['statement']['where'][0]['value']);\n }", "public function getJoinType() {}", "public function join(...$params)\n {\n $this->tmpReindex = false;\n\n // Pass through to the builder\n $this->builder()->join(...$params);\n\n return $this;\n }", "public function rightJoin($table, $conditions = []);", "private function buildJoins(): void {\r\n\r\n if(count($this -> joins) > 0) {\r\n\r\n $query = [];\r\n\r\n foreach($this -> joins as $join) {\r\n\r\n $parts = [];\r\n $parts[] = sprintf('%s JOIN', strtoupper($join['type']));\r\n $parts[] = $join['table'];\r\n\r\n if(null !== $join['alias']) {\r\n $parts[] = $join['alias'];\r\n }\r\n\r\n if(null !== $join['conditions']) {\r\n $parts[] = sprintf('ON %s', $join['conditions']);\r\n }\r\n\r\n $query[] = implode(' ', $parts);\r\n }\r\n\r\n $this -> query[] = implode(' ', $query);\r\n }\r\n }", "public function joinCustomers()\n {\n $this->builder->join('customers', 'cus_id', 'rc_customer');\n }", "public function joinStudentToGroups(&$q, $from_table, $student_column, $join_group_info = false) {\n\t\t$q->join($from_table, \"StudentGroup\", array($student_column=>\"people\"));\n\t\tif ($join_group_info)\n\t\t\t$q->join(\"StudentGroup\", \"StudentsGroup\", array(\"group\"=>\"id\"));\n\t}", "private function addJoinOn($type, Query $other, $fieldOrExpr, $operator, $valueOrExpr) {\r\n\t\tif (!array_key_exists($other->_salt_alias, $this->_salt_joins)) {\r\n\t\t\tthrow new SaltException(L::error_query_missing_join($other->_salt_alias));\r\n\t\t}\r\n\r\n\t\t$absoluteField = $this->resolveFieldName(ClauseType::JOIN, $fieldOrExpr);\r\n\r\n\t\t$valueOrExpr = $this->resolveFieldName(ClauseType::JOIN, $valueOrExpr, $fieldOrExpr);\r\n\t\tif (is_array($valueOrExpr)) {\r\n\t\t\t$valueOrExpr = '('.implode(', ', $valueOrExpr).')';\r\n\t\t}\r\n\t\t$clause = $absoluteField.' '.$operator.' '.$valueOrExpr;\r\n\r\n\t\t$this->addJoinOnClause($other, $type, $clause);\r\n// \t\t$this->joins[$other->alias]['on'][]=' '.$type.' '.$clause;\r\n\t}" ]
[ "0.6536646", "0.65148723", "0.64792514", "0.6207479", "0.6196289", "0.61650527", "0.6162351", "0.60221905", "0.60143656", "0.6003059", "0.59235084", "0.59121704", "0.5903059", "0.5890913", "0.5884956", "0.57957774", "0.5773256", "0.57500005", "0.5719613", "0.5694283", "0.56920826", "0.5683201", "0.5675595", "0.56711227", "0.5646432", "0.5641884", "0.56344676", "0.5627238", "0.5623668", "0.5623376", "0.56145364", "0.56033504", "0.5595397", "0.55938447", "0.55873585", "0.5586424", "0.5572684", "0.55687433", "0.5562759", "0.5555011", "0.5543431", "0.55281115", "0.55078554", "0.5506212", "0.55041224", "0.5499409", "0.5492218", "0.5470142", "0.54636705", "0.5458903", "0.5452675", "0.5450725", "0.54456586", "0.5439441", "0.5428819", "0.54165834", "0.5394383", "0.5394029", "0.5390145", "0.53855944", "0.53853095", "0.5368831", "0.5337984", "0.53340286", "0.5330334", "0.5328348", "0.5326342", "0.5305712", "0.53031623", "0.52942514", "0.52914965", "0.528982", "0.5287163", "0.52821904", "0.52738076", "0.52698153", "0.52608955", "0.5259794", "0.5247278", "0.5234443", "0.52069247", "0.5204808", "0.51917654", "0.51900727", "0.5179114", "0.5176438", "0.51707083", "0.51643056", "0.51610005", "0.5160042", "0.5154775", "0.5154394", "0.5141179", "0.5140791", "0.51361966", "0.5123399", "0.5116373", "0.51150715", "0.51146924", "0.51136684" ]
0.57939756
16
Orders the result set by a given field. If called multiple times, the query will order by each specified field in the order this method is called. If the query uses DISTINCT or GROUP BY conditions, fields or expressions that are used for the order must be selected to be compatible with some databases like PostgreSQL. The PostgreSQL driver can handle simple cases automatically but it is suggested to explicitly specify them. Additionally, when ordering on an alias, the alias must be added before orderBy() is called.
public function orderBy($field, $direction = 'ASC');
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function orderBy($field) {\n\t$this->parseQuery->orderBy($field);\n }", "public function orderBy(string $field, string $direction): self;", "public function order($field, $order = 'desc');", "public function orderByAscending($field) {\n\t$this->parseQuery->orderByAscending($field);\n }", "public function orderBy($field, $asc = true)\n {\n if ($asc) {\n $this->order[] = \"$this->alias.$field ASC\";\n } else {\n $this->order[] = \"$this->alias.$field DESC\";\n }\n\n return $this;\n\n }", "public function orderByAsc($field, $overwrite = false);", "private function sql_orderBy()\n {\n // Get table and field\n list( $table, $field ) = explode( '.', $this->curr_tableField );\n\n // Short var\n $arr_order = null;\n $arr_order = $this->conf_view[ 'filter.' ][ $table . '.' ][ $field . '.' ][ 'order.' ];\n\n // Order field\n switch ( true )\n {\n case( $arr_order[ 'field' ] == 'uid' ):\n $orderField = $this->sql_filterFields[ $this->curr_tableField ][ 'uid' ];\n break;\n case( $arr_order[ 'field' ] == 'value' ):\n default:\n $orderField = $this->sql_filterFields[ $this->curr_tableField ][ 'value' ];\n break;\n }\n // Order field\n // Order flag\n switch ( true )\n {\n case( $arr_order[ 'orderFlag' ] == 'DESC' ):\n $orderFlag = 'DESC';\n break;\n case( $arr_order[ 'orderFlag' ] == 'ASC' ):\n default:\n $orderFlag = 'ASC';\n break;\n }\n // Order flag\n // Get ORDER BY statement\n $orderBy = $orderField . ' ' . $orderFlag;\n\n // RETURN ORDER BY statement\n return $orderBy;\n }", "public function orderBy($field, $direction = 'ASC')\n {\n $this->orderBy = $field;\n $this->orderByDirection = $direction;\n return $this;\n }", "protected static function _orderby($field, $order)\n {\n if ($field == \"\") {\n self::$orderby = null;\n } else {\n self::$orderby = sprintf(\" ORDER BY %s %s\", $field, $order);\n }\n }", "public function order($field, $direction = Operator::SORT_DESC)\n {\n if (empty($field)) {\n $this->order_str = '';\n return $this;\n }\n if (!empty($direction)){\n $direction = ltrim($direction, '$');\n }\n if (is_array($field)) {\n $output = array();\n foreach ($field as $item) {\n $output[] = \"`{$item}`\";\n }\n $field = implode(', ', $field);\n }\n else {\n $field = $this->escapeString($field);\n }\n $this->order_str = \"{$field} {$direction}\";\n return $this;\n }", "public function orderBy(array $fields, $order = null);", "public function orderBy($sField, $sOrder = Db::ASC)\n {\n $this->clause('ORDER BY', \"$sField $sOrder\");\n\n return $this;\n }", "public function addAscendingOrderBy($field)\n\t{\n\t\tparent::orderBy($field, self::ASC);\n\t\treturn $this;\n\t}", "public function orderBy(string $field, string $direction = null): static\n {\n if ($direction === null) {\n $direction = 'ASC';\n } else {\n $direction = strtoupper($direction);\n }\n\n $this->orderBy[] = [\n 'field' => $field,\n 'direction' => $direction\n ];\n\n return $this;\n }", "public function orderBy($field, $direction = self::DESC) {\n if (is_array($field)) {\n foreach ($field as $key => $dir) {\n $this->orderBy($key, $dir);\n }\n\n } else if ($field === 'RAND') {\n $this->_orderBy[] = $this->func('RAND');\n\n } else if ($field instanceof Func) {\n $this->_orderBy[] = $field;\n\n } else {\n $direction = strtolower($direction);\n\n if ($direction != self::ASC && $direction != self::DESC) {\n throw new InvalidArgumentException(sprintf('Invalid order direction %s for field %s', $direction, $field));\n }\n\n $this->_orderBy[$field] = $direction;\n }\n\n return $this;\n }", "public function orderBy(string $field, string $type=''): QueryBuilderInterface\n\t{\n\t\t// When ordering by random, do an ascending order if the driver\n\t\t// doesn't support random ordering\n\t\tif (stripos($type, 'rand') !== FALSE)\n\t\t{\n\t\t\t$rand = $this->driver->getSql()->random();\n\t\t\t$type = $rand ?? 'ASC';\n\t\t}\n\n\t\t// Set fields for later manipulation\n\t\t$field = $this->driver->quoteIdent($field);\n\t\t$this->state->setOrderArray($field, $type);\n\n\t\t$orderClauses = [];\n\n\t\t// Flatten key/val pairs into an array of space-separated pairs\n\t\tforeach($this->state->getOrderArray() as $k => $v)\n\t\t{\n\t\t\t$orderClauses[] = $k . ' ' . strtoupper($v);\n\t\t}\n\n\t\t// Set the final string\n\t\t$orderString = ! isset($rand)\n\t\t\t? \"\\nORDER BY \".implode(', ', $orderClauses)\n\t\t\t: \"\\nORDER BY\".$rand;\n\n\t\t$this->state->setOrderString($orderString);\n\n\t\treturn $this;\n\t}", "public function orderby($field, $direction = 'ASC')\n\t\t{\n\t\t\t$this->order[] = \"$field $direction\";\n\t\t\treturn $this;\n\t\t}", "public function orderBy() {\n $this->_orderBy = \"\";\n foreach ($this->_columns as $tableName => $table) {\n if (array_key_exists('order_bys', $table)) {\n foreach ($table['order_bys'] as $fieldName => $field) {\n $this->_orderBy[] = $field['dbAlias'];\n }\n }\n }\n $this->_orderBy = \"ORDER BY \" . implode(', ', $this->_orderBy) . \" \";\n }", "public function andThenAscendingBy(string $field): ExtensibleSorting;", "public function orders($field, $reversive = false) {\n\t\t\t$sort = ($reversive) ? 'DESC' : 'ASC';\n\t\t\t$this->order = \"ORDER BY `$field` $sort\";\n\t\t\treturn $this;\n\t\t}", "public static function order( $column, $order, $use_alias = true ) {\n\t\t\tif( self::$query_open ) {\n self::$current_query->order( $column, $order, $use_alias );\n }\n\t\t}", "public function orderBy($field, $direction = 'asc'): self\n\t{\n\t\t$this->orders[] = [\n\t\t\t$field => strtolower($direction) === 'asc' ? 'asc' : 'desc',\n\t\t];\n\n\t\treturn $this;\n\t}", "public function it_sorts_by_field_in_ascending_order(): void\n {\n $results = Client::filter([\n 'sorts' => [\n [\n 'column' => 'name',\n 'direction' => 'asc',\n ],\n ],\n ])->get();\n\n self::assertEquals($results->sortBy('name')->pluck('id'), $results->pluck('id'));\n }", "public function orderBy(string $field, string $order='ASC', string $condition = '', $included = false, array $parameters = [ ], bool $useCache = false): array {\n return DAO::orderBy($this->getModel(), $field, $order, $condition, $included, $parameters, $useCache);\n }", "public function orderBy($field, $direction = self::ASC)\n {\n if (!array_key_exists('orderby', $this->options)) {\n $this->options['orderby'] = [];\n }\n $this->options['orderby'][] = $field . ' ' . $direction;\n\n return $this;\n }", "public function orderByDescending($field) {\n\t$this->parseQuery->orderByDescending($field);\n }", "public function sort_asc($field)\n {\n return $this->sort($field,self::ASC);\n }", "function orderByClause( $orderby ) {\n\t global $wpdb;\n\t return \"dm.meta_value+0 {$this->order}, $wpdb->posts.post_title ASC\";\n\t}", "public static function order_field($title_field,$field_select, $field_sorting = '', $sort_direct ='')\n\t{\n\t\t$url = $_SERVER['REQUEST_URI'];\n\t\t$url = trim(preg_replace('/&sortby=[a-zA-Z0-9_]+/i', '', $url)); // field\n\t\t$url = trim(preg_replace('/&sort=[a-z]+/i', '', $url)); // direct\n\t\t\n\t\t$sort_direct = $sort_direct?$sort_direct:'asc';\n\t\t$sort_direct_continue = $sort_direct == 'asc' ? 'desc' : 'asc';\n\t\t$link = $url.'&sortby='.$field_select.'&sort='.$sort_direct_continue;\n\t\tif($field_select == $field_sorting)\n\t\t{\n\t\t\t$html = \"<a title=\\\"Click to sort by this column\\\" href=\\\"$link\\\">\";\n\t\t\t$html .= $title_field ;\n\t\t\t$html .= \"<img alt=\\\"$sort_direct\\\" src=\\\"templates/default/images/sort_$sort_direct.png\\\">\";\n\t\t\t$html .= \"</a>\";\n\t\t\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$html = \"<a title=\\\"Click to sort by this column\\\" href=\\\"$link\\\">$title_field</a>\";\n\t\t}\n\t\treturn $html ; \n\t}", "public function order($field, $dir = 'ASC', $reset = false) {\n\t\tif($reset == 'reset' || $reset)\n\t\t\t$this->_order_cond = array();\n\t\t\n\t\t$field = ctype_alnum($field) ? \"`$field`\" : $field;\n\t\tif(!$field) return $this;\n\t\t$dir = ctype_alnum($dir) ? strtoupper($dir) : 'ASC';\n\t\t$this->_order_cond[] = \"$field $dir\";\n\t\treturn $this;\n\t\t\n\t}", "function SortBy ( $cField )\n{\n $cField = $this->_FixCase_($cField);\n $cValue = '';\n if ( empty($this->_SortNameList) ) {\n if ( $this->_SortAllFields )\n $cValue = empty($this->_PrimaryKeyStr) ? $cField : $cField.','.$this->_PrimaryKeyStr;\n } else {\n $cValue = $this->_SortNameList[$cField];\n if ( empty($cVAlue) && $this->_SortAllFields )\n $cValue = empty($this->_PrimaryKeyStr) ? $cField : $cField.','.$this->_PrimaryKeyStr;\n }\n if ( empty($cValue) ) return false;\n\n $this->KeyName($cValue);\n return $this->SearchCurr();\n}", "public function setOrder($field, $direction = 'ASC')\n {\n return $this->orderBy = array(\n 'field' => $field,\n 'direction' => $direction\n );\n }", "public function orderAsc($fieldOrExpr) {\r\n\t\t$this->_salt_orders[]=$this->resolveFieldName(ClauseType::ORDER, $fieldOrExpr).' ASC';\r\n\t}", "public function orderBy(/* Variable */) {\n\n $child = $this->createChild(null, array(), null);\n $child->_comparatorFunction = null;\n\n $args = func_get_args();\n\n return call_user_func_array(array($child, 'thenOrderBy'), $args);\n }", "public function getQueryOrderby() {\n return '`'.$this->name.'`';\n }", "public function queryAllWithOwnersAndContributorsSortedBy($field)\n {\n $q = $this->createQueryBuilder('bundle')\n ->select('bundle, owner, contributors')\n ->leftJoin('bundle.owner', 'owner')\n ->leftJoin('bundle.contributors', 'contributors')\n ->addOrderBy('bundle.' . $field, 'name' === $field ? 'asc' : 'desc')\n ->addOrderBy('bundle.score', 'desc')\n ->addOrderBy('bundle.lastCommitAt', 'desc')\n ->getQuery();\n\n return $q;\n }", "public function setOrderField($x) { $this->orderField = $x; }", "public function orderBy($fields)\n\t{\n\t\t$this->query->orderBy($fields);\n\n\t\treturn $this;\n\t}", "function click_sort($order) {\n if (isset($this->real_field)) {\n // Since fields should always have themselves already added, just\n // add a sort on the field.\n $params = array('type' => 'numeric');\n $this->query->add_orderby($this->table_alias, $this->real_field, $order, $this->field_alias, $params);\n }\n }", "public function orderBy($fields, $overwrite = false);", "public function order($field, $value)\n {\n $this->orders[$field] = $value;\n return $this;\n }", "public function orderBy($column, $direction = 'asc');", "public function order_by() {\r\n\t\t$fields = func_get_args();\r\n\r\n\t\t// Loop through the columns\r\n\t\tfor ( $i = 0; $i < intval( $_GET['iSortingCols'] ); $i++ ) {\r\n\t\t\t// Add the necessary comman\r\n\t\t\tif ( !empty( $this->order_by ) )\r\n\t\t\t\t$this->order_by .= ',';\r\n\t\t\t\r\n\t\t\t// Compile the fields\r\n\t\t\t$this->order_by .= $fields[$_GET['iSortCol_' . $i]] . ' ' . $_GET['sSortDir_' . $i];\r\n\t\t}\r\n\t\t\r\n\t\t// If it's not empty\r\n\t\tif ( !empty( $this->order_by ) )\r\n\t\t\t$this->order_by = ' ORDER BY ' . $this->order_by;\r\n\t}", "public function orderBy($column, $dir): QueryBuilderInterface;", "function sort($fieldname, $direction = \"ASC\")\n\t{\n\t\t$this->table->sort = $fieldname;\n\t\t$this->table->direction = $direction;\n\t}", "private function _orderByField($sql, $bind)\r\n {\r\n preg_match('/ order by field\\((.*)\\)$/si', $sql, $matches);\r\n $oldClause = $matches[0];\r\n $values = explode(',', $matches[1]);\r\n\r\n $field = array_shift($values);\r\n\r\n $newClause = \" order by case $field\";\r\n for ($i = 0, $size = count($values); $i < $size; $i++)\r\n {\r\n $newClause .= \" when {$values[$i]} then $i\";\r\n }\r\n $newClause .= ' end';\r\n\r\n $sql = str_replace($oldClause, $newClause, $sql);\r\n\r\n return array($sql, $bind);\r\n }", "public function SetSortField($Field)\n\t\t{\n\t\t\t$this->_pricesortfield = $Field;\n\t\t}", "function getAllPlayersOrderBy($field){\n\t$query = \"SELECT * FROM aquigaza_fsutt_local.players ORDER by \".$field;\n $resource = runQuery($query);\n\treturn ozRunQuery($resource);\n}", "public function orderBy($sql);", "public function orderBy($direction = \"ASC\",$column);", "public function queryAllOrderBy($orderColumn);", "public function queryAllOrderBy($orderColumn);", "public function queryAllOrderBy($orderColumn);", "public function queryAllOrderBy($orderColumn);", "public function queryAllOrderBy($orderColumn);", "public function queryAllOrderBy($orderColumn);", "public function queryAllOrderBy($orderColumn);", "public function queryAllOrderBy($orderColumn);", "public function queryAllOrderBy($orderColumn);", "public function queryAllOrderBy($orderColumn);", "public function queryAllOrderBy($orderColumn);", "public function queryAllOrderBy($orderColumn);", "public function queryAllOrderBy($orderColumn);", "public function queryAllOrderBy($orderColumn);", "public function queryAllOrderBy($orderColumn);", "public function queryAllOrderBy($orderColumn);", "public function queryAllOrderBy($orderColumn);", "public function queryAllOrderBy($orderColumn);", "public function queryAllOrderBy($orderColumn);", "public function queryAllOrderBy($orderColumn);", "public function queryAllOrderBy($orderColumn);", "public function queryAllOrderBy($orderColumn);", "public function queryAllOrderBy($orderColumn);", "public function queryAllOrderBy($orderColumn);", "public function queryAllOrderBy($orderColumn);", "public function queryAllOrderBy($orderColumn);", "function order_by($order_by, $direction = 'ASC')\n {\n // Make an exception for the rand() method\n $order_by = preg_replace(\"/rand\\\\(\\\\s*\\\\)/\", 'rand', $order_by);\n if (in_array($order_by, $this->object->_get_querable_table_columns())) {\n $this->object->_query_args['orderby'] = $order_by;\n } else {\n // ordering by a meta value\n $this->object->_query_args['orderby'] = 'meta_value';\n $this->object->_query_args['meta_key'] = $order_by;\n }\n $this->object->_query_args['order'] = $direction;\n return $this->object;\n }", "private function orderBy($param) {\n if (isset($param['column']) && isset($param['type'])) {\n $this->sql .= 'ORDER BY ' . $param['column'] . ' ' . $param['type'] . ' ';\n }\n }", "public function orderByDesc($field, $overwrite = false);", "public function &getOrderBy();", "public function andThenDescendingBy(string $field): ExtensibleSorting;", "function order_by($params, $default_field, $default_order = 'ASC') {\r\n \tif (isset($params['sortby'])) {\r\n \t\t$default_field = $params['sortby'];\r\n \t}\r\n\r\n \tif (isset($params['sortdir'])) {\r\n \t\t$default_order = $params['sortdir'];\r\n \t}\r\n\r\n \treturn \"ORDER BY $default_field $default_order\";\r\n\r\n }", "function mycpt_custom_orderby( $query ) {\n if ( ! is_admin() )\n return;\n \n $orderby = $query->get( 'orderby');\n \n if ( 'email' == $orderby ) {\n $query->set( 'meta_key', 'email' );\n $query->set( 'orderby', 'meta_value' );\n }\n else if( 'company' == $orderby ) {\n $query->set( 'meta_key', 'company');\n $query->set( 'orderby', 'meta_value');\n } else {\n $query->set( 'orderby', 'title');\n }\n}", "public function orderBy($vars){\n\t\t\t$string = self::ORDER_BY;\n\t\t\t\n\t\t\t$cpt = 0;\n\t\t\tforeach($vars as $var){\n\t\t\t\t$string .= ' ' . $var;\n\t\t\t\tif(($cpt+1) < count($vars)){\n\t\t\t\t\t$string .= ', ';\n\t\t\t\t}\n\t\t\t}\n\t\t\t$this->_query .= $string . ' ';\n\t\t\treturn $this->_returnObject ? $this : $string;\n\t\t}", "public static function order($fields)\n {\n $order = self::set(\"order\");\n\n $order = Validator::contains($order)->validate($fields)? $order: null;\n\n return $order? \" ORDER BY {$order}\": null;\n }", "public function addDescendingOrderBy($field)\n\t{\n\t\tparent::orderBy($field, self::DESC);\n\t\treturn $this;\n\t}", "public function asc($field)\n {\n $this->sorts[SCT::toHyphen($field)] = 'asc';\n return $this;\n }", "public function getOrderByClause() {\n\n\t\ttx_pttools_assert::isTrue($this->isSortable, array('message' => 'This column is not sortable'));\n\t\tswitch ($this->sortingState) {\n\t\t\tcase self::SORTINGSTATE_NONE: {\n\t\t\t\t$orderBy = '';\n\t\t\t} break;\n\n\t\t\tcase self::SORTINGSTATE_ASC: {\n\t\t\t\t$orderBy = sprintf('%s.%s %s', $this->table, $this->field, 'ASC');\n\t\t\t} break;\n\n\t\t\tcase self::SORTINGSTATE_DESC: {\n\t\t\t\t$orderBy = sprintf('%s.%s %s', $this->table, $this->field, 'DESC');\n\t\t\t} break;\n\n\t\t\tdefault: {\n\t\t\t\tthrow new tx_pttools_exception('Invalid sorting state!');\n\t\t\t} break;\n\t\t}\n\t\treturn $orderBy;\n\t}", "public function groupBy($field, $asc = true)\n {\n if ($asc) {\n $this->groupBy[] = \" $this->alias.$field ASC\";\n } else {\n $this->groupBy[] = \" $this->alias.$field DESC\";\n }\n \n return $this;\n }", "public function orderDesc($fieldOrExpr) {\r\n\t\t$this->_salt_orders[]=$this->resolveFieldName(ClauseType::ORDER, $fieldOrExpr).' DESC';\r\n\t}", "public function orderBy($column, $direction = 'asc')\n {\n\n }", "public function getOrderField()\n\t{\n\t\treturn $this->orderField;\n\t}", "protected function create_entity_order_by( $field_name, $sort_order = \\PostFinanceCheckout\\Sdk\\Model\\EntityQueryOrderByType::DESC ) {\n\t\t$order_by = new \\PostFinanceCheckout\\Sdk\\Model\\EntityQueryOrderBy();\n\t\t$order_by->setFieldName( $field_name );\n\t\t$order_by->setSorting( $sort_order );\n\t\treturn $order_by;\n\t}", "public function sort($field, $order = 1)\n {\n $this->sort[$field] = $order;\n\n return $this;\n }", "public function orderBy(){\r\n $this->orderBy = \"ORDER BY \";\r\n $args = func_get_args();\r\n foreach($args as $arg){\r\n $this->orderBy.= $this->db->formatTableName($arg);\r\n if(end($args) !== $arg){\r\n $this->orderBy.=\", \";\r\n } \r\n\r\n }\r\n return $this;\r\n }", "public function custom_column_orderby( $query ) {\n\n\t\tif ( ! isset( $_GET['post_type'] ) || 'ticket' !== $_GET['post_type'] ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$fields = $this->get_custom_fields();\n\t\t$orderby = $query->get( 'orderby' );\n\n\t\tif ( ! empty( $orderby ) && array_key_exists( $orderby, $fields ) ) {\n\n\t\t\tif ( 'taxonomy' != $fields[ $orderby ]['args']['field_type'] ) {\n\t\t\t\t$query->set( 'meta_key', '_dev_' . $orderby );\n\t\t\t\t$query->set( 'orderby', 'meta_value' );\n\t\t\t}\n\n\t\t}\n\n\t}", "private function setCustomOrderBy()\n\t{\n\t\tif (!$this->useDataProvider && $this->customQuery->orderBy) {\n\t\t\t$this->orderBy = $this->customQuery->orderBy;\n\t\t} else {\n\t\t\t$this->sort = $this->customQuery->orderBy; //set $this->sort property for dataProvider sorting\n\t\t}\n\n\t\treturn $this;\n\t}", "function sortBy($field, &$array, $direction = 'asc')\n{\n usort($array, create_function('$a, $b', '\n $a = $a[\"' . $field . '\"];\n $b = $b[\"' . $field . '\"];\n\n if ($a == $b) return 0;\n\n $direction = strtolower(trim($direction));\n\n return ($a ' . ($direction == 'desc' ? '>' : '<') . ' $b) ? -1 : 1;\n '));\n\n return true;\n}", "public function orderBy( $column, $type = self::ASC )\n {\n if ( $this->invertedOrderString )\n {\n $this->invertedOrderString .= ', ';\n }\n else\n {\n $this->invertedOrderString = 'ORDER BY ';\n }\n $this->invertedOrderString .= $column . ' ' . ( $type == self::ASC ? self::DESC : self::ASC );\n return parent::orderBy( $column, $type );\n }", "protected function renderSort($field)\n {\n if ((empty(Request::get($this->sort_param)) && $field == $this->default_field) || (Request::get($this->sort_param) == $field . ' ASC')) {\n return [' -highlight', $field . ' DESC', 'descending', Icon::get('arrow-up')];\n } elseif (Request::get($this->sort_param) == $field . ' DESC') {\n return [' -highlight', $field . ' ASC', 'ascending', ' ' . Icon::get('arrow-down')];\n } else {\n return [null, $field . ' ASC', 'ascending', null];\n }\n }" ]
[ "0.73414195", "0.7023737", "0.68529433", "0.65752697", "0.6446628", "0.641468", "0.6392131", "0.6306023", "0.6282514", "0.62677413", "0.61999613", "0.6189228", "0.6186102", "0.60662365", "0.60408", "0.6035906", "0.60312444", "0.6020376", "0.6008956", "0.59658694", "0.5945983", "0.594381", "0.59414095", "0.5935962", "0.59108114", "0.5818767", "0.57897717", "0.5773584", "0.5751107", "0.57133645", "0.56946194", "0.56827337", "0.56640637", "0.5647221", "0.5646604", "0.5643928", "0.56408054", "0.56112754", "0.5593523", "0.5586684", "0.556672", "0.55343395", "0.5522337", "0.5520464", "0.5492004", "0.54771346", "0.5472144", "0.5466654", "0.5465897", "0.545465", "0.54496336", "0.54496336", "0.54496336", "0.54496336", "0.54496336", "0.54496336", "0.54496336", "0.54496336", "0.54496336", "0.54496336", "0.54496336", "0.54496336", "0.54496336", "0.54496336", "0.54496336", "0.54496336", "0.54496336", "0.54496336", "0.54496336", "0.54496336", "0.54496336", "0.54496336", "0.54496336", "0.54496336", "0.54496336", "0.54496336", "0.54403824", "0.5434459", "0.5426466", "0.54150337", "0.5409243", "0.53923076", "0.53462446", "0.5343025", "0.5333604", "0.5317889", "0.5304128", "0.5296017", "0.52862936", "0.52755743", "0.52574843", "0.5256434", "0.5246664", "0.5217517", "0.52118427", "0.5201991", "0.51909786", "0.5189132", "0.5167181", "0.51634777" ]
0.7079249
1
Orders the result set by a random value. This may be stacked with other orderBy() calls. If so, the query will order by each specified field, including this one, in the order called. Although this method may be called multiple times on the same query, doing so is not particularly useful. Note: The method used by most drivers may not scale to very large result sets. If you need to work with extremely large data sets, you may create your own database driver by subclassing off of an existing driver and implementing your own randomization mechanism. See for an example of such an alternate sorting mechanism.
public function orderRandom();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function orderRand(Varien_Db_Select $select, $field = null)\n {\n $this->_getReadAdapter()->orderRand($select, $field);\n return $this;\n }", "public function orderRand($seed = null)\n {\n $this->orderBy(NULL, $this->driver->sqlRandom($seed));\n return $this;\n }", "public function orderBy(string $field, string $type=''): QueryBuilderInterface\n\t{\n\t\t// When ordering by random, do an ascending order if the driver\n\t\t// doesn't support random ordering\n\t\tif (stripos($type, 'rand') !== FALSE)\n\t\t{\n\t\t\t$rand = $this->driver->getSql()->random();\n\t\t\t$type = $rand ?? 'ASC';\n\t\t}\n\n\t\t// Set fields for later manipulation\n\t\t$field = $this->driver->quoteIdent($field);\n\t\t$this->state->setOrderArray($field, $type);\n\n\t\t$orderClauses = [];\n\n\t\t// Flatten key/val pairs into an array of space-separated pairs\n\t\tforeach($this->state->getOrderArray() as $k => $v)\n\t\t{\n\t\t\t$orderClauses[] = $k . ' ' . strtoupper($v);\n\t\t}\n\n\t\t// Set the final string\n\t\t$orderString = ! isset($rand)\n\t\t\t? \"\\nORDER BY \".implode(', ', $orderClauses)\n\t\t\t: \"\\nORDER BY\".$rand;\n\n\t\t$this->state->setOrderString($orderString);\n\n\t\treturn $this;\n\t}", "function order_by($order_by, $direction = 'ASC')\n {\n // Make an exception for the rand() method\n $order_by = preg_replace(\"/rand\\\\(\\\\s*\\\\)/\", 'rand', $order_by);\n if (in_array($order_by, $this->object->_get_querable_table_columns())) {\n $this->object->_query_args['orderby'] = $order_by;\n } else {\n // ordering by a meta value\n $this->object->_query_args['orderby'] = 'meta_value';\n $this->object->_query_args['meta_key'] = $order_by;\n }\n $this->object->_query_args['order'] = $direction;\n return $this->object;\n }", "function order_by($order_by, $direction = 'ASC')\n {\n // We treat the rand() function as an exception\n if (preg_match(\"/rand\\\\(\\\\s*\\\\)/\", $order_by)) {\n $order = 'rand()';\n } else {\n $order_by = $this->object->_clean_column($order_by);\n // If the order by clause is a column, then it should be backticked\n if ($this->object->has_column($order_by)) {\n $order_by = \"`{$order_by}`\";\n }\n $direction = $this->object->_clean_column($direction);\n $order = \"{$order_by} {$direction}\";\n }\n $this->object->_order_clauses[] = $order;\n return $this->object;\n }", "public function orderBy($field, $direction = 'ASC');", "public function orderBy(string $field, string $direction): self;", "public function random()\n {\n $values = [];\n $priorities = [];\n foreach ($this->values as $columns) {\n foreach ($columns as $column) {\n $values[] = $column[0];\n $priorities[] = $column[1];\n }\n }\n\n $key = 0;\n $sum = array_sum($priorities);\n $random = mt_rand(0, $sum);\n foreach ($priorities as $key => $priority) {\n if ($random <= $priority) break;\n $random -= $priority;\n }\n\n return $values[$key];\n }", "public function order($field, $order = 'desc');", "public function getRandomValue()\n {\n if ($this->isNativeField()) {\n switch ($this->getDataType()) {\n case DField::DATA_TYPE_TINYINT:\n case DField::DATA_TYPE_SMALLINT:\n case DField::DATA_TYPE_MEDIUMINT:\n case DField::DATA_TYPE_INT:\n case DField::DATA_TYPE_BIGINT:\n $value = rand(0, 100);\n break;\n case DField::DATA_TYPE_FLOAT:\n $value = rand(10, 1000) / 10;\n break;\n default:\n $value = null;\n break;\n }\n } else {\n $value = null;\n }\n\n return $value;\n }", "public function it_sorts_by_field_in_ascending_order(): void\n {\n $results = Client::filter([\n 'sorts' => [\n [\n 'column' => 'name',\n 'direction' => 'asc',\n ],\n ],\n ])->get();\n\n self::assertEquals($results->sortBy('name')->pluck('id'), $results->pluck('id'));\n }", "private function select_random() {\n $ad = $this->db_wrapper->select_data($this->table_name, '*', null, 1, 'RAND()');\n if($ad) {\n $ad = array_flat($ad);\n \n $this->ad_code = $ad['adcode'];\n $this->ad_id = $ad['ad_id'];\n $this->ad_title = $ad['ad_title'];\n }\n }", "public function orderBy($column, $direction = 'asc') {\n if($column == 'rand') {\n $this->order_by[] = 'rand';\n } else {\n if(!is_array($column)) {\n $column = array($column => $direction);\n }\n foreach($column as $col => $d) {\n $this->order_by[] = array($col, $d);\n }\n }\n return $this;\n }", "public function randomQuestion() {\n return\n $this->createQueryBuilder('qb')\n ->orderBy('RAND()')\n ->setMaxResults($this->maxResult)\n ->getQuery()\n ->getResult()\n ;\n }", "public function orderBy($field, $direction = self::DESC) {\n if (is_array($field)) {\n foreach ($field as $key => $dir) {\n $this->orderBy($key, $dir);\n }\n\n } else if ($field === 'RAND') {\n $this->_orderBy[] = $this->func('RAND');\n\n } else if ($field instanceof Func) {\n $this->_orderBy[] = $field;\n\n } else {\n $direction = strtolower($direction);\n\n if ($direction != self::ASC && $direction != self::DESC) {\n throw new InvalidArgumentException(sprintf('Invalid order direction %s for field %s', $direction, $field));\n }\n\n $this->_orderBy[$field] = $direction;\n }\n\n return $this;\n }", "public function random($num = 10) {\n if ($this->count() < $num) {\n return $this->getAll();\n }\n return $this->model->all()->random($num);\n }", "function fixtures_fetch_random_value( string $table ,\n string $field ) : mixed\n{\n // Fetch an entry in the database\n $drand = mysqli_fetch_array(query(\" SELECT $table.$field AS 'u_value'\n FROM $table\n ORDER BY RAND()\n LIMIT 1 \"));\n\n // Return the ID\n return $drand['u_value'];\n}", "public function orderBy(array $fields, $order = null);", "public static function random(){\n $conexion = StorianDB::connectDB();\n $query = $conexion->query(\"SELECT * FROM cuento ORDER BY RAND() LIMIT 1\");\n return $tabla = $query->fetchObject();\n }", "public function orderByAsc($field, $overwrite = false);", "public function orderBy($field) {\n\t$this->parseQuery->orderBy($field);\n }", "function getAllPlayersOrderBy($field){\n\t$query = \"SELECT * FROM aquigaza_fsutt_local.players ORDER by \".$field;\n $resource = runQuery($query);\n\treturn ozRunQuery($resource);\n}", "public function random()\n {\n return $this->items[array_rand($this->items)];\n }", "public function findRandom()\n {\n return $this->createQueryBuilder('q')\n ->select('q', 'COUNT(l) AS nbLikes')\n ->leftJoin('q.likes', 'l')\n ->orderBy('RAND()')\n ->groupBy('q')\n ->setMaxResults(1)\n ->getQuery()\n ->getOneOrNullResult();\n }", "private function sql_orderBy()\n {\n // Get table and field\n list( $table, $field ) = explode( '.', $this->curr_tableField );\n\n // Short var\n $arr_order = null;\n $arr_order = $this->conf_view[ 'filter.' ][ $table . '.' ][ $field . '.' ][ 'order.' ];\n\n // Order field\n switch ( true )\n {\n case( $arr_order[ 'field' ] == 'uid' ):\n $orderField = $this->sql_filterFields[ $this->curr_tableField ][ 'uid' ];\n break;\n case( $arr_order[ 'field' ] == 'value' ):\n default:\n $orderField = $this->sql_filterFields[ $this->curr_tableField ][ 'value' ];\n break;\n }\n // Order field\n // Order flag\n switch ( true )\n {\n case( $arr_order[ 'orderFlag' ] == 'DESC' ):\n $orderFlag = 'DESC';\n break;\n case( $arr_order[ 'orderFlag' ] == 'ASC' ):\n default:\n $orderFlag = 'ASC';\n break;\n }\n // Order flag\n // Get ORDER BY statement\n $orderBy = $orderField . ' ' . $orderFlag;\n\n // RETURN ORDER BY statement\n return $orderBy;\n }", "public function fetchRandomQuote()\n {\n $idArray = $this->fetchQuoteId();\n // shuffle the array \n shuffle($idArray);\n $randomId = $idArray[0];\n return $this->fetchQuoteDetails($randomId);\n }", "public function orderby(){\n\n $rows = $this\n ->db\n ->order_by(\"title\", \"asc\")\n ->order_by(\"id\", \"random\")\n ->get(\"personel\")\n ->result();\n\n print_r($rows);\n\n }", "function orderByClause( $orderby ) {\n\t global $wpdb;\n\t return \"dm.meta_value+0 {$this->order}, $wpdb->posts.post_title ASC\";\n\t}", "protected function _getRandomAuthor()\n {\n $sth = $this->_dbObj->prepare('SELECT author FROM ' . $this->_quotesTable)->execute();\n $authors = $sth->fetchAllAssoc();\n\n $randomKey = array_rand($authors);\n\n return $authors[$randomKey]['author'];\n }", "public function findAllOverruleOrderBy()\n {\n $mockResult = $this->getMock('stubDatabaseResult');\n $this->mockConnection->expects($this->any())->method('query')->will($this->returnValue($mockResult));\n $mockResult->expects($this->once())\n ->method('fetchAll')\n ->will($this->returnValue(array(array('bar' => 'Here is bar.', 'default' => 'And this is default.'))));\n $finderResult = $this->dbFinder->findAll($this->mockConnection, new stubReflectionClass('MockSinglePrimaryKeyEntity'), 'blub DESC');\n $this->assertEquals(1, $finderResult->count());\n $data = $finderResult->current();\n $this->assertEquals('Here is bar.', $data->withAnnotation());\n $this->assertEquals('And this is default.', $data->withDefaultValue());\n $select = $this->mockQueryBuilder->getSelect();\n $this->assertEquals('foo', $select->getBaseTableName());\n $this->assertEquals('blub DESC', $select->getOrderedBy());\n $this->assertFalse($select->hasLimit());\n $this->assertNull($select->getOffset());\n $this->assertNull($select->getAmount());\n $this->assertFalse($select->hasCriterion());\n }", "private function applyOrderByClause(&$s, &$orderBy) {\n\n if (empty($orderBy)) {\n return;\n }\n\n foreach($orderBy as $fieldName => $dir) {\n\n // Special-case 'RAND()',\n if (strcasecmp('RAND()', $fieldName) === 0) {\n $s->orderBy('RAND()');\n continue;\n }\n\n $info = Octopus_Model_Restriction_Field::parseFieldExpression($fieldName, $this->getModelInstance());\n extract($info);\n\n if ($field === $this->getModelPrimaryKey()) {\n Octopus_Model_Field::defaultOrderBy($field, $dir, $s, $s->params, $this->getModelInstance());\n continue;\n }\n\n $f = $this->getModelField($field);\n\n if (!$f) {\n throw new Octopus_Model_Exception(\"Field not found on {$this->getModel()}: $field\");;\n }\n\n $f->orderBy($subexpression, $dir, $s, $s->params, $this->getModelInstance());\n }\n\n }", "public function orderBy($fields, $overwrite = false);", "public function random()\r\n\t{\r\n\t\treturn $this->_items[array_rand($this->_items)];\r\n\t}", "protected static function _orderby($field, $order)\n {\n if ($field == \"\") {\n self::$orderby = null;\n } else {\n self::$orderby = sprintf(\" ORDER BY %s %s\", $field, $order);\n }\n }", "public function random() {\n return $this[array_rand($this)];\n }", "public function &getOrderBy();", "public function _random() {\n\t\tif( $this->type == 'image' ) {\n\t\t\t$files = PSUFiles::getImageArray($this->base_dir.$this->dir, 0, $this->depth);\n\t\t} else {\n\t\t\t$files = PSUFiles::getImageArray($this->base_dir.$this->dir, 0, $this->depth, array('txt', 'html'));\n\t\t}//end if\n\n\t\t$this->set( PSUFiles::chooseRandomElement($files) );\n\t}", "public function thingsShuffle()\n {\n\n $this->thing->db->setUser($this->from);\n $thingreport = $this->thing->db->userSearch(''); // Designed to accept null as $this->uuid.\n\n $things = $thingreport['thing'];\n\n $this->total_things = count($things);\n\n //$start_time = time();\n\n //shuffle($things);\n $things = array_reverse($things);\n return $things;\n }", "public function testOrder()\n {\n $index = new Index();\n $query = new Query($index);\n $this->assertSame($query, $query->order('price'));\n\n $elasticQuery = $query->compileQuery()->toArray();\n $expected = [['price' => ['order' => 'desc']]];\n $this->assertEquals($expected, $elasticQuery['sort']);\n\n $query->order(['created' => 'asc']);\n $elasticQuery = $query->compileQuery()->toArray();\n $expected = [\n ['price' => ['order' => 'desc']],\n ['created' => ['order' => 'asc']],\n ];\n $this->assertEquals($expected, $elasticQuery['sort']);\n\n $query->order(['modified' => 'desc', 'score' => 'asc']);\n $elasticQuery = $query->compileQuery()->toArray();\n $expected = [\n ['price' => ['order' => 'desc']],\n ['created' => ['order' => 'asc']],\n ['modified' => ['order' => 'desc']],\n ['score' => ['order' => 'asc']],\n ];\n $this->assertEquals($expected, $elasticQuery['sort']);\n\n $query->order(['clicks' => ['mode' => 'avg', 'order' => 'asc']]);\n $elasticQuery = $query->compileQuery()->toArray();\n $expected = [\n ['price' => ['order' => 'desc']],\n ['created' => ['order' => 'asc']],\n ['modified' => ['order' => 'desc']],\n ['score' => ['order' => 'asc']],\n ['clicks' => ['mode' => 'avg', 'order' => 'asc']],\n ];\n $this->assertEquals($expected, $elasticQuery['sort']);\n\n $query->order(['created' => 'asc'], true);\n $elasticQuery = $query->compileQuery()->toArray();\n $expected = [\n ['created' => ['order' => 'asc']],\n ];\n $this->assertEquals($expected, $elasticQuery['sort']);\n }", "public function orderBy(/* Variable */) {\n\n $child = $this->createChild(null, array(), null);\n $child->_comparatorFunction = null;\n\n $args = func_get_args();\n\n return call_user_func_array(array($child, 'thenOrderBy'), $args);\n }", "public function byCriterionOverruleOrderBy()\n {\n $mockCriterion = $this->getMock('stubCriterion');\n $mockCriterion->expects($this->any())->method('toSQL')->will($this->returnValue('example'));\n $mockResult = $this->getMock('stubDatabaseResult');\n $this->mockConnection->expects($this->any())->method('query')->will($this->returnValue($mockResult));\n $mockResult->expects($this->once())\n ->method('fetchAll')\n ->will($this->returnValue(array(array('bar' => 'Here is bar.', 'default' => 'And this is default.'))));\n $finderResult = $this->dbFinder->findByCriterion($this->mockConnection, $mockCriterion, new stubReflectionClass('MockSinglePrimaryKeyEntity'), 'blub DESC');\n $this->assertEquals(1, $finderResult->count());\n $data = $finderResult->current();\n $this->assertEquals('Here is bar.', $data->withAnnotation());\n $this->assertEquals('And this is default.', $data->withDefaultValue());\n $select = $this->mockQueryBuilder->getSelect();\n $this->assertEquals('foo', $select->getBaseTableName());\n $this->assertEquals('blub DESC', $select->getOrderedBy());\n $this->assertFalse($select->hasLimit());\n $this->assertNull($select->getOffset());\n $this->assertNull($select->getAmount());\n $this->assertTrue($select->hasCriterion());\n }", "public static function getRandom()\n\t{\n\t\t$randNumPhp = Lottery::getSecureRand( self::getCount() );\n\t\t//$randNumSql = '( SELECT FLOOR( MAX(`id`) * RAND() ) FROM `category_prize` LIMIT 1 )';\n\n\t\treturn self::find()\n ->select(['id', 'name'])\n\t\t ->andWhere(['>=', 'id', $randNumPhp])\n\t\t ->orderBy('id')\n\t\t ->asArray()\n ->one();\n\t}", "public function orderBy($fields, $direction = 'ASC', $escape = null)\n {\n $orderBy = [];\n $direction = strtoupper(trim($direction));\n\n if ($direction === 'RANDOM') {\n $direction = '';\n\n // Do we have a seed value?\n $fields = ctype_digit((string)$fields)\n ? sprintf($this->SqlOrderByRandomKeywords[ 1 ], $fields)\n : $this->SqlOrderByRandomKeywords[ 0 ];\n } elseif (empty($fields)) {\n return $this;\n } elseif ($direction !== '') {\n $direction = in_array($direction, ['ASC', 'DESC'], true)\n ? ' ' . $direction\n : '';\n }\n\n is_bool($escape) || $escape = $this->conn->protectIdentifiers;\n\n if ($escape === false) {\n $orderBy[] = ['field' => $fields, 'direction' => $direction, 'escape' => false];\n } elseif (is_array($fields)) {\n foreach ($fields as $field_name => $field_direction) {\n $field_direction = is_numeric($field_name) ? $direction : $field_direction;\n $orderBy[] = ['field' => trim($field_name), 'direction' => $field_direction, 'escape' => true];\n }\n } else {\n foreach (explode(',', $fields) as $fields) {\n $orderBy[] = ($direction === ''\n && preg_match(\n '/\\s+(ASC|DESC)$/i',\n rtrim($fields),\n $match,\n PREG_OFFSET_CAPTURE\n ))\n ? [\n 'field' => ltrim(substr($fields, 0, $match[ 0 ][ 1 ])),\n 'direction' => ' ' . $match[ 1 ][ 0 ],\n 'escape' => true,\n ]\n : ['field' => trim($fields), 'direction' => $direction, 'escape' => true];\n }\n }\n\n $this->builderCache->orderBy = array_merge($this->builderCache->orderBy, $orderBy);\n\n return $this;\n }", "public function shuffle() {\n shuffle($this->__rows__);\n return $this;\n }", "function click_sort($order) {\n if (isset($this->real_field)) {\n // Since fields should always have themselves already added, just\n // add a sort on the field.\n $params = array('type' => 'numeric');\n $this->query->add_orderby($this->table_alias, $this->real_field, $order, $this->field_alias, $params);\n }\n }", "function aecom_soft_rand_shuffle( $posts, $query ) {\n if ( aecom_should_randomize_query( $query ) ) {\n // save original order - mainly for use in project archive's ?qp=...\n // (for paging thru individual projects)\n $i = ( ( $query->is_paged() ? $query->get( 'paged' ) : 1 ) - 1 ) * $query->get( 'posts_per_page' );\n foreach( $posts as &$post ) {\n $post->original_query_order = $i + 1;\n $i += 1;\n }\n // randomize order - or special semi-rand order for projects\n if ( $query->get( 'post_type' ) === 'project' ) {\n usort( $posts, 'aecom_sort_projects' );\n } else {\n shuffle( $posts );\n }\n }\n return $posts;\n}", "public function orderBy(string $field, string $direction = null): static\n {\n if ($direction === null) {\n $direction = 'ASC';\n } else {\n $direction = strtoupper($direction);\n }\n\n $this->orderBy[] = [\n 'field' => $field,\n 'direction' => $direction\n ];\n\n return $this;\n }", "public function orderBy() {\n $this->_orderBy = \"\";\n foreach ($this->_columns as $tableName => $table) {\n if (array_key_exists('order_bys', $table)) {\n foreach ($table['order_bys'] as $fieldName => $field) {\n $this->_orderBy[] = $field['dbAlias'];\n }\n }\n }\n $this->_orderBy = \"ORDER BY \" . implode(', ', $this->_orderBy) . \" \";\n }", "public function queryAllOrderBy($orderColumn);", "public function queryAllOrderBy($orderColumn);", "public function queryAllOrderBy($orderColumn);", "public function queryAllOrderBy($orderColumn);", "public function queryAllOrderBy($orderColumn);", "public function queryAllOrderBy($orderColumn);", "public function queryAllOrderBy($orderColumn);", "public function queryAllOrderBy($orderColumn);", "public function queryAllOrderBy($orderColumn);", "public function queryAllOrderBy($orderColumn);", "public function queryAllOrderBy($orderColumn);", "public function queryAllOrderBy($orderColumn);", "public function queryAllOrderBy($orderColumn);", "public function queryAllOrderBy($orderColumn);", "public function queryAllOrderBy($orderColumn);", "public function queryAllOrderBy($orderColumn);", "public function queryAllOrderBy($orderColumn);", "public function queryAllOrderBy($orderColumn);", "public function queryAllOrderBy($orderColumn);", "public function queryAllOrderBy($orderColumn);", "public function queryAllOrderBy($orderColumn);", "public function queryAllOrderBy($orderColumn);", "public function queryAllOrderBy($orderColumn);", "public function queryAllOrderBy($orderColumn);", "public function queryAllOrderBy($orderColumn);", "public function queryAllOrderBy($orderColumn);", "public function Random()\n {\n return parent::Random();\n }", "public function orderBy($column, $dir): QueryBuilderInterface;", "public function testOrderByWithDirection()\n {\n $query = (new Select($this->mockConnection))->orderBy('field', 'dir');\n $array = $query->toArray();\n\n $this->assertInstanceOf(Select::class, $query);\n $this->assertArrayHasKey('orderBy', $array);\n $this->assertCount(1, $array);\n $this->assertEquals([\n 'column' => 'field',\n 'direction' => 'dir',\n ], $array['orderBy'][0]);\n }", "private function setCustomOrderBy()\n\t{\n\t\tif (!$this->useDataProvider && $this->customQuery->orderBy) {\n\t\t\t$this->orderBy = $this->customQuery->orderBy;\n\t\t} else {\n\t\t\t$this->sort = $this->customQuery->orderBy; //set $this->sort property for dataProvider sorting\n\t\t}\n\n\t\treturn $this;\n\t}", "public function orderBy($sField, $sOrder = Db::ASC)\n {\n $this->clause('ORDER BY', \"$sField $sOrder\");\n\n return $this;\n }", "public function orderByAscending($field) {\n\t$this->parseQuery->orderByAscending($field);\n }", "public function testOrderByWithoutDirection()\n {\n $query = (new Select($this->mockConnection))->orderBy('field');\n $array = $query->toArray();\n\n $this->assertInstanceOf(Select::class, $query);\n $this->assertArrayHasKey('orderBy', $array);\n $this->assertCount(1, $array);\n $this->assertEquals([\n 'column' => 'field',\n 'direction' => 'asc',\n ], $array['orderBy'][0]);\n }", "public function addAscendingOrderBy($field)\n\t{\n\t\tparent::orderBy($field, self::ASC);\n\t\treturn $this;\n\t}", "public function scope_should_sort_by_default()\n {\n $this->assertEquals([1, 2, 3], ContentRating::all()->pluck('id')->toArray());\n\n ContentRating::swapOrder(ContentRating::find(1), ContentRating::find(3));\n\n $this->assertEquals([3, 2, 1], ContentRating::all()->pluck('id')->toArray());\n $this->assertEquals([1, 2, 3], ContentRating::withoutGlobalScopes()->get()->pluck('id')->toArray());\n }", "function get_random_featured_items($num = 5, $hasImage = null)\n{\n return get_records('Item', array('featured' => 1,\n 'sort_field' => 'random',\n 'hasImage' => $hasImage), $num);\n}", "public function orderBy($field, $direction = 'ASC')\n {\n $this->orderBy = $field;\n $this->orderByDirection = $direction;\n return $this;\n }", "public function orderByAscending(callable $function);", "public function getRandom()\n {\n $this->update();\n $count = sizeof($this->data);\n if ($count > 0) {\n $index = rand(0, $count - 1);\n if (isset($this->data[$index])) {\n return $this->updateValueIfNeeded($this->data, $index);\n }\n }\n return null;\n }", "public function randomItem();", "static public function showArticleRand($item, $value){\n $conditionSql = \"WHERE articles.$item = $value && articles.state = 0\";\n $order = \"RAND()\";\n $mode = \"DESC\";\n $start = 0;\n $count = 4;\n return ArticleModel::articlesMostSeen($order, $mode, $start, $count, $conditionSql);\n }", "public function andThenAscendingBy(string $field): ExtensibleSorting;", "public function orderBy($columns);", "protected function getOrderByAttribute()\n {\n return $this->fetchData[self::ORDER_CLAUSE];\n }", "public function allByOrdered($attribute, $value, $orderBy, $order, $columns=['*']) \n\t{\n\t\treturn $this->model->where($attribute, '=', $value)->orderBy($orderBy, $order)->get($columns);\n\t}", "public function orderBy($key, $order='asc');", "private function sortCollection()\n {\n if ($this->queryConfiguration->hasOrderColumn()) {\n $order = $this->queryConfiguration->orderColumns();\n $orderFunc = $this->defaultGlobalOrderFunction;\n $this->collection = $this->collection->sort(function ($first, $second) use ($order, $orderFunc) {\n return $orderFunc($first, $second, $order);\n });\n }\n }", "public function orderBy($fields)\n\t{\n\t\t$this->query->orderBy($fields);\n\n\t\treturn $this;\n\t}", "public function orderBy($field, $asc = true)\n {\n if ($asc) {\n $this->order[] = \"$this->alias.$field ASC\";\n } else {\n $this->order[] = \"$this->alias.$field DESC\";\n }\n\n return $this;\n\n }", "public function random() {\r\n \t$objReturn = null;\r\n\r\n \t$intIndex = rand(0, (count($this->collection) - 1));\r\n \tif (isset($this->collection[$intIndex])) {\r\n\t\t\t$objReturn = $this->collection[$intIndex];\r\n \t}\r\n\r\n \treturn $objReturn;\r\n }", "function tep_random_select($query) {\n $random_product = '';\n $random_query = tep_db_query($query);\n $num_rows = tep_db_num_rows($random_query);\n if ($num_rows > 0) {\n $random_row = tep_rand(0, ($num_rows - 1));\n tep_db_data_seek($random_query, $random_row);\n $random_product = tep_db_fetch_array($random_query);\n }\n\n return $random_product;\n }", "public function filterByRandom($random = null, $comparison = null)\n\t{\n\t\tif (is_array($random)) {\n\t\t\t$useMinMax = false;\n\t\t\tif (isset($random['min'])) {\n\t\t\t\t$this->addUsingAlias(QuizPeer::RANDOM, $random['min'], Criteria::GREATER_EQUAL);\n\t\t\t\t$useMinMax = true;\n\t\t\t}\n\t\t\tif (isset($random['max'])) {\n\t\t\t\t$this->addUsingAlias(QuizPeer::RANDOM, $random['max'], Criteria::LESS_EQUAL);\n\t\t\t\t$useMinMax = true;\n\t\t\t}\n\t\t\tif ($useMinMax) {\n\t\t\t\treturn $this;\n\t\t\t}\n\t\t\tif (null === $comparison) {\n\t\t\t\t$comparison = Criteria::IN;\n\t\t\t}\n\t\t}\n\t\treturn $this->addUsingAlias(QuizPeer::RANDOM, $random, $comparison);\n\t}" ]
[ "0.6473308", "0.58857995", "0.55334693", "0.54911256", "0.5489703", "0.53941774", "0.5365472", "0.53504586", "0.5336028", "0.53231394", "0.5315397", "0.528806", "0.5263116", "0.52027005", "0.51631474", "0.5136113", "0.51301306", "0.5130011", "0.5097016", "0.5090266", "0.507067", "0.50436246", "0.49946547", "0.4978458", "0.49502194", "0.49254632", "0.49173984", "0.49153778", "0.4912772", "0.49107456", "0.4901618", "0.4890038", "0.48696038", "0.48596537", "0.4846977", "0.48433074", "0.48357943", "0.48296806", "0.48140866", "0.48129818", "0.4800336", "0.47850868", "0.477051", "0.47553715", "0.47478157", "0.47131565", "0.46998638", "0.4688413", "0.46770406", "0.46770406", "0.46770406", "0.46770406", "0.46770406", "0.46770406", "0.46770406", "0.46770406", "0.46770406", "0.46770406", "0.46770406", "0.46770406", "0.46770406", "0.46770406", "0.46770406", "0.46770406", "0.46770406", "0.46770406", "0.46770406", "0.46770406", "0.46770406", "0.46770406", "0.46770406", "0.46770406", "0.46770406", "0.46770406", "0.46665406", "0.46476755", "0.46405825", "0.46394092", "0.46391442", "0.46279028", "0.46128187", "0.46064812", "0.45912585", "0.45879436", "0.45763516", "0.4568972", "0.4568199", "0.45495263", "0.45367607", "0.4534475", "0.45259637", "0.45256674", "0.45213282", "0.4513844", "0.45106784", "0.4504392", "0.44900024", "0.4481062", "0.44806594", "0.4480327" ]
0.62790257
1
Restricts a query to a given range in the result set. If this method is called with no parameters, will remove any range directives that have been set.
public function range($start = NULL, $length = NULL);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function select_range($query, $begin = null, $end = null) {\n return UPS_SUCCESS;\n }", "public function scopeWithinRange($query, $start, $end)\n {\n return $query->whereDate('metadata_order.value', '>=', $start)\n ->whereDate('metadata_order.value', '<=', $end);\n }", "function db_query_range($query, $from, $count, $args = array()) {\n $fnc = $this->slave_safe ? 'db_query_range_slave' : 'db_query_range';\n return $fnc($query, $from, $count, $args);\n }", "public function setFilterRange($attribute, $min, $max, $exclude = false)\n\t{\n\t\t$this->range[] = ($exclude ? '!' : '') . $attribute . \",{$min},{$max}\";\n\t}", "public function removeRange($startPage) {}", "function filterByRange($from, $to) {\n $this->setDateFilter(self::DATE_FILTER_SELECTED_RANGE);\n $this->setAdditionalProperty('date_filter_from', (string) $from);\n $this->setAdditionalProperty('date_filter_to', (string) $to);\n }", "private function priceRange($query)\n {\n if(isset($this->price['max']))\n ($this->price['max'] == 0)? $query->where('price','>',$this->price['min']) : $query->whereBetween('price', [$this->price['min'], $this->price['max']]);\n\n }", "public function delegateQueryRange($query, $from, $count, array $args = [], array $options = []);", "public function cpRange($tablename,$columnname,$startvalue,$endvalue=0,$param=0) {\n $sql= \"SELECT * FROM $tablename WHERE $columnname BETWEEN '$startvalue'\";\n if($endvalue!=0){\n \n $sql.= \" AND '$endvalue'\";}\n if($param!=0)\n {\n $d_id_key= key($param);\n $d_value= $param[$d_id_key];\n $sql.= \" AND $d_id_key>0\"; \n }\n elseif ($param=0) {\n $d_id_key= key($param);\n $d_value= $param[$d_id_key];\n $sql.= \" AND $d_id_key=0\"; \n \n }\n//print_r($sql);\n $sth = $this->dbh->prepare($sql);\n $sth->execute();\n $result = $sth->fetchAll(PDO::FETCH_ASSOC);\n \n return $result;\n}", "private function prepareInRangeCondition($inRange)\n {\n list($attribute, $from, $to) = array_pad($inRange, 3, null);\n $inRange = new Range();\n $inRange->addField($attribute, ['from' => $from, 'to' => $to]);\n $this->filter->addMust($inRange);\n }", "public function get_range_edges( $range_from = null, $range_to = null, $limit = null ) {\n\t\tglobal $wpdb;\n\n\t\t$this->validate_fields( array( $this->range_field ) );\n\n\t\t// Performance :: When getting the postmeta range we do not want to filter by the whitelist.\n\t\t// The reason for this is that it leads to a non-performant query that can timeout.\n\t\t// Instead lets get the range based on posts regardless of meta.\n\t\t$filter_values = $this->filter_values;\n\t\tif ( 'postmeta' === $this->table ) {\n\t\t\t$this->filter_values = null;\n\t\t}\n\n\t\t// `trim()` to make sure we don't add the statement if it's empty.\n\t\t$filters = trim( $this->build_filter_statement( $range_from, $range_to ) );\n\n\t\t// Reset Post meta filter.\n\t\tif ( 'postmeta' === $this->table ) {\n\t\t\t$this->filter_values = $filter_values;\n\t\t}\n\n\t\t$filter_statement = '';\n\t\tif ( ! empty( $filters ) ) {\n\t\t\t$filter_statement = \"\n\t\t\t\tWHERE\n\t\t\t\t\t{$filters}\n\t\t\t\";\n\t\t}\n\n\t\t// Only make the distinct count when we know there can be multiple entries for the range column.\n\t\t$distinct_count = count( $this->key_fields ) > 1 ? 'DISTINCT' : '';\n\n\t\t$query = \"\n\t\t\tSELECT\n\t\t\t MIN({$this->range_field}) as min_range,\n\t\t\t MAX({$this->range_field}) as max_range,\n\t\t\t COUNT( {$distinct_count} {$this->range_field}) as item_count\n\t\t\tFROM\n\t\t\";\n\n\t\t/**\n\t\t * If `$limit` is not specified, we can directly use the table.\n\t\t */\n\t\tif ( ! $limit ) {\n\t\t\t$query .= \"\n\t\t\t\t{$this->table}\n\t {$filter_statement}\n\t\t\t\";\n\t\t} else {\n\t\t\t/**\n\t\t\t * If there is `$limit` specified, we can't directly use `MIN/MAX()` as they don't work with `LIMIT`.\n\t\t\t * That's why we will alter the query for this case.\n\t\t\t */\n\t\t\t$limit = intval( $limit );\n\n\t\t\t$query .= \"\n\t\t\t\t(\n\t\t\t\t\tSELECT\n\t\t\t\t\t\t{$distinct_count} {$this->range_field}\n\t\t\t\t\tFROM\n\t\t\t\t\t\t{$this->table}\n\t\t\t\t\t\t{$filter_statement}\n\t\t\t\t\tORDER BY\n\t\t\t\t\t\t{$this->range_field} ASC\n\t\t\t\t\tLIMIT {$limit}\n\t\t\t\t) as ids_query\n\t\t\t\";\n\t\t}\n\n\t\t// phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared\n\t\t$result = $wpdb->get_row( $query, ARRAY_A );\n\n\t\tif ( ! $result || ! is_array( $result ) ) {\n\t\t\tthrow new Exception( 'Unable to get range edges' );\n\t\t}\n\n\t\treturn $result;\n\t}", "protected static function setRange(array $range = [])\n {\n static::$range = ! empty($range) ? $range : range(0, 9);\n }", "public function scopeOverPriceRange($query)\n {\n return $query->where('price', '>=', 50000);\n }", "public function getSearchRange() {}", "public function getSearchRange() {}", "public function scopeYearsRange($query, $id, $yearFrom, $yearTo)\n {\n $fet = $query;\n if ($yearFrom && $yearTo)\n $fet = $fet->whereBetween('year', array($yearFrom, $yearTo))->whereNotNull('video')->where('video','<>','');\n\n if ($this->options->getDataProvider() == 'db' || ! $this->options->autoUpdateData())\n {\n return $fet;\n }\n\n if ($fet->isEmpty() || $fet->first()->updated_at->addDay() <= Carbon::now())\n {\n $fet = $this->updateFeatured();\n }\n\n return $fet; \n }", "public function processRange($range) {\n $parts = explode($this->_range_delimiter, $range);\n\n if ( sizeof($parts) !== 2 ) {\n throw new InvalidArgumentException(\"bad range: ${range}\");\n }\n\n // sanity\n $start = $parts[0];\n $end = $parts[1];\n\n // could be roman numerals from prelim\n if ( !is_numeric($start) ) {\n\n \tif ( !$this->isPrelim($start) ) {\n \t\tthrow new InvalidArgumentException(\"bad range: ${range}\");\n \t}\n\n if ( !is_numeric($end) ) {\n\n\t \tif ( !$this->isPrelim($end) ) {\n\t \t\tthrow new InvalidArgumentException(\"bad range: ${range}\");\n\t \t}\n \n return $start . $this->_range_delimiter . $end;\n\n } else if ( intval($end) > $this->_min_page ) {\n \t// way out on the edge case: second number could be arabic\n \n $end = $this->step($end);\n\n return $start . $this->_range_delimiter . $end;\n }\n }\n\n // fill out $end with leading digits of $start\n $end = $this->expandRangeEnd($start, $end);\n\n // sanity\n if ( intval($end) <= intval($start) ) {\n \tthrow new InvalidArgumentException(\"bad range: ${start} to ${end}\");\n }\n\n // does the addition/subtraction fall within this range?\n if ( intval($start) <= $this->_min_page && $this->_min_page < intval($end) ) {\n\n \t// removing pages from within a range is problematic\n \tif ( $this->_increment < 0 ) {\n \t\tthrow new InvalidArgumentException(\"Cannot remove pages from with range: ${range}\");\n \t}\n\n \t// gap this range\n \treturn $this->splitRange($start, $end);\n }\n\n $start = $this->step($start);\n $end = $this->step($end);\n\n $end = $this->collapseRangeEnd($start, $end);\n\n return $start . $this->_range_delimiter . $end;\n }", "public function scopeUnderPriceRange($query)\n {\n return $query->where('price', '<', 50000);\n }", "private function getRange() {\n\t\t\ttry {\n\t\t\t\t$connection = new \\Phalcon\\Db\\Adapter\\Pdo\\Mysql(array(\n\t\t\t\t\t\t\"host\" => \"localhost\",\n\t\t\t\t\t\t\"username\" => \"addhawk\",\n\t\t\t\t\t\t\"password\" => \"addhawk4784\",\n\t\t\t\t\t\t\"dbname\" => \"addhawk\"\n\t\t\t\t));\n\t\t\t //Reconnect\n\t\t\t $connection->connect();\n\t\t\t $phql = \"SELECT * FROM admin\";\n\t\t\t $result = $connection->query($phql);\n\t\t\t $result->setFetchMode(Phalcon\\Db::FETCH_NUM);\n\t\t\t $this->data['admin'];\n\t\t\t\t$admin = $result->fetchArray();\n\t\t\t\t$this->data['x_range'] = $admin[1];\n\t\t\t\t$this->data['y_range'] = $admin[2];\n\t\t\t\t$this->data['title'] = \"Get Range\";\n\t\t\t\t$this->response->setJsonContent(array('success' => true, 'data' => $this->data));\n\t\t\t} catch (Exception $e) {\n\t\t\t\t$this->data['error'] = $e->getMessage();\n\t\t\t\t$this->response->setJsonContent(array('success' => false, 'data' => $this->data));\n\t\t\t}\n \treturn $this->response; //Supply response\n }", "public function clearPageRange() : Ghostscript\n {\n $this->setPageStart(null);\n $this->setPageEnd(null);\n return $this;\n }", "private function prepareNotInRangeCondition($notInRange)\n {\n list($attribute, $from, $to) = array_pad($notInRange, 3, null);\n $inRange = new Range();\n $inRange->addField($attribute, ['from' => $from, 'to' => $to]);\n $this->filter->addMustNot($inRange);\n }", "public function setRange( $range ) \n {\n \n if( !is_int( $range ) ) {\n throw new Execption( \"<<THE RANGE MUST BE AN INTEGER>>\" );\n }\n \n $this->_range = $range;\n \n }", "public function getRange() {\n\n }", "public function filter_range($data,$min,$max){\n return filter_var($data,FILTER_VALIDATE_INT,array(\n \"options\" => array(\n \"min_range\" =>$min,\n \"min_range\"=>$max)\n ));\n }", "public function setRange($range)\n {\n Argument::i()->test(1, 'int');\n \n if ($range < 0) {\n $range = 25;\n }\n \n $this->range = $range;\n \n return $this;\n }", "public function getPageRange($range = 4)\n {\n $from = max(1, $this->getPage() - $range);\n $to = min($this->getPageCount(), $this->getPage() + $range);\n\n return range($from, $to);\n }", "public function range(): RangeRequestBuilder {\n return new RangeRequestBuilder($this->pathParameters, $this->requestAdapter);\n }", "public function rangeAllRecords($start, $end)\n\t{\n\t\treturn $this->with(['applicant.department.college.branch', \n\t\t\t'project', 'projectType'])\n\t\t\t->whereBetween('created_at', [$start, $end])\n ->get();\n\t}", "function getQueryRange($input)\n {\n SGL::logMessage(null, PEAR_LOG_DEBUG);\n $sessionInfo = (SID) ? SID : '';\n if (!empty($sessionInfo)) {\n $sessionInfo = '&' . $sessionInfo;\n }\n if ($input->queryRange == 'all') {\n $html = \"<a href='\".SGL_Url::makeLink().\"frmQueryRange/thisCategory/\" . $sessionInfo . \"'>\" . SGL_String::translate('whole DB') . \"</a>\";\n } else {\n $html = \"<a href='\".SGL_Url::makeLink().\"frmQueryRange/all/\" . $sessionInfo . \"'>\" . SGL_String::translate('this category') . \"</a>\";\n }\n return $html;\n }", "public function setRange($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Cloud\\Monitoring\\V3\\Range::class);\n $this->range = $var;\n\n return $this;\n }", "public static function sanitizeRange( $range ) {\n list( /*...*/, $bits ) = self::parseCIDR( $range );\n list( $start, /*...*/ ) = self::parseRange( $range );\n $start = self::formatHex( $start );\n if ( $bits === false ) {\n return $start; // wasn't actually a range\n }\n return \"$start/$bits\";\n }", "public function availableRange(array $query = [], array $options = []): ApiResponse\n {\n return $this->client->request('get', 'available_range.asp', $this->mergeQuery($query, $options));\n }", "public function between($column, $start, $end, $boolean = 'and', $not = false)\r\n {\r\n $operator = $not ? 'not between' : 'between';\r\n return $this->where($column.' '.$operator.' ? and ? ', array($start, $end), $boolean);\r\n }", "public function range($start, $length) {\n $this->invokeEntityFieldQuery('range', array($start, $length));\n return $this;\n }", "public function scopebyDate($query, Array $dateRange)\n {\n if (count($dateRange) != 2) {\n return $query;\n }\n\n $dateStart = $dateRange[0];\n $dateEnd = $dateRange[1];\n \n return $query\n ->whereDate('issue_date', '>=', $dateStart)\n ->whereDate('issue_date', '<=', $dateEnd);\n }", "function setDisplayRange(&$range_limits,$total_pages,$page_index){\n\t\tdefine('PAGES_DISPLAYED',7);\n\t\tdefine('MAX_OFFSET',3);\n\t\t\n\t\tif ($total_pages <= constant('PAGES_DISPLAYED')){\n\t\t\t//range 1 to $total_pages\n\t\t\t$range_limits['min'] = 1;\n\t\t\t$range_limits['max'] = $total_pages;\n\t\t} else {//range $PAGE_NO_MAX buttons required\n\t\t\t//button moves, range is stationary\n\t\t\tif (($page_index <= constant('MAX_OFFSET')) || (($total_pages - $page_index) < constant('MAX_OFFSET'))) {\n\t\t\t\tif ($page_index <= constant('MAX_OFFSET')) {\n\t\t\t\t\t$range_limits['min'] = 1;\n\t\t\t\t\t$range_limits['max'] = constant('PAGES_DISPLAYED');\n\t\t\t\t} else {\n\t\t\t\t\t$range_limits['min'] = $total_pages - (constant('PAGES_DISPLAYED') - 1);\n\t\t\t\t\t$range_limits['max'] = $total_pages;\n\t\t\t\t}\n\t\t\t} else {//($page_index > $max_offset) && (($total_pages - $page_index) > $max_offset)\n\t\t\t\t//button stationary, range moves[$page_index +/- $max_offset] \n\t\t\t\t$range_limits['min'] = $page_index - constant('MAX_OFFSET');\n\t\t\t\t$range_limits['max'] = $page_index + constant('MAX_OFFSET');\n\t\t\t}\t\n\t\t}\n\t\treturn;\t\t\t\n\t}", "public function setRange($range)\n {\n if (! ($range instanceof OntologyClass) && ! ($range instanceof DataType)) throw new \\InvalidArgumentException('range must be an OntologyClass or a DataType, but has type ' . PhpUtil::typeNameOf($range));\n $this->range = $range;\n }", "private function _getRangeConditions($field_name, $min, $max, $max_value, $table_name='Rental')\n\t{\n\t\tif (intval($max) === $max_value)\n\t\t\t$max = 9999999;\n\n\t\t$conditions = array(\n\t\t\t$table_name . '.' . $field_name . ' >=' => $min,\n\t\t\t$table_name . '.' . $field_name . ' <=' => $max);\n\t\t\n\t\treturn $conditions;\n\t}", "public function not_between($val1, $val2) \n {\n // Alittle cleaning\n $val1 = $this->clean($val1);\n $val2 = $this->clean($val2);\n \n // Build our statement\n $this->sql .= \" NOT BETWEEN `\". $val1 .\"` AND `\". $val2 .\"`\";\n return $this;\t\n }", "public function scopeCourseRangeTurn($query, $courserange, $turnid)\n\t{\n\t\treturn $query->whereIn('course_id', $courserange)\n\t\t\t\t\t->where('turn_id','=',$turnid);\n\t}", "protected function _applyPriceRange()\n {\n $interval = $this->getInterval();\n\n if (!$interval) {\n return $this;\n }\n\n list($from, $to) = $interval;\n if ($from === '' && $to === '') {\n return $this;\n }\n\n $field = $this->_getFilterField();\n $limits = array();\n if (!empty($from)) {\n $limits['gte'] = $from;\n }\n if (!empty($to)) {\n $limits['lte'] = $to;\n }\n\n $query = $this->getLayer()->getProductCollection()->getSearchEngineQuery();\n $query->addFilter('range', array($this->_getFilterField() => $limits), $this->_getFilterField());\n\n return $this;\n }", "public function setRange($limit = null, $offset = null)\n {\n $this->range_limit = $limit;\n $this->range_offset = $offset;\n\n return $this;\n }", "public function orHavingNotBetween(\n Closure | string $column,\n Closure | float | int | string | null $min,\n Closure | float | int | string | null $max\n ) : static {\n return $this->orHaving($column, 'NOT BETWEEN', $min, $max);\n }", "public static function range($value, $min, $max, $message = '');", "public function scopeBetweenPrices($query, $min, $max)\n {\n return $query->where('price', '>=', $min)\n ->where('price', '<=', $max);\n }", "public static function SEARCH_STOP_DATE_RANGE_BOOKING(){\n\t $SQL_String = \"SELECT * FROM area_booking WHERE am_id=:am_id AND (date_enter BETWEEN :stop_start AND :stop_end OR date_exit BETWEEN :stop_start AND :stop_end) AND _keep=1\";\n\t return $SQL_String;\n\t}", "public function setPrintPageRange(?array $pageRange = null) {}", "public function getRange($start, $num)\n\t{\n\t\treturn $this->pdo->query(\n\t\t\tsprintf('\n\t\t\t\tSELECT *,\n\t\t\t\tUNCOMPRESS(plot) AS plot\n\t\t\t\tFROM xxxinfo\n\t\t\t\tORDER BY createddate DESC %s',\n\t\t\t\t($start === false ? '' : ' LIMIT ' . $num . ' OFFSET ' . $start)\n\t\t\t)\n\t\t);\n\t}", "public function getIncludedRanges(): Range\n {\n return API::ffi()->ts_parser_included_ranges($this->data);\n }", "public function getRange() \n {\n \n return $this->_range;\n \n }", "public function getRange(): string;", "public static function whereNotBetween($column, $lowest, $highest);", "public function getRange()\n {\n return $this->range;\n }", "public function getRange()\n {\n return $this->range;\n }", "public function scopeBetweenDates($query, $from, $to)\n {\n return $query->whereBetween('date', [$from, $to]);\n }", "public function havingNotBetween(\n Closure | string $column,\n Closure | float | int | string | null $min,\n Closure | float | int | string | null $max\n ) : static {\n return $this->having($column, 'NOT BETWEEN', $min, $max);\n }", "public function testRange() {\n\t\t$result = _::range(5);\n\t\t$this->assertInternalType('array', $result);\n\t\t$this->assertCount(5, $result);\n\t\t$this->assertEquals(0, $result[0]);\n\t\t$this->assertEquals(1, $result[1]);\n\t\t$this->assertEquals(2, $result[2]);\n\t\t$this->assertEquals(3, $result[3]);\n\t\t$this->assertEquals(4, $result[4]);\n\n\t\t// test range with two parameters\n\t\t$result = _::range(1, 4);\n\t\t$this->assertInternalType('array', $result);\n\t\t$this->assertCount(3, $result);\n\t\t$this->assertEquals(1, $result[0]);\n\t\t$this->assertEquals(2, $result[1]);\n\t\t$this->assertEquals(3, $result[2]);\n\n\t\t// test range with three parameters\n\t\t$result = _::range(1, 10, 2);\n\t\t$this->assertInternalType('array', $result);\n\t\t$this->assertCount(5, $result);\n\t\t$this->assertEquals(1, $result[0]);\n\t\t$this->assertEquals(3, $result[1]);\n\t\t$this->assertEquals(5, $result[2]);\n\t\t$this->assertEquals(7, $result[3]);\n\t\t$this->assertEquals(9, $result[4]);\n\t}", "public function range() \n\t{\n\t\t// collect params, false if not provided\n\t\t$start = $this->EE->TMPL->fetch_param('start', \"1\");\n\t\t$end = $this->EE->TMPL->fetch_param('end');\n\t\t$reverse = $this->EE->TMPL->fetch_param('reverse');\n\t\t\n\t\t// start building our output\n\t\t$output = $this->_open_tag();\n\t\t$options = $this->_default_option();\n\t\t\n\t\t// build our options\n\t\tif(is_numeric($start) && is_numeric($end)) {\n\t\t\tif($reverse == 'yes') {\n\t\t\t\tfor($i=$end; $i>=$start; $i--) {\n\t\t\t\t\t$options .= '<option value=\"'.$i.'\">'.$i.'</option>';\n\t\t\t\t}\t\n\t\t\t} else {\n\t\t\t\tfor($i=$start; $i<=$end; $i++) {\n\t\t\t\t\t$options .= '<option value=\"'.$i.'\">'.$i.'</option>';\n\t\t\t\t}\t\n\t\t\t}\n\t\t} else {\n\t\t\t$options = '<option>Invalid Range Provided</option>';\n\t\t}\n\t\t\n\t\t$output .= $options . '</select>';\n\t\treturn $output;\n\t}", "protected function _getRanges() {}", "public function limit($start, $end = '')\n {\n if(!$this->query)\n {\n return false;\n }\n \n $this->query .= 'LIMIT ';\n $start = intval($start);\n \n if(empty($end))\n {\n $this->query .= $start . ' '; \n }\n else\n {\n $end = intval($end);\n $this->query .= $start . ', ' . $end . ' ';\n } \n \n // Return a ref. to this object for chainability\n return $this;\n }", "public function between($column,$val1,$val2);", "function getRowsByRange($table_name, $value_column_name, $value_min, $value_max)\n {\n $sql = sprintf(\n \"SELECT * FROM %s WHERE %s BETWEEN \\\"%s\\\" AND \\\"%s\\\"\",\n $table_name,\n $value_column_name,\n $value_min,\n $value_max);\n\n $rows = array();\n\n $result = $this->query($sql);\n while($row = $result->fetchArray(SQLITE3_ASSOC))\n {\n array_push($rows, $row);\n }\n\n return $rows;\n }", "public function between($val1, $val2) \n {\n // Alittle cleaning\n $val1 = $this->clean($val1);\n $val2 = $this->clean($val2);\n \n // Build our statement\n $this->sql .= \" BETWEEN `\". $val1 .\"` AND `\". $val2 .\"`\";\n return $this;\t\n }", "public function setNamedRange($name, $row_from, $column_from, $row_to, $column_to) {\n\t}", "public function addCodeSpaceRange($start, $end) {}", "public function queryXmetricdatasourceRange($request)\n {\n $runtime = new RuntimeOptions([]);\n $headers = [];\n\n return $this->queryXmetricdatasourceRangeEx($request, $headers, $runtime);\n }", "public function isRange(): bool\n {\n return $this->type == self::TYPE_RANGE;\n }", "public function scopeUpdatedBetween($query, \\DateInterval $minAge, \\DateInterval $maxAge) {\n $minAgeDate = new \\DateTime();\n $minAgeDate->sub($minAge);\n $maxAgeDate = new \\DateTime();\n $maxAgeDate->sub($maxAge);\n\n return $query->whereBetween('updated_at', [$minAgeDate, $maxAgeDate]);\n }", "public function addNotBetween($column, $start, $stop, $operand = 'AND')\n {\n $this->addWhere($column . ' BETWEEN ' . $start . ' AND ' . $stop, $operand);\n }", "public function notBetween($column,$val1,$val2);", "public function addRange($min, $max)\n {\n $this->range = \"$min to $max\";\n array_push($this->options, array(\"options\" => array(\"min_range\" => $min, \"max_range\" => $max)));\n }", "function visible_range() {\n\t\treturn new DateRange(\n\t\t\t$this->attribute(\"show date\"),\n\t\t\t$this->attribute(\"hide date\"),\n\t\t\t$this\n\t\t);\n\t}", "public function apply_limit($query, $offset = 0, $limit = 0) {\n\n\t\t\t\n\t\t\t$high_where = '';\n\t\t\t$lower_where = 0;\n if($offset>0 || $limit>0) {\n $high_where = '\"_RN\" <= '.($offset+$limit).' AND ';\n $lower_where = $offset+1;\n }\n $sql = sprintf('SELECT * FROM (SELECT ROWNUM AS \"_RN\", \"_SUB\".* FROM (%s) \"_SUB\") WHERE %s \"_RN\" >= %d',$query, $high_where, $lower_where);\n\t\t\t\n\t\t\treturn $sql;\n\t\t}", "public function hasRange()\n {\n return ($this->getOffset() !== false && $this->getOffset() >= 0 && $this->getNumberOfEntries() !== false && $this->getNumberOfEntries() > 0);\n }", "public function setPageRange($pageRange)\n\t{\n $this->pageRange = (integer) $pageRange;\n\n return $this;\n\t}", "private function checkQueryRange($nid) {\n $date_start = $this->date->get(\"timestamp\");\n $date_end = $this->date->get(\"last second\");\n return hiro_query_range_is_relevant($nid, $date_start, $date_end);\n }", "public function limit($start, $end = '')\n\t{\n\t\tif ($this->fromQueryString)\n\t\t\tthrow(new QueryStringAlreadySpecified(\"The query string has already been specified. You can't access query builder's functions.\"));\n\t\t$this->limit = $start . ($end != '' ? ', ' . $end : '');\n\t\treturn $this;\n\t}", "public function setIncludedRanges(array $ranges): bool\n {\n $size = count($ranges);\n $cranges = API::ffi()->new(\"TSRange[{$size}]\");\n\n for ($i = 0; $i < $size; $i ++) {\n $range = $ranges[$i];\n $crange = API::ffi()->new(\"TSRange\");\n\n $crange->start_point = $range->startPoint->data;\n $crange->end_point = $range->endPoint->data;\n $crange->start_byte = $range->startByte;\n $crange->end_byte = $range->endByte;\n\n $cranges[$i] = $crange;\n }\n\n return API::ffi()->ts_parser_set_included_ranges($this->data, $cranges, $size);\n }", "public function delete_id_range($start, $end)\r\n\t{\r\n\t\treturn false;\r\n\t}", "protected function _applyDateRangeFilter()\n {\n // Remember that field PERIOD is a DATE(YYYY-MM-DD) in all databases including Oracle\n\n if ($this->_from !== null) {\n $this->getSelect()->where('created_time >= ?', $this->_from .' 00:00:00');\n }\n if ($this->_to !== null) {\n $this->getSelect()->where('created_time <= ?', $this->_to .' 23:59:59');\n }\n\n return $this;\n\n }", "public static function whereBetween($column, $lowest, $highest);", "public static function validateRange(TextBase $control, $range)\r\n\t{\r\n\t\tthrow new \\LogicException(':RANGE validator is not applicable to TagInput.');\r\n\t}", "private function checkBounds()\n {\n $this->page = max($this->page, 0);\n $this->page = min($this->page, $this->lastPage());\n }", "public function queryXmetricdatasourceRangeEx($request, $headers, $runtime)\n {\n Utils::validateModel($request);\n\n return QueryXmetricdatasourceRangeResponse::fromMap($this->doRequest('1.0', 'antcloud.monitor.xmetricdatasource.range.query', 'HTTPS', 'POST', '/gateway.do', Tea::merge($request), $headers, $runtime));\n }", "public function scopeLegalPerson($query) {\n\t\treturn $query->where('type', 0);\n\t}", "public static function filterRange($attrValue, $min, $max, Logger $logger)\n\t{\n\t\t$attrValue = filter_var($attrValue, FILTER_VALIDATE_INT);\n\n\t\tif ($attrValue === false)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\tif ($attrValue < $min)\n\t\t{\n\t\t\t$logger->warn(\n\t\t\t\t'Value outside of range, adjusted up to min value',\n\t\t\t\tarray(\n\t\t\t\t\t'attrValue' => $attrValue,\n\t\t\t\t\t'min' => $min,\n\t\t\t\t\t'max' => $max\n\t\t\t\t)\n\t\t\t);\n\n\t\t\treturn $min;\n\t\t}\n\n\t\tif ($attrValue > $max)\n\t\t{\n\t\t\t$logger->warn(\n\t\t\t\t'Value outside of range, adjusted down to max value',\n\t\t\t\tarray(\n\t\t\t\t\t'attrValue' => $attrValue,\n\t\t\t\t\t'min' => $min,\n\t\t\t\t\t'max' => $max\n\t\t\t\t)\n\t\t\t);\n\n\t\t\treturn $max;\n\t\t}\n\n\t\treturn $attrValue;\n\t}", "function setArticleCountsRange($min, $max)\n\t{\n\t\t$this->validate['articles_count']['range']['rule'][1] = $min-1;\n\t\t$this->validate['articles_count']['range']['rule'][2] = $max+1;\n\t}", "function setLimit($start, $end) {\n\t\tif (!is_int($start) || !is_int($end)) {\n\t\t\tthrow new DBException(\"Limit must be integer\");\n\t\t}\n\t\t$this->start = $start;\n\t\t$this->end = $end;\n\t\treturn $this;\n\n\t}", "public function narrowRange($value) {\n return $this->setProperty('narrowRange', $value);\n }", "public function forceIntegerInRangeForcesIntegerIntoDefaultBoundariesDataProvider() {}", "public function whereBetween($column, $value1, $value2);", "protected function parseRangeUsingWildcards($input, &$range): void\n {\n $this->fillAddress($input);\n\n $range['min'] = str_replace('*', '0', $input);\n $range['max'] = str_replace('*', '255', $input);\n }", "public function testComAdobeCqDamCfmImplContentRewriterParRangeFilter()\n {\n $client = static::createClient();\n\n $path = '/system/console/configMgr/com.adobe.cq.dam.cfm.impl.content.rewriter.ParRangeFilter';\n\n $crawler = $client->request('POST', $path);\n }", "public function notInRange($attribute, $from = '', $to = '')\n {\n $this->notInRange[] = [$attribute, $from, $to];\n\n return $this;\n }", "public function where_between($name, $lower, $upper)\n {\n $this->where(self::quote_name($name) .' between ? and ?', $lower, $upper);\n return $this;\n }", "protected function resetQuery()\n {\n array_forget($this->query, ['start', 'end']);\n }", "public function queryXmetricRange($request)\n {\n $runtime = new RuntimeOptions([]);\n $headers = [];\n\n return $this->queryXmetricRangeEx($request, $headers, $runtime);\n }", "function range($valor,$parms)\n\t{\t\t\n\t\tlist($min, $max) = explode(\",\", $parms, 2);\n\t\tif($valor<$min||$valor>$max)\n\t\t{\n\t\t\t$this->CI->form_validation->set_message('range', \"El campo %s debe contener un valor entre {$min} y {$max}.\");\n\t\t\treturn FALSE;\n\t\t}\n\t\treturn TRUE;\n\t}", "public function selectRange(Result $result, array $ranges)\n {\n $range = $this->unrestrictedWithLowestStartNumberProvider->getRange($ranges);\n\n if (is_null($range)) {\n $result->addMessage(' - no unrestricted ranges available, use restricted range with fewest countries');\n\n $ranges = $this->restrictedWithFewestCountriesProvider->getRanges($ranges);\n switch (count($ranges)) {\n case 0:\n throw new RuntimeException(\n 'Assertion failed in method ' . __METHOD__ . ': count($ranges) == 0'\n );\n case 1:\n $range = $ranges[0];\n break;\n default:\n $result->addMessage(' - multiple ranges have the fewest countries');\n return $this->highestAvailabilityRangeSelector->getRange($result, $ranges);\n }\n\n $message = sprintf(\n ' - using restricted range with fewest countries: id %d with countries %s',\n $range['entity']->getId(),\n implode(', ', $range['countryIds'])\n );\n } else {\n $rangeEntity = $range['entity'];\n\n $message = sprintf(\n ' - using unrestricted range with lowest start number: id %d starts at %d',\n $rangeEntity->getId(),\n $rangeEntity->getFromNo()\n );\n }\n\n $result->addMessage($message);\n\n return $range;\n }", "public function between($from=0, $to=10) {\n $this->__limit__ = array($to-$from, $from);\n return $this;\n }" ]
[ "0.6324292", "0.6151093", "0.5929911", "0.5901071", "0.585246", "0.58078283", "0.5777406", "0.5677549", "0.5598598", "0.55479527", "0.55420095", "0.553456", "0.55118716", "0.5505498", "0.55035865", "0.547832", "0.5477245", "0.54693055", "0.5454321", "0.53520024", "0.5329871", "0.5321206", "0.5319701", "0.531782", "0.52955085", "0.52755094", "0.52444965", "0.52044904", "0.5202781", "0.51970047", "0.5181802", "0.5170512", "0.51566625", "0.5155357", "0.51282203", "0.51256806", "0.51178676", "0.5108063", "0.5089198", "0.50847656", "0.5078544", "0.504586", "0.5034727", "0.5032527", "0.50242084", "0.5024035", "0.49888414", "0.4987683", "0.4981549", "0.49741918", "0.49673256", "0.49639195", "0.49534178", "0.49534178", "0.49363643", "0.49314728", "0.4924165", "0.49225208", "0.49159503", "0.49123794", "0.49083766", "0.4908086", "0.48998085", "0.48800263", "0.48765182", "0.4869572", "0.4860332", "0.4860317", "0.48449156", "0.48385507", "0.48367396", "0.48336452", "0.48328692", "0.48153856", "0.479866", "0.4798081", "0.4797847", "0.47955132", "0.47942033", "0.47869962", "0.47770423", "0.47707266", "0.4761814", "0.47591668", "0.47466245", "0.4737054", "0.47306532", "0.4728858", "0.47282168", "0.47172177", "0.4705552", "0.4693104", "0.4676224", "0.46708465", "0.46706545", "0.46705228", "0.4667196", "0.4662827", "0.46534905", "0.4639037" ]
0.54157287
19
Add another Select query to UNION to this one. Union queries consist of two or more queries whose results are effectively concatenated together. Queries will be UNIONed in the order they are specified, with this object's query coming first. Duplicate columns will be discarded. All forms of UNION are supported, using the second '$type' argument. Note: All queries UNIONed together must have the same field structure, in the same order. It is up to the caller to ensure that they match properly. If they do not, an SQL syntax error will result.
public function union(SelectInterface $query, $type = '');
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function addQueryToUnion() {\n if (empty($this->query)) {\n throw new \\Exception('Cannot add an empty query to union', 500);\n }\n\n $this->union[] = $this->query;\n // Reset all vars\n $this->query = '';\n $this->where = '';\n $this->sort = '';\n\n return $this;\n }", "public function union($sql)\n\t{\n\t\t$this->query->union[] = $sql;\n\t\treturn $this->query;\n\t}", "public function union($query, $overwrite = false);", "public function buildUnionQuery($type = 'DISTINCT') {\n if (empty($this->union)) {\n throw new \\Exception('Cannot build a union query', 500);\n }\n\n $this->query = implode(\" UNION {$type} \", $this->union);\n $this->union = [];\n\n return $this;\n }", "public function union(AbstractQueryBuilder $select, $isUnionAll = false)\n {\n $this->builderCache->store(($isUnionAll\n ? 'union_all'\n : 'union'), $select->getSqlStatement());\n\n return $this;\n }", "public function union($query, $all);", "public function union(): self;", "public function unionAll($query, $overwrite = false);", "function mUNION(){\n try {\n $_type = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$UNION;\n $_channel = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$DEFAULT_TOKEN_CHANNEL;\n // Tokenizer11.g:206:3: ( 'union' ) \n // Tokenizer11.g:207:3: 'union' \n {\n $this->matchString(\"union\"); \n\n\n }\n\n $this->state->type = $_type;\n $this->state->channel = $_channel;\n }\n catch(Exception $e){\n throw $e;\n }\n }", "protected abstract function get_union();", "function union($table){\n\t\t$this->union[] = $table;\t\n\t\treturn $this;\t\n\t}", "public function union(Builder $subquery)\n {\n array_push($this->union, $this->syntax->selectSyntax($subquery));\n $this->parameters = array_merge($this->parameters, $subquery->getParameters());\n \n return $this;\n }", "public function union($query, $distinct = null)\n\t{\n\t\tif (!$query instanceof JDatabaseQuery) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Apply the distinct flag to the union if set.\n\t\tif ($distinct !== null) {\n\t\t\t$query->unionDistinct = (bool) $distinct;\n\t\t}\n\n\t\t// Clear the ORDER BY clause in unioned query.\n\t\t$query->clear('order');\n\n\t\t// Add the query to union.\n\t\t$this->_union[] = $query;\n\n\t\treturn $this;\n\t}", "public function union(Query $query, $flag = null) {\n if ($flag === Dialect::ALL || $flag === Dialect::DISTINCT) {\n $query->attribute('flag', $flag);\n }\n\n return $this->_addCompound(Dialect::UNION, $query);\n }", "public function addSelect($select = null)\n {\n $this->_type = self::SELECT;\n\n if (empty($select)) {\n return $this;\n }\n\n $selects = is_array($select) ? $select : func_get_args();\n\n return $this->add('select', $selects, true);\n }", "public function union($query, $all = false)\n {\n throw new NotImplementedException('Joins are not implemented in Crate');\n }", "public function select( $select ) {\n $args = func_get_args();\n\n $this->_type = self::TYPE_SELECT;\n\n foreach( $args AS $arg ) {\n $this->_select[] = $arg;\n }\n\n return $this;\n }", "public function addObj($_select, $_where = array(), $_order = \"\", $_limit = 30, $_offset = 0)\n {\n if (!$_select) {\n return false;\n }\n if ($_where) {\n $_select->where($_where);\n }\n if ($_order) {\n $_select->order($_order);\n }\n $_select->limit($_limit);\n $_select->offset($_offset);\n return $_select;\n }", "public function addSelect($select = null)\n {\n return $this->queryBuilder->addSelect($select);\n }", "protected function _transformQuery()\n {\n if (!$this->_dirty || $this->_type !== 'select') {\n return;\n }\n\n if (empty($this->_parts['from'])) {\n $this->from([$this->_repository->getAlias() => $this->_repository->table()]);\n }\n $this->_addDefaultFields();\n $this->getEagerLoader()->attachAssociations($this, $this->_repository, !$this->_hasFields);\n $this->_addDefaultSelectTypes();\n }", "protected function appendSql($string)\n {\n $this->selectSQL .= $string;\n return $this;\n }", "public function joinSelect(Query $other, $fieldOrExpr, $operator, $valueOrExpr, $type = 'INNER') {\r\n\t\t$this->addJoin($other, $fieldOrExpr, $operator, $valueOrExpr, $type, '( '.$other->toSQL().' ) '.$other->_salt_alias, FALSE);\r\n\t}", "private function _select(){\n $this->debugBacktrace();\n $parameter = $this->selectParam; //transfer to local variable.\n $this->selectParam = \"\"; //reset updateParam.\n\n \n \n $sql = \"\";\n if($this->hasRawSql){\n $sql = $parameter;\n $this->hasRawSql = false;\n }\n else{\n $tableName = $this->tableName;\n $this->tableName = \"\"; //reset.\n\n $columns = \"\";\n if(!isset($parameter) || empty($parameter)){\n $columns = \"*\";\n $sql = $this->_prepare_select_sql($columns,$tableName);\n }\n else{\n //first check whether it has 'select' keyword\n $parameter = trim($parameter);\n $keyWord = substr($parameter,0,6);\n if(strtoupper($keyWord)==\"SELECT\") {\n $sql = $parameter;\n }\n else{\n $columns = $parameter;\n $sql = $this->_prepare_select_sql($columns,$tableName);\n }\n }\n }\n\n \n $queryObject = $this->_perform_mysql_query($sql);\n \n if(empty($this->selectModifier)){\n //No select modifier (first, firstOrDefault, single, singleOrDefault) found ---->\n $quantity = 0;\n $rows = array();\n switch ($this->fetchType){\n case \"fetch_object\":\n while ($row = mysqli_fetch_object($queryObject)) {\n if(isset($tableName)){\n $meta = new stdClass();\n $meta->type = $tableName;\n $row->__meta = $meta;\n }\n $rows[] = $row;\n $quantity++;\n }\n break;\n case \"fetch_assoc\":\n while ($row = mysqli_fetch_assoc($queryObject)) {\n $rows[] = $row;\n $quantity++;\n }\n break;\n case \"fetch_array\":\n while ($row = mysqli_fetch_array($queryObject)) {\n $rows[] = $row;\n $quantity++;\n }\n break;\n case \"fetch_row\":\n while ($row = mysqli_fetch_row($queryObject)) {\n $rows[] = $row;\n $quantity++;\n }\n break;\n case \"fetch_field\":\n while ($row = mysqli_fetch_field($queryObject)) {\n $rows[] = $row;\n $quantity++;\n }\n break;\n }\n\n if($quantity>0){\n mysqli_free_result($queryObject);\n }\n\n return $rows;\n //<----No select modifier (first, firstOrDefault, single, singleOrDefault) found \n }\n else{ \n //select modifier (first, firstOrDefault, single, singleOrDefault) found ---->\n $selectModifier = $this->selectModifier;\n $this->selectModifier = \"\";\n $row;\n switch($selectModifier){\n case \"first\":\n $numRows = mysqli_num_rows($queryObject);\n if($numRows == 0){\n throw new ZeroException(\"No data found.\");\n }\n break;\n \n case \"firstOrNull\":\n $numRows = mysqli_num_rows($queryObject);\n if($numRows == 0){\n return NULL;\n }\n break;\n\n case \"single\":\n $numRows = mysqli_num_rows($queryObject);\n if($numRows == 0){\n throw new ZeroException(\"No data found.\");\n }\n if($numRows > 1){\n throw new ZeroException(\"Multiple records found.\");\n }\n break;\n\n case \"singleOrNull\":\n $numRows = mysqli_num_rows($queryObject);\n if($numRows == 0){\n return NULL;\n }\n if($numRows > 1){\n return NULL;\n }\n break;\n }\n\n return $this->_prepareSingleRecord($queryObject);\n //<---- select modifier (first, firstOrDefault, single, singleOrDefault) found *212*062#\n }\n }", "public function mergeQuery(array $queryToBeAppended);", "public function addSelect(string ...$columns)\n {\n $this->select = array_merge($this->select, $columns);\n\n return $this;\n }", "public function union(Statement $statement)\n\t\t{\n\t\t\t$this->unions[] = $statement;\n\t\t\treturn $this;\n\t\t}", "public function assemble()\n {\n $queryString = array();\n\n $queryString[] = $this->query['type'];\n\n // Select query\n if ($this->query['type'] == \"SELECT\"\n or $this->query['type'] == \"SELECT DISTINCT\") {\n // Build columns to select\n $queryString[] = $this->buildSelectColumns();\n\n // From\n $queryString[] = \"FROM `{$this->query['table']}`\";\n\n // Joins\n if (array_key_exists('joins', $this->query)) {\n $queryString[] = $this->buildJoins();\n }\n\n // Where\n $queryString[] = $this->buildWhere();\n\n // Custom SQL\n if (array_key_exists('sql', $this->query)) {\n $queryString[] = $this->query['sql'];\n }\n\n // Order by\n if (array_key_exists('order_by', $this->query)) {\n $queryString[] = \"ORDER BY \" . implode(\", \", $this->query['order_by']);\n }\n }\n // Insert\n elseif ($this->query['type'] == \"INSERT INTO\") {\n // Table\n $queryString[] = \"`{$this->query['table']}`\";\n\n // Get the columns and values\n $columns = $values = array();\n foreach ($this->query['data'] as $column => $value) {\n $columns[] = $this->columnName($column);\n $values[] = $this->processValue($value);\n }\n\n // Add columns and values to query\n $queryString[] = \"(\" . implode(',', $columns) . \")\";\n $queryString[] = \"VALUES (\" . implode(',', $values) . \")\";\n }\n // Update\n elseif ($this->query['type'] == \"UPDATE\") {\n // Table\n $queryString[] = \"`{$this->query['table']}`\";\n\n // Set values\n $values = array();\n foreach ($this->query['data'] as $column => $value) {\n // Process column name\n $column = $this->columnName($column);\n\n // Add value to bind queue\n $valueBindKey = \"new_\" . str_replace(array('.', '`'), array('_', ''), $column);\n $this->valuesToBind[$valueBindKey] = $value;\n\n // Add to values\n $values[] = $column . \" = :{$valueBindKey}\";\n }\n\n // Add values to query\n $queryString[] = \"SET \" . implode(\", \", $values);\n\n $queryString[] = $this->buildWhere();\n }\n // Delete from\n elseif ($this->query['type'] == \"DELETE\") {\n // Table\n $queryString[] = \"FROM `{$this->query['table']}`\";\n\n // Where\n $queryString[] = $this->buildWhere();\n }\n\n return implode(\" \", str_replace(\"{prefix}\", $this->prefix, $queryString));\n }", "private function makeSelectAndFrom()\r\n\t{\r\n\t\t// Build SQL\r\n\t\t$sql = 'SELECT ';\r\n\t\r\n\t\t// Add custom fields (subqueries)\r\n\t\tif ($this->hasCustomFields())\r\n\t\t{\r\n\t\t\t// Find custom fields\r\n\t\t\tforeach ($this->fields as $field)\r\n\t\t\t{\r\n\t\t\t\tif ($field instanceOf CustomField)\r\n\t\t\t\t{\r\n\t\t\t\t\t$sql .= '(' . $field->query . ') AS `' . $field->name . '`, ';\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\r\n\t\tif (!$this->hasForeignFields())\r\n\t\t{\r\n\t\t\tif (isset($this->selectFields))\r\n\t\t\t{\r\n\t\t\t\t// Use custom field selection\r\n\t\t\t\t$sql .= implode(', ', $this->selectFields) . ' ';\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t// Take all fields\r\n\t\t\t\t$sql .= '`'.$this->name.'`.* ';\r\n\t\t\t}\r\n\t\t\t\t\r\n\t\t\t$sql .= 'FROM `'.$this->name.'` ';\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t// Get foreign fields\r\n\t\t\t$cols = array();\r\n\t\r\n\t\t\tif (isset($this->selectFields))\r\n\t\t\t{\r\n\t\t\t\t// Use custom field selection\r\n\t\t\t\tforeach ($this->selectFields as $field)\r\n\t\t\t\t{\r\n\t\t\t\t\t$cols[] = $field;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t// Take all fields\r\n\t\t\t\t$cols[] = 't1.*';\r\n\t\t\t}\r\n\t\r\n\t\t\t$from_sql = 'FROM `'.$this->name.'` t1 ';\r\n\t\t\t$joined = array();\r\n\t\t\t$joins = array();\r\n\t\t\t$alias_no = 2;\r\n\t\t\t$tables[] = array('table' => $this->name, 'alias' => 't1');\r\n\t\r\n\t\t\t// Iterate over fields\r\n\t\t\tforeach ($this->fields as &$field)\r\n\t\t\t{\r\n\t\t\t\t$use_alias = false;\r\n\t\r\n\t\t\t\tif ($field instanceof ForeignField)\r\n\t\t\t\t{\r\n\t\t\t\t\t// Check if foreign field should be included, if select fields were set\r\n\t\t\t\t\tif (isset($this->selectFields))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$found = false;\r\n\t\t\t\t\t\tforeach ($this->selectFields as $sel_field)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tif (str_contains($sel_field, $field->name))\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t$found = true;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (!$found)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\r\n\t\t\t\t\t// Find out what kind of join it should be (INNER or LEFT)\r\n\t\t\t\t\t$join_type = strtoupper($field->joinType);\r\n\t\r\n\t\t\t\t\t// Check if it's a join between two foreign tables\r\n\t\t\t\t\tif ($field->joinFromTable == null)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t// Join between this table and other table\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t// Check if we need to make a new join\r\n\t\t\t\t\t\t$this_join = array(\r\n\t\t\t\t\t\t\t'from_table' => $this->name, \r\n\t\t\t\t\t\t\t'to_table' => $field->table,\r\n\t\t\t\t\t\t\t'from' => $field->joinFrom, \r\n\t\t\t\t\t\t\t'to' => $field->joinTo\r\n\t\t\t\t\t\t);\r\n\t\t\t\t\t\tif (!$this->CheckJoinExists($this_join, $joins))\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$from_sql .= $join_type.' JOIN `'.$field->table .'` t'.$alias_no.' ON t1.`'.$field->joinFrom.'` = t'.$alias_no.'.`'.$field->joinTo.'` ';\r\n\t\t\t\t\t\t\t$joins[] = $this_join;\r\n\t\t\t\t\t\t\t$use_alias = true;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t// Join between two other tables\r\n\t\r\n\t\t\t\t\t\t// Check if we need to make a new join\r\n\t\t\t\t\t\t$this_join = array(\r\n\t\t\t\t\t\t\t'from_table' \t=> $this->table_name, \r\n\t\t\t\t\t\t\t'to_table' \t\t=> $field->foreign_field->table,\r\n\t\t\t\t\t\t\t'from' \t\t\t=> $field->foreign_field->join_from, \r\n\t\t\t\t\t\t\t'to' \t\t\t=> $field->foreign_field->join_to\r\n\t\t\t\t\t\t);\r\n\t\t\t\t\t\tif (!$this->checkJoinExists($this_join, $joins)) \r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tif (($alias = $this->tableHasAlias($field->table, $tables)) !== false) \r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t$from_sql .= $join_type.' JOIN `'.$field->table.'` t'.$alias_no.' ON '.$alias.'.`'.$field->joinFrom.'` = t'.$alias_no.'.`'.$field->joinTo.'` ';\r\n\t\t\t\t\t\t\t} \r\n\t\t\t\t\t\t\telse \r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t$from_sql .= $join_type.' JOIN `'.$field->table.'` t'.$alias_no.' ON `'.$field->joinFromTable.'`.`'.$field->joinFrom.'` = t'.$alias_no.'.`'.$field->joinTo.'` ';\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t$joins[] = $this_join;\r\n\t\t\t\t\t\t\t$use_alias = true;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\r\n\t\t\t\t\tif ($use_alias)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$cols[] = 't'.$alias_no.'.`'.$field->foreignFieldName .'` AS `'.$field->name.'`';\r\n\t\t\t\t\t\t$tables[] = array('table' => $field->table, 'alias' => 't'.$alias_no);\r\n\t\t\t\t\t\t$alias_no++;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t// Check if table has alias\r\n\t\t\t\t\t\tif (($alias = $this->tableHasAlias($field->table, $tables)) !== false)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$cols[] = $alias.'.`'.$field->foreignFieldName.'` AS `'.$field->name .'`';\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$cols[] = '`'.$field->table.'`.`'.$field->foreignFieldName.'` AS `'.$field->name.'`';\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$this->tableAliases = $tables;\r\n\t\r\n\t\t\t$sql .= implode(', ', $cols).' '.$from_sql;\r\n\t\r\n\t\t\t$this->table_aliases = $tables;\r\n\t\t}\r\n\t\r\n\t\treturn $sql;\r\n\t}", "protected function wrapUnion($sql): string\n {\n return '('.$sql.')';\n }", "protected function _compile_select($select_override = FALSE)\r\n\t{\r\n // Combine any cached components with the current statements\r\n $this->_merge_cache();\r\n\r\n // Write the \"select\" portion of the query\r\n if ($select_override !== FALSE)\r\n {\r\n $sql = $select_override;\r\n }\r\n else\r\n {\r\n $sql = ( ! $this->qb_distinct) ? 'SELECT ' : 'SELECT DISTINCT ';\r\n\r\n if (count($this->qb_select) === 0)\r\n {\r\n $sql .= '*';\r\n }\r\n else\r\n {\r\n // Cycle through the \"select\" portion of the query and prep each column name.\r\n // The reason we protect identifiers here rather then in the select() function\r\n // is because until the user calls the from() function we don't know if there are aliases\r\n foreach ($this->qb_select as $key => $val)\r\n {\r\n $no_escape = isset($this->qb_no_escape[$key]) ? $this->qb_no_escape[$key] : NULL;\r\n $this->qb_select[$key] = $this->protect_identifiers($val, FALSE, $no_escape);\r\n }\r\n\r\n $sql .= implode(', ', $this->qb_select);\r\n }\r\n }\r\n\r\n // Write the \"FROM\" portion of the query\r\n if (count($this->qb_from) > 0)\r\n {\r\n $sql .= \"\\nFROM \".$this->_from_tables();\r\n }\r\n\r\n // Write the \"JOIN\" portion of the query\r\n if (count($this->qb_join) > 0)\r\n {\r\n $sql .= \"\\n\".implode(\"\\n\", $this->qb_join);\r\n }\r\n\r\n $sql .= $this->_compile_wh('qb_where')\r\n .$this->_compile_group_by()\r\n .$this->_compile_wh('qb_having')\r\n .$this->_compile_order_by(); // ORDER BY\r\n\r\n // LIMIT\r\n if ($this->qb_limit)\r\n {\r\n $sql = $this->_limit($sql.\"\\n\");\r\n }\r\n\r\n // ----------------------------------------------------------------\r\n\r\n // Write the \"LOCK IN SHARE MODE\" portion of the query\r\n\r\n if ($this->qb_lock_in_share_mode)\r\n {\r\n $sql .= \"\\nLOCK IN SHARE MODE\";\r\n }\r\n\r\n // ----------------------------------------------------------------\r\n\r\n // Write the \"LOCK IN SHARE MODE\" portion of the query\r\n\r\n if ($this->qb_for_update)\r\n {\r\n $sql .= \"\\nFOR UPDATE\";\r\n }\r\n\r\n return $sql;\r\n\t}", "protected function RetSelect() {\n\n $return = \"SELECT\";\n\n if ($this->\n distinct) {\n\n $return .= \" DISTINCT\";\n }\n\n $columnsArr = [];\n\n foreach ($this->\n columns as $key => $value) {\n\n if (is_string($value)) {\n\n $columnsArr[] = $value;\n } else if (isset($value['subquery']) &&\n $value['subquery'] instanceof \\FluitoPHP\\Database\\DBQueryHelper &&\n $value['subquery']->\n IsSelect()) {\n\n $columnsArr[] = \"(\" . $value['subquery']->\n Generate() . \")\" . (isset($value['label']) &&\n is_string($value['label']) ? \" AS \\\"{$value['label']}\\\"\" : \"\");\n } else if (isset($value['value'])) {\n\n $columnsArr[] = \"'{$value['value']}'\" . (isset($value['label']) &&\n is_string($value['label']) ? \" AS \\\"{$value['label']}\\\"\" : \"\");\n } else {\n\n $columnsArr[] = \"{$value['column']}\" . (isset($value['label']) &&\n is_string($value['label']) ? \" AS \\\"{$value['label']}\\\"\" : \"\");\n }\n }\n\n if (count($columnsArr)) {\n\n $return .= \" \" . implode($columnsArr, \", \");\n } else {\n\n $return .= \" *\";\n }\n\n\n $tablesStr = \"\";\n\n foreach ($this->\n tables as $key => $value) {\n\n if (is_string($value)) {\n\n $tablesStr .= \", $value\";\n } else {\n\n if (!(isset($value['table']) &&\n $value['table'] != \"\") &&\n isset($value['subquery']) &&\n $value['subquery'] instanceof \\FluitoPHP\\Database\\DBQueryHelper &&\n $value['subquery']->\n IsSelect()) {\n\n $value['table'] = \"(\" . rtrim($value['subquery']->\n Generate(), ';') . \")\";\n\n if (!isset($value['alias'])) {\n\n throw new \\Exception(\"Error: Alias required in case of subquery to be used in from clause.\");\n }\n } else {\n\n $value['table'] = \"{$value['table']}\";\n }\n\n if (isset($value['alias'])) {\n\n $value['alias'] = \"`{$value['alias']}`\";\n }\n\n if (!isset($value['table']) ||\n $value['table'] == \"\") {\n\n throw new \\Exception(\"Error: Tables not properly provided in QueryHelper.\");\n }\n\n if (!isset($value['jointype'])) {\n\n $tablesStr .= \", \" . $value['table'];\n\n if (isset($value['alias'])) {\n\n $tablesStr .= \" AS \" . $value['alias'];\n }\n } else {\n\n switch ($value['jointype']) {\n case 'j':\n\n $tablesStr .= \" JOIN \" . $value['table'];\n break;\n\n case 'ij':\n\n $tablesStr .= \" INNER JOIN \" . $value['table'];\n break;\n\n case 'cj':\n\n $tablesStr .= \" CROSS JOIN \" . $value['table'];\n break;\n\n case 'sj':\n\n $tablesStr .= \" STRAIGHT_JOIN \" . $value['table'];\n break;\n\n case 'lj':\n\n $tablesStr .= \" LEFT JOIN \" . $value['table'];\n break;\n\n case 'rj':\n\n $tablesStr .= \" RIGHT JOIN \" . $value['table'];\n break;\n\n case 'nj':\n\n $tablesStr .= \" NATURAL JOIN \" . $value['table'];\n break;\n\n case 'nlj':\n\n $tablesStr .= \" NATURAL LEFT JOIN \" . $value['table'];\n break;\n\n case 'nrj':\n\n $tablesStr .= \" NATURAL RIGHT JOIN \" . $value['table'];\n break;\n\n case 'loj':\n\n $tablesStr .= \" LEFT OUTER JOIN \" . $value['table'];\n break;\n\n case 'roj':\n\n $tablesStr .= \" RIGHT OUTER JOIN \" . $value['table'];\n break;\n\n case 'nloj':\n\n $tablesStr .= \" NATURAL LEFT OUTER JOIN \" . $value['table'];\n break;\n\n case 'nroj':\n\n $tablesStr .= \" NATURAL RIGHT OUTER JOIN \" . $value['table'];\n break;\n\n default:\n break;\n }\n\n if (isset($value['alias'])) {\n\n $tablesStr .= \" AS \" . $value['alias'];\n }\n\n if (isset($value['joinconditions']) &&\n count($value['joinconditions'])) {\n\n $tablesStr .= $this->\n WhereClause($value['joinconditions'], 1);\n }\n }\n }\n }\n\n $return .= \" FROM \" . ltrim($tablesStr, \", \");\n\n\n if (count($this->\n where)) {\n\n $return .= $this->\n WhereClause($this->\n where);\n }\n\n\n $groupsArr = [];\n\n foreach ($this->\n group as $key => $value) {\n\n if (is_string($value)) {\n\n $groupsArr[] = \"{$value}\";\n } else if (isset($value['subquery']) &&\n $value['subquery'] instanceof \\FluitoPHP\\Database\\DBQueryHelper &&\n $value['subquery']->\n IsSelect()) {\n\n $groupsArr[] = \"(\" . rtrim($value['subquery']->\n Generate(), ';') . \")\";\n } else if (isset($value['value'])) {\n\n $value['value'] = $this->\n connection->\n GetConn()->\n real_escape_string($value['value']);\n $groupsArr[] = \"'{$value['value']}'\";\n } else {\n\n $groupsArr[] = \"{$value['column']}\";\n }\n }\n\n if (count($groupsArr)) {\n\n $return .= \" GROUP BY \" . implode($groupsArr, \", \");\n }\n\n\n if (count($this->\n having)) {\n\n $return .= $this->\n WhereClause($this->\n having, 2);\n }\n\n\n $ordersArr = [];\n\n foreach ($this->\n order as $key => $value) {\n\n if (is_string($value)) {\n\n $ordersArr[] = $value;\n } else if (isset($value['subquery']) &&\n $value['subquery'] instanceof \\FluitoPHP\\Database\\DBQueryHelper &&\n $value['subquery']->\n IsSelect()) {\n\n $ordersArr[] = \"(\" . rtrim($value['subquery']->\n Generate(), ';') . \")\" . (isset($value['type']) &&\n $value['type'] == 'd' ? \" DESC\" : \"\");\n } else if (isset($value['value'])) {\n\n $ordersArr[] = \"'{$value['value']}'\" . (isset($value['type']) &&\n $value['type'] == 'd' ? \" DESC\" : \"\");\n } else {\n\n $ordersArr[] = \"{$value['column']}\" . (isset($value['type']) &&\n $value['type'] == 'd' ? \" DESC\" : \"\");\n }\n }\n\n if (count($ordersArr)) {\n\n $return .= \" ORDER BY \" . implode($ordersArr, \", \");\n }\n\n if ($this->\n perpage > 0) {\n\n if ($this->\n page < 1) {\n\n $this->\n page = 1;\n }\n\n $startcount = $this->\n perpage * ($this->\n page - 1);\n\n $return .= \" LIMIT {$startcount}, {$this->\n perpage}\";\n }\n\n return $return . \";\";\n }", "protected function _compile_select($select_override = FALSE)\n\t{\n\t\t// Combine any cached components with the current statements\n\t\t$this->_merge_cache();\n\n\t\t// Write the \"select\" portion of the query\n\t\tif ($select_override !== FALSE)\n\t\t{\n\t\t\t$sql = $select_override;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$sql = ( ! $this->qb_distinct) ? 'SELECT ' : 'SELECT DISTINCT ';\n\n\t\t\tif (count($this->qb_select) === 0)\n\t\t\t{\n\t\t\t\t$sql .= '*';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// Cycle through the \"select\" portion of the query and prep each column name.\n\t\t\t\t// The reason we protect identifiers here rather than in the select() function\n\t\t\t\t// is because until the user calls the from() function we don't know if there are aliases\n\t\t\t\tforeach ($this->qb_select as $key => $val)\n\t\t\t\t{\n\t\t\t\t\t$no_escape = isset($this->qb_no_escape[$key]) ? $this->qb_no_escape[$key] : NULL;\n\t\t\t\t\t$this->qb_select[$key] = $this->protect_identifiers($val, FALSE, $no_escape);\n\t\t\t\t}\n\n\t\t\t\t$sql .= implode(', ', $this->qb_select);\n\t\t\t}\n\t\t}\n\n\t\t// Write the \"FROM\" portion of the query\n\t\tif (count($this->qb_from) > 0)\n\t\t{\n\t\t\t$sql .= \"\\nFROM \".$this->_from_tables();\n\t\t}\n\n\t\t// Write the \"JOIN\" portion of the query\n\t\tif (count($this->qb_join) > 0)\n\t\t{\n\t\t\t$sql .= \"\\n\".implode(\"\\n\", $this->qb_join);\n\t\t}\n\n\t\t$sql .= $this->_compile_wh('qb_where')\n\t\t\t.$this->_compile_group_by()\n\t\t\t.$this->_compile_wh('qb_having')\n\t\t\t.$this->_compile_order_by(); // ORDER BY\n\n\t\t// LIMIT\n\t\tif ($this->qb_limit OR $this->qb_offset)\n\t\t{\n\t\t\treturn $this->_limit($sql.\"\\n\");\n\t\t}\n\n\t\treturn $sql;\n\t}", "public function getUnionType() : UnionType\n {\n if (null !== ($union_type = $this->getFutureUnionType())) {\n $this->getUnionType()->addUnionType($union_type);\n }\n\n return parent::getUnionType();\n }", "protected function _sql_select ( /* void */ )\n {\n /*\n Start SQL query.\n */\n $sql = ($this->bDistinct) ? 'SELECT DISTINCT ' : 'SELECT ';\n /*\n Select which fields ?\n */\n $sql .= (empty($this->aFields)) ? '*' : implode(', ', $this->aFields);\n /*\n From which tables ?\n */\n $sql .= (empty($this->aTables)) ? '' : \"\\nFROM \" . implode(', ', $this->aTables);\n /*\n Join something ?\n */\n if (!empty($this->aJoin))\n {\n foreach ($this->aJoin as $j)\n {\n $sql .= \"\\n{$j[0]} JOIN {$j[1]} ON {$j[2]}\";\n }\n }\n /*\n Where ?\n */\n if (!empty($this->aWhere))\n {\n $sql .= \"\\nWHERE \" . implode(\"\\n\", $this->aWhere);\n $sql .= (!empty($this->aLike)) ? implode(\"\\n\", $this->aLike) : '';\n }\n elseif (!empty($this->aLike))\n {\n $sql .= \"\\nWHERE \" . implode(\"\\n\", $this->aLike);\n }\n /*\n Group by ?\n */\n if (!empty($this->aGroupBy))\n {\n $sql .= \"\\nGROUP BY \" . implode(', ', $this->aGroupBy);\n }\n /*\n Having ?\n */\n if (!empty($this->aHaving))\n {\n $sql .= \"\\nHAVING \";\n foreach ($this->aHaving as $i)\n {\n $sql .= \"\\n{$i[0]}{$i[1]} {$i[2]}\";\n }\n }\n /*\n Order by ?\n */\n if (!empty($this->aOrderBy))\n {\n $sql .= \"\\nORDER BY \";\n foreach ($this->aOrderBy as $i)\n {\n $sql .= \"{$i[0]} {$i[1]}, \";\n }\n $sql = trim($sql, ', ');\n }\n /*\n Query limit ?\n */\n if ($this->nLimit !== false)\n {\n if ($this->nOffset !== false)\n {\n $sql .= \"\\nLIMIT \" . $this->nOffset . ', ' . $this->nLimit;\n }\n else\n {\n $sql .= \"\\nLIMIT 0, \" . $this->nLimit;\n }\n }\n /*\n Return SQL.\n */\n return $sql;\n }", "public function select($select = '*')\n {\n $this->_type = db::SELECT;\n\n if (is_string($select))\n {\n $select = explode(',', $select);\n }\n elseif (is_object($select))\n {\n $this->_select[] = $select;\n }\n\n foreach ($select as $val)\n {\n if ($val !== '')\n {\n $this->_select[] = $val;\n }\n }\n\n return $this;\n }", "protected function _addCompound($type, Query $query) {\n if ($query->getType() !== self::SELECT) {\n throw new InvalidQueryException(sprintf('Only a select query can be used with %s', $type));\n }\n\n $query->attribute('compound', $type);\n\n $this->_compounds[] = $query;\n\n return $this;\n }", "abstract public function prepareSelect();", "public function addType($type)\n {\n $this->type = $this->type . Collection::OPERATOR_OR . $type;\n $this->types = null;\n $this->content = null;\n return $this;\n }", "public function makeSQL( $type ) {\n $this->pager->setTotal( $this->count() );\n $this->pager->setQuery( $this );\n return parent::makeSQL( $type );\n }", "public function selectUserFilesUnionOtherFiles($viewData = null) {\n\t\t$DB = $this->con->query(\"SELECT * FROM files WHERE user_id = {$_SESSION['user_id']} UNION SELECT * FROM files WHERE user_id != {$_SESSION['user_id']}\")->fetchAll(\\PDO::FETCH_ASSOC);\n\t\treturn $DB;\n\t}", "public function testTranslationWithUnionQuery(): void\n {\n $table = $this->getTableLocator()->get('Comments');\n /** @var \\Cake\\ORM\\Table|\\Cake\\ORM\\Behavior\\TranslateBehavior $table */\n $table->addBehavior('Translate', ['fields' => ['comment']]);\n $table->setLocale('spa');\n $query = $table->find()->where(['Comments.id' => 6]);\n $query2 = $table->find()->where(['Comments.id' => 5]);\n $query->union($query2);\n $results = $query->all()->sortBy('id', SORT_ASC)->toList();\n $this->assertCount(2, $results);\n\n $this->assertSame('First Comment for Second Article', $results[0]->comment);\n $this->assertSame('Second Comment for Second Article', $results[1]->comment);\n }", "public function unionQueries( $sqls, $all ) {\n\t\t$glue = $all ? ') UNION ALL (' : ') UNION (';\n\n\t\treturn '(' . implode( $glue, $sqls ) . ')';\n\t}", "protected function _addSelectPart($type, Select $select)\n {\n switch ($type) {\n case 'sold':\n $select->join(array('s' => 'sales_listings'), \"s.listing_id = l.id\", 's.id AS sale_listing_id')\n ->order('s.created_at DESC')\n ->group('l.id');\n break;\n }\n\n return $select;\n }", "public function testSelectStatementAddTable()\n {\n\n $query = new Query(\"SELECT id, description FROM `test` WHERE xy > 10\", 'mysql');\n $query->from(\"abc\", Query::APPEND);\n $this->assertEquals(\"SELECT id, description FROM `test` , `abc` WHERE xy > 10\", (string)$query);\n }", "public function addSelect($name, $alias = '')\n\t{\n\t\tif (is_object($name))\n\t\t\t$name = $name->getName();\n\n\t\t// Check error\n\t\tif (isset($this->selects[$name]) && $alias == '')\n\t\t\tthrow(new RowAlreadyUsedException(\"The row [\" . $name . \"] is already added to the query. Please use an alias.\"));\n\t\tif ($alias != '' && in_array($alias, $this->selects))\n\t\t\tthrow(new AliasAlreadyUsedException(\"The alias [\" . $alias . \"] is already used.\"));\n\t\tif ($this->fromQueryString)\n\t\t\tthrow(new QueryStringAlreadySpecified(\"The query string has already been specified. You can't access query builder's functions.\"));\n\n\t\t// Add table to FORM group\n\t\t$this->selects[$name] = $alias == '' ? $name : $alias;\n\t\treturn $this;\n\t}", "public function addQuery($sql = '', $comment = '', $option = ''){\n\t\t$this->_queries[] = array(\n\t\t\t'sql' => $sql,\n\t\t\t'comment' => $comment,\n\t\t\t'option' => $option\n\t\t);\n\n\t\treturn $this;\n\t}", "private function __select() {\n $from_str = $this->getFromStr();\n $field = $this->field_str;\n if (empty($field)) {\n $field = '*';\n }\n $sql = \"SELECT {$field} FROM {$from_str}\";\n if (!empty($this->join_str_list)) {\n $temp = implode(' ', $this->join_str_list);\n $sql .= \" {$temp}\";\n }\n if (!empty($this->where_str)) {\n $sql .= \" WHERE {$this->where_str}\";\n }\n if (!empty($this->group_str)) {\n $sql .= \" GROUP BY {$this->group_str}\";\n }\n if (!empty($this->order_str)) {\n $sql .= \" ORDER BY {$this->order_str}\";\n }\n if (!empty($this->limit_str)) {\n $sql .= \" LIMIT {$this->limit_str}\";\n }\n $list = $this->query($sql);\n return $list;\n }", "public function select($str = '*') \n {\n $this->_data['select'] = $str;\n $postpend = '';\n if ($this->_data['query'] !== null) {\n $postpend = $this->_data['query'];\n }\n $this->_data['query'] = 'SELECT ' . $str . $postpend;\n return $this;\n }", "public function __clone()\n {\n $this->select = clone $this->select;\n }", "public function get_select()\n {\n $flags = $this->sql_no_cache ? 'sql_no_cache' : '';\n $flags .= $this->sql_calc_found ? 'sql_calc_found_rows' : '';\n\n $fields_table = $this->alias ? $this->alias: self::quote_name($this->table);\n\n $fields = $this->fields ? join(', ', $this->fields): $fields_table.'.*';\n $from = $this->get_from();\n $join = $this->get_join();\n $where = $this->get_where();\n $having = $this->get_having();\n $order = $this->get_order();\n $group = $this->get_group();\n $limit = $this->get_limit();\n $mode = $this->for_update ? 'for update': '';\n $mode = $this->share_mode ? 'lock in share mode': '';\n // MySQL runs a needless filesort when grouping without an order clause. disable it.\n if ($group && !$order) $order = 'order by null';\n return \"select $flags $fields $from $join $where $group $having $order $limit $mode\";\n }", "function set_select_type( $type )\n\t{\n\t\t$allowed = array( MYSQL_NUM, MYSQL_BOTH, MYSQL_ASSOC );\n\t\tif ( in_array( $type, $allowed ) ) {\n\t\t\t$this->SELECT_TYPE = $type;\n\t\t}\n\t\treturn $this->SELECT_TYPE;\n\t}", "public function &getUnion();", "public function addselect($columns = \"*\", $object = null, $defaultjoin = true)\n {\n\n // save currente sequence\n $this->querysequence = $this->query;\n $this->sequenceobject = $this->object;\n\n if (is_object($columns)):\n $this->instanciateVariable($columns);\n $columns = \"*\";\n elseif (is_bool($object)):\n $defaultjoin = $object;\n elseif (is_object($object)):\n $this->instanciateVariable($object);\n endif;\n\n $this->defaultjoinsetted = $defaultjoin;\n $this->query = \" select $columns from `\" . $this->table . \"` \";\n\n if ($defaultjoin) {\n\n if (!empty($this->entity_link_list)) {\n foreach ($this->entity_link_list as $entity_link) {\n $this->query .= \" left join `\" . strtolower(get_class($entity_link)) . \"` on \" . strtolower(get_class($entity_link)) . \".id = \" . $this->table . \".\" . strtolower(get_class($entity_link)) . \"_id\";\n }\n }\n }\n\n return $this;\n }", "protected function _translateSelect(Query $query, JsonTypeMap &$map): Query\n {\n $fields = $query->clause('select');\n $updatedFields = [];\n\n // Handle alias for selected datfields\n foreach ($fields as $alias => $field) {\n $palias = null;\n\n // If field is an expression, translate it\n if ($field instanceof ExpressionInterface) {\n $updatedFields[$alias] = $this->translateExpression($field, $query, $map);\n continue;\n }\n\n if (is_int($field)) {\n $updatedFields[$alias] = $field;\n continue;\n }\n\n // Regular field case\n if (!$this->isDatField($field)) {\n $updatedFields[$alias] = $this->_translateRawSQL($field, $query, $map);\n continue;\n }\n\n if (is_integer($alias) || $this->isDatField($alias)) {\n // No alias given or autogenerated, generates a valid one or query will fail\n // Also clean CakePHP processed alias to keep JSON structure\n // This will only work if using \\Cake\\ORM\\Query\n\n // If field is selected without alias, we must link type to previous cakephp alias\n $palias = is_string($alias) ? $alias : null;\n $alias = $this->aliasDatField($field);\n\n // Restore model alias\n if ($query instanceof ORMQuery) {\n $alias = sprintf('%s__%s', $this->_getAliasFromQuery($query), $alias);\n }\n } else {\n // When aliasing datfields, select type map will only receive alias with copied type\n // We must get back type from main type map and clears select type map\n $type = $query->getTypeMap()->toArray()[$field] ?? null;\n if ($type) {\n // Add back JSON type to parse alias correctly\n $map\n ->addJsonType($field, $type)\n ->clearRegularTypeMap($alias);\n }\n }\n\n // Update alias target\n $map->setAlias($palias ?? $field, $alias);\n $updatedFields[$alias] = $this->translateDatField($field);\n }\n\n $query->select($updatedFields, true);\n\n return $query;\n }", "function querySelect( $query, &$resultContainer )\r\n\t{\r\n\t\t$resultStm = $this->link->query( $query.\";\", PDO::FETCH_CLASS, \"stdclass\" );\r\n\t\treturn $this->_processSelectResult($resultStm, $resultContainer, $query);\r\n\t}", "public final function simplify(Context\\Context $ctx_ = null):self {\n $ctx = $ctx_ ?? new Context\\Context(new NullErrorReceiver());\n $union = new Union($this);\n foreach ($this->split() as $type) {\n $union = $union->addType($type, $ctx);\n }\n return $union;\n }", "public function performSelectTypeAnalysis() {\n\t\t$infos = array(\n\t\t\t'SIMPLE' => 'Simple SELECT (not using UNION or subqueries)',\n\t\t\t'PRIMARY' => 'Outermost SELECT',\n\t\t\t'UNION' => 'Second or later SELECT statement in a UNION',\n\t\t\t'DEPENDENT' => 'UNION\tSecond or later SELECT statement in a UNION, dependent on outer query',\n\t\t\t'UNION RESULT' => 'Result of a UNION.',\n\t\t\t'SUBQUERY' => 'First SELECT in subquery',\n\t\t\t'DEPENDENT SUBQUERY' => 'First SELECT in subquery, dependent on outer query',\n\t\t\t'DERIVED' => 'Derived table SELECT (subquery in FROM clause)',\n\t\t\t'MATERIALIZED' => 'Materialized subquery',\n\t\t\t'UNCACHEABLE SUBQUERY' => 'A subquery for which the result cannot be cached and must be re-evaluated for each row of the outer query',\n\t\t\t'UNCACHEABLE UNION' => 'The second or later select in a UNION that belongs to an uncacheable subquery (see UNCACHEABLE SUBQUERY)'\n\t\t);\n\t\t$this->cells['select_type']->info = $infos[$this->cells['select_type']->v];\n\t}", "public function select($sql) {\n $this->__select__ = $sql;\n return $this;\n }", "protected function getSelectAppend($new_sql = '', $full_sql = '')\n {\n if (trim($new_sql) === '') {\n return $full_sql;\n }\n\n if (trim($full_sql) === '') {\n $full_sql = $this->getDistinct() . $new_sql;\n } else {\n $full_sql .= PHP_EOL . $new_sql;\n }\n\n return $full_sql;\n }", "public function assembleSelect(Select $select, array &$values = [])\n {\n $select = clone $select;\n\n $this->emit(static::ON_ASSEMBLE_SELECT, [$select]);\n\n $sql = array_filter([\n $this->buildWith($select->getWith(), $values),\n $this->buildSelect($select->getColumns(), $select->getDistinct(), $values),\n $this->buildFrom($select->getFrom(), $values),\n $this->buildJoin($select->getJoin(), $values),\n $this->buildWhere($select->getWhere(), $values),\n $this->buildGroupBy($select->getGroupBy(), $values),\n $this->buildHaving($select->getHaving(), $values),\n $this->buildOrderBy($select->getOrderBy(), $values),\n $this->buildLimitOffset($select->getLimit(), $select->getOffset())\n ]);\n\n $sql = implode($this->separator, $sql);\n\n $unions = $this->buildUnions($select->getUnion(), $values);\n if ($unions) {\n list($unionKeywords, $selects) = $unions;\n\n if ($sql) {\n $sql = \"($sql)\";\n\n $requiresUnionKeyword = true;\n } else {\n $requiresUnionKeyword = false;\n }\n\n do {\n $unionKeyword = array_shift($unionKeywords);\n $select = array_shift($selects);\n\n if ($requiresUnionKeyword) {\n $sql .= \"{$this->separator}$unionKeyword{$this->separator}\";\n }\n\n $sql .= \"($select)\";\n\n $requiresUnionKeyword = true;\n } while (! empty($unionKeywords));\n }\n\n $this->emit(static::ON_SELECT_ASSEMBLED, [&$sql, &$values]);\n\n return [$sql, $values];\n }", "function register_graphql_union_type(string $type_name, array $config)\n {\n }", "public function add_select($columns)\r\n {\r\n if ($this->columns) {\r\n array_add($this->columns, $columns);\r\n } else {\r\n $this->select($columns);\r\n }\r\n\r\n return $this;\r\n }", "public function subQuery() {\n $query = new SubQuery(Query::SELECT, $this->getRepository());\n $query->fields(func_get_args());\n\n return $query;\n }", "public function select($data = '*') \n {\t\n // Empty out the old junk\n $this->clear();\n \n // Process our columns, if array, we need to implode to a string\n if(is_array($data))\n {\n if(count($data) > 1)\n {\n $this->sql = \"SELECT \". $this->clean( implode(', ', $data) );\n }\n else\n {\n $this->sql = \"SELECT \". $this->clean($data[0]);\n }\n }\n else\n {\n $this->sql = \"SELECT \". $this->clean($data);\n }\n return $this;\n }", "public function whereOrQuery(Query $subQuery) {\r\n\t\t$this->addWhereQuery('OR', $subQuery);\r\n\t}", "public function execute($type = Database::SELECT, $data = NULL, $as_object = NULL)\n\t{\n\t\t$query = $this->build($type);\n\t\t$meta = $this->meta();\n\t\t\n\t\t// Have we got a from for SELECTS?\n\t\tif ($type === Database::SELECT && !isset($this->_db_applied['from']))\n\t\t{\n\t\t\t$query->from($meta->table);\n\t\t}\n\t\t// All other methods require table() to be set\n\t\telse if ($type !== Database::SELECT && !isset($this->_db_applied['table']))\n\t\t{\n\t\t\t$query->table($meta->table);\n\t\t}\n\t\t\n\t\t// Perform a little arg-munging since UPDATES and INSERTS accept a data parameter\n\t\tif ($type === Database::UPDATE && is_array($data))\n\t\t{\n\t\t\t// Since we're out of the Jelly, we have to alias manually\n\t\t\tforeach($data as $column => $value)\n\t\t\t{\n\t\t\t\t$query->value($this->alias($column), $value);\n\t\t\t}\n\t\t}\n\t\telse if ($type === Database::INSERT && is_array($data))\n\t\t{\n\t\t\t// Keys have to be manually aliased\n\t\t\t$columns = array();\n\t\t\t$values = array();\n\t\t\tforeach ($data as $column => $value)\n\t\t\t{\n\t\t\t\t$columns[] = $this->alias($column);\n\t\t\t\t$values[] = $value;\n\t\t\t}\n\t\t\t\n\t\t\t$query->columns($columns);\n\t\t\t$query->values($values);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$as_object = $data;\n\t\t}\n\t\t\n\t\t// Return a StdClass. Much faster\n\t\tif ($as_object === NULL)\n\t\t{\n\t\t\t$query->as_object(get_class($this));\n\t\t}\n\t\t// Allow custom classes and such\n\t\telse \n\t\t{\n\t\t\t$query->as_object($as_object);\n\t\t}\n\t\t\n\t\treturn $query->execute($meta->db);\n\t}", "public function select()\n\t{\n\t\t$this->_query['select'] = func_get_args();\n\n\t\treturn $this;\n\t}", "function addToQuery(&$query, $tablename=\"\", $fieldaliasprefix=\"\", $rec=\"\", $level, $mode)\n {\n }", "abstract public function query($type, $sql, $asObject = false, array $params = null);", "public function\n\t\tget_select_query()\n\t{\n\t\t$query = '';\n\t\t\n\t\t$key_fields = $this->get_key_fields();\n\t\t\n\t\t#print_r($key_fields);\n\t\t\n\t\t$display_fields = $this->get_display_fields();\n\t\t\n\t\t#print_r($display_fields);\n\t\t\n\t\t$table_name = $this->get_table_name();\n\t\t\n\t\t$ordering_fields = $this->get_ordering_fields();\n\t\t\n\t\t#print_r($ordering_fields);\n\t\t\n\t\t/*\n\t\t * The select clause.\n\t\t */\n\t\t\n\t\t$select_fields = array();\n\t\t\n\t\tforeach ($key_fields as $key_field) {\n\t\t\t$select_fields[] = $key_field;\n\t\t}\n\t\t\n\t\tforeach ($display_fields as $display_field) {\n\t\t\t$select_fields[] = $display_field['name'];\n\t\t}\n\t\t\n\t\t#print_r($select_fields);\n\t\t\n\t\t$select_fields = array_unique($select_fields);\n\t\t\n\t\t#print_r($select_fields);\n\t\t\n\t\t$query .= 'SELECT ';\n\t\t\n\t\t$first = TRUE;\n\t\tforeach ($select_fields as $select_field) {\n\t\t\tif ($first) {\n\t\t\t\t$first = FALSE;\n\t\t\t} else {\n\t\t\t\t$query .= ' , ';\n\t\t\t}\n\t\t\t\n\t\t\t$query .= ' ' . $select_field . ' ';\n\t\t}\n\t\t\n\t\t/*\n\t\t * The from clause.\n\t\t */\n\t\t\n\t\t$query .= ' FROM ' . $table_name . ' ';\n\t\t\n\t\t/*\n\t\t * The order by clause.\n\t\t */\n\t\t\n\t\t$query .= ' ORDER BY ';\n\t\t\n\t\t$first = TRUE;\n\t\tforeach ($ordering_fields as $of) {\n\t\t\tif ($first) {\n\t\t\t\t$first = FALSE;\n\t\t\t} else {\n\t\t\t\t$query .= ' , ';\n\t\t\t}\n\t\t\t\n\t\t\t$query .= ' ' . $of['name'] . ' ' . $of['direction'] . ' ';\n\t\t}\n\t\t\n\t\t#echo $query;\n\t\t\n\t\treturn $query;\n\t}", "public function getUnionType(): UnionType\n {\n if (null !== ($union_type = $this->getFutureUnionType())) {\n $this->setUnionType(parent::getUnionType()->withUnionType($union_type->asNonLiteralType()));\n }\n\n return parent::getUnionType();\n }", "function addToQuery(&$query, $tablename=\"\", $fieldaliasprefix=\"\", $rec, $level, $mode)\n {\n }", "public function select($selectString = '') {\n $select = '';\n $this->type = self::TYPE_SELECT;\n if (empty($selectString)) {\n $select = \"SELECT * FROM `\" . static::$tableName . \"` \";\n } else {\n $select = \"SELECT \" . $selectString . \" FROM `\" . static::$tableName . \"` \";\n }\n $this->sql = $select;\n }", "private function addDerivedQueries(\n RequestInterface $request,\n QueryContainer $queryContainer,\n ScoreBuilder $scoreBuilder,\n Select $select,\n IndexBuilderInterface $indexBuilder\n ) {\n $matchQueries = $queryContainer->getMatchQueries();\n if (!$matchQueries) {\n $select->columns($scoreBuilder->build());\n $select = $this->createAroundSelect($select, $scoreBuilder);\n } else {\n $matchContainer = array_shift($matchQueries);\n $this->matchBuilder->build(\n $scoreBuilder,\n $select,\n $matchContainer->getRequest(),\n $matchContainer->getConditionType()\n );\n $select->columns($scoreBuilder->build());\n $select = $this->createAroundSelect($select, $scoreBuilder);\n $select = $this->addMatchQueries($request, $select, $indexBuilder, $matchQueries);\n }\n\n return $select;\n }", "public /*overrides*/ function getLimitSubquery()\n {\n $map = reset($this->_queryComponents);\n $table = $map['table'];\n $componentAlias = key($this->_queryComponents);\n\n // get short alias\n $alias = $this->getSqlTableAlias($componentAlias);\n\n $driverName = $this->_conn->getAttribute(Doctrine_Core::ATTR_DRIVER_NAME);\n\n // initialize the base of the subquery\n if (($driverName == 'oracle' || $driverName == 'oci') && $this->_isOrderedByJoinedColumn()) {\n $subquery = 'SELECT ';\n } else {\n $subquery = 'SELECT DISTINCT ';\n }\n // what about composite keys?\n if (is_array($table->getIdentifier())) {\n foreach ($table->getIdentifier() as $id) {\n $primaryKey[] = $this->_conn->quoteIdentifier($alias . '.' . $id);\n }\n $subquery .= join(', ', $primaryKey);\n } else {\n $primaryKey = $alias . '.' . $table->getColumnName($table->getIdentifier());\n $subquery .= $this->_conn->quoteIdentifier($primaryKey);\n }\n\n // pgsql & oracle need the order by fields to be preserved in select clause\n if ($driverName == 'pgsql' || $driverName == 'oracle' || $driverName == 'oci' || $driverName == 'mssql' || $driverName == 'odbc') {\n foreach ($this->_sqlParts['orderby'] as $part) {\n // Remove identifier quoting if it exists\n $e = $this->_tokenizer->bracketExplode($part, ' ');\n foreach ($e as $f) {\n if ($f == 0 || $f % 2 == 0) {\n $partOriginal = str_replace(',', '', trim($f));\n $callback = create_function('$e', 'return trim($e, \\'[]`\"\\');');\n $part = trim(implode('.', array_map($callback, explode('.', $partOriginal))));\n\n if (strpos($part, '.') === false) {\n continue;\n }\n\n // don't add functions\n if (strpos($part, '(') !== false) {\n continue;\n }\n\n // don't add primarykey column (its already in the select clause)\n if ($part !== $primaryKey) {\n $subquery .= ', ' . $partOriginal;\n }\n }\n }\n }\n }\n\n $orderby = $this->_sqlParts['orderby'];\n $having = $this->_sqlParts['having'];\n if ($driverName == 'mysql' || $driverName == 'pgsql') {\n foreach ($this->_expressionMap as $dqlAlias => $expr) {\n if (isset($expr[1])) {\n $subquery .= ', ' . $expr[0] . ' AS ' . $this->_aggregateAliasMap[$dqlAlias];\n }\n }\n } else {\n foreach ($this->_expressionMap as $dqlAlias => $expr) {\n if (isset($expr[1])) {\n foreach ($having as $k => $v) {\n $having[$k] = str_replace($this->_aggregateAliasMap[$dqlAlias], $expr[0], $v);\n }\n foreach ($orderby as $k => $v) {\n $e = explode(' ', $v);\n if ($e[0] == $this->_aggregateAliasMap[$dqlAlias]) {\n $orderby[$k] = $expr[0];\n }\n }\n }\n }\n }\n\n // Add having fields that got stripped out of select\n preg_match_all('/`[a-z0-9_]+`\\.`[a-z0-9_]+`/i', implode(' ', $having), $matches, PREG_PATTERN_ORDER);\n if (count($matches[0]) > 0) {\n $subquery .= ', ' . implode(', ', array_unique($matches[0]));\n }\n\n $subquery .= ' FROM';\n\n foreach ($this->_sqlParts['from'] as $part) {\n // preserve LEFT JOINs only if needed\n if (substr($part, 0, 9) === 'LEFT JOIN') {\n $e = explode(' ', $part);\n // Fix for http://www.doctrine-project.org/jira/browse/DC-706\n // Fix for http://www.doctrine-project.org/jira/browse/DC-594\n if (empty($this->_sqlParts['orderby']) && empty($this->_sqlParts['where']) && empty($this->_sqlParts['having']) && empty($this->_sqlParts['groupby'])) {\n continue;\n }\n }\n\n $subquery .= ' ' . $part;\n }\n\n // all conditions must be preserved in subquery\n $subquery .= ( ! empty($this->_sqlParts['where']))? ' WHERE ' . implode(' ', $this->_sqlParts['where']) : '';\n $subquery .= ( ! empty($this->_sqlParts['groupby']))? ' GROUP BY ' . implode(', ', $this->_sqlParts['groupby']) : '';\n $subquery .= ( ! empty($having))? ' HAVING ' . implode(' AND ', $having) : '';\n $subquery .= ( ! empty($orderby))? ' ORDER BY ' . implode(', ', $orderby) : '';\n\n if (($driverName == 'oracle' || $driverName == 'oci') && $this->_isOrderedByJoinedColumn()) {\n // When using \"ORDER BY x.foo\" where x.foo is a column of a joined table,\n // we may get duplicate primary keys because all columns in ORDER BY must appear\n // in the SELECT list when using DISTINCT. Hence we need to filter out the\n // primary keys with an additional DISTINCT subquery.\n // #1038\n $quotedIdentifierColumnName = $this->_conn->quoteIdentifier($table->getColumnName($table->getIdentifier()));\n $subquery = 'SELECT doctrine_subquery_alias.' . $quotedIdentifierColumnName\n . ' FROM (' . $subquery . ') doctrine_subquery_alias'\n . ' GROUP BY doctrine_subquery_alias.' . $quotedIdentifierColumnName\n . ' ORDER BY MIN(ROWNUM)';\n }\n\n // add driver specific limit clause\n $subquery = $this->_conn->modifyLimitSubquery($table, $subquery, $this->_sqlParts['limit'], $this->_sqlParts['offset']);\n\n $parts = $this->_tokenizer->quoteExplode($subquery, ' ', \"'\", \"'\");\n\n foreach ($parts as $k => $part) {\n if (strpos($part, ' ') !== false) {\n continue;\n }\n\n $part = str_replace(array('\"', \"'\", '`'), \"\", $part);\n\n if ($this->hasSqlTableAlias($part)) {\n $parts[$k] = $this->_conn->quoteIdentifier($this->generateNewSqlTableAlias($part));\n continue;\n }\n\n if (strpos($part, '.') === false) {\n continue;\n }\n\n preg_match_all(\"/[a-zA-Z0-9_]+\\.[a-z0-9_]+/i\", $part, $m);\n\n foreach ($m[0] as $match) {\n $e = explode('.', $match);\n\n // Rebuild the original part without the newly generate alias and with quoting reapplied\n $e2 = array();\n foreach ($e as $k2 => $v2) {\n $e2[$k2] = $this->_conn->quoteIdentifier($v2);\n }\n $match = implode('.', $e2);\n\n // Generate new table alias\n $e[0] = $this->generateNewSqlTableAlias($e[0]);\n\n // Requote the part with the newly generated alias\n foreach ($e as $k2 => $v2) {\n $e[$k2] = $this->_conn->quoteIdentifier($v2);\n }\n\n $replace = implode('.' , $e);\n\n // Replace the original part with the new part with new sql table alias\n $parts[$k] = str_replace($match, $replace, $parts[$k]);\n }\n }\n\n if ($driverName == 'mysql' || $driverName == 'pgsql') {\n foreach ($parts as $k => $part) {\n if (strpos($part, \"'\") !== false) {\n continue;\n }\n if (strpos($part, '__') == false) {\n continue;\n }\n\n preg_match_all(\"/[a-zA-Z0-9_]+\\_\\_[a-z0-9_]+/i\", $part, $m);\n\n foreach ($m[0] as $match) {\n $e = explode('__', $match);\n $e[0] = $this->generateNewSqlTableAlias($e[0]);\n\n $parts[$k] = str_replace($match, implode('__', $e), $parts[$k]);\n }\n }\n }\n\n $subquery = implode(' ', $parts);\n return $subquery;\n }", "private function init_consolidationAndSelect_setTsSelect()\n {\n // LOOP : each filter (table.field)\n foreach ( ( array ) $this->arr_tsFilterTableFields as $tableField )\n {\n // IF : $conf_sql['select'] doesn't contain the current tableField\n if ( strpos( $this->pObj->conf_sql[ 'select' ], $tableField ) === false )\n {\n // Add tableField to ts property SELECT\n $csvStatement = ', ' . $tableField . ' AS \\'' . $tableField . '\\'';\n $this->pObj->conf_sql[ 'select' ] = $this->pObj->conf_sql[ 'select' ] . ', ' . $csvStatement;\n // Add tableField to ts property SELECT\n // DRS\n if ( $this->pObj->b_drs_filter )\n {\n $prompt = $tableField . ' is added to $this->pObj->conf_sql[select].';\n t3lib_div :: devlog( '[INFO/FILTER] ' . $prompt, $this->pObj->extKey, 0 );\n }\n // DRS\n }\n // IF : $conf_sql['select'] doesn't contain the current tableField\n // IF : $csvSelectWoFunc doesn't contain the current tableField\n if ( strpos( $this->pObj->csvSelectWoFunc, $tableField ) === false )\n {\n $this->pObj->csvSelectWoFunc = $this->pObj->csvSelectWoFunc . ', ' . $tableField;\n // DRS\n if ( $this->pObj->b_drs_filter )\n {\n $prompt = $tableField . ' is added to $this->pObj->csvSelectWoFunc.';\n t3lib_div :: devlog( '[INFO/FILTER] ' . $prompt, $this->pObj->extKey, 0 );\n }\n // DRS\n }\n // IF : $csvSelectWoFunc doesn't contain the current tableField\n }\n // LOOP : each filter (table.field)\n }", "protected function parseUnion() {\n $reader = $this->reader; // alias in local\n\n do {\n // this will ALWAYS stop our loop\n if($reader->nodeType == XMLReader::END_ELEMENT && $reader->name == 'union') {\n break;\n }\n } while($reader->read());\n\n return;\n }", "function duplicateTypeInUnion( int | string /*comment*/ | INT $var) {}", "abstract public function Query($query, $type = DBA::ASSOC);", "protected function processUnion($tokens) {\n // code which finds UNION and UNION ALL query parts\n $processor = new UnionProcessor();\n return $processor->process($tokens);\n }", "public function SELECTquery($select_fields, $from_table, $where_clause, $groupBy='', $orderBy='', $limit='') {\n \n $query = parent::SELECTquery($select_fields, $from_table, $where_clause, $groupBy, $orderBy, $limit);\n \n // trace query\n $debugQuery = str_replace(chr(9), '', $query); // removes tabs from query for better readability\n trace($debugQuery);\n #$this->logQuery($debugQuery); // activate for debugging purposes only - no logging by default for non-modifying queries like selects!\n \n return $query;\n \n }", "private function addJoinOnQuery($type, Query $other, Query $whereQuery) {\r\n\t\t//$this->joins[$other->alias]['on'][]=' '.$type.' ('.implode(' ', $whereQuery->wheres).')';\r\n\t\t$this->addJoinOnClause($other, $type, '('.implode(' ',$whereQuery->_salt_wheres).')');\r\n\t\t$this->linkBindsOf($other, ClauseType::JOIN, ClauseType::WHERE);\r\n\t}", "public function execute($result_type = QueryResultType::PDO_OBJECT, $firstOnly = false, $record_class = '', $fields_alias = '', $eagerLoading = array())\n\t{\n\t\tif ($this->fromQueryString && $result_type == QueryResultType::RECORD_OBJECT)\n\t\t\tthrow(new UnvalidResultTypeException(\"Record object result type cannot be used with query made from string. Please use query builder's functions or change result type.\"));\n\n\t\t// Retrieve result type\n\t\tif ($result_type == QueryResultType::RECORD_OBJECT && $record_class == '')\n\t\t{\n\t\t\tif (!class_exists(ucfirst($this->firstFrom) . 'Table'))\n\t\t\t\tthrow(new UnknownTable(\"The table [\" . ucfirst($this->firstFrom) . \"Table] is not part of the project model schema, and then cannot be used as result type. Please specify another result type.\"));\n\t\t\t$record_class = $this->firstFrom;\n\t\t}\n\n\t\t// Concat query string\n\t\tif (!$this->fromQueryString)\n\t\t\t$this->querystring = $this->concatQueryString();\n\n\t\t$query = $this->database->getConnection()->prepare($this->querystring);\n\t\tLogger::getInstance()->log(LoggerEntry::DATABASE, 'Query', 'Execute [' . $this->querystring . ']');\n\n\t\tEventHandler::trigger(EventTypes::ORION_BEFORE_QUERY, null);\n\t\ttry\n\t\t{\n\t\t\tif ($this->fromQueryString)\n\t\t\t\t$query->execute($this->querystring_arguments);\n\t\t\telse\n\t\t\t\t$query->execute();\n\t\t} catch (Exception $e)\n\t\t{\n\t\t\tthrow(new QueryNotValidException(\"The query [\" . $this->querystring . \"] returned the following error: \" . $e));\n\t\t}\n\t\tEventHandler::trigger(EventTypes::ORION_AFTER_QUERY, null);\n\n\t\tif ($this->isSelectQuery() || $this->fromQueryString)\n\t\t{\n\t\t\tswitch ($result_type)\n\t\t\t{\n\t\t\t\tcase QueryResultType::NONE:\n\t\t\t\t\tbreak;\n\n\t\t\t\t// Returns as RECORD object\n\t\t\t\tcase QueryResultType::RECORD_OBJECT:\n\t\t\t\t\t$result = $query->fetchAll(PDO::FETCH_ASSOC);\n\t\t\t\t\tLogger::getInstance()->log(LoggerEntry::DATABASE, 'Query', 'Results count: [' . sizeof($result) . ']');\n\t\t\t\t\t$final = array();\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\tif (is_array($eagerLoading) && sizeof($eagerLoading) > 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$final = Record::createObjectFromArray(new $record_class(), $result, $record_class, $eagerLoading, false);\n\t\t\t\t\t\t} else\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tforeach ($result as $line)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$final[] = Record::createObjectFromArray(new $record_class(), $line, $fields_alias);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} catch (Exception $e)\n\t\t\t\t\t{\n\t\t\t\t\t\tthrow(new QueryNotValidException(\"The query [\" . $this->querystring . \"] returned the following error: \" . $e));\n\t\t\t\t\t}\n\n\t\t\t\t\tif ($firstOnly)\n\t\t\t\t\t\treturn sizeof($final) > 0 ? $final[0] : null;\n\t\t\t\t\treturn $final;\n\n\t\t\t\t// Returns as PDO object\n\t\t\t\tcase QueryResultType::PDO_OBJECT:\n\t\t\t\t\t$all = $query->fetchAll(PDO::FETCH_OBJ);\n\t\t\t\t\tLogger::getInstance()->log(LoggerEntry::DATABASE, 'Query', 'Results count: [' . sizeof($all) . ']');\n\t\t\t\t\tif ($firstOnly)\n\t\t\t\t\t{\n\t\t\t\t\t\treturn sizeof($all) > 0 ? $all[0] : null;\n\t\t\t\t\t}\n\t\t\t\t\treturn $all;\n\n\t\t\t\t// Returns as PDO array\n\t\t\t\tcase QueryResultType::PDO_ARRAY:\n\t\t\t\t\t$all = $query->fetchAll(PDO::FETCH_ASSOC);\n\t\t\t\t\tLogger::getInstance()->log(LoggerEntry::DATABASE, 'Query', 'Results count: [' . sizeof($all) . ']');\n\t\t\t\t\tif ($firstOnly)\n\t\t\t\t\t{\n\t\t\t\t\t\treturn sizeof($all) > 0 ? $all[0] : null;\n\t\t\t\t\t}\n\t\t\t\t\treturn $all;\n\t\t\t}\n\t\t\treturn null;\n\t\t} elseif ($this->isInsertQuery())\n\t\t{\n\t\t\treturn $this->database->getConnection()->lastInsertId();\n\t\t}\n\t\treturn true;\n\t}", "public function addSelectTableColumns (Doctrine_Query $q)\n {\n $q->addSelect(\"{$q->getRootAlias()}.*\");\n\n return $this;\n }", "public function merge(Q $q) {\n foreach($parts = $q->getPart() as $part=>$info) {\n if (!empty($info)) {\n if (is_array($info) && (count($info) == 1) && array_key_exists(0, $info)) {\n $info = $info[0];\n }\n $this->addPart($part, $info);\n }\n }\n $this->where($q->getCriteria());\n return $this;\n }", "protected function _reset_select()\r\n\t{\r\n\t\t$this->_reset_run(array(\r\n\t\t\t'qb_select'\t\t=> array(),\r\n\t\t\t'qb_from'\t\t=> array(),\r\n\t\t\t'qb_join'\t\t=> array(),\r\n\t\t\t'qb_where'\t\t=> array(),\r\n\t\t\t'qb_groupby'\t\t=> array(),\r\n\t\t\t'qb_having'\t\t=> array(),\r\n\t\t\t'qb_orderby'\t\t=> array(),\r\n\t\t\t'qb_aliased_tables'\t=> array(),\r\n\t\t\t'qb_no_escape'\t\t=> array(),\r\n\t\t\t'qb_distinct'\t\t=> FALSE,\r\n\t\t\t'qb_limit'\t\t=> FALSE,\r\n\t\t\t'qb_offset'\t\t=> FALSE,\r\n 'qb_lock_in_share_mode' => FALSE,\r\n 'qb_for_update' => FALSE\r\n\t\t));\r\n\t}", "public function override( $options ){\n\t\tif ( isset($options['select']) ){\n\t\t\tif ( $options['select'] )\n\t\t\t\t$this->select = new Query\\Select( $options['select'] );\n\t\t\telse\n\t\t\t\t$this->select = new Query\\Select( '*' );\n\t\t}\n\n\t\tif ( isset($options['from']) ){\n\t\t\tif ( $options['from'] )\n\t\t\t\t$this->from = new Query\\From( $options['from'] );\n\t\t\telse\n\t\t\t\t$this->from = false;\n\t\t}\n\n\t\tif ( isset($options['where']) ){\n\t\t\tif ( $options['where'] )\n\t\t\t\t$this->where = new Query\\Where( $options['where'] );\n\t\t\telse\n\t\t\t\t$this->where = false;\n\t\t}\n\n\t\tif ( isset($options['limit']) ){\n\t\t\tif ( $options['limit'] )\n\t\t\t\t$this->limit = $options['limit'];\n\t\t\telse\n\t\t\t\t$this->limit = false;\n\t\t}\n\n\t\tif ( isset($options['order by']) ){\n\t\t\tif ( $options['order by'] )\n\t\t\t\t$this->orderBy = $options['order by'];\n\t\t\telse\n\t\t\t\t$this->orderBy = false;\n\t\t}\n\t\t\n\t\tif ( isset($options['group by']) ){\n\t\t\tif ( $options['group by'] )\n\t\t\t\t$this->groupBy = $options['group by'];\n\t\t\telse\n\t\t\t\t$this->groupBy = false;\n\t\t}\n\t}", "public function append(QueryResponse $other) {\n $this->errs = array_merge($errs, $other->errs);\n $this->didSucceed = ($this->didSucceed && $other->didSucceed);\n return $this;\n }", "protected function _reset_select()\n\t{\n\t\t$this->_reset_run(array(\n\t\t\t'qb_select'\t\t=> array(),\n\t\t\t'qb_from'\t\t=> array(),\n\t\t\t'qb_join'\t\t=> array(),\n\t\t\t'qb_where'\t\t=> array(),\n\t\t\t'qb_groupby'\t\t=> array(),\n\t\t\t'qb_having'\t\t=> array(),\n\t\t\t'qb_orderby'\t\t=> array(),\n\t\t\t'qb_aliased_tables'\t=> array(),\n\t\t\t'qb_no_escape'\t\t=> array(),\n\t\t\t'qb_distinct'\t\t=> FALSE,\n\t\t\t'qb_limit'\t\t=> FALSE,\n\t\t\t'qb_offset'\t\t=> FALSE\n\t\t));\n\t}", "public function build()\n\t{\n\t\t$this->clearString();\n\n\t\tswitch($this->type)\n\t\t{\n\t\t\tcase 'select':\n\t\t\t\t$this->buildSelect();\n\t\t\tbreak;\n\n\t\t\tcase 'insert':\n\t\t\t\t$this->buildInsert();\n\t\t\tbreak;\n\n\t\t\tcase 'update':\n\t\t\t\t$this->buildUpdate();\n\t\t\tbreak;\n\n\t\t\tcase 'delete':\n\t\t\t\t$this->buildDelete();\n\t\t\tbreak;\n\n\t\t\tcase 'truncate':\n\t\t\t\t$this->buildTruncate();\n\t\t\tbreak;\n\n\t\t\tcase 'drop':\n\t\t\t\t$this->buildDrop();\n\t\t\tbreak;\n\t\t}\n\n\t\t// Append ending semicolon\n\t\t$this->queryString .= \";\";\n\n\t\treturn $this;\n\t}", "public function newSelect()\n {\n return $this->newInstance('Select');\n }", "public function __toString()\n\t{\n\t\t// Initialize variables.\n\t\t$query = '';\n\n\t\t// Add the SELECT and FROM clauses.\n\t\t$query .= 'SELECT '.implode(',', $this->_select);\n\t\t$query .= \"\\nFROM \".implode(',', $this->_from);\n\n\t\t// Special case for JOIN clauses.\n\t\tif ($this->_join) {\n\t\t\t$query .= \"\\n\".implode(\"\\n\", $this->_join);\n\t\t}\n\n\t\t// Add the WHERE clause if it exists.\n\t\tif ($this->_where) {\n\t\t\t$query .= \"\\nWHERE \".$this->_where;\n\t\t}\n\n\t\t// Add the optional GROUP BY and HAVING clauses if they exist.\n\t\tif ($this->_group) {\n\t\t\t$query .= \"\\nGROUP BY \".implode(',', $this->_group);\n\t\t}\n\t\tif ($this->_having) {\n\t\t\t$query .= \"\\nHAVING \".implode(',', $this->_having);\n\t\t}\n\n\t\t// Add any UNION queries.\n\t\tforeach ($this->_union as $union)\n\t\t{\n\t\t\t$query .= \"\\nUNION\".((!$union->unionDistinct) ? ' ALL' : '');\n\t\t\t$query .= \"\\n\".$union;\n\t\t}\n\n\t\t// Add the optional ORDER BY clause if it exists.\n\t\tif ($this->_order) {\n\t\t\t$query .= \"\\nORDER BY \".implode(',', $this->_order);\n\t\t}\n\n\t\treturn $query;\n\t}", "public function subquery() {\r\n\t\t$args = func_get_args();\r\n\t\t$name = array_shift($args);\r\n\t\t$model = array_shift($args);\r\n\t\t$statement = array_shift($args);\r\n\t\t$this->_subqueries[] = array(\r\n\t\t\t'name' => $name,\r\n\t\t\t'model' => $model,\r\n\t\t\t'statement' => $statement,\r\n\t\t\t'args' => $args\r\n\t\t);\r\n\t}", "public function addSelect($fields)\n {\n if (func_num_args() > 1) {\n $fields = func_get_args();\n } elseif (!is_array($fields)) {\n $fields = [$fields];\n }\n foreach ($fields as $idx => $field) {\n $this->selectField($field, is_numeric($idx) ? null : $idx);\n }\n\n return $this;\n }", "public function select($select = null)\n {\n $this->_type = self::SELECT;\n\n if (empty($select)) {\n return $this;\n }\n\n $selects = is_array($select) ? $select : func_get_args();\n\n return $this->add('select', $selects, false);\n }", "protected function compileUnion(array $union)\n {\n $conduction = $union['all'] ? ' union all ' : ' union ';\n\n return $conduction . '(' . $union['query']->toSql() . ')';\n }", "public function fromSelectQuery(\\Yana\\Db\\Queries\\IsSelectQuery $query): string;", "function set_select_type($type) {\n\t\t\t$allowed = array (MYSQLI_NUM, MYSQLI_BOTH, MYSQLI_ASSOC);\n\t\t\tif (in_array($type, $allowed)) {\n\t\t\t\t$this->SELECT_TYPE = $type;\n\t\t\t}\n\t\t\treturn $this->SELECT_TYPE;\n\t\t}", "public function rawSelect($query)\r\n\t{\r\n\t\t$this->model = $this->model->select($query);\r\n\t\treturn $this;\r\n\t}", "public function newQuery()\n {\n $query = parent::newQuery();\n\n if ($this->usesTimestamps()) {\n $table = $this->getTable();\n $columns = ['*'];\n foreach ($this->getDates() as $dateColumn) {\n $columns[] = DB::raw(\"CONCAT($table.$dateColumn) AS $dateColumn\");\n }\n $query->addSelect($columns);\n }\n\n return $query;\n }" ]
[ "0.69111943", "0.6452777", "0.6250641", "0.60823727", "0.5732522", "0.56662065", "0.5457898", "0.5451955", "0.5384053", "0.53327525", "0.52996564", "0.52422047", "0.52264607", "0.51364875", "0.50841165", "0.50020045", "0.5000878", "0.49943078", "0.4994071", "0.49846807", "0.4879333", "0.48514012", "0.48355117", "0.4791701", "0.47897965", "0.47812593", "0.47610566", "0.47323793", "0.47256765", "0.47038496", "0.47019234", "0.4691871", "0.46578175", "0.4645305", "0.46432927", "0.46364903", "0.46304092", "0.46201566", "0.46141303", "0.46097785", "0.46066505", "0.45932025", "0.45919746", "0.45801082", "0.45759594", "0.45249438", "0.4520234", "0.4515115", "0.45027614", "0.44778737", "0.44735372", "0.44577563", "0.4446957", "0.44343305", "0.44130725", "0.44115084", "0.4405778", "0.43892902", "0.43788585", "0.43714967", "0.43679696", "0.43524376", "0.43511063", "0.43425965", "0.4340665", "0.43328258", "0.43197116", "0.4316328", "0.43129212", "0.43123415", "0.4308235", "0.4306193", "0.43012053", "0.43011358", "0.42931923", "0.4287237", "0.4279932", "0.42780235", "0.42751434", "0.4260111", "0.42592993", "0.42590654", "0.4255986", "0.4254642", "0.42454177", "0.42436492", "0.42417124", "0.4241497", "0.42370117", "0.4233123", "0.42281196", "0.42270258", "0.42246112", "0.4216215", "0.42123756", "0.42089865", "0.4206425", "0.41927186", "0.41911176", "0.41886798" ]
0.7199377
0
Groups the result set by the specified field.
public function groupBy($field);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function groupby($field)\n\t\t{\n\t\t\t$this->groupby[] = $field;\n\t\t\treturn $this;\n\t\t}", "public function groupBy($field)\n {\n $this->groupBy = $field;\n return $this;\n }", "public function groupBy($field): QueryBuilderInterface\n\t{\n\t\tif ( ! is_scalar($field))\n\t\t{\n\t\t\t$newGroupArray = array_map([$this->driver, 'quoteIdent'], $field);\n\t\t\t$this->state->setGroupArray(\n\t\t\t\tarray_merge($this->state->getGroupArray(), $newGroupArray)\n\t\t\t);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->state->appendGroupArray($this->driver->quoteIdent($field));\n\t\t}\n\n\t\t$this->state->setGroupString(' GROUP BY ' . implode(',', $this->state->getGroupArray()));\n\n\t\treturn $this;\n\t}", "function get_group_by($field, $match = null)\n\t{\n\t\treturn get_instance()->kbcore->groups->get_by($field, $match);\n\t}", "public function addGroupBy($field)\n\t{\n\t\tparent::addGroupBy($field);\n\t\treturn $this;\n\t}", "public function getGroupsByField($field,$value){\n\t\t$query = \"SELECT * FROM people_group WHERE $field = '$value'\";\n\t\t$result = $this->mysqli->query($query);\n\t\t$data = FALSE;\n\t\twhile ($row = $result->fetch_assoc()) {\n\t\t\t$data [] = array(\n\t\t\t\t'id' => $row['id'], \n\t\t\t\t'person_id' => $row['person_id'], \n\t\t\t\t'group_name' => $row['group_name'], \n\t\t\t);\n\t\t}\n\n\t\treturn $data;\n\n\t}", "public function group($field)\n {\n if (empty($field)) {\n $this->group_str = '';\n return $this;\n }\n if (is_array($field)) {\n $output = array();\n foreach ($field as $item) {\n $output[] = \"`{$item}`\";\n }\n $field = implode(', ', $field);\n }\n else {\n $field = $this->escapeString($field);\n }\n $this->group_str = $field;\n return $this;\n }", "public function getGroupByFieldResultItems()\n {\n return $this->group_by_field_result_items;\n }", "public function groupBy(array $fields, $order = null);", "#[@arg(position= 0)]\n public function setField($field= 'bz_id') {\n $this->criteria= create(new Criteria())\n ->setProjection(Projections::projectionList(array(\n Projections::property(Person::column($field)), \n Projections::count()\n )))\n ->addGroupBy($field)\n ;\n }", "public function groupBy($fields, $overwrite = false);", "function get_groups($field = null, $match = null, $limit = 0, $offset = 0)\n\t{\n\t\treturn get_instance()->kbcore->groups->get_many($field, $match, $limit, $offset);\n\t}", "protected function getGroupFilterFieldDef($reportDef, $field)\n {\n $pos = strrpos($field, ':');\n if ($pos !== false) {\n $field_name = substr($field, $pos + 1);\n $table_key = substr($field, 0, $pos);\n } else {\n $table_key = 'self';\n $field_name = $field;\n }\n if (is_array($reportDef['group_defs'])) {\n $report = null;\n foreach ($reportDef['group_defs'] as $groupColumn) {\n if ($groupColumn['table_key'] === $table_key && $groupColumn['name'] === $field_name) {\n if (empty($groupColumn['type'])) {\n if (!$report) {\n $report = new Report($reportDef);\n }\n if (!empty($report->full_bean_list[$table_key])) {\n $bean = $report->full_bean_list[$table_key];\n $fieldDef = $bean->getFieldDefinition($field_name);\n if (!empty($fieldDef['type'])) {\n $groupColumn['type'] = $fieldDef['type'];\n }\n }\n }\n return $groupColumn;\n }\n }\n }\n return false;\n }", "public function &getGroupBy();", "function restore_group_by($field, $match = null)\n\t{\n\t\treturn get_instance()->kbcore->groups->restore_by($field, $match);\n\t}", "public function groupBy($fieldOrExpr) {\r\n\t\t$absoluteField = $this->resolveFieldName(ClauseType::GROUP, $fieldOrExpr);\r\n\t\t$this->_salt_groups[]=$absoluteField;\r\n\t}", "function scan_field_groups()\n {\n }", "function get_grouping_fields() {\n //field that is used to compare one record from the next\n $compare_field = sql_concat('user.lastname', \"'_'\", 'user.firstname', \"'_'\", 'user.id');\n\n //field used to order for groupings\n $order_field = sql_concat('lastname', \"'_'\", 'firstname', \"'_'\", 'userid');\n\n $cluster_label = get_string('grouping_cluster', 'rlreport_course_completion_by_cluster');\n $cluster_grouping = new table_report_grouping('cluster', 'cluster.id', $cluster_label, 'ASC',\n array('cluster.name'), 'above', 'path');\n \n $user_grouping_fields = array(\n 'user.idnumber AS useridnumber', 'user.firstname');\n $user_grouping = new table_report_grouping('groupuseridnumber', $compare_field, '', 'ASC', \n $user_grouping_fields, 'below', $order_field);\n\n //these groupings will always be used\n $result = array(\n $cluster_grouping, $user_grouping);\n\n //determine whether or not we should use the curriculum grouping\n $preferences = php_report_filtering_get_active_filter_values($this->get_report_shortname(),\n 'columns'.'_curriculum', $this->filter);\n\n $show_curriculum = true;\n if (isset($preferences['0']['value'])) {\n $show_curriculum = $preferences['0']['value'];\n }\n\n if ($show_curriculum) {\n $curriculum_label = get_string('grouping_curriculum', 'rlreport_course_completion_by_cluster');\n $result[] = new table_report_grouping('groupcurriculumid', 'curriculum.id', $curriculum_label, 'ASC', array(),\n 'below', 'curriculumname, curriculumid');\n }\n\n return $result;\n }", "public function groupBy($field, $escape = null)\n {\n is_bool($escape) || $escape = $this->conn->protectIdentifiers;\n\n if (is_string($field)) {\n $field = ($escape === true)\n ? explode(',', $field)\n : [$field];\n }\n\n foreach ($field as $fieldName) {\n $fieldName = trim($fieldName);\n\n if ($fieldName !== '') {\n $fieldName = ['field' => $fieldName, 'escape' => $escape];\n\n $this->builderCache->groupBy[] = $fieldName;\n }\n }\n\n return $this;\n }", "public static function groupBy($list, $fieldName, $article_grouping_direction, $fieldNameToKeep = null)\n\t{\n\t\t$grouped = array();\n\n\t\tif (!is_array($list))\n\t\t{\n\t\t\tif ($list == '')\n\t\t\t{\n\t\t\t\treturn $grouped;\n\t\t\t}\n\n\t\t\t$list = array($list);\n\t\t}\n\n\t\tforeach ($list as $key => $item)\n\t\t{\n\t\t\tif (!isset($grouped[$item->$fieldName]))\n\t\t\t{\n\t\t\t\t$grouped[$item->$fieldName] = array();\n\t\t\t}\n\n\t\t\tif (is_null($fieldNameToKeep))\n\t\t\t{\n\t\t\t\t$grouped[$item->$fieldName][$key] = $item;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$grouped[$item->$fieldName][$key] = $item->$fieldNameToKeep;\n\t\t\t}\n\n\t\t\tunset($list[$key]);\n\t\t}\n\n\t\t$article_grouping_direction($grouped);\n\n\t\treturn $grouped;\n\t}", "public function groupBy($sql);", "public function Group($field,$group){\n $this->_groups[$field] = array_merge($group,array(\"currentGroup\" => \"?\", \"currentMsg\" => \"\"));\n }", "public function group($column)\n {\n // Make column name safe\n $column = $this->san($column);\n \n // GROUP BY .. \n $this->query .= 'GROUP BY ' . $column . ' ';\n \n // Return a ref. to this object for chainability\n return $this;\n }", "public function sum($field) {\n return $this->getRepository()->aggregate($this, __FUNCTION__, $field);\n }", "function ydgdict_group_search_results_by_entry( $groupby, $wp_query ) \n{\n if ( ! $wp_query->is_archive( 'entry' ) || ! $wp_query->is_search() || is_admin() ) return $groupby; // unchanged\n\n global $wpdb;\n\n return \" {$wpdb->posts}.ID \";\n}", "public function groupBy($field, $asc = true)\n {\n if ($asc) {\n $this->groupBy[] = \" $this->alias.$field ASC\";\n } else {\n $this->groupBy[] = \" $this->alias.$field DESC\";\n }\n \n return $this;\n }", "function acf_prepare_field_group_for_export($field_group = array())\n{\n}", "public function groupBy($property)\n {\n $this->group[] = $this->dbFieldName($property);\n }", "public function statisticItineraryBy($field) {\n $q = \"SELECT DATE_FORMAT(created_at,'%Y-%m') as month, COUNT(DATE_FORMAT(created_at,'%Y-%m')) as number \n FROM itinerary GROUP BY DATE_FORMAT(created_at,'%Y-%m')\";\n \n $stmt = $this->conn->prepare($q);\n //$stmt->bind_param(\"i\",$customer_id);\n $stmt->execute();\n $results = $stmt->get_result();\n\n $stats = array();\n // looping through result and preparing tasks array\n while ($stat = $results->fetch_assoc()) {\n $tmp = array();\n\n $tmp[\"month\"] = $stat[\"month\"];\n $tmp[\"number\"] = $stat[\"number\"];\n\n array_push($stats, $tmp);\n }\n\n $stmt->close();\n return $stats;\n }", "function acf_get_field_groups($filter = array())\n{\n}", "private function groupBy() {\n $this->sql .= 'GROUP BY inv_agent_id ';\n }", "public function setGroupByFieldResultItems($var)\n {\n $arr = GPBUtil::checkRepeatedField($var, \\Google\\Protobuf\\Internal\\GPBType::MESSAGE, \\Aliyun\\OTS\\ProtoBuffer\\Protocol\\GroupByFieldResultItem::class);\n $this->group_by_field_result_items = $arr;\n $this->has_group_by_field_result_items = true;\n\n return $this;\n }", "function acf_get_raw_field_groups()\n{\n}", "function remove_group_by($field, $match = null)\n\t{\n\t\treturn get_instance()->kbcore->groups->remove_by($field, $match);\n\t}", "public function getQueryGroupby() {\n $R = 'R_'. $this->id;\n return \"$R.value_id\";\n }", "public function getGrouping()\n {\n return $this->result->getGrouping();\n }", "private function sql_groupBy()\n {\n // Get WHERE statement\n $groupBy = $this->curr_tableField;\n\n // RETURN GROUP BY statement without GROUP BY\n return $groupBy;\n }", "abstract protected function _buildGroupBy( $group );", "public function group_by ( $mFields )\n {\n /*\n Convert from comma separated list to array.\n */\n if (!is_array($mFields))\n {\n $mFields = explode(',', str_replace(', ', ',', $mFields));\n }\n /*\n Save.\n */\n $this->aGroupBy = array_merge($this->aGroupBy, $mFields);\n /*\n Return for method chaining.\n */\n return $this;\n }", "public function groupCallback($group, $mode, $field, $objModelRow);", "public function getGroupByResults()\n {\n return $this->group_by_results;\n }", "public function groupBy($callback);", "public function get_all_items($field) {\n return $field->find_sqlarray( \n array(\"where\" => array(\n \"arraygroup\" => \"items\"\n ))\n );\n }", "public function relationExtendRefreshResults($field)\n {\n }", "function acf_get_raw_field_group($id = 0)\n{\n}", "function acf_get_field_group($id = 0)\n{\n}", "function acf_get_grouped_field_types()\n{\n}", "public function get_array_of($result, $field ){\n\t\t\t$arr = array();\n\t\t\tif(is_array($field)) {\n\t\t\t\twhile($row = mysql_fetch_array($result)){\n\t\t\t\t\t$temp_arr = array();\n\t\t\t\t\tforeach($field as $temp_field){\n\t\t\t\t\t\t//array_push($temp_arr, $row[$temp_field]);\n\t\t\t\t\t\t$temp_arr[$temp_field] = $row[$temp_field];\n\t\t\t\t\t}\n\t\t\t\t\tarray_push($arr, $temp_arr);\n\t\t\t\t}\n\t\t\t\treturn $arr;\n\t\t\t}else {\n\t\t\t\twhile($row = mysql_fetch_array($result)){\n\t\t\t\t\tarray_push($arr, $row[$field]);\n\t\t\t\t}\n\t\t\t\treturn $arr;\n\t\t\t}\n\t\t}", "function groupBy($column) {\n if(!is_array($column)) {\n $column = array($column);\n }\n foreach ($column as $value) {\n $this->group_by .= ', `'.str_replace('.', '`.`', $value).'`';\n }\n $this->group_by = trim($this->group_by, ', ');\n return $this;\n }", "public function statisticMoneyBy($field) {\n $q = \"SELECT DATE_FORMAT(created_at,'%Y-%m') as month, SUM(cost) as total_money \n FROM itinerary GROUP BY DATE_FORMAT(created_at,'%Y-%m')\";\n \n $stmt = $this->conn->prepare($q);\n //$stmt->bind_param(\"i\",$customer_id);\n $stmt->execute();\n $results = $stmt->get_result();\n\n $stats = array();\n // looping through result and preparing tasks array\n while ($stat = $results->fetch_assoc()) {\n $tmp = array();\n\n $tmp[\"month\"] = $stat[\"month\"];\n $tmp[\"total_money\"] = $stat[\"total_money\"];\n\n array_push($stats, $tmp);\n }\n\n $stmt->close();\n return $stats;\n }", "public function visitGroupClause(\n /*IGroupClause*/ $node) /*: mixed*/ {\n $collection = /*(string)*/$node->getCollection()->accept($this);\n $key = /*(string)*/$node->getKey()->accept($this);\n\n return 'group '.$collection.' by '.$key;\n }", "public function statisticUserBy($field) {\n $q = \"SELECT DATE_FORMAT(created_at,'%Y-%m') as month, COUNT(DATE_FORMAT(created_at,'%Y-%m')) as number \n FROM user GROUP BY DATE_FORMAT(created_at,'%Y-%m')\";\n \n $stmt = $this->conn->prepare($q);\n //$stmt->bind_param(\"i\",$customer_id);\n $stmt->execute();\n $results = $stmt->get_result();\n\n $stats = array();\n // looping through result and preparing tasks array\n while ($stat = $results->fetch_assoc()) {\n $tmp = array();\n\n $tmp[\"month\"] = $stat[\"month\"];\n $tmp[\"number\"] = $stat[\"number\"];\n\n array_push($stats, $tmp);\n }\n\n $stmt->close();\n return $stats;\n }", "public function getGroupByPage() {}", "public function group($str) \n {\n $this->_data['group'] = $str;\n $this->_data['query'] .= ' GROUP BY '.$str;\n return $this;\n }", "protected function getGroupByAttribute()\n {\n return $this->fetchData[self::GROUP_CLAUSE];\n }", "function getByField ( $field,$value){\n\t\t $result=$this->fetchRow(\"$field= '$value' \"); //order by id?\n\t\t if($result==null)\n\t\t\t return;\n\t\t if(is_array($result))\n\t\t\t return $result[0];\n\t\t return $result;\n\t}", "function acf_get_field_groups( $filter = array() ) {\n\treturn acf_get_internal_post_type_posts( 'acf-field-group', $filter );\n}", "public function get_group_by()\n\t{\n\t\treturn NULL;\n\t}", "function acf_write_json_field_group($field_group)\n{\n}", "function delete_group_by($field, $match = null)\n\t{\n\t\treturn get_instance()->kbcore->groups->delete_by($field, $match);\n\t}", "public static function groupJoinResults(&$parentData, $childData, $childField, $pkColumn, $fkColumn)\n\t{\n\t\tif(!$parentData || !$childData) return $parentData;\n\t\t$childData = arrayGroupBy($childData, $fkColumn);\n\t\tforeach ($parentData as $key => &$parent)\n\t\t{\n\t\t\t$parentId = $parent[$pkColumn];\n\t\t\tif(isset($childData[$parentId]))\n\t\t\t\t$parent[$childField] = $childData[$parentId];\n\t\t}\n\t\treturn $parentData;\n\t}", "function getResult($limit, $idField, $dateField = null);", "function acf_prepare_field_group_for_export( $field_group = array() ) {\n\treturn acf_prepare_internal_post_type_for_export( $field_group, 'acf-field-group' );\n}", "public function get_records_by_group($table, $groupKeyName, $groupID, $orderKeyName = '', $order = 'ASC', $fields = '*',$limit=10){\n $orderSql = ' LIMIT $limit';\n if($orderKeyName != '') $orderSql = \" ORDER BY $orderKeyName $order LIMIT $limit\";\n $sql = \"SELECT * FROM $table WHERE $groupKeyName = '$groupID'\" . $orderSql;\n $result = mysql_query($sql);\n while($row = mysql_fetch_assoc($result)) {\n\n $records[] = $row;\n\n }\n return $records;\n }", "protected function setGroup() {\r\n //var_dump($this->sql);\r\n if( $this->sqlGroupBy ) {\r\n var_dump($this->sql);\r\n $this->sql .= ' GROUP BY ' . $this->sqlGroupBy;\r\n }\r\n //var_dump($this->sql);\r\n }", "function Field() {\n\t\t$fs = $this->FieldSet();\n \t$spaceZebra = isset($this->zebra) ? \" $this->zebra\" : '';\n \t$idAtt = isset($this->id) ? \" id=\\\"{$this->id}\\\"\" : '';\n\t\t$content = \"<div class=\\\"fieldgroup$spaceZebra\\\"$idAtt>\";\n\t\tforeach($fs as $subfield) {\n\t\t\t$childZebra = (!isset($childZebra) || $childZebra == \"odd\") ? \"even\" : \"odd\";\n\t\t\tif($subfield->hasMethod('setZebra')) $subfield->setZebra($childZebra);\n\t\t\t$content .= \"<div class=\\\"fieldgroupField\\\">\" . $subfield->{$this->subfieldParam}() . \"</div>\";\n\t\t}\n\t\t$content .= \"</div>\";\n\t\treturn $content;\n\t}", "private function _groupFieldCountries()\n {\n $this->_fieldCountries = [];\n foreach ($this->_addAccountfields as $country => $fields) {\n foreach ($fields as $field) {\n $this->_fieldCountries[$field][] = str_replace(\" \", \"-\", strtolower($country));\n }\n }\n return $this->_fieldCountries;\n }", "protected function showGroup(Field $field) {\n $stub = $this->stub('partials.show-group');\n\n $this\n ->replace($stub, 'FieldLabel', $field->label())\n ->replace($stub, 'FieldName', $field->name())\n ;\n\n return $stub;\n }", "public function groupBy() {\n $fields = func_get_args();\n\n if (is_array($fields[0])) {\n $fields = $fields[0];\n }\n\n $this->_groupBy = array_unique(array_merge($this->_groupBy, $fields));\n\n return $this;\n }", "function restore_groups($field, $match = null)\n\t{\n\t\treturn get_instance()->kbcore->groups->restore_by($field, $match);\n\t}", "public function groupBy($group=null)\n {\n $group = LambdaUtils::toSelectCallable($group);\n\n $result = new ObjectArray(array());\n if($this instanceof ObjectArray)\n {\n $result = $this->newInstance();\n }\n\n foreach($this as $record)\n {\n $key = call_user_func($group, $record);\n\n $data = array();\n if($this->__converter instanceof IListConverter)\n {\n $data = $this->newConverterInstance();\n }\n $newitemtype = new ArrayList($data);\n\n $result->get($key, $newitemtype, true)->add($record);\n }\n\n return $result;\n }", "public function testGroupByBaseField() {\n $this->setupTestEntities();\n\n $view = Views::getView('test_group_by_count');\n $view->setDisplay();\n // This tests that the GROUP BY portion of the query is properly formatted\n // to include the base table to avoid ambiguous field errors.\n $view->displayHandlers->get('default')->options['fields']['name']['group_type'] = 'min';\n unset($view->displayHandlers->get('default')->options['fields']['id']['group_type']);\n $this->executeView($view);\n $this->assertStringContainsString('GROUP BY entity_test.id', (string) $view->build_info['query'], 'GROUP BY field includes the base table name when grouping on the base field.');\n }", "function acf_get_local_field_group($key = '')\n{\n}", "public function avg($field) {\n return $this->getRepository()->aggregate($this, __FUNCTION__, $field);\n }", "public function get($field = null)\n\t{\n\t\t// make sure a group id is set\n\t\tif (empty($this->group['id']))\n\t\t{\n\t\t\tthrow new SentryGroupException(__('sentry::sentry.no_group_selected'));\n\t\t}\n\n\t\t// if no fields were passed - return entire user\n\t\tif ($field === null)\n\t\t{\n\t\t\treturn $this->group;\n\t\t}\n\t\t// if field is an array - return requested fields\n\t\telse if (is_array($field))\n\t\t{\n\t\t\t$values = array();\n\n\t\t\t// loop through requested fields\n\t\t\tforeach ($field as $key)\n\t\t\t{\n\t\t\t\t// check to see if field exists in group\n\t\t\t\tif (array_key_exists($key, $this->group))\n\t\t\t\t{\n\t\t\t\t\t$values[$key] = $this->group[$key];\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthrow new SentryGroupException(\n\t\t\t\t\t\t__('sentry::sentry.not_found_in_group_object', array('field' => $key))\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn $values;\n\t\t}\n\t\t// if single field was passed - return its value\n\t\telse\n\t\t{\n\t\t\t// check to see if field exists in group\n\t\t\tif (array_key_exists($field, $this->group))\n\t\t\t{\n\t\t\t\treturn $this->group[$field];\n\t\t\t}\n\n\t\t\tthrow new SentryGroupException(\n\t\t\t\t__('sentry::sentry.not_found_in_group_object', array('field' => $field))\n\t\t\t);\n\t\t}\n\t}", "public function groupBy(callable $function);", "protected abstract function getGroupByClause(array $grouping);", "public function testGroupByWithFieldsNotExistingOnBundle() {\n $field_storage = FieldStorageConfig::create([\n 'type' => 'integer',\n 'field_name' => 'field_test',\n 'cardinality' => 4,\n 'entity_type' => 'entity_test_mul',\n ]);\n $field_storage->save();\n $field = FieldConfig::create([\n 'field_name' => 'field_test',\n 'entity_type' => 'entity_test_mul',\n 'bundle' => 'entity_test_mul',\n ]);\n $field->save();\n\n $entities = [];\n $entity = EntityTestMul::create([\n 'field_test' => [1],\n 'type' => 'entity_test_mul',\n ]);\n $entity->save();\n $entities[] = $entity;\n\n $entity = EntityTestMul::create([\n 'type' => 'entity_test_mul2',\n ]);\n $entity->save();\n $entities[] = $entity;\n\n $view = Views::getView('test_group_by_field_not_within_bundle');\n $this->executeView($view);\n\n $this->assertCount(2, $view->result);\n // The first result is coming from entity_test_mul2, so no field could be\n // rendered.\n $this->assertEquals('', $view->getStyle()->getField(0, 'field_test'));\n // The second result is coming from entity_test_mul, so its field value\n // could be rendered.\n $this->assertEquals('1', $view->getStyle()->getField(1, 'field_test'));\n }", "public function sum($field)\n {\n return $this->withMeta(['sum' => $field]);\n }", "function acf_get_local_field_groups()\n{\n}", "function _field_grouped_fieldset ($fval) {\n\n $res = '';\n $setName = $this->name;\n\n // how many sets to show to begin w/?\n if (!empty($fval) and is_array($fval))\n $numsets = count($fval);\n\t\telse\n\t\t\t$numsets = (isset($this->attribs['numsets']))? $this->attribs['numsets'] : 1;\n\n $hiddens = '';\n $res .= \"<div id=\\\"proto_{$setName}\\\" data-numsets=\\\"{$numsets}\\\" data-setname=\\\"{$setName}\\\" class=\\\"formex_group\\\" style=\\\"display: none; margin:0; padding: 0\\\">\n <fieldset class=\\\"formex_grouped_fieldset {$this->element_class}\\\"><ul>\";\n\t\t\t\t\t\n\n foreach ($this->opts as $name => $parms) {\n\t\t\t$newelem = new formex_field($this->fex, $name, $parms);\n\n\t\t\t$res .= '<li>';\n\t\t\tif ($newelem->type != 'hidden') {\n\t\t\t\t$res .= $this->fex->field_label($newelem);\n\t\t\t\t$res .= $newelem->get_html('');\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$hiddens = $newelem->get_html('');\n\t\t\t}\n\t\t\t$res .= '</li>';\n }\n\n $res .= \"</ul>$hiddens</fieldset></div>\";\n\n $labelclass = (!empty($this->attribs['enable_showhide']))? 'enable_showhide' : '';\n\n /* \"+\" and \"-\" controls for adding and removing sets */\n $res .= \"<span id=\\\"fieldsetControl$setName\\\" data-setname=\\\"$setName\\\" class=\\\"controls {$this->element_class}\\\">\";\n\t\t$res .= \"<label class=\\\"$labelclass\\\">{$this->descrip}</label>\";\n\t\t$res .= '<a href=\"#\" class=\"add\">+</a> <a href=\"#\" class=\"sub\">&ndash;</a></span>';\n\n\t\t$res .= \"<script type=\\\"text/javascript\\\">\n\t\t\t\t\t\tvar formex_groupvalues = formex_groupvalues || [];\n\t\t\t\t\t\tformex_groupvalues['{$setName}'] = \".json_encode($fval).\";\n\t\t\t\t</script>\";\n return $res;\n }", "public function select($field);", "public function isGroup($fieldName) {\n\t\t$type = $this->getFieldType($fieldName);\n\t\treturn $type === 'group';\n\t}", "function nkf_base_rows_from_field_collection(&$vars, $field_array) {\n $vars['rows'] = array();\n foreach($vars['element']['#items'] as $key => $item) {\n $entity_id = $item['value'];\n $entity = field_collection_item_load($entity_id);\n $wrapper = entity_metadata_wrapper('field_collection_item', $entity);\n $row = array();\n foreach($field_array as $field) {\n $info = $wrapper->$field->info();\n $type = $info['type'];\n $field_value = $wrapper->$field->value();\n switch ($type) {\n case 'text_formatted':\n $value = $wrapper->$field->value->value();\n break;\n case 'field_item_image':\n if (isset($field_value)) {\n $build = array(\n '#theme' => 'image',\n '#path' => $field_value['uri'],\n '#url' => nkf_base_image_url($field_value['uri'], 'large'),\n '#alt' => $field_value['alt'],\n '#title' => $field_value['title'],\n //'#width' => $field_value['width'],\n //'#height' => $field_value['height'],\n );\n $value = $build;\n } else {\n $value = null;\n }\n break;\n default:\n $value = isset($field_value) ? $wrapper->$field->value() : null;\n\n }\n $row[$field] = $value;\n }\n $vars['rows'][] = $row;\n }\n}", "public function groupBy($column)\n\t{\n\t\t$this->groupings[] = $column;\n\t\treturn $this;\n\t}", "public function getDataListByField(string $field_name)\n {\n switch ($field_name) {\n case 'PostalCode': return $this -> get_postal_code_list(); break;\n case 'City': return $this -> generate_city_value_list(); break;\n }\n }", "public function field($field) {\n\t array_push($this->parameters['field'], $field);\n\t $this->parameters['field'] = array_unique($this->parameters['field']);\n\t\treturn $this;\n\t}", "function f($field) {\n\t\treturn($this->fetchfield($field));\n\t}", "function prepare_field_for_export($field)\n {\n }", "function sum_records_per_field_grouped_by_account($entries_records, $field_name)\n{\n\n $reports = [];\n\n foreach ($entries_records as $entry => $records) {\n\n $entry_loaded = node_load($entry);\n $entry_loaded_wrapper = entity_metadata_wrapper('node', $entry_loaded);\n\n // Getting the name of the indication or the product.\n $account = $entry_loaded_wrapper->field_account->value();\n\n $indication_or_product = $entry_loaded_wrapper->{$field_name}->value();\n if (isset($indication_or_product->name)) {\n $name = $indication_or_product->name;\n } else {\n $name = $indication_or_product[0]->name;\n }\n if (isset($account->title)) {\n $account_name = $account->title;\n } else {\n $account_name = $account[0]->title;\n }\n // If the indication is not init yet so create new array of monthes for it.\n if (!isset($reports[$account_name])) {\n $reports[$account_name] = [];\n $reports[$account_name][\"consumptions\"] = [];\n $reports[$account_name][\"stocks\"] = [];\n }\n if (!isset($reports[$account_name][\"consumptions\"][$name])) {\n $reports[$account_name][\"consumptions\"][$name] = [];\n $months = [\n 'January', 'February', 'March', 'April', 'May', 'June',\n 'July', 'August', 'September', 'October', 'November', 'December',\n ];\n foreach ($months as $month) {\n $reports[$account_name][\"consumptions\"][$name][$month] = [0];\n $reports[$account_name][\"stocks\"][$name][$month] = [0];\n }\n }\n // accounts:{products:{consumption:{months:[value]}}}.\n $records_loaded = entity_load(\"entry_month_record\", $records);\n\n foreach ($records_loaded as $id => $record) {\n $record_loaded_wrapper = entity_metadata_wrapper('entry_month_record', $record);\n $timestamp = $record_loaded_wrapper->field_entry_date->value();\n $date = getdate($timestamp);\n $month = $date['month'];\n $reports[$account_name][\"stocks\"][$name][$month][0] += $record_loaded_wrapper->field_stocks->value();\n $reports[$account_name][\"consumptions\"][$name][$month][0] += $record_loaded_wrapper->field_consumption->value();\n }\n }\n\n return $reports;\n}", "public static function get_data_by($field, $value)\n {\n }", "function acf_filter_field_groups($field_groups, $args = array())\n{\n}", "public function getGroupingCollections($objType, $fieldName)\r\n\t{\r\n\t\t$ret = array();\r\n\r\n\t\tforeach ($this->collections as $coll)\r\n\t\t{\r\n\t\t\tif ($coll->objectType == $objType && $fieldName == $coll->fieldName)\r\n\t\t\t\t$ret[] = $coll;\r\n\t\t}\r\n\r\n\t\treturn $ret;\r\n\t}", "protected function prepareGroupByPart()\n {\n $this->groupByQuery = 'GROUP BY ';\n $this->groupByQuery .= implode(', ', $this->groupByPart);\n $this->groupByQuery = \" {$this->groupByQuery} \";\n }", "public function groupBy($sql) {\n $this->__groupBy__ = $sql;\n return $this;\n }", "public function fetchOneFieldAll($sql, $fld)\n {\n $res = $this->query($sql);\n for($out = array(); $row = $res->fetch_array($this->fetch_mode); $out[] = $row[$fld]);\n return $out;\n }", "protected function setGrouping(Query $solarium_query, QueryInterface $query, $grouping_options = [], $index_fields = [], $field_names = []) {\n if (!empty($grouping_options['use_grouping'])) {\n\n $group_fields = [];\n\n foreach ($grouping_options['fields'] as $collapse_field) {\n // @todo languages\n $first_name = reset($field_names[$collapse_field]);\n /** @var \\Drupal\\search_api\\Item\\Field $field */\n $field = $index_fields[$collapse_field];\n $type = $field->getType();\n if ($this->dataTypeHelper->isTextType($type) || 's' !== Utility::getSolrFieldCardinality($first_name)) {\n $this->getLogger()->error('Grouping is not supported for field @field. Only single-valued fields not indexed as \"Fulltext\" are supported.',\n ['@field' => $index_fields[$collapse_field]['name']]);\n }\n else {\n $group_fields[] = $first_name;\n }\n }\n\n if (!empty($group_fields)) {\n // Activate grouping on the solarium query.\n $grouping_component = $solarium_query->getGrouping();\n\n $grouping_component->setFields($group_fields)\n // We always want the number of groups returned so that we get pagers\n // done right.\n ->setNumberOfGroups(TRUE)\n ->setTruncate(!empty($grouping_options['truncate']))\n ->setFacet(!empty($grouping_options['group_facet']));\n\n if (!empty($grouping_options['group_limit']) && ($grouping_options['group_limit'] != 1)) {\n $grouping_component->setLimit($grouping_options['group_limit']);\n }\n\n if (!empty($grouping_options['group_sort'])) {\n $sorts = [];\n foreach ($grouping_options['group_sort'] as $group_sort_field => $order) {\n $sorts[] = Utility::getSortableSolrField($group_sort_field, $field_names, $query) . ' ' . strtolower($order);\n }\n\n $grouping_component->setSort(implode(', ', $sorts));\n }\n }\n }\n }", "function groupByHeader(&$conf,$GBCode,$menuRow,&$groupBy,&$lastgroupBy,&$evalGroupBy,$GrpByField,&$lc,&$gc,&$i,&$pagejump,&$sql,$end=false,&$DEBUG,$nbrow) {\n\t\t// group by field handling\n\t\t//if ($end) return;\n\t\t$GBmarkerArray=array();\n\t\t$groupByFields=\"\";\n\t\t$gbflag=0;\n\t\t$newGroupBy=array();\n\t\tif ($conf['list.']['groupByFieldBreaks']) {\n\t\t\t$fNA=t3lib_div::trimexplode(',',$conf['list.']['groupByFieldBreaks']);\n\t\t\tforeach($fNA as $fN) {\n\t\t\t\t$fN2=t3lib_div::trimexplode(':',$fN);\n\t\t\t\t$fN=$fN2[0];\n\t\t\t\t//if ($conf['list.']['hiddenGroupByField.'][$fN]) continue;\n\n\t\t\t\t$GBmarkerArray['###GROUPBY_'.$fN.'###']=\"\";\n\t\t\t\t//error_log(__METHOD__.\": -\".$groupBy[$fN].\"!==\".$this->metafeeditlib->transformGroupByData($fN,$menuRow[$GrpByField[$fN]?$GrpByField[$fN]:$fN],$conf));\n\t\t\t\tif (($groupBy[$fN]!==$this->metafeeditlib->transformGroupByData($fN,$menuRow[$GrpByField[$fN]?$GrpByField[$fN]:$fN],$conf) || $end) && !$conf['list.']['hiddenGroupByField.'][$fN]) {\n\t\t\t\t\t// Group by field change !\n\t\t\t\t\t$GBmarkerArray['###FOOTERSUM_'.$fN.'_FIELD_metafeeditnbelts###']='';\n\t\t\t\t\t//error_log(__METHOD__.\": aa- $nbrow : \".$evalGroupBy[$fN]);\n\t\t\t\t\tif ($nbrow>1) {\n\t\t\t\t\t\t\n\t\t\t\t\t\t$GBmarkerArray['###GROUPBYFOOTER_'.$fN.'###']=$evalGroupBy[$fN]; \n\t\t\t\t\t\t$this->metafeeditlib->getGroupByFooterSums($conf,'FOOTERSUM',$GBmarkerArray,$fN,$sql,$lastgroupBy,$end,$DEBUG);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$GBCode=$this->cObj->substituteSubpart($GBCode, '###GROUPBYFOOTERFIELD_'.$fN.'###','');\n\t\t\t\t\t}\n\t\t\t\t\t$std=$menuRow[$fN];\n\n\t\t\t\t\t// Default we get value from std group by field ...\n\t\t\t\t\tif ($GrpByField[$fN]) {\n\t\t\t\t\t $std=$menuRow[$GrpByField[$fN]];\n\t\t\t\t\t if ($menuRow['EVAL_'.str_replace('.','_',$GrpByField[$fN])]) $std=$menuRow['EVAL_'.str_replace('.','_',$GrpByField[$fN])];\n\t\t\t\t\t}\n\t\t\t\n\t\t\t\t\t// stdWrap on group by.\t\t\n\t\t\t\t\t$_fN=str_replace('.','_',$fN);\n\t\t\t\t\tif ($conf['list.']['groupByFields.']['stdWrap.'][$_fN.'.']) {\n\t\t\t\t\t $this->cObj->start($menuRow,$this->theTable);\n\t\t\t\t\t $std=$this->cObj->stdWrap($std,$conf['list.']['groupByFields.']['stdWrap.'][$_fN.'.']);\n\t\t\t\t\t}\n\t\t\t\n\t\t\t\t\t// ??? \t\n\t\t\t\t\t\n\t\t\t\t\tif ($GrpByField[$fN]) {\n\t\t\t\t\t\t$newGroupBy[$fN]=$menuRow[$GrpByField[$fN]];\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$newGroupBy[$fN]=$menuRow[$fN];\n\t\t\t\t\t\tif ($menuRow['EVAL_'.$_fN]) $std=$menuRow['EVAL_'.$_fN];\n\t\t\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t\t\t// we set group by flag\n\t\t\t\t\t$gbflag=1;\n\t\t\t\t\t$GBmarkerArray['###GROUPBY_'.$fN.'###']=$std;\n\t\t\t\t\t$evalGroupBy[$fN]=$std;\n\t\t\t\t\t// We have to reset all son groupbys so that the headers will be regenerated...\n\t\t\t\t\t$resetgbf=FALSE;\n\t\t\t\t\tif (is_array($groupBy)) foreach ($groupBy as $gbf=>$val) {\n\t\t\t\t\t\tif ( $resetgbf) unset($groupBy[$gbf]);\n\t\t\t\t\t\tif ($gbf==$fN) $resetgbf=TRUE;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// we clear unused group bys \n\t\t\t\t\t$GBCode=$this->cObj->substituteSubpart($GBCode, '###GROUPBYFIELD_'.$fN.'###','');\n\t\t\t\t\t$GBCode=$this->cObj->substituteSubpart($GBCode, '###GROUPBYFOOTERFIELD_'.$fN.'###','');\n\t\t\t\t}\n\t\t\t\t// We clear next group by if end of list is reached\n\t\t\t\tif ($end) $GBCode=$this->cObj->substituteSubpart($GBCode, '###GROUPBYFIELD_'.$fN.'###','');\n\t\t\t}\n\t\t\tforeach($newGroupBy as $fN=>$val) {\n\t\t\t\t$groupBy[$fN]=$this->metafeeditlib->transformGroupByData($fN,$val,$conf);\n\t\t\t\t//$lastgroupBy[$fN]=$menuRow[$GrpByField[$fN]?$GrpByField[$fN]:$fN];\n\t\t\t\t$lastgroupBy[$fN]=$this->metafeeditlib->transformGroupByData($fN,$menuRow[$GrpByField[$fN]?$GrpByField[$fN]:$fN],$conf);\n\t\t\t}\n\t\t}\n\t\tif ($gbflag) {\n\t\t\t$groupByFields=$this->cObj->substituteMarkerArray($GBCode, $GBmarkerArray);\n\t\t\t$gc++;\n\t\t\t// Jump page on group by\n\t\t\tif ($gc>1 && $conf['list.']['jumpPageOnGroupBy']) {\n\t\t\t $pagejump=1;\n\t\t\t}\n\t\t\tif ($conf['list.']['groupBySize']) {\n\t\t\t\t$lc=$lc+$conf['list.']['groupBySize'];\n\t\t\t}\n\t\t\tif ($conf['list.']['no_detail']) $lc++; //MMM\n\n\t\t\tif ($gc>1 && $dispDir=='Right') $lc++;\n\t\t\t$i=0; // pour fin de ligne\n\t\t}\n\t\t//error_log(__METHOD__.\"end: -\".print_r($groupByFields,true)); \n\t\treturn $groupByFields;\n\t}", "private function fetchGroups($academicid, $sortorder = '', $sortfield = '', $limit = 0, $offset = 0) {\n dol_syslog(__METHOD__, LOG_DEBUG);\n\n $sql = 'SELECT';\n $sql .= ' t.rowid,';\n\n $sql .= \" t.ref,\";\n $sql .= \" t.sufix,\";\n $sql .= \" t.label,\";\n $sql .= \" t.fk_academicyear,\";\n $sql .= \" t.grado_code,\";\n $sql .= \" t.tms,\";\n $sql .= \" t.date_create,\";\n $sql .= \" t.statut,\";\n $sql .= \" t.import_key\";\n\n\n $sql .= ' FROM ' . MAIN_DB_PREFIX . 'educo_group as t';\n\n // Manage filter\n\n $sql .= ' WHERE 1 = 1';\n $sql .= \" AND t.fk_academicyear =$academicid\";\n if (!empty($conf->multicompany->enabled)) {\n $sql .= \" AND entity IN (\" . getEntity(\"educogroup\", 1) . \")\";\n }\n\n if (!empty($sortfield)) {\n $sql .= $this->db->order($sortfield, $sortorder);\n }\n if (!empty($limit)) {\n $sql .= ' ' . $this->db->plimit($limit + 1, $offset);\n }\n $lines = array();\n $resql = $this->db->query($sql);\n if ($resql) {\n $num = $this->db->num_rows($resql);\n\n while ($obj = $this->db->fetch_object($resql)) {\n $lines[] = $obj;\n }\n $this->db->free($resql);\n return $lines;\n } else {\n $this->errors[] = 'Error ' . $this->db->lasterror();\n dol_syslog(__METHOD__ . ' ' . implode(',', $this->errors), LOG_ERR);\n\n return - 1;\n }\n }" ]
[ "0.7004244", "0.65770024", "0.6551445", "0.65145576", "0.6369502", "0.63546884", "0.63137305", "0.6152158", "0.608925", "0.59699535", "0.5914712", "0.59047854", "0.58912283", "0.5886462", "0.58660424", "0.5859383", "0.58371377", "0.5814556", "0.5753937", "0.57474047", "0.5683865", "0.56498003", "0.5548986", "0.55430937", "0.5540406", "0.5499217", "0.54698366", "0.5435374", "0.5428134", "0.5410883", "0.5393458", "0.5388015", "0.53849244", "0.5373812", "0.53519404", "0.5332126", "0.5327835", "0.5311201", "0.52747977", "0.52611613", "0.5258003", "0.52423346", "0.5218905", "0.52090466", "0.5192514", "0.5162978", "0.51455355", "0.5117718", "0.51022685", "0.50906473", "0.5089801", "0.5074229", "0.50735843", "0.5067373", "0.5059135", "0.50588524", "0.505542", "0.50542074", "0.504169", "0.50329775", "0.50325537", "0.5028956", "0.5028356", "0.50282747", "0.5017957", "0.49866515", "0.49853766", "0.4982525", "0.4980792", "0.4968537", "0.4964479", "0.49568567", "0.49499524", "0.49499148", "0.49214536", "0.49195015", "0.4913777", "0.49111736", "0.49086016", "0.49001804", "0.48962995", "0.48850378", "0.48754472", "0.487251", "0.48724133", "0.4866551", "0.48584256", "0.4854036", "0.48418415", "0.48368594", "0.4822128", "0.48190594", "0.4816694", "0.48144257", "0.48073325", "0.48060918", "0.47951835", "0.47866514", "0.47794652" ]
0.7834335
1
Get the equivalent COUNT query of this query as a new query object.
public function countQuery();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getCountQuery()\n {\n $query = clone $this;\n\n //reset any orders or limits previously set since don't want those for\n //a query that just counts the results.\n $query->order('', true)\n ->limit(0);\n\n //Set main column to get to \"COUNT(*)\", and remove rest of columns\n $keys = array_keys($query->_from);\n foreach ($keys as $key) {\n $columns = ($key == 0) ? array('COUNT(*)') : array();\n $query->_from[$key]['columns'] = $columns;\n }\n\n return $query;\n }", "public function toCountQuery() {\r\n\t\t$sql='SELECT COUNT(*) as nb';\r\n\r\n\t\t$selectClause = $this->buildSelectClause();\r\n\t\t$hasDistinct = (strpos(strtolower($selectClause), 'distinct') !== FALSE);\r\n\r\n\t\t$excludeBinds = array();\r\n\t\tif (($hasDistinct) || (count($this->_salt_groups) > 0)) {\r\n\t\t\t// if select clause have a distinct... we have to count the complete subquery...\r\n \t\t\t// with groups, count() also need to be executed on a sub select query...\r\n \t\t\t// @see http://stackoverflow.com/questions/364825/getting-the-number-of-rows-with-a-group-by-query\r\n\t\t\t$sql.=' FROM ( SELECT '.$selectClause.$this->toBaseSQL().') c';\r\n\t\t} else {\r\n\t\t\t$excludeBinds = $this->getBinds(ClauseType::SELECT);\r\n\t\t\t// more simple query without select clause\r\n\t\t\t$sql.=$this->toBaseSQL();\r\n\t\t}\r\n\r\n\t\t$binds = $this->getBinds();\r\n\t\t$binds = array_diff_key($binds, $excludeBinds);\r\n\r\n\t\treturn new CountQuery($sql, $binds);\r\n\t}", "protected function getCountQuery() {\n\t\tif ($this->countQuery !== null) {\n\t\t\treturn $this->countQuery;\n\t\t}\n\n\t\tif ($this->searchTerm !== null && $this->searchFields === null) {\n\t\t\t$fields = $this->getFields();\n\t\t\t$searchFields = array();\n\t\t\tforeach ($fields as $field) {\n\t\t\t\t$searchFields[] = $field['name'];\n\t\t\t}\n\t\t} else {\n\t\t\t$searchFields = null;\n\t\t}\n\n\t\t$query = clone $this;\n\t\t$query->resetFields();\n\t\t$query->resetLimit();\n\t\t$query->resetOrderBy();\n\t\t$query->field('COUNT(*)', 'total');\n\n\t\tif ($searchFields !== null) {\n\t\t\t$query->setSearchFields($searchFields);\n\t\t}\n\n\t\treturn $query;\n\t}", "protected function getCountQuery() {\n if ($this->customCountQuery) {\n return $this->customCountQuery;\n }\n else {\n return $this->query->countQuery();\n }\n }", "public function toCount()\n {\n return $this->buildCountQuery($this->toQuery())->count();\n }", "public function setCountQuery()\n {\n $this->countQuery = true;\n return $this;\n }", "public function count() {\n $queryId = $this->getQueryId('##count##');\n\n if ($this->willCacheResult) {\n $resultId = $this->getResultId($queryId);\n\n $cachedResult = $this->cache->getResult($resultId);\n if ($cachedResult) {\n return $cachedResult->getResult();\n }\n }\n\n $connection = $this->model->getMeta()->getConnection();\n\n $cachedQuery = $this->cache->getQuery($queryId);\n if (!$cachedQuery) {\n $statement = self::$queryParser->parseQueryForCount($this);\n\n $statementParser = $connection->getStatementParser();\n\n $sql = $statementParser->parseStatement($statement);\n $usedModels = $this->getUsedModels($statement);\n\n $cachedQuery = new QueryCacheObject($sql, $usedModels);\n\n $this->cache->setQuery($queryId, $cachedQuery);\n } else {\n $sql = $cachedQuery->getSql();\n $usedModels = $cachedQuery->getUsedModels();\n }\n\n $sql = $this->parseVariablesIntoSql($sql, $connection);\n\n $result = $connection->execute($sql);\n\n if ($result->getRowCount()) {\n $row = $result->getFirst();\n $result = $row[QueryParser::ALIAS_COUNT];\n } else {\n $result = 0;\n }\n\n if ($this->willCacheResult) {\n $cachedResult = new ResultCacheObject($result);\n\n $this->cache->setResult($resultId, $cachedResult, $usedModels);\n }\n\n return $result;\n }", "public static function getCountQuery()\n {\n $key = static::getPrimaryKey();\n return DB::table(static::$schema)\n ->select([\"count({$key}) as count\"]);\n }", "public function build_count() {\n\t\t$this->validate_input();\n\n\t\t$tree = $this->sql_tree;\n\n\t\t$pagination_info = $this->make_pagination_info();\n\t\t// order is important here. The count transform puts everything within a subquery so it must go last\n\t\tif (!$this->ignore_filtering) {\n\t\t\t$tree = $this->filter_transform->alter($tree, $pagination_info);\n\t\t}\n\t\t$tree = $this->count_transform->alter($tree, $pagination_info);\n\n\t\t$creator = new PHPSQLCreator();\n\t\treturn $creator->create($tree);\n\t}", "public function setCountQuery(Select $query) {\n\t\t$this->countQuery = $query;\n\t\treturn $this;\n\t}", "public function count($query)\n {\n return $this->newQuery($query)->count();\n }", "protected function _performCount()\n {\n $query = $this->cleanCopy();\n $counter = $this->_counter;\n if ($counter) {\n $query->counter(null);\n\n return (int)$counter($query);\n }\n\n $complex = (\n $query->clause('distinct') ||\n count($query->clause('group')) ||\n count($query->clause('union')) ||\n $query->clause('having')\n );\n\n if (!$complex) {\n // Expression fields could have bound parameters.\n foreach ($query->clause('select') as $field) {\n if ($field instanceof ExpressionInterface) {\n $complex = true;\n break;\n }\n }\n }\n\n if (!$complex && $this->_valueBinder !== null) {\n $order = $this->clause('order');\n $complex = $order === null ? false : $order->hasNestedExpression();\n }\n\n $count = ['count' => $query->func()->count('*')];\n\n if (!$complex) {\n $query->getEagerLoader()->enableAutoFields(false);\n $statement = $query\n ->select($count, true)\n ->enableAutoFields(false)\n ->execute();\n } else {\n $statement = $this->getConnection()->newQuery()\n ->select($count)\n ->from(['count_source' => $query])\n ->execute();\n }\n\n $result = $statement->fetch('assoc')['count'];\n $statement->closeCursor();\n\n return (int)$result;\n }", "public function count(): ODataQueryBuilder {\n $this->count = true;\n\n return $this;\n }", "public function count(Query $query): int;", "public function getCountQuery()\n {\n return $this->countQuery;\n }", "public function getCountQuery()\n {\n return $this->countQuery;\n }", "protected function query(QueryInterface $query)\n {\n $query->select('COUNT(*) as ' . $this->keyword);\n\n if (! $this->alias && $this->table)\n {\n $this->alias = $this->table[0];\n }\n\n return $query->from($this->table, $this->alias);\n }", "protected function getCountQuery()\n {\n return $this->countQuery;\n }", "public function count()\n {\n $result = new QueryResult($this);\n return $result->count();\n }", "public function count($query = null)\n {\n return $this->_database->count($query->from($this->_name));\n }", "public function getQueryCount();", "public function count()\n\t{\n\t\t// Get a \"count all\" query\n $db = $this->getDbo();\n\n $query = $this->buildQuery(true);\n\n $query->clear('select')->clear('order')->select('COUNT(*)');\n\n\t\t// Run the \"before build query\" hook and behaviours\n $this->triggerEvent('onBuildCountQuery', array(&$query));\n\n $total = $db->setQuery($query)->loadResult();\n\n\t\treturn $this->count = $total;\n\t}", "public function count(): int\n {\n $query = clone $this;\n $table = current($this->from);\n return $query->select(\"(COUNT($table.id))\")->execute()->fetchColumn();\n }", "public function count()\r\n\t{\r\n\t\t$countModel = clone $this->model;\r\n\t\t$countQuery = $countModel->getQuery();\r\n\t\t$countQuery->orders = null;\r\n\t\t$countModel->setQuery($countQuery);\r\n\r\n\t\treturn $countModel->count();\r\n\t}", "public function count()\n {\n return $this->createStandardQueryBuilder()->count()->getQuery()->execute();\n }", "public function composeCountQuery()\n\t{\n\t\t$query = '';\n\n\t\tif (!empty($this->group)) {\n\t\t\t// if the query uses GROUP BY we have to call COUNT on sub-query\n\t\t\t$query .= 'SELECT COUNT( sub.' . $this->orm->getConfigDbPrimaryKey() . ') AS count\n\t\t\tFROM (SELECT ' . $this->orm->getConfigDbTable() . '.' . $this->orm->getConfigDbPrimaryKey() . '';\n\t\t} else {\n\t\t\t$query .= 'SELECT count(' . $this->orm->getConfigDbTable() . '.' . $this->orm->getConfigDbPrimaryKey() . ') AS count';\n\t\t}\n\n\t\t$query .= ' FROM ' . $this->orm->getConfigDbTable() . ' ';\n\n\t\tif (!empty($this->joinTables)) {\n\t\t\t$query .= ' ' . implode(' ', $this->joinTables);\n\t\t}\n\n\t\tif (!empty($this->search)) {\n\t\t\t$query .= ' WHERE ' . implode($this->imploder, $this->search);\n\t\t}\n\n\t\tif (!empty($this->group)) {\n\t\t\t$query .= ' GROUP BY ' . implode(', ', $this->group) . ') AS sub';\n\t\t}\n\n\t\treturn $query;\n\t}", "public function setCountQuery(Query $countQuery)\n {\n $this->countQuery = $countQuery;\n return $this;\n }", "public function getSelectCountSql()\n {\n $countSelect = clone $this->getSelect();\n $countSelect->reset(\\Magento\\Framework\\DB\\Select::ORDER);\n $countSelect->reset(\\Magento\\Framework\\DB\\Select::LIMIT_COUNT);\n $countSelect->reset(\\Magento\\Framework\\DB\\Select::LIMIT_OFFSET);\n $countSelect->reset(\\Magento\\Framework\\DB\\Select::GROUP);\n $countSelect->reset(\\Magento\\Framework\\DB\\Select::COLUMNS);\n $countSelect->columns(\"COUNT(*)\");\n\n return $countSelect;\n }", "public function count($query = []){\n\t\treturn $this->collection->count($query);\n\t}", "public function count()\n\t{\n\t\t$query = clone $this->df;\n\n\t\t$query->removeClause('select')\n\t\t\t->removeClause('limit')\n\t\t\t->removeClause('offset')\n\t\t\t->removeClause('order by')\n\t\t\t->select('count(*)');\n\n\t\treturn $this->count = (int)$query->fetchSingle();\n\t}", "public function countByQuery($where = '') {\n return $this->getDbTable()->countByQuery($where);\n }", "public function count()\n {\n $constrainedBuilder = clone $this->query;\n\n $constrainedBuilder = $constrainedBuilder->distinct();\n\n return $constrainedBuilder->count($this->relatedPivotKey);\n }", "public function count(): static\n {\n return $this->withProperty('isCount', true);\n }", "protected function prepareCount()\n {\n if (is_null($this->idsCount)) {\n $options = array(\n SelectorSourceInterface::RESULT => SelectorSourceInterface::RESULT_COUNT,\n SelectorSourceInterface::GROUPBY => $this->groupBy,\n );\n $this->idsCount = $this->source->loadIds(\n $this->criterias,\n array_merge($this->options, $options)\n );\n }\n\n return $this;\n }", "public function count($queries = [])\n\t{\n\t\t$model \t\t= $this->queries($queries);\n\t\t$model\t\t= $model->count();\n\n\t\treturn \t$model;\n\t}", "function getCount() {\n\t\t$where = (sizeof($this->wheres) > 0) ? ' WHERE '.implode(\" \\n AND \\n\\t\", $this->wheres) : '';\n\t\t$group = (sizeof($this->groups) > 0) ? ' GROUP BY '.implode(\", \", $this->groups) : '' ;\n\t\t$query = \"SELECT count(*) FROM \\n\\t\".$this->class->table.\"\\n \".implode(\"\\n \", $this->joins).$where.' '.$group.' ';\n\n\t\t$count =self::$global['dbCon']->fetchRow($query,MYSQLI_NUM);\n\t\treturn $count[0];\n\n\t}", "public function count() {\n $this->_active_query->fields($this->func()->count());\n $query = $this->query( $this->_active_query->getQuery(), $this->_active_query->getParams() );\n return (int)$query->rowCount();\n }", "public function count(): int\n {\n return $this->makeQuery()->count();\n }", "public function count($query = TRUE)\n {\n if(is_bool($query))\n {\n // Profile count operation for cursor\n if($this->db()->profiling)\n {\n $bm = $this->db()->profiler_start(\"Mongo_Database::$this->db\",$this->inspect().\".count(\".JSON::str($query).\")\");\n }\n\n $this->_cursor OR $this->load(TRUE);\n\n $count = $this->_cursor->count($query);\n }\n else\n {\n if(is_string($query) && $query[0] == \"{\")\n {\n $query = JSON::arr($query);\n if($query === NULL)\n {\n throw new Exception('Unable to parse query from JSON string.');\n }\n }\n $query_trans = array();\n foreach($query as $field => $value)\n {\n $query_trans[$this->get_field_name($field)] = $value;\n }\n $query = $query_trans;\n\n // Profile count operation for collection\n if($this->db()->profiling)\n {\n $bm = $this->db()->profiler_start(\"Mongo_Database::$this->db\",\"db.$this->name.count(\".($query ? JSON::str($query):'').\")\");\n }\n\n $count = $this->collection()->count($query);\n }\n\n // End profiling count\n if(isset($bm))\n {\n $this->db()->profiler_stop($bm);\n }\n\n if (is_array($count)) throw new MongoException(json_encode($count));\n\n return $count;\n }", "public function count() {\n $s = $this->buildSelect(true, null, false, false);\n return $s->numRows();\n }", "public function getCount()\n {\n $query = $this->createSearchQuery()\n ->select(\"COUNT(p.id)\")\n ->getQuery();\n \n $queryPath = $this->getCreatedSearchQueryCachePath();\n $query->useResultCache(true, self::CACHE_DAY, $this->getCachePrefix(__FUNCTION__) . $queryPath);\n \n $result = $query->getScalarResult();\n\n return $result[0][1];\n }", "public function count() {\n $repo = $this->getRepository();\n\n return $repo->aggregate($this->limit(0), __FUNCTION__, $repo->getPrimaryKey());\n }", "protected static function buildCountQuery(array $arrOptions)\n {\n return QueryBuilder::count($arrOptions);\n }", "public function getRelationCountQuery(Builder $query)\n {\n $this->setJoin ( $query );\n return parent::getRelationCountQuery ( $query );\n }", "private function getCountFilteredResults()\n {\n $qb = $this->em->createQueryBuilder();\n $qb->select('count(distinct ' . $this->tableName . '.' . $this->rootEntityIdentifier . ')');\n $qb->from($this->metadata->getName(), $this->tableName);\n\n $this->setLeftJoin($qb);\n $this->setWhere($qb);\n $this->setWhereCallbacks($qb);\n\n return (int) $qb->getQuery()->getSingleScalarResult();\n }", "public function count($distinct = false)\r\n {\r\n $res = $this->getQuery()->count();\r\n $this->cleanup();\r\n \r\n return $res;\r\n }", "protected function _getListCount($query) {\n // Use fast COUNT(*) on JDatabaseQuery objects if there no GROUP BY or HAVING clause:\n if ($query instanceof JDatabaseQuery\n && $query->type == 'select'\n && $query->group === null\n && $query->having === null) {\n $query = clone $query;\n $query->clear('select')->clear('order')->clear('limit')->select('COUNT(DISTINCT id)');\n\n $this->_db->setQuery($query);\n return (int) $this->_db->loadResult();\n }\n\n // Otherwise fall back to inefficient way of counting all results.\n $this->_db->setQuery($query);\n $this->_db->execute();\n\n return (int) $this->_db->getNumRows();\n }", "function create_list_count_query($where) {\r\n\t\t$q = parent::create_list_count_query($where);\r\n\t\t$q = preg_replace ('/select\\s+count\\(\\*\\)\\s+c/i', \"SELECT COUNT(DISTINCT `$this->table_name`.id) c\", $q);\r\n $q = preg_replace(\"/GROUP\\s+BY\\s+`$this->table_name`.id\\s*$/i\", '', $q);\r\n\t\treturn $q;\r\n\t}", "public function count()\n {\n return $this->queryResult->getSize();\n }", "public function queryCount() {\n return $this->queryCount;\n }", "public function fromCountQuery(\\Yana\\Db\\Queries\\IsCountQuery $query): string;", "public function selectcount($object = null)\n {\n $columns = \"COUNT(*)\";\n if ($object):\n $this->instanciateVariable($object);\n elseif (is_object($columns)):\n $this->instanciateVariable($columns);\n $columns = \"COUNT(*)\";\n endif;\n\n $this->columns = \"COUNT(*)\";\n $this->columnscount = \"COUNT(*)\";\n// $this->columns = is_array($columns) ? $columns : func_get_args();\n $this->query = \" \";\n// $this->_selectcount = \" select $columns from `\". $this->table . \"` \";\n $this->initdefaultjoin();\n\n return $this;\n }", "public function buildQueryBuilderForCount(): void\n {\n $this->qb->resetQueryParts();\n\n $this->qb->addSelect(\"COUNT({$this->table}.id) AS count\")\n ->from($this->table, $this->table)\n ->where(\"{$this->table}.{$this->pidColumnName}=0\")\n ;\n }", "public function getCount()\n {\n return $this->doQuery(null, false, false)->count();\n }", "public function setCountQuery(SelectQueryInterface $query) {\n $this->customCountQuery = $query;\n }", "public function count()\n {\n if (func_num_args() == 0) {\n return $this->getCount();\n }\n\n $this->setCount(func_get_arg(0));\n\n return $this;\n }", "public static function count($where = null)\n {\n if (!is_null($where) && is_array($where)) self::parseWhere($where, $where_str, $parameters);\n\n $class = new static([ ]);\n $result = database()->rowCount('SELECT * FROM ' . $class->table . ' ' . ($where_str ?? ''), ($parameters ?? null));\n\n unset($class);\n return $result;\n }", "public function getSelectCountSql()\n {\n $this->_renderFilters();\n\n $countSelect = $this->_getClearSelect()\n ->columns('COUNT(DISTINCT cpf'.$this->_storeId.'.entity_id)')\n ->resetJoinLeft();\n return $countSelect;\n }", "public function getCount()\n {\n if ($this->_queryResult === null) {\n return 0;\n }\n\n return $this->_queryResult->count();\n }", "public function count(): CountRequestBuilder {\n return new CountRequestBuilder($this->pathParameters, $this->requestAdapter);\n }", "public function count(): CountRequestBuilder {\n return new CountRequestBuilder($this->pathParameters, $this->requestAdapter);\n }", "public function count(): CountRequestBuilder {\n return new CountRequestBuilder($this->pathParameters, $this->requestAdapter);\n }", "public function count(): CountRequestBuilder {\n return new CountRequestBuilder($this->pathParameters, $this->requestAdapter);\n }", "public function count(): CountRequestBuilder {\n return new CountRequestBuilder($this->pathParameters, $this->requestAdapter);\n }", "public function count(): CountRequestBuilder {\n return new CountRequestBuilder($this->pathParameters, $this->requestAdapter);\n }", "public function count(): CountRequestBuilder {\n return new CountRequestBuilder($this->pathParameters, $this->requestAdapter);\n }", "public function count(): CountRequestBuilder {\n return new CountRequestBuilder($this->pathParameters, $this->requestAdapter);\n }", "public function count(): CountRequestBuilder {\n return new CountRequestBuilder($this->pathParameters, $this->requestAdapter);\n }", "public function count() {\n if ($this->_count <= 0) {\n $where = new Where();\n if (isset($this->_options[\"eventData\"]) && $this->_options[\"eventData\"] != '') {\n $where->expression($this->_sql_search_expression, \"%\" . $this->_options[\"eventData\"] . \"%\");\n }\n $sql = new Sql($this->adapter);\n $select = $sql->select();\n $select->from($this->table)->where($where)->columns(array('count' => new Expression('COUNT(*)')));\n $sqlTxt = $sql->getSqlStringForSqlObject($select);\n $resultSet = $this->adapter->query($sqlTxt, Adapter::QUERY_MODE_EXECUTE);\n foreach ($resultSet as $row) {\n $this->_count = intval($row->count);\n break;\n }\n }\n return $this->_count;\n }", "public function getQueryCount()\n {\n return $this->query_count;\n }", "public function count($documentClass, array $query = array())\n {\n return $this->getRepository($documentClass)->count($query);\n }", "function count()\n{\n\tif (!$this->getSql()) return 0;\n\t$rows = $this->getClone()->select('count(*) as n');\n\treturn (int)$rows[0]['n'];\n}", "public function count($col = '*', $as = NULL) \n {\n $col = $this->clean($col);\n \n // Empty out the old junk\n $this->clear();\n \n // Build our sql statement\n $as = ($as !== NULL) ? \" AS \".$as : \"\";\n $this->sql = \"SELECT COUNT(\". $col .\")\". $as;\n return $this;\n }", "public function countBy($queryString)\n\t{\n\t\treturn $this->prepareQueryBy($queryString)->count('*');\n\t}", "function count_query($query, array $params = array()) {\n\t$statement = run_query($query, $params);\n\treturn count($statement->fetchAll(PDO::FETCH_OBJ));\n}", "public function getCount($where = [], $joinConditions = [], $prefix = 'u')\n {\n return $this->find($where, $prefix, true, $joinConditions);\n }", "public function count(string $q = '*'): int\n {\n if ($this->shouldEmulateExecution()) {\n return 0;\n }\n\n if ($this->getWhere() === null) {\n return (int) $this->db->executeCommand('LLEN', [$this->getARInstance()->keyPrefix()]);\n }\n\n return (int) $this->executeScript('Count');\n }", "public function getSelectCountSql() {\r\n $countSelect = clone $this->getSelect();\r\n\t\t\r\n\t\t$countSelect->reset();\r\n\t\t\r\n $countSelect\r\n ->from(['m' => new \\Zend_Db_Expr('(\r\n\t\t\t\tSELECT frequency_length\r\n\t\t\t\tFROM subscriptions_profiles AS main_table\r\n\t\t\t\tWHERE (main_table.status != \"active\") AND (FLOOR(main_table.frequency_length / (60 * 60 * 24)) > 0)\r\n\t\t\t\tGROUP BY CONCAT(frequency_length, merchant_source)\r\n\t\t\t)')], [])\r\n ->columns(array(\r\n\t\t\t\tnew \\Zend_Db_Expr('COUNT(*)')\r\n ));\r\n\t\t\r\n\t\treturn $countSelect;\r\n }", "public function count($where = NULL)\n\t{\n\t\t$meta = $this->meta();\n\t\t\n\t\tif (is_int($where) || is_string($where))\n\t\t{\n\t\t\t$this->where($meta->primary_key, '=', $where);\n\t\t}\n\t\t// Add the where\n\t\telse if (is_array($where))\n\t\t{\n\t\t\tforeach($where as $column => $value)\n\t\t\t{\n\t\t\t\t$this->where($column, '=', $value);\n\t\t\t}\n\t\t}\n\t\t\n\t\t$query = $this->build(Database::SELECT);\n\t\n\t\treturn $query->select(array('COUNT(\"*\")', 'total'))\n\t\t\t->from($meta->table)\n\t\t\t->execute($meta->db)\n\t\t\t->get('total');\n\t}", "public static function getCount()\n {\n $key = static::getPrimaryKey();\n return DB::table(static::$schema)\n ->select(['count('. $key .') tcount'])\n ->fetchOne()\n ->tcount;\n }", "public function executeCountQuery($query, ApiRequest $apiRequest)\n {\n $repository = $this->orm->getRepositoryFromQuery($query);\n $countQuery = $this->orm->getCountQuery($repository);\n\n $this->addFilterCriteria($countQuery, $repository, $apiRequest->getFilters());\n $count = $this->orm->executeQuery($countQuery)[0]['count'];\n return $count;\n }", "public function getCount()\n {\n if (null === $this->count) {\n $qb = clone $this->getQueryBuilder();\n $query = $qb->addSelect('count(e.id) as total_count');\n $result = $query->getQuery()->execute();\n $this->count = $result[0]['total_count'];\n }\n return $this->count;\n }", "public function count()\n {\n return $this->client->count($this->compile())['count'];\n }", "public function getQueryCount()\n\t{\n\t\treturn $this->query_count;\n\t}", "public function queryCount()\n {\n return $this->_QUERYCOUNT;\n }", "public function buildQueryBuilderForCountWithSubQuery(QueryBuilder $queryBuilder): void\n {\n $this->qb->resetQueryParts();\n\n $this->qb->addSelect('COUNT(t1.id) AS count')\n ->from($this->table, 't1')\n ->join('t1', sprintf('(%s)', $queryBuilder->getSQL()), 't3', 't1.id = t3.id')\n ;\n }", "static function GetCustomCountQuery($criteria)\r\n\t{\r\n\t\t$sql = \"select count(1) as counter from `agenda_sgp`\";\r\n\r\n\t\t// the criteria can be used or you can write your own custom logic.\r\n\t\t// be sure to escape any user input with $criteria->Escape()\r\n\t\t$sql .= $criteria->GetWhere();\r\n\r\n\t\treturn $sql;\r\n\t}", "final public static function selectCount($col, $alias, $table = null)\n {\n //init the select\n self::$query .= \"SELECT COUNT($col) AS $alias FROM \" . ($table != null ? $table : self::tableName());\n return (new static);\n }", "public function getQuerycount() : int\n {\n return $this->queryCount;\n }", "public function getSelectCountSql()\n {\n $countSelect = parent::getSelectCountSql();\n\n $countSelect->reset(\\Zend_Db_Select::GROUP);\n\n return $countSelect;\n }", "public function getCount() {\n return $this->get(self::COUNT);\n }", "public function getRecordsCount(Query $query)\n {\n $qb = $this->getRequestQB($query, false);\n $qb->select($qb->expr()->countDistinct('search.id'));\n\n return (int)$qb->getQuery()->getSingleScalarResult();\n }", "public function get_count($where = array())\n {\n return $this->db->where($where)->from($this->tableName)->count_all_results();\n }", "public function count(): int\n {\n if ($this->numberOfResults === null) {\n $this->initialize();\n if ($this->queryResult !== null) {\n $this->numberOfResults = count($this->queryResult ?? []);\n } else {\n parent::count();\n }\n }\n\n return $this->numberOfResults;\n }", "static function GetCustomCountQuery($criteria)\n\t{\n\t\t$sql = \"select count(1) as counter from `modelo_certificado`\";\n\n\t\t// the criteria can be used or you can write your own custom logic.\n\t\t// be sure to escape any user input with $criteria->Escape()\n\t\t//$sql .= $criteria->GetWhere();\n\n\t\treturn $sql;\n\t}", "static function GetCustomCountQuery($criteria)\r\n\t{\r\n\t\t$sql = \"select count(1) as counter from `users`\";\r\n\r\n\t\t// the criteria can be used or you can write your own custom logic.\r\n\t\t// be sure to escape any user input with $criteria->Escape()\r\n\t\t$sql .= $criteria->GetWhere();\r\n\r\n\t\treturn $sql;\r\n\t}", "public function QueryCount($condition, $table, $opts){\n \n if ($condition == NULL){ \n $sql = \"SELECT count(*) FROM $table\";\n }\n else{\n $this->keyvalSeparate($condition);\n $newconditions = $this->expressionGen_AND($this->keys, $this->values); \n $sql = \"SELECT count(*) FROM $table WHERE $newconditions\"; \n }\n \n if ($opts != NULL) $sql .= \" \".$opts;\n \n\t\t$query = $this->QueryMe($sql);\n\t\t$query = $query->fetch( \\PDO::FETCH_ASSOC);\n\t\t$count = $query[\"count(*)\"];\n\t\treturn $count;\n \n }", "public function count(array $query = [])\n {\n $partial = Inflector::pluralize($this->getResourceName()).'/count';\n\n return $this->client->get($partial, $query)['count'];\n }", "public function getSelectCountSql()\n {\n $countSelect = parent::getSelectCountSql();\n $countSelect->reset(Zend_Db_Select::GROUP);\n\n return $countSelect;\n }", "public function getCount()\n {\n $dqlStr = $this->getQuery()->getDQL();\n $stmt = Connection::conn()->prepare(\"SELECT count(*) AS total FROM ({$this->getQuery()->getSQL()}) data\");\n $params = $this->getQuery()->getParameters();\n\n $orderParam = array();\n foreach ($params as $param) {\n /* @var $param \\Doctrine\\ORM\\Query\\Parameter */\n $orderParam[ strpos($dqlStr, \":{$param->getName()}\") ] = $param;\n }\n ksort($orderParam);\n\n $orderParamSorted = array_values($orderParam);\n foreach ($orderParamSorted as $index => $param) {\n $stmt->bindValue(1 + $index, $param->getValue(), $param->getType());\n }\n $stmt->execute();\n\n $row = $stmt->fetch();\n return (int) $row['total'];\n }" ]
[ "0.81277746", "0.782603", "0.77943915", "0.73987824", "0.7204776", "0.716211", "0.70869136", "0.6953441", "0.68850833", "0.67725813", "0.6721695", "0.6702764", "0.6679869", "0.66370064", "0.654595", "0.654595", "0.653327", "0.6518281", "0.6512614", "0.65089345", "0.6462946", "0.6461509", "0.6458158", "0.64385045", "0.6373488", "0.6372723", "0.63368", "0.6327415", "0.6306559", "0.6293651", "0.62488157", "0.6183837", "0.617581", "0.61659443", "0.6157486", "0.6140372", "0.6139687", "0.61356866", "0.6117289", "0.6107384", "0.6095485", "0.6095324", "0.6048357", "0.60481685", "0.6036013", "0.59986705", "0.59976965", "0.5987538", "0.5979935", "0.59702915", "0.5970033", "0.59677035", "0.5966053", "0.59660244", "0.5957252", "0.59490436", "0.5939087", "0.5927448", "0.59149146", "0.59025514", "0.59025514", "0.59025514", "0.59025514", "0.59025514", "0.59025514", "0.59025514", "0.59025514", "0.59025514", "0.589953", "0.5899098", "0.58919793", "0.5883461", "0.58786106", "0.587351", "0.5857341", "0.58553493", "0.5840378", "0.5826154", "0.58193225", "0.581855", "0.5814338", "0.581433", "0.5800646", "0.5793927", "0.5786902", "0.57754624", "0.5772064", "0.5769999", "0.5769134", "0.57688683", "0.5767038", "0.57565725", "0.5754345", "0.5743935", "0.5743851", "0.5740143", "0.5735996", "0.57341576", "0.57328546", "0.5728558" ]
0.64651644
20
Indicates if preExecute() has already been called on that object.
public function isPrepared();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function preExecuteCheck()\n {\n return true;\n }", "public function preExecute() {\n }", "public function preExecute(){\n\n\t\n\t}", "function getPreceptor(): bool\n {\n if (!isset($this->bpreceptor) && !$this->bLoaded) {\n $this->DBCarregar();\n }\n return core\\is_true($this->bpreceptor);\n }", "public function preProcess();", "public function preProcess();", "public static function before() {\n\t\t// Return true for the actions below to execute\n\t\treturn true;\n\t}", "protected function beforeRun(){\n\t\treturn true;\n\t}", "public function isInitialCall();", "abstract protected function _preProcess();", "public function preProcess()\n { \n $errors = $this->get( 'error' );\n $this->assign('errors', $errors );\n $errors = null;\n return true;\n }", "protected function shouldExecute()\n {\n return !$this->job->isDryRun() || $this->get('executeInPreview');\n }", "public function isExecuted() {}", "public function preAction()\n {\n // Nothing to do\n }", "protected function preProcess() {}", "public function pre_action()\n\t{\n\t\tparent::pre_action();\n\t}", "protected function preRun()\n {\n if (@class_exists('Plugin_PreRun') &&\n in_array('Iface_PreRun', class_implements('Plugin_PreRun'))) {\n $preRun = new Plugin_PreRun();\n $preRun->process();\n }\n }", "function preProcess()\n {\t\n parent::preProcess( );\n\t\t \n\t}", "function isExecuted() ;", "public function getShouldExecute() : bool\n {\n }", "public function pre()\n {}", "protected function willExecute() {\n return;\n }", "public function preProcess($object);", "public function preExec()\n {\n }", "public function isExecuted() : bool {\n return $this->isExecuted;\n }", "public final function isFirstCall() {\n\t\tif($this->isFirstCall) {\n\t\t\t$this->isFirstCall = false;\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public function preAction()\n {\n }", "protected function performPrePersistCallback()\n {\n // echo 'inserting a record ...';\n $this->validate();\n \n return true;\n }", "public function preSave ( $Event ) {\n\t\t# Prepare\n\t\t$result = true;\n\t\t\n\t\t# Ensure\n\t\tif ( self::ensure($Event, __FUNCTION__) ) {\n\t\t\t// no need\n\t\t}\n\t\t\n\t\t# Done\n\t\treturn method_exists(get_parent_class($this),$parent_method = __FUNCTION__) ? parent::$parent_method($Event) : $result;\n\t}", "protected function performPreSaveCallback()\n {\n // echo 'saving a record ...';\n $this->validate();\n \n return true;\n }", "function preLoad() {\n if ( ! $this->useThemes() ) {\n $this->doneAndExit( 'do_not_use_themes' );\n }\n $method = strtoupper( filter_input( INPUT_SERVER, 'REQUEST_METHOD' ) );\n if ( 'HEAD' === $method && apply_filters( 'exit_on_http_head', TRUE ) ) {\n $this->doneAndExit( 'on_http_head' );\n }\n if ( is_robots() ) {\n do_action( 'do_robots' );\n $this->doneAndExit( 'is_robots' );\n } elseif ( is_feed() ) {\n do_feed();\n $this->doneAndExit( 'is_feed' );\n } elseif ( is_trackback() ) {\n include( ABSPATH . 'wp-trackback.php' );\n $this->doneAndExit( 'is_trackback' );\n }\n return TRUE;\n }", "function isPreparation()\n {\n return isset($this->source['prep']) && $this->source['prep'];\n }", "public function isCallInitializationHook()\n {\n return $this->callInitializationHook;\n }", "protected function processPreprocess(Aloi_Serphlet_Application_HttpRequest $request, Aloi_Serphlet_Application_HttpResponse $response) {\r\n\t\treturn true;\r\n\t}", "protected function performPreUpdateCallback()\n {\n // echo 'updating a record ...';\n $this->validate();\n \n return true;\n }", "private function before_execute()\n {\n }", "public function hasExcecuted()\n {\n return $this->executed;\n }", "public function executed() : bool {\n return $this->_executed;\n }", "public function preExecute()\n {\n if (!$this->getUser()->getReferenceFor('career'))\n {\n $this->getUser()->setFlash('warning', 'Debe seleccionar una carrera para poder administrar las opciones de sus materias.');\n $this->redirect('@career');\n }\n $this->career = CareerPeer::retrieveByPK($this->getUser()->getReferenceFor('career'));\n if ( is_null($this->career))\n {\n $this->getUser()->setFlash('warning', 'Debe seleccionar una carrera para poder administrar las opciones de sus materias.');\n $this->redirect('@career');\n }\n \n parent::preExecute();\n\n }", "public function isProcessed() {}", "public function qualifyToStart(): bool;", "public function should_execute()\n {\n }", "public function should_execute()\n {\n }", "public function should_execute()\n {\n }", "public function should_execute()\n {\n }", "public function should_execute()\n {\n }", "public function should_execute()\n {\n }", "public function should_execute()\n {\n }", "public function should_execute()\n {\n }", "public function should_execute()\n {\n }", "public function preUpdate(ConnectionInterface $con = null)\n {\n if (is_callable('parent::preUpdate')) {\n // parent::preUpdate($con);\n }\n return true;\n }", "public function preUpdate(ConnectionInterface $con = null)\n {\n if (is_callable('parent::preUpdate')) {\n // parent::preUpdate($con);\n }\n return true;\n }", "public function preUpdate(ConnectionInterface $con = null)\n {\n if (is_callable('parent::preUpdate')) {\n // parent::preUpdate($con);\n }\n return true;\n }", "protected function beforeProcess() {\n }", "public function preUpdate()\n {\n }", "protected function performPreRemoveCallback()\n {\n // delete workflow for this entity\n $workflow = $this['__WORKFLOW__'];\n if ($workflow['id'] > 0) {\n $result = (bool) DBUtil::deleteObjectByID('workflows', $workflow['id']);\n if ($result === false) {\n $dom = ZLanguage::getModuleDomain('SurveyManager');\n return LogUtil::registerError(__('Error! Could not remove stored workflow. Deletion has been aborted.', $dom));\n }\n }\n \n return true;\n }", "protected function _preExec()\n {\n }", "function _pre() {\n\n\t}", "public function hasProfilePreLoaded()\n {\n return property_exists($this, 'profile') && ! is_null($this->profile);\n }", "public function isExecutable() {\n return $this->state->canChange('executed');\n }", "function beforeValidate() {\n\t\t\treturn !($this->codeExists($this->data['ReductionCode']['code'], $this->data['ReductionCode']['event_id']));\n\t\t}", "public function preSaveCallback()\n {\n $this->performPreSaveCallback();\n }", "public function preSaveCallback()\n {\n $this->performPreSaveCallback();\n }", "public function preAction() {\n\n }", "protected function preSave() {\n return TRUE;\n }", "public function preSave(ConnectionInterface $con = null)\n {\n if (is_callable('parent::preSave')) {\n // parent::preSave($con);\n }\n return true;\n }", "public function preSave(ConnectionInterface $con = null)\n {\n if (is_callable('parent::preSave')) {\n // parent::preSave($con);\n }\n return true;\n }", "public function preSave(ConnectionInterface $con = null)\n {\n if (is_callable('parent::preSave')) {\n // parent::preSave($con);\n }\n return true;\n }", "public function isExecuted() {\n return $this->state->getCode() == TaskState::Executed;\n }", "public function isPreceptor()\n {\n return $this->getAttribute('login_role') == 'Preceptor';\n //return $this->getGuardUser()->hasGroup('Preceptor');\n }", "public function hasPreparer()\n {\n return isset($this->preparer);\n }", "public function isGetPagePreProcessCalledCallback() {}", "private function beforeMove(): bool\n {\n $event = new MoveEvent();\n $this->trigger(self::EVENT_BEFORE_MOVING, $event);\n\n return $event->canMove;\n }", "protected function beforeDoAction() {\n return true;\n }", "public function preExecute()\n {\n // store current URI incase we need to be redirected back to this page\n $request = $this->getRequest();\n if($request->getPathInfo() != '/getEbayResults')\n {\n $this->getUser()->setAttribute('lastPageUri', $request->getPathInfo());\n }\n }", "protected function preSave() {\n\t\treturn true;\n\t}", "public function preExecute()\n {\n $this->getContext()->getConfiguration()->loadHelpers(array('Url', 'sfsCurrency'));\n \n if ($this->getActionName() == 'index') {\n $this->checkOrderStatus();\n }\n }", "public function preUpdateCallback()\n {\n $this->performPreUpdateCallback();\n }", "public function preUpdateCallback()\n {\n $this->performPreUpdateCallback();\n }", "public function isIgnoreMinimumExecutionTime()\n\t{\n\t\treturn $this->ignoreMinimumExecutionTime;\n\t}", "public function preInsert(ConnectionInterface $con = null)\n {\n if (is_callable('parent::preInsert')) {\n // parent::preInsert($con);\n }\n return true;\n }", "public function preInsert(ConnectionInterface $con = null)\n {\n if (is_callable('parent::preInsert')) {\n // parent::preInsert($con);\n }\n return true;\n }", "public function preInsert(ConnectionInterface $con = null)\n {\n if (is_callable('parent::preInsert')) {\n // parent::preInsert($con);\n }\n return true;\n }", "public static function mustRunBefore(): iterable;", "public function preUpdate(ConnectionInterface $con = null)\n {\n if (is_callable('parent::preUpdate')) {\n return parent::preUpdate($con);\n }\n return true;\n }", "public function preUpdate(ConnectionInterface $con = null)\n {\n if (is_callable('parent::preUpdate')) {\n return parent::preUpdate($con);\n }\n return true;\n }", "public function preUpdate(ConnectionInterface $con = null)\n {\n if (is_callable('parent::preUpdate')) {\n return parent::preUpdate($con);\n }\n return true;\n }", "public function preUpdate(ConnectionInterface $con = null)\n {\n if (is_callable('parent::preUpdate')) {\n return parent::preUpdate($con);\n }\n return true;\n }", "public function preUpdate(ConnectionInterface $con = null)\n {\n if (is_callable('parent::preUpdate')) {\n return parent::preUpdate($con);\n }\n return true;\n }", "public function preUpdate(ConnectionInterface $con = null)\n {\n if (is_callable('parent::preUpdate')) {\n return parent::preUpdate($con);\n }\n return true;\n }", "public function prePersistCallback()\n {\n $this->performPrePersistCallback();\n }", "public function prePersistCallback()\n {\n $this->performPrePersistCallback();\n }", "protected function beforeUpdate(): bool\n {\n return true;\n }", "public function isInitial();", "public function beforeValidate() {\n\t\treturn true;\n\t}", "public function beforeAction($action)\n {\n // which are triggered on the [[EVENT_BEFORE_ACTION]] event, e.g. PageCache or AccessControl\n\n if (!parent::beforeAction($action)) {\n return false;\n }\n\n // other custom code here\n\n return true; // or false to not run the action\n }", "public function isOrPositionBefore()\n {\n return\n ($this->getIsOnCatalogProductPage() && !$this->getShowOrPosition())\n || ($this->getShowOrPosition()\n && $this->getShowOrPosition() == self::POSITION_BEFORE);\n }", "public abstract function should_execute();", "function shouldExecute()\n {\n return Dice::roll(100, 100);\n }", "function isOverExecuted()\n {\n if ($this->start_time+$this->max_execution_time<time()) return true;\n else return false;\n }", "function onBeforeApply() {\n\t\treturn true;\n\t}" ]
[ "0.71530056", "0.65071213", "0.6442079", "0.5986785", "0.59794706", "0.59794706", "0.59601027", "0.5942302", "0.5933861", "0.5926664", "0.5926564", "0.5921444", "0.59166294", "0.59084684", "0.5850421", "0.58484995", "0.5839741", "0.5820644", "0.58106935", "0.57490134", "0.574265", "0.57215446", "0.571988", "0.5698796", "0.56864005", "0.5682764", "0.5643944", "0.5643762", "0.5631196", "0.56080997", "0.5602441", "0.5600118", "0.5586011", "0.5563407", "0.55577785", "0.5531458", "0.5529369", "0.55289483", "0.55188966", "0.5518524", "0.5513465", "0.5501942", "0.5501942", "0.5501942", "0.5501942", "0.5501942", "0.5501942", "0.5501942", "0.5501942", "0.5501942", "0.55016834", "0.55016834", "0.55016834", "0.54666483", "0.54615784", "0.5461309", "0.5456603", "0.54475373", "0.5428297", "0.5411312", "0.5410438", "0.54022104", "0.54022104", "0.54008913", "0.53985447", "0.5383557", "0.5383557", "0.5383557", "0.5378175", "0.5376521", "0.5370296", "0.5364484", "0.5360259", "0.5337686", "0.53369784", "0.5336524", "0.5308019", "0.5307533", "0.5307533", "0.53044903", "0.53043836", "0.53043836", "0.53043836", "0.5295446", "0.5279146", "0.5279146", "0.5279146", "0.5279146", "0.5279146", "0.5279146", "0.5278592", "0.5278592", "0.52706677", "0.52656", "0.526112", "0.52551967", "0.5238038", "0.5235929", "0.5234895", "0.522933", "0.5228258" ]
0.0
-1
Generic preparation and validation for a SELECT query.
public function preExecute(SelectInterface $query = NULL);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract public function prepareSelect();", "protected function prepareSelectStatement() {}", "protected abstract function getSelectStatement();", "protected abstract function getSelectStatement();", "private function __select() {\n $from_str = $this->getFromStr();\n $field = $this->field_str;\n if (empty($field)) {\n $field = '*';\n }\n $sql = \"SELECT {$field} FROM {$from_str}\";\n if (!empty($this->join_str_list)) {\n $temp = implode(' ', $this->join_str_list);\n $sql .= \" {$temp}\";\n }\n if (!empty($this->where_str)) {\n $sql .= \" WHERE {$this->where_str}\";\n }\n if (!empty($this->group_str)) {\n $sql .= \" GROUP BY {$this->group_str}\";\n }\n if (!empty($this->order_str)) {\n $sql .= \" ORDER BY {$this->order_str}\";\n }\n if (!empty($this->limit_str)) {\n $sql .= \" LIMIT {$this->limit_str}\";\n }\n $list = $this->query($sql);\n return $list;\n }", "private function _select(){\n $this->debugBacktrace();\n $parameter = $this->selectParam; //transfer to local variable.\n $this->selectParam = \"\"; //reset updateParam.\n\n \n \n $sql = \"\";\n if($this->hasRawSql){\n $sql = $parameter;\n $this->hasRawSql = false;\n }\n else{\n $tableName = $this->tableName;\n $this->tableName = \"\"; //reset.\n\n $columns = \"\";\n if(!isset($parameter) || empty($parameter)){\n $columns = \"*\";\n $sql = $this->_prepare_select_sql($columns,$tableName);\n }\n else{\n //first check whether it has 'select' keyword\n $parameter = trim($parameter);\n $keyWord = substr($parameter,0,6);\n if(strtoupper($keyWord)==\"SELECT\") {\n $sql = $parameter;\n }\n else{\n $columns = $parameter;\n $sql = $this->_prepare_select_sql($columns,$tableName);\n }\n }\n }\n\n \n $queryObject = $this->_perform_mysql_query($sql);\n \n if(empty($this->selectModifier)){\n //No select modifier (first, firstOrDefault, single, singleOrDefault) found ---->\n $quantity = 0;\n $rows = array();\n switch ($this->fetchType){\n case \"fetch_object\":\n while ($row = mysqli_fetch_object($queryObject)) {\n if(isset($tableName)){\n $meta = new stdClass();\n $meta->type = $tableName;\n $row->__meta = $meta;\n }\n $rows[] = $row;\n $quantity++;\n }\n break;\n case \"fetch_assoc\":\n while ($row = mysqli_fetch_assoc($queryObject)) {\n $rows[] = $row;\n $quantity++;\n }\n break;\n case \"fetch_array\":\n while ($row = mysqli_fetch_array($queryObject)) {\n $rows[] = $row;\n $quantity++;\n }\n break;\n case \"fetch_row\":\n while ($row = mysqli_fetch_row($queryObject)) {\n $rows[] = $row;\n $quantity++;\n }\n break;\n case \"fetch_field\":\n while ($row = mysqli_fetch_field($queryObject)) {\n $rows[] = $row;\n $quantity++;\n }\n break;\n }\n\n if($quantity>0){\n mysqli_free_result($queryObject);\n }\n\n return $rows;\n //<----No select modifier (first, firstOrDefault, single, singleOrDefault) found \n }\n else{ \n //select modifier (first, firstOrDefault, single, singleOrDefault) found ---->\n $selectModifier = $this->selectModifier;\n $this->selectModifier = \"\";\n $row;\n switch($selectModifier){\n case \"first\":\n $numRows = mysqli_num_rows($queryObject);\n if($numRows == 0){\n throw new ZeroException(\"No data found.\");\n }\n break;\n \n case \"firstOrNull\":\n $numRows = mysqli_num_rows($queryObject);\n if($numRows == 0){\n return NULL;\n }\n break;\n\n case \"single\":\n $numRows = mysqli_num_rows($queryObject);\n if($numRows == 0){\n throw new ZeroException(\"No data found.\");\n }\n if($numRows > 1){\n throw new ZeroException(\"Multiple records found.\");\n }\n break;\n\n case \"singleOrNull\":\n $numRows = mysqli_num_rows($queryObject);\n if($numRows == 0){\n return NULL;\n }\n if($numRows > 1){\n return NULL;\n }\n break;\n }\n\n return $this->_prepareSingleRecord($queryObject);\n //<---- select modifier (first, firstOrDefault, single, singleOrDefault) found *212*062#\n }\n }", "public function testSelect()\n {\n $index = new Index();\n $query = new Query($index);\n $this->assertSame($query, $query->select(['a', 'b']));\n $elasticQuery = $query->compileQuery()->toArray();\n $this->assertEquals(['a', 'b'], $elasticQuery['_source']);\n\n $query->select(['c', 'd']);\n $elasticQuery = $query->compileQuery()->toArray();\n $this->assertEquals(['a', 'b', 'c', 'd'], $elasticQuery['_source']);\n\n $query->select(['e', 'f'], true);\n $elasticQuery = $query->compileQuery()->toArray();\n $this->assertEquals(['e', 'f'], $elasticQuery['_source']);\n }", "protected function processSelect(\\Zend_Db_Select $select)\n { }", "public function testSelectWithConditions(): void\n {\n $this->_insert();\n $result = $this->connection->selectQuery('id', 'ordered_uuid_items')\n ->where(['id' => '48298a29-81c0-4c26-a7fb-413140cf8569'], ['id' => 'ordered_uuid'])\n ->execute()\n ->fetchAll('assoc');\n\n $this->assertCount(1, $result);\n $this->assertSame('4c2681c048298a29a7fb413140cf8569', $result[0]['id']);\n }", "public function createSelectSql(): \\Hx\\Db\\Sql\\SelectInterface;", "public abstract function getSelectSQL($fields, $from, $joins, $where, $having, $group, $order, $limit, $values, $forupdate);", "function createSelect($_table, $_value, $_colum)\n{\n\n $_prev_par= false;\n $_query = \"SELECT * FROM $_table\";\n\n foreach ($_value as $_key => $_value)\n {\n if ($_value != \"\")\n {\n if ($_prev_par)\n {\n $_query.= \" AND \";\n }\n else\n {\n $_query.= \" WHERE \";\n }\n\n $_query.= $_colum[$_key].\" = '$_value'\";\n $_prev_par = true;\n }\n }\n $_query.=\";\";\n\n return $_query;\n}", "function selectQuery($query) \t{\n\t\tif($query != '')\t\t{\n\t $res = $this->execute($query);\n\t\t\treturn $this->fetchAll($res);\n\t\t}\n\t}", "protected static function select()\n {\n }", "function getSelectQueryResult($query) {\r\n\tif(!preg_match('/^[\\ ]*SELECT/i', $query)) migrationDie(array(\"ERR_QUERY\", \"'SELECT' query expected\", $query));\r\n\t$select_result = array();\r\n\t$query_result = customQuery($query);\r\n\twhile($row = $query_result->fetch_assoc()) {\r\n\t\t$select_result[] = $row;\r\n\t}\r\n\treturn $select_result;\r\n}", "public function testSelectStmt()\n {\n $select = $this->getConnection()\n ->select()\n (['blog_title', 'blog_id'])\n ('dummy_posts')\n ('WHERE blog_title = :title');\n return $this->assertEquals($select, \"SELECT blog_title, blog_id FROM dummy_posts WHERE blog_title = :title\");\n }", "public function select();", "public function select();", "public function select();", "function buildSelect($db_name,$table_name,$columns,$where_select){\n\n\t$query_select = \"SELECT \";\n\t//FILL COLUMNS FOR GET\n\tforeach ($columns as $c) {\n\t\t$query_select .= $c;\n\t\tif(array_search($c,$columns) != count($columns) - 1) $query_select .= \",\";\n\t}\n\tif($where_select != \"*\"){//GET \n\t\t//INTERMEDIATE\n\t\t$query_select .= \" FROM $table_name WHERE \";\n\t\t//FILL VALUES WHERE\n\t\tend($where_select);\n\t\t$last_key = key($where_select);\n\t\tforeach ($where_select as $key => $value) {\n\t\t\t$query_select .= $key . \"=\" . \":\" . $key;\n\t\t\tif($key != $last_key) $query_select .= \" AND \";\n\t\t}\n\t\texecuteQuery(\"USE $db_name\");\n\t\treturn executeQuery($query_select,$where_select);\n\t}\n\telse{//GET ALL SELECT\n\t\t//INTERMEDIATE\n\t\t$query_select .= \" FROM $table_name\";\n\t\texecuteQuery(\"USE $db_name\");\n\t\treturn executeQuery($query_select,\"*\");\n\t}\n\n}", "public function testInvalidSelectStatement()\n {\n $method = $this->builder_reflection->getMethod('sql_select_statement');\n $method->setAccessible(TRUE);\n\n $property = $this->builder_reflection->getProperty('select_statement');\n $property->setAccessible(TRUE);\n\n $method->invokeArgs($this->builder, array('INSERT INTO table1'));\n\n $string = '';\n\n $this->assertEquals($string, $property->getValue($this->builder));\n }", "public function querySelect($sql, $fields = NULL, $fetchMode = NULL) : Collection;", "function selecting($table='', $fields='*', ...$get_args) { \n\t\t$getfromtable = $this->fromtable;\n\t\t$getselect_result = $this->select_result; \n\t\t$getisinto = $this->isinto;\n \n\t\t$this->fromtable = null;\n\t\t$this->select_result = true;\t\n\t\t$this->isinto = false;\t\n \n $skipwhere = false;\n $wherekeys = $get_args;\n $where = '';\n\t\t\n if ( ! isset($table) || $table=='' ) {\n $this->setParamaters();\n return false;\n }\n \n $columns = $this->to_string($fields);\n \n\t\tif (isset($getfromtable) && ! $getisinto) \n\t\t\t$sql=\"CREATE TABLE $table AS SELECT $columns FROM \".$getfromtable;\n elseif (isset($getfromtable) && $getisinto) \n\t\t\t$sql=\"SELECT $columns INTO $table FROM \".$getfromtable;\n else \n\t\t\t$sql=\"SELECT $columns FROM \".$table;\n\n if (!empty($get_args)) {\n\t\t\tif (is_string($get_args[0])) {\n $args_by = '';\n $groupbyset = false; \n $havingset = false; \n $orderbyset = false; \n\t\t\t\tforeach ($get_args as $where_groupby_having_orderby) {\n if (strpos($where_groupby_having_orderby,'WHERE')!==false ) {\n $args_by .= $where_groupby_having_orderby;\n $skipwhere = true;\n } elseif (strpos($where_groupby_having_orderby,'GROUP BY')!==false ) {\n $args_by .= ' '.$where_groupby_having_orderby;\n $groupbyset = true;\n } elseif (strpos($where_groupby_having_orderby,'HAVING')!==false ) {\n if ($groupbyset) {\n $args_by .= ' '.$where_groupby_having_orderby;\n $havingset = true;\n } else {\n $this->setParamaters();\n return false;\n }\n } elseif (strpos($where_groupby_having_orderby,'ORDER BY')!==false ) {\n $args_by .= ' '.$where_groupby_having_orderby; \n $orderbyset = true;\n }\n }\n if ($skipwhere || $groupbyset || $havingset || $orderbyset) {\n $where = $args_by;\n $skipwhere = true;\n }\n\t\t\t}\t\t\n\t\t} else {\n $skipwhere = true;\n } \n \n if (! $skipwhere)\n $where = $this->where( ...$wherekeys);\n \n if (is_string($where)) {\n $sql .= $where;\n if ($getselect_result) \n return (($this->getPrepare()) && !empty($this->getParamaters())) ? $this->get_results($sql, OBJECT, true) : $this->get_results($sql); \n else \n return $sql;\n } else {\n $this->setParamaters();\n return false;\n } \n }", "protected function _sql_select ( /* void */ )\n {\n /*\n Start SQL query.\n */\n $sql = ($this->bDistinct) ? 'SELECT DISTINCT ' : 'SELECT ';\n /*\n Select which fields ?\n */\n $sql .= (empty($this->aFields)) ? '*' : implode(', ', $this->aFields);\n /*\n From which tables ?\n */\n $sql .= (empty($this->aTables)) ? '' : \"\\nFROM \" . implode(', ', $this->aTables);\n /*\n Join something ?\n */\n if (!empty($this->aJoin))\n {\n foreach ($this->aJoin as $j)\n {\n $sql .= \"\\n{$j[0]} JOIN {$j[1]} ON {$j[2]}\";\n }\n }\n /*\n Where ?\n */\n if (!empty($this->aWhere))\n {\n $sql .= \"\\nWHERE \" . implode(\"\\n\", $this->aWhere);\n $sql .= (!empty($this->aLike)) ? implode(\"\\n\", $this->aLike) : '';\n }\n elseif (!empty($this->aLike))\n {\n $sql .= \"\\nWHERE \" . implode(\"\\n\", $this->aLike);\n }\n /*\n Group by ?\n */\n if (!empty($this->aGroupBy))\n {\n $sql .= \"\\nGROUP BY \" . implode(', ', $this->aGroupBy);\n }\n /*\n Having ?\n */\n if (!empty($this->aHaving))\n {\n $sql .= \"\\nHAVING \";\n foreach ($this->aHaving as $i)\n {\n $sql .= \"\\n{$i[0]}{$i[1]} {$i[2]}\";\n }\n }\n /*\n Order by ?\n */\n if (!empty($this->aOrderBy))\n {\n $sql .= \"\\nORDER BY \";\n foreach ($this->aOrderBy as $i)\n {\n $sql .= \"{$i[0]} {$i[1]}, \";\n }\n $sql = trim($sql, ', ');\n }\n /*\n Query limit ?\n */\n if ($this->nLimit !== false)\n {\n if ($this->nOffset !== false)\n {\n $sql .= \"\\nLIMIT \" . $this->nOffset . ', ' . $this->nLimit;\n }\n else\n {\n $sql .= \"\\nLIMIT 0, \" . $this->nLimit;\n }\n }\n /*\n Return SQL.\n */\n return $sql;\n }", "private function isSelectQuery()\n\t{\n\t\treturn sizeof($this->selects) > 0;\n\t}", "public abstract function getSelect(\n $fields, $from, $where = '', $groupby = '', $limit = 0, $offset = 0\n );", "private function Select()\n {\n $return = false;\n $action = $this->Action();\n $columns = $this->Columns();\n $table = $this->Table();\n $where = (Checker::isArray($this->Where(), false))?$this->Where():array(Where::QUERY => \"\", Where::VALUES => array());\n $order = (Checker::isString($this->Order()))?$this->Order():\"\";\n $limit = (Checker::isInt($this->Limit()))?\" LIMIT \".$this->Limit():\"\";\n if($columns && $table && Checker::isArray($where, false))\n {\n $return[Where::QUERY] = \"$action $columns FROM $table\".$where[Where::QUERY].\"$order$limit\";\n\n if(Checker::isArray($where, false) && isset($where[Where::VALUES])) $return[Where::VALUES] = $where[Where::VALUES];\n else $return[Where::VALUES] = array();\n }\n return $return;\n }", "public function processSelect(Builder $query, $results);", "public function testBuildSelectWithFields()\n {\n $query = $this->getQuery()\n ->fields('id', 'name', 'email')\n ;\n\n $this->assertSame(\n 'id, name, email',\n $query->buildSelectFields()\n );\n }", "protected static function buildSelectionQuery() \n {\n return Query::select()->\n from(self::getTableName());\n }", "function testDBSelect() {\r\n\t$db = MetadataDB::getInstance();\r\n\t// error in sql...\r\n\t$sql = 'select varable from metadata';\r\n\t$result = $db->select($sql);\r\n\tif (!$result) {\r\n\t} else {\r\n\t\t//print 'All OK!';\r\n\t}\r\n}", "function select_sql($table='', $fields='*', ...$get_args) {\n\t\t$this->select_result = false;\n return $this->selecting($table, $fields, ...$get_args);\t \n }", "function testDBSelectCorrect() {\r\n\t$db = MetadataDB::getInstance();\r\n\t// error in sql...\r\n\t$sql = 'select variable from metadata';\r\n\t$result = $db->select($sql);\r\n\tif (!$result) {\r\n\t} else {\r\n\t\t//print 'All OK!';\r\n\t}\r\n}", "public function select()\r\n\t{\r\n\t\t$this->clear();\r\n\t\t$where = null;\r\n\t\t// no args, so I'm searching for ALL... or doing a specific search\r\n\t\tif(func_num_args() === 0\r\n\t\t || ($where = call_user_func_array(array($this->obj, 'buildWhere'), func_get_args())))\r\n\t\t{\r\n\t\t\t$query = 'SELECT *\r\n\t\t\t\tFROM '.$this->obj->buildFrom();\r\n\t\t\t// pass args to where generator\r\n\t\t\tif($where)\r\n\t\t\t{\r\n\t\t\t\t$query .= ' WHERE '.$where;\r\n\t\t\t}\r\n\t\t\t$results = $this->site->db->query($query);\r\n\t\t\t$success = ($results->num_rows > 0);\r\n\t\t\twhile($row = $results->fetch_assoc())\r\n\t\t\t{\r\n\t\t\t\t$obj = new $this->obj->__CLASS__($this->obj->site);\r\n\t\t\t\tif($obj->loadRow($row))\r\n\t\t\t\t{\r\n\t\t\t\t\t$this->push($obj);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn $success;\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "protected function _transformQuery()\n {\n if (!$this->_dirty || $this->_type !== 'select') {\n return;\n }\n\n if (empty($this->_parts['from'])) {\n $this->from([$this->_repository->getAlias() => $this->_repository->table()]);\n }\n $this->_addDefaultFields();\n $this->getEagerLoader()->attachAssociations($this, $this->_repository, !$this->_hasFields);\n $this->_addDefaultSelectTypes();\n }", "public function select($fields=null) { if ($fields) $this->fields($fields); return $this->execute($this->get_select()); }", "public function testSelectWithNoParameters()\n {\n $this->db->select(\"test\");\n $this->assertEquals(\"SELECT * FROM test\", (string) $this->db);\n }", "function test_select($urabe, $body)\n{\n $sql = $body->sql_select;\n $result = $urabe->select($sql);\n $result->message = \"Urabe test selection query with default parser\";\n return $result;\n}", "public function fromSelectQuery(\\Yana\\Db\\Queries\\IsSelectQuery $query): string;", "private function _prepare_select_sql($columns,$table){\n $this->debugBacktrace();\n $distinct = $this->distinct; $this->distinct = \"\";\n $sql = \"\";\n switch ($this->queryType){\n case \"select\":\n $sql = \"SELECT \". $distinct . \" \" . $columns .\" FROM \" . $table;\n break;\n case \"count\":\n case \"min\":\n case \"max\":\n case \"sum\":\n $aggregateFunctionName = $this->queryType;\n $sql = \"SELECT \". $aggregateFunctionName .\"(\". $distinct . \" \". $columns .\") as `\". $aggregateFunctionName .\"` FROM \" . $table;\n break;\n }\n \n if(!empty($this->joinClause)){\n $sql .= \" \" . $this->joinClause;\n $this->joinClause = \"\";\n }\n \n if(!empty($this->whereClause)){\n $sql .= \" WHERE \" . $this->whereClause;\n $this->whereClause =\"\";\n }\n \n \n if(!empty($this->groupByClause)){\n $sql .= \" GROUP BY \" . $this->groupByClause;\n $this->groupByClause =\"\";\n }\n \n if(!empty($this->havingClause)){\n $sql .= \" HAVING \" . $this->havingClause;\n $this->havingClause = \"\";\n }\n \n if(!empty($this->orderByClause)){\n $sql .= ' ORDER BY '. $this->orderByClause;\n $this->orderByClause = \"\";\n }\n //LIMIT 10 OFFSET 10\n if($this->selectModifier == \"first\"){\n $sql .= ' LIMIT 1';\n }\n else{\n if($this->takeQuantity > 0){\n $sql .= \" LIMIT \" . $this->takeQuantity;\n }\n }\n \n if($this->skipQuantity>0){\n $sql .= \" OFFSET \" . $this->skipQuantity;\n }\n \n return $sql;\n }", "public function testDecorateQuery_SQL_SelectFields() {\n /* Single field */\n $originalQuery = \"SELECT `emp_firstname`, `emp_lastname` FROM `hs_hr_employee` WHERE `emp_number` = '10'\";\n $expectedQuery = \"SELECT `emp_firstname`, `emp_lastname`, `emp_middle_name` FROM `hs_hr_employee` WHERE `emp_number` = '10'\";\n $resultQuery = $this->baseService->decorateQuery('SampleService_ForSelect', 'sampleMethod1', $originalQuery);\n $this->assertEquals($expectedQuery, $resultQuery);\n\n /* Multiple fields */\n $originalQuery = \"SELECT `emp_firstname`, `emp_lastname` FROM `hs_hr_employee` WHERE `emp_number` = '10'\";\n $expectedQuery = \"SELECT `emp_firstname`, `emp_lastname`, `emp_middle_name`, `job_title_code`, `joined_date` FROM `hs_hr_employee` WHERE `emp_number` = '10'\";\n $resultQuery = $this->baseService->decorateQuery('SampleService_ForSelect', 'sampleMethod2', $originalQuery);\n $this->assertEquals($expectedQuery, $resultQuery);\n\n /* Single field with alias */\n $originalQuery = \"SELECT `emp_firstname`, `emp_lastname` FROM `hs_hr_employee` WHERE `emp_number` = '10'\";\n $expectedQuery = \"SELECT `emp_firstname`, `emp_lastname`, `emp_middle_name` AS `middleName` FROM `hs_hr_employee` WHERE `emp_number` = '10'\";\n $resultQuery = $this->baseService->decorateQuery('SampleService_ForSelect', 'sampleMethod3', $originalQuery);\n $this->assertEquals($expectedQuery, $resultQuery);\n\n /* Multiple fields with aliases */\n $originalQuery = \"SELECT `emp_firstname`, `emp_lastname` FROM `hs_hr_employee` WHERE `emp_number` = '10'\";\n $expectedQuery = \"SELECT `emp_firstname`, `emp_lastname`, `emp_middle_name` AS `middleName`, `job_title_code`, `joined_date` AS `active` FROM `hs_hr_employee` WHERE `emp_number` = '10'\";\n $resultQuery = $this->baseService->decorateQuery('SampleService_ForSelect', 'sampleMethod4', $originalQuery);\n $this->assertEquals($expectedQuery, $resultQuery);\n\n /* Single field with table id */\n\n /* Multiple fields with table ids */\n }", "function querySelect( $query, &$resultContainer )\r\n\t{\r\n\t\t$resultStm = $this->link->query( $query.\";\", PDO::FETCH_CLASS, \"stdclass\" );\r\n\t\treturn $this->_processSelectResult($resultStm, $resultContainer, $query);\r\n\t}", "protected function _authenticateCreateSelect()\n {\n // build credential expression\n if (empty($this->_credentialTreatment)\n || (strpos($this->_credentialTreatment, \"?\") === false)\n ) {\n $this->_credentialTreatment = '?';\n }\n\n $credentialExpression = \n '(CASE WHEN ' . \n $this->_db->escape($this->_credentialColumn, true)\n . ' = ' . $this->_credentialTreatment \n . ' THEN 1 ELSE 0 END) AS '\n . $this->_db->escape('zend_auth_credential_match', true);\n\n // get select\n \n $dbSelect = \"SELECT *, $credentialExpression \" \n . \" FROM \" . $this->_tableName\n . ' WHERE '\n . $this->_db->escape($this->_identityColumn, true) . ' = ?';\n if ($this->_conditionStatement) { \n $dbSelect .= ' AND ' . $this->_conditionStatement;\n }\n return $dbSelect;\n }", "function is_select_statement()\n {\n return isset($this->object->_query_args['is_select']) && $this->object->_query_args['is_select'];\n }", "public function select($table, $fields, $where, $order, $start);", "protected function runSelectWithMeta()\n {\n return $this->connection->selectWithMeta(\n $this->toSql(),\n $this->getBindings(),\n ! $this->useWritePdo\n );\n }", "function select($fields = '*', $fetch_type = \\PDO::FETCH_ASSOC)\n {\n $this->db->table($this->getTableFullName());\n return call_user_func_array([$this->db, __FUNCTION__], func_get_args());\n }", "public function select(Query $query)\n {\n if ($query->getTable() != '') {\n $data = [];\n //\tno prepared allowed\n $fields = $this->buildFields($query);\n //\tprepared allowed\n $joins = $this->buildJoins($query);\n //$data += $Joins['data'];\n //\tprepared allowed\n $wheres = $this->buildWheres($query);\n $data = array_merge($data, $wheres['data']);\n //\tno prepared allowed\n $orders = $this->buildOrders($query);\n //\tno prepared allowed\n $groups = $this->buildGroups($query);\n //\tprepared allowed\n $having = $this->buildHaving($query);\n $data = array_merge($data, $having['data']);\n //\tno prepared allowed\n $limit = $this->buildLimits($query);\n $sql = 'SELECT '.$fields.' FROM '.$query->getTable().$joins.$wheres['placeholders'].$orders.$groups.$having['placeholders'].$limit;\n $stmt = $this->connection->prepare($sql);\n $stmt->execute($data);\n\n return new Collection($stmt->fetchAll());\n }\n\n throw new \\Exception('A table must be selected first');\n }", "public function select(string $query)\n{\n // guardamos lo que venga como parametros en la funcion select\n $this->strquery = $query;\n // preparamos el query\n $result = $this->conexion->prepare($this->strquery);\n $result->execute();\n // se utiliza fetch porque solo devuelve un resultado\n $data = $result->fetch(PDO::FETCH_ASSOC);\n return $data;\n}", "public function select($table_name, $fields = array(), $where = array(), $order_by = '')\r\n {\r\n }", "function exec_SELECTquery($select_fields, $from_table, $where_clause, $groupBy = '', $orderBy = '', $limit = '') {\n\t\t// Added to log select queries\n\t\tforeach($this->preProcessHookObjects as $preProcessHookObject) { /* @var $preProcessHookObject Tx_SandstormmediaPlumber_Hooks_DbPreProcessHookInterface */\n\t\t\t$preProcessHookObject->exec_SELECTquery_preProcessAction($select_fields, $from_table, $where_clause, $groupBy, $orderBy, $limit, $this);\n\t\t}\n\n\t\t$res = parent::exec_SELECTquery($select_fields, $from_table, $where_clause, $groupBy, $orderBy, $limit);\n\n\t\t// Added to log select queries\n\t\tforeach($this->postProcessHookObjects as $postProcessHookObject) { /* @var $postProcessHookObject Tx_SandstormmediaPlumber_Hooks_DbPostProcessHookInterface */\n\t\t\t$postProcessHookObject->exec_SELECTquery_postProcessAction($select_fields, $from_table, $where_clause, $groupBy, $orderBy, $limit, $this);\n\t\t}\n\n\t\treturn $res;\n\t}", "function exec_SELECTquery($select_fields, $from_table, $where_clause, $groupBy = '', $orderBy = '', $limit = '') {\n\t\t// Added to log select queries\n\t\tforeach($this->preProcessHookObjects as $preProcessHookObject) { /* @var $preProcessHookObject Tx_SandstormmediaPlumber_Hooks_DbPreProcessHookInterface */\n\t\t\t$preProcessHookObject->exec_SELECTquery_preProcessAction($select_fields, $from_table, $where_clause, $groupBy, $orderBy, $limit, $this);\n\t\t}\n\n\t\t$res = parent::exec_SELECTquery($select_fields, $from_table, $where_clause, $groupBy, $orderBy, $limit);\n\n\t\t// Added to log select queries\n\t\tforeach($this->postProcessHookObjects as $postProcessHookObject) { /* @var $postProcessHookObject Tx_SandstormmediaPlumber_Hooks_DbPostProcessHookInterface */\n\t\t\t$postProcessHookObject->exec_SELECTquery_postProcessAction($select_fields, $from_table, $where_clause, $groupBy, $orderBy, $limit, $this);\n\t\t}\n\n\t\treturn $res;\n\t}", "abstract protected function initQuery(): void;", "function queryDB($db, $query, $params) {\r\n // Silex will catch the exception\r\n $stmt = $db->prepare($query);\r\n $results = $stmt->execute($params);\r\n $selectpos = stripos($query, \"select\");\r\n if (($selectpos !== false) && ($selectpos < 6)) {\r\n $results = $stmt->fetchAll();\r\n }\r\n return $results;\r\n}", "public function testSelectWithNullFieldParameter()\n {\n $this->db->select(\"test\", new DBField());\n $this->assertEquals(\"SELECT * FROM test\", (string) $this->db);\n }", "abstract protected function _query($sql);", "public function testBuildSelectFieldsEmpty()\n {\n $query = $this->getQuery();\n\n $this->assertSame(\n '*',\n $query->buildSelectFields()\n );\n }", "public function testInitialSelectStatement()\n {\n $method = $this->builder_reflection->getMethod('sql_select_statement');\n $method->setAccessible(TRUE);\n\n $property = $this->builder_reflection->getProperty('select_statement');\n $property->setAccessible(TRUE);\n\n $method->invokeArgs($this->builder, array('SELECT * FROM table1'));\n\n $string = 'SELECT * FROM table1';\n\n $this->assertEquals($string, $property->getValue($this->builder));\n }", "public function Select($cond)\r\n\t\r\n {\r\n\t\tglobal $db;\r\n if($cond==\"\")\r\n {\r\n $sql = \"SELECT * FROM \".$this->TableName;\r\n } else\r\n {\t\r\n\t\t \t\r\n\t\t $sql = \"SELECT * FROM \". $this->TableName.\" \".$cond;\r\n }\r\n try{\r\n $query = $db->prepare($sql);\r\n $query->execute();\r\n $arr['rows'] = $query->fetchAll(PDO::FETCH_ASSOC);\r\n $arr['err'] = false;\r\n } catch(PDOException $e){\r\n $arr['err'] = true;\r\n $arr['msg'] = $e->getMessage(); \r\n } \r\n return $arr;\r\n }", "function Select($table, $fields, $where, $limit = false, $where_type = 'AND')\n\t{\n\t\t$where = $this->QueryWhereGenerate($where);\n\t\t\n\t\t$fields_query = '';\n\t\t$where_query = '';\n\t\t\n\t\tif (strstr($fields, ','))\n\t\t{\n\t\t\t$fields_array = explode(',', $fields);\n\t\t\t\n\t\t\tforeach ($fields_array AS $field)\n\t\t\t{\n\t\t\t\t$fields_query .= ', `' . trim($field) . '`';\n\t\t\t}\n\t\t\t\n\t\t\t$fields_query = substr($fields_query, 1);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif ($fields == '*')\n\t\t\t{\n\t\t\t\t$fields_query = $fields;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$fields_query = '`' . $fields . '`';\n\t\t\t}\n\t\t}\n\t\t\n\t\tforeach ($where AS $key => $value)\n\t\t{\n\t\t\t$where_query .= ' ' . $where_type. \" `\" . $key . \"` \" . $value;\n\t\t}\n\t\t\n\t\tif ($limit)\n\t\t{\n\t\t\treturn $this->RunQuery(\"SELECT \" . $fields_query . \" FROM `\" . $table . \"` WHERE \" . substr($where_query, strlen($where_type) + 1) . ' LIMIT ' . $limit);\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn $this->RunQuery(\"SELECT \" . $fields_query . \" FROM `\" . $table . \"` WHERE \" . substr($where_query, strlen($where_type) + 1));\n\t\t}\n\t}", "public function testSelectInstance() {\r\n $this->assertInstanceOf('\\PM\\Main\\Database\\Select', $this->_instance->select());\r\n }", "protected function RetSelect() {\n\n $return = \"SELECT\";\n\n if ($this->\n distinct) {\n\n $return .= \" DISTINCT\";\n }\n\n $columnsArr = [];\n\n foreach ($this->\n columns as $key => $value) {\n\n if (is_string($value)) {\n\n $columnsArr[] = $value;\n } else if (isset($value['subquery']) &&\n $value['subquery'] instanceof \\FluitoPHP\\Database\\DBQueryHelper &&\n $value['subquery']->\n IsSelect()) {\n\n $columnsArr[] = \"(\" . $value['subquery']->\n Generate() . \")\" . (isset($value['label']) &&\n is_string($value['label']) ? \" AS \\\"{$value['label']}\\\"\" : \"\");\n } else if (isset($value['value'])) {\n\n $columnsArr[] = \"'{$value['value']}'\" . (isset($value['label']) &&\n is_string($value['label']) ? \" AS \\\"{$value['label']}\\\"\" : \"\");\n } else {\n\n $columnsArr[] = \"{$value['column']}\" . (isset($value['label']) &&\n is_string($value['label']) ? \" AS \\\"{$value['label']}\\\"\" : \"\");\n }\n }\n\n if (count($columnsArr)) {\n\n $return .= \" \" . implode($columnsArr, \", \");\n } else {\n\n $return .= \" *\";\n }\n\n\n $tablesStr = \"\";\n\n foreach ($this->\n tables as $key => $value) {\n\n if (is_string($value)) {\n\n $tablesStr .= \", $value\";\n } else {\n\n if (!(isset($value['table']) &&\n $value['table'] != \"\") &&\n isset($value['subquery']) &&\n $value['subquery'] instanceof \\FluitoPHP\\Database\\DBQueryHelper &&\n $value['subquery']->\n IsSelect()) {\n\n $value['table'] = \"(\" . rtrim($value['subquery']->\n Generate(), ';') . \")\";\n\n if (!isset($value['alias'])) {\n\n throw new \\Exception(\"Error: Alias required in case of subquery to be used in from clause.\");\n }\n } else {\n\n $value['table'] = \"{$value['table']}\";\n }\n\n if (isset($value['alias'])) {\n\n $value['alias'] = \"`{$value['alias']}`\";\n }\n\n if (!isset($value['table']) ||\n $value['table'] == \"\") {\n\n throw new \\Exception(\"Error: Tables not properly provided in QueryHelper.\");\n }\n\n if (!isset($value['jointype'])) {\n\n $tablesStr .= \", \" . $value['table'];\n\n if (isset($value['alias'])) {\n\n $tablesStr .= \" AS \" . $value['alias'];\n }\n } else {\n\n switch ($value['jointype']) {\n case 'j':\n\n $tablesStr .= \" JOIN \" . $value['table'];\n break;\n\n case 'ij':\n\n $tablesStr .= \" INNER JOIN \" . $value['table'];\n break;\n\n case 'cj':\n\n $tablesStr .= \" CROSS JOIN \" . $value['table'];\n break;\n\n case 'sj':\n\n $tablesStr .= \" STRAIGHT_JOIN \" . $value['table'];\n break;\n\n case 'lj':\n\n $tablesStr .= \" LEFT JOIN \" . $value['table'];\n break;\n\n case 'rj':\n\n $tablesStr .= \" RIGHT JOIN \" . $value['table'];\n break;\n\n case 'nj':\n\n $tablesStr .= \" NATURAL JOIN \" . $value['table'];\n break;\n\n case 'nlj':\n\n $tablesStr .= \" NATURAL LEFT JOIN \" . $value['table'];\n break;\n\n case 'nrj':\n\n $tablesStr .= \" NATURAL RIGHT JOIN \" . $value['table'];\n break;\n\n case 'loj':\n\n $tablesStr .= \" LEFT OUTER JOIN \" . $value['table'];\n break;\n\n case 'roj':\n\n $tablesStr .= \" RIGHT OUTER JOIN \" . $value['table'];\n break;\n\n case 'nloj':\n\n $tablesStr .= \" NATURAL LEFT OUTER JOIN \" . $value['table'];\n break;\n\n case 'nroj':\n\n $tablesStr .= \" NATURAL RIGHT OUTER JOIN \" . $value['table'];\n break;\n\n default:\n break;\n }\n\n if (isset($value['alias'])) {\n\n $tablesStr .= \" AS \" . $value['alias'];\n }\n\n if (isset($value['joinconditions']) &&\n count($value['joinconditions'])) {\n\n $tablesStr .= $this->\n WhereClause($value['joinconditions'], 1);\n }\n }\n }\n }\n\n $return .= \" FROM \" . ltrim($tablesStr, \", \");\n\n\n if (count($this->\n where)) {\n\n $return .= $this->\n WhereClause($this->\n where);\n }\n\n\n $groupsArr = [];\n\n foreach ($this->\n group as $key => $value) {\n\n if (is_string($value)) {\n\n $groupsArr[] = \"{$value}\";\n } else if (isset($value['subquery']) &&\n $value['subquery'] instanceof \\FluitoPHP\\Database\\DBQueryHelper &&\n $value['subquery']->\n IsSelect()) {\n\n $groupsArr[] = \"(\" . rtrim($value['subquery']->\n Generate(), ';') . \")\";\n } else if (isset($value['value'])) {\n\n $value['value'] = $this->\n connection->\n GetConn()->\n real_escape_string($value['value']);\n $groupsArr[] = \"'{$value['value']}'\";\n } else {\n\n $groupsArr[] = \"{$value['column']}\";\n }\n }\n\n if (count($groupsArr)) {\n\n $return .= \" GROUP BY \" . implode($groupsArr, \", \");\n }\n\n\n if (count($this->\n having)) {\n\n $return .= $this->\n WhereClause($this->\n having, 2);\n }\n\n\n $ordersArr = [];\n\n foreach ($this->\n order as $key => $value) {\n\n if (is_string($value)) {\n\n $ordersArr[] = $value;\n } else if (isset($value['subquery']) &&\n $value['subquery'] instanceof \\FluitoPHP\\Database\\DBQueryHelper &&\n $value['subquery']->\n IsSelect()) {\n\n $ordersArr[] = \"(\" . rtrim($value['subquery']->\n Generate(), ';') . \")\" . (isset($value['type']) &&\n $value['type'] == 'd' ? \" DESC\" : \"\");\n } else if (isset($value['value'])) {\n\n $ordersArr[] = \"'{$value['value']}'\" . (isset($value['type']) &&\n $value['type'] == 'd' ? \" DESC\" : \"\");\n } else {\n\n $ordersArr[] = \"{$value['column']}\" . (isset($value['type']) &&\n $value['type'] == 'd' ? \" DESC\" : \"\");\n }\n }\n\n if (count($ordersArr)) {\n\n $return .= \" ORDER BY \" . implode($ordersArr, \", \");\n }\n\n if ($this->\n perpage > 0) {\n\n if ($this->\n page < 1) {\n\n $this->\n page = 1;\n }\n\n $startcount = $this->\n perpage * ($this->\n page - 1);\n\n $return .= \" LIMIT {$startcount}, {$this->\n perpage}\";\n }\n\n return $return . \";\";\n }", "public function getSQL($param=false){\n\t\t\tswitch( $name = $this->obtenerDato(\"name\") ){\n\t\t\t\t// Los campos modelfield::$specials los ponemos en código\n\t\t\t\t// Debemos refactorizar esto con algo mas de tiempo\n\t\t\t\tcase \"estado_contratacion\":\n\t\t\t\t\t$sql = \"( -- empresas validas\n\t\t\t\t\t\t\tn1 IN (<%empresasvalidas%>)\n\t\t\t\t\t\tAND if(n2 IS NULL OR !n2, 1, n2 IN (<%empresasvalidas%>) )\n\t\t\t\t\t\tAND if(n3 IS NULL OR !n3, 1, n3 IN (<%empresasvalidas%>) )\n\t\t\t\t\t\tAND if(n4 IS NULL OR !n4, 1, n4 IN (<%empresasvalidas%>) )\n\t\t\t\t\t)\";\n\n\t\t\t\t\treturn $sqlFinal = \"(SELECT if(($sql), 'Valido', 'No Valido'))\";\n\t\t\t\tbreak;\n\t\t\t\tcase \"cadena_contratacion_cumplimentada\":\n\t\t\t\t\t$sql = \"( -- empresas cumplimentadas\n\t\t\t\t\t\t\tn1 IN (<%empresacumplimentadas%>)\n\t\t\t\t\t\tAND if(n2 IS NULL OR !n2, 1, n2 IN (<%empresacumplimentadas%>) )\n\t\t\t\t\t\tAND if(n3 IS NULL OR !n3, 1, n3 IN (<%empresacumplimentadas%>) )\n\t\t\t\t\t\tAND if(n4 IS NULL OR !n4, 1, n4 IN (<%empresacumplimentadas%>) )\n\t\t\t\t\t)\";\n\n\t\t\t\t\treturn $sqlFinal = \"(SELECT if(($sql), 'Si', 'No'))\";\n\t\t\t\tbreak;\n\t\t\t\tcase 'asignado_en_conjunto_de_agrupadores': case 'valido_conjunto_agrupadores': \n\t\t\t\t// case 'valido_conjunto_agrupadores_asignados':\n\t\t\t\tcase 'valido_conjunto_agrupadores_seleccionados':\n\t\t\t\tcase 'valido_conjunto_agrupadores_solo_asignados':\n\t\t\t\t\tif( $param instanceof ArrayObjectList && $sql = trim($this->obtenerDato(\"sql\")) ){\n\t\t\t\t\t\t$subsql = array();\n\t\t\t\t\t\tforeach ($param as $item) {\n\t\t\t\t\t\t\t$subsql[] = \"((\". str_replace('%s', $item->getUID(), $sql) .\") = 1)\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn $sql = '( IF( '.implode(' AND ',$subsql) .',\\'Si\\',\\'No\\') )';\n\t\t\t\t\t}\n\n\t\t\t\tbreak;\n\t\t\t\tcase 'valido_algun_agrupador': \n\t\t\t\t\tif( $param instanceof ArrayObjectList && $sql = trim($this->obtenerDato(\"sql\")) ){\n\t\t\t\t\t\tforeach($param as $item) {\n\t\t\t\t\t\t\t$subsql[] = \"((\". str_replace('%s', $item->getUID(), $sql) .\") = 1)\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn $sql = '( IF( '.implode(' OR ',$subsql) .',\\'Si\\',\\'No\\') )';\n\t\t\t\t\t} \n\t\t\t\tbreak;\n\t\t\t\tcase 'mostrar_agrupador_asignado': case 'trabajos': case 'codigo_agrupador_valido':\n\t\t\t\t\tif( $param instanceof ArrayObjectList && $sql = trim($this->obtenerDato(\"sql\")) ){\n\t\t\t\t\t\treturn str_replace('%s', $param->toComaList() ,$sql);\n\t\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tif( $sql = trim($this->obtenerDato(\"sql\")) ){\n\t\t\t\t\t\tif( $param instanceof Ielemento ) $param = $param->getUID();\n\t\t\t\t\t\tif( $param ) $sql = str_replace(\"%s\", $param, $sql);\n\t\t\t\t\t\treturn $sql;\n\t\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\treturn false;\n\t\t}", "public function select($fields);", "protected function prepareQuery($query) {}", "public function select($query, $bindings = []);", "public function select($query, $bindings = []);", "public function select($query, $bindings = []);", "protected function Select($sql) { \n if ((empty($sql)) || (!eregi(\"^select\",$sql)) || (empty($this->CONNECTION))) { \n $this->ERROR_MSG = \"\\r\\n\" . \"SQL Statement is <code>null</code> or not a SELECT - \" . date('H:i:s'); \n $this->debug(); \n return false; \n } else { \n $conn = $this->CONNECTION; \n $results = mysql_query($sql,$conn); \n if ((!$results) || (empty($results))) { \n $this->ERROR_MSG = \"\\r\\n\" . mysql_error().\" - \" . date('H:i:s'); \n $this->debug(); \n return false; \n } else { \n// $i = 0; \n// $data = array(); \n// while ($row = mysql_fetch_array($results)) { \n// $data[$i] = $row; \n// $i++; \n// } \n// mysql_free_result($results); \n// return $data; \n return $results;\n } \n } \n }", "public function performSelectTypeAnalysis() {\n\t\t$infos = array(\n\t\t\t'SIMPLE' => 'Simple SELECT (not using UNION or subqueries)',\n\t\t\t'PRIMARY' => 'Outermost SELECT',\n\t\t\t'UNION' => 'Second or later SELECT statement in a UNION',\n\t\t\t'DEPENDENT' => 'UNION\tSecond or later SELECT statement in a UNION, dependent on outer query',\n\t\t\t'UNION RESULT' => 'Result of a UNION.',\n\t\t\t'SUBQUERY' => 'First SELECT in subquery',\n\t\t\t'DEPENDENT SUBQUERY' => 'First SELECT in subquery, dependent on outer query',\n\t\t\t'DERIVED' => 'Derived table SELECT (subquery in FROM clause)',\n\t\t\t'MATERIALIZED' => 'Materialized subquery',\n\t\t\t'UNCACHEABLE SUBQUERY' => 'A subquery for which the result cannot be cached and must be re-evaluated for each row of the outer query',\n\t\t\t'UNCACHEABLE UNION' => 'The second or later select in a UNION that belongs to an uncacheable subquery (see UNCACHEABLE SUBQUERY)'\n\t\t);\n\t\t$this->cells['select_type']->info = $infos[$this->cells['select_type']->v];\n\t}", "private function makeSelectAndFrom()\r\n\t{\r\n\t\t// Build SQL\r\n\t\t$sql = 'SELECT ';\r\n\t\r\n\t\t// Add custom fields (subqueries)\r\n\t\tif ($this->hasCustomFields())\r\n\t\t{\r\n\t\t\t// Find custom fields\r\n\t\t\tforeach ($this->fields as $field)\r\n\t\t\t{\r\n\t\t\t\tif ($field instanceOf CustomField)\r\n\t\t\t\t{\r\n\t\t\t\t\t$sql .= '(' . $field->query . ') AS `' . $field->name . '`, ';\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\r\n\t\tif (!$this->hasForeignFields())\r\n\t\t{\r\n\t\t\tif (isset($this->selectFields))\r\n\t\t\t{\r\n\t\t\t\t// Use custom field selection\r\n\t\t\t\t$sql .= implode(', ', $this->selectFields) . ' ';\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t// Take all fields\r\n\t\t\t\t$sql .= '`'.$this->name.'`.* ';\r\n\t\t\t}\r\n\t\t\t\t\r\n\t\t\t$sql .= 'FROM `'.$this->name.'` ';\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t// Get foreign fields\r\n\t\t\t$cols = array();\r\n\t\r\n\t\t\tif (isset($this->selectFields))\r\n\t\t\t{\r\n\t\t\t\t// Use custom field selection\r\n\t\t\t\tforeach ($this->selectFields as $field)\r\n\t\t\t\t{\r\n\t\t\t\t\t$cols[] = $field;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t// Take all fields\r\n\t\t\t\t$cols[] = 't1.*';\r\n\t\t\t}\r\n\t\r\n\t\t\t$from_sql = 'FROM `'.$this->name.'` t1 ';\r\n\t\t\t$joined = array();\r\n\t\t\t$joins = array();\r\n\t\t\t$alias_no = 2;\r\n\t\t\t$tables[] = array('table' => $this->name, 'alias' => 't1');\r\n\t\r\n\t\t\t// Iterate over fields\r\n\t\t\tforeach ($this->fields as &$field)\r\n\t\t\t{\r\n\t\t\t\t$use_alias = false;\r\n\t\r\n\t\t\t\tif ($field instanceof ForeignField)\r\n\t\t\t\t{\r\n\t\t\t\t\t// Check if foreign field should be included, if select fields were set\r\n\t\t\t\t\tif (isset($this->selectFields))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$found = false;\r\n\t\t\t\t\t\tforeach ($this->selectFields as $sel_field)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tif (str_contains($sel_field, $field->name))\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t$found = true;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (!$found)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\r\n\t\t\t\t\t// Find out what kind of join it should be (INNER or LEFT)\r\n\t\t\t\t\t$join_type = strtoupper($field->joinType);\r\n\t\r\n\t\t\t\t\t// Check if it's a join between two foreign tables\r\n\t\t\t\t\tif ($field->joinFromTable == null)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t// Join between this table and other table\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t// Check if we need to make a new join\r\n\t\t\t\t\t\t$this_join = array(\r\n\t\t\t\t\t\t\t'from_table' => $this->name, \r\n\t\t\t\t\t\t\t'to_table' => $field->table,\r\n\t\t\t\t\t\t\t'from' => $field->joinFrom, \r\n\t\t\t\t\t\t\t'to' => $field->joinTo\r\n\t\t\t\t\t\t);\r\n\t\t\t\t\t\tif (!$this->CheckJoinExists($this_join, $joins))\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$from_sql .= $join_type.' JOIN `'.$field->table .'` t'.$alias_no.' ON t1.`'.$field->joinFrom.'` = t'.$alias_no.'.`'.$field->joinTo.'` ';\r\n\t\t\t\t\t\t\t$joins[] = $this_join;\r\n\t\t\t\t\t\t\t$use_alias = true;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t// Join between two other tables\r\n\t\r\n\t\t\t\t\t\t// Check if we need to make a new join\r\n\t\t\t\t\t\t$this_join = array(\r\n\t\t\t\t\t\t\t'from_table' \t=> $this->table_name, \r\n\t\t\t\t\t\t\t'to_table' \t\t=> $field->foreign_field->table,\r\n\t\t\t\t\t\t\t'from' \t\t\t=> $field->foreign_field->join_from, \r\n\t\t\t\t\t\t\t'to' \t\t\t=> $field->foreign_field->join_to\r\n\t\t\t\t\t\t);\r\n\t\t\t\t\t\tif (!$this->checkJoinExists($this_join, $joins)) \r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tif (($alias = $this->tableHasAlias($field->table, $tables)) !== false) \r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t$from_sql .= $join_type.' JOIN `'.$field->table.'` t'.$alias_no.' ON '.$alias.'.`'.$field->joinFrom.'` = t'.$alias_no.'.`'.$field->joinTo.'` ';\r\n\t\t\t\t\t\t\t} \r\n\t\t\t\t\t\t\telse \r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t$from_sql .= $join_type.' JOIN `'.$field->table.'` t'.$alias_no.' ON `'.$field->joinFromTable.'`.`'.$field->joinFrom.'` = t'.$alias_no.'.`'.$field->joinTo.'` ';\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t$joins[] = $this_join;\r\n\t\t\t\t\t\t\t$use_alias = true;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\r\n\t\t\t\t\tif ($use_alias)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$cols[] = 't'.$alias_no.'.`'.$field->foreignFieldName .'` AS `'.$field->name.'`';\r\n\t\t\t\t\t\t$tables[] = array('table' => $field->table, 'alias' => 't'.$alias_no);\r\n\t\t\t\t\t\t$alias_no++;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t// Check if table has alias\r\n\t\t\t\t\t\tif (($alias = $this->tableHasAlias($field->table, $tables)) !== false)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$cols[] = $alias.'.`'.$field->foreignFieldName.'` AS `'.$field->name .'`';\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$cols[] = '`'.$field->table.'`.`'.$field->foreignFieldName.'` AS `'.$field->name.'`';\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$this->tableAliases = $tables;\r\n\t\r\n\t\t\t$sql .= implode(', ', $cols).' '.$from_sql;\r\n\t\r\n\t\t\t$this->table_aliases = $tables;\r\n\t\t}\r\n\t\r\n\t\treturn $sql;\r\n\t}", "function adv_select($table, array $where = null, array $fields = null, $order = '', $limit = null, $offset = null);", "function selectResult($table,$field,$where) {\n\t\tif($where!='')\n\t\t\t$where= ' WHERE '.$where;\n \t$query = \"SELECT \".$field.\"\n \t FROM \".$this->tablePrefix .$table.$where ;\n\t\t//echo $query;//exit;\n $res = $this->execute($query);\n \treturn $this->fetchAll($res);\n }", "function BDDselect($sql, $param){\n $bdd = BDDopen();\n $req = $bdd->prepare($sql);\n if($req->execute($param) === FALSE){\n echo 'Errore de la requette';\n print_r($param);\n }\n return $req;\n}", "public function _select ($table, $fields_array = array(), $where_params_array = array(), $order_array = array(), $limit = null, $offset = null)\n {\n // if not set a wildcard to return everything\n if ( !empty ($fields_array) )\n {\n\n $fields = implode (', ', $fields_array);\n }\n else\n {\n\n $fields = '*';\n }\n\n // create the basic query\n $query = \"\n\t\tSELECT {$fields}\n\t\tFROM {$table}\n\t\t\";\n\n $bind_params_array = array();\n\n // if there are any WHERE parameters then add them to the query and the bind params array\n if ( !empty ($where_params_array) )\n {\n\n $query .= \"WHERE\n \";\n $count = 0;\n foreach ($where_params_array as $key => $value) {\n\n $bind_params_array[$count] = $value;\n\n if ( $count > 0 )\n {\n $query .= \" AND \";\n }\n $query .= \"`{$key}` = ?\n \";\n $count++;\n }\n }\n\n // if an order by setting has been received then add it to the query\n if ( !empty ($order_array) )\n {\n\n $query.= \"ORDER BY\n \";\n foreach ($order_array as $key => $value) {\n\n $query.= \"{$key} {$value},\n \";\n }\n $query = rtrim (trim ($query), ',');\n }\n\n // if an LIMIT setting has been received then add it to the query\n if ( is_numeric ($limit) )\n {\n $query.= \"\n LIMIT {$limit}\n \";\n }\n\n // if an OFFSET setting has been received then add it to the query\n if ( $limit !== null && $offset != null )\n {\n if ( !is_int ($offset) )\n {\n\n throw new Exception ('Non integer passed to function as OFFSET value');\n return false;\n }\n\n $query.= \"\n OFFSET {$offset}\n \";\n }\n\n return $this->queryDatabase ($query, $bind_params_array, true);\n }", "private function _createSQLSelect(array $params){\n\t\t$select = 'SELECT ';\n\t\tif(isset($params['columns'])){\n\t\t\t$this->clear();\n\t\t\t$select.= $params['columns'];\n\t\t} else {\n\t\t\t$select.= join(', ', $this->_getAttributes());\n\t\t}\n\t\tif($this->_schema){\n\t\t\t$select.= ' FROM '.$this->_schema.'.'.$this->_source;\n\t\t} else {\n\t\t\t$select.= ' FROM '.$this->_source;\n\t\t}\n\t\t$return = 'n';\n\t\t$primaryKeys = $this->_getPrimaryKeyAttributes();\n\t\tif(isset($params['conditions'])&&$params['conditions']){\n\t\t\t$select.= ' WHERE '.$params['conditions'].' ';\n\t\t} else {\n\t\t\tif(!isset($primaryKeys[0])){\n\t\t\t\tif($this->isView==true){\n\t\t\t\t\t$primaryKeys[0] = 'id';\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(isset($params[0])){\n\t\t\t\tif(is_numeric($params[0])){\n\t\t\t\t\tif(isset($primaryKeys[0])){\n\t\t\t\t\t\t$params['conditions'] = $primaryKeys[0].' = '.$this->_db->addQuotes($params[0]);\n\t\t\t\t\t\t$return = '1';\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthrow new ActiveRecordException('No se ha definido una llave primaria para este objeto');\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif($params[0]===''){\n\t\t\t\t\t\tif(isset($primaryKeys[0])){\n\t\t\t\t\t\t\t$params['conditions'] = $primaryKeys[0].\" = ''\";\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tthrow new ActiveRecordException('No se ha definido una llave primaria para este objeto');\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$params['conditions'] = $params[0];\n\t\t\t\t\t}\n\t\t\t\t\t$return = 'n';\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(isset($params['conditions'])){\n\t\t\t\t$select.= ' WHERE '.$params['conditions'];\n\t\t\t}\n\t\t}\n\t\tif(isset($params['group'])&&$params['group']) {\n\t\t\t$select.= ' GROUP BY '.$params['group'];\n\t\t}\n\t\tif(isset($params['order'])&&$params['order']) {\n\t\t\t$select.= ' ORDER BY '.$params['order'];\n\t\t}\n\t\tif(isset($params['limit'])&&$params['limit']) {\n\t\t\t$select = $this->_limit($select, $params['limit']);\n\t\t}\n\t\tif(isset($params['for_update'])&&$params['for_update']==true){\n\t\t\t$select = $this->_db->forUpdate($select);\n\t\t}\n\t\tif(isset($params['shared_lock'])&&$params['shared_lock']==true){\n\t\t\t$select = $this->_db->sharedLock($select);\n\t\t}\n\t\treturn array('return' => $return, 'sql' => $select);\n\t}", "public function select()\n\t{\n\t\treturn call_user_func_array([$this->queryFactory->__invoke('select'), 'select'], func_get_args());\n\t}", "public function selectQuery(){\n try {\n // Sparql11query.g:43:3: ( SELECT ( DISTINCT | REDUCED )? ( ( variable )+ | ASTERISK ) ( datasetClause )* whereClause solutionModifier ) \n // Sparql11query.g:44:3: SELECT ( DISTINCT | REDUCED )? ( ( variable )+ | ASTERISK ) ( datasetClause )* whereClause solutionModifier \n {\n $this->match($this->input,$this->getToken('SELECT'),self::$FOLLOW_SELECT_in_selectQuery142); \n // Sparql11query.g:45:3: ( DISTINCT | REDUCED )? \n $alt4=2;\n $LA4_0 = $this->input->LA(1);\n\n if ( (($LA4_0>=$this->getToken('DISTINCT') && $LA4_0<=$this->getToken('REDUCED'))) ) {\n $alt4=1;\n }\n switch ($alt4) {\n case 1 :\n // Sparql11query.g: \n {\n if ( ($this->input->LA(1)>=$this->getToken('DISTINCT') && $this->input->LA(1)<=$this->getToken('REDUCED')) ) {\n $this->input->consume();\n $this->state->errorRecovery=false;\n }\n else {\n $mse = new MismatchedSetException(null,$this->input);\n throw $mse;\n }\n\n\n }\n break;\n\n }\n\n // Sparql11query.g:49:3: ( ( variable )+ | ASTERISK ) \n $alt6=2;\n $LA6_0 = $this->input->LA(1);\n\n if ( (($LA6_0>=$this->getToken('VAR1') && $LA6_0<=$this->getToken('VAR2'))) ) {\n $alt6=1;\n }\n else if ( ($LA6_0==$this->getToken('ASTERISK')) ) {\n $alt6=2;\n }\n else {\n $nvae = new NoViableAltException(\"\", 6, 0, $this->input);\n\n throw $nvae;\n }\n switch ($alt6) {\n case 1 :\n // Sparql11query.g:50:5: ( variable )+ \n {\n // Sparql11query.g:50:5: ( variable )+ \n $cnt5=0;\n //loop5:\n do {\n $alt5=2;\n $LA5_0 = $this->input->LA(1);\n\n if ( (($LA5_0>=$this->getToken('VAR1') && $LA5_0<=$this->getToken('VAR2'))) ) {\n $alt5=1;\n }\n\n\n switch ($alt5) {\n \tcase 1 :\n \t // Sparql11query.g:50:5: variable \n \t {\n \t $this->pushFollow(self::$FOLLOW_variable_in_selectQuery175);\n \t $this->variable();\n\n \t $this->state->_fsp--;\n\n\n \t }\n \t break;\n\n \tdefault :\n \t if ( $cnt5 >= 1 ) break 2;//loop5;\n $eee =\n new EarlyExitException(5, $this->input);\n throw $eee;\n }\n $cnt5++;\n } while (true);\n\n\n }\n break;\n case 2 :\n // Sparql11query.g:51:7: ASTERISK \n {\n $this->match($this->input,$this->getToken('ASTERISK'),self::$FOLLOW_ASTERISK_in_selectQuery184); \n\n }\n break;\n\n }\n\n // Sparql11query.g:53:3: ( datasetClause )* \n //loop7:\n do {\n $alt7=2;\n $LA7_0 = $this->input->LA(1);\n\n if ( ($LA7_0==$this->getToken('FROM')) ) {\n $alt7=1;\n }\n\n\n switch ($alt7) {\n \tcase 1 :\n \t // Sparql11query.g:53:3: datasetClause \n \t {\n \t $this->pushFollow(self::$FOLLOW_datasetClause_in_selectQuery192);\n \t $this->datasetClause();\n\n \t $this->state->_fsp--;\n\n\n \t }\n \t break;\n\n \tdefault :\n \t break 2;//loop7;\n }\n } while (true);\n\n $this->pushFollow(self::$FOLLOW_whereClause_in_selectQuery195);\n $this->whereClause();\n\n $this->state->_fsp--;\n\n $this->pushFollow(self::$FOLLOW_solutionModifier_in_selectQuery197);\n $this->solutionModifier();\n\n $this->state->_fsp--;\n\n\n }\n\n }\n catch (RecognitionException $re) {\n $this->reportError($re);\n $this->recover($this->input,$re);\n }\n catch(Exception $e) {\n throw $e;\n }\n \n return ;\n }", "public function walkSelectStatement(SelectStatement $AST): void\n {\n $query = $this->_getQuery();\n $queriedValue = $query->getHint(self::HINT_PAGINATOR_FILTER_VALUE);\n $columns = $query->getHint(self::HINT_PAGINATOR_FILTER_COLUMNS);\n $filterCaseInsensitive = $query->getHint(self::HINT_PAGINATOR_FILTER_CASE_INSENSITIVE);\n $components = $this->getQueryComponents();\n $filterExpressions = [];\n $expressions = [];\n foreach ($columns as $column) {\n $alias = false;\n $parts = explode('.', $column, 2);\n $field = end($parts);\n if (2 <= count($parts)) {\n $alias = trim(reset($parts));\n if (!array_key_exists($alias, $components)) {\n throw new InvalidValueException(\"There is no component aliased by [$alias] in the given Query\");\n }\n $meta = $components[$alias];\n if (!$meta['metadata']->hasField($field)) {\n throw new InvalidValueException(\"There is no such field [$field] in the given Query component, aliased by [$alias]\");\n }\n $pathExpression = new PathExpression(PathExpression::TYPE_STATE_FIELD, $alias, $field);\n $pathExpression->type = PathExpression::TYPE_STATE_FIELD;\n } else {\n if (!array_key_exists($field, $components)) {\n throw new InvalidValueException(\"There is no component field [$field] in the given Query\");\n }\n $pathExpression = $components[$field]['resultVariable'];\n }\n $expression = new ConditionalPrimary();\n if (isset($meta) && $meta['metadata']->getTypeOfField($field) === 'boolean') {\n if (in_array(strtolower($queriedValue), ['true', 'false'])) {\n $expression->simpleConditionalExpression = new ComparisonExpression($pathExpression, '=', new Literal(Literal::BOOLEAN, $queriedValue));\n } elseif (is_numeric($queriedValue)) {\n $expression->simpleConditionalExpression = new ComparisonExpression($pathExpression, '=', new Literal(Literal::BOOLEAN, $queriedValue == '1' ? 'true' : 'false'));\n } else {\n continue;\n }\n unset($meta);\n } elseif (is_numeric($queriedValue)\n && (\n !isset($meta)\n || in_array(\n $meta['metadata']->getTypeOfField($field),\n [\n Type::SMALLINT,\n Type::INTEGER,\n Type::BIGINT,\n Type::FLOAT,\n Type::DECIMAL,\n ],\n true\n )\n )\n ) {\n $expression->simpleConditionalExpression = new ComparisonExpression($pathExpression, '=', new Literal(Literal::NUMERIC, $queriedValue));\n } else {\n $likePathExpression = $pathExpression;\n $likeQueriedValue = $queriedValue;\n\n if ($filterCaseInsensitive) {\n $lower = new LowerFunction('lower');\n $lower->stringPrimary = $pathExpression;\n $likePathExpression = $lower;\n $likeQueriedValue = strtolower($queriedValue);\n }\n\n $expression->simpleConditionalExpression = new LikeExpression($likePathExpression, new Literal(Literal::STRING, $likeQueriedValue));\n }\n $filterExpressions[] = $expression->simpleConditionalExpression;\n $expressions[] = $expression;\n }\n if (count($expressions) > 1) {\n $conditionalPrimary = new ConditionalExpression($expressions);\n } elseif (count($expressions) > 0) {\n $conditionalPrimary = reset($expressions);\n } else {\n return;\n }\n if ($AST->whereClause) {\n if ($AST->whereClause->conditionalExpression instanceof ConditionalTerm) {\n if (!$this->termContainsFilter($AST->whereClause->conditionalExpression, $filterExpressions)) {\n array_unshift(\n $AST->whereClause->conditionalExpression->conditionalFactors,\n $this->createPrimaryFromNode($conditionalPrimary)\n );\n }\n } elseif ($AST->whereClause->conditionalExpression instanceof ConditionalPrimary) {\n if (!$this->primaryContainsFilter($AST->whereClause->conditionalExpression, $filterExpressions)) {\n $AST->whereClause->conditionalExpression = new ConditionalTerm([\n $this->createPrimaryFromNode($conditionalPrimary),\n $AST->whereClause->conditionalExpression,\n ]);\n }\n } elseif ($AST->whereClause->conditionalExpression instanceof ConditionalExpression) {\n if (!$this->expressionContainsFilter($AST->whereClause->conditionalExpression, $filterExpressions)) {\n $previousPrimary = new ConditionalPrimary();\n $previousPrimary->conditionalExpression = $AST->whereClause->conditionalExpression;\n $AST->whereClause->conditionalExpression = new ConditionalTerm([\n $this->createPrimaryFromNode($conditionalPrimary),\n $previousPrimary,\n ]);\n }\n }\n } else {\n $AST->whereClause = new WhereClause(\n $conditionalPrimary\n );\n }\n }", "function testSelect()\r\n\t{\r\n\t\t$data = new Data();\r\n\t\t$data->setTableAlias( \"d\" );\r\n\r\n\t\t$dic = new Dictionary();\r\n\t\t$dic->setTableAlias( \"dic\" );\r\n\t\t\r\n\t\t$stm = new SQLStatementSelect( $data );\r\n\t\t$stm->setExpression(\r\n\t\t\tnew ExprAND(\r\n\t\t\t\tnew ExprEQ( $data->tag_value(), 1),\r\n\t\t\t\t new ExprEQ( $data->tag_date(), 1),\r\n\t\t\t\t new ExprEQ( $data->tag_string(), \"\"),\r\n\t\t\t\t new ExprEQ( $data->tag_text(), \"\"),\r\n\t\t\t\t new ExprEQ( $data->tag_text(), null)\r\n\t\t\t\t) );\r\n\t\t\r\n\t\t$stm->addOrder( $data->tag_date() );\r\n\t\t$stm->addGroup( $data->tag_date() );\r\n\t\t$stm->addColumn( $dic->tag_text(\"dic_text1\") );\r\n\t\t$stm->addColumn( $dic->tag_text(\"dic_text\") ); //same and alias\r\n\t\t$stm->addJoin( $data->key_dictionary_id($dic) );\r\n\r\n\t\t$query = $stm->generate(new MysqlGenerator());\r\n\t\t\r\n\t\t$expected = \"SELECT\"\r\n\t\t .\" `d`.`data_id` AS `data_id`,\"\r\n\t\t\t.\" `d`.`date` AS `date`,\"\r\n\t\t\t.\" `d`.`value` AS `value`,\"\r\n\t\t\t.\" `d`.`string` AS `string`,\"\r\n\t\t\t.\" `d`.`text` AS `text`,\"\r\n\t\t\t.\" `d`.`enum` AS `enum`,\"\r\n\t\t\t.\" `d`.`blob` AS `blob`,\"\r\n\t\t\t.\" `d`.`real` AS `real`,\"\r\n\t\t\t.\" `d`.`dictionary_id` AS `dictionary_id`,\"\r\n\t\t\t.\" `dic`.`text` AS `dic_text1`,\"\r\n\t\t\t.\" `dic`.`text` AS `dic_text`\"\r\n\t\t\t.\" FROM `t_data` AS `d` \"\r\n\t\t\t.\"LEFT JOIN `t_dictionary` AS `dic` ON (`dic`.`dictionary_id` = `d`.`dictionary_id`) \"\r\n\t\t\t.\"WHERE ((`d`.`value` = 1)\"\r\n\t\t\t.\" AND (`d`.`date` = '1970-01-01 03:00:01')\"\r\n\t\t\t.\" AND (`d`.`string` = '')\"\r\n\t\t\t.\" AND (`d`.`text` = '')\"\r\n\t\t\t.\" AND (`d`.`text` IS NULL)) \"\r\n\t\t\t.\"GROUP BY `d`.`date` \"\r\n\t\t\t.\"ORDER BY `d`.`date` ASC\"\r\n\t\t\t;\r\n\t\t\r\n\t\tTS_ASSERT_EQUALS( $expected, $this->ws($query) );\r\n\t}", "public function SELECTquery($select_fields, $from_table, $where_clause, $groupBy='', $orderBy='', $limit='') {\n \n $query = parent::SELECTquery($select_fields, $from_table, $where_clause, $groupBy, $orderBy, $limit);\n \n // trace query\n $debugQuery = str_replace(chr(9), '', $query); // removes tabs from query for better readability\n trace($debugQuery);\n #$this->logQuery($debugQuery); // activate for debugging purposes only - no logging by default for non-modifying queries like selects!\n \n return $query;\n \n }", "public static function select($sql, $cond=null)\n {\n $result = false;\n try\n {\n // prepare the query with the $sql parameter\n $stmt = self::connect()->prepare($sql);\n // execute the query with the $cond parameter\n $stmt->execute($cond);\n // fetchAll on the query to organize the results in a 2-dimensional array\n $result = $stmt->fetchAll();\n }\n\n // catch errors with stop and display of errors\n catch (Exception $ex)\n {\n die($ex->getMessage());\n }\n\n $stmt = null;\n return $result;\n }", "public function testSelect()\n {\n $connection = new MockConnection($this->mockConnector, $this->mockCompiler);\n $select = $connection->select();\n\n $this->assertInstanceOf(Query\\Select::class, $select);\n $this->assertEquals($connection, $select->connection);\n }", "function buildQuery(){\n\t\t$r = ($this->fieldName == \"\") ? \"SELECT * FROM \" . $this->tableName . \";\" : \"SELECT * FROM \" . $this->tableName . \" WHERE \" . $this->fieldName . \" = \" . $this->fieldValue . \";\";\n\t\t//print \"executing $r <br/>\";\n\t\treturn $r;\n\t}", "private function buildSelectString () \n {\n $this->selectSql = \"SELECT \";\n $this->selectSql .= $this->columns;\n $this->selectSql .= \" FROM \" . $this->tableName;\n if ($this->where !== null && $this->where !== \"\") {\n $this->selectSql .= \" WHERE \" . $this->where;\n }\n if ($this->order !== null && $this->order !== \"\") {\n $this->selectSql .= \" ORDER BY \" . $this->order;\n }\n if ($this->other !== null && $this->other !== \"\") {\n $this->selectSql .= $this->other;\n }\n }", "function GenericSQL($sql, $param_type_array, $param_array, $sql_op){\n\tglobal $mysqli;\n\n\ttry{\n\t\tif($stmt=$mysqli->prepare($sql)){\n if($param_type_array !== NULL && $param_array !== NULL)\n call_user_func_array(\n array($stmt, \"bind_param\"), \n array_merge(\n passByReference($param_type_array), \n passByReference($param_array)\n )\n );\n\n $stmt->execute();\n\n if($stmt->affected_rows === 0 && $sql_op !== SQL_SELECT){\n return NOTHING_AFFECTED;\n }elseif($stmt->affected_rows === -1 && $sql_op !== SQL_SELECT){\n return $stmt->errno;\n }elseif($sql_op === SQL_SELECT){\n $data = returnJson($stmt);\n return $data;\n }else{\n return SUCCESS; \n }\n }else{\n // Throw error\n fwrite(STDOUT, \"else\");\n return FAILURE;\n }\n\t}catch (Exception $e) {\n // Return generic error\n fwrite(STDOUT, \"exception\");\n\t\treturn FAILURE;\n }\n}", "function select($query,$order_by,$order_is,$limits){\n\t\t// Checking order data\n\t\tif($order_by==''){\n\t\t\t$ord='';\n\t\t} else {\n\t\t\tif($order_is==''){\n\t\t\t\t$ord_is='ASC';\n\t\t\t} else {\n\t\t\t\tif($order_is=='asc'){\n\t\t\t\t\t$ord_is='ASC';\n\t\t\t\t} elseif($order_is=='desc') {\n\t\t\t\t\t$ord_is='DESC';\n\t\t\t\t} else {\n\t\t\t\t\t$ord_is='ASC';\n\t\t\t\t}\n\t\t\t}\n\t\t\t$ord=' ORDER BY `'.$order_by.'` '.$ord_is.'';\n\t\t}\n\t\t// Checking limits data\n\t\tif($limits==''){\n\t\t\t$lim='';\n\t\t} else {\n\t\t\t$lim=' LIMIT '.$limits;\n\t\t}\n\t\t// Checking query type\n\t\t$r=mysql_query($query.$ord.$lim);\n\t\t$f=mysql_fetch_array($r);\n\t\treturn $f;\n\t}", "protected function processQuery()\n\t{\n\t\t// Type of input the field shows\n\t\t$this->input_type = $this->getAttribute('input_type');\n\n\t\t// Database Table\n\t\t$this->table = $this->getAttribute('table');\n\n\t\t// The field that the field will save on the database\n\t\t$this->key_field = (string) $this->getAttribute('key_field');\n\n\t\t// The column that the field shows in the input\n\t\t$this->value_field = (string) $this->getAttribute('value_field');\n\n\t\t// The option field that the field will save on the database\n\t\t$this->option_key_field = (string) $this->getAttribute('option_key_field');\n\n\t\t// The option value that the field shows in the input\n\t\t$this->option_value_field = (string) $this->getAttribute('option_value_field');\n\n\t\t// Flag to identify if the fk_value is multiple\n\t\t$this->value_multiple = (int) $this->getAttribute('value_multiple', 0);\n\n\t\t$this->required = (string) $this->getAttribute('required', 0);\n\n\t\t// Flag to identify if the fk_value hides the trashed items\n\t\t$this->hideTrashed = (int) $this->getAttribute('hide_trashed', 0);\n\t\t\n\t\t// Flag to identify if the fk_value hides the unpublished items\t\n\t\t$this->hideUnpublished = (int) $this->getAttribute('hide_unpublished', 0);\n\n\t\t// Flag to identify if the fk_value hides the published items\n\t\t$this->hidePublished = (int) $this->getAttribute('hide_published', 0);\n\n\t\t// Flag to identify if the fk_value hides the archived items\n\t\t$this->hideArchived = (int) $this->getAttribute('hide_archived', 0);\n\n\t\t// Flag to identify if the fk has default order\n\t\t$this->fk_ordering = (string) $this->getAttribute('fk_ordering');\n\n\t\t// The where SQL for foreignkey\n\t\t$this->condition = (string) $this->getAttribute('condition');\n\n\t\t// Flag for translate options\n\t\t$this->translate = (bool) $this->getAttribute('translate');\n\n\t\t// Initialize variables.\n\t\t$html = '';\n\t\t$fk_value = '';\n\n\t\t// Load all the field options\n\t\t$db = Factory::getContainer()->get('DatabaseDriver');\n\t\t$query = $db->getQuery(true);\n\n\t\t// Support for multiple fields on fk_values\n\t\tif ($this->value_multiple == 1)\n\t\t{\n\t\t\t// Get the fields for multiple value\n\t\t\t$this->value_fields = (string) $this->getAttribute('value_field_multiple');\n\t\t\t$this->value_fields = explode(',', $this->value_fields);\n\t\t\t$this->separator = (string) $this->getAttribute('separator');\n\n\t\t\t$fk_value = ' CONCAT(';\n\n\t\t\tforeach ($this->value_fields as $field)\n\t\t\t{\n\t\t\t\t$fk_value .= $db->quoteName($field) . ', \\'' . $this->separator . '\\', ';\n\t\t\t}\n\t\t\t\n\t\t\t$fk_value = substr($fk_value, 0, -(strlen($this->separator) + 6));\n\t\t\t$fk_value .= ') AS ' . $db->quoteName($this->value_field);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$fk_value = $db->quoteName($this->value_field);\n\t\t}\n\n\t\t$query\n\t\t\t->select(\n\t\t\t\tarray(\n\t\t\t\t\t$db->quoteName($this->key_field),\n\t\t\t\t\t$fk_value\n\t\t\t\t)\n\t\t\t)\n\t\t\t->from($this->table);\n\n\t\tif ($this->hideTrashed)\n\t\t{\n\t\t\t$query->where($db->quoteName('state') . ' != -2');\n\t\t}\n\n\t\tif ($this->hideUnpublished)\n\t\t{\n\t\t\t$query->where($db->quoteName('state') . ' != 0');\n\t\t}\n\n\t\tif ($this->hidePublished)\n\t\t{\n\t\t\t$query->where($db->quoteName('state') . ' != 1');\n\t\t}\n\n\t\tif ($this->hideArchived)\n\t\t{\n\t\t\t$query->where($db->quoteName('state') . ' != 2');\n\t\t}\n\n\t\tif ($this->fk_ordering)\n\t\t{\n\t\t\t$query->order($this->fk_ordering);\n\t\t}\n\n\t\tif($this->condition)\n\t\t{\n\t\t\t$query->where($this->condition);\n\t\t}\n\n\t\t\n\n\t\treturn $query;\n\t}", "public function testSelectWithNullWhereParameter()\n {\n $this->db->select(\"test\", new DBField('id'), null);\n $this->assertEquals(\"SELECT `id` FROM test\", (string) $this->db);\n }", "function select($column0=null, $_=null){\n $obj = new SelectRule(new Context($this->connection));\n if($column0 == null){\n $args = ['*'];\n }elseif(is_array($column0)){\n $args = $column0;\n }else{\n $args = func_get_args();\n }\n foreach ($args as &$arg){\n $arg = DB::wrap($arg);\n if($arg == '*'){\n continue;\n }\n }\n return $obj->select(implode(',', $args));\n }", "abstract public function query($sql);", "public function select($table, $where_sql = false, $where_fields_values = false, $custom_select_sql = false, $order = false, $limit = false)\r\n\t{\r\n\t\t$sql = $this->generate_select_sql ($table, $where_sql, $where_fields_values, $custom_select_sql, $order, $limit);\r\n\t\treturn $this->query($sql);\r\n\t}", "protected abstract function getSelectStatement(array $columns);", "function buildQuery () {\n $select = array();\n $from = array();\n $where = array();\n $join = '';\n $rowLimit = '';\n $tables = array();\n\n if (!empty ($this->checkTables)) {\n\n foreach ($this->checkTables as $table) {\n\n // only include tables that have selected columns\n $columns = self::getCheckTableColumns( $table );\n\n if (!empty ($columns)) {\n\n $tables[] = $this->removeQuotes($table);\n\n // Assign select and where clauses\n //go through each column\n foreach ($columns as $column) {\n //Add is column to constraint if selected\n if (!empty( $this->formTableColumnFilterHash[$table][$column]['checkColumn'] )) {\n $select[] = $this->removeQuotes($table) . \".\" . $this->removeQuotes($column);\n }\n\n self::getColumnFilter ( $where,\n $table,\n $column,\n $this->formTableColumnFilterHash[$table][$column]['selectMinOper'],\n $this->formTableColumnFilterHash[$table][$column]['textMinValue'],\n $this->formTableColumnFilterHash[$table][$column]['selectMaxOper'],\n $this->formTableColumnFilterHash[$table][$column]['textMaxValue']);\n } // foreach $column\n } //if (!empty ($columns))\n } // foreach $table\n } //if (!empty ($this->checkTables))\n\n // If there is only one table add from clause to that, otherwise only add the join table\n\n //Calculate joins before FROM\n $join = $this->joinTables($this->checkTables);\n\n $fromStatement = \"FROM \";\n $tblCounter = 0;\n $joinarray = array();\n $uniqueJoinArray= array_unique($this->JOINARRAY);\n $tblTotal = count($tables) - count($uniqueJoinArray);\n\n // build the FROM statement using all tables and not just tables that have selected columns\n foreach ($this->checkTables as $t) {\n $tblCounter++;\n\n # don't add a table to the FROM statement if it is used in a JOIN\n if(!(in_array($t, $this->JOINARRAY))){\n $fromStatement .= $t;\n\n //if($tblCounter < $tblTotal){\n $fromStatement .= \", \";\n //} // if\n\n } // if\n } // foreach tables\n\n $fromStatement = preg_replace(\"/\\,\\s*$/\",\"\",$fromStatement);\n $from[] = $fromStatement;\n\n // Add something if there are no columns selected\n if ( count( $select ) == 0 ) {\n $select[] = '42==42';\n }\n\n // Let's combine all the factors into one big query\n $query = \"SELECT \" . join(', ',$select) . \"\\n\" . join(', ', $from) . \"\\n\" . $join;\n\n # Case non-empty where clause\n if ( count( $where ) > 0 ) {\n $query .= 'WHERE ' . join( \" AND \", $where );\n $query .= \"\\n\";\n }\n\n // Add Row Limit\n if ( !empty( $this->selectRowLimit ) ) {\n $rowLimit = \"LIMIT \" . $this->selectRowLimit;\n $query .= $rowLimit;\n $query .= \"\\n\";\n }\n\n return $query;\n }", "function is_select_statement()\n {\n return $this->object->_select_clause ? TRUE : FALSE;\n }", "public function select($params){\n\t\t$DB = Registry::getInstance()->DB;\n\t\t$prefix = \"SELECT \";\n\t\t$p = $this->clean($params);\n\t\t$statement = $prefix.\" \".$this->genFrom($p['cols']).\" \".$this->genTable($p['tables']).$this->genWhere($p['where']);\t\n\t\treturn $DB->select($statement);\t\n\t}", "function querySelect($query) {\r\n\t\t\r\n\t\tif (strlen(trim($query)) < 0 ) {\r\n\t\t\ttrigger_error(\"Database encountered empty query string in querySelect function\",E_USER_ERROR);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\tif( !$this->connected ) \r\n\t\t\t$this->connect();\r\n\t\t\t\r\n\t\tif ($result = $this->socket->query($query)) {\r\n\t\t\t$this->recordsSelected = $result->num_rows;\r\n\t\t\t$this->databaseResults = $this->getData($result);\r\n\t\t\t$result->close();\t\t\t\r\n\t\t}\r\n\t\telseif($this->socket->errno!='')\r\n\t\t{\r\n\t\t\r\n\t\t\t$this->error( $sql.\"Error querying database: \". $this->socket->error,false);\r\n\t\t\treturn false;\r\n\r\n\t\t\t}\r\n\t\t\r\n\t\treturn $this->databaseResults;\r\n\t}", "public function cpSelect($tablename,$value1=0,$value2=0) {\n /*\n * Prepare the select statement\n */\n $sql=\"SELECT * FROM $tablename\";\n if($value1!=0)\n { $key1= key($value1);\n $sql.=\" where $key1='$value1[$key1]'\";\n }\n if($value1!=0 && $value2!=0) \n {\n $key2= key($value2);\n $sql.=\" AND $key2='$value2[$key2]'\";\n }\n \n $sth = $this->dbh->prepare($sql);\n $sth->execute();\n $result = $sth->fetchAll(PDO::FETCH_ASSOC);\n return $result;\n \n}", "public function Do_select_Example1(){\n\n\t}", "public function select($field);" ]
[ "0.7798989", "0.7205433", "0.633592", "0.633592", "0.6301271", "0.6220187", "0.6168892", "0.61399484", "0.6126623", "0.60883707", "0.60615754", "0.602415", "0.60173863", "0.60116214", "0.59990126", "0.59961575", "0.59567076", "0.59567076", "0.59567076", "0.5943183", "0.5929555", "0.59045184", "0.5902862", "0.5895785", "0.5885962", "0.58444786", "0.5840506", "0.58290184", "0.5815414", "0.57961106", "0.5782747", "0.57824445", "0.5782436", "0.57739633", "0.5768829", "0.5758206", "0.5754387", "0.57542914", "0.57421273", "0.574163", "0.5732644", "0.5718393", "0.5710572", "0.5708108", "0.57048875", "0.5697653", "0.5690768", "0.5687599", "0.5674212", "0.5664565", "0.56592405", "0.56592405", "0.5632043", "0.562995", "0.5621562", "0.56186", "0.56137586", "0.56085175", "0.5607624", "0.5603511", "0.5601697", "0.559739", "0.5573637", "0.557033", "0.55680674", "0.55663544", "0.55663544", "0.55663544", "0.5561636", "0.55572814", "0.55559176", "0.55493957", "0.55430365", "0.5530441", "0.5529776", "0.55281377", "0.5527626", "0.55254316", "0.55207807", "0.5515942", "0.55127937", "0.5506899", "0.54990757", "0.54933107", "0.54932684", "0.5491986", "0.5486344", "0.5483631", "0.5465273", "0.5447158", "0.5442275", "0.5441281", "0.54390335", "0.5433172", "0.5432267", "0.54280734", "0.54211634", "0.5415013", "0.54142064", "0.54125404" ]
0.5623271
54
Runs the query against the database.
public function execute();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function run(){\n $sql = $this->sql();\n return $this->query($sql,$this->args);\n }", "public function query();", "public function query();", "public function query();", "public function query()\n {\n }", "public function query()\n {\n }", "abstract public function query();", "private function RunBasicQuery() {\n // Prepare the Query\n $this->stmt = $this->db->prepare($this->sql);\n \n // Run the Query in the Database\n $this->stmt->execute();\n \n // Store the Number Of Rows Returned\n $this->num_rows = $this->stmt->rowCount();\n \n // Work with the results (as an array of objects)\n $this->rs = $this->stmt->fetchAll();\n \n // Free the statement\n $this->stmt->closeCursor(); \n }", "private function executeQuery() {\n\t\t$recordset = $this->getConnection()->execute( $this );\n\t\t\n\t\tif( $recordset === false ) {\n\t\t\t$this->_recordset = array();\n\t\t} else {\n\t\t\t$this->_recordset = $recordset;\n\t\t}\n\n\t\t$this->_currentRow = 0;\n\t\t$this->isDirty( false );\n\t}", "public function query()\n\t{\n\t\t\n\t}", "public static function query()\n {\n }", "public static function query();", "function query() {}", "private function runQuery () {\n\n // Prepare the constructed SQL statement\n if ($this->_query = $this->_pdo->prepare($this->_sql)) {\n\n // Set a counter to one to use when binding\n $x = 1;\n \n // Loop through the binding array\n foreach($this->_bindArray as $param) {\n \n // Run the bindValue function to match the correct value to the correct placing\n $this->_query->bindValue($x, $param);\n\n // Increment the counter\n $x++;\n \n }\n \n // Run the execute function\n $this->execute();\n }\n }", "private function ExecuteQuery()\n\t{\n\t\tswitch($this->querytype)\n\t\t{\n\t\t\tcase \"SELECT\":\n\t\t\t{\n\t\t\t\t$this->stmt->execute();\n\t\t\t\t$this->querydata = $this->stmt->fetchAll(PDO::FETCH_ASSOC);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase \"INSERT\":\n\t\t\tcase \"UPDATE\":\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\t$this->beginTransaction();\n\t\t\t\t\t$this->stmt->execute();\n\t\t\t\t\t$this->commit();\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcatch (PDOException $e)\n\t\t\t\t{\n\t\t\t\t\t$this->rollBack();\n\t\t\t\t\techo(\"Query failed: \" . $e->getMessage());\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "function executeQuery($query);", "protected function execute_single_query(){\n\t\t$this -> open_connection();\n\t\t$this -> conn -> query($this -> query);\n\t\t$this -> close_connection();\n\t}", "public function execute($query);", "function run_query($query) {\r\n\t \t$db = new Database();\r\n\t \t$queryResult = $db->run_query_internal($query);\r\n\t \treturn mysqli_query($db->getConnection(),$query);\r\n\t }", "public function execute () {\n $this->query->execute();\n }", "function query(\\database $dbase){\n //\n //Get the sql string \n $sql=$this->to_str();\n //\n // Execute the $sql on columns to get the $result\n $dbase->query($sql);\n \n }", "protected abstract function executeQuery(Result $result);", "function query() {\n }", "public function runQuery(){\n \n $query = $this->getQuery();\n $pager = $this->getPager();\n $modify_result = $this->getModifyResult();\n\n // set default number of results so that we don't output NULL as \n // total_results if there are errors\n $pager->setTotalResults( 0 );\n $results = array();\n \n if( !$this->getResponse()->hasErrors() ){\n \t\n \t $count_query = clone $query;\n\t $pager->setTotalResults( $count_query->count() );\n \t $pager->decorateQuery( $query );\n \n\t if( $pager->getPageSize() > 0 ){\n\t $db_results = $query->find();\n\t foreach( $db_results as $model ){\n\t $result_object = array();\n\t $modify_result( $model, $result_object );\n\t $results[] = $result_object;\n\t }\n\t }\n\t \n }\n \n $api_response_body = $this->getResponse()->getResponseBody();\n $api_response_body->setBody($results);\n \n }", "protected abstract function executeQuery($query);", "protected function execute_single_query() \n\t\t{\n \t\t\t$this->open_connection();\n \t\t\t$this->conn->query($this->query);\n \t\t\t$this->close_connection();\n\t\t}", "private function query() {\n return ApplicationSql::query($this->_select, $this->_table, $this->_join, $this->_where, $this->_order, $this->_group, $this->_limit, $this->_offset);\n }", "public function executeQuery() {\r\n\t\t$query = $this->query;\r\n\t\t$query->matching($query->logicalAnd($this->queryConstraints));\r\n//$parser = \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::makeInstance('TYPO3\\\\CMS\\\\Extbase\\\\Persistence\\\\Generic\\\\Storage\\\\Typo3DbQueryParser'); \r\n//$queryParts = $parser->parseQuery($query); \r\n//\\TYPO3\\CMS\\Core\\Utility\\DebugUtility::debug($queryParts, 'Query Content');\r\n\t\t$queryResult = $query->execute()->toArray();\r\n\t\t$this->setSelectedPageUids($queryResult);\r\n\t\t$this->resetQuery(); \r\n\t\treturn $queryResult;\r\n\t}", "function runQuery()\r\n\t\t{\r\n\t\tif(!$this->conn)\r\n\t\t\t{\r\n\t\t\t$this->createConnect();\r\n\t\t\t}\r\n\t\tif($this->query)\r\n\t\t\t{\r\n\t\t\t$this->errors=\"\";\r\n\t\t\t$this->query.=\";\";\r\n\t\t\t$this->result = mysql_query($this->query);\r\n\t\t\tif(mysql_affected_rows()>=0)\r\n\t\t\t\t{\r\n\t\t\t\tunset($this->query);\r\n\t\t\t\t}\r\n\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\techo \"<br>Error:<br>\";\r\n\t\t\t\t$debugging=debug_backtrace();\r\n\t\t\t\tforeach ($debugging as $debug)\r\n\t\t\t\t\t{\r\n\t\t\t\t\techo \"<b>File :</b> \".$debug[\"file\"].\"<br />\";\r\n\t\t\t\t\techo \"<b>Line :</b> \".$debug[\"line\"].\"<br />\";\r\n\t\t\t\t\techo \"<b>Function :</b> \".$debug[\"function\"].\"<br />\";\r\n\t\t\t\t\techo \"<b>Cause :</b> \".mysql_error().\"<br />\";\r\n\t\t\t\t\t}\r\n\t\t\t\techo \"<b>Query :</b> \".$this->query.\"<hr>\";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\telse\r\n\t\t\t{\r\n\t\t\techo \"<br>-- NULL Query --\";\r\n\t\t\t}\r\n\t\tif (!is_resource($this->result))\r\n\t\t\t{\r\n\t\t\t$this->errors=mysql_error();\r\n\t\t\tif($this->transaction)\r\n\t\t\t\t{\r\n\t\t\t\t\t$this->transaction=FALSE;\r\n\t\t\t\t\t$this->query=\"ROLLBACK TRANSACTION\";\r\n\t\t\t\t\t$this->runQuery();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}", "function _execute($sql) {\n\t\t$result = sqlite_query($this->connection, $sql);\n\n\t\tif (preg_match('/^(INSERT|UPDATE|DELETE)/', $sql)) {\n\t\t\t$this->resultSet($result);\n\t\t\tlist($this->_queryStats) = $this->fetchResult();\n\t\t}\n\t\treturn $result;\n\t}", "public function run()\n {\n $this->runQueriesFromSqlFile('1.3.4.3');\n }", "public function query($sql);", "public function query($sql);", "public function query($sql);", "public function query($sql);", "private function execute () {\n if($this->_query->execute()) {\n\n // It has been succesful so add the output to $this->results and set it as an object\n $this->_results = $this->_query->fetchAll(PDO::FETCH_OBJ);\n\n // Set the affected row count to $this->_count\n $this->_count = $this->_query->rowCount();\n\n } else {\n\n // The query failed so set $this->_error to true. MORE WORK NEEDED HERE\n $this->_error = true;\n\n }\n }", "abstract public function query($sql);", "public static function execute()\n {\n if(DEBUG_QUERIES)\n {\n $start = microtime();\n }\n $r = self::$stmt->execute();\n if(DEBUG_QUERIES)\n {\n $elapsed = round(microtime() - $start, 4);\n isset(Core::$benchmark['db']['count']) ? Core::$benchmark['db']['count']++ : Core::$benchmark['db']['count'] = 1;\n isset(Core::$benchmark['db']['elapsed']) ? (Core::$benchmark['db']['elapsed']+$elapsed) : Core::$benchmark['db']['elapsed'] = $elapsed;\n }\n if(self::$stmt->errorCode() !== '00000')\n {\n trigger_error(json_encode(self::$stmt->errorInfo()));\n }\n return $r;\n }", "public static function query($sql);", "public function _query()\n {\n }", "abstract protected function doQuery( $sql );", "public function execute()\n {\n return $this->query($this->sSql);\n }", "function runQuery()\n\t{\n\t\treturn $this->query;\n\t}", "private function query()\n {\n $lStart = microtime(true);\n\n //arguments should be query (with placeholders) followed by an array of key-value pairs\n $args = func_get_args();\n $args = array_shift($args);\n $query = array_shift($args);\n $params = $args ? array_shift($args) : [];\n\n $sth = $this->pdo->prepare($query);\n if (!$sth) {\n //prepare failed\n $this->handlePrepareError($sth, $query, $params);\n }\n\n //explicitly bind parameters as int/string so IN() doens't get quoted\n foreach ($params as $key => $value) {\n if (is_numeric($value)) {\n $sth->bindValue($key, $value, PDO::PARAM_INT);\n } elseif (is_bool($value)) {\n $sth->bindValue($key, $value, PDO::PARAM_BOOL);\n } elseif (is_null($value)) {\n $sth->bindValue($key, $value, PDO::PARAM_NULL);\n } else {\n $sth->bindValue($key, $value, PDO::PARAM_STR);\n }\n }\n\n //query invalid\n if(!$sth->execute()) {\n $this->handleExecuteError($sth, $query, $params);\n }\n $this->queryTimer += microtime(true) - $lStart;\n $this->queryCount++;\n\n $query = preg_replace('/^\\s+/', '', $query);\n if(str_starts_with(strtolower($query), 'select')) {\n //return results for SELECT\n return $sth;\n\n } elseif(str_starts_with(strtolower($query), 'insert')) {\n //return insert id for INSERT\n $id = $this->pdo->lastInsertId();\n return ($id ?: true);\n\n } else {\n //return TRUE for DELETE, UPDATE\n //NB: don't return affected rows for UPDATE since 0 affected will be interpreted as query failed)\n return true;\n }\n }", "public function execute() {\n\t\t\t$connection = \\Leap\\Core\\DB\\Connection\\Pool::instance()->get_connection($this->data_source);\n\t\t\tif ($this->before !== NULL) {\n\t\t\t\tcall_user_func_array($this->before, array($connection));\n\t\t\t}\n\t\t\t$connection->execute($this->command());\n\t\t\tif ($this->after !== NULL) {\n\t\t\t\tcall_user_func_array($this->after, array($connection));\n\t\t\t}\n\t\t}", "public function runCustomQuery($query, Database_Config $databaseConfig = NULL);", "public function execute()\n\t{\n\t\t// Use cached results if found (previous count() or other internal call)\n\t\tif($this->activeQueryResults) {\n\t\t\t$results = $this->activeQueryResults;\n\t\t} else {\n\t\t\tif($this->activeQuery instanceof phpDataMapper_Database_Query_Interface) {\n\t\t\t\t$results = $this->query($this->activeQuery->sql(), $this->activeQuery->getParameters());\n\t\t\t\t$this->activeQueryResults = $results;\n\t\t\t} else {\n\t\t\t\t$results = array();\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $results;\n\t}", "function db_run_query( $statement ) {\n\n $this->pm_clear_dataset();\n $this->pm_store_statement( $statement );\n $this->pm_debug_statement( $statement );\n if( ! $this->query_is_select ) $this->pm_write_logfile( $statement );\n\n $this->dataset_obj = $this->connection->query( $statement );\n $this->pm_die_if_error( 'dataset_obj' );\n\n if( is_object( $this->dataset_obj )) # updates/inserts/deletes seem to return an integer not an object\n $this->rowcount = $this->dataset_obj->numrows();\n else\n $this->rowcount = ROWCOUNT_NOT_SET;\n\n return $this->dataset_obj;\n }", "public function run()\n {\n DB::disableQueryLog();\n parent::run();\n }", "public function executeQuery() \r\n\t{\r\n\t\t$Result = $this->objStatement->execute();\r\n\t\t\r\n\t\tif($Result)\r\n\t\t{\r\n\t\t\t$Result = new DatabaseStatement($this->objStatement);\r\n\t\t}\r\n\t\t\r\n\t\treturn $Result;\r\n\t}", "function queryExecute($query) {\r\n\t\t\r\n\t\tif (strlen(trim($query)) < 0 ) {\r\n\t\t\ttrigger_error(\"Database encountered empty query string in queryExecute function\",E_ERROR);\r\n\t\t}\r\n\t\tif( !$this->connected ) \r\n\t\t\t$this->connect();\r\n\t\t\r\n\t\tif($this->socket->query($query) === true) {\r\n\t\t\t$this->recordsUpdated = $this->socket->affected_rows;\r\n\t\t}\r\n\t}", "function query() {\n \n $this->ensure_my_table();\n \n if ($this->options['operator'] == 'in') {\n $keys = array_keys($this->value);\n\n $this->query->add_where(0, $this->table_alias.'.id IN ('. implode(',', $keys).')' );\n }\n\n }", "function tep_db_query($query){\n\t\tglobal $db;\n\t\treturn($db->Execute($query));\n\t}", "public function execute()\n {\n \tif ( $this->cur_query != \"\" )\n \t{\n \t\t$res = $this->query( $this->cur_query );\n \t}\n \t\n \t$this->cur_query \t= \"\";\n \t$this->is_shutdown \t= false;\n\n \treturn $res;\n }", "final public function execute()\n {\n return $this\n ->finalize()\n ->getDB()\n ->execute($this);\n }", "public function doQuery($sql, $params);", "public function __invoke()\n {\n $this->execute();\n }", "abstract function executeQuery($cons);", "function query(DBWrapper $db, $sql)\n {\n\n $db->query($sql);\n }", "function query() {\r\n\t\t\t$args = func_get_args();\r\n\t\t\t$sql = array_shift($args);\r\n\t\t\tforeach ($args as $key => $value)\r\n\t\t\t\t$args[$key] = $this->clean($value);\r\n\t\t\treturn mysql_query(vsprintf($sql, $args));\r\n\t\t}", "abstract public function execute($query);", "public function execute(QueryObject $query);", "public function execute()\n {\n if (!$this->sessionSet && $this->platform instanceof MySqlPlatform) {\n $this->connection->exec(\"SET @@SESSION.sql_mode = '';\");\n $this->sessionSet = true;\n }\n\n // Take a local copy so that we don't modify the original query and cause issues later\n $query = $this->replacePrefix((string) $this->sql);\n\n if (!($this->sql instanceof \\JDatabaseQuery) && ($this->limit > 0 || $this->offset > 0)) {\n // @TODO\n if ($this->offset > 0) {\n $query .= ' LIMIT ' . $this->offset . ', ' . $this->limit;\n } else {\n $query .= ' LIMIT ' . $this->limit;\n }\n }\n\n $this->prepared = $this->connection->prepare($query);\n\n // Increment the query counter.\n $this->count++;\n\n // Reset the error values.\n $this->errorNum = 0;\n $this->errorMsg = '';\n $memoryBefore = null;\n\n // If debugging is enabled then let's log the query.\n if ($this->debug) {\n // Add the query to the object queue.\n $this->log[] = $query;\n\n \\JLog::add($query, \\JLog::DEBUG, 'databasequery');\n\n $this->timings[] = microtime(true);\n }\n\n // Execute the query.\n $this->executed = false;\n $previous = null;\n\n if ($this->prepared instanceof Statement) {\n // Bind the variables:\n if ($this->sql instanceof JDatabaseQueryPreparable) {\n $bounded = $this->sql->getBounded();\n\n foreach ($bounded as $key => $obj) {\n $this->prepared->bindParam($key, $obj->value, $obj->dataType, $obj->length, $obj->driverOptions);\n }\n }\n\n try {\n $this->executed = $this->prepared->execute();\n } catch (\\Exception $previous) {\n }\n }\n\n if ($this->debug) {\n $this->timings[] = microtime(true);\n\n if (defined('DEBUG_BACKTRACE_IGNORE_ARGS')) {\n $this->callStacks[] = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS);\n } else {\n $this->callStacks[] = debug_backtrace();\n }\n }\n\n // If an error occurred handle it.\n if (!$this->executed) {\n // Get the error number and message before we execute any more queries.\n $errorNum = (int) $this->connection->errorCode();\n $errorMsg = (string) 'SQL: ' . implode(\", \", $this->connection->errorInfo());\n\n // Get the error number and message from before we tried to reconnect.\n $this->errorNum = $errorNum;\n $this->errorMsg = $errorMsg;\n\n // Throw the normal query exception.\n \\JLog::add(\n \\JText::sprintf('JLIB_DATABASE_QUERY_FAILED', $this->errorNum, $this->errorMsg),\n \\JLog::ERROR,\n 'databasequery'\n );\n throw new RuntimeException($this->errorMsg, $this->errorNum, $previous);\n }\n\n return $this->prepared;\n }", "public function query($query);", "public function query($query);", "public function query($query);", "public function run()\n {\n $marks = [];\n\n foreach ($this->data as $field => $value) {\n $marks[\":{$field}\"] = $value;\n }\n\n return $this->entity->getDb()->execute((string) $this, $marks);\n }", "public function testRunASqlQuery(){\r\n $sql = \"Select * from orders;\";\r\n $db = new database;\r\n $db->connectToDatabase();\r\n $success = $db->runASqlQuery($sql);\r\n $this->assertEquals(true,$success);\r\n }", "public function query()\n {\n $args = func_get_args();\n\n $this->connect(atkDb::getQueryMode($args[0]));\n\n return call_user_method_array('query',$this->m_current_clusternode, $args);\n }", "public function query(IQuery $query);", "public function ExecuteQuery($query){\n\t\treturn $this->db_con->query($query);\n\t}", "public function executeQuery($query) {\r\n\t\t\r\n\t\t$this->mdb2->connect();\r\n\t\t\t\t\r\n\t\t$ResultSet = $this->mdb2->query($query);\r\n\t\t\r\n\t\t$this->mdb2->disconnect();\r\n\t\t\r\n\t\tif (PEAR::isError($ResultSet)) {\r\n\t\t\tdie($ResultSet->getMessage() . \": \" . $query);\r\n\t\t}\r\n\t\t\r\n\t\treturn $ResultSet;\r\n\t\t\r\n\t}", "public function doQuery() {\n // Selects all of ads' title and writer's name\n $queryString = \"SELECT title, name FROM advertisements INNER JOIN users ON users.id = advertisements.userid ORDER BY advertisements.id DESC\";\n\n $getAds = $this->sql->query($queryString);\n\n // Store the result array in the $data variable, which can be available by getData() later\n while($rows = $getAds->fetch_array(MYSQLI_ASSOC)) {\n array_push($this->data, $rows);\n }\n }", "abstract protected function _query($sql);", "function query($sql) {\r\n\t\treturn $this->execute($sql);\r\n\r\n\t}", "public function query() {\n $this->field_alias = $this->real_field;\n if (isset($this->definition['trovequery'])) {\n $this->query->add_where('', $this->definition['trovequery']['arg'], $this->definition['trovequery']['value']);\n }\n }", "public function execute($sql){\n\t $query = DB::query(Database::SELECT, $sql);\n\t return $query->execute($this->database);\n\t}", "public function query($statement);", "public function query($query) {\n if(method_exists($this->db, 'query')) {\n return $this->db->query($query);\n } else {\n throw new Exception(__METHOD__ . \" not implemented\");\n }\n }", "function query() {\n $this->ensure_my_table();\n $value = $this->parse_gis_location();\n $this->query->add_where($this->options['group'], \"$this->table_alias.$this->real_field\", $value, $this->operator);\n }", "public function query($query) {\n $this->result = $this->dbHandler->prepare($query);\n }", "private function execute() {\n $query = $this->db->query($this->sql);\n return $query->result();\n }", "public function query(QueryObject $query);", "function query($sql) {\n\t\t\treturn $this->db->query($sql);\n\t\t}", "function query($query) {\n\t\treturn $this->dbcr_query( $query, true );\n\t}", "public function Query() {\n \n }", "public static function query($query){\n if(!self::$connection){\n self::initDb();\n }\n\n return self::$connection->query($query);\n }", "private function execute() {\n $this->statement = $this->pdo->prepare($this->queryString);\n\n foreach ($this->params as $boundParam) {\n $this->statement->bindValue($boundParam->name, $boundParam->value, $boundParam->type);\n }\n\n $this->statement->execute();\n }", "public function executeQuery($sql){\n return DB::executeQuery($this->db, $sql);\n }", "function query( $sql ){\n\t\tif( $this->db == null ){\n\t\t\treturn false;\n\t\t}\n\t\t$result = $this->db->query( $sql );\n\n\t\treturn $result;\n\t}", "public function query() {\n\n }", "function doQuery(&$sql,$dsn=\"default\") {\n\t\t//use this tableName\n\t\t$db = DB::getHandle($dsn);\n\n\t\t$db->query($sql);\n\n\t \treturn;\n\t}", "function doQuery(&$sql,$dsn=\"default\") {\n\t\t//use this tableName\n\t\t$db = DB::getHandle($dsn);\n\n\t\t$db->query($sql);\n\n\t \treturn;\n\t}", "function db_execute($query)\n {\n /*\n * Execute the Query\n */\n $this->varifysql($query[\"SQL\"]);\n return $this->get_conn()->query($query[\"SQL\"], PDO::FETCH_ASSOC);\n }", "public function executeSQL($query){\n\t\t$this->lastQuery = $query;\t\t\n\t\tif($this->result = mysqli_query( $this->databaseLink,$query)){\n\t\t\tif (gettype($this->result) === 'object') {\n\t\t\t\t$this->records = @mysqli_num_rows($this->result);\n\t\t\t\t$this->affected = @mysqli_affected_rows($this->databaseLink);\n\t\t\t} else {\n\t\t\t\t$this->records = 0;\n\t\t\t\t$this->affected = 0;\n\t\t\t}\n\n\t\t\tif($this->records > 0){\n\t\t\t\t$this->arrayResults();\n\t\t\t\treturn $this->arrayedResult;\n\t\t\t}else{\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t}else{\n\t\t\t$this->lastError = mysql_error($this->databaseLink);\n\t\t\techo $this->lastError;\n\t\t\treturn false;\n\t\t}\n\t}", "public function run()\n {\n $sql = file_get_contents(database_path() . '/seeders/countries-all.sql');\n\n DB::statement($sql);\n }", "private function runQuery($query) {\r\n\t\treturn mysql_query($query, $this->sql);\r\n\t}", "protected function runDatabaseCheck() {\n\t\t$this->showProgressMessage('Going to run database check.');\n\n\t\t$dbOperations = t3lib_div::makeInstance('tx_mnogosearch_dboperations');\n\t\t/* @var $dbOperations tx_mnogosearch_dboperations */\n\t\t$dbOperations->setIndexer($this->indexer);\n\t\t$dbOperations->checkAndCreate();\n\t}", "public function runquery(string $query) { \n\n // Check if SELECT is in the query\n if (preg_match('/SELECT/', strtoupper($query)) != 0) {\n // Array with forbidden query parts\n $disAllow = array( 'INSERT','UPDATE','DELETE','RENAME','DROP','CREATE','TRUNCATE','ALTER',\n 'COMMIT','ROLLBACK','MERGE','CALL','EXPLAIN','LOCK','GRANT','REVOKE',\n 'SAVEPOINT','TRANSACTION','SET');\n\n $disAllow = array( 'UPDATE ','DELETE ', 'DROP ', 'TRUNCATE ', 'RENAME ');\n\n $disAllow = implode('|', $disAllow);\n\n // Check if no other harmfull statements exist\n if (preg_match('/('.$disAllow.')/', strtoupper($query)) == 0) {\n\n $conn=array(\n 'driver' => $this->dbtype,\n 'host' => $this->host,\n 'database' => $this->dbname,\n 'username' => $this->username,\n 'password' => decrypt($this->password),\n 'charset' => 'utf8',\n 'collation' => 'utf8_unicode_ci',\n 'prefix' => ''\n ); \n\n if ($this->dbtype=='oracle') {\n $conn['database']='';\n $conn['service_name']=$this->dbname;\n }\n\n Config::set('database.connections.'.$this->name, $conn);\n \n $DB=\\DB::connection($this->name);\n\n //Connection\n try {\n \\DB::connection($this->name)->getPdo();\n } \n catch(\\PDOException $e) { \n return $e->getMessage();\n }\n \n //Query \n try {\n $ret=$DB->select($query);\n }\n catch(\\PDOException $err) {\n return $err->getMessage(); \n }\n \n return collect($ret)->toJson();\n\n } else {\n return 'Error: only SELECT queries area allowed. INVALID keyword included.';\n } \n\n } else {\n return 'Error: only SELECT queries area allowed.';\n } \n \n }", "public function execute($sql) {\n\t\tif(SYS_USE_FIREPHP==1)\n\t\t\tPhpBURN_Message::output(\"[!Performing the query!]: $sql\");\n\t\treturn $this->getModel()->getConnection()->executeSQL($sql);\n\t\t//$this->resultSet = &$this->getModel()->getConnection()->executeSQL($sql);\n\t}", "public function execute($query)\n {\n }" ]
[ "0.7303905", "0.72429526", "0.72429526", "0.72429526", "0.7205063", "0.7205063", "0.72020024", "0.718458", "0.71191496", "0.707435", "0.7050414", "0.70229256", "0.69604087", "0.6915769", "0.68847656", "0.6871295", "0.6816728", "0.68108255", "0.6746749", "0.6744973", "0.67324054", "0.67321944", "0.669905", "0.66973895", "0.6694952", "0.66913044", "0.66504306", "0.6648025", "0.6611102", "0.66037667", "0.65996003", "0.6594403", "0.6594403", "0.6594403", "0.6594403", "0.65815634", "0.65645844", "0.6557782", "0.65558594", "0.655114", "0.65455955", "0.6544439", "0.6539981", "0.65373105", "0.6527055", "0.65169716", "0.6511818", "0.6493235", "0.64931077", "0.6486427", "0.64679366", "0.64615643", "0.6448524", "0.64390224", "0.6434025", "0.6423425", "0.64232016", "0.6414359", "0.64088154", "0.64030975", "0.64028597", "0.6397278", "0.63948274", "0.63910055", "0.63910055", "0.63910055", "0.63745576", "0.6370199", "0.6369231", "0.6354497", "0.6348686", "0.6345633", "0.63226926", "0.6315738", "0.63089323", "0.6305697", "0.6304299", "0.63035184", "0.6294342", "0.6292155", "0.62814444", "0.6280306", "0.62735295", "0.6255285", "0.6250079", "0.6247937", "0.62454677", "0.62452644", "0.6238274", "0.62372833", "0.62357014", "0.6220552", "0.6220552", "0.62136394", "0.6213374", "0.6201346", "0.6193784", "0.6182067", "0.61813587", "0.6180304", "0.6178329" ]
0.0
-1
Helper function to build most common HAVING conditional clauses. This method can take a variable number of parameters. If called with two parameters, they are taken as $field and $value with $operator having a value of IN if $value is an array and = otherwise.
public function havingCondition($field, $value = NULL, $operator = NULL);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function having(\n Closure | string $column,\n string $operator,\n Closure | float | int | string | null ...$values\n ) : static {\n return $this->addHaving('AND', $column, $operator, $values);\n }", "public function having($clause, array $params);", "public function buildHaving(array $having = null, array &$values = [])\n {\n if ($having === null) {\n return '';\n }\n\n return 'HAVING ' . $this->buildCondition($having, $values);\n }", "private function buildHaving(): void {\r\n\r\n if(count($this -> having) > 0) {\r\n\r\n $this -> query[] = 'HAVING';\r\n $this -> query[] = sprintf('(%s)', implode(' AND ', $this -> having));\r\n }\r\n }", "public static function having($prop, $value = PDODBNULL, $operator = '=', $cond = 'AND'){\r\n return self::$PDO->having($prop,$value,$operator,$cond);\r\n }", "public function having()\n {\n $args = func_get_args();\n $count = count($args);\n \n if ($count == 1) {\n $this->having[] = $args[0];\n } else {\n $this->having[] = array_shift($args);\n \n if ($count == 2 && is_array($args[0]))\n $args = $args[0];\n \n if ($args)\n $this->having_params = array_merge($this->having_params, $args);\n }\n return $this;\n }", "public function makeGroupByWithHaving( $options ) {\n\t\t$sql = '';\n\t\tif ( isset( $options['GROUP BY'] ) ) {\n\t\t\t$gb = is_array( $options['GROUP BY'] )\n\t\t\t\t? implode( ',', $options['GROUP BY'] )\n\t\t\t\t: $options['GROUP BY'];\n\t\t\t$sql .= ' GROUP BY ' . $gb;\n\t\t}\n\t\tif ( isset( $options['HAVING'] ) ) {\n\t\t\t$having = is_array( $options['HAVING'] )\n\t\t\t\t? $this->makeList( $options['HAVING'], LIST_AND )\n\t\t\t\t: $options['HAVING'];\n\t\t\t$sql .= ' HAVING ' . $having;\n\t\t}\n\n\t\treturn $sql;\n\t}", "public function orHaving(\n Closure | string $column,\n string $operator,\n Closure | float | int | string | null ...$values\n ) : static {\n return $this->addHaving('OR', $column, $operator, $values);\n }", "private function addHaving(\n string $glue,\n array | Closure | string $column,\n string $operator,\n array $values\n ) : static {\n return $this->addWhere($glue, $column, $operator, $values, 'having');\n }", "public function and_having($column, $op = null, $value = null)\n {\n if(func_num_args() === 2)\n {\n $value = $op;\n $op = '=';\n }\n\n $this->_having[] = array('AND' => array($column, $op, $value));\n\n return $this;\n }", "public function andWhere($field, $operator, $value);", "public function having($field, $value = null, $comparitor = null);", "private function buildWhere ($array) {\n\n // Only do anything if the array contains anything\n if($array){ \n\n // Loop through the array where $key is the column name and $value are the \n // array containing the operator [0] and values [1]\n foreach($array as $key => $value){ \n\n // We set each element of the where clause to $this->where before setting it to\n // $this->show_where. If it already exists we must have already have something\n // in the where clause so set $preSql to ' AND ' otherwise set it to ' WHERE '\n $preSql = (isset($this->where)) ? ' AND ' : ' WHERE ';\n\n // As we need different ways of building the where clause elements, depending on\n // the operator ($value[0]), we run a switch statement to call the function to\n // build the correct type of element, passing in the field name ($key) and the\n // operator and criteria ($value array)\n switch($value[0]) {\n case '>':\n case '<':\n case '=':\n case '<=':\n case '>=':\n case '!=':\n case '<>':\n case 'LIKE':\n $this->where = $this->whereElementStandard ($key, $value);\n break;\n\n case 'IN':\n $this->where = $this->whereElementIn ($key, $value); \n break;\n\n case 'BETWEEN':\n $this->where = $this->whereElementBetween ($key, $value); \n break;\n case 'NULL':\n case 'NOT NULL':\n $this->where = $this->whereElementNull ($key, $value); \n break;\n\n default:\n $this->where = $this->whereElementStandard ($key, $value);\n break;\n } // End switch\n\n \n // Add the created where clause elements to $this->show_where\n $this->show_where .= $preSql.$this->where;\n } // End foreach\n } // End if $array\n }", "public function getHavingParameterised(&$parameters)\n {\n $this->splitQueryParameters($this->having, $conditions, $parameters);\n return $conditions;\n }", "public function condition()\n {\n $op = $this->getDefaultOperator();\n $params = func_get_args();\n \n switch (count($params)) {\n case 1:\n if (is_string($params[0])) {\n $this->addCondition('literal', [$params[0]]);\n } elseif (is_array($params[0])) {\n $combination = $this->getDefaultOperator();\n \n /**\n * The code within the foreach is an extraction of Zend\\Db\\Sql\\Select::where()\n */\n foreach ($params[0] as $pkey => $pvalue) {\n if (is_string($pkey) && strpos($pkey, '?') !== false) {\n # ['id = ?' => 1]\n # ['id IN (?, ?, ?)' => [1, 3, 4]]\n $predicate = new ZfPredicate\\Expression($pkey, $pvalue);\n } elseif (is_string($pkey)) {\n if ($pvalue === null) {\n # ['name' => null] -> \"ISNULL(name)\"\n $predicate = new ZfPredicate\\IsNull($pkey, $pvalue);\n } elseif (is_array($pvalue)) {\n # ['id' => [1, 2, 3]] -> \"id IN (1, 2, 3)\"\n $predicate = new ZfPredicate\\In($pkey, $pvalue);\n } else {\n # ['id' => $id] -> \"id = 15\"\n $predicate = new ZfPredicate\\Operator($pkey, ZfPredicate\\Operator::OP_EQ, $pvalue);\n }\n } elseif ($pvalue instanceof ZfPredicate\\PredicateInterface) {\n $predicate = $pvalue;\n } else {\n # ['id = ?'] -> \"id = ''\"\n # ['id = 1'] -> literal.\n $predicate = (strpos($pvalue, Expression::PLACEHOLDER) !== false)\n ? new ZfPredicate\\Expression($pvalue) : new ZfPredicate\\Literal($pvalue);\n }\n $this->getCurrentPredicate()->addPredicate($predicate, $combination);\n }\n }\n break;\n \n case 2:\n # $rel->where('foo = ? AND id IN (?) AND bar = ?', [true, [1, 2, 3], false]);\n # If passing a non-array value:\n # $rel->where('foo = ?', 1);\n # But if an array is to be passed, must be inside another array\n # $rel->where('id IN (?)', [[1, 2, 3]]);\n if (!is_array($params[1])) {\n $params[1] = [$params[1]];\n }\n $this->expandPlaceholders($params[0], $params[1]);\n $this->addCondition('expression', [$params[0], $params[1]]);\n break;\n \n case 3:\n # $rel->where('id', '>', 2);\n $this->getCurrentPredicate()->addPredicate(\n new ZfPredicate\\Operator($params[0], $params[1], $params[2])\n );\n break;\n \n default:\n throw new Exception\\BadMethodCallException(\n sprintf(\n \"One to three arguments are expected, %s passed\",\n count($params)\n )\n );\n }\n \n return $this;\n }", "public function having(array $clauseProps){\r\n\r\n foreach ($clauseProps as $key => $value) {\r\n if(is_array($value)){\r\n if(count($value) > 0){\r\n # check that HAVING clause operator supplied is allowed !!\r\n if(!(in_array(strtoupper($value[0]), $this->allowedOperators))){\r\n throw new UnexpectedValueException();\r\n }\r\n }\r\n }\r\n }\r\n\r\n $this->queryString .= (\" HAVING \" . implode(', ', $this->prepareSelectPlaceholder($clauseProps)));\r\n\r\n return $this;\r\n }", "public function where()\n {\n $args = func_get_args();\n $count = count($args);\n \n if ($count == 1) {\n if (is_array($args[0])) {\n # This is expected to be a column => value associated array.\n # In this case, the array is stored as is.\n $this->where[] = $args[0];\n } else {\n # This is expected to be a string.\n $this->where[] = $args[0];\n }\n } elseif ($count) {\n # Case: $query->where(\"foo\", true, \"bar_baz\", $bar);\n if ($count >= 2 && is_int($count / 2) && (!is_array($args[1]) || Toolbox\\ArrayTools::isIndexed($args[1])) && is_bool(strpos($args[0], ' '))) {\n $where = [];\n foreach ($args as $key => $value) {\n $key++;\n if ($key && !($key % 2)) {\n $where[$next_key] = $value;\n } else {\n $next_key = $value;\n }\n }\n $this->where[] = $where;\n } else {\n $this->where[] = array_shift($args);\n \n # Case: $query->where('foo => :foo', ['foo' => $foo]);\n if ($count == 2 && is_array($args[0]) && !Toolbox\\ArrayTools::isIndexed($args[0]))\n $args = $args[0];\n \n if ($args)\n $this->where_params = array_merge($this->where_params, $args);\n }\n }\n return $this;\n }", "public function orHavingIn(\n Closure | string $column,\n Closure | float | int | string | null $value,\n Closure | float | int | string | null ...$values\n ) : static {\n return $this->orHaving($column, 'IN', ...[$value, ...$values]);\n }", "protected function constructWhereClausePart($queryPart, $values) {\n \n $parameters = array(); \n \n// $where = 'WHERE $X{IN,hs_hr_employee.emp_firstname,firstName} AND $X{IN,hs_hr_employee.emp_lastname,lastName}';\n $pattern = '/\\$X\\{(.*?)\\}/';\n\n $callback = function($matches) use ($values, &$parameters) {\n $val = explode(\",\", $matches[1]);\n \n // $X{VAR,name}\n \n if ((count($val) == 2 && $val[0] == 'VAR')) {\n \n $operator = $val[0];\n $name = $val[1]; \n } else {\n \n if (count($val) < 3) { \n throw new ReportException('Invalid filter definition: ' . $matches[0]);\n }\n \n $operator = $val[0];\n $field = $val[1];\n $name = $val[2]; \n }\n \n // If no value defined for this filter, ignore it (filter is set to true)\n if (!isset($values[$name]) || is_null($values[$name])) {\n return \"true\";\n }\n if ($operator == 'IN') {\n \n $valueArray = $values[$name];\n \n if (!is_array($valueArray) && is_string($valueArray)) {\n $valueArray = explode(',', $valueArray);\n }\n if (!is_array($valueArray) || count($valueArray) == 0) {\n return \"true\";\n } \n\n $placeHolders = rtrim(str_repeat('?,', count($valueArray)), ',');\n $clause = $field . \" IN (\" . $placeHolders . \")\";\n \n $parameters = array_merge($parameters, $valueArray);\n\n } else if ($operator == '=') {\n $clause = $field . ' = ?';\n $parameters[] = $values[$name];\n \n } else if ($operator == 'BETWEEN') {\n $clause = $field . ' BETWEEN ? AND ?';\n $parameters[] = $values[$name]['from'];\n $parameters[] = $values[$name]['to'];\n } else if ($operator == '>') {\n $clause = $field . ' > ?';\n $parameters[] = $values[$name];\n } else if ($operator == '<') {\n $clause = $field . ' < ?';\n $parameters[] = $values[$name];\n } else if ($operator == '>=') {\n $clause = $field . ' >= ?';\n $parameters[] = $values[$name];\n } else if ($operator == '<=') {\n $clause = $field . ' <= ?';\n $parameters[] = $values[$name];\n } else if ($operator == 'IS NOT NULL') {\n if ($values[$name] == 'TRUE') {\n $clause = $field . ' IS NOT NULL';\n } else {\n $clause = 'true';\n }\n } else if ($operator == 'IS NULL') {\n if ($values[$name] == 'TRUE') {\n $clause = $field . ' IS NULL';\n } else {\n $clause = 'true';\n }\n } else if ($operator == 'VAR') {\n $clause = $values[$name];\n } \n\n return $clause;\n };\n\n $str = preg_replace_callback($pattern, $callback, $queryPart);\n\n return array($str, $parameters);\n }", "public function orHaving($prop, $value = PDODBNULL, $operator = '='){\r\n return $this->where($prop,$value,$operator,'OR');\r\n }", "public static function orHaving($prop, $value = PDODBNULL, $operator = '='){\r\n return self::$PDO->orHaving($prop,$value,$operator);\r\n }", "public function having($prop, $value = PDODBNULL, $operator = '=', $cond = 'AND'){\r\n $this->_having[] = array($prop,$value,$operator,$cond);\r\n return $this;\r\n }", "function where( ...$getwherekeys) { \n $whereorhaving = ($this->iswhere) ? 'WHERE' : 'HAVING';\n $this->iswhere = true;\n \n\t\tif (!empty($getwherekeys)){\n\t\t\tif (is_string($getwherekeys[0])) {\n\t\t\t\tforeach ($getwherekeys as $makearray) \n\t\t\t\t\t$wherekeys[] = explode(' ',$makearray);\t\n\t\t\t} else \n\t\t\t\t$wherekeys = $getwherekeys;\t\t\t\n\t\t} else \n\t\t\treturn '';\n\t\t\n\t\tforeach ($wherekeys as $values) {\n\t\t\t$operator[] = (isset($values[1])) ? $values[1]: '';\n\t\t\tif (!empty($values[1])){\n\t\t\t\tif (strtoupper($values[1]) == 'IN') {\n\t\t\t\t\t$wherekey[ $values[0] ] = array_slice($values,2);\n\t\t\t\t\t$combiner[] = (isset($values[3])) ? $values[3]: _AND;\n\t\t\t\t\t$extra[] = (isset($values[4])) ? $values[4]: null;\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\t$wherekey[ (isset($values[0])) ? $values[0] : '1' ] = (isset($values[2])) ? $values[2] : '' ;\n\t\t\t\t\t$combiner[] = (isset($values[3])) ? $values[3]: _AND;\n\t\t\t\t\t$extra[] = (isset($values[4])) ? $values[4]: null;\n\t\t\t\t}\t\t\t\t\n\t\t\t} else {\n $this->setParamaters();\n\t\t\t\treturn false;\n } \n\t\t}\n \n $where='1'; \n if (! isset($wherekey['1'])) {\n $where='';\n $i=0;\n $needtoskip=false;\n foreach($wherekey as $key=>$val) {\n $iscondition = strtoupper($operator[$i]);\n\t\t\t\t$combine = $combiner[$i];\n\t\t\t\tif ( in_array(strtoupper($combine), array( 'AND', 'OR', 'NOT', 'AND NOT' )) || isset($extra[$i])) \n\t\t\t\t\t$combinewith = (isset($extra[$i])) ? $combine : strtoupper($combine);\n\t\t\t\telse \n\t\t\t\t\t$combinewith = _AND;\n if (! in_array( $iscondition, array( '<', '>', '=', '!=', '>=', '<=', '<>', 'IN', 'LIKE', 'NOT LIKE', 'BETWEEN', 'NOT BETWEEN', 'IS', 'IS NOT' ) )) {\n $this->setParamaters();\n return false;\n } else {\n if (($iscondition=='BETWEEN') || ($iscondition=='NOT BETWEEN')) {\n\t\t\t\t\t\t$value = $this->escape($combinewith);\n\t\t\t\t\t\tif (in_array(strtoupper($extra[$i]), array( 'AND', 'OR', 'NOT', 'AND NOT' ))) \n\t\t\t\t\t\t\t$mycombinewith = strtoupper($extra[$i]);\n\t\t\t\t\t\telse \n $mycombinewith = _AND;\n\t\t\t\t\t\tif ($this->getPrepare()) {\n\t\t\t\t\t\t\t$where.= \"$key \".$iscondition.' '._TAG.\" AND \"._TAG.\" $mycombinewith \";\n\t\t\t\t\t\t\t$this->setParamaters($val);\n\t\t\t\t\t\t\t$this->setParamaters($combinewith);\n\t\t\t\t\t\t} else \n\t\t\t\t\t\t\t$where.= \"$key \".$iscondition.\" '\".$this->escape($val).\"' AND '\".$value.\"' $mycombinewith \";\n\t\t\t\t\t\t$combinewith = $mycombinewith;\n\t\t\t\t\t} elseif ($iscondition=='IN') {\n\t\t\t\t\t\t$value = '';\n\t\t\t\t\t\tforeach ($val as $invalues) {\n\t\t\t\t\t\t\tif ($this->getPrepare()) {\n\t\t\t\t\t\t\t\t$value .= _TAG.', ';\n\t\t\t\t\t\t\t\t$this->setParamaters($invalues);\n\t\t\t\t\t\t\t} else \n\t\t\t\t\t\t\t\t$value .= \"'\".$this->escape($invalues).\"', \";\n\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$where.= \"$key \".$iscondition.\" ( \".rtrim($value, ', ').\" ) $combinewith \";\n\t\t\t\t\t} elseif(((strtolower($val)=='null') || ($iscondition=='IS') || ($iscondition=='IS NOT'))) {\n $iscondition = (($iscondition=='IS') || ($iscondition=='IS NOT')) ? $iscondition : 'IS';\n $where.= \"$key \".$iscondition.\" NULL $combinewith \";\n } elseif((($iscondition=='LIKE') || ($iscondition=='NOT LIKE')) && ! preg_match('/[_%?]/',$val)) return false;\n else {\n\t\t\t\t\t\tif ($this->getPrepare()) {\n\t\t\t\t\t\t\t$where.= \"$key \".$iscondition.' '._TAG.\" $combinewith \";\n\t\t\t\t\t\t\t$this->setParamaters($val);\n\t\t\t\t\t\t} else \n\t\t\t\t\t\t\t$where.= \"$key \".$iscondition.\" '\".$this->escape($val).\"' $combinewith \";\n\t\t\t\t\t}\n $i++;\n }\n }\n $where = rtrim($where, \" $combinewith \");\n }\n\t\t\n if (($this->getPrepare()) && !empty($this->getParamaters()) && ($where!='1'))\n\t\t\treturn \" $whereorhaving \".$where.' ';\n\t\telse\n\t\t\treturn ($where!='1') ? \" $whereorhaving \".$where.' ' : ' ' ;\n }", "function custom_conds( $conds = array()) {\n\n\t}", "public function resolveConditionData($params)\n {\n $dataWhere = \"\";\n\n $lowerKeyd = array_change_key_case($params, CASE_LOWER);\n $glue = strtoupper(isset($lowerKeyd[self::OPERATOR_PREFIX . 'operator']) && strtolower($lowerKeyd[self::OPERATOR_PREFIX . 'operator']) == \"or\" ? \"OR\" : \"AND\");\n unset($lowerKeyd);\n\n foreach ($params as $k => $v) {\n if (strpos($k, self::OPERATOR_PREFIX) === 0) {\n continue;\n }\n if (is_numeric($k)) {\n if (is_array($v)) {\n $dataWhere .= ($dataWhere ? \" {$glue} (\" : \"(\") . $this->resolveConditionData($v) . \")\";\n }\n else { // raw\n $dataWhere .= ($dataWhere ? \" {$glue} \" : \"\") . $v;\n }\n }\n else {\n $expl = explode(\" \", $k, 2);\n $operator = count($expl) > 1 ? $expl[1] : \"=\";\n if ($operator == \"=\" && (is_array($v))) {\n $operator = \"IN\";\n }\n if ($operator == \"!=\" && (is_array($v))) {\n $operator = \"NOT IN\";\n }\n if ($operator == \"=\" && ($v === NULL)) {\n $operator = \"IS\";\n }\n if ($operator == \"!=\" && ($v === NULL)) {\n $operator = \"IS NOT\";\n }\n $dontQuote = false;\n if ($v === NULL) {\n $v = \"NULL\";\n $dontQuote = true;\n }\n if ($v === TRUE) {\n $v = 1;\n }\n if ($v === FALSE) {\n $v = 0;\n }\n $column = $expl[0];\n if (strpos($column, self::DONT_QUOTE_VALUE_PREFIX) === 0) {\n $column = substr($column, 1);\n $dontQuote = true;\n }\n $dataWhere .= ($dataWhere ? \" {$glue} \" : \"\") . $this->quoteColumn($column) . \" {$operator} \" . $this->_quoteVal($v, $dontQuote);\n }\n }\n\n return $dataWhere;\n }", "public function whereHas($relation, $field, $operator, $value);", "public function and_having($column, $op, $value = NULL){\n $this->_having[] = array('AND' => array($column, $op, $value));\n\n return $this;\n }", "public function testBuildWhereWithTwoArguments()\n {\n $query = $this->getQuery()\n ->where('param1', 'value1')\n ->where('param2', 'in', ['value2', 'value3'])\n ;\n\n $this->assertSame(\n \"WHERE param1 = 'value1' AND param2 IN ('value2', 'value3')\",\n $query->buildWhere()\n );\n }", "public function orWhereIn()\n {\n list($field, $value) = $this->extractQueryToFieldAndValue(func_get_args());\n if (!is_array($value)) {\n $value = [$value];\n }\n return $this->addOrWhereStack([$field => [self::OPERATORS['in'] => $value]]); \n }", "public function addHavingWithVariables($condition, array $variables) {\n $condition = $this->parseVariables($condition, $variables);\n\n parent::addHavingWithVariables($condition, array());\n }", "public function where(array $array = array(), $operator = 'and') {\n $where = '';\n $counter = 0;\n foreach ($array as $key => $value) {\n $this->placeHolder[\":$key\"] = $value;\n if ($counter > 0) {\n $where.=\" $operator `$key`=:$key\";\n } else {\n $where.=\"`$key`=:$key\";\n }\n $counter++;\n }\n // $where = trim($where, $operator);\n $this->sql.=\" WHERE \" . $where;\n }", "public function testBuildWhereWithTwoArgumentsAndAlias()\n {\n $query = $this->getQuery()\n ->alias('alias')\n ->where('param1', 'value1')\n ->where('param2', 'in', ['value2', 'value3'])\n ;\n\n $this->assertSame(\n \"WHERE alias.param1 = 'value1' AND alias.param2 IN ('value2', 'value3')\",\n $query->buildWhere()\n );\n }", "public function havingAnd()\n {\n $this->having .= \" AND \";\n }", "function filter($exprs=array(), $gexprs=array())\n\t{\n\t\t$where = array('sql'=>array(), 'args'=>array());\n\t\t$having = array('sql'=>array(), 'args'=>array());\n\t\tforeach($_REQUEST as $k=>$v) {\n\t\t\t$args = array();\n\t\t\t$sql = array();\n\n\t\t\tif($v === '') continue;\n\t\t\tif(!preg_match('|^f_[dts]_|', $k)) continue;\n\t\t\t$t = substr($k, 2, 1);\n\t\t\t$k = substr($k, 4);\n\t\t\t// only alphanumerics allowed\n\t\t\tif(!preg_match('|^[A-z0-9_-]+$|', $k)) continue;\n\t\t\tswitch($t) {\n\t\t\t\tcase 'd': $coltype = 'date'; break;\n\t\t\t\tcase 's': $coltype = 'select'; break;\n\t\t\t\tcase 't':\n\t\t\t\tdefault: $coltype = 'text';\n\t\t\t}\n\n\t\t\t// look for an expression passed to the function first -- this is\n\t\t\t// used for trickier SQL expressions, eg, functions\n\t\t\tif(isset($exprs[$k])) {\n\t\t\t\t$s = $exprs[$k];\n\t\t\t\t$t = 'where';\n\t\t\t} else if(isset($gexprs[$k])) {\n\t\t\t\t$s = $gexprs[$k];\n\t\t\t\t$t = 'having';\n\t\t\t} else {\n\t\t\t\t// use the literal column name\n\t\t\t\t$s = \"\\\"$k\\\"\";\n\t\t\t\t$t = 'where';\n\t\t\t}\n\n\t\t\t$range = explode('<>', $v);\n\t\t\tif(count($range) == 2) {\n\t\t\t\t// double-bounded range\n\t\t\t\t$sql[] = \"($s>='%s' AND $s<='%s')\";\n\t\t\t\t$args[] = $range[0];\n\t\t\t\t$args[] = $range[1];\n\t\t\t} else if(strlen($v) == 1) {\n\t\t\t\t// no range (explicit)\n\t\t\t\t// FYI: this check is needed, as the \"else\" block assumes\n\t\t\t\t// a string length of at least 2\n\t\t\t\t$sql[] = is_numeric($v) ? \"$s='%s'\" : \"$s LIKE '%%s%'\";\n\t\t\t\t$args[] = $v;\n\t\t\t} else {\n\t\t\t\t// everything else: single-bounded range, eq, neq, like, not like\n\t\t\t\t$chop = 0;\n\t\t\t\t$like = false;\n\t\t\t\tswitch(substr($v, 0, 1)) {\n\t\t\t\t\tcase '=': // exactly equals to\n\t\t\t\t\t\t$s .= '=';\n\t\t\t\t\t\t$chop = 1;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase '>': // greater than\n\t\t\t\t\t\tif(substr($v, 1, 1) == '=') {\n\t\t\t\t\t\t\t$s .= '>=';\n\t\t\t\t\t\t\t$chop = 2;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$s .= '>';\n\t\t\t\t\t\t\t$chop = 1;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase '<': // less than\n\t\t\t\t\t\tif(substr($v, 1, 1) == '=') { \n\t\t\t\t\t\t\t$s .= '<=';\n\t\t\t\t\t\t\t$chop = 2;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$s .= '<';\n\t\t\t\t\t\t\t$chop = 1;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase '!': // does not contain\n\t\t\t\t\t\tif(substr($v, 1, 1) == '=') {\n\t\t\t\t\t\t\t$s .= '!=';\n\t\t\t\t\t\t\t$chop = 2;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$s .= ' NOT LIKE ';\n\t\t\t\t\t\t\t$chop = 1;\n\t\t\t\t\t\t\t$like = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault: // contains\n\t\t\t\t\t\t$s .= ' LIKE ';\n\t\t\t\t\t\t$like = true;\n\t\t\t\t}\n\t\t\t\t$v = substr($v, $chop);\n\t\t\t\tif($like) {\n\t\t\t\t\t$s .= \"'%%s%'\";\n\t\t\t\t} else {\n\t\t\t\t\t$s .= \"'%s'\";\n\t\t\t\t}\n\t\t\t\t$sql[] = $s;\n\t\t\t\t$args[] = $v;\n\n\t\t\t\t// special handling for various filter types\n\t\t\t\tif($coltype == 'date' && $chop) {\n\t\t\t\t\t// don't include the default '0000-00-00' fields in ranged selections\n\t\t\t\t\t$s = isset($exprs[$k]) ? $exprs[$k] : \"\\\"$k\\\"\";\n\t\t\t\t\t$s .= \"!='0000-00-00'\";\n\t\t\t\t\t$sql[] = $s;\n\t\t\t\t}\n\t\t\t}\n\t\t\tswitch($t) {\n\t\t\t\tcase 'where':\n\t\t\t\t\t$where['sql'] = array_merge($where['sql'], $sql);\n\t\t\t\t\t$where['args'] = array_merge($where['args'], $args);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'having':\n\t\t\t\t\t$having['sql'] = array_merge($having['sql'], $sql);\n\t\t\t\t\t$having['args'] = array_merge($having['args'], $args);\n\t\t\t}\n\t\t}\n\n\t\t// ensure the WHERE clause always has something in it\n\t\t$where['sql'][] = '1=1';\n\n\t\t$final = array(implode(' AND ', $where['sql']), $where['args']);\n\t\tif(!empty($having['sql'])) {\n\t\t\t$final[] = implode(' AND ', $having['sql']);\n\t\t\t$final[] = $having['args'];\n\t\t}\n\n\t\treturn $final;\n\t}", "public function whereComplex()\n {\n return $this->addComplexCondition('and', $this->conditions);\n }", "public function havingIn(\n Closure | string $column,\n Closure | float | int | string | null $value,\n Closure | float | int | string | null ...$values\n ) : static {\n return $this->having($column, 'IN', ...[$value, ...$values]);\n }", "static function add_condition($where=array(),$cond='',$key=NULL,$value=NULL) {\n\tif ($cond) $where['cond'][]=$cond;\n\t$args=func_get_args();\n\tfor ($i=2; $i<count($args); $i=$i+2) {\n\t\tif (isset($args[$i])) $where['value'][$args[$i]]=isset($args[$i+1])?$args[$i+1]:NULL;\n\t}\n\treturn $where;\n}", "function class_arrayFilter($array, $field, $value, $condition)\n{\n //equal\n if ($condition == '=') {\n $condition_1 = true;\n $condition_2 = false;\n $condition_3 = false;\n $condition_4 = false;\n }\n //mayor igual que\n if ($condition == '>=') {\n $condition_1 = false;\n $condition_2 = false;\n $condition_3 = true;\n $condition_4 = false;\n }\n\n //special all\n if ($condition == 'all') {\n $condition_1 = true;\n $condition_2 = true;\n $condition_3 = false;\n $condition_4 = false;\n }\n //special all\n if ($condition == 'contains') {\n $condition_1 = false;\n $condition_2 = false;\n $condition_3 = false;\n $condition_4 = true;\n }\n\n if ($array) {\n $array_filter = array();\n foreach ($array as $row) {\n //Condition 1\n if ($condition_1) {\n if ($row[$field] == $value) {\n $array_filter[] = $row;\n }\n }\n //Condition 2\n if ($condition_2) {\n if ($row[$field] == 0) {\n $array_filter[] = $row;\n }\n }\n //Condition 3\n if ($condition_3) {\n if ($row[$field] >= $value) {\n $array_filter[] = $row;\n }\n }\n //Condition 4\n if ($condition_4) {\n foreach ($row as $key_condition => $row_condition) {\n if (preg_match(\"/\" . $value . \"(.*)/i\", $row[$key_condition])) {\n //if ((@preg_match(\"^\" . $value . \"\", $row[$key_condition],PCRE_CASELESS))) {\n $array_filter[] = $row;\n }\n }\n }\n }\n $debug = 0;\n\n $results = class_array($array_filter, $debug);\n } else {\n $results = null;\n }\n\n return $results;\n}", "public function buildQueryLimits()\n\t{\n\t\tglobal $modSettings;\n\n\t\t$extra_where = [];\n\n\t\tif (!empty($this->_searchParams->_minMsgID) || !empty($this->_searchParams->_maxMsgID))\n\t\t{\n\t\t\t$extra_where[] = 'id >= ' . $this->_searchParams->_minMsgID . ' AND id <= ' . (empty($this->_searchParams->_maxMsgID) ? (int) $modSettings['maxMsgID'] : $this->_searchParams->_maxMsgID);\n\t\t}\n\n\t\tif (!empty($this->_searchParams->topic))\n\t\t{\n\t\t\t$extra_where[] = 'id_topic = ' . (int) $this->_searchParams->topic;\n\t\t}\n\n\t\tif (!empty($this->_searchParams->brd))\n\t\t{\n\t\t\t$extra_where[] = 'id_board IN (' . implode(',', $this->_searchParams->brd) . ')';\n\t\t}\n\n\t\tif (!empty($this->_searchParams->_memberlist))\n\t\t{\n\t\t\t$extra_where[] = 'id_member IN (' . implode(',', $this->_searchParams->_memberlist) . ')';\n\t\t}\n\n\t\treturn $extra_where;\n\t}", "function addConditionalsToQuery($query, $filledFormFields) {\n\t// Testing if we have to fill the conditional of our SQL statement\n\tif(count($filledFormFields) > 0) {\n\t\t$query .= \" WHERE \";\n\n\n\t\t// Adding the conditionals to the query\n\t\t$i = 0;\n\t\tforeach($filledFormFields as $fieldKey => $fieldValue) {\n\t\t\t// Appending the new conditional\n\t\t\t$queryAppendage = $fieldKey . \" LIKE :\" . $fieldKey . \" \";\n\n\t\t\t$query .= $queryAppendage;\n\t\t\t\n\t\t\t// If there's more conditionals after this, append an \"AND\" as well.\n\t\t\tif($i < count($filledFormFields) - 1) \n\t\t\t\t$query .= \" AND \";\n\n\t\t\t$i++;\n\t\t}\n\t}\n\n\treturn $query;\n}", "protected static function whereFormat($where){\n $whereArray = array();\n\n $operate = ' AND ';\n\n foreach ($where as $key => $set){\n if(is_string($set)){\n if(count($where) == 2){\n list($filed,$value) = $where;\n $whereArray[] = $filed . ' = ' . $value;\n }\n if(count($where) == 3){\n list($filed,$exp,$value) = $where;\n if(in_array($exp, array('=','<=','<>','>=')) && $value){\n $whereArray[] = $filed . \" $exp \" . $value;\n }\n if(in_array($exp, array('in','not in')) && $value){\n $value = implode(',', $value);\n $whereArray[] = $filed . \" $exp \" . \" ($value)\";\n }\n }\n break;\n }elseif(is_array($set)){\n if(count($set) == 2){\n list($filed,$value) = $set;\n $whereArray[] = $filed . ' = ' . $value;\n }\n if(count($set) == 3){\n list($filed,$exp,$value) = $set;\n if(in_array($exp, array('=','<=','<>','>=')) && $value){\n $whereArray[] = $filed . \" $exp \" . $value;\n }\n if(in_array($exp, array('in','not in')) && $value){\n $value = implode(',', $value);\n $whereArray[] = $filed . \" $exp \" . \" ($value)\";\n }\n }\n }\n\n }\n return implode($operate, $whereArray);\n }", "function custom_conds( $conds = array())\n\t{\n\t\t// rating_id condition\n\t\tif ( isset( $conds['id'] )) {\n\t\t\t$this->db->where( 'id', $conds['id'] );\n\t\t}\n\n\t\t// user_id condition\n\t\tif ( isset( $conds['user_id'] )) {\n\t\t\t$this->db->where( 'user_id', $conds['user_id'] );\n\t\t}\n\n\t\t// shop_id condition\n\t\tif ( isset( $conds['shop_id'] )) {\n\t\t\t$this->db->where( 'shop_id', $conds['shop_id'] );\n\t\t}\n\n\t\t// rating condition\n\t\tif ( isset( $conds['rating'] )) {\n\t\t\t$this->db->where( 'rating', $conds['rating'] );\n\t\t}\n\n\t\t// title condition\n\t\tif ( isset( $conds['title'] )) {\n\t\t\t$this->db->where( 'title', $conds['title'] );\n\t\t}\n\n\t\t// description condition\n\t\tif ( isset( $conds['description'] )) {\n\t\t\t$this->db->where( 'description', $conds['description'] );\n\t\t}\n\n\t\t$this->db->order_by( 'added_date', 'desc' );\n\t}", "public function where($field, $value, $comparison = '==', $logical = 'and');", "public function andWhere() {\r\n\t\t$args = func_get_args();\r\n\t\t$statement = array_shift($args);\r\n\t\t//if ( (count($args) == 1) && (is_null($args[0])) ) {\r\n\t\t//\t$this->_wheres = array();\r\n\t\t//\treturn null;\r\n\t\t//}\r\n\t\t$criteria = new Dbi_Sql_Criteria($this, new Dbi_Sql_Expression($statement, $args));\r\n\t\t$this->_wheres[] = $criteria;\r\n\t\treturn $criteria;\r\n\t}", "protected function makeSqlCriteria($values, $keyFields, $alias = '', $default = '0') {\n if (!count($values)) return $default;\n // TODO: Optimization 1: remove duplicates from values! (how??? sort keys??? make a tree???)\n // TODO: Optimization 2: make nested criterias depending on values cardinality\n $values = Ac_Util::array_unique($values); \n $db = $this->db;\n $qAlias = strlen($alias)? $alias.'.' : $alias;\n if (is_array($keyFields)) {\n if (count($keyFields) === 1) {\n $qValues = array();\n $qKeyField = $db->n($keyFields[0]);\n foreach ($values as $val) $qValues[] = $db->q(is_array($val)? $val[0] : $val);\n $qValues = array_unique($qValues);\n if (count($qValues) === 1) $res = $qAlias.$qKeyField.' = '.$qValues[0];\n else $res = $qAlias.$qKeyField.' IN('.implode(\",\", $qValues).')';\n } else {\n $cKeyFields = count($keyFields);\n $bKeyFields = $cKeyFields - 1;\n $qKeyFields = array();\n foreach ($keyFields as $keyField) $qKeyFields[] = $qAlias.$db->n($keyField);\n $crit = array();\n foreach ($values as $valArray) {\n $c = '';\n for ($i = 0; $i < $bKeyFields; $i++) {\n $c .= $qKeyFields[$i].'='.$db->q($valArray[$i]).' AND ';\n }\n $crit[] = $c.$qKeyFields[$bKeyFields].' = '.$db->q($valArray[$bKeyFields]);\n }\n $res = '('.implode(')OR(', $crit).')';\n }\n } else {\n $qValues = array();\n $qKeyField = $db->NameQuote($keyFields);\n foreach ($values as $val) $qValues[] = $db->Quote($val);\n if (count($qValues) === 1) $res = $qAlias.$qKeyField.' = '.$qValues[0];\n else $res = $qAlias.$qKeyField.' IN('.implode(\",\", $qValues).')';\n }\n return $res;\n }", "function _parse_where_clause($condition)\n {\n $column = '';\n $operator = '';\n $value = '';\n $numeric = TRUE;\n // Substitute any placeholders\n global $wpdb;\n $binds = func_get_args();\n $binds = isset($binds[1]) ? $binds[1] : array();\n // first argument is the condition\n foreach ($binds as &$bind) {\n // A bind could be an array, used for the 'IN' operator\n // or a simple scalar value. We need to convert arrays\n // into scalar values\n if (is_object($bind)) {\n $bind = (array) $bind;\n }\n if (is_array($bind) && !empty($bind)) {\n foreach ($bind as &$val) {\n if (!is_numeric($val)) {\n $val = '\"' . addslashes($val) . '\"';\n $numeric = FALSE;\n }\n }\n $bind = implode(',', $bind);\n } else {\n if (is_array($bind) && empty($bind)) {\n $bind = 'NULL';\n } else {\n if (!is_numeric($bind)) {\n $numeric = FALSE;\n }\n }\n }\n }\n if ($binds) {\n $condition = $wpdb->prepare($condition, $binds);\n }\n // Parse the where clause\n if (preg_match(\"/^[^\\\\s]+/\", $condition, $match)) {\n $column = trim(array_shift($match));\n $condition = str_replace($column, '', $condition);\n }\n if (preg_match(\"/(NOT )?IN|(NOT )?LIKE|(NOT )?BETWEEN|[=!<>]+/i\", $condition, $match)) {\n $operator = trim(array_shift($match));\n $condition = str_replace($operator, '', $condition);\n $operator = strtolower($operator);\n $value = trim($condition);\n }\n // Values will automatically be quoted, so remove them\n // If the value is part of an IN clause or BETWEEN clause and\n // has multiple values, we attempt to split the values apart into an\n // array and iterate over them individually\n if ($operator == 'in') {\n $values = preg_split(\"/'?\\\\s?(,)\\\\s?'?/i\", $value);\n } elseif ($operator == 'between') {\n $values = preg_split(\"/'?\\\\s?(AND)\\\\s?'?/i\", $value);\n }\n // If there's a single value, treat it as an array so that we\n // can still iterate\n if (empty($values)) {\n $values = array($value);\n }\n foreach ($values as $index => $value) {\n $value = preg_replace(\"/^(\\\\()?'/\", '', $value);\n $value = preg_replace(\"/'(\\\\))?\\$/\", '', $value);\n $values[$index] = $value;\n }\n if (count($values) > 1) {\n $value = $values;\n }\n // Return the WP Query meta query parameters\n $retval = array('column' => $column, 'value' => $value, 'compare' => strtoupper($operator), 'type' => $numeric ? 'numeric' : 'string');\n return $retval;\n }", "function db_where($where, $join_and = true) {\n $where_clause = array();\n\n if (is_array($where)) {\n foreach ($where as $key => $value) {\n if (is_numeric($key)) {\n $where_clause[] = $value;\n } else {\n if (db_where_key_has_condition($key)) {\n // if has condition with it?\n // i.e array('name =' => $var) or array('age >' => $int)\n $where_clause[] = \" {$key} \\\"\".mres($value).\"\\\" \";\n } else {\n $where_clause[] = \" {$key} = \\\"\".mres($value).\"\\\" \";\n }\n }\n }\n } else {\n $where_clause[] = $where;\n }\n\n return '('.join($join_and ? ' AND ' : ' OR ', $where_clause).')';\n}", "function AndWhereClause() {\n\t\t$this->clauses = func_get_args();\n\t}", "private function _sql_filter_posts($column, $operator, $value) {\n\n\t\tif ( empty($value) ) {\n\t\t\treturn '';\n\t\t}\n\n\t\tglobal $wpdb;\n\t\t\n\t\t$sub_query = '1 AND';\n\t\t$line_item_join_rule = 'OR'; // TODO\n\t\t\n\t\tswitch($operator) {\n\t\t\tcase 'starts_with': \n\n\t\t\t\tif ( is_array($value) ) {\n\t\t\t\t\tforeach ($value as &$v) {\n\t\t\t\t\t\t$v = $wpdb->prepare('%s', $v.'%');\n\t\t\t\t\t\t$sub_query .= sprint(\" %s {$wpdb->posts}.$column LIKE %s\", $line_item_join_rule, $v);\n\t\t\t\t\t}\n\t\t\t\t\treturn \" {$this->join_rule} ($sub_query)\";\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$value = $wpdb->prepare('%s', $value.'%');\n\t\t\t\t\treturn sprintf(\" {$this->join_rule} {$wpdb->posts}.$column LIKE %s\", $value);\n\t\t\t\t}\n\t\t\t\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase 'ends_with': \n\n\t\t\t\tif ( is_array($value) ) {\n\t\t\t\t\tforeach ($value as &$v) {\n\t\t\t\t\t\t$v = $wpdb->prepare('%s', '%'.$v);\n\t\t\t\t\t\t$sub_query .= sprint(\" %s {$wpdb->posts}.$column LIKE %s\", $line_item_join_rule, $v);\n\t\t\t\t\t}\n\t\t\t\t\treturn \" {$this->join_rule} ($sub_query)\";\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$value = $wpdb->prepare('%s', '%'.$value);\n\t\t\t\t\treturn sprintf(\" {$this->join_rule} {$wpdb->posts}.$column LIKE %s\", $value);\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'like': \n\n\t\t\t\tif ( is_array($value) ) {\n\t\t\t\t\tforeach ($value as &$v) {\n\t\t\t\t\t\t$v = $wpdb->prepare('%s', '%'.$v.'%');\n\t\t\t\t\t\t$sub_query .= sprint(\" %s {$wpdb->posts}.$column LIKE %s\", $line_item_join_rule, $v);\n\t\t\t\t\t}\n\t\t\t\t\treturn \" {$this->join_rule} ($sub_query)\";\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$value = $wpdb->prepare('%s', '%'.$value);\n\t\t\t\t\treturn sprintf(\" {$this->join_rule} {$wpdb->posts}.$column LIKE %s\", $value);\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'not_like': \n\n\t\t\t\tif ( is_array($value) ) {\n\t\t\t\t\tforeach ($value as &$v) {\n\t\t\t\t\t\t$v = $wpdb->prepare('%s', '%'.$v.'%');\n\t\t\t\t\t\t$sub_query .= sprint(\" %s {$wpdb->posts}.$column NOT LIKE %s\", $line_item_join_rule, $v);\n\t\t\t\t\t}\n\t\t\t\t\treturn \" {$this->join_rule} ($sub_query)\";\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$value = $wpdb->prepare('%s', '%'.$value);\n\t\t\t\t\treturn sprintf(\" {$this->join_rule} {$wpdb->posts}.$column NOT LIKE %s\", $value);\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\n\n\t\t\t// Arrays make no sense for these guys:\n\t\t\tcase '>':\n\t\t\tcase '>=':\n\t\t\tcase '<':\n\t\t\tcase '<=':\n\t\t\t\tif ( is_array($value) ) {\n\t\t\t\t\t$this->errors[] = sprintf(__('The %s operator cannot operate on an array of values.', CCTM_TXTDOMAIN), $operator);\n\t\t\t\t\treturn '';\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\treturn sprintf(\" {$this->join_rule} {$wpdb->posts}.$column $operator %s\", $wpdb->prepare('%s',$value));\n\t\t\t\t\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase '=':\n\t\t\t\tif ( is_array($value) ) {\n\t\t\t\t\tforeach ($value as &$v) {\n\t\t\t\t\t\t$v = $wpdb->prepare('%s', $v);\n\t\t\t\t\t}\n\t\t\n\t\t\t\t\t$value = '('. implode(',', $value) . ')';\n\t\t\t\t\treturn sprintf(\" {$this->join_rule} {$wpdb->posts}.$column IN %s\", $value);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\treturn sprintf(\" {$this->join_rule} {$wpdb->posts}.$column = %s\", $wpdb->prepare('%s',$value));\n\t\t\t\t}\n\t\t\t\n\n\t\t\tcase '!=':\n\t\t\t\tif ( is_array($value) ) {\n\t\t\t\t\tforeach ($value as &$v) {\n\t\t\t\t\t\t$v = $wpdb->prepare('%s', $v);\n\t\t\t\t\t}\n\t\t\n\t\t\t\t\t$value = '('. implode(',', $value) . ')';\n\t\t\t\t\treturn sprintf(\" {$this->join_rule} {$wpdb->posts}.$column NOT IN %s\", $value);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\treturn sprintf(\" {$this->join_rule} {$wpdb->posts}.$column != %s\", $wpdb->prepare('%s',$value));\n\t\t\t\t}\n\t\t}\n\t}", "public function parseWhere(&$arguments)\n {\n /* Initiate some variables */\n $clause = '';\n $Where = array();\n\n /* Go through each word of the query until we need to stop */\n while ($word = $this->getNextWord(true)) {\n if (strtolower(substr($word, 0, 3)) == 'set') {\n $this->c -= strlen($word) + 1;\n break;\n }\n\n switch (strtolower($word)) {\n /* Back up if we find these keywords */\n case 'from':\n {\n $this->c -= 5;\n\n break 2;\n }\n\n case 'limit':\n {\n $this->c -= 6;\n\n break 2;\n }\n\n case 'orderby':\n {\n $this->c -= 8;\n\n break 2;\n }\n\n /* Look for logical operators */\n case 'and':\n case 'or':\n case 'xor':\n {\n $Where[] = $clause;\n $Where[] = $word;\n $clause = '';\n\n break;\n }\n\n /* Append the current value to the clause */\n default:\n {\n $this->c -= strlen($word) + 1;\n $clause .= $this->getNextWord(true) . ' ';\n }\n }\n }\n\n /* Add the the last element onto the $Where array */\n $Where[] = substr($clause, 0, strlen($clause) - 1);\n $arguments['where'] = $Where;\n\n foreach ($arguments['where'] as $key => $value) {\n if ($key <= count($arguments['where']) - 1) {\n $arguments['where'][$key] = rtrim($value);\n }\n }\n\n return true;\n }", "protected function parse($conditions, $operator = 'AND')\n {\n $result = [];\n\n if(\\is_numeric($conditions)){\n $result = [ sprintf(\"id = %d\", $conditions) ];\n } else if(is_array($conditions)){\n foreach($conditions as $key => $value){\n if(\\is_numeric($key)){\n if(\\is_numeric($value)){\n $result[] = sprintf(\"id = %d\", $value);\n } else if(is_string($value)){\n $result[] = $value;\n } else if(is_array($value) && count($value) == 3){\n //caso [ columna, operador, valorDeseado ]\n $result[] = sprintf(\"%s %s '%s'\", ...$value);\n } else {\n throw new \\Exception(\"Unexpected condition format\");\n }\n } else if(is_string($key)) {\n if(is_array($value)){\n $result[] = sprintf(\n \"%s IN(%s)\",\n $key,\n implode(\n ', ',\n array_map(\n function($e){\n if(\\is_numeric($e)){\n return $e;\n }\n return \"'{$e}'\";\n },\n $value\n )\n )\n );\n } else {\n $result[] = sprintf(\"%s = '%s'\", $key, $value);\n }\n } else {\n throw new \\Exception(\"Not implemented 2!\");\n }\n }\n }\n\n return $result;\n }", "public function having(string ...$conditions): self {\r\n\r\n $this -> having = array_merge($this -> having, $conditions);\r\n return $this;\r\n }", "public function andWhere($conditions);", "public function where($field=null,$operator=null,$value=null,$model=null){\n if(is_callable($field)){\n if($operator!==null){\n $this->model=$operator;\n }\n call_user_func_array($field,[$this->model]);\n }\n else{\n\n if($this->model==null){\n $this->model=$model;\n }\n\n if($field!==null && $operator!==null && $value!==null){\n $this->where['field'][]=$field;\n $this->where['operator'][]=$operator;\n if(is_callable($value)){\n $value=call_user_func($value);\n $jsonValCheck=json_decode(json_encode($value),1);\n if(is_array($jsonValCheck)){\n $this->where['value'][]=null;\n }\n else{\n $this->where['value'][]=$value;\n }\n\n }\n elseif(is_array($value)){\n $this->where['value']=''.$value[0]::where($value[1][0],\"=\",$value[1][1])->data()->$value[2];\n }\n else{\n $this->where['value'][]=$value;\n }\n\n }\n\n\n }\n\n return $this;\n }", "public function orHaving(){\r\n \t$tb = call_user_func_array(array($this->mask(), 'orHaving'), func_get_args());\r\n\t\treturn $this;\r\n }", "public function arrayConditionArray($field, array $valueArray) {\n\t\t$negated = preg_match('/\\s+(?:NOT)$/', $field);\n\n\t\tif (count($valueArray) === 0) {\n\t\t\t$condition = '1!=1';\n\t\t\tif ($negated) {\n\t\t\t\t$condition = '1=1';\n\t\t\t}\n\t\t\treturn [$condition];\n\t\t}\n\n\t\treturn [$field => $valueArray];\n\n\t\t// 2.x CORE BUG, cannot use yet\n\t\treturn [$field . ' IN' => $valueArray];\n\t}", "public function where($field, $operator, $value);", "private function _getMultipleOptionFilterConditions($params, $field_name, $other_value, $table_name='Rental')\n\t{\n\t\t$safe_field_name = $this->_getSafeFieldName($field_name);\n\t\t$conditions = array();\n\t\t$possibleValues = json_decode($params[$safe_field_name]);\n\t\tif (count($possibleValues) === 0)\n\t\t\treturn null;\n\n\t\t$conditions['OR'] = array(array($table_name . '.' . $field_name => $possibleValues));\n\n\t\tif (in_array($other_value, $possibleValues))\n\t\t\tarray_push($conditions['OR'], array(\n\t\t\t\t$table_name . '.' . $field_name . ' >=' => $other_value\n\t\t\t));\n\n\t\treturn $conditions;\n\t}", "Private function where($tableName,array $conditions,array $options = array()){\n\t\tif(empty ($options))$options = array('prepend' => true ,'join' => ' AND ');\n\t\tif(!isset($options['join'])) $options['join'] = ' AND ';\n\t\t$ops = $this->_operators;\n\t\t$schema = $this->schema[$tableName];\n\t\t$conditions = $this->addSlashesDeep($conditions);\n\t\tswitch (true) {\n\t\t\tcase empty($conditions):\n\t\t\t\treturn '';\n\t\t\tcase is_string($conditions):\n\t\t\t\treturn ($options['prepend']) ? \" WHERE {$conditions}\" : $conditions;\n\t\t\tcase !is_array($conditions):\n\t\t\t\treturn '';\n\t\t}\n\t\t$result = array();\n\n if(count($conditions) > 0 && count($schema) > 0){\n foreach ($conditions as $key => $value) {\n $schema[$key] = isset($schema[$key]) ? $schema[$key] : array();\n switch (true) {\n case strtolower($key) == 'or':\n case strtolower($key) == 'and':\n $result[] = $this->where($tableName,$value,array('prepend' => FALSE,'join' => \" {$key} \"));\n break;\n case (is_numeric($key) && is_array($value)):\n $result[] = $this->where($tableName,$value,array('prepend' => FALSE));\n break;\n case (is_numeric($key) && is_string($value)):\n $result[] = $value;\n break;\n case (is_string($key) && is_array($value) && isset($ops[key($value)])):\n foreach ($value as $op => $val) {\n $result[] = $this->_operator($tableName,$key, array($op => $val), $schema[$key]);\n }\n break;\n case (is_string($key) && is_array($value)):\n $value = join(', ', $this->value($value, $schema[$key]));\n $result[] = \"{$tableName}.{$key} IN ({$value})\";\n break;\n case (is_string($key) && is_string($value) && strpos($value,'%') !== FALSE):\n if(array_key_exists ($key,$this->schema[$tableName])){\n $result[] = \"{$tableName}.{$key} LIKE '{$value}'\";\n }\n else{\n $result[] = \"{$key} LIKE '{$value}'\";\n }\n //$result[] = \"{$tableName}.{$key} LIKE '{$value}'\";\n break;\n default:\n $value = $this->value($value, $schema[$key]);\n $result[] = $tableName.\".\".$key.\" = \".$value;\n break;\n }\n }\n }\n\n\t\tif(count($result)>1){\n\t\t\t$result = \"(\".join($options['join'], $result).\")\";\n\t\t}else{\n\t\t\t$result = join($options['join'], $result);\n\t\t}\n\t\treturn ($options['prepend'] && !empty($result)) ? \"WHERE {$result}\" : $result;\n\t}", "public function resolveCondition($params)\n {\n $where_clause = $this->resolveConditionData($params);\n if ($where_clause) {\n $where_clause = \" WHERE \" . $where_clause;\n }\n\n // special params\n $paramsFunctional = array_change_key_case($params, CASE_UPPER);\n if (isset($paramsFunctional[self::OPERATOR_PREFIX . 'MATCH'])) {\n $MATCH = $paramsFunctional[self::OPERATOR_PREFIX . 'MATCH'];\n\n if (is_array($MATCH) && isset($MATCH['columns'], $MATCH['keyword'])) {\n $where_clause .= ($where_clause != '' ? ' AND ' : ' WHERE ') . ' MATCH (' . $this->quoteColumn($MATCH['columns']) . ') AGAINST (' . $this->_quoteVal_one($MATCH['keyword']) . ($MATCH['mode'] ? \" IN \" . strtoupper($MATCH['mode']) . \" MODE\" : \"\") . ')';\n }\n }\n\n if (isset($paramsFunctional[self::OPERATOR_PREFIX . 'GROUP'])) {\n $where_clause .= ' GROUP BY ' . $this->quoteColumn($paramsFunctional[self::OPERATOR_PREFIX . 'GROUP']);\n\n if (isset($paramsFunctional[self::OPERATOR_PREFIX . 'HAVING'])) {\n $where_clause .= ' HAVING ' . $this->resolveConditionData($paramsFunctional[self::OPERATOR_PREFIX . 'HAVING']);\n }\n }\n\n if (isset($paramsFunctional[self::OPERATOR_PREFIX . 'ORDER'])) {\n $where_clause .= ' ORDER BY ' . $this->quoteColumn($paramsFunctional[self::OPERATOR_PREFIX . 'ORDER']);\n }\n\n if (isset($paramsFunctional[self::OPERATOR_PREFIX . 'LIMIT'])) {\n $LIMIT = $paramsFunctional[self::OPERATOR_PREFIX . 'LIMIT'];\n if (is_numeric($LIMIT)) {\n $where_clause .= ' LIMIT ' . $LIMIT;\n if (isset($paramsFunctional[self::OPERATOR_PREFIX . 'OFFSET']) && is_numeric($paramsFunctional[self::OPERATOR_PREFIX . 'OFFSET'])) {\n $where_clause .= ' OFFSET ' . $paramsFunctional[self::OPERATOR_PREFIX . 'OFFSET'];\n }\n }\n else if (is_array($LIMIT) && is_numeric($LIMIT[0]) && is_numeric($LIMIT[1])) {\n if (isset($paramsFunctional[self::OPERATOR_PREFIX . 'OFFSET']) && is_numeric($paramsFunctional[self::OPERATOR_PREFIX . 'OFFSET'])) {\n $where_clause .= ' LIMIT ' . $LIMIT[1] . ' OFFSET ' . $paramsFunctional[self::OPERATOR_PREFIX . 'OFFSET'];\n }\n else {\n $where_clause .= ' LIMIT ' . $LIMIT[1] . ' OFFSET ' . $LIMIT[0];\n }\n }\n }\n\n return $where_clause;\n }", "public function where($arr){//ex of $arr : ['name' => 'LIKE A%','email' => '= [email protected]']\n $c = \"\";\n $x = 0;\n foreach($arr as $key => $v){//for each param, translate to SQL language\n if($x != 0){\n $c .= \" AND\";\n }\n $x++;\n $c .= \" $key $v\";\n }\n $this->params[\"WHERE\"] = $c;//adding the conditions to the query\n return $this;\n }", "private function buildWhere()\n {\n $query = array();\n\n // Make sure there's something to do\n if (isset($this->query['where']) and count($this->query['where'])) {\n foreach ($this->query['where'] as $group => $conditions) {\n $group = array(); // Yes, because the $group above is not used, get over it.\n foreach ($conditions as $condition => $value) {\n // Get column name\n $cond = explode(\" \", $condition);\n $column = str_replace('`', '', $cond[0]);\n $safeColumn = $this->columnName($column);\n\n // Make the column name safe\n $condition = str_replace($column, $safeColumn, $condition);\n\n // Add value to the bind queue\n $valueBindKey = str_replace(array('.', '`'), array('_', ''), $safeColumn);\n\n if (!empty($value) or $value !== null) {\n $this->valuesToBind[$valueBindKey] = $value;\n }\n\n // Add condition to group\n $group[] = str_replace(\"?\", \":{$valueBindKey}\", $condition);\n }\n\n // Add the group\n $query[] = \"(\" . implode(\" AND \", $group) . \")\";\n }\n\n // Return\n return \"WHERE \" . implode(\" OR \", $query);\n }\n }", "public function andWhere($col, $operator = self::NO_OPERATOR, $value = self::NO_VALUE);", "function parseToWhere($vars,$bool,$selx,$etype) {\n $arVars=explode(';',$vars);\n $arBool=explode(';',$bool);\n $arSelx=explode(';',$selx);\n $arEtype=explode(';',$etype);\n \n $i=0;\n //$iMax=0;\n $whereClause='';\n //$chosenOnes=array();\n \n foreach($arVars AS $varName) {\n if ($whereClause) {$whereClause.=$arBool[$i];}\n if (substr($arSelx[$i],0,2)=='__') {\n $op=substr($arSelx[$i],2,2);\n $val=substr($arSelx[$i],4);\n if ($op=='lt') {$whereClause.=' ('.$varName.\"<'\".$val.\"') \";}\n elseif ($op=='eq') {$whereClause.=' ('.$varName.\"='\".$val.\"') \";}\n elseif ($op=='gt') {$whereClause.=' ('.$varName.\">'\".$val.\"') \";}\n elseif ($op=='rg') {\n $v0=substr($val,0,strpos($val,'_'));\n $v1=substr($val,strpos($val,'_')+1);\n $whereClause.=\" ($varName>='$v0' AND $varName<='$v1') \";\n }\n else {$nought=0;}\n } elseif ($arEtype[$i]=='text') {\n $whereClause.=' ('.$varName.\" LIKE '%\".$arSelx[$i].\"%') \";\n } else {\n $whereClause.=' ('.$varName.\"='\".$arSelx[$i].\"') \";\n }\n $i++;\n }\n return $whereClause;\n}", "function dbConditionInt($fieldName, array $values, $notIn = false) {\n\t$MAX_EXPRESSIONS = 950; // maximum number of values for using \"IN (id1>,<id2>,...,<idN>)\"\n\t$MIN_NUM_BETWEEN = 5; // minimum number of consecutive values for using \"BETWEEN <id1> AND <idN>\"\n\n\tif (count($values) == 0) {\n\t\treturn '1=0';\n\t}\n\n\t$condition = '';\n\n\t$betweens = array();\n\t$ins = array();\n\n\t$pos = 1;\n\t$len = 1;\n\t$valueL = reset($values);\n\twhile (false !== ($valueR = next($values))) {\n\t\t$valueL = bcadd($valueL, 1, 0);\n\n\t\tif ($valueR != $valueL) {\n\t\t\tif ($len >= $MIN_NUM_BETWEEN) {\n\t\t\t\t$betweens[] = array(bcsub($valueL, $len, 0), bcsub($valueL, 1, 0));\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$ins = array_merge($ins, array_slice($values, $pos - $len, $len));\n\t\t\t}\n\n\t\t\t$len = 1;\n\t\t\t$valueL = $valueR;\n\t\t}\n\t\telse {\n\t\t\t$len++;\n\t\t}\n\t\t$pos++;\n\t}\n\n\tif ($len >= $MIN_NUM_BETWEEN) {\n\t\t$betweens[] = array(bcadd(bcsub($valueL, $len, 0), 1, 0), $valueL);\n\t}\n\telse {\n\t\t$ins = array_merge($ins, array_slice($values, $pos - $len, $len));\n\t}\n\n\t$operand = $notIn ? 'AND' : 'OR';\n\t$not = $notIn ? 'NOT ' : '';\n\t$inNum = count($ins);\n\t$betweenNum = count($betweens);\n\n\tif ($MAX_EXPRESSIONS < $inNum || 1 < $betweenNum || (0 < $inNum && 0 < $betweenNum)) {\n\t\t$condition .= '(';\n\t}\n\n\t// compose \"BETWEEN\"s\n\t$first = true;\n\tforeach ($betweens as $between) {\n\t\tif (!$first) {\n\t\t\t$condition .= ' '.$operand.' ';\n\t\t}\n\t\t$condition .= $not.$fieldName.' BETWEEN '.zbx_dbstr($between[0]).' AND '.zbx_dbstr($between[1]);\n\t\t$first = false;\n\t}\n\n\tif (0 < $inNum && 0 < $betweenNum) {\n\t\t$condition .= ' '.$operand.' ';\n\t}\n\n\tif ($inNum == 1) {\n\t\tforeach ($ins as $insValue) {\n\t\t\t$condition .= $notIn\n\t\t\t\t? $fieldName.'!='.zbx_dbstr($insValue)\n\t\t\t\t: $fieldName.'='.zbx_dbstr($insValue);\n\t\t\tbreak;\n\t\t}\n\t}\n\n\t// compose \"IN\"s\n\telse {\n\t\t$first = true;\n\t\tforeach (array_chunk($ins, $MAX_EXPRESSIONS) as $in) {\n\t\t\tif (!$first) {\n\t\t\t\t$condition .= ' '.$operand.' ';\n\t\t\t}\n\n\t\t\t$in = array_map('zbx_dbstr', $in);\n\t\t\t$condition .= $fieldName.' '.$not.'IN ('.implode(',', $in).')';\n\t\t\t$first = false;\n\t\t}\n\t}\n\n\tif ($MAX_EXPRESSIONS < $inNum || 1 < $betweenNum || (0 < $inNum && 0 < $betweenNum)) {\n\t\t$condition .= ')';\n\t}\n\n\treturn $condition;\n}", "private function arrayWhere($grouper, array $where, &$tokens, callable $wrapper)\n {\n $joiner = ($grouper == self::TOKEN_AND ? 'AND' : 'OR');\n\n foreach ($where as $key => $value) {\n $token = strtoupper($key);\n\n //Grouping identifier (@OR, @AND), MongoDB like style\n if ($token == self::TOKEN_AND || $token == self::TOKEN_OR) {\n $tokens[] = [$joiner, '('];\n\n foreach ($value as $nested) {\n if (count($nested) == 1) {\n $this->arrayWhere($token, $nested, $tokens, $wrapper);\n continue;\n }\n\n $tokens[] = [$token == self::TOKEN_AND ? 'AND' : 'OR', '('];\n $this->arrayWhere(self::TOKEN_AND, $nested, $tokens, $wrapper);\n $tokens[] = ['', ')'];\n }\n\n $tokens[] = ['', ')'];\n\n continue;\n }\n\n //AND|OR [name] = [value]\n if (!is_array($value)) {\n $tokens[] = [$joiner, [$key, '=', $wrapper($value)]];\n continue;\n }\n\n if (count($value) > 1) {\n //Multiple values to be joined by AND condition (x = 1, x != 5)\n $tokens[] = [$joiner, '('];\n $this->builtConditions('AND', $key, $value, $tokens, $wrapper);\n $tokens[] = ['', ')'];\n } else {\n $this->builtConditions($joiner, $key, $value, $tokens, $wrapper);\n }\n }\n\n return;\n }", "public function conditionsToSql(string $fieldName, $value, $func = '', string $tablePrefix = ''): ?string\n {\n $ands = [];\n \n if (!is_array($value)) {\n $value = [$value];\n }\n\n $operator_str = is_array($func) && $func['operator'] == 'not in' ? 'IS NULL' : 'IS NOT NULL';\n \n foreach($value as $val) {\n $ors = [];\n \n if (!is_array($val)) {\n $val = [$val]; \n }\n \n foreach ($val as $v) {\n \t $ors[] = 'JSON_SEARCH(' . $tablePrefix . $fieldName . \", 'all', '\" . escape($v) . \"') \" . $operator_str;\n }\n \t\n \t$ands[] = '(\n \t' . implode(\" OR\\n\", $ors) . '\n )';\n }\n \n return '(\n \t' . implode(\" AND\\n\", $ands) . '\n )';\n }", "function having(...$having)\n {\n $this->iswhere = false;\n return $this->where( ...$having);\n }", "function array_to_where_clause($a_vars) {\n\tglobal $mysqli;\n\n\t$a_where = array();\n\tforeach($a_vars as $k=>$v) {\n\t\t\t$k = $mysqli->real_escape_string($k);\n\t\t\t$v = $mysqli->real_escape_string($v);\n\t\t\t$a_where[] = \"`$k`='$v'\";\n\t}\n\t$s_where = implode(' AND ', $a_where);\n\treturn $s_where;\n}", "public static function buildInPredicate($column, array $values)\n{\n\t// Form IN predicate\n\t$clause = $column . ' IN (?'\n\t . str_repeat(', ?', count($values) - 1) . ')';\n\n\t// Return clause\n\treturn $clause;\n}", "static function makeConditions($params = null, $filterables = null)\n {\n // Presets\n $where = [];\n if (is_array($params)) {\n foreach ($params as $param => $value) {\n if (is_array($value)) {\n $where[] = [$param, $value[0], $value[1]];\n }\n else {\n $where[] = [$param, $value];\n }\n }\n }\n \n /**\n * @var Request $request\n */\n $request = \\Illuminate\\Support\\Facades\\Request::getFacadeRoot();\n \n // User filters from $_GET (take $_POST also)\n $filterables = is_array($filterables) ? $filterables : [];\n foreach ($filterables as $filter){\n // Parse condition if input has filterable value.\n if ($request->has($filter)){\n if ($condition = self::parseFilter($filter, $request->input($filter))) {\n $where[] = $condition;\n }\n }\n }\n \n // Hola\n return $where;\n }", "protected function formConditions(&$builder, $filters = null)\n {\n if (empty($filters)) { $filters = $this->filters; }\n $param_count = 0;\n foreach ($filters as $filter){\n $param_id = \"p_$param_count\";\n\n $actual_field = $filter[self::FILTER_PARAM_FIELD];\n $actual_field_arr = explode('.', $filter[self::FILTER_PARAM_FIELD]);\n $count_parts = count($actual_field_arr);\n if ($count_parts > 2){\n $actual_field = $actual_field_arr[$count_parts - 2] . '.' . $actual_field_arr[$count_parts - 1];\n }\n\n if (is_array($filter[self::FILTER_PARAM_VALUE])){\n switch ($filter[self::FILTER_PARAM_COMPARATOR]){\n case self::CMP_NOT:\n $builder->notInWhere($actual_field, $filter[self::FILTER_PARAM_VALUE]);\n break;\n default:\n $builder->inWhere($actual_field, $filter[self::FILTER_PARAM_VALUE]);\n break;\n }\n } else {\n //build conditions\n $condition = null;\n switch ($filter[self::FILTER_PARAM_COMPARATOR]){\n case self::CMP_IS:\n $condition = \"{$actual_field} IS :$param_id:\";\n break;\n case self::CMP_IS_NOT:\n $condition = \"NOT {$actual_field} IS :$param_id:\";\n break;\n case self::CMP_LIKE:\n $condition = \"{$actual_field} LIKE :$param_id:\";\n break;\n default:\n $condition = \"{$actual_field} {$filter[self::FILTER_PARAM_COMPARATOR]} :$param_id:\";\n break;\n }\n\n //determine joining operators\n switch ($filter[self::FILTER_PARAM_CONDITION]){\n case self::COND_OR:\n $builder->orWhere($condition, [$param_id => $filter[self::FILTER_PARAM_VALUE]]);\n break;\n default:\n $builder->andWhere($condition, [$param_id => $filter[self::FILTER_PARAM_VALUE]]);\n break;\n }\n }\n $param_count++;\n }\n }", "public function having(){\r\n \t$tb = call_user_func_array(array($this->mask(), 'having'), func_get_args());\r\n\t\treturn $this;\r\n }", "public function createConditionSql($field, $operator, $value)\n {\n $sqlOperator = $this->getSqlOperator($operator);\n $connection = $this->getConnection();\n\n $condition = '';\n switch ($operator) {\n case '{}':\n case '!{}':\n if (is_array($value)) {\n if (!empty($value)) {\n $sqlOperator = $operator == '{}' ? 'IN' : 'NOT IN';\n $condition = $connection->quoteInto($field . ' ' . $sqlOperator . ' (?)', $value);\n }\n } else {\n $condition = $connection->quoteInto($field . ' ' . $sqlOperator . ' ?', '%' . $value . '%');\n }\n break;\n case 'between':\n $condition = $field . ' ' . sprintf(\n $sqlOperator,\n $connection->quote($value['start']),\n $connection->quote($value['end'])\n );\n break;\n default:\n $condition = $connection->quoteInto($field . ' ' . $sqlOperator . ' ?', $value);\n break;\n }\n\n return $condition;\n }", "function compare_operator($query,$item)\n{\n if($query['WHERE'][2]==\"CONTAINS\")\n {\n if(strpos($item,$query['WHERE'][3]) !== false)\n {\n return true;\n }\n }\n else if ($query['WHERE'][2]==\"=\")\n {\n if((is_double($query['WHERE'][3]) && ((double)$item == $query['WHERE'][3])) || strcmp($item, $query['WHERE'][3])==0)\n {\n return true;\n }\n }\n else if ($query['WHERE'][2]==\"<\")\n {\n if((is_double($query['WHERE'][3]) && ((double)$item < $query['WHERE'][3])) || strcmp($item, $query['WHERE'][3]) < 0)\n {\n return true;\n }\n }\n else if ($query['WHERE'][2]==\">\")\n {\n if((is_double($query['WHERE'][3]) && ((double)$item > $query['WHERE'][3])) || strcmp($item, $query['WHERE'][3]) > 0)\n {\n return true;\n }\n }\n return false;\n}", "public function getAndWhereStatement($separator='AND') \n {\n $andWhere_array = [];\n foreach ($this->andWhere as $key => $column) {\n if( !isset($_GET[$key]) || empty($_GET[$key]) ) continue;\n switch ($key) {\n case 's':\n $keywords = explode(\" \", mysql_real_escape_string(htmlspecialchars($_GET[$key])));\n $parts = array();\n for ($i = 0; $i < count($keywords); $i++) {\n $parts[] = \"(o.Name LIKE '%\". $keywords[$i] .\"%' OR o.Details LIKE '%\". $keywords[$i] .\"%' OR o.Profil LIKE '%\". $keywords[$i] .\"%')\";\n }\n $andWhere_array[] = '('. implode(' AND ', $parts) .')';\n break;\n default:\n if(is_array($_GET[$key])) {\n $andWhere_array[] = key($column) .\".\". reset($column) .\" IN('\". implode(\"','\", $_GET[$key]) .\"')\";\n } else {\n $andWhere_array[] = key($column) .\".\". reset($column) .\"='{$_GET[$key]}'\";\n }\n break;\n }\n }\n $andWhere_array[] = (Route::getRoute() == 'offres/stage') ? \"o.id_tpost='4'\" : \"o.id_tpost!='4'\";\n\n // Afficher les offres expirées au candidats dans la page des offres.\n if (get_setting('front_show_expired_offers_on_frentend') != 1) {\n $andWhere_array[] = \"o.status='En cours'\";\n $andWhere_array[] = \"DATE(o.date_expiration) >= CURDATE()\";\n }\n\n return (!empty($andWhere_array)) ? \" {$separator} \". implode(' AND ', $andWhere_array) : '';\n }", "protected function _compile_conditions(array $conditions)\n {\n $last_condition = NULL;\n\n $sql = '';\n foreach ($conditions as $group)\n {\n // Process groups of conditions\n foreach ($group as $logic => $condition)\n {\n if ($condition === '(')\n {\n if ( ! empty($sql) AND $last_condition !== '(')\n {\n // Include logic operator\n $sql .= ' '.$logic.' ';\n }\n\n $sql .= '(';\n }\n elseif ($condition === ')')\n {\n $sql .= ')';\n }\n else\n {\n if ( ! empty($sql) AND $last_condition !== '(')\n {\n // Add the logic operator\n $sql .= ' '.$logic.' ';\n }\n\n // Split the condition\n list($column, $op, $value) = $condition;\n // Support db::expr() as where clause\n if ($column instanceOf db_expression and $op === null and $value === null)\n {\n $sql .= (string) $column;\n }\n else\n {\n if ($value === NULL)\n {\n if ($op === '=')\n {\n // Convert \"val = NULL\" to \"val IS NULL\"\n $op = 'IS';\n }\n elseif ($op === '!=')\n {\n // Convert \"val != NULL\" to \"valu IS NOT NULL\"\n $op = 'IS NOT';\n }\n }\n\n // Database operators are always uppercase\n $op = strtoupper($op);\n if (($op === 'BETWEEN' OR $op === 'NOT BETWEEN') AND is_array($value))\n {\n // BETWEEN always has exactly two arguments\n list($min, $max) = $value;\n\n if (is_string($min) AND array_key_exists($min, $this->_parameters))\n {\n // Set the parameter as the minimum\n $min = $this->_parameters[$min];\n }\n\n if (is_string($max) AND array_key_exists($max, $this->_parameters))\n {\n // Set the parameter as the maximum\n $max = $this->_parameters[$max];\n }\n\n // Quote the min and max value\n $value = $this->quote($min).' AND '.$this->quote($max);\n }\n elseif ($op === 'FIND_IN_SET' || strstr($column, '->') )\n {\n }\n else\n {\n if (is_string($value) AND array_key_exists($value, $this->_parameters))\n {\n // Set the parameter as the value\n $value = $this->_parameters[$value];\n }\n\n // Quote the entire value normally\n $value = $this->quote($value);\n \n }\n\n //json字段查询\n if ( strstr($column, '->') ) \n {\n $value = is_string($value) ? $this->quote($value) : $value;\n list($column, $json_field) = explode('->', $column, 2);\n\n $column = $this->quote_field($column, false);\n $sql .= $column.'->\\'$.' . $json_field . '\\' '.$op.' '.$value;\n }\n else\n {\n // Append the statement to the query\n $column = $this->quote_field($column, false);\n if ($op === 'FIND_IN_SET') \n {\n $sql .= $op.\"( '{$value}', {$column} )\";\n }\n else \n {\n $sql .= $column.' '.$op.' '.$value;\n }\n }\n }\n }\n\n $last_condition = $condition;\n }\n }\n\n return $sql;\n }", "protected function _buildCondition(){\n \t$aryCondition = array();\n \t\n \tif(!empty($this->postData)){\n \t\t //search\n\t\t\t \t\t\t\n\t\t\tif($this->postData['title']!=''){\n \t\t \t$aryCondition['like'][] = array(\"mt.title\"=>$this->postData['title']);\n \t\t }\t\t\t\n\t\t\tif($this->postData['page']!=''){\n \t\t \t$aryCondition['and'][] = array(\"mt.page\"=>$this->postData['page']);\n \t\t }\t\t\t\n\t\t\tif($this->postData['code']!=''){\n \t\t \t$aryCondition['like'][] = array(\"mt.code\"=>$this->postData['code']);\n \t\t }\t\t\t\n\t\t\tif($this->postData['status']!=''){\n \t\t \t$aryCondition['and'][] = array(\"mt.status\"=>$this->postData['status']);\n \t\t }\t\t\t\n\n \t}\n \treturn $aryCondition;\n }", "function _add_where_clause($where_clauses, $join)\n {\n $clauses = array();\n foreach ($where_clauses as $clause) {\n extract($clause);\n if ($this->object->has_column($column)) {\n $column = \"`{$column}`\";\n }\n if (!is_array($value)) {\n $value = array($value);\n }\n foreach ($value as $index => $v) {\n $v = $clause['type'] == 'numeric' ? $v : \"'{$v}'\";\n $value[$index] = $v;\n }\n if ($compare == 'BETWEEN') {\n $value = \"{$value[0]} AND {$value[1]}\";\n } else {\n $value = implode(', ', $value);\n if (strpos($compare, 'IN') !== FALSE) {\n $value = \"({$value})\";\n }\n }\n $clauses[] = \"{$column} {$compare} {$value}\";\n }\n $this->object->_where_clauses[] = implode(\" {$join} \", $clauses);\n }", "public function having($sql);", "function custom_conds( $conds = array())\n\t{\n\t\t// default where clause\n\t\tif ( !isset( $conds['no_publish_filter'] )) {\n\t\t\t$this->db->where( 'status', 1 );\n\t\t}\n\t\t\n\t\t// order by\n\t\tif ( isset( $conds['order_by'] )) {\n\t\t\t$order_by_field = $conds['order_by_field'];\n\t\t\t$order_by_type = $conds['order_by_type'];\n\t\t\t\n\t\t\t$this->db->order_by( 'rt_products.'.$order_by_field, $order_by_type);\n\t\t}\n\t\t// product id condition\n\t\tif ( isset( $conds['id'] )) {\n\t\t\t$this->db->where( 'id', $conds['id'] );\t\n\t\t}\n\n\t\t// category id condition\n\t\tif ( isset( $conds['cat_id'] )) {\n\t\t\t\n\t\t\tif ($conds['cat_id'] != \"\") {\n\t\t\t\tif($conds['cat_id'] != '0'){\n\t\t\t\t\t$this->db->where( 'cat_id', $conds['cat_id'] );\t\n\t\t\t\t}\n\n\t\t\t}\t\t\t\n\t\t}\n\n\t\t// sub category id condition \n\t\tif ( isset( $conds['sub_cat_id'] )) {\n\t\t\t\n\t\t\tif ($conds['sub_cat_id'] != \"\") {\n\t\t\t\tif($conds['sub_cat_id'] != '0'){\n\t\t\t\t\n\t\t\t\t\t$this->db->where( 'sub_cat_id', $conds['sub_cat_id'] );\t\n\t\t\t\t}\n\n\t\t\t}\t\t\t\n\t\t}\n\n\t\n\t\t// cat_ordering condition\n\t\tif ( isset( $conds['shop_id'] )) {\n\t\t\t$this->db->where( 'shop_id', $conds['shop_id'] );\n\t\t}\n\n\t\t// product_name condition\n\t\tif ( isset( $conds['name'] )) {\n\t\t\t$this->db->where( 'name', $conds['name'] );\n\t\t}\n\n\t\tif ( isset( $conds['desc'] )) {\n\t\t\t$this->db->where( 'description', $conds['desc'] );\n\t\t}\n\n\t\t// product keywords\n\t\tif ( isset( $conds['search_tag'] )) {\n\t\t\t$this->db->where( 'search_tag', $conds['search_tag'] );\n\t\t}\n\n\t\t// product highlight information condition\n\t\tif ( isset( $conds['info'] )) {\n\t\t\t$this->db->where( 'highlight_information', $conds['info'] );\n\t\t}\n\n\t\t// product code\n\t\tif ( isset( $conds['code'] )){\n\t\t\t$this->db->where( 'code', $conds['code'] );\n\t\t}\n\n\t\t// product unit_value condition\n\t\tif ( isset( $conds['product_unit_value'] )) {\n\t\t\t$this->db->where( 'product_unit_value', $conds['product_unit_value'] );\n\t\t}\n\n\t\t// product unit condition\n\t\tif ( isset( $conds['product_unit'] )) {\n\t\t\t$this->db->where( 'product_unit', $conds['product_unit'] );\n\t\t}\n\n\t\t// product minimum_order\n\t\tif ( isset( $conds['minimum_order'] )){\n\t\t\t$this->db->where( 'minimum_order', $conds['minimum_order'] );\n\t\t}\n\n\t\t// product maximum_order\n\t\tif ( isset( $conds['maximum_order'] )){\n\t\t\t$this->db->where( 'maximum_order', $conds['maximum_order'] );\n\t\t}\n\n\t\t// point condition\n\t\tif ( isset( $conds['price_min'] ) || isset( $conds['price_max'] )) {\n\t\t\t$this->db->where( 'unit_price >= ', $conds['price_min'] );\n\t\t\t$this->db->where( 'unit_price <= ', $conds['price_max'] );\n\t\t}\n\n\t\t// feature products\n\t\tif ( isset( $conds['is_featured'] )) {\n\t\t\t$this->db->where( 'is_featured', $conds['is_featured'] );\n\t\t}\n\n\t\t// rating condition\n\t\tif ( isset( $conds['rating_value'] ) ) {\n\t\t\t// For Rating value with comma 3,4,5\n\t\t\t// $rating_value = explode(',', $conds['rating_value']);\n\t\t\t// $this->db->where_in( 'overall_rating', $rating_value);\n\n\t\t\t// For single rating value\n\t\t\t$this->db->where( 'overall_rating >=', $conds['rating_value'] );\n\t\t}\n\t\t\n\t\t// discount products\n\t\tif ( $this->is_filter_discount( $conds )) {\n\t\t\t$this->db->where( 'is_discount', '1' );\t\n\t\t}\n\n\t\t// available products\n\t\tif ( isset( $conds['is_available'] )) {\n\t\t\t$this->db->where( 'is_available', $conds['is_available'] );\n\t\t}\n\n\t\t// searchterm\n\t\tif ( isset( $conds['searchterm'] )) {\n\t\t\t$this->db->like( 'name', $conds['searchterm'] );\n\t\t}\n\n\n\t\tif( isset($conds['min_price'])) {\n\n\t\t\t\n\t\t\tif( $conds['min_price'] != 0 ) {\n\t\t\t\t$this->db->where( 'unit_price >=', $conds['min_price'] );\n\t\t\t}\n\n\t\t}\n\n\t\tif( isset($conds['max_price'])) {\n\t\t\tif( $conds['max_price'] != 0 ) {\n\t\t\t\t$this->db->where( 'unit_price <=', $conds['max_price'] );\n\t\t\t}\t\n\n\t\t}\n\n\t\t// product shop_status\n\t\tif ( isset( $conds['shop_status'] )){\n\t\t\t$this->db->where( 'shop_status', $conds['shop_status'] );\n\t\t}\n\n\t\t$this->db->order_by('added_date', 'desc' );\n\n\n\t}", "private function addWhere(&$query, $column, $operator, $value)\n {\n if ($operator == 'in') {\n\n $is_null = false;\n foreach ($value as $key => $val) {\n if ($val === null) {\n $is_null = true;\n unset($value[$key]);\n }\n }\n\n if ($is_null) {\n $query->whereNull($column)->orWhereIn($column, $value);\n } else {\n $query->whereIn($column, $value);\n }\n\n } elseif ($operator == 'not in') {\n $is_null = false;\n foreach ($value as $key => $val) {\n if ($val === null) {\n $is_null = true;\n unset($value[$key]);\n }\n }\n\n $value = array_values($value);\n if ($is_null) {\n $query->whereNotNull($column)->whereNotIn($column, $value);\n } else {\n $query->whereNotIn($column, $value);\n }\n\n } elseif ($operator == 'search') {\n\n $input = mb_strtolower($value);\n $input = Transliterator::transliterate($input, ' ');\n $input = explode(' ', $input);\n $input = array_filter($input);\n\n foreach ($input as $word) {\n $query = $query->where('search', 'LIKE', '%' . $word . '%');\n }\n\n } else {\n $query->where($column, $operator, $value);\n }\n return $query;\n }", "public function where($column, $operator = null, $value = null, $boolean = 'and')\n {\n // If the column is an array, we will assume it is an array of key-value pairs\n // and can add them each as a where clause. We will maintain the boolean we\n // received when the method was called and pass it into the nested where.\n if (is_array($column)) {\n return $this->addArrayOfWheres($column, $boolean);\n }\n\n // Here we will make some assumptions about the operator. If only 2 values are\n // passed to the method, we will assume that the operator is an equals sign\n // and keep going. Otherwise, we'll require the operator to be passed in.\n [$value, $operator] = $this->prepareValueAndOperator(\n $value,\n $operator,\n func_num_args() === 2\n );\n\n // If the columns is actually a Closure instance, we will assume the developer\n // wants to begin a nested where statement which is wrapped in parenthesis.\n // We'll add that Closure to the query then return back out immediately.\n if ($column instanceof Closure && is_null($operator)) {\n return $this->whereNested($column, $boolean);\n }\n\n // If the column is a Closure instance and there is an operator value, we will\n // assume the developer wants to run a subquery and then compare the result\n // of that subquery with the given value that was provided to the method.\n if ($this->isQueryable($column) && ! is_null($operator)) {\n $sub = $this->createSub($column);\n\n return $this->where($sub, $operator, $value, $boolean);\n }\n\n // If the given operator is not found in the list of valid operators we will\n // assume that the developer is just short-cutting the '=' operators and\n // we will set the operators to '==' and set the values appropriately.\n if ($this->invalidOperator($operator)) {\n [$value, $operator] = [$operator, '=='];\n }\n\n // If the value is a Closure, it means the developer is performing an entire\n // sub-select within the query and we will need to compile the sub-select\n // within the where clause to get the appropriate query record results.\n if ($value instanceof Closure) {\n return $this->whereSub($column, $operator, $value, $boolean);\n }\n\n // If the value is \"null\", we will just assume the developer wants to add a\n // where null clause to the query. So, we will allow a short-cut here to\n // that method for convenience so the developer doesn't have to check.\n if (is_null($value)) {\n return $this->whereNull($column, $boolean, $operator !== '=');\n }\n\n $type = 'Basic';\n\n // Now that we are working with just a simple query we can put the elements\n // in our array and add the query binding to our array of bindings that\n // will be bound to each SQL statements when it is finally executed.\n $this->wheres[] = compact(\n 'type',\n 'column',\n 'operator',\n 'value',\n 'boolean'\n );\n\n return $this;\n }", "protected static function logicalAND(){\n\t\t$values = func_get_args();\n\t\tif(is_array($values[0])){\n\t\t\t$values = $values[0];\n\t\t}\n\t\treturn self::junction('AND', $values);\n\t}", "public static function buildWhereInClause($column, array $values)\n{\n\t// Form WHERE clause\n\t$clause = ' WHERE ' . self::buildInPredicate($column, $values);\n\n\t// Return clause\n\treturn $clause;\n}", "public function postConditions($data = array(), $op = null, $bool = 'AND', $exclusive = false) {\n\t\tunset($data['_Token']);\n\t\t$registered = ClassRegistry::keys();\n\t\t$bools = array('and', 'or', 'not', 'and not', 'or not', 'xor', '||', '&&');\n\t\t$cond = array();\n\n\t\tif ($op === null) {\n\t\t\t$op = '';\n\t\t}\n\n\t\t$arrayOp = is_array($op);\n\t\tforeach ($data as $model => $fields) {\n\t\t\tif (is_array($fields)) {\n\t\t\t\tforeach ($fields as $field => $value) {\n\t\t\t\t\tif (is_array($value) && in_array(strtolower($field), $registered)) {\n\t\t\t\t\t\t$cond += (array)self::postConditions(array($field=>$value), $op, $bool, $exclusive);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// check for boolean keys\n\t\t\t\t\t\tif (in_array(strtolower($model), $bools)) {\n\t\t\t\t\t\t\t$key = $field;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$key = $model.'.'.$field;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// check for habtm [Publication][Publication][0] = 1\n\t\t\t\t\t\tif ($model == $field) {\n\t\t\t\t\t\t\t// should get PK\n\t\t\t\t\t\t\t$key = $model.'.id';\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$fieldOp = $op;\n\n\t\t\t\t\t\tif ($arrayOp) {\n\t\t\t\t\t\t\tif (array_key_exists($key, $op)) {\n\t\t\t\t\t\t\t\t$fieldOp = $op[$key];\n\t\t\t\t\t\t\t} elseif (array_key_exists($field, $op)) {\n\t\t\t\t\t\t\t\t$fieldOp = $op[$field];\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t$fieldOp = false;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ($exclusive && $fieldOp === false) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$fieldOp = strtoupper(trim($fieldOp));\n\t\t\t\t\t\tif (is_array($value) || is_numeric($value)) {\n\t\t\t\t\t\t\t$fieldOp = '=';\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ($fieldOp === 'LIKE') {\n\t\t\t\t\t\t\t$key = $key.' LIKE';\n\t\t\t\t\t\t\t$value = '%'.$value.'%';\n\t\t\t\t\t\t} elseif ($fieldOp && $fieldOp != '=') {\n\t\t\t\t\t\t\t$key = $key.' '.$fieldOp;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ($value !== '%%') {\n\t\t\t\t\t\t\t$cond[$key] = $value;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif ($bool != null && strtoupper($bool) != 'AND') {\n\t\t\t$cond = array($bool => $cond);\n\t\t}\n\n\t\treturn $cond;\n\t}", "final public static function and($field = '', $operator = '', $value = '', bool $valueIsFunction = false)\n {\n //add the condition\n if ($field == '' || $operator == '' || $value == '') {\n self::$query .= ' AND ';\n } else {\n if (!$valueIsFunction)\n self::$bindParams[] = [$field => $value];\n\n self::$query .= ' AND ' . $field . ' ' . $operator . ' ' . ($valueIsFunction ? $value : self::prepareBind([$field], true));\n }\n return (new static);\n }", "protected function _having($key, $values=[], string $conj='AND'): self\n\t{\n\t\t$where = $this->_where($key, $values);\n\n\t\t// Create key/value placeholders\n\t\tforeach($where as $f => $val)\n\t\t{\n\t\t\t// Split each key by spaces, in case there\n\t\t\t// is an operator such as >, <, !=, etc.\n\t\t\t$fArray = explode(' ', trim($f));\n\n\t\t\t$item = $this->driver->quoteIdent($fArray[0]);\n\n\t\t\t// Simple key value, or an operator\n\t\t\t$item .= (count($fArray) === 1) ? '=?' : \" {$fArray[1]} ?\";\n\n\t\t\t// Put in the having map\n\t\t\t$this->state->appendHavingMap([\n\t\t\t\t'conjunction' => empty($this->state->getHavingMap())\n\t\t\t\t\t? ' HAVING '\n\t\t\t\t\t: \" {$conj} \",\n\t\t\t\t'string' => $item\n\t\t\t]);\n\t\t}\n\n\t\treturn $this;\n\t}", "function getConditions($con, $op, $num, $str){\n\t\t$retvalue = $con;\n\t\t$and = \"\";\n\t\t\n\t\tif ($con != \"\"){\n\t\t\t$and = \" AND \";\n\t\t}\n\t\t\n\t\tif (empty($op)){\n\t\t\t// Any/Failsafe\n\t\t\t$retvalue = $retvalue. $and. $str. \" >= 1\";\n\t\t} else if ($op == \"gr\"){\n\t\t\t$retvalue = $retvalue. $and. $str. \" >= \". $num;\n\t\t} else if ($op == \"ls\"){\n\t\t\t$retvalue = $retvalue. $and. $str. \" <= \". $num;\n\t\t} else if ($op == \"eq\"){\n\t\t\t$retvalue = $retvalue. $and. $str. \" = \". $num;\n\t\t}\n\t\t\n\t\treturn $retvalue;\n\t}", "private function constructCondStringStatic(&$tablesUsed, $conds)\n {\n $groupStrings = array();\n $andGroupStrings = array();\n\n foreach ($conds as $group => $conditions) {\n foreach ($conditions as &$condition) {\n $column = $this->canonicalizeColumn($condition[COND_COLUMN], false, $tablesUsed);\n $before = $after = '';\n if ($condition[COND_OPERATOR] == 'LIKE') {\n $before = '%';\n $after = '%';\n } elseif ($condition[COND_OPERATOR] == 'STARTSWITH') {\n $condition[COND_OPERATOR] = 'LIKE';\n $after = '%';\n }\n\n $condition = $column . ' ' . $condition[COND_OPERATOR] . \" '\" .\n $before . $this->connObj->escapeString($condition[1]) . $after . \"'\";\n }\n\n if ($group === 0) {\n $groupStrings[$group] = implode(' AND ', $conditions);\n } elseif (is_string($group) && substr($group, 0, 3) === 'AND') {\n // 'AND1', 'AND2' are a special type of groups\n $andGroupStrings[$group] = '(' . implode(' AND ', $conditions) . ')';\n } else {\n $groupStrings[$group] = '(' . implode(' OR ', $conditions) . ')';\n }\n }\n\n if (!empty($andGroupStrings)) {\n $groupStrings[] = '(' . implode(' OR ', $andGroupStrings) . ')';\n }\n\n $groupStrings = array_merge($groupStrings, $this->constructJoinString($tablesUsed));\n\n return implode(' AND ', $groupStrings);\n }", "public function condition(string $field, string $compare, string $operator = \"=\", string $connector = \"AND\");", "function query($args, $operator = 'AND')\n {\n }", "public function where()\n {\n $args = func_get_args();\n $num_args = count($args);\n \n // Custom queries\n if ( $num_args == 2 && is_array($args[1]) )\n {\n $this->where = $args[0];\n $this->params = $args[1];\n }\n else\n {\n // AND equality condition\n if ( $num_args == 2 )\n {\n list($field, $value) = $args;\n $op = '=';\n }\n // AND with custom operation condition\n else\n {\n list($field, $op, $value) = $args;\n }\n $this->appendWhere('AND', $field, $op, $value); \n }\n return $this;\n }", "public function where($column, $operator = null, $value = null, $boolean = 'and')\n {\n // First we check whether the operator is 'IN' so that we call whereIn() on it\n // as a helping hand and centralization strategy, whereIn knows what to do with the IN operator.\n if (mb_strtolower($operator) == 'in') {\n return $this->whereIn($column, $value, $boolean);\n }\n\n // If the column is an array, we will assume it is an array of key-value pairs\n // and can add them each as a where clause. We will maintain the boolean we\n // received when the method was called and pass it into the nested where.\n if (is_array($column)) {\n return $this->whereNested(function (IlluminateQueryBuilder $query) use ($column) {\n foreach ($column as $key => $value) {\n $query->where($key, '=', $value);\n }\n }, $boolean);\n }\n\n if (func_num_args() == 2) {\n list($value, $operator) = [$operator, '='];\n } elseif ($this->invalidOperatorAndValue($operator, $value)) {\n throw new \\InvalidArgumentException('Value must be provided.');\n }\n\n // If the columns is actually a Closure instance, we will assume the developer\n // wants to begin a nested where statement which is wrapped in parenthesis.\n // We'll add that Closure to the query then return back out immediately.\n if ($column instanceof Closure) {\n return $this->whereNested($column, $boolean);\n }\n\n // If the given operator is not found in the list of valid operators we will\n // assume that the developer is just short-cutting the '=' operators and\n // we will set the operators to '=' and set the values appropriately.\n if (!in_array(mb_strtolower($operator), $this->operators, true)) {\n list($value, $operator) = [$operator, '='];\n }\n\n // If the value is a Closure, it means the developer is performing an entire\n // sub-select within the query and we will need to compile the sub-select\n // within the where clause to get the appropriate query record results.\n if ($value instanceof Closure) {\n return $this->whereSub($column, $operator, $value, $boolean);\n }\n\n // If the value is \"null\", we will just assume the developer wants to add a\n // where null clause to the query. So, we will allow a short-cut here to\n // that method for convenience so the developer doesn't have to check.\n if (is_null($value)) {\n return $this->whereNull($column, $boolean, $operator != '=');\n }\n\n // Now that we are working with just a simple query we can put the elements\n // in our array and add the query binding to our array of bindings that\n // will be bound to each SQL statements when it is finally executed.\n $type = 'Basic';\n\n $property = $column;\n\n // When the column is an id we need to treat it as a graph db id and transform it\n // into the form of id(n) and the typecast the value into int.\n if ($column == 'id') {\n $column = 'id('.$this->modelAsNode().')';\n $value = intval($value);\n }\n // When it's been already passed in the form of NodeLabel.id we'll have to\n // re-format it into id(NodeLabel)\n elseif (preg_match('/^.*\\.id$/', $column)) {\n $parts = explode('.', $column);\n $column = sprintf('%s(%s)', $parts[1], $parts[0]);\n $value = intval($value);\n }\n // Also if the $column is already a form of id(n) we'd have to type-cast the value into int.\n elseif (preg_match('/^id\\(.*\\)$/', $column)) {\n $value = intval($value);\n }\n\n $binding = $this->prepareBindingColumn($column);\n\n $this->wheres[] = compact('type', 'binding', 'column', 'operator', 'value', 'boolean');\n\n $property = $this->wrap($binding);\n\n if (!$value instanceof Expression) {\n $this->addBinding([$property => $value], 'where');\n }\n\n return $this;\n }", "protected function whereToken($joiner, array $parameters, &$tokens = [], callable $wrapper)\n {\n list($identifier, $valueA, $valueB, $valueC) = $parameters + array_fill(0, 5, null);\n\n if (empty($identifier)) {\n //Nothing to do\n return;\n }\n\n //Where conditions specified in array form\n if (is_array($identifier)) {\n if (count($identifier) == 1) {\n $this->arrayWhere(\n $joiner == 'AND' ? self::TOKEN_AND : self::TOKEN_OR,\n $identifier,\n $tokens,\n $wrapper\n );\n\n return;\n }\n\n $tokens[] = [$joiner, '('];\n $this->arrayWhere(self::TOKEN_AND, $identifier, $tokens, $wrapper);\n $tokens[] = ['', ')'];\n\n return;\n }\n\n if ($identifier instanceof \\Closure) {\n $tokens[] = [$joiner, '('];\n call_user_func($identifier, $this, $joiner, $wrapper);\n $tokens[] = ['', ')'];\n\n return;\n }\n\n if ($identifier instanceof QueryBuilder) {\n //Will copy every parameter from QueryBuilder\n $wrapper($identifier);\n }\n\n switch (count($parameters)) {\n case 1:\n //AND|OR [identifier: sub-query]\n $tokens[] = [$joiner, $identifier];\n break;\n case 2:\n //AND|OR [identifier] = [valueA]\n $tokens[] = [$joiner, [$identifier, '=', $wrapper($valueA)]];\n break;\n case 3:\n //AND|OR [identifier] [valueA: OPERATION] [valueA]\n $tokens[] = [$joiner, [$identifier, strtoupper($valueA), $wrapper($valueB)]];\n break;\n case 4:\n //BETWEEN or NOT BETWEEN\n $valueA = strtoupper($valueA);\n if (!in_array($valueA, ['BETWEEN', 'NOT BETWEEN'])) {\n throw new BuilderException(\n 'Only \"BETWEEN\" or \"NOT BETWEEN\" can define second comparasions value.'\n );\n }\n\n //AND|OR [identifier] [valueA: BETWEEN|NOT BETWEEN] [valueB] [valueC]\n $tokens[] = [$joiner, [$identifier, $valueA, $wrapper($valueB), $wrapper($valueC)]];\n }\n }", "public function where() {\r\n\t\t$args = func_get_args();\r\n\t\t$expr = array_shift($args);\r\n\t\tarray_push($this->_wheres, '(' . $this->_parameterize($expr, $args) . ')');\r\n\t\t$this->_dirty = true;\r\n\t}", "function having($s)\n{\n\t$this->tryModify();\n\tif(!isset($this->query['having'])) $this->query['having'] = array();\n\t$this->query['having'][] = $this->setWhereParams($s, func_get_args(), 1);\n\treturn $this;\n}", "private function getQueryConditions($sql, $profileIsp, $profileItemCond, $typeFieldName)\n {\n $itemDataType = $profileIsp['item_data_type'];\n if ($itemDataType == 'S') {\n $ispCatArray = array_column($profileIsp['category_type'], 'value');\n $inString = \"'\" . implode(\"','\", $ispCatArray) . \"'\";\n $this->query[] = $sql . \" (\" . $typeFieldName . \" = \" . $profileIsp['id'] . \" AND metadata_value IN (\" . $inString . \") $profileItemCond ) \";\n } elseif ($itemDataType == 'D') {\n $this->query[] = $sql . \" (\" . $typeFieldName . \" = \" . $profileIsp['id'] . \" AND STR_TO_DATE(metadata_value, \\\"%m/%d/%Y\\\") >= '\" . $profileIsp['start_date'] . \"' AND STR_TO_DATE(metadata_value, \\\"%m/%d/%Y\\\") <= '\" . $profileIsp['end_date'] . \"' $profileItemCond ) \";\n } elseif ($itemDataType == 'N') {\n if ($profileIsp['is_single']) {\n $this->query[] = $sql . \" (\" . $typeFieldName . \" = \" . $profileIsp['id'] . \" AND metadata_value = '\" . $profileIsp['single_value'] . \"' $profileItemCond ) \";\n } else {\n $this->query[] = $sql . \" (\" . $typeFieldName . \" = \" . $profileIsp['id'] . \" AND metadata_value >= \" . $profileIsp['min_digits'] . \" AND metadata_value <= \" . $profileIsp['max_digits'] . \" $profileItemCond) \";\n }\n }\n }", "function combineSQLCriteria($arrElements, $and = true)\n{\n\t$ret=\"\";\n\t$union = $and ? \" AND \" : \" OR \";\n\tforeach($arrElements as $e)\n\t{\n\t\tif(strlen($e))\n\t\t{\n\t\t\tif(!strlen($ret))\n\t\t\t{\n\t\t\t\t$ret = \"(\".$e.\")\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$ret .= $union.\"(\".$e.\")\";\n\t\t\t}\n\t\t}\n\t}\n\treturn $ret;\n}", "function in($x, $y, $and=null, ...$args)\n {\n $expression = array();\n array_push($expression, $x, _IN, $y, $and, ...$args);\n return $expression;\n }" ]
[ "0.64402515", "0.61656153", "0.58997965", "0.5772756", "0.5764759", "0.5713066", "0.569427", "0.5676686", "0.5672715", "0.5637114", "0.56330264", "0.5619707", "0.5615368", "0.561336", "0.5597413", "0.55853784", "0.55828106", "0.5576727", "0.55762625", "0.55587834", "0.5532104", "0.5518757", "0.5502411", "0.5496707", "0.54870296", "0.5471366", "0.54708385", "0.5457049", "0.54293215", "0.54185295", "0.54073364", "0.53911585", "0.5380618", "0.5363753", "0.5348775", "0.533779", "0.5323535", "0.5301582", "0.52859825", "0.52817404", "0.52760077", "0.527006", "0.52548295", "0.52379644", "0.5223382", "0.5212658", "0.52096593", "0.5208411", "0.5205399", "0.51925707", "0.5188566", "0.51843673", "0.51834184", "0.5174208", "0.5168133", "0.516475", "0.5162842", "0.5161947", "0.5160273", "0.515884", "0.514525", "0.51437074", "0.5125729", "0.5116798", "0.51099", "0.5095677", "0.5087004", "0.50783926", "0.50641274", "0.506049", "0.50587386", "0.50410026", "0.5035579", "0.50336325", "0.5032588", "0.502879", "0.50249386", "0.50184155", "0.50171584", "0.50143623", "0.5011314", "0.5008818", "0.5007411", "0.49971193", "0.49928573", "0.49880636", "0.49863875", "0.49861917", "0.49833432", "0.49823612", "0.4967241", "0.4964829", "0.49610943", "0.49577048", "0.49533924", "0.4948771", "0.49479255", "0.4942814", "0.49277025", "0.49202815" ]
0.6670852
0
Gets a list of all conditions in the HAVING clause. This method returns by reference. That allows alter hooks to access the data structure directly and manipulate it before it gets compiled.
public function &havingConditions();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getHaving() {\n return $this->_having ?: new Predicate(Predicate::ALSO);\n }", "public function &getConditions() {\n return $this->conditions;\n }", "public function getHaving()\n\t\t{\n\t\t\treturn $this->havings;\n\t\t}", "public function having($conditions) {\n $this->having = !empty($conditions) ? ('HAVING ' . implode(',', $conditions)) : null;\n return $this;\n }", "public function getHaving()\n {\n return $this->having;\n }", "public function get_conditions()\n {\n return $this->conditions;\n }", "public function getHavingParameterised(&$parameters)\n {\n $this->splitQueryParameters($this->having, $conditions, $parameters);\n return $conditions;\n }", "public function getConditions()\n {\n return $this->conditions;\n }", "public function getConditions()\n {\n return $this->conditions;\n }", "public function getConditions()\n {\n return $this->conditions;\n }", "public function getConditions()\n {\n return $this->conditions;\n }", "public function having(string ...$conditions): self {\r\n\r\n $this -> having = array_merge($this -> having, $conditions);\r\n return $this;\r\n }", "function having(...$having)\n {\n $this->iswhere = false;\n return $this->where( ...$having);\n }", "public function getConditions()\n\t{\n\t\treturn $this->conditions;\n\t}", "public function getConditions()\n\t{\n\t\treturn $this->conditions;\n\t}", "public function having(): Having\n {\n if (!isset($this->having)){\n $this->having = new Query\\Having($this, $this->driver, $this->topQuery);\n }\n return $this->having; \n }", "public function getConditions(): array\n\t{\n\t\treturn $this->conditions;\n\t}", "public function having(){\r\n \t$tb = call_user_func_array(array($this->mask(), 'having'), func_get_args());\r\n\t\treturn $this;\r\n }", "private function buildHaving(): void {\r\n\r\n if(count($this -> having) > 0) {\r\n\r\n $this -> query[] = 'HAVING';\r\n $this -> query[] = sprintf('(%s)', implode(' AND ', $this -> having));\r\n }\r\n }", "public function and_having_close(){\n $this->_having[] = array('AND' => ')');\n\n return $this;\n }", "public function having()\n {\n $this->having = $expr = new Expression;\n $expr->driver = $this->driver;\n $expr->builder = $this;\n $expr->parent = $this;\n return $expr;\n }", "public function and_having_close()\n {\n $this->_having[] = array('AND' => ')');\n\n return $this;\n }", "public function getConditions();", "public function getConditions();", "public function getConditions();", "public function getWheres()\n {\n return $this->wheres;\n }", "public function and_having_open(){\n $this->_having[] = array('AND' => '(');\n\n return $this;\n }", "function condition_values() {\n return array();\n }", "public function addHaving(array $criterion)\n {\n $criterion = new Criterion($criterion);\n $this->criteria->add(\n $criterion->setType('having')\n );\n\n return $this;\n }", "public function getConditionsHook()\n\t{\n\t\t$conditions = array();\n\t\t\n\t\t$conditions['select'] = '`bid` AS id, `cid`, `type`, `name`, `alias`, `imptotal`, `impmade`, '\n\t\t\t\t\t\t\t\t\t\t\t\t\t.'`clicks`, `imageurl`, `clickurl`, `date`, `showBanner` AS state, `checked_out`, '\n\t\t\t\t\t\t\t\t\t\t\t\t\t.'`checked_out_time`, `editor`, `custombannercode`, `catid`, `description`, '\n\t\t\t\t\t\t\t\t\t\t\t\t\t.'`sticky`, `ordering`, `publish_up`, `publish_down`, `tags`, `params`'\t;\n\t\t\n\t\t$conditions['where'] = array();\n\t\t\n\t\treturn $conditions;\n\t}", "public function having(): self\n {\n $bindingsFunction = func_get_args();\n\n $sql = array_shift($bindingsFunction);\n\n $this->addToBindings($bindingsFunction);\n\n $this->havings[] = $sql;\n\n return $this;\n }", "public function having($condition)\n\t\t{\n\t\t\tif($condition instanceof Condition || $condition instanceof ConditionGroup)\n\t\t\t{\n\t\t\t\t$this->havings = $condition; \n\t\t\t\treturn $this;\t\t\t\t\n\t\t\t}\n\t\t\tthrow new \\Exception('Can only add Conditions or ConditionGroups to a statement\\'s where block');\n\t\t}", "public function having()\n {\n $args = func_get_args();\n $count = count($args);\n \n if ($count == 1) {\n $this->having[] = $args[0];\n } else {\n $this->having[] = array_shift($args);\n \n if ($count == 2 && is_array($args[0]))\n $args = $args[0];\n \n if ($args)\n $this->having_params = array_merge($this->having_params, $args);\n }\n return $this;\n }", "public function whereComplex()\n {\n return $this->addComplexCondition('and', $this->conditions);\n }", "public function havingAnd()\n {\n $this->having .= \" AND \";\n }", "public function condition()\n {\n if (!$this->condition) {\n $this->condition = array();\n foreach (monsterToCondition::select('ctype', 'condition')->where('mid', '=', $this->id)->get() as $r) {\n $this->condition[] = $r->condition;\n };\n }\n return $this->condition;\n }", "function having($s)\n{\n\t$this->tryModify();\n\tif(!isset($this->query['having'])) $this->query['having'] = array();\n\t$this->query['having'][] = $this->setWhereParams($s, func_get_args(), 1);\n\treturn $this;\n}", "public function having($conditions, $context, array $options = [])\n\t{\n\t\t$defaults = ['prepend' => 'HAVING'];\n\t\t$options += $defaults;\n\t\treturn $this->_conditions($conditions, $context, $options);\n\t}", "public function orHaving(){\r\n \t$tb = call_user_func_array(array($this->mask(), 'orHaving'), func_get_args());\r\n\t\treturn $this;\r\n }", "public function and_having_open()\n {\n $this->_having[] = array('AND' => '(');\n\n return $this;\n }", "private function addHaving(\n string $glue,\n array | Closure | string $column,\n string $operator,\n array $values\n ) : static {\n return $this->addWhere($glue, $column, $operator, $values, 'having');\n }", "public function getConditions(): ConditionList\n {\n return new ConditionList($this->conditions->toArray());\n }", "public function having($clause, array $params);", "public function having($sql);", "public function get(): array\n {\n return $this->criterions;\n }", "public function getConditionHistogramContainer()\n {\n return $this->conditionHistogramContainer;\n }", "public function getConditionHistogramContainer()\n {\n return $this->conditionHistogramContainer;\n }", "public function having($conditions = null, $overwrite = false);", "protected function getFilter() {\n\t\t$conditions = $this->getConditions();\n\t\treturn $conditions;\n\t}", "public function get_conditions() {\n $conditions = get_post_meta( $this->post_id, '_wcs_conditions', true );\n\n if ( ! $conditions ) {\n return array();\n }\n\n return (array) $conditions;\n }", "public function having($having) \n {\n $this->sql .= \" HAVING \". $this->clean($having);\n return $this;\n }", "public function setHaving($having)\n {\n $having = func_num_args() > 1 ? func_get_args() : $having;\n $this->having = [];\n return $this->addHaving($having);\n }", "protected function getConditions()\n {\n $entityPk = (array)$this->mapper->getConfig()->getPrimaryKey();\n $conditions = [];\n foreach ($entityPk as $col) {\n $val = $this->entityHydrator->get($this->entity, $col);\n if ($val) {\n $conditions[$col] = $val;\n }\n }\n\n // not enough columns? reset\n if (count($conditions) != count($entityPk)) {\n return [];\n }\n\n return $conditions;\n }", "public static function getConditionsHook()\n\t{\n\t\t$conditions = array();\n\n\t\t$conditions['select'] = '`id`, `id` AS sid, `title`, \\'\\' AS `alias`, 1 AS parent_id, `section` AS extension, `description`, `published`, `checked_out`, `checked_out_time`, `access`, `params`, `section`';\n\n\t\t$where_or = array();\n\t\t$where_or[] = \"section REGEXP '^[\\\\-\\\\+]?[[:digit:]]*\\\\.?[[:digit:]]*$'\";\n\t\t$where_or[] = \"section IN ('com_banner', 'com_contact', 'com_contact_details', 'com_content', 'com_newsfeeds', 'com_sections', 'com_weblinks' )\";\n\t\t$conditions['where_or'] = $where_or;\n\n\t\t$conditions['order'] = \"id ASC, section ASC, ordering ASC\";\t\n\n\t\treturn $conditions;\n\t}", "public function getConditions()\n {\n if (empty($this->_conditions)) {\n $this->_resetConditions();\n }\n\n // Load rule conditions if it is applicable\n if ($this->hasConditionsSerialized()) {\n $conditions = $this->getConditionsSerialized();\n if (!empty($conditions)) {\n $conditions = Mage::helper('core/unserializeArray')->unserialize($conditions);\n if (is_array($conditions) && !empty($conditions)) {\n $this->_conditions->loadArray($conditions);\n }\n }\n $this->unsConditionsSerialized();\n }\n\n return $this->_conditions;\n }", "public function buildHaving(array $having = null, array &$values = [])\n {\n if ($having === null) {\n return '';\n }\n\n return 'HAVING ' . $this->buildCondition($having, $values);\n }", "public function getGroupedBindings() {\n return [\n 'fields' => $this->getBindings(),\n 'where' => $this->getWhere()->getBindings(),\n 'having' => $this->getHaving()->getBindings()\n ];\n }", "public function having(\n Closure | string $column,\n string $operator,\n Closure | float | int | string | null ...$values\n ) : static {\n return $this->addHaving('AND', $column, $operator, $values);\n }", "public function getQueryCriteria(): array\n {\n return [\n 'created_after' => new DateValidator,\n 'created_before' => new DateValidator,\n 'id_greater_than' => new PositiveIntValidator,\n 'id_less_than' => new PositiveIntValidator,\n 'name' => new StringValidator,\n 'updated_before' => new DateValidator,\n 'updated_after' => new DateValidator\n ];\n }", "protected function conditionsContainKey()\n {\n if (empty($this->where)) {\n return false;\n }\n\n $conditionKeys = array_keys($this->where);\n\n $model = $this->model;\n\n $keys = $model->hasCompositeKey() ? $model->getCompositeKey() : [$model->getKeyName()];\n\n $conditionsContainKey = count(array_intersect($conditionKeys, $keys)) === count($keys);\n\n if (!$conditionsContainKey) {\n return false;\n }\n\n $conditionValue = [];\n\n foreach ($keys as $key) {\n $condition = $this->where[$key];\n\n $value = $model->unmarshalItem(array_get($condition, 'AttributeValueList'))[0];\n\n $conditionValue[$key] = $value;\n }\n\n return $conditionValue;\n }", "public function getConditions()\n {\n return new CartConditionCollection($this->session->get($this->sessionKeyCartConditions));\n }", "protected function _having($key, $values=[], string $conj='AND'): self\n\t{\n\t\t$where = $this->_where($key, $values);\n\n\t\t// Create key/value placeholders\n\t\tforeach($where as $f => $val)\n\t\t{\n\t\t\t// Split each key by spaces, in case there\n\t\t\t// is an operator such as >, <, !=, etc.\n\t\t\t$fArray = explode(' ', trim($f));\n\n\t\t\t$item = $this->driver->quoteIdent($fArray[0]);\n\n\t\t\t// Simple key value, or an operator\n\t\t\t$item .= (count($fArray) === 1) ? '=?' : \" {$fArray[1]} ?\";\n\n\t\t\t// Put in the having map\n\t\t\t$this->state->appendHavingMap([\n\t\t\t\t'conjunction' => empty($this->state->getHavingMap())\n\t\t\t\t\t? ' HAVING '\n\t\t\t\t\t: \" {$conj} \",\n\t\t\t\t'string' => $item\n\t\t\t]);\n\t\t}\n\n\t\treturn $this;\n\t}", "public function condition()\n {\n return $this->queries->map(function ($query) {\n return [$query['method'] => $query['arguments']];\n })->toArray();\n }", "public function getCriteriaList() {\n return $this->_get(6);\n }", "public function getWhere() {\r\n return $this->_where;\r\n }", "public function where_close()\n {\n return $this->and_where_close();\n }", "public function get_clauses()\n {\n }", "public function getWhereParams()\n {\n return (isset($this->whereBuilder))? $this->whereBuilder->getConditionParameters() : [];\n }", "public function filter()\n {\n foreach ($this->array as $key => $value) {\n foreach ($this->conditions as list($k, $op, $v)) {\n\n $this->convertVariableType($v);\n\n if (!$this->logicFilter($key, $value[$k], $op, $v)) {\n continue 2;\n }\n }\n }\n\n $this->array = array_intersect_key($this->array, array_flip(array_keys($this->filterMask, true)));\n\n return $this->array;\n }", "public function Where()\n {\n return $this->where;\n }", "private function getContainQueries()\n {\n $containStatistics = function (Query $q) {\n return $q->select([\n 'id',\n 'year',\n 'value',\n 'metric_id',\n 'school_id',\n 'school_district_id',\n ]);\n };\n $containCriteria = function (Query $q) {\n return $q\n ->select(['id', 'formula_id', 'weight'])\n ->contain([\n 'Metrics' => function (Query $q) {\n return $q->select(['id', 'name']);\n },\n ]);\n };\n $containSchools = function (Query $q) {\n return $q\n ->select([\n 'id',\n 'name',\n 'address',\n 'url',\n 'phone',\n ])\n ->contain([\n 'Grades' => function (Query $q) {\n return $q\n ->select(['id', 'name'])\n ->orderAsc('Grades.id');\n },\n 'SchoolTypes' => function (Query $q) {\n return $q->select(['id', 'name']);\n },\n ]);\n };\n $containDistricts = function (Query $q) {\n return $q\n ->select([\n 'id',\n 'name',\n 'url',\n 'phone',\n ]);\n };\n $containFormulas = function (Query $q) use ($containCriteria) {\n return $q\n ->select(['id'])\n ->contain([\n 'Criteria' => $containCriteria,\n ]);\n };\n $containResultsSchools = function (Query $q) use ($containSchools, $containStatistics) {\n return $q->contain([\n 'Schools' => $containSchools,\n 'Statistics' => $containStatistics,\n ]);\n };\n $containResultsDistricts = function (Query $q) use ($containDistricts, $containStatistics) {\n return $q->contain([\n 'SchoolDistricts' => $containDistricts,\n 'Statistics' => $containStatistics,\n ]);\n };\n\n return [\n 'formulas' => $containFormulas,\n 'resultsSchools' => $containResultsSchools,\n 'resultsDistricts' => $containResultsDistricts,\n ];\n }", "public function getConditionDataProvider()\n {\n return [\n [\n [\n 'type' => 'type',\n 'attribute' => 'attribute',\n 'operator' => 'operator',\n 'value' => 'value',\n 'value_type' => 'value_type',\n 'aggregator' => 'aggregator',\n 'conditions' => [\n [\n 'type' => 'child_type',\n 'attribute' => 'child_attribute',\n 'operator' => 'child_operator',\n 'value' => 'child_value',\n 'value_type' => null,\n 'aggregator' => 'aggregator'\n ]\n ]\n ]\n ]\n ];\n }", "public function hasWhere()\n {\n return $this->_has('_where');\n }", "public function compileWheres()\n {\n\n // We will add all compiled wheres to this array.\n $filter = array(\n 'bool' => array(\n 'must' => array(),\n 'should' => array(),\n 'must_not' => array()\n )\n );\n\n // The wheres to compile.\n $wheres = $this->wheres ?: array();\n\n foreach ($wheres as $i => &$where)\n {\n // Make sure the operator is in lowercase.\n if (isset($where['operator']))\n {\n $where['operator'] = strtolower($where['operator']);\n\n // Operator conversions\n $convert = array(\n null => 'term',\n '=' => 'term',\n '<>' => 'not term',\n '!=' => 'not term',\n 'regex' => 'regexp',\n 'rlike' => 'regexp',\n 'ilike' => 'regexp',\n 'geowithin' => 'geoWithin',\n 'geometry' => 'geoIntersects',\n 'geointersects' => 'geoIntersects'\n );\n\n if (array_key_exists($where['operator'], $convert))\n {\n $where['operator'] = $convert[$where['operator']];\n }\n }\n\n // The next item in a \"chain\" of wheres devices the boolean of the\n // first item. So if we see that there are multiple wheres, we will\n // use the operator of the next where.\n if ($i == 0 and count($wheres) > 1 and $where['boolean'] == 'and')\n {\n $where['boolean'] = $wheres[$i+1]['boolean'];\n }\n\n // We use different methods to compile different wheres.\n $method = \"compileWhere{$where['type']}\";\n $result = $this->{$method}($where);\n\n // Wrap the where with an $or operator.\n if ($where['boolean'] == 'or')\n {\n $filter['bool']['should'][] = $result;\n }\n else\n {\n $filter['bool']['must'][] = $result;\n }\n\n }\n\n return $filter;\n }", "public function getWhere()\n {\n return $this->where;\n }", "public function conditionsProvider()\n {\n return [[[new \\Urbania\\AppleNews\\Format\\Condition()]]];\n }", "public function conditionsProvider()\n {\n return [[[new \\Urbania\\AppleNews\\Format\\Condition()]]];\n }", "public function getConditions()\n {\n if (empty($this->_conditions)) {\n $this->_resetConditions();\n }\n // Load rule conditions if it is applicable\n if ($this->hasConditionsSerialized()) {\n $conditions = $this->getConditionsSerialized();\n if (!empty($conditions)) {\n $conditions = unserialize($conditions);\n if (is_array($conditions) && !empty($conditions)) {\n $this->_conditions->loadArray($conditions);\n }\n }\n $this->unsConditionsSerialized();\n }\n\n return $this->_conditions;\n }", "public function getParameterConditions(): array\n {\n return $this->parameterConditions;\n }", "public function or_having_open(){\n $this->_having[] = array('OR' => '(');\n\n return $this;\n }", "public function makeGroupByWithHaving( $options ) {\n\t\t$sql = '';\n\t\tif ( isset( $options['GROUP BY'] ) ) {\n\t\t\t$gb = is_array( $options['GROUP BY'] )\n\t\t\t\t? implode( ',', $options['GROUP BY'] )\n\t\t\t\t: $options['GROUP BY'];\n\t\t\t$sql .= ' GROUP BY ' . $gb;\n\t\t}\n\t\tif ( isset( $options['HAVING'] ) ) {\n\t\t\t$having = is_array( $options['HAVING'] )\n\t\t\t\t? $this->makeList( $options['HAVING'], LIST_AND )\n\t\t\t\t: $options['HAVING'];\n\t\t\t$sql .= ' HAVING ' . $having;\n\t\t}\n\n\t\treturn $sql;\n\t}", "public function getActiveConditions() {\n $conditions = self::where('active', true)->get()->toArray();\n return $conditions;\n\n }", "public function having($prop, $value = PDODBNULL, $operator = '=', $cond = 'AND'){\r\n $this->_having[] = array($prop,$value,$operator,$cond);\r\n return $this;\r\n }", "public function scopes()\n {\n return array(\n 'flagged' => array(\n 'condition' => 'flagged = :flagged',\n 'params' => array(':flagged' => self::STATUS_FLAGGED),\n ),\n 'notFlagged' => array(\n 'condition' => 'flagged != :flagged',\n 'params' => array(':flagged' => self::STATUS_FLAGGED),\n ),\n 'owner' => array(\n 'condition' => 'fromOwner = :flag',\n 'params' => array(':flag' => self::STATUS_FROM_OWNER),\n ),\n 'notOwner' => array(\n 'condition' => 'fromOwner != :flag',\n 'params' => array(':flag' => self::STATUS_FROM_OWNER),\n ),\n 'uploaded' => array(\n 'condition' => 'uploaded = :uploaded',\n 'params' => array(':uploaded' => self::STATUS_UPLOADED),\n ),\n 'notUploaded' => array(\n 'condition' => 'uploaded != :uploaded',\n 'params' => array(':uploaded' => self::STATUS_UPLOADED),\n ),\n 'deleted' => array(\n 'condition' => 'deleted = :deleted',\n 'params' => array(':deleted' => self::STATUS_DELETED),\n ),\n 'notDeleted' => array(\n 'condition' => 'deleted != :deleted',\n 'params' => array(':deleted' => self::STATUS_DELETED),\n ),\n 'saved' => array(\n 'condition' => 'saved = :saved',\n 'params' => array(':saved' => self::STATUS_SAVED),\n ),\n 'notSaved' => array(\n 'condition' => 'saved != :saved',\n 'params' => array(':saved' => self::STATUS_SAVED),\n ),\n );\n }", "private function sql_whereAllItems()\n {\n $where = '1 ' .\n $this->sql_whereAnd_pidList() .\n $this->sql_whereAnd_enableFields() .\n $this->sql_whereAnd_Filter() .\n $this->sql_whereAnd_fromTS() .\n $this->sql_whereAnd_sysLanguage();\n // Get WHERE statement\n // RETURN WHERE statement without a WHERE\n return $where;\n }", "public static function having($prop, $value = PDODBNULL, $operator = '=', $cond = 'AND'){\r\n return self::$PDO->having($prop,$value,$operator,$cond);\r\n }", "function getWhere() {\n return $this->where;\n }", "public function addHaving($having)\n {\n $having = $this->normalisePredicates(func_get_args());\n\n // If the function is called with an array of items\n $this->having = array_merge($this->having, $having);\n\n return $this;\n }", "public function getRootConditions(): iterable\n {\n return $this->model->getRootConditions();\n }", "public function hasHaving()\n\t\t{\n\t\t\treturn !is_null($this->havings);\n\t\t}", "public function get_where()\n {\n }", "public function get_where()\n {\n }", "public function having($having = null) {\n\t\tif (!$having) {\n\t\t\treturn $this->_config['having'];\n\t\t}\n\t\t$this->_config['having'] = array_merge(\n\t\t\t(array) $this->_config['having'], (array) $having\n\t\t);\n\t\treturn $this;\n\t}", "public function getCondition(): array\n {\n return $this->nodeConditions;\n }", "function GetArray()\r\n\t{\r\n\t\treturn $this->_arrWhere;\r\n\t}", "protected function compileHavings(Builder $builder, $havings): string\n {\n $sql = implode(' ', array_map([$this, 'compileHaving'], $havings));\n\n return 'having '.$this->removeStatementBoolean($sql);\n }", "protected function getCalculateableCondition()\n {\n return $this->getConditions()->filter(function (CartCondition $condition) {\n if ($condition->getType() !== 'tax') {\n if (($condition->getApplyMinimum() && !$condition->getApplyMinimumForEach()\n && $condition->getApplyMinimum() <= $this->subtotal())) {\n return true;\n }\n\n if ($condition->getTarget() !== 'products' && !$condition->getApplyMinimum()) {\n return true;\n }\n }\n });\n }", "public function or_having_close(){\n $this->_having[] = array('OR' => ')');\n\n return $this;\n }", "public function getHavingItemCount()\n {\n return $this->count(self::HAVING_ITEM);\n }", "public function having(string $having);" ]
[ "0.66103774", "0.659002", "0.65707505", "0.6563108", "0.64636767", "0.6456111", "0.6393219", "0.63529795", "0.63529795", "0.63529795", "0.63529795", "0.6327125", "0.6206203", "0.6202713", "0.6202713", "0.6190177", "0.6163314", "0.615114", "0.61052394", "0.60361916", "0.60053784", "0.59651834", "0.5960285", "0.5960285", "0.5960285", "0.5928507", "0.5907742", "0.59057426", "0.58939135", "0.5887987", "0.58756745", "0.58548903", "0.58437407", "0.58019805", "0.5788439", "0.5781718", "0.57726055", "0.5760841", "0.5756421", "0.5755402", "0.5739927", "0.57288986", "0.5717721", "0.5710459", "0.5694056", "0.5681052", "0.5681052", "0.56623393", "0.56622297", "0.5653343", "0.5624985", "0.5623868", "0.5608938", "0.56040347", "0.55941087", "0.5588126", "0.54989004", "0.5489529", "0.5478029", "0.5470463", "0.54640824", "0.5460537", "0.54570293", "0.54497325", "0.5431312", "0.54192865", "0.540783", "0.54019684", "0.5398194", "0.5394409", "0.5393731", "0.5380595", "0.53805095", "0.5364393", "0.53605783", "0.535679", "0.535679", "0.53431404", "0.5337346", "0.53367776", "0.53347474", "0.5315017", "0.531385", "0.5298417", "0.5296947", "0.52807206", "0.5277999", "0.5277342", "0.5262286", "0.5254509", "0.5252561", "0.5252561", "0.52440256", "0.5242801", "0.52425826", "0.5241557", "0.52415454", "0.5233931", "0.52320963", "0.52306825" ]
0.6714822
0
Gets a list of all values to insert into the HAVING clause.
public function havingArguments();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getHaving()\n\t\t{\n\t\t\treturn $this->havings;\n\t\t}", "public function getHaving()\n {\n return $this->having;\n }", "public function getHaving() {\n return $this->_having ?: new Predicate(Predicate::ALSO);\n }", "public function getHavingParameterised(&$parameters)\n {\n $this->splitQueryParameters($this->having, $conditions, $parameters);\n return $conditions;\n }", "function condition_values() {\n return array();\n }", "private function addHaving(\n string $glue,\n array | Closure | string $column,\n string $operator,\n array $values\n ) : static {\n return $this->addWhere($glue, $column, $operator, $values, 'having');\n }", "public function buildHaving(array $having = null, array &$values = [])\n {\n if ($having === null) {\n return '';\n }\n\n return 'HAVING ' . $this->buildCondition($having, $values);\n }", "public function having()\n {\n $args = func_get_args();\n $count = count($args);\n \n if ($count == 1) {\n $this->having[] = $args[0];\n } else {\n $this->having[] = array_shift($args);\n \n if ($count == 2 && is_array($args[0]))\n $args = $args[0];\n \n if ($args)\n $this->having_params = array_merge($this->having_params, $args);\n }\n return $this;\n }", "private function buildHaving(): void {\r\n\r\n if(count($this -> having) > 0) {\r\n\r\n $this -> query[] = 'HAVING';\r\n $this -> query[] = sprintf('(%s)', implode(' AND ', $this -> having));\r\n }\r\n }", "public function addHaving(array $criterion)\n {\n $criterion = new Criterion($criterion);\n $this->criteria->add(\n $criterion->setType('having')\n );\n\n return $this;\n }", "function having(...$having)\n {\n $this->iswhere = false;\n return $this->where( ...$having);\n }", "public function having(): Having\n {\n if (!isset($this->having)){\n $this->having = new Query\\Having($this, $this->driver, $this->topQuery);\n }\n return $this->having; \n }", "public function all()\n {\n return $this->values;\n }", "public function having(){\r\n \t$tb = call_user_func_array(array($this->mask(), 'having'), func_get_args());\r\n\t\treturn $this;\r\n }", "public function having($conditions) {\n $this->having = !empty($conditions) ? ('HAVING ' . implode(',', $conditions)) : null;\n return $this;\n }", "protected function buildHaving(Query $query)\n {\n $having = '';\n $data = [];\n foreach ($query->getHaving() as $key => $value) {\n //\tadd where on first loop only, AND on all others\n $having .= ($having == '' ? ' HAVING ' : ' AND ').$key;\n if (is_array($value)) {\n $data = array_merge($data, $value);\n continue;\n }\n\n $data[] = $value;\n }\n\n return ['placeholders' => $having, 'data' => $data];\n }", "public function all(): array\n {\n return $this->values;\n }", "public function getHavingItemCount()\n {\n return $this->count(self::HAVING_ITEM);\n }", "public function setHaving($having)\n {\n $having = func_num_args() > 1 ? func_get_args() : $having;\n $this->having = [];\n return $this->addHaving($having);\n }", "function get_inserts() {\n\t\t $attributes = $this->quoted_attributes();\n\n\t\t $inserts = array();\n\t\t foreach($attributes as $key => $value) {\n\t\t\t if(!in_array($key, $this->primary_keys) || ($value != \"''\")) {\n\t\t\t\t $inserts[$key] = $value;\n\t\t\t }\n\t\t }\n\t\t return $inserts;\n\t }", "public function having($sql);", "public function getGroupedBindings() {\n return [\n 'fields' => $this->getBindings(),\n 'where' => $this->getWhere()->getBindings(),\n 'having' => $this->getHaving()->getBindings()\n ];\n }", "public function getValuesList() {\n return $this->_get(3);\n }", "public function getAllValues();", "public function having(): self\n {\n $bindingsFunction = func_get_args();\n\n $sql = array_shift($bindingsFunction);\n\n $this->addToBindings($bindingsFunction);\n\n $this->havings[] = $sql;\n\n return $this;\n }", "public function having(string ...$conditions): self {\r\n\r\n $this -> having = array_merge($this -> having, $conditions);\r\n return $this;\r\n }", "protected function getConditions()\n {\n $entityPk = (array)$this->mapper->getConfig()->getPrimaryKey();\n $conditions = [];\n foreach ($entityPk as $col) {\n $val = $this->entityHydrator->get($this->entity, $col);\n if ($val) {\n $conditions[$col] = $val;\n }\n }\n\n // not enough columns? reset\n if (count($conditions) != count($entityPk)) {\n return [];\n }\n\n return $conditions;\n }", "function having($s)\n{\n\t$this->tryModify();\n\tif(!isset($this->query['having'])) $this->query['having'] = array();\n\t$this->query['having'][] = $this->setWhereParams($s, func_get_args(), 1);\n\treturn $this;\n}", "public static function listOfValues()\n {\n return array_values((new static)->_all);\n }", "function AggregateListRowValues() {\n\t}", "function AggregateListRowValues() {\n\t}", "function AggregateListRowValues() {\n\t}", "function AggregateListRowValues() {\n\t}", "public function aggregateListRowValues()\n\t{\n\t}", "public function aggregateListRowValues()\n\t{\n\t}", "public function having($clause, array $params);", "public function having(string $having);", "public function getAll()\n {\n return $this->values;\n }", "public function getAll()\n {\n return $this->values;\n }", "public function allEvaluations()\n {\n $qb = $this->em->createQueryBuilder();\n $qb->select('e, bfg')\n ->from(Evaluation::class, 'e')\n ->join('e.branchForGroup', 'bfg');\n $result = $qb->getQuery()->getResult();\n return $result;\n }", "function getValues(){\n $values = [];\n \n foreach($this as $valor){\n $values[] = $valor;\n }\n \n return $values;\n }", "public function bindValues()\n {\n $ret = [];\n\n if ($this->data)\n {\n $ret = \\array_values($this->data);\n }\n\n if ($this->getWhereValues())\n {\n $ret = \\array_merge($ret, $this->getWhereValues());\n }\n\n return Utils::arrayFlatten($ret);\n }", "public function getValuesList() {\n return $this->_get(2);\n }", "private function getContainQueries()\n {\n $containStatistics = function (Query $q) {\n return $q->select([\n 'id',\n 'year',\n 'value',\n 'metric_id',\n 'school_id',\n 'school_district_id',\n ]);\n };\n $containCriteria = function (Query $q) {\n return $q\n ->select(['id', 'formula_id', 'weight'])\n ->contain([\n 'Metrics' => function (Query $q) {\n return $q->select(['id', 'name']);\n },\n ]);\n };\n $containSchools = function (Query $q) {\n return $q\n ->select([\n 'id',\n 'name',\n 'address',\n 'url',\n 'phone',\n ])\n ->contain([\n 'Grades' => function (Query $q) {\n return $q\n ->select(['id', 'name'])\n ->orderAsc('Grades.id');\n },\n 'SchoolTypes' => function (Query $q) {\n return $q->select(['id', 'name']);\n },\n ]);\n };\n $containDistricts = function (Query $q) {\n return $q\n ->select([\n 'id',\n 'name',\n 'url',\n 'phone',\n ]);\n };\n $containFormulas = function (Query $q) use ($containCriteria) {\n return $q\n ->select(['id'])\n ->contain([\n 'Criteria' => $containCriteria,\n ]);\n };\n $containResultsSchools = function (Query $q) use ($containSchools, $containStatistics) {\n return $q->contain([\n 'Schools' => $containSchools,\n 'Statistics' => $containStatistics,\n ]);\n };\n $containResultsDistricts = function (Query $q) use ($containDistricts, $containStatistics) {\n return $q->contain([\n 'SchoolDistricts' => $containDistricts,\n 'Statistics' => $containStatistics,\n ]);\n };\n\n return [\n 'formulas' => $containFormulas,\n 'resultsSchools' => $containResultsSchools,\n 'resultsDistricts' => $containResultsDistricts,\n ];\n }", "function getAllDataValues() {\n\t\t$conn = Doctrine_Manager::connection(); \n\t\t$resultvalues = $conn->fetchAll(\"SELECT * FROM lookuptypevalue WHERE lookuptypeid = '\".$this->getID().\"' order by lookupvaluedescription asc \");\n\t\treturn $resultvalues;\t\n\t}", "public function getAll(): array\n {\n return $this->localValues;\n }", "public function having($having = null) {\n\t\tif (!$having) {\n\t\t\treturn $this->_config['having'];\n\t\t}\n\t\t$this->_config['having'] = array_merge(\n\t\t\t(array) $this->_config['having'], (array) $having\n\t\t);\n\t\treturn $this;\n\t}", "static public function getAll()\r\n {\r\n return self::$values;\r\n }", "public function values() : array\n {\n return array_values($this->entries);\n }", "public function getValues()\n {\n if ($this->_values === null) {\n $this->_values = $this->getColumn()->getData('values') ? $this->getColumn()->getData('values') : [];\n }\n return $this->_values;\n }", "public function getMinisters() {\n return $this->parseData($this->sql['min']);\n }", "public function getPublicValues()\n {\n // filter and sort values\n $publicValues = [];\n\n foreach (self::$publicDatatypes as $datatypeId) {\n if (isset($this->values[$datatypeId])) {\n $publicValues[$datatypeId] = $this->values[$datatypeId];\n }\n }\n\n return $publicValues;\n }", "public function having(\n Closure | string $column,\n string $operator,\n Closure | float | int | string | null ...$values\n ) : static {\n return $this->addHaving('AND', $column, $operator, $values);\n }", "public function addHaving($having)\n {\n $having = $this->normalisePredicates(func_get_args());\n\n // If the function is called with an array of items\n $this->having = array_merge($this->having, $having);\n\n return $this;\n }", "public function filterNotNull(): Set;", "public function getFilterValues()\n {\n return $this->filter_values;\n }", "public function having($having) \n {\n $this->sql .= \" HAVING \". $this->clean($having);\n return $this;\n }", "protected function _get_save_values()\n\t{\n\t\t// Is this a create or update operation?\n\t\t$is_create = ! $is_update = $this->loaded();\n\n\t\t$values = array();\n\n\t\tforeach ($this->_meta->fields as $name => $field)\n\t\t{\n\t\t\t// When creating, primary fields should not be included unless\n\t\t\t// they have been changed.\n\t\t\tif ($is_create\n\t\t\t\tand $field instanceof Dorm_Field_Key\n\t\t\t\tand $field->primary\n\t\t\t\tand ! $this->changed($name) )\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// When updating, only changed fields should be included\n\t\t\tif ($is_update AND ! $this->changed($name))\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$value = Arr::get($this->_values, $name);\n\n\t\t\tif ($value !== NULL)\n\t\t\t{\n\t\t\t\t$value = $field->save($value);\n\t\t\t}\n\n\t\t\t$values[$name] = $value;\n\t\t}\n\n\t\t// @todo: Add \"unmapped\" values?\n\n\t\treturn $values;\n\t}", "public static function getRequiredValues():array {\n\n # Declare result\n $result = [];\n\n # Return result\n return $result;\n\n }", "public function makeGroupByWithHaving( $options ) {\n\t\t$sql = '';\n\t\tif ( isset( $options['GROUP BY'] ) ) {\n\t\t\t$gb = is_array( $options['GROUP BY'] )\n\t\t\t\t? implode( ',', $options['GROUP BY'] )\n\t\t\t\t: $options['GROUP BY'];\n\t\t\t$sql .= ' GROUP BY ' . $gb;\n\t\t}\n\t\tif ( isset( $options['HAVING'] ) ) {\n\t\t\t$having = is_array( $options['HAVING'] )\n\t\t\t\t? $this->makeList( $options['HAVING'], LIST_AND )\n\t\t\t\t: $options['HAVING'];\n\t\t\t$sql .= ' HAVING ' . $having;\n\t\t}\n\n\t\treturn $sql;\n\t}", "public function getValues () {\n\n return array_values($this->values);\n\n }", "public function getEmptyValues();", "public function getValues()\n {\n return $this->_values;\n }", "public function getValues(): array\n {\n return $this->getEntityDao()->getValues();\n }", "public function having()\n {\n $this->having = $expr = new Expression;\n $expr->driver = $this->driver;\n $expr->builder = $this;\n $expr->parent = $this;\n return $expr;\n }", "public function get_count_variables() {\r\n\t\treturn array( $this->where, $this->values );\r\n\t}", "public function getValues($clean = true) {\n if ($clean) {\n return array_diff_key($this->data, $this->filter);\n } else {\n return $this->data;\n }\n }", "public function getValues()\n {\n $values = [];\n\n foreach ($this->options['groups'] as $fieldset) {\n foreach ($fieldset['elements'] as $element_id => $element_info) {\n if (!empty($element_info[1]['belongsTo'])) {\n $group = $element_info[1]['belongsTo'];\n $value = $this->getValue($group . '_' . $element_id);\n\n if ($value !== null) {\n $values[$group][$element_id] = $value;\n }\n } else {\n $value = $this->getValue($element_id);\n\n if ($value !== null) {\n $values[$element_id] = $value;\n }\n }\n }\n }\n\n return $values;\n }", "public function getSensitiveValueFrequencyHistogramBuckets()\n {\n return $this->sensitive_value_frequency_histogram_buckets;\n }", "public function getValues()\n {\n return $this->getVal('value', []);\n }", "public function getDimensionValues() {\n\t\treturn $this->dimensionValues;\n\t}", "public function values() {\n\t\treturn array_values($this->_value);\n\t}", "public function havingAnd()\n {\n $this->having .= \" AND \";\n }", "public static function values()\n {\n return self::$values;\n }", "public function values() {\n\t\treturn array_values($this->toArray());\n\t}", "public function getValues()\n\t{\n\t\treturn $this->_values;\n\t}", "public function getStatistics()\n\t{\n\t\t$fieldParent = 'id_project';\n\t\t$statistics = array();\n\n\t\t$statistics = array_merge($statistics,\n\t\t\t$this->getFilterStatisticsChild('expenses', $fieldParent, array('price'))\n\t\t);\n\t\t$statistics = array_merge($statistics,\n\t\t\t$this->getFilterStatisticsChild('events', $fieldParent, array('duration'))\n\t\t);\n\t\t$statistics = array_merge($statistics,\n\t\t\t$this->getFilterStatisticsChild('incomes', $fieldParent, array('price'))\n\t\t);\n\t\t$statistics = array_merge($statistics,\n\t\t\t$this->getFilterStatisticsChild('facts', $fieldParent)\n\t\t);\n\n\t\treturn $statistics;\n\t}", "protected function filterNumericFields(): array\n {\n return [];\n }", "public function values()\n {\n return $this->values;\n }", "public function values()\n {\n return $this->values;\n }", "public function values()\n {\n return $this->values;\n }", "public function values()\n {\n return $this->values;\n }", "public function getValues()\n {\n return $this->values;\n }", "public function getValues()\n {\n return $this->values;\n }", "public function getValues()\n {\n return $this->values;\n }", "public function getValues()\n {\n return $this->values;\n }", "public function &havingConditions();", "public function getValues(): Collection\n {\n return $this->values;\n }", "public function having($key, $val=[]): QueryBuilderInterface\n\t{\n\t\treturn $this->_having($key, $val);\n\t}", "public function getValues() : array\n {\n return $this->values;\n }", "public function get_binds_values()\r\n {\r\n return array_values_recursive_with_keys($this->binds);\r\n }", "public function getSqlPreparedValues()\n {\n return $this->sqlPreparedValues;\n }", "public function getValues() {\n return $this->values;\n }", "public function getValues() {\n return $this->values;\n }", "public static function getExtraList(): array\n\t{\n\t\t$result = [];\n\n\t\t$iterator = self::getList([\n\t\t\t'select' => [\n\t\t\t\t'ID',\n\t\t\t\t'NAME',\n\t\t\t\t'PERCENTAGE',\n\t\t\t],\n\t\t\t'order' => [\n\t\t\t\t'ID' => 'ASC',\n\t\t\t],\n\t\t\t'cache' => [\n\t\t\t\t'ttl' => 86400,\n\t\t\t],\n\t\t]);\n\t\twhile ($row = $iterator->fetch())\n\t\t{\n\t\t\t$row['ID'] = (int)$row['ID'];\n\t\t\t$row['PERCENTAGE'] = (float)$row['PERCENTAGE'];\n\n\t\t\t$result[$row['ID']] = $row;\n\t\t}\n\t\tunset($row, $iterator);\n\n\t\treturn $result;\n\t}", "public function getValues()\n {\n // Load the config data\n $output = [];\n $configData = $this->getConfigFieldsList();\n\n // Update the array with database values\n foreach ($configData as $group => $fields) {\n $output[$group] = [];\n foreach ($fields as $key => $value) {\n $v = $this->value($group . '/' . $key);\n $output[$group][$key] = $this->toBooleanFilter($v);\n }\n }\n\n return $output;\n }", "public function having(array $clauseProps){\r\n\r\n foreach ($clauseProps as $key => $value) {\r\n if(is_array($value)){\r\n if(count($value) > 0){\r\n # check that HAVING clause operator supplied is allowed !!\r\n if(!(in_array(strtoupper($value[0]), $this->allowedOperators))){\r\n throw new UnexpectedValueException();\r\n }\r\n }\r\n }\r\n }\r\n\r\n $this->queryString .= (\" HAVING \" . implode(', ', $this->prepareSelectPlaceholder($clauseProps)));\r\n\r\n return $this;\r\n }", "public function get_values() {\n\t\t$values = [];\n\n\t\tforeach ( $this->fields as $field ) {\n\t\t\t$values[$field->name] = $field->get_value();\n\t\t}\n\n\t\treturn $values;\n\t}", "public function getValues()\n {\n return array_values($this->data);\n }", "public function appendHavingItem($value)\n {\n return $this->append(self::HAVING_ITEM, $value);\n }", "protected function _having($key, $values=[], string $conj='AND'): self\n\t{\n\t\t$where = $this->_where($key, $values);\n\n\t\t// Create key/value placeholders\n\t\tforeach($where as $f => $val)\n\t\t{\n\t\t\t// Split each key by spaces, in case there\n\t\t\t// is an operator such as >, <, !=, etc.\n\t\t\t$fArray = explode(' ', trim($f));\n\n\t\t\t$item = $this->driver->quoteIdent($fArray[0]);\n\n\t\t\t// Simple key value, or an operator\n\t\t\t$item .= (count($fArray) === 1) ? '=?' : \" {$fArray[1]} ?\";\n\n\t\t\t// Put in the having map\n\t\t\t$this->state->appendHavingMap([\n\t\t\t\t'conjunction' => empty($this->state->getHavingMap())\n\t\t\t\t\t? ' HAVING '\n\t\t\t\t\t: \" {$conj} \",\n\t\t\t\t'string' => $item\n\t\t\t]);\n\t\t}\n\n\t\treturn $this;\n\t}" ]
[ "0.59974545", "0.5828762", "0.58052045", "0.5748108", "0.5447974", "0.54459494", "0.5443569", "0.5405427", "0.5380105", "0.5377666", "0.536575", "0.53161865", "0.52994925", "0.5283852", "0.5227224", "0.5191971", "0.51524", "0.51405084", "0.5128575", "0.5127995", "0.51006305", "0.50889003", "0.50833446", "0.5072487", "0.50598377", "0.5056843", "0.50159824", "0.50074947", "0.49929965", "0.4980059", "0.4980059", "0.4980059", "0.4980059", "0.49574485", "0.49574485", "0.49547926", "0.49458584", "0.49333182", "0.49333182", "0.4890599", "0.48836842", "0.48710117", "0.48691988", "0.4864236", "0.48386165", "0.48142397", "0.48001665", "0.47981888", "0.4794918", "0.47869122", "0.47828135", "0.47768077", "0.47731635", "0.47698897", "0.47618344", "0.47528726", "0.4740417", "0.47364667", "0.47334003", "0.47333652", "0.47250396", "0.47229874", "0.4720303", "0.4717983", "0.4710403", "0.46995816", "0.46961743", "0.46875763", "0.4676952", "0.46731824", "0.46709144", "0.46627042", "0.46600884", "0.46595192", "0.46554655", "0.46544328", "0.46521473", "0.46521026", "0.46499953", "0.46499953", "0.46499953", "0.46499953", "0.46491665", "0.46491665", "0.46491665", "0.46491665", "0.46443844", "0.46425372", "0.4638399", "0.46367815", "0.46333724", "0.46319383", "0.46317098", "0.46317098", "0.46279904", "0.46269086", "0.4626168", "0.46197903", "0.46150845", "0.46150455", "0.46134704" ]
0.0
-1
Adds an arbitrary HAVING clause to the query.
public function having($snippet, $args = []);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function having($clause, array $params);", "public function having($sql);", "public function having($having) \n {\n $this->sql .= \" HAVING \". $this->clean($having);\n return $this;\n }", "public function having(string $having);", "function having($s)\n{\n\t$this->tryModify();\n\tif(!isset($this->query['having'])) $this->query['having'] = array();\n\t$this->query['having'][] = $this->setWhereParams($s, func_get_args(), 1);\n\treturn $this;\n}", "public function havingSQL($havingSqlStatement){\n $this->debugBacktrace();\n $this->havingClause = $havingSqlStatement;\n }", "public function getHaving() {\n return $this->_having ?: new Predicate(Predicate::ALSO);\n }", "public function addHaving(array $criterion)\n {\n $criterion = new Criterion($criterion);\n $this->criteria->add(\n $criterion->setType('having')\n );\n\n return $this;\n }", "public function having(): Having\n {\n if (!isset($this->having)){\n $this->having = new Query\\Having($this, $this->driver, $this->topQuery);\n }\n return $this->having; \n }", "function having(...$having)\n {\n $this->iswhere = false;\n return $this->where( ...$having);\n }", "public function havingCondition($field, $value = NULL, $operator = NULL);", "public function having(array $clauseProps){\r\n\r\n foreach ($clauseProps as $key => $value) {\r\n if(is_array($value)){\r\n if(count($value) > 0){\r\n # check that HAVING clause operator supplied is allowed !!\r\n if(!(in_array(strtoupper($value[0]), $this->allowedOperators))){\r\n throw new UnexpectedValueException();\r\n }\r\n }\r\n }\r\n }\r\n\r\n $this->queryString .= (\" HAVING \" . implode(', ', $this->prepareSelectPlaceholder($clauseProps)));\r\n\r\n return $this;\r\n }", "public function having($condition)\n\t\t{\n\t\t\tif($condition instanceof Condition || $condition instanceof ConditionGroup)\n\t\t\t{\n\t\t\t\t$this->havings = $condition; \n\t\t\t\treturn $this;\t\t\t\t\n\t\t\t}\n\t\t\tthrow new \\Exception('Can only add Conditions or ConditionGroups to a statement\\'s where block');\n\t\t}", "function addComplexHaving($name, $having) {\n\t\t$this->addBlock('having', $name, $having);\n\t\treturn $this;\n\t}", "public function having($conditions) {\n $this->having = !empty($conditions) ? ('HAVING ' . implode(',', $conditions)) : null;\n return $this;\n }", "private function addHaving(\n string $glue,\n array | Closure | string $column,\n string $operator,\n array $values\n ) : static {\n return $this->addWhere($glue, $column, $operator, $values, 'having');\n }", "public function setHaving($having)\n {\n $having = func_num_args() > 1 ? func_get_args() : $having;\n $this->having = [];\n return $this->addHaving($having);\n }", "public function having($query, array $params = array())\r\n {\r\n $this->add_bind('having', $params);\r\n\r\n $this->having[] = compact('query', 'params');\r\n\r\n return $this;\r\n }", "private function buildHaving(): void {\r\n\r\n if(count($this -> having) > 0) {\r\n\r\n $this -> query[] = 'HAVING';\r\n $this -> query[] = sprintf('(%s)', implode(' AND ', $this -> having));\r\n }\r\n }", "public function addHaving($having)\n {\n $having = $this->normalisePredicates(func_get_args());\n\n // If the function is called with an array of items\n $this->having = array_merge($this->having, $having);\n\n return $this;\n }", "public function makeGroupByWithHaving( $options ) {\n\t\t$sql = '';\n\t\tif ( isset( $options['GROUP BY'] ) ) {\n\t\t\t$gb = is_array( $options['GROUP BY'] )\n\t\t\t\t? implode( ',', $options['GROUP BY'] )\n\t\t\t\t: $options['GROUP BY'];\n\t\t\t$sql .= ' GROUP BY ' . $gb;\n\t\t}\n\t\tif ( isset( $options['HAVING'] ) ) {\n\t\t\t$having = is_array( $options['HAVING'] )\n\t\t\t\t? $this->makeList( $options['HAVING'], LIST_AND )\n\t\t\t\t: $options['HAVING'];\n\t\t\t$sql .= ' HAVING ' . $having;\n\t\t}\n\n\t\treturn $sql;\n\t}", "public function scopeHavingFeature(EloquentBuilder $query, $feature);", "public function having($having)\n {\n if ( ! (func_num_args() == 1 && $having instanceof Composite)) {\n $having = new Composite(Composite::TYPE_AND, func_get_args());\n }\n\n return $this->add('having', $having);\n }", "public function having()\n {\n $args = func_get_args();\n $count = count($args);\n \n if ($count == 1) {\n $this->having[] = $args[0];\n } else {\n $this->having[] = array_shift($args);\n \n if ($count == 2 && is_array($args[0]))\n $args = $args[0];\n \n if ($args)\n $this->having_params = array_merge($this->having_params, $args);\n }\n return $this;\n }", "public function having($having = null) {\n\t\tif (!$having) {\n\t\t\treturn $this->_config['having'];\n\t\t}\n\t\t$this->_config['having'] = array_merge(\n\t\t\t(array) $this->_config['having'], (array) $having\n\t\t);\n\t\treturn $this;\n\t}", "public function having(string $having, ...$params): Selection\n {\n $this->selection->having($having, ...$params);\n return $this;\n }", "public function buildHaving(array $having = null, array &$values = [])\n {\n if ($having === null) {\n return '';\n }\n\n return 'HAVING ' . $this->buildCondition($having, $values);\n }", "public function getHaving()\n {\n return $this->having;\n }", "function mHAVING(){\n try {\n $_type = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$HAVING;\n $_channel = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$DEFAULT_TOKEN_CHANNEL;\n // Tokenizer11.g:64:3: ( 'having' ) \n // Tokenizer11.g:65:3: 'having' \n {\n $this->matchString(\"having\"); \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 having(){\r\n \t$tb = call_user_func_array(array($this->mask(), 'having'), func_get_args());\r\n\t\treturn $this;\r\n }", "final public function addHaving(YMKM_SQL_Entity_Having $s)\n {\n $this->doAddHaving($s);\n return $this;\n }", "public function having($key, $val=[]): QueryBuilderInterface\n\t{\n\t\treturn $this->_having($key, $val);\n\t}", "public function having(): self\n {\n $bindingsFunction = func_get_args();\n\n $sql = array_shift($bindingsFunction);\n\n $this->addToBindings($bindingsFunction);\n\n $this->havings[] = $sql;\n\n return $this;\n }", "public function having(\n Closure | string $column,\n string $operator,\n Closure | float | int | string | null ...$values\n ) : static {\n return $this->addHaving('AND', $column, $operator, $values);\n }", "public function havingAnd()\n {\n $this->having .= \" AND \";\n }", "public static function having($prop, $value = PDODBNULL, $operator = '=', $cond = 'AND'){\r\n return self::$PDO->having($prop,$value,$operator,$cond);\r\n }", "public function having()\n {\n $this->having = $expr = new Expression;\n $expr->driver = $this->driver;\n $expr->builder = $this;\n $expr->parent = $this;\n return $expr;\n }", "public function having($prop, $value = PDODBNULL, $operator = '=', $cond = 'AND'){\r\n $this->_having[] = array($prop,$value,$operator,$cond);\r\n return $this;\r\n }", "public function having($key, $value = NULL, $escape = NULL)\n\t{\n\t\treturn $this->_wh('qb_having', $key, $value, 'AND ', $escape);\n\t}", "public function having($sField, $sValue, $sOperator = '=')\n {\n $this->optClause('HAVING', $sField, $sValue, $sOperator);\n\n return $this;\n }", "public function having(string ...$conditions): self {\r\n\r\n $this -> having = array_merge($this -> having, $conditions);\r\n return $this;\r\n }", "protected function compileHaving(Builder $query, array $having)\n {\n $sql = implode(' ', array_map([$this, 'compileHaving'], $having));\n\n return 'having ' . $this->removeLeadingBoolean($sql);\n }", "public function and_having_close(){\n $this->_having[] = array('AND' => ')');\n\n return $this;\n }", "public function having(string $column, string $operator, $value)\n {\n /**\n * If the value is a Builder object then\n * add its parameters to the parameters array\n * and create the subquery from the syntax class\n */\n if ($value instanceof Builder) {\n $this->parameters = array_merge($this->parameters, $value->getParameters());\n $value = \"(\".$this->syntax->selectSyntax(get_object_vars($value)).\")\";\n }\n $this->having = [\"column\" => $column, \"operator\" => $operator, \"value\" => $value];\n \n return $this;\n }", "public function having($expression)\n\t{\n\t\tif (!($expression === NULL || is_string($expression))) {\n\t\t\tthrow new InvalidArgumentException('Having expression has to be a string or NULL.');\n\t\t}\n\t\t$this->dirty();\n\t\t$this->having = $expression;\n\t\t$this->args['having'] = array_slice(func_get_args(), 1);\n\t\treturn $this;\n\t}", "function having($key, $value = '', $escape = TRUE)\r\n\t{\r\n\t\treturn $this->_having($key, $value, 'AND ', $escape);\r\n\t}", "public function andHaving($having)\n {\n $having = $this->getQueryPart('having');\n $args = func_get_args();\n\n if ($having instanceof Composite && $having->getType() === Composite::TYPE_AND) {\n $having->addMultiple($args);\n } else {\n array_unshift($args, $having);\n $having = new Composite(Composite::TYPE_AND, $args);\n }\n\n return $this->add('having', $having);\n }", "public function orHaving(){\r\n \t$tb = call_user_func_array(array($this->mask(), 'orHaving'), func_get_args());\r\n\t\treturn $this;\r\n }", "public function having($conditions = null, $overwrite = false);", "public function addHavingWithVariables($condition, array $variables) {\n $condition = $this->parseVariables($condition, $variables);\n\n parent::addHavingWithVariables($condition, array());\n }", "public function and_having($column, $op, $value = NULL){\n $this->_having[] = array('AND' => array($column, $op, $value));\n\n return $this;\n }", "public function and_having_close()\n {\n $this->_having[] = array('AND' => ')');\n\n return $this;\n }", "public function having($field, $value = null, $escape = null)\n {\n return $this->prepareWhereStatement($field, $value, 'AND ', $escape, 'having');\n }", "protected function _buildContentHaving($q = true)\n\t{\n\t\t$filter_assigned = $this->getState('filter_assigned');\n\n\t\t$having = array();\n\n\t\tif ($filter_assigned === 'O')\n\t\t{\n\t\t\t$having[] = 'COUNT(rel.fileid) = 0';\n\t\t}\n\t\telseif ($filter_assigned === 'A')\n\t\t{\n\t\t\t$having[] = 'COUNT(rel.fileid) > 0';\n\t\t}\n\n\t\tif ($q instanceof \\JDatabaseQuery)\n\t\t{\n\t\t\treturn $having ? $q->having($having) : $q;\n\t\t}\n\n\t\treturn $q\n\t\t\t? ' HAVING ' . (count($having) ? implode(' AND ', $having) : ' 1 ')\n\t\t\t: $having;\n\t}", "function _having($key, $value = '', $type = 'AND ', $escape = TRUE)\r\n\t{\r\n\t\t// Check if this is a related object\r\n\t\tif ( ! empty($this->parent))\r\n\t\t{\r\n\t\t\t$this->db->_having($this->table . '.' . $key, $value, $type, $escape);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$this->db->_having($key, $value, $type, $escape);\r\n\t\t}\r\n\r\n\t\t// For method chaining\r\n\t\treturn $this;\r\n\t}", "public function orHaving($key, $val=[]): QueryBuilderInterface\n\t{\n\t\treturn $this->_having($key, $val, 'OR');\n\t}", "public function andHaving($expression)\n\t{\n\t\tif (!is_string($expression)) {\n\t\t\tthrow new InvalidArgumentException('Having expression has to be a string.');\n\t\t}\n\t\t$this->dirty();\n\t\t$this->having = $this->having ? '(' . $this->having . ') AND (' . $expression . ')' : $expression;\n\t\t$this->pushArgs('having', array_slice(func_get_args(), 1));\n\t\treturn $this;\n\t}", "protected function compileHaving(array $having): string\n {\n if ($having['type'] === 'raw') {\n return $having['boolean'].' '.$having['sql'];\n } elseif ($having['type'] === 'between') {\n return $this->compileHavingBetween($having);\n }\n\n return $this->compileBasicHaving($having);\n }", "public function and_having($column, $op = null, $value = null)\n {\n if(func_num_args() === 2)\n {\n $value = $op;\n $op = '=';\n }\n\n $this->_having[] = array('AND' => array($column, $op, $value));\n\n return $this;\n }", "public function getHavingParameterised(&$parameters)\n {\n $this->splitQueryParameters($this->having, $conditions, $parameters);\n return $conditions;\n }", "public function having($field, $value = null, $comparitor = null);", "protected function compileBasicHaving($having): string\n {\n $column = $this->wrap($having['column']);\n\n $parameter = $this->parameter($having['value']);\n\n return $having['boolean'].' '.$column.' '.$having['operator'].' '.$parameter;\n }", "protected function compileHavings(Builder $builder, $havings): string\n {\n $sql = implode(' ', array_map([$this, 'compileHaving'], $havings));\n\n return 'having '.$this->removeStatementBoolean($sql);\n }", "public function not_having($having) \n {\n $this->sql .= \" NOT HAVING \". $this->clean($having);\n return $this;\n }", "protected function buildHaving(Query $query)\n {\n $having = '';\n $data = [];\n foreach ($query->getHaving() as $key => $value) {\n //\tadd where on first loop only, AND on all others\n $having .= ($having == '' ? ' HAVING ' : ' AND ').$key;\n if (is_array($value)) {\n $data = array_merge($data, $value);\n continue;\n }\n\n $data[] = $value;\n }\n\n return ['placeholders' => $having, 'data' => $data];\n }", "public function orHaving($expression)\n\t{\n\t\tif (!is_string($expression)) {\n\t\t\tthrow new InvalidArgumentException('Having expression has to be a string.');\n\t\t}\n\t\t$this->dirty();\n\t\t$this->having = $this->having ? '(' . $this->having . ') OR (' . $expression . ')' : $expression;\n\t\t$this->pushArgs('having', array_slice(func_get_args(), 1));\n\t\treturn $this;\n\t}", "public static function buildHaving(UniqueObject $havingClause, $firstTable, $lastTable, $lastModel) {\n\t\tif ($havingClause->getModel()->getName() != 'Comhon\\Logic\\Having\\Clause') {\n\t\t\t$clauseModel = ModelManager::getInstance()->getInstanceModel('Comhon\\Logic\\Having\\Clause');\n\t\t\tthrow new ArgumentException($havingClause, $clauseModel->getObjectInstance(false)->getComhonClass(), 1);\n\t\t}\n\t\t$havingClause->validate();\n\t\t$clause = new HavingClause($havingClause->getValue('type'));\n\t\t\n\t\t/** @var \\Comhon\\Object\\UniqueObject $element */\n\t\tforeach ($havingClause->getValue('elements') as $element) {\n\t\t\tif ($element->getModel()->getName() == 'Comhon\\Logic\\Having\\Clause') { // clause\n\t\t\t\t$clause->addClause(self::buildHaving($element, $firstTable, $lastTable, $lastModel));\n\t\t\t} else { // literal\n\t\t\t\t// table is not used anymore for function \"COUNT\" because we now use COUNT(*) instead of COUNT(table.column)\n\t\t\t\t// but we keep condition just in case\n\t\t\t\t$table = $element->getModel()->getName() == 'Comhon\\Logic\\Having\\Literal\\Count' ? $firstTable : $lastTable;\n\t\t\t\t$clause->addLiteral(HavingLiteral::buildHaving($element, $table, $lastModel));\n\t\t\t}\n\t\t}\n\t\treturn $clause;\n\t}", "public function having($conditions, $context, array $options = [])\n\t{\n\t\t$defaults = ['prepend' => 'HAVING'];\n\t\t$options += $defaults;\n\t\treturn $this->_conditions($conditions, $context, $options);\n\t}", "public function getHaving()\n\t\t{\n\t\t\treturn $this->havings;\n\t\t}", "protected function renderHaving() : ?string\n {\n return $this->renderWhere('having');\n }", "public static function orHaving($prop, $value = PDODBNULL, $operator = '='){\r\n return self::$PDO->orHaving($prop,$value,$operator);\r\n }", "public function orHaving($field, $value = null, $escape = null)\n {\n return $this->prepareWhereStatement($field, $value, 'OR ', $escape, 'having');\n }", "public function having($field, $op = null, $value = null) {\n return $this->_modifyPredicate($this->_having, Predicate::ALSO, $field, $op, $value);\n }", "public function orHaving($having)\n {\n $having = $this->getQueryPart('having');\n $args = func_get_args();\n\n if ($having instanceof Composite && $having->getType() === Composite::TYPE_OR) {\n $having->addMultiple($args);\n } else {\n array_unshift($args, $having);\n $having = new Composite(Composite::TYPE_OR, $args);\n }\n\n return $this->add('having', $having);\n }", "public function and_having_open(){\n $this->_having[] = array('AND' => '(');\n\n return $this;\n }", "protected function _having($key, $values=[], string $conj='AND'): self\n\t{\n\t\t$where = $this->_where($key, $values);\n\n\t\t// Create key/value placeholders\n\t\tforeach($where as $f => $val)\n\t\t{\n\t\t\t// Split each key by spaces, in case there\n\t\t\t// is an operator such as >, <, !=, etc.\n\t\t\t$fArray = explode(' ', trim($f));\n\n\t\t\t$item = $this->driver->quoteIdent($fArray[0]);\n\n\t\t\t// Simple key value, or an operator\n\t\t\t$item .= (count($fArray) === 1) ? '=?' : \" {$fArray[1]} ?\";\n\n\t\t\t// Put in the having map\n\t\t\t$this->state->appendHavingMap([\n\t\t\t\t'conjunction' => empty($this->state->getHavingMap())\n\t\t\t\t\t? ' HAVING '\n\t\t\t\t\t: \" {$conj} \",\n\t\t\t\t'string' => $item\n\t\t\t]);\n\t\t}\n\n\t\treturn $this;\n\t}", "protected function compileBasicHaving($having)\n {\n $column = $this->wrap($having['column']);\n\n $parameter = $this->parameter($having['value']);\n\n return $having['boolean'].' '.$column.' '.$having['operator'].' '.$parameter;\n }", "public function or_having($key, $value = NULL, $escape = NULL)\n\t{\n\t\treturn $this->_wh('qb_having', $key, $value, 'OR ', $escape);\n\t}", "public function appendHavingItem($value)\n {\n return $this->append(self::HAVING_ITEM, $value);\n }", "public function havingOR()\n {\n $this->having .= \" OR \";\n }", "public function havingGte($col, $value)\n {\n $this->having .= \"$col >= $value\";\n }", "public function or_having_close(){\n $this->_having[] = array('OR' => ')');\n\n return $this;\n }", "protected function compileHaving(array $having)\n {\n // If the having clause is \"raw\", we can just return the clause straight away\n // without doing any more processing on it. Otherwise, we will compile the\n // clause into Cypher based on the components that make it up from builder.\n if ($having['type'] === 'raw') {\n return $having['boolean'].' '.$having['cypher'];\n }\n\n return $this->compileBasicHaving($having);\n }", "public function havingLike(\n Closure | string $column,\n Closure | float | int | string | null $value\n ) : static {\n return $this->having($column, 'LIKE', $value);\n }", "public function having(array $filter): static\n {\n return $this->withProperty('filter', array_merge($this->filter, $filter));\n }", "public function or_having_close()\n {\n $this->_having[] = array('OR' => ')');\n\n return $this;\n }", "public function or_having($column, $op = null, $value = null)\n {\n if(func_num_args() === 2)\n {\n $value = $op;\n $op = '=';\n }\n\n $this->_having[] = array('OR' => array($column, $op, $value));\n\n return $this;\n }", "public function and_having_open()\n {\n $this->_having[] = array('AND' => '(');\n\n return $this;\n }", "public function havingLte($col, $value)\n {\n $this->having .= \"$col <= $value \";\n }", "function or_having($key, $value = '', $escape = TRUE)\r\n\t{\r\n\t\treturn $this->_having($key, $value, 'OR ', $escape);\r\n\t}", "public function orHavingLike(\n Closure | string $column,\n Closure | float | int | string | null $value\n ) : static {\n return $this->orHaving($column, 'LIKE', $value);\n }", "public function orHavingEqual(\n Closure | string $column,\n Closure | float | int | string | null $value\n ) : static {\n return $this->orHaving($column, '=', $value);\n }", "public function orHaving($prop, $value = PDODBNULL, $operator = '='){\r\n return $this->where($prop,$value,$operator,'OR');\r\n }", "public function havingEqual(\n Closure | string $column,\n Closure | float | int | string | null $value\n ) : static {\n return $this->having($column, '=', $value);\n }", "private function getHavingRaw($search_string) {\n\n $searchArray = explode(\" \", $search_string);\n\n static $having = '';\n //creates a having query for each incoming word\n for ($nCount = 0; $nCount < sizeof($searchArray); $nCount++) {\n if (Config::get('database.default') === 'mysql') {\n $having .= \" AND GROUP_CONCAT(descriptors.description) \" .\n \"like '%\" . strtolower(ltrim(rtrim($searchArray[$nCount]))) . \"%'\";\n } else {\n $having .= \" AND string_agg(LOWER(descriptors.description), ' ' ORDER BY descriptors.\\\"descriptorType_id\\\") \" .\n \"like '%\" . strtolower(ltrim(rtrim($searchArray[$nCount]))) . \"%'\";\n }\n }\n\n return substr($having, 5, strlen($having) - 5);\n }", "protected function user_where_clause() {}", "public function or_having_open(){\n $this->_having[] = array('OR' => '(');\n\n return $this;\n }", "protected abstract function getGroupByClause(array $grouping);", "public function havingIsNotNull(Closure | string $column) : static\n {\n return $this->having($column, 'IS NOT NULL');\n }", "public function testGroupByCountOnlyFilters() {\n // Check if GROUP BY and HAVING are included when a view\n // doesn't display SUM, COUNT, MAX, etc. functions in SELECT statement.\n\n for ($x = 0; $x < 10; $x++) {\n $this->storage->create(['name' => 'name1'])->save();\n }\n\n $view = Views::getView('test_group_by_in_filters');\n $this->executeView($view);\n\n $this->assertStringContainsString('GROUP BY', (string) $view->build_info['query'], 'Make sure that GROUP BY is in the query');\n $this->assertStringContainsString('HAVING', (string) $view->build_info['query'], 'Make sure that HAVING is in the query');\n }", "protected function compileHavingBetween($having): string\n {\n $between = $having['not'] ? 'not between' : 'between';\n\n $column = $this->wrap($having['column']);\n\n $min = $this->parameter(headItem($having['values']));\n $max = $this->parameter(lastItem($having['values']));\n\n return $having['boolean'].' '.$column.' '.$between.' '.$min.' and '.$max;\n }" ]
[ "0.74526924", "0.69209415", "0.68110424", "0.6674092", "0.6645885", "0.6578243", "0.65213406", "0.6498943", "0.6432526", "0.6360529", "0.6360331", "0.63500684", "0.6321787", "0.62960535", "0.6205678", "0.6200963", "0.61823285", "0.6181196", "0.6151645", "0.61313885", "0.6090935", "0.6023798", "0.60133785", "0.6011077", "0.59638363", "0.59536195", "0.59535587", "0.5937133", "0.5920179", "0.5895339", "0.58796716", "0.5868056", "0.5857912", "0.58542323", "0.5803096", "0.5792817", "0.5692332", "0.56736386", "0.5670916", "0.5658113", "0.56501204", "0.5632671", "0.56264424", "0.56207484", "0.5617885", "0.56117606", "0.5601705", "0.5537852", "0.5533904", "0.55324537", "0.55136293", "0.54439235", "0.5434986", "0.5434229", "0.54238284", "0.53918105", "0.538745", "0.5383443", "0.5382069", "0.5377077", "0.5346798", "0.5343197", "0.5325592", "0.53066033", "0.5296869", "0.52397114", "0.5233534", "0.52259415", "0.5224221", "0.5216004", "0.5203194", "0.5195184", "0.51862943", "0.51042444", "0.5083664", "0.5078444", "0.50765836", "0.5070602", "0.5069526", "0.5066999", "0.5064694", "0.5042757", "0.5038877", "0.49483413", "0.48975536", "0.48948842", "0.48936772", "0.4807002", "0.47999442", "0.4790202", "0.4783351", "0.47630152", "0.47501153", "0.47233027", "0.47173753", "0.4712364", "0.46999165", "0.46963465", "0.46845308", "0.4681464", "0.46739498" ]
0.0
-1
Compiles the HAVING clause for later retrieval.
public function havingCompile(Connection $connection);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function having($clause, array $params);", "public function having($sql);", "private function buildHaving(): void {\r\n\r\n if(count($this -> having) > 0) {\r\n\r\n $this -> query[] = 'HAVING';\r\n $this -> query[] = sprintf('(%s)', implode(' AND ', $this -> having));\r\n }\r\n }", "public function having($having) \n {\n $this->sql .= \" HAVING \". $this->clean($having);\n return $this;\n }", "public function getHaving() {\n return $this->_having ?: new Predicate(Predicate::ALSO);\n }", "public function having()\n {\n $this->having = $expr = new Expression;\n $expr->driver = $this->driver;\n $expr->builder = $this;\n $expr->parent = $this;\n return $expr;\n }", "public function makeGroupByWithHaving( $options ) {\n\t\t$sql = '';\n\t\tif ( isset( $options['GROUP BY'] ) ) {\n\t\t\t$gb = is_array( $options['GROUP BY'] )\n\t\t\t\t? implode( ',', $options['GROUP BY'] )\n\t\t\t\t: $options['GROUP BY'];\n\t\t\t$sql .= ' GROUP BY ' . $gb;\n\t\t}\n\t\tif ( isset( $options['HAVING'] ) ) {\n\t\t\t$having = is_array( $options['HAVING'] )\n\t\t\t\t? $this->makeList( $options['HAVING'], LIST_AND )\n\t\t\t\t: $options['HAVING'];\n\t\t\t$sql .= ' HAVING ' . $having;\n\t\t}\n\n\t\treturn $sql;\n\t}", "public function having(): Having\n {\n if (!isset($this->having)){\n $this->having = new Query\\Having($this, $this->driver, $this->topQuery);\n }\n return $this->having; \n }", "public function having(){\r\n \t$tb = call_user_func_array(array($this->mask(), 'having'), func_get_args());\r\n\t\treturn $this;\r\n }", "private function addHaving(\n string $glue,\n array | Closure | string $column,\n string $operator,\n array $values\n ) : static {\n return $this->addWhere($glue, $column, $operator, $values, 'having');\n }", "public function buildHaving(array $having = null, array &$values = [])\n {\n if ($having === null) {\n return '';\n }\n\n return 'HAVING ' . $this->buildCondition($having, $values);\n }", "function having($s)\n{\n\t$this->tryModify();\n\tif(!isset($this->query['having'])) $this->query['having'] = array();\n\t$this->query['having'][] = $this->setWhereParams($s, func_get_args(), 1);\n\treturn $this;\n}", "public function having(string $having);", "public function havingSQL($havingSqlStatement){\n $this->debugBacktrace();\n $this->havingClause = $havingSqlStatement;\n }", "function having(...$having)\n {\n $this->iswhere = false;\n return $this->where( ...$having);\n }", "public function having($conditions) {\n $this->having = !empty($conditions) ? ('HAVING ' . implode(',', $conditions)) : null;\n return $this;\n }", "protected function compileHaving(Builder $query, array $having)\n {\n $sql = implode(' ', array_map([$this, 'compileHaving'], $having));\n\n return 'having ' . $this->removeLeadingBoolean($sql);\n }", "protected function compileHaving(array $having): string\n {\n if ($having['type'] === 'raw') {\n return $having['boolean'].' '.$having['sql'];\n } elseif ($having['type'] === 'between') {\n return $this->compileHavingBetween($having);\n }\n\n return $this->compileBasicHaving($having);\n }", "public function having(): self\n {\n $bindingsFunction = func_get_args();\n\n $sql = array_shift($bindingsFunction);\n\n $this->addToBindings($bindingsFunction);\n\n $this->havings[] = $sql;\n\n return $this;\n }", "public function having(array $clauseProps){\r\n\r\n foreach ($clauseProps as $key => $value) {\r\n if(is_array($value)){\r\n if(count($value) > 0){\r\n # check that HAVING clause operator supplied is allowed !!\r\n if(!(in_array(strtoupper($value[0]), $this->allowedOperators))){\r\n throw new UnexpectedValueException();\r\n }\r\n }\r\n }\r\n }\r\n\r\n $this->queryString .= (\" HAVING \" . implode(', ', $this->prepareSelectPlaceholder($clauseProps)));\r\n\r\n return $this;\r\n }", "public function havingCondition($field, $value = NULL, $operator = NULL);", "public function having($condition)\n\t\t{\n\t\t\tif($condition instanceof Condition || $condition instanceof ConditionGroup)\n\t\t\t{\n\t\t\t\t$this->havings = $condition; \n\t\t\t\treturn $this;\t\t\t\t\n\t\t\t}\n\t\t\tthrow new \\Exception('Can only add Conditions or ConditionGroups to a statement\\'s where block');\n\t\t}", "function addComplexHaving($name, $having) {\n\t\t$this->addBlock('having', $name, $having);\n\t\treturn $this;\n\t}", "public function orHaving(){\r\n \t$tb = call_user_func_array(array($this->mask(), 'orHaving'), func_get_args());\r\n\t\treturn $this;\r\n }", "protected function compileBasicHaving($having): string\n {\n $column = $this->wrap($having['column']);\n\n $parameter = $this->parameter($having['value']);\n\n return $having['boolean'].' '.$column.' '.$having['operator'].' '.$parameter;\n }", "public function addHaving(array $criterion)\n {\n $criterion = new Criterion($criterion);\n $this->criteria->add(\n $criterion->setType('having')\n );\n\n return $this;\n }", "public function having(\n Closure | string $column,\n string $operator,\n Closure | float | int | string | null ...$values\n ) : static {\n return $this->addHaving('AND', $column, $operator, $values);\n }", "public function getHaving()\n {\n return $this->having;\n }", "protected function compileHaving(array $having)\n {\n // If the having clause is \"raw\", we can just return the clause straight away\n // without doing any more processing on it. Otherwise, we will compile the\n // clause into Cypher based on the components that make it up from builder.\n if ($having['type'] === 'raw') {\n return $having['boolean'].' '.$having['cypher'];\n }\n\n return $this->compileBasicHaving($having);\n }", "public static function having($prop, $value = PDODBNULL, $operator = '=', $cond = 'AND'){\r\n return self::$PDO->having($prop,$value,$operator,$cond);\r\n }", "protected function compileHavings(Builder $builder, $havings): string\n {\n $sql = implode(' ', array_map([$this, 'compileHaving'], $havings));\n\n return 'having '.$this->removeStatementBoolean($sql);\n }", "public static function buildHaving(UniqueObject $havingClause, $firstTable, $lastTable, $lastModel) {\n\t\tif ($havingClause->getModel()->getName() != 'Comhon\\Logic\\Having\\Clause') {\n\t\t\t$clauseModel = ModelManager::getInstance()->getInstanceModel('Comhon\\Logic\\Having\\Clause');\n\t\t\tthrow new ArgumentException($havingClause, $clauseModel->getObjectInstance(false)->getComhonClass(), 1);\n\t\t}\n\t\t$havingClause->validate();\n\t\t$clause = new HavingClause($havingClause->getValue('type'));\n\t\t\n\t\t/** @var \\Comhon\\Object\\UniqueObject $element */\n\t\tforeach ($havingClause->getValue('elements') as $element) {\n\t\t\tif ($element->getModel()->getName() == 'Comhon\\Logic\\Having\\Clause') { // clause\n\t\t\t\t$clause->addClause(self::buildHaving($element, $firstTable, $lastTable, $lastModel));\n\t\t\t} else { // literal\n\t\t\t\t// table is not used anymore for function \"COUNT\" because we now use COUNT(*) instead of COUNT(table.column)\n\t\t\t\t// but we keep condition just in case\n\t\t\t\t$table = $element->getModel()->getName() == 'Comhon\\Logic\\Having\\Literal\\Count' ? $firstTable : $lastTable;\n\t\t\t\t$clause->addLiteral(HavingLiteral::buildHaving($element, $table, $lastModel));\n\t\t\t}\n\t\t}\n\t\treturn $clause;\n\t}", "protected function _buildContentHaving($q = true)\n\t{\n\t\t$filter_assigned = $this->getState('filter_assigned');\n\n\t\t$having = array();\n\n\t\tif ($filter_assigned === 'O')\n\t\t{\n\t\t\t$having[] = 'COUNT(rel.fileid) = 0';\n\t\t}\n\t\telseif ($filter_assigned === 'A')\n\t\t{\n\t\t\t$having[] = 'COUNT(rel.fileid) > 0';\n\t\t}\n\n\t\tif ($q instanceof \\JDatabaseQuery)\n\t\t{\n\t\t\treturn $having ? $q->having($having) : $q;\n\t\t}\n\n\t\treturn $q\n\t\t\t? ' HAVING ' . (count($having) ? implode(' AND ', $having) : ' 1 ')\n\t\t\t: $having;\n\t}", "public function having($query, array $params = array())\r\n {\r\n $this->add_bind('having', $params);\r\n\r\n $this->having[] = compact('query', 'params');\r\n\r\n return $this;\r\n }", "protected function compileWhereHavingStatement($cacheKey)\n {\n if (count($this->builderCache->{$cacheKey}) > 0) {\n for ($i = 0, $c = count($this->builderCache->{$cacheKey}); $i < $c; $i++) {\n // Is this condition already compiled?\n if (is_string($this->builderCache->{$cacheKey}[ $i ])) {\n continue;\n } elseif ($this->builderCache->{$cacheKey}[ $i ][ 'escape' ] === false) {\n $this->builderCache->{$cacheKey}[ $i ]\n = $this->builderCache->{$cacheKey}[ $i ][ 'condition' ];\n continue;\n }\n\n // Split multiple conditions\n $conditions = preg_split(\n '/((?:^|\\s+)AND\\s+|(?:^|\\s+)OR\\s+)/i',\n $this->builderCache->{$cacheKey}[ $i ][ 'condition' ],\n -1,\n PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY\n );\n\n for ($ci = 0, $cc = count($conditions); $ci < $cc; $ci++) {\n if (($op = $this->getOperator($conditions[ $ci ])) === false\n OR\n ! preg_match(\n '/^(\\(?)(.*)(' . preg_quote($op, '/') . ')\\s*(.*(?<!\\)))?(\\)?)$/i',\n $conditions[ $ci ],\n $matches\n )\n ) {\n continue;\n }\n\n // $matches = array(\n // 0 => '(test <= foo)', /* the whole thing */\n // 1 => '(', /* optional */\n // 2 => 'test', /* the field name */\n // 3 => ' <= ', /* $op */\n // 4 => 'foo', /* optional, if $op is e.g. 'IS NULL' */\n // 5 => ')' /* optional */\n // );\n\n if ( ! empty($matches[ 4 ])) {\n //$this->isLiteral($matches[4]) OR $matches[4] = $this->protectIdentifiers(trim($matches[4]));\n $matches[ 4 ] = ' ' . $matches[ 4 ];\n }\n\n $conditions[ $ci ] = $matches[ 1 ] . $this->conn->protectIdentifiers(trim($matches[ 2 ]))\n . ' ' . trim($matches[ 3 ]) . $matches[ 4 ] . $matches[ 5 ];\n }\n\n $this->builderCache->{$cacheKey}[ $i ] = implode('', $conditions);\n }\n\n if ($cacheKey === 'having') {\n return \"\\n\" . sprintf(\n 'HAVING %s',\n implode(\"\\n\", $this->builderCache->having)\n );\n }\n\n return \"\\n\" . sprintf(\n 'WHERE %s',\n implode(\"\\n\", $this->builderCache->{$cacheKey})\n );\n }\n\n return '';\n }", "public function having()\n {\n $args = func_get_args();\n $count = count($args);\n \n if ($count == 1) {\n $this->having[] = $args[0];\n } else {\n $this->having[] = array_shift($args);\n \n if ($count == 2 && is_array($args[0]))\n $args = $args[0];\n \n if ($args)\n $this->having_params = array_merge($this->having_params, $args);\n }\n return $this;\n }", "protected function compileBasicHaving($having)\n {\n $column = $this->wrap($having['column']);\n\n $parameter = $this->parameter($having['value']);\n\n return $having['boolean'].' '.$column.' '.$having['operator'].' '.$parameter;\n }", "public function and_having_close(){\n $this->_having[] = array('AND' => ')');\n\n return $this;\n }", "public function having(string ...$conditions): self {\r\n\r\n $this -> having = array_merge($this -> having, $conditions);\r\n return $this;\r\n }", "protected function buildHaving(Query $query)\n {\n $having = '';\n $data = [];\n foreach ($query->getHaving() as $key => $value) {\n //\tadd where on first loop only, AND on all others\n $having .= ($having == '' ? ' HAVING ' : ' AND ').$key;\n if (is_array($value)) {\n $data = array_merge($data, $value);\n continue;\n }\n\n $data[] = $value;\n }\n\n return ['placeholders' => $having, 'data' => $data];\n }", "public function getHavingParameterised(&$parameters)\n {\n $this->splitQueryParameters($this->having, $conditions, $parameters);\n return $conditions;\n }", "public function setHaving($having)\n {\n $having = func_num_args() > 1 ? func_get_args() : $having;\n $this->having = [];\n return $this->addHaving($having);\n }", "function mHAVING(){\n try {\n $_type = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$HAVING;\n $_channel = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$DEFAULT_TOKEN_CHANNEL;\n // Tokenizer11.g:64:3: ( 'having' ) \n // Tokenizer11.g:65:3: 'having' \n {\n $this->matchString(\"having\"); \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 having($prop, $value = PDODBNULL, $operator = '=', $cond = 'AND'){\r\n $this->_having[] = array($prop,$value,$operator,$cond);\r\n return $this;\r\n }", "public function having($key, $val=[]): QueryBuilderInterface\n\t{\n\t\treturn $this->_having($key, $val);\n\t}", "public function having($having = null) {\n\t\tif (!$having) {\n\t\t\treturn $this->_config['having'];\n\t\t}\n\t\t$this->_config['having'] = array_merge(\n\t\t\t(array) $this->_config['having'], (array) $having\n\t\t);\n\t\treturn $this;\n\t}", "public function scopeHavingFeature(EloquentBuilder $query, $feature);", "public function having($having)\n {\n if ( ! (func_num_args() == 1 && $having instanceof Composite)) {\n $having = new Composite(Composite::TYPE_AND, func_get_args());\n }\n\n return $this->add('having', $having);\n }", "public function havingAnd()\n {\n $this->having .= \" AND \";\n }", "public function having(string $having, ...$params): Selection\n {\n $this->selection->having($having, ...$params);\n return $this;\n }", "public function and_having_close()\n {\n $this->_having[] = array('AND' => ')');\n\n return $this;\n }", "protected function renderHaving() : ?string\n {\n return $this->renderWhere('having');\n }", "public function addHaving($having)\n {\n $having = $this->normalisePredicates(func_get_args());\n\n // If the function is called with an array of items\n $this->having = array_merge($this->having, $having);\n\n return $this;\n }", "public function having(string $column, string $operator, $value)\n {\n /**\n * If the value is a Builder object then\n * add its parameters to the parameters array\n * and create the subquery from the syntax class\n */\n if ($value instanceof Builder) {\n $this->parameters = array_merge($this->parameters, $value->getParameters());\n $value = \"(\".$this->syntax->selectSyntax(get_object_vars($value)).\")\";\n }\n $this->having = [\"column\" => $column, \"operator\" => $operator, \"value\" => $value];\n \n return $this;\n }", "public function addHavingWithVariables($condition, array $variables) {\n $condition = $this->parseVariables($condition, $variables);\n\n parent::addHavingWithVariables($condition, array());\n }", "protected function _having($key, $values=[], string $conj='AND'): self\n\t{\n\t\t$where = $this->_where($key, $values);\n\n\t\t// Create key/value placeholders\n\t\tforeach($where as $f => $val)\n\t\t{\n\t\t\t// Split each key by spaces, in case there\n\t\t\t// is an operator such as >, <, !=, etc.\n\t\t\t$fArray = explode(' ', trim($f));\n\n\t\t\t$item = $this->driver->quoteIdent($fArray[0]);\n\n\t\t\t// Simple key value, or an operator\n\t\t\t$item .= (count($fArray) === 1) ? '=?' : \" {$fArray[1]} ?\";\n\n\t\t\t// Put in the having map\n\t\t\t$this->state->appendHavingMap([\n\t\t\t\t'conjunction' => empty($this->state->getHavingMap())\n\t\t\t\t\t? ' HAVING '\n\t\t\t\t\t: \" {$conj} \",\n\t\t\t\t'string' => $item\n\t\t\t]);\n\t\t}\n\n\t\treturn $this;\n\t}", "protected function compileHavingBitwise($having)\n {\n $column = $this->wrap($having['column']);\n\n $parameter = $this->parameter($having['value']);\n\n return $having['boolean'].' ('.$column.' '.$having['operator'].' '.$parameter.')::bool';\n }", "function having($key, $value = '', $escape = TRUE)\r\n\t{\r\n\t\treturn $this->_having($key, $value, 'AND ', $escape);\r\n\t}", "final public function addHaving(YMKM_SQL_Entity_Having $s)\n {\n $this->doAddHaving($s);\n return $this;\n }", "public function and_having_open(){\n $this->_having[] = array('AND' => '(');\n\n return $this;\n }", "public function getHaving()\n\t\t{\n\t\t\treturn $this->havings;\n\t\t}", "function _having($key, $value = '', $type = 'AND ', $escape = TRUE)\r\n\t{\r\n\t\t// Check if this is a related object\r\n\t\tif ( ! empty($this->parent))\r\n\t\t{\r\n\t\t\t$this->db->_having($this->table . '.' . $key, $value, $type, $escape);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$this->db->_having($key, $value, $type, $escape);\r\n\t\t}\r\n\r\n\t\t// For method chaining\r\n\t\treturn $this;\r\n\t}", "public function not_having($having) \n {\n $this->sql .= \" NOT HAVING \". $this->clean($having);\n return $this;\n }", "public function having($conditions, $context, array $options = [])\n\t{\n\t\t$defaults = ['prepend' => 'HAVING'];\n\t\t$options += $defaults;\n\t\treturn $this->_conditions($conditions, $context, $options);\n\t}", "public function and_having($column, $op, $value = NULL){\n $this->_having[] = array('AND' => array($column, $op, $value));\n\n return $this;\n }", "public function having($conditions = null, $overwrite = false);", "public function having($key, $value = NULL, $escape = NULL)\n\t{\n\t\treturn $this->_wh('qb_having', $key, $value, 'AND ', $escape);\n\t}", "public function having($expression)\n\t{\n\t\tif (!($expression === NULL || is_string($expression))) {\n\t\t\tthrow new InvalidArgumentException('Having expression has to be a string or NULL.');\n\t\t}\n\t\t$this->dirty();\n\t\t$this->having = $expression;\n\t\t$this->args['having'] = array_slice(func_get_args(), 1);\n\t\treturn $this;\n\t}", "public function or_having_close(){\n $this->_having[] = array('OR' => ')');\n\n return $this;\n }", "protected function user_where_clause() {}", "public function orHaving($key, $val=[]): QueryBuilderInterface\n\t{\n\t\treturn $this->_having($key, $val, 'OR');\n\t}", "public static function orHaving($prop, $value = PDODBNULL, $operator = '='){\r\n return self::$PDO->orHaving($prop,$value,$operator);\r\n }", "public function and_having($column, $op = null, $value = null)\n {\n if(func_num_args() === 2)\n {\n $value = $op;\n $op = '=';\n }\n\n $this->_having[] = array('AND' => array($column, $op, $value));\n\n return $this;\n }", "protected function compileHavingBetween($having): string\n {\n $between = $having['not'] ? 'not between' : 'between';\n\n $column = $this->wrap($having['column']);\n\n $min = $this->parameter(headItem($having['values']));\n $max = $this->parameter(lastItem($having['values']));\n\n return $having['boolean'].' '.$column.' '.$between.' '.$min.' and '.$max;\n }", "public function &havingConditions();", "public function or_having_close()\n {\n $this->_having[] = array('OR' => ')');\n\n return $this;\n }", "public function and_having_open()\n {\n $this->_having[] = array('AND' => '(');\n\n return $this;\n }", "private function sql_groupBy()\n {\n // Get WHERE statement\n $groupBy = $this->curr_tableField;\n\n // RETURN GROUP BY statement without GROUP BY\n return $groupBy;\n }", "public function andHaving($having)\n {\n $having = $this->getQueryPart('having');\n $args = func_get_args();\n\n if ($having instanceof Composite && $having->getType() === Composite::TYPE_AND) {\n $having->addMultiple($args);\n } else {\n array_unshift($args, $having);\n $having = new Composite(Composite::TYPE_AND, $args);\n }\n\n return $this->add('having', $having);\n }", "public function havingGte($col, $value)\n {\n $this->having .= \"$col >= $value\";\n }", "protected function compileHavings(Builder $query, $havings)\n {\n $cypher = implode(' ', array_map([$this, 'compileHaving'], $havings));\n\n return 'with '.$this->removeLeadingBoolean($cypher);\n }", "public function having($sField, $sValue, $sOperator = '=')\n {\n $this->optClause('HAVING', $sField, $sValue, $sOperator);\n\n return $this;\n }", "public function or_having_open(){\n $this->_having[] = array('OR' => '(');\n\n return $this;\n }", "protected abstract function getGroupByClause(array $grouping);", "public function havingOR()\n {\n $this->having .= \" OR \";\n }", "public function andHaving($expression)\n\t{\n\t\tif (!is_string($expression)) {\n\t\t\tthrow new InvalidArgumentException('Having expression has to be a string.');\n\t\t}\n\t\t$this->dirty();\n\t\t$this->having = $this->having ? '(' . $this->having . ') AND (' . $expression . ')' : $expression;\n\t\t$this->pushArgs('having', array_slice(func_get_args(), 1));\n\t\treturn $this;\n\t}", "protected function getGeneralWhereClause() {}", "public function having($field, $value = null, $comparitor = null);", "public function havingIsNotNull(Closure | string $column) : static\n {\n return $this->having($column, 'IS NOT NULL');\n }", "public function or_having($key, $value = NULL, $escape = NULL)\n\t{\n\t\treturn $this->_wh('qb_having', $key, $value, 'OR ', $escape);\n\t}", "public function havingLte($col, $value)\n {\n $this->having .= \"$col <= $value \";\n }", "public function having($field, $value = null, $escape = null)\n {\n return $this->prepareWhereStatement($field, $value, 'AND ', $escape, 'having');\n }", "public function orHaving($expression)\n\t{\n\t\tif (!is_string($expression)) {\n\t\t\tthrow new InvalidArgumentException('Having expression has to be a string.');\n\t\t}\n\t\t$this->dirty();\n\t\t$this->having = $this->having ? '(' . $this->having . ') OR (' . $expression . ')' : $expression;\n\t\t$this->pushArgs('having', array_slice(func_get_args(), 1));\n\t\treturn $this;\n\t}", "public function orHaving(\n Closure | string $column,\n string $operator,\n Closure | float | int | string | null ...$values\n ) : static {\n return $this->addHaving('OR', $column, $operator, $values);\n }", "public function or_having_open()\n {\n $this->_having[] = array('OR' => '(');\n\n return $this;\n }", "public function having($columns)\n\t{\n\t\tif (is_array($columns)) {\n\t\t\t$this->_having = array_unique(array_merge($this->_having, $columns));\n\t\t} else {\n\t\t\t$this->_having = array_unique(array_merge($this->_having, array($columns)));\n\t\t}\n\n\t\treturn $this;\n\t}", "function start_group_where($key,$value=NULL,$escape=TRUE,$type=\"AND\")\n {\n $this->open_bracket($type); \n return parent::_where($key, $value,'',$escape); \n }", "public function orHaving($prop, $value = PDODBNULL, $operator = '='){\r\n return $this->where($prop,$value,$operator,'OR');\r\n }", "protected function _buildWhere(&$query)\n {\n\n return $query;\n }", "public function orHavingEqual(\n Closure | string $column,\n Closure | float | int | string | null $value\n ) : static {\n return $this->orHaving($column, '=', $value);\n }", "public function whereClause(){\n try {\n // Sparql11query.g:117:3: ( ( WHERE )? groupGraphPattern ) \n // Sparql11query.g:118:3: ( WHERE )? groupGraphPattern \n {\n // Sparql11query.g:118:3: ( WHERE )? \n $alt15=2;\n $LA15_0 = $this->input->LA(1);\n\n if ( ($LA15_0==$this->getToken('WHERE')) ) {\n $alt15=1;\n }\n switch ($alt15) {\n case 1 :\n // Sparql11query.g:118:3: WHERE \n {\n $this->match($this->input,$this->getToken('WHERE'),self::$FOLLOW_WHERE_in_whereClause412); \n\n }\n break;\n\n }\n\n $this->pushFollow(self::$FOLLOW_groupGraphPattern_in_whereClause415);\n $this->groupGraphPattern();\n\n $this->state->_fsp--;\n\n\n }\n\n }\n catch (RecognitionException $re) {\n $this->reportError($re);\n $this->recover($this->input,$re);\n }\n catch(Exception $e) {\n throw $e;\n }\n \n return ;\n }" ]
[ "0.718122", "0.69709885", "0.6761752", "0.67044646", "0.65698767", "0.6525475", "0.6475478", "0.6412246", "0.6386801", "0.63347304", "0.63067126", "0.6270026", "0.6263461", "0.62425876", "0.6233493", "0.6220378", "0.6215624", "0.6193895", "0.6189807", "0.6150571", "0.6071724", "0.6048111", "0.6042451", "0.60111684", "0.59730715", "0.5972729", "0.59714717", "0.59563893", "0.59518725", "0.5924093", "0.5884821", "0.58525217", "0.5842812", "0.58369577", "0.5830308", "0.5828932", "0.58112395", "0.5780553", "0.57681346", "0.57323146", "0.5713481", "0.57083845", "0.5707928", "0.56999147", "0.5692726", "0.567044", "0.5651817", "0.5641243", "0.5632188", "0.55994564", "0.5593203", "0.5568862", "0.55481094", "0.55408376", "0.55166495", "0.5467063", "0.54345787", "0.54166704", "0.5411024", "0.5404188", "0.5337445", "0.533742", "0.5332985", "0.5330703", "0.5327304", "0.5324058", "0.5314268", "0.5310668", "0.5284715", "0.5271412", "0.5237902", "0.5165842", "0.51631767", "0.51613736", "0.51441246", "0.51255405", "0.512491", "0.5122309", "0.5120728", "0.511944", "0.5117697", "0.511208", "0.5104925", "0.51045567", "0.5082183", "0.49976605", "0.49752784", "0.495018", "0.49479917", "0.4932199", "0.4918409", "0.4917532", "0.49167597", "0.4901049", "0.4859709", "0.4837348", "0.4830909", "0.4827165", "0.48214555", "0.4819076", "0.48128134" ]
0.0
-1
Sets a condition in the HAVING clause that the specified field be NULL.
public function havingIsNull($field);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function havingIsNotNull($field);", "public function havingIsNull(Closure | string $column) : static\n {\n return $this->having($column, 'IS NULL');\n }", "public function orHavingIsNull(Closure | string $column) : static\n {\n return $this->orHaving($column, 'IS NULL');\n }", "public static function whereNull($column);", "public function isNullCond(string $field, string $connector = \"AND\", bool $not = false);", "public function __null ( $sField )\n {\n return \"$sField IS NULL\";\n }", "public function whereNull($fields);", "public function havingIsNotNull(Closure | string $column) : static\n {\n return $this->having($column, 'IS NOT NULL');\n }", "public function havingCondition($field, $value = NULL, $operator = NULL);", "public static function whereIsNull($parameter);", "private function cek_null($val,$field)\n { if (isset($val)){ return $this->ci->db->where($field, $val); } }", "public function orHavingIsNotNull(Closure | string $column) : static\n {\n return $this->orHaving($column, 'IS NOT NULL');\n }", "public function clearCondition(){\n\t\t$this->where=\"\";\n\t}", "public function whereNull(String $col){\r\n $this->where->add($colName.\" IS NULL\");\r\n\r\n }", "public function whereNotNull($field)\n {\n return $this->makeModel()->whereNotNull($field);\n\n }", "public function orHavingNotEqual(\n Closure | string $column,\n Closure | float | int | string | null $value\n ) : static {\n return $this->orHaving($column, '!=', $value);\n }", "protected function whereNull(Builder $query, $where)\n {\n return $this->wrap($where['column']).' is null';\n }", "public function havingNotEqual(\n Closure | string $column,\n Closure | float | int | string | null $value\n ) : static {\n return $this->having($column, '!=', $value);\n }", "protected function _emptyFieldsToNull(&$field, $key)\n {\n if ($this->_metadata[$key]['NULLABLE'] && empty($field)) {\n $field = null;\n }\n }", "public function isNull() {\n $this->_action = 'IS NULL';\n $this->_value = '';\n \n return $this;\n }", "protected function whereNull(Builder $query, array $where)\n {\n return $this->wrap($where['column']) . ' is null';\n }", "public function notNull($column)\n {\n $this->addCondition($this->db->escapeIdentifier($column).' IS NOT NULL');\n }", "public function having($field, $value = null, $comparitor = null);", "public static function whereNotNull($column);", "public function where_null($name, $state=true)\n {\n $this->where[] = sprintf('%s %s null', self::quote_name($name), $state ? 'is': 'is not');\n return $this;\n }", "public function __notnull ( $sField )\n {\n return \"$sField IS NOT NULL\";\n }", "public function null(): FluidColumnOptions\n {\n $this->column->setNotnull(false);\n return $this;\n }", "public function whereNone($operand, $operatorOrValue=null, $value=null);", "public function whereNotExists($field) {\n\t$this->parseQuery->whereDoesNotExist($field);\n }", "public function not_having($having) \n {\n $this->sql .= \" NOT HAVING \". $this->clean($having);\n return $this;\n }", "public function havingNullSafeEqual(\n Closure | string $column,\n Closure | float | int | string | null $value\n ) : static {\n return $this->having($column, '<=>', $value);\n }", "public function addFieldToFilter($field, $condition = null): self\n {\n if ($field === 'store_id') {\n return $this->addStoreFilter($condition, false);\n }\n\n return parent::addFieldToFilter($field, $condition);\n }", "public function optional(Field $field)\n {\n $disp = $field->getDispatcher();\n $disp->addListener(Events::BEFORE_TRANSFORM, function (Event $event) {\n if (null === $event->getInput()) {\n $event->setData(null);\n }\n });\n\n return $field;\n }", "public function clearWhere()\n {\n \t$this->_where = null;\n }", "public function xorHaving($field, $op = null, $value = null) {\n return $this->_modifyPredicate($this->_having, Predicate::MAYBE, $field, $op, $value);\n }", "public function notNull() {\n $this->_action = 'IS NOT NULL';\n $this->_value = '';\n \n return $this;\n }", "protected function applyFieldConditions()\n {\n if ($this->field !== null) {\n $this->andWhere(Db::parseParam('fieldId', $this->parseFieldValue($this->field)));\n }\n }", "public function whereNotNull($fields);", "public function fieldCondition($field, $column = NULL, $value = NULL, $operator = NULL, $delta_group = NULL, $language_group = NULL) {\n $this->invokeEntityFieldQuery('fieldCondition', array($field, $column, $value, $operator, $delta_group, $language_group));\n return $this;\n }", "protected function whereNull(Builder $builder, $where): string\n {\n return $this->wrap($where['column']).' is null';\n }", "abstract public function isNull();", "public function isNull();", "protected function whereNotNull(Builder $query, $where)\n {\n return $this->wrap($where['column']).' is not null';\n }", "public function getSqlFilter(Mouf_DBConnection $dbConnection) {\n\t\treturn $this->columnName.\" IS NULL\";\n\t}", "public function notNull(): FluidColumnOptions\n {\n $this->column->setNotnull(true);\n return $this;\n }", "public function orHavingNullSafeEqual(\n Closure | string $column,\n Closure | float | int | string | null $value\n ) : static {\n return $this->orHaving($column, '<=>', $value);\n }", "public function testBuildWhereEmpty()\n {\n $query = $this->getQuery();\n\n $this->assertSame(\n '',\n $query->buildWhere()\n );\n }", "public function having($prop, $value = PDODBNULL, $operator = '=', $cond = 'AND'){\r\n $this->_having[] = array($prop,$value,$operator,$cond);\r\n return $this;\r\n }", "public function orHavingNotLike(\n Closure | string $column,\n Closure | float | int | string | null $value\n ) : static {\n return $this->orHaving($column, 'NOT LIKE', $value);\n }", "public function orHaving($field, $op = null, $value = null) {\n return $this->_modifyPredicate($this->_having, Predicate::EITHER, $field, $op, $value);\n }", "function NotWhere ($whereclause)\n\t{\n\t\t$this->clause = $whereclause;\n\t}", "public final function isNullAllowed($fld)\n {\n return $this->columns->{$fld}->null == 1 ? true : false;\n }", "public function having($clause, array $params);", "public function addFieldToFilter($field, $condition = null)\n {\n return parent::addFieldToFilter($field, $condition);\n }", "public function testWhereNotEqualsNull()\n {\n $query = (new WhereBuilder($this->mockConnection))->where('field', '!=', null);\n $array = $query->toArray();\n\n $this->assertInstanceOf(WhereBuilder::class, $query);\n $this->assertEquals([\n 'where' => [\n [\n 'column' => 'field',\n 'operator' => 'is not',\n 'value' => 'NULL',\n 'boolean' => 'and',\n ]\n ]\n ], $array);\n\n $query = (new WhereBuilder($this->mockConnection))->where('field', '<>', null);\n $array = $query->toArray();\n\n $this->assertInstanceOf(WhereBuilder::class, $query);\n $this->assertEquals([\n 'where' => [\n [\n 'column' => 'field',\n 'operator' => 'is not',\n 'value' => 'NULL',\n 'boolean' => 'and',\n ]\n ]\n ], $array);\n }", "public function notGroupStart(): QueryBuilderInterface\n\t{\n\t\t$conj = empty($this->state->getQueryMap()) ? ' WHERE ' : ' AND ';\n\n\t\t$this->state->appendMap($conj, ' NOT (', 'group_start');\n\n\t\treturn $this;\n\t}", "public static function set_null_data($field)\n\t{\n\t\tforeach($field as $key => $value)\n\t\t{\n\t\t\tif($value == null || $value == '')\n\t\t\t{\n\t\t\t\t$field[$key] = null;\n\t\t\t}\n\t\t}\n\n\t\treturn $field;\n\t}", "public function testMissingFields()\n {\n $arrayFilterConfig = array(\n 'fields' => array(\n array(\n 'field' => '',\n 'value' => 'News')),\n 'fstat' => array(),\n 'search' => array()\n );\n \n $this->setExpectedException(\n 'InvalidArgumentException',\n 'Cannot add condition. Field must be a non-empty string.'\n );\n $filter = new P4Cms_Record_Filter($arrayFilterConfig);\n }", "public function whereNotEqualTo($field, $value) {\n\t$this->parseQuery->whereNotEqualTo($field, $value);\n }", "public function addFieldToFilter($field, $condition = null)\n {\n if ($field === 'store_id') {\n return $this->addStoreFilter($condition, false);\n }\n\n if ($field === 'customer_group_id') {\n return $this->addCustomerGroupFilter($condition, false);\n }\n\n return parent::addFieldToFilter($field, $condition);\n }", "public function cleanField($field)\n\t{\n\t\t//by default... we dont clean anything\n\t}", "public function testWhereEqualsNull()\n {\n $query = (new WhereBuilder($this->mockConnection))->where('field', '=', null);\n $array = $query->toArray();\n\n $this->assertInstanceOf(WhereBuilder::class, $query);\n $this->assertEquals([\n 'where' => [\n [\n 'column' => 'field',\n 'operator' => 'is',\n 'value' => 'NULL',\n 'boolean' => 'and',\n ]\n ]\n ], $array);\n }", "function _ting_ranking_field_filter($element) {\n return !empty($element['field_name']);\n}", "protected function whereNotNull(Builder $query, array $where)\n {\n return $this->wrap($where['column']) . ' is not null';\n }", "public function havingNotLike(\n Closure | string $column,\n Closure | float | int | string | null $value\n ) : static {\n return $this->having($column, 'NOT LIKE', $value);\n }", "public function neq(): WhereCondition\n {\n\n $this->_op = self::OP_TYPE_NEQ;\n\n return $this;\n\n }", "public function having($conditions) {\n $this->having = !empty($conditions) ? ('HAVING ' . implode(',', $conditions)) : null;\n return $this;\n }", "public function except($clause)\n {\n // $prop = '_' . $clause;\n \n switch ($clause) {\n case 'distinct':\n case 'from':\n case 'offset':\n case 'limit':\n case 'page':\n case 'per_page':\n $this->$clause = null;\n break;\n \n case 'select':\n case 'joins':\n case 'where':\n case 'where_params':\n case 'order':\n case 'group':\n case 'having':\n case 'having_params':\n $this->$clause = [];\n break;\n }\n return $this;\n }", "public function where_not_null($name)\n {\n return $this->where_null($name, false);\n }", "public function scopeSimple($query)\n {\n return $query->where('group_id', NULL);\n }", "public function zero()\n {\n $this->assertFalse($this->orCriterion->hasCriterion());\n $this->orCriterion->toSQL();\n }", "public function testconstructSQLClauseNullValues()\n {\n $_SESSION['behat']['GenesisSqlExtension']['keywords'] = [];\n $_SESSION['behat']['GenesisSqlExtension']['notQuotableKeywords'] = [];\n\n // Prepare / Mock\n $glue = ' AND ';\n $columns = [\n 'firstname' => 'null',\n 'lastname' => '!null',\n 'postcode' => '!NULL',\n 'address' => 'NULL'\n ];\n\n // Execute\n $result = $this->testObject->constructSQLClause($glue, $columns);\n\n $expected = \"firstname is null AND lastname is not null AND postcode is not NULL AND address is NULL\";\n\n // Assert Result\n $this->assertEquals($expected, $result);\n }", "public function clear($clause = null)\n\t{\n\t\tswitch ($clause)\n\t\t{\n\t\t\tcase 'union':\n\t\t\t\t$this->unionDistinct = true;\n\t\t\t\t$this->_union = array();\n\t\t\t\tbreak;\n\t\t\tcase 'select':\n\t\t\t\t$this->_select = array();\n\t\t\t\tbreak;\n\t\t\tcase 'from':\n\t\t\t\t$this->_from = array();\n\t\t\t\tbreak;\n\t\t\tcase 'join':\n\t\t\t\t$this->_join = array();\n\t\t\t\tbreak;\n\t\t\tcase 'where':\n\t\t\t\t$this->_where = null;\n\t\t\t\tbreak;\n\t\t\tcase 'group':\n\t\t\t\t$this->_group = array();\n\t\t\t\tbreak;\n\t\t\tcase 'having':\n\t\t\t\t$this->_having = array();\n\t\t\t\tbreak;\n\t\t\tcase 'order':\n\t\t\t\t$this->_order = array();\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$this->unionDistinct = true;\n\t\t\t\t$this->_union = array();\n\t\t\t\t$this->_select = array();\n\t\t\t\t$this->_from = array();\n\t\t\t\t$this->_join = array();\n\t\t\t\t$this->_where = null;\n\t\t\t\t$this->_group = array();\n\t\t\t\t$this->_having = array();\n\t\t\t\t$this->_order = array();\n\t\t\t\tbreak;\n\t\t}\n\n\t\treturn $this;\n\t}", "public function is_null($column, $boolean = 'and', $not = false)\r\n {\r\n return $this->where_assoc(array($column => null), $boolean, $not);\r\n }", "protected function setNullableField($model, $field)\n {\n $value = $model->getAttribute($field);\n\n # Compare the Value to empty string\n if( $value === ''){\n $value = null;\n }\n\n $model->setAttribute($field, $value );\n }", "public function whereNull($column, $boolean = 'and', $not = false)\n {\n return $this->callHook(__FUNCTION__, $this->packArgs(compact('column', 'boolean', 'not')));\n }", "public function whereNotEq()\n {\n \n list($field, $value) = $this->extractQueryToFieldAndValue(func_get_args());\n $this->_conditions[self::WHERENOT][$field] = [self::OPERATORS['ne'] => $value];\n return $this;\n }", "public static function null(string $column, $not = false): Condition\n {\n $self = (new Condition())->column($column);\n return $not ? $self->isNotNull() : $self->isNull();\n }", "public function having($conditions = null, $overwrite = false);", "public function addFieldToFilter($field, $condition = null)\n {\n if (isset($this->_fields[$field])) {\n $field = $this->_fields[$field];\n }\n\n return parent::addFieldToFilter($field, $condition);\n }", "function isNull($x, $y='null', $and=null, ...$args)\n {\n $expression = array();\n array_push($expression, $x, _isNULL, $y, $and, ...$args);\n return $expression;\n }", "function isNull($x, $y='null', $and=null, ...$args)\n {\n $expression = array();\n array_push($expression, $x, _isNULL, $y, $and, ...$args);\n return $expression;\n }", "public function having($condition)\n\t\t{\n\t\t\tif($condition instanceof Condition || $condition instanceof ConditionGroup)\n\t\t\t{\n\t\t\t\t$this->havings = $condition; \n\t\t\t\treturn $this;\t\t\t\t\n\t\t\t}\n\t\t\tthrow new \\Exception('Can only add Conditions or ConditionGroups to a statement\\'s where block');\n\t\t}", "public static function having($prop, $value = PDODBNULL, $operator = '=', $cond = 'AND'){\r\n return self::$PDO->having($prop,$value,$operator,$cond);\r\n }", "public function having($field, $value = null, $escape = null)\n {\n return $this->prepareWhereStatement($field, $value, 'AND ', $escape, 'having');\n }", "protected function whereNotNull(Builder $builder, $where): string\n {\n return $this->wrap($where['column']).' is not null';\n }", "public function testGroupByNone() {\n $this->groupByTestHelper(NULL, [1, 5]);\n }", "protected function whereNull($builder, $column, $boolean = 'and', $not = false)\n {\n return $builder->whereNull($column, $boolean, $not);\n }", "public function filterByWithoutLength()\n {\n $this->query->andWhere($this->query->expr()->isNull('b.length'));\n }", "public function is_not_null($column, $boolean = 'and')\r\n {\r\n return $this->where_assoc(array($column => null), $boolean, true);\r\n }", "public function onDeleteSetNull()\n {\n return $this->onDelete(ForeignKeyMode::SET_NULL);\n }", "public function changeFieldToNotNullable($field)\n {\n\t$result= PerfORMController::getConnection()->query('select * from %n where %n is null',\n\t $field->getModel()->getTableName(),\n\t $field->getName()\n\t);\n\n\t$pk= $field->getModel()->getPrimaryKey();\n\n\tforeach($result as $row )\n\t{\n\t if ( !is_null($value= $field->getDefaultValue()) )\n\t {\n\t }\n\t elseif ( is_callable($field->getDefaultCallback()))\n\t {\n\t\t$value= call_user_func($field->getDefaultCallback(), $row);\n\t }\n\t else\n\t {\n\t\tthrow new Exception(\"Unable to set default value for field '\".$field->getName().\"'\");\n\t }\n\n\t PerfORMController::getConnection()->query('update %n set %n = %'.$field->getType().' where %n = %i',\n\t $field->getModel()->getTableName(),\n\t $field->getName(),\n\t $value,\n\t $pk,\n\t $row->{$pk}\n\t );\n\t}\n\n\tPerfORMController::getBuilder()->changeFieldsNullable($field);\n\t$this->updateFieldSync($field);\n }", "public function testBuildGroupByEmpty()\n {\n $query = $this->getQuery();\n\n $this->assertSame(\n '',\n $query->buildGroupBy()\n );\n }", "protected function beforeSave()\n {\n foreach ($this->getTableSchema()->columns as $column)\n {\n if ($column->allowNull == 1 && $this->getAttribute($column->name) == '')\n {\n $this->setAttribute($column->name, null);\n }\n }\n \n return parent::beforeSave();\n }", "public function having($field, $op = null, $value = null) {\n return $this->_modifyPredicate($this->_having, Predicate::ALSO, $field, $op, $value);\n }", "public function changeFieldToNullable($field)\n {\n\tPerfORMController::getBuilder()->changeFieldsNullable($field);\n\t$this->updateFieldSync($field);\n }", "public function orHavingEqual(\n Closure | string $column,\n Closure | float | int | string | null $value\n ) : static {\n return $this->orHaving($column, '=', $value);\n }", "public function compilarWhereNull(Builder $builder, $where)\n {\n return $where['boolean'] . \" {$this->colunize($where['column'])} is null\";\n \n }", "public function orHavingLessThanOrEqual(\n Closure | string $column,\n Closure | float | int | string | null $value\n ) : static {\n return $this->orHaving($column, '<=', $value);\n }", "public function whereNull($column, $boolean = 'and', $not = false)\n {\n $type = $not ? 'NotNull' : 'Null';\n\n if ($column == 'id') {\n $column = 'id('.$this->modelAsNode().')';\n }\n\n $binding = $this->prepareBindingColumn($column);\n\n $this->wheres[] = compact('type', 'column', 'boolean', 'binding');\n\n return $this;\n }" ]
[ "0.625018", "0.59701", "0.5928521", "0.5795825", "0.57617235", "0.57091147", "0.56600934", "0.5634498", "0.56288326", "0.56081384", "0.5589795", "0.5502315", "0.5385832", "0.5377742", "0.53713465", "0.53582776", "0.53570306", "0.53266454", "0.5301143", "0.52739", "0.5167355", "0.5150008", "0.51469994", "0.5145675", "0.5133894", "0.5108633", "0.50924546", "0.5087649", "0.506398", "0.5036334", "0.5016021", "0.4979556", "0.4974588", "0.49434066", "0.49399233", "0.49395257", "0.49182367", "0.4914048", "0.49040088", "0.48963264", "0.48953718", "0.489149", "0.4884076", "0.48827416", "0.48685795", "0.4865916", "0.48350844", "0.48334002", "0.47732794", "0.47564286", "0.47485062", "0.4719499", "0.47098336", "0.4709166", "0.4708174", "0.47020245", "0.46924567", "0.46876898", "0.46854877", "0.46777543", "0.46735862", "0.46639717", "0.46618956", "0.46458852", "0.4634954", "0.4627325", "0.46213973", "0.4618203", "0.46132833", "0.4600843", "0.4593136", "0.4593129", "0.45504245", "0.45503137", "0.45451793", "0.4542468", "0.45322403", "0.4530849", "0.45125893", "0.4512034", "0.45111546", "0.45111546", "0.4491472", "0.44908625", "0.4484004", "0.4478726", "0.4478461", "0.44768837", "0.4475587", "0.44710958", "0.44649646", "0.44533673", "0.44496804", "0.4448039", "0.4443498", "0.44366944", "0.44263563", "0.44253558", "0.4415164", "0.44145963" ]
0.7071005
0
Sets a condition in the HAVING clause that the specified field be NOT NULL.
public function havingIsNotNull($field);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function havingIsNull($field);", "public function isNullCond(string $field, string $connector = \"AND\", bool $not = false);", "public function orHavingIsNull(Closure | string $column) : static\n {\n return $this->orHaving($column, 'IS NULL');\n }", "public function havingIsNotNull(Closure | string $column) : static\n {\n return $this->having($column, 'IS NOT NULL');\n }", "public function orHavingIsNotNull(Closure | string $column) : static\n {\n return $this->orHaving($column, 'IS NOT NULL');\n }", "public function notNull($column)\n {\n $this->addCondition($this->db->escapeIdentifier($column).' IS NOT NULL');\n }", "public function havingIsNull(Closure | string $column) : static\n {\n return $this->having($column, 'IS NULL');\n }", "public function __notnull ( $sField )\n {\n return \"$sField IS NOT NULL\";\n }", "public function orHavingNotEqual(\n Closure | string $column,\n Closure | float | int | string | null $value\n ) : static {\n return $this->orHaving($column, '!=', $value);\n }", "public static function whereNull($column);", "public function __null ( $sField )\n {\n return \"$sField IS NULL\";\n }", "public function havingCondition($field, $value = NULL, $operator = NULL);", "public function havingNotEqual(\n Closure | string $column,\n Closure | float | int | string | null $value\n ) : static {\n return $this->having($column, '!=', $value);\n }", "public function whereNotNull($field)\n {\n return $this->makeModel()->whereNotNull($field);\n\n }", "public static function whereNotNull($column);", "public function whereNull($fields);", "public static function whereIsNull($parameter);", "public function notNull() {\n $this->_action = 'IS NOT NULL';\n $this->_value = '';\n \n return $this;\n }", "protected function whereNotNull(Builder $query, $where)\n {\n return $this->wrap($where['column']).' is not null';\n }", "private function cek_null($val,$field)\n { if (isset($val)){ return $this->ci->db->where($field, $val); } }", "public function whereNull(String $col){\r\n $this->where->add($colName.\" IS NULL\");\r\n\r\n }", "public function whereNotNull($fields);", "public function neq(): WhereCondition\n {\n\n $this->_op = self::OP_TYPE_NEQ;\n\n return $this;\n\n }", "public function notNull(): FluidColumnOptions\n {\n $this->column->setNotnull(true);\n return $this;\n }", "public function having($field, $value = null, $comparitor = null);", "public static function null(string $column, $not = false): Condition\n {\n $self = (new Condition())->column($column);\n return $not ? $self->isNotNull() : $self->isNull();\n }", "protected function whereNull(Builder $query, $where)\n {\n return $this->wrap($where['column']).' is null';\n }", "protected function whereNotNull(Builder $query, array $where)\n {\n return $this->wrap($where['column']) . ' is not null';\n }", "public function testWhereNotEqualsNull()\n {\n $query = (new WhereBuilder($this->mockConnection))->where('field', '!=', null);\n $array = $query->toArray();\n\n $this->assertInstanceOf(WhereBuilder::class, $query);\n $this->assertEquals([\n 'where' => [\n [\n 'column' => 'field',\n 'operator' => 'is not',\n 'value' => 'NULL',\n 'boolean' => 'and',\n ]\n ]\n ], $array);\n\n $query = (new WhereBuilder($this->mockConnection))->where('field', '<>', null);\n $array = $query->toArray();\n\n $this->assertInstanceOf(WhereBuilder::class, $query);\n $this->assertEquals([\n 'where' => [\n [\n 'column' => 'field',\n 'operator' => 'is not',\n 'value' => 'NULL',\n 'boolean' => 'and',\n ]\n ]\n ], $array);\n }", "public function fieldCondition($field, $column = NULL, $value = NULL, $operator = NULL, $delta_group = NULL, $language_group = NULL) {\n $this->invokeEntityFieldQuery('fieldCondition', array($field, $column, $value, $operator, $delta_group, $language_group));\n return $this;\n }", "public function is_not_null($column, $boolean = 'and')\r\n {\r\n return $this->where_assoc(array($column => null), $boolean, true);\r\n }", "public function not_having($having) \n {\n $this->sql .= \" NOT HAVING \". $this->clean($having);\n return $this;\n }", "public function whereNotEq()\n {\n \n list($field, $value) = $this->extractQueryToFieldAndValue(func_get_args());\n $this->_conditions[self::WHERENOT][$field] = [self::OPERATORS['ne'] => $value];\n return $this;\n }", "public function orHavingNotLike(\n Closure | string $column,\n Closure | float | int | string | null $value\n ) : static {\n return $this->orHaving($column, 'NOT LIKE', $value);\n }", "public function havingNullSafeEqual(\n Closure | string $column,\n Closure | float | int | string | null $value\n ) : static {\n return $this->having($column, '<=>', $value);\n }", "protected function whereNull(Builder $query, array $where)\n {\n return $this->wrap($where['column']) . ' is null';\n }", "public function whereNotExists($field) {\n\t$this->parseQuery->whereDoesNotExist($field);\n }", "public function is_null($column, $boolean = 'and', $not = false)\r\n {\r\n return $this->where_assoc(array($column => null), $boolean, $not);\r\n }", "public function whereNotEqualTo($field, $value) {\n\t$this->parseQuery->whereNotEqualTo($field, $value);\n }", "function NotWhere ($whereclause)\n\t{\n\t\t$this->clause = $whereclause;\n\t}", "public function orHavingNullSafeEqual(\n Closure | string $column,\n Closure | float | int | string | null $value\n ) : static {\n return $this->orHaving($column, '<=>', $value);\n }", "public function where_null($name, $state=true)\n {\n $this->where[] = sprintf('%s %s null', self::quote_name($name), $state ? 'is': 'is not');\n return $this;\n }", "public final function isNullAllowed($fld)\n {\n return $this->columns->{$fld}->null == 1 ? true : false;\n }", "public function isNull() {\n $this->_action = 'IS NULL';\n $this->_value = '';\n \n return $this;\n }", "public function isNot(): WhereCondition\n {\n\n $this->_op = self::OP_TYPE_ISN;\n\n return $this;\n\n }", "public function where_not_null($name)\n {\n return $this->where_null($name, false);\n }", "public function getSqlFilter(Mouf_DBConnection $dbConnection) {\n\t\treturn $this->columnName.\" IS NULL\";\n\t}", "public function havingNotLike(\n Closure | string $column,\n Closure | float | int | string | null $value\n ) : static {\n return $this->having($column, 'NOT LIKE', $value);\n }", "public function whereNull($column, $boolean = 'and', $not = false)\n {\n return $this->callHook(__FUNCTION__, $this->packArgs(compact('column', 'boolean', 'not')));\n }", "public function null(): FluidColumnOptions\n {\n $this->column->setNotnull(false);\n return $this;\n }", "public function neq(string $column, $value = null, $and = true)\n {\n return $and ? $this->and($column, '<>', $value) : $this->or($column, '<>', $value);\n }", "public function addFieldToFilter($field, $condition = null): self\n {\n if ($field === 'store_id') {\n return $this->addStoreFilter($condition, false);\n }\n\n return parent::addFieldToFilter($field, $condition);\n }", "public function notInValue(): WhereCondition\n {\n\n $this->_op = self::OP_TYPE_NIN;\n\n return $this;\n\n }", "protected function whereNotNull(Builder $builder, $where): string\n {\n return $this->wrap($where['column']).' is not null';\n }", "public function whereNone($operand, $operatorOrValue=null, $value=null);", "public function gteq(): WhereCondition\n {\n\n $this->_op = self::OP_TYPE_GT_EQ;\n\n return $this;\n\n }", "abstract public function isNull();", "public function whereNull($column, $boolean = 'and', $not = false)\n {\n $this->where($column, ['eq', 'ne'][$not], null, $boolean);\n\n return $this;\n }", "public function isNull();", "protected function whereNull($builder, $column, $boolean = 'and', $not = false)\n {\n return $builder->whereNull($column, $boolean, $not);\n }", "public function orWhereNotEq()\n {\n list($field, $value) = $this->extractQueryToFieldAndValue(func_get_args());\n return $this->addOrWhereStack([$field => [self::OPERATORS['ne'] => $value]]);\n }", "public function whereNull($column, $boolean = 'and', $not = false)\n {\n $type = $not ? 'NotNull' : 'Null';\n\n if ($column == 'id') {\n $column = 'id('.$this->modelAsNode().')';\n }\n\n $binding = $this->prepareBindingColumn($column);\n\n $this->wheres[] = compact('type', 'column', 'boolean', 'binding');\n\n return $this;\n }", "public function having($prop, $value = PDODBNULL, $operator = '=', $cond = 'AND'){\r\n $this->_having[] = array($prop,$value,$operator,$cond);\r\n return $this;\r\n }", "public function notGroupStart(): QueryBuilderInterface\n\t{\n\t\t$conj = empty($this->state->getQueryMap()) ? ' WHERE ' : ' AND ';\n\n\t\t$this->state->appendMap($conj, ' NOT (', 'group_start');\n\n\t\treturn $this;\n\t}", "protected function _emptyFieldsToNull(&$field, $key)\n {\n if ($this->_metadata[$key]['NULLABLE'] && empty($field)) {\n $field = null;\n }\n }", "protected function whereNull(Builder $builder, $where): string\n {\n return $this->wrap($where['column']).' is null';\n }", "public function notnull()\n {\n return self::$driver->notnull();\n }", "protected function applyFieldConditions()\n {\n if ($this->field !== null) {\n $this->andWhere(Db::parseParam('fieldId', $this->parseFieldValue($this->field)));\n }\n }", "public function whereNull($column, $boolean = 'and', $not = false)\n {\n if ($column === '_id') {\n if ($not) {\n // the meta().id of a document is never null\n // so where condition \"meta().id is not null\" makes no changes to the result\n return $this;\n }\n $column = $this->grammar->getMetaIdExpression($this);\n }\n\n return parent::whereNull($column, $boolean, $not);\n }", "public function addFieldToFilter($field, $condition = null)\n {\n return parent::addFieldToFilter($field, $condition);\n }", "public function havingNotIn(\n Closure | string $column,\n Closure | float | int | string | null $value,\n Closure | float | int | string | null ...$values\n ) : static {\n return $this->having($column, 'NOT IN', ...[$value, ...$values]);\n }", "public function xorHaving($field, $op = null, $value = null) {\n return $this->_modifyPredicate($this->_having, Predicate::MAYBE, $field, $op, $value);\n }", "public function optional(Field $field)\n {\n $disp = $field->getDispatcher();\n $disp->addListener(Events::BEFORE_TRANSFORM, function (Event $event) {\n if (null === $event->getInput()) {\n $event->setData(null);\n }\n });\n\n return $field;\n }", "public function whereNotNull($column, $boolean = 'and')\n {\n return $this->whereNull($column, $boolean, true);\n }", "public function whereNotNull($column, $boolean = 'and')\n {\n return $this->whereNull($column, $boolean, true);\n }", "public function addFieldToFilter($field, $condition = null)\n {\n if ($field === 'store_id') {\n return $this->addStoreFilter($condition, false);\n }\n\n if ($field === 'customer_group_id') {\n return $this->addCustomerGroupFilter($condition, false);\n }\n\n return parent::addFieldToFilter($field, $condition);\n }", "public function orHavingLessThanOrEqual(\n Closure | string $column,\n Closure | float | int | string | null $value\n ) : static {\n return $this->orHaving($column, '<=', $value);\n }", "public function testWhereEqualsNull()\n {\n $query = (new WhereBuilder($this->mockConnection))->where('field', '=', null);\n $array = $query->toArray();\n\n $this->assertInstanceOf(WhereBuilder::class, $query);\n $this->assertEquals([\n 'where' => [\n [\n 'column' => 'field',\n 'operator' => 'is',\n 'value' => 'NULL',\n 'boolean' => 'and',\n ]\n ]\n ], $array);\n }", "function _ting_ranking_field_filter($element) {\n return !empty($element['field_name']);\n}", "public function not_where($fields, $condition = ''): self\n\t{\n\t\tif (isset($fields, $condition) && is_string($fields) && $fields != '')\n\t\t{\n\t\t\t$this->push_where_field($fields, $this->not($condition));\n\t\t}\n\t\telseif (isset($fields) && is_array($fields) && !empty($fields))\n\t\t{\n\t\t\tforeach ($fields as $field => $condition)\n\t\t\t{\n\t\t\t\tif (is_string($field) && $field != '')\n\t\t\t\t{\n\t\t\t\t\t$this->push_where_field($field, $this->not($condition));\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$this->error('Each field name in list must not be an empty string', __METHOD__);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->error('No specified or valid arguments were given', __METHOD__);\n\t\t}\n\t\t\n\t\treturn $this;\n\t}", "public function orHavingNotIn(\n Closure | string $column,\n Closure | float | int | string | null $value,\n Closure | float | int | string | null ...$values\n ) : static {\n return $this->orHaving($column, 'NOT IN', ...[$value, ...$values]);\n }", "public static function having($prop, $value = PDODBNULL, $operator = '=', $cond = 'AND'){\r\n return self::$PDO->having($prop,$value,$operator,$cond);\r\n }", "public function whereNot($col, $operator = self::NO_OPERATOR, $value = self::NO_VALUE);", "public function whereNotIn()\n {\n list($field, $value) = $this->extractQueryToFieldAndValue(func_get_args());\n $this->_conditions[self::WHERENOTIN][$field] = [self::OPERATORS['nin'] => $value];\n return $this;\n }", "public function whereNot($operand, $operatorOrValue=null, $value=null);", "function isNull($x, $y='null', $and=null, ...$args)\n {\n $expression = array();\n array_push($expression, $x, _isNULL, $y, $and, ...$args);\n return $expression;\n }", "function isNull($x, $y='null', $and=null, ...$args)\n {\n $expression = array();\n array_push($expression, $x, _isNULL, $y, $and, ...$args);\n return $expression;\n }", "public function scopeWithinNot($query, $value, $column = null)\n {\n return $query->whereNotIn($this->tableCol($column ?: 'id'), to_array($value));\n }", "public function testMissingFields()\n {\n $arrayFilterConfig = array(\n 'fields' => array(\n array(\n 'field' => '',\n 'value' => 'News')),\n 'fstat' => array(),\n 'search' => array()\n );\n \n $this->setExpectedException(\n 'InvalidArgumentException',\n 'Cannot add condition. Field must be a non-empty string.'\n );\n $filter = new P4Cms_Record_Filter($arrayFilterConfig);\n }", "public function having($clause, array $params);", "public function testBuildWhereEmpty()\n {\n $query = $this->getQuery();\n\n $this->assertSame(\n '',\n $query->buildWhere()\n );\n }", "public function testconstructSQLClauseNullValues()\n {\n $_SESSION['behat']['GenesisSqlExtension']['keywords'] = [];\n $_SESSION['behat']['GenesisSqlExtension']['notQuotableKeywords'] = [];\n\n // Prepare / Mock\n $glue = ' AND ';\n $columns = [\n 'firstname' => 'null',\n 'lastname' => '!null',\n 'postcode' => '!NULL',\n 'address' => 'NULL'\n ];\n\n // Execute\n $result = $this->testObject->constructSQLClause($glue, $columns);\n\n $expected = \"firstname is null AND lastname is not null AND postcode is not NULL AND address is NULL\";\n\n // Assert Result\n $this->assertEquals($expected, $result);\n }", "public function changeFieldToNotNullable($field)\n {\n\t$result= PerfORMController::getConnection()->query('select * from %n where %n is null',\n\t $field->getModel()->getTableName(),\n\t $field->getName()\n\t);\n\n\t$pk= $field->getModel()->getPrimaryKey();\n\n\tforeach($result as $row )\n\t{\n\t if ( !is_null($value= $field->getDefaultValue()) )\n\t {\n\t }\n\t elseif ( is_callable($field->getDefaultCallback()))\n\t {\n\t\t$value= call_user_func($field->getDefaultCallback(), $row);\n\t }\n\t else\n\t {\n\t\tthrow new Exception(\"Unable to set default value for field '\".$field->getName().\"'\");\n\t }\n\n\t PerfORMController::getConnection()->query('update %n set %n = %'.$field->getType().' where %n = %i',\n\t $field->getModel()->getTableName(),\n\t $field->getName(),\n\t $value,\n\t $pk,\n\t $row->{$pk}\n\t );\n\t}\n\n\tPerfORMController::getBuilder()->changeFieldsNullable($field);\n\t$this->updateFieldSync($field);\n }", "public function clearCondition(){\n\t\t$this->where=\"\";\n\t}", "public function orHaving($field, $op = null, $value = null) {\n return $this->_modifyPredicate($this->_having, Predicate::EITHER, $field, $op, $value);\n }", "public static function isNotNull()\n {\n return self::logicalNot(self::isNull());\n }", "public function addFieldToFilter($field, $condition = null)\n {\n if (isset($this->_fields[$field])) {\n $field = $this->_fields[$field];\n }\n\n return parent::addFieldToFilter($field, $condition);\n }", "public static function whereIsNotValue($parameter, $value);", "public function having($conditions = null, $overwrite = false);", "public function notNull(bool $notNull = true): self\r\n {\r\n $this->notNull = $notNull;\r\n return $this;\r\n }" ]
[ "0.7127565", "0.61121035", "0.59569556", "0.5917542", "0.5905032", "0.58895427", "0.5878509", "0.5789669", "0.5731488", "0.57148075", "0.56641495", "0.5654133", "0.5649552", "0.56284004", "0.5625691", "0.56141627", "0.56012565", "0.558496", "0.5424437", "0.5379684", "0.53490376", "0.53435785", "0.5334311", "0.53274316", "0.5297083", "0.52841073", "0.52705306", "0.5217614", "0.519409", "0.5191038", "0.518997", "0.51612973", "0.51564", "0.51445436", "0.5113067", "0.5112127", "0.5110668", "0.5097265", "0.5097095", "0.50819016", "0.5072411", "0.5044739", "0.50347704", "0.5022492", "0.5003646", "0.49999654", "0.49938908", "0.4983871", "0.49511233", "0.49387825", "0.4932453", "0.49320185", "0.49056113", "0.48993003", "0.48974916", "0.48899314", "0.48824784", "0.4863674", "0.48622942", "0.4859822", "0.4844821", "0.48436126", "0.48215628", "0.4780091", "0.47603455", "0.47558147", "0.47459263", "0.4736997", "0.4725525", "0.47247174", "0.47213495", "0.47171646", "0.47124535", "0.4704426", "0.4704426", "0.47036797", "0.469398", "0.46930954", "0.46775606", "0.46740472", "0.46668997", "0.46551156", "0.46500096", "0.46366775", "0.46337068", "0.46054536", "0.46054536", "0.46044093", "0.45950744", "0.45921695", "0.45903382", "0.45673728", "0.45535746", "0.45452142", "0.45391196", "0.4538692", "0.45320404", "0.45319405", "0.45312357", "0.45303282" ]
0.6621382
1
Sets a HAVING condition that the specified subquery returns values.
public function havingExists(SelectInterface $select);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function havingCondition($field, $value = NULL, $operator = NULL);", "public function having($clause, array $params);", "public function having($sql);", "public function having($condition)\n\t\t{\n\t\t\tif($condition instanceof Condition || $condition instanceof ConditionGroup)\n\t\t\t{\n\t\t\t\t$this->havings = $condition; \n\t\t\t\treturn $this;\t\t\t\t\n\t\t\t}\n\t\t\tthrow new \\Exception('Can only add Conditions or ConditionGroups to a statement\\'s where block');\n\t\t}", "public function having($prop, $value = PDODBNULL, $operator = '=', $cond = 'AND'){\r\n $this->_having[] = array($prop,$value,$operator,$cond);\r\n return $this;\r\n }", "public static function having($prop, $value = PDODBNULL, $operator = '=', $cond = 'AND'){\r\n return self::$PDO->having($prop,$value,$operator,$cond);\r\n }", "public function having(){\r\n \t$tb = call_user_func_array(array($this->mask(), 'having'), func_get_args());\r\n\t\treturn $this;\r\n }", "public function having(string $column, string $operator, $value)\n {\n /**\n * If the value is a Builder object then\n * add its parameters to the parameters array\n * and create the subquery from the syntax class\n */\n if ($value instanceof Builder) {\n $this->parameters = array_merge($this->parameters, $value->getParameters());\n $value = \"(\".$this->syntax->selectSyntax(get_object_vars($value)).\")\";\n }\n $this->having = [\"column\" => $column, \"operator\" => $operator, \"value\" => $value];\n \n return $this;\n }", "public function getHaving() {\n return $this->_having ?: new Predicate(Predicate::ALSO);\n }", "function having(...$having)\n {\n $this->iswhere = false;\n return $this->where( ...$having);\n }", "private function addHaving(\n string $glue,\n array | Closure | string $column,\n string $operator,\n array $values\n ) : static {\n return $this->addWhere($glue, $column, $operator, $values, 'having');\n }", "public function having(\n Closure | string $column,\n string $operator,\n Closure | float | int | string | null ...$values\n ) : static {\n return $this->addHaving('AND', $column, $operator, $values);\n }", "public function having(): Having\n {\n if (!isset($this->having)){\n $this->having = new Query\\Having($this, $this->driver, $this->topQuery);\n }\n return $this->having; \n }", "public function addHaving(array $criterion)\n {\n $criterion = new Criterion($criterion);\n $this->criteria->add(\n $criterion->setType('having')\n );\n\n return $this;\n }", "public function having($key, $val=[]): QueryBuilderInterface\n\t{\n\t\treturn $this->_having($key, $val);\n\t}", "public function having()\n {\n $this->having = $expr = new Expression;\n $expr->driver = $this->driver;\n $expr->builder = $this;\n $expr->parent = $this;\n return $expr;\n }", "public function and_having($column, $op, $value = NULL){\n $this->_having[] = array('AND' => array($column, $op, $value));\n\n return $this;\n }", "public function having()\n {\n $args = func_get_args();\n $count = count($args);\n \n if ($count == 1) {\n $this->having[] = $args[0];\n } else {\n $this->having[] = array_shift($args);\n \n if ($count == 2 && is_array($args[0]))\n $args = $args[0];\n \n if ($args)\n $this->having_params = array_merge($this->having_params, $args);\n }\n return $this;\n }", "public function having(array $clauseProps){\r\n\r\n foreach ($clauseProps as $key => $value) {\r\n if(is_array($value)){\r\n if(count($value) > 0){\r\n # check that HAVING clause operator supplied is allowed !!\r\n if(!(in_array(strtoupper($value[0]), $this->allowedOperators))){\r\n throw new UnexpectedValueException();\r\n }\r\n }\r\n }\r\n }\r\n\r\n $this->queryString .= (\" HAVING \" . implode(', ', $this->prepareSelectPlaceholder($clauseProps)));\r\n\r\n return $this;\r\n }", "function having($s)\n{\n\t$this->tryModify();\n\tif(!isset($this->query['having'])) $this->query['having'] = array();\n\t$this->query['having'][] = $this->setWhereParams($s, func_get_args(), 1);\n\treturn $this;\n}", "public function having($having) \n {\n $this->sql .= \" HAVING \". $this->clean($having);\n return $this;\n }", "public function having($conditions) {\n $this->having = !empty($conditions) ? ('HAVING ' . implode(',', $conditions)) : null;\n return $this;\n }", "public function and_having($column, $op = null, $value = null)\n {\n if(func_num_args() === 2)\n {\n $value = $op;\n $op = '=';\n }\n\n $this->_having[] = array('AND' => array($column, $op, $value));\n\n return $this;\n }", "public function and_having_close(){\n $this->_having[] = array('AND' => ')');\n\n return $this;\n }", "public function having($sField, $sValue, $sOperator = '=')\n {\n $this->optClause('HAVING', $sField, $sValue, $sOperator);\n\n return $this;\n }", "public function orHaving(){\r\n \t$tb = call_user_func_array(array($this->mask(), 'orHaving'), func_get_args());\r\n\t\treturn $this;\r\n }", "public function setHaving($having)\n {\n $having = func_num_args() > 1 ? func_get_args() : $having;\n $this->having = [];\n return $this->addHaving($having);\n }", "public function having(string ...$conditions): self {\r\n\r\n $this -> having = array_merge($this -> having, $conditions);\r\n return $this;\r\n }", "public function and_having_close()\n {\n $this->_having[] = array('AND' => ')');\n\n return $this;\n }", "public function having($conditions = null, $overwrite = false);", "public function getHaving()\n {\n return $this->having;\n }", "function having($key, $value = '', $escape = TRUE)\r\n\t{\r\n\t\treturn $this->_having($key, $value, 'AND ', $escape);\r\n\t}", "public function having(): self\n {\n $bindingsFunction = func_get_args();\n\n $sql = array_shift($bindingsFunction);\n\n $this->addToBindings($bindingsFunction);\n\n $this->havings[] = $sql;\n\n return $this;\n }", "function _having($key, $value = '', $type = 'AND ', $escape = TRUE)\r\n\t{\r\n\t\t// Check if this is a related object\r\n\t\tif ( ! empty($this->parent))\r\n\t\t{\r\n\t\t\t$this->db->_having($this->table . '.' . $key, $value, $type, $escape);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$this->db->_having($key, $value, $type, $escape);\r\n\t\t}\r\n\r\n\t\t// For method chaining\r\n\t\treturn $this;\r\n\t}", "public function having(string $having);", "public function having($key, $value = NULL, $escape = NULL)\n\t{\n\t\treturn $this->_wh('qb_having', $key, $value, 'AND ', $escape);\n\t}", "public function havingAnd()\n {\n $this->having .= \" AND \";\n }", "public function havingSQL($havingSqlStatement){\n $this->debugBacktrace();\n $this->havingClause = $havingSqlStatement;\n }", "private function buildHaving(): void {\r\n\r\n if(count($this -> having) > 0) {\r\n\r\n $this -> query[] = 'HAVING';\r\n $this -> query[] = sprintf('(%s)', implode(' AND ', $this -> having));\r\n }\r\n }", "public function appendHavingItem($value)\n {\n return $this->append(self::HAVING_ITEM, $value);\n }", "function addComplexHaving($name, $having) {\n\t\t$this->addBlock('having', $name, $having);\n\t\treturn $this;\n\t}", "public function havingEqual(\n Closure | string $column,\n Closure | float | int | string | null $value\n ) : static {\n return $this->having($column, '=', $value);\n }", "public function addHaving($having)\n {\n $having = $this->normalisePredicates(func_get_args());\n\n // If the function is called with an array of items\n $this->having = array_merge($this->having, $having);\n\n return $this;\n }", "public function having($field, $value = null, $comparitor = null);", "public function having($field, $value = null, $escape = null)\n {\n return $this->prepareWhereStatement($field, $value, 'AND ', $escape, 'having');\n }", "public function having($field, $op = null, $value = null) {\n return $this->_modifyPredicate($this->_having, Predicate::ALSO, $field, $op, $value);\n }", "public function scopeHavingFeature(EloquentBuilder $query, $feature);", "public function havingGte($col, $value)\n {\n $this->having .= \"$col >= $value\";\n }", "public function orHaving($key, $val=[]): QueryBuilderInterface\n\t{\n\t\treturn $this->_having($key, $val, 'OR');\n\t}", "public function having($having = null) {\n\t\tif (!$having) {\n\t\t\treturn $this->_config['having'];\n\t\t}\n\t\t$this->_config['having'] = array_merge(\n\t\t\t(array) $this->_config['having'], (array) $having\n\t\t);\n\t\treturn $this;\n\t}", "public function checkSubquerySupport();", "public function and_having_open(){\n $this->_having[] = array('AND' => '(');\n\n return $this;\n }", "public function having($conditions, $context, array $options = [])\n\t{\n\t\t$defaults = ['prepend' => 'HAVING'];\n\t\t$options += $defaults;\n\t\treturn $this->_conditions($conditions, $context, $options);\n\t}", "public function &havingConditions();", "public function orHavingEqual(\n Closure | string $column,\n Closure | float | int | string | null $value\n ) : static {\n return $this->orHaving($column, '=', $value);\n }", "protected function user_where_clause() {}", "public function having($having)\n {\n if ( ! (func_num_args() == 1 && $having instanceof Composite)) {\n $having = new Composite(Composite::TYPE_AND, func_get_args());\n }\n\n return $this->add('having', $having);\n }", "public function setSubquery()\n {\n $this->isSubQuery = true;\n return $this;\n }", "public function having(string $having, ...$params): Selection\n {\n $this->selection->having($having, ...$params);\n return $this;\n }", "protected function _having($key, $values=[], string $conj='AND'): self\n\t{\n\t\t$where = $this->_where($key, $values);\n\n\t\t// Create key/value placeholders\n\t\tforeach($where as $f => $val)\n\t\t{\n\t\t\t// Split each key by spaces, in case there\n\t\t\t// is an operator such as >, <, !=, etc.\n\t\t\t$fArray = explode(' ', trim($f));\n\n\t\t\t$item = $this->driver->quoteIdent($fArray[0]);\n\n\t\t\t// Simple key value, or an operator\n\t\t\t$item .= (count($fArray) === 1) ? '=?' : \" {$fArray[1]} ?\";\n\n\t\t\t// Put in the having map\n\t\t\t$this->state->appendHavingMap([\n\t\t\t\t'conjunction' => empty($this->state->getHavingMap())\n\t\t\t\t\t? ' HAVING '\n\t\t\t\t\t: \" {$conj} \",\n\t\t\t\t'string' => $item\n\t\t\t]);\n\t\t}\n\n\t\treturn $this;\n\t}", "public function where(callable $condition): TestData\n {\n $this->conditions[] = $condition;\n\n return $this;\n }", "public function gteSubquery($column, Table $subquery)\n {\n $this->addCondition($this->db->escapeIdentifier($column).' >= ('.$subquery->buildSelectQuery().')');\n $this->values = array_merge($this->values, $subquery->getConditionBuilder()->getValues());\n }", "public function having($expression)\n\t{\n\t\tif (!($expression === NULL || is_string($expression))) {\n\t\t\tthrow new InvalidArgumentException('Having expression has to be a string or NULL.');\n\t\t}\n\t\t$this->dirty();\n\t\t$this->having = $expression;\n\t\t$this->args['having'] = array_slice(func_get_args(), 1);\n\t\treturn $this;\n\t}", "public function and_having_open()\n {\n $this->_having[] = array('AND' => '(');\n\n return $this;\n }", "public function buildHaving(array $having = null, array &$values = [])\n {\n if ($having === null) {\n return '';\n }\n\n return 'HAVING ' . $this->buildCondition($having, $values);\n }", "public function getHaving()\n\t\t{\n\t\t\treturn $this->havings;\n\t\t}", "public static function orHaving($prop, $value = PDODBNULL, $operator = '='){\r\n return self::$PDO->orHaving($prop,$value,$operator);\r\n }", "final public function addHaving(YMKM_SQL_Entity_Having $s)\n {\n $this->doAddHaving($s);\n return $this;\n }", "public function addFacetCondition()\n {\n $query = $this->getLayer()->getProductCollection()->getSearchEngineQuery();\n $options = array('interval' => 1, 'field' => $this->_getFilterField());\n $query->addFacet($this->_getFilterField(), 'histogram', $options);\n\n return $this;\n }", "public function orHaving($field, $value = null, $escape = null)\n {\n return $this->prepareWhereStatement($field, $value, 'OR ', $escape, 'having');\n }", "public function havingIn(\n Closure | string $column,\n Closure | float | int | string | null $value,\n Closure | float | int | string | null ...$values\n ) : static {\n return $this->having($column, 'IN', ...[$value, ...$values]);\n }", "public function orHavingGreaterThanOrEqual(\n Closure | string $column,\n Closure | float | int | string | null $value\n ) : static {\n return $this->orHaving($column, '>=', $value);\n }", "public function havingLte($col, $value)\n {\n $this->having .= \"$col <= $value \";\n }", "public function andHaving($having)\n {\n $having = $this->getQueryPart('having');\n $args = func_get_args();\n\n if ($having instanceof Composite && $having->getType() === Composite::TYPE_AND) {\n $having->addMultiple($args);\n } else {\n array_unshift($args, $having);\n $having = new Composite(Composite::TYPE_AND, $args);\n }\n\n return $this->add('having', $having);\n }", "public function andHaving($expression)\n\t{\n\t\tif (!is_string($expression)) {\n\t\t\tthrow new InvalidArgumentException('Having expression has to be a string.');\n\t\t}\n\t\t$this->dirty();\n\t\t$this->having = $this->having ? '(' . $this->having . ') AND (' . $expression . ')' : $expression;\n\t\t$this->pushArgs('having', array_slice(func_get_args(), 1));\n\t\treturn $this;\n\t}", "public function addHavingWithVariables($condition, array $variables) {\n $condition = $this->parseVariables($condition, $variables);\n\n parent::addHavingWithVariables($condition, array());\n }", "public function having($query, array $params = array())\r\n {\r\n $this->add_bind('having', $params);\r\n\r\n $this->having[] = compact('query', 'params');\r\n\r\n return $this;\r\n }", "public function testWhereWithSubQueryValueClosure()\n {\n $subQuery = null;\n $query = (new WhereBuilder($this->mockConnection))\n ->where('field', '=', function ($select) use (&$subQuery) {\n $subQuery = $select;\n });\n $array = $query->toArray();\n\n $this->assertInstanceOf(WhereBuilder::class, $query);\n $this->assertEquals([\n 'where' => [\n [\n 'column' => 'field',\n 'operator' => '=',\n 'value' => $subQuery,\n 'boolean' => 'and',\n ]\n ]\n ], $array);\n }", "public function orHaving($prop, $value = PDODBNULL, $operator = '='){\r\n return $this->where($prop,$value,$operator,'OR');\r\n }", "public function havingGreaterThanOrEqual(\n Closure | string $column,\n Closure | float | int | string | null $value\n ) : static {\n return $this->having($column, '>=', $value);\n }", "public function orHavingGreaterThan(\n Closure | string $column,\n Closure | float | int | string | null $value\n ) : static {\n return $this->orHaving($column, '>', $value);\n }", "public function whereComplex()\n {\n return $this->addComplexCondition('and', $this->conditions);\n }", "public function or_having($column, $op = null, $value = null)\n {\n if(func_num_args() === 2)\n {\n $value = $op;\n $op = '=';\n }\n\n $this->_having[] = array('OR' => array($column, $op, $value));\n\n return $this;\n }", "public function exists(Builder $subquery)\n {\n $condition = \"exists\";\n\n $this->where('', $condition, $subquery, $condition);\n \n return $this;\n }", "public function having(array $filter): static\n {\n return $this->withProperty('filter', array_merge($this->filter, $filter));\n }", "protected function get_sql_for_subquery( $query ) {\r\n\t\tglobal $wpdb;\r\n\r\n\t\t// The sub-parts of a $where part\r\n\t\t$where_parts = array();\r\n\r\n\t\t$column = ( ! empty( $query['column'] ) ) ? esc_sql( $query['column'] ) : $this->column;\r\n\r\n\t\t$column = $this->validate_column( $column );\r\n\r\n\t\t$compare = $this->get_compare( $query );\r\n\r\n\t\t$inclusive = ! empty( $query['inclusive'] );\r\n\r\n\t\t// Assign greater- and less-than values.\r\n\t\t$lt = '<';\r\n\t\t$gt = '>';\r\n\r\n\t\tif ( $inclusive ) {\r\n\t\t\t$lt .= '=';\r\n\t\t\t$gt .= '=';\r\n\t\t}\r\n\r\n\t\t// Range queries\r\n\t\tif ( ! empty( $query['after'] ) )\r\n\t\t\t$where_parts[] = $wpdb->prepare( \"$column $gt %s\", $this->build_mysql_datetime( $query['after'], ! $inclusive ) );\r\n\r\n\t\tif ( ! empty( $query['before'] ) )\r\n\t\t\t$where_parts[] = $wpdb->prepare( \"$column $lt %s\", $this->build_mysql_datetime( $query['before'], $inclusive ) );\r\n\r\n\t\t// Specific value queries\r\n\r\n\t\tif ( isset( $query['year'] ) && $value = $this->build_value( $compare, $query['year'] ) )\r\n\t\t\t$where_parts[] = \"YEAR( $column ) $compare $value\";\r\n\r\n\t\tif ( isset( $query['month'] ) && $value = $this->build_value( $compare, $query['month'] ) )\r\n\t\t\t$where_parts[] = \"MONTH( $column ) $compare $value\";\r\n\t\telse if ( isset( $query['monthnum'] ) && $value = $this->build_value( $compare, $query['monthnum'] ) )\r\n\t\t\t$where_parts[] = \"MONTH( $column ) $compare $value\";\r\n\r\n\t\tif ( isset( $query['week'] ) && false !== ( $value = $this->build_value( $compare, $query['week'] ) ) )\r\n\t\t\t$where_parts[] = _wp_mysql_week( $column ) . \" $compare $value\";\r\n\t\telse if ( isset( $query['w'] ) && false !== ( $value = $this->build_value( $compare, $query['w'] ) ) )\r\n\t\t\t$where_parts[] = _wp_mysql_week( $column ) . \" $compare $value\";\r\n\r\n\t\tif ( isset( $query['dayofyear'] ) && $value = $this->build_value( $compare, $query['dayofyear'] ) )\r\n\t\t\t$where_parts[] = \"DAYOFYEAR( $column ) $compare $value\";\r\n\r\n\t\tif ( isset( $query['day'] ) && $value = $this->build_value( $compare, $query['day'] ) )\r\n\t\t\t$where_parts[] = \"DAYOFMONTH( $column ) $compare $value\";\r\n\r\n\t\tif ( isset( $query['dayofweek'] ) && $value = $this->build_value( $compare, $query['dayofweek'] ) )\r\n\t\t\t$where_parts[] = \"DAYOFWEEK( $column ) $compare $value\";\r\n\r\n\t\tif ( isset( $query['hour'] ) || isset( $query['minute'] ) || isset( $query['second'] ) ) {\r\n\t\t\t// Avoid notices\r\n\t\t\tforeach ( array( 'hour', 'minute', 'second' ) as $unit ) {\r\n\t\t\t\tif ( ! isset( $query[$unit] ) ) {\r\n\t\t\t\t\t$query[$unit] = null;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif ( $time_query = $this->build_time_query( $column, $compare, $query['hour'], $query['minute'], $query['second'] ) ) {\r\n\t\t\t\t$where_parts[] = $time_query;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn $where_parts;\r\n\t}", "public function hasOtherCriteria() {\n return $this->_has(9);\n }", "public function whereGreaterOrEq()\n {\n list($field, $value) = $this->extractQueryToFieldAndValue(func_get_args());\n $this->_conditions[self::WHEREGTE][$field] = [self::OPERATORS['gte'] => $value];\n return $this;\n }", "public function havingGreaterThan(\n Closure | string $column,\n Closure | float | int | string | null $value\n ) : static {\n return $this->having($column, '>', $value);\n }", "public function orHaving($field, $op = null, $value = null) {\n return $this->_modifyPredicate($this->_having, Predicate::EITHER, $field, $op, $value);\n }", "public function or_having($key, $value = NULL, $escape = NULL)\n\t{\n\t\treturn $this->_wh('qb_having', $key, $value, 'OR ', $escape);\n\t}", "public function orHavingLessThanOrEqual(\n Closure | string $column,\n Closure | float | int | string | null $value\n ) : static {\n return $this->orHaving($column, '<=', $value);\n }", "public function havingLike(\n Closure | string $column,\n Closure | float | int | string | null $value\n ) : static {\n return $this->having($column, 'LIKE', $value);\n }", "public function orHavingIn(\n Closure | string $column,\n Closure | float | int | string | null $value,\n Closure | float | int | string | null ...$values\n ) : static {\n return $this->orHaving($column, 'IN', ...[$value, ...$values]);\n }", "protected function _buildContentHaving($q = true)\n\t{\n\t\t$filter_assigned = $this->getState('filter_assigned');\n\n\t\t$having = array();\n\n\t\tif ($filter_assigned === 'O')\n\t\t{\n\t\t\t$having[] = 'COUNT(rel.fileid) = 0';\n\t\t}\n\t\telseif ($filter_assigned === 'A')\n\t\t{\n\t\t\t$having[] = 'COUNT(rel.fileid) > 0';\n\t\t}\n\n\t\tif ($q instanceof \\JDatabaseQuery)\n\t\t{\n\t\t\treturn $having ? $q->having($having) : $q;\n\t\t}\n\n\t\treturn $q\n\t\t\t? ' HAVING ' . (count($having) ? implode(' AND ', $having) : ' 1 ')\n\t\t\t: $having;\n\t}", "public function whereHas($relation, $field, $operator, $value);", "public function gteq(): WhereCondition\n {\n\n $this->_op = self::OP_TYPE_GT_EQ;\n\n return $this;\n\n }", "public function or_having_close(){\n $this->_having[] = array('OR' => ')');\n\n return $this;\n }", "function mHAVING(){\n try {\n $_type = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$HAVING;\n $_channel = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$DEFAULT_TOKEN_CHANNEL;\n // Tokenizer11.g:64:3: ( 'having' ) \n // Tokenizer11.g:65:3: 'having' \n {\n $this->matchString(\"having\"); \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 static function buildHaving(UniqueObject $havingClause, $firstTable, $lastTable, $lastModel) {\n\t\tif ($havingClause->getModel()->getName() != 'Comhon\\Logic\\Having\\Clause') {\n\t\t\t$clauseModel = ModelManager::getInstance()->getInstanceModel('Comhon\\Logic\\Having\\Clause');\n\t\t\tthrow new ArgumentException($havingClause, $clauseModel->getObjectInstance(false)->getComhonClass(), 1);\n\t\t}\n\t\t$havingClause->validate();\n\t\t$clause = new HavingClause($havingClause->getValue('type'));\n\t\t\n\t\t/** @var \\Comhon\\Object\\UniqueObject $element */\n\t\tforeach ($havingClause->getValue('elements') as $element) {\n\t\t\tif ($element->getModel()->getName() == 'Comhon\\Logic\\Having\\Clause') { // clause\n\t\t\t\t$clause->addClause(self::buildHaving($element, $firstTable, $lastTable, $lastModel));\n\t\t\t} else { // literal\n\t\t\t\t// table is not used anymore for function \"COUNT\" because we now use COUNT(*) instead of COUNT(table.column)\n\t\t\t\t// but we keep condition just in case\n\t\t\t\t$table = $element->getModel()->getName() == 'Comhon\\Logic\\Having\\Literal\\Count' ? $firstTable : $lastTable;\n\t\t\t\t$clause->addLiteral(HavingLiteral::buildHaving($element, $table, $lastModel));\n\t\t\t}\n\t\t}\n\t\treturn $clause;\n\t}" ]
[ "0.6416501", "0.63521844", "0.6221326", "0.6207407", "0.61442596", "0.6095151", "0.6090732", "0.6006318", "0.60000604", "0.59506404", "0.59381783", "0.5906694", "0.58963", "0.58935183", "0.5883997", "0.58453065", "0.5802054", "0.5721202", "0.5695124", "0.5676814", "0.5672755", "0.5645035", "0.5644215", "0.5598982", "0.5558348", "0.55530024", "0.553335", "0.5526213", "0.5524728", "0.5493063", "0.5491793", "0.5446751", "0.5441769", "0.5440901", "0.54377955", "0.5425794", "0.5423653", "0.5386056", "0.53854406", "0.5377814", "0.53136045", "0.53131765", "0.5305234", "0.5301798", "0.52744585", "0.5268761", "0.5268263", "0.5257045", "0.5245404", "0.5226738", "0.52166605", "0.5215259", "0.519467", "0.5173686", "0.5167175", "0.51646245", "0.5160255", "0.51600015", "0.51367736", "0.51128423", "0.5051995", "0.50302315", "0.5023256", "0.5019813", "0.50107366", "0.5008855", "0.5001324", "0.49836263", "0.49818736", "0.49285483", "0.49261183", "0.49191445", "0.4913669", "0.49087584", "0.4892054", "0.4890881", "0.48876846", "0.48862818", "0.48844248", "0.48732814", "0.484834", "0.4820515", "0.48158693", "0.47965723", "0.47633007", "0.4762057", "0.47560793", "0.4751316", "0.47445577", "0.47441903", "0.47323936", "0.47317806", "0.47139686", "0.47105315", "0.4699827", "0.4696534", "0.46892127", "0.4683538", "0.46828", "0.46743938" ]
0.48664165
80
Sets a HAVING condition that the specified subquery returns no values.
public function havingNotExists(SelectInterface $select);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function not_having($having) \n {\n $this->sql .= \" NOT HAVING \". $this->clean($having);\n return $this;\n }", "public function havingIsNull($field);", "public function havingIsNull(Closure | string $column) : static\n {\n return $this->having($column, 'IS NULL');\n }", "public function testGetRowsHavingFilterNotSelected() {\n $params = [\n 'report_id' => 'contribution/contributions',\n 'contribution_total_amount_sum_op' => 'lte',\n 'contribution_total_amount_sum_value' => '1000',\n 'group_bys' => [\n 'contribution_financial_type_id' => '1',\n 'contribution_campaign_id' => '1',\n ],\n 'order_bys' => [['column' => 'contribution_source', 'order' => 'ASC']],\n ];\n $this->callAPISuccess('ReportTemplate', 'getrows', $params)['values'];\n }", "public function getHaving() {\n return $this->_having ?: new Predicate(Predicate::ALSO);\n }", "public function havingNotEqual(\n Closure | string $column,\n Closure | float | int | string | null $value\n ) : static {\n return $this->having($column, '!=', $value);\n }", "function having(...$having)\n {\n $this->iswhere = false;\n return $this->where( ...$having);\n }", "public function havingIsNotNull(Closure | string $column) : static\n {\n return $this->having($column, 'IS NOT NULL');\n }", "public function orHavingIsNull(Closure | string $column) : static\n {\n return $this->orHaving($column, 'IS NULL');\n }", "public function having($sql);", "public function havingIsNotNull($field);", "public function hideSumWhenEmpty()\n {\n return $this->withMeta(['hideSumWhenEmpty' => true]);\n }", "public function having(){\r\n \t$tb = call_user_func_array(array($this->mask(), 'having'), func_get_args());\r\n\t\treturn $this;\r\n }", "public function orHavingNotEqual(\n Closure | string $column,\n Closure | float | int | string | null $value\n ) : static {\n return $this->orHaving($column, '!=', $value);\n }", "public function having($prop, $value = PDODBNULL, $operator = '=', $cond = 'AND'){\r\n $this->_having[] = array($prop,$value,$operator,$cond);\r\n return $this;\r\n }", "public function havingCondition($field, $value = NULL, $operator = NULL);", "public function checkSubquerySupport();", "public function globalVarConditionMatchesOnEmptyExpressionWithNoValueSet() {}", "public function globalVarConditionMatchesOnEmptyExpressionWithNoValueSet() {}", "public function globalVarConditionDoesNotMatchOnEmptyExpressionWithValueSetToZero() {}", "public function globalVarConditionDoesNotMatchOnEmptyExpressionWithValueSetToZero() {}", "public function having($clause, array $params);", "public function orHavingIsNotNull(Closure | string $column) : static\n {\n return $this->orHaving($column, 'IS NOT NULL');\n }", "public static function having($prop, $value = PDODBNULL, $operator = '=', $cond = 'AND'){\r\n return self::$PDO->having($prop,$value,$operator,$cond);\r\n }", "public function hasNoLimit() {\n return $this->_has(1);\n }", "public function testBuildGroupByEmpty()\n {\n $query = $this->getQuery();\n\n $this->assertSame(\n '',\n $query->buildGroupBy()\n );\n }", "public function scopeSimple($query)\n {\n return $query->where('group_id', NULL);\n }", "public function hasHaving()\n\t\t{\n\t\t\treturn !is_null($this->havings);\n\t\t}", "public function clearExcludes()\r\n {\r\n foreach ($this->facetQueries as $facetQuery) {\r\n $facetQuery->clearExcludes();\r\n }\r\n\r\n return parent::clearExcludes();\r\n }", "function PMA_showEmptyResultMessageOrSetUniqueCondition($rows, $key_id, $where_clause_array, $local_query, $result, $found_unique_key)\n{\n // No row returned\n if (! $rows[$key_id]) {\n unset($rows[$key_id], $where_clause_array[$key_id]);\n PMA_showMessage(__('MySQL returned an empty result set (i.e. zero rows).'), $local_query);\n echo \"\\n\";\n include 'libraries/footer.inc.php';\n } else {// end if (no row returned)\n $meta = PMA_DBI_get_fields_meta($result[$key_id]);\n list($unique_condition, $tmp_clause_is_unique)\n = PMA_getUniqueCondition($result[$key_id], count($meta), $meta, $rows[$key_id], true);\n if (! empty($unique_condition)) {\n $found_unique_key = true;\n }\n unset($unique_condition, $tmp_clause_is_unique);\n }\n return $found_unique_key;\n}", "public function orHaving(){\r\n \t$tb = call_user_func_array(array($this->mask(), 'orHaving'), func_get_args());\r\n\t\treturn $this;\r\n }", "public function notGroupStart(): QueryBuilderInterface\n\t{\n\t\t$conj = empty($this->state->getQueryMap()) ? ' WHERE ' : ' AND ';\n\n\t\t$this->state->appendMap($conj, ' NOT (', 'group_start');\n\n\t\treturn $this;\n\t}", "public function and_having_close(){\n $this->_having[] = array('AND' => ')');\n\n return $this;\n }", "public function having(): Having\n {\n if (!isset($this->having)){\n $this->having = new Query\\Having($this, $this->driver, $this->topQuery);\n }\n return $this->having; \n }", "public function having($condition)\n\t\t{\n\t\t\tif($condition instanceof Condition || $condition instanceof ConditionGroup)\n\t\t\t{\n\t\t\t\t$this->havings = $condition; \n\t\t\t\treturn $this;\t\t\t\t\n\t\t\t}\n\t\t\tthrow new \\Exception('Can only add Conditions or ConditionGroups to a statement\\'s where block');\n\t\t}", "public function zero()\n {\n $this->assertFalse($this->orCriterion->hasCriterion());\n $this->orCriterion->toSQL();\n }", "public function having($conditions = null, $overwrite = false);", "private function buildHaving(): void {\r\n\r\n if(count($this -> having) > 0) {\r\n\r\n $this -> query[] = 'HAVING';\r\n $this -> query[] = sprintf('(%s)', implode(' AND ', $this -> having));\r\n }\r\n }", "public function and_having_close()\n {\n $this->_having[] = array('AND' => ')');\n\n return $this;\n }", "public function having(array $clauseProps){\r\n\r\n foreach ($clauseProps as $key => $value) {\r\n if(is_array($value)){\r\n if(count($value) > 0){\r\n # check that HAVING clause operator supplied is allowed !!\r\n if(!(in_array(strtoupper($value[0]), $this->allowedOperators))){\r\n throw new UnexpectedValueException();\r\n }\r\n }\r\n }\r\n }\r\n\r\n $this->queryString .= (\" HAVING \" . implode(', ', $this->prepareSelectPlaceholder($clauseProps)));\r\n\r\n return $this;\r\n }", "public function testBuildWhereEmpty()\n {\n $query = $this->getQuery();\n\n $this->assertSame(\n '',\n $query->buildWhere()\n );\n }", "public function having($conditions) {\n $this->having = !empty($conditions) ? ('HAVING ' . implode(',', $conditions)) : null;\n return $this;\n }", "public function notInSubquery($column, Table $subquery)\n {\n $this->addCondition($this->db->escapeIdentifier($column).' NOT IN ('.$subquery->buildSelectQuery().')');\n $this->values = array_merge($this->values, $subquery->getConditionBuilder()->getValues());\n }", "public function setSubquery()\n {\n $this->isSubQuery = true;\n return $this;\n }", "public function having()\n {\n $this->having = $expr = new Expression;\n $expr->driver = $this->driver;\n $expr->builder = $this;\n $expr->parent = $this;\n return $expr;\n }", "public function scopeIsNotSold($query)\n {\n return $query->where('sold', 0);\n }", "public function havingNotIn(\n Closure | string $column,\n Closure | float | int | string | null $value,\n Closure | float | int | string | null ...$values\n ) : static {\n return $this->having($column, 'NOT IN', ...[$value, ...$values]);\n }", "public function whereNone($operand, $operatorOrValue=null, $value=null);", "public function &havingConditions();", "public function stdWrap_ifEmptyDeterminesEmptyValuesDataProvider() {}", "public function except($clause)\n {\n // $prop = '_' . $clause;\n \n switch ($clause) {\n case 'distinct':\n case 'from':\n case 'offset':\n case 'limit':\n case 'page':\n case 'per_page':\n $this->$clause = null;\n break;\n \n case 'select':\n case 'joins':\n case 'where':\n case 'where_params':\n case 'order':\n case 'group':\n case 'having':\n case 'having_params':\n $this->$clause = [];\n break;\n }\n return $this;\n }", "public function testWhenNoConditionIsSet()\n {\n $this->assertFalse($this->class->has_condition());\n }", "protected function user_where_clause() {}", "public function having($key, $val=[]): QueryBuilderInterface\n\t{\n\t\treturn $this->_having($key, $val);\n\t}", "public function xorHaving($field, $op = null, $value = null) {\n return $this->_modifyPredicate($this->_having, Predicate::MAYBE, $field, $op, $value);\n }", "public function having($having) \n {\n $this->sql .= \" HAVING \". $this->clean($having);\n return $this;\n }", "public function testWhereNotInWithEmpty()\n {\n $connection = $this->getQueryBuilderConnection();\n\n $results = $connection\n ->select('id')\n ->from('querybuilder_tests')\n ->whereNotIn('id', [])\n ->get();\n\n $real = count($results);\n\n $all = $connection\n ->select($connection->createRawExpression('count(1)'))\n ->from('querybuilder_tests')\n ->getOneField();\n\n $this->assertEquals($real, (int)$all);\n }", "public static function withRejected()\n {\n return (new static )->newQueryWithoutScope(new ContentPublishingScope())->withRejected();\n }", "function NotWhere ($whereclause)\n\t{\n\t\t$this->clause = $whereclause;\n\t}", "public function orHavingNotLike(\n Closure | string $column,\n Closure | float | int | string | null $value\n ) : static {\n return $this->orHaving($column, 'NOT LIKE', $value);\n }", "public function notHospitalised()\n {\n $this->whereClause .= ' AND status <> ?';\n $this->parameterList[] = RequestStatus::HOSPITAL;\n\n return $this;\n }", "public function scopeWithinNot($query, $value, $column = null)\n {\n return $query->whereNotIn($this->tableCol($column ?: 'id'), to_array($value));\n }", "public function addHaving(array $criterion)\n {\n $criterion = new Criterion($criterion);\n $this->criteria->add(\n $criterion->setType('having')\n );\n\n return $this;\n }", "public function havingNotLike(\n Closure | string $column,\n Closure | float | int | string | null $value\n ) : static {\n return $this->having($column, 'NOT LIKE', $value);\n }", "public function orHavingNotIn(\n Closure | string $column,\n Closure | float | int | string | null $value,\n Closure | float | int | string | null ...$values\n ) : static {\n return $this->orHaving($column, 'NOT IN', ...[$value, ...$values]);\n }", "public static function rejected()\n {\n return (new static )->newQueryWithoutScope(new ContentPublishingScope())->rejected();\n }", "public function clearCondition(){\n\t\t$this->where=\"\";\n\t}", "public function notInValue(): WhereCondition\n {\n\n $this->_op = self::OP_TYPE_NIN;\n\n return $this;\n\n }", "public function getHaving()\n {\n return $this->having;\n }", "public function exists(Builder $subquery)\n {\n $condition = \"exists\";\n\n $this->where('', $condition, $subquery, $condition);\n \n return $this;\n }", "public function empty() : DBQueryResult {\n return $this->db->run(\"DELETE FROM `$this->_name`\");\n }", "public function having($having = null) {\n\t\tif (!$having) {\n\t\t\treturn $this->_config['having'];\n\t\t}\n\t\t$this->_config['having'] = array_merge(\n\t\t\t(array) $this->_config['having'], (array) $having\n\t\t);\n\t\treturn $this;\n\t}", "public function hasOtherCriteria() {\n return $this->_has(9);\n }", "public function filterByWithoutLength()\n {\n $this->query->andWhere($this->query->expr()->isNull('b.length'));\n }", "public function forNestedWhere()\n {\n // ->from($this->from) is wrong, and ->from($this->type) is redundant in nested where\n return $this->newQuery()->from(null);\n }", "public function having(\n Closure | string $column,\n string $operator,\n Closure | float | int | string | null ...$values\n ) : static {\n return $this->addHaving('AND', $column, $operator, $values);\n }", "public function having(string ...$conditions): self {\r\n\r\n $this -> having = array_merge($this -> having, $conditions);\r\n return $this;\r\n }", "public function testAroundCollectTotalsForNotNegotiableQuote()\n {\n $this->quote->expects($this->atLeastOnce())->method('getData')->willReturn(false);\n $quote = $this->quote;\n $closure = function () use ($quote) {\n return $quote;\n };\n $this->quote->expects($this->never())->method('getAllItems');\n\n $this->quotePlugin->aroundCollectTotals($this->quote, $closure);\n }", "private function setGroup2() {\n $this->qestion->groupBy(\"moods.id\");\n //$this->qestion->havingRaw(\"CASE WHEN count(forwarding_drugs.id_mood) = 0 THEN 1 else forwarding_drugs.id_mood END \");\n }", "function register_block_core_query_no_results()\n {\n }", "function having($s)\n{\n\t$this->tryModify();\n\tif(!isset($this->query['having'])) $this->query['having'] = array();\n\t$this->query['having'][] = $this->setWhereParams($s, func_get_args(), 1);\n\treturn $this;\n}", "public function and_having($column, $op, $value = NULL){\n $this->_having[] = array('AND' => array($column, $op, $value));\n\n return $this;\n }", "public function useGroupMemberRelatedByGroupIdNotExistsQuery($modelAlias = null, $queryClass = null)\n {\n return $this->useExistsQuery('GroupMemberRelatedByGroupId', $modelAlias, $queryClass, 'NOT EXISTS');\n }", "private function checkOperationReturn()\n {\n if ($this->isSubQuery == true && !$this->return instanceof AqlReturn) {\n throw new InvalidArgumentException(\"A subquery not should have a {$this->operation} operation.\");\n }\n return $this;\n }", "public function setHaving($having)\n {\n $having = func_num_args() > 1 ? func_get_args() : $having;\n $this->having = [];\n return $this->addHaving($having);\n }", "public function testGroupByNone() {\n $this->groupByTestHelper(NULL, [1, 5]);\n }", "public function clear($clause = null)\n\t{\n\t\tswitch ($clause)\n\t\t{\n\t\t\tcase 'union':\n\t\t\t\t$this->unionDistinct = true;\n\t\t\t\t$this->_union = array();\n\t\t\t\tbreak;\n\t\t\tcase 'select':\n\t\t\t\t$this->_select = array();\n\t\t\t\tbreak;\n\t\t\tcase 'from':\n\t\t\t\t$this->_from = array();\n\t\t\t\tbreak;\n\t\t\tcase 'join':\n\t\t\t\t$this->_join = array();\n\t\t\t\tbreak;\n\t\t\tcase 'where':\n\t\t\t\t$this->_where = null;\n\t\t\t\tbreak;\n\t\t\tcase 'group':\n\t\t\t\t$this->_group = array();\n\t\t\t\tbreak;\n\t\t\tcase 'having':\n\t\t\t\t$this->_having = array();\n\t\t\t\tbreak;\n\t\t\tcase 'order':\n\t\t\t\t$this->_order = array();\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$this->unionDistinct = true;\n\t\t\t\t$this->_union = array();\n\t\t\t\t$this->_select = array();\n\t\t\t\t$this->_from = array();\n\t\t\t\t$this->_join = array();\n\t\t\t\t$this->_where = null;\n\t\t\t\t$this->_group = array();\n\t\t\t\t$this->_having = array();\n\t\t\t\t$this->_order = array();\n\t\t\t\tbreak;\n\t\t}\n\n\t\treturn $this;\n\t}", "public function neq(): WhereCondition\n {\n\n $this->_op = self::OP_TYPE_NEQ;\n\n return $this;\n\n }", "public function scopeWhereNotOrganization($query)\n {\n return $query->whereNull('organization_goal_id');\n }", "public function and_having_open(){\n $this->_having[] = array('AND' => '(');\n\n return $this;\n }", "public function scopeHavingNoCourses($query)\n {\n return $query->has('courses', '<', 1);\n }", "public function havingNullSafeEqual(\n Closure | string $column,\n Closure | float | int | string | null $value\n ) : static {\n return $this->having($column, '<=>', $value);\n }", "private function search_not_empty_grouping_node($node) {\n if ($node->type == qtype_preg_node::TYPE_NODE_SUBEXPR\n && $node->subtype == qtype_preg_node_subexpr::SUBTYPE_GROUPING) {\n $parent = $this->get_parent_node($this->tree, $node->id);\n if ($parent !== null) {\n $group_operand = $node->operands[0];\n if ($parent->type != qtype_preg_node::TYPE_NODE_FINITE_QUANT\n && $parent->type != qtype_preg_node::TYPE_NODE_INFINITE_QUANT\n && $group_operand->type != qtype_preg_node::TYPE_LEAF_META\n && $group_operand->subtype != qtype_preg_leaf_meta::SUBTYPE_EMPTY\n && $group_operand->type != qtype_preg_node::TYPE_NODE_ALT) {\n\n $this->regex_hint_result->problem_ids[] = $node->id;\n $this->regex_hint_result->problem_type = 'qtype_preg_regex_hint_grouping_node';\n $this->regex_hint_result->problem = htmlspecialchars(get_string('simplification_equivalences_short_2_1', 'qtype_preg'));\n $this->regex_hint_result->solve = htmlspecialchars(get_string('simplification_equivalences_full_2_1', 'qtype_preg'));\n $this->regex_hint_result->problem_indfirst = $node->position->indfirst;\n $this->regex_hint_result->problem_indlast = $node->position->indlast;\n return true;\n } else if (($parent->type == qtype_preg_node::TYPE_NODE_FINITE_QUANT\n || $parent->type == qtype_preg_node::TYPE_NODE_INFINITE_QUANT)\n && $group_operand->type != qtype_preg_node::TYPE_NODE_CONCAT\n && $group_operand->type != qtype_preg_node::TYPE_NODE_ALT\n && $group_operand->type != qtype_preg_node::TYPE_NODE_FINITE_QUANT\n && $group_operand->type != qtype_preg_node::TYPE_NODE_INFINITE_QUANT) {\n $this->regex_hint_result->problem_ids[] = $node->id;\n $this->regex_hint_result->problem_type = 'qtype_preg_regex_hint_grouping_node';\n $this->regex_hint_result->problem = htmlspecialchars(get_string('simplification_equivalences_short_2_1', 'qtype_preg'));\n $this->regex_hint_result->solve = htmlspecialchars(get_string('simplification_equivalences_full_2_1', 'qtype_preg'));\n $this->regex_hint_result->problem_indfirst = $node->position->indfirst;\n $this->regex_hint_result->problem_indlast = $node->position->indlast;\n return true;\n }\n } else {\n if ($node->position != NULL) {\n $this->regex_hint_result->problem_ids[] = $node->id;\n $this->regex_hint_result->problem_type = 'qtype_preg_regex_hint_grouping_node';\n $this->regex_hint_result->problem = htmlspecialchars(get_string('simplification_equivalences_short_2_1', 'qtype_preg'));\n $this->regex_hint_result->solve = htmlspecialchars(get_string('simplification_equivalences_full_2_1', 'qtype_preg'));\n $this->regex_hint_result->problem_indfirst = $node->position->indfirst;\n $this->regex_hint_result->problem_indlast = $node->position->indlast;\n return true;\n }\n }\n }\n if ($this->is_operator($node)) {\n foreach ($node->operands as $operand) {\n if ($this->search_not_empty_grouping_node($operand)) {\n return true;\n }\n }\n }\n\n return false;\n }", "public function whereNotEq()\n {\n \n list($field, $value) = $this->extractQueryToFieldAndValue(func_get_args());\n $this->_conditions[self::WHERENOT][$field] = [self::OPERATORS['ne'] => $value];\n return $this;\n }", "public function havingAnd()\n {\n $this->having .= \" AND \";\n }", "public function notWhereClose()\n\t{\n\t\treturn $this->whereClose();\n\t}", "private function addHaving(\n string $glue,\n array | Closure | string $column,\n string $operator,\n array $values\n ) : static {\n return $this->addWhere($glue, $column, $operator, $values, 'having');\n }", "private function findNotSoldQuery() : QueryBuilder\n {\n return $this\n ->createQueryBuilder('p')\n ->where('p.sold = false')\n ->orderBy('p.created_at', 'ASC');\n }", "public function useGroupMemberRelatedByUserIdNotExistsQuery($modelAlias = null, $queryClass = null)\n {\n return $this->useExistsQuery('GroupMemberRelatedByUserId', $modelAlias, $queryClass, 'NOT EXISTS');\n }", "public function scopeNotBilled($query)\n {\n return $query->where('billed', false);\n }" ]
[ "0.58419544", "0.5786849", "0.5591235", "0.55233496", "0.54878414", "0.54170305", "0.53993046", "0.53726983", "0.5348912", "0.5333755", "0.53182644", "0.5306606", "0.52805555", "0.5265027", "0.5236656", "0.52224976", "0.52134854", "0.51872313", "0.5187059", "0.51836365", "0.5183142", "0.5166338", "0.5091546", "0.50846857", "0.50753754", "0.50683475", "0.5066564", "0.5045127", "0.50405085", "0.5032582", "0.5018057", "0.50089604", "0.49866086", "0.4980996", "0.49694058", "0.49594176", "0.49517325", "0.49443966", "0.49431568", "0.49426445", "0.49372903", "0.49263272", "0.4926064", "0.48998263", "0.4886716", "0.48795208", "0.48718336", "0.48535115", "0.48504603", "0.4837083", "0.48335966", "0.48276398", "0.48087835", "0.48084128", "0.48016626", "0.4757391", "0.47496614", "0.47450918", "0.47371185", "0.4726435", "0.47162378", "0.46947116", "0.46927983", "0.46875206", "0.468633", "0.46694002", "0.46625134", "0.46588612", "0.46410766", "0.46391225", "0.4637247", "0.46184236", "0.46177182", "0.4615398", "0.46105507", "0.46072844", "0.460357", "0.46019137", "0.4584408", "0.45735875", "0.45651823", "0.45630863", "0.45613596", "0.45605928", "0.45603055", "0.4550858", "0.45504457", "0.45432305", "0.4536235", "0.45353967", "0.45314172", "0.45306063", "0.45118505", "0.45114666", "0.45081207", "0.4499462", "0.44922382", "0.4491655", "0.44811392", "0.44796842" ]
0.5099025
22
Clone magic method. Select queries have dependent objects that must be deepcloned. The connection object itself, however, should not be cloned as that would duplicate the connection itself.
public function __clone();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function __clone()\n {\n $this->query = clone $this->query;\n }", "public function __clone()\n {\n $this->select = clone $this->select;\n }", "public final function __clone()\n\t{\n\t\tthrow new Db_Exception('Cloning of Db_Connection instances are not allowed.');\n\t}", "public function __clone() {\n if ($this->_where) {\n $this->_where = clone $this->_where;\n }\n\n if ($this->_having) {\n $this->_having = clone $this->_having;\n }\n }", "public function __clone()\n {\n $this->table = clone $this->table;\n }", "protected function __clone() {}", "protected function __clone() {}", "protected function __clone() {}", "protected function __clone() {}", "protected function __clone() {}", "protected function __clone() {}", "protected function __clone() {}", "protected function __clone() { }", "private function __clone() {}", "private function __clone() {}", "private function __clone() {}", "private function __clone() {}", "private function __clone() {}", "private function __clone() {}", "private function __clone() {}", "private function __clone() {}", "private function __clone() {}", "private function __clone() {}", "private function __clone() {}", "private function __clone() {}", "private function __clone() {}", "private function __clone() {}", "private function __clone() {}", "private function __clone() {}", "private function __clone() {}", "private function __clone() {}", "private function __clone() {}", "private function __clone() {}", "private function __clone() {}", "private function __clone() {}", "private function __clone() {}", "private function __clone() {}", "private function __clone() {}", "private function __clone(){}", "private function __clone(){}", "private function __clone(){}", "private function __clone(){}", "private function __clone(){}", "private function __clone(){}", "private function __clone(){}", "private function __clone(){}", "private function __clone(){}", "private function __clone(){}", "private function __clone(){}", "protected function __clone(){}", "private function __clone() { }", "private function __clone() { }", "private function __clone() { }", "private function __clone() { }", "private function __clone() { }", "private function __clone() { }", "private function __clone() { }", "private function __clone() { }", "private function __clone() { }", "private function __clone() { }", "public function __clone() {}", "public function __clone() {}", "public function __clone() {}", "public function __clone() {}", "private function __clone(){ }", "private function __clone () {}", "protected function __clone()\n {}", "function __clone()\n\t{\n\t\t$relations = array();\n\n\t\tif (!empty($this->relations))\n\t\t{\n\t\t\t/** @var Relation[] $relations */\n\t\t\tforeach ($this->relations as $key => $relation)\n\t\t\t{\n\t\t\t\t$relations[$key] = clone($relation);\n\t\t\t\t$relations[$key]->reset();\n\t\t\t}\n\t\t}\n\n\t\t$this->relations = $relations;\n\t}", "private function __clone()\r\n {}", "private function __clone ( ) { }", "final private function __clone(){}", "public function clone() {\n\t\t\t$class = get_called_class();\n\t\t\t$obj = new $class($this->_db);\n\t\t\t$obj->setFromArray($this->toArray());\n\t\t\t$obj->setChanged($this->hasChanged());\n\t\t\treturn $obj;\n\t\t}", "final private function __clone() {}", "final private function __clone() {}", "final private function __clone() {}", "final private function __clone() {}", "final private function __clone() { }", "final private function __clone() { }", "private function __clone(){\n\t\t\n\t}", "public function __clone() {\n // Issue E_USER_ERROR if clone is attempted\n trigger_error('Cloning <em>wjdb</em> is prohibited.', E_USER_ERROR);\n }", "private function __clone ()\n\t{}", "private function __clone() { \n\n\t}", "protected function __clone() {\n \n }", "protected function __clone()\n {\n }", "private function __clone() {\n }", "private function __clone() {\n }", "private function __clone() {\n }", "private function __clone() {\n }", "private function __clone() {\n }", "private function __clone() {\n \n }", "private function __clone() {\n \n }", "private function __clone() {\r\n\t}", "final public function __clone() {}", "private function __clone() {\n\t}", "private function __clone() {\n\t}", "private function __clone() {\n\t}", "private function __clone() {\n\t}", "private function __clone() {\n\t}", "private function __clone()\n {\n }" ]
[ "0.76012415", "0.7484601", "0.7247227", "0.6715469", "0.6581133", "0.65803087", "0.65803087", "0.65803087", "0.65803087", "0.65803087", "0.65803087", "0.65803087", "0.65681064", "0.65539795", "0.65539795", "0.65539795", "0.65539795", "0.65539795", "0.65539795", "0.65539795", "0.65539795", "0.65539795", "0.65539795", "0.65539795", "0.65539795", "0.65539795", "0.65539795", "0.65539795", "0.65539795", "0.65539795", "0.65539795", "0.65539795", "0.65539795", "0.65539795", "0.65539795", "0.65539795", "0.65539795", "0.65539795", "0.65442514", "0.65442514", "0.65442514", "0.65442514", "0.65442514", "0.65442514", "0.65442514", "0.65442514", "0.65442514", "0.65442514", "0.65442514", "0.65436494", "0.65320355", "0.65320355", "0.65320355", "0.65320355", "0.65320355", "0.65320355", "0.65320355", "0.65320355", "0.65320355", "0.65320355", "0.65290743", "0.65290743", "0.65290743", "0.65290743", "0.6507094", "0.6503174", "0.6497317", "0.648234", "0.6460813", "0.6428507", "0.64269555", "0.639315", "0.6382705", "0.6382705", "0.6382705", "0.6382705", "0.63670236", "0.63670236", "0.6363004", "0.6356466", "0.63551414", "0.6348675", "0.63467073", "0.6346472", "0.63385856", "0.63385856", "0.63385856", "0.63385856", "0.63385856", "0.6335493", "0.6335493", "0.6332207", "0.63297695", "0.6328299", "0.6328299", "0.6328299", "0.6328299", "0.6328299", "0.63017535" ]
0.6541865
51
Add FOR UPDATE to the query. FOR UPDATE prevents the rows retrieved by the SELECT statement from being modified or deleted by other transactions until the current transaction ends. Other transactions that attempt UPDATE, DELETE, or SELECT FOR UPDATE of these rows will be blocked until the current transaction ends.
public function forUpdate($set = TRUE);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function forUpdate($sql){\n\t\treturn $sql.' FOR UPDATE';\n\t}", "public function for_update(){\n\t\t$this->for_update = true;\n\t\treturn $this;\n\t}", "public function updateQuery(\n UpdatingQueryInterface $query,\n PromiseInterface $promise,\n ): BatchManipulationManagerInterface;", "protected function lock()\n {\n $sql = \"LOCK TABLE $this->_table_name WRITE\";\n try {\n $this->_db->exec($sql);\n } catch ( PDOException $e ) {\n if ( !strpos($e->getMessage(), 'syntax error') )\n throw $e;\n // no lock support, continue\n }\n }", "function UPDATEquery($table, $where, $fields_values, $no_quote_fields = FALSE) {\n\t\tforeach($this->preProcessHookObjects as $preProcessHookObject) { /* @var $preProcessHookObject Tx_SandstormmediaPlumber_Hooks_DbPreProcessHookInterface */\n\t\t\t$preProcessHookObject->UPDATEquery_preProcessAction($table, $where, $fields_values, $no_quote_fields, $this);\n\t\t}\n\t\treturn parent::UPDATEquery($table, $where, $fields_values, $no_quote_fields);\n\t}", "public function commit()\n {\n return $this->update($this->columns, $this->table)->where($this->clauses)->execute();\n }", "public function forUpdate(string $sqlQuery) : string\n {\n return $sqlQuery.' WITH (UPDLOCK) ';\n }", "function _lock_tree_table()\n\t{\n\t\tee()->db->query(\"LOCK TABLE \" .$this->tree_table . \" WRITE\");\n\t}", "function exec_UPDATEquery($table, $where, $fields_values, $no_quote_fields = FALSE) {\n\t\t$res = parent::exec_UPDATEquery($table, $where, $fields_values, $no_quote_fields);\n\t\tforeach($this->postProcessHookObjects as $postProcessHookObject) { /* @var $postProcessHookObject Tx_SandstormmediaPlumber_Hooks_DbPostProcessHookInterface */\n\t\t\t$postProcessHookObject->exec_UPDATEquery_postProcessAction($table, $where, $fields_values, $no_quote_fields, $this);\n\t\t}\n\t\treturn $res;\n\t}", "public function findForUpdate($params=''){\n\t\t$this->_connect();\n\t\tif($this->_db->isUnderTransaction()==false){\n\t\t\tthrow new ActiveRecordException('No se puede hacer el findForUpdate mientras no este bajo una transacción');\n\t\t}\n\t\t$numberArguments = func_num_args();\n\t\t$params = Utils::getParams(func_get_args(), $numberArguments);\n\t\t$params['for_update'] = true;\n\t\t$select = $this->_createSQLSelect($params);\n\t\t$resultResource = $this->_db->query($select['sql']);\n\t\treturn $this->_createResultset($select, $resultResource);\n\t}", "function doLimitedUpdate() {\n\t\t$sQuery = 'UPDATE ' . $this->_table() . ' SET ';\n\t\t$aParams = array();\n\t\t\n\t\t$blacklist = array(\n\t\t\t\"sPassword\" => 1,\n\t\t);\n\t\t\n\t\t$aParts = array(); // quick workaround to make the join less hurtful.\n\t\t\n\t\tforeach ($this->_aFieldToSelect as $attr => $column) {\n\t\t\tif (!array_key_exists($attr, $blacklist)) {\n\t\t\t\t$val = $this->$attr;\n\t\t\t\t$aParts[] = $column . ' = ?';\n\t\t\t\t$aParams[] = $val; \n\t\t\t} \n\t\t}\n\t\t$sQuery .= join(', ', $aParts);\n\t\t\n\t\t$sQuery .= ' WHERE id = ? ';\n\t\t$aParams[] = $this->getId();\n\t\t\n\t\t$res = DBUtil::runQuery(array($sQuery, $aParams));\n\n $group = sprintf(\"%s/%s\", get_class($this), 'id');\n $oCache =& KTCache::getSingleton();\n $oCache->remove($group, $this->iId);\n $this->clearCachedGroups();\n\n\t\treturn $res;\n\t}", "private function executeQuery() {\n\t\t$recordset = $this->getConnection()->execute( $this );\n\t\t\n\t\tif( $recordset === false ) {\n\t\t\t$this->_recordset = array();\n\t\t} else {\n\t\t\t$this->_recordset = $recordset;\n\t\t}\n\n\t\t$this->_currentRow = 0;\n\t\t$this->isDirty( false );\n\t}", "protected function hashLockClause() {}", "function update($txn = true) {\n\t\tif ($txn && !($txn instanceof pq\\Transaction)) {\n\t\t\t$txn = $this->table->getConnection()->startTransaction();\n\t\t}\n\t\ttry {\n\t\t\tforeach ($this->rows as $row) {\n\t\t\t\t$row->update();\n\t\t\t}\n\t\t} catch (\\Exception $e) {\n\t\t\tif ($txn) {\n\t\t\t\t$txn->rollback();\n\t\t\t}\n\t\t\tthrow $e;\n\t\t}\n\t\tif ($txn) {\n\t\t\t$txn->commit();\n\t\t}\n\t\treturn $this;\n\t}", "public function commitUpdate();", "public function triggerUpdate() \n {\n $log = FezLog::get();\n $db = DB_API::get();\n \n if (!$this->_use_locking) {\n $log->debug(\"not using locking - starting background process directly\");\n $this->process();\n return;\n }\n \n /**\n * CHECK PROCESS MUTEX\n * 1. Check lock state\n * 2. If locked, check if process is running\n * 3. If process if running: commit/end transaction\n * 4. If process is not running: clean lock\n * 5. Acquire lock\n * 6. Run process\n */\n // Start a transaction explicitly.\n $db->beginTransaction();\n\n $sql = \"SELECT \".$this->_dblp.\"value, \".$this->_dblp.\"pid FROM \".$this->_dbtp.\"locks \".\n \"WHERE \".$this->_dblp.\"name=?\";\n \n try {\n $res = $db->fetchRow($sql, $this->_lock, Zend_Db::FETCH_ASSOC);\n \n $pid = $res[$this->_dblp.'pid'];\n $lock_value = $res[$this->_dblp.'value'];\n $acquire_lock = true;\n $log->debug(\n \"Queue::triggerUpdate got lockValue=\".$lock_value.\", pid=\".$pid.\n \" with \".$sql.\" and \".print_r($res, true)\n );\n\n if ($lock_value > 0 && !empty($pid) && is_numeric($pid)) { \n // check if process is still running or if this is an invalid lock\n $psinfo = $this->getProcessInfo($pid);\n $log->debug(array(\"psinfo\",$psinfo));\n\n if (!empty($psinfo)) {\n // override existing lock\n $acquire_lock = false;\n $log->debug(\"overriding existing lock \".$psinfo);\n }\n }\n \n // worst case: a background process is started, but the queue already\n // empty at this point (very fast indexer)\n if ($acquire_lock) {\n // acquired lock \n $sql = \"DELETE FROM \".$this->_dbtp.\"locks WHERE \".$this->_dblp.\"name=?\";\n $db->query($sql, $this->_lock);\n \n $invalid_pid = -2;\n $sql = \"INSERT INTO \".$this->_dbtp.\"locks (\".$this->_dblp.\"name,\".$this->_dblp.\"value,\".$this->_dblp.\"pid) \".\n \"VALUES (?,?,?)\";\n $db->query($sql, array($this->_lock, 1, $invalid_pid));\n // If all succeed, commit the transaction and all changes\n // are committed at once.\n $db->commit();\n $ok = true; \n } else {\n $db->rollBack();\n $ok = false;\n }\n } catch(Exception $ex) {\n $db->rollBack();\n $log->err($ex);\n $ok = false;\n }\n \n if (! $ok) {\n // setting lock failed because another process was faster\n $log->debug(\"Queue::triggerUpdate - lock value has been taken\");\n \n } else {\n // create new background update process\n $log->debug(\"Queue::triggerUpdate - created new background process!\");\n $this->process();\n }\n }", "public function atomic($f)\n {\n return $this->connection->atomic($f);\n }", "protected function performUpdate() {}", "public static function lockTable(){\n\t\t$statement = App::getDBO()->prepare('LOCK TABLES USERS WRITE');\n\t\t App::getDBO()->query();\n\t}", "private function _find($id, $lockForUpdate = false)\n {\n $prepSql = \"SELECT {$this->_columnNames} FROM `{$this->_tableName}` \"\n . 'WHERE `id` = ? ';\n \n if ($lockForUpdate) {\n $prepSql .= 'FOR UPDATE ';\n }\n \n $pstmt = $this->_prepare($prepSql);\n $bindings = [$id];\n\n $pstmt->execute($bindings);\n \n $dbRecord = $pstmt->fetch(\\PDO::FETCH_ASSOC);\n $pstmt->closeCursor();\n $entity = $this->_toEntity($dbRecord);\n \n return $entity;\n }", "private function update()\n {\n $queryString = 'UPDATE ' . $this->table . ' SET ';\n foreach ($this->data as $column => $value) {\n if ($column != self::ID) {\n $queryString .= $column . ' =:' . $column . ',';\n }\n }\n $queryString .= ' updated_at = sysdate() WHERE 1 = 1 AND ' . self::ID . ' =:' . self::ID;\n $this->query = $this->pdo->prepare($queryString);\n }", "protected function updateLock() \n {\n $log = FezLog::get();\n $db = DB_API::get();\n \n $my_process = $this->getProcessInfo();\n $my_pid = $my_process['pid'];\n\n if (!is_numeric($my_pid)) {\n $my_pid = 'null';\n }\n\n $db->beginTransaction();\n\n $stmt = \"SELECT \".$this->_dblp.\"value, \".$this->_dblp.\"pid FROM \".$this->_dbtp.\"locks \".\n \"WHERE \".$this->_dblp.\"name=?\";\n \n try {\n $res = $db->fetchRow($stmt, $this->_lock, Zend_Db::FETCH_ASSOC);\n \n $pid = $res[$this->_dblp.'pid'];\n $lock_value = $res[$this->_dblp.'value'];\n $acquire_lock = true;\n $log->debug(\n \"Queue got lockValue=\".$lock_value.\", pid=\".$pid.\" with \".$stmt.\" and \".print_r($res, true)\n );\n \n if ($lock_value != -1 && (!empty($pid)) && is_numeric($pid)) {\n // check if process is still running or if this is an invalid lock\n $psinfo = $this->getProcessInfo($pid);\n $log->debug(\"checking for lock on lock \".$pid);\n $log->debug(array(\"psinfo\",$psinfo));\n if (!empty($psinfo)) {\n // override existing lock\n $acquire_lock = false;\n $log->debug(\"overriding existing lock \".$psinfo);\n }\n }\n \n // worst case: a background process is started, but the queue already\n // empty at this point\n if ($acquire_lock) {\n $sql = \"UPDATE \".$this->_dbtp.\"locks SET \".$this->_dblp.\"pid=? \".\n \"WHERE \".$this->_dblp.\"name=?\"; \n $db->query($sql, array($my_pid, $this->_lock));\n $db->commit();\n } else {\n return false;\n }\n }\n catch(Exception $ex) {\n $db->rollBack(); \n $log->err($ex);\n return false;\n }\n return true;\n }", "abstract function update (\\Database\\Query\\Query $query);", "public function UPDATEquery($table, $where, $fields_values, $no_quote_fields=FALSE) {\n \n $query = parent::UPDATEquery($table, $where, $fields_values, $no_quote_fields);\n \n // log query\n $debugQuery = str_replace(chr(9), '', $query); // removes tabs from query for better readability\n trace($debugQuery);\n $this->logQuery($debugQuery);\n \n return $query;\n \n }", "public function exec_UPDATEquery($table, $where, $fields_values, $no_quote_fields = false)\n {\n $res = $this->query($this->UPDATEquery($table, $where, $fields_values, $no_quote_fields));\n if ($this->debugOutput) {\n $this->debug('exec_UPDATEquery');\n }\n\n return $res;\n }", "public function affectingStatement($query, $bindings = []);", "public function affectingStatement($query, $bindings = []);", "public function update()\n {\n return new QueryProxy('update', $this);\n }", "function update_sqliTransaction($update_query, $table, $expectedResult){\n $connection = updateConnectionString();\n mysqli_autocommit($connection,FALSE);\n mysqli_query($connection,\"start transaction\"); \n \n $sql = \"Select * FROM $table\";\n $result = mysqli_query($connection,$sql); \n $rowsBefore = mysqli_num_rows($result);\n \n $queryresult = mysqli_query($connection, $update_query) \n or die(mysqli_error($connection));\n $affectedRows = mysqli_affected_rows($connection);\n \n $sql = \"Select * FROM $table\";\n $result = mysqli_query($connection,$sql); \n $rowsAfter = mysqli_num_rows($result);\n \n if(($rowsBefore != $rowsAfter) || ($affectedRows != $expectedResult)){\n if($affectedRows != 0){\n include(\"logs/logsMail.php\");\n mysqli_query($connection,\"rollback\");\n }else{\n mysqli_query($connection,\"commit\");\n } \n }else{\n mysqli_query($connection,\"commit\");\n }\n mysqli_close($connection);\n return $queryresult;\n }", "public function MyUpdate() {\n //var_dump($rs);\n\n DB::beginTransaction();\n\n\n /*\n DB::transaction(function() {\n $article = Articles::create(array(\n ''\n ));\n });\n */\n }", "public function flushQuery();", "private function handleUpdates($entityManager, $unitOfWork)\n {\n $memberId = $this->session->get('memberId') ?: 0;\n\n foreach ($unitOfWork->getScheduledEntityUpdates() as $entity) {\n\n if ($entity instanceof EffectiveEntity) {\n\n // Check to see if effectiveTime has been explicitly set.\n $changeSet = $unitOfWork->getEntityChangeSet($entity);\n\n if (! isset($changeSet['effectiveTime'])) {\n // effectiveTime was not set by developer. Need to use\n // either current time or (current effectiveTime + 1) if the\n // latter happens to be equal to the current time.\n $effectiveTime = max(\n time(),\n $entity->getEffectiveTime() + 1\n );\n $entity->setEffectiveTime($effectiveTime);\n }\n\n // Added__ housekeeping fields need updating\n if (method_exists($entity, 'setAddedOn')) {\n $entity->setAddedOn(time());\n }\n\n if (method_exists($entity, 'setAddedBy')) {\n $entity->setAddedBy($memberId);\n }\n\n $unitOfWork->detach($entity);\n $entityManager->persist($entity);\n $unitOfWork->computeChangeSet(\n $entityManager->getClassMetadata(get_class($entity)),\n $entity\n );\n\n } else {\n\n $recompute = false;\n\n // Update housekeeping fields\n if (method_exists($entity, 'setModifiedOn')) {\n $entity->setModifiedOn(time());\n $recompute = true;\n }\n\n if (method_exists($entity, 'setModifiedBy')) {\n $entity->setModifiedBy($memberId);\n $recompute = true;\n }\n\n if ($recompute) {\n $unitOfWork->recomputeSingleEntityChangeSet(\n $entityManager->getClassMetadata(get_class($entity)),\n $entity\n );\n }\n }\n }\n }", "function lock() {\n global $_Query_lock_depth;\n if ($_Query_lock_depth < 0) {\n Fatal::internalError('Negative lock depth');\n }\n if ($_Query_lock_depth == 0) {\n $row = $this->select1($this->mkSQL('select get_lock(%Q, %N) as locked',\n OBIB_LOCK_NAME, OBIB_LOCK_TIMEOUT));\n if (!isset($row['locked']) or $row['locked'] != 1) {\n Fatal::cantLock();\n }\n }\n $_Query_lock_depth++;\n }", "public function lock($name=NULL, $mode='WRITE', $quot='`'){\r\n\t\tif($name){\r\n\t\t\t$this->check_table_name($name);\r\n\t\t\t$mode = $this->escstr(strtoupper(trim($mode)));\r\n\t\t\t$this->parent->add_sql(' LOCK TABLE '.$quot.$name.$quot.' '.$mode);\r\n\t\t}\r\n\t\telse\r\n\t\t\t$this->parent->add_sql(' FLUSH TABLES WITH READ LOCK ');\r\n\t\t$this->sql_query_class->lock = true;\r\n\t\treturn new object_sql_query(NULL, $this->parent);\r\n\t}", "public function DoUpdate()\n\t{\n\n\t\treturn db_update_records($this->fields, $this->tables, $this->values, $this->filters);\n\t}", "private function executeExtraUpdates()\n {\n foreach ($this->extraUpdates as $oid => $update) {\n list ($entity, $changeset) = $update;\n $this->entityChangeSets[$oid] = $changeset;\n $this->getEntityPersister(get_class($entity))->update($entity);\n }\n $this->extraUpdates = [];\n }", "public function lockToNormal() {}", "abstract public function mass_update();", "function lock_table($table_name, $alias = null) {\r\n\t\treturn;\r\n\r\n\t\t$sql = \"LOCK TABLES $table_name\";\r\n\r\n\t\tif (isset($alias)) {\r\n\t\t\t$sql .= \" AS $alias\";\r\n\t\t}\r\n\r\n\t\t$sql .= \" WRITE\";\r\n\r\n\t\treturn $this->query($sql);\r\n\r\n\t}", "public function update($query){\n $query_result = $this->db_conn->query($query)\n or die($this->db_conn->error.\"Line is \".__LINE__);\n if($query_result){\n return $query_result;\n }else {\n return false;\n }\n }", "public function lock()\n\t{\n\t\t$this->immutable = true;\n\t}", "function update() {\n\t\t\t$updateQuery = \"UPDATE \".$this->table.\" SET \";\n\n\t\t\t$keysAR = array_keys($this->activeRecord);\n\n\t\t\tfor ($loopUp = 0; $loopUp < count($this->activeRecord); $loopUp++) {\n\n $updateQuery .= $keysAR[$loopUp] . \" = ?, \";\n $paramArray[] = $this->activeRecord[$keysAR[$loopUp]];\n\n\t\t\t}\n\n\t\t\t$updateQuery = substr($updateQuery, 0, -2); // Haal de laatste komma weg.\n\n\t\t\t$updateQuery .= \" WHERE \";\n\n\t\t\t// Fetch de primary key van de tabel.\n $fetchPrimary = $this->mysqlConnection->query(\"SHOW INDEX FROM \".$this->table);\n $arrayIndex = $fetchPrimary->fetch(PDO::FETCH_ASSOC);\n $kolomIndex = $arrayIndex['Column_name'];\n\n $updateQuery .= $kolomIndex.\" = \".$this->originalValues[$kolomIndex];\n\n\t\t\t$this->lastQuery = $updateQuery;\n\n $updateTable = $this->mysqlConnection->prepare($this->lastQuery);\n $updateTable->execute($paramArray);\n\n\t\t}", "public function commit() {\n $result = parent::commit();\n $this->activeTransaction = false;\n return $result;\n }", "public function update($query, $bindings = []);", "public function update($query, $bindings = []);", "public function run()\n {\n $config = $this->config;\n try {\n $this->getFluent()->getPdo()->beginTransaction();\n $this->tree->getFluent()->getPdo()->exec(\"LOCK TABLES $config[table] WRITE;\");\n $return = $this->doRun();\n $this->getFluent()->getPdo()->commit();\n $this->tree->getFluent()->getPdo()->query(\"UNLOCK TABLES;\");\n return $return;\n } catch (Exception $ex) {\n $this->getFluent()->getPdo()->rollBack();\n $this->tree->getFluent()->getPdo()->query(\"UNLOCK TABLES;\");\n throw $ex;\n }\n }", "public function beginTransaction()\n {\n $this->getActivePdo()->beginTransaction();\n }", "function _update_locked () {\n\t\t\n\t\t// How old do locks have to be to get unlocked?\n\t\t$minutes = 10;\n\t\t\n\t\t$time = gmdate(\"Y-m-d H:i:s\", (time() - ($minutes * 60)));\n\t\t\n\t\t$q = $this->db->query(\"UPDATE commentreports\n\t\t\t\t\t\tSET \tlocked = NULL,\n\t\t\t\t\t\t\t\tlockedby = 0\n\t\t\t\t\t\tWHERE\tlocked < '$time'\n\t\t\t\t\t\t\");\n\t\n\t}", "protected function ipLockClause() {}", "function mysql_query($query)\n{\n $link = Session::get('db_link');\n if ($query == \"START TRANSACTION\") return mysqli_autocommit($link, FALSE);\n else if ($query == \"COMMIT\") return mysqli_commit($link);\n else return mysqli_query($link, $query);\n}", "private function update(){\n\t\t$q = Queries::update($this->authkey);\n\t\t$this->internalQuery($q);\n\t}", "public function statement($query, $bindings = [])\n\t{\n\t\treturn $this->run($query, $bindings, function ($me, $query, $bindings) {\n\t\t\t/* @var $me static */\n\t\t\tif ($me->pretending()) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\t\n\t\t\t$bindings = $me->prepareBindings($bindings);\n\t\t\t\n\t\t\t$this->recordsHaveBeenModified(); // 只加了这一行\n\t\t\t\n\t\t\treturn $me->getPdo()->prepare($query)->execute($bindings);\n\t\t});\n\t}", "protected function doUpdate(ConnectionInterface $con)\n {\n $selectCriteria = $this->buildPkeyCriteria();\n $valuesCriteria = $this->buildCriteria();\n\n return $selectCriteria->doUpdate($valuesCriteria, $con);\n }", "protected function doUpdate(ConnectionInterface $con)\n {\n $selectCriteria = $this->buildPkeyCriteria();\n $valuesCriteria = $this->buildCriteria();\n\n return $selectCriteria->doUpdate($valuesCriteria, $con);\n }", "protected function doUpdate(ConnectionInterface $con)\n {\n $selectCriteria = $this->buildPkeyCriteria();\n $valuesCriteria = $this->buildCriteria();\n\n return $selectCriteria->doUpdate($valuesCriteria, $con);\n }", "protected function doUpdate(ConnectionInterface $con)\n {\n $selectCriteria = $this->buildPkeyCriteria();\n $valuesCriteria = $this->buildCriteria();\n\n return $selectCriteria->doUpdate($valuesCriteria, $con);\n }", "protected function doUpdate(ConnectionInterface $con)\n {\n $selectCriteria = $this->buildPkeyCriteria();\n $valuesCriteria = $this->buildCriteria();\n\n return $selectCriteria->doUpdate($valuesCriteria, $con);\n }", "protected function doUpdate(ConnectionInterface $con)\n {\n $selectCriteria = $this->buildPkeyCriteria();\n $valuesCriteria = $this->buildCriteria();\n\n return $selectCriteria->doUpdate($valuesCriteria, $con);\n }", "protected function doUpdate(ConnectionInterface $con)\n {\n $selectCriteria = $this->buildPkeyCriteria();\n $valuesCriteria = $this->buildCriteria();\n\n return $selectCriteria->doUpdate($valuesCriteria, $con);\n }", "protected function doUpdate(ConnectionInterface $con)\n {\n $selectCriteria = $this->buildPkeyCriteria();\n $valuesCriteria = $this->buildCriteria();\n\n return $selectCriteria->doUpdate($valuesCriteria, $con);\n }", "protected function doUpdate(ConnectionInterface $con)\n {\n $selectCriteria = $this->buildPkeyCriteria();\n $valuesCriteria = $this->buildCriteria();\n\n return $selectCriteria->doUpdate($valuesCriteria, $con);\n }", "protected function doUpdate(ConnectionInterface $con)\n {\n $selectCriteria = $this->buildPkeyCriteria();\n $valuesCriteria = $this->buildCriteria();\n\n return $selectCriteria->doUpdate($valuesCriteria, $con);\n }", "protected function doUpdate(ConnectionInterface $con)\n {\n $selectCriteria = $this->buildPkeyCriteria();\n $valuesCriteria = $this->buildCriteria();\n\n return $selectCriteria->doUpdate($valuesCriteria, $con);\n }", "protected function doUpdate(ConnectionInterface $con)\n {\n $selectCriteria = $this->buildPkeyCriteria();\n $valuesCriteria = $this->buildCriteria();\n\n return $selectCriteria->doUpdate($valuesCriteria, $con);\n }", "public function commit(?bool $softCommit = null, ?bool $waitSearcher = null, ?bool $expungeDeletes = null): UpdateResult\n {\n $this->addBufferToQuery($this->buffer);\n $this->updateQuery->addCommit($softCommit, $waitSearcher, $expungeDeletes);\n $result = $this->client->update($this->updateQuery, $this->getEndpoint());\n $this->clear();\n\n return $result;\n }", "public function execute () {\n $this->query->execute();\n }", "function sql_update($conn, $table, $values, $where) {\n\n $query = \"\n UPDATE\n \" . $table .\"\n SET\n \".$values.\"\n WHERE\n \".$where.\" \";\n\n if(_DEBUG==true){\n echo '<div style=\"z-index:100; color:red; background:#F4F4F4; border:solid 1px #E1E1E1; position:fixed; float:right; padding:10px; bottom:0; right:10px;\">' . $query . '</div>';\n }\n\n $result = mysqli_query($conn, $query) or die(mysqli_error($conn));\n\n if(_LOG==true && TABELA_LOG!=NULL ){\n criar_log($conn, $query, TABELA_LOG);\n }\n\n return $result;\n\n}", "function actualizarsoloparesnulossinmin($idkardex,$tallafinal,$tallafinal1,$cantidad1,$iddetalleingreso,$idmodelodetalle,$return = false ){\n $sqlA[] = \"UPDATE adicionkardextienda SET saldocantidad='0',cantidad='0',generado='0' WHERE idmodelodetalle='$idmodelodetalle' AND idcalzado='$iddetalleingreso' AND talla='$tallafinal';\";\n $sqlA[] = \"UPDATE historialkardextienda SET saldocantidad='0',cantidad='0',generado='0' WHERE idmodelodetalle='$idmodelodetalle' AND idcalzado='$iddetalleingreso' AND talla='$tallafinal' and idperiodo='3';\";\n\n//MostrarConsulta($sqlA);\nejecutarConsultaSQLBeginCommit($sqlA);\n}", "public function locksSafeUpdate($query, array $params = [], $maxAttempts = 3)\n {\n for ($attempt = 1; $attempt <= $maxAttempts; $attempt++) {\n try {\n return $this->executeUpdate($query, $params);\n } catch (Exception $e) {\n /**\n * We need try execute query again in case of following MySQL errors:\n * Error: 1205 SQLSTATE: HY000 (ER_LOCK_WAIT_TIMEOUT) Message:\n * Lock wait timeout exceeded; try restarting transaction\n * Error: 1213 SQLSTATE: 40001 (ER_LOCK_DEADLOCK) Message:\n * Deadlock found when trying to get lock; try restarting transaction\n */\n if ($attempt === $maxAttempts\n || stripos(strtolower($e->getMessage()), 'try restarting transaction') === false\n ) {\n throw $e;\n }\n\n $this->delay();\n }\n }\n\n return 0;\n }", "public function set_lock($table_name, $record_id, $user_id);", "function actualizarsoloparesnulosin($idkardex,$talla,$cantidad1,$iddetalleingreso,$idmodelodetalle,$return = false ){\n $sqlA[] = \"UPDATE adicionkardextienda SET saldocantidad='$cantidad1',cantidad='$cantidad1' WHERE idmodelodetalle='$idmodelodetalle' AND idcalzado='$iddetalleingreso' AND talla='$talla';\";\n $sqlA[] = \"UPDATE historialkardextienda SET saldocantidad='$cantidad1',cantidad='$cantidad1' WHERE idmodelodetalle='$idmodelodetalle' AND idcalzado='$iddetalleingreso' AND talla='$talla' and idperiodo='3';\";\n\n//MostrarConsulta($sqlA);\n ejecutarConsultaSQLBeginCommit($sqlA);\n}", "public function getForUpdateSQL();", "private function internalUpdate()\n {\n $param = array();\n\n // Run before update methods and stop here if the return bool false\n if ($this->runBefore('update') === false)\n return false;\n\n // Define fieldlist array\n $fieldlist = array();\n\n // Build updatefields\n foreach ( $this->data as $fld => $val )\n {\n // Skip datafields not in definition\n if (!$this->isField($fld))\n continue;\n\n $val = $this->checkFieldvalue($fld, $val);\n $type = $val == 'NULL' ? 'raw' : $this->getFieldtype($fld);\n\n $fieldlist[] = $this->alias . '.' . $fld . '={' . $type . ':' . $fld . '}';\n $param[$fld] = $val;\n }\n\n // Create filter\n $filter = ' WHERE ' . $this->alias . '.' . $this->pk . '={' . $this->getFieldtype($this->pk) . ':' . $this->pk . '}';\n\n // Even if the pk value is present in data, we set this param manually to prevent errors\n $param[$this->pk] = $this->data->{$this->pk};\n\n // Build fieldlist\n $fieldlist = implode(', ', $fieldlist);\n\n // Create complete sql string\n $sql = \"UPDATE {db_prefix}{$this->tbl} AS {$this->alias} SET {$fieldlist}{$filter}\";\n\n // Run query\n $this->db->query($sql, $param);\n\n // Run after update event methods\n if ($this->runAfter('update') === false)\n return false;\n }", "static function &QueryUpdate($id, $table, $values, $where_condition=NULL, $bind_vars=array()) {\n Profiler::StartTimer(\"DataManager::QueryUpdate()\");\n Profiler::StartTimer(\"DataManager::QueryUpdate($id)\", 3);\n $qstart = microtime(true);\n $rows_affected = NULL;\n $queryid = new DatamanagerQueryID($id);\n if ($source =& DataManager::PickSource($queryid)) {\n $rows_affected = $source->QueryUpdate($queryid, $table, $values, $where_condition, $bind_vars);\n if ($rows_affected > 0) {\n DataManager::CacheClear($id);\n }\n }\n Profiler::StopTimer(\"DataManager::QueryUpdate()\");\n Profiler::StopTimer(\"DataManager::QueryUpdate($id)\");\n self::log(\"update\", $id, $table, $qstart, microtime(true));\n return $rows_affected;\n }", "public function mergeWith(SyncItem $donor, ObjectManager $em){\n $masterData = $this->getCurrentData();\n $donorData = $donor->getCurrentData();\n\n //Duplicate the master's data so the master's data doesn't get altered in the history data\n $updateData = clone $masterData;\n\n //Add current data sets to the HistoryData\n $masterData->setStatus(-1);\n $donorData->setStatus(-1);\n $this->addHistoryData($masterData);\n $this->addHistoryData($donorData);\n\n //Add donor's history to the master's history\n $donorHistory = $donor->getHistoryData();\n foreach($donorHistory as $history){\n $this->addHistoryData($history);\n }\n\n\n //Compare the grades of the data in the master and the donor. If the donor has better data\n //Than the master at any point, transfer the data.\n //Would have been significantly easier with arrays. Impossible because the dataStrings are\n //stored as variables, rather than in a single array.\n\n if($donorData->getDataString0() != null &&\n $updateData->gradeData(0) > $donorData->gradeData(0)\n ){\n $updateData->setDataString0($donorData->getDataString0());\n }\n if($donorData->getDataString1() != null &&\n $updateData->gradeData(1) > $donorData->gradeData(1)\n ){\n $updateData->setDataString1($donorData->getDataString1());\n }\n if($donorData->getDataString2() != null &&\n $updateData->gradeData(2) > $donorData->gradeData(2)\n ){\n $updateData->setDataString2($donorData->getDataString2());\n }\n if($donorData->getDataString3() != null &&\n $updateData->gradeData(3) > $donorData->gradeData(3)\n ){\n $updateData->setDataString3($donorData->getDataString3());\n }\n if($donorData->getDataString4() != null &&\n $updateData->gradeData(4) > $donorData->gradeData(4)\n ){\n $updateData->setDataString4($donorData->getDataString4());\n }\n if($donorData->getDataString5() != null &&\n $updateData->gradeData(5) > $donorData->gradeData(5)\n ){\n $updateData->setDataString5($donorData->getDataString5());\n }\n\n //Set new time\n $time = new DateTime();\n $updateData->setCreated($time);\n\n //Set status of the data\n if($updateData->getOverallGrade() == 'A'){\n $updateData->setStatus(1);\n }else{\n $updateData->setStatus(0);\n }\n $em->persist($updateData);\n\n //Update the data and the grade of the master\n $this->setCurrentData($updateData);\n $this->setGrade();\n\n $em->persist($this);\n }", "function block_admin_display_form1_submit($form, &$form_state) {\r\n $transaction = db_transaction();\r\n try {\r\n foreach ($form_state['values']['blocks'] as $block) {\r\n $block['status'] = (int) ($block['region'] != BLOCK_REGION_NONE);\r\n $block['region'] = $block['status'] ? $block['region'] : '';\r\n db_update('block')\r\n ->fields(array(\r\n 'status' => $block['status'],\r\n 'weight' => $block['weight'],\r\n 'region' => $block['region'],\r\n ))\r\n ->condition('module', $block['module'])\r\n ->condition('delta', $block['delta'])\r\n ->condition('theme', $block['theme'])\r\n ->execute();\r\n }\r\n }\r\n catch (Exception $e) {\r\n $transaction->rollback();\r\n watchdog_exception('block', $e);\r\n throw $e;\r\n }\r\n drupal_set_message(t('The block settings have been updated.'));\r\n cache_clear_all();\r\n}", "public function commit()\n{\n\t$this->query('COMMIT');\n}", "protected function execUpdate($table, $where, $fields_values)\n {\n $no_quote_fields = FALSE;\n $GLOBALS[\"TYPO3_DB\"]->exec_UPDATEquery($table, $where, $fields_values, $no_quote_fields);\n }", "public function commit(){\n\t\t$qUpdate = $this->dbh->prepare($this->modify);\n\t\t$qUpdate->bindValue(':mod',$this->modpath);\n\t\t$qUpdate->execute();\n\t\tif($qUpdate->rowCount() == 1){\n\t\t\treturn true;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}", "private function _acquire_where(array $where = []): self {\n\t\t$update = $this->queryUpdate();\n\t\t$sql = $update->sql();\n\t\t$server = Server::singleton($this->application);\n\t\t$update->setValues([\n\t\t\t'pid' => $this->application->process->id(), 'server' => $server,\n\t\t\t'*locked' => $sql->now(), '*used' => $sql->now(),\n\t\t])->appendWhere([\n\t\t\t'id' => $this->id,\n\t\t] + $where)->execute();\n\t\tif ($this->fetch()->_isMine()) {\n\t\t\tself::$serverLocks = $server->id();\n\t\t\t$this->application->logger->debug(\"Acquired lock $this->code\");\n\t\t\treturn $this;\n\t\t}\n\n\t\tthrow new LockedException(\"Is locked $this->>code\");\n\t}", "public function lockAndBlock()\n {\n $this->lock();\n }", "public function alterStatement(&$query, array &$args);", "public function custom_query()\n {\n $query = $this->db->get(\"products\");\n foreach($query->result() as $row) {\n $data = [\"price\" => $row->price*100];\n $this->db->where('id', $row->id);\n $this->db->update('products', $data);\n }\n die;\n }", "function search_notification_enable_all($force=false)\n{\n ?>\n\t\t<script>\n\t\t\talert('search_notification_enable_all() function called'); \n\t\t</script>\n\t\t<?php\nif ($force)\n {\n sql_query(\"UPDATE search_saved SET enabled=1\");\n }\nelse\n {\n global $userref;\n sql_query(\"UPDATE search_saved SET enabled=1 WHERE owner='{$userref}'\");\n }\n}", "function lock($table, $mode=\"write\") {\r\n\t\t$query=new query($this, \"lock tables $table $mode\");\r\n\t\t$result=$query->result;\r\n\t\treturn $result;\r\n\t}", "public function atualizar() {\n\n\t\t$params = array (\n\t\t\t\"p_nome\" => $this->p_nome,\n\t\t\t\"p_descricao\" => $this->p_descricao,\n\t\t\t\"p_preco\" => $this->p_preco\n\t\t);\n\n\t\t# where c_id = $this->c_id\n\t\t$this->__con->where('p_id', $this->p_id);\n\t\t$atualizar = $this->__con->update('produto', $params);\n\n\n\t\tvar_dump($this->__con->getLastQuery());\n\t\tif ($atualizar>0) {\n\n\t\t\treturn $atualizar;\n\n\t\t}\n\t\t\n\t\tthrow new \\Exception(\"Verifique os parâmetros da query de atualização.\", 1);\n\t\n\t}", "public function lock()\n {\n if ( !($this->_state & self::LOADED) ) {\n $this->_memManager->load($this, $this->_id);\n $this->_state |= self::LOADED;\n }\n\n $this->_state |= self::LOCKED;\n\n /**\n * @todo\n * It's possible to set \"value\" container attribute to avoid modification tracing, while it's locked\n * Check, if it's more effective\n */\n }", "protected function _update()\n\t{\n\t\t// UPDATE 'table' SET\n\t\t$this->_query = 'UPDATE '.$this->_table.' SET ';\n\n\t\t// * / row1, row2\n\t\t$first = true;\n\t\t$vals = '';\n\t\tforeach($this->_set as $key => $value) {\n\t\t\t$this->_query .= ($first) ? ('') : (', '); \n\t\t\t$this->_query .= \"$key = '$value'\";\n\n\t\t\t$first = false;\n\t\t} // foreach\n\n\t\t// WHERE foo = 'bar'\n\t\t$this->_query .= ' WHERE ';\n\t\t$imax = count($this->_where);\n\t\t$first = true;\n\t\tfor($i=0; $i<$imax; $i++) {\n\t\t\t$this->_query .= ($first) ? ('') : (' AND '); \n\t\t\t$first = false;\n\n\t\t\t$this->_query .= $this->_where[$i]['row'].' ';\n\t\t\t$this->_query .= $this->_where[$i]['condition'].' \\'';\n\t\t\t$this->_query .= $this->_where[$i]['value'].'\\'';\n\t\t} // foreach\n\n\t\t// end ;\n\t\t$this->_query .= ';';\n\n\t\treturn $this->_query;\n\t}", "function register_block_core_query()\n {\n }", "public function commit()\n {\n if ($this->hasActiveTransaction) {\n parent::commit();\n $this->hasActiveTransaction = false;\n }\n }", "public function commit(){\n\t\t$event = EventHandler::getInstance();\n\t\t$this->_getDAO();\n\t\t$event->trigger(new UserSettingModifyBeforeCommit($this));\n\t\t$r = $this->_update();\n\t\tif($r !== false){\n\t\t\t$event->trigger(new UserSettingModifyAfterCommit($this));\n\t\t}\n\t\treturn $r;\n\t}", "private function moveLockersForNewColumn($forLocationUID, $forLockerUID) {\n\t\t\t$moveQuery = \"\n\t\t\t\tUPDATE `TekBox-Boxes`\n\t\t\t\tSET `Column` = `Column` + 1 \n\t\t\t\tWHERE `Cluster-UUID` = '$forLocationUID'\n\t\t\t\";\n\t\t\t\n\t\t\tif ($moveResult = mysqli_query($this->mysqli, $moveQuery)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\t\n\t\t\treturn false;\n\t\t}", "function batch_update($datas)\n\t{\n\t\t$ci = &get_instance();\n\t\t$ci->db->trans_strict(TRUE);\n\t\t$ci->db->trans_start();\n\n\t\tif (IS_LOCAL) $ci->load->helper('logger');\n\n\t\tforeach($datas as $table => $data) {\n\t\t\t$ci->db->update($table, $data[0], $data[1]);\n\n\t\t\tif (IS_LOCAL)\tlogme('UPDATE_QUERY', 'info', $ci->db->last_query());\n\t\t}\n\n\t\t$ci->db->trans_complete();\n\t\tif ($ci->db->trans_status() === FALSE)\n\t\t{\n\t\t\tif (IS_LOCAL)\tlogme('ERROR_QUERY', 'info', 'Database Error: '.$ci->db->error()['message']);\n\t\t\treturn [FALSE, ['message' => F::_err_msg('err_commit_data')]];\n\t\t}\n\n\t\treturn [TRUE, NULL];\n\t}", "public function update_or_ignore()\n {\n $this->update_ignore('table', array('foo' => 'bar'), array('hello' => 'world'));\n\n // you can also do\n $this->ignore();\n $this->update('table', array('foo' => 'bar'), array('hello' => 'world'));\n }", "public function update() {\n\t\t$dbh = App::getDatabase()->connect();\n\n\t\t$query = \"UPDATE \".$this->getTableName().\"\n\t\t\t\t SET \";\n\n\t\t$fl = true;\n\t\tforeach($this as $column => $val) {\n\t\t\tif(!in_array($column, $this->getPrimaries())) {\n\t\t\t\t$query .= (($fl) ? \"\" : \", \").$column.\" = \".((is_bool($val)) ? (($val) ? \"TRUE\" : \"FALSE\") : ((is_null($val)||($val === \"\")) ? \"null\" : \"'\".$val.\"'\"));\n\t\t\t\t$fl = false;\n\t\t\t}\n\t\t}\n\n\t\t$fl = true;\n\t\tforeach($this as $column => $val) {\n\t\t\tif(in_array($column, $this->getPrimaries())) {\n\t\t\t\t$query .= \"\\n\".(($fl) ? \"WHERE\" : \"AND\").\" \".$column.\" = '\".$val.\"'\";\n\t\t\t\t$fl = false;\n\t\t\t}\n\t\t}\n\n\t\t$res = $dbh->exec($query);\n\t\t$dbh = null;\n\t\treturn $res;\n\t}", "public function commitTransaction()\n {\n\t\treturn $this->db->fireFastSqlQuery(\"COMMIT\");\n\t}", "public function lock()\n {\n if ($this->isLocked()) {\n throw new RuntimeException('Cannot lock: already locked');\n }\n\n $this->conn->set('lock:' . $this->name, $this->id);\n }", "public function commit()\n {\n $this->getActivePdo()->commit();\n }", "public function sharedLock($sql){\n\t\treturn $sql;\n\t}", "protected function getUpdateStatements() {}", "public function refresh(): void\n {\n $this->query('SELECT 1')->execute();\n }" ]
[ "0.59328705", "0.50731367", "0.5070927", "0.500483", "0.48061028", "0.47558188", "0.46768984", "0.46397233", "0.45856348", "0.45667326", "0.45250273", "0.44931588", "0.44269338", "0.44171128", "0.43896964", "0.43709442", "0.43676037", "0.4329716", "0.43293783", "0.43197733", "0.43074954", "0.4301116", "0.42773607", "0.42544302", "0.418126", "0.41780466", "0.41780466", "0.41683716", "0.41443998", "0.41309297", "0.41157204", "0.41083765", "0.40914556", "0.40893522", "0.40846172", "0.4078839", "0.40699118", "0.40277293", "0.40175483", "0.40034086", "0.3980244", "0.39769837", "0.3975651", "0.39616728", "0.39616728", "0.39609015", "0.39505073", "0.3938336", "0.39379734", "0.39332154", "0.39314497", "0.39308825", "0.39301625", "0.39301625", "0.39301625", "0.39301625", "0.39301625", "0.39301625", "0.39301625", "0.39301625", "0.39301625", "0.39301625", "0.39301625", "0.39301625", "0.39191648", "0.39155272", "0.3913576", "0.39104593", "0.3907464", "0.39012843", "0.389854", "0.3898153", "0.38971254", "0.38965377", "0.38912278", "0.38892454", "0.38889226", "0.38781282", "0.38772264", "0.3871079", "0.38597664", "0.38594174", "0.38591588", "0.3854695", "0.38544536", "0.38524172", "0.3850408", "0.38468885", "0.38467273", "0.38455617", "0.38434413", "0.38419735", "0.3839577", "0.3834975", "0.3822891", "0.3817622", "0.3814135", "0.38048518", "0.38045132", "0.38030198", "0.38001907" ]
0.0
-1
Returns a string representation of how the query will be executed in SQL.
public function __toString();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function toString()\n {\n return \"is equivalent to the SQL query \". \\PHPUnit_Util_Type::toString($this->sql);\n }", "public function getSQL(): string\n {\n return $this->getQuery()->getSQL();\n }", "public function __toString()\n {\n return $this->getSQL();\n }", "public function __toString()\n {\n return $this->builder->getSql();\n }", "public function __toString()\n {\n $query = '';\n\n switch ($this->type) {\n case 'insert':\n $query .= (string) $this->insert;\n\n // Set method\n if ($this->set) {\n $query .= (string) $this->set;\n }\n // Columns-Values method\n elseif ($this->values) {\n if ($this->columns) {\n $query .= (string) $this->columns;\n }\n\n $elements = $this->insert->getElements();\n $tableName = array_shift($elements);\n\n $query .= 'VALUES ';\n $query .= (string) $this->values;\n\n if ($this->autoIncrementField) {\n $query = 'SET IDENTITY_INSERT ' . $tableName . ' ON;' . $query . 'SET IDENTITY_INSERT ' . $tableName . ' OFF;';\n }\n\n if ($this->where) {\n $query .= (string) $this->where;\n }\n }\n\n break;\n\n default:\n $query = parent::__toString();\n break;\n }\n\n return $query;\n }", "public function __toString(){\n\t\t$output = '';\n\t\tforeach ($this->_queries as $query){\n\t\t\tif (isset($query['sql'])){\n\t\t\t\t$output .= $query['sql'] . PHP_EOL . PHP_EOL;\n\t\t\t}\n\t\t}\n\n\t\treturn $output;\n\t}", "protected function sqlToString()\n {\n return implode(' ', $this->query);\n }", "public function __toString(): string\n {\n $last = $this->withColumnName ? \"($this->column)\" : '';\n return $this->query . $last;\n }", "public function toSql()\n {\n if (0 === count($this->getParams())) {\n return 'SELECT *';\n } else {\n return 'SELECT ' . implode(', ', $this->getParams());\n }\n }", "public function __toString(): string\n {\n return sprintf(\n 'SELECT %s FROM %s WHERE %s',\n implode(', ', $this->fields),\n implode(', ', $this->table),\n implode(', ', $this->condition)\n );\n }", "public function __toString()\n {\n return $this->sql;\n }", "public function __toString()\n {\n return $this->sql;\n }", "public function getSQL()\n\t{\n\t\t// build the SELECT FROM part\n\t\t$sql = sprintf('SELECT * FROM `%s`', $this->from);\n\t\t// build the JOIN part\n\t\tforeach ($this->joins as $join) {\n\t\t\t$sql .= sprintf(' %s JOIN `%s` ON (%s)',\n\t\t\t\t$join['type'],\n\t\t\t\t$join['foreignTable'],\n\t\t\t\t$join['clause']\n\t\t\t);\n\t\t}\n\t\t// build the WHERE part\n\t\tif ($this->wheres) {\n\t\t\t$whereClauses = array();\n\t\t\tforeach ($this->wheres as $key => $where) {\n\t\t\t\t$whereClauses []= $where['clause'];\n\t\t\t}\n\t\t\t$sql .= ' WHERE ' . implode(' AND ', $whereClauses);\n\t\t}\n\t\t// build the LIMIT part\n\t\tif ($this->limit) {\n\t\t\t$sql .= ' LIMIT ' . $this->limit;\n\t\t}\n\t\treturn $sql;\n\t}", "public function __toString() {\n\t\treturn $this->sql;\n\t}", "public function getSQL(): string\n {\n if ($this->query === null) {\n throw new Exception('Query wasn\\'t set');\n }\n\n if (is_object($this->query)) {\n if (method_exists($this->query, '__toString')) {\n return $this->query->__toString();\n }\n } else {\n return trim($this->query);\n }\n\n $className = get_class($this->query);\n throw new Exception(\"Can not use class={$className} as database query because it can't be used as string\");\n }", "public function getSQL() {\n return $this->_connection->processQuery($this, true);\n }", "public function getSql() : string {\n return $this->sql;\n }", "public function __toString()\n\t{\n\t\treturn $this->sql;\n\t}", "function __toString(): string {\n return $this->getSQL(null);\n }", "public function sql(){\n $str = \"\";\n foreach($this->params as $key => $val){\n if($val != false){\n $str .= \"$key $val \";\n }\n }\n return $str;\n }", "function str()\n\t{\n return\n \"SELECT $this->select\" .\n \" FROM $this->from \" .\n \" WHERE $this->where \" .\n ($this->group_by ? \" GROUP BY $this->group_by\": '') .\n ($this->having ? \" HAVING $this->having\" : '') .\n ($this->order_by ? \" ORDER BY $this->order_by\": '') .\n ($this->limit ? \" LIMIT $this->limit\": '');\t\t\t\n }", "public function sql(): string\n {\n $columnsNames = array();\n $columnsValues = array();\n\n foreach ($this->parameters as $key => $val) {\n $arg = $this->getArgName($key);\n $columnsNames[] = $this->escape($key); \n $columnsValues[] = ':' . $arg;\n } \n return trim(sprintf(\n 'INSERT INTO %s (%s) VALUES (%s)',\n $this->escape($this->tableName),\n implode(', ', $columnsNames),\n implode(', ', $columnsValues)\n ));\n }", "public function __toString() {\n // to do it. This allows constructs like \"(string) $query\" to work. When\n // the query will be executed, it will be recompiled using the proper\n // placeholder generator anyway.\n if (!$this->compiled()) {\n $this->compile($this->connection, $this);\n }\n\n // Create a sanitized comment string to prepend to the query.\n $comments = $this->connection->makeComment($this->comments);\n\n // SELECT\n $query = $comments . 'SELECT ';\n if ($this->distinct) {\n $query .= 'DISTINCT ';\n }\n\n // FIELDS and EXPRESSIONS\n $fields = array();\n foreach ($this->tables as $alias => $table) {\n if (!empty($table['all_fields'])) {\n $fields[] = $this->connection->escapeTable($alias) . '.*';\n }\n }\n foreach ($this->fields as $alias => $field) {\n // Always use the AS keyword for field aliases, as some\n // databases require it (e.g., PostgreSQL).\n $fields[] = (isset($field['table']) ? $this->connection->escapeTable($field['table']) . '.' : '') . $this->connection->escapeField($field['field']) . ' AS ' . $this->connection->escapeAlias($field['alias']);\n }\n foreach ($this->expressions as $alias => $expression) {\n $fields[] = $expression['expression'] . ' AS ' . $this->connection->escapeAlias($expression['alias']);\n }\n $query .= implode(', ', $fields);\n\n\n // FROM - We presume all queries have a FROM, as any query that doesn't won't need the query builder anyway.\n $query .= \"\\nFROM \";\n foreach ($this->tables as $alias => $table) {\n $query .= \"\\n\";\n if (isset($table['join type'])) {\n $query .= $table['join type'] . ' JOIN ';\n }\n\n // If the table is a subquery, compile it and integrate it into this query.\n if ($table['table'] instanceof SelectQueryInterface) {\n // Run preparation steps on this sub-query before converting to string.\n $subquery = $table['table'];\n $subquery->preExecute();\n $table_string = '(' . (string) $subquery . ')';\n }\n else {\n $table_string = '{' . $this->connection->escapeTable($table['table']) . '}';\n }\n\n // Don't use the AS keyword for table aliases, as some\n // databases don't support it (e.g., Oracle).\n $query .= $table_string . ' ' . $this->connection->escapeTable($table['alias']);\n\n if (!empty($table['condition'])) {\n $query .= ' ON ' . $table['condition'];\n }\n }\n\n // WHERE\n if (count($this->where)) {\n // There is an implicit string cast on $this->condition.\n $query .= \"\\nWHERE \" . $this->where;\n }\n\n // GROUP BY\n if ($this->group) {\n $query .= \"\\nGROUP BY \" . implode(', ', $this->group);\n }\n\n // HAVING\n if (count($this->having)) {\n // There is an implicit string cast on $this->having.\n $query .= \"\\nHAVING \" . $this->having;\n }\n\n // ORDER BY\n if ($this->order) {\n $query .= \"\\nORDER BY \";\n $fields = array();\n foreach ($this->order as $field => $direction) {\n $fields[] = $field . ' ' . $direction;\n }\n $query .= implode(', ', $fields);\n }\n\n // RANGE\n // There is no universal SQL standard for handling range or limit clauses.\n // Fortunately, all core-supported databases use the same range syntax.\n // Databases that need a different syntax can override this method and\n // do whatever alternate logic they need to.\n if (!empty($this->range)) {\n if($this->range['start']) {\n $query .= \"\\nROWS \" . (int) $this->range['length'] . \" TO \" . (int) $this->range['start'] + (int) $this->range['length'];\n } else {\n $query .= \"\\nROWS \" . (int) $this->range['length']; \n }\n }\n\n // UNION is a little odd, as the select queries to combine are passed into\n // this query, but syntactically they all end up on the same level.\n if ($this->union) {\n foreach ($this->union as $union) {\n $query .= ' ' . $union['type'] . ' ' . (string) $union['query'];\n }\n }\n\n if ($this->forUpdate) {\n $query .= ' FOR UPDATE';\n }\n\n return $query;\n }", "public function sql() {\n\t\t$sqlT = \\lulo\\twig\\TwigTemplate::factoryHtmlResource(\\lulo\\query\\Query::PATH . \"/select/query.twig.sql\");\n\t\treturn $sqlT->render([\"query\" => $this]);\n\t}", "public function sql(): string;", "public function GetSQL()\n\t{\n\t\treturn db_get_select_sql($this->fields, $this->tables, $this->groupby, $this->filters, $this->sortfields, $this->limit);\n\t}", "public function showQuery() {\n return $this->_sql;\n }", "public function showQuery() {\n return $this->_sql;\n }", "public function __toString() {\r\n return $this->to_sql();\r\n }", "public function getSQL()\n {\n if ($this->_sql !== null && $this->_state === self::STATE_CLEAN) {\n return $this->_sql;\n }\n\n $sql = '';\n\n switch ($this->_type) {\n case self::DELETE:\n $sql = $this->getSQLForDelete();\n break;\n\n case self::UPDATE:\n $sql = $this->getSQLForUpdate();\n break;\n\n case self::SELECT:\n default:\n $sql = $this->getSQLForSelect();\n break;\n }\n\n $this->_state = self::STATE_CLEAN;\n $this->_sql = $sql;\n\n return $sql;\n }", "public function get_sql() {\n return $this->sql;\n }", "public function get_sql()\n\t{\n\t\treturn $this->sql;\n\t}", "function to_str(){\n //\n $op1 = $this->operand1->to_str();\n $op2 = $this->operand2->to_str();\n \n //return a valid where clause\n return \"$op1 $this->operator $op2\";\n }", "public function __toString()\n\t{\n\t\t// Initialize variables.\n\t\t$query = '';\n\n\t\t// Add the SELECT and FROM clauses.\n\t\t$query .= 'SELECT '.implode(',', $this->_select);\n\t\t$query .= \"\\nFROM \".implode(',', $this->_from);\n\n\t\t// Special case for JOIN clauses.\n\t\tif ($this->_join) {\n\t\t\t$query .= \"\\n\".implode(\"\\n\", $this->_join);\n\t\t}\n\n\t\t// Add the WHERE clause if it exists.\n\t\tif ($this->_where) {\n\t\t\t$query .= \"\\nWHERE \".$this->_where;\n\t\t}\n\n\t\t// Add the optional GROUP BY and HAVING clauses if they exist.\n\t\tif ($this->_group) {\n\t\t\t$query .= \"\\nGROUP BY \".implode(',', $this->_group);\n\t\t}\n\t\tif ($this->_having) {\n\t\t\t$query .= \"\\nHAVING \".implode(',', $this->_having);\n\t\t}\n\n\t\t// Add any UNION queries.\n\t\tforeach ($this->_union as $union)\n\t\t{\n\t\t\t$query .= \"\\nUNION\".((!$union->unionDistinct) ? ' ALL' : '');\n\t\t\t$query .= \"\\n\".$union;\n\t\t}\n\n\t\t// Add the optional ORDER BY clause if it exists.\n\t\tif ($this->_order) {\n\t\t\t$query .= \"\\nORDER BY \".implode(',', $this->_order);\n\t\t}\n\n\t\treturn $query;\n\t}", "function to_str() {\n //\n //Test if this sql has an elias \n $alias= is_null($this->alias) ? \"\":\"as `$this->alias`\";\n //\n //the update statement \n $smt=\"\"\n //This is an update statement \n .\"UPDATE \\n\"\n //\n //Get the root from expression as the source table of this update \n //statement \n . \"{$this->root->fromexp()} \\n\"\n . \"SET \\n\"\n //\n //get the values as key values pairs \n .\"{$this->str_values()} \\n\"\n //\n //The joins, if any\n . \"{$this->joins->to_str()} \\n\"\n //\n //the where condition is that the primary value is equal to the \n //primary column\n .\"WHERE {$this->wheres->to_str()} \\n\"\n //\n //include an ellias if any \n .\"$alias\";\n //\n //Return the sql statement\n return $smt;\n }", "public function to_str() {\n //\n //Construct the sql (select) statement\n $stmt = \n \"select \\n\"\n //\n //Field selection \n . \"{$this->fields->to_str()} \\n\"\n . \"from \\n\"\n //\n //For now the root is simply the name of a table or a bracketed \n //enclose sql \n . \"{$this->root->fromexp()} \\n\"\n //\n //The joins, if any\n . \"{$this->joins->to_str()} \\n\"\n //\n //The where clause, if necessary \n .\"{$this->wheres->to_str()}\";\n return $stmt;\n \n }", "public function getSQL();", "public function prettySql() {\n\t\t$sql = $this->sql();\n\t\t$sql = preg_replace(\"#([\\w_\\(\\)]+)([ \\t]+)([\\w_\\(\\)]+)#s\", \"$1 $3\", $sql);\n\t\t$sql = str_replace(\" \", \" \", $sql);\n\t\treturn $sql;\n\t}", "public function sql () {\n\n return $this->_sql;\n }", "public function __toString() {\n return str_replace(array_keys($this->param), array_values($this->param), $this->sql);\n }", "final public static function toSQL()\n {\n $select = false;\n foreach (self::$starts as $reserved) {\n if (strpos(self::$query, $reserved . ' ') === 0) {\n $select = true;\n break;\n }\n }\n\n if (!$select) {\n self::$query = \"SELECT * FROM \" . self::tableName() . self::$query;\n }\n\n\n $values = [];\n for ($i = 0; $i < sizeof(self::$bindParams); $i++) {\n foreach (self::$bindParams[$i] as $item) {\n $values[] = $item;\n }\n }\n\n if (sizeof($values) > 0) {\n $query = self::$query;\n self::$query = \"\";\n self::$where = false;\n self::$bindParams = array();\n $query = str_replace(\"?\", \"#%s#\", $query);\n $query = sprintf($query, ...$values);\n $query = str_replace(\"#\", \"'\", $query);\n return sprintf($query, ...$values);\n }\n return self::$query;\n }", "function getSql()\n{\n\textract($this->query, EXTR_SKIP);\n\t\n\tif (!$select or !$from) return '';\n\t\n\t$sql = 'SELECT '.implode(',', $select).' FROM '.$from;\n\tif ($where) $sql .= ' WHERE '.implode(' AND ', array_unique($where));\n\tif ($whereJoin) $sql .= ($where? ' AND ':' WHERE ').implode(' AND ', array_unique($whereJoin));\n\tif ($group) $sql .= ' GROUP BY '.$group;\n\tif ($having) $sql .= ' HAVING '.implode(' AND ', array_unique($having));\n\tif ($order) $sql .= ' ORDER BY '.implode(',', $order);\n\tif ($limit) $sql .= ' LIMIT '.$limit[0].' OFFSET '.$limit[1];\n\treturn $sql;\n}", "public function __toString()\n {\n // SELECT\n $parts = [\"SELECT\"];\n if ($this->select) {\n $parts[] = join(\", \", $this->select);\n } else {\n $parts[] = \"*\";\n }\n\n // FROM\n $parts[] = \"FROM\";\n $parts[] = $this->buildFrom();\n\n\n if (!empty($this->joins)) {\n foreach ($this->joins as $type => $joins) {\n foreach ($joins as [$table, $condition]) {\n $parts[] = strtoupper($type) . \" JOIN $table ON $condition\";\n }\n }\n }\n\n // WHERE\n if (!empty($this->where)) {\n $parts[] = \"WHERE\";\n $parts[] = \"(\" . join(\") AND (\", $this->where) . \")\";\n }\n\n // GROUP BY\n if (!empty($this->group)) {\n $parts[] = \"GROUP BY\";\n $parts[] = join(\", \", $this->group);\n }\n\n // ORDER BY\n if (!empty($this->order)) {\n $parts[] = \"ORDER BY\";\n $parts[] = join(\", \", $this->order);\n }\n\n // LIMIT\n if (!empty($this->limit)) {\n $parts[] = \"LIMIT {$this->limit}\";\n }\n\n return join(\" \", $parts);\n }", "public function __toString(): string\n {\n $this->buildQuery();\n return $this->query;\n }", "public function __toString()\n {\n if (empty($this->data)) {\n return \"INSERT INTO `{$this->entity->name}` (`id`) VALUES (NULL)\";\n }\n\n $fields = array_keys($this->data);\n\n $query = \"INSERT INTO `{$this->entity->name}`\";\n $query .= ' (`'.implode('`, `', $fields).'`)';\n $query .= ' VALUES (:'.implode(', :', $fields).')';\n\n if ($this->duplications) {\n $query .= ' ON DUPLICATE KEY UPDATE';\n $query .= ' id = LAST_INSERT_ID(id), '.static::buildFields($fields);\n }\n\n return $query;\n }", "abstract protected function buildSQL(): string;", "public function getSql()\n {\n return $this->sql;\n }", "public function toString() {\n return $this->options['statement'];\n }", "public function toSql()\n\t{\n\t\treturn $this->getQuery()->getDQL();\n\t}", "public function toSQL()\n {\n $sql = '`' . $this->fieldName . '` ' . $this->getOperator() . ' ' . $this->getSearchValue();\n if (null != $this->tableName) {\n $sql = '`' . $this->tableName . '`.' . $sql;\n }\n \n return $sql;\n }", "public function getSQL() {\n\t\t$o = $this->obj;\n\t\t$sql = \"SELECT\";\n\t\tif ($this->distinct) {\n\t\t\t$sql .= \" DISTINCT\";\n\t\t}\n\t\t$s = $this->getSelects();\n\t\tif ($s == \"\") {\n\t\t\t$sql .= \" \".$this->getTable().\".*\";\n\t\t} else {\n\t\t\t$sql .= \" \".$s;\n\t\t}\n\t\t$sql .= \" FROM \".$this->getFrom();\n\t\t$sql .= $this->getJoins();\n\t\t$where = $this->getFilters()->getSQL();\n\t\tif ($where != \"\") {\n\t\t\t$sql .= \" WHERE \".$where;\n\t\t}\n\n\n\n\t\tif ($this->group !== false) {\n\t\t\tif ($this->group[1] == false) {\n\t\t\t\t$sql .= \" GROUP BY \".$this->getTable().\".`\".$this->db->escape_string($this->group[0]).\"`\";\n\t\t\t} else {\n\t\t\t\t$sql .= \" GROUP BY \".$this->group[0];\n\t\t\t}\n\t\t}\n\t\t//if ($this->filter) {\n\t\t//\t$sql .= \" WHERE \".$this->filter->getSQL();\n\t\t//}\n\t\tif (count($this->order) > 0) {\n\t\t\tif ($this->order[0][0] === false) {\n\t\t\t\t$sql .= \" ORDER BY RAND()\";\n\t\t\t} elseif (isset($this->order[0][0])) {\n\t\t\t\t$sql .= \" ORDER BY \";\n\t\t\t\tforeach ($this->order as $cols) {\n\t\t\t\t\t$sql .= \"`\".$this->db->escape_string($cols[0]).\"`\";\n\t\t\t\t\tif ($this->orderAsc) {\n\t\t\t\t\t\t$sql .= \" {$cols[1]} \";\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$sql .= \" {$cols[1]} \";\n\t\t\t\t\t}\n\t\t\t\t\t$sql .= \", \";\n\t\t\t\t}\n\t\t\t\t$sql = substr($sql, 0, -2);\n\t\t\t}\n\t\t}\n\n\t\tif ($this->start !== false) {\n\t\t\t$sql .= \" LIMIT {$this->start}\";\n\t\t\tif ($this->end !== false) {\n\t\t\t\t$sql .= \",{$this->end}\";\n\t\t\t}\n\t\t}\n\t\treturn $sql;\n\t}", "public function to_sql() {\r\n if ($this->sql == null) {\r\n $this->sql = $this->builder->{$this->type}($this);\r\n }\r\n\r\n return $this->sql;\r\n }", "function to_str() {\n return \n //\n //For now we are deleting everything in that record\n \"DELETE {$this->str_values()}\"\n //\n //Get the from expression of the root\n . \"FROM {$this->root->fromexp()}\"\n //\n //the where condition is that the primary value is equal to the \n //primary column\n .\"WHERE {$this->wheres->to_str()} \\n\";\n }", "public function __toString(): string\n {\n return \"DELETE FROM \".$this->table.$this->getWhere();\n }", "public function getSql() { \n return $this->sql;\n }", "public function get_sql()\n {\n }", "function getSQL() {\n\t\treturn $this->sql;\n\t}", "public final function getQueryDebug()\n {\n $sql = $this->buildSqlString();\n\n $out = '\n\t\t<div class=\"debug\">\n\t\t\t<h3>SQL</h3>\n\t\t\t<p>' . $sql . '</p>\n\t\t\t<h3>Params</h3>\n\t\t\t' . $this->debug($this->param) . '\n\t\t\t<h3>Full query</h3>\n\t\t\t' . $this->db->quote($sql, $this->param) . '\n\t\t</div>';\n\n return $out;\n }", "abstract protected function _getSQL(): String;", "protected function buildSQL(): string\n {\n $sql = 'INSERT' . PHP_EOL;\n\n $sql .= $this->buildTable();\n $sql .= $this->buildFields();\n $this->buildBindings();\n $sql .= $this->buildValues();\n $sql .= $this->buildValuesFromSelect();\n $sql .= $this->buildReturning();\n\n\n return $sql;\n }", "final protected function getSQL()\n {\n return $this->sql;\n }", "function get_sql(){\r\n\r\n\t\treturn $this->get_sql_select().$this->get_sql_where().$this->get_sql_order().$this->get_sql_limit();\r\n\r\n\t}", "private function createBaseQuery(): string\n {\n // Prefix the table columns with 'entries.'\n $tableColumns = array_map(function ($column) {\n return 'entries.' . $column;\n }, self::TABLE_COLUMNS);\n\n if ($this->listView) {\n // Filter out the properties that are not available to the listview\n $jsonColumns = array_filter($this->properties, function (Collection\\Property $property) {\n return $property->getIncludeInJsonListView();\n });\n }\n\n // Create the select syntax for the json data column\n $jsonColumns = array_map(function (Collection\\Property $property) {\n return $this->jsonUnquote($property->getIdentifier()) . ' AS `' . $property->getIdentifier() . '`';\n }, $jsonColumns ?? $this->properties);\n\n // Merge both of the above\n $columns = array_merge($tableColumns, $jsonColumns);\n\n // Create the select statement\n $select = implode(', ', $columns);\n\n // Create the query\n // We need the entries.data to be able to perform a HAVING query on it, when parsing the entry, the DATA object is removed\n return 'SELECT entries.data, ' . $select . ' FROM collection_entries AS entries WHERE entries.collection_id = :collection_id AND entries.active = 1 ';\n }", "public function get_sql() {\n\t\treturn $this->SQL1;\n\t}", "public function getQuery(){\n $sql = \"select %s from %s %s %s %s %s %s\";\n\n return sprintf($sql, $this->param, $this->table,\n empty($this->join) ? '' : implode($this->join),\n empty($this->where) ? '' : 'where '. $this->where,\n empty($this->having)? '' : 'having '. $this->having,\n empty($this->order) ? '' : 'order by '. $this->order,\n empty($this->setOperations) ? '' : implode($this->setOperations)\n );\n }", "protected function toBaseSQL() {\r\n\t\t$sql=' FROM '.$this->resolveTable();\r\n\r\n\t\t$sql.=$this->buildJoinClause();\r\n\t\t$sql.=$this->buildWhereClause();\r\n\r\n\t\t$sql.=$this->buildGroupClause();\r\n\r\n\t\treturn $sql;\r\n\t}", "public function getQuerySql() {\n $sql = parent::getQuerySql();\n $connection = $this->model->getMeta()->getConnection();\n\n return $this->parseVariablesIntoSql($sql, $connection);\n }", "protected function getAdditionalSql()\n\t{\n\n\t\t$parts = [];\n\n\t\tif($this->isNullable()){\n\t\t\t$parts[] = 'NOT NULL';\n\t\t}\n\n\t\tif(!is_null($this->getDefault())){\n\t\t\t$default = $this->getDefault();\n\t\t\tif(is_int($this->getDefault())){\n\t\t\t\t$parts[] = sprintf('DEFAULT %d', $default);\n\t\t\t}else{\n\t\t\t\t$parts[] = sprintf(\"DEFAULT '%s'\", $default);\n\t\t\t}\n\n\t\t}\n\n\t\tif($this->isUnique()){\n\t\t\t$parts[] = sprintf('UNIQUE');\n\t\t}\n\n\t\tif($this->isPrimary()){\n\t\t\t$parts[] = 'AUTO_INCREMENT';\n\t\t}\n\n\t\treturn implode(' ', $parts);\n\t}", "public function fetchSqlString()\n\t{\n\t\treturn $this->cur_query;\n\t}", "function to_str(){\n //\n //Get the name of the entity \n $ename= $this->entity->name;\n //\n //The type of the join eg inner join, outer join\n $join_str=\"$this->type\"\n //\n //The on clause\n . \"\\t `$ename` \\tON \\t{$this->get_ons()}\";\n return $join_str;\n }", "public function __toString() {\n return $this->query;\n }", "public function __toString() {\n\t\treturn $this->query;\n\t}", "public function getSql();", "public function getSql();", "abstract function getSQL();", "final public function generateFormattedSQL()\n {\n $parts = $this->generateOrderedSQLParts();\n return array_reduce($parts, function ($memo, $part) {\n $type = current(array_keys($part));\n $value = current($part);\n $sep = $this->getSeparatorForPartType($type);\n if (!$memo) {\n return $value;\n }\n return \"{$memo}{$sep}{$value}\";\n }, null);\n }", "public function generateQuery(): string\n {\n $query = $this->template;\n $query = str_replace('{{columns}}', $this->generateColumns(), $query);\n $query = str_replace('{{pagination}}', $this->generatePagination(), $query);\n $query = str_replace('{{tables}}', $this->generateTables(), $query);\n $matches = [];\n $i = preg_match('/{{where(\\|([a-zA-Z .,\\-]*))?}}/', $query, $matches);\n if ($i) {\n $prepend = $matches[2] ?? null;\n $query = str_replace($matches[0], $this->generateWhere($prepend), $query);\n }\n $i = preg_match('/{{sort(\\|([a-zA-Z .,\\-]*))?}}/', $query, $matches);\n if ($i) {\n $prepend = $matches[2] ?? null;\n $query = str_replace($matches[0], $this->generateSort($prepend), $query);\n }\n return $query;\n }", "public function toSql()\n {\n $this->compile();\n\n return $this->compilerState->compiledParts['sql'] ?? false;\n }", "public function fetchSqlString();", "public function getQuery()\n {\n $query = 'SELECT ';\n $query .= implode(', ', $this->select) . ' ';\n $query .= \"FROM $this->kind \";\n \n if ( ! empty($this->where) )\n {\n $query .= \"WHERE $this->where \";\n }\n \n if ( ! empty($this->groupBy) )\n {\n $query .= \"GROUP BY $this->groupBy \";\n }\n \n if ( ! empty($this->orderBy) )\n {\n $query .= \"ORDER BY $this->orderBy $this->orderByDirection \";\n }\n \n if ( $this->limit !== null )\n {\n $query .= \"LIMIT $this->limit \";\n }\n \n if ( $this->offset !== null )\n {\n $query .= \"OFFSET $this->offset\";\n }\n \n return trim($query);\n }", "function render() {\n\t\t$sql = array();\n\t\tforeach ($this->stmts as $type => $stmts) {\n\t\t\tswitch($type) {\n\t\t\t\tcase \"select\":\n\t\t\t\tcase \"select distinct\":\n\t\t\t\t\t$sql[] = strToUpper($type) . \" \" . implode($stmts, \"\\n\") . \" FROM \".implode($this->from, \", \");\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\t$sql[] = implode($stmts, \"\\n\");\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn implode($sql, \"\\n\").\";\";\n\t}", "public function toAql(): string\n {\n $query = $this->query;\n\n foreach ($this->queryParameters as $parameter) {\n if (!$this->container->has($parameter)) {\n throw new StatementException(\"Parameter ($parameter) was not defined for this statement\");\n }\n\n $query = str_replace($parameter, $this->output($parameter), $query);\n }\n\n return utf8_encode($query);\n }", "public function formatQuery($sql) {\r\n\t\t//regex work with a lookahead to avoid splitting things inside single quotes\r\n\t\t$sql = preg_replace(\r\n\t\t\t\t\"/(WHERE|FROM|GROUP BY|HAVING|ORDER BY|LIMIT|OFFSET|UNION|DUPLICATE KEY)(?=(?:(?:[^']*+'){2})*+[^']*+\\z)/\", \"\\n$0\", $sql\r\n\t\t);\r\n\t\t$sql = preg_replace(\r\n\t\t\t\t\"/(INNER|LEFT|RIGHT|CASE|WHEN|END|ELSE|AND)(?=(?:(?:[^']*+'){2})*+[^']*+\\z)/\", \"\\n $0\", $sql);\r\n\t\treturn $sql;\r\n\t}", "function __toString()\n {\n $sTmp = 'DELETE ' .\n ' FROM ' . $this->_sTable;\n if( !empty($this->_sWhere))\n {\n $sTmp .= ' WHERE ' . $this->_sWhere;\n }\n return $sTmp;\n }", "public function __toString() {\n\t\treturn $this->getQuery();\n\t}", "public function toString()\n\t{\n\t\tif($this->str === null)\n\t\t{\n\t\t\tif(!empty($this->values))\n\t\t\t{\n\t\t\t\t$len = count($this->values);\n\t\t\t\t$conditions = '';\n\n\t\t\t\tforeach($this->values as $i => $value)\n\t\t\t\t{\n\t\t\t\t\tswitch($value[self::TYPE])\n\t\t\t\t\t{\n\t\t\t\t\t\tcase self::TYPE_RAW:\n\n\t\t\t\t\t\t\t$conditions.= $value[self::COLUMN] . ' ' . $value[self::OPERATOR] . ' ' . $value[self::VALUE];\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase self::TYPE_IN:\n\n\t\t\t\t\t\t\t$params = array();\n\n\t\t\t\t\t\t\tforeach($value[self::VALUE] as $val)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$params[] = self::escape($val);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$conditions.= $value[self::COLUMN] . ' IN (' . implode(',', $params) . ')';\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase self::TYPE_SCALAR:\n\t\t\t\t\t\tdefault:\n\n\t\t\t\t\t\t\t$conditions.= $value[self::COLUMN] . ' ' . $value[self::OPERATOR] . ' ' . self::escape($value[self::VALUE]);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\t$conditions.= ($i < $len - 1) ? ' ' . $value[self::CONJUNCTION] . ' ' : '';\n\t\t\t\t}\n\n\t\t\t\treturn $this->str = 'WHERE ' . $conditions;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn $this->str = '';\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn $this->str;\n\t\t}\n\t}", "public function __toString(){\n return $this->execute();\n }", "final public function generateSQL()\n {\n return implode(self::STATEMENTS_DELIMITER, array_map(function ($part) {\n return current($part);\n }, $this->generateOrderedSQLParts()));\n }", "function getSelectSql()\n {\n $str = \"SELECT * FROM \";\n if (isset($this->schema))\n $str = $str . $this->schema . \".\";\n\n $str = $str . $this->tblName . \" WHERE \" . $this->getWhereCondition($this->tblIndex);\n return $str;\n }", "public function getSQL()\n{\n\treturn $this->format('Y-m-d H:i:s');\n}", "public function __toString()\n {\n $sql = array();\n foreach ($this->items as $command => $args)\n if (!empty($args))\n $sql[] = sprintf(\"%s %s\", $command, $args);\n\n return implode(' ', $sql);\n }", "function __toString() {\n\t\treturn $this->query;\n\t}", "public function __toString()\n {\n $sql = parent::__toString();\n $this->connection->limit($sql, $this->limit);\n return $sql;\n }", "public function __toString() {\n\t\t$sSelect = \"(&\";\n\t\t$sSelect .= $this->sFrom;\n\t\t$sSelect .= $this->sWhere;\n\t\t$sSelect .= \")\";\n\t\treturn $sSelect;\n\t}", "function getSQL(?GrammarInterface $grammar): string {\n if($grammar !== null) {\n $table = $grammar->quoteTable($this->table->getTable());\n \n $alias = $this->table->getAlias();\n if(!empty($alias)) {\n $table .= ' AS '.$alias;\n }\n } else {\n $table = $this->table;\n }\n \n $ons = (\n !empty($this->ons) ?\n ' ON '.\\implode(' AND ', $this->ons) :\n ''\n );\n \n return ($this->type ? $this->type.' ' : '').'JOIN '.$table.$ons;\n }", "public function __toString()\n {\n return $this->getQuery();\n }", "public function getQuery(): string {\n\t\t// Store previous output before changing to temp\n\t\t$output = $this->get('output');\n\t\t\n\t\ttry {\n\t\t\t$this->set('output', SqlAdapter::SQL_QUERY);\n\t\t\t$result = $this->run();\n\t\t} finally {\n\t\t\t$this->set('output', $output);\n\t\t}\n\t\t\n\t\treturn $result;\n\t}", "public function buildSqlexp()\n {\n return $this->formatLine($this->_buildSqlExp());\n }", "public function __toString() {\n return $this->getQueryId();\n }", "function to_str() {\n $smt=\"INSERT \\n\"\n //\n //Get the root of the sql \n . \"INTO {$this->root->fromexp()}\\n\"\n //The values\n . \"{$this->str_values()}\\n\"\n //\n //The joins if any because some insert may have sqls as their root\n .\"{$this->joins->to_str()}\" \n \n \n ;\n //\n //Return the sql statement that inserts \n return $smt;\n }", "public static function baseQuery() {\n $sql = 'SELECT*FROM '.static::getTable();\n return $sql;\n }" ]
[ "0.80735326", "0.78274226", "0.7610163", "0.75983727", "0.75858086", "0.7581244", "0.75539005", "0.75240713", "0.74741846", "0.7461257", "0.74501574", "0.74501574", "0.74484605", "0.743464", "0.74336004", "0.74246967", "0.73934346", "0.7386084", "0.73572135", "0.7345165", "0.7335804", "0.727777", "0.7228582", "0.72276044", "0.7216769", "0.7213009", "0.7212931", "0.7212931", "0.71722674", "0.71523845", "0.7124415", "0.71221477", "0.7121181", "0.7115664", "0.7106137", "0.7084872", "0.70840555", "0.7077236", "0.7075217", "0.70559967", "0.70530826", "0.7038945", "0.7033275", "0.7025908", "0.6996971", "0.699211", "0.6986629", "0.69627494", "0.69557184", "0.6944481", "0.6936054", "0.69263345", "0.6893722", "0.6890986", "0.6884333", "0.6874548", "0.6870265", "0.6868385", "0.6863278", "0.6854185", "0.68529326", "0.68418914", "0.68415403", "0.68385345", "0.68367374", "0.68260866", "0.6823701", "0.67889416", "0.67885953", "0.6787435", "0.678118", "0.67468506", "0.67378104", "0.67378104", "0.67364514", "0.6724419", "0.672421", "0.6724138", "0.6709128", "0.6683612", "0.6676399", "0.6673911", "0.66532326", "0.6647747", "0.66307837", "0.65994215", "0.6596697", "0.65846384", "0.65840435", "0.65837866", "0.65837026", "0.6575337", "0.657358", "0.6573219", "0.65403473", "0.6529903", "0.6526943", "0.6503707", "0.6500524", "0.6480068", "0.6477308" ]
0.0
-1
Fetch the correctly formatted internal encryption algorithm method name.
abstract protected function fetchAlgorithmMethodName();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getAlgorithm() : string\n {\n return self::ALGORITHM;\n }", "public function getAlgorithm(): string\n {\n return $this->getHeaderClaim('alg');\n }", "function mcrypt_enc_get_algorithms_name($td)\n{\n}", "abstract public function getAlgorithmType(): string;", "final protected static function getMethod(): string\n {\n return Application::getConfig('application')->getArrayItem('security', 'openssl_default_method') ?? self::DEFAULT_METHOD;\n }", "public function getMethod() {\n\t\tif (isset($_GET[$this->config->get('methodParam')]))\n\t\t\t$method = urldecode($_GET[$this->config->get('methodParam')]);\n\t\telse\n\t\t\t$method = $this->config->get('defaultMethod');\n\t\t\n\t\treturn strtolower($method);\n\t}", "protected function algorithm(): string\r\n {\r\n return PASSWORD_ARGON2ID;\r\n }", "public function getAlgorithm()\n {\n return $this->algorithm;\n }", "public function getAlgorithm()\n {\n return $this->algorithm;\n }", "private function getHashAlgorithm(string $algorithm) : string\n {\n switch ($algorithm) {\n case Algorithms::SHA256:\n return 'sha256';\n case Algorithms::SHA384:\n return 'sha384';\n case Algorithms::SHA512:\n return 'sha512';\n default:\n throw new InvalidArgumentException(\"Algorithm \\\"$algorithm\\\" is not a hash algorithm\");\n }\n }", "public static function getCamelCaseEncryption() {\n return ucfirst(strtolower(IPlayerConfiguration::CRYPTOGRAPHY_ALGORITHM_NAME . IPlayerConfiguration::CRYPTOGRAPHY_ALGORITHM_VERSION));\n }", "public function getAlgorithm()\n {\n return $this->_algorithm;\n }", "public function method() {\n\t\treturn strtoupper($this->getMethod());\n\t}", "public function getInputMethod()\n {\n global $db, $langs;\n\n if ($this->methode_commande_id > 0)\n {\n $sql = \"SELECT rowid, code, libelle as label\";\n $sql.= \" FROM \".MAIN_DB_PREFIX.'c_input_method';\n $sql.= \" WHERE active=1 AND rowid = \".$db->escape($this->methode_commande_id);\n\n $resql = $db->query($sql);\n if ($resql)\n {\n if ($db->num_rows($query))\n {\n $obj = $db->fetch_object($query);\n\n $string = $langs->trans($obj->code);\n if ($string == $obj->code)\n {\n $string = $obj->label != '-' ? $obj->label : '';\n }\n return $string;\n }\n }\n else dol_print_error($db);\n }\n\n return '';\n }", "public function getMethodName() {\r\n\t\treturn($this->method_name);\r\n\t}", "public function getSignAlgorithm() : string\n {\n return $this->signAlgorithm;\n }", "public function getMethodName()\n {\n return PhandArr::last(explode('@', $this->getMethodInvokerName()));\n }", "abstract protected function getMethodName();", "abstract protected static function getHashAlgorithm() : string;", "protected function getHashMethod()\r\n {\r\n return $this->processor_data['processor_params']['hash_method'];\r\n }", "public function getCrypterSuffix() : string\n {\n return $this->shouldBeEncrypted() ? '.' . $this->crypter->getSuffix() : '';\n }", "public function getAlgorithm() {\n $signer = $this->header->getSigner();\n if ($signer !== false) {\n return $signer->getAlgorithm();\n }\n return false;\n }", "public static function getAlgo()\n {\n return 'HS256';\n }", "public static function getAlgo()\n {\n return 'HS256';\n }", "protected function getAlgorithm()\r\n {\r\n return 'SHA256';\r\n }", "public function getMethodName();", "public function getMethodName();", "public function getMethodName();", "private function getOpenSslDigestAlgo(int $algo): string\n {\n switch ($algo) {\n case OPENSSL_ALGO_SHA1:\n return 'sha1';\n case OPENSSL_ALGO_SHA224:\n return 'sha224';\n case OPENSSL_ALGO_SHA256:\n return 'sha256';\n case OPENSSL_ALGO_SHA384:\n return 'sha384';\n case OPENSSL_ALGO_SHA512:\n return 'sha512';\n default:\n throw new XmlSignatureValidatorException(\n \"Cannot verify: Unsupported Algorithm <$algo>\"\n );\n }\n }", "protected function getHashAlgo()\n {\n return self::INTERNAL_ALGORITHM;\n }", "public static function getEncryption() {\n return IPlayerConfiguration::CRYPTOGRAPHY_ALGORITHM_NAME . IPlayerConfiguration::CRYPTOGRAPHY_ALGORITHM_VERSION;\n }", "public function getInternalName();", "public function getSigningAlgorithm()\n {\n if (isset($this->raw->algorithm)) {\n if (is_string($this->raw->algorithm)) {\n if (false === defined('Phar::' . $this->raw->algorithm)) {\n throw new InvalidArgumentException(\n sprintf(\n 'The signing algorithm \"%s\" is not supported.',\n $this->raw->algorithm\n )\n );\n }\n\n return constant('Phar::' . $this->raw->algorithm);\n }\n\n return $this->raw->algorithm;\n }\n\n return Phar::SHA1;\n }", "public function getAesName();", "protected function getMethod(): string\n {\n if (strlen($this->method) == 0) {\n $this->method = 'get';\n }\n return $this->method;\n }", "protected function getPkceMethod()\n {\n return AbstractProvider::PKCE_METHOD_S256;\n }", "public function getMethod() : string\n {\n return static::$method;\n }", "public function getPasswordCryptMethod() {\n\t\treturn $this->_passwordCryptMethod;\n\t}", "public function getMethod()\n {\n return Mage::getStoreConfig('smsnotifier/main_conf/message_type');\n //return Mage::helper('core')->decrypt($encrypted_pass);\n }", "public static function rsaAlgoNameFromId( $opensslAlgo ) {\n\t\tswitch( $opensslAlgo ) {\n\t\tcase OPENSSL_ALGO_SHA1:\n\t\t\treturn 'SHA1withRSA';\n\t\tcase OPENSSL_ALGO_SHA512:\n\t\t\treturn 'SHA512withRSA';\n\t\tdefault:\n\t\t\tthrow new Exception(\"Unsupported algorithm: $opensslAlgo\");\n\t\t}\n\t}", "public function get_normalized_http_method() {\n return strtoupper($this->http_method);\n }", "public function getEncryptionAlgo() {\n\treturn $this->cipher;\n }", "public function get_normalized_http_method()\n {\n return strtoupper($this->http_method);\n }", "public function getEncryptionAlgorithm($client_id = null)\n\t{\n//\n//\t\t$stmt->execute(compact('client_id'));\n//\t\tif ($result = $stmt->fetch(\\PDO::FETCH_ASSOC)) {\n//\t\t\treturn $result['encryption_algorithm'];\n//\t\t}\n//\n//\t\treturn 'RS256';\n\t\t//TODO: Needs mongodb implementation.\n\t\tthrow new \\Exception('getEncryptionAlgorithm() for the MongoDB driver is currently unimplemented.');\n\t}", "public function getAuthenticationMethod() {\n\t\treturn $this->selectedEndpoint['authentication_method'];\n\t}", "public function getFormKey()\n\t{\n\t\treturn encrypt((new \\ReflectionClass($this))->getShortName());\n\t}", "public function getSignAlgorithm(): string {\n\t\t\treturn $this->signAlgorithm;\n\t\t}", "protected function getMethodName($key){\n\t\t$method = $this->getMethod($key);\n\t\t\n\t\treturn $method->getName();\n\t}", "public function getMethodName()\n {\n return $this->method;\n }", "public function getPaymentName()\n {\n return self::METHOD_NAME;\n }", "public function getMethod(): string {}", "public function getMethod(): string;", "public function getMethod(): string;", "public function getMethod(): string;", "public function getMethod(): string;", "public function getMethod(): string;", "public function getMethod(): string;", "public function getApiMethodName() : string {\n\t\treturn $this->apiMethod;\n\t}", "public function getPhpNamingMethod()\n {\n return $this->phpNamingMethod;\n }", "private static function _algoClassByName(string $alg): string\n {\n if (!array_key_exists($alg, self::MAP_ALGO_TO_CLASS)) {\n throw new \\UnexpectedValueException(\n \"Algorithm '{$alg}' not supported.\");\n }\n return self::MAP_ALGO_TO_CLASS[$alg];\n }", "public function getMethodFileName($method) {\n\t\tglobal $rootPath;\n\t\tif(!isset($rootPath)) $rootPath = \"\";\n\t\t\t$fct_name = $this->tblname.\"_APAS_$method\";\n\t\tif($this->extname == \"CORE\")\n\t\t\t$fct_file_name = $rootPath.$this->extname.\"/$fct_name.mth.php\";\n\t\telse\n\t\t\t$fct_file_name = $rootPath.\"extensions/\".$this->extname.\"/$fct_name.mth.php\";\n\t\treturn array($fct_file_name,$fct_name);\n\t}", "public function getOperator(): string {\n\t\tswitch($this->rndOperator) {\n\t\t\tcase self::PLUS:\n\t\t\t\treturn Config::ANTI_SPAM_USE_MATH_SYMBOLS ? '+' : Language::out()->getPlusName();\n\t\t\tcase self::MINUS:\n\t\t\t\treturn Config::ANTI_SPAM_USE_MATH_SYMBOLS ? '-' : Language::out()->getMinusName();\n\t\t\tcase self::MULTIPLE:\n\t\t\tdefault:\n\t\t\t\treturn Config::ANTI_SPAM_USE_MATH_SYMBOLS ? '*' : Language::out()->getMultiplyWithName();\n\t\t}\n\t}", "public function cipherName()\n\t{\n\t\treturn $this->cipher->name();\n\t}", "public function fetch_method()\n\t{\n\t\t$method = $this->route_stack[self::SEG_METHOD];\n\t\treturn ($method === $this->fetch_class()) ? 'index' : $method;\n\t}", "public function getMethodName() : string\n {\n\n return $this->methodName;\n }", "public function getBasicAuthMethod() {\n\t\treturn $this->selectedEndpoint['basic_auth_method'];\n\t}", "private static function get_method(){\n\t\t\tif(!self::$method)\n\t\t\t\tself::$method = $_SERVER['REQUEST_METHOD'];\n\t\t\t\t\n\t\t\treturn strtolower(self::$method);\n\t\t}", "protected function get_method_type() {\n\n\t\treturn isset( $this->response_data->expMonth ) ? 'credit_card' : 'echeck';\n\t}", "public static function getAlgorithm();", "protected function getMethod(): string\n {\n return $this->getTwoStep() ? 'rest/registerPreAuth.do' : 'rest/register.do';\n }", "public function getMethod(): string\n {\n return $this->method;\n }", "public function getMethod(): string\n {\n return $this->method;\n }", "public function method(): string\n {\n return $this->method;\n }", "public function method(): string{\n return $this->_method;\n }", "public function getName() \n { \n return $this->getType().\"_\".substr(md5(implode($this->getParameters())), 0, 20);\n }", "public function get_login_method() \n {\n return $this->login_method;\n }", "public function getName(): string\n {\n if (!$this->useAlternateName) {\n return 'get' . $this->getPropertyName();\n } else {\n $methodName = 'get' . $this->getPropertyName() . 'By';\n\n $camelizedColumns = array_map([TDBMDaoGenerator::class, 'toCamelCase'], $this->foreignKey->getUnquotedLocalColumns());\n\n $methodName .= implode('And', $camelizedColumns);\n\n return $methodName;\n }\n }", "public function httpMethodString()\n\t{\n\t\t$this->httpMethod();\n\t\treturn $this->_httpMethodString;\n\t}", "public function getOpenSslName();", "public function getStringAlgorithm() {}", "public function getMethod()\n {\n if (isset($_POST[$this->methodParam])) {\n return strtoupper($_POST[$this->methodParam]);\n } elseif (isset($_SERVER['HTTP_X_HTTP_METHOD_OVERRIDE'])) {\n return strtoupper($_SERVER['HTTP_X_HTTP_METHOD_OVERRIDE']);\n } else {\n return isset($_SERVER['REQUEST_METHOD']) ? strtoupper($_SERVER['REQUEST_METHOD']) : 'GET';\n }\n }", "public function getMethod(): string {\n\n return strtoupper($_SERVER['REQUEST_METHOD']);\n }", "abstract protected function getPaymentMethodCode();", "public function get_method() {\n\t\treturn $this->method;\n\t}", "public function getMethod() : string\n {\n\n return $this->method;\n }", "public function getInternalName()\n {\n return ($this->isGlobal() ? 'g_' : 'f_') . str_replace('\\\\', '_', $this->namespace) . '_' . $this->getName();\n }", "public function getMethod()\t{\n\t\tif ($this->class != \"NoRoute\")\t{\n\t\t\treturn $this->method;\n\t\t}\n\t\treturn \"invoke\";\n\t}", "public function getMethod() : string;", "public function sslGetCipherName(): string|false {}", "public function get_method() {\n return $this->_method;\n }", "public function getMethod() : string\n {\n return $this->method;\n }", "public function getMethod()\n {\n if($this->_method == NULL || !isset($this->_method))\n {\n $this->_method = substr(get_class($this),3);\n }\n \n return $this->_method;\n }", "public function getHashAlgorithm()\n\t{\n\t\treturn $this->hash_algorithm;\n\t}", "public function method(): string\n {\n return \\strtoupper($this->request()->getMethod());\n }", "public function method(): string\n {\n return $this->getMethod();\n }", "public function getMethod()\n\t{\n\t\treturn strtoupper($this->_internal_request->get_normalized_http_method());\n\t}", "public function GetMethod () {\n\t\treturn $this->method;\n\t}", "public function getAuthenticationMethod() {\n return @$this->attributes['authentication_method'];\n }", "private function getFieldNameFromMethodName($methodName)\n {\n $str = substr($methodName, 3); // removing 'get'\n $str = $this->lcfirst($str);\n $str = preg_replace('/([A-Z])/', '_$1', $str);\n return strtolower($str);\n }", "public function getAlgorithm();" ]
[ "0.7152099", "0.70413315", "0.64654076", "0.62949866", "0.6262322", "0.6220159", "0.61349803", "0.6116348", "0.6116348", "0.60968924", "0.60564005", "0.60387033", "0.6007145", "0.5967294", "0.5890867", "0.5862219", "0.5857976", "0.58487624", "0.58473474", "0.58312756", "0.58222777", "0.580053", "0.57962966", "0.57962966", "0.5795744", "0.57892936", "0.57892936", "0.57892936", "0.57764447", "0.5753986", "0.5747137", "0.57358783", "0.57297385", "0.5715753", "0.57156885", "0.57038987", "0.569846", "0.5695942", "0.568673", "0.56818664", "0.56603223", "0.56534606", "0.5644538", "0.564441", "0.56413364", "0.56274885", "0.5626728", "0.56196463", "0.56191754", "0.56068283", "0.5594038", "0.5589674", "0.5589674", "0.5589674", "0.5589674", "0.5589674", "0.5589674", "0.5576808", "0.5562885", "0.555544", "0.5553921", "0.5550947", "0.55304015", "0.5525994", "0.5522307", "0.5515933", "0.55090153", "0.5500721", "0.54966915", "0.5494846", "0.5492634", "0.5492634", "0.5491529", "0.5489073", "0.547794", "0.5476154", "0.54675716", "0.5465937", "0.5459458", "0.54588056", "0.54557645", "0.54510146", "0.5442591", "0.5439179", "0.5431693", "0.54303366", "0.5422684", "0.54195035", "0.54174274", "0.5410199", "0.54083043", "0.53964156", "0.5394291", "0.538987", "0.5386483", "0.5385786", "0.538148", "0.53813916", "0.5372021", "0.5368869" ]
0.7499706
0
Internal method for the validation of plain data used at encryption operations.
abstract protected function validatePlainDataForEncryption($plainData);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function validatePlainData($plainData)\n {\n if (!is_string($plainData)) {\n throw new \\InvalidArgumentException(\"The data for encryption must be a string or a binary string.\");\n } elseif ($this->useChunks === false) {\n $chunkSize = (int)ceil(static::KEY_SIZE / 8) - $this->getPaddingReservedSize();\n\n if (strlen($plainData) > $chunkSize) {\n throw new \\InvalidArgumentException(\n \"The data for encryption must be less or equal of $chunkSize bytes. Another option is \" .\n \"to allow chunk processing via the `enableChunkProcessing` method, which is not recommended.\"\n );\n }\n }\n }", "abstract protected function validateCipherDataForDecryption($cipherData);", "public function testValidationCaseForNonStringInputDataPassedForEncryption()\n {\n // Backward compatible for different versions of PHPUnit\n if (method_exists($this, 'expectException')) {\n $this->expectException(\\InvalidArgumentException::class);\n\n NativeRc4::encryptData('', ['wrong']);\n } else {\n $hasThrown = null;\n\n try {\n NativeRc4::encryptData('', ['wrong']);\n } catch (\\InvalidArgumentException $exception) {\n $hasThrown = !empty($exception->getMessage());\n } catch (\\Exception $exception) {\n $hasThrown = $exception->getMessage();\n }\n\n $this->assertTrue($hasThrown);\n\n return;\n }\n }", "abstract public function validateData();", "public function validate(array $data) : bool\n {\n // If we dont have all the required parts for decryption exit.\n if (! isset( $data['iv'], $data['data'], $data['mac'])) {\n return false;\n }\n\n // If the extracted iv is invalid exit.\n $iv = base64_decode($data['iv']);\n\n if (strlen( $iv ) !== SODIUM_CRYPTO_SECRETBOX_NONCEBYTES) {\n return false;\n }\n\n return hash_equals($this->hash(base64_decode($data['data']), $iv), $data['mac']);\n }", "abstract public function validateData($data);", "public function testValidationCaseForNonStringSecretKeyPassedForEncryption()\n {\n // Backward compatible for different versions of PHPUnit\n if (method_exists($this, 'expectException')) {\n $this->expectException(\\InvalidArgumentException::class);\n\n NativeRc4::encryptData(['wrong'], '');\n } else {\n $hasThrown = null;\n\n try {\n NativeRc4::encryptData(['wrong'], '');\n } catch (\\InvalidArgumentException $exception) {\n $hasThrown = !empty($exception->getMessage());\n } catch (\\Exception $exception) {\n $hasThrown = $exception->getMessage();\n }\n\n $this->assertTrue($hasThrown);\n\n return;\n }\n }", "public function checkData() {\n\t\t// e.g. numbers must only have digits, e-mail addresses must have a \"@\" and a \".\".\n\t\treturn $this->control->checkPOST($this);\n\t}", "public function checkData() {\n\t\t// e.g. numbers must only have digits, e-mail addresses must have a \"@\" and a \".\".\n\t\treturn $this->control->checkPOST($this);\n\t}", "function isDataValid() \n {\n return true;\n }", "function validate_password($plain, $encrypted) {\n if ($plain != \"\" && $encrypted != \"\") {\n// split apart the hash / salt\n $stack = explode(':', $encrypted);\n\n if (sizeof($stack) != 2) return false;\n\n if (md5($stack[1] . $plain) == $stack[0]) {\n return true;\n }\n }\n\n return false;\n }", "public function testValidationCaseForNonStringInputDataPassedForDecryption()\n {\n // Backward compatible for different versions of PHPUnit\n if (method_exists($this, 'expectException')) {\n $this->expectException(\\InvalidArgumentException::class);\n\n NativeRc4::decryptData('', ['wrong']);\n } else {\n $hasThrown = null;\n\n try {\n NativeRc4::decryptData('', ['wrong']);\n } catch (\\InvalidArgumentException $exception) {\n $hasThrown = !empty($exception->getMessage());\n } catch (\\Exception $exception) {\n $hasThrown = $exception->getMessage();\n }\n\n $this->assertTrue($hasThrown);\n\n return;\n }\n }", "abstract protected function validate($data);", "private function invalidPayload($data)\n {\n return ! is_array($data) || ! isset($data['iv']) || ! isset($data['str']) || ! isset($data['mac']);\n }", "function validate_password($plain, $encrypted) {\n if (!is_null($plain) && !is_null($encrypted)) {\n // split apart the hash / salt\n $stack = explode(':', $encrypted);\n\n if (sizeof($stack) != 2)\n return false;\n\n if (md5($stack[1] . $plain) == $stack[0]) {\n return true;\n }\n }\n\n return false;\n }", "public function isDataValid(): bool;", "private function validateInputParameters($data)\n {\n }", "protected function validateChecksum() {\n\t}", "abstract public function isValid($data);", "public function testValidationCaseForSettingWrongFormattedStringForPublicKey()\n {\n $protocol = $this->getCryptographicProtocolForTesting();\n\n $exchangeInformation = $protocol->generateExchangeRequestInformation();\n\n // Backward compatible for different versions of PHPUnit\n if (method_exists($this, 'expectException')) {\n $this->expectException(\\InvalidArgumentException::class);\n\n $protocol->computeSharedSecret('яяяя', $exchangeInformation->private);\n } else {\n $hasThrown = null;\n\n try {\n $protocol->computeSharedSecret('яяяя', $exchangeInformation->private);\n } catch (\\InvalidArgumentException $exception) {\n $hasThrown = !empty($exception->getMessage());\n } catch (\\Exception $exception) {\n $hasThrown = $exception->getMessage();\n }\n\n $this->assertTrue($hasThrown);\n\n return;\n }\n }", "private function _validData($data){\n\t\t$columnsLen = array(\n\t\t\t\t\t\t\t'nro_pedido' => 6,\n\t\t\t\t\t\t\t'id_factura_pagos' => 1,\n\t\t\t\t\t\t\t'valor' => 1,\n\t\t\t\t\t\t\t'concepto' => 1,\n\t\t\t\t\t\t\t'fecha_inicio' => 0,\n\t\t\t\t\t\t\t'fecha_fin' => 0,\n\t\t\t\t\t\t\t'id_user' => 1\n\t\t);\n\t\treturn $this->_checkColumnsData($columnsLen, $data);\n\t}", "public function testPlainPassword()\n {\n $user = new User();\n $constraintViolationList = $this->validator->validate($user, null, [User::VALIDATION_GROUP_PLAIN_PASSWORD]);\n Assert::assertEquals('plainPassword', $constraintViolationList->get(0)->getPropertyPath());\n\n $user->setPlainPassword('dd');\n $constraintViolationList = $this->validator->validate($user, null, [User::VALIDATION_GROUP_PLAIN_PASSWORD]);\n Assert::assertEquals('plainPassword', $constraintViolationList->get(0)->getPropertyPath());\n\n\n $user->setPlainPassword($this->createString(128));\n $constraintViolationList = $this->validator->validate($user, null, [User::VALIDATION_GROUP_PLAIN_PASSWORD]);\n Assert::assertEquals('plainPassword', $constraintViolationList->get(0)->getPropertyPath());\n\n }", "public function testValidationCaseForNonStringSecretKeyPassedForDecryption()\n {\n // Backward compatible for different versions of PHPUnit\n if (method_exists($this, 'expectException')) {\n $this->expectException(\\InvalidArgumentException::class);\n\n NativeRc4::decryptData(['wrong'], '');\n } else {\n $hasThrown = null;\n\n try {\n NativeRc4::decryptData(['wrong'], '');\n } catch (\\InvalidArgumentException $exception) {\n $hasThrown = !empty($exception->getMessage());\n } catch (\\Exception $exception) {\n $hasThrown = $exception->getMessage();\n }\n\n $this->assertTrue($hasThrown);\n\n return;\n }\n }", "abstract public function valid();", "public function validateData($data): void;", "public function encryptData($plainData)\n {\n $this->checkIfThePublicKeyIsSet();\n $this->validatePlainData($plainData);\n\n $publicKeyResource = openssl_pkey_get_public(base64_decode($this->publicKey));\n\n // @codeCoverageIgnoreStart\n if ($publicKeyResource === false) {\n throw new \\RuntimeException(\n 'Failed to use the current public key, probably because of ' .\n 'a misconfigured OpenSSL library or an invalid key.'\n );\n }\n // @codeCoverageIgnoreEnd\n\n $chunkSize = (int)ceil(static::KEY_SIZE / 8) - $this->getPaddingReservedSize();\n $needsOnePass = ($plainData === '');\n $cipherData = '';\n\n while ($plainData || $needsOnePass) {\n $dataChunk = substr($plainData, 0, $chunkSize);\n $plainData = substr($plainData, $chunkSize);\n $encryptedChunk = '';\n\n if (!openssl_public_encrypt($dataChunk, $encryptedChunk, $publicKeyResource, $this->padding)) {\n throw new \\InvalidArgumentException('The data encryption failed because of a wrong format');\n }\n\n $cipherData .= $encryptedChunk;\n $needsOnePass = false;\n }\n\n // Free the public key (resource cleanup)\n @openssl_free_key($publicKeyResource);\n $publicKeyResource = null;\n\n return $this->changeOutputFormat($cipherData, true);\n }", "protected function _validate() {\n\t}", "public function valid()\n {\n\n if (strlen($this->container['virtual_operator']) > 60) {\n return false;\n }\n if (strlen($this->container['event_type']) > 100) {\n return false;\n }\n if (strlen($this->container['result_status']) > 100) {\n return false;\n }\n if (strlen($this->container['username']) > 100) {\n return false;\n }\n if (strlen($this->container['property_value']) > 450) {\n return false;\n }\n return true;\n }", "private function validate_input() {\n\t\t$fields = array_merge( array( $this->range_field ), $this->key_fields, $this->checksum_fields );\n\n\t\t$this->validate_fields( $fields );\n\t\t$this->validate_fields_against_table( $fields );\n\t}", "public function validate()\n {\n // generate Token String\n $idTokenString = $this->getTokenString($this->_key);\n return ($idTokenString == $this->_tokenString);\n }", "public function valid() {}", "public function valid() {}", "public function valid() {}", "public function valid() {}", "public function valid() {}", "public function valid() {}", "public function valid() {}", "public function valid() {}", "public function isValid($data);", "function sanitize ($data, $type) {\n if($type == 1){\n for($i = 0; $i < count($data); $i++) {\n $data[$i] = (string)$data[$i]; //ensure is string$\n $data[$i] = preg_replace(\"/[^a-zA-Z0-9 .!\\/]*/\",\"\", $data[$i]); //remove any characters that are not a-z, A-Z, 0-9...\n $data[$i] = substr($data[$i], 0, 20);//restrict length to 20 characters\n $data[$i] = htmlentities($data[$i], ENT_QUOTES, 'utf-8');\n $data[$i] = filter_var($data[$i], FILTER_SANITIZE_STRING);\n }\n //username must be longer than 5 \n //password must be 8 characters or more\n\n if(strlen($data[0]) < 5 || strlen($data[1]) < 8) {\n return false;\n }\n else {\n return $data;\n }\n }\n}", "public function enforceRulePassword($data){\n if (strlen($data) >= 8){\n \t$validPassword= $data;\n \t} \n \telse{\n \t$validPassword= FALSE;\n\t\t\t}\n\t\t\t\n\t\t\t/*if (preg_match (\"/^.*(?=.{8,})(?=.*\\d)(?=.*[a-zA-Z]).*$/\", $data)){\n \t$validPassword= $data;\n \t} \n \telse{\n \t$validPassword= FALSE;\n\t\t\t}*/\n\t\t\t\n\t\t\treturn $validPassword;\n }", "private function ensureSafePassword(string $plainPassword): bool\n\t{\n\t\t$zxcvbn = new Zxcvbn();\n\t\t$passwordData = $zxcvbn->passwordStrength($plainPassword);\n\t\t\n\t\tif ($passwordData['score'] < 2 && $this->app_env !== 'dev')\n\t\t{\n\t\t\t$errorText = \"Password is too weak. {$passwordData['feedback']['warning']}.\";\n\t\t\tthrow new ApiBadRequestException($errorText);\n\t\t}\n\t\t\n\t\treturn true;\n\t}", "public function validateData(){\n if(substr($this->user_id,0,5)!=$this->office_id){\n return false;\n }\n if(in_array($this->email,$this->getEmails())){\n return false;\n }\n return true; \n }", "public function validateData(){\n\t\tif (!self::isEmailValid($this->email))\n\t\t\tthrow new Exception(\"Email address {$this->email} is not a valid email address.\");\n\n\t\tparent::validateData();\n\t}", "abstract public function encrypt($data);", "public function testBinary(): void\n {\n $randomBytes = base64_decode('L3zw8k6jFccVGXr6mqci4Q=='); // random_bytes(16);\n\n $validator = new LengthValidator(16, 16);\n $result = $validator->validate($randomBytes);\n\n $this->assertFalse($result->isValid());\n\n $validator = new LengthValidator(1, 16, multibyte: false);\n $result = $validator->validate($randomBytes);\n\n $this->assertTrue($result->isValid());\n }", "function check_implementation() {\r\n\r\n\t\t$xtea = new XTEA(\"\");\r\n\t\t$vectors = array(\r\n\t\t\tarray(array(0x00000000,0x00000000,0x00000000,0x00000000), array(0x41414141,0x41414141), array(0xed23375a,0x821a8c2d)),\r\n\t\t\tarray(array(0x00010203,0x04050607,0x08090a0b,0x0c0d0e0f), array(0x41424344,0x45464748), array(0x497df3d0,0x72612cb5)),\r\n\r\n\t\t);\r\n\r\n\t\t//Correct implementation?\r\n\t\t$correct = true;\r\n\t\t//Test vectors, see http://www.schneier.com/code/vectors.txt\r\n\t\tforeach($vectors AS $vector) {\r\n \t$key = $vector[0];\r\n\t\t\t$plain = $vector[1];\r\n\t\t\t$cipher = $vector[2];\r\n\r\n\t\t\t$xtea->key_setup($key);\r\n\t\t\t$return = $xtea->block_encrypt($vector[1][0],$vector[1][1]);\r\n\r\n\t\t\tif((int)$return[0] != (int)$cipher[0] || (int)$return[1] != (int)$cipher[1])\r\n\t\t\t\t$correct = false;\r\n\r\n\t\t}\r\n\r\n\t\treturn $correct;\r\n\r\n\t}", "public function sanitiseData(): void\n {\n $this->firstLine = self::sanitiseString($this->firstLine);\n self::validateExistsAndLength($this->firstLine, 1000);\n $this->secondLine = self::sanitiseString($this->secondLine);\n self::validateExistsAndLength($this->secondLine, 1000);\n $this->town = self::sanitiseString($this->town);\n self::validateExistsAndLength($this->town, 255);\n $this->postcode = self::sanitiseString($this->postcode);\n self::validateExistsAndLength($this->postcode, 10);\n $this->county = self::sanitiseString($this->county);\n self::validateExistsAndLength($this->county, 255);\n $this->country = self::sanitiseString($this->country);\n self::validateExistsAndLength($this->country, 255);\n }", "public function validation()\n {\n $this->assertFalse($this->denyValidator->validate(123));\n $this->assertFalse($this->denyValidator->validate('1234'));\n $this->assertFalse($this->denyValidator->validate(true));\n $this->assertFalse($this->denyValidator->validate(null));\n $this->assertFalse($this->denyValidator->validate(new stdClass()));\n }", "public function valid();", "public function valid();", "public function valid();", "public function valid();", "abstract public function validate();", "abstract public function validate();", "private function validateLicenseData()\n {\n\n // error_log('LicenseEmail : '.print_r($this->getLicenseEmail(), 1));\n // error_log('LicenseProduct : '.print_r($this->getLicenseProduct(), 1));\n // error_log('LicenseSecretKey : '.print_r($this->getLicenseSecretKey(), 1));\n }", "public function testValidationCaseForSettingWrongFormattedStringForPrivateKey()\n {\n $protocol = $this->getCryptographicProtocolForTesting();\n\n $exchangeInformation = $protocol->generateExchangeRequestInformation();\n\n // Backward compatible for different versions of PHPUnit\n if (method_exists($this, 'expectException')) {\n $this->expectException(\\InvalidArgumentException::class);\n\n $protocol->computeSharedSecret($exchangeInformation->public, 'яяяя');\n } else {\n $hasThrown = null;\n\n try {\n $protocol->computeSharedSecret($exchangeInformation->public, 'яяяя');\n } catch (\\InvalidArgumentException $exception) {\n $hasThrown = !empty($exception->getMessage());\n } catch (\\Exception $exception) {\n $hasThrown = $exception->getMessage();\n }\n\n $this->assertTrue($hasThrown);\n\n return;\n }\n }", "private function validateData()\n {\n if (empty($this->nome)) {\n $this->errors->addMessage(\"O nome é obrigatório\");\n }\n\n if (!filter_var($this->email, FILTER_VALIDATE_EMAIL)) {\n $this->errors->addMessage(\"O e-mail é inválido\");\n }\n\n if (strlen($this->senha) < 6) {\n $this->errors->addMessage(\"A senha deve ter no minímo 6 caracteres!\");\n }\n if ($this->emailExiste($this->email, 'email')) {\n $this->errors->addMessage(\"Esse e-mail já está cadastrado\");\n }\n if ($this->emailExiste($this->usuario, 'usuario')) {\n $this->errors->addMessage(\"Esse usuário já está cadastrado\");\n }\n\n return $this->errors->hasError();\n }", "function _inputCheck(){\n if (isset($_POST['verder']) && $this->_verify() == \"\") {\n return true;\n }\n else {\n return false;\n }\n }", "public function validateInputData(&$data) {\n $data = trim($data);\n $data = stripslashes($data);\n $data = htmlspecialchars($data);\n }", "public function validateData(){\n return true;\n }", "public function checkIntegrity();", "protected function coreValidatorLogic()\r\n {\r\n foreach($this->filteredInputArray as $key => $urlSafeBase64Token)\r\n {\r\n if($this->testResultsArray[$key] === true) //Only check the ones that passed the PHP Filter validation.\r\n {\r\n $this->testResultsArray[$key] = $this->base64Token($urlSafeBase64Token, $this->validationMetaArray['base64Token'], $this->errorMessagesArray[$key]);\r\n }\r\n }\r\n\r\n return;\r\n }", "public function valid()\n {\n\n if (strlen($this->container['bookingReferenceNumber']) > 15) {\n return false;\n }\n if (strlen($this->container['carrierName']) > 15) {\n return false;\n }\n if (strlen($this->container['ticketNumber']) > 15) {\n return false;\n }\n if (strlen($this->container['checkDigit']) > 1) {\n return false;\n }\n if (strlen($this->container['extendedPaymentCode']) > 3) {\n return false;\n }\n if (strlen($this->container['passengerName']) > 42) {\n return false;\n }\n if (strlen($this->container['customerCode']) > 40) {\n return false;\n }\n if (strlen($this->container['documentType']) > 1) {\n return false;\n }\n if (strlen($this->container['documentNumber']) > 14) {\n return false;\n }\n if (strlen($this->container['invoiceNumber']) > 25) {\n return false;\n }\n if (strlen($this->container['additionalCharges']) > 20) {\n return false;\n }\n if (strlen($this->container['totalFeeAmount']) > 12) {\n return false;\n }\n if (strlen($this->container['clearingSequence']) > 2) {\n return false;\n }\n if (strlen($this->container['clearingCount']) > 2) {\n return false;\n }\n if (strlen($this->container['totalClearingAmount']) > 20) {\n return false;\n }\n if (strlen($this->container['reservationSystemCode']) > 4) {\n return false;\n }\n if (strlen($this->container['processIdentifier']) > 3) {\n return false;\n }\n if (strlen($this->container['ticketIssueDate']) > 8) {\n return false;\n }\n if (strlen($this->container['originalTicketNumber']) > 14) {\n return false;\n }\n if (strlen($this->container['purchaseType']) > 3) {\n return false;\n }\n if (strlen($this->container['creditReasonIndicator']) > 1) {\n return false;\n }\n if (strlen($this->container['ticketChangeIndicator']) > 1) {\n return false;\n }\n if (strlen($this->container['planNumber']) > 1) {\n return false;\n }\n if (strlen($this->container['arrivalDate']) > 8) {\n return false;\n }\n if (strlen($this->container['restrictedTicketDesciption']) > 20) {\n return false;\n }\n if (strlen($this->container['exchangeTicketAmount']) > 12) {\n return false;\n }\n if (strlen($this->container['exchangeTicketFeeAmount']) > 12) {\n return false;\n }\n if (strlen($this->container['reservationType']) > 32) {\n return false;\n }\n if (strlen($this->container['boardingFeeAmount']) > 12) {\n return false;\n }\n return true;\n }", "private function is_malformed($data) {\r\n\r\n if( !in_array($data[0], array_keys($this->header_type)) ){\r\n $this->malformed_msg = \"The transaction type is not known\";\r\n return TRUE;\r\n }\r\n\r\n if( in_array($data[0], array(\"TRNS\", \"SPL\")) AND !in_array($data[1], $this->trnstype) ){\r\n $this->malformed_msg = \"The transaction is multi-line, but the sub-type (e.g. INVOICE, BILL, etc) is not known\";\r\n return TRUE;\r\n }\r\n\r\n if( $this->flag_multi == FALSE AND ($data[0] == \"SPL\" || $data[0] == \"ENDTRNS\") ){\r\n $this->malformed_msg = \"The record is SPL or ENDTRNS, but didn't start with TRNS\";\r\n return TRUE;\r\n }\r\n\r\n if( $this->array_count($data) > count($this->default_headers[$data[0]]) ){\r\n $this->malformed_msg = \"There are more elements in the record, \".count($data).\", than in the header, \".count($this->default_headers[$data[0]]);\r\n return TRUE;\r\n }\r\n\r\n //Check these conditions if not in the first record of the file\r\n if( isset($this->prior_record) ){\r\n if( $this->prior_record[0] == \"TRNS\" AND $data[0] !== \"SPL\" ){\r\n $this->malformed_msg = \"A TRNS record is not followed by an SPL record\";\r\n return TRUE;\r\n }\r\n\r\n if( $this->prior_record[0] == \"SPL\" AND !in_array($data[0], array(\"SPL\", \"ENDTRNS\")) ){\r\n $this->malformed_msg = \"An SPL record is not followed by another SPL record or ENDTRNS\";\r\n return TRUE;\r\n }\r\n }\r\n \r\n //Reaching this point means that the record is not malformed\r\n return FALSE;\r\n }", "public function validDataTypes();", "abstract protected function safetyCheck() : self;", "public function valid()\n {\n return $this->key() < $this->filesize;\n }", "public function isPasswordValid(string $encoded, string $raw);", "public function encrypt($plain, $private) {\n\n\t\t/**\n\t\t* Checking Parameters Existence - if value of plain-text or private-key is null,\n\t\t* then method returns (boolean)false directly.\n\t\t*/\n\t\tif(strlen($plain) == 0 || strlen($private) == 0) return false;\n\n\t\t/**\n\t\t* Reset all object\n\t\t*/\n\t\t$this->copy();\n\n\t\t/**\n\t\t* Preparing Data - store all parameters to the objects.\n\t\t*/\n\t\t$this->plain->value = $plain;\n\t\t$this->private->value = $private;\n\t\t$this->plain->length = strlen($plain);\n\t\t$this->private->length = strlen($private);\n\n\t\t/**\n\t\t* Generate Random Key - this random key in integer will be used to encrypt data.\n\t\t* Random key format is in integer between 1 to 61.\n\t\t*/\n\t\t$this->public->randomKey = rand(1,61);\n\n\t\t/**\n\t\t* Converting plain-text to ASCII.\n\t\t* @see src/Controller.php\n\t\t* @see Controlller::stringToAscii()\n\t\t*/\n\t\t$this->plain->ascii = $this->stringToAscii($this->plain->value);\n\n\t\t/**\n\t\t* Converting private-key to ASCII\n\t\t* @see src/Controller.php\n\t\t* @see Controlller::privateToAscii()\n\t\t*/\n\t\t$this->privateToAscii();\t\t\n\n\t\t/**\n\t\t* Getting Even & Odd Integer that will be added for each plain-text\n\t\t* @see src/Controller.php\n\t\t* @see Controlller::evenOddMapping()\n\t\t*/\n\t\t$this->evenOddMapping();\n\n\t\t/**\n\t\t* Map each plain-text's character key from private-key\n\t\t* @see src/Controller.php\n\t\t* @see Controlller::keysMapping()\n\t\t*/\n\t\t$this->keysMapping();\n\n\t\t/**\n\t\t * Converting Numberal to Alphabet\n\t\t * @see src/Controller.php\n\t\t * @see Controller::numberToAlpha()\n\t\t */\n\t\t$this->process->exchange = $this->numberToAlpha($this->process->exchange);\n\n\t\t/**\n\t\t * Calculate each character\n\t\t * @see src/Controller.php\n\t\t * @see Controller::CharCategories()\n\t\t */\n\t\t$this->CharCategories();\n\n\t\t/**\n\t\t * Processing Huffman algorithm\n\t\t * @see src/Controller.php\n\t\t * @see Controller::huffmanBinary()\n\t\t */\n\t\t$this->huffmanBinary();\n\t\t\n\t\t/**\n\t\t * Converting Data to Huffman Binary\n\t\t * @see src/basic/EncryptStepMethods.php\n\t\t * @see EncryptStepMethods::exToCipher()\n\t\t */\n\t\t$this->exToCipher();\n\n\t\t/**\n\t\t * Processing Public-key\n\t\t * \n\t\t * This is how public-key generated base on randomKey, plain-text, and\n\t\t * and private-key as well.\n\t\t */\t\t\n\t\tforeach($this->process->order as $key => $value) {\n\t\t\t$this->process->order[$key] = $value + $this->public->randomKey;\n\t\t}\n\n\t\t$this->public->json = json_encode($this->process->order);\n\t\tfor($i=0; $i<strlen($this->public->json); $i++) { \n\t\t\t$x = str_pad(ord($this->public->json[$i]), 3, '0', STR_PAD_LEFT);\n\t\t\t$this->public->jsonAscii .= $x;\n\t\t}\n\n\t\t$this->public->jsonAscii = str_split($this->public->jsonAscii, $this->process->split);\n\t\tforeach($this->public->jsonAscii as $key => $value) {\n\t\t\t$this->public->jsonAscii[$key] = '1' . str_pad(Troop::fromDec(intval(\"1{$value}\")), $this->process->pad, '0', STR_PAD_LEFT);\n\t\t}\n\n\t\t$this->encrypt->public_key = Troop::fromDec(intval($this->public->randomKey)) . $this->process->minAscii . $this->process->maxAscii . implode('', $this->public->jsonAscii);\n\n\t\t/**\n\t\t * Return of encryption\n\t\t */\n\t\treturn new Request([\n\t\t\t'plain_text' => $plain,\n\t\t\t'cipher_text' => $this->encrypt->cipher,\n\t\t\t'public_key' => $this->encrypt->public_key,\n\t\t\t'private_key' => $private,\n\t\t]);\n\t}", "public function isDataValid() {\n if ($this->userExists())\n $this->_errors[] = 'username already taken';\n // username and password must match pattern\n else if (empty($this->_username) || !preg_match('/^[a-zA-Z0-9]{5,16}$/', $this->_username))\n $this->_errors[] = 'invalid username must be between 5 and 16 characters';\n else if (empty($this->_password) || !preg_match('/^[a-zA-Z0-9]{6,18}$/', $this->_password))\n $this->_errors[] = 'invalid password must be between 6 and 18 characters';\n\t\t else if (empty($this->_password) || $this->_password != $this->_password_confirm)\n $this->_errors[] = \"Password didn't match X\";\n // names must be between 2 and 22 characters\n else if (empty($this->_first_name) || !preg_match('/^[a-zA-Z0-9]{2,22}$/', $this->_first_name))\n $this->_errors[] = 'invalid first name must be between 2 and 22 characters';\n else if (empty($this->_last_name) || !preg_match('/^[a-zA-Z0-9]{2,22}$/', $this->_last_name))\n $this->_errors[] = 'invalid last name must be between 2 and 22 characters';\n //restricts day to 01-31, month to 01-12 and year to 1900-2099 (also allowing / - or . between the parts of the date) \n else if (empty($this->_dob) || !preg_match('/^(0?[1-9]|[12][0-9]|3[01])[\\/\\ ](0?[1-9]|1[0-2])[\\/\\ ](19|20)\\d{2}$/', $this->_dob))\n $this->_errors[] = 'invalid dod | must be DD/MM/YYYY format';\n else if (empty($this->_address))\n $this->_errors[] = 'invalid address';\n // checks if valid postal code\n else if (empty($this->_postcode) || !preg_match('/^(([A-PR-UW-Z]{1}[A-IK-Y]?)([0-9]?[A-HJKS-UW]?[ABEHMNPRVWXY]?|[0-9]?[0-9]?))\\s?([0-9]{1}[ABD-HJLNP-UW-Z]{2})$/', $this->_postcode))\n $this->_errors[] = 'invalid postcode | must be AA11 9AA format';\n // checks is valid email using regular expression\n else if (empty($this->_email) || !preg_match('/^[_\\.0-9a-zA-Z-]+@([0-9a-zA-Z][0-9a-zA-Z-]+\\.)+[a-zA-Z]{2,6}$/', $this->_email))\n $this->_errors[] = 'invalid email';\n\n\n // return true or false \n return count($this->_errors) ? 0 : 1;\n }", "public function checkInput($data) {\n\n if(strlen($data) >= 1){\n $data = trim($data); //remove \\n, \\r, \\t doesn't remove spaces between words, if wanted than use -> str_replace(\" \", \"\", trim($data));\n return $data;\n }else{\n return false;\n }\n\n }", "public function isValid() {\n\t\treturn !is_array($this->data) && count($this->data->getRawData()) > 0;\n\t}", "private function validate () {\n $payload = $this->payload;\n // Unset fields that don't match the spec\n foreach (array_keys($payload) as $field) {\n if (!in_array($field, $this->fields)) {\n unset($payload[$field]);\n }\n }\n\n // If the user is signing up manually (I.e. not via a social network), then\n // we also need a password\n if ($this->method === 'manual' && empty($payload['password'])) {\n return false;\n }\n\n $this->payload = $payload;\n return true;\n }", "private function ValidateTranslationFields()\t\n\t{\n\t\t// check for required fields\t\t\n\t\tforeach($this->arrTranslations as $key => $val){\t\t\t\n\t\t\tif(strlen($val['image_text']) > 2048){\n\t\t\t\t$this->error = str_replace('_FIELD_', '<b>'._DESCRIPTION.'</b>', _FIELD_LENGTH_EXCEEDED);\n\t\t\t\t$this->error = str_replace('_LENGTH_', 2048, $this->error);\n\t\t\t\t$this->errorField = 'image_text_'.$key;\n\t\t\t\treturn false;\n\t\t\t}\t\t\t\n\t\t}\t\t\n\t\treturn true;\t\t\n\t}", "private function isValidData($data) {\n\t\tif (!is_string($data) && !is_int($data) && !is_float($data) && !is_array($data)) {\n\t\t\tthrow new FlintstoneException('Invalid data type');\n\t\t}\n\n\t\treturn true;\n\t}", "function ValidateData()\n\t\t{\n\t\t\t$theValidator = new CValidator();\n\t\t\tif(!$this->arrValidator || !is_array($this->arrValidator) )\n\t\t\t{\n\t\t\t\t$this->arrValidator = array();\n\t\t\t}\n\t\t\tforeach($this->arrValidator as $key=>$value)\n\t\t\t{\n\t\t\t\tif($this->$key == '')\n\t\t\t\t{\n\t\t\t\t\t// Kiem tra xem co phai bat buoc khong?\n\t\t\t\t\tif(isset($this->arrRequired[$key]) && ($this->arrRequired[$key] == 1))\n\t\t\t\t\t{\n\t\t\t\t\t\treturn(false);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif(!$theValidator->CheckPatt($value, $this->$key))\n\t\t\t\t\t{\n\t\t\t\t\t\treturn(false);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn(true);\n\t\t}", "abstract public function verify($data, $signature);", "public function valid()\n {\n\n $allowedValues = $this->getTransformAllowableValues();\n if (!in_array($this->container['transform'], $allowedValues)) {\n return false;\n }\n $allowedValues = $this->getWrapTextAllowableValues();\n if (!in_array($this->container['wrapText'], $allowedValues)) {\n return false;\n }\n $allowedValues = $this->getAnchoringTypeAllowableValues();\n if (!in_array($this->container['anchoringType'], $allowedValues)) {\n return false;\n }\n $allowedValues = $this->getCenterTextAllowableValues();\n if (!in_array($this->container['centerText'], $allowedValues)) {\n return false;\n }\n $allowedValues = $this->getTextVerticalTypeAllowableValues();\n if (!in_array($this->container['textVerticalType'], $allowedValues)) {\n return false;\n }\n $allowedValues = $this->getAutofitTypeAllowableValues();\n if (!in_array($this->container['autofitType'], $allowedValues)) {\n return false;\n }\n return true;\n }", "public function is_valid()\n {\n }", "public function isPasswordValid($encoded, $raw, $salt)\n {\n\n }", "public function is_valid()\n {\n }", "public function validate($data) {\n return true;\n }", "function validate_password($hashed_password, $cleartext_password) {\n if (!is_string($hashed_password) || !is_string($cleartext_password))\n return false;\n if (config\\HASHING_ALGORITHM == \"crypt\") {\n $salt_end = strrpos($hashed_password, \"$\");\n if ($salt_end === false) {\n // DES, first two charachers is salt.\n $salt = substr($hashed_password, 0, 2);\n } else {\n // Salt before $.\n $salt_end++;\n $salt = substr($hashed_password, 0, $salt_end);\n }\n return crypt($cleartext_password, $salt) == $hashed_password;\n } else if (config\\HASHING_ALGORITHM == \"sha1\") {\n if (strlen($hashed_password) != 80)\n return false;\n $salt = substr($hashed_password, 0, 40);\n $hash = substr($hashed_password, 40);\n return $hash == sha1($salt . $cleartext_password, false);\n } else if (config\\HASHING_ALGORITHM == \"md5\") {\n if (strlen($hashed_password) != 64)\n return false;\n $salt = substr($hashed_password, 0, 32);\n $hash = substr($hashed_password, 32);\n return $hash == sha1($salt . $cleartext_password, false);\n } else\n trigger_error(\"The configured hashing algorithm '\" . config\\HASHING_ALGORITHM . \"' is not supported.\", \\E_USER_ERROR);\n}", "function check_plain($text) {\n return validate_utf8($text) ? htmlspecialchars($text, ENT_QUOTES) : '';\n}", "public final function verifySetData(){\n\n foreach($this->data as $k => $v){\n $this->verifyData($k);\n }//foreach\n\n if(count($this->errors)){\n return false;\n }//if\n\n return true;\n\n }", "function validate()\n\t{\n\t\t$isValid = false;\n\t\t\n\t\tif(empty($this->data['username']))\n\t\t{\n\t\t\t\t$this->errors['username'] = \"Please enter a Username\";\n\t\t}\n\t\t\n\t\tif(empty($this->data['password']))\n\t\t{\n\t\t\t\t$this->errors['password'] = \"Please enter a password\";\n\t\t}\n\t\t\n\t\tif(empty($this->data['description']))\n\t\t{\n\t\t\t\t$this->errors['description'] = \"Please enter a description of yourself\";\n\t\t}\n\t\t\n\t\t\n\t\t//validate data elements in userData property\n\t\t//if an error exists, store to errors using column name as key\n\t\t\n\t\t if(empty($this->errors))\n\t\t{\n\t\t\t$isValid = true;\n\t\t}\n\t\t\n\t\treturn $isValid;\n\t}", "public function validated();", "public function testEncryptEmailA() {\n // Encrypted email\n $encrypted_email = security::encrypt_email( '[email protected]', '', false );\n\n // Proper email =\n // Make sure it's 15 characters\n $this->assertEquals( 'john&#64;doe&#46;&#99;&#111;&#109;', $encrypted_email );\n }", "protected function prepareValidations() {}", "public function testPasswordIsValid($data)\n {\n $pattern = \"/^(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[0-9])(?=.*?[#?!@$%^&*-]).{8,}$/\";\n\n $this->assertMatchesRegularExpression($pattern,$data);\n\n }", "public function isValid()\n\t{\n\t\tif (empty($this->titre)) $this->titre = \"TITRE A REMPLACER\";\n\t\telse $this->titre = trim (preg_replace('/\\s+/', ' ', $this->titre) ); // Suppression des espaces\n\t\tif (!empty($this->contenu)) $this->contenu = trim (preg_replace('/\\s+/', ' ', $this->contenu) ); // Suppression des espaces\n\t\tif (empty($this->statut)) $this->statut = 0;\n\t\tif (empty($this->id_type)) $this->id_type = 1;\n\t\tif (empty($this->id_membre)) $this->id_membre = 0;\n\t}", "function validateInput($data)\n{\n $data = trim($data); //Strip unnecessary characters (extra space, tab, newline)\n $data = stripslashes($data); //Remove backslashes (\\)\n $data = htmlspecialchars($data, ENT_NOQUOTES, 'UTF-8');\n return $data;\n}", "protected function _verifyExtraData(&$extraData)\r\n\t{\r\n\t\tif ($extraData === null)\r\n\t\t{\r\n\t\t\t$extraData = '';\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\treturn XenForo_DataWriter_Helper_Denormalization::verifySerialized($extraData, $this, 'extra_data');\r\n\t}", "public function checkTrustData($data)\n {\n if (is_array($this->_props) && count($this->_props) > 0) {\n $props = array();\n $name = get_class();\n if (isset($data[$name])) {\n $props = $data[$name];\n } else {\n $props = array();\n }\n $props2 = array();\n foreach ($this->_props as $prop => $req) {\n if (empty($props[$prop])) {\n if ($req) {\n return false;\n }\n } else {\n $props2[$prop] = $props[$prop];\n }\n }\n $this->_props = (count($props2) > 0) ? $props2 : null;\n }\n return true;\n }", "protected function checkStructure()\n {\n $structure = $this->getStructure();\n\n foreach ($structure as $field => $opt) {\n if (!array_key_exists($field, $this->data)) {\n continue;\n }\n\n $value = Arr::get($this->data, $field);\n if (is_array($value)) {\n $this->errors[$field][] = Translate::get('validate_wrong_type_data');\n continue;\n }\n\n $value = trim($value);\n $length = (int)$opt->length;\n\n if (!empty($length)) {\n $len = mb_strlen($value);\n if ($len > $length) {\n $this->errors[$field][] = Translate::getSprintf('validate_max_length', $length);\n continue;\n }\n }\n\n if (!$opt->autoIncrement && $opt->default === NULL && !$opt->allowNull && $this->isEmpty($value)) {\n $this->errors[$field][] = Translate::get('validate_not_empty');\n continue;\n }\n\n switch ($opt->dataType) {\n case 'int':\n case 'bigint':\n if (!$this->isEmpty($value) && (filter_var($value, FILTER_VALIDATE_INT) === false)) {\n $this->errors[$field][] = Translate::get('validate_int');\n continue 2;\n }\n break;\n\n case 'double':\n if (!is_float($value) && !$this->isEmpty($value)) {\n $this->errors[$field][] = Translate::get('validate_double');\n continue 2;\n }\n break;\n\n case 'float':\n if (!is_numeric($value) && !$this->isEmpty($value)) {\n $this->errors[$field][] = Translate::get('validate_float');\n continue 2;\n }\n break;\n\n case 'date':\n case 'datetime':\n case 'timestamp':\n if (!$this->isEmpty($value) && !Validate::dateSql($value)) {\n $this->errors[$field][] = Translate::get('validate_sql_date');\n continue 2;\n }\n break;\n\n default:\n continue 2;\n break;\n\n }\n }\n }", "public function testEncryptA() {\n // Initialize variables\n $string = 'Hello World!';\n\n // Encrypt string\n $encrypted_string = security::encrypt( $string, 'random-hash' );\n\n // Make sure it's not there\n $this->assertFalse( stristr( $encrypted_string, $string ) );\n }", "protected function validateCipherOrSignatureData($cipherOrSignatureData)\n {\n if (!is_string($cipherOrSignatureData)) {\n throw new \\InvalidArgumentException(\"The data for decryption must be a string or a binary string.\");\n } elseif ($cipherOrSignatureData === '') {\n throw new \\InvalidArgumentException(\"The string is empty and there is nothing to decrypt from it.\");\n }\n\n $chunkSize = (int)ceil(static::KEY_SIZE / 8);\n $rawDataSize = strlen($this->changeOutputFormat($cipherOrSignatureData, false));\n\n if ($this->useChunks === false && $rawDataSize > $chunkSize) {\n throw new \\InvalidArgumentException(\n \"The data for decryption must be less or equal of $chunkSize bytes. Another option is \" .\n \"to allow chunk processing via the `enableChunkProcessing` method, which is not recommended.\"\n );\n } elseif ($rawDataSize % $chunkSize !== 0) {\n throw new \\InvalidArgumentException(\n \"The data length for decryption must dividable by $chunkSize byte blocks.\"\n );\n }\n }", "public function testNotString(): void\n {\n $validator = new LengthValidator();\n $result = $validator->validate(9);\n\n $this->assertFalse($result->isValid());\n }", "function sanitizePassword() {\n // If there is a password confirmation we put it to the checker, too\n $passCheckerInput = (strlen($this->passwordConf) > 0) ?\n array($this->password, $this->passwordConf) : $this->password;\n $passwordChecker = new PasswordChecker($passCheckerInput);\n if ($passwordChecker->getRelevance()) {\n $this->password = htmlspecialchars($this->password);\n } else {\n die(\"Error. Check your form data\");\n }\n }" ]
[ "0.7045691", "0.6626759", "0.6406262", "0.6373728", "0.6133701", "0.60577077", "0.6043969", "0.6041955", "0.6041955", "0.5992711", "0.5856533", "0.58358836", "0.5796604", "0.5782164", "0.5779227", "0.57707155", "0.5724287", "0.5719811", "0.565119", "0.56397414", "0.5616948", "0.56120515", "0.56104434", "0.5531062", "0.5508429", "0.5490124", "0.5488138", "0.54757035", "0.5470695", "0.5463613", "0.54500484", "0.54500484", "0.54500484", "0.54500484", "0.54500484", "0.54500484", "0.54500484", "0.54500484", "0.5440045", "0.53875023", "0.53643006", "0.5357226", "0.53509825", "0.5348007", "0.53333855", "0.5330777", "0.5320196", "0.5292983", "0.5282327", "0.5272904", "0.5272904", "0.5272904", "0.5272904", "0.5265828", "0.5265828", "0.52630544", "0.52589226", "0.5258068", "0.52543586", "0.524164", "0.5239138", "0.5237361", "0.52364224", "0.5229028", "0.5228069", "0.52230185", "0.5221843", "0.5210817", "0.52071774", "0.52044356", "0.519789", "0.51914847", "0.5189829", "0.5180979", "0.51800025", "0.5178281", "0.5175985", "0.51673275", "0.5163765", "0.5158454", "0.5157756", "0.5156456", "0.5155326", "0.51489246", "0.5145885", "0.51437736", "0.5142107", "0.5139758", "0.5135697", "0.5134816", "0.5128946", "0.51271033", "0.51222986", "0.51213783", "0.5116244", "0.5112816", "0.5112045", "0.5108277", "0.51074684", "0.5103909" ]
0.8719335
0
Internal method for the validation of cipher data used at decryption operations.
abstract protected function validateCipherDataForDecryption($cipherData);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract protected function validatePlainDataForEncryption($plainData);", "public function testValidationCaseForNonStringInputDataPassedForDecryption()\n {\n // Backward compatible for different versions of PHPUnit\n if (method_exists($this, 'expectException')) {\n $this->expectException(\\InvalidArgumentException::class);\n\n NativeRc4::decryptData('', ['wrong']);\n } else {\n $hasThrown = null;\n\n try {\n NativeRc4::decryptData('', ['wrong']);\n } catch (\\InvalidArgumentException $exception) {\n $hasThrown = !empty($exception->getMessage());\n } catch (\\Exception $exception) {\n $hasThrown = $exception->getMessage();\n }\n\n $this->assertTrue($hasThrown);\n\n return;\n }\n }", "public function testValidationCaseForNonStringSecretKeyPassedForDecryption()\n {\n // Backward compatible for different versions of PHPUnit\n if (method_exists($this, 'expectException')) {\n $this->expectException(\\InvalidArgumentException::class);\n\n NativeRc4::decryptData(['wrong'], '');\n } else {\n $hasThrown = null;\n\n try {\n NativeRc4::decryptData(['wrong'], '');\n } catch (\\InvalidArgumentException $exception) {\n $hasThrown = !empty($exception->getMessage());\n } catch (\\Exception $exception) {\n $hasThrown = $exception->getMessage();\n }\n\n $this->assertTrue($hasThrown);\n\n return;\n }\n }", "public function validate(array $data) : bool\n {\n // If we dont have all the required parts for decryption exit.\n if (! isset( $data['iv'], $data['data'], $data['mac'])) {\n return false;\n }\n\n // If the extracted iv is invalid exit.\n $iv = base64_decode($data['iv']);\n\n if (strlen( $iv ) !== SODIUM_CRYPTO_SECRETBOX_NONCEBYTES) {\n return false;\n }\n\n return hash_equals($this->hash(base64_decode($data['data']), $iv), $data['mac']);\n }", "public function testValidationCaseForNonStringInputDataPassedForEncryption()\n {\n // Backward compatible for different versions of PHPUnit\n if (method_exists($this, 'expectException')) {\n $this->expectException(\\InvalidArgumentException::class);\n\n NativeRc4::encryptData('', ['wrong']);\n } else {\n $hasThrown = null;\n\n try {\n NativeRc4::encryptData('', ['wrong']);\n } catch (\\InvalidArgumentException $exception) {\n $hasThrown = !empty($exception->getMessage());\n } catch (\\Exception $exception) {\n $hasThrown = $exception->getMessage();\n }\n\n $this->assertTrue($hasThrown);\n\n return;\n }\n }", "public function testValidationCaseForNonStringSecretKeyPassedForEncryption()\n {\n // Backward compatible for different versions of PHPUnit\n if (method_exists($this, 'expectException')) {\n $this->expectException(\\InvalidArgumentException::class);\n\n NativeRc4::encryptData(['wrong'], '');\n } else {\n $hasThrown = null;\n\n try {\n NativeRc4::encryptData(['wrong'], '');\n } catch (\\InvalidArgumentException $exception) {\n $hasThrown = !empty($exception->getMessage());\n } catch (\\Exception $exception) {\n $hasThrown = $exception->getMessage();\n }\n\n $this->assertTrue($hasThrown);\n\n return;\n }\n }", "abstract public function validateData();", "protected function validateCipherOrSignatureData($cipherOrSignatureData)\n {\n if (!is_string($cipherOrSignatureData)) {\n throw new \\InvalidArgumentException(\"The data for decryption must be a string or a binary string.\");\n } elseif ($cipherOrSignatureData === '') {\n throw new \\InvalidArgumentException(\"The string is empty and there is nothing to decrypt from it.\");\n }\n\n $chunkSize = (int)ceil(static::KEY_SIZE / 8);\n $rawDataSize = strlen($this->changeOutputFormat($cipherOrSignatureData, false));\n\n if ($this->useChunks === false && $rawDataSize > $chunkSize) {\n throw new \\InvalidArgumentException(\n \"The data for decryption must be less or equal of $chunkSize bytes. Another option is \" .\n \"to allow chunk processing via the `enableChunkProcessing` method, which is not recommended.\"\n );\n } elseif ($rawDataSize % $chunkSize !== 0) {\n throw new \\InvalidArgumentException(\n \"The data length for decryption must dividable by $chunkSize byte blocks.\"\n );\n }\n }", "abstract public function decrypt($data);", "private function invalidPayload($data)\n {\n return ! is_array($data) || ! isset($data['iv']) || ! isset($data['str']) || ! isset($data['mac']);\n }", "function isDataValid() \n {\n return true;\n }", "abstract public function validateData($data);", "protected function _decrypt() {}", "protected function _decrypt() {}", "private function validateInputParameters($data)\n {\n }", "private function _validData($data){\n\t\t$columnsLen = array(\n\t\t\t\t\t\t\t'nro_pedido' => 6,\n\t\t\t\t\t\t\t'id_factura_pagos' => 1,\n\t\t\t\t\t\t\t'valor' => 1,\n\t\t\t\t\t\t\t'concepto' => 1,\n\t\t\t\t\t\t\t'fecha_inicio' => 0,\n\t\t\t\t\t\t\t'fecha_fin' => 0,\n\t\t\t\t\t\t\t'id_user' => 1\n\t\t);\n\t\treturn $this->_checkColumnsData($columnsLen, $data);\n\t}", "protected function validatePlainData($plainData)\n {\n if (!is_string($plainData)) {\n throw new \\InvalidArgumentException(\"The data for encryption must be a string or a binary string.\");\n } elseif ($this->useChunks === false) {\n $chunkSize = (int)ceil(static::KEY_SIZE / 8) - $this->getPaddingReservedSize();\n\n if (strlen($plainData) > $chunkSize) {\n throw new \\InvalidArgumentException(\n \"The data for encryption must be less or equal of $chunkSize bytes. Another option is \" .\n \"to allow chunk processing via the `enableChunkProcessing` method, which is not recommended.\"\n );\n }\n }\n }", "public function valid()\n {\n return $this->key() < $this->filesize;\n }", "private function validateLicenseData()\n {\n\n // error_log('LicenseEmail : '.print_r($this->getLicenseEmail(), 1));\n // error_log('LicenseProduct : '.print_r($this->getLicenseProduct(), 1));\n // error_log('LicenseSecretKey : '.print_r($this->getLicenseSecretKey(), 1));\n }", "public function DataIsValid()\n {\n $bDataIsValid = parent::DataIsValid();\n if ($this->HasContent() && $bDataIsValid) {\n if (intval($this->data) < 12 && intval($this->data) >= -11) {\n $bDataIsValid = true;\n } else {\n $bDataIsValid = false;\n $oMessageManager = TCMSMessageManager::GetInstance();\n $sConsumerName = TCMSTableEditorManager::MESSAGE_MANAGER_CONSUMER;\n $sFieldTitle = $this->oDefinition->GetName();\n $oMessageManager->AddMessage($sConsumerName, 'TABLEEDITOR_FIELD_TIMEZONE_NOT_VALID', array('sFieldName' => $this->name, 'sFieldTitle' => $sFieldTitle));\n }\n }\n\n return $bDataIsValid;\n }", "public function checkData() {\n\t\t// e.g. numbers must only have digits, e-mail addresses must have a \"@\" and a \".\".\n\t\treturn $this->control->checkPOST($this);\n\t}", "public function checkData() {\n\t\t// e.g. numbers must only have digits, e-mail addresses must have a \"@\" and a \".\".\n\t\treturn $this->control->checkPOST($this);\n\t}", "protected function validateChecksum() {\n\t}", "abstract protected function validate($data);", "public function valid()\n {\n\n if (strlen($this->container['bookingReferenceNumber']) > 15) {\n return false;\n }\n if (strlen($this->container['carrierName']) > 15) {\n return false;\n }\n if (strlen($this->container['ticketNumber']) > 15) {\n return false;\n }\n if (strlen($this->container['checkDigit']) > 1) {\n return false;\n }\n if (strlen($this->container['extendedPaymentCode']) > 3) {\n return false;\n }\n if (strlen($this->container['passengerName']) > 42) {\n return false;\n }\n if (strlen($this->container['customerCode']) > 40) {\n return false;\n }\n if (strlen($this->container['documentType']) > 1) {\n return false;\n }\n if (strlen($this->container['documentNumber']) > 14) {\n return false;\n }\n if (strlen($this->container['invoiceNumber']) > 25) {\n return false;\n }\n if (strlen($this->container['additionalCharges']) > 20) {\n return false;\n }\n if (strlen($this->container['totalFeeAmount']) > 12) {\n return false;\n }\n if (strlen($this->container['clearingSequence']) > 2) {\n return false;\n }\n if (strlen($this->container['clearingCount']) > 2) {\n return false;\n }\n if (strlen($this->container['totalClearingAmount']) > 20) {\n return false;\n }\n if (strlen($this->container['reservationSystemCode']) > 4) {\n return false;\n }\n if (strlen($this->container['processIdentifier']) > 3) {\n return false;\n }\n if (strlen($this->container['ticketIssueDate']) > 8) {\n return false;\n }\n if (strlen($this->container['originalTicketNumber']) > 14) {\n return false;\n }\n if (strlen($this->container['purchaseType']) > 3) {\n return false;\n }\n if (strlen($this->container['creditReasonIndicator']) > 1) {\n return false;\n }\n if (strlen($this->container['ticketChangeIndicator']) > 1) {\n return false;\n }\n if (strlen($this->container['planNumber']) > 1) {\n return false;\n }\n if (strlen($this->container['arrivalDate']) > 8) {\n return false;\n }\n if (strlen($this->container['restrictedTicketDesciption']) > 20) {\n return false;\n }\n if (strlen($this->container['exchangeTicketAmount']) > 12) {\n return false;\n }\n if (strlen($this->container['exchangeTicketFeeAmount']) > 12) {\n return false;\n }\n if (strlen($this->container['reservationType']) > 32) {\n return false;\n }\n if (strlen($this->container['boardingFeeAmount']) > 12) {\n return false;\n }\n return true;\n }", "abstract public function isValid($data);", "public function isDataValid(): bool;", "function decryptData($data, $key) {\r\n $chiper = \"des-ede3\"; //Algorthim used to decrypt\r\n $data = $this->hex2ByteArray($data);\r\n $data = $this->byteArray2String($data);\r\n $data = base64_encode($data);\r\n $iv = openssl_random_pseudo_bytes(openssl_cipher_iv_length($chiper));\r\n $decrypted = openssl_decrypt($data, $chiper, $key, OPENSSL_ZERO_PADDING,$iv);\r\n return $decrypted;\r\n}", "function ValidateData()\n\t\t{\n\t\t\t$theValidator = new CValidator();\n\t\t\tif(!$this->arrValidator || !is_array($this->arrValidator) )\n\t\t\t{\n\t\t\t\t$this->arrValidator = array();\n\t\t\t}\n\t\t\tforeach($this->arrValidator as $key=>$value)\n\t\t\t{\n\t\t\t\tif($this->$key == '')\n\t\t\t\t{\n\t\t\t\t\t// Kiem tra xem co phai bat buoc khong?\n\t\t\t\t\tif(isset($this->arrRequired[$key]) && ($this->arrRequired[$key] == 1))\n\t\t\t\t\t{\n\t\t\t\t\t\treturn(false);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif(!$theValidator->CheckPatt($value, $this->$key))\n\t\t\t\t\t{\n\t\t\t\t\t\treturn(false);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn(true);\n\t\t}", "public function validate()\n {\n // generate Token String\n $idTokenString = $this->getTokenString($this->_key);\n return ($idTokenString == $this->_tokenString);\n }", "public function testIsValidKeyWithInvalidKey() \n {\n $result = $this->fileCache->isValidKey('');\n $expected = FALSE;\n\n $this->assertEquals($expected, $result);\n }", "public function testUnicodeDataEncryptionAndDataDecryption()\n {\n $unicodeData = \"яJx 3!Й$\\v@UdrЯЗЮ\"; // length => NativeRc4::KEY_SIZE\n $randomKey = random_bytes(NativeRc4::KEY_SIZE);\n\n $encryptedData = NativeRc4::encryptData($randomKey, $unicodeData);\n $decryptedData = NativeRc4::decryptData($randomKey, $encryptedData);\n\n $this->assertEquals($unicodeData, $decryptedData);\n\n if (in_array(strtolower(Rc4::ALGORITHM_NAME), openssl_get_cipher_methods(), true)) {\n $this->assertEquals(\n $unicodeData,\n openssl_decrypt($encryptedData, 'RC4', $randomKey, OPENSSL_RAW_DATA, '')\n );\n }\n }", "public function validation()\n {\n $this->assertFalse($this->denyValidator->validate(123));\n $this->assertFalse($this->denyValidator->validate('1234'));\n $this->assertFalse($this->denyValidator->validate(true));\n $this->assertFalse($this->denyValidator->validate(null));\n $this->assertFalse($this->denyValidator->validate(new stdClass()));\n }", "public function valid()\n {\n\n if (strlen($this->container['virtual_operator']) > 60) {\n return false;\n }\n if (strlen($this->container['event_type']) > 100) {\n return false;\n }\n if (strlen($this->container['result_status']) > 100) {\n return false;\n }\n if (strlen($this->container['username']) > 100) {\n return false;\n }\n if (strlen($this->container['property_value']) > 450) {\n return false;\n }\n return true;\n }", "public static function aes128Decrypt($key, $data) {}", "public function testValidationCaseForSettingWrongFormattedStringForPrivateKey()\n {\n $protocol = $this->getCryptographicProtocolForTesting();\n\n $exchangeInformation = $protocol->generateExchangeRequestInformation();\n\n // Backward compatible for different versions of PHPUnit\n if (method_exists($this, 'expectException')) {\n $this->expectException(\\InvalidArgumentException::class);\n\n $protocol->computeSharedSecret($exchangeInformation->public, 'яяяя');\n } else {\n $hasThrown = null;\n\n try {\n $protocol->computeSharedSecret($exchangeInformation->public, 'яяяя');\n } catch (\\InvalidArgumentException $exception) {\n $hasThrown = !empty($exception->getMessage());\n } catch (\\Exception $exception) {\n $hasThrown = $exception->getMessage();\n }\n\n $this->assertTrue($hasThrown);\n\n return;\n }\n }", "protected function _validate() {\n\t}", "function new_decrypt($data, $key) {\n if(empty($key)){\n $key = $encryption_key;\n }\n // Remove the base64 encoding from our key\n $encryption_key = base64_decode($key);\n // To decrypt, split the encrypted data from our IV - our unique separator used was \"::\"\n list($encrypted_data, $iv) = explode('::', base64_decode($data), 2);\n return openssl_decrypt($encrypted_data, 'aes-256-cbc', $encryption_key, 0, $iv);\n}", "private function validate_input() {\n\t\t$fields = array_merge( array( $this->range_field ), $this->key_fields, $this->checksum_fields );\n\n\t\t$this->validate_fields( $fields );\n\t\t$this->validate_fields_against_table( $fields );\n\t}", "public function validateData($data): void;", "public function testValidationCaseForSettingWrongFormattedStringForPublicKey()\n {\n $protocol = $this->getCryptographicProtocolForTesting();\n\n $exchangeInformation = $protocol->generateExchangeRequestInformation();\n\n // Backward compatible for different versions of PHPUnit\n if (method_exists($this, 'expectException')) {\n $this->expectException(\\InvalidArgumentException::class);\n\n $protocol->computeSharedSecret('яяяя', $exchangeInformation->private);\n } else {\n $hasThrown = null;\n\n try {\n $protocol->computeSharedSecret('яяяя', $exchangeInformation->private);\n } catch (\\InvalidArgumentException $exception) {\n $hasThrown = !empty($exception->getMessage());\n } catch (\\Exception $exception) {\n $hasThrown = $exception->getMessage();\n }\n\n $this->assertTrue($hasThrown);\n\n return;\n }\n }", "abstract public function valid();", "function commonValidation($data) {\n unset($this->validate['title']);\n unset($this->validate['category_id']);\n unset($this->validate['short_description']);\n\n if ($data['Offer']['basename'] != '') {\n unset($this->validate['file']['valid_upload']);\n }\n }", "public function isValid($data);", "public function valid()\n {\n return !is_null($this->key());\n }", "public function enforceRulePassword($data){\n if (strlen($data) >= 8){\n \t$validPassword= $data;\n \t} \n \telse{\n \t$validPassword= FALSE;\n\t\t\t}\n\t\t\t\n\t\t\t/*if (preg_match (\"/^.*(?=.{8,})(?=.*\\d)(?=.*[a-zA-Z]).*$/\", $data)){\n \t$validPassword= $data;\n \t} \n \telse{\n \t$validPassword= FALSE;\n\t\t\t}*/\n\t\t\t\n\t\t\treturn $validPassword;\n }", "protected function is_valid_key($key)\n {\n }", "public function valid()\n {\n\n if ($this->container['use_async_pattern'] === null) {\n return false;\n }\n if ($this->container['source_file_name'] === null) {\n return false;\n }\n if ($this->container['source_file_content'] === null) {\n return false;\n }\n if ($this->container['copy_metadata'] === null) {\n return false;\n }\n $allowed_values = [\"English\", \"Arabic\", \"Danish\", \"German\", \"Dutch\", \"Finnish\", \"French\", \"Hebrew\", \"Hungarian\", \"Italian\", \"Norwegian\", \"Portuguese\", \"Spanish\", \"Swedish\", \"Russian\"];\n if (!in_array($this->container['language'], $allowed_values)) {\n return false;\n }\n $allowed_values = [\"Slow but accurate\", \"Faster and less accurate\", \"Fastest and least accurate\"];\n if (!in_array($this->container['performance'], $allowed_values)) {\n return false;\n }\n $allowed_values = [\"None\", \"Whitelist\", \"Blacklist\"];\n if (!in_array($this->container['characters_option'], $allowed_values)) {\n return false;\n }\n return true;\n }", "public function decrypt(string $data) : string|bool\n {\n $json = Jso::hay(base64_decode($data))->decode(true);\n\n if (! Jso::valid() || !$this->validate((array)$json)) {\n throw new DecrypterException('Could not validate the decrypted data pack');\n }\n\n $iv = base64_decode($json['iv']);\n $encrypted = base64_decode($json['data']);\n $decrypted = sodium_crypto_secretbox_open($encrypted, $iv, $this->appKey);\n\n if (! $decrypted) {\n throw new DecrypterException('Could not decrypt the requested data');\n }\n\n sodium_memzero($encrypted);\n return $decrypted;\n }", "public final function verifyData($key){\n\n unset($this->errors[$key]);\n\n if(!array_key_exists($key,$this->data)){\n\n if(!array_key_exists($key,$this->definition)){\n throw new \\Disco\\exceptions\\Exception(\"Field `{$key}` is not defined by this data model\");\n }//if\n\n //DEFAULT\n if(array_key_exists('default',$this->definition[$key])){\n $this->data[$key] = $this->definition[$key]['default'];\n }//if\n //REQUIRED\n else if($this->getDefinitionValue($key,'required')){\n return $this->setError($key,\"`{$key}` is required\");\n }//elif\n else {\n return false;\n }//el\n\n }//if\n\n //PREMASSAGE\n if(($massage = $this->getDefinitionValue($key,'premassage')) !== false){\n $this->data[$key] = $this->{$massage}($this->data[$key]);\n }//if\n\n $value = $this->data[$key];\n\n //REGEXP\n if(($regexp = $this->getDefinitionValue($key,'regexp')) !== false){\n if(($default = \\App::getCondition($regexp)) !== false && !\\App::matchCondition($default,$value)){\n return $this->setError($key);\n }//if\n if(!preg_match(\"/{$regexp}/\",$value)){\n return $this->setError($key);\n }//if\n $this->_postMassage($key,$value);\n return true;\n }//if\n\n //METHOD\n if(($method = $this->getDefinitionValue($key,'method')) !== false){\n if(!$this->{$method}($value)){\n return $this->setError($key);\n }//if\n $this->_postMassage($key,$value);\n return true;\n }//if\n\n //NULLABLE\n if($this->getDefinitionValue($key,'nullable') && $value === null){\n $this->_postMassage($key,$value);\n return true;\n }//if\n\n $type = $this->getDefinitionValue($key,'type');\n\n //TRUTHY\n if($type != 'boolean' && $this->getDefinitionValue($key,'truthy') && is_bool($value)){\n $this->_postMassage($key,$value);\n return true;\n }//if\n\n switch($type){\n\n case 'int':\n\n if(!$this->_isValidInt($key,$value)){\n return false;\n }//if\n\n break;\n\n case 'uint':\n\n if(!$this->_isValidInt($key,$value)){\n return false;\n }//if\n\n if($value < 0){\n return $this->setError($key,\"`{$key}` must be a positive integer\");\n }//if\n\n break;\n\n case 'float':\n\n if(!$this->_isValidFloat($key,$value)){\n return false;\n }//if\n\n break;\n\n case 'ufloat':\n\n if(!$this->_isValidFloat($key,$value)){\n return false;\n }//if\n\n if($value < 0){\n return $this->setError($key,\"`{$key}` must be a positive number\");\n }//if\n\n break;\n\n case 'string':\n\n if(!is_string($value)){\n return $this->setError($key,\"`{$key}` must be a string\");\n }//if\n\n if(($min = $this->getDefinitionValue($key,'minlen')) !== false && strlen($value) < $min){\n return $this->setError($key,\"`{$key}` must be greater than {$min} characters long\");\n }//if\n\n if(($max = $this->getDefinitionValue($key,'maxlen')) !== false && strlen($value) > $max){\n return $this->setError($key,\"`{$key}` must be less than {$max} characters long\");\n }//if\n\n break;\n\n case 'char':\n\n if(!is_string($value) || strlen($value) != 1){\n return $this->setError($key,\"`{$key}` must be a single character\");\n }//if\n\n break;\n\n case 'boolean': \n\n if(!is_bool($value)){\n return $this->setError($key,\"`{$key}` must be a boolean value\");\n }//if\n\n break;\n\n case 'array':\n\n if(!is_array($value)){\n return $this->setError($key,\"`{$key}` must be an array\");\n }//if\n\n break;\n\n case 'object':\n\n if(is_object($value)){\n if(($instanceof = $this->getDefinitionValue($key,'instanceof')) !== false && !$value instanceof $instanceof){\n return $this->setError($key,\"`{$key}` must be an instance of `{$instanceof}`\");\n }//if\n } //if\n else {\n return $this->setError($key,\"`{$key}` must be an object\");\n }//if\n\n break;\n\n case 'closure':\n\n if(!is_object($value) || !$value instanceof \\Closure){\n return $this->setError($key,\"`{$key}` must be a closure\");\n }//if \n\n break;\n\n default:\n return $this->setError($key);\n\n }//switch\n\n //IN\n if(($in = $this->getDefinitionValue($key,'in')) !== false && !in_array($value,$in)){\n $in = implode(', ',$in);\n return $this->setError($key,\"`{$key}` must be a value of `{$in}`\");\n }//if\n\n //NOTIN\n if(($in = $this->getDefinitionValue($key,'notin')) !== false && in_array($value,$in)){\n $in = implode(', ',$in);\n return $this->setError($key,\"`{$key}` must not be a value of `{$in}`\");\n }//if\n\n $this->_postMassage($key,$value);\n\n }", "public function validateInput($inputData)\n {\n if (!v::string()->notEmpty()->validate($inputData)) {\n $this->errors = 'Please give some inputs';\n }\n \n if (!v::json()->validate($inputData)) {\n $this->errors = 'Not a valid JSON';\n }\n\n if (v::string()->notEmpty()->validate($inputData) && v::json()->validate($inputData)) {\n if (!v::key('char')->validate(json_decode($inputData, true))) {\n $this->errors[] = 'Required Key char is not present in the input';\n }\n }\n }", "public function validarClave() {\n if (!$this->hasErrors()) {\n if ($this->clave != $this->claveConfirmar) {\n $this->addError('clave', 'Contraseña no coincide');\n $this->addError('claveConfirmar', 'Contraseña no coincide');\n $this->clave = null;\n $this->claveConfirmar = null;\n }\n }\n }", "private function ValidateTranslationFields()\t\n\t{\n\t\t// check for required fields\t\t\n\t\tforeach($this->arrTranslations as $key => $val){\t\t\t\n\t\t\tif(strlen($val['image_text']) > 2048){\n\t\t\t\t$this->error = str_replace('_FIELD_', '<b>'._DESCRIPTION.'</b>', _FIELD_LENGTH_EXCEEDED);\n\t\t\t\t$this->error = str_replace('_LENGTH_', 2048, $this->error);\n\t\t\t\t$this->errorField = 'image_text_'.$key;\n\t\t\t\treturn false;\n\t\t\t}\t\t\t\n\t\t}\t\t\n\t\treturn true;\t\t\n\t}", "function check_implementation() {\r\n\r\n\t\t$xtea = new XTEA(\"\");\r\n\t\t$vectors = array(\r\n\t\t\tarray(array(0x00000000,0x00000000,0x00000000,0x00000000), array(0x41414141,0x41414141), array(0xed23375a,0x821a8c2d)),\r\n\t\t\tarray(array(0x00010203,0x04050607,0x08090a0b,0x0c0d0e0f), array(0x41424344,0x45464748), array(0x497df3d0,0x72612cb5)),\r\n\r\n\t\t);\r\n\r\n\t\t//Correct implementation?\r\n\t\t$correct = true;\r\n\t\t//Test vectors, see http://www.schneier.com/code/vectors.txt\r\n\t\tforeach($vectors AS $vector) {\r\n \t$key = $vector[0];\r\n\t\t\t$plain = $vector[1];\r\n\t\t\t$cipher = $vector[2];\r\n\r\n\t\t\t$xtea->key_setup($key);\r\n\t\t\t$return = $xtea->block_encrypt($vector[1][0],$vector[1][1]);\r\n\r\n\t\t\tif((int)$return[0] != (int)$cipher[0] || (int)$return[1] != (int)$cipher[1])\r\n\t\t\t\t$correct = false;\r\n\r\n\t\t}\r\n\r\n\t\treturn $correct;\r\n\r\n\t}", "public function valid() {\n return ( ! is_null($this->key()));\n }", "function decryptData($openssl_data, $openssl_pass, $openssl_iv){\n\t$method = 'AES-256-CBC';\n\n\tif(strlen($openssl_iv) > '128'){\n\t\t$openssl_iv = substr($openssl_iv, 0, 128);\n\t}\n\n\treturn trim(openssl_decrypt($openssl_data, $method, $openssl_pass, FALSE, $openssl_iv));\n}", "public function validarClave() {\r\n if (!$this->hasErrors()) {\r\n if ($this->clave != $this->claveConfirmar) {\r\n $this->addError('clave', 'Contraseña no coincide');\r\n $this->addError('claveConfirmar', 'Contraseña no coincide');\r\n $this->clave = null;\r\n $this->claveConfirmar = null;\r\n }\r\n }\r\n }", "function check_api_token($token) {\n /* format (2) : crypt (1) : ccrypt( create_api_token('glynthom', '50') , 'AES-256-OFB', 'en' ) ) */\n\n if (strlen(utf8_decode( $token )) === 60) {\n \n switch (true) {\n case (strlen(utf8_decode( $token )) === 120):\n $token = ccrypt( $token , 'AES-256-OFB', 'de' );\n case (strlen(utf8_decode( $token )) === 60):\n break;\n }\n\n $token = explode(\"-\", $token);\n $token[0] = strlen(utf8_decode( $token[0] ));\n /* name de-crunch, figure out upad length compensation */\n\n switch (true) {\n case ( !isset($token[3]) ):\n case ( !isset($token[1]) ):\n case ( !isset($token[6]) ): \n return 'token is invalid, error';\n break; \n }\n\n switch (true) {\n case ($token[0] === 32): // max user pad\n $token[3] = ccrypt( $token[3], 'AES-256-OFB', 'de' );\n $token[1] = ccrypt( $token[1], 'AES-256-OFB', 'de' );\n break;\n case ($token[0] === 30): // user pad\n $token[3] = ccrypt( $token[3], 'AES-256-OFB', 'de' );\n $token[1] = ccrypt( $token[1], 'AES-256-OFB', 'de' ); \n break;\n case ($token[0] === 28): // user pad \n $token[3] = ccrypt( $token[3], 'AES-256-OFB', 'de' );\n $token[1] = ccrypt( $token[1], 'AES-256-OFB', 'de' ); \n break;\n case ($token[0] === 26): // user pad\n $token[3] = ccrypt( $token[3], 'AES-256-OFB', 'de' );\n $token[1] = ccrypt( $token[1], 'AES-256-OFB', 'de' ); \n break;\n case ($token[0] === 24): // user pad\n $token[3] = ccrypt( $token[3], 'AES-256-OFB', 'de' );\n $token[1] = ccrypt( $token[1], 'AES-256-OFB', 'de' );\n break;\n case ($token[0] === 22): // username \n $token[3] = ccrypt( $token[3], 'AES-256-OFB', 'de' );\n $token[1] = ccrypt( $token[1], 'AES-256-OFB', 'de' );\n break;\n case ($token[0] === 20): // user pad\n $token[3] = ccrypt( $token[3], 'AES-256-OFB', 'de' );\n $token[1] = ccrypt( $token[1], 'AES-256-OFB', 'de' ); \n break;\n case ($token[0] === 18): // user pad \n $token[3] = ccrypt( $token[3], 'AES-256-OFB', 'de' );\n $token[1] = ccrypt( $token[1], 'AES-256-OFB', 'de' );\n break;\n case ($token[0] === 16): // user pad\n $token[3] = ccrypt( $token[3], 'AES-256-OFB', 'de' );\n $token[1] = ccrypt( $token[1], 'AES-256-OFB', 'de' );\n break;\n case ($token[0] === 14): // user pad \n $token[3] = ccrypt( $token[3], 'AES-256-OFB', 'de' );\n $token[1] = ccrypt( $token[1], 'AES-256-OFB', 'de' );\n break;\n case ($token[0] === 12): // user pad\n $token[3] = ccrypt( $token[3], 'AES-256-OFB', 'de' );\n $token[1] = ccrypt( $token[1], 'AES-256-OFB', 'de' ); \n break;\n case ($token[0] === 10): // user pad\n $token[3] = ccrypt( $token[3], 'AES-256-OFB', 'de' );\n $token[1] = ccrypt( $token[1], 'AES-256-OFB', 'de' ); \n break;\n case ($token[0] === 8): // user pad\n $token[3] = ccrypt( $token[3], 'AES-256-OFB', 'de' );\n $token[1] = ccrypt( $token[1], 'AES-256-OFB', 'de' );\n break;\n case ($token[0] === 6): // user pad\n $token[3] = ccrypt( $token[3], 'AES-256-OFB', 'de' );\n $token[1] = ccrypt( $token[1], 'AES-256-OFB', 'de' );\n break;\n case ($token[0] === 4): // min user pad\n $token[3] = ccrypt( $token[3], 'AES-256-OFB', 'de' );\n $token[1] = ccrypt( $token[1], 'AES-256-OFB', 'de' );\n break;\n }\n\n /* number de-crunch figure out pad length compensation */\n\n /* if ( isset($token[6]) ) { */\n $nlen = strlen(utf8_decode( $token[6] ));\n\n switch (true) {\n case ($nlen === 10): // max 100 000\n $token[5] = ccrypt( $token[5], 'AES-256-OFB', 'de' );\n break;\n case ($nlen === 8): // 10 000 \n $token[5] = ccrypt( $token[5], 'AES-256-OFB', 'de' );\n break;\n case ($nlen === 6): // 1 000 \n $token[5] = ccrypt( $token[5], 'AES-256-OFB', 'de' );\n break;\n case ($nlen === 4): // 100\n $token[5] = ccrypt( $token[5], 'AES-256-OFB', 'de' );\n break;\n case ($nlen === 2): // 50 public access\n $token[5] = ccrypt( $token[5], 'AES-256-OFB', 'de' );\n break;\n\n case ($nlen > 10):\n case ($nlen < 2):\n $token[3] = 'token is '; $token[1] = 'invalid'; $token[5] = 'error';\n break;\n }\n\n } else { $token[3] = 'token is '; $token[1] = 'invalid'; $token[5] = 'error';}\n\n /* final sanity check */\n\n $options = array('options' => array('min_range' => 0));\n\n switch (true) {\n\n case ( !preg_match('/^[A-Za-z0-9_]{1,15}$/', ($token[3] . $token[1]) ) ):\n return 'token is invalid, error';\n break;\n case ( filter_var($token[5], FILTER_VALIDATE_INT, $options) === FALSE ):\n return 'token is invalid, error';\n break;\n\n }\n \n return $token[3] . $token[1] . ',' .$token[5];\n\n}", "public final function verifySetData(){\n\n foreach($this->data as $k => $v){\n $this->verifyData($k);\n }//foreach\n\n if(count($this->errors)){\n return false;\n }//if\n\n return true;\n\n }", "public function valid() {}", "public function valid() {}", "public function valid() {}", "public function valid() {}", "public function valid() {}", "public function valid() {}", "public function valid() {}", "public function valid() {}", "public function decrypt($data)\n {\n if(!is_string($data) || empty($data)) return false;\n\n // Decode crypt keys\n $first_key = base64_decode($this->config['main_key']);\n $second_key = base64_decode($this->config['assured_key']);\n\n // Decode base64 coded $data\n $mix = base64_decode($data);\n\n // Get length of IV from crypt first method\n $iv_length = openssl_cipher_iv_length($this->encrypt_fst_method);\n\n // Get IV from decoded $data\n $iv = substr($mix, 0, $iv_length);\n // Get second encrypted $data from $mix\n $second_encrypted = substr($mix, $iv_length, 64);\n // Get first encrypted $data from $mix\n $first_encrypted = substr($mix, $iv_length + 64);\n\n // Decrypt first encrypted $data with first encryption method\n $data = openssl_decrypt($first_encrypted, $this->encrypt_fst_method, $first_key, OPENSSL_RAW_DATA, $iv);\n $second_encrypted_new = hash_hmac($this->encrypt_snd_method, $first_encrypted, $second_key, TRUE);\n\n // Check if new second encrypted data is equals to previous second encrypted data,\n // then return decrypted data\n if (hash_equals($second_encrypted, $second_encrypted_new)) {\n $this->has_error = false;\n return $data;\n }\n\n // Otherwise it has modefied\n $this->has_error = true;\n return false;\n }", "function aes_128_decrypt($key, $data) {\n $base64_original = str_replace(array('-', '_'), array('+', '/'), $data);\n\n // Get binary data\n $decoded = base64_decode($base64_original);\n\n // Initialization vector is the first 16 bytes of the received data\n $iv = substr($decoded, 0, 16);\n\n // The payload itself is is the rest of the received data\n $payload = substr($decoded, 16);\n\n // Decrypt raw binary payload\n $json = openssl_decrypt($payload, \"aes-128-cbc\", $key, OPENSSL_RAW_DATA, $iv);\n //$json = mcrypt_decrypt(MCRYPT_RIJNDAEL_128, $key, $payload, MCRYPT_MODE_CBC, $iv); // You can use this instead of openssl_decrupt, if mcrypt is enabled in your system\n\n return $json;\n }", "public function validateTokenizeCard($data)\n {\n $validator = Validator::make($data, [\n 'card_number' => 'required|numeric',\n 'client_id' => 'required|string'\n ]);\n\n if ($validator->fails()) {\n throw new \\Exception($validator->errors()->first());\n }\n }", "function validate_key($key)\n{\n if ($key == 'PhEUT5R251')\n return true;\n else\n return false;\n}", "public function valid()\n {\n\n $allowedValues = $this->getTransformAllowableValues();\n if (!in_array($this->container['transform'], $allowedValues)) {\n return false;\n }\n $allowedValues = $this->getWrapTextAllowableValues();\n if (!in_array($this->container['wrapText'], $allowedValues)) {\n return false;\n }\n $allowedValues = $this->getAnchoringTypeAllowableValues();\n if (!in_array($this->container['anchoringType'], $allowedValues)) {\n return false;\n }\n $allowedValues = $this->getCenterTextAllowableValues();\n if (!in_array($this->container['centerText'], $allowedValues)) {\n return false;\n }\n $allowedValues = $this->getTextVerticalTypeAllowableValues();\n if (!in_array($this->container['textVerticalType'], $allowedValues)) {\n return false;\n }\n $allowedValues = $this->getAutofitTypeAllowableValues();\n if (!in_array($this->container['autofitType'], $allowedValues)) {\n return false;\n }\n return true;\n }", "public function validation($data)\n {\n \t$this->load->library('encrypt');\n\t\t$user = $this->db->select('email, password, status_register')->where('email', $data['email'])->get('ec_client')->result_array();\n if (count($user) > 0) {\n\t\t\t\t$password_decode = $this->encrypt->decode($user[0]['password']);\n\t\t\t\t\tif ($password_decode == $data['password']) {\n\t\t\t\t\t\tif ($user[0]['status_register'] == 0) {\n return 2;\n }\n return 1;\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn 0; # Usuario o clave de acceso incorrectos\n\t\t\t\t\t}\n\t\t\t} else {\n\t\t\t\treturn 0; # Usuario o clave de acceso incorrectos\n\t\t\t}\n }", "public function validate()\r\n {\r\n if(($this->length_n>=MIN_LENGTH AND $this->length_n<MAX_LENGTH) AND ($this->width_m>=MIN_WIDTH AND $this->width_m<MAX_WIDTH))\r\n {\r\n return true;\r\n }else {\r\n return false;\r\n }\r\n\r\n \r\n }", "public function isValid()\n {\n return $this->pos < strlen($this->buffer);\n }", "public function valid(){\n\t\treturn (is_array($this->data) ? key($this->data) !== null : false);\n\t}", "public function valid()\n {\n if (count($this->data) < 1) {\n if ($this->provider instanceof \\Closure) {\n $this->data = $this->provider->__invoke($this->key);\n } else {\n $this->data = $this->manuallyAddedData;\n $this->manuallyAddedData = array();\n }\n }\n\n return count($this->data) > 0;\n }", "protected function _verifySecretKey()\n {\n $sCronSecretkeyParameter = $this->_getSecretKey();\n $sCronSecretkey = $this->_getContainer()->getConfig()->getConfigParam('sAmazonCronSecretKey');\n\n if ($sCronSecretkeyParameter === false || $sCronSecretkey !== $sCronSecretkeyParameter) {\n $this->setViewData(array(\n 'sError' => 'Wrong Secret Key given.'\n ));\n\n return false;\n }\n\n return true;\n }", "function openssl_private_decrypt(\n string $data,\n &$decrypted_data,\n #[LanguageLevelTypeAware(['8.0' => 'OpenSSLAsymmetricKey|OpenSSLCertificate|array|string'], default: 'resource|array|string')] $private_key,\n int $padding = OPENSSL_PKCS1_PADDING\n): bool {}", "public function hasCryptFilter() {}", "public function validateData(){\n if(substr($this->user_id,0,5)!=$this->office_id){\n return false;\n }\n if(in_array($this->email,$this->getEmails())){\n return false;\n }\n return true; \n }", "public function validate( )\n {\n return count( array_diff( $this->extractTokens( ), $this->getAvailableTokens( ) ) ) == 0;\n }", "public function isDataValid() {\n if ($this->userExists())\n $this->_errors[] = 'username already taken';\n // username and password must match pattern\n else if (empty($this->_username) || !preg_match('/^[a-zA-Z0-9]{5,16}$/', $this->_username))\n $this->_errors[] = 'invalid username must be between 5 and 16 characters';\n else if (empty($this->_password) || !preg_match('/^[a-zA-Z0-9]{6,18}$/', $this->_password))\n $this->_errors[] = 'invalid password must be between 6 and 18 characters';\n\t\t else if (empty($this->_password) || $this->_password != $this->_password_confirm)\n $this->_errors[] = \"Password didn't match X\";\n // names must be between 2 and 22 characters\n else if (empty($this->_first_name) || !preg_match('/^[a-zA-Z0-9]{2,22}$/', $this->_first_name))\n $this->_errors[] = 'invalid first name must be between 2 and 22 characters';\n else if (empty($this->_last_name) || !preg_match('/^[a-zA-Z0-9]{2,22}$/', $this->_last_name))\n $this->_errors[] = 'invalid last name must be between 2 and 22 characters';\n //restricts day to 01-31, month to 01-12 and year to 1900-2099 (also allowing / - or . between the parts of the date) \n else if (empty($this->_dob) || !preg_match('/^(0?[1-9]|[12][0-9]|3[01])[\\/\\ ](0?[1-9]|1[0-2])[\\/\\ ](19|20)\\d{2}$/', $this->_dob))\n $this->_errors[] = 'invalid dod | must be DD/MM/YYYY format';\n else if (empty($this->_address))\n $this->_errors[] = 'invalid address';\n // checks if valid postal code\n else if (empty($this->_postcode) || !preg_match('/^(([A-PR-UW-Z]{1}[A-IK-Y]?)([0-9]?[A-HJKS-UW]?[ABEHMNPRVWXY]?|[0-9]?[0-9]?))\\s?([0-9]{1}[ABD-HJLNP-UW-Z]{2})$/', $this->_postcode))\n $this->_errors[] = 'invalid postcode | must be AA11 9AA format';\n // checks is valid email using regular expression\n else if (empty($this->_email) || !preg_match('/^[_\\.0-9a-zA-Z-]+@([0-9a-zA-Z][0-9a-zA-Z-]+\\.)+[a-zA-Z]{2,6}$/', $this->_email))\n $this->_errors[] = 'invalid email';\n\n\n // return true or false \n return count($this->_errors) ? 0 : 1;\n }", "private function validateData()\n {\n if (empty($this->nome)) {\n $this->errors->addMessage(\"O nome é obrigatório\");\n }\n\n if (!filter_var($this->email, FILTER_VALIDATE_EMAIL)) {\n $this->errors->addMessage(\"O e-mail é inválido\");\n }\n\n if (strlen($this->senha) < 6) {\n $this->errors->addMessage(\"A senha deve ter no minímo 6 caracteres!\");\n }\n if ($this->emailExiste($this->email, 'email')) {\n $this->errors->addMessage(\"Esse e-mail já está cadastrado\");\n }\n if ($this->emailExiste($this->usuario, 'usuario')) {\n $this->errors->addMessage(\"Esse usuário já está cadastrado\");\n }\n\n return $this->errors->hasError();\n }", "public function valid()\n {\n\n if ($this->container['name'] === null) {\n return false;\n }\n if (strlen($this->container['name']) > 100) {\n return false;\n }\n if ($this->container['nit'] === null) {\n return false;\n }\n if (strlen($this->container['nit']) > 15) {\n return false;\n }\n if ($this->container['inbound_configuration_username'] === null) {\n return false;\n }\n if ($this->container['outbound_configuration_contingency_email'] === null) {\n return false;\n }\n return true;\n }", "public function decrypt();", "function km200_Decrypt( $decryptData ) \n{ \n $decrypt = openssl_decrypt( \n base64_decode( $decryptData ),\n \"aes-256-ecb\",\n km200_crypt_key_private,\n OPENSSL_RAW_DATA | OPENSSL_ZERO_PADDING\n );\n// var_dump($decryptData);\n\n // remove zero padding \n $decrypt = rtrim( $decrypt, \"\\x00\" ); \n // remove PKCS #7 padding \n $decrypt_len = strlen( $decrypt ); \n $decrypt_padchar = ord( $decrypt[ $decrypt_len - 1 ] ); \n for ( $i = 0; $i < $decrypt_padchar ; $i++ ) \n { \n if ( $decrypt_padchar != ord( $decrypt[$decrypt_len - $i - 1] ) ) \n break; \n } \n if ( $i != $decrypt_padchar ) \n return $decrypt; \n else \n return substr( \n $decrypt, \n 0, \n $decrypt_len - $decrypt_padchar \n ); \n}", "public function testBasicDataEncryptionAndDataDecryption()\n {\n $randomData = random_bytes(8);\n $randomKey = random_bytes(NativeRc4::KEY_SIZE);\n\n $encryptedData = NativeRc4::encryptData($randomKey, $randomData);\n $decryptedData = NativeRc4::decryptData($randomKey, $encryptedData);\n\n $this->assertEquals($randomData, $decryptedData);\n\n if (in_array(strtolower(Rc4::ALGORITHM_NAME), openssl_get_cipher_methods(), true)) {\n $this->assertEquals(\n $encryptedData,\n openssl_encrypt($randomData, 'RC4', $randomKey, OPENSSL_RAW_DATA, '')\n );\n }\n }", "public function validateAuthKey($authKey){\n }", "public function rules()\n {\n return [\n 'session_key' => 'required',\n 'iv' => 'required',\n 'encryptedData' => 'required'\n ];\n }", "function check_element_validity($key,$opt){\n\n if (preg_match(STARTCHARRGX, $key) === 1 ) { //check first character\n preg_match(STARTCHARRGX,$key,$matches);\n if ($matches[0] == \"_\") {\n return false;\n }\n return true;\n }\n if ( preg_match(INVALIDCHARSRGX, $key) === 1) { //check other chars validity\n return true;\n }\n return false;\n }", "private function validateData() {\r\n\r\n $requiredFields = array(\"v_code\" => \"Verification code not supplied\",\r\n \"psw1\" => \"Password field is empty\",\r\n \"psw2\" => \"Password field is empty\",);\r\n\r\n\r\n //0 means there is no error\r\n $error_status = \\VAL_NO_ERROR;\r\n\r\n /*\r\n Initialize error object that will be returned by this function\r\n */\r\n $error_obj = new stdClass();\r\n $error_obj->msg = \"\";\r\n $error_obj->field = \"\";\r\n $error_obj->code = 0;\r\n $error_obj->type = \\VAL_NO_ERROR;\r\n\r\n //check if required variables are defined\r\n foreach ($requiredFields as $key => $value) {\r\n $value = $this->request->request->get($key);\r\n if (empty( $value )) {\r\n $error_obj->field = $key;\r\n $error_obj->msg = $requiredFields[$key];\r\n $error_obj->type = \\VAL_FIELD_ERROR;\r\n\r\n //return after each field that is found wrong\r\n return $error_obj;\r\n }\r\n }\r\n\r\n $pass_1 = $this->request->request->get('psw1');\r\n $pass_2 = $this->request->request->get('psw2');\r\n\r\n //Check if emails match\r\n if (strcmp($pass_1, $pass_2) != 0) {\r\n $error_obj->field = \"psw2\";\r\n $error_obj->msg = \"Passwords are different\";\r\n $error_obj->type = \\VAL_FIELD_ERROR;\r\n\r\n return $error_obj;\r\n }\r\n\r\n /*\r\n Only check one password. If both passwords are thesame, we only need to check one of them.\r\n */\r\n if (!preg_match('/^(?=.*\\d)(?=.*[a-z])(?=.*[A-Z]).{6,}$/', $pass_1)) {\r\n $error_obj->field = \"psw1\";\r\n $error_obj->msg = \"Password must have a digit, lower and upper case charters. Min lenght is 6\";\r\n $error_obj->type = \\VAL_FIELD_ERROR;\r\n\r\n return $error_obj;\r\n }\r\n\r\n return $error_obj;\r\n }", "function _inputCheck(){\n if (isset($_POST['verder']) && $this->_verify() == \"\") {\n return true;\n }\n else {\n return false;\n }\n }", "public function valid() {\n return array_key_exists($this->_key, $this->_data);\n }", "public function decrypt($data, $deterministic);", "private function isValidKey($key) {\n\n\t\t// Check key length\n\t\t$len = strlen($key);\n\n\t\tif ($len < 1) {\n\t\t\tthrow new FlintstoneException('No key has been set');\n\t\t}\n\n\t\tif ($len > 50) {\n\t\t\tthrow new FlintstoneException('Maximum key length is 50 characters');\n\t\t}\n\n\t\t// Check valid characters in key\n\t\tif (!preg_match(\"/^[A-Za-z0-9_\\-]+$/\", $key)) {\n\t\t\tthrow new FlintstoneException('Invalid characters in key');\n\t\t}\n\n\t\treturn true;\n\t}", "public function testIsValidKeyWithValidKey() \n {\n $key = 'key1';\n $result = $this->fileCache->isValidKey($key);\n $expected = TRUE;\n\n $this->assertEquals($expected, $result);\n }", "function validate(array $data)\n\t{\n\t}", "public function hasValidData($key = null) {\n if (!$this->hasData) {\n return false;\n }\n if (isset($key)) {\n if (is_array($key)) {\n foreach ($key as $k) {\n if (!isset($this->data[$k])) \n return false;\n }\n }\n else if (!isset($this->data[$key])) { \n return false;\n }\n }\n return $this->checkToken();\n }", "public function valid()\n {\n return (null !== key($this->data));\n }" ]
[ "0.7728111", "0.662747", "0.65892667", "0.6566636", "0.632465", "0.6242262", "0.6176424", "0.6146964", "0.6042639", "0.5946525", "0.5943229", "0.59191275", "0.5764247", "0.5764247", "0.57420397", "0.5724901", "0.5697322", "0.56938076", "0.5684154", "0.56604636", "0.565735", "0.565735", "0.5630979", "0.56153405", "0.55900276", "0.55602425", "0.553551", "0.55254644", "0.5516808", "0.5502485", "0.54834276", "0.54690284", "0.54491377", "0.54457265", "0.5438503", "0.5437897", "0.54376173", "0.5429295", "0.54256046", "0.5424342", "0.53846085", "0.53810716", "0.53705776", "0.53602374", "0.5347315", "0.5332927", "0.5328497", "0.53253967", "0.53184", "0.53164905", "0.53065705", "0.53021604", "0.52920735", "0.52877873", "0.5285889", "0.5275755", "0.5273576", "0.52653825", "0.52607125", "0.52431834", "0.52431834", "0.52431834", "0.52431834", "0.52431834", "0.52431834", "0.52431834", "0.52431834", "0.52399355", "0.52273977", "0.52032304", "0.51987916", "0.51896864", "0.5186853", "0.5165842", "0.5165643", "0.5164885", "0.51640505", "0.5163636", "0.5145452", "0.5144432", "0.5142447", "0.51395816", "0.51334184", "0.5132792", "0.5131726", "0.51309067", "0.51267695", "0.5118221", "0.511771", "0.5113011", "0.5112385", "0.5107362", "0.5106738", "0.51044255", "0.5103827", "0.5103498", "0.5101194", "0.5099716", "0.5096611", "0.5093092" ]
0.8284532
0
Symmetrical encryption algorithm constructor.
abstract public function __construct();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getAsymmetricCipher();", "public function encrypt();", "protected function _encrypt()\n {\n switch ($this->_cypherUsed) {\n case self::CYPHER_BASIC:\n //break ommited on purpose\n default:\n $string = $this->_plainText;\n $result = '';\n for ($i = 0; $i < strlen($string); $i++) {\n $char = substr($string, $i, 1);\n $keychar = substr($this->_keyString, ($i % strlen($this->_keyString)) - 1, 1);\n $char = chr(ord($char) + ord($keychar));\n $result .= $char;\n }\n $this->_encryptedText = base64_encode($result);\n break;\n }\n }", "function simple_encrypt($text){\n \treturn base64_encode(openssl_encrypt($text, \"AES-256-CTR\", \"GhratnaXbS\", 0, \"0123456789abcdef\"));\n }", "function simple_encode($data, $passwd, $method='aes-128-cbc', $options=0, $iv='SomeA1AweS0meK5y') {\n return openssl_encrypt ($data, $method, $passwd, $options, $iv);\n}", "public function encrypt() \r\n {\r\n //TODO: Implement encrypt method\r\n }", "function MyJamiaEncrypt($str) {\n\t\t\n\t\t// Store the cipher method \n\t\t$ciphering = \"AES-128-CTR\"; \n \n\t\t// Use OpenSSl Encryption method \n\t\t$iv_length = openssl_cipher_iv_length($ciphering); \n\t\t$options = 0; \n \n\t\t// Non-NULL Initialization Vector for encryption \n\t\t$encryption_iv = '1234567891011121'; \n \n\t\t// Store the encryption key \n\t\t$encryption_key = \"MyJamiaEncryptionString\"; \n \n\t\t// Use openssl_encrypt() function to encrypt the data \n\t\treturn openssl_encrypt($str, $ciphering, \n\t\t $encryption_key, $options, $encryption_iv); \n \t}", "function Crypter($clave){\n $this->key = $clave;\n }", "public function setAsymmetricCipher(AsymmetricEncryption $cipher);", "function my_simple_crypt($string, $action = 'e')\n{\n $secret_key = 'my_simple_secret_key';\n $secret_iv = 'my_simple_secret_iv';\n\n $output = false;\n $encrypt_method = \"AES-256-CBC\";\n $key = hash('sha256', $secret_key);\n $iv = substr(hash('sha256', $secret_iv), 0, 16);\n\n if ($action == 'e') {\n $output = base64_encode(openssl_encrypt($string, $encrypt_method, $key, 0, $iv));\n } else if ($action == 'd') {\n $output = openssl_decrypt(base64_decode($string), $encrypt_method, $key, 0, $iv);\n }\n\n return $output;\n}", "private function _encryptSymmetric($data, $alias, $password, $options)\n {\n $encData = '';\n $key = null;\n \n $processedOpts = $this->_processSymmetricOptions($options);\n \n try {\n $key = $this->_getKey($alias, $password);\n \n /* Open the cipher */\n $td = mcrypt_module_open(\n $processedOpts[self::OPT_CIPHER], \n '', \n $processedOpts[self::OPT_MODE], \n ''\n );\n \n /* create IV */\n $iv = mcrypt_create_iv(mcrypt_enc_get_iv_size($td), MCRYPT_RAND);\n \n /* Intialize encryption */\n mcrypt_generic_init($td, $key, $iv);\n \n /* Encrypt data */\n $encData = bin2hex($iv) . bin2hex(mcrypt_generic($td, $data));\n \n /* Terminate encryption handler */\n mcrypt_generic_deinit($td);\n mcrypt_module_close($td);\n } catch (Exception $e) {\n throw new Crypt_KeyStore_Exception($e);\n }\n \n return $encData;\n }", "public function encryption($encryption);", "private function __construct()\n\t{\t\t\n\t\t// Load the Cryptography class\n\t\trequire_once(__DIR__.'/../vendor/crypt/AES.php');\n\t\t\n\t\t// Create a new AES cryptography object\n\t\t$this->aes = new Crypt_AES(); \n\t\t\n\t\t// Set the encryption key\n\t\t$this->setKey($this->cryptKey);\n\t}", "public function getEncryptionAlgo() {\n\treturn $this->cipher;\n }", "abstract protected function getCrypt();", "abstract public function encrypt($data);", "function my_simple_crypt( $string, $action = 'd') {\n $secret_key = 'my_simple_secret_key';\n $secret_iv = 'my_simple_secret_iv';\n \n $output = false;\n $encrypt_method = \"AES-256-CBC\";\n $key = hash( 'sha256', $secret_key );\n $iv = substr( hash( 'sha256', $secret_iv ), 0, 16 );\n \n if( $action == 'e' ) {\n $output = base64_encode( openssl_encrypt( $string, $encrypt_method, $key, 0, $iv ) );\n }\n else if( $action == 'd' ){\n $output = openssl_decrypt( base64_decode( $string ), $encrypt_method, $key, 0, $iv );\n }\n \n return $output;\n }", "protected function _crypt($data, $algorithm, $param = null, $encrypt = true) {}", "function encrypt($str) {\n return Crypt::encrypt($str);\n}", "function encrypt($decrepted_string, $encrytion_key){\r\n $ciphering = \"AES-128-CTR\";\r\n $options = 0;\r\n $encryption_iv = '1234567891011121';\r\n $string = openssl_encrypt($decrepted_string, $ciphering, $encrytion_key, $options, $encryption_iv);\r\n return $string;\r\n}", "abstract public function createSecretKey();", "public function __construct(string $key)\n {\n // hash the key so that it could be easily used in MySQL\n $key = hash(self::KEY_HASH_ALGORITHM, $key);\n // only the 16 first chars will be used by openssl\n $key = substr($key, 0, self::KEY_LENGTH);\n\n parent::__construct($key, self::CIPHER);\n }", "public static function generateSymmetricKey($password, $length)\n {\n $symkey = '';\n $sequence = 0;\n while (strlen($symkey) < $length) {\n $temp = pack('Na*', $sequence++, $password);\n $symkey.= Hex::decode(sha1($temp));\n }\n return substr($symkey, 0, $length);\n }", "function encriptarContrasena($contrasena) {\n\t#The first argument specifies the \"base-2 logarithm of the iteration count used for password stretching\" and the second argument specifies the use of portable hashes\n $t_hasher = new PasswordHash(8, FALSE);\n return $t_hasher->HashPassword($contrasena);\n}", "public function _setupInlineCrypt() {\n\t\t$lambda_functions = &Crypt_RC2::_getLambdaFunctions();\n\n\t\t// The first 10 generated $lambda_functions will use the $keys hardcoded as integers\n\t\t// for the mixing rounds, for better inline crypt performance [~20% faster].\n\t\t// But for memory reason we have to limit those ultra-optimized $lambda_functions to an amount of 10.\n\t\t// (Currently, for Crypt_RC2, one generated $lambda_function cost on php5.5@32bit ~60kb unfreeable mem and ~100kb on php5.5@64bit)\n\t\t$gen_hi_opt_code = (bool) ( count( $lambda_functions ) < 10 );\n\n\t\t// Generation of a uniqe hash for our generated code\n\t\t$code_hash = \"Crypt_RC2, {$this->mode}\";\n\t\tif ( $gen_hi_opt_code ) {\n\t\t\t$code_hash = str_pad( $code_hash, 32 ) . $this->_hashInlineCryptFunction( $this->key );\n\t\t}\n\n\t\t// Is there a re-usable $lambda_functions in there?\n\t\t// If not, we have to create it.\n\t\tif ( ! isset( $lambda_functions[ $code_hash ] ) ) {\n\t\t\t// Init code for both, encrypt and decrypt.\n\t\t\t$init_crypt = '$keys = $self->keys;';\n\n\t\t\tswitch ( true ) {\n\t\t\t\tcase $gen_hi_opt_code:\n\t\t\t\t\t$keys = $this->keys;\n\t\t\t\tdefault:\n\t\t\t\t\t$keys = [];\n\t\t\t\t\tforeach ( $this->keys as $k => $v ) {\n\t\t\t\t\t\t$keys[ $k ] = '$keys[' . $k . ']';\n\t\t\t\t\t}\n\t\t\t}\n\n\t\t\t// $in is the current 8 bytes block which has to be en/decrypt\n\t\t\t$encrypt_block = $decrypt_block = '\n $in = unpack(\"v4\", $in);\n $r0 = $in[1];\n $r1 = $in[2];\n $r2 = $in[3];\n $r3 = $in[4];\n ';\n\n\t\t\t// Create code for encryption.\n\t\t\t$limit = 20;\n\t\t\t$actions = [ $limit => 44, 44 => 64 ];\n\t\t\t$j = 0;\n\n\t\t\tfor ( ; ; ) {\n\t\t\t\t// Mixing round.\n\t\t\t\t$encrypt_block .= '\n $r0 = (($r0 + ' . $keys[ $j ++ ] . ' +\n ((($r1 ^ $r2) & $r3) ^ $r1)) & 0xFFFF) << 1;\n $r0 |= $r0 >> 16;\n $r1 = (($r1 + ' . $keys[ $j ++ ] . ' +\n ((($r2 ^ $r3) & $r0) ^ $r2)) & 0xFFFF) << 2;\n $r1 |= $r1 >> 16;\n $r2 = (($r2 + ' . $keys[ $j ++ ] . ' +\n ((($r3 ^ $r0) & $r1) ^ $r3)) & 0xFFFF) << 3;\n $r2 |= $r2 >> 16;\n $r3 = (($r3 + ' . $keys[ $j ++ ] . ' +\n ((($r0 ^ $r1) & $r2) ^ $r0)) & 0xFFFF) << 5;\n $r3 |= $r3 >> 16;';\n\n\t\t\t\tif ( $j === $limit ) {\n\t\t\t\t\tif ( 64 === $limit ) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Mashing round.\n\t\t\t\t\t$encrypt_block .= '\n $r0 += $keys[$r3 & 0x3F];\n $r1 += $keys[$r0 & 0x3F];\n $r2 += $keys[$r1 & 0x3F];\n $r3 += $keys[$r2 & 0x3F];';\n\t\t\t\t\t$limit = $actions[ $limit ];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$encrypt_block .= '$in = pack(\"v4\", $r0, $r1, $r2, $r3);';\n\n\t\t\t// Create code for decryption.\n\t\t\t$limit = 44;\n\t\t\t$actions = [ $limit => 20, 20 => 0 ];\n\t\t\t$j = 64;\n\n\t\t\tfor ( ; ; ) {\n\t\t\t\t// R-mixing round.\n\t\t\t\t$decrypt_block .= '\n $r3 = ($r3 | ($r3 << 16)) >> 5;\n $r3 = ($r3 - ' . $keys[ -- $j ] . ' -\n ((($r0 ^ $r1) & $r2) ^ $r0)) & 0xFFFF;\n $r2 = ($r2 | ($r2 << 16)) >> 3;\n $r2 = ($r2 - ' . $keys[ -- $j ] . ' -\n ((($r3 ^ $r0) & $r1) ^ $r3)) & 0xFFFF;\n $r1 = ($r1 | ($r1 << 16)) >> 2;\n $r1 = ($r1 - ' . $keys[ -- $j ] . ' -\n ((($r2 ^ $r3) & $r0) ^ $r2)) & 0xFFFF;\n $r0 = ($r0 | ($r0 << 16)) >> 1;\n $r0 = ($r0 - ' . $keys[ -- $j ] . ' -\n ((($r1 ^ $r2) & $r3) ^ $r1)) & 0xFFFF;';\n\n\t\t\t\tif ( $j === $limit ) {\n\t\t\t\t\tif ( 0 === $limit ) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\t// R-mashing round.\n\t\t\t\t\t$decrypt_block .= '\n $r3 = ($r3 - $keys[$r2 & 0x3F]) & 0xFFFF;\n $r2 = ($r2 - $keys[$r1 & 0x3F]) & 0xFFFF;\n $r1 = ($r1 - $keys[$r0 & 0x3F]) & 0xFFFF;\n $r0 = ($r0 - $keys[$r3 & 0x3F]) & 0xFFFF;';\n\t\t\t\t\t$limit = $actions[ $limit ];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$decrypt_block .= '$in = pack(\"v4\", $r0, $r1, $r2, $r3);';\n\n\t\t\t// Creates the inline-crypt function\n\t\t\t$lambda_functions[ $code_hash ] = $this->_createInlineCryptFunction(\n\t\t\t\t[\n\t\t\t\t\t'init_crypt' => $init_crypt,\n\t\t\t\t\t'encrypt_block' => $encrypt_block,\n\t\t\t\t\t'decrypt_block' => $decrypt_block\n\t\t\t\t]\n\t\t\t);\n\t\t}\n\n\t\t// Set the inline-crypt function as callback in: $this->inline_crypt\n\t\t$this->inline_crypt = $lambda_functions[ $code_hash ];\n\t}", "public function __construct()\n {\n $this->method = 'des-ecb';\n\n // WinVNC uses a fixed key with reversed bits to encrypt/decrypt password in registry\n // Original Key: \\x17\\x52\\x6B\\x06\\x23\\x4E\\x58\\x07\n // Reversed Bits: \\xE8\\x4A\\xD6\\x60\\xC4\\x72\\x1A\\xE0\n $this->key = hex2bin('e84ad660c4721ae0');\n\n // We are sending raw data with zero padding to OpenSSL\n $this->options = OPENSSL_RAW_DATA | OPENSSL_ZERO_PADDING;\n\n // des-ecb seems to use 8 character block size\n $this->block_size = 8;\n }", "public function encryptionCipher()\n {\n return $this->encryptionCipher;\n }", "public function encryption($store = null);", "public function getCipher();", "public function __construct($key){\n\t\t\n\t\tif(empty($key)){\n\t\t\tthrow(new Exception(\"Cannot use empty key for encryption\"));\n\t\t}\n\t\t\n \t\t$this->key = md5($key);\n\t}", "protected function _computeEncryptionKey($password = '') {}", "public function getDefaultCrypt(): Encrypter|null;", "public function getEncryptionKey() {}", "public function __construct()\n {\n # Creates a major progression matrix\n $this->cypherMatrix = array(\n 'I' => array ('V', 'vi', 'ii', 'iii', 'VI6'),\n 'ii' => array ('iii', 'V', 'vi','I', 'VII65'),\n 'II6' => 'V',\n 'iii' => array ('I', 'V', 'IV'),\n 'III6' => 'vi',\n 'IV' => array ('V', 'I', 'bVII', 'vi', 'II6'),\n 'V' => array ('I', 'ii', 'iii', 'III6'),\n 'V6' => 'I',\n 'vi' => array ('ii', 'V6', 'IV'),\n 'VI6' => 'ii',\n 'bVII' => 'IV',\n 'viidim' => 'I',\n 'VII65' => 'iii'\n \n );\n \n \n # Creates a 12 tone MAJOR cypher scale\n $this->cypherScale = array(\n '1' => 'I',\n '2' => 'VI6',\n '3' => 'ii',\n '4' => 'VII65',\n '5' => 'iii',\n '6' => 'IV',\n '7' => 'II6',\n '8' => 'V',\n '9' => 'III6',\n '10' => 'vi',\n '11' => 'bVII',\n '12' => 'viidim',\n );\n \n \n \n # Creates a MINOR cypher progression matrix\n $this->cypherMatrixMinor = array(\n 'i' => array ('V', 'VI', 'iv', 'iidim56', 'I6'),\n 'I6' => array ('iv', 'II6'),\n 'iidim56' => 'V',\n 'II' => 'v',\n 'II6' => 'v',\n 'III' => array ('i', 'V', 'iv'),\n 'iv' => array ('V', 'i', 'iidim56', 'III'),\n 'IV6' => 'VII',\n 'v' => array ('III', 'V'),\n 'V' => 'i',\n 'V65' => 'i',\n 'VI' => array ('III', 'VII', 'iv'),\n 'VII' => 'V', \n );\n\n \n \n # Creates a 12 tone MINOR cypher scale\n $this->cypherScaleMinor = array(\n '1' => 'i',\n '2' => 'V65',\n '3' => 'iidim7',\n '4' => 'III', \n '5' => 'I6', # Doesn't exist in minor scale\n '6' => 'iv',\n '7' => 'II6', # Another first inversion to cover exception\n '8' => 'V',\n '9' => 'VI',\n '10' => 'IV6',\n '11' => 'VII',\n '12' => 'V65',\n );\n \n # Creates a chord progression matrix\n $this->fullChordMatrix = array(\n 'c' => array('g6', 'am', 'dmaj7', 'dm'),\n 'dm' => array('emaj7', 'g', 'g6', 'amaj7'),\n 'dmaj7' => array('g', 'g6'),\n 'em' => array('c', 'emaj7'),\n 'emaj7' => 'am',\n 'g' => array('g7', 'c', 'dmaj7', 'em'),\n 'g6' => array('dmaj7', 'amaj7'),\n 'g7' => 'c',\n 'am' => array('dm', 'bmaj7'),\n 'amaj7' => array('dm', 'bb'),\n 'bb' => 'g6',\n 'bmaj7' => 'emaj7', \n );\n \n # Creates a 12 tone scale array\n $this->serialScale = array(\n '1' => 'c',\n '2' => 'c#',\n '3' => 'd',\n '4' => 'd#',\n '5' => 'e',\n '6' => 'f',\n '7' => 'f#',\n '8' => 'g',\n '9' => 'g#',\n '10' => 'a',\n '11' => 'a#',\n '12' => 'b',\n \n );\n \n # Creates a 12 tone scale array in MAJOR\n $this->serialScaleMajor = array(\n '1' => 'C',\n '2' => 'C#',\n '3' => 'D',\n '4' => 'D#',\n '5' => 'E',\n '6' => 'F',\n '7' => 'F#',\n '8' => 'G',\n '9' => 'G#',\n '10' => 'A',\n '11' => 'A#',\n '12' => 'B',\n \n );\n \n \n \n $this->tonalityIndex = array (\n \n 'FIndexMajor' => array(\n 'I' => 'F',\n 'ii' => 'g',\n 'iii' => 'a',\n 'IV' => 'Bb',\n 'V' => 'C',\n 'vi' => 'd',\n 'viidim' => 'edim', \n ),\n \n 'GIndexMajor' => array(\n 'I' => 'G',\n 'ii' => 'a',\n 'iii' => 'b',\n 'IV' => 'C',\n 'V' => 'D',\n 'vi' => 'e',\n 'viidim' => 'f#dim6',\n ),\n \n 'GIndexMinor' => array(\n 'i' => 'G',\n 'iidim7' => 'adim7',\n 'III' => 'Bb',\n 'iv' => 'c7',\n 'V' => 'D',\n 'VI' => 'Eb',\n 'VII' => 'f',\n ),\n \n 'CIndexMajor' => array(\n 'I' => 'C',\n 'ii' => 'd7',\n 'II6' => 'D6',\n 'iii' => 'e',\n 'III6' => 'E6',\n 'IV' => 'F',\n 'V' => 'G',\n 'V6' => 'G6',\n 'vi' => 'a',\n 'VI6' => 'A6',\n 'bVII' => 'Bb',\n 'viidim' => 'bdim',\n 'VII65' => 'bhalfdim',\n ),\n \n 'AbIndexMajor' => array(\n 'I' => 'Ab',\n 'ii' => 'bb',\n 'II6' => 'Bb6',\n 'iii' => 'c',\n 'III6' => 'C6',\n 'IV' => 'Db',\n 'V' => 'Eb',\n 'V6' => 'Eb6',\n 'vi' => 'f',\n 'VI6' => 'F6',\n 'bVII' => 'Gb',\n 'viidim' => 'gdim6',\n 'VII65' => 'ghalfdim',\n ),\n \n \n 'AIndexMinor' => array(\n 'i' => 'a',\n 'I6' => 'A6',\n 'iidim7' => 'bdim7',\n 'iidim56' => 'bdim56',\n 'II' => 'B',\n 'II6' => 'B6',\n 'III' => 'C',\n 'iv' => 'd',\n 'IV6' => 'D6',\n 'v' => 'e',\n 'V' => 'E',\n 'V65' => 'E65',\n 'VI' => 'F',\n 'VII' => 'G',\n ),\n \n 'CIndexMinor' => array(\n 'i' => 'c',\n 'I6' => 'C6',\n 'iidim7' => 'ddim7',\n 'iidim56' => 'ddim56',\n 'II' => 'D',\n 'II6' => 'D6',\n 'III' => 'Eb',\n 'iv' => 'f',\n 'IV6' => 'D6',\n 'v' => 'g',\n 'V' => 'G',\n 'V65' => 'G65',\n 'VI' => 'Ab',\n 'VII' => 'Bb', \n ),\n );\n \n # Progressions ending on same degree as start\n $this->progressionListMaj1 = array (\"5\", \"6\", \"5\", \"5\", \"5\", \"5\", \"5\"); # a \"6-5\" progression\n $this->progressionListMaj2 = array (\"7\", \"2\", \"7\", \"1\", \"-5\"); # a \"5-2\" progression\n \n $this->progressionListMin1 = array (\"5\", \"5\", \"5\", \"5\", \"6\", \"5\", \"5\"); # 6-5\n $this->progressionListMin2 = array (\"7\", \"1\", \"7\", \"2\", \"7\"); # 5-2\n \n }", "private function crypto() {\n if ($this->cripto === null) {\n $this->cripto = new Crypto();\n }\n return $this->cripto;\n }", "public static function cryptopass(string $sText, int $iAction): string {\n $sOutput = '';\n $sCryptMethod = \"AES-256-CTR\";\n $sKey = ProjectConfigs::pass_key;\n $sIv = ProjectConfigs::pass_iv;\n \n $sHashedIv = hash('sha256', $sIv);\n $sFinalIv = substr($sHashedIv, 0, 16); //We need 16 Bytes (256 bits)\n $sHashedKey = hash('sha256', $sKey);\n \n if($iAction === self::ENCRYPT) {\n $sEncrypted = openssl_encrypt($sText, $sCryptMethod, $sHashedKey, 0, $sFinalIv);\n $sOutput = base64_encode($sEncrypted);\n } \n else if($iAction === self::DECRYPT) {\n $sDecoded = base64_decode($sText);\n $sOutput = openssl_decrypt($sDecoded, $sCryptMethod, $sHashedKey, 0, $sFinalIv);\n }\n \n return $sOutput;\n }", "function encrypt($string) { \r\n\tglobal $key;\r\n\t$result = Cryptor::Encrypt($string,$key);\r\n\treturn $result;\r\n}", "protected function generateEncryptionKeyIfNeeded() {}", "public function __construct()\n {\n $this->_mcryptExists = (!function_exists('mcrypt_encrypt')) ? false : true;\n\n if ($this->_mcryptExists === false) {\n throw new FlyException(Fly::t('fly', 'The Encrypt library requires the Mcrypt extension.'));\n }\n\n Fly::log('debug', \"Encrypt Class Initialized\");\n }", "function break_repeating_key_XOR($args = NULL) {\n\n\n\tif ($args==NULL) {\n\t\treturn false;\n\t}\n\n\t// INIT PARAMETERS\n\t$kl_min = 2;\n\t$kl_max = 10;\n\tif (isset($args['kl_min'])) {\n\t\t$kl_min = $args['kl_min'];\n\t}\n\tif (isset($args['kl_max'])) {\n\t\t$kl_max = $args['kl_max'];\n\t}\n\n\t// Recupero il testo cifrato a seconda che venga passato direttamente\n\t// o sia passato l'url di un file\n\t$cypher = '';\n\tif ($args['file']!=NULL) {\n\t\t$lines = file($args['file'], FILE_IGNORE_NEW_LINES);\n\n\t\tset_time_limit(0);\n\t\tforeach($lines as $line) {\n\t\t\t$cypher .= $line;\n\t\t}\n\t\tset_time_limit(30);\n\t}\n\telse if ($args['string']) {\n\t\t$cypher = $args['string'];\n\t}\n\n\t//echo $cypher.\"<br><br>\";\n\n\t$cypher = $this->base64_to_hex($cypher);\n\t$array_norm_keylegth = array();\n\tfor ($keylength=2; $keylength <= 40; $keylength++) { \n\t\t$sum = 0;\n\t\t$keylength_byte = $keylength*2;\n\t\t//echo $keylength.\"<br>\";\n\t\tfor ($i=0; $i < 4; $i++) { \n\t\t\t$str1 = substr($cypher, ($keylength_byte*2)*$i, $keylength_byte);\n\t\t\t$str2 = substr($cypher, (($keylength_byte*2)*$i)+$keylength_byte, $keylength_byte);\n\t\t\t//echo \"#### \".$str1.\"<br>\";\n\t\t\t//echo \"#### \".$str2.\"<br>\";\n\t\t\t//echo \"#### \".$this->helper->hamming_distance($str1, $str2)/$keylength.\"<br><br>\";\n\t\t\t$sum = $sum + $this->helper->hamming_distance($str1, $str2)/$keylength_byte;\n\t\t}\n\n\t\t//echo \"######## \".$sum.\"<br>\";\n\t\t//echo \"######## \".($sum/4).\"<br>\".\"<br>\";\n\n\t\t//echo \"###################################<br><br>\";\n\t\t\n\t\t$array_norm_keylegth[] = array('norm_keylength' => $sum/4, 'keylength' => $keylength_byte);\n\t\t\n\t}\n\n\tusort($array_norm_keylegth, function($a, $b) {\n\t\t$el1 = $a['norm_keylength'];\n\t\t$el2 = $b['norm_keylength'];\n\n\t\tif ($el1 == $el2) return 0;\n\n\t\treturn ($el1 < $el2) ? -1 : 1;\n\t});\n\n\t//echo \"<pre>\";\n\t//print_r($array_norm_keylegth);\n\t//echo \"</pre>\";\n\n\t$keylength_candidata = $array_norm_keylegth[0]['keylength'];\n\n\t$array_blocchi_testo_keylength = $this->helper->unique_split_to_array($cypher, $keylength_candidata*2);\n\n\t//echo \"<pre>\";\n\t//print_r($array_blocchi_testo_keylength);\n\t//echo \"</pre>\";\n\n\t$array_string = array();\n\tfor ($i=0; $i<(($keylength_candidata*2)); $i += 2) { \n\t\t$partial_string = '';\n\t\tforeach ($array_blocchi_testo_keylength as $string) {\n\t\t\t$partial_string .= substr($string, $i, 2);\n\t\t}\n\t\t$array_string[] = $partial_string;\n\n\t\techo \"<pre>\";\n\t\tprint_r($this->single_byte_xor_cipher($partial_string, \n\t\t\t\t\t\t\t\t\t\t \t 16, \n\t\t\t\t\t\t\t\t\t\t \t array('min'=>0, 'max'=>255),\n\t\t\t\t\t\t\t\t\t\t \t array('total_letter'=>1,\n\t\t\t\t\t\t\t\t\t\t\t\t\t'first_letter'=>0,\n\t\t\t\t\t\t\t\t\t\t\t\t\t'second_letter'=>0)));\n\t\techo \"</pre>\";\n\n\t\techo \"<br>################################################</br>\";\n\t}/**/\n\n\techo \"<pre>\";\n\tprint_r($array_string);\n\techo \"</pre>\";\n\n\t// Controllo le ripetizioni di sottostrighe\n\t/*set_time_limit(0);\n\t$array_text = array();\n\n\t$dim_cypher = strlen($cypher);\n\t$occurences = array();\n\n\tfor ($i = floor($dim_cypher/2); $i>0; $i--) {\n\t\t$offset_sx = 0;\n\t\t$offset_dx = $dim_cypher-$i;\n\t\t$finito = false;\n\t\twhile ((($i <= $offset_sx)||($i<=$offset_dx))\n\t\t\t &&($offset_sx<=$dim_cypher)\n\t\t\t &&($offset_dx>=0)) {\n\n\t\t\t$text = substr($cypher, $offset_sx, $i);\n\n\t\t\t$occurences = $this->helper->strpos_all($cypher, $text);\n\t\t\tif (count($occurences)>1) {\n\t\t\t\t$finito = true;\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t$offset_sx++;\n\t\t\t$offset_dx--;\n\t\t}\n\n\t\tif ($finito) {\n\t\t\tbreak;\n\t\t}\n\t}\n\tset_time_limit(30);\n\n\t/*echo $text.\"<br>\";\n\tprint_r($occurences);*/\n\n\n\t// Possibili keylengths e valutazione con distanza di hemming\n\t/*set_time_limit(0);\n\t$distance = $occurences[1] - $occurences[0];\n\t//echo \"<br>distance: \".$distance.\"<br>\";\n\n\t$keylengths = 0;\n\t$array_somme = array();\n\t$smaller_avarage_dist = 0;\n\t$guessed_keylength = 0;\n\tfor ($i=1; $i <= $distance; $i++) { \n\t\t//echo \"<br>#### distance%i: \".($distance%$i).\"<br>\";\n\t\tif (($distance%$i)==0) {\n\t\t\t$keylength = $distance/$i; // sottomultipli $distance\n\n\t\t\tif ($keylength>2) {\n\t\t\t\t//echo \"<br>######## keylengths: \".($keylengths).\"<br>\";\n\t\t\t\t$array_blocchi_testo = $this->helper->unique_split_to_array($cypher, $keylength);\n\t\t\t\t//print_r($array_blocchi_testo);\n\t\t\t\t$d_crypt = 0;\n\t\t\t\t$somma_d_crypt = 0;\n\t\t\t\tfor ($j=0; $j < count($array_blocchi_testo)-1; $j += 2) { \n\t\t\t\t\t$str1 = $array_blocchi_testo[$j];\n\t\t\t\t\t$str2 = $array_blocchi_testo[$j+1];\n\n\t\t\t\t\tif (strlen($str1) == strlen($str2)) {\n\t\t\t\t\t\t$d_crypt = $this->helper->hamming_distance($str1, $str2)/$keylength;\n\t\t\t\t\t}\n\n\t\t\t\t\t$somma_d_crypt = $somma_d_crypt + $d_crypt;\n\n\t\t\t\t}\n\t\t\t\t//echo \"<br>######## j-2\".($j-2).\"<br>\";\n\t\t\t\t$array_somme[] = array(\"avar_norm\"=>$somma_d_crypt/($j-2), \"keylength\"=>$keylength);\n\t\t\t}\n\t\t}\n\n\t}\n\tset_time_limit(30);\n\n\tusort($array_somme, function($a, $b) {\n\t\t$el1 = $a['avar_norm'];\n\t\t$el2 = $b['avar_norm'];\n\n\t\tif ($el1 == $el2) return 0;\n\n\t\treturn ($el1 < $el2) ? -1 : 1;\n\t});\n\n\t$keylength_candidata = $array_somme[0]['keylength'];\n\n\t$array_blocchi_testo_keylength = $this->helper->unique_split_to_array($cypher, $keylength_candidata);\n\n\t/*echo \"<pre>\";\n\tprint_r($array_blocchi_testo_keylength);\n\techo \"</pre>\";*/\n\n\t/*$array_string = array();\n\tfor ($i=0; $i<$keylength_candidata; $i++) { \n\t\t$partial_string = '';\n\t\tforeach ($array_blocchi_testo_keylength as $string) {\n\t\t\t$partial_string .= $string[$i];\n\t\t}\n\t\t$array_string[$i] = $this->base64_to_hex($partial_string);\n\n\t\techo \"<pre>\";\n\t\tprint_r($this->single_byte_xor_cipher($array_string[$i], \n\t\t\t\t\t\t\t\t\t\t \t 16, \n\t\t\t\t\t\t\t\t\t\t \t array('min'=>0, 'max'=>255),\n\t\t\t\t\t\t\t\t\t\t \t array('total_letter'=>1,\n\t\t\t\t\t\t\t\t\t\t\t\t\t'first_letter'=>0,\n\t\t\t\t\t\t\t\t\t\t\t\t\t'second_letter'=>0))[0]);\n\t\techo \"</pre>\";\n\n\t\techo \"<br>################################################</br>\";\n\t}\n\n\t/*echo \"<pre>\";\n\tprint_r($array_string);\n\techo \"</pre>\";*/\n\n}", "public static function encrypt($data)\n {\n $simple_string = $data ;//this->getData();\n\n // Storingthe cipher method \n $ciphering = self::$ENCRYPTION_ALGORITHM; // \"AES-128-CTR\";\n\n // Using OpenSSl Encryption method \n $iv_length = openssl_cipher_iv_length($ciphering);\n $options = 0;\n\n // Non-NULL Initialization Vector for encryption \n $encryption_iv = self::$encrypt_iv;//'617263616e67656c3c336d696572';\n\n // Storing the encryption key \n $encryption_key = self::getKey();\n\n // Using openssl_encrypt() function to encrypt the data \n $encryption = openssl_encrypt($simple_string, $ciphering, $encryption_key, $options, $encryption_iv);\n return $encryption;\n }", "public static function pubCrypt($symKey){\n\t\topenssl_public_encrypt($symKey, $encSymKey, self::getPubKey(), OPENSSL_PKCS1_OAEP_PADDING); //The default OPENSSL_PKCS1_PADDING is deprecated.\n\t\treturn base64_encode($encSymKey);\n\t}", "public function __construct($compress = true) {\n $this->encrypt = new encrypt($compress);\n }", "function Crypt_Rijndael($mode = CRYPT_RIJNDAEL_MODE_CBC)\r\n {\r\n switch ($mode) {\r\n case CRYPT_RIJNDAEL_MODE_ECB:\r\n case CRYPT_RIJNDAEL_MODE_CBC:\r\n $this->mode = $mode;\r\n break;\r\n default:\r\n $this->mode = CRYPT_RIJNDAEL_MODE_CBC;\r\n }\r\n\r\n // according to <http://csrc.nist.gov/archive/aes/rijndael/Rijndael-ammended.pdf#page=19> (section 5.2.1), \r\n // precomputed tables can be used in the mixColumns phase. in that example, they're assigned t0...t3, so\r\n // those are the names we'll use.\r\n $this->t3 = array(\r\n 0x6363A5C6, 0x7C7C84F8, 0x777799EE, 0x7B7B8DF6, 0xF2F20DFF, 0x6B6BBDD6, 0x6F6FB1DE, 0xC5C55491, \r\n 0x30305060, 0x01010302, 0x6767A9CE, 0x2B2B7D56, 0xFEFE19E7, 0xD7D762B5, 0xABABE64D, 0x76769AEC, \r\n 0xCACA458F, 0x82829D1F, 0xC9C94089, 0x7D7D87FA, 0xFAFA15EF, 0x5959EBB2, 0x4747C98E, 0xF0F00BFB, \r\n 0xADADEC41, 0xD4D467B3, 0xA2A2FD5F, 0xAFAFEA45, 0x9C9CBF23, 0xA4A4F753, 0x727296E4, 0xC0C05B9B, \r\n 0xB7B7C275, 0xFDFD1CE1, 0x9393AE3D, 0x26266A4C, 0x36365A6C, 0x3F3F417E, 0xF7F702F5, 0xCCCC4F83, \r\n 0x34345C68, 0xA5A5F451, 0xE5E534D1, 0xF1F108F9, 0x717193E2, 0xD8D873AB, 0x31315362, 0x15153F2A, \r\n 0x04040C08, 0xC7C75295, 0x23236546, 0xC3C35E9D, 0x18182830, 0x9696A137, 0x05050F0A, 0x9A9AB52F, \r\n 0x0707090E, 0x12123624, 0x80809B1B, 0xE2E23DDF, 0xEBEB26CD, 0x2727694E, 0xB2B2CD7F, 0x75759FEA, \r\n 0x09091B12, 0x83839E1D, 0x2C2C7458, 0x1A1A2E34, 0x1B1B2D36, 0x6E6EB2DC, 0x5A5AEEB4, 0xA0A0FB5B, \r\n 0x5252F6A4, 0x3B3B4D76, 0xD6D661B7, 0xB3B3CE7D, 0x29297B52, 0xE3E33EDD, 0x2F2F715E, 0x84849713, \r\n 0x5353F5A6, 0xD1D168B9, 0x00000000, 0xEDED2CC1, 0x20206040, 0xFCFC1FE3, 0xB1B1C879, 0x5B5BEDB6, \r\n 0x6A6ABED4, 0xCBCB468D, 0xBEBED967, 0x39394B72, 0x4A4ADE94, 0x4C4CD498, 0x5858E8B0, 0xCFCF4A85, \r\n 0xD0D06BBB, 0xEFEF2AC5, 0xAAAAE54F, 0xFBFB16ED, 0x4343C586, 0x4D4DD79A, 0x33335566, 0x85859411, \r\n 0x4545CF8A, 0xF9F910E9, 0x02020604, 0x7F7F81FE, 0x5050F0A0, 0x3C3C4478, 0x9F9FBA25, 0xA8A8E34B, \r\n 0x5151F3A2, 0xA3A3FE5D, 0x4040C080, 0x8F8F8A05, 0x9292AD3F, 0x9D9DBC21, 0x38384870, 0xF5F504F1, \r\n 0xBCBCDF63, 0xB6B6C177, 0xDADA75AF, 0x21216342, 0x10103020, 0xFFFF1AE5, 0xF3F30EFD, 0xD2D26DBF, \r\n 0xCDCD4C81, 0x0C0C1418, 0x13133526, 0xECEC2FC3, 0x5F5FE1BE, 0x9797A235, 0x4444CC88, 0x1717392E, \r\n 0xC4C45793, 0xA7A7F255, 0x7E7E82FC, 0x3D3D477A, 0x6464ACC8, 0x5D5DE7BA, 0x19192B32, 0x737395E6, \r\n 0x6060A0C0, 0x81819819, 0x4F4FD19E, 0xDCDC7FA3, 0x22226644, 0x2A2A7E54, 0x9090AB3B, 0x8888830B, \r\n 0x4646CA8C, 0xEEEE29C7, 0xB8B8D36B, 0x14143C28, 0xDEDE79A7, 0x5E5EE2BC, 0x0B0B1D16, 0xDBDB76AD, \r\n 0xE0E03BDB, 0x32325664, 0x3A3A4E74, 0x0A0A1E14, 0x4949DB92, 0x06060A0C, 0x24246C48, 0x5C5CE4B8, \r\n 0xC2C25D9F, 0xD3D36EBD, 0xACACEF43, 0x6262A6C4, 0x9191A839, 0x9595A431, 0xE4E437D3, 0x79798BF2, \r\n 0xE7E732D5, 0xC8C8438B, 0x3737596E, 0x6D6DB7DA, 0x8D8D8C01, 0xD5D564B1, 0x4E4ED29C, 0xA9A9E049, \r\n 0x6C6CB4D8, 0x5656FAAC, 0xF4F407F3, 0xEAEA25CF, 0x6565AFCA, 0x7A7A8EF4, 0xAEAEE947, 0x08081810, \r\n 0xBABAD56F, 0x787888F0, 0x25256F4A, 0x2E2E725C, 0x1C1C2438, 0xA6A6F157, 0xB4B4C773, 0xC6C65197, \r\n 0xE8E823CB, 0xDDDD7CA1, 0x74749CE8, 0x1F1F213E, 0x4B4BDD96, 0xBDBDDC61, 0x8B8B860D, 0x8A8A850F, \r\n 0x707090E0, 0x3E3E427C, 0xB5B5C471, 0x6666AACC, 0x4848D890, 0x03030506, 0xF6F601F7, 0x0E0E121C, \r\n 0x6161A3C2, 0x35355F6A, 0x5757F9AE, 0xB9B9D069, 0x86869117, 0xC1C15899, 0x1D1D273A, 0x9E9EB927, \r\n 0xE1E138D9, 0xF8F813EB, 0x9898B32B, 0x11113322, 0x6969BBD2, 0xD9D970A9, 0x8E8E8907, 0x9494A733, \r\n 0x9B9BB62D, 0x1E1E223C, 0x87879215, 0xE9E920C9, 0xCECE4987, 0x5555FFAA, 0x28287850, 0xDFDF7AA5, \r\n 0x8C8C8F03, 0xA1A1F859, 0x89898009, 0x0D0D171A, 0xBFBFDA65, 0xE6E631D7, 0x4242C684, 0x6868B8D0, \r\n 0x4141C382, 0x9999B029, 0x2D2D775A, 0x0F0F111E, 0xB0B0CB7B, 0x5454FCA8, 0xBBBBD66D, 0x16163A2C\r\n );\r\n\r\n $this->dt3 = array(\r\n 0xF4A75051, 0x4165537E, 0x17A4C31A, 0x275E963A, 0xAB6BCB3B, 0x9D45F11F, 0xFA58ABAC, 0xE303934B, \r\n 0x30FA5520, 0x766DF6AD, 0xCC769188, 0x024C25F5, 0xE5D7FC4F, 0x2ACBD7C5, 0x35448026, 0x62A38FB5, \r\n 0xB15A49DE, 0xBA1B6725, 0xEA0E9845, 0xFEC0E15D, 0x2F7502C3, 0x4CF01281, 0x4697A38D, 0xD3F9C66B, \r\n 0x8F5FE703, 0x929C9515, 0x6D7AEBBF, 0x5259DA95, 0xBE832DD4, 0x7421D358, 0xE0692949, 0xC9C8448E, \r\n 0xC2896A75, 0x8E7978F4, 0x583E6B99, 0xB971DD27, 0xE14FB6BE, 0x88AD17F0, 0x20AC66C9, 0xCE3AB47D, \r\n 0xDF4A1863, 0x1A3182E5, 0x51336097, 0x537F4562, 0x6477E0B1, 0x6BAE84BB, 0x81A01CFE, 0x082B94F9, \r\n 0x48685870, 0x45FD198F, 0xDE6C8794, 0x7BF8B752, 0x73D323AB, 0x4B02E272, 0x1F8F57E3, 0x55AB2A66, \r\n 0xEB2807B2, 0xB5C2032F, 0xC57B9A86, 0x3708A5D3, 0x2887F230, 0xBFA5B223, 0x036ABA02, 0x16825CED, \r\n 0xCF1C2B8A, 0x79B492A7, 0x07F2F0F3, 0x69E2A14E, 0xDAF4CD65, 0x05BED506, 0x34621FD1, 0xA6FE8AC4, \r\n 0x2E539D34, 0xF355A0A2, 0x8AE13205, 0xF6EB75A4, 0x83EC390B, 0x60EFAA40, 0x719F065E, 0x6E1051BD, \r\n 0x218AF93E, 0xDD063D96, 0x3E05AEDD, 0xE6BD464D, 0x548DB591, 0xC45D0571, 0x06D46F04, 0x5015FF60, \r\n 0x98FB2419, 0xBDE997D6, 0x4043CC89, 0xD99E7767, 0xE842BDB0, 0x898B8807, 0x195B38E7, 0xC8EEDB79, \r\n 0x7C0A47A1, 0x420FE97C, 0x841EC9F8, 0x00000000, 0x80868309, 0x2BED4832, 0x1170AC1E, 0x5A724E6C, \r\n 0x0EFFFBFD, 0x8538560F, 0xAED51E3D, 0x2D392736, 0x0FD9640A, 0x5CA62168, 0x5B54D19B, 0x362E3A24, \r\n 0x0A67B10C, 0x57E70F93, 0xEE96D2B4, 0x9B919E1B, 0xC0C54F80, 0xDC20A261, 0x774B695A, 0x121A161C, \r\n 0x93BA0AE2, 0xA02AE5C0, 0x22E0433C, 0x1B171D12, 0x090D0B0E, 0x8BC7ADF2, 0xB6A8B92D, 0x1EA9C814, \r\n 0xF1198557, 0x75074CAF, 0x99DDBBEE, 0x7F60FDA3, 0x01269FF7, 0x72F5BC5C, 0x663BC544, 0xFB7E345B, \r\n 0x4329768B, 0x23C6DCCB, 0xEDFC68B6, 0xE4F163B8, 0x31DCCAD7, 0x63851042, 0x97224013, 0xC6112084, \r\n 0x4A247D85, 0xBB3DF8D2, 0xF93211AE, 0x29A16DC7, 0x9E2F4B1D, 0xB230F3DC, 0x8652EC0D, 0xC1E3D077, \r\n 0xB3166C2B, 0x70B999A9, 0x9448FA11, 0xE9642247, 0xFC8CC4A8, 0xF03F1AA0, 0x7D2CD856, 0x3390EF22, \r\n 0x494EC787, 0x38D1C1D9, 0xCAA2FE8C, 0xD40B3698, 0xF581CFA6, 0x7ADE28A5, 0xB78E26DA, 0xADBFA43F, \r\n 0x3A9DE42C, 0x78920D50, 0x5FCC9B6A, 0x7E466254, 0x8D13C2F6, 0xD8B8E890, 0x39F75E2E, 0xC3AFF582, \r\n 0x5D80BE9F, 0xD0937C69, 0xD52DA96F, 0x2512B3CF, 0xAC993BC8, 0x187DA710, 0x9C636EE8, 0x3BBB7BDB, \r\n 0x267809CD, 0x5918F46E, 0x9AB701EC, 0x4F9AA883, 0x956E65E6, 0xFFE67EAA, 0xBCCF0821, 0x15E8E6EF, \r\n 0xE79BD9BA, 0x6F36CE4A, 0x9F09D4EA, 0xB07CD629, 0xA4B2AF31, 0x3F23312A, 0xA59430C6, 0xA266C035, \r\n 0x4EBC3774, 0x82CAA6FC, 0x90D0B0E0, 0xA7D81533, 0x04984AF1, 0xECDAF741, 0xCD500E7F, 0x91F62F17, \r\n 0x4DD68D76, 0xEFB04D43, 0xAA4D54CC, 0x9604DFE4, 0xD1B5E39E, 0x6A881B4C, 0x2C1FB8C1, 0x65517F46, \r\n 0x5EEA049D, 0x8C355D01, 0x877473FA, 0x0B412EFB, 0x671D5AB3, 0xDBD25292, 0x105633E9, 0xD647136D, \r\n 0xD7618C9A, 0xA10C7A37, 0xF8148E59, 0x133C89EB, 0xA927EECE, 0x61C935B7, 0x1CE5EDE1, 0x47B13C7A, \r\n 0xD2DF599C, 0xF2733F55, 0x14CE7918, 0xC737BF73, 0xF7CDEA53, 0xFDAA5B5F, 0x3D6F14DF, 0x44DB8678, \r\n 0xAFF381CA, 0x68C43EB9, 0x24342C38, 0xA3405FC2, 0x1DC37216, 0xE2250CBC, 0x3C498B28, 0x0D9541FF, \r\n 0xA8017139, 0x0CB3DE08, 0xB4E49CD8, 0x56C19064, 0xCB84617B, 0x32B670D5, 0x6C5C7448, 0xB85742D0\r\n );\r\n\r\n for ($i = 0; $i < 256; $i++) {\r\n $this->t2[$i << 8] = (($this->t3[$i] << 8) & 0xFFFFFF00) | (($this->t3[$i] >> 24) & 0x000000FF);\r\n $this->t1[$i << 16] = (($this->t3[$i] << 16) & 0xFFFF0000) | (($this->t3[$i] >> 16) & 0x0000FFFF);\r\n $this->t0[$i << 24] = (($this->t3[$i] << 24) & 0xFF000000) | (($this->t3[$i] >> 8) & 0x00FFFFFF);\r\n\r\n $this->dt2[$i << 8] = (($this->dt3[$i] << 8) & 0xFFFFFF00) | (($this->dt3[$i] >> 24) & 0x000000FF);\r\n $this->dt1[$i << 16] = (($this->dt3[$i] << 16) & 0xFFFF0000) | (($this->dt3[$i] >> 16) & 0x0000FFFF);\r\n $this->dt0[$i << 24] = (($this->dt3[$i] << 24) & 0xFF000000) | (($this->dt3[$i] >> 8) & 0x00FFFFFF);\r\n }\r\n }", "public function __construct()\n {\n if (!isset(self::$_defaultCypher)) {\n //detect what cypher to use by default\n\n //TODO: Add more cypher types\n self::$_defaultCypher = self::CYPHER_BASIC;\n }\n\n if (!isset(self::$_siteKey)) {\n $db = DataAccess::getInstance();\n //NOTE: license_verify: Nothing to do with license or verify,\n //this is just to make it slightly harder for someone to\n //figure out the key, by naming it something that doesn't\n //sound like a key.\n $key = base64_decode($db->get_site_setting('license_verify'));\n if ($key === false || strlen($key) < 100) {\n //need to generate a random key, between 100 and 200 chars long\n $key = self::generateRandomKey(100, 180);\n $db->set_site_setting('license_verify', base64_encode($key));\n }\n self::$_siteKey = $key;\n }\n }", "public function getCrypt(): Encrypter|null;", "function _mcryptSetup()\n {\n if (!$this->changed) {\n return;\n }\n\n if (!$this->explicit_key_length) {\n // this just copied from Crypt_Rijndael::_setup()\n $length = strlen($this->key) >> 2;\n if ($length > 8) {\n $length = 8;\n } else if ($length < 4) {\n $length = 4;\n }\n $this->Nk = $length;\n $this->key_size = $length << 2;\n }\n\n switch ($this->Nk) {\n case 4: // 128\n $this->key_size = 16;\n break;\n case 5: // 160\n case 6: // 192\n $this->key_size = 24;\n break;\n case 7: // 224\n case 8: // 256\n $this->key_size = 32;\n }\n\n $this->key = str_pad(substr($this->key, 0, $this->key_size), $this->key_size, chr(0));\n $this->encryptIV = $this->decryptIV = $this->iv = str_pad(substr($this->iv, 0, 16), 16, chr(0));\n\n if (!isset($this->enmcrypt)) {\n $mode = $this->mode;\n //$mode = $this->mode == CRYPT_AES_MODE_CTR ? MCRYPT_MODE_ECB : $this->mode;\n\n $this->demcrypt = mcrypt_module_open(MCRYPT_RIJNDAEL_128, '', $mode, '');\n $this->enmcrypt = mcrypt_module_open(MCRYPT_RIJNDAEL_128, '', $mode, '');\n\n if ($mode == 'ncfb') {\n $this->ecb = mcrypt_module_open(MCRYPT_RIJNDAEL_128, '', MCRYPT_MODE_ECB, '');\n }\n\n } // else should mcrypt_generic_deinit be called?\n\n mcrypt_generic_init($this->demcrypt, $this->key, $this->iv);\n mcrypt_generic_init($this->enmcrypt, $this->key, $this->iv);\n\n if ($this->mode == 'ncfb') {\n mcrypt_generic_init($this->ecb, $this->key, \"\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\");\n }\n\n $this->changed = false;\n }", "public function getEncryptionKey();", "function mysql_aes_key($key)\n{\n $bytes = 16;\n $newKey = \\str_repeat(\\chr(0), $bytes);\n $length = \\strlen($key);\n\n for ($i = 0; $i < $length; $i++) {\n $index = $i % $bytes;\n $newKey[$index] = $newKey[$index] ^ $key[$i];\n }\n\n return $newKey;\n}", "public static function getEncryption() {\n return IPlayerConfiguration::CRYPTOGRAPHY_ALGORITHM_NAME . IPlayerConfiguration::CRYPTOGRAPHY_ALGORITHM_VERSION;\n }", "private function _getCipher()\n {\n if ($this->_mcryptCipher == '') {\n $this->_mcryptCipher = MCRYPT_RIJNDAEL_256;\n }\n return $this->_mcryptCipher;\n }", "function fsl_encrypt($string, $key = NULL){\n\n //set key to default key if no key passed to function \n $encryption_key = (empty($key)) ? option('fsl_global_encryption_key') : $key;\n\n // Generate an initialization vector\n // This *MUST* be available for decryption as well\n $iv = openssl_random_pseudo_bytes(openssl_cipher_iv_length('aes-256-cbc'));\n\n // Create some data to encrypt\n \n // Encrypt $data using aes-256-cbc cipher with the given encryption key and\n // our initialization vector. The 0 gives us the default options, but can\n // be changed to OPENSSL_RAW_DATA or OPENSSL_ZERO_PADDING\n $encrypted = openssl_encrypt($string, 'aes-256-cbc', $encryption_key, 0, $iv);\n\n // If we lose the $iv variable, we can't decrypt this, so:\n // - $encrypted is already base64-encoded from openssl_encrypt\n // - Append a separator that we know won't exist in base64, \":\"\n // - And then append a base64-encoded $iv\n $encrypted = $encrypted . ':' . base64_encode($iv);\n\n return $encrypted;\n}", "public function encrypt()\n {\n $this->items = base64_encode(gzcompress($this->flip()->toJson()));\n\n return $this;\n }", "public function encrypt($str, $key, $method = '') {\n // Set cipher_method to AES-256-CBC as standard if none is present\n if($method == '') {\n $method = $this->cipher_method;\n }\n \n // Create return array\n $return = array('decrypted' => addslashes(trim($str)), 'encrypted' => '', 'key' => $key, 'safekey' => '', 'algorithm' => $this->cipher_algorithm, 'method' => $method, 'iv' => '', 'base64_encode' => array(), 'error' => array(), 'decryptedlen' => strlen(addslashes(trim($str))), 'encryptedlen' => 0, 'compressedlen' => 0);\n\n // String cannot be empty\n if($str == '') {\n $return['error'][] = 'String empty';\n return $return;\n }\n \n // Key cannot be empty\n if($key=='') {\n $return['error'][] = 'Key empty';\n trigger_error('Key can not be empty', E_USER_NOTICE); \n return $return;\n } else {\n $key = substr(hash($this->cipher_algorithm, $key, true), 0, 32);\n $return['safekey'] = bin2hex($key);\n }\n \n // Generate cipher_algorithm string to glue it to output string\n $len = 32;\n $algorithm = $this->textToBinary(mb_substr($this->cipher_algorithm.'_'.$this->generateRandomString($len-strlen($this->cipher_algorithm)), 0, $len));\n if(count(explode(' ',$algorithm)) !== $len) {\n $return['error'][] = 'Algorithm error';\n trigger_error('Algorithm error', E_USER_NOTICE); \n return $return;\n }\n \n // Create an IV and save it as binary\n // An initialization vector (IV) is an arbitrary number that can be used along with a secret key for data encryption.\n $ivlen = openssl_cipher_iv_length($method);\n $iv = openssl_random_pseudo_bytes($ivlen);\n $return['iv'] = bin2hex($iv); \n \n // Split input to be able to encrypt larger strings\n foreach(str_split($return['decrypted'], 20) as $str) {\n $return['base64_encode'][] = $this->textToBinary(base64_encode(openssl_encrypt($str, $method, $key, OPENSSL_RAW_DATA, $iv)), null);\n }\n \n // Glue everything togeather\n $return['encrypted'] = $algorithm. PHP_EOL . implode(PHP_EOL, $return['base64_encode']) . PHP_EOL . $this->textToBinary($return['iv']);\n $return['encrypted'] = str_replace(array(' ',PHP_EOL),array($this->delimiter_character,$this->delimiter_breaks),$this->delimiter_characters.' '.$return['encrypted'].' '.$this->delimiter_characters);\n $return['encryptedlen'] = strlen($return['encrypted']);\n \n // Compress the string if enabled\n if($this->compress==true) {\n $return['encryptednotcompressed'] = $return['encrypted'];\n $return['encrypted'] = addslashes($this->delimiter_gz.utf8_encode(gzencode($return['encrypted'],9)).$this->delimiter_gz);\n $return['compressedlen'] = strlen($return['encrypted']);\n }\n \n return $return;\n }", "function encrypt($plain){\n return trim(base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_256, $this->key, $plain, MCRYPT_MODE_ECB, mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB), MCRYPT_RAND))));\n }", "public static function encrypt($input, $flags = array(self::TWO_WAY), $customRules = array())\n\t{\n\t\t$flags = (array)$flags;\n\t\t//string that will be returned\n\t\t$finalOutput = '';\n\n\t\t//used for poisoning\n\t\t$inputLength = strlen($input);\n\n\t\t//main flags default states\n\t\t$ONE_WAY = false;\n\t\t$TWO_WAY = false;\n\t\t$STRICT = false;\n\n\t\t//the following statements modify the above default flag states (if necessary)\n\t\tif(in_array(self::TWO_WAY, $flags) === true)\n\t\t{\n\t\t\t$TWO_WAY = true;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$ONE_WAY = true;\n\t\t}\n\n\t\tif(in_array(self::STRICT, $flags) === true)\n\t\t{\n\t\t\t$STRICT = true;\n\t\t}\n\n\t\t//we are going to produce a oneway, super strong encryption (virtually irreversable)\n\t\tif($ONE_WAY === true)\n\t\t{\n\t\t\t$saltOne = hash((isset($customRules[self::HASH])&&$customRules[self::HASH]!==''?$customRules[self::HASH]:self::$_hash), $input.(isset($customRules[self::SALT])&&$customRules[self::SALT]!==''?$customRules[self::SALT]:self::$_salt).(isset($customRules[self::UNIQUE_SALT])&&$customRules[self::UNIQUE_SALT]!==''?$customRules[self::UNIQUE_SALT]:''));\n\t\t\tfor($x=0;$x<self::$_saltDepth;$x++)\n\t\t\t{\n\t\t\t\t$saltOne = hash((isset($customRules[self::HASH])&&$customRules[self::HASH]!==''?$customRules[self::HASH]:self::$_hash), $saltOne);\n\t\t\t}\n\n\t\t\t//get list of supported hashing algorithims\n\t\t\t$supportedHashes = hash_algos();\n\n\t\t\t//first encrypt with salt first\n\t\t\t$finalOutput = (isset($supportedHashes['whirlpool'])?\n\t\t\t\thash('whirlpool',$saltOne.$input):\n\t\t\t\t(isset($supportedHashes['sha512'])?\n\t\t\t\t\thash('sha512',$saltOne.$input):\n\t\t\t\t\t(isset($supportedHashes['ripemd320'])?\n\t\t\t\t\t\thash('ripemd320',$saltOne.$input):hash('md5', $saltOne.$input)\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t);\n\n\t\t\t//then encrypt with salt last\n\t\t\t$finalOutput = (isset($supportedHashes['whirlpool'])?\n\t\t\t\thash('whirlpool',$finalOutput.$saltOne):\n\t\t\t\t(isset($supportedHashes['sha512'])?\n\t\t\t\t\thash('sha512',$finalOutput.$saltOne):\n\t\t\t\t\t(isset($supportedHashes['ripemd320'])?\n\t\t\t\t\t\thash('ripemd320',$finalOutput.$saltOne):hash('md5', $finalOutput.$saltOne)\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t);\n\n\t\t\t//begin poisoning\n\t\t\tif(!isset($customRules[self::POISON_CONSTRAINTS]) && !empty(self::$_poisonConstraints))\n\t\t\t{\n\t\t\t\t$finalOutput = self::_poisonString($finalOutput, self::$_poisonConstraints);\n\t\t\t}\n\t\t\telseif(isset($customRules[self::POISON_CONSTRAINTS]) && !empty($customRules[self::POISON_CONSTRAINTS]))\n\t\t\t{\n\t\t\t\t$finalOutput = self::_poisonString($finalOutput, $customRules[self::POISON_CONSTRAINTS]);\n\t\t\t}\n\n\t\t\tif($STRICT === true && $ONE_WAY === true)\n\t\t\t{\n\t\t\t\tif(isset($customRules[self::HASH]) && $customRules[self::HASH] !== '')\n\t\t\t\t{\n\t\t\t\t\t$finalOutput = substr($finalOutput, 0, strlen(hash($customRules[self::HASH], $input)));\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$finalOutput = substr($finalOutput, 0, strlen(hash(self::$_hash, $input)));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t//we are going to produce a two-way encrypted string (which will be extremely hard to crack without source code access)\n\t\telseif($TWO_WAY === true)\n\t\t{\n\t\t\t$hashedCharacters = array();\n\t\t\tfor($i=0;$i<$inputLength;$i++)\n\t\t\t{\n\t\t\t\t$thisCharacterArrayKey = array_search(substr($input, $i, 1), self::$_hashTableFrom);\n\t\t\t\t$hashedCharacters[] = self::$_hashTableTo[$thisCharacterArrayKey];\n\t\t\t}\n\n\t\t\t$finalOutput = implode('', $hashedCharacters);\n\n\t\t\t//begin poisoning\n\t\t\tif(!isset($customRules[self::POISON_CONSTRAINTS]) && !empty(self::$_poisonConstraints))\n\t\t\t{\n\t\t\t\t$finalOutput = self::_poisonString($finalOutput, self::$_poisonConstraints, 'alphan');\n\t\t\t}\n\t\t\telseif(isset($customRules[self::POISON_CONSTRAINTS]) && !empty($customRules[self::POISON_CONSTRAINTS]))\n\t\t\t{\n\t\t\t\t$finalOutput = self::_poisonString($finalOutput, $customRules[self::POISON_CONSTRAINTS], 'alphan');\n\t\t\t}\n\t\t}\n\n\t\treturn $finalOutput;\n\t}", "public function crypt(string $salt): self\n {\n return new static(crypt($this->string, $salt), $this->encoding);\n }", "protected abstract function getSecretKey();", "function encrypt($str, $key) {\n $key = str_pad($key, 16);\n //$key = $this->hex2bin($key);\n $iv = $this->iv;\n\n $td = mcrypt_module_open('rijndael-128', '', 'cbc', $iv);\n\n mcrypt_generic_init($td, $key, $iv);\n $encrypted = mcrypt_generic($td, $str);\n\n mcrypt_generic_deinit($td);\n mcrypt_module_close($td);\n\n return bin2hex($encrypted);\n }", "public function setAlgo($algo = null): cryptopenssl\n {\n if(isset($algo) && in_array($algo, $this->_aAlgosEncryption))\n {\n $this->_algo = $algo;\n }\n else\n {\n $sAlgosDispos = \"'\". implode(\"', \", $this->_aAlgosEncryption) .\"'\";\n $msg = sprintf($this->_aMsgsExceptions['algo_inconnu'], $algo, $sAlgosDispos);\n throw new Exception($msg, E_USER_ERROR);\n }\n return $this;\n }", "function init()\n {\n return $this->_crypt->init();\n }", "public function decrypt();", "public function __construct($params){\r\n if(!extension_loaded('mcrypt')){\r\n throw new Exception('mcrypt extension is required for this script');\r\n return false;\r\n }\r\n # make sure key is supplied\r\n if(!array_key_exists('key', $params) || !isset($params['key']) || (isset($params['key']) && !$params['key'])){\r\n $error = 'key is a required parameter. see Crypt::listOptions()';\r\n throw new Exception($error);\r\n return false;\r\n }\r\n # set params\r\n $this->raw_key = $params['key'];\r\n $this->algorithms = mcrypt_list_algorithms();\r\n $this->modes = mcrypt_list_modes();\r\n # check availables\r\n if(!count($this->algorithms)){\r\n throw new Exception('there are no available algorithms for mcrypt');\r\n return false;\r\n }\r\n if(!count($this->modes)){\r\n throw new Exception('there are no available modes for mcrypt');\r\n return false;\r\n }\r\n # algorithm\r\n $this->algorithm = $this->algorithms[0]; \r\n if(array_key_exists('algorithm', $params) && in_array($params['algorithm'], $this->algorithms)){\r\n $this->algorithm = $params['algorithm'];\r\n }\r\n # mode\r\n $this->mode = $this->modes[0];\r\n if(array_key_exists('mode', $params) && in_array($params['mode'], $this->modes)){\r\n $this->mode = $params['mode'];\r\n }\r\n # base 64 encoding\r\n $this->base64 = true;\r\n if(array_key_exists('base64', $params) && !$params['base64']){\r\n $this->base64 = false;\r\n }\r\n \r\n return $this->start();\r\n }", "private static function Crypto() {\n if (self::$cripto == null) {\n self::$cripto = new \\PlayPHP\\Classes\\Security\\Crypto();\n }\n return self::$cripto;\n }", "public function encender();", "private function _encryptAsymmetric($data, $alias, $password, $options)\n {\n $encData = '';\n $entry = $this->getEntry($alias);\n $pubKey = $entry->getCertificate()->getPublicKey()->getEncoded();\n if ($pubKey != null) {\n if (!openssl_public_encrypt($data, $encData, $pubKey)) {\n throw new Crypt_KeyStore_Exception(\"Failed to encrypt with pub key\");\n }\n } else {\n throw new Crypt_KeyStore_Exception(\"Failed to get pub key from cert\");\n }\n \n return $encData;\n }", "function crypt_data($string, $action = 'e') \n{\n $secret_key \t= \"@#@ @@&&*$ bhufjg *@ !@#432 3783\"; // 32bits\n\n $secret_iv \t\t= md5('sA*(DH');\n $secret_iv \t\t= md5($secret_iv);\n\n $output \t\t= false;\n $encrypt_method = \"AES-256-CBC\";\n $key \t\t\t= hash('sha256', $secret_key);\n $iv \t\t\t= substr(hash('sha256', $secret_iv), 0, 16);\n\n \n if ($action == 'e') {\n $output = base64_encode(openssl_encrypt($string, $encrypt_method, $key, 0, $iv));\n } elseif ($action == 'd') {\n $output = openssl_decrypt(base64_decode($string), $encrypt_method, $key, 0, $iv);\n }\n\n return $output;\n}", "public function createSecretKey($alias, $password=false, $options=array()) \n {\n if (!isset($alias) || $alias == '') {\n throw new Crypt_KeyStore_Exception(\"Alias must be specified\");\n }\n \n $processedOpts = $this->_processSymmetricOptions($options);\n $size = $processedOpts[self::OPT_KEYSIZE];\n \n try {\n \n // create a random keyphrase and create the key with salt\n $keyphrase = '';\n for ($n = 0; $n < $size; $n++) {\n $keyphrase .= dechex(mt_rand(0, 15));\n }\n $salt = substr(\n pack(\"h*\", md5(mt_rand())), \n 0, \n $processedOpts[self::OPT_SALTSIZE]\n );\n \n // create a big, salted secret key from the random key phrase\n $algoKey = (isset($options[self::OPT_HASH]) ? \n $options[self::OPT_HASH] : \n self::$_symmetricOptions[self::OPT_HASH]);\n $algo = self::$_hashTable[$algoKey];\n $key = mhash_keygen_s2k($algo, $keyphrase, $salt, $size);\n \n // if specified, encrypt the new key with the specified password\n if ($password != false) {\n \n /* Open the cipher */\n $td = mcrypt_module_open(\n $processedOpts[self::OPT_CIPHER], \n '', \n $processedOpts[self::OPT_MODE], \n ''\n );\n \n /* Create the IV and determine the keysize length, use MCRYPT_RAND\n * on Windows instead */\n $iv = mcrypt_create_iv(mcrypt_enc_get_iv_size($td), MCRYPT_RAND);\n $this->_log(\"createSecretKey(): iv=\" . bin2hex($iv));\n $salt = substr(\n pack(\"h*\", md5(mt_rand())), \n 0, \n $processedOpts[self::OPT_SALTSIZE]\n );\n $this->_log(\"createSecretKey(): salt=\" . bin2hex($salt));\n \n /* Create key */\n $keysize = mcrypt_enc_get_key_size($td);\n $enc_key = mhash_keygen_s2k(\n $processedOpts[self::OPT_HASH], \n $password, \n $salt, \n $keysize\n );\n\n /* Intialize encryption */\n mcrypt_generic_init($td, $enc_key, $iv);\n \n /* Encrypt data */\n $encrypted = bin2hex(mcrypt_generic($td, $key));\n $this->_log(\"createSecretKey(): key=$encrypted\");\n \n // store the salt as the 1st 8 bytes\n $encrypted = bin2hex($iv) . bin2hex($salt) . $encrypted;\n \n /* Terminate encryption handler */\n mcrypt_generic_deinit($td);\n mcrypt_module_close($td);\n } else {\n $encrypted = bin2hex($key);\n }\n \n // store the key\n $algo = (isset($options[self::OPT_CIPHER]) ? \n $options[self::OPT_CIPHER] : \n self::$_symmetricOptions[self::OPT_CIPHER]);\n $this->_setSecretKeyEntry(\n $alias, \n $encrypted, \n $algo, \n $size\n );\n }\n catch (Exception $e) {\n throw new Crypt_KeyStore_Exception($e);\n }\n \n return;\n }", "function xor_encrypt($string, $key)\n\t{\n\t\tfor ($a=0; $a < strlen($string); $a++)\n\t\t{\n\t\t\tfor ($b=0; $b < strlen($key); $b++)\n\t\t\t{\n\t\t\t\t$string[$a] = $string[$a]^$key[$b];\n\t\t\t}\n\t\t}\n\t\n\t\treturn $string; \n\t}", "protected function getAlgorithm()\r\n {\r\n return 'SHA256';\r\n }", "static function encrypt($data){\n # Setup the initialization vector\n $iv_size = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_128, MCRYPT_MODE_CBC);\n $iv = mcrypt_create_iv($iv_size, MCRYPT_RAND);\n # Encrypt the data\n $encryptedMessage = openssl_encrypt($data, \"AES-256-CBC\", self::getEncryptKey(), 0, $iv);\n return base64_encode($encryptedMessage.'~~~'.$iv);\n }", "function BASE64URL_symmetric_decipher($dato, $key, $vector)\n\t{\n $tamVI = strlen($vector);\n\n if($tamVI != 16){\n trigger_error(\"Initialization Vector must have 16 hexadecimal characters\", E_USER_ERROR);\n return null;\n }\n if(strlen($key) != 16){\n trigger_error(\"Simetric Key doesn't have length of 16\", E_USER_ERROR);\n\n return null;\n }\n\n $binvi = pack(\"H*\", $vector);\n\n if($binvi == null){\n trigger_error(\"Initialization Vector is not valid, must contain only hexadecimal characters\", E_USER_ERROR);\n\n return null;\n\n }\n $key .= substr($key,0,8); // agrega los primeros 8 bytes al final\n\n $pas = preg_replace('/_/','/',$dato);\n $pas = preg_replace('/-/','+',$pas);\n $pas = preg_replace('/\\./','=',$pas);\n\n $crypttext = base64_decode($pas);\n\n $crypttext2 = mcrypt_decrypt(MCRYPT_3DES, $key, $crypttext, MCRYPT_MODE_CBC, $binvi);\n\n\n $block = mcrypt_get_block_size('tripledes', 'cbc');\n $packing = ord($crypttext2{strlen($crypttext2) - 1});\n if($packing and ($packing < $block))\n {\n for($P = strlen($crypttext2) - 1; $P >= strlen($crypttext2) - $packing; $P--)\n {\n if(ord($crypttext2{$P}) != $packing)\n {\n $packing = 0;\n }\n }\n }\n\n $crypttext2 = substr($crypttext2,0,strlen($crypttext2) - $packing);\n return $crypttext2;\n\t}", "function encryptData($data)\n{\n $cypher = \"aes-256-cbc\";\n $iv = openssl_random_pseudo_bytes(openssl_cipher_iv_length($cypher));\n $key = base64_encode(gethostname());\n\n\n\n return openssl_encrypt($data,$cypher,$key,0,$iv);\n}", "function _setup()\r\n {\r\n // Each number in $rcon is equal to the previous number multiplied by two in Rijndael's finite field.\r\n // See http://en.wikipedia.org/wiki/Finite_field_arithmetic#Multiplicative_inverse\r\n static $rcon = array(0,\r\n 0x01000000, 0x02000000, 0x04000000, 0x08000000, 0x10000000,\r\n 0x20000000, 0x40000000, 0x80000000, 0x1B000000, 0x36000000,\r\n 0x6C000000, 0xD8000000, 0xAB000000, 0x4D000000, 0x9A000000,\r\n 0x2F000000, 0x5E000000, 0xBC000000, 0x63000000, 0xC6000000,\r\n 0x97000000, 0x35000000, 0x6A000000, 0xD4000000, 0xB3000000,\r\n 0x7D000000, 0xFA000000, 0xEF000000, 0xC5000000, 0x91000000\r\n );\r\n\r\n if (!$this->changed) {\r\n return;\r\n }\r\n\r\n if (!$this->explicit_key_length) {\r\n // we do >> 2, here, and not >> 5, as we do above, since strlen($this->key) tells us the number of bytes - not bits\r\n $length = strlen($this->key) >> 2;\r\n if ($length > 8) {\r\n $length = 8;\r\n } else if ($length < 4) {\r\n $length = 4;\r\n }\r\n $this->Nk = $length;\r\n $this->key_size = $length << 2;\r\n }\r\n\r\n $this->key = str_pad(substr($this->key, 0, $this->key_size), $this->key_size, chr(0));\r\n $this->encryptIV = $this->decryptIV = $this->iv = str_pad(substr($this->iv, 0, $this->block_size), $this->block_size, chr(0));\r\n\r\n // see Rijndael-ammended.pdf#page=44\r\n $this->Nr = max($this->Nk, $this->Nb) + 6;\r\n\r\n // shift offsets for Nb = 5, 7 are defined in Rijndael-ammended.pdf#page=44,\r\n // \"Table 8: Shift offsets in Shiftrow for the alternative block lengths\"\r\n // shift offsets for Nb = 4, 6, 8 are defined in Rijndael-ammended.pdf#page=14,\r\n // \"Table 2: Shift offsets for different block lengths\"\r\n switch ($this->Nb) {\r\n case 4:\r\n case 5:\r\n case 6:\r\n $this->c = array(0, 1, 2, 3);\r\n break;\r\n case 7:\r\n $this->c = array(0, 1, 2, 4);\r\n break;\r\n case 8:\r\n $this->c = array(0, 1, 3, 4);\r\n }\r\n\r\n $key = $this->key;\r\n\r\n $w = array_values(unpack('N*words', $key));\r\n\r\n $length = $this->Nb * ($this->Nr + 1);\r\n for ($i = $this->Nk; $i < $length; $i++) {\r\n $temp = $w[$i - 1];\r\n if ($i % $this->Nk == 0) {\r\n // according to <http://php.net/language.types.integer>, \"the size of an integer is platform-dependent\".\r\n // on a 32-bit machine, it's 32-bits, and on a 64-bit machine, it's 64-bits. on a 32-bit machine,\r\n // 0xFFFFFFFF << 8 == 0xFFFFFF00, but on a 64-bit machine, it equals 0xFFFFFFFF00. as such, doing 'and'\r\n // with 0xFFFFFFFF (or 0xFFFFFF00) on a 32-bit machine is unnecessary, but on a 64-bit machine, it is.\r\n $temp = (($temp << 8) & 0xFFFFFF00) | (($temp >> 24) & 0x000000FF); // rotWord\r\n $temp = $this->_subWord($temp) ^ $rcon[$i / $this->Nk];\r\n } else if ($this->Nk > 6 && $i % $this->Nk == 4) {\r\n $temp = $this->_subWord($temp);\r\n }\r\n $w[$i] = $w[$i - $this->Nk] ^ $temp;\r\n }\r\n\r\n // convert the key schedule from a vector of $Nb * ($Nr + 1) length to a matrix with $Nr + 1 rows and $Nb columns\r\n // and generate the inverse key schedule. more specifically,\r\n // according to <http://csrc.nist.gov/archive/aes/rijndael/Rijndael-ammended.pdf#page=23> (section 5.3.3), \r\n // \"The key expansion for the Inverse Cipher is defined as follows:\r\n // 1. Apply the Key Expansion.\r\n // 2. Apply InvMixColumn to all Round Keys except the first and the last one.\"\r\n // also, see fips-197.pdf#page=27, \"5.3.5 Equivalent Inverse Cipher\"\r\n $temp = array();\r\n for ($i = $row = $col = 0; $i < $length; $i++, $col++) {\r\n if ($col == $this->Nb) {\r\n if ($row == 0) {\r\n $this->dw[0] = $this->w[0];\r\n } else {\r\n // subWord + invMixColumn + invSubWord = invMixColumn\r\n $j = 0;\r\n while ($j < $this->Nb) {\r\n $dw = $this->_subWord($this->w[$row][$j]);\r\n $temp[$j] = $this->dt0[$dw & 0xFF000000] ^ \r\n $this->dt1[$dw & 0x00FF0000] ^ \r\n $this->dt2[$dw & 0x0000FF00] ^ \r\n $this->dt3[$dw & 0x000000FF];\r\n $j++;\r\n }\r\n $this->dw[$row] = $temp;\r\n }\r\n\r\n $col = 0;\r\n $row++;\r\n }\r\n $this->w[$row][$col] = $w[$i];\r\n }\r\n\r\n $this->dw[$row] = $this->w[$row];\r\n\r\n $this->changed = false;\r\n }", "public function encrypt( $plaintext ) {\n\t\tif ( CRYPT_ENGINE_OPENSSL == $this->engine ) {\n\t\t\t$temp = $this->key;\n\t\t\t$this->key = $this->orig_key;\n\t\t\t$result = parent::encrypt( $plaintext );\n\t\t\t$this->key = $temp;\n\n\t\t\treturn $result;\n\t\t}\n\n\t\treturn parent::encrypt( $plaintext );\n\t}", "function key_encrypt($message, $key, $cipher_method=AES_256) {\n\t\n\t$length = key_length($cipher_method);\n\t\n\t$key = str_pad($key, $length, '*');\n\n\t$iv_length = openssl_cipher_iv_length($cipher_method);\n\t$iv = openssl_random_pseudo_bytes($iv_length);\n\n\t$encrypted = openssl_encrypt($message, $cipher_method, $key, OPENSSL_RAW_DATA, $iv);\n\t$encrypted_message = $iv . $encrypted;\n\n return base64_encode($encrypted_message);\n}", "public function encrypt($plaintext) {\n\t\t//Capitalize all the characters\n\t\t$plaintext = strtoupper($plaintext); // see https://www.php.net/manual/en/function.strtoupper.php\n\t\t//convert the string to an array, and then loop over the \n\t\t$plaintext = str_split ($plaintext); //see https://www.php.net/manual/en/function.str-split.php\n\t\t\t\t\t\t\t\t\t\t\t\t//also see https://www.php.net/manual/en/function.explode.php\n\t\t\n\t\t//var_dump($plaintext); //Debug code uncomment to see the array\n\t\t\n\t\t$cyphertext = array(); //create an empty array for our cyphertext\n\t\t\n\t\t//temporary variables for our script. This is inelegant, but easy to follow.\n\t\t$tmp_plain_num = 0;\n\t\t$tmp_crypt_num = 0;\n\t\tforeach ($plaintext as $char) {\n\t\t\t//check to make sure we have a letter. If we do not, just stick it in the cyphertext unencrypted.\n\t\t\tif(ctype_alpha($char)) {\n\t\t\t\t$tmp_plain_num = self::$lettersToNumbers[$char]; //gets the number\n\t\t\t\t/**\n\t\t\t\t *\tIn php, mod takes precedence over addition, so we need parenthesis. What would happen without them?\n\t\t\t\t */\n\t\t\t\t$tmp_crypt_num = ($tmp_plain_num + $this->shift_key) % 26; // See https://www.php.net/manual/en/language.operators.precedence.php for php's PEMDAS\n\t\t\t\t\n\t\t\t\t/**\n\t\t\t\t *\tIn php (as opposed to some other languages), we can append an element to the end of an array \n\t\t\t\t * by simply leaving the index empty.\n\t\t\t\t */\n\t\t\t\t$cyphertext[] = self::$numbersToLetters[$tmp_crypt_num]; //encrypt the letter, and append it to the array.\n\t\t\t} else {\n\t\t\t\t$cyphertext[] = $char; //stick the non-letter in.\n\t\t\t}\n\t\t}\n\t\t\n\t\t//var_dump($cyphertext); //Debug code Uncomment to see the array\n\t\t\n\t\t$cyphertext = implode($cyphertext); //convert back to a string. See https://www.php.net/manual/en/function.implode.php\n\t\t\n\t\treturn($cyphertext);\n\t}", "public function includeSymboles() {\n\n for ($i=0; $i <$this->symbolPortion ; $i++) {\n $this->password = $this->password.substr($this->symboles, rand(0, strlen($this->symboles) - 1), 1);\n }\n }", "private function getCryptographicProtocolForTesting()\n {\n $exchange = new KeyExchange(new HkdfShaTwo384());\n $exchange->setKeyExchangeSize(512);\n\n return $exchange;\n }", "function encrypt_decrypt($action, $string) {\n\n if ( !function_exists(\"openssl_encrypt\") )\n {\n die (\"openssl function openssl_encrypt does not exist\");\n }\n if ( !function_exists(\"hash\") )\n {\n die (\"function hash does not exist\");\n }\n\n global $encryption_key;\n\n $output = false;\n $encrypt_method = \"AES-256-CBC\";\n //echo \"$encryption_key\\n\";\n $secret_iv = 'RgX54.Ju7h';\n\n\n // hash\n $key = hash('sha256', $encryption_key);\n\n // iv - encrypt method AES-256-CBC expects 16 bytes - else you will get a warning\n $iv = substr(hash('sha256', $secret_iv), 0, 16);\n\n if( $action == 'encrypt' )\n {\n $output = openssl_encrypt($string, $encrypt_method, $key, 0, $iv);\n $output = base64_encode($output);\n } else if( $action == 'decrypt' )\n {\n $output = openssl_decrypt(base64_decode($string), $encrypt_method, $key, 0, $iv);\n }\n\n return $output;\n}", "public static function aes128Encrypt($key, $data) {}", "function encryptAES($content, $secret){\n return openssl_encrypt($content, \"AES-256-CBC\", $secret);\n}", "public function __construct() {\n self::$encryption=new Encryption();\n}", "function encrypt($string) {\n\t\t\t$iv = $this->_generate_iv();\n\t\t\t\n\t\t\t// Clear output\n\t\t\t$out = '';\n\t\t\t\n\t\t\t// First block of output is ($this->hash_hey XOR IV)\n\t\t\tfor($c=0;$c < $this->hash_length;$c++) {\n\t\t\t\t$out .= chr(ord($iv[$c]) ^ ord($this->hash_key[$c]));\n\t\t\t}\n\t\n\t\t\t// Use IV as first key\n\t\t\t$key = $iv;\n\t\t\t$c = 0;\n\t\n\t\t\t// Go through input string\n\t\t\twhile($c < strlen($string)) {\n\t\t\t\t// If we have used all characters of the current key we switch to a new one\n\t\t\t\tif(($c != 0) and ($c % $this->hash_length == 0)) {\n\t\t\t\t\t// New key is the hash of current key and last block of plaintext\n\t\t\t\t\t$key = $this->_hash($key . substr($string,$c - $this->hash_length,$this->hash_length));\n\t\t\t\t}\n\t\t\t\t// Generate output by xor-ing input and key character for character\n\t\t\t\t$out .= chr(ord($key[$c % $this->hash_length]) ^ ord($string[$c]));\n\t\t\t\t$c++;\n\t\t\t}\n\t\t\t// Apply base64 encoding if necessary\n\t\t\tif($this->base64) $out = base64_encode($out);\n\t\t\treturn $out;\n\t\t}", "function encrypt($plaintext)\n {\n $plaintext = strtolower($plaintext);\n $ciphertext = \"\";\n \n for ( $i = 0; $i < strlen($plaintext); $i++ )\n {\n $x = $this->alphabet->indexOf($plaintext[$i]);\n $encodedIndex = mod(($x + $this->shift), $this->alphabet->sizeOf());\n $ciphertext = $ciphertext . ($this->alphabet->get($encodedIndex)[0]);\n }\n return $ciphertext;\n }", "public function encrypt($plain){\t\n return trim(base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_256, $this->key, $plain, MCRYPT_MODE_ECB, mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB), MCRYPT_RAND))));\n }", "public function testMiddleKey2()\n {\n if (!extension_loaded('mcrypt')) {\n $this->markTestSkipped('mcrypt must be demonstrate it\\'s behaviors');\n }\n\n $this->setExpectedException('PHPUnit_Framework_Error_Warning');\n\n $key = str_repeat('z', 20);\n $iv = str_repeat('z', 16);\n\n $plaintext = 'a';\n\n mcrypt_encrypt('rijndael-128', $key, $plaintext, 'cbc', $iv);\n }", "static function setEncryptionAlgorithm($algo)\n {\n self::$defaultEncryptionAlgorithm = $algo;\n }", "function __construct(){\n parent::__construct();\n $this->load->library('encrypt');\n\n \t}", "public function encryptPassword($pass){\r\n\t\t$this->string = array(\r\n\t\t\t\"string\" => $pass,\r\n\t\t\t\"count\" => strlen($pass)\r\n\t\t);\r\n\t\t//the function setCharacters() is executed to get all the initial characters to use for password encryption.\r\n\t\t$characters = $this->setCharacters();\r\n\t\t/* \r\n\t\t\tIn order to encrypt this password with a unique pattern I took the password and found the position\r\n\t\t\ton my character table. I took all positions that are found on my character table and use those numbers like patters\r\n\t\t\tI set the characters location as ranges in my $start_range variable.\r\n\t\t*/\r\n\t\t$start_range = array();\r\n\t\tfor($x=0; $x<$this->string['count']; $x++){\r\n\t\t\t$start_range[$x] = array_search($this->string['string'][$x], $characters);\r\n\t\t}\r\n\t\tforeach ($start_range as $key => $value) {\r\n\t\t\tif($value == null){\r\n\t\t\t\t$start_range[$key] = $this->string['count'];\r\n\t\t\t}\r\n\t\t}\r\n\t\t//doubles the range to make the password more complex base on mathematical additions; submitted on the 1.2 update\r\n\t\t$a = 0;\r\n\t\tfor ($i=0; $i < $this->string['count']; $i++) {\r\n\t\t\t$start_range[$this->string['count'] + $a] = round(($start_range[$i] * ($this->string['count'] + $a))); \r\n\t\t\t$a++;\r\n\t\t}\r\n\t\t/*\r\n\t\t\tUnique matrix is created depending on number of characters and the location of the characters\r\n\t\t\tI set for what i call my matrix to be 5000 characters to make the mattern more complex. you can set that to your liking i dont recommend going lower than 1000 characters.\r\n\t\t*/\r\n\t\t$matrix = $this->generateMatrix($characters, $start_range, $this->matrixLength);\r\n\t\t/*\r\n\t\t\t@param array will make sure the matrix is as complex as possible.\r\n\t\t*/\r\n\t\t$matrix_final = $this->generateMatrix($matrix, $start_range, $this->matrixLength);\r\n\t\t/*\r\n\t\t\tI have tested with 128 characters, havent test for less or more yet.\r\n\t\t\tthis is where the magic happens and i use the same consept of creating a matrix to create the final encryption.\r\n\t\t*/\r\n\t\t$final_password = $this->generateMatrix($matrix_final, $start_range, $this->passwordEncryptionLenght);\r\n\t\t$this->encPassword = implode('',$final_password);\r\n\t}", "private function encryptKey($key, $password=NULL, $salt=NULL, $skNonce=NULL)\n {\n //create salt if null\n if (is_null($salt))\n {\n $salt = sodium_bin2hex(random_bytes(SODIUM_CRYPTO_PWHASH_SALTBYTES));\n }\n\n $symmetricKey = $this->passwordKDF($password, $salt);\n\n //check if nonce is set\n if(is_null($skNonce))\n {\n $skNonce = sodium_bin2hex(random_bytes($this->NONCE_BYTES));\n }\n\n //encrypt the secret key of the keypair\n $encryptedKey = sodium_crypto_secretbox(sodium_crypto_box_secretkey($key), sodium_hex2bin($skNonce), $symmetricKey);\n\n //create TreesStorageKey object\n $storageKey = new TreesStorageKey();\n $storageKey->OPS_LIMIT = $this->OPS_LIMIT;\n $storageKey->MEM_LIMIT = $this->MEM_LIMIT;\n $storageKey->publicKey = sodium_bin2hex(sodium_crypto_box_publickey($key));\n $storageKey->lockedSecretBox = sodium_bin2hex($encryptedKey);\n $storageKey->salt = $salt;\n $storageKey->skNonce = $skNonce;\n $storageKey->pwhashAlgo = 1;\n\n return $storageKey;\n\n }", "public function my_simple_crypt( $string, $action = 'e' ) {\n $secret_key = env('SECRET_KEY');\n $secret_iv = env('SECRET_IV');\n\n $output = false;\n $encrypt_method = \"AES-256-CBC\";\n $key = substr( hash( 'sha256', $secret_key ), 0 ,32);\n $iv = substr( hash( 'sha256', $secret_iv ), 0, 16 );\n\n if( $action == 'e' ) {\n $output = base64_encode( openssl_encrypt( $string, $encrypt_method, $key, 0, $iv ) );\n }\n else if( $action == 'd' ){\n $output = openssl_decrypt( base64_decode( $string ), $encrypt_method, $key, 0, $iv );\n }\n return $output;\n }", "function mc_encrypt($encrypt, $key){\n $encrypt = serialize($encrypt);\n $iv = mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_CBC), MCRYPT_DEV_URANDOM);\n $key = pack('H*', $key);\n $mac = hash_hmac('sha256', $encrypt, substr(bin2hex($key), -32));\n $passcrypt = mcrypt_encrypt(MCRYPT_RIJNDAEL_256, $key, $encrypt.$mac, MCRYPT_MODE_CBC, $iv);\n $encoded = base64_encode($passcrypt).'|'.base64_encode($iv);\n return $encoded;\n }", "public function fileCipher() {\n return new OctaFileCipher();\n }", "private function encode_this_session( $txt )\r\n {\r\n \t\tif(extension_loaded('openssl')){\r\n \t\t\t$iv = substr(hash('sha256', SECRET_KEY), 0, 16);\r\n \t\t\treturn rtrim(openssl_encrypt($txt, 'AES-256-CBC', SECRET_KEY, 0, $iv));\r\n \t\t} else {\r\n \t\t\treturn base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_256, md5(SECRET_KEY), $txt, MCRYPT_MODE_CBC, md5(md5(SECRET_KEY))));\r\n \t\t}\r\n }", "protected function getAlgorithm(): int\n {\n return PASSWORD_BCRYPT;\n }", "function aes_encrypt($decrypted, $salt = null)\n{\n if (null === $salt) {\n if (!($salt = \\getenv('AES_SALT'))) {\n throw new \\Limepie\\Exception('Missing encryption salt.');\n }\n }\n\n $key = \\Limepie\\mysql_aes_key($salt);\n\n $cypher = 'aes-128-ecb';\n\n return \\openssl_encrypt($decrypted, $cypher, $key, \\OPENSSL_RAW_DATA);\n}", "public function encrypt($plaintext) {\n\t\t\n\t\t$key = self::PWD; // Password is set above at the Constants\n\t\t$ivlen = openssl_cipher_iv_length($cipher=\"AES-256-CTR\");\n\t\t$iv = openssl_random_pseudo_bytes($ivlen);\n\t\t$ciphertext_raw = openssl_encrypt($plaintext, $cipher, $key, $options=OPENSSL_RAW_DATA, $iv);\n\t\t$hmac = hash_hmac('sha256', $ciphertext_raw, $key, $as_binary=true);\n\t\t$ciphertext = base64_encode($iv.$hmac.$ciphertext_raw );\n\t\n\t\treturn bin2hex($ciphertext);\n\t\n\t}", "private function _decryptSymmetric($encData, $alias, $password, $options)\n {\n $data = '';\n $key = null;\n \n $processedOpts = $this->_processSymmetricOptions($options);\n try {\n $key = $this->_getKey($alias, $password);\n \n /* Open the cipher */\n $td = mcrypt_module_open(\n $processedOpts[self::OPT_CIPHER], \n '', \n $processedOpts[self::OPT_MODE], \n ''\n );\n \n // get IV from beginning of encrypted string\n $ivsize = mcrypt_enc_get_iv_size($td);\n $iv = pack(\n 'H*', \n substr(\n $encData, \n 0, \n $ivsize * 2\n )\n );\n \n // calculate the header size and get encrypted data\n $header_size = $ivsize * 2;\n $encoded_cipher = substr($encData, $header_size);\n $cipher = pack('H*', $encoded_cipher);\n \n // Intialize encryption from the IV and dec_key\n mcrypt_generic_init($td, $key, $iv);\n \n // Decrypt encrypted string, trimming the result due to padding\n $data = trim(mdecrypt_generic($td, $cipher));\n \n // Terminate encryption handler\n mcrypt_generic_deinit($td);\n mcrypt_module_close($td);\n } catch (Exception $e) {\n throw new Crypt_KeyStore_Exception($e);\n }\n \n return $data;\n }", "function __construct($key, $base64 = true) {\n\t\t\t\n\t\t\tglobal $cc_encryption_hash;\n\t\t\t\n\t\t\t// Toggle base64 usage on / off\n\t\t\t$this->base64 = $base64;\n\t\t\t\n\t\t\t// Instead of using the key directly we compress it using a hash function\n\t\t\t$this->hash_key = $this->_hash($key);\n\t\t\t\n\t\t\t// Remember length of hashvalues for later use\n\t\t\t$this->hash_length = strlen($this->hash_key);\n\t\t}", "function encrypt($string, $key=KEY) {\n return base64_encode(encrypt_string($string, $key));\n }" ]
[ "0.71682346", "0.6173329", "0.59116864", "0.5890748", "0.58246225", "0.58175206", "0.58069104", "0.5794332", "0.5690198", "0.56805515", "0.5675322", "0.566449", "0.5654899", "0.5603828", "0.55938065", "0.5582291", "0.5577891", "0.5554099", "0.55031365", "0.5500157", "0.549581", "0.5483687", "0.54486287", "0.54378986", "0.54303", "0.54108816", "0.5407913", "0.53927445", "0.5390708", "0.53635496", "0.53451294", "0.5335202", "0.5332233", "0.5307638", "0.5303735", "0.53013974", "0.52871794", "0.5285991", "0.5274864", "0.5268182", "0.5264007", "0.5260028", "0.52578723", "0.5250183", "0.5221388", "0.5217945", "0.5216636", "0.5212224", "0.51975924", "0.5143884", "0.51392376", "0.5128565", "0.51020986", "0.5095816", "0.5093091", "0.50917083", "0.50898796", "0.5085262", "0.5084842", "0.5079367", "0.5079129", "0.5076411", "0.5072713", "0.50575364", "0.50574183", "0.5055838", "0.50454813", "0.5044765", "0.5042393", "0.50402075", "0.5036442", "0.5035258", "0.503173", "0.5030099", "0.50277597", "0.5026762", "0.5026159", "0.50214285", "0.5018314", "0.501733", "0.5011935", "0.50107604", "0.5006584", "0.50030357", "0.50017047", "0.5001631", "0.49944377", "0.4994003", "0.49811175", "0.49795562", "0.49767298", "0.49763528", "0.4968661", "0.4966864", "0.49646693", "0.49635583", "0.4954655", "0.49524316", "0.49464193", "0.49429762", "0.49277428" ]
0.0
-1
Constructor method for Employee_DataType
public function __construct($employee_ID = null, $user_ID = null, \WorkdayWsdl\\StructType\External_Integration_ID_DataType $integration_ID_Data = null, array $personal_Info_Data = array(), array $worker_Status_Data = array(), array $worker_Position_Data = array(), array $compensation_Data = array(), array $compensation_Detail_Data = array(), \WorkdayWsdl\\StructType\Worker_Document_Data_WWSType $worker_Document_Data = null) { $this ->setEmployee_ID($employee_ID) ->setUser_ID($user_ID) ->setIntegration_ID_Data($integration_ID_Data) ->setPersonal_Info_Data($personal_Info_Data) ->setWorker_Status_Data($worker_Status_Data) ->setWorker_Position_Data($worker_Position_Data) ->setCompensation_Data($compensation_Data) ->setCompensation_Detail_Data($compensation_Detail_Data) ->setWorker_Document_Data($worker_Document_Data); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function __construct($employee)\n {\n $this->employee = $employee;\n }", "public function __construct(Employee $employee)\n {\n $this->employee = $employee ;\n }", "function __construct($employee_name = null) {\r\n\t\t$this->set_name($employee_name);\r\n\t}", "public function __construct($datatype)\n {\n $this->dataType = $datatype;\n }", "public function initialize()\n {\n // attributes\n $this->setName('employee');\n $this->setPhpName('Employee');\n $this->setIdentifierQuoting(false);\n $this->setClassName('\\\\lwops\\\\lwops\\\\Employee');\n $this->setPackage('lwops.lwops');\n $this->setUseIdGenerator(true);\n // columns\n $this->addPrimaryKey('oid', 'Oid', 'INTEGER', true, null, null);\n $this->addColumn('firstName', 'Firstname', 'VARCHAR', true, 20, null);\n $this->addColumn('middleInitial', 'Middleinitial', 'VARCHAR', false, 1, 'X');\n $this->addColumn('lastName', 'Lastname', 'VARCHAR', true, 20, null);\n $this->addColumn('nationalID', 'Nationalid', 'CHAR', true, 10, '1000000001');\n $this->addColumn('mobileNbr', 'Mobilenbr', 'CHAR', true, 10, '0720000000');\n $this->addColumn('resident', 'Resident', 'BOOLEAN', true, 1, false);\n $this->addColumn('elecDeduction', 'Elecdeduction', 'BOOLEAN', true, 1, true);\n $this->addColumn('ePayment', 'Epayment', 'BOOLEAN', true, 1, false);\n $this->addColumn('active', 'Active', 'BOOLEAN', true, 1, true);\n $this->addColumn('startDt', 'Startdt', 'DATE', true, null, null);\n $this->addColumn('gender', 'Gender', 'CHAR', true, null, 'M');\n $this->addColumn('terminated', 'Terminated', 'BOOLEAN', true, 1, false);\n $this->addColumn('dateOfBirth', 'Dateofbirth', 'DATE', true, null, null);\n $this->addColumn('maritalStatus', 'Maritalstatus', 'VARCHAR', true, 1, null);\n $this->addColumn('spouseFirstNm', 'Spousefirstnm', 'VARCHAR', false, 45, null);\n $this->addColumn('spouseLastNm', 'Spouselastnm', 'VARCHAR', false, 45, null);\n $this->addColumn('spouseMobNbr', 'Spousemobnbr', 'VARCHAR', false, 10, null);\n $this->addColumn('prevEmployerName', 'Prevemployername', 'VARCHAR', true, 45, null);\n $this->addColumn('prevEmployerTelNbr', 'Prevemployertelnbr', 'VARCHAR', true, 45, null);\n $this->addColumn('prevEmployerStartDt', 'Prevemployerstartdt', 'DATE', true, null, null);\n $this->addColumn('prevEmployerEndDt', 'Prevemployerenddt', 'DATE', true, null, null);\n $this->addColumn('prevEmployerLeavingReason', 'Prevemployerleavingreason', 'VARCHAR', true, 100, null);\n $this->addColumn('prevEmployerLocation', 'Prevemployerlocation', 'VARCHAR', true, 100, null);\n $this->addColumn('workDoneAtPrevEmployer', 'Workdoneatprevemployer', 'VARCHAR', true, 150, null);\n $this->addColumn('nxtOfKinFirstNm', 'Nxtofkinfirstnm', 'VARCHAR', true, 45, null);\n $this->addColumn('nxtOfKinLastNm', 'Nxtofkinlastnm', 'VARCHAR', true, 45, null);\n $this->addColumn('nxtOfKinMobileNbr', 'Nxtofkinmobilenbr', 'VARCHAR', true, 10, null);\n $this->addColumn('nxtOfKinResidence', 'Nxtofkinresidence', 'VARCHAR', true, 45, null);\n $this->addColumn('nxtOfKinRelationship', 'Nxtofkinrelationship', 'VARCHAR', true, 10, null);\n $this->addColumn('nxtOfKinPlaceOfWork', 'Nxtofkinplaceofwork', 'VARCHAR', true, 75, null);\n $this->addColumn('comment', 'Comment', 'VARCHAR', false, 255, null);\n $this->addColumn('createTmstp', 'Createtmstp', 'TIMESTAMP', true, null, 'CURRENT_TIMESTAMP');\n $this->addColumn('updtTmstp', 'Updttmstp', 'TIMESTAMP', false, null, null);\n }", "public function __construct(\\WorkdayWsdl\\\\StructType\\Employee_ReferenceType $employee_Reference = null, \\WorkdayWsdl\\\\StructType\\Employee_Employment_Info_DataType $employee_Employment_Info_Data = null, $as_Of_Date = null, $as_Of_Moment = null, $version = null)\n {\n $this\n ->setEmployee_Reference($employee_Reference)\n ->setEmployee_Employment_Info_Data($employee_Employment_Info_Data)\n ->setAs_Of_Date($as_Of_Date)\n ->setAs_Of_Moment($as_Of_Moment)\n ->setVersion($version);\n }", "function __construct($employees) {\n foreach($employees as $employee) {\n $id = $employee['id'];\n $bossId = $this->calcBoss($employee);\n // create array with employee id as key to make retrieval easier\n $this->originalData[$id] = $employee;\n // creates index with bossId as key and direct reports\n $this->index[$bossId][] = $id;\n }\n }", "public function __construct($employees)\n {\n $this->employees = $employees;\n }", "public function __construct($id, $firstName, $lastName,\n $email, $phone, $reason,\n $date, $emp, $data) {\n $this->id =$id;\n $this->firstName = $firstName;\n $this->lastName = $lastName;\n $this->email = $email;\n $this->phone = $phone;\n $this->reason = $reason;\n $this->date = $date;\n $this->assnEmp = $emp;\n $this->data = $data;\n }", "public function __construct(EmployeeRepository $employeeRepo)\n {\n try {\n //getEmployees($whereParams=[],$orWhereParams=[],$relationalParams=[],$orderBy=['by' => 'id', 'order' => 'asc', 'num' => null],$aggregates=['key' => null, 'value' => null],$withParams=[],$activeFlag=true)\n $this->employees = $employeeRepo->getEmployees([], [], [], $orderBy=['by' => 'id', 'order' => 'asc', 'num' => null], $aggregates=['key' => null, 'value' => null], $withParams=[], $activeFlag=true);\n } catch (Exception $e) {\n }\n }", "function __Construct(array $columnData ){\r\n\t\tif(array_key_exists(\"TABLE_CATALOG\",$columnData)){\r\n\t\t\t$this->tableCatalog = $columnData[\"TABLE_CATALOG\"];\r\n\t\t}\r\n\t\tif(array_key_exists(\"TABLE_SCHEMA\",$columnData)){\r\n\t\t\t$this->tableSchema = $columnData[\"TABLE_SCHEMA\"];\r\n\t\t}\r\n\t\tif(array_key_exists(\"TABLE_NAME\",$columnData)){\r\n\t\t\t$this->tableName = $columnData[\"TABLE_NAME\"];\r\n\t\t}\r\n\t\tif(array_key_exists(\"COLUMN_NAME\",$columnData)){\r\n\t\t\t$this->columnName = $columnData[\"COLUMN_NAME\"];\r\n\t\t}\r\n\t\tif(array_key_exists(\"ORDINAL_POSITION\",$columnData)){\r\n\t\t\t$this->ordinalPosition = intval($columnData[\"ORDINAL_POSITION\"]);\r\n\t\t}\r\n\t\tif(array_key_exists(\"COLUMN_DEFAULT\",$columnData)){\r\n\t\t\t$this->columnDefault = $columnData[\"COLUMN_DEFAULT\"];\r\n\t\t}\r\n\t\tif(array_key_exists(\"IS_NULLABLE\",$columnData)){\r\n\t\t\t$this->isNullable = $columnData[\"IS_NULLABLE\"] != \"NO\";\r\n\t\t}\r\n\t\tif(array_key_exists(\"DATA_TYPE\",$columnData)){\r\n\t\t\t$this->dataType = $columnData[\"DATA_TYPE\"];\r\n\t\t}\r\n\t\tif(array_key_exists(\"CHARACTER_MAXIMUM_LENGTH\",$columnData)){\r\n\t\t\t$this->charMaxLength = intval($columnData[\"CHARACTER_MAXIMUM_LENGTH\"]);\r\n\t\t}\r\n\t\tif(array_key_exists(\"CHARACTER_OCTET_LENGTH\",$columnData)){\r\n\t\t\t$this->charOctetLenght = intval($columnData[\"CHARACTER_OCTET_LENGTH\"]);\r\n\t\t}\r\n\t\tif(array_key_exists(\"NUMERIC_PRECISION\",$columnData)){\r\n\t\t\t$this->numericPrecision = intval($columnData[\"NUMERIC_PRECISION\"]);\r\n\t\t}\r\n\t\tif(array_key_exists(\"NUMERIC_SCALE\",$columnData)){\r\n\t\t\t$this->numericScale = intval($columnData[\"NUMERIC_SCALE\"]);\r\n\t\t}\r\n\t\tif(array_key_exists(\"DATETIME_PRECISION\",$columnData)){\r\n\t\t\t$this->datetimePrecision = intval($columnData[\"DATETIME_PRECISION\"]);\r\n\t\t}\r\n\t\tif(array_key_exists(\"CHARACTER_SET_NAME\",$columnData)){\r\n\t\t\t$this->charSetName = $columnData[\"CHARACTER_SET_NAME\"];\r\n\t\t}\r\n\t\tif(array_key_exists(\"COLLATION_NAME\",$columnData)){\r\n\t\t\t$this->collationName = $columnData[\"COLLATION_NAME\"];\r\n\t\t}\r\n\t\tif(array_key_exists(\"COLUMN_TYPE\",$columnData)){\r\n\t\t\t$this->columnType = $columnData[\"COLUMN_TYPE\"];\r\n\t\t}\r\n\t\tif(array_key_exists(\"COLUMN_KEY\",$columnData)){\r\n\t\t\t$this->columnKey = $columnData[\"COLUMN_KEY\"];\r\n\t\t}\r\n\t\tif(array_key_exists(\"EXTRA\",$columnData)){\r\n\t\t\t$this->extra = $columnData[\"EXTRA\"];\r\n\t\t}\r\n\t\tif(array_key_exists(\"PRIVILEGES\",$columnData)){\r\n\t\t\t$this->privileges = explode(',', $columnData[\"PRIVILEGES\"]);\r\n\t\t}\r\n\t\tif(array_key_exists(\"COLUMN_COMMENT\",$columnData)){\r\n\t\t\t$this->columnComment = $columnData[\"COLUMN_COMMENT\"];\r\n\t\t}\r\n\t}", "function __construct($arrData=array())\n\t{\n $this->data = $arrData;\n $this->tableName = \"tblusers\";\n\n require_once(C_P_CLASES.'utils/tables.names.php');\n //inicializo nombres de campos de tabla\n $tmpIns = new A_TABLENAMES(\"\");\n $tmpIns->set_dataTblusers();\n $this->arrDataNames = $tmpIns->get_tblusers();\n $this->domain = C_DOMAIN;\n }", "function __construct($EMP_USER, $EMP_PASSWORD, $EMP_FECH_NAC, $EMP_EMAIL, $EMP_NOMBRE, $EMP_APELLIDO, $EMP_DNI, $EMP_TELEFONO, $EMP_CUENTA, $EMP_DIRECCION, $EMP_COMENTARIOS, $EMP_TIPO, $EMP_ESTADO, $EMP_FOTO, $EMP_NOMINA)\n{\n $this->EMP_USER = $EMP_USER;\n\t$this->EMP_PASSWORD = $EMP_PASSWORD;\n\t$this->EMP_FECH_NAC = $EMP_FECH_NAC;\n\t$this->EMP_EMAIL = $EMP_EMAIL;\n\t$this->EMP_NOMBRE = $EMP_NOMBRE;\n\t$this->EMP_APELLIDO = $EMP_APELLIDO;\n\t$this->EMP_DNI = $EMP_DNI;\n\t$this->EMP_TELEFONO = $EMP_TELEFONO;\n\t$this->EMP_CUENTA =$EMP_CUENTA;\n\t$this->EMP_DIRECCION =$EMP_DIRECCION;\n\t$this->EMP_COMENTARIOS =$EMP_COMENTARIOS;\n\t$this->EMP_TIPO =$EMP_TIPO;\n\t$this->EMP_ESTADO =$EMP_ESTADO;\n\t$this->EMP_FOTO=$EMP_FOTO;\n\t$this->EMP_NOMINA=$EMP_NOMINA;\n\n}", "abstract protected function initDataTypes();", "public function __construct() {\n\n $this->tableName = \"re_event_type\";\n $this->setColumnsInfo(\"id\", \"int(11)\", 0);\n $this->setColumnsInfo(\"name\", \"varchar(250)\", \"\");\n $this->setColumnsInfo(\"id_space\", \"int(11)\", 0);\n $this->primaryKey = \"id\";\n }", "public function __construct(\n\t\tEmployee $employee,\n\t\tDesignationRepository $designation,\n\t\tDepartmentRepository $department,\n\t\tEmployeeTerm $employee_term,\n\t\tEmployeeDesignation $employee_designation,\n\t\tCasteRepository $caste,\n\t\tCategoryRepository $category,\n\t\tReligionRepository $religion,\n\t\tBloodGroupRepository $blood_group,\n\t\tUser $user,\n\t\tEmployeeGroupRepository $employee_group,\n\t\tRoleRepository $role,\n\t\tBranchRepository $branch,\n\t\tNationalityRepository $nationality,\n\t\tEmployeeDocumentTypeRepository $document_type,\n\t\tEmployeeDocument $document,\n\t\tBankRepository $bank,\n\t\tEmployeeSalary $employee_salary,\n\t\tEmployeeQualification $qualification,\n\t\tEmployeeAccount $account\n\t) {\n\t\t$this->employee = $employee;\n\t\t$this->designation = $designation;\n\t\t$this->department = $department;\n\t\t$this->employee_term = $employee_term;\n\t\t$this->employee_designation = $employee_designation;\n\t\t$this->caste = $caste;\n\t\t$this->category = $category;\n\t\t$this->religion = $religion;\n\t\t$this->blood_group = $blood_group;\n\t\t$this->user = $user;\n\t\t$this->employee_group = $employee_group;\n\t\t$this->role = $role;\n\t\t$this->branch = $branch;\n\t\t$this->nationality = $nationality;\n\t\t$this->document_type = $document_type;\n\t\t$this->document = $document;\n\t\t$this->bank = $bank;\n\t\t$this->employee_salary = $employee_salary;\n\t\t$this->qualification = $qualification;\n\t\t$this->account = $account;\n\t}", "function __construct($companyid, $emp_seqno) {\n global $g_db_sql;\n $this->companyID = $companyid;\n $this->empSeqNo = $emp_seqno;\n $this->DBConn = &$g_db_sql;\n }", "public function __construct(Elastic $elastic, Employee $employee)\n {\n parent::__construct();\n\n $this->elastic = $elastic;\n $this->employee = $employee;\n }", "public function __construct() {\n parent::__construct();\n //setting attribute types.\n settype($this->id, \"integer\");\n settype($this->name, \"string\");\n settype($this->question_type_id, \"integer\");\n }", "function __construct($u_id = \"-1\"){\n try{\n $db = new MyConnection();\n $this->connection = $db->getConnection();\n // Initialise frequently used queries as prepared statements\n $this->initQueries();\n }\n catch (Exception $e){\n echo \"MySQL Connection Failed\";\n }\n // if the emmployee id is -1 create a container employee\n if($u_id == \"-1\")\n // default data\n $this->data = array('u_id'=> -1,\n 'e_id' => 'MAHE9999999',\n 'email' => 'na',\n 'password' => 'na');\n else // if not check if employee exists and then retrieve\n {\n // Retrieve data from the employee id\n $this->data['u_id'] = $u_id;\n $result = $this->connection->query(\"SELECT * FROM user WHERE u_id = '{$this->data['u_id']}'\");\n if($result && $result->num_rows == 1){\n\n $this->data = $result->fetch_assoc();\n }\n else{\n echo \"Cannot Retrieve\";\n }\n }\n }", "public function __construct(\\WorkdayWsdl\\\\StructType\\Employee_ReferenceType $employee_Reference = null, \\WorkdayWsdl\\\\StructType\\Employee_Image_DataType $employee_Image_Data = null, $version = null)\n {\n $this\n ->setEmployee_Reference($employee_Reference)\n ->setEmployee_Image_Data($employee_Image_Data)\n ->setVersion($version);\n }", "public function __construct(Employee $employee, Payroll $payroll)\n {\n //\n $this->employee = $employee;\n $this->payroll = $payroll;\n }", "public function __construct($data, RecordType $recordType = null)\n {\n $this->data = $data;\n $this->recordType = $recordType;\n }", "public function generateEmployeeData($employee)\n {\n $data = [\n 'cn' => $employee->cn[0],\n 'company' => $employee->company[0],\n 'l' => $employee->l[0],\n 'department' => $employee->department[0],\n 'streetaddress' => $employee->streetaddress[0],\n 'postalcode' => $employee->postalcode[0],\n 'mail' => $employee->mail[0],\n 'title' => $employee->title[0],\n 'telephonenumber' => Helper::formatPhoneNumberByLocationAndStreet($employee->telephonenumber[0], $employee->l[0], $employee->streetaddress[0]),\n 'mobile' => Helper::formatMobileNumberByLocation($employee->mobile[0], $employee->l[0]),\n // whencreated'] = substr($employee->whencreated[0], 0, 4).'-'.substr($employee->whencreated[0], 4, 2).'-'.substr($employee->whencreated[0], 6, 2),\n 'thumbnailphoto' => base64_encode($employee->thumbnailphoto[0]),\n ];\n\n return $data;\n }", "public function __construct(TDProject_ERP_Model_Entities_Address $address = null)\n {\n // call the parents constructor\n parent::__construct($address);\n // initialize the ValueObject with the passed data\n $this->_countries = new TechDivision_Collections_ArrayList();\n }", "private function _serializeEmployee($record)\n {\n $employee = new Employee();\n $employee->EmployeeID = $record['EmployeeID'];\n $employee->FirstName = $record['FirstName'];\n $employee->LastName = $record['LastName'];\n $employee->Title = $record['Title'];\n $employee->TitleOfCourtesy = $record['TitleOfCourtesy'];\n $employee->BirthDate = !is_null($record['BirthDate']) ? $record['BirthDate']->format('Y-m-d\\TH:i:s'): null;\n $employee->HireDate = !is_null($record['HireDate']) ? $record['HireDate']->format('Y-m-d\\TH:i:s'): null; \n $employee->Address = $record['Address'];\n $employee->City = $record['City'];\n $employee->Region = $record['Region'];\n $employee->PostalCode = $record['PostalCode'];\n $employee->Country = $record['Country'];\n $employee->HomePhone = $record['HomePhone'];\n $employee->Extension = $record['Extension'];\n $employee->Notes = $record['Notes'];\n $employee->ReportsTo = $record['ReportsTo'];\n //$employee->Photo = $record['Photo'];\n $employee->Emails = array ($employee->FirstName . '@hotmail.com', $employee->FirstName . '@live.com');\n return $employee;\n }", "function __construct($data) {\r\n\t\t$this->annee = (isset($data['annee'])) ? $data['annee'] : \"\";\r\n\t\t$this->tDate = (isset($data['tDate'])) ? $data['tDate'] : \"\";\r\n\t}", "public function __construct($data){\n parent::__construct($data,'Application_Model_Table_Departments');\n }", "public function __construct()\n {\n $dbf_default_schema = [\n [\"id\", self::NUMBER_TYPE, self::MEMORY_ADDRESS, self::FIELD_LENGTH],\n ];\n\n if (empty($this->schema)) {\n $this->schema = $dbf_default_schema;\n }\n }", "public function __construct($userInfo = [])\n {\n if (empty($userInfo[self::EMPLOYEE_ID])) {\n throw new InvalidArgumentException('Employee ID cannot be empty.', 1493733219);\n }\n\n // Set all of the provided fields, taking whatever value was given.\n foreach (self::getAllFieldNames() as $fieldName) {\n if (array_key_exists($fieldName, $userInfo)) {\n $this->values[$fieldName] = $userInfo[$fieldName];\n }\n }\n\n // Ensure fields with stricter constraints have valid values.\n $this->values[self::EMPLOYEE_ID] = (string)$userInfo[self::EMPLOYEE_ID];\n $this->setLocked($userInfo[self::LOCKED] ?? null);\n $this->setRequireMfa($userInfo[self::REQUIRE_MFA] ?? null);\n }", "public function __construct() {\n parent::__construct();\n $this->setOdataType('#microsoft.graph.educationOneRosterApiDataProvider');\n }", "function __construct($id='', $type='current'){\r\n\t\tGLOBAL $strLocal;\r\n\t\tGLOBAL $arrUsrData;\r\n\t\t\r\n\t\t$this->gridName = self::GridName;\t\t\r\n\t\t$this->gridClass = 'headcount_record';\t\t\r\n\t\t$this->register = self::Register;\r\n\t\t\r\n\t\tswitch($type){\r\n\t\t\tcase 'new':\r\n\t\t\t\t$this->table = 'tbl_new_employee';\r\n\t\t\t\t$this->prefix = 'nem';\r\n\t\t\tbreak;\r\n\t\t\tcase 'current':\r\n\t\t\tdefault:\r\n\t\t\t\t$this->table = 'tbl_current_employee';\r\n\t\t\t\t$this->prefix = 'cem';\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t\t\r\n\t\t$this->type = $type;\r\n\t\t\r\n\t\tparent::__construct($id);\r\n\t\t\r\n\t}", "public function __construct($_salutation = NULL,$_firstName = NULL,$_middleName = NULL,$_lastName = NULL,$_suffix = NULL)\r\n\t{\r\n\t\tparent::__construct(array('Salutation'=>$_salutation,'FirstName'=>$_firstName,'MiddleName'=>$_middleName,'LastName'=>$_lastName,'Suffix'=>$_suffix));\r\n\t}", "public function __construct() {\n parent::__construct(self::TABLE_NAME, self::ID, self::NAME);\n $this->_age_model_method = null;\n $this->_core_id = null;\n $this->_age_model_notes = array();\n $this->_contact_id = null;\n $this->_age_model_id_status = 0;\n }", "function __construct( $odataEntity ) {\r\n\t\tparent::__construct( $odataEntity );\r\n\t\tforeach ($odataEntity->getProperties() as $property) {\r\n\t\t\tif ($property->getName() == 'TypeId') {\r\n\t\t\t\t$this->type_id = $property->getValue();\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public function __construct()\n\t{\n\t\t$this->incomeData = FieldMap::getFieldLabel(\"income_data\",\"\",1);\n\t\t$this->removeIncomeFlag = 0;\n\t}", "public function __construct()\n {\n \t$this->schema();\n\t\t$this->data();\n }", "function __construct($dataType, $default = null, $notNull = false) {\n $this->dataType = $dataType;\n $this->value = $default;\n $this->flags = (is_null($default) ? 0 : DATAFLAG_CHANGED) | ($notNull ? DATAFLAG_NOTNULL : 0);\n }", "public function __construct()\n {\n parent::__construct(self::table, self::columns, self::entity_class_name);\n }", "public function __construct()\n {\n parent::__construct(self::table, self::columns, self::entity_class_name);\n }", "public function __construct()\n {\n parent::__construct(self::table, self::columns, self::entity_class_name);\n }", "public function __construct()\n {\n parent::__construct(self::table, self::columns, self::entity_class_name);\n }", "public static function createSelf()\n {\n $dataTypeFactory = new self();\n\n $dataTypeFactory->addFactoryTypeHandler('bit', new BitTypeFactory());\n // Integer type mappers.\n $dataTypeFactory->addFactoryTypeHandler('tinyint', new TinyIntTypeFactory());\n $dataTypeFactory->addFactoryTypeHandler('smallint', new SmallIntTypeFactory());\n $dataTypeFactory->addFactoryTypeHandler('mediumint', new MediumIntTypeFactory());\n $dataTypeFactory->addFactoryTypeHandler('int', new IntTypeFactory());\n $dataTypeFactory->addFactoryTypeHandler('bigint', new BigIntTypeFactory());\n // Numeric-point type mappers.\n $dataTypeFactory->addFactoryTypeHandler('double', new DoubleTypeFactory());\n $dataTypeFactory->addFactoryTypeHandler('float', new FloatTypeFactory());\n $dataTypeFactory->addFactoryTypeHandler('decimal', new DecimalTypeFactory());\n // Date and time mappers.\n $dataTypeFactory->addFactoryTypeHandler('date', new DateTypeFactory());\n $dataTypeFactory->addFactoryTypeHandler('time', new TimeTypeFactory());\n $dataTypeFactory->addFactoryTypeHandler('timestamp', new TimestampTypeFactory());\n $dataTypeFactory->addFactoryTypeHandler('datetime', new DateTimeTypeFactory());\n $dataTypeFactory->addFactoryTypeHandler('year', new YearTypeFactory());\n // Char type mappers.\n $dataTypeFactory->addFactoryTypeHandler('char', new CharTypeFactory());\n $dataTypeFactory->addFactoryTypeHandler('varchar', new VarCharTypeFactory());\n $dataTypeFactory->addFactoryTypeHandler('binary', new BinaryTypeFactory());\n $dataTypeFactory->addFactoryTypeHandler('varbinary', new VarBinaryTypeFactory());\n // Blob type mappers.\n $dataTypeFactory->addFactoryTypeHandler('tinyblob', new TinyBlobTypeFactory());\n $dataTypeFactory->addFactoryTypeHandler('blob', new BlobTypeFactory());\n $dataTypeFactory->addFactoryTypeHandler('mediumblob', new MediumBlobTypeFactory());\n $dataTypeFactory->addFactoryTypeHandler('longblob', new LongBlobTypeFactory());\n // Text type mappers.\n $dataTypeFactory->addFactoryTypeHandler('tinytext', new TinyTextTypeFactory());\n $dataTypeFactory->addFactoryTypeHandler('text', new TextTypeFactory());\n $dataTypeFactory->addFactoryTypeHandler('mediumtext', new MediumTextTypeFactory());\n $dataTypeFactory->addFactoryTypeHandler('longtext', new LongTextTypeFactory());\n // Option type mappers.\n $dataTypeFactory->addFactoryTypeHandler('enum', new EnumTypeFactory());\n $dataTypeFactory->addFactoryTypeHandler('set', new SetTypeFactory());\n // Other type mappers.\n $dataTypeFactory->addFactoryTypeHandler('json', new JsonTypeFactory());\n\n return $dataTypeFactory;\n }", "public function __construct ()\n {\n parent::__construct(NULL);\n $this->name_tuples = [];\n // use name attributes must conform to: AS 5017-2006: Health Care Client Name Usage\n $this->acceptable_use_attributes = UseAttributeInterface::NameValues;\n }", "public function __construct() {\n parent::__construct();\n $this->setOdataType('#microsoft.graph.teamworkApplicationIdentity');\n }", "public function __construct($email,$excel,$tab_value)\n {\n\t $this->email = $email;\n\t $this->excel = $excel;\n\t $this->tab_value = $tab_value;\n }", "public function testCreateEmployee()\n {\n }", "public function __construct($data,$type=false)\n {\n $this->data=$data;\n $this->type=$type;\n }", "public function __construct($index, $column, $data_type, $date_format)\n {\n $this->date_format = $date_format;\n parent::__construct($index, $column, $data_type);\n }", "public function __construct($first_name, $last_name, $gender, $SSN, $emp_id, $year_of_service, $department, $salary, $bonus)\n {\n parent::__construct($first_name, $last_name, $gender, $SSN, $emp_id, $year_of_service, $department, $salary);\n\n $this->bonus = $bonus;\n }", "function __construct($eid){\n\t\t$this->eid = $eid; \n\t\t\n\t }", "public function __construct($obj = null)\n {\n if( !is_null($obj) && $obj instanceof Zend_Db_Table_Row ) {\n $this->id = $obj->ID;\n $this->name = $obj->NAME;\n }\n \n if(is_array($obj)){\n //echo $obj['TOUR_TYPE_ID'];die;\n $this->id = $obj['ID'];\n if(isset($obj['name'])) $this->name = $obj['NAME'];\n }\n }", "public function __construct($StudentNameVal, $StudentSurnameVal, $EmailAddressVal, $PhoneNumberVal, $CellNumberVal, $BirthDateVal, $AddressVal, $EnglishProofVal, $IDTypeVal, $IDNumberVal, $RegistrationFeeVal, $ProgramNameVal, $ProgramTuitionVal, $StartDateVal){\r\n \t\r\n \tparent::__construct($StudentNameVal, $StudentSurnameVal, $EmailAddressVal\r\n \t\t, $PhoneNumberVal, $CellNumberVal, $BirthDateVal,\r\n $AddressVal, $EnglishProofVal, $IDTypeVal, $IDNumberVal, $RegistrationFeeVal, $ProgramNameVal, $ProgramTuitionVal, $StartDateVal);\r\n\r\n\t}", "public function __construct($data) {\n $this->setValues($data);\n }", "public function __construct($data)\n {\n }", "public function __construct($data)\n {\n }", "public function __construct($data)\n {\n }", "public function __construct($data)\n {\n }", "public function __construct(Employer $employer)\n {\n $this->employer = $employer;\n }", "public function __construct()\n {\n \n $this->entityName = MapMarker::MAPMARKER_ENTITY_NAME;\n $this->modelClass = \"\\MapMarkers\\Model\\MapMarker\";\n $this->dataItem = MapMarker::MAPMARKER_DATA_ENTITY;\n }", "public function __construct($_data = NULL, $_bypassFilters = false, $_convertDates = true);", "function __construct($nameU,$tlf) {\r\n\t\t\t$this->nombreUnidad = $nameU;\r\n\t\t\t$this->telefono = $tlf;\r\n }", "public function testConstructor()\n {\n $data = new DataPoint(\n 'uniqueId',\n 'an offense',\n new \\DateTime(),\n 'Gotham',\n [\n 'lat' => 0,\n 'lon' => 0\n ],\n 'Felony',\n '1'\n );\n \n $this->assertInstanceOf('HRQLS\\Controllers\\Crime\\DataPoint', $data);\n \n return $data;\n }", "public function __construct()\n {\n parent::__construct();\n $this->set_column(\"penj_nomor\", \"nomor penjualan\", true);\n $this->set_column(\"penj_nominal\", \"nominal penjualan\", false);\n $this->set_column(\"penj_tgl\", \"tanggal penjualan\", false);\n $this->set_column(\"cust_perusahaan\", \"customer\", false);\n $this->set_column(\"penj_jenis\", \"jenis penjualan\", false);\n $this->set_column(\"penj_status\", \"status\", false);\n $this->set_column(\"status_pembayaran\", \"status pembayaran\", false);\n $this->set_column(\"selisih_tanggal\", \"durasi jatuh tempo\", false);\n $this->penj_create_date = date(\"y-m-d h:i:s\");\n $this->penj_last_modified = date(\"y-m-d h:i:s\");\n $this->id_create_data = $this->session->id_user;\n $this->id_last_modified = $this->session->id_user;\n }", "function __construct() {\n // Initialize the dbms pointer.\n AbstractMapper::__construct();\n\n // Initialize table name.\n $this->tableName = \"special_fees\";\n }", "public function __construct()\n {\n $this->city = new City;\n $this->country = new Country;\n $this->event = new Event;\n $this->experience = new Experience;\n $this->place = new Place;\n $this->type = new Type;\n $this->subcategory = new Subcategory;\n }", "function __construct($_dataTableName = 'Application_Model_DbTable_ProjectCcLicense')\n {\n $this->_dataTableName = $_dataTableName;\n $this->_dataTable = new $this->_dataTableName;\n }", "protected function constructor()\r\n\t{\r\n\t\t$this->finalYear = self::MAX_INT;\r\n\t\t$this->finalMillis = self::MAX_DBL;\r\n\t\t$this->finalZone = null;\r\n\r\n\t\t$this->constructEmpty();\r\n\t}", "function set_employee($emp)\n\t\t{\n\t\t\t$this->employee = $emp;\n\t\t}", "public function __construct() {\n\n\t\t$this->bootstrap = true;\n\t\t$this->table = 'pfg';\n\t\t$this->className = 'PFGModel';\n\t\t$this->publicName = $this->la('Gestion de formulaire');\n\n\t\tparent::__construct();\n\t\t$this->context = Context::getContext();\n\t\tEmployeeConfiguration::updateValue('EXPERT_PFG_SCRIPT', $this->generateParaGridScript());\n\t\t$this->paragridScript = EmployeeConfiguration::get('EXPERT_PFG_SCRIPT');\n\n\t\tif (empty($this->paragridScript)) {\n\t\t\tEmployeeConfiguration::updateValue('EXPERT_PFG_SCRIPT', $this->generateParaGridScript());\n\t\t\t$this->paragridScript = EmployeeConfiguration::get('EXPERT_PFG_SCRIPT');\n\t\t}\n\n\t\tEmployeeConfiguration::updateValue('EXPERT_PFG_FIELDS', Tools::jsonEncode($this->getPFGModelFields()));\n\t\t$this->configurationField = Tools::jsonDecode(EmployeeConfiguration::get('EXPERT_PFG_FIELDS'), true);\n\n\t\tif (empty($this->configurationField)) {\n\t\t\tEmployeeConfiguration::updateValue('EXPERT_PFG_FIELDS', Tools::jsonEncode($this->getPFGModelFields()));\n\t\t\t$this->configurationField = Tools::jsonDecode(EmployeeConfiguration::get('EXPERT_PFG_FIELDS'), true);\n\t\t}\n\n\t}", "public function setDataType($dataType)\n {\n $this->dataType = $dataType;\n return $this;\n }", "public function __construct() {\n parent::__construct();\n $this->_table_columns = array(\"id\", \"entry_date\", \"account_type\", \"entry_value\", \"memo\", \"expense\", \"confirm\", \"deleted\", \"create_stamp\", \"modified_stamp\");\n }", "public function __construct() {\r\n\t\t$this->_data = array(\r\n\t\t\t'Steve' => array(\r\n\t\t\t\t'id' => 1,\r\n\t\t\t\t'userid' => 'Steve',\r\n\t\t\t\t'passwd' => 'lollypop',\r\n\t\t\t\t'inactive' => 'N',\r\n\t\t\t\t'dept_field' => 'North',\r\n\t\t),\r\n\t\t\t'Sally' => array(\r\n\t\t\t\t'id' => 2,\r\n\t\t\t\t'userid' => 'Sally',\r\n\t\t\t\t'passwd' => 'sallybop',\r\n\t\t\t\t'inactive' => 'N',\r\n\t\t\t\t'dept_field' => 'East',\r\n\t\t),\r\n\t\t\t'Sam' => array(\r\n\t\t\t\t'id' => 3,\r\n\t\t\t\t'userid' => 'Sam',\r\n\t\t\t\t'passwd' => 'sammydop',\r\n\t\t\t\t'inactive' => 'Y',\r\n\t\t\t\t'dept_field' => 'West',\r\n\t\t),\r\n\t\t\t);\r\n\r\n\t}", "public function __construct($csvData,$adminId,$type)\n { \n $this->type = $type;\n $this->csvData = $csvData;\n $this->adminId = $adminId;\n }", "function __construct()\n\t{\n\t\t// $this->cust_code = $cust_code;\n\t\t// $this->fecha_interaccion = $fecha_interaccion;\n\t\t// $this->tipo_interaccion = $tipo_interaccion;\n\t\t// $this->time_stamp = $time_stamp;\n }", "public function __construct()\n\t{\n\t\t/** Parse fields **/\n\t\t//$this->fields = include TABLEBASE.DS.'table_user.php';\n\t\t/** Set primary key **/\n\t\t$this->pk\t = 'id';\n\t\t/** Set name,parent call**/\n\t\tparent::__construct();\n\t}", "public static function initialise() {\n \t// We can't modify it in place, else we'll break any logging done inside the SihnonFramework tree\n \t// or other subclass trees.\n \tstatic::$types = parent::$types;\n \t\n \t// Add the new data types for this subclass\n static::$types['job_id'] = 'int'; \n }", "public function __construct() {\n $this->_residentTypeArray = array(ResidentType::all);\n }", "public function __construct($employmentHistoryEmployerName = null, $employmentHistoryEndDate = null, $employmentHistoryMonthlyGrossPay = null, $employmentHistoryOccupation = null, $employmentHistoryStartDate = null, $employmentHistorySupervisorName = null, $employmentHistorySupervisorPhone = null)\n {\n $this\n ->setEmploymentHistoryEmployerName($employmentHistoryEmployerName)\n ->setEmploymentHistoryEndDate($employmentHistoryEndDate)\n ->setEmploymentHistoryMonthlyGrossPay($employmentHistoryMonthlyGrossPay)\n ->setEmploymentHistoryOccupation($employmentHistoryOccupation)\n ->setEmploymentHistoryStartDate($employmentHistoryStartDate)\n ->setEmploymentHistorySupervisorName($employmentHistorySupervisorName)\n ->setEmploymentHistorySupervisorPhone($employmentHistorySupervisorPhone);\n }", "public function __construct($_birthDt = NULL,$_dwellingStructureType = NULL,$_score = NULL)\n {\n MicrobiltCriminalReportWsdlClass::__construct(array('BirthDt'=>$_birthDt,'DwellingStructureType'=>$_dwellingStructureType,'Score'=>$_score),false);\n }", "function __construct($uYear, $uMonth, $uDay) {\n if (!fbIsValidYear($uYear)) throw new Exception(\"Invalid year \" . json_encode($uYear) . \".\");\n if (!fbIsValidMonth($uMonth)) throw new Exception(\"Invalid month \" . json_encode($uMonth) . \".\");\n if (!fbIsValidDay($uDay)) throw new Exception(\"Invalid day \" . json_encode($uDay) . \".\");\n if (!fbIsValidDate($uYear, $uMonth, $uDay)) throw new Exception(\"Invalid date \" . fsGetDataString($uYear, $uMonth, $uDay) . \".\");\n $this->__uYear = $uYear;\n $this->__uMonth = $uMonth;\n $this->__uDay = $uDay;\n }", "function __construct(array $data)\n {\n if (isset($data)) {\n $this->id = $data['id'];\n $this->code = $data['code'];\n $this->startDate = $data['start_date'];\n $this->endDate = $data['end_date'];\n $this->discount = $data['discount'];\n }\n }", "public function __construct(array $data)\n {\n if (isset($data['id'])) {\n $this->id = $data['id'];\n }\n $this->firstname = $data['firstname'];\n $this->lastname = $data['lastname'];\n $this->weight = $data['weight'];\n $this->birthday = $data['birthday'];\n $this->sex = $data['sex'];\n }", "public function __construct() {\n\t\tswitch (TRUE) {\n\t\t\tcase (func_num_args() == 1 && is_array(func_get_arg(0))):\n\t\t\t\t$data = func_get_arg(0);\n\n\t\t\t\t$this->application_id = intval($data['application_id']);\n\t\t\t\t$this->email = strtolower(trim($data['email']));\n\t\t\t\t$this->dep_account = intval(array_search(strtoupper($data['dep_account']), self::$dep_accounts));\n\t\t\t\t$this->income_frequency = intval(array_search(strtoupper($data['income_frequency']), self::$income_frequencies));\n\t\t\t\t$this->income_monthly_net = intval($data['income_monthly_net']);\n\t\t\t\t$this->dob = $data['dob'];\n\t\t\t\tbreak;\n\t\t\tcase (func_num_args() == 6):\n\t\t\t\tlist ($application_id, $email, $dep_account, $income_frequency, $income_monthly_net, $dob) = func_get_args();\n\t\t\n\t\t\t\t$this->application_id = intval($application_id);\n\t\t\t\t$this->email = strtolower(trim($email));\n\t\t\t\t$this->dep_account = intval(array_search(strtoupper($dep_account), self::$dep_accounts));\n\t\t\t\t$this->income_frequency = intval(array_search(strtoupper($income_frequency), self::$income_frequencies));\n\t\t\t\t$this->income_monthly_net = intval($income_monthly_net);\n\t\t\t\t$this->dob = $dob;\t\t\t\t\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t// Not implemented.\n\t\t\t\tbreak;\n\t\t}\t\n\t}", "function __construct($data=NULL){\n switch(true){\n case !isset($data):\n parent::__construct();\n break;\n case is_array($data):\n parent::__construct($data);\n break;\n case is_object($data):\n parent::__construct($data);\n break;\n case is_string($data):\n // TODO (pretty much copy attrPairs())\n break;\n default:\n errorHandle::newError(__METHOD__.\"() - Unsupported data type! (only supports array, string, and object)\", errorHandle::DEBUG);\n return FALSE;\n }\n }", "public function testConstructor_invalidClass()\n {\n new DataPoint('uniqueid', 'an offense', new \\DateTime(), 'Gotham', ['lat' => 0, 'lon' => 0], 'FELONY', '1337');\n }", "public function setDataType($dataType) {\n $dataType = strtoupper($dataType);\n\n if (in_array($dataType, $this->getAllowedDataTypes())) {\n $this->dataType = $dataType;\n }\n\n return $this;\n }", "public function __construct()\n {\n parent::__construct();\n\n // Set data types\n $this->data_types = array(\n 'title' => 'string',\n 'url' => 'url',\n 'url_key' => 'md5',\n 'embed' => 'string',\n 'created_on' => 'datetime'\n );\n\n }", "public function __construct($dataContext = null) {\n if(!isset($dataContext))\n $dataContext = \\Swiftriver\\Core\\Setup::DALConfiguration()->DataContextType;\n $classType = (string) $dataContext;\n $this->dataContext = new $classType();\n }", "public function __construct($dataContext = null) {\n if(!isset($dataContext))\n $dataContext = \\Swiftriver\\Core\\Setup::DALConfiguration()->DataContextType;\n $classType = (string) $dataContext;\n $this->dataContext = new $classType();\n }", "function __construct($TableName = 'item_type') {\r\n $this->idItem_Type = new DB_Field('idItem_Type', 0, new DbIntSanitizer(), TRUE, TRUE);\r\n $this->Category_Type = new DB_Field('Category_Type', 0, new DbIntSanitizer(), TRUE, TRUE);\r\n $this->Type_Description = new DB_Field('Type_Description', '', new DbStrSanitizer(100), TRUE, TRUE);\r\n $this->Order_Line_Type_Id = new DB_Field('Order_Line_Type_Id', 0, new DbIntSanitizer(), TRUE, TRUE);\r\n\r\n parent::__construct($TableName);\r\n }", "public function __construct($pDatabaesObjectRefrence, $pIntCompanyCode = 0){\n\t\t/* database reference */\n\t\t$this->_databaseObject\t= $pDatabaesObjectRefrence;\n\t\t/* Company Code */\n\t\t$this->_intCompanyCode\t= $pIntCompanyCode;\n\t}", "protected function __construct($name)\n {\n // Set basic data\n $this->name = $name;\n\n // Inject db object\n $this->db = Database::getInstance();\n\n ## Load table definition\n\n // No related table set and no data definition set?\n if (empty($this->tbl) && !isset($this->definition))\n return;\n\n // When no related table is set, the definition for the uses datafields\n // has to be set in the model. Otherwise you can not use the validator.\n if (empty($this->tbl) && isset($this->definition))\n {\n #$this->columns = Lib::toObject($this->definition);\n $this->columns = new Data($this->definition);\n unset($this->definition);\n return;\n }\n\n // Get fielddefinition from db table\n $structure = $this->db->getTblStructure($this->tbl);\n\n // Get the columns\n $this->columns = $structure->columns;\n\n // Get primary key column\n $this->pk = $structure->indexes->PRIMARY->columns->{0};\n\n $this->setPK();\n }", "public function __construct($data) {\r\n // e.g. $data['name' => 'Bill']; changes to $user->name = 'Bill'\r\n foreach ($data as $key => $value) {\r\n $this->$key = $value;\r\n }\r\n // Need to clean up the store numbers\r\n $this->fromStore = preg_replace(\"/[^0-9]/\", '', $this->fromStore);\r\n $this->toStore = preg_replace(\"/[^0-9]/\", '', $this->toStore);\r\n \r\n }", "public function __construct($columnName, $value, $type, $length) {\n $this->columnName = $columnName;\n $this->value = $value;\n $this->type = $type;\n $this->length = $length;\n }", "function setEmployeeID($employeeid) {\n $this->employeeid = $employeeid;\n }", "public function __construct($data = null) {\n parent::__construct();\n if ($data !== null) { // If data is given to us, test that data\n $this->data = $data;\n }\n else { // Otherwise test the sample data here\n $this->data = \"Jan,2,3\\nFeb,,8\\nMar,6,13\";\n }\n $this->results = array();\n }", "public function __construct(){\n // $this->team = new \\Model\\Business\\Department();\n $this->config = new \\Model\\Business\\YearPerformanceConfigCyclical();\n $this->record = new \\Model\\Business\\RecordYearPerformanceQuestions();\n $this->question = new \\Model\\Business\\YearPerformanceFeedbackQuestions();\n }", "public function __construct() {\n parent::__construct();\n $this->setOdataType('#microsoft.graph.extensionProperty');\n }", "public function __construct() {\n\t\t\t$this->field_type = 'number';\n\n\t\t\tparent::__construct();\n\t\t}" ]
[ "0.6820082", "0.6673485", "0.6612824", "0.66121924", "0.6486929", "0.63808185", "0.61447394", "0.59936297", "0.59770215", "0.5955739", "0.5918524", "0.5911284", "0.5820489", "0.58125293", "0.57541937", "0.57526106", "0.57379633", "0.5709364", "0.5699383", "0.5681924", "0.5637665", "0.5618231", "0.5617947", "0.5611358", "0.56076026", "0.5599784", "0.5592114", "0.55919236", "0.5571197", "0.5567217", "0.5552946", "0.55518496", "0.5531913", "0.5528053", "0.5525368", "0.5524794", "0.5517786", "0.55125415", "0.55083483", "0.55083483", "0.55083483", "0.55083483", "0.55064315", "0.5502632", "0.54757315", "0.5473505", "0.54377747", "0.5436105", "0.54180944", "0.541559", "0.54059035", "0.54045534", "0.54026335", "0.5395509", "0.5395146", "0.5395146", "0.5393769", "0.5393769", "0.538852", "0.5379473", "0.5377923", "0.5376836", "0.5376185", "0.5372817", "0.5366228", "0.53580064", "0.53574103", "0.5354471", "0.53527045", "0.5349592", "0.53481674", "0.53456086", "0.5327826", "0.5327542", "0.5322776", "0.5319306", "0.53187335", "0.5303142", "0.53021514", "0.5301605", "0.53007513", "0.529641", "0.52961236", "0.52950966", "0.5294819", "0.5294242", "0.52832776", "0.52832365", "0.5280976", "0.5280976", "0.5280683", "0.5277372", "0.52764213", "0.5276203", "0.5271046", "0.5263596", "0.5256449", "0.52538747", "0.5253615", "0.52467024" ]
0.5597713
26
This method is responsible for validating the values passed to the setPersonal_Info_Data method This method is willingly generated in order to preserve the oneline inline validation within the setPersonal_Info_Data method
public static function validatePersonal_Info_DataForArrayConstraintsFromSetPersonal_Info_Data(array $values = array()) { $message = ''; $invalidValues = []; foreach ($values as $employee_DataTypePersonal_Info_DataItem) { // validation for constraint: itemType if (!$employee_DataTypePersonal_Info_DataItem instanceof \WorkdayWsdl\\StructType\Personal_Info_DataType) { $invalidValues[] = is_object($employee_DataTypePersonal_Info_DataItem) ? get_class($employee_DataTypePersonal_Info_DataItem) : sprintf('%s(%s)', gettype($employee_DataTypePersonal_Info_DataItem), var_export($employee_DataTypePersonal_Info_DataItem, true)); } } if (!empty($invalidValues)) { $message = sprintf('The Personal_Info_Data property can only contain items of type \WorkdayWsdl\\StructType\Personal_Info_DataType, %s given', is_object($invalidValues) ? get_class($invalidValues) : (is_array($invalidValues) ? implode(', ', $invalidValues) : gettype($invalidValues))); } unset($invalidValues); return $message; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract public function validateData();", "public function sanitiseData(): void\n {\n $this->firstLine = self::sanitiseString($this->firstLine);\n self::validateExistsAndLength($this->firstLine, 1000);\n $this->secondLine = self::sanitiseString($this->secondLine);\n self::validateExistsAndLength($this->secondLine, 1000);\n $this->town = self::sanitiseString($this->town);\n self::validateExistsAndLength($this->town, 255);\n $this->postcode = self::sanitiseString($this->postcode);\n self::validateExistsAndLength($this->postcode, 10);\n $this->county = self::sanitiseString($this->county);\n self::validateExistsAndLength($this->county, 255);\n $this->country = self::sanitiseString($this->country);\n self::validateExistsAndLength($this->country, 255);\n }", "function personal_info() {\n if (!$this->session->userdata('logged_in')) {\n redirect('logout');\n }\n\n $data1 = $this->show_User_data();\n $data4 = $this->applifinan_data();\n $data2 = $this->show_user_history();\n $data3 = $this->referee_spon_data();\n $data = $data2 + $data1 + $data3 + $data4;\n $data['active2'] = TRUE;\n\n $this->form_validation->set_rules('surname', 'surname', 'required|max_length[20]|alpha|xss_clean');\n $this->form_validation->set_rules('other_name', 'Other name', 'required|max_length[40]|alpha|xss_clean');\n $this->form_validation->set_rules('title', 'title', 'required|max_length[10]|xss_clean');\n $this->form_validation->set_rules('datebirth', 'Date of birth', 'trim|required|exact_length[10]|xss_clean');\n $this->form_validation->set_rules('disab', 'disable', 'required|max_length[20]|xss_clean');\n $this->form_validation->set_rules('perm_address', 'Permanet Address', 'required|max_length[30]|xss_clean');\n $this->form_validation->set_rules('landline', 'landline', 'trim|exact_length[10]|numeric|xss_clean|callback_landline_check');\n $this->form_validation->set_rules('mobile', 'mobile', 'required|exact_length[10]|numeric|xss_clean');\n $this->form_validation->set_rules('fax', 'fax', 'min_length[14]|max_length[16]|alpha_dash|xss_clean|callback_fax_check');\n $this->form_validation->set_rules('email', 'email', 'required|max_length[40]|valid_email|xss_clean');\n $this->form_validation->set_rules('coun_birth', 'country', 'required|max_length[80]|xss_clean');\n $this->form_validation->set_rules('nation', 'nationality', 'required|max_length[40]|xss_clean');\n $this->form_validation->run();\n\n if (isset($_POST['savcont'])) {\n $datebirth= $this->input->post('datebirth');\n if ($this->form_validation->run() == FALSE || substr($datebirth, 6)>= date('Y')) {\n $data['error']='<p>Your date of birth cant be that day please try again.</p>';\n $this->load->view('application/capplication', $data);\n } else {\n\n $data['active3'] = TRUE;\n unset($data['active2']);\n $this->load->model('Application_form');\n Application_form::insert_other_info($datebirth);\n $this->load->view('application/capplication', $data);\n }\n } elseif (isset($_POST['save'])) {\n $datebirth= $this->input->post('datebirth');\n if($this->form_validation->run() == FALSE ||substr($datebirth, 6) >= date('Y')){\n $data['error']='<p>Your date of birth cant be that day please try again.</p>';\n $this->load->view('application/capplication', $data); \n } else {\n $this->load->model('Application_form');\n Application_form::insert_other_info($datebirth);\n $this->load->view('application/capplication', $data);\n }\n } elseif(isset($_POST['back'])){\n $data['active1'] = TRUE;\n unset($data['active2']);\n $this->load->view('application/capplication', $data);\n }else {\n $this->load->view('application/capplication', $data);\n }\n }", "protected function validate_data_fields(){\n\t\tif(empty($this->RESPONSE)){throw new Exception(\"Response field not found\", 5);}\n\t\t\n\t\t// The remote IP address is also required\n\t\tif($this->validate_ip($this->REMOTE_ADDRESS)){throw new Exception(\"Renote IP address not set correctly\", 6);}\n\t}", "function isDataValid() \n {\n return true;\n }", "function validation($data, $files) {\n $errors = parent::validation($data, $files);\n \n if(empty($data['ukprn'])) {\n $errors['ukprn'] = get_string('error_missing_school_name', 'enrol_ukfilmnet');\n }\n if($data['contact_email'] && strpos( $data['contact_email'], '@') === false) {\n $errors['contact_email'] = get_string('error_invalid_email', 'enrol_ukfilmnet');\n }\n if(!array_key_exists('school_consent_to_contact', $data)) {\n $errors['school_consent_to_contact'] = get_string('error_missing_school_consent_to_contact', 'enrol_ukfilmnet');\n }\n \n return $errors;\n }", "function ValidateData()\n\t\t{\n\t\t\t$theValidator = new CValidator();\n\t\t\tif(!$this->arrValidator || !is_array($this->arrValidator) )\n\t\t\t{\n\t\t\t\t$this->arrValidator = array();\n\t\t\t}\n\t\t\tforeach($this->arrValidator as $key=>$value)\n\t\t\t{\n\t\t\t\tif($this->$key == '')\n\t\t\t\t{\n\t\t\t\t\t// Kiem tra xem co phai bat buoc khong?\n\t\t\t\t\tif(isset($this->arrRequired[$key]) && ($this->arrRequired[$key] == 1))\n\t\t\t\t\t{\n\t\t\t\t\t\treturn(false);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif(!$theValidator->CheckPatt($value, $this->$key))\n\t\t\t\t\t{\n\t\t\t\t\t\treturn(false);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn(true);\n\t\t}", "private function validateData()\n {\n if (empty($this->nome)) {\n $this->errors->addMessage(\"O nome é obrigatório\");\n }\n\n if (!filter_var($this->email, FILTER_VALIDATE_EMAIL)) {\n $this->errors->addMessage(\"O e-mail é inválido\");\n }\n\n if (strlen($this->senha) < 6) {\n $this->errors->addMessage(\"A senha deve ter no minímo 6 caracteres!\");\n }\n if ($this->emailExiste($this->email, 'email')) {\n $this->errors->addMessage(\"Esse e-mail já está cadastrado\");\n }\n if ($this->emailExiste($this->usuario, 'usuario')) {\n $this->errors->addMessage(\"Esse usuário já está cadastrado\");\n }\n\n return $this->errors->hasError();\n }", "private function validateFormData() {\n\n $this->firstName = $this->generalFieldValidation($this->firstName, \"firstName\", \"First name\", 40, false);\n $this->lastName = $this->generalFieldValidation($this->lastName, \"lastName\", \"Last name\", 40, false);\n $this->email = $this->generalFieldValidation($this->email, \"email\", \"E-mail\", 60, false);\n $this->address = $this->generalFieldValidation($this->address, \"address\", \"Address\", 255);\n $this->city = $this->generalFieldValidation($this->city, \"city\", \"City\", 60);\n $this->state = $this->generalFieldValidation($this->state, \"state\", \"State\", 2);\n $this->zip = $this->generalFieldValidation($this->zip, \"zip\", \"Zip code\", 5);\n $this->phone = $this->generalFieldValidation($this->phone, \"phone\", \"Phone number\", 10, false);\n $this->notes = $this->generalFieldValidation($this->notes, \"notes\", \"Notes\", -1, false);\n if ($this->phone !== \"\") {\n if (!is_numeric($this->phone)) {\n $this->errorArray[\"phone\"] = \"Phone number may only contain digits.\";\n } else {\n if (strlen($this->phone) < 10) {\n $this->errorArray[\"phone\"] = \"Phone number must contain 10 digits.\";\n }\n }\n }\n if ($this->zip !== \"\") {\n if (!is_numeric($this->zip)) {\n $this->errorArray[\"zip\"] = \"Zip code may only contain digits.\";\n } else {\n if (strlen($this->zip) !== 5) {\n $this->errorArray[\"zip\"] = \"Five digit zip code required.\";\n }\n }\n }\n if ($this->email !== \"\") {\n if (!preg_match(\"/^\\S+@\\S+\\.\\S+$/\", $this->email)) {\n $this->errorArray[\"email\"] = \"E-mail address is not valid.\";\n }\n }\n if (count($this->errorArray) === 0) {\n $this->passedValidation = true;\n }\n }", "function validateData($array){\n\t\t$errorFlag=true;\n\t\t$currentDate = getdate(); //get current date\n\t\tif (trim($array['FName'])==''){\n\t\t\t$this->appendErrorMsg(\"First Name is required\");\n\t\t\t$errorFlag = false;\n\t\t}\n\t\tif (trim($array['LName'])==''){\n\t\t\t$this->appendErrorMsg(\"Last Name is required\");\n\t\t\t$errorFlag = false;\n\t\t}\n\t\tif (trim($array['License_No'])==''){\n\t\t\t$this->appendErrorMsg(\"License number is required\");\n\t\t\t$errorFlag = false;\n\t\t}\n\t\tif (trim($array['Birthdate'])==''){\n\t\t\t$this->appendErrorMsg(\"Birthdate cannot be blank\");\n\t\t\t$errorFlag = false;\n\t\t} else if (!preg_match(\"/^[0-9]{4,4}[-][0-1]{1,2}?[0-9]{1,2}[-][0-3]{1,2}?[0-9]{1,2}$/\", $array['Birthdate'])){\n\t\t\t$this->appendErrorMsg(\"Date should be in the format yyyy-mm-dd\");\n\t\t\t$errorFlag = false;\n\t\t} else if (getAge($array['Birthdate'])<16 || getAge($array['Birthdate'])> 100){\n\t\t\t$this->appendErrorMsg(\"Sorry, we do not provide coverage to drivers under the age of 16 or over the age of 100\");\n\t\t\t$errorFlag = false;\n\t\t}\n\t\tif (trim($array['PostalCode'])==''){\n\t\t\t$this->appendErrorMsg(\"Postal Code is required\");\n\t\t\t$errorFlag = false;\n\t\t} else if (!preg_match(\"/^[A-Za-z]{1}\\d{1}[A-Za-z]{1}\\d{1}[A-Za-z]{1}\\d{1}$/\",$array['PostalCode'])){\n\t\t\t$this->appendErrorMsg(\"Postal Code should be in the format A1B2C3\");\n\t\t\t$errorFlag = false;\n\t\t}\n\t\tif (trim($array['Phone'])==''){\n\t\t\t$this->appendErrorMsg(\"Phone number is required\");\n\t\t\t$errorFlag = false;\n\t\t} else if (!preg_match(\"/^[0-9]{10}$/\",$array['Phone'])){\n\t\t\t$this->appendErrorMsg(\"Phone number must be in the format xxx-xxx-xxxx or xxxxxxxxx\");\n\t\t\t$errorFlag = false;\n\t\t}\n\t\tif (!preg_match(\"/^[0-9]{1,}$/\", $array['Years_Exp'])){\n\t\t\t$this->appendErrorMsg(\"Please input the number of Years of Experience\");\n\t\t\t$errorFlag = false;\n\t\t}\n\t\treturn $errorFlag;\n\t}", "protected function validationData() {\n\t\t$input = [];\n\n\t\t/**\n\t\t * Decode institute and ref_by id and merge to request input\n\t\t */\n\t\tif ( $this->has('institute_id') ) {\n\t\t\t$input['institute_id'] = GeneralHelpers::decode($this->input('institute_id'));\n\t\t}\n\n\t\tif ( $this->has('ref_by') ) {\n\t\t\t$input['ref_by'] = GeneralHelpers::decode($this->get('ref_by'));\n\t\t}\n\n\t\t$this->merge($input);\n\n\t\treturn parent::validationData(); // TODO: Change the autogenerated stub\n\t}", "private function writeDataValidity(): void\n {\n // Datavalidation collection\n $dataValidationCollection = $this->phpSheet->getDataValidationCollection();\n\n // Write data validations?\n if (!empty($dataValidationCollection)) {\n // DATAVALIDATIONS record\n $record = 0x01B2; // Record identifier\n $length = 0x0012; // Bytes to follow\n\n $grbit = 0x0000; // Prompt box at cell, no cached validity data at DV records\n $horPos = 0x00000000; // Horizontal position of prompt box, if fixed position\n $verPos = 0x00000000; // Vertical position of prompt box, if fixed position\n $objId = 0xFFFFFFFF; // Object identifier of drop down arrow object, or -1 if not visible\n\n $header = pack('vv', $record, $length);\n $data = pack('vVVVV', $grbit, $horPos, $verPos, $objId, count($dataValidationCollection));\n $this->append($header . $data);\n\n // DATAVALIDATION records\n $record = 0x01BE; // Record identifier\n\n foreach ($dataValidationCollection as $cellCoordinate => $dataValidation) {\n // options\n $options = 0x00000000;\n\n // data type\n $type = CellDataValidation::type($dataValidation);\n\n $options |= $type << 0;\n\n // error style\n $errorStyle = CellDataValidation::errorStyle($dataValidation);\n\n $options |= $errorStyle << 4;\n\n // explicit formula?\n if ($type == 0x03 && preg_match('/^\\\".*\\\"$/', $dataValidation->getFormula1())) {\n $options |= 0x01 << 7;\n }\n\n // empty cells allowed\n $options |= $dataValidation->getAllowBlank() << 8;\n\n // show drop down\n $options |= (!$dataValidation->getShowDropDown()) << 9;\n\n // show input message\n $options |= $dataValidation->getShowInputMessage() << 18;\n\n // show error message\n $options |= $dataValidation->getShowErrorMessage() << 19;\n\n // condition operator\n $operator = CellDataValidation::operator($dataValidation);\n\n $options |= $operator << 20;\n\n $data = pack('V', $options);\n\n // prompt title\n $promptTitle = $dataValidation->getPromptTitle() !== '' ?\n $dataValidation->getPromptTitle() : chr(0);\n $data .= StringHelper::UTF8toBIFF8UnicodeLong($promptTitle);\n\n // error title\n $errorTitle = $dataValidation->getErrorTitle() !== '' ?\n $dataValidation->getErrorTitle() : chr(0);\n $data .= StringHelper::UTF8toBIFF8UnicodeLong($errorTitle);\n\n // prompt text\n $prompt = $dataValidation->getPrompt() !== '' ?\n $dataValidation->getPrompt() : chr(0);\n $data .= StringHelper::UTF8toBIFF8UnicodeLong($prompt);\n\n // error text\n $error = $dataValidation->getError() !== '' ?\n $dataValidation->getError() : chr(0);\n $data .= StringHelper::UTF8toBIFF8UnicodeLong($error);\n\n // formula 1\n try {\n $formula1 = $dataValidation->getFormula1();\n if ($type == 0x03) { // list type\n $formula1 = str_replace(',', chr(0), $formula1);\n }\n $this->parser->parse($formula1);\n $formula1 = $this->parser->toReversePolish();\n $sz1 = strlen($formula1);\n } catch (PhpSpreadsheetException $e) {\n $sz1 = 0;\n $formula1 = '';\n }\n $data .= pack('vv', $sz1, 0x0000);\n $data .= $formula1;\n\n // formula 2\n try {\n $formula2 = $dataValidation->getFormula2();\n if ($formula2 === '') {\n throw new WriterException('No formula2');\n }\n $this->parser->parse($formula2);\n $formula2 = $this->parser->toReversePolish();\n $sz2 = strlen($formula2);\n } catch (PhpSpreadsheetException $e) {\n $sz2 = 0;\n $formula2 = '';\n }\n $data .= pack('vv', $sz2, 0x0000);\n $data .= $formula2;\n\n // cell range address list\n $data .= pack('v', 0x0001);\n $data .= $this->writeBIFF8CellRangeAddressFixed($cellCoordinate);\n\n $length = strlen($data);\n $header = pack('vv', $record, $length);\n\n $this->append($header . $data);\n }\n }\n }", "private function isValidProfileInformation($user_fulldata,$application){\n $validation_array = $this->getValidationArray($application);\n\n $user_reg_validation = $validation_array['users_reg'];\n $guardian_validation = $validation_array['guardian'];\n $qualifications_validation = $validation_array['qualifications'];\n $qualification_error_msg = $validation_array['qualifications']['DEGREE_ID_MSG'];\n $or_qualifications_validation = $validation_array['or_qualifications']['OR_DEGREE_ID'];\n $or_qualification_error_msg = $validation_array['or_qualifications']['OR_DEGREE_ID_MSG'];\n\n $users_reg = $user_fulldata['users_reg'];\n $guardian = $user_fulldata['guardian'];\n $qualifications = $user_fulldata['qualifications'];\n\n\n\n if($users_reg['IS_CNIC_PASS']=='P'){\n $user_reg_validation = array_merge($user_reg_validation,$validation_array['PASSPORT']);\n }else{\n $user_reg_validation = array_merge($user_reg_validation,$validation_array['CNIC']);\n }\n\n $error = \"\";\n foreach($user_reg_validation as $column=>$value){\n\n\n if(preg_match(\"/\".$value['regex'].\"/\", $users_reg[$column])){\n\n }else{\n $error.=\"<div class='text-danger'>{$value['error_msg']}</div>\";\n\n }\n }\n\n foreach($guardian_validation as $column=>$value){\n\n\n if(preg_match(\"/\".$value['regex'].\"/\", $guardian[$column])){\n\n }else{\n $error.=\"<div class='text-danger'>{$value['error_msg']}</div>\";\n }\n }\n \n foreach($qualifications as $qual){\n\n foreach($qualifications_validation['DEGREE_ID'] as $k=>$val){\n if($qual['DEGREE_ID']==$val){\n unset($qualifications_validation['DEGREE_ID'][$k]);\n unset($qualification_error_msg[$k]);\n\n break;\n }\n }\n }\n foreach ($qualification_error_msg as $error_msg){\n $error.=\"<div class='text-danger'>{$error_msg}</div>\";\n }\n\n\n if(is_array($or_qualifications_validation)){\n $bool = true;\n foreach($qualifications as $qual){\n\n foreach($or_qualifications_validation as $val){\n if($qual['DEGREE_ID']==$val){\n $bool = false;\n break;\n }\n }\n }\n\n if($bool){\n $error.=\"<div class='text-danger'>{$or_qualification_error_msg}</div>\";\n }\n\n }\n return $error;\n //prePrint($qualification_error_msg);\n\n }", "private function checkData(){\n $this->datavalidator->addValidation('article_title','req',$this->text('e10'));\n $this->datavalidator->addValidation('article_title','maxlen=250',$this->text('e11'));\n $this->datavalidator->addValidation('article_prologue','req',$this->text('e12'));\n $this->datavalidator->addValidation('article_prologue','maxlen=3000',$this->text('e13'));\n $this->datavalidator->addValidation('keywords','regexp=/^[^,\\s]{3,}(,? ?[^,\\s]{3,})*$/',$this->text('e32'));\n $this->datavalidator->addValidation('keywords','maxlen=500',$this->text('e33'));\n if($this->data['layout'] != 'g' && $this->data['layout'] != 'h'){ //if article is gallery dont need content\n $this->datavalidator->addValidation('article_content','req',$this->text('e14'));\n }\n $this->datavalidator->addValidation('id_menucategory','req',$this->text('e15'));\n $this->datavalidator->addValidation('id_menucategory','numeric',$this->text('e16'));\n $this->datavalidator->addValidation('layout','req',$this->text('e17'));\n $this->datavalidator->addValidation('layout','maxlen=1',$this->text('e18'));\n if($this->languager->getLangsCount() > 1){\n $this->datavalidator->addValidation('lang','req',$this->text('e19'));\n $this->datavalidator->addValidation('lang','numeric',$this->text('e20'));\n }\n //if user cannot publish articles check publish values\n if($_SESSION[PAGE_SESSIONID]['privileges']['articles'][2] == '1') {\n $this->datavalidator->addValidation('published','req',$this->text('e21'));\n $this->datavalidator->addValidation('published','numeric',$this->text('e22'));\n $this->datavalidator->addValidation('publish_date','req',$this->text('e23'));\n }\n $this->datavalidator->addValidation('topped','req',$this->text('e24'));\n $this->datavalidator->addValidation('topped','numeric',$this->text('e25'));\n $this->datavalidator->addValidation('homepage','req',$this->text('e30'));\n $this->datavalidator->addValidation('homepage','numeric',$this->text('e31'));\n $this->datavalidator->addValidation('showsocials','req',$this->text('e26'));\n $this->datavalidator->addValidation('showsocials','numeric',$this->text('e27'));\n \n $result = $this->datavalidator->ValidateData($this->data);\n if(!$result){\n $errors = $this->datavalidator->GetErrors();\n return array('state'=>'error','data'=> reset($errors));\n }else{\n return true;\n }\n }", "public static function validateData(): array\n {\n\n $data = self::sanitizeData();\n\n // check for name\n if (empty($data['fname'])) {\n $data['errorName'] = 'First name is blank';\n } elseif(strlen($data['fname']) < 2 || strlen($data['fname']) > 20) {\n $data['errorName'] = 'First name must be in range of 2-20 char...';\n }\n\n // check for lname\n if (empty($data['lname'])) {\n $data['errorLastName'] = 'Last name is blank';\n } elseif(strlen($data['lname']) < 2 || strlen($data['lname']) > 30) {\n $data['errorLastName'] = 'Last name must be in range of 2-30 char...';\n }\n\n // check for email\n if (empty($data['email'])) {\n $data['errorEmail'] = 'Email cannot be blank';\n }\n\n // check for gender\n if (empty($data['gender'])) {\n $data['errorGender'] = 'Gender must be selected';\n }\n\n // check for passwords\n\n if (empty($data['password']) || empty($data['cpassword'])) {\n $data['errorPassword'] = 'Password cannot be empty';\n } elseif(strlen($data['password']) < 5 || strlen($data['cpassword']) < 5) {\n $data['errorPassword'] = 'Password must be longer than 5 char...';\n }\n\n if ($data['password'] !== $data['cpassword']) {\n $data['errorPassword'] = 'Passowrd must be a same';\n } \n\n // check birtth\n if (empty($data['birthDate'])) {\n $data['errorBirth'] = 'Birth Date cannot be empty';\n }\n\n if (empty($data['profilePic'])) {\n $data['profilePic'] = '/images/profile.jpg';\n }\n\n if (empty($data['coverPic'])) {\n $data['coverPic'] = 'images/cover.png';\n }\n\n return $data;\n }", "public function checkData() {\n\t\t// e.g. numbers must only have digits, e-mail addresses must have a \"@\" and a \".\".\n\t\treturn $this->control->checkPOST($this);\n\t}", "public function checkData() {\n\t\t// e.g. numbers must only have digits, e-mail addresses must have a \"@\" and a \".\".\n\t\treturn $this->control->checkPOST($this);\n\t}", "public function validateData(){\n\t\tif (!self::isEmailValid($this->email))\n\t\t\tthrow new Exception(\"Email address {$this->email} is not a valid email address.\");\n\n\t\tparent::validateData();\n\t}", "public function validate() {\r\n // Name - this is required\r\n if ($this->description == '') {\r\n $this->errors[] = 'Description is required';\r\n } \r\n \r\n // Category number - must be a number\r\n if (!is_numeric($this->category)) {\r\n $this->category = 0;\r\n } \r\n \r\n // Item number - must be a number\r\n if (!is_numeric($this->item)) {\r\n $this->item = 0;\r\n } \r\n }", "public function isDataValid() {\n if ($this->userExists())\n $this->_errors[] = 'username already taken';\n // username and password must match pattern\n else if (empty($this->_username) || !preg_match('/^[a-zA-Z0-9]{5,16}$/', $this->_username))\n $this->_errors[] = 'invalid username must be between 5 and 16 characters';\n else if (empty($this->_password) || !preg_match('/^[a-zA-Z0-9]{6,18}$/', $this->_password))\n $this->_errors[] = 'invalid password must be between 6 and 18 characters';\n\t\t else if (empty($this->_password) || $this->_password != $this->_password_confirm)\n $this->_errors[] = \"Password didn't match X\";\n // names must be between 2 and 22 characters\n else if (empty($this->_first_name) || !preg_match('/^[a-zA-Z0-9]{2,22}$/', $this->_first_name))\n $this->_errors[] = 'invalid first name must be between 2 and 22 characters';\n else if (empty($this->_last_name) || !preg_match('/^[a-zA-Z0-9]{2,22}$/', $this->_last_name))\n $this->_errors[] = 'invalid last name must be between 2 and 22 characters';\n //restricts day to 01-31, month to 01-12 and year to 1900-2099 (also allowing / - or . between the parts of the date) \n else if (empty($this->_dob) || !preg_match('/^(0?[1-9]|[12][0-9]|3[01])[\\/\\ ](0?[1-9]|1[0-2])[\\/\\ ](19|20)\\d{2}$/', $this->_dob))\n $this->_errors[] = 'invalid dod | must be DD/MM/YYYY format';\n else if (empty($this->_address))\n $this->_errors[] = 'invalid address';\n // checks if valid postal code\n else if (empty($this->_postcode) || !preg_match('/^(([A-PR-UW-Z]{1}[A-IK-Y]?)([0-9]?[A-HJKS-UW]?[ABEHMNPRVWXY]?|[0-9]?[0-9]?))\\s?([0-9]{1}[ABD-HJLNP-UW-Z]{2})$/', $this->_postcode))\n $this->_errors[] = 'invalid postcode | must be AA11 9AA format';\n // checks is valid email using regular expression\n else if (empty($this->_email) || !preg_match('/^[_\\.0-9a-zA-Z-]+@([0-9a-zA-Z][0-9a-zA-Z-]+\\.)+[a-zA-Z]{2,6}$/', $this->_email))\n $this->_errors[] = 'invalid email';\n\n\n // return true or false \n return count($this->_errors) ? 0 : 1;\n }", "public function validate_fields() {\n \n\t\t\n \n\t\t}", "public function validateData(){\n return true;\n }", "private function validateCustomerInfoFields()\n {\n if (!method_exists($this, 'getCustomerInfo')) {\n throw new InvalidArgumentException(\"Please make sure to add getCustomerInfo that return an array\");\n }\n\n $fields = ['name', 'address', 'zip_code', 'city', 'state', 'country_code', 'phone', 'email'];\n\n foreach ($fields as $field) {\n if (! array_key_exists($field, $this->getCustomerInfo())) {\n throw new InvalidArgumentException(\"Please make sure to add {$field} key to the array that returned by getCustomerInfo\");\n }\n }\n }", "public function validateData(){\n if(substr($this->user_id,0,5)!=$this->office_id){\n return false;\n }\n if(in_array($this->email,$this->getEmails())){\n return false;\n }\n return true; \n }", "function validateInput()\r\n\t{\r\n\t\tif(preg_match('/^[a-zA-Z ]*$/', $this->name) != 1)\r\n\t\t{\r\n\t\t\t$this->err = true;\r\n\t\t\t$this->errMsgBeg .= \"-> Error in name $this->name. Only alphabets allowed.<br>\";\r\n\t\t}\r\n\r\n\t\tif(preg_match('/^[a-zA-Z ]*$/', $this->desg) != 1)\r\n\t\t{\r\n\t\t\t$this->err = true;\r\n\t\t\t$this->errMsgBeg .= \"-> Error in designation $this->desg. Only alphabets allowed.<br>\";\r\n\t\t}\r\n\r\n\t\tif(empty($this->addr))\r\n\t\t{\r\n\t\t\t$this->err = true;\r\n\t\t\t$this->errMsgBeg .= \"-> Error in address entered. Please fill correct address field as per gender: Office address for Male user, and Residential address for Female user.<br>\";\t\r\n\t\t}\r\n\r\n\t\tforeach($this->emails as $ele)\r\n\t\t{\r\n\t\t\tif(!filter_var($ele, FILTER_VALIDATE_EMAIL))\r\n\t\t\t{\r\n\t\t\t\t$this->err = true;\r\n\t\t\t\t$this->errMsgBeg .= \"-> Invalid email-id $ele. Enter correctly.<br>\";\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t}", "protected function localValidation()\n\t\t{\n\t\t}", "public function validate_fields() {\n \n\t\t//...\n \n }", "private function validateData() {\r\n\r\n $requiredFields = array(\"v_code\" => \"Verification code not supplied\",\r\n \"psw1\" => \"Password field is empty\",\r\n \"psw2\" => \"Password field is empty\",);\r\n\r\n\r\n //0 means there is no error\r\n $error_status = \\VAL_NO_ERROR;\r\n\r\n /*\r\n Initialize error object that will be returned by this function\r\n */\r\n $error_obj = new stdClass();\r\n $error_obj->msg = \"\";\r\n $error_obj->field = \"\";\r\n $error_obj->code = 0;\r\n $error_obj->type = \\VAL_NO_ERROR;\r\n\r\n //check if required variables are defined\r\n foreach ($requiredFields as $key => $value) {\r\n $value = $this->request->request->get($key);\r\n if (empty( $value )) {\r\n $error_obj->field = $key;\r\n $error_obj->msg = $requiredFields[$key];\r\n $error_obj->type = \\VAL_FIELD_ERROR;\r\n\r\n //return after each field that is found wrong\r\n return $error_obj;\r\n }\r\n }\r\n\r\n $pass_1 = $this->request->request->get('psw1');\r\n $pass_2 = $this->request->request->get('psw2');\r\n\r\n //Check if emails match\r\n if (strcmp($pass_1, $pass_2) != 0) {\r\n $error_obj->field = \"psw2\";\r\n $error_obj->msg = \"Passwords are different\";\r\n $error_obj->type = \\VAL_FIELD_ERROR;\r\n\r\n return $error_obj;\r\n }\r\n\r\n /*\r\n Only check one password. If both passwords are thesame, we only need to check one of them.\r\n */\r\n if (!preg_match('/^(?=.*\\d)(?=.*[a-z])(?=.*[A-Z]).{6,}$/', $pass_1)) {\r\n $error_obj->field = \"psw1\";\r\n $error_obj->msg = \"Password must have a digit, lower and upper case charters. Min lenght is 6\";\r\n $error_obj->type = \\VAL_FIELD_ERROR;\r\n\r\n return $error_obj;\r\n }\r\n\r\n return $error_obj;\r\n }", "protected function validationData() {\n\t\t$input = [];\n\n\t\t/**\n\t\t * If source and target institute id is available in input decode it and merge with input\n\t\t */\n\t\tif ( $this->has('source_institute_id') ) {\n\t\t\t$input['source_institute_id'] = GeneralHelpers::decode($this->input('source_institute_id'));\n\t\t}\n\n\t\tif ( $this->has('target_institute_id') ) {\n\t\t\t$input['target_institute_id'] = GeneralHelpers::decode($this->input('target_institute_id'));\n\t\t}\n\n\t\t$this->merge($input);\n\n\t\treturn parent::validationData();\n\t}", "public function validateDataInvoice(): void\n {\n $this->validarDatos($this->datos, $this->getRules('fe'));\n\n $this->validarDatosArray($this->datos->arrayOtrosTributos, 'tributos');\n\n /** @phpstan-ignore-next-line */\n if (property_exists($this->datos, 'arraySubtotalesIVA')) {\n $this->validarDatosArray((array) $this->datos->arraySubtotalesIVA, 'iva');\n }\n\n $this->validarDatosArray($this->datos->comprobantesAsociados, 'comprobantesAsociados');\n\n if ($this->ws === 'wsfe') {\n if (property_exists($this->datos, 'arrayOpcionales')) {\n $this->validarDatosArray((array) $this->datos->arrayOpcionales, 'opcionales');\n }\n } elseif ($this->ws === 'wsmtxca') {\n $this->validarDatosArray($this->datos->items, 'items');\n }\n }", "public function validate_customer_input_fields()\n {\n $passed_validation_tests = true;\n $check_name = has_presence($this->name);\n $msg = \"Fix the following error(s): \";\n $msg .=\"<ul style='text-align:left;margin-left:33%'>\";\n \n if (!$check_name) {\n $passed_validation_tests = false;\n $msg .= \"<li>\";\n $msg .= \"Customer name cannot be blank.\";\n $msg .= \"</li>\";\n }\n // $check_apy_regex = Form::has_format_matching($apy, '/\\A\\d\\Z/');\n $check_telephone = has_presence($this->telephone);\n $check_telephone_numeric = has_number($this->telephone);\n $check_telephone_length = has_length($this->telephone, ['exact' => 10]);\n if (!$check_telephone or !$check_telephone_numeric or !$check_telephone_length) {\n $passed_validation_tests = false;\n $msg .= \"<li>\";\n $msg .= \"Telephone: \";\n $msg .= h($this->telephone);\n $msg .= \" cannot be blank and must consists of 10 digits.\";\n $msg .= \"</li>\";\n }\n\n $check_barcode = has_presence($this->barcode);\n $check_barcode_numeric = has_number($this->barcode);\n $check_barcode_length = has_length($this->barcode, ['exact' => 6]);\n if (!$check_barcode or !$check_barcode_numeric or !$check_barcode_length) {\n $passed_validation_tests = false;\n $msg .= \"<li>\";\n $msg .= \"Barcode: \";\n $msg .= h($this->barcode);\n $msg .= \" cannot be blank and must consists of 6 digits.\";\n $msg .= \"</li>\";\n }\n\n $msg .= \"</ul>\";\n\n if ($passed_validation_tests) {\n return \"\";\n } else {\n return $msg;\n }\n }", "private function getInfoForValidtion() {\n\t\t\t$Name = $this->getInterstName();\n\t\t\t$Email = $this->getInterstEmail();\n\t\t\t$Message = $this->getInterstMsg();\n\t\t\t$this->validation->InterestFormValidation($Name,$Email,$Message);\n\t\t}", "private function _validData($data){\n\t\t$columnsLen = array(\n\t\t\t\t\t\t\t'nro_pedido' => 6,\n\t\t\t\t\t\t\t'id_factura_pagos' => 1,\n\t\t\t\t\t\t\t'valor' => 1,\n\t\t\t\t\t\t\t'concepto' => 1,\n\t\t\t\t\t\t\t'fecha_inicio' => 0,\n\t\t\t\t\t\t\t'fecha_fin' => 0,\n\t\t\t\t\t\t\t'id_user' => 1\n\t\t);\n\t\treturn $this->_checkColumnsData($columnsLen, $data);\n\t}", "public function isValid()\n\t{\n\t\tif (empty($this->titre)) $this->titre = \"TITRE A REMPLACER\";\n\t\telse $this->titre = trim (preg_replace('/\\s+/', ' ', $this->titre) ); // Suppression des espaces\n\t\tif (!empty($this->contenu)) $this->contenu = trim (preg_replace('/\\s+/', ' ', $this->contenu) ); // Suppression des espaces\n\t\tif (empty($this->statut)) $this->statut = 0;\n\t\tif (empty($this->id_type)) $this->id_type = 1;\n\t\tif (empty($this->id_membre)) $this->id_membre = 0;\n\t}", "function validation($data){\n //messages if there is a problem with the text.\n $errors = parent::validation($data);\n //extra check to make sure there is something in the htmlarea besides a <br />\n $questiontext= trim(strip_tags($data['questiontext']));\n if ($questiontext==''){\n $errors['questiontext'] = get_string('err_required', 'form');\n }\n return $errors;\n }", "function validateData($fields, $vars) \n{ \n\t// array for storing error messages \n\tglobal $err_mess; \t\t\t\t\t\t// error message, make accessible outside function \n\t$err_msg = \"\"; \t\t\t\t\t\t\t// blank to begin with \n\t$fields_ok = true;\t\t\t\t\t\t// success/failure indicator - assume success \n\n\t// for each field name in validation information validate data \n\t// data according to rules for field \n\t// $fields[x] - attribute name \n\t// $fields[x+1] - validation code \n\t// $fields[x+2] - human name for error message \n\t// validation codes - correspond to array entry in function validateData \n\t// 1 - field required - primary key, \"new\" (new record) or numeric (existing record) \n\t// 2 - field required - foreign key, must be numeric, must be > 0 \n\t// 3 - field required - phone number, must be 10 digits long \n\t// 4 - field required - email address \n\t//\t 5 - field required - no validation required \n\t// code + 100 - field not required but same validation as code if field required \n\t\n\t// want to consider validation for all fields in record \n\tfor ($i=0; $i<count($fields); $i=$i+3) \n\t{\n\t\t// extract data value from $vars that corresponds \n\t\t// to field name in validation data \n\t\t$field_name = $fields[$i]; \t\t\t// field name \n\t\t$field_data = $vars[$field_name]; \t// data value from form \n\t\t$field_code = $fields[$i+1];\t\t// validation code \n\t\t$field_err = $fields[$i+2];\t\t\t// field name for error message \n\t\t\n\t\t// determine if validating primary key \n\t\tif ($field_code==1) { \n\t\t\t// primary key, required field, must be \"new\" or numeric \n\t\t\tif (strlen($field_data)==0) { \n\t\t\t\t// required field not entered \n\t\t\t\t$err_mess .=$field_err .\"-required field \"; \n\t\t\t\t$fields_ok = false;\t\t\t// indicate validation problem \n\t\t\t} else { \t\t\t\t\t\t// not blank so \n\t\t\t\t// check for \"new\" (new record) or numeric (update existing record) \n\t\t\t\tif ($field_data != \"new\") { \n\t\t\t\t\tif (is_numeric($field_data) == false) { \n\t\t\t\t\t\t// invalid primary key \n\t\t\t\t\t\t$err_mess .=$field_err .\" - invalid primary key \"; \n\t\t\t\t\t\t$fields_ok = false;\t\t\t// indicate validation problem \t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} \n\t\t} \n\n\t\t// determine if validating foreign key \n\t\tif ($field_code==2 or $field_code==102) {\n\t\t\t// validation may be required on number \n\t\t\t// check if required field and no data \n\t\t\tif ($field_code==2 and is_numeric($field_data)==false) { \n\t\t\t\t// required foreign key and no data \n\t\t\t\t$err_mess .=$field_err .\"-required field \"; \n\t\t\t\t$fields_ok = false; \t\t// indicate validation problem \n\t\t\t} else { \t\t\t\t\t\t// could still be no data \n\t\t\t\tif ($field_data!=\"\" and is_numeric($field_data)==false) { \n\t\t\t\t\t// field is not blank, must be number \n\t\t\t\t\t$err_mess .=$field_err .\"-not numeric \"; \n\t\t\t\t\t$fields_ok = false;\t\t// indicate validation problem \n\t\t\t\t} else { \n\t\t\t\t\t// ensure value is > 0 \n\t\t\t\t\tif ($field_data <= 0) { \n\t\t\t\t\t\t// invalid foreign key \n\t\t\t\t\t\t$err_mess .=$field_err .\"-select \"; \n\t\t\t\t\t\t$fields_ok = false;\t\t// indicate validation problem \n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// determine if validating phone number \n\t\tif ($field_code==3 or $field_code==103) { \n\t\t\t// validation may be required on phone number \n\t\t\tif ($field_code==3 and $field_data==\"\") { \n\t\t\t\t// required field and no data \n\t\t\t\t$err_mess .=$field_err .\"-required field \"; \n\t\t\t\t$fields_ok = false; \t\t// indicate validation problem \n\t\t\t} else { \t\t\t\t\t\t// could still be no data \n\t\t\t\t// validate if not required field & data entered \n\t\t\t\tif ($field_data!=\"\" and is_numeric($field_data)==false) { \n\t\t\t\t\t// field is not a number \n\t\t\t\t\t$err_mess .=$field_err .\"-not numeric \"; \n\t\t\t\t\t$fields_ok = false;\t\t// indicate validation problem \n\t\t\t\t} else { \n\t\t\t\t\t// check for correct length (must be 10 digits) \n\t\t\t\t\tif ($field_data!=\"\" and strlen($field_data)!=10) {\n\t\t\t\t\t\t// phone number length not 10 \n\t\t\t\t\t\t$err_mess .=$field_err .\"-must be 10 digits \"; \n\t\t\t\t\t\t$fields_ok = false; // indicate validation problem \n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} \n\t\t} \n\t\t\n\t\t// determine if validating email address \n\t\tif ($field_code==4 or $field_code==104) { \n\t\t\t// validation may be required on email address \n\t\t\t// check if required field and no data \n\t\t\tif ($field_code==4 and (!isEmail($field_data))) { \n\t\t\t\t// required field and invalid email address \n\t\t\t\t$err_mess .=$field_err .\"-invalid address \"; \n\t\t\t\t$fields_ok = false; \t// indicate validation problem \n\t\t\t} else { \t\t\t\t\t\t// could still be no data \n\t\t\t\tif ($field_data!=\"\") { \n\t\t\t\t\t// validate email address \n\t\t\t\t\tif (!isEmail($field_data)) { \n\t\t\t\t\t\t// invalid email address \n\t\t\t\t\t\t$err_mess .=$field_err .\"-invalid address \"; \n\t\t\t\t\t\t$fields_ok = false;\t\t// indicate validation problem \n\t\t\t\t\t} \n\t\t\t\t}\n\t\t\t}\n\t\t} \n\n\t\t// determine if no validation required (but could be required field) \n\t\tif ($field_code==5 or $field_code==105) { \n\t\t\t// considering field with no validation requirements \n\t\t\tif ($field_code==5 and strlen($field_data)==0) { \n\t\t\t\t// required field and no data \n\t\t\t\t$err_mess .=$field_err .\"-required field \"; \n\t\t\t\t$fields_ok = false; \t// indicate validation problem \n\t\t\t}\n\t\t} \n\t} \n\n\t// all fields validated, return success/failure indicator \n\treturn $fields_ok; \t\n}", "protected function _validate() {\n\t}", "public function normalizeData()\n {\n if (is_numeric($this->Streetname2)) {\n $this->HouseNumber = $this->Streetname2;\n $this->Streetname2 = \"\";\n }\n\n// Sometimes people will input - To mean Idfk why are you asking me to input this?\n if ($this->Phone && strlen($this->Phone) < 3) {\n $this->addMessage($this->getFormatedMessage(\"Invalid Phone [$this->Phone] ignoring\"));\n $this->Phone = '';\n }\n\n if ($this->State && strlen($this->State) < 2) {\n $this->addMessage($this->getFormatedMessage(\"Invalid State [$this->State] ignoring\"));\n $this->State = '';\n }\n\n if ($this->CompanyName && strlen($this->CompanyName) < 3) {\n $this->addMessage($this->getFormatedMessage(\"Invalid CompanyName[$this->CompanyName] ignoring \"));\n $this->CompanyName = '';\n }\n\n $this->Description = $this->escapeTextData($this->Description);\n if ($this->Description && strlen($this->Description) > 255) {\n $this->Description = substr($this->Description, 0, 255);\n\n //Make sure we are not sending a broken special char\n $descChars = str_split($this->Description); \n for ($i = 254; $i > 251; --$i) {\n if ($descChars[$i] == '&') {\n $this->Description = substr($this->Description, 0, $i);\n }\n }\n }\n\n if($this->Description && strlen($this->Description) < 3) {\n $this->addMessage($this->getFormatedMessage(\"Invalid description $this->Description ignoring \"));\n $this->Description = ''; \n }\n }", "function validation($data, $files) {\n global $DB;\n $errors = parent::validation($data, $files);\n\t\t\tif (!filter_var($data['email'], FILTER_VALIDATE_EMAIL)) {\n\t\t\t\t$errors['email'] = \"Invalid email format\";\n\t\t\t} else{\n\t\t\t\t// Add field validation check for duplicate email,username.\n\t\t\t\tif($data['studentid'] == -1){\n\t\t\t\tif ($result = $DB->get_record('user', array('email' => $data['email']), 'id', IGNORE_MULTIPLE)) {\n\t\t\t\t\t//if (empty($data['studentid']) || $result->id != $data['studentid']) {\n\t\t\t\t\t\tif ($result) {\n\t\t\t\t\t\t\t$errors['email'] = \"Email already exists\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t}\n\t\t\tif($data['studentid'] > 0){\n\t\t\t\t\tif ($result = $DB->get_record('user', array('email' => $data['email']), 'id', IGNORE_MULTIPLE)) {\n\t\t\t\t\t\tif ($result && $result->id != $data['studentid']) {\n\t\t\t\t\t\tif ($result) {\n\t\t\t\t\t\t\t$errors['email'] = \"Email already exists\";\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif(!check_only_characters($data['firstname']))\n\t\t{\n\t\t\t$errors['firstname'] = \"Use Only Characters\";\n\t\t}\n\t\tif(!check_only_characters($data['lastname']))\n\t\t{\n\t\t\t$errors['lastname'] = \"Use Only Characters\";\n\t\t}\n\t\tif(!empty($data['phone1'])){\n\t\t\tif(!check_is_number($data['phone1']))\n\t\t\t{\n\t\t\t\t$errors['phone1'] = \"Please Use only Numbers\";\n\t\t\t}\n\t\t\tif(!mobile_number_length($data['phone1']))\n\t\t\t{\n\t\t\t\t$errors['phone1'] = \"Please Give 10 Digit Mobile Number\";\n\t\t\t}\t\n\t\t}\n\t\treturn $errors;\n\t}", "public function validate()\n\t{\n\t\t$errors = array();\n\t\t\n\t\t//make sure user is logged in\n\t\tif (empty($this->userid)) \n\t\t{\n\t\t\t$errors['userid'] = true;\n\t\t}\n\t\t\n\t\t//verify all info is provided\n\t\tif (isset($this->title))\n\t\t\t$this->title = strip_tags($this->title);\n\t\telse\n\t\t\t$errors['title'] = true;\n\t\t\t\n\t\tif (isset($this->description))\n\t\t\t$this->description = strip_tags($this->description);\n\t\telse\n\t\t\t$errors['description'] = true;\n\t\t\t\n\t\tif (isset($this->content))\n\t\t\t$this->content = strip_tags($this->content, \"<br><b>\");\n\t\telse\n\t\t\t$errors['content'] = true;\n\t\t\t\n\t\tif (isset($this->location))\n\t\t\t$this->location = strip_tags($this->location);\n\t\telse\n\t\t\t$errors['location'] = true;\n\t\t\n\t\tif (!isset($this->category))\n\t\t\t$errors['category'] = true;\n\t\t\t\n\t\tif (!isset($this->enddatetime))\n\t\t\t$errors['enddatetime'] = true;\n\t\t\n\t\t\n\t\t//If we made it here, all is valid\n\t\tif (count($errors) > 0)\n\t\t\treturn $errors;\n\t\telse\n\t\t\treturn NULL;\n\t}", "private function _inputUpdateValidatedFields(WireInputData $values, Salesperson $code) {\n\t\t$invalidfields = [];\n\t\t$originals = ['groupid' => $code->groupid, 'userid' => $code->userid, 'vendorid' => $code->vendorid];\n\n\t\t$spgpm = Spgpm::instance();\n\t\t$code->setGroupid($values->string('groupid'));\n\n\t\tif ($spgpm->exists($values->string('groupid')) === false) {\n\t\t\t$code->setGroupid('');\n\t\t\t$invalidfields['groupid'] = 'Group ID';\n\t\t}\n\n\t\t$logm = \\Dplus\\Msa\\Logm::getInstance();\n\t\t$code->setUserid($values->text('userid'));\n\n\t\tif ($values->text('userid') != '' && $logm->exists($values->text('userid')) === false) {\n\t\t\t$code->setUserid('');\n\t\t\t$invalidfields['userid'] = 'Login ID';\n\t\t}\n\n\t\t$vendors = \\VendorQuery::create();\n\t\t$code->setVendorid($values->string('vendorid'));\n\n\t\tif (boolval($vendors->filterByVendorid($values->string('vendorid'))->count()) === false) {\n\t\t\t$code->setVendorid('');\n\t\t\t$invalidfields['vendorid'] = 'Vendor ID';\n\t\t}\n\t\treturn $invalidfields;\n\t}", "function ctr_validateDetails(&$ctx)\n{\n $reservation = $ctx['reservation'];\n\n // tables exist *AND* are not empty\n if (!empty($_POST['fullnames']) AND !empty($_POST['ages']))\n {\n $ages = $_POST['ages'];\n $fullnames = $_POST['fullnames'];\n $persons = array();\n\n for ($i = 0; $i < count($fullnames); $i++)\n {\n // age in [1;120] and fullname is set\n if (1 <= $ages[$i] AND $ages[$i] <= 120 AND $fullnames[$i])\n {\n array_push($persons, new Person($fullnames[$i], $ages[$i]));\n }\n else\n {\n $ctx['warning'] .= \"Veuillez remplir le(s) \".\n \"participant(s) correctement.\\n\";\n return false;\n }\n }\n\n $reservation->persons = $persons;\n $reservation->save();\n \n return true;\n }\n\n // Bypass checks if datas were already filled\n if ($reservation->persons)\n return true;\n\n $ctx['warning'] .= \"Veuillez remplir tous les champs correctement.\\n\";\n\n return false;\n}", "public function validate($data) {\n\n\t\t$this->validationErrors = [];\n\n\t\t$amount = (float)$data['amount'];\n\t\tif ($amount <= 0) {\n\t\t\t$this->validationErrors['error_amount'] = true;\n\t\t}\n\n\t\t// Personal data should be either all blank or all set:\n\t\tif ($this->wantsReceipt($data)) {\n\t\t\tif (empty($data['data_privacy_statement_accepted'])) {\n\t\t\t\t$this->validationErrors['error_data_privacy_statement_accepted'] = true;\n\t\t\t}\n\t\t\tif ($amount < 50) {\n\t\t\t\t$this->validationErrors['error_donation_too_small_for_receipt'] = true;\n\t\t\t}\n\t\t\tif (empty($data['donation_firstname'])) {\n\t\t\t\t$this->validationErrors['error_donation_firstname'] = true;\n\t\t\t}\n\t\t\tif (empty($data['donation_lastname'])) {\n\t\t\t\t$this->validationErrors['error_donation_lastname'] = true;\n\t\t\t}\n\t\t\tif (empty($data['donation_street_address'])) {\n\t\t\t\t$this->validationErrors['error_donation_street_address'] = true;\n\t\t\t}\n\t\t\tif (!preg_match('/^[0-9]{5}$/', $data['donation_zip'])) {\n\t\t\t\t$this->validationErrors['error_donation_zip'] = true;\n\t\t\t}\n\t\t\tif (empty($data['donation_city'])) {\n\t\t\t\t$this->validationErrors['error_donation_city'] = true;\n\t\t\t}\n\t\t\tif (empty($data['donation_country'])) {\n\t\t\t\t$this->validationErrors['error_donation_country'] = true;\n\t\t\t}\n\t\t}\n\n\t\treturn empty($this->validationErrors);\n\t}", "public function validationData()\n {\n $all = parent::validationData();\n $all['bank-info'] = Purifier::clean($all['bank-info']);\n $all['delivery'] = Purifier::clean($all['delivery']);\n return $all;\n }", "protected function prepareForValidation()\n {\n if($this->name != null) {\n $this->merge([\n 'name' => filter_var($this->name, FILTER_SANITIZE_STRING),\n ]);\n }\n\n if($this->email != null) {\n $this->merge([\n 'email' => filter_var(trim($this->email), FILTER_SANITIZE_EMAIL),\n ]);\n }\n\n if($this->leader != null) {\n $this->merge([\n 'leader' => filter_var($this->leader, FILTER_SANITIZE_STRING),\n ]);\n }\n\n if($this->gruplac != null) {\n $this->merge([\n 'gruplac' => filter_var(trim($this->gruplac), FILTER_SANITIZE_URL),\n ]);\n }\n\n if($this->minciencias_code != null) {\n $this->merge([\n 'minciencias_code' => filter_var(trim($this->minciencias_code), FILTER_SANITIZE_STRING),\n ]);\n }\n\n if($this->minciencias_category != null) {\n $this->merge([\n 'minciencias_category' => filter_var($this->minciencias_category, FILTER_SANITIZE_STRING),\n ]);\n }\n\n if($this->website != null) {\n $this->merge([\n 'website' => filter_var(trim($this->website), FILTER_SANITIZE_URL),\n ]);\n }\n\n if($this->educational_institution_id != null) {\n $this->merge([\n 'educational_institution_id' => (integer) filter_var($this->educational_institution_id, FILTER_SANITIZE_NUMBER_INT),\n ]);\n }\n }", "abstract public function validateData($data);", "public function validate() {\n\t\t$this->form_validation->set_rules('rfid', 'FRID', 'required');\t\t\n\t\t$this->form_validation->set_rules('person', \"Person\", 'required');\n\t\t$this->form_validation->set_rules('asset_id', \"Assets\", 'required'); \t\n\t\t$this->form_validation->set_rules('inform_mobile', \"Mobile No.\"); \t\n\t\t$this->form_validation->set_rules('inform_email', \"Email Id\"); \t\n\t\t$this->form_validation->set_rules('send_sms', \"Sms Alert\"); \t\n\t\t$this->form_validation->set_rules('send_email', \"Email Alert\"); \t\n\t\t$this->form_validation->set_rules('comments', \"Comments\"); \t\n\t\t$this->form_validation->set_rules('landmark_id', \"Landmark\"); \t\n\t\treturn parent::validate();\n\t}", "protected function prepareForValidation(): void\n {\n // $this->merge([\n // 'created_by' => Auth::user()->id\n // ]);\n // $this->merge([\n // 'updated_by' => Auth::user()->id\n // ]);\n\n // $this->merge([\n // 'status' => 'Active',\n // 'name' => $this->input('display_name'),\n // 'password' => ''\n // ]);\n\n\n // $this->merge([\n // 'slug' => str_slug($this->input('title'))\n // ]);\n // $this->merge([\n // 'posted_at' => Carbon::parse($this->input('posted_at'))\n // ]);\n }", "protected function prepareValidations() {}", "protected function checkStructure()\n {\n $structure = $this->getStructure();\n\n foreach ($structure as $field => $opt) {\n if (!array_key_exists($field, $this->data)) {\n continue;\n }\n\n $value = Arr::get($this->data, $field);\n if (is_array($value)) {\n $this->errors[$field][] = Translate::get('validate_wrong_type_data');\n continue;\n }\n\n $value = trim($value);\n $length = (int)$opt->length;\n\n if (!empty($length)) {\n $len = mb_strlen($value);\n if ($len > $length) {\n $this->errors[$field][] = Translate::getSprintf('validate_max_length', $length);\n continue;\n }\n }\n\n if (!$opt->autoIncrement && $opt->default === NULL && !$opt->allowNull && $this->isEmpty($value)) {\n $this->errors[$field][] = Translate::get('validate_not_empty');\n continue;\n }\n\n switch ($opt->dataType) {\n case 'int':\n case 'bigint':\n if (!$this->isEmpty($value) && (filter_var($value, FILTER_VALIDATE_INT) === false)) {\n $this->errors[$field][] = Translate::get('validate_int');\n continue 2;\n }\n break;\n\n case 'double':\n if (!is_float($value) && !$this->isEmpty($value)) {\n $this->errors[$field][] = Translate::get('validate_double');\n continue 2;\n }\n break;\n\n case 'float':\n if (!is_numeric($value) && !$this->isEmpty($value)) {\n $this->errors[$field][] = Translate::get('validate_float');\n continue 2;\n }\n break;\n\n case 'date':\n case 'datetime':\n case 'timestamp':\n if (!$this->isEmpty($value) && !Validate::dateSql($value)) {\n $this->errors[$field][] = Translate::get('validate_sql_date');\n continue 2;\n }\n break;\n\n default:\n continue 2;\n break;\n\n }\n }\n }", "protected function validate()\n {\n if ($this->name == '') {\n $this->errors[] = 'Name is required';\n }\n\n if ($this->name == '') {\n $this->errors[] = 'Name is required';\n }\n if ($this->sex == '') {\n $this->errors[] = 'Sex selection is required';\n }\n\n if ($this->description == '') {\n $this->errors[] = 'Description is required';\n }\n\n if ($this->surrender_date == '') {\n $this->errors[] = 'Surrender Date is required';\n }\n\n if ($this->surrender_reason == '') {\n $this->errors[] = 'Surrender Reason is required';\n }\n\n return empty($this->errors);\n }", "abstract protected function fieldValidation($submittedData);", "public function validate(FBDataMap $data, FBDataMap $allData) {\n\t\t\t// for overriding\n\t\t\treturn true;\n\t\t}", "function validation($data, $files) {\n $errors = array();\n\n if (!$data['itemid']) {\n $errors['itemid'] = get_string('pleasechooseavalue', 'surveyreport_frequency');\n }\n\n return $errors;\n }", "function validation($data){\n\tif (empty($data['name']))\n\t\treturn \"Please enter your name\";\n\tif (empty($data['tel']))\n\t\treturn \"Please enter valid contact number\";\n\treturn 0;\n}", "private function validateInputParameters($data)\n {\n }", "function validate()\n\t{\n\t\t$isValid = false;\n\t\t\n\t\tif(empty($this->data['username']))\n\t\t{\n\t\t\t\t$this->errors['username'] = \"Please enter a Username\";\n\t\t}\n\t\t\n\t\tif(empty($this->data['password']))\n\t\t{\n\t\t\t\t$this->errors['password'] = \"Please enter a password\";\n\t\t}\n\t\t\n\t\tif(empty($this->data['description']))\n\t\t{\n\t\t\t\t$this->errors['description'] = \"Please enter a description of yourself\";\n\t\t}\n\t\t\n\t\t\n\t\t//validate data elements in userData property\n\t\t//if an error exists, store to errors using column name as key\n\t\t\n\t\t if(empty($this->errors))\n\t\t{\n\t\t\t$isValid = true;\n\t\t}\n\t\t\n\t\treturn $isValid;\n\t}", "public function validaDatos(){\n\t\t\t\t\n\t\t\t\tif( $this->nombre == \"\" ){\n\t\t\t\t\t\t$this->errores.= \"<strong>* Ingrese su nombre por favor.</strong><br />\";\n\t\t\t\t\t}else if( strlen($this->nombre) > 20 ){\n\t\t\t\t\t\t$errores.= \"<strong>* Escriba un nombre con menos caracteres. (20 caracteres maximo - sin espacios)</strong><br />\";\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\tif( $this->email == \"\" ){\n\t\t\t\t\t\t$this->errores.= \"<strong>* Ingrese su email por favor.</strong><br />\";\n\t\t\t\t\t}else if( !preg_match($this->sintax,$this->email)){\n\t\t\t\t\t\t$this->errores.= \"<strong>* Ingrese formato correcto de email</strong><br /> 'ej: [email protected]' .<br />\";\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif( $this->asunto == \"\" ){\n\t\t\t\t\t\t$this->errores.= \"<strong>* Ingrese su asunto por favor. </strong><br />\";\n\t\t\t\t\t}else if( strlen($this->asunto) > 20 ){\n\t\t\t\t\t\t$errores.= \"<strong>* Escriba un asunto con menos caracteres. (20 caracteres maximo - sin espacios) </strong><br />\";\n\t\t\t\t\t}\n\t\t\t\t\t\t\t \n\t\t\t\tif( $this->msj == \"\" ){\n\t\t\t\t\t\t$this->errores.= \"<strong>* Ingrese su mensaje por favor. </strong><br />\";\n\t\t\t\t\t}else if( strlen($this->msj) > 200 ){\n\t\t\t\t\t$this->errores.= \"<strong>* Maximo permitido 200 caracteres. </strong><br />\";\n\t\t\t\t\t}\n\t\t\t}", "public function validate()\n {\n if ($this->amount <= 0) {\n $this->errors[0] = 'Wpisz poprawną kwotę!';\n }\n \n if (!isset($this->payment)) {\n $this->errors[1] = 'Wybierz sposób płatności!';\n }\n \n if (!isset($this->category)) {\n $this->errors[2] = 'Wybierz kategorię!';\n }\n }", "public function getValidatedData()\n {\n return $this->only([\n // Footer inputs\n 'name', 'localization', 'uri', 'locale', 'page',\n // SEO Metas inputs\n 'seo_title', 'seo_description', 'seo_keywords',\n ]);\n }", "private function PREPARE_VALIDATION_RESULTS()\r\r {\r\r $this->PREPARE_OBJECT_VARIABLE_METHOD(); \r\r $this->READ_FIELDS();\r\r \r\r foreach($this->_ready_fields as $key => $fields)\r\r {\r\r # SET THE ALIAS FOR EACH FIELD\r\r $this->_object[$key]['ALIAS'] = (isset($fields['ALIAS'])) ? $fields['ALIAS'] : $key; \r\r \r\r # IF VALUE IS NOT NULL\r\r if(isset($fields['REQUIRED']) && $this->_object[$key]['VALUE']===''){\r\r $this->_results[$key]['REQUIRED'] = (strlen($fields['REQUIRED']) > 1 ) ? $fields['REQUIRED'] : $this->_object[$key]['ALIAS'].' '.$this->_error['REQUIRED'];\r\r }\r\r \r\r # IF VALUE IS NOT NUMERIC\r\r if( isset($fields['NUMERIC']) && !is_numeric($this->_object[$key]['VALUE']) ){\r\r $this->_results[$key]['NUMERIC'] = (strlen($fields['NUMERIC'])>1 ? $fields['NUMERIC'] :$this->_object[$key]['ALIAS'].' '.$this->_error['NUMERIC']);\r\r }\r\r \r\r # IF VALUE IS A VALID EMAIL\r\r if(isset($fields['EMAIL']) && !$this->checkEmail($this->_object[$key]['VALUE'])){\r\r $this->_results[$key]['EMAIL'] = (strlen($fields['EMAIL'])>1 ? $fields['EMAIL'] :$this->_object[$key]['ALIAS'].' '.$this->_error['EMAIL']);\r\r }\r\r \r\r # IF VALUE HAS A SPECIFIC LENGTH\r\r if(isset($fields['LENGTH'])){\r\r \r\r if(array_key_exists('EQUAL', $fields['LENGTH']) && !(($fields['LENGTH']['EQUAL']) == strlen($this->_object[$key]['VALUE'])))\r\r {\r\r $this->_results[$key]['LENGTH'] =isset($fields['LENGTH']['ERROR'])? $fields['LENGTH']['ERROR']:$this->_object[$key]['ALIAS'].' '.$this->_error['LENGTH']['EQUAL'].' '.$fields['LENGTH']['EQUAL'].' characters';\r\r }\r\r # GREATER THAN \r\r else if(array_key_exists('GREAT', $fields['LENGTH']) && !(strlen($this->_object[$key]['VALUE']) > ($fields['LENGTH']['GREAT'])))\r\r {\r\r $this->_results[$key]['LENGTH'] =isset($fields['LENGTH']['ERROR'])? $fields['LENGTH']['ERROR'] :$this->_object[$key]['ALIAS'].' '.$this->_error['LENGTH']['GREAT'].' '.$fields['LENGTH']['GREAT'].' characters';\r\r }\r\r # GREATER THAN EQUAL TO \r\r else if(array_key_exists('GREAT_E', $fields['LENGTH']) && !(strlen($this->_object[$key]['VALUE'])>=($fields['LENGTH']['GREAT_E'])))\r\r {\r\r $this->_results[$key]['LENGTH'] =isset($fields['LENGTH']['ERROR'])? $fields['LENGTH']['ERROR'] :$this->_object[$key]['ALIAS'].' '.$this->_error['LENGTH']['GREAT_E'].' '.$fields['LENGTH']['GREAT_E'].' characters';\r\r }\r\r # LESS THAN \r\r else if(array_key_exists('LESS', $fields['LENGTH']) && !(strlen($this->_object[$key]['VALUE'])<($fields['LENGTH']['LESS'])))\r\r {\r\r $this->_results[$key]['LENGTH'] =isset($fields['LENGTH']['ERROR'])? $fields['LENGTH']['ERROR'] :$this->_object[$key]['ALIAS'].' '.$this->_error['LENGTH']['LESS'].' '.$fields['LENGTH']['LESS'].' characters';\r\r }\r\r # LESS THAN EQUAL TO \r\r else if(array_key_exists('LESS_E', $fields['LENGTH']) && !(strlen($this->_object[$key]['VALUE'])<=($fields['LENGTH']['LESS_E'])))\r\r {\r\r $this->_results[$key]['LENGTH'] =isset($fields['LENGTH']['ERROR'])? $fields['LENGTH']['ERROR'] :$this->_object[$key]['ALIAS'].' '.$this->_error['LENGTH']['LESS_E'].' '.$fields['LENGTH']['LESS_E'].' characters';\r\r }\r\r }\r\r \r\r # IF A FIELD IS EQUAL TO ANOTHER FIELD \r\r if(isset($fields['COMPARE'])){\r\r \r\r if(is_array($fields['COMPARE']))\r\r {\r\r if($this->_object[$key]['VALUE']!==$this->_object[$fields['COMPARE']['WITH']]['VALUE']){ \r\r $this->_results[$key]['COMPARE'] = isset($fields['COMPARE']['ERROR']) ? $fields['COMPARE']['ERROR'] : $this->_object[$key]['ALIAS'] .' and '. $this->_ready_fields[$fields['COMPARE']['WITH']]['ALIAS'].' '. $this->_error['COMPARE'];\r\r }\r\r } \r\r else\r\r {\r\r if($this->_object[$key]['VALUE']!==$this->_object[$fields['COMPARE']]['VALUE']){\r\r $this->_results[$key]['COMPARE'] = $this->_object[$key]['ALIAS'] .' and '. $this->_ready_fields[$fields['COMPARE']]['ALIAS'].' '. $this->_error['COMPARE'];\r\r }\r\r }\r\r }\r\r \r\r } \r\r }", "function validateData($tID, $sID){\r\n\t\t\t\tglobal $error;\r\n\t\t\t\tglobal $count;\r\n\t\t\t\t\r\n\t\t\t\tif($tID==0 || $tID== null){\r\n\t\t\t\t\t$error.= \"<br/> You must select a tutor.\"; \r\n\t\t\t\t\t$count++;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(count($sID)==0){\r\n\t\t\t\t\t$error.= \"<br/> You must select a student to assign.\"; \r\n\t\t\t\t\t$count++;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}", "protected function validate()\r\n\t{\r\n\t\tif (!$this->isFetched())\r\n\t\t{\r\n\t\t\treturn;\r\n }\r\n \r\n\t\tif ($this->validationInfo)\r\n\t\t{\r\n\t\t\t$this->validationInfo->validate($this->normalizedValue);\r\n\t\t}\r\n\t\t$this->isValid = true;\r\n\t}", "private function proccess()\n {\n foreach ($this->validate as $name => $value) {\n $rules = $this->rules[$name];\n \n /* Let's see is this value a required, e.g not empty */\n if (preg_match('~req~', $rules)) {\n if ($this->isEmpty($value)) {\n $this->errors[] = $this->filterName($name) . ' can\\'t be empty, please enter required data.';\n continue; // We will display only one error per input\n }\n }\n \n /**\n * Let's see is this value needs to be integer\n */\n if (preg_match('~int~', $rules)) {\n if (!$this->isInt($value)) {\n $this->errors[] = $this->filterName($name) . ' is not number, please enter number.';\n continue; // We will display only one error per input\n }\n }\n \n /**\n * Let's see is this value needs to be text\n */\n if (preg_match('~text~', $rules)) {\n if (!$this->isText($value)) {\n $this->errors[] = $this->filterName($name) . ' is not text, please enter only letters.';\n continue; // We will display only one error per input\n }\n }\n \n /* This is good input */\n $this->data[$name] = $value;\n }\n }", "public final function verifyData($key){\n\n unset($this->errors[$key]);\n\n if(!array_key_exists($key,$this->data)){\n\n if(!array_key_exists($key,$this->definition)){\n throw new \\Disco\\exceptions\\Exception(\"Field `{$key}` is not defined by this data model\");\n }//if\n\n //DEFAULT\n if(array_key_exists('default',$this->definition[$key])){\n $this->data[$key] = $this->definition[$key]['default'];\n }//if\n //REQUIRED\n else if($this->getDefinitionValue($key,'required')){\n return $this->setError($key,\"`{$key}` is required\");\n }//elif\n else {\n return false;\n }//el\n\n }//if\n\n //PREMASSAGE\n if(($massage = $this->getDefinitionValue($key,'premassage')) !== false){\n $this->data[$key] = $this->{$massage}($this->data[$key]);\n }//if\n\n $value = $this->data[$key];\n\n //REGEXP\n if(($regexp = $this->getDefinitionValue($key,'regexp')) !== false){\n if(($default = \\App::getCondition($regexp)) !== false && !\\App::matchCondition($default,$value)){\n return $this->setError($key);\n }//if\n if(!preg_match(\"/{$regexp}/\",$value)){\n return $this->setError($key);\n }//if\n $this->_postMassage($key,$value);\n return true;\n }//if\n\n //METHOD\n if(($method = $this->getDefinitionValue($key,'method')) !== false){\n if(!$this->{$method}($value)){\n return $this->setError($key);\n }//if\n $this->_postMassage($key,$value);\n return true;\n }//if\n\n //NULLABLE\n if($this->getDefinitionValue($key,'nullable') && $value === null){\n $this->_postMassage($key,$value);\n return true;\n }//if\n\n $type = $this->getDefinitionValue($key,'type');\n\n //TRUTHY\n if($type != 'boolean' && $this->getDefinitionValue($key,'truthy') && is_bool($value)){\n $this->_postMassage($key,$value);\n return true;\n }//if\n\n switch($type){\n\n case 'int':\n\n if(!$this->_isValidInt($key,$value)){\n return false;\n }//if\n\n break;\n\n case 'uint':\n\n if(!$this->_isValidInt($key,$value)){\n return false;\n }//if\n\n if($value < 0){\n return $this->setError($key,\"`{$key}` must be a positive integer\");\n }//if\n\n break;\n\n case 'float':\n\n if(!$this->_isValidFloat($key,$value)){\n return false;\n }//if\n\n break;\n\n case 'ufloat':\n\n if(!$this->_isValidFloat($key,$value)){\n return false;\n }//if\n\n if($value < 0){\n return $this->setError($key,\"`{$key}` must be a positive number\");\n }//if\n\n break;\n\n case 'string':\n\n if(!is_string($value)){\n return $this->setError($key,\"`{$key}` must be a string\");\n }//if\n\n if(($min = $this->getDefinitionValue($key,'minlen')) !== false && strlen($value) < $min){\n return $this->setError($key,\"`{$key}` must be greater than {$min} characters long\");\n }//if\n\n if(($max = $this->getDefinitionValue($key,'maxlen')) !== false && strlen($value) > $max){\n return $this->setError($key,\"`{$key}` must be less than {$max} characters long\");\n }//if\n\n break;\n\n case 'char':\n\n if(!is_string($value) || strlen($value) != 1){\n return $this->setError($key,\"`{$key}` must be a single character\");\n }//if\n\n break;\n\n case 'boolean': \n\n if(!is_bool($value)){\n return $this->setError($key,\"`{$key}` must be a boolean value\");\n }//if\n\n break;\n\n case 'array':\n\n if(!is_array($value)){\n return $this->setError($key,\"`{$key}` must be an array\");\n }//if\n\n break;\n\n case 'object':\n\n if(is_object($value)){\n if(($instanceof = $this->getDefinitionValue($key,'instanceof')) !== false && !$value instanceof $instanceof){\n return $this->setError($key,\"`{$key}` must be an instance of `{$instanceof}`\");\n }//if\n } //if\n else {\n return $this->setError($key,\"`{$key}` must be an object\");\n }//if\n\n break;\n\n case 'closure':\n\n if(!is_object($value) || !$value instanceof \\Closure){\n return $this->setError($key,\"`{$key}` must be a closure\");\n }//if \n\n break;\n\n default:\n return $this->setError($key);\n\n }//switch\n\n //IN\n if(($in = $this->getDefinitionValue($key,'in')) !== false && !in_array($value,$in)){\n $in = implode(', ',$in);\n return $this->setError($key,\"`{$key}` must be a value of `{$in}`\");\n }//if\n\n //NOTIN\n if(($in = $this->getDefinitionValue($key,'notin')) !== false && in_array($value,$in)){\n $in = implode(', ',$in);\n return $this->setError($key,\"`{$key}` must not be a value of `{$in}`\");\n }//if\n\n $this->_postMassage($key,$value);\n\n }", "private function dataValidator($userData)\n {\n $params = ['username', 'firstname', 'secondname', 'email', 'password'];\n $invalidParams = [];\n\n //->save() will warn if incorrect email or password details, just need to ensure values exist\n foreach ($params as $param) {\n if (!isset($userData[$param]) && $userData[$param] == '') {\n $invalidParams[] = $userData[$param];\n }\n }\n\n if (!empty($invalidParams)) {\n $this->log->logError('Admin User data is missing: ' . implode(', ', $params));\n\n return false;\n }\n\n return true;\n }", "protected function validate() {\r\n if ($this->getBaseAmount() <= 0)\r\n $this->errors->add(\"The base amount of alicuota must be greater than 0.\");\r\n// \t\t\telse\r\n// \t\t\t{\r\n// \t\t\t\t$relativeError = (($this->getTaxAmount() / $this->getBaseAmount() * 100) - $this->getTaxPercent());\r\n// \t\t\t\t$relativeError = $relativeError / $this->getTaxPercent();\r\n// \t\t\t\t$relativeError = NumberDataTypeHelper::truncate($relativeError, 2);\r\n// \t\t\t\tif (abs($relativeError) > 0.01)\r\n// \t\t\t\t\t$this->errors->add(\"The base and tax amount do not match with the alicuota ({$this->getName()}). Diference: $relativeError\");\r\n// \t\t\t}\r\n }", "public static function validatePerson_Identification_DataForArrayConstraintsFromSetPerson_Identification_Data(array $values = array())\n {\n $message = '';\n $invalidValues = [];\n foreach ($values as $create_External_Committee_Member_DataTypePerson_Identification_DataItem) {\n // validation for constraint: itemType\n if (!$create_External_Committee_Member_DataTypePerson_Identification_DataItem instanceof \\WorkdayWsdl\\\\StructType\\Person_Identification_DataType) {\n $invalidValues[] = is_object($create_External_Committee_Member_DataTypePerson_Identification_DataItem) ? get_class($create_External_Committee_Member_DataTypePerson_Identification_DataItem) : sprintf('%s(%s)', gettype($create_External_Committee_Member_DataTypePerson_Identification_DataItem), var_export($create_External_Committee_Member_DataTypePerson_Identification_DataItem, true));\n }\n }\n if (!empty($invalidValues)) {\n $message = sprintf('The Person_Identification_Data property can only contain items of type \\WorkdayWsdl\\\\StructType\\Person_Identification_DataType, %s given', is_object($invalidValues) ? get_class($invalidValues) : (is_array($invalidValues) ? implode(', ', $invalidValues) : gettype($invalidValues)));\n }\n unset($invalidValues);\n return $message;\n }", "public function is_valid()\n {\n }", "public function formValidation($dataSet){\n\t\t\t$error=FALSE; $data=array();\n\t\t\tforeach ($dataSet as $aData) {\n\t\t\t\tif($aData['validationString']=='name'){\n\t\t\t\t\t$data[$aData['dataName']]=$this->getValidatedName(trim($aData['dataValue']));\n\t\t\t\t}\n\t\t\t\tif($aData['validationString']=='number'){\n\t\t\t\t\t$data[$aData['dataName']]=$this->getNumericData(trim($aData['dataValue']));\n\t\t\t\t}\n\t\t\t\tif($aData['validationString']=='integer'){\n\t\t\t\t\t$data[$aData['dataName']]=$this->getIntegerData(trim($aData['dataValue']));\n\t\t\t\t}\n\t\t\t\tif($aData['validationString']=='non empty'){\n\t\t\t\t\t$data[$aData['dataName']]=$this->getNonEmptyData(trim($aData['dataValue']));\n\t\t\t\t}\n\t\t\t\tif($aData['validationString']=='sanitize'){\n\t\t\t\t\t$data[$aData['dataName']]=$this->getSanitizeData(trim($aData['dataValue']));\n\t\t\t\t}\n\t\t\t\tif($aData['validationString']=='gsm phone'){\n\t\t\t\t\t$data[$aData['dataName']]=$this->getValidated080GSMNo(trim($aData['dataValue']));\n\t\t\t\t}\n\t\t\t\tif($aData['validationString']=='email'){\n\t\t\t\t\t$data[$aData['dataName']]=$this->getValidatedEmail(trim($aData['dataValue']));\n\t\t\t\t}\n\t\t\t\tif($aData['validationString']=='password rule'){\n\t\t\t\t\t$data[$aData['dataName']]=$this->enforceRulePassword(trim($aData['dataValue']));\n\t\t\t\t}\n\t\t\t\tif($aData['validationString']=='non empty textarea'){\n\t\t\t\t\t$data[$aData['dataName']]=$this->getNonEmptyTextField(trim($aData['dataValue']));\n\t\t\t\t}\n\t\t\t\tif($aData['validationString']=='in list'){\n\t\t\t\t\t$data[$aData['dataName']]=$this->checkInList($aData['dataValue'],$aData['dataList']);\n\t\t\t\t} \n\t\t\t}\n\t\t\tforeach ($data as $aData) {\n\t\t\t\tif($aData===FALSE) $error=TRUE;\n\t\t\t}\n\t\t\t$validedDataSet=array('error'=>$error, 'data'=>$data);\n\t\t\treturn $validedDataSet;\n\t\t}", "public function is_valid()\n {\n }", "public function check_data()\n {\n parent::check_data();\n\n if(empty($this->build_notifications))\n {\n throw new exception('<strong>Data missing: Notifications</strong>');\n }\n\n if(empty($this->build_batch_reference))\n {\n throw new exception('<strong>Data missing: Batch References</strong>');\n }\n }", "public function validate_feedback_data(){\n \n // validate step 1 data.\n \n // rating should be 1-5.\n if( ! in_array($this->post_data->get('rating'), range(1, 5)) ) $this->error_msg[] = 'Rating should be 1 to 5';\n \n // title should not be blank.\n if( trim($this->post_data->get('title')) == '' ) $this->error_msg[] = 'Title should not be blank';\n \n // feedback should not be blank.\n if( trim($this->post_data->get('feedback')) == '' ) $this->error_msg[] = 'Feedback should not be blank';\n \n // recommendation should be 1 or 0.\n if( ! in_array($this->post_data->get('recommend'), range(0, 1)) ) $this->error_msg[] = 'Invalid recommendation option';\n \n \n \n // validate step 2 data.\n \n // first name should not be blank.\n if( trim($this->post_data->get('first_name')) == '' ) $this->error_msg[] = 'First name should not be blank';\n \n // last name should not be blank.\n if( trim($this->post_data->get('last_name')) == '' ) $this->error_msg[] = 'Last name should not be blank';\n \n // email should not be blank.\n if( trim($this->post_data->get('email')) == '' ) $this->error_msg[] = 'Email should not be blank';\n \n // email should be valid.\n if( ! preg_match('/^\\w+([\\.-]?\\w+)*@\\w+([\\.-]?\\w+)*(\\.\\w{2,3})+$/', $this->post_data->get('email')) ) $this->error_msg[] = 'Email should not be valid';\n \n // city should not be blank.\n if( trim($this->post_data->get('city')) == '' ) $this->error_msg[] = 'City should not be blank';\n \n // country should be somewhere from earth.\n $country = DB::table('Country')->where('code', '=', $this->post_data->get('country'))->get();\n if( empty( $country ) ) $this->error_msg[] = 'Invalid country';\n \n // permission shoulbe be 1 or 0.\n if( ! in_array($this->post_data->get('permission'), range(0, 1)) ) $this->error_msg[] = 'Invalid permission option';\n \n \n \n // validate hidden data.\n \n $company = new \\Company\\Repositories\\DBCompany;\n $company = $company->get_company_info( Config::get('application.subdomain') );\n \n // company id should be valid.\n if( $company->companyid != $this->post_data->get('company_id') ) $this->error_msg[] = 'Invalid company id';\n \n // site id should be valid.\n if( $company->siteid != $this->post_data->get('site_id') ) $this->error_msg[] = 'Invalid site id';\n \n \n \n // return true if thre's no error, false otherwise.\n return ( empty($this->error_msg) ? true : false );\n }", "public function validateData($data): void;", "protected function preValidate() {}", "function emptyInfo() {\n\n $this->setIdestudiantegeneral(\"\");\n $this->setIdtrato(\"\");\n $this->setIdestadocivil(\"\");\n $this->setTipodocumento(\"\");\n $this->setNumerodocumento(\"\");\n $this->setExpedidodocumento(\"\");\n $this->setNumerolibretamilitar(\"\");\n $this->setNumerodistritolibretamilitar(\"\");\n $this->setExpedidalibretamilitar(\"\");\n $this->setNombrecortoestudiantegeneral(\"\");\n $this->setNombresestudiantegeneral(\"\");\n $this->setApellidosestudiantegeneral(\"\");\n $this->setFechanacimientoestudiantegeneral(\"\");\n $this->setIdciudadnacimiento(\"\");\n $this->setCodigogenero(\"\");\n $this->setDireccionresidenciaestudiantegeneral(\"\");\n $this->setDireccioncortaresidenciaestudiantegeneral(\"\");\n $this->setCiudadresidenciaestudiantegeneral(\"\");\n $this->setTelefonoresidenciaestudiantegeneral(\"\");\n $this->setTelefono2estudiantegeneral(\"\");\n $this->setCelularestudiantegeneral(\"\");\n $this->setDireccioncorrespondenciaestudiantegeneral(\"\");\n $this->setDireccioncortacorrespondenciaestudiantegeneral(\"\");\n $this->setCiudadcorrespondenciaestudiantegeneral(\"\");\n $this->setTelefonocorrespondenciaestudiantegeneral(\"\");\n $this->setEmailestudiantegeneral(\"\");\n $this->setEmail2estudiantegeneral(\"\");\n $this->setFechacreacionestudiantegeneral(\"\");\n $this->setFechaactualizaciondatosestudiantegeneral(\"\");\n $this->setCodigotipocliente(\"\");\n $this->setCasoemergenciallamarestudiantegeneral(\"\");\n $this->setTelefono1casoemergenciallamarestudiantegeneral(\"\");\n $this->setTelefono2casoemergenciallamarestudiantegeneral(\"\");\n $this->setIdtipoestudiantefamilia(\"\");\n }", "function homeValidate() {\n\t\t$validate1 = array(\n\t\t\n\t\t/*'stock'=> array(\n\t\t\t\t\t'mustNotEmpty'=>array(\n\t\t\t\t\t\t'rule' => 'notEmpty',\n\t\t\t\t\t\t'message'=> 'Please enter Stock Number')\n\t\t\t\t\t),\n\t\t\t\t\n\t\t 'name'=> array(\n\t\t\t\t\t'mustNotEmpty'=>array(\n\t\t\t\t\t\t'rule' => 'notEmpty',\n\t\t\t\t\t\t'message'=> 'Please enter name')\n\t\t\t\t\t),*/\n\t\t 'email'=> array(\n\t\t\t\t\t'mustNotEmpty'=>array(\n\t\t\t\t\t\t'rule' => 'notEmpty',\n\t\t\t\t\t\t'message'=> 'Please enter Email')\n\t\t\t\t\t),\n\n\t\t 'contact'=> array(\n\t\t\t\t\t'mustNotEmpty'=>array(\n\t\t\t\t\t\t'rule' => 'notEmpty',\n\t\t\t\t\t\t'message'=> 'Please enter Contact Number')\n\t\t\t\t\t),\n\t\t/*'make'=> array(\n\t\t\t\t\t'mustNotEmpty'=>array(\n\t\t\t\t\t\t'rule' => 'notEmpty',\n\t\t\t\t\t\t'message'=> 'Please enter Make')\n\t\t\t\t\t),\n\t\t'model'=> array(\n\t\t\t\t\t'mustNotEmpty'=>array(\n\t\t\t\t\t\t'rule' => 'notEmpty',\n\t\t\t\t\t\t'message'=> 'Please enter Model')\n\t\t\t\t\t),\n\t\t'part'=> array(\n\t\t\t\t\t'mustNotEmpty'=>array(\n\t\t\t\t\t\t'rule' => 'notEmpty',\n\t\t\t\t\t\t'message'=> 'Please enter part')\n\t\t\t\t\t),\n\t\t'year'=> array(\n\t\t\t\t\t'mustNotEmpty'=>array(\n\t\t\t\t\t\t'rule' => 'notEmpty',\n\t\t\t\t\t\t'message'=> 'Please choose year')\n\t\t\t\t\t),\n\t\t'country' => array(\n\t\t\t\t\t'mustNotEmpty'=>array(\n\t\t\t\t\t\t'rule' => 'notEmpty',\n\t\t\t\t\t\t'message'=> 'Please choose country')\n\t\t\t\t\t),\n\t\t'comment' => array(\n\t\t\t\t\t'mustNotEmpty'=>array(\n\t\t\t\t\t\t'rule' => 'notEmpty',\n\t\t\t\t\t\t'message'=> 'Please enter comment')\n\t\t\t\t\t),*/\n\t\t\n\t\t\t);\n\t\t$this->validate=$validate1;\n\t\treturn $this->validates();\n\t}", "function cp_do_input_validation($_adata) {\n\t# Initialize array\n\t\t$err_entry = array(\"flag\" => 0);\n\n\t# Check modes and data as required\n\t\tIF ($_adata['op'] == 'edit' || $_adata['op'] == 'add') {\n\t\t# Check required fields (err / action generated later in cade as required)\n\t\t//\tIF (!$_adata['s_id'])\t\t{$err_entry['flag'] = 1; $err_entry['s_id'] = 1;}\n\t\t//\tIF (!$_adata['s_status'])\t{$err_entry['flag'] = 1; $err_entry['s_status'] = 1;}\n\t\t\tIF (!$_adata['s_company'])\t{$err_entry['flag'] = 1; $err_entry['s_company'] = 1;}\n\t\t//\tIF (!$_adata['s_name_first'])\t{$err_entry['flag'] = 1; $err_entry['s_name_first'] = 1;}\n\t\t//\tIF (!$_adata['s_name_last'])\t{$err_entry['flag'] = 1; $err_entry['s_name_last'] = 1;}\n\t\t\tIF (!$_adata['s_addr_01'])\t{$err_entry['flag'] = 1; $err_entry['s_addr_01'] = 1;}\n\t\t//\tIF (!$_adata['s_addr_02'])\t{$err_entry['flag'] = 1; $err_entry['s_addr_02'] = 1;}\n\t\t\tIF (!$_adata['s_city'])\t\t{$err_entry['flag'] = 1; $err_entry['s_city'] = 1;}\n\t\t\tIF (!$_adata['s_state_prov'])\t{$err_entry['flag'] = 1; $err_entry['s_state_prov'] = 1;}\n\t\t\tIF (!$_adata['s_country'])\t{$err_entry['flag'] = 1; $err_entry['s_country'] = 1;}\n\t\t\tIF (!$_adata['s_zip_code'])\t{$err_entry['flag'] = 1; $err_entry['s_zip_code'] = 1;}\n\t\t//\tIF (!$_adata['s_phone'])\t\t{$err_entry['flag'] = 1; $err_entry['s_phone'] = 1;}\n\t\t//\tIF (!$_adata['s_fax'])\t\t{$err_entry['flag'] = 1; $err_entry['s_fax'] = 1;}\n\t\t//\tIF (!$_adata['s_tollfree'])\t{$err_entry['flag'] = 1; $err_entry['s_tollfree'] = 1;}\n\t\t//\tIF (!$_adata['s_email'])\t\t{$err_entry['flag'] = 1; $err_entry['s_email'] = 1;}\n\t\t//\tIF (!$_adata['s_taxid'])\t\t{$err_entry['flag'] = 1; $err_entry['s_taxid'] = 1;}\n\t\t//\tIF (!$_adata['s_account'])\t{$err_entry['flag'] = 1; $err_entry['s_account'] = 1;}\n\t\t\tIF (!$_adata['s_terms'])\t\t{$err_entry['flag'] = 1; $err_entry['s_terms'] = 1;}\n\t\t//\tIF (!$_adata['s_notes'])\t\t{$err_entry['flag'] = 1; $err_entry['s_notes'] = 1;}\n\n\t\t}\n\n\t# Validate some data (submitting data entered)\n\t# Email\n\t\tIF ($_adata['s_email'] && do_validate_email($_adata['s_email'], 0)) {\n\t\t\t$err_entry['flag'] = 1; $err_entry['err_email_invalid'] = 1;\n\t\t}\n\n\t# Email does not match existing email\n\t\t$_ce = array(0,1,1,1,1);\t// Element 0 = Nothing, 1 = clients, 2 = suppliers, 3 = admins, 4 = site addressses\n\t\tIF ($_adata['s_email'] && do_email_exist_check($_adata['s_email'], $_adata['s_id'], $_ce)) {\n\t\t\t$err_entry['flag'] = 1; $err_entry['err_email_matches_another'] = 1;\n\t\t}\n\n\t\treturn $err_entry;\n\n\t}", "public function setDetails(){\n $this->user_id=$this->clearInputs($_POST['user_id']);\n $this->user_type=$this->clearInputs(substr($_POST['user_id'],0,3));\n $this->name=$this->clearInputs($_POST['name']);\n $this->office_id=$this->clearInputs($_POST['office_id']);\n $this->designation=$this->clearInputs($_POST['designation']);\n $this->nic=$this->clearInputs($_POST['nic']);\n $this->contact_no=$this->clearInputs($_POST['contact_no']);\n $this->email=$this->clearInputs($_POST['email']);\n $this->hashed_password=password_hash($this->generateRandomPassword(8),PASSWORD_DEFAULT);\n \n }", "private function dataCreateValidate()\n\t{\n\t\treturn array(\n\t\t\t'file_date' => form_error('file_date'),\n\t\t\t'type_file' => form_error('type_file')\n\t\t);\n\t}", "private function validate() {\n $this->valid = (1 === count($this->marriages));\n }", "function isPatientDataValid($fileNumber, $name, $phoneNo, $dateOfBirth)\n{\n $result = ['result' => false, 'message' => 'Unable to save patient !'];\n $isFileNumberValid = isFileNumberValid($fileNumber);\n if (!$isFileNumberValid) {\n $result['message'] = \"Please Enter a Valid File No\";\n return $result;\n }\n if (!$name) {\n $result['message'] = \"Please Enter Patient Name\";\n return $result;\n }\n $phoneNoIsValid = isPhoneNoValid($phoneNo);\n if (!$phoneNoIsValid) {\n $result['message'] = \"Please Enter Valid Phone No\";\n return $result;\n }\n $isDateOfBirthValid = isDateOfBirthValid($dateOfBirth);\n if (!$isDateOfBirthValid) {\n $result['message'] = \"Please Enter a Valid Date of Birth\";\n return $result;\n }\n $result['result'] = true;\n return $result;\n}", "function simplr_validate($data) {\r\n $errors = array();\r\n //validate the existance of first and last name, title and school\r\n if(!$data['first_name']){$errors[] = __('You must enter your first name.'); }\r\n if(!$data['last_name']){$errors[] = __('You must enter your last name.'); }\r\n if(!$data['title']){$errors[] = __('You must enter your title.'); }\r\n if(!$data['school']){$errors[] = __('You must enter the school/affiliation.'); }\r\n // Validate username\r\n if(!$data['user_login1']) { \r\n $errors[] = __('You must enter a username.'); \r\n } else {\r\n // check whether username is valid\r\n $user_test = validate_username( $data['user_login1'] );\r\n if($user_test != true) {\r\n $errors[] .= __('Invalid Username.');\r\n }\r\n // check whether username already exists\r\n $user_id = username_exists( $data['user_login1'] );\r\n if($user_id) {\r\n $errors[] .= __('This username already exists.');\r\n }\r\n } //end username validation\r\n if(!$data['user_pass1'] || !$data['user_pass_confirm']) {\r\n $errors[] = __('You must enter a password and password confirmation.');\r\n }\r\n // Make sure passwords match\r\n if($data['user_pass1'] != $data['user_pass_confirm']) {\r\n $errors[] = __('The passwords you entered do not match.');\r\n }\t\r\n // Validate email\r\n if(!$data['user_email']) { \r\n $errors[] = __('You must enter an email.'); \r\n } else {\r\n $email_test = email_exists($data['user_email']);\r\n if($email_test != false) {\r\n $errors[] .= __('An account with this email has already been registered.');\r\n }\r\n if( !is_email($data['user_email']) ) {\r\n $errors[] .= __('Please enter a valid email.');\r\n }\t\r\n } // end email validation\r\n return $errors;\r\n}", "public function validateSpeakerInfo()\n {\n $speakerInfo = filter_var(\n $this->_sanitized_data['speaker_info'],\n FILTER_SANITIZE_STRING\n );\n $validation_response = true;\n $speakerInfo = strip_tags($speakerInfo);\n $speakerInfo = $this->_purifier->purify($speakerInfo);\n\n if (empty($speakerInfo)) {\n $this->_addErrorMessage(\"You submitted speaker info but it was empty after sanitizing\");\n $validation_response = false;\n }\n\n return $validation_response;\n }", "public function ValidateUserInput()\n {\n $bIsValid = parent::ValidateUserInput();\n\n if ($bIsValid) {\n $oMsgManager = TCMSMessageManager::GetInstance();\n\n if (!array_key_exists('accountOwner', $this->aPaymentUserData) || empty($this->aPaymentUserData['accountOwner'])) {\n $oMsgManager->AddMessage(self::MSG_MANAGER_NAME.'-accountOwner', 'ERROR-USER-REQUIRED-FIELD-MISSING');\n $bIsValid = false;\n }\n\n if (!array_key_exists('accountNr', $this->aPaymentUserData) || empty($this->aPaymentUserData['accountNr'])) {\n $oMsgManager->AddMessage(self::MSG_MANAGER_NAME.'-accountNr', 'ERROR-USER-REQUIRED-FIELD-MISSING');\n $bIsValid = false;\n }\n\n if (!array_key_exists('bankNr', $this->aPaymentUserData) || empty($this->aPaymentUserData['bankNr'])) {\n $oMsgManager->AddMessage(self::MSG_MANAGER_NAME.'-bankNr', 'ERROR-USER-REQUIRED-FIELD-MISSING');\n $bIsValid = false;\n }\n }\n\n return $bIsValid;\n }", "public function _getValidationErrors()\n {\n $errs = parent::_getValidationErrors();\n $validationRules = $this->_getValidationRules();\n if ([] !== ($vs = $this->getCountry())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_COUNTRY, $i)] = $fieldErrs;\n }\n }\n }\n if (null !== ($v = $this->getDataExclusivityPeriod())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_DATA_EXCLUSIVITY_PERIOD] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getDateOfFirstAuthorization())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_DATE_OF_FIRST_AUTHORIZATION] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getHolder())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_HOLDER] = $fieldErrs;\n }\n }\n if ([] !== ($vs = $this->getIdentifier())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_IDENTIFIER, $i)] = $fieldErrs;\n }\n }\n }\n if (null !== ($v = $this->getInternationalBirthDate())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_INTERNATIONAL_BIRTH_DATE] = $fieldErrs;\n }\n }\n if ([] !== ($vs = $this->getJurisdiction())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_JURISDICTION, $i)] = $fieldErrs;\n }\n }\n }\n if ([] !== ($vs = $this->getJurisdictionalAuthorization())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_JURISDICTIONAL_AUTHORIZATION, $i)] = $fieldErrs;\n }\n }\n }\n if (null !== ($v = $this->getLegalBasis())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_LEGAL_BASIS] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getProcedure())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_PROCEDURE] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getRegulator())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_REGULATOR] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getRestoreDate())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_RESTORE_DATE] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getStatus())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_STATUS] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getStatusDate())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_STATUS_DATE] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getSubject())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_SUBJECT] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getValidityPeriod())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_VALIDITY_PERIOD] = $fieldErrs;\n }\n }\n if (isset($validationRules[self::FIELD_COUNTRY])) {\n $v = $this->getCountry();\n foreach($validationRules[self::FIELD_COUNTRY] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_COUNTRY, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_COUNTRY])) {\n $errs[self::FIELD_COUNTRY] = [];\n }\n $errs[self::FIELD_COUNTRY][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_DATA_EXCLUSIVITY_PERIOD])) {\n $v = $this->getDataExclusivityPeriod();\n foreach($validationRules[self::FIELD_DATA_EXCLUSIVITY_PERIOD] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_DATA_EXCLUSIVITY_PERIOD, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_DATA_EXCLUSIVITY_PERIOD])) {\n $errs[self::FIELD_DATA_EXCLUSIVITY_PERIOD] = [];\n }\n $errs[self::FIELD_DATA_EXCLUSIVITY_PERIOD][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_DATE_OF_FIRST_AUTHORIZATION])) {\n $v = $this->getDateOfFirstAuthorization();\n foreach($validationRules[self::FIELD_DATE_OF_FIRST_AUTHORIZATION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_DATE_OF_FIRST_AUTHORIZATION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_DATE_OF_FIRST_AUTHORIZATION])) {\n $errs[self::FIELD_DATE_OF_FIRST_AUTHORIZATION] = [];\n }\n $errs[self::FIELD_DATE_OF_FIRST_AUTHORIZATION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_HOLDER])) {\n $v = $this->getHolder();\n foreach($validationRules[self::FIELD_HOLDER] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_HOLDER, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_HOLDER])) {\n $errs[self::FIELD_HOLDER] = [];\n }\n $errs[self::FIELD_HOLDER][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_IDENTIFIER])) {\n $v = $this->getIdentifier();\n foreach($validationRules[self::FIELD_IDENTIFIER] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_IDENTIFIER, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_IDENTIFIER])) {\n $errs[self::FIELD_IDENTIFIER] = [];\n }\n $errs[self::FIELD_IDENTIFIER][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_INTERNATIONAL_BIRTH_DATE])) {\n $v = $this->getInternationalBirthDate();\n foreach($validationRules[self::FIELD_INTERNATIONAL_BIRTH_DATE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_INTERNATIONAL_BIRTH_DATE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_INTERNATIONAL_BIRTH_DATE])) {\n $errs[self::FIELD_INTERNATIONAL_BIRTH_DATE] = [];\n }\n $errs[self::FIELD_INTERNATIONAL_BIRTH_DATE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_JURISDICTION])) {\n $v = $this->getJurisdiction();\n foreach($validationRules[self::FIELD_JURISDICTION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_JURISDICTION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_JURISDICTION])) {\n $errs[self::FIELD_JURISDICTION] = [];\n }\n $errs[self::FIELD_JURISDICTION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_JURISDICTIONAL_AUTHORIZATION])) {\n $v = $this->getJurisdictionalAuthorization();\n foreach($validationRules[self::FIELD_JURISDICTIONAL_AUTHORIZATION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_JURISDICTIONAL_AUTHORIZATION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_JURISDICTIONAL_AUTHORIZATION])) {\n $errs[self::FIELD_JURISDICTIONAL_AUTHORIZATION] = [];\n }\n $errs[self::FIELD_JURISDICTIONAL_AUTHORIZATION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_LEGAL_BASIS])) {\n $v = $this->getLegalBasis();\n foreach($validationRules[self::FIELD_LEGAL_BASIS] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_LEGAL_BASIS, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_LEGAL_BASIS])) {\n $errs[self::FIELD_LEGAL_BASIS] = [];\n }\n $errs[self::FIELD_LEGAL_BASIS][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_PROCEDURE])) {\n $v = $this->getProcedure();\n foreach($validationRules[self::FIELD_PROCEDURE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_PROCEDURE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_PROCEDURE])) {\n $errs[self::FIELD_PROCEDURE] = [];\n }\n $errs[self::FIELD_PROCEDURE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_REGULATOR])) {\n $v = $this->getRegulator();\n foreach($validationRules[self::FIELD_REGULATOR] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_REGULATOR, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_REGULATOR])) {\n $errs[self::FIELD_REGULATOR] = [];\n }\n $errs[self::FIELD_REGULATOR][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_RESTORE_DATE])) {\n $v = $this->getRestoreDate();\n foreach($validationRules[self::FIELD_RESTORE_DATE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_RESTORE_DATE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_RESTORE_DATE])) {\n $errs[self::FIELD_RESTORE_DATE] = [];\n }\n $errs[self::FIELD_RESTORE_DATE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_STATUS])) {\n $v = $this->getStatus();\n foreach($validationRules[self::FIELD_STATUS] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_STATUS, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_STATUS])) {\n $errs[self::FIELD_STATUS] = [];\n }\n $errs[self::FIELD_STATUS][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_STATUS_DATE])) {\n $v = $this->getStatusDate();\n foreach($validationRules[self::FIELD_STATUS_DATE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_STATUS_DATE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_STATUS_DATE])) {\n $errs[self::FIELD_STATUS_DATE] = [];\n }\n $errs[self::FIELD_STATUS_DATE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_SUBJECT])) {\n $v = $this->getSubject();\n foreach($validationRules[self::FIELD_SUBJECT] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_SUBJECT, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_SUBJECT])) {\n $errs[self::FIELD_SUBJECT] = [];\n }\n $errs[self::FIELD_SUBJECT][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_VALIDITY_PERIOD])) {\n $v = $this->getValidityPeriod();\n foreach($validationRules[self::FIELD_VALIDITY_PERIOD] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_VALIDITY_PERIOD, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_VALIDITY_PERIOD])) {\n $errs[self::FIELD_VALIDITY_PERIOD] = [];\n }\n $errs[self::FIELD_VALIDITY_PERIOD][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_CONTAINED])) {\n $v = $this->getContained();\n foreach($validationRules[self::FIELD_CONTAINED] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE, self::FIELD_CONTAINED, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_CONTAINED])) {\n $errs[self::FIELD_CONTAINED] = [];\n }\n $errs[self::FIELD_CONTAINED][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_EXTENSION])) {\n $v = $this->getExtension();\n foreach($validationRules[self::FIELD_EXTENSION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE, self::FIELD_EXTENSION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_EXTENSION])) {\n $errs[self::FIELD_EXTENSION] = [];\n }\n $errs[self::FIELD_EXTENSION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_MODIFIER_EXTENSION])) {\n $v = $this->getModifierExtension();\n foreach($validationRules[self::FIELD_MODIFIER_EXTENSION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE, self::FIELD_MODIFIER_EXTENSION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_MODIFIER_EXTENSION])) {\n $errs[self::FIELD_MODIFIER_EXTENSION] = [];\n }\n $errs[self::FIELD_MODIFIER_EXTENSION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_TEXT])) {\n $v = $this->getText();\n foreach($validationRules[self::FIELD_TEXT] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE, self::FIELD_TEXT, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_TEXT])) {\n $errs[self::FIELD_TEXT] = [];\n }\n $errs[self::FIELD_TEXT][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_ID])) {\n $v = $this->getId();\n foreach($validationRules[self::FIELD_ID] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_RESOURCE, self::FIELD_ID, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_ID])) {\n $errs[self::FIELD_ID] = [];\n }\n $errs[self::FIELD_ID][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_IMPLICIT_RULES])) {\n $v = $this->getImplicitRules();\n foreach($validationRules[self::FIELD_IMPLICIT_RULES] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_RESOURCE, self::FIELD_IMPLICIT_RULES, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_IMPLICIT_RULES])) {\n $errs[self::FIELD_IMPLICIT_RULES] = [];\n }\n $errs[self::FIELD_IMPLICIT_RULES][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_LANGUAGE])) {\n $v = $this->getLanguage();\n foreach($validationRules[self::FIELD_LANGUAGE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_RESOURCE, self::FIELD_LANGUAGE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_LANGUAGE])) {\n $errs[self::FIELD_LANGUAGE] = [];\n }\n $errs[self::FIELD_LANGUAGE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_META])) {\n $v = $this->getMeta();\n foreach($validationRules[self::FIELD_META] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_RESOURCE, self::FIELD_META, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_META])) {\n $errs[self::FIELD_META] = [];\n }\n $errs[self::FIELD_META][$rule] = $err;\n }\n }\n }\n return $errs;\n }", "public function validate() {\n \n $errors = [];\n $names = explode(' ', $this->data->name, 2);\n\n if(count($names) < 2) {\n $errors['name'] = array('first and last names are required');\n }\n\n if(!filter_var($this->data->email, FILTER_VALIDATE_EMAIL)) {\n $errors['email'] = array($this->data->email.' is not a valid email address');\n }\n\n if(strlen($this->data->password) < 8) {\n $errors['password'] = array('password must be at least 8 characters');\n }\n\n return $errors;\n }", "abstract protected function validate($data);", "public function validation($data, $files) {\n\n global $CFG;\n $errors = parent::validation($data, $files);\n\n //get the form reference\n $mform =& $this->_form;\n\n $errors = array();\n $cm_idnumbers = $data['idnumber']['cm']; // array for course module id numbers\n if (!empty($cm_idnumbers)) {\n $tmp_array = array();\n $tmp_array = $cm_idnumbers;\n foreach ($cm_idnumbers as $key => $value) {\n if (empty($value)) {\n continue; // if idnumber is blank then no need to check\n }\n unset($tmp_array[$key]); // removing first occurence of the key\n while ($duplicate_value_key = array_search($value, $tmp_array)) {\n // searching existence of the current key\n\n $elname = \"idnumber[cm][$duplicate_value_key]\";\n\n // showing error on subsequent duplicate values.\n if ($mform->isElementFrozen($elname)) {\n // if the 2nd duplicate value found is frozen,\n // then show error on first occurrence\n $errors[\"idnumber[cm][$key]\"]= get_string('idnumbertaken',\n 'report_editidnumber');\n } else {\n // if duplicate is not frozen show error on it.\n $errors[$elname]= get_string('idnumbertaken', 'report_editidnumber');\n }\n unset($tmp_array[$duplicate_value_key]);\n }\n }\n }\n // array for grade items id numbers\n $gi_idnumbers = isset($data['idnumber']['gi']) ? $data['idnumber']['gi'] : \"\";\n\n if (!empty($gi_idnumbers)) {\n $tmp_array = array();\n $tmp_array = $gi_idnumbers;\n foreach ($gi_idnumbers as $key => $value) {\n if (empty($value)) {\n continue; // if idnumber is blank then no need to check\n }\n // if idnumber is already assigned to any course module\n if (array_search($value, $cm_idnumbers)) {\n $errors[\"idnumber[gi][$key]\"]= get_string('idnumbertaken',\n 'report_editidnumber');\n }\n unset ($tmp_array[$key]); // removing first occurence of the key\n // searching existence of the current key\n while ($duplicate_value_key = array_search($value, $tmp_array)) {\n $errors[\"idnumber[gi][$duplicate_value_key]\"]= get_string('idnumbertaken',\n 'report_editidnumber');\n unset($tmp_array[$duplicate_value_key]);\n }\n }\n }\n\n return $errors;\n }", "protected function validate()\n {\n if ($this->primary_first_name == '') {\n $this->errors[] = 'First name is required';\n }\n if ($this->primary_last_name == '') {\n $this->errors[] = 'Last Name is required';\n }\n\n if ($this->email == '') {\n $this->errors[] = 'Email is required';\n }\n\n if ($this->phone_number == '') {\n $this->errors[] = 'Phone Number is required';\n }\n\n if ($this->city == '') {\n $this->errors[] = 'City is required';\n }\n\n if ($this->state == '') {\n $this->errors[] = 'State is required';\n }\n\n if ($this->zip_code == '') {\n $this->errors[] = 'Zip Code is required';\n }\n\n if ($this->application_date == '') {\n $this->errors[] = 'Application Date is required';\n }\n\n return empty($this->errors);\n}", "public function generalValidation()\n {\n \t// Validamos que los dos campos esten llenos o estén vacios al mismo tiempo.\n \tif (is_null($this->error) ^ is_null($this->read_at)) {\n \t\treturn false;\n \t}\n\n \treturn true;\n }", "function readInputData() {\n\t\t$this->readUserVars(array(\n 'userId', \n 'typeId', \n 'applicationForm', \n 'survey', \n 'membership', \n 'domain', \n 'ipRange', \n 'notifyEmail', \n 'notifyPaymentEmail', \n 'specialRequests', \n 'datePaid', \n 'registrationOptionIds'));\n\n\t\t$this->_data['datePaid'] = Request::getUserVar('paid')?Request::getUserDateVar('datePaid'):null;\n\n\t\t// If registration type requires it, membership is provided\n\t\t$registrationTypeDao =& DAORegistry::getDAO('RegistrationTypeDAO');\n\t\t$registrationType =& $registrationTypeDao->getRegistrationType($this->getData('typeId'));\n\t\t$needMembership = $registrationType->getMembership();\n\n\t\tif ($needMembership) { \n\t\t\t$this->addCheck(new FormValidator($this, 'membership', 'required', 'manager.registration.form.membershipRequired'));\n\t\t}\n\n\t\t// If registration type requires it, domain and/or IP range is provided\n\t\t$isInstitutional = $registrationTypeDao->getRegistrationTypeInstitutional($this->getData('typeId'));\n\t\t$isOnline = $registrationType->getAccess() != REGISTRATION_TYPE_ACCESS_PHYSICAL ? true : false;\n\n\t\tif ($isInstitutional && $isOnline) { \n\t\t\t$this->addCheck(new FormValidatorCustom($this, 'domain', 'required', 'manager.registration.form.domainIPRangeRequired', create_function('$domain, $ipRange', 'return $domain != \\'\\' || $ipRange != \\'\\' ? true : false;'), array($this->getData('ipRange'))));\n\t\t}\n\n\t\t// If notify email is requested, ensure registration contact name and email exist.\n\t\tif ($this->_data['notifyEmail'] == 1) {\n\t\t\t$this->addCheck(new FormValidatorCustom($this, 'notifyEmail', 'required', 'manager.registration.form.registrationContactRequired', create_function('', '$schedConf =& Request::getSchedConf(); $schedConfSettingsDao =& DAORegistry::getDAO(\\'SchedConfSettingsDAO\\'); $registrationName = $schedConfSettingsDao->getSetting($schedConf->getId(), \\'registrationName\\'); $registrationEmail = $schedConfSettingsDao->getSetting($schedConf->getId(), \\'registrationEmail\\'); return $registrationName != \\'\\' && $registrationEmail != \\'\\' ? true : false;'), array()));\n\t\t}\n\t\tif ($this->_data['notifyPaymentEmail'] == 1) {\n\t\t\t$this->addCheck(new FormValidatorCustom($this, 'notifyPaymentEmail', 'required', 'manager.registration.form.registrationContactRequired', create_function('', '$schedConf =& Request::getSchedConf(); $schedConfSettingsDao =& DAORegistry::getDAO(\\'SchedConfSettingsDAO\\'); $registrationName = $schedConfSettingsDao->getSetting($schedConf->getId(), \\'registrationName\\'); $registrationEmail = $schedConfSettingsDao->getSetting($schedConf->getId(), \\'registrationEmail\\'); return $registrationName != \\'\\' && $registrationEmail != \\'\\' ? true : false;'), array()));\n\t\t}\n\t}", "protected function fieldData()\n {\n if ($this->field_data_fetched === false) {\n $this->field_data = array(\n 'label' => 'Your date of birth',\n 'description' => 'Please enter your date of birth',\n 'placeholder' => 'dd/mm/yyyy',\n 'size' => 50,\n 'maxlength' => 10\n );\n\n $this->field_data_fetched = true;\n }\n }", "public function _getValidationErrors()\n {\n $errs = parent::_getValidationErrors();\n $validationRules = $this->_getValidationRules();\n if (null !== ($v = $this->getCity())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_CITY] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getCountry())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_COUNTRY] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getDistrict())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_DISTRICT] = $fieldErrs;\n }\n }\n if ([] !== ($vs = $this->getLine())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_LINE, $i)] = $fieldErrs;\n }\n }\n }\n if (null !== ($v = $this->getPeriod())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_PERIOD] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getPostalCode())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_POSTAL_CODE] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getState())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_STATE] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getText())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_TEXT] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getType())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_TYPE] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getUse())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_USE] = $fieldErrs;\n }\n }\n if (isset($validationRules[self::FIELD_CITY])) {\n $v = $this->getCity();\n foreach($validationRules[self::FIELD_CITY] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_ADDRESS, self::FIELD_CITY, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_CITY])) {\n $errs[self::FIELD_CITY] = [];\n }\n $errs[self::FIELD_CITY][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_COUNTRY])) {\n $v = $this->getCountry();\n foreach($validationRules[self::FIELD_COUNTRY] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_ADDRESS, self::FIELD_COUNTRY, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_COUNTRY])) {\n $errs[self::FIELD_COUNTRY] = [];\n }\n $errs[self::FIELD_COUNTRY][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_DISTRICT])) {\n $v = $this->getDistrict();\n foreach($validationRules[self::FIELD_DISTRICT] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_ADDRESS, self::FIELD_DISTRICT, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_DISTRICT])) {\n $errs[self::FIELD_DISTRICT] = [];\n }\n $errs[self::FIELD_DISTRICT][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_LINE])) {\n $v = $this->getLine();\n foreach($validationRules[self::FIELD_LINE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_ADDRESS, self::FIELD_LINE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_LINE])) {\n $errs[self::FIELD_LINE] = [];\n }\n $errs[self::FIELD_LINE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_PERIOD])) {\n $v = $this->getPeriod();\n foreach($validationRules[self::FIELD_PERIOD] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_ADDRESS, self::FIELD_PERIOD, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_PERIOD])) {\n $errs[self::FIELD_PERIOD] = [];\n }\n $errs[self::FIELD_PERIOD][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_POSTAL_CODE])) {\n $v = $this->getPostalCode();\n foreach($validationRules[self::FIELD_POSTAL_CODE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_ADDRESS, self::FIELD_POSTAL_CODE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_POSTAL_CODE])) {\n $errs[self::FIELD_POSTAL_CODE] = [];\n }\n $errs[self::FIELD_POSTAL_CODE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_STATE])) {\n $v = $this->getState();\n foreach($validationRules[self::FIELD_STATE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_ADDRESS, self::FIELD_STATE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_STATE])) {\n $errs[self::FIELD_STATE] = [];\n }\n $errs[self::FIELD_STATE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_TEXT])) {\n $v = $this->getText();\n foreach($validationRules[self::FIELD_TEXT] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_ADDRESS, self::FIELD_TEXT, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_TEXT])) {\n $errs[self::FIELD_TEXT] = [];\n }\n $errs[self::FIELD_TEXT][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_TYPE])) {\n $v = $this->getType();\n foreach($validationRules[self::FIELD_TYPE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_ADDRESS, self::FIELD_TYPE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_TYPE])) {\n $errs[self::FIELD_TYPE] = [];\n }\n $errs[self::FIELD_TYPE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_USE])) {\n $v = $this->getUse();\n foreach($validationRules[self::FIELD_USE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_ADDRESS, self::FIELD_USE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_USE])) {\n $errs[self::FIELD_USE] = [];\n }\n $errs[self::FIELD_USE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_EXTENSION])) {\n $v = $this->getExtension();\n foreach($validationRules[self::FIELD_EXTENSION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_ELEMENT, self::FIELD_EXTENSION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_EXTENSION])) {\n $errs[self::FIELD_EXTENSION] = [];\n }\n $errs[self::FIELD_EXTENSION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_ID])) {\n $v = $this->getId();\n foreach($validationRules[self::FIELD_ID] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_ELEMENT, self::FIELD_ID, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_ID])) {\n $errs[self::FIELD_ID] = [];\n }\n $errs[self::FIELD_ID][$rule] = $err;\n }\n }\n }\n return $errs;\n }", "public function validations() {\n $this->form_validation->set_rules('name', 'Name', 'trim|required|alpha');\n $this->form_validation->set_rules('age', 'Age', 'trim|required|is_natural_no_zero|max_length[2]');\n $this->form_validation->set_rules('dob', 'Date Of Birth', 'trim|required');\n $this->form_validation->set_rules('profession', 'Select Profession', 'trim|required');\n $this->form_validation->set_rules('locality', 'Locality', 'trim|required|alpha');\n $this->form_validation->set_rules('guests', 'No. of Guests', 'trim|required');\n $this->form_validation->set_rules('address', 'Address', 'trim|required');\n }", "public function validated();", "function commonValidation($data) {\n unset($this->validate['title']);\n unset($this->validate['category_id']);\n unset($this->validate['short_description']);\n\n if ($data['Offer']['basename'] != '') {\n unset($this->validate['file']['valid_upload']);\n }\n }", "function _prepare_validation()\n\t{\n\t\t$this->load->library('form_validation');\t\n\t\t$this->form_validation->set_error_delimiters('<div class=\"error\">', '</div>');\n\t\t//Setting Validation Rule\t\n\t\t$this->form_validation->set_rules('samity_id','Code','trim|required|xss_clean|max_length[100]');\n\t\t$this->form_validation->set_rules('cbo_samity_day','Samity Day','trim|required|xss_clean');\n\t\t$this->form_validation->set_rules('txt_effective_date','Effective Date','trim|required|max_length[10]|is_date|xss_clean|callback_check_samity_effective_date');\t\n\t}", "public function valid()\n {\n\n if (strlen($this->container['company_name']) > 254) {\n return false;\n }\n if (strlen($this->container['company_name']) < 0) {\n return false;\n }\n if ($this->container['firstname'] === null) {\n return false;\n }\n if (strlen($this->container['firstname']) > 255) {\n return false;\n }\n if (strlen($this->container['firstname']) < 0) {\n return false;\n }\n if ($this->container['lastname'] === null) {\n return false;\n }\n if (strlen($this->container['lastname']) > 255) {\n return false;\n }\n if (strlen($this->container['lastname']) < 0) {\n return false;\n }\n if ($this->container['street'] === null) {\n return false;\n }\n if (strlen($this->container['street']) > 254) {\n return false;\n }\n if (strlen($this->container['street']) < 3) {\n return false;\n }\n if ($this->container['post_code'] === null) {\n return false;\n }\n if (strlen($this->container['post_code']) > 40) {\n return false;\n }\n if (strlen($this->container['post_code']) < 2) {\n return false;\n }\n if ($this->container['city'] === null) {\n return false;\n }\n if (strlen($this->container['city']) > 99) {\n return false;\n }\n if (strlen($this->container['city']) < 2) {\n return false;\n }\n if ($this->container['country_code'] === null) {\n return false;\n }\n if (strlen($this->container['country_code']) > 2) {\n return false;\n }\n if (strlen($this->container['country_code']) < 0) {\n return false;\n }\n if (strlen($this->container['telephone']) > 99) {\n return false;\n }\n if (strlen($this->container['telephone']) < 0) {\n return false;\n }\n return true;\n }", "function isDataValid() \r\n { \r\n $isValid = parent::isDataValid();\r\n \r\n// $isValid = $this->active_subPage->isDataValid(); \r\n \r\n // now return result\r\n return $isValid; \r\n }" ]
[ "0.6391842", "0.63317466", "0.62318915", "0.6230617", "0.62305", "0.6225306", "0.62060606", "0.61750716", "0.61457795", "0.6134435", "0.61237514", "0.60112745", "0.6010478", "0.5972876", "0.5967445", "0.59263355", "0.59263355", "0.59182805", "0.59120226", "0.5875252", "0.58736956", "0.58556294", "0.58468986", "0.5845659", "0.58207", "0.5815567", "0.58119893", "0.57975364", "0.5785386", "0.5767427", "0.57629365", "0.57590777", "0.5756949", "0.57543486", "0.5748021", "0.5745053", "0.57441235", "0.5741268", "0.57346326", "0.5725878", "0.57252395", "0.5724971", "0.57041025", "0.5701431", "0.56778646", "0.5676624", "0.56761104", "0.5662913", "0.5661508", "0.56533295", "0.5647593", "0.56241727", "0.5623549", "0.56206256", "0.5605542", "0.56015587", "0.56012094", "0.55965126", "0.55953294", "0.55777836", "0.5577707", "0.557536", "0.5568345", "0.5563527", "0.55603415", "0.5551118", "0.5544515", "0.55402446", "0.553956", "0.5539102", "0.55382603", "0.55327934", "0.5530988", "0.55262995", "0.55250275", "0.55191517", "0.55024654", "0.5497937", "0.5495159", "0.54877007", "0.54876864", "0.5472914", "0.5471911", "0.5464538", "0.5463225", "0.54504466", "0.5446693", "0.54394215", "0.5429542", "0.5425873", "0.5420756", "0.5420582", "0.5417762", "0.54138476", "0.5407499", "0.5406478", "0.54035324", "0.53971165", "0.5394378", "0.5394272" ]
0.6616691
0
Add item to Personal_Info_Data value
public function addToPersonal_Info_Data(\WorkdayWsdl\\StructType\Personal_Info_DataType $item) { // validation for constraint: itemType if (!$item instanceof \WorkdayWsdl\\StructType\Personal_Info_DataType) { throw new \InvalidArgumentException(sprintf('The Personal_Info_Data property can only contain items of type \WorkdayWsdl\\StructType\Personal_Info_DataType, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__); } $this->Personal_Info_Data[] = $item; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function addItemDetails(&$item) \r\n\t{\r\n\t\t//$item->totals = KTBTrackerHelper::getUserTotals($item);\r\n\t\t$this->getUserInfo($item);\r\n\t}", "public function add_info($info)\r\n { \r\n }", "public function addToPerson_Identification_Data(\\WorkdayWsdl\\\\StructType\\Person_Identification_DataType $item)\n {\n // validation for constraint: itemType\n if (!$item instanceof \\WorkdayWsdl\\\\StructType\\Person_Identification_DataType) {\n throw new \\InvalidArgumentException(sprintf('The Person_Identification_Data property can only contain items of type \\WorkdayWsdl\\\\StructType\\Person_Identification_DataType, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__);\n }\n $this->Person_Identification_Data[] = $item;\n return $this;\n }", "function addItem2DB($data = null)\n {\n if ($this->isAdmin() == TRUE) {\n $this->loadThis();\n } else {\n $result = $_POST['itemInfo'];\n echo $this->user_model->add($result);\n }\n }", "public function addToPetInfoPref($item)\n {\n // validation for constraint: itemType\n if (!false) {\n throw new \\InvalidArgumentException(sprintf('The PetInfoPref property can only contain items of anyType, \"%s\" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__);\n }\n $this->PetInfoPref[] = $item;\n return $this;\n }", "public function add_information() \r\n {}", "public function add_information() \r\n {}", "function setItemSystemFields($data, $item){\n if ($this->debug_mode)\n echo $this->ClassName . \"setItemSystemFields();\" . \"<HR>\";\n foreach ($item as $key => $value) {\n \tif($key == '_lastmodified'){\n \t\tcontinue;\n \t}\n if ((substr($key, 0, 1) == \"_\") && (! isset($data[$key]))) {\n $data[$key] = $value;\n }\n }\n if (isset($data['_lastmodified'])) {\n \tunset ($data['_lastmodified']);\n }\n }", "function addMetadataValueToItem(&$item, $md) {\n $value = $this->getMetadataValue($item, $md);\n $md->setValue($value);\n $item->addMetadata($md);\n }", "public function add($item)\n {\n $this->manuallyAddedData[] = $item;\n }", "function PreProcessItemData()\n {\n $this->Sql_Table_Column_Rename(\"Candidate\",\"Friend\");\n\n \n array_unshift($this->ItemDataPaths,\"../EventApp/System/Inscriptions\");\n\n $unitid=$this->ApplicationObj->Unit(\"ID\");\n $eventid=$this->ApplicationObj->Event(\"ID\");\n\n $this->AddDefaults[ \"Unit\" ]=$unitid;\n $this->AddFixedValues[ \"Unit\" ]=$unitid;\n $this->ItemData[ \"Unit\" ][ \"Default\" ]=$unitid;\n\n $this->AddDefaults[ \"Event\" ]=$eventid;\n $this->AddFixedValues[ \"Event\" ]=$eventid;\n $this->ItemData[ \"Event\" ][ \"Default\" ]=$eventid;\n }", "abstract public function add_item();", "function OnAfterAdd(){\n //get keyfield value\n if (intval($this->item_id) == 0)\n $data = $this->Storage->GetRecord(null, array(\n $this->key_field => \"\"));\n $this->item_id = $data[$this->key_field];\n }", "function add($itemInfo)\n {\n// if (isset($itemInfo['userid'])) {\n// $item = $this->getItemById($itemInfo['userid']);\n// } else {\n// $item = $this->getItemByNumber($itemInfo['email']);\n// }\n// if (count($item) > 0) {\n// $itemInfo['update_time'] = date(\"Y-m-d\");\n// $insert_id = $this->update($itemInfo, $item->userid);\n// } else {\n// $itemInfo['created_time'] = date(\"Y-m-d\");\n// $this->db->trans_start();\n// $this->db->insert('tbl_userinfo', $itemInfo);\n// $insert_id = $this->db->insert_id();\n// $this->db->trans_complete();\n// }\n\n $this->db->where('id', $itemInfo['id']);\n $insert_id = $this->db->update('tbl_userinfo', $itemInfo);\n\n return $insert_id;\n }", "protected function saveInfoValues() {\r\n\t\tif(is_a($this->infoValueCollection, 'tx_ptgsaconfmgm_infoValueCollection')) {\r\n\t\t\t\r\n\t\t\tif($this->tableName=='tx_ptconference_domain_model_persdata') {\r\n\t\t\t\t$persArticleUid = $this->rowUid;\r\n\t\t\t\t$relArticleUid = 0;\r\n\t\t\t} else {\r\n\t\t\t\t$persArticleUid = $this->get_persdata();\r\n\t\t\t\t$relArticleUid = $this->rowUid;\r\n\t\t\t}\t\t\t\r\n\t\t\t\r\n\t\t\tforeach($this->infoValueCollection as $infoValue) {\r\n\t\t\t\t$infoValue->set_persdata($persArticleUid);\r\n\t\t\t\t$infoValue->set_relarticle($relArticleUid);\r\n\t\t\t\t$infoValue->save();\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public function writeItem($item)\n {\n $this->data[] = $item;\n }", "function addItem2DB()\n {\n if ($this->isAdmin() == TRUE) {\n $this->loadThis();\n } else {\n $result = $_POST['itemInfo'];\n echo $this->carousel_model->add($result);\n }\n }", "public function getPersonalInfo(){\r\n\t $this->_personalInfo;\r\n\t}", "public function add($info, $meta)\r\n {\r\n\r\n }", "public function addItem($key, $value);", "function add_info($page, $add) {\r\n \r\n $this->db->insert($page, $add);\r\n }", "public function addDatas(\\RO\\Cmd\\ItemData $value){\n return $this->_add(5, $value);\n }", "public function saveAddedFieldData($inputData) {\n\n\t\t\t$group_id = $inputData['group-id'];\n\t\t\t$type_id = $inputData['type-id'];\n\n\t\t\t$info = getRequest('data');\n\n\t\t\t$title = getArrayKey($info, 'title');\n\t\t\t$name = getArrayKey($info, 'name');\n\t\t\t$is_visible = getArrayKey($info, 'is_visible');\n\t\t\t$field_type_id = getArrayKey($info, 'field_type_id');\n\t\t\t$guide_id = getArrayKey($info, 'guide_id');\n\t\t\t$in_search = getArrayKey($info, 'in_search');\n\t\t\t$in_filter = getArrayKey($info, 'in_filter');\n\t\t\t$tip = getArrayKey($info, 'tip');\n\t\t\t$isRequired = getArrayKey($info, 'is_required');\n\t\t\t$restrictionId = getArrayKey($info, 'restriction_id');\n\t\t\t$isImportant = getArrayKey($info, 'is_important');\n\n\t\t\t$objectTypes = umiObjectTypesCollection::getInstance();\n\t\t\t$fields = umiFieldsCollection::getInstance();\n\t\t\t$fieldTypes = umiFieldTypesCollection::getInstance();\n\n\t\t\t//Check for non-unique field name\n\t\t\t$type = $objectTypes->getType($type_id);\n\t\t\tif($type instanceof umiObjectType) {\n\t\t\t\tif($type->getFieldId($name)) {\n\t\t\t\t\tthrow new publicAdminException(getLabel('error-non-unique-field-name'));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$field_type_obj = $fieldTypes->getFieldType($field_type_id);\n\t\t\t$field_data_type = $field_type_obj->getDataType();\n\n\t\t\tif($field_data_type == \"relation\" && $guide_id == 0) {\n\t\t\t\t$guide_id = self::getAutoGuideId($title);\n\t\t\t}\n\n\t\t\tif($field_data_type == \"optioned\" && $guide_id == 0) {\n\t\t\t\t$parent_guide_id = $objectTypes->getTypeIdByGUID('emarket-itemoption');\n\t\t\t\t$guide_id = self::getAutoGuideId($title, $parent_guide_id);\n\t\t\t}\n\n\t\t\t$field_id = $fields->addField($name, $title, $field_type_id, $is_visible, false, false);\n\n\t\t\t$field = $fields->getField($field_id);\n\t\t\t$field->setGuideId($guide_id);\n\t\t\t$field->setIsInSearch($in_search);\n\t\t\t$field->setIsInFilter($in_filter);\n\t\t\t$field->setTip($tip);\n\t\t\t$field->setIsRequired($isRequired);\n\t\t\t$field->setRestrictionId($restrictionId);\n\t\t\t$field->setImportanceStatus($isImportant);\n\t\t\t$field->commit();\n\n\t\t\tif($type instanceof umiObjectType) {\n\t\t\t\t$group = $type->getFieldsGroup($group_id);\n\t\t\t\tif($group instanceof umiFieldsGroup) {\n\t\t\t\t\t$group->attachField($field_id);\n\t\t\t\t\t$group_name = $group->getName();\n\n\t\t\t\t\t$childs = $objectTypes->getChildTypeIds($type_id);\n\t\t\t\t\t$sz = count($childs);\n\n\t\t\t\t\tfor($i = 0; $i < $sz; $i++) {\n\t\t\t\t\t\t$child_type_id = $childs[$i];\n\t\t\t\t\t\t$child_type = $objectTypes->getType($child_type_id);\n\n\t\t\t\t\t\tif($child_type instanceof umiObjectType) {\n\n\t\t\t\t\t\t\tif($child_type->getFieldId($name) == $field_id) continue;\n\n\t\t\t\t\t\t\t$child_group = $child_type->getFieldsGroupByName($group_name);\n\t\t\t\t\t\t\tif($child_group instanceof umiFieldsGroup) {\n\t\t\t\t\t\t\t\t$child_group->attachField($field_id, true);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t$ignoreChildGroup = getRequest('ignoreChildGroup');\n\t\t\t\t\t\t\t\tif ($ignoreChildGroup) {\n\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tthrow new publicAdminException(getLabel(\"error-no-child-group\", false, $group_name, $child_type->getName()));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tthrow new publicAdminException(getLabel(\"error-no-object-type\", false, $child_type_id));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\treturn $field_id;\n\t\t\t\t} else {\n\t\t\t\t\tthrow new coreException(getLabel(\"error-no-fieldgroup\", false, $group_id));\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tthrow new coreException(getLabel(\"error-no-object-type\", false, $type_id));\n\t\t\t}\n\t\t}", "function addItem2DB($data = null)\n {\n if ($this->isAdmin() == TRUE) {\n $this->loadThis();\n } else {\n $result = $_POST['itemInfo'];\n echo $this->coupon_model->add($result);\n }\n }", "function addItem2DB($data = null)\n {\n if ($this->isAdmin() == TRUE) {\n $this->loadThis();\n } else {\n $result = $_POST['itemInfo'];\n echo $this->order_model->add($result);\n }\n }", "public function addItem(Array $item)\n {\n $this->item[] = $item;\n }", "public function addItem($item){\n $this->items[] = $item;\n }", "public function add($item);", "public function add($item);", "private function add_info(\\StdClass $parsed, $proj) {\n $key = $this->_basic($parsed);\n $this->_basic_item($parsed, $proj, $key);\n }", "function insertPersonalInfo($user_id,$userData)\n\t\t{\n\t\t\t//setting user full name\n\t\t\t$name = $userData['f_name'].\" \".$userData['l_name'];\n\t\t\t//profile creation date\n\t\t\t$profile_creation_date = $this->getCurrentDate();\n\t\t\t//last updation date\n\t\t\t$last_updation_date = $this->getCurrentDate();\n\t\t\t//column name for insertion\n\t\t\t$column_name = array(\"user_id\",\"name\",\"gender\",\"dob\",\"contact_no\",\"addr_line1\",\"addr_line2\",\"pincode\",\"city\",\"state\",\"country\",\"profile_creation_date\",\"last_upgradation_date\");\n\t\t\t//column value for insertion\n\t\t\t$column_value = array($user_id,$name,$userData['gender'],$userData['dob'],$userData['contact'],$userData['add1'],$userData['add2'],$userData['pin'],$userData['city'],$userData['state'],$userData['country'],$profile_creation_date,$last_updation_date);\n\t\t\t//insert the values to user info table\n\t\t\t$insert = $this->manageContent->insertValue(\"user_info\",$column_name,$column_value);\n\t\t\treturn $insert;\n\t\t}", "function addFactoryInfo($companyInfo, $factoruInfo)\n {\n $keys = array_keys($factoruInfo);\n $i = 0;\n foreach($factoruInfo as $info) {\n $companyInfo[$keys[$i]] = $info;\n $i++;\n }\n return $companyInfo;\n }", "function addItemForUpdate($item) {\n $this->_update[$item->getId()] = $item;\n }", "public function add_data($data)\n {\n }", "function add($item);", "private function _addToFilteredItem( $addon, array $subData, &$filteredItem ){\n foreach ($subData as $key => $value) {\n if( is_array($value) ){\n $fieldPrefix = ($this->_iniData[$key]['db_table_prefix']) ? $this->_iniData[$key]['db_table_prefix'] : \"\";\n $this->_addToFilteredItem( $fieldPrefix, $value, $filteredItem );\n }\n if ( !is_numeric($key) && in_array($key,$this->_fieldsToUse,true)) {\n $filteredItem[$addon . $key] = $value;\n }\n }\n }", "function addItem(SitemapItem $item){\r\n $this->items[] = $item;\r\n }", "public function createItem($data);", "function addByName(){\n //turn user profile into assoc array\n $medsJSON = file_get_contents(\"userData.json\");\n \n $medsPHP = json_decode($medsJSON);\n $medComp = $_POST['medComp'];\n $medComp = $medComp ?:'Not entered';\n $medName = $_POST['medName'];\n $medStrength = $_POST['strength']; \n $medTabs = $_POST['medTabs']; \n $medPack = $_POST['medPack']; \n \n \n \n \n $tempArray = array(\n \"company\" => $medComp,\n \"medication\" => $medName,\n \"strength\" => $medStrength,\n \"barcode\" => \"Not entered\",\n \"notabs\" => $medPack,\n \"tabsperday\" => $medTabs,\n );\n\n \n $newObject = (object) $tempArray;\n \n array_push($medsPHP->meds, $newObject);\n \n \n \n \n //recode to json\n $newMedsJSON = json_encode($medsPHP);\n \n \n //rewrite file\n file_put_contents(\"userData.json\", $newMedsJSON);\n header(\"Location: medication.html\");\n die();\n}", "public function append($item)\n {\n array_push($this->activeValue, $item);\n }", "function appendInfo($info) {\n\t\t\t$this->responseVar['info'] .= $info.\"\\n<br>\\n\";\n\t\t}", "function updateMiiInfo($newInfo,$user,$action){\n if($action == \"add\"){\n array_push($this->miiInfo,$newInfo);\n }\n elseif($action == \"remove\"){\n $index = array_search($user,$this->names);\n array_splice($this->miiInfo,$index,1);\n }\n \n }", "public function addToDisability_Data(\\WorkdayWsdl\\\\StructType\\Disability_Information_Data_for_Related_PersonType $item)\n {\n // validation for constraint: itemType\n if (!$item instanceof \\WorkdayWsdl\\\\StructType\\Disability_Information_Data_for_Related_PersonType) {\n throw new \\InvalidArgumentException(sprintf('The Disability_Data property can only contain items of type \\WorkdayWsdl\\\\StructType\\Disability_Information_Data_for_Related_PersonType, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__);\n }\n $this->Disability_Data[] = $item;\n return $this;\n }", "function add($data){\n if(array_key_exists($data['id'], $this->fields)){\n exit(\"Field with ID: '\".$data['id'].\"' already exists.\");\n }\n if(!isset($data['validate'])){\n $data['validate'] = false;\n }\n if(!isset($data['inline'])){\n $data['inline'] = null;\n }\n if(!isset($data['value'])){\n $data['value'] = null;\n }\n if(!isset($data['readonly'])){\n $data['readonly'] = false;\n }\n\n $this->fields[$data['id']] = $data;\n }", "public function add_to_foot($data)\n\t{\n\t\t$this->footer_item[] = $data;\n\t}", "function appendItemMetadataList(&$item) {\n $mda = array();\n\n // Static metadata\n $mda = $this->getHardCodedMetadataList(true);\n foreach($mda as $md) {\n $md->setValue($item->getHardCodedMetadataValue($md->getLabel()));\n $item->addMetadata($md);\n unset($md);\n }\n \n // Dynamic metadata\n $mdIter = $this->getRealMetadataIterator(true);\n $mdIter->rewind();\n while($mdIter->valid()) {\n $md = $mdIter->current();\n $this->addMetadataValueToItem($item, $md);\n $mdIter->next();\n }\n }", "public function AddData($model, $other_info, $staff_edu, $staff_interview_first, $staff_interview_second, $staff_interview_third, $staff_salary) {\n\n $other_info->staff_id = $model->id;\n $staff_edu->staff_id = $model->id;\n $staff_interview_first->staff_id = $model->id;\n $staff_salary->staff_id = $model->id;\n $staff_interview_second->staff_id = $model->id;\n $staff_interview_third->staff_id = $model->id;\n $staff_edu->save(false);\n $other_info->update();\n $staff_interview_first->update();\n $staff_interview_second->update();\n $staff_interview_third->update();\n $staff_salary->update();\n }", "function AfterAdd(&$values,&$keys,$inline,&$pageObject)\n{\n\n\t\tglobal $conn;\n$proid= $keys['proid'];\n$bill_date=$values['bill_date'];\n$amount_bill=$values['amount'];\n$bill_no=$values['bill_no'];\n$item=$values['item'];\n$ProgramID = $values['ProgramID'];\n$BatchID = $values['BatchID'];\n\n//get related student according to intake , branch, and program\n$sql_student = \"select StudentID from student_info where DipID='$ProgramID' AND BatchID='$BatchID' AND Status='Active'\";\n$q_student = db_query($sql_student,$conn);\n\n//insert all program billing item to related student program bill\nwhile($row_student=db_fetch_array($q_student))\n{ \n$studentID=$row_student['StudentID'];\n$sql_insert=\"INSERT INTO student_billing (proid,date,amount,amount_balance,bill_no,item,studentID,status)\nVALUES ('$proid','$bill_date','$amount_bill','$amount_bill','$bill_no','$item','$studentID','Pending')\";\ndb_exec($sql_insert,$conn);\t\n}\n\n\n;\t\t\n}", "protected function storeExtraInfo()\n\t{\n\t\t$input = $this->connection->getExtraInfo();\n\t\t\n\t\tif (!isset($input)) {\n\t\t\t$this->extrainfo[] = null;\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tif (!is_string($input)) {\n\t\t\ttrigger_error(\"Metadata in other forms that a string is not yet supported\", E_USER_NOTICE);\n\t\t\treturn;\t\t\t\n\t\t}\n\t\t\n\t\t$info[] = (object)array('type'=>'_raw_', 'value'=>$input);\n\t\t\n\t\t$matches = null;\n\t\tif (preg_match_all('%<extraInfo>.*?</extraInfo>%is', $input, $matches, PREG_SET_ORDER)) {\n\t\t\tforeach ($matches[0] as $xml) {\n\t\t\t\t$sxml = new SimpleXMLElement($xml);\n\t\t\t\t$info[] = (object)array('type'=>(string)$sxml->type, 'value'=>(string)$sxml->value->string);\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $this->extrainfo[] = $info;\n\t}", "public function insertItem($item){\n\t\t$hour = date ( 'H', strtotime ( $item->list_time ) );\n\t\t$this->hours[$hour][DayShelfStrategy::HOUR_FIELD_ITEMLIST][] = $item;\n\t}", "public function add()\n {\n $item = new stdClass();\n $item->item_id = null;\n $item->barcode = null;\n $item->price = null;\n $item->stock = null;\n $item->name = null;\n $item->category_id = null;\n $query_category = $this->categorys_m->get();\n $query_unit = $this->units_m->get();\n $unit[null] = '-Pilih-';\n foreach ($query_unit->result() as $u) {\n\n $unit[$u->unit_id] = $u->name;\n };\n $data = [\n 'page' => 'add',\n 'row' => $item,\n 'category' => $query_category,\n 'unit' => $unit,\n 'selectedunit' => null\n ];\n $this->template->load('template', 'product/item/item_add', $data);\n }", "public function addPaymentInfo(SEPAPaymentInfo $paymentInfo)\n {\n $this->paymentInfos[] = $paymentInfo;\n }", "function ooffice_write_item( $item ) {\r\n global $odt;\r\n if ($item){\r\n $code = $item->code_item;\r\n $description_item = $item->description_item;\r\n $ref_referentiel = $item->ref_referentiel;\r\n $ref_competence = $item->ref_competence;\r\n\t\t\t$type_item = $item->type_item;\r\n\t\t\t$poids_item = $item->poids_item;\r\n\t\t\t$empreinte_item = $item->empreinte_item;\r\n\t\t\t$num_item = $item->num_item;\r\n $odt->SetFont('Arial','B',9); \r\n \t $odt->Write(0, recode_utf8_vers_latin1(trim(stripslashes($code))));\r\n \t \t$odt->Ln(1);\r\n \t \t$odt->SetFont('Arial','I',9);\r\n \t $odt->Write(0, recode_utf8_vers_latin1(trim(stripslashes($description_item))));\r\n \t $odt->Ln(1);\r\n \t $odt->SetFont('Arial','',9);\r\n $odt->Write(0, recode_utf8_vers_latin1(trim(get_string('t_item','referentiel').\" : \".$type_item.\", \".get_string('p_item','referentiel').\" : \".$poids_item.\", \".get_string('e_item','referentiel').\" : \".$empreinte_item)));\r\n $odt->Ln(1);\r\n } \r\n }", "public function addPersonalInfo($userId, $gender, $bloodGroup, $fatherName, $motherName, $dob){\n $res = array();\n // 1. Add a new PersonalInformation\n $query = \"INSERT INTO vol_personal_info(usr_id, gender, blood_group, father_name, mother_name) VALUES(?,?,?,?,?)\";\n $stmt = $this->conn->prepare($query);\n $stmt->bind_param('dssss', $userId, $gender, $bloodGroup, $fatherName, $motherName);\n $insert_contact_result = $stmt->execute();\n if($insert_contact_result == false) return self::setPIError('INSERT_PERSONAL_INFO_ERROR');\n $res['error'] = '0';\n $res['errorCode'] = '';\n $res['errorMessage'] = '';\n $res['personalInfo'] = self::setPersonalInfo($userId, $gender, $bloodGroup, $fatherName, $motherName, $dob);\n return $res;\n }", "function addItem($data)\n\t{\n\t\t$title_url = $data['uri'] ? url_title($data['uri'], 'dash', TRUE) : url_title($data['name'], 'dash', TRUE);\n\t\t$published = $data['published'] == \"yes\" ? true : false;\n\t\t\n\t\t$qStr = \"INSERT INTO portfolio (name, description, marked_up_description, short_description, uri, live_url, image, image_small, time, published)\n\t\t\t\tVALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)\";\n\t\t$q = $this->db->query($qStr, array($data['name'], $data['description'], $data['marked_up_description'], $data['short_description'], \n\t\t\t\t\t\t\t\t\t\t\t$title_url, $data['live_url'], $data['image'], $data['image_small'], $data['time'], $published));\n\t\t\n\t\tif ($q)\n\t\t\treturn $this->getItem($this->db->insert_id());\n\t\telse\n\t\t\treturn array('success'=>false, 'error'=>\"There was an error adding this item\");\n\t}", "public function add() {\n $dataH['CustomerBankAccount'] = $_lib['sess']->get_companydef('BankAccount');\n $old_pattern = array(\"/[^0-9]/\");\n $new_pattern = array(\"\");\n $dataH['CustomerAccountPlanID'] = strtolower(preg_replace($old_pattern, $new_pattern , $_lib['sess']->get_companydef('OrgNumber')));\n }", "function addItem($value, $text, $bstore=false){\n\t\t\t\tif($bstore){\n\t\t\t\t\t$this->items[] = array($value => $text);\n\t\t\t\t}else{\n\t\t\t\t\t$this->item = array($value => $text);\n\t\t\t\t}\n\n\t\t\t\treturn $this->item;\n\t\t\t}", "public function addAdditionalInfos(\\AgentSIB\\Diadoc\\Api\\Proto\\Invoicing\\AdditionalInfo $value)\n {\n if ($this->AdditionalInfos === null) {\n $this->AdditionalInfos = new \\Protobuf\\MessageCollection();\n }\n\n $this->AdditionalInfos->add($value);\n }", "public function add_item($zajlib_feed_item){\n\t\t$this->items[] = $zajlib_feed_item; \n\t}", "public function addItem($name, $value)\n {\n $this->elements[] = ['name' => $name, 'value' => $value];\n }", "public function addToSpecialReqDetails($item)\n {\n // validation for constraint: itemType\n if (!false) {\n throw new \\InvalidArgumentException(sprintf('The SpecialReqDetails property can only contain items of anyType, \"%s\" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__);\n }\n $this->SpecialReqDetails[] = $item;\n return $this;\n }", "function PostProcessItemData()\n {\n $this->AddEventQuestDatas();\n $this->ItemDataGroups();\n }", "public function addData($name, $value) {\n\t\t$this->data[$name] = $value;\n\t}", "public function AddData ($key, $value) {\n\t\t$this->data[$key] = $value;\t\t\t\t\n\t}", "public function appendItemInfo(Down_GuildDropItemInfo $value)\n {\n return $this->append(self::_ITEM_INFO, $value);\n }", "public function addItem($item)\n {\n if ($item instanceof \\Fastbill\\Item\\Item)\n {\n $this['ITEMS'][] = $item;\n }\n else\n {\n $itemObj = new \\Fastbill\\Item\\Item();\n $itemObj->fillFromArray($item);\n $this['ITEMS'];\n }\n\n }", "public function add_info($info) {\n\n try {\n if ($this->db->insert($this->db->USER_BLOG_POST, $info))\n return true;\n else\n return false;\n } catch (Exception $err_obj) {\n show_error($err_obj->getMessage());\n }\n }", "public function setAdditionalInfo($value)\n {\n return $this->set(self::ADDITIONALINFO, $value);\n }", "function add($name, $data) {\n $this->data[$name] = $data;\n return $data;\n }", "final public function addItemOwner() {\n $this->addUserByField('users_id', true);\n }", "function updatePersonalInfo($user_id,$userData)\n\t\t{\n\t\t\t//getting id of given user id\n\t\t\t$idRow = $this->manageContent->getValue_where(\"user_info\",\"*\",\"user_id\",$user_id);\n\t\t\t$id = $idRow[0]['id'];\n\t\t\t//updating the values\n\t\t\tif(isset($userData['name']) && !empty($userData['name']))\n\t\t\t{\n\t\t\t\t$upd = $this->manageContent->updateValueWhere(\"user_info\",\"name\",$userData['name'],\"id\",$id);\n\t\t\t}\n\t\t\t\n\t\t\tif(isset($userData['gender']) && !empty($userData['gender']))\n\t\t\t{\n\t\t\t\t$upd = $this->manageContent->updateValueWhere(\"user_info\",\"gender\",$userData['gender'],\"id\",$id);\n\t\t\t}\n\t\t\t\n\t\t\tif(isset($userData['dob']) && !empty($userData['dob']))\n\t\t\t{\n\t\t\t\t$upd = $this->manageContent->updateValueWhere(\"user_info\",\"dob\",$userData['dob'],\"id\",$id);\n\t\t\t}\n\t\t\t\n\t\t\tif(isset($userData['contact']) && !empty($userData['contact']))\n\t\t\t{\n\t\t\t\t$upd = $this->manageContent->updateValueWhere(\"user_info\",\"contact_no\",$userData['contact'],\"id\",$id);\n\t\t\t}\n\t\t\t\n\t\t\tif(isset($userData['add1']) && !empty($userData['add1']))\n\t\t\t{\n\t\t\t\t$upd = $this->manageContent->updateValueWhere(\"user_info\",\"addr_line1\",$userData['add1'],\"id\",$id);\n\t\t\t}\n\t\t\t\n\t\t\tif(isset($userData['add2']))\n\t\t\t{\n\t\t\t\t$upd = $this->manageContent->updateValueWhere(\"user_info\",\"addr_line2\",$userData['add2'],\"id\",$id);\n\t\t\t}\n\t\t\t\n\t\t\tif(isset($userData['pin']) && !empty($userData['pin']))\n\t\t\t{\n\t\t\t\t$upd = $this->manageContent->updateValueWhere(\"user_info\",\"pincode\",$userData['pin'],\"id\",$id);\n\t\t\t}\n\t\t\t\n\t\t\tif(isset($userData['city']) && !empty($userData['city']))\n\t\t\t{\n\t\t\t\t$upd = $this->manageContent->updateValueWhere(\"user_info\",\"city\",$userData['city'],\"id\",$id);\n\t\t\t}\n\t\t\t\n\t\t\tif(isset($userData['state']) && !empty($userData['state']))\n\t\t\t{\n\t\t\t\t$upd = $this->manageContent->updateValueWhere(\"user_info\",\"state\",$userData['state'],\"id\",$id);\n\t\t\t}\n\t\t\t\n\t\t\tif(isset($userData['country']) && !empty($userData['country']))\n\t\t\t{\n\t\t\t\t$upd = $this->manageContent->updateValueWhere(\"user_info\",\"country\",$userData['country'],\"id\",$id);\n\t\t\t}\n\t\t}", "abstract protected function onBeforeAdd($oItem);", "function addItem(&$item) {\n\t\tglobal $CONF ; \n\t\t$this->items [$item->alias] = $item;\n\t\t$item->menu = $this ;\n\t}", "function Add($name, $value)\r\n\t{\r\n\t\tif (is_array($this->Data))\r\n\t\t{\r\n\t\t\t$this->Data[$name] = $value;\t\r\n\t\t}\t\r\n\t\telse if (is_object($this->Data))\r\n\t\t{\r\n\t\t\t$this->Data->$name = $value;\t\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\ttrigger_error(\"A DataRow of base type, cannot have fields added.\",E_USER_ERROR);\t\r\n\t\t}\r\n\t\t\r\n\t}", "public function add($item) {\n $this->items[$item->id()] = $item;\n }", "public function appendItem(\\PB_Item $value)\n {\n return $this->append(self::ITEM, $value);\n }", "public function addItem($item) {\n\t\t$this->result .= '<li>' . $item . '</li>' . PHP_EOL;\n\t}", "function AfterAdd(&$values,&$keys,$inline,&$pageObject)\n{\n\n\t\tglobal $conn;\n\n$ID=$keys['ID'];\n//give uppercase name\n$uppername=strtoupper($values['Name']);\n\n$give_matric = \"UPDATE staff_info set Name='$uppername' where ID='$ID' \";\ndb_exec($give_matric,$conn);\n;\t\t\n}", "function addItem(SitemapItem $item)\r\n {\r\n $this->items[] = $item;\r\n }", "function roomify_conversations_add_further_info_field() {\n field_info_cache_clear();\n\n if (field_read_field('conversation_further_info') === FALSE) {\n $field = array(\n 'field_name' => 'conversation_further_info',\n 'type' => 'text_long',\n 'cardinality' => 1,\n 'locked' => 1,\n 'settings' => array(\n 'max_length' => 255,\n 'profile2_private' => FALSE,\n ),\n );\n field_create_field($field);\n }\n\n field_cache_clear();\n\n if (field_read_instance('roomify_conversation', 'conversation_further_info', 'standard') === FALSE) {\n $instance = array(\n 'field_name' => 'conversation_further_info',\n 'entity_type' => 'roomify_conversation',\n 'label' => 'Further info',\n 'bundle' => 'standard',\n 'required' => FALSE,\n 'widget' => array(\n 'type' => 'text_textarea',\n 'weight' => 6,\n ),\n );\n field_create_instance($instance);\n }\n}", "function fill_in_additional_list_fields()\r\n\t{\r\n\t}", "function addEntry($newentry) {\n\t\t$this->data[] = $newentry;\n\t}", "public function save() {\r\n /** probably we should add a timestamp, Item ID and stuff */\r\n $stored_data = json_encode(array($this->name, $this->status), JSON_UNESCAPED_UNICODE);\r\n $this->db_write(\"objects\", \"Item_s11n\", $stored_data);\r\n print ($stored_data);\r\n }", "public function appendAdditionalInfos(\\Diadoc\\Api\\Proto\\Invoicing\\AdditionalInfo $value)\n {\n return $this->append(self::ADDITIONALINFOS, $value);\n }", "function AfterAdd(&$values, &$keys, $inline, &$pageObject)\n{\n\n\t\t\n\t// We update the values that allow us to find the MEFE master user for this organization\n\n\t\t// what was the ID of the last inserted record?\n\n\t\t\t$rs_organization_id = $values['id_organization'];\n\t\t\n\t\t// We update the value\n\n\t\t\t$table_name = 'uneet_enterprise_organizations' ;\n\n\t\t\t$data = array();\n\t\t\t\t$data[\"mefe_master_user_external_person_id\"] = (0 . '-' . $rs_organization_id) ;\n\t\t\t\t$data[\"mefe_master_user_external_person_system\"] = 'Setup' ;\n\t\t\t\t$data[\"mefe_master_user_external_person_table\"] = 'Setup' ;\n\t\t\t$keyvalues = array();\n\t\t\t\t$keyvalues[\"id_organization\"] = $rs_organization_id;\n\n\t\t\t// Command to do the update\n\t\t\t\t\n\t\t\t\tDB::Update($table_name, $data, $keyvalues);\n\n// Place event code here.\n// Use \"Add Action\" button to add code snippets.\n;\t\t\n}", "function PostProcess($item)\n {\n $this->Sql_Select_Hash_Datas_Read($item,array(\"Friend\",\"Name\"));\n\n $name=$this->FriendsObj()->Friend_Name_Text($item[ \"Friend\" ]);\n \n \n $updatedatas=array();\n if (empty($item[ \"Name\" ]) || $item[ \"Name\" ]!=$name)\n {\n $item[ \"Name\" ]=$name;\n array_push($updatedatas,\"Name\");\n }\n\n $this->Sql_Select_Hash_Datas_Read\n (\n $item,\n array_merge\n (\n $this->MyMod_Item_Groups_Compulsory_Data($this->InscriptionSGroups(0),True),\n array(\"Status\",\"Completed\")\n )\n );\n \n if ($item[ \"Status\" ]==1 || !$this->Inscription_Complete($item))\n {\n if (empty($item[ \"Complete\" ]) || $item[ \"Complete\" ]!=1)\n {\n $item[ \"Complete\" ]=1;\n array_push($updatedatas,\"Complete\");\n }\n }\n else\n {\n if (empty($item[ \"Complete\" ]) || $item[ \"Complete\" ]!=2)\n {\n $item[ \"Complete\" ]=2;\n array_push($updatedatas,\"Complete\");\n }\n }\n\n if (count($updatedatas)>0)\n {\n $this->Sql_Update_Item_Values_Set($updatedatas,$item);\n }\n \n return $item;\n }", "public function addToArray($name, $item)\n {\n $this->arrSettings[$name] = $item; \n }", "public function addData(string $data);", "public function addItem($item)\n {\n // Push item into list of array\n array_push($this->items, $item);\n }", "private function save_paypal_meta_data()\n {\n $postMeta = [\n 'payer_email' => 'Payer PayPal address',\n 'first_name' => 'Payer first name',\n 'last_name' => 'Payer last name',\n 'payment_type' => 'Payment type',\n ];\n\n foreach ($postMeta as $key => $name) {\n $value = wc_clean($this->request->get($key, FILTER_DEFAULT));\n $value and update_post_meta($this->order->get_id(), $name, $value);\n }\n }", "public function add($item)\n {\n $this->addArray('content', $item, array('ButtonContainer', 'Container', 'Form', 'Heading', 'HTML', 'Image', 'Checkbox', 'Email', 'HiddenField', 'Label', 'Password', 'Phone', 'RadioButtons', 'SelectMenu', 'TextInput', 'TextArea', 'Upload', 'XList', 'Table'));\n }", "public function onAfterFieldDefinition($data, $item): void\n {\n // A locale can be null, those need to be skipped\n $locales = Locale::get()->exclude(['Locale' => null]);\n\n foreach ($locales as $locale) {\n $copy = $item;\n $copy['Field'] = sprintf('%s_%s', $item['Field'], $locale->Locale);\n $data->push($copy);\n }\n }", "protected function _createRecordInfo(Item $item)\n {\n\n // Check to see if we alread have a location\n if (!$this->_recordInfo) {\n $this->_recordInfo = $this->_node->appendChild(new Mods_RecordInfo());\n } \n }", "public function AddItem($item)\n {\n $this->_items[] = $item;\n }", "public function insert()\n {\n $this->_checkItem();\n $service = $this->getService();\n $entry = $service->newItemEntry();\n $this->setEntry($entry);\n $this->_prepareEnrtyForSave();\n $this->getEntry()->setItemType($this->_getItemType());\n $entry = $service->insertGbaseItem($this->getEntry());\n $this->setEntry($entry);\n $entryId = $this->getEntry()->getId();\n $published = $this->gBaseDate2DateTime($this->getEntry()->getPublished()->getText());\n $this->getItem()\n ->setGbaseItemId($entryId)\n ->setPublished($published);\n\n if ($expires = $this->_getAttributeValue('expiration_date')) {\n $expires = $this->gBaseDate2DateTime($expires);\n $this->getItem()->setExpires($expires);\n }\n }", "function acf_append_data($name, $data)\n{\n}", "function add_field($field, $value) {\n // sent to paypal as POST variables. If the value is already in the \n // array, it will be overwritten.\n \n $this->fields[\"$field\"] = $value;\n }", "public function addItem($item)\n\t{\n\t\t$this->_items[] = $item;\n\t}", "public function add_item($boat_id, $item, $type) {\n $data = array(\n 'BOAT_ID' => $boat_id,\n 'CL_DES' => $item,\n 'TYPE' => $type,\n 'CHECKED' => false\n );\n $this->db->insert('CL', $data);\n }", "public function setPersonalInfo($personalInfo){\r\n\t \r\n\t return $this;\r\n\t}" ]
[ "0.6281816", "0.624835", "0.5833373", "0.5772086", "0.57477057", "0.57307374", "0.57307374", "0.5715001", "0.5685597", "0.56725395", "0.5660738", "0.5629426", "0.5616938", "0.5613185", "0.5565619", "0.55552506", "0.5544828", "0.5526423", "0.5525993", "0.5518383", "0.5500519", "0.5465077", "0.5459958", "0.5454519", "0.54487324", "0.54401237", "0.54271233", "0.5420279", "0.5420279", "0.54151237", "0.54148304", "0.5413364", "0.5404913", "0.5402593", "0.5385306", "0.53607255", "0.5358994", "0.53554153", "0.5342019", "0.53320175", "0.5330568", "0.5310395", "0.5307518", "0.5300579", "0.52945244", "0.5293674", "0.52932733", "0.5290452", "0.5287285", "0.52706116", "0.52681965", "0.52642965", "0.52634513", "0.5262887", "0.5260003", "0.52420324", "0.52208567", "0.5218557", "0.5212833", "0.5197873", "0.51958394", "0.51926476", "0.51891", "0.51864314", "0.5177468", "0.517667", "0.51704055", "0.5165876", "0.51615256", "0.5159938", "0.51595026", "0.5131987", "0.5126581", "0.51251704", "0.51232815", "0.51129717", "0.5112927", "0.5106829", "0.5095626", "0.5093309", "0.50818336", "0.5076884", "0.50766367", "0.5069199", "0.5066256", "0.5063078", "0.50625503", "0.50596213", "0.5058809", "0.50538903", "0.50457716", "0.5043371", "0.50394905", "0.5027511", "0.50261116", "0.5024257", "0.5021885", "0.5018226", "0.5017621", "0.501288" ]
0.68782574
0
This method is responsible for validating the values passed to the setWorker_Status_Data method This method is willingly generated in order to preserve the oneline inline validation within the setWorker_Status_Data method
public static function validateWorker_Status_DataForArrayConstraintsFromSetWorker_Status_Data(array $values = array()) { $message = ''; $invalidValues = []; foreach ($values as $employee_DataTypeWorker_Status_DataItem) { // validation for constraint: itemType if (!$employee_DataTypeWorker_Status_DataItem instanceof \WorkdayWsdl\\StructType\Worker_Status_DataType) { $invalidValues[] = is_object($employee_DataTypeWorker_Status_DataItem) ? get_class($employee_DataTypeWorker_Status_DataItem) : sprintf('%s(%s)', gettype($employee_DataTypeWorker_Status_DataItem), var_export($employee_DataTypeWorker_Status_DataItem, true)); } } if (!empty($invalidValues)) { $message = sprintf('The Worker_Status_Data property can only contain items of type \WorkdayWsdl\\StructType\Worker_Status_DataType, %s given', is_object($invalidValues) ? get_class($invalidValues) : (is_array($invalidValues) ? implode(', ', $invalidValues) : gettype($invalidValues))); } unset($invalidValues); return $message; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function getStatus(){\n\t\t$this->valid=$this->checkDatesValidity();\n\t\tif($this->usage==\"once\" && $this->usageCount) $this->valid = false;\n\t\tif($this->usage==\"count\" && $this->usageCount>=$this->maxUsage) $this->valid = false;\n\t\tif($this->type==\"fixed\" && $this->value<=0) $this->valid = false;\n\t\tif($this->type==\"grid\" && !count($this->grid)) $this->valid = false;\n\t}", "protected function prepareForValidation() {\n\t\t$this->importStatus = [\n\t\t\tContentUserReportViewHelper::COPY_CONTENT_JOB_NOT_STARTED,\n\t\t\tContentUserReportViewHelper::COPY_CONTENT_JOB_RUNNING,\n\t\t\tContentUserReportViewHelper::COPY_CONTENT_JOB_COMPLETED,\n\t\t\tContentUserReportViewHelper::COPY_CONTENT_JOB_FAILED,\n\t\t];\n\t}", "abstract public function validateData();", "private function set_current_health_status($arr){\r\n\t\t$qno = $this->getFirstQuestionNo('current_health_status');\r\n\t\t$err=null;\r\n\t\ttry{\r\n \t\t$v=$this->vc->exists('q4',$arr,\"enum\",array(\"values\"=>array(1,2,3,4,5)),false,false);\r\n \t\t$this->data['current_health_status']['q4']=($v==\"\")?0:$v;\r\n \t}catch(ValidationException $e){\r\n \t\t$eob=$e->createErrorObject();\r\n \t\t$eob->message = \"Please give your opinion of your overall health\";\r\n \t\t$eob->name = \"Question \" . $qno;\r\n \t\t$err[] = $eob;\r\n \t}\r\n\r\n\t\t\t$qno += 1;\r\n \tfor($x=0;$x<=15;$x++){\r\n \t\ttry{\r\n \t\t\t$v=$this->vc->exists('q5_'.$x,$arr,\"enum\",array(\"values\"=>array(1,2,3,4,5)),false,false);\r\n \t\t\t$this->data['current_health_status']['q5_'.$x]=($v==\"\")?0:$v;\r\n \t\t}catch(ValidationException $e){\r\n \t\t\t$eb=$e->createErrorObject();\r\n \t\t\t$eb->message = \"Be sure to select an answer for all conditions\";\r\n \t\t\t$eb->name = \"Question \" . $qno;\r\n \t\t}\r\n \t}\r\n \tif (isset($eb)) {\r\n \t\t$err[] = $eb;\r\n \t}\r\n/* \t\r\n\t\t\t$qno += 1;\r\n \ttry{\r\n \t\t$v=$this->vc->exists('q6',$arr,\"enum\",array(\"values\"=>array(1,2)),false,false);\r\n \t\t$this->data['current_health_status']['q6']=($v==\"\")?0:$v;\r\n \t}catch(ValidationException $e){\r\n \t\t$eob=$e->createErrorObject();\r\n \t\t$eob->message = \"Please answer if you have medical condition that requires you to use your medical benefits\";\r\n \t\t$eob->name = \"Question \" . $qno;\r\n \t}\r\n*/\r\n\t\t\t$qno += 1;\r\n \ttry{\r\n \t\t$v=$this->vc->exists('q7',$arr,\"enum\",array(\"values\"=>array(1,2)),false,false);\r\n \t\t$this->data['current_health_status']['q7']=($v==\"\")?0:$v;\r\n \t}catch(ValidationException $e){\r\n \t\t$eob=$e->createErrorObject();\r\n \t\t$eob->message = \"Please express if you understand your medical benefits\";\r\n \t\t$eob->name = \"Question \" . $qno;\r\n \t\t$err[] = $eob;\r\n \t}\r\n/*\r\n\t\t\t$qno += 1;\r\n \ttry{\r\n \t\t$v=$this->vc->exists('q8',$arr,\"enum\",array(\"values\"=>array(1,2,3)),false,false);\r\n \t\t$this->data['current_health_status']['q8']=($v==\"\")?0:$v;\r\n \t}catch(ValidationException $e){\r\n \t\t$eob=$e->createErrorObject();\r\n \t\t$eob->message = \"Please answer if you get a yearly physical examination\";\r\n \t\t$eob->name = \"Question \" . $qno;\r\n \t\t$err[] = $eob;\r\n \t}\r\n*/\r\n\t\t\t$qno += 1;\r\n \ttry{\r\n \t\t$v=$this->vc->exists('q9',$arr,\"enum\",array(\"values\"=>array(1,2)),false,false);\r\n \t\t$this->data['current_health_status']['q9']=($v==\"\")?0:$v;\r\n \t}catch(ValidationException $e){\r\n \t\t$eob=$e->createErrorObject();\r\n \t\t$eob->message = \"Please answer whether you can care for a minor injury\";\r\n \t\t$eob->name = \"Question \" . $qno;\r\n \t\t$err[] = $eob;\r\n \t} \t\r\n \treturn ($err)?$err:false; \t\r\n }", "public function check_data()\n {\n parent::check_data();\n\n if(empty($this->build_notifications))\n {\n throw new exception('<strong>Data missing: Notifications</strong>');\n }\n\n if(empty($this->build_batch_reference))\n {\n throw new exception('<strong>Data missing: Batch References</strong>');\n }\n }", "private function __validate_bwsched() {\n if (isset($this->initial_data[\"bwsched\"])) {\n if ($this->is_firewall_schedule($this->initial_data[\"bwsched\"])) {\n $this->validated_data[\"bwsched\"] = $this->initial_data[\"bwsched\"];\n } else {\n $this->errors[] = APIResponse\\get(4150);\n }\n } else {\n $this->validated_data[\"bwsched\"] = \"none\";\n }\n }", "protected function validate_data_fields(){\n\t\tif(empty($this->RESPONSE)){throw new Exception(\"Response field not found\", 5);}\n\t\t\n\t\t// The remote IP address is also required\n\t\tif($this->validate_ip($this->REMOTE_ADDRESS)){throw new Exception(\"Renote IP address not set correctly\", 6);}\n\t}", "private function writeDataValidity(): void\n {\n // Datavalidation collection\n $dataValidationCollection = $this->phpSheet->getDataValidationCollection();\n\n // Write data validations?\n if (!empty($dataValidationCollection)) {\n // DATAVALIDATIONS record\n $record = 0x01B2; // Record identifier\n $length = 0x0012; // Bytes to follow\n\n $grbit = 0x0000; // Prompt box at cell, no cached validity data at DV records\n $horPos = 0x00000000; // Horizontal position of prompt box, if fixed position\n $verPos = 0x00000000; // Vertical position of prompt box, if fixed position\n $objId = 0xFFFFFFFF; // Object identifier of drop down arrow object, or -1 if not visible\n\n $header = pack('vv', $record, $length);\n $data = pack('vVVVV', $grbit, $horPos, $verPos, $objId, count($dataValidationCollection));\n $this->append($header . $data);\n\n // DATAVALIDATION records\n $record = 0x01BE; // Record identifier\n\n foreach ($dataValidationCollection as $cellCoordinate => $dataValidation) {\n // options\n $options = 0x00000000;\n\n // data type\n $type = CellDataValidation::type($dataValidation);\n\n $options |= $type << 0;\n\n // error style\n $errorStyle = CellDataValidation::errorStyle($dataValidation);\n\n $options |= $errorStyle << 4;\n\n // explicit formula?\n if ($type == 0x03 && preg_match('/^\\\".*\\\"$/', $dataValidation->getFormula1())) {\n $options |= 0x01 << 7;\n }\n\n // empty cells allowed\n $options |= $dataValidation->getAllowBlank() << 8;\n\n // show drop down\n $options |= (!$dataValidation->getShowDropDown()) << 9;\n\n // show input message\n $options |= $dataValidation->getShowInputMessage() << 18;\n\n // show error message\n $options |= $dataValidation->getShowErrorMessage() << 19;\n\n // condition operator\n $operator = CellDataValidation::operator($dataValidation);\n\n $options |= $operator << 20;\n\n $data = pack('V', $options);\n\n // prompt title\n $promptTitle = $dataValidation->getPromptTitle() !== '' ?\n $dataValidation->getPromptTitle() : chr(0);\n $data .= StringHelper::UTF8toBIFF8UnicodeLong($promptTitle);\n\n // error title\n $errorTitle = $dataValidation->getErrorTitle() !== '' ?\n $dataValidation->getErrorTitle() : chr(0);\n $data .= StringHelper::UTF8toBIFF8UnicodeLong($errorTitle);\n\n // prompt text\n $prompt = $dataValidation->getPrompt() !== '' ?\n $dataValidation->getPrompt() : chr(0);\n $data .= StringHelper::UTF8toBIFF8UnicodeLong($prompt);\n\n // error text\n $error = $dataValidation->getError() !== '' ?\n $dataValidation->getError() : chr(0);\n $data .= StringHelper::UTF8toBIFF8UnicodeLong($error);\n\n // formula 1\n try {\n $formula1 = $dataValidation->getFormula1();\n if ($type == 0x03) { // list type\n $formula1 = str_replace(',', chr(0), $formula1);\n }\n $this->parser->parse($formula1);\n $formula1 = $this->parser->toReversePolish();\n $sz1 = strlen($formula1);\n } catch (PhpSpreadsheetException $e) {\n $sz1 = 0;\n $formula1 = '';\n }\n $data .= pack('vv', $sz1, 0x0000);\n $data .= $formula1;\n\n // formula 2\n try {\n $formula2 = $dataValidation->getFormula2();\n if ($formula2 === '') {\n throw new WriterException('No formula2');\n }\n $this->parser->parse($formula2);\n $formula2 = $this->parser->toReversePolish();\n $sz2 = strlen($formula2);\n } catch (PhpSpreadsheetException $e) {\n $sz2 = 0;\n $formula2 = '';\n }\n $data .= pack('vv', $sz2, 0x0000);\n $data .= $formula2;\n\n // cell range address list\n $data .= pack('v', 0x0001);\n $data .= $this->writeBIFF8CellRangeAddressFixed($cellCoordinate);\n\n $length = strlen($data);\n $header = pack('vv', $record, $length);\n\n $this->append($header . $data);\n }\n }\n }", "public function checkData() {\n\t\t// e.g. numbers must only have digits, e-mail addresses must have a \"@\" and a \".\".\n\t\treturn $this->control->checkPOST($this);\n\t}", "public function checkData() {\n\t\t// e.g. numbers must only have digits, e-mail addresses must have a \"@\" and a \".\".\n\t\treturn $this->control->checkPOST($this);\n\t}", "public function _validate()\n {\n\t\t$data = array();\n\t\t$data['error_string'] = array();\n\t\t$data['inputerror'] = array();\n\t\t$data['status'] = TRUE;\n\n\t\tif($this->input->post('status') === 'SelecteerStatus')\n\t\t{\n $data['inputerror'][] = 'status';\n $data['error_string'][] = 'Status is verplicht!';\n $data['status'] = FALSE;\n\t\t}\n\t\t\n\t\tif($this->input->post('prioriteit') === 'SelecteerPrioriteit')\n\t\t{\n\t\t\t$data['inputerror'][] = 'prioriteit';\n\t\t\t$data['error_string'][] = 'Prioriteit is verplicht!';\n\t\t\t$data['status'] = FALSE;\n\t\t}\n\n\t\tif(empty($this->input->post('Categorie')))\n\t\t{\n\t\t\t$data['inputerror'][] = 'categorie';\n\t\t\t$data['error_string'][] = 'Categorie is verplicht!';\n\t\t\t$data['status'] = FALSE;\n\t\t}\n if($this->input->post('werkman') === 'Selecteer')\n {\n $data['inputerror'][] = 'werkman';\n $data['error_string'][] = 'Werkman toewijzen is verplicht!';\n $data['status'] = FALSE;\n }\n\n\t\tif($data['status'] === FALSE)\n\t\t{\n\t\t\techo json_encode($data);\n\t\t\texit();\n\t\t}\n }", "public function checkDataSubmission() {\n\t\t$this->main('', array());\n }", "protected function _validate() {\n\t}", "public function checkValidity()\r\n {\r\n if (!parent::checkValidity())\r\n return false;\r\n\r\n if (!$this->checkUniqueCode())\r\n return false;\r\n \r\n if ($this->workflowState && strlen($this->workflowState) > 64)\r\n {\r\n $this->lastErrorMsg = _ERROR_WORKFLOWSTATE_TOO_LONG;\r\n return false;\r\n }\r\n \r\n if (trim($this->name . ' ') == '')\r\n {\r\n $this->lastErrorMsg = _ERROR_NAME_IS_MANDATORY;\r\n return false;\r\n }\r\n \r\n if (strlen($this->name) > 255)\r\n {\r\n $this->lastErrorMsg = _ERROR_NAME_TOO_LONG;\r\n return false;\r\n }\r\n \r\n if (trim($this->code . ' ') == '')\r\n {\r\n $this->lastErrorMsg = _ERROR_CODE_IS_MANDATORY;\r\n return false;\r\n }\r\n \r\n if (strlen($this->code) > 64)\r\n {\r\n $this->lastErrorMsg = _ERROR_CODE_TOO_LONG;\r\n return false;\r\n }\r\n \r\n if ($this->fromState && strlen($this->fromState) > 64)\r\n {\r\n $this->lastErrorMsg = _ERROR_CODE_TOO_LONG;\r\n return false;\r\n }\r\n \r\n if ($this->toState && strlen($this->toState) > 64)\r\n {\r\n $this->lastErrorMsg = _ERROR_CODE_TOO_LONG;\r\n return false;\r\n } \r\n \r\n return true;\r\n }", "protected function localValidation()\n\t\t{\n\t\t}", "public function rules()\n\t{\n return array(\n array('label, status_id', 'required'),\n array('label, status_id, template_name', 'safe')\n );\n\t}", "public function validate()\n {\n parent::validate();\n if ( ! $this->getRelease()\n || in_array($this->getRelease()->getState(), [\n array_search('failed', config('projects.states')),\n array_search('destroyed', config('projects.states'))\n ])\n ) {\n $this->failedValidation($this->getValidatorInstance());\n }\n }", "function validate() {\n\t\t\n\t\tif(is_array($this->value)) { // If array\n\t\t\tforeach($this->value as $k => $value){\n\t\t\t\t$this->value[$k] = $this->validate_color_rgba($value);\n\t\t\t}//foreach\n\t\t} else { // not array\n\t\t\t$this->value = $this->validate_color_rgba($this->value);\n\t\t} // END array check\n\t\t\n\t}", "public function validate_feedback_data(){\n \n // validate step 1 data.\n \n // rating should be 1-5.\n if( ! in_array($this->post_data->get('rating'), range(1, 5)) ) $this->error_msg[] = 'Rating should be 1 to 5';\n \n // title should not be blank.\n if( trim($this->post_data->get('title')) == '' ) $this->error_msg[] = 'Title should not be blank';\n \n // feedback should not be blank.\n if( trim($this->post_data->get('feedback')) == '' ) $this->error_msg[] = 'Feedback should not be blank';\n \n // recommendation should be 1 or 0.\n if( ! in_array($this->post_data->get('recommend'), range(0, 1)) ) $this->error_msg[] = 'Invalid recommendation option';\n \n \n \n // validate step 2 data.\n \n // first name should not be blank.\n if( trim($this->post_data->get('first_name')) == '' ) $this->error_msg[] = 'First name should not be blank';\n \n // last name should not be blank.\n if( trim($this->post_data->get('last_name')) == '' ) $this->error_msg[] = 'Last name should not be blank';\n \n // email should not be blank.\n if( trim($this->post_data->get('email')) == '' ) $this->error_msg[] = 'Email should not be blank';\n \n // email should be valid.\n if( ! preg_match('/^\\w+([\\.-]?\\w+)*@\\w+([\\.-]?\\w+)*(\\.\\w{2,3})+$/', $this->post_data->get('email')) ) $this->error_msg[] = 'Email should not be valid';\n \n // city should not be blank.\n if( trim($this->post_data->get('city')) == '' ) $this->error_msg[] = 'City should not be blank';\n \n // country should be somewhere from earth.\n $country = DB::table('Country')->where('code', '=', $this->post_data->get('country'))->get();\n if( empty( $country ) ) $this->error_msg[] = 'Invalid country';\n \n // permission shoulbe be 1 or 0.\n if( ! in_array($this->post_data->get('permission'), range(0, 1)) ) $this->error_msg[] = 'Invalid permission option';\n \n \n \n // validate hidden data.\n \n $company = new \\Company\\Repositories\\DBCompany;\n $company = $company->get_company_info( Config::get('application.subdomain') );\n \n // company id should be valid.\n if( $company->companyid != $this->post_data->get('company_id') ) $this->error_msg[] = 'Invalid company id';\n \n // site id should be valid.\n if( $company->siteid != $this->post_data->get('site_id') ) $this->error_msg[] = 'Invalid site id';\n \n \n \n // return true if thre's no error, false otherwise.\n return ( empty($this->error_msg) ? true : false );\n }", "public function rules()\n {\n $rules = [\n $this->csvHeader() => sprintf('required|in:%s', $this->validActivityStatus())\n ];\n\n (!is_array(getVal($this->data, ['activity_status']))) ?: $rules[$this->csvHeader()] .= '|size:1';\n\n return $rules;\n }", "public function getStatusData()\r\n\t{\r\n\t\t$data = array(\r\n\t\t\t'source' => array(\r\n\t\t\t\t'a' => array(\r\n\t\t\t\t\t'selected' => false,\r\n\t\t\t\t\t'preferred' => false,\r\n\t\t\t\t\t'voltage' => false,\r\n\t\t\t\t\t'frequency' => false,\r\n\t\t\t\t\t'status' => false,\r\n\t\t\t\t),\r\n\t\t\t\t'b' => array(\r\n\t\t\t\t\t'selected' => false,\r\n\t\t\t\t\t'preferred' => false,\r\n\t\t\t\t\t'voltage' => false,\r\n\t\t\t\t\t'frequency' => false,\r\n\t\t\t\t\t'status' => false,\r\n\t\t\t\t),\r\n\t\t\t),\r\n\t\t\t'phaseSynchronization' => false,\r\n\t\t\t'totalLoad' => false,\r\n\t\t\t'totalPower' => false,\r\n\t\t\t'peakLoad' => false,\r\n\t\t\t'energy' => false,\r\n\t\t\t'powerSupplyStatus' => false,\r\n\t\t\t'communicationStatus' => false,\r\n\t\t);\r\n\r\n\t\t$this->hr->get('/status_update.html');\r\n\r\n\t\tif ($this->hr->result) {\r\n\t\t\t// selected source\r\n\t\t\tif (preg_match('/selected source<\\/span>\\s*<span class=\"txt\">source\\s+([a-z])/i', $this->hr->result, $matches)) {\r\n\t\t\t\t$source = strtolower($matches[1]);\r\n\t\t\t\t$data['source'][$source]['selected'] = true;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// preferred source\r\n\t\t\tif (preg_match('/preferred source<\\/span>\\s*<span class=\"txt\">source\\s+([a-z])/i', $this->hr->result, $matches)) {\r\n\t\t\t\t$source = strtolower($matches[1]);\r\n\t\t\t\t$data['source'][$source]['preferred'] = true;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// source voltage\r\n\t\t\tif (preg_match('/source voltage \\(a\\/b\\)<\\/span>\\s*<span class=\"txt\">([0-9\\.]+)\\s*\\/?\\s*([0-9\\.]*)/i', $this->hr->result, $matches)) {\r\n\t\t\t\t$data['source']['a']['voltage'] = $matches[1];\r\n\t\t\t\t$data['source']['b']['voltage'] = $matches[2];\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// frequency\r\n\t\t\tif (preg_match('/source frequency \\(a\\/b\\)<\\/span>\\s*<span class=\"txt\">([0-9\\.]+)\\s*\\/?\\s*([0-9\\.]*)/i', $this->hr->result, $matches)) {\r\n\t\t\t\t$data['source']['a']['frequency'] = $matches[1];\r\n\t\t\t\t$data['source']['b']['frequency'] = $matches[2];\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// status\r\n\t\t\tif (preg_match('/source status \\(a\\/b\\)<\\/span>\\s*<span class=\"txt\">([a-z]+)\\s*\\/?\\s*([a-z]*)/i', $this->hr->result, $matches)) {\r\n\t\t\t\t$data['source']['a']['status'] = ($matches[1] == 'OK') ? true : false;\r\n\t\t\t\t$data['source']['b']['status'] = ($matches[2] == 'OK') ? true : false;\r\n\t\t\t}\r\n\r\n\t\t\t// phase sync\r\n\t\t\tif (preg_match('/phase synchronization<\\/span>\\s*<span class=\"txt\">([a-z]+)/i', $this->hr->result, $matches)) {\r\n\t\t\t\t$data['phaseSynchronization'] = ($matches[1] == 'No') ? false : true;\r\n\t\t\t}\r\n\r\n\t\t\t// total load\r\n\t\t\tif (preg_match('/total\\s+load<\\/span>\\s*<span class=\"txt\">([0-9\\.]+)/i', $this->hr->result, $matches)) {\r\n\t\t\t\t$data['totalLoad'] = floatval($matches[1]);\r\n\t\t\t}\r\n\r\n\t\t\t// total power\r\n\t\t\tif (preg_match('/total\\s+power<\\/span>\\s*<span class=\"txt\">([0-9\\.]+)/i', $this->hr->result, $matches)) {\r\n\t\t\t\t$data['totalPower'] = floatval($matches[1]);\r\n\t\t\t}\r\n\r\n\t\t\t// peak load\r\n\t\t\tif (preg_match('/peak\\s+load<\\/span>\\s*<span class=\"l2b txt\">([0-9\\.]+)/i', $this->hr->result, $matches)) {\r\n\t\t\t\t$data['peakLoad'] = floatval($matches[1]);\r\n\t\t\t}\r\n\r\n\t\t\t// energy\r\n\t\t\tif (preg_match('/energy<\\/span>\\s*<span class=\"l2b txt\">([0-9\\.]+)/i', $this->hr->result, $matches)) {\r\n\t\t\t\t$data['energy'] = floatval($matches[1]);\r\n\t\t\t}\r\n\r\n\t\t\t// PS status\r\n\t\t\tif (preg_match('/power supply status<\\/span>\\s*<span class=\"txt\">([a-z]+)/i', $this->hr->result, $matches)) {\r\n\t\t\t\t$data['powerSupplyStatus'] = ($matches[1] == 'OK') ? true : false;\r\n\t\t\t}\r\n\r\n\t\t\t// comm status\r\n\t\t\tif (preg_match('/communication status<\\/span>\\s*<span class=\"txt\">([a-z]+)/i', $this->hr->result, $matches)) {\r\n\t\t\t\t$data['communicationStatus'] = ($matches[1] == 'OK') ? true : false;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn $data;\r\n\t}", "public function validate()\n {\n $messages = array();\n\n // ID\n if (!Validator::validateField($this->id, 'intVal')) {\n $messages[] = 'ID is invalid.';\n }\n\n // Email\n if (!Validator::validateField($this->email, 'email', array('notEmpty' => array(), 'required' => true))) {\n $messages[] = 'Email address is invalid.';\n }\n\n // Password - no need to validate as it is validated on set and isn't required for an update\n\n // First name\n if (!Validator::validateField($this->first_name, 'stringType', array(\n 'notEmpty' => array(),\n 'length' => array(1, 35),\n 'required' => true\n ))) {\n $messages[] = 'First name is required.';\n }\n\n // Last name\n if (!Validator::validateField($this->last_name, 'stringType', array(\n 'notEmpty' => array(),\n 'length' => array(1, 35),\n 'required' => true\n ))) {\n $messages[] = 'Last name is required.';\n }\n\n // Role\n if (!Validator::validateField($this->role, 'stringType', array(\n 'notEmpty' => array(),\n 'length' => array(1, 35),\n 'required' => true\n ))) {\n $messages[] = 'Role is required.';\n }\n\n // Status\n if (!Validator::validateField($this->status, 'slug', array(\n 'notEmpty' => array(),\n 'length' => array(1, 20),\n 'required' => true\n ))) {\n $messages[] = 'Status is not valid.';\n }\n\n if (!empty($messages)) {\n throw new ValidationException($messages);\n }\n }", "abstract public function runValidation();", "public function validation($data, $files) {\r\n\r\n // // Check open and close times are consistent.\r\n // if ($data['timeopen'] != 0 && $data['timeclose'] != 0 &&\r\n // $data['timeclose'] < $data['timeopen']) {\r\n // $errors['timeclose'] = get_string('closebeforeopen', 'quiz');\r\n // }\r\n\r\n // // Check that the grace period is not too short.\r\n // if ($data['overduehandling'] == 'graceperiod') {\r\n // $graceperiodmin = get_config('quiz', 'graceperiodmin');\r\n // if ($data['graceperiod'] <= $graceperiodmin) {\r\n // $errors['graceperiod'] = get_string('graceperiodtoosmall', 'quiz', format_time($graceperiodmin));\r\n // }\r\n // }\r\n\r\n // if (array_key_exists('completion', $data) && $data['completion'] == COMPLETION_TRACKING_AUTOMATIC) {\r\n // $completionpass = isset($data['completionpass']) ? $data['completionpass'] : $this->current->completionpass;\r\n\r\n // // Show an error if require passing grade was selected and the grade to pass was set to 0.\r\n // if ($completionpass && (empty($data['gradepass']) || grade_floatval($data['gradepass']) == 0)) {\r\n // if (isset($data['completionpass'])) {\r\n // $errors['completionpassgroup'] = get_string('gradetopassnotset', 'quiz');\r\n // } else {\r\n // $errors['gradepass'] = get_string('gradetopassmustbeset', 'quiz');\r\n // }\r\n // }\r\n // }\r\n\r\n // // Check the boundary value is a number or a percentage, and in range.\r\n // $i = 0;\r\n // while (!empty($data['feedbackboundaries'][$i] )) {\r\n // $boundary = trim($data['feedbackboundaries'][$i]);\r\n // if (strlen($boundary) > 0) {\r\n // if ($boundary[strlen($boundary) - 1] == '%') {\r\n // $boundary = trim(substr($boundary, 0, -1));\r\n // if (is_numeric($boundary)) {\r\n // $boundary = $boundary * $data['grade'] / 100.0;\r\n // } else {\r\n // $errors[\"feedbackboundaries[$i]\"] =\r\n // get_string('feedbackerrorboundaryformat', 'quiz', $i + 1);\r\n // }\r\n // } else if (!is_numeric($boundary)) {\r\n // $errors[\"feedbackboundaries[$i]\"] =\r\n // get_string('feedbackerrorboundaryformat', 'quiz', $i + 1);\r\n // }\r\n // }\r\n // if (is_numeric($boundary) && $boundary <= 0 || $boundary >= $data['grade'] ) {\r\n // $errors[\"feedbackboundaries[$i]\"] =\r\n // get_string('feedbackerrorboundaryoutofrange', 'quiz', $i + 1);\r\n // }\r\n // if (is_numeric($boundary) && $i > 0 &&\r\n // $boundary >= $data['feedbackboundaries'][$i - 1]) {\r\n // $errors[\"feedbackboundaries[$i]\"] =\r\n // get_string('feedbackerrororder', 'quiz', $i + 1);\r\n // }\r\n // $data['feedbackboundaries'][$i] = $boundary;\r\n // $i += 1;\r\n // }\r\n // $numboundaries = $i;\r\n\r\n // // Check there is nothing in the remaining unused fields.\r\n // if (!empty($data['feedbackboundaries'])) {\r\n // for ($i = $numboundaries; $i < count($data['feedbackboundaries']); $i += 1) {\r\n // if (!empty($data['feedbackboundaries'][$i] ) &&\r\n // trim($data['feedbackboundaries'][$i] ) != '') {\r\n // $errors[\"feedbackboundaries[$i]\"] =\r\n // get_string('feedbackerrorjunkinboundary', 'quiz', $i + 1);\r\n // }\r\n // }\r\n // }\r\n // for ($i = $numboundaries + 1; $i < count($data['feedbacktext']); $i += 1) {\r\n // if (!empty($data['feedbacktext'][$i]['text']) &&\r\n // trim($data['feedbacktext'][$i]['text'] ) != '') {\r\n // $errors[\"feedbacktext[$i]\"] =\r\n // get_string('feedbackerrorjunkinfeedback', 'quiz', $i + 1);\r\n // }\r\n // }\r\n\r\n // // If CBM is involved, don't show the warning for grade to pass being larger than the maximum grade.\r\n // if (($data['preferredbehaviour'] == 'deferredcbm') OR ($data['preferredbehaviour'] == 'immediatecbm')) {\r\n // unset($errors['gradepass']);\r\n // }\r\n // // Any other rule plugins.\r\n // $errors = quiz_access_manager::validate_settings_form_fields($errors, $data, $files, $this);\r\n\r\n // return $errors;\r\n }", "protected function validate()\r\n\t{\r\n\t\tif (!$this->isFetched())\r\n\t\t{\r\n\t\t\treturn;\r\n }\r\n \r\n\t\tif ($this->validationInfo)\r\n\t\t{\r\n\t\t\t$this->validationInfo->validate($this->normalizedValue);\r\n\t\t}\r\n\t\t$this->isValid = true;\r\n\t}", "private function validateData() {\r\n\r\n $requiredFields = array(\"v_code\" => \"Verification code not supplied\",\r\n \"psw1\" => \"Password field is empty\",\r\n \"psw2\" => \"Password field is empty\",);\r\n\r\n\r\n //0 means there is no error\r\n $error_status = \\VAL_NO_ERROR;\r\n\r\n /*\r\n Initialize error object that will be returned by this function\r\n */\r\n $error_obj = new stdClass();\r\n $error_obj->msg = \"\";\r\n $error_obj->field = \"\";\r\n $error_obj->code = 0;\r\n $error_obj->type = \\VAL_NO_ERROR;\r\n\r\n //check if required variables are defined\r\n foreach ($requiredFields as $key => $value) {\r\n $value = $this->request->request->get($key);\r\n if (empty( $value )) {\r\n $error_obj->field = $key;\r\n $error_obj->msg = $requiredFields[$key];\r\n $error_obj->type = \\VAL_FIELD_ERROR;\r\n\r\n //return after each field that is found wrong\r\n return $error_obj;\r\n }\r\n }\r\n\r\n $pass_1 = $this->request->request->get('psw1');\r\n $pass_2 = $this->request->request->get('psw2');\r\n\r\n //Check if emails match\r\n if (strcmp($pass_1, $pass_2) != 0) {\r\n $error_obj->field = \"psw2\";\r\n $error_obj->msg = \"Passwords are different\";\r\n $error_obj->type = \\VAL_FIELD_ERROR;\r\n\r\n return $error_obj;\r\n }\r\n\r\n /*\r\n Only check one password. If both passwords are thesame, we only need to check one of them.\r\n */\r\n if (!preg_match('/^(?=.*\\d)(?=.*[a-z])(?=.*[A-Z]).{6,}$/', $pass_1)) {\r\n $error_obj->field = \"psw1\";\r\n $error_obj->msg = \"Password must have a digit, lower and upper case charters. Min lenght is 6\";\r\n $error_obj->type = \\VAL_FIELD_ERROR;\r\n\r\n return $error_obj;\r\n }\r\n\r\n return $error_obj;\r\n }", "public function validateStatus()\n {\n if (!$this->hasErrors()) {\n $user = $this->getUser();\n\n if ($user->status==User::STATUS_BLOCKED || $user->status==User::STATUS_DELETED) {\n $this->addError('password', Yii::t('app','Your account is blocked, please contact support.'));\n }\n\n if ($user->status==User::STATUS_EMAIL_VALIDATION) {\n $this->addError('password', Yii::t('app','Du hast Deine Registrierung noch nicht abgeschlossen. Prüfe Deine E-Mails, dort findest Du eine E-Mail mit dem Bestätigungslink. Bitte klicke auf diesen Link um Deine Registrierung abzuschliessen.'));\n }\n\n }\n }", "public function validate() {\r\n // Name - this is required\r\n if ($this->description == '') {\r\n $this->errors[] = 'Description is required';\r\n } \r\n \r\n // Category number - must be a number\r\n if (!is_numeric($this->category)) {\r\n $this->category = 0;\r\n } \r\n \r\n // Item number - must be a number\r\n if (!is_numeric($this->item)) {\r\n $this->item = 0;\r\n } \r\n }", "function required_validate() {\n if ($this->required) {\n if (array_key_exists('NOT_NULL', $this->condition)) \n {\n if ($this->value == '' || $this->value == NULL) {\n $this->errors->add_msj(NOT_NULL_PRE.$this->name.NOT_NULL_POS);\n }\n }\n\n if (array_key_exists('IS_INT', $this->condition)) \n {\n if (!field_is_int($this->value))\n {\n $this->errors->add_msj(IS_INT_PRE.$this->name.IS_INT_POS);\n }\n }\n\n }\n }", "public function isValid($data) {\n //Remove Commas \n $data = str_replace(\",\", \"\", $data);\n \n $data['heatLossMethod']='percent';\n \n $precision = $this->mS->masterConversionList['temperature'][1][$this->mS->selected['temperature']][4];\n $iapws = new Steam_IAPWS();\n $maxTemp = $this->mS->ceil_dec($this->mS->localize($iapws->saturatedTemperature($this->mS->standardize($data['daPressure'], 'pressure')),'temperature'),$precision); \n \n if ($data['condReturnTemp']>=$maxTemp or $data['condReturnTemp']<=$this->mS->minTemperature()){\n $this->getElement('condReturnTemp')->addValidator('between', true, array('min' => $this->mS->minTemperature(), 'max' => $maxTemp, 'inclusive' => false));\n }\n \n \n $precision = $this->mS->masterConversionList['temperature'][1][$this->mS->selected['temperature']][4];\n $iapws = new Steam_IAPWS();\n $minTemp = $this->mS->ceil_dec($this->mS->localize($iapws->saturatedTemperature($this->mS->standardize($data['highPressure'],'pressure')),'temperature'),$precision);\n if ($data['boilerTemp']<$minTemp){\n $this->getElement('boilerTemp')\n ->addValidator('greaterThan', true, array('min' => $minTemp, 'messages' => '%value% is below the boiling temperature [%min%] for boiler pressure.'));\n }\n \n \n if ($data['headerCount']<3){\n $data['turbineHpMpOn'] = null;\n $data['turbineMpLpOn'] = null;\n $data['desuperHeatHpMp']=='No';\n if ($data['mpCondReturnRate']=='') $data['mpCondReturnRate'] = 0;\n if ($data['lpCondReturnRate']=='') $data['lpCondReturnRate'] = 0;\n }\n if ($data['headerCount']<2){\n $data['turbineHpLpOn'] = null;\n $data['desuperHeatMpLp']=='No';\n }\n \n if ($data['headerCount']==3){\n if($data['desuperHeatHpMp']=='Yes'){ \n $this->getElement('desuperHeatHpMpTemp')\n ->setRequired(true)\n ->addValidator($this->isFloat,true)\n ->addValidator('between', true, array('min' => $this->mS->minTemperature(), 'max' => $this->mS->maxTemperature(), 'inclusive' => true));\n }\n }\n if ($data['headerCount']>=2){\n if($data['desuperHeatMpLp']=='Yes'){ \n $this->getElement('desuperHeatMpLpTemp')\n ->setRequired(true)\n ->addValidator($this->isFloat,true)\n ->addValidator('between', true, array('min' => $this->mS->minTemperature(), 'max' => $this->mS->maxTemperature(), 'inclusive' => true)); \n }\n }\n\n \n if($data['blowdownHeatX']=='Yes'){ \n $this->getElement('blowdownHeatXTemp')\n ->setRequired(true)\n ->addValidator($this->isFloat,true)\n ->addValidator('greaterThan', true, array('min' => 0, 'max' => $this->mS->maxTemperature(), 'inclusive' => true));\n }\n \n foreach(Steam_Support::steamTurbineCodes() as $turbine){\n if ($data['turbine'.$turbine.'On']==1){\n $this->getElement('turbine'.$turbine.'IsoEff')->setRequired('true')\n ->addValidator($this->isFloat)\n ->addValidator('Between', true, array('min' => ISOEFF_MIN, 'max' => ISOEFF_MAX));\n $this->getElement('turbine'.$turbine.'GenEff')->setRequired('true')\n ->addValidator($this->isFloat)\n ->addValidator('Between', true, array('min' => GENEFF_MIN, 'max' => GENEFF_MAX));\n \n if ($turbine=='Cond'){\n $this->getElement('turbineCondOutletPressure')->setRequired(true)\n ->addValidator($this->isFloat,true)\n ->addValidator('between', true, array('min' => $this->mS->minVacuum(), 'max' => $this->mS->condVacuum(), 'inclusive' => true));\n }\n \n switch($data['turbine'.$turbine.'Method']){\n case 'fixedFlow':\n $this->getElement('turbine'.$turbine.'FixedFlow')->setRequired('true')\n ->addValidator($this->isFloat)\n ->addValidator('between', true, array('min' => $this->mS->minMassflow(), 'max' => $this->mS->maxMassflow(), 'inclusive' => false)); \n break;\n case 'flowRange':\n $this->getElement('turbine'.$turbine.'MinFlow')->setRequired('true')\n ->addValidator($this->isFloat)\n ->addValidator('between', true, array('min' => $this->mS->minMassflow(), 'max' => $data['turbine'.$turbine.'MaxFlow'])); \n \n $this->getElement('turbine'.$turbine.'MaxFlow')->setRequired('true')\n ->addValidator($this->isFloat)\n ->addValidator('between', true, array('min' => $this->mS->minMassflow(), 'max' => $this->mS->maxMassflow(), 'inclusive' => false));\n break;\n\n case 'fixedPower':\n $this->getElement('turbine'.$turbine.'FixedPower')->setRequired('true')\n ->addValidator($this->isFloat)\n ->addValidator('greaterThan', true, array('min' => 0)); \n break;\n case 'powerRange':\n $this->getElement('turbine'.$turbine.'MinPower')->setRequired('true')\n ->addValidator($this->isFloat)\n ->addValidator('between', true, array('min' => 0, 'max' => $data['turbine'.$turbine.'MaxPower'])); \n \n $this->getElement('turbine'.$turbine.'MaxPower')->setRequired('true')\n ->addValidator($this->isFloat)\n ->addValidator('greaterThan', true, array('min' => 0)); \n break;\n\n case 'balanceHeader':\n break;\n }\n }\n }\n \n $this->getElement('hpSteamUsage')->addValidator('between', true, array('min' => $this->mS->minMassflow(), 'max' => $this->mS->maxMassflow(), 'inclusive' => true));\n \n $this->getElement('hpHeatLossPercent')->setRequired(true)\n ->addValidator($this->isFloat,true)\n ->addValidator('between', true, array('min' => HEATLOST_PERCENT_MIN, 'max' => HEATLOST_PERCENT_MAX, 'inclusive' => true));\n \n \n if ($data['headerCount']==3){\n $tmp = $this->getElement('mediumPressure')->setRequired(true)\n ->addValidator($this->isFloat,true);\n if (isset($data['highPressure'])) $tmp->addValidator('lessThan', true, array('max' => $data['highPressure'], 'messages' => 'Must be less than High Pressure.'));\n $tmp->addValidator('greaterThan', true, array('min' => $this->mS->minPressure()));\n $tmp = $this->getElement('lowPressure')->setRequired(true)\n ->addValidator($this->isFloat,true);\n if (isset($data['mediumPressure'])) $tmp->addValidator('lessThan', true, array('max' => $data['mediumPressure'], 'messages' => 'Must be less than Medium Pressure.'));\n $tmp->addValidator('greaterThan', true, array('min' => $this->mS->minPressure())); \n if (isset($data['lowPressure'])) $this->getElement('daPressure')->addValidator('lessThan', true, array('max' => $data['lowPressure'], 'messages' => 'Must be below lowest steam header pressure.'));\n \n \n $this->getElement('mpSteamUsage')->setRequired(true)\n ->addValidator($this->isFloat,true);\n $this->getElement('mpSteamUsage')->addValidator('between', true, array('min' => $this->mS->minMassflow(), 'max' => $this->mS->maxMassflow(), 'inclusive' => true)); \n \n $this->getElement('mpCondReturnRate')->setRequired(true)\n ->addValidator($this->isFloat,true)\n ->addValidator('between', true, array('min' => 0, 'max' => 100, 'inclusive' => true));\n \n $this->getElement('mpHeatLossPercent')->setRequired(true)\n ->addValidator($this->isFloat,true)\n ->addValidator('between', true, array('min' => HEATLOST_PERCENT_MIN, 'max' => HEATLOST_PERCENT_MAX, 'inclusive' => true)); \n }\n \n if ($data['headerCount']==2){\n \n $tmp = $this->getElement('lowPressure')->setRequired(true)\n ->addValidator($this->isFloat,true);\n if (isset($data['highPressure'])) $tmp->addValidator('lessThan', true, array('max' => $data['highPressure'], 'messages' => 'Must be less than High Pressure.'));\n $tmp->addValidator('greaterThan', true, array('min' => $this->mS->minPressure())); \n if (isset($data['lowPressure'])) $this->getElement('daPressure')->addValidator('lessThan', true, array('max' => $data['lowPressure'], 'messages' => 'Must be below lowest steam header pressure.'));\n \n }\n \n if ($data['headerCount']>=2){\n \n $this->getElement('lpSteamUsage')->setRequired(true)\n ->addValidator($this->isFloat,true);\n \n $this->getElement('lpSteamUsage')->addValidator('between', true, array('min' => $this->mS->minMassflow(), 'max' => $this->mS->maxMassflow(), 'inclusive' => true)); \n \n $this->getElement('lpCondReturnRate')->setRequired(true)\n ->addValidator($this->isFloat,true)\n ->addValidator('between', true, array('min' => 0, 'max' => 100, 'inclusive' => true));\n \n $this->getElement('lpHeatLossPercent')->setRequired(true)\n ->addValidator($this->isFloat,true)\n ->addValidator('between', true, array('min' => HEATLOST_PERCENT_MIN, 'max' => HEATLOST_PERCENT_MAX, 'inclusive' => true)); \n }\n \n if ($data['headerCount']==1){ \n if (isset($data['highPressure'])) $this->getElement('daPressure')->addValidator('lessThan', true, array('max' => $data['highPressure'], 'messages' => 'Must be below lowest steam header pressure.')); \n \n } \n return parent::isValid($data);\n }", "private function validateData()\n {\n if (empty($this->nome)) {\n $this->errors->addMessage(\"O nome é obrigatório\");\n }\n\n if (!filter_var($this->email, FILTER_VALIDATE_EMAIL)) {\n $this->errors->addMessage(\"O e-mail é inválido\");\n }\n\n if (strlen($this->senha) < 6) {\n $this->errors->addMessage(\"A senha deve ter no minímo 6 caracteres!\");\n }\n if ($this->emailExiste($this->email, 'email')) {\n $this->errors->addMessage(\"Esse e-mail já está cadastrado\");\n }\n if ($this->emailExiste($this->usuario, 'usuario')) {\n $this->errors->addMessage(\"Esse usuário já está cadastrado\");\n }\n\n return $this->errors->hasError();\n }", "public static function validateStatus()\n{\n return array(\n new Main\\Entity\\Validator\\Length(null, 1),\n );\n}", "public function validate() {\n if (!empty($this->value)) {\n parent::validate();\n }\n }", "private function processStatus(){\n\t\t$this->facilityData = $this->getFacilityStatus();\n\n\t\t/** Set the date if it's not set for the proved facility */\n\t\t$this->setFacilityStatus();\n\t}", "function ValidateData()\n\t\t{\n\t\t\t$theValidator = new CValidator();\n\t\t\tif(!$this->arrValidator || !is_array($this->arrValidator) )\n\t\t\t{\n\t\t\t\t$this->arrValidator = array();\n\t\t\t}\n\t\t\tforeach($this->arrValidator as $key=>$value)\n\t\t\t{\n\t\t\t\tif($this->$key == '')\n\t\t\t\t{\n\t\t\t\t\t// Kiem tra xem co phai bat buoc khong?\n\t\t\t\t\tif(isset($this->arrRequired[$key]) && ($this->arrRequired[$key] == 1))\n\t\t\t\t\t{\n\t\t\t\t\t\treturn(false);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif(!$theValidator->CheckPatt($value, $this->$key))\n\t\t\t\t\t{\n\t\t\t\t\t\treturn(false);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn(true);\n\t\t}", "protected function validate_return_data($data_obj)\r\n {\r\n // Transfer the error message when previous object execution fail\r\n if($data_obj->is_error === true)\r\n {\r\n $status_data = $data_obj->get_return_data_set();\r\n $this->set_error(\r\n $status_data[\"status\"], \r\n $status_data[\"status_information\"],\r\n $status_data[\"status_information\"]\r\n );\r\n } \r\n }", "public function validate($data) {\n $data = $this->gump->sanitize($data);\n $this->gump->validation_rules(array(\n 'name' => 'required|max_len,100',\n 'capacity' => 'required|numeric',\n 'color' => 'required|max_len,7'\n ));\n\n $this->gump->filter_rules(array(\n 'name' => 'trim|sanitize_string',\n 'capacity' => 'trim|sanitize_string',\n 'color' => 'trim|sanitize_string',\n ));\n\n $validated_data = $this->gump->run($data);\n if ($validated_data === false) {\n $errArr = $this->gump->get_readable_errors();\n $errString = \"\";\n foreach ($errArr as $k => $err) {\n $errString .= $err . '<br>';\n }\n throw new Exception($errString);\n } else {\n return $data;\n }\n }", "protected function buildValidationCallback() {\n }", "private function __validate_bw() {\n if (isset($this->initial_data[\"bw\"])) {\n if (is_numeric($this->initial_data[\"bw\"]) and intval($this->initial_data[\"bw\"] >= 1)) {\n $this->validated_data[\"bw\"] = intval($this->initial_data[\"bw\"]);\n } else {\n $this->errors[] = APIResponse\\get(4211);\n }\n } else {\n $this->errors[] = APIResponse\\get(4210);\n }\n }", "private function proccess()\n {\n foreach ($this->validate as $name => $value) {\n $rules = $this->rules[$name];\n \n /* Let's see is this value a required, e.g not empty */\n if (preg_match('~req~', $rules)) {\n if ($this->isEmpty($value)) {\n $this->errors[] = $this->filterName($name) . ' can\\'t be empty, please enter required data.';\n continue; // We will display only one error per input\n }\n }\n \n /**\n * Let's see is this value needs to be integer\n */\n if (preg_match('~int~', $rules)) {\n if (!$this->isInt($value)) {\n $this->errors[] = $this->filterName($name) . ' is not number, please enter number.';\n continue; // We will display only one error per input\n }\n }\n \n /**\n * Let's see is this value needs to be text\n */\n if (preg_match('~text~', $rules)) {\n if (!$this->isText($value)) {\n $this->errors[] = $this->filterName($name) . ' is not text, please enter only letters.';\n continue; // We will display only one error per input\n }\n }\n \n /* This is good input */\n $this->data[$name] = $value;\n }\n }", "public function beforeValidate() {\n $flowData = CJSON::decode($this->flow);\n\n if ($flowData === false) {\n $this->addError('flow', Yii::t('studio', 'Flow configuration data appears to be ' .\n 'corrupt.'));\n return false;\n }\n if (isset($flowData['trigger']['type'])) {\n $this->triggerType = $flowData['trigger']['type'];\n if (isset($flowData['trigger']['modelClass']))\n $this->modelClass = $flowData['trigger']['modelClass'];\n } else {\n // $this->addError('flow',Yii::t('studio','You must configure a trigger event.'));\n }\n if (!isset($flowData['items']) || empty($flowData['items'])) {\n $this->addError('flow', Yii::t('studio', 'There must be at least one action in the ' .\n 'flow.'));\n }\n\n $this->lastUpdated = time();\n if ($this->isNewRecord)\n $this->createDate = $this->lastUpdated;\n return parent::beforeValidate();\n }", "public function validate()\n\t{\n\t\t$this->errors = [];\n\n\t\t$this->validateConfig();\n\n\t\t// there is no point to continue if config is not valid against the schema\n\t\tif($this->isValid()) {\n\t\t\t$this->validateRepetitions();\n\t\t\t$this->validateMode();\n\t\t\t$this->validateClasses();\n\t\t\t$this->validateTestData();\n\t\t}\n\t}", "function getStatus(){\n $this->status = 'Unknown';\n if($this->finAid == 1 && $this->totalOwed != 0){\n if($this->finaidQuestion[1] == ''){\n $this->status = 'Waiting for finaid application';\n return;\n }else{\n $this->status = 'Waiting for finaid decision';\n return;\n }\n }\n if($this->schoolFeeOwed != 0){\n $this->status = 'Waiting for school fee payment';\n return;\n }\n if($this->countryId[1] == 0){\n $this->status = 'Waiting for country preferences';\n return;\n }\n if($this->countryId[1] != 0 && $this->countryConfirm != 1){\n $this->status = 'Waiting for country assignments';\n return;\n }\n if($this->delegateFeeOwed != 0){\n $this->status = 'Waiting for delegate fee payment';\n return;\n }\n if(sizeof($this->attendees) == 0){\n $this->status = 'Waiting for attendee info';\n return;\n }\n if($this->totalOwed < 0){\n $this->status = 'Need Refund';\n return;\n }\n if(sizeof($this->attendees) == $this->totalAttendees && $this->totalOwed == 0){\n $this->status = 'Ready';\n return;\n }\n }", "function validateData($array){\n\t\t$errorFlag=true;\n\t\t$currentDate = getdate(); //get current date\n\t\tif (trim($array['FName'])==''){\n\t\t\t$this->appendErrorMsg(\"First Name is required\");\n\t\t\t$errorFlag = false;\n\t\t}\n\t\tif (trim($array['LName'])==''){\n\t\t\t$this->appendErrorMsg(\"Last Name is required\");\n\t\t\t$errorFlag = false;\n\t\t}\n\t\tif (trim($array['License_No'])==''){\n\t\t\t$this->appendErrorMsg(\"License number is required\");\n\t\t\t$errorFlag = false;\n\t\t}\n\t\tif (trim($array['Birthdate'])==''){\n\t\t\t$this->appendErrorMsg(\"Birthdate cannot be blank\");\n\t\t\t$errorFlag = false;\n\t\t} else if (!preg_match(\"/^[0-9]{4,4}[-][0-1]{1,2}?[0-9]{1,2}[-][0-3]{1,2}?[0-9]{1,2}$/\", $array['Birthdate'])){\n\t\t\t$this->appendErrorMsg(\"Date should be in the format yyyy-mm-dd\");\n\t\t\t$errorFlag = false;\n\t\t} else if (getAge($array['Birthdate'])<16 || getAge($array['Birthdate'])> 100){\n\t\t\t$this->appendErrorMsg(\"Sorry, we do not provide coverage to drivers under the age of 16 or over the age of 100\");\n\t\t\t$errorFlag = false;\n\t\t}\n\t\tif (trim($array['PostalCode'])==''){\n\t\t\t$this->appendErrorMsg(\"Postal Code is required\");\n\t\t\t$errorFlag = false;\n\t\t} else if (!preg_match(\"/^[A-Za-z]{1}\\d{1}[A-Za-z]{1}\\d{1}[A-Za-z]{1}\\d{1}$/\",$array['PostalCode'])){\n\t\t\t$this->appendErrorMsg(\"Postal Code should be in the format A1B2C3\");\n\t\t\t$errorFlag = false;\n\t\t}\n\t\tif (trim($array['Phone'])==''){\n\t\t\t$this->appendErrorMsg(\"Phone number is required\");\n\t\t\t$errorFlag = false;\n\t\t} else if (!preg_match(\"/^[0-9]{10}$/\",$array['Phone'])){\n\t\t\t$this->appendErrorMsg(\"Phone number must be in the format xxx-xxx-xxxx or xxxxxxxxx\");\n\t\t\t$errorFlag = false;\n\t\t}\n\t\tif (!preg_match(\"/^[0-9]{1,}$/\", $array['Years_Exp'])){\n\t\t\t$this->appendErrorMsg(\"Please input the number of Years of Experience\");\n\t\t\t$errorFlag = false;\n\t\t}\n\t\treturn $errorFlag;\n\t}", "public function validateReport($data)\n {\n self::$rules = [\n 'employee' => 'required',\n 'startDate' => 'required|date_format:Y-m-d',\n 'endDate' => 'required|date_format:Y-m-d'\n ];\n if ($data['employee'] != 0) {\n self::$rules['employee'] = 'required|exists:appUser,id';\n }\n $this->validate($data);\n }", "private function _validate()\r\n {\r\n $data = array();\r\n $data['error_string'] = array();\r\n $data['inputerror'] = array();\r\n $data['status'] = TRUE;\r\n\r\n if($this->input->post('gsm_number') == '')\r\n {\r\n $data['inputerror'][] = 'gsm_number';\r\n $data['error_string'][] = 'Number GSM is required';\r\n $data['status'] = FALSE;\r\n }\r\n\r\n if($this->input->post('gsm_imsi_number') == '')\r\n {\r\n $data['inputerror'][] = 'gsm_imsi_number';\r\n $data['error_string'][] = 'Number IMSI GSM is required';\r\n $data['status'] = FALSE;\r\n }\r\n\r\n if($this->input->post('gsm_iccid_number') == '')\r\n {\r\n $data['inputerror'][] = 'gsm_iccid_number';\r\n $data['error_string'][] = 'Number ICCID GSM is required';\r\n $data['status'] = FALSE;\r\n }\r\n\r\n if($this->input->post('vendor_id') == '')\r\n {\r\n $data['inputerror'][] = 'vendor_id';\r\n $data['error_string'][] = 'Please select Vendor';\r\n $data['status'] = FALSE;\r\n }\r\n\r\n if($this->input->post('gsm_cond_id') == '')\r\n {\r\n $data['inputerror'][] = 'gsm_cond_id';\r\n $data['error_string'][] = 'Please select Condition';\r\n $data['status'] = FALSE;\r\n }\r\n\r\n if($this->input->post('gsm_received_date') == '')\r\n {\r\n $data['inputerror'][] = 'gsm_received_date';\r\n $data['error_string'][] = 'GSM Received Date is required';\r\n $data['status'] = FALSE;\r\n }\r\n\r\n if($this->input->post('gsm_received_by') == '')\r\n {\r\n $data['inputerror'][] = 'gsm_received_by';\r\n $data['error_string'][] = 'GSM Received By is required';\r\n $data['status'] = FALSE;\r\n }\r\n\r\n if($data['status'] === FALSE)\r\n {\r\n echo json_encode($data);\r\n exit();\r\n }\r\n }", "protected function prepareForValidation() {\n\n // converting date and hour to datetime\n if ($this->has(['start_date', 'start_time'])) {\n $start_datetime = Carbon::createFromFormat('Y-m-d H:i', $this->input('start_date').\" \".$this->input('start_time'));\n $start_datetime->setTimezone('Europe/London');\n $this->merge(['start_date' => $start_datetime]);\n }\n\n if ($this->has(['end_date', 'end_time'])) {\n $end_datetime = Carbon::createFromFormat('Y-m-d H:i', $this->input('end_date').\" \".$this->input('end_time'));\n $this->merge(['end_date' => $end_datetime]);\n }\n\n if ($this->has('starting_bid')) {\n $this->merge(['starting_bid' => ceil($this->input('starting_bid') * 100)]);\n }\n\n // determine if minimum increment is percentage or fixed\n if ($this->has('increment_val')) {\n if ($this->has('percent_check') && $this->input('percent_check')) // percentual\n $this->merge(['increment_percent' => $this->input('increment_val')]);\n else // fixed\n $this->merge(['increment_fixed' => ceil($this->input('increment_val') * 100)]);\n }\n }", "private function validateFormData() {\n\n $this->firstName = $this->generalFieldValidation($this->firstName, \"firstName\", \"First name\", 40, false);\n $this->lastName = $this->generalFieldValidation($this->lastName, \"lastName\", \"Last name\", 40, false);\n $this->email = $this->generalFieldValidation($this->email, \"email\", \"E-mail\", 60, false);\n $this->address = $this->generalFieldValidation($this->address, \"address\", \"Address\", 255);\n $this->city = $this->generalFieldValidation($this->city, \"city\", \"City\", 60);\n $this->state = $this->generalFieldValidation($this->state, \"state\", \"State\", 2);\n $this->zip = $this->generalFieldValidation($this->zip, \"zip\", \"Zip code\", 5);\n $this->phone = $this->generalFieldValidation($this->phone, \"phone\", \"Phone number\", 10, false);\n $this->notes = $this->generalFieldValidation($this->notes, \"notes\", \"Notes\", -1, false);\n if ($this->phone !== \"\") {\n if (!is_numeric($this->phone)) {\n $this->errorArray[\"phone\"] = \"Phone number may only contain digits.\";\n } else {\n if (strlen($this->phone) < 10) {\n $this->errorArray[\"phone\"] = \"Phone number must contain 10 digits.\";\n }\n }\n }\n if ($this->zip !== \"\") {\n if (!is_numeric($this->zip)) {\n $this->errorArray[\"zip\"] = \"Zip code may only contain digits.\";\n } else {\n if (strlen($this->zip) !== 5) {\n $this->errorArray[\"zip\"] = \"Five digit zip code required.\";\n }\n }\n }\n if ($this->email !== \"\") {\n if (!preg_match(\"/^\\S+@\\S+\\.\\S+$/\", $this->email)) {\n $this->errorArray[\"email\"] = \"E-mail address is not valid.\";\n }\n }\n if (count($this->errorArray) === 0) {\n $this->passedValidation = true;\n }\n }", "public function __construct($data)\n {\n $this->id = $data[SubmissionStatus::FIELD_ID];\n $this->isValid = boolval($data[SubmissionStatus::FIELD_IS_VALID]);\n if(array_key_exists(SubmissionStatus::FIELD_PHOTOS, $data)) {\n $jsonPhotoErrors = $data[SubmissionStatus::FIELD_PHOTOS];\n $photoErrors = array();\n foreach ($jsonPhotoErrors as $jsonPhotoError) {\n array_push($photoErrors, new PhotoError($jsonPhotoError));\n }\n $this->photos = $photoErrors;\n }\n if(array_key_exists(SubmissionStatus::FIELD_GENERAL_ERRORS, $data)) {\n $this->generalErrors = $data[SubmissionStatus::FIELD_GENERAL_ERRORS];\n }\n }", "public function DataIsValid()\n {\n $bDataIsValid = parent::DataIsValid();\n if ($this->HasContent() && $bDataIsValid) {\n if (intval($this->data) < 12 && intval($this->data) >= -11) {\n $bDataIsValid = true;\n } else {\n $bDataIsValid = false;\n $oMessageManager = TCMSMessageManager::GetInstance();\n $sConsumerName = TCMSTableEditorManager::MESSAGE_MANAGER_CONSUMER;\n $sFieldTitle = $this->oDefinition->GetName();\n $oMessageManager->AddMessage($sConsumerName, 'TABLEEDITOR_FIELD_TIMEZONE_NOT_VALID', array('sFieldName' => $this->name, 'sFieldTitle' => $sFieldTitle));\n }\n }\n\n return $bDataIsValid;\n }", "function isDataValid() \n {\n return true;\n }", "protected function performValidation()\n {\n // no required arguments\n }", "public function updateCustomValidate(){\n if(!$this->addCustomValidate()){\n return false;\n }\n \n // Przy zmianie status na \"W rezerwie\", \"W stanie spoczynku\" lub \"Zmarły\",\n // żołnierz zostaje automatycznie oddelegowany z misji oraz usunięty ze szkolenia na których obecnie przebywał.\n if(in_array($this->id_status, array('2', '3', '4'))){\n \n }\n \n return true;\n }", "public function validateData(){\n\t\tif (!self::isEmailValid($this->email))\n\t\t\tthrow new Exception(\"Email address {$this->email} is not a valid email address.\");\n\n\t\tparent::validateData();\n\t}", "public function rules()\n {\n return [\n 'status' => 'required|integer',\n 'description' => 'required|min:5|unique_report',\n ];\n }", "function setFailedValidationStatusCode();", "public function validate() {\n if (!empty($this->value)) {\n parent::validate();\n }\n }", "public function validate() {\n if (!empty($this->value)) {\n parent::validate();\n }\n }", "public function validateUserStatus()\n {\n if (!$this->hasErrors() && ($user = $this->getUser()) && $user->isDisabled() && !$user->isOwner()) {\n $this->addError('status', Yii::t('skeleton', 'Your account is currently disabled. Please contact an administrator!'));\n }\n }", "function validate() {\n\t\t$this->_validationErrors = array();\n\t\tif (null === $this->getsession_id()) {\n\t\t\t$this->_validationErrors[] = 'session_id must not be null';\n\t\t}\n\t\tif (null === $this->getclassroom_id()) {\n\t\t\t$this->_validationErrors[] = 'classroom_id must not be null';\n\t\t}\n\t\tif (null === $this->getname()) {\n\t\t\t$this->_validationErrors[] = 'name must not be null';\n\t\t}\n\t\treturn 0 === count($this->_validationErrors);\n\t}", "public function validateData(){\n return true;\n }", "public function rules()\n {\n return [\n 'st'=>'required',\n 'point'=>'required_if:status,0,1',\n 'status'=>'required_if:status,0|in:1,2',\n 'reason'=>'required_if:st,2',\n ];\n }", "public function rules()\n {\n\n $rules = [\n 'client_work_history_id' => 'required',\n 'employment_status_id' => 'required',\n 'position_id' => 'required',\n 'branch_id' => 'required',\n 'status' => 'required|alpha'\n ];\n\n if ($this->hasMethod('PUT')) {\n $deployment = $this->segment(4) ? BranchWorkHistory::find($this->segment(4)) : NULL;\n\n if ($deployment) {\n $rules['reason_id'] = ['required', Rule::unique(branch_work_histories)->ignore($deployment->id)];\n $rules['employment_status_id'] = ['required', Rule::unique(branch_work_histories)->ignore($deployment->id)];\n $rules['reason_for_leaving_remarks'] = ['required', 'alpha_dash', Rule::unique(branch_work_histories)->ignore($deployment->id)];\n $rules['date_end'] = ['required', Rule::unique(branch_work_histories)->ignore($deployment->id)];\n }\n } else {\n $rules['reason_id'] = 'required';\n $rules['employment_status_id'] = 'required';\n $rules['reason_for_leaving_remarks'] = 'required|unique:branch_work_histories|alpha_dash';\n $rules['date_end'] = 'required';\n }\n\n return $rules;\n }", "public function rules()\n\t{\n\t\treturn array(\n\t\t\tarray('id,employee_id,status_type,support_city,wage_city,start_date,end_date,supportInfo','safe'),\n array('employee_id','required'),\n array('support_city,start_date','required'),\n array('employee_id','validateName'),\n array('supportInfo','validateDetail'),\n\t\t);\n\t}", "protected function preValidate() {}", "function validate( $data = FALSE )\r\n {\r\n // validate $data['status']. \"publish\" or \"drawt\" are accepted\r\n if( isset($data['status']) && ( ($data['status'] < 0) || ($data['status'] > 2) ) )\r\n {\r\n trigger_error(\"Wrong 'status' variable: \".$data['status'].\" Only 2 = 'publish' or 1 = 'drawt' are accepted.\\nFILE: \".__FILE__.\"\\nLINE: \".__LINE__, E_USER_ERROR);\r\n return SF_NO_VALID_ACTION;\r\n } \r\n // check if node exists\r\n if(isset($data['node']) && !file_exists(SF_BASE_DIR . 'data/navigation/'.$data['node']))\r\n {\r\n $this->B->$data['error'] = 'Node '.$data['node'].' dosent exists';\r\n return SF_NO_VALID_ACTION; \r\n } \r\n \r\n return SF_IS_VALID_ACTION;\r\n }", "public function rules() {\n\t\treturn [\n\t\t\t'institute_id' => 'sometimes|institute',\n\t\t\t'plan_status' => 'sometimes|in:' . implode(',', $this->planStatus),\n\t\t];\n\t}", "function validation($data){\n $errors= array();\n if ($foundcourses = get_records('course', 'shortname', $data['shortname'])) {\n if (!empty($data['id'])) {\n unset($foundcourses[$data['id']]);\n }\n if (!empty($foundcourses)) {\n foreach ($foundcourses as $foundcourse) {\n $foundcoursenames[] = $foundcourse->fullname;\n }\n $foundcoursenamestring = implode(',', $foundcoursenames);\n $errors['shortname']= get_string('shortnametaken', '', $foundcoursenamestring);\n }\n }\n\n if (empty($data['enrolenddisabled'])){\n if ($data['enrolenddate'] <= $data['enrolstartdate']){\n $errors['enroldateendgrp'] = get_string('enrolenddaterror');\n }\n }\n\n if (0 == count($errors)){\n return true;\n } else {\n return $errors;\n }\n }", "protected function postValidation()\n {\n if (Tools::isSubmit('btnSubmit')) {\n if (!Tools::getValue('SEND_SMS_API')) {\n $this->postErrors[] = $this->l('API Key is required.');\n }\n if (Tools::getValue('SEND_SMS_API')) {\n $isapiKey = $this->isValidAPIKey(Tools::getValue('SEND_SMS_API'));\n if ($isapiKey->status != 'success') {\n $this->postErrors[] = $this->l('API Key is not valid.');\n }\n }\n if (!Tools::getValue('ADMIN_MOBILE')) {\n $this->postErrors[] = $this->l('Admin Mobile Number is required.');\n }\n if (Tools::getValue('ADMIN_MOBILE')) {\n $isvalid = preg_match('/^[0-9]*$/', Tools::getValue('ADMIN_MOBILE'));\n if ($isvalid == false) {\n $this->postErrors[] = $this->l('Admin Mobile Number is not valid.');\n }\n }\n }\n }", "public function validate() {\n if (!$this->_data) {\n return false;\n }\n\n $fields = $this->getFields();\n $messages = $this->getMessages();\n\n foreach ($this->_data as $field => $value) {\n if (empty($this->_rules[$field])) {\n continue;\n }\n\n foreach ($this->_rules[$field] as $rule => $params) {\n $options = $params['options'];\n $arguments = $options;\n array_unshift($arguments, $value);\n\n // Use G11n if it is available\n if (class_exists('Titon\\G11n\\Utility\\Validate')) {\n $class = 'Titon\\G11n\\Utility\\Validate';\n } else {\n $class = 'Titon\\Utility\\Validate';\n }\n\n if (!call_user_func(array($class, 'hasMethod'), $rule)) {\n throw new InvalidValidationRuleException(sprintf('Validation rule %s does not exist', $rule));\n }\n\n // Prepare messages\n $message = $params['message'];\n\n if (!$message && isset($messages[$rule])) {\n $message = $messages[$rule];\n }\n\n if ($message) {\n $message = String::insert($message, array_map(function($value) {\n return is_array($value) ? implode(', ', $value) : $value;\n }, $options + array(\n 'field' => $field,\n 'title' => $fields[$field]\n )));\n } else {\n throw new InvalidValidationRuleException(sprintf('Error message for rule %s does not exist', $rule));\n }\n\n if (!call_user_func_array(array($class, $rule), $arguments)) {\n $this->addError($field, $message);\n break;\n }\n }\n }\n\n return empty($this->_errors);\n }", "public function validateCreateSegment($data)\n {\n self::$rules = [\n 'name' => 'required',\n 'event_id' => 'required|exists:fedEvent,id,run,0',\n 'type' => 'required|in:1v1,1v1v1,1v1v1v1,1v1v1v1v1,1v1v1v1v1v1,2v2,2v2v2,2v2v2v2,3v3,4v4,5v5,2v1,3v2,10,20,30,0',\n 'wrestler' => 'required_unless:type,0|array|wrestlers_match',\n 'wrestler.*' => 'exists:wrestler,id,activated,1'\n ];\n $this->validate($data);\n }", "public function check() {\n $field = null;\n $this->_errors = [];\n $fields = $this->_getField();\n\n foreach ($this->_constraints as $constraints) {\n foreach ($fields as $value) {\n switch ($constraints['type']) {\n case self::EQUAL:\n if ($value != $constraints['value']) {\n array_push($this->_errors, ['name' => $this->_field, 'field' => $this->_label, 'message' => $constraints['message']]);\n }\n break;\n\n case self::DIFFERENT:\n if ($value == $constraints['value']) {\n array_push($this->_errors, ['name' => $this->_field, 'field' => $this->_label, 'message' => $constraints['message']]);\n }\n break;\n\n case self::MORETHAN:\n if ($value <= $constraints['value']) {\n array_push($this->_errors, ['name' => $this->_field, 'field' => $this->_label, 'message' => $constraints['message']]);\n }\n break;\n\n case self::LESSTHAN:\n if ($value >= $constraints['value']) {\n array_push($this->_errors, ['name' => $this->_field, 'field' => $this->_label, 'message' => $constraints['message']]);\n }\n break;\n\n case self::BETWEEN:\n if ($value < $constraints['value'][0] || $value > $constraints['value'][1]) {\n array_push($this->_errors, ['name' => $this->_field, 'field' => $this->_label, 'message' => $constraints['message']]);\n }\n break;\n\n case self::IN:\n if (!in_array($value, $constraints['value'])) {\n array_push($this->_errors, ['name' => $this->_field, 'field' => $this->_label, 'message' => $constraints['message']]);\n }\n break;\n\n case self::NOTIN:\n if (in_array($value, $constraints['value'])) {\n array_push($this->_errors, ['name' => $this->_field, 'field' => $this->_label, 'message' => $constraints['message']]);\n }\n break;\n\n case self::LENGTH:\n if (strlen($value) != $constraints['value']) {\n array_push($this->_errors, ['name' => $this->_field, 'field' => $this->_label, 'message' => $constraints['message']]);\n }\n break;\n\n case self::LENGTHMIN:\n if (strlen($value) < $constraints['value']) {\n array_push($this->_errors, ['name' => $this->_field, 'field' => $this->_label, 'message' => $constraints['message']]);\n }\n break;\n\n case self::LENGTHMAX:\n if (strlen($value) > $constraints['value']) {\n array_push($this->_errors, ['name' => $this->_field, 'field' => $this->_label, 'message' => $constraints['message']]);\n }\n break;\n\n case self::LENGTHIN:\n if (!in_array(strlen($value), $constraints['value'])) {\n array_push($this->_errors, ['name' => $this->_field, 'field' => $this->_label, 'message' => $constraints['message']]);\n }\n break;\n\n case self::LENGTHBETWEEN:\n if (strlen($value) < $constraints['value'][0] || strlen($value) > $constraints['value'][1]) {\n array_push($this->_errors, ['name' => $this->_field, 'field' => $this->_label, 'message' => $constraints['message']]);\n }\n break;\n\n case self::REGEX:\n if (!preg_match($constraints['value'], $value)) {\n array_push($this->_errors, ['name' => $this->_field, 'field' => $this->_label, 'message' => $constraints['message']]);\n }\n break;\n\n case self::URL:\n if (!filter_var($value, FILTER_VALIDATE_URL)) {\n array_push($this->_errors, ['name' => $this->_field, 'field' => $this->_label, 'message' => $constraints['message']]);\n }\n break;\n\n case self::MAIL:\n if (!filter_var($value, FILTER_VALIDATE_EMAIL)) {\n array_push($this->_errors, ['name' => $this->_field, 'field' => $this->_label, 'message' => $constraints['message']]);\n }\n break;\n\n case self::INT:\n if (!filter_var($value, FILTER_VALIDATE_INT)) {\n array_push($this->_errors, ['name' => $this->_field, 'field' => $this->_label, 'message' => $constraints['message']]);\n }\n break;\n\n case self::FLOAT:\n if (!filter_var($value, FILTER_VALIDATE_FLOAT)) {\n array_push($this->_errors, ['name' => $this->_field, 'field' => $this->_label, 'message' => $constraints['message']]);\n }\n break;\n\n case self::ALPHA:\n if (!preg_match('#^([a-zA-Z]+)$#', $value)) {\n array_push($this->_errors, ['name' => $this->_field, 'field' => $this->_label, 'message' => $constraints['message']]);\n }\n break;\n\n case self::ALPHANUM:\n if (!preg_match('#^([a-zA-Z0-9]+)$#', $value)) {\n array_push($this->_errors, ['name' => $this->_field, 'field' => $this->_label, 'message' => $constraints['message']]);\n }\n break;\n\n case self::ALPHADASH:\n if (!preg_match('#^([a-zA-Z0-9_-]+)$#', $value)) {\n array_push($this->_errors, ['name' => $this->_field, 'field' => $this->_label, 'message' => $constraints['message']]);\n }\n break;\n\n case self::IP:\n if (!filter_var($value, FILTER_VALIDATE_IP)) {\n array_push($this->_errors, ['name' => $this->_field, 'field' => $this->_label, 'message' => $constraints['message']]);\n }\n break;\n\n case self::SQL:\n /** @var $value \\Gcs\\Framework\\Core\\Orm\\Entity\\Entity */\n\n $sql = new Sql();\n $sql->query('query-form-validation', $constraints['value']['query']);\n $sql->vars('value', $value);\n\n if (count($constraints['value']['vars']) > 0) {\n $sql->vars($constraints['value']['vars']);\n }\n\n $data = $sql->fetch('query-form-validation', Sql::PARAM_FETCHCOLUMN);\n\n $querySuccess = true;\n\n switch ($constraints['value']['constraint']) {\n case '==':\n if ($data != $constraints['value']['value']) {\n $querySuccess = false;\n }\n break;\n\n case '!=':\n if ($data == $constraints['value']['value']) {\n $querySuccess = false;\n }\n break;\n\n case '>':\n if ($data <= $constraints['value']['value']) {\n $querySuccess = false;\n }\n break;\n\n case '<':\n if ($data >= $constraints['value']['value']) {\n $querySuccess = false;\n }\n break;\n }\n\n if (!$querySuccess) {\n array_push($this->_errors, ['name' => $this->_field, 'field' => $this->_label, 'message' => $constraints['message']]);\n }\n break;\n\n case self::CUSTOM:\n /** @var object[] $constraints */\n if ($constraints['value']->filter() == false) {\n array_push($this->_errors, ['name' => $this->_field, 'field' => $this->_label, 'message' => $constraints['value']->error()]);\n }\n break;\n }\n }\n\n switch ($constraints['type']) {\n case self::COUNT:\n if (count($fields) != $constraints['value']) {\n array_push($this->_errors, ['name' => $this->_field, 'field' => $this->_label, 'message' => $constraints['message']]);\n }\n break;\n\n case self::COUNTMIN:\n if (count($fields) < $constraints['value']) {\n array_push($this->_errors, ['name' => $this->_field, 'field' => $this->_label, 'message' => $constraints['message']]);\n }\n break;\n\n case self::COUNTMAX:\n if (count($fields) > $constraints['value']) {\n array_push($this->_errors, ['name' => $this->_field, 'field' => $this->_label, 'message' => $constraints['message']]);\n }\n break;\n\n case self::COUNTIN:\n /** @var array $constraints */\n if (!in_array(count($fields), $constraints['value'])) {\n array_push($this->_errors, ['name' => $this->_field, 'field' => $this->_label, 'message' => $constraints['message']]);\n }\n break;\n\n case self::EXIST:\n if (count($fields) == 1 && $fields[0] == null) {\n array_push($this->_errors, ['name' => $this->_field, 'field' => $this->_label, 'message' => $constraints['message']]);\n }\n break;\n\n case self::NOTEXIST:\n if (count($fields) == 1 && $fields[0] != null) {\n array_push($this->_errors, ['name' => $this->_field, 'field' => $this->_label, 'message' => $constraints['message']]);\n }\n break;\n }\n }\n }", "protected function setupValidation()\n {\n }", "abstract public function validateData($data);", "protected function checkStructure()\n {\n $structure = $this->getStructure();\n\n foreach ($structure as $field => $opt) {\n if (!array_key_exists($field, $this->data)) {\n continue;\n }\n\n $value = Arr::get($this->data, $field);\n if (is_array($value)) {\n $this->errors[$field][] = Translate::get('validate_wrong_type_data');\n continue;\n }\n\n $value = trim($value);\n $length = (int)$opt->length;\n\n if (!empty($length)) {\n $len = mb_strlen($value);\n if ($len > $length) {\n $this->errors[$field][] = Translate::getSprintf('validate_max_length', $length);\n continue;\n }\n }\n\n if (!$opt->autoIncrement && $opt->default === NULL && !$opt->allowNull && $this->isEmpty($value)) {\n $this->errors[$field][] = Translate::get('validate_not_empty');\n continue;\n }\n\n switch ($opt->dataType) {\n case 'int':\n case 'bigint':\n if (!$this->isEmpty($value) && (filter_var($value, FILTER_VALIDATE_INT) === false)) {\n $this->errors[$field][] = Translate::get('validate_int');\n continue 2;\n }\n break;\n\n case 'double':\n if (!is_float($value) && !$this->isEmpty($value)) {\n $this->errors[$field][] = Translate::get('validate_double');\n continue 2;\n }\n break;\n\n case 'float':\n if (!is_numeric($value) && !$this->isEmpty($value)) {\n $this->errors[$field][] = Translate::get('validate_float');\n continue 2;\n }\n break;\n\n case 'date':\n case 'datetime':\n case 'timestamp':\n if (!$this->isEmpty($value) && !Validate::dateSql($value)) {\n $this->errors[$field][] = Translate::get('validate_sql_date');\n continue 2;\n }\n break;\n\n default:\n continue 2;\n break;\n\n }\n }\n }", "protected static function set_status()\n {\n }", "public function rules()\n {\n return [\n 'document' => 'required',\n 'status' => 'required'\n ];\n }", "protected function validate(&$data,$nonce_name) {\n\t\tglobal $wpdb;\n\t\t$is_valid = parent::validate($data,$nonce_name);\n\t\tif($is_valid && is_array($data)) {\n\t\t\t$is_valid = true ;\n\t\t\t// Check if date is empty\n\t\t\tif(empty($data[\"event_start_date\"])) {\n\t\t\t\t$is_valid = false ;\n\t\t\t\t$this->add_db_result(\"event_start_date\",\"required\",\"Start Date is missing\");\n\t\t\t}\n\t\t\t// Check if date format is valid\n\t\t\telse if($data[\"event_start_date\"] === null) {\n\t\t\t\t$is_valid = false ;\n\t\t\t\t$this->add_db_result(\"event_start_date\",\"field\",\"Start Date format is not valid\");\n\t\t\t}\n\t\t\t// Multi Day Event\n\t\t\t// Check if date format is valid\n\t\t\tif($data[\"event_end_date\"] === null) {\n\t\t\t\t$is_valid = false ;\n\t\t\t\t$this->add_db_result(\"event_end_date\",\"field\",\"End Date is missing\");\n\t\t\t}\n\t\t\t// Check if start date is lower\\equel to end date \n\t\t\tif(!empty($data[\"event_start_date\"]) && !empty($data[\"event_end_date\"])) {\n\t\t\t\tif(strtotime($data[\"event_start_date\"]) > strtotime($data[\"event_end_date\"])) {\n\t\t\t\t\t$is_valid = false ;\n\t\t\t\t\t$this->add_db_result(\"event_end_date\",\"required\",\"Event can't end before it starts\");\n\t\t\t\t}\n\t\t\t} \n\t\t\t\n\t\t\tif(isset($data[\"event_tour_id\"])) {\n\t\t\t\tif(!is_numeric($data[\"event_tour_id\"])) {\n\t\t\t\t\t$is_valid = false;\n\t\t\t\t\t$this->add_db_result(\"event_tour_id\",\"required\",\"Tour information is invalid\");\t\n\t\t\t\t} \n\t\t\t} else {\n\t\t\t\t$tour_name = trim($data[\"tour_name\"]); \n\t\t\t\tif(!empty($tour_name) && !is_numeric($tour_name)) {\n\t\t\t\t\t$is_tour = $wpdb->get_row(\"SELECT tour_id FROM \".WORDTOUR_TOUR.\" WHERE UPPER(tour_name)='\".trim(strtoupper($data[\"tour_name\"]).\"'\"),\"ARRAY_A\");\n\t\t\t\t\tif($is_tour) {\n\t\t\t\t\t\t$data[\"event_tour_id\"] = $is_tour[\"tour_id\"];\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$is_valid = false ;\n\t\t\t\t\t\t$this->add_db_result(\"tour_name\",\"required\",\"Tour '$data[tour_name]' doesn't exist\");\n\t\t\t\t\t}\n\t\t\t\t}\t\n\t\t\t}\n\t\t\n\t\t\tif(isset($data[\"event_venue_id\"])) {\n\t\t\t\tif(!is_numeric($data[\"event_venue_id\"])) {\n\t\t\t\t\t$is_valid = false;\n\t\t\t\t\t$this->add_db_result(\"event_venue_id\",\"required\",\"Venue information is invalid\");\t\n\t\t\t\t} \n\t\t\t} else {\n\t\t\t\tif(empty($data[\"venue_name\"])) {\n\t\t\t\t\t$is_valid = false ;\n\t\t\t\t\t$this->add_db_result(\"venue_name\",\"required\",\"Venue is missing\");\n\t\t\t\t} else if(!is_numeric($data[\"venue_name\"])) {\n\t\t\t\t\t$is_venue = $wpdb->get_row(\"SELECT venue_id FROM \".WORDTOUR_VENUES.\" WHERE UPPER(venue_name)='\".trim(strtoupper($data[\"venue_name\"]).\"'\"),\"ARRAY_A\");\n\t\t\t\t\tif($is_venue) {\n\t\t\t\t\t\t$data[\"event_venue_id\"] = $is_venue[\"venue_id\"];\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$is_valid = false ;\n\t\t\t\t\t\t$this->add_db_result(\"venue_name\",\"required\",\"Venue '$data[venue_name]' doesn't exist\");\n\t\t\t\t\t}\n\t\t\t\t}\t\n\t\t\t}\n\t\t\t\n\t\t\tif(isset($data[\"event_artist_id\"])) {\n\t\t\t\tif(!is_numeric($data[\"event_artist_id\"])) {\n\t\t\t\t\t$is_valid = false;\n\t\t\t\t\t$this->add_db_result(\"event_artist_id\",\"required\",\"Artist information is invalid\");\t\n\t\t\t\t} \n\t\t\t} else {\n\t\t\t\tif(empty($data[\"artist_name\"])) {\n\t\t\t\t\t$is_valid = false ;\n\t\t\t\t\t$this->add_db_result(\"artist_name\",\"required\",\"Artist is missing\");\n\t\t\t\t} else if(!is_numeric($data[\"artist_name\"])) {\n\t\t\t\t\t$is_artist = $wpdb->get_row(\"SELECT artist_id FROM \".WORDTOUR_ARTISTS.\" WHERE UPPER(artist_name)='\".trim(strtoupper($data[\"artist_name\"]).\"'\"),\"ARRAY_A\");\n\t\t\t\t\tif($is_artist) {\n\t\t\t\t\t\t$data[\"event_artist_id\"] = $is_artist[\"artist_id\"];\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$is_valid = false ;\n\t\t\t\t\t\t$this->add_db_result(\"artist_name\",\"required\",\"Artist '$data[artist_name]' doesn't exist\");\n\t\t\t\t\t}\n\t\t\t\t}\t\n\t\t\t}\n\t\t\t\n\t\t\tif(isset($data[\"event_more_artists\"])) {\n\t\t\t\t$more_artists = json_decode(stripslashes($data[\"event_more_artists\"]));\n\t\t\t\t$more_artists_exist_error = array();\n\t\t\t\t$more_artists_error = array();\n\t\t\t\t$more_artists_is_valid = 1;\n\t\t\t\t$more_artists_id = array();\n\t\t\t\tif(is_array($more_artists)) {\n\t\t\t\t\tforeach($more_artists as $artist_name) {\n\t\t\t\t\t\t$name = addslashes(trim(strtoupper($artist_name)));\n\t\t\t\t\t\tif(!empty($name)) {\n\t\t\t\t\t\t\t// check if artist exist in the system\n\t\t\t\t\t\t\t$is_artist = $wpdb->get_row($wpdb->prepare(\"SELECT artist_id FROM \".WORDTOUR_ARTISTS.\" WHERE UPPER(artist_name)='\".$name.\"'\"),\"ARRAY_A\");\n\t\t\t\t\t\t\t//print_r($wpdb);\n\t\t\t\t\t\t\tif(!$is_artist) {\n\t\t\t\t\t\t\t\t$is_valid = false ;\n\t\t\t\t\t\t\t\t$more_artists_is_valid = 0;\n\t\t\t\t\t\t\t\t$more_artists_exist_error[] = \"<i>'$artist_name'</i>\";\t\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tif($name == trim(strtoupper($data[\"artist_name\"]))) {\n\t\t\t\t\t\t\t\t\t$is_valid = false ;\n\t\t\t\t\t\t\t\t\t$more_artists_is_valid = 0;\n\t\t\t\t\t\t\t\t\t$more_artists_error[] = \"Additional Artist <i>'$artist_name'</i> is already assigned\";\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t$more_artists_id[] = $is_artist[\"artist_id\"]; \n\t\t\t\t\t\t\t\t}\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif(!$more_artists_is_valid) {\n\t\t\t\t\t\t$more_artists_msg = \"\"; \n\t\t\t\t\t\tif(count($more_artists_exist_error)>0) {\n\t\t\t\t\t\t\t$more_artists_msg.= \"Additional Artist \".implode(\", \",$more_artists_exist_error).\" doesn't exist, \";\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(count($more_artists_error)>0) {\n\t\t\t\t\t\t\t$more_artists_msg.= implode(\", \",$more_artists_error);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$this->add_db_result(\"event_more_artists\",\"required\",$more_artists_msg);\t\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$data[\"event_more_artists\"] = array_unique($more_artists_id);\n\t\t\t\t\t} \n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tif(!empty($data[\"tkts_url\"]) && !is_valid_url($data[\"tkts_url\"])) {\n\t\t\t\t$is_valid = false ;\n\t\t\t\t$this->add_db_result(\"tkts_url\",\"required\",\"Buy Tickt url in not valid, the required format is http://your_website_url\");\t\n\t\t\t}\n\t\t\t\n\t\t\tif(!$is_valid) $this->db_result(\"error\",null,array(\"data\"=>$this->db_response_msg));\t\t\n\t\t}\n\t\treturn $is_valid;\n\t}", "public function validate()\n {\n $validator = Validator::make($this->data, $this->fieldValidationArray());\n if ($validator->fails()) {\n throw $this->validationException(join(\", \", $validator->errors()->all()));\n }\n\n /* if there's a script, check that the script will return the right type .*/\n if (isset($this->data[\"script\"])) {\n if ($this->recordType == null) {\n throw $this->validationException(\"Script can't be tested because the field doesn't belong to a record type.\");\n }\n try {\n $script = $this->getScript($this->recordType);\n if ($script->type() != $this->data[\"type\"]) {\n throw $this->validationException(\"Script should return a '\" . $this->data[\"type\"] . \"' but returned a \" . $script->type());\n }\n } catch (ScriptException $e) {\n throw $this->validationException(\"Script has a problem: \" . $e->getMessage());\n }\n }\n }", "public static function validateLives_With_Worker_DataForArrayConstraintsFromSetLives_With_Worker_Data(array $values = array())\n {\n $message = '';\n $invalidValues = [];\n foreach ($values as $dependent_DataTypeLives_With_Worker_DataItem) {\n // validation for constraint: itemType\n if (!$dependent_DataTypeLives_With_Worker_DataItem instanceof \\WorkdayWsdl\\\\StructType\\Lives_With_Worker_DataType) {\n $invalidValues[] = is_object($dependent_DataTypeLives_With_Worker_DataItem) ? get_class($dependent_DataTypeLives_With_Worker_DataItem) : sprintf('%s(%s)', gettype($dependent_DataTypeLives_With_Worker_DataItem), var_export($dependent_DataTypeLives_With_Worker_DataItem, true));\n }\n }\n if (!empty($invalidValues)) {\n $message = sprintf('The Lives_With_Worker_Data property can only contain items of type \\WorkdayWsdl\\\\StructType\\Lives_With_Worker_DataType, %s given', is_object($invalidValues) ? get_class($invalidValues) : (is_array($invalidValues) ? implode(', ', $invalidValues) : gettype($invalidValues)));\n }\n unset($invalidValues);\n return $message;\n }", "function validate(){\n $errors = array();\n\n // throw message indicating that this field is numeric\n if( $this->post->isNumeric('noOfTransactions')==false){\n $errors[] = $this->Raxan->locale(\"request.missing.transcount\");\n }\n // throw message indicating that this field is date\n if( $this->post->isDate(\"startDate\",\"Y-m-d\" )==false){\n $errors[] = $this->Raxan->locale(\"request.missing.startdate\");\n }\n // throw message indicating that this field is date\n if( $this->post->isDate( \"endDate\",\"Y-m-d\" )==false ){\n $errors[] = $this->Raxan->locale(\"request.missing.enddate\");\n }\n\n if(!empty ($errors)) {\n $this->postMessage($errors, \"Request History\");\n }\n return (count($errors) == 0);\n }", "protected function postValidation()\n {\n $errors = array();\n\n // \"Length of reference\" field.\n if (!($length = Tools::getValue('ORDERREF_LENGTH'))) {\n $errors[] = $this->l('The \"Length of reference\" field is required.');\n }\n elseif (!Validate::isInt($length)) {\n $errors[] = $this->l('The \"Length of reference\" field must be an integer number.');\n }\n elseif (!($length >= self::ORDERREF_LENGTH_MIN && $length <= self::ORDERREF_LENGTH_MAX)) {\n $errors[] = $this->l('The \"Length of reference\" field limits exceed. Value must be between')\n . ' ' . self::ORDERREF_LENGTH_MIN . ' '\n . $this->l('and')\n . ' ' . self::ORDERREF_LENGTH_MAX;\n }\n \n // \"How to generate\" field.\n if (!($mode = Tools::getValue('ORDERREF_MODE'))) {\n $errors[] = $this->l('The \"How to generate order references\" field is required.');\n }\n elseif (!(Validate::isInt($mode) &&\n ($mode == self::ORDERREF_MODE_RANDOM\n || $mode == self::ORDERREF_MODE_CONSEQUENT\n || $mode == self::ORDERREF_MODE_PS))) {\n $errors[] = $this->l('The \"How to generate order references\" field has illegal value.');\n }\n\n return $errors;\n }", "public function validate($configData);", "protected function fine_validation()\n {\n if (is_superadmin_loggedin()) {\n $this->form_validation->set_rules('branch_id', translate('branch'), 'required');\n }\n $this->form_validation->set_rules('group_id', translate('group_name'), 'trim|required');\n $this->form_validation->set_rules('fine_type_id', translate('fees_type'), 'trim|required|callback_check_feetype');\n $this->form_validation->set_rules('fine_type', translate('fine_type'), 'trim|required');\n $this->form_validation->set_rules('fine_value', translate('fine') . \" \" . translate('value'), 'trim|required|numeric|greater_than[0]');\n $this->form_validation->set_rules('fee_frequency', translate('late_fee_frequency'), 'trim|required');\n }", "function validates(){\n\t\t\tif($this->RequestHandler->isAjax()==true){ \n\t\t\t//echo \"<pre>\"; print_r($this->params); die;\n\t\t\t//echo \"<pre>\"; print_r($this->params); die;\n\t\t\t$logArray = $this->params['form'];\n\t\t\tif($logArray['log_entry']=='accepted'){\n\t\t\t\t$log_entry = 'scenario_accepted';\n\t\t\t\t$state = '5';\n\t\t\t}elseif($logArray['log_entry']=='rejected'){\n\t\t\t\t$log_entry = 'scenario_rejected';\n\t\t\t\t$state = '6';\n\t\t\t}\n\t\t\t$datatosave = array();\n\t\t\t\t\t$datatosave = array (\n\t\t\t\t\t\t\t'Log' => array (\n\t\t\t\t\t\t\t'affected_obj' => $this->params['pass'][0],\n\t\t\t\t\t\t\t'log_entry' => $log_entry,\n\t\t\t\t\t\t\t'created' => date('Y-m-d H:i:s'),\n\t\t\t\t\t\t\t'status' => 1,\n\t\t\t\t\t\t\t'customer_id' => $logArray['cust_id'],\n\t\t\t\t\t\t\t'bsk' => $this->Session->read('BSK'),\n\t\t\t\t\t\t\t'user' => $this->Session->read('ACCOUNTNAME'),\n\t\t\t\t\t\t\t'app_type' => 'Gate',\n\t\t\t\t\t\t\t'modified' => '0000-00-00 00:00:00',\n\t\t\t\t\t\t\t'modification_status' => 1,\n\t\t\t\t\t\t\t'modification_response' => $logArray['comment']\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t\t\t$this->Log->create();\n\t\t\t\t$this->Log->save($datatosave);\n\t\t\t\t$this->Scenario->updateAll(\n\t\t\t\t\t\t\tarray('Scenario.status' => \"'\".$state.\"'\"),\n\t\t\t\t\t\t\tarray('Scenario.id' => $this->params['pass'][0])\n\t\t\t\t);\n\t\t\t\techo $log_entry; die;\n\t\n\t\t}\n\t}", "function validate() {\n $errorMsg = array(); //variable store error messages\n $result = 1;\n\n for ($i = 0; $i < $this->id; $i++) {\n $errorMsg [$this->check_vars [$i] ['controler_name']] = \"\";\n }\n\n for ($i = 0; $i < $this->id; $i++) {\n if (strlen($errorMsg [$this->check_vars [$i] ['controler_name']])) {\n continue;\n }\n $postVar = $this->check_vars [$i] ['data'];\n $authType = $this->check_vars [$i] ['authtype'];\n\n if ($this->check_vars [$i] ['error'] == \"\" || $this->check_vars [$i] ['error'] == \" \") {\n $error = $lang->INVALID;\n } else {\n $error = $this->check_vars [$i] ['error'];\n }\n\n $pos = strpos($authType, '=');\n if ($pos !== false) {\n $authType = substr($this->check_vars [$i] ['authtype'], 0, $pos);\n $value = substr($this->check_vars [$i] ['authtype'], $pos + 1);\n }\n\n switch ($authType) {\n //check whether field is required or not\n case \"required\" : {\n if (is_array($postVar)) {\n $count = count($postVar);\n\n for ($j = 0; $j < $count; $j++) {\n $length = strlen(trim($postVar [$j]));\n if (!$length) {\n $errorMsg [$this->check_vars [$i] ['controler_name']] .= $error . \" :File \" . ($j + 1);\n }\n }\n } elseif (isset($postVar) && empty($postVar)) {\n $length = strlen(trim($postVar));\n\n if (!$length) {\n $errorMsg [$this->check_vars [$i] ['controler_name']] .= $error;\n }\n } else {\n $length = strlen(trim($postVar));\n\n if (!$length) {\n $errorMsg [$this->check_vars [$i] ['controler_name']] .= $error;\n }\n }\n break;\n }\n //validate for name\n case \"csvname\": {\n\n $regexp = '/^[a-zA-Z ]+[a-zA-Z]*$/';\n\n if (!preg_match($regexp, trim($postVar))) {\n $length = strlen(trim($postVar));\n\n if ($length)\n $errorMsg [$this->check_vars [$i] ['controler_name']] .= $error;\n }\n break;\n }\n\n //validate field only contains alpha characters only\n case \"alphabets\" : {\n $regexp = '/^[A-za-z]*$/';\n //echo trim ( $postVar );die;\n //echo \"hello\";die;\n if (!preg_match($regexp, trim($postVar))) {\n\n $length = strlen(trim($postVar));\n\n if ($length)\n $errorMsg [$this->check_vars [$i] ['controler_name']] .= $error;\n }\n break;\n }\n\n //validate field only contains alphanumeric characters only\n case \"alphanumeric\" : {\n $regexp = '/^[A-za-z0-9]*$/';\n if (!preg_match($regexp, trim($postVar))) {\n $length = strlen(trim($postVar));\n\n if ($length)\n $errorMsg [$this->check_vars [$i] ['controler_name']] .= $error;\n }\n break;\n }\n\n //validate field only contains numeric characters only\t\n case \"numeric\" : {\n $regexp = '/^[0-9]*$/';\n if (!preg_match($regexp, trim($postVar))) {\n $length = strlen(trim($postVar));\n\n if ($length)\n $errorMsg [$this->check_vars [$i] ['controler_name']] .= $error;\n }\n break;\n }\n\n //validate field max character limit\t\n case \"maxlength\" : {\n $length = strlen(trim($postVar));\n\n if ($length > $value)\n $errorMsg [$this->check_vars [$i] ['controler_name']] .= $error;\n\n break;\n }\n\n //validate field min character limit\n case \"minlength\" : {\n $length = strlen(trim($postVar));\n\n if ($length < $value && $length != 0)\n $errorMsg [$this->check_vars [$i] ['controler_name']] .= $error;\n\n break;\n }\n\n //validate username field ...it can contain alphanumeric without any spaces\n case \"username\" : {\n $regexp1 = '/^[0-9]$/';\n $regexp2 = '/^[a-zA-Z]+[a-zA-Z0-9\\.\\_]*[a-zA-Z0-9]+$/';\n\n if (!preg_match($regexp1, trim($postVar)) && !preg_match($regexp2, trim($postVar))) {\n $length = strlen(trim($postVar));\n\n if ($length)\n $errorMsg [$this->check_vars [$i] ['controler_name']] .= $error;\n }\n break;\n }\n\n //checks for script tags\n case \"script\" : {\n $regexp1 = '/(<([^>]+)>)/i';\n if (!preg_match($regexp1, trim($postVar))) {\n $length = strlen(trim($postVar));\n\n if ($length)\n $errorMsg [$this->check_vars [$i] ['controler_name']] .= $error;\n }\n break;\n }\n\n //validates form address field\n case \"address\" : {\n $regexp = '/^[a-zA-Z0-9]+.*$/';\n if (!preg_match($regexp, trim($postVar))) {\n $length = strlen(trim($postVar));\n\n if ($length)\n $errorMsg [$this->check_vars [$i] ['controler_name']] .= $error;\n }\n break;\n }\n\n //validates for counting chrecters only, in string\n case \"spaceCheck\": {\n $foo = preg_replace('/\\s+/', '', $postVar);\n if (strlen($foo) < $value) {\n $errorMsg [$this->check_vars [$i] ['controler_name']] .= $error;\n }\n break;\n }\n\n //validates for colorcodes\n\n case \"colorCode\": {\n $regexp = \"/^#[abcdef 0-9]{6}/\";\n if (!preg_match($regexp, trim($postVar))) {\n $length = strlen(trim($postVar));\n\n if ($length)\n $errorMsg [$this->check_vars [$i] ['controler_name']] .= $error;\n }\n break;\n }\n //validates phone field\n case \"phone\" : {\n if (isset($value)) {\n $found = strpos($value, ',');\n\n if ($found === false) {\n $options [0] = $value;\n } else {\n $options = explode(\",\", $value);\n }\n }\n\n $patternMatch = 0;\n foreach ($options as $opt) {\n $type = $this->availablePhoneType($opt);\n\n foreach ($type as $regexp) {\n if (preg_match($regexp, $postVar)) {\n $patternMatch = 1;\n }\n }\n if ($patternMatch)\n break;\n }\n\n if (!$patternMatch) {\n $length = strlen(trim($postVar));\n if ($length) {\n $errorMsg [$this->check_vars [$i] ['controler_name']] .= $error;\n }\n }\n break;\n }\n\n //validates mobile field\t\n case \"mobile\" : {\n $regexp1 = '/^[0-9]{10}$/';\n // (+91)1111111111\n $regexp2 = '/^[\\(][\\+][0-9]{2}[\\)][0-9]{10}$/';\n // +911111111111\n $regexp3 = '/^[\\+][0-9]{2}[0-9]{10}$/';\n // 1-1111111111\n $regexp4 = '/^[0-9]{2}[\\-][0-9]{10}$/';\n\n if (!preg_match($regexp1, trim($postVar)) && !preg_match($regexp2, trim($postVar)) && !preg_match($regexp3, trim($postVar)) && !preg_match($regexp4, trim($postVar))) {\n $length = strlen(trim($postVar));\n\n if ($length)\n $errorMsg [$this->check_vars [$i] ['controler_name']] .= $error;\n }\n break;\n }\n\n //validates emial field\t\n case \"email\" : {\n $regexp = '/^[A-Za-z]+((\\.|\\_){1}[a-zA-Z0-9]+)*@([a-zA-Z0-9]+([\\-]{1}[a-zA-Z0-9]+)*[\\.]{1})+[a-zA-Z]{2,4}$/';\n if (!preg_match($regexp, trim($postVar))) {\n $length = strlen(trim($postVar));\n\n if ($length) {\n $errorMsg [$this->check_vars [$i] ['controler_name']] .= $error;\n }\n }\n break;\n }\n\n //validates url field\n case \"url\" : {\n $regexp = '|^http(s)?://[a-z0-9-]+(\\.[a-z0-9-]+)*(:[0-9]+)?(/.*)?$|i';\n if (!preg_match($regexp, trim($postVar))) {\n $length = strlen(trim($postVar));\n\n if ($length) {\n $errorMsg [$this->check_vars [$i] ['controler_name']] .= $error;\n }\n }\n break;\n }\n\n //validates date field\n case \"date\" : {\n $errorMsg [$this->check_vars [$i] ['controler_name']] .= $this->validateDate(trim($postVar), $value, $error);\n break;\n }\n\n //validates password match\n case \"match\" : {\n $data = explode(\"#\", $postVar);\n if (count($data) == 2) {\n if ($data[0] != $data[1]) {\n $errorMsg [$this->check_vars [$i] ['controler_name']] .= $error;\n break;\n }\n }\n }\n\n //validates datatype of field\n case \"datatype\" : {\n $limit = explode(',', $value);\n if ($limit[0] == \"int\") {\n $regexp = '/^[0-9]{' . $limit[1] . '}$/';\n\n if (!preg_match($regexp, trim($postVar))) {\n $length = strlen(trim($postVar));\n\n if ($length) {\n $errorMsg [$this->check_vars [$i] ['controler_name']] .= $error;\n }\n }\n }\n\n if ($limit[0] == \"float\") {\n $regexp = '/^[0-9]{' . $limit[1] . '}.[0-9]{' . $limit[2] . '}$/';\n if (!preg_match($regexp, trim($postVar))) {\n $length = strlen(trim($postVar));\n if ($length) {\n $errorMsg [$this->check_vars [$i] ['controler_name']] .= $error;\n }\n }\n }\n\n if ($limit[0] == \"bool\") {\n $result = is_bool($postVar);\n }\n\n if ($limit[0] == \"null\") {\n $result = is_null($postVar);\n }\n\n if (!$result) {\n $errorMsg [$this->check_vars [$i] ['controler_name']] .= $error;\n }\n break;\n }\n\n //validates filetype of field\n case \"ftype\": {\n $errorMsg .= $this->validateFileType($postVar, $value, $error);\n break;\n }\n //validates filesize\n case \"fsize\": {\n $errorMsg .= $this->validateFileSize($postVar, $value, $error);\n break;\n }\n case \"custom\" : {\n if (!preg_match($value, trim($postVar))) {\n $length = strlen(trim($postVar));\n if ($length)\n $errorMsg [$this->check_vars [$i] ['controler_name']] .= $error;\n }\n break;\n }\n default: {\n echo\"you entered a wrong choice\";\n break;\n }\n }\n }\n\n return $errorMsg;\n }", "protected function createValidationErrorMessage() {}", "public function valid()\n {\n\n if ($this->container['name'] === null) {\n return false;\n }\n if ($this->container['status'] === null) {\n return false;\n }\n $allowedValues = $this->getStatusAllowableValues();\n if (!in_array($this->container['status'], $allowedValues)) {\n return false;\n }\n if ($this->container['poolname'] === null) {\n return false;\n }\n if ($this->container['template_name'] === null) {\n return false;\n }\n if ($this->container['utm'] === null) {\n return false;\n }\n if ($this->container['body'] === null) {\n return false;\n }\n if ($this->container['sender'] === null) {\n return false;\n }\n if ($this->container['attachments'] === null) {\n return false;\n }\n return true;\n }", "public function valid()\n {\n\n if (strlen($this->container['virtual_operator']) > 60) {\n return false;\n }\n if (strlen($this->container['event_type']) > 100) {\n return false;\n }\n if (strlen($this->container['result_status']) > 100) {\n return false;\n }\n if (strlen($this->container['username']) > 100) {\n return false;\n }\n if (strlen($this->container['property_value']) > 450) {\n return false;\n }\n return true;\n }", "function validate_on_update() {}", "public function validate()\n\t{\n\t\t$this->vars['errors'] = $this->validation_errors();\n\t}", "public function _getValidationErrors()\n {\n $errs = parent::_getValidationErrors();\n $validationRules = $this->_getValidationRules();\n if (null !== ($v = $this->getAccident())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_ACCIDENT] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getAccidentType())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_ACCIDENT_TYPE] = $fieldErrs;\n }\n }\n if ([] !== ($vs = $this->getAdditionalMaterials())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_ADDITIONAL_MATERIALS, $i)] = $fieldErrs;\n }\n }\n }\n if ([] !== ($vs = $this->getCondition())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_CONDITION, $i)] = $fieldErrs;\n }\n }\n }\n if ([] !== ($vs = $this->getCoverage())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_COVERAGE, $i)] = $fieldErrs;\n }\n }\n }\n if (null !== ($v = $this->getCreated())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_CREATED] = $fieldErrs;\n }\n }\n if ([] !== ($vs = $this->getDiagnosis())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_DIAGNOSIS, $i)] = $fieldErrs;\n }\n }\n }\n if (null !== ($v = $this->getEnterer())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_ENTERER] = $fieldErrs;\n }\n }\n if ([] !== ($vs = $this->getException())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_EXCEPTION, $i)] = $fieldErrs;\n }\n }\n }\n if (null !== ($v = $this->getFacility())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_FACILITY] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getFundsReserve())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_FUNDS_RESERVE] = $fieldErrs;\n }\n }\n if ([] !== ($vs = $this->getIdentifier())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_IDENTIFIER, $i)] = $fieldErrs;\n }\n }\n }\n if ([] !== ($vs = $this->getInterventionException())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_INTERVENTION_EXCEPTION, $i)] = $fieldErrs;\n }\n }\n }\n if ([] !== ($vs = $this->getItem())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_ITEM, $i)] = $fieldErrs;\n }\n }\n }\n if ([] !== ($vs = $this->getMissingTeeth())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_MISSING_TEETH, $i)] = $fieldErrs;\n }\n }\n }\n if (null !== ($v = $this->getOrganization())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_ORGANIZATION] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getOriginalPrescription())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_ORIGINAL_PRESCRIPTION] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getOriginalRuleset())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_ORIGINAL_RULESET] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getPatient())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_PATIENT] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getPayee())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_PAYEE] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getPrescription())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_PRESCRIPTION] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getPriority())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_PRIORITY] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getProvider())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_PROVIDER] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getReferral())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_REFERRAL] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getRuleset())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_RULESET] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getSchool())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_SCHOOL] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getTarget())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_TARGET] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getType())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_TYPE] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getUse())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_USE] = $fieldErrs;\n }\n }\n if (isset($validationRules[self::FIELD_ACCIDENT])) {\n $v = $this->getAccident();\n foreach($validationRules[self::FIELD_ACCIDENT] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_ACCIDENT, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_ACCIDENT])) {\n $errs[self::FIELD_ACCIDENT] = [];\n }\n $errs[self::FIELD_ACCIDENT][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_ACCIDENT_TYPE])) {\n $v = $this->getAccidentType();\n foreach($validationRules[self::FIELD_ACCIDENT_TYPE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_ACCIDENT_TYPE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_ACCIDENT_TYPE])) {\n $errs[self::FIELD_ACCIDENT_TYPE] = [];\n }\n $errs[self::FIELD_ACCIDENT_TYPE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_ADDITIONAL_MATERIALS])) {\n $v = $this->getAdditionalMaterials();\n foreach($validationRules[self::FIELD_ADDITIONAL_MATERIALS] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_ADDITIONAL_MATERIALS, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_ADDITIONAL_MATERIALS])) {\n $errs[self::FIELD_ADDITIONAL_MATERIALS] = [];\n }\n $errs[self::FIELD_ADDITIONAL_MATERIALS][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_CONDITION])) {\n $v = $this->getCondition();\n foreach($validationRules[self::FIELD_CONDITION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_CONDITION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_CONDITION])) {\n $errs[self::FIELD_CONDITION] = [];\n }\n $errs[self::FIELD_CONDITION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_COVERAGE])) {\n $v = $this->getCoverage();\n foreach($validationRules[self::FIELD_COVERAGE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_COVERAGE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_COVERAGE])) {\n $errs[self::FIELD_COVERAGE] = [];\n }\n $errs[self::FIELD_COVERAGE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_CREATED])) {\n $v = $this->getCreated();\n foreach($validationRules[self::FIELD_CREATED] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_CREATED, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_CREATED])) {\n $errs[self::FIELD_CREATED] = [];\n }\n $errs[self::FIELD_CREATED][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_DIAGNOSIS])) {\n $v = $this->getDiagnosis();\n foreach($validationRules[self::FIELD_DIAGNOSIS] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_DIAGNOSIS, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_DIAGNOSIS])) {\n $errs[self::FIELD_DIAGNOSIS] = [];\n }\n $errs[self::FIELD_DIAGNOSIS][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_ENTERER])) {\n $v = $this->getEnterer();\n foreach($validationRules[self::FIELD_ENTERER] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_ENTERER, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_ENTERER])) {\n $errs[self::FIELD_ENTERER] = [];\n }\n $errs[self::FIELD_ENTERER][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_EXCEPTION])) {\n $v = $this->getException();\n foreach($validationRules[self::FIELD_EXCEPTION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_EXCEPTION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_EXCEPTION])) {\n $errs[self::FIELD_EXCEPTION] = [];\n }\n $errs[self::FIELD_EXCEPTION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_FACILITY])) {\n $v = $this->getFacility();\n foreach($validationRules[self::FIELD_FACILITY] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_FACILITY, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_FACILITY])) {\n $errs[self::FIELD_FACILITY] = [];\n }\n $errs[self::FIELD_FACILITY][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_FUNDS_RESERVE])) {\n $v = $this->getFundsReserve();\n foreach($validationRules[self::FIELD_FUNDS_RESERVE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_FUNDS_RESERVE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_FUNDS_RESERVE])) {\n $errs[self::FIELD_FUNDS_RESERVE] = [];\n }\n $errs[self::FIELD_FUNDS_RESERVE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_IDENTIFIER])) {\n $v = $this->getIdentifier();\n foreach($validationRules[self::FIELD_IDENTIFIER] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_IDENTIFIER, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_IDENTIFIER])) {\n $errs[self::FIELD_IDENTIFIER] = [];\n }\n $errs[self::FIELD_IDENTIFIER][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_INTERVENTION_EXCEPTION])) {\n $v = $this->getInterventionException();\n foreach($validationRules[self::FIELD_INTERVENTION_EXCEPTION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_INTERVENTION_EXCEPTION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_INTERVENTION_EXCEPTION])) {\n $errs[self::FIELD_INTERVENTION_EXCEPTION] = [];\n }\n $errs[self::FIELD_INTERVENTION_EXCEPTION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_ITEM])) {\n $v = $this->getItem();\n foreach($validationRules[self::FIELD_ITEM] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_ITEM, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_ITEM])) {\n $errs[self::FIELD_ITEM] = [];\n }\n $errs[self::FIELD_ITEM][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_MISSING_TEETH])) {\n $v = $this->getMissingTeeth();\n foreach($validationRules[self::FIELD_MISSING_TEETH] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_MISSING_TEETH, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_MISSING_TEETH])) {\n $errs[self::FIELD_MISSING_TEETH] = [];\n }\n $errs[self::FIELD_MISSING_TEETH][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_ORGANIZATION])) {\n $v = $this->getOrganization();\n foreach($validationRules[self::FIELD_ORGANIZATION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_ORGANIZATION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_ORGANIZATION])) {\n $errs[self::FIELD_ORGANIZATION] = [];\n }\n $errs[self::FIELD_ORGANIZATION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_ORIGINAL_PRESCRIPTION])) {\n $v = $this->getOriginalPrescription();\n foreach($validationRules[self::FIELD_ORIGINAL_PRESCRIPTION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_ORIGINAL_PRESCRIPTION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_ORIGINAL_PRESCRIPTION])) {\n $errs[self::FIELD_ORIGINAL_PRESCRIPTION] = [];\n }\n $errs[self::FIELD_ORIGINAL_PRESCRIPTION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_ORIGINAL_RULESET])) {\n $v = $this->getOriginalRuleset();\n foreach($validationRules[self::FIELD_ORIGINAL_RULESET] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_ORIGINAL_RULESET, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_ORIGINAL_RULESET])) {\n $errs[self::FIELD_ORIGINAL_RULESET] = [];\n }\n $errs[self::FIELD_ORIGINAL_RULESET][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_PATIENT])) {\n $v = $this->getPatient();\n foreach($validationRules[self::FIELD_PATIENT] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_PATIENT, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_PATIENT])) {\n $errs[self::FIELD_PATIENT] = [];\n }\n $errs[self::FIELD_PATIENT][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_PAYEE])) {\n $v = $this->getPayee();\n foreach($validationRules[self::FIELD_PAYEE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_PAYEE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_PAYEE])) {\n $errs[self::FIELD_PAYEE] = [];\n }\n $errs[self::FIELD_PAYEE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_PRESCRIPTION])) {\n $v = $this->getPrescription();\n foreach($validationRules[self::FIELD_PRESCRIPTION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_PRESCRIPTION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_PRESCRIPTION])) {\n $errs[self::FIELD_PRESCRIPTION] = [];\n }\n $errs[self::FIELD_PRESCRIPTION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_PRIORITY])) {\n $v = $this->getPriority();\n foreach($validationRules[self::FIELD_PRIORITY] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_PRIORITY, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_PRIORITY])) {\n $errs[self::FIELD_PRIORITY] = [];\n }\n $errs[self::FIELD_PRIORITY][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_PROVIDER])) {\n $v = $this->getProvider();\n foreach($validationRules[self::FIELD_PROVIDER] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_PROVIDER, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_PROVIDER])) {\n $errs[self::FIELD_PROVIDER] = [];\n }\n $errs[self::FIELD_PROVIDER][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_REFERRAL])) {\n $v = $this->getReferral();\n foreach($validationRules[self::FIELD_REFERRAL] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_REFERRAL, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_REFERRAL])) {\n $errs[self::FIELD_REFERRAL] = [];\n }\n $errs[self::FIELD_REFERRAL][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_RULESET])) {\n $v = $this->getRuleset();\n foreach($validationRules[self::FIELD_RULESET] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_RULESET, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_RULESET])) {\n $errs[self::FIELD_RULESET] = [];\n }\n $errs[self::FIELD_RULESET][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_SCHOOL])) {\n $v = $this->getSchool();\n foreach($validationRules[self::FIELD_SCHOOL] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_SCHOOL, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_SCHOOL])) {\n $errs[self::FIELD_SCHOOL] = [];\n }\n $errs[self::FIELD_SCHOOL][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_TARGET])) {\n $v = $this->getTarget();\n foreach($validationRules[self::FIELD_TARGET] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_TARGET, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_TARGET])) {\n $errs[self::FIELD_TARGET] = [];\n }\n $errs[self::FIELD_TARGET][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_TYPE])) {\n $v = $this->getType();\n foreach($validationRules[self::FIELD_TYPE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_TYPE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_TYPE])) {\n $errs[self::FIELD_TYPE] = [];\n }\n $errs[self::FIELD_TYPE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_USE])) {\n $v = $this->getUse();\n foreach($validationRules[self::FIELD_USE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_USE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_USE])) {\n $errs[self::FIELD_USE] = [];\n }\n $errs[self::FIELD_USE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_CONTAINED])) {\n $v = $this->getContained();\n foreach($validationRules[self::FIELD_CONTAINED] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE, self::FIELD_CONTAINED, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_CONTAINED])) {\n $errs[self::FIELD_CONTAINED] = [];\n }\n $errs[self::FIELD_CONTAINED][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_EXTENSION])) {\n $v = $this->getExtension();\n foreach($validationRules[self::FIELD_EXTENSION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE, self::FIELD_EXTENSION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_EXTENSION])) {\n $errs[self::FIELD_EXTENSION] = [];\n }\n $errs[self::FIELD_EXTENSION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_MODIFIER_EXTENSION])) {\n $v = $this->getModifierExtension();\n foreach($validationRules[self::FIELD_MODIFIER_EXTENSION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE, self::FIELD_MODIFIER_EXTENSION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_MODIFIER_EXTENSION])) {\n $errs[self::FIELD_MODIFIER_EXTENSION] = [];\n }\n $errs[self::FIELD_MODIFIER_EXTENSION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_TEXT])) {\n $v = $this->getText();\n foreach($validationRules[self::FIELD_TEXT] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE, self::FIELD_TEXT, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_TEXT])) {\n $errs[self::FIELD_TEXT] = [];\n }\n $errs[self::FIELD_TEXT][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_ID])) {\n $v = $this->getId();\n foreach($validationRules[self::FIELD_ID] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_RESOURCE, self::FIELD_ID, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_ID])) {\n $errs[self::FIELD_ID] = [];\n }\n $errs[self::FIELD_ID][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_IMPLICIT_RULES])) {\n $v = $this->getImplicitRules();\n foreach($validationRules[self::FIELD_IMPLICIT_RULES] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_RESOURCE, self::FIELD_IMPLICIT_RULES, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_IMPLICIT_RULES])) {\n $errs[self::FIELD_IMPLICIT_RULES] = [];\n }\n $errs[self::FIELD_IMPLICIT_RULES][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_LANGUAGE])) {\n $v = $this->getLanguage();\n foreach($validationRules[self::FIELD_LANGUAGE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_RESOURCE, self::FIELD_LANGUAGE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_LANGUAGE])) {\n $errs[self::FIELD_LANGUAGE] = [];\n }\n $errs[self::FIELD_LANGUAGE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_META])) {\n $v = $this->getMeta();\n foreach($validationRules[self::FIELD_META] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_RESOURCE, self::FIELD_META, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_META])) {\n $errs[self::FIELD_META] = [];\n }\n $errs[self::FIELD_META][$rule] = $err;\n }\n }\n }\n return $errs;\n }", "public function validate_trainer_feedback($excel_data, $class, $course, $trainer) {\n unset($excel_data[1]);\n $excel_data = array_filter($excel_data);\n $insert_data = array();\n $fdbk_arr = array('Competent'=>'COMP_C','Not Yet Competent'=>'COMP_NYC',\n 'Exempted'=>'COMP_EX','Absent'=>'COMP_ABS','Twice Not Competent'=>'COMP_2NYC');\n foreach ($excel_data as $key => $row) {\n $status = '';\n $excel = array();\n $excel['taxcode'] = $row[1];\n $excel['fullname'] = $row[2];\n \n $excel['rating'] = $fdbk_arr[trim($row[3])];\n $excel['view_rating'] = $row[3];\n \n $insert_data[$key] = $excel;\n \n $error_msg = $this->check_feedback_is_empty($excel, $fdbk_arr);\n if (!empty($error_msg)) {\n $insert_data[$key]['failure_reason'] = $error_msg;\n $insert_data[$key]['status'] = 'FAILED';\n } else {\n $insert_data[$key]['failure_reason'] = $error_msg;\n $insert_data[$key]['status'] = 'PASSED';\n }\n $user_enrol_status = $this->classtraineemodel->check_trainee_taxcode_exist($course, $class, $this->tenant_id, trim($excel['taxcode']));\n if ($user_enrol_status->num_rows() == 0) {\n $error_msg .= ' Trainee credentials not found in this class.';\n $insert_data[$key]['failure_reason'] = $error_msg;\n $insert_data[$key]['status'] = 'FAILED';\n }else{\n $insert_data[$key]['user_id'] = $user_enrol_status->row('user_id');\n }\n }\n $insert_status = $this->classtraineemodel->update_trainer_feedback_data($this->tenant_id, $insert_data, $course, $trainer, $class);\n return $insert_status;\n }", "protected function validate()\n {\n if ($this->name == '') {\n $this->errors[] = 'Name is required';\n }\n\n if ($this->name == '') {\n $this->errors[] = 'Name is required';\n }\n if ($this->sex == '') {\n $this->errors[] = 'Sex selection is required';\n }\n\n if ($this->description == '') {\n $this->errors[] = 'Description is required';\n }\n\n if ($this->surrender_date == '') {\n $this->errors[] = 'Surrender Date is required';\n }\n\n if ($this->surrender_reason == '') {\n $this->errors[] = 'Surrender Reason is required';\n }\n\n return empty($this->errors);\n }", "public function validation($data,$files) {\n \n $errors=array();\n if($data['submitbutton']=='Continue'){\n \n $classificationList=$this->getClassifications();\n $classifications=$this->formatClassificationArray($classificationList);\n $classificationKeys=array_keys($classifications);\n if(!in_array($data['classification_id'],$classificationKeys)){\n $errors['classification_id']=\"Invalid classification selected\"; \n }\n \n if($data['incident_datetime']>time()){\n $errors['incident_datetime']=\"Incident Date/Time must be in the past\";\n }\n }\n return $errors;\n }", "public static function inValidStatusProvider()\n\t{\n\t\treturn array(\n\t\t\tarray(''),\n\t\t\tarray(null),\n\t\t\tarray(false),\n\t\t\tarray(true),\n\t\t\tarray('somethingwrong'),\n\t\t\tarray(array('open')),\n\t\t);\n\t}", "private function manageStatus()\n {\n $this->updateStatus();\n $this->checkStatus();\n }", "public function doValidate(){\n if (!is_array($this->getValidates())){\n throw new \\Exception(\"dose this function must call setValidate() function first.\");\n }\n\n foreach($this->getValidates() as $k => $v){\n //$v = (ValidateData)$v;\n if (TextUtils::isEmpty($v->getInput()) && $v->getRequire() == true){\n $v->setResult(false);\n }else{\n $v->setResult(true);\n }\n\n if ($v->getResult() && !TextUtils::isEmpty($v->getInput())){\n switch($v->getValidator()){\n case ValidateData::VALIDATOR_CUSTOM:\n $v->setResult($this->check($v->getInput(),$v->getRegexp()));\n break;\n case ValidateData::VALIDATOR_COMPARE:\n $result = false;\n if (!TextUtils::isEmpty($v->getOperator())){\n switch ($v->getOperator()){\n case ValidateData::OPERATOR_EQUIVALENT:\n $result = $v->getInput() == $v->getTo();\n break;\n case ValidateData::OPERATOR_GREATER:\n $result = $v->getInput() > $v->getTo();\n break;\n case ValidateData::OPERATOR_LESS:\n $result = $v->getInput() < $v->getTo();\n break;\n case ValidateData::OPERATOR_EQUIVALENT_GREATER:\n $result = $v->getInput() >= $v->getTo();\n break;\n case ValidateData::OPERATOR_EQUIVALENT_LESS:\n $result = $v->getInput() <= $v->getTo();\n break;\n case ValidateData::OPERATOR_NOT_EQUIVALENT:\n $result = $v->getInput() != $v->getTo();\n break;\n }\n\n }\n $v->setResult($result);\n break;\n case ValidateData::VALIDATOR_LENGTH:\n $len = mb_strlen($v->getInput(),'UTF-8');\n $v->setResult($len >= $v->getMin());\n if ($v->getMax() > $v->getMin()){\n $v->setResult($len <= $v->getMax() && $len >= $v->getMin());\n }\n\n break;\n\n case ValidateData::VALIDATOR_RANGE:\n $v->setResult((int)$v->getInput() >= $v->getMin());\n if ($v->getMax() > $v->getMin()){\n $v->setResult((int)$v->getInput() <= $v->getMax() && (int)$v->getInput() >= $v->getMin());\n }\n\n break;\n default:\n $v->setResult($this->check($v->getInput(),$this->getValidator($v->getValidator())));\n break;\n }\n }\n }\n return $this->getError();\n }", "protected function buildStatusFields()\n {\n //====================================================================//\n // Order Current Status\n $this->fieldsFactory()->create(SPL_T_VARCHAR)\n ->Identifier(\"status\")\n ->Name(Translate::getAdminTranslation(\"Status\", \"AdminOrders\"))\n ->MicroData(\"http://schema.org/Invoice\", \"paymentStatus\")\n ->isReadOnly()\n ->isNotTested();\n\n //====================================================================//\n // INVOICE STATUS FLAGS\n //====================================================================//\n\n //====================================================================//\n // Is Paid\n $this->fieldsFactory()->create(SPL_T_BOOL)\n ->Identifier(\"isPaid\")\n ->Name(\"is Paid\")\n ->MicroData(\"http://schema.org/PaymentStatusType\", \"PaymentComplete\")\n ->Group(Translate::getAdminTranslation(\"Meta\", \"AdminThemes\"))\n ->isReadOnly()\n ->isNotTested();\n }", "protected function prepareValidations() {}" ]
[ "0.63312685", "0.59636194", "0.59624165", "0.5851447", "0.580899", "0.5765033", "0.5756305", "0.5708719", "0.56713504", "0.56713504", "0.5663364", "0.56542486", "0.5636632", "0.5626314", "0.56138957", "0.5583534", "0.5575395", "0.5544729", "0.5523626", "0.5497691", "0.54857343", "0.5474844", "0.54709095", "0.5449121", "0.54457396", "0.5423642", "0.5421119", "0.54144526", "0.5407563", "0.53909737", "0.538934", "0.53782666", "0.53660715", "0.53559583", "0.53509563", "0.5346256", "0.5345788", "0.5340271", "0.53235745", "0.5322015", "0.5309683", "0.53068244", "0.5302738", "0.5285601", "0.5274486", "0.52743644", "0.5262838", "0.5261462", "0.5260028", "0.5256664", "0.5253944", "0.5250411", "0.52364385", "0.5222046", "0.52206933", "0.5220631", "0.5217752", "0.5217752", "0.5217337", "0.52103907", "0.52080625", "0.5203136", "0.51927274", "0.51737696", "0.5173523", "0.51722914", "0.51712036", "0.5167528", "0.51666623", "0.5157039", "0.51568747", "0.51566875", "0.5150166", "0.5149113", "0.5148142", "0.5137642", "0.5137166", "0.51364726", "0.5135459", "0.51331925", "0.5128558", "0.51281834", "0.512269", "0.51209885", "0.5115625", "0.511408", "0.511336", "0.5112663", "0.5106792", "0.5105702", "0.51022977", "0.5098909", "0.5094759", "0.50901234", "0.5084664", "0.50787544", "0.5077671", "0.5076897", "0.5076269", "0.5070471" ]
0.64021975
0
Add item to Worker_Status_Data value
public function addToWorker_Status_Data(\WorkdayWsdl\\StructType\Worker_Status_DataType $item) { // validation for constraint: itemType if (!$item instanceof \WorkdayWsdl\\StructType\Worker_Status_DataType) { throw new \InvalidArgumentException(sprintf('The Worker_Status_Data property can only contain items of type \WorkdayWsdl\\StructType\Worker_Status_DataType, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__); } $this->Worker_Status_Data[] = $item; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function addStatus($status);", "function add_status($vStatus, $index = 0) {\n\t\tif ($this->get_multiple_values()) {\n\t\t\tif (!isset($this->statuses[$index])) {\n\t\t\t\t$this->statuses[$index] = Array();\n\t\t\t}\t\n\t\t\tif (!in_array($vStatus, $this->statuses[$index])) {\n\t\t\t\tarray_push($this->statuses[$index], $vStatus);\n\t\t\t}\n\t\t} else {\n\t\t\tif (!in_array($vStatus, $this->statuses)) {\n\t\t\t\tarray_push($this->statuses, $vStatus);\n\t\t\t}\n\t\t}\n\t}", "function add() {\n if(!$this->request->isApiCall() && !$this->request->isAsyncCall()) {\n $this->httpError(HTTP_ERR_BAD_REQUEST);\n } // if\n \n $this->wireframe->print_button = false;\n \n if($this->request->isSubmitted()) {\n $status_data = $this->request->post('status');\n \n $status = new StatusUpdate();\n \n $status->setAttributes($status_data);\n $status->setCreatedById($this->logged_user->getId());\n $status->setCreatedByName($this->logged_user->getName());\n $status->setCreatedByEmail($this->logged_user->getEmail());\n \n $save = $status->save();\n if(!$save || is_error($save)) {\n if($this->request->isApiCall()) {\n $this->serveData($save);\n } else {\n $this->httpError(HTTP_ERR_OPERATION_FAILED);\n } // if\n } // if\n \n if($this->request->isApiCall()) {\n $this->serveData($status, 'message');\n } else {\n UserConfigOptions::setValue('status_update_last_visited', new DateTimeValue(), $this->logged_user);\n \n $this->smarty->assign('status_update', $status);\n print $this->smarty->fetch(get_template_path('_status_row', $this->controller_name, STATUS_MODULE));\n die();\n } // if\n } else {\n $this->httpError(HTTP_ERR_BAD_REQUEST);\n } // if\n }", "function addItemForUpdate($item) {\n $this->_update[$item->getId()] = $item;\n }", "public function addStatuses(\\google\\rpc\\Status $value){\n return $this->_add(1, $value);\n }", "public function addWorker($data){\n $result=$this->db->insert('workers',$data);\n return $result;\n }", "function cb_wc_add_status( $wc_statuses_arr ) {\n\t$new_statuses_arr = array();\n\n\t// Add new order status after payment pending.\n\tforeach ( $wc_statuses_arr as $id => $label ) {\n\t\t$new_statuses_arr[ $id ] = $label;\n\n\t\tif ( 'wc-pending' === $id ) { // after \"Payment Pending\" status.\n\t\t\t$new_statuses_arr['wc-blockchainpending'] = __( 'Blockchain Pending', 'coinbase' );\n\t\t}\n\t}\n\n\treturn $new_statuses_arr;\n}", "function statuses_saveData() {\n\n\t// Get array with new data\n\t$fields = statuses_getData();\n\t$count = sizeof($fields); // count items\n\n\t// Construct URL\n\t$url = BASEURL . \"v1/statuses?count=\" . $count . \"&token=\" . getToken(1);\n\n\t// Get existing data\n\t$response = array_reverse(doGetRequest($url));\n\n\t// Iterate through all new items and if their ID isn't found in the request with the latest data, add them\n\tfor ($i=0; $i < 50; $i++) { \n\n\t\t$newId = $fields[$i]['org_id']; // original ID of a new item\n\t\t\n\t\tif($response['code'] == 404) {\n\t\t\tdoPostRequest($url, $fields[$i]);\n\t\t}\n\t\telseif(!in_array_r($newId, $response)) {\n\t\t\tdoPostRequest($url, $fields[$i]);\n\t\t}\n\t\n\t}\n\n}", "protected function statusUpdate($data)\n {\n // DB::table('status_update')->insert(['date' => Carbon::now(),\n // 'status' => $data['status'],\n // 'booking_id' => $data['id'],\n // 'created_at' => Carbon::now()\n // ]);\n }", "public function updateStatus($data)\n {\n $systemJobModel = $this->getSystemJob();\n $json = ($systemJobModel->data) ? json_decode($systemJobModel->data, true) : [ 'log' => $this->getLog() ];\n $systemJobModel->data = json_encode(array_merge($json, $data));\n $systemJobModel->save();\n }", "private function concat_existing_queue_items($queue_status, $file_data, $stage, $migration_state_id) {\n //attempt to load queue status\n $stored_queue = $this->transfer_util->get_queue_status($stage, $migration_state_id);\n if (false !== $stored_queue) {\n $queue_status = $stored_queue;\n $queue_status['total'] += $file_data['meta']['count'];\n $queue_status['size'] += $file_data['meta']['size'];\n $queue_status['manifest'] = array_merge($file_data['meta']['manifest'], $queue_status['manifest']);\n }\n\n return $queue_status;\n }", "public function add(Xend_Response_Status_Interface $data)\n {\n array_push($this->_data, $data);\n return $this;\n }", "function PKG_addJob($client,$packageName,$priority,$params)\n{\n\tPKG_addStatusJob($client,$packageName,$priority,$params,\"waiting\");\n}", "public function run()\n {\n Status::insert($this->statusLists);\n }", "public function\tAddWorkerAtWorkshop()\n {\n if(Request::ajax()) \n {\n // Getting all post data\n $data = Input::all();\n\n try\n { \n $worker = Worker::find($data[\"worker_id\"]);\n //first checks if the worker is already doing something at this moment\n $isFree = true;\n\n foreach ($worker->workshop_level_3 as $task)\n { \n if($task->pivot->date == $data[\"date\"] && $task->pivot->isMorning == $data[\"ismorning\"])\n $isFree = false;\n }\n\n if($isFree)\n { \n $worker->workshop_level_3()->attach($data[\"workshop_id\"], ['date' => $data[\"date\"],'isMorning' => $data[\"ismorning\"]]);\n\n return response(200);\n }\n else\n {\n return response(\" Le travailleur semble déjà faire quelque chose...\" ,400);\n }\n }\n catch(\\Exception $er)\n { \n return response(\" Veuillez vérifier que le nom d'utilisateur est correct\" ,400);\n } \n }\n else\n return response($default_general_error_message,500);\n \n }", "private function updateSpoolStatus ()\n {\n\n $oAppMessage = (new AppMessage())->retrieveByPK ($this->spool_id);\n if ( is_array ($this->fileData['attachments']) )\n {\n $attachment = implode (\",\", $this->fileData['attachments']);\n $oAppMessage->setappMsgAttach ($attachment);\n }\n $oAppMessage->setappMsgstatus ($this->status);\n $oAppMessage->setappMsgsenddate (date ('Y-m-d H:i:s'));\n $oAppMessage->save ();\n }", "protected function _saveStatus()\n {\n try {\n\n /**\n * update task statuses with completion days\n */\n foreach( $this->_status as $key => $val ) {\n\n if ( in_array( $key, $this->_tasks ) ) {\n $task = Mage::getModel('jirafe_analytics/install')\n ->getCollection()\n ->addFieldToFilter( 'task', $key )\n ->getFirstItem();\n\n $task->setCompletedDt( $val );\n $task->save();\n }\n }\n\n /**\n * refresh status values in cache\n *\n */\n $this->_saveStatusToCache();\n\n return true;\n\n } catch (Exception $e) {\n Mage::helper('jirafe_analytics')->log('ERROR', 'Jirafe_Analytics_Model_Installer::_saveStatus()', $e->getMessage(), $e);\n return false;\n }\n }", "public function save() {\r\n /** probably we should add a timestamp, Item ID and stuff */\r\n $stored_data = json_encode(array($this->name, $this->status), JSON_UNESCAPED_UNICODE);\r\n $this->db_write(\"objects\", \"Item_s11n\", $stored_data);\r\n print ($stored_data);\r\n }", "public function assignStuff()\n {\n $itemId = Input::get('item_id');\n $stuffId = Input::get('job_manager');\n \n $orderItem = OrderItem::find($itemId);\n $status = $orderItem->saveAsWorking($stuffId, $this->current_user->id);\n \n if($status)\n {\n $stuff = Admin::find($stuffId);\n \n $params = [\n 'stuff' => $stuff,\n 'item' => $orderItem \n ];\n $this->sendMail('emails.orders.assignJob', $stuff->email, $stuff->full_name(), $params, 'Rock Design Notification');\n \n $result = array();\n $result['stuffName'] = $stuff->full_name();\n $result['msg'] = sprintf('The job is assigned to %s.', $stuff->full_name());\n $result['orderStatus'] = $orderItem->order->statusLang();\n \n echo json_encode($result);\n exit; \n }\n }", "protected function _updateStatus()\n {\n $this->_writeStatusFile(\n array(\n 'time' => time(),\n 'done' => ($this->_currentItemCount == $this->_totalFeedItems),\n 'count' => $this->_currentItemCount,\n 'total' => $this->_totalFeedItems,\n 'message' => \"Importing content. Item \" . $this->_currentItemCount\n . \" of \" . $this->_totalFeedItems . \".\"\n )\n );\n }", "private static function set_addon_status( &$addon ) {\n\t\tif ( ! empty( $addon['activate_url'] ) ) {\n\t\t\t$addon['status'] = array(\n\t\t\t\t'type' => 'installed',\n\t\t\t\t'label' => __( 'Installed', 'formidable' ),\n\t\t\t);\n\t\t} elseif ( $addon['installed'] ) {\n\t\t\t$addon['status'] = array(\n\t\t\t\t'type' => 'active',\n\t\t\t\t'label' => __( 'Active', 'formidable' ),\n\t\t\t);\n\t\t} else {\n\t\t\t$addon['status'] = array(\n\t\t\t\t'type' => 'not-installed',\n\t\t\t\t'label' => __( 'Not Installed', 'formidable' ),\n\t\t\t);\n\t\t}\n\t}", "public function register_status() {\n register_post_status( self::$status, array(\n 'label' => __( 'Limbo', 'fu-events-calendar' ),\n 'label_count' => _nx_noop( 'Limbo <span class=\"count\">(%s)</span>', 'Limbo <span class=\"count\">(%s)</span>', 'event status', 'fu-events-calendar' ),\n 'show_in_admin_all_list' => false,\n 'show_in_admin_status_list' => true,\n 'public' => false,\n 'internal' => false,\n ) );\n }", "public function add_ppe_inspection_worker($idPPEInspection) \n\t\t{\n\t\t\t//add the new workers\n\t\t\t$query = 1;\n\t\t\tif ($workers = $this->input->post('workers')) {\n\t\t\t\t$tot = count($workers);\n\t\t\t\tfor ($i = 0; $i < $tot; $i++) {\n\t\t\t\t\t$data = array(\n\t\t\t\t\t\t'fk_id_ppe_inspection' => $idPPEInspection,\n\t\t\t\t\t\t'fk_id_user' => $workers[$i],\n\t\t\t\t\t\t'date_issue' => date(\"Y-m-d G:i:s\") \n\t\t\t\t\t);\n\t\t\t\t\t$query = $this->db->insert('ppe_inspection_workers', $data);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($query) {\n\t\t\t\treturn true;\n\t\t\t} else{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}", "public function addStatus($status)\r\n {\r\n if($this->statusModel->isExistStatus($status['id']))\r\n {\r\n $this->statusModel->updateExistingStatus($status);\r\n }\r\n else\r\n {\r\n //IF status not exist then add new status\r\n $this->statusModel->addNewStatus($status);\r\n }\r\n }", "public function append($item)\n {\n array_push($this->activeValue, $item);\n }", "private function get_additional_entry_item( $addon_meta_data ) {\n\n\t\tif ( ! isset( $addon_meta_data['value'] ) || ! is_array( $addon_meta_data['value'] ) ) {\n\t\t\treturn array();\n\t\t}\n\t\t$status = $addon_meta_data['value'];\n\t\t$additional_entry_item = array(\n\t\t\t'label' => __( 'Google Sheets Integration', Forminator::DOMAIN ),\n\t\t\t'value' => '',\n\t\t);\n\n\n\t\t$sub_entries = array();\n\t\tif ( isset( $status['connection_name'] ) ) {\n\t\t\t$sub_entries[] = array(\n\t\t\t\t'label' => __( 'Integration Name', Forminator::DOMAIN ),\n\t\t\t\t'value' => $status['connection_name'],\n\t\t\t);\n\t\t}\n\n\t\tif ( isset( $status['is_sent'] ) ) {\n\t\t\t$is_sent = true === $status['is_sent'] ? __( 'Yes', Forminator::DOMAIN ) : __( 'No', Forminator::DOMAIN );\n\t\t\t$sub_entries[] = array(\n\t\t\t\t'label' => __( 'Sent To Google Sheets', Forminator::DOMAIN ),\n\t\t\t\t'value' => $is_sent,\n\t\t\t);\n\t\t}\n\n\t\tif ( isset( $status['description'] ) ) {\n\t\t\t$sub_entries[] = array(\n\t\t\t\t'label' => __( 'Info', Forminator::DOMAIN ),\n\t\t\t\t'value' => $status['description'],\n\t\t\t);\n\t\t}\n\n\t\t$additional_entry_item['sub_entries'] = $sub_entries;\n\n\t\t// return single array\n\t\treturn $additional_entry_item;\n\t}", "private function write_status(string $field_name, string $status)\n {\n $this->status[$field_name] = $status;\n }", "function updatestatus() {\n global $_lib;\n\n $dataH = array();\n $dataH['ID'] = $this->transaction->ID;\n $dataH['RemittanceSequence'] = $this->transaction->RemittanceSequence;\n $dataH['RemittanceDaySequence'] = $this->transaction->RemittanceDaySequence;\n $dataH['RemittanceSendtDateTime'] = $_lib['sess']->get_session('Datetime');\n $dataH['RemittanceSendtPersonID'] = $_lib['sess']->get_person('PersonID');\n $dataH['RemittanceStatus'] = 'sent';\n \n #Disse mŒ fjernes nŒr vi har en godkjenningsprosess\n $dataH['RemittanceApprovedDateTime'] = $_lib['sess']->get_session('Datetime');\n $dataH['RemittanceApprovedPersonID'] = $_lib['sess']->get_person('PersonID');\n\n $_lib['storage']->store_record(array('data' => $dataH, 'table' => 'invoicein', 'debug' => false));\n }", "public function updateStatus() {\n $ref = ORM::forTable('referrals')\n ->findOne($this->data['id']);\n if ($this->data['status'] == 'Assigned' && $this->data['route_id']) {\n $route = ORM::forTable('estimate_routes')\n ->findOne($this->data['route_id']);\n $assignedReferralsCount = ORM::forTable('referrals')\n ->select('id')\n ->where('route_id', $route->id)\n ->count();\n $ref->route_id = $this->data['route_id'];\n $ref->status = 'Assigned';\n $ref->route_order = $assignedReferralsCount;\n\n } elseif ($this->data['status'] == 'Pending') {\n $ref->status = 'Pending';\n $ref->route_order = 0;\n $ref->route_id = NULL;\n } else {\n $ref->status = $this->data['status'];\n }\n if ($ref->save()) {\n $this->renderJson([\n 'success' => true,\n 'message' => 'Job request status updated successfully'\n ]);\n } else {\n $this->renderJson([\n 'success' => false,\n 'message' => 'An error has occurred while saving job request'\n ]);\n }\n }", "public function save_status_info($data) {\n extract($data);\n $sql=\"INSERT INTO tbl_status (status_name, publication_status) VALUES ('$status_name', '$publication_status' )\";\n if(mysqli_query($this->link, $sql)) {\n $message=\"Status info save successfully\";\n return $message;\n } else {\n die('Query problem'.mysqli_error($this->link) );\n }\n }", "public function set_status( $arr ){\n\t\t\t\n\t\t\t$post_type = NN_PREFIX.$this->cpt_args[ 'post_type' ];\n\t\t\t\n\t\t\tforeach( $arr as $status ){\n\t\t\t\t$u_status = ucfirst( $status );\n\t\t\t\tregister_post_status( $status, array(\n\t\t\t\t\t'label' => _x( $u_status, $post_type ),\n\t\t\t\t\t'public' \t=> true,\n\t\t\t\t\t'exclude_from_search' => true,\n\t\t\t\t\t'show_in_admin_all_list' => true,\n\t\t\t\t\t'show_in_admin_status_list' => true,\n\t\t\t\t\t'label_count' => _n_noop( $u_status.' <span class=\"count\">(%s)</span>', $u_status.' <span class=\"count\">(%s)</span>' ),\n\t\t\t\t) );\n\t\t\t}\n\t\t}", "public function updateStatusRequest()\n { \n $now = Mage::getSingleton('core/date')->gmtDate(); \n $items = Mage::getModel('qquoteadv/qqadvcustomer')->getCollection();\n $items->addFieldToFilter('status', Ophirah_Qquoteadv_Model_Status::STATUS_REQUEST);\n $items->getSelect()->group('store_id');\n if($items->getSize() >0 ){\n $data = $items->getData();\n\n foreach($data as $unit) { \n $storeId = $unit['store_id'];\n $day = Mage::getStoreConfig('qquoteadv/general/expirtime_proposal', (int)$storeId); \n \n $now = Mage::getSingleton('core/date')->gmtDate(); \n $collection = Mage::getModel('qquoteadv/qqadvcustomer')->getCollection();\n $collection->addFieldToFilter('status', Ophirah_Qquoteadv_Model_Status::STATUS_REQUEST);\n $collection->getSelect()\n ->where('created_at<INTERVAL -' . $day . ' DAY + \\'' . $now . '\\'');\n $collection->load(); \n\n foreach ($collection as $item) { \n $item->setStatus(Ophirah_Qquoteadv_Model_Status::STATUS_REQUEST_EXPIRED);\n $item->save(); \n }\n }\n }\n }", "public function oppo_status_add($data)\n {\n if($query = $this->db->query(\"call oppo_status_add(\n\n '\".$data['lead_status'].\"',\n '\".$data['c_on'].\"',\n '\".$data['c_by'].\"'\n )\"))\n { save_query_in_log(); return true; }else{ save_query_in_log(); return false; }\n }", "function updateStatus(&$status, &$statusflag)\n {\n Requirements::customCSS('.col-ScheduledStatusDataColumn i {\n width: 16px;\n height: 16px;\n display: block;\n float: left;\n margin-right: 6px;\n }', 'ScheduledStatusDataColumn_Icons');\n if ( $this->owner->getEmbargoIsSet() ) {\n if ( $this->owner->getScheduledStatus() ) {\n // Under Embargo\n $status .= '<i class=\"font-icon-eye btn--icon-md text-danger\" title=\"Embargo active\"></i>'.$this->owner->dbObject(\"Embargo\")->Nice();\n } else {\n // Embargo expired\n $status .= '<i class=\"font-icon-eye btn--icon-md text-info\" title=\"Embargo expired\"></i>'.$this->owner->dbObject(\"Embargo\")->Nice();\n }\n }\n if ( $this->owner->getExpiryIsSet() ) {\n if ( $this->owner->getEmbargoIsSet() ) {\n $status .= '<br />'; // add a break if both set\n }\n if ( $this->owner->getExpiredStatus() ) {\n // Expired/unpublished\n $status .= '<i class=\"font-icon-eye-with-line btn--icon-md text-danger\" title=\"Expired/unpublished\"></i>'.$this->owner->dbObject(\"Expiry\")->Nice();\n } else {\n // Scheduled to expire\n $status .= '<i class=\"font-icon-eye-with-line btn--icon-md text-warning\" title=\"Scheduled to expire\"></i>'.$this->owner->dbObject(\"Expiry\")->Nice();\n }\n }\n }", "public function addStat($statData);", "public function lead_status_add($data)\n {\n if($query = $this->db->query(\"call lead_status_add(\n\n '\".$data['lead_status'].\"',\n '\".$data['c_on'].\"',\n '\".$data['c_by'].\"'\n )\"))\n { save_query_in_log(); return true; }else{ save_query_in_log(); return false; }\n }", "function updateStatus() {\n global $status, $spambotDataLoc;\n return file_put_contents( $spambotDataLoc.'sbstatus', serialize($status) ); \n}", "private function processStatus(){\n\t\t$this->facilityData = $this->getFacilityStatus();\n\n\t\t/** Set the date if it's not set for the proved facility */\n\t\t$this->setFacilityStatus();\n\t}", "function attendance_add_status($status) {\n global $DB;\n if (empty($status->context)) {\n $status->context = context_system::instance();\n }\n\n if (!empty($status->acronym) && !empty($status->description)) {\n $status->deleted = 0;\n $status->visible = 1;\n $status->setunmarked = 0;\n $status->availablebeforesession = 0;\n\n $id = $DB->insert_record('attendance_statuses', $status);\n $status->id = $id;\n\n $event = \\mod_attendance\\event\\status_added::create(array(\n 'objectid' => $status->attendanceid,\n 'context' => $status->context,\n 'other' => array('acronym' => $status->acronym,\n 'description' => $status->description,\n 'grade' => $status->grade)));\n if (!empty($status->cm)) {\n $event->add_record_snapshot('course_modules', $status->cm);\n }\n $event->add_record_snapshot('attendance_statuses', $status);\n $event->trigger();\n return true;\n } else {\n return false;\n }\n}", "public function run()\n {\n \t$status =[\n \t[\n \t\t'name' => 'Pending'\n \t],\n \t[\n \t\t'name' => 'Active'\n \t],\n \t[\n \t\t'name' => 'Ongoing'\n \t],\n \t[\n \t\t'name' => 'Ended'\n \t]];\n \t\n DB::table('status')->insert($status);\n }", "public function test_add_status_event()\n {\n $employer = Employer::factory()->create();\n $status = EmployerStatus::create([\n \"employer_id\" => $employer->id,\n \"online_at\" => $online_at = Carbon::now(),\n\n ]);\n $this->assertDatabaseHas(\"employer_statuses\", [\n \"employer_id\" => (string)$employer->id,\n \"online_at\" => $online_at,\n\n ]);\n }", "public function addToCache(string $key, $data,string $status, $ttl=10*60){\n if(!(Str::startsWith($status, '5')||Str::startsWith($status, '4'))){\n Cache::add($key,$data,$ttl);\n }\n }", "private function store_local_manifest($queue_status, $file_data, $stage, $migration_state_id) {\n $queue_status = $this->concat_existing_queue_items($queue_status, $file_data, $stage, $migration_state_id);\n\n try {\n $this->transfer_util->save_queue_status($queue_status, $stage, $migration_state_id);\n } catch (\\Exception $e) {\n return $this->transfer_util->ajax_error($e->getMessage());\n }\n\n return $queue_status;\n }", "public function addclaimstatus(){\n $response = $this->insertInToTable(CLAIM_STATUS, array(array('claim_status_name'=>$this->getData['addnewclaimstatus'], 'created_by'=>$this->Useconfig['user_id'], 'created_ip'=>commonfunction::loggedinIP())));\n return $response;\n }", "function addToBatch($item, $values) {\n $item['rowValues'] = $values;\n $item['allowUpdate'] = $this->_allowEntityUpdate;\n $item['ignoreCase'] = $this->_ignoreCase;\n $this->_importQueueBatch[] = $item;\n }", "protected function getItemStatus($item)\n {\n $duedate = '';\n $notes = [];\n $statusCode = trim($item['status']['code']);\n if (isset($this->itemStatusMappings[$statusCode])) {\n $status = $this->itemStatusMappings[$statusCode];\n } else {\n /*$status = isset($item['status']['display'])\n ? ucwords(strtolower($item['status']['display']))\n : '-';*/\n\t\t\t$status = isset($item['status']['display'])\n ? ucwords(strtolower($item['status']['display']))\n : '';//removed and added by Pier Shen @2018-10-30\n }\n $status = trim($status);\n // For some reason at least API v2.0 returns \"ON SHELF\" even when the\n // item is out. Use duedate to check if it's actually checked out.\n if (isset($item['status']['duedate'])) {\n $duedate = $this->dateConverter->convertToDisplayDate(\n \\DateTime::ISO8601,\n $item['status']['duedate']\n );\n $status = 'Checked Out';\n\t\t\tif (isset($item['fixedFields']['75'])) {\n $recall = $item['fixedFields']['75'];\n $notes[] = $this->translate('Recalled');\n }//added by Pier Shen @2018-10-30\n } /*else {\n switch ($status) {\n case '-':\n $status = 'On Shelf';\n break;\n case 'Lib Use Only':\n $status = 'On Reference Desk';\n break;\n }\n }*/ //removed by Pier Shen @2018-10-30\n if ($status == 'Available') {//changed by Pier Shen @2018-10-30\n // Check for checkin date\n $today = $this->dateConverter->convertToDisplayDate('U', time());\n if (isset($item['fixedFields']['68'])) {\n $checkedIn = $this->dateConverter->convertToDisplayDate(\n \\DateTime::ISO8601, $item['fixedFields']['68']['value']\n );\n if ($checkedIn == $today) {\n $notes[] = $this->translate('Returned today');\n }\n }\n }\n return [$status, $duedate, $notes];\n }", "public function addToCitizenship_Status_Reference(\\WorkdayWsdl\\\\StructType\\Citizenship_StatusObjectType $item)\n {\n // validation for constraint: itemType\n if (!$item instanceof \\WorkdayWsdl\\\\StructType\\Citizenship_StatusObjectType) {\n throw new \\InvalidArgumentException(sprintf('The Citizenship_Status_Reference property can only contain items of type \\WorkdayWsdl\\\\StructType\\Citizenship_StatusObjectType, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__);\n }\n $this->Citizenship_Status_Reference[] = $item;\n return $this;\n }", "protected function handleDoAdd() {\n\t\t\tif ($this->verifyRequest('POST') && $this->verifyParams()) {\n\t\t\t\tif ($this->blnAuthenticated) {\n\t\t\t\t\t$arrVariables = $this->objUrl->getVariables();\n\t\t\t\t\t\n\t\t\t\t\tAppLoader::includeUtility('Sanitizer');\n\t\t\t\t\tif (!($arrUnsanitary = Sanitizer::sanitizeArray($arrVariables))) {\n\t\t\t\t\t\tif (!empty($arrVariables['status'])) {\n\t\t\t\t\t\t\tAppLoader::includeUtility('EventHelper');\n\t\t\t\t\t\t\tif (EventHelper::userStatus(AppRegistry::get('UserLogin')->getUserId(), $arrVariables['status'])) {\n\t\t\t\t\t\t\t\tCoreAlert::alert('The status was posted successfully.');\n\t\t\t\t\t\t\t\t$this->blnSuccess = true;\n\t\t\t\t\t\t\t\t$this->intStatusCode = 201;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\ttrigger_error(AppLanguage::translate('There was an error posting the status'));\n\t\t\t\t\t\t\t\t$this->error();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ttrigger_error(AppLanguage::translate('Missing status'));\n\t\t\t\t\t\t\t$this->error(400);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttrigger_error(AppLanguage::translate('The following value(s) contain illegal data: %s', implode(', ', array_map('htmlentities', $arrUnsanitary))));\n\t\t\t\t\t\t$this->error(400);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\ttrigger_error(AppLanguage::translate('Missing or invalid authentication'));\n\t\t\t\t\t$this->error(401);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$this->error(400);\n\t\t\t}\n\t\t}", "private function set_current_health_status($arr){\r\n\t\t$qno = $this->getFirstQuestionNo('current_health_status');\r\n\t\t$err=null;\r\n\t\ttry{\r\n \t\t$v=$this->vc->exists('q4',$arr,\"enum\",array(\"values\"=>array(1,2,3,4,5)),false,false);\r\n \t\t$this->data['current_health_status']['q4']=($v==\"\")?0:$v;\r\n \t}catch(ValidationException $e){\r\n \t\t$eob=$e->createErrorObject();\r\n \t\t$eob->message = \"Please give your opinion of your overall health\";\r\n \t\t$eob->name = \"Question \" . $qno;\r\n \t\t$err[] = $eob;\r\n \t}\r\n\r\n\t\t\t$qno += 1;\r\n \tfor($x=0;$x<=15;$x++){\r\n \t\ttry{\r\n \t\t\t$v=$this->vc->exists('q5_'.$x,$arr,\"enum\",array(\"values\"=>array(1,2,3,4,5)),false,false);\r\n \t\t\t$this->data['current_health_status']['q5_'.$x]=($v==\"\")?0:$v;\r\n \t\t}catch(ValidationException $e){\r\n \t\t\t$eb=$e->createErrorObject();\r\n \t\t\t$eb->message = \"Be sure to select an answer for all conditions\";\r\n \t\t\t$eb->name = \"Question \" . $qno;\r\n \t\t}\r\n \t}\r\n \tif (isset($eb)) {\r\n \t\t$err[] = $eb;\r\n \t}\r\n/* \t\r\n\t\t\t$qno += 1;\r\n \ttry{\r\n \t\t$v=$this->vc->exists('q6',$arr,\"enum\",array(\"values\"=>array(1,2)),false,false);\r\n \t\t$this->data['current_health_status']['q6']=($v==\"\")?0:$v;\r\n \t}catch(ValidationException $e){\r\n \t\t$eob=$e->createErrorObject();\r\n \t\t$eob->message = \"Please answer if you have medical condition that requires you to use your medical benefits\";\r\n \t\t$eob->name = \"Question \" . $qno;\r\n \t}\r\n*/\r\n\t\t\t$qno += 1;\r\n \ttry{\r\n \t\t$v=$this->vc->exists('q7',$arr,\"enum\",array(\"values\"=>array(1,2)),false,false);\r\n \t\t$this->data['current_health_status']['q7']=($v==\"\")?0:$v;\r\n \t}catch(ValidationException $e){\r\n \t\t$eob=$e->createErrorObject();\r\n \t\t$eob->message = \"Please express if you understand your medical benefits\";\r\n \t\t$eob->name = \"Question \" . $qno;\r\n \t\t$err[] = $eob;\r\n \t}\r\n/*\r\n\t\t\t$qno += 1;\r\n \ttry{\r\n \t\t$v=$this->vc->exists('q8',$arr,\"enum\",array(\"values\"=>array(1,2,3)),false,false);\r\n \t\t$this->data['current_health_status']['q8']=($v==\"\")?0:$v;\r\n \t}catch(ValidationException $e){\r\n \t\t$eob=$e->createErrorObject();\r\n \t\t$eob->message = \"Please answer if you get a yearly physical examination\";\r\n \t\t$eob->name = \"Question \" . $qno;\r\n \t\t$err[] = $eob;\r\n \t}\r\n*/\r\n\t\t\t$qno += 1;\r\n \ttry{\r\n \t\t$v=$this->vc->exists('q9',$arr,\"enum\",array(\"values\"=>array(1,2)),false,false);\r\n \t\t$this->data['current_health_status']['q9']=($v==\"\")?0:$v;\r\n \t}catch(ValidationException $e){\r\n \t\t$eob=$e->createErrorObject();\r\n \t\t$eob->message = \"Please answer whether you can care for a minor injury\";\r\n \t\t$eob->name = \"Question \" . $qno;\r\n \t\t$err[] = $eob;\r\n \t} \t\r\n \treturn ($err)?$err:false; \t\r\n }", "public function save() {\n JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));\n\n // Initialise variables.\n $app = JFactory::getApplication();\n $model = $this->getModel('DwOpportunityresponsestatusForm', 'Dw_opportunities_responses_statusesModel');\n\n // Get the user data.\n $data = JFactory::getApplication()->input->get('jform', array(), 'array');\n\n\t\t// Check if user can edit or create the item ---------------------------------------------------------------------------------------------\n\t\t$id = ( ( $data['id'] == 0 ) || !isset ( $data['id'] ) ) ? null : (int)$data['id'];\n $user = JFactory::getUser();\n\n if( $id ) \n\t\t{\n \t//Check the user can edit this item\n $authorised = $user->authorise('core.edit', 'com_dw_opportunities_responses_statuses');\n\t\t\t\n\t\t\tif(!$authorised && $user->authorise('core.edit.own', 'com_dw_opportunities_responses_statuses'))\n\t\t\t{\n\t\t\t\t//Check the owner from the model\n\t\t\t\t$itemData = $model -> getData($id);\n\t\t\t\t$itemOwner = ( isset ( $itemData -> created_by ) ) ? $itemData -> created_by : null ;\n\t\t\t\t$authorised = $user -> id == $itemOwner ; \n\t\t\t}\n\t\t\n } \n\t\telse \n\t\t{\n //Check the user can create new item\n $authorised = $user->authorise('core.create', 'com_dw_opportunities_responses_statuses');\n\t\t\t\n //Check the user has already created a status for this response_id ( ONLY 1 allowed )\n if( $authorised )\n {\n\t\t\t\t$response_id = ( !empty( $data['response_id'] ) ) ? $data['response_id'] : 0 ;\n\t\t\t\t\n\t\t\t\tJModelLegacy::addIncludePath(JPATH_SITE . '/components/com_dw_opportunities_responses_statuses/models', 'Dw_opportunities_responses_statusesModel');\n\t\t\t\t$responsesstatusesModel = JModelLegacy::getInstance('DWOpportunitiesresponsesstatuses', 'Dw_opportunities_responses_statusesModel', array('ignore_request' => true)); \n\t\t\t\t$responsesstatuses = $responsesstatusesModel -> getItemsByResponse( $response_id );\n\n\t\t\t\tif( $responsesstatuses )\n\t\t\t\t{\n\t\t\t\t\t$authorised = false ;\n\t\t\t\t}\n\t\t\t\n\t\t\t}\n\t\t\t\n }\t\t\n\t\t\n\t\tif( $authorised )\n\t\t{\n\t\t\t//Check if the response belongs to an opportunity that is created by the user\n\t\t\t\n\t\t\t//Get the response object\n\t\t\tJModelLegacy::addIncludePath(JPATH_SITE . '/components/com_dw_opportunities_responses/models', 'Dw_opportunities_responsesModel');\n\t\t\t$responseModel = JModelLegacy::getInstance('DwOpportunityresponse', 'Dw_opportunities_responsesModel', array('ignore_request' => true));\t\n\t\t\t$response = $responseModel ->getData ( $data['response_id'] );\n\t\t\t\n\t\t\t//Get the opportunity\n\t\t\tJModelLegacy::addIncludePath(JPATH_SITE . '/components/com_dw_opportunities/models', 'Dw_opportunitiesModel');\n\t\t\t$opportunityModel = JModelLegacy::getInstance('DwOpportunity', 'Dw_opportunitiesModel', array('ignore_request' => true));\t\n\t\t\t$opportunity = $opportunityModel -> getData ( $response -> opportunity_id );\n\t\t\t\n\t\t\t$authorised = $user -> id == $opportunity -> created_by;\n\t\t\t\n\t\t}\n\n\t\tif (!$authorised)\n\t\t{\t\t\n\t\t\ttry\n\t\t\t{\n\t\t\t\techo new JResponseJson( '' , JText::_('COM_DW_OPPORTUNITIES_RESPONSES_STATUSES_WIZARD_PERMISSION_DENIED') , true );\n\t\t\t}\n\t\t\tcatch(Exception $e)\n\t\t\t{\n\t\t\t\techo new JResponseJson($e);\n\t\t\t}\n\t\t\n\t\t\tjexit();\n\t\t}\n\t\t// ------------------------------------------------------------------------------------------------------------------------------\n\t\t\n\t\t\n // Validate the posted data.\n $form = $model->getForm();\n if (!$form) {\n JError::raiseError(500, $model->getError());\n return false;\n }\n\n // Validate the posted data.\n $data = $model->validate($form, $data);\n\n // Check for errors.\n if ($data === false) {\n // Get the validation messages.\n $errors = $model->getErrors();\n\n // Push up to three validation messages out to the user.\n for ($i = 0, $n = count($errors); $i < $n && $i < 3; $i++) {\n if ($errors[$i] instanceof Exception) {\n $app->enqueueMessage($errors[$i]->getMessage(), 'warning');\n } else {\n $app->enqueueMessage($errors[$i], 'warning');\n }\n }\n\n $input = $app->input;\n $jform = $input->get('jform', array(), 'ARRAY');\n\n // Save the data in the session.\n $app->setUserState('com_dw_opportunities_responses_statuses.edit.opportunityresponsestatus.data', $jform, array());\n\n\t\t\ttry\n\t\t\t{\n\t\t\t\techo new JResponseJson( '' , $errors , true );\n\t\t\t}\n\t\t\tcatch(Exception $e)\n\t\t\t{\n\t\t\t\techo new JResponseJson($e);\n\t\t\t}\n\t\t\n\t\t\tjexit();\n }\n\t\t\n\t\t//parameters fields convert into json before save - yesinternet\n\t\tif (isset($data['parameters']) && is_array($data['parameters']))\n\t\t{\n\t\t\t$registry = new JRegistry;\n\t\t\t$registry->loadArray($data['parameters']);\n\t\t\t$data['parameters'] = (string) $registry;\n\t\t}\n\n // Attempt to save the data.\n $return = $model->save($data);\n\n // Check for errors.\n if ($return === false) {\n // Save the data in the session.\n $app->setUserState('com_dw_opportunities_responses_statuses.edit.opportunityresponsestatus.data', $data);\n\n\t\t\ttry\n\t\t\t{\n\t\t\t\techo new JResponseJson( '' , 'Could not save the data' , true );\n\t\t\t}\n\t\t\tcatch(Exception $e)\n\t\t\t{\n\t\t\t\techo new JResponseJson($e);\n\t\t\t}\n\t\t\n\t\t\tjexit();\n }\n\n\n // Check in the profile.\n if ($return) {\n $model->checkin($return);\n }\n\n\t\t//Notify volunteer about the new status ----------------------------------------------------------------------------------------------------\n\t\tJPluginHelper::importPlugin('donorwiz');\n\t\t$dispatcher\t= JEventDispatcher::getInstance();\n\t\t$dispatcher->trigger( 'onOpportunityResponseStatusUpdate' , array( &$data ) );\n\t\t\n\t\ttry\n\t\t{\n\t\t\techo new JResponseJson( $return );\n\t\t}\n\t\tcatch(Exception $e)\n\t\t{\n\t\t\techo new JResponseJson($e);\n\t\t}\n\t\n\t\tjexit();\n\n\t\t}", "public function registerWorker()\r\n {\r\n Resque::redis()->sadd('workers', $this);\r\n setlocale(LC_TIME, \"\");\r\n setlocale(LC_ALL, \"en\");\r\n Resque::redis()->set('worker:' . (string)$this . ':started', strftime('%a %b %d %H:%M:%S %Z %Y'));\r\n }", "public function refreshTaskStatus(){\n\n $webCronResult = $this->webCronResults()->orderBy('code', 'desc')->first();\n\n if ($webCronResult) {\n\n if ($webCronResult->code >= 300) {\n // bad status\n $this->status = 0 ;\n }else{\n // good status\n $this->status = 2 ;\n };\n\n $this->save();\n\n };\n\n }", "public function update_status();", "public function run()\n {\n $data = ['completed','pending','processing'];\n foreach ( $data as $item){\n DB::table('orderstatuses')->insert(\n ['ordstatname' => $item]\n );\n }\n\n }", "public function registerWorker()\n\t{\n\t\tResque::redis()->sadd('workers', (string)$this);\n\t\tResque::redis()->set('worker:' . (string)$this . ':started', date('c'));\n\t}", "public function updateStatus(): void\n {\n $data = json_encode($this->getStatus(), JSON_PRETTY_PRINT);\n File::put(public_path(self::STATUS_FILE_NAME), $data);\n }", "private function _addToFilteredItem( $addon, array $subData, &$filteredItem ){\n foreach ($subData as $key => $value) {\n if( is_array($value) ){\n $fieldPrefix = ($this->_iniData[$key]['db_table_prefix']) ? $this->_iniData[$key]['db_table_prefix'] : \"\";\n $this->_addToFilteredItem( $fieldPrefix, $value, $filteredItem );\n }\n if ( !is_numeric($key) && in_array($key,$this->_fieldsToUse,true)) {\n $filteredItem[$addon . $key] = $value;\n }\n }\n }", "function add($record)\n {\n $data = get_object_vars($record);\n $this->rest->initialize(array('server' => REST_SERVER));\n $this->rest->option(CURLOPT_PORT, REST_PORT);\n $retrieved = $this->rest->post('recipe/maintenance/item/id/' . $record->menu_id.'-'.$record->inventory_id, $data);\n }", "protected function defineValue()\n {\n //get the number of repos owned by this user\n $count = $this->api_client->getRepositoriesCount();\n\n if ($count >= 21) {\n $this->status = 'Senior Evangelist';\n } elseif ($count >= 11) {\n $this->status = 'Associate Evangelist';\n } elseif ($count >= 5) {\n $this->status = 'Junior Evangelist';\n } else {\n $this->status = 'Baby Evangelist';\n }\n }", "private function Log($status, $charId)\n {\n $JournalItem = new JournalItem();\n $JournalItem->item_id = $this->id;\n $JournalItem->char_id = $charId;\n $JournalItem->status = $status;\n $JournalItem->save();\n }", "public function addHistoryStatus(NostoOrderStatusInterface $status)\n {\n $this->historyStatuses[] = $status;\n }", "public function addCheckInTaskList(\\sc\\score\\Task $value){\n return $this->_add(2, $value);\n }", "public function incrementPendingEntriesCount()\n\t{\n\t\t$this->setPendingEntriesCount($this->getPendingEntriesCount() + 1); \n\t\t$this->save();\n\t}", "public function addToLives_With_Worker_Data(\\WorkdayWsdl\\\\StructType\\Lives_With_Worker_DataType $item)\n {\n // validation for constraint: itemType\n if (!$item instanceof \\WorkdayWsdl\\\\StructType\\Lives_With_Worker_DataType) {\n throw new \\InvalidArgumentException(sprintf('The Lives_With_Worker_Data property can only contain items of type \\WorkdayWsdl\\\\StructType\\Lives_With_Worker_DataType, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__);\n }\n $this->Lives_With_Worker_Data[] = $item;\n return $this;\n }", "public function appendItem(\\PB_Item $value)\n {\n return $this->append(self::ITEM, $value);\n }", "function rec($log_item)\n\t{\n\t\t$this->items[] = $log_item;\n\t}", "function update_status()\n\t{\n\t\t$data = filter_forwarded_data($this);\n\t\t\n\t\tif(!empty($data['t']) && !empty($data['list'])) $response = $this->_tender->update_status($data['t'], explode('--',$data['list']));\n\t\t\n\t\t# all good\n\t\tif(!empty($response) && $response['boolean']){\n\t\t\t$data['msg'] = 'The Invitation for Bids/Quotations status has been updated.';\n\t\t\t$data['area'] = 'refresh_list_msg';\n\t\t} \n\t\t# there was an error\n\t\telse {\n\t\t\t$data['msg'] = (!empty($data['t']) && !empty($data['list']))? 'ERROR: There was an error updating the Invitation for Bids/Quotations status.': 'ERROR: This action can not be resolved';\n\t\t\t$data['area'] = 'basic_msg';\n\t\t}\n\t\t\n\t\t$this->load->view('addons/basic_addons', $data);\n\t}", "function add_activity_result($result) {\n\t\t$this->_activity_result[] = $result;\n\t}", "function set($iAccountNo=0, $item='', $value='', $id='') {\n\n\t\tinitializeJsonArray();\n\t\tif(isAdminLoggedIn()){\n\n\t\t\tif($oUser = $this->user_model->getUserBy('account_no', $iAccountNo)){\n\n\t\t\t\tswitch ($item) {\n\n\t\t\t\t\tcase 'status':\n\t\t\t\t\t\tif(in_array($value, $this->aUserStatus)){\n\t\t\t\t\t\t\t$this->db->where('account_no', $iAccountNo);\n\t\t\t\t\t\t\t$this->db->set('status', $value);\n\t\t\t\t\t\t\t$this->db->update('users');\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'mem':\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t}\n\t\t\t\t$this->aJsonOutput['output']['id'] = $id;\n\n\t\t\t}\n\t\t} else {\n\t\t\t$this->aJsonOutput['output']['error_type'] = $this->aErrorTypes['not_logged_in'];\n\t\t\t$this->aJsonOutput['output']['error'] = '0';\n\t\t}\n\t\toutputJson();\n\t}", "public function run()\n {\n $statuses = [\n ['name' => 'On track', 'value' => 'on-track', 'color' => '#00423f', 'bg' => '#00d4c8'],\n ['name' => 'At risk', 'value' => 'at-risk', 'color' => '#574500', 'bg' => '#ffd100'],\n ['name' => 'On track', 'value' => 'off-track', 'color' => '#fff', 'bg' => '#fb5779'],\n ];\n\n Status::insert($statuses);\n }", "public function append_post_status() {\n $post = get_post();\n $selected = '';\n $label = '';\n if($post->post_type !== self::$post_type) return;\n\n if($post->post_status === self::$status){\n $selected = 'selected=\\\"selected\\\"';\n $label = __( 'Limbo', 'fu-events-calendar' );\n }\n\n ?>\n <script type=\"text/javascript\">\n (function ($) {\n $('select#post_status').append('<option value=\"<?php echo self::$status ?>\" <?php echo $selected ?>><?php _e( 'Limbo', 'fu-events-calendar' ) ?></option>');\n <?php if ($label !== ''): ?>\n $('#post-status-display').text('<?php echo $label ?>');\n <?php endif; ?>\n })(jQuery);\n </script>\n <?php\n }", "public function saveStatus(String $status): void\n {\n if (!in_array($status, static::STATUS)) {\n throw new Exception(\n 'Kan ikke sette jobb-status til ' . $status . ' da den ikke er støttet'\n );\n }\n $this->update('status_progress', $status);\n }", "public function add_data_to_tombstone(){\n }", "public function writeItem($item)\n {\n $this->data[] = $item;\n }", "public function add($item)\n {\n $this->manuallyAddedData[] = $item;\n }", "protected function logAndUpdate($type, $status, $item, $msg)\n\t{\n\t\tif ($status === 'reject') {\n\t\t\t$msg .= '. Rejecting from queue';\n\t\t}\n\t\t$this->logger->{$type}(\"Job {$item['id']}: $msg\");\n\t\t$this->engine->{$status}($item);\n\t}", "public function createItem($data) {\n // the queue table yet, so we cannot rely on drupal_write_record().\n $query = db_insert('queue')\n ->fields(array(\n 'name' => $this->name,\n 'data' => serialize($data),\n // We cannot rely on REQUEST_TIME because many items might be created\n // by a single request which takes longer than 1 second.\n 'created' => time(),\n ));\n return (bool) $query->execute();\n }", "private function writeStatus(Issue $issue)\n\t{\n\t\tif (!empty($issue->id_status)) {\n\t\t\tif (isset($this->statuses[$issue->id_status])) {\n\t\t\t\t$issue->status = $this->statuses[$issue->id_status];\n\t\t\t}\n\t\t\telseif (!empty($issue->status_name)) {\n\t\t\t\t/** @var $status Status|Has_Redmine_Id */\n\t\t\t\t$status = Builder::create(Status::class);\n\t\t\t\t$status->name = $issue->status_name;\n\t\t\t\t$status->redmine_id = $issue->id_status;\n\t\t\t\tDao::write($status);\n\t\t\t\t$this->statuses[$status->redmine_id] = $status;\n\t\t\t\t$issue->status = $status;\n\t\t\t}\n\t\t}\n\t\tunset($issue->id_status);\n\t\tunset($issue->status_name);\n\t}", "public function append_post_status_inline() {\n $screen = get_current_screen();\n if ($screen->post_type !== self::$post_type) return;\n ?>\n <script type=\"text/javascript\">\n (function ($) {\n $('select[name=\"_status\"]').append('<option value=\"<?php echo self::$status ?>\"><?php _e('Limbo', 'fu-events-calendar' ) ?></option>');\n })(jQuery);\n </script>\n <?php\n }", "public function onWorkerHandlerStatusMessage(WorkerHandlerStatus $msg)\n {\n $handlerId = $msg->getWorkerHandlerId();\n\n if (isset($this->workerHandlers[$handlerId])) {\n // Remove to make sure the handlers are ordered by time.\n unset($this->workerHandlers[$handlerId]);\n }\n\n $this->workerHandlers[$handlerId] = microtime(true);\n\n $requestId = $msg->getRequestId();\n\n if ($requestId === null) {\n return;\n }\n\n $this->getLogger()->debug('Storage has a result available for: '.$requestId.'.');\n\n $this->sendResponseToClients($requestId);\n }", "private function _updateOrderItemHist($_id, $status = 'P', $notified = 1, $comment = '')\n {\n $_orderHist = $this->getTable('order_item_histories');\n $_orderHist->virtuemart_order_item_id = $_id;\n $_orderHist->order_status_code = $status;\n $_orderHist->customer_notified = $notified;\n $_orderHist->comments = $comment;\n $_orderHist->store();\n }", "public function setStatus($value)\n {\n $this->setItemValue('status', ['id' => (int)$value]);\n }", "private function addWeekItem($ItemData, $DataStartDate, $DataStopDate) {\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t$start_day = $DataStartDate->getDayOfWeek();\r\n\t\t\t\r\n\t\t$this->addWeekly($ItemData, $DataStartDate, $DataStopDate, $start_day);\t\t\r\n\t\t\t\r\n\t\r\n\t}", "function addFeedData($feedID,$url,$status=true,$update=0);", "public function changeStatusAjaxAction()\n\t{\n\t\t$data = $this->getRequest()->getPost();\n\t\tif($data){\n\t\t\tif($data['lb_item_status']!=\"\"){\n\t\t\t\t$order = Mage::getModel('sales/order')->load($data['order_id']);\n\t\t\t\t$orderStatus = $order->getStatus();\n\t\t\t\t$lbOrderItemInstance = Mage::getModel('dropship360/orderitems')->getCollection()->addFieldToFilter('item_id', $data['lb_item_id']);\n\t\t\t\ttry{\n\t\t\t\t\tif($lbOrderItemInstance->count() > 0){\t\t\t\n\t\t\t\t\t\tforeach($lbOrderItemInstance as $item){\n\t\t\t\t\t\t\t$itemStatusHistory = Mage::helper('dropship360')->getSerialisedData($item, $data['lb_item_status'], $orderStatus);\n\t\t\t\t\t\t\t$item->setLbItemStatus($data['lb_item_status']);\n\t\t\t\t\t\t\t$item->setItemStatusHistory($itemStatusHistory);\n\t\t\t\t\t\t\t$item->setUpdatedBy('User');\n\t\t\t\t\t\t\t$item->setUpdatedAt(Mage::getModel('core/date')->gmtDate());\n\t\t\t\t\t\t\t$item->save();\t\n\t\t\t\t\t\t\tif($data['lb_item_status']==$item->getLbItemStatus()){\n\t\t\t\t\t\t\t\t$data['msg'] = $item->getSku().' status successfully changed to '.$data['lb_item_status'];\n\t\t\t\t\t\t\t\tMage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('dropship360')->__($data['msg']));\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t$data['msg'] = $item->getSku().' status unable to change to '.$data['lb_item_status'];\n\t\t\t\t\t\t\t\tMage::getSingleton('adminhtml/session')->addError(Mage::helper('dropship360')->__($data['msg']));\n\t\t\t\t\t\t\t}\t\n\t\t\t\t\t\t}\n\t\t\t\t\t}\t\t\t\n\t\t\t\t\tif($data['lb_item_status'] == 'Transmitting'){\n\t\t\t\t\t\tMage::getModel('dropship360/logicbroker')->setupNotification();\n\t\t\t\t\t}\t\t\t\n\t\t\t\t\t$result = Mage::helper('core')->jsonEncode($data);\n\t\t\t\t\tMage::app()->getResponse()->setBody($result);\n\t\t\t\t}catch(Exception $e){\t\t\t\n\t\t\t\t\tMage::getSingleton('adminhtml/session')->addError($e->getMessage());\n\t\t\t\t}\n\t\t\t}\n\t\t}else{\n\t\t\t$data['msg'] = 'Unable to perform the required operation';\n\t\t}\t\n\t}", "public function AddEditStatusCode(){\n\t\ttry{\n\t\t\tif(isset($this->getData['emailstatus'])){\n\t\t\t\t\tif($this->getData['emailstatus'] == '0' && isset($this->getData['new_notification_name']) && $this->getData['new_notification_name'] != ''){\n\t\t\t\t\t\t$inserted = $this->_db->insert(MAIL_NOTIFY_TYPES,array('notification_name' => $this->getData['new_notification_name'],'notification_staus' => $this->getData['notification_sta'],'admin_display'=>'1','templatecategory_id'=>3));\n\t\t\t\t\t\t$this->getData['notification_id'] = ($inserted)?$this->_db->lastInsertId():'0';\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\tunset($this->getData['notification_id']);\n\t\t\t\t}\n\t\t\tif(isset($this->getData['mode']) && $this->getData['mode'] == 'add'){\n\t\t\t\treturn ($this->insertInToTable(STATUS_MASTER,array($this->getData))) ? TRUE : FALSE;\n\t\t\t}else{\n\t\t\t\t$where = 'master_id ='.Zend_Encript_Encription:: decode($this->getData['token']);\n\t\t\t\t$this->getData['modify_by'] = $this->Useconfig['user_id'];\n\t\t\t\t$this->getData['modify_ip'] = commonfunction::loggedinIP();\n\t\t\t\t$this->getData['modify_date'] = '';\n\t\t\t\treturn ($this->UpdateInToTable(STATUS_MASTER,array($this->getData),$where)) ? TRUE : FALSE;\n\t\t\t}\n\t\t}catch (Exception $e) {\n\t\t\t\t $this->_logger->info('Class-'.__CLASS__.',Function-'.__FUNCTION__.',Line-'.__LINE__.',Error-'.$e->getMessage());\n\t\t}\n }", "function add()\n\t{\n\t\t$this->_updatedata();\n\t}", "public function add($work)\n {\n $name = $work['name'];\n $startingDate = date('Y-m-d', strtotime($work['startingDate']));\n $endingDate = date('Y-m-d', strtotime($work['endingDate']));\n $status = $work['status'];\n $sql_insert = \"INSERT INTO `works` (`name`, `starting_date`, `ending_date`, `status`) VALUES ('$name', '$startingDate', '$endingDate', '$status')\";\n\n return mysqli_query($this->database, $sql_insert);\n }", "function updateAppliedJobStatus($linkVal, $cID, $jID, $classId)\n\t{\n\t\t$last_updated = time();\n\t\tif($classId == 'status'){\n\t\t\t$fieldName = \"status\";\n\t\t}\n\t\tif($classId == 'actions'){\n\t\t\t$fieldName = \"actions\";\n\t\t}\n\t\t$sql=\"UPDATE `appplied_jobs` SET $fieldName='\".$linkVal.\"', `updated_at`='\".$last_updated.\"'\n\t\t WHERE `job_id`='\".$jID.\"' AND `candidate_id`='\".$cID.\"'\";\n\t\t$result = $this->db->prepare($sql);\t\t\t\n\t\tif($result->execute())\n\t\t{\n\t\t\treturn \"Sucess\";\n\t\t}\n\t \n\t\telse\n\t\treturn \"<span style='color:red;font-size: 16px; font-weight=800;font-style: oblique;font-weight: 600;'> Already Inserted In Data Base</span>\";\t\n\t}", "public function setStatus($value) {\n$allowed = ['complete', 'in progress'];\nif (!in_array($value, $allowed))\n throw new Exception('A status must be either complete or in progress');\n$this->status = $value;\nreturn $this;\n}", "public function getItemStatus() {\r\n\t\t$status = array();\r\n\t\t\t$status[0] = array('id' => 0,\r\n\t\t\t\t\t\t\t'name' => 'Sold',\r\n\t\t\t\t\t\t\t'checked' => false,\r\n\t\t\t\t\t\t\t'field_name' => 'sold'\r\n\t\t\t\t\t\t);\r\n\t\t\t$status[1] = array('id' => 1,\r\n\t\t\t\t\t\t\t'name' => 'Available',\r\n\t\t\t\t\t\t\t'checked' => false,\r\n\t\t\t\t\t\t\t'field_name' => 'available'\r\n\t\t\t\t\t\t);\r\n\t\t\t$status[2] = array('id' => 2,\r\n\t\t\t\t\t\t\t'name' => 'Out on Job',\r\n\t\t\t\t\t\t\t'checked' => false,\r\n\t\t\t\t\t\t\t'field_name' => 'out_on_job'\r\n\t\t\t\t\t\t);\r\n\t\t\t$status[3] = array('id' => 3,\r\n\t\t\t\t\t\t\t'name' => 'Pending Sale',\r\n\t\t\t\t\t\t\t'checked' => false,\r\n\t\t\t\t\t\t\t'field_name' => 'pending_sale'\r\n\t\t\t\t\t\t);\r\n\t\t\t$status[4] = array('id' => 4,\r\n\t\t\t\t\t\t\t'name' => 'Out on Memo',\r\n\t\t\t\t\t\t\t'checked' => false,\r\n\t\t\t\t\t\t\t'field_name' => 'out_on_memo'\r\n\t\t\t\t\t\t);\r\n\t\t\t$status[5] = array('id' => 5,\r\n\t\t\t\t\t\t\t'name' => 'Burgled',\r\n\t\t\t\t\t\t\t'checked' => false,\r\n\t\t\t\t\t\t\t'field_name' => 'burgled'\r\n\t\t\t\t\t\t);\r\n\t\t\t$status[6] = array('id' => 6,\r\n\t\t\t\t\t\t\t'name' => 'Assembled',\r\n\t\t\t\t\t\t\t'checked' => false,\r\n\t\t\t\t\t\t\t'field_name' => 'assembled'\r\n\t\t\t\t\t\t);\r\n\t\t\t$status[7] = array('id' => 7,\r\n\t\t\t\t\t\t\t'name' => 'Returned To Consignee',\r\n\t\t\t\t\t\t\t'checked' => false,\r\n\t\t\t\t\t\t\t'field_name' => 'return_to_consignee'\r\n\t\t\t\t\t\t);\r\n\t\t\t$status[8] = array(\r\n\t\t\t\t\t\t\t'id' => 8,\r\n\t\t\t\t\t\t\t'name' => 'Pending Repair Queue',\r\n\t\t\t\t\t\t\t'checked' => false,\r\n\t\t\t\t\t\t\t'field_name' => 'pending_repair'\r\n\t\t\t\t\t\t);\r\n\t\t\t$status[91] = array('id' => 91,\r\n\t\t\t\t\t\t\t'name' => 'Francesklein Import',\r\n\t\t\t\t\t\t\t'checked' => false,\r\n\t\t\t\t\t\t\t'field_name' => 'francesklein_import'\r\n\t\t\t\t\t\t);\r\n\t\t\t$status[98] = array('id' => 98,\r\n\t\t\t\t\t\t\t'name' => 'Never Going Online',\r\n\t\t\t\t\t\t\t'checked' => false,\r\n\t\t\t\t\t\t\t'field_name' => 'never_going_online'\r\n\t\t\t\t\t\t);\r\n\t\t\t$status[99] = array('id' => 99,\r\n\t\t\t\t\t\t\t'name' => 'Unavailable',\r\n\t\t\t\t\t\t\t'checked' => false,\r\n\t\t\t\t\t\t\t'field_name' => 'unavailable'\r\n\t\t\t\t\t);\r\n\t\treturn $status;\r\n\t}", "public function update_result_item_status( $result, $status ) {\n\t\treturn update_user_meta( $result->data->ID, $this->slug . '_status', $status );\n\t}", "static function update_tracing_data($lead_id, $status){\n\t\t$table = self::get_offline_table();\n\t\tglobal $wpdb;\n\t\t$wpdb->update($table, array('crm_status'=>(int)$status), array('lead_id'=>(int)$lead_id), array('%d'), array('%d'));\n\t\t\n\t}", "protected function set_data($status_info, $data)\r\n {\r\n $this->status_information = $status_info;\r\n $this->return_data = $data;\r\n }", "public function store()\n\t{\n\t\t$postdata = file_get_contents('php://input');\n $request = json_decode($postdata, true);\n\n $cnt = ManageTaskStatus::where(['status_name' => $request['status_name']])->where('deleted_status', '=', 0 )->get()->count();\n if ($cnt > 0) { //exists priority Name\n $result = ['success' => false, 'errormsg' => 'Status already exists'];\n return json_encode($result);\n } else {\n $loggedInUserId = Auth::guard('admin')->user()->id;\n $create = CommonFunctions::insertMainTableRecords($loggedInUserId);\n $input['statusData'] = array_merge($request, $create);\n $tskstatus = ManageTaskStatus::create($input['statusData']);\n $last3 = ManageTaskStatus::latest('id')->first();\n $tskstatus = ManageTaskStatus::where(['deleted_status' => 0])->get();\n // $result = ['success' => true, 'result' => $bloodgroup, 'lastinsertid' => $last3->id];\n $result = ['success' => true, 'records' => $tskstatus, 'totalCount' => count($tskstatus)];\n return json_encode($result);\n }\n\t}", "function admin_add_members_status(){\t\n\t\t$progress = $this->Session->read('Import.progress');\n\t\t\n\t\t$this->layout = 'ajax';\n\t\t$data = array(\n\t\t\t'progress' => $this->Session->read('Import.progress'),\n\t\t\t'total' => $this->Session->read('Import.total')\n\t\t);\n\t\t$this->set('data', $data);\n\t\t$this->render('/ajaxreturn');\n\t}", "public function add_status( $order, $status ) {\n\n\t\tif ( is_numeric( $order ) ) {\n\t\t\t$order = wc_get_order( $order );\n\t\t}\n\n\t\t// Add the status if it doesn't already exist\n\t\tif ( ! $this->order_has_status( $order, $status ) ) {\n\t\t\treturn add_post_meta( SV_WC_Order_Compatibility::get_prop( $order, 'id' ), '_wc_avatax_status', $status );\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public static function rac_change_cart_list_mailstatus() {\n check_ajax_referer('mailstatus-cartlist', 'rac_security');\n\n if (isset($_POST['row_id']) && isset($_POST['status'])) {\n $status = $_POST['status'];\n update_post_meta($_POST['row_id'], 'rac_cart_sending_status', $status);\n echo '1';\n }\n exit();\n }", "public function test_admin_can_update_a_worker()\n {\n $this->browse(function (Browser $browser) {\n $browser->loginAs($admin = $this->createAdmin())\n ->visitRoute($this->route, $this->lastWorker()->id)\n ->type('worker_name', $this->makeWorker()->worker_name)\n ->type('worker_nif', $this->makeWorker()->worker_nif)\n ->type('worker_start', str_replace('/', '', $this->makeWorker()->worker_start))\n ->type('worker_ropo', $this->makeWorker()->worker_ropo)\n ->type('worker_ropo_date', str_replace('/', '', $this->makeWorker()->worker_ropo_date))\n ->select('worker_ropo_level', $this->makeWorker()->worker_ropo_level)\n ->type('worker_observations', $this->makeWorker()->worker_observations)\n ->press(trans('buttons.edit'))\n ->assertSee(__('The items has been updated successfuly'));\n });\n\n $this->assertDatabaseHas('workers', [\n 'worker_name' => $this->makeWorker()->worker_name,\n 'worker_nif' => $this->makeWorker()->worker_nif,\n 'worker_ropo' => $this->makeWorker()->worker_ropo,\n 'worker_ropo_level' => $this->makeWorker()->worker_ropo_level,\n 'worker_observations' => $this->makeWorker()->worker_observations,\n ]);\n }", "public function getStatusesForAdding()\n {\n return $this->statusesForAdding;\n }" ]
[ "0.5700343", "0.55176336", "0.5473545", "0.5324831", "0.5256279", "0.5216933", "0.52050316", "0.51999325", "0.5192786", "0.5173823", "0.50788814", "0.5069913", "0.505924", "0.505686", "0.50449306", "0.50345826", "0.50078946", "0.49951497", "0.49807838", "0.49698597", "0.4967887", "0.49633077", "0.49621215", "0.49619132", "0.49572968", "0.49569187", "0.49462354", "0.4931272", "0.4905789", "0.48848704", "0.48784593", "0.48527768", "0.4843031", "0.4832297", "0.48254895", "0.47976136", "0.4790899", "0.47856298", "0.4785368", "0.47561303", "0.47385064", "0.4737887", "0.47256857", "0.47246522", "0.47194526", "0.46934605", "0.46927747", "0.4684307", "0.46840778", "0.46833467", "0.46727994", "0.4667817", "0.46655908", "0.46655726", "0.4665113", "0.46420822", "0.46400464", "0.4637889", "0.46348903", "0.4621354", "0.46165463", "0.46021673", "0.45988372", "0.45987463", "0.45922005", "0.45911", "0.4588975", "0.45886317", "0.45847937", "0.45806423", "0.4571954", "0.45691583", "0.45677236", "0.4567414", "0.45615703", "0.45603004", "0.45589828", "0.45526475", "0.45405525", "0.45395997", "0.45349473", "0.4524082", "0.45214", "0.45203066", "0.45155495", "0.45055526", "0.4501601", "0.44998726", "0.4490892", "0.4488368", "0.4484692", "0.44835335", "0.4483129", "0.44827628", "0.44804013", "0.44735122", "0.4471875", "0.44706762", "0.44688123", "0.44640028" ]
0.68905354
0
This method is responsible for validating the values passed to the setWorker_Position_Data method This method is willingly generated in order to preserve the oneline inline validation within the setWorker_Position_Data method
public static function validateWorker_Position_DataForArrayConstraintsFromSetWorker_Position_Data(array $values = array()) { $message = ''; $invalidValues = []; foreach ($values as $employee_DataTypeWorker_Position_DataItem) { // validation for constraint: itemType if (!$employee_DataTypeWorker_Position_DataItem instanceof \WorkdayWsdl\\StructType\Worker_Position_DataType) { $invalidValues[] = is_object($employee_DataTypeWorker_Position_DataItem) ? get_class($employee_DataTypeWorker_Position_DataItem) : sprintf('%s(%s)', gettype($employee_DataTypeWorker_Position_DataItem), var_export($employee_DataTypeWorker_Position_DataItem, true)); } } if (!empty($invalidValues)) { $message = sprintf('The Worker_Position_Data property can only contain items of type \WorkdayWsdl\\StructType\Worker_Position_DataType, %s given', is_object($invalidValues) ? get_class($invalidValues) : (is_array($invalidValues) ? implode(', ', $invalidValues) : gettype($invalidValues))); } unset($invalidValues); return $message; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract public function validateData();", "private function writeDataValidity(): void\n {\n // Datavalidation collection\n $dataValidationCollection = $this->phpSheet->getDataValidationCollection();\n\n // Write data validations?\n if (!empty($dataValidationCollection)) {\n // DATAVALIDATIONS record\n $record = 0x01B2; // Record identifier\n $length = 0x0012; // Bytes to follow\n\n $grbit = 0x0000; // Prompt box at cell, no cached validity data at DV records\n $horPos = 0x00000000; // Horizontal position of prompt box, if fixed position\n $verPos = 0x00000000; // Vertical position of prompt box, if fixed position\n $objId = 0xFFFFFFFF; // Object identifier of drop down arrow object, or -1 if not visible\n\n $header = pack('vv', $record, $length);\n $data = pack('vVVVV', $grbit, $horPos, $verPos, $objId, count($dataValidationCollection));\n $this->append($header . $data);\n\n // DATAVALIDATION records\n $record = 0x01BE; // Record identifier\n\n foreach ($dataValidationCollection as $cellCoordinate => $dataValidation) {\n // options\n $options = 0x00000000;\n\n // data type\n $type = CellDataValidation::type($dataValidation);\n\n $options |= $type << 0;\n\n // error style\n $errorStyle = CellDataValidation::errorStyle($dataValidation);\n\n $options |= $errorStyle << 4;\n\n // explicit formula?\n if ($type == 0x03 && preg_match('/^\\\".*\\\"$/', $dataValidation->getFormula1())) {\n $options |= 0x01 << 7;\n }\n\n // empty cells allowed\n $options |= $dataValidation->getAllowBlank() << 8;\n\n // show drop down\n $options |= (!$dataValidation->getShowDropDown()) << 9;\n\n // show input message\n $options |= $dataValidation->getShowInputMessage() << 18;\n\n // show error message\n $options |= $dataValidation->getShowErrorMessage() << 19;\n\n // condition operator\n $operator = CellDataValidation::operator($dataValidation);\n\n $options |= $operator << 20;\n\n $data = pack('V', $options);\n\n // prompt title\n $promptTitle = $dataValidation->getPromptTitle() !== '' ?\n $dataValidation->getPromptTitle() : chr(0);\n $data .= StringHelper::UTF8toBIFF8UnicodeLong($promptTitle);\n\n // error title\n $errorTitle = $dataValidation->getErrorTitle() !== '' ?\n $dataValidation->getErrorTitle() : chr(0);\n $data .= StringHelper::UTF8toBIFF8UnicodeLong($errorTitle);\n\n // prompt text\n $prompt = $dataValidation->getPrompt() !== '' ?\n $dataValidation->getPrompt() : chr(0);\n $data .= StringHelper::UTF8toBIFF8UnicodeLong($prompt);\n\n // error text\n $error = $dataValidation->getError() !== '' ?\n $dataValidation->getError() : chr(0);\n $data .= StringHelper::UTF8toBIFF8UnicodeLong($error);\n\n // formula 1\n try {\n $formula1 = $dataValidation->getFormula1();\n if ($type == 0x03) { // list type\n $formula1 = str_replace(',', chr(0), $formula1);\n }\n $this->parser->parse($formula1);\n $formula1 = $this->parser->toReversePolish();\n $sz1 = strlen($formula1);\n } catch (PhpSpreadsheetException $e) {\n $sz1 = 0;\n $formula1 = '';\n }\n $data .= pack('vv', $sz1, 0x0000);\n $data .= $formula1;\n\n // formula 2\n try {\n $formula2 = $dataValidation->getFormula2();\n if ($formula2 === '') {\n throw new WriterException('No formula2');\n }\n $this->parser->parse($formula2);\n $formula2 = $this->parser->toReversePolish();\n $sz2 = strlen($formula2);\n } catch (PhpSpreadsheetException $e) {\n $sz2 = 0;\n $formula2 = '';\n }\n $data .= pack('vv', $sz2, 0x0000);\n $data .= $formula2;\n\n // cell range address list\n $data .= pack('v', 0x0001);\n $data .= $this->writeBIFF8CellRangeAddressFixed($cellCoordinate);\n\n $length = strlen($data);\n $header = pack('vv', $record, $length);\n\n $this->append($header . $data);\n }\n }\n }", "protected function validate_data_fields(){\n\t\tif(empty($this->RESPONSE)){throw new Exception(\"Response field not found\", 5);}\n\t\t\n\t\t// The remote IP address is also required\n\t\tif($this->validate_ip($this->REMOTE_ADDRESS)){throw new Exception(\"Renote IP address not set correctly\", 6);}\n\t}", "private function validate(){\n\t\t$row = $this->row;\n\t\t$col = $this->col;\n\t\tfor($i=0;$i<$row;$i++)\n\t\t\tfor($j=0;$j<$col;$j++)\n\t\t\t$this->sanitzeRow($i,$j);\n\n\t\tfor($i=0;$i<$row;$i++)\n\t\t\tfor($j=0;$j<$col;$j++)\n\t\t\t$this->sanitzeCol($i,$j);\n\n\t}", "function ValidateData()\n\t\t{\n\t\t\t$theValidator = new CValidator();\n\t\t\tif(!$this->arrValidator || !is_array($this->arrValidator) )\n\t\t\t{\n\t\t\t\t$this->arrValidator = array();\n\t\t\t}\n\t\t\tforeach($this->arrValidator as $key=>$value)\n\t\t\t{\n\t\t\t\tif($this->$key == '')\n\t\t\t\t{\n\t\t\t\t\t// Kiem tra xem co phai bat buoc khong?\n\t\t\t\t\tif(isset($this->arrRequired[$key]) && ($this->arrRequired[$key] == 1))\n\t\t\t\t\t{\n\t\t\t\t\t\treturn(false);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif(!$theValidator->CheckPatt($value, $this->$key))\n\t\t\t\t\t{\n\t\t\t\t\t\treturn(false);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn(true);\n\t\t}", "public function DataIsValid()\n {\n $bDataIsValid = parent::DataIsValid();\n if ($this->HasContent() && $bDataIsValid) {\n if (intval($this->data) < 12 && intval($this->data) >= -11) {\n $bDataIsValid = true;\n } else {\n $bDataIsValid = false;\n $oMessageManager = TCMSMessageManager::GetInstance();\n $sConsumerName = TCMSTableEditorManager::MESSAGE_MANAGER_CONSUMER;\n $sFieldTitle = $this->oDefinition->GetName();\n $oMessageManager->AddMessage($sConsumerName, 'TABLEEDITOR_FIELD_TIMEZONE_NOT_VALID', array('sFieldName' => $this->name, 'sFieldTitle' => $sFieldTitle));\n }\n }\n\n return $bDataIsValid;\n }", "function isDataValid() \n {\n return true;\n }", "public function valid()\n {\n if (!parent::valid()) {\n return false;\n }\n\n $allowedValues = $this->getRelativeHorizontalPositionAllowableValues();\n if (!in_array($this->container['relative_horizontal_position'], $allowedValues)) {\n return false;\n }\n\n $allowedValues = $this->getRelativeVerticalPositionAllowableValues();\n if (!in_array($this->container['relative_vertical_position'], $allowedValues)) {\n return false;\n }\n\n $allowedValues = $this->getWrapTypeAllowableValues();\n if (!in_array($this->container['wrap_type'], $allowedValues)) {\n return false;\n }\n\n\n return true;\n }", "public function sanitiseData(): void\n {\n $this->firstLine = self::sanitiseString($this->firstLine);\n self::validateExistsAndLength($this->firstLine, 1000);\n $this->secondLine = self::sanitiseString($this->secondLine);\n self::validateExistsAndLength($this->secondLine, 1000);\n $this->town = self::sanitiseString($this->town);\n self::validateExistsAndLength($this->town, 255);\n $this->postcode = self::sanitiseString($this->postcode);\n self::validateExistsAndLength($this->postcode, 10);\n $this->county = self::sanitiseString($this->county);\n self::validateExistsAndLength($this->county, 255);\n $this->country = self::sanitiseString($this->country);\n self::validateExistsAndLength($this->country, 255);\n }", "public function checkData() {\n\t\t// e.g. numbers must only have digits, e-mail addresses must have a \"@\" and a \".\".\n\t\treturn $this->control->checkPOST($this);\n\t}", "public function checkData() {\n\t\t// e.g. numbers must only have digits, e-mail addresses must have a \"@\" and a \".\".\n\t\treturn $this->control->checkPOST($this);\n\t}", "protected function _validate() {\n\t}", "public function validateData(){\n\t\tif (!self::isEmailValid($this->email))\n\t\t\tthrow new Exception(\"Email address {$this->email} is not a valid email address.\");\n\n\t\tparent::validateData();\n\t}", "public function check_data()\n {\n parent::check_data();\n\n if(empty($this->build_notifications))\n {\n throw new exception('<strong>Data missing: Notifications</strong>');\n }\n\n if(empty($this->build_batch_reference))\n {\n throw new exception('<strong>Data missing: Batch References</strong>');\n }\n }", "protected function localValidation()\n\t\t{\n\t\t}", "public function validate()\r\n {\r\n if(($this->length_n>=MIN_LENGTH AND $this->length_n<MAX_LENGTH) AND ($this->width_m>=MIN_WIDTH AND $this->width_m<MAX_WIDTH))\r\n {\r\n return true;\r\n }else {\r\n return false;\r\n }\r\n\r\n \r\n }", "public function checkCoordinates() : void\n {\n $this->checkLatitudes();\n $this->checkLongitudes();\n }", "private function validate_input() {\n\t\t$fields = array_merge( array( $this->range_field ), $this->key_fields, $this->checksum_fields );\n\n\t\t$this->validate_fields( $fields );\n\t\t$this->validate_fields_against_table( $fields );\n\t}", "private function validateData()\n {\n if (empty($this->nome)) {\n $this->errors->addMessage(\"O nome é obrigatório\");\n }\n\n if (!filter_var($this->email, FILTER_VALIDATE_EMAIL)) {\n $this->errors->addMessage(\"O e-mail é inválido\");\n }\n\n if (strlen($this->senha) < 6) {\n $this->errors->addMessage(\"A senha deve ter no minímo 6 caracteres!\");\n }\n if ($this->emailExiste($this->email, 'email')) {\n $this->errors->addMessage(\"Esse e-mail já está cadastrado\");\n }\n if ($this->emailExiste($this->usuario, 'usuario')) {\n $this->errors->addMessage(\"Esse usuário já está cadastrado\");\n }\n\n return $this->errors->hasError();\n }", "public function validate() {\r\n \r\n if (is_null($this->bbcode_uid)) {\r\n $this->bbcode_uid = \"sausages\";\r\n }\r\n \r\n if (is_null($this->lat)) {\r\n $this->lat = 0;\r\n }\r\n \r\n if (is_null($this->lon)) {\r\n $this->lon = 0;\r\n }\r\n \r\n if (is_null($this->edit_timestamp)) {\r\n $this->edit_timestamp = 0;\r\n }\r\n \r\n if (is_null($this->edit_count)) {\r\n $this->edit_count = 0;\r\n }\r\n \r\n if (empty($this->uid) && $this->Author instanceof User) {\r\n $this->uid = $this->Author->id;\r\n }\r\n \r\n if (empty($this->uid)) {\r\n throw new Exception(\"No post author specified\");\r\n }\r\n \r\n if (empty($this->ip)) {\r\n $this->ip = filter_input(INPUT_SERVER, \"REMOTE_ADDR\", FILTER_SANITIZE_URL); #$_SERVER['REMOTE_ADDR'];\r\n }\r\n \r\n if ($this->ip == null) {\r\n $this->ip = \"\";\r\n }\r\n \r\n if (empty($this->url_slug)) {\r\n $this->createSlug();\r\n }\r\n \r\n if (empty($this->url_slug)) {\r\n $this->url_slug = \"\";\r\n }\r\n \r\n if (!filter_var($this->timestamp)) {\r\n $this->timestamp = time(); \r\n }\r\n \r\n if (empty($this->text)) {\r\n throw new Exception(\"No post text was submitted\"); \r\n }\r\n \r\n \r\n return true;\r\n }", "public function validate()\n {\n $validator = Validator::make($this->data, $this->fieldValidationArray());\n if ($validator->fails()) {\n throw $this->validationException(join(\", \", $validator->errors()->all()));\n }\n\n /* if there's a script, check that the script will return the right type .*/\n if (isset($this->data[\"script\"])) {\n if ($this->recordType == null) {\n throw $this->validationException(\"Script can't be tested because the field doesn't belong to a record type.\");\n }\n try {\n $script = $this->getScript($this->recordType);\n if ($script->type() != $this->data[\"type\"]) {\n throw $this->validationException(\"Script should return a '\" . $this->data[\"type\"] . \"' but returned a \" . $script->type());\n }\n } catch (ScriptException $e) {\n throw $this->validationException(\"Script has a problem: \" . $e->getMessage());\n }\n }\n }", "protected function postValidation()\n {\n $errors = array();\n\n // \"Length of reference\" field.\n if (!($length = Tools::getValue('ORDERREF_LENGTH'))) {\n $errors[] = $this->l('The \"Length of reference\" field is required.');\n }\n elseif (!Validate::isInt($length)) {\n $errors[] = $this->l('The \"Length of reference\" field must be an integer number.');\n }\n elseif (!($length >= self::ORDERREF_LENGTH_MIN && $length <= self::ORDERREF_LENGTH_MAX)) {\n $errors[] = $this->l('The \"Length of reference\" field limits exceed. Value must be between')\n . ' ' . self::ORDERREF_LENGTH_MIN . ' '\n . $this->l('and')\n . ' ' . self::ORDERREF_LENGTH_MAX;\n }\n \n // \"How to generate\" field.\n if (!($mode = Tools::getValue('ORDERREF_MODE'))) {\n $errors[] = $this->l('The \"How to generate order references\" field is required.');\n }\n elseif (!(Validate::isInt($mode) &&\n ($mode == self::ORDERREF_MODE_RANDOM\n || $mode == self::ORDERREF_MODE_CONSEQUENT\n || $mode == self::ORDERREF_MODE_PS))) {\n $errors[] = $this->l('The \"How to generate order references\" field has illegal value.');\n }\n\n return $errors;\n }", "function validate() {\n\t\t\t$this->field['msg'] = ( isset( $this->field['msg'] ) ) ? $this->field['msg'] : esc_html__( 'You must provide a comma separated list of numerical values for this option.', 'redux-framework' );\n\n\t\t\tif ( ! is_numeric( str_replace( ',', '', $this->value ) ) || strpos( $this->value, ',' ) == false ) {\n\t\t\t\t$this->value = ( isset( $this->current ) ) ? $this->current : '';\n\t\t\t\t$this->field['current'] = $this->value;\n\n\t\t\t\t$this->error = $this->field;\n\t\t\t}\n\t\t}", "abstract public function validateData($data);", "protected function prepareValidations() {}", "function valid() {\r\n return isset($this->_data[$this->_position]);\r\n }", "public function validate() {\n if (!$this->_data) {\n return false;\n }\n\n $fields = $this->getFields();\n $messages = $this->getMessages();\n\n foreach ($this->_data as $field => $value) {\n if (empty($this->_rules[$field])) {\n continue;\n }\n\n foreach ($this->_rules[$field] as $rule => $params) {\n $options = $params['options'];\n $arguments = $options;\n array_unshift($arguments, $value);\n\n // Use G11n if it is available\n if (class_exists('Titon\\G11n\\Utility\\Validate')) {\n $class = 'Titon\\G11n\\Utility\\Validate';\n } else {\n $class = 'Titon\\Utility\\Validate';\n }\n\n if (!call_user_func(array($class, 'hasMethod'), $rule)) {\n throw new InvalidValidationRuleException(sprintf('Validation rule %s does not exist', $rule));\n }\n\n // Prepare messages\n $message = $params['message'];\n\n if (!$message && isset($messages[$rule])) {\n $message = $messages[$rule];\n }\n\n if ($message) {\n $message = String::insert($message, array_map(function($value) {\n return is_array($value) ? implode(', ', $value) : $value;\n }, $options + array(\n 'field' => $field,\n 'title' => $fields[$field]\n )));\n } else {\n throw new InvalidValidationRuleException(sprintf('Error message for rule %s does not exist', $rule));\n }\n\n if (!call_user_func_array(array($class, $rule), $arguments)) {\n $this->addError($field, $message);\n break;\n }\n }\n }\n\n return empty($this->_errors);\n }", "protected function checkStructure()\n {\n $structure = $this->getStructure();\n\n foreach ($structure as $field => $opt) {\n if (!array_key_exists($field, $this->data)) {\n continue;\n }\n\n $value = Arr::get($this->data, $field);\n if (is_array($value)) {\n $this->errors[$field][] = Translate::get('validate_wrong_type_data');\n continue;\n }\n\n $value = trim($value);\n $length = (int)$opt->length;\n\n if (!empty($length)) {\n $len = mb_strlen($value);\n if ($len > $length) {\n $this->errors[$field][] = Translate::getSprintf('validate_max_length', $length);\n continue;\n }\n }\n\n if (!$opt->autoIncrement && $opt->default === NULL && !$opt->allowNull && $this->isEmpty($value)) {\n $this->errors[$field][] = Translate::get('validate_not_empty');\n continue;\n }\n\n switch ($opt->dataType) {\n case 'int':\n case 'bigint':\n if (!$this->isEmpty($value) && (filter_var($value, FILTER_VALIDATE_INT) === false)) {\n $this->errors[$field][] = Translate::get('validate_int');\n continue 2;\n }\n break;\n\n case 'double':\n if (!is_float($value) && !$this->isEmpty($value)) {\n $this->errors[$field][] = Translate::get('validate_double');\n continue 2;\n }\n break;\n\n case 'float':\n if (!is_numeric($value) && !$this->isEmpty($value)) {\n $this->errors[$field][] = Translate::get('validate_float');\n continue 2;\n }\n break;\n\n case 'date':\n case 'datetime':\n case 'timestamp':\n if (!$this->isEmpty($value) && !Validate::dateSql($value)) {\n $this->errors[$field][] = Translate::get('validate_sql_date');\n continue 2;\n }\n break;\n\n default:\n continue 2;\n break;\n\n }\n }\n }", "function validate() {\n\t\t\n\t\tif(is_array($this->value)) { // If array\n\t\t\tforeach($this->value as $k => $value){\n\t\t\t\t$this->value[$k] = $this->validate_color_rgba($value);\n\t\t\t}//foreach\n\t\t} else { // not array\n\t\t\t$this->value = $this->validate_color_rgba($this->value);\n\t\t} // END array check\n\t\t\n\t}", "protected function preValidate() {}", "public function validate() {\n if (!empty($this->value)) {\n parent::validate();\n }\n }", "public function checkLatitudes() : void\n {\n if ($this->DataService->getALatitude() < -90 || $this->DataService->getALatitude() > 90) {\n $this->errorMessage .= \"The latitude coordinate of A point is invalid\\r\\n\";\n }\n \n if ($this->DataService->getBLatitude() < -90 || $this->DataService->getBLatitude() > 90) {\n $this->errorMessage .= \"The latitude coordinate of B point is invalid\\r\\n\";\n }\n }", "protected function Validate() {\r\n if (!is_int($this->class_log)) {\r\n \treturn false;\r\n }\r\n\r\n if (!is_int($this->student)) {\r\n \treturn false;\r\n }\r\n\r\n if (!is_string($this->longitude)) {\r\n \treturn false;\r\n }\r\n\r\n if (!is_string($this->latitude)) {\r\n \treturn false;\r\n }\r\n\r\n return true;\r\n }", "protected function validateInput()\r\n {\r\n self::setValidSortTypes();\r\n\r\n if (empty($this->offset)) {\r\n $this->offset = 0;\r\n }\r\n\r\n // Missing values\r\n $check_missing = ['type', 'offset', 'limit', 'sort_type', 'sort_order'];\r\n missing_values_to_exception($this, 'CHV\\ListingException', $check_missing, 100);\r\n\r\n // Validate type\r\n if (!in_array($this->type, self::$valid_types)) {\r\n throw new ListingException('Invalid $type \"' . $this->type . '\"', 110);\r\n }\r\n\r\n if ($this->offset < 0 || $this->limit < 0) {\r\n throw new ListingException('Limit integrity violation', 121);\r\n }\r\n\r\n // Validate sort type\r\n if (!in_array($this->sort_type, self::$valid_sort_types)) {\r\n throw new ListingException('Invalid $sort_type \"' . $this->sort_type . '\"', 130);\r\n }\r\n\r\n // Validate sort order\r\n if (!preg_match('/^(asc|desc)$/', $this->sort_order)) {\r\n throw new ListingException('Invalid $sort_order \"' . $this->sort_order . '\"', 140);\r\n }\r\n }", "function validatePos() {\n for($i=1; $i<=9; $i++) {\n if ( ! isset($_POST['year'.$i]) ) continue;\n if ( ! isset($_POST['desc'.$i]) ) continue;\n \n $year = $_POST['year'.$i];\n $desc = $_POST['desc'.$i];\n \n if ( strlen($year) == 0 || strlen($desc) == 0 ) {\n return \"All fields are required\";\n }\n \n if ( ! is_numeric($year) ) {\n return \"Position year must be numeric\";\n }\n }\n return true;\n }", "private function validateInputParameters($data)\n {\n }", "public static function invalidMarkerShapePolyCoordinate()\n {\n return new static('The x & y coordinates of a poly marker shape must be numeric values.');\n }", "public function validate_feedback_data(){\n \n // validate step 1 data.\n \n // rating should be 1-5.\n if( ! in_array($this->post_data->get('rating'), range(1, 5)) ) $this->error_msg[] = 'Rating should be 1 to 5';\n \n // title should not be blank.\n if( trim($this->post_data->get('title')) == '' ) $this->error_msg[] = 'Title should not be blank';\n \n // feedback should not be blank.\n if( trim($this->post_data->get('feedback')) == '' ) $this->error_msg[] = 'Feedback should not be blank';\n \n // recommendation should be 1 or 0.\n if( ! in_array($this->post_data->get('recommend'), range(0, 1)) ) $this->error_msg[] = 'Invalid recommendation option';\n \n \n \n // validate step 2 data.\n \n // first name should not be blank.\n if( trim($this->post_data->get('first_name')) == '' ) $this->error_msg[] = 'First name should not be blank';\n \n // last name should not be blank.\n if( trim($this->post_data->get('last_name')) == '' ) $this->error_msg[] = 'Last name should not be blank';\n \n // email should not be blank.\n if( trim($this->post_data->get('email')) == '' ) $this->error_msg[] = 'Email should not be blank';\n \n // email should be valid.\n if( ! preg_match('/^\\w+([\\.-]?\\w+)*@\\w+([\\.-]?\\w+)*(\\.\\w{2,3})+$/', $this->post_data->get('email')) ) $this->error_msg[] = 'Email should not be valid';\n \n // city should not be blank.\n if( trim($this->post_data->get('city')) == '' ) $this->error_msg[] = 'City should not be blank';\n \n // country should be somewhere from earth.\n $country = DB::table('Country')->where('code', '=', $this->post_data->get('country'))->get();\n if( empty( $country ) ) $this->error_msg[] = 'Invalid country';\n \n // permission shoulbe be 1 or 0.\n if( ! in_array($this->post_data->get('permission'), range(0, 1)) ) $this->error_msg[] = 'Invalid permission option';\n \n \n \n // validate hidden data.\n \n $company = new \\Company\\Repositories\\DBCompany;\n $company = $company->get_company_info( Config::get('application.subdomain') );\n \n // company id should be valid.\n if( $company->companyid != $this->post_data->get('company_id') ) $this->error_msg[] = 'Invalid company id';\n \n // site id should be valid.\n if( $company->siteid != $this->post_data->get('site_id') ) $this->error_msg[] = 'Invalid site id';\n \n \n \n // return true if thre's no error, false otherwise.\n return ( empty($this->error_msg) ? true : false );\n }", "public function checkValidity()\r\n {\r\n if (!parent::checkValidity())\r\n return false;\r\n\r\n if (!$this->checkUniqueCode())\r\n return false;\r\n \r\n if ($this->workflowState && strlen($this->workflowState) > 64)\r\n {\r\n $this->lastErrorMsg = _ERROR_WORKFLOWSTATE_TOO_LONG;\r\n return false;\r\n }\r\n \r\n if (trim($this->name . ' ') == '')\r\n {\r\n $this->lastErrorMsg = _ERROR_NAME_IS_MANDATORY;\r\n return false;\r\n }\r\n \r\n if (strlen($this->name) > 255)\r\n {\r\n $this->lastErrorMsg = _ERROR_NAME_TOO_LONG;\r\n return false;\r\n }\r\n \r\n if (trim($this->code . ' ') == '')\r\n {\r\n $this->lastErrorMsg = _ERROR_CODE_IS_MANDATORY;\r\n return false;\r\n }\r\n \r\n if (strlen($this->code) > 64)\r\n {\r\n $this->lastErrorMsg = _ERROR_CODE_TOO_LONG;\r\n return false;\r\n }\r\n \r\n if ($this->fromState && strlen($this->fromState) > 64)\r\n {\r\n $this->lastErrorMsg = _ERROR_CODE_TOO_LONG;\r\n return false;\r\n }\r\n \r\n if ($this->toState && strlen($this->toState) > 64)\r\n {\r\n $this->lastErrorMsg = _ERROR_CODE_TOO_LONG;\r\n return false;\r\n } \r\n \r\n return true;\r\n }", "public static function invalidMarkerShapeCoordinates()\n {\n return new static('A marker shape must have coordinates.');\n }", "public function validateData(){\n return true;\n }", "public function valid()\n {\n if ($this->container['area'] === null) {\n return false;\n }\n if ($this->container['axis_between_categories'] === null) {\n return false;\n }\n if ($this->container['axis_line'] === null) {\n return false;\n }\n if ($this->container['base_unit_scale'] === null) {\n return false;\n }\n if ($this->container['category_type'] === null) {\n return false;\n }\n if ($this->container['cross_at'] === null) {\n return false;\n }\n if ($this->container['cross_type'] === null) {\n return false;\n }\n if ($this->container['display_unit'] === null) {\n return false;\n }\n if ($this->container['display_unit_label'] === null) {\n return false;\n }\n if ($this->container['has_multi_level_labels'] === null) {\n return false;\n }\n if ($this->container['is_automatic_major_unit'] === null) {\n return false;\n }\n if ($this->container['is_automatic_max_value'] === null) {\n return false;\n }\n if ($this->container['is_automatic_minor_unit'] === null) {\n return false;\n }\n if ($this->container['is_automatic_min_value'] === null) {\n return false;\n }\n if ($this->container['is_display_unit_label_shown'] === null) {\n return false;\n }\n if ($this->container['is_logarithmic'] === null) {\n return false;\n }\n if ($this->container['is_plot_order_reversed'] === null) {\n return false;\n }\n if ($this->container['is_visible'] === null) {\n return false;\n }\n if ($this->container['log_base'] === null) {\n return false;\n }\n if ($this->container['major_grid_lines'] === null) {\n return false;\n }\n if ($this->container['major_tick_mark'] === null) {\n return false;\n }\n if ($this->container['major_unit'] === null) {\n return false;\n }\n if ($this->container['major_unit_scale'] === null) {\n return false;\n }\n if ($this->container['max_value'] === null) {\n return false;\n }\n if ($this->container['minor_grid_lines'] === null) {\n return false;\n }\n if ($this->container['minor_tick_mark'] === null) {\n return false;\n }\n if ($this->container['minor_unit'] === null) {\n return false;\n }\n if ($this->container['minor_unit_scale'] === null) {\n return false;\n }\n if ($this->container['min_value'] === null) {\n return false;\n }\n if ($this->container['tick_label_position'] === null) {\n return false;\n }\n if ($this->container['tick_labels'] === null) {\n return false;\n }\n if ($this->container['tick_label_spacing'] === null) {\n return false;\n }\n if ($this->container['tick_mark_spacing'] === null) {\n return false;\n }\n if ($this->container['title'] === null) {\n return false;\n }\n if ($this->container['link'] === null) {\n return false;\n }\n return true;\n }", "public function isValid()\n\t{\n\t\tif (empty($this->titre)) $this->titre = \"TITRE A REMPLACER\";\n\t\telse $this->titre = trim (preg_replace('/\\s+/', ' ', $this->titre) ); // Suppression des espaces\n\t\tif (!empty($this->contenu)) $this->contenu = trim (preg_replace('/\\s+/', ' ', $this->contenu) ); // Suppression des espaces\n\t\tif (empty($this->statut)) $this->statut = 0;\n\t\tif (empty($this->id_type)) $this->id_type = 1;\n\t\tif (empty($this->id_membre)) $this->id_membre = 0;\n\t}", "public function validateEditSegment($data)\n {\n self::$rules = [\n 'name' => 'required',\n 'result' => 'required',\n 'winner' => 'required|different:loser',\n 'loser' => 'required',\n ];\n $this->validate($data);\n }", "public function validate() {\r\n // Name - this is required\r\n if ($this->description == '') {\r\n $this->errors[] = 'Description is required';\r\n } \r\n \r\n // Category number - must be a number\r\n if (!is_numeric($this->category)) {\r\n $this->category = 0;\r\n } \r\n \r\n // Item number - must be a number\r\n if (!is_numeric($this->item)) {\r\n $this->item = 0;\r\n } \r\n }", "protected function validate(&$data,$nonce_name) {\n\t\tglobal $wpdb;\n\t\t$is_valid = parent::validate($data,$nonce_name);\n\t\tif($is_valid && is_array($data)) {\n\t\t\t$is_valid = true ;\n\t\t\t// Check if date is empty\n\t\t\tif(empty($data[\"event_start_date\"])) {\n\t\t\t\t$is_valid = false ;\n\t\t\t\t$this->add_db_result(\"event_start_date\",\"required\",\"Start Date is missing\");\n\t\t\t}\n\t\t\t// Check if date format is valid\n\t\t\telse if($data[\"event_start_date\"] === null) {\n\t\t\t\t$is_valid = false ;\n\t\t\t\t$this->add_db_result(\"event_start_date\",\"field\",\"Start Date format is not valid\");\n\t\t\t}\n\t\t\t// Multi Day Event\n\t\t\t// Check if date format is valid\n\t\t\tif($data[\"event_end_date\"] === null) {\n\t\t\t\t$is_valid = false ;\n\t\t\t\t$this->add_db_result(\"event_end_date\",\"field\",\"End Date is missing\");\n\t\t\t}\n\t\t\t// Check if start date is lower\\equel to end date \n\t\t\tif(!empty($data[\"event_start_date\"]) && !empty($data[\"event_end_date\"])) {\n\t\t\t\tif(strtotime($data[\"event_start_date\"]) > strtotime($data[\"event_end_date\"])) {\n\t\t\t\t\t$is_valid = false ;\n\t\t\t\t\t$this->add_db_result(\"event_end_date\",\"required\",\"Event can't end before it starts\");\n\t\t\t\t}\n\t\t\t} \n\t\t\t\n\t\t\tif(isset($data[\"event_tour_id\"])) {\n\t\t\t\tif(!is_numeric($data[\"event_tour_id\"])) {\n\t\t\t\t\t$is_valid = false;\n\t\t\t\t\t$this->add_db_result(\"event_tour_id\",\"required\",\"Tour information is invalid\");\t\n\t\t\t\t} \n\t\t\t} else {\n\t\t\t\t$tour_name = trim($data[\"tour_name\"]); \n\t\t\t\tif(!empty($tour_name) && !is_numeric($tour_name)) {\n\t\t\t\t\t$is_tour = $wpdb->get_row(\"SELECT tour_id FROM \".WORDTOUR_TOUR.\" WHERE UPPER(tour_name)='\".trim(strtoupper($data[\"tour_name\"]).\"'\"),\"ARRAY_A\");\n\t\t\t\t\tif($is_tour) {\n\t\t\t\t\t\t$data[\"event_tour_id\"] = $is_tour[\"tour_id\"];\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$is_valid = false ;\n\t\t\t\t\t\t$this->add_db_result(\"tour_name\",\"required\",\"Tour '$data[tour_name]' doesn't exist\");\n\t\t\t\t\t}\n\t\t\t\t}\t\n\t\t\t}\n\t\t\n\t\t\tif(isset($data[\"event_venue_id\"])) {\n\t\t\t\tif(!is_numeric($data[\"event_venue_id\"])) {\n\t\t\t\t\t$is_valid = false;\n\t\t\t\t\t$this->add_db_result(\"event_venue_id\",\"required\",\"Venue information is invalid\");\t\n\t\t\t\t} \n\t\t\t} else {\n\t\t\t\tif(empty($data[\"venue_name\"])) {\n\t\t\t\t\t$is_valid = false ;\n\t\t\t\t\t$this->add_db_result(\"venue_name\",\"required\",\"Venue is missing\");\n\t\t\t\t} else if(!is_numeric($data[\"venue_name\"])) {\n\t\t\t\t\t$is_venue = $wpdb->get_row(\"SELECT venue_id FROM \".WORDTOUR_VENUES.\" WHERE UPPER(venue_name)='\".trim(strtoupper($data[\"venue_name\"]).\"'\"),\"ARRAY_A\");\n\t\t\t\t\tif($is_venue) {\n\t\t\t\t\t\t$data[\"event_venue_id\"] = $is_venue[\"venue_id\"];\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$is_valid = false ;\n\t\t\t\t\t\t$this->add_db_result(\"venue_name\",\"required\",\"Venue '$data[venue_name]' doesn't exist\");\n\t\t\t\t\t}\n\t\t\t\t}\t\n\t\t\t}\n\t\t\t\n\t\t\tif(isset($data[\"event_artist_id\"])) {\n\t\t\t\tif(!is_numeric($data[\"event_artist_id\"])) {\n\t\t\t\t\t$is_valid = false;\n\t\t\t\t\t$this->add_db_result(\"event_artist_id\",\"required\",\"Artist information is invalid\");\t\n\t\t\t\t} \n\t\t\t} else {\n\t\t\t\tif(empty($data[\"artist_name\"])) {\n\t\t\t\t\t$is_valid = false ;\n\t\t\t\t\t$this->add_db_result(\"artist_name\",\"required\",\"Artist is missing\");\n\t\t\t\t} else if(!is_numeric($data[\"artist_name\"])) {\n\t\t\t\t\t$is_artist = $wpdb->get_row(\"SELECT artist_id FROM \".WORDTOUR_ARTISTS.\" WHERE UPPER(artist_name)='\".trim(strtoupper($data[\"artist_name\"]).\"'\"),\"ARRAY_A\");\n\t\t\t\t\tif($is_artist) {\n\t\t\t\t\t\t$data[\"event_artist_id\"] = $is_artist[\"artist_id\"];\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$is_valid = false ;\n\t\t\t\t\t\t$this->add_db_result(\"artist_name\",\"required\",\"Artist '$data[artist_name]' doesn't exist\");\n\t\t\t\t\t}\n\t\t\t\t}\t\n\t\t\t}\n\t\t\t\n\t\t\tif(isset($data[\"event_more_artists\"])) {\n\t\t\t\t$more_artists = json_decode(stripslashes($data[\"event_more_artists\"]));\n\t\t\t\t$more_artists_exist_error = array();\n\t\t\t\t$more_artists_error = array();\n\t\t\t\t$more_artists_is_valid = 1;\n\t\t\t\t$more_artists_id = array();\n\t\t\t\tif(is_array($more_artists)) {\n\t\t\t\t\tforeach($more_artists as $artist_name) {\n\t\t\t\t\t\t$name = addslashes(trim(strtoupper($artist_name)));\n\t\t\t\t\t\tif(!empty($name)) {\n\t\t\t\t\t\t\t// check if artist exist in the system\n\t\t\t\t\t\t\t$is_artist = $wpdb->get_row($wpdb->prepare(\"SELECT artist_id FROM \".WORDTOUR_ARTISTS.\" WHERE UPPER(artist_name)='\".$name.\"'\"),\"ARRAY_A\");\n\t\t\t\t\t\t\t//print_r($wpdb);\n\t\t\t\t\t\t\tif(!$is_artist) {\n\t\t\t\t\t\t\t\t$is_valid = false ;\n\t\t\t\t\t\t\t\t$more_artists_is_valid = 0;\n\t\t\t\t\t\t\t\t$more_artists_exist_error[] = \"<i>'$artist_name'</i>\";\t\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tif($name == trim(strtoupper($data[\"artist_name\"]))) {\n\t\t\t\t\t\t\t\t\t$is_valid = false ;\n\t\t\t\t\t\t\t\t\t$more_artists_is_valid = 0;\n\t\t\t\t\t\t\t\t\t$more_artists_error[] = \"Additional Artist <i>'$artist_name'</i> is already assigned\";\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t$more_artists_id[] = $is_artist[\"artist_id\"]; \n\t\t\t\t\t\t\t\t}\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif(!$more_artists_is_valid) {\n\t\t\t\t\t\t$more_artists_msg = \"\"; \n\t\t\t\t\t\tif(count($more_artists_exist_error)>0) {\n\t\t\t\t\t\t\t$more_artists_msg.= \"Additional Artist \".implode(\", \",$more_artists_exist_error).\" doesn't exist, \";\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(count($more_artists_error)>0) {\n\t\t\t\t\t\t\t$more_artists_msg.= implode(\", \",$more_artists_error);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$this->add_db_result(\"event_more_artists\",\"required\",$more_artists_msg);\t\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$data[\"event_more_artists\"] = array_unique($more_artists_id);\n\t\t\t\t\t} \n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tif(!empty($data[\"tkts_url\"]) && !is_valid_url($data[\"tkts_url\"])) {\n\t\t\t\t$is_valid = false ;\n\t\t\t\t$this->add_db_result(\"tkts_url\",\"required\",\"Buy Tickt url in not valid, the required format is http://your_website_url\");\t\n\t\t\t}\n\t\t\t\n\t\t\tif(!$is_valid) $this->db_result(\"error\",null,array(\"data\"=>$this->db_response_msg));\t\t\n\t\t}\n\t\treturn $is_valid;\n\t}", "public function doValidate(){\n if (!is_array($this->getValidates())){\n throw new \\Exception(\"dose this function must call setValidate() function first.\");\n }\n\n foreach($this->getValidates() as $k => $v){\n //$v = (ValidateData)$v;\n if (TextUtils::isEmpty($v->getInput()) && $v->getRequire() == true){\n $v->setResult(false);\n }else{\n $v->setResult(true);\n }\n\n if ($v->getResult() && !TextUtils::isEmpty($v->getInput())){\n switch($v->getValidator()){\n case ValidateData::VALIDATOR_CUSTOM:\n $v->setResult($this->check($v->getInput(),$v->getRegexp()));\n break;\n case ValidateData::VALIDATOR_COMPARE:\n $result = false;\n if (!TextUtils::isEmpty($v->getOperator())){\n switch ($v->getOperator()){\n case ValidateData::OPERATOR_EQUIVALENT:\n $result = $v->getInput() == $v->getTo();\n break;\n case ValidateData::OPERATOR_GREATER:\n $result = $v->getInput() > $v->getTo();\n break;\n case ValidateData::OPERATOR_LESS:\n $result = $v->getInput() < $v->getTo();\n break;\n case ValidateData::OPERATOR_EQUIVALENT_GREATER:\n $result = $v->getInput() >= $v->getTo();\n break;\n case ValidateData::OPERATOR_EQUIVALENT_LESS:\n $result = $v->getInput() <= $v->getTo();\n break;\n case ValidateData::OPERATOR_NOT_EQUIVALENT:\n $result = $v->getInput() != $v->getTo();\n break;\n }\n\n }\n $v->setResult($result);\n break;\n case ValidateData::VALIDATOR_LENGTH:\n $len = mb_strlen($v->getInput(),'UTF-8');\n $v->setResult($len >= $v->getMin());\n if ($v->getMax() > $v->getMin()){\n $v->setResult($len <= $v->getMax() && $len >= $v->getMin());\n }\n\n break;\n\n case ValidateData::VALIDATOR_RANGE:\n $v->setResult((int)$v->getInput() >= $v->getMin());\n if ($v->getMax() > $v->getMin()){\n $v->setResult((int)$v->getInput() <= $v->getMax() && (int)$v->getInput() >= $v->getMin());\n }\n\n break;\n default:\n $v->setResult($this->check($v->getInput(),$this->getValidator($v->getValidator())));\n break;\n }\n }\n }\n return $this->getError();\n }", "public function validate() {\n if (!empty($this->value)) {\n parent::validate();\n }\n }", "public function validate() {\n if (!empty($this->value)) {\n parent::validate();\n }\n }", "public function validate()\n {\n if ($this->amount <= 0) {\n $this->errors[0] = 'Wpisz poprawną kwotę!';\n }\n \n if (!isset($this->payment)) {\n $this->errors[1] = 'Wybierz sposób płatności!';\n }\n \n if (!isset($this->category)) {\n $this->errors[2] = 'Wybierz kategorię!';\n }\n }", "public function valid()\n {\n\n if (strlen($this->container['virtual_operator']) > 60) {\n return false;\n }\n if (strlen($this->container['event_type']) > 100) {\n return false;\n }\n if (strlen($this->container['result_status']) > 100) {\n return false;\n }\n if (strlen($this->container['username']) > 100) {\n return false;\n }\n if (strlen($this->container['property_value']) > 450) {\n return false;\n }\n return true;\n }", "public function validate()\n\t{\n\t\t$errors = array();\n\t\t\n\t\t//make sure user is logged in\n\t\tif (empty($this->userid)) \n\t\t{\n\t\t\t$errors['userid'] = true;\n\t\t}\n\t\t\n\t\t//verify all info is provided\n\t\tif (isset($this->title))\n\t\t\t$this->title = strip_tags($this->title);\n\t\telse\n\t\t\t$errors['title'] = true;\n\t\t\t\n\t\tif (isset($this->description))\n\t\t\t$this->description = strip_tags($this->description);\n\t\telse\n\t\t\t$errors['description'] = true;\n\t\t\t\n\t\tif (isset($this->content))\n\t\t\t$this->content = strip_tags($this->content, \"<br><b>\");\n\t\telse\n\t\t\t$errors['content'] = true;\n\t\t\t\n\t\tif (isset($this->location))\n\t\t\t$this->location = strip_tags($this->location);\n\t\telse\n\t\t\t$errors['location'] = true;\n\t\t\n\t\tif (!isset($this->category))\n\t\t\t$errors['category'] = true;\n\t\t\t\n\t\tif (!isset($this->enddatetime))\n\t\t\t$errors['enddatetime'] = true;\n\t\t\n\t\t\n\t\t//If we made it here, all is valid\n\t\tif (count($errors) > 0)\n\t\t\treturn $errors;\n\t\telse\n\t\t\treturn NULL;\n\t}", "public function processPosition()\n {\n $name = Tools::getValue('name');\n $position = Tools::getValue('position');\n $id_position = (int)Tools::getValue('id');\n $mode = Tools::getValue('mode');\n if ($mode == 'duplicate') {\n $adapter = new AdminApPageBuilderPositionsController();\n $id_position = $adapter->duplicatePosition($id_position, 'ajax', $name);\n } else if ($mode == 'new') {\n $key = ApPageSetting::getRandomNumber();\n $name = $name ? $name : $position.$key;\n $position_controller = new AdminApPageBuilderPositionsController();\n\n $position_data = array(\n 'name' => $name,\n 'position' => $position,\n 'position_key' => 'position'.$key,\n );\n $id_position = $position_controller->autoCreatePosition($position_data);\n } else if ($mode == 'edit') {\n // Edit only name\n $position_controller = new AdminApPageBuilderPositionsController();\n $position_controller->updateName($id_position, $name);\n }\n // Reload position\n if ($mode == 'new' || $mode == 'duplicate') {\n $this->selectPosition($id_position);\n } else {\n die(Tools::jsonEncode(array('status' => 'SUCCESS')));\n }\n }", "function validate()\n\t{\n\t\t$isValid = false;\n\t\t\n\t\tif(empty($this->data['username']))\n\t\t{\n\t\t\t\t$this->errors['username'] = \"Please enter a Username\";\n\t\t}\n\t\t\n\t\tif(empty($this->data['password']))\n\t\t{\n\t\t\t\t$this->errors['password'] = \"Please enter a password\";\n\t\t}\n\t\t\n\t\tif(empty($this->data['description']))\n\t\t{\n\t\t\t\t$this->errors['description'] = \"Please enter a description of yourself\";\n\t\t}\n\t\t\n\t\t\n\t\t//validate data elements in userData property\n\t\t//if an error exists, store to errors using column name as key\n\t\t\n\t\t if(empty($this->errors))\n\t\t{\n\t\t\t$isValid = true;\n\t\t}\n\t\t\n\t\treturn $isValid;\n\t}", "public function beforeSave()\n {\n $value = $this->getValue();\n try {\n $this->validate($value);\n } catch (\\Magento\\Framework\\Exception\\LocalizedException $e) {\n $msg = __('%1', $e->getMessage());\n $error = new \\Magento\\Framework\\Exception\\LocalizedException($msg, $e);\n throw $error;\n }\n }", "public function valid()\n {\n if ($this->container['priority'] === null) {\n return false;\n }\n if ($this->container['type'] === null) {\n return false;\n }\n if ($this->container['stop_if_true'] === null) {\n return false;\n }\n if ($this->container['above_average'] === null) {\n return false;\n }\n if ($this->container['color_scale'] === null) {\n return false;\n }\n if ($this->container['data_bar'] === null) {\n return false;\n }\n if ($this->container['formula1'] === null) {\n return false;\n }\n if ($this->container['formula2'] === null) {\n return false;\n }\n if ($this->container['icon_set'] === null) {\n return false;\n }\n if ($this->container['operator'] === null) {\n return false;\n }\n if ($this->container['style'] === null) {\n return false;\n }\n if ($this->container['text'] === null) {\n return false;\n }\n if ($this->container['time_period'] === null) {\n return false;\n }\n if ($this->container['top10'] === null) {\n return false;\n }\n if ($this->container['link'] === null) {\n return false;\n }\n return true;\n }", "private function validatePositions(array $pos_arr) {\n foreach ($pos_arr as $key => $position) {\n if (!is_numeric($position) && $position != '0') {\n $position = intval($position);\n \n // return value of 0 from intval = failure\n if ($position == 0) {\n trigger_error(\"Position array[$key] is not numeric.\");\n }\n }\n if ($position == '0') {\n $position = 0;\n }\n }\n return $pos_arr;\n }", "protected function validate()\r\n\t{\r\n\t\tif (!$this->isFetched())\r\n\t\t{\r\n\t\t\treturn;\r\n }\r\n \r\n\t\tif ($this->validationInfo)\r\n\t\t{\r\n\t\t\t$this->validationInfo->validate($this->normalizedValue);\r\n\t\t}\r\n\t\t$this->isValid = true;\r\n\t}", "public function isValid($data) {\n //Remove Commas \n $data = str_replace(\",\", \"\", $data);\n \n $data['heatLossMethod']='percent';\n \n $precision = $this->mS->masterConversionList['temperature'][1][$this->mS->selected['temperature']][4];\n $iapws = new Steam_IAPWS();\n $maxTemp = $this->mS->ceil_dec($this->mS->localize($iapws->saturatedTemperature($this->mS->standardize($data['daPressure'], 'pressure')),'temperature'),$precision); \n \n if ($data['condReturnTemp']>=$maxTemp or $data['condReturnTemp']<=$this->mS->minTemperature()){\n $this->getElement('condReturnTemp')->addValidator('between', true, array('min' => $this->mS->minTemperature(), 'max' => $maxTemp, 'inclusive' => false));\n }\n \n \n $precision = $this->mS->masterConversionList['temperature'][1][$this->mS->selected['temperature']][4];\n $iapws = new Steam_IAPWS();\n $minTemp = $this->mS->ceil_dec($this->mS->localize($iapws->saturatedTemperature($this->mS->standardize($data['highPressure'],'pressure')),'temperature'),$precision);\n if ($data['boilerTemp']<$minTemp){\n $this->getElement('boilerTemp')\n ->addValidator('greaterThan', true, array('min' => $minTemp, 'messages' => '%value% is below the boiling temperature [%min%] for boiler pressure.'));\n }\n \n \n if ($data['headerCount']<3){\n $data['turbineHpMpOn'] = null;\n $data['turbineMpLpOn'] = null;\n $data['desuperHeatHpMp']=='No';\n if ($data['mpCondReturnRate']=='') $data['mpCondReturnRate'] = 0;\n if ($data['lpCondReturnRate']=='') $data['lpCondReturnRate'] = 0;\n }\n if ($data['headerCount']<2){\n $data['turbineHpLpOn'] = null;\n $data['desuperHeatMpLp']=='No';\n }\n \n if ($data['headerCount']==3){\n if($data['desuperHeatHpMp']=='Yes'){ \n $this->getElement('desuperHeatHpMpTemp')\n ->setRequired(true)\n ->addValidator($this->isFloat,true)\n ->addValidator('between', true, array('min' => $this->mS->minTemperature(), 'max' => $this->mS->maxTemperature(), 'inclusive' => true));\n }\n }\n if ($data['headerCount']>=2){\n if($data['desuperHeatMpLp']=='Yes'){ \n $this->getElement('desuperHeatMpLpTemp')\n ->setRequired(true)\n ->addValidator($this->isFloat,true)\n ->addValidator('between', true, array('min' => $this->mS->minTemperature(), 'max' => $this->mS->maxTemperature(), 'inclusive' => true)); \n }\n }\n\n \n if($data['blowdownHeatX']=='Yes'){ \n $this->getElement('blowdownHeatXTemp')\n ->setRequired(true)\n ->addValidator($this->isFloat,true)\n ->addValidator('greaterThan', true, array('min' => 0, 'max' => $this->mS->maxTemperature(), 'inclusive' => true));\n }\n \n foreach(Steam_Support::steamTurbineCodes() as $turbine){\n if ($data['turbine'.$turbine.'On']==1){\n $this->getElement('turbine'.$turbine.'IsoEff')->setRequired('true')\n ->addValidator($this->isFloat)\n ->addValidator('Between', true, array('min' => ISOEFF_MIN, 'max' => ISOEFF_MAX));\n $this->getElement('turbine'.$turbine.'GenEff')->setRequired('true')\n ->addValidator($this->isFloat)\n ->addValidator('Between', true, array('min' => GENEFF_MIN, 'max' => GENEFF_MAX));\n \n if ($turbine=='Cond'){\n $this->getElement('turbineCondOutletPressure')->setRequired(true)\n ->addValidator($this->isFloat,true)\n ->addValidator('between', true, array('min' => $this->mS->minVacuum(), 'max' => $this->mS->condVacuum(), 'inclusive' => true));\n }\n \n switch($data['turbine'.$turbine.'Method']){\n case 'fixedFlow':\n $this->getElement('turbine'.$turbine.'FixedFlow')->setRequired('true')\n ->addValidator($this->isFloat)\n ->addValidator('between', true, array('min' => $this->mS->minMassflow(), 'max' => $this->mS->maxMassflow(), 'inclusive' => false)); \n break;\n case 'flowRange':\n $this->getElement('turbine'.$turbine.'MinFlow')->setRequired('true')\n ->addValidator($this->isFloat)\n ->addValidator('between', true, array('min' => $this->mS->minMassflow(), 'max' => $data['turbine'.$turbine.'MaxFlow'])); \n \n $this->getElement('turbine'.$turbine.'MaxFlow')->setRequired('true')\n ->addValidator($this->isFloat)\n ->addValidator('between', true, array('min' => $this->mS->minMassflow(), 'max' => $this->mS->maxMassflow(), 'inclusive' => false));\n break;\n\n case 'fixedPower':\n $this->getElement('turbine'.$turbine.'FixedPower')->setRequired('true')\n ->addValidator($this->isFloat)\n ->addValidator('greaterThan', true, array('min' => 0)); \n break;\n case 'powerRange':\n $this->getElement('turbine'.$turbine.'MinPower')->setRequired('true')\n ->addValidator($this->isFloat)\n ->addValidator('between', true, array('min' => 0, 'max' => $data['turbine'.$turbine.'MaxPower'])); \n \n $this->getElement('turbine'.$turbine.'MaxPower')->setRequired('true')\n ->addValidator($this->isFloat)\n ->addValidator('greaterThan', true, array('min' => 0)); \n break;\n\n case 'balanceHeader':\n break;\n }\n }\n }\n \n $this->getElement('hpSteamUsage')->addValidator('between', true, array('min' => $this->mS->minMassflow(), 'max' => $this->mS->maxMassflow(), 'inclusive' => true));\n \n $this->getElement('hpHeatLossPercent')->setRequired(true)\n ->addValidator($this->isFloat,true)\n ->addValidator('between', true, array('min' => HEATLOST_PERCENT_MIN, 'max' => HEATLOST_PERCENT_MAX, 'inclusive' => true));\n \n \n if ($data['headerCount']==3){\n $tmp = $this->getElement('mediumPressure')->setRequired(true)\n ->addValidator($this->isFloat,true);\n if (isset($data['highPressure'])) $tmp->addValidator('lessThan', true, array('max' => $data['highPressure'], 'messages' => 'Must be less than High Pressure.'));\n $tmp->addValidator('greaterThan', true, array('min' => $this->mS->minPressure()));\n $tmp = $this->getElement('lowPressure')->setRequired(true)\n ->addValidator($this->isFloat,true);\n if (isset($data['mediumPressure'])) $tmp->addValidator('lessThan', true, array('max' => $data['mediumPressure'], 'messages' => 'Must be less than Medium Pressure.'));\n $tmp->addValidator('greaterThan', true, array('min' => $this->mS->minPressure())); \n if (isset($data['lowPressure'])) $this->getElement('daPressure')->addValidator('lessThan', true, array('max' => $data['lowPressure'], 'messages' => 'Must be below lowest steam header pressure.'));\n \n \n $this->getElement('mpSteamUsage')->setRequired(true)\n ->addValidator($this->isFloat,true);\n $this->getElement('mpSteamUsage')->addValidator('between', true, array('min' => $this->mS->minMassflow(), 'max' => $this->mS->maxMassflow(), 'inclusive' => true)); \n \n $this->getElement('mpCondReturnRate')->setRequired(true)\n ->addValidator($this->isFloat,true)\n ->addValidator('between', true, array('min' => 0, 'max' => 100, 'inclusive' => true));\n \n $this->getElement('mpHeatLossPercent')->setRequired(true)\n ->addValidator($this->isFloat,true)\n ->addValidator('between', true, array('min' => HEATLOST_PERCENT_MIN, 'max' => HEATLOST_PERCENT_MAX, 'inclusive' => true)); \n }\n \n if ($data['headerCount']==2){\n \n $tmp = $this->getElement('lowPressure')->setRequired(true)\n ->addValidator($this->isFloat,true);\n if (isset($data['highPressure'])) $tmp->addValidator('lessThan', true, array('max' => $data['highPressure'], 'messages' => 'Must be less than High Pressure.'));\n $tmp->addValidator('greaterThan', true, array('min' => $this->mS->minPressure())); \n if (isset($data['lowPressure'])) $this->getElement('daPressure')->addValidator('lessThan', true, array('max' => $data['lowPressure'], 'messages' => 'Must be below lowest steam header pressure.'));\n \n }\n \n if ($data['headerCount']>=2){\n \n $this->getElement('lpSteamUsage')->setRequired(true)\n ->addValidator($this->isFloat,true);\n \n $this->getElement('lpSteamUsage')->addValidator('between', true, array('min' => $this->mS->minMassflow(), 'max' => $this->mS->maxMassflow(), 'inclusive' => true)); \n \n $this->getElement('lpCondReturnRate')->setRequired(true)\n ->addValidator($this->isFloat,true)\n ->addValidator('between', true, array('min' => 0, 'max' => 100, 'inclusive' => true));\n \n $this->getElement('lpHeatLossPercent')->setRequired(true)\n ->addValidator($this->isFloat,true)\n ->addValidator('between', true, array('min' => HEATLOST_PERCENT_MIN, 'max' => HEATLOST_PERCENT_MAX, 'inclusive' => true)); \n }\n \n if ($data['headerCount']==1){ \n if (isset($data['highPressure'])) $this->getElement('daPressure')->addValidator('lessThan', true, array('max' => $data['highPressure'], 'messages' => 'Must be below lowest steam header pressure.')); \n \n } \n return parent::isValid($data);\n }", "public function provideValidCoordinates() {\n return [\n ['39.7392° N, 104.9903° W'],\n ['-39.7392° N, 104.9903° W'],\n ['39.7392° N, -104.9903° W'],\n ['-39.7392° N, -104.9903° W'],\n ];\n }", "private function checkData(){\n $this->datavalidator->addValidation('article_title','req',$this->text('e10'));\n $this->datavalidator->addValidation('article_title','maxlen=250',$this->text('e11'));\n $this->datavalidator->addValidation('article_prologue','req',$this->text('e12'));\n $this->datavalidator->addValidation('article_prologue','maxlen=3000',$this->text('e13'));\n $this->datavalidator->addValidation('keywords','regexp=/^[^,\\s]{3,}(,? ?[^,\\s]{3,})*$/',$this->text('e32'));\n $this->datavalidator->addValidation('keywords','maxlen=500',$this->text('e33'));\n if($this->data['layout'] != 'g' && $this->data['layout'] != 'h'){ //if article is gallery dont need content\n $this->datavalidator->addValidation('article_content','req',$this->text('e14'));\n }\n $this->datavalidator->addValidation('id_menucategory','req',$this->text('e15'));\n $this->datavalidator->addValidation('id_menucategory','numeric',$this->text('e16'));\n $this->datavalidator->addValidation('layout','req',$this->text('e17'));\n $this->datavalidator->addValidation('layout','maxlen=1',$this->text('e18'));\n if($this->languager->getLangsCount() > 1){\n $this->datavalidator->addValidation('lang','req',$this->text('e19'));\n $this->datavalidator->addValidation('lang','numeric',$this->text('e20'));\n }\n //if user cannot publish articles check publish values\n if($_SESSION[PAGE_SESSIONID]['privileges']['articles'][2] == '1') {\n $this->datavalidator->addValidation('published','req',$this->text('e21'));\n $this->datavalidator->addValidation('published','numeric',$this->text('e22'));\n $this->datavalidator->addValidation('publish_date','req',$this->text('e23'));\n }\n $this->datavalidator->addValidation('topped','req',$this->text('e24'));\n $this->datavalidator->addValidation('topped','numeric',$this->text('e25'));\n $this->datavalidator->addValidation('homepage','req',$this->text('e30'));\n $this->datavalidator->addValidation('homepage','numeric',$this->text('e31'));\n $this->datavalidator->addValidation('showsocials','req',$this->text('e26'));\n $this->datavalidator->addValidation('showsocials','numeric',$this->text('e27'));\n \n $result = $this->datavalidator->ValidateData($this->data);\n if(!$result){\n $errors = $this->datavalidator->GetErrors();\n return array('state'=>'error','data'=> reset($errors));\n }else{\n return true;\n }\n }", "public function validate($data) {\n $data = $this->gump->sanitize($data);\n $this->gump->validation_rules(array(\n 'name' => 'required|max_len,100',\n 'capacity' => 'required|numeric',\n 'color' => 'required|max_len,7'\n ));\n\n $this->gump->filter_rules(array(\n 'name' => 'trim|sanitize_string',\n 'capacity' => 'trim|sanitize_string',\n 'color' => 'trim|sanitize_string',\n ));\n\n $validated_data = $this->gump->run($data);\n if ($validated_data === false) {\n $errArr = $this->gump->get_readable_errors();\n $errString = \"\";\n foreach ($errArr as $k => $err) {\n $errString .= $err . '<br>';\n }\n throw new Exception($errString);\n } else {\n return $data;\n }\n }", "function validate() {\n\t\t// execute the column validation \n\t\tparent::validate();\n\t\t\n\t\t// connection\t\t\n\t\t$conn = Doctrine_Manager::connection();\n\t\t\n\t\t// query for check if location exists\n\t\t$unique_query = \"SELECT id FROM company WHERE name = '\".$this->getName().\"' AND id <> '\".$this->getID().\"'\";\n\t\t$result = $conn->fetchOne($unique_query);\n\t\t// debugMessage($unique_query);\n\t\t// debugMessage(\"result is \".$result);\n\t\tif(!isEmptyString($result)){ \n\t\t\t$this->getErrorStack()->add(\"unique.name\", \"The name \".$this->getName().\" already exists. Please specify another.\");\n\t\t}\n\t}", "public static function invalidMarkerPosition()\n {\n return new static(sprintf(\n '%s'.PHP_EOL.'%s'.PHP_EOL.'%s'.PHP_EOL.'%s',\n 'The position setter arguments is invalid.',\n 'The available prototypes are :',\n ' - function setPosition(Fungio\\GoogleMap\\Base\\Coordinate $position)',\n ' - function setPosition(double $latitude, double $longitude, boolean $noWrap = true)'\n ));\n }", "function validate()\n {\n if (!$this->ParentId && !$this->Content)\n throw Exception(\"ParentId and Content cannot both be NULL\");\n }", "protected function validate() {\r\n if ($this->getBaseAmount() <= 0)\r\n $this->errors->add(\"The base amount of alicuota must be greater than 0.\");\r\n// \t\t\telse\r\n// \t\t\t{\r\n// \t\t\t\t$relativeError = (($this->getTaxAmount() / $this->getBaseAmount() * 100) - $this->getTaxPercent());\r\n// \t\t\t\t$relativeError = $relativeError / $this->getTaxPercent();\r\n// \t\t\t\t$relativeError = NumberDataTypeHelper::truncate($relativeError, 2);\r\n// \t\t\t\tif (abs($relativeError) > 0.01)\r\n// \t\t\t\t\t$this->errors->add(\"The base and tax amount do not match with the alicuota ({$this->getName()}). Diference: $relativeError\");\r\n// \t\t\t}\r\n }", "public function rules()\n {\n return [\n 'coor_x_origin' => 'required|numeric',\n 'coor_y_origin' => 'required|numeric'\n ];\n }", "abstract protected function validate($data);", "public static function invalidMarkerShapeRectCoordinates()\n {\n return new static(sprintf(\n '%s'.PHP_EOL.'%s',\n 'The coordinates setter arguments is invalid if the marker shape type is rect.',\n 'The available prototype is : function setCoordinates('.\n 'array(double $x1, double $y1, double $x2, double $y2)'.\n ')'\n ));\n }", "public function valid() {\n\t\treturn isset($this->data[$this->position]);\n\t}", "public function normalizeData()\n {\n if (is_numeric($this->Streetname2)) {\n $this->HouseNumber = $this->Streetname2;\n $this->Streetname2 = \"\";\n }\n\n// Sometimes people will input - To mean Idfk why are you asking me to input this?\n if ($this->Phone && strlen($this->Phone) < 3) {\n $this->addMessage($this->getFormatedMessage(\"Invalid Phone [$this->Phone] ignoring\"));\n $this->Phone = '';\n }\n\n if ($this->State && strlen($this->State) < 2) {\n $this->addMessage($this->getFormatedMessage(\"Invalid State [$this->State] ignoring\"));\n $this->State = '';\n }\n\n if ($this->CompanyName && strlen($this->CompanyName) < 3) {\n $this->addMessage($this->getFormatedMessage(\"Invalid CompanyName[$this->CompanyName] ignoring \"));\n $this->CompanyName = '';\n }\n\n $this->Description = $this->escapeTextData($this->Description);\n if ($this->Description && strlen($this->Description) > 255) {\n $this->Description = substr($this->Description, 0, 255);\n\n //Make sure we are not sending a broken special char\n $descChars = str_split($this->Description); \n for ($i = 254; $i > 251; --$i) {\n if ($descChars[$i] == '&') {\n $this->Description = substr($this->Description, 0, $i);\n }\n }\n }\n\n if($this->Description && strlen($this->Description) < 3) {\n $this->addMessage($this->getFormatedMessage(\"Invalid description $this->Description ignoring \"));\n $this->Description = ''; \n }\n }", "public function valid()\n {\n\n if (strlen($this->container['company_name']) > 254) {\n return false;\n }\n if (strlen($this->container['company_name']) < 0) {\n return false;\n }\n if ($this->container['firstname'] === null) {\n return false;\n }\n if (strlen($this->container['firstname']) > 255) {\n return false;\n }\n if (strlen($this->container['firstname']) < 0) {\n return false;\n }\n if ($this->container['lastname'] === null) {\n return false;\n }\n if (strlen($this->container['lastname']) > 255) {\n return false;\n }\n if (strlen($this->container['lastname']) < 0) {\n return false;\n }\n if ($this->container['street'] === null) {\n return false;\n }\n if (strlen($this->container['street']) > 254) {\n return false;\n }\n if (strlen($this->container['street']) < 3) {\n return false;\n }\n if ($this->container['post_code'] === null) {\n return false;\n }\n if (strlen($this->container['post_code']) > 40) {\n return false;\n }\n if (strlen($this->container['post_code']) < 2) {\n return false;\n }\n if ($this->container['city'] === null) {\n return false;\n }\n if (strlen($this->container['city']) > 99) {\n return false;\n }\n if (strlen($this->container['city']) < 2) {\n return false;\n }\n if ($this->container['country_code'] === null) {\n return false;\n }\n if (strlen($this->container['country_code']) > 2) {\n return false;\n }\n if (strlen($this->container['country_code']) < 0) {\n return false;\n }\n if (strlen($this->container['telephone']) > 99) {\n return false;\n }\n if (strlen($this->container['telephone']) < 0) {\n return false;\n }\n return true;\n }", "public function validation($data, $files) {\r\n\r\n // // Check open and close times are consistent.\r\n // if ($data['timeopen'] != 0 && $data['timeclose'] != 0 &&\r\n // $data['timeclose'] < $data['timeopen']) {\r\n // $errors['timeclose'] = get_string('closebeforeopen', 'quiz');\r\n // }\r\n\r\n // // Check that the grace period is not too short.\r\n // if ($data['overduehandling'] == 'graceperiod') {\r\n // $graceperiodmin = get_config('quiz', 'graceperiodmin');\r\n // if ($data['graceperiod'] <= $graceperiodmin) {\r\n // $errors['graceperiod'] = get_string('graceperiodtoosmall', 'quiz', format_time($graceperiodmin));\r\n // }\r\n // }\r\n\r\n // if (array_key_exists('completion', $data) && $data['completion'] == COMPLETION_TRACKING_AUTOMATIC) {\r\n // $completionpass = isset($data['completionpass']) ? $data['completionpass'] : $this->current->completionpass;\r\n\r\n // // Show an error if require passing grade was selected and the grade to pass was set to 0.\r\n // if ($completionpass && (empty($data['gradepass']) || grade_floatval($data['gradepass']) == 0)) {\r\n // if (isset($data['completionpass'])) {\r\n // $errors['completionpassgroup'] = get_string('gradetopassnotset', 'quiz');\r\n // } else {\r\n // $errors['gradepass'] = get_string('gradetopassmustbeset', 'quiz');\r\n // }\r\n // }\r\n // }\r\n\r\n // // Check the boundary value is a number or a percentage, and in range.\r\n // $i = 0;\r\n // while (!empty($data['feedbackboundaries'][$i] )) {\r\n // $boundary = trim($data['feedbackboundaries'][$i]);\r\n // if (strlen($boundary) > 0) {\r\n // if ($boundary[strlen($boundary) - 1] == '%') {\r\n // $boundary = trim(substr($boundary, 0, -1));\r\n // if (is_numeric($boundary)) {\r\n // $boundary = $boundary * $data['grade'] / 100.0;\r\n // } else {\r\n // $errors[\"feedbackboundaries[$i]\"] =\r\n // get_string('feedbackerrorboundaryformat', 'quiz', $i + 1);\r\n // }\r\n // } else if (!is_numeric($boundary)) {\r\n // $errors[\"feedbackboundaries[$i]\"] =\r\n // get_string('feedbackerrorboundaryformat', 'quiz', $i + 1);\r\n // }\r\n // }\r\n // if (is_numeric($boundary) && $boundary <= 0 || $boundary >= $data['grade'] ) {\r\n // $errors[\"feedbackboundaries[$i]\"] =\r\n // get_string('feedbackerrorboundaryoutofrange', 'quiz', $i + 1);\r\n // }\r\n // if (is_numeric($boundary) && $i > 0 &&\r\n // $boundary >= $data['feedbackboundaries'][$i - 1]) {\r\n // $errors[\"feedbackboundaries[$i]\"] =\r\n // get_string('feedbackerrororder', 'quiz', $i + 1);\r\n // }\r\n // $data['feedbackboundaries'][$i] = $boundary;\r\n // $i += 1;\r\n // }\r\n // $numboundaries = $i;\r\n\r\n // // Check there is nothing in the remaining unused fields.\r\n // if (!empty($data['feedbackboundaries'])) {\r\n // for ($i = $numboundaries; $i < count($data['feedbackboundaries']); $i += 1) {\r\n // if (!empty($data['feedbackboundaries'][$i] ) &&\r\n // trim($data['feedbackboundaries'][$i] ) != '') {\r\n // $errors[\"feedbackboundaries[$i]\"] =\r\n // get_string('feedbackerrorjunkinboundary', 'quiz', $i + 1);\r\n // }\r\n // }\r\n // }\r\n // for ($i = $numboundaries + 1; $i < count($data['feedbacktext']); $i += 1) {\r\n // if (!empty($data['feedbacktext'][$i]['text']) &&\r\n // trim($data['feedbacktext'][$i]['text'] ) != '') {\r\n // $errors[\"feedbacktext[$i]\"] =\r\n // get_string('feedbackerrorjunkinfeedback', 'quiz', $i + 1);\r\n // }\r\n // }\r\n\r\n // // If CBM is involved, don't show the warning for grade to pass being larger than the maximum grade.\r\n // if (($data['preferredbehaviour'] == 'deferredcbm') OR ($data['preferredbehaviour'] == 'immediatecbm')) {\r\n // unset($errors['gradepass']);\r\n // }\r\n // // Any other rule plugins.\r\n // $errors = quiz_access_manager::validate_settings_form_fields($errors, $data, $files, $this);\r\n\r\n // return $errors;\r\n }", "public function on_before_validate($values)\n\t{\n\t\t$this->add_validation('parent_id', array(&$this, 'no_location_and_parent_match'), lang('error_location_parents_match'));\n\t//\t$this->add_validation('id', array(&$this, 'no_id_and_parent_match'), lang('error_location_parents_match'), $values['parent_id']);\n\t\t\n\t\tif (!empty($values['id']))\n\t\t{\n\t\t\t$this->add_validation('nav_key', array(&$this, 'is_editable_navigation'), lang('error_val_empty_or_already_exists', lang('form_label_nav_key')), array($values['group_id'], $values['id'], $values['language']));\n\t\t\t//$this->add_validation('location', array(&$this, 'is_editable_location'), lang('error_val_empty_or_already_exists', lang('form_label_location')), array($values['group_id'], $values['parent_id'], $values['id'], $values['language']));\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->add_validation('nav_key', array(&$this, 'is_new_navigation'), lang('error_val_empty_or_already_exists', lang('form_label_nav_key')), array($values['group_id'], $values['language']));\n\t\t\t//$this->add_validation('location', array(&$this, 'is_new_location'), lang('error_val_empty_or_already_exists', lang('form_label_location')), array($values['group_id'], $values['parent_id'], $values['language']));\n\t\t}\n\t\treturn $values;\n\t}", "protected function prepareForValidation() {\n\n // converting date and hour to datetime\n if ($this->has(['start_date', 'start_time'])) {\n $start_datetime = Carbon::createFromFormat('Y-m-d H:i', $this->input('start_date').\" \".$this->input('start_time'));\n $start_datetime->setTimezone('Europe/London');\n $this->merge(['start_date' => $start_datetime]);\n }\n\n if ($this->has(['end_date', 'end_time'])) {\n $end_datetime = Carbon::createFromFormat('Y-m-d H:i', $this->input('end_date').\" \".$this->input('end_time'));\n $this->merge(['end_date' => $end_datetime]);\n }\n\n if ($this->has('starting_bid')) {\n $this->merge(['starting_bid' => ceil($this->input('starting_bid') * 100)]);\n }\n\n // determine if minimum increment is percentage or fixed\n if ($this->has('increment_val')) {\n if ($this->has('percent_check') && $this->input('percent_check')) // percentual\n $this->merge(['increment_percent' => $this->input('increment_val')]);\n else // fixed\n $this->merge(['increment_fixed' => ceil($this->input('increment_val') * 100)]);\n }\n }", "public function validateData($data): void;", "private function validateFormData() {\n\n $this->firstName = $this->generalFieldValidation($this->firstName, \"firstName\", \"First name\", 40, false);\n $this->lastName = $this->generalFieldValidation($this->lastName, \"lastName\", \"Last name\", 40, false);\n $this->email = $this->generalFieldValidation($this->email, \"email\", \"E-mail\", 60, false);\n $this->address = $this->generalFieldValidation($this->address, \"address\", \"Address\", 255);\n $this->city = $this->generalFieldValidation($this->city, \"city\", \"City\", 60);\n $this->state = $this->generalFieldValidation($this->state, \"state\", \"State\", 2);\n $this->zip = $this->generalFieldValidation($this->zip, \"zip\", \"Zip code\", 5);\n $this->phone = $this->generalFieldValidation($this->phone, \"phone\", \"Phone number\", 10, false);\n $this->notes = $this->generalFieldValidation($this->notes, \"notes\", \"Notes\", -1, false);\n if ($this->phone !== \"\") {\n if (!is_numeric($this->phone)) {\n $this->errorArray[\"phone\"] = \"Phone number may only contain digits.\";\n } else {\n if (strlen($this->phone) < 10) {\n $this->errorArray[\"phone\"] = \"Phone number must contain 10 digits.\";\n }\n }\n }\n if ($this->zip !== \"\") {\n if (!is_numeric($this->zip)) {\n $this->errorArray[\"zip\"] = \"Zip code may only contain digits.\";\n } else {\n if (strlen($this->zip) !== 5) {\n $this->errorArray[\"zip\"] = \"Five digit zip code required.\";\n }\n }\n }\n if ($this->email !== \"\") {\n if (!preg_match(\"/^\\S+@\\S+\\.\\S+$/\", $this->email)) {\n $this->errorArray[\"email\"] = \"E-mail address is not valid.\";\n }\n }\n if (count($this->errorArray) === 0) {\n $this->passedValidation = true;\n }\n }", "abstract public function runValidation();", "public function isValid($data) {\n //Remove Commas \n $data = str_replace(\",\", \"\", $data);\n \n //Valid that DA Pressure is less than or equal to Steam Pressure and Crit Pressure\n if ($data['SteamPressure']<>'' and $data['SteamPressure']<>$data['daPressure']){\n if ($data['SteamPressure']>$this->mS->critPressure()){\n $this->getElement('daPressure')->addValidator('lessThan', true, array('max'=>$this->mS->critPressure()));\n }else{\n $this->getElement('daPressure')->addValidator('lessThan', true, array('max'=>$data['SteamPressure'], 'messages' => 'Cannot be greater than steam pressure.'));\n }\n }\n \n //Valid that DA Pressure is greater than Min Pressure\n if ($data['daPressure']<>$this->mS->minPressure())\n $this->getElement('daPressure')->addValidator('greaterThan', true, array('min' => $this->mS->minPressure()));\n \n return parent::isValid($data);\n }", "public function listInvalidProperties()\n {\n $invalidProperties = parent::listInvalidProperties();\n $allowedValues = $this->getRelativeHorizontalPositionAllowableValues();\n if (!in_array($this->container['relative_horizontal_position'], $allowedValues)) {\n $invalidProperties[] = sprintf(\n \"invalid value for 'relative_horizontal_position', must be one of '%s'\",\n implode(\"', '\", $allowedValues)\n );\n }\n\n $allowedValues = $this->getRelativeVerticalPositionAllowableValues();\n if (!in_array($this->container['relative_vertical_position'], $allowedValues)) {\n $invalidProperties[] = sprintf(\n \"invalid value for 'relative_vertical_position', must be one of '%s'\",\n implode(\"', '\", $allowedValues)\n );\n }\n\n $allowedValues = $this->getWrapTypeAllowableValues();\n if (!in_array($this->container['wrap_type'], $allowedValues)) {\n $invalidProperties[] = sprintf(\n \"invalid value for 'wrap_type', must be one of '%s'\",\n implode(\"', '\", $allowedValues)\n );\n }\n\n\n return $invalidProperties;\n }", "abstract public function validate();", "abstract public function validate();", "public function validateEntries() \n {\n //verify if first entry is a START entry\n $this->firstItemIsStartEntry();\n\n //Detect the right order of entries\n $this->detectRightEntryOrder();\n\n //check if last entry is pause or end when the record is not current\n $this->obligePauseWhenNotCurrent();\n }", "protected function validate()\n {\n }", "public function isValid($_throwExceptionOnInvalidData = false);", "public function isDataValid() {\n if ($this->userExists())\n $this->_errors[] = 'username already taken';\n // username and password must match pattern\n else if (empty($this->_username) || !preg_match('/^[a-zA-Z0-9]{5,16}$/', $this->_username))\n $this->_errors[] = 'invalid username must be between 5 and 16 characters';\n else if (empty($this->_password) || !preg_match('/^[a-zA-Z0-9]{6,18}$/', $this->_password))\n $this->_errors[] = 'invalid password must be between 6 and 18 characters';\n\t\t else if (empty($this->_password) || $this->_password != $this->_password_confirm)\n $this->_errors[] = \"Password didn't match X\";\n // names must be between 2 and 22 characters\n else if (empty($this->_first_name) || !preg_match('/^[a-zA-Z0-9]{2,22}$/', $this->_first_name))\n $this->_errors[] = 'invalid first name must be between 2 and 22 characters';\n else if (empty($this->_last_name) || !preg_match('/^[a-zA-Z0-9]{2,22}$/', $this->_last_name))\n $this->_errors[] = 'invalid last name must be between 2 and 22 characters';\n //restricts day to 01-31, month to 01-12 and year to 1900-2099 (also allowing / - or . between the parts of the date) \n else if (empty($this->_dob) || !preg_match('/^(0?[1-9]|[12][0-9]|3[01])[\\/\\ ](0?[1-9]|1[0-2])[\\/\\ ](19|20)\\d{2}$/', $this->_dob))\n $this->_errors[] = 'invalid dod | must be DD/MM/YYYY format';\n else if (empty($this->_address))\n $this->_errors[] = 'invalid address';\n // checks if valid postal code\n else if (empty($this->_postcode) || !preg_match('/^(([A-PR-UW-Z]{1}[A-IK-Y]?)([0-9]?[A-HJKS-UW]?[ABEHMNPRVWXY]?|[0-9]?[0-9]?))\\s?([0-9]{1}[ABD-HJLNP-UW-Z]{2})$/', $this->_postcode))\n $this->_errors[] = 'invalid postcode | must be AA11 9AA format';\n // checks is valid email using regular expression\n else if (empty($this->_email) || !preg_match('/^[_\\.0-9a-zA-Z-]+@([0-9a-zA-Z][0-9a-zA-Z-]+\\.)+[a-zA-Z]{2,6}$/', $this->_email))\n $this->_errors[] = 'invalid email';\n\n\n // return true or false \n return count($this->_errors) ? 0 : 1;\n }", "private function setError() {\n\t\t$this->is_valid = false;\n\n\t\t// Remove the last invalid interval.\n\t\tarray_pop($this->intervals);\n\n\t\tif (!isset($this->source[$this->pos])) {\n\t\t\t$this->error = _('unexpected end of interval');\n\n\t\t\treturn;\n\t\t}\n\n\t\tfor ($i = $this->pos, $chunk = '', $maxChunkSize = 50; isset($this->source[$i]); $i++) {\n\t\t\tif (0x80 != (0xc0 & ord($this->source[$i])) && $maxChunkSize-- == 0) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t$chunk .= $this->source[$i];\n\t\t}\n\n\t\tif (isset($this->source[$i])) {\n\t\t\t$chunk .= ' ...';\n\t\t}\n\n\t\t$this->error = _s('incorrect syntax near \"%1$s\"', $chunk);\n\t}", "function homeValidate() {\n\t\t$validate1 = array(\n\t\t\n\t\t/*'stock'=> array(\n\t\t\t\t\t'mustNotEmpty'=>array(\n\t\t\t\t\t\t'rule' => 'notEmpty',\n\t\t\t\t\t\t'message'=> 'Please enter Stock Number')\n\t\t\t\t\t),\n\t\t\t\t\n\t\t 'name'=> array(\n\t\t\t\t\t'mustNotEmpty'=>array(\n\t\t\t\t\t\t'rule' => 'notEmpty',\n\t\t\t\t\t\t'message'=> 'Please enter name')\n\t\t\t\t\t),*/\n\t\t 'email'=> array(\n\t\t\t\t\t'mustNotEmpty'=>array(\n\t\t\t\t\t\t'rule' => 'notEmpty',\n\t\t\t\t\t\t'message'=> 'Please enter Email')\n\t\t\t\t\t),\n\n\t\t 'contact'=> array(\n\t\t\t\t\t'mustNotEmpty'=>array(\n\t\t\t\t\t\t'rule' => 'notEmpty',\n\t\t\t\t\t\t'message'=> 'Please enter Contact Number')\n\t\t\t\t\t),\n\t\t/*'make'=> array(\n\t\t\t\t\t'mustNotEmpty'=>array(\n\t\t\t\t\t\t'rule' => 'notEmpty',\n\t\t\t\t\t\t'message'=> 'Please enter Make')\n\t\t\t\t\t),\n\t\t'model'=> array(\n\t\t\t\t\t'mustNotEmpty'=>array(\n\t\t\t\t\t\t'rule' => 'notEmpty',\n\t\t\t\t\t\t'message'=> 'Please enter Model')\n\t\t\t\t\t),\n\t\t'part'=> array(\n\t\t\t\t\t'mustNotEmpty'=>array(\n\t\t\t\t\t\t'rule' => 'notEmpty',\n\t\t\t\t\t\t'message'=> 'Please enter part')\n\t\t\t\t\t),\n\t\t'year'=> array(\n\t\t\t\t\t'mustNotEmpty'=>array(\n\t\t\t\t\t\t'rule' => 'notEmpty',\n\t\t\t\t\t\t'message'=> 'Please choose year')\n\t\t\t\t\t),\n\t\t'country' => array(\n\t\t\t\t\t'mustNotEmpty'=>array(\n\t\t\t\t\t\t'rule' => 'notEmpty',\n\t\t\t\t\t\t'message'=> 'Please choose country')\n\t\t\t\t\t),\n\t\t'comment' => array(\n\t\t\t\t\t'mustNotEmpty'=>array(\n\t\t\t\t\t\t'rule' => 'notEmpty',\n\t\t\t\t\t\t'message'=> 'Please enter comment')\n\t\t\t\t\t),*/\n\t\t\n\t\t\t);\n\t\t$this->validate=$validate1;\n\t\treturn $this->validates();\n\t}", "public function IsValidCoordinate()\n {\n return $this->Coords->IsValid();\n }", "public function valid()\n {\n\n $allowedValues = $this->getTransformAllowableValues();\n if (!in_array($this->container['transform'], $allowedValues)) {\n return false;\n }\n $allowedValues = $this->getWrapTextAllowableValues();\n if (!in_array($this->container['wrapText'], $allowedValues)) {\n return false;\n }\n $allowedValues = $this->getAnchoringTypeAllowableValues();\n if (!in_array($this->container['anchoringType'], $allowedValues)) {\n return false;\n }\n $allowedValues = $this->getCenterTextAllowableValues();\n if (!in_array($this->container['centerText'], $allowedValues)) {\n return false;\n }\n $allowedValues = $this->getTextVerticalTypeAllowableValues();\n if (!in_array($this->container['textVerticalType'], $allowedValues)) {\n return false;\n }\n $allowedValues = $this->getAutofitTypeAllowableValues();\n if (!in_array($this->container['autofitType'], $allowedValues)) {\n return false;\n }\n return true;\n }", "protected function validate()\n {\n// echo static::class;\n if (!isset($this->getProperty('raw_data')['_'])) {\n throw new InvalidEntity('Invalid entity data given: ' . json_encode($this->getRawData(), JSON_PRETTY_PRINT));\n }\n }", "private function proccess()\n {\n foreach ($this->validate as $name => $value) {\n $rules = $this->rules[$name];\n \n /* Let's see is this value a required, e.g not empty */\n if (preg_match('~req~', $rules)) {\n if ($this->isEmpty($value)) {\n $this->errors[] = $this->filterName($name) . ' can\\'t be empty, please enter required data.';\n continue; // We will display only one error per input\n }\n }\n \n /**\n * Let's see is this value needs to be integer\n */\n if (preg_match('~int~', $rules)) {\n if (!$this->isInt($value)) {\n $this->errors[] = $this->filterName($name) . ' is not number, please enter number.';\n continue; // We will display only one error per input\n }\n }\n \n /**\n * Let's see is this value needs to be text\n */\n if (preg_match('~text~', $rules)) {\n if (!$this->isText($value)) {\n $this->errors[] = $this->filterName($name) . ' is not text, please enter only letters.';\n continue; // We will display only one error per input\n }\n }\n \n /* This is good input */\n $this->data[$name] = $value;\n }\n }", "public static function validateWorker_Status_DataForArrayConstraintsFromSetWorker_Status_Data(array $values = array())\n {\n $message = '';\n $invalidValues = [];\n foreach ($values as $employee_DataTypeWorker_Status_DataItem) {\n // validation for constraint: itemType\n if (!$employee_DataTypeWorker_Status_DataItem instanceof \\WorkdayWsdl\\\\StructType\\Worker_Status_DataType) {\n $invalidValues[] = is_object($employee_DataTypeWorker_Status_DataItem) ? get_class($employee_DataTypeWorker_Status_DataItem) : sprintf('%s(%s)', gettype($employee_DataTypeWorker_Status_DataItem), var_export($employee_DataTypeWorker_Status_DataItem, true));\n }\n }\n if (!empty($invalidValues)) {\n $message = sprintf('The Worker_Status_Data property can only contain items of type \\WorkdayWsdl\\\\StructType\\Worker_Status_DataType, %s given', is_object($invalidValues) ? get_class($invalidValues) : (is_array($invalidValues) ? implode(', ', $invalidValues) : gettype($invalidValues)));\n }\n unset($invalidValues);\n return $message;\n }", "public function afterValidate() {\n\t\tif($this->allowFrom !== \"\"){\n\t\t\t$res\t= preg_split(\"/\\./\",$this->allowFrom);\n\t\t\t$this->allowFrom= sprintf(\"%03d\",$res[0]).\".\".sprintf(\"%03d\",$res[1]).\".\".sprintf(\"%03d\",$res[2]).\".\".sprintf(\"%03d\",$res[3]);\n\t\t}else{\n\t\t\t$this->allowFrom = NULL;\n\t\t}\n\t\t//----------------------------------------------------------------------\n\t\t$res\t= NULL;\n\t\t// ---------------------------------------------------------------------\n\t\tif($this->allowTo !== \"\"){\n\t\t\t$res\t= preg_split(\"/\\./\",$this->allowTo);\n\t\t\t$this->allowTo\t= sprintf(\"%03d\",$res[0]).\".\".sprintf(\"%03d\",$res[1]).\".\".sprintf(\"%03d\",$res[2]).\".\".sprintf(\"%03d\",$res[3]);\n\t\t}else{\n\t\t\t$this->allowTo = NULL;\n\t\t}\n\t\t//----------------------------------------------------------------------\n\t\tparent::afterValidate();\n\t}", "function validate(array $data)\n\t{\n\t}", "function valid() \n {\n return $this->offsetExists($this->position);\n }", "public function validate()\r\n {\r\n foreach ($this->_data as $data) {\r\n if (!in_array($data, $this->_validateAgainst)) $this->addError('Value is not a valid selection.');\r\n }\r\n \r\n return !sizeof($this->_errors);\r\n }", "public function validate(){\n\t\t\n\t\tparent::validate();\n\t\t\n\t\tif (isset($this->amount_limit)){\n\t\t\t\n\t\t\tif (!is_numeric($this->amount_limit))\n\t\t\t\t$this->errorAmountLimit = \"Podaj prawidłową kwotę.\";\n\t\t\t\n\t\t\tif ($this->amount_limit < 0)\n\t\t\t\t$this->errorAmountLimit = \"Kwota limitu nie może być ujemna.\";\n\t\t}\n\t\t\n\t\tif ($this->errorName != null || $this->errorAmountLimit != null){\n\t\t\t$this->success = false;\n\t\t}\n\n\t}", "public function validate(){\n\n if(!$this->convert_and_validate_rows()){\n return 0;\n }\n\n if(!$this->validate_columns()){\n return 0;\n }\n\n if(!$this->validate_regions()){\n return 0;\n }\n\n return 1;\n }", "function validateData($array){\n\t\t$errorFlag=true;\n\t\t$currentDate = getdate(); //get current date\n\t\tif (trim($array['FName'])==''){\n\t\t\t$this->appendErrorMsg(\"First Name is required\");\n\t\t\t$errorFlag = false;\n\t\t}\n\t\tif (trim($array['LName'])==''){\n\t\t\t$this->appendErrorMsg(\"Last Name is required\");\n\t\t\t$errorFlag = false;\n\t\t}\n\t\tif (trim($array['License_No'])==''){\n\t\t\t$this->appendErrorMsg(\"License number is required\");\n\t\t\t$errorFlag = false;\n\t\t}\n\t\tif (trim($array['Birthdate'])==''){\n\t\t\t$this->appendErrorMsg(\"Birthdate cannot be blank\");\n\t\t\t$errorFlag = false;\n\t\t} else if (!preg_match(\"/^[0-9]{4,4}[-][0-1]{1,2}?[0-9]{1,2}[-][0-3]{1,2}?[0-9]{1,2}$/\", $array['Birthdate'])){\n\t\t\t$this->appendErrorMsg(\"Date should be in the format yyyy-mm-dd\");\n\t\t\t$errorFlag = false;\n\t\t} else if (getAge($array['Birthdate'])<16 || getAge($array['Birthdate'])> 100){\n\t\t\t$this->appendErrorMsg(\"Sorry, we do not provide coverage to drivers under the age of 16 or over the age of 100\");\n\t\t\t$errorFlag = false;\n\t\t}\n\t\tif (trim($array['PostalCode'])==''){\n\t\t\t$this->appendErrorMsg(\"Postal Code is required\");\n\t\t\t$errorFlag = false;\n\t\t} else if (!preg_match(\"/^[A-Za-z]{1}\\d{1}[A-Za-z]{1}\\d{1}[A-Za-z]{1}\\d{1}$/\",$array['PostalCode'])){\n\t\t\t$this->appendErrorMsg(\"Postal Code should be in the format A1B2C3\");\n\t\t\t$errorFlag = false;\n\t\t}\n\t\tif (trim($array['Phone'])==''){\n\t\t\t$this->appendErrorMsg(\"Phone number is required\");\n\t\t\t$errorFlag = false;\n\t\t} else if (!preg_match(\"/^[0-9]{10}$/\",$array['Phone'])){\n\t\t\t$this->appendErrorMsg(\"Phone number must be in the format xxx-xxx-xxxx or xxxxxxxxx\");\n\t\t\t$errorFlag = false;\n\t\t}\n\t\tif (!preg_match(\"/^[0-9]{1,}$/\", $array['Years_Exp'])){\n\t\t\t$this->appendErrorMsg(\"Please input the number of Years of Experience\");\n\t\t\t$errorFlag = false;\n\t\t}\n\t\treturn $errorFlag;\n\t}" ]
[ "0.6250665", "0.6239848", "0.5929916", "0.59119207", "0.58686876", "0.5863896", "0.58303034", "0.5780146", "0.5732594", "0.56591696", "0.56591696", "0.56431615", "0.56187326", "0.5604051", "0.55439454", "0.5518377", "0.5507813", "0.54950297", "0.5478772", "0.54693526", "0.546767", "0.542322", "0.54199696", "0.5417708", "0.53904504", "0.5384681", "0.5370413", "0.5359247", "0.5354876", "0.533029", "0.5322739", "0.532091", "0.5302967", "0.5300639", "0.5291406", "0.5287452", "0.528148", "0.527851", "0.5272188", "0.52469957", "0.52256656", "0.5223989", "0.52235293", "0.52220815", "0.5221545", "0.52158856", "0.52125704", "0.52080643", "0.52080643", "0.5204346", "0.5201375", "0.52012146", "0.51974636", "0.5186704", "0.51840967", "0.5181851", "0.5179572", "0.5176957", "0.51702005", "0.51694727", "0.51674867", "0.5166707", "0.5160969", "0.51554424", "0.51473963", "0.51404", "0.5139971", "0.51397455", "0.5138799", "0.5136059", "0.5134184", "0.513207", "0.5115665", "0.5114601", "0.5112242", "0.51022565", "0.509828", "0.5087284", "0.5084548", "0.5080787", "0.5079653", "0.5079653", "0.50785965", "0.50712115", "0.5065543", "0.50626326", "0.506122", "0.5059582", "0.5046812", "0.5045354", "0.50429124", "0.5041237", "0.5040636", "0.5038523", "0.5034015", "0.50303555", "0.5026574", "0.50258505", "0.5022977", "0.50206727" ]
0.6669201
0
Add item to Worker_Position_Data value
public function addToWorker_Position_Data(\WorkdayWsdl\\StructType\Worker_Position_DataType $item) { // validation for constraint: itemType if (!$item instanceof \WorkdayWsdl\\StructType\Worker_Position_DataType) { throw new \InvalidArgumentException(sprintf('The Worker_Position_Data property can only contain items of type \WorkdayWsdl\\StructType\Worker_Position_DataType, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__); } $this->Worker_Position_Data[] = $item; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addItemForUpdate($item) {\n $this->_update[$item->getId()] = $item;\n }", "public function addToWorker_Status_Data(\\WorkdayWsdl\\\\StructType\\Worker_Status_DataType $item)\n {\n // validation for constraint: itemType\n if (!$item instanceof \\WorkdayWsdl\\\\StructType\\Worker_Status_DataType) {\n throw new \\InvalidArgumentException(sprintf('The Worker_Status_Data property can only contain items of type \\WorkdayWsdl\\\\StructType\\Worker_Status_DataType, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__);\n }\n $this->Worker_Status_Data[] = $item;\n return $this;\n }", "function addstock($uketoru_item, $uketoru_num){\n\tglobal $item;\n\tglobal $num_item;\n\t// echo $uketoru_item, '<br />', $uketoru_num, '<br />';\n\t// echo gettype($item), '<br />';\n\t# checking whether or not the item is in the data and its position\n\t$yes_no = in_array($uketoru_item, $item);\n\t$position = array_search($uketoru_item, $item);\n\t\n\t// echo 'in_array', '<br />' ,(boolean) $yes_no , '<br />','<br />';\n\t// echo 'position', '<br />', $position , '<br />';\n\n\t//echo $address;\n\tif($yes_no == 0){\n\t// $uketoru_item is not in array data \n\techo \"the item is not in the data.\",'<br />';\n\t# add the item in the data\n\tarray_push($item, $uketoru_item);\n\tarray_push($num_item, $uketoru_num);\n\t// echo $item[0],'<br />', $num_item[0],'<br />';\n\n\t}else{\n\t# $uketoru_item\n\t\"the item is in the data and is stocked.\";\n\t# add the stock on the item\n\t// echo \"yes_no\", '<br />', $yes_no, '<br />';\n\t$num_item[$position] = $num_item[$position] + $uketoru_num;\n\n\t}\n}", "public function addToPosition(string $item): self\n {\n // validation for constraint: enumeration\n if (!\\EnumType\\EwsEmailPositionType::valueIsValid($item)) {\n throw new InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \\EnumType\\EwsEmailPositionType', is_array($item) ? implode(', ', $item) : var_export($item, true), implode(', ', \\EnumType\\EwsEmailPositionType::getValidValues())), __LINE__);\n }\n $this->Position[] = $item;\n \n return $this;\n }", "public function insertItem($item){\n\t\t$hour = date ( 'H', strtotime ( $item->list_time ) );\n\t\t$this->hours[$hour][DayShelfStrategy::HOUR_FIELD_ITEMLIST][] = $item;\n\t}", "function wpcp_add_custom_data_to_order($item, $cart_item_key, $values, $order)\n{\n foreach ($item as $cart_item_key => $values) {\n if (isset($values['wpcp_location'])) {\n $item->add_meta_data(__('wpcp_location', 'wpcp'), $values['wpcp_location'], true);\n }\n }\n}", "function wpcp_add_custom_field_item_data($cart_item_data, $product_id, $variation_id, $quantity)\n{\n if (!empty($_POST['wpcp_location'])) {\n // Add the item data\n $cart_item_data['wpcp_location'] = $_POST['wpcp_location'];\n }\n return $cart_item_data;\n}", "abstract public function add_item();", "public function addResult(RaceResultItem $result)\n {\n if ($result->getParticipation()->getId() != $this->participation->getId()) {\n throw new \\Exception('Invalid player');\n }\n\n $this->pos_abs[] = $result->getPosAbs();\n $this->pos_rel[] = $result->getPosRel();\n $this->pts_abs[] = $result->getPtsAbs();\n $this->pts_rel[] = $result->getPtsRel();\n }", "public function addWorker($data){\n $result=$this->db->insert('workers',$data);\n return $result;\n }", "function addLocation($data) {\r\n\r\n\r\n\t\t$this->query('INSERT INTO locations (`id`, `created`, `modified`, `name`) \r\n\t\t\t\t\t\t\t VALUES (NULL, CURRENT_TIMESTAMP(), CURRENT_TIMESTAMP(), \"'. $data['name'] .'\");');\r\n\r\n\t}", "public function addPos( $value){\n return $this->_add(1, $value);\n }", "public function add( $data, $shard = NULL );", "function OnAfterAdd(){\n //get keyfield value\n if (intval($this->item_id) == 0)\n $data = $this->Storage->GetRecord(null, array(\n $this->key_field => \"\"));\n $this->item_id = $data[$this->key_field];\n }", "public function addToLives_With_Worker_Data(\\WorkdayWsdl\\\\StructType\\Lives_With_Worker_DataType $item)\n {\n // validation for constraint: itemType\n if (!$item instanceof \\WorkdayWsdl\\\\StructType\\Lives_With_Worker_DataType) {\n throw new \\InvalidArgumentException(sprintf('The Lives_With_Worker_Data property can only contain items of type \\WorkdayWsdl\\\\StructType\\Lives_With_Worker_DataType, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__);\n }\n $this->Lives_With_Worker_Data[] = $item;\n return $this;\n }", "function location_tagid_db_save($data)\n\t {\n\t foreach($data['data_id'] as $key=>$location_items)\n\t {\n\t\t foreach($location_items as $location_item)\n\t\t {\n\t $location_item['nId'] = $data['node_id'];\n\t\t\t print_r($location_item).\"<br/>\";\n\t $this->db->insert('question_location',$location_item);\n\t\t\t}\n\t }\n\t }", "public function updateData($data_obj, $item_id)\n {\n\t\t$em = $this->controller_obj->getDoctrine()->getManager();\n\t\t$item = $em->getRepository(\"WebManagementBundle:location\")->find($item_id);\n\t\t$item->setLatitude($data_obj->getLatitude());\n\t\t$item->setLongitude($data_obj->getLongitude());\n\t\t$address_repo = $em->getRepository(\"WebManagementBundle:address\");\n\t\t$address = $address_repo->find($data_obj->getSelectAddress());\n\t\t$item->setAddress($address);\n\t\t$item->setDescription($data_obj->getDescription());\t\t\n\t\t$em->flush();\n\t}", "private function addItemToCollection()\n {\n $this->collection->items[$this->cart_hash] = $this;\n\n }", "public function addDatas(\\RO\\Cmd\\ItemData $value){\n return $this->_add(5, $value);\n }", "function addToBatch($item, $values) {\n $item['rowValues'] = $values;\n $item['allowUpdate'] = $this->_allowEntityUpdate;\n $item['ignoreCase'] = $this->_ignoreCase;\n $this->_importQueueBatch[] = $item;\n }", "abstract function incrementPosition();", "abstract public function addCoord(array $coord);", "public function writeItem($item)\n {\n $this->data[] = $item;\n }", "function addItemForInsert($item, $batch_id=null) {\n if($batch_id != null) {\n $this->_insert[$batch_id] = $item;\n } else {\n $this->_insert[] = $item;\n }\n }", "function PostProcessItemData()\n {\n $this->AddEventQuestDatas();\n $this->ItemDataGroups();\n }", "public function offsetSet($offset,$item)\n\t{\n\t\t$this->add($offset,$item);\n\t}", "abstract protected function onBeforeAdd($oItem);", "protected function tempPosition()\n {\n $this->{$this->getPositionColumn()} = static::$insanePosition;\n $this->save();\n }", "public function insertItem($userId, $data)\n {\n\n $orm = $this->getOrm();\n\n $itemNode = $orm->newEntity(\"WbfsysAddressItem\");\n\n $itemNode->vid = $userId;\n\n $itemNode->use_for_contact = $data->use_for_contact;\n $itemNode->flag_private = $data->flag_private;\n $itemNode->name = $data->name;\n $itemNode->address_value = $data->address_value;\n $itemNode->id_type = $data->id_type;\n $itemNode->description = $data->description;\n\n $itemNode = $orm->insert($itemNode);\n\n return $itemNode;\n\n }", "public function setByPosition($pos, $value)\n\t{\n\t\tswitch($pos) {\n\t\t\tcase 0:\n\t\t\t\t$this->setVenueid($value);\n\t\t\t\tbreak;\n\t\t\tcase 1:\n\t\t\t\t$this->setAddress($value);\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\t$this->setAddress2($value);\n\t\t\t\tbreak;\n\t\t\tcase 3:\n\t\t\t\t$this->setCity($value);\n\t\t\t\tbreak;\n\t\t\tcase 4:\n\t\t\t\t$this->setProvince($value);\n\t\t\t\tbreak;\n\t\t\tcase 5:\n\t\t\t\t$this->setCountry($value);\n\t\t\t\tbreak;\n\t\t\tcase 6:\n\t\t\t\t$this->setLatitude($value);\n\t\t\t\tbreak;\n\t\t\tcase 7:\n\t\t\t\t$this->setLongitude($value);\n\t\t\t\tbreak;\n\t\t\tcase 8:\n\t\t\t\t$this->setPhone($value);\n\t\t\t\tbreak;\n\t\t\tcase 9:\n\t\t\t\t$this->setName($value);\n\t\t\t\tbreak;\n\t\t\tcase 10:\n\t\t\t\t$this->setDescription($value);\n\t\t\t\tbreak;\n\t\t\tcase 11:\n\t\t\t\t$this->setWebsite($value);\n\t\t\t\tbreak;\n\t\t\tcase 12:\n\t\t\t\t$this->setTwitter($value);\n\t\t\t\tbreak;\n\t\t\tcase 13:\n\t\t\t\t$this->setFacebook($value);\n\t\t\t\tbreak;\n\t\t\tcase 14:\n\t\t\t\t$this->setRssfeed($value);\n\t\t\t\tbreak;\n\t\t\tcase 15:\n\t\t\t\t$this->setClosed($value);\n\t\t\t\tbreak;\n\t\t\tcase 16:\n\t\t\t\t$this->setLastfmid($value);\n\t\t\t\tbreak;\n\t\t\tcase 17:\n\t\t\t\t$this->setSlug($value);\n\t\t\t\tbreak;\n\t\t\tcase 18:\n\t\t\t\t$this->setHasphotos($value);\n\t\t\t\tbreak;\n\t\t\tcase 19:\n\t\t\t\t$this->setSubmittedbyuser($value);\n\t\t\t\tbreak;\n\t\t} // switch()\n\t}", "function add( $obj )\r\n\t{\r\n\t\tif ( $this->signUseID == true) {\r\n\t\t\t$pos = $obj->primary_key_value();\r\n\t\t\t$this->data[ $pos ] = $obj;\r\n\t\t}\r\n\t\telse {\r\n\t\t\t$this->data[] = $obj;\r\n\t\t}\r\n\t}", "abstract function set ($item, $data);", "public function assignPos(Position $position);", "function PreProcessItemData()\n {\n $this->Sql_Table_Column_Rename(\"Candidate\",\"Friend\");\n\n \n array_unshift($this->ItemDataPaths,\"../EventApp/System/Inscriptions\");\n\n $unitid=$this->ApplicationObj->Unit(\"ID\");\n $eventid=$this->ApplicationObj->Event(\"ID\");\n\n $this->AddDefaults[ \"Unit\" ]=$unitid;\n $this->AddFixedValues[ \"Unit\" ]=$unitid;\n $this->ItemData[ \"Unit\" ][ \"Default\" ]=$unitid;\n\n $this->AddDefaults[ \"Event\" ]=$eventid;\n $this->AddFixedValues[ \"Event\" ]=$eventid;\n $this->ItemData[ \"Event\" ][ \"Default\" ]=$eventid;\n }", "public function addItemToReplacementData( $itemId )\n {\n if ( !isset( $this->replacementData[$itemId] ) )\n {\n $this->replacementData[$itemId] = 0;\n }\n ++$this->replacementData[$itemId];\n }", "abstract public function assign($userId, $itemName, $bizRule = null, $data = null);", "public function add_location($rec){\n\t\t$doc = json_encode($this->_location($rec));\n\t\treturn $this->update($doc);\n\t}", "public function offsetSet($offset, $item)\n\t{\n\t\t$this->add($offset, $item);\n\t}", "public function updateFeatureItemPosition() {\n $this->autoRender = false;\n if (isset($_GET) && !empty($_GET)) {\n foreach ($_GET as $key => $val) {\n $this->loadModel('FeaturedItem');\n $this->FeaturedItem->updateAll(array('FeaturedItem.position' => $val), array('FeaturedItem.id' => $this->Encryption->decode($key)));\n }\n }\n }", "public function push($obj)\r\n\t{\r\n\t\t$this->isLoaded = true;\r\n\t\t$this->keyAssocation[$obj->get($this->obj->primaryKey)] = $this->count++;\r\n\t\t$this->elements[] = $obj;\r\n\t}", "public function processPosition()\n {\n $name = Tools::getValue('name');\n $position = Tools::getValue('position');\n $id_position = (int)Tools::getValue('id');\n $mode = Tools::getValue('mode');\n if ($mode == 'duplicate') {\n $adapter = new AdminApPageBuilderPositionsController();\n $id_position = $adapter->duplicatePosition($id_position, 'ajax', $name);\n } else if ($mode == 'new') {\n $key = ApPageSetting::getRandomNumber();\n $name = $name ? $name : $position.$key;\n $position_controller = new AdminApPageBuilderPositionsController();\n\n $position_data = array(\n 'name' => $name,\n 'position' => $position,\n 'position_key' => 'position'.$key,\n );\n $id_position = $position_controller->autoCreatePosition($position_data);\n } else if ($mode == 'edit') {\n // Edit only name\n $position_controller = new AdminApPageBuilderPositionsController();\n $position_controller->updateName($id_position, $name);\n }\n // Reload position\n if ($mode == 'new' || $mode == 'duplicate') {\n $this->selectPosition($id_position);\n } else {\n die(Tools::jsonEncode(array('status' => 'SUCCESS')));\n }\n }", "function add($item);", "function addItem(SitemapItem $item){\r\n $this->items[] = $item;\r\n }", "public function savePosition() {}", "private function setupOrderItemIndex() {\n //works from the properties set in setBackorderVars\n if (!empty($this->backorderRecord['Order']['OrderItem'])) {\n foreach ($this->backorderRecord['Order']['OrderItem'] as $boItem) {\n $this->ofb['OrderItemIndex'][$boItem['item_id']] = $boItem;\n }\n } else {\n $this->ofb['OrderItemIndex'] = array();\n }\n }", "public function append($item)\n {\n array_push($this->activeValue, $item);\n }", "public function addData(\\RO\\Cmd\\AchieveData $value){\n return $this->_add(1, $value);\n }", "public function add($item);", "public function add($item);", "public function setByPosition($pos, $value)\n {\n switch ($pos) {\n case 0:\n $this->setId($value);\n break;\n case 1:\n $this->setCode($value);\n break;\n case 2:\n $this->setCategory($value);\n break;\n case 3:\n $this->setAddress($value);\n break;\n case 4:\n $this->setAddress2($value);\n break;\n case 5:\n $this->setZipcode($value);\n break;\n case 6:\n $this->setCity($value);\n break;\n case 7:\n $this->setGeoCoordinateX($value);\n break;\n case 8:\n $this->setGeoCoordinateY($value);\n break;\n case 9:\n $this->setDistanceCamping($value);\n break;\n case 10:\n $this->setImage($value);\n break;\n case 11:\n $this->setPriority($value);\n break;\n case 12:\n $this->setTel($value);\n break;\n case 13:\n $this->setFax($value);\n break;\n case 14:\n $this->setEmail($value);\n break;\n case 15:\n $this->setWebsite($value);\n break;\n case 16:\n $this->setCreatedAt($value);\n break;\n case 17:\n $this->setUpdatedAt($value);\n break;\n case 18:\n $this->setActive($value);\n break;\n } // switch()\n }", "public function add_position($individual_id)\n\t{\n\t\t$data = array(\n\t\t\t'employer'=>$this->input->post('employer'),\n\t\t\t'job_title'=>$this->input->post('job_title'),\n\t\t\t'employment_date'=>$this->input->post('employment_date'),\n\t\t\t'individual_id'=>$individual_id,\n\t\t\t'created'=>date('Y-m-d H:i:s'),\n\t\t\t'created_by'=>$this->session->userdata('personnel_id'),\n\t\t\t'modified_by'=>$this->session->userdata('personnel_id')\n\t\t);\n\t\t\n\t\tif($this->db->insert('individual_job', $data))\n\t\t{\n\t\t\treturn TRUE;\n\t\t}\n\t\telse{\n\t\t\treturn FALSE;\n\t\t}\n\t}", "function update_data($data_update_item) {\n\t}", "abstract public function collectorPositionDataProvider();", "function add()\n\t{\n\t\t$this->_updatedata();\n\t}", "public function add($item)\n {\n $this->manuallyAddedData[] = $item;\n }", "function insert_shopping_cart_position($data) {\r\n\t\t$this->db->insert ( 'shopping_cart_position', $data );\r\n\t\treturn $this->db->insert_id ();\r\n\t}", "public function addData(array $arr);", "public function appendItem(\\PB_Item $value)\n {\n return $this->append(self::ITEM, $value);\n }", "private function setItem(array $itemData)\n {\n //====================================================================//\n // Safety Check\n if ((!$this->item instanceof WC_Order_Item_Shipping) && (!$this->item instanceof WC_Order_Item_Fee)) {\n return;\n }\n //====================================================================//\n // Update Name\n if (isset($itemData[\"name\"])) {\n $this->setGeneric(\"_name\", $itemData[\"name\"], \"item\");\n }\n //====================================================================//\n // Update Quantity\n $qty = $itemData[\"quantity\"] ?? 1;\n //====================================================================//\n // Update Unit Price\n if (isset($itemData[\"subtotal\"])) {\n // Compute Expected Total\n $total = $qty * self::prices()->taxExcluded($itemData[\"subtotal\"]);\n // Compute Expected Total Tax Incl.\n $totalTax = $qty * self::prices()->taxAmount($itemData[\"subtotal\"]);\n // There is NO Discount\n } else {\n $total = $this->item->get_total();\n $totalTax = $this->item->get_total_tax();\n }\n //====================================================================//\n // Update Item Taxes\n if ($totalTax != $this->item->get_total_tax()) {\n $this->setItemTaxArray('total', (float) $totalTax);\n }\n //====================================================================//\n // Update Item Totals\n $this->setGeneric(\"_total\", $total, \"item\");\n }", "public function update_position($p_object_id, $p_option = null, $p_insertion = null, $p_pos = null)\n {\n $l_data = $this->m_mptt->get_by_node_id($p_object_id);\n\n if (is_object($l_data))\n {\n $l_array = $l_data->get_row(IDOIT_C__DAO_RESULT_TYPE_ARRAY);\n\n $l_sql = \"UPDATE isys_catg_location_list SET\n\t\t\t\tisys_catg_location_list__pos = \" . $this->convert_sql_int($p_pos) . \",\n\t\t\t\tisys_catg_location_list__insertion = \" . $this->convert_sql_int($p_insertion) . \",\n\t\t\t\tisys_catg_location_list__option = \" . $this->convert_sql_id($p_option) . \"\n\t\t\t\tWHERE isys_catg_location_list__id = \" . $this->convert_sql_id($l_array[\"isys_catg_location_list__id\"]) . \";\";\n\n if ($this->update($l_sql))\n {\n return $this->apply_update();\n } // if\n } // if\n\n return false;\n }", "public function addItemPedido($objItemPedido){\n if (is_object($objItemPedido)) $this->arrItemPedido[] = $objItemPedido;\n }", "public function addItems(\\RO\\Cmd\\AchieveDBItem $value){\n return $this->_add(4, $value);\n }", "function addItemToDB()\n {\n $this->database->addItemToDB($this);\n }", "private function addWeekItem($ItemData, $DataStartDate, $DataStopDate) {\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t$start_day = $DataStartDate->getDayOfWeek();\r\n\t\t\t\r\n\t\t$this->addWeekly($ItemData, $DataStartDate, $DataStopDate, $start_day);\t\t\r\n\t\t\t\r\n\t\r\n\t}", "public function setByPosition($pos, $value)\n {\n switch ($pos) {\n case 0:\n $this->setOpPrimeId($value);\n break;\n case 1:\n $this->setOpId($value);\n break;\n case 2:\n $this->setOpPrimeLibelle($value);\n break;\n case 3:\n $this->setOpPrimeNumero($value);\n break;\n case 4:\n $this->setGdlArtId($value);\n break;\n case 5:\n $this->setOperationPrimeCurrencyId($value);\n break;\n case 6:\n $this->setOperationPrimeRRewardTypeId($value);\n break;\n case 7:\n $this->setOperationPrimeRRewardExpeditionModeId($value);\n break;\n case 8:\n $this->setOperationPrimeRRewardTransporterId($value);\n break;\n case 9:\n $this->setOperationPrimeFixedAmount($value);\n break;\n case 10:\n $this->setOperationPrimeProductPricePourcentage($value);\n break;\n case 11:\n $this->setOperationPrimeMaximumAmount($value);\n break;\n } // switch()\n }", "public function setByPosition($pos, $value)\n\t{\n\t\tswitch($pos) {\n\t\t\tcase 0:\n\t\t\t\t$this->setId($value);\n\t\t\t\tbreak;\n\t\t\tcase 1:\n\t\t\t\t$this->setPartieId($value);\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\t$this->setReplicaPostId($value);\n\t\t\t\tbreak;\n\t\t\tcase 3:\n\t\t\t\t$this->setType($value);\n\t\t\t\tbreak;\n\t\t\tcase 4:\n\t\t\t\t$this->setTitle($value);\n\t\t\t\tbreak;\n\t\t\tcase 5:\n\t\t\t\t$this->setUrl($value);\n\t\t\t\tbreak;\n\t\t\tcase 6:\n\t\t\t\t$this->setText($value);\n\t\t\t\tbreak;\n\t\t\tcase 7:\n\t\t\t\t$this->setPhotoFile($value);\n\t\t\t\tbreak;\n\t\t\tcase 8:\n\t\t\t\t$this->setPhotoUrl($value);\n\t\t\t\tbreak;\n\t\t\tcase 9:\n\t\t\t\t$this->setQuote($value);\n\t\t\t\tbreak;\n\t\t\tcase 10:\n\t\t\t\t$this->setQuoteAuthor($value);\n\t\t\t\tbreak;\n\t\t\tcase 11:\n\t\t\t\t$this->setLinkTitle($value);\n\t\t\t\tbreak;\n\t\t\tcase 12:\n\t\t\t\t$this->setLinkUrl($value);\n\t\t\t\tbreak;\n\t\t\tcase 13:\n\t\t\t\t$this->setLinkImage($value);\n\t\t\t\tbreak;\n\t\t\tcase 14:\n\t\t\t\t$this->setVideoUrl($value);\n\t\t\t\tbreak;\n\t\t\tcase 15:\n\t\t\t\t$this->setTotalIndex($value);\n\t\t\t\tbreak;\n\t\t\tcase 16:\n\t\t\t\t$this->setBestBadge1($value);\n\t\t\t\tbreak;\n\t\t\tcase 17:\n\t\t\t\t$this->setBestBadge2($value);\n\t\t\t\tbreak;\n\t\t\tcase 18:\n\t\t\t\t$this->setIsPublished($value);\n\t\t\t\tbreak;\n\t\t\tcase 19:\n\t\t\t\t$this->setIsFeatured($value);\n\t\t\t\tbreak;\n\t\t\tcase 20:\n\t\t\t\t$this->setCommentsCount($value);\n\t\t\t\tbreak;\n\t\t\tcase 21:\n\t\t\t\t$this->setCreatedAt($value);\n\t\t\t\tbreak;\n\t\t\tcase 22:\n\t\t\t\t$this->setUpdatedAt($value);\n\t\t\t\tbreak;\n\t\t} // switch()\n\t}", "public function push_data($n, $v)\n{\n $wk = new pair;\n $wk->set($n, $v);\n $this->data_[] = $wk;\n}", "function add_setting( $position, $form_id ) { if ( - 1 == $position ) {?>\n\n\t\t\t<li class=\"autofill-list-row-count field_setting\">\n\t\t\t\t<label for=\"visibility\" class=\"section_label\">\n\t\t\t\t\t<?php esc_html_e( 'Sync Field Value' ); ?></label>\n\n\t\t\t\t<label class=\"inline\" for=\"autofill-list-row-count\">\n\t\t\t\t\t<?php\n\t\t\t\t\tesc_html_e( 'Update value from row count of list field: ' );\n\t\t\t\t\tgform_tooltip( 'autofill_list_row_count' );\n\t\t\t\t\t?>\n\t\t\t\t</label>\n\n\t\t\t\t<input type=\"text\" id=\"autofill-list-row-count\" onkeyup=\"SetFieldProperty( 'autofillListRowCount', this.value);\" />\n\n\t\t\t</li>\n\n\t<?php }}", "abstract public function updateData();", "public function setByPosition($pos, $value)\n {\n switch ($pos) {\n case 0:\n $this->setSekolahId($value);\n break;\n case 1:\n $this->setSemesterId($value);\n break;\n case 2:\n $this->setSumberAirId($value);\n break;\n case 3:\n $this->setSumberAirMinumId($value);\n break;\n case 4:\n $this->setCreateDate($value);\n break;\n case 5:\n $this->setLastUpdate($value);\n break;\n case 6:\n $this->setSoftDelete($value);\n break;\n case 7:\n $this->setLastSync($value);\n break;\n case 8:\n $this->setUpdaterId($value);\n break;\n case 9:\n $this->setKetersediaanAir($value);\n break;\n case 10:\n $this->setKecukupanAir($value);\n break;\n case 11:\n $this->setMinumSiswa($value);\n break;\n case 12:\n $this->setMemprosesAir($value);\n break;\n case 13:\n $this->setSiswaBawaAir($value);\n break;\n case 14:\n $this->setToiletSiswaLaki($value);\n break;\n case 15:\n $this->setToiletSiswaPerempuan($value);\n break;\n case 16:\n $this->setToiletSiswaKk($value);\n break;\n case 17:\n $this->setToiletSiswaKecil($value);\n break;\n case 18:\n $this->setJmlJambanLG($value);\n break;\n case 19:\n $this->setJmlJambanLTg($value);\n break;\n case 20:\n $this->setJmlJambanPG($value);\n break;\n case 21:\n $this->setJmlJambanPTg($value);\n break;\n case 22:\n $this->setJmlJambanLpG($value);\n break;\n case 23:\n $this->setJmlJambanLpTg($value);\n break;\n case 24:\n $this->setTempatCuciTangan($value);\n break;\n case 25:\n $this->setTempatCuciTanganRusak($value);\n break;\n case 26:\n $this->setASabunAirMengalir($value);\n break;\n case 27:\n $this->setJambanDifabel($value);\n break;\n case 28:\n $this->setTipeJamban($value);\n break;\n case 29:\n $this->setASediaPembalut($value);\n break;\n case 30:\n $this->setKegiatanCuciTangan($value);\n break;\n case 31:\n $this->setPembuanganAirLimbah($value);\n break;\n case 32:\n $this->setAKurasSeptitank($value);\n break;\n case 33:\n $this->setAMemilikiSolokan($value);\n break;\n case 34:\n $this->setATempatSampahKelas($value);\n break;\n case 35:\n $this->setATempatSampahTutupP($value);\n break;\n case 36:\n $this->setACerminJambanP($value);\n break;\n case 37:\n $this->setAMemilikiTps($value);\n break;\n case 38:\n $this->setATpsAngkutRutin($value);\n break;\n case 39:\n $this->setAAnggaranSanitasi($value);\n break;\n case 40:\n $this->setAMelibatkanSanitasiSiswa($value);\n break;\n case 41:\n $this->setAKemitraanSanDaerah($value);\n break;\n case 42:\n $this->setAKemitraanSanPuskesmas($value);\n break;\n case 43:\n $this->setAKemitraanSanSwasta($value);\n break;\n case 44:\n $this->setAKemitraanSanNonPem($value);\n break;\n case 45:\n $this->setKieGuruCuciTangan($value);\n break;\n case 46:\n $this->setKieGuruHaid($value);\n break;\n case 47:\n $this->setKieGuruPerawatanToilet($value);\n break;\n case 48:\n $this->setKieGuruKeamananPangan($value);\n break;\n case 49:\n $this->setKieGuruMinumAir($value);\n break;\n case 50:\n $this->setKieKelasCuciTangan($value);\n break;\n case 51:\n $this->setKieKelasHaid($value);\n break;\n case 52:\n $this->setKieKelasPerawatanToilet($value);\n break;\n case 53:\n $this->setKieKelasKeamananPangan($value);\n break;\n case 54:\n $this->setKieKelasMinumAir($value);\n break;\n case 55:\n $this->setKieToiletCuciTangan($value);\n break;\n case 56:\n $this->setKieToiletHaid($value);\n break;\n case 57:\n $this->setKieToiletPerawatanToilet($value);\n break;\n case 58:\n $this->setKieToiletKeamananPangan($value);\n break;\n case 59:\n $this->setKieToiletMinumAir($value);\n break;\n case 60:\n $this->setKieSelasarCuciTangan($value);\n break;\n case 61:\n $this->setKieSelasarHaid($value);\n break;\n case 62:\n $this->setKieSelasarPerawatanToilet($value);\n break;\n case 63:\n $this->setKieSelasarKeamananPangan($value);\n break;\n case 64:\n $this->setKieSelasarMinumAir($value);\n break;\n case 65:\n $this->setKieUksCuciTangan($value);\n break;\n case 66:\n $this->setKieUksHaid($value);\n break;\n case 67:\n $this->setKieUksPerawatanToilet($value);\n break;\n case 68:\n $this->setKieUksKeamananPangan($value);\n break;\n case 69:\n $this->setKieUksMinumAir($value);\n break;\n case 70:\n $this->setKieKantinCuciTangan($value);\n break;\n case 71:\n $this->setKieKantinHaid($value);\n break;\n case 72:\n $this->setKieKantinPerawatanToilet($value);\n break;\n case 73:\n $this->setKieKantinKeamananPangan($value);\n break;\n case 74:\n $this->setKieKantinMinumAir($value);\n break;\n } // switch()\n }", "public function addItem($key, $value);", "protected function _addEcommerceItems($piwikTracker, $quote)\n {\n $_helper = Mage::helper('linumsoftware_piwik');\n \n foreach ($quote->getAllVisibleItems() as $item) {\n if($item->getName()){\n\t//we only want to track the main configurable item\n\t//but not the subitem\n\tif($item->getParentItem()) {\n\t if ($item->getParentItem()->getProductType() == 'configurable') {\n\t continue;\n\t }\n\t}\n\t\n\t$itemPrice = $item->getBasePrice();\n\t// This is inconsistent behaviour from Magento\n\t// base_price should be item price in base currency\n\t// TODO: add test so we don't get caught out when this is fixed in a future release\n\tif(!$itemPrice || $itemPrice < 0.00001) {\n\t $itemPrice = $item->getPrice();\n\t}\n\tif($_helper->debugLog()) {\n\t $_helper->_log(\"addEcommerceItem(\" .\n\t\t\t $item->getProduct()->getData('sku') . \",\" .\n\t\t\t $item->getName() . \",\" .\n\t\t\t $_helper->getProductCategories($item->getProduct()) . \",\" .\n\t\t\t $itemPrice . \",\" .\n\t\t\t $item->getQty() . \")\"\n\t\t\t );\n\t}\n\t$piwikTracker->addEcommerceItem(\n\t\t\t\t\t$item->getProduct()->getData('sku'),\n\t\t\t\t\t$item->getName(),\n\t\t\t\t\t$_helper->getProductCategories($item->getProduct()),\n\t\t\t\t\t$itemPrice,\n\t\t\t\t\t$item->getQty()\n\t\t\t\t\t);\n }\n }\n }", "public function setByPosition($pos, $value)\n\t{\n\t\tswitch($pos) {\n\t\t\tcase 0:\n\t\t\t\t$this->setId($value);\n\t\t\t\tbreak;\n\t\t\tcase 1:\n\t\t\t\t$this->setSubserial($value);\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\t$this->setAnnounce($value);\n\t\t\t\tbreak;\n\t\t\tcase 3:\n\t\t\t\t$this->setMail($value);\n\t\t\t\tbreak;\n\t\t\tcase 4:\n\t\t\t\t$this->setSerialId($value);\n\t\t\t\tbreak;\n\t\t\tcase 5:\n\t\t\t\t$this->setRank($value);\n\t\t\t\tbreak;\n\t\t\tcase 6:\n\t\t\t\t$this->setPrecinctId($value);\n\t\t\t\tbreak;\n\t\t\tcase 7:\n\t\t\t\t$this->setGenreId($value);\n\t\t\t\tbreak;\n\t\t\tcase 8:\n\t\t\t\t$this->setBroadcastId($value);\n\t\t\t\tbreak;\n\t\t\tcase 9:\n\t\t\t\t$this->setCopyright($value);\n\t\t\t\tbreak;\n\t\t\tcase 10:\n\t\t\t\t$this->setStatusId($value);\n\t\t\t\tbreak;\n\t\t\tcase 11:\n\t\t\t\t$this->setRecorddate($value);\n\t\t\t\tbreak;\n\t\t\tcase 12:\n\t\t\t\t$this->setPublicdate($value);\n\t\t\t\tbreak;\n\t\t\tcase 13:\n\t\t\t\t$this->setEditorial1($value);\n\t\t\t\tbreak;\n\t\t\tcase 14:\n\t\t\t\t$this->setEditorial2($value);\n\t\t\t\tbreak;\n\t\t\tcase 15:\n\t\t\t\t$this->setEditorial3($value);\n\t\t\t\tbreak;\n\t\t\tcase 16:\n\t\t\t\t$this->setAudio($value);\n\t\t\t\tbreak;\n\t\t\tcase 17:\n\t\t\t\t$this->setDuration($value);\n\t\t\t\tbreak;\n\t\t\tcase 18:\n\t\t\t\t$this->setNumView($value);\n\t\t\t\tbreak;\n\t\t\tcase 19:\n\t\t\t\t$this->setComments($value);\n\t\t\t\tbreak;\n\t\t} // switch()\n\t}", "public function addExtendpos( $value){\n return $this->_add(3, $value);\n }", "public function insertOrderDetails($value,$line_item, $mainOrderId)\n {\n //main order\n $order_list_arr['name'] = $value->name;\n $order_list_arr['shpoify_order_id'] = $value->id;\n $order_list_arr['line_item_id'] = $line_item->id;\n $order_list_arr['order_number'] = $value->order_number;\n $order_list_arr['customer_name'] = $value->billing_address->name;\n $order_list_arr['app_id'] = $value->app_id;\n $order_list_arr['checkout_id'] = $value->checkout_id;\n $order_list_arr['token'] = $value->token;\n $order_list_arr['gateway'] = $value->gateway;\n $order_list_arr['total_price'] = $value->total_price;\n $order_list_arr['subtotal_price'] = $value->subtotal_price;\n $order_list_arr['currency'] = $value->currency;\n $order_list_arr['cart_token'] = $value->cart_token;\n $order_list_arr['checkout_token'] = $value->checkout_token;\n $order_list_arr['order_status_url'] = $value->order_status_url;\n\n return OrderDetails::insertGetId($order_list_arr);\n\n }", "function _addItem ($quantity, $rate, $weight, $length, $width, $height, $description, $readytoship=0) {\r\n $index = $this->items_qty;\r\n $this->item_quantity[$index] = (string)$quantity;\r\n $this->item_weight[$index] = ( $weight ? (string)$weight : '0' );\r\n $this->item_length[$index] = ( $length ? (string)$length : '0' );\r\n $this->item_width[$index] = ( $width ? (string)$width : '0' );\r\n $this->item_height[$index] = ( $height ? (string)$height : '0' );\r\n $this->item_description[$index] = $description;\r\n $this->item_readytoship[$index] = $readytoship;\r\n $this->items_qty ++;\r\n $this->items_price += $quantity * $rate;\r\n }", "public function add_item($zajlib_feed_item){\n\t\t$this->items[] = $zajlib_feed_item; \n\t}", "function savePositions($a_pos)\n\t{\n\t\tasort($a_pos);\n\t\t\n\t\t// File Item\n\t\t$childs = $this->tabs_node->child_nodes();\n\t\t$nodes = array();\n\t\tfor ($i=0; $i<count($childs); $i++)\n\t\t{\n\t\t\tif ($childs[$i]->node_name() == \"Tab\")\n\t\t\t{\n\t\t\t\t$pc_id = $childs[$i]->get_attribute(\"PCID\");\n\t\t\t\t$hier_id = $childs[$i]->get_attribute(\"HierId\");\n\t\t\t\t$nodes[$hier_id.\":\".$pc_id] = $childs[$i];\n\t\t\t\t$childs[$i]->unlink($childs[$i]);\n\t\t\t}\n\t\t}\n\t\t\n\t\tforeach($a_pos as $k => $v)\n\t\t{\n\t\t\tif (is_object($nodes[$k]))\n\t\t\t{\n\t\t\t\t$nodes[$k] = $this->tabs_node->append_child($nodes[$k]);\n\t\t\t}\n\t\t}\n\t}", "public function offsetSet($offset , $value) {\n $this->_items[$offset] = $value;\n }", "public function klAddedToCartItemData($quote, $addedItem)\n {\n $addedProduct = $addedItem->getProduct();\n $addedItemData = [\n 'AddedItemCategories' => (array) $addedProduct->getCategoryIds(),\n 'AddedItemImageUrlKey' => (string) is_null($addedProduct->getData('small_image')) ? \"\" : stripslashes($addedProduct->getData('small_image')),\n 'AddedItemPrice' => (float) $addedProduct->getFinalPrice(),\n 'AddedItemQuantity' => (int) $addedItem->getQty(),\n 'AddedItemProductID' => (int) $addedProduct->getId(),\n 'AddedItemProductName' => (string) $addedProduct->getName(),\n 'AddedItemSku' => (string) $addedProduct->getSku(),\n 'AddedItemUrl' => (string) is_null($addedProduct->getProductUrl()) ? \"\" : stripslashes($addedProduct->getProductUrl()),\n ];\n\n $klAddedToCartPayload = array_merge(\n $this->klBuildCartData($quote, $addedItem),\n $addedItemData\n );\n\n if ($addedItem->getProductType() == 'bundle') {\n $klAddedToCartPayload = array_merge(\n $klAddedToCartPayload,\n ['AddedItemBundleOptions' => $this->getBundleProductOptions($addedItem)]\n );\n }\n\n // Storing payload in the DataHelper object for SalesQuoteSaveAfter Observer since quoteId is not set at this point for guest checkouts\n $this->_dataHelper->setObserverAtcPayload($klAddedToCartPayload);\n }", "function addLocatorItems()\n\t{\n\t\tglobal $ilLocator;\n\t\t\n\t\tif (is_object($this->object))\n\t\t{\n\t\t\t$ilLocator->addItem($this->object->getTitle(),\n\t\t\t\t$this->getGotoLink($this->object->getRefId()), \"\", $_GET[\"ref_id\"]);\n\t\t}\n\t}", "public function AddData ($key, $value) {\n\t\t$this->data[$key] = $value;\t\t\t\t\n\t}", "public function add(Path $item): void\n {\n $path = $item->getPath();\n $value = $item->getValue();\n $index = array_pop($path);\n $array = [];\n\n if (count($path) > 0) {\n if (false === is_int($index) && false === is_string($index)) {\n $index = (string) $index;\n }\n\n $this->insertIntoArray($array, $path, [$index => $value]);\n } elseif (null === $index) {\n $array = [$value];\n } else {\n $array = [$index => $value];\n }\n\n $this->data = array_replace_recursive($this->data, $array);\n }", "public function add_ppe_inspection_worker($idPPEInspection) \n\t\t{\n\t\t\t//add the new workers\n\t\t\t$query = 1;\n\t\t\tif ($workers = $this->input->post('workers')) {\n\t\t\t\t$tot = count($workers);\n\t\t\t\tfor ($i = 0; $i < $tot; $i++) {\n\t\t\t\t\t$data = array(\n\t\t\t\t\t\t'fk_id_ppe_inspection' => $idPPEInspection,\n\t\t\t\t\t\t'fk_id_user' => $workers[$i],\n\t\t\t\t\t\t'date_issue' => date(\"Y-m-d G:i:s\") \n\t\t\t\t\t);\n\t\t\t\t\t$query = $this->db->insert('ppe_inspection_workers', $data);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($query) {\n\t\t\t\treturn true;\n\t\t\t} else{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}", "public function setByPosition($pos, $value)\n\t{\n\t\tswitch($pos) {\n\t\t\tcase 0:\n\t\t\t\t$this->setId($value);\n\t\t\t\tbreak;\n\t\t\tcase 1:\n\t\t\t\t$this->setUfId($value);\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\t$this->setNome($value);\n\t\t\t\tbreak;\n\t\t\tcase 3:\n\t\t\t\t$this->setSlug($value);\n\t\t\t\tbreak;\n\t\t\tcase 4:\n\t\t\t\t$this->setLongitude($value);\n\t\t\t\tbreak;\n\t\t\tcase 5:\n\t\t\t\t$this->setLatitude($value);\n\t\t\t\tbreak;\n\t\t} // switch()\n\t}", "public function enqueue($item)\n {\n array_push($this->array, $item);\n }", "function onStoreRow( &$data )\r\n\t{\r\n\t\t$element =& $this->getElement();\r\n\t\tif ($data['rowid'] == 0 && !in_array( $element->name, $data )) {\r\n\t\t\t$user\t\t=& JFactory::getUser();\r\n\t\t\t$data[$element->name] = $user->get('id');\r\n\t\t}\r\n\t}", "public function append($value)\n {\n $this->items[] = $value;\n }", "protected function addLocation($remote_id, $item)\n {\n if(!empty($item['latitude']) && !empty($item['longitude']) && !empty($item['address']))\n {\n $pointObj = new Point($item['latitude'], $item['longitude']);\n $point = [\n 'location' => DB::raw(sprintf(\"ST_GeogFromText('%s')\", $pointObj->toWKT())),\n 'address' => $item['address'],\n ];\n $this->locations[$remote_id] = $point;\n }\n }", "static function setGridItemLocation($griditem_id=0,$scene_id=0,$cell_id=1)\r\n\t{\r\n\t\t$foundlocation = self::searchGriditemById($griditem_id);\r\n\t\tif ($foundlocation['scene_id'] != '0')\r\n\t\t{\t\t\t\t\t\t\r\n\t\t\t$iteminfo = self::getGriditemsInfo();\r\n\t\t\t$item = $iteminfo[$foundlocation['scene_id']]['griditems'][$foundlocation['cell_id']]; // get item\r\n\t\t\t$iteminfo[$scene_id]['griditems'][$cell_id] = $item; // move item to new scene\r\n\t\t\tunset($iteminfo[$foundlocation['scene_id']]['griditems'][$foundlocation['cell_id']]); // remove item from old location\r\n\t\t\tself::setGriditemsInfo($iteminfo);\t\r\n\t\t}\r\n\t}", "protected function addOtherData(array $data) : void\n {\n $this->otherData += $data;\n }", "private function _addToFilteredItem( $addon, array $subData, &$filteredItem ){\n foreach ($subData as $key => $value) {\n if( is_array($value) ){\n $fieldPrefix = ($this->_iniData[$key]['db_table_prefix']) ? $this->_iniData[$key]['db_table_prefix'] : \"\";\n $this->_addToFilteredItem( $fieldPrefix, $value, $filteredItem );\n }\n if ( !is_numeric($key) && in_array($key,$this->_fieldsToUse,true)) {\n $filteredItem[$addon . $key] = $value;\n }\n }\n }", "public function setPosition(?OnenotePatchInsertPosition $value): void {\n $this->getBackingStore()->set('position', $value);\n }", "public function setByPosition($pos, $value)\n {\n switch ($pos) {\n case 0:\n $this->setPothnbr($value);\n break;\n case 1:\n $this->setPothstat($value);\n break;\n case 2:\n $this->setPothrcptdate($value);\n break;\n case 3:\n $this->setIntbwhse($value);\n break;\n case 4:\n $this->setPothglpd($value);\n break;\n case 5:\n $this->setPothairship($value);\n break;\n case 6:\n $this->setPotherinreview($value);\n break;\n case 7:\n $this->setPothexchctry($value);\n break;\n case 8:\n $this->setPothexchrate($value);\n break;\n case 9:\n $this->setIntbwhseorig($value);\n break;\n case 10:\n $this->setPothlandcost($value);\n break;\n case 11:\n $this->setPothrcptnbr($value);\n break;\n case 12:\n $this->setPothlandbasedon($value);\n break;\n case 13:\n $this->setPothinvcnbr($value);\n break;\n case 14:\n $this->setPothinvcdate($value);\n break;\n case 15:\n $this->setPothfrtamt($value);\n break;\n case 16:\n $this->setPothmiscamt($value);\n break;\n case 17:\n $this->setDateupdtd($value);\n break;\n case 18:\n $this->setTimeupdtd($value);\n break;\n case 19:\n $this->setDummy($value);\n break;\n } // switch()\n\n return $this;\n }", "public function addElement($item)\n {\n $this->items[$this->itemsCount] = $item;\n $this->itemsCount++;\n }", "function pushData($key, $data);", "function addData($name, $value, $colour)\n {\n $value *= 1.0; // Make sure it's a number\n\n if ($value < 0) {\n return;\n }\n\n $this->data[] = array\n (\n 'name' => $name,\n 'value' => $value,\n 'colour' => $this->hexcol($colour),\n );\n\n $this->total += $value;\n }", "public function add_to_foot($data)\n\t{\n\t\t$this->footer_item[] = $data;\n\t}", "function setPosition($value) {\n $this->_position = intval($value);\n }", "public function setByPosition($pos, $value)\n {\n switch ($pos) {\n case 0:\n $this->setSessionid($value);\n break;\n case 1:\n $this->setRecno($value);\n break;\n case 2:\n $this->setDate($value);\n break;\n case 3:\n $this->setTime($value);\n break;\n case 4:\n $this->setType($value);\n break;\n case 5:\n $this->setCustid($value);\n break;\n case 6:\n $this->setShiptoid($value);\n break;\n case 7:\n $this->setCustname($value);\n break;\n case 8:\n $this->setOrderno($value);\n break;\n case 9:\n $this->setCustpo($value);\n break;\n case 10:\n $this->setCustref($value);\n break;\n case 11:\n $this->setStatus($value);\n break;\n case 12:\n $this->setOrderdate($value);\n break;\n case 13:\n $this->setCareof($value);\n break;\n case 14:\n $this->setQuotdate($value);\n break;\n case 15:\n $this->setInvdate($value);\n break;\n case 16:\n $this->setShipdate($value);\n break;\n case 17:\n $this->setRevdate($value);\n break;\n case 18:\n $this->setExpdate($value);\n break;\n case 19:\n $this->setHasdocuments($value);\n break;\n case 20:\n $this->setHastracking($value);\n break;\n case 21:\n $this->setSubtotal($value);\n break;\n case 22:\n $this->setSalestax($value);\n break;\n case 23:\n $this->setFreight($value);\n break;\n case 24:\n $this->setMisccost($value);\n break;\n case 25:\n $this->setOrdertotal($value);\n break;\n case 26:\n $this->setHasnotes($value);\n break;\n case 27:\n $this->setEditord($value);\n break;\n case 28:\n $this->setError($value);\n break;\n case 29:\n $this->setErrormsg($value);\n break;\n case 30:\n $this->setSconame($value);\n break;\n case 31:\n $this->setShipname($value);\n break;\n case 32:\n $this->setShipaddress($value);\n break;\n case 33:\n $this->setShipaddress2($value);\n break;\n case 34:\n $this->setShipcity($value);\n break;\n case 35:\n $this->setShipstate($value);\n break;\n case 36:\n $this->setShipzip($value);\n break;\n case 37:\n $this->setShipcountry($value);\n break;\n case 38:\n $this->setContact($value);\n break;\n case 39:\n $this->setPhintl($value);\n break;\n case 40:\n $this->setPhone($value);\n break;\n case 41:\n $this->setExtension($value);\n break;\n case 42:\n $this->setFaxnbr($value);\n break;\n case 43:\n $this->setEmail($value);\n break;\n case 44:\n $this->setReleasenbr($value);\n break;\n case 45:\n $this->setShipviacd($value);\n break;\n case 46:\n $this->setShipviadesc($value);\n break;\n case 47:\n $this->setPricecode($value);\n break;\n case 48:\n $this->setPricecodedesc($value);\n break;\n case 49:\n $this->setPricedisp($value);\n break;\n case 50:\n $this->setTaxcode($value);\n break;\n case 51:\n $this->setTaxcodedesc($value);\n break;\n case 52:\n $this->setTaxcodedisp($value);\n break;\n case 53:\n $this->setTermcode($value);\n break;\n case 54:\n $this->setTermtype($value);\n break;\n case 55:\n $this->setTermcodedesc($value);\n break;\n case 56:\n $this->setRqstdate($value);\n break;\n case 57:\n $this->setShipcom($value);\n break;\n case 58:\n $this->setSp1($value);\n break;\n case 59:\n $this->setSp1name($value);\n break;\n case 60:\n $this->setSp2($value);\n break;\n case 61:\n $this->setSp2name($value);\n break;\n case 62:\n $this->setSp2disp($value);\n break;\n case 63:\n $this->setSp3($value);\n break;\n case 64:\n $this->setSp3name($value);\n break;\n case 65:\n $this->setSp3disp($value);\n break;\n case 66:\n $this->setFob($value);\n break;\n case 67:\n $this->setDeliverydesc($value);\n break;\n case 68:\n $this->setWhse($value);\n break;\n case 69:\n $this->setCardnumber($value);\n break;\n case 70:\n $this->setCardexpire($value);\n break;\n case 71:\n $this->setCardcode($value);\n break;\n case 72:\n $this->setCardapproval($value);\n break;\n case 73:\n $this->setTotalcost($value);\n break;\n case 74:\n $this->setTotaldiscount($value);\n break;\n case 75:\n $this->setPaymenttype($value);\n break;\n case 76:\n $this->setSrcdatefrom($value);\n break;\n case 77:\n $this->setSrcdatethru($value);\n break;\n case 78:\n $this->setBillname($value);\n break;\n case 79:\n $this->setBilladdress($value);\n break;\n case 80:\n $this->setBilladdress2($value);\n break;\n case 81:\n $this->setBilladdress3($value);\n break;\n case 82:\n $this->setBillcountry($value);\n break;\n case 83:\n $this->setBillcity($value);\n break;\n case 84:\n $this->setBillstate($value);\n break;\n case 85:\n $this->setBillzip($value);\n break;\n case 86:\n $this->setPrntfmt($value);\n break;\n case 87:\n $this->setPrntfmtdisp($value);\n break;\n case 88:\n $this->setDummy($value);\n break;\n } // switch()\n\n return $this;\n }" ]
[ "0.5231292", "0.5206924", "0.5104459", "0.50767857", "0.5028276", "0.5020101", "0.49048936", "0.4889565", "0.48665488", "0.48301995", "0.48181653", "0.48165485", "0.481629", "0.47600394", "0.47438157", "0.47194618", "0.47158635", "0.47026443", "0.47001815", "0.46973503", "0.46802163", "0.46730882", "0.46520922", "0.4644063", "0.46405622", "0.46251315", "0.46233067", "0.46003318", "0.45930365", "0.45549914", "0.45438758", "0.45426595", "0.45334682", "0.4519631", "0.45047083", "0.4502772", "0.4498747", "0.44936454", "0.44934177", "0.4475742", "0.44718304", "0.4462407", "0.44428003", "0.44418418", "0.44385168", "0.44231987", "0.44202262", "0.44173872", "0.44173872", "0.44144425", "0.44120896", "0.44102916", "0.440547", "0.44002086", "0.44000015", "0.43997315", "0.43987796", "0.4396395", "0.43910807", "0.4389745", "0.43800077", "0.4378391", "0.4375449", "0.43742526", "0.43741152", "0.43730068", "0.43703026", "0.436992", "0.4367109", "0.43656802", "0.43614364", "0.4356519", "0.43517423", "0.43500462", "0.43470594", "0.43438372", "0.43409556", "0.43364623", "0.43341258", "0.43286136", "0.43271387", "0.4324717", "0.4321757", "0.43212447", "0.43203154", "0.43143162", "0.43130815", "0.4311885", "0.43096215", "0.4309132", "0.430843", "0.43064922", "0.4302352", "0.43021128", "0.4301519", "0.4299494", "0.4299323", "0.4297701", "0.42956585", "0.42925683" ]
0.6830623
0
This method is responsible for validating the values passed to the setCompensation_Data method This method is willingly generated in order to preserve the oneline inline validation within the setCompensation_Data method
public static function validateCompensation_DataForArrayConstraintsFromSetCompensation_Data(array $values = array()) { $message = ''; $invalidValues = []; foreach ($values as $employee_DataTypeCompensation_DataItem) { // validation for constraint: itemType if (!$employee_DataTypeCompensation_DataItem instanceof \WorkdayWsdl\\StructType\Compensation_DataType) { $invalidValues[] = is_object($employee_DataTypeCompensation_DataItem) ? get_class($employee_DataTypeCompensation_DataItem) : sprintf('%s(%s)', gettype($employee_DataTypeCompensation_DataItem), var_export($employee_DataTypeCompensation_DataItem, true)); } } if (!empty($invalidValues)) { $message = sprintf('The Compensation_Data property can only contain items of type \WorkdayWsdl\\StructType\Compensation_DataType, %s given', is_object($invalidValues) ? get_class($invalidValues) : (is_array($invalidValues) ? implode(', ', $invalidValues) : gettype($invalidValues))); } unset($invalidValues); return $message; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function validateCompensation_Detail_DataForArrayConstraintsFromSetCompensation_Detail_Data(array $values = array())\n {\n $message = '';\n $invalidValues = [];\n foreach ($values as $employee_DataTypeCompensation_Detail_DataItem) {\n // validation for constraint: itemType\n if (!$employee_DataTypeCompensation_Detail_DataItem instanceof \\WorkdayWsdl\\\\StructType\\Compensation_Detail_DataType) {\n $invalidValues[] = is_object($employee_DataTypeCompensation_Detail_DataItem) ? get_class($employee_DataTypeCompensation_Detail_DataItem) : sprintf('%s(%s)', gettype($employee_DataTypeCompensation_Detail_DataItem), var_export($employee_DataTypeCompensation_Detail_DataItem, true));\n }\n }\n if (!empty($invalidValues)) {\n $message = sprintf('The Compensation_Detail_Data property can only contain items of type \\WorkdayWsdl\\\\StructType\\Compensation_Detail_DataType, %s given', is_object($invalidValues) ? get_class($invalidValues) : (is_array($invalidValues) ? implode(', ', $invalidValues) : gettype($invalidValues)));\n }\n unset($invalidValues);\n return $message;\n }", "private function writeDataValidity(): void\n {\n // Datavalidation collection\n $dataValidationCollection = $this->phpSheet->getDataValidationCollection();\n\n // Write data validations?\n if (!empty($dataValidationCollection)) {\n // DATAVALIDATIONS record\n $record = 0x01B2; // Record identifier\n $length = 0x0012; // Bytes to follow\n\n $grbit = 0x0000; // Prompt box at cell, no cached validity data at DV records\n $horPos = 0x00000000; // Horizontal position of prompt box, if fixed position\n $verPos = 0x00000000; // Vertical position of prompt box, if fixed position\n $objId = 0xFFFFFFFF; // Object identifier of drop down arrow object, or -1 if not visible\n\n $header = pack('vv', $record, $length);\n $data = pack('vVVVV', $grbit, $horPos, $verPos, $objId, count($dataValidationCollection));\n $this->append($header . $data);\n\n // DATAVALIDATION records\n $record = 0x01BE; // Record identifier\n\n foreach ($dataValidationCollection as $cellCoordinate => $dataValidation) {\n // options\n $options = 0x00000000;\n\n // data type\n $type = CellDataValidation::type($dataValidation);\n\n $options |= $type << 0;\n\n // error style\n $errorStyle = CellDataValidation::errorStyle($dataValidation);\n\n $options |= $errorStyle << 4;\n\n // explicit formula?\n if ($type == 0x03 && preg_match('/^\\\".*\\\"$/', $dataValidation->getFormula1())) {\n $options |= 0x01 << 7;\n }\n\n // empty cells allowed\n $options |= $dataValidation->getAllowBlank() << 8;\n\n // show drop down\n $options |= (!$dataValidation->getShowDropDown()) << 9;\n\n // show input message\n $options |= $dataValidation->getShowInputMessage() << 18;\n\n // show error message\n $options |= $dataValidation->getShowErrorMessage() << 19;\n\n // condition operator\n $operator = CellDataValidation::operator($dataValidation);\n\n $options |= $operator << 20;\n\n $data = pack('V', $options);\n\n // prompt title\n $promptTitle = $dataValidation->getPromptTitle() !== '' ?\n $dataValidation->getPromptTitle() : chr(0);\n $data .= StringHelper::UTF8toBIFF8UnicodeLong($promptTitle);\n\n // error title\n $errorTitle = $dataValidation->getErrorTitle() !== '' ?\n $dataValidation->getErrorTitle() : chr(0);\n $data .= StringHelper::UTF8toBIFF8UnicodeLong($errorTitle);\n\n // prompt text\n $prompt = $dataValidation->getPrompt() !== '' ?\n $dataValidation->getPrompt() : chr(0);\n $data .= StringHelper::UTF8toBIFF8UnicodeLong($prompt);\n\n // error text\n $error = $dataValidation->getError() !== '' ?\n $dataValidation->getError() : chr(0);\n $data .= StringHelper::UTF8toBIFF8UnicodeLong($error);\n\n // formula 1\n try {\n $formula1 = $dataValidation->getFormula1();\n if ($type == 0x03) { // list type\n $formula1 = str_replace(',', chr(0), $formula1);\n }\n $this->parser->parse($formula1);\n $formula1 = $this->parser->toReversePolish();\n $sz1 = strlen($formula1);\n } catch (PhpSpreadsheetException $e) {\n $sz1 = 0;\n $formula1 = '';\n }\n $data .= pack('vv', $sz1, 0x0000);\n $data .= $formula1;\n\n // formula 2\n try {\n $formula2 = $dataValidation->getFormula2();\n if ($formula2 === '') {\n throw new WriterException('No formula2');\n }\n $this->parser->parse($formula2);\n $formula2 = $this->parser->toReversePolish();\n $sz2 = strlen($formula2);\n } catch (PhpSpreadsheetException $e) {\n $sz2 = 0;\n $formula2 = '';\n }\n $data .= pack('vv', $sz2, 0x0000);\n $data .= $formula2;\n\n // cell range address list\n $data .= pack('v', 0x0001);\n $data .= $this->writeBIFF8CellRangeAddressFixed($cellCoordinate);\n\n $length = strlen($data);\n $header = pack('vv', $record, $length);\n\n $this->append($header . $data);\n }\n }\n }", "public function isValid($data) {\n //Remove Commas \n $data = str_replace(\",\", \"\", $data);\n \n $data['heatLossMethod']='percent';\n \n $precision = $this->mS->masterConversionList['temperature'][1][$this->mS->selected['temperature']][4];\n $iapws = new Steam_IAPWS();\n $maxTemp = $this->mS->ceil_dec($this->mS->localize($iapws->saturatedTemperature($this->mS->standardize($data['daPressure'], 'pressure')),'temperature'),$precision); \n \n if ($data['condReturnTemp']>=$maxTemp or $data['condReturnTemp']<=$this->mS->minTemperature()){\n $this->getElement('condReturnTemp')->addValidator('between', true, array('min' => $this->mS->minTemperature(), 'max' => $maxTemp, 'inclusive' => false));\n }\n \n \n $precision = $this->mS->masterConversionList['temperature'][1][$this->mS->selected['temperature']][4];\n $iapws = new Steam_IAPWS();\n $minTemp = $this->mS->ceil_dec($this->mS->localize($iapws->saturatedTemperature($this->mS->standardize($data['highPressure'],'pressure')),'temperature'),$precision);\n if ($data['boilerTemp']<$minTemp){\n $this->getElement('boilerTemp')\n ->addValidator('greaterThan', true, array('min' => $minTemp, 'messages' => '%value% is below the boiling temperature [%min%] for boiler pressure.'));\n }\n \n \n if ($data['headerCount']<3){\n $data['turbineHpMpOn'] = null;\n $data['turbineMpLpOn'] = null;\n $data['desuperHeatHpMp']=='No';\n if ($data['mpCondReturnRate']=='') $data['mpCondReturnRate'] = 0;\n if ($data['lpCondReturnRate']=='') $data['lpCondReturnRate'] = 0;\n }\n if ($data['headerCount']<2){\n $data['turbineHpLpOn'] = null;\n $data['desuperHeatMpLp']=='No';\n }\n \n if ($data['headerCount']==3){\n if($data['desuperHeatHpMp']=='Yes'){ \n $this->getElement('desuperHeatHpMpTemp')\n ->setRequired(true)\n ->addValidator($this->isFloat,true)\n ->addValidator('between', true, array('min' => $this->mS->minTemperature(), 'max' => $this->mS->maxTemperature(), 'inclusive' => true));\n }\n }\n if ($data['headerCount']>=2){\n if($data['desuperHeatMpLp']=='Yes'){ \n $this->getElement('desuperHeatMpLpTemp')\n ->setRequired(true)\n ->addValidator($this->isFloat,true)\n ->addValidator('between', true, array('min' => $this->mS->minTemperature(), 'max' => $this->mS->maxTemperature(), 'inclusive' => true)); \n }\n }\n\n \n if($data['blowdownHeatX']=='Yes'){ \n $this->getElement('blowdownHeatXTemp')\n ->setRequired(true)\n ->addValidator($this->isFloat,true)\n ->addValidator('greaterThan', true, array('min' => 0, 'max' => $this->mS->maxTemperature(), 'inclusive' => true));\n }\n \n foreach(Steam_Support::steamTurbineCodes() as $turbine){\n if ($data['turbine'.$turbine.'On']==1){\n $this->getElement('turbine'.$turbine.'IsoEff')->setRequired('true')\n ->addValidator($this->isFloat)\n ->addValidator('Between', true, array('min' => ISOEFF_MIN, 'max' => ISOEFF_MAX));\n $this->getElement('turbine'.$turbine.'GenEff')->setRequired('true')\n ->addValidator($this->isFloat)\n ->addValidator('Between', true, array('min' => GENEFF_MIN, 'max' => GENEFF_MAX));\n \n if ($turbine=='Cond'){\n $this->getElement('turbineCondOutletPressure')->setRequired(true)\n ->addValidator($this->isFloat,true)\n ->addValidator('between', true, array('min' => $this->mS->minVacuum(), 'max' => $this->mS->condVacuum(), 'inclusive' => true));\n }\n \n switch($data['turbine'.$turbine.'Method']){\n case 'fixedFlow':\n $this->getElement('turbine'.$turbine.'FixedFlow')->setRequired('true')\n ->addValidator($this->isFloat)\n ->addValidator('between', true, array('min' => $this->mS->minMassflow(), 'max' => $this->mS->maxMassflow(), 'inclusive' => false)); \n break;\n case 'flowRange':\n $this->getElement('turbine'.$turbine.'MinFlow')->setRequired('true')\n ->addValidator($this->isFloat)\n ->addValidator('between', true, array('min' => $this->mS->minMassflow(), 'max' => $data['turbine'.$turbine.'MaxFlow'])); \n \n $this->getElement('turbine'.$turbine.'MaxFlow')->setRequired('true')\n ->addValidator($this->isFloat)\n ->addValidator('between', true, array('min' => $this->mS->minMassflow(), 'max' => $this->mS->maxMassflow(), 'inclusive' => false));\n break;\n\n case 'fixedPower':\n $this->getElement('turbine'.$turbine.'FixedPower')->setRequired('true')\n ->addValidator($this->isFloat)\n ->addValidator('greaterThan', true, array('min' => 0)); \n break;\n case 'powerRange':\n $this->getElement('turbine'.$turbine.'MinPower')->setRequired('true')\n ->addValidator($this->isFloat)\n ->addValidator('between', true, array('min' => 0, 'max' => $data['turbine'.$turbine.'MaxPower'])); \n \n $this->getElement('turbine'.$turbine.'MaxPower')->setRequired('true')\n ->addValidator($this->isFloat)\n ->addValidator('greaterThan', true, array('min' => 0)); \n break;\n\n case 'balanceHeader':\n break;\n }\n }\n }\n \n $this->getElement('hpSteamUsage')->addValidator('between', true, array('min' => $this->mS->minMassflow(), 'max' => $this->mS->maxMassflow(), 'inclusive' => true));\n \n $this->getElement('hpHeatLossPercent')->setRequired(true)\n ->addValidator($this->isFloat,true)\n ->addValidator('between', true, array('min' => HEATLOST_PERCENT_MIN, 'max' => HEATLOST_PERCENT_MAX, 'inclusive' => true));\n \n \n if ($data['headerCount']==3){\n $tmp = $this->getElement('mediumPressure')->setRequired(true)\n ->addValidator($this->isFloat,true);\n if (isset($data['highPressure'])) $tmp->addValidator('lessThan', true, array('max' => $data['highPressure'], 'messages' => 'Must be less than High Pressure.'));\n $tmp->addValidator('greaterThan', true, array('min' => $this->mS->minPressure()));\n $tmp = $this->getElement('lowPressure')->setRequired(true)\n ->addValidator($this->isFloat,true);\n if (isset($data['mediumPressure'])) $tmp->addValidator('lessThan', true, array('max' => $data['mediumPressure'], 'messages' => 'Must be less than Medium Pressure.'));\n $tmp->addValidator('greaterThan', true, array('min' => $this->mS->minPressure())); \n if (isset($data['lowPressure'])) $this->getElement('daPressure')->addValidator('lessThan', true, array('max' => $data['lowPressure'], 'messages' => 'Must be below lowest steam header pressure.'));\n \n \n $this->getElement('mpSteamUsage')->setRequired(true)\n ->addValidator($this->isFloat,true);\n $this->getElement('mpSteamUsage')->addValidator('between', true, array('min' => $this->mS->minMassflow(), 'max' => $this->mS->maxMassflow(), 'inclusive' => true)); \n \n $this->getElement('mpCondReturnRate')->setRequired(true)\n ->addValidator($this->isFloat,true)\n ->addValidator('between', true, array('min' => 0, 'max' => 100, 'inclusive' => true));\n \n $this->getElement('mpHeatLossPercent')->setRequired(true)\n ->addValidator($this->isFloat,true)\n ->addValidator('between', true, array('min' => HEATLOST_PERCENT_MIN, 'max' => HEATLOST_PERCENT_MAX, 'inclusive' => true)); \n }\n \n if ($data['headerCount']==2){\n \n $tmp = $this->getElement('lowPressure')->setRequired(true)\n ->addValidator($this->isFloat,true);\n if (isset($data['highPressure'])) $tmp->addValidator('lessThan', true, array('max' => $data['highPressure'], 'messages' => 'Must be less than High Pressure.'));\n $tmp->addValidator('greaterThan', true, array('min' => $this->mS->minPressure())); \n if (isset($data['lowPressure'])) $this->getElement('daPressure')->addValidator('lessThan', true, array('max' => $data['lowPressure'], 'messages' => 'Must be below lowest steam header pressure.'));\n \n }\n \n if ($data['headerCount']>=2){\n \n $this->getElement('lpSteamUsage')->setRequired(true)\n ->addValidator($this->isFloat,true);\n \n $this->getElement('lpSteamUsage')->addValidator('between', true, array('min' => $this->mS->minMassflow(), 'max' => $this->mS->maxMassflow(), 'inclusive' => true)); \n \n $this->getElement('lpCondReturnRate')->setRequired(true)\n ->addValidator($this->isFloat,true)\n ->addValidator('between', true, array('min' => 0, 'max' => 100, 'inclusive' => true));\n \n $this->getElement('lpHeatLossPercent')->setRequired(true)\n ->addValidator($this->isFloat,true)\n ->addValidator('between', true, array('min' => HEATLOST_PERCENT_MIN, 'max' => HEATLOST_PERCENT_MAX, 'inclusive' => true)); \n }\n \n if ($data['headerCount']==1){ \n if (isset($data['highPressure'])) $this->getElement('daPressure')->addValidator('lessThan', true, array('max' => $data['highPressure'], 'messages' => 'Must be below lowest steam header pressure.')); \n \n } \n return parent::isValid($data);\n }", "function ValidateData()\n\t\t{\n\t\t\t$theValidator = new CValidator();\n\t\t\tif(!$this->arrValidator || !is_array($this->arrValidator) )\n\t\t\t{\n\t\t\t\t$this->arrValidator = array();\n\t\t\t}\n\t\t\tforeach($this->arrValidator as $key=>$value)\n\t\t\t{\n\t\t\t\tif($this->$key == '')\n\t\t\t\t{\n\t\t\t\t\t// Kiem tra xem co phai bat buoc khong?\n\t\t\t\t\tif(isset($this->arrRequired[$key]) && ($this->arrRequired[$key] == 1))\n\t\t\t\t\t{\n\t\t\t\t\t\treturn(false);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif(!$theValidator->CheckPatt($value, $this->$key))\n\t\t\t\t\t{\n\t\t\t\t\t\treturn(false);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn(true);\n\t\t}", "abstract public function validateData();", "function isDataValid() \n {\n return true;\n }", "private function validateLicenseData()\n {\n\n // error_log('LicenseEmail : '.print_r($this->getLicenseEmail(), 1));\n // error_log('LicenseProduct : '.print_r($this->getLicenseProduct(), 1));\n // error_log('LicenseSecretKey : '.print_r($this->getLicenseSecretKey(), 1));\n }", "protected function validate() {\r\n if ($this->getBaseAmount() <= 0)\r\n $this->errors->add(\"The base amount of alicuota must be greater than 0.\");\r\n// \t\t\telse\r\n// \t\t\t{\r\n// \t\t\t\t$relativeError = (($this->getTaxAmount() / $this->getBaseAmount() * 100) - $this->getTaxPercent());\r\n// \t\t\t\t$relativeError = $relativeError / $this->getTaxPercent();\r\n// \t\t\t\t$relativeError = NumberDataTypeHelper::truncate($relativeError, 2);\r\n// \t\t\t\tif (abs($relativeError) > 0.01)\r\n// \t\t\t\t\t$this->errors->add(\"The base and tax amount do not match with the alicuota ({$this->getName()}). Diference: $relativeError\");\r\n// \t\t\t}\r\n }", "function addValidationRules(){\n\t\t$this->registerRule('validDate','function','validDate');\n\t\t$this->registerRule('validPeriod','function','validPeriod');\n\t\t$this->registerRule('existe','function','existe');\n\t\t$this->registerRule('number_range','function','number_range');\n\t\t$this->registerRule('validInterval','function','validInterval');\n\t\t$this->registerRule('couple_not_null','function','couple_not_null');\n\t\t$this->registerRule('validParam','function','validParam');\n\t\t$this->registerRule('validUnit_existe','function','validUnit_existe');\n\t\t$this->registerRule('validUnit_required','function','validUnit_required');\n\t\t$this->addRule('dats_title','Data description: Metadata informative title is required','required');\n\t\t$this->addRule('dats_title','Data description: Dataset name exceeds the maximum length allowed (100 characters)','maxlength',100);\t\n\t\t$this->addRule('dats_date_begin','Temporal coverage: Date begin is not a date','validDate');\n\t\t$this->addRule('dats_date_end','Temporal coverage: Date end is not a date','validDate');\n\t\t$this->addRule(array('dats_date_begin','dats_date_end'),'Temporal coverage: Date end must be after date begin','validPeriod');\n\t\tif ($this->dataset->dats_id == 0){\n\t\t\t$this->addRule('dats_title','Data description: A dataset with the same title exists in the database','existe',array('dataset','dats_title'));\n\t\t}\n\t\t\n\t\tif (isset($this->dataset->data_policy) && !empty($this->dataset->data_policy) && $this->dataset->data_policy->data_policy_id > 0){\n\t\t\t$this->getElement('new_data_policy')->setAttribute('onfocus','blur()');\n\t\t}\n\t\t$this->addRule('new_data_policy','Data use information: Data policy exceeds the maximum length allowed (100 characters)','maxlength',100);\t\n\t\t$attrs = array();\n\t\tif (isset($this->dataset->database) && !empty($this->dataset->database) && $this->dataset->database->database_id > 0){\n\t\t\t//$this->getElement('new_database')->setAttribute('onfocus','blur()');\n\t\t\t//$this->getElement('new_db_url')->setAttribute('onfocus','blur()');\n\t\t\t$this->disableElement('new_database');\n\t\t\t$this->disableElement('new_db_url');\n\t\t}\n\t\t/*else {\n\t\t\t//$this->addRule('new_database','A database with the same title already exists','existe',array('database','database_name'));\n\t\t}*/\n\t\t$this->addRule('new_database','Data use information: Database name exceeds the maximum length allowed (250 characters)','maxlength',250);\n\t\t$this->addRule('new_db_url','Data use information: Database url exceeds the maximum length allowed (250 characters)','maxlength',250);\t\n\t\t//Formats\n\t\tfor ($i = 0; $i < $this->dataset->nbFormats; $i++){\n\t\t\t$this->addRule('data_format_'.$i,'Data use information: Format name '.($i+1).' exceeds the maximum length allowed (100 characters)','maxlength',100);\n\t\t\tif (isset($this->dataset->data_formats[$i]) && !empty($this->dataset->data_formats[$i]) && $this->dataset->data_formats[$i]->data_format_id > 0){\n\t\t\t\t//$this->getElement('new_data_format_'.$i)->setAttribute('onfocus','blur()');\n\t\t\t\t$this->disableElement('new_data_format_'.$i);\n\t\t\t}\n\t\t\t/*else{\n\t\t\t\t//$this->addRule('new_data_format_'.$i,'Data format '.($i+1).': This format already exists in the database','existe',array('data_format','data_format_name'));\n\t\t\t}*/\n\t\t}\n\t\t//Contacts\n\t\t$this->addRule('pi_0','Contact 1 is required','couple_not_null',array($this,'pi_name_0'));\n\t\t$this->addRule('organism_0','Contact 1: organism is required','couple_not_null',array($this,'org_sname_0'));\n\t\t$this->addRule('email1_0','Contact 1: email1 is required','required');\t\n\t\tfor ($i = 0; $i < $this->dataset->nbPis; $i++){\n\t\t\t$this->addRule('pi_name_'.$i,'Contact '.($i+1).': Name exceeds the maximum length allowed (250 characters)','maxlength',250);\n\t\t\t$this->addRule('email1_'.$i,'Contact '.($i+1).': email1 is incorrect','email');\n\t\t\t$this->addRule('email2_'.$i,'Contact '.($i+1).': email2 is incorrect','email');\n\t\t\t$this->addRule('org_fname_'.$i,'Contact '.($i+1).': Organism full name exceeds the maximum length allowed (250 characters)','maxlength',250);\n\t\t\t$this->addRule('org_sname_'.$i,'Contact '.($i+1).': Organism short name exceeds the maximum length allowed (50 characters)','maxlength',50);\n\t\t\t$this->addRule('org_url_'.$i,'Contact '.($i+1).': Organism url exceeds the maximum length allowed (250 characters)','maxlength',250);\n\t\t\t$this->addRule('email1_'.$i,'Contact '.($i+1).': email1 exceeds the maximum length allowed (250 characters)','maxlength',250);\n\t\t\t$this->addRule('email2_'.$i,'Contact '.($i+1).': email2 exceeds the maximum length allowed (250 characters)','maxlength',250);\n\t\t\tif (isset($this->dataset->originators[$i]) && !empty($this->dataset->originators[$i]) && $this->dataset->originators[$i]->pers_id > 0){\n\t\t\t\t//$this->getElement('pi_name_'.$i)->setAttribute('onfocus','blur()');\n\t\t\t\t//$this->getElement('email1_'.$i)->setAttribute('onfocus','blur()');\n\t\t\t\t//$this->getElement('email2_'.$i)->setAttribute('onfocus','blur()');\n\t\t\t\t//$this->getElement('organism_'.$i)->setAttribute('onfocus','blur()');\n\t\t\t\t$this->disableElement('pi_name_'.$i);\n\t\t\t\t$this->disableElement('email1_'.$i);\n\t\t\t\t$this->disableElement('email2_'.$i);\n\t\t\t\t$this->disableElement('organism_'.$i);\n\t\t\t}\n\t\t\t/*else{\n\t\t\t\t//$this->addRule('pi_name_'.$i,'Contact '.($i+1).': A contact with the same name is already present in the database. Select it in the drop-down list.','existe',array('personne','pers_name'));\n\t\t\t}*/\n\t\t\tif (isset($this->dataset->originators[$i]->organism) && !empty($this->dataset->originators[$i]->organism) && $this->dataset->originators[$i]->organism->org_id > 0){\n\t\t\t\t//$this->getElement('org_sname_'.$i)->setAttribute('onfocus','blur()');\n\t\t\t\t//$this->getElement('org_fname_'.$i)->setAttribute('onfocus','blur()');\n\t\t\t\t//$this->getElement('org_url_'.$i)->setAttribute('onfocus','blur()');\n\t\t\t\t$this->disableElement('org_sname_'.$i);\n\t\t\t\t$this->disableElement('org_fname_'.$i);\n\t\t\t\t$this->disableElement('org_url_'.$i);\n\t\t\t}\n\t\t\tif ($i != 0){\n\t\t\t\t$this->addRule('pi_name_'.$i,'Contact '.($i+1).': email1 is required','contact_email_required',array($this,$i));\n\t\t\t\t$this->addRule('pi_name_'.$i,'Contact '.($i+1).': organism is required','contact_organism_required',array($this,$i));\n\t\t\t}\n\t\t}\n\t\t\n\t\t//Add validation rules\n\t\t$this->AddModValidationRules();\n\t\t$this->AddSatValidationRules();\n\t\t$this->AddInstruValidationRules();\n\n\t\t//$this->addRule('grid_type','Coverage: Grid type exceeds the maximum length allowed (100 characters)','maxlength',100);\n\t\t$this->addVaValidationRulesResolution('Coverage');\n\t\t//$this->addRule('sensor_resol_temp','Coverage: Temporal resolution is incorrect','validDate');\n\t\t$this->addRule('sensor_resol_tmp','Coverage: temporal resolution is incorrect','regex',\"/^[0-9]{2}[:][0-9]{2}[:][0-9]{2}$/\");\n\t\t$this->addValidationRulesGeoCoverage();\n\t\t//PARAMETER\n\t\tfor ($i = 0; $i < $this->dataset->nbVars; $i++){\n\t\t\t$this->addValidationRulesVariable($i,$i,'Parameter '.($i+1));\n\t\t}\n\t\t\n\t}", "public static function validateCOBRA_Eligibility_DataForArrayConstraintsFromSetCOBRA_Eligibility_Data(array $values = array())\n {\n $message = '';\n $invalidValues = [];\n foreach ($values as $dependent_Coverage_DataTypeCOBRA_Eligibility_DataItem) {\n // validation for constraint: itemType\n if (!$dependent_Coverage_DataTypeCOBRA_Eligibility_DataItem instanceof \\WorkdayWsdl\\\\StructType\\COBRA_Eligibility_DataType) {\n $invalidValues[] = is_object($dependent_Coverage_DataTypeCOBRA_Eligibility_DataItem) ? get_class($dependent_Coverage_DataTypeCOBRA_Eligibility_DataItem) : sprintf('%s(%s)', gettype($dependent_Coverage_DataTypeCOBRA_Eligibility_DataItem), var_export($dependent_Coverage_DataTypeCOBRA_Eligibility_DataItem, true));\n }\n }\n if (!empty($invalidValues)) {\n $message = sprintf('The COBRA_Eligibility_Data property can only contain items of type \\WorkdayWsdl\\\\StructType\\COBRA_Eligibility_DataType, %s given', is_object($invalidValues) ? get_class($invalidValues) : (is_array($invalidValues) ? implode(', ', $invalidValues) : gettype($invalidValues)));\n }\n unset($invalidValues);\n return $message;\n }", "public function validateDataInvoice(): void\n {\n $this->validarDatos($this->datos, $this->getRules('fe'));\n\n $this->validarDatosArray($this->datos->arrayOtrosTributos, 'tributos');\n\n /** @phpstan-ignore-next-line */\n if (property_exists($this->datos, 'arraySubtotalesIVA')) {\n $this->validarDatosArray((array) $this->datos->arraySubtotalesIVA, 'iva');\n }\n\n $this->validarDatosArray($this->datos->comprobantesAsociados, 'comprobantesAsociados');\n\n if ($this->ws === 'wsfe') {\n if (property_exists($this->datos, 'arrayOpcionales')) {\n $this->validarDatosArray((array) $this->datos->arrayOpcionales, 'opcionales');\n }\n } elseif ($this->ws === 'wsmtxca') {\n $this->validarDatosArray($this->datos->items, 'items');\n }\n }", "protected function prepareValidations() {}", "private function checkData(){\n $this->datavalidator->addValidation('article_title','req',$this->text('e10'));\n $this->datavalidator->addValidation('article_title','maxlen=250',$this->text('e11'));\n $this->datavalidator->addValidation('article_prologue','req',$this->text('e12'));\n $this->datavalidator->addValidation('article_prologue','maxlen=3000',$this->text('e13'));\n $this->datavalidator->addValidation('keywords','regexp=/^[^,\\s]{3,}(,? ?[^,\\s]{3,})*$/',$this->text('e32'));\n $this->datavalidator->addValidation('keywords','maxlen=500',$this->text('e33'));\n if($this->data['layout'] != 'g' && $this->data['layout'] != 'h'){ //if article is gallery dont need content\n $this->datavalidator->addValidation('article_content','req',$this->text('e14'));\n }\n $this->datavalidator->addValidation('id_menucategory','req',$this->text('e15'));\n $this->datavalidator->addValidation('id_menucategory','numeric',$this->text('e16'));\n $this->datavalidator->addValidation('layout','req',$this->text('e17'));\n $this->datavalidator->addValidation('layout','maxlen=1',$this->text('e18'));\n if($this->languager->getLangsCount() > 1){\n $this->datavalidator->addValidation('lang','req',$this->text('e19'));\n $this->datavalidator->addValidation('lang','numeric',$this->text('e20'));\n }\n //if user cannot publish articles check publish values\n if($_SESSION[PAGE_SESSIONID]['privileges']['articles'][2] == '1') {\n $this->datavalidator->addValidation('published','req',$this->text('e21'));\n $this->datavalidator->addValidation('published','numeric',$this->text('e22'));\n $this->datavalidator->addValidation('publish_date','req',$this->text('e23'));\n }\n $this->datavalidator->addValidation('topped','req',$this->text('e24'));\n $this->datavalidator->addValidation('topped','numeric',$this->text('e25'));\n $this->datavalidator->addValidation('homepage','req',$this->text('e30'));\n $this->datavalidator->addValidation('homepage','numeric',$this->text('e31'));\n $this->datavalidator->addValidation('showsocials','req',$this->text('e26'));\n $this->datavalidator->addValidation('showsocials','numeric',$this->text('e27'));\n \n $result = $this->datavalidator->ValidateData($this->data);\n if(!$result){\n $errors = $this->datavalidator->GetErrors();\n return array('state'=>'error','data'=> reset($errors));\n }else{\n return true;\n }\n }", "public function validate()\n {\n if ($this->amount <= 0) {\n $this->errors[0] = 'Wpisz poprawną kwotę!';\n }\n \n if (!isset($this->payment)) {\n $this->errors[1] = 'Wybierz sposób płatności!';\n }\n \n if (!isset($this->category)) {\n $this->errors[2] = 'Wybierz kategorię!';\n }\n }", "private function validRow($arrayToCheck) {\n if (isset($arrayToCheck) && !empty($arrayToCheck)) {\n //check number values\n if (count($arrayToCheck) == COUNT_VALUES) {\n //check values needed to put in database\n \n //Check subscriber\n if (!intval($arrayToCheck[2])) {\n $this->arrMsgError[] = array(\n 'data' => $arrayToCheck,\n 'error' => 'Subscriber is not an integer'\n );\n return false;\n }\n\n //Check date\n list($day, $month, $year) = explode('/', $arrayToCheck[3]);\n if(!checkdate($month,$day,$year)) {\n $this->arrMsgError[] = array(\n 'data' => $arrayToCheck,\n 'error' => 'Date is wrong'\n );\n return false;\n }\n\n //Check hour\n if (!preg_match(\"/^(?:2[0-3]|[01][0-9]):[0-5][0-9]:[0-5][0-9]$/\", $arrayToCheck[4])) {\n $this->arrMsgError[] = array(\n 'data' => $arrayToCheck,\n 'error' => 'Time is wrong'\n );\n return false;\n }\n\n //Check Consumption\n if (preg_match(\"/^(?:2[0-3]|[01][0-9]):[0-5][0-9]:[0-5][0-9]$/\", $arrayToCheck[5])) {\n $type = 'call';\n $parsed = date_parse($arrayToCheck[5]);\n $consumption = $parsed['hour'] * 3600 + $parsed['minute'] * 60 + $parsed['second'];\n }\n elseif ($arrayToCheck[6] == '0.0' || intval($arrayToCheck[6])) {\n $type = 'data';\n $consumption = intval($arrayToCheck[6]);\n }\n elseif ($arrayToCheck[5]=='' || $arrayToCheck[6]=='') {\n $type = 'sms';\n $consumption = '';\n }\n else {\n $this->arrMsgError[] = array(\n 'data' => $arrayToCheck,\n 'error' => 'Consumption values are not good'\n );\n return false;\n }\n\n //return array to insert in database \n //array(subscriber, datetime, consumption, $type)\n $date = date(\"Y-m-d H:i:s\", strtotime(str_replace('/', '-', $arrayToCheck[3]).' '.$arrayToCheck[4]));\n return array(\n 'subscriber' => $arrayToCheck[2],\n 'date' => $date,\n 'consumption' => $consumption,\n 'type' => $type);\n } \n else\n return false;\n }\n else {\n return false;\n }\n }", "protected function prepareForValidation() {\n\n // converting date and hour to datetime\n if ($this->has(['start_date', 'start_time'])) {\n $start_datetime = Carbon::createFromFormat('Y-m-d H:i', $this->input('start_date').\" \".$this->input('start_time'));\n $start_datetime->setTimezone('Europe/London');\n $this->merge(['start_date' => $start_datetime]);\n }\n\n if ($this->has(['end_date', 'end_time'])) {\n $end_datetime = Carbon::createFromFormat('Y-m-d H:i', $this->input('end_date').\" \".$this->input('end_time'));\n $this->merge(['end_date' => $end_datetime]);\n }\n\n if ($this->has('starting_bid')) {\n $this->merge(['starting_bid' => ceil($this->input('starting_bid') * 100)]);\n }\n\n // determine if minimum increment is percentage or fixed\n if ($this->has('increment_val')) {\n if ($this->has('percent_check') && $this->input('percent_check')) // percentual\n $this->merge(['increment_percent' => $this->input('increment_val')]);\n else // fixed\n $this->merge(['increment_fixed' => ceil($this->input('increment_val') * 100)]);\n }\n }", "function validateData($array){\n\t\t$errorFlag=true;\n\t\t$currentDate = getdate(); //get current date\n\t\tif (trim($array['FName'])==''){\n\t\t\t$this->appendErrorMsg(\"First Name is required\");\n\t\t\t$errorFlag = false;\n\t\t}\n\t\tif (trim($array['LName'])==''){\n\t\t\t$this->appendErrorMsg(\"Last Name is required\");\n\t\t\t$errorFlag = false;\n\t\t}\n\t\tif (trim($array['License_No'])==''){\n\t\t\t$this->appendErrorMsg(\"License number is required\");\n\t\t\t$errorFlag = false;\n\t\t}\n\t\tif (trim($array['Birthdate'])==''){\n\t\t\t$this->appendErrorMsg(\"Birthdate cannot be blank\");\n\t\t\t$errorFlag = false;\n\t\t} else if (!preg_match(\"/^[0-9]{4,4}[-][0-1]{1,2}?[0-9]{1,2}[-][0-3]{1,2}?[0-9]{1,2}$/\", $array['Birthdate'])){\n\t\t\t$this->appendErrorMsg(\"Date should be in the format yyyy-mm-dd\");\n\t\t\t$errorFlag = false;\n\t\t} else if (getAge($array['Birthdate'])<16 || getAge($array['Birthdate'])> 100){\n\t\t\t$this->appendErrorMsg(\"Sorry, we do not provide coverage to drivers under the age of 16 or over the age of 100\");\n\t\t\t$errorFlag = false;\n\t\t}\n\t\tif (trim($array['PostalCode'])==''){\n\t\t\t$this->appendErrorMsg(\"Postal Code is required\");\n\t\t\t$errorFlag = false;\n\t\t} else if (!preg_match(\"/^[A-Za-z]{1}\\d{1}[A-Za-z]{1}\\d{1}[A-Za-z]{1}\\d{1}$/\",$array['PostalCode'])){\n\t\t\t$this->appendErrorMsg(\"Postal Code should be in the format A1B2C3\");\n\t\t\t$errorFlag = false;\n\t\t}\n\t\tif (trim($array['Phone'])==''){\n\t\t\t$this->appendErrorMsg(\"Phone number is required\");\n\t\t\t$errorFlag = false;\n\t\t} else if (!preg_match(\"/^[0-9]{10}$/\",$array['Phone'])){\n\t\t\t$this->appendErrorMsg(\"Phone number must be in the format xxx-xxx-xxxx or xxxxxxxxx\");\n\t\t\t$errorFlag = false;\n\t\t}\n\t\tif (!preg_match(\"/^[0-9]{1,}$/\", $array['Years_Exp'])){\n\t\t\t$this->appendErrorMsg(\"Please input the number of Years of Experience\");\n\t\t\t$errorFlag = false;\n\t\t}\n\t\treturn $errorFlag;\n\t}", "protected function prepareForValidation()\n {\n $merge = [];\n\n if ($this->valtotal) {\n $merge['valtotal'] = Format::strToFloat($this->valtotal);\n }\n\n $this->merge($merge);\n }", "function validate() {\n\t\t\n\t\tif(is_array($this->value)) { // If array\n\t\t\tforeach($this->value as $k => $value){\n\t\t\t\t$this->value[$k] = $this->validate_color_rgba($value);\n\t\t\t}//foreach\n\t\t} else { // not array\n\t\t\t$this->value = $this->validate_color_rgba($this->value);\n\t\t} // END array check\n\t\t\n\t}", "public function validate() {\r\n // Name - this is required\r\n if ($this->description == '') {\r\n $this->errors[] = 'Description is required';\r\n } \r\n \r\n // Category number - must be a number\r\n if (!is_numeric($this->category)) {\r\n $this->category = 0;\r\n } \r\n \r\n // Item number - must be a number\r\n if (!is_numeric($this->item)) {\r\n $this->item = 0;\r\n } \r\n }", "public function validation($data, $files) {\r\n\r\n // // Check open and close times are consistent.\r\n // if ($data['timeopen'] != 0 && $data['timeclose'] != 0 &&\r\n // $data['timeclose'] < $data['timeopen']) {\r\n // $errors['timeclose'] = get_string('closebeforeopen', 'quiz');\r\n // }\r\n\r\n // // Check that the grace period is not too short.\r\n // if ($data['overduehandling'] == 'graceperiod') {\r\n // $graceperiodmin = get_config('quiz', 'graceperiodmin');\r\n // if ($data['graceperiod'] <= $graceperiodmin) {\r\n // $errors['graceperiod'] = get_string('graceperiodtoosmall', 'quiz', format_time($graceperiodmin));\r\n // }\r\n // }\r\n\r\n // if (array_key_exists('completion', $data) && $data['completion'] == COMPLETION_TRACKING_AUTOMATIC) {\r\n // $completionpass = isset($data['completionpass']) ? $data['completionpass'] : $this->current->completionpass;\r\n\r\n // // Show an error if require passing grade was selected and the grade to pass was set to 0.\r\n // if ($completionpass && (empty($data['gradepass']) || grade_floatval($data['gradepass']) == 0)) {\r\n // if (isset($data['completionpass'])) {\r\n // $errors['completionpassgroup'] = get_string('gradetopassnotset', 'quiz');\r\n // } else {\r\n // $errors['gradepass'] = get_string('gradetopassmustbeset', 'quiz');\r\n // }\r\n // }\r\n // }\r\n\r\n // // Check the boundary value is a number or a percentage, and in range.\r\n // $i = 0;\r\n // while (!empty($data['feedbackboundaries'][$i] )) {\r\n // $boundary = trim($data['feedbackboundaries'][$i]);\r\n // if (strlen($boundary) > 0) {\r\n // if ($boundary[strlen($boundary) - 1] == '%') {\r\n // $boundary = trim(substr($boundary, 0, -1));\r\n // if (is_numeric($boundary)) {\r\n // $boundary = $boundary * $data['grade'] / 100.0;\r\n // } else {\r\n // $errors[\"feedbackboundaries[$i]\"] =\r\n // get_string('feedbackerrorboundaryformat', 'quiz', $i + 1);\r\n // }\r\n // } else if (!is_numeric($boundary)) {\r\n // $errors[\"feedbackboundaries[$i]\"] =\r\n // get_string('feedbackerrorboundaryformat', 'quiz', $i + 1);\r\n // }\r\n // }\r\n // if (is_numeric($boundary) && $boundary <= 0 || $boundary >= $data['grade'] ) {\r\n // $errors[\"feedbackboundaries[$i]\"] =\r\n // get_string('feedbackerrorboundaryoutofrange', 'quiz', $i + 1);\r\n // }\r\n // if (is_numeric($boundary) && $i > 0 &&\r\n // $boundary >= $data['feedbackboundaries'][$i - 1]) {\r\n // $errors[\"feedbackboundaries[$i]\"] =\r\n // get_string('feedbackerrororder', 'quiz', $i + 1);\r\n // }\r\n // $data['feedbackboundaries'][$i] = $boundary;\r\n // $i += 1;\r\n // }\r\n // $numboundaries = $i;\r\n\r\n // // Check there is nothing in the remaining unused fields.\r\n // if (!empty($data['feedbackboundaries'])) {\r\n // for ($i = $numboundaries; $i < count($data['feedbackboundaries']); $i += 1) {\r\n // if (!empty($data['feedbackboundaries'][$i] ) &&\r\n // trim($data['feedbackboundaries'][$i] ) != '') {\r\n // $errors[\"feedbackboundaries[$i]\"] =\r\n // get_string('feedbackerrorjunkinboundary', 'quiz', $i + 1);\r\n // }\r\n // }\r\n // }\r\n // for ($i = $numboundaries + 1; $i < count($data['feedbacktext']); $i += 1) {\r\n // if (!empty($data['feedbacktext'][$i]['text']) &&\r\n // trim($data['feedbacktext'][$i]['text'] ) != '') {\r\n // $errors[\"feedbacktext[$i]\"] =\r\n // get_string('feedbackerrorjunkinfeedback', 'quiz', $i + 1);\r\n // }\r\n // }\r\n\r\n // // If CBM is involved, don't show the warning for grade to pass being larger than the maximum grade.\r\n // if (($data['preferredbehaviour'] == 'deferredcbm') OR ($data['preferredbehaviour'] == 'immediatecbm')) {\r\n // unset($errors['gradepass']);\r\n // }\r\n // // Any other rule plugins.\r\n // $errors = quiz_access_manager::validate_settings_form_fields($errors, $data, $files, $this);\r\n\r\n // return $errors;\r\n }", "public function validate($data) {\n\n\t\t$this->validationErrors = [];\n\n\t\t$amount = (float)$data['amount'];\n\t\tif ($amount <= 0) {\n\t\t\t$this->validationErrors['error_amount'] = true;\n\t\t}\n\n\t\t// Personal data should be either all blank or all set:\n\t\tif ($this->wantsReceipt($data)) {\n\t\t\tif (empty($data['data_privacy_statement_accepted'])) {\n\t\t\t\t$this->validationErrors['error_data_privacy_statement_accepted'] = true;\n\t\t\t}\n\t\t\tif ($amount < 50) {\n\t\t\t\t$this->validationErrors['error_donation_too_small_for_receipt'] = true;\n\t\t\t}\n\t\t\tif (empty($data['donation_firstname'])) {\n\t\t\t\t$this->validationErrors['error_donation_firstname'] = true;\n\t\t\t}\n\t\t\tif (empty($data['donation_lastname'])) {\n\t\t\t\t$this->validationErrors['error_donation_lastname'] = true;\n\t\t\t}\n\t\t\tif (empty($data['donation_street_address'])) {\n\t\t\t\t$this->validationErrors['error_donation_street_address'] = true;\n\t\t\t}\n\t\t\tif (!preg_match('/^[0-9]{5}$/', $data['donation_zip'])) {\n\t\t\t\t$this->validationErrors['error_donation_zip'] = true;\n\t\t\t}\n\t\t\tif (empty($data['donation_city'])) {\n\t\t\t\t$this->validationErrors['error_donation_city'] = true;\n\t\t\t}\n\t\t\tif (empty($data['donation_country'])) {\n\t\t\t\t$this->validationErrors['error_donation_country'] = true;\n\t\t\t}\n\t\t}\n\n\t\treturn empty($this->validationErrors);\n\t}", "public function validate($configData);", "public function check_data()\n {\n parent::check_data();\n\n if(empty($this->build_notifications))\n {\n throw new exception('<strong>Data missing: Notifications</strong>');\n }\n\n if(empty($this->build_batch_reference))\n {\n throw new exception('<strong>Data missing: Batch References</strong>');\n }\n }", "private function proccess()\n {\n foreach ($this->validate as $name => $value) {\n $rules = $this->rules[$name];\n \n /* Let's see is this value a required, e.g not empty */\n if (preg_match('~req~', $rules)) {\n if ($this->isEmpty($value)) {\n $this->errors[] = $this->filterName($name) . ' can\\'t be empty, please enter required data.';\n continue; // We will display only one error per input\n }\n }\n \n /**\n * Let's see is this value needs to be integer\n */\n if (preg_match('~int~', $rules)) {\n if (!$this->isInt($value)) {\n $this->errors[] = $this->filterName($name) . ' is not number, please enter number.';\n continue; // We will display only one error per input\n }\n }\n \n /**\n * Let's see is this value needs to be text\n */\n if (preg_match('~text~', $rules)) {\n if (!$this->isText($value)) {\n $this->errors[] = $this->filterName($name) . ' is not text, please enter only letters.';\n continue; // We will display only one error per input\n }\n }\n \n /* This is good input */\n $this->data[$name] = $value;\n }\n }", "public function formValidation($dataSet){\n\t\t\t$error=FALSE; $data=array();\n\t\t\tforeach ($dataSet as $aData) {\n\t\t\t\tif($aData['validationString']=='name'){\n\t\t\t\t\t$data[$aData['dataName']]=$this->getValidatedName(trim($aData['dataValue']));\n\t\t\t\t}\n\t\t\t\tif($aData['validationString']=='number'){\n\t\t\t\t\t$data[$aData['dataName']]=$this->getNumericData(trim($aData['dataValue']));\n\t\t\t\t}\n\t\t\t\tif($aData['validationString']=='integer'){\n\t\t\t\t\t$data[$aData['dataName']]=$this->getIntegerData(trim($aData['dataValue']));\n\t\t\t\t}\n\t\t\t\tif($aData['validationString']=='non empty'){\n\t\t\t\t\t$data[$aData['dataName']]=$this->getNonEmptyData(trim($aData['dataValue']));\n\t\t\t\t}\n\t\t\t\tif($aData['validationString']=='sanitize'){\n\t\t\t\t\t$data[$aData['dataName']]=$this->getSanitizeData(trim($aData['dataValue']));\n\t\t\t\t}\n\t\t\t\tif($aData['validationString']=='gsm phone'){\n\t\t\t\t\t$data[$aData['dataName']]=$this->getValidated080GSMNo(trim($aData['dataValue']));\n\t\t\t\t}\n\t\t\t\tif($aData['validationString']=='email'){\n\t\t\t\t\t$data[$aData['dataName']]=$this->getValidatedEmail(trim($aData['dataValue']));\n\t\t\t\t}\n\t\t\t\tif($aData['validationString']=='password rule'){\n\t\t\t\t\t$data[$aData['dataName']]=$this->enforceRulePassword(trim($aData['dataValue']));\n\t\t\t\t}\n\t\t\t\tif($aData['validationString']=='non empty textarea'){\n\t\t\t\t\t$data[$aData['dataName']]=$this->getNonEmptyTextField(trim($aData['dataValue']));\n\t\t\t\t}\n\t\t\t\tif($aData['validationString']=='in list'){\n\t\t\t\t\t$data[$aData['dataName']]=$this->checkInList($aData['dataValue'],$aData['dataList']);\n\t\t\t\t} \n\t\t\t}\n\t\t\tforeach ($data as $aData) {\n\t\t\t\tif($aData===FALSE) $error=TRUE;\n\t\t\t}\n\t\t\t$validedDataSet=array('error'=>$error, 'data'=>$data);\n\t\t\treturn $validedDataSet;\n\t\t}", "public function sanitiseData(): void\n {\n $this->firstLine = self::sanitiseString($this->firstLine);\n self::validateExistsAndLength($this->firstLine, 1000);\n $this->secondLine = self::sanitiseString($this->secondLine);\n self::validateExistsAndLength($this->secondLine, 1000);\n $this->town = self::sanitiseString($this->town);\n self::validateExistsAndLength($this->town, 255);\n $this->postcode = self::sanitiseString($this->postcode);\n self::validateExistsAndLength($this->postcode, 10);\n $this->county = self::sanitiseString($this->county);\n self::validateExistsAndLength($this->county, 255);\n $this->country = self::sanitiseString($this->country);\n self::validateExistsAndLength($this->country, 255);\n }", "protected function validate()\r\n\t{\r\n\t\tif (!$this->isFetched())\r\n\t\t{\r\n\t\t\treturn;\r\n }\r\n \r\n\t\tif ($this->validationInfo)\r\n\t\t{\r\n\t\t\t$this->validationInfo->validate($this->normalizedValue);\r\n\t\t}\r\n\t\t$this->isValid = true;\r\n\t}", "public function doValidate(){\n if (!is_array($this->getValidates())){\n throw new \\Exception(\"dose this function must call setValidate() function first.\");\n }\n\n foreach($this->getValidates() as $k => $v){\n //$v = (ValidateData)$v;\n if (TextUtils::isEmpty($v->getInput()) && $v->getRequire() == true){\n $v->setResult(false);\n }else{\n $v->setResult(true);\n }\n\n if ($v->getResult() && !TextUtils::isEmpty($v->getInput())){\n switch($v->getValidator()){\n case ValidateData::VALIDATOR_CUSTOM:\n $v->setResult($this->check($v->getInput(),$v->getRegexp()));\n break;\n case ValidateData::VALIDATOR_COMPARE:\n $result = false;\n if (!TextUtils::isEmpty($v->getOperator())){\n switch ($v->getOperator()){\n case ValidateData::OPERATOR_EQUIVALENT:\n $result = $v->getInput() == $v->getTo();\n break;\n case ValidateData::OPERATOR_GREATER:\n $result = $v->getInput() > $v->getTo();\n break;\n case ValidateData::OPERATOR_LESS:\n $result = $v->getInput() < $v->getTo();\n break;\n case ValidateData::OPERATOR_EQUIVALENT_GREATER:\n $result = $v->getInput() >= $v->getTo();\n break;\n case ValidateData::OPERATOR_EQUIVALENT_LESS:\n $result = $v->getInput() <= $v->getTo();\n break;\n case ValidateData::OPERATOR_NOT_EQUIVALENT:\n $result = $v->getInput() != $v->getTo();\n break;\n }\n\n }\n $v->setResult($result);\n break;\n case ValidateData::VALIDATOR_LENGTH:\n $len = mb_strlen($v->getInput(),'UTF-8');\n $v->setResult($len >= $v->getMin());\n if ($v->getMax() > $v->getMin()){\n $v->setResult($len <= $v->getMax() && $len >= $v->getMin());\n }\n\n break;\n\n case ValidateData::VALIDATOR_RANGE:\n $v->setResult((int)$v->getInput() >= $v->getMin());\n if ($v->getMax() > $v->getMin()){\n $v->setResult((int)$v->getInput() <= $v->getMax() && (int)$v->getInput() >= $v->getMin());\n }\n\n break;\n default:\n $v->setResult($this->check($v->getInput(),$this->getValidator($v->getValidator())));\n break;\n }\n }\n }\n return $this->getError();\n }", "public function validate_feedback_data(){\n \n // validate step 1 data.\n \n // rating should be 1-5.\n if( ! in_array($this->post_data->get('rating'), range(1, 5)) ) $this->error_msg[] = 'Rating should be 1 to 5';\n \n // title should not be blank.\n if( trim($this->post_data->get('title')) == '' ) $this->error_msg[] = 'Title should not be blank';\n \n // feedback should not be blank.\n if( trim($this->post_data->get('feedback')) == '' ) $this->error_msg[] = 'Feedback should not be blank';\n \n // recommendation should be 1 or 0.\n if( ! in_array($this->post_data->get('recommend'), range(0, 1)) ) $this->error_msg[] = 'Invalid recommendation option';\n \n \n \n // validate step 2 data.\n \n // first name should not be blank.\n if( trim($this->post_data->get('first_name')) == '' ) $this->error_msg[] = 'First name should not be blank';\n \n // last name should not be blank.\n if( trim($this->post_data->get('last_name')) == '' ) $this->error_msg[] = 'Last name should not be blank';\n \n // email should not be blank.\n if( trim($this->post_data->get('email')) == '' ) $this->error_msg[] = 'Email should not be blank';\n \n // email should be valid.\n if( ! preg_match('/^\\w+([\\.-]?\\w+)*@\\w+([\\.-]?\\w+)*(\\.\\w{2,3})+$/', $this->post_data->get('email')) ) $this->error_msg[] = 'Email should not be valid';\n \n // city should not be blank.\n if( trim($this->post_data->get('city')) == '' ) $this->error_msg[] = 'City should not be blank';\n \n // country should be somewhere from earth.\n $country = DB::table('Country')->where('code', '=', $this->post_data->get('country'))->get();\n if( empty( $country ) ) $this->error_msg[] = 'Invalid country';\n \n // permission shoulbe be 1 or 0.\n if( ! in_array($this->post_data->get('permission'), range(0, 1)) ) $this->error_msg[] = 'Invalid permission option';\n \n \n \n // validate hidden data.\n \n $company = new \\Company\\Repositories\\DBCompany;\n $company = $company->get_company_info( Config::get('application.subdomain') );\n \n // company id should be valid.\n if( $company->companyid != $this->post_data->get('company_id') ) $this->error_msg[] = 'Invalid company id';\n \n // site id should be valid.\n if( $company->siteid != $this->post_data->get('site_id') ) $this->error_msg[] = 'Invalid site id';\n \n \n \n // return true if thre's no error, false otherwise.\n return ( empty($this->error_msg) ? true : false );\n }", "function validate() {\n\t\t\t$this->field['msg'] = ( isset( $this->field['msg'] ) ) ? $this->field['msg'] : esc_html__( 'You must provide a comma separated list of numerical values for this option.', 'redux-framework' );\n\n\t\t\tif ( ! is_numeric( str_replace( ',', '', $this->value ) ) || strpos( $this->value, ',' ) == false ) {\n\t\t\t\t$this->value = ( isset( $this->current ) ) ? $this->current : '';\n\t\t\t\t$this->field['current'] = $this->value;\n\n\t\t\t\t$this->error = $this->field;\n\t\t\t}\n\t\t}", "public function validate(): void\n {\n $this->validatingValue = method_exists($this, 'getValue') ? $this->getValue() : $this->validatingValue;\n\n /**\n * Executes each of the validation closures in reversed order only if the $validatingChain\n * property isn't empty.\n */\n if (!empty($this->validatingChain)) {\n foreach (array_reverse($this->validatingChain) as $function) {\n $function();\n }\n }\n }", "public function isValid($data) {\n //Remove Commas \n $data = str_replace(\",\", \"\", $data);\n \n //Valid that DA Pressure is less than or equal to Steam Pressure and Crit Pressure\n if ($data['SteamPressure']<>'' and $data['SteamPressure']<>$data['daPressure']){\n if ($data['SteamPressure']>$this->mS->critPressure()){\n $this->getElement('daPressure')->addValidator('lessThan', true, array('max'=>$this->mS->critPressure()));\n }else{\n $this->getElement('daPressure')->addValidator('lessThan', true, array('max'=>$data['SteamPressure'], 'messages' => 'Cannot be greater than steam pressure.'));\n }\n }\n \n //Valid that DA Pressure is greater than Min Pressure\n if ($data['daPressure']<>$this->mS->minPressure())\n $this->getElement('daPressure')->addValidator('greaterThan', true, array('min' => $this->mS->minPressure()));\n \n return parent::isValid($data);\n }", "public function rules() {\n return array(\n array('out_summ, in_curr', 'required'),\n array('out_summ', 'numerical', 'min' => 1, 'tooSmall' => Yii::t('payment', 'The summ can not be less than $ 1'), 'message' => Yii::t('payment', 'Summ must be a number')),\n );\n }", "function _prepare_validation()\n\t{\n\t\t$this->load->library('form_validation');\t\n\t\t$this->form_validation->set_error_delimiters('<div class=\"error\">', '</div>');\n\t\t//Setting Validation Rule\t\n\t\t$this->form_validation->set_rules('samity_id','Code','trim|required|xss_clean|max_length[100]');\n\t\t$this->form_validation->set_rules('cbo_samity_day','Samity Day','trim|required|xss_clean');\n\t\t$this->form_validation->set_rules('txt_effective_date','Effective Date','trim|required|max_length[10]|is_date|xss_clean|callback_check_samity_effective_date');\t\n\t}", "public function _getValidationErrors()\n {\n $errs = parent::_getValidationErrors();\n $validationRules = $this->_getValidationRules();\n if (null !== ($v = $this->getAccident())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_ACCIDENT] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getAccidentType())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_ACCIDENT_TYPE] = $fieldErrs;\n }\n }\n if ([] !== ($vs = $this->getAdditionalMaterials())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_ADDITIONAL_MATERIALS, $i)] = $fieldErrs;\n }\n }\n }\n if ([] !== ($vs = $this->getCondition())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_CONDITION, $i)] = $fieldErrs;\n }\n }\n }\n if ([] !== ($vs = $this->getCoverage())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_COVERAGE, $i)] = $fieldErrs;\n }\n }\n }\n if (null !== ($v = $this->getCreated())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_CREATED] = $fieldErrs;\n }\n }\n if ([] !== ($vs = $this->getDiagnosis())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_DIAGNOSIS, $i)] = $fieldErrs;\n }\n }\n }\n if (null !== ($v = $this->getEnterer())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_ENTERER] = $fieldErrs;\n }\n }\n if ([] !== ($vs = $this->getException())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_EXCEPTION, $i)] = $fieldErrs;\n }\n }\n }\n if (null !== ($v = $this->getFacility())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_FACILITY] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getFundsReserve())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_FUNDS_RESERVE] = $fieldErrs;\n }\n }\n if ([] !== ($vs = $this->getIdentifier())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_IDENTIFIER, $i)] = $fieldErrs;\n }\n }\n }\n if ([] !== ($vs = $this->getInterventionException())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_INTERVENTION_EXCEPTION, $i)] = $fieldErrs;\n }\n }\n }\n if ([] !== ($vs = $this->getItem())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_ITEM, $i)] = $fieldErrs;\n }\n }\n }\n if ([] !== ($vs = $this->getMissingTeeth())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_MISSING_TEETH, $i)] = $fieldErrs;\n }\n }\n }\n if (null !== ($v = $this->getOrganization())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_ORGANIZATION] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getOriginalPrescription())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_ORIGINAL_PRESCRIPTION] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getOriginalRuleset())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_ORIGINAL_RULESET] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getPatient())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_PATIENT] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getPayee())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_PAYEE] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getPrescription())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_PRESCRIPTION] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getPriority())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_PRIORITY] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getProvider())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_PROVIDER] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getReferral())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_REFERRAL] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getRuleset())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_RULESET] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getSchool())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_SCHOOL] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getTarget())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_TARGET] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getType())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_TYPE] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getUse())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_USE] = $fieldErrs;\n }\n }\n if (isset($validationRules[self::FIELD_ACCIDENT])) {\n $v = $this->getAccident();\n foreach($validationRules[self::FIELD_ACCIDENT] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_ACCIDENT, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_ACCIDENT])) {\n $errs[self::FIELD_ACCIDENT] = [];\n }\n $errs[self::FIELD_ACCIDENT][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_ACCIDENT_TYPE])) {\n $v = $this->getAccidentType();\n foreach($validationRules[self::FIELD_ACCIDENT_TYPE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_ACCIDENT_TYPE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_ACCIDENT_TYPE])) {\n $errs[self::FIELD_ACCIDENT_TYPE] = [];\n }\n $errs[self::FIELD_ACCIDENT_TYPE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_ADDITIONAL_MATERIALS])) {\n $v = $this->getAdditionalMaterials();\n foreach($validationRules[self::FIELD_ADDITIONAL_MATERIALS] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_ADDITIONAL_MATERIALS, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_ADDITIONAL_MATERIALS])) {\n $errs[self::FIELD_ADDITIONAL_MATERIALS] = [];\n }\n $errs[self::FIELD_ADDITIONAL_MATERIALS][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_CONDITION])) {\n $v = $this->getCondition();\n foreach($validationRules[self::FIELD_CONDITION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_CONDITION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_CONDITION])) {\n $errs[self::FIELD_CONDITION] = [];\n }\n $errs[self::FIELD_CONDITION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_COVERAGE])) {\n $v = $this->getCoverage();\n foreach($validationRules[self::FIELD_COVERAGE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_COVERAGE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_COVERAGE])) {\n $errs[self::FIELD_COVERAGE] = [];\n }\n $errs[self::FIELD_COVERAGE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_CREATED])) {\n $v = $this->getCreated();\n foreach($validationRules[self::FIELD_CREATED] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_CREATED, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_CREATED])) {\n $errs[self::FIELD_CREATED] = [];\n }\n $errs[self::FIELD_CREATED][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_DIAGNOSIS])) {\n $v = $this->getDiagnosis();\n foreach($validationRules[self::FIELD_DIAGNOSIS] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_DIAGNOSIS, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_DIAGNOSIS])) {\n $errs[self::FIELD_DIAGNOSIS] = [];\n }\n $errs[self::FIELD_DIAGNOSIS][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_ENTERER])) {\n $v = $this->getEnterer();\n foreach($validationRules[self::FIELD_ENTERER] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_ENTERER, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_ENTERER])) {\n $errs[self::FIELD_ENTERER] = [];\n }\n $errs[self::FIELD_ENTERER][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_EXCEPTION])) {\n $v = $this->getException();\n foreach($validationRules[self::FIELD_EXCEPTION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_EXCEPTION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_EXCEPTION])) {\n $errs[self::FIELD_EXCEPTION] = [];\n }\n $errs[self::FIELD_EXCEPTION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_FACILITY])) {\n $v = $this->getFacility();\n foreach($validationRules[self::FIELD_FACILITY] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_FACILITY, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_FACILITY])) {\n $errs[self::FIELD_FACILITY] = [];\n }\n $errs[self::FIELD_FACILITY][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_FUNDS_RESERVE])) {\n $v = $this->getFundsReserve();\n foreach($validationRules[self::FIELD_FUNDS_RESERVE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_FUNDS_RESERVE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_FUNDS_RESERVE])) {\n $errs[self::FIELD_FUNDS_RESERVE] = [];\n }\n $errs[self::FIELD_FUNDS_RESERVE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_IDENTIFIER])) {\n $v = $this->getIdentifier();\n foreach($validationRules[self::FIELD_IDENTIFIER] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_IDENTIFIER, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_IDENTIFIER])) {\n $errs[self::FIELD_IDENTIFIER] = [];\n }\n $errs[self::FIELD_IDENTIFIER][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_INTERVENTION_EXCEPTION])) {\n $v = $this->getInterventionException();\n foreach($validationRules[self::FIELD_INTERVENTION_EXCEPTION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_INTERVENTION_EXCEPTION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_INTERVENTION_EXCEPTION])) {\n $errs[self::FIELD_INTERVENTION_EXCEPTION] = [];\n }\n $errs[self::FIELD_INTERVENTION_EXCEPTION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_ITEM])) {\n $v = $this->getItem();\n foreach($validationRules[self::FIELD_ITEM] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_ITEM, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_ITEM])) {\n $errs[self::FIELD_ITEM] = [];\n }\n $errs[self::FIELD_ITEM][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_MISSING_TEETH])) {\n $v = $this->getMissingTeeth();\n foreach($validationRules[self::FIELD_MISSING_TEETH] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_MISSING_TEETH, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_MISSING_TEETH])) {\n $errs[self::FIELD_MISSING_TEETH] = [];\n }\n $errs[self::FIELD_MISSING_TEETH][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_ORGANIZATION])) {\n $v = $this->getOrganization();\n foreach($validationRules[self::FIELD_ORGANIZATION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_ORGANIZATION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_ORGANIZATION])) {\n $errs[self::FIELD_ORGANIZATION] = [];\n }\n $errs[self::FIELD_ORGANIZATION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_ORIGINAL_PRESCRIPTION])) {\n $v = $this->getOriginalPrescription();\n foreach($validationRules[self::FIELD_ORIGINAL_PRESCRIPTION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_ORIGINAL_PRESCRIPTION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_ORIGINAL_PRESCRIPTION])) {\n $errs[self::FIELD_ORIGINAL_PRESCRIPTION] = [];\n }\n $errs[self::FIELD_ORIGINAL_PRESCRIPTION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_ORIGINAL_RULESET])) {\n $v = $this->getOriginalRuleset();\n foreach($validationRules[self::FIELD_ORIGINAL_RULESET] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_ORIGINAL_RULESET, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_ORIGINAL_RULESET])) {\n $errs[self::FIELD_ORIGINAL_RULESET] = [];\n }\n $errs[self::FIELD_ORIGINAL_RULESET][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_PATIENT])) {\n $v = $this->getPatient();\n foreach($validationRules[self::FIELD_PATIENT] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_PATIENT, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_PATIENT])) {\n $errs[self::FIELD_PATIENT] = [];\n }\n $errs[self::FIELD_PATIENT][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_PAYEE])) {\n $v = $this->getPayee();\n foreach($validationRules[self::FIELD_PAYEE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_PAYEE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_PAYEE])) {\n $errs[self::FIELD_PAYEE] = [];\n }\n $errs[self::FIELD_PAYEE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_PRESCRIPTION])) {\n $v = $this->getPrescription();\n foreach($validationRules[self::FIELD_PRESCRIPTION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_PRESCRIPTION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_PRESCRIPTION])) {\n $errs[self::FIELD_PRESCRIPTION] = [];\n }\n $errs[self::FIELD_PRESCRIPTION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_PRIORITY])) {\n $v = $this->getPriority();\n foreach($validationRules[self::FIELD_PRIORITY] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_PRIORITY, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_PRIORITY])) {\n $errs[self::FIELD_PRIORITY] = [];\n }\n $errs[self::FIELD_PRIORITY][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_PROVIDER])) {\n $v = $this->getProvider();\n foreach($validationRules[self::FIELD_PROVIDER] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_PROVIDER, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_PROVIDER])) {\n $errs[self::FIELD_PROVIDER] = [];\n }\n $errs[self::FIELD_PROVIDER][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_REFERRAL])) {\n $v = $this->getReferral();\n foreach($validationRules[self::FIELD_REFERRAL] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_REFERRAL, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_REFERRAL])) {\n $errs[self::FIELD_REFERRAL] = [];\n }\n $errs[self::FIELD_REFERRAL][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_RULESET])) {\n $v = $this->getRuleset();\n foreach($validationRules[self::FIELD_RULESET] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_RULESET, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_RULESET])) {\n $errs[self::FIELD_RULESET] = [];\n }\n $errs[self::FIELD_RULESET][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_SCHOOL])) {\n $v = $this->getSchool();\n foreach($validationRules[self::FIELD_SCHOOL] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_SCHOOL, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_SCHOOL])) {\n $errs[self::FIELD_SCHOOL] = [];\n }\n $errs[self::FIELD_SCHOOL][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_TARGET])) {\n $v = $this->getTarget();\n foreach($validationRules[self::FIELD_TARGET] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_TARGET, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_TARGET])) {\n $errs[self::FIELD_TARGET] = [];\n }\n $errs[self::FIELD_TARGET][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_TYPE])) {\n $v = $this->getType();\n foreach($validationRules[self::FIELD_TYPE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_TYPE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_TYPE])) {\n $errs[self::FIELD_TYPE] = [];\n }\n $errs[self::FIELD_TYPE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_USE])) {\n $v = $this->getUse();\n foreach($validationRules[self::FIELD_USE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_USE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_USE])) {\n $errs[self::FIELD_USE] = [];\n }\n $errs[self::FIELD_USE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_CONTAINED])) {\n $v = $this->getContained();\n foreach($validationRules[self::FIELD_CONTAINED] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE, self::FIELD_CONTAINED, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_CONTAINED])) {\n $errs[self::FIELD_CONTAINED] = [];\n }\n $errs[self::FIELD_CONTAINED][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_EXTENSION])) {\n $v = $this->getExtension();\n foreach($validationRules[self::FIELD_EXTENSION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE, self::FIELD_EXTENSION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_EXTENSION])) {\n $errs[self::FIELD_EXTENSION] = [];\n }\n $errs[self::FIELD_EXTENSION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_MODIFIER_EXTENSION])) {\n $v = $this->getModifierExtension();\n foreach($validationRules[self::FIELD_MODIFIER_EXTENSION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE, self::FIELD_MODIFIER_EXTENSION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_MODIFIER_EXTENSION])) {\n $errs[self::FIELD_MODIFIER_EXTENSION] = [];\n }\n $errs[self::FIELD_MODIFIER_EXTENSION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_TEXT])) {\n $v = $this->getText();\n foreach($validationRules[self::FIELD_TEXT] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE, self::FIELD_TEXT, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_TEXT])) {\n $errs[self::FIELD_TEXT] = [];\n }\n $errs[self::FIELD_TEXT][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_ID])) {\n $v = $this->getId();\n foreach($validationRules[self::FIELD_ID] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_RESOURCE, self::FIELD_ID, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_ID])) {\n $errs[self::FIELD_ID] = [];\n }\n $errs[self::FIELD_ID][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_IMPLICIT_RULES])) {\n $v = $this->getImplicitRules();\n foreach($validationRules[self::FIELD_IMPLICIT_RULES] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_RESOURCE, self::FIELD_IMPLICIT_RULES, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_IMPLICIT_RULES])) {\n $errs[self::FIELD_IMPLICIT_RULES] = [];\n }\n $errs[self::FIELD_IMPLICIT_RULES][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_LANGUAGE])) {\n $v = $this->getLanguage();\n foreach($validationRules[self::FIELD_LANGUAGE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_RESOURCE, self::FIELD_LANGUAGE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_LANGUAGE])) {\n $errs[self::FIELD_LANGUAGE] = [];\n }\n $errs[self::FIELD_LANGUAGE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_META])) {\n $v = $this->getMeta();\n foreach($validationRules[self::FIELD_META] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_RESOURCE, self::FIELD_META, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_META])) {\n $errs[self::FIELD_META] = [];\n }\n $errs[self::FIELD_META][$rule] = $err;\n }\n }\n }\n return $errs;\n }", "public function actionMedicalindividualvalidation() {\n\t\tif (\\Yii::$app->SessionCheck->isclientLogged () == true) \t\t// checking logged session\n\t\t{\n\t\t\t/**\n\t\t\t * Declaring Session Variables**\n\t\t\t */\n\t\t\t$this->layout = 'main';\n\t\t\t$session = \\Yii::$app->session;\n\t\t\t$logged_user_id = $session ['client_user_id'];\n\t\t\t\n\t\t\t$encrypt_component = new EncryptDecryptComponent ();\n\t\t\t$common_validation_component = new CommonValidationsComponent ();\n\t\t\t$validation_rule_ids = array ();\n\t\t\t$element_ids = array ();\n\t\t\t$arrvalidation_errors = array ();\n\t\t\t$arrvalidations = array ();\n\t\t\t$arrperiodvalidation_errors = array ();\n\t\t\t$get_company_id = \\Yii::$app->request->get ();\n\t\t\t\n\t\t\tif (! empty ( $get_company_id )) {\n\t\t\t\t\n\t\t\t\t/**\n\t\t\t\t * Encrypted company ID*\n\t\t\t\t */\n\t\t\t\t$encrypt_company_id = $get_company_id ['c_id'];\n\t\t\t\t$encrypt_medical_id = $get_company_id ['medical_id'];\n\t\t\t\t\n\t\t\t\tif (! empty ( $encrypt_company_id ) && ! empty ( $encrypt_medical_id )) {\n\t\t\t\t\t$company_id = $encrypt_component->decryptUser ( $encrypt_company_id ); // Decrypted company Id\n\t\t\t\t\t$medical_id = $encrypt_component->decryptUser ( $encrypt_medical_id ); // Decrypted payroll Id\n\t\t\t\t\t \n\t\t\t\t\t// / getting company details\n\t\t\t\t\t$company_details = TblAcaCompanies::find ()->select ( 'company_client_number,company_name' )->where ( 'company_id = :company_id', [ \n\t\t\t\t\t\t\t'company_id' => $company_id \n\t\t\t\t\t] )->one ();\n\t\t\t\t\t\n\t\t\t\t\t// / getting payroll details\n\t\t\t\t\t\n\t\t\t\t\t$medical_details = TblAcaMedicalData::find ()->where ( [ \n\t\t\t\t\t\t\t'employee_id' => $medical_id \n\t\t\t\t\t] )->One ();\n\t\t\t\t\t\n\t\t\t\t\tif (! empty ( $medical_details )) {\n\t\t\t\t\t\t\n\t\t\t\t\t\t// check for medical employee period\n\t\t\t\t\t\t\n\t\t\t\t\t\t$enrollment_periods = TblAcaMedicalEnrollmentPeriod::find ()->where ( [ \n\t\t\t\t\t\t\t\t'employee_id' => $medical_id \n\t\t\t\t\t\t] )->All ();\n\t\t\t\t\t\t\n\t\t\t\t\t\t/*for($i = 104; $i <= 139; $i ++) {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$validation_rule_ids [] = $i;\n\t\t\t\t\t\t}*/\n\t\t\t\t\t\t\n\t\t\t\t\t\t$validation_rule_ids = [ \n\t\t\t\t\t\t\t'104',\n\t\t\t\t\t\t\t'105',\n\t\t\t\t\t\t\t'106',\n\t\t\t\t\t\t\t'107',\n\t\t\t\t\t\t\t'108',\n\t\t\t\t\t\t\t'109',\n\t\t\t\t\t\t\t'110',\n\t\t\t\t\t\t\t'111',\n\t\t\t\t\t\t\t'112',\n\t\t\t\t\t\t\t'113',\n\t\t\t\t\t\t\t'114',\n\t\t\t\t\t\t\t'115',\n\t\t\t\t\t\t\t'116',\n\t\t\t\t\t\t\t'117',\n\t\t\t\t\t\t\t'118',\n\t\t\t\t\t\t\t'119',\n\t\t\t\t\t\t\t'120',\n\t\t\t\t\t\t\t'121',\n\t\t\t\t\t\t\t'122',\n\t\t\t\t\t\t\t'123',\n\t\t\t\t\t\t\t'124',\n\t\t\t\t\t\t\t'125',\n\t\t\t\t\t\t\t'126',\n\t\t\t\t\t\t\t'127',\n\t\t\t\t\t\t\t'128',\n\t\t\t\t\t\t\t'129',\n\t\t\t\t\t\t\t'130',\n\t\t\t\t\t\t\t'131',\n\t\t\t\t\t\t\t'132',\n\t\t\t\t\t\t\t'133',\n\t\t\t\t\t\t\t'134',\n\t\t\t\t\t\t\t'135',\n\t\t\t\t\t\t\t'136',\n\t\t\t\t\t\t\t'137',\n\t\t\t\t\t\t\t'138',\n\t\t\t\t\t\t\t'139',\n\t\t\t\t\t\t\t'153',\n\t\t\t\t\t\t\t'154',\n\t\t\t\t\t\t\t'155',\n\t\t\t\t\t\t\t'156'\n\t\t\t\t\t\t];\n\t\t\t\t\t\t\n\t\t\t\t\t\tfor($i = 1; $i <= 15; $i ++) {\n\t\t\t\t\t\t\t$element_ids [] = $i;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * *Check for validation errors***\n\t\t\t\t\t\t */\n\t\t\t\t\t\t$validation_results = TblAcaMedicalValidationLog::find ()->select ( 'validation_rule_id, is_validated' )->where ( [ \n\t\t\t\t\t\t\t\t'company_id' => $company_id,\n\t\t\t\t\t\t\t\t'employee_id' => $medical_id,\n\t\t\t\t\t\t\t\t'validation_rule_id' => $validation_rule_ids,\n\t\t\t\t\t\t\t\t'is_validated' => 0 \n\t\t\t\t\t\t] )->All ();\n\t\t\t\t\t\t\n\t\t\t\t\t\t$validation_period_results = TblAcaMedicalEnrollmentPeriodValidationLog::find ()->select ( 'period_id, validation_rule_id, is_validated' )->where ( [ \n\t\t\t\t\t\t\t\t'company_id' => $company_id,\n\t\t\t\t\t\t\t\t'employee_id' => $medical_id,\n\t\t\t\t\t\t\t\t'validation_rule_id' => $validation_rule_ids,\n\t\t\t\t\t\t\t\t'is_validated' => 0 \n\t\t\t\t\t\t] )->All ();\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (! empty ( $validation_results ) || ! empty ( $validation_period_results )) {\n\t\t\t\t\t\t\tif (! empty ( $validation_results )) {\n\t\t\t\t\t\t\t\tforeach ( $validation_results as $validations ) {\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t$arrvalidations [] = $validations->validation_rule_id;\n\t\t\t\t\t\t\t\t\t$arrvalidation_errors [$validations->validation_rule_id] ['error_message'] = $validations->validationRule->error_message;\n\t\t\t\t\t\t\t\t\t$arrvalidation_errors [$validations->validation_rule_id] ['error_code'] = $validations->validationRule->error_code;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif (! empty ( $validation_period_results )) {\n\t\t\t\t\t\t\t\tforeach ( $validation_period_results as $period_validations ) {\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t$arrperiodvalidation_errors [$period_validations->period_id] [$period_validations->validation_rule_id] ['error_message'] = $period_validations->validationRule->error_message;\n\t\t\t\t\t\t\t\t\t$arrperiodvalidation_errors [$period_validations->period_id] [$period_validations->validation_rule_id] ['error_code'] = $period_validations->validationRule->error_code;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$plan_classes = TblAcaPlanCoverageType::find ()->select ( 'plan_class_id, plan_class_number' )->where ( [ \n\t\t\t\t\t\t\t\t\t'company_id' => $company_id \n\t\t\t\t\t\t\t] )->all ();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t/**\n\t\t\t\t\t\t\t * Get all errors for general info *\n\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\t$get_post_validation_errors = TblAcaValidationRules::find ()->select ( 'rule_id, error_code, error_message' )->where ( [ \n\t\t\t\t\t\t\t\t\t'rule_id' => $validation_rule_ids \n\t\t\t\t\t\t\t] )->All ();\n\t\t\t\t\t\t\n\t\t\t\t\t\t\tif (! empty ( $get_post_validation_errors )) {\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tforeach ( $get_post_validation_errors as $errors ) {\n\t\t\t\t\t\t\t\t\t$post_validation_errors [$errors->rule_id] ['error_message'] = $errors->error_message;\n\t\t\t\t\t\t\t\t\t$post_validation_errors [$errors->rule_id] ['error_code'] = $errors->error_code;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$person_type_Data = ArrayHelper::map ( TblAcaLookupOptions::find ()->where ( [ \n\t\t\t\t\t\t\t\t\t'=',\n\t\t\t\t\t\t\t\t\t'code_id',\n\t\t\t\t\t\t\t\t\t10 \n\t\t\t\t\t\t\t] )->andwhere ( [ \n\t\t\t\t\t\t\t\t\t'<>',\n\t\t\t\t\t\t\t\t\t'lookup_status',\n\t\t\t\t\t\t\t\t\t2 \n\t\t\t\t\t\t\t] )->all (), 'lookup_id', 'lookup_value' );\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$employee_post_details = \\Yii::$app->request->post ();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif (! empty ( $employee_post_details )) {\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t// begin transaction\n\t\t\t\t\t\t\t\t$transaction = \\Yii::$app->db->beginTransaction ();\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t$medical_details->attributes = $employee_post_details ['TblAcaMedicalData'];\n\t\t\t\t\t\t\t\t\t//$medical_details->dob =date('Y-m-d',strtotime($employee_post_details ['TblAcaMedicalData']['dob']));\n\t\t\t\t\t\t\t\t\tif(!empty($employee_post_details ['TblAcaMedicalData']['ssn']))\n\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$medical_details->ssn = preg_replace ( '/[^0-9\\']/', '', $employee_post_details ['TblAcaMedicalData']['ssn'] ); \n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t// checking for duplicate SSN\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t$duplicate_ssn = TblAcaMedicalData::find ()->select ( 'ssn' )->where ('ssn='.$medical_details->ssn )->andWhere ( 'employee_id <> ' . $medical_id )->andWhere ( 'company_id='.$company_id )->All ();\n\t\t\t\t\t\t\t\t\t\tif(!empty($duplicate_ssn)){\n\t\t\t\t\t\t\t\t\t\t\tthrow new \\Exception ( 'SSN already exists' );\n\t\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\n\t\t\t\t\t\t\t\t\t//print_r($medical_details->attributes);die();\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tif ($medical_details->save () && $medical_details->validate ()) {\n\t\t\t\t\t\t\t\t\t\tif (! empty ( $employee_post_details ['TblAcaMedicalEnrollmentPeriod'] )) {\n\t\t\t\t\t\t\t\t\t\t\t$period_details = $employee_post_details ['TblAcaMedicalEnrollmentPeriod'];\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tforeach ( $period_details as $key => $details ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t$coverage_start_date = '';\n\t\t\t\t\t\t\t\t\t\t\t\t$coverage_end_date = '';\n\t\t\t\t\t\t\t\t\t\t\t\t$person_type = '';\n\t\t\t\t\t\t\t\t\t\t\t\t$ssn = '';\n\t\t\t\t\t\t\t\t\t\t\t\t$dob = '';\n\t\t\t\t\t\t\t\t\t\t\t\t$dependent_dob = '';\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\tif (! empty ( $details ['coverage_start_date'] )) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t$coverage_start_date = $details ['coverage_start_date'];\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\tif (! empty ( $details ['coverage_end_date'] )) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t$coverage_end_date = $details ['coverage_end_date'];\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\tif (! empty ( $details ['person_type'] )) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t$person_type = $details ['person_type'];\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\tif (! empty ( $details ['ssn'] )) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t$ssn = preg_replace ( '/[^0-9\\']/', '',$details ['ssn']);\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\tif (! empty ( $details ['dependent_dob'] )) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t$dependent_dob = $details ['dependent_dob'];\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\tif (! empty ( $details ['dob'] )) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t$dob = date('Y-m-d',strtotime($details ['dob']));\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t$encrypted_period_id = $key;\n\t\t\t\t\t\t\t\t\t\t\t\t$decrypted_period_id = $encrypt_component->decryptUser ( $encrypted_period_id );\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t$individual_period_details = TblAcaMedicalEnrollmentPeriod::find ()->where ( [ \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'period_id' => $decrypted_period_id \n\t\t\t\t\t\t\t\t\t\t\t\t] )->One ();\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\tif (! empty ( $individual_period_details )) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t$individual_period_details->coverage_start_date = $coverage_start_date;\n\t\t\t\t\t\t\t\t\t\t\t\t\t$individual_period_details->coverage_end_date = $coverage_end_date;\n\t\t\t\t\t\t\t\t\t\t\t\t\t$individual_period_details->person_type = $person_type;\n\t\t\t\t\t\t\t\t\t\t\t\t\t$individual_period_details->ssn = $ssn;\n\t\t\t\t\t\t\t\t\t\t\t\t\t$individual_period_details->dependent_dob = $dependent_dob;\n\t\t\t\t\t\t\t\t\t\t\t\t\t$individual_period_details->dob = $dob;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\tif ($individual_period_details->save () && $individual_period_details->validate ()) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$period_result ['success'] = 'success';\n\t\t\t\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$arrerrors = $individual_period_details->getFirstErrors ();\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$errorstring = '';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t/**\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t * *****Converting error into string*******\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tforeach ( $arrerrors as $key => $value ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$errorstring .= $value . '<br>';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tthrow new \\Exception ( $errorstring );\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\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\n\t\t\t\t\t\t\t\t\t\t// validate general plan info\n\t\t\t\t\t\t\t\t\t\t$validate_results = $common_validation_component->ValidateMedical ( $company_id, $medical_id, $element_ids );\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\tif (! empty ( $validate_results ['error'] )) {\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tthrow new \\Exception ( $validate_results ['error'] );\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t$validation_success = $validate_results ['success'];\n\t\t\t\t\t\t\t\t\t\t\t$validation_period_success = $validate_results ['period_success'];\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tif (empty ( $validation_success ) && empty ( $validation_period_success )) {\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\tTblAcaMedicalValidationLog::deleteAll ( 'company_id = :company_id AND employee_id = :employee_id', [ \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t':company_id' => $company_id,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t':employee_id' => $medical_id \n\t\t\t\t\t\t\t\t\t\t\t\t] );\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\tTblAcaMedicalEnrollmentPeriodValidationLog::deleteAll ( 'company_id = :company_id AND employee_id = :employee_id', [ \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t':company_id' => $company_id,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t':employee_id' => $medical_id \n\t\t\t\t\t\t\t\t\t\t\t\t] );\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t$model_company_validation_log =TblAcaCompanyValidationStatus::find()->where(['company_id'=>$company_id])->one();\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\tif(!empty($model_company_validation_log))\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t$model_company_validation_log->created_by = $logged_user_id;\n\t\t\t\t\t\t\t\t\t\t\t\t\t$model_company_validation_log->modified_by = $logged_user_id;\n\t\t\t\t\t\t\t\t\t\t\t\t\t$model_company_validation_log->medical_info_date = date('Y-m-d H:i:s');\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t$model_company_validation_log->save();\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t$transaction->commit (); // commit the transaction\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\\Yii::$app->session->setFlash ( 'success', 'Value updated successfully' );\n\t\t\t\t\t\t\t\t\t\t\t\treturn $this->redirect ( array (\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'/client/validateforms/medicalvalidation?c_id=' . $encrypt_company_id \n\t\t\t\t\t\t\t\t\t\t\t\t) );\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t\t$arrvalidation_errors = array ();\n\t\t\t\t\t\t\t\t\t\t\t\t$arrperiodvalidation_errors = array ();\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\tif (! empty ( $validation_success )) {\n\t\t\t\t\t\t\t\t\t\t\t\t\tforeach ( $validation_success as $key => $value ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif ($value == 0) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$arrvalidation_errors [$key] ['error_message'] = $post_validation_errors [$key] ['error_message'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$arrvalidation_errors [$key] ['error_code'] = $post_validation_errors [$key] ['error_code'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\tif (! empty ( $validation_period_success )) {\n\t\t\t\t\t\t\t\t\t\t\t\t\tforeach ( $validation_period_success as $key => $validations ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tforeach ( $validations as $validation_rule_id => $is_validated ) {\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\t\t\t\t\t\t\tif ($is_validated == 0) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$arrperiodvalidation_errors [$key] [$validation_rule_id] ['error_message'] = $post_validation_errors [$validation_rule_id] ['error_message'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$arrperiodvalidation_errors [$key] [$validation_rule_id] ['error_code'] = $post_validation_errors [$validation_rule_id] ['error_code'];\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\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t// check for payroll employee period\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t$enrollment_periods = TblAcaMedicalEnrollmentPeriod::find ()->where ( [ \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'employee_id' => $medical_id \n\t\t\t\t\t\t\t\t\t\t\t\t] )->All ();\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t$transaction->rollBack ();\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t$arrerrors = $medical_details->getFirstErrors ();\n\t\t\t\t\t\t\t\t\t\t$errorstring = '';\n\t\t\t\t\t\t\t\t\t\t/**\n\t\t\t\t\t\t\t\t\t\t * *****Converting error into string*******\n\t\t\t\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\t\t\t\tforeach ( $arrerrors as $key => $value ) {\n\t\t\t\t\t\t\t\t\t\t\t$errorstring .= $value . '<br>';\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\tthrow new \\Exception ( $errorstring );\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} catch ( \\Exception $e ) {\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t$msg = $e->getMessage ();\n\t\t\t\t\t\t\t\t\t\\Yii::$app->session->setFlash ( 'error', $msg );\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t// rollback transaction\n\t\t\t\t\t\t\t\t\t$transaction->rollback ();\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\treturn $this->redirect ( array (\n\t\t\t\t\t\t\t\t\t\t\t'/client/validateforms/medicalindividualvalidation?c_id=' . $encrypt_company_id . '&medical_id=' . $encrypt_medical_id \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\t\n\t\t\t\t\t\t\treturn $this->render ( 'medicalindividualvalidation', array (\n\t\t\t\t\t\t\t\t\t'company_detals' => $company_details,\n\t\t\t\t\t\t\t\t\t'medical_details' => $medical_details,\n\t\t\t\t\t\t\t\t\t'encrypt_company_id' => $encrypt_company_id,\n\t\t\t\t\t\t\t\t\t'arrvalidations' => $arrvalidations,\n\t\t\t\t\t\t\t\t\t'arrvalidation_errors' => $arrvalidation_errors,\n\t\t\t\t\t\t\t\t\t'enrollment_periods' => $enrollment_periods,\n\t\t\t\t\t\t\t\t\t'arrperiodvalidation_errors' => $arrperiodvalidation_errors,\n\t\t\t\t\t\t\t\t\t'plan_classes' => $plan_classes,\n\t\t\t\t\t\t\t\t\t'encoded_company_id' => $encrypt_company_id,\n\t\t\t\t\t\t\t\t\t'encrypt_medical_id' => $encrypt_medical_id,\n\t\t\t\t\t\t\t\t\t'person_type_Data' => $person_type_Data \n\t\t\t\t\t\t\t) );\n\t\t\t\t\t\t}else\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\\Yii::$app->session->setFlash ( 'success', 'No issues in the employee.' );\n\t\t\t\t\t\t\treturn $this->redirect ( array (\n\t\t\t\t\t\t\t'/client/validateforms/medicalvalidation?c_id='.$encrypt_company_id \n\t\t\t\t\t\t\t\t) );\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\treturn $this->redirect ( array (\n\t\t\t\t\t\t\t'/client/companies' \n\t\t\t\t\t) );\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t\\Yii::$app->SessionCheck->clientlogout (); // client logout\n\t\t\t\n\t\t\treturn $this->goHome ();\n\t\t}\n\t}", "private function validate(){\n\t\t$row = $this->row;\n\t\t$col = $this->col;\n\t\tfor($i=0;$i<$row;$i++)\n\t\t\tfor($j=0;$j<$col;$j++)\n\t\t\t$this->sanitzeRow($i,$j);\n\n\t\tfor($i=0;$i<$row;$i++)\n\t\t\tfor($j=0;$j<$col;$j++)\n\t\t\t$this->sanitzeCol($i,$j);\n\n\t}", "public function validateData(){\n return true;\n }", "private function validate() {\n $this->valid = (1 === count($this->marriages));\n }", "private function validateData()\n {\n if (empty($this->nome)) {\n $this->errors->addMessage(\"O nome é obrigatório\");\n }\n\n if (!filter_var($this->email, FILTER_VALIDATE_EMAIL)) {\n $this->errors->addMessage(\"O e-mail é inválido\");\n }\n\n if (strlen($this->senha) < 6) {\n $this->errors->addMessage(\"A senha deve ter no minímo 6 caracteres!\");\n }\n if ($this->emailExiste($this->email, 'email')) {\n $this->errors->addMessage(\"Esse e-mail já está cadastrado\");\n }\n if ($this->emailExiste($this->usuario, 'usuario')) {\n $this->errors->addMessage(\"Esse usuário já está cadastrado\");\n }\n\n return $this->errors->hasError();\n }", "private function validateInputParameters($data)\n {\n }", "public function beforeValidate() {\n $requiredValidator = new CRequiredValidator();\n $emailValidator = new CEmailValidator();\n\n //SFERA-2781\n if(ClientDetectorComponent::getInstance()->isTechnicolor() || ClientDetectorComponent::getInstance()->isUmg()){\n\n //if not empty => should be validate\n if($this->email){\n $emailValidator->attributes[] = 'email';\n }\n\n if ($this->isMoneyBookers()) {\n // Set email variable\n $this->email = $this->mbEmail;\n if($this->email){\n $emailValidator->attributes[] = 'mbEmail';\n }\n } elseif($this->isPayPal()) {\n // Set email variable\n $this->email = $this->ppEmail;\n if($this->email){\n $emailValidator->attributes[] = 'ppEmail';\n }\n } elseif($this->isWiretransfer()) {\n // Set required attributes\n // $requiredValidator->attributes[] = 'bank_name';\n // $requiredValidator->attributes[] = 'bank_address';\n // $requiredValidator->attributes[] = 'bank_swift_code';\n // $requiredValidator->attributes[] = 'bank_account_number'; \n }\n\n } else {\n\n //not Technicolor => require and validate email\n if ($this->isMoneyBookers()) {\n $requiredValidator->attributes[] = 'email';\n $emailValidator->attributes[] = 'email';\n\n // Set email variable\n $this->email = $this->mbEmail;\n // Set required attributes\n $requiredValidator->attributes[] = 'mbEmail';\n $requiredValidator->attributes[] = 'money_bookers_id';\n // Set email required attributes\n $emailValidator->attributes[] = 'mbEmail';\n } elseif($this->isPayPal()) {\n $requiredValidator->attributes[] = 'email';\n $emailValidator->attributes[] = 'email';\n\n // Set email variable\n $this->email = $this->ppEmail;\n // Set required attributes\n $requiredValidator->attributes[] = 'ppEmail';\n // Set email required attributes\n $emailValidator->attributes[] = 'ppEmail';\n } elseif($this->isWiretransfer()) {\n // Set required attributes\n // $requiredValidator->attributes[] = 'bank_name';\n // $requiredValidator->attributes[] = 'bank_address';\n // $requiredValidator->attributes[] = 'bank_swift_code';\n // $requiredValidator->attributes[] = 'bank_account_number';\n } elseif($this->isNoPayment()) {\n \n }\n }\n\n // Add validators to existing list\n if(!empty($requiredValidator->attributes)){\n $this->validatorList->add($requiredValidator);\n }\n\n if(!empty($emailValidator->attributes)){\n $this->validatorList->add($emailValidator);\n }\n\n return parent::beforeValidate();\n }", "public function beforeSave()\n {\n $value = $this->getValue();\n try {\n $this->validate($value);\n } catch (\\Magento\\Framework\\Exception\\LocalizedException $e) {\n $msg = __('%1', $e->getMessage());\n $error = new \\Magento\\Framework\\Exception\\LocalizedException($msg, $e);\n throw $error;\n }\n }", "protected function validate_data_fields(){\n\t\tif(empty($this->RESPONSE)){throw new Exception(\"Response field not found\", 5);}\n\t\t\n\t\t// The remote IP address is also required\n\t\tif($this->validate_ip($this->REMOTE_ADDRESS)){throw new Exception(\"Renote IP address not set correctly\", 6);}\n\t}", "private function _validData($data){\n\t\t$columnsLen = array(\n\t\t\t\t\t\t\t'nro_pedido' => 6,\n\t\t\t\t\t\t\t'id_factura_pagos' => 1,\n\t\t\t\t\t\t\t'valor' => 1,\n\t\t\t\t\t\t\t'concepto' => 1,\n\t\t\t\t\t\t\t'fecha_inicio' => 0,\n\t\t\t\t\t\t\t'fecha_fin' => 0,\n\t\t\t\t\t\t\t'id_user' => 1\n\t\t);\n\t\treturn $this->_checkColumnsData($columnsLen, $data);\n\t}", "public function isValid()\n\t{\n\t\tif (empty($this->titre)) $this->titre = \"TITRE A REMPLACER\";\n\t\telse $this->titre = trim (preg_replace('/\\s+/', ' ', $this->titre) ); // Suppression des espaces\n\t\tif (!empty($this->contenu)) $this->contenu = trim (preg_replace('/\\s+/', ' ', $this->contenu) ); // Suppression des espaces\n\t\tif (empty($this->statut)) $this->statut = 0;\n\t\tif (empty($this->id_type)) $this->id_type = 1;\n\t\tif (empty($this->id_membre)) $this->id_membre = 0;\n\t}", "public function validate() {\n if (!empty($this->value)) {\n parent::validate();\n }\n }", "public function validateData(){\n\t\tif (!self::isEmailValid($this->email))\n\t\t\tthrow new Exception(\"Email address {$this->email} is not a valid email address.\");\n\n\t\tparent::validateData();\n\t}", "public function DataIsValid()\n {\n $bDataIsValid = parent::DataIsValid();\n if ($this->HasContent() && $bDataIsValid) {\n if (intval($this->data) < 12 && intval($this->data) >= -11) {\n $bDataIsValid = true;\n } else {\n $bDataIsValid = false;\n $oMessageManager = TCMSMessageManager::GetInstance();\n $sConsumerName = TCMSTableEditorManager::MESSAGE_MANAGER_CONSUMER;\n $sFieldTitle = $this->oDefinition->GetName();\n $oMessageManager->AddMessage($sConsumerName, 'TABLEEDITOR_FIELD_TIMEZONE_NOT_VALID', array('sFieldName' => $this->name, 'sFieldTitle' => $sFieldTitle));\n }\n }\n\n return $bDataIsValid;\n }", "private function PREPARE_VALIDATION_RESULTS()\r\r {\r\r $this->PREPARE_OBJECT_VARIABLE_METHOD(); \r\r $this->READ_FIELDS();\r\r \r\r foreach($this->_ready_fields as $key => $fields)\r\r {\r\r # SET THE ALIAS FOR EACH FIELD\r\r $this->_object[$key]['ALIAS'] = (isset($fields['ALIAS'])) ? $fields['ALIAS'] : $key; \r\r \r\r # IF VALUE IS NOT NULL\r\r if(isset($fields['REQUIRED']) && $this->_object[$key]['VALUE']===''){\r\r $this->_results[$key]['REQUIRED'] = (strlen($fields['REQUIRED']) > 1 ) ? $fields['REQUIRED'] : $this->_object[$key]['ALIAS'].' '.$this->_error['REQUIRED'];\r\r }\r\r \r\r # IF VALUE IS NOT NUMERIC\r\r if( isset($fields['NUMERIC']) && !is_numeric($this->_object[$key]['VALUE']) ){\r\r $this->_results[$key]['NUMERIC'] = (strlen($fields['NUMERIC'])>1 ? $fields['NUMERIC'] :$this->_object[$key]['ALIAS'].' '.$this->_error['NUMERIC']);\r\r }\r\r \r\r # IF VALUE IS A VALID EMAIL\r\r if(isset($fields['EMAIL']) && !$this->checkEmail($this->_object[$key]['VALUE'])){\r\r $this->_results[$key]['EMAIL'] = (strlen($fields['EMAIL'])>1 ? $fields['EMAIL'] :$this->_object[$key]['ALIAS'].' '.$this->_error['EMAIL']);\r\r }\r\r \r\r # IF VALUE HAS A SPECIFIC LENGTH\r\r if(isset($fields['LENGTH'])){\r\r \r\r if(array_key_exists('EQUAL', $fields['LENGTH']) && !(($fields['LENGTH']['EQUAL']) == strlen($this->_object[$key]['VALUE'])))\r\r {\r\r $this->_results[$key]['LENGTH'] =isset($fields['LENGTH']['ERROR'])? $fields['LENGTH']['ERROR']:$this->_object[$key]['ALIAS'].' '.$this->_error['LENGTH']['EQUAL'].' '.$fields['LENGTH']['EQUAL'].' characters';\r\r }\r\r # GREATER THAN \r\r else if(array_key_exists('GREAT', $fields['LENGTH']) && !(strlen($this->_object[$key]['VALUE']) > ($fields['LENGTH']['GREAT'])))\r\r {\r\r $this->_results[$key]['LENGTH'] =isset($fields['LENGTH']['ERROR'])? $fields['LENGTH']['ERROR'] :$this->_object[$key]['ALIAS'].' '.$this->_error['LENGTH']['GREAT'].' '.$fields['LENGTH']['GREAT'].' characters';\r\r }\r\r # GREATER THAN EQUAL TO \r\r else if(array_key_exists('GREAT_E', $fields['LENGTH']) && !(strlen($this->_object[$key]['VALUE'])>=($fields['LENGTH']['GREAT_E'])))\r\r {\r\r $this->_results[$key]['LENGTH'] =isset($fields['LENGTH']['ERROR'])? $fields['LENGTH']['ERROR'] :$this->_object[$key]['ALIAS'].' '.$this->_error['LENGTH']['GREAT_E'].' '.$fields['LENGTH']['GREAT_E'].' characters';\r\r }\r\r # LESS THAN \r\r else if(array_key_exists('LESS', $fields['LENGTH']) && !(strlen($this->_object[$key]['VALUE'])<($fields['LENGTH']['LESS'])))\r\r {\r\r $this->_results[$key]['LENGTH'] =isset($fields['LENGTH']['ERROR'])? $fields['LENGTH']['ERROR'] :$this->_object[$key]['ALIAS'].' '.$this->_error['LENGTH']['LESS'].' '.$fields['LENGTH']['LESS'].' characters';\r\r }\r\r # LESS THAN EQUAL TO \r\r else if(array_key_exists('LESS_E', $fields['LENGTH']) && !(strlen($this->_object[$key]['VALUE'])<=($fields['LENGTH']['LESS_E'])))\r\r {\r\r $this->_results[$key]['LENGTH'] =isset($fields['LENGTH']['ERROR'])? $fields['LENGTH']['ERROR'] :$this->_object[$key]['ALIAS'].' '.$this->_error['LENGTH']['LESS_E'].' '.$fields['LENGTH']['LESS_E'].' characters';\r\r }\r\r }\r\r \r\r # IF A FIELD IS EQUAL TO ANOTHER FIELD \r\r if(isset($fields['COMPARE'])){\r\r \r\r if(is_array($fields['COMPARE']))\r\r {\r\r if($this->_object[$key]['VALUE']!==$this->_object[$fields['COMPARE']['WITH']]['VALUE']){ \r\r $this->_results[$key]['COMPARE'] = isset($fields['COMPARE']['ERROR']) ? $fields['COMPARE']['ERROR'] : $this->_object[$key]['ALIAS'] .' and '. $this->_ready_fields[$fields['COMPARE']['WITH']]['ALIAS'].' '. $this->_error['COMPARE'];\r\r }\r\r } \r\r else\r\r {\r\r if($this->_object[$key]['VALUE']!==$this->_object[$fields['COMPARE']]['VALUE']){\r\r $this->_results[$key]['COMPARE'] = $this->_object[$key]['ALIAS'] .' and '. $this->_ready_fields[$fields['COMPARE']]['ALIAS'].' '. $this->_error['COMPARE'];\r\r }\r\r }\r\r }\r\r \r\r } \r\r }", "protected function postValidation()\n {\n $errors = array();\n\n // \"Length of reference\" field.\n if (!($length = Tools::getValue('ORDERREF_LENGTH'))) {\n $errors[] = $this->l('The \"Length of reference\" field is required.');\n }\n elseif (!Validate::isInt($length)) {\n $errors[] = $this->l('The \"Length of reference\" field must be an integer number.');\n }\n elseif (!($length >= self::ORDERREF_LENGTH_MIN && $length <= self::ORDERREF_LENGTH_MAX)) {\n $errors[] = $this->l('The \"Length of reference\" field limits exceed. Value must be between')\n . ' ' . self::ORDERREF_LENGTH_MIN . ' '\n . $this->l('and')\n . ' ' . self::ORDERREF_LENGTH_MAX;\n }\n \n // \"How to generate\" field.\n if (!($mode = Tools::getValue('ORDERREF_MODE'))) {\n $errors[] = $this->l('The \"How to generate order references\" field is required.');\n }\n elseif (!(Validate::isInt($mode) &&\n ($mode == self::ORDERREF_MODE_RANDOM\n || $mode == self::ORDERREF_MODE_CONSEQUENT\n || $mode == self::ORDERREF_MODE_PS))) {\n $errors[] = $this->l('The \"How to generate order references\" field has illegal value.');\n }\n\n return $errors;\n }", "protected function prepareForValidation()\n {\n $input = array_filter(\n $this->all(['voucher-start', 'voucher-end', 'centre', 'date-sent']),\n 'strlen'\n );\n\n foreach ($input as $key => $value) {\n if (in_array($key, ['voucher-start', 'voucher-end'])) {\n $clean = Voucher::cleanCodes((array)$value);\n $input[$key] = strtoupper((array_shift($clean)));\n }\n }\n // replace old input with new input\n $this->replace($input);\n }", "protected function _validate() {\n\t}", "protected function fine_validation()\n {\n if (is_superadmin_loggedin()) {\n $this->form_validation->set_rules('branch_id', translate('branch'), 'required');\n }\n $this->form_validation->set_rules('group_id', translate('group_name'), 'trim|required');\n $this->form_validation->set_rules('fine_type_id', translate('fees_type'), 'trim|required|callback_check_feetype');\n $this->form_validation->set_rules('fine_type', translate('fine_type'), 'trim|required');\n $this->form_validation->set_rules('fine_value', translate('fine') . \" \" . translate('value'), 'trim|required|numeric|greater_than[0]');\n $this->form_validation->set_rules('fee_frequency', translate('late_fee_frequency'), 'trim|required');\n }", "public function validate()\n {\n $info = $this->getInfoInstance();\n\n $quote = $info->getQuote();\n\n $maxInstallmentsNumber = Mage::getStoreConfig('payment/vindi_creditcard/max_installments_number');\n\n if ($this->isSingleOrder($quote) && ($maxInstallmentsNumber > 1)) {\n if (! $installments = $info->getAdditionalInformation('installments')) {\n return $this->error('Você deve informar o número de parcelas.');\n }\n\n if ($installments > $maxInstallmentsNumber) {\n return $this->error('O número de parcelas selecionado é inválido.');\n }\n\n $minInstallmentsValue = Mage::getStoreConfig('payment/vindi_creditcard/min_installment_value');\n $installmentValue = ceil($quote->getGrandTotal() / $installments * 100) / 100;\n\n if (($installmentValue < $minInstallmentsValue) && ($installments > 1)) {\n return $this->error('O número de parcelas selecionado é inválido.');\n }\n }\n\n if ($info->getAdditionalInformation('use_saved_cc')) {\n return $this;\n }\n\n $availableTypes = $this->api()->getCreditCardTypes();\n\n $ccNumber = $info->getCcNumber();\n\n // remove credit card non-numbers\n $ccNumber = preg_replace('/\\D/', '', $ccNumber);\n\n $info->setCcNumber($ccNumber);\n\n if (! $this->_validateExpDate($info->getCcExpYear(), $info->getCcExpMonth())) {\n return $this->error(Mage::helper('payment')->__('Incorrect credit card expiration date.'));\n }\n\n if (! array_key_exists($info->getCcType(), $availableTypes)) {\n return $this->error(Mage::helper('payment')->__('Credit card type is not allowed for this payment method.'));\n }\n\n return $this;\n }", "protected function validate()\n {\n if ($this->name == '') {\n $this->errors[] = 'Name is required';\n }\n\n if ($this->name == '') {\n $this->errors[] = 'Name is required';\n }\n if ($this->sex == '') {\n $this->errors[] = 'Sex selection is required';\n }\n\n if ($this->description == '') {\n $this->errors[] = 'Description is required';\n }\n\n if ($this->surrender_date == '') {\n $this->errors[] = 'Surrender Date is required';\n }\n\n if ($this->surrender_reason == '') {\n $this->errors[] = 'Surrender Reason is required';\n }\n\n return empty($this->errors);\n }", "abstract public function validateData($data);", "public final function verifyData($key){\n\n unset($this->errors[$key]);\n\n if(!array_key_exists($key,$this->data)){\n\n if(!array_key_exists($key,$this->definition)){\n throw new \\Disco\\exceptions\\Exception(\"Field `{$key}` is not defined by this data model\");\n }//if\n\n //DEFAULT\n if(array_key_exists('default',$this->definition[$key])){\n $this->data[$key] = $this->definition[$key]['default'];\n }//if\n //REQUIRED\n else if($this->getDefinitionValue($key,'required')){\n return $this->setError($key,\"`{$key}` is required\");\n }//elif\n else {\n return false;\n }//el\n\n }//if\n\n //PREMASSAGE\n if(($massage = $this->getDefinitionValue($key,'premassage')) !== false){\n $this->data[$key] = $this->{$massage}($this->data[$key]);\n }//if\n\n $value = $this->data[$key];\n\n //REGEXP\n if(($regexp = $this->getDefinitionValue($key,'regexp')) !== false){\n if(($default = \\App::getCondition($regexp)) !== false && !\\App::matchCondition($default,$value)){\n return $this->setError($key);\n }//if\n if(!preg_match(\"/{$regexp}/\",$value)){\n return $this->setError($key);\n }//if\n $this->_postMassage($key,$value);\n return true;\n }//if\n\n //METHOD\n if(($method = $this->getDefinitionValue($key,'method')) !== false){\n if(!$this->{$method}($value)){\n return $this->setError($key);\n }//if\n $this->_postMassage($key,$value);\n return true;\n }//if\n\n //NULLABLE\n if($this->getDefinitionValue($key,'nullable') && $value === null){\n $this->_postMassage($key,$value);\n return true;\n }//if\n\n $type = $this->getDefinitionValue($key,'type');\n\n //TRUTHY\n if($type != 'boolean' && $this->getDefinitionValue($key,'truthy') && is_bool($value)){\n $this->_postMassage($key,$value);\n return true;\n }//if\n\n switch($type){\n\n case 'int':\n\n if(!$this->_isValidInt($key,$value)){\n return false;\n }//if\n\n break;\n\n case 'uint':\n\n if(!$this->_isValidInt($key,$value)){\n return false;\n }//if\n\n if($value < 0){\n return $this->setError($key,\"`{$key}` must be a positive integer\");\n }//if\n\n break;\n\n case 'float':\n\n if(!$this->_isValidFloat($key,$value)){\n return false;\n }//if\n\n break;\n\n case 'ufloat':\n\n if(!$this->_isValidFloat($key,$value)){\n return false;\n }//if\n\n if($value < 0){\n return $this->setError($key,\"`{$key}` must be a positive number\");\n }//if\n\n break;\n\n case 'string':\n\n if(!is_string($value)){\n return $this->setError($key,\"`{$key}` must be a string\");\n }//if\n\n if(($min = $this->getDefinitionValue($key,'minlen')) !== false && strlen($value) < $min){\n return $this->setError($key,\"`{$key}` must be greater than {$min} characters long\");\n }//if\n\n if(($max = $this->getDefinitionValue($key,'maxlen')) !== false && strlen($value) > $max){\n return $this->setError($key,\"`{$key}` must be less than {$max} characters long\");\n }//if\n\n break;\n\n case 'char':\n\n if(!is_string($value) || strlen($value) != 1){\n return $this->setError($key,\"`{$key}` must be a single character\");\n }//if\n\n break;\n\n case 'boolean': \n\n if(!is_bool($value)){\n return $this->setError($key,\"`{$key}` must be a boolean value\");\n }//if\n\n break;\n\n case 'array':\n\n if(!is_array($value)){\n return $this->setError($key,\"`{$key}` must be an array\");\n }//if\n\n break;\n\n case 'object':\n\n if(is_object($value)){\n if(($instanceof = $this->getDefinitionValue($key,'instanceof')) !== false && !$value instanceof $instanceof){\n return $this->setError($key,\"`{$key}` must be an instance of `{$instanceof}`\");\n }//if\n } //if\n else {\n return $this->setError($key,\"`{$key}` must be an object\");\n }//if\n\n break;\n\n case 'closure':\n\n if(!is_object($value) || !$value instanceof \\Closure){\n return $this->setError($key,\"`{$key}` must be a closure\");\n }//if \n\n break;\n\n default:\n return $this->setError($key);\n\n }//switch\n\n //IN\n if(($in = $this->getDefinitionValue($key,'in')) !== false && !in_array($value,$in)){\n $in = implode(', ',$in);\n return $this->setError($key,\"`{$key}` must be a value of `{$in}`\");\n }//if\n\n //NOTIN\n if(($in = $this->getDefinitionValue($key,'notin')) !== false && in_array($value,$in)){\n $in = implode(', ',$in);\n return $this->setError($key,\"`{$key}` must not be a value of `{$in}`\");\n }//if\n\n $this->_postMassage($key,$value);\n\n }", "function form_val_setrules(){\n $this->form_validation->set_error_delimiters('<p style=\"color:rgb(255, 115, 115);\" class=\"help-block\"><i class=\"glyphicon glyphicon-exclamation-sign\"></i> ','</p>');\n\n $this->form_validation->set_rules('return_date','Return Date','required');\n $this->form_validation->set_rules('reference','Reference','required'); \n }", "public function _getValidationErrors()\n {\n $errs = parent::_getValidationErrors();\n $validationRules = $this->_getValidationRules();\n if ([] !== ($vs = $this->getCountry())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_COUNTRY, $i)] = $fieldErrs;\n }\n }\n }\n if (null !== ($v = $this->getDataExclusivityPeriod())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_DATA_EXCLUSIVITY_PERIOD] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getDateOfFirstAuthorization())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_DATE_OF_FIRST_AUTHORIZATION] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getHolder())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_HOLDER] = $fieldErrs;\n }\n }\n if ([] !== ($vs = $this->getIdentifier())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_IDENTIFIER, $i)] = $fieldErrs;\n }\n }\n }\n if (null !== ($v = $this->getInternationalBirthDate())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_INTERNATIONAL_BIRTH_DATE] = $fieldErrs;\n }\n }\n if ([] !== ($vs = $this->getJurisdiction())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_JURISDICTION, $i)] = $fieldErrs;\n }\n }\n }\n if ([] !== ($vs = $this->getJurisdictionalAuthorization())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_JURISDICTIONAL_AUTHORIZATION, $i)] = $fieldErrs;\n }\n }\n }\n if (null !== ($v = $this->getLegalBasis())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_LEGAL_BASIS] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getProcedure())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_PROCEDURE] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getRegulator())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_REGULATOR] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getRestoreDate())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_RESTORE_DATE] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getStatus())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_STATUS] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getStatusDate())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_STATUS_DATE] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getSubject())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_SUBJECT] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getValidityPeriod())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_VALIDITY_PERIOD] = $fieldErrs;\n }\n }\n if (isset($validationRules[self::FIELD_COUNTRY])) {\n $v = $this->getCountry();\n foreach($validationRules[self::FIELD_COUNTRY] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_COUNTRY, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_COUNTRY])) {\n $errs[self::FIELD_COUNTRY] = [];\n }\n $errs[self::FIELD_COUNTRY][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_DATA_EXCLUSIVITY_PERIOD])) {\n $v = $this->getDataExclusivityPeriod();\n foreach($validationRules[self::FIELD_DATA_EXCLUSIVITY_PERIOD] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_DATA_EXCLUSIVITY_PERIOD, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_DATA_EXCLUSIVITY_PERIOD])) {\n $errs[self::FIELD_DATA_EXCLUSIVITY_PERIOD] = [];\n }\n $errs[self::FIELD_DATA_EXCLUSIVITY_PERIOD][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_DATE_OF_FIRST_AUTHORIZATION])) {\n $v = $this->getDateOfFirstAuthorization();\n foreach($validationRules[self::FIELD_DATE_OF_FIRST_AUTHORIZATION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_DATE_OF_FIRST_AUTHORIZATION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_DATE_OF_FIRST_AUTHORIZATION])) {\n $errs[self::FIELD_DATE_OF_FIRST_AUTHORIZATION] = [];\n }\n $errs[self::FIELD_DATE_OF_FIRST_AUTHORIZATION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_HOLDER])) {\n $v = $this->getHolder();\n foreach($validationRules[self::FIELD_HOLDER] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_HOLDER, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_HOLDER])) {\n $errs[self::FIELD_HOLDER] = [];\n }\n $errs[self::FIELD_HOLDER][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_IDENTIFIER])) {\n $v = $this->getIdentifier();\n foreach($validationRules[self::FIELD_IDENTIFIER] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_IDENTIFIER, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_IDENTIFIER])) {\n $errs[self::FIELD_IDENTIFIER] = [];\n }\n $errs[self::FIELD_IDENTIFIER][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_INTERNATIONAL_BIRTH_DATE])) {\n $v = $this->getInternationalBirthDate();\n foreach($validationRules[self::FIELD_INTERNATIONAL_BIRTH_DATE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_INTERNATIONAL_BIRTH_DATE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_INTERNATIONAL_BIRTH_DATE])) {\n $errs[self::FIELD_INTERNATIONAL_BIRTH_DATE] = [];\n }\n $errs[self::FIELD_INTERNATIONAL_BIRTH_DATE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_JURISDICTION])) {\n $v = $this->getJurisdiction();\n foreach($validationRules[self::FIELD_JURISDICTION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_JURISDICTION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_JURISDICTION])) {\n $errs[self::FIELD_JURISDICTION] = [];\n }\n $errs[self::FIELD_JURISDICTION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_JURISDICTIONAL_AUTHORIZATION])) {\n $v = $this->getJurisdictionalAuthorization();\n foreach($validationRules[self::FIELD_JURISDICTIONAL_AUTHORIZATION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_JURISDICTIONAL_AUTHORIZATION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_JURISDICTIONAL_AUTHORIZATION])) {\n $errs[self::FIELD_JURISDICTIONAL_AUTHORIZATION] = [];\n }\n $errs[self::FIELD_JURISDICTIONAL_AUTHORIZATION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_LEGAL_BASIS])) {\n $v = $this->getLegalBasis();\n foreach($validationRules[self::FIELD_LEGAL_BASIS] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_LEGAL_BASIS, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_LEGAL_BASIS])) {\n $errs[self::FIELD_LEGAL_BASIS] = [];\n }\n $errs[self::FIELD_LEGAL_BASIS][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_PROCEDURE])) {\n $v = $this->getProcedure();\n foreach($validationRules[self::FIELD_PROCEDURE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_PROCEDURE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_PROCEDURE])) {\n $errs[self::FIELD_PROCEDURE] = [];\n }\n $errs[self::FIELD_PROCEDURE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_REGULATOR])) {\n $v = $this->getRegulator();\n foreach($validationRules[self::FIELD_REGULATOR] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_REGULATOR, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_REGULATOR])) {\n $errs[self::FIELD_REGULATOR] = [];\n }\n $errs[self::FIELD_REGULATOR][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_RESTORE_DATE])) {\n $v = $this->getRestoreDate();\n foreach($validationRules[self::FIELD_RESTORE_DATE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_RESTORE_DATE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_RESTORE_DATE])) {\n $errs[self::FIELD_RESTORE_DATE] = [];\n }\n $errs[self::FIELD_RESTORE_DATE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_STATUS])) {\n $v = $this->getStatus();\n foreach($validationRules[self::FIELD_STATUS] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_STATUS, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_STATUS])) {\n $errs[self::FIELD_STATUS] = [];\n }\n $errs[self::FIELD_STATUS][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_STATUS_DATE])) {\n $v = $this->getStatusDate();\n foreach($validationRules[self::FIELD_STATUS_DATE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_STATUS_DATE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_STATUS_DATE])) {\n $errs[self::FIELD_STATUS_DATE] = [];\n }\n $errs[self::FIELD_STATUS_DATE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_SUBJECT])) {\n $v = $this->getSubject();\n foreach($validationRules[self::FIELD_SUBJECT] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_SUBJECT, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_SUBJECT])) {\n $errs[self::FIELD_SUBJECT] = [];\n }\n $errs[self::FIELD_SUBJECT][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_VALIDITY_PERIOD])) {\n $v = $this->getValidityPeriod();\n foreach($validationRules[self::FIELD_VALIDITY_PERIOD] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_VALIDITY_PERIOD, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_VALIDITY_PERIOD])) {\n $errs[self::FIELD_VALIDITY_PERIOD] = [];\n }\n $errs[self::FIELD_VALIDITY_PERIOD][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_CONTAINED])) {\n $v = $this->getContained();\n foreach($validationRules[self::FIELD_CONTAINED] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE, self::FIELD_CONTAINED, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_CONTAINED])) {\n $errs[self::FIELD_CONTAINED] = [];\n }\n $errs[self::FIELD_CONTAINED][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_EXTENSION])) {\n $v = $this->getExtension();\n foreach($validationRules[self::FIELD_EXTENSION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE, self::FIELD_EXTENSION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_EXTENSION])) {\n $errs[self::FIELD_EXTENSION] = [];\n }\n $errs[self::FIELD_EXTENSION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_MODIFIER_EXTENSION])) {\n $v = $this->getModifierExtension();\n foreach($validationRules[self::FIELD_MODIFIER_EXTENSION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE, self::FIELD_MODIFIER_EXTENSION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_MODIFIER_EXTENSION])) {\n $errs[self::FIELD_MODIFIER_EXTENSION] = [];\n }\n $errs[self::FIELD_MODIFIER_EXTENSION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_TEXT])) {\n $v = $this->getText();\n foreach($validationRules[self::FIELD_TEXT] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE, self::FIELD_TEXT, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_TEXT])) {\n $errs[self::FIELD_TEXT] = [];\n }\n $errs[self::FIELD_TEXT][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_ID])) {\n $v = $this->getId();\n foreach($validationRules[self::FIELD_ID] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_RESOURCE, self::FIELD_ID, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_ID])) {\n $errs[self::FIELD_ID] = [];\n }\n $errs[self::FIELD_ID][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_IMPLICIT_RULES])) {\n $v = $this->getImplicitRules();\n foreach($validationRules[self::FIELD_IMPLICIT_RULES] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_RESOURCE, self::FIELD_IMPLICIT_RULES, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_IMPLICIT_RULES])) {\n $errs[self::FIELD_IMPLICIT_RULES] = [];\n }\n $errs[self::FIELD_IMPLICIT_RULES][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_LANGUAGE])) {\n $v = $this->getLanguage();\n foreach($validationRules[self::FIELD_LANGUAGE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_RESOURCE, self::FIELD_LANGUAGE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_LANGUAGE])) {\n $errs[self::FIELD_LANGUAGE] = [];\n }\n $errs[self::FIELD_LANGUAGE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_META])) {\n $v = $this->getMeta();\n foreach($validationRules[self::FIELD_META] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_RESOURCE, self::FIELD_META, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_META])) {\n $errs[self::FIELD_META] = [];\n }\n $errs[self::FIELD_META][$rule] = $err;\n }\n }\n }\n return $errs;\n }", "function required_validate() {\n if ($this->required) {\n if (array_key_exists('NOT_NULL', $this->condition)) \n {\n if ($this->value == '' || $this->value == NULL) {\n $this->errors->add_msj(NOT_NULL_PRE.$this->name.NOT_NULL_POS);\n }\n }\n\n if (array_key_exists('IS_INT', $this->condition)) \n {\n if (!field_is_int($this->value))\n {\n $this->errors->add_msj(IS_INT_PRE.$this->name.IS_INT_POS);\n }\n }\n\n }\n }", "public function validateData($data): void;", "private function _inputUpdateValidatedFields(WireInputData $values, Salesperson $code) {\n\t\t$invalidfields = [];\n\t\t$originals = ['groupid' => $code->groupid, 'userid' => $code->userid, 'vendorid' => $code->vendorid];\n\n\t\t$spgpm = Spgpm::instance();\n\t\t$code->setGroupid($values->string('groupid'));\n\n\t\tif ($spgpm->exists($values->string('groupid')) === false) {\n\t\t\t$code->setGroupid('');\n\t\t\t$invalidfields['groupid'] = 'Group ID';\n\t\t}\n\n\t\t$logm = \\Dplus\\Msa\\Logm::getInstance();\n\t\t$code->setUserid($values->text('userid'));\n\n\t\tif ($values->text('userid') != '' && $logm->exists($values->text('userid')) === false) {\n\t\t\t$code->setUserid('');\n\t\t\t$invalidfields['userid'] = 'Login ID';\n\t\t}\n\n\t\t$vendors = \\VendorQuery::create();\n\t\t$code->setVendorid($values->string('vendorid'));\n\n\t\tif (boolval($vendors->filterByVendorid($values->string('vendorid'))->count()) === false) {\n\t\t\t$code->setVendorid('');\n\t\t\t$invalidfields['vendorid'] = 'Vendor ID';\n\t\t}\n\t\treturn $invalidfields;\n\t}", "function commonValidation($data) {\n unset($this->validate['title']);\n unset($this->validate['category_id']);\n unset($this->validate['short_description']);\n\n if ($data['Offer']['basename'] != '') {\n unset($this->validate['file']['valid_upload']);\n }\n }", "public function validateCallParameter() {\n if ($this->call_asset['parameter']) {\n // Validate parameters to a call.\n // Array, defining each parameter allowed in a call with the expected\n // data type of the value.\n $call_parameter = $this->call_parameter;\n // Parameters of the call request as seen in the request call.\n $call_request_parameter = $this->call_asset['parameter'];\n\n // Validate each parameter.\n foreach($call_request_parameter as $key => $value) {\n if (array_key_exists($key, $call_parameter)) {\n // Key in the request matches predefined parameter of the call.\n $is_valid = $this->matchDataType($value, $call_parameter[ $key ]);\n \n // Value should only match the enumerated value.\n if (is_array($call_parameter[ $key ])) {\n $call_parameter[ $key ] = 'one: ' . implode(',', $call_parameter[ $key ]) . ' - list';\n }\n\n if (!$is_valid) {\n // Data type mismatch.\n $response = [\n 'code' => 400, // Bad Request.\n 'message' => 'Call: Parameter ' . $key . ' expects ' . $call_parameter[ $key ] . ' type.'\n ];\n TripalWebServiceResponse::errorResponse($response);\n\n // Error will exit, but break here to be clear that loop should halt on error.\n break;\n }\n }\n else {\n // Undefined parameter to this call.\n $response = [\n 'code' => 400, // Bad Request.\n 'message' => 'Call: Parameter ' . $key . ' not expected for this call.'\n ];\n TripalWebServiceResponse::errorResponse($response);\n\n // Error will exit, but break here to be clear that loop should halt on error.\n break;\n }\n }\n }\n }", "public function checkData() {\n\t\t// e.g. numbers must only have digits, e-mail addresses must have a \"@\" and a \".\".\n\t\treturn $this->control->checkPOST($this);\n\t}", "public function checkData() {\n\t\t// e.g. numbers must only have digits, e-mail addresses must have a \"@\" and a \".\".\n\t\treturn $this->control->checkPOST($this);\n\t}", "protected function preValidate() {}", "public function rules()\n {\n return [\n // MUST be present, be a number and exist in table\n 'centre' => 'required|exists:centres,id|numeric',\n // MUST be present, string, exists\n 'voucher-start' => 'required|string|exists:vouchers,code',\n // MUST be present, string, exists, greater/equal to start and same sponsor as start\n 'voucher-end' => 'required|string|exists:vouchers,code|codeGreaterThan:voucher-start|sameSponsor:voucher-start',\n // MUST be present, date formatted to Y-m-d, eg 2019-06-21\n 'date-sent' => 'required|date_format:Y-m-d',\n ];\n }", "function validation($data, $files) {\n $errors = parent::validation($data, $files);\n \n if(empty($data['ukprn'])) {\n $errors['ukprn'] = get_string('error_missing_school_name', 'enrol_ukfilmnet');\n }\n if($data['contact_email'] && strpos( $data['contact_email'], '@') === false) {\n $errors['contact_email'] = get_string('error_invalid_email', 'enrol_ukfilmnet');\n }\n if(!array_key_exists('school_consent_to_contact', $data)) {\n $errors['school_consent_to_contact'] = get_string('error_missing_school_consent_to_contact', 'enrol_ukfilmnet');\n }\n \n return $errors;\n }", "function validation($data){\n $errors= array();\n if ($foundcourses = get_records('course', 'shortname', $data['shortname'])) {\n if (!empty($data['id'])) {\n unset($foundcourses[$data['id']]);\n }\n if (!empty($foundcourses)) {\n foreach ($foundcourses as $foundcourse) {\n $foundcoursenames[] = $foundcourse->fullname;\n }\n $foundcoursenamestring = implode(',', $foundcoursenames);\n $errors['shortname']= get_string('shortnametaken', '', $foundcoursenamestring);\n }\n }\n\n if (empty($data['enrolenddisabled'])){\n if ($data['enrolenddate'] <= $data['enrolstartdate']){\n $errors['enroldateendgrp'] = get_string('enrolenddaterror');\n }\n }\n\n if (0 == count($errors)){\n return true;\n } else {\n return $errors;\n }\n }", "public function preValidate(ArrayObject $data)\n {\n\n }", "protected function validationData() {\n\t\t$input = [];\n\n\t\t/**\n\t\t * If source and target institute id is available in input decode it and merge with input\n\t\t */\n\t\tif ( $this->has('source_institute_id') ) {\n\t\t\t$input['source_institute_id'] = GeneralHelpers::decode($this->input('source_institute_id'));\n\t\t}\n\n\t\tif ( $this->has('target_institute_id') ) {\n\t\t\t$input['target_institute_id'] = GeneralHelpers::decode($this->input('target_institute_id'));\n\t\t}\n\n\t\t$this->merge($input);\n\n\t\treturn parent::validationData();\n\t}", "function homeValidate() {\n\t\t$validate1 = array(\n\t\t\n\t\t/*'stock'=> array(\n\t\t\t\t\t'mustNotEmpty'=>array(\n\t\t\t\t\t\t'rule' => 'notEmpty',\n\t\t\t\t\t\t'message'=> 'Please enter Stock Number')\n\t\t\t\t\t),\n\t\t\t\t\n\t\t 'name'=> array(\n\t\t\t\t\t'mustNotEmpty'=>array(\n\t\t\t\t\t\t'rule' => 'notEmpty',\n\t\t\t\t\t\t'message'=> 'Please enter name')\n\t\t\t\t\t),*/\n\t\t 'email'=> array(\n\t\t\t\t\t'mustNotEmpty'=>array(\n\t\t\t\t\t\t'rule' => 'notEmpty',\n\t\t\t\t\t\t'message'=> 'Please enter Email')\n\t\t\t\t\t),\n\n\t\t 'contact'=> array(\n\t\t\t\t\t'mustNotEmpty'=>array(\n\t\t\t\t\t\t'rule' => 'notEmpty',\n\t\t\t\t\t\t'message'=> 'Please enter Contact Number')\n\t\t\t\t\t),\n\t\t/*'make'=> array(\n\t\t\t\t\t'mustNotEmpty'=>array(\n\t\t\t\t\t\t'rule' => 'notEmpty',\n\t\t\t\t\t\t'message'=> 'Please enter Make')\n\t\t\t\t\t),\n\t\t'model'=> array(\n\t\t\t\t\t'mustNotEmpty'=>array(\n\t\t\t\t\t\t'rule' => 'notEmpty',\n\t\t\t\t\t\t'message'=> 'Please enter Model')\n\t\t\t\t\t),\n\t\t'part'=> array(\n\t\t\t\t\t'mustNotEmpty'=>array(\n\t\t\t\t\t\t'rule' => 'notEmpty',\n\t\t\t\t\t\t'message'=> 'Please enter part')\n\t\t\t\t\t),\n\t\t'year'=> array(\n\t\t\t\t\t'mustNotEmpty'=>array(\n\t\t\t\t\t\t'rule' => 'notEmpty',\n\t\t\t\t\t\t'message'=> 'Please choose year')\n\t\t\t\t\t),\n\t\t'country' => array(\n\t\t\t\t\t'mustNotEmpty'=>array(\n\t\t\t\t\t\t'rule' => 'notEmpty',\n\t\t\t\t\t\t'message'=> 'Please choose country')\n\t\t\t\t\t),\n\t\t'comment' => array(\n\t\t\t\t\t'mustNotEmpty'=>array(\n\t\t\t\t\t\t'rule' => 'notEmpty',\n\t\t\t\t\t\t'message'=> 'Please enter comment')\n\t\t\t\t\t),*/\n\t\t\n\t\t\t);\n\t\t$this->validate=$validate1;\n\t\treturn $this->validates();\n\t}", "function readInputData() {\n\t\t$this->readUserVars(array('subscriptionName', 'subscriptionEmail', 'subscriptionPhone', 'subscriptionFax', 'subscriptionMailingAddress', 'subscriptionAdditionalInformation', 'enableDelayedOpenAccess', 'delayedOpenAccessDuration', 'delayedOpenAccessPolicy', 'enableOpenAccessNotification', 'enableAuthorSelfArchive', 'authorSelfArchivePolicy', 'subscriptionExpiryPartial', 'enableSubscriptionOnlinePaymentNotificationPurchaseIndividual', 'enableSubscriptionOnlinePaymentNotificationPurchaseInstitutional', 'enableSubscriptionOnlinePaymentNotificationRenewIndividual', 'enableSubscriptionOnlinePaymentNotificationRenewInstitutional', 'enableSubscriptionExpiryReminderBeforeMonths', 'numMonthsBeforeSubscriptionExpiryReminder', 'enableSubscriptionExpiryReminderBeforeWeeks', 'numWeeksBeforeSubscriptionExpiryReminder', 'enableSubscriptionExpiryReminderAfterWeeks', 'numWeeksAfterSubscriptionExpiryReminder', 'enableSubscriptionExpiryReminderAfterMonths', 'numMonthsAfterSubscriptionExpiryReminder'));\n\n\t\t// If delayed open access selected, ensure a valid duration is provided\n\t\tif ($this->_data['enableDelayedOpenAccess'] == 1) {\n\t\t\t$this->addCheck(new FormValidatorInSet($this, 'delayedOpenAccessDuration', 'required', 'manager.subscriptionPolicies.delayedOpenAccessDurationValid', array_keys($this->validDuration)));\n\t\t}\n\n\t\t// If expiry reminder before months is selected, ensure a valid month value is provided\n\t\tif ($this->_data['enableSubscriptionExpiryReminderBeforeMonths'] == 1) {\n\t\t\t$this->addCheck(new FormValidatorInSet($this, 'numMonthsBeforeSubscriptionExpiryReminder', 'required', 'manager.subscriptionPolicies.numMonthsBeforeSubscriptionExpiryReminderValid', array_keys($this->validNumMonthsBeforeExpiry)));\n\t\t}\n\n\t\t// If expiry reminder before weeks is selected, ensure a valid week value is provided\n\t\tif ($this->_data['enableSubscriptionExpiryReminderBeforeWeeks'] == 1) {\n\t\t\t$this->addCheck(new FormValidatorInSet($this, 'numWeeksBeforeSubscriptionExpiryReminder', 'required', 'manager.subscriptionPolicies.numWeeksBeforeSubscriptionExpiryReminderValid', array_keys($this->validNumWeeksBeforeExpiry)));\n\t\t}\n\n\t\t// If expiry reminder after months is selected, ensure a valid month value is provided\n\t\tif ($this->_data['enableSubscriptionExpiryReminderAfterMonths'] == 1) {\n\t\t\t$this->addCheck(new FormValidatorInSet($this, 'numMonthsAfterSubscriptionExpiryReminder', 'required', 'manager.subscriptionPolicies.numMonthsAfterSubscriptionExpiryReminderValid', array_keys($this->validNumMonthsAfterExpiry)));\n\t\t}\n\n\t\t// If expiry reminder after weeks is selected, ensure a valid week value is provided\n\t\tif ($this->_data['enableSubscriptionExpiryReminderAfterWeeks'] == 1) {\n\t\t\t$this->addCheck(new FormValidatorInSet($this, 'numWeeksAfterSubscriptionExpiryReminder', 'required', 'manager.subscriptionPolicies.numWeeksAfterSubscriptionExpiryReminderValid', array_keys($this->validNumWeeksAfterExpiry)));\n\t\t}\n\t}", "public function validationData()\n {\n $all = parent::validationData();\n $all['bank-info'] = Purifier::clean($all['bank-info']);\n $all['delivery'] = Purifier::clean($all['delivery']);\n return $all;\n }", "public static function validateAllowed_for_Tax_Deduction_DataForArrayConstraintsFromSetAllowed_for_Tax_Deduction_Data(array $values = array())\n {\n $message = '';\n $invalidValues = [];\n foreach ($values as $dependent_DataTypeAllowed_for_Tax_Deduction_DataItem) {\n // validation for constraint: itemType\n if (!$dependent_DataTypeAllowed_for_Tax_Deduction_DataItem instanceof \\WorkdayWsdl\\\\StructType\\Allowed_for_Tax_Deduction_DataType) {\n $invalidValues[] = is_object($dependent_DataTypeAllowed_for_Tax_Deduction_DataItem) ? get_class($dependent_DataTypeAllowed_for_Tax_Deduction_DataItem) : sprintf('%s(%s)', gettype($dependent_DataTypeAllowed_for_Tax_Deduction_DataItem), var_export($dependent_DataTypeAllowed_for_Tax_Deduction_DataItem, true));\n }\n }\n if (!empty($invalidValues)) {\n $message = sprintf('The Allowed_for_Tax_Deduction_Data property can only contain items of type \\WorkdayWsdl\\\\StructType\\Allowed_for_Tax_Deduction_DataType, %s given', is_object($invalidValues) ? get_class($invalidValues) : (is_array($invalidValues) ? implode(', ', $invalidValues) : gettype($invalidValues)));\n }\n unset($invalidValues);\n return $message;\n }", "private function calculateInputData() {\n\t\t$this->inputValuesSetRawData();\n\t\t$this->explodeRowsToCells();\n\t\t$this->separateHeader();\n\t\t$this->validateValues();\n\t}", "protected function validationData() {\n\t\t$input = [];\n\n\t\t/**\n\t\t * Decode institute and ref_by id and merge to request input\n\t\t */\n\t\tif ( $this->has('institute_id') ) {\n\t\t\t$input['institute_id'] = GeneralHelpers::decode($this->input('institute_id'));\n\t\t}\n\n\t\tif ( $this->has('ref_by') ) {\n\t\t\t$input['ref_by'] = GeneralHelpers::decode($this->get('ref_by'));\n\t\t}\n\n\t\t$this->merge($input);\n\n\t\treturn parent::validationData(); // TODO: Change the autogenerated stub\n\t}", "protected function prepareForValidation()\n {\n $this->merge([\n 'nome' => $this->nome,\n 'nascimento' => convertDateToDatabase($this->nascimento),\n 'cpf' => returnOnlyNumbers($this->cpf),\n 'email' => $this->email,\n ]);\n }", "public function afterValidate() {\n\t\tif($this->allowFrom !== \"\"){\n\t\t\t$res\t= preg_split(\"/\\./\",$this->allowFrom);\n\t\t\t$this->allowFrom= sprintf(\"%03d\",$res[0]).\".\".sprintf(\"%03d\",$res[1]).\".\".sprintf(\"%03d\",$res[2]).\".\".sprintf(\"%03d\",$res[3]);\n\t\t}else{\n\t\t\t$this->allowFrom = NULL;\n\t\t}\n\t\t//----------------------------------------------------------------------\n\t\t$res\t= NULL;\n\t\t// ---------------------------------------------------------------------\n\t\tif($this->allowTo !== \"\"){\n\t\t\t$res\t= preg_split(\"/\\./\",$this->allowTo);\n\t\t\t$this->allowTo\t= sprintf(\"%03d\",$res[0]).\".\".sprintf(\"%03d\",$res[1]).\".\".sprintf(\"%03d\",$res[2]).\".\".sprintf(\"%03d\",$res[3]);\n\t\t}else{\n\t\t\t$this->allowTo = NULL;\n\t\t}\n\t\t//----------------------------------------------------------------------\n\t\tparent::afterValidate();\n\t}", "public function rules()\n {\n return array(\n array('pagination, bundleSize, publicationDate, deliveryDate', 'required'),\n array('pagination, bundleSize', 'numerical'),\n array('orderDetails', 'validateDetails'),\n );\n }", "public function validate() {\n if (!empty($this->value)) {\n parent::validate();\n }\n }", "public function validate() {\n if (!empty($this->value)) {\n parent::validate();\n }\n }", "protected final function CheckFormat(&$data)\n {\n if ($data[1] != \"Receiver\" && $data[2] != \"Transmitter\") \n ExHandler::Error500(\"Vue files must contain 'Receiver' and 'Transmitter' in cells B:1 and C:1 respectively.\");\n }", "public function _getValidationErrors()\n {\n $errs = parent::_getValidationErrors();\n $validationRules = $this->_getValidationRules();\n if ([] !== ($vs = $this->getDataRequirement())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_DATA_REQUIREMENT, $i)] = $fieldErrs;\n }\n }\n }\n if (null !== ($v = $this->getEncounter())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_ENCOUNTER] = $fieldErrs;\n }\n }\n if ([] !== ($vs = $this->getEvaluationMessage())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_EVALUATION_MESSAGE, $i)] = $fieldErrs;\n }\n }\n }\n if ([] !== ($vs = $this->getIdentifier())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_IDENTIFIER, $i)] = $fieldErrs;\n }\n }\n }\n if (null !== ($v = $this->getModuleCanonical())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_MODULE_CANONICAL] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getModuleCodeableConcept())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_MODULE_CODEABLE_CONCEPT] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getModuleUri())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_MODULE_URI] = $fieldErrs;\n }\n }\n if ([] !== ($vs = $this->getNote())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_NOTE, $i)] = $fieldErrs;\n }\n }\n }\n if (null !== ($v = $this->getOccurrenceDateTime())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_OCCURRENCE_DATE_TIME] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getOutputParameters())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_OUTPUT_PARAMETERS] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getPerformer())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_PERFORMER] = $fieldErrs;\n }\n }\n if ([] !== ($vs = $this->getReasonCode())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_REASON_CODE, $i)] = $fieldErrs;\n }\n }\n }\n if ([] !== ($vs = $this->getReasonReference())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_REASON_REFERENCE, $i)] = $fieldErrs;\n }\n }\n }\n if (null !== ($v = $this->getRequestIdentifier())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_REQUEST_IDENTIFIER] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getResult())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_RESULT] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getStatus())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_STATUS] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getSubject())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_SUBJECT] = $fieldErrs;\n }\n }\n if (isset($validationRules[self::FIELD_DATA_REQUIREMENT])) {\n $v = $this->getDataRequirement();\n foreach($validationRules[self::FIELD_DATA_REQUIREMENT] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_GUIDANCE_RESPONSE, self::FIELD_DATA_REQUIREMENT, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_DATA_REQUIREMENT])) {\n $errs[self::FIELD_DATA_REQUIREMENT] = [];\n }\n $errs[self::FIELD_DATA_REQUIREMENT][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_ENCOUNTER])) {\n $v = $this->getEncounter();\n foreach($validationRules[self::FIELD_ENCOUNTER] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_GUIDANCE_RESPONSE, self::FIELD_ENCOUNTER, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_ENCOUNTER])) {\n $errs[self::FIELD_ENCOUNTER] = [];\n }\n $errs[self::FIELD_ENCOUNTER][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_EVALUATION_MESSAGE])) {\n $v = $this->getEvaluationMessage();\n foreach($validationRules[self::FIELD_EVALUATION_MESSAGE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_GUIDANCE_RESPONSE, self::FIELD_EVALUATION_MESSAGE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_EVALUATION_MESSAGE])) {\n $errs[self::FIELD_EVALUATION_MESSAGE] = [];\n }\n $errs[self::FIELD_EVALUATION_MESSAGE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_IDENTIFIER])) {\n $v = $this->getIdentifier();\n foreach($validationRules[self::FIELD_IDENTIFIER] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_GUIDANCE_RESPONSE, self::FIELD_IDENTIFIER, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_IDENTIFIER])) {\n $errs[self::FIELD_IDENTIFIER] = [];\n }\n $errs[self::FIELD_IDENTIFIER][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_MODULE_CANONICAL])) {\n $v = $this->getModuleCanonical();\n foreach($validationRules[self::FIELD_MODULE_CANONICAL] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_GUIDANCE_RESPONSE, self::FIELD_MODULE_CANONICAL, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_MODULE_CANONICAL])) {\n $errs[self::FIELD_MODULE_CANONICAL] = [];\n }\n $errs[self::FIELD_MODULE_CANONICAL][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_MODULE_CODEABLE_CONCEPT])) {\n $v = $this->getModuleCodeableConcept();\n foreach($validationRules[self::FIELD_MODULE_CODEABLE_CONCEPT] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_GUIDANCE_RESPONSE, self::FIELD_MODULE_CODEABLE_CONCEPT, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_MODULE_CODEABLE_CONCEPT])) {\n $errs[self::FIELD_MODULE_CODEABLE_CONCEPT] = [];\n }\n $errs[self::FIELD_MODULE_CODEABLE_CONCEPT][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_MODULE_URI])) {\n $v = $this->getModuleUri();\n foreach($validationRules[self::FIELD_MODULE_URI] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_GUIDANCE_RESPONSE, self::FIELD_MODULE_URI, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_MODULE_URI])) {\n $errs[self::FIELD_MODULE_URI] = [];\n }\n $errs[self::FIELD_MODULE_URI][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_NOTE])) {\n $v = $this->getNote();\n foreach($validationRules[self::FIELD_NOTE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_GUIDANCE_RESPONSE, self::FIELD_NOTE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_NOTE])) {\n $errs[self::FIELD_NOTE] = [];\n }\n $errs[self::FIELD_NOTE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_OCCURRENCE_DATE_TIME])) {\n $v = $this->getOccurrenceDateTime();\n foreach($validationRules[self::FIELD_OCCURRENCE_DATE_TIME] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_GUIDANCE_RESPONSE, self::FIELD_OCCURRENCE_DATE_TIME, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_OCCURRENCE_DATE_TIME])) {\n $errs[self::FIELD_OCCURRENCE_DATE_TIME] = [];\n }\n $errs[self::FIELD_OCCURRENCE_DATE_TIME][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_OUTPUT_PARAMETERS])) {\n $v = $this->getOutputParameters();\n foreach($validationRules[self::FIELD_OUTPUT_PARAMETERS] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_GUIDANCE_RESPONSE, self::FIELD_OUTPUT_PARAMETERS, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_OUTPUT_PARAMETERS])) {\n $errs[self::FIELD_OUTPUT_PARAMETERS] = [];\n }\n $errs[self::FIELD_OUTPUT_PARAMETERS][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_PERFORMER])) {\n $v = $this->getPerformer();\n foreach($validationRules[self::FIELD_PERFORMER] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_GUIDANCE_RESPONSE, self::FIELD_PERFORMER, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_PERFORMER])) {\n $errs[self::FIELD_PERFORMER] = [];\n }\n $errs[self::FIELD_PERFORMER][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_REASON_CODE])) {\n $v = $this->getReasonCode();\n foreach($validationRules[self::FIELD_REASON_CODE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_GUIDANCE_RESPONSE, self::FIELD_REASON_CODE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_REASON_CODE])) {\n $errs[self::FIELD_REASON_CODE] = [];\n }\n $errs[self::FIELD_REASON_CODE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_REASON_REFERENCE])) {\n $v = $this->getReasonReference();\n foreach($validationRules[self::FIELD_REASON_REFERENCE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_GUIDANCE_RESPONSE, self::FIELD_REASON_REFERENCE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_REASON_REFERENCE])) {\n $errs[self::FIELD_REASON_REFERENCE] = [];\n }\n $errs[self::FIELD_REASON_REFERENCE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_REQUEST_IDENTIFIER])) {\n $v = $this->getRequestIdentifier();\n foreach($validationRules[self::FIELD_REQUEST_IDENTIFIER] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_GUIDANCE_RESPONSE, self::FIELD_REQUEST_IDENTIFIER, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_REQUEST_IDENTIFIER])) {\n $errs[self::FIELD_REQUEST_IDENTIFIER] = [];\n }\n $errs[self::FIELD_REQUEST_IDENTIFIER][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_RESULT])) {\n $v = $this->getResult();\n foreach($validationRules[self::FIELD_RESULT] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_GUIDANCE_RESPONSE, self::FIELD_RESULT, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_RESULT])) {\n $errs[self::FIELD_RESULT] = [];\n }\n $errs[self::FIELD_RESULT][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_STATUS])) {\n $v = $this->getStatus();\n foreach($validationRules[self::FIELD_STATUS] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_GUIDANCE_RESPONSE, self::FIELD_STATUS, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_STATUS])) {\n $errs[self::FIELD_STATUS] = [];\n }\n $errs[self::FIELD_STATUS][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_SUBJECT])) {\n $v = $this->getSubject();\n foreach($validationRules[self::FIELD_SUBJECT] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_GUIDANCE_RESPONSE, self::FIELD_SUBJECT, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_SUBJECT])) {\n $errs[self::FIELD_SUBJECT] = [];\n }\n $errs[self::FIELD_SUBJECT][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_CONTAINED])) {\n $v = $this->getContained();\n foreach($validationRules[self::FIELD_CONTAINED] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE, self::FIELD_CONTAINED, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_CONTAINED])) {\n $errs[self::FIELD_CONTAINED] = [];\n }\n $errs[self::FIELD_CONTAINED][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_EXTENSION])) {\n $v = $this->getExtension();\n foreach($validationRules[self::FIELD_EXTENSION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE, self::FIELD_EXTENSION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_EXTENSION])) {\n $errs[self::FIELD_EXTENSION] = [];\n }\n $errs[self::FIELD_EXTENSION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_MODIFIER_EXTENSION])) {\n $v = $this->getModifierExtension();\n foreach($validationRules[self::FIELD_MODIFIER_EXTENSION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE, self::FIELD_MODIFIER_EXTENSION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_MODIFIER_EXTENSION])) {\n $errs[self::FIELD_MODIFIER_EXTENSION] = [];\n }\n $errs[self::FIELD_MODIFIER_EXTENSION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_TEXT])) {\n $v = $this->getText();\n foreach($validationRules[self::FIELD_TEXT] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE, self::FIELD_TEXT, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_TEXT])) {\n $errs[self::FIELD_TEXT] = [];\n }\n $errs[self::FIELD_TEXT][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_ID])) {\n $v = $this->getId();\n foreach($validationRules[self::FIELD_ID] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_RESOURCE, self::FIELD_ID, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_ID])) {\n $errs[self::FIELD_ID] = [];\n }\n $errs[self::FIELD_ID][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_IMPLICIT_RULES])) {\n $v = $this->getImplicitRules();\n foreach($validationRules[self::FIELD_IMPLICIT_RULES] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_RESOURCE, self::FIELD_IMPLICIT_RULES, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_IMPLICIT_RULES])) {\n $errs[self::FIELD_IMPLICIT_RULES] = [];\n }\n $errs[self::FIELD_IMPLICIT_RULES][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_LANGUAGE])) {\n $v = $this->getLanguage();\n foreach($validationRules[self::FIELD_LANGUAGE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_RESOURCE, self::FIELD_LANGUAGE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_LANGUAGE])) {\n $errs[self::FIELD_LANGUAGE] = [];\n }\n $errs[self::FIELD_LANGUAGE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_META])) {\n $v = $this->getMeta();\n foreach($validationRules[self::FIELD_META] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_RESOURCE, self::FIELD_META, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_META])) {\n $errs[self::FIELD_META] = [];\n }\n $errs[self::FIELD_META][$rule] = $err;\n }\n }\n }\n return $errs;\n }", "public function normalizeData()\n {\n if (is_numeric($this->Streetname2)) {\n $this->HouseNumber = $this->Streetname2;\n $this->Streetname2 = \"\";\n }\n\n// Sometimes people will input - To mean Idfk why are you asking me to input this?\n if ($this->Phone && strlen($this->Phone) < 3) {\n $this->addMessage($this->getFormatedMessage(\"Invalid Phone [$this->Phone] ignoring\"));\n $this->Phone = '';\n }\n\n if ($this->State && strlen($this->State) < 2) {\n $this->addMessage($this->getFormatedMessage(\"Invalid State [$this->State] ignoring\"));\n $this->State = '';\n }\n\n if ($this->CompanyName && strlen($this->CompanyName) < 3) {\n $this->addMessage($this->getFormatedMessage(\"Invalid CompanyName[$this->CompanyName] ignoring \"));\n $this->CompanyName = '';\n }\n\n $this->Description = $this->escapeTextData($this->Description);\n if ($this->Description && strlen($this->Description) > 255) {\n $this->Description = substr($this->Description, 0, 255);\n\n //Make sure we are not sending a broken special char\n $descChars = str_split($this->Description); \n for ($i = 254; $i > 251; --$i) {\n if ($descChars[$i] == '&') {\n $this->Description = substr($this->Description, 0, $i);\n }\n }\n }\n\n if($this->Description && strlen($this->Description) < 3) {\n $this->addMessage($this->getFormatedMessage(\"Invalid description $this->Description ignoring \"));\n $this->Description = ''; \n }\n }", "public function validate(){\r\n\t\tif(array_get($this->entity, array_get($this->validate, 'fieldName')) != $this->fieldValue){\r\n\t\t\tHmsException::occur($fieldName. '必须等于', $this->fieldValue);\r\n\t\t}\r\n\t}", "protected function checkStructure()\n {\n $structure = $this->getStructure();\n\n foreach ($structure as $field => $opt) {\n if (!array_key_exists($field, $this->data)) {\n continue;\n }\n\n $value = Arr::get($this->data, $field);\n if (is_array($value)) {\n $this->errors[$field][] = Translate::get('validate_wrong_type_data');\n continue;\n }\n\n $value = trim($value);\n $length = (int)$opt->length;\n\n if (!empty($length)) {\n $len = mb_strlen($value);\n if ($len > $length) {\n $this->errors[$field][] = Translate::getSprintf('validate_max_length', $length);\n continue;\n }\n }\n\n if (!$opt->autoIncrement && $opt->default === NULL && !$opt->allowNull && $this->isEmpty($value)) {\n $this->errors[$field][] = Translate::get('validate_not_empty');\n continue;\n }\n\n switch ($opt->dataType) {\n case 'int':\n case 'bigint':\n if (!$this->isEmpty($value) && (filter_var($value, FILTER_VALIDATE_INT) === false)) {\n $this->errors[$field][] = Translate::get('validate_int');\n continue 2;\n }\n break;\n\n case 'double':\n if (!is_float($value) && !$this->isEmpty($value)) {\n $this->errors[$field][] = Translate::get('validate_double');\n continue 2;\n }\n break;\n\n case 'float':\n if (!is_numeric($value) && !$this->isEmpty($value)) {\n $this->errors[$field][] = Translate::get('validate_float');\n continue 2;\n }\n break;\n\n case 'date':\n case 'datetime':\n case 'timestamp':\n if (!$this->isEmpty($value) && !Validate::dateSql($value)) {\n $this->errors[$field][] = Translate::get('validate_sql_date');\n continue 2;\n }\n break;\n\n default:\n continue 2;\n break;\n\n }\n }\n }", "private function validateFormData() {\n\n $this->firstName = $this->generalFieldValidation($this->firstName, \"firstName\", \"First name\", 40, false);\n $this->lastName = $this->generalFieldValidation($this->lastName, \"lastName\", \"Last name\", 40, false);\n $this->email = $this->generalFieldValidation($this->email, \"email\", \"E-mail\", 60, false);\n $this->address = $this->generalFieldValidation($this->address, \"address\", \"Address\", 255);\n $this->city = $this->generalFieldValidation($this->city, \"city\", \"City\", 60);\n $this->state = $this->generalFieldValidation($this->state, \"state\", \"State\", 2);\n $this->zip = $this->generalFieldValidation($this->zip, \"zip\", \"Zip code\", 5);\n $this->phone = $this->generalFieldValidation($this->phone, \"phone\", \"Phone number\", 10, false);\n $this->notes = $this->generalFieldValidation($this->notes, \"notes\", \"Notes\", -1, false);\n if ($this->phone !== \"\") {\n if (!is_numeric($this->phone)) {\n $this->errorArray[\"phone\"] = \"Phone number may only contain digits.\";\n } else {\n if (strlen($this->phone) < 10) {\n $this->errorArray[\"phone\"] = \"Phone number must contain 10 digits.\";\n }\n }\n }\n if ($this->zip !== \"\") {\n if (!is_numeric($this->zip)) {\n $this->errorArray[\"zip\"] = \"Zip code may only contain digits.\";\n } else {\n if (strlen($this->zip) !== 5) {\n $this->errorArray[\"zip\"] = \"Five digit zip code required.\";\n }\n }\n }\n if ($this->email !== \"\") {\n if (!preg_match(\"/^\\S+@\\S+\\.\\S+$/\", $this->email)) {\n $this->errorArray[\"email\"] = \"E-mail address is not valid.\";\n }\n }\n if (count($this->errorArray) === 0) {\n $this->passedValidation = true;\n }\n }", "protected function postValidation()\n {\n if (Tools::isSubmit('btnSubmit')) {\n if (!Tools::getValue('SEND_SMS_API')) {\n $this->postErrors[] = $this->l('API Key is required.');\n }\n if (Tools::getValue('SEND_SMS_API')) {\n $isapiKey = $this->isValidAPIKey(Tools::getValue('SEND_SMS_API'));\n if ($isapiKey->status != 'success') {\n $this->postErrors[] = $this->l('API Key is not valid.');\n }\n }\n if (!Tools::getValue('ADMIN_MOBILE')) {\n $this->postErrors[] = $this->l('Admin Mobile Number is required.');\n }\n if (Tools::getValue('ADMIN_MOBILE')) {\n $isvalid = preg_match('/^[0-9]*$/', Tools::getValue('ADMIN_MOBILE'));\n if ($isvalid == false) {\n $this->postErrors[] = $this->l('Admin Mobile Number is not valid.');\n }\n }\n }\n }", "protected function buildValidationCallback() {\n }", "protected function prepareForValidation()\n {\n \n //Filling uncaught parameters to blank default value\n foreach($this->columns_rules as $column => $rules){\n if(empty($this->get($column))) {\n $this->request->add([$column => '']); \n }\n }\n\n }", "private function validate_input() {\n\t\t$fields = array_merge( array( $this->range_field ), $this->key_fields, $this->checksum_fields );\n\n\t\t$this->validate_fields( $fields );\n\t\t$this->validate_fields_against_table( $fields );\n\t}", "public function validate()\n\t{\n\t\t$this->errors = [];\n\n\t\t$this->validateConfig();\n\n\t\t// there is no point to continue if config is not valid against the schema\n\t\tif($this->isValid()) {\n\t\t\t$this->validateRepetitions();\n\t\t\t$this->validateMode();\n\t\t\t$this->validateClasses();\n\t\t\t$this->validateTestData();\n\t\t}\n\t}", "public function _getValidationErrors()\n {\n $errs = parent::_getValidationErrors();\n $validationRules = $this->_getValidationRules();\n if (null !== ($v = $this->getCity())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_CITY] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getCountry())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_COUNTRY] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getDistrict())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_DISTRICT] = $fieldErrs;\n }\n }\n if ([] !== ($vs = $this->getLine())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_LINE, $i)] = $fieldErrs;\n }\n }\n }\n if (null !== ($v = $this->getPeriod())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_PERIOD] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getPostalCode())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_POSTAL_CODE] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getState())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_STATE] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getText())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_TEXT] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getType())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_TYPE] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getUse())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_USE] = $fieldErrs;\n }\n }\n if (isset($validationRules[self::FIELD_CITY])) {\n $v = $this->getCity();\n foreach($validationRules[self::FIELD_CITY] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_ADDRESS, self::FIELD_CITY, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_CITY])) {\n $errs[self::FIELD_CITY] = [];\n }\n $errs[self::FIELD_CITY][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_COUNTRY])) {\n $v = $this->getCountry();\n foreach($validationRules[self::FIELD_COUNTRY] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_ADDRESS, self::FIELD_COUNTRY, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_COUNTRY])) {\n $errs[self::FIELD_COUNTRY] = [];\n }\n $errs[self::FIELD_COUNTRY][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_DISTRICT])) {\n $v = $this->getDistrict();\n foreach($validationRules[self::FIELD_DISTRICT] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_ADDRESS, self::FIELD_DISTRICT, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_DISTRICT])) {\n $errs[self::FIELD_DISTRICT] = [];\n }\n $errs[self::FIELD_DISTRICT][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_LINE])) {\n $v = $this->getLine();\n foreach($validationRules[self::FIELD_LINE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_ADDRESS, self::FIELD_LINE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_LINE])) {\n $errs[self::FIELD_LINE] = [];\n }\n $errs[self::FIELD_LINE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_PERIOD])) {\n $v = $this->getPeriod();\n foreach($validationRules[self::FIELD_PERIOD] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_ADDRESS, self::FIELD_PERIOD, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_PERIOD])) {\n $errs[self::FIELD_PERIOD] = [];\n }\n $errs[self::FIELD_PERIOD][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_POSTAL_CODE])) {\n $v = $this->getPostalCode();\n foreach($validationRules[self::FIELD_POSTAL_CODE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_ADDRESS, self::FIELD_POSTAL_CODE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_POSTAL_CODE])) {\n $errs[self::FIELD_POSTAL_CODE] = [];\n }\n $errs[self::FIELD_POSTAL_CODE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_STATE])) {\n $v = $this->getState();\n foreach($validationRules[self::FIELD_STATE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_ADDRESS, self::FIELD_STATE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_STATE])) {\n $errs[self::FIELD_STATE] = [];\n }\n $errs[self::FIELD_STATE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_TEXT])) {\n $v = $this->getText();\n foreach($validationRules[self::FIELD_TEXT] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_ADDRESS, self::FIELD_TEXT, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_TEXT])) {\n $errs[self::FIELD_TEXT] = [];\n }\n $errs[self::FIELD_TEXT][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_TYPE])) {\n $v = $this->getType();\n foreach($validationRules[self::FIELD_TYPE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_ADDRESS, self::FIELD_TYPE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_TYPE])) {\n $errs[self::FIELD_TYPE] = [];\n }\n $errs[self::FIELD_TYPE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_USE])) {\n $v = $this->getUse();\n foreach($validationRules[self::FIELD_USE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_ADDRESS, self::FIELD_USE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_USE])) {\n $errs[self::FIELD_USE] = [];\n }\n $errs[self::FIELD_USE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_EXTENSION])) {\n $v = $this->getExtension();\n foreach($validationRules[self::FIELD_EXTENSION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_ELEMENT, self::FIELD_EXTENSION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_EXTENSION])) {\n $errs[self::FIELD_EXTENSION] = [];\n }\n $errs[self::FIELD_EXTENSION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_ID])) {\n $v = $this->getId();\n foreach($validationRules[self::FIELD_ID] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_ELEMENT, self::FIELD_ID, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_ID])) {\n $errs[self::FIELD_ID] = [];\n }\n $errs[self::FIELD_ID][$rule] = $err;\n }\n }\n }\n return $errs;\n }", "public function validateEditAngle($data)\n {\n self::$rules = [\n 'name' => 'required',\n 'result' => 'required',\n ];\n $this->validate($data);\n }", "public static function validateAnnual_Income_DataForArrayConstraintsFromSetAnnual_Income_Data(array $values = array())\n {\n $message = '';\n $invalidValues = [];\n foreach ($values as $dependent_DataTypeAnnual_Income_DataItem) {\n // validation for constraint: itemType\n if (!$dependent_DataTypeAnnual_Income_DataItem instanceof \\WorkdayWsdl\\\\StructType\\Annual_Income_DataType) {\n $invalidValues[] = is_object($dependent_DataTypeAnnual_Income_DataItem) ? get_class($dependent_DataTypeAnnual_Income_DataItem) : sprintf('%s(%s)', gettype($dependent_DataTypeAnnual_Income_DataItem), var_export($dependent_DataTypeAnnual_Income_DataItem, true));\n }\n }\n if (!empty($invalidValues)) {\n $message = sprintf('The Annual_Income_Data property can only contain items of type \\WorkdayWsdl\\\\StructType\\Annual_Income_DataType, %s given', is_object($invalidValues) ? get_class($invalidValues) : (is_array($invalidValues) ? implode(', ', $invalidValues) : gettype($invalidValues)));\n }\n unset($invalidValues);\n return $message;\n }", "protected function prepareForValidation()\n {\n if($this->name != null) {\n $this->merge([\n 'name' => filter_var($this->name, FILTER_SANITIZE_STRING),\n ]);\n }\n\n if($this->email != null) {\n $this->merge([\n 'email' => filter_var(trim($this->email), FILTER_SANITIZE_EMAIL),\n ]);\n }\n\n if($this->leader != null) {\n $this->merge([\n 'leader' => filter_var($this->leader, FILTER_SANITIZE_STRING),\n ]);\n }\n\n if($this->gruplac != null) {\n $this->merge([\n 'gruplac' => filter_var(trim($this->gruplac), FILTER_SANITIZE_URL),\n ]);\n }\n\n if($this->minciencias_code != null) {\n $this->merge([\n 'minciencias_code' => filter_var(trim($this->minciencias_code), FILTER_SANITIZE_STRING),\n ]);\n }\n\n if($this->minciencias_category != null) {\n $this->merge([\n 'minciencias_category' => filter_var($this->minciencias_category, FILTER_SANITIZE_STRING),\n ]);\n }\n\n if($this->website != null) {\n $this->merge([\n 'website' => filter_var(trim($this->website), FILTER_SANITIZE_URL),\n ]);\n }\n\n if($this->educational_institution_id != null) {\n $this->merge([\n 'educational_institution_id' => (integer) filter_var($this->educational_institution_id, FILTER_SANITIZE_NUMBER_INT),\n ]);\n }\n }" ]
[ "0.6410474", "0.62148154", "0.61932635", "0.6142784", "0.5984186", "0.5918877", "0.5875359", "0.58193713", "0.581505", "0.5740609", "0.5725442", "0.57217234", "0.5712102", "0.56930876", "0.56847066", "0.5679649", "0.5667135", "0.565881", "0.5657518", "0.5656773", "0.56491315", "0.56484634", "0.56171066", "0.559716", "0.559111", "0.55738914", "0.55716085", "0.55656815", "0.5561742", "0.55588573", "0.5545107", "0.5541408", "0.5519507", "0.5512298", "0.5482517", "0.54808843", "0.5474898", "0.54668874", "0.5457661", "0.5441342", "0.542323", "0.54220057", "0.5420753", "0.54045415", "0.5399782", "0.53974795", "0.53941983", "0.53880876", "0.5375841", "0.53733295", "0.5364909", "0.5363985", "0.53604305", "0.5360196", "0.5355611", "0.53490514", "0.5331011", "0.5326275", "0.53255296", "0.5324973", "0.53247184", "0.53225565", "0.5321235", "0.53111285", "0.53068984", "0.53056526", "0.5303555", "0.5303555", "0.53019464", "0.5291078", "0.5288481", "0.5284013", "0.52802676", "0.527777", "0.52753407", "0.52667934", "0.52656007", "0.5255166", "0.5247175", "0.52419454", "0.5234234", "0.52329856", "0.52319574", "0.5227813", "0.5227813", "0.5220421", "0.5212603", "0.52121675", "0.52080554", "0.5207038", "0.5205168", "0.52020985", "0.5199256", "0.5196657", "0.51965874", "0.5196379", "0.5195881", "0.5192914", "0.51923543", "0.51880896" ]
0.6550004
0
Add item to Compensation_Data value
public function addToCompensation_Data(\WorkdayWsdl\\StructType\Compensation_DataType $item) { // validation for constraint: itemType if (!$item instanceof \WorkdayWsdl\\StructType\Compensation_DataType) { throw new \InvalidArgumentException(sprintf('The Compensation_Data property can only contain items of type \WorkdayWsdl\\StructType\Compensation_DataType, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__); } $this->Compensation_Data[] = $item; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function addToCompensation_Detail_Data(\\WorkdayWsdl\\\\StructType\\Compensation_Detail_DataType $item)\n {\n // validation for constraint: itemType\n if (!$item instanceof \\WorkdayWsdl\\\\StructType\\Compensation_Detail_DataType) {\n throw new \\InvalidArgumentException(sprintf('The Compensation_Detail_Data property can only contain items of type \\WorkdayWsdl\\\\StructType\\Compensation_Detail_DataType, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__);\n }\n $this->Compensation_Detail_Data[] = $item;\n return $this;\n }", "public function append($item)\n {\n array_push($this->activeValue, $item);\n }", "public function addToCOBRA_Eligibility_Data(\\WorkdayWsdl\\\\StructType\\COBRA_Eligibility_DataType $item)\n {\n // validation for constraint: itemType\n if (!$item instanceof \\WorkdayWsdl\\\\StructType\\COBRA_Eligibility_DataType) {\n throw new \\InvalidArgumentException(sprintf('The COBRA_Eligibility_Data property can only contain items of type \\WorkdayWsdl\\\\StructType\\COBRA_Eligibility_DataType, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__);\n }\n $this->COBRA_Eligibility_Data[] = $item;\n return $this;\n }", "public function add() {\n $dataH['CustomerBankAccount'] = $_lib['sess']->get_companydef('BankAccount');\n $old_pattern = array(\"/[^0-9]/\");\n $new_pattern = array(\"\");\n $dataH['CustomerAccountPlanID'] = strtolower(preg_replace($old_pattern, $new_pattern , $_lib['sess']->get_companydef('OrgNumber')));\n }", "function addItemForUpdate($item) {\n $this->_update[$item->getId()] = $item;\n }", "public function addItem(Array $item)\n {\n $this->item[] = $item;\n }", "public function writeItem($item)\n {\n $this->data[] = $item;\n }", "public function onBeforeApplySave(&$data) {\n // require helper file\n JLoader::register('MdfuelHelperReceipts', JPATH_COMPONENT.'/helpers/receipts.php');\n $model = $this->getThisModel();\n $item = $model->getItem();\n\n $jinput = JFactory::getApplication()->input;\n $liters = $jinput->get('liters');\n $liter_prijs = $jinput->get('liter_prijs');\n $carid = $jinput->get('mdfuel_car_id');\n $fueltype = MdfuelHelperReceipts::getFuelType($carid);\n $tankbedrag = $liters * $liter_prijs;\n $data['tankbedrag'] = $tankbedrag;\n $data['fuel'] = $fueltype;\n return $data;\n}", "public function add($item)\n {\n $this->manuallyAddedData[] = $item;\n }", "public function add_deal($data_arr,&$validation_passed,&$new_transaction_id,&$err_arr){\n\t\tdie(\"NO LONGER USED\");\n \n }", "public function add()\n {\n $item = new stdClass();\n $item->item_id = null;\n $item->barcode = null;\n $item->price = null;\n $item->stock = null;\n $item->name = null;\n $item->category_id = null;\n $query_category = $this->categorys_m->get();\n $query_unit = $this->units_m->get();\n $unit[null] = '-Pilih-';\n foreach ($query_unit->result() as $u) {\n\n $unit[$u->unit_id] = $u->name;\n };\n $data = [\n 'page' => 'add',\n 'row' => $item,\n 'category' => $query_category,\n 'unit' => $unit,\n 'selectedunit' => null\n ];\n $this->template->load('template', 'product/item/item_add', $data);\n }", "function addToBatch($item, $values) {\n $item['rowValues'] = $values;\n $item['allowUpdate'] = $this->_allowEntityUpdate;\n $item['ignoreCase'] = $this->_ignoreCase;\n $this->_importQueueBatch[] = $item;\n }", "private function append($value)\n {\n \t$this->values[] = $value;\n }", "public function setModuleData(){\n\t\t/* variable initialization */\n\t\t$this->_strSchemaName\t.= \"_\".$this->getCompanyCode();\n\t\t$intRespone\t\t\t\t= \"\";\n\t\t\n\t\t/* Setting the Pokicy filed */\n\t\tif((isset($this->_strDataSet['policy'])) && (!empty($this->_strDataSet['policy']))){\n\t\t\t/* Iterating the loop */\n\t\t\tforeach($this->_strDataSet['policy'] as $strPlicyKey => $strPolicyValue){\n\t\t\t\t/* Decoding the value */\n\t\t\t\t$this->_strDataSet['policy'][$strPlicyKey]\t= getDecyptionValue($strPolicyValue);\n\t\t\t}\n\t\t\t/* Imploding the value */\n\t\t\t$this->_strDataSet['policy']\t\t= implode(\",\",$this->_strDataSet['policy']);\n\t\t}else{\n\t\t\t/* Setting the value */\n\t\t\t$this->_strDataSet['policy']\t= \"\";\n\t\t}\n\t\t\n\t\t/* Set the operation filter array */\n\t\t$strEventFilterArr \t= array(\n\t\t\t\t\t\t\t\t\t\t'table' \t=> $this->_strSchemaName,\n\t\t\t\t\t\t\t\t\t\t'data' \t\t=> $this->_strDataSet,\n\t\t\t\t\t\t\t\t\t\t'where' \t=> array('id' => $this->_strDataSet['foreign']),\n\t\t\t\t\t\t\t\t\t);\n\t\t/* removed unwanted variables */\n\t\tunset($strEventFilterArr['data']['foreign']);\n\t\t\n\t\t/* Perfomaning the addition operation */\n\t\tif($this->_strDataSet['foreign'] == 0){\n\t\t\t/* add new records */\n\t\t\t$intResultStatus = $this->_objDataOperation->setDataInTable($strEventFilterArr);\n\t\t/* Perfomaning the update operation */\n\t\t}else{\n\t\t\t/* update the existing records */\n\t\t\t$intResultStatus = $this->_objDataOperation->setUpdateData($strEventFilterArr);\n\t\t}\n\t\t/* removed used variables */\n\t\tunset($strResultArr);\n\t\t\n\t\t/* return the operation status */\n\t\treturn $intResultStatus;\n\t}", "private function cObjDataAddArray( $keyValue )\n {\n foreach ( $keyValue as $key => $value )\n {\n if ( empty( $key ) )\n {\n continue;\n }\n\n $this->pObj->cObj->data[ $key ] = $value;\n\n if ( !( $this->pObj->b_drs_map || $this->pObj->b_drs_warn ) )\n {\n continue;\n }\n\n if ( $value === null )\n {\n if ( $this->pObj->b_drs_warn )\n {\n $prompt = $key . ' is null. Maybe this is an error!';\n t3lib_div :: devLog( '[WARN/BROWSERMAPS] ' . $prompt, $this->pObj->extKey, 2 );\n }\n }\n else\n {\n if ( $this->pObj->b_drs_map )\n {\n $prompt = 'Added to cObject[' . $key . ']: ' . $value;\n t3lib_div :: devLog( '[INFO/BROWSERMAPS] ' . $prompt, $this->pObj->extKey, 0 );\n $prompt = 'You can use the content in TypoScript with: field = ' . $key;\n t3lib_div :: devLog( '[INFO/BROWSERMAPS] ' . $prompt, $this->pObj->extKey, 0 );\n }\n }\n }\n }", "public function addToHas_Health_Insurance_Data(\\WorkdayWsdl\\\\StructType\\Has_Health_Insurance_DataType $item)\n {\n // validation for constraint: itemType\n if (!$item instanceof \\WorkdayWsdl\\\\StructType\\Has_Health_Insurance_DataType) {\n throw new \\InvalidArgumentException(sprintf('The Has_Health_Insurance_Data property can only contain items of type \\WorkdayWsdl\\\\StructType\\Has_Health_Insurance_DataType, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__);\n }\n $this->Has_Health_Insurance_Data[] = $item;\n return $this;\n }", "public function addDiscount(AdjustmentDataInterface $discount)\n {\n $this->discounts[] = $discount;\n }", "function addItem2DB($data = null)\n {\n if ($this->isAdmin() == TRUE) {\n $this->loadThis();\n } else {\n $result = $_POST['itemInfo'];\n echo $this->coupon_model->add($result);\n }\n }", "public function append($table, $item) {\r\n saprfc_table_append($this->fce, $table, array(\"LINE\" => \"\" . $item . \"\"));\r\n $this->arrayDebug['APPEND'][$table][] = $item;\r\n }", "public function addToResponse_Group(\\WorkdayWsdl\\\\StructType\\Workers_Compensation_Code_Response_GroupType $item)\n {\n // validation for constraint: itemType\n if (!$item instanceof \\WorkdayWsdl\\\\StructType\\Workers_Compensation_Code_Response_GroupType) {\n throw new \\InvalidArgumentException(sprintf('The Response_Group property can only contain items of type \\WorkdayWsdl\\\\StructType\\Workers_Compensation_Code_Response_GroupType, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__);\n }\n $this->Response_Group[] = $item;\n return $this;\n }", "public function appendEquipmentingItem($value)\n {\n return $this->append(self::EQUIPMENTING_ITEM, $value);\n }", "public function addDatas(\\RO\\Cmd\\ItemData $value){\n return $this->_add(5, $value);\n }", "private function addData ()\n {\n foreach ($this->data as $key=>$value)\n {\n $keys[] = $key;\n $values[] = $value;\n \n }\n $cols = implode($keys, \",\");\n $dataValues = \"'\".implode($values, \"','\").\"'\";\n $query = \"INSERT INTO `$this->tablename`($cols)VALUES($dataValues);\";\n \n $conn = $this->DB->conn;\n \n $sql = $conn->query($query);\n \n if($sql == TRUE) return TRUE;\n else \n {\n \n throw new Exception(\"Error : Data Not inserted to database :( \".$conn->error);\n \n }\n \n }", "public function AddData ($key, $value) {\n\t\t$this->data[$key] = $value;\t\t\t\t\n\t}", "public function addExpense($table, $data)\n {\n\n if (isset($data)) {\n $result=$this->dynamicInsert($table, $data);\n }\n }", "function addstock($uketoru_item, $uketoru_num){\n\tglobal $item;\n\tglobal $num_item;\n\t// echo $uketoru_item, '<br />', $uketoru_num, '<br />';\n\t// echo gettype($item), '<br />';\n\t# checking whether or not the item is in the data and its position\n\t$yes_no = in_array($uketoru_item, $item);\n\t$position = array_search($uketoru_item, $item);\n\t\n\t// echo 'in_array', '<br />' ,(boolean) $yes_no , '<br />','<br />';\n\t// echo 'position', '<br />', $position , '<br />';\n\n\t//echo $address;\n\tif($yes_no == 0){\n\t// $uketoru_item is not in array data \n\techo \"the item is not in the data.\",'<br />';\n\t# add the item in the data\n\tarray_push($item, $uketoru_item);\n\tarray_push($num_item, $uketoru_num);\n\t// echo $item[0],'<br />', $num_item[0],'<br />';\n\n\t}else{\n\t# $uketoru_item\n\t\"the item is in the data and is stocked.\";\n\t# add the stock on the item\n\t// echo \"yes_no\", '<br />', $yes_no, '<br />';\n\t$num_item[$position] = $num_item[$position] + $uketoru_num;\n\n\t}\n}", "final public function addItemGroupTechInCharge() {\n if (!empty($this->target_object)) {\n foreach ($this->target_object as $val) {\n if ($val->fields['groups_id_tech'] > 0) {\n $this->addForGroup(0, $val->fields['groups_id_tech']);\n }\n }\n }\n }", "function add()\n\t{\n\t\t$this->_updatedata();\n\t}", "function appendAllListOfValuesToItem(&$item) {\n $iter = $item->getMetadataIterator();\n $this->appendAllListOfValues($iter);\n }", "public function addData()\r\n {\r\n\r\n $this->datecreated = time();\r\n $sql = 'INSERT INTO ' . TABLE_PREFIX . 'stat_productstock (\r\n p_barcode,\r\n sd_value,\r\n sd_month,\r\n sd_year,\r\n day_1,\r\n day_2,\r\n day_3,\r\n day_4,\r\n day_5,\r\n day_6,\r\n day_7,\r\n day_8,\r\n day_9,\r\n day_10,\r\n day_11,\r\n day_12,\r\n day_13,\r\n day_14,\r\n day_15,\r\n day_16,\r\n day_17,\r\n day_18,\r\n day_19,\r\n day_20,\r\n day_21,\r\n day_22,\r\n day_23,\r\n day_24,\r\n day_25,\r\n day_26,\r\n day_27,\r\n day_28,\r\n day_29,\r\n day_30,\r\n day_31,\r\n sd_datecreated,\r\n sd_datemodified\r\n )\r\n VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)';\r\n $rowCount = $this->db3->query($sql, array(\r\n (string)$this->pbarcode,\r\n (string)$this->value,\r\n (int)$this->month,\r\n (int)$this->year,\r\n (string)$this->day_1,\r\n (string)$this->day_2,\r\n (string)$this->day_3,\r\n (string)$this->day_4,\r\n (string)$this->day_5,\r\n (string)$this->day_6,\r\n (string)$this->day_7,\r\n (string)$this->day_8,\r\n (string)$this->day_9,\r\n (string)$this->day_10,\r\n (string)$this->day_11,\r\n (string)$this->day_12,\r\n (string)$this->day_13,\r\n (string)$this->day_14,\r\n (string)$this->day_15,\r\n (string)$this->day_16,\r\n (string)$this->day_17,\r\n (string)$this->day_18,\r\n (string)$this->day_19,\r\n (string)$this->day_20,\r\n (string)$this->day_21,\r\n (string)$this->day_22,\r\n (string)$this->day_23,\r\n (string)$this->day_24,\r\n (string)$this->day_25,\r\n (string)$this->day_26,\r\n (string)$this->day_27,\r\n (string)$this->day_28,\r\n (string)$this->day_29,\r\n (string)$this->day_30,\r\n (string)$this->day_31,\r\n (int)$this->datecreated,\r\n (int)$this->datemodified\r\n ))->rowCount();\r\n\r\n $this->id = $this->db3->lastInsertId();\r\n return $this->id;\r\n }", "private function setItem(array $itemData)\n {\n //====================================================================//\n // Safety Check\n if ((!$this->item instanceof WC_Order_Item_Shipping) && (!$this->item instanceof WC_Order_Item_Fee)) {\n return;\n }\n //====================================================================//\n // Update Name\n if (isset($itemData[\"name\"])) {\n $this->setGeneric(\"_name\", $itemData[\"name\"], \"item\");\n }\n //====================================================================//\n // Update Quantity\n $qty = $itemData[\"quantity\"] ?? 1;\n //====================================================================//\n // Update Unit Price\n if (isset($itemData[\"subtotal\"])) {\n // Compute Expected Total\n $total = $qty * self::prices()->taxExcluded($itemData[\"subtotal\"]);\n // Compute Expected Total Tax Incl.\n $totalTax = $qty * self::prices()->taxAmount($itemData[\"subtotal\"]);\n // There is NO Discount\n } else {\n $total = $this->item->get_total();\n $totalTax = $this->item->get_total_tax();\n }\n //====================================================================//\n // Update Item Taxes\n if ($totalTax != $this->item->get_total_tax()) {\n $this->setItemTaxArray('total', (float) $totalTax);\n }\n //====================================================================//\n // Update Item Totals\n $this->setGeneric(\"_total\", $total, \"item\");\n }", "public function addNewStructureRow(){\n\t\t$map_id = $this->Generic_model->general_fetch_array_return_row('map_attributes_values', array('attribute_id'=>$this->input->post('newStructureAttr'), 'value'=>$this->input->post('newStructureValue')))->map_id;\n\t\t$onSale = '1';\n\t\tif($this->input->post('onSaleStruct') == ''){\n\t\t\t$onSale = '0';\n\t\t}\n\t\t$details = array(\n\t\t\t'pid' => $this->uri->segment(4),\n\t\t\t'map_id' => $map_id,\n\t\t\t'retail_price' => $this->input->post('price'),\n\t\t\t'retail_price_tax' => $this->input->post('priceTax'),\n\t\t\t'cost_price' => $this->input->post('costPrice'),\n\t\t\t'on_sale_status' => $onSale\n\t\t);\n\t\t$response = $this->Generic_model->general_insert('pricing_structure', $details);\n\t\tif($response){\n\t\t\t$this->session->set_flashdata('success', 'Product Updated successfully with new pricing structure.');\n\t\t}else{\n\t\t\t$this->session->set_flashdata('failure', 'Oops!! Something went wrong. Try again...');\n\t\t}\n\t\tredirect('admin/product/editProduct/'.$this->uri->segment(4));\n\t}", "function Add($name, $value)\r\n\t{\r\n\t\tif (is_array($this->Data))\r\n\t\t{\r\n\t\t\t$this->Data[$name] = $value;\t\r\n\t\t}\t\r\n\t\telse if (is_object($this->Data))\r\n\t\t{\r\n\t\t\t$this->Data->$name = $value;\t\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\ttrigger_error(\"A DataRow of base type, cannot have fields added.\",E_USER_ERROR);\t\r\n\t\t}\r\n\t\t\r\n\t}", "public function addToOccupation_Data(\\WorkdayWsdl\\\\StructType\\Occupation_DataType $item)\n {\n // validation for constraint: itemType\n if (!$item instanceof \\WorkdayWsdl\\\\StructType\\Occupation_DataType) {\n throw new \\InvalidArgumentException(sprintf('The Occupation_Data property can only contain items of type \\WorkdayWsdl\\\\StructType\\Occupation_DataType, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__);\n }\n $this->Occupation_Data[] = $item;\n return $this;\n }", "function OnAfterAdd(){\n //get keyfield value\n if (intval($this->item_id) == 0)\n $data = $this->Storage->GetRecord(null, array(\n $this->key_field => \"\"));\n $this->item_id = $data[$this->key_field];\n }", "public function addToAnnual_Income_Data(\\WorkdayWsdl\\\\StructType\\Annual_Income_DataType $item)\n {\n // validation for constraint: itemType\n if (!$item instanceof \\WorkdayWsdl\\\\StructType\\Annual_Income_DataType) {\n throw new \\InvalidArgumentException(sprintf('The Annual_Income_Data property can only contain items of type \\WorkdayWsdl\\\\StructType\\Annual_Income_DataType, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__);\n }\n $this->Annual_Income_Data[] = $item;\n return $this;\n }", "public function append($value)\n {\n $this->items[] = $value;\n }", "function updateCompanyIdOrContactIdToListElem(&$arFields){\n\n if($arFields['IBLOCK_ID'] == 125 /*&& $arFields['PROPERTY_VALUES']['592']['n0']['VALUE'] == ''*/){\n $arFields['PROPERTY_VALUES']['592']['n0']['VALUE'];\n //file_put_contents($file, $arFields['PROPERTY_VALUES']['593']['n0']['VALUE'], FILE_APPEND | LOCK_EX);\n\n foreach ($arFields['PROPERTY_VALUES']['593'] as $number => $dealId){\n $ID = $dealId['VALUE'];\n $key = $number;\n }\n\n //Берем данные сделки по id\n //$dealData = CCrmDeal::GetByID($arFields['PROPERTY_VALUES']['593']['43585']['VALUE']);\n $dealData = CCrmDeal::GetByID($ID);\n if($dealData['COMPANY_ID'] != '') {\n $arFields['PROPERTY_VALUES']['592'][$key]['VALUE'] = 'CO_'.$dealData['COMPANY_ID'];\n }\n if($dealData['COMPANY_ID'] == 0 && $dealData['CONTACT_ID'] != '') {\n $arFields['PROPERTY_VALUES']['592'][$key]['VALUE'] = 'C_'.$dealData['CONTACT_ID'];\n }\n\n /* $file = $_SERVER['DOCUMENT_ROOT'].'/local/testLogger3.log';\n file_put_contents($file, print_r($arFields,true), FILE_APPEND | LOCK_EX);*/\n\n return true;\n\n }\n\n}", "function store()\r\n {\r\n $db =& eZDB::globalDatabase();\r\n $db->begin();\r\n\r\n $this->Name = $db->escapeString( $this->Name );\r\n $this->Sign = $db->escapeString( $this->Sign );\r\n\r\n if ( $this->Value == \"\" )\r\n {\r\n $this->Value = 1;\r\n }\r\n \r\n if ( !isset( $this->ID ) )\r\n {\r\n $timeStamp =& eZDateTime::timeStamp( true );\r\n $db->lock( \"eZTrade_AlternativeCurrency\" );\r\n $nextID = $db->nextID( \"eZTrade_AlternativeCurrency\", \"ID\" );\r\n \r\n $res[] = $db->query( \"INSERT INTO eZTrade_AlternativeCurrency\r\n ( ID,\r\n\t\t Name,\r\n\t\t Sign,\r\n\t\t Value,\r\n\t\t Created,\r\n\t\t PrefixSign )\r\n VALUES\r\n\t\t ( '$nextID',\r\n '$this->Name',\r\n\t\t '$this->Sign',\r\n\t\t '$this->Value',\r\n\t\t '$timeStamp',\r\n\t\t '$this->PrefixSign' )\" );\r\n $db->unlock();\r\n\t\t\t$this->ID = $nextID;\r\n }\r\n else\r\n {\r\n $res[] = $db->query( \"UPDATE eZTrade_AlternativeCurrency SET\r\n\t\t Name='$this->Name',\r\n\t\t Sign='$this->Sign',\r\n\t\t Value='$this->Value',\r\n\t\t Created=Created,\r\n\t\t PrefixSign='$this->PrefixSign'\r\n WHERE ID='$this->ID'\" );\r\n }\r\n\r\n eZDB::finish( $res, $db );\r\n return true;\r\n }", "final public function save() {\n $db = Database::getInstance();\n $mysqli = $db->getConnection();\n\t\n\t//Insert into database if its a new component or update if its an existing one\n $sql_query = 'INSERT INTO fresco_costing_component_array (component_id,component_type_id,quote_id,component_name,metal,powdercoating,fabric,processing,wastage,installation,margin,other) VALUES (';\n $sql_query .= '\"'.$this->_component_id.'\",';\n $sql_query .= '\"'.$this->_component_type_id.'\",';\n $sql_query .= '\"'.$this->_quote_id.'\",';\n $sql_query .= '\"'.$this->component_name.'\",';\n $sql_query .= '\"'.$this->metal.'\",';\n $sql_query .= '\"'.$this->powdercoating.'\",';\n $sql_query .= '\"'.$this->fabric.'\",';\n $sql_query .= '\"'.$this->processing.'\",';\n $sql_query .= '\"'.$this->wastage.'\",';\n $sql_query .= '\"'.$this->installation.'\",';\n $sql_query .= '\"'.$this->margin.'\",';\n $sql_query .= '\"'.$this->other.'\"';\n $sql_query .= ') ON DUPLICATE KEY UPDATE ';\n $sql_query .= 'component_type_id = \"' . $this->_component_type_id . '\", ';\n $sql_query .= 'quote_id = \"' . $this->_quote_id . '\", ';\n $sql_query .= 'component_name = \"' . $this->component_name . '\", ';\n $sql_query .= 'metal = \"' . $this->metal . '\", ';\n $sql_query .= 'powdercoating = \"' . $this->powdercoating . '\", ';\n $sql_query .= 'fabric = \"' . $this->fabric . '\", ';\n $sql_query .= 'processing = \"' . $this->processing . '\", ';\n $sql_query .= 'wastage = \"' . $this->wastage . '\", ';\n $sql_query .= 'installation = \"' . $this->installation . '\", ';\n $sql_query .= 'margin = \"' . $this->margin . '\", ';\n $sql_query .= 'other = \"' . $this->other . '\"';\n \n $result = $mysqli->query($sql_query);\n if (!$result) {\n trigger_error('Unable to write to database : SQL query : ' . $sql_query);\n }\n\treturn;\n }", "function AddItem($item, $object = null, $itemkey = null)\r\n {\r\n if($object != null)\r\n {\r\n throw new Exception('ObjectNew1 functionallity for RadioGroup is not yet implemented.');\r\n }\r\n\r\n //Set the array to the end\r\n end($this->_items);\r\n\r\n //Adds the item as the last one\r\n if($itemkey != null)\r\n {\r\n $this->_items[$itemkey] = $item;\r\n }\r\n else\r\n {\r\n $this->_items[] = $item;\r\n }\r\n\r\n return ($this->Count);\r\n }", "function addItemAtBeginOfCompanies($item){\n\t\t\t\t$this->addItemAtBeginOf($this->companies, $item);\n\t\t\t}", "public function modify_row(&$p_arrRow)\n {\n if ($p_arrRow['isys_cats_chassis_slot_list__insertion'] == C__INSERTION__FRONT)\n {\n $p_arrRow['isys_cats_chassis_slot_list__insertion'] = _L('LC__UNIVERSAL__FRONT');\n }\n else\n {\n $p_arrRow['isys_cats_chassis_slot_list__insertion'] = _L('LC__UNIVERSAL__REAR');\n } // if\n\n $l_assigned_items = $this->m_cat_dao->get_assigned_chassis_items_by_cat_id($p_arrRow['isys_cats_chassis_slot_list__id']);\n\n if (is_array($l_assigned_items) && count($l_assigned_items) > 0)\n {\n $p_arrRow['assigned_items'] = [];\n $l_chassis_dao = isys_cmdb_dao_category_s_chassis::instance($this->m_db);\n\n foreach ($l_assigned_items as $l_item)\n {\n $p_arrRow['assigned_items'][] = $l_chassis_dao->get_assigned_device_title_by_cat_id($l_item['isys_cats_chassis_list__id'], false);\n } // foreach\n } // if\n }", "public function addEntries($entryValues, $producingCl) {\n\t\t\t$updatedEntryValues = $entryValues;\n\t\t\tif ($producingCl) {\n\t\t\t\t// this entry's time minus previous entry's time, unless there is no previous entry\n\t\t\t\tif (count($this->entries) == 0) {\n\t\t\t\t\t$timeDifference = 0;\n\t\t\t\t} else {\n\t\t\t\t\t$timeDifference = $entryValues[0] - $this->entries[(count($this->entries) - 1)][0]; \t\n\t\t\t\t}\n\n\t\t\t\t$flowrate = $entryValues[2];\n\t\t\t\t// L of chlorine produced during the $timeDifference measured in seconds\n\t\t\t\t$chlorineProduced = ($flowrate * ($timeDifference / 60.0)) / 1000;\n\t\t\t\t$this->totalChlorineProduced += $chlorineProduced;\n\t\t\t} else {\n\t\t\t\t$chlorineProduced = 0.0;\n\t\t\t}\n\t\t\t$updatedEntryValues[] = $chlorineProduced;\n\t\t\t$this->entries[] = $updatedEntryValues;\n\n\t\t\t// Check entry values for errors/warnings\n\t\t\t$this->updateCycleStatus($entryValues[5], $entryValues[4], $entryValues[2], $entryValues[6]);\n\t\t}", "public function addNew($data) {\r\n \t$roomDiscount = $this->findByUnique($data[self::ROOM], $data[self::RULE]);\r\n \tif (empty($roomDiscount)) {\r\n \t\treturn $this->insert($data);\r\n \t} else {\r\n \t\treturn $roomDiscount->id;\r\n \t}\r\n }", "public function updateStock()\n {\n// foreach($this->detalle_compras as $detalle)\n// {\n// $producto= Producto::model()->findByPk($detalle->producto);\n// $producto->stock+=$detalle->cantidad;\n// $producto->save();\n// }\n }", "public function addItem($item)\n {\n if ($item instanceof \\Fastbill\\Item\\Item)\n {\n $this['ITEMS'][] = $item;\n }\n else\n {\n $itemObj = new \\Fastbill\\Item\\Item();\n $itemObj->fillFromArray($item);\n $this['ITEMS'];\n }\n\n }", "public function addToPersonal_Info_Data(\\WorkdayWsdl\\\\StructType\\Personal_Info_DataType $item)\n {\n // validation for constraint: itemType\n if (!$item instanceof \\WorkdayWsdl\\\\StructType\\Personal_Info_DataType) {\n throw new \\InvalidArgumentException(sprintf('The Personal_Info_Data property can only contain items of type \\WorkdayWsdl\\\\StructType\\Personal_Info_DataType, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__);\n }\n $this->Personal_Info_Data[] = $item;\n return $this;\n }", "public function add() {\t\n CheckAdminLoginSession();\t\t\n\t\t$post_data = $this->input->post();\n\t\t\n\t\tif(!empty($post_data)) { \n\t\t\t$this->form_validation->set_error_delimiters('<span class=\"text-danger\">', '</span>');\n\t\t\t$this->form_validation->set_rules('name', ' Name', 'required|trim');\t\t\t\t\n\t\t\tif($this->form_validation->run() == FALSE) { } else {\n\t\tforeach ($this->input->post('company_id') as $key => $company_id) {\n\t\t\tforeach ($company_id as $insurance_type_id) {\n\t\t\t\t$data = array(\t\t\t\t\t\t\t\n\t\t\t\t'name' => $this->input->post('name'),\t\t\t\t\n\t\t\t\t'company_id' => $key,\t\t\t\t\n\t\t\t\t'insurance_type_id' => $insurance_type_id,\t\t\t\t\n\t\t\t\t'created_date' => date('Y-m-d H:i:s'),\n\t\t\t\t'modified_date' => date('Y-m-d H:i:s'),\n\t\t\t\t'status' => $this->input->post('status')\t \n\t\t\t\t); \n\t\t\t\t$id = $this->admin_model->setInsertData($this->optional_warranty,$data);\n\t\t\t}\n\t\t}\n\t\t\t\t$this->session->set_flashdata('message','Your Optional Warranty has been added successfully');\n\t\t redirect('admin/optional-warranty/lists','refresh');\n\t\t }\n }\n $data='';\n $data['companyProvidingInsurance'] = $this->admin_model->getCompanyProvidingInsurance($this->company_insurance);\n\t\t$this->load->view('admin/include/head');\n\t\t$this->load->view('admin/include/header');\n\t\t$this->load->view('admin/include/sidebar');\n\t\t$this->load->view('admin/optional_warranty/add',$data);\n\t\t$this->load->view('admin/include/footer');\n\t\t$this->load->view('admin/include/foot');\n\t}", "public static function insert_new_product_details($data)\n {\n try{\n \n $session = Yii::$app->session;\n foreach($data as $key=>$val) \n {\n if($key == 'hire_price' || $key == 'sale_price'){\n if($val != '')\n {\n $val=str_replace(',', '', $val );\n if (strpos($val, '.') !== false) {\n $val=substr($val,0,strpos($val, '.')+3);\n }\n }\n else\n {\n $val = 0;\n }\n }\n if($key == 'life_tax_details')\n {\n if(sizeof($val)>0){\n\n $val=implode(\",\",$val);\n }\n }\n if($key == 'exact_location')\n {\n if(sizeof($val)>0){\n\n $val=implode(\",\",$val);\n }\n }\n $$key=get_magic_quotes_gpc()?$val:addslashes($val);\n $insertdata[$key] = $$key;\n\n }\n \n if($insertdata['hire_price_range'] == 'crore')\n {\n \n $insertdata['hire_price'] = $insertdata['hire_price'] * 10000000;\n }\n else if($insertdata['hire_price_range'] == 'lack')\n {\n $insertdata['hire_price'] = $insertdata['hire_price'] * 100000;\n }\n else if($insertdata['hire_price_range'] == 'thousand')\n {\n $insertdata['hire_price'] = $insertdata['hire_price'] * 1000;\n }\n else if($insertdata['hire_price_range'] == 'por')\n {\n $insertdata['hire_price'] = -1;\n }\n \n if($insertdata['sale_price_range'] == 'crore')\n {\n $insertdata['sale_price'] = $insertdata['sale_price'] * 10000000;\n }\n else if($insertdata['sale_price_range'] == 'lack')\n {\n $insertdata['sale_price'] = $insertdata['sale_price'] * 100000;\n }\n else if($insertdata['sale_price_range'] == 'thousand')\n {\n $insertdata['sale_price'] = $insertdata['sale_price'] * 1000;\n }\n else if($insertdata['sale_price_range'] == 'por')\n {\n $insertdata['sale_price'] = -1;\n }\n \n unset($insertdata['hire_price_range']);\n unset($insertdata['sale_price_range']);\n \n\n $capacity = $insertdata['capacity'];\n $insertdata['capacity'] = $insertdata['capacity'].' '.$insertdata['capacity_metric']; \n unset($insertdata['capacity_metric']);\n\n if(!isset($model_other)) $insertdata['model_other']=''; \n $insertdata['product_status'] = 0; //update this when control panel complete\n\n $remove_keys = ['email','user_name','phone_number','password','regrepassword','company_name','designation','company_email','address','otp'];\n foreach($remove_keys as $removekey) unset($insertdata[$removekey]);\n\n //save equipment current location to productloaction array\n $productlocation = array();\n $current_location_keys = ['latitude','longitude','city','state','country','google_place_id','location_type']; \n foreach($current_location_keys as $key)\n {\n if($key == 'location_type')\n {\n $location[$key] = 1;\n }\n else\n {\n $location[$key] = $insertdata[$key];\n unset($insertdata[$key]);\n }\n }\n $productlocation[] = $location;\n unset($insertdata['street']);\n unset($insertdata['route']);\n unset($insertdata['zipcode']);\n\n //save equipment serving location to productloaction array\n if(isset($insertdata['exact_location']))\n {\n $exact_locations = explode(',',$insertdata['exact_location']);\n foreach($exact_locations as $exact_location)\n {\n $get_url_data=file_get_contents(\"http://maps.google.com/maps/api/geocode/json?address=\".urlencode($exact_location).\"&sensor=false\");\n $url_data=(array)json_decode($get_url_data);\n $url_data=$url_data['results'];\n $components=array_reverse($url_data[0]->address_components);\n $country\t=@$components[0]->long_name;\n $state\t\t=@$components[1]->long_name;\n $city\t\t=@$components[2]->long_name;\n $place_id=$url_data[0]->place_id;\n $lat=$url_data[0]->geometry->location->lat;\n $lng=$url_data[0]->geometry->location->lng;\n $location['latitude'] = $lat;\n $location['longitude'] = $lng;\n $location['city'] = $city;\n $location['state'] = $state;\n $location['country'] = $country;\n $location['google_place_id'] = $place_id;\n $location['location_type'] = 2;\n $productlocation[] = $location;\n }\n }\n unset($insertdata['exact_location']);\n unset($insertdata['_csrf']);\n unset($insertdata['product_type_check']);\n \n if ($insertdata['length'] == \"\"){ \n $insertdata['length'] =0; \n } \n if ($insertdata['width'] == \"\"){\n $insertdata['width'] =0; \n } \n if ($insertdata['height'] == \"\"){ \n $insertdata['height'] =0; \n } \n $insertdata['dimensions'] = $insertdata['length'].'x'.$insertdata['width'].'x'.$insertdata['height']; \n unset($insertdata['length']); \n unset($insertdata['width']); \n unset($insertdata['height']);\n \n //update amount if package type is free\n if($data['package_type'] != 2) { $data['package_amount'] = 0; }\n \n\n\n //get current user id\n $insertdata['user_id']=Yii::$app->user->getId(); \n \n $insertdata['updated_by'] = Yii::$app->user->id;\n $insertdata['date_updated'] = date('Y-m-d H:i:s');\n \n //insert data into database core_prodcuts table and get inserted product id\n Yii::$app->db->createCommand()->insert('core_products', $insertdata)->execute();\n $product_id = Yii::$app->db->getLastInsertID();\n\n $session->set('current_product_id', $product_id);\n\n //generate unique code for product and update\n //new logic start\n $categories = array('1'=>'C','2'=>'D','3'=>'E','4'=>'G','5'=>'P');//C-crane,D-dumper,E-excavator,G-generator,P-piling rigs\n $manual_product_code = $categories[$insertdata['category_id']];\n \n $subcategorycode = Productsubcategory::get_sub_category_code_by_id($insertdata['sub_category_id']);\n $manual_product_code .= $subcategorycode;\n \n if(strlen($capacity)>4)\n $manual_product_code .= substr($capacity, 0,4);\n else if(strlen($capacity)<=4)\n $manual_product_code .= str_pad($capacity, 4, '0', STR_PAD_LEFT);\n \n $producttype = array('0'=>'H','1'=>'S','2'=>'B'); //H-hire,S-sale,B-both\n $manual_product_code .=$producttype[$insertdata['product_type']];\n \n $manual_product_code .= strtoupper(str_pad(dechex($product_id), 5, '0', STR_PAD_LEFT));\n \n \n //new logic end\n Yii::$app->db->createCommand()->update('core_products', ['manual_product_code' => $manual_product_code], \"product_id = '$product_id'\")->execute();\n\n\n //save product current and serving locations using product id \n foreach($productlocation as $location)\n {\n $location['product_id'] = $product_id;\n Yii::$app->db->createCommand()->insert('core_product_locations', $location)->execute();\n }\n\n //get category name by id to get full path of the images & load charts upload for product\n $category_id = $insertdata['category_id'];\n $category_names = Productcategory::select_fields_by_category_id($category_id);\n $category_name= str_replace(' ', '_', $category_names[0]['category_name']);\n\n //save product images\n if(is_array($session->get('product_images')))\n {\n $product_images = $session->get('product_images');\n $original_image_name=$session->get('product_images_names');\n foreach($product_images as $index=>$product_image)\n {\n $images_data['product_id'] = $product_id;\n $images_data['image_name'] = $original_image_name[$index];\n $images_data['image_url'] = Yii::$app->params['SITE_URL'].'uploads/'.date('Y').'/'.$category_name.'/'.$product_image;\n $images_data['image_type'] = 1;\n $images_data['image_status'] = 1;\n \n //insert image details to database table.\n Yii::$app->db->createCommand()->insert('core_product_images', $images_data)->execute();\n\n }\n $session->remove('product_images');\n $session->remove('product_images_names');\n }\n //save product load_charts\n if(is_array($session->get('product_loadcharts')))\n {\n $product_load_charts = $session->get('product_loadcharts');\n $original_load_chart_name=$session->get('product_loadcharts_names');\n foreach($product_load_charts as $index=>$load_chart)\n {\n $load_charts_data['product_id'] = $product_id;\n $load_charts_data['image_name'] = $original_load_chart_name[$index];\n $load_charts_data['image_url'] = Yii::$app->params['SITE_URL'].'uploads/'.date('Y').'/'.$category_name.'/'.$load_chart;\n $load_charts_data['image_type'] = 2;\n $load_charts_data['image_status'] = 1;\n //insert load_charts details to database table.\n Yii::$app->db->createCommand()->insert('core_product_images', $load_charts_data)->execute();\n }\n $session->remove('product_loadcharts');\n $session->remove('product_loadcharts_names');\n }\n\n $response ['status'] = 200;\n $response ['message'] = \"Product added successfully\";\n\n \n /*//get current user email\n $email = User::select_user_email_by_id();\n $subject=\"Big Equipments India | Registration Of Equipment\";\n //get what message to send after creating product\n $message = Mail_settings::get_product_add_message($manual_product_code,$product_id);\n \n //send email to current user\n Mail_settings::send_email_notification($email,$subject,$message);*/\n\n return json_encode($response);\n \n } catch (ErrorException $ex) {\n Yii::warning('Error while adding new product.');\n Yii::warning($ex->getMessage());\n }\n \n }", "protected function registerData($data)\n\t{\n\t\t$mcoData = new Application_Model_DbTable_McoData();\n\t\t$mcoDataNew = $mcoData->createRow();\n\t\t$mcoDataNew->mco = $this->mcoId;\n\t\t$mcoDataNew->line = $data[1];\n\t\tif($data[3] == 'PD')\n\t\t\t$type = 1;\n\t\tif($data[3] == 'RI')\n\t\t\t$type = 2;\n\t\tif($data[3] == 'PI')\n\t\t\t$type = 3;\n\t\tif($data[3] == 'NT')\n\t\t\t$type = 4;\n\t\tif($data[3] == 'OU') //outros \n\t\t\t$type = 5;\n\t\tif($data[3] == 'AL') // alternativos\n\t\t\t$type = 6;\n\t\t$mcoDataNew->type = $type;\n\t\t$mcoDataNew->vehicle_number = $data[4];\n\t\t$mcoDataNew->start_hour = Application_Model_General::convertHour($data[5]);\n\t\t$mcoDataNew->mid_hour = Application_Model_General::convertHour($data[6]);\n\t\t$mcoDataNew->end_hour = Application_Model_General::convertHour($data[7]);\n\t\t$mcoDataNew->start_roulette = $data[8];\n\t\tif($data[9]) $mcoDataNew->mid_roulette = $data[9];\n\t\t$mcoDataNew->end_roulette = $data[10];\n\t\t$mcoDataNew->incident = $this->returnIncident($data[18]);\n\t\t$mcoDataNew->traffic_jam = $this->returnTrafficJam($data[19]);\n\t\t$mcoDataNew->travel_interrupted = $this->returnTravelInterrupted($data[17]);\n\t\t$amount_passenger = $data[10] - $data[8];\n\t\tif($amount_passenger<0){\n\t\t\t$amount_passenger = (100000-$data[8])+$data[10];\n\t\t}\n\t\t$mcoDataNew->amount_passenger = $amount_passenger;\n\t\t$this->countPassengers($data[1],$amount_passenger);\n\t\t$mcoDataNew->start_date = Application_Model_General::dateToUs($data[14]);\n\t\tif($data[15]) $mcoDataNew->mid_date = Application_Model_General::dateToUs($data[15]);\n\t\t$mcoDataNew->end_date = Application_Model_General::dateToUs($data[16]);\n\t\t$mcoDataNew->imported = 1;\n\t\t$mcoDataNew->status = 1;\n\t\t$mcoDataNew->save();\n\t}", "public function addData($dataRow, $productId)\n {\n $customData = &$dataRow['amasty_custom_data'];\n\n if (isset($this->effectiveDates[$productId])) {\n $customData[Product::PREFIX_OTHER_ATTRIBUTES] = [\n self::SALE_PRICE_EFFECITVEDATE_INDEX => $this->effectiveDates[$productId]\n ];\n } else {\n $customData[Product::PREFIX_OTHER_ATTRIBUTES] = [\n self::SALE_PRICE_EFFECITVEDATE_INDEX => \"\"\n ];\n }\n\n return $dataRow;\n }", "public function add_item($boat_id, $item, $type) {\n $data = array(\n 'BOAT_ID' => $boat_id,\n 'CL_DES' => $item,\n 'TYPE' => $type,\n 'CHECKED' => false\n );\n $this->db->insert('CL', $data);\n }", "public function add($item): self\n {\n // validation for constraint: itemType\n if (!$item instanceof \\StructType\\EwsCDRDataType) {\n throw new InvalidArgumentException(sprintf('The CDRData property can only contain items of type \\StructType\\EwsCDRDataType, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__);\n }\n return parent::add($item);\n }", "public function add_data($data)\n {\n }", "public function storeCommissionData($commissionDataArr) {\r\n $model = Mage::getModel('marketplace/commission');\r\n $duplicateProduct = $model->getCollection()\r\n ->addFieldToSelect('order_id')\r\n ->addFieldToFilter('order_id',$commissionDataArr['order_id'])\r\n ->addFieldToFilter('product_id',$commissionDataArr['product_id'])\r\n ->addFieldToFilter('seller_id',$commissionDataArr['seller_id']);\r\n if($duplicateProduct->getSize()){\r\n return false;\r\n }\r\n else {\r\n $model->setData($commissionDataArr);\r\n $model->save();\r\n return $model->getId();\r\n }\r\n }", "private function setDepositFromData()\n {\n if ($this->dataHasDeposit()) {\n $this->collection->items[$this->cart_hash]->deposit = $this->data['deposit'];\n $this->collection->deposit += $this->data['deposit'];\n }\n }", "public function addToInsurancePref($item)\n {\n // validation for constraint: itemType\n if (!false) {\n throw new \\InvalidArgumentException(sprintf('The InsurancePref property can only contain items of anyType, \"%s\" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__);\n }\n $this->InsurancePref[] = $item;\n return $this;\n }", "public function addDetail($data) {\r\n /* FILTER KELENGKAPAN TRANSAKSI BY JENIS ACCOUNT */\r\n if ($this->isValidCoa(array(\r\n 'coa' => $data['dkst_coa'],\r\n 'cbid' => ses_cabang)) == FALSE)\r\n return FALSE;\r\n\r\n if ($this->db->insert(\"ksr_dtrans\", $data) == FALSE) {\r\n return FALSE;\r\n } else {\r\n return TRUE;\r\n }\r\n }", "public function addItem($item){\n $this->items[] = $item;\n }", "public function insert()\n {\n $this->_checkItem();\n $service = $this->getService();\n $entry = $service->newItemEntry();\n $this->setEntry($entry);\n $this->_prepareEnrtyForSave();\n $this->getEntry()->setItemType($this->_getItemType());\n $entry = $service->insertGbaseItem($this->getEntry());\n $this->setEntry($entry);\n $entryId = $this->getEntry()->getId();\n $published = $this->gBaseDate2DateTime($this->getEntry()->getPublished()->getText());\n $this->getItem()\n ->setGbaseItemId($entryId)\n ->setPublished($published);\n\n if ($expires = $this->_getAttributeValue('expiration_date')) {\n $expires = $this->gBaseDate2DateTime($expires);\n $this->getItem()->setExpires($expires);\n }\n }", "public function add($data){\r\n \t$db = $this->getAdapter();\r\n \t$db->beginTransaction();\r\n\t\t$user_info = new Application_Model_DbTable_DbGetUserInfo();\r\n\t\t$result = $user_info->getUserInfo();\r\n\t\t$session_user=new Zend_Session_Namespace(SYSTEM_SES);\r\n\t\t$request=Zend_Controller_Front::getInstance()->getRequest();\r\n\t\t $level = $result[\"level\"];\r\n \ttry {\r\n \t\t$arr = array(\r\n \t\t\t'item_name'\t\t=>\t$data[\"name\"],\r\n \t\t\t'item_code'\t\t=>\t$data[\"pro_code\"],\r\n// \t\t\t'barcode'\t\t=>\t$data[\"barcode\"],\r\n \t\t\t'cate_id'\t\t=>\t$data[\"category_id\"],\r\n \t\t\t'product_type'\t=>\t$data[\"product_type\"],\r\n \t\t\t'cost_price'=>$data[\"cost_price\"],\r\n \t\t\t'selling_price'=>$data[\"selling_price\"],\r\n \t\t\t'user_id'\t\t=>\t$this->getUserId(),\r\n \t\t\t'note'\t\t\t=>\t$data[\"description\"],\r\n \t\t\t'create_date'\t\t=>\tdate(\"Y-m-d\"),\r\n \t\t\t\t\r\n \t\t);\r\n \t\t$this->_name=\"ln_ins_product\";\r\n \t\t$id = $this->insert($arr);\r\n\t\t\t\r\n \t\tif(!empty($data['identity'])){\r\n \t\t\t$identitys = explode(',',$data['identity']);\r\n \t\t\tforeach($identitys as $i)\r\n \t\t\t{\r\n \t\t\t\t$arr1 = array(\r\n \t\t\t\t\t'pro_id'\t\t\t=>\t$id,\r\n \t\t\t\t\t'location_id'\t\t=>\t$data[\"branch_id\".$i],\r\n \t\t\t\t\t'qty'\t\t\t\t=>\t$data[\"total_qty_\".$i],\r\n \t\t\t\t\t'qty_warning'\t\t=>\t$data[\"alert_qty\".$i],\r\n \t\t\t\t\t'last_mod_userid'\t=>\t$this->getUserId(),\r\n \t\t\t\t\t'last_mod_date'\t\t=>\tnew Zend_Date(),\r\n \t\t\t\t\t'last_mod_userid' => $this->getUserId(),\r\n \t\t\t\t);\r\n \t\t\t\t$this->_name = \"ln_ins_prolocation\";\r\n \t\t\t\t$this->insert($arr1);\r\n \t\t\t }\r\n \t\t }\r\n \t\t$db->commit();\r\n \t}catch (Exception $e){\r\n \t\t$db->rollBack();\r\n \t\tApplication_Model_DbTable_DbUserLog::writeMessageError($e->getMessage());\r\n \t}\r\n }", "public function save()\n {\n array_push($this->table, $this->value);\n }", "public function insert() {\n $this->observer->idchangemoney = $this->connection->insert(\"ren_change_money\", array(\n \"`change`\" => $this->observer->change,\n \"`year`\" => $this->observer->year,\n \"`idmoney`\" => $this->observer->money->idmoney\n ), $this->user->iduser);\n }", "public function addSales($item)\n\t{\n\n\t\t$sql=\"UPDATE item set sales_price = ? WHERE id = ? \";\n \tif($this->db->query($sql,$item)) {\n \n \t return true;\n \t }\n \t\treturn FALSE;\n\n\t}", "public function add($item, $id){\n $storedItem = ['qty' => 0,\n 'price'=>$item->price,\n 'item' => $item]; //servirá para os grupos, para nao tar a adicionar 2 da mesma coisa\n\n if($this->items){ //verificar se ja ha items no array\n if (array_key_exists($id, $this->items)){ //verificar se ja existe o item que eu quero adicionar\n $storedItem = $this->items[$id];\n }\n }\n\n $storedItem['qty']++;\n $storedItem['price'] = $item->price * $storedItem['qty'];\n $this->items[$id] = $storedItem;\n $this->totalQty++;\n $this->totalPrice += $item->price;\n\n }", "public function addDataElement($value)\n {\n $this->dataElements[] = $value;\n }", "function AfterAdd(&$values,&$keys,$inline,&$pageObject)\n{\n\n\t\tglobal $conn;\n$proid= $keys['proid'];\n$bill_date=$values['bill_date'];\n$amount_bill=$values['amount'];\n$bill_no=$values['bill_no'];\n$item=$values['item'];\n$ProgramID = $values['ProgramID'];\n$BatchID = $values['BatchID'];\n\n//get related student according to intake , branch, and program\n$sql_student = \"select StudentID from student_info where DipID='$ProgramID' AND BatchID='$BatchID' AND Status='Active'\";\n$q_student = db_query($sql_student,$conn);\n\n//insert all program billing item to related student program bill\nwhile($row_student=db_fetch_array($q_student))\n{ \n$studentID=$row_student['StudentID'];\n$sql_insert=\"INSERT INTO student_billing (proid,date,amount,amount_balance,bill_no,item,studentID,status)\nVALUES ('$proid','$bill_date','$amount_bill','$amount_bill','$bill_no','$item','$studentID','Pending')\";\ndb_exec($sql_insert,$conn);\t\n}\n\n\n;\t\t\n}", "private function write_single($data){\r\n if($this->$data[0] !== NULL){\r\n //add row of data to transaction object\r\n $this->$data[0]->add_list($data);\r\n }else{\r\n $this->$data[0] = new transaction_object($data[0]);\r\n $this->$data[0]->add_header($this->default_headers[$data[0]]);\r\n $this->$data[0]->add_list($data);\r\n }\r\n }", "private function _addToFilteredItem( $addon, array $subData, &$filteredItem ){\n foreach ($subData as $key => $value) {\n if( is_array($value) ){\n $fieldPrefix = ($this->_iniData[$key]['db_table_prefix']) ? $this->_iniData[$key]['db_table_prefix'] : \"\";\n $this->_addToFilteredItem( $fieldPrefix, $value, $filteredItem );\n }\n if ( !is_numeric($key) && in_array($key,$this->_fieldsToUse,true)) {\n $filteredItem[$addon . $key] = $value;\n }\n }\n }", "public function addToContribuinte(\\IFT_IES\\StructType\\IFT_IESContribuinte $item)\n {\n // validation for constraint: itemType\n if (!$item instanceof \\IFT_IES\\StructType\\IFT_IESContribuinte) {\n throw new \\InvalidArgumentException(sprintf('The contribuinte property can only contain items of type \\IFT_IES\\StructType\\IFT_IESContribuinte, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__);\n }\n $this->contribuinte[] = $item;\n return $this;\n }", "function insert() {\n // Retrieve scale and infer grademax from it\n if (!empty($this->scaleid)) {\n $this->load_scale();\n $this->scale->load_items();\n $this->grademax = count ($this->scale->scale_items);\n $this->grademin = 0;\n }\n\n $result = parent::insert();\n\n // Notify parent grade_item of need to update\n $this->load_grade_item();\n $result = $result && $this->grade_item->flag_for_update();\n\n // Update grade_grades_text if specified\n if ($result && !empty($this->feedback)) {\n $result = $this->annotate(NULL, NULL, $this->feedback, $this->feedbackformat);\n }\n\n return $result && $this->grade_item->flag_for_update();\n }", "public function onAfterFieldDefinition($data, $item): void\n {\n // A locale can be null, those need to be skipped\n $locales = Locale::get()->exclude(['Locale' => null]);\n\n foreach ($locales as $locale) {\n $copy = $item;\n $copy['Field'] = sprintf('%s_%s', $item['Field'], $locale->Locale);\n $data->push($copy);\n }\n }", "public function addToRepairLabourRates($item)\n {\n // validation for constraint: itemType\n if (!(is_int($item) || ctype_digit($item))) {\n throw new \\InvalidArgumentException(sprintf('The repairLabourRates property can only contain items of type long, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__);\n }\n $this->repairLabourRates[] = $item;\n return $this;\n }", "public function insertValue( $value, $iRow, $iColumn )\r\n {\r\n $this->data[$iRow][$iColumn] = $value;\r\n }", "public function add(){\n\n\t\t$db = new dbconnection();\n\t\t$conn = $db->startconnection();\t\n\n\t\t$query = $conn->prepare(\"INSERT INTO item(`item_code`,`item_category`,`item_subcategory`,`item_name`,`quantity`,`unit_price`) values (?,?,?,?,?,?)\");\n\n\t\t$query->bind_param(\"ssssss\",$this->itemcode,$this->category,$this->subcategory,$this->itemname,$this->quantity,$this->uprice);\n\t\t\t\n\t\t\tif($query->execute()){\n\n\t\t\treturn 1;\n\n\t\t}else{\n\n\t\t\treturn 0;\n\n\t\t}\n\n\n\t\t}", "function add_cart_item( $cart_item ) {\n\t\t\t\tif (isset($cart_item['addons'])) :\n\t\t\t\t\t\n\t\t\t\t\t$extra_cost = 0;\n\t\t\t\t\t\n\t\t\t\t\tforeach ($cart_item['addons'] as $addon) :\n\t\t\t\t\t\t\n\t\t\t\t\t\tif ($addon['price']>0) $extra_cost += $addon['price'];\n\t\t\t\t\t\t\n\t\t\t\t\tendforeach;\n\t\t\t\t\t\n\t\t\t\t\t$cart_item['data']->adjust_price( $extra_cost );\n\t\t\t\t\t\n\t\t\t\tendif;\n\t\t\t\t\n\t\t\t\treturn $cart_item;\n\t\t\t\t\n\t\t\t}", "abstract public function add_item();", "function AddUpdateOptionBOMItem($BID, $opId, $arryDetails,$index) {//$option_ID,//\r\n global $Config;\r\n extract($arryDetails);\r\n //print_r($arryDetails);//die;\r\n \r\n if ($opId == '') {\r\n $strUpSQLQuery = \"update inv_bill_of_material set \r\n\t\t\t\ttotal_cost='\" . $TotalValue . \"',\r\n\t\t\t\tUpdatedDate = '\" . $Config['TodayDate'] . \"'\r\n\t\t\t\twhere bomID='\" . $BID.\"'\";\r\n //echo $strUpSQLQuery ;die;\r\n\r\n $this->query($strUpSQLQuery, 0);\r\n }\r\n \r\n \r\n for ($j = 1; $j<=$arryDetails['newNumberLine'.$index.'']; $j++) {\r\n \r\n if (!empty($arryDetails[\"newsku$index-$j\"])) {\r\n \r\n $id = $arryDetails[\"newid$index-$j\"];\r\n //print_r($id);\r\n if ($id > 0) {\r\n $sql = \"update inv_item_bom set orderby = '\".$arryDetails[\"orderby$index-$j\"].\"', item_id='\" . $arryDetails[\"newitem_id$index-$j\"] . \"', sku='\" . addslashes($arryDetails[\"newsku$index-$j\"]) . \"',`Primary`='\" .$arryDetails[\"Primary$index-$j\"] . \"', description='\" . addslashes($arryDetails[\"newdescription$index-$j\"]) . \"', wastageQty='\" . addslashes($arryDetails[\"newWastageqty$index-$j\"]) . \"', bom_qty='\" . addslashes($arryDetails[\"newqty$index-$j\"]) . \"', unit_cost='\" . addslashes($arryDetails[\"newprice$index-$j\"]) . \"', total_bom_cost='\" . addslashes($arryDetails[\"newamount$index-$j\"]) . \"',`Condition`='\" . addslashes($arryDetails[\"newCondition$index-$j\"]) . \"',req_item='\" . addslashes($arryDetails[\"newreq_item$index-$j\"]) . \"' where id='\" . $id.\"'\"; \r\n $this->query($sql, 0);\r\n } \r\n else {\r\n $sql = \"insert into inv_item_bom (bomID,optionID, item_id, sku, description, wastageQty, bom_qty, unit_cost, total_bom_cost,`Condition`,req_item,orderby,`Primary`) values('\" . $BID . \"','\" . $opId . \"','\" . $arryDetails[\"newitem_id$index-$j\"] . \"', '\" . addslashes($arryDetails[\"newsku$index-$j\"]) . \"', '\" . addslashes($arryDetails[\"newdescription$index-$j\"]) . \"', '\" . addslashes($arryDetails[\"newWastageqty$index-$j\"]) . \"', '\" . addslashes($arryDetails[\"newqty$index-$j\"]) . \"', '\" . addslashes($arryDetails[\"newrice$index-$j\"]) . \"','\" . addslashes($arryDetails[\"newamount$index-$j\"]) . \"','\" . addslashes($arryDetails[\"newCondition$index-$j\"]) . \"','\" . addslashes($arryDetails[\"newreq_item$index-$j\"] ). \"', orderby = '\".$arryDetails[\"orderby$index-$j\"].\"','\" . addslashes($arryDetails[\"Primary$index-$j\"]) . \"')\";\r\n $this->query($sql, 0);\r\n \r\n }\r\n \r\n }\r\n \r\n \r\n }\r\n //die;\r\n return true;\r\n }", "public function addItem($key, $value);", "public function saveMultipartItemsComponents() {\n \n if (isset($_POST['item_no'])) {\n \n $param_pack = array();\n for ($i=0; $i < count($_POST['item_no']); $i++) {\n \n $hireItemID = trim($this->security->xss_clean($_POST['hireItemID'])); \n $item_no = trim($this->security->xss_clean($_POST['item_no'][$i]));\n $qty = trim($this->security->xss_clean($_POST['requestQty'][$i]));\n $description = trim($this->security->xss_clean($_POST['description'][$i]));\n $rate = trim($this->security->xss_clean($_POST['rate'][$i]));\n $value = $rate*$qty;\n $contractID = trim($this->security->xss_clean($_POST['contractID']));\n $itemType = 2; \n \n \n if ( v::int()->validate($hireItemID)\n && v::int()->validate($item_no)\n && v::int()->validate($qty)\n && v::numeric()->validate($rate)\n && v::int()->validate($contractID)\n && v::int()->validate($itemType) ) {\n \n $param_arr = compact(\"hireItemID\",\n \"item_no\",\n \"qty\",\n \"description\",\n \"rate\",\n \"value\",\n \"contractID\",\n \"itemType\");\n \n array_push( $param_pack, $param_arr);\n \n }else {\n \n http_response_code(400);\n echo \"Please, check the format data.\";\n return;\n }\n }\n \n $this->load->model('contracts_m'); \n \n foreach ( $param_pack as $i) {\n \n if ($i['qty'] > 0) {\n \n if ( !$this->contracts_m->insMultipartItemComponent($i) ) {\n \n echo \"ko\";\n return; \n }\n }\n }\n \n echo \"ok\";\n }\n }", "private function setProductItem(array $itemData): void\n {\n //====================================================================//\n // Safety Check\n if (!$this->item instanceof WC_Order_Item_Product) {\n return;\n }\n //====================================================================//\n // Update Quantity\n if (isset($itemData[\"quantity\"])) {\n $this->setGeneric(\"_quantity\", $itemData[\"quantity\"], \"item\");\n }\n //====================================================================//\n // Update Name\n if (isset($itemData[\"name\"])) {\n $this->setGeneric(\"_name\", $itemData[\"name\"], \"item\");\n }\n //====================================================================//\n // Update Product Id\n if (isset($itemData[\"product\"])) {\n $productId = self::objects()->id($itemData[\"product\"]);\n $this->setGeneric(\"_product_id\", $productId, \"item\");\n }\n //====================================================================//\n // Update Unit Price\n if (isset($itemData[\"subtotal\"])) {\n // Compute Expected Subtotal\n $subtotal = $this->item->get_quantity() * self::prices()->taxExcluded($itemData[\"subtotal\"]);\n // Compute Expected Subtotal Tax Incl.\n $subtotalTax = $this->item->get_quantity() * self::prices()->taxAmount($itemData[\"subtotal\"]);\n } else {\n $subtotal = $this->item->get_subtotal();\n $subtotalTax = $this->item->get_subtotal_tax();\n }\n //====================================================================//\n // Update Total Line Price\n // There is A Discount Percent\n if (isset($itemData[\"discount\"])) {\n // Compute Expected Total\n $total = (float) $subtotal * (1 - $itemData[\"discount\"] / 100);\n // Compute Expected Total Tax Incl.\n $totalTax = (float) $subtotalTax * (1 - $itemData[\"discount\"] / 100);\n // There is NO Discount\n } else {\n $total = $subtotal;\n $totalTax = $subtotalTax;\n }\n //====================================================================//\n // Update Item Taxes Array\n if (($totalTax != $this->item->get_total_tax()) || ($subtotalTax != $this->item->get_subtotal_tax())) {\n $this->setProductTaxArray((float) $totalTax, (float) $subtotalTax);\n }\n //====================================================================//\n // Update Item Totals\n $this->setGeneric(\"_total\", $total, \"item\");\n $this->setGeneric(\"_subtotal\", $subtotal, \"item\");\n }", "public function add($sAccount, $sVendor, $sCategory, $sDate, $iDebit, $iFixed, $sAmount, $sNotes)\n {\n \n //global $m_pSession;\n\n $sEnteredOn = date(\"Y-m-d H:i:s\");\n \n $bNewVendor = false;\n $bNewAccount = false;\n $bNewCategory = false;\n\n //Clean Account, Vendor and Category fields. Trim account and vender. Clean up Category and sub categories within the delemiter.\n $sVendor = trim($sVendor);\n $sAccount = trim($sAccount);\n $sCategory = $this->cleanCategory($sCategory);\n\n //Dealing with empty strings sent to add\n if(strlen($sVendor)!=0)\n $iVendorId = $this->pDatabase->selectValue(\"vendors/get_id_by_name\", $this->iUserId, $sVendor);\n else\n $iVendorId = 'NULL';\n \n if(strlen($sAccount)!=0)\n $iAccountId = $this->pDatabase->selectValue(\"accounts/get_id_by_name\", $this->iUserId, $sAccount);\n else\n $iAccountId = 'NULL';\n \n //Get category id form the database.\n if(strlen($sCategory)!=0)\n $iCategoryId = $this->pDatabase->selectValue(\"categories/get_id_by_name\", $this->iUserId, $sCategory);\n else\n $iCategoryId = 'NULL';\n \n //In case that any values are empty that shouldn't be empty\n if(($iVendorId=='NULL') && (strlen($sVendor)!=0)){ \n $this->addNew(\"vendors\",$sVendor); $bNewVendor=true;\n }\n if(($iCategoryId=='NULL') && (strlen($sCategory)!=0)){ \n $this->addNew(\"categories\",$sCategory); $bNewCategory=true;\n }\n if(($iAccountId=='NULL') && (strlen($sAccount)!=0)){ \n $this->addNew(\"accounts\",$sAccount); $bNewAccount=true;\n }\n \n \n \n //Add the transaction to the databse.\n $sTransactionId = $this->pDatabase->insert(\"transactions/add\", \"transactions\", $this->iUserId, $iVendorId, $iAccountId, $iCategoryId, $sDate, $iDebit, $iFixed, $sAmount, $sNotes, $sEnteredOn);\n\n //If error adding the transaction then clean up and report error.\n if ($sTransactionId == null)\n {\n //If vendor, account or category was created then delete them.\n if ($bNewVendor) $this->pDatabase->delete(\"vendors/delete\", $this->iUserId, $iVendorId);\n if ($bNewAccount) $this->pDatabase->delete(\"accounts/delete\", $this->iUserId, $iAccountId);\n if ($bNewCategory) $this->pDatabase->delete(\"categories/delete\", $this->iUserId, $iCategoryId);\n \n return XML::serialize(true, \"addTransaction\", \"type\",\"ERROR\",\"id\", \"-1\");\n }\n\n //If transaction is within visible period then add it to the list add it to the sorted list.\n\n\n return XML::serialize(true, \"addTransaction\", \"type\",\"OK\", \"id\",$sTransactionId);\n }", "function add_billing_data($billObj) {\n\n $item = new stdClass();\n $item->trans_id = $billObj->transId;\n $item->cardholder = $billObj->billTo->firstName . ' ' . $billObj->billTo->lastName;\n $item->type = 'a';\n $item->address = $billObj->billTo->address;\n $item->state = $billObj->billTo->state;\n $item->city = $billObj->billTo->city;\n $item->zip = $billObj->billTo->zip;\n $item->pdate = time();\n\n $exists = $this->is_billing_data_exists($item->trans_id);\n if ($exists == 0) {\n $query = \"insert into mdl_billing_data \"\n . \"(transaction_id,\"\n . \"cardholder,\"\n . \"type,\"\n . \"address,\"\n . \"state,\"\n . \"city,\"\n . \"zip,\"\n . \"pdate) \"\n . \"values ('$item->trans_id',\"\n . \"'\" . addslashes($item->cardholder) . \"',\"\n . \"'$item->type',\"\n . \"'\" . addslashes($item->address) . \"',\"\n . \"'$item->state',\"\n . \"'\" . addslashes($item->city) . \"',\"\n . \"'$item->zip',\"\n . \"'$item->pdate')\";\n $this->db->query($query);\n } // end if $exists == 0\n }", "public function add(Path $item): void\n {\n $path = $item->getPath();\n $value = $item->getValue();\n $index = array_pop($path);\n $array = [];\n\n if (count($path) > 0) {\n if (false === is_int($index) && false === is_string($index)) {\n $index = (string) $index;\n }\n\n $this->insertIntoArray($array, $path, [$index => $value]);\n } elseif (null === $index) {\n $array = [$value];\n } else {\n $array = [$index => $value];\n }\n\n $this->data = array_replace_recursive($this->data, $array);\n }", "public function addData($dataRow, $productId)\n {\n if (!empty($this->weeTaxData[$productId])) {\n $dataRow = array_merge($dataRow, $this->weeTaxData[$productId]);\n }\n return $dataRow;\n }", "public function update(): void\n {\n // Update quality\n if ($this->item->sell_in > 10) {\n $this->item->quality++;\n }\n\n if ($this->item->sell_in <= 10 && $this->item->sell_in > 5) {\n $this->item->quality += 2;\n }\n\n if ($this->item->sell_in <= 5 && $this->item->sell_in > 0) {\n $this->item->quality += 3;\n }\n\n // Update Sell in\n $this->updateSellIn();\n\n if ($this->item->sell_in < 0) {\n $this->item->quality = 0;\n }\n\n $this->checkAndUpdateQualityByRange();\n }", "public function add_data_final()\n\t{\n\t\t$user_id \t\t\t= $this->session->userdata['logged_in']['user_id'];\n\t\t\n\t\t$test_id \t\t\t= $this->input->post('test_id');\n\t\t$count_tests \t\t= count($test_id);\n\t\t\n\t\t$programm_type_id \t= $this->input->post('programm_type_id');\n\t\t$programm_date_id \t= $this->input->post('programm_date_id');\n\t\t$test_values \t\t= $this->input->post('test_value');\n\t\t$test_method \t\t= $this->input->post('methods');\n\t\t$date \t\t\t\t= date('Y-m-d');\n\n\t\t\n\t\tfor ($i=0; $i <$count_tests ; $i++) { \n\t\t\t$this->db->where('user_id', $user_id);\n\t\t\t$this->db->where('programm_type_id', $programm_type_id);\n\t\t\t$this->db->where('programm_date_id', $programm_date_id);\n\t\t\t\n\t\t\t\n\t\t\t$this->db->where('test_id', $test_id[$i]);\n\n\n\t\t\t$this->test_value \t\t\t= $test_values[$i];\n\t\t\t$this->method_id \t\t\t= $test_method[$i];\n\t\t\t$this->date_value_added \t= $date;\n\n\t\t\t$this->db->update('users_programm_dates_tests_evaluations', $this);\n\t\t}\n\t\t\n\n\n\t}", "function saveData($db, &$strError)\n{\n global $error;\n $strError = \"\";\n (isset($_REQUEST['dataType'])) ? $strDataType = $_REQUEST['dataType'] : $strDataType = \"department\";\n (isset($_REQUEST['dataCode'])) ? $strDataCode = trim($_REQUEST['dataCode']) : $strDataCode = \"\";\n (isset($_REQUEST['dataOldCode'])) ? $strDataOldCode = $_REQUEST['dataOldCode'] : $strDataOldCode = \"\";\n (isset($_REQUEST['dataName'])) ? $strDataName = $_REQUEST['dataName'] : $strDataName = \"\";\n (isset($_REQUEST['dataID'])) ? $strDataID = $_REQUEST['dataID'] : $strDataID = \"\";\n // cek validasi -----------------------\n if (strtolower($strDataType) == \"management\") {\n // --- EDIT DATA MANAGEMENT\n if ($strDataCode == \"\") {\n $strError = $error['empty_code'];\n return false;\n } else if ($strDataName == \"\") {\n $strError = $error['empty_name'];\n return false;\n } else {\n ($strDataID == \"\") ? $strKriteria = \"\" : $strKriteria = \"AND id <> '$strDataID' \";\n if (isDataExists($db, \"hrd_management\", \"management_code\", $strDataCode, $strKriteria)) {\n $strError = $error['duplicate_code'] . \" Management -> $strDataCode\";\n return false;\n }\n }\n // simpan data -----------------------\n $data = [\n \"management_code\" => check_plain($strDataCode),\n \"management_name\" => check_plain($strDataName),\n ];\n $tbl = new cModel(\"hrd_management\", \"management\");\n if ($strDataID == \"\") {\n $tbl->insert($data);\n // data baru\n writeLog(ACTIVITY_ADD, MODULE_PAYROLL, \"$strDataCode\", 0);\n } else {\n $tbl->update([\"id\" => $strDataID], $data);\n writeLog(ACTIVITY_EDIT, MODULE_PAYROLL, \"$strDataCode\", 0);\n // update data2 dibawahnya, jika ada perubahan kode\n $strDataCode = check_plain($strDataCode);\n $strDataOldCode = check_plain($strDataOldCode);\n if ($strDataOldCode != $strDataCode) {\n $tbl->query(\n \"\n UPDATE hrd_division SET management_code = '$strDataCode' \n WHERE management_code = '$strDataOldCode'; \n UPDATE hrd_department SET management_code = '$strDataCode' \n WHERE management_code = '$strDataOldCode';\n UPDATE hrd_sub_department SET division_code = '$strDataCode'\n WHERE management_code = '$strDataOldCode';\n UPDATE hrd_section SET division_code = '$strDataCode' \n WHERE management_code = '$strDataOldCode';\n UPDATE hrd_sub_section SET division_code = '$strDataCode' \n WHERE management_code = '$strDataOldCode';\n UPDATE hrd_employee SET management_code = '$strDataCode' \n WHERE management_code = '$strDataOldCode'\"\n );\n }\n }\n } else if (strtolower($strDataType) == \"division\") {\n (isset($_REQUEST['dataManCode'])) ? $strDataManCode = $_REQUEST['dataManCode'] : $strDataManCode = \"\";\n // --- EDIT DATA DIVISION\n if ($strDataCode == \"\") {\n $strError = $error['empty_code'];\n return false;\n } else if ($strDataName == \"\") {\n $strError = $error['empty_name'];\n return false;\n } else {\n ($strDataID == \"\") ? $strKriteria = \"\" : $strKriteria = \"AND id <> '$strDataID' \";\n if (isDataExists($db, \"hrd_division\", \"division_code\", $strDataCode, $strKriteria)) {\n $strError = $error['duplicate_code'] . \" Division -> $strDataCode\";\n return false;\n }\n }\n // simpan data -----------------------\n $data = [\n \"division_code\" => $strDataCode,\n \"division_name\" => $strDataName,\n \"management_code\" => $strDataManCode,\n ];\n $tbl = new cModel(\"hrd_division\", \"division\");\n if ($strDataID == \"\") {\n $tbl->insert($data);\n // data baru\n writeLog(ACTIVITY_ADD, MODULE_PAYROLL, \"$strDataCode\", 0);\n } else {\n $tbl->update([\"id\" => $strDataID], $data);\n writeLog(ACTIVITY_EDIT, MODULE_PAYROLL, \"$strDataCode\", 0);\n // update data2 dibawahnya, jika ada perubahan kode\n if ($strDataOldCode != $strDataCode) {\n $tbl->query(\n \"\n UPDATE hrd_department SET division_code = '$strDataCode' \n WHERE division_code = '$strDataOldCode';\n UPDATE hrd_sub_department SET division_code = '$strDataCode'\n WHERE division_code = '$strDataOldCode';\n UPDATE hrd_section SET division_code = '$strDataCode' \n WHERE division_code = '$strDataOldCode';\n UPDATE hrd_sub_section SET division_code = '$strDataCode' \n WHERE division_code = '$strDataOldCode';\n UPDATE hrd_employee SET division_code = '$strDataCode' \n WHERE division_code = '$strDataOldCode'\"\n );\n }\n }\n } else if (strtolower($strDataType) == \"department\") {\n // --- EDIT DATA DEPARTMENT\n (isset($_REQUEST['dataManCode'])) ? $strDataManCode = $_REQUEST['dataManCode'] : $strDataManCode = \"\";\n (isset($_REQUEST['dataDivCode'])) ? $strDataDivCode = $_REQUEST['dataDivCode'] : $strDataDivCode = \"\";\n if ($strDataCode == \"\") {\n $strError = $error['empty_code'];\n return false;\n } else if ($strDataName == \"\") {\n $strError = $error['empty_name'];\n return false;\n } else {\n ($strDataID == \"\") ? $strKriteria = \"\" : $strKriteria = \"AND id <> '$strDataID' \";\n if (isDataExists($db, \"hrd_department\", \"department_code\", $strDataCode, $strKriteria)) {\n $strError = $error['duplicate_code'] . \" Department -> $strDataCode\";\n return false;\n }\n }\n $data = [\n \"department_code\" => $strDataCode,\n \"department_name\" => $strDataName,\n \"division_code\" => $strDataDivCode,\n \"management_code\" => $strDataManCode,\n ];\n $tbl = new cModel(\"hrd_department\", \"department\");\n // simpan data -----------------------\n if ($strDataID == \"\") {\n // data baru\n $tbl->insert($data);\n writeLog(ACTIVITY_ADD, MODULE_PAYROLL, \"$strDataCode\", 0);\n } else {\n $tbl->update([\"id\" => $strDataID], $data);\n writeLog(ACTIVITY_EDIT, MODULE_PAYROLL, \"$strDataCode\", 0);\n // update data2 dibawahnya, jika ada perubahan kode\n if ($strDataOldCode != $strDataCode) {\n $tbl->query(\n \"\n UPDATE hrd_sub_department SET department_code = '$strDataCode'\n WHERE department_code = '$strDataOldCode';\n UPDATE hrd_section SET department_code = '$strDataCode'\n WHERE department_code = '$strDataOldCode';\n UPDATE hrd_sub_section SET department_code = '$strDataCode' \n WHERE department_code = '$strDataOldCode';\n UPDATE hrd_employee SET department_code = '$strDataCode' \n WHERE department_code = '$strDataOldCode'\"\n );\n }\n }\n } else if (strtolower($strDataType) == \"subdepartment\") { // --- EDIT DATA SECTION\n (isset($_REQUEST['dataManCode'])) ? $strDataManCode = $_REQUEST['dataManCode'] : $strDataManCode = \"\";\n (isset($_REQUEST['dataDivCode'])) ? $strDataDivCode = $_REQUEST['dataDivCode'] : $strDataDivCode = \"\";\n (isset($_REQUEST['dataDeptCode'])) ? $strDataDeptCode = $_REQUEST['dataDeptCode'] : $strDataDeptCode = \"\";\n if ($strDataCode == \"\") {\n $strError = $error['empty_code'];\n return false;\n } else if ($strDataName == \"\") {\n $strError = $error['empty_name'];\n return false;\n } else {\n ($strDataID == \"\") ? $strKriteria = \"\" : $strKriteria = \"AND id <> '$strDataID' \";\n if (isDataExists($db, \"hrd_sub_department\", \"sub_department_code\", $strDataCode, $strKriteria)) {\n $strError = $error['duplicate_code'] . \" Sub Department -> $strDataCode\";\n return false;\n }\n }\n $data = [\n \"sub_department_code\" => $strDataCode,\n \"sub_department_name\" => $strDataName,\n \"department_code\" => $strDataDeptCode,\n \"division_code\" => $strDataDivCode,\n \"management_code\" => $strDataManCode,\n ];\n $tbl = new cModel(\"hrd_sub_department\", \"subdepartment\");\n // simpan data -----------------------\n if ($strDataID == \"\") {\n // data baru\n $tbl->insert($data);\n writeLog(ACTIVITY_ADD, MODULE_PAYROLL, \"$strDataCode\", 0);\n } else {\n $tbl->update([\"id\" => $strDataID], $data);\n writeLog(ACTIVITY_EDIT, MODULE_PAYROLL, \"$strDataCode\", 0);\n // update data2 dibawahnya, jika ada perubahan kode\n if ($strDataOldCode != $strDataCode) {\n $tbl->query(\n \"\n UPDATE hrd_section SET section_code = '$strDataCode'\n WHERE section_code = '$strDataOldCode';\n UPDATE hrd_sub_section SET section_code = '$strDataCode'\n WHERE section_code = '$strDataOldCode';\n UPDATE hrd_employee SET section_code = '$strDataCode' \n WHERE section_code = '$strDataOldCode'\"\n );\n }\n }\n } else if (strtolower($strDataType) == \"section\") { // --- EDIT DATA SECTION\n (isset($_REQUEST['dataManCode'])) ? $strDataManCode = $_REQUEST['dataManCode'] : $strDataManCode = \"\";\n (isset($_REQUEST['dataDivCode'])) ? $strDataDivCode = $_REQUEST['dataDivCode'] : $strDataDivCode = \"\";\n (isset($_REQUEST['dataDeptCode'])) ? $strDataDeptCode = $_REQUEST['dataDeptCode'] : $strDataDeptCode = \"\";\n (isset($_REQUEST['dataSubDeptCode'])) ? $strDataSubDeptCode = $_REQUEST['dataSubDeptCode'] : $strDataSubDeptCode = \"\";\n if ($strDataCode == \"\") {\n $strError = $error['empty_code'];\n return false;\n } else if ($strDataName == \"\") {\n $strError = $error['empty_name'];\n return false;\n } else {\n ($strDataID == \"\") ? $strKriteria = \"\" : $strKriteria = \"AND id <> '$strDataID' \";\n if (isDataExists($db, \"hrd_section\", \"section_code\", $strDataCode, $strKriteria)) {\n $strError = $error['duplicate_code'] . \" Section -> $strDataCode\";\n return false;\n }\n }\n $data = [\n \"section_code\" => $strDataCode,\n \"section_name\" => $strDataName,\n \"sub_department_code\" => $strDataSubDeptCode,\n \"department_code\" => $strDataDeptCode,\n \"division_code\" => $strDataDivCode,\n \"management_code\" => $strDataManCode,\n ];\n $tbl = new cModel(\"hrd_section\", \"section\");\n // simpan data -----------------------\n if ($strDataID == \"\") {\n // data baru\n $tbl->insert($data);\n writeLog(ACTIVITY_ADD, MODULE_PAYROLL, \"$strDataCode\", 0);\n } else {\n $tbl->update([\"id\" => $strDataID], $data);\n writeLog(ACTIVITY_EDIT, MODULE_PAYROLL, \"$strDataCode\", 0);\n // update data2 dibawahnya, jika ada perubahan kode\n if ($strDataOldCode != $strDataCode) {\n $tbl->query(\n \"\n UPDATE hrd_sub_section SET section_code = '$strDataCode'\n WHERE section_code = '$strDataOldCode';\n UPDATE hrd_employee SET section_code = '$strDataCode'\n WHERE section_code = '$strDataOldCode'\"\n );\n }\n }\n } else if (strtolower($strDataType) == \"subsection\") { // --- EDIT DATA SUBSECTION\n (isset($_REQUEST['dataManCode'])) ? $strDataManCode = $_REQUEST['dataManCode'] : $strDataManCode = \"\";\n (isset($_REQUEST['dataDivCode'])) ? $strDataDivCode = $_REQUEST['dataDivCode'] : $strDataDivCode = \"\";\n (isset($_REQUEST['dataDeptCode'])) ? $strDataDeptCode = $_REQUEST['dataDeptCode'] : $strDataDeptCode = \"\";\n (isset($_REQUEST['dataSectCode'])) ? $strDataSectCode = $_REQUEST['dataSectCode'] : $strDataSectCode = \"\";\n (isset($_REQUEST['dataSubDeptCode'])) ? $strDataSubDeptCode = $_REQUEST['dataSubDeptCode'] : $strDataSubDeptCode = \"\";\n //(isset($_REQUEST['dataOvertime'])) ? $strDataOvertime = $_REQUEST['dataOvertime'] : $strDataOvertime = \"f\";\n if ($strDataCode == \"\") {\n $strError = $error['empty_code'];\n return false;\n } else if ($strDataName == \"\") {\n $strError = $error['empty_name'];\n return false;\n } else {\n ($strDataID == \"\") ? $strKriteria = \"\" : $strKriteria = \"AND id <> '$strDataID' \";\n if (isDataExists($db, \"hrd_sub_section\", \"sub_section_code\", $strDataCode, $strKriteria)) {\n $strError = $error['duplicate_code'] . \" Sub Section -> $strDataCode\";\n return false;\n }\n }\n $data = [\n \"sub_section_code\" => $strDataCode,\n \"sub_section_name\" => $strDataName,\n \"section_code\" => $strDataSectCode,\n \"sub_department_code\" => $strDataSubDeptCode,\n \"department_code\" => $strDataDeptCode,\n \"division_code\" => $strDataDivCode,\n \"management_code\" => $strDataManCode,\n ];\n $tbl = new cModel(\"hrd_sub_section\", \"sub section\");\n // simpan data -----------------------\n if ($strDataID == \"\") {\n // data baru\n $tbl->insert($data);\n writeLog(ACTIVITY_ADD, MODULE_PAYROLL, \"$strDataCode\", 0);\n } else {\n $tbl->update([\"id\" => $strDataID], $data);\n writeLog(ACTIVITY_EDIT, MODULE_PAYROLL, \"$strDataCode\", 0);\n }\n }\n return true;\n}", "function addData($column, $value)\n {\n $this->addColumns($column);\n $this->data[$this->series]['data'][$column] = $value * 1.0;\n }", "public function addItem(SagepayItem $item)\r\n {\r\n $this->_items[] = $item;\r\n }", "function add($data){\n if(array_key_exists($data['id'], $this->fields)){\n exit(\"Field with ID: '\".$data['id'].\"' already exists.\");\n }\n if(!isset($data['validate'])){\n $data['validate'] = false;\n }\n if(!isset($data['inline'])){\n $data['inline'] = null;\n }\n if(!isset($data['value'])){\n $data['value'] = null;\n }\n if(!isset($data['readonly'])){\n $data['readonly'] = false;\n }\n\n $this->fields[$data['id']] = $data;\n }", "public function addSale($item, $id){\n\n $storedItem = ['qty' => 0, 'productPrice' => $item->productPrice, 'item' => $item];\n if($this->items){\n if(array_key_exists($id, $this->items)){\n $storedItem = $this->items[$id];\n }\n }\n\n $storedItem['qty']++;\n $storedItem['productPrice'] = $item->productPrice * $storedItem['qty'];\n $this->items[$id] = $storedItem;\n $this->totalQty++;\n $this->totalPrice += $item->productPrice;\n }", "public function add()\n {\n //$this->log($this->request->data, 'debug');\n\n $humidity = $this->Humidities->newEntity();\n $humidity = $this->Humidities->patchEntity($humidity, [\n 'dt' => $this->request->data['datetime'],\n 'val' => $this->request->data['humidity']\n ]);\n\n $result = ['code' => 'S', 'message' => 'Success: humidity save is success.'];\n if (!$this->Humidities->save($humidity)) {\n $result = ['code' => 'E', 'message' => 'Error: unexpected error is occurred when save humidity data.'];\n }\n\n $this->set([\n 'result' => $result,\n '_serialize' => ['result']\n ]);\n }", "function add_update_om_items(){\t\n \t\t$house=$this->input->post('house2');\n\t\t$panjang=$this->input->post('panjang');\n\t\t$lebar=$this->input->post('lebar');\n\t\t$tinggi=$this->input->post('tinggi');\n\t\t$volume=$panjang*$lebar*$tinggi;\n\t\t\n\t\t$items=array(\n\t\t'HouseNo' =>$house,\n\t\t'NoPack'=>$this->input->post('pack'),\n\t\t'Length'=>$this->input->post('panjang'),\n\t\t'Width'=>$this->input->post('lebar'),\n\t\t'Height'=>$this->input->post('tinggi'),\n\t\t'Volume'=>$volume,\n\t\t'Date'=>date('Y-m-d H:i:s')\n\t\t);\t\t\n\t\t $this->model_app->insert('booking_items',$items);\n\t\t \n\tredirect('transaction/edit_outgoing_master/'.$house);\n }", "public function add($item);", "public function add($item);", "public function addRow($data){\n $data = (array)$data;\n $this->counter++;\n $newRow = [];\n $newRow = array_merge($newRow, $this->saveMetaData($data));\n $newRow = array_merge($newRow, $this->saveGeoData($data));\n $newRow = array_merge($newRow, $this->saveCoreData($data));\n $this->rowData[]=$newRow;\n }", "public function inserirFinal(array &$array, $item)\n\t{\n\t\t$array[] = $item;\n\t}", "public static function saveDisposal($data){\r\n\r\n // Create some constants for the sql inserts\r\n $user = Auth::getUser();\r\n // Save order Header\r\n $reqStrore = $user->storeNumber;\r\n $userID = $user->id;\r\n\r\n\r\n\r\n\r\n $sql = \"INSERT INTO disposal_head (\r\n reqStore,\r\n userRequesting,\r\n policeName,\r\n policeReportDate,\r\n policeReportNum,\r\n nerReportBy,\r\n nerReportDate,\r\n mfgReportBy,\r\n mfgReportDate,\r\n disposalComments)\r\n Values (\r\n :reqStore,\r\n :userRequesting,\r\n :policeName,\r\n :policeReportDate,\r\n :policeReportNum,\r\n :nerReportBy,\r\n :nerReportDate,\r\n :mfgReportBy,\r\n :mfgReportDate,\r\n :disposalComments)\";\r\n \r\n $db = static::getDB();\r\n\r\n $stmt = $db->prepare($sql);\r\n\r\n $stmt->bindValue(':reqStore', $reqStrore);\r\n $stmt->bindValue(':userRequesting', $userID);\r\n $stmt->bindValue(':policeName', $data['policeDepartment']);\r\n $stmt->bindValue(':policeReportDate', $data['policeDate']);\r\n $stmt->bindValue(':policeReportNum', $data['reportNum']);\r\n $stmt->bindValue(':nerReportBy', $data['nerReportBy']);\r\n $stmt->bindValue(':nerReportDate', $data['nerDate']);\r\n $stmt->bindValue(':mfgReportBy', $data['mfgReportBy']);\r\n $stmt->bindValue(':mfgReportDate', $data['mfgDate']);\r\n $stmt->bindValue(':disposalComments', $data['disposal_comments']);\r\n\r\n $stmt->execute();\r\n\r\n // Get id of last insert\r\n $insertId = $db->lastinsertId();\r\n // get total number of parts for the order\r\n\r\n $partCount = count($data['catNum']);\r\n\r\n // save each item on the request to table\r\n for ($i = 0; $i<$partCount; $i++){\r\n $itemData = array(\r\n 'cat_num' => $data['catNum'][$i],\r\n 'itm_num' => $data['itmNum'][$i],\r\n 'ser_num' => $data['serialNum'][$i],\r\n 'mfg' => $data['mfg'][$i],\r\n 'qty' => $data['quantity'][$i],\r\n 'disp_code'=>$data['disposalCode'][$i],\r\n 'orderID' => $insertId\r\n );\r\n static::saveParts($itemData);\r\n }\r\n }" ]
[ "0.6699705", "0.55794066", "0.5439293", "0.5117364", "0.50710636", "0.50562865", "0.5034741", "0.49769795", "0.4965951", "0.49514467", "0.49439436", "0.49334455", "0.4895031", "0.48946083", "0.4886936", "0.48747206", "0.48504317", "0.4843837", "0.4838966", "0.48289162", "0.48129404", "0.48127496", "0.48047426", "0.480308", "0.479154", "0.47904706", "0.47820994", "0.47776878", "0.47732633", "0.47700456", "0.47645319", "0.47637728", "0.47585368", "0.4751712", "0.47499937", "0.47465354", "0.47407818", "0.4740358", "0.47353572", "0.47244316", "0.47207794", "0.47136503", "0.47096044", "0.47048068", "0.46923837", "0.46867123", "0.46664137", "0.4661294", "0.46610785", "0.46530277", "0.4651832", "0.46488476", "0.46469355", "0.46315074", "0.46304026", "0.4629665", "0.46291012", "0.46280426", "0.46255967", "0.46251836", "0.462285", "0.46171734", "0.46153602", "0.46116254", "0.4611144", "0.46083492", "0.45906967", "0.45904204", "0.4585947", "0.4581777", "0.45803356", "0.45788983", "0.4567616", "0.4566697", "0.45665216", "0.45596564", "0.4557194", "0.45539337", "0.45533925", "0.45517644", "0.45513868", "0.4551314", "0.454701", "0.45468405", "0.45386195", "0.45323375", "0.45320556", "0.45316964", "0.45287752", "0.45241457", "0.45229128", "0.4519417", "0.45180243", "0.45170113", "0.4516891", "0.45156232", "0.45156232", "0.4513314", "0.45090264", "0.4508986" ]
0.7193161
0
This method is responsible for validating the values passed to the setCompensation_Detail_Data method This method is willingly generated in order to preserve the oneline inline validation within the setCompensation_Detail_Data method
public static function validateCompensation_Detail_DataForArrayConstraintsFromSetCompensation_Detail_Data(array $values = array()) { $message = ''; $invalidValues = []; foreach ($values as $employee_DataTypeCompensation_Detail_DataItem) { // validation for constraint: itemType if (!$employee_DataTypeCompensation_Detail_DataItem instanceof \WorkdayWsdl\\StructType\Compensation_Detail_DataType) { $invalidValues[] = is_object($employee_DataTypeCompensation_Detail_DataItem) ? get_class($employee_DataTypeCompensation_Detail_DataItem) : sprintf('%s(%s)', gettype($employee_DataTypeCompensation_Detail_DataItem), var_export($employee_DataTypeCompensation_Detail_DataItem, true)); } } if (!empty($invalidValues)) { $message = sprintf('The Compensation_Detail_Data property can only contain items of type \WorkdayWsdl\\StructType\Compensation_Detail_DataType, %s given', is_object($invalidValues) ? get_class($invalidValues) : (is_array($invalidValues) ? implode(', ', $invalidValues) : gettype($invalidValues))); } unset($invalidValues); return $message; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function writeDataValidity(): void\n {\n // Datavalidation collection\n $dataValidationCollection = $this->phpSheet->getDataValidationCollection();\n\n // Write data validations?\n if (!empty($dataValidationCollection)) {\n // DATAVALIDATIONS record\n $record = 0x01B2; // Record identifier\n $length = 0x0012; // Bytes to follow\n\n $grbit = 0x0000; // Prompt box at cell, no cached validity data at DV records\n $horPos = 0x00000000; // Horizontal position of prompt box, if fixed position\n $verPos = 0x00000000; // Vertical position of prompt box, if fixed position\n $objId = 0xFFFFFFFF; // Object identifier of drop down arrow object, or -1 if not visible\n\n $header = pack('vv', $record, $length);\n $data = pack('vVVVV', $grbit, $horPos, $verPos, $objId, count($dataValidationCollection));\n $this->append($header . $data);\n\n // DATAVALIDATION records\n $record = 0x01BE; // Record identifier\n\n foreach ($dataValidationCollection as $cellCoordinate => $dataValidation) {\n // options\n $options = 0x00000000;\n\n // data type\n $type = CellDataValidation::type($dataValidation);\n\n $options |= $type << 0;\n\n // error style\n $errorStyle = CellDataValidation::errorStyle($dataValidation);\n\n $options |= $errorStyle << 4;\n\n // explicit formula?\n if ($type == 0x03 && preg_match('/^\\\".*\\\"$/', $dataValidation->getFormula1())) {\n $options |= 0x01 << 7;\n }\n\n // empty cells allowed\n $options |= $dataValidation->getAllowBlank() << 8;\n\n // show drop down\n $options |= (!$dataValidation->getShowDropDown()) << 9;\n\n // show input message\n $options |= $dataValidation->getShowInputMessage() << 18;\n\n // show error message\n $options |= $dataValidation->getShowErrorMessage() << 19;\n\n // condition operator\n $operator = CellDataValidation::operator($dataValidation);\n\n $options |= $operator << 20;\n\n $data = pack('V', $options);\n\n // prompt title\n $promptTitle = $dataValidation->getPromptTitle() !== '' ?\n $dataValidation->getPromptTitle() : chr(0);\n $data .= StringHelper::UTF8toBIFF8UnicodeLong($promptTitle);\n\n // error title\n $errorTitle = $dataValidation->getErrorTitle() !== '' ?\n $dataValidation->getErrorTitle() : chr(0);\n $data .= StringHelper::UTF8toBIFF8UnicodeLong($errorTitle);\n\n // prompt text\n $prompt = $dataValidation->getPrompt() !== '' ?\n $dataValidation->getPrompt() : chr(0);\n $data .= StringHelper::UTF8toBIFF8UnicodeLong($prompt);\n\n // error text\n $error = $dataValidation->getError() !== '' ?\n $dataValidation->getError() : chr(0);\n $data .= StringHelper::UTF8toBIFF8UnicodeLong($error);\n\n // formula 1\n try {\n $formula1 = $dataValidation->getFormula1();\n if ($type == 0x03) { // list type\n $formula1 = str_replace(',', chr(0), $formula1);\n }\n $this->parser->parse($formula1);\n $formula1 = $this->parser->toReversePolish();\n $sz1 = strlen($formula1);\n } catch (PhpSpreadsheetException $e) {\n $sz1 = 0;\n $formula1 = '';\n }\n $data .= pack('vv', $sz1, 0x0000);\n $data .= $formula1;\n\n // formula 2\n try {\n $formula2 = $dataValidation->getFormula2();\n if ($formula2 === '') {\n throw new WriterException('No formula2');\n }\n $this->parser->parse($formula2);\n $formula2 = $this->parser->toReversePolish();\n $sz2 = strlen($formula2);\n } catch (PhpSpreadsheetException $e) {\n $sz2 = 0;\n $formula2 = '';\n }\n $data .= pack('vv', $sz2, 0x0000);\n $data .= $formula2;\n\n // cell range address list\n $data .= pack('v', 0x0001);\n $data .= $this->writeBIFF8CellRangeAddressFixed($cellCoordinate);\n\n $length = strlen($data);\n $header = pack('vv', $record, $length);\n\n $this->append($header . $data);\n }\n }\n }", "public static function validateCompensation_DataForArrayConstraintsFromSetCompensation_Data(array $values = array())\n {\n $message = '';\n $invalidValues = [];\n foreach ($values as $employee_DataTypeCompensation_DataItem) {\n // validation for constraint: itemType\n if (!$employee_DataTypeCompensation_DataItem instanceof \\WorkdayWsdl\\\\StructType\\Compensation_DataType) {\n $invalidValues[] = is_object($employee_DataTypeCompensation_DataItem) ? get_class($employee_DataTypeCompensation_DataItem) : sprintf('%s(%s)', gettype($employee_DataTypeCompensation_DataItem), var_export($employee_DataTypeCompensation_DataItem, true));\n }\n }\n if (!empty($invalidValues)) {\n $message = sprintf('The Compensation_Data property can only contain items of type \\WorkdayWsdl\\\\StructType\\Compensation_DataType, %s given', is_object($invalidValues) ? get_class($invalidValues) : (is_array($invalidValues) ? implode(', ', $invalidValues) : gettype($invalidValues)));\n }\n unset($invalidValues);\n return $message;\n }", "public function validateDataInvoice(): void\n {\n $this->validarDatos($this->datos, $this->getRules('fe'));\n\n $this->validarDatosArray($this->datos->arrayOtrosTributos, 'tributos');\n\n /** @phpstan-ignore-next-line */\n if (property_exists($this->datos, 'arraySubtotalesIVA')) {\n $this->validarDatosArray((array) $this->datos->arraySubtotalesIVA, 'iva');\n }\n\n $this->validarDatosArray($this->datos->comprobantesAsociados, 'comprobantesAsociados');\n\n if ($this->ws === 'wsfe') {\n if (property_exists($this->datos, 'arrayOpcionales')) {\n $this->validarDatosArray((array) $this->datos->arrayOpcionales, 'opcionales');\n }\n } elseif ($this->ws === 'wsmtxca') {\n $this->validarDatosArray($this->datos->items, 'items');\n }\n }", "public function isValid($data) {\n //Remove Commas \n $data = str_replace(\",\", \"\", $data);\n \n $data['heatLossMethod']='percent';\n \n $precision = $this->mS->masterConversionList['temperature'][1][$this->mS->selected['temperature']][4];\n $iapws = new Steam_IAPWS();\n $maxTemp = $this->mS->ceil_dec($this->mS->localize($iapws->saturatedTemperature($this->mS->standardize($data['daPressure'], 'pressure')),'temperature'),$precision); \n \n if ($data['condReturnTemp']>=$maxTemp or $data['condReturnTemp']<=$this->mS->minTemperature()){\n $this->getElement('condReturnTemp')->addValidator('between', true, array('min' => $this->mS->minTemperature(), 'max' => $maxTemp, 'inclusive' => false));\n }\n \n \n $precision = $this->mS->masterConversionList['temperature'][1][$this->mS->selected['temperature']][4];\n $iapws = new Steam_IAPWS();\n $minTemp = $this->mS->ceil_dec($this->mS->localize($iapws->saturatedTemperature($this->mS->standardize($data['highPressure'],'pressure')),'temperature'),$precision);\n if ($data['boilerTemp']<$minTemp){\n $this->getElement('boilerTemp')\n ->addValidator('greaterThan', true, array('min' => $minTemp, 'messages' => '%value% is below the boiling temperature [%min%] for boiler pressure.'));\n }\n \n \n if ($data['headerCount']<3){\n $data['turbineHpMpOn'] = null;\n $data['turbineMpLpOn'] = null;\n $data['desuperHeatHpMp']=='No';\n if ($data['mpCondReturnRate']=='') $data['mpCondReturnRate'] = 0;\n if ($data['lpCondReturnRate']=='') $data['lpCondReturnRate'] = 0;\n }\n if ($data['headerCount']<2){\n $data['turbineHpLpOn'] = null;\n $data['desuperHeatMpLp']=='No';\n }\n \n if ($data['headerCount']==3){\n if($data['desuperHeatHpMp']=='Yes'){ \n $this->getElement('desuperHeatHpMpTemp')\n ->setRequired(true)\n ->addValidator($this->isFloat,true)\n ->addValidator('between', true, array('min' => $this->mS->minTemperature(), 'max' => $this->mS->maxTemperature(), 'inclusive' => true));\n }\n }\n if ($data['headerCount']>=2){\n if($data['desuperHeatMpLp']=='Yes'){ \n $this->getElement('desuperHeatMpLpTemp')\n ->setRequired(true)\n ->addValidator($this->isFloat,true)\n ->addValidator('between', true, array('min' => $this->mS->minTemperature(), 'max' => $this->mS->maxTemperature(), 'inclusive' => true)); \n }\n }\n\n \n if($data['blowdownHeatX']=='Yes'){ \n $this->getElement('blowdownHeatXTemp')\n ->setRequired(true)\n ->addValidator($this->isFloat,true)\n ->addValidator('greaterThan', true, array('min' => 0, 'max' => $this->mS->maxTemperature(), 'inclusive' => true));\n }\n \n foreach(Steam_Support::steamTurbineCodes() as $turbine){\n if ($data['turbine'.$turbine.'On']==1){\n $this->getElement('turbine'.$turbine.'IsoEff')->setRequired('true')\n ->addValidator($this->isFloat)\n ->addValidator('Between', true, array('min' => ISOEFF_MIN, 'max' => ISOEFF_MAX));\n $this->getElement('turbine'.$turbine.'GenEff')->setRequired('true')\n ->addValidator($this->isFloat)\n ->addValidator('Between', true, array('min' => GENEFF_MIN, 'max' => GENEFF_MAX));\n \n if ($turbine=='Cond'){\n $this->getElement('turbineCondOutletPressure')->setRequired(true)\n ->addValidator($this->isFloat,true)\n ->addValidator('between', true, array('min' => $this->mS->minVacuum(), 'max' => $this->mS->condVacuum(), 'inclusive' => true));\n }\n \n switch($data['turbine'.$turbine.'Method']){\n case 'fixedFlow':\n $this->getElement('turbine'.$turbine.'FixedFlow')->setRequired('true')\n ->addValidator($this->isFloat)\n ->addValidator('between', true, array('min' => $this->mS->minMassflow(), 'max' => $this->mS->maxMassflow(), 'inclusive' => false)); \n break;\n case 'flowRange':\n $this->getElement('turbine'.$turbine.'MinFlow')->setRequired('true')\n ->addValidator($this->isFloat)\n ->addValidator('between', true, array('min' => $this->mS->minMassflow(), 'max' => $data['turbine'.$turbine.'MaxFlow'])); \n \n $this->getElement('turbine'.$turbine.'MaxFlow')->setRequired('true')\n ->addValidator($this->isFloat)\n ->addValidator('between', true, array('min' => $this->mS->minMassflow(), 'max' => $this->mS->maxMassflow(), 'inclusive' => false));\n break;\n\n case 'fixedPower':\n $this->getElement('turbine'.$turbine.'FixedPower')->setRequired('true')\n ->addValidator($this->isFloat)\n ->addValidator('greaterThan', true, array('min' => 0)); \n break;\n case 'powerRange':\n $this->getElement('turbine'.$turbine.'MinPower')->setRequired('true')\n ->addValidator($this->isFloat)\n ->addValidator('between', true, array('min' => 0, 'max' => $data['turbine'.$turbine.'MaxPower'])); \n \n $this->getElement('turbine'.$turbine.'MaxPower')->setRequired('true')\n ->addValidator($this->isFloat)\n ->addValidator('greaterThan', true, array('min' => 0)); \n break;\n\n case 'balanceHeader':\n break;\n }\n }\n }\n \n $this->getElement('hpSteamUsage')->addValidator('between', true, array('min' => $this->mS->minMassflow(), 'max' => $this->mS->maxMassflow(), 'inclusive' => true));\n \n $this->getElement('hpHeatLossPercent')->setRequired(true)\n ->addValidator($this->isFloat,true)\n ->addValidator('between', true, array('min' => HEATLOST_PERCENT_MIN, 'max' => HEATLOST_PERCENT_MAX, 'inclusive' => true));\n \n \n if ($data['headerCount']==3){\n $tmp = $this->getElement('mediumPressure')->setRequired(true)\n ->addValidator($this->isFloat,true);\n if (isset($data['highPressure'])) $tmp->addValidator('lessThan', true, array('max' => $data['highPressure'], 'messages' => 'Must be less than High Pressure.'));\n $tmp->addValidator('greaterThan', true, array('min' => $this->mS->minPressure()));\n $tmp = $this->getElement('lowPressure')->setRequired(true)\n ->addValidator($this->isFloat,true);\n if (isset($data['mediumPressure'])) $tmp->addValidator('lessThan', true, array('max' => $data['mediumPressure'], 'messages' => 'Must be less than Medium Pressure.'));\n $tmp->addValidator('greaterThan', true, array('min' => $this->mS->minPressure())); \n if (isset($data['lowPressure'])) $this->getElement('daPressure')->addValidator('lessThan', true, array('max' => $data['lowPressure'], 'messages' => 'Must be below lowest steam header pressure.'));\n \n \n $this->getElement('mpSteamUsage')->setRequired(true)\n ->addValidator($this->isFloat,true);\n $this->getElement('mpSteamUsage')->addValidator('between', true, array('min' => $this->mS->minMassflow(), 'max' => $this->mS->maxMassflow(), 'inclusive' => true)); \n \n $this->getElement('mpCondReturnRate')->setRequired(true)\n ->addValidator($this->isFloat,true)\n ->addValidator('between', true, array('min' => 0, 'max' => 100, 'inclusive' => true));\n \n $this->getElement('mpHeatLossPercent')->setRequired(true)\n ->addValidator($this->isFloat,true)\n ->addValidator('between', true, array('min' => HEATLOST_PERCENT_MIN, 'max' => HEATLOST_PERCENT_MAX, 'inclusive' => true)); \n }\n \n if ($data['headerCount']==2){\n \n $tmp = $this->getElement('lowPressure')->setRequired(true)\n ->addValidator($this->isFloat,true);\n if (isset($data['highPressure'])) $tmp->addValidator('lessThan', true, array('max' => $data['highPressure'], 'messages' => 'Must be less than High Pressure.'));\n $tmp->addValidator('greaterThan', true, array('min' => $this->mS->minPressure())); \n if (isset($data['lowPressure'])) $this->getElement('daPressure')->addValidator('lessThan', true, array('max' => $data['lowPressure'], 'messages' => 'Must be below lowest steam header pressure.'));\n \n }\n \n if ($data['headerCount']>=2){\n \n $this->getElement('lpSteamUsage')->setRequired(true)\n ->addValidator($this->isFloat,true);\n \n $this->getElement('lpSteamUsage')->addValidator('between', true, array('min' => $this->mS->minMassflow(), 'max' => $this->mS->maxMassflow(), 'inclusive' => true)); \n \n $this->getElement('lpCondReturnRate')->setRequired(true)\n ->addValidator($this->isFloat,true)\n ->addValidator('between', true, array('min' => 0, 'max' => 100, 'inclusive' => true));\n \n $this->getElement('lpHeatLossPercent')->setRequired(true)\n ->addValidator($this->isFloat,true)\n ->addValidator('between', true, array('min' => HEATLOST_PERCENT_MIN, 'max' => HEATLOST_PERCENT_MAX, 'inclusive' => true)); \n }\n \n if ($data['headerCount']==1){ \n if (isset($data['highPressure'])) $this->getElement('daPressure')->addValidator('lessThan', true, array('max' => $data['highPressure'], 'messages' => 'Must be below lowest steam header pressure.')); \n \n } \n return parent::isValid($data);\n }", "function validateData($array){\n\t\t$errorFlag=true;\n\t\t$currentDate = getdate(); //get current date\n\t\tif (trim($array['FName'])==''){\n\t\t\t$this->appendErrorMsg(\"First Name is required\");\n\t\t\t$errorFlag = false;\n\t\t}\n\t\tif (trim($array['LName'])==''){\n\t\t\t$this->appendErrorMsg(\"Last Name is required\");\n\t\t\t$errorFlag = false;\n\t\t}\n\t\tif (trim($array['License_No'])==''){\n\t\t\t$this->appendErrorMsg(\"License number is required\");\n\t\t\t$errorFlag = false;\n\t\t}\n\t\tif (trim($array['Birthdate'])==''){\n\t\t\t$this->appendErrorMsg(\"Birthdate cannot be blank\");\n\t\t\t$errorFlag = false;\n\t\t} else if (!preg_match(\"/^[0-9]{4,4}[-][0-1]{1,2}?[0-9]{1,2}[-][0-3]{1,2}?[0-9]{1,2}$/\", $array['Birthdate'])){\n\t\t\t$this->appendErrorMsg(\"Date should be in the format yyyy-mm-dd\");\n\t\t\t$errorFlag = false;\n\t\t} else if (getAge($array['Birthdate'])<16 || getAge($array['Birthdate'])> 100){\n\t\t\t$this->appendErrorMsg(\"Sorry, we do not provide coverage to drivers under the age of 16 or over the age of 100\");\n\t\t\t$errorFlag = false;\n\t\t}\n\t\tif (trim($array['PostalCode'])==''){\n\t\t\t$this->appendErrorMsg(\"Postal Code is required\");\n\t\t\t$errorFlag = false;\n\t\t} else if (!preg_match(\"/^[A-Za-z]{1}\\d{1}[A-Za-z]{1}\\d{1}[A-Za-z]{1}\\d{1}$/\",$array['PostalCode'])){\n\t\t\t$this->appendErrorMsg(\"Postal Code should be in the format A1B2C3\");\n\t\t\t$errorFlag = false;\n\t\t}\n\t\tif (trim($array['Phone'])==''){\n\t\t\t$this->appendErrorMsg(\"Phone number is required\");\n\t\t\t$errorFlag = false;\n\t\t} else if (!preg_match(\"/^[0-9]{10}$/\",$array['Phone'])){\n\t\t\t$this->appendErrorMsg(\"Phone number must be in the format xxx-xxx-xxxx or xxxxxxxxx\");\n\t\t\t$errorFlag = false;\n\t\t}\n\t\tif (!preg_match(\"/^[0-9]{1,}$/\", $array['Years_Exp'])){\n\t\t\t$this->appendErrorMsg(\"Please input the number of Years of Experience\");\n\t\t\t$errorFlag = false;\n\t\t}\n\t\treturn $errorFlag;\n\t}", "public function actionMedicalindividualvalidation() {\n\t\tif (\\Yii::$app->SessionCheck->isclientLogged () == true) \t\t// checking logged session\n\t\t{\n\t\t\t/**\n\t\t\t * Declaring Session Variables**\n\t\t\t */\n\t\t\t$this->layout = 'main';\n\t\t\t$session = \\Yii::$app->session;\n\t\t\t$logged_user_id = $session ['client_user_id'];\n\t\t\t\n\t\t\t$encrypt_component = new EncryptDecryptComponent ();\n\t\t\t$common_validation_component = new CommonValidationsComponent ();\n\t\t\t$validation_rule_ids = array ();\n\t\t\t$element_ids = array ();\n\t\t\t$arrvalidation_errors = array ();\n\t\t\t$arrvalidations = array ();\n\t\t\t$arrperiodvalidation_errors = array ();\n\t\t\t$get_company_id = \\Yii::$app->request->get ();\n\t\t\t\n\t\t\tif (! empty ( $get_company_id )) {\n\t\t\t\t\n\t\t\t\t/**\n\t\t\t\t * Encrypted company ID*\n\t\t\t\t */\n\t\t\t\t$encrypt_company_id = $get_company_id ['c_id'];\n\t\t\t\t$encrypt_medical_id = $get_company_id ['medical_id'];\n\t\t\t\t\n\t\t\t\tif (! empty ( $encrypt_company_id ) && ! empty ( $encrypt_medical_id )) {\n\t\t\t\t\t$company_id = $encrypt_component->decryptUser ( $encrypt_company_id ); // Decrypted company Id\n\t\t\t\t\t$medical_id = $encrypt_component->decryptUser ( $encrypt_medical_id ); // Decrypted payroll Id\n\t\t\t\t\t \n\t\t\t\t\t// / getting company details\n\t\t\t\t\t$company_details = TblAcaCompanies::find ()->select ( 'company_client_number,company_name' )->where ( 'company_id = :company_id', [ \n\t\t\t\t\t\t\t'company_id' => $company_id \n\t\t\t\t\t] )->one ();\n\t\t\t\t\t\n\t\t\t\t\t// / getting payroll details\n\t\t\t\t\t\n\t\t\t\t\t$medical_details = TblAcaMedicalData::find ()->where ( [ \n\t\t\t\t\t\t\t'employee_id' => $medical_id \n\t\t\t\t\t] )->One ();\n\t\t\t\t\t\n\t\t\t\t\tif (! empty ( $medical_details )) {\n\t\t\t\t\t\t\n\t\t\t\t\t\t// check for medical employee period\n\t\t\t\t\t\t\n\t\t\t\t\t\t$enrollment_periods = TblAcaMedicalEnrollmentPeriod::find ()->where ( [ \n\t\t\t\t\t\t\t\t'employee_id' => $medical_id \n\t\t\t\t\t\t] )->All ();\n\t\t\t\t\t\t\n\t\t\t\t\t\t/*for($i = 104; $i <= 139; $i ++) {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$validation_rule_ids [] = $i;\n\t\t\t\t\t\t}*/\n\t\t\t\t\t\t\n\t\t\t\t\t\t$validation_rule_ids = [ \n\t\t\t\t\t\t\t'104',\n\t\t\t\t\t\t\t'105',\n\t\t\t\t\t\t\t'106',\n\t\t\t\t\t\t\t'107',\n\t\t\t\t\t\t\t'108',\n\t\t\t\t\t\t\t'109',\n\t\t\t\t\t\t\t'110',\n\t\t\t\t\t\t\t'111',\n\t\t\t\t\t\t\t'112',\n\t\t\t\t\t\t\t'113',\n\t\t\t\t\t\t\t'114',\n\t\t\t\t\t\t\t'115',\n\t\t\t\t\t\t\t'116',\n\t\t\t\t\t\t\t'117',\n\t\t\t\t\t\t\t'118',\n\t\t\t\t\t\t\t'119',\n\t\t\t\t\t\t\t'120',\n\t\t\t\t\t\t\t'121',\n\t\t\t\t\t\t\t'122',\n\t\t\t\t\t\t\t'123',\n\t\t\t\t\t\t\t'124',\n\t\t\t\t\t\t\t'125',\n\t\t\t\t\t\t\t'126',\n\t\t\t\t\t\t\t'127',\n\t\t\t\t\t\t\t'128',\n\t\t\t\t\t\t\t'129',\n\t\t\t\t\t\t\t'130',\n\t\t\t\t\t\t\t'131',\n\t\t\t\t\t\t\t'132',\n\t\t\t\t\t\t\t'133',\n\t\t\t\t\t\t\t'134',\n\t\t\t\t\t\t\t'135',\n\t\t\t\t\t\t\t'136',\n\t\t\t\t\t\t\t'137',\n\t\t\t\t\t\t\t'138',\n\t\t\t\t\t\t\t'139',\n\t\t\t\t\t\t\t'153',\n\t\t\t\t\t\t\t'154',\n\t\t\t\t\t\t\t'155',\n\t\t\t\t\t\t\t'156'\n\t\t\t\t\t\t];\n\t\t\t\t\t\t\n\t\t\t\t\t\tfor($i = 1; $i <= 15; $i ++) {\n\t\t\t\t\t\t\t$element_ids [] = $i;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * *Check for validation errors***\n\t\t\t\t\t\t */\n\t\t\t\t\t\t$validation_results = TblAcaMedicalValidationLog::find ()->select ( 'validation_rule_id, is_validated' )->where ( [ \n\t\t\t\t\t\t\t\t'company_id' => $company_id,\n\t\t\t\t\t\t\t\t'employee_id' => $medical_id,\n\t\t\t\t\t\t\t\t'validation_rule_id' => $validation_rule_ids,\n\t\t\t\t\t\t\t\t'is_validated' => 0 \n\t\t\t\t\t\t] )->All ();\n\t\t\t\t\t\t\n\t\t\t\t\t\t$validation_period_results = TblAcaMedicalEnrollmentPeriodValidationLog::find ()->select ( 'period_id, validation_rule_id, is_validated' )->where ( [ \n\t\t\t\t\t\t\t\t'company_id' => $company_id,\n\t\t\t\t\t\t\t\t'employee_id' => $medical_id,\n\t\t\t\t\t\t\t\t'validation_rule_id' => $validation_rule_ids,\n\t\t\t\t\t\t\t\t'is_validated' => 0 \n\t\t\t\t\t\t] )->All ();\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (! empty ( $validation_results ) || ! empty ( $validation_period_results )) {\n\t\t\t\t\t\t\tif (! empty ( $validation_results )) {\n\t\t\t\t\t\t\t\tforeach ( $validation_results as $validations ) {\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t$arrvalidations [] = $validations->validation_rule_id;\n\t\t\t\t\t\t\t\t\t$arrvalidation_errors [$validations->validation_rule_id] ['error_message'] = $validations->validationRule->error_message;\n\t\t\t\t\t\t\t\t\t$arrvalidation_errors [$validations->validation_rule_id] ['error_code'] = $validations->validationRule->error_code;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif (! empty ( $validation_period_results )) {\n\t\t\t\t\t\t\t\tforeach ( $validation_period_results as $period_validations ) {\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t$arrperiodvalidation_errors [$period_validations->period_id] [$period_validations->validation_rule_id] ['error_message'] = $period_validations->validationRule->error_message;\n\t\t\t\t\t\t\t\t\t$arrperiodvalidation_errors [$period_validations->period_id] [$period_validations->validation_rule_id] ['error_code'] = $period_validations->validationRule->error_code;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$plan_classes = TblAcaPlanCoverageType::find ()->select ( 'plan_class_id, plan_class_number' )->where ( [ \n\t\t\t\t\t\t\t\t\t'company_id' => $company_id \n\t\t\t\t\t\t\t] )->all ();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t/**\n\t\t\t\t\t\t\t * Get all errors for general info *\n\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\t$get_post_validation_errors = TblAcaValidationRules::find ()->select ( 'rule_id, error_code, error_message' )->where ( [ \n\t\t\t\t\t\t\t\t\t'rule_id' => $validation_rule_ids \n\t\t\t\t\t\t\t] )->All ();\n\t\t\t\t\t\t\n\t\t\t\t\t\t\tif (! empty ( $get_post_validation_errors )) {\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tforeach ( $get_post_validation_errors as $errors ) {\n\t\t\t\t\t\t\t\t\t$post_validation_errors [$errors->rule_id] ['error_message'] = $errors->error_message;\n\t\t\t\t\t\t\t\t\t$post_validation_errors [$errors->rule_id] ['error_code'] = $errors->error_code;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$person_type_Data = ArrayHelper::map ( TblAcaLookupOptions::find ()->where ( [ \n\t\t\t\t\t\t\t\t\t'=',\n\t\t\t\t\t\t\t\t\t'code_id',\n\t\t\t\t\t\t\t\t\t10 \n\t\t\t\t\t\t\t] )->andwhere ( [ \n\t\t\t\t\t\t\t\t\t'<>',\n\t\t\t\t\t\t\t\t\t'lookup_status',\n\t\t\t\t\t\t\t\t\t2 \n\t\t\t\t\t\t\t] )->all (), 'lookup_id', 'lookup_value' );\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$employee_post_details = \\Yii::$app->request->post ();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif (! empty ( $employee_post_details )) {\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t// begin transaction\n\t\t\t\t\t\t\t\t$transaction = \\Yii::$app->db->beginTransaction ();\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t$medical_details->attributes = $employee_post_details ['TblAcaMedicalData'];\n\t\t\t\t\t\t\t\t\t//$medical_details->dob =date('Y-m-d',strtotime($employee_post_details ['TblAcaMedicalData']['dob']));\n\t\t\t\t\t\t\t\t\tif(!empty($employee_post_details ['TblAcaMedicalData']['ssn']))\n\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$medical_details->ssn = preg_replace ( '/[^0-9\\']/', '', $employee_post_details ['TblAcaMedicalData']['ssn'] ); \n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t// checking for duplicate SSN\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t$duplicate_ssn = TblAcaMedicalData::find ()->select ( 'ssn' )->where ('ssn='.$medical_details->ssn )->andWhere ( 'employee_id <> ' . $medical_id )->andWhere ( 'company_id='.$company_id )->All ();\n\t\t\t\t\t\t\t\t\t\tif(!empty($duplicate_ssn)){\n\t\t\t\t\t\t\t\t\t\t\tthrow new \\Exception ( 'SSN already exists' );\n\t\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\n\t\t\t\t\t\t\t\t\t//print_r($medical_details->attributes);die();\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tif ($medical_details->save () && $medical_details->validate ()) {\n\t\t\t\t\t\t\t\t\t\tif (! empty ( $employee_post_details ['TblAcaMedicalEnrollmentPeriod'] )) {\n\t\t\t\t\t\t\t\t\t\t\t$period_details = $employee_post_details ['TblAcaMedicalEnrollmentPeriod'];\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tforeach ( $period_details as $key => $details ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t$coverage_start_date = '';\n\t\t\t\t\t\t\t\t\t\t\t\t$coverage_end_date = '';\n\t\t\t\t\t\t\t\t\t\t\t\t$person_type = '';\n\t\t\t\t\t\t\t\t\t\t\t\t$ssn = '';\n\t\t\t\t\t\t\t\t\t\t\t\t$dob = '';\n\t\t\t\t\t\t\t\t\t\t\t\t$dependent_dob = '';\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\tif (! empty ( $details ['coverage_start_date'] )) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t$coverage_start_date = $details ['coverage_start_date'];\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\tif (! empty ( $details ['coverage_end_date'] )) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t$coverage_end_date = $details ['coverage_end_date'];\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\tif (! empty ( $details ['person_type'] )) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t$person_type = $details ['person_type'];\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\tif (! empty ( $details ['ssn'] )) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t$ssn = preg_replace ( '/[^0-9\\']/', '',$details ['ssn']);\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\tif (! empty ( $details ['dependent_dob'] )) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t$dependent_dob = $details ['dependent_dob'];\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\tif (! empty ( $details ['dob'] )) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t$dob = date('Y-m-d',strtotime($details ['dob']));\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t$encrypted_period_id = $key;\n\t\t\t\t\t\t\t\t\t\t\t\t$decrypted_period_id = $encrypt_component->decryptUser ( $encrypted_period_id );\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t$individual_period_details = TblAcaMedicalEnrollmentPeriod::find ()->where ( [ \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'period_id' => $decrypted_period_id \n\t\t\t\t\t\t\t\t\t\t\t\t] )->One ();\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\tif (! empty ( $individual_period_details )) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t$individual_period_details->coverage_start_date = $coverage_start_date;\n\t\t\t\t\t\t\t\t\t\t\t\t\t$individual_period_details->coverage_end_date = $coverage_end_date;\n\t\t\t\t\t\t\t\t\t\t\t\t\t$individual_period_details->person_type = $person_type;\n\t\t\t\t\t\t\t\t\t\t\t\t\t$individual_period_details->ssn = $ssn;\n\t\t\t\t\t\t\t\t\t\t\t\t\t$individual_period_details->dependent_dob = $dependent_dob;\n\t\t\t\t\t\t\t\t\t\t\t\t\t$individual_period_details->dob = $dob;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\tif ($individual_period_details->save () && $individual_period_details->validate ()) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$period_result ['success'] = 'success';\n\t\t\t\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$arrerrors = $individual_period_details->getFirstErrors ();\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$errorstring = '';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t/**\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t * *****Converting error into string*******\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tforeach ( $arrerrors as $key => $value ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$errorstring .= $value . '<br>';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tthrow new \\Exception ( $errorstring );\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\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\n\t\t\t\t\t\t\t\t\t\t// validate general plan info\n\t\t\t\t\t\t\t\t\t\t$validate_results = $common_validation_component->ValidateMedical ( $company_id, $medical_id, $element_ids );\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\tif (! empty ( $validate_results ['error'] )) {\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tthrow new \\Exception ( $validate_results ['error'] );\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t$validation_success = $validate_results ['success'];\n\t\t\t\t\t\t\t\t\t\t\t$validation_period_success = $validate_results ['period_success'];\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tif (empty ( $validation_success ) && empty ( $validation_period_success )) {\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\tTblAcaMedicalValidationLog::deleteAll ( 'company_id = :company_id AND employee_id = :employee_id', [ \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t':company_id' => $company_id,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t':employee_id' => $medical_id \n\t\t\t\t\t\t\t\t\t\t\t\t] );\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\tTblAcaMedicalEnrollmentPeriodValidationLog::deleteAll ( 'company_id = :company_id AND employee_id = :employee_id', [ \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t':company_id' => $company_id,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t':employee_id' => $medical_id \n\t\t\t\t\t\t\t\t\t\t\t\t] );\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t$model_company_validation_log =TblAcaCompanyValidationStatus::find()->where(['company_id'=>$company_id])->one();\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\tif(!empty($model_company_validation_log))\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t$model_company_validation_log->created_by = $logged_user_id;\n\t\t\t\t\t\t\t\t\t\t\t\t\t$model_company_validation_log->modified_by = $logged_user_id;\n\t\t\t\t\t\t\t\t\t\t\t\t\t$model_company_validation_log->medical_info_date = date('Y-m-d H:i:s');\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t$model_company_validation_log->save();\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t$transaction->commit (); // commit the transaction\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\\Yii::$app->session->setFlash ( 'success', 'Value updated successfully' );\n\t\t\t\t\t\t\t\t\t\t\t\treturn $this->redirect ( array (\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'/client/validateforms/medicalvalidation?c_id=' . $encrypt_company_id \n\t\t\t\t\t\t\t\t\t\t\t\t) );\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t\t$arrvalidation_errors = array ();\n\t\t\t\t\t\t\t\t\t\t\t\t$arrperiodvalidation_errors = array ();\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\tif (! empty ( $validation_success )) {\n\t\t\t\t\t\t\t\t\t\t\t\t\tforeach ( $validation_success as $key => $value ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif ($value == 0) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$arrvalidation_errors [$key] ['error_message'] = $post_validation_errors [$key] ['error_message'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$arrvalidation_errors [$key] ['error_code'] = $post_validation_errors [$key] ['error_code'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\tif (! empty ( $validation_period_success )) {\n\t\t\t\t\t\t\t\t\t\t\t\t\tforeach ( $validation_period_success as $key => $validations ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tforeach ( $validations as $validation_rule_id => $is_validated ) {\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\t\t\t\t\t\t\tif ($is_validated == 0) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$arrperiodvalidation_errors [$key] [$validation_rule_id] ['error_message'] = $post_validation_errors [$validation_rule_id] ['error_message'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$arrperiodvalidation_errors [$key] [$validation_rule_id] ['error_code'] = $post_validation_errors [$validation_rule_id] ['error_code'];\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\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t// check for payroll employee period\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t$enrollment_periods = TblAcaMedicalEnrollmentPeriod::find ()->where ( [ \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'employee_id' => $medical_id \n\t\t\t\t\t\t\t\t\t\t\t\t] )->All ();\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t$transaction->rollBack ();\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t$arrerrors = $medical_details->getFirstErrors ();\n\t\t\t\t\t\t\t\t\t\t$errorstring = '';\n\t\t\t\t\t\t\t\t\t\t/**\n\t\t\t\t\t\t\t\t\t\t * *****Converting error into string*******\n\t\t\t\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\t\t\t\tforeach ( $arrerrors as $key => $value ) {\n\t\t\t\t\t\t\t\t\t\t\t$errorstring .= $value . '<br>';\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\tthrow new \\Exception ( $errorstring );\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} catch ( \\Exception $e ) {\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t$msg = $e->getMessage ();\n\t\t\t\t\t\t\t\t\t\\Yii::$app->session->setFlash ( 'error', $msg );\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t// rollback transaction\n\t\t\t\t\t\t\t\t\t$transaction->rollback ();\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\treturn $this->redirect ( array (\n\t\t\t\t\t\t\t\t\t\t\t'/client/validateforms/medicalindividualvalidation?c_id=' . $encrypt_company_id . '&medical_id=' . $encrypt_medical_id \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\t\n\t\t\t\t\t\t\treturn $this->render ( 'medicalindividualvalidation', array (\n\t\t\t\t\t\t\t\t\t'company_detals' => $company_details,\n\t\t\t\t\t\t\t\t\t'medical_details' => $medical_details,\n\t\t\t\t\t\t\t\t\t'encrypt_company_id' => $encrypt_company_id,\n\t\t\t\t\t\t\t\t\t'arrvalidations' => $arrvalidations,\n\t\t\t\t\t\t\t\t\t'arrvalidation_errors' => $arrvalidation_errors,\n\t\t\t\t\t\t\t\t\t'enrollment_periods' => $enrollment_periods,\n\t\t\t\t\t\t\t\t\t'arrperiodvalidation_errors' => $arrperiodvalidation_errors,\n\t\t\t\t\t\t\t\t\t'plan_classes' => $plan_classes,\n\t\t\t\t\t\t\t\t\t'encoded_company_id' => $encrypt_company_id,\n\t\t\t\t\t\t\t\t\t'encrypt_medical_id' => $encrypt_medical_id,\n\t\t\t\t\t\t\t\t\t'person_type_Data' => $person_type_Data \n\t\t\t\t\t\t\t) );\n\t\t\t\t\t\t}else\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\\Yii::$app->session->setFlash ( 'success', 'No issues in the employee.' );\n\t\t\t\t\t\t\treturn $this->redirect ( array (\n\t\t\t\t\t\t\t'/client/validateforms/medicalvalidation?c_id='.$encrypt_company_id \n\t\t\t\t\t\t\t\t) );\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\treturn $this->redirect ( array (\n\t\t\t\t\t\t\t'/client/companies' \n\t\t\t\t\t) );\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t\\Yii::$app->SessionCheck->clientlogout (); // client logout\n\t\t\t\n\t\t\treturn $this->goHome ();\n\t\t}\n\t}", "public function sanitiseData(): void\n {\n $this->firstLine = self::sanitiseString($this->firstLine);\n self::validateExistsAndLength($this->firstLine, 1000);\n $this->secondLine = self::sanitiseString($this->secondLine);\n self::validateExistsAndLength($this->secondLine, 1000);\n $this->town = self::sanitiseString($this->town);\n self::validateExistsAndLength($this->town, 255);\n $this->postcode = self::sanitiseString($this->postcode);\n self::validateExistsAndLength($this->postcode, 10);\n $this->county = self::sanitiseString($this->county);\n self::validateExistsAndLength($this->county, 255);\n $this->country = self::sanitiseString($this->country);\n self::validateExistsAndLength($this->country, 255);\n }", "private function validRow($arrayToCheck) {\n if (isset($arrayToCheck) && !empty($arrayToCheck)) {\n //check number values\n if (count($arrayToCheck) == COUNT_VALUES) {\n //check values needed to put in database\n \n //Check subscriber\n if (!intval($arrayToCheck[2])) {\n $this->arrMsgError[] = array(\n 'data' => $arrayToCheck,\n 'error' => 'Subscriber is not an integer'\n );\n return false;\n }\n\n //Check date\n list($day, $month, $year) = explode('/', $arrayToCheck[3]);\n if(!checkdate($month,$day,$year)) {\n $this->arrMsgError[] = array(\n 'data' => $arrayToCheck,\n 'error' => 'Date is wrong'\n );\n return false;\n }\n\n //Check hour\n if (!preg_match(\"/^(?:2[0-3]|[01][0-9]):[0-5][0-9]:[0-5][0-9]$/\", $arrayToCheck[4])) {\n $this->arrMsgError[] = array(\n 'data' => $arrayToCheck,\n 'error' => 'Time is wrong'\n );\n return false;\n }\n\n //Check Consumption\n if (preg_match(\"/^(?:2[0-3]|[01][0-9]):[0-5][0-9]:[0-5][0-9]$/\", $arrayToCheck[5])) {\n $type = 'call';\n $parsed = date_parse($arrayToCheck[5]);\n $consumption = $parsed['hour'] * 3600 + $parsed['minute'] * 60 + $parsed['second'];\n }\n elseif ($arrayToCheck[6] == '0.0' || intval($arrayToCheck[6])) {\n $type = 'data';\n $consumption = intval($arrayToCheck[6]);\n }\n elseif ($arrayToCheck[5]=='' || $arrayToCheck[6]=='') {\n $type = 'sms';\n $consumption = '';\n }\n else {\n $this->arrMsgError[] = array(\n 'data' => $arrayToCheck,\n 'error' => 'Consumption values are not good'\n );\n return false;\n }\n\n //return array to insert in database \n //array(subscriber, datetime, consumption, $type)\n $date = date(\"Y-m-d H:i:s\", strtotime(str_replace('/', '-', $arrayToCheck[3]).' '.$arrayToCheck[4]));\n return array(\n 'subscriber' => $arrayToCheck[2],\n 'date' => $date,\n 'consumption' => $consumption,\n 'type' => $type);\n } \n else\n return false;\n }\n else {\n return false;\n }\n }", "abstract public function validateData();", "function ValidateData()\n\t\t{\n\t\t\t$theValidator = new CValidator();\n\t\t\tif(!$this->arrValidator || !is_array($this->arrValidator) )\n\t\t\t{\n\t\t\t\t$this->arrValidator = array();\n\t\t\t}\n\t\t\tforeach($this->arrValidator as $key=>$value)\n\t\t\t{\n\t\t\t\tif($this->$key == '')\n\t\t\t\t{\n\t\t\t\t\t// Kiem tra xem co phai bat buoc khong?\n\t\t\t\t\tif(isset($this->arrRequired[$key]) && ($this->arrRequired[$key] == 1))\n\t\t\t\t\t{\n\t\t\t\t\t\treturn(false);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif(!$theValidator->CheckPatt($value, $this->$key))\n\t\t\t\t\t{\n\t\t\t\t\t\treturn(false);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn(true);\n\t\t}", "function addValidationRules(){\n\t\t$this->registerRule('validDate','function','validDate');\n\t\t$this->registerRule('validPeriod','function','validPeriod');\n\t\t$this->registerRule('existe','function','existe');\n\t\t$this->registerRule('number_range','function','number_range');\n\t\t$this->registerRule('validInterval','function','validInterval');\n\t\t$this->registerRule('couple_not_null','function','couple_not_null');\n\t\t$this->registerRule('validParam','function','validParam');\n\t\t$this->registerRule('validUnit_existe','function','validUnit_existe');\n\t\t$this->registerRule('validUnit_required','function','validUnit_required');\n\t\t$this->addRule('dats_title','Data description: Metadata informative title is required','required');\n\t\t$this->addRule('dats_title','Data description: Dataset name exceeds the maximum length allowed (100 characters)','maxlength',100);\t\n\t\t$this->addRule('dats_date_begin','Temporal coverage: Date begin is not a date','validDate');\n\t\t$this->addRule('dats_date_end','Temporal coverage: Date end is not a date','validDate');\n\t\t$this->addRule(array('dats_date_begin','dats_date_end'),'Temporal coverage: Date end must be after date begin','validPeriod');\n\t\tif ($this->dataset->dats_id == 0){\n\t\t\t$this->addRule('dats_title','Data description: A dataset with the same title exists in the database','existe',array('dataset','dats_title'));\n\t\t}\n\t\t\n\t\tif (isset($this->dataset->data_policy) && !empty($this->dataset->data_policy) && $this->dataset->data_policy->data_policy_id > 0){\n\t\t\t$this->getElement('new_data_policy')->setAttribute('onfocus','blur()');\n\t\t}\n\t\t$this->addRule('new_data_policy','Data use information: Data policy exceeds the maximum length allowed (100 characters)','maxlength',100);\t\n\t\t$attrs = array();\n\t\tif (isset($this->dataset->database) && !empty($this->dataset->database) && $this->dataset->database->database_id > 0){\n\t\t\t//$this->getElement('new_database')->setAttribute('onfocus','blur()');\n\t\t\t//$this->getElement('new_db_url')->setAttribute('onfocus','blur()');\n\t\t\t$this->disableElement('new_database');\n\t\t\t$this->disableElement('new_db_url');\n\t\t}\n\t\t/*else {\n\t\t\t//$this->addRule('new_database','A database with the same title already exists','existe',array('database','database_name'));\n\t\t}*/\n\t\t$this->addRule('new_database','Data use information: Database name exceeds the maximum length allowed (250 characters)','maxlength',250);\n\t\t$this->addRule('new_db_url','Data use information: Database url exceeds the maximum length allowed (250 characters)','maxlength',250);\t\n\t\t//Formats\n\t\tfor ($i = 0; $i < $this->dataset->nbFormats; $i++){\n\t\t\t$this->addRule('data_format_'.$i,'Data use information: Format name '.($i+1).' exceeds the maximum length allowed (100 characters)','maxlength',100);\n\t\t\tif (isset($this->dataset->data_formats[$i]) && !empty($this->dataset->data_formats[$i]) && $this->dataset->data_formats[$i]->data_format_id > 0){\n\t\t\t\t//$this->getElement('new_data_format_'.$i)->setAttribute('onfocus','blur()');\n\t\t\t\t$this->disableElement('new_data_format_'.$i);\n\t\t\t}\n\t\t\t/*else{\n\t\t\t\t//$this->addRule('new_data_format_'.$i,'Data format '.($i+1).': This format already exists in the database','existe',array('data_format','data_format_name'));\n\t\t\t}*/\n\t\t}\n\t\t//Contacts\n\t\t$this->addRule('pi_0','Contact 1 is required','couple_not_null',array($this,'pi_name_0'));\n\t\t$this->addRule('organism_0','Contact 1: organism is required','couple_not_null',array($this,'org_sname_0'));\n\t\t$this->addRule('email1_0','Contact 1: email1 is required','required');\t\n\t\tfor ($i = 0; $i < $this->dataset->nbPis; $i++){\n\t\t\t$this->addRule('pi_name_'.$i,'Contact '.($i+1).': Name exceeds the maximum length allowed (250 characters)','maxlength',250);\n\t\t\t$this->addRule('email1_'.$i,'Contact '.($i+1).': email1 is incorrect','email');\n\t\t\t$this->addRule('email2_'.$i,'Contact '.($i+1).': email2 is incorrect','email');\n\t\t\t$this->addRule('org_fname_'.$i,'Contact '.($i+1).': Organism full name exceeds the maximum length allowed (250 characters)','maxlength',250);\n\t\t\t$this->addRule('org_sname_'.$i,'Contact '.($i+1).': Organism short name exceeds the maximum length allowed (50 characters)','maxlength',50);\n\t\t\t$this->addRule('org_url_'.$i,'Contact '.($i+1).': Organism url exceeds the maximum length allowed (250 characters)','maxlength',250);\n\t\t\t$this->addRule('email1_'.$i,'Contact '.($i+1).': email1 exceeds the maximum length allowed (250 characters)','maxlength',250);\n\t\t\t$this->addRule('email2_'.$i,'Contact '.($i+1).': email2 exceeds the maximum length allowed (250 characters)','maxlength',250);\n\t\t\tif (isset($this->dataset->originators[$i]) && !empty($this->dataset->originators[$i]) && $this->dataset->originators[$i]->pers_id > 0){\n\t\t\t\t//$this->getElement('pi_name_'.$i)->setAttribute('onfocus','blur()');\n\t\t\t\t//$this->getElement('email1_'.$i)->setAttribute('onfocus','blur()');\n\t\t\t\t//$this->getElement('email2_'.$i)->setAttribute('onfocus','blur()');\n\t\t\t\t//$this->getElement('organism_'.$i)->setAttribute('onfocus','blur()');\n\t\t\t\t$this->disableElement('pi_name_'.$i);\n\t\t\t\t$this->disableElement('email1_'.$i);\n\t\t\t\t$this->disableElement('email2_'.$i);\n\t\t\t\t$this->disableElement('organism_'.$i);\n\t\t\t}\n\t\t\t/*else{\n\t\t\t\t//$this->addRule('pi_name_'.$i,'Contact '.($i+1).': A contact with the same name is already present in the database. Select it in the drop-down list.','existe',array('personne','pers_name'));\n\t\t\t}*/\n\t\t\tif (isset($this->dataset->originators[$i]->organism) && !empty($this->dataset->originators[$i]->organism) && $this->dataset->originators[$i]->organism->org_id > 0){\n\t\t\t\t//$this->getElement('org_sname_'.$i)->setAttribute('onfocus','blur()');\n\t\t\t\t//$this->getElement('org_fname_'.$i)->setAttribute('onfocus','blur()');\n\t\t\t\t//$this->getElement('org_url_'.$i)->setAttribute('onfocus','blur()');\n\t\t\t\t$this->disableElement('org_sname_'.$i);\n\t\t\t\t$this->disableElement('org_fname_'.$i);\n\t\t\t\t$this->disableElement('org_url_'.$i);\n\t\t\t}\n\t\t\tif ($i != 0){\n\t\t\t\t$this->addRule('pi_name_'.$i,'Contact '.($i+1).': email1 is required','contact_email_required',array($this,$i));\n\t\t\t\t$this->addRule('pi_name_'.$i,'Contact '.($i+1).': organism is required','contact_organism_required',array($this,$i));\n\t\t\t}\n\t\t}\n\t\t\n\t\t//Add validation rules\n\t\t$this->AddModValidationRules();\n\t\t$this->AddSatValidationRules();\n\t\t$this->AddInstruValidationRules();\n\n\t\t//$this->addRule('grid_type','Coverage: Grid type exceeds the maximum length allowed (100 characters)','maxlength',100);\n\t\t$this->addVaValidationRulesResolution('Coverage');\n\t\t//$this->addRule('sensor_resol_temp','Coverage: Temporal resolution is incorrect','validDate');\n\t\t$this->addRule('sensor_resol_tmp','Coverage: temporal resolution is incorrect','regex',\"/^[0-9]{2}[:][0-9]{2}[:][0-9]{2}$/\");\n\t\t$this->addValidationRulesGeoCoverage();\n\t\t//PARAMETER\n\t\tfor ($i = 0; $i < $this->dataset->nbVars; $i++){\n\t\t\t$this->addValidationRulesVariable($i,$i,'Parameter '.($i+1));\n\t\t}\n\t\t\n\t}", "private function checkData(){\n $this->datavalidator->addValidation('article_title','req',$this->text('e10'));\n $this->datavalidator->addValidation('article_title','maxlen=250',$this->text('e11'));\n $this->datavalidator->addValidation('article_prologue','req',$this->text('e12'));\n $this->datavalidator->addValidation('article_prologue','maxlen=3000',$this->text('e13'));\n $this->datavalidator->addValidation('keywords','regexp=/^[^,\\s]{3,}(,? ?[^,\\s]{3,})*$/',$this->text('e32'));\n $this->datavalidator->addValidation('keywords','maxlen=500',$this->text('e33'));\n if($this->data['layout'] != 'g' && $this->data['layout'] != 'h'){ //if article is gallery dont need content\n $this->datavalidator->addValidation('article_content','req',$this->text('e14'));\n }\n $this->datavalidator->addValidation('id_menucategory','req',$this->text('e15'));\n $this->datavalidator->addValidation('id_menucategory','numeric',$this->text('e16'));\n $this->datavalidator->addValidation('layout','req',$this->text('e17'));\n $this->datavalidator->addValidation('layout','maxlen=1',$this->text('e18'));\n if($this->languager->getLangsCount() > 1){\n $this->datavalidator->addValidation('lang','req',$this->text('e19'));\n $this->datavalidator->addValidation('lang','numeric',$this->text('e20'));\n }\n //if user cannot publish articles check publish values\n if($_SESSION[PAGE_SESSIONID]['privileges']['articles'][2] == '1') {\n $this->datavalidator->addValidation('published','req',$this->text('e21'));\n $this->datavalidator->addValidation('published','numeric',$this->text('e22'));\n $this->datavalidator->addValidation('publish_date','req',$this->text('e23'));\n }\n $this->datavalidator->addValidation('topped','req',$this->text('e24'));\n $this->datavalidator->addValidation('topped','numeric',$this->text('e25'));\n $this->datavalidator->addValidation('homepage','req',$this->text('e30'));\n $this->datavalidator->addValidation('homepage','numeric',$this->text('e31'));\n $this->datavalidator->addValidation('showsocials','req',$this->text('e26'));\n $this->datavalidator->addValidation('showsocials','numeric',$this->text('e27'));\n \n $result = $this->datavalidator->ValidateData($this->data);\n if(!$result){\n $errors = $this->datavalidator->GetErrors();\n return array('state'=>'error','data'=> reset($errors));\n }else{\n return true;\n }\n }", "public function _getValidationErrors()\n {\n $errs = parent::_getValidationErrors();\n $validationRules = $this->_getValidationRules();\n if (null !== ($v = $this->getAccident())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_ACCIDENT] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getAccidentType())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_ACCIDENT_TYPE] = $fieldErrs;\n }\n }\n if ([] !== ($vs = $this->getAdditionalMaterials())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_ADDITIONAL_MATERIALS, $i)] = $fieldErrs;\n }\n }\n }\n if ([] !== ($vs = $this->getCondition())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_CONDITION, $i)] = $fieldErrs;\n }\n }\n }\n if ([] !== ($vs = $this->getCoverage())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_COVERAGE, $i)] = $fieldErrs;\n }\n }\n }\n if (null !== ($v = $this->getCreated())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_CREATED] = $fieldErrs;\n }\n }\n if ([] !== ($vs = $this->getDiagnosis())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_DIAGNOSIS, $i)] = $fieldErrs;\n }\n }\n }\n if (null !== ($v = $this->getEnterer())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_ENTERER] = $fieldErrs;\n }\n }\n if ([] !== ($vs = $this->getException())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_EXCEPTION, $i)] = $fieldErrs;\n }\n }\n }\n if (null !== ($v = $this->getFacility())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_FACILITY] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getFundsReserve())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_FUNDS_RESERVE] = $fieldErrs;\n }\n }\n if ([] !== ($vs = $this->getIdentifier())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_IDENTIFIER, $i)] = $fieldErrs;\n }\n }\n }\n if ([] !== ($vs = $this->getInterventionException())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_INTERVENTION_EXCEPTION, $i)] = $fieldErrs;\n }\n }\n }\n if ([] !== ($vs = $this->getItem())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_ITEM, $i)] = $fieldErrs;\n }\n }\n }\n if ([] !== ($vs = $this->getMissingTeeth())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_MISSING_TEETH, $i)] = $fieldErrs;\n }\n }\n }\n if (null !== ($v = $this->getOrganization())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_ORGANIZATION] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getOriginalPrescription())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_ORIGINAL_PRESCRIPTION] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getOriginalRuleset())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_ORIGINAL_RULESET] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getPatient())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_PATIENT] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getPayee())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_PAYEE] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getPrescription())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_PRESCRIPTION] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getPriority())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_PRIORITY] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getProvider())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_PROVIDER] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getReferral())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_REFERRAL] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getRuleset())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_RULESET] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getSchool())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_SCHOOL] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getTarget())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_TARGET] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getType())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_TYPE] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getUse())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_USE] = $fieldErrs;\n }\n }\n if (isset($validationRules[self::FIELD_ACCIDENT])) {\n $v = $this->getAccident();\n foreach($validationRules[self::FIELD_ACCIDENT] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_ACCIDENT, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_ACCIDENT])) {\n $errs[self::FIELD_ACCIDENT] = [];\n }\n $errs[self::FIELD_ACCIDENT][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_ACCIDENT_TYPE])) {\n $v = $this->getAccidentType();\n foreach($validationRules[self::FIELD_ACCIDENT_TYPE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_ACCIDENT_TYPE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_ACCIDENT_TYPE])) {\n $errs[self::FIELD_ACCIDENT_TYPE] = [];\n }\n $errs[self::FIELD_ACCIDENT_TYPE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_ADDITIONAL_MATERIALS])) {\n $v = $this->getAdditionalMaterials();\n foreach($validationRules[self::FIELD_ADDITIONAL_MATERIALS] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_ADDITIONAL_MATERIALS, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_ADDITIONAL_MATERIALS])) {\n $errs[self::FIELD_ADDITIONAL_MATERIALS] = [];\n }\n $errs[self::FIELD_ADDITIONAL_MATERIALS][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_CONDITION])) {\n $v = $this->getCondition();\n foreach($validationRules[self::FIELD_CONDITION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_CONDITION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_CONDITION])) {\n $errs[self::FIELD_CONDITION] = [];\n }\n $errs[self::FIELD_CONDITION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_COVERAGE])) {\n $v = $this->getCoverage();\n foreach($validationRules[self::FIELD_COVERAGE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_COVERAGE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_COVERAGE])) {\n $errs[self::FIELD_COVERAGE] = [];\n }\n $errs[self::FIELD_COVERAGE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_CREATED])) {\n $v = $this->getCreated();\n foreach($validationRules[self::FIELD_CREATED] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_CREATED, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_CREATED])) {\n $errs[self::FIELD_CREATED] = [];\n }\n $errs[self::FIELD_CREATED][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_DIAGNOSIS])) {\n $v = $this->getDiagnosis();\n foreach($validationRules[self::FIELD_DIAGNOSIS] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_DIAGNOSIS, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_DIAGNOSIS])) {\n $errs[self::FIELD_DIAGNOSIS] = [];\n }\n $errs[self::FIELD_DIAGNOSIS][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_ENTERER])) {\n $v = $this->getEnterer();\n foreach($validationRules[self::FIELD_ENTERER] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_ENTERER, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_ENTERER])) {\n $errs[self::FIELD_ENTERER] = [];\n }\n $errs[self::FIELD_ENTERER][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_EXCEPTION])) {\n $v = $this->getException();\n foreach($validationRules[self::FIELD_EXCEPTION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_EXCEPTION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_EXCEPTION])) {\n $errs[self::FIELD_EXCEPTION] = [];\n }\n $errs[self::FIELD_EXCEPTION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_FACILITY])) {\n $v = $this->getFacility();\n foreach($validationRules[self::FIELD_FACILITY] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_FACILITY, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_FACILITY])) {\n $errs[self::FIELD_FACILITY] = [];\n }\n $errs[self::FIELD_FACILITY][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_FUNDS_RESERVE])) {\n $v = $this->getFundsReserve();\n foreach($validationRules[self::FIELD_FUNDS_RESERVE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_FUNDS_RESERVE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_FUNDS_RESERVE])) {\n $errs[self::FIELD_FUNDS_RESERVE] = [];\n }\n $errs[self::FIELD_FUNDS_RESERVE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_IDENTIFIER])) {\n $v = $this->getIdentifier();\n foreach($validationRules[self::FIELD_IDENTIFIER] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_IDENTIFIER, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_IDENTIFIER])) {\n $errs[self::FIELD_IDENTIFIER] = [];\n }\n $errs[self::FIELD_IDENTIFIER][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_INTERVENTION_EXCEPTION])) {\n $v = $this->getInterventionException();\n foreach($validationRules[self::FIELD_INTERVENTION_EXCEPTION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_INTERVENTION_EXCEPTION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_INTERVENTION_EXCEPTION])) {\n $errs[self::FIELD_INTERVENTION_EXCEPTION] = [];\n }\n $errs[self::FIELD_INTERVENTION_EXCEPTION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_ITEM])) {\n $v = $this->getItem();\n foreach($validationRules[self::FIELD_ITEM] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_ITEM, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_ITEM])) {\n $errs[self::FIELD_ITEM] = [];\n }\n $errs[self::FIELD_ITEM][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_MISSING_TEETH])) {\n $v = $this->getMissingTeeth();\n foreach($validationRules[self::FIELD_MISSING_TEETH] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_MISSING_TEETH, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_MISSING_TEETH])) {\n $errs[self::FIELD_MISSING_TEETH] = [];\n }\n $errs[self::FIELD_MISSING_TEETH][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_ORGANIZATION])) {\n $v = $this->getOrganization();\n foreach($validationRules[self::FIELD_ORGANIZATION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_ORGANIZATION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_ORGANIZATION])) {\n $errs[self::FIELD_ORGANIZATION] = [];\n }\n $errs[self::FIELD_ORGANIZATION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_ORIGINAL_PRESCRIPTION])) {\n $v = $this->getOriginalPrescription();\n foreach($validationRules[self::FIELD_ORIGINAL_PRESCRIPTION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_ORIGINAL_PRESCRIPTION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_ORIGINAL_PRESCRIPTION])) {\n $errs[self::FIELD_ORIGINAL_PRESCRIPTION] = [];\n }\n $errs[self::FIELD_ORIGINAL_PRESCRIPTION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_ORIGINAL_RULESET])) {\n $v = $this->getOriginalRuleset();\n foreach($validationRules[self::FIELD_ORIGINAL_RULESET] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_ORIGINAL_RULESET, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_ORIGINAL_RULESET])) {\n $errs[self::FIELD_ORIGINAL_RULESET] = [];\n }\n $errs[self::FIELD_ORIGINAL_RULESET][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_PATIENT])) {\n $v = $this->getPatient();\n foreach($validationRules[self::FIELD_PATIENT] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_PATIENT, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_PATIENT])) {\n $errs[self::FIELD_PATIENT] = [];\n }\n $errs[self::FIELD_PATIENT][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_PAYEE])) {\n $v = $this->getPayee();\n foreach($validationRules[self::FIELD_PAYEE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_PAYEE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_PAYEE])) {\n $errs[self::FIELD_PAYEE] = [];\n }\n $errs[self::FIELD_PAYEE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_PRESCRIPTION])) {\n $v = $this->getPrescription();\n foreach($validationRules[self::FIELD_PRESCRIPTION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_PRESCRIPTION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_PRESCRIPTION])) {\n $errs[self::FIELD_PRESCRIPTION] = [];\n }\n $errs[self::FIELD_PRESCRIPTION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_PRIORITY])) {\n $v = $this->getPriority();\n foreach($validationRules[self::FIELD_PRIORITY] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_PRIORITY, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_PRIORITY])) {\n $errs[self::FIELD_PRIORITY] = [];\n }\n $errs[self::FIELD_PRIORITY][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_PROVIDER])) {\n $v = $this->getProvider();\n foreach($validationRules[self::FIELD_PROVIDER] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_PROVIDER, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_PROVIDER])) {\n $errs[self::FIELD_PROVIDER] = [];\n }\n $errs[self::FIELD_PROVIDER][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_REFERRAL])) {\n $v = $this->getReferral();\n foreach($validationRules[self::FIELD_REFERRAL] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_REFERRAL, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_REFERRAL])) {\n $errs[self::FIELD_REFERRAL] = [];\n }\n $errs[self::FIELD_REFERRAL][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_RULESET])) {\n $v = $this->getRuleset();\n foreach($validationRules[self::FIELD_RULESET] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_RULESET, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_RULESET])) {\n $errs[self::FIELD_RULESET] = [];\n }\n $errs[self::FIELD_RULESET][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_SCHOOL])) {\n $v = $this->getSchool();\n foreach($validationRules[self::FIELD_SCHOOL] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_SCHOOL, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_SCHOOL])) {\n $errs[self::FIELD_SCHOOL] = [];\n }\n $errs[self::FIELD_SCHOOL][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_TARGET])) {\n $v = $this->getTarget();\n foreach($validationRules[self::FIELD_TARGET] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_TARGET, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_TARGET])) {\n $errs[self::FIELD_TARGET] = [];\n }\n $errs[self::FIELD_TARGET][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_TYPE])) {\n $v = $this->getType();\n foreach($validationRules[self::FIELD_TYPE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_TYPE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_TYPE])) {\n $errs[self::FIELD_TYPE] = [];\n }\n $errs[self::FIELD_TYPE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_USE])) {\n $v = $this->getUse();\n foreach($validationRules[self::FIELD_USE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_USE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_USE])) {\n $errs[self::FIELD_USE] = [];\n }\n $errs[self::FIELD_USE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_CONTAINED])) {\n $v = $this->getContained();\n foreach($validationRules[self::FIELD_CONTAINED] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE, self::FIELD_CONTAINED, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_CONTAINED])) {\n $errs[self::FIELD_CONTAINED] = [];\n }\n $errs[self::FIELD_CONTAINED][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_EXTENSION])) {\n $v = $this->getExtension();\n foreach($validationRules[self::FIELD_EXTENSION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE, self::FIELD_EXTENSION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_EXTENSION])) {\n $errs[self::FIELD_EXTENSION] = [];\n }\n $errs[self::FIELD_EXTENSION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_MODIFIER_EXTENSION])) {\n $v = $this->getModifierExtension();\n foreach($validationRules[self::FIELD_MODIFIER_EXTENSION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE, self::FIELD_MODIFIER_EXTENSION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_MODIFIER_EXTENSION])) {\n $errs[self::FIELD_MODIFIER_EXTENSION] = [];\n }\n $errs[self::FIELD_MODIFIER_EXTENSION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_TEXT])) {\n $v = $this->getText();\n foreach($validationRules[self::FIELD_TEXT] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE, self::FIELD_TEXT, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_TEXT])) {\n $errs[self::FIELD_TEXT] = [];\n }\n $errs[self::FIELD_TEXT][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_ID])) {\n $v = $this->getId();\n foreach($validationRules[self::FIELD_ID] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_RESOURCE, self::FIELD_ID, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_ID])) {\n $errs[self::FIELD_ID] = [];\n }\n $errs[self::FIELD_ID][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_IMPLICIT_RULES])) {\n $v = $this->getImplicitRules();\n foreach($validationRules[self::FIELD_IMPLICIT_RULES] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_RESOURCE, self::FIELD_IMPLICIT_RULES, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_IMPLICIT_RULES])) {\n $errs[self::FIELD_IMPLICIT_RULES] = [];\n }\n $errs[self::FIELD_IMPLICIT_RULES][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_LANGUAGE])) {\n $v = $this->getLanguage();\n foreach($validationRules[self::FIELD_LANGUAGE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_RESOURCE, self::FIELD_LANGUAGE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_LANGUAGE])) {\n $errs[self::FIELD_LANGUAGE] = [];\n }\n $errs[self::FIELD_LANGUAGE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_META])) {\n $v = $this->getMeta();\n foreach($validationRules[self::FIELD_META] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_RESOURCE, self::FIELD_META, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_META])) {\n $errs[self::FIELD_META] = [];\n }\n $errs[self::FIELD_META][$rule] = $err;\n }\n }\n }\n return $errs;\n }", "function _prepare_validation()\n\t{\n\t\t$this->load->library('form_validation');\t\n\t\t$this->form_validation->set_error_delimiters('<div class=\"error\">', '</div>');\n\t\t//Setting Validation Rule\t\n\t\t$this->form_validation->set_rules('samity_id','Code','trim|required|xss_clean|max_length[100]');\n\t\t$this->form_validation->set_rules('cbo_samity_day','Samity Day','trim|required|xss_clean');\n\t\t$this->form_validation->set_rules('txt_effective_date','Effective Date','trim|required|max_length[10]|is_date|xss_clean|callback_check_samity_effective_date');\t\n\t}", "function isDataValid() \n {\n return true;\n }", "public function validateDetails($attribute,$params)\n {\n if (count($this->orderDetails) == 0) {\n $this->addError('orderDetails', 'Order Details need to be entered');\n }\n }", "protected function prepareForValidation()\n {\n $merge = [];\n\n if ($this->valtotal) {\n $merge['valtotal'] = Format::strToFloat($this->valtotal);\n }\n\n $this->merge($merge);\n }", "private function validateDescriptiveRecord()\n {\n if (! preg_match($this->bsbRegex, $this->bsb)) {\n throw new Exception('Descriptive record bsb is invalid. Required format is 000-000.');\n }\n\n if (! preg_match('/^[\\d]{0,9}$/', $this->accountNumber)) {\n throw new Exception('Descriptive record account number is invalid. Must be up to 9 digits only.');\n }\n\n if (! preg_match('/^[A-Z]{3}$/', $this->bankName)) {\n throw new Exception('Descriptive record bank name is invalid. Must be capital letter abbreviation of length 3.');\n }\n\n if (! preg_match('/^[A-Za-z\\s+]{0,26}$/', $this->userName)) {\n throw new Exception('Descriptive record user name is invalid. Must be letters only and up to 26 characters long.');\n }\n\n if (! preg_match('/^[\\d]{6}$/', $this->directEntryUserId)) {\n throw new Exception('Descriptive record direct entiry user ID is invalid. Must be 6 digits long.');\n }\n\n if (! preg_match('/^[A-Za-z\\s]{0,12}$/', $this->description)) {\n throw new Exception('Descriptive record description is invalid. Must be letters only and up to 12 characters long.');\n }\n }", "public function check_data()\n {\n parent::check_data();\n\n if(empty($this->build_notifications))\n {\n throw new exception('<strong>Data missing: Notifications</strong>');\n }\n\n if(empty($this->build_batch_reference))\n {\n throw new exception('<strong>Data missing: Batch References</strong>');\n }\n }", "protected function validate() {\r\n if ($this->getBaseAmount() <= 0)\r\n $this->errors->add(\"The base amount of alicuota must be greater than 0.\");\r\n// \t\t\telse\r\n// \t\t\t{\r\n// \t\t\t\t$relativeError = (($this->getTaxAmount() / $this->getBaseAmount() * 100) - $this->getTaxPercent());\r\n// \t\t\t\t$relativeError = $relativeError / $this->getTaxPercent();\r\n// \t\t\t\t$relativeError = NumberDataTypeHelper::truncate($relativeError, 2);\r\n// \t\t\t\tif (abs($relativeError) > 0.01)\r\n// \t\t\t\t\t$this->errors->add(\"The base and tax amount do not match with the alicuota ({$this->getName()}). Diference: $relativeError\");\r\n// \t\t\t}\r\n }", "private function validateLicenseData()\n {\n\n // error_log('LicenseEmail : '.print_r($this->getLicenseEmail(), 1));\n // error_log('LicenseProduct : '.print_r($this->getLicenseProduct(), 1));\n // error_log('LicenseSecretKey : '.print_r($this->getLicenseSecretKey(), 1));\n }", "public function validate() {\r\n // Name - this is required\r\n if ($this->description == '') {\r\n $this->errors[] = 'Description is required';\r\n } \r\n \r\n // Category number - must be a number\r\n if (!is_numeric($this->category)) {\r\n $this->category = 0;\r\n } \r\n \r\n // Item number - must be a number\r\n if (!is_numeric($this->item)) {\r\n $this->item = 0;\r\n } \r\n }", "public function rules()\n {\n return array(\n array('pagination, bundleSize, publicationDate, deliveryDate', 'required'),\n array('pagination, bundleSize', 'numerical'),\n array('orderDetails', 'validateDetails'),\n );\n }", "public function normalizeData()\n {\n if (is_numeric($this->Streetname2)) {\n $this->HouseNumber = $this->Streetname2;\n $this->Streetname2 = \"\";\n }\n\n// Sometimes people will input - To mean Idfk why are you asking me to input this?\n if ($this->Phone && strlen($this->Phone) < 3) {\n $this->addMessage($this->getFormatedMessage(\"Invalid Phone [$this->Phone] ignoring\"));\n $this->Phone = '';\n }\n\n if ($this->State && strlen($this->State) < 2) {\n $this->addMessage($this->getFormatedMessage(\"Invalid State [$this->State] ignoring\"));\n $this->State = '';\n }\n\n if ($this->CompanyName && strlen($this->CompanyName) < 3) {\n $this->addMessage($this->getFormatedMessage(\"Invalid CompanyName[$this->CompanyName] ignoring \"));\n $this->CompanyName = '';\n }\n\n $this->Description = $this->escapeTextData($this->Description);\n if ($this->Description && strlen($this->Description) > 255) {\n $this->Description = substr($this->Description, 0, 255);\n\n //Make sure we are not sending a broken special char\n $descChars = str_split($this->Description); \n for ($i = 254; $i > 251; --$i) {\n if ($descChars[$i] == '&') {\n $this->Description = substr($this->Description, 0, $i);\n }\n }\n }\n\n if($this->Description && strlen($this->Description) < 3) {\n $this->addMessage($this->getFormatedMessage(\"Invalid description $this->Description ignoring \"));\n $this->Description = ''; \n }\n }", "public function validationData()\n {\n $all = parent::validationData();\n $all['bank-info'] = Purifier::clean($all['bank-info']);\n $all['delivery'] = Purifier::clean($all['delivery']);\n return $all;\n }", "protected function validate()\r\n\t{\r\n\t\tif (!$this->isFetched())\r\n\t\t{\r\n\t\t\treturn;\r\n }\r\n \r\n\t\tif ($this->validationInfo)\r\n\t\t{\r\n\t\t\t$this->validationInfo->validate($this->normalizedValue);\r\n\t\t}\r\n\t\t$this->isValid = true;\r\n\t}", "public function validate($data) {\n\n\t\t$this->validationErrors = [];\n\n\t\t$amount = (float)$data['amount'];\n\t\tif ($amount <= 0) {\n\t\t\t$this->validationErrors['error_amount'] = true;\n\t\t}\n\n\t\t// Personal data should be either all blank or all set:\n\t\tif ($this->wantsReceipt($data)) {\n\t\t\tif (empty($data['data_privacy_statement_accepted'])) {\n\t\t\t\t$this->validationErrors['error_data_privacy_statement_accepted'] = true;\n\t\t\t}\n\t\t\tif ($amount < 50) {\n\t\t\t\t$this->validationErrors['error_donation_too_small_for_receipt'] = true;\n\t\t\t}\n\t\t\tif (empty($data['donation_firstname'])) {\n\t\t\t\t$this->validationErrors['error_donation_firstname'] = true;\n\t\t\t}\n\t\t\tif (empty($data['donation_lastname'])) {\n\t\t\t\t$this->validationErrors['error_donation_lastname'] = true;\n\t\t\t}\n\t\t\tif (empty($data['donation_street_address'])) {\n\t\t\t\t$this->validationErrors['error_donation_street_address'] = true;\n\t\t\t}\n\t\t\tif (!preg_match('/^[0-9]{5}$/', $data['donation_zip'])) {\n\t\t\t\t$this->validationErrors['error_donation_zip'] = true;\n\t\t\t}\n\t\t\tif (empty($data['donation_city'])) {\n\t\t\t\t$this->validationErrors['error_donation_city'] = true;\n\t\t\t}\n\t\t\tif (empty($data['donation_country'])) {\n\t\t\t\t$this->validationErrors['error_donation_country'] = true;\n\t\t\t}\n\t\t}\n\n\t\treturn empty($this->validationErrors);\n\t}", "protected function fine_validation()\n {\n if (is_superadmin_loggedin()) {\n $this->form_validation->set_rules('branch_id', translate('branch'), 'required');\n }\n $this->form_validation->set_rules('group_id', translate('group_name'), 'trim|required');\n $this->form_validation->set_rules('fine_type_id', translate('fees_type'), 'trim|required|callback_check_feetype');\n $this->form_validation->set_rules('fine_type', translate('fine_type'), 'trim|required');\n $this->form_validation->set_rules('fine_value', translate('fine') . \" \" . translate('value'), 'trim|required|numeric|greater_than[0]');\n $this->form_validation->set_rules('fee_frequency', translate('late_fee_frequency'), 'trim|required');\n }", "private function isValidProfileInformation($user_fulldata,$application){\n $validation_array = $this->getValidationArray($application);\n\n $user_reg_validation = $validation_array['users_reg'];\n $guardian_validation = $validation_array['guardian'];\n $qualifications_validation = $validation_array['qualifications'];\n $qualification_error_msg = $validation_array['qualifications']['DEGREE_ID_MSG'];\n $or_qualifications_validation = $validation_array['or_qualifications']['OR_DEGREE_ID'];\n $or_qualification_error_msg = $validation_array['or_qualifications']['OR_DEGREE_ID_MSG'];\n\n $users_reg = $user_fulldata['users_reg'];\n $guardian = $user_fulldata['guardian'];\n $qualifications = $user_fulldata['qualifications'];\n\n\n\n if($users_reg['IS_CNIC_PASS']=='P'){\n $user_reg_validation = array_merge($user_reg_validation,$validation_array['PASSPORT']);\n }else{\n $user_reg_validation = array_merge($user_reg_validation,$validation_array['CNIC']);\n }\n\n $error = \"\";\n foreach($user_reg_validation as $column=>$value){\n\n\n if(preg_match(\"/\".$value['regex'].\"/\", $users_reg[$column])){\n\n }else{\n $error.=\"<div class='text-danger'>{$value['error_msg']}</div>\";\n\n }\n }\n\n foreach($guardian_validation as $column=>$value){\n\n\n if(preg_match(\"/\".$value['regex'].\"/\", $guardian[$column])){\n\n }else{\n $error.=\"<div class='text-danger'>{$value['error_msg']}</div>\";\n }\n }\n \n foreach($qualifications as $qual){\n\n foreach($qualifications_validation['DEGREE_ID'] as $k=>$val){\n if($qual['DEGREE_ID']==$val){\n unset($qualifications_validation['DEGREE_ID'][$k]);\n unset($qualification_error_msg[$k]);\n\n break;\n }\n }\n }\n foreach ($qualification_error_msg as $error_msg){\n $error.=\"<div class='text-danger'>{$error_msg}</div>\";\n }\n\n\n if(is_array($or_qualifications_validation)){\n $bool = true;\n foreach($qualifications as $qual){\n\n foreach($or_qualifications_validation as $val){\n if($qual['DEGREE_ID']==$val){\n $bool = false;\n break;\n }\n }\n }\n\n if($bool){\n $error.=\"<div class='text-danger'>{$or_qualification_error_msg}</div>\";\n }\n\n }\n return $error;\n //prePrint($qualification_error_msg);\n\n }", "private function PREPARE_VALIDATION_RESULTS()\r\r {\r\r $this->PREPARE_OBJECT_VARIABLE_METHOD(); \r\r $this->READ_FIELDS();\r\r \r\r foreach($this->_ready_fields as $key => $fields)\r\r {\r\r # SET THE ALIAS FOR EACH FIELD\r\r $this->_object[$key]['ALIAS'] = (isset($fields['ALIAS'])) ? $fields['ALIAS'] : $key; \r\r \r\r # IF VALUE IS NOT NULL\r\r if(isset($fields['REQUIRED']) && $this->_object[$key]['VALUE']===''){\r\r $this->_results[$key]['REQUIRED'] = (strlen($fields['REQUIRED']) > 1 ) ? $fields['REQUIRED'] : $this->_object[$key]['ALIAS'].' '.$this->_error['REQUIRED'];\r\r }\r\r \r\r # IF VALUE IS NOT NUMERIC\r\r if( isset($fields['NUMERIC']) && !is_numeric($this->_object[$key]['VALUE']) ){\r\r $this->_results[$key]['NUMERIC'] = (strlen($fields['NUMERIC'])>1 ? $fields['NUMERIC'] :$this->_object[$key]['ALIAS'].' '.$this->_error['NUMERIC']);\r\r }\r\r \r\r # IF VALUE IS A VALID EMAIL\r\r if(isset($fields['EMAIL']) && !$this->checkEmail($this->_object[$key]['VALUE'])){\r\r $this->_results[$key]['EMAIL'] = (strlen($fields['EMAIL'])>1 ? $fields['EMAIL'] :$this->_object[$key]['ALIAS'].' '.$this->_error['EMAIL']);\r\r }\r\r \r\r # IF VALUE HAS A SPECIFIC LENGTH\r\r if(isset($fields['LENGTH'])){\r\r \r\r if(array_key_exists('EQUAL', $fields['LENGTH']) && !(($fields['LENGTH']['EQUAL']) == strlen($this->_object[$key]['VALUE'])))\r\r {\r\r $this->_results[$key]['LENGTH'] =isset($fields['LENGTH']['ERROR'])? $fields['LENGTH']['ERROR']:$this->_object[$key]['ALIAS'].' '.$this->_error['LENGTH']['EQUAL'].' '.$fields['LENGTH']['EQUAL'].' characters';\r\r }\r\r # GREATER THAN \r\r else if(array_key_exists('GREAT', $fields['LENGTH']) && !(strlen($this->_object[$key]['VALUE']) > ($fields['LENGTH']['GREAT'])))\r\r {\r\r $this->_results[$key]['LENGTH'] =isset($fields['LENGTH']['ERROR'])? $fields['LENGTH']['ERROR'] :$this->_object[$key]['ALIAS'].' '.$this->_error['LENGTH']['GREAT'].' '.$fields['LENGTH']['GREAT'].' characters';\r\r }\r\r # GREATER THAN EQUAL TO \r\r else if(array_key_exists('GREAT_E', $fields['LENGTH']) && !(strlen($this->_object[$key]['VALUE'])>=($fields['LENGTH']['GREAT_E'])))\r\r {\r\r $this->_results[$key]['LENGTH'] =isset($fields['LENGTH']['ERROR'])? $fields['LENGTH']['ERROR'] :$this->_object[$key]['ALIAS'].' '.$this->_error['LENGTH']['GREAT_E'].' '.$fields['LENGTH']['GREAT_E'].' characters';\r\r }\r\r # LESS THAN \r\r else if(array_key_exists('LESS', $fields['LENGTH']) && !(strlen($this->_object[$key]['VALUE'])<($fields['LENGTH']['LESS'])))\r\r {\r\r $this->_results[$key]['LENGTH'] =isset($fields['LENGTH']['ERROR'])? $fields['LENGTH']['ERROR'] :$this->_object[$key]['ALIAS'].' '.$this->_error['LENGTH']['LESS'].' '.$fields['LENGTH']['LESS'].' characters';\r\r }\r\r # LESS THAN EQUAL TO \r\r else if(array_key_exists('LESS_E', $fields['LENGTH']) && !(strlen($this->_object[$key]['VALUE'])<=($fields['LENGTH']['LESS_E'])))\r\r {\r\r $this->_results[$key]['LENGTH'] =isset($fields['LENGTH']['ERROR'])? $fields['LENGTH']['ERROR'] :$this->_object[$key]['ALIAS'].' '.$this->_error['LENGTH']['LESS_E'].' '.$fields['LENGTH']['LESS_E'].' characters';\r\r }\r\r }\r\r \r\r # IF A FIELD IS EQUAL TO ANOTHER FIELD \r\r if(isset($fields['COMPARE'])){\r\r \r\r if(is_array($fields['COMPARE']))\r\r {\r\r if($this->_object[$key]['VALUE']!==$this->_object[$fields['COMPARE']['WITH']]['VALUE']){ \r\r $this->_results[$key]['COMPARE'] = isset($fields['COMPARE']['ERROR']) ? $fields['COMPARE']['ERROR'] : $this->_object[$key]['ALIAS'] .' and '. $this->_ready_fields[$fields['COMPARE']['WITH']]['ALIAS'].' '. $this->_error['COMPARE'];\r\r }\r\r } \r\r else\r\r {\r\r if($this->_object[$key]['VALUE']!==$this->_object[$fields['COMPARE']]['VALUE']){\r\r $this->_results[$key]['COMPARE'] = $this->_object[$key]['ALIAS'] .' and '. $this->_ready_fields[$fields['COMPARE']]['ALIAS'].' '. $this->_error['COMPARE'];\r\r }\r\r }\r\r }\r\r \r\r } \r\r }", "protected function checkStructure()\n {\n $structure = $this->getStructure();\n\n foreach ($structure as $field => $opt) {\n if (!array_key_exists($field, $this->data)) {\n continue;\n }\n\n $value = Arr::get($this->data, $field);\n if (is_array($value)) {\n $this->errors[$field][] = Translate::get('validate_wrong_type_data');\n continue;\n }\n\n $value = trim($value);\n $length = (int)$opt->length;\n\n if (!empty($length)) {\n $len = mb_strlen($value);\n if ($len > $length) {\n $this->errors[$field][] = Translate::getSprintf('validate_max_length', $length);\n continue;\n }\n }\n\n if (!$opt->autoIncrement && $opt->default === NULL && !$opt->allowNull && $this->isEmpty($value)) {\n $this->errors[$field][] = Translate::get('validate_not_empty');\n continue;\n }\n\n switch ($opt->dataType) {\n case 'int':\n case 'bigint':\n if (!$this->isEmpty($value) && (filter_var($value, FILTER_VALIDATE_INT) === false)) {\n $this->errors[$field][] = Translate::get('validate_int');\n continue 2;\n }\n break;\n\n case 'double':\n if (!is_float($value) && !$this->isEmpty($value)) {\n $this->errors[$field][] = Translate::get('validate_double');\n continue 2;\n }\n break;\n\n case 'float':\n if (!is_numeric($value) && !$this->isEmpty($value)) {\n $this->errors[$field][] = Translate::get('validate_float');\n continue 2;\n }\n break;\n\n case 'date':\n case 'datetime':\n case 'timestamp':\n if (!$this->isEmpty($value) && !Validate::dateSql($value)) {\n $this->errors[$field][] = Translate::get('validate_sql_date');\n continue 2;\n }\n break;\n\n default:\n continue 2;\n break;\n\n }\n }\n }", "protected function validate_data_fields(){\n\t\tif(empty($this->RESPONSE)){throw new Exception(\"Response field not found\", 5);}\n\t\t\n\t\t// The remote IP address is also required\n\t\tif($this->validate_ip($this->REMOTE_ADDRESS)){throw new Exception(\"Renote IP address not set correctly\", 6);}\n\t}", "public function validate()\n {\n if ($this->amount <= 0) {\n $this->errors[0] = 'Wpisz poprawną kwotę!';\n }\n \n if (!isset($this->payment)) {\n $this->errors[1] = 'Wybierz sposób płatności!';\n }\n \n if (!isset($this->category)) {\n $this->errors[2] = 'Wybierz kategorię!';\n }\n }", "function form_val_setrules(){\n $this->form_validation->set_error_delimiters('<p style=\"color:rgb(255, 115, 115);\" class=\"help-block\"><i class=\"glyphicon glyphicon-exclamation-sign\"></i> ','</p>');\n\n $this->form_validation->set_rules('return_date','Return Date','required');\n $this->form_validation->set_rules('reference','Reference','required'); \n }", "protected function prepareForValidation() {\n\n // converting date and hour to datetime\n if ($this->has(['start_date', 'start_time'])) {\n $start_datetime = Carbon::createFromFormat('Y-m-d H:i', $this->input('start_date').\" \".$this->input('start_time'));\n $start_datetime->setTimezone('Europe/London');\n $this->merge(['start_date' => $start_datetime]);\n }\n\n if ($this->has(['end_date', 'end_time'])) {\n $end_datetime = Carbon::createFromFormat('Y-m-d H:i', $this->input('end_date').\" \".$this->input('end_time'));\n $this->merge(['end_date' => $end_datetime]);\n }\n\n if ($this->has('starting_bid')) {\n $this->merge(['starting_bid' => ceil($this->input('starting_bid') * 100)]);\n }\n\n // determine if minimum increment is percentage or fixed\n if ($this->has('increment_val')) {\n if ($this->has('percent_check') && $this->input('percent_check')) // percentual\n $this->merge(['increment_percent' => $this->input('increment_val')]);\n else // fixed\n $this->merge(['increment_fixed' => ceil($this->input('increment_val') * 100)]);\n }\n }", "public final function verifyData($key){\n\n unset($this->errors[$key]);\n\n if(!array_key_exists($key,$this->data)){\n\n if(!array_key_exists($key,$this->definition)){\n throw new \\Disco\\exceptions\\Exception(\"Field `{$key}` is not defined by this data model\");\n }//if\n\n //DEFAULT\n if(array_key_exists('default',$this->definition[$key])){\n $this->data[$key] = $this->definition[$key]['default'];\n }//if\n //REQUIRED\n else if($this->getDefinitionValue($key,'required')){\n return $this->setError($key,\"`{$key}` is required\");\n }//elif\n else {\n return false;\n }//el\n\n }//if\n\n //PREMASSAGE\n if(($massage = $this->getDefinitionValue($key,'premassage')) !== false){\n $this->data[$key] = $this->{$massage}($this->data[$key]);\n }//if\n\n $value = $this->data[$key];\n\n //REGEXP\n if(($regexp = $this->getDefinitionValue($key,'regexp')) !== false){\n if(($default = \\App::getCondition($regexp)) !== false && !\\App::matchCondition($default,$value)){\n return $this->setError($key);\n }//if\n if(!preg_match(\"/{$regexp}/\",$value)){\n return $this->setError($key);\n }//if\n $this->_postMassage($key,$value);\n return true;\n }//if\n\n //METHOD\n if(($method = $this->getDefinitionValue($key,'method')) !== false){\n if(!$this->{$method}($value)){\n return $this->setError($key);\n }//if\n $this->_postMassage($key,$value);\n return true;\n }//if\n\n //NULLABLE\n if($this->getDefinitionValue($key,'nullable') && $value === null){\n $this->_postMassage($key,$value);\n return true;\n }//if\n\n $type = $this->getDefinitionValue($key,'type');\n\n //TRUTHY\n if($type != 'boolean' && $this->getDefinitionValue($key,'truthy') && is_bool($value)){\n $this->_postMassage($key,$value);\n return true;\n }//if\n\n switch($type){\n\n case 'int':\n\n if(!$this->_isValidInt($key,$value)){\n return false;\n }//if\n\n break;\n\n case 'uint':\n\n if(!$this->_isValidInt($key,$value)){\n return false;\n }//if\n\n if($value < 0){\n return $this->setError($key,\"`{$key}` must be a positive integer\");\n }//if\n\n break;\n\n case 'float':\n\n if(!$this->_isValidFloat($key,$value)){\n return false;\n }//if\n\n break;\n\n case 'ufloat':\n\n if(!$this->_isValidFloat($key,$value)){\n return false;\n }//if\n\n if($value < 0){\n return $this->setError($key,\"`{$key}` must be a positive number\");\n }//if\n\n break;\n\n case 'string':\n\n if(!is_string($value)){\n return $this->setError($key,\"`{$key}` must be a string\");\n }//if\n\n if(($min = $this->getDefinitionValue($key,'minlen')) !== false && strlen($value) < $min){\n return $this->setError($key,\"`{$key}` must be greater than {$min} characters long\");\n }//if\n\n if(($max = $this->getDefinitionValue($key,'maxlen')) !== false && strlen($value) > $max){\n return $this->setError($key,\"`{$key}` must be less than {$max} characters long\");\n }//if\n\n break;\n\n case 'char':\n\n if(!is_string($value) || strlen($value) != 1){\n return $this->setError($key,\"`{$key}` must be a single character\");\n }//if\n\n break;\n\n case 'boolean': \n\n if(!is_bool($value)){\n return $this->setError($key,\"`{$key}` must be a boolean value\");\n }//if\n\n break;\n\n case 'array':\n\n if(!is_array($value)){\n return $this->setError($key,\"`{$key}` must be an array\");\n }//if\n\n break;\n\n case 'object':\n\n if(is_object($value)){\n if(($instanceof = $this->getDefinitionValue($key,'instanceof')) !== false && !$value instanceof $instanceof){\n return $this->setError($key,\"`{$key}` must be an instance of `{$instanceof}`\");\n }//if\n } //if\n else {\n return $this->setError($key,\"`{$key}` must be an object\");\n }//if\n\n break;\n\n case 'closure':\n\n if(!is_object($value) || !$value instanceof \\Closure){\n return $this->setError($key,\"`{$key}` must be a closure\");\n }//if \n\n break;\n\n default:\n return $this->setError($key);\n\n }//switch\n\n //IN\n if(($in = $this->getDefinitionValue($key,'in')) !== false && !in_array($value,$in)){\n $in = implode(', ',$in);\n return $this->setError($key,\"`{$key}` must be a value of `{$in}`\");\n }//if\n\n //NOTIN\n if(($in = $this->getDefinitionValue($key,'notin')) !== false && in_array($value,$in)){\n $in = implode(', ',$in);\n return $this->setError($key,\"`{$key}` must not be a value of `{$in}`\");\n }//if\n\n $this->_postMassage($key,$value);\n\n }", "public function _getValidationErrors()\n {\n $errs = parent::_getValidationErrors();\n $validationRules = $this->_getValidationRules();\n if (null !== ($v = $this->getCity())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_CITY] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getCountry())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_COUNTRY] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getDistrict())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_DISTRICT] = $fieldErrs;\n }\n }\n if ([] !== ($vs = $this->getLine())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_LINE, $i)] = $fieldErrs;\n }\n }\n }\n if (null !== ($v = $this->getPeriod())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_PERIOD] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getPostalCode())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_POSTAL_CODE] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getState())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_STATE] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getText())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_TEXT] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getType())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_TYPE] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getUse())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_USE] = $fieldErrs;\n }\n }\n if (isset($validationRules[self::FIELD_CITY])) {\n $v = $this->getCity();\n foreach($validationRules[self::FIELD_CITY] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_ADDRESS, self::FIELD_CITY, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_CITY])) {\n $errs[self::FIELD_CITY] = [];\n }\n $errs[self::FIELD_CITY][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_COUNTRY])) {\n $v = $this->getCountry();\n foreach($validationRules[self::FIELD_COUNTRY] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_ADDRESS, self::FIELD_COUNTRY, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_COUNTRY])) {\n $errs[self::FIELD_COUNTRY] = [];\n }\n $errs[self::FIELD_COUNTRY][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_DISTRICT])) {\n $v = $this->getDistrict();\n foreach($validationRules[self::FIELD_DISTRICT] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_ADDRESS, self::FIELD_DISTRICT, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_DISTRICT])) {\n $errs[self::FIELD_DISTRICT] = [];\n }\n $errs[self::FIELD_DISTRICT][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_LINE])) {\n $v = $this->getLine();\n foreach($validationRules[self::FIELD_LINE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_ADDRESS, self::FIELD_LINE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_LINE])) {\n $errs[self::FIELD_LINE] = [];\n }\n $errs[self::FIELD_LINE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_PERIOD])) {\n $v = $this->getPeriod();\n foreach($validationRules[self::FIELD_PERIOD] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_ADDRESS, self::FIELD_PERIOD, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_PERIOD])) {\n $errs[self::FIELD_PERIOD] = [];\n }\n $errs[self::FIELD_PERIOD][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_POSTAL_CODE])) {\n $v = $this->getPostalCode();\n foreach($validationRules[self::FIELD_POSTAL_CODE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_ADDRESS, self::FIELD_POSTAL_CODE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_POSTAL_CODE])) {\n $errs[self::FIELD_POSTAL_CODE] = [];\n }\n $errs[self::FIELD_POSTAL_CODE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_STATE])) {\n $v = $this->getState();\n foreach($validationRules[self::FIELD_STATE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_ADDRESS, self::FIELD_STATE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_STATE])) {\n $errs[self::FIELD_STATE] = [];\n }\n $errs[self::FIELD_STATE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_TEXT])) {\n $v = $this->getText();\n foreach($validationRules[self::FIELD_TEXT] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_ADDRESS, self::FIELD_TEXT, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_TEXT])) {\n $errs[self::FIELD_TEXT] = [];\n }\n $errs[self::FIELD_TEXT][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_TYPE])) {\n $v = $this->getType();\n foreach($validationRules[self::FIELD_TYPE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_ADDRESS, self::FIELD_TYPE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_TYPE])) {\n $errs[self::FIELD_TYPE] = [];\n }\n $errs[self::FIELD_TYPE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_USE])) {\n $v = $this->getUse();\n foreach($validationRules[self::FIELD_USE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_ADDRESS, self::FIELD_USE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_USE])) {\n $errs[self::FIELD_USE] = [];\n }\n $errs[self::FIELD_USE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_EXTENSION])) {\n $v = $this->getExtension();\n foreach($validationRules[self::FIELD_EXTENSION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_ELEMENT, self::FIELD_EXTENSION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_EXTENSION])) {\n $errs[self::FIELD_EXTENSION] = [];\n }\n $errs[self::FIELD_EXTENSION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_ID])) {\n $v = $this->getId();\n foreach($validationRules[self::FIELD_ID] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_ELEMENT, self::FIELD_ID, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_ID])) {\n $errs[self::FIELD_ID] = [];\n }\n $errs[self::FIELD_ID][$rule] = $err;\n }\n }\n }\n return $errs;\n }", "protected function postValidation()\n {\n $errors = array();\n\n // \"Length of reference\" field.\n if (!($length = Tools::getValue('ORDERREF_LENGTH'))) {\n $errors[] = $this->l('The \"Length of reference\" field is required.');\n }\n elseif (!Validate::isInt($length)) {\n $errors[] = $this->l('The \"Length of reference\" field must be an integer number.');\n }\n elseif (!($length >= self::ORDERREF_LENGTH_MIN && $length <= self::ORDERREF_LENGTH_MAX)) {\n $errors[] = $this->l('The \"Length of reference\" field limits exceed. Value must be between')\n . ' ' . self::ORDERREF_LENGTH_MIN . ' '\n . $this->l('and')\n . ' ' . self::ORDERREF_LENGTH_MAX;\n }\n \n // \"How to generate\" field.\n if (!($mode = Tools::getValue('ORDERREF_MODE'))) {\n $errors[] = $this->l('The \"How to generate order references\" field is required.');\n }\n elseif (!(Validate::isInt($mode) &&\n ($mode == self::ORDERREF_MODE_RANDOM\n || $mode == self::ORDERREF_MODE_CONSEQUENT\n || $mode == self::ORDERREF_MODE_PS))) {\n $errors[] = $this->l('The \"How to generate order references\" field has illegal value.');\n }\n\n return $errors;\n }", "public function actionMedicalvalidation() {\n\t\tif (\\Yii::$app->SessionCheck->isclientLogged () == true) \t\t// checking logged session\n\t\t{\n\t\t\t// rendering the layout\n\t\t\t$this->layout = 'main';\n\t\t\t\n\t\t\t$encrypt_component = new EncryptDecryptComponent ();\n\t\t\t$company_detals = array ();\n\t\t\t$company_validation = array ();\n\t\t\t$error_medical_classes = array ();\n\t\t\t$arr_medical_individual_issues = array ();\n\t\t\t$medical_period_issues = array();\n\t\t\t$medical_validation_issues = array();\n\t\t\t$top_ten_employee_id = array();\n\t\t\t\n\t\t\t$get_company_id = \\Yii::$app->request->get ();\n\t\t\t\n\t\t\tif (! empty ( $get_company_id )) {\n\t\t\t\t/**\n\t\t\t\t * Encrypted company ID*\n\t\t\t\t */\n\t\t\t\t$encrypt_company_id = $get_company_id ['c_id'];\n\t\t\t\tif (! empty ( $encrypt_company_id )) {\n\t\t\t\t\t\n\t\t\t\t\t$company_id = $encrypt_component->decryptUser ( $encrypt_company_id ); // Decrypted company Id\n\t\t\t\t\t \n\t\t\t\t\t// / get the company details\n\t\t\t\t\t$company_detals = TblAcaCompanies::find ()->select ( 'company_client_number,company_name' )->where ( 'company_id = :company_id', [ \n\t\t\t\t\t\t\t'company_id' => $company_id \n\t\t\t\t\t] )->one ();\n\t\t\t\t\t\n\t\t\t\t\t// checking if the validation starts for this company\n\t\t\t\t\t\n\t\t\t\t\t$company_validation = TblAcaCompanyValidationStatus::find ()->where ( [ \n\t\t\t\t\t\t\t'company_id' => $company_id \n\t\t\t\t\t] )->andWhere ( [ \n\t\t\t\t\t\t\t'is_initialized' => 1 \n\t\t\t\t\t] )->andWhere ( [ \n\t\t\t\t\t\t\t'is_completed' => 0 \n\t\t\t\t\t] )->One ();\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t/**\n\t\t\t\t\t * *** getting individual payroll employee validation *******\n\t\t\t\t\t */\n\t\t\t\t\t/**************** pagination ***********************/\t\n\t\t\t\t\t$num_rec_per_page=10;\n\t\t\t\t\n\t\t\t\t\tif (isset($get_company_id['page_id'])) {\n\t\t\t\t\t\t$page = $get_company_id['page_id'];\n\t\t\t\t\t } else {\n\t\t\t\t\t \t$page=1; \n\t\t\t\t\t }\n\t\t\n\t\t\t\t\t$start_from = ($page-1) * $num_rec_per_page;\n\t\t\t\t\n\t\t\t\t\t/**\n\t\t\t\t\t\tnow getting the count of total issues \n\t\t\t\t\t**/\t\t\t\t\t\n\t\t\t\t\t$sql = 'SELECT `employee_id` FROM `tbl_aca_medical_validation_log` WHERE `company_id`=' . $company_id . ' GROUP BY employee_id';\n\t\t\t\t\t$medical_validation = \\Yii::$app->db->createCommand ( $sql )->queryAll ();\n\t\t\t\t\t$i=0;\n\t\t\t\t\tforeach($medical_validation as $medical_validation){\n\t\t\t\t\t\t$medical_validation_issues[$i] = $medical_validation['employee_id'];\n\t\t\t\t\t\t$i++;\n\t\t\t\t\t}\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t$sql = 'SELECT `employee_id` FROM `tbl_aca_medical_enrollment_period_validation_log` WHERE `company_id`=' . $company_id . ' GROUP BY employee_id';\n\t\t\t\t\t$medical_period = \\Yii::$app->db->createCommand ( $sql )->queryAll ();\n\t\t\t\t\t$j=0;\n\t\t\t\t\tforeach($medical_period as $medical_period){\n\t\t\t\t\t\t$medical_period_issues[$j] = $medical_period['employee_id'];\n\t\t\t\t\t\t$j++;\n\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\t// combining both the issue arrays to combine all the employee ids\t\t\t\t\t\n\t\t\t\t\t$issues_array = array_merge($medical_validation_issues,$medical_period_issues);\n\t\t\t\t\n\t\t\t\t\t// get the unique employee ids\n\t\t\t\t\t$final_employee_ids_array = array_unique($issues_array);\n\t\t\t\t\t$final_employee_ids_array = array_values($final_employee_ids_array);\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tif(count($final_employee_ids_array)> 10){\n\n\t\t\t\t\t\t//pagination\t\t\t\t\t\t\n\t\t\t\t\t\tfor($i=$start_from;$i<($start_from+10);$i++){\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif($i<count($final_employee_ids_array)){\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t//\tif(!empty($final_employee_ids_array[$i])){\n\t\t\t\t\t\t\t\t$top_ten_employee_id[] = $final_employee_ids_array[$i];\n\t\t\t\t\t\t\t//\t}\n\t\t\t\t\t\t\t}else\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}else\n\t\t\t\t\t{\n\t\t\t\t\t\t\n\t\t\t\t\t\tfor($i=0;$i<count($final_employee_ids_array);$i++){\n\t\t\t\t\t\t\t//if(!empty($final_employee_ids_array[$i])){\n\t\t\t\t\t\t\t$top_ten_employee_id[] = $final_employee_ids_array[$i];\n\t\t\t\t\t\t\t//}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\n\t\t\t\t\t$medical_details = ArrayHelper::index(TblAcaMedicalData::find ()->where ( [ \n\t\t\t\t\t\t\t\t'employee_id' => $top_ten_employee_id\n\t\t\t\t\t\t] )->groupBy ( [ \n\t\t\t\t\t\t\t\t'employee_id' \n\t\t\t\t\t\t] )->asArray()->All (),'employee_id');\n\t\t\t\t\t\t//ArrayHelper::map($array, 'id', 'name')\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t// get the number of issues for individual payroll data\n\t\t\t\t\t$error_individual_medical = ArrayHelper::index(TblAcaMedicalValidationLog::find ()->select(['COUNT(*) AS cnt,employee_id'])->where ( [ \n\t\t\t\t\t\t\t\t'company_id' => $company_id \n\t\t\t\t\t\t] )->andWhere ( [ \n\t\t\t\t\t\t\t\t'<>',\n\t\t\t\t\t\t\t\t'is_validated',\n\t\t\t\t\t\t\t\t1 \n\t\t\t\t\t\t] )->andWhere ( [ \n\t\t\t\t\t\t\t\t'employee_id' => $top_ten_employee_id \n\t\t\t\t\t\t] )->groupBy ( [ \n\t\t\t\t\t\t\t\t'employee_id' \n\t\t\t\t\t\t] )->asArray()->All (),'employee_id');\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t// get the number of issues for period payroll data\n\t\t\t\t\t$error_individual_medical_period = ArrayHelper::index(TblAcaMedicalEnrollmentPeriodValidationLog::find ()->select(['COUNT(*) AS cnt,employee_id'])->where ( [ \n\t\t\t\t\t\t\t\t'company_id' => $company_id \n\t\t\t\t\t\t] )->andWhere ( [ \n\t\t\t\t\t\t\t\t'<>',\n\t\t\t\t\t\t\t\t'is_validated',\n\t\t\t\t\t\t\t\t1 \n\t\t\t\t\t\t] )->andWhere ( [ \n\t\t\t\t\t\t\t\t'employee_id' => $top_ten_employee_id \n\t\t\t\t\t\t] )->groupBy ( [ \n\t\t\t\t\t\t\t\t'employee_id' \n\t\t\t\t\t\t] )->asArray()->All (),'employee_id');\n\t\t\t\t\t\t\n\t\t\t\t\tif(!empty($medical_details))\t\t\n\t\t\t\t\t{\t\t//print_r($issue_count);\t\t\t\n\t\t\t\t\tforeach($medical_details as $key=>$value)\n\t\t\t\t\t{\n\t\t\t\t\t\t$employee_id = \t$key;\n\t\t\t\t\t\t$medical_issue = '';\n\t\t\t\t\t\t$medical_period_issue = '';\n\t\t\t\t\t\tif(!empty($error_individual_medical[$employee_id]['cnt'])){\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$medical_issue = $error_individual_medical[$employee_id]['cnt'];\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(!empty($error_individual_medical_period[$employee_id]['cnt'])){\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$medical_period_issue = $error_individual_medical_period[$employee_id]['cnt'];\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t$issue_count = $medical_issue+ $medical_period_issue;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\tif ($issue_count != 0) {\n\t\t\t\t\t\t\t$hased_medical_employee_id = $encrypt_component->encrytedUser ( $employee_id );\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$arr_medical_individual_issues [] = array (\n\t\t\t\t\t\t\t\t//'medical_firstname' => $medical_details->first_name,\n\t\t\t\t\t\t\t\t'medical_firstname' => $value['first_name'],\n\t\t\t\t\t\t\t\t'medical_lastname' => $value['last_name'],\n\t\t\t\t\t\t\t\t'medical_middlename' => $value['middle_name'],\n\t\t\t\t\t\t\t\t'medical_ssn' => $value['ssn'],\n\t\t\t\t\t\t\t\t'issue_count' => $issue_count,\n\t\t\t\t\t\t\t\t'medical_id' => $hased_medical_employee_id ,\n\t\t\t\t\t\t\t\t'company_id' =>$encrypt_company_id\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t/**\n\t\t\t\t\t * *** getting individual payroll employee validation *******\n\t\t\t\t\t */\n\t\t\t\t\t/**************** pagination **********************\n\t\t\t\t\t$num_rec_per_page=10;\n\t\t\t\t\t\n\t\t\t\t\tif (isset($get_company_id['page_id'])) {\n\t\t\t\t\t\t$page = $get_company_id['page_id'];\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$page=1;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$start_from = ($page-1) * $num_rec_per_page;\n\t\t\t\t\t\n\t\t\t\t\t/**\n\t\t\t\t\t\tnow getting the count of total issues \n\t\t\t\t\t*\n\t\t\t\t\t$medical_validation = TblAcaMedicalValidationLog::find ()->select ( 'employee_id' )->where ( [ \n\t\t\t\t\t\t\t\t'company_id' => $company_id \n\t\t\t\t\t] )->All ();\n\t\t\t\t\t\t\n\t\t\t\t\t$arr_validations ['medical_data_validation'] = count($medical_validation);\n\t\t\t\t\t\n\t\t\t\t\t$medical_period = TblAcaMedicalEnrollmentPeriodValidationLog::find ()->select ( 'employee_id' )->where ( [ \n\t\t\t\t\t\t\t\t'company_id' => $company_id \n\t\t\t\t\t] )->All ();\n\t\t\t\t\t\t\n\t\t\t\t\t$arr_validations ['medical_data_validation'] += count($medical_period);\n\t\t\t\t\t//print_r($arr_validations ['medical_data_validation']);die();\n\t\t\t\t\t/**\n\t\t\t\t\t * *** getting individual payroll employee validation *******\n\t\t\t\t\t \n\t\t\t\t\tif($arr_validations ['medical_data_validation']>10){\n\t\t\t\t\t\t$error_medical_classes = TblAcaMedicalData::find ()->where ( [ \n\t\t\t\t\t\t\t\t'employee_id' => $medical_validation \n\t\t\t\t\t\t] )->orWhere ( [ \n\t\t\t\t\t\t\t\t'employee_id' => $medical_period \n\t\t\t\t\t\t] )->andWhere ( [ \n\t\t\t\t\t\t\t\t'company_id' => $company_id \n\t\t\t\t\t\t] )->groupBy ( [ \n\t\t\t\t\t\t\t\t'employee_id' \n\t\t\t\t\t\t] )\n\t\t\t\t\t\t->offset($start_from)\n\t\t\t\t\t\t->limit($num_rec_per_page)\n\t\t\t\t\t\t\n\t\t\t\t\t\t->All ();\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\t$error_medical_classes = TblAcaMedicalData::find ()->where ( [ \n\t\t\t\t\t\t\t\t'employee_id' => $medical_validation \n\t\t\t\t\t\t] )->orWhere ( [ \n\t\t\t\t\t\t\t\t'employee_id' => $medical_period \n\t\t\t\t\t\t] )->andWhere ( [ \n\t\t\t\t\t\t\t\t'company_id' => $company_id \n\t\t\t\t\t\t] )->groupBy ( [ \n\t\t\t\t\t\t\t\t'employee_id' \n\t\t\t\t\t\t] )->All ();\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t//////// using for pagination\n\t\t\t\t\t$error_medical_classes_count = TblAcaMedicalData::find ()->where ( [ \n\t\t\t\t\t\t\t\t'employee_id' => $medical_validation \n\t\t\t\t\t\t] )->orWhere ( [ \n\t\t\t\t\t\t\t\t'employee_id' => $medical_period \n\t\t\t\t\t\t] )->andWhere ( [ \n\t\t\t\t\t\t\t\t'company_id' => $company_id \n\t\t\t\t\t\t] )->groupBy ( [ \n\t\t\t\t\t\t\t\t'employee_id' \n\t\t\t\t\t\t] )->count ();\n\t\t\t\t\t//$searchModel = new TblAcaMedicalErrorSearch();\n\t\t\t\t\t\n\t\t\t\t\t// get the individual payroll employee details\n\t\t\t\t\tforeach ( $error_medical_classes as $error_medical_class ) {\n\t\t\t\t\t\t\n\t\t\t\t\t\t$medical_details = TblAcaMedicalData::find ()->where ( [ \n\t\t\t\t\t\t\t\t'employee_id' => $error_medical_class->employee_id \n\t\t\t\t\t\t] )->One ();\n\t\t\t\t\t\t\n\t\t\t\t\t\t// get the number of issues for individual medical data\n\t\t\t\t\t\t$error_individual_medical = TblAcaMedicalValidationLog::find ()->where ( [ \n\t\t\t\t\t\t\t\t'company_id' => $company_id \n\t\t\t\t\t\t] )->andWhere ( [ \n\t\t\t\t\t\t\t\t'<>',\n\t\t\t\t\t\t\t\t'is_validated',\n\t\t\t\t\t\t\t\t1 \n\t\t\t\t\t\t] )->andWhere ( [ \n\t\t\t\t\t\t\t\t'employee_id' => $error_medical_class->employee_id \n\t\t\t\t\t\t] )->All ();\n\t\t\t\t\t\t\n\t\t\t\t\t\t// get the number of issues for period medical data\n\t\t\t\t\t\t$error_individual_medical_period = TblAcaMedicalEnrollmentPeriodValidationLog::find ()->where ( [ \n\t\t\t\t\t\t\t\t'company_id' => $company_id \n\t\t\t\t\t\t] )->andWhere ( [ \n\t\t\t\t\t\t\t\t'<>',\n\t\t\t\t\t\t\t\t'is_validated',\n\t\t\t\t\t\t\t\t1 \n\t\t\t\t\t\t] )->andWhere ( [ \n\t\t\t\t\t\t\t\t'employee_id' => $error_medical_class->employee_id \n\t\t\t\t\t\t] )->Count ();\n\t\t\t\t\t\t\n\t\t\t\t\t\t$issue_count = count ( $error_individual_medical );\n\t\t\t\t\t\t$issue_count += $error_individual_medical_period;\n\t\t\t\t\t\t\n\t\t\t\t\t\tif ($issue_count > 0) {\n\t\t\t\t\t\t\t$hased_medical_employee_id = $encrypt_component->encrytedUser ( $error_medical_class->employee_id );\n\t\t\t\t\t\t\t$arr_medical_individual_issues [] = array (\n\t\t\t\t\t\t\t\t\t//'medical_firstname' => $medical_details->first_name,\n\t\t\t\t\t\t\t\t\t'medical_firstname' => $medical_details->first_name,\n\t\t\t\t\t\t\t\t\t'medical_lastname' => $medical_details->last_name,\n\t\t\t\t\t\t\t\t\t'medical_middlename' => $medical_details->middle_name,\n\t\t\t\t\t\t\t\t\t'medical_ssn' => $medical_details->ssn,\n\t\t\t\t\t\t\t\t\t'issue_count' => $issue_count,\n\t\t\t\t\t\t\t\t\t'medical_id' => $hased_medical_employee_id ,\n\t\t\t\t\t\t\t\t\t'company_id' =>$encrypt_company_id\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t*/\n\t\t\t\t\t//print_r($arr_medical_individual_issues);die();\n\t\t\t\t\t\t//$dataProvider = $searchModel->search($arr_medical_individual_issues); //dataProvider for grid \n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif(!empty($arr_medical_individual_issues)){\n\t\t\treturn $this->render ( 'medicalvalidation', array (\n\t\t\t\t\t'company_detals' => $company_detals,\n\t\t\t\t\t//'dataProvider'=>$dataProvider,\n\t\t\t\t\t//'searchModel'=>$searchModel,\n\t\t\t\t\t'company_validation' => $company_validation,\n\t\t\t\t\t'encoded_company_id' => $_GET ['c_id'],\n\t\t\t\t\t'arr_medical_individual_issues' => $arr_medical_individual_issues,\n\t\t\t\t\t'total_issue_count' => count($final_employee_ids_array),\n\t\t\t\t\t'error_medical_classes_count' => count($final_employee_ids_array)\n\t\t\t) );\n\t\t\t\n\t\t\t}else{\n\t\t\treturn $this->redirect ( array (\n\t\t\t\t\t\t\t\t'/client/validateforms?c_id=' . $encrypt_company_id \n\t\t\t\t\t\t) );\n\t\t\t}\n\t\t} else {\n\t\t\t\\Yii::$app->SessionCheck->clientlogout (); // client logout\n\t\t\t\n\t\t\treturn $this->goHome ();\n\t\t}\n\t}", "public function formValidation($dataSet){\n\t\t\t$error=FALSE; $data=array();\n\t\t\tforeach ($dataSet as $aData) {\n\t\t\t\tif($aData['validationString']=='name'){\n\t\t\t\t\t$data[$aData['dataName']]=$this->getValidatedName(trim($aData['dataValue']));\n\t\t\t\t}\n\t\t\t\tif($aData['validationString']=='number'){\n\t\t\t\t\t$data[$aData['dataName']]=$this->getNumericData(trim($aData['dataValue']));\n\t\t\t\t}\n\t\t\t\tif($aData['validationString']=='integer'){\n\t\t\t\t\t$data[$aData['dataName']]=$this->getIntegerData(trim($aData['dataValue']));\n\t\t\t\t}\n\t\t\t\tif($aData['validationString']=='non empty'){\n\t\t\t\t\t$data[$aData['dataName']]=$this->getNonEmptyData(trim($aData['dataValue']));\n\t\t\t\t}\n\t\t\t\tif($aData['validationString']=='sanitize'){\n\t\t\t\t\t$data[$aData['dataName']]=$this->getSanitizeData(trim($aData['dataValue']));\n\t\t\t\t}\n\t\t\t\tif($aData['validationString']=='gsm phone'){\n\t\t\t\t\t$data[$aData['dataName']]=$this->getValidated080GSMNo(trim($aData['dataValue']));\n\t\t\t\t}\n\t\t\t\tif($aData['validationString']=='email'){\n\t\t\t\t\t$data[$aData['dataName']]=$this->getValidatedEmail(trim($aData['dataValue']));\n\t\t\t\t}\n\t\t\t\tif($aData['validationString']=='password rule'){\n\t\t\t\t\t$data[$aData['dataName']]=$this->enforceRulePassword(trim($aData['dataValue']));\n\t\t\t\t}\n\t\t\t\tif($aData['validationString']=='non empty textarea'){\n\t\t\t\t\t$data[$aData['dataName']]=$this->getNonEmptyTextField(trim($aData['dataValue']));\n\t\t\t\t}\n\t\t\t\tif($aData['validationString']=='in list'){\n\t\t\t\t\t$data[$aData['dataName']]=$this->checkInList($aData['dataValue'],$aData['dataList']);\n\t\t\t\t} \n\t\t\t}\n\t\t\tforeach ($data as $aData) {\n\t\t\t\tif($aData===FALSE) $error=TRUE;\n\t\t\t}\n\t\t\t$validedDataSet=array('error'=>$error, 'data'=>$data);\n\t\t\treturn $validedDataSet;\n\t\t}", "protected function validationData() {\n\t\t$input = [];\n\n\t\t/**\n\t\t * If source and target institute id is available in input decode it and merge with input\n\t\t */\n\t\tif ( $this->has('source_institute_id') ) {\n\t\t\t$input['source_institute_id'] = GeneralHelpers::decode($this->input('source_institute_id'));\n\t\t}\n\n\t\tif ( $this->has('target_institute_id') ) {\n\t\t\t$input['target_institute_id'] = GeneralHelpers::decode($this->input('target_institute_id'));\n\t\t}\n\n\t\t$this->merge($input);\n\n\t\treturn parent::validationData();\n\t}", "public static function validateCOBRA_Eligibility_DataForArrayConstraintsFromSetCOBRA_Eligibility_Data(array $values = array())\n {\n $message = '';\n $invalidValues = [];\n foreach ($values as $dependent_Coverage_DataTypeCOBRA_Eligibility_DataItem) {\n // validation for constraint: itemType\n if (!$dependent_Coverage_DataTypeCOBRA_Eligibility_DataItem instanceof \\WorkdayWsdl\\\\StructType\\COBRA_Eligibility_DataType) {\n $invalidValues[] = is_object($dependent_Coverage_DataTypeCOBRA_Eligibility_DataItem) ? get_class($dependent_Coverage_DataTypeCOBRA_Eligibility_DataItem) : sprintf('%s(%s)', gettype($dependent_Coverage_DataTypeCOBRA_Eligibility_DataItem), var_export($dependent_Coverage_DataTypeCOBRA_Eligibility_DataItem, true));\n }\n }\n if (!empty($invalidValues)) {\n $message = sprintf('The COBRA_Eligibility_Data property can only contain items of type \\WorkdayWsdl\\\\StructType\\COBRA_Eligibility_DataType, %s given', is_object($invalidValues) ? get_class($invalidValues) : (is_array($invalidValues) ? implode(', ', $invalidValues) : gettype($invalidValues)));\n }\n unset($invalidValues);\n return $message;\n }", "public function validate() {\n\t\t$this->form_validation->set_rules('rfid', 'FRID', 'required');\t\t\n\t\t$this->form_validation->set_rules('person', \"Person\", 'required');\n\t\t$this->form_validation->set_rules('asset_id', \"Assets\", 'required'); \t\n\t\t$this->form_validation->set_rules('inform_mobile', \"Mobile No.\"); \t\n\t\t$this->form_validation->set_rules('inform_email', \"Email Id\"); \t\n\t\t$this->form_validation->set_rules('send_sms', \"Sms Alert\"); \t\n\t\t$this->form_validation->set_rules('send_email', \"Email Alert\"); \t\n\t\t$this->form_validation->set_rules('comments', \"Comments\"); \t\n\t\t$this->form_validation->set_rules('landmark_id', \"Landmark\"); \t\n\t\treturn parent::validate();\n\t}", "public function rules() {\n return [\n [['ERROR_CODE', 'STATUS', 'PRODUCT_ID'], 'integer'],\n [['MSISDN', 'CREATED_TIME'], 'safe']\n ];\n }", "protected function prepareValidations() {}", "private function validateFormData() {\n\n $this->firstName = $this->generalFieldValidation($this->firstName, \"firstName\", \"First name\", 40, false);\n $this->lastName = $this->generalFieldValidation($this->lastName, \"lastName\", \"Last name\", 40, false);\n $this->email = $this->generalFieldValidation($this->email, \"email\", \"E-mail\", 60, false);\n $this->address = $this->generalFieldValidation($this->address, \"address\", \"Address\", 255);\n $this->city = $this->generalFieldValidation($this->city, \"city\", \"City\", 60);\n $this->state = $this->generalFieldValidation($this->state, \"state\", \"State\", 2);\n $this->zip = $this->generalFieldValidation($this->zip, \"zip\", \"Zip code\", 5);\n $this->phone = $this->generalFieldValidation($this->phone, \"phone\", \"Phone number\", 10, false);\n $this->notes = $this->generalFieldValidation($this->notes, \"notes\", \"Notes\", -1, false);\n if ($this->phone !== \"\") {\n if (!is_numeric($this->phone)) {\n $this->errorArray[\"phone\"] = \"Phone number may only contain digits.\";\n } else {\n if (strlen($this->phone) < 10) {\n $this->errorArray[\"phone\"] = \"Phone number must contain 10 digits.\";\n }\n }\n }\n if ($this->zip !== \"\") {\n if (!is_numeric($this->zip)) {\n $this->errorArray[\"zip\"] = \"Zip code may only contain digits.\";\n } else {\n if (strlen($this->zip) !== 5) {\n $this->errorArray[\"zip\"] = \"Five digit zip code required.\";\n }\n }\n }\n if ($this->email !== \"\") {\n if (!preg_match(\"/^\\S+@\\S+\\.\\S+$/\", $this->email)) {\n $this->errorArray[\"email\"] = \"E-mail address is not valid.\";\n }\n }\n if (count($this->errorArray) === 0) {\n $this->passedValidation = true;\n }\n }", "private function validate() {\n $this->valid = (1 === count($this->marriages));\n }", "public function _getValidationErrors()\n {\n $errs = parent::_getValidationErrors();\n $validationRules = $this->_getValidationRules();\n if ([] !== ($vs = $this->getCountry())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_COUNTRY, $i)] = $fieldErrs;\n }\n }\n }\n if (null !== ($v = $this->getDataExclusivityPeriod())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_DATA_EXCLUSIVITY_PERIOD] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getDateOfFirstAuthorization())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_DATE_OF_FIRST_AUTHORIZATION] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getHolder())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_HOLDER] = $fieldErrs;\n }\n }\n if ([] !== ($vs = $this->getIdentifier())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_IDENTIFIER, $i)] = $fieldErrs;\n }\n }\n }\n if (null !== ($v = $this->getInternationalBirthDate())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_INTERNATIONAL_BIRTH_DATE] = $fieldErrs;\n }\n }\n if ([] !== ($vs = $this->getJurisdiction())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_JURISDICTION, $i)] = $fieldErrs;\n }\n }\n }\n if ([] !== ($vs = $this->getJurisdictionalAuthorization())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_JURISDICTIONAL_AUTHORIZATION, $i)] = $fieldErrs;\n }\n }\n }\n if (null !== ($v = $this->getLegalBasis())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_LEGAL_BASIS] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getProcedure())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_PROCEDURE] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getRegulator())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_REGULATOR] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getRestoreDate())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_RESTORE_DATE] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getStatus())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_STATUS] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getStatusDate())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_STATUS_DATE] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getSubject())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_SUBJECT] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getValidityPeriod())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_VALIDITY_PERIOD] = $fieldErrs;\n }\n }\n if (isset($validationRules[self::FIELD_COUNTRY])) {\n $v = $this->getCountry();\n foreach($validationRules[self::FIELD_COUNTRY] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_COUNTRY, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_COUNTRY])) {\n $errs[self::FIELD_COUNTRY] = [];\n }\n $errs[self::FIELD_COUNTRY][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_DATA_EXCLUSIVITY_PERIOD])) {\n $v = $this->getDataExclusivityPeriod();\n foreach($validationRules[self::FIELD_DATA_EXCLUSIVITY_PERIOD] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_DATA_EXCLUSIVITY_PERIOD, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_DATA_EXCLUSIVITY_PERIOD])) {\n $errs[self::FIELD_DATA_EXCLUSIVITY_PERIOD] = [];\n }\n $errs[self::FIELD_DATA_EXCLUSIVITY_PERIOD][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_DATE_OF_FIRST_AUTHORIZATION])) {\n $v = $this->getDateOfFirstAuthorization();\n foreach($validationRules[self::FIELD_DATE_OF_FIRST_AUTHORIZATION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_DATE_OF_FIRST_AUTHORIZATION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_DATE_OF_FIRST_AUTHORIZATION])) {\n $errs[self::FIELD_DATE_OF_FIRST_AUTHORIZATION] = [];\n }\n $errs[self::FIELD_DATE_OF_FIRST_AUTHORIZATION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_HOLDER])) {\n $v = $this->getHolder();\n foreach($validationRules[self::FIELD_HOLDER] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_HOLDER, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_HOLDER])) {\n $errs[self::FIELD_HOLDER] = [];\n }\n $errs[self::FIELD_HOLDER][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_IDENTIFIER])) {\n $v = $this->getIdentifier();\n foreach($validationRules[self::FIELD_IDENTIFIER] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_IDENTIFIER, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_IDENTIFIER])) {\n $errs[self::FIELD_IDENTIFIER] = [];\n }\n $errs[self::FIELD_IDENTIFIER][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_INTERNATIONAL_BIRTH_DATE])) {\n $v = $this->getInternationalBirthDate();\n foreach($validationRules[self::FIELD_INTERNATIONAL_BIRTH_DATE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_INTERNATIONAL_BIRTH_DATE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_INTERNATIONAL_BIRTH_DATE])) {\n $errs[self::FIELD_INTERNATIONAL_BIRTH_DATE] = [];\n }\n $errs[self::FIELD_INTERNATIONAL_BIRTH_DATE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_JURISDICTION])) {\n $v = $this->getJurisdiction();\n foreach($validationRules[self::FIELD_JURISDICTION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_JURISDICTION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_JURISDICTION])) {\n $errs[self::FIELD_JURISDICTION] = [];\n }\n $errs[self::FIELD_JURISDICTION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_JURISDICTIONAL_AUTHORIZATION])) {\n $v = $this->getJurisdictionalAuthorization();\n foreach($validationRules[self::FIELD_JURISDICTIONAL_AUTHORIZATION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_JURISDICTIONAL_AUTHORIZATION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_JURISDICTIONAL_AUTHORIZATION])) {\n $errs[self::FIELD_JURISDICTIONAL_AUTHORIZATION] = [];\n }\n $errs[self::FIELD_JURISDICTIONAL_AUTHORIZATION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_LEGAL_BASIS])) {\n $v = $this->getLegalBasis();\n foreach($validationRules[self::FIELD_LEGAL_BASIS] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_LEGAL_BASIS, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_LEGAL_BASIS])) {\n $errs[self::FIELD_LEGAL_BASIS] = [];\n }\n $errs[self::FIELD_LEGAL_BASIS][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_PROCEDURE])) {\n $v = $this->getProcedure();\n foreach($validationRules[self::FIELD_PROCEDURE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_PROCEDURE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_PROCEDURE])) {\n $errs[self::FIELD_PROCEDURE] = [];\n }\n $errs[self::FIELD_PROCEDURE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_REGULATOR])) {\n $v = $this->getRegulator();\n foreach($validationRules[self::FIELD_REGULATOR] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_REGULATOR, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_REGULATOR])) {\n $errs[self::FIELD_REGULATOR] = [];\n }\n $errs[self::FIELD_REGULATOR][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_RESTORE_DATE])) {\n $v = $this->getRestoreDate();\n foreach($validationRules[self::FIELD_RESTORE_DATE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_RESTORE_DATE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_RESTORE_DATE])) {\n $errs[self::FIELD_RESTORE_DATE] = [];\n }\n $errs[self::FIELD_RESTORE_DATE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_STATUS])) {\n $v = $this->getStatus();\n foreach($validationRules[self::FIELD_STATUS] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_STATUS, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_STATUS])) {\n $errs[self::FIELD_STATUS] = [];\n }\n $errs[self::FIELD_STATUS][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_STATUS_DATE])) {\n $v = $this->getStatusDate();\n foreach($validationRules[self::FIELD_STATUS_DATE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_STATUS_DATE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_STATUS_DATE])) {\n $errs[self::FIELD_STATUS_DATE] = [];\n }\n $errs[self::FIELD_STATUS_DATE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_SUBJECT])) {\n $v = $this->getSubject();\n foreach($validationRules[self::FIELD_SUBJECT] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_SUBJECT, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_SUBJECT])) {\n $errs[self::FIELD_SUBJECT] = [];\n }\n $errs[self::FIELD_SUBJECT][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_VALIDITY_PERIOD])) {\n $v = $this->getValidityPeriod();\n foreach($validationRules[self::FIELD_VALIDITY_PERIOD] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_VALIDITY_PERIOD, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_VALIDITY_PERIOD])) {\n $errs[self::FIELD_VALIDITY_PERIOD] = [];\n }\n $errs[self::FIELD_VALIDITY_PERIOD][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_CONTAINED])) {\n $v = $this->getContained();\n foreach($validationRules[self::FIELD_CONTAINED] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE, self::FIELD_CONTAINED, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_CONTAINED])) {\n $errs[self::FIELD_CONTAINED] = [];\n }\n $errs[self::FIELD_CONTAINED][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_EXTENSION])) {\n $v = $this->getExtension();\n foreach($validationRules[self::FIELD_EXTENSION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE, self::FIELD_EXTENSION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_EXTENSION])) {\n $errs[self::FIELD_EXTENSION] = [];\n }\n $errs[self::FIELD_EXTENSION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_MODIFIER_EXTENSION])) {\n $v = $this->getModifierExtension();\n foreach($validationRules[self::FIELD_MODIFIER_EXTENSION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE, self::FIELD_MODIFIER_EXTENSION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_MODIFIER_EXTENSION])) {\n $errs[self::FIELD_MODIFIER_EXTENSION] = [];\n }\n $errs[self::FIELD_MODIFIER_EXTENSION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_TEXT])) {\n $v = $this->getText();\n foreach($validationRules[self::FIELD_TEXT] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE, self::FIELD_TEXT, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_TEXT])) {\n $errs[self::FIELD_TEXT] = [];\n }\n $errs[self::FIELD_TEXT][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_ID])) {\n $v = $this->getId();\n foreach($validationRules[self::FIELD_ID] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_RESOURCE, self::FIELD_ID, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_ID])) {\n $errs[self::FIELD_ID] = [];\n }\n $errs[self::FIELD_ID][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_IMPLICIT_RULES])) {\n $v = $this->getImplicitRules();\n foreach($validationRules[self::FIELD_IMPLICIT_RULES] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_RESOURCE, self::FIELD_IMPLICIT_RULES, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_IMPLICIT_RULES])) {\n $errs[self::FIELD_IMPLICIT_RULES] = [];\n }\n $errs[self::FIELD_IMPLICIT_RULES][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_LANGUAGE])) {\n $v = $this->getLanguage();\n foreach($validationRules[self::FIELD_LANGUAGE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_RESOURCE, self::FIELD_LANGUAGE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_LANGUAGE])) {\n $errs[self::FIELD_LANGUAGE] = [];\n }\n $errs[self::FIELD_LANGUAGE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_META])) {\n $v = $this->getMeta();\n foreach($validationRules[self::FIELD_META] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_RESOURCE, self::FIELD_META, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_META])) {\n $errs[self::FIELD_META] = [];\n }\n $errs[self::FIELD_META][$rule] = $err;\n }\n }\n }\n return $errs;\n }", "public function isValid()\n\t{\n\t\tif (empty($this->titre)) $this->titre = \"TITRE A REMPLACER\";\n\t\telse $this->titre = trim (preg_replace('/\\s+/', ' ', $this->titre) ); // Suppression des espaces\n\t\tif (!empty($this->contenu)) $this->contenu = trim (preg_replace('/\\s+/', ' ', $this->contenu) ); // Suppression des espaces\n\t\tif (empty($this->statut)) $this->statut = 0;\n\t\tif (empty($this->id_type)) $this->id_type = 1;\n\t\tif (empty($this->id_membre)) $this->id_membre = 0;\n\t}", "public function validate_fields() {\n\n\t\t$this->validate_refund_address_field();\n\t}", "public function validation($data, $files) {\r\n\r\n // // Check open and close times are consistent.\r\n // if ($data['timeopen'] != 0 && $data['timeclose'] != 0 &&\r\n // $data['timeclose'] < $data['timeopen']) {\r\n // $errors['timeclose'] = get_string('closebeforeopen', 'quiz');\r\n // }\r\n\r\n // // Check that the grace period is not too short.\r\n // if ($data['overduehandling'] == 'graceperiod') {\r\n // $graceperiodmin = get_config('quiz', 'graceperiodmin');\r\n // if ($data['graceperiod'] <= $graceperiodmin) {\r\n // $errors['graceperiod'] = get_string('graceperiodtoosmall', 'quiz', format_time($graceperiodmin));\r\n // }\r\n // }\r\n\r\n // if (array_key_exists('completion', $data) && $data['completion'] == COMPLETION_TRACKING_AUTOMATIC) {\r\n // $completionpass = isset($data['completionpass']) ? $data['completionpass'] : $this->current->completionpass;\r\n\r\n // // Show an error if require passing grade was selected and the grade to pass was set to 0.\r\n // if ($completionpass && (empty($data['gradepass']) || grade_floatval($data['gradepass']) == 0)) {\r\n // if (isset($data['completionpass'])) {\r\n // $errors['completionpassgroup'] = get_string('gradetopassnotset', 'quiz');\r\n // } else {\r\n // $errors['gradepass'] = get_string('gradetopassmustbeset', 'quiz');\r\n // }\r\n // }\r\n // }\r\n\r\n // // Check the boundary value is a number or a percentage, and in range.\r\n // $i = 0;\r\n // while (!empty($data['feedbackboundaries'][$i] )) {\r\n // $boundary = trim($data['feedbackboundaries'][$i]);\r\n // if (strlen($boundary) > 0) {\r\n // if ($boundary[strlen($boundary) - 1] == '%') {\r\n // $boundary = trim(substr($boundary, 0, -1));\r\n // if (is_numeric($boundary)) {\r\n // $boundary = $boundary * $data['grade'] / 100.0;\r\n // } else {\r\n // $errors[\"feedbackboundaries[$i]\"] =\r\n // get_string('feedbackerrorboundaryformat', 'quiz', $i + 1);\r\n // }\r\n // } else if (!is_numeric($boundary)) {\r\n // $errors[\"feedbackboundaries[$i]\"] =\r\n // get_string('feedbackerrorboundaryformat', 'quiz', $i + 1);\r\n // }\r\n // }\r\n // if (is_numeric($boundary) && $boundary <= 0 || $boundary >= $data['grade'] ) {\r\n // $errors[\"feedbackboundaries[$i]\"] =\r\n // get_string('feedbackerrorboundaryoutofrange', 'quiz', $i + 1);\r\n // }\r\n // if (is_numeric($boundary) && $i > 0 &&\r\n // $boundary >= $data['feedbackboundaries'][$i - 1]) {\r\n // $errors[\"feedbackboundaries[$i]\"] =\r\n // get_string('feedbackerrororder', 'quiz', $i + 1);\r\n // }\r\n // $data['feedbackboundaries'][$i] = $boundary;\r\n // $i += 1;\r\n // }\r\n // $numboundaries = $i;\r\n\r\n // // Check there is nothing in the remaining unused fields.\r\n // if (!empty($data['feedbackboundaries'])) {\r\n // for ($i = $numboundaries; $i < count($data['feedbackboundaries']); $i += 1) {\r\n // if (!empty($data['feedbackboundaries'][$i] ) &&\r\n // trim($data['feedbackboundaries'][$i] ) != '') {\r\n // $errors[\"feedbackboundaries[$i]\"] =\r\n // get_string('feedbackerrorjunkinboundary', 'quiz', $i + 1);\r\n // }\r\n // }\r\n // }\r\n // for ($i = $numboundaries + 1; $i < count($data['feedbacktext']); $i += 1) {\r\n // if (!empty($data['feedbacktext'][$i]['text']) &&\r\n // trim($data['feedbacktext'][$i]['text'] ) != '') {\r\n // $errors[\"feedbacktext[$i]\"] =\r\n // get_string('feedbackerrorjunkinfeedback', 'quiz', $i + 1);\r\n // }\r\n // }\r\n\r\n // // If CBM is involved, don't show the warning for grade to pass being larger than the maximum grade.\r\n // if (($data['preferredbehaviour'] == 'deferredcbm') OR ($data['preferredbehaviour'] == 'immediatecbm')) {\r\n // unset($errors['gradepass']);\r\n // }\r\n // // Any other rule plugins.\r\n // $errors = quiz_access_manager::validate_settings_form_fields($errors, $data, $files, $this);\r\n\r\n // return $errors;\r\n }", "public function validation($data, $files) {\n\n global $CFG;\n $errors = parent::validation($data, $files);\n\n //get the form reference\n $mform =& $this->_form;\n\n $errors = array();\n $cm_idnumbers = $data['idnumber']['cm']; // array for course module id numbers\n if (!empty($cm_idnumbers)) {\n $tmp_array = array();\n $tmp_array = $cm_idnumbers;\n foreach ($cm_idnumbers as $key => $value) {\n if (empty($value)) {\n continue; // if idnumber is blank then no need to check\n }\n unset($tmp_array[$key]); // removing first occurence of the key\n while ($duplicate_value_key = array_search($value, $tmp_array)) {\n // searching existence of the current key\n\n $elname = \"idnumber[cm][$duplicate_value_key]\";\n\n // showing error on subsequent duplicate values.\n if ($mform->isElementFrozen($elname)) {\n // if the 2nd duplicate value found is frozen,\n // then show error on first occurrence\n $errors[\"idnumber[cm][$key]\"]= get_string('idnumbertaken',\n 'report_editidnumber');\n } else {\n // if duplicate is not frozen show error on it.\n $errors[$elname]= get_string('idnumbertaken', 'report_editidnumber');\n }\n unset($tmp_array[$duplicate_value_key]);\n }\n }\n }\n // array for grade items id numbers\n $gi_idnumbers = isset($data['idnumber']['gi']) ? $data['idnumber']['gi'] : \"\";\n\n if (!empty($gi_idnumbers)) {\n $tmp_array = array();\n $tmp_array = $gi_idnumbers;\n foreach ($gi_idnumbers as $key => $value) {\n if (empty($value)) {\n continue; // if idnumber is blank then no need to check\n }\n // if idnumber is already assigned to any course module\n if (array_search($value, $cm_idnumbers)) {\n $errors[\"idnumber[gi][$key]\"]= get_string('idnumbertaken',\n 'report_editidnumber');\n }\n unset ($tmp_array[$key]); // removing first occurence of the key\n // searching existence of the current key\n while ($duplicate_value_key = array_search($value, $tmp_array)) {\n $errors[\"idnumber[gi][$duplicate_value_key]\"]= get_string('idnumbertaken',\n 'report_editidnumber');\n unset($tmp_array[$duplicate_value_key]);\n }\n }\n }\n\n return $errors;\n }", "public function rules()\n\t{\n\t\treturn array(\n\t\t\tarray('id,employee_id,status_type,support_city,wage_city,start_date,end_date,supportInfo','safe'),\n array('employee_id','required'),\n array('support_city,start_date','required'),\n array('employee_id','validateName'),\n array('supportInfo','validateDetail'),\n\t\t);\n\t}", "public function isValid($data) {\n //Remove Commas \n $data = str_replace(\",\", \"\", $data);\n \n //Valid that DA Pressure is less than or equal to Steam Pressure and Crit Pressure\n if ($data['SteamPressure']<>'' and $data['SteamPressure']<>$data['daPressure']){\n if ($data['SteamPressure']>$this->mS->critPressure()){\n $this->getElement('daPressure')->addValidator('lessThan', true, array('max'=>$this->mS->critPressure()));\n }else{\n $this->getElement('daPressure')->addValidator('lessThan', true, array('max'=>$data['SteamPressure'], 'messages' => 'Cannot be greater than steam pressure.'));\n }\n }\n \n //Valid that DA Pressure is greater than Min Pressure\n if ($data['daPressure']<>$this->mS->minPressure())\n $this->getElement('daPressure')->addValidator('greaterThan', true, array('min' => $this->mS->minPressure()));\n \n return parent::isValid($data);\n }", "public function validate_feedback_data(){\n \n // validate step 1 data.\n \n // rating should be 1-5.\n if( ! in_array($this->post_data->get('rating'), range(1, 5)) ) $this->error_msg[] = 'Rating should be 1 to 5';\n \n // title should not be blank.\n if( trim($this->post_data->get('title')) == '' ) $this->error_msg[] = 'Title should not be blank';\n \n // feedback should not be blank.\n if( trim($this->post_data->get('feedback')) == '' ) $this->error_msg[] = 'Feedback should not be blank';\n \n // recommendation should be 1 or 0.\n if( ! in_array($this->post_data->get('recommend'), range(0, 1)) ) $this->error_msg[] = 'Invalid recommendation option';\n \n \n \n // validate step 2 data.\n \n // first name should not be blank.\n if( trim($this->post_data->get('first_name')) == '' ) $this->error_msg[] = 'First name should not be blank';\n \n // last name should not be blank.\n if( trim($this->post_data->get('last_name')) == '' ) $this->error_msg[] = 'Last name should not be blank';\n \n // email should not be blank.\n if( trim($this->post_data->get('email')) == '' ) $this->error_msg[] = 'Email should not be blank';\n \n // email should be valid.\n if( ! preg_match('/^\\w+([\\.-]?\\w+)*@\\w+([\\.-]?\\w+)*(\\.\\w{2,3})+$/', $this->post_data->get('email')) ) $this->error_msg[] = 'Email should not be valid';\n \n // city should not be blank.\n if( trim($this->post_data->get('city')) == '' ) $this->error_msg[] = 'City should not be blank';\n \n // country should be somewhere from earth.\n $country = DB::table('Country')->where('code', '=', $this->post_data->get('country'))->get();\n if( empty( $country ) ) $this->error_msg[] = 'Invalid country';\n \n // permission shoulbe be 1 or 0.\n if( ! in_array($this->post_data->get('permission'), range(0, 1)) ) $this->error_msg[] = 'Invalid permission option';\n \n \n \n // validate hidden data.\n \n $company = new \\Company\\Repositories\\DBCompany;\n $company = $company->get_company_info( Config::get('application.subdomain') );\n \n // company id should be valid.\n if( $company->companyid != $this->post_data->get('company_id') ) $this->error_msg[] = 'Invalid company id';\n \n // site id should be valid.\n if( $company->siteid != $this->post_data->get('site_id') ) $this->error_msg[] = 'Invalid site id';\n \n \n \n // return true if thre's no error, false otherwise.\n return ( empty($this->error_msg) ? true : false );\n }", "public function DataIsValid()\n {\n $bDataIsValid = parent::DataIsValid();\n if ($this->HasContent() && $bDataIsValid) {\n if (intval($this->data) < 12 && intval($this->data) >= -11) {\n $bDataIsValid = true;\n } else {\n $bDataIsValid = false;\n $oMessageManager = TCMSMessageManager::GetInstance();\n $sConsumerName = TCMSTableEditorManager::MESSAGE_MANAGER_CONSUMER;\n $sFieldTitle = $this->oDefinition->GetName();\n $oMessageManager->AddMessage($sConsumerName, 'TABLEEDITOR_FIELD_TIMEZONE_NOT_VALID', array('sFieldName' => $this->name, 'sFieldTitle' => $sFieldTitle));\n }\n }\n\n return $bDataIsValid;\n }", "public function validate()\n {\n $info = $this->getInfoInstance();\n\n $quote = $info->getQuote();\n\n $maxInstallmentsNumber = Mage::getStoreConfig('payment/vindi_creditcard/max_installments_number');\n\n if ($this->isSingleOrder($quote) && ($maxInstallmentsNumber > 1)) {\n if (! $installments = $info->getAdditionalInformation('installments')) {\n return $this->error('Você deve informar o número de parcelas.');\n }\n\n if ($installments > $maxInstallmentsNumber) {\n return $this->error('O número de parcelas selecionado é inválido.');\n }\n\n $minInstallmentsValue = Mage::getStoreConfig('payment/vindi_creditcard/min_installment_value');\n $installmentValue = ceil($quote->getGrandTotal() / $installments * 100) / 100;\n\n if (($installmentValue < $minInstallmentsValue) && ($installments > 1)) {\n return $this->error('O número de parcelas selecionado é inválido.');\n }\n }\n\n if ($info->getAdditionalInformation('use_saved_cc')) {\n return $this;\n }\n\n $availableTypes = $this->api()->getCreditCardTypes();\n\n $ccNumber = $info->getCcNumber();\n\n // remove credit card non-numbers\n $ccNumber = preg_replace('/\\D/', '', $ccNumber);\n\n $info->setCcNumber($ccNumber);\n\n if (! $this->_validateExpDate($info->getCcExpYear(), $info->getCcExpMonth())) {\n return $this->error(Mage::helper('payment')->__('Incorrect credit card expiration date.'));\n }\n\n if (! array_key_exists($info->getCcType(), $availableTypes)) {\n return $this->error(Mage::helper('payment')->__('Credit card type is not allowed for this payment method.'));\n }\n\n return $this;\n }", "public function validateDetailTransactionData($parent, $child, $count, $value)\n {\n $model = new Model_Wep();\n switch ($child) {\n case 'code':\n $code = $model->getCodeandName($parent, 1);\n if (in_array(strtoupper($value), $code)) {\n $this->elementData[$count][$parent][$child] = array_search(strtoupper($value), $code);\n } else {\n $this->error[$count][]['message'] = \"Invalid \" . $parent . \"-code. Please use proper code.\"; \n }\n break;\n \n case 'xml_lang':\n $xml_lang = $model->getCodeandName('Language', 1);\n if (in_array(strtolower($value), $xml_lang)) {\n $this->elementData[$count][$parent][$child] = array_search(strtolower($value), $xml_lang);\n } else {\n $this->error[$count][]['message'] = \"Invalid \" . $parent . \"-xml_lang code. Please use a valid language code.\";\n }\n break;\n\n case 'iso_date':\n case 'value_date':\n $value = str_replace('/', '-', $value);\n $date = date_parse($value);\n if (!checkdate($date[\"month\"], $date[\"day\"], $date[\"year\"])){ \n $this->error[$count][]['message'] = $parent . \"-\" . $child . \" must be in date format.\";\n } else {\n $this->elementData[$count][$parent][$child] = date('Y-m-d', strtotime($value));\n }\n break;\n\n case 'currency';\n $currency = $model->getCodeandName('Currency', 1);\n if (in_array(strtoupper($value), $currency)) {\n $this->elementData[$count][$parent][$child] = array_search(strtoupper($value), $currency);\n } else {\n $this->error[$count][]['message'] = \"Invalid \" . $parent . \"-currency code. Please use a valid currency code.\";\n }\n break;\n\n default:\n break;\n }\n }", "function homeValidate() {\n\t\t$validate1 = array(\n\t\t\n\t\t/*'stock'=> array(\n\t\t\t\t\t'mustNotEmpty'=>array(\n\t\t\t\t\t\t'rule' => 'notEmpty',\n\t\t\t\t\t\t'message'=> 'Please enter Stock Number')\n\t\t\t\t\t),\n\t\t\t\t\n\t\t 'name'=> array(\n\t\t\t\t\t'mustNotEmpty'=>array(\n\t\t\t\t\t\t'rule' => 'notEmpty',\n\t\t\t\t\t\t'message'=> 'Please enter name')\n\t\t\t\t\t),*/\n\t\t 'email'=> array(\n\t\t\t\t\t'mustNotEmpty'=>array(\n\t\t\t\t\t\t'rule' => 'notEmpty',\n\t\t\t\t\t\t'message'=> 'Please enter Email')\n\t\t\t\t\t),\n\n\t\t 'contact'=> array(\n\t\t\t\t\t'mustNotEmpty'=>array(\n\t\t\t\t\t\t'rule' => 'notEmpty',\n\t\t\t\t\t\t'message'=> 'Please enter Contact Number')\n\t\t\t\t\t),\n\t\t/*'make'=> array(\n\t\t\t\t\t'mustNotEmpty'=>array(\n\t\t\t\t\t\t'rule' => 'notEmpty',\n\t\t\t\t\t\t'message'=> 'Please enter Make')\n\t\t\t\t\t),\n\t\t'model'=> array(\n\t\t\t\t\t'mustNotEmpty'=>array(\n\t\t\t\t\t\t'rule' => 'notEmpty',\n\t\t\t\t\t\t'message'=> 'Please enter Model')\n\t\t\t\t\t),\n\t\t'part'=> array(\n\t\t\t\t\t'mustNotEmpty'=>array(\n\t\t\t\t\t\t'rule' => 'notEmpty',\n\t\t\t\t\t\t'message'=> 'Please enter part')\n\t\t\t\t\t),\n\t\t'year'=> array(\n\t\t\t\t\t'mustNotEmpty'=>array(\n\t\t\t\t\t\t'rule' => 'notEmpty',\n\t\t\t\t\t\t'message'=> 'Please choose year')\n\t\t\t\t\t),\n\t\t'country' => array(\n\t\t\t\t\t'mustNotEmpty'=>array(\n\t\t\t\t\t\t'rule' => 'notEmpty',\n\t\t\t\t\t\t'message'=> 'Please choose country')\n\t\t\t\t\t),\n\t\t'comment' => array(\n\t\t\t\t\t'mustNotEmpty'=>array(\n\t\t\t\t\t\t'rule' => 'notEmpty',\n\t\t\t\t\t\t'message'=> 'Please enter comment')\n\t\t\t\t\t),*/\n\t\t\n\t\t\t);\n\t\t$this->validate=$validate1;\n\t\treturn $this->validates();\n\t}", "protected function award_validation()\n {\n if (is_superadmin_loggedin()) {\n $this->form_validation->set_rules('branch_id', translate('branch'), 'required');\n }\n $this->form_validation->set_rules('role_id', translate('role'), 'trim|required');\n $this->form_validation->set_rules('user_id', translate('winner'), 'trim|required');\n $this->form_validation->set_rules('award_name', translate('award_name'), 'trim|required');\n $this->form_validation->set_rules('gift_item', translate('gift_item'), 'trim|required');\n $this->form_validation->set_rules('award_reason', translate('award_reason'), 'trim|required');\n $this->form_validation->set_rules('given_date', translate('given_date'), 'trim|required');\n $roleID = $this->input->post('role_id');\n if ($roleID == 7) {\n $this->form_validation->set_rules('class_id', translate('class'), 'trim|required');\n }\n }", "protected function validationData() {\n\t\t$input = [];\n\n\t\t/**\n\t\t * Decode institute and ref_by id and merge to request input\n\t\t */\n\t\tif ( $this->has('institute_id') ) {\n\t\t\t$input['institute_id'] = GeneralHelpers::decode($this->input('institute_id'));\n\t\t}\n\n\t\tif ( $this->has('ref_by') ) {\n\t\t\t$input['ref_by'] = GeneralHelpers::decode($this->get('ref_by'));\n\t\t}\n\n\t\t$this->merge($input);\n\n\t\treturn parent::validationData(); // TODO: Change the autogenerated stub\n\t}", "protected function validate()\n {\n if ($this->name == '') {\n $this->errors[] = 'Name is required';\n }\n\n if ($this->name == '') {\n $this->errors[] = 'Name is required';\n }\n if ($this->sex == '') {\n $this->errors[] = 'Sex selection is required';\n }\n\n if ($this->description == '') {\n $this->errors[] = 'Description is required';\n }\n\n if ($this->surrender_date == '') {\n $this->errors[] = 'Surrender Date is required';\n }\n\n if ($this->surrender_reason == '') {\n $this->errors[] = 'Surrender Reason is required';\n }\n\n return empty($this->errors);\n }", "private function _validData($data){\n\t\t$columnsLen = array(\n\t\t\t\t\t\t\t'nro_pedido' => 6,\n\t\t\t\t\t\t\t'id_factura_pagos' => 1,\n\t\t\t\t\t\t\t'valor' => 1,\n\t\t\t\t\t\t\t'concepto' => 1,\n\t\t\t\t\t\t\t'fecha_inicio' => 0,\n\t\t\t\t\t\t\t'fecha_fin' => 0,\n\t\t\t\t\t\t\t'id_user' => 1\n\t\t);\n\t\treturn $this->_checkColumnsData($columnsLen, $data);\n\t}", "function Validation()\n {\n $validate1 = array(\n 'FIRST_NAME' => array(\n 'mustNotEmpty' => array(\n 'rule' => 'notEmpty',\n 'message' => 'First name could not be blank',\n 'last' => true)\n ),\n \n 'DOB' => array(\n 'mustNotEmpty' => array(\n 'rule' => 'notEmpty',\n 'message' => 'Date Of Birth could not be blank',\n 'last' => true)\n ),\n 'FATHER_NAME' => array(\n 'mustNotEmpty' => array(\n 'rule' => 'notEmpty',\n 'message' => 'Father Name could not be blank',\n 'last' => true)\n ),\n 'RELIGION' => array(\n 'mustNotEmpty' => array(\n 'rule' => 'notEmpty',\n 'message' => 'Religion could not be blank',\n 'last' => true)\n ),\n 'CAST' => array(\n 'mustNotEmpty' => array(\n 'rule' => 'notEmpty',\n 'message' => 'Cast could not be blank',\n 'last' => true)\n ),\n 'SUB_CAST' => array(\n 'mustNotEmpty' => array(\n 'rule' => 'notEmpty',\n 'message' => 'Sub Cast could not be blank',\n 'last' => true)\n ),\n 'CAST_CAT_ID' => array(\n 'mustNotEmpty' => array(\n 'rule' => array('comparison', '!=', 0),\n 'message' => 'Please select Cast Category',\n 'last' => true)\n ),\n 'CLASS_ID' => array(\n 'mustNotEmpty' => array(\n 'rule' => array('comparison', '!=', 0),\n 'message' => 'Please select Class',\n 'last' => true)\n ),\n 'MEDIUM_ID' => array(\n 'mustNotEmpty' => array(\n 'rule' => array('comparison', '!=', 0),\n 'message' => 'Please select Medium',\n 'last' => true)\n ),\n 'PASSWORD' => array(\n 'mustNotEmpty' => array(\n 'rule' => 'notEmpty',\n 'message' => 'Please enter password',\n 'allowEmpty' => true,\n 'on' => 'create',\n 'last' => true),\n 'between' => array(\n 'rule' => array('between', 6, 25),\n 'message' => 'Password between 6 and 25 chars',\n 'required' => false,\n 'allowEmpty' => true,\n ),\n ),\n 'CONFIRM_PASSWORD' => array(\n 'mustMatch' => array(\n 'rule' => array('verifies'),\n 'message' => 'Both passwords must match',\n 'last' => true),\n ),\n 'COUNTRY_ID' => array(\n 'mustNotEmpty' => array(\n 'rule' => array('comparison', '!=', 0),\n 'message' => 'Please select Country',\n 'last' => true)\n ),\n\t\t\t 'GROUP' => array(\n 'mustNotEmpty' => array(\n 'rule' => 'notEmpty',\n 'message' => 'Group could not be blank',\n 'last' => true),\n\t\t\t 'mustNotEmpty' => array(\n 'rule' => array('comparison', '!=', 0),\n 'message' => 'Please select Group',\n 'last' => true)\n \t\t ),\n \n \n \n );\n $this->validate = $validate1;\n return $this->validates();\n }", "private function proccess()\n {\n foreach ($this->validate as $name => $value) {\n $rules = $this->rules[$name];\n \n /* Let's see is this value a required, e.g not empty */\n if (preg_match('~req~', $rules)) {\n if ($this->isEmpty($value)) {\n $this->errors[] = $this->filterName($name) . ' can\\'t be empty, please enter required data.';\n continue; // We will display only one error per input\n }\n }\n \n /**\n * Let's see is this value needs to be integer\n */\n if (preg_match('~int~', $rules)) {\n if (!$this->isInt($value)) {\n $this->errors[] = $this->filterName($name) . ' is not number, please enter number.';\n continue; // We will display only one error per input\n }\n }\n \n /**\n * Let's see is this value needs to be text\n */\n if (preg_match('~text~', $rules)) {\n if (!$this->isText($value)) {\n $this->errors[] = $this->filterName($name) . ' is not text, please enter only letters.';\n continue; // We will display only one error per input\n }\n }\n \n /* This is good input */\n $this->data[$name] = $value;\n }\n }", "protected function prepareForValidation()\n {\n if($this->name != null) {\n $this->merge([\n 'name' => filter_var($this->name, FILTER_SANITIZE_STRING),\n ]);\n }\n\n if($this->email != null) {\n $this->merge([\n 'email' => filter_var(trim($this->email), FILTER_SANITIZE_EMAIL),\n ]);\n }\n\n if($this->leader != null) {\n $this->merge([\n 'leader' => filter_var($this->leader, FILTER_SANITIZE_STRING),\n ]);\n }\n\n if($this->gruplac != null) {\n $this->merge([\n 'gruplac' => filter_var(trim($this->gruplac), FILTER_SANITIZE_URL),\n ]);\n }\n\n if($this->minciencias_code != null) {\n $this->merge([\n 'minciencias_code' => filter_var(trim($this->minciencias_code), FILTER_SANITIZE_STRING),\n ]);\n }\n\n if($this->minciencias_category != null) {\n $this->merge([\n 'minciencias_category' => filter_var($this->minciencias_category, FILTER_SANITIZE_STRING),\n ]);\n }\n\n if($this->website != null) {\n $this->merge([\n 'website' => filter_var(trim($this->website), FILTER_SANITIZE_URL),\n ]);\n }\n\n if($this->educational_institution_id != null) {\n $this->merge([\n 'educational_institution_id' => (integer) filter_var($this->educational_institution_id, FILTER_SANITIZE_NUMBER_INT),\n ]);\n }\n }", "public function validate() {\n if (!empty($this->value)) {\n parent::validate();\n }\n }", "public function listInvalidProperties()\n {\n $invalidProperties = [];\n\n if ($this->container['company_id'] === null) {\n $invalidProperties[] = \"'company_id' can't be null\";\n }\n if (($this->container['company_id'] > 2147483647)) {\n $invalidProperties[] = \"invalid value for 'company_id', must be smaller than or equal to 2147483647.\";\n }\n\n if (($this->container['company_id'] < 1)) {\n $invalidProperties[] = \"invalid value for 'company_id', must be bigger than or equal to 1.\";\n }\n\n if (!is_null($this->container['company_prefecture_code']) && ($this->container['company_prefecture_code'] > 46)) {\n $invalidProperties[] = \"invalid value for 'company_prefecture_code', must be smaller than or equal to 46.\";\n }\n\n if (!is_null($this->container['company_prefecture_code']) && ($this->container['company_prefecture_code'] < 0)) {\n $invalidProperties[] = \"invalid value for 'company_prefecture_code', must be bigger than or equal to 0.\";\n }\n\n if ($this->container['partner_display_name'] === null) {\n $invalidProperties[] = \"'partner_display_name' can't be null\";\n }\n if (!is_null($this->container['partner_id']) && ($this->container['partner_id'] > 2147483647)) {\n $invalidProperties[] = \"invalid value for 'partner_id', must be smaller than or equal to 2147483647.\";\n }\n\n if (!is_null($this->container['partner_id']) && ($this->container['partner_id'] < 1)) {\n $invalidProperties[] = \"invalid value for 'partner_id', must be bigger than or equal to 1.\";\n }\n\n if (!is_null($this->container['partner_prefecture_code']) && ($this->container['partner_prefecture_code'] > 46)) {\n $invalidProperties[] = \"invalid value for 'partner_prefecture_code', must be smaller than or equal to 46.\";\n }\n\n if (!is_null($this->container['partner_prefecture_code']) && ($this->container['partner_prefecture_code'] < 0)) {\n $invalidProperties[] = \"invalid value for 'partner_prefecture_code', must be bigger than or equal to 0.\";\n }\n\n if ($this->container['partner_title'] === null) {\n $invalidProperties[] = \"'partner_title' can't be null\";\n }\n $allowedValues = $this->getQuotationLayoutAllowableValues();\n if (!is_null($this->container['quotation_layout']) && !in_array($this->container['quotation_layout'], $allowedValues, true)) {\n $invalidProperties[] = sprintf(\n \"invalid value '%s' for 'quotation_layout', must be one of '%s'\",\n $this->container['quotation_layout'],\n implode(\"', '\", $allowedValues)\n );\n }\n\n $allowedValues = $this->getQuotationStatusAllowableValues();\n if (!is_null($this->container['quotation_status']) && !in_array($this->container['quotation_status'], $allowedValues, true)) {\n $invalidProperties[] = sprintf(\n \"invalid value '%s' for 'quotation_status', must be one of '%s'\",\n $this->container['quotation_status'],\n implode(\"', '\", $allowedValues)\n );\n }\n\n $allowedValues = $this->getTaxEntryMethodAllowableValues();\n if (!is_null($this->container['tax_entry_method']) && !in_array($this->container['tax_entry_method'], $allowedValues, true)) {\n $invalidProperties[] = sprintf(\n \"invalid value '%s' for 'tax_entry_method', must be one of '%s'\",\n $this->container['tax_entry_method'],\n implode(\"', '\", $allowedValues)\n );\n }\n\n return $invalidProperties;\n }", "function validate() {\n\t\t\t$this->field['msg'] = ( isset( $this->field['msg'] ) ) ? $this->field['msg'] : esc_html__( 'You must provide a comma separated list of numerical values for this option.', 'redux-framework' );\n\n\t\t\tif ( ! is_numeric( str_replace( ',', '', $this->value ) ) || strpos( $this->value, ',' ) == false ) {\n\t\t\t\t$this->value = ( isset( $this->current ) ) ? $this->current : '';\n\t\t\t\t$this->field['current'] = $this->value;\n\n\t\t\t\t$this->error = $this->field;\n\t\t\t}\n\t\t}", "function validation($data, $files) {\n $errors = parent::validation($data, $files);\n \n if(empty($data['ukprn'])) {\n $errors['ukprn'] = get_string('error_missing_school_name', 'enrol_ukfilmnet');\n }\n if($data['contact_email'] && strpos( $data['contact_email'], '@') === false) {\n $errors['contact_email'] = get_string('error_invalid_email', 'enrol_ukfilmnet');\n }\n if(!array_key_exists('school_consent_to_contact', $data)) {\n $errors['school_consent_to_contact'] = get_string('error_missing_school_consent_to_contact', 'enrol_ukfilmnet');\n }\n \n return $errors;\n }", "public function addToCompensation_Detail_Data(\\WorkdayWsdl\\\\StructType\\Compensation_Detail_DataType $item)\n {\n // validation for constraint: itemType\n if (!$item instanceof \\WorkdayWsdl\\\\StructType\\Compensation_Detail_DataType) {\n throw new \\InvalidArgumentException(sprintf('The Compensation_Detail_Data property can only contain items of type \\WorkdayWsdl\\\\StructType\\Compensation_Detail_DataType, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__);\n }\n $this->Compensation_Detail_Data[] = $item;\n return $this;\n }", "public function validateData(){\n return true;\n }", "public function rules()\n {\n return [\n // MUST be present, be a number and exist in table\n 'centre' => 'required|exists:centres,id|numeric',\n // MUST be present, string, exists\n 'voucher-start' => 'required|string|exists:vouchers,code',\n // MUST be present, string, exists, greater/equal to start and same sponsor as start\n 'voucher-end' => 'required|string|exists:vouchers,code|codeGreaterThan:voucher-start|sameSponsor:voucher-start',\n // MUST be present, date formatted to Y-m-d, eg 2019-06-21\n 'date-sent' => 'required|date_format:Y-m-d',\n ];\n }", "public function _getValidationErrors()\n {\n $errs = parent::_getValidationErrors();\n $validationRules = $this->_getValidationRules();\n if ([] !== ($vs = $this->getDataRequirement())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_DATA_REQUIREMENT, $i)] = $fieldErrs;\n }\n }\n }\n if (null !== ($v = $this->getEncounter())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_ENCOUNTER] = $fieldErrs;\n }\n }\n if ([] !== ($vs = $this->getEvaluationMessage())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_EVALUATION_MESSAGE, $i)] = $fieldErrs;\n }\n }\n }\n if ([] !== ($vs = $this->getIdentifier())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_IDENTIFIER, $i)] = $fieldErrs;\n }\n }\n }\n if (null !== ($v = $this->getModuleCanonical())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_MODULE_CANONICAL] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getModuleCodeableConcept())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_MODULE_CODEABLE_CONCEPT] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getModuleUri())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_MODULE_URI] = $fieldErrs;\n }\n }\n if ([] !== ($vs = $this->getNote())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_NOTE, $i)] = $fieldErrs;\n }\n }\n }\n if (null !== ($v = $this->getOccurrenceDateTime())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_OCCURRENCE_DATE_TIME] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getOutputParameters())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_OUTPUT_PARAMETERS] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getPerformer())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_PERFORMER] = $fieldErrs;\n }\n }\n if ([] !== ($vs = $this->getReasonCode())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_REASON_CODE, $i)] = $fieldErrs;\n }\n }\n }\n if ([] !== ($vs = $this->getReasonReference())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_REASON_REFERENCE, $i)] = $fieldErrs;\n }\n }\n }\n if (null !== ($v = $this->getRequestIdentifier())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_REQUEST_IDENTIFIER] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getResult())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_RESULT] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getStatus())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_STATUS] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getSubject())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_SUBJECT] = $fieldErrs;\n }\n }\n if (isset($validationRules[self::FIELD_DATA_REQUIREMENT])) {\n $v = $this->getDataRequirement();\n foreach($validationRules[self::FIELD_DATA_REQUIREMENT] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_GUIDANCE_RESPONSE, self::FIELD_DATA_REQUIREMENT, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_DATA_REQUIREMENT])) {\n $errs[self::FIELD_DATA_REQUIREMENT] = [];\n }\n $errs[self::FIELD_DATA_REQUIREMENT][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_ENCOUNTER])) {\n $v = $this->getEncounter();\n foreach($validationRules[self::FIELD_ENCOUNTER] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_GUIDANCE_RESPONSE, self::FIELD_ENCOUNTER, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_ENCOUNTER])) {\n $errs[self::FIELD_ENCOUNTER] = [];\n }\n $errs[self::FIELD_ENCOUNTER][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_EVALUATION_MESSAGE])) {\n $v = $this->getEvaluationMessage();\n foreach($validationRules[self::FIELD_EVALUATION_MESSAGE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_GUIDANCE_RESPONSE, self::FIELD_EVALUATION_MESSAGE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_EVALUATION_MESSAGE])) {\n $errs[self::FIELD_EVALUATION_MESSAGE] = [];\n }\n $errs[self::FIELD_EVALUATION_MESSAGE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_IDENTIFIER])) {\n $v = $this->getIdentifier();\n foreach($validationRules[self::FIELD_IDENTIFIER] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_GUIDANCE_RESPONSE, self::FIELD_IDENTIFIER, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_IDENTIFIER])) {\n $errs[self::FIELD_IDENTIFIER] = [];\n }\n $errs[self::FIELD_IDENTIFIER][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_MODULE_CANONICAL])) {\n $v = $this->getModuleCanonical();\n foreach($validationRules[self::FIELD_MODULE_CANONICAL] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_GUIDANCE_RESPONSE, self::FIELD_MODULE_CANONICAL, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_MODULE_CANONICAL])) {\n $errs[self::FIELD_MODULE_CANONICAL] = [];\n }\n $errs[self::FIELD_MODULE_CANONICAL][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_MODULE_CODEABLE_CONCEPT])) {\n $v = $this->getModuleCodeableConcept();\n foreach($validationRules[self::FIELD_MODULE_CODEABLE_CONCEPT] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_GUIDANCE_RESPONSE, self::FIELD_MODULE_CODEABLE_CONCEPT, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_MODULE_CODEABLE_CONCEPT])) {\n $errs[self::FIELD_MODULE_CODEABLE_CONCEPT] = [];\n }\n $errs[self::FIELD_MODULE_CODEABLE_CONCEPT][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_MODULE_URI])) {\n $v = $this->getModuleUri();\n foreach($validationRules[self::FIELD_MODULE_URI] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_GUIDANCE_RESPONSE, self::FIELD_MODULE_URI, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_MODULE_URI])) {\n $errs[self::FIELD_MODULE_URI] = [];\n }\n $errs[self::FIELD_MODULE_URI][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_NOTE])) {\n $v = $this->getNote();\n foreach($validationRules[self::FIELD_NOTE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_GUIDANCE_RESPONSE, self::FIELD_NOTE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_NOTE])) {\n $errs[self::FIELD_NOTE] = [];\n }\n $errs[self::FIELD_NOTE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_OCCURRENCE_DATE_TIME])) {\n $v = $this->getOccurrenceDateTime();\n foreach($validationRules[self::FIELD_OCCURRENCE_DATE_TIME] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_GUIDANCE_RESPONSE, self::FIELD_OCCURRENCE_DATE_TIME, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_OCCURRENCE_DATE_TIME])) {\n $errs[self::FIELD_OCCURRENCE_DATE_TIME] = [];\n }\n $errs[self::FIELD_OCCURRENCE_DATE_TIME][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_OUTPUT_PARAMETERS])) {\n $v = $this->getOutputParameters();\n foreach($validationRules[self::FIELD_OUTPUT_PARAMETERS] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_GUIDANCE_RESPONSE, self::FIELD_OUTPUT_PARAMETERS, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_OUTPUT_PARAMETERS])) {\n $errs[self::FIELD_OUTPUT_PARAMETERS] = [];\n }\n $errs[self::FIELD_OUTPUT_PARAMETERS][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_PERFORMER])) {\n $v = $this->getPerformer();\n foreach($validationRules[self::FIELD_PERFORMER] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_GUIDANCE_RESPONSE, self::FIELD_PERFORMER, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_PERFORMER])) {\n $errs[self::FIELD_PERFORMER] = [];\n }\n $errs[self::FIELD_PERFORMER][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_REASON_CODE])) {\n $v = $this->getReasonCode();\n foreach($validationRules[self::FIELD_REASON_CODE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_GUIDANCE_RESPONSE, self::FIELD_REASON_CODE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_REASON_CODE])) {\n $errs[self::FIELD_REASON_CODE] = [];\n }\n $errs[self::FIELD_REASON_CODE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_REASON_REFERENCE])) {\n $v = $this->getReasonReference();\n foreach($validationRules[self::FIELD_REASON_REFERENCE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_GUIDANCE_RESPONSE, self::FIELD_REASON_REFERENCE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_REASON_REFERENCE])) {\n $errs[self::FIELD_REASON_REFERENCE] = [];\n }\n $errs[self::FIELD_REASON_REFERENCE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_REQUEST_IDENTIFIER])) {\n $v = $this->getRequestIdentifier();\n foreach($validationRules[self::FIELD_REQUEST_IDENTIFIER] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_GUIDANCE_RESPONSE, self::FIELD_REQUEST_IDENTIFIER, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_REQUEST_IDENTIFIER])) {\n $errs[self::FIELD_REQUEST_IDENTIFIER] = [];\n }\n $errs[self::FIELD_REQUEST_IDENTIFIER][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_RESULT])) {\n $v = $this->getResult();\n foreach($validationRules[self::FIELD_RESULT] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_GUIDANCE_RESPONSE, self::FIELD_RESULT, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_RESULT])) {\n $errs[self::FIELD_RESULT] = [];\n }\n $errs[self::FIELD_RESULT][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_STATUS])) {\n $v = $this->getStatus();\n foreach($validationRules[self::FIELD_STATUS] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_GUIDANCE_RESPONSE, self::FIELD_STATUS, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_STATUS])) {\n $errs[self::FIELD_STATUS] = [];\n }\n $errs[self::FIELD_STATUS][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_SUBJECT])) {\n $v = $this->getSubject();\n foreach($validationRules[self::FIELD_SUBJECT] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_GUIDANCE_RESPONSE, self::FIELD_SUBJECT, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_SUBJECT])) {\n $errs[self::FIELD_SUBJECT] = [];\n }\n $errs[self::FIELD_SUBJECT][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_CONTAINED])) {\n $v = $this->getContained();\n foreach($validationRules[self::FIELD_CONTAINED] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE, self::FIELD_CONTAINED, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_CONTAINED])) {\n $errs[self::FIELD_CONTAINED] = [];\n }\n $errs[self::FIELD_CONTAINED][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_EXTENSION])) {\n $v = $this->getExtension();\n foreach($validationRules[self::FIELD_EXTENSION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE, self::FIELD_EXTENSION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_EXTENSION])) {\n $errs[self::FIELD_EXTENSION] = [];\n }\n $errs[self::FIELD_EXTENSION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_MODIFIER_EXTENSION])) {\n $v = $this->getModifierExtension();\n foreach($validationRules[self::FIELD_MODIFIER_EXTENSION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE, self::FIELD_MODIFIER_EXTENSION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_MODIFIER_EXTENSION])) {\n $errs[self::FIELD_MODIFIER_EXTENSION] = [];\n }\n $errs[self::FIELD_MODIFIER_EXTENSION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_TEXT])) {\n $v = $this->getText();\n foreach($validationRules[self::FIELD_TEXT] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE, self::FIELD_TEXT, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_TEXT])) {\n $errs[self::FIELD_TEXT] = [];\n }\n $errs[self::FIELD_TEXT][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_ID])) {\n $v = $this->getId();\n foreach($validationRules[self::FIELD_ID] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_RESOURCE, self::FIELD_ID, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_ID])) {\n $errs[self::FIELD_ID] = [];\n }\n $errs[self::FIELD_ID][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_IMPLICIT_RULES])) {\n $v = $this->getImplicitRules();\n foreach($validationRules[self::FIELD_IMPLICIT_RULES] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_RESOURCE, self::FIELD_IMPLICIT_RULES, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_IMPLICIT_RULES])) {\n $errs[self::FIELD_IMPLICIT_RULES] = [];\n }\n $errs[self::FIELD_IMPLICIT_RULES][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_LANGUAGE])) {\n $v = $this->getLanguage();\n foreach($validationRules[self::FIELD_LANGUAGE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_RESOURCE, self::FIELD_LANGUAGE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_LANGUAGE])) {\n $errs[self::FIELD_LANGUAGE] = [];\n }\n $errs[self::FIELD_LANGUAGE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_META])) {\n $v = $this->getMeta();\n foreach($validationRules[self::FIELD_META] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_RESOURCE, self::FIELD_META, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_META])) {\n $errs[self::FIELD_META] = [];\n }\n $errs[self::FIELD_META][$rule] = $err;\n }\n }\n }\n return $errs;\n }", "public function ValidatePHP_cc_detail()\n {\n // error flag, becomes 1 when errors are found.\n $errorsExist = 0;\n \n \n if (!$this->validate_contact_id($_GET['cid']))\n {\n\t\t//print \"error name: \" .$_POST['ce_name']. \"<br>\";\n \t$errorsExist = 1;\n }\n \n\treturn $errorsExist;\n\t\n }", "public function rules() {\n return array(\n array('out_summ, in_curr', 'required'),\n array('out_summ', 'numerical', 'min' => 1, 'tooSmall' => Yii::t('payment', 'The summ can not be less than $ 1'), 'message' => Yii::t('payment', 'Summ must be a number')),\n );\n }", "public function getConfigFromData(ContinuationDetail $continuationDetail)\n {\n $notRemovedCriteria = Criteria::create();\n $notRemovedCriteria->andWhere(\n $notRemovedCriteria->expr()->isNull('removalDate')\n );\n\n $licenceVehicles = $continuationDetail->getLicence()->getLicenceVehicles()->matching($notRemovedCriteria);\n $isGoods =\n $continuationDetail->getLicence()->getGoodsOrPsv()->getId() === Licence::LICENCE_CATEGORY_GOODS_VEHICLE;\n\n $header[] = [\n ['value' => 'continuations.vehicles-section.table.vrm', 'header' => true]\n ];\n if ($isGoods) {\n $header[0][] = ['value' => 'continuations.vehicles-section.table.weight', 'header' => true];\n }\n\n $config = [];\n /** @var LicenceVehicle $lv */\n foreach ($licenceVehicles as $lv) {\n /** @var Vehicle $vehicle */\n $vehicle = $lv->getVehicle();\n $row = [];\n $row[] = ['value' => $vehicle->getVrm()];\n if ($isGoods) {\n $row[] = [\n // no need to translate, the same in Welsh\n 'value' => $vehicle->getPlatedWeight() . 'kg'\n ];\n }\n $config[] = $row;\n }\n\n usort(\n $config,\n function ($a, $b) {\n return strcmp($a[0]['value'], $b[0]['value']);\n }\n );\n\n return (count($config) === 0)\n ? ['emptyTableMessage' => $this->translate('There are no vehicles recorded on your licence')]\n : array_merge($header, $config);\n }", "function validate() {\n\t\t\n\t\tif(is_array($this->value)) { // If array\n\t\t\tforeach($this->value as $k => $value){\n\t\t\t\t$this->value[$k] = $this->validate_color_rgba($value);\n\t\t\t}//foreach\n\t\t} else { // not array\n\t\t\t$this->value = $this->validate_color_rgba($this->value);\n\t\t} // END array check\n\t\t\n\t}", "public function rules()\n {\n return [\n\n 'case_type' =>'required|not_in:0',\n// 'case_sub_type' =>'required|not_in:0',\n'saps_station'=>'required',\n 'cellphone' =>'required',\n 'name' =>'required|alpha',\n 'surname' =>'required|alpha',\n 'company' =>'required',\n 'description' =>'required',\n 'client_reference_number' =>'required',\n 'saps_case_number' =>'required',\n 'saps_case_number' =>'required',\n // 'rate_value' =>'required',\n 'investigation_cell' =>'required',\n 'investigation_email' =>'email',\n 'investigation_note' =>'required',\n\n\n\n\n\n\n \n ];\n }", "function commonValidation($data) {\n unset($this->validate['title']);\n unset($this->validate['category_id']);\n unset($this->validate['short_description']);\n\n if ($data['Offer']['basename'] != '') {\n unset($this->validate['file']['valid_upload']);\n }\n }", "public function listInvalidProperties()\n {\n $invalidProperties = [];\n\n if ($this->container['channelProductNo'] === null) {\n $invalidProperties[] = \"'channelProductNo' can't be null\";\n }\n if ((mb_strlen($this->container['channelProductNo']) > 60)) {\n $invalidProperties[] = \"invalid value for 'channelProductNo', the character length must be smaller than or equal to 60.\";\n }\n\n if ((mb_strlen($this->container['channelProductNo']) < 0)) {\n $invalidProperties[] = \"invalid value for 'channelProductNo', the character length must be bigger than or equal to 0.\";\n }\n\n if (!is_null($this->container['merchantProductNo']) && (mb_strlen($this->container['merchantProductNo']) > 50)) {\n $invalidProperties[] = \"invalid value for 'merchantProductNo', the character length must be smaller than or equal to 50.\";\n }\n\n if (!is_null($this->container['merchantProductNo']) && (mb_strlen($this->container['merchantProductNo']) < 0)) {\n $invalidProperties[] = \"invalid value for 'merchantProductNo', the character length must be bigger than or equal to 0.\";\n }\n\n if ($this->container['quantity'] === null) {\n $invalidProperties[] = \"'quantity' can't be null\";\n }\n if (($this->container['quantity'] < 0)) {\n $invalidProperties[] = \"invalid value for 'quantity', must be bigger than or equal to 0.\";\n }\n\n if (!is_null($this->container['cancellationRequestedQuantity']) && ($this->container['cancellationRequestedQuantity'] < 0)) {\n $invalidProperties[] = \"invalid value for 'cancellationRequestedQuantity', must be bigger than or equal to 0.\";\n }\n\n if ($this->container['unitPriceInclVat'] === null) {\n $invalidProperties[] = \"'unitPriceInclVat' can't be null\";\n }\n if (($this->container['unitPriceInclVat'] < 0)) {\n $invalidProperties[] = \"invalid value for 'unitPriceInclVat', must be bigger than or equal to 0.\";\n }\n\n if (!is_null($this->container['feeFixed']) && ($this->container['feeFixed'] < 0)) {\n $invalidProperties[] = \"invalid value for 'feeFixed', must be bigger than or equal to 0.\";\n }\n\n if (!is_null($this->container['feeRate']) && ($this->container['feeRate'] < 0)) {\n $invalidProperties[] = \"invalid value for 'feeRate', must be bigger than or equal to 0.\";\n }\n\n return $invalidProperties;\n }", "private function validateData()\n {\n if (empty($this->nome)) {\n $this->errors->addMessage(\"O nome é obrigatório\");\n }\n\n if (!filter_var($this->email, FILTER_VALIDATE_EMAIL)) {\n $this->errors->addMessage(\"O e-mail é inválido\");\n }\n\n if (strlen($this->senha) < 6) {\n $this->errors->addMessage(\"A senha deve ter no minímo 6 caracteres!\");\n }\n if ($this->emailExiste($this->email, 'email')) {\n $this->errors->addMessage(\"Esse e-mail já está cadastrado\");\n }\n if ($this->emailExiste($this->usuario, 'usuario')) {\n $this->errors->addMessage(\"Esse usuário já está cadastrado\");\n }\n\n return $this->errors->hasError();\n }", "private function _inputUpdateValidatedFields(WireInputData $values, Salesperson $code) {\n\t\t$invalidfields = [];\n\t\t$originals = ['groupid' => $code->groupid, 'userid' => $code->userid, 'vendorid' => $code->vendorid];\n\n\t\t$spgpm = Spgpm::instance();\n\t\t$code->setGroupid($values->string('groupid'));\n\n\t\tif ($spgpm->exists($values->string('groupid')) === false) {\n\t\t\t$code->setGroupid('');\n\t\t\t$invalidfields['groupid'] = 'Group ID';\n\t\t}\n\n\t\t$logm = \\Dplus\\Msa\\Logm::getInstance();\n\t\t$code->setUserid($values->text('userid'));\n\n\t\tif ($values->text('userid') != '' && $logm->exists($values->text('userid')) === false) {\n\t\t\t$code->setUserid('');\n\t\t\t$invalidfields['userid'] = 'Login ID';\n\t\t}\n\n\t\t$vendors = \\VendorQuery::create();\n\t\t$code->setVendorid($values->string('vendorid'));\n\n\t\tif (boolval($vendors->filterByVendorid($values->string('vendorid'))->count()) === false) {\n\t\t\t$code->setVendorid('');\n\t\t\t$invalidfields['vendorid'] = 'Vendor ID';\n\t\t}\n\t\treturn $invalidfields;\n\t}", "function evalValues()\t{\n\t\t// Check required, set failure if not ok.\n\t\treset($this->requiredArr);\n\t\t$masterTable=$this->conf['blogData']?'tx_metafeedit_comments':$this->theTable;\n\t\t$tempArr=array();\n\t\twhile(list(,$theField)=each($this->requiredArr))\t{\n\t\t\tif (!trim($this->dataArr[$theField]) )\t{\n\t\t\t\tif ($this->conf['TCAN'][$this->theTable]['columns'][$theField]['config']['type']=='group' && $this->conf['TCAN'][$this->theTable]['columns'][$theField]['config']['internal_type']=='file')\t{\n\t\t\t\t\t\n\t\t\t\t\tif (!trim($this->dataArr[$theField.'_file']) )\t{\n\t\t\t\t\t\n\t\t\t\t\t\t$tempArr[]=$theField;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$tempArr[]=$theField;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Evaluate: This evaluates for more advanced things than 'required' does. But it returns the same error code, so you must let the required-message tell, if further evaluation has failed!\n\t\t$recExist=0;\n\t\t$evalValues=$this->conf['blogData']?$this->metafeeditlib->getBlogEvalValues($this->conf):$this->conf[$this->conf['cmdKey'].'.']['evalValues.'];\n\t\tif (is_array($evalValues))\t{\n\t\t\tswitch($this->conf['inputvar.']['cmd'])\t{\n\t\t\t\tcase 'edit':\n\t\t\t\t\tif (isset($this->dataArr['pid']))\t{\t\t\t// This may be tricked if the input has the pid-field set but the edit-field list does NOT allow the pid to be edited. Then the pid may be false.\n\t\t\t\t\t\t$recordTestPid = intval($this->dataArr['pid']);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$tempRecArr = $GLOBALS['TSFE']->sys_page->getRawRecord($masterTable,$this->dataArr[$this->conf['uidField']]);\n\t\t\t\t\t\t$recordTestPid = intval($tempRecArr['pid'])?intval($tempRecArr['pid']):$this->thePid;\n\t\t\t\t\t}\n\t\t\t\t\t$recExist=1;\n\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\t$recordTestPid = $this->thePid ? $this->thePid : t3lib_div::intval_positive($this->dataArr['pid']);\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\treset($evalValues);\n\t\t\twhile(list($theField,$theValue)=each($evalValues))\t{\n\t\t\t\t$listOfCommands = t3lib_div::trimExplode(',',$theValue,1);\n\t\t\t\twhile(list(,$cmd)=each($listOfCommands))\t{\n\t\t\t\t\t$cmdParts = preg_split('/\\[|\\]/',$cmd);\t// Point is to enable parameters after each command enclosed in brackets [..]. These will be in position 1 in the array.\n\t\t\t\t\t$theCmd = trim($cmdParts[0]);\n\t\t\t\t\tswitch($theCmd)\t{\n\t\t\t\t\t\tcase 'uniqueGlobal':\n\t\t\t\t\t\t\t\t$whereef= $GLOBALS['TSFE']->sys_page->enableFields($masterTable);\n\t\t\t\t\t\t\t\tif ($DBrows = $GLOBALS['TSFE']->sys_page->getRecordsByField($masterTable,$theField,$this->dataArr[$theField],$whereef,'','','1'))\t{\n\t\t\t\t\t\t\t\tif (!$recExist || $DBrows[0][$this->conf['uidField']]!=$this->dataArr[$this->conf['uidField']])\t{\t// Only issue an error if the record is not existing (if new...) and if the record with the false value selected was not our self.\n\t\t\t\t\t\t\t\t\t//$tempArr[]=$theField;\n\t\t\t\t\t\t\t\t\t$this->failureMsg[$theField][] = $this->getFailure($theField, $theCmd, $this->metafeeditlib->getLL('error_value_existed',$this->conf));\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'uniqueFields':\n\n\t\t\t\t\t \t\t$i=0;\t\n\t\t\t\t\t\t\tforeach($cmdParts as $cmdP) {\n\t\t\t\t\t\t\t\tif ($i>0 && trim($cmdP)) $Where.= \" and \".$cmdParts[$i].\"='\".$this->dataArr[$cmdParts[$i]].\"'\";\n\t\t\t\t\t\t\t\t$i++;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$whereef= $GLOBALS['TSFE']->sys_page->enableFields($masterTable);\n\t\t\t\t\t\t\tif ($DBrows = $GLOBALS['TSFE']->sys_page->getRecordsByField($masterTable,$theField,$this->dataArr[$theField], 'AND pid IN ('.$recordTestPid.')'.$Where.$whereef,'','','1'))\t{\n\t\t\t\t\t\t\t\tif (!$recExist || $DBrows[0][$this->conf['uidField']]!=$this->dataArr[$this->conf['uidField']])\t{\t// Only issue an error if the record is not existing (if new...) and if the record with the false value selected was not our self.\n\t\t\t\t\t\t\t\t\t//$tempArr[]=$theField;\n\t\t\t\t\t\t\t\t\t$this->failureMsg[$theField][] = $this->getFailure($theField, $theCmd, $this->metafeeditlib->getLL('error_mvalue_existed',$this->conf));\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'uniqueLocal':\n\t\t\t\t\t\tcase 'uniqueInPid':\n\t\t\t\t\t\t\t$whereef= $GLOBALS['TSFE']->sys_page->enableFields($masterTable);\n\t\t\t\t\t\t\tif ($DBrows = $GLOBALS['TSFE']->sys_page->getRecordsByField($masterTable,$theField,$this->dataArr[$theField], 'AND pid IN ('.$recordTestPid.')'.$whereef,'','','1'))\t{\n\t\t\t\t\t\t\tif (!$recExist || $DBrows[0][$this->conf['uidField']]!=$this->dataArr[$this->conf['uidField']])\t{\t// Only issue an error if the record is not existing (if new...) and if the record with the false value selected was not our self.\n\t\t\t\t\t\t\t\t\t$this->failureMsg[$theField][] = $this->getFailure($theField, $theCmd, $this->metafeeditlib->getLL('error_value_existed',$this->conf));\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'twice':\n\t\t\t\t\t\t\tif (strcmp($this->dataArr[$theField], $this->dataArr[$theField.'_again']))\t{\n\t\t\t\t\t\t\t\t$this->failureMsg[$theField][] = $this->getFailure($theField, $theCmd, $this->metafeeditlib->getLL('error_value_twice',$this->conf));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'email':\n\t\t\t\t\t\t\tif (trim($this->dataArr[$theField])) {\n\t\t\t\t\t\t\t\tif (!$this->cObj->checkEmail($this->dataArr[$theField]))\t{\n\t\t\t\t\t\t\t\t\t$this->failureMsg[$theField][] = $this->getFailure($theField, $theCmd, $this->metafeeditlib->getLL('error_valid_email',$this->conf));\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'required':\n\t\t\t\t\t\t\tif (!trim($this->dataArr[$theField]))\t{\n\t\t\t\t\t\t\t\tif ($this->conf['TCAN'][$this->theTable]['columns'][$theField]['config']['type']=='group' && $this->conf['TCAN'][$this->theTable]['columns'][$theField]['config']['internal_type']=='file')\t{\n\t\t\t\t\t\t\t\t\tif (!trim($this->dataArr[$theField.'_file']) )\t{\n\t\t\t\t\t\t\t\t\t\t$tempArr[]=$theField;\n\t\t\t\t\t\t\t\t\t\t$this->failureMsg[$theField][] = $this->getFailure($theField, $theCmd, $this->metafeeditlib->getLL('error_value_required',$this->conf));\n\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t$tempArr[]=$theField;\n\t\t\t\t\t\t\t\t\t$this->failureMsg[$theField][] = $this->getFailure($theField, $theCmd, $this->metafeeditlib->getLL('error_value_required',$this->conf));\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'atLeast':\n\t\t\t\t\t\t\t$chars=intval($cmdParts[1]);\n\t\t\t\t\t\t\tif (strlen($this->dataArr[$theField])<$chars)\t{\n\t\t\t\t\t\t\t\t//$tempArr[]=$theField;\n\t\t\t\t\t\t\t\t$this->failureMsg[$theField][] = sprintf($this->getFailure($theField, $theCmd, $this->metafeeditlib->getLL('error_min_char',$this->conf)), $chars);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'invert':\n\t\t\t\t\t\t\t$this->dataArr[$theField]=$this->dataArr[$theField]?0:1;\t\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'atMost':\n\t\t\t\t\t\t\t$chars=intval($cmdParts[1]);\n\t\t\t\t\t\t\tif (strlen($this->dataArr[$theField])>$chars)\t{\n\t\t\t\t\t\t\t\t//$tempArr[]=$theField;\n\t\t\t\t\t\t\t\t$this->failureMsg[$theField][] = sprintf($this->getFailure($theField, $theCmd, $this->metafeeditlib->getLL('error_max_char',$this->conf)), $chars);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'inBranch':\n\t\t\t\t\t\t\t$pars = explode(';',$cmdParts[1]);\n\t\t\t\t\t\t\tif (intval($pars[0]))\t{\n\t\t\t\t\t\t\t\t$pid_list = $this->cObj->getTreeList(\n\t\t\t\t\t\t\t\t\tintval($pars[0]),\n\t\t\t\t\t\t\t\t\tintval($pars[1]) ? intval($pars[1]) : 999,\n\t\t\t\t\t\t\t\t\tintval($pars[2])\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\tif (!$pid_list || !t3lib_div::inList($pid_list,$this->dataArr[$theField]))\t{\n\t\t\t\t\t\t\t\t\t//$tempArr[]=$theField;\n\t\t\t\t\t\t\t\t\t$this->failureMsg[$theField][] = sprintf($this->getFailure($theField, $theCmd, $this->metafeeditlib->getLL('error_value_notInList',$this->conf)), $pid_list);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'unsetEmpty':\n\t\t\t\t\t\t\tif (!$this->dataArr[$theField])\t{\n\t\t\t\t\t\t\t\t$hash = array_flip($tempArr);\n\t\t\t\t\t\t\t\tunset($hash[$theField]);\n\t\t\t\t\t\t\t\t$tempArr = array_keys($hash);\n\t\t\t\t\t\t\t\tunset($this->failureMsg[$theField]);\n\t\t\t\t\t\t\t\tunset($this->dataArr[$theField]);\t// This should prevent the field from entering the database.\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t//should go in parse values ?\n\t\t\t\t\t\tcase 'wwwURL':\n\t\t\t\t\t\t\t\tif ($this->dataArr[$theField]) {\n\t\t\t\t\t\t\t\t\t\t$wwwURLOptions = array (\n\t\t\t\t\t\t\t\t\t\t'AssumeProtocol' => 'http' ,\n\t\t\t\t\t\t\t\t\t\t\t\t'AllowBracks' => TRUE ,\n\t\t\t\t\t\t\t\t\t\t\t\t'AllowedProtocols' => array(0 => 'http', 1 => 'https', ) ,\n\t\t\t\t\t\t\t\t\t\t\t\t'Require' => array('Protocol' => FALSE , 'User' => FALSE , 'Password' => FALSE , 'Server' => TRUE , 'Resource' => FALSE , 'TLD' => TRUE , 'Port' => FALSE , 'QueryString' => FALSE , 'Anchor' => FALSE , ) ,\n\t\t\t\t\t\t\t\t\t\t\t\t'Forbid' => array('Protocol' => FALSE , 'User' => TRUE , 'Password' => TRUE , 'Server' => FALSE , 'Resource' => FALSE , 'TLD' => FALSE , 'Port' => TRUE , 'QueryString' => FALSE , 'Anchor' => FALSE , ) ,\n\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t$wwwURLResult = tx_metafeedit_srfeuserregister_pi1_urlvalidator::_ValURL($this->dataArr[$theField], $wwwURLOptions);\n\t\t\t\t\t\t\t\t\t\tif ($wwwURLResult['Result'] = 'EW_OK' ) {\n\t\t\t\t\t\t\t\t\t\t\t\t$this->dataArr[$theField] = $wwwURLResult['Value'];\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$this->markerArray['###EVAL_ERROR_FIELD_'.$theField.'###'] = is_array($this->failureMsg[$theField]) ? implode('<br />',$this->failureMsg[$theField]) : '';\n\t\t\t\t//$this->markerArray['###CSS_ERROR_FIELD_'.$theField.'###']=$this->markerArray['###EVAL_ERROR_FIELD_'.$theField.'###']?'tx-metafeedit-form-error ':'';\n\t\t\t\t$this->markerArray['###CSS_ERROR_FIELD_'.$theField.'###']=is_array($this->failureMsg[$theField])?'tx-metafeedit-form-field-error ':'';\n\t\t\t}\n\t\t}\n\t\t//$this->failure=implode(',',$tempArr);\t //$failure will show which fields were not OK\n\t\tif (count($this->failureMsg) >0) {\n\t\t\t$this->failure=1;\n\t\t\tif (count($tempArr)) {\n\t\t\t\tforeach($tempArr as $ta) {\n\t\t\t\t\t$this->markerArray['###CSS_ERROR_FIELD_'.$ta.'###']='tx-metafeedit-form-field-error ';\n\t\t\t\t}\n\t\t\t\t$this->failure=implode(',',$tempArr);\n\t\t\t}\n\t\t\t$this->markerArray['###EVAL_ERROR###'] = $this->metafeeditlib->makeErrorMarker($this->conf,$this->metafeeditlib->getLL('error_occured',$this->conf));\n\t\t} else { \n\t\t\t$this->failure=0;\n\t\t\tif (count($tempArr)) {\n\t\t\t\t$this->failure=implode(',',$tempArr);\n\t\t\t\t$this->markerArray['###EVAL_ERROR###'] = $this->metafeeditlib->makeErrorMarker($this->conf,$this->getFailure('_FORM', '_REQUIRED', $this->metafeeditlib->getLL('error_required',$this->conf))); \n\t\t\t}\n\t\t}\n\t\t\n\t\t// Call to user eval function\n\n\t\t\n\t\tif ($this->conf['userFunc_afterEval']) t3lib_div::callUserFunction($this->conf['userFunc_afterEval'],$this->conf,$this);\n\n\t}", "private function _validate()\r\n {\r\n $data = array();\r\n $data['error_string'] = array();\r\n $data['inputerror'] = array();\r\n $data['status'] = TRUE;\r\n\r\n if($this->input->post('gsm_number') == '')\r\n {\r\n $data['inputerror'][] = 'gsm_number';\r\n $data['error_string'][] = 'Number GSM is required';\r\n $data['status'] = FALSE;\r\n }\r\n\r\n if($this->input->post('gsm_imsi_number') == '')\r\n {\r\n $data['inputerror'][] = 'gsm_imsi_number';\r\n $data['error_string'][] = 'Number IMSI GSM is required';\r\n $data['status'] = FALSE;\r\n }\r\n\r\n if($this->input->post('gsm_iccid_number') == '')\r\n {\r\n $data['inputerror'][] = 'gsm_iccid_number';\r\n $data['error_string'][] = 'Number ICCID GSM is required';\r\n $data['status'] = FALSE;\r\n }\r\n\r\n if($this->input->post('vendor_id') == '')\r\n {\r\n $data['inputerror'][] = 'vendor_id';\r\n $data['error_string'][] = 'Please select Vendor';\r\n $data['status'] = FALSE;\r\n }\r\n\r\n if($this->input->post('gsm_cond_id') == '')\r\n {\r\n $data['inputerror'][] = 'gsm_cond_id';\r\n $data['error_string'][] = 'Please select Condition';\r\n $data['status'] = FALSE;\r\n }\r\n\r\n if($this->input->post('gsm_received_date') == '')\r\n {\r\n $data['inputerror'][] = 'gsm_received_date';\r\n $data['error_string'][] = 'GSM Received Date is required';\r\n $data['status'] = FALSE;\r\n }\r\n\r\n if($this->input->post('gsm_received_by') == '')\r\n {\r\n $data['inputerror'][] = 'gsm_received_by';\r\n $data['error_string'][] = 'GSM Received By is required';\r\n $data['status'] = FALSE;\r\n }\r\n\r\n if($data['status'] === FALSE)\r\n {\r\n echo json_encode($data);\r\n exit();\r\n }\r\n }", "protected function prepareForValidation()\n {\n $this->merge([\n 'nome' => $this->nome,\n 'nascimento' => convertDateToDatabase($this->nascimento),\n 'cpf' => returnOnlyNumbers($this->cpf),\n 'email' => $this->email,\n ]);\n }", "public function actionPayrollindividualvalidation() {\n\t\tif (\\Yii::$app->SessionCheck->isclientLogged () == true) \t\t// checking logged session\n\t\t{\n\t\t\t/**\n\t\t\t * Declaring Session Variables**\n\t\t\t */\n\t\t\t$this->layout = 'main';\n\t\t\t$session = \\Yii::$app->session;\n\t\t\t$logged_user_id = $session ['client_user_id'];\n\t\t\t\n\t\t\t$encrypt_component = new EncryptDecryptComponent ();\n\t\t\t$common_validation_component = new CommonValidationsComponent ();\n\t\t\t$validation_rule_ids = array ();\n\t\t\t$element_ids = array ();\n\t\t\t$arrvalidation_errors = array ();\n\t\t\t$arrvalidations = array ();\n\t\t\t$arrperiodvalidation_errors = array ();\n\t\t\t$get_company_id = \\Yii::$app->request->get ();\n\t\t\t\n\t\t\tif (! empty ( $get_company_id )) {\n\t\t\t\t\n\t\t\t\t/**\n\t\t\t\t * Encrypted company ID*\n\t\t\t\t */\n\t\t\t\t$encrypt_company_id = $get_company_id ['c_id'];\n\t\t\t\t$encrypt_payroll_id = $get_company_id ['payroll_id'];\n\t\t\t\t\n\t\t\t\tif (! empty ( $encrypt_company_id ) && ! empty ( $encrypt_payroll_id )) {\n\t\t\t\t\t$company_id = $encrypt_component->decryptUser ( $encrypt_company_id ); // Decrypted company Id\n\t\t\t\t\t$payroll_id = $encrypt_component->decryptUser ( $encrypt_payroll_id ); // Decrypted payroll Id\n\t\t\t\t\t// die($company_id); \n\t\t\t\t\t// / getting company details\n\t\t\t\t\t$company_details = TblAcaCompanies::find ()->select ( 'company_client_number,company_name' )->where ( 'company_id = :company_id', [ \n\t\t\t\t\t\t\t'company_id' => $company_id \n\t\t\t\t\t] )->one ();\n\t\t\t\t\t\n\t\t\t\t\t// / getting payroll details\n\t\t\t\t\t\n\t\t\t\t\t$payroll_details = TblAcaPayrollData::find ()->where ( [ \n\t\t\t\t\t\t\t'employee_id' => $payroll_id \n\t\t\t\t\t] )->One ();\n\t\t\t\t\t // $payroll_details->scenario = 'validateMedical';\n\t\t\t\t\t \n\t\t\t\t\tif (! empty ( $payroll_details )) {\n\t\t\t\t\t\t\n\t\t\t\t\t\t// check for payroll employee period\n\t\t\t\t\t\t\n\t\t\t\t\t\t$employee_periods = TblAcaPayrollEmploymentPeriod::find ()->where ( [ \n\t\t\t\t\t\t\t\t'employee_id' => $payroll_id \n\t\t\t\t\t\t] )->All ();\n\t\t\t\t\t\t\n\t\t\t\t\t\t/*for($i = 75; $i <= 103; $i ++) {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$validation_rule_ids [] = $i;\n\t\t\t\t\t\t}*/\n\t\t\t\t\t\t\t$validation_rule_ids = [ \n\t\t\t\t\t\t\t'75',\n\t\t\t\t\t\t\t'76',\n\t\t\t\t\t\t\t'77',\n\t\t\t\t\t\t\t'78',\n\t\t\t\t\t\t\t'79',\n\t\t\t\t\t\t\t'80',\n\t\t\t\t\t\t\t'81',\n\t\t\t\t\t\t\t'82',\n\t\t\t\t\t\t\t'83',\n\t\t\t\t\t\t\t'84',\n\t\t\t\t\t\t\t'85',\n\t\t\t\t\t\t\t'86',\n\t\t\t\t\t\t\t'87',\n\t\t\t\t\t\t\t'88',\n\t\t\t\t\t\t\t'89',\n\t\t\t\t\t\t\t'90',\n\t\t\t\t\t\t\t'91',\n\t\t\t\t\t\t\t'92',\n\t\t\t\t\t\t\t'93',\n\t\t\t\t\t\t\t'94',\n\t\t\t\t\t\t\t'95',\n\t\t\t\t\t\t\t'96',\n\t\t\t\t\t\t\t'97',\n\t\t\t\t\t\t\t'98',\n\t\t\t\t\t\t\t'99',\n\t\t\t\t\t\t\t'100',\n\t\t\t\t\t\t\t'101',\n\t\t\t\t\t\t\t'102',\n\t\t\t\t\t\t\t'103',\n\t\t\t\t\t\t\t'146',\n\t\t\t\t\t\t\t'147',\n\t\t\t\t\t\t\t'149',\n\t\t\t\t\t\t\t'150',\n\t\t\t\t\t\t\t'151',\n\t\t\t\t\t\t\t'152'\n\t\t\t\t\t];\n\t\t\t\t\t\tfor($i = 1; $i <= 13; $i ++) {\n\t\t\t\t\t\t\t$element_ids [] = $i;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * *Check for validation errors***\n\t\t\t\t\t\t */\n\t\t\t\t\t\t$validation_results = TblAcaPayrollValidationLog::find ()->select ( 'validation_rule_id, is_validated' )->where ( [ \n\t\t\t\t\t\t\t\t'company_id' => $company_id,\n\t\t\t\t\t\t\t\t'employee_id' => $payroll_id,\n\t\t\t\t\t\t\t\t'validation_rule_id' => $validation_rule_ids,\n\t\t\t\t\t\t\t\t'is_validated' => 0 \n\t\t\t\t\t\t] )->All ();\n\t\t\t\t\t\t\n\t\t\t\t\t\t$validation_period_results = TblAcaPayrollEmploymentPeriodValidationLog::find ()->select ( 'period_id, validation_rule_id, is_validated' )->where ( [ \n\t\t\t\t\t\t\t\t'company_id' => $company_id,\n\t\t\t\t\t\t\t\t'employee_id' => $payroll_id,\n\t\t\t\t\t\t\t\t'validation_rule_id' => $validation_rule_ids,\n\t\t\t\t\t\t\t\t'is_validated' => 0 \n\t\t\t\t\t\t] )->All ();\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (! empty ( $validation_results ) || ! empty ( $validation_period_results )) {\n\t\t\t\t\t\t\tif (! empty ( $validation_results )) {\n\t\t\t\t\t\t\t\tforeach ( $validation_results as $validations ) {\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t$arrvalidations [] = $validations->validation_rule_id;\n\t\t\t\t\t\t\t\t\t$arrvalidation_errors [$validations->validation_rule_id] ['error_message'] = $validations->validationRule->error_message;\n\t\t\t\t\t\t\t\t\t$arrvalidation_errors [$validations->validation_rule_id] ['error_code'] = $validations->validationRule->error_code;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif (! empty ( $validation_period_results )) {\n\t\t\t\t\t\t\t\tforeach ( $validation_period_results as $period_validations ) {\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t$arrperiodvalidation_errors [$period_validations->period_id] [$period_validations->validation_rule_id] ['error_message'] = $period_validations->validationRule->error_message;\n\t\t\t\t\t\t\t\t\t$arrperiodvalidation_errors [$period_validations->period_id] [$period_validations->validation_rule_id] ['error_code'] = $period_validations->validationRule->error_code;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$plan_classes = TblAcaPlanCoverageType::find ()->select ( 'plan_class_id, plan_class_number' )->where ( [ \n\t\t\t\t\t\t\t\t\t'company_id' => $company_id \n\t\t\t\t\t\t\t] )->all ();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t/**\n\t\t\t\t\t\t\t * Get all errors for general info *\n\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\t$get_post_validation_errors = TblAcaValidationRules::find ()->select ( 'rule_id, error_code, error_message' )->where ( [ \n\t\t\t\t\t\t\t\t\t'rule_id' => $validation_rule_ids \n\t\t\t\t\t\t\t] )->All ();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif (! empty ( $get_post_validation_errors )) {\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tforeach ( $get_post_validation_errors as $errors ) {\n\t\t\t\t\t\t\t\t\t$post_validation_errors [$errors->rule_id] ['error_message'] = $errors->error_message;\n\t\t\t\t\t\t\t\t\t$post_validation_errors [$errors->rule_id] ['error_code'] = $errors->error_code;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$employee_post_details = \\Yii::$app->request->post ();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif (! empty ( $employee_post_details )) {\n\t\t\t\t\t\t\t\t// begin transaction\n\t\t\t\t\t\t\t\t$transaction = \\Yii::$app->db->beginTransaction ();\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t$payroll_details->attributes = $employee_post_details ['TblAcaPayrollData'];\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tif(!empty($employee_post_details ['TblAcaPayrollData']['ssn']))\n\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$payroll_details->ssn = preg_replace ( '/[^0-9\\']/', '', $employee_post_details ['TblAcaPayrollData']['ssn'] ); \n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t// checking for duplicate SSN\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t$duplicate_ssn = TblAcaPayrollData::find ()->select ( 'ssn' )->where ('ssn='.$payroll_details->ssn )->andWhere ( 'employee_id <> ' . $payroll_id )->andWhere ( 'company_id='.$company_id )->All ();\n\t\t\t\t\t\t\t\t\t\tif(!empty($duplicate_ssn)){\n\t\t\t\t\t\t\t\t\t\t\tthrow new \\Exception ( 'SSN already exists' );\n\t\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}\n\t\t\t\t\t\t\t\t\t$payroll_details->state = strtoupper($employee_post_details ['TblAcaPayrollData']['state']);\n\t\t\t\t\t\t\t\t\tif ($payroll_details->save () && $payroll_details->validate ()) {\n\t\t\t\t\t\t\t\t\t\tif (! empty ( $employee_post_details ['TblAcaPayrollEmploymentPeriod'] )) {\n\t\t\t\t\t\t\t\t\t\t\t$period_details = $employee_post_details ['TblAcaPayrollEmploymentPeriod'];\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tforeach ( $period_details as $key => $details ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t$hire_date = '';\n\t\t\t\t\t\t\t\t\t\t\t\t$termination_date = '';\n\t\t\t\t\t\t\t\t\t\t\t\t$plan_class = '';\n\t\t\t\t\t\t\t\t\t\t\t\t$status = '';\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\tif (! empty ( $details ['hire_date'] )) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t$hire_date = $details ['hire_date'];\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\tif (! empty ( $details ['termination_date'] )) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t$termination_date = $details ['termination_date'];\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\tif (! empty ( $details ['plan_class'] )) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t$plan_class = $details ['plan_class'];\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\tif (! empty ( $details ['status'] )) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t$status = $details ['status'];\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t$encrypted_period_id = $key;\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t$decrypted_period_id = $encrypt_component->decryptUser ( $encrypted_period_id );\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t$individual_period_details = TblAcaPayrollEmploymentPeriod::find ()->where ( [ \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'period_id' => $decrypted_period_id \n\t\t\t\t\t\t\t\t\t\t\t\t] )->One ();\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\tif (! empty ( $individual_period_details )) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t$individual_period_details->hire_date = $details ['hire_date'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t$individual_period_details->termination_date = $details ['termination_date'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t$individual_period_details->plan_class = $details ['plan_class'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t$individual_period_details->status = $details ['status'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\tif ($individual_period_details->save () && $individual_period_details->validate ()) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$period_result ['success'] = 'success';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$arrerrors = $individual_period_details->getFirstErrors ();\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$errorstring = '';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t/**\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t * *****Converting error into string*******\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tforeach ( $arrerrors as $key => $value ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$errorstring .= $value . '<br>';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tthrow new \\Exception ( $errorstring );\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\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\n\t\t\t\t\t\t\t\t\t\t// validate general plan info\n\t\t\t\t\t\t\t\t\t\t$validate_results = $common_validation_component->ValidatePayroll ( $company_id, $payroll_id, $element_ids );\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\tif (! empty ( $validate_results ['error'] )) {\n\t\t\t\t\t\t\t\t\t\t\tthrow new \\Exception ( $validate_results ['error'] );\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t$validation_success = $validate_results ['success'];\n\t\t\t\t\t\t\t\t\t\t\t$validation_period_success = $validate_results ['period_success'];\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tif (empty ( $validation_success ) && empty ( $validation_period_success )) {\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\tTblAcaPayrollValidationLog::deleteAll ( 'company_id = :company_id AND employee_id = :employee_id', [ \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t':company_id' => $company_id,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t':employee_id' => $payroll_id \n\t\t\t\t\t\t\t\t\t\t\t\t] );\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\tTblAcaPayrollEmploymentPeriodValidationLog::deleteAll ( 'company_id = :company_id AND employee_id = :employee_id', [ \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t':company_id' => $company_id,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t':employee_id' => $payroll_id \n\t\t\t\t\t\t\t\t\t\t\t\t] );\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t$model_company_validation_log =TblAcaCompanyValidationStatus::find()->where(['company_id'=>$company_id])->one();\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\tif(!empty($model_company_validation_log))\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t$model_company_validation_log->created_by = $logged_user_id;\n\t\t\t\t\t\t\t\t\t\t\t\t\t$model_company_validation_log->modified_by = $logged_user_id;\n\t\t\t\t\t\t\t\t\t\t\t\t\t$model_company_validation_log->payroll_info_date = date('Y-m-d H:i:s');\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t$model_company_validation_log->save();\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t$transaction->commit (); // commit the transaction\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\\Yii::$app->session->setFlash ( 'success', 'Value updated successfully' );\n\t\t\t\t\t\t\t\t\t\t\t\treturn $this->redirect ( array (\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'/client/validateforms/payrollvalidation?c_id=' . $encrypt_company_id \n\t\t\t\t\t\t\t\t\t\t\t\t) );\n\t\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t\t$arrperiodvalidation_errors = array ();\n\t\t\t\t\t\t\t\t\t\t\t\t$arrvalidation_errors = array ();\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\tif (! empty ( $validation_success )) {\n\t\t\t\t\t\t\t\t\t\t\t\t\tforeach ( $validation_success as $key => $value ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif ($value == 0) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$arrvalidation_errors [$key] ['error_message'] = $post_validation_errors [$key] ['error_message'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$arrvalidation_errors [$key] ['error_code'] = $post_validation_errors [$key] ['error_code'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\tif (! empty ( $validation_period_success )) {\n\t\t\t\t\t\t\t\t\t\t\t\t\tforeach ( $validation_period_success as $key => $validations ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tforeach ( $validations as $validation_rule_id => $is_validated ) {\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\t\t\t\t\t\t\tif ($is_validated == 0) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$arrperiodvalidation_errors [$key] [$validation_rule_id] ['error_message'] = $post_validation_errors [$validation_rule_id] ['error_message'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$arrperiodvalidation_errors [$key] [$validation_rule_id] ['error_code'] = $post_validation_errors [$validation_rule_id] ['error_code'];\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\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t// check for payroll employee period\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t$employee_periods = TblAcaPayrollEmploymentPeriod::find ()->where ( [ \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'employee_id' => $payroll_id \n\t\t\t\t\t\t\t\t\t\t\t\t] )->All ();\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t//$transaction->rollBack ();\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t$arrerrors = $payroll_details->getFirstErrors ();\n\t\t\t\t\t\t\t\t\t\t$errorstring = '';\n\t\t\t\t\t\t\t\t\t\t/**\n\t\t\t\t\t\t\t\t\t\t * *****Converting error into string*******\n\t\t\t\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\t\t\t\tforeach ( $arrerrors as $key => $value ) {\n\t\t\t\t\t\t\t\t\t\t\t$errorstring .= $value . '<br>';\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\tthrow new \\Exception ( $errorstring );\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} catch ( \\Exception $e ) {\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t$msg = $e->getMessage ();\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t//print_r($e);die();\n\t\t\t\t\t\t\t\t\t\\Yii::$app->session->setFlash ( 'error', $msg );\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t// rollback transaction\n\t\t\t\t\t\t\t\t\t$transaction->rollback ();\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\treturn $this->redirect ( array (\n\t\t\t\t\t\t\t\t\t\t\t'/client/validateforms/payrollindividualvalidation?c_id=' . $encrypt_company_id . '&payroll_id=' . $encrypt_payroll_id \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\t\n\t\t\t\t\t\t\treturn $this->render ( 'payrollindividualvalidation', array (\n\t\t\t\t\t\t\t\t\t'company_detals' => $company_details,\n\t\t\t\t\t\t\t\t\t'payroll_details' => $payroll_details,\n\t\t\t\t\t\t\t\t\t'encrypt_company_id' => $encrypt_company_id,\n\t\t\t\t\t\t\t\t\t'arrvalidations' => $arrvalidations,\n\t\t\t\t\t\t\t\t\t'arrvalidation_errors' => $arrvalidation_errors,\n\t\t\t\t\t\t\t\t\t'employee_periods' => $employee_periods,\n\t\t\t\t\t\t\t\t\t'arrperiodvalidation_errors' => $arrperiodvalidation_errors,\n\t\t\t\t\t\t\t\t\t'plan_classes' => $plan_classes,\n\t\t\t\t\t\t\t\t\t'encoded_company_id' => $encrypt_company_id,\n\t\t\t\t\t\t\t\t\t'encrypt_payroll_id' => $encrypt_payroll_id \n\t\t\t\t\t\t\t) );\n\t\t\t\t\t\t}else\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\\Yii::$app->session->setFlash ( 'success', 'No issues in the employee.' );\n\t\t\t\t\t\t\treturn $this->redirect ( array (\n\t\t\t\t\t\t\t'/client/validateforms?c_id='.$encrypt_company_id \n\t\t\t\t\t\t\t\t) );\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\treturn $this->redirect ( array (\n\t\t\t\t\t\t\t'/client/companies' \n\t\t\t\t\t) );\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t\\Yii::$app->SessionCheck->clientlogout (); // client logout\n\t\t\t\n\t\t\treturn $this->goHome ();\n\t\t}\n\t}", "public function checkData() {\n\t\t// e.g. numbers must only have digits, e-mail addresses must have a \"@\" and a \".\".\n\t\treturn $this->control->checkPOST($this);\n\t}", "public function checkData() {\n\t\t// e.g. numbers must only have digits, e-mail addresses must have a \"@\" and a \".\".\n\t\treturn $this->control->checkPOST($this);\n\t}", "private function validate(){\n\t\t$row = $this->row;\n\t\t$col = $this->col;\n\t\tfor($i=0;$i<$row;$i++)\n\t\t\tfor($j=0;$j<$col;$j++)\n\t\t\t$this->sanitzeRow($i,$j);\n\n\t\tfor($i=0;$i<$row;$i++)\n\t\t\tfor($j=0;$j<$col;$j++)\n\t\t\t$this->sanitzeCol($i,$j);\n\n\t}", "function SetUpDetailParms() {\n\n\t\t// Get the keys for master table\n\t\tif (isset($_GET[EW_TABLE_SHOW_DETAIL])) {\n\t\t\t$sDetailTblVar = $_GET[EW_TABLE_SHOW_DETAIL];\n\t\t\t$this->setCurrentDetailTable($sDetailTblVar);\n\t\t} else {\n\t\t\t$sDetailTblVar = $this->getCurrentDetailTable();\n\t\t}\n\t\tif ($sDetailTblVar <> \"\") {\n\t\t\t$DetailTblVar = explode(\",\", $sDetailTblVar);\n\t\t\tif (in_array(\"a_purchases\", $DetailTblVar)) {\n\t\t\t\tif (!isset($GLOBALS[\"a_purchases_grid\"]))\n\t\t\t\t\t$GLOBALS[\"a_purchases_grid\"] = new ca_purchases_grid;\n\t\t\t\tif ($GLOBALS[\"a_purchases_grid\"]->DetailEdit) {\n\t\t\t\t\t$GLOBALS[\"a_purchases_grid\"]->CurrentMode = \"edit\";\n\t\t\t\t\t$GLOBALS[\"a_purchases_grid\"]->CurrentAction = \"gridedit\";\n\n\t\t\t\t\t// Save current master table to detail table\n\t\t\t\t\t$GLOBALS[\"a_purchases_grid\"]->setCurrentMasterTable($this->TableVar);\n\t\t\t\t\t$GLOBALS[\"a_purchases_grid\"]->setStartRecordNumber(1);\n\t\t\t\t\t$GLOBALS[\"a_purchases_grid\"]->Supplier_ID->FldIsDetailKey = TRUE;\n\t\t\t\t\t$GLOBALS[\"a_purchases_grid\"]->Supplier_ID->CurrentValue = $this->Supplier_Number->CurrentValue;\n\t\t\t\t\t$GLOBALS[\"a_purchases_grid\"]->Supplier_ID->setSessionValue($GLOBALS[\"a_purchases_grid\"]->Supplier_ID->CurrentValue);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (in_array(\"a_stock_items\", $DetailTblVar)) {\n\t\t\t\tif (!isset($GLOBALS[\"a_stock_items_grid\"]))\n\t\t\t\t\t$GLOBALS[\"a_stock_items_grid\"] = new ca_stock_items_grid;\n\t\t\t\tif ($GLOBALS[\"a_stock_items_grid\"]->DetailEdit) {\n\t\t\t\t\t$GLOBALS[\"a_stock_items_grid\"]->CurrentMode = \"edit\";\n\t\t\t\t\t$GLOBALS[\"a_stock_items_grid\"]->CurrentAction = \"gridedit\";\n\n\t\t\t\t\t// Save current master table to detail table\n\t\t\t\t\t$GLOBALS[\"a_stock_items_grid\"]->setCurrentMasterTable($this->TableVar);\n\t\t\t\t\t$GLOBALS[\"a_stock_items_grid\"]->setStartRecordNumber(1);\n\t\t\t\t\t$GLOBALS[\"a_stock_items_grid\"]->Supplier_Number->FldIsDetailKey = TRUE;\n\t\t\t\t\t$GLOBALS[\"a_stock_items_grid\"]->Supplier_Number->CurrentValue = $this->Supplier_Number->CurrentValue;\n\t\t\t\t\t$GLOBALS[\"a_stock_items_grid\"]->Supplier_Number->setSessionValue($GLOBALS[\"a_stock_items_grid\"]->Supplier_Number->CurrentValue);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "function admin_validate_data_ajax(){\n\t\t$this->layout = \"\";\n\t\t$this->autoRender = false;\n\t\tif($this->RequestHandler->isAjax()){\n\t\t\t$errors_msg = null;\n\t\t\t$data = $this->data;\n\t\t\tif(isset($this->data['Vendor']['id'])){\n\t\t\t\t$data['Vendor']['id'] = DECRYPT_DATA($data['Vendor']['id']);\n\t\t\t}\n\t\t\t\n\t\t\t$errors = $this->Vendor->validate_data($data);\n\t\t\t\n\t\t\tif ( is_array ($this->data) ){\n\t\t\t\tforeach ($this->data['Vendor'] as $key => $value ){\n\t\t\t\t\tif( array_key_exists ( $key, $errors) ){\n\t\t\t\t\t\tforeach ( $errors [ $key ] as $k => $v ){\n\t\t\t\t\t\t\t$errors_msg .= \"error|$key|$v\";\n\t\t\t\t\t\t}\t\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t$errors_msg .= \"ok|$key\\n\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t \n\t\t\t}\n\t\t\techo $errors_msg;die();\n\t\t}\t\n\t}", "protected function _clean()\r\n\t{\r\n\t\t$this->taintValue = null;\r\n\t\t$this->normalizedValue = null;\r\n\t\r\n\t\t$this->parameterInfo = null;\r\n\t\t$this->bFetched = false;\r\n\t\t\r\n\t\t$this->validationInfo = null;\r\n\t\t$this->isValid = false;\r\n\t}", "public function prepareDetailTransactionData() \n {\n $header = array_flip(array_shift($this->data));\n $headerKeys = array_keys($header);\n $count = 0;\n foreach ($this->data as $data) {\n foreach ($data as $key => $value) {\n $value = trim($value);\n if (in_array($headerKeys[$key], $this->ignoredHeaders)) continue;\n if (empty($headerKeys[$key])) continue;\n\n $parent = strstr($headerKeys[$key], '-', true);\n $child = preg_replace('/-/', '', strstr($headerKeys[$key], '-'), 1);\n \n if ($parent == \"Transaction\") { \n $this->elementData[$count][$child] = $value;\n } else {\n $this->elementData[$count][$parent][$child] = $value;\n }\n }\n\n $this->checkRequiredFields($count, $this->elementData[$count]);\n $count++;\n }\n\n $this->checkRefDuplication();\n return $count;\n }", "protected function postValidation()\n {\n if (Tools::isSubmit('btnSubmit')) {\n if (!Tools::getValue('SEND_SMS_API')) {\n $this->postErrors[] = $this->l('API Key is required.');\n }\n if (Tools::getValue('SEND_SMS_API')) {\n $isapiKey = $this->isValidAPIKey(Tools::getValue('SEND_SMS_API'));\n if ($isapiKey->status != 'success') {\n $this->postErrors[] = $this->l('API Key is not valid.');\n }\n }\n if (!Tools::getValue('ADMIN_MOBILE')) {\n $this->postErrors[] = $this->l('Admin Mobile Number is required.');\n }\n if (Tools::getValue('ADMIN_MOBILE')) {\n $isvalid = preg_match('/^[0-9]*$/', Tools::getValue('ADMIN_MOBILE'));\n if ($isvalid == false) {\n $this->postErrors[] = $this->l('Admin Mobile Number is not valid.');\n }\n }\n }\n }", "public function validateAmendmentSubmission($postValues, $groupId, $userGroup) {\r\n $emptyColumn = array();\r\n if (!empty($postValues['newrenewal']) && $postValues['newrenewal'] != 0) {\r\n \r\n } else {\r\n $emptyColumn[] = 'NewRenewal';\r\n }\r\n $productlineVal = '';\r\n $editSubObj = new EditSubmissionDetails();\r\n if (!empty($groupId) && $userGroup == 'master') {\r\n if (isset($postValues['editunderwriter']) && !empty($postValues['editunderwriter']) && $postValues['editunderwriter'] != 0) {\r\n $underwriter = $postValues['editunderwriter'];\r\n } else {\r\n $emptyColumn[] = 'Underwriter';\r\n }\r\n if (isset($postValues['productline_master']) && !empty($postValues['productline_master'])) {\r\n $productlineVal = $editSubObj->getLobName($postValues['productline_master']);\r\n $productline = trim($productlineVal[0]['LOBName']);\r\n } else {\r\n $emptyColumn[] = 'Product line';\r\n }\r\n if (isset($postValues['editproductlinesubtype_master']) && !empty($postValues['editproductlinesubtype_master']) && $postValues['editproductlinesubtype_master'] != 0) {\r\n $productlinesubtype = $postValues['editproductlinesubtype_master'];\r\n } else {\r\n $emptyColumn[] = 'product line subtype';\r\n }\r\n if (isset($postValues['editsection_master']) && !empty($postValues['editsection_master']) && $postValues['editsection_master'] != 0) {\r\n $section = $postValues['editsection_master'];\r\n } else {\r\n $emptyColumn[] = 'Section';\r\n }\r\n if (isset($postValues['editprofitcode_master']) && !empty($postValues['editprofitcode_master']) && $postValues['editprofitcode_master'] != 0) {\r\n $profitcode = $postValues['editprofitcode_master'];\r\n } else {\r\n $emptyColumn[] = 'Profitcode';\r\n }\r\n if (isset($postValues['editprimarystatus']) && !empty($postValues['editprimarystatus']) && $postValues['editprimarystatus'] != 0) {\r\n $primary_status = $postValues['editprimarystatus'];\r\n } else {\r\n $emptyColumn[] = 'Primary status';\r\n }\r\n } else {\r\n if (isset($postValues['editunderwriter']) && !empty($postValues['editunderwriter']) && $postValues['editunderwriter'] != 0) {\r\n $underwriter = $postValues['editunderwriter'];\r\n } else {\r\n $emptyColumn[] = 'Underwriter';\r\n }\r\n\r\n if (isset($postValues['editproductline']) && !empty($postValues['editproductline'])) {\r\n $productline = $postValues['editproductline'];\r\n } else {\r\n $emptyColumn[] = 'Product line';\r\n }\r\n if (isset($postValues['editproductlinesubtype']) && !empty($postValues['editproductlinesubtype']) && $postValues['editproductlinesubtype'] != 0) {\r\n $productlinesubtype = $postValues['editproductlinesubtype'];\r\n } else {\r\n $emptyColumn[] = 'product line subtype';\r\n }\r\n if (isset($postValues['editsection']) && !empty($postValues['editsection']) && $postValues['editsection'] != 0) {\r\n $section = $postValues['editsection'];\r\n } else {\r\n $emptyColumn[] = 'Section';\r\n }\r\n\r\n if (isset($postValues['editprofitcode']) && !empty($postValues['editprofitcode']) && $postValues['editprofitcode'] != 0) {\r\n $profitcode = $postValues['editprofitcode'];\r\n } else {\r\n $emptyColumn[] = 'Profitcode';\r\n }\r\n if (isset($postValues['editprimarystatus']) && !empty($postValues['editprimarystatus']) && $postValues['editprimarystatus'] != 0) {\r\n $primary_status = $postValues['editprimarystatus'];\r\n } else {\r\n $emptyColumn[] = 'Primary status';\r\n }\r\n }\r\n if (isset($postValues['effectiveDate']) && !empty($postValues['effectiveDate'])) {\r\n \r\n } else {\r\n $emptyColumn[] = 'Effective date';\r\n }\r\n if (!empty($primary_status) && $primary_status == '15') {\r\n if (isset($postValues['expityDate']) && !empty($postValues['expityDate'])) {\r\n \r\n } else {\r\n $emptyColumn[] = 'Expiry date';\r\n }\r\n }\r\n if (isset($postValues['editcurrency']) && !empty($postValues['editcurrency']) && $postValues['editcurrency'] != 0) {\r\n \r\n } else {\r\n $emptyColumn[] = 'Currency';\r\n }\r\n if (isset($postValues['editexchangeRate']) && !empty($postValues['editexchangeRate'])) {\r\n \r\n } else {\r\n $emptyColumn[] = 'Exchange Rate';\r\n }\r\n if (isset($postValues['editexchangeRateDate']) && !empty($postValues['editexchangeRateDate'])) {\r\n \r\n } else {\r\n $emptyColumn[] = 'Exchange Rate Date';\r\n }\r\n if (isset($postValues['editinsuredname']) && !empty($postValues['editinsuredname'])) {\r\n \r\n } else {\r\n $emptyColumn[] = 'Insured Name';\r\n }\r\n if (isset($postValues['insured_name_status']) && $postValues['insured_name_status'] == 'Y') {\r\n if (!empty($postValues['dbaName'])) {\r\n \r\n } else {\r\n $emptyColumn[] = 'DBA Name';\r\n }\r\n }\r\n if (isset($postValues['editinsuredContactPerson']) && !empty($postValues['editinsuredContactPerson'])) {\r\n \r\n } else {\r\n $emptyColumn[] = 'Insured Contact Person';\r\n }\r\n\r\n if (isset($postValues['insured_country']) && !empty($postValues['insured_country'])) {\r\n \r\n } else {\r\n $emptyColumn[] = 'Insured Country';\r\n }\r\n\r\n if (isset($postValues['db_number']) && !empty($postValues['db_number'])) {\r\n \r\n } else {\r\n $emptyColumn[] = 'D&B Number';\r\n }\r\n\r\n if (isset($postValues['insured_state']) && !empty($postValues['insured_state'])) {\r\n \r\n } else {\r\n $emptyColumn[] = 'Insured State';\r\n }\r\n\r\n if (isset($postValues['editcabcompanies']) && !empty($postValues['editcabcompanies'])) {\r\n \r\n } else {\r\n $emptyColumn[] = 'Cab Companies';\r\n }\r\n\r\n if (isset($postValues['insured_city']) && !empty($postValues['insured_city'])) {\r\n \r\n } else {\r\n $emptyColumn[] = 'Insured city';\r\n }\r\n\r\n if (isset($postValues['brokerCode']) && !empty($postValues['brokerCode'])) {\r\n \r\n } else {\r\n $emptyColumn[] = 'Broker Name';\r\n }\r\n if (isset($postValues['wholesaler_retailer']) && !empty($postValues['wholesaler_retailer'])) {\r\n if ($postValues['wholesaler_retailer'] == 'Wholesaler') {\r\n if (!empty($postValues['retailBrokerName'])) {\r\n \r\n } else {\r\n $emptyColumn[] = 'Retail broker name';\r\n }\r\n if (!empty($postValues['retailbrokerCountryCode'])) {\r\n \r\n } else {\r\n $emptyColumn[] = 'Retail country code';\r\n }\r\n if (!empty($postValues['retailbrokerStateCode'])) {\r\n \r\n } else {\r\n $emptyColumn[] = 'Retail state code';\r\n }\r\n if (!empty($postValues['retailbrokerCityCode'])) {\r\n \r\n } else {\r\n $emptyColumn[] = 'Retail city code';\r\n }\r\n }\r\n } else {\r\n $emptyColumn[] = 'Wholesaler or Retailer';\r\n }\r\n if (isset($postValues['brokerCountryCode']) && !empty($postValues['brokerCountryCode']) && $postValues['brokerCountryCode'] != 0) {\r\n \r\n } else {\r\n $emptyColumn[] = 'Broker Country';\r\n }\r\n if (isset($postValues['brokerStateCode']) && !empty($postValues['brokerStateCode']) && $postValues['brokerStateCode'] != 0) {\r\n \r\n } else {\r\n $emptyColumn[] = 'State code';\r\n }\r\n if (isset($postValues['brokerCityCode']) && !empty($postValues['brokerCityCode']) && $postValues['brokerCityCode'] != 0) {\r\n \r\n } else {\r\n $emptyColumn[] = 'City code';\r\n }\r\n if (isset($postValues['broker_contact_person']) && !empty($postValues['broker_contact_person'])) {\r\n \r\n } else {\r\n $emptyColumn[] = 'Broker contact person';\r\n }\r\n if (isset($postValues['broker_code']) && !empty($postValues['broker_code'])) {\r\n \r\n } else {\r\n $emptyColumn[] = 'Generated Broker Code';\r\n }\r\n if (isset($postValues['processdate']) && !empty($postValues['processdate'])) {\r\n \r\n } else {\r\n $emptyColumn[] = 'Process Date';\r\n }\r\n if (isset($postValues['premiumType']) && !empty($postValues['premiumType'])) {\r\n \r\n } else {\r\n $emptyColumn[] = 'Premium Type';\r\n }\r\n if (isset($postValues['gross_premium_text']) && !empty($postValues['gross_premium_text'])) {\r\n \r\n } else if (isset($postValues['gross_premium_select']) && !empty($postValues['gross_premium_select'])) {\r\n \r\n } else {\r\n $emptyColumn[] = 'Gross Premium';\r\n }\r\n\r\n if (isset($postValues['limit_text']) && !empty($postValues['limit_text'])) {\r\n \r\n } else if (isset($postValues['limit_select']) && !empty($postValues['limit_select'])) {\r\n \r\n } else {\r\n $emptyColumn[] = 'Limit in Local Currency';\r\n }\r\n if (!empty($productline) && ($productline == 'Exec & Prof' || $productline == 'Healthcare')) {\r\n if (isset($postValues['editLayerLimitLocalCurrency']) && !empty($postValues['editLayerLimitLocalCurrency'])) {\r\n \r\n } else {\r\n $emptyColumn[] = 'Layer of limit in Local Currency';\r\n }\r\n\r\n if (isset($postValues['editselfRetrntionLocalCurrency']) && !empty($postValues['editselfRetrntionLocalCurrency'])) {\r\n \r\n } else {\r\n $emptyColumn[] = 'Self Retention in Local currency';\r\n }\r\n }\r\n if (!empty($productline) && ($productline == 'Exec & Prof')) {\r\n if (isset($postValues['editPrecentageLayer']) && !empty($postValues['editPrecentageLayer'])) {\r\n \r\n } else {\r\n $emptyColumn[] = '% of layer';\r\n }\r\n }\r\n if (isset($postValues['attachment_point_text']) && !empty($postValues['attachment_point_text'])) {\r\n \r\n } else if (isset($postValues['attachment_point_select']) && !empty($postValues['attachment_point_select'])) {\r\n \r\n } else {\r\n $emptyColumn[] = 'Attachment point in Local Currency';\r\n }\r\n\r\n if (isset($postValues['editpolicyCommision']) && !empty($postValues['editpolicyCommision'])) {\r\n \r\n } else {\r\n $emptyColumn[] = 'Policy Commission';\r\n }\r\n// if (isset($postValues['editPermiumLocalCurency']) && !empty($postValues['editPermiumLocalCurency'])) {\r\n// \r\n// } else {\r\n// $emptyColumn[] = 'Net Premium in Local currency';\r\n// }\r\n if (isset($postValues['editrenewable']) && !empty($postValues['editrenewable'])) {\r\n \r\n } else {\r\n $emptyColumn[] = 'Renewable';\r\n }\r\n if (isset($postValues['editdateofrenewal']) && !empty($postValues['editdateofrenewal'])) {\r\n \r\n } else {\r\n $emptyColumn[] = 'Date of Renewal';\r\n }\r\n// if (!empty($productline) && ($productline == 'Casualty')) {\r\n// if (isset($postValues['editpolicyName']) && !empty($postValues['editpolicyName'])) {\r\n// \r\n// } else {\r\n// $emptyColumn[] = 'Policy Name';\r\n// }\r\n// }\r\n if (isset($postValues['editdirectAssumed']) && !empty($postValues['editdirectAssumed'])) {\r\n \r\n } else {\r\n $emptyColumn[] = 'Direct/Assumed';\r\n }\r\n if (isset($postValues['editadmitted']) && !empty($postValues['editadmitted'])) {\r\n \r\n } else {\r\n $emptyColumn[] = 'Admitted/Not-admitted';\r\n }\r\n if (isset($postValues['editcompanyPaper']) && !empty($postValues['editcompanyPaper'])) {\r\n \r\n } else {\r\n $emptyColumn[] = 'Company paper';\r\n }\r\n if (isset($postValues['editcompanyPaperNumber']) && !empty($postValues['editcompanyPaperNumber'])) {\r\n \r\n } else {\r\n $emptyColumn[] = 'Company paper number';\r\n }\r\n if (isset($postValues['editpolicyNumber']) && !empty($postValues['editpolicyNumber'])) {\r\n \r\n } else {\r\n $emptyColumn[] = 'Policy number';\r\n }\r\n// echo \"<pre>\";\r\n// print_r($postValues);exit;\r\n if (isset($postValues['editcoverage']) && !empty($postValues['editcoverage'])) {\r\n \r\n } else {\r\n $emptyColumn[] = 'Coverage';\r\n }\r\n if (isset($postValues['editsuffix']) && !empty($postValues['editsuffix'])) {\r\n \r\n } else {\r\n $emptyColumn[] = 'Suffix';\r\n }\r\n if (isset($postValues['edittransactionNumber']) && !empty($postValues['edittransactionNumber'])) {\r\n \r\n } else {\r\n $emptyColumn[] = 'Transaction Number';\r\n }\r\n if (isset($postValues['editnaicCode']) && !empty($postValues['editnaicCode'])) {\r\n \r\n } else {\r\n $emptyColumn[] = 'NAIC Code';\r\n }\r\n if (isset($postValues['editnaicTitle']) && !empty($postValues['editnaicTitle'])) {\r\n \r\n } else {\r\n $emptyColumn[] = 'NAIC Title';\r\n }\r\n if (isset($postValues['editsicCode']) && !empty($postValues['editsicCode'])) {\r\n \r\n } else {\r\n $emptyColumn[] = 'SIC Code';\r\n }\r\n if (isset($postValues['editsicTitle']) && !empty($postValues['editsicTitle'])) {\r\n \r\n } else {\r\n $emptyColumn[] = 'SIC Title';\r\n }\r\n if (isset($postValues['editofrcReport']) && !empty($postValues['editofrcReport'])) {\r\n \r\n } else {\r\n $emptyColumn[] = 'OFRC Report';\r\n }\r\n if (isset($postValues['yesBroker']) && $postValues['yesBroker'] == 'N') {\r\n if (isset($postValues['received_date_by_berkshire']) && !empty($postValues['received_date_by_berkshire'])) {\r\n \r\n } else {\r\n $emptyColumn[] = 'byBerkSi';\r\n }\r\n }\r\n if (isset($postValues['yesIndia']) && $postValues['yesIndia'] == 'N') {\r\n if (isset($postValues['received_date_by_india']) && !empty($postValues['received_date_by_india'])) {\r\n \r\n } else {\r\n $emptyColumn[] = 'byIndia';\r\n }\r\n }\r\n if (isset($postValues['branch_office']) && !empty($postValues['branch_office']) && $postValues['branch_office'] != 0) {\r\n \r\n } else {\r\n $emptyColumn[] = 'and Branch office';\r\n }\r\n return $emptyColumn;\r\n }", "function _prepare_validation()\n\t{\n\t\t$this->load->library('form_validation');\t\n\t\t$this->form_validation->set_error_delimiters('<div class=\"error\">', '</div>');\n\t\t//Setting Validation Rule\t\t\t\t\n\t\t//$this->form_validation->set_rules('txt_code','Code','trim|required|max_length[200]|xss_clean|callback_check_code');\t\t\n\t\t$this->form_validation->set_rules('member_id','Memebr','trim|required|xss_clean');\n\t\t$this->form_validation->set_rules('cbo_savings_code','Savings code','trim|required|xss_clean');\t\t\n\t\t$this->form_validation->set_rules('cbo_payment_type','Payment Type','trim|required|xss_clean');\n\t\t$this->form_validation->set_rules('txt_transaction_date','Transaction Date','trim|max_length[10]|xss_clean|required|callback_check_transaction_date');\t\t\n\t\t$this->form_validation->set_rules('txt_amount','Amount','trim|numeric|xss_clean|required');\n\t}", "public function validateReport($data)\n {\n self::$rules = [\n 'employee' => 'required',\n 'startDate' => 'required|date_format:Y-m-d',\n 'endDate' => 'required|date_format:Y-m-d'\n ];\n if ($data['employee'] != 0) {\n self::$rules['employee'] = 'required|exists:appUser,id';\n }\n $this->validate($data);\n }", "abstract public function getValidateDesc();", "private function validateData() {\r\n\r\n $requiredFields = array(\"v_code\" => \"Verification code not supplied\",\r\n \"psw1\" => \"Password field is empty\",\r\n \"psw2\" => \"Password field is empty\",);\r\n\r\n\r\n //0 means there is no error\r\n $error_status = \\VAL_NO_ERROR;\r\n\r\n /*\r\n Initialize error object that will be returned by this function\r\n */\r\n $error_obj = new stdClass();\r\n $error_obj->msg = \"\";\r\n $error_obj->field = \"\";\r\n $error_obj->code = 0;\r\n $error_obj->type = \\VAL_NO_ERROR;\r\n\r\n //check if required variables are defined\r\n foreach ($requiredFields as $key => $value) {\r\n $value = $this->request->request->get($key);\r\n if (empty( $value )) {\r\n $error_obj->field = $key;\r\n $error_obj->msg = $requiredFields[$key];\r\n $error_obj->type = \\VAL_FIELD_ERROR;\r\n\r\n //return after each field that is found wrong\r\n return $error_obj;\r\n }\r\n }\r\n\r\n $pass_1 = $this->request->request->get('psw1');\r\n $pass_2 = $this->request->request->get('psw2');\r\n\r\n //Check if emails match\r\n if (strcmp($pass_1, $pass_2) != 0) {\r\n $error_obj->field = \"psw2\";\r\n $error_obj->msg = \"Passwords are different\";\r\n $error_obj->type = \\VAL_FIELD_ERROR;\r\n\r\n return $error_obj;\r\n }\r\n\r\n /*\r\n Only check one password. If both passwords are thesame, we only need to check one of them.\r\n */\r\n if (!preg_match('/^(?=.*\\d)(?=.*[a-z])(?=.*[A-Z]).{6,}$/', $pass_1)) {\r\n $error_obj->field = \"psw1\";\r\n $error_obj->msg = \"Password must have a digit, lower and upper case charters. Min lenght is 6\";\r\n $error_obj->type = \\VAL_FIELD_ERROR;\r\n\r\n return $error_obj;\r\n }\r\n\r\n return $error_obj;\r\n }" ]
[ "0.587873", "0.5781418", "0.5681975", "0.5645212", "0.5590447", "0.5590342", "0.54932827", "0.5486492", "0.54830337", "0.5476842", "0.5471194", "0.54674745", "0.54629385", "0.5422629", "0.5418839", "0.54139113", "0.54067004", "0.5404779", "0.5389906", "0.53889024", "0.533098", "0.53138834", "0.529748", "0.5277047", "0.52678406", "0.5267269", "0.5254514", "0.52499586", "0.522469", "0.522352", "0.5214423", "0.5206095", "0.51999366", "0.5199562", "0.5192428", "0.517571", "0.516886", "0.51681465", "0.5167633", "0.51628315", "0.5156537", "0.5151899", "0.514554", "0.51443595", "0.51439166", "0.5131292", "0.5129561", "0.5128031", "0.51280046", "0.51265275", "0.51124656", "0.5103843", "0.5095004", "0.50921077", "0.5092105", "0.50891614", "0.5080915", "0.5079652", "0.50551903", "0.5050496", "0.50503445", "0.50433517", "0.5037788", "0.5036592", "0.50328124", "0.503067", "0.5027331", "0.50255316", "0.50090253", "0.5008493", "0.5008042", "0.500235", "0.5001912", "0.49983802", "0.4995478", "0.49938357", "0.4991406", "0.4985598", "0.49788398", "0.49738437", "0.49725205", "0.49695036", "0.49511558", "0.4947207", "0.49436548", "0.49411497", "0.494081", "0.49386495", "0.49386495", "0.49380437", "0.49348193", "0.49298805", "0.49143904", "0.49139372", "0.49134457", "0.49092388", "0.49075323", "0.4906499", "0.49039778", "0.49036717" ]
0.68135285
0
Add item to Compensation_Detail_Data value
public function addToCompensation_Detail_Data(\WorkdayWsdl\\StructType\Compensation_Detail_DataType $item) { // validation for constraint: itemType if (!$item instanceof \WorkdayWsdl\\StructType\Compensation_Detail_DataType) { throw new \InvalidArgumentException(sprintf('The Compensation_Detail_Data property can only contain items of type \WorkdayWsdl\\StructType\Compensation_Detail_DataType, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__); } $this->Compensation_Detail_Data[] = $item; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function addToCompensation_Data(\\WorkdayWsdl\\\\StructType\\Compensation_DataType $item)\n {\n // validation for constraint: itemType\n if (!$item instanceof \\WorkdayWsdl\\\\StructType\\Compensation_DataType) {\n throw new \\InvalidArgumentException(sprintf('The Compensation_Data property can only contain items of type \\WorkdayWsdl\\\\StructType\\Compensation_DataType, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__);\n }\n $this->Compensation_Data[] = $item;\n return $this;\n }", "private function addDetailRecord(DetailRecord $detailRecord, DescriptiveRecord $descriptiveRecord)\n {\n // Record Type\n $line = $detailRecord->getRecordType();\n\n // BSB\n $line .= $detailRecord->getBsb();\n\n // Account Number\n $line .= str_pad($detailRecord->getAccountNumber(), 9, ' ', STR_PAD_LEFT);\n\n // Indicator\n $line .= $detailRecord->getIndicator() ?: ' ';\n\n // Transaction Code\n $line .= $detailRecord->getTransactionCode();\n\n // Transaction Amount\n $line .= str_pad($detailRecord->getAmount(), 10, '0', STR_PAD_LEFT);\n\n // Account Name\n $line .= str_pad($detailRecord->getAccountName(), 32, ' ', STR_PAD_RIGHT);\n\n // Lodgement Reference\n $line .= str_pad($detailRecord->getReference(), 18, ' ', STR_PAD_RIGHT);\n\n // Trace BSB\n $line .= $descriptiveRecord->getBsb();\n\n // Trace Account Number\n $line .= str_pad($descriptiveRecord->getAccountNumber(), 9, ' ', STR_PAD_LEFT);\n\n // Remitter Name\n $line .= str_pad($detailRecord->getRemitter(), 16, ' ', STR_PAD_RIGHT);\n\n // Withholding amount\n $line .= str_pad($detailRecord->getTaxWithholding(), 8, '0', STR_PAD_LEFT);\n\n $this->addLine($line);\n }", "public function addDetail($data) {\r\n /* FILTER KELENGKAPAN TRANSAKSI BY JENIS ACCOUNT */\r\n if ($this->isValidCoa(array(\r\n 'coa' => $data['dkst_coa'],\r\n 'cbid' => ses_cabang)) == FALSE)\r\n return FALSE;\r\n\r\n if ($this->db->insert(\"ksr_dtrans\", $data) == FALSE) {\r\n return FALSE;\r\n } else {\r\n return TRUE;\r\n }\r\n }", "public function addDetailData($data,$parent) {\n if($data && is_array($data) && $parent) {\n foreach($data as $fbKey => $fbVal) {\n $this->getAdapter()->query(\"INSERT INTO tmw_wire_comp_details(playerId,detailsField,detailsData) VALUES ('$parent','$fbKey','$fbVal');\");\n }\n return true;\n } else {\n throw new Exception('Could not insert data');\n }\t\n }", "public function addToDetail($item)\n {\n // validation for constraint: itemType\n if (!is_string($item)) {\n throw new \\InvalidArgumentException(sprintf('The Detail property can only contain items of string, \"%s\" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__);\n }\n $this->Detail[] = $item;\n return $this;\n }", "public function add()\n {\n $item = new stdClass();\n $item->item_id = null;\n $item->barcode = null;\n $item->price = null;\n $item->stock = null;\n $item->name = null;\n $item->category_id = null;\n $query_category = $this->categorys_m->get();\n $query_unit = $this->units_m->get();\n $unit[null] = '-Pilih-';\n foreach ($query_unit->result() as $u) {\n\n $unit[$u->unit_id] = $u->name;\n };\n $data = [\n 'page' => 'add',\n 'row' => $item,\n 'category' => $query_category,\n 'unit' => $unit,\n 'selectedunit' => null\n ];\n $this->template->load('template', 'product/item/item_add', $data);\n }", "public function simpan_data_detail($data)\n\t{\n\t\t$this->db->insert('detail_pros', $data);\n\t}", "public function append($item)\n {\n array_push($this->activeValue, $item);\n }", "public function add() {\n $dataH['CustomerBankAccount'] = $_lib['sess']->get_companydef('BankAccount');\n $old_pattern = array(\"/[^0-9]/\");\n $new_pattern = array(\"\");\n $dataH['CustomerAccountPlanID'] = strtolower(preg_replace($old_pattern, $new_pattern , $_lib['sess']->get_companydef('OrgNumber')));\n }", "private function cObjDataAddArray( $keyValue )\n {\n foreach ( $keyValue as $key => $value )\n {\n if ( empty( $key ) )\n {\n continue;\n }\n\n $this->pObj->cObj->data[ $key ] = $value;\n\n if ( !( $this->pObj->b_drs_map || $this->pObj->b_drs_warn ) )\n {\n continue;\n }\n\n if ( $value === null )\n {\n if ( $this->pObj->b_drs_warn )\n {\n $prompt = $key . ' is null. Maybe this is an error!';\n t3lib_div :: devLog( '[WARN/BROWSERMAPS] ' . $prompt, $this->pObj->extKey, 2 );\n }\n }\n else\n {\n if ( $this->pObj->b_drs_map )\n {\n $prompt = 'Added to cObject[' . $key . ']: ' . $value;\n t3lib_div :: devLog( '[INFO/BROWSERMAPS] ' . $prompt, $this->pObj->extKey, 0 );\n $prompt = 'You can use the content in TypoScript with: field = ' . $key;\n t3lib_div :: devLog( '[INFO/BROWSERMAPS] ' . $prompt, $this->pObj->extKey, 0 );\n }\n }\n }\n }", "public static function insert_new_product_details($data)\n {\n try{\n \n $session = Yii::$app->session;\n foreach($data as $key=>$val) \n {\n if($key == 'hire_price' || $key == 'sale_price'){\n if($val != '')\n {\n $val=str_replace(',', '', $val );\n if (strpos($val, '.') !== false) {\n $val=substr($val,0,strpos($val, '.')+3);\n }\n }\n else\n {\n $val = 0;\n }\n }\n if($key == 'life_tax_details')\n {\n if(sizeof($val)>0){\n\n $val=implode(\",\",$val);\n }\n }\n if($key == 'exact_location')\n {\n if(sizeof($val)>0){\n\n $val=implode(\",\",$val);\n }\n }\n $$key=get_magic_quotes_gpc()?$val:addslashes($val);\n $insertdata[$key] = $$key;\n\n }\n \n if($insertdata['hire_price_range'] == 'crore')\n {\n \n $insertdata['hire_price'] = $insertdata['hire_price'] * 10000000;\n }\n else if($insertdata['hire_price_range'] == 'lack')\n {\n $insertdata['hire_price'] = $insertdata['hire_price'] * 100000;\n }\n else if($insertdata['hire_price_range'] == 'thousand')\n {\n $insertdata['hire_price'] = $insertdata['hire_price'] * 1000;\n }\n else if($insertdata['hire_price_range'] == 'por')\n {\n $insertdata['hire_price'] = -1;\n }\n \n if($insertdata['sale_price_range'] == 'crore')\n {\n $insertdata['sale_price'] = $insertdata['sale_price'] * 10000000;\n }\n else if($insertdata['sale_price_range'] == 'lack')\n {\n $insertdata['sale_price'] = $insertdata['sale_price'] * 100000;\n }\n else if($insertdata['sale_price_range'] == 'thousand')\n {\n $insertdata['sale_price'] = $insertdata['sale_price'] * 1000;\n }\n else if($insertdata['sale_price_range'] == 'por')\n {\n $insertdata['sale_price'] = -1;\n }\n \n unset($insertdata['hire_price_range']);\n unset($insertdata['sale_price_range']);\n \n\n $capacity = $insertdata['capacity'];\n $insertdata['capacity'] = $insertdata['capacity'].' '.$insertdata['capacity_metric']; \n unset($insertdata['capacity_metric']);\n\n if(!isset($model_other)) $insertdata['model_other']=''; \n $insertdata['product_status'] = 0; //update this when control panel complete\n\n $remove_keys = ['email','user_name','phone_number','password','regrepassword','company_name','designation','company_email','address','otp'];\n foreach($remove_keys as $removekey) unset($insertdata[$removekey]);\n\n //save equipment current location to productloaction array\n $productlocation = array();\n $current_location_keys = ['latitude','longitude','city','state','country','google_place_id','location_type']; \n foreach($current_location_keys as $key)\n {\n if($key == 'location_type')\n {\n $location[$key] = 1;\n }\n else\n {\n $location[$key] = $insertdata[$key];\n unset($insertdata[$key]);\n }\n }\n $productlocation[] = $location;\n unset($insertdata['street']);\n unset($insertdata['route']);\n unset($insertdata['zipcode']);\n\n //save equipment serving location to productloaction array\n if(isset($insertdata['exact_location']))\n {\n $exact_locations = explode(',',$insertdata['exact_location']);\n foreach($exact_locations as $exact_location)\n {\n $get_url_data=file_get_contents(\"http://maps.google.com/maps/api/geocode/json?address=\".urlencode($exact_location).\"&sensor=false\");\n $url_data=(array)json_decode($get_url_data);\n $url_data=$url_data['results'];\n $components=array_reverse($url_data[0]->address_components);\n $country\t=@$components[0]->long_name;\n $state\t\t=@$components[1]->long_name;\n $city\t\t=@$components[2]->long_name;\n $place_id=$url_data[0]->place_id;\n $lat=$url_data[0]->geometry->location->lat;\n $lng=$url_data[0]->geometry->location->lng;\n $location['latitude'] = $lat;\n $location['longitude'] = $lng;\n $location['city'] = $city;\n $location['state'] = $state;\n $location['country'] = $country;\n $location['google_place_id'] = $place_id;\n $location['location_type'] = 2;\n $productlocation[] = $location;\n }\n }\n unset($insertdata['exact_location']);\n unset($insertdata['_csrf']);\n unset($insertdata['product_type_check']);\n \n if ($insertdata['length'] == \"\"){ \n $insertdata['length'] =0; \n } \n if ($insertdata['width'] == \"\"){\n $insertdata['width'] =0; \n } \n if ($insertdata['height'] == \"\"){ \n $insertdata['height'] =0; \n } \n $insertdata['dimensions'] = $insertdata['length'].'x'.$insertdata['width'].'x'.$insertdata['height']; \n unset($insertdata['length']); \n unset($insertdata['width']); \n unset($insertdata['height']);\n \n //update amount if package type is free\n if($data['package_type'] != 2) { $data['package_amount'] = 0; }\n \n\n\n //get current user id\n $insertdata['user_id']=Yii::$app->user->getId(); \n \n $insertdata['updated_by'] = Yii::$app->user->id;\n $insertdata['date_updated'] = date('Y-m-d H:i:s');\n \n //insert data into database core_prodcuts table and get inserted product id\n Yii::$app->db->createCommand()->insert('core_products', $insertdata)->execute();\n $product_id = Yii::$app->db->getLastInsertID();\n\n $session->set('current_product_id', $product_id);\n\n //generate unique code for product and update\n //new logic start\n $categories = array('1'=>'C','2'=>'D','3'=>'E','4'=>'G','5'=>'P');//C-crane,D-dumper,E-excavator,G-generator,P-piling rigs\n $manual_product_code = $categories[$insertdata['category_id']];\n \n $subcategorycode = Productsubcategory::get_sub_category_code_by_id($insertdata['sub_category_id']);\n $manual_product_code .= $subcategorycode;\n \n if(strlen($capacity)>4)\n $manual_product_code .= substr($capacity, 0,4);\n else if(strlen($capacity)<=4)\n $manual_product_code .= str_pad($capacity, 4, '0', STR_PAD_LEFT);\n \n $producttype = array('0'=>'H','1'=>'S','2'=>'B'); //H-hire,S-sale,B-both\n $manual_product_code .=$producttype[$insertdata['product_type']];\n \n $manual_product_code .= strtoupper(str_pad(dechex($product_id), 5, '0', STR_PAD_LEFT));\n \n \n //new logic end\n Yii::$app->db->createCommand()->update('core_products', ['manual_product_code' => $manual_product_code], \"product_id = '$product_id'\")->execute();\n\n\n //save product current and serving locations using product id \n foreach($productlocation as $location)\n {\n $location['product_id'] = $product_id;\n Yii::$app->db->createCommand()->insert('core_product_locations', $location)->execute();\n }\n\n //get category name by id to get full path of the images & load charts upload for product\n $category_id = $insertdata['category_id'];\n $category_names = Productcategory::select_fields_by_category_id($category_id);\n $category_name= str_replace(' ', '_', $category_names[0]['category_name']);\n\n //save product images\n if(is_array($session->get('product_images')))\n {\n $product_images = $session->get('product_images');\n $original_image_name=$session->get('product_images_names');\n foreach($product_images as $index=>$product_image)\n {\n $images_data['product_id'] = $product_id;\n $images_data['image_name'] = $original_image_name[$index];\n $images_data['image_url'] = Yii::$app->params['SITE_URL'].'uploads/'.date('Y').'/'.$category_name.'/'.$product_image;\n $images_data['image_type'] = 1;\n $images_data['image_status'] = 1;\n \n //insert image details to database table.\n Yii::$app->db->createCommand()->insert('core_product_images', $images_data)->execute();\n\n }\n $session->remove('product_images');\n $session->remove('product_images_names');\n }\n //save product load_charts\n if(is_array($session->get('product_loadcharts')))\n {\n $product_load_charts = $session->get('product_loadcharts');\n $original_load_chart_name=$session->get('product_loadcharts_names');\n foreach($product_load_charts as $index=>$load_chart)\n {\n $load_charts_data['product_id'] = $product_id;\n $load_charts_data['image_name'] = $original_load_chart_name[$index];\n $load_charts_data['image_url'] = Yii::$app->params['SITE_URL'].'uploads/'.date('Y').'/'.$category_name.'/'.$load_chart;\n $load_charts_data['image_type'] = 2;\n $load_charts_data['image_status'] = 1;\n //insert load_charts details to database table.\n Yii::$app->db->createCommand()->insert('core_product_images', $load_charts_data)->execute();\n }\n $session->remove('product_loadcharts');\n $session->remove('product_loadcharts_names');\n }\n\n $response ['status'] = 200;\n $response ['message'] = \"Product added successfully\";\n\n \n /*//get current user email\n $email = User::select_user_email_by_id();\n $subject=\"Big Equipments India | Registration Of Equipment\";\n //get what message to send after creating product\n $message = Mail_settings::get_product_add_message($manual_product_code,$product_id);\n \n //send email to current user\n Mail_settings::send_email_notification($email,$subject,$message);*/\n\n return json_encode($response);\n \n } catch (ErrorException $ex) {\n Yii::warning('Error while adding new product.');\n Yii::warning($ex->getMessage());\n }\n \n }", "public function simpan_sub_detail($data)\n\t{\n\t\t$this->db->insert('sub_detail_pros', $data);\n\t}", "private function addDetail()\n { \n $params = array();\n $params['db_link'] = $this->db;\n $params['ticket_id'] = $_REQUEST['ticket_id'];\n $Tickets = new Tickets($params);\n \n if($_REQUEST['changed_status'] != 0)\n {\n \n $Tickets->setStatus($_REQUEST['changed_status']);\n $Tickets->update();\n //save log \n $this->saveLog($_REQUEST['changed_status'], $_REQUEST['ticket_id'], null);\n }\n \n $data = array();\n $data['subject'] = stripslashes(trim($_REQUEST['subject']));\n $data['notes'] = stripslashes(trim($_REQUEST['notes']));\n $data['user_id'] = $_SESSION['LOGIN_USER']['userId'];\n \n //$Tickets = new Tickets($params);\n $details_id = $Tickets->addDetails($data);\n\n if($details_id)\n {\n $files = $this->getUploadedFiles();\n $this->saveAttachments($files, $_REQUEST['ticket_id'], $details_id);\n }\n \n //Send Email To resolvers, source, etc.\n $this->sendEmail($_REQUEST['ticket_id'], $data['subject']);\n \n \n \n echo '[{\"isError\":0, \"message\":\"Details added Successfully.\"}]';\n exit;\n }", "public function addNewStructureRow(){\n\t\t$map_id = $this->Generic_model->general_fetch_array_return_row('map_attributes_values', array('attribute_id'=>$this->input->post('newStructureAttr'), 'value'=>$this->input->post('newStructureValue')))->map_id;\n\t\t$onSale = '1';\n\t\tif($this->input->post('onSaleStruct') == ''){\n\t\t\t$onSale = '0';\n\t\t}\n\t\t$details = array(\n\t\t\t'pid' => $this->uri->segment(4),\n\t\t\t'map_id' => $map_id,\n\t\t\t'retail_price' => $this->input->post('price'),\n\t\t\t'retail_price_tax' => $this->input->post('priceTax'),\n\t\t\t'cost_price' => $this->input->post('costPrice'),\n\t\t\t'on_sale_status' => $onSale\n\t\t);\n\t\t$response = $this->Generic_model->general_insert('pricing_structure', $details);\n\t\tif($response){\n\t\t\t$this->session->set_flashdata('success', 'Product Updated successfully with new pricing structure.');\n\t\t}else{\n\t\t\t$this->session->set_flashdata('failure', 'Oops!! Something went wrong. Try again...');\n\t\t}\n\t\tredirect('admin/product/editProduct/'.$this->uri->segment(4));\n\t}", "function AfterAdd(&$values,&$keys,$inline,&$pageObject)\n{\n\n\t\tglobal $conn;\n$proid= $keys['proid'];\n$bill_date=$values['bill_date'];\n$amount_bill=$values['amount'];\n$bill_no=$values['bill_no'];\n$item=$values['item'];\n$ProgramID = $values['ProgramID'];\n$BatchID = $values['BatchID'];\n\n//get related student according to intake , branch, and program\n$sql_student = \"select StudentID from student_info where DipID='$ProgramID' AND BatchID='$BatchID' AND Status='Active'\";\n$q_student = db_query($sql_student,$conn);\n\n//insert all program billing item to related student program bill\nwhile($row_student=db_fetch_array($q_student))\n{ \n$studentID=$row_student['StudentID'];\n$sql_insert=\"INSERT INTO student_billing (proid,date,amount,amount_balance,bill_no,item,studentID,status)\nVALUES ('$proid','$bill_date','$amount_bill','$amount_bill','$bill_no','$item','$studentID','Pending')\";\ndb_exec($sql_insert,$conn);\t\n}\n\n\n;\t\t\n}", "public function addToAdditionalDetail(\\Sabre\\UpdateReservation\\StructType\\AdditionalDetailType $item)\n {\n // validation for constraint: itemType\n if (!$item instanceof \\Sabre\\UpdateReservation\\StructType\\AdditionalDetailType) {\n throw new \\InvalidArgumentException(sprintf('The AdditionalDetail property can only contain items of \\Sabre\\UpdateReservation\\StructType\\AdditionalDetailType, \"%s\" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__);\n }\n $this->AdditionalDetail[] = $item;\n return $this;\n }", "function add_billing_data($billObj) {\n\n $item = new stdClass();\n $item->trans_id = $billObj->transId;\n $item->cardholder = $billObj->billTo->firstName . ' ' . $billObj->billTo->lastName;\n $item->type = 'a';\n $item->address = $billObj->billTo->address;\n $item->state = $billObj->billTo->state;\n $item->city = $billObj->billTo->city;\n $item->zip = $billObj->billTo->zip;\n $item->pdate = time();\n\n $exists = $this->is_billing_data_exists($item->trans_id);\n if ($exists == 0) {\n $query = \"insert into mdl_billing_data \"\n . \"(transaction_id,\"\n . \"cardholder,\"\n . \"type,\"\n . \"address,\"\n . \"state,\"\n . \"city,\"\n . \"zip,\"\n . \"pdate) \"\n . \"values ('$item->trans_id',\"\n . \"'\" . addslashes($item->cardholder) . \"',\"\n . \"'$item->type',\"\n . \"'\" . addslashes($item->address) . \"',\"\n . \"'$item->state',\"\n . \"'\" . addslashes($item->city) . \"',\"\n . \"'$item->zip',\"\n . \"'$item->pdate')\";\n $this->db->query($query);\n } // end if $exists == 0\n }", "private function addDetailsInRows()\n\t{\n\t\tforeach ($this->data_show as &$row)\n\t\t\tforeach ($this->data as $row_original)\n\t\t\t{\n\t\t\t\t$is_group = true;\n\t\t\t\t\n\t\t\t\tforeach ($this->col_group as $key)\n\t\t\t\t\tif($row[$key] != $row_original[$key])\n\t\t\t\t\t\t$is_group = false;\n\t\t\t\t\n\t\t\t\tif($is_group)\n\t\t\t\t{\n\t\t\t\t\t// total amount\n\t\t\t\t\tif($this->col_aggr_sum)\n\t\t\t\t\t\t$row[$this->col_aggr_sum] += $row_original[$this->col_aggr_sum];\n\t\t\t\t\t\n\t\t\t\t\t// add details\n\t\t\t\t\t$row_tmp = array();\n\t\t\t\t\t\n\t\t\t\t\tforeach ($this->data[0] as $col => $val)\n\t\t\t\t\t\tif(!in_array($col, $this->col_show) || $col == $this->col_aggr_sum)\n\t\t\t\t\t\t\t$row_tmp[$col] = $row_original[$col];\n\t\t\t\t\t\n\t\t\t\t\t$row['details'][] = $row_tmp;\n\t\t\t\t}\n\t\t\t}\n\t}", "protected function addItemDetails(&$item) \r\n\t{\r\n\t\t//$item->totals = KTBTrackerHelper::getUserTotals($item);\r\n\t\t$this->getUserInfo($item);\r\n\t}", "public function add_deal($data_arr,&$validation_passed,&$new_transaction_id,&$err_arr){\n\t\tdie(\"NO LONGER USED\");\n \n }", "function OnAfterAdd(){\n //get keyfield value\n if (intval($this->item_id) == 0)\n $data = $this->Storage->GetRecord(null, array(\n $this->key_field => \"\"));\n $this->item_id = $data[$this->key_field];\n }", "function updateCompanyIdOrContactIdToListElem(&$arFields){\n\n if($arFields['IBLOCK_ID'] == 125 /*&& $arFields['PROPERTY_VALUES']['592']['n0']['VALUE'] == ''*/){\n $arFields['PROPERTY_VALUES']['592']['n0']['VALUE'];\n //file_put_contents($file, $arFields['PROPERTY_VALUES']['593']['n0']['VALUE'], FILE_APPEND | LOCK_EX);\n\n foreach ($arFields['PROPERTY_VALUES']['593'] as $number => $dealId){\n $ID = $dealId['VALUE'];\n $key = $number;\n }\n\n //Берем данные сделки по id\n //$dealData = CCrmDeal::GetByID($arFields['PROPERTY_VALUES']['593']['43585']['VALUE']);\n $dealData = CCrmDeal::GetByID($ID);\n if($dealData['COMPANY_ID'] != '') {\n $arFields['PROPERTY_VALUES']['592'][$key]['VALUE'] = 'CO_'.$dealData['COMPANY_ID'];\n }\n if($dealData['COMPANY_ID'] == 0 && $dealData['CONTACT_ID'] != '') {\n $arFields['PROPERTY_VALUES']['592'][$key]['VALUE'] = 'C_'.$dealData['CONTACT_ID'];\n }\n\n /* $file = $_SERVER['DOCUMENT_ROOT'].'/local/testLogger3.log';\n file_put_contents($file, print_r($arFields,true), FILE_APPEND | LOCK_EX);*/\n\n return true;\n\n }\n\n}", "public function pushDetailsItem($fields)\n {\n $defaults = array(\n 'id' => '',\n 'name' => ''\n );\n $this->data['ecommerce']['detail']['products'][] = $this->getDefaults($fields, $defaults);\n }", "public function prepareDetailTransactionData() \n {\n $header = array_flip(array_shift($this->data));\n $headerKeys = array_keys($header);\n $count = 0;\n foreach ($this->data as $data) {\n foreach ($data as $key => $value) {\n $value = trim($value);\n if (in_array($headerKeys[$key], $this->ignoredHeaders)) continue;\n if (empty($headerKeys[$key])) continue;\n\n $parent = strstr($headerKeys[$key], '-', true);\n $child = preg_replace('/-/', '', strstr($headerKeys[$key], '-'), 1);\n \n if ($parent == \"Transaction\") { \n $this->elementData[$count][$child] = $value;\n } else {\n $this->elementData[$count][$parent][$child] = $value;\n }\n }\n\n $this->checkRequiredFields($count, $this->elementData[$count]);\n $count++;\n }\n\n $this->checkRefDuplication();\n return $count;\n }", "public function addDatas(\\RO\\Cmd\\ItemData $value){\n return $this->_add(5, $value);\n }", "function Add($name, $value)\r\n\t{\r\n\t\tif (is_array($this->Data))\r\n\t\t{\r\n\t\t\t$this->Data[$name] = $value;\t\r\n\t\t}\t\r\n\t\telse if (is_object($this->Data))\r\n\t\t{\r\n\t\t\t$this->Data->$name = $value;\t\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\ttrigger_error(\"A DataRow of base type, cannot have fields added.\",E_USER_ERROR);\t\r\n\t\t}\r\n\t\t\r\n\t}", "function add() {\r\n\r\n\r\n $item_data = array(\r\n \"master_warehouse_id\" => $this->input->post('master_warehouse_id'),\r\n \"master_items_id\" => $this->input->post('master_items_id'),\r\n \"stock_on_hand\" => $this->input->post('stock_on_hand'),\r\n \"date_adjusment\" => $this->input->post('date_adjusment'),\r\n \"description\" => $this->input->post('description'),\r\n \"created_by\" => $this->session->userdata('user_name'),\r\n \"created_at\" => get_current_utc_time(),\r\n \"updated_by\" => $this->session->userdata('user_name'),\r\n \"updated_at\" => get_current_utc_time(),\r\n \"deleted\" =>0\r\n );\r\n\r\n $data = $this->Master_Stock_model->save($item_data);\r\n if ($data) {\r\n $item_info = $this->Master_Stock_model->get_details()->row();\r\n echo json_encode(array(\"success\" => true, \"id\" => $item_info->id, \"data\" => $this->_make_item_row($item_info), 'message' => lang('record_saved')));\r\n } else {\r\n echo json_encode(array(\"success\" => false, 'message' => lang('error_occurred')));\r\n }\r\n }", "public function add() {\t\n CheckAdminLoginSession();\t\t\n\t\t$post_data = $this->input->post();\n\t\t\n\t\tif(!empty($post_data)) { \n\t\t\t$this->form_validation->set_error_delimiters('<span class=\"text-danger\">', '</span>');\n\t\t\t$this->form_validation->set_rules('name', ' Name', 'required|trim');\t\t\t\t\n\t\t\tif($this->form_validation->run() == FALSE) { } else {\n\t\tforeach ($this->input->post('company_id') as $key => $company_id) {\n\t\t\tforeach ($company_id as $insurance_type_id) {\n\t\t\t\t$data = array(\t\t\t\t\t\t\t\n\t\t\t\t'name' => $this->input->post('name'),\t\t\t\t\n\t\t\t\t'company_id' => $key,\t\t\t\t\n\t\t\t\t'insurance_type_id' => $insurance_type_id,\t\t\t\t\n\t\t\t\t'created_date' => date('Y-m-d H:i:s'),\n\t\t\t\t'modified_date' => date('Y-m-d H:i:s'),\n\t\t\t\t'status' => $this->input->post('status')\t \n\t\t\t\t); \n\t\t\t\t$id = $this->admin_model->setInsertData($this->optional_warranty,$data);\n\t\t\t}\n\t\t}\n\t\t\t\t$this->session->set_flashdata('message','Your Optional Warranty has been added successfully');\n\t\t redirect('admin/optional-warranty/lists','refresh');\n\t\t }\n }\n $data='';\n $data['companyProvidingInsurance'] = $this->admin_model->getCompanyProvidingInsurance($this->company_insurance);\n\t\t$this->load->view('admin/include/head');\n\t\t$this->load->view('admin/include/header');\n\t\t$this->load->view('admin/include/sidebar');\n\t\t$this->load->view('admin/optional_warranty/add',$data);\n\t\t$this->load->view('admin/include/footer');\n\t\t$this->load->view('admin/include/foot');\n\t}", "function addItem2DB($data = null)\n {\n if ($this->isAdmin() == TRUE) {\n $this->loadThis();\n } else {\n $result = $_POST['itemInfo'];\n echo $this->coupon_model->add($result);\n }\n }", "public function pushDetailsList($list)\n {\n $this->data['ecommerce']['detail']['actionField']['list'] = $list;\n }", "function AddUpdateOptionBOMItem($BID, $opId, $arryDetails,$index) {//$option_ID,//\r\n global $Config;\r\n extract($arryDetails);\r\n //print_r($arryDetails);//die;\r\n \r\n if ($opId == '') {\r\n $strUpSQLQuery = \"update inv_bill_of_material set \r\n\t\t\t\ttotal_cost='\" . $TotalValue . \"',\r\n\t\t\t\tUpdatedDate = '\" . $Config['TodayDate'] . \"'\r\n\t\t\t\twhere bomID='\" . $BID.\"'\";\r\n //echo $strUpSQLQuery ;die;\r\n\r\n $this->query($strUpSQLQuery, 0);\r\n }\r\n \r\n \r\n for ($j = 1; $j<=$arryDetails['newNumberLine'.$index.'']; $j++) {\r\n \r\n if (!empty($arryDetails[\"newsku$index-$j\"])) {\r\n \r\n $id = $arryDetails[\"newid$index-$j\"];\r\n //print_r($id);\r\n if ($id > 0) {\r\n $sql = \"update inv_item_bom set orderby = '\".$arryDetails[\"orderby$index-$j\"].\"', item_id='\" . $arryDetails[\"newitem_id$index-$j\"] . \"', sku='\" . addslashes($arryDetails[\"newsku$index-$j\"]) . \"',`Primary`='\" .$arryDetails[\"Primary$index-$j\"] . \"', description='\" . addslashes($arryDetails[\"newdescription$index-$j\"]) . \"', wastageQty='\" . addslashes($arryDetails[\"newWastageqty$index-$j\"]) . \"', bom_qty='\" . addslashes($arryDetails[\"newqty$index-$j\"]) . \"', unit_cost='\" . addslashes($arryDetails[\"newprice$index-$j\"]) . \"', total_bom_cost='\" . addslashes($arryDetails[\"newamount$index-$j\"]) . \"',`Condition`='\" . addslashes($arryDetails[\"newCondition$index-$j\"]) . \"',req_item='\" . addslashes($arryDetails[\"newreq_item$index-$j\"]) . \"' where id='\" . $id.\"'\"; \r\n $this->query($sql, 0);\r\n } \r\n else {\r\n $sql = \"insert into inv_item_bom (bomID,optionID, item_id, sku, description, wastageQty, bom_qty, unit_cost, total_bom_cost,`Condition`,req_item,orderby,`Primary`) values('\" . $BID . \"','\" . $opId . \"','\" . $arryDetails[\"newitem_id$index-$j\"] . \"', '\" . addslashes($arryDetails[\"newsku$index-$j\"]) . \"', '\" . addslashes($arryDetails[\"newdescription$index-$j\"]) . \"', '\" . addslashes($arryDetails[\"newWastageqty$index-$j\"]) . \"', '\" . addslashes($arryDetails[\"newqty$index-$j\"]) . \"', '\" . addslashes($arryDetails[\"newrice$index-$j\"]) . \"','\" . addslashes($arryDetails[\"newamount$index-$j\"]) . \"','\" . addslashes($arryDetails[\"newCondition$index-$j\"]) . \"','\" . addslashes($arryDetails[\"newreq_item$index-$j\"] ). \"', orderby = '\".$arryDetails[\"orderby$index-$j\"].\"','\" . addslashes($arryDetails[\"Primary$index-$j\"]) . \"')\";\r\n $this->query($sql, 0);\r\n \r\n }\r\n \r\n }\r\n \r\n \r\n }\r\n //die;\r\n return true;\r\n }", "final public function addItemGroupTechInCharge() {\n if (!empty($this->target_object)) {\n foreach ($this->target_object as $val) {\n if ($val->fields['groups_id_tech'] > 0) {\n $this->addForGroup(0, $val->fields['groups_id_tech']);\n }\n }\n }\n }", "protected function saveInfoValues() {\r\n\t\tif(is_a($this->infoValueCollection, 'tx_ptgsaconfmgm_infoValueCollection')) {\r\n\t\t\t\r\n\t\t\tif($this->tableName=='tx_ptconference_domain_model_persdata') {\r\n\t\t\t\t$persArticleUid = $this->rowUid;\r\n\t\t\t\t$relArticleUid = 0;\r\n\t\t\t} else {\r\n\t\t\t\t$persArticleUid = $this->get_persdata();\r\n\t\t\t\t$relArticleUid = $this->rowUid;\r\n\t\t\t}\t\t\t\r\n\t\t\t\r\n\t\t\tforeach($this->infoValueCollection as $infoValue) {\r\n\t\t\t\t$infoValue->set_persdata($persArticleUid);\r\n\t\t\t\t$infoValue->set_relarticle($relArticleUid);\r\n\t\t\t\t$infoValue->save();\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public function addDetail(Detail $detail) {\n $this->details[] = $detail->toArray();\n\n return $this;\n }", "function add_additional_field($details) {\r\n\t\t$sql = \"INSERT INTO sys_man_additional_fields (field_name, field_type, field_placement, group_id) VALUES (?, ?, ?, ?)\";\r\n\t\t$data=array(\"$details->field_name\", \"$details->field_type\", \"$details->field_placement\", \"$details->group_id\");\r\n\t\t$query = $this->db->query($sql, $data);\r\n\t\treturn;\r\n\t}", "public function add($data){\r\n \t$db = $this->getAdapter();\r\n \t$db->beginTransaction();\r\n\t\t$user_info = new Application_Model_DbTable_DbGetUserInfo();\r\n\t\t$result = $user_info->getUserInfo();\r\n\t\t$session_user=new Zend_Session_Namespace(SYSTEM_SES);\r\n\t\t$request=Zend_Controller_Front::getInstance()->getRequest();\r\n\t\t $level = $result[\"level\"];\r\n \ttry {\r\n \t\t$arr = array(\r\n \t\t\t'item_name'\t\t=>\t$data[\"name\"],\r\n \t\t\t'item_code'\t\t=>\t$data[\"pro_code\"],\r\n// \t\t\t'barcode'\t\t=>\t$data[\"barcode\"],\r\n \t\t\t'cate_id'\t\t=>\t$data[\"category_id\"],\r\n \t\t\t'product_type'\t=>\t$data[\"product_type\"],\r\n \t\t\t'cost_price'=>$data[\"cost_price\"],\r\n \t\t\t'selling_price'=>$data[\"selling_price\"],\r\n \t\t\t'user_id'\t\t=>\t$this->getUserId(),\r\n \t\t\t'note'\t\t\t=>\t$data[\"description\"],\r\n \t\t\t'create_date'\t\t=>\tdate(\"Y-m-d\"),\r\n \t\t\t\t\r\n \t\t);\r\n \t\t$this->_name=\"ln_ins_product\";\r\n \t\t$id = $this->insert($arr);\r\n\t\t\t\r\n \t\tif(!empty($data['identity'])){\r\n \t\t\t$identitys = explode(',',$data['identity']);\r\n \t\t\tforeach($identitys as $i)\r\n \t\t\t{\r\n \t\t\t\t$arr1 = array(\r\n \t\t\t\t\t'pro_id'\t\t\t=>\t$id,\r\n \t\t\t\t\t'location_id'\t\t=>\t$data[\"branch_id\".$i],\r\n \t\t\t\t\t'qty'\t\t\t\t=>\t$data[\"total_qty_\".$i],\r\n \t\t\t\t\t'qty_warning'\t\t=>\t$data[\"alert_qty\".$i],\r\n \t\t\t\t\t'last_mod_userid'\t=>\t$this->getUserId(),\r\n \t\t\t\t\t'last_mod_date'\t\t=>\tnew Zend_Date(),\r\n \t\t\t\t\t'last_mod_userid' => $this->getUserId(),\r\n \t\t\t\t);\r\n \t\t\t\t$this->_name = \"ln_ins_prolocation\";\r\n \t\t\t\t$this->insert($arr1);\r\n \t\t\t }\r\n \t\t }\r\n \t\t$db->commit();\r\n \t}catch (Exception $e){\r\n \t\t$db->rollBack();\r\n \t\tApplication_Model_DbTable_DbUserLog::writeMessageError($e->getMessage());\r\n \t}\r\n }", "function add($data){\n if(array_key_exists($data['id'], $this->fields)){\n exit(\"Field with ID: '\".$data['id'].\"' already exists.\");\n }\n if(!isset($data['validate'])){\n $data['validate'] = false;\n }\n if(!isset($data['inline'])){\n $data['inline'] = null;\n }\n if(!isset($data['value'])){\n $data['value'] = null;\n }\n if(!isset($data['readonly'])){\n $data['readonly'] = false;\n }\n\n $this->fields[$data['id']] = $data;\n }", "public function storeDetail(array $data): void\n {\n }", "public function addAdditionalInfos(\\AgentSIB\\Diadoc\\Api\\Proto\\Invoicing\\AdditionalInfo $value)\n {\n if ($this->AdditionalInfos === null) {\n $this->AdditionalInfos = new \\Protobuf\\MessageCollection();\n }\n\n $this->AdditionalInfos->add($value);\n }", "public function free_add()\n\t\t{\n\t\t\t// $data['master_libur'] = $this->general->getData($data);\n\t\t\t// echo $data->judul;\n\t\t\t$this->general->load('absent/free/add');\n\t\t}", "public function appendEquipmentingItem($value)\n {\n return $this->append(self::EQUIPMENTING_ITEM, $value);\n }", "public function AddData ($key, $value) {\n\t\t$this->data[$key] = $value;\t\t\t\t\n\t}", "public function append($table, $item) {\r\n saprfc_table_append($this->fce, $table, array(\"LINE\" => \"\" . $item . \"\"));\r\n $this->arrayDebug['APPEND'][$table][] = $item;\r\n }", "function update_product_details($data,$iCatalogueId)\n {\n $this->db->where('iCatelogueId',$iCatalogueId);\n $query = $this->db->update('r_app_catalogue_details',$data);\n return $query;\n }", "protected function _setValueDetailDb($arr)\n\t{\n\t\tglobal $classEscape;\n\t\tglobal $varsRequest;\n\n\t\t$strDirect = 'inDirect';\n\t\tif ($arr['flagDirect']) {\n\t\t\t$strDirect = 'direct';\n\t\t}\n\n\t\t$strFlagDirect = 'varsInDirect';\n\t\tif ($arr['flagDirect']) {\n\t\t\t$strFlagDirect = 'varsDirect';\n\t\t}\n\n\t\t$idTarget = $arr['arrValue']['arr']['idAccountTitle'];\n\t\tif ($varsRequest['query']['func'] == 'DetailAdd'\n\t\t\t|| ($varsRequest['query']['func'] == 'DetailEdit' && !$arr['flagDefault'])\n\t\t) {\n\t\t\t$idTarget = 'custom_' . $arr['flagFS'] . '_' . $strDirect . '_' . $arr['arrValue']['arr']['idAccountTitle'];\n\t\t}\n\n\t\t$arrayBlock = $this->_getTreeBlock(array(\n\t\t\t'vars' => $arr['varsItem']['varsFS']['jsonJgaapFS' . $arr['flagFS']][$strFlagDirect],\n\t\t\t'idTarget' => $arr['idTarget'],\n\t\t));\n\n\t\t$arrayCheck = array();\n\t\tforeach ($arrayBlock as $key => $value) {\n\t\t\t$arrayCheck[$value['vars']['idTarget']] = $value;\n\t\t}\n\n\t\t$arrayIdAccountTitle = $classEscape->splitCommaArrayData(array('data' => $arr['arrValue']['arr']['arrCommaIdAccountTitle']));\n\t\tif ($arrayBlock[0]['vars']['idTarget'] == 'currentTermProfitOrLossPre') {\r\n\t\t\tarray_unshift($arrayIdAccountTitle, 'currentTermProfitOrLossPre');;\n\t\t}\n\n\t\t$array = $arrayIdAccountTitle;\n\t\t$arrayNew = array();\n\t\t$tmplVars = $arr['varsItem']['varsFSItem']['varsAccountTitleFSCS'];\n\t\tforeach ($array as $key => $value) {\n\t\t\tif ($varsRequest['query']['func'] == 'DetailAdd') {\n\t\t\t\tif ($value == 'insertPoint') {\n\t\t\t\t\t$tmplVars['strTitle'] = $arr['arrValue']['arr']['strTitle'];\n\t\t\t\t\t$tmplVars['vars'] = array(\n\t\t\t\t\t\t'idTarget' => $idTarget,\n\t\t\t\t\t\t'flagUse' => (int) $arr['arrValue']['arr']['flagUse'],\n\t\t\t\t\t\t'flagSortUse' => 1,\n\t\t\t\t\t\t'varsValue' => array(),\n\t\t\t\t\t);\n\t\t\t\t\t$arrayNew[] = $tmplVars;\n\n\t\t\t\t} else {\n\t\t\t\t\t$arrayNew[] = $arrayCheck[$value];\n\t\t\t\t}\n\n\t\t\t} else {\n\t\t\t\tif ($value == $arr['idTarget']) {\n\t\t\t\t\t$arrayCheck[$value]['strTitle'] = $arr['arrValue']['arr']['strTitle'];\n\t\t\t\t\t$arrayCheck[$value]['vars'] = array(\n\t\t\t\t\t\t'idTarget' => $idTarget,\n\t\t\t\t\t\t'flagUse' => (int) $arr['arrValue']['arr']['flagUse'],\n\t\t\t\t\t\t'flagSortUse' => 1,\n\t\t\t\t\t\t'varsValue' => array(),\n\t\t\t\t\t);\n\t\t\t\t\t$arrayNew[] = $arrayCheck[$value];\n\n\t\t\t\t} else {\n\t\t\t\t\t$arrayNew[] = $arrayCheck[$value];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$varsFS = $this->_insertTreeBlock(array(\n\t\t\t'vars' => $arr['varsItem']['varsFS']['jsonJgaapFS'. $arr['flagFS']][$strFlagDirect],\n\t\t\t'idTarget' => $arr['idTarget'],\n\t\t\t'varsTarget' => $arrayNew,\n\t\t));\n\n\t\t$arr['varsItem']['varsFS']['jsonJgaapFS'. $arr['flagFS']][$strFlagDirect] = $varsFS;\n\n\t\treturn $arr['varsItem']['varsFS']['jsonJgaapFS'. $arr['flagFS']];\n\t}", "public static function addAccountdetail($data) {\n\t\tif (!is_array($data)) return false;\n\t\t$data['create_time'] = Common::getTime();\n $data['update_time'] = Common::getTime();\n\t\t$data = self::_cookData($data);\n return $ret = self::_getDao()->insert($data);\n\t}", "function addItemForUpdate($item) {\n $this->_update[$item->getId()] = $item;\n }", "public static function update_product_details($data)\n {\n try{\n \n $session = Yii::$app->session;\n foreach($data as $key=>$val) \n {\n \n if($key == 'life_tax_details')\n {\n if(sizeof($val)>0){\n\n $val=implode(\",\",$val);\n }\n }\n if($key == 'exact_location')\n {\n if(sizeof($val)>0){\n\n $val=implode(\",\",$val);\n }\n }\n $$key=get_magic_quotes_gpc()?$val:addslashes($val);\n $insertdata[$key] = $$key;\n\n }\n\n $capacity = $insertdata['capacity'];\n $insertdata['capacity'] = $insertdata['capacity'].' '.$insertdata['capacity_metric']; \n unset($insertdata['capacity_metric']);\n\n if(!isset($model_other)) $insertdata['model_other']=''; \n \n \n //save equipment current location to productloaction array\n $productlocation = array();\n $current_location_keys = ['latitude','longitude','city','state','country','google_place_id','location_type']; \n foreach($current_location_keys as $key)\n {\n if($key == 'location_type')\n {\n $location[$key] = 1;\n }\n else\n {\n $location[$key] = $insertdata[$key];\n unset($insertdata[$key]);\n }\n }\n $productlocation[] = $location;\n unset($insertdata['street']);\n unset($insertdata['route']);\n unset($insertdata['zipcode']);\n\n //save equipment serving location to productloaction array\n if(isset($insertdata['exact_location']))\n {\n $exact_locations = explode(',',$insertdata['exact_location']);\n foreach($exact_locations as $exact_location)\n {\n $get_url_data=file_get_contents(\"http://maps.google.com/maps/api/geocode/json?address=\".urlencode($exact_location).\"&sensor=false\");\n $url_data=(array)json_decode($get_url_data);\n $url_data=$url_data['results'];\n $components=array_reverse($url_data[0]->address_components);\n $country\t=@$components[0]->long_name;\n $state\t\t=@$components[1]->long_name;\n $city\t\t=@$components[2]->long_name;\n $place_id=$url_data[0]->place_id;\n $lat=$url_data[0]->geometry->location->lat;\n $lng=$url_data[0]->geometry->location->lng;\n $location['latitude'] = $lat;\n $location['longitude'] = $lng;\n $location['city'] = $city;\n $location['state'] = $state;\n $location['country'] = $country;\n $location['google_place_id'] = $place_id;\n $location['location_type'] = 2;\n $productlocation[] = $location;\n }\n }\n unset($insertdata['exact_location']);\n unset($insertdata['_csrf']);\n //unset($insertdata['product_type_check']);\n \n $product_id = $insertdata['product_id'];\n unset($insertdata['product_id']); \n\n\n //get current user id\n //$insertdata['user_id']=Yii::$app->user->getId(); \n $insertdata['updated_by'] = Yii::$app->user->id;\n $insertdata['date_updated'] = date('Y-m-d H:i:s');\n \n //insert data into database core_prodcuts table and get inserted product id\n Yii::$app->db->createCommand()->update('core_products', $insertdata,\"product_id = $product_id\")->execute();\n \n \n Yii::$app->db->createCommand()->delete('core_product_locations', \"product_id = $product_id\")->execute();\n \n //save product current and serving locations using product id \n foreach($productlocation as $location)\n {\n $location['product_id'] = $product_id;\n Yii::$app->db->createCommand()->insert('core_product_locations', $location)->execute();\n }\n\n //get category name by id to get full path of the images & load charts upload for product\n $category_id = $insertdata['category_id'];\n $category_names = Productcategory::select_fields_by_category_id($category_id);\n $category_name= str_replace(' ', '_', $category_names[0]['category_name']);\n\n //save product images\n if(is_array($session->get('product_images')))\n {\n $product_images = $session->get('product_images');\n $original_image_name=$session->get('product_images_names');\n foreach($product_images as $index=>$product_image)\n {\n $images_data['product_id'] = $product_id;\n $images_data['image_name'] = $original_image_name[$index];\n $images_data['image_url'] = Yii::$app->params['SITE_URL'].'uploads/'.date('Y').'/'.$category_name.'/'.$product_image;\n $images_data['image_type'] = 1;\n $images_data['image_status'] = 1;\n \n //insert image details to database table.\n Yii::$app->db->createCommand()->insert('core_product_images', $images_data)->execute();\n\n }\n $session->remove('product_images');\n $session->remove('product_images_names');\n }\n //save product load_charts\n if(is_array($session->get('product_loadcharts')))\n {\n $product_load_charts = $session->get('product_loadcharts');\n $original_load_chart_name=$session->get('product_loadcharts_names');\n foreach($product_load_charts as $index=>$load_chart)\n {\n $load_charts_data['product_id'] = $product_id;\n $load_charts_data['image_name'] = $original_load_chart_name[$index];\n $load_charts_data['image_url'] = Yii::$app->params['SITE_URL'].'uploads/'.date('Y').'/'.$category_name.'/'.$load_chart;\n $load_charts_data['image_type'] = 2;\n $load_charts_data['image_status'] = 1;\n //insert load_charts details to database table.\n Yii::$app->db->createCommand()->insert('core_product_images', $load_charts_data)->execute();\n }\n $session->remove('product_loadcharts');\n $session->remove('product_loadcharts_names');\n }\n\n $response ['status'] = 200;\n $response ['message'] = \"Product updated successfully\";\n\n \n /*//get current user email\n $email = User::select_user_email_by_id();\n $subject=\"Big Equipments India | Registration Of Equipment\";\n //get what message to send after creating product\n $message = Mail_settings::get_product_add_message($manual_product_code,$product_id);\n \n //send email to current user\n Mail_settings::send_email_notification($email,$subject,$message);*/\n\n return $response;\n \n } catch (ErrorException $ex) {\n Yii::warning('Error while updating new product.');\n Yii::warning($ex->getMessage());\n \n $response ['status'] = 400;\n $response ['message'] = \"Error while updating product details\";\n return $response;\n }\n \n }", "public function addItem(Array $item)\n {\n $this->item[] = $item;\n }", "function addKeysell($sell_details){\n\t if ($this->db->insert('vc_keysell',$sell_details))\n\t\t\t { \n\t\t\t return TRUE;\n\t\t\t }\n\t\t\t else\n\t\t\t {\n\t\t\t return FALSE;\n\t\t\t }\n }", "private function append($value)\n {\n \t$this->values[] = $value;\n }", "public static function validateCompensation_Detail_DataForArrayConstraintsFromSetCompensation_Detail_Data(array $values = array())\n {\n $message = '';\n $invalidValues = [];\n foreach ($values as $employee_DataTypeCompensation_Detail_DataItem) {\n // validation for constraint: itemType\n if (!$employee_DataTypeCompensation_Detail_DataItem instanceof \\WorkdayWsdl\\\\StructType\\Compensation_Detail_DataType) {\n $invalidValues[] = is_object($employee_DataTypeCompensation_Detail_DataItem) ? get_class($employee_DataTypeCompensation_Detail_DataItem) : sprintf('%s(%s)', gettype($employee_DataTypeCompensation_Detail_DataItem), var_export($employee_DataTypeCompensation_Detail_DataItem, true));\n }\n }\n if (!empty($invalidValues)) {\n $message = sprintf('The Compensation_Detail_Data property can only contain items of type \\WorkdayWsdl\\\\StructType\\Compensation_Detail_DataType, %s given', is_object($invalidValues) ? get_class($invalidValues) : (is_array($invalidValues) ? implode(', ', $invalidValues) : gettype($invalidValues)));\n }\n unset($invalidValues);\n return $message;\n }", "public function addData($dataRow, $productId)\n {\n $customData = &$dataRow['amasty_custom_data'];\n\n if (isset($this->effectiveDates[$productId])) {\n $customData[Product::PREFIX_OTHER_ATTRIBUTES] = [\n self::SALE_PRICE_EFFECITVEDATE_INDEX => $this->effectiveDates[$productId]\n ];\n } else {\n $customData[Product::PREFIX_OTHER_ATTRIBUTES] = [\n self::SALE_PRICE_EFFECITVEDATE_INDEX => \"\"\n ];\n }\n\n return $dataRow;\n }", "private function addDetailRecord(TransactionInterface $transaction)\n {\n // Record Type\n $line = self::DETAIL_TYPE;\n\n // BSB\n $line .= $transaction->getBsb();\n\n // Account Number\n $line .= str_pad($transaction->getAccountNumber(), 9, ' ', STR_PAD_LEFT);\n\n // Indicator\n $line .= $transaction->getIndicator() ?: ' ';\n\n // Transaction Code\n $line .= $transaction->getTransactionCode();\n\n // Transaction Amount\n $line .= str_pad($transaction->getAmount(), 10, '0', STR_PAD_LEFT);\n\n // Account Name\n $line .= str_pad($transaction->getAccountName(), 32, ' ', STR_PAD_RIGHT);\n\n // Lodgement Reference\n $line .= str_pad($transaction->getReference(), 18, ' ', STR_PAD_RIGHT);\n\n // Trace BSB - already validated\n $line .= $this->bsb;\n\n // Trace Account Number - already validated\n $line .= str_pad($this->accountNumber, 9, ' ', STR_PAD_LEFT);\n\n // Remitter Name - already validated\n $remitter = $transaction->getRemitter() ?: $this->remitter;\n $line .= str_pad($remitter, 16, ' ', STR_PAD_RIGHT);\n\n // Withholding amount\n $line .= str_pad($transaction->getTaxWithholding(), 8, '0', STR_PAD_LEFT);\n\n $this->addLine($line);\n }", "private function write_single($data){\r\n if($this->$data[0] !== NULL){\r\n //add row of data to transaction object\r\n $this->$data[0]->add_list($data);\r\n }else{\r\n $this->$data[0] = new transaction_object($data[0]);\r\n $this->$data[0]->add_header($this->default_headers[$data[0]]);\r\n $this->$data[0]->add_list($data);\r\n }\r\n }", "function add( $obj )\r\n\t{\r\n\t\tif ( $this->signUseID == true) {\r\n\t\t\t$pos = $obj->primary_key_value();\r\n\t\t\t$this->data[ $pos ] = $obj;\r\n\t\t}\r\n\t\telse {\r\n\t\t\t$this->data[] = $obj;\r\n\t\t}\r\n\t}", "private function _addToFilteredItem( $addon, array $subData, &$filteredItem ){\n foreach ($subData as $key => $value) {\n if( is_array($value) ){\n $fieldPrefix = ($this->_iniData[$key]['db_table_prefix']) ? $this->_iniData[$key]['db_table_prefix'] : \"\";\n $this->_addToFilteredItem( $fieldPrefix, $value, $filteredItem );\n }\n if ( !is_numeric($key) && in_array($key,$this->_fieldsToUse,true)) {\n $filteredItem[$addon . $key] = $value;\n }\n }\n }", "public function addItem(My_ShoppingCart_Item_Interface $item)\n {\n $this->_order->Orderdetail[] = $item;\n }", "public function addSinglePurchaseDetails()\n\t{\n\t\t$singleProduct = [];\n\t\tforeach($this->orderParameters as $orders){\n\t\t\t$found = 0;\n\t\t\tforeach($this->aggregateProduct as $product){\n\t\t\t\tif($product[\"title\"] == $orders[\"title\"])\n\t\t\t\t\t$found++;\n\t\t\t}\n\t\t\t\n\t\t\tif($found == 0)\n\t\t\t $singleProduct[] = $orders;//add to single\n\t\t}\n\t\t\n\t\t$this->addPurchaseDetails($singleProduct);\n\t}", "function add($record)\n {\n $data = get_object_vars($record);\n $this->rest->initialize(array('server' => REST_SERVER));\n $this->rest->option(CURLOPT_PORT, REST_PORT);\n $retrieved = $this->rest->post('recipe/maintenance/item/id/' . $record->menu_id.'-'.$record->inventory_id, $data);\n }", "public function addData()\r\n {\r\n\r\n $this->datecreated = time();\r\n $sql = 'INSERT INTO ' . TABLE_PREFIX . 'stat_productstock (\r\n p_barcode,\r\n sd_value,\r\n sd_month,\r\n sd_year,\r\n day_1,\r\n day_2,\r\n day_3,\r\n day_4,\r\n day_5,\r\n day_6,\r\n day_7,\r\n day_8,\r\n day_9,\r\n day_10,\r\n day_11,\r\n day_12,\r\n day_13,\r\n day_14,\r\n day_15,\r\n day_16,\r\n day_17,\r\n day_18,\r\n day_19,\r\n day_20,\r\n day_21,\r\n day_22,\r\n day_23,\r\n day_24,\r\n day_25,\r\n day_26,\r\n day_27,\r\n day_28,\r\n day_29,\r\n day_30,\r\n day_31,\r\n sd_datecreated,\r\n sd_datemodified\r\n )\r\n VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)';\r\n $rowCount = $this->db3->query($sql, array(\r\n (string)$this->pbarcode,\r\n (string)$this->value,\r\n (int)$this->month,\r\n (int)$this->year,\r\n (string)$this->day_1,\r\n (string)$this->day_2,\r\n (string)$this->day_3,\r\n (string)$this->day_4,\r\n (string)$this->day_5,\r\n (string)$this->day_6,\r\n (string)$this->day_7,\r\n (string)$this->day_8,\r\n (string)$this->day_9,\r\n (string)$this->day_10,\r\n (string)$this->day_11,\r\n (string)$this->day_12,\r\n (string)$this->day_13,\r\n (string)$this->day_14,\r\n (string)$this->day_15,\r\n (string)$this->day_16,\r\n (string)$this->day_17,\r\n (string)$this->day_18,\r\n (string)$this->day_19,\r\n (string)$this->day_20,\r\n (string)$this->day_21,\r\n (string)$this->day_22,\r\n (string)$this->day_23,\r\n (string)$this->day_24,\r\n (string)$this->day_25,\r\n (string)$this->day_26,\r\n (string)$this->day_27,\r\n (string)$this->day_28,\r\n (string)$this->day_29,\r\n (string)$this->day_30,\r\n (string)$this->day_31,\r\n (int)$this->datecreated,\r\n (int)$this->datemodified\r\n ))->rowCount();\r\n\r\n $this->id = $this->db3->lastInsertId();\r\n return $this->id;\r\n }", "function expense_tracker_add_row()\n{\n\t$this->layout='blank';\n\t$s_society_id=(int)$this->Session->read('society_id');\n\t$s_user_id=(int)$this->Session->read('user_id');\n\n\t\t$count = (int)$this->request->query('con');\n\t\t$this->set('count',$count);\n\n\t\t\t$this->loadmodel('accounts_group');\n\t\t\t$conditions=array(\"accounts_id\" => 4);\n\t\t\t$cursor1=$this->accounts_group->find('all',array('conditions'=>$conditions));\n\t\t\t$this->set('cursor1',$cursor1);\n\n\t\t\t\t$this->loadmodel('ledger_sub_account');\n\t\t\t\t$conditions=array(\"ledger_id\" => 15);\n\t\t\t\t$cursor2=$this->ledger_sub_account->find('all',array('conditions'=>$conditions));\n\t\t\t\t$this->set('cursor2',$cursor2);\n}", "public static function addAccountdetail($data) {\n\t\tif (!is_array($data)) return false;\n\t\t$data['create_time'] = Common::getTime();\n $data['update_time'] = Common::getTime();\n\t\t$data = self::_cookData($data);\n\t\treturn self::_getDao()->insert($data);\n\t}", "function UpdateGeneral($arryDetails){ \r\n\t\t\tglobal $Config;\r\n\t\t\textract($arryDetails);\r\n\r\n\t\t\tif(!empty($SuppID)){\r\n\t\t\t\tif($Status=='') $Status=1;\r\n\t\t\t\t$UserName = trim($FirstName.' '.$LastName);\r\n\t\t\t\tif($primaryVendor == 1){\r\n\t\t\t\t\t$strSQLQuery2 = \"update p_supplier set primaryVendor = '0'\";\r\n\t\t\t\t\t$this->query($strSQLQuery2, 0);\r\n\t\t\t\t}\t\r\n\t\t\t\t\tif($defaultVendor == 1){\r\n\t\t\t\t\t$strSQLQuery3 = \"update p_supplier set defaultVendor = '0'\";\r\n\t\t\t\t\t$this->query($strSQLQuery3, 0);\r\n\t\t\t\t}\t\r\n\t\t\t\t\r\n\tif($Taxable == 'No')\r\n\t\t\t{\r\n\t\t\t\t$TaxRate = '';\r\n\t\t\t}\r\n\r\n\r\n\t\t\t\t$strSQLQuery = \"update p_supplier set primaryVendor = '\".addslashes($primaryVendor).\"', SuppType='\".addslashes($SuppType).\"', CompanyName='\".addslashes($CompanyName).\"', UserName='\".addslashes($UserName).\"', FirstName='\".addslashes($FirstName).\"', LastName='\".addslashes($LastName).\"' , Email='\".addslashes($Email).\"', Mobile='\".addslashes($Mobile).\"', Landline='\".addslashes($Landline).\"', Fax='\".addslashes($Fax).\"' , Website='\".addslashes($Website).\"', UpdatedDate = '\".$Config['TodayDate'].\"', Status='\".$Status.\"',Currency='\".$Currency.\"',SupplierSince='\".$SupplierSince.\"', TaxNumber='\".addslashes($TaxNumber).\"', PaymentMethod='\".addslashes($PaymentMethod).\"', ShippingMethod='\".addslashes($ShippingMethod).\"', PaymentTerm='\".addslashes($PaymentTerm).\"', SSN='\".addslashes($SSN).\"', TenNine='\".addslashes($TenNine).\"' , AccountID='\".addslashes($AccountID).\"', CreditCard='\".addslashes($CreditCard).\"', HoldPayment='\".addslashes($HoldPayment).\"', EIN='\".addslashes($EIN).\"',Taxable='\".addslashes($Taxable).\"',TaxRate='\".addslashes($TaxRate).\"', CreditLimit='\".addslashes($CreditLimit).\"',VAT='\".mysql_real_escape_string($VAT).\"',CST='\".mysql_real_escape_string($CST).\"',TRN='\".mysql_real_escape_string($TRN).\"',defaultVendor ='\".mysql_real_escape_string($defaultVendor).\"' where SuppID='\".mysql_real_escape_string($SuppID).\"'\"; \r\n\t\t\t\t$this->query($strSQLQuery, 0);\r\n\r\n\r\n\r\n\t\t\t\t\r\n\t\t\t\t/***********************/\r\n\t\t\t\t$objConfig=new admin();\r\n\t\t\t\t$Config['DbName'] = $Config['DbMain'];\r\n\t\t\t\t$objConfig->dbName = $Config['DbName'];\r\n\t\t\t\t$objConfig->connect();\r\n\t\t\r\n\t\t\t\t$strSQLQuery = \"update company_user set user_name='\".addslashes($Email).\"' where ref_id='\".mysql_real_escape_string($SuppID).\"' and user_type='vendor' and comId='\".$_SESSION['CmpID'].\"' \"; \r\n\t\t\t\t$this->query($strSQLQuery, 0);\t\t\r\n\r\n\r\n\t\t\t\t$Config['DbName'] = $_SESSION['CmpDatabase'];\r\n\t\t\t\t$objConfig->dbName = $Config['DbName'];\r\n\t\t\t\t$objConfig->connect();\r\n\t\t\t\t/***********************/\r\n\r\n\r\n\t\t\t}\r\n\r\n\t\t\treturn 1;\r\n\t\t}", "function saveData($db, &$strError)\n{\n global $error;\n $strError = \"\";\n (isset($_REQUEST['dataType'])) ? $strDataType = $_REQUEST['dataType'] : $strDataType = \"department\";\n (isset($_REQUEST['dataCode'])) ? $strDataCode = trim($_REQUEST['dataCode']) : $strDataCode = \"\";\n (isset($_REQUEST['dataOldCode'])) ? $strDataOldCode = $_REQUEST['dataOldCode'] : $strDataOldCode = \"\";\n (isset($_REQUEST['dataName'])) ? $strDataName = $_REQUEST['dataName'] : $strDataName = \"\";\n (isset($_REQUEST['dataID'])) ? $strDataID = $_REQUEST['dataID'] : $strDataID = \"\";\n // cek validasi -----------------------\n if (strtolower($strDataType) == \"management\") {\n // --- EDIT DATA MANAGEMENT\n if ($strDataCode == \"\") {\n $strError = $error['empty_code'];\n return false;\n } else if ($strDataName == \"\") {\n $strError = $error['empty_name'];\n return false;\n } else {\n ($strDataID == \"\") ? $strKriteria = \"\" : $strKriteria = \"AND id <> '$strDataID' \";\n if (isDataExists($db, \"hrd_management\", \"management_code\", $strDataCode, $strKriteria)) {\n $strError = $error['duplicate_code'] . \" Management -> $strDataCode\";\n return false;\n }\n }\n // simpan data -----------------------\n $data = [\n \"management_code\" => check_plain($strDataCode),\n \"management_name\" => check_plain($strDataName),\n ];\n $tbl = new cModel(\"hrd_management\", \"management\");\n if ($strDataID == \"\") {\n $tbl->insert($data);\n // data baru\n writeLog(ACTIVITY_ADD, MODULE_PAYROLL, \"$strDataCode\", 0);\n } else {\n $tbl->update([\"id\" => $strDataID], $data);\n writeLog(ACTIVITY_EDIT, MODULE_PAYROLL, \"$strDataCode\", 0);\n // update data2 dibawahnya, jika ada perubahan kode\n $strDataCode = check_plain($strDataCode);\n $strDataOldCode = check_plain($strDataOldCode);\n if ($strDataOldCode != $strDataCode) {\n $tbl->query(\n \"\n UPDATE hrd_division SET management_code = '$strDataCode' \n WHERE management_code = '$strDataOldCode'; \n UPDATE hrd_department SET management_code = '$strDataCode' \n WHERE management_code = '$strDataOldCode';\n UPDATE hrd_sub_department SET division_code = '$strDataCode'\n WHERE management_code = '$strDataOldCode';\n UPDATE hrd_section SET division_code = '$strDataCode' \n WHERE management_code = '$strDataOldCode';\n UPDATE hrd_sub_section SET division_code = '$strDataCode' \n WHERE management_code = '$strDataOldCode';\n UPDATE hrd_employee SET management_code = '$strDataCode' \n WHERE management_code = '$strDataOldCode'\"\n );\n }\n }\n } else if (strtolower($strDataType) == \"division\") {\n (isset($_REQUEST['dataManCode'])) ? $strDataManCode = $_REQUEST['dataManCode'] : $strDataManCode = \"\";\n // --- EDIT DATA DIVISION\n if ($strDataCode == \"\") {\n $strError = $error['empty_code'];\n return false;\n } else if ($strDataName == \"\") {\n $strError = $error['empty_name'];\n return false;\n } else {\n ($strDataID == \"\") ? $strKriteria = \"\" : $strKriteria = \"AND id <> '$strDataID' \";\n if (isDataExists($db, \"hrd_division\", \"division_code\", $strDataCode, $strKriteria)) {\n $strError = $error['duplicate_code'] . \" Division -> $strDataCode\";\n return false;\n }\n }\n // simpan data -----------------------\n $data = [\n \"division_code\" => $strDataCode,\n \"division_name\" => $strDataName,\n \"management_code\" => $strDataManCode,\n ];\n $tbl = new cModel(\"hrd_division\", \"division\");\n if ($strDataID == \"\") {\n $tbl->insert($data);\n // data baru\n writeLog(ACTIVITY_ADD, MODULE_PAYROLL, \"$strDataCode\", 0);\n } else {\n $tbl->update([\"id\" => $strDataID], $data);\n writeLog(ACTIVITY_EDIT, MODULE_PAYROLL, \"$strDataCode\", 0);\n // update data2 dibawahnya, jika ada perubahan kode\n if ($strDataOldCode != $strDataCode) {\n $tbl->query(\n \"\n UPDATE hrd_department SET division_code = '$strDataCode' \n WHERE division_code = '$strDataOldCode';\n UPDATE hrd_sub_department SET division_code = '$strDataCode'\n WHERE division_code = '$strDataOldCode';\n UPDATE hrd_section SET division_code = '$strDataCode' \n WHERE division_code = '$strDataOldCode';\n UPDATE hrd_sub_section SET division_code = '$strDataCode' \n WHERE division_code = '$strDataOldCode';\n UPDATE hrd_employee SET division_code = '$strDataCode' \n WHERE division_code = '$strDataOldCode'\"\n );\n }\n }\n } else if (strtolower($strDataType) == \"department\") {\n // --- EDIT DATA DEPARTMENT\n (isset($_REQUEST['dataManCode'])) ? $strDataManCode = $_REQUEST['dataManCode'] : $strDataManCode = \"\";\n (isset($_REQUEST['dataDivCode'])) ? $strDataDivCode = $_REQUEST['dataDivCode'] : $strDataDivCode = \"\";\n if ($strDataCode == \"\") {\n $strError = $error['empty_code'];\n return false;\n } else if ($strDataName == \"\") {\n $strError = $error['empty_name'];\n return false;\n } else {\n ($strDataID == \"\") ? $strKriteria = \"\" : $strKriteria = \"AND id <> '$strDataID' \";\n if (isDataExists($db, \"hrd_department\", \"department_code\", $strDataCode, $strKriteria)) {\n $strError = $error['duplicate_code'] . \" Department -> $strDataCode\";\n return false;\n }\n }\n $data = [\n \"department_code\" => $strDataCode,\n \"department_name\" => $strDataName,\n \"division_code\" => $strDataDivCode,\n \"management_code\" => $strDataManCode,\n ];\n $tbl = new cModel(\"hrd_department\", \"department\");\n // simpan data -----------------------\n if ($strDataID == \"\") {\n // data baru\n $tbl->insert($data);\n writeLog(ACTIVITY_ADD, MODULE_PAYROLL, \"$strDataCode\", 0);\n } else {\n $tbl->update([\"id\" => $strDataID], $data);\n writeLog(ACTIVITY_EDIT, MODULE_PAYROLL, \"$strDataCode\", 0);\n // update data2 dibawahnya, jika ada perubahan kode\n if ($strDataOldCode != $strDataCode) {\n $tbl->query(\n \"\n UPDATE hrd_sub_department SET department_code = '$strDataCode'\n WHERE department_code = '$strDataOldCode';\n UPDATE hrd_section SET department_code = '$strDataCode'\n WHERE department_code = '$strDataOldCode';\n UPDATE hrd_sub_section SET department_code = '$strDataCode' \n WHERE department_code = '$strDataOldCode';\n UPDATE hrd_employee SET department_code = '$strDataCode' \n WHERE department_code = '$strDataOldCode'\"\n );\n }\n }\n } else if (strtolower($strDataType) == \"subdepartment\") { // --- EDIT DATA SECTION\n (isset($_REQUEST['dataManCode'])) ? $strDataManCode = $_REQUEST['dataManCode'] : $strDataManCode = \"\";\n (isset($_REQUEST['dataDivCode'])) ? $strDataDivCode = $_REQUEST['dataDivCode'] : $strDataDivCode = \"\";\n (isset($_REQUEST['dataDeptCode'])) ? $strDataDeptCode = $_REQUEST['dataDeptCode'] : $strDataDeptCode = \"\";\n if ($strDataCode == \"\") {\n $strError = $error['empty_code'];\n return false;\n } else if ($strDataName == \"\") {\n $strError = $error['empty_name'];\n return false;\n } else {\n ($strDataID == \"\") ? $strKriteria = \"\" : $strKriteria = \"AND id <> '$strDataID' \";\n if (isDataExists($db, \"hrd_sub_department\", \"sub_department_code\", $strDataCode, $strKriteria)) {\n $strError = $error['duplicate_code'] . \" Sub Department -> $strDataCode\";\n return false;\n }\n }\n $data = [\n \"sub_department_code\" => $strDataCode,\n \"sub_department_name\" => $strDataName,\n \"department_code\" => $strDataDeptCode,\n \"division_code\" => $strDataDivCode,\n \"management_code\" => $strDataManCode,\n ];\n $tbl = new cModel(\"hrd_sub_department\", \"subdepartment\");\n // simpan data -----------------------\n if ($strDataID == \"\") {\n // data baru\n $tbl->insert($data);\n writeLog(ACTIVITY_ADD, MODULE_PAYROLL, \"$strDataCode\", 0);\n } else {\n $tbl->update([\"id\" => $strDataID], $data);\n writeLog(ACTIVITY_EDIT, MODULE_PAYROLL, \"$strDataCode\", 0);\n // update data2 dibawahnya, jika ada perubahan kode\n if ($strDataOldCode != $strDataCode) {\n $tbl->query(\n \"\n UPDATE hrd_section SET section_code = '$strDataCode'\n WHERE section_code = '$strDataOldCode';\n UPDATE hrd_sub_section SET section_code = '$strDataCode'\n WHERE section_code = '$strDataOldCode';\n UPDATE hrd_employee SET section_code = '$strDataCode' \n WHERE section_code = '$strDataOldCode'\"\n );\n }\n }\n } else if (strtolower($strDataType) == \"section\") { // --- EDIT DATA SECTION\n (isset($_REQUEST['dataManCode'])) ? $strDataManCode = $_REQUEST['dataManCode'] : $strDataManCode = \"\";\n (isset($_REQUEST['dataDivCode'])) ? $strDataDivCode = $_REQUEST['dataDivCode'] : $strDataDivCode = \"\";\n (isset($_REQUEST['dataDeptCode'])) ? $strDataDeptCode = $_REQUEST['dataDeptCode'] : $strDataDeptCode = \"\";\n (isset($_REQUEST['dataSubDeptCode'])) ? $strDataSubDeptCode = $_REQUEST['dataSubDeptCode'] : $strDataSubDeptCode = \"\";\n if ($strDataCode == \"\") {\n $strError = $error['empty_code'];\n return false;\n } else if ($strDataName == \"\") {\n $strError = $error['empty_name'];\n return false;\n } else {\n ($strDataID == \"\") ? $strKriteria = \"\" : $strKriteria = \"AND id <> '$strDataID' \";\n if (isDataExists($db, \"hrd_section\", \"section_code\", $strDataCode, $strKriteria)) {\n $strError = $error['duplicate_code'] . \" Section -> $strDataCode\";\n return false;\n }\n }\n $data = [\n \"section_code\" => $strDataCode,\n \"section_name\" => $strDataName,\n \"sub_department_code\" => $strDataSubDeptCode,\n \"department_code\" => $strDataDeptCode,\n \"division_code\" => $strDataDivCode,\n \"management_code\" => $strDataManCode,\n ];\n $tbl = new cModel(\"hrd_section\", \"section\");\n // simpan data -----------------------\n if ($strDataID == \"\") {\n // data baru\n $tbl->insert($data);\n writeLog(ACTIVITY_ADD, MODULE_PAYROLL, \"$strDataCode\", 0);\n } else {\n $tbl->update([\"id\" => $strDataID], $data);\n writeLog(ACTIVITY_EDIT, MODULE_PAYROLL, \"$strDataCode\", 0);\n // update data2 dibawahnya, jika ada perubahan kode\n if ($strDataOldCode != $strDataCode) {\n $tbl->query(\n \"\n UPDATE hrd_sub_section SET section_code = '$strDataCode'\n WHERE section_code = '$strDataOldCode';\n UPDATE hrd_employee SET section_code = '$strDataCode'\n WHERE section_code = '$strDataOldCode'\"\n );\n }\n }\n } else if (strtolower($strDataType) == \"subsection\") { // --- EDIT DATA SUBSECTION\n (isset($_REQUEST['dataManCode'])) ? $strDataManCode = $_REQUEST['dataManCode'] : $strDataManCode = \"\";\n (isset($_REQUEST['dataDivCode'])) ? $strDataDivCode = $_REQUEST['dataDivCode'] : $strDataDivCode = \"\";\n (isset($_REQUEST['dataDeptCode'])) ? $strDataDeptCode = $_REQUEST['dataDeptCode'] : $strDataDeptCode = \"\";\n (isset($_REQUEST['dataSectCode'])) ? $strDataSectCode = $_REQUEST['dataSectCode'] : $strDataSectCode = \"\";\n (isset($_REQUEST['dataSubDeptCode'])) ? $strDataSubDeptCode = $_REQUEST['dataSubDeptCode'] : $strDataSubDeptCode = \"\";\n //(isset($_REQUEST['dataOvertime'])) ? $strDataOvertime = $_REQUEST['dataOvertime'] : $strDataOvertime = \"f\";\n if ($strDataCode == \"\") {\n $strError = $error['empty_code'];\n return false;\n } else if ($strDataName == \"\") {\n $strError = $error['empty_name'];\n return false;\n } else {\n ($strDataID == \"\") ? $strKriteria = \"\" : $strKriteria = \"AND id <> '$strDataID' \";\n if (isDataExists($db, \"hrd_sub_section\", \"sub_section_code\", $strDataCode, $strKriteria)) {\n $strError = $error['duplicate_code'] . \" Sub Section -> $strDataCode\";\n return false;\n }\n }\n $data = [\n \"sub_section_code\" => $strDataCode,\n \"sub_section_name\" => $strDataName,\n \"section_code\" => $strDataSectCode,\n \"sub_department_code\" => $strDataSubDeptCode,\n \"department_code\" => $strDataDeptCode,\n \"division_code\" => $strDataDivCode,\n \"management_code\" => $strDataManCode,\n ];\n $tbl = new cModel(\"hrd_sub_section\", \"sub section\");\n // simpan data -----------------------\n if ($strDataID == \"\") {\n // data baru\n $tbl->insert($data);\n writeLog(ACTIVITY_ADD, MODULE_PAYROLL, \"$strDataCode\", 0);\n } else {\n $tbl->update([\"id\" => $strDataID], $data);\n writeLog(ACTIVITY_EDIT, MODULE_PAYROLL, \"$strDataCode\", 0);\n }\n }\n return true;\n}", "public function appendAdditionalInfos(\\Diadoc\\Api\\Proto\\Invoicing\\AdditionalInfo $value)\n {\n return $this->append(self::ADDITIONALINFOS, $value);\n }", "function add()\n\t{\n\t\t$this->_updatedata();\n\t}", "public function addData($pDataObj,\r\n $pDataObjKey = null) {\r\n if ($pDataObjKey !== null) {\r\n $this->records[$pDataObjKey] = $pDataObj;\r\n } else {\r\n $this->records[] = $pDataObj;\r\n }\r\n return;\r\n }", "public function addNew($data) {\r\n \t$roomDiscount = $this->findByUnique($data[self::ROOM], $data[self::RULE]);\r\n \tif (empty($roomDiscount)) {\r\n \t\treturn $this->insert($data);\r\n \t} else {\r\n \t\treturn $roomDiscount->id;\r\n \t}\r\n }", "private function addDescriptiveRecord()\n {\n // Record Type\n $line = self::DESCRIPTIVE_TYPE;\n\n if ($this->includeAccountNumberInDescriptiveRecord) {\n // BSB\n $line .= $this->bsb;\n\n // Account Number\n $line .= str_pad($this->accountNumber, 9, ' ', STR_PAD_LEFT);\n\n // Reserved - must be a single blank space\n $line .= ' ';\n } else {\n // Reserved - must be 17 blank spaces\n $line .= str_repeat(' ', 17);\n }\n\n // Sequence Number\n $line .= '01';\n\n // Bank Name\n $line .= $this->bankName;\n\n // Reserved - must be seven blank spaces\n $line .= str_repeat(' ', 7);\n\n // User Name\n $line .= str_pad($this->userName, 26, ' ', STR_PAD_RIGHT);\n\n // User ID\n $line .= $this->directEntryUserId;\n\n // File Description\n $line .= str_pad($this->description, 12, ' ', STR_PAD_RIGHT);\n\n // Processing Date\n $line .= date('dmy', is_numeric($this->processingDate) ? $this->processingDate : strtotime($this->processingDate));\n\n // Reserved - 40 blank spaces\n $line .= str_repeat(' ', 40);\n\n $this->addLine($line);\n }", "public function addToCOBRA_Eligibility_Data(\\WorkdayWsdl\\\\StructType\\COBRA_Eligibility_DataType $item)\n {\n // validation for constraint: itemType\n if (!$item instanceof \\WorkdayWsdl\\\\StructType\\COBRA_Eligibility_DataType) {\n throw new \\InvalidArgumentException(sprintf('The COBRA_Eligibility_Data property can only contain items of type \\WorkdayWsdl\\\\StructType\\COBRA_Eligibility_DataType, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__);\n }\n $this->COBRA_Eligibility_Data[] = $item;\n return $this;\n }", "function inspiry_additional_details() { ?>\n <div class=\"inspiry-details-wrapper\">\n <label><?php esc_html_e( 'Additional Details', 'framework' ); ?></label>\n <div class=\"inspiry-detail-header\">\n <p class=\"title\"><?php esc_html_e( 'Title', 'framework' ); ?></p>\n <p class=\"value\"><?php esc_html_e( 'Value', 'framework' ); ?></p>\n </div>\n <div id=\"inspiry-additional-details-container\">\n\t\t\t\t<?php\n\t\t\t\tif ( realhomes_dashboard_edit_property() || inspiry_is_edit_property() ) {\n\t\t\t\t\tglobal $target_property;\n\n\t\t\t\t\tif ( function_exists( 'ere_additional_details_migration' ) ) {\n\t\t\t\t\t\tere_additional_details_migration( $target_property->ID ); // Migrate property additional details from old metabox key to new key.\n\t\t\t\t\t}\n\n\t\t\t\t\t$additional_details = get_post_meta( $target_property->ID, 'REAL_HOMES_additional_details_list', true );\n\t\t\t\t\tif ( ! empty( $additional_details ) ) {\n\t\t\t\t\t\t$additional_details = array_filter( $additional_details ); // remove empty values.\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( ! empty( $additional_details ) ) {\n\t\t\t\t\t\tforeach ( $additional_details as $additional_detail ) {\n\t\t\t\t\t\t\tinspiry_render_additional_details( $additional_detail[0], $additional_detail[1] );\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tinspiry_render_additional_details();\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$default_details = apply_filters( 'inspiry_default_property_additional_details', array() );\n\t\t\t\t\tif ( ! empty( $default_details ) ) {\n\t\t\t\t\t\tforeach ( $default_details as $title => $value ) {\n\t\t\t\t\t\t\tinspiry_render_additional_details( $title, $value );\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tinspiry_render_additional_details();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t?>\n </div>\n <button class=\"add-detail btn btn-primary\"><i class=\"fas fa-plus\"></i><?php esc_attr_e( 'Add More', 'framework' ); ?></button>\n </div>\n\t\t<?php\n\t}", "public function addToContentDetail(\\Minioak\\Royalmail\\Shipping\\Structs\\ContentDetail $item)\n {\n // validation for constraint: itemType\n if (!$item instanceof \\Minioak\\Royalmail\\Shipping\\Structs\\ContentDetail) {\n throw new \\InvalidArgumentException(sprintf('The contentDetail property can only contain items of \\Minioak\\Royalmail\\Shipping\\Structs\\ContentDetail, \"%s\" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__);\n }\n $this->contentDetail[] = $item;\n return $this;\n }", "function addNew($rec)\r\n\t\t{\r\n\t\t\t// Create associative array of key fields and data values\r\n\t\t\t$data = array(\"idMedicalRecord\"=>$rec[0],\"medicalRec_weight\"=>$rec[1],\"medicalRec_height\"=>$rec[2],\"medicalRec_bloodPressure\"=>$rec[3],\"medicalRec_temperature\"=>$rec[4],\"medicalRec_bloodIronLevel\"=>$rec[5],\"medicalRec_time\"=>$rec[6],\"medicalRec_date\"=>$rec[7],\"medicalRec_medicalHistory\"=>$rec[8],\"medicalRec_rejectionReason\"=>$rec[9]);\r\n\t\t\t// Bind values to object's attributes\r\n\t\t\t$this->bind($data);\r\n\t\t\t// Add new values to table in database\r\n\t\t\t$this->insert();\r\n\t\t}", "public static function addFinalPriceForDetailProduct($data)\n {\n $taxClassArray = self::getTax();\n $priceRs = self::getPriceToCalculateTax($data);\n $data->final_price = self::finalPrice($priceRs['price'], $data->tax_class_id, $taxClassArray);\n $data->display_price_promotion = $priceRs['display_price_promotion'];\n return $data;\n }", "public static function addReservationAddonDetails($reservationID, $arrAddon) {\n $arrInsertData = array();\n \n foreach($arrAddon as $prod_id => $qty) {\n if($qty > 0){\n $arrInsertData[] = array(\n 'reservation_id' => $reservationID,\n 'no_of_persons' => $qty,\n 'options_id' => $prod_id,\n 'option_type' => 'addon',\n 'reservation_type' => 'experience',\n 'created_at' => date('Y-m-d H:i:m'),\n 'updated_at' => date('Y-m-d H:i:m'),\n );\n }\n\n }\n \n //writing data to reservation_addons_variants_details table\n DB::table('reservation_addons_variants_details')->insert($arrInsertData);\n }", "public function setEquipmentDetails($equipmentData)\n {\n foreach ($equipmentData as $key => $value) {\n $equipmentData[$key] = ($key != 'expire') ? mysql_escape_string($value) : $value;\n }\n\n //$this->db->select_db(DB_NAME);\n //\tsave to trash_bin\n $this->save2trash('U', $equipmentData['equipment_id']);\n//\n //\tcheck expire date change\n $recalculteMixLimits = false;\n if ($this->isExpireDateChanged($equipmentData[\"equipment_id\"], $equipmentData[\"expire\"])) {\n $recalculteMixLimits = true;\n }\n\n //\tcheck daily limit change\n if ($this->isDailyLimitChanged($equipmentData[\"equipment_id\"], $equipmentData[\"daily\"])) {\n $recalculteMixLimits = true;\n }\n\n $query = \"UPDATE \" . TB_EQUIPMENT . \" SET \";\n\n $query.=\"department_id='\" . $this->db->sqltext($equipmentData[\"department_id\"]) . \"', \";\n $query.=\"equip_desc='\" . $this->db->sqltext($equipmentData[\"equip_desc\"]) . \"', \";\n $query.=\"inventory_id='\" . $this->db->sqltext($equipmentData[\"inventory_id\"]) . \"', \";\n $query.=\"permit='\" . $this->db->sqltext($equipmentData[\"permit\"]) . \"', \";\n $query.=\"expire='\" . strtotime($equipmentData[\"expire\"]->formatInput()) . \"', \";\n $query.=\"daily='\" . $this->db->sqltext($equipmentData[\"daily\"]) . \"', \";\n $query.=\"dept_track='\" . $this->db->sqltext($equipmentData[\"dept_track\"]) . \"', \";\n $query.=\"facility_track='\" . $this->db->sqltext($equipmentData[\"facility_track\"]) . \"', \";\n $query .= \"model_number='\" . $this->db->sqltext($equipmentData[\"model_number\"]) . \"', \";\n $query .= \"serial_number='\" . $this->db->sqltext($equipmentData[\"serial_number\"]) . \"', \";\n $query.=\"creater_id='\" . $this->db->sqltext($equipmentData[\"creater_id\"]) . \"', \";\n $query.=\"voc_emissions='\" . $this->db->sqltext($this->getVocEmissions()) . \"'\";\n\n $query.=\" WHERE equipment_id=\" . $equipmentData['equipment_id'];\n\n $this->db->query($query);\n }", "public function addExpense($table, $data)\n {\n\n if (isset($data)) {\n $result=$this->dynamicInsert($table, $data);\n }\n }", "public function addDeal($deal_info) {\n $package_name = $deal_info['new_deal_package_name'];\n $number_chairs = $deal_info['new_deal_number_chairs'];\n $number_guests = $deal_info['new_deal_number_guests'];\n $floral_arrangement = $deal_info['new_deal_floral_arrangement'];\n $music_package = $deal_info['new_deal_music_package'];\n $photo_package = $deal_info['new_deal_photo_package'];\n $discount = $deal_info['new_deal_discount'];\n $deal_of_month = $deal_info['new_deal_of_month'];\n $description = $deal_info['new_deal_description'];\n \n #creates an array to hold new deal information for use in query\n $deal_array = array($package_name,$number_chairs,$number_guests,$floral_arrangement,\n $music_package,$photo_package,$discount,$deal_of_month,\n $description);\n \n #creates MySQL statement to insert new deal information into deals table\n $sql = \"INSERT INTO deals\n SET packageName = ?,\n numberChairs = ?,\n numberGuests = ?,\n floralArrangement = ?,\n musicPackage = ?,\n photoPackage = ?,\n discount = ?,\n dealOfMonth = ?,\n packageDescription = ?\n \";\n \n #executes the query using the constructed statement and the new deal data\n $statement = $this->db->query($sql,$deal_array);\n \n }", "public function writeItem($item)\n {\n $this->data[] = $item;\n }", "private function _updateSensorDetails($sensorInformationArray)\n {\n // 'f_color' => NULL ,\n $fiedsList = array(\n 'f_station_code' => NULL,\n 'f_sensor_ch' => NULL,\n 'f_sensor_code' => NULL,\n 'f_chain_code' => NULL,\n 'f_group_code' => NULL,\n 'f_unit_code' => NULL,\n 'f_name' => NULL,\n 'f_unit' => NULL,\n 'f_div' => NULL,\n 'f_mul' => NULL,\n 'f_val_neg' => NULL,\n 'f_val_log' => NULL,\n 'f_val_last' => NULL,\n 'f_val_sum' => NULL,\n 'f_val_aver' => NULL,\n 'f_val_min' => NULL,\n 'f_val_max' => NULL,\n 'f_val_time' => NULL,\n 'f_val_user' => NULL,\n 'f_create_time' => NULL,\n 'f_val_axilary' => NULL,\n 'f_user_app' => NULL,\n 'f_sensor_user_name' => NULL,\n 'f_user_unit_code' => NULL,\n );\n \n $updateString = \"\";\n foreach($fiedsList as $key => $val)\n {\n if(!isset($sensorInformationArray->{$key}))\n {\n $sensorInformationArray->{$key} = NULL;\n }else\n {\n // continue\n }\n \n /**\n * Fix, ETo debe mostrarse como SUM y no como AVER como declara el server remoto\n */\n if($sensorInformationArray->f_sensor_code == 1201)\n {\n $sensorInformationArray->f_val_aver = 0;\n $sensorInformationArray->f_val_sum = 1;\n }\n $updateString .= \"\\n `{$key}` = \" . check_null_val(process_plain_text($sensorInformationArray->{$key})) . \" ,\";\n }\n if(trim($updateString))\n {\n $query = \"\n UPDATE\n `\" . DBT_PREFIX . \"sensor_info`\n SET\n {$updateString}\n `last_update_date` = UNIX_TIMESTAMP()\n WHERE\n `f_station_code` = '{$sensorInformationArray->f_station_code}'\n AND\n `f_sensor_code` = '{$sensorInformationArray->f_sensor_code}'\n AND\n `f_sensor_ch` = '{$sensorInformationArray->f_sensor_ch}'\n LIMIT 1\n \";\n sql_select($query, $results);\n return $sensorInformationArray->f_station_code . \"_\" . $sensorInformationArray->f_sensor_code . \"_\" . $sensorInformationArray->f_sensor_ch . \" updated\";\n }else\n {\n return false;\n }\n }", "public function add_suppliers() {\n $arrPageData['arrSessionData'] = $this->session->userdata;\n if ($this->input->post('service_type') == 'customer') {\n $support_email = '';\n $support_no = '';\n $service_level = '';\n $response = '';\n $start_date = '';\n $end_date = '';\n }\n if ($this->input->post('service_type') == 'supplier') {\n $support_email = $this->input->post('support_email');\n $support_no = $this->input->post('support_number');\n $service_level = '';\n $response = '';\n $start_date = '';\n $end_date = '';\n }\n if ($this->input->post('service_type') == 'service') {\n $support_email = $this->input->post('support_email');\n $support_no = $this->input->post('support_number');\n $service_level = $this->input->post('service_level');\n $response = $this->input->post('response');\n if ($this->input->post('contract_start')) {\n $start_date = $this->input->post('contract_start');\n } else {\n $start_date = '';\n }\n if ($this->input->post('contract_end')) {\n $end_date = $this->input->post('contract_end');\n } else {\n $end_date = '';\n }\n }\n\n $supplierdata = array(\n 'supplier_name' => $this->input->post('supplier_name'),\n 'type' => $this->input->post('service_type'),\n 'account_id' => $arrPageData['arrSessionData']['objSystemUser']->accountid,\n 'ref_no' => $this->input->post('ref_code'),\n 'support_email' => $support_email,\n 'support_number' => $support_no,\n 'service_level' => $service_level,\n 'response' => $response,\n 'contract_startdate' => $start_date,\n 'contract_enddate' => $end_date,\n 'contract_name' => $this->input->post('contract_name'),\n 'supplier_title' => $this->input->post('contract_title'),\n 'contract_no' => $this->input->post('contract_number'),\n 'contract_email' => $this->input->post('contract_email'),\n 'supplier_address' => $this->input->post('address'),\n 'supplier_city' => $this->input->post('city'),\n 'supplier_state' => $this->input->post('state'),\n 'supplier_postcode' => $this->input->post('postcode'),\n 'active' => 1,\n 'archive' => 1);\n\n $this->db->insert('suppliers', $supplierdata);\n $id = $this->db->insert_id();\n if ($id) {\n return $id;\n } else {\n return FALSE;\n }\n }", "private function addLineItemsToInvoice($data){\n $lineItems = [];\n $counter = 1;\n foreach($data as $lineData) {\n $lineItem = [];\n $lineItem['LineNum'] = $counter;\n $lineItem['Description'] = IndexSanityCheckHelper::indexSanityCheck('description', $lineData);\n\n if (array_key_exists('item_id', $lineData)) {\n $lineItem['Amount'] = IndexSanityCheckHelper::indexSanityCheck('amount', $lineData);\n $lineItem['DetailType'] = 'SalesItemLineDetail';\n $lineItem['SalesItemLineDetail'] = [];\n $lineItem['SalesItemLineDetail']['Qty'] = IndexSanityCheckHelper::indexSanityCheck('quantity', $lineData);\n $lineItem['SalesItemLineDetail']['UnitPrice'] = IndexSanityCheckHelper::indexSanityCheck('unit_amount', $lineData);\n $lineItem['SalesItemLineDetail']['ItemRef']['value'] = IndexSanityCheckHelper::indexSanityCheck('item_id', $lineData);\n $lineItem['SalesItemLineDetail']['TaxCodeRef']['value'] = IndexSanityCheckHelper::indexSanityCheck('tax_id', $lineData);\n $lineItem['SalesItemLineDetail']['DiscountRate'] = IndexSanityCheckHelper::indexSanityCheck('discount_rate', $lineData);\n $lineItem['SalesItemLineDetail']['TaxInclusiveAmt'] = IndexSanityCheckHelper::indexSanityCheck('tax_inclusive_amount', $lineData);\n } else {\n $lineItem['Amount'] = IndexSanityCheckHelper::indexSanityCheck('amount', $lineData);\n $lineItem['DetailType'] = 'SalesItemLineDetail';\n $lineItem['SalesItemLineDetail'] = [];\n $lineItem['SalesItemLineDetail']['Qty'] = IndexSanityCheckHelper::indexSanityCheck('quantity', $lineData);\n $lineItem['SalesItemLineDetail']['UnitPrice'] = IndexSanityCheckHelper::indexSanityCheck('unit_amount', $lineData);\n $lineItem['SalesItemLineDetail']['TaxCodeRef']['value'] = IndexSanityCheckHelper::indexSanityCheck('tax_id', $lineData);\n $lineItem['SalesItemLineDetail']['DiscountRate'] = IndexSanityCheckHelper::indexSanityCheck('discount_rate', $lineData);\n $lineItem['SalesItemLineDetail']['TaxInclusiveAmt'] = IndexSanityCheckHelper::indexSanityCheck('tax_inclusive_amount', $lineData);\n }\n $counter++;\n array_push($lineItems, $lineItem);\n }\n if ($this->getDiscountRate()) {\n if ($this->getDiscountRate() > 0) {\n $discountLineItem = [];\n $discountLineItem['LineNum'] = $counter;\n $discountLineItem['Description'] = '';\n $discountLineItem['Amount'] = $this->getDiscountAmount();\n $discountLineItem['DetailType'] = 'DiscountLineDetail';\n $discountLineItem['DiscountLineDetail']['PercentBased'] = true;\n $discountLineItem['DiscountLineDetail']['DiscountPercent'] = $this->getDiscountRate();\n array_push($lineItems, $discountLineItem);\n }\n }\n else if ($this->getDiscountAmount()) {\n if ($this->getDiscountAmount() > 0) {\n $discountLineItem = [];\n $discountLineItem['LineNum'] = $counter;\n $discountLineItem['Description'] = '';\n $discountLineItem['Amount'] = $this->getDiscountAmount();\n $discountLineItem['DetailType'] = 'DiscountLineDetail';\n $discountLineItem['DiscountLineDetail']['PercentBased'] = false;\n array_push($lineItems, $discountLineItem);\n }\n }\n return $lineItems;\n }", "private function setItem(array $itemData)\n {\n //====================================================================//\n // Safety Check\n if ((!$this->item instanceof WC_Order_Item_Shipping) && (!$this->item instanceof WC_Order_Item_Fee)) {\n return;\n }\n //====================================================================//\n // Update Name\n if (isset($itemData[\"name\"])) {\n $this->setGeneric(\"_name\", $itemData[\"name\"], \"item\");\n }\n //====================================================================//\n // Update Quantity\n $qty = $itemData[\"quantity\"] ?? 1;\n //====================================================================//\n // Update Unit Price\n if (isset($itemData[\"subtotal\"])) {\n // Compute Expected Total\n $total = $qty * self::prices()->taxExcluded($itemData[\"subtotal\"]);\n // Compute Expected Total Tax Incl.\n $totalTax = $qty * self::prices()->taxAmount($itemData[\"subtotal\"]);\n // There is NO Discount\n } else {\n $total = $this->item->get_total();\n $totalTax = $this->item->get_total_tax();\n }\n //====================================================================//\n // Update Item Taxes\n if ($totalTax != $this->item->get_total_tax()) {\n $this->setItemTaxArray('total', (float) $totalTax);\n }\n //====================================================================//\n // Update Item Totals\n $this->setGeneric(\"_total\", $total, \"item\");\n }", "private function cObjData_updateRow( $uid )\n {\n static $firstVisit = true;\n\n // RETURN: empty row\n if ( empty( $this->rows[ $uid ] ) )\n {\n return;\n }\n // RETURN: empty row\n // Add each element of the row to cObj->data\n foreach ( ( array ) $this->rows[ $uid ] as $key => $value )\n {\n $this->pObj->cObj->data[ $key ] = $value;\n }\n\n // Add the field uid with the uid of the current row\n $key = $this->sql_filterFields[ $this->curr_tableField ][ 'uid' ];\n $value = $this->rows[ $uid ][ $key ];\n $this->pObj->cObj->data[ 'uid' ] = $value;\n\n // Add the field value with the value of the current row\n $key = $this->sql_filterFields[ $this->curr_tableField ][ 'value' ];\n $value = $this->rows[ $uid ][ $key ];\n $this->pObj->cObj->data[ 'value' ] = $value;\n\n // Add the field hits with the hits of the filter item\n $key = $this->sql_filterFields[ $this->curr_tableField ][ 'hits' ];\n $value = $this->rows[ $uid ][ $key ];\n $this->pObj->cObj->data[ 'hits' ] = $value;\n//$this->pObj->dev_var_dump( $this->pObj->cObj->data['hits'] );\n // Add the field rowNumber with the number of the current row\n $key = $this->pObj->prefixId . '.rowNumber';\n $value = $this->itemsPerHtmlRow[ 'currItemNumberInRow' ];\n\n // DRS\n if ( $firstVisit && $this->pObj->b_drs_cObjData )\n {\n foreach ( ( array ) $this->pObj->cObj->data as $key => $value )\n {\n $arr_prompt[] = '\\'' . $key . '\\' => \\'' . $value . '\\'';\n }\n $prompt = 'cObj->data of the first row: ' . implode( '; ', ( array ) $arr_prompt );\n t3lib_div::devlog( '[OK/COBJ] ' . $prompt, $this->pObj->extKey, -1 );\n }\n // DRS\n\n $firstVisit = false;\n }", "public static function addToDetails($keys,$d){\nif(is_object($d))$d=(array)$d; //Allow $d to be an object\nif(!is_array($keys))$keys=array($keys); //So it will work when $keys is a string\nif(is_array($d)){\n foreach($keys as $k){\n if(array_key_exists($k,$d))self::$details[$k]=$d[$k];\n }\n }\n}", "public function UpdateChequeDetails($update) {\n $arr = [];\n $i = 0;\n foreach ($update as $key => $val) {\n $arr[$key]['cheque_num'] = $val['cheque_num'][0];\n $arr[$key]['expiry_date'] = $val['expiry_date'][0];\n $arr[$key]['amount'] = $val['amount'][0];\n $i++;\n }\n foreach ($arr as $key => $value) {\n $aditional = \\common\\models\\ChequeDetails::findOne($key);\n $aditional->cheque_no = $value['cheque_num'];\n $aditional->due_date = date(\"Y-m-d\", strtotime($value['expiry_date']));\n $aditional->amount = $value['amount'];\n $aditional->save();\n }\n }", "public function aroundAddProduct($subject,\\Closure $proceed, $productInfo, $requestInfo = null)\n {\n $con=false;\n $mainid=\"\";\n $subid=\"\";\n $opstr=\"\";\n \n \n \n \n /**@var $subject \\Magento\\Checkout\\Model\\Cart */\n \n \n \n if(!$this->helper->getCustomerId()){\n \n throw new LocalizedException(__('Not logged in.'));\n }\n \n try{\n \n $productInfo=$this->_getProduct($productInfo);\n \n \n if(!in_array($productInfo->getTypeId(),[AccessoryType::TYPE_CODE,ClothType::TYPE_CODE])){\n $this->helper->log(\"\\n not multiv:added \\n\");\n return $proceed($productInfo,$requestInfo);\n \n }\n $items=$subject->getItems();\n \n foreach($items as $it){\n // $this->helper->log(\"current product \".$it->getId().\"\\n\");\n $pr=$it->getProduct();\n $this->helper->log(\"sku \".$pr->getSku().\"\\n\");\n if(strpos($pr->getSku() ,'res-')===0){\n $this->helper->log(\"\\n already :added \\n\");\n $this->_check($pr->getSku(), $requestInfo);\n// \n // return $proceed($productInfo,$requestInfo);\n/// throw new LocalizedException(__(\"Only One rental item can be added.\"));\n \n }\n \n }\n \n \n if(is_object($requestInfo)){\n $opts=$requestInfo->getData('rental_option');\n $opstr=$opts;\n $subject->getQuote()->getExtensionAttributes()->getRentalData()->setRentalDates($opstr);\n \n $depo=$productInfo->getData('deposit')??11;\n list(,,,$dd)=explode('-',$opstr);\n $rental=$dd!=8?$productInfo->getData('rent4'):$productInfo->getData('rent8');\n\n $vipdisc=$dd!=8?$productInfo->getData('vip_discount'):$productInfo->getData('vip_discount8');\n\n \n \n $sub=$requestInfo->getData('multiv_sub');\n }else if(is_array($requestInfo)){\n \n $rr=print_r($requestInfo,1);\n $this->helper->log(\"\\nmultiv:\".$rr.\"\\n\");\n if(!isset($requestInfo['rental_option'])){\n throw new LocalizedException(\"Invalid options\");\n \n }\n \n \n $opstr=$opts=$requestInfo['rental_option'];\n list(,,,$dd)=explode('-',$opstr);\n $rental=$dd!=8?$productInfo->getData('rent4'):$productInfo->getData('rent8');\n\n $vipdisc=$dd!=8?$productInfo->getData('vip_discount'):$productInfo->getData('vip_discount8');\n $depo=$productInfo->getData('deposit')??11;\n $owner=$productInfo->getData('uid');\n $cid=$this->helper->getCustomerId();\n \n $sub=isset($requestInfo['multiv_sub'])?$requestInfo['multiv_sub']:'';\n if(!$opts) throw new LocalizedException(\"Invalid options\");\n $qid=$subject->getQuote()->getId();\n $qid2=$this->cart->getQuoteId();\n $s= true;\n if(!$qid){\n $this->helper->log(\"createquote: cannot add qid2 $qid2 qid $qid\");\n throw new LocalizedException(__('Cannot add'));\n }\n \n $wash=(int)$productInfo->getData('wash');\n $this->helper->log(\"createquote: rental $rental depo $depo qid $qid qid2 $qid2 vip $vipdisc\");\n $con=$this->helper->reserve($opts,$productInfo->getId(),$qid,$owner,$cid,$rental,$depo,$wash,$vipdisc);\n if(!$con){\n \n throw new LocalizedException(__(\"Cannot be added again.\"));\n \n }\n \n }else{\n throw new LocalizedException(__(\"Invalid options\"));\n }\n \n $mainid=$productInfo->getId();\n $this->helper->log(\"mainid $mainid\");\n $this->helper->saveSession('rental', $rental);\n $this->helper->saveSession('depo', $depo);\n // $this->helper->addStock($productInfo);\n $prdd=$this->productRepo->get('deposit');\n \n $subid=$prdd->getId();\n // $this->helper->addStock($prdd);\n $this->helper->log(\"create:creating bundle mainid $mainid subid $subid rental $rental depo $depo\");\n\n if($subject->getQuote()->getExtensionAttributes()==null){\n $cartExtension = $this->cartExtensionFactory->create();\n $subject->getQuote()->setExtensionAttributes($cartExtension);\n// file_put_contents('lastq.txt','lastset');\n $subject->getQuote()->getExtensionAttributes()->setRentalData($this->qo);\n\n }\n\n $rental=$rental;///1.21;\n $depo=$depo;///1.21;\n\n\n\n\n\n $subject->getQuote()->getExtensionAttributes()->getRentalData()->setLastRequest($dd,$rental,$depo);\n $subject->getQuote()->getExtensionAttributes()->getRentalData()->setRentalDates($opstr);\n $_product=$this->createBundle($productInfo, $prdd,$opstr,$rental,$depo);\n/// $this->helper->updateProductStock($_product); \n $bundleid=$_product->getId();\n $this->helper->log(\"created $bundleid\");\n // get selection option in a bundle product\n $selectionCollection = $_product->getTypeInstance(true)\n ->getSelectionsCollection(\n $_product->getTypeInstance(true)->getOptionsIds($_product),$_product);\n \n // create bundle option\n $cont = 0;\n $selectionArray = [];\n foreach ($selectionCollection as $proselection){\n $this->helper->log(\" selection \".get_class($proselection).\"\\n\");\n $selectionArray[$cont] = $proselection->getSelectionId();\n $cont++;\n }\n // get options ids\n $optionsCollection = $_product->getTypeInstance(true)\n ->getOptionsCollection($_product);\n $bos=[]; \n foreach ($optionsCollection as $options) {\n /**@var $options \\Magento\\Bundle\\Api\\D/ata\\BundleOptionInterface */\n \n/// $links=$options->getProductLinks();\n //// $lnks=print_r($links,1);\n $id_option = $options->getId();\n \n $sel=$this->helper->getSel($id_option);\n \n \n \n $bos[$id_option]=[$sel];\n $this->helper->log(\"create: id $id_option sel $sel\");\n \n \n }\n \n \n $params = [\n 'product' => $_product->getId(),\n 'bundle_option' => $bos,\n 'qty' => 1\n ]; \n \n $parentid=$_product->getId();\n \n $requestInfo['product']=$_product->getId();\n $requestInfo['bundle_option']=$bos;\n $requestInfo['qty']=1;\n $bss=print_r($bos,1);\n $this->helper->log(\"create: adding to caert bos: $bss \");\n /**@var $result \\Magento\\Checkout\\Model\\Cart */\n ///$cart->addProduct($productInfo);\n \n /**@var $item \\Magento\\Quote\\Model\\Quote\\Item */\n \n \n $result=$proceed($_product,$requestInfo);\n $this->helper->log(\"addeds\");\n \n \n \n foreach($result->getItems() as $item ){\n \n if($item->getProductId()==$bundleid){\n\n \n $options = $item->getOptions();\n foreach ($options as $option)\n {\n if ($option->getCode() == 'bundle_selection_attributes')\n {\n $oo=$option->getValue();\n $this->helper->log(\"created: option bundle $oo\");\n \n /// $unserialized = unserialize($option->getValue());\n //$unserialized['price'] = number_format($rental+$depo, 2, '.', ',');\n /// $option->setValue(serialize($unserialized));\n }\n }\n try\n {\n/// $item->setOptions($options)->save();\n }\n catch (\\Exception $e)\n {}\n \n $item->setCustomPrice($rental+$depo);\n $item->setOriginalCustomPrice($rental+$depo);\n $this->helper->log(\"create:save bundle $rental dep $depo\");\n\n foreach($item->getChildren() as $it){\n \n $it->setIsSuperMode(true);\n if($it->getProduct()->getId()===$mainid){\n $it->setCustomPrice($rental);\n $it->setDiscountCalculationPrice($rental);\n \n $it->setOriginalCustomPrice($rental);\n $it->getProduct()->setIsSuperMode(true);\n $it->setFinalPrice($rental);\n $this->helper->log(\"create:set price \".$it->getId().\" price parentid \".$item->getId().\" paritid \".$item->getItemId());\n\n\n $options = $it->getOptions();\n foreach ($options as &$option)\n {\n if ($option->getCode() == 'bundle_selection_attributes')\n {\n $oo=$option->getValue(); \n $this->helper->log(\"created: $mainid rental $oo\");\n \n $unserialized = json_decode($option->getValue(),true);\n $unserialized['price'] = number_format($rental, 2, '.', ',');\n $option->setValue(json_encode($unserialized));\n \n }\n }\n try\n {\n $it->setOptions($options);\n /// $item->setOptions($options)->save();\n }catch(\\Exception $e){\n \n }\n \n \n }\n\n else if($it->getProduct()->getId()==$subid){\n $it->setCustomPrice($depo);\n $it->setDiscountCalculationPrice(0);\n $it->setOriginalCustomPrice($depo);\n $it->getProduct()->setIsSuperMode(true);\n $this->helper->log(\"create:set price \".$it->getId().\" price parentid \".$item->getId().\" paritid \".$item->getItemId());\n \n $options = $it->getOptions();\n $it->setFinalPrice($depo);\n foreach ($options as &$option)\n {\n if ($option->getCode() == 'bundle_selection_attributes')\n {\n $oo=$option->getValue();\n $this->helper->log(\"created: $subid deposi9teopt $oo\");\n\n $unserialized = json_decode($option->getValue(),true);\n $unserialized['price'] = number_format($depo, 2, '.', ',');\n $option->setValue(json_encode($unserialized));\n \n }\n }\n try\n {\n $it->setOptions($options);\n /// $item->setOptions($options)->save();\n }\n catch (\\Exception $e)\n {}\n \n }\n \n }\n \n \n }\n }\n \n \n \n /*\n foreach($result->getItems() as $item ){\n \n \n $b=$item->getData('info_buyRequest');\n $co=$item->getCustomOption();\n $bo=$item->getBuyRequest();\n $bor=\"\";\n $this->helper->log(\"adding item\");\n \n if($bo){\n // $bo=get_class($bo);\n \n $bor=$bo->getData('rental_option');\n \n }\n $parid=$item->getParentItemId();\n $ppid=\"\";\n $bsku='';\n $itsku=$item->getProduct()->getSku();\n $itid=$item->getId();\n \n if($parid){\n $ppid=$item->getParentItem()->getId();\n $bsku=$item->getParentItem()->getProduct()->getSku();\n }\n \n file_put_contents('around.txt', \"item $itid parient $parid ppid $ppid bundle $bundleid mainid $mainid itemsku $itsku busku $bsku \\n \",FILE_APPEND);\n if($item->getProductId()==$mainid&&$bor==$opstr){\n \n \n if($item->getParentItem()&& $item->getParentItem()->getProduct()->getId()==$bundleid){\n \n $item->setCustomPrice($rental);\n $item->setOriginalCustomPrice($rental);\n $skux=$item->getProduct()->getSku();\n file_put_contents('around.txt', \"setting price of $mainid $skux parid $parid \\n \",FILE_APPEND);\n $item->getProduct()->setIsSuperMode(true);\n }\n \n }\n if($item->getProductId()==$subid&&$bor==$opstr){\n // $parid=$item->getParentItemId();\n if($item->getParentItem()&& $item->getParentItem()->getProduct()->getId()==$bundleid){\n $item->setCustomPrice($depo);\n $item->setOriginalCustomPrice($depo);\n $item->getProduct()->setIsSuperMode(true);\n }\n \n }else if($item->getProductId()==$bundleid){\n/// $this->helper->log(\"dditem $dd rental $rental depo $depo bor $bor itemid \".$item->getProductId().\" opstr $opstr\");\n /// $item->setCustomPrice($depo+$rental);\n /// $item->setOriginalCustomPrice($depo+$rental);\n /// $item->getProduct()->setIsSuperMode(true);\n $item->setIsSuperMode(true);\n }\n \n \n }\n */\n $this->helper->log(\"committing\");\n \n $con->commit();\n $this->helper->log(\"added to cart\");\n $con=false;\n }catch(LocalizedException $e){\n $this->helper->log(\"error in adding\");\n $this->helper->log($e->getMessage());\n $this->helper->log($e->getTraceAsString());\n $this->msgmgr->addErrorMessage($e->getMessage()) ;\n/// throw $e;\n }\n catch(\\Exception $e){\n $this->helper->log(\"error in adding:main exception\");\n $this->helper->log($e->getMessage());\n $this->msgmgr->addErrorMessage((string)__('Cannot add.')) ; \n/// throw $e; \n }\n finally {\n if($con){\n $con->rollBack();\n }\n }\n \n return $result??''; \n \n }", "public function append($value)\n {\n $this->items[] = $value;\n }", "function insert() {\n\t\t$sql = \"INSERT INTO cost_detail (cd_fr_id, cd_seq, cd_start_time, cd_end_time, cd_hour, cd_minute, cd_cost, cd_update, cd_user_update)\n\t\t\t\tVALUES(?, ?, ?, ?, ?, ?, ?, ?, ?)\";\n\t\t$this->ffm->query($sql, array($this->cd_fr_id, $this->cd_seq, $this->cd_start_time, $this->cd_end_time, $this->cd_hour, $this->cd_minute, $this->cd_cost, $this->cd_update, $this->cd_user_update));\n\t\t$this->last_insert_id = $this->ffm->insert_id();\n\t}", "protected function _setValueDetailDbEdit($arr)\n\t{\n\t\tglobal $classDb;\n\t\t$dbh = $classDb->getHandle();\n\n\t\tglobal $varsPluginAccountingEntity;\n\t\tglobal $varsPluginAccountingAccount;\n\n\t\t$strNation = ucwords(PLUGIN_ACCOUNTING_STR_NATION);\n\t\t$rows = $classDb->getSelect(array(\n\t\t\t'idModule' => 'accounting',\n\t\t\t'strTable' => 'accountingFS' . $strNation,\n\t\t\t'arrLimit' => array(),\n\t\t\t'arrOrder' => array(),\n\t\t\t'flagAnd' => 1,\n\t\t\t'arrWhere' => array(\n\t\t\t\tarray(\n\t\t\t\t\t'flagType' => 'num',\n\t\t\t\t\t'strColumn' => 'idEntity',\n\t\t\t\t\t'flagCondition' => 'eq',\n\t\t\t\t\t'value' => $varsPluginAccountingAccount['idEntityCurrent'],\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'flagType' => 'num',\n\t\t\t\t\t'strColumn' => 'numFiscalPeriod',\n\t\t\t\t\t'flagCondition' => 'small',\n\t\t\t\t\t'value' => $varsPluginAccountingAccount['numFiscalPeriodCurrent'],\n\t\t\t\t),\n\t\t\t),\n\t\t));\n\n\t\t$array = $rows['arrRows'];\n\t\t$strDirect = 'inDirect';\n\t\tif ($arr['flagDirect']) {\n\t\t\t$strDirect = 'direct';\n\t\t}\n\t\t$idAccountTitle = $arr['arrValue']['arr']['idAccountTitle'];\n\t\t$idAccountTitleCustom = 'custom_' . $arr['flagFS'] . '_' . $strDirect . '_' . $idAccountTitle;\n\n\t\t$strFlagDirect = 'varsInDirect';\n\t\tif ($arr['flagDirect']) {\n\t\t\t$strFlagDirect = 'varsDirect';\n\t\t}\n\n\t\tforeach ($array as $key => $value) {\n\t\t\tif (!$value['jsonJgaapFSCS']) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$varsFS = $value['jsonJgaapFSCS'];\n\t\t\t$varsFS[$strFlagDirect] = $this->_setValueDetailDbEditLoop(array(\n\t\t\t\t'idValue' => $idAccountTitleCustom,\n\t\t\t\t'vars' => $value['jsonJgaapFSCS'][$strFlagDirect],\n\t\t\t\t'idTarget' => $arr['idTarget'],\n\t\t\t\t'flagEditCheck' => $arr['flagEditCheck'],\n\t\t\t));\n\n\t\t\t$jsonAccountTitle = json_encode($varsFS);\n\t\t\t$this->checkTextSize(array(\n\t\t\t\t'flag' => 'errorDataMax',\n\t\t\t\t'str' => $jsonAccountTitle,\n\t\t\t));\n\t\t\t$strAccountTitle = 'jsonJgaapFSCS';\n\n\t\t\t$arrDbColumn = array($strAccountTitle);\n\t\t\t$arrDbValue = array($jsonAccountTitle);\n\n\t\t\t$classDb->updateRow(array(\n\t\t\t\t'idModule' => 'accounting',\n\t\t\t\t'strTable' => 'accountingFS' . $strNation,\n\t\t\t\t'arrColumn' => $arrDbColumn,\n\t\t\t\t'flagAnd' => 1,\n\t\t\t\t'arrWhere' => array(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'flagType' => 'num',\n\t\t\t\t\t\t'strColumn' => 'id',\n\t\t\t\t\t\t'flagCondition' => 'eq',\n\t\t\t\t\t\t'value' => $value['id'],\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\t'arrValue' => $arrDbValue,\n\t\t\t));\n\t\t}\n\n\t\t$rows = $classDb->getSelect(array(\n\t\t\t'idModule' => 'accounting',\n\t\t\t'strTable' => 'accountingFS' . $strNation,\n\t\t\t'arrLimit' => array(),\n\t\t\t'arrOrder' => array(),\n\t\t\t'flagAnd' => 1,\n\t\t\t'arrWhere' => array(\n\t\t\t\tarray(\n\t\t\t\t\t'flagType' => 'num',\n\t\t\t\t\t'strColumn' => 'idEntity',\n\t\t\t\t\t'flagCondition' => 'eq',\n\t\t\t\t\t'value' => $varsPluginAccountingAccount['idEntityCurrent'],\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'flagType' => 'num',\n\t\t\t\t\t'strColumn' => 'numFiscalPeriod',\n\t\t\t\t\t'flagCondition' => 'eqSmall',\n\t\t\t\t\t'value' => $varsPluginAccountingAccount['numFiscalPeriodCurrent'],\n\t\t\t\t),\n\t\t\t),\n\t\t));\n\n\t\t$arrayFSList = $this->_getFSList(array(\n\t\t\t'numFiscalPeriod' => $varsPluginAccountingAccount['numFiscalPeriodCurrent'],\n\t\t));\n\n\n\t\t$array = $rows['arrRows'];\n\t\tforeach ($array as $key => $value) {\n\t\t\tforeach ($arrayFSList as $keyFSList => $valueFSList) {\n\t\t\t\tif (!$value['jsonJgaapAccountTitle'. $keyFSList]) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t$arrIdTarget = $arr['varsItem']['varsJgaapFS']['arrIdAccountTitleFS'][$keyFSList][$arr['idTarget']];\n\t\t\t\tif (!$arrIdTarget) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$varsFS = $value['jsonJgaapAccountTitle'. $keyFSList];\n\t\t\t\tforeach ($arrIdTarget as $keyTarget => $valueTarget) {\n\t\t\t\t\t$varsFS = $this->_setValueDetailDbEditLoopAccountTitle(array(\n\t\t\t\t\t\t'idValue' => $idAccountTitleCustom,\n\t\t\t\t\t\t'arrValue' => $arr['arrValue'],\n\t\t\t\t\t\t'vars' => $varsFS,\n\t\t\t\t\t\t'strFlagDirect' => $strFlagDirect,\n\t\t\t\t\t\t'idTarget' => $keyTarget,\n\t\t\t\t\t\t'idTargetCS' => $arr['idTarget'],\n\t\t\t\t\t\t'flagEditCheck' => $arr['flagEditCheck'],\n\t\t\t\t\t));\n\t\t\t\t}\n\n\t\t\t\t$jsonAccountTitle = json_encode($varsFS);\n\t\t\t\t$this->checkTextSize(array(\n\t\t\t\t\t'flag' => 'errorDataMax',\n\t\t\t\t\t'str' => $jsonAccountTitle,\n\t\t\t\t));\n\t\t\t\t$strAccountTitle = 'jsonJgaapAccountTitle'. $keyFSList;\n\n\t\t\t\t$arrDbColumn = array($strAccountTitle);\n\t\t\t\t$arrDbValue = array($jsonAccountTitle);\n\n\t\t\t\t$classDb->updateRow(array(\n\t\t\t\t\t'idModule' => 'accounting',\n\t\t\t\t\t'strTable' => 'accountingFS' . $strNation,\n\t\t\t\t\t'arrColumn' => $arrDbColumn,\n\t\t\t\t\t'flagAnd' => 1,\n\t\t\t\t\t'arrWhere' => array(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'flagType' => 'num',\n\t\t\t\t\t\t\t'strColumn' => 'id',\n\t\t\t\t\t\t\t'flagCondition' => 'eq',\n\t\t\t\t\t\t\t'value' => $value['id'],\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t\t'arrValue' => $arrDbValue,\n\t\t\t\t));\n\t\t\t}\n\t\t}\n\n\n\t}", "public function uploadDetailDataToTransaction($activityId)\n {\n $count = array();\n $count['total'] = $this->prepareDetailTransactionData();\n //exit();\n $element = new Iati_Aidstream_Element_Activity_Transaction();\n \n $result = $element->fetchData($activityId, true);\n $result = Iati_ElementSorter::sortElementsData($result, array('TransactionDate' =>'@iso_date'), array('TransactionValue' => '@value_date'));\n \n // Update if existing transaction by compairing 'internal reference'\n $count['update'] = 0;\n $duplicate = 0;\n $transactionKey = 0;\n foreach ($this->elementData as $key => $data) {\n $refCount = 0;\n foreach($result as $row) {\n if (strtolower($data['ref']) == strtolower($row['@ref']) && !empty($data['ref'])) {\n if ($refCount == 0) {\n $this->elementData[$key]['id'] = $row['id'];\n $this->elementData[$key]['TransactionType']['id'] = $row['TransactionType']['id'];\n $this->elementData[$key]['ProviderOrg']['id'] = $row['ProviderOrg']['id'];\n $this->elementData[$key]['ReceiverOrg']['id'] = $row['ReceiverOrg']['id'];\n $this->elementData[$key]['TransactionValue']['id'] = $row['TransactionValue']['id'];\n $this->elementData[$key]['Description']['id'] = $row['Description']['id'];\n $this->elementData[$key]['TransactionDate']['id'] = $row['TransactionDate']['id'];\n $this->elementData[$key]['FlowType']['id'] = $row['FlowType']['id'];\n $this->elementData[$key]['FinanceType']['id'] = $row['FinanceType']['id'];\n $this->elementData[$key]['AidType']['id'] = $row['AidType']['id'];\n $this->elementData[$key]['DisbursementChannel']['id'] = $row['DisbursementChannel']['id'];\n $this->elementData[$key]['TiedStatus']['id'] = $row['TiedStatus']['id'];\n \n $count['update'] += 1; // Transaction Update count\n $refCount = 1;\n } elseif ($refCount == 1) {\n $duplicate += 1;\n $transactionKey = $key;\n } \n }\n }\n }\n\n // Transaction add count\n $count['add'] = $count['total'] - $count['update'];\n \n if($duplicate >= 1) {\n $this->error[$transactionKey][]['message'] = \"Cannot update transaction. Internal reference duplication on your \n existing transactions. Please use a different internal reference or \n check your existing transactions.\";\n }\n \n if(empty($this->error)){\n $element->save($this->elementData , $activityId);\n \n return $count;\n } else {\n return false;\n }\n }", "function addstock($uketoru_item, $uketoru_num){\n\tglobal $item;\n\tglobal $num_item;\n\t// echo $uketoru_item, '<br />', $uketoru_num, '<br />';\n\t// echo gettype($item), '<br />';\n\t# checking whether or not the item is in the data and its position\n\t$yes_no = in_array($uketoru_item, $item);\n\t$position = array_search($uketoru_item, $item);\n\t\n\t// echo 'in_array', '<br />' ,(boolean) $yes_no , '<br />','<br />';\n\t// echo 'position', '<br />', $position , '<br />';\n\n\t//echo $address;\n\tif($yes_no == 0){\n\t// $uketoru_item is not in array data \n\techo \"the item is not in the data.\",'<br />';\n\t# add the item in the data\n\tarray_push($item, $uketoru_item);\n\tarray_push($num_item, $uketoru_num);\n\t// echo $item[0],'<br />', $num_item[0],'<br />';\n\n\t}else{\n\t# $uketoru_item\n\t\"the item is in the data and is stocked.\";\n\t# add the stock on the item\n\t// echo \"yes_no\", '<br />', $yes_no, '<br />';\n\t$num_item[$position] = $num_item[$position] + $uketoru_num;\n\n\t}\n}", "public function addNewDeal($data,$lid) {\n return $this->db->insert('Deals',$data);\n }", "public function assestLedgerEntry()\n {\n $items = $this->getVoucherItems();\n \n $financeLedger = new Core_Model_Finance_Ledger;\n $assestLedgerRecord = $financeLedger->fetchByName('Current Asset');\n \n $totalPrice = 0;\n for($i = 0; $i <= sizeof($items)-1; $i += 1) {\n $price = $items[$i]['unit_price'] * $items[$i]['quantity'];\n $totalPrice = $totalPrice + $price;\n }\n $notes = 'Purchase with Purchase Id = '.$this->_purchaseId; \n \n $dataToInsert = array(\n 'debit' => $amount,\n 'credit' => \"0\",\n 'notes' => $notes,\n 'transaction_timestamp' => $this->_transactionTime,\n 'fa_ledger_id' => $assestLedgerRecord['fa_ledger_id']\n );\n $ledgerEntryModel = new Core_Model_Finance_Ledger_Entry;\n $ledgerEntryId = $ledgerEntryModel->create($dataToInsert);\n return $ledgerEntryId;\n }", "public function addToPersonal_Info_Data(\\WorkdayWsdl\\\\StructType\\Personal_Info_DataType $item)\n {\n // validation for constraint: itemType\n if (!$item instanceof \\WorkdayWsdl\\\\StructType\\Personal_Info_DataType) {\n throw new \\InvalidArgumentException(sprintf('The Personal_Info_Data property can only contain items of type \\WorkdayWsdl\\\\StructType\\Personal_Info_DataType, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__);\n }\n $this->Personal_Info_Data[] = $item;\n return $this;\n }", "function addItem2DB()\n {\n if ($this->isAdmin() == TRUE) {\n $this->loadThis();\n } else {\n $result = $_POST['itemInfo'];\n echo $this->carousel_model->add($result);\n }\n }", "function addTargetComp($tcomp_details){\n\t if ($this->db->insert('vc_target_comp',$tcomp_details))\n\t\t\t{ \n\t\t\treturn TRUE;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\treturn FALSE;\n\t\t\t}\n }", "function WriteAuditTrailOnAdd(&$rs) {\n\t\tglobal $mst_vendor;\n\t\t$table = 'mst_vendor';\n\n\t\t// Get key value\n\t\t$key = \"\";\n\t\tif ($key <> \"\") $key .= EW_COMPOSITE_KEY_SEPARATOR;\n\t\t$key .= $rs['kode'];\n\n\t\t// Write Audit Trail\n\t\t$filePfx = \"log\";\n\t\t$curDate = date(\"Y/m/d\");\n\t\t$curTime = date(\"H:i:s\");\n\t\t$id = ew_ScriptName();\n\t $curUser = CurrentUserName();\n\t\t$action = \"A\";\n\t\t$oldvalue = \"\";\n\t\tforeach (array_keys($rs) as $fldname) {\n\t\t\tif ($mst_vendor->fields[$fldname]->FldDataType <> EW_DATATYPE_BLOB) { // Ignore Blob Field\n\t\t\t\t$newvalue = ($mst_vendor->fields[$fldname]->FldDataType == EW_DATATYPE_MEMO) ? \"<MEMO>\" : $rs[$fldname]; // Memo Field\n\t\t\t\tew_WriteAuditTrail($filePfx, $curDate, $curTime, $id, $curUser, $action, $table, $fldname, $key, $oldvalue, $newvalue);\n\t\t\t}\n\t\t}\n\t}", "public function actionCreate()\n {\n \n // generate purchase Order Number\n \n $adjustment_number = TransactionCode::generate_transaction_number('AD--');\n \n if(empty($adjustment_number)){\n $adjustment_number = '';\n }\n \n\n $modelAdjustmentHead = new ImAdjustHead;\n $modelsAdjustmentDetail = [new ImAdjustDetail];\n\n // Set Default Data\n $modelAdjustmentHead->transaction_no = $adjustment_number; \n $modelAdjustmentHead->status = 'open'; \n\n $modelAdjustmentHead->branch_id = 1;\n $modelAdjustmentHead->currency_id = 1;\n\n // Currency Data\n $currency_data = Currency::find()->where(['id'=>$modelAdjustmentHead->currency_id])->one();\n\n if(!empty($currency_data)){\n $modelAdjustmentHead->exchange_rate = $currency_data->exchange_rate;\n }\n \n if ($modelAdjustmentHead->load(Yii::$app->request->post())) {\n\n $modelsAdjustmentDetail = Model::createMultiple(ImAdjustDetail::classname());\n Model::loadMultiple($modelsAdjustmentDetail, Yii::$app->request->post());\n\n // validate all models\n $valid = $modelAdjustmentHead->validate();\n $valid = Model::validateMultiple($modelsAdjustmentDetail) && $valid;\n\n if ($valid) {\n $transaction = \\Yii::$app->db->beginTransaction();\n\n try {\n $modelAdjustmentHead->status = 'open';\n if ($flag = $modelAdjustmentHead->save(false)) {\n foreach ($modelsAdjustmentDetail as $modelAdjustmentDetail) {\n $modelAdjustmentDetail->im_adjust_head_id = $modelAdjustmentHead->id;\n if (! ($flag = $modelAdjustmentDetail->save(false))) {\n $transaction->rollBack();\n break;\n }\n }\n }\n\n if ($flag) {\n\n // Update transaction code data\n $update_transaction = TransactionCode::update_transaction_number('AD--');\n\n if($update_transaction){\n echo 'successfully updated';\n }else{\n echo 'successfully not updated';\n }\n\n // Set success data\n \\Yii::$app->getSession()->setFlash('success', 'Successfully Inserted');\n\n \n $transaction->commit();\n return $this->redirect(['view', 'id' => $modelAdjustmentHead->id]);\n }\n } catch (\\Exception $e) {\n\n // Set success data\n \\Yii::$app->getSession()->setFlash('error', $e->getMessage());\n\n $transaction->rollBack();\n }\n }\n }\n\n return $this->render('create', [\n 'modelAdjustmentHead' => $modelAdjustmentHead,\n 'modelsAdjustmentDetail' => (empty($modelsAdjustmentDetail)) ? [new ImAdjustDetail] : $modelsAdjustmentDetail\n ]);\n\n }" ]
[ "0.6132607", "0.5467399", "0.5360926", "0.52197987", "0.5216997", "0.52087444", "0.51678056", "0.51663333", "0.5139879", "0.51351756", "0.51181453", "0.51178575", "0.51080304", "0.5090842", "0.5080605", "0.5041717", "0.5007385", "0.49704885", "0.49491113", "0.49209148", "0.49071994", "0.49013686", "0.48991305", "0.48809522", "0.48783386", "0.4876451", "0.48735285", "0.48707378", "0.48501402", "0.48479396", "0.48438534", "0.4824014", "0.48164526", "0.4806554", "0.48005736", "0.47967038", "0.47962835", "0.47887594", "0.4775792", "0.47553828", "0.4754243", "0.47437277", "0.4740099", "0.4736555", "0.47364387", "0.4734792", "0.47300777", "0.47221172", "0.47169775", "0.46980864", "0.46979913", "0.46847478", "0.467914", "0.46784717", "0.46763137", "0.46686712", "0.46685904", "0.46629393", "0.46563172", "0.46536416", "0.4653328", "0.464334", "0.46359712", "0.4633618", "0.4626625", "0.46220568", "0.4619234", "0.4613058", "0.46113765", "0.46105012", "0.4609763", "0.46050966", "0.46040455", "0.46037456", "0.46016058", "0.45996505", "0.45990926", "0.4598724", "0.45964313", "0.45902592", "0.45899948", "0.45825174", "0.45791417", "0.4577865", "0.45715868", "0.45684648", "0.45616522", "0.45605806", "0.45521912", "0.45521304", "0.45517483", "0.45480242", "0.4540782", "0.45401508", "0.45382586", "0.45377374", "0.4537424", "0.4537391", "0.45372835", "0.45353758" ]
0.7190778
0
Method called when an object has been exported with var_export() functions It allows to return an object instantiated with the values
public static function __set_state(array $array) { return parent::__set_state($array); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function ExportObject() {\n // Init object\n $plugin = new stdClass();\n // Set values\n $plugin->Name = $this->Name;\n $plugin->Version = $this->Version;\n $plugin->Author = $this->Author;\n $plugin->About = $this->About;\n $plugin->Root = $this->Root;\n $plugin->Identifier = $this->Identifier;\n \n // Return result\n return $plugin;\n }", "protected function constructExportObject()\n\t{\n\t\t//default export is \"all public fields\"\n\t\treturn (object) Arrays::getPublicPropertiesOfObject($this);\n\t}", "function from_export($value) {\n return $value;\n }", "public function export(): mixed;", "public function ExportObject() {\n // Init object\n $col = new stdClass();\n \n // Set values\n $col->id = $this->Id;\n $col->type = $this->Type;\n $col->label = $this->Label;\n $col->p = $this->P;\n \n // Return values\n return $col;\n }", "public function exportData() {\n\t\treturn $this->constructExportObject();\n\t}", "public function toObject();", "function ctools_export_new_object($table, $set_defaults = TRUE) {\r\n $schema = ctools_export_get_schema($table);\r\n $export = $schema['export'];\r\n\r\n $object = new $export['object'];\r\n foreach ($schema['fields'] as $field => $info) {\r\n if (isset($info['object default'])) {\r\n $object->$field = $info['object default'];\r\n }\r\n else if (isset($info['default'])) {\r\n $object->$field = $info['default'];\r\n }\r\n else {\r\n $object->$field = NULL;\r\n }\r\n }\r\n\r\n if ($set_defaults) {\r\n // Set some defaults so this data always exists.\r\n // We don't set the export_type property here, as this object is not saved\r\n // yet. We do give it NULL so we don't generate notices trying to read it.\r\n $object->export_type = NULL;\r\n $object->{$export['export type string']} = t('Local');\r\n }\r\n return $object;\r\n}", "public function export();", "public function export();", "public function export();", "public function export();", "public function export();", "public function createExport();", "public function newInstance(): object;", "public static function createFromGlobals();", "public function export (){\n\n }", "function &object(object $value, string $namespace = 'default'): object\n{\n $var = new Variable\\ObjectVariable($value);\n Repository::add($var, $namespace);\n return $var->getValue();\n}", "public function getObj();", "public static function toObject(){\r\n $args = func_get_args();\r\n \r\n if(count($args) >=2){\r\n $className = '\\\\'.str_replace('.', '\\\\', $args[0]);\r\n $refClass = new \\ReflectionClass($className);\r\n $toObjInstance = $refClass->newInstance();\r\n\r\n unset($args[0]);\r\n \r\n foreach($args as $arg){\r\n \r\n if(is_object($arg)){\r\n $arg = Obj::getProperties($arg);\r\n }\r\n \r\n if(is_array($arg)){\r\n foreach($arg as $propertyName=>$propertyValue){\r\n if($refClass->hasProperty($propertyName)){\r\n $property = $refClass->getProperty($propertyName);\r\n $property->setAccessible(true);\r\n $property->setValue($toObjInstance, $propertyValue);\r\n }\r\n }\r\n }\r\n }\r\n return $toObjInstance;\r\n }\r\n }", "public function export()\n {\n }", "function &stdClass(stdClass $value, string $namespace = 'default'): stdClass\n{\n $var = new Variable\\StdClassVariable($value);\n Repository::add($var, $namespace);\n return $var->getValue();\n}", "public function getExportableValues() {\n\t\telgg_deprecated_notice(__METHOD__ . ' has been deprecated by toObject()', 1.9);\n\t\treturn array(\n\t\t\t'id',\n\t\t\t'entity_guid',\n\t\t\t'name',\n\t\t\t'value',\n\t\t\t'value_type',\n\t\t\t'owner_guid',\n\t\t\t'type',\n\t\t);\n\t}", "public function ExportObject() {\n // Init object\n $overviewChart = new stdClass();\n \n // Set values\n $overviewChart->Types = $this->Types;\n $overviewChart->Chart = $this->Chart->ExportObject();\n \n //return result\n return $overviewChart;\n }", "public function export()\n {\n \n }", "public function newInstance(): object\n {\n return $this->instantiator->instantiate($this->name);\n }", "public function getter () {\n return (object)[\n get_plugin_name => $this->plugin_name,\n get_plugin_version => $this->plugin_version,\n get_translation_slug => $this->translation_slug,\n get_admin_page_slug => $this->admin_page_slug,\n get_api_namespace => $this->api_namespace,\n get_options_name => $this->options_name\n ];\n }", "public function getObject() {}", "public function getObject() {}", "public function export()\n {\n //\n }", "function _instantiateExportDeployment($context) {\n\t\t$exportDeploymentClassName = $this->getExportDeploymentClassName();\n\t\t$this->import($exportDeploymentClassName);\n\t\t$exportDeployment = new $exportDeploymentClassName($context, $this);\n\t\treturn $exportDeployment;\n\t}", "function get_obj()\n {\n $object = new ApiRest;\n return $object;\n }", "public function newInstance();", "public function newInstance();", "public function __CONSTRUCT(){\n\t}", "public function getInstance(): object;", "public function exportedVars(): iterable;", "public static function fromGlobals() {}", "public function ExportObject() {\n // Init object\n $submission = new stdClass();\n \n // Set values\n $submission->Id = $this->Id;\n $submission->DateTime = $this->DateTime;\n $submission->GitHash = $this->GitHash;\n $submission->Categories = array();\n \n // Export each category\n foreach ($this->Categories as $category) {\n $submission->Categories[] = $category->ExportObject();\n }\n \n // return result\n return $submission;\n }", "public function getInstance(): object\n {\n }", "function ctools_get_default_object($table, $name) {\r\n $schema = ctools_export_get_schema($table);\r\n $export = $schema['export'];\r\n\r\n if (!$export['default hook']) {\r\n return;\r\n }\r\n\r\n // Try to load individually from cache if this cache is enabled.\r\n if (!empty($export['cache defaults'])) {\r\n $defaults = _ctools_export_get_some_defaults($table, $export, array($name));\r\n }\r\n else {\r\n $defaults = _ctools_export_get_defaults($table, $export);\r\n }\r\n\r\n $status = variable_get($export['status'], array());\r\n\r\n if (!isset($defaults[$name])) {\r\n return;\r\n }\r\n\r\n $object = $defaults[$name];\r\n\r\n // Determine if default object is enabled or disabled.\r\n if (isset($status[$object->{$export['key']}])) {\r\n $object->disabled = $status[$object->{$export['key']}];\r\n }\r\n\r\n $object->{$export['export type string']} = t('Default');\r\n $object->export_type = EXPORT_IN_CODE;\r\n $object->in_code_only = TRUE;\r\n\r\n return $object;\r\n}", "public function toStdClass() {\n $stdClass = new stdClass();\n $stdClass->number = $this->_number;\n $stdClass->internal = $this->_internal;\n return $stdClass;\n }", "public function getObject(): object;", "public function get_export_data()\n {\n\n $l_sql = \"SELECT isys_obj_type__id, isys_obj_type__title, isys_verinice_types__title, isys_verinice_types__const \" . \"FROM isys_obj_type \" . \"INNER JOIN isys_verinice_types ON isys_obj_type__isys_verinice_types__id = isys_verinice_types__id \";\n\n return $this->retrieve($l_sql);\n\n }", "public function dataProviderExport()\n {\n // Regular :\n $data = [\n [\n 'test string',\n var_export('test string', true),\n ],\n [\n 75,\n var_export(75, true),\n ],\n [\n 7.5,\n var_export(7.5, true),\n ],\n [\n null,\n 'null',\n ],\n [\n true,\n 'true',\n ],\n [\n false,\n 'false',\n ],\n [\n [],\n '[]',\n ],\n ];\n // Arrays :\n $var = [\n 'key1' => 'value1',\n 'key2' => 'value2',\n ];\n $expectedResult = <<<'RESULT'\n[\n 'key1' => 'value1',\n 'key2' => 'value2',\n]\nRESULT;\n $data[] = [$var, $expectedResult];\n $var = [\n 'value1',\n 'value2',\n ];\n $expectedResult = <<<'RESULT'\n[\n 'value1',\n 'value2',\n]\nRESULT;\n $data[] = [$var, $expectedResult];\n $var = [\n 'key1' => [\n 'subkey1' => 'value2',\n ],\n 'key2' => [\n 'subkey2' => 'value3',\n ],\n ];\n $expectedResult = <<<'RESULT'\n[\n 'key1' => [\n 'subkey1' => 'value2',\n ],\n 'key2' => [\n 'subkey2' => 'value3',\n ],\n]\nRESULT;\n $data[] = [$var, $expectedResult];\n // Objects :\n $var = new \\StdClass();\n $var->testField = 'Test Value';\n $expectedResult = \"unserialize('\" . serialize($var) . \"')\";\n $data[] = [$var, $expectedResult];\n $var = function () {return 2;};\n $expectedResult = 'function () {return 2;}';\n $data[] = [$var, $expectedResult];\n return $data;\n }", "public static function export()\n {\n return null;\n }", "function create()\n\t{\n\t\t$names = $this->_fields;\n\t\t$object = new StdClass;\n\t\tforeach ($names as $name)\n\t\t\t$object->$name = \"\";\n\t\treturn $object;\n\t}", "public function construct()\n {\n return $this->object;\n }", "public function metaExport($object = false);", "public function vars()\n {\n \n return new ArrayWrapper(get_object_vars($this->object));\n \n }", "public function getValuesObject()\n {\n $obj = new \\stdClass;\n\n foreach ( $this->keyValues as $key => $value )\n {\n $obj->$key = $value;\n }\n\n return $obj;\n }", "public function getObject();", "public function getObject();", "function newDataObject() {\n\t\t$ofrPlugin =& PluginRegistry::getPlugin('generic', $this->parentPluginName);\n\t\t$ofrPlugin->import('classes.ObjectForReviewPerson');\n\t\treturn new ObjectForReviewPerson();\n\t}", "public function __construct(VariableExportInterface $variableExport)\n {\n $this->serialized = $variableExport->toSerialize();\n }", "public function as_object($class = TRUE, $arguments = array());", "function var_export($expression, $return = false)\n{\n}", "function getObject();", "function getObject();", "abstract public function object();", "public function __construct()\r\n {\r\n $this->_internalObject = new stdClass();\r\n\t\t$a=serialize($this->_internalObject);\r\n\t\t\"echo $a<br>\";\r\n }", "abstract protected function createObject();", "function &getInstance($module_srl)\n\t{\n\t\treturn new ExtraVar($module_srl);\n\t}", "abstract function exportData();", "function createProduct($name,$price,$qty,$id):stdClass\n{\n$product=new stdClass();\n$product->name=$name;\n$product->price=$price;\n$product->quantity= $qty;\n$product->id=$id;\n\nreturn $product;\n}", "abstract protected function exportFunctions();", "public static function factory()\n {\n $class = get_called_class();\n $object = new $class();\n foreach (static::getDefaults() as $field => $value) {\n $object->{$field} = $value;\n }\n return $object;\n }", "public function &__invoke()\r\n\t{\r\n\t\t$result = new stdClass();\r\n\t\tAdhoc::eachTrap('Registry',\r\n\t\t\tfunction ($trap) use (&$result)\r\n\t\t\t{\r\n\t\t\t\t$data =& $trap->GetList();\r\n\t\t\t\tforeach ($data as $k=>$v)\r\n\t\t\t\t{\r\n\t\t\t\t\tif (!isset($result->$k) and isset($v))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$result->$k = $v;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t);\r\n\t\t\r\n\t\treturn $result;\r\n\t}", "public static function instantation($the_record){\n\n // can be used to retrieve a string with the name of the called class and static:: introduces its scope.\n $calling_class = get_called_class();\n\n $the_object = new $calling_class;\n\n\n // doing a loop to get all of the values in the object ]\n foreach($the_record as $key => $value) {\n\n if($the_object->has_the_key($key)){\n $the_object->$key = $value;\n \n }\n }\n\n return $the_object;\n }", "public static function get_object() {\n\t\treturn self::$object;\n\t}", "function adminer_object() {\r\n include_once \"./plugins/plugin.php\";\r\n \r\n // autoloader\r\n foreach (glob(\"plugins/*.php\") as $filename) {\r\n include_once \"./$filename\";\r\n }\r\n \r\n $plugins = array(\r\n // specify enabled plugins here\r\n // new AdminerDumpXml,\r\n // new AdminerTinymce,\r\n // new AdminerFileUpload(\"data/\"),\r\n // new AdminerSlugify,\r\n // new AdminerTranslation,\r\n // new AdminerForeignSystem,\r\n // new AdminerLoginPasswordLess(password_hash(\"\", PASSWORD_DEFAULT)),\r\n );\r\n \r\n /* It is possible to combine customization and plugins:\r\n class AdminerCustomization extends AdminerPlugin {\r\n }\r\n return new AdminerCustomization($plugins);\r\n */\r\n class AdminerCustomization extends AdminerPlugin {\r\n function login($login, $password) {\r\n // validate user submitted credentials\r\n return true;\r\n }\r\n }\r\n return new AdminerCustomization($plugins);\r\n \r\n // return new AdminerPlugin($plugins);\r\n}", "public function ExportItem() {\n // Init object\n $submission = new stdClass();\n \n // Set values\n $submission->Id = $this->Id;\n $submission->DateTime = $this->DateTime;\n $submission->ImportDateTime = $this->ImportDateTime;\n $submission->User = $this->User;\n $submission->Good = $this->Good;\n $submission->Bad = $this->Bad;\n $submission->Strange = $this->Strange;\n $submission->GitHash = $this->GitHash;\n $submission->SequenceNumber = $this->SequenceNumber;\n \n // Return result\n return $submission;\n }", "private static function _instantiateThisObject() {\r\n $className = get_called_class();\r\n return new $className();\r\n }", "function instance($obj) {\n\tif (is_string($obj)) {\n\t\t$obj = new $obj;\n\t}\n\treturn $obj;\n}", "function ctools_var_export($var, $prefix = '') {\r\n if (is_array($var)) {\r\n if (empty($var)) {\r\n $output = 'array()';\r\n }\r\n else {\r\n $output = \"array(\\n\";\r\n foreach ($var as $key => $value) {\r\n $output .= $prefix . \" \" . ctools_var_export($key) . \" => \" . ctools_var_export($value, $prefix . ' ') . \",\\n\";\r\n }\r\n $output .= $prefix . ')';\r\n }\r\n }\r\n else if (is_object($var) && get_class($var) === 'stdClass') {\r\n // var_export() will export stdClass objects using an undefined\r\n // magic method __set_state() leaving the export broken. This\r\n // workaround avoids this by casting the object as an array for\r\n // export and casting it back to an object when evaluated.\r\n $output = '(object) ' . ctools_var_export((array) $var, $prefix);\r\n }\r\n else if (is_bool($var)) {\r\n $output = $var ? 'TRUE' : 'FALSE';\r\n }\r\n else {\r\n $output = var_export($var, TRUE);\r\n }\r\n\r\n return $output;\r\n}", "public function getOutputObject()\n {\n $baseObject = parent::getOutputObject();\n $baseObject->name = $this->getName();\n\n return $baseObject;\n }", "public function init_objects() {\n $this->controller_oai = new \\Tainacan\\OAIPMHExpose\\OAIPMH_Expose();\n $this->list_sets = new \\Tainacan\\OAIPMHExpose\\OAIPMH_List_Sets();\n $this->list_metadata_formats = new \\Tainacan\\OAIPMHExpose\\OAIPMH_List_Metadata_Formats();\n $this->list_records = new \\Tainacan\\OAIPMHExpose\\OAIPMH_List_Records();\n $this->get_record = new \\Tainacan\\OAIPMHExpose\\OAIPMH_Get_Record();\n $this->identify = new \\Tainacan\\OAIPMHExpose\\OAIPMH_Identify();\n $this->identifiers = new \\Tainacan\\OAIPMHExpose\\OAIPMH_List_Identifiers();\n }", "public function _construct(){\n\t\treturn $this->data;\n\t}", "public function _construct(){\n\t\treturn $this->data;\n\t}", "public function regularNew() {}", "public function newInstance()\n {\n return $this->newInstanceArgs(func_get_args());\n }", "function data2Object($data) { \n\t\t\t$class_object = new getData($data); \n\t\t\treturn $class_object; \n\t\t}", "function _construct(){ }", "function ctools_export_object($table, $object, $indent = '', $identifier = NULL, $additions = array(), $additions2 = array()) {\r\n $schema = ctools_export_get_schema($table);\r\n if (!isset($identifier)) {\r\n $identifier = $schema['export']['identifier'];\r\n }\r\n\r\n $output = $indent . '$' . $identifier . ' = new ' . get_class($object) . \"();\\n\";\r\n\r\n if ($schema['export']['can disable']) {\r\n $output .= $indent . '$' . $identifier . '->disabled = FALSE; /* Edit this to true to make a default ' . $identifier . ' disabled initially */' . \"\\n\";\r\n }\r\n if (!empty($schema['export']['api']['current_version'])) {\r\n $output .= $indent . '$' . $identifier . '->api_version = ' . $schema['export']['api']['current_version'] . \";\\n\";\r\n }\r\n\r\n // Put top additions here:\r\n foreach ($additions as $field => $value) {\r\n $output .= $indent . '$' . $identifier . '->' . $field . ' = ' . ctools_var_export($value, $indent) . \";\\n\";\r\n }\r\n\r\n $fields = $schema['fields'];\r\n if (!empty($schema['join'])) {\r\n foreach ($schema['join'] as $join) {\r\n if (!empty($join['load'])) {\r\n foreach ($join['load'] as $join_field) {\r\n $fields[$join_field] = $join['fields'][$join_field];\r\n }\r\n }\r\n }\r\n }\r\n\r\n // Go through our schema and joined tables and build correlations.\r\n foreach ($fields as $field => $info) {\r\n if (!empty($info['no export'])) {\r\n continue;\r\n }\r\n if (!isset($object->$field)) {\r\n if (isset($info['default'])) {\r\n $object->$field = $info['default'];\r\n }\r\n else {\r\n $object->$field = '';\r\n }\r\n }\r\n\r\n // Note: This is the *field* export callback, not the table one!\r\n if (!empty($info['export callback']) && function_exists($info['export callback'])) {\r\n $output .= $indent . '$' . $identifier . '->' . $field . ' = ' . $info['export callback']($object, $field, $object->$field, $indent) . \";\\n\";\r\n }\r\n else {\r\n $value = $object->$field;\r\n if ($info['type'] == 'int') {\r\n if (isset($info['size']) && $info['size'] == 'tiny') {\r\n $info['boolean'] = (!isset($info['boolean'])) ? $schema['export']['boolean'] : $info['boolean'];\r\n $value = ($info['boolean']) ? (bool) $value : (int) $value;\r\n }\r\n else {\r\n $value = (int) $value;\r\n }\r\n }\r\n\r\n $output .= $indent . '$' . $identifier . '->' . $field . ' = ' . ctools_var_export($value, $indent) . \";\\n\";\r\n }\r\n }\r\n\r\n // And bottom additions here\r\n foreach ($additions2 as $field => $value) {\r\n $output .= $indent . '$' . $identifier . '->' . $field . ' = ' . ctools_var_export($value, $indent) . \";\\n\";\r\n }\r\n\r\n return $output;\r\n}", "public function createValidObject() : object {\n\t\treturn (object) [\"tweetContent\" => bin2hex(random_bytes(12))];\n\t}", "public function _init_obj()\n {\n // dummy\n }", "protected function make_object( \\stdClass $data ) {\n\t\treturn new Purchase( $data );\n\t}", "public function as_object()\n {\n $this->return_as = 'object';\n return $this;\n }", "static public function fromObj($anObj) {\n\t\t$theClassName = get_called_class();\n\t\t$o = new $theClassName();\n\t\treturn $o->setDataFrom($anObj);\n\t}", "function adminer_object() {\n\t\tinclude_once \"plugins/plugin.php\";\n\t\t// autoloader\n\t\tforeach (glob(\"plugins/*.php\") as $filename) {\n\t\t\tinclude_once $filename;\n\t\t}\n\t\t$plugins = array(\n\t\t\t// specify enabled plugins here\n\t\t\tnew AdminerDatabaseHide(array('information_schema', 'mysql', 'performance_schema')),\n\t\t\t//new AdminerDumpJson,\n\t\t\t//new AdminerDumpBz2,\n\t\t\t//new AdminerDumpZip,\n\t\t\t//new AdminerDumpXml,\n\t\t\t//new AdminerDumpAlter,\n\t\t\t//~ new AdminerSqlLog(\"past-\" . rtrim(`git describe --tags --abbrev=0`) . \".sql\"),\n\t\t\t//new AdminerFileUpload(\"\"),\n\t\t\t//new AdminerJsonColumn,\n\t\t\t//new AdminerSlugify,\n\t\t\t//new AdminerTranslation,\n\t\t\t//new AdminerForeignSystem,\n\t\t\t//new AdminerEnumOption,\n\t\t\t//new AdminerTablesFilter,\n\t\t\t//new AdminerEditForeign,\n\t\t);\n\n\t\treturn new AdminerPlugin($plugins);\n\t}", "public function newCObj() {}", "private function PREPARE_OBJECT_VARIABLE_METHOD()\r\r {\r\r if($this->_type === 'POST')\r\r {\r\r foreach($this->_fields as $key=>$field)\r\r {\r\r $this->_object[$key]['VALUE'] = isset($_POST[$key])?$_POST[$key]:false;\r\r } \r\r } \r\r else if($this->_type === 'GET')\r\r {\r\r foreach($this->_fields as $key=>$field)\r\r {\r\r $this->_object[$key]['VALUE'] = isset($_GET[$key])?$_GET[$key]:false;\r\r } \r\r } \r\r }", "public function toStdClass() {\n $stdClass = new stdClass();\n $stdClass->amountInsuranceBase = $this->_amountInsuranceBase;\n $stdClass->fragile = $this->_fragile;\n $stdClass->parcelsCount = $this->_parcelsCount;\n $stdClass->serviceTypeId = $this->_serviceTypeId;\n return $stdClass;\n }", "public function toStdClass() {\n $stdClass = new stdClass();\n $stdClass->billOfLading = $this->_billOfLading;\n $stdClass->secondaryPickingType = $this->_secondaryPickingType;\n return $stdClass;\n }", "abstract public function prepare_new_object(array $args);", "protected function getRealScriptUserObj() {}", "public function export(bool $private = FALSE, bool $meta = FALSE) {\n\t\t$keys = [];\n\t\t$ret = [];\n\n\t\tif ($private) {\n\t\t\t$keys = static::$PRIVATE;\n\t\t} else {\n\t\t\t$keys = static::$PUBLIC;\n\t\t}\n\n\t\tif (!empty(array_intersect(EXP_RESERVED, $keys))) {\n\t\t\tthrow new ExportableException(\n\t\t\t\t\"Reserved key '\".EXP_CLASSNAME.\"' used in object.\"\n\t\t\t);\n\t\t}\n\n\t\tif ($meta) { // Add metadata.\n\t\t\t$ret[EXP_CLASSNAME] = get_class($this);\n\t\t\t$ret[EXP_VISIBILITY] = $private ? 'private' : 'public';\n\t\t}\n\n\t\tforeach ($keys as $k) {\n\t\t\t$current = $this->__exportable_get($k);\n\t\t\tswitch (gettype($current)) {\n\t\t\t\tcase 'object':\n\t\t\t\t\t$ret[$k] = $this->exp_obj(\n\t\t\t\t\t\t$current, $private, $meta\n\t\t\t\t\t);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'array':\n\t\t\t\t\t$ret[$k] = $this->exp_array(\n\t\t\t\t\t\t$current, $private, $meta\n\t\t\t\t\t);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\t$ret[$k] = $current;\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn $ret;\n\t}", "public static function & GetInstance ();", "public function getInstance(): mixed;", "public function convertToUserIntObject() {}", "function FetchObj() {}" ]
[ "0.6951056", "0.69235533", "0.6576406", "0.6377145", "0.61438453", "0.6123597", "0.60555947", "0.60385406", "0.5922576", "0.5922576", "0.5922576", "0.5922576", "0.5922576", "0.5859328", "0.58386916", "0.58126146", "0.5800945", "0.5715804", "0.571534", "0.5712997", "0.5688761", "0.5658427", "0.5640244", "0.56017965", "0.5525057", "0.5512275", "0.54624516", "0.54065686", "0.54065686", "0.5402593", "0.53759634", "0.5372155", "0.5371501", "0.5371501", "0.53698903", "0.5342519", "0.5334929", "0.5315758", "0.5307627", "0.5297458", "0.5262869", "0.5260146", "0.5248292", "0.5244241", "0.52275795", "0.51874787", "0.51795346", "0.5150348", "0.5141145", "0.513255", "0.5131906", "0.5117587", "0.5117587", "0.5117466", "0.5112706", "0.51077455", "0.50988156", "0.50935", "0.50935", "0.5078365", "0.50393796", "0.50392556", "0.5032243", "0.500829", "0.500578", "0.50021815", "0.49989748", "0.4986421", "0.4985877", "0.49773422", "0.49751663", "0.49675283", "0.4957486", "0.49566287", "0.49518955", "0.49497175", "0.49412116", "0.49269983", "0.49269983", "0.4919096", "0.4918042", "0.49162993", "0.4907476", "0.49073106", "0.48962304", "0.48928276", "0.4889555", "0.48821777", "0.48817694", "0.4876133", "0.48756412", "0.48639464", "0.48624778", "0.48621023", "0.48483175", "0.4845858", "0.48404086", "0.48386553", "0.48385635", "0.48351642", "0.4834503" ]
0.0
-1
Method returning the class name
public function __toString() { return __CLASS__; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getClassName();", "public function getClassName();", "public function getClassName() ;", "public function getClassName() {}", "public function getClassName() {}", "public function getClassName() {}", "public function getClassName() {}", "public function getClassName()\n {\n return __CLASS__;;\n }", "private function get_class_name() {\n\t\t\treturn !is_null($this->class_name) ? $this->class_name : get_class($this);\n\t\t}", "public function getClassName() {\r\n\t\treturn($this->class_name);\r\n\t}", "public static function get_class_name() {\r\n\t\treturn __CLASS__;\r\n\t}", "public function getClassName() { return __CLASS__; }", "public static function getClassName() {\n\t\treturn get_called_class();\n\t}", "public function getClassName(): string\n {\n return $this->get(self::CLASS_NAME);\n }", "public static function getClassName()\n\t{\n\t\treturn get_called_class();\n\t}", "public static function getClassName()\n {\n return get_called_class();\n }", "public function getClassName()\n {\n return $this->class;\n }", "public function getClassName()\n {\n return $this->class;\n }", "public static function className() : string {\n return get_called_class();\n }", "public function getName()\n {\n return __CLASS__;\n }", "public function getName()\n\t{\n\t\treturn str_replace('\\\\', '_', __CLASS__);\n\t}", "public function getClassName()\n {\n return $this->class_name;\n }", "public function class_name() {\n\t\treturn strtolower(get_class($this));\n\t}", "public function getName(): string\n {\n return __CLASS__;\n }", "public static function getClassName() {\n return get_called_class();\n }", "public function getClassname(){\n\t\treturn $this->classname;\n\t}", "public function getClassname()\n\t{\n\t\treturn $this->classname;\n\t}", "public function getClassName()\n {\n return $this->_sClass;\n }", "public function get_just_class_name() {\n\n\t\t$full_path = $this->get_called_class();\n\n\t\treturn substr( strrchr( $full_path, '\\\\' ), 1 );\n\n\t}", "protected function getClassName(): string\n {\n return $this->className;\n }", "public static function getClassName() {\n return self::$className;\n }", "public function getClassName(): string;", "public function getClassName() : string;", "public function getName() {\r\n $parsed = Parser::parseClassName(get_class());\r\n return $parsed['className'];\r\n }", "public function getClassName() : string\n {\n return $this->className;\n }", "public function getClassName()\n {\n $fullClass = get_called_class();\n $exploded = explode('\\\\', $fullClass);\n\n return end($exploded);\n }", "public static function getClassName()\n {\n $classNameArray = explode('\\\\', get_called_class());\n\n return array_pop($classNameArray);\n }", "public function getClassName(): string\n {\n return $this->className;\n }", "public function getClassName(): string\n {\n return $this->className;\n }", "public function getClassName() {\t\t\n\t\treturn MemberHelper::getClassName($this->classNumber);\n\t}", "public function getName()\n\t{\n\t\treturn substr(__CLASS__, 7);\n\t}", "public function getName()\n\t{\n\t\treturn substr(__CLASS__, 7);\n\t}", "public function getClassName() {\r\n\t\treturn $this->strClassName;\r\n\t}", "public function getClassName() : string\n {\n\n return $this->className;\n }", "public function getClassName()\n {\n return $this->className;\n }", "public function getClassName()\n {\n return $this->className;\n }", "public function getClassName()\n {\n return $this->className;\n }", "public function getClassName()\n {\n return $this->className;\n }", "public function getClassName()\n {\n return $this->className;\n }", "public function getClassName()\n {\n return $this->className;\n }", "public function getClassName()\n {\n return $this->className;\n }", "public function getClassName()\n {\n return $this->className;\n }", "public static function staticGetClassName()\n {\n return __CLASS__;\n }", "public function getClassName() {\n return $this->className;\n }", "public function getClassName() {\n\t\treturn $this->className;\n\t}", "public function getClassName(): string\n {\n return $this->makeClassFromFilename($this->filename);\n }", "public function getClassName() {\n\t\treturn $this->_className;\n\t}", "public function getClassName() {\n return $this->className;\n }", "public function getClassName() {\n return $this->className;\n }", "public function getClassName ()\n {\n $className = explode('\\\\', get_class($this));\n\n return array_pop($className);\n }", "function getClassName()\n {\n // TODO: Implement getClassName() method.\n }", "public static function getClassName(){\n $parts = explode('\\\\', static::class);\n return end($parts);\n }", "function getClassName(){\n echo __CLASS__ . \"<br><br>\"; \n }", "public function name()\n {\n $name = get_class($this);\n\n return substr($name, strrpos($name, '\\\\') + 1);\n }", "public function class()\n {\n // @codingStandardsIgnoreLine\n return $this->class ?? \"\";\n }", "public function getClass()\n {\n return $this->_className;\n }", "private function getClassName() {\n return (new \\ReflectionClass(static::class))->getShortName();\n }", "public function getName() {\n\t\t\n\t\t// cut last part of class name\n\t\treturn substr( get_class( $this ), 0, -11 );\n\t\t\n\t}", "public function getClassNm()\r\n {\r\n\t\t$tabInfo = $this->getPathInfo();\r\n\t\treturn $tabInfo[1];\r\n }", "public function className()\n {\n $full_path = explode('\\\\', get_called_class());\n return end($full_path);\n }", "private function className () {\n $namespacedClass = explode(\"\\\\\", get_class($this));\n\n return end($namespacedClass);\n }", "public function getClass(): string\n {\n return $this->class;\n }", "public static function getFullyQualifiedClassName() {\n $reflector = new \\ReflectionClass(get_called_class());\n return $reflector->getName();\n }", "public function getClassName()\n\t{\n\t\tif (null === $this->_className) {\n\t\t\t$this->setClassName(get_class($this));\n\t\t}\n\t\t\n\t\treturn $this->_className;\n\t}", "public function getClassName() : string {\n if ($this->getType() != Router::CLOSURE_ROUTE) {\n $path = $this->getRouteTo();\n $pathExplode = explode(DS, $path);\n\n if (count($pathExplode) >= 1) {\n $fileNameExplode = explode('.', $pathExplode[count($pathExplode) - 1]);\n\n if (count($fileNameExplode) == 2 && $fileNameExplode[1] == 'php') {\n return $fileNameExplode[0];\n }\n }\n }\n\n return '';\n }", "public function getName(){\n\t\treturn get_class($this);\n\t}", "public function getClassName() {\r\n return $this->myCRUD()->getClassName();\r\n }", "public static function className()\n\t{\n\t\treturn static::class;\n\t}", "public function toClassName(): string\n {\n return ClassName::full($this->name);\n }", "public function getName()\n {\n return static::CLASS;\n }", "public function getClass(): string;", "public function getClass(): string;", "public function getClass(): string;", "public function getClass(): string;", "public function getClass(): string;", "public function getClass(): string;", "function getName()\n {\n return get_class($this);\n }", "public function className(): string\n {\n return $this->taskClass->name();\n }", "public static function getClassName($class)\n {\n return static::splitClassName($class)[1];\n }", "function getName()\r\n\t{\r\n\t\treturn get_class($this);\r\n\t}", "public function getName() {\n return get_class($this);\n }", "public function getName() {\n return get_class($this);\n }", "public function toString()\n {\n return __CLASS__;\n }", "public function getName()\n\t{\n\t\treturn $this->name ?: class_basename($this);\n\t}", "public function getNamespacedName()\n {\n return get_class();\n }", "protected function name() {\n\t\treturn strtolower(str_replace('\\\\', '_', get_class($this)));\n\t}", "protected function getClassName()\n {\n return ucwords(camel_case($this->getNameInput())) . 'TableSeeder';\n }", "function getClassName($name)\n{\n return str_replace('_', ' ', snake_case(class_basename($name)));\n}", "public function getClassName(): ?string {\n\t\treturn Hash::get($this->_config, 'className');\n\t}", "public function __toString() {\n\t\treturn $this->className();\n\t}", "public static function name()\n {\n return lcfirst(self::getClassShortName());\n }" ]
[ "0.87522393", "0.87522393", "0.8751158", "0.87397957", "0.87397957", "0.87397957", "0.87397957", "0.8731564", "0.8696754", "0.8673495", "0.8638432", "0.8615335", "0.8603119", "0.8566906", "0.8562364", "0.8555002", "0.85503733", "0.85503733", "0.85425884", "0.8533183", "0.8529981", "0.85237026", "0.8502733", "0.8493115", "0.8491238", "0.8488943", "0.8484194", "0.847459", "0.8441478", "0.8418852", "0.8399611", "0.83950585", "0.83949184", "0.83853173", "0.8378261", "0.837777", "0.8372544", "0.8355432", "0.8355432", "0.83479965", "0.8325877", "0.8325877", "0.8312873", "0.83027107", "0.8272631", "0.8272631", "0.8272631", "0.8272631", "0.8272631", "0.8272631", "0.8272631", "0.8272631", "0.82474744", "0.8242934", "0.8202995", "0.8185409", "0.8184752", "0.81829107", "0.81829107", "0.8176191", "0.81761754", "0.8162896", "0.8142928", "0.81323636", "0.8062757", "0.80528253", "0.8045769", "0.8033823", "0.8026215", "0.8001116", "0.79949147", "0.79779136", "0.79672754", "0.7957633", "0.790449", "0.78617185", "0.7860126", "0.7847096", "0.78195953", "0.7817044", "0.780094", "0.780094", "0.780094", "0.780094", "0.780094", "0.780094", "0.77821547", "0.7761565", "0.77588034", "0.7747239", "0.77409905", "0.77409905", "0.7710985", "0.76808393", "0.7670475", "0.76640886", "0.76514393", "0.76499707", "0.76323646", "0.76005036", "0.75937456" ]
0.0
-1
Resize hinh imagejpeg ( resize ( $dir_upload . $small_image, 280,240,$dir_upload."add_img.png","b"), $dir_upload. $small_image );
function resize($image,$x,$y=NULL,$wm=NULL,$wml='br'){ if(!file_exists($image)){ return false; } $images = array(); if($wm !== '' && $wm !== NULL && file_exists($wm)){ $images['wmimg'] = $wm; } $images['img'] = $image; foreach($images as $key=>$value){ $type = substr($value,strrpos($value,'.')); if(stristr($type,'i')){ $$key = imagecreatefromgif($value); } if(stristr($type,'j')){ $$key = imagecreatefromjpeg($value); } if(stristr($type,'n')){ $$key = imagecreatefrompng($value); } } $size = array(); if($y === '' || $y === NULL){ $size['x'] = imageSX($img); $size['y'] = imageSY($img); if($size['x'] >= $size['y']){ $size['dest_x'] = $x; $size['dest_y'] = ceil($size['y'] * ($x / $size['x'])); }else{ $size['dest_y'] = $x; $size['dest_x'] = ceil($size['x'] * ($x / $size['y'])); } $dest = imageCreatetruecolor($size['dest_x'],$size['dest_y']); }else{ $dest = imagecreatetrueColor($x,$y); $size['x'] = imageSX($img); $size['y'] = imageSY($img); $size['dest_x'] = $x; $size['dest_y'] = $y; } imagecopyresized($dest, $img, 0, 0, 0, 0, $size['dest_x'], $size['dest_y'], $size['x'], $size['y']); if(isset($wmimg)){ $size['wmx'] = imageSX($wmimg); $size['wmy'] = imageSY($wmimg); $size['wmh'] = strtolower($wml{0}) === 'b' ? ($size['dest_y'] - $size['wmy'] - 0) : 0; $size['wmw'] = strtolower($wml{1}) === 'r' ? ($size['dest_x'] - $size['wmx'] - 0) : 0; imagecopy($dest, $wmimg, $size['wmw'], $size['wmh'], 0, 0, $size['wmx'], $size['wmy']); imagedestroy($wmimg); } imagedestroy($img); return $dest; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function resize( $jpg ) {\n\t$im = @imagecreatefromjpeg( $jpg );\n\t$filename = $jpg;\n\t$percent = 0.5;\n\tlist( $width, $height ) = getimagesize( $filename );\n\tif ( $uploader_name == \"c_master_imgs\" ):\n\t\t$new_width = $width;\n\t$new_height = $height;\n\telse :\n\t\tif ( $width > 699 ): $new_width = 699;\n\t$percent = 699 / $width;\n\t$new_height = $height * $percent;\n\telse :\n\t\t$new_width = $width;\n\t$new_height = $height;\n\tendif;\n\tendif; // end if measter images do not resize\n\t//if ( $new_height>600){ $new_height = 600; }\n\t$im = imagecreatetruecolor( $new_width, $new_height );\n\t$image = imagecreatefromjpeg( $filename );\n\timagecopyresampled( $im, $image, 0, 0, 0, 0, $new_width, $new_height, $width, $height );\n\t@imagejpeg( $im, $jpg, 80 );\n\t@imagedestroy( $im );\n}", "function img_resize( $tmpname, $size, $save_dir, $save_name )\r\n {\r\n $save_dir .= ( substr($save_dir,-1) != \"/\") ? \"/\" : \"\";\r\n $gis = GetImageSize($tmpname);\r\n $type = $gis[2];\r\n switch($type)\r\n {\r\n case \"1\": $imorig = imagecreatefromgif($tmpname); break;\r\n case \"2\": $imorig = imagecreatefromjpeg($tmpname);break;\r\n case \"3\": $imorig = imagecreatefrompng($tmpname); break;\r\n default: $imorig = imagecreatefromjpeg($tmpname);\r\n }\r\n\r\n $x = imageSX($imorig);\r\n $y = imageSY($imorig);\r\n if($gis[0] <= $size)\r\n {\r\n $av = $x;\r\n $ah = $y;\r\n }\r\n else\r\n {\r\n $yc = $y*1.3333333;\r\n $d = $x>$yc?$x:$yc;\r\n $c = $d>$size ? $size/$d : $size;\r\n $av = $x*$c; \r\n $ah = $y*$c; \r\n } \r\n $im = imagecreate($av, $ah);\r\n $im = imagecreatetruecolor($av,$ah);\r\n if (imagecopyresampled($im,$imorig , 0,0,0,0,$av,$ah,$x,$y))\r\n if (imagejpeg($im, $save_dir.$save_name))\r\n\t\t return true;\r\n else\r\n return false;\r\n }", "function imgResize($filename, $newWidth, $newHeight, $dir_out){\n\t\n\t// изменение размера изображения\n\n\t// 1 создадим новое изображение из файла\n\t$scr = imagecreatefromjpeg($filename); // или $imagePath\n\t\n\t// 2 создадим новое полноцветное изображение нужного размера\n\t$newImg = imagecreatetruecolor($newWidth, $newHeight);\n\n\t// 3 определим размер исходного изображения для 4 пункта\n\t$size = getimagesize($filename);\n\n\t// 4 копирует прямоугольную часть одного изображения на другое изображение, интерполируя значения пикселов таким образом, чтобы уменьшение размера изображения не уменьшало его чёткости\n\timagecopyresampled($newImg, $scr, 0, 0, 0, 0, $newWidth, $newHeight, $size[0], $size[1]);\n\n\t// 5 запишем изображение в файл по нужному пути\n\timagejpeg($newImg, $dir_out);\n\n\timagedestroy($scr);\n\timagedestroy($newImg);\t\t\n\t\n}", "function imgResize_gallery($file_ori,$UploadPath,$Resize=1,$imgx=130,$imgy=150,$clean=0,$allowedFormat=array('image/*'),$Maxfilesize=2097152,$filename_body='')\t{\n\t\t$dest_filename='';\n\t\t\n\t\t$handle = new upload($file_ori);\n\t\t$handle->allowed = $allowedFormat;\n\t\t$handle->file_max_size = $Maxfilesize;\n\t\t$img_proper=getimagesize($file_ori['tmp_name']);\n\t\t\n\t\tif($filename_body!='')\n\t\t\t$handle->file_name_body_add = $filename_body;\n\t\t\n\t\tif ($handle->uploaded) {\n\t\t\tif((($img_proper[0]>$imgx && $img_proper[1]>$imgy) || ($img_proper[0]>$imgx && $img_proper[1]<$imgy)) && $Resize==1)\t{\n\t\t\t\t$handle->image_x = $imgx;\n\t\t\t\t$handle->image_resize = true;\n\t\t\t\t$handle->image_ratio_y = true;\n\t\t\t\t$handle->dir_auto_create = true;\n\t\t\t\t$handle->dir_auto_chmod = true;\n\t\t\t\t$handle->dir_chmod = 0777;\n\t\t\t} else if($img_proper[0]<$imgx && $img_proper[1]>$imgy && $Resize==1)\t{\n\t\t\t\t$handle->image_y = $imgy;\n\t\t\t\t$handle->image_resize = true;\n\t\t\t\t$handle->image_ratio_x = true;\n\t\t\t\t$handle->dir_auto_create = true;\n\t\t\t\t$handle->dir_auto_chmod = true;\n\t\t\t\t$handle->dir_chmod = 0777;\n\t\t\t}\n\t\t\t$handle->process($UploadPath);\n\t\t\tif ($handle->processed) {\n\t\t\t\t$dest_filename=$handle->file_dst_name;\n\t\t\t\tif($clean==1)\n\t\t\t\t\t$handle->clean();\n\t\t\t} else\n\t\t\t\t$dest_filename='';\n\t\t}\n\t\treturn $dest_filename;\n\t}", "function imgResize($file_ori,$UploadPath,$Resize=1,$imgx=130,$imgy=150,$clean=0,$postFix=\"\") {\n\t\t$dest_filename='';\n\t\t$handle = new upload($file_ori);\n\t\t$img_proper=getimagesize($file_ori['tmp_name']);\n\t\tif ($handle->uploaded) {\n\t\t\tif($img_proper[0]>$imgx && $img_proper[1]>$imgy && $Resize==1)\t{\n\t\t\t\t$handle->image_x = $imgx;\n\t\t\t\t$handle->image_y = $imgy;\n\t\t\t\t$handle->image_resize = true;\n\t\t\t\t$handle->image_ratio_y = true;\n\t\t\t\t$handle->image_ratio_x = true;\n\t\t\t\t$handle->dir_auto_create = true;\n\t\t\t\t$handle->dir_auto_chmod = true;\n\t\t\t\t$handle->dir_chmod = 0777;\n\t\t\t} else if($img_proper[0]>$imgx && $img_proper[1]<$imgy && $Resize==1)\t{\n\t\t\t\t$handle->image_x = $imgx;\n\t\t\t\t$handle->image_resize = true;\n\t\t\t\t$handle->image_ratio_y = true;\n\t\t\t\t$handle->dir_auto_create = true;\n\t\t\t\t$handle->dir_auto_chmod = true;\n\t\t\t\t$handle->dir_chmod = 0777;\n\t\t\t} else if($img_proper[0]<$imgx && $img_proper[1]>$imgy && $Resize==1)\t{\n\t\t\t\t$handle->image_y = $imgy;\n\t\t\t\t$handle->image_resize = true;\n\t\t\t\t$handle->image_ratio_x = true;\n\t\t\t\t$handle->dir_auto_create = true;\n\t\t\t\t$handle->dir_auto_chmod = true;\n\t\t\t\t$handle->dir_chmod = 0777;\n\t\t\t}\n\t\t\t$handle->file_name_body_add = $postFix;\n\t\t\t$handle->process($UploadPath);\n\t\t\tif ($handle->processed) {\n\t\t\t\t$dest_filename=$handle->file_dst_name;\n\t\t\t\tif($clean==1)\n\t\t\t\t\t$handle->clean();\n\t\t\t} else\n\t\t\t\t$dest_filename='';\n\t\t}\n\t\treturn $dest_filename;\n\t}", "function image_resize($filename){\n\t\t$width = 1000;\n\t\t$height = 500;\n\t\t$save_file_location = $filename;\n\t\t// File type\n\t\t//header('Content-Type: image/jpg');\n\t\t$source_properties = getimagesize($filename);\n\t\t$image_type = $source_properties[2];\n\n\t\t// Get new dimensions\n\t\tlist($width_orig, $height_orig) = getimagesize($filename);\n\n\t\t$ratio_orig = $width_orig/$height_orig;\n\t\tif ($width/$height > $ratio_orig) {\n\t\t\t$width = $height*$ratio_orig;\n\t\t} else {\n\t\t\t$height = $width/$ratio_orig;\n\t\t}\n\t\t// Resampling the image \n\t\t$image_p = imagecreatetruecolor($width, $height);\n\t\tif( $image_type == IMAGETYPE_JPEG ) {\n\t\t\t$image = imagecreatefromjpeg($filename);\n\t\t}else if($image_type == IMAGETYPE_GIF){\n\t\t\t$image = imagecreatefromgif($filename);\n\t\t}else if($image_type == IMAGETYPE_PNG){\n\t\t\t$image = imagecreatefrompng($filename);\n\t\t}\n\t\t$finalIMG = imagecopyresampled($image_p, $image, 0, 0, 0, 0,\n\t\t$width, $height, $width_orig, $height_orig);\n\t\t// Display of output image\n\n\t\tif( $image_type == IMAGETYPE_JPEG ) {\n\t\t\timagejpeg($image_p, $save_file_location);\n\t\t}else if($image_type == IMAGETYPE_GIF){\n\t\t\timagegif($image_p, $save_file_location);\n\t\t}else if($image_type == IMAGETYPE_PNG){\n\t\t\t$imagepng = imagepng($image_p, $save_file_location);\n\t\t}\n\t}", "function resizeImage($fileName,$maxWidth,$maxHight,$originalFileSufix=\"\")\n{\n $limitedext = array(\".gif\",\".jpg\",\".png\",\".jpeg\");\n\n //check the file's extension\n $ext = strrchr($fileName,'.');\n $ext = strtolower($ext);\n\n //uh-oh! the file extension is not allowed!\n if (!in_array($ext,$limitedext)) {\n exit();\n }\n\n if($ext== \".jpeg\" || $ext == \".jpg\"){\n $new_img = imagecreatefromjpeg($fileName);\n }elseif($ext == \".png\" ){\n $new_img = imagecreatefrompng($fileName);\n }elseif($ext == \".gif\"){\n $new_img = imagecreatefromgif($fileName);\n }\n\n //list the width and height and keep the height ratio.\n list($width, $height) = getimagesize($fileName);\n\n //calculate the image ratio\n $imgratio=$width/$height;\n $newwidth = $width;\n $newheight = $height;\n\n //Image format -\n if ($imgratio>1){\n if ($width>$maxWidth) {\n $newwidth = $maxWidth;\n $newheight = $maxWidth/$imgratio;\n }\n //image format |\n }else{\n if ($height>$maxHight) {\n $newheight = $maxHight;\n $newwidth = $maxHight*$imgratio;\n }\n }\n\n //function for resize image.\n $resized_img = imagecreatetruecolor($newwidth,$newheight);\n\n //the resizing is going on here!\n imagecopyresized($resized_img, $new_img, 0, 0, 0, 0, $newwidth, $newheight, $width, $height);\n\n //finally, save the image\n if ($originalFileSufix!=\"\") {\n $path_parts=pathinfo($fileName);\n rename($fileName,$path_parts[\"dirname\"].DIRECTORY_SEPARATOR.$path_parts[\"filename\"].\"_\".$originalFileSufix.\".\".$path_parts[\"extension\"]);\n }\n ImageJpeg ($resized_img,$fileName,80);\n\n ImageDestroy ($resized_img);\n ImageDestroy ($new_img);\n}", "function resize_image($path, $filename, $maxwidth, $maxheight, $quality=75, $type = \"small_\", $new_path = \"\")\n{\n $filename = DIRECTORY_SEPARATOR.basename($filename);\n $sExtension = substr($filename, (strrpos($filename, \".\") + 1));\n $sExtension = strtolower($sExtension);\n\n // check ton tai thu muc khong\n if (!file_exists($path.$type))\n {\n @mkdir($path.$type, 0777, true);\n chmod($path.$type, 0777);\n }\n // Get new dimensions\n $size = getimagesize($path . $filename);\n $width = $size[0];\n $height = $size[1];\n if($width != 0 && $height !=0)\n {\n if($maxwidth / $width > $maxheight / $height) $percent = $maxheight / $height;\n else $percent = $maxwidth / $width;\n }\n\n $new_width\t= $width * $percent;\n $new_height\t= $height * $percent;\n\n // Resample\n $image_p = imagecreatetruecolor($new_width, $new_height);\n //check extension file for create\n switch($size['mime'])\n {\n case 'image/gif':\n $image = imagecreatefromgif($path . $filename);\n break;\n case 'image/jpeg' :\n case 'image/pjpeg' :\n $image = imagecreatefromjpeg($path . $filename);\n break;\n case 'image/png':\n $image = imagecreatefrompng($path . $filename);\n break;\n }\n //Copy and resize part of an image with resampling\n imagecopyresampled($image_p, $image, 0, 0, 0, 0, $new_width, $new_height, $width, $height);\n\n // Output\n // check new_path, nếu new_path tồn tại sẽ save ra đó, thay path = new_path\n if($new_path != \"\")\n {\n $path = $new_path;\n if (!file_exists($path.$type))\n {\n @mkdir($path.$type, 0777, true);\n chmod($path.$type, 0777);\n }\n }\n\n switch($sExtension)\n {\n case \"gif\":\n imagegif($image_p, $path . $type . $filename);\n break;\n case $sExtension == \"jpg\" || $sExtension == \"jpe\" || $sExtension == \"jpeg\":\n imagejpeg($image_p, $path . $type . $filename, $quality);\n break;\n case \"png\":\n imagepng($image_p, $path . $type . $filename);\n break;\n }\n imagedestroy($image_p);\n}", "function sharpen_resized_jpeg_images($resized_file) {\r\n $image = wp_load_image($resized_file); \r\n if(!is_resource($image))\r\n return new WP_Error('error_loading_image', $image, $file); \r\n $size = @getimagesize($resized_file);\r\n if(!$size)\r\n return new WP_Error('invalid_image', __('Could not read image size'), $file); \r\n list($orig_w, $orig_h, $orig_type) = $size; \r\n switch($orig_type) {\r\n case IMAGETYPE_JPEG:\r\n $matrix = array(\r\n array(-1, -1, -1),\r\n array(-1, 16, -1),\r\n array(-1, -1, -1),\r\n ); \r\n $divisor = array_sum(array_map('array_sum', $matrix));\r\n $offset = 0; \r\n imageconvolution($image, $matrix, $divisor, $offset);\r\n imagejpeg($image, $resized_file,apply_filters('jpeg_quality', 90, 'edit_image'));\r\n break;\r\n case IMAGETYPE_PNG:\r\n return $resized_file;\r\n case IMAGETYPE_GIF:\r\n return $resized_file;\r\n } \r\n return $resized_file;\r\n}", "function resizeImage($input,$output,$wid,$hei,$auto=false,$quality=80) {\n\n\t// File and new size\n\t//the original image has 800x600\n\t$filename = $input;\n\t//the resize will be a percent of the original size\n\t$percent = 0.5;\n\n\t// Get new sizes\n\tlist($width, $height) = getimagesize($filename);\n\t$newwidth = $wid;//$width * $percent;\n\t$newheight = $hei;//$height * $percent;\n\tif($auto) {\n\t\tif($width>$height) {\n\t\t\t$newheight=$wid*0.75;\n\t\t} else if($height>$width) {\n\t\t\t$newwidth=$hei*0.75;\n\t\t}\n\t}\n\n\t// Load\n\t$thumb = imagecreatetruecolor($newwidth, $newheight);\n\t$source = imagecreatefromjpeg($filename);\n\n\t// Resize\n\timagecopyresized($thumb, $source, 0, 0, 0, 0, $newwidth, $newheight, $width, $height);\n\n\t// Output and free memory\n\t//the resized image will be 400x300\n\timagejpeg($thumb,$output,$quality);\n\timagedestroy($thumb);\n}", "function reduce_image_size($dest_folder,$image_name,$files)\n{\n //REDUCE IMAGE RESOLUTION\n if($files)\n {\n //echo 123;exit;\n $dest = $dest_folder.$image_name;\n $width = 300;\n $height = 300;\n list($width_orig, $height_orig) = getimagesize($files);\n $ratio_orig = $width_orig/$height_orig;\n if ($width/$height > $ratio_orig)\n {\n $width = $height*$ratio_orig;\n }\n else\n {\n $height = $width/$ratio_orig;\n }\n $image_p = imagecreatetruecolor($width, $height);\n $image = imagecreatefromjpeg($files);\n imagecopyresampled($image_p, $image, 0, 0, 0, 0, $width, $height, $width_orig, $height_orig);\n imagejpeg($image_p,$dest, 100);\n ImageDestroy ($image_p);\n }\n //END OF REDUCING IMAGE RESOLUTION\n}", "function resizeImage($image,$width,$height,$scale) {\n\tlist($imagewidth, $imageheight, $imageType) = getimagesize($image);\n\t$imageType = image_type_to_mime_type($imageType);\n\t$newImageWidth = ceil($width * $scale);\n\t$newImageHeight = ceil($height * $scale);\n\t$newImage = imagecreatetruecolor($newImageWidth,$newImageHeight);\n\tswitch($imageType) {\n\t\tcase \"image/gif\":\n\t\t\t$source=imagecreatefromgif($image); \n\t\t\tbreak;\n\t case \"image/pjpeg\":\n\t\tcase \"image/jpeg\":\n\t\tcase \"image/jpg\":\n\t\t\t$source=imagecreatefromjpeg($image); \n\t\t\tbreak;\n\t case \"image/png\":\n\t\tcase \"image/x-png\":\n\t\t\t$source=imagecreatefrompng($image); \n\t\t\tbreak;\n \t}\n\timagecopyresampled($newImage,$source,0,0,0,0,$newImageWidth,$newImageHeight,$width,$height);\n\t\n\tswitch($imageType) {\n\t\tcase \"image/gif\":\n\t \t\timagegif($newImage,$image); \n\t\t\tbreak;\n \tcase \"image/pjpeg\":\n\t\tcase \"image/jpeg\":\n\t\tcase \"image/jpg\":\n\t \t\timagejpeg($newImage,$image,90); \n\t\t\tbreak;\n\t\tcase \"image/png\":\n\t\tcase \"image/x-png\":\n\t\t\timagepng($newImage,$image); \n\t\t\tbreak;\n }\n\t\n\tchmod($image, 0777);\n\treturn $image;\n}", "function ImageUpload($imagefieldname, $savename, $maxheight, $maxwidth, $minheight, $minwidth) {\r\n global $imageuploaddir, $imageuploadmaxsize, $debuglog;\r\n // first 2 globals are only retrieved for use here, debuglog is to append error messages\r\n $imagedir = $imageuploaddir;\r\n $thiserror = \"\";\r\n $uploadedfile_name = $_FILES[$imagefieldname]['name'];\r\n $uploadedfile_tmp = $_FILES[$imagefieldname]['tmp_name'];\r\n $uploadedfile_size = $_FILES[$imagefieldname]['size'];\r\n $uploadedfile_type = $_FILES[$imagefieldname]['type'];\r\n if ($uploadedfile_size > $imageuploadmaxsize) {\r\n $thiserror .= \"Error: Uploaded image size must be less than \" . $imageuploadmaxsize/1000000 . \" MB!<br />\";\r\n } else {\r\n if (isset($_FILES[$imagefieldname]['name'])) {\r\n $temp_img = $imagedir.'tmp_'.$savename;\r\n $prod_img = $imagedir.$savename;\r\n move_uploaded_file($uploadedfile_tmp, $temp_img);\r\n chmod ($temp_img, octdec('0666'));\r\n $sizes = getimagesize($temp_img);\r\n if ($sizes[0] == 0 || $sizes[1] == 0) { $imageszerror = \"Y\"; $imageulerror = \"Y\"; }\r\n else {\r\n $aspect_ratio = $sizes[1]/$sizes[0];\r\n if ($sizes[1] <= $maxheight) { $new_width = $sizes[0]; $new_height = $sizes[1]; }\r\n else { $new_height = $maxheight; $new_width = abs($new_height/$aspect_ratio); }\r\n if ($new_width <= $maxwidth) { $new_width = $new_width; $new_height = $new_height; }\r\n else { $new_width = $maxwidth; $new_height = abs($new_width*$aspect_ratio); }\r\n $destimg=ImageCreateTrueColor($new_width,$new_height);\r\n }\r\n $debuglog .= \"W: $new_width H: $new_height (After Max Adjustment)<br />\\n\";\r\n if ($uploadedfile_type == \"image/jpeg\" || $uploadedfile_type == \"image/pjpeg\") { $srcimg=ImageCreateFromJPEG($temp_img); }\r\n else if ($uploadedfile_type == \"image/gif\") { $srcimg=ImageCreateFromGIF($temp_img); }\r\n else if ($uploadedfile_type == \"image/png\" || $uploadedfile_type == \"image/x-png\") { $srcimg=ImageCreateFromPNG($temp_img); }\r\n else if ($uploadedfile_type == \"image/bmp\") { $srcimg=ImageCreateFromBMP($temp_img); }\r\n else {\r\n $imageulerror = \"Y\";\r\n if ($imageszerror == \"Y\") { $thiserror .= \"Error: Uploaded file has 0 for either height or length!<br />\"; }\r\n $thiserror .= \"Error: $uploadedfile_type used.<br>Only GIF, JPEG, PNG, and Windows BMP files allowed!<br />\";\r\n }\r\n if ($imageulerror != \"Y\") {\r\n if(function_exists('imagecopyresampled')) {\r\n imagecopyresampled($destimg,$srcimg,0,0,0,0,$new_width,$new_height,ImageSX($srcimg),ImageSY($srcimg));\r\n } else {\r\n Imagecopyresized($destimg,$srcimg,0,0,0,0,$new_width,$new_height,ImageSX($srcimg),ImageSY($srcimg));\r\n }\r\n }\r\n if ($srcimg) {\r\n // Fix for minimum width and height\r\n if ($new_width < $minwidth || $new_height < $minheight) {\r\n if ($new_height < $minheight) {\r\n $newy = intval(($minheight-$new_height)/2);\r\n $thisheight = $minheight;\r\n } else {\r\n $newy = 0;\r\n $thisheight = $new_height;\r\n }\r\n if ($new_width < $minwidth) {\r\n $newx = intval(($minwidth-$new_width)/2);\r\n $thiswidth = $minwidth;\r\n } else {\r\n $newx = 0;\r\n $thiswidth = $new_width;\r\n }\r\n $debuglog .= \"W: $thiswidth H: $thisheight (After Min Adjustment)<br />\\n\";\r\n $destimg=imagecreatetruecolor($thiswidth, $thisheight);\r\n $bk=imagecolorallocate($destimg, 255, 255, 255);\r\n imagefill($destimg,0,0,$bk);\r\n imagecopy($destimg, $srcimg, $newx, $newy, 0, 0, $new_width, $new_height);\r\n }\r\n // Sharpen image\r\n $sharpenmatrix = array(\r\n array(-1.2, -1, -1.2), // array(-1, -1, -1),\r\n array(-1.0, 28, -1.0), // array(-1, 16, -1),\r\n array(-1.2, -1, -1.2), // array(-1, -1, -1),\r\n );\r\n $sharpendivisor = array_sum(array_map('array_sum', $sharpenmatrix));\r\n imageconvolution($destimg, $sharpenmatrix, $sharpendivisor, 0);\r\n // Finally output production image\r\n ImageJPEG($destimg,$prod_img,95);\r\n }\r\n if ($imageulerror != \"Y\") { imagedestroy($destimg); }\r\n if (file_exists($temp_img)) { unlink($temp_img); }\r\n }\r\n }\r\n if ($imageulerror != \"Y\") { $success = \"Y\"; } else { $success = \"N|$thiserror\"; }\r\n return $success;\r\n}", "function resize($image_name, $size, $folder_name) {\n $file_extension = getFileExtension($image_name);\n switch ($file_extension) {\n case 'jpg':\n case 'jpeg':\n $image_src = imagecreatefromjpeg($folder_name . '/' . $image_name);\n break;\n case 'png':\n $image_src = imagecreatefrompng($folder_name . '/' . $image_name);\n break;\n case 'gif':\n $image_src = imagecreatefromgif($folder_name . '/' . $image_name);\n break;\n }\n $true_width = imagesx($image_src);\n $true_height = imagesy($image_src);\n\n $width = $size;\n $height = ($width / $true_width) * $true_height;\n\n $image_des = imagecreatetruecolor($width, $height);\n\n imagecopyresampled($image_des, $image_src, 0, 0, 0, 0, $width, $height, $true_width, $true_height);\n\n switch ($file_extension) {\n case 'jpg':\n case 'jpeg':\n imagejpeg($image_des, $folder_name . '/' . $image_name, 100);\n break;\n case 'png':\n imagepng($image_des, $folder_name . '/' . $image_name, 8);\n break;\n case 'gif':\n imagegif($image_des, $folder_name . '/' . $image_name, 100);\n break;\n }\n return $image_des;\n}", "function insert_image($temp_name, $path_main, $path_add, $entitle, $width = 0, $height = 0, $resize_type = '', $srcx = 0, $srcy = 0) {\n // create directories\n $dir_arr = explode('/', $path_add);\n $direct_temp = $_SERVER['DOCUMENT_ROOT'] . '/' . $path_main . '/';\n for ($i = 0; $i < count($dir_arr); $i++) {\n if (!is_dir($direct_temp . $dir_arr[$i])) {\n mkdir($direct_temp . $dir_arr[$i]);\n }\n $direct_temp .= $dir_arr[$i] . '/';\n }\n $size = getimagesize($temp_name);\n $type = $size['mime'];\n $new_name = 'none';\n switch ($type) {\n case 'image/jpeg':\n $new_name = $entitle . \".jpg\";\n break;\n case 'image/png':\n $new_name = $entitle . \".png\";\n break;\n case 'image/gif':\n $new_name = $entitle . \".gif\";\n break;\n }\n if ($new_name === 'none')\n return false;\n // resize calc\n $new_width = 0;\n $new_height = 0;\n $src_width = $size[0];\n $src_height = $size[1];\n if ($width && $height) {\n if ($resize_type == '') { // simple resize\n $new_width = $width;\n $new_height = $height;\n } elseif ($resize_type == 'w') { // resize by width\n $new_width = $width;\n $new_height = $width * $size[1] / $size[0];\n } elseif ($resize_type == 'h') { // resize by height\n $new_height = $height;\n $new_width = $height * $size[0] / $size[1];\n } elseif ($resize_type == 'max') { // resize by max\n if ((1.0 * $width / $height) < (1.0 * $size[0] / $size[1])) {\n $new_width = $width;\n $new_height = $width * $size[1] / $size[0];\n } else {\n $new_height = $height;\n $new_width = $height * $size[0] / $size[1];\n }\n } elseif ($resize_type == 'min') { // cut resize\n if ((1.0 * $width / $height) > (1.0 * $size[0] / $size[1])) {\n $new_width = $width;\n $new_height = $width * $size[1] / $size[0];\n } else {\n $new_height = $height;\n $new_width = $height * $size[0] / $size[1];\n }\n } elseif ($resize_type == 'cut') {\n if ((1.0 * $width / $height) > (1.0 * $size[0] / $size[1])) {\n $src_width = $size[0];\n $src_height = intval($src_width * $height / $width);\n $new_width = $width;\n $new_height = $height;\n } else {\n $src_height = $size[1];\n $src_width = intval($src_height * $width / $height);\n $new_width = $width;\n $new_height = $height;\n }\n }\n } else {\n if (!copy($temp_name, $direct_temp . $new_name))\n return '';\n return $path_add . $new_name;\n }\n\n // resizing\n switch ($type) {\n //int imagecopyresampled (\n // resource dst_im, resource src_im, \n // int dstX, int dstY, int srcX, int srcY, \n // int dstW, int dstH, int srcW, int srcH)\n case 'image/jpeg':\n $src = imagecreatefromjpeg($temp_name);\n $dest = imagecreatetruecolor($new_width, $new_height);\n imagecopyresampled($dest, $src, 0, 0, $srcx, $srcy, $new_width, $new_height, $src_width, $src_height);\n imagejpeg($dest, $direct_temp . $new_name, 75);\n imagedestroy($src);\n imagedestroy($dest);\n break;\n case 'image/png':\n $src = imagecreatefrompng($temp_name);\n $dest = imagecreatetruecolor($new_width, $new_height);\n imagecopyresampled($dest, $src, 0, 0, $srcx, $srcy, $new_width, $new_height, $src_width, $src_height);\n imagepng($dest, $direct_temp . $new_name);\n imagedestroy($src);\n imagedestroy($dest);\n break;\n case 'image/gif':\n $src = imagecreatefromgif($temp_name);\n $dest = imagecreatetruecolor($new_width, $new_height);\n imagecopyresampled($dest, $src, 0, 0, $srcx, $srcy, $new_width, $new_height, $src_width, $src_height);\n imagegif($dest, $direct_temp . $new_name);\n imagedestroy($src);\n imagedestroy($dest);\n break;\n }\n chmod($direct_temp . $new_name, 0777);\n return $path_add . $new_name;\n }", "function resize_img($dir_in, $dir_out, $imedat='defaultname.jpg', $max=500,$new) {\r\n\r\n $img = $dir_in . '/' . $imedat;\r\n $extension = array_pop(explode('.', $imedat));\r\n $fileExt = strtolower(end(explode('.',$imedat)));\r\n $imedat = $new.$fileExt;\r\n switch ($extension){\r\n \r\n case 'jpg':\r\n case 'jpeg':\r\n $image = ImageCreateFromJPEG($img);\r\n break;\r\n \r\n case 'png':\r\n $image = ImageCreateFromPNG($img);\r\n break;\r\n \r\n default:\r\n $image = false;\r\n }\r\n\r\n\r\nif(!$image){\r\n // not valid img stop processing\r\n return false; \r\n}\r\n\r\n $vis = imagesy($image);\r\n $sir = imagesx($image);\r\n\r\n if(($vis < $max) && ($sir < $max)) {\r\n $nvis=$vis; $nsir=$sir;\r\n } else {\r\n if($vis > $sir) { $nvis=$max; $nsir=($sir*$max)/$vis;}\r\n elseif($vis < $sir) { $nvis=($max*$vis)/$sir; $nsir=$max;}\r\n else { $nvis=$max; $nsir=$max;}\r\n }\r\n\r\n $out = ImageCreateTrueColor($nsir,$nvis);\r\n ImageCopyResampled($out, $image, 0, 0, 0, 0, $nsir, $nvis, $sir, $vis);\r\n\r\n switch ($extension){\r\n \r\n case 'jpg':\r\n case 'jpeg':\r\n imageinterlace($out ,1);\r\n ImageJPEG($out, $dir_out . '/' . $imedat, 75);\r\n break;\r\n \r\n case 'png':\r\n ImagePNG($out, $dir_out . '/' . $imedat);\r\n break;\r\n \r\n default:\r\n $out = false;\r\n }\r\n\r\n if(!$out){\r\n return false;\r\n }\r\n \r\nImageDestroy($image);\r\nImageDestroy($out);\r\n\r\nreturn true;\r\n}", "function resizeImage($image,$width,$height,$scale) {\n\t\t\t\tlist($imagewidth, $imageheight, $imageType) = getimagesize($image);\n\t\t\t\t$imageType = image_type_to_mime_type($imageType);\n\t\t\t\t$newImageWidth = ceil($width * $scale);\n\t\t\t\t$newImageHeight = ceil($height * $scale);\n\t\t\t\t$newImage = imagecreatetruecolor($newImageWidth,$newImageHeight);\n\t\t\t\tswitch($imageType) {\n\t\t\t\t\tcase \"image/gif\":\n\t\t\t\t\t\t$source=imagecreatefromgif($image);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"image/pjpeg\":\n\t\t\t\t\tcase \"image/jpeg\":\n\t\t\t\t\tcase \"image/jpg\":\n\t\t\t\t\t\t$source=imagecreatefromjpeg($image);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"image/png\":\n\t\t\t\t\tcase \"image/x-png\":\n\t\t\t\t\t\t$source=imagecreatefrompng($image);\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\timagecopyresampled($newImage,$source,0,0,0,0,$newImageWidth,$newImageHeight,$width,$height);\n\t\t\t\n\t\t\t\tswitch($imageType) {\n\t\t\t\t\tcase \"image/gif\":\n\t\t\t\t\t\timagegif($newImage,$image);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"image/pjpeg\":\n\t\t\t\t\tcase \"image/jpeg\":\n\t\t\t\t\tcase \"image/jpg\":\n\t\t\t\t\t\timagejpeg($newImage,$image,90);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"image/png\":\n\t\t\t\t\tcase \"image/x-png\":\n\t\t\t\t\t\timagepng($newImage,$image);\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\n\t\t\t\tchmod($image, 0777);\n\t\t\t\treturn $image;\n\t\t\t}", "function resizeImage($image,$width,$height,$scale,$stype) {\n\t$newImageWidth = ceil($width * $scale);\n\t$newImageHeight = ceil($height * $scale);\n\t$newImage = imagecreatetruecolor($newImageWidth,$newImageHeight);\n\tswitch($stype) {\n case 'gif':\n $source = imagecreatefromgif($image);\n break;\n case 'jpg':\n $source = imagecreatefromjpeg($image);\n break;\n case 'jpeg':\n $source = imagecreatefromjpeg($image);\n break;\n case 'png':\n $source = imagecreatefrompng($image);\n break;\n }\n\timagecopyresampled($newImage, $source,0,0,0,0, $newImageWidth, $newImageHeight, $width, $height);\n\timagejpeg($newImage,$image,90);\n\tchmod($image, 0777);\n\treturn $image;\n}", "private function resize() {\n\t\tswitch($this->type) {\n\t\t\tcase 'image/jpeg':\n\t\t\t\t$originalImage = imagecreatefromjpeg($this->tempName);\n\t\t\tbreak;\n\t\t\tcase 'image/png':\n\t\t\t\t$originalImage = imagecreatefrompng($this->tempName);\n\t\t\tbreak;\n\t\t\tcase 'image/gif':\n\t\t\t\t$originalImage = imagecreatefromgif($this->tempName);\n\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tdie('FILE CANNOT BE RESIZED');\n\t\t\tbreak;\n\t\t}\n\n\t\t// Determine new height\n\t\t$this->newHeight = ($this->height / $this->width) * $this->newWidth;\n\n\t\t// Create new image\n\t\t$this->newImage = imagecreatetruecolor($this->newWidth, $this->newHeight);\n\n\t\t// Resample original image into new image\n\t\timagecopyresampled($this->newImage, $originalImage, 0, 0, 0, 0, $this->newWidth, $this->newHeight, $this->width, $this->height);\n\n\t\t// Switch based on image being resized\n\t\tswitch($this->type) {\n\t\t\tcase 'image/jpeg':\n\t\t\t\t// Source, Dest, Quality 0 to 100\n\t\t\t\timagejpeg($this->newImage, $this->destinationFolder.'/'.$this->newName, 80);\n\t\t\tbreak;\n\t\t\tcase 'image/png':\n\t\t\t\t// Source, Dest, Quality 0 (no compression) to 9\n\t\t\t\timagepng($this->newImage, $this->destinationFolder.'/'.$this->newName, 0);\n\t\t\tbreak;\n\t\t\tcase 'image/gif':\n\t\t\t\timagegif($this->newImage, $this->destinationFolder.'/'.$this->newName);\n\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tdie('YOUR FILE CANNOT BE RESIZED');\n\t\t\tbreak;\n\t\t}\n\n\t\t// DESTROY NEW IMAGE TO SAVE SERVER SPACE\n\t\timagedestroy($this->newImage);\n\t\timagedestroy($originalImage);\n\n\t\t// SUCCESSFULLY UPLOADED\n\t\t$this->result = true;\n\t\t$this->message = 'Image uploaded and resized successfully';\n\t}", "function resizeThumbnailImage($thumb_image_name, $image, $width, $height, $start_width, $start_height, $scale){\n\t$newImageWidth = ceil($width * $scale);\n\t$newImageHeight = ceil($height * $scale);\n\t$newImage = imagecreatetruecolor($newImageWidth,$newImageHeight);\n\t$source = imagecreatefromjpeg($image);\n\timagecopyresampled($newImage,$source,0,0,$start_width,$start_height,$newImageWidth,$newImageHeight,$width,$height);\n\timagejpeg($newImage,$thumb_image_name,90);\n\tchmod($thumb_image_name, 0777);\n\treturn $thumb_image_name;\n}", "function UploadGallery($nama_file_unik, $folder){\n $file_upload = $folder . $nama_file_unik;\n\n // Simpan gambar dalam ukuran aslinya\n move_uploaded_file($_FILES[\"gb_gallery\"][\"tmp_name\"], $file_upload);\n \n // Identitas file asli\n $gbr_asli = imagecreatefromjpeg($file_upload);\n $lebar = imageSX($gbr_asli);\n $tinggi \t= imageSY($gbr_asli);\n\n // Simpan dalam versi thumbnail\n $thumb_lebar = 180;\n $thumb_tinggi = 180;\n\n // Proses perubahan dimensi ukuran\n $gbr_thumb = imagecreatetruecolor($thumb_lebar,$thumb_tinggi);\n imagecopyresampled($gbr_thumb, $gbr_asli, 0, 0, 0, 0, $thumb_lebar, $thumb_tinggi, $lebar, $tinggi);\n\n // Simpan gambar thumbnail\n imagejpeg($gbr_thumb,$folder . \"small_\" . $nama_file_unik);\n \n // Hapus gambar di memori komputer\n imagedestroy($gbr_asli);\n imagedestroy($gbr_thumb);\n}", "function uploadAndResizeImage(array $fileToUpload, $uploadFolder, array $sizes) {\n\n $result = [];\n\n /*\n Vi smider værdierne fra $_FILES super global\n variablen i vores egne variabler og giver dem\n et mere beskrivende variabel navn\n */\n\n $originalFile = $fileToUpload['name'];\n\n /*\n pathinfo er en function til at få information omkring en fil, samt stien til den fil.\n i dette tilfælde benytter vi den til at få endelsen på filen altså: jpg, gif, png osv\n\n Vi kører pathinfo igennem en strtolower (string to lower) function, således at fil\n endelsen altid kommer ud i små bogstaver.\n\n Vi ved ikke hvad brugerne kommer med, så dette er en måde at sikre os, at vi altid\n arbejder på den samme måde, nemlig med små bogstaver\n */\n\n $fileType = strtolower(pathinfo($originalFile, PATHINFO_EXTENSION));\n\n // var_dump($fileType);\n // die;\n\n /*\n Vi benytter samme metode til at få filnavnet ud, uden endelsen: .jpg, .png osv\n */\n\n $originalFilename = pathinfo($originalFile, PATHINFO_FILENAME);\n\n // var_dump($originalFilename);\n // die;\n\n $uploadedFile = $fileToUpload['tmp_name'];\n $errors = $fileToUpload['error'];\n $fileSize = $fileToUpload['size'];\n\n /*\n Det er nu tid til at kigge på hvilken fil og filtype vi har fået ind\n og teste på om dette er den rette.\n\n Vi begynder samtidig med at se på selve resize delen af scriptet\n\n Til denne del, benytter vi en række functions som går ind og opfører\n sig lidt som et billedredigerings program, som eksempelvis Photoshop.\n\n Det betyder at vi begynder at kigge på hvad der er i selve filen vi uploader,\n vi ser på billedet i pixels, som man ville gøre det i et billedredigeringsprogram\n\n Da måden PHP ser på hvad der er i et billede rent pixelmæssigt er udgjort på baggrund\n af filtypen: png, jpg osv, kan vi slå \"valideringen\" af filtypen sammen med denne del\n */\n\n switch ($fileType) {\n case 'png':\n\n /*\n png formatet er i orden, her beder vi php om at\n skabe et kilde billede i pixels, i hukommelsen, vi kan arbejde med\n som var det et billedredigerings program.\n */\n\n $sourceImage = imagecreatefrompng($uploadedFile);\n\n break;\n\n case 'gif':\n\n /* samme som ovenstående bare i forhold til gif billeder */\n\n $sourceImage = imagecreatefromgif($uploadedFile);\n\n break;\n\n case 'jpeg':\n case 'jpg':\n\n /* samme som ovenstående bare i forhold til jpg billeder */\n\n $sourceImage = imagecreatefromjpeg($uploadedFile);\n\n break;\n\n default:\n\n /* skulle vi få et format ind vi ikke kender, stopper vi scriptet */\n\n throw new Exception('Unknown image filetype given');\n\n break;\n }\n\n /*\n Nu hvor vi skal til at arbejde med vores kilde billede, er vi nødt til at kende\n størrelsen.\n getimagesize functionen returnerer et array med størrelses informationerne.\n Her skal vi benytte de 2 første værdier, som angiver størrelsen i integers\n */\n\n $sourceImageWidth = getimagesize($uploadedFile)[0];\n\n // var_dump($sourceImageWidth);\n // var_dump($sourceImageHeight);\n // die;\n\n /*\n Alternativt kan man bruge list functionen, som giver os mulighed for at\n overføre værdier fra et array, direkte til variabler.\n\n Her er det dog vigtigt at kende placeringerne i det array der returneres.\n\n Vi ved at de 2 første er vores vidde og bredde og kunne derfor skrive\n list($variabeltilvidde, $variabeltilhøjdre) = getimagesize($uploadedFile);\n */\n\n list($sourceImageWidth, $sourceImageHeight) = getimagesize($uploadedFile);\n\n /*\n Vi skal nu til selve resizing af billeder.\n\n Da vi angiver disse i et array, vil vi løbe over dem\n igennem en foreach\n */\n\n foreach ($sizes as $prefix => $size) {\n /*\n Vi angiver først vores ønskede billedstørrelse\n Vidden kan vi tage fra vores sizes array.\n\n Højden bruger vi i en udregning for at holde vores aspect ratio.\n Formlen for denne lyder:\n Original højde / original vidde * ny vidde = ny højde\n */\n\n $width = $size;\n $height = ($sourceImageHeight / $sourceImageWidth) * $size;\n\n // echo $width;\n // echo $height;\n // die;\n\n /*\n Vi skaber et tomt canvas, som vi kan fylde ud med pixels fra\n det originale billede. Dette canvas sætter vi størrelsen på.\n imagecreatetruecolor functionen benyttes til at skabe dette tomme canvas\n */\n\n $newImage = imagecreatetruecolor($width, $height);\n /*\n Vi benytter imagecopyresample functionen til at kopiere pixels fra vores originale billede\n over til vores nye billede.\n\n Måden dette gøres på, er ved at skabe et rektangel på det originale billede, hvor de pixels\n som ligger inden for denne rektangel bliver kopieret.\n\n Dernæst benytter vi endnu et rektangel på det nye billede, hvorved de kopierede pixels\n pastes ind.\n\n Hvis det nye billede er mindre, vel der her skabes en resizing, som derved får de kopierede\n pixels til at passe ind i det rektangel de skal passe i.\n\n Vi angiver vores nye billede, vores originale billede og dernes koordinaterne for:\n Hvor på x aksen rektanglet på det nye billede skal placeres\n Hvor på y aksen rektanglet på det nye billede skal placeres\n\n Hvor på x aksen rektanglet på det originale billede skal placeres\n Hvor på y aksen rektanglet på det originale billede skal placeres.\n\n Dernæst angiver vi størrelsen på vores rekstangler, altså:\n Vidden på rektanglet på vores nye billede\n Højden på rektanglet på vores nye billede\n\n Vidden på rektanglet på vores originale billede\n Højde på rektanglet på vores originale billede\n */\n\n imagecopyresampled($newImage, $sourceImage, 0, 0, 0, 0, $width, $height, $sourceImageWidth, $sourceImageHeight);\n\n /*\n Når det nye billede har modtagede de kopierede pixels\n fra det originale er vi klar til at gemme det.\n\n Vi opbygger derefter filnavnet samt stien hvor dette skal gemmes.\n $uploadFolder stien bliver givet igennem denne functions parameter\n\n time() functionen giver os et timestamp for det øjeblik filens skal gemmes.\n vi benytter dette, for at få et unikt filnavn, således at vi ikke overskriver\n eksisterende filer med samme navn\n\n $prefix bliver givet igennem vores sizes array\n\n $originalFilename blev fundet igennem overførslen fra Super global variablen\n øverst i denne function.\n\n Dernæst vælger vi at gemme denne fil som jpg.\n\n */\n if ($fileType == \"jpeg\") {\n $filename = $uploadFolder . $prefix . '_' . time() . '_' . $originalFilename . '.jpg';\n imagejpeg($newImage, $filename, 100);\n }\n if ($fileType == \"jpg\") {\n $filename = $uploadFolder . $prefix . '_' . time() . '_' . $originalFilename . '.jpg';\n imagejpeg($newImage, $filename, 100);\n }\n if ($fileType == \"gif\") {\n $filename = $uploadFolder . $prefix . '_' . time() . '_' . $originalFilename . '.gif';\n imagegif($newImage, $filename, 100);\n }\n if ($fileType == \"png\") {\n $filename = $uploadFolder . $prefix . '_' . time() . '_' . $originalFilename . '.png';\n imagepng($newImage, $filename, 100);\n }\n\n /*\n Vores nye billede ligger stadigvæk i serverens hukommelse\n For at være gode og ansvarlige programmører, sletter vi dette, således\n at hukommelsen frigives til de andre brugere af serveren :-)\n */\n\n imagedestroy($newImage);\n\n /*\n Til sidst smider vi vores filsti i vores result array, således\n at det efterfølgende kan benyttes i en database.\n\n Vi genbruger her vores prefix fra vores sizes array, således\n at fil stierne kan adskilles\n */\n\n $result[$prefix] = $filename;\n }\n\n /*\n Da vores originale billede også ligger i serverens hukommelse,\n vil vi igen være gode og ansvarlige programmører der fjerner dette\n */\n\n imagedestroy($sourceImage);\n\n return $result;\n}", "function imgResizeHeight($file_ori,$UploadPath,$Resize=1,$imgx=130,$imgy=150,$clean=0) {\n\t\t$dest_filename='';\n\t\t$handle = new upload($file_ori);\n\t\t$img_proper=getimagesize($file_ori['tmp_name']);\n\t\t\n\t\tif ($handle->uploaded) {\n\t\t\t//$handle->image_x = $imgx;\n\t\t\t$handle->image_y = $imgy;\n\t\t\t$handle->image_resize = true;\n\t\t\t$handle->image_ratio_x = true;\n\t\t}\n\t\t$handle->process($UploadPath);\n\t\tif ($handle->processed) {\n\t\t\t$dest_filename=$handle->file_dst_name;\n\t\t\tif($clean==1)\n\t\t\t\t$handle->clean();\n\t\t} else\n\t\t\t$dest_filename='';\n\t\treturn $dest_filename;\n\t}", "function _resizeImageGD1($src_file, $dest_file, $new_size, $imgobj) {\r\n if ($imgobj->_size == null) {\r\n return false;\r\n }\r\n // GD1 can only handle JPG & PNG images\r\n if ($imgobj->_type !== \"jpg\" && $imgobj->_type !== \"jpeg\" && $imgobj->_type !== \"png\") {\r\n return false;\r\n }\r\n // height/width\r\n $ratio = max($imgobj->_size[0], $imgobj->_size[1]) / $new_size;\r\n $ratio = max($ratio, 1.0);\r\n $destWidth = (int)($imgobj->_size[0] / $ratio);\r\n $destHeight = (int)($imgobj->_size[1] / $ratio);\r\n if ($imgobj->_type == \"jpg\" || $imgobj->_type == \"jpeg\") {\r\n $src_img = imagecreatefromjpeg($src_file);\r\n } else {\r\n $src_img = imagecreatefrompng($src_file);\r\n }\r\n if (!$src_img) {\r\n return false;\r\n }\r\n $dst_img = imagecreate($destWidth, $destHeight);\r\n imagecopyresized($dst_img, $src_img, 0, 0, 0, 0, $destWidth, (int)$destHeight, $imgobj->_size[0], $imgobj->_size[1]);\r\n if ($imgobj->_type == \"jpg\" || $imgobj->_type == \"jpeg\") {\r\n imagejpeg($dst_img, $dest_file, $this->_JPEG_quality);\r\n } else {\r\n imagepng($dst_img, $dest_file);\r\n }\r\n imagedestroy($src_img);\r\n imagedestroy($dst_img);\r\n return true; \r\n }", "function resizeImage($image,$width,$height) {\n\t$newImageWidth = $width;\n\t$newImageHeight = $height;\n\t$newImage = imagecreatetruecolor($newImageWidth,$newImageHeight);\n\t$source = imagecreatefromjpeg($image);\n\timagecopyresampled($newImage,$source,0,0,0,0,$newImageWidth,$newImageHeight,$width,$height);\n\timagejpeg($newImage,$image,90);\n\tchmod($image, 0777);\n\treturn $image;\n}", "function imageResize($file, $dest, $height, $width, $thumb = FALSE) {\n\tglobal $ighMaxHeight, $ighMaxWidth, $ighThumbHeight, $ighThumbWidth;\n\n\tif (strstr(@mime_content_type($file), \"png\"))\n\t\t$oldImage = imagecreatefrompng($file);\n\telseif (strstr(@mime_content_type($file), \"jpeg\"))\n\t\t$oldImage = imagecreatefromjpeg($file);\n\telseif (strstr(@mime_content_type($file), \"gif\"))\n\t\t$oldImage = imagecreatefromgif($file);\n\telse\n\t\tdie (\"oh shit\");\n\n\t$base_img = $oldImage;\n $img_width = imagesx($base_img);\n $img_height = imagesy($base_img);\n\n $thumb_height = $height;\n $thumb_width = $width;\n\n // Work out which way it needs to be resized\n $img_width_per = $thumb_width / $img_width;\n $img_height_per = $thumb_height / $img_height;\n \n if ($img_width_per <= $img_height_per) {\n $thumb_height = intval($img_height * $img_width_per); \n }\n else {\n $thumb_width = intval($img_width * $img_height_per);\n }\n\n\tif ($thumb) {\n\t\t$thumb_width = $width;\t\t// 120\n\t\t$thumb_height = $height*3/4;\t// 120 * 3 / 4 = 90\n\t}\n\n // Create the new thumbnail image\n $thumb_img = ImageCreateTrueColor($thumb_width, $thumb_height); \n\n\tif ($thumb) {\t// Do the Square from the Centre thing.\n\t\tImageCopyResampled($thumb_img, $base_img, 0, 0, \n\t\t\t\t($img_width/2)-($thumb_width/2), ($img_height/2)-($thumb_height/2), \n\t\t\t\t$thumb_width, $thumb_height, $thumb_width, $thumb_height);\t\t\t\n\t} else {\t// standard image to image resize.\n\t\tImageCopyResampled($thumb_img, $base_img, 0, 0, 0, 0, \n\t\t\t\t$thumb_width, $thumb_height, $img_width, $img_height);\n\t}\n\n\t// using jpegs!\n\timagejpeg($thumb_img, $dest);\n\timagedestroy($base_img);\n\timagedestroy($thumb_img);\n}", "function uploadImageFile() { // Note: GD library is required for this function\n\n if ($_SERVER['REQUEST_METHOD'] == 'POST') {\n $iWidth = $iHeight = 570; // desired image result dimensions\n $iJpgQuality = 90;\n $uploadDirectory = 'images/upload_photos/';\n $title_short = $_POST['title_short'];\n $title_long = $_POST['title_long'];\n if ($_FILES) {\n foreach($_FILES as $file){\n $base = basename($file['name']);\n $newFileName = $uploadDirectory.'large/'.basename($file['name']);\n if(move_uploaded_file($file['tmp_name'],$newFileName)){\n\n }\n else{\n $error=1;\n }\n }\n\n $ext = pathinfo($newFileName, PATHINFO_EXTENSION);\n\n // check for image type\n if(strtolower($ext==\"png\")){\n $vImg = @imagecreatefrompng($newFileName);\n }\n if((strtolower($ext==\"jpeg\"))||(strtolower($ext==\"jpg\"))){\n $vImg = @imagecreatefromjpeg($newFileName);\n }\n\n\n // create a new true color image\n $vDstImg = @imagecreatetruecolor( $iWidth, $iHeight );\n\n // copy and resize part of an image with resampling\n imagecopyresampled($vDstImg, $vImg, 0, 0, (int)$_POST['x1'], (int)$_POST['y1'], $iWidth, $iHeight, (int)$_POST['w'], (int)$_POST['h']);\n\n\n\n // output image to file\n if(imagejpeg($vDstImg, $uploadDirectory.'small/'.$base, $iJpgQuality)){\n\n }\n else{\n $error=2;\n }\n if($error){\n return $error;\n }\n $small_photo = $uploadDirectory.'small/'.$base;\n $large_photo = $newFileName;\n $db = new PDO('mysql:host=mysql51-136.perso;dbname=jordandefmbdd', 'jordandefmbdd', 'hgz5pTRuktht');\n $query =\n 'INSERT INTO photos VALUES (\n null,\n \\''.addslashes($small_photo).'\\',\n \\''.addslashes($large_photo).'\\',\n \\''.addslashes($title_long).'\\',\n \\''.addslashes($title_short).'\\'\n )'\n ;\n $result = $db->query($query);\n return $uploadDirectory.'small/'.$base;\n\n }\n }\n}", "function funcs_resizeImageFile($file,$newWidth,$newHeight,$oldWidth,$oldHeight,$destination = null,$quality = 75){\n\t//create a new pallete for both source and destination\n\t$dest = imagecreatetruecolor($newWidth, $newHeight);\n\tif (preg_match('/\\.gif$/',$file)){\n\t\t$source = imagecreatefromgif($file);\n\t}else{\n\t\t//assume jpeg since we only allow jpeg and gif\n\t\t$source = imagecreatefromjpeg($file);\n\t}\n\t//copy the source pallete onto destination pallete\n\timagecopyresampled($dest,$source,0,0,0,0, $newWidth, $newHeight, $oldWidth,$oldHeight);\n\t//save file\n\tif (preg_match('/\\.gif$/',$file)){\n\t\timagegif($dest,((is_null($destination))?$file:$destination));\n\t}else{\n\t\timagejpeg($dest,((is_null($destination))?$file:$destination),$quality);\n\t}\n}", "function resizeThumbnailImage($thumb_image_name, $image, $width, $height, $start_width, $start_height, $scale){\n\tlist($imagewidth, $imageheight, $imageType) = getimagesize($image);\n\t$imageType = image_type_to_mime_type($imageType);\n\t\n\t$newImageWidth = ceil($width * $scale);\n\t$newImageHeight = ceil($height * $scale);\n\t$newImage = imagecreatetruecolor($newImageWidth,$newImageHeight);\n\tswitch($imageType) {\n\t\tcase \"image/gif\":\n\t\t\t$source=imagecreatefromgif($image); \n\t\t\tbreak;\n\t case \"image/pjpeg\":\n\t\tcase \"image/jpeg\":\n\t\tcase \"image/jpg\":\n\t\t\t$source=imagecreatefromjpeg($image); \n\t\t\tbreak;\n\t case \"image/png\":\n\t\tcase \"image/x-png\":\n\t\t\t$source=imagecreatefrompng($image); \n\t\t\tbreak;\n \t}\n\timagecopyresampled($newImage,$source,0,0,$start_width,$start_height,$newImageWidth,$newImageHeight,$width,$height);\n\tswitch($imageType) {\n\t\tcase \"image/gif\":\n\t \t\timagegif($newImage,$thumb_image_name); \n\t\t\tbreak;\n \tcase \"image/pjpeg\":\n\t\tcase \"image/jpeg\":\n\t\tcase \"image/jpg\":\n\t \t\timagejpeg($newImage,$thumb_image_name,90); \n\t\t\tbreak;\n\t\tcase \"image/png\":\n\t\tcase \"image/x-png\":\n\t\t\timagepng($newImage,$thumb_image_name); \n\t\t\tbreak;\n }\n\tchmod($thumb_image_name, 0777);\n\treturn $thumb_image_name;\n}", "function resizeImage ( $sourcePathFilename, $extension, $destinationPath, $maxWidth, $maxHeight ) {\n $result = '';\n debug_log ( __FILE__, __LINE__, $sourcePathFilename );\n debug_log ( __FILE__, __LINE__, $extension );\n\n if ( $sourcePathFilename != '' && $extension != '' ) {\n if ( in_array ( $extension, array ( 'jpg', 'jpeg', 'png', 'gif' ) ) ) {\n switch ( $extension ) {\n case 'jpg':\n $imageOldData = imagecreatefromjpeg ( $sourcePathFilename );\n break;\n\n case 'jpeg':\n $imageOldData = imagecreatefromjpeg ( $sourcePathFilename );\n break;\n\n case 'png':\n $imageOldData = imagecreatefrompng ( $sourcePathFilename );\n break;\n\n case 'gif':\n $imageOldData = imagecreatefromgif ( $sourcePathFilename );\n break;\n\n default:\n $imageOldData = imagecreatefromjpeg ( $sourcePathFilename );\n }\n\n $imageOldWidth = imagesx ( $imageOldData );\n $imageOldHeight = imagesy ( $imageOldData );\n\n $imageScale = min ( $maxWidth / $imageOldWidth, $maxHeight / $imageOldHeight );\n\n $imageNewWidth = ceil ( $imageScale * $imageOldWidth );\n $imageNewHeight = ceil ( $imageScale * $imageOldHeight );\n\n $imageNewData = imagecreatetruecolor ( $imageNewWidth, $imageNewHeight );\n\n $colorWhite = imagecolorallocate ( $imageNewData, 255, 255, 255 );\n imagefill ( $imageNewData, 0, 0, $colorWhite );\n\n imagecopyresampled ( $imageNewData, $imageOldData, 0, 0, 0, 0, $imageNewWidth, $imageNewHeight, $imageOldWidth, $imageOldHeight );\n\n ob_start ();\n imagejpeg ( $imageNewData, NULL, 100 );\n $imageNewDataString = ob_get_clean ();\n\n $imageNewFilename = hash ( 'sha256', $imageNewDataString ) . uniqid () . '.jpg';\n\n $imageNewPathFilename = $destinationPath . $imageNewFilename;\n\n if ( file_put_contents ( $imageNewPathFilename, $imageNewDataString ) !== false )\n {\n $result = $imageNewFilename;\n }\n\n imagedestroy ( $imageNewData );\n imagedestroy ( $imageOldData );\n }\n }\n\n return $result;\n}", "function resize_image($src, $width, $height){\n // initializing\n $save_path = Wordless::theme_temp_path();\n $img_filename = Wordless::join_paths($save_path, md5($width . 'x' . $height . '_' . basename($src)) . '.jpg');\n\n // if file doesn't exists, create it\n if (!file_exists($img_filename)) {\n $to_scale = 0;\n $to_crop = 0;\n\n // Get orig dimensions\n list ($width_orig, $height_orig, $type_orig) = getimagesize($src);\n\n // get original image ... to improve!\n switch($type_orig){\n case IMAGETYPE_JPEG: $image = imagecreatefromjpeg($src);\n break;\n case IMAGETYPE_PNG: $image = imagecreatefrompng($src);\n break;\n case IMAGETYPE_GIF: $image = imagecreatefromgif($src);\n break;\n default:\n return;\n }\n\n // which is the new smallest?\n if ($width < $height)\n $min_dim = $width;\n else\n $min_dim = $height;\n\n // which is the orig smallest?\n if ($width_orig < $height_orig)\n $min_orig = $width_orig;\n else\n $min_orig = $height_orig;\n\n // image of the right size\n if ($height_orig == $height && $width_orig == $width) ; // nothing to do\n // if something smaller => scale\n else if ($width_orig < $width) {\n $to_scale = 1;\n $ratio = $width / $width_orig;\n }\n else if ($height_orig < $height) {\n $to_scale = 1;\n $ratio = $height / $height_orig;\n }\n // if both bigger => scale\n else if ($height_orig > $height && $width_orig > $width) {\n $to_scale = 1;\n $ratio_dest = $width / $height;\n $ratio_orig = $width_orig / $height_orig;\n if ($ratio_dest > $ratio_orig)\n $ratio = $width / $width_orig;\n else\n $ratio = $height / $height_orig;\n }\n // one equal one bigger\n else if ( ($width == $width_orig && $height_orig > $height) || ($height == $height_orig && $width_orig > $width) )\n $to_crop = 1;\n // some problem...\n else\n echo \"ALARM\";\n\n // we need to zoom to get the right size\n if ($to_scale == 1) {\n $new_width = $width_orig * $ratio;\n $new_height = $height_orig * $ratio;\n $image_scaled = imagecreatetruecolor($new_width, $new_height);\n // scaling!\n imagecopyresampled($image_scaled, $image, 0, 0, 0, 0, $new_width, $new_height, $width_orig, $height_orig);\n $image = $image_scaled;\n\n if($new_width > $width || $new_height > $height)\n $to_crop = 1;\n }\n else {\n $new_width = $width_orig;\n $new_height = $height_orig;\n }\n\n // we need to crop the image\n if ($to_crop == 1) {\n $image_cropped = imagecreatetruecolor($width, $height);\n\n // find margins for images\n $margin_x = ($new_width - $width) / 2;\n $margin_y = ($new_height - $height) / 2;\n\n // cropping!\n imagecopy($image_cropped, $image, 0, 0, $margin_x, $margin_y, $width, $height);\n $image = $image_cropped;\n }\n\n // Save image\n imagejpeg($image, $img_filename, 95);\n }\n\n // Return image URL\n return Wordless::join_paths(Wordless::theme_temp_path(), basename($img_filename));\n }", "function resizeSaveImage($filename, $destinationFile, $newWidth){\n\t\t \n\t\t list($width, $height) = getimagesize($filename);\n\t\t if($width > $newWidth){\n\t\t\t\t$percent = $newWidth / $width;\n\t\t\t\t$newHeight = $height * $percent;\n\t\t\t\t\n\t\t\t\t// Load\n\t\t\t\t$resizedImage = imagecreatetruecolor($newWidth, $newHeight);\n\t\t\t\t$source = imagecreatefromjpeg($filename);\n\t\t\t\t\n\t\t\t\t// Resize\n\t\t\t\timagecopyresized($resizedImage, $source, 0, 0, 0, 0, $newWidth, $newHeight, $width, $height);\n\t\t\t\t\n\t\t\t\t// Output\n\t\t\t\timagejpeg($resizedImage, $destinationFile, 100 );\n\t\t\t\t\n\t\t\t\t//memory clean up.\n\t\t\t\timagedestroy($source);\n\t\t\t\timagedestroy($resizedImage);\n\t\t }\n\t }", "function resizeThumbnailImage($thumb_image_name, $image, $width, $height, $start_width, $start_height, $scale){\n\t\tlist($imagewidth, $imageheight, $imageType) = getimagesize($image);\n\t\t$imageType = image_type_to_mime_type($imageType);\n\t\t\n\t\t$newImageWidth = ceil($width * $scale);\n\t\t$newImageHeight = ceil($height * $scale);\n\t\t$newImage = imagecreatetruecolor($newImageWidth,$newImageHeight);\n\t\tswitch($imageType) {\n\t\t\tcase \"image/gif\":\n\t\t\t\t$source=imagecreatefromgif($image); \n\t\t\t\tbreak;\n\t\t\tcase \"image/pjpeg\":\n\t\t\tcase \"image/jpeg\":\n\t\t\tcase \"image/jpg\":\n\t\t\t\t$source=imagecreatefromjpeg($image); \n\t\t\t\tbreak;\n\t\t\tcase \"image/png\":\n\t\t\tcase \"image/x-png\":\n\t\t\t\t$source=imagecreatefrompng($image); \n\t\t\t\tbreak;\n\t\t}\n\t\timagecopyresampled($newImage,$source,0,0,$start_width,$start_height,$newImageWidth,$newImageHeight,$width,$height);\n\t\tswitch($imageType) {\n\t\t\tcase \"image/gif\":\n\t\t\t\timagegif($newImage,$thumb_image_name); \n\t\t\t\tbreak;\n\t\t\tcase \"image/pjpeg\":\n\t\t\tcase \"image/jpeg\":\n\t\t\tcase \"image/jpg\":\n\t\t\t\timagejpeg($newImage,$thumb_image_name,90); \n\t\t\t\tbreak;\n\t\t\tcase \"image/png\":\n\t\t\tcase \"image/x-png\":\n\t\t\t\timagepng($newImage,$thumb_image_name); \n\t\t\t\tbreak;\n\t\t}\n\t\tchmod($thumb_image_name, 0777);\n\t\treturn $thumb_image_name;\n\t}", "function resizeImage($src_file, $dest_file, $new_size=100, $resize_aspect=\"sq\", $quality=\"80\")\n\t{\n\t\t$imginfo = getimagesize($src_file);\n\t\t\n\t\tif ($imginfo == null) {\n\t\treturn false;\n\t\t}\t \n\t\t\n\t\t// GD2 can only handle JPG, PNG & GIF images\n\t\tif (!$imginfo[2] > 0 && $imginfo[2] <= 3 ) {\n\t\t return false;\n\t\t}\n\t\t\n\t\t// height/width\n\t\t$srcWidth = $imginfo[0];\n\t\t$srcHeight = $imginfo[1];\n\t\t//$resize_aspect = \"sq\";\n\t\tif ($resize_aspect == 'ht') {\n\t\t $ratio = $srcHeight / $new_size;\n\t\t} elseif ($resize_aspect == 'wd') {\n\t\t $ratio = $srcWidth / $new_size;\n\t\t} elseif ($resize_aspect == 'sq') {\n\t\t $ratio = min($srcWidth, $srcHeight) / $new_size;\n\t\t} else {\n\t\t $ratio = max($srcWidth, $srcHeight) / $new_size;\n\t\t}\n\t\t\n\t\t/**\n\t\t* Initialize variables\n\t\t*/\n\t\t$clipX = 0;\n\t\t$clipY = 0;\n\t\t\n\t\t$ratio = max($ratio, 1.0);\n\t\tif ($resize_aspect == 'sq'){\n\t\t$destWidth = (int)(min($srcWidth,$srcHeight) / $ratio);\n\t\t$destHeight = (int)(min($srcWidth,$srcHeight) / $ratio);\n\t\tif($srcHeight > $srcWidth){\n\t\t$clipX = 0;\n\t\t$clipY = ((int)($srcHeight - $srcWidth)/2);\n\t\t$srcHeight = $srcWidth;\n\t\t}elseif($srcWidth > $srcHeight){\n\t\t$clipX = ((int)($srcWidth - $srcHeight)/2);\n\t\t$clipY = 0;\n\t\t$srcWidth = $srcHeight;\n\t\t}\n\t\t}else{\n\t\t$destWidth = (int)($srcWidth / $ratio);\n\t\t$destHeight = (int)($srcHeight / $ratio);\n\t\t}\n\t\t\n\t\tif (!function_exists('imagecreatefromjpeg')) {\n\t\t echo 'PHP running on your server does not support the GD image library, check with your webhost if ImageMagick is installed';\n\t\t exit;\n\t\t}\n\t\tif (!function_exists('imagecreatetruecolor')) {\n\t\t echo 'PHP running on your server does not support GD version 2.x, please switch to GD version 1.x on the admin page';\n\t\t exit;\n\t\t}\n\t\t\n\t\tif ($imginfo[2] == 1 )\n\t\t $src_img = imagecreatefromgif($src_file);\n\t\telseif ($imginfo[2] == 2)\n\t\t $src_img = imagecreatefromjpeg($src_file);\n\t\telse\n\t\t $src_img = imagecreatefrompng($src_file);\n\t\tif (!$src_img){\n\t\t return false;\n\t\t}\n\t\tif ($imginfo[2] == 1 ) {\n\t\t$dst_img = imagecreate($destWidth, $destHeight);\n\t\t} else {\n\t\t$dst_img = imagecreatetruecolor($destWidth, $destHeight);\n\t\t}\n\t\t\n\t\timagecopyresampled($dst_img, $src_img, 0, 0, $clipX, $clipY, (int)$destWidth, (int)$destHeight, $srcWidth, $srcHeight);\n\t\timagejpeg($dst_img, $dest_file, $quality);\n\t\timagedestroy($src_img);\n\t\timagedestroy($dst_img);\n\t\t\n\t\t// We check that the image is valid\n\t\t$imginfo = getimagesize($dest_file);\n\t\tif ($imginfo == null) {\n\t\t\t@unlink($dest_file);\n\t\t\treturn false;\n\t\t} else {\n\t\t\treturn true;\n\t\t}\n\t}", "function imgResizeHorW($file_ori,$UploadPath,$imgx=130,$imgy=150,$type='H',$clean=0) {\n\t\t$dest_filename='';\n\t\t\n\t\t$handle = new upload($file_ori);\n\t\t\n\t\t$img_proper=getimagesize($file_ori['tmp_name']);\n\t\t\n\t\tif ($handle->uploaded) {\n\t\t\tif($type=='W')\t{\n\t\t\t\t//$handle->image_x = $imgx;\n\t\t\t\t$handle->image_x = $imgx;\n\t\t\t\t$handle->image_resize = true;\n\t\t\t\t$handle->image_ratio_y = true;\n\t\t\t} else if($type=='H')\t{\n\t\t\t\t$handle->image_y = $imgy;\n\t\t\t\t$handle->image_resize = true;\n\t\t\t\t$handle->image_ratio_x = true;\n\t\t\t}\n\t\t}\n\t\t$handle->process($UploadPath);\n\t\tif ($handle->processed) {\n\t\t\t$dest_filename=$handle->file_dst_name;\n\t\t\tif($clean==1)\n\t\t\t\t$handle->clean();\n\t\t} else\n\t\t\t$dest_filename='';\n\t\treturn $dest_filename;\n\t}", "function resizer($image_file_name,$desc_location=null,$new_width=null,$new_height=null,$min_size=null,$show_image=true)\n\t{\n\t list($width, $height) = @getimagesize($image_file_name);\n\t if (empty($width) or empty($height)) {return false;}\n\n\t if (!is_null($min_size)) {\n\t if (is_null($min_size)) {$min_size=$new_width;}\n\t if (is_null($min_size)) {$min_size=$new_height;}\n\n\t if ($width>$height) {$new_height=$min_size;$new_width=null;}\n\t else {$new_width=$min_size;$new_height=null;}\n\t }\n\n\t// $my_new_height=$new_height;\n\t if (is_null($new_height) and !is_null($new_width))\n\t { $my_new_height=round($height*$new_width/$width);$my_new_width=$new_width; }\n\t elseif (!is_null($new_height))\n\t { $my_new_width=round($width*$new_height/$height);$my_new_height=$new_height; }\n\t//echo \"$my_new_width, $my_new_height <br/>\";\n\t $image_resized = imagecreatetruecolor($my_new_width, $my_new_height);\n\t $image = imagecreatefromjpeg($image_file_name);\n\t imagecopyresampled($image_resized, $image, 0, 0, 0, 0, $my_new_width, $my_new_height, $width, $height);\n\n\t //--(BEGIN)-->save , show or send image pointer as result\n\t if (!is_null($desc_location))\n\t imagejpeg($image_resized, $desc_location,100);\n\t elseif ($show_image==true)\n\t imagejpeg($image_resized);\n\t return $image_resized;\n\t //--(END)-->save , show or send image pointer as result\n\t}", "function resize_image($src_file, $dest_file, $new_size, $method, $thumb_use)\r\n{\r\n global $CONFIG, $ERROR;\r\n global $lang_errors;\r\n\r\n $imginfo = getimagesize($src_file);\r\n if ($imginfo == null)\r\n return false;\r\n // GD can only handle JPG & PNG images\r\n if ($imginfo[2] != GIS_JPG && $imginfo[2] != GIS_PNG && ($method == 'gd1' || $method == 'gd2')) {\r\n $ERROR = $lang_errors['gd_file_type_err'];\r\n return false;\r\n }\r\n // height/width\r\n $srcWidth = $imginfo[0];\r\n $srcHeight = $imginfo[1];\r\n if ($thumb_use == 'ht') {\r\n $ratio = $srcHeight / $new_size;\r\n } elseif ($thumb_use == 'wd') {\r\n $ratio = $srcWidth / $new_size;\r\n } else {\r\n $ratio = max($srcWidth, $srcHeight) / $new_size;\r\n }\r\n $ratio = max($ratio, 1.0);\r\n $destWidth = (int)($srcWidth / $ratio);\r\n $destHeight = (int)($srcHeight / $ratio);\r\n // Method for thumbnails creation\r\n switch ($method) {\r\n case \"im\" :\r\n if (preg_match(\"#[A-Z]:|\\\\\\\\#Ai\", __FILE__)) {\r\n // get the basedir, remove '/include'\r\n $cur_dir = substr(dirname(__FILE__), 0, -8);\r\n $src_file = '\"' . $cur_dir . '\\\\' . strtr($src_file, '/', '\\\\') . '\"';\r\n $im_dest_file = str_replace('%', '%%', ('\"' . $cur_dir . '\\\\' . strtr($dest_file, '/', '\\\\') . '\"'));\r\n } else {\r\n $src_file = escapeshellarg($src_file);\r\n $im_dest_file = str_replace('%', '%%', escapeshellarg($dest_file));\r\n }\r\n\r\n $output = array();\r\n /*\r\n * Hack for working with ImageMagick on WIndows even if IM is installed in C:\\Program Files.\r\n * By Aditya Mooley <[email protected]>\r\n */\r\n if (eregi(\"win\",$_ENV['OS'])) {\r\n $cmd = \"\\\"\".str_replace(\"\\\\\",\"/\", $CONFIG['impath']).\"convert\\\" -quality {$CONFIG['jpeg_qual']} {$CONFIG['im_options']} -geometry {$destWidth}x{$destHeight} \".str_replace(\"\\\\\",\"/\" ,$src_file ).\" \".str_replace(\"\\\\\",\"/\" ,$im_dest_file );\r\n exec (\"\\\"$cmd\\\"\", $output, $retval);\r\n } else {\r\n $cmd = \"{$CONFIG['impath']}convert -quality {$CONFIG['jpeg_qual']} {$CONFIG['im_options']} -geometry {$destWidth}x{$destHeight} $src_file $im_dest_file\";\r\n exec ($cmd, $output, $retval);\r\n }\r\n\r\n\r\n if ($retval) {\r\n $ERROR = \"Error executing ImageMagick - Return value: $retval\";\r\n if ($CONFIG['debug_mode']) {\r\n // Re-execute the command with the backtit operator in order to get all outputs\r\n // will not work is safe mode is enabled\r\n $output = `$cmd 2>&1`;\r\n $ERROR .= \"<br /><br /><div align=\\\"left\\\">Cmd line : <br /><font size=\\\"2\\\">\" . nl2br(htmlspecialchars($cmd)) . \"</font></div>\";\r\n $ERROR .= \"<br /><br /><div align=\\\"left\\\">The convert program said:<br /><font size=\\\"2\\\">\";\r\n $ERROR .= nl2br(htmlspecialchars($output));\r\n $ERROR .= \"</font></div>\";\r\n }\r\n @unlink($dest_file);\r\n return false;\r\n }\r\n break;\r\n\r\n case \"gd1\" :\r\n if (!function_exists('imagecreatefromjpeg')) {\r\n cpg_die(CRITICAL_ERROR, 'PHP running on your server does not support the GD image library, check with your webhost if ImageMagick is installed', __FILE__, __LINE__);\r\n }\r\n if ($imginfo[2] == GIS_JPG)\r\n $src_img = imagecreatefromjpeg($src_file);\r\n else\r\n $src_img = imagecreatefrompng($src_file);\r\n if (!$src_img) {\r\n $ERROR = $lang_errors['invalid_image'];\r\n return false;\r\n }\r\n $dst_img = imagecreate($destWidth, $destHeight);\r\n imagecopyresized($dst_img, $src_img, 0, 0, 0, 0, $destWidth, (int)$destHeight, $srcWidth, $srcHeight);\r\n imagejpeg($dst_img, $dest_file, $CONFIG['jpeg_qual']);\r\n imagedestroy($src_img);\r\n imagedestroy($dst_img);\r\n break;\r\n\r\n case \"gd2\" :\r\n if (!function_exists('imagecreatefromjpeg')) {\r\n cpg_die(CRITICAL_ERROR, 'PHP running on your server does not support the GD image library, check with your webhost if ImageMagick is installed', __FILE__, __LINE__);\r\n }\r\n if (!function_exists('imagecreatetruecolor')) {\r\n cpg_die(CRITICAL_ERROR, 'PHP running on your server does not support GD version 2.x, please switch to GD version 1.x on the config page', __FILE__, __LINE__);\r\n }\r\n if ($imginfo[2] == GIS_JPG)\r\n $src_img = imagecreatefromjpeg($src_file);\r\n else\r\n $src_img = imagecreatefrompng($src_file);\r\n if (!$src_img) {\r\n $ERROR = $lang_errors['invalid_image'];\r\n return false;\r\n }\r\n $dst_img = imagecreatetruecolor($destWidth, $destHeight);\r\n imagecopyresampled($dst_img, $src_img, 0, 0, 0, 0, $destWidth, (int)$destHeight, $srcWidth, $srcHeight);\r\n imagejpeg($dst_img, $dest_file, $CONFIG['jpeg_qual']);\r\n imagedestroy($src_img);\r\n imagedestroy($dst_img);\r\n break;\r\n }\r\n // Set mode of uploaded picture\r\n chmod($dest_file, octdec($CONFIG['default_file_mode']));\r\n // We check that the image is valid\r\n $imginfo = getimagesize($dest_file);\r\n if ($imginfo == null) {\r\n $ERROR = $lang_errors['resize_failed'];\r\n @unlink($dest_file);\r\n return false;\r\n } else {\r\n return true;\r\n }\r\n}", "function resizeThumbnailImage($thumb_image_name, $image, $width, $height, $start_width, $start_height, $scale){\n\t\t\t\tlist($imagewidth, $imageheight, $imageType) = getimagesize($image);\n\t\t\t\t$imageType = image_type_to_mime_type($imageType);\n\t\t\t\n\t\t\t\t$newImageWidth = ceil($width * $scale);\n\t\t\t\t$newImageHeight = ceil($height * $scale);\n\t\t\t\t$newImage = imagecreatetruecolor($newImageWidth,$newImageHeight);\n\t\t\t\tswitch($imageType) {\n\t\t\t\t\tcase \"image/gif\":\n\t\t\t\t\t\t$source=imagecreatefromgif($image);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"image/pjpeg\":\n\t\t\t\t\tcase \"image/jpeg\":\n\t\t\t\t\tcase \"image/jpg\":\n\t\t\t\t\t\t$source=imagecreatefromjpeg($image);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"image/png\":\n\t\t\t\t\tcase \"image/x-png\":\n\t\t\t\t\t\t$source=imagecreatefrompng($image);\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\timagecopyresampled($newImage,$source,0,0,$start_width,$start_height,$newImageWidth,$newImageHeight,$width,$height);\n\t\t\t\tswitch($imageType) {\n\t\t\t\t\tcase \"image/gif\":\n\t\t\t\t\t\timagegif($newImage,$thumb_image_name);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"image/pjpeg\":\n\t\t\t\t\tcase \"image/jpeg\":\n\t\t\t\t\tcase \"image/jpg\":\n\t\t\t\t\t\timagejpeg($newImage,$thumb_image_name,90);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"image/png\":\n\t\t\t\t\tcase \"image/x-png\":\n\t\t\t\t\t\timagepng($newImage,$thumb_image_name);\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tchmod($thumb_image_name, 0777);\n\t\t\t\treturn $thumb_image_name;\n\t\t\t}", "function img_upload () {\n \t//override the default memory allocation\n \tini_set(\"memory_limit\",\"50M\");\n \t//upload config\n\t\t$config = array(\n\t\t\t'allowed_types' => 'jpg|jpeg|gif|png',\n\t\t\t'max_size' => 99000,\n\t\t\t'upload_path' => $this->temp_path\n\t\t);\n\t\t$this->load->library('upload', $config);\n\t\t//perform upload, if error, return message \n\t\tif ( ! $this->upload->do_upload()) {\n\t\t\t$error = array('error' => $this->upload->display_errors());\n\t\t\treturn $error;\n\t\t} //otherwise everything is good to go\n\n\t\t$image_data = $this->upload->data();\n\t\t\n\t\t//generate unique filename\n\t\t$filename = '';\n\t\t//$filename = $this->generate_filename ($this->img_path, $image_data['file_ext']);\n\t\twhile (true) {\n\t\t\t$filename = uniqid(mt_rand(), true) . $image_data['file_ext'];\n\t\t\tif (!file_exists($this->img_path . '/' . $filename)) break;\n\t\t}\n\t\t\n\t\t//large image, resize to 800\n\t\t$config = array (\n\t\t\t'source_image' => $image_data['full_path'],\n\t\t\t'new_image' => $this->img_path . '/lg/' . $filename,\n\t\t\t'maintain_ratio' => true,\n\t\t\t'width' => 800,\n\t\t\t'height' => 800\n\t\t);\n\t\t//resize library\n\t\t$this->load->library('image_lib', $config);\n\t\t$this->image_lib->initialize($config);\n\t\t//create the image\n\t\t$this->image_lib->resize();\n\t\t\n\t\t//resize to 410, main image that will be viewed more tban large or thumb\n\t\t$med_config = array (\n\t\t\t'source_image' => $image_data['full_path'],\n\t\t\t'new_image' => $this->img_path . '/' . $filename,\n\t\t\t'maintain_ratio' => true,\n\t\t\t'width' => 410,\n\t\t\t'height' => 410\n\t\t);\n\t\t//resize library\n\t\t$this->load->library('image_lib', $config);\n\t\t//create the image\n\t\t$this->image_lib->initialize($med_config);\n\t\t$this->image_lib->resize();\n\n\t\t//resize config data\n\t\t$tn_config = array (\n\t\t\t'source_image' => $image_data['full_path'],\n\t\t\t'new_image' => $this->img_path . '/tn/' . $filename,\n\t\t\t'create_thumb' => true,\n\t\t\t'maintain_ratio' => false,\n\t\t\t'width' => 110,\n\t\t\t'height' => 110\n\t\t);\n\t\t//resize library\n\t\t$this->image_lib->initialize($tn_config);\n\t\t$this->image_lib->resize();\n\n\t\t//delete original\n\t\tunlink($image_data['full_path']);\n\t\t\n\t\t$image_id = $this->artists_model->add_image($this->tank_auth->get_user_id(), $filename);\n\t\t\n\t\treturn array('success' => '/pb/img/' . $filename, \n\t\t\t\t\t'filename' => $filename,\n\t\t\t\t\t'image_id' => $image_id);\n }", "function UploadFoto($fupload_name, $folder, $ukuran){\n // File gambar yang di upload\n $file_upload = $folder . $fupload_name;\n\n // Simpan gambar dalam ukuran aslinya\n move_uploaded_file($_FILES[\"fupload\"][\"tmp_name\"], $file_upload);\n\n // Identitas file asli\n $gbr_asli = imagecreatefromjpeg($file_upload);\n $lebar = imageSX($gbr_asli);\n $tinggi \t= imageSY($gbr_asli);\n\n // Simpan dalam versi thumbnail\n $thumb_lebar = $ukuran;\n $thumb_tinggi = $ukuran;\n\n // Proses perubahan dimensi ukuran\n $gbr_thumb = imagecreatetruecolor($thumb_lebar,$thumb_tinggi);\n imagecopyresampled($gbr_thumb, $gbr_asli, 0, 0, 0, 0, $thumb_lebar, $thumb_tinggi, $lebar, $tinggi);\n\n // Simpan gambar thumbnail\n imagejpeg($gbr_thumb,$folder . \"small_\" . $fupload_name);\n \n // Hapus gambar di memori komputer\n imagedestroy($gbr_asli);\n imagedestroy($gbr_thumb);\n}", "function imagethumb( $image_src , $image_dest = NULL , $max_size = 500, $expand = FALSE, $square = FALSE )\n{\n\tif( !file_exists($image_src) ) return FALSE;\n\n\t// Récupère les infos de l'image\n\t$fileinfo = getimagesize($image_src);\n\n\techo \"file infos :\".$fileinfo[0].\"---\".$fileinfo[1];\n\t\n\tif( !$fileinfo ) return FALSE;\n\n\t$width = $fileinfo[0];\n\t$height = $fileinfo[1];\n\n\n\t$type_mime = $fileinfo['mime'];\n\n\n\t$type = str_replace('image/', '', $type_mime);\n\n\t//echo \"\\ntype_mime --> \".$type;\n\n\tif( !$expand && max($width, $height)<=$max_size && (!$square || ($square && $width==$height) ) )\n\t{\n\t\t// L'image est plus petite que max_size\n\t\tif($image_dest)\n\t\t{\n\t\t\treturn copy($image_src, $image_dest);\n\t\t}\n\t\telse\n\t\t{\n\t\t\theader('Content-Type: '. $type_mime);\n\t\t\treturn (boolean) readfile($image_src);\n\t\t}\n\t}\n\n\t// Calcule les nouvelles dimensions\n\t$ratio = $width / $height;\n\n\tif( $square )\n\t{\n\t\t$new_width = $new_height = $max_size;\n\n\t\tif( $ratio > 1 )\n\t\t{\n\t\t\t// Paysage\n\t\t\t$src_y = 0;\n\t\t\t$src_x = round( ($width - $height) / 2 );\n\n\t\t\t$src_w = $src_h = $height;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Portrait\n\t\t\t$src_x = 0;\n\t\t\t$src_y = round( ($height - $width) / 2 );\n\n\t\t\t$src_w = $src_h = $width;\n\t\t}\n\t}\n\telse\n\t{\n\t\t$src_x = $src_y = 0;\n\t\t$src_w = $width;\n\t\t$src_h = $height;\n\n\t\tif ( $ratio > 1 )\n\t\t{\n\t\t\t// Paysage\n\t\t\t$new_width = $max_size;\n\t\t\t$new_height = round( $max_size / $ratio );\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Portrait\n\t\t\t$new_height = $max_size;\n\t\t\t$new_width = round( $max_size * $ratio );\n\t\t}\n\t}\n\n\t// Ouvre l'image originale\n\t$func = 'imagecreatefrom' . $type;\n\tif( !function_exists($func) ) return FALSE;\n\n\t$image_src = $func($image_src);\n\t$new_image = imagecreatetruecolor($new_width,$new_height);\n\n\t// Gestion de la transparence pour les png\n\tif( $type=='png' )\n\t{\n\t\timagealphablending($new_image,false);\n\t\tif( function_exists('imagesavealpha') )\n\t\t\timagesavealpha($new_image,true);\n\t}\n\n\t// Gestion de la transparence pour les gif\n\telseif( $type=='gif' && imagecolortransparent($image_src)>=0 )\n\t{\n\t\t$transparent_index = imagecolortransparent($image_src);\n\t\t$transparent_color = imagecolorsforindex($image_src, $transparent_index);\n\t\t$transparent_index = imagecolorallocate($new_image, $transparent_color['red'], $transparent_color['green'], $transparent_color['blue']);\n\t\timagefill($new_image, 0, 0, $transparent_index);\n\t\timagecolortransparent($new_image, $transparent_index);\n\t}\n\n\t// Redimensionnement de l'image\n\timagecopyresampled(\n\t\t$new_image, $image_src,\n\t\t0, 0, $src_x, $src_y,\n\t\t$new_width, $new_height, $src_w, $src_h\n\t);\n\n\t// Enregistrement de l'image\n\t$func = 'image'. $type;\n\tif($image_dest)\n\t{\n\t\t$func($new_image, $image_dest);\n\t}\n\telse\n\t{\n\t\theader('Content-Type: '. $type_mime);\n\t\t$func($new_image);\n\t}\n\n\t// Libération de la mémoire\n\timagedestroy($new_image); \n\n\treturn TRUE;\n}", "public function uploadImage($file)\n {\n $iErrorCode = 0 ;\n\n if ($iErrorCode == 0) {\n $zFileName = $_FILES[$file][\"name\"] ;\n $zFileType = $_FILES[$file][\"type\"] ;\n $iFileSize = intval ($_FILES[$file][\"size\"]) ;\n $zDirTempName = $_FILES[$file][\"tmp_name\"] ;\n\n $bCreateFolders = true ;\n $zBackgroundColor = null ;\n $iImageQuality = IMAGE_QUALITY ;\n\n // rename file if already exists\n if (file_exists (\"publicites/big/\" . $zFileName)) {\n $iExistFileCount = 1 ;\n\n $zExt = strtolower (CCommonTools::getFileNameExtension ($zFileName)) ;\n $zNoExtName = preg_replace (\"/[.]\" . $zExt . \"$/\", \"\", $zFileName) ;\n\n while (file_exists (\"publicites/big\" . \"/\" . $zNoExtName . \"-\" . $iExistFileCount . \".\" . $zExt))\n {\n $iExistFileCount++ ;\n }\n $zFileName = $zNoExtName . \"-\" . $iExistFileCount . \".\" . $zExt ;\n }\n // big \n $oLayerBig = ImageWorkshop::initFromPath ($_FILES [$file]['tmp_name']) ;\n $oLayerBig->save (\"publicites/big\", $zFileName, $bCreateFolders, $zBackgroundColor, $iImageQuality) ;\n\n // thumbnail (must)\n $oLayerThumbnail = ImageWorkshop::initFromPath ($_FILES [$file]['tmp_name']) ;\n $iExpectedWidth = 96 ;\n $iExpectedHeight = 96 ;\n\n ($iExpectedWidth > $iExpectedHeight) ? $iLargestSide = $iExpectedWidth : $iLargestSide = $iExpectedHeight;\n\n $oLayerThumbnail->cropMaximumInPixel (0, 0, \"MM\") ;\n $oLayerThumbnail->resizeInPixel ($iLargestSide, $iLargestSide) ;\n $oLayerThumbnail->cropInPixel ($iExpectedWidth, $iExpectedHeight, 0, 0, 'MM') ;\n $oLayerThumbnail->save (\"publicites/thumbnail\", $zFileName, $bCreateFolders, $zBackgroundColor, $iImageQuality) ;\n // rename file if already exists\n\n if ($iErrorCode == 0) {\n $this->image = $zFileName;\n }\n return $iErrorCode;\n }\n }", "function resizeUpload($field,$pic_dir,$name_dir,$cropratio=NULL,$watermark=NULL,$max_width,$max_height,$add_to_filename=NULL, $quality=90){\r\n\t\tglobal $font_path, $font_size, $water_mark_text_1, $water_mark_text;\r\n\t\t$maxwidth = $max_width; // Max new width or height, can not exceed this value.\r\n\t\t$maxheight = $max_height;\r\n\t\t$dir = $pic_dir; // Directory to save resized image. (Include a trailing slash - /)\r\n\t\t// Collect the post variables.\r\n\t\t$postvars = array(\r\n\t\t\t\"image\" => trim($_FILES[\"$field\"][\"name\"]),\r\n\t\t\t\"image_tmp\" => $_FILES[\"$field\"][\"tmp_name\"],\r\n\t\t\t\"image_size\" => (int)$_FILES[\"$field\"][\"size\"],\r\n\t\t\t);\r\n\t\t\t// Array of valid extensions.\r\n\t\t\t$valid_exts = array(\"jpg\",\"jpeg\",\"gif\",\"png\");\r\n\t\t\t$mod_exts = array(\"gif\",\"png\");\r\n\t\t\t// Select the extension from the file.\r\n\t\t\t$ext = end(explode(\".\",strtolower(trim($_FILES[\"$field\"][\"name\"]))));\r\n\t\t\t//echo (\"Image size: \" . $postvars[\"image_size\"] . \"<br> Ext: \" . $ext . \"<br>\");\r\n\t\t\t// Check is valid extension.\r\n\t\t\tif(in_array($ext,$valid_exts)){\r\n\t\t\t\tif($ext == \"jpg\" || $ext == \"jpeg\"){\r\n\t\t\t\t\t$image = imagecreatefromjpeg($postvars[\"image_tmp\"]);\r\n\t\t\t\t}\r\n\t\t\t\telse if($ext == \"gif\"){\r\n\t\t\t\t\t$image = imagecreatefromgif($postvars[\"image_tmp\"]);\r\n\t\t\t\t}\r\n\t\t\t\telse if($ext == \"png\"){\r\n\t\t\t\t\t$image = imagecreatefrompng($postvars[\"image_tmp\"]);\r\n\t\t\t\t}\r\n\t\t\t\t// Grab the width and height of the image.\r\n\t\t\t\tlist($width,$height) = getimagesize($postvars[\"image_tmp\"]);\r\n\t\t\t\t// Ratio cropping\r\n\t\t\t\t$offsetX\t= 0;\r\n\t\t\t\t$offsetY\t= 0;\r\n\t\t\t\tif ($cropratio) {\r\n\t\t\t\t\t\t$cropRatio = explode(':', (string) $cropratio);\r\n\t\t\t\t\t\t$ratioComputed\t\t= $width / $height;\r\n\t\t\t\t\t\t$cropRatioComputed\t= (float) $cropRatio[0] / (float) $cropRatio[1];\r\n\t\t\t\t\t\tif ($ratioComputed < $cropRatioComputed)\r\n\t\t\t\t\t\t{ // Image is too tall so we will crop the top and bottom\r\n\t\t\t\t\t\t\t$origHeight\t= $height;\r\n\t\t\t\t\t\t\t$height\t\t= $width / $cropRatioComputed;\r\n\t\t\t\t\t\t\t$offsetY\t= ($origHeight - $height) / 2;\r\n\t\t\t\t\t\t\t$smallestSide = $width;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse if ($ratioComputed > $cropRatioComputed)\r\n\t\t\t\t\t\t{ // Image is too wide so we will crop off the left and right sides\r\n\t\t\t\t\t\t\t$origWidth\t= $width;\r\n\t\t\t\t\t\t\t$width\t\t= $height * $cropRatioComputed;\r\n\t\t\t\t\t\t\t$offsetX\t= ($origWidth - $width) / 2;\r\n\t\t\t\t\t\t\t$smallestSide = $height;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t// We get the other dimension by multiplying the quotient of the new width or height divided by\r\n\t\t\t\t// the old width or height.\r\n\t\t\t $w_adjust = ($maxwidth / $width);\r\n\t\t\t $h_adjust = ($maxheight / $height);\r\n\t\t\t if (($width >= $maxwidth)||($height >= $maxheight)) {\r\n\t\t\t\t if($w_adjust <= $h_adjust)\r\n\t\t\t\t {\r\n\t\t\t\t\t $newwidth=floor($width*$w_adjust);\r\n\t\t\t\t\t $newheight=floor($height*$w_adjust);\r\n\t\t\t\t } else {\r\n\t\t\t\t\t $newwidth=floor($width*$h_adjust);\r\n\t\t\t\t\t $newheight=floor($height*$h_adjust);\r\n\t\t\t\t }\r\n\t\t\t } else {\r\n\t\t\t\t \t$newwidth=$width;\r\n\t\t\t\t\t$newheight=$height;\r\n\t\t\t }\r\n\t\t\t\t// Create temporary image file.\r\n\t\t\t\t$tmp = imagecreatetruecolor($newwidth,$newheight);\r\n\t\t\t\t\r\n\t\t\t\t// Copy the image to one with the new width and height.\r\n\t\t\t\t\timagecopyresampled($tmp,$image,0,0,$offsetX,$offsetY,$newwidth,$newheight,$width,$height);\r\n\t\t\t\t\t// Create random 5 digit number for filename. Add to current timestamp.\r\n\t\t\t\t\t$rand = rand(10000,99999);\r\n\t\t\t\t\t$rand .= time();\r\n\t\t\t\t\t$origfilename = $name_dir.$rand ;\r\n if ($add_to_filename){ $origfilename .= \"_\".$add_to_filename; }\r\n $origfilename .= \".jpg\";\r\n\t\t\t\t\t\r\n\t\t\t\t\t$filename = $dir.$rand;\r\n if ($add_to_filename){ $filename .= \"_\".$add_to_filename; }\r\n $filename .= \".jpg\";\r\n\r\n\t\t\t\tif ($watermark) {\r\n\t\t\t\t\t//Apply watermark here\t\t\t\t\t\r\n\t\t\t\t\t$maroon = imagecolorallocate($tmp, 134, 22, 0);\r\n\t\t\t\t\t$white = imagecolorallocate($tmp, 255, 255, 255);\r\n\t\t\t\t\t/*$base_height = $newheight-20;\r\n\t\t\t\t\t$base_width = $newwidth/5;*/\r\n\t\t\t\t\t//$borderOffset = 4;\r\n\t\t\t\t\t$dimensions = imagettfbbox($font_size, 0, $font_path, $water_mark_text);\r\n\t\t\t\t\t$lineWidth = ($dimensions[2] - $dimensions[0]);\r\n\t\t\t\t\t$textX = (ImageSx($tmp) - $lineWidth) / 2;\r\n\t\t\t\t\t$textY = ($newheight/10)*9;\t\t\t\t\t\r\n\t\t\t\t // Add some shadow to the text\t\t\t\t\t\r\n\t\t\t\t\timagettftext($tmp, $font_size, 0, $textX+1,$textY+1, $white, $font_path, $water_mark_text);\r\n\t\t\t\t\timagettftext($tmp, $font_size, 0, $textX, $textY, $maroon, $font_path, $water_mark_text);\r\n\t\t\t\t}\t\t\t\t\t\t\t\r\n\r\n\t\t\t\t// Create image file with specified quality in % (low quality image in less image sharpness)\r\n\t\t\t\timagejpeg($tmp,$filename,$quality);\r\n\t\t\t\treturn $origfilename;\r\n\r\n\t\t\t\timagedestroy($image);\r\n\t\t\t\timagedestroy($tmp);\t\r\n\r\n\t\t\t}\r\n\r\n\t\r\n\r\n\t}", "function resizeImage($filename, $max_width, $max_height)\n{\n list($orig_width, $orig_height) = getimagesize($filename);\n\n $width = $orig_width;\n $height = $orig_height;\n\n # taller\n if ($max_height != 0 && $max_width != 0)\n {\n\t if ($height > $max_height) {\n\t\t $width = ($max_height / $height) * $width;\n\t\t $height = $max_height;\n\t }\n\n\t # wider\n\t if ($width > $max_width) {\n\t\t $height = ($max_width / $width) * $height;\n\t\t $width = $max_width;\n\t }\n }\n\n $image_p = imagecreatetruecolor($width, $height);\n\n $image = imagecreatefromjpeg($filename);\n\n imagecopyresampled($image_p, $image, 0, 0, 0, 0,\n $width, $height, $orig_width, $orig_height);\n\n return $image_p;\n}", "private function _resizeThumbnailImage($thumb_image_name, $image, $width, $height, $src_width, $src_height, $scale){\n\t\t$newImageWidth = ceil($width * $scale);\n\t\t$newImageHeight = ceil($height * $scale);\n\t\t$newImage = imagecreatetruecolor($newImageWidth,$newImageHeight);\n\t\t$source = imagecreatefromjpeg($image);\n\t\timagecopyresampled($newImage,$source,0,0,0,0,$width,$height,$src_width,$src_height);\n\t\timagejpeg($newImage,$thumb_image_name,90);\n\t\tchmod($thumb_image_name, 0777);\n\t\t//return $thumb_image_name;\n\t}", "function resizeImage($sourceImage, $targetImage, $maxWidth, $maxHeight, $quality = 80) {\n echo 'sourceImage ';\n echo $sourceImage;\n echo ' targetImage ';\n echo $targetImage;\n // Obtain image from given source file.\n\tif (!$image = @imagecreatefromjpeg($sourceImage)) {\n\t\techo 'false';\n return false;\n }\n\techo ' pre list ';\n // Get dimensions of source image.\n list($origWidth, $origHeight) = getimagesize($sourceImage);\n\n if ($maxWidth == 0) {\n $maxWidth = $origWidth;\n }\n\n if ($maxHeight == 0) {\n $maxHeight = $origHeight;\n }\n\n // Calculate ratio of desired maximum sizes and original sizes.\n $widthRatio = $maxWidth / $origWidth;\n $heightRatio = $maxHeight / $origHeight;\n\n // Ratio used for calculating new image dimensions.\n $ratio = min($widthRatio, $heightRatio);\n\n // Calculate new image dimensions.\n $newWidth = (int)$origWidth * $ratio;\n $newHeight = (int)$origHeight * $ratio;\n\techo 'pre true color ';\n // Create final image with new dimensions.\n\t$newImage = imagecreatetruecolor($newWidth, $newHeight);\n\techo 'post true color ';\n\n // $image = str_replace(' ','_',$image);\n\n\timagecopyresampled($newImage, $image, 0, 0, 0, 0, $newWidth, $newHeight, $origWidth, $origHeight);\n\techo 'post resampled ';\n\n // CREATE PROGRESSIVE IMG INSTANCE\n // $imageProg = imagecreatefromjpeg($image);\n // imageinterlace($imageProg, true);\n // echo 'post progressive';\n\n\timagejpeg($newImage, $targetImage, $quality);\n // imagejpeg($imageProg, $targetImage, $quality);\n\techo 'post imagejpeg ';\n\n // FREE UP MEMORY\n imagedestroy($image);\n imagedestroy($newImage);\n // imagedestroy($imageProg);\n\n return true;\n}", "function resize_image($filename)\n {\n $img_source = 'assets/images/products/'. $filename;\n $img_target = 'assets/images/thumb/';\n\n // image lib settings\n $config = array(\n 'image_library' => 'gd2',\n 'source_image' => $img_source,\n 'new_image' => $img_target,\n 'maintain_ratio' => FALSE,\n 'width' => 128,\n 'height' => 128\n );\n // load image library\n $this->load->library('image_lib', $config);\n\n // resize image\n if(!$this->image_lib->resize())\n echo $this->image_lib->display_errors();\n $this->image_lib->clear();\n }", "function upload_passport($path, $ext, $sn) {\n $img_url = 'passport' . $sn . '-' . date('mdYHis.') . $ext;\n move_uploaded_file($path, \"temp_img/\" . $img_url);\n $resizeObj = new resize(\"temp_img/\" . $img_url);\n $resizeObj->resizeImage(280, 350, 'crop');\n $resizeObj->saveImage(\"pics/\" . $img_url, 100);\n unlink(\"temp_img/\" . $img_url);\n return $img_url;\n}", "function imageUploadThumb($temp_name, $type, $w, $h)\n {\n\n // $name = $_FILES[\"image_upload\"][\"name\"];\n // $size = $_FILES[\"image_upload\"][\"size\"];\n // $ext = end(explode(\".\", $_FILES[\"image_upload\"][\"name\"]));\n $allowed_ext = array(\"png\", \"jpg\", \"jpeg\");\n $random = rand(0, 999999999);\n $extension1 = explode(\".\", $type);\n $extension = end($extension1);\n $new_name = $random . \".\" . $extension;\n $new_image = '';\n // $new_name = md5(rand()) . '.' . $ext;\n $path = '../images/' . $new_name;\n list($width, $height) = getimagesize($temp_name);\n if ($extension == 'png') {\n $new_image = imagecreatefrompng($temp_name);\n }\n if ($extension == 'jpg' || $extension == 'jpeg') {\n $new_image = imagecreatefromjpeg($temp_name);\n }\n $new_width = $w;\n $new_height = $h;\n // $new_height = ($height / $width) * 200;\n $tmp_image = imagecreatetruecolor(\n $new_width,\n $new_height\n );\n imagecopyresampled(\n $tmp_image,\n $new_image,\n 0,\n 0,\n 0,\n 0,\n $new_width,\n $new_height,\n $width,\n $height\n );\n imagejpeg($tmp_image, $path, 100);\n imagedestroy($new_image);\n imagedestroy($tmp_image);\n // $img1 = $image['image']['name'];\n // $type = $image['image']['type'];\n\n // $temp = $image['image']['tmp_name'];\n // if (move_uploaded_file($temp_name, \"../images/$img\")) {\n return $new_name;\n // } else {\n // return false;\n // }\n $this->conn = null;\n }", "function getImageResize($image, $width, $height = 0, $adds)\r\n {\r\n $imageinfo = getimagesize($image);\r\n if (!$imageinfo[0] and !$imageinfo[1]) {\r\n // TO DO***** copy file to server, get size, than delete...\r\n }\r\n $out['w'] = $imageinfo[0];\r\n $out['h'] = $imageinfo[1]; \r\n if ($height == 0) {\r\n $input_ratio = $imageinfo[0] / $imageinfo[1];\r\n $height = $width / $input_ratio;\r\n if ($imageinfo[0] < $width) {\r\n $width = $imageinfo[0];\r\n $height = $imageinfo[1];\r\n }\r\n }\r\n else {\r\n $input_ratio = $imageinfo[0] / $imageinfo[1];\r\n $ratio = $width / $height;\r\n if ($ratio < $input_ratio) {\r\n $height = $width / $input_ratio;\r\n }\r\n else {\r\n $width = $height * $input_ratio;\r\n }\r\n if (($imageinfo[0] < $width) && ($imageinfo[1] < $height)) {\r\n $width = $imageinfo[0];\r\n $height = $imageinfo[1];\r\n }\r\n }\r\n $attr = ' height=\"' . floor($height) . '\" width=\"' . floor($width) . '\"';\r\n return $this->imageHtmlCode($image, $adds, $attr);\r\n }", "function _resizeImageIM($src_file, $dest_file, $new_size) {\r\n \t$retval = $output = null;\r\n $cmd = $this->_IM_path.\"convert -resize $new_size \\\"$src_file\\\" \\\"$dest_file\\\"\";\r\n exec($cmd, $output, $retval);\r\n if($retval) {\r\n return false;\r\n } else {\r\n return true;\r\n }\r\n }", "function miniw($image_file, $destination, $width, $quality){\r\n# $image_file = sumber gambar\r\n# $destination = hasil thumbnail (path + file)\r\n# $width = lebar thumbnail (pixel)\r\n# $quality = kualitas JPG thumbnail\r\n\r\n$thumbw = $width; //lebar=100; tinggi akan diproposionalkan\r\n\r\n$src_img = imagecreatefromjpeg($image_file);\r\n$size[0] = ImageSX($src_img); // lebar\r\n$size[1] = ImageSY($src_img); // tinggi\r\n\r\n$thumbh = ($thumbw/$size[0])*$size[1]; //height\r\n$scale = min($thumbw/$size[0], $thumbh/$size[1]);\r\n$width = (int)($size[0]*$scale);\r\n$height = (int)($size[1]*$scale);\r\n$deltaw = (int)(($thumbw - $width)/2);\r\n$deltah = (int)(($thumbh - $height)/2);\r\n\r\nif($thumbw < $size[0]){\r\n$dst_img = imagecreatetruecolor($thumbw, $thumbh);\r\nimagecopyresampled($dst_img, $src_img, 0,0, 0,0, $thumbw, $thumbh,\r\n$size[0], $size[1]);\r\ntouch($destination);\r\nimagejpeg($dst_img, $destination, $quality); // Ini hasil akhirnya.\r\nimagedestroy($dst_img);\r\n} else {\r\n$dst_img = imagecreatetruecolor($size[0], $size[1]);\r\nimagecopyresampled($dst_img, $src_img, 0,0, 0,0, $size[0], $size[1],\r\n$size[0], $size[1]);\r\ntouch($destination);\r\nimagejpeg($dst_img, $destination, $quality); // Ini hasil akhirnya.\r\nimagedestroy($dst_img);\r\n}\r\n\r\nimagedestroy($src_img);\r\n}", "function cjpopups_resize_image($src, $width, $height = null, $crop = false, $single = false){\n\trequire_once(sprintf('%s/aq_resizer.php', cjpopups_item_path('helpers_dir')));\n\t$resized = aq_resize($src, $width, $height, $crop, $single);\n\tif(!empty($resized)){\n\t\treturn $resized;\n\t}else{\n\t\t$placeholder = 'http://placehold.it/'.$width.'x'.$height.'&text=No+Thumbnail';;\n\t\tif($single){\n\t\t\t$return = $placeholder;\n\t\t}else{\n\t\t\t$return[] = $placeholder;\n\t\t\t$return[] = $width;\n\t\t\t$return[] = $height;\n\t\t}\n\t\treturn $return;\n\t}\n}", "function replace_image($id)\n {\n\t $iamgepath=\"./images/big/\"; //base image name \n\t\t $thumpath=\"./images/smal/\";\n\t\t $oldname=$iamgepath.\"temp.jpg\";//image file name \n\t\t $newname=$iamgepath.\"person_L_\".$id.\".jpg\";//new image name \n\t\t $newthumname=$thumpath.\"person_S_\".$id.\".jpg\";\n\t\t if(file_exists($newname))\n\t\t {\n\t\t unlink($newname);// delete the big picture\n\t\t unlink($newthumname);// delete the thumnail \n\t\t }\n\t\t copy($oldname,$newthumname);//copy new file to thumnail folder and renaming it\n\t rename($oldname,$newname);//renaming the temp image \n\t\t \n\t\t // resizing the image in small folder\n\t\t \n \t\t $config['image_library'] = 'gd2';\n $config['source_image']\t= $newthumname;\n\t\t $config['new_image']\t= $newthumname;\n\t\t $config['create_thumb'] = FALSE;\n $config['maintain_ratio'] = TRUE;\n $config['width']\t = 50;\n $config['height'] = 50;\n\t\t $this->load->library('image_lib', $config);//initialise image librarry\n\t\t \n\t\t if ( ! $this->image_lib->resize()) // resizing the picture \n {\n echo 'image resizing is not working';\n\t\t\t echo $this->image_lib->display_errors();\n } \n\t\t\t\n\t\n\t\n\t}", "function resizeImage($old_image_path, $new_image_path, $max_width, $max_height) {\r\n \r\n // Get image type\r\n $image_info = getimagesize($old_image_path);\r\n $image_type = $image_info[2];\r\n \r\n // Set up the function names\r\n switch ($image_type) {\r\n case IMAGETYPE_JPEG:\r\n $image_from_file = 'imagecreatefromjpeg';\r\n $image_to_file = 'imagejpeg';\r\n break;\r\n case IMAGETYPE_GIF:\r\n $image_from_file = 'imagecreatefromgif';\r\n $image_to_file = 'imagegif';\r\n break;\r\n case IMAGETYPE_PNG:\r\n $image_from_file = 'imagecreatefrompng';\r\n $image_to_file = 'imagepng';\r\n break;\r\n default:\r\n return;\r\n } // ends the swith\r\n \r\n // Get the old image and its height and width\r\n $old_image = $image_from_file($old_image_path);\r\n $old_width = imagesx($old_image);\r\n $old_height = imagesy($old_image);\r\n \r\n // Calculate height and width ratios\r\n $width_ratio = $old_width / $max_width;\r\n $height_ratio = $old_height / $max_height;\r\n \r\n // If image is larger than specified ratio, create the new image\r\n if ($width_ratio > 1 || $height_ratio > 1) {\r\n \r\n // Calculate height and width for the new image\r\n $ratio = max($width_ratio, $height_ratio);\r\n $new_height = round($old_height / $ratio);\r\n $new_width = round($old_width / $ratio);\r\n \r\n // Create the new image\r\n $new_image = imagecreatetruecolor($new_width, $new_height);\r\n \r\n // Set transparency according to image type\r\n if ($image_type == IMAGETYPE_GIF) {\r\n $alpha = imagecolorallocatealpha($new_image, 0, 0, 0, 127);\r\n imagecolortransparent($new_image, $alpha);\r\n }\r\n \r\n if ($image_type == IMAGETYPE_PNG || $image_type == IMAGETYPE_GIF) {\r\n imagealphablending($new_image, false);\r\n imagesavealpha($new_image, true);\r\n }\r\n \r\n // Copy old image to new image - this resizes the image\r\n $new_x = 0;\r\n $new_y = 0;\r\n $old_x = 0;\r\n $old_y = 0;\r\n imagecopyresampled($new_image, $old_image, $new_x, $new_y, $old_x, $old_y, $new_width, $new_height, $old_width, $old_height);\r\n \r\n // Write the new image to a new file\r\n $image_to_file($new_image, $new_image_path);\r\n // Free any memory associated with the new image\r\n imagedestroy($new_image);\r\n } else {\r\n // Write the old image to a new file\r\n $image_to_file($old_image, $new_image_path);\r\n }\r\n // Free any memory associated with the old image\r\n imagedestroy($old_image);\r\n }", "function convert_image($fname,$path,$wid,$hei)\n{\n\t$wid = intval($wid); \n\t$hei = intval($hei); \n\t//$fname = $sname;\n\t$sname = \"$path$fname\";\n\t//echo $sname;\n\t//header('Content-type: image/jpeg,image/gif,image/png');\n\t//image size\n\tlist($width, $height) = getimagesize($sname);\n\t\n\tif($hei == \"\")\n\t{\n\t\tif($width < $wid)\n\t\t{\n\t\t\t$wid = $width;\n\t\t\t$hei = $height;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$percent = $wid/$width; \n\t\t\t$wid = $wid;\n\t\t\t$hei = round ($height * $percent);\n\t\t}\n\t}\n\t\n\t//$wid=469;\n\t//$hei=290;\n\t$thumb = imagecreatetruecolor($wid,$hei);\n\t//image type\n\t$type=exif_imagetype($sname);\n\t//check image type\n\tswitch($type)\n\t{\n\tcase 2:\n\t$source = imagecreatefromjpeg($sname);\n\tbreak;\n\tcase 3:\n\t$source = imagecreatefrompng($sname);\n\tbreak;\n\tcase 1:\n\t$source = imagecreatefromgif($sname);\n\tbreak;\n\t}\n\t// Resize\n\timagecopyresized($thumb, $source, 0, 0, 0, 0,$wid,$hei, $width, $height);\n\t//echo \"converted\";\n\t//else\n\t//echo \"not converted\";\n\t// source filename\n\t$file = basename($sname);\n\t//destiantion file path\n\t//$path=\"uploaded/flashgallery/\";\n\t$dname=$path.$fname;\n\t//display on browser\n\t//imagejpeg($thumb);\n\t//store into file path\n\timagejpeg($thumb,$dname);\n}", "function show_image($image, $width, $height) { //$image_content = read_file($image); We does not want to use this as output.\n //resize image \n $image = imagecreatefromjpeg($image);\n $thumbImage = imagecreatetruecolor(50, 50);\n imagecopyresized($thumbImage, $image, 0, 0, 0, 0, 50, 50, $width, $height);\n imagedestroy($image);\n //imagedestroy($thumbImage); do not destroy before display :)\n // ob_end_clean(); // clean the output buffer ... if turned on.\n header('Content-Type: image/jpeg');\n imagejpeg($thumbImage); //you does not want to save.. just display\n }", "function imageresize($img,$target=\"\",$width=0,$height=0,$percent=0)\n{\n if (strpos($img,\".jpg\") !== false or strpos($img,\".jpeg\") !== false){\n\t $image = ImageCreateFromJpeg($img);\n\t $extension = \".jpg\";\n } elseif (strpos($img,\".png\") !== false) {\n\t $image = ImageCreateFromPng($img);\n\t $extension = \".png\";\n } elseif (strpos($img,\".gif\") !== false) {\n\t $image = ImageCreateFromGif($img);\n\t $extension = \".gif\";\n }elseif(getfiletype($img)=='bmp'){\n\t\t$image = ImageCreateFromwbmp($img);\n\t\t$extension = '.bmp';\n }\n\n $size = getimagesize ($img);\n\n // calculate missing values\n if ($width and !$height) {\n\t $height = ($size[1] / $size[0]) * $width;\n } elseif (!$width and $height) {\n\t $width = ($size[0] / $size[1]) * $height;\n } elseif ($percent) {\n\t $width = $size[0] / 100 * $percent;\n\t $height = $size[1] / 100 * $percent;\n } elseif (!$width and !$height and !$percent) {\n\t $width = 100; // here you can enter a standard value for actions where no arguments are given\n\t $height = ($size[1] / $size[0]) * $width;\n }\n\n $thumb = imagecreatetruecolor ($width, $height);\n\n if (function_exists(\"imageCopyResampled\"))\n {\n\t if (!@ImageCopyResampled($thumb, $image, 0, 0, 0, 0, $width, $height, $size[0], $size[1])) {\n\t\t ImageCopyResized($thumb, $image, 0, 0, 0, 0, $width, $height, $size[0], $size[1]);\n\t }\n\t} else {\n\t ImageCopyResized($thumb, $image, 0, 0, 0, 0, $width, $height, $size[0], $size[1]);\n\t}\n\n //ImageCopyResampleBicubic ($thumb, $image, 0, 0, 0, 0, $width, $height, $size[0], $size[1]);\n\n if (!$target) {\n\t $target = \"temp\".$extension;\n }\n\n $return = true;\n\n switch ($extension) {\n\t case \".jpeg\":\n\t case \".jpg\": {\n\t\t imagejpeg($thumb, $target, 100);\n\t break;\n\t }\n\t case \".gif\": {\n\t\t imagegif($thumb, $target);\n\t break;\n\t }\n\t case \".png\": {\n\t\t imagepng($thumb, $target);\n\t break;\n\t }\n\t case \".bmp\": {\n\t\t imagewbmp($thumb,$target);\n\t }\n\t default: {\n\t\t $return = false;\n\t }\n }\n\n // report the success (or fail) of the action\n return $return;\n}", "function make_thumb($img_name,$filename,$new_w,$new_h)\n{\n//get image extension.\n$ext=getExtension($img_name);\n//creates the new image using the appropriate function from gd library\nif(!strcmp(\"jpg\",$ext) || !strcmp(\"jpeg\",$ext))\n$src_img=imagecreatefromjpeg($img_name);\n\nif(!strcmp(\"png\",$ext))\n$src_img=imagecreatefrompng($img_name);\n\n//gets the dimmensions of the image\n$old_x=imageSX($src_img);\n$old_y=imageSY($src_img);\n\n// next we will calculate the new dimmensions for the thumbnail image\n// the next steps will be taken:\n// 1. calculate the ratio by dividing the old dimmensions with the new ones\n// 2. if the ratio for the width is higher, the width will remain the one define in WIDTH variable\n// and the height will be calculated so the image ratio will not change\n// 3. otherwise we will use the height ratio for the image\n// as a result, only one of the dimmensions will be from the fixed ones\n$ratio1=$old_x/$new_w;\n$ratio2=$old_y/$new_h;\nif($ratio1>$ratio2) {\n$thumb_w=$new_w;\n$thumb_h=$old_y/$ratio1;\n}\nelse {\n$thumb_h=$new_h;\n$thumb_w=$old_x/$ratio2;\n}\n\n// we create a new image with the new dimmensions\n$dst_img=ImageCreateTrueColor($thumb_w,$thumb_h);\n\n// resize the big image to the new created one\nimagecopyresampled($dst_img,$src_img,0,0,0,0,$thumb_w,$thumb_h,$old_x,$old_y);\n\n// output the created image to the file. Now we will have the thumbnail into the file named by $filename\nif(!strcmp(\"png\",$ext))\nimagepng($dst_img,$filename);\nelse\nimagejpeg($dst_img,$filename);\n\n//destroys source and destination images.\nimagedestroy($dst_img);\nimagedestroy($src_img);\n}", "public static function resizeImageUpload($upload_field_name, $max_width, $max_height)\n\t{\n\t\t$filename = $_FILES[$upload_field_name]['tmp_name'];\n\t\t// Get new dimensions\n\t\tlist($width, $height) = getimagesize($filename);\n\t\t\n\t\t$width_percent = $max_width / $width;\n\t\t$height_percent = $max_height / $height;\n\t\t\n\t\t$final_percent = 0.00;\n\t\tif ($width_percent < $height_percent)\n\t\t\t$final_percent = $width_percent;\n\t\telse\n\t\t\t$final_percent = $height_percent;\n\t\t\n\t\t$new_width = $width * $final_percent;\n\t\t$new_height = $height * $final_percent;\n\n\t\t// Resample\n\t\t$image_p = imagecreatetruecolor($max_width, $max_height);\n\t\t\n\t\t$info = getimagesize($filename);\n\n\t\t$image = null;\n\t\tif ($info['mime'] == \"image/png\")\n\t\t\t$image = imagecreatefrompng($filename);\n\t\telse if ($info['mime'] == \"image/gif\")\n\t\t\t$image = imagecreatefromgif($filename);\n\t\telse\n\t\t\t$image = imagecreatefromjpeg($filename);\n\n\t\timagefill($image_p, 0, 0, imagecolorallocate($image_p, 255,255,255));\n\t\timagecopyresampled($image_p, $image, ($max_width - $new_width) / 2, ($max_height - $new_height) / 2, 0, 0, $new_width, $new_height, $width, $height);\n\n\t\t// Output\n\t\timagepng($image_p, $filename, 0);\n\t}", "function spc_resizeImage( $file, $thumbpath, $max_side , $fixfor = NULL ) {\n\n\tif ( file_exists( $file ) ) {\n\t\t$type = getimagesize( $file );\n\n\t\tif (!function_exists( 'imagegif' ) && $type[2] == 1 ) {\n\t\t\t$error = __( 'Filetype not supported. Thumbnail not created.' );\n\t\t}\n\t\telseif (!function_exists( 'imagejpeg' ) && $type[2] == 2 ) {\n\t\t\t$error = __( 'Filetype not supported. Thumbnail not created.' );\n\t\t}\n\t\telseif (!function_exists( 'imagepng' ) && $type[2] == 3 ) {\n\t\t\t$error = __( 'Filetype not supported. Thumbnail not created.' );\n\t\t} else {\n\n\t\t\t// create the initial copy from the original file\n\t\t\tif ( $type[2] == 1 ) {\n\t\t\t\t$image = imagecreatefromgif( $file );\n\t\t\t}\n\t\t\telseif ( $type[2] == 2 ) {\n\t\t\t\t$image = imagecreatefromjpeg( $file );\n\t\t\t}\n\t\t\telseif ( $type[2] == 3 ) {\n\t\t\t\t$image = imagecreatefrompng( $file );\n\t\t\t}\n\n\t\t\tif ( function_exists( 'imageantialias' ))\n\t\t\t\timageantialias( $image, TRUE );\n\n\t\t\t$image_attr = getimagesize( $file );\n\n\t\t\t// figure out the longest side\n if($fixfor){\n \t if($fixfor == 'width'){\n \t \t$image_width = $image_attr[0];\n\t\t\t\t$image_height = $image_attr[1];\n\t\t\t\t$image_new_width = $max_side;\n\n\t\t\t\t$image_ratio = $image_width / $image_new_width;\n\t\t\t\t$image_new_height = $image_height / $image_ratio;\n \t }elseif($fixfor == 'height'){\n \t $image_width = $image_attr[0];\n\t\t\t\t$image_height = $image_attr[1];\n\t\t\t\t$image_new_height = $max_side;\n\n\t\t\t\t$image_ratio = $image_height / $image_new_height;\n\t\t\t\t$image_new_width = $image_width / $image_ratio;\t\n \t }\n }else{\n\t\t\tif ( $image_attr[0] > $image_attr[1] ) {\n\t\t\t\t$image_width = $image_attr[0];\n\t\t\t\t$image_height = $image_attr[1];\n\t\t\t\t$image_new_width = $max_side;\n\n\t\t\t\t$image_ratio = $image_width / $image_new_width;\n\t\t\t\t$image_new_height = $image_height / $image_ratio;\n\t\t\t\t//width is > height\n\t\t\t} else {\n\t\t\t\t$image_width = $image_attr[0];\n\t\t\t\t$image_height = $image_attr[1];\n\t\t\t\t$image_new_height = $max_side;\n\n\t\t\t\t$image_ratio = $image_height / $image_new_height;\n\t\t\t\t$image_new_width = $image_width / $image_ratio;\n\t\t\t\t//height > width\n\t\t\t}\n }\t\n\n\t\t\t$thumbnail = imagecreatetruecolor( $image_new_width, $image_new_height);\n\t\t\t@ imagecopyresampled( $thumbnail, $image, 0, 0, 0, 0, $image_new_width, $image_new_height, $image_attr[0], $image_attr[1] );\n\n\t\t\t// move the thumbnail to its final destination\n\t\t\tif ( $type[2] == 1 ) {\n\t\t\t\tif (!imagegif( $thumbnail, $thumbpath ) ) {\n\t\t\t\t\t$error = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\telseif ( $type[2] == 2 ) {\n\t\t\t\tif (!imagejpeg( $thumbnail, $thumbpath ) ) {\n\t\t\t\t\t$error = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\telseif ( $type[2] == 3 ) {\n\t\t\t\tif (!imagepng( $thumbnail, $thumbpath ) ) {\n\t\t\t\t\t$error = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t} else {\n\t\t$error = 0;\n\t}\n\n\tif (!empty ( $error ) ) {\n\t\treturn $error;\n\t} else {\n\t\treturn $thumbpath;\n\t}\n}", "function _resizeImageGD2($src_file, $dest_file, $new_size, $imgobj) {\r\n if ($imgobj->_size == null) {\r\n return false;\r\n }\r\n // GD can only handle JPG, PNG & GIF images\r\n if ($imgobj->_type !== \"jpg\" && $imgobj->_type !== \"jpeg\" && $imgobj->_type !== \"png\" && $imgobj->_type !== \"gif\") {\r\n return false;\r\n }\r\n if ($imgobj->_type == \"gif\" && !function_exists(\"imagecreatefromgif\")) {\r\n \treturn false;\r\n }\r\n \r\n // height/width\r\n $ratio = max($imgobj->_size[0], $imgobj->_size[1]) / $new_size;\r\n $ratio = max($ratio, 1.0);\r\n $destWidth = (int)($imgobj->_size[0] / $ratio);\r\n $destHeight = (int)($imgobj->_size[1] / $ratio);\r\n if ($imgobj->_type == \"jpg\" || $imgobj->_type == \"jpeg\") {\r\n $src_img = @imagecreatefromjpeg($src_file);\r\n $dst_img = imagecreatetruecolor($destWidth, $destHeight);\r\n } else if ($imgobj->_type == \"png\") {\r\n $src_img = @imagecreatefrompng($src_file);\r\n $dst_img = imagecreatetruecolor($destWidth, $destHeight);\r\n \t\t\t$img_white = imagecolorallocate($dst_img, 255, 255, 255); // set background to white\r\n\t\t\t$img_return = @imagefill($dst_img, 0, 0, $img_white);\r\n } else {\r\n \t$src_img = @imagecreatefromgif($src_file);\r\n \t$dst_img = imagecreatetruecolor($destWidth,$destHeight);\r\n\t\t\t$img_white = imagecolorallocate($dst_img, 255, 255, 255); // set background to white\r\n\t\t\t$img_return = @imagefill($dst_img, 0, 0, $img_white);\r\n }\r\n if (!$src_img) {\r\n return false;\r\n }\r\n imagecopyresampled($dst_img, $src_img, 0, 0, 0, 0, $destWidth, $destHeight, $imgobj->_size[0], $imgobj->_size[1]);\r\n if ($imgobj->_type == \"jpg\" || $imgobj->_type == \"jpeg\") {\r\n imagejpeg($dst_img, $dest_file, $this->_JPEG_quality);\r\n } else if ($imgobj->_type == \"png\") {\r\n imagepng($dst_img, $dest_file);\r\n } else {\r\n \timagegif($dst_img, $dest_file);\r\n }\r\n imagedestroy($src_img);\r\n imagedestroy($dst_img);\r\n return true;\r\n }", "function upload_image($dst_height_max,$dst_width_max,$filename,$id,$checkSize,$top)\n{\nif ($top) $path = 'west_config/';\n// image upload handling\nif ($filename == 'staffPhoto') {\n\t$upload_dir_path = $path.\"staff_photos/\".$id.\"/\";\n} else if ($filename == 'cncsstaffPhoto') {\n\t$upload_dir_path = $path.\"cncs_staff_photos/\".$id.\"/\";\n} else if ($filename == 'photoName') {\n\t$upload_dir_path = $path.\"photos/\".$id.\"/\";\n} else if ($filename == 'progImage') {\n\t$upload_dir_path = $path.\"prog_photos/\".$id.\"/\";\n} else if ($filename == 'bannerName') {\n\t$upload_dir_path = $path.\"banners/\".$id.\"/\";\n}\nif (!is_dir($upload_dir_path)) {\n\tmkdir ($upload_dir_path);\n}\n$image_name = $_FILES[$filename]['name'];\n$upload_file = $upload_dir_path.$image_name;\n$file_uploaded_ok =(move_uploaded_file($_FILES[$filename]['tmp_name'], $upload_file));\n\n// determine if image size meets specs, set warning flag if needed\n$imageSizeWarning = false;\nlist($width, $height, $type, $attr) = getimagesize($upload_file);\nif ($checkSize) {\n\t$imageSizeWarning = ($dst_height_max != $height or $dst_width_max != $width) ? true : false; \n}\n\n//resize image if needed\nif ($dst_width_max == 0) {\n\tif ($dst_height_max == 0) {\n\t\t$div_factor = 1;\n\t} else {\n\t\t$div_factor = $height/$dst_height_max;\n\t}\n} elseif ($dst_height_max == 0) {\n\t$div_factor = $width/$dst_width_max;\n} else {\n\tif (($width/$dst_width_max) > ($height/$dst_height_max)) {\n\t\t$div_factor = $width/$dst_width_max;\n\t} else {\n\t\t$div_factor = $height/$dst_height_max;\t\t\n\t};\n}\nif ($width > $dst_width_max or $height > $dst_height_max) {\n\t$new_width = $width/$div_factor;\n\t$new_height = $height/$div_factor;\n} else {\n\t$new_width = $width;\n\t$new_height = $height;\n}\n\t\n// Detrmine File type\nif (strpos($image_name,\".jpg\") != FALSE or strpos($image_name,\".jpeg\") != FALSE\n\tor strpos($image_name,\".JPG\") != FALSE or strpos($image_name,\".JPEG\") != FALSE) {\n\t// Resample & resize\n\tif ($width > $dst_width_max or $height > $dst_height_max) {\n\t\t$image_p = imagecreatetruecolor($new_width, $new_height);\n\t\t$image = imagecreatefromjpeg($upload_file);\n\t\timagecopyresampled($image_p, $image, 0, 0, 0, 0, $new_width, $new_height, $width, $height);\n\t\timagejpeg($image_p, $upload_file, 100);\n\t}\n} else if (stripos($image_name,\".gif\") != FALSE or stripos($image_name,\".GIF\") != FALSE) {\n\t// Resample & resize\n\tif ($width > $dst_width_max or $height > $dst_height_max) {\n\t\t$image_p = imagecreatetruecolor($new_width, $new_height);\n\t\t$image = imagecreatefromgif($upload_file);\n\t\timagecopyresampled($image_p, $image, 0, 0, 0, 0, $new_width, $new_height, $width, $height);\n\t\timagegif($image_p, $upload_file, 100);\n\t}\n} else if (stripos($image_name,\".png\") != FALSE) {\n\t// Resample & resize\n\tif ($width > $dst_width_max or $height > $dst_height_max) {\n\t\t$image_p = imagecreatetruecolor($new_width, $new_height);\n\t\t$image = imagecreatefrompng($upload_file);\n\t\timagecopyresampled($image_p, $image, 0, 0, 0, 0, $new_width, $new_height, $width, $height);\n\t\timagepng($image_p, $upload_file);\n\t}\n}\n\n$ret_array = array($image_name,$imageSizeWarning);\n\nreturn $ret_array;\n\n}", "public function doUploadBySize($width = 170, $height = 170, $isDelSrcImg = true, $isCopyImg = false)\n {\n $result = false;\n try {\n $field = $this->_config['field'];\n $imagefile = $_FILES[$field]['tmp_name'];\n $truename = $_FILES[$field]['name'];\n\n require_once 'MyLib/Image/Validate.php';\n $validate = new MyLib_Image_Validate();\n\n if (!$validate->isValid($imagefile, $truename)) {\n return false;\n }\n\n //$path = $this->_getPath();\n //if (!empty($this->_path)) {\n // return $this->_path;\n //}\n\n $id = $this->_config['id'];\n $dir0 = $id % 10000;\n $dir1 = $dir0 % 100;\n $dir2 = $dir0 - $dir1 * 100;\n if ($dir2 < 0) {\n $dir2 = 0;\n }\n\n $path = 'apps/';\n switch ($this->_config['section']) {\n\n case 1 :\n $path .= 'scripteditor/' . $dir2 . '/' . $dir1 . '/';\n break;\n case 2 :\n\t $path .= 'slave/' . $dir2 . '/' . $dir1 . '/';\n\t break;\n default :\n $path .= 'tmp/';\n break;\n }\n $this->_path = $path;\n\n $result = $this->_upload->upfileBySize($this->_config['field'],\n array('baseFolder' => $this->_config['basefolder'], 'path' => $path, 'id' => $this->_config['id'],\n 'width' => $width, 'height' => $height, 'imageName' => $imageName, 'isDelSrcImg' => $isDelSrcImg,\n 'isCopyImg' => $isCopyImg));\n }\n catch (Exception $e) {\n\n }\n return $result;\n }", "public function uploadImage($image){\n\t\t\n\t\t$ruta = \"../public/uploads/\";\n\t\tini_set(\"max_execution_time\",0);\n\t\t$handle->forbidden \t= array('application/*');\n\t\t$handle \t\t\t= new Upload($image);\n\t\t\n\t\tif( $handle->uploaded ){\n\t\t\t\n\t\t\t$path1 = $ruta;\t\n\t\t\tif (!file_exists(\"$path1\")){\n\t\t\t\tmkdir($path1,0777);\n\t\t\t}\n\t\t\t//original <<<<<---------------------------- VER SI PUEDO BORRAR\n\t\t\t$path_ori1 = $ruta.'original/';\n\t\t\tif (!file_exists(\"$path_ori1\")){\n\t\t\t\tmkdir($path_ori1,0777);\n\t\t\t}\n\t\t\t$imagename =\t$handle->Process($path_ori1);\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t// big-muro (height: 184px; width: 256px;)\n\t\t\t$path_big = $ruta.'big-post/';\n\t\t\t$handle->image_resize \t= true;\n\t\t\t$handle->image_ratio = true;\n \t\t \t$handle->jpeg_quality \t\t\t= 100;\n \t\t \tlist($org_width, $org_height) = getimagesize($image['tmp_name']);\n \t\t \t$handle->image_ratio_crop\t = true;\n\t\t\t$handle->image_resize = true;\n\t\t\t$handle->image_ratio = true;\n \t\t \t$handle->jpeg_quality \t\t\t= 100;\n\t\t\t$handle->image_x = 256;\n\t\t\t$handle->image_y = 184;\n\t\t\tif (!file_exists(\"$path_tapa\")){\n\t\t\t\tmkdir($path_tapa,0777);\n\t\t\t}\n\t\t\t$imagename = $handle->Process($path_big);\n\t\t\t\n\t\t\t// ampliada (width =\"758\" height =\"544\") \n\t\t\t$path_ampliada = $ruta.'ampliada/';\n\t\t\t$handle->image_resize \t= true;\n\t\t\t$handle->image_ratio = true;\n \t\t \t$handle->jpeg_quality \t\t\t= 100;\n \t\t \tlist($org_width, $org_height) = getimagesize($image['tmp_name']);\n \t\t \t$handle->image_ratio_crop\t = true;\n\t\t\t$handle->image_resize = true;\n\t\t\t$handle->image_ratio = true;\n \t\t \t$handle->jpeg_quality \t\t\t= 100;\n\t\t\t$handle->image_x = 658;\n\t\t\t$handle->image_y = 444;\n\t\t\tif (!file_exists(\"$path_tapa\")){\n\t\t\t\tmkdir($path_tapa,0777);\n\t\t\t}\n\t\t\t$imagename = $handle->Process($path_ampliada);\t\t\t\t\t\n\t\t\t\n\t\t\t$handle->Clean();\n\t\t\t\n\t\t}\n\t\t\n\t\treturn $imagename; \n\t\t\n\t}", "function CropMnb($imgSrc,$newfilename,$new_width=100,$new_height=100,$quality=100){\n\n\t\t$extension = strtolower($this->getExtension($imgSrc,false)); // false - tells to get \"jpg\" NOT \".jpg\" GOT IT :P\n\t\t\n\t\t//saving the image into memory (for manipulation with GD Library)\n\t\tswitch($extension) {\n\t\t\tcase 'gif':\n\t\t\t$myImage = imagecreatefromgif($this->path.$imgSrc);\n\t\t\tbreak;\n\t\t\tcase 'jpg':\n\t\t\t$myImage = imagecreatefromjpeg($this->path.$imgSrc);\n\t\t\tbreak;\n\t\t\tcase 'png':\n\t\t\t$myImage = imagecreatefrompng($this->path.$imgSrc);\n\t\t\tbreak;\n\t\t}\n\t\t\n\t\t$thumb = $this->ResizeSemiAbstractTop($myImage,$new_width,$new_height);\n\n\t\tif($extension==\"jpg\" ){\n\t\t\timagejpeg($thumb,$this->path.$newfilename,$quality);\n\t\t}elseif($extension==\"gif\" ){\n\t\t\timagegif($thumb,$this->path.$newfilename,$quality);\n\t\t}elseif($extension==\"png\" ){\n\t\t\timagepng($thumb,$this->path.$newfilename,9);\n\t\t}\n\t\n\t\timagedestroy($thumb); \n\t}", "function resizeImage($CurWidth,$CurHeight,$MaxSize,$DestFolder,$SrcImage,$Quality,$ImageType)\r\n{\r\n\t//Check Image size is not 0\r\n\tif($CurWidth <= 0 || $CurHeight <= 0) \r\n\t{\r\n\t\treturn false;\r\n\t}\r\n\t\r\n\t//Construct a proportional size of new image\r\n\t$ImageScale \t= min($MaxSize/$CurWidth, $MaxSize/$CurHeight); \r\n\t$NewWidth \t\t\t= ceil($ImageScale*$CurWidth);\r\n\t$NewHeight \t\t\t= ceil($ImageScale*$CurHeight);\r\n\t$NewCanves \t\t\t= imagecreatetruecolor($NewWidth, $NewHeight);\r\n\t\r\n\t// Resize Image\r\n\tif(imagecopyresampled($NewCanves, $SrcImage,0, 0, 0, 0, $NewWidth, $NewHeight, $CurWidth, $CurHeight))\r\n\t{\r\n\t\tswitch(strtolower($ImageType))\r\n\t\t{\r\n\t\t\tcase 'image/png':\r\n\t\t\t\timagepng($NewCanves,$DestFolder);\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'image/gif':\r\n\t\t\t\timagegif($NewCanves,$DestFolder);\r\n\t\t\t\tbreak;\t\t\t\r\n\t\t\tcase 'image/jpeg':\r\n\t\t\tcase 'image/pjpeg':\r\n\t\t\t\timagejpeg($NewCanves,$DestFolder,$Quality);\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\treturn false;\r\n\t\t}\r\n\t//Destroy image, frees memory\t\r\n\tif(is_resource($NewCanves)) {imagedestroy($NewCanves);} \r\n\treturn true;\r\n\t}\r\n\r\n}", "static function thumbimage($image, $width, $height, $is_utf8=true) {\r\n\t\t/**\r\n\t\t * 2011-12-9 wengebin Add\r\n\t\t * 要支持中文,作为 linux 服务器,必须将 GBK/GB2312 格式的字符串转换成 UTF-8,\r\n\t\t * 因为 linux 上保存的文件名都是 UTF-8 格式的;\r\n\t\t * 而作为 windows 服务器,因为服务器上保存的文件名默认就是 GBK/GB2312 格式,\r\n\t\t * 所以 windows 服务器上不需要转换!\r\n\t\t */\r\n\t\t$is_utf_8 = $is_utf8;\r\n\t\tif ((!IS_WIN && !MulanStringUtil::is_utf8($image)) || !$is_utf_8) {\r\n\t\t\t$image = iconv(\"GBK\", \"UTF-8\",$image);\r\n\t\t\t$is_utf_8 = true;\r\n\t\t} else if (IS_WIN && MulanStringUtil::is_utf8($image) && $is_utf_8) {\r\n\t\t\t$image = iconv(\"UTF-8\", \"GBK\",$image);\r\n\t\t\t$is_utf_8 = false;\r\n\t\t}\r\n\t\tif(!$image) {\r\n\t\t\t// If no image,return the default image\r\n\t\t\treturn MulanImageUtil::thumbimage('images'.'/'.'stories'.'/'.'default.jpg',$width,$height);\r\n\t\t} else {\r\n\t\t\t\r\n\t\t\t// If have image,replace the 'root' uri\r\n\t\t\t$image = str_replace(JURI::base(),'',$image);\r\n\t\t\t\r\n\t\t\t// Decode the image src\r\n\t\t\t$image = rawurldecode($image);\r\n\t\t\t\r\n\t\t\t// If the image is exists and can be resize,return image src,otherwise return the default image src\r\n\t\t\t$image = preg_replace('/\\\\\\\\/','/',$image);\r\n\t\t\tpreg_match('/(^.+)[\\/\\\\\\\\]{1}.+\\.\\w+$/',$image,$match);\r\n\t\t\t$folder = JPATH_SITE.'/'.'images'.'/'.'resized'.'/'.$match[1];\r\n\t\t\t\r\n\t\t\t$folder = preg_replace('/\\\\\\\\/','/',$folder);\r\n\t\t\tMulanImageUtil::createFoldersByUtl($folder);\r\n\t\t\t\r\n\t\t\t$imagesurl = (file_exists(JPATH_SITE.'/'.$image)) ? MulanImageUtil::resize($image,$width,$height) : '';\r\n\t\t\tif(!$imagesurl) {\r\n\t\t\t\treturn MulanImageUtil::thumbimage('images'.'/'.'stories'.'/'.'default.jpg',$width,$height);\r\n\t\t\t} else {\r\n\t\t\t\tif (!$is_utf_8) {\r\n\t\t\t\t\t$imagesurl = iconv(\"GBK\", \"UTF-8\",$imagesurl);\r\n\t\t\t\t}\r\n\t\t\t\treturn MulanImageUtil::encodeImageURL($imagesurl);\r\n\t\t\t\t//return preg_replace('/\\s/','%20',$imagesurl);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "function redimensionarImagen($origin,$destino,$newWidth,$newHeight,$jpgQuality=100)\n{\n // texto con el valor correcto height=\"yyy\" width=\"xxx\"\n $datos=getimagesize($origin);\n \n // comprobamos que la imagen sea superior a los tamaños de la nueva imagen\n if($datos[0]>$newWidth || $datos[1]>$newHeight)\n {\n \n // creamos una nueva imagen desde el original dependiendo del tipo\n if($datos[2]==1)\n $img=imagecreatefromgif($origin);\n if($datos[2]==2)\n $img=imagecreatefromjpeg($origin);\n if($datos[2]==3)\n $img=imagecreatefrompng($origin);\n \n // Redimensionamos proporcionalmente\n if(rad2deg(atan($datos[0]/$datos[1]))>rad2deg(atan($newWidth/$newHeight)))\n {\n $anchura=$newWidth;\n $altura=round(($datos[1]*$newWidth)/$datos[0]);\n }else{\n $altura=$newHeight;\n $anchura=round(($datos[0]*$newHeight)/$datos[1]);\n }\n \n // creamos la imagen nueva\n $newImage = imagecreatetruecolor($anchura,$altura);\n \n // redimensiona la imagen original copiandola en la imagen\n imagecopyresampled($newImage, $img, 0, 0, 0, 0, $anchura, $altura, $datos[0], $datos[1]);\n \n // guardar la nueva imagen redimensionada donde indicia $destino\n if($datos[2]==1)\n imagegif($newImage,$destino);\n if($datos[2]==2)\n imagejpeg($newImage,$destino,$jpgQuality);\n if($datos[2]==3)\n imagepng($newImage,$destino);\n \n // eliminamos la imagen temporal\n imagedestroy($newImage);\n \n return true;\n }\n return false;\n}", "public function resizeImage($image, $width = MEDIUM_IMAGE_MAX_WIDTH, $height = MEDIUM_IMAGE_MAX_HEIGHT, $subpath = IMG_SUBPATH_MEDIUM, $quality = JPEG_QUALITY) \n {\n // check if file is image\n if (!$this->isFileImage($image) ) {\n $this->throwException(FILE_IS_NOT_IMAGE, \"File is not an image\");\n }\n list($imgWidth, $imgHeight) = getimagesize($image);\n \n if ($imgWidth > $imgHeight) {\n $newWidth = $imgWidth / ($imgWidth / $width);\n $newHeight = $imgHeight / ($imgWidth / $width);\n } else {\n $newWidth = $imgWidth / ($imgHeight / $height);\n $newHeight = $imgHeight / ($imgHeight / $height);\n }\n\n $path = pathinfo($image);\n //print_r($path); // debug\n $src_img = imagecreatefromjpeg($image);\n $dest_img = imagecreatetruecolor($newWidth, $newHeight);\n imagecopyresampled($dest_img, $src_img, 0, 0, 0, 0, $newWidth, $newHeight, $imgWidth, $imgHeight);\n \n if (ADD_WATERMARK_TO_PHOTO) {\n //TODO: Add optional watermark to photo\n }\n \n imagejpeg($dest_img, IMAGE_STORAGE_PATH . $subpath . $path['filename'] . \".\" . $path['extension'], $quality);\n \n \n return IMAGE_STORAGE_PATH . $subpath . $path['filename'] . \".\" . $path['extension'];\n }", "function upload_image( $image, $folder, $height=768, $width=1024, $path=FALSE ){\n \n $this->make_dirs($folder);\n \n $realpath = 'uploads/';\n $allowed_types = \"gif|jpg|png|jpeg\"; \t\n $img_name = random_string('alnum', 16); //generate random string for image name\n \n $config = array(\n 'upload_path' => $realpath.$folder,\n 'allowed_types' => $allowed_types,\n //'max_size' => \"10240\", // File size limitation, initially w'll set to 10mb (Can be changed)\n //'max_height' => \"4000\", // max height in px\n //'max_width' => \"4000\", // max width in px\n // 'min_width' => \"200\", // min width in px\n // 'min_height' => \"200\", // min height in px\n 'file_name' => $img_name,\n 'overwrite'\t => FALSE,\n 'remove_spaces'\t => TRUE,\n 'quality' => '100%',\n );\n\t\t\n $this->load->library('upload'); //upload library\n $this->upload->initialize($config);\n \n if(!$this->upload->do_upload($image)){\n $error = array('error' => $this->upload->display_errors());\n return $error; //error in upload\n\n }\n //image uploaded successfully - proceed to create resized copies\n $image_data = $this->upload->data(); //get uploaded data\n $this->load->library('image_lib'); //image library\n\n // create folder for thumb image\n $folder_thumb = $folder.'/thumb/';\n $this->make_dirs($folder_thumb);\n\n\n // create folder for medium image\n $folder_resize = $folder.'/medium/';\n $this->make_dirs($folder_resize);\n\n // create folder for large image\n $large = '/large';\n $folder_large = $folder.$large;\n $this->make_dirs($folder_large);\n\n $img_sizes_arr = $this->image_sizes(); //predefined sizes in model\n $thumb_img = '';\n\n foreach($img_sizes_arr as $k=>$v){\n\n $real_path = realpath(FCPATH .$realpath .$folder);\n\n $resize['image_library'] = 'gd2';\n $resize['source_image'] = $image_data['full_path'];\n $resize['new_image'] \t = $real_path.$v['folder'].'/'.$image_data['file_name'];\n $resize['maintain_ratio'] = FALSE;\n $resize['width'] \t = $v['width'];\n $resize['height'] \t = $v['height'];\n $resize['quality'] \t = '100%';\n\n $this->image_lib->initialize($resize);\n $this->image_lib->resize(); //create resized copies\n }\n\n //custom size \n $real_path = realpath(FCPATH .$realpath .$folder);\n $resize1['source_image'] \t = $image_data['full_path'];\n $resize1['new_image'] \t = $real_path.$large.'/'.$image_data['file_name'];\n $resize1['maintain_ratio'] \t = FALSE;\n $resize1['width'] = $width;\n $resize1['height'] \t\t = $height;\n $resize1['quality'] = '100%';\n\n $this->image_lib->initialize($resize1);\n $this->image_lib->resize();\n $this->image_lib->clear(); //clear memory\n if(empty($thumb_img))\n $thumb_img = $image_data['file_name'];\n\n return array('image_name'=>$thumb_img); \n }", "function resizeImage($fileName, $newWidth = 100 , $newHeight = 100, $cropType = 0, $outputFileName = \"\", $quality = 75){\r\n $imgCreateFun=array(1 => \"imagecreatefromgif\", 2 => \"imagecreatefromjpeg\", 3 => \"imagecreatefrompng\");\r\n $imgOutputFun=array(1 => \"imagegif\", 2 => \"imagejpeg\", 3 => \"imagepng\");\r\n \r\n if(file_exists($fileName)){\r\n $myFileInfo = getimagesize($fileName);\r\n $imgWidth = $myFileInfo[0];\r\n $imgHeight = $myFileInfo[1];\r\n \r\n $resCords = getPropSizes($imgWidth, $imgHeight, $newWidth, $newHeight, $cropType);\r\n \r\n $imgType = $myFileInfo[2];\r\n if(in_array($imgType,array_keys($imgCreateFun))){\r\n $image_p = imagecreatetruecolor($newWidth, $newHeight);\r\n $image = $imgCreateFun[$imgType]($fileName);\r\n imagecopyresampled($image_p, $image, 0, 0, $resCords[\"srcX\"], $resCords[\"srcY\"], $newWidth, $newHeight, $resCords[\"srcW\"], $resCords[\"srcH\"]); \r\n if(!file_exists($outputFileName)){\r\n if(!$outputFileName){\r\n header(\"Content-type: \".$myFileInfo[\"mime\"]);\r\n }\r\n $imgOutputFun[$imgType]($image_p, $outputFileName, $quality);\r\n imagedestroy($image_p);\r\n imagedestroy($image); \r\n }\r\n else{\r\n imagedestroy($image_p);\r\n imagedestroy($image);\r\n die(\"Cannot write output image - Filename already exists\");\r\n }\r\n \r\n }\r\n else{\r\n die(\"Image Type not supported\");\r\n }\r\n }\r\n else{\r\n die(\"Source file not found\");\r\n }\r\n}", "public static function create_jpeg_thumbnail($imgSrc,$thumbDirectory,$thumbnail_width,$thumbnail_height,$image) {\n $thumbDirectory = trim($thumbDirectory);\n\t\t$imageSourceExploded = explode('/', $imgSrc);\n\t\t$imageName = $imageSourceExploded[count($imageSourceExploded)-1];\n\t\t$imageDirectory = str_replace($imageName, '', $imgSrc);\n\t\t$filetype = explode('.',$imageName);\n\t\t$filetype = strtolower($filetype[count($filetype)-1]);\n\n\t\t//getting the image dimensions\n\t\tlist($width_orig, $height_orig) = getimagesize($imgSrc);\n\n\n\t\t//$myImage = imagecreatefromjpeg($imgSrc);\n\t\tif ($filetype == 'jpg' or $filetype == 'JPG' ) {\n\t\t\t$myImage = imagecreatefromjpeg(\"$imageDirectory/$imageName\");\n\t\t} else\n\t\tif ($filetype == 'jpeg' or $filetype == 'JPEG' ) {\n\t\t\t$myImage = imagecreatefromjpeg(\"$imageDirectory/$imageName\");\n\t\t} else\n\t\tif ($filetype == 'png' or $filetype == 'PNG' ) {\n\t\t\t$myImage = imagecreatefrompng(\"$imageDirectory/$imageName\");\n\t\t} else\n\t\tif ($filetype == 'gif' or $filetype == 'GIF') {\n\t\t\t$myImage = imagecreatefromgif(\"$imageDirectory/$imageName\");\n\t\t}\n\n $ratio_orig = $width_orig/$height_orig;\n\n\t\tif ($thumbnail_width/$thumbnail_height > $ratio_orig) {\n $new_height = $thumbnail_width/$ratio_orig;\n $new_width = $thumbnail_width;\n\t\t} else{\n $new_width = $thumbnail_height*$ratio_orig;\n $new_height = $thumbnail_height;\n\t\t}\n\n\t\t$x_mid = $new_width/2; //horizontal middle\n\t\t$y_mid = $new_height/2; //vertical middle\n\n $process = imagecreatetruecolor(round($new_width), round($new_height));\n\n\t\tif($ratio_orig>=1){\n imagecopyresampled($process, $myImage, 0, 0, 0, 0, $new_width, $new_height, $width_orig, $height_orig);\n\n $thumb = imagecreatetruecolor($thumbnail_width, $thumbnail_height);\n\n imagecopyresampled($thumb, $process, 0, 0, ($x_mid-($thumbnail_width/2)), ($y_mid-($thumbnail_height/2)), $thumbnail_width, $thumbnail_height, $thumbnail_width, $thumbnail_height);\n\t\t}else{\n\t\t\t$ratio_desc = ceil(($thumbnail_height/$height_orig)*100);\n\t\t\t$new_height = round(($ratio_desc/100)*$height_orig);\n\t\t\t$new_width = round(($ratio_desc/100)*$width_orig);\n\n\t\t\t$thumb = imagecreatetruecolor($thumbnail_width, $thumbnail_height) ;\n\t\t\t// fill rest color with grey background\n\t\t\t$grey = imagecolorallocate($thumb, 62, 62, 62);\n\t\t\timagefill($thumb, 0, 0, $grey);\n\n\t\t\timagecopyresampled($thumb, $myImage, round(($thumbnail_width-$new_width)/2), 0, 0, 0, $new_width, $thumbnail_height, $width_orig, $height_orig);\n\t\t}\n\n\t\t$thumbImageName = $image;\n\t\t$destination = $thumbDirectory=='' ? $thumbImageName : $thumbDirectory.\"/\".$thumbImageName;\n\t\timagejpeg($thumb, $destination, 100);\n\t\treturn $thumbImageName;\n\t}", "function UploadLogo($fupload_name, $folder, $ukuran, $tinggix){\n $file_upload = $folder . $fupload_name;\n\n // Simpan gambar dalam ukuran aslinya\n move_uploaded_file($_FILES[\"fupload\"][\"tmp_name\"], $file_upload);\n\n // Identitas file asli\n $gbr_asli = imagecreatefromjpeg($file_upload);\n $lebar = imageSX($gbr_asli);\n $tinggi \t= imageSY($gbr_asli);\n\n // Simpan dalam versi thumbnail\n $thumb_lebar = $ukuran;\n $thumb_tinggi = $tinggix;\n\n // Proses perubahan dimensi ukuran\n $gbr_thumb = imagecreatetruecolor($thumb_lebar,$thumb_tinggi);\n imagecopyresampled($gbr_thumb, $gbr_asli, 0, 0, 0, 0, $thumb_lebar, $thumb_tinggi, $lebar, $tinggi);\n\n // Simpan gambar thumbnail\n imagejpeg($gbr_thumb,$folder . \"small_\" . $fupload_name);\n \n // Hapus gambar di memori komputer\n imagedestroy($gbr_asli);\n imagedestroy($gbr_thumb);\n}", "function processImage($dir, $filename)\n{\n // Set up the variables\n $dir = $dir . '/';\n\n // Set up the image path\n $image_path = $dir . $filename;\n\n // Set up the thumbnail image path\n $image_path_tn = $dir . makeThumbnailName($filename);\n\n // Create a thumbnail image that's a maximum of 200 pixels square\n resizeImage($image_path, $image_path_tn, 200, 200);\n\n // Resize original to a maximum of 500 pixels square\n resizeImage($image_path, $image_path, 500, 500);\n}", "public function create_jpeg_thumbnail($imgSrc,$thumbDirectory,$thumbnail_width,$thumbnail_height,$image) {\n $thumbDirectory = trim($thumbDirectory);\n\t \t$imageSourceExploded = explode('/', $imgSrc);\n\t \t$imageName = $imageSourceExploded[count($imageSourceExploded)-1];\n\t \t$imageDirectory = str_replace($imageName, '', $imgSrc);\n\t \t$filetype = explode('.',$imageName);\n\t \t$filetype = strtolower($filetype[count($filetype)-1]);\n\t \n\t //getting the image dimensions \n\t list($width_orig, $height_orig) = getimagesize($imgSrc); \n\t \n\t \n\t //$myImage = imagecreatefromjpeg($imgSrc);\n\t\t if ($filetype == 'jpg' or $filetype == 'JPG' ) {\n\t\t $myImage = imagecreatefromjpeg(\"$imageDirectory/$imageName\");\n\t\t } else\n\t\t if ($filetype == 'jpeg' or $filetype == 'JPEG' ) {\n\t\t $myImage = imagecreatefromjpeg(\"$imageDirectory/$imageName\");\n\t\t } else\n\t\t if ($filetype == 'png' or $filetype == 'PNG' ) {\n\t\t $myImage = imagecreatefrompng(\"$imageDirectory/$imageName\");\n\t\t } else\n\t\t if ($filetype == 'gif' or $filetype == 'GIF') {\n\t\t $myImage = imagecreatefromgif(\"$imageDirectory/$imageName\");\n\t\t }\n\t \n\t \t$ratio_orig = $width_orig/$height_orig;\n\t \n\t\t if ($thumbnail_width/$thumbnail_height > $ratio_orig) {\n\t\t $new_height = $thumbnail_width/$ratio_orig;\n\t\t $new_width = $thumbnail_width;\n\t\t } else{\n\t\t $new_width = $thumbnail_height*$ratio_orig;\n\t\t $new_height = $thumbnail_height;\n\t\t }\n\t \n\t\t $x_mid = $new_width/2; //horizontal middle\n\t\t $y_mid = $new_height/2; //vertical middle\n\t \n\t \t$process = imagecreatetruecolor(round($new_width), round($new_height)); \n\t \n\t\t if($ratio_orig>=1){\n\t\t\t imagecopyresampled($process, $myImage, 0, 0, 0, 0, $new_width, $new_height, $width_orig, $height_orig);\n\t\t\t \n\t\t\t $thumb = imagecreatetruecolor($thumbnail_width, $thumbnail_height);\n\t\t\t \n\t\t\t imagecopyresampled($thumb, $process, 0, 0, ($x_mid-($thumbnail_width/2)), ($y_mid-($thumbnail_height/2)), $thumbnail_width, $thumbnail_height, $thumbnail_width, $thumbnail_height);\n\t\t }else{\n\t\t\t \t$ratio_desc = ceil(($thumbnail_height/$height_orig)*100);\n\t\t\t\t $new_height = round(($ratio_desc/100)*$height_orig);\n\t\t\t\t $new_width = round(($ratio_desc/100)*$width_orig);\n\t\t\t \n\t\t\t\t $thumb = imagecreatetruecolor($thumbnail_width, $thumbnail_height) ;\n\t\t\t\t // fill rest color with grey background\n\t\t\t\t $grey = imagecolorallocate($thumb, 62, 62, 62);\n\t\t\t\t imagefill($thumb, 0, 0, $grey);\n\t\t\t\t \n\t\t\t\t imagecopyresampled($thumb, $myImage, round(($thumbnail_width-$new_width)/2), 0, 0, 0, $new_width, $thumbnail_height, $width_orig, $height_orig);\n\t\t }\n\t \n\t $thumbImageName = $image;\n\t $destination = $thumbDirectory=='' ? $thumbImageName : $thumbDirectory.\"/\".$thumbImageName;\n\t imagejpeg($thumb, $destination, 100);\n\t return $thumbImageName;\n\t }", "public function image_resize()\n {\n $url = $this->input->get('pic');\n $width = $this->input->get('width');\n $height = $this->input->get('height');\n $bgcolor = $this->input->get('color');\n $type = $this->input->get('type');\n $loc = $this->input->get('loc');\n if (empty($type)) {\n $type = 'fit'; // fit, fill\n }\n if (empty($loc)) {\n $loc = 'Center'; // NorthWest, North, NorthEast, West, Center, East, SouthWest, South, SouthEast\n }\n $strict = FALSE;\n if (substr($width, -1) == \"*\" && substr($height, -1) == \"*\") {\n $width = substr($width, 0, -1);\n $height = substr($height, 0, -1);\n $strict = TRUE;\n }\n\n// $bgcolor = (trim($bgcolor) == \"\") ? \"FFFFFF\" : $bgcolor;\n// $props = array(\n// 'picture' => $url,\n// 'resize_width' => $width,\n// 'resize_height' => $height,\n// 'bg_color' => $bgcolor\n// );\n//\n// $this->load->library('Image_resize', $props);\n// $this->skip_template_view();\n\n $dest_folder = APPPATH . 'cache' . DS . 'temp' . DS;\n $this->general->createFolder($dest_folder);\n\n $pic = trim($url);\n $pic = base64_decode($pic);\n $pic = str_replace(\" \", \"%20\", $pic);\n $url = $pic;\n $url = str_replace(\" \", \"%20\", $url);\n $props = array(\n 'picture' => $url,\n 'resize_width' => $width,\n 'resize_height' => $height,\n 'bg_color' => $bgcolor\n );\n $md5_url = md5($url . serialize($props));\n $tmp_path = $tmp_file = $dest_folder . $md5_url;\n\n if (strpos($url, $this->config->item('site_url')) === FALSE && strpos($url, 's3.amazonaws') === FALSE) {\n $this->output->set_status_header(400);\n exit;\n }\n \n if (!is_file($tmp_path)) {\n $image_data = file_get_contents($url);\n if ($image_data == FALSE) {\n $curl = curl_init();\n curl_setopt($curl, CURLOPT_URL, $url);\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE);\n curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, FALSE);\n curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, FALSE);\n curl_setopt($curl, CURLOPT_TIMEOUT, 600);\n curl_setopt($curl, CURLOPT_COOKIEJAR, \"cookie.txt\");\n curl_setopt($curl, CURLOPT_COOKIEFILE, \"cookie.txt\");\n curl_setopt($curl, CURLOPT_FOLLOWLOCATION, TRUE);\n curl_setopt($curl, CURLOPT_VERBOSE, TRUE);\n //curl_setopt($curl, CURLOPT_HEADER, TRUE);\n $image_data = curl_exec($curl);\n\n if ($image_data == FALSE) {\n \t\n $httpCode = curl_getinfo($curl, CURLINFO_HTTP_CODE);\n if ($httpCode != 200) {\n $this->output->set_status_header($httpCode);\n exit;\n }\n }\n curl_close($curl);\n// $headers = parse_response_header($http_response_header);\n// if ($headers['reponse_code'] != 200) {\n// $this->output->set_status_header($headers['reponse_code']);\n// exit;\n// }\n }\n $handle = fopen($tmp_path, 'w+');\n fwrite($handle, $image_data);\n fclose($handle);\n\n $img_info = getimagesize($tmp_path);\n $img_ext = end(explode(\"/\", $img_info['mime']));\n if ($img_ext == 'jpeg' || $img_ext == \"pjpeg\") {\n $img_ext = 'jpg';\n }\n if ($strict == TRUE && $img_info[0] < $width && $img_info[1] < $height) {\n $tmp_file = $tmp_path;\n } else {\n\n $this->load->library('image_lib');\n\n $image_process_tool = $this->config->item('imageprocesstool');\n $config['image_library'] = $image_process_tool;\n if ($image_process_tool == \"imagemagick\") {\n $config['library_path'] = $this->config->item('imagemagickinstalldir');\n }\n// if ($img_ext == \"jpg\") {\n// $png_convert = $this->image_lib->convet_jpg_png($tmp_path, $tmp_path . \".png\", $config['library_path']);\n// if ($png_convert) {\n// unlink($tmp_path);\n// rename($tmp_path . \".png\", $tmp_path);\n// }\n// }\n\n if ($type == 'fill') {\n $img_info = getimagesize($tmp_path);\n $org_width = $img_info[0];\n $org_height = $img_info[1];\n\n $width_ratio = $width / $org_width;\n $height_ratio = $height / $org_height;\n if ($width_ratio > $height_ratio) {\n $resize_width = $org_width * $width_ratio;\n $resize_height = $org_height * $width_ratio;\n } else {\n $resize_width = $org_width * $height_ratio;\n $resize_height = $org_height * $height_ratio;\n }\n\n $crop_width = $width;\n $crop_height = $height;\n\n $width = $resize_width;\n $height = $resize_height;\n }\n\n $config['source_image'] = $tmp_path;\n $config['width'] = $width;\n $config['height'] = $height;\n $config['gravity'] = $loc; //center/West/East\n $config['bgcolor'] = (trim($bgcolor) != \"\") ? trim($bgcolor) : $this->config->item('imageresizebgcolor');\n $this->image_lib->initialize($config);\n $this->image_lib->resize();\n\n if ($type == 'fill') {\n $config['source_image'] = $tmp_path;\n $config['width'] = $crop_width;\n $config['height'] = $crop_height;\n $config['gravity'] = 'center';\n $config['maintain_ratio'] = FALSE;\n\n $this->image_lib->initialize($config);\n $this->image_lib->crop();\n }\n }\n }\n\n $this->image_display($tmp_file);\n }", "public function create_jpeg_thumbnail($imgSrc,$thumbDirectory,$thumbnail_width,$thumbnail_height,$image) {\n $thumbDirectory = trim($thumbDirectory);\n\t \t$imageSourceExploded = explode('/', $imgSrc);\n\t \t$imageName = $imageSourceExploded[count($imageSourceExploded)-1];\n\t \t$imageDirectory = str_replace($imageName, '', $imgSrc);\n\t \t$filetype = explode('.',$imageName);\n\t \t$filetype = strtolower($filetype[count($filetype)-1]);\n\t \n\t //getting the image dimensions \n\t list($width_orig, $height_orig) = getimagesize($imgSrc); \n\t \n\t \n\t //$myImage = imagecreatefromjpeg($imgSrc);\n\t\t if ($filetype == 'jpg' or $filetype == 'JPG' ) {\n\t\t $myImage = imagecreatefromjpeg(\"$imageDirectory/$imageName\");\n\t\t } else\n\t\t if ($filetype == 'jpeg' or $filetype == 'JPEG' ) {\n\t\t $myImage = imagecreatefromjpeg(\"$imageDirectory/$imageName\");\n\t\t } else\n\t\t if ($filetype == 'png' or $filetype == 'PNG' ) {\n\t\t $myImage = imagecreatefrompng(\"$imageDirectory/$imageName\");\n\t\t } else\n\t\t if ($filetype == 'gif' or $filetype == 'GIF') {\n\t\t $myImage = imagecreatefromgif(\"$imageDirectory/$imageName\");\n\t\t }\n\t \n\t \t$ratio_orig = $width_orig/$height_orig;\n\t \n\t\t if ($thumbnail_width/$thumbnail_height > $ratio_orig) {\n\t\t $new_height = $thumbnail_width/$ratio_orig;\n\t\t $new_width = $thumbnail_width;\n\t\t } else{\n\t\t $new_width = $thumbnail_height*$ratio_orig;\n\t\t $new_height = $thumbnail_height;\n\t\t }\n\t \n\t\t $x_mid = $new_width/2; //horizontal middle\n\t\t $y_mid = $new_height/2; //vertical middle\n\t \n\t \t$process = imagecreatetruecolor(round($new_width), round($new_height)); \n\t \n\t\t if($ratio_orig>=1 or $thumbnail_height!=PROPERTY_THUMB_HEIGHT_LARGE){\n\t\t\t imagecopyresampled($process, $myImage, 0, 0, 0, 0, $new_width, $new_height, $width_orig, $height_orig);\n\t\t\t \n\t\t\t $thumb = imagecreatetruecolor($thumbnail_width, $thumbnail_height);\n\t\t\t \n\t\t\t imagecopyresampled($thumb, $process, 0, 0, ($x_mid-($thumbnail_width/2)), ($y_mid-($thumbnail_height/2)), $thumbnail_width, $thumbnail_height, $thumbnail_width, $thumbnail_height);\n\t\t }else{\n\t\t\t \t$ratio_desc = ceil(($thumbnail_height/$height_orig)*100);\n\t\t\t\t $new_height = round(($ratio_desc/100)*$height_orig);\n\t\t\t\t $new_width = round(($ratio_desc/100)*$width_orig);\n\t\t\t \n\t\t\t\t $thumb = imagecreatetruecolor($thumbnail_width, $thumbnail_height) ;\n\t\t\t\t // fill rest color with grey background\n\t\t\t\t $grey = imagecolorallocate($thumb, 62, 62, 62);\n\t\t\t\t imagefill($thumb, 0, 0, $grey);\n\t\t\t\t \n\t\t\t\t imagecopyresampled($thumb, $myImage, round(($thumbnail_width-$new_width)/2), 0, 0, 0, $new_width, $thumbnail_height, $width_orig, $height_orig);\n\t\t }\n\t \n\t $thumbImageName = $image;\n\t $destination = $thumbDirectory=='' ? $thumbImageName : $thumbDirectory.\"/\".$thumbImageName;\n\t imagejpeg($thumb, $destination, 100);\n\t return $thumbImageName;\n\t }", "protected function resizeImage($path)\n\t{\n\t\t$iP = &$this->uploader->imageProcessor;\n\t\t$iP->load($this->uploader->mediaService->getItem($path));\n\t\t$iP->resize_square(500);\n\t\t$iP->saveImage();\n }", "function createthumb($name,$filename,$new_w,$new_h) {\n $system=explode(\".\",$name);\n if (preg_match(\"/jpg|jpeg/\", $system[sizeof($system) - 1])) {\n $src_img=imagecreatefromjpeg($name);\n } else return;\n\n $old_x=imageSX($src_img);\n $old_y=imageSY($src_img);\n if ($old_x > $old_y) {\n $thumb_w=$new_w;\n $thumb_h=$old_y*($new_h/$old_x);\n }\n if ($old_x < $old_y) {\n $thumb_w=$old_x*($new_w/$old_y);\n $thumb_h=$new_h;\n }\n if ($old_x == $old_y) {\n $thumb_w=$new_w;\n $thumb_h=$new_h;\n }\n $dst_img=ImageCreateTrueColor($thumb_w,$thumb_h);\n imagecopyresampled($dst_img,$src_img,0,0,0,0,$thumb_w,$thumb_h,$old_x,$old_y);\n echo imagejpeg($dst_img,$filename);\n\n imagedestroy($dst_img);\n imagedestroy($src_img);\n}", "function make_thumb($img_name, $filename, $new_w, $new_h) {\n //get image extension.\n $ext = getExtension($img_name);\n //creates the new image using the appropriate function from gd library\n if (!strcmp(\"jpg\", $ext) || !strcmp(\"jpeg\", $ext))\n $src_img = imagecreatefromjpeg($img_name);\n\n if (!strcmp(\"png\", $ext))\n $src_img = imagecreatefrompng($img_name);\n\n //gets the dimmensions of the image\n $old_x = imageSX($src_img);\n $old_y = imageSY($src_img);\n\n // next we will calculate the new dimmensions for the thumbnail image\n // the next steps will be taken: \n // 1. calculate the ratio by dividing the old dimmensions with the new ones\n // 2. if the ratio for the width is higher, the width will remain the one define in WIDTH variable\n // and the height will be calculated so the image ratio will not change\n // 3. otherwise we will use the height ratio for the image\n // as a result, only one of the dimmensions will be from the fixed ones\n $ratio1 = $old_x / $new_w;\n $ratio2 = $old_y / $new_h;\n if ($ratio1 > $ratio2) {\n $thumb_w = $new_w;\n $thumb_h = $old_y / $ratio1;\n } else {\n $thumb_h = $new_h;\n $thumb_w = $old_x / $ratio2;\n }\n\n // we create a new image with the new dimmensions\n $dst_img = ImageCreateTrueColor($thumb_w, $thumb_h);\n\n // resize the big image to the new created one\n imagecopyresampled($dst_img, $src_img, 0, 0, 0, 0, $thumb_w, $thumb_h, $old_x, $old_y);\n\n // output the created image to the file. Now we will have the thumbnail into the file named by $filename\n if (!strcmp(\"png\", $ext))\n imagepng($dst_img, $filename);\n else\n imagejpeg($dst_img, $filename);\n\n //destroys source and destination images. \n imagedestroy($dst_img);\n imagedestroy($src_img);\n}", "function saveResizedImage($format,$imgData,$resizedFilename){\n \tswitch( $format ){\n\t\tcase 1:\n\t\timagegif($imgData, $resizedFilename);\n\t\tbreak;\n\t\tcase 2:\n\t\timagejpeg($imgData, $resizedFilename, 75);\n\t\tbreak;\n\t\tcase 3:\n\t\timagepng($imgData, $resizedFilename, 1);\n\t}\n}", "function create_medium($type, $image){\r\n\techo $source_path=DIR_FS_SITE.'upload/photo/'.$type.'/large/'.$image;\r\n\techo $destination_path=DIR_FS_SITE.'upload/photo/'.$type.'/medium/'.$image;\r\n\tlist($width, $height) = getimagesize($source_path);\r\n $xscale=$width/MEDIUM_WIDTH;\r\n $yscale=$height/MEDIUM_HEIGHT;\r\n \r\n // Recalculate new size with default ratio\r\n if ($yscale>$xscale){\r\n $new_width = round($width * (1/$yscale));\r\n $new_height = round($height * (1/$yscale));\r\n }\r\n else {\r\n $new_width = round($width * (1/$xscale));\r\n $new_height = round($height * (1/$xscale));\r\n }\r\n\r\n #check image format and create image\r\n if(strtolower(substr($source_path, -3))=='jpg'):\r\n $imageTmp = imagecreatefromjpeg ($source_path);\r\n elseif(strtolower(substr($source_path, -3))=='gif'):\r\n $imageTmp = imagecreatefromgif($source_path);\r\n elseif(strtolower(substr($source_path, -3))=='png'):\r\n $imageTmp = imagecreatefrompng($source_path);\r\n endif;\r\n\r\n // Resize the original image & output\r\n $imageResized = imagecreatetruecolor($new_width, $new_height);\r\n # $imageTmp = imagecreatefromjpeg ($source_path);\r\n imagecopyresampled($imageResized, $imageTmp, 0, 0, 0, 0, $new_width, $new_height, $width, $height);\r\n output_img($imageResized, image_type_to_mime_type(getimagesize($source_path)), $destination_path);\r\n}", "function resize_png_image($img,$newWidth,$newHeight,$target){\r\n\t\t\t//$srcImage=imagecreatefrompng('D:\\Projects\\xampp\\htdocs\\wannaquiz\\watermarks\\linkedin2.png');\r\n $srcImage=imagecreatefrompng($img);\r\n\t\t\tif($srcImage==''){\r\n\t\t\t\treturn FALSE;\r\n\t\t\t}\r\n\t\t\t$srcWidth=imagesx($srcImage);\r\n\t\t\t$srcHeight=imagesy($srcImage);\r\n\t\t\t$percentage=(double)$newWidth/$srcWidth;\r\n\t\t\t$destHeight=round($srcHeight*$percentage)+1;\r\n\t\t\t$destWidth=round($srcWidth*$percentage)+1;\r\n\t\t\tif($destHeight > $newHeight){\r\n\t\t\t\t// if the width produces a height bigger than we want, calculate based on height\r\n\t\t\t\t$percentage=(double)$newHeight/$srcHeight;\r\n\t\t\t\t$destHeight=round($srcHeight*$percentage)+1;\r\n\t\t\t\t$destWidth=round($srcWidth*$percentage)+1;\r\n\t\t\t}\r\n\t\t\t$destImage=imagecreatetruecolor($destWidth-1,$destHeight-1);\r\n\t\t\tif(!imagealphablending($destImage,FALSE)){\r\n\t\t\t\treturn FALSE;\r\n\t\t\t}\r\n\t\t\tif(!imagesavealpha($destImage,TRUE)){\r\n\t\t\t\treturn FALSE;\r\n\t\t\t}\r\n\t\t\tif(!imagecopyresampled($destImage,$srcImage,0,0,0,0,$destWidth,$destHeight,$srcWidth,$srcHeight)){\r\n\t\t\t\treturn FALSE;\r\n\t\t\t}\r\n\t\t\tif(!imagepng($destImage,$target)){\r\n\t\t\t\treturn FALSE;\r\n\t\t\t}\r\n\t\t\timagedestroy($destImage);\r\n\t\t\timagedestroy($srcImage);\r\n\t\t\treturn TRUE;\r\n\t\t}", "public function do_profile_resize_image($data){\n\t\t//Your Image\n\t\t$imgSrc = 'public/upload/img/profile/' . $data['file'];\n\n\t\t//getting the image dimensions\n\t\tlist($width, $height) = getimagesize($imgSrc);\n\n\t\t//saving the image into memory (for manipulation with GD Library)\n\t\tif ($data['type'] == \"jpeg\" || $data['type'] == \"jpg\")\n\t\t\t$myImage = imagecreatefromjpeg($imgSrc);\n\t\telse if ($data['type'] == \"png\")\n\t\t\t$myImage = imagecreatefrompng($imgSrc);\n\t\telse if ($data['type'] == \"gij\")\n\t\t\t$myImage = imagecreatefromgif($imgSrc);\n\n\t\t// calculating the part of the image to use for thumbnail\n\t\tif ($width > $height) {\n\t\t $y = 0;\n\t\t $x = ($width - $height) / 2;\n\t\t $smallestSide = $height;\n\t\t} else {\n\t\t $x = 0;\n\t\t $y = ($height - $width) / 2;\n\t\t $smallestSide = $width;\n\t\t}\n\n\t\t// copying the part into thumbnail\n\t\t$thumbSize = 300;\n\t\t$thumb = imagecreatetruecolor($thumbSize, $thumbSize);\n\t\timagecopyresampled($thumb, $myImage, 0, 0, $x, $y, $thumbSize, $thumbSize, $smallestSide, $smallestSide);\n\n\t\t//final output\n\t\t$thumbnail_path = 'public/upload/img/profile/thumbnail_' . $data['file'];\n\t\tif ($data['type'] == \"jpeg\" || $data['type'] == \"jpg\") {\n\t\t\timagejpeg($thumb, $thumbnail_path);\n\t\t}\n\t\telse if ($data['type'] == \"png\") {\n\t\t\timagepng($thumb, $thumbnail_path);\n\t\t}\n\t\telse if ($data['type'] == \"gif\") {\n\t\t\timagegif($thumb, $thumbnail_path);\n\t\t}\n\n\t}", "function upload_picture_thumb($img = '',$uploadPath,$uploadPath1,$thumbwidth, $thubHeight) {\n $config['upload_path'] = getcwd() . $uploadPath;\n $config['allowed_types'] = 'gif|jpg|png|jpeg';\n $this->CI = & get_instance();\n $config['max_width'] = '10241';\n $config['max_height'] = '7681';\n $config['encrypt_name'] = TRUE;\n $this->CI->load->library('upload', $config);\n if ($this->CI->upload->do_upload($img)) {\n $newdata = $this->CI->upload->data();\n $img_new = $newdata['file_name'];\n $config['image_library'] = 'gd2';\n //$config['source_image'] = getcwd().'/upload_image/thumb/'.$img_new;\n $config['source_image'] = getcwd() . $uploadPath.$img_new;\n $config['new_image'] = getcwd() .$uploadPath1. $img_new;\n $config['create_thumb'] = FALSE;\n $config['maintain_ratio'] = TRUE;\n $config['width'] = $thumbwidth;\n $config['height'] = $thubHeight;\n\n //print_r($config);\n $this->CI->load->library('image_lib', $config);\n $this->CI->image_lib->resize();\n //$this->CI->image_lib->initialize($config);\n //$this->CI->image_lib->resize();\n //$this->CI->image_lib->clear();\n return $img_new;\n }\n }", "function UploadSlideshow($nama_file_unik, $folder){\n $file_upload = $folder . $nama_file_unik;\n\n // Simpan gambar dalam ukuran aslinya\n move_uploaded_file($_FILES[\"gb_slideshow\"][\"tmp_name\"], $file_upload);\n \n // Identitas file asli\n $gbr_asli = imagecreatefromjpeg($file_upload);\n $lebar = imageSX($gbr_asli);\n $tinggi \t= imageSY($gbr_asli);\n\n // Simpan dalam versi thumbnail\n $thumb_lebar = 180;\n $thumb_tinggi = 180;\n\n // Proses perubahan dimensi ukuran\n $gbr_thumb = imagecreatetruecolor($thumb_lebar,$thumb_tinggi);\n imagecopyresampled($gbr_thumb, $gbr_asli, 0, 0, 0, 0, $thumb_lebar, $thumb_tinggi, $lebar, $tinggi);\n\n // Simpan gambar thumbnail\n imagejpeg($gbr_thumb,$folder . \"small_\" . $nama_file_unik);\n \n // Hapus gambar di memori komputer\n imagedestroy($gbr_asli);\n imagedestroy($gbr_thumb);\n}", "function imageToThumb($fname, $imgheight, $imgwidth, $foldername) {\r\n\t// Open the directory\r\n\t$pathToImages = urldecode ( $_REQUEST [\"jpath\"] );\r\n\t$pathToThumbs = urldecode ( $_REQUEST [\"jpath\"] ) . $foldername . \"/\";\r\n\t$dir = opendir ( $pathToImages );\r\n\tini_set ( \"memory_limit\", \"1000M\" );\r\n\r\n\t// Loop through it, looking for any/all JPG files:\r\n\tif (readdir ( $dir )) {\r\n\t\t// Parse path for the extension\r\n\t\t$info = pathinfo ( $pathToImages . $fname );\r\n\t\t\r\n\t\tif (strtolower ( $info ['extension'] ) == 'jpg') {\r\n\t\t\t// Load image and get image size\r\n\t\t\t$img = imagecreatefromjpeg ( \"{$pathToImages}{$fname}\" );\r\n\t\t} else if (strtolower ( $info ['extension'] ) == 'png') {\r\n\t\t\t// Load image and get image size\r\n\t\t\t$img = imagecreatefrompng ( \"{$pathToImages}{$fname}\" );\r\n\t\t} else if (strtolower ( $info ['extension'] ) == 'gif') {\r\n\t\t\t// Load image and get image size\r\n\t\t\t$img = imagecreatefromgif ( \"{$pathToImages}{$fname}\" );\r\n\t\t}\r\n\r\n\t\t$width = imagesx ( $img );\r\n\t\t$height = imagesy ( $img );\r\n\t\t\r\n\t\t/* Calculate thumbnail size\r\n\t\t * $new_width = $thumbWidth;\r\n\t\t * $new_height = floor($height * ( $thumbWidth / $width )); */\r\n\t\t\r\n\t\t$new_width = $imgwidth;\r\n\t\t$new_height = $imgheight;\r\n\t\t\r\n\t\t// Create a new temporary image\r\n\t\t$tmp_img = imagecreatetruecolor ( $new_width, $new_height );\r\n\t\t\r\n\t\t// Copy and resize old image into new image\r\n\t\timagecopyresized ( $tmp_img, $img, 0, 0, 0, 0, $new_width, $new_height, $width, $height );\r\n\t\t\r\n\t\tif (strtolower ( $info ['extension'] ) == 'jpg') {\r\n\t\t\t// Save thumbnail into a file\r\n\t\t\timagejpeg ( $tmp_img, \"{$pathToThumbs}{$fname}\" );\r\n\t\t} else if (strtolower ( $info ['extension'] ) == 'png') {\r\n\t\t\t// Save thumbnail into a file\r\n\t\t\timagepng ( $tmp_img, \"{$pathToThumbs}{$fname}\" );\r\n\t\t} else if (strtolower ( $info ['extension'] ) == 'gif') {\r\n\t\t\t// Save thumbnail into a file\r\n\t\t\timagegif ( $tmp_img, \"{$pathToThumbs}{$fname}\" );\r\n\t\t}\r\n\t}\r\n\r\n\t// Close the directory\r\n\tclosedir ( $dir );\r\n}", "function UploadAlbum($nama_file_unik, $folder){\n $file_upload = $folder . $nama_file_unik;\n\n // Simpan gambar dalam ukuran aslinya\n move_uploaded_file($_FILES[\"gb_album\"][\"tmp_name\"], $file_upload);\n \n // Identitas file asli\n $gbr_asli = imagecreatefromjpeg($file_upload);\n $lebar = imageSX($gbr_asli);\n $tinggi \t= imageSY($gbr_asli);\n\n // Simpan dalam versi thumbnail\n $thumb_lebar = 180;\n $thumb_tinggi = 180;\n\n // Proses perubahan dimensi ukuran\n $gbr_thumb = imagecreatetruecolor($thumb_lebar,$thumb_tinggi);\n imagecopyresampled($gbr_thumb, $gbr_asli, 0, 0, 0, 0, $thumb_lebar, $thumb_tinggi, $lebar, $tinggi);\n\n // Simpan gambar thumbnail\n imagejpeg($gbr_thumb,$folder . \"small_\" . $nama_file_unik);\n \n // Hapus gambar di memori komputer\n imagedestroy($gbr_asli);\n imagedestroy($gbr_thumb);\n}", "function media_upload_max_image_resize()\n {\n }", "function upload_image($img_name, $img_size, $tmp) {\n\n if ($img_size < 1024*1024*2) // size < 2MB\n {\n // emrit i shtohet nje nr random qe mos ngaterrohet\n $img_new_name = rand(00, 9999).strtolower(str_replace(' ', '-', $img_name));\n\n if (move_uploaded_file($tmp, SERVER_URL.'uploads/'.$img_new_name)) {\n chmod(SERVER_URL.'uploads/'.$img_new_name, 0666);\n echo '<p>The image was updated successfully</p>';\n\n return $img_new_name;\n }\n else {\n echo '<p>There was a problem during upload. Please try again.</p>';\n\n }\n }\n }", "function makeThumbnail($newfile, $where, $username) {\n\n // Setup the new file name\n $filename = $newfile;\n $target_dir = \"uploads/\";\n $target_file = $target_dir . basename($_FILES['fileToUplaod'][\"name\"]);\n $imageFileType = pathinfo($target_file, PATHINFO_EXTENSION);\n\n // Set a maximum height and width\n $width = 200;\n $height = 200;\n\n // Content type\n //header('Content-Type: image/jpeg');\n\n // Get new dimensions using the width and height from above\n list($width_orig, $height_orig) = getimagesize($filename);\n\n $ratio_orig = $width_orig/$height_orig;\n\n if ($width/$height > $ratio_orig) {\n $width = $height*$ratio_orig;\n } else {\n $height = $width/$ratio_orig;\n }\n\n // Resample & Resize the Images (JPGs, PNG, GIF)\n\n if($imageFileType == \"jpg\" || $imageFileType == \"jpeg\") {\n //header('Content-Type: image/jpeg');\n $image_p = imagecreatetruecolor($width, $height);\n $image = imagecreatetruecolor($filename);\n imagecopyresampled($image_p, $image, 0, 0, 0, 0, $width, $height, $width_orig, $height_orig);\n imagejpeg($image_p, $where.$username.'thumbnail.jpg');\n\n // Combine & return the username with the word 'thumbnail.jpg' at the end.\n return $username.'thumbnail.jpg';\n }\n\n if($imageFileType == \"png\") {\n //header('Content-Type: image/png');\n $image_p = imagecreatetruecolor($width, $height);\n $image = imagecreatefrompng($filename);\n imagecopyresampled($image_p, $image, 0, 0, 0, 0, $width, $height, $width_orig, $height_orig);\n imagepng($image_p, $where.$username.'thumbnail.png');\n\n // Combine & return the username with the word 'thumbnail.png' at the end.\n return $username.'thumbnail.png';\n }\n\n if($imageFileType == \"gif\") {\n //header('Content-Type: image/gif');\n $image_p = imagecreatetruecolor($width, $height);\n $image = imagecreatefromgif($filename);\n imagecopyresampled($image_p, $image, 0, 0, 0, 0, $width, $height, $width_orig, $height_orig);\n imagegif($image_p, $where.$username.'thumbnail.gif');\n\n // Combine & return the username with the word 'thumbnail.png' at the end.\n return $username.'thumbnail.gif';\n }\n\n //var_dump(debug_backtrace());\n return $username.'thumbnail.png';\n\n}", "function upload_image($image,$path,$modwidths,$unlink){\n\t\t\t $imagename = $image['name'];\n\t\t\t $ext = pathinfo($imagename,PATHINFO_EXTENSION);\n $source = $image['tmp_name'];\n $target = $path.$imagename;\n\t\t\t $this->filename = $this->name.\".jpg\";\n move_uploaded_file($source, $target);\n \t\t\t $imagepath = $imagename;\n \t\t\t $file = $path.\"/\".$imagepath; //This is the original file\n \t\t\t\t\n list($width, $height) = getimagesize($file) ; \n\t\t\t //create images for each modwidth specified\n\t\t\t foreach($modwidths as $modwidth)\n\t\t\t {\n\t\t\t\t $newid = uniqid();\n\t\t\t\t $save = $path.\"/\".$newid.\".jpg\"; //This is the new file you saving\n\t\t\t\t $this->images[] = $newid.\".jpg\"; //This saves the image name in the images array of the class\n\t\t\t\t $diff = $width / $modwidth;\t//Calculate image scale based on the modwidth\n\t \n\t\t\t\t $modheight = $height / $diff; //calculate modheight based on the scale\n\t\t\t\t \n\t\t\t\t $tn = imagecreatetruecolor($modwidth, $modheight) ; \n\t\t\t\t //Generate the image from the source\n\t\t\t\t if ($ext == \"jpg\" or $ext == \"jpeg\")\n\t\t\t\t $image = imagecreatefromjpeg($file);\n\t\t\t\t elseif ($ext == \"gif\")\n\t\t\t\t $image = imagecreatefromgif($file);\n\t\t\t\t elseif ($ext == \"png\")\n\t\t\t\t $image = imagecreatefrompng($file);\n\t\t\t\t else\n\t\t\t\t $image = false; \n\t\t\t\t \n\t\t\t\t if ($image)\n\t\t\t\t {\n\t\t\t\t\t imagecopyresampled($tn, $image, 0, 0, 0, 0, $modwidth, $modheight, $width, $height) ; \n\t\t\t\t\t imagejpeg($tn, $save, 100) ; \n\t\t\t\t\t $this->success = true; //set the success variable of the class as true\n\t\t\t\t }\n\t\t\t\t else\n\t\t\t\t {\n\t\t\t\t\t $this->success = false; //set the success variable of the class as false\n\t\t\t\t }\n\t\t\t }\n \t\t\t//Delete source file if the unlink variable is set to 1\n \t\t\t if ($unlink == 1)\n\t\t\t unlink($target);\n\t\t}", "public function ResizeImageThumbnail($image_path, $height, $width,$image){\n\t $img_name_only = explode('.', $image);\n\t $img_name_only = $img_name_only[0];\n\t $image = new \\Imagick($image_path.'/'.$image);\n\t $image->thumbnailImage($width, $height);\n\t $store_image_with_new_name=$image_path.'/'.$img_name_only.'_'.$width.'X'.$height.'.jpeg';\n\t $image->writeImage($store_image_with_new_name);\n\t $image->destroy();\n\t return $img_name_only.'.jpeg';\n \t}", "function SousCategorieNewsLogoUpload($nom_dev){\n\ndefine('KB', 1024);\ndefine('MB', 1048576);\ndefine('GB', 1073741824);\ndefine('TB', 1099511627776);\n\n\t$max_file = 3*MB;\n\t$max_width = \"300\";\n\t$upload_path_pictures = dossier_categories_news().\"/\";// The path to where the image will be saved\n\n\t//Image Locations\n\t$image_name = deleteTousCaracteresSpeciaux($nom_dev).'_'.nameimage();\n\t$image_location = $upload_path_pictures.$image_name;\n\n\t//on recupère les données du fichier \n\t//le nom du fichier\n $userfile_name = $_FILES[\"image\"][\"name\"]; \n //le nom du fichier temporaire\n $userfile_tmp = $_FILES[\"image\"][\"tmp_name\"]; \n //la taille du fichier\n $userfile_size = $_FILES[\"image\"][\"size\"]; \n //le nom du fichier path exclus\n $filename = basename($_FILES[\"image\"][\"name\"]); \n //l'extension du fichier\n $file_ext = substr($filename, strrpos($filename, \".\") + 1); \n\n if(testFormatSousCategorieNewsLogo()){\n \t//tout est ok, on peut uploader le fichier\n move_uploaded_file($userfile_tmp, $image_location); \n chmod ($image_location, 0777); \n $width = getWidth($image_location); \n $height = getHeight($image_location); \n //Scale the image if it is greater than the width set above \n if ($width > $max_width){ \n $scale = $max_width/$width; \n $uploaded = resizeImage($image_location,$width,$height,$scale); \n }else{ \n $scale = 1; \n $uploaded = resizeImage($image_location,$width,$height,$scale); \n } \n }\n return $image_name;\n}", "public function image_size(){\n\t\t//add_image_size( 'thumb-owl', 205, 205, true );\n//\tadd_image_size( 'thumb-150', 150, 150, true);\n//\tadd_image_size( 'thumb-120', 120, 120, true);\n//\tadd_image_size( 'thumb-100', 100, 100, true );\n//\tadd_image_size( 'thumb-250', 250, 250, true );\n// // add_image_size( 'thumb-150', 150, 150, true ); //wordpress thumbail\n// add_image_size( 'thumb-60', 60, 60, true);\n//\t\t//add_image_size( 'thumb-editor', 500, 9999, true );\n//remove_image_size( 'thumb-editor');\n\t\t//remove_image_size('large');\n\t\t//remove_image_size('medium_large');\n\t}", "function resize($src_file, $dest_file, $new_size, $img_meta) {\n if (!zmgGd1xTool::isSupportedType($img_meta['extension'], $src_file)) {\n return false;\n }\n \n // height/width\n $ratio = max($img_meta['width'], $img_meta['height']) / $new_size;\n $ratio = max($ratio, 1.0);\n $destWidth = (int)($img_meta['width'] / $ratio);\n $destHeight = (int)($img_meta['height'] / $ratio);\n if ($img_meta['extension'] == \"jpg\" || $img_meta['extension'] == \"jpeg\") {\n $src_img = imagecreatefromjpeg($src_file);\n } else {\n $src_img = imagecreatefrompng($src_file);\n }\n if (!$src_img) {\n return zmgToolboxPlugin::registerError($src_file, 'GD 1.x: Could not convert image.');\n }\n $dst_img = imagecreate($destWidth, $destHeight);\n imagecopyresized($dst_img, $src_img, 0, 0, 0, 0, $destWidth, (int)$destHeight,\n $img_meta['width'], $img_meta['height']);\n\n if ($img_meta['extension'] == \"jpg\" || $img_meta['extension'] == \"jpeg\") {\n imagejpeg($dst_img, $dest_file, $img_meta['jpeg_qty']);\n } else {\n imagepng($dst_img, $dest_file);\n }\n\n imagedestroy($src_img);\n imagedestroy($dst_img);\n return true;\n }", "public function ImageResize($file_resize_width, $file_resize_height){\r\n $this->proc_filewidth=$file_resize_width;\r\n $this->proc_fileheight=$file_resize_height;\r\n }", "public function ezbs_add_image_size(){\n \n $obj_ezc_add_image_size = Class_WP_ezClasses_Theme_Add_Image_Size_1::ez_new();\n\t \n\t // $obj_ezc_add_image_size->set_remove_width_height(false);\n\t \n\t // $obj_ezc_add_image_size->set_jpeg_quality(80);\t\n\t \n\t $arr_args['arr_args'] = $this->ezbs_add_image_size_args();\n\t \n\t // ais = add image size\n\t $obj_ezc_add_image_size->ez_ais($arr_args);\n\t \n\t //$obj_ezc_add_image_size->set_image_size_names_choose_defaults(false);\n\t \n\t // isnc = image_size_names_choose (with is a stock WP filter) \n\t $obj_ezc_add_image_size->ez_isnc($arr_args);\t \n\t \n }", "private function doImageResize($img){\n\t\t//Determine the new dimensions\n\t\t$d=$this->getNewDims($img);\n\t\t\n\t\t//Determine which function to use\n\t\t$funcs=$this->getImageFunctions($img);\n\t\t\n\t\t//Determine the image type\n\t\t$src_img=$funcs[0]($img);\n\t\t\n\t\t//Determine the new image size\n\t\t$new_img=imagecreatetruecolor($d[0], $d[1]);\n\t\t\n\t\tif(imagecopyresampled\n\t\t\t\t($new_img, $src_img, 0, 0, 0, 0, $d[0],$d[1] , $d[2], $d[3])){\n\t\t\timagedestroy($src_img);\n\t\t\t//check if the new image has the same file type as the original one\n\t\t\tif($new_img && $funcs[1]($new_img,$img)){\n\t\t\t\timagedestroy($new_img);\n\t\t\t}\n\t\t\telse{\n\t\t\t\tthrow new Exception('Failed to save the new image!');\n\t\t\t}\n\t\t\t\n\t\t}\n\t\telse{\n\t\t\tthrow new Exception(\"Could not resample the image!\");\n\t\t}\n\t\t\n\t}" ]
[ "0.7755187", "0.76064634", "0.7574261", "0.75533295", "0.7529035", "0.75171125", "0.7381917", "0.73799914", "0.73686063", "0.7246326", "0.72441864", "0.72436154", "0.72162515", "0.7143735", "0.71314764", "0.7126696", "0.71230406", "0.7117989", "0.71134704", "0.7109626", "0.7107053", "0.7106287", "0.710035", "0.7065604", "0.70556825", "0.7054375", "0.7042157", "0.7036655", "0.7033523", "0.7017738", "0.70113295", "0.70023686", "0.69895095", "0.69842327", "0.69690704", "0.69681066", "0.6961923", "0.69559705", "0.69556385", "0.6929591", "0.69177353", "0.6910671", "0.69077677", "0.6904618", "0.68985957", "0.6884316", "0.6877207", "0.68709874", "0.686951", "0.6860907", "0.68546814", "0.6853304", "0.68517494", "0.6849563", "0.6842875", "0.68077624", "0.68039554", "0.680182", "0.67691284", "0.67664194", "0.67653424", "0.67495376", "0.6747485", "0.6745616", "0.6742469", "0.67404175", "0.6733659", "0.6731866", "0.67144847", "0.6712593", "0.67104596", "0.6706884", "0.67038834", "0.67021525", "0.6701345", "0.670077", "0.66995484", "0.66978836", "0.66894484", "0.66824925", "0.66550106", "0.6640215", "0.6638363", "0.6637414", "0.6635065", "0.6622195", "0.66194314", "0.6618886", "0.6617242", "0.6614519", "0.6614266", "0.6613991", "0.6611191", "0.6608376", "0.6608268", "0.660772", "0.6604036", "0.66005284", "0.6589263", "0.6581239" ]
0.6619057
87
Written Pham Vu Hoang Luyen
function Update_table($dk, $table, &$db) { $sql_query = "update `".$table."` set ". $dk; $sql_query = $db->sql_query($sql_query) or die(mysql_error()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function helper()\n\t{\n\t\n\t}", "private function __() {\n }", "final function velcom(){\n }", "private function _i() {\n }", "public function boleta()\n\t{\n\t\t//\n\t}", "public function AggiornaPrezzi(){\n\t}", "public function nadar()\n {\n }", "public function serch()\n {\n }", "public function masodik()\n {\n }", "public function hapus_toko(){\n\t}", "private function j() {\n }", "public function ogs()\r\n {\r\n }", "public function ex4()\n {\n }", "final private function __construct(){\r\r\n\t}", "public function custom()\n\t{\n\t}", "private function __construct()\t{}", "public function elso()\n {\n }", "public function extra_voor_verp()\n\t{\n\t}", "public static function main(){\n\t\t\t\n\t\t}", "public function init() {\t\t\n\n }", "private function __construct() {\r\n\t\t\r\n\t}", "public function __construct()\n\t\t{\n\t\t\t\n\t\t}", "private function __construct() { \n\t\t\n\n\t}", "public function aaa() {\n\t}", "abstract public function getPasiekimai();", "function __construct()\n\t{\n\t\t\n\t\t\n\t}", "public function oops () {\n }", "public function main()\r\n {\r\n \r\n }", "function __construct()\r\n\t{\t\t//Yeah bro! Freaking PhP yo..\r\n\t}", "function __construct (){\n\t\t}", "private function __construct() {\r\n\t\r\n\t}", "private function __construct()\r\n\t{\r\n\t\r\n\t}", "public function _strings_for_pot()\n {\n }", "private function __construct( )\n {\n\t}", "public function init()\n { \t\n }", "private function __construct(){\n\t\t }", "public function __construct()\n\t\t{\t\t\t\n\t\t}", "public function init()\n\t\t{\n\t\n\t\t}", "public function init() {\n\t\t\n\t}", "public function __construct() {\n \t\t \t\n\t\t}", "private function __construct () \n\t{\n\t}", "public function main()\n\t{\n\t}", "public function init()\n {\t\t\t\n }", "public function init()\n {\t\t\t\n }", "function fix() ;", "function __construct() ;", "protected function init()\n\t{\n\t\t\n\t}", "public function andar()\n {\n }", "private function __construct()\r\r\n\t{\r\r\n\t}", "public function __construct()\n\t{\n\t\tparent::__construct();\n\t\t// ben duoi nay se la cac logic cua __construct lop con ma chung ta can dinh nghia - xu ly\n\t}", "private function __construct()\n\t{\n\t\t\n\t}", "private function __construct()\r\n {\r\n }", "private function __construct()\r\n {\r\n }", "public function truycapvao_private_cha(){\n }", "function custom_construction() {\r\n\t\r\n\t\r\n\t}", "function lcs()\n {\n }", "function init()\r\n \t{\r\n \t}", "protected function test9() {\n\n }", "public function leer(){\n }", "public function init(){\n\t\t\n\t}", "public function __init(){}", "function extract()\n {\n }", "public function leer(){\n }", "public function leer(){\n }", "public function __construct() {\n\t\t\n\t}", "public function __construct() {\n\t\t\n\t}", "public function __construct() {\n\t\t\n\t}", "public function __construct() {\n\t\t\n\t}", "public function __construct() {\n\t\t\n\t}", "public static function getCode()\n\t{\n\t\tthrow new NotImplementedException;\n\t}", "private function __construct() \n {\n\t\t\n }", "function _pre() {\n\n\t}", "private function __construct()\r\n\t{\r\n\t}", "public static function Parse837()\n\t{\n\n\t}", "function input_admin_head()\n\t{\n\t\t// Note: This function can be removed if not used\n\n\t\t\n\t\t\n\t}", "function _construct() {\n \t\n\t\t\n\t}", "public function init()\n {\n \treturn;\n }", "function __construct()\r\n\t\t{\r\n\t\t\t\r\n\t\t}", "public function veriCode() {}", "protected function _getNextCode() {}", "function __toString () {\n \n \n \n }", "public function init()\n\t{\n\n\t}", "private function method1()\n\t{\n\t}", "public function init(){\n\t\t\t\t}", "private function __construct(){\n \t\n }", "final private function __construct()\n\t{\n\t}", "public function init ()\r\n {\r\n }", "public static function declarations()\n {\n \n }", "private function __construct()\n\t{\n\n\t}", "protected function _init()\r\n\t{\r\n\t}", "public function obtener()\n {\n }", "public function __construct() {\r\n\t\t\r\n\t}", "protected function __init__() { }", "function verReg() {\n \n }", "final private function __construct() { }", "final private function __construct() { }", "final private function __construct() { }", "function init()\n\t{\n\t\t\n\t}", "function __construct()\r\n\t{\r\n\t\t\r\n\t}", "function init() {\n\t\t\n\t}", "final private function __construct() {}" ]
[ "0.6095811", "0.5965028", "0.59606653", "0.59233487", "0.59061694", "0.58884263", "0.58513623", "0.5765334", "0.57079315", "0.5624313", "0.5620513", "0.55972624", "0.5552196", "0.55036014", "0.5478748", "0.5466472", "0.54326504", "0.54324114", "0.5399189", "0.5388125", "0.53427094", "0.53400856", "0.5325253", "0.5313645", "0.53041756", "0.5281929", "0.528035", "0.527284", "0.52667075", "0.5258891", "0.525335", "0.5252482", "0.5247913", "0.52461505", "0.5245848", "0.52427864", "0.5240654", "0.52266407", "0.52235305", "0.5221588", "0.52144814", "0.5212611", "0.5211573", "0.5211573", "0.52102983", "0.5203113", "0.52025986", "0.52006704", "0.5200524", "0.5198722", "0.51932245", "0.51919675", "0.51919675", "0.51866114", "0.5181871", "0.5181558", "0.51686317", "0.5167218", "0.516619", "0.5165429", "0.51572025", "0.5156917", "0.5154368", "0.5154368", "0.51541203", "0.51541203", "0.51541203", "0.51541203", "0.51541203", "0.51533127", "0.5142203", "0.51416296", "0.5135514", "0.51301676", "0.51172477", "0.51120466", "0.5099508", "0.5099336", "0.5095817", "0.5078576", "0.5070065", "0.50686634", "0.5066765", "0.50658745", "0.5065651", "0.5063208", "0.50593436", "0.50545686", "0.50460505", "0.5040704", "0.5037885", "0.5036528", "0.50347954", "0.50345325", "0.5032171", "0.5032171", "0.5032171", "0.5030911", "0.5027154", "0.50245196", "0.5023957" ]
0.0
-1
Written Pham Vu Hoang Luyen
function convertHTML($strInput) //Convert to html special code { //$strInput = htmlspecialchars($strInput, ENT_QUOTES); $strInput = str_replace('"', '&quot;', $strInput); $strInput = str_replace("'", "&#039;", $strInput); return $strInput; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function helper()\n\t{\n\t\n\t}", "private function __() {\n }", "final function velcom(){\n }", "private function _i() {\n }", "public function boleta()\n\t{\n\t\t//\n\t}", "public function AggiornaPrezzi(){\n\t}", "public function nadar()\n {\n }", "public function serch()\n {\n }", "public function masodik()\n {\n }", "public function hapus_toko(){\n\t}", "private function j() {\n }", "public function ogs()\r\n {\r\n }", "public function ex4()\n {\n }", "final private function __construct(){\r\r\n\t}", "public function custom()\n\t{\n\t}", "private function __construct()\t{}", "public function elso()\n {\n }", "public function extra_voor_verp()\n\t{\n\t}", "public static function main(){\n\t\t\t\n\t\t}", "public function init() {\t\t\n\n }", "private function __construct() {\r\n\t\t\r\n\t}", "public function __construct()\n\t\t{\n\t\t\t\n\t\t}", "private function __construct() { \n\t\t\n\n\t}", "public function aaa() {\n\t}", "abstract public function getPasiekimai();", "function __construct()\n\t{\n\t\t\n\t\t\n\t}", "public function oops () {\n }", "public function main()\r\n {\r\n \r\n }", "function __construct()\r\n\t{\t\t//Yeah bro! Freaking PhP yo..\r\n\t}", "function __construct (){\n\t\t}", "private function __construct() {\r\n\t\r\n\t}", "private function __construct()\r\n\t{\r\n\t\r\n\t}", "public function _strings_for_pot()\n {\n }", "private function __construct( )\n {\n\t}", "public function init()\n { \t\n }", "private function __construct(){\n\t\t }", "public function __construct()\n\t\t{\t\t\t\n\t\t}", "public function init()\n\t\t{\n\t\n\t\t}", "public function init() {\n\t\t\n\t}", "public function __construct() {\n \t\t \t\n\t\t}", "private function __construct () \n\t{\n\t}", "public function main()\n\t{\n\t}", "public function init()\n {\t\t\t\n }", "public function init()\n {\t\t\t\n }", "function fix() ;", "function __construct() ;", "protected function init()\n\t{\n\t\t\n\t}", "public function andar()\n {\n }", "private function __construct()\r\r\n\t{\r\r\n\t}", "public function __construct()\n\t{\n\t\tparent::__construct();\n\t\t// ben duoi nay se la cac logic cua __construct lop con ma chung ta can dinh nghia - xu ly\n\t}", "private function __construct()\n\t{\n\t\t\n\t}", "private function __construct()\r\n {\r\n }", "private function __construct()\r\n {\r\n }", "public function truycapvao_private_cha(){\n }", "function custom_construction() {\r\n\t\r\n\t\r\n\t}", "function lcs()\n {\n }", "function init()\r\n \t{\r\n \t}", "protected function test9() {\n\n }", "public function leer(){\n }", "public function init(){\n\t\t\n\t}", "public function __init(){}", "function extract()\n {\n }", "public function leer(){\n }", "public function leer(){\n }", "public function __construct() {\n\t\t\n\t}", "public function __construct() {\n\t\t\n\t}", "public function __construct() {\n\t\t\n\t}", "public function __construct() {\n\t\t\n\t}", "public function __construct() {\n\t\t\n\t}", "public static function getCode()\n\t{\n\t\tthrow new NotImplementedException;\n\t}", "private function __construct() \n {\n\t\t\n }", "function _pre() {\n\n\t}", "private function __construct()\r\n\t{\r\n\t}", "public static function Parse837()\n\t{\n\n\t}", "function input_admin_head()\n\t{\n\t\t// Note: This function can be removed if not used\n\n\t\t\n\t\t\n\t}", "function _construct() {\n \t\n\t\t\n\t}", "public function init()\n {\n \treturn;\n }", "function __construct()\r\n\t\t{\r\n\t\t\t\r\n\t\t}", "public function veriCode() {}", "protected function _getNextCode() {}", "function __toString () {\n \n \n \n }", "public function init()\n\t{\n\n\t}", "private function method1()\n\t{\n\t}", "public function init(){\n\t\t\t\t}", "private function __construct(){\n \t\n }", "final private function __construct()\n\t{\n\t}", "public function init ()\r\n {\r\n }", "public static function declarations()\n {\n \n }", "private function __construct()\n\t{\n\n\t}", "protected function _init()\r\n\t{\r\n\t}", "public function obtener()\n {\n }", "public function __construct() {\r\n\t\t\r\n\t}", "protected function __init__() { }", "function verReg() {\n \n }", "final private function __construct() { }", "final private function __construct() { }", "final private function __construct() { }", "function init()\n\t{\n\t\t\n\t}", "function __construct()\r\n\t{\r\n\t\t\r\n\t}", "function init() {\n\t\t\n\t}", "final private function __construct() {}" ]
[ "0.6095811", "0.5965028", "0.59606653", "0.59233487", "0.59061694", "0.58884263", "0.58513623", "0.5765334", "0.57079315", "0.5624313", "0.5620513", "0.55972624", "0.5552196", "0.55036014", "0.5478748", "0.5466472", "0.54326504", "0.54324114", "0.5399189", "0.5388125", "0.53427094", "0.53400856", "0.5325253", "0.5313645", "0.53041756", "0.5281929", "0.528035", "0.527284", "0.52667075", "0.5258891", "0.525335", "0.5252482", "0.5247913", "0.52461505", "0.5245848", "0.52427864", "0.5240654", "0.52266407", "0.52235305", "0.5221588", "0.52144814", "0.5212611", "0.5211573", "0.5211573", "0.52102983", "0.5203113", "0.52025986", "0.52006704", "0.5200524", "0.5198722", "0.51932245", "0.51919675", "0.51919675", "0.51866114", "0.5181871", "0.5181558", "0.51686317", "0.5167218", "0.516619", "0.5165429", "0.51572025", "0.5156917", "0.5154368", "0.5154368", "0.51541203", "0.51541203", "0.51541203", "0.51541203", "0.51541203", "0.51533127", "0.5142203", "0.51416296", "0.5135514", "0.51301676", "0.51172477", "0.51120466", "0.5099508", "0.5099336", "0.5095817", "0.5078576", "0.5070065", "0.50686634", "0.5066765", "0.50658745", "0.5065651", "0.5063208", "0.50593436", "0.50545686", "0.50460505", "0.5040704", "0.5037885", "0.5036528", "0.50347954", "0.50345325", "0.5032171", "0.5032171", "0.5032171", "0.5030911", "0.5027154", "0.50245196", "0.5023957" ]
0.0
-1
Written Pham Vu Hoang Luyen
function unconvertHTML($strInput)//Convert html special code to standart form { //$strInput = html_entity_decode($strInput); $strInput = str_replace('&quot;', '"', $strInput); $strInput = str_replace("&#039;", "'", $strInput); return $strInput; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function helper()\n\t{\n\t\n\t}", "private function __() {\n }", "final function velcom(){\n }", "private function _i() {\n }", "public function boleta()\n\t{\n\t\t//\n\t}", "public function AggiornaPrezzi(){\n\t}", "public function nadar()\n {\n }", "public function serch()\n {\n }", "public function masodik()\n {\n }", "public function hapus_toko(){\n\t}", "private function j() {\n }", "public function ogs()\r\n {\r\n }", "public function ex4()\n {\n }", "final private function __construct(){\r\r\n\t}", "public function custom()\n\t{\n\t}", "private function __construct()\t{}", "public function elso()\n {\n }", "public function extra_voor_verp()\n\t{\n\t}", "public static function main(){\n\t\t\t\n\t\t}", "public function init() {\t\t\n\n }", "private function __construct() {\r\n\t\t\r\n\t}", "public function __construct()\n\t\t{\n\t\t\t\n\t\t}", "private function __construct() { \n\t\t\n\n\t}", "public function aaa() {\n\t}", "abstract public function getPasiekimai();", "function __construct()\n\t{\n\t\t\n\t\t\n\t}", "public function oops () {\n }", "public function main()\r\n {\r\n \r\n }", "function __construct()\r\n\t{\t\t//Yeah bro! Freaking PhP yo..\r\n\t}", "function __construct (){\n\t\t}", "private function __construct() {\r\n\t\r\n\t}", "private function __construct()\r\n\t{\r\n\t\r\n\t}", "public function _strings_for_pot()\n {\n }", "private function __construct( )\n {\n\t}", "public function init()\n { \t\n }", "private function __construct(){\n\t\t }", "public function __construct()\n\t\t{\t\t\t\n\t\t}", "public function init()\n\t\t{\n\t\n\t\t}", "public function init() {\n\t\t\n\t}", "public function __construct() {\n \t\t \t\n\t\t}", "private function __construct () \n\t{\n\t}", "public function main()\n\t{\n\t}", "public function init()\n {\t\t\t\n }", "public function init()\n {\t\t\t\n }", "function fix() ;", "function __construct() ;", "protected function init()\n\t{\n\t\t\n\t}", "public function andar()\n {\n }", "private function __construct()\r\r\n\t{\r\r\n\t}", "public function __construct()\n\t{\n\t\tparent::__construct();\n\t\t// ben duoi nay se la cac logic cua __construct lop con ma chung ta can dinh nghia - xu ly\n\t}", "private function __construct()\n\t{\n\t\t\n\t}", "private function __construct()\r\n {\r\n }", "private function __construct()\r\n {\r\n }", "public function truycapvao_private_cha(){\n }", "function custom_construction() {\r\n\t\r\n\t\r\n\t}", "function lcs()\n {\n }", "function init()\r\n \t{\r\n \t}", "protected function test9() {\n\n }", "public function leer(){\n }", "public function init(){\n\t\t\n\t}", "public function __init(){}", "function extract()\n {\n }", "public function leer(){\n }", "public function leer(){\n }", "public function __construct() {\n\t\t\n\t}", "public function __construct() {\n\t\t\n\t}", "public function __construct() {\n\t\t\n\t}", "public function __construct() {\n\t\t\n\t}", "public function __construct() {\n\t\t\n\t}", "public static function getCode()\n\t{\n\t\tthrow new NotImplementedException;\n\t}", "private function __construct() \n {\n\t\t\n }", "function _pre() {\n\n\t}", "private function __construct()\r\n\t{\r\n\t}", "public static function Parse837()\n\t{\n\n\t}", "function input_admin_head()\n\t{\n\t\t// Note: This function can be removed if not used\n\n\t\t\n\t\t\n\t}", "function _construct() {\n \t\n\t\t\n\t}", "public function init()\n {\n \treturn;\n }", "function __construct()\r\n\t\t{\r\n\t\t\t\r\n\t\t}", "public function veriCode() {}", "protected function _getNextCode() {}", "function __toString () {\n \n \n \n }", "public function init()\n\t{\n\n\t}", "private function method1()\n\t{\n\t}", "public function init(){\n\t\t\t\t}", "private function __construct(){\n \t\n }", "final private function __construct()\n\t{\n\t}", "public function init ()\r\n {\r\n }", "public static function declarations()\n {\n \n }", "private function __construct()\n\t{\n\n\t}", "protected function _init()\r\n\t{\r\n\t}", "public function obtener()\n {\n }", "public function __construct() {\r\n\t\t\r\n\t}", "protected function __init__() { }", "function verReg() {\n \n }", "final private function __construct() { }", "final private function __construct() { }", "final private function __construct() { }", "function init()\n\t{\n\t\t\n\t}", "function __construct()\r\n\t{\r\n\t\t\r\n\t}", "function init() {\n\t\t\n\t}", "final private function __construct() {}" ]
[ "0.6095811", "0.5965028", "0.59606653", "0.59233487", "0.59061694", "0.58884263", "0.58513623", "0.5765334", "0.57079315", "0.5624313", "0.5620513", "0.55972624", "0.5552196", "0.55036014", "0.5478748", "0.5466472", "0.54326504", "0.54324114", "0.5399189", "0.5388125", "0.53427094", "0.53400856", "0.5325253", "0.5313645", "0.53041756", "0.5281929", "0.528035", "0.527284", "0.52667075", "0.5258891", "0.525335", "0.5252482", "0.5247913", "0.52461505", "0.5245848", "0.52427864", "0.5240654", "0.52266407", "0.52235305", "0.5221588", "0.52144814", "0.5212611", "0.5211573", "0.5211573", "0.52102983", "0.5203113", "0.52025986", "0.52006704", "0.5200524", "0.5198722", "0.51932245", "0.51919675", "0.51919675", "0.51866114", "0.5181871", "0.5181558", "0.51686317", "0.5167218", "0.516619", "0.5165429", "0.51572025", "0.5156917", "0.5154368", "0.5154368", "0.51541203", "0.51541203", "0.51541203", "0.51541203", "0.51541203", "0.51533127", "0.5142203", "0.51416296", "0.5135514", "0.51301676", "0.51172477", "0.51120466", "0.5099508", "0.5099336", "0.5095817", "0.5078576", "0.5070065", "0.50686634", "0.5066765", "0.50658745", "0.5065651", "0.5063208", "0.50593436", "0.50545686", "0.50460505", "0.5040704", "0.5037885", "0.5036528", "0.50347954", "0.50345325", "0.5032171", "0.5032171", "0.5032171", "0.5030911", "0.5027154", "0.50245196", "0.5023957" ]
0.0
-1
Written Pham Vu Hoang Luyen
function insertData($strInput)//Use In inserting or updating data into database { $strInput = addslashes(unconvertHTML($strInput)); return $strInput; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function helper()\n\t{\n\t\n\t}", "private function __() {\n }", "final function velcom(){\n }", "private function _i() {\n }", "public function boleta()\n\t{\n\t\t//\n\t}", "public function AggiornaPrezzi(){\n\t}", "public function nadar()\n {\n }", "public function serch()\n {\n }", "public function masodik()\n {\n }", "public function hapus_toko(){\n\t}", "private function j() {\n }", "public function ogs()\r\n {\r\n }", "public function ex4()\n {\n }", "final private function __construct(){\r\r\n\t}", "public function custom()\n\t{\n\t}", "private function __construct()\t{}", "public function elso()\n {\n }", "public function extra_voor_verp()\n\t{\n\t}", "public static function main(){\n\t\t\t\n\t\t}", "public function init() {\t\t\n\n }", "private function __construct() {\r\n\t\t\r\n\t}", "public function __construct()\n\t\t{\n\t\t\t\n\t\t}", "private function __construct() { \n\t\t\n\n\t}", "public function aaa() {\n\t}", "abstract public function getPasiekimai();", "function __construct()\n\t{\n\t\t\n\t\t\n\t}", "public function oops () {\n }", "public function main()\r\n {\r\n \r\n }", "function __construct()\r\n\t{\t\t//Yeah bro! Freaking PhP yo..\r\n\t}", "function __construct (){\n\t\t}", "private function __construct() {\r\n\t\r\n\t}", "private function __construct()\r\n\t{\r\n\t\r\n\t}", "public function _strings_for_pot()\n {\n }", "private function __construct( )\n {\n\t}", "public function init()\n { \t\n }", "private function __construct(){\n\t\t }", "public function __construct()\n\t\t{\t\t\t\n\t\t}", "public function init()\n\t\t{\n\t\n\t\t}", "public function init() {\n\t\t\n\t}", "public function __construct() {\n \t\t \t\n\t\t}", "private function __construct () \n\t{\n\t}", "public function main()\n\t{\n\t}", "public function init()\n {\t\t\t\n }", "public function init()\n {\t\t\t\n }", "function fix() ;", "function __construct() ;", "protected function init()\n\t{\n\t\t\n\t}", "public function andar()\n {\n }", "private function __construct()\r\r\n\t{\r\r\n\t}", "public function __construct()\n\t{\n\t\tparent::__construct();\n\t\t// ben duoi nay se la cac logic cua __construct lop con ma chung ta can dinh nghia - xu ly\n\t}", "private function __construct()\n\t{\n\t\t\n\t}", "private function __construct()\r\n {\r\n }", "private function __construct()\r\n {\r\n }", "public function truycapvao_private_cha(){\n }", "function custom_construction() {\r\n\t\r\n\t\r\n\t}", "function lcs()\n {\n }", "function init()\r\n \t{\r\n \t}", "protected function test9() {\n\n }", "public function leer(){\n }", "public function init(){\n\t\t\n\t}", "public function __init(){}", "function extract()\n {\n }", "public function leer(){\n }", "public function leer(){\n }", "public function __construct() {\n\t\t\n\t}", "public function __construct() {\n\t\t\n\t}", "public function __construct() {\n\t\t\n\t}", "public function __construct() {\n\t\t\n\t}", "public function __construct() {\n\t\t\n\t}", "public static function getCode()\n\t{\n\t\tthrow new NotImplementedException;\n\t}", "private function __construct() \n {\n\t\t\n }", "function _pre() {\n\n\t}", "private function __construct()\r\n\t{\r\n\t}", "public static function Parse837()\n\t{\n\n\t}", "function input_admin_head()\n\t{\n\t\t// Note: This function can be removed if not used\n\n\t\t\n\t\t\n\t}", "function _construct() {\n \t\n\t\t\n\t}", "public function init()\n {\n \treturn;\n }", "function __construct()\r\n\t\t{\r\n\t\t\t\r\n\t\t}", "public function veriCode() {}", "protected function _getNextCode() {}", "function __toString () {\n \n \n \n }", "public function init()\n\t{\n\n\t}", "private function method1()\n\t{\n\t}", "public function init(){\n\t\t\t\t}", "private function __construct(){\n \t\n }", "final private function __construct()\n\t{\n\t}", "public function init ()\r\n {\r\n }", "public static function declarations()\n {\n \n }", "private function __construct()\n\t{\n\n\t}", "protected function _init()\r\n\t{\r\n\t}", "public function obtener()\n {\n }", "public function __construct() {\r\n\t\t\r\n\t}", "protected function __init__() { }", "function verReg() {\n \n }", "final private function __construct() { }", "final private function __construct() { }", "final private function __construct() { }", "function init()\n\t{\n\t\t\n\t}", "function __construct()\r\n\t{\r\n\t\t\r\n\t}", "function init() {\n\t\t\n\t}", "final private function __construct() {}" ]
[ "0.6095811", "0.5965028", "0.59606653", "0.59233487", "0.59061694", "0.58884263", "0.58513623", "0.5765334", "0.57079315", "0.5624313", "0.5620513", "0.55972624", "0.5552196", "0.55036014", "0.5478748", "0.5466472", "0.54326504", "0.54324114", "0.5399189", "0.5388125", "0.53427094", "0.53400856", "0.5325253", "0.5313645", "0.53041756", "0.5281929", "0.528035", "0.527284", "0.52667075", "0.5258891", "0.525335", "0.5252482", "0.5247913", "0.52461505", "0.5245848", "0.52427864", "0.5240654", "0.52266407", "0.52235305", "0.5221588", "0.52144814", "0.5212611", "0.5211573", "0.5211573", "0.52102983", "0.5203113", "0.52025986", "0.52006704", "0.5200524", "0.5198722", "0.51932245", "0.51919675", "0.51919675", "0.51866114", "0.5181871", "0.5181558", "0.51686317", "0.5167218", "0.516619", "0.5165429", "0.51572025", "0.5156917", "0.5154368", "0.5154368", "0.51541203", "0.51541203", "0.51541203", "0.51541203", "0.51541203", "0.51533127", "0.5142203", "0.51416296", "0.5135514", "0.51301676", "0.51172477", "0.51120466", "0.5099508", "0.5099336", "0.5095817", "0.5078576", "0.5070065", "0.50686634", "0.5066765", "0.50658745", "0.5065651", "0.5063208", "0.50593436", "0.50545686", "0.50460505", "0.5040704", "0.5037885", "0.5036528", "0.50347954", "0.50345325", "0.5032171", "0.5032171", "0.5032171", "0.5030911", "0.5027154", "0.50245196", "0.5023957" ]
0.0
-1
Written Pham Vu Hoang Luyen
function displayData_DB($strInput) { $strInput = stripslashes($strInput); return $strInput; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function helper()\n\t{\n\t\n\t}", "private function __() {\n }", "final function velcom(){\n }", "private function _i() {\n }", "public function boleta()\n\t{\n\t\t//\n\t}", "public function AggiornaPrezzi(){\n\t}", "public function nadar()\n {\n }", "public function serch()\n {\n }", "public function masodik()\n {\n }", "public function hapus_toko(){\n\t}", "private function j() {\n }", "public function ogs()\r\n {\r\n }", "public function ex4()\n {\n }", "final private function __construct(){\r\r\n\t}", "public function custom()\n\t{\n\t}", "private function __construct()\t{}", "public function elso()\n {\n }", "public function extra_voor_verp()\n\t{\n\t}", "public static function main(){\n\t\t\t\n\t\t}", "public function init() {\t\t\n\n }", "private function __construct() {\r\n\t\t\r\n\t}", "public function __construct()\n\t\t{\n\t\t\t\n\t\t}", "private function __construct() { \n\t\t\n\n\t}", "public function aaa() {\n\t}", "abstract public function getPasiekimai();", "function __construct()\n\t{\n\t\t\n\t\t\n\t}", "public function oops () {\n }", "public function main()\r\n {\r\n \r\n }", "function __construct()\r\n\t{\t\t//Yeah bro! Freaking PhP yo..\r\n\t}", "function __construct (){\n\t\t}", "private function __construct() {\r\n\t\r\n\t}", "private function __construct()\r\n\t{\r\n\t\r\n\t}", "public function _strings_for_pot()\n {\n }", "private function __construct( )\n {\n\t}", "public function init()\n { \t\n }", "private function __construct(){\n\t\t }", "public function __construct()\n\t\t{\t\t\t\n\t\t}", "public function init()\n\t\t{\n\t\n\t\t}", "public function init() {\n\t\t\n\t}", "public function __construct() {\n \t\t \t\n\t\t}", "private function __construct () \n\t{\n\t}", "public function main()\n\t{\n\t}", "public function init()\n {\t\t\t\n }", "public function init()\n {\t\t\t\n }", "function fix() ;", "function __construct() ;", "protected function init()\n\t{\n\t\t\n\t}", "public function andar()\n {\n }", "private function __construct()\r\r\n\t{\r\r\n\t}", "public function __construct()\n\t{\n\t\tparent::__construct();\n\t\t// ben duoi nay se la cac logic cua __construct lop con ma chung ta can dinh nghia - xu ly\n\t}", "private function __construct()\n\t{\n\t\t\n\t}", "private function __construct()\r\n {\r\n }", "private function __construct()\r\n {\r\n }", "public function truycapvao_private_cha(){\n }", "function custom_construction() {\r\n\t\r\n\t\r\n\t}", "function lcs()\n {\n }", "function init()\r\n \t{\r\n \t}", "protected function test9() {\n\n }", "public function leer(){\n }", "public function init(){\n\t\t\n\t}", "public function __init(){}", "function extract()\n {\n }", "public function leer(){\n }", "public function leer(){\n }", "public function __construct() {\n\t\t\n\t}", "public function __construct() {\n\t\t\n\t}", "public function __construct() {\n\t\t\n\t}", "public function __construct() {\n\t\t\n\t}", "public function __construct() {\n\t\t\n\t}", "public static function getCode()\n\t{\n\t\tthrow new NotImplementedException;\n\t}", "private function __construct() \n {\n\t\t\n }", "function _pre() {\n\n\t}", "private function __construct()\r\n\t{\r\n\t}", "public static function Parse837()\n\t{\n\n\t}", "function input_admin_head()\n\t{\n\t\t// Note: This function can be removed if not used\n\n\t\t\n\t\t\n\t}", "function _construct() {\n \t\n\t\t\n\t}", "public function init()\n {\n \treturn;\n }", "function __construct()\r\n\t\t{\r\n\t\t\t\r\n\t\t}", "public function veriCode() {}", "protected function _getNextCode() {}", "function __toString () {\n \n \n \n }", "public function init()\n\t{\n\n\t}", "private function method1()\n\t{\n\t}", "public function init(){\n\t\t\t\t}", "private function __construct(){\n \t\n }", "final private function __construct()\n\t{\n\t}", "public function init ()\r\n {\r\n }", "public static function declarations()\n {\n \n }", "private function __construct()\n\t{\n\n\t}", "protected function _init()\r\n\t{\r\n\t}", "public function obtener()\n {\n }", "public function __construct() {\r\n\t\t\r\n\t}", "protected function __init__() { }", "function verReg() {\n \n }", "final private function __construct() { }", "final private function __construct() { }", "final private function __construct() { }", "function init()\n\t{\n\t\t\n\t}", "function __construct()\r\n\t{\r\n\t\t\r\n\t}", "function init() {\n\t\t\n\t}", "final private function __construct() {}" ]
[ "0.6095811", "0.5965028", "0.59606653", "0.59233487", "0.59061694", "0.58884263", "0.58513623", "0.5765334", "0.57079315", "0.5624313", "0.5620513", "0.55972624", "0.5552196", "0.55036014", "0.5478748", "0.5466472", "0.54326504", "0.54324114", "0.5399189", "0.5388125", "0.53427094", "0.53400856", "0.5325253", "0.5313645", "0.53041756", "0.5281929", "0.528035", "0.527284", "0.52667075", "0.5258891", "0.525335", "0.5252482", "0.5247913", "0.52461505", "0.5245848", "0.52427864", "0.5240654", "0.52266407", "0.52235305", "0.5221588", "0.52144814", "0.5212611", "0.5211573", "0.5211573", "0.52102983", "0.5203113", "0.52025986", "0.52006704", "0.5200524", "0.5198722", "0.51932245", "0.51919675", "0.51919675", "0.51866114", "0.5181871", "0.5181558", "0.51686317", "0.5167218", "0.516619", "0.5165429", "0.51572025", "0.5156917", "0.5154368", "0.5154368", "0.51541203", "0.51541203", "0.51541203", "0.51541203", "0.51541203", "0.51533127", "0.5142203", "0.51416296", "0.5135514", "0.51301676", "0.51172477", "0.51120466", "0.5099508", "0.5099336", "0.5095817", "0.5078576", "0.5070065", "0.50686634", "0.5066765", "0.50658745", "0.5065651", "0.5063208", "0.50593436", "0.50545686", "0.50460505", "0.5040704", "0.5037885", "0.5036528", "0.50347954", "0.50345325", "0.5032171", "0.5032171", "0.5032171", "0.5030911", "0.5027154", "0.50245196", "0.5023957" ]
0.0
-1
Written Pham Vu Hoang Luyen
function displayData_Textbox($strInput) { $strInput = convertHTML(stripslashes($strInput)); return $strInput; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function helper()\n\t{\n\t\n\t}", "private function __() {\n }", "final function velcom(){\n }", "private function _i() {\n }", "public function boleta()\n\t{\n\t\t//\n\t}", "public function AggiornaPrezzi(){\n\t}", "public function nadar()\n {\n }", "public function serch()\n {\n }", "public function masodik()\n {\n }", "public function hapus_toko(){\n\t}", "private function j() {\n }", "public function ogs()\r\n {\r\n }", "public function ex4()\n {\n }", "final private function __construct(){\r\r\n\t}", "public function custom()\n\t{\n\t}", "private function __construct()\t{}", "public function elso()\n {\n }", "public function extra_voor_verp()\n\t{\n\t}", "public static function main(){\n\t\t\t\n\t\t}", "public function init() {\t\t\n\n }", "private function __construct() {\r\n\t\t\r\n\t}", "public function __construct()\n\t\t{\n\t\t\t\n\t\t}", "private function __construct() { \n\t\t\n\n\t}", "public function aaa() {\n\t}", "abstract public function getPasiekimai();", "function __construct()\n\t{\n\t\t\n\t\t\n\t}", "public function oops () {\n }", "public function main()\r\n {\r\n \r\n }", "function __construct()\r\n\t{\t\t//Yeah bro! Freaking PhP yo..\r\n\t}", "function __construct (){\n\t\t}", "private function __construct() {\r\n\t\r\n\t}", "private function __construct()\r\n\t{\r\n\t\r\n\t}", "public function _strings_for_pot()\n {\n }", "private function __construct( )\n {\n\t}", "public function init()\n { \t\n }", "private function __construct(){\n\t\t }", "public function __construct()\n\t\t{\t\t\t\n\t\t}", "public function init()\n\t\t{\n\t\n\t\t}", "public function init() {\n\t\t\n\t}", "public function __construct() {\n \t\t \t\n\t\t}", "private function __construct () \n\t{\n\t}", "public function main()\n\t{\n\t}", "public function init()\n {\t\t\t\n }", "public function init()\n {\t\t\t\n }", "function fix() ;", "function __construct() ;", "protected function init()\n\t{\n\t\t\n\t}", "public function andar()\n {\n }", "private function __construct()\r\r\n\t{\r\r\n\t}", "public function __construct()\n\t{\n\t\tparent::__construct();\n\t\t// ben duoi nay se la cac logic cua __construct lop con ma chung ta can dinh nghia - xu ly\n\t}", "private function __construct()\n\t{\n\t\t\n\t}", "private function __construct()\r\n {\r\n }", "private function __construct()\r\n {\r\n }", "public function truycapvao_private_cha(){\n }", "function custom_construction() {\r\n\t\r\n\t\r\n\t}", "function lcs()\n {\n }", "function init()\r\n \t{\r\n \t}", "protected function test9() {\n\n }", "public function leer(){\n }", "public function init(){\n\t\t\n\t}", "public function __init(){}", "function extract()\n {\n }", "public function leer(){\n }", "public function leer(){\n }", "public function __construct() {\n\t\t\n\t}", "public function __construct() {\n\t\t\n\t}", "public function __construct() {\n\t\t\n\t}", "public function __construct() {\n\t\t\n\t}", "public function __construct() {\n\t\t\n\t}", "public static function getCode()\n\t{\n\t\tthrow new NotImplementedException;\n\t}", "private function __construct() \n {\n\t\t\n }", "function _pre() {\n\n\t}", "private function __construct()\r\n\t{\r\n\t}", "public static function Parse837()\n\t{\n\n\t}", "function input_admin_head()\n\t{\n\t\t// Note: This function can be removed if not used\n\n\t\t\n\t\t\n\t}", "function _construct() {\n \t\n\t\t\n\t}", "public function init()\n {\n \treturn;\n }", "function __construct()\r\n\t\t{\r\n\t\t\t\r\n\t\t}", "public function veriCode() {}", "protected function _getNextCode() {}", "function __toString () {\n \n \n \n }", "public function init()\n\t{\n\n\t}", "private function method1()\n\t{\n\t}", "public function init(){\n\t\t\t\t}", "private function __construct(){\n \t\n }", "final private function __construct()\n\t{\n\t}", "public function init ()\r\n {\r\n }", "public static function declarations()\n {\n \n }", "private function __construct()\n\t{\n\n\t}", "protected function _init()\r\n\t{\r\n\t}", "public function obtener()\n {\n }", "public function __construct() {\r\n\t\t\r\n\t}", "protected function __init__() { }", "function verReg() {\n \n }", "final private function __construct() { }", "final private function __construct() { }", "final private function __construct() { }", "function init()\n\t{\n\t\t\n\t}", "function __construct()\r\n\t{\r\n\t\t\r\n\t}", "function init() {\n\t\t\n\t}", "final private function __construct() {}" ]
[ "0.6095811", "0.5965028", "0.59606653", "0.59233487", "0.59061694", "0.58884263", "0.58513623", "0.5765334", "0.57079315", "0.5624313", "0.5620513", "0.55972624", "0.5552196", "0.55036014", "0.5478748", "0.5466472", "0.54326504", "0.54324114", "0.5399189", "0.5388125", "0.53427094", "0.53400856", "0.5325253", "0.5313645", "0.53041756", "0.5281929", "0.528035", "0.527284", "0.52667075", "0.5258891", "0.525335", "0.5252482", "0.5247913", "0.52461505", "0.5245848", "0.52427864", "0.5240654", "0.52266407", "0.52235305", "0.5221588", "0.52144814", "0.5212611", "0.5211573", "0.5211573", "0.52102983", "0.5203113", "0.52025986", "0.52006704", "0.5200524", "0.5198722", "0.51932245", "0.51919675", "0.51919675", "0.51866114", "0.5181871", "0.5181558", "0.51686317", "0.5167218", "0.516619", "0.5165429", "0.51572025", "0.5156917", "0.5154368", "0.5154368", "0.51541203", "0.51541203", "0.51541203", "0.51541203", "0.51541203", "0.51533127", "0.5142203", "0.51416296", "0.5135514", "0.51301676", "0.51172477", "0.51120466", "0.5099508", "0.5099336", "0.5095817", "0.5078576", "0.5070065", "0.50686634", "0.5066765", "0.50658745", "0.5065651", "0.5063208", "0.50593436", "0.50545686", "0.50460505", "0.5040704", "0.5037885", "0.5036528", "0.50347954", "0.50345325", "0.5032171", "0.5032171", "0.5032171", "0.5030911", "0.5027154", "0.50245196", "0.5023957" ]
0.0
-1
Written Pham Vu Hoang Luyen
function convertcharstoupper($str) { return mb_convert_case($str, MB_CASE_UPPER, "UTF-8"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function helper()\n\t{\n\t\n\t}", "private function __() {\n }", "final function velcom(){\n }", "private function _i() {\n }", "public function boleta()\n\t{\n\t\t//\n\t}", "public function AggiornaPrezzi(){\n\t}", "public function nadar()\n {\n }", "public function serch()\n {\n }", "public function masodik()\n {\n }", "public function hapus_toko(){\n\t}", "private function j() {\n }", "public function ogs()\r\n {\r\n }", "public function ex4()\n {\n }", "final private function __construct(){\r\r\n\t}", "public function custom()\n\t{\n\t}", "private function __construct()\t{}", "public function elso()\n {\n }", "public function extra_voor_verp()\n\t{\n\t}", "public static function main(){\n\t\t\t\n\t\t}", "public function init() {\t\t\n\n }", "private function __construct() {\r\n\t\t\r\n\t}", "public function __construct()\n\t\t{\n\t\t\t\n\t\t}", "private function __construct() { \n\t\t\n\n\t}", "public function aaa() {\n\t}", "abstract public function getPasiekimai();", "function __construct()\n\t{\n\t\t\n\t\t\n\t}", "public function oops () {\n }", "public function main()\r\n {\r\n \r\n }", "function __construct()\r\n\t{\t\t//Yeah bro! Freaking PhP yo..\r\n\t}", "function __construct (){\n\t\t}", "private function __construct() {\r\n\t\r\n\t}", "private function __construct()\r\n\t{\r\n\t\r\n\t}", "public function _strings_for_pot()\n {\n }", "private function __construct( )\n {\n\t}", "public function init()\n { \t\n }", "private function __construct(){\n\t\t }", "public function __construct()\n\t\t{\t\t\t\n\t\t}", "public function init()\n\t\t{\n\t\n\t\t}", "public function init() {\n\t\t\n\t}", "public function __construct() {\n \t\t \t\n\t\t}", "private function __construct () \n\t{\n\t}", "public function main()\n\t{\n\t}", "public function init()\n {\t\t\t\n }", "public function init()\n {\t\t\t\n }", "function fix() ;", "function __construct() ;", "protected function init()\n\t{\n\t\t\n\t}", "public function andar()\n {\n }", "private function __construct()\r\r\n\t{\r\r\n\t}", "public function __construct()\n\t{\n\t\tparent::__construct();\n\t\t// ben duoi nay se la cac logic cua __construct lop con ma chung ta can dinh nghia - xu ly\n\t}", "private function __construct()\n\t{\n\t\t\n\t}", "private function __construct()\r\n {\r\n }", "private function __construct()\r\n {\r\n }", "public function truycapvao_private_cha(){\n }", "function custom_construction() {\r\n\t\r\n\t\r\n\t}", "function lcs()\n {\n }", "function init()\r\n \t{\r\n \t}", "protected function test9() {\n\n }", "public function leer(){\n }", "public function init(){\n\t\t\n\t}", "public function __init(){}", "function extract()\n {\n }", "public function leer(){\n }", "public function leer(){\n }", "public function __construct() {\n\t\t\n\t}", "public function __construct() {\n\t\t\n\t}", "public function __construct() {\n\t\t\n\t}", "public function __construct() {\n\t\t\n\t}", "public function __construct() {\n\t\t\n\t}", "public static function getCode()\n\t{\n\t\tthrow new NotImplementedException;\n\t}", "private function __construct() \n {\n\t\t\n }", "function _pre() {\n\n\t}", "private function __construct()\r\n\t{\r\n\t}", "public static function Parse837()\n\t{\n\n\t}", "function input_admin_head()\n\t{\n\t\t// Note: This function can be removed if not used\n\n\t\t\n\t\t\n\t}", "function _construct() {\n \t\n\t\t\n\t}", "public function init()\n {\n \treturn;\n }", "function __construct()\r\n\t\t{\r\n\t\t\t\r\n\t\t}", "public function veriCode() {}", "protected function _getNextCode() {}", "function __toString () {\n \n \n \n }", "public function init()\n\t{\n\n\t}", "private function method1()\n\t{\n\t}", "public function init(){\n\t\t\t\t}", "private function __construct(){\n \t\n }", "final private function __construct()\n\t{\n\t}", "public function init ()\r\n {\r\n }", "public static function declarations()\n {\n \n }", "private function __construct()\n\t{\n\n\t}", "protected function _init()\r\n\t{\r\n\t}", "public function obtener()\n {\n }", "public function __construct() {\r\n\t\t\r\n\t}", "protected function __init__() { }", "function verReg() {\n \n }", "final private function __construct() { }", "final private function __construct() { }", "final private function __construct() { }", "function init()\n\t{\n\t\t\n\t}", "function __construct()\r\n\t{\r\n\t\t\r\n\t}", "function init() {\n\t\t\n\t}", "final private function __construct() {}" ]
[ "0.6095811", "0.5965028", "0.59606653", "0.59233487", "0.59061694", "0.58884263", "0.58513623", "0.5765334", "0.57079315", "0.5624313", "0.5620513", "0.55972624", "0.5552196", "0.55036014", "0.5478748", "0.5466472", "0.54326504", "0.54324114", "0.5399189", "0.5388125", "0.53427094", "0.53400856", "0.5325253", "0.5313645", "0.53041756", "0.5281929", "0.528035", "0.527284", "0.52667075", "0.5258891", "0.525335", "0.5252482", "0.5247913", "0.52461505", "0.5245848", "0.52427864", "0.5240654", "0.52266407", "0.52235305", "0.5221588", "0.52144814", "0.5212611", "0.5211573", "0.5211573", "0.52102983", "0.5203113", "0.52025986", "0.52006704", "0.5200524", "0.5198722", "0.51932245", "0.51919675", "0.51919675", "0.51866114", "0.5181871", "0.5181558", "0.51686317", "0.5167218", "0.516619", "0.5165429", "0.51572025", "0.5156917", "0.5154368", "0.5154368", "0.51541203", "0.51541203", "0.51541203", "0.51541203", "0.51541203", "0.51533127", "0.5142203", "0.51416296", "0.5135514", "0.51301676", "0.51172477", "0.51120466", "0.5099508", "0.5099336", "0.5095817", "0.5078576", "0.5070065", "0.50686634", "0.5066765", "0.50658745", "0.5065651", "0.5063208", "0.50593436", "0.50545686", "0.50460505", "0.5040704", "0.5037885", "0.5036528", "0.50347954", "0.50345325", "0.5032171", "0.5032171", "0.5032171", "0.5030911", "0.5027154", "0.50245196", "0.5023957" ]
0.0
-1
Written Pham Vu Hoang Luyen
function displayData_DB_Content($strInput) { $strInput = stripslashes($strInput); // $strInput = str_replace(chr(10), '<br>', $strInput); return $strInput; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function helper()\n\t{\n\t\n\t}", "private function __() {\n }", "final function velcom(){\n }", "private function _i() {\n }", "public function boleta()\n\t{\n\t\t//\n\t}", "public function AggiornaPrezzi(){\n\t}", "public function nadar()\n {\n }", "public function serch()\n {\n }", "public function masodik()\n {\n }", "public function hapus_toko(){\n\t}", "private function j() {\n }", "public function ogs()\r\n {\r\n }", "public function ex4()\n {\n }", "final private function __construct(){\r\r\n\t}", "public function custom()\n\t{\n\t}", "private function __construct()\t{}", "public function elso()\n {\n }", "public function extra_voor_verp()\n\t{\n\t}", "public static function main(){\n\t\t\t\n\t\t}", "public function init() {\t\t\n\n }", "private function __construct() {\r\n\t\t\r\n\t}", "public function __construct()\n\t\t{\n\t\t\t\n\t\t}", "private function __construct() { \n\t\t\n\n\t}", "public function aaa() {\n\t}", "abstract public function getPasiekimai();", "function __construct()\n\t{\n\t\t\n\t\t\n\t}", "public function oops () {\n }", "public function main()\r\n {\r\n \r\n }", "function __construct()\r\n\t{\t\t//Yeah bro! Freaking PhP yo..\r\n\t}", "function __construct (){\n\t\t}", "private function __construct() {\r\n\t\r\n\t}", "private function __construct()\r\n\t{\r\n\t\r\n\t}", "public function _strings_for_pot()\n {\n }", "private function __construct( )\n {\n\t}", "public function init()\n { \t\n }", "private function __construct(){\n\t\t }", "public function __construct()\n\t\t{\t\t\t\n\t\t}", "public function init()\n\t\t{\n\t\n\t\t}", "public function init() {\n\t\t\n\t}", "public function __construct() {\n \t\t \t\n\t\t}", "private function __construct () \n\t{\n\t}", "public function main()\n\t{\n\t}", "public function init()\n {\t\t\t\n }", "public function init()\n {\t\t\t\n }", "function fix() ;", "function __construct() ;", "protected function init()\n\t{\n\t\t\n\t}", "public function andar()\n {\n }", "private function __construct()\r\r\n\t{\r\r\n\t}", "public function __construct()\n\t{\n\t\tparent::__construct();\n\t\t// ben duoi nay se la cac logic cua __construct lop con ma chung ta can dinh nghia - xu ly\n\t}", "private function __construct()\n\t{\n\t\t\n\t}", "private function __construct()\r\n {\r\n }", "private function __construct()\r\n {\r\n }", "public function truycapvao_private_cha(){\n }", "function custom_construction() {\r\n\t\r\n\t\r\n\t}", "function lcs()\n {\n }", "function init()\r\n \t{\r\n \t}", "protected function test9() {\n\n }", "public function leer(){\n }", "public function init(){\n\t\t\n\t}", "public function __init(){}", "function extract()\n {\n }", "public function leer(){\n }", "public function leer(){\n }", "public function __construct() {\n\t\t\n\t}", "public function __construct() {\n\t\t\n\t}", "public function __construct() {\n\t\t\n\t}", "public function __construct() {\n\t\t\n\t}", "public function __construct() {\n\t\t\n\t}", "public static function getCode()\n\t{\n\t\tthrow new NotImplementedException;\n\t}", "private function __construct() \n {\n\t\t\n }", "function _pre() {\n\n\t}", "private function __construct()\r\n\t{\r\n\t}", "public static function Parse837()\n\t{\n\n\t}", "function input_admin_head()\n\t{\n\t\t// Note: This function can be removed if not used\n\n\t\t\n\t\t\n\t}", "function _construct() {\n \t\n\t\t\n\t}", "public function init()\n {\n \treturn;\n }", "function __construct()\r\n\t\t{\r\n\t\t\t\r\n\t\t}", "public function veriCode() {}", "protected function _getNextCode() {}", "function __toString () {\n \n \n \n }", "public function init()\n\t{\n\n\t}", "private function method1()\n\t{\n\t}", "public function init(){\n\t\t\t\t}", "private function __construct(){\n \t\n }", "final private function __construct()\n\t{\n\t}", "public function init ()\r\n {\r\n }", "public static function declarations()\n {\n \n }", "private function __construct()\n\t{\n\n\t}", "protected function _init()\r\n\t{\r\n\t}", "public function obtener()\n {\n }", "public function __construct() {\r\n\t\t\r\n\t}", "protected function __init__() { }", "function verReg() {\n \n }", "final private function __construct() { }", "final private function __construct() { }", "final private function __construct() { }", "function init()\n\t{\n\t\t\n\t}", "function __construct()\r\n\t{\r\n\t\t\r\n\t}", "function init() {\n\t\t\n\t}", "final private function __construct() {}" ]
[ "0.6095811", "0.5965028", "0.59606653", "0.59233487", "0.59061694", "0.58884263", "0.58513623", "0.5765334", "0.57079315", "0.5624313", "0.5620513", "0.55972624", "0.5552196", "0.55036014", "0.5478748", "0.5466472", "0.54326504", "0.54324114", "0.5399189", "0.5388125", "0.53427094", "0.53400856", "0.5325253", "0.5313645", "0.53041756", "0.5281929", "0.528035", "0.527284", "0.52667075", "0.5258891", "0.525335", "0.5252482", "0.5247913", "0.52461505", "0.5245848", "0.52427864", "0.5240654", "0.52266407", "0.52235305", "0.5221588", "0.52144814", "0.5212611", "0.5211573", "0.5211573", "0.52102983", "0.5203113", "0.52025986", "0.52006704", "0.5200524", "0.5198722", "0.51932245", "0.51919675", "0.51919675", "0.51866114", "0.5181871", "0.5181558", "0.51686317", "0.5167218", "0.516619", "0.5165429", "0.51572025", "0.5156917", "0.5154368", "0.5154368", "0.51541203", "0.51541203", "0.51541203", "0.51541203", "0.51541203", "0.51533127", "0.5142203", "0.51416296", "0.5135514", "0.51301676", "0.51172477", "0.51120466", "0.5099508", "0.5099336", "0.5095817", "0.5078576", "0.5070065", "0.50686634", "0.5066765", "0.50658745", "0.5065651", "0.5063208", "0.50593436", "0.50545686", "0.50460505", "0.5040704", "0.5037885", "0.5036528", "0.50347954", "0.50345325", "0.5032171", "0.5032171", "0.5032171", "0.5030911", "0.5027154", "0.50245196", "0.5023957" ]
0.0
-1
Written Pham Vu Hoang Luyen
function check_exits_field($code,$field, $table, &$db, $id = 0) { if($id<>0) $cond = " AND id <> '".$id."'"; else $cond = ""; $sql_check = "SELECT count(*) FROM ".$table." WHERE `".$field."` = '".$code."'".$cond; $sql_check = $db->sql_query($sql_check) or die(mysql_error()); $exits = $db->sql_fetchfield(0); if($exits)return true; else return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function helper()\n\t{\n\t\n\t}", "private function __() {\n }", "final function velcom(){\n }", "private function _i() {\n }", "public function boleta()\n\t{\n\t\t//\n\t}", "public function AggiornaPrezzi(){\n\t}", "public function nadar()\n {\n }", "public function serch()\n {\n }", "public function masodik()\n {\n }", "public function hapus_toko(){\n\t}", "private function j() {\n }", "public function ogs()\r\n {\r\n }", "public function ex4()\n {\n }", "final private function __construct(){\r\r\n\t}", "public function custom()\n\t{\n\t}", "private function __construct()\t{}", "public function elso()\n {\n }", "public function extra_voor_verp()\n\t{\n\t}", "public static function main(){\n\t\t\t\n\t\t}", "public function init() {\t\t\n\n }", "private function __construct() {\r\n\t\t\r\n\t}", "public function __construct()\n\t\t{\n\t\t\t\n\t\t}", "private function __construct() { \n\t\t\n\n\t}", "public function aaa() {\n\t}", "abstract public function getPasiekimai();", "function __construct()\n\t{\n\t\t\n\t\t\n\t}", "public function oops () {\n }", "public function main()\r\n {\r\n \r\n }", "function __construct()\r\n\t{\t\t//Yeah bro! Freaking PhP yo..\r\n\t}", "function __construct (){\n\t\t}", "private function __construct() {\r\n\t\r\n\t}", "private function __construct()\r\n\t{\r\n\t\r\n\t}", "public function _strings_for_pot()\n {\n }", "private function __construct( )\n {\n\t}", "public function init()\n { \t\n }", "private function __construct(){\n\t\t }", "public function __construct()\n\t\t{\t\t\t\n\t\t}", "public function init()\n\t\t{\n\t\n\t\t}", "public function init() {\n\t\t\n\t}", "public function __construct() {\n \t\t \t\n\t\t}", "private function __construct () \n\t{\n\t}", "public function main()\n\t{\n\t}", "public function init()\n {\t\t\t\n }", "public function init()\n {\t\t\t\n }", "function fix() ;", "function __construct() ;", "protected function init()\n\t{\n\t\t\n\t}", "public function andar()\n {\n }", "private function __construct()\r\r\n\t{\r\r\n\t}", "public function __construct()\n\t{\n\t\tparent::__construct();\n\t\t// ben duoi nay se la cac logic cua __construct lop con ma chung ta can dinh nghia - xu ly\n\t}", "private function __construct()\n\t{\n\t\t\n\t}", "private function __construct()\r\n {\r\n }", "private function __construct()\r\n {\r\n }", "public function truycapvao_private_cha(){\n }", "function custom_construction() {\r\n\t\r\n\t\r\n\t}", "function lcs()\n {\n }", "function init()\r\n \t{\r\n \t}", "protected function test9() {\n\n }", "public function leer(){\n }", "public function init(){\n\t\t\n\t}", "public function __init(){}", "function extract()\n {\n }", "public function leer(){\n }", "public function leer(){\n }", "public function __construct() {\n\t\t\n\t}", "public function __construct() {\n\t\t\n\t}", "public function __construct() {\n\t\t\n\t}", "public function __construct() {\n\t\t\n\t}", "public function __construct() {\n\t\t\n\t}", "public static function getCode()\n\t{\n\t\tthrow new NotImplementedException;\n\t}", "private function __construct() \n {\n\t\t\n }", "function _pre() {\n\n\t}", "private function __construct()\r\n\t{\r\n\t}", "public static function Parse837()\n\t{\n\n\t}", "function input_admin_head()\n\t{\n\t\t// Note: This function can be removed if not used\n\n\t\t\n\t\t\n\t}", "function _construct() {\n \t\n\t\t\n\t}", "public function init()\n {\n \treturn;\n }", "function __construct()\r\n\t\t{\r\n\t\t\t\r\n\t\t}", "public function veriCode() {}", "protected function _getNextCode() {}", "function __toString () {\n \n \n \n }", "public function init()\n\t{\n\n\t}", "private function method1()\n\t{\n\t}", "public function init(){\n\t\t\t\t}", "private function __construct(){\n \t\n }", "final private function __construct()\n\t{\n\t}", "public function init ()\r\n {\r\n }", "public static function declarations()\n {\n \n }", "private function __construct()\n\t{\n\n\t}", "protected function _init()\r\n\t{\r\n\t}", "public function obtener()\n {\n }", "public function __construct() {\r\n\t\t\r\n\t}", "protected function __init__() { }", "function verReg() {\n \n }", "final private function __construct() { }", "final private function __construct() { }", "final private function __construct() { }", "function init()\n\t{\n\t\t\n\t}", "function __construct()\r\n\t{\r\n\t\t\r\n\t}", "function init() {\n\t\t\n\t}", "final private function __construct() {}" ]
[ "0.6095811", "0.5965028", "0.59606653", "0.59233487", "0.59061694", "0.58884263", "0.58513623", "0.5765334", "0.57079315", "0.5624313", "0.5620513", "0.55972624", "0.5552196", "0.55036014", "0.5478748", "0.5466472", "0.54326504", "0.54324114", "0.5399189", "0.5388125", "0.53427094", "0.53400856", "0.5325253", "0.5313645", "0.53041756", "0.5281929", "0.528035", "0.527284", "0.52667075", "0.5258891", "0.525335", "0.5252482", "0.5247913", "0.52461505", "0.5245848", "0.52427864", "0.5240654", "0.52266407", "0.52235305", "0.5221588", "0.52144814", "0.5212611", "0.5211573", "0.5211573", "0.52102983", "0.5203113", "0.52025986", "0.52006704", "0.5200524", "0.5198722", "0.51932245", "0.51919675", "0.51919675", "0.51866114", "0.5181871", "0.5181558", "0.51686317", "0.5167218", "0.516619", "0.5165429", "0.51572025", "0.5156917", "0.5154368", "0.5154368", "0.51541203", "0.51541203", "0.51541203", "0.51541203", "0.51541203", "0.51533127", "0.5142203", "0.51416296", "0.5135514", "0.51301676", "0.51172477", "0.51120466", "0.5099508", "0.5099336", "0.5095817", "0.5078576", "0.5070065", "0.50686634", "0.5066765", "0.50658745", "0.5065651", "0.5063208", "0.50593436", "0.50545686", "0.50460505", "0.5040704", "0.5037885", "0.5036528", "0.50347954", "0.50345325", "0.5032171", "0.5032171", "0.5032171", "0.5030911", "0.5027154", "0.50245196", "0.5023957" ]
0.0
-1
Written Pham Vu Hoang Luyen
function check_exits_idField($code,$field, $table, &$db) { $sql_check = "SELECT * FROM ".$table." WHERE `".$field."` = '".$code."'"; $sql_check = $db->sql_query($sql_check) or die(mysql_error()); $exits = $db->sql_fetchfield(0); if($exits)return true; else return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function helper()\n\t{\n\t\n\t}", "private function __() {\n }", "final function velcom(){\n }", "private function _i() {\n }", "public function boleta()\n\t{\n\t\t//\n\t}", "public function AggiornaPrezzi(){\n\t}", "public function nadar()\n {\n }", "public function serch()\n {\n }", "public function masodik()\n {\n }", "public function hapus_toko(){\n\t}", "private function j() {\n }", "public function ogs()\r\n {\r\n }", "public function ex4()\n {\n }", "final private function __construct(){\r\r\n\t}", "public function custom()\n\t{\n\t}", "private function __construct()\t{}", "public function elso()\n {\n }", "public function extra_voor_verp()\n\t{\n\t}", "public static function main(){\n\t\t\t\n\t\t}", "public function init() {\t\t\n\n }", "private function __construct() {\r\n\t\t\r\n\t}", "public function __construct()\n\t\t{\n\t\t\t\n\t\t}", "private function __construct() { \n\t\t\n\n\t}", "public function aaa() {\n\t}", "abstract public function getPasiekimai();", "function __construct()\n\t{\n\t\t\n\t\t\n\t}", "public function oops () {\n }", "public function main()\r\n {\r\n \r\n }", "function __construct()\r\n\t{\t\t//Yeah bro! Freaking PhP yo..\r\n\t}", "function __construct (){\n\t\t}", "private function __construct() {\r\n\t\r\n\t}", "private function __construct()\r\n\t{\r\n\t\r\n\t}", "public function _strings_for_pot()\n {\n }", "private function __construct( )\n {\n\t}", "public function init()\n { \t\n }", "private function __construct(){\n\t\t }", "public function __construct()\n\t\t{\t\t\t\n\t\t}", "public function init()\n\t\t{\n\t\n\t\t}", "public function init() {\n\t\t\n\t}", "public function __construct() {\n \t\t \t\n\t\t}", "private function __construct () \n\t{\n\t}", "public function main()\n\t{\n\t}", "public function init()\n {\t\t\t\n }", "public function init()\n {\t\t\t\n }", "function fix() ;", "function __construct() ;", "protected function init()\n\t{\n\t\t\n\t}", "public function andar()\n {\n }", "private function __construct()\r\r\n\t{\r\r\n\t}", "public function __construct()\n\t{\n\t\tparent::__construct();\n\t\t// ben duoi nay se la cac logic cua __construct lop con ma chung ta can dinh nghia - xu ly\n\t}", "private function __construct()\n\t{\n\t\t\n\t}", "private function __construct()\r\n {\r\n }", "private function __construct()\r\n {\r\n }", "public function truycapvao_private_cha(){\n }", "function custom_construction() {\r\n\t\r\n\t\r\n\t}", "function lcs()\n {\n }", "function init()\r\n \t{\r\n \t}", "protected function test9() {\n\n }", "public function leer(){\n }", "public function init(){\n\t\t\n\t}", "public function __init(){}", "function extract()\n {\n }", "public function leer(){\n }", "public function leer(){\n }", "public function __construct() {\n\t\t\n\t}", "public function __construct() {\n\t\t\n\t}", "public function __construct() {\n\t\t\n\t}", "public function __construct() {\n\t\t\n\t}", "public function __construct() {\n\t\t\n\t}", "public static function getCode()\n\t{\n\t\tthrow new NotImplementedException;\n\t}", "private function __construct() \n {\n\t\t\n }", "function _pre() {\n\n\t}", "private function __construct()\r\n\t{\r\n\t}", "public static function Parse837()\n\t{\n\n\t}", "function input_admin_head()\n\t{\n\t\t// Note: This function can be removed if not used\n\n\t\t\n\t\t\n\t}", "function _construct() {\n \t\n\t\t\n\t}", "public function init()\n {\n \treturn;\n }", "function __construct()\r\n\t\t{\r\n\t\t\t\r\n\t\t}", "public function veriCode() {}", "protected function _getNextCode() {}", "function __toString () {\n \n \n \n }", "public function init()\n\t{\n\n\t}", "private function method1()\n\t{\n\t}", "public function init(){\n\t\t\t\t}", "private function __construct(){\n \t\n }", "final private function __construct()\n\t{\n\t}", "public function init ()\r\n {\r\n }", "public static function declarations()\n {\n \n }", "private function __construct()\n\t{\n\n\t}", "protected function _init()\r\n\t{\r\n\t}", "public function obtener()\n {\n }", "public function __construct() {\r\n\t\t\r\n\t}", "protected function __init__() { }", "function verReg() {\n \n }", "final private function __construct() { }", "final private function __construct() { }", "final private function __construct() { }", "function init()\n\t{\n\t\t\n\t}", "function __construct()\r\n\t{\r\n\t\t\r\n\t}", "function init() {\n\t\t\n\t}", "final private function __construct() {}" ]
[ "0.6095811", "0.5965028", "0.59606653", "0.59233487", "0.59061694", "0.58884263", "0.58513623", "0.5765334", "0.57079315", "0.5624313", "0.5620513", "0.55972624", "0.5552196", "0.55036014", "0.5478748", "0.5466472", "0.54326504", "0.54324114", "0.5399189", "0.5388125", "0.53427094", "0.53400856", "0.5325253", "0.5313645", "0.53041756", "0.5281929", "0.528035", "0.527284", "0.52667075", "0.5258891", "0.525335", "0.5252482", "0.5247913", "0.52461505", "0.5245848", "0.52427864", "0.5240654", "0.52266407", "0.52235305", "0.5221588", "0.52144814", "0.5212611", "0.5211573", "0.5211573", "0.52102983", "0.5203113", "0.52025986", "0.52006704", "0.5200524", "0.5198722", "0.51932245", "0.51919675", "0.51919675", "0.51866114", "0.5181871", "0.5181558", "0.51686317", "0.5167218", "0.516619", "0.5165429", "0.51572025", "0.5156917", "0.5154368", "0.5154368", "0.51541203", "0.51541203", "0.51541203", "0.51541203", "0.51541203", "0.51533127", "0.5142203", "0.51416296", "0.5135514", "0.51301676", "0.51172477", "0.51120466", "0.5099508", "0.5099336", "0.5095817", "0.5078576", "0.5070065", "0.50686634", "0.5066765", "0.50658745", "0.5065651", "0.5063208", "0.50593436", "0.50545686", "0.50460505", "0.5040704", "0.5037885", "0.5036528", "0.50347954", "0.50345325", "0.5032171", "0.5032171", "0.5032171", "0.5030911", "0.5027154", "0.50245196", "0.5023957" ]
0.0
-1
Written Pham Vu Hoang Luyen
function Max_pre_order($max_field, $code,$field, $table, &$db,$type='') { $otherSQL=($type=='')?'':' and type='.$type; $sql_check = "SELECT max(".$max_field.") as TT FROM ".$table." WHERE `".$field."` = '".$code."'".$otherSQL; $sql_check = $db->sql_query($sql_check) or die(mysql_error()); $exits = $db->sql_fetchfield(0); return ($exits+1); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function helper()\n\t{\n\t\n\t}", "private function __() {\n }", "final function velcom(){\n }", "private function _i() {\n }", "public function boleta()\n\t{\n\t\t//\n\t}", "public function AggiornaPrezzi(){\n\t}", "public function nadar()\n {\n }", "public function serch()\n {\n }", "public function masodik()\n {\n }", "public function hapus_toko(){\n\t}", "private function j() {\n }", "public function ogs()\r\n {\r\n }", "public function ex4()\n {\n }", "final private function __construct(){\r\r\n\t}", "public function custom()\n\t{\n\t}", "private function __construct()\t{}", "public function elso()\n {\n }", "public function extra_voor_verp()\n\t{\n\t}", "public static function main(){\n\t\t\t\n\t\t}", "public function init() {\t\t\n\n }", "private function __construct() {\r\n\t\t\r\n\t}", "public function __construct()\n\t\t{\n\t\t\t\n\t\t}", "private function __construct() { \n\t\t\n\n\t}", "public function aaa() {\n\t}", "abstract public function getPasiekimai();", "function __construct()\n\t{\n\t\t\n\t\t\n\t}", "public function oops () {\n }", "public function main()\r\n {\r\n \r\n }", "function __construct()\r\n\t{\t\t//Yeah bro! Freaking PhP yo..\r\n\t}", "function __construct (){\n\t\t}", "private function __construct() {\r\n\t\r\n\t}", "private function __construct()\r\n\t{\r\n\t\r\n\t}", "public function _strings_for_pot()\n {\n }", "private function __construct( )\n {\n\t}", "public function init()\n { \t\n }", "private function __construct(){\n\t\t }", "public function __construct()\n\t\t{\t\t\t\n\t\t}", "public function init()\n\t\t{\n\t\n\t\t}", "public function init() {\n\t\t\n\t}", "public function __construct() {\n \t\t \t\n\t\t}", "private function __construct () \n\t{\n\t}", "public function main()\n\t{\n\t}", "public function init()\n {\t\t\t\n }", "public function init()\n {\t\t\t\n }", "function fix() ;", "function __construct() ;", "protected function init()\n\t{\n\t\t\n\t}", "public function andar()\n {\n }", "private function __construct()\r\r\n\t{\r\r\n\t}", "public function __construct()\n\t{\n\t\tparent::__construct();\n\t\t// ben duoi nay se la cac logic cua __construct lop con ma chung ta can dinh nghia - xu ly\n\t}", "private function __construct()\n\t{\n\t\t\n\t}", "private function __construct()\r\n {\r\n }", "private function __construct()\r\n {\r\n }", "public function truycapvao_private_cha(){\n }", "function custom_construction() {\r\n\t\r\n\t\r\n\t}", "function lcs()\n {\n }", "function init()\r\n \t{\r\n \t}", "protected function test9() {\n\n }", "public function leer(){\n }", "public function init(){\n\t\t\n\t}", "public function __init(){}", "function extract()\n {\n }", "public function leer(){\n }", "public function leer(){\n }", "public function __construct() {\n\t\t\n\t}", "public function __construct() {\n\t\t\n\t}", "public function __construct() {\n\t\t\n\t}", "public function __construct() {\n\t\t\n\t}", "public function __construct() {\n\t\t\n\t}", "public static function getCode()\n\t{\n\t\tthrow new NotImplementedException;\n\t}", "private function __construct() \n {\n\t\t\n }", "function _pre() {\n\n\t}", "private function __construct()\r\n\t{\r\n\t}", "public static function Parse837()\n\t{\n\n\t}", "function input_admin_head()\n\t{\n\t\t// Note: This function can be removed if not used\n\n\t\t\n\t\t\n\t}", "function _construct() {\n \t\n\t\t\n\t}", "public function init()\n {\n \treturn;\n }", "function __construct()\r\n\t\t{\r\n\t\t\t\r\n\t\t}", "public function veriCode() {}", "protected function _getNextCode() {}", "function __toString () {\n \n \n \n }", "public function init()\n\t{\n\n\t}", "private function method1()\n\t{\n\t}", "public function init(){\n\t\t\t\t}", "private function __construct(){\n \t\n }", "final private function __construct()\n\t{\n\t}", "public function init ()\r\n {\r\n }", "public static function declarations()\n {\n \n }", "private function __construct()\n\t{\n\n\t}", "protected function _init()\r\n\t{\r\n\t}", "public function obtener()\n {\n }", "public function __construct() {\r\n\t\t\r\n\t}", "protected function __init__() { }", "function verReg() {\n \n }", "final private function __construct() { }", "final private function __construct() { }", "final private function __construct() { }", "function init()\n\t{\n\t\t\n\t}", "function __construct()\r\n\t{\r\n\t\t\r\n\t}", "function init() {\n\t\t\n\t}", "final private function __construct() {}" ]
[ "0.6095811", "0.5965028", "0.59606653", "0.59233487", "0.59061694", "0.58884263", "0.58513623", "0.5765334", "0.57079315", "0.5624313", "0.5620513", "0.55972624", "0.5552196", "0.55036014", "0.5478748", "0.5466472", "0.54326504", "0.54324114", "0.5399189", "0.5388125", "0.53427094", "0.53400856", "0.5325253", "0.5313645", "0.53041756", "0.5281929", "0.528035", "0.527284", "0.52667075", "0.5258891", "0.525335", "0.5252482", "0.5247913", "0.52461505", "0.5245848", "0.52427864", "0.5240654", "0.52266407", "0.52235305", "0.5221588", "0.52144814", "0.5212611", "0.5211573", "0.5211573", "0.52102983", "0.5203113", "0.52025986", "0.52006704", "0.5200524", "0.5198722", "0.51932245", "0.51919675", "0.51919675", "0.51866114", "0.5181871", "0.5181558", "0.51686317", "0.5167218", "0.516619", "0.5165429", "0.51572025", "0.5156917", "0.5154368", "0.5154368", "0.51541203", "0.51541203", "0.51541203", "0.51541203", "0.51541203", "0.51533127", "0.5142203", "0.51416296", "0.5135514", "0.51301676", "0.51172477", "0.51120466", "0.5099508", "0.5099336", "0.5095817", "0.5078576", "0.5070065", "0.50686634", "0.5066765", "0.50658745", "0.5065651", "0.5063208", "0.50593436", "0.50545686", "0.50460505", "0.5040704", "0.5037885", "0.5036528", "0.50347954", "0.50345325", "0.5032171", "0.5032171", "0.5032171", "0.5030911", "0.5027154", "0.50245196", "0.5023957" ]
0.0
-1
Quan ly nguoi su dung
function private_unset() { unset($_SESSION['search_adv']); unset($_SESSION['adver_type']); unset($_SESSION['catinfolist']); unset($_SESSION['url_of_list_pro']); unset($_SESSION['catprojectlist']); unset($_SESSION['search_name']); unset($_SESSION['search_code']); unset($_SESSION['search_type']); unset($_SESSION['txtInfo_Search']); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function chuiNiu()\n{\n\techo '谁喜欢吹牛,爱谁谁<br>';\n}", "public function getCompatibleLanguageQuaderno() {\n $country = $this->getCountry();\n $spanishSpeaking = pais::getCountriesSpanishSpeaking();\n if (array_key_exists($country->getUID(), $spanishSpeaking)) {\n return 'ES';\n } else {\n switch ($country->getUID()) {\n case pais::PORTUGAL_CODE:\n return 'PT';\n break;\n case pais::FRANCE_CODE:\n return 'FR';\n break;\n default:\n return 'EN';\n }\n }\n\n return 'EN';\n }", "public function inYiddish() : string\n {\n return $this->getTranslationIn('yi');\n }", "function text_arabic($sura,$aya,$text){\n\t\t$table_per_kata\t= get_table(\"SELECT * FROM terjemah_kata WHERE sura='$sura' \n\t\t\t\t\t\t\t\t\tAND aya='$aya'\");\n\t\t// inisialisasi\n\t\t$arr_terjemah = array();\n\t\tforeach($table_per_kata as $j => $row_per_kata){\n\t\t\t$m = $j+1;\n\t\t\t$arr_terjemah[$m] \t\t= $row_per_kata[indonesia]; \n\t\t\t$arr_arab_harokat[$m] \t= $row_per_kata[arab_harokat]; \n\t\t}\n\t\t\n\t\t// explode aya text into word\n\t\t$arr_kata_arab\t= explode(\" \",$text);\n\t\t\n\t\t//menampilkan tiap kata beserta terjemahnya\n\t\t/*echo \"\n\t\t<pre>\n\t\t$sura:$aya \";*/\n\t\t\n\t\t$m = 1;\n\t\tforeach($arr_kata_arab as $k => $kata_arab){\n\t\t\t$event_aya_word =\"\";\n\t\t\t//menampilkan terjemahan per kata\n\t\t\t//echo \"$kata_arab {$arr_arab[$m]}<br>\";\n\t\t\tif($kata_arab==$arr_arab_harokat[$m] ){\n\t\t\t\t$output .= \"\n\t\t\t\t<span id='terjemah_{$sura}_{$aya}_{$m}' \n\t\t\t\t\tstyle='visibility:hidden;position:absolute;width:0px;height:0px;' >\n\t\t\t\t\t{$arr_terjemah[$m]}\n\t\t\t\t</span>\n\t\t\t\t\";\n\t\t\t\t$event_aya_word =\"\n\t\t\t\tonmousemove='move_terjemah($sura,$aya,$m,event)' \n\t\t\t\tonmouseout='hide_terjemah($sura,$aya,$m)'\n\t\t\t\t\";\n\t\t\t\t\n\t\t\t\t$id_kata = \"kata_{$sura}_{$aya}_{$m}\";\n\t\t\t\t$m++;\n\t\t\t}\n\t\t\t//menampilkan kata arab\n\t\t\t$output .= \"\n\t\t\t<span \n\t\t\t\tid='$id_kata'\n\t\t\t\tclass='aya_word'\n\t\t\t\t$event_aya_word >\n\t\t\t\t\".repair_ar($kata_arab).\"\n\t\t\t</span>\n\t\t\t\";\n\t\t}\n\t\treturn $output;\n\t}", "public function dep_trai(){\n\t\treturn $dep_trai = \"đẹp trai\";\n\t}", "function hapusawalan1($kata){\n if(substr($kata,0,4)==\"meng\"){\n if(substr($kata,4,1)==\"e\"||substr($kata,4,1)==\"u\"){\n $kata = \"k\".substr($kata,4);\n }else{\n $kata = substr($kata,4);\n }\n }else if(substr($kata,0,4)==\"meny\"){\n $kata = \"ny\".substr($kata,4);\n }else if(substr($kata,0,3)==\"men\"){\n $kata = substr($kata,3);\n }else if(substr($kata,0,3)==\"mem\"){\n if(substr($kata,3,1)==\"a\" || substr($kata,3,1)==\"i\" || substr($kata,3,1)==\"e\" || substr($kata,3,1)==\"u\" || substr($kata,3,1)==\"o\"){\n $kata = \"p\".substr($kata,3);\n }else{\n $kata = substr($kata,3);\n }\n }else if(substr($kata,0,2)==\"me\"){\n $kata = substr($kata,2);\n }else if(substr($kata,0,4)==\"peng\"){\n if(substr($kata,4,1)==\"e\" || substr($kata,4,1)==\"a\"){\n $kata = \"k\".substr($kata,4);\n }else{\n $kata = substr($kata,4);\n }\n }else if(substr($kata,0,4)==\"peny\"){\n $kata = \"s\".substr($kata,4);\n }else if(substr($kata,0,3)==\"pen\"){\n if(substr($kata,3,1)==\"a\" || substr($kata,3,1)==\"i\" || substr($kata,3,1)==\"e\" || substr($kata,3,1)==\"u\" || substr($kata,3,1)==\"o\"){\n $kata = \"t\".substr($kata,3);\n }else{\n $kata = substr($kata,3);\n }\n }else if(substr($kata,0,3)==\"pem\"){\n if(substr($kata,3,1)==\"a\" || substr($kata,3,1)==\"i\" || substr($kata,3,1)==\"e\" || substr($kata,3,1)==\"u\" || substr($kata,3,1)==\"o\"){\n $kata = \"p\".substr($kata,3);\n }else{\n $kata = substr($kata,3);\n }\n }else if(substr($kata,0,2)==\"di\"){\n $kata = substr($kata,2);\n }else if(substr($kata,0,5)==\"keter\"){\n $kata = substr($kata,5);\n }else if(substr($kata,0,3)==\"ter\"){\n $kata = substr($kata,3);\n }else if(substr($kata,0,2)==\"ke\"){\n $kata = substr($kata,2);\n }\n return $kata;\n }", "function difundir() {\n\n // La funcion obtener_frase esta heredado del pariente Orador\n $frase = $this->obtener_frase();\n\n // Convirtir a mayusculos\n $frase_mayusculas = strtoupper($frase);\n\n echo $frase_mayusculas;\n\n }", "public function bersuara()\n {\n return \"DARAWET ANJING DAWET\";\n }", "public function inSomali()\n {\n return $this->getTranslationIn('so');\n }", "static public function words() : array {\n return [\n \"абажур\",\n \"абзац\",\n \"абонент\",\n \"абрикос\",\n \"абсурд\",\n \"авангард\",\n \"август\",\n \"авиация\",\n \"авоська\",\n \"автор\",\n \"агат\",\n \"агент\",\n \"агитатор\",\n \"агнец\",\n \"агония\",\n \"агрегат\",\n \"адвокат\",\n \"адмирал\",\n \"адрес\",\n \"ажиотаж\",\n \"азарт\",\n \"азбука\",\n \"азот\",\n \"аист\",\n \"айсберг\",\n \"академия\",\n \"аквариум\",\n \"аккорд\",\n \"акробат\",\n \"аксиома\",\n \"актер\",\n \"акула\",\n \"акция\",\n \"алгоритм\",\n \"алебарда\",\n \"аллея\",\n \"алмаз\",\n \"алтарь\",\n \"алфавит\",\n \"алхимик\",\n \"алый\",\n \"альбом\",\n \"алюминий\",\n \"амбар\",\n \"аметист\",\n \"амнезия\",\n \"ампула\",\n \"амфора\",\n \"анализ\",\n \"ангел\",\n \"анекдот\",\n \"анимация\",\n \"анкета\",\n \"аномалия\",\n \"ансамбль\",\n \"антенна\",\n \"апатия\",\n \"апельсин\",\n \"апофеоз\",\n \"аппарат\",\n \"апрель\",\n \"аптека\",\n \"арабский\",\n \"арбуз\",\n \"аргумент\",\n \"арест\",\n \"ария\",\n \"арка\",\n \"армия\",\n \"аромат\",\n \"арсенал\",\n \"артист\",\n \"архив\",\n \"аршин\",\n \"асбест\",\n \"аскетизм\",\n \"аспект\",\n \"ассорти\",\n \"астроном\",\n \"асфальт\",\n \"атака\",\n \"ателье\",\n \"атлас\",\n \"атом\",\n \"атрибут\",\n \"аудитор\",\n \"аукцион\",\n \"аура\",\n \"афера\",\n \"афиша\",\n \"ахинея\",\n \"ацетон\",\n \"аэропорт\",\n \"бабушка\",\n \"багаж\",\n \"бадья\",\n \"база\",\n \"баклажан\",\n \"балкон\",\n \"бампер\",\n \"банк\",\n \"барон\",\n \"бассейн\",\n \"батарея\",\n \"бахрома\",\n \"башня\",\n \"баян\",\n \"бегство\",\n \"бедро\",\n \"бездна\",\n \"бекон\",\n \"белый\",\n \"бензин\",\n \"берег\",\n \"беседа\",\n \"бетонный\",\n \"биатлон\",\n \"библия\",\n \"бивень\",\n \"бигуди\",\n \"бидон\",\n \"бизнес\",\n \"бикини\",\n \"билет\",\n \"бинокль\",\n \"биология\",\n \"биржа\",\n \"бисер\",\n \"битва\",\n \"бицепс\",\n \"благо\",\n \"бледный\",\n \"близкий\",\n \"блок\",\n \"блуждать\",\n \"блюдо\",\n \"бляха\",\n \"бобер\",\n \"богатый\",\n \"бодрый\",\n \"боевой\",\n \"бокал\",\n \"большой\",\n \"борьба\",\n \"босой\",\n \"ботинок\",\n \"боцман\",\n \"бочка\",\n \"боярин\",\n \"брать\",\n \"бревно\",\n \"бригада\",\n \"бросать\",\n \"брызги\",\n \"брюки\",\n \"бублик\",\n \"бугор\",\n \"будущее\",\n \"буква\",\n \"бульвар\",\n \"бумага\",\n \"бунт\",\n \"бурный\",\n \"бусы\",\n \"бутылка\",\n \"буфет\",\n \"бухта\",\n \"бушлат\",\n \"бывалый\",\n \"быль\",\n \"быстрый\",\n \"быть\",\n \"бюджет\",\n \"бюро\",\n \"бюст\",\n \"вагон\",\n \"важный\",\n \"ваза\",\n \"вакцина\",\n \"валюта\",\n \"вампир\",\n \"ванная\",\n \"вариант\",\n \"вассал\",\n \"вата\",\n \"вафля\",\n \"вахта\",\n \"вдова\",\n \"вдыхать\",\n \"ведущий\",\n \"веер\",\n \"вежливый\",\n \"везти\",\n \"веко\",\n \"великий\",\n \"вена\",\n \"верить\",\n \"веселый\",\n \"ветер\",\n \"вечер\",\n \"вешать\",\n \"вещь\",\n \"веяние\",\n \"взаимный\",\n \"взбучка\",\n \"взвод\",\n \"взгляд\",\n \"вздыхать\",\n \"взлетать\",\n \"взмах\",\n \"взнос\",\n \"взор\",\n \"взрыв\",\n \"взывать\",\n \"взятка\",\n \"вибрация\",\n \"визит\",\n \"вилка\",\n \"вино\",\n \"вирус\",\n \"висеть\",\n \"витрина\",\n \"вихрь\",\n \"вишневый\",\n \"включать\",\n \"вкус\",\n \"власть\",\n \"влечь\",\n \"влияние\",\n \"влюблять\",\n \"внешний\",\n \"внимание\",\n \"внук\",\n \"внятный\",\n \"вода\",\n \"воевать\",\n \"вождь\",\n \"воздух\",\n \"войти\",\n \"вокзал\",\n \"волос\",\n \"вопрос\",\n \"ворота\",\n \"восток\",\n \"впадать\",\n \"впускать\",\n \"врач\",\n \"время\",\n \"вручать\",\n \"всадник\",\n \"всеобщий\",\n \"вспышка\",\n \"встреча\",\n \"вторник\",\n \"вулкан\",\n \"вурдалак\",\n \"входить\",\n \"въезд\",\n \"выбор\",\n \"вывод\",\n \"выгодный\",\n \"выделять\",\n \"выезжать\",\n \"выживать\",\n \"вызывать\",\n \"выигрыш\",\n \"вылезать\",\n \"выносить\",\n \"выпивать\",\n \"высокий\",\n \"выходить\",\n \"вычет\",\n \"вышка\",\n \"выяснять\",\n \"вязать\",\n \"вялый\",\n \"гавань\",\n \"гадать\",\n \"газета\",\n \"гаишник\",\n \"галстук\",\n \"гамма\",\n \"гарантия\",\n \"гастроли\",\n \"гвардия\",\n \"гвоздь\",\n \"гектар\",\n \"гель\",\n \"генерал\",\n \"геолог\",\n \"герой\",\n \"гешефт\",\n \"гибель\",\n \"гигант\",\n \"гильза\",\n \"гимн\",\n \"гипотеза\",\n \"гитара\",\n \"глаз\",\n \"глина\",\n \"глоток\",\n \"глубокий\",\n \"глыба\",\n \"глядеть\",\n \"гнать\",\n \"гнев\",\n \"гнить\",\n \"гном\",\n \"гнуть\",\n \"говорить\",\n \"годовой\",\n \"голова\",\n \"гонка\",\n \"город\",\n \"гость\",\n \"готовый\",\n \"граница\",\n \"грех\",\n \"гриб\",\n \"громкий\",\n \"группа\",\n \"грызть\",\n \"грязный\",\n \"губа\",\n \"гудеть\",\n \"гулять\",\n \"гуманный\",\n \"густой\",\n \"гуща\",\n \"давать\",\n \"далекий\",\n \"дама\",\n \"данные\",\n \"дарить\",\n \"дать\",\n \"дача\",\n \"дверь\",\n \"движение\",\n \"двор\",\n \"дебют\",\n \"девушка\",\n \"дедушка\",\n \"дежурный\",\n \"дезертир\",\n \"действие\",\n \"декабрь\",\n \"дело\",\n \"демократ\",\n \"день\",\n \"депутат\",\n \"держать\",\n \"десяток\",\n \"детский\",\n \"дефицит\",\n \"дешевый\",\n \"деятель\",\n \"джаз\",\n \"джинсы\",\n \"джунгли\",\n \"диалог\",\n \"диван\",\n \"диета\",\n \"дизайн\",\n \"дикий\",\n \"динамика\",\n \"диплом\",\n \"директор\",\n \"диск\",\n \"дитя\",\n \"дичь\",\n \"длинный\",\n \"дневник\",\n \"добрый\",\n \"доверие\",\n \"договор\",\n \"дождь\",\n \"доза\",\n \"документ\",\n \"должен\",\n \"домашний\",\n \"допрос\",\n \"дорога\",\n \"доход\",\n \"доцент\",\n \"дочь\",\n \"дощатый\",\n \"драка\",\n \"древний\",\n \"дрожать\",\n \"друг\",\n \"дрянь\",\n \"дубовый\",\n \"дуга\",\n \"дудка\",\n \"дукат\",\n \"дуло\",\n \"думать\",\n \"дупло\",\n \"дурак\",\n \"дуть\",\n \"духи\",\n \"душа\",\n \"дуэт\",\n \"дымить\",\n \"дыня\",\n \"дыра\",\n \"дыханье\",\n \"дышать\",\n \"дьявол\",\n \"дюжина\",\n \"дюйм\",\n \"дюна\",\n \"дядя\",\n \"дятел\",\n \"егерь\",\n \"единый\",\n \"едкий\",\n \"ежевика\",\n \"ежик\",\n \"езда\",\n \"елка\",\n \"емкость\",\n \"ерунда\",\n \"ехать\",\n \"жадный\",\n \"жажда\",\n \"жалеть\",\n \"жанр\",\n \"жара\",\n \"жать\",\n \"жгучий\",\n \"ждать\",\n \"жевать\",\n \"желание\",\n \"жемчуг\",\n \"женщина\",\n \"жертва\",\n \"жесткий\",\n \"жечь\",\n \"живой\",\n \"жидкость\",\n \"жизнь\",\n \"жилье\",\n \"жирный\",\n \"житель\",\n \"журнал\",\n \"жюри\",\n \"забывать\",\n \"завод\",\n \"загадка\",\n \"задача\",\n \"зажечь\",\n \"зайти\",\n \"закон\",\n \"замечать\",\n \"занимать\",\n \"западный\",\n \"зарплата\",\n \"засыпать\",\n \"затрата\",\n \"захват\",\n \"зацепка\",\n \"зачет\",\n \"защита\",\n \"заявка\",\n \"звать\",\n \"звезда\",\n \"звонить\",\n \"звук\",\n \"здание\",\n \"здешний\",\n \"здоровье\",\n \"зебра\",\n \"зевать\",\n \"зеленый\",\n \"земля\",\n \"зенит\",\n \"зеркало\",\n \"зефир\",\n \"зигзаг\",\n \"зима\",\n \"зиять\",\n \"злак\",\n \"злой\",\n \"змея\",\n \"знать\",\n \"зной\",\n \"зодчий\",\n \"золотой\",\n \"зомби\",\n \"зона\",\n \"зоопарк\",\n \"зоркий\",\n \"зрачок\",\n \"зрение\",\n \"зритель\",\n \"зубной\",\n \"зыбкий\",\n \"зять\",\n \"игла\",\n \"иголка\",\n \"играть\",\n \"идея\",\n \"идиот\",\n \"идол\",\n \"идти\",\n \"иерархия\",\n \"избрать\",\n \"известие\",\n \"изгонять\",\n \"издание\",\n \"излагать\",\n \"изменять\",\n \"износ\",\n \"изоляция\",\n \"изрядный\",\n \"изучать\",\n \"изымать\",\n \"изящный\",\n \"икона\",\n \"икра\",\n \"иллюзия\",\n \"имбирь\",\n \"иметь\",\n \"имидж\",\n \"иммунный\",\n \"империя\",\n \"инвестор\",\n \"индивид\",\n \"инерция\",\n \"инженер\",\n \"иномарка\",\n \"институт\",\n \"интерес\",\n \"инфекция\",\n \"инцидент\",\n \"ипподром\",\n \"ирис\",\n \"ирония\",\n \"искать\",\n \"история\",\n \"исходить\",\n \"исчезать\",\n \"итог\",\n \"июль\",\n \"июнь\",\n \"кабинет\",\n \"кавалер\",\n \"кадр\",\n \"казарма\",\n \"кайф\",\n \"кактус\",\n \"калитка\",\n \"камень\",\n \"канал\",\n \"капитан\",\n \"картина\",\n \"касса\",\n \"катер\",\n \"кафе\",\n \"качество\",\n \"каша\",\n \"каюта\",\n \"квартира\",\n \"квинтет\",\n \"квота\",\n \"кедр\",\n \"кекс\",\n \"кенгуру\",\n \"кепка\",\n \"керосин\",\n \"кетчуп\",\n \"кефир\",\n \"кибитка\",\n \"кивнуть\",\n \"кидать\",\n \"километр\",\n \"кино\",\n \"киоск\",\n \"кипеть\",\n \"кирпич\",\n \"кисть\",\n \"китаец\",\n \"класс\",\n \"клетка\",\n \"клиент\",\n \"клоун\",\n \"клуб\",\n \"клык\",\n \"ключ\",\n \"клятва\",\n \"книга\",\n \"кнопка\",\n \"кнут\",\n \"князь\",\n \"кобура\",\n \"ковер\",\n \"коготь\",\n \"кодекс\",\n \"кожа\",\n \"козел\",\n \"койка\",\n \"коктейль\",\n \"колено\",\n \"компания\",\n \"конец\",\n \"копейка\",\n \"короткий\",\n \"костюм\",\n \"котел\",\n \"кофе\",\n \"кошка\",\n \"красный\",\n \"кресло\",\n \"кричать\",\n \"кровь\",\n \"крупный\",\n \"крыша\",\n \"крючок\",\n \"кубок\",\n \"кувшин\",\n \"кудрявый\",\n \"кузов\",\n \"кукла\",\n \"культура\",\n \"кумир\",\n \"купить\",\n \"курс\",\n \"кусок\",\n \"кухня\",\n \"куча\",\n \"кушать\",\n \"кювет\",\n \"лабиринт\",\n \"лавка\",\n \"лагерь\",\n \"ладонь\",\n \"лазерный\",\n \"лайнер\",\n \"лакей\",\n \"лампа\",\n \"ландшафт\",\n \"лапа\",\n \"ларек\",\n \"ласковый\",\n \"лауреат\",\n \"лачуга\",\n \"лаять\",\n \"лгать\",\n \"лебедь\",\n \"левый\",\n \"легкий\",\n \"ледяной\",\n \"лежать\",\n \"лекция\",\n \"лента\",\n \"лепесток\",\n \"лесной\",\n \"лето\",\n \"лечь\",\n \"леший\",\n \"лживый\",\n \"либерал\",\n \"ливень\",\n \"лига\",\n \"лидер\",\n \"ликовать\",\n \"лиловый\",\n \"лимон\",\n \"линия\",\n \"липа\",\n \"лирика\",\n \"лист\",\n \"литр\",\n \"лифт\",\n \"лихой\",\n \"лицо\",\n \"личный\",\n \"лишний\",\n \"лобовой\",\n \"ловить\",\n \"логика\",\n \"лодка\",\n \"ложка\",\n \"лозунг\",\n \"локоть\",\n \"ломать\",\n \"лоно\",\n \"лопата\",\n \"лорд\",\n \"лось\",\n \"лоток\",\n \"лохматый\",\n \"лошадь\",\n \"лужа\",\n \"лукавый\",\n \"луна\",\n \"лупить\",\n \"лучший\",\n \"лыжный\",\n \"лысый\",\n \"львиный\",\n \"льгота\",\n \"льдина\",\n \"любить\",\n \"людской\",\n \"люстра\",\n \"лютый\",\n \"лягушка\",\n \"магазин\",\n \"мадам\",\n \"мазать\",\n \"майор\",\n \"максимум\",\n \"мальчик\",\n \"манера\",\n \"март\",\n \"масса\",\n \"мать\",\n \"мафия\",\n \"махать\",\n \"мачта\",\n \"машина\",\n \"маэстро\",\n \"маяк\",\n \"мгла\",\n \"мебель\",\n \"медведь\",\n \"мелкий\",\n \"мемуары\",\n \"менять\",\n \"мера\",\n \"место\",\n \"метод\",\n \"механизм\",\n \"мечтать\",\n \"мешать\",\n \"миграция\",\n \"мизинец\",\n \"микрофон\",\n \"миллион\",\n \"минута\",\n \"мировой\",\n \"миссия\",\n \"митинг\",\n \"мишень\",\n \"младший\",\n \"мнение\",\n \"мнимый\",\n \"могила\",\n \"модель\",\n \"мозг\",\n \"мойка\",\n \"мокрый\",\n \"молодой\",\n \"момент\",\n \"монах\",\n \"море\",\n \"мост\",\n \"мотор\",\n \"мохнатый\",\n \"мочь\",\n \"мошенник\",\n \"мощный\",\n \"мрачный\",\n \"мстить\",\n \"мудрый\",\n \"мужчина\",\n \"музыка\",\n \"мука\",\n \"мумия\",\n \"мундир\",\n \"муравей\",\n \"мусор\",\n \"мутный\",\n \"муфта\",\n \"муха\",\n \"мучить\",\n \"мушкетер\",\n \"мыло\",\n \"мысль\",\n \"мыть\",\n \"мычать\",\n \"мышь\",\n \"мэтр\",\n \"мюзикл\",\n \"мягкий\",\n \"мякиш\",\n \"мясо\",\n \"мятый\",\n \"мячик\",\n \"набор\",\n \"навык\",\n \"нагрузка\",\n \"надежда\",\n \"наемный\",\n \"нажать\",\n \"называть\",\n \"наивный\",\n \"накрыть\",\n \"налог\",\n \"намерен\",\n \"наносить\",\n \"написать\",\n \"народ\",\n \"натура\",\n \"наука\",\n \"нация\",\n \"начать\",\n \"небо\",\n \"невеста\",\n \"негодяй\",\n \"неделя\",\n \"нежный\",\n \"незнание\",\n \"нелепый\",\n \"немалый\",\n \"неправда\",\n \"нервный\",\n \"нести\",\n \"нефть\",\n \"нехватка\",\n \"нечистый\",\n \"неясный\",\n \"нива\",\n \"нижний\",\n \"низкий\",\n \"никель\",\n \"нирвана\",\n \"нить\",\n \"ничья\",\n \"ниша\",\n \"нищий\",\n \"новый\",\n \"нога\",\n \"ножницы\",\n \"ноздря\",\n \"ноль\",\n \"номер\",\n \"норма\",\n \"нота\",\n \"ночь\",\n \"ноша\",\n \"ноябрь\",\n \"нрав\",\n \"нужный\",\n \"нутро\",\n \"нынешний\",\n \"нырнуть\",\n \"ныть\",\n \"нюанс\",\n \"нюхать\",\n \"няня\",\n \"оазис\",\n \"обаяние\",\n \"обвинять\",\n \"обгонять\",\n \"обещать\",\n \"обжигать\",\n \"обзор\",\n \"обида\",\n \"область\",\n \"обмен\",\n \"обнимать\",\n \"оборона\",\n \"образ\",\n \"обучение\",\n \"обходить\",\n \"обширный\",\n \"общий\",\n \"объект\",\n \"обычный\",\n \"обязать\",\n \"овальный\",\n \"овес\",\n \"овощи\",\n \"овраг\",\n \"овца\",\n \"овчарка\",\n \"огненный\",\n \"огонь\",\n \"огромный\",\n \"огурец\",\n \"одежда\",\n \"одинокий\",\n \"одобрить\",\n \"ожидать\",\n \"ожог\",\n \"озарение\",\n \"озеро\",\n \"означать\",\n \"оказать\",\n \"океан\",\n \"оклад\",\n \"окно\",\n \"округ\",\n \"октябрь\",\n \"окурок\",\n \"олень\",\n \"опасный\",\n \"операция\",\n \"описать\",\n \"оплата\",\n \"опора\",\n \"оппонент\",\n \"опрос\",\n \"оптимизм\",\n \"опускать\",\n \"опыт\",\n \"орать\",\n \"орбита\",\n \"орган\",\n \"орден\",\n \"орел\",\n \"оригинал\",\n \"оркестр\",\n \"орнамент\",\n \"оружие\",\n \"осадок\",\n \"освещать\",\n \"осень\",\n \"осина\",\n \"осколок\",\n \"осмотр\",\n \"основной\",\n \"особый\",\n \"осуждать\",\n \"отбор\",\n \"отвечать\",\n \"отдать\",\n \"отец\",\n \"отзыв\",\n \"открытие\",\n \"отмечать\",\n \"относить\",\n \"отпуск\",\n \"отрасль\",\n \"отставка\",\n \"оттенок\",\n \"отходить\",\n \"отчет\",\n \"отъезд\",\n \"офицер\",\n \"охапка\",\n \"охота\",\n \"охрана\",\n \"оценка\",\n \"очаг\",\n \"очередь\",\n \"очищать\",\n \"очки\",\n \"ошейник\",\n \"ошибка\",\n \"ощущение\",\n \"павильон\",\n \"падать\",\n \"паек\",\n \"пакет\",\n \"палец\",\n \"память\",\n \"панель\",\n \"папка\",\n \"партия\",\n \"паспорт\",\n \"патрон\",\n \"пауза\",\n \"пафос\",\n \"пахнуть\",\n \"пациент\",\n \"пачка\",\n \"пашня\",\n \"певец\",\n \"педагог\",\n \"пейзаж\",\n \"пельмень\",\n \"пенсия\",\n \"пепел\",\n \"период\",\n \"песня\",\n \"петля\",\n \"пехота\",\n \"печать\",\n \"пешеход\",\n \"пещера\",\n \"пианист\",\n \"пиво\",\n \"пиджак\",\n \"пиковый\",\n \"пилот\",\n \"пионер\",\n \"пирог\",\n \"писать\",\n \"пить\",\n \"пицца\",\n \"пишущий\",\n \"пища\",\n \"план\",\n \"плечо\",\n \"плита\",\n \"плохой\",\n \"плыть\",\n \"плюс\",\n \"пляж\",\n \"победа\",\n \"повод\",\n \"погода\",\n \"подумать\",\n \"поехать\",\n \"пожимать\",\n \"позиция\",\n \"поиск\",\n \"покой\",\n \"получать\",\n \"помнить\",\n \"пони\",\n \"поощрять\",\n \"попадать\",\n \"порядок\",\n \"пост\",\n \"поток\",\n \"похожий\",\n \"поцелуй\",\n \"почва\",\n \"пощечина\",\n \"поэт\",\n \"пояснить\",\n \"право\",\n \"предмет\",\n \"проблема\",\n \"пруд\",\n \"прыгать\",\n \"прямой\",\n \"психолог\",\n \"птица\",\n \"публика\",\n \"пугать\",\n \"пудра\",\n \"пузырь\",\n \"пуля\",\n \"пункт\",\n \"пурга\",\n \"пустой\",\n \"путь\",\n \"пухлый\",\n \"пучок\",\n \"пушистый\",\n \"пчела\",\n \"пшеница\",\n \"пыль\",\n \"пытка\",\n \"пыхтеть\",\n \"пышный\",\n \"пьеса\",\n \"пьяный\",\n \"пятно\",\n \"работа\",\n \"равный\",\n \"радость\",\n \"развитие\",\n \"район\",\n \"ракета\",\n \"рамка\",\n \"ранний\",\n \"рапорт\",\n \"рассказ\",\n \"раунд\",\n \"рация\",\n \"рвать\",\n \"реальный\",\n \"ребенок\",\n \"реветь\",\n \"регион\",\n \"редакция\",\n \"реестр\",\n \"режим\",\n \"резкий\",\n \"рейтинг\",\n \"река\",\n \"религия\",\n \"ремонт\",\n \"рента\",\n \"реплика\",\n \"ресурс\",\n \"реформа\",\n \"рецепт\",\n \"речь\",\n \"решение\",\n \"ржавый\",\n \"рисунок\",\n \"ритм\",\n \"рифма\",\n \"робкий\",\n \"ровный\",\n \"рогатый\",\n \"родитель\",\n \"рождение\",\n \"розовый\",\n \"роковой\",\n \"роль\",\n \"роман\",\n \"ронять\",\n \"рост\",\n \"рота\",\n \"роща\",\n \"рояль\",\n \"рубль\",\n \"ругать\",\n \"руда\",\n \"ружье\",\n \"руины\",\n \"рука\",\n \"руль\",\n \"румяный\",\n \"русский\",\n \"ручка\",\n \"рыба\",\n \"рывок\",\n \"рыдать\",\n \"рыжий\",\n \"рынок\",\n \"рысь\",\n \"рыть\",\n \"рыхлый\",\n \"рыцарь\",\n \"рычаг\",\n \"рюкзак\",\n \"рюмка\",\n \"рябой\",\n \"рядовой\",\n \"сабля\",\n \"садовый\",\n \"сажать\",\n \"салон\",\n \"самолет\",\n \"сани\",\n \"сапог\",\n \"сарай\",\n \"сатира\",\n \"сауна\",\n \"сахар\",\n \"сбегать\",\n \"сбивать\",\n \"сбор\",\n \"сбыт\",\n \"свадьба\",\n \"свет\",\n \"свидание\",\n \"свобода\",\n \"связь\",\n \"сгорать\",\n \"сдвигать\",\n \"сеанс\",\n \"северный\",\n \"сегмент\",\n \"седой\",\n \"сезон\",\n \"сейф\",\n \"секунда\",\n \"сельский\",\n \"семья\",\n \"сентябрь\",\n \"сердце\",\n \"сеть\",\n \"сечение\",\n \"сеять\",\n \"сигнал\",\n \"сидеть\",\n \"сизый\",\n \"сила\",\n \"символ\",\n \"синий\",\n \"сирота\",\n \"система\",\n \"ситуация\",\n \"сиять\",\n \"сказать\",\n \"скважина\",\n \"скелет\",\n \"скидка\",\n \"склад\",\n \"скорый\",\n \"скрывать\",\n \"скучный\",\n \"слава\",\n \"слеза\",\n \"слияние\",\n \"слово\",\n \"случай\",\n \"слышать\",\n \"слюна\",\n \"смех\",\n \"смирение\",\n \"смотреть\",\n \"смутный\",\n \"смысл\",\n \"смятение\",\n \"снаряд\",\n \"снег\",\n \"снижение\",\n \"сносить\",\n \"снять\",\n \"событие\",\n \"совет\",\n \"согласие\",\n \"сожалеть\",\n \"сойти\",\n \"сокол\",\n \"солнце\",\n \"сомнение\",\n \"сонный\",\n \"сообщать\",\n \"соперник\",\n \"сорт\",\n \"состав\",\n \"сотня\",\n \"соус\",\n \"социолог\",\n \"сочинять\",\n \"союз\",\n \"спать\",\n \"спешить\",\n \"спина\",\n \"сплошной\",\n \"способ\",\n \"спутник\",\n \"средство\",\n \"срок\",\n \"срывать\",\n \"стать\",\n \"ствол\",\n \"стена\",\n \"стихи\",\n \"сторона\",\n \"страна\",\n \"студент\",\n \"стыд\",\n \"субъект\",\n \"сувенир\",\n \"сугроб\",\n \"судьба\",\n \"суета\",\n \"суждение\",\n \"сукно\",\n \"сулить\",\n \"сумма\",\n \"сунуть\",\n \"супруг\",\n \"суровый\",\n \"сустав\",\n \"суть\",\n \"сухой\",\n \"суша\",\n \"существо\",\n \"сфера\",\n \"схема\",\n \"сцена\",\n \"счастье\",\n \"счет\",\n \"считать\",\n \"сшивать\",\n \"съезд\",\n \"сынок\",\n \"сыпать\",\n \"сырье\",\n \"сытый\",\n \"сыщик\",\n \"сюжет\",\n \"сюрприз\",\n \"таблица\",\n \"таежный\",\n \"таинство\",\n \"тайна\",\n \"такси\",\n \"талант\",\n \"таможня\",\n \"танец\",\n \"тарелка\",\n \"таскать\",\n \"тахта\",\n \"тачка\",\n \"таять\",\n \"тварь\",\n \"твердый\",\n \"творить\",\n \"театр\",\n \"тезис\",\n \"текст\",\n \"тело\",\n \"тема\",\n \"тень\",\n \"теория\",\n \"теплый\",\n \"терять\",\n \"тесный\",\n \"тетя\",\n \"техника\",\n \"течение\",\n \"тигр\",\n \"типичный\",\n \"тираж\",\n \"титул\",\n \"тихий\",\n \"тишина\",\n \"ткань\",\n \"товарищ\",\n \"толпа\",\n \"тонкий\",\n \"топливо\",\n \"торговля\",\n \"тоска\",\n \"точка\",\n \"тощий\",\n \"традиция\",\n \"тревога\",\n \"трибуна\",\n \"трогать\",\n \"труд\",\n \"трюк\",\n \"тряпка\",\n \"туалет\",\n \"тугой\",\n \"туловище\",\n \"туман\",\n \"тундра\",\n \"тупой\",\n \"турнир\",\n \"тусклый\",\n \"туфля\",\n \"туча\",\n \"туша\",\n \"тыкать\",\n \"тысяча\",\n \"тьма\",\n \"тюльпан\",\n \"тюрьма\",\n \"тяга\",\n \"тяжелый\",\n \"тянуть\",\n \"убеждать\",\n \"убирать\",\n \"убогий\",\n \"убыток\",\n \"уважение\",\n \"уверять\",\n \"увлекать\",\n \"угнать\",\n \"угол\",\n \"угроза\",\n \"удар\",\n \"удивлять\",\n \"удобный\",\n \"уезд\",\n \"ужас\",\n \"ужин\",\n \"узел\",\n \"узкий\",\n \"узнавать\",\n \"узор\",\n \"уйма\",\n \"уклон\",\n \"укол\",\n \"уксус\",\n \"улетать\",\n \"улица\",\n \"улучшать\",\n \"улыбка\",\n \"уметь\",\n \"умиление\",\n \"умный\",\n \"умолять\",\n \"умысел\",\n \"унижать\",\n \"уносить\",\n \"уныние\",\n \"упасть\",\n \"уплата\",\n \"упор\",\n \"упрекать\",\n \"упускать\",\n \"уран\",\n \"урна\",\n \"уровень\",\n \"усадьба\",\n \"усердие\",\n \"усилие\",\n \"ускорять\",\n \"условие\",\n \"усмешка\",\n \"уснуть\",\n \"успеть\",\n \"усыпать\",\n \"утешать\",\n \"утка\",\n \"уточнять\",\n \"утро\",\n \"утюг\",\n \"уходить\",\n \"уцелеть\",\n \"участие\",\n \"ученый\",\n \"учитель\",\n \"ушко\",\n \"ущерб\",\n \"уютный\",\n \"уяснять\",\n \"фабрика\",\n \"фаворит\",\n \"фаза\",\n \"файл\",\n \"факт\",\n \"фамилия\",\n \"фантазия\",\n \"фара\",\n \"фасад\",\n \"февраль\",\n \"фельдшер\",\n \"феномен\",\n \"ферма\",\n \"фигура\",\n \"физика\",\n \"фильм\",\n \"финал\",\n \"фирма\",\n \"фишка\",\n \"флаг\",\n \"флейта\",\n \"флот\",\n \"фокус\",\n \"фольклор\",\n \"фонд\",\n \"форма\",\n \"фото\",\n \"фраза\",\n \"фреска\",\n \"фронт\",\n \"фрукт\",\n \"функция\",\n \"фуражка\",\n \"футбол\",\n \"фыркать\",\n \"халат\",\n \"хамство\",\n \"хаос\",\n \"характер\",\n \"хата\",\n \"хватать\",\n \"хвост\",\n \"хижина\",\n \"хилый\",\n \"химия\",\n \"хирург\",\n \"хитрый\",\n \"хищник\",\n \"хлам\",\n \"хлеб\",\n \"хлопать\",\n \"хмурый\",\n \"ходить\",\n \"хозяин\",\n \"хоккей\",\n \"холодный\",\n \"хороший\",\n \"хотеть\",\n \"хохотать\",\n \"храм\",\n \"хрен\",\n \"хриплый\",\n \"хроника\",\n \"хрупкий\",\n \"художник\",\n \"хулиган\",\n \"хутор\",\n \"царь\",\n \"цвет\",\n \"цель\",\n \"цемент\",\n \"центр\",\n \"цепь\",\n \"церковь\",\n \"цикл\",\n \"цилиндр\",\n \"циничный\",\n \"цирк\",\n \"цистерна\",\n \"цитата\",\n \"цифра\",\n \"цыпленок\",\n \"чадо\",\n \"чайник\",\n \"часть\",\n \"чашка\",\n \"человек\",\n \"чемодан\",\n \"чепуха\",\n \"черный\",\n \"честь\",\n \"четкий\",\n \"чехол\",\n \"чиновник\",\n \"число\",\n \"читать\",\n \"членство\",\n \"чреватый\",\n \"чтение\",\n \"чувство\",\n \"чугунный\",\n \"чудо\",\n \"чужой\",\n \"чукча\",\n \"чулок\",\n \"чума\",\n \"чуткий\",\n \"чучело\",\n \"чушь\",\n \"шаблон\",\n \"шагать\",\n \"шайка\",\n \"шакал\",\n \"шалаш\",\n \"шампунь\",\n \"шанс\",\n \"шапка\",\n \"шарик\",\n \"шасси\",\n \"шатер\",\n \"шахта\",\n \"шашлык\",\n \"швейный\",\n \"швырять\",\n \"шевелить\",\n \"шедевр\",\n \"шейка\",\n \"шелковый\",\n \"шептать\",\n \"шерсть\",\n \"шестерка\",\n \"шикарный\",\n \"шинель\",\n \"шипеть\",\n \"широкий\",\n \"шить\",\n \"шишка\",\n \"шкаф\",\n \"школа\",\n \"шкура\",\n \"шланг\",\n \"шлем\",\n \"шлюпка\",\n \"шляпа\",\n \"шнур\",\n \"шоколад\",\n \"шорох\",\n \"шоссе\",\n \"шофер\",\n \"шпага\",\n \"шпион\",\n \"шприц\",\n \"шрам\",\n \"шрифт\",\n \"штаб\",\n \"штора\",\n \"штраф\",\n \"штука\",\n \"штык\",\n \"шуба\",\n \"шуметь\",\n \"шуршать\",\n \"шутка\",\n \"щадить\",\n \"щедрый\",\n \"щека\",\n \"щель\",\n \"щенок\",\n \"щепка\",\n \"щетка\",\n \"щука\",\n \"эволюция\",\n \"эгоизм\",\n \"экзамен\",\n \"экипаж\",\n \"экономия\",\n \"экран\",\n \"эксперт\",\n \"элемент\",\n \"элита\",\n \"эмблема\",\n \"эмигрант\",\n \"эмоция\",\n \"энергия\",\n \"эпизод\",\n \"эпоха\",\n \"эскиз\",\n \"эссе\",\n \"эстрада\",\n \"этап\",\n \"этика\",\n \"этюд\",\n \"эфир\",\n \"эффект\",\n \"эшелон\",\n \"юбилей\",\n \"юбка\",\n \"южный\",\n \"юмор\",\n \"юноша\",\n \"юрист\",\n \"яблоко\",\n \"явление\",\n \"ягода\",\n \"ядерный\",\n \"ядовитый\",\n \"ядро\",\n \"язва\",\n \"язык\",\n \"яйцо\",\n \"якорь\",\n \"январь\",\n \"японец\",\n \"яркий\",\n \"ярмарка\",\n \"ярость\",\n \"ярус\",\n \"ясный\",\n \"яхта\",\n \"ячейка\",\n \"ящик\" \n ];\n }", "public function luas()\n {\n return $this->panjang * $this->lebar;\n }", "function addjapeng($kanjicity, $kanalocal, $kanacity, $kanastreet,/* $kanahouse,*/ $hyphens)\n\t{\n\t\tif (strstr(substr($kanjicity,8),encode(\"郡\"))!==false) $kanacity=substr($kanacity,0,8) . str_replace(encode(\"グン\"),\"gun \",substr($kanacity,8));\n\t\t$string= trim($kanalocal.\" \". $kanacity . \" \" . $kanastreet/* . \" \" . $kanahouse*/);\n\n\n\t\t//Array to prevent \"-shi,-ku\" errors\n\t\t$cities=array(encode(\"サイタマシ\") =>\"Saitamashi \",encode(\"キョウトシ\") =>\"Kyotoshi \",encode(\"センダイシ\") =>\"Sendaishi \",encode(\"キタキュウシュウシ\") =>\"Kita Kyushushi \",encode(\"チバシ\") =>\"Chibashi \",encode(\"ナゴヤシ\") =>\"Nagoyashi \",encode(\"サカイシ\") =>\"Sakaishi \",encode(\"オオサカシ\") =>\"Osakashi \",encode(\"カワサキシ\") =>\"Kawasakishi \",encode(\"ヒロシマシ\") =>\"Hiroshimashi \",encode(\"ニイガタシ\") =>\"Nigatashi \",encode(\"サッポロシ\") =>\"Sapporoshi \",encode(\"ヨコハマシ\") =>\"Yokohamashi \",encode(\"ハママツシ\") =>\"Hamamatsushi \",encode(\"コウベシ\") =>\"Kobeshi \",encode(\"フクオカシ\") =>\"Fukuokashi \",encode(\"シズオカシ\") =>\"Shizuokashi \");\n\t\t//Irregular combinations\n\t\t$irregular=array(encode(\"ゥウ\") => encode(\"ゥ\") ,encode(\"ォオ\") => encode(\"ォ\") ,encode(\"ョウ\") => encode(\"ョ\") ,encode(\"ュウ\") => encode(\"ュ\")/*, encode(\" ミナミ\") =>\" Minami \", encode(\" ヒガシ\") =>\" higashi \"/*, encode(\" キタ\") =>\" kita \", encode(\" ニシ\") =>\" nishi\" */);\n\t\t//Basic transition\n\t\t$trans=array(encode(\"シモウ\") => \"shimou\" ,encode(\"モトウ\") => \"motou\" ,encode(\"モトオ\") => \"motoo\" ,encode(\"ン\") => \"n\" ,encode(\"ヲ\") => \"wo\" ,encode(\"ワ\") => \"wa\" ,encode(\"ロウ\") => \"ro\" ,/*encode(\"ロオ\") => \"ro\" ,*/encode(\"ロ\") => \"ro\" ,encode(\"レ\") => \"re\" ,encode(\"ル\") => \"ru\" ,encode(\"リイ\") => \"ri\" ,encode(\"リョ\") => \"ryo\" ,encode(\"リュ\") => \"ryu\" ,encode(\"リャ\") => \"rya\" ,encode(\"リ\") => \"ri\" ,encode(\"ラ\") => \"ra\" ,encode(\"ヨウ\") => \"yo\" ,encode(\"ユウ\") => \"yu\" ,encode(\"ヨ\") => \"yo\" ,encode(\"ユ\") => \"yu\" ,encode(\"ヤ\") => \"ya\" ,encode(\"モオ\") => \"mo\" ,encode(\"モウ\") => \"mo\" ,encode(\"モ\") => \"mo\" ,encode(\"メ\") => \"me\" ,encode(\"ム\") => \"mu\" ,encode(\"ミョ\") => \"myo\" ,encode(\"ミュ\") => \"myu\" ,encode(\"ミャ\") => \"mya\" ,encode(\"ミ\") => \"mi\" ,encode(\"マ\") => \"ma\" ,encode(\"ボウ\") => \"bo\" ,encode(\"ボ\") => \"bo\" ,encode(\"ベ\") => \"be\" ,encode(\"ブウ\") => \"bu\" ,encode(\"ブ\") => \"bu\" ,encode(\"ビョ\") => \"byo\" ,encode(\"ビュ\") => \"byu\" ,encode(\"ビャ\") => \"bya\" ,encode(\"ビ\") => \"bi\" ,encode(\"バ\") => \"ba\" ,encode(\"ポウ\") => \"po\" ,encode(\"ポ\") => \"po\" ,encode(\"ペ\") => \"pe\" ,encode(\"プウ\") => \"pu\" ,encode(\"プ\") => \"pu\" ,encode(\"ピョ\") => \"pyo\" ,encode(\"ピュ\") => \"pyu\" ,encode(\"ピャ\") => \"pya\" ,encode(\"パ\") => \"pa\" ,encode(\"ノウ\") => \"no\" ,encode(\"ホウ\") => \"ho\" ,encode(\"ホ\") => \"ho\" ,encode(\"ヘ\") => \"he\" ,encode(\"フォ\") => \"fo\" ,encode(\"フェ\") => \"fe\" ,encode(\"フゥ\") => \"fu\" ,encode(\"フィ\") => \"fi\" ,encode(\"ファ\") => \"fa\" ,encode(\"フウ\") => \"fu\" ,encode(\"フ\") => \"fu\" ,encode(\"ヒョ\") => \"hyo\" ,encode(\"ヒュ\") => \"hyu\" ,encode(\"ヒャ\") => \"hya\" ,encode(\"ヒ\") => \"hi\" ,encode(\"ハ\") => \"ha\" ,encode(\"ノ\") => \"no\" ,encode(\"ネ\") => \"ne\" ,encode(\"ヌウ\") => \"nu\" ,encode(\"ヌ\") => \"ne\" ,encode(\"ニョ\") => \"nyo\" ,encode(\"ニュ\") => \"nyu\" ,encode(\"ニャ\") => \"nya\" ,encode(\"ニ\") => \"ni\" ,encode(\"ナ\") => \"na\" ,encode(\"ドオ\") => \"do\" ,encode(\"ドウ\") => \"do\" ,encode(\"ド\") => \"do\" ,encode(\"ディ\") => \"di\" ,encode(\"デ\") => \"de\" ,encode(\"ヅウ\") => \"ju\" ,encode(\"ヅ\") => \"ju\" ,encode(\"ヂョ\") => \"jyo\" ,encode(\"ヂュ\") => \"jyu\" ,encode(\"ヂャ\") => \"jya\" ,encode(\"ヂェ\") => \"jye\" ,encode(\"ヂィ\") => \"ji\" ,encode(\"ヂ\") => \"ji\" ,encode(\"ダ\") => \"da\" ,encode(\"トオ\") => \"to\" ,encode(\"トウ\") => \"to\" ,encode(\"ト\") => \"to\" ,encode(\"ティ\") => \"ti\" ,encode(\"テ\") => \"te\" ,encode(\"ツウ\") => \"tsu\" ,encode(\"ツ\") => \"tsu\" ,encode(\"チョ\") => \"cho\" ,encode(\"チュ\") => \"chu\" ,encode(\"チャ\") => \"cha\" ,encode(\"チェ\") => \"che\" ,encode(\"チィ\") => \"chi\" ,encode(\"チ\") => \"chi\" ,encode(\"タ\") => \"ta\" ,encode(\"ゾウ\") => \"zo\" ,encode(\"ゾオ\") => \"zo\" ,encode(\"ゾ\") => \"zo\" ,encode(\"ゼ\") => \"ze\" ,encode(\"ズ\") => \"zu\" ,encode(\"ジョ\") => \"jo\" ,encode(\"ジェ\") => \"je\" ,encode(\"ジュ\") => \"ju\" ,encode(\"ジャ\") => \"ja\" ,encode(\"ジ\") => \"ji\" ,encode(\"ザ\") => \"za\" ,encode(\"ソウ\") => \"so\" ,encode(\"ソオ\") => \"so\" ,encode(\"ソ\") => \"so\" ,encode(\"セ\") => \"se\" ,encode(\"ス\") => \"su\" ,encode(\"ショ\") => \"sho\" ,encode(\"シェ\") => \"she\" ,encode(\"シュ\") => \"shu\" ,encode(\"シャ\") => \"sha\" ,encode(\"シ\") => \"shi\" ,encode(\"サ\") => \"sa\" ,encode(\"ゴウ\") => \"go\" ,encode(\"ゴオ\") => \"go\" ,encode(\"ゴ\") => \"go\" ,encode(\"ゲ\") => \"ge\" ,encode(\"グ\") => \"gu\" ,encode(\"ギョ\") => \"gyo\" ,encode(\"ギェ\") => \"gye\" ,encode(\"ギュ\") => \"gyu\" ,encode(\"ギィ\") => \"gyi\" ,encode(\"ギャ\") => \"gya\" ,encode(\"ギ\") => \"gi\" ,encode(\"ガ\") => \"ga\" ,encode(\"コウ\") => \"ko\" ,encode(\"コオ\") => \"ko\" ,encode(\"コ\") => \"ko\" ,encode(\"ケ\") => \"ke\" ,encode(\"ク\") => \"ku\" ,encode(\"キョ\") => \"kyo\" ,encode(\"キェ\") => \"kye\" ,encode(\"キュ\") => \"kyu\" ,encode(\"キィ\") => \"kyi\" ,encode(\"キャ\") => \"kya\" ,encode(\"キ\") => \"ki\" ,encode(\"カ\") => \"ka\" ,encode(\"オオ\") => \"o\" ,encode(\"オウ\") => \"o\" ,encode(\"ヴォ\") => \"vo\" ,encode(\"ヴェ\") => \"ve\" ,encode(\"ヴィ\") => \"vi\" ,encode(\"ヴァ\") => \"va\" ,encode(\"ヴ\") => \"vu\" ,encode(\"オ\") => \"o\" ,encode(\"エ\") => \"e\" ,encode(\"ウ\") => \"u\" ,encode(\"イ\") => \"i\" ,encode(\"ア\") => \"a\",encode(\"ッ\") => \"l\");\n\t\t//Perform Conversion\n\t\t$string=strtr($string,$cities);\n\t\t$string=strtr($string,$irregular);\n\t\t$string=strtr($string,$trans);\n\t\t$string=strtoupper(substr($string,0,1)) . substr($string,1);\n\t\t$length=strlen($string);\n\t\t//echo \"<br />basic switch $string\";\n\t\t//Remove tsu or \"l\" as it is now written\n\t\tfor ($pos=0;$pos<=$length;$pos++)\n\t\t\t{\n\t\t\t\t$part=substr($string,$pos,1);\n\t\t\t\t$tsu=strstr($part,\"l\");\n\t\t\t\tif ($tsu!==false)\n\t\t\t\t\t{\n\t\t\t\t\t\t$string=substr($string,0,$pos) . substr($string,($pos+1),1) . substr($string,($pos+1));\n\t\t\t\t\t}\n\t\t\t}\n\t\t//echo \"<br />remove tsu $string\";\n\t\t//Add Capital Letters to the start of each place\n\t\t$off=1+strpos($string,\" \");\n\t\twhile ($off!=1)\n\t\t\t{\n\t\t\t\t$string=substr($string,0,$off) . strtoupper(substr($string,$off,1)) . substr($string,($off+1));\n\t\t\t\t$off=1+strpos($string,\" \",$off);\n\t\t\t}\n\t\t//echo \"</br> Capital Letters $string\";\n\t\t//Function to add Hyphens to the end of each word\n\t\t$vowels=array(\"a\",\"e\",\"i\",\"o\",\"u\",\"n\");\n\t\t$stringer=explode(\" \",$string);\n\t\t$count=(count($stringer)-(1+$hyphens));\n\t\tfor ($i=0;$i<=$count;$i++)\n\t\t\t{\n\t\t\t\t$stringer[$i]=hyphenator($stringer[$i],$vowels);\n\t\t\t}\n\t\t$string=implode(\" \",$stringer);\n\t\t//echo \"<br />Hyphens $string\";\n\t\t//Strip off any bracketed areas\n\t\t$string=str_replace(\"ma-chi\",\"machi\",$string);\n\t\tif (strstr($string,encode(\"(\"))!==false) $string=substr($string,0,strpos($string,encode(\"(\"))) . substr($string,(8+strpos($string,encode(\")\"))));\n\t\t//echo \"<br />Final $string\";\n\t\treturn $string;\n\t}", "public function percobaan()\n {\n \t$a = \"Ahmad Muhaimin\";\n \treturn \"Nama Saya Adalah \".$a;\n }", "static public function english_name() : string {\n return \"Russian\";\n }", "function hapusakhiran($kata){\n if (substr($kata, -3)== \"kan\" ){\n $kata = substr($kata, 0, -3);\n }\n else if(substr($kata, -1)== \"i\" ){\n $kata = substr($kata, 0, -1);\n }else if(substr($kata, -2)== \"an\"){\n $kata = substr($kata, 0, -2);\n }\n return $kata;\n }", "public static function doYouMean() {\r\n\t\t$aranan_kelime = 'ph'; //Bu değerin veritabanından geldiğini varsayalım\r\n\t\t$diziler = array('php', 'asp', '.net', 'jsp', 'java', 'javascript', 'html', 'c', 'css', 'xml');\r\n\t\t//$diziler dizisi, veritabanından çekilen birçok veri dizisi olduğu varsayalım\r\n\t\t$uzunluk = -1;\r\n\t\t\r\n\t\tforeach($diziler as $dizi) {\r\n\t\t\t$benzerlik = levenshtein($aranan_kelime, $dizi);\r\n\t\t\tif($benzerlik == 0) {\r\n\t\t\t\t$yakinlik = $dizi;\r\n\t\t\t\t$uzunluk = 0;\r\n\t\t\t}\r\n\t\t\tif(($benzerlik <= $uzunluk) || ($uzunluk < 0)) {\r\n\t\t\t\t$yakinlik = $dizi;\r\n\t\t\t\t$uzunluk = $benzerlik;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t$op = \"Aranan Kelime: \".$aranan_kelime;\r\n\t\tif($uzunluk == 0) {\r\n\t\t\t$op .= $yakinlik.\" için herhangi bir sonuç bulunamadı!\";\r\n\t\t} else {\r\n\t\t\t$op .= \"Bunu mu demek istediniz? \".$yakinlik;\r\n\t\t}\r\n\t\treturn $op;\r\n\t}", "function QuitarArticulos($palabra) \r\n {\r\n #$palabra = preg_replace('/\\bMC/', '', $palabra); \r\n $palabra = preg_replace('/\\b(DE(L)?|LA(S)?|LOS|Y|A|VON|VAN)\\s+/i', '', $palabra); \r\n return $palabra; \r\n }", "function noidungtt($sotu,$noidung)\n{\n\n\t$n=explode(\" \",$noidung);\n\t$noidunginra=\" \";\n\tif($sotu<=count($n)){\n for($i=0;$i<$sotu;$i++)\n\t\t $noidunginra = $noidunginra.$n[$i].\" \";\n $noidunginra .=\"...\";\n }\n\telse\n\t\techo \"<h1>cảnh báo : số từ tóm lược nhiều hơn nội dung ban đầu</h1>\"; \n\treturn $noidunginra;\n}", "function huruf($jenis, $papar)\n{\n \n switch ($jenis) \n {// mula - pilih $jenis\n case 'BESAR':\n $papar = strtoupper($papar);\n break;\n case 'kecil':\n $papar = strtolower($papar);\n break;\n case 'Depan':\n $papar = ucfrist($papar);\n break;\n case 'Besar_Depan':\n $papar = mb_convert_case($papar, MB_CASE_TITLE);\n break;\n }// tamat - pilih $jenis\n \n return $papar;\n}", "function tampilSikap($nilai) {\nif($nilai== '1'){ \n\t$nilai = 'Kurang';\n}\nelseif($nilai== '2'){ \n\t$nilai = 'Cukup';\n}\nelseif($nilai== '3'){ \n\t$nilai = 'Baik';\n}\nelse { \n\t$nilai = 'Baik Sekali';\n}\n\treturn $nilai;\n}", "public function inLuxembourgish()\n {\n return $this->getTranslationIn('lb');\n }", "public function tes()\n\t{\n\t\t$tes = \"^ & %aku% ak4 $ 12 Trilyun2 Enak2 banget2 ya Tragedi ular kembali memakan korban. Kali ini seorang bocah laki2 di Bandung tewas setelah dipatuk ular weling.--Insiden itu menimpa Andi Ramdani (11), bocah asal Jalan Nagrog, Gang Keramat RT 04/09, Kelurahan Pasirjati, Kecamatan Ujungberung, Kota Bandung. Andi tewas saat dilarikan ke rumah sakit umum daerah (RSUD) Bandung pada Rabu (23/1) siang.--Bagaimana awal mula kejadiannya? Simak selengkapnya di link yang ada di stories!--Sumber: detiknews--#detikcom #ularweling #dipatukular\";\n\t\t$tes1 = \"'DANAR' Dono y nyiyir gak ga adalah..,./ seorang...!! @mahasiswa2%&& :D z!! @mas danar_dono\";\n\t\t$cek = $this->case_folding($tes);\n\t\t$cek = $this->cleansing($cek);\n\t\t$cek = $this->stemmer($cek);\n\t\t$cek = $this->stopword($cek);\n\t\t$cek = preg_split('/ /',$cek);\n\t\t$count = count($cek);\n\t\tfor($i=0;$i<$count;$i++){\n\t\t\t$cek[$i] = $this->hilangkan_kataberulang($cek[$i]);\n\t\t}\n\t}", "protected function subjonctifImparfait(){\n $terminaisons=[];\n $terminaisons[]= \"fuguèsse\";\n $terminaisons[]= \"fuguèsses\";\n $terminaisons[]= \"fuguèsse\";\n $terminaisons[]= \"fuguessian\";\n $terminaisons[]= \"fuguessias\";\n $terminaisons[]= \"fuguèsson\";\n return $terminaisons;\n }", "function papan_catur($angka) {\r\n}", "function poemhd_plugin() {\n\t$chosen = Poemhd_plugin_get_lyric();\n\t$lang = '';\n\tif ( 'en_' !== substr( get_user_locale(), 0, 3 ) ) {\n\t\t$lang = ' lang=\"en\"';\n\t}\n\n\tprintf(\n\t\t'<p id=\"dolly\"><span class=\"screen-reader-text\">%s </span><span dir=\"ltr\"%s>%s</span></p>',\n\t\t__( 'Quote from Hello Dolly song, by Jerry Herman:' ),\n\t\t$lang,\n\t\t$chosen\n\t);\n}", "function lang()\n\t{\n\t\t$lang = (empty($_COOKIE['lang'])) ? 'italiano' : $_COOKIE['lang'];\n\t\t$this->lang=$lang;\n\t\t$this->lang_frequency=$lang.$this->lang_frequency_suffix;\n\t\t\n\t\t\n\n\t\t$n=\"\";\n\t\t$i=1;\n\t\twhile (isset($_COOKIE['lang'.$n]))\n\t\t{\n\t\t\t$i++;\n\t\t\t\t\n\t\t\t$this->lang_a[$i][0]=$_COOKIE['lang'.$n];\n\t\t\t$this->lang_a[$i][1]=$_COOKIE['lang'.$n].\"_frequency\"; //Non sò a cosa serva però...\n\t\t\t$n=$i;\n\t\t}\n\n\t\n\t\n\t\n\t}", "public function inDanish()\n {\n return $this->getTranslationIn('da');\n }", "function apa_kabar() {\n return \"Apa kabar dunia?\"; //tidak menampilkan apapun\n}", "public function getSemanaQuin()\n {\n return $this->semana_quin;\n }", "public function traerCualquiera()\n {\n }", "public function inHausa()\n {\n return $this->getTranslationIn('ha');\n }", "public function byChatThamGia(){\n\t\t// Chất tham gia array(\"Al\",\"S8\")\n\t\t$equationID=array();\n\t\tforeach($this->thamgia as $chat){\n\t\t\tif(ChemistryThulium::check_thulium($chat))\n\t\t\t{\n\t\t\t\t$thuliumId=ChemistryThulium::get_id($chat);\n\t\t\t\t// Lấy mã chất bởi tên chất\n\t\t\t\t$equationID[]=ChemistryChatThamGia::get_id_equation($thuliumId);\n\t\t\t\t// Láy mã phương trình bởi mã chất\n\t\t\t}\n\t\t\telse break;\n\t\t}\n\t\treturn $this->getCommonThulium($equationID);\n\t}", "function Tinh ($x,$n){\n $tong = 0;\n if($x<0 || $n <0){\n echo \"<p>Không cho phép tính toán với số âm</p>\";\n }else{\n for ($i=1;$i<=$n;$i++){\n $tong+=$x*$i*2;\n }echo \"<p>S($n) = $tong</p>\";\n }\n}", "function truc() {\n}", "public function serang(){\n\n\t\treturn 'sedang menyerang elang';\n\n\t}", "public function handle()\n {\n //都道府県の連想配列\n $pref = array(\"1\" => \"北海道\", \"2\" => \"青森県\", \"3\" => \"岩手県\", \"4\" => \"宮城県\", \"5\" => \"秋田県\", \"6\" => \"山形県\", \"7\" => \"福島県\", \"8\" => \"茨城県\", \"9\" => \"栃木県\", \"10\" => \"群馬県\", \"11\" => \"埼玉県\", \"12\" => \"千葉県\", \"13\" => \"東京都\", \"14\" => \"神奈川県\", \"15\" => \"新潟県\", \"16\" => \"富山県\", \"17\" => \"石川県\", \"18\" => \"福井県\", \"19\" => \"山梨県\", \"20\" => \"長野県\", \"21\" => \"岐阜県\", \"22\" => \"静岡県\", \"23\" => \"愛知県\", \"24\" => \"三重県\", \"25\" => \"滋賀県\", \"26\" => \"京都府\", \"27\" => \"大阪府\", \"28\" => \"兵庫県\", \"29\" => \"奈良県\", \"30\" => \"和歌山県\", \"31\" => \"鳥取県\", \"32\" => \"島根県\", \"33\" => \"岡山県\", \"34\" => \"広島県\", \"35\" => \"山口県\", \"36\" => \"徳島県\", \"37\" => \"香川県\", \"38\" => \"愛媛県\", \"39\" => \"高知県\", \"40\" => \"福岡県\", \"41\" => \"佐賀県\", \"42\" => \"長崎県\", \"43\" => \"熊本県\", \"44\" => \"大分県\", \"45\" => \"宮崎県\", \"46\" => \"鹿児島県\", \"47\" => \"沖縄県\");\n\n //業種・職種・勤務地の条件を指定して件数を絞り込む\n $b = 86; //業種\n $j = 24; //職種\n $k = 27; //勤務地\n\n //年月日時分秒の設定\n date_default_timezone_set('Asia/Tokyo');\n $today = date(\"YmdHis\");\n\n $url = \"https://job.rikunabi.com/2018/search/company/result/?isc=r8rcna01262\";\n\n $useragent = \"Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.1) Gecko/20061204 Firefox/2.0.0.1\";\n\n $dom = new DOMDocument;\n $dom->preserveWhiteSpace = false;\n $dom->formatOutput = true;\n @$dom->loadHTMLFile($url);\n $xpath = new DOMXPath($dom);\n\n //件数の取得\n $tests = $xpath->query('//span[@class=\"search-resultCounter-count\"]')->item(0)->nodeValue;\n\n //ページ数の計算\n $p = $tests / 100;\n //print $p . \"\\n\";\n\n\n $csv_header = [\"会社ID\", \"サイトID\", \"会社名\", \"電話番号\", \"メールアドレス\", \"ホームページ\", \"代表者\", \"資本金\", \"売上高\", \"連絡先\"];\n\n //csv出力前に、表示されるファイルパス、集計件数、条件内容\n $output_result = \"条件:業界(b={$b})、職種(j={$j})、勤務地({$pref[$k]})、会社件数:{$tests}件\";\n echo $output_result;\n $output_result = \"ファイルパス:C:\\Users\\admin44\\Downloads\\{$today}.csv\" . \"\\n\";\n $output_result = preg_replace(\"/({)/\", \"\", $output_result);\n $output_result = preg_replace(\"/(})/\", \"\", $output_result);\n echo $output_result;\n\n $result = [];\n\n //会社一覧ページ毎\n for ($i = 1; $i <= $p+1; $i++) {\n\n $url = \"https://job.rikunabi.com/2018/search/company/result/?isc=r8rcna01262&pn=\" .$i;\n print $url . \"\\n\";\n\n $dom = new DOMDocument;\n $dom->preserveWhiteSpace = false;\n $dom->formatOutput = true;\n @$dom->loadHTMLFile($url);\n $xpath = new DOMXPath($dom);\n\n $tests = $xpath->query('//div[@class=\"search-cassette-title\"]/a');\n\n //PR広告表示確認\n $PR = $xpath->query('//span[@class=\"search-cassette-prLabel\"]')->item(0)->nodeValue;\n //echo $PR. \"\\n\";\n\n $companies = [];\n\n foreach ($tests as $test) {\n $link = $test->getAttribute('href');\n\n $company_url = \"https://job.rikunabi.com\" . $link;\n\n //会社IDの取得\n //$linkの必要な箇所だけ取得\n $paths = explode(\"/\", $link);\n //print $paths[3]. \"\\n\";\n\n //会社IDの配列化\n $company_id = array(\"会社ID\" => \"001\".$paths[3]);\n //var_dump($company_id);\n\n //サイトIDの配列化\n $employment_site_id = array(\"サイトID\" => \"001\");\n //var_dump($employment_site_id);\n\n $dom = new DOMDocument;\n $dom->preserveWhiteSpace = false;\n $dom->formatOutput = true;\n @$dom->loadHTMLFile($company_url);\n $xpath = new DOMXPath($dom);\n\n // 会社名の取得\n $companys = trim($xpath->query('//h1[@class=\"ts-h-company-mainTitle\"]')->item(0)->nodeValue);\n $companys = str_replace(array(\" \"), '', $companys);\n $company1 = array(\"会社名\" => $companys);\n //print_r($company1);\n\n //会社データのラベルの取得\n $header = $xpath->query('//tr/th[@class=\"ts-h-mod-dataTable02-cell ts-h-mod-dataTable02-cell_th\"]');\n\n //会社データの値の取得\n $value = $xpath->query('//tr/td[@class=\"ts-h-mod-dataTable02-cell ts-h-mod-dataTable02-cell_td\"]');\n\n $keys = [];\n $vals = [];\n\n foreach ($header as $node) {\n $key = trim($node->nodeValue);\n $keys[] = htmlspecialchars($key);\n }\n\n foreach ($value as $node) {\n $val = trim($node->nodeValue);\n $vals[] = htmlspecialchars($val);\n }\n\n $array = array_combine($keys, $vals);\n $array = str_replace(array(\"\\r\\n\", \"\\r\", \"\\n\",\"■\", \" \"), '', $array);\n\n //連絡先の取得\n $address = trim($xpath->query('//*[@id=\"company-data04\"]/div[@class=\"ts-h-company-sentence\"]')->item(0)->nodeValue);\n\n //連絡先の改行削除\n $address = str_replace(array(\"\\r\\n\", \"\\r\", \"\\n\", \" \"), '', $address);\n\n $address = array(\"連絡先\" => $address);\n\n //連絡先の再取得\n $address2 = trim($xpath->query('//*[@id=\"company-data04\"]/div[@class=\"ts-h-company-sentence\"]')->item(0)->nodeValue);\n //連絡先の改行削除\n $address2 = str_replace(array(\"\\r\\n\", \"\\r\", \"\\n\", \" \"), '', $address2);\n\n //連絡先の再取得\n $address3 = trim($xpath->query('//*[@id=\"company-data04\"]/div[@class=\"ts-h-company-sentence\"]')->item(0)->nodeValue);\n //連絡先の改行削除\n $address3 = str_replace(array(\"\\r\\n\", \"\\r\", \"\\n\", \" \"), '', $address3);\n\n //連絡先から企業URLを取得する。\n preg_match('/(http|https)(:|:)(.*?)(.jp|.com)/', $address2, $match);\n $match[0] = (isset($match[0])) ? $match[0] : '';\n $url = $match[0];\n\n $company_url = (isset($array[\"ホームページ\"])) ? $array[\"ホームページ\"] : '';\n if ($company_url == \"\") {\n $array[\"ホームページ\"] = $url;\n }\n\n //連絡先からメールアドレスを取得する。\n preg_match('/(mail|E-mail|E-mail|e-mail|Mail|MAIL|メール|E-MAIL|MAIL|mail|アドレス|Mail)( | |:|:|: | :|】|/|…)(.*?)(.jp|.com)/', $address2, $match);\n $match[3] = (isset($match[3])) ? $match[3] : '';\n $match[4] = (isset($match[4])) ? $match[4] : '';\n $email = $match[3] . $match[4];\n\n $email = preg_replace(\"/( | |:|:|〇)/\", \"\", $email);\n $email = preg_replace(\"/(☆)/\", \"@\", $email);\n //echo $email;\n\n if (filter_var($email, FILTER_VALIDATE_EMAIL) === false) {\n $email = \"\";\n }\n\n $address_array = array(\"メールアドレス\" => $email);\n\n //連絡先から電話番号を取得する。\n preg_match('/([0-9]{2,4}-[0-9]{2,4}-[0-9]{3,4})/', $address2, $match);\n $match[0] = (isset($match[0])) ? $match[0] : '';\n $contact = $match[0];\n\n //var_dump($contact);\n $contact_array = array(\"電話番号\" => $contact);\n\n $company = array_merge($array, $address_array);\n $company = array_merge($company, $contact_array);\n $company = array_merge($company, $address);\n $company = array_merge($company1, $company);\n $company3 = array_merge($company_id, $employment_site_id);\n $company = array_merge($company3, $company);\n //var_dump($company);\n\n $_company = [];\n foreach ($csv_header as $column_name) {\n\n $_company[$column_name] = (isset($company[$column_name])) ? $company[$column_name] : '';\n\n }\n\n $_company[\"売上高\"] = str_replace(\",\", \"\", $_company[\"売上高\"]);\n $_company[\"資本金\"] = str_replace(\",\", \"\", $_company[\"資本金\"]);\n\n $company = $_company;\n //var_dump($company);\n\n //1ページ分の会社データ\n $companies[] = $company;\n //var_dump($companies);\n\n }\n\n //重複する各ページの広告PRの会社データを削除\n if (isset($PR) === false){\n //echo \"PRなし\". \"\\n\";\n } else {\n $delete = array_shift($companies);\n //var_dump($delete);\n }\n\n $result = array_merge($result, $companies);\n //var_dump($result);\n }\n\n // タイムゾーンを世界標準時間(UTC)から東京に変更 ※php.iniで設定可能\n date_default_timezone_set('Asia/Tokyo');\n\n //CSVファイル作成\n $f = fopen(\"${today}.csv\", \"w\");\n stream_filter_prepend($f, 'convert.iconv.utf-8/cp932');\n // 正常にファイルを開くことができていれば、書き込みます。\n if ($f) {\n // $ary から順番に配列を呼び出して書き込みます。\n foreach ($result as $line) {\n //var_dump($line);\n // fputcsv関数でファイルに書き込みます。\n fputcsv($f, $line);\n }\n }\n // ファイルを閉じます。\n fclose($f);\n\n // スクレイピングできた結果を登録する\n foreach($result as $line){\n var_dump($line[\"会社名\"]);\n\n // 会社テーブルにデータを追加\n DB::table('companies')->insert(\n [\n 'company_id' => $line[\"会社ID\"],\n 'employment_site_id' => $line[\"サイトID\"],\n 'company_name' => $line[\"会社名\"],\n 'phone_number' => $line[\"電話番号\"],\n 'mail_address' => $line[\"メールアドレス\"],\n 'home_page_url' => $line[\"ホームページ\"],\n 'ceo' => $line[\"代表者\"],\n 'capital_stock' => $line[\"資本金\"],\n 'sales' => $line[\"売上高\"],\n 'created_at' => date(\"Y-m-d H:i:s\"),\n 'updated_at' => date(\"Y-m-d H:i:s\")\n ]\n );\n }\n //[\"会社ID\", \"サイトID\", \"会社名\", \"電話番号\", \"メールアドレス\", \"ホームページ\", \"代表者\", \"資本金\", \"売上高\"];\n\n //array_unshift($result, $csv_header);\n //print_r($result);\n\n }", "public function jalan() {\n return \"Hewan ini berjalan<br/>\";\n }", "function apostrophe() {\n global $lang;\n $this->doc .= $lang['apostrophe'];\n }", "public function luas_Persegi()\n {\n $hitung = $this->lebar * $this->panjang;\n return $hitung;\n }", "static public function name() : string {\n return \"русский язык\";\n \n }", "function truc(string $arg):string{\n return $arg . ' yo <br/>';\n }", "static private function ___translate___()\n {\n _('RECORD\\Farthest %1$s from Sagittarius A*');\n }", "public function HienThiBinhLuan0(){\n\t\t$this->db->where('KichHoat', '0');\n\t\treturn $this -> db -> get('b_cmt');\n\t}", "function DanhMuc_Them(&$loi){\t\n\t\n\t\t$thanhcong=true;\n\t\t\n\t\t$quocgia = $_POST[quocgia];settype($quocgia,\"int\");\n\t\t$idMien = $_POST[idMien];settype($idMien,\"int\");\n\t\t$TenDM_KS = $this->processData($_POST[TenDM_KS]);\n\t\t$TenDM_KS_KD = $this->processData($_POST[TenDM_KS_KD]);\n\t\t$Title = $this->processData($_POST[Title]);\n\t\t$MetaD = $this->processData($_POST[MetaD]);\n\t\t$MetaK = $this->processData($_POST[MetaK]);\n\t\t\n\t\t$ThuTu = $this->ThuTuMax('dvt_ks_danhmuc') + 1;\n\t\t\n\t\t$AnHien = $_POST[AnHien];settype($AnHien,\"int\");\n\t\t\n\t\tif($Title==\"\") $Title=$TenDM_KS;\n\t\tif($MetaD==\"\") $MetaD=$TenDM_KS;\n\t\tif($MetaK==\"\") $MetaK=$TenDM_KS;\n\t\tif($TenDM_KS_KD==\"\") $TenDM_KS_KD = $this->changeTitle($TenDM_KS);\n\t\t\n\t\tif($idMien==0 && $quocgia==0)\n\t\t{\n\t\t\t$thanhcong= false;\n\t\t\t$loi[idMien]= \"Chọn miền\";\n\t\t}\n\t\tif($TenDM_KS==\"\")\n\t\t{\n\t\t\t$thanhcong= false;\n\t\t\t$loi[TenDM_KS]= \"Chưa nhập tên danh mục\";\n\t\t}\n\t\n\t\tif($thanhcong==false){\n\t\t\treturn $thanhcong;\n\t\t}else{\n\t\t\t$sql = \"INSERT INTO dvt_ks_danhmuc \n\t\t\t\t\tVALUES(NULL,$quocgia,$idMien,'$TenDM_KS','$TenDM_KS_KD','$Title','$MetaD','$MetaK',$ThuTu,$AnHien)\";\n\t\t\tmysql_query($sql) or die(mysql_error().$sql);\t\t\n\t\t}\n\t\treturn $thanhcong;\n\t}", "function jourSemaine() {\n $jour = 'vendredi'; // variable locale\n return $jour;\n}", "function titleKeyWords()\n\t{\n\t\tif(isset($_REQUEST['questionID']))\n\t\t{\n\t\t\t//print strip_tags(myTruncate(get_forum_nameByAphorismID($_REQUEST['questionID']), 100, ' ', ' ... ')).' - Фрази, афоризми, умни мисли, забавни изказвания, лозунги и др';\n\t\t}\n\t\telse \n\t\t{\n\t\t\tprint 'Фрази, афоризми, умни мисли, забавни изказвания, лозунги и др';\n\t\t}\n\t\n\t}", "function tr($key){\n// global $lang;\n $lang = \"nl\";\n if (isset($_COOKIE['lng']))\n $lang = $_COOKIE['lng'];\n switch($key){\n case 'Prijzen' :\n\t\t\tswitch($lang){\n\t\t\t\tcase 'nl':\n\t\t\t\t\treturn \"Prijzen\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'fr':\n\t\t\t\t\treturn \"Prix\";\n\t\t\t\t\tbreak;\n\t\t\t\tdefault :\n\t\t\t\t\treturn 'Rates';\n\t\t\t} \n break;\n case 'Omgeving' :\n\t\t\tswitch ($lang){\n\t\t\t\tcase 'nl':\n\t\t\t\t\treturn \"Omgeving\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'fr' :\n\t\t\t\t\treturn \"Environs\";\n \tdefault :\n\t\t\t\t\treturn \"Surroundings\";\n\t\t\t}\n break;\n }\n return \"\";\n}", "function aturan3($word = '')\n {\n if (substr($word, 0, 3) == 'ber' and preg_match('/^[aiueo]/', substr($word, 3, 1)) == 0 and substr($word, 3, 1) != 'r' and substr($word, 5, 2) == 'er' and preg_match('/^[aiueo]/', substr($word, 7, 1)) == 1) {\n return true;\n } else {\n return false;\n }\n }", "public function chengzhangjilu(){\n \t\n\n \t$this->display();\n }", "function ting($ting){\r\n\tswitch ($ting){\r\n\t\tcase \"T1\":\r\n\t\t$tkt=\"TINGKATAN SATU\";\r\n\t\tbreak;\r\n\t\tcase \"T2\":\r\n\t\t$tkt=\"TINGKATAN DUA\";\r\n\t\tbreak;\r\n\t\tcase \"T3\":\r\n\t\t$tkt=\"TINGKATAN TIGA\";\r\n\t\tbreak;\r\n\t\tcase \"T4\":\r\n\t\t$tkt=\"TINGKATAN EMPAT\";\r\n\t\tbreak;\r\n\t\tcase \"T5\":\r\n\t\t$tkt=\"TINGKATAN LIMA\";\r\n\t\tbreak;\r\n\t\tcase \"P\":\r\n\t\t$tkt=\"PERALIHAN\";\r\n\t\tbreak;\r\n\t\tcase \"D1\":\r\n\t\t$npep=\"TAHUN SATU\";\r\n\t\tbreak;\r\n\t\tcase \"D2\":\r\n\t\t$tkt=\"TAHUN DUA\";\r\n\t\tbreak;\r\n\t\tcase \"D3\":\r\n\t\t$tkt=\"TAHUN TIGA\";\r\n\t\tbreak;\r\n\t\tcase \"D4\":\r\n\t\t$tkt=\"TAHUN EMPAT\";\r\n\t\tbreak;\r\n\t\tcase \"D5\":\r\n\t\t$tkt=\"TAHUN LIMA\";\r\n\t\tbreak;\r\n\t\tcase \"D6\":\r\n\t\t$tkt=\"TAHUN ENAM\";\r\n\t\tbreak;\r\n\t}\r\nreturn $tkt;\r\n}", "public function percobaan3()\n {\n \t$a = \"Kurniawan\";\n \treturn view ('latihan.saya', compact('a'));\n }", "public function Teksti2(){\n\t\t$this->teksti2=(\"sot po mbahet provimi ne lenden\");\n\t\techo $this->teksti2;\n\t}", "function buenosDias(){\n return \"Hola! buenos días!!\".salto;\n}", "function yumusamaCheck($kelime){\n\t\t// $sondanIkinci = mb_substr($kelime, -2, -1);\n\t\t// // eger sondan ikinci unlu degilse yumusama olamaz\n\t\t// if(!in_array($sondanIkinci, UNLULER)) return -1;\n\t\t$sonHarf = mb_substr($kelime, -1);\n\t\tif($sonHarf === \"b\") {\n\t\t\treturn mb_substr($kelime, 0 ,mb_strlen($kelime)-1).\"p\";\n\t\t}\n\t\tif($sonHarf === \"c\") {\n\t\t\treturn mb_substr($kelime, 0 ,mb_strlen($kelime)-1).\"ç\";\n\t\t}\n\t\tif($sonHarf === \"d\") {\n\t\t\treturn mb_substr($kelime, 0 ,mb_strlen($kelime)-1).\"t\";\n\t\t}\n\t\tif($sonHarf === \"g\") {\n\t\t\treturn mb_substr($kelime, 0 ,mb_strlen($kelime)-1).\"k\";\n\t\t}\n\t\tif($sonHarf === \"ğ\") {\n\t\t\treturn mb_substr($kelime, 0 ,mb_strlen($kelime)-1).\"k\";\n\t\t}\n\t\treturn -1;\n\t}", "static function ProcessHindiPhonetic($word)\n\t\t{\n\t\t\t$word=strtolower($word);\n\t\t\t$k=1;\n\t\t\t$word1=\"D\";\t\n\t\t\t$n=strlen($word);\n\t\t\t$word1[0]=$word[0];\n\t\t\tfor($i=1;$i<=($n-1);$i++)\n\t\t\t{\n\t\t\t\tif($word[$i]!='e' && $word[$i]!='o')\n\t\t\t\t{\n\t\t\t\t\tif($word[$i]==$word[$i-1]);\n\t\t\t\t\telse $word1[$k++]=$word[$i];\n\t\t\t\t}\n\t\t\t\telse $word1[$k++]=$word[$i];\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t/* Process the word */\n\t\t\t\n\t\t\t$word=$word1;\n\t\t\t$n=strlen($word);\n\t\t\t$result=\"S\";\n\t\t\t$k=0;\n\t\t\t//if($word[0]=='e') $word[0]='i';\n\t\t\tif($word==\"mein\" || $word==\"main\")\n\t\t\t{\n\t\t\t\t$result=\"me\";\n\t\t\t}\n\t\t\telse if($word==\"hain\" || $word==\"hai\")\n\t\t\t{\n\t\t\t\t$result=\"he\";\n\t\t\t}\n\t\t\telse if ($word==\"hun\" || $word==\"hoon\")\n\t\t\t{\n\t\t\t\t$result=\"hu\";\n\t\t\t}\n\t\t\telse \n\t\t\t{\n\t\t\tfor($i=0;$i<(strlen($word)+1);$i++)\n\t\t\t{\n switch($word[$i])\n {\n case 'a' :\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif($i==0)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//$result[$k++]='a';\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\t\t\t\t\t\t\t\t\tif($word[$i+1]=='e')\n {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//echo Hello;\n $result[$k++]='e';\n $i++;\n }\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\telse if($word[$i+1]=='i')\n {\n if($i+2==$n)\n {\n $result[$k++]='a';\n $result[$k++]='i';\n $i++;\n }\n else \n {\n $result[$k++]='e';\n $i++;\n }\n }\n else if($word[$i+1]=='y' && $i+2==$n)\n {\n $result[$k++]='a';\n $result[$k++]='i';\n $i++;\n }\n \n else if($word[$i+1]=='u')\n {\n $result[$k++]='o';\n $i++;\n }\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\telse if($i+1==$n)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$result[$k++]='a';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\telse $result[$k++]='a';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\telse \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif($word[$i+1]=='e')\n {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//echo Hello;\n $result[$k++]='e';\n $i++;\n }\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\telse if($word[$i+1]=='i')\n {\n if($i+2==$n)\n {\n $result[$k++]='a';\n $result[$k++]='i';\n $i++;\n }\n else \n {\n $result[$k++]='e';\n $i++;\n }\n }\n else if($word[$i+1]=='y' && $i+2==$n)\n {\n $result[$k++]='a';\n $result[$k++]='i';\n $i++;\n }\n \n else if($word[$i+1]=='u')\n {\n $result[$k++]='o';\n $i++;\n }\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\telse if($i+1==$n)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$result[$k++]='a';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n break;\n \n case 'b' : $result[$k++]='b'; break;\n case 'c' : $result[$k++]='c'; break;\n case 'd' : $result[$k++]='d'; break;\n case 'e' : if($i==0)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$result[$k++]='i';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n else if($word[$i+1]=='e')\n {\n if($word[$i+2]=='y');\n else $result[$k++]='i';\n $i++;\n }\n else if($word[$i+1]=='i' && $word[$i+2]=='n')\n {\n $result[$k++]='e';\n $i=$i+2;\n }\n else if($word[$i+1]=='i')\n {\n $result[$k++]='i';\n $i++;\n }\n else $result[$k++]='e'; \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n break;\n \n case 'f' : $result[$k++]='f'; break;\n case 'g' : if($word[$i+1]=='h')\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$result[$k++]='g';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$i++;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\telse $result[$k++]='g'; break;\n case 'h' : \n \n if($i+1==$n && ($word[$i-1]=='a' || $word[$i-1]=='e' || $word[$i-1]=='g' || $word[$i-1]=='j' || $word[$i-1]=='u'));\n else $result[$k++]='h';\n break;\n \n case 'i' : if($word[$i+1]=='y') ;\n \n else $result[$k++]='i'; break;\n case 'j' : if($word[$i+1]=='h')\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$result[$k++]='j';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$i++;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\telse $result[$k++]='j'; break;\n case 'k' : $result[$k++]='k'; break;\n case 'l' : $result[$k++]= 'l'; break;\n case 'm' : $result[$k++]='m'; break;\n case 'n' : $result[$k++]='n'; break;\n case 'o' :if($word[$i+1]=='n' && $i==$n-2)\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\t\t\t\t\t\t\t\t$result[$k++]='o';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$i++;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n else if($word[$i+1]=='w' || $word[$i+1]=='v' || $word[$i+1]=='u')\n {\n \n $result[$k++]='o';\n $i++;\n }\n else if($word[$i+1]=='o')\n {\n if($word[$i-1]=='r' && ($word[$i-2]=='m' || $word[$i-2]=='n' || $word[$i-2]=='v' || $word[$i-2]=='b' || $word[$i-2]=='g' || $word[$i-2]=='k'))\n {\n $result[$k++]='i';\n }\n else $result[$k++]='u';\n $i++;\n } \n else $result[$k++]='o'; break;\n case 'p' : \n if ($word[$i+1]=='h')\n {\n $result[$k++]='f';\n $i++;\n }\n else $result[$k++]='p';\n break;\n \n case 'q' : $result[$k++]='k'; break;\n case 'r' : $result[$k++]='r'; break;\n case 's' : if($word[$i+1]=='h')\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$result[$k++]='s';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$i++;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\telse $result[$k++]='s'; break;\n case 't' : if($word[$i+1]=='h')\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$result[$k++]='t';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$i++;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\telse $result[$k++]='t'; break;\n case 'u' : \n if($word[$i-1]=='r' && ($word[$i-2]=='m' || $word[$i-2]=='n' || $word[$i-2]=='v' || $word[$i-2]=='b' || $word[$i-2]=='g' || $word[$i-2]=='k'))\n {\n $result[$k++]='i';\n }\n else $result[$k++]='u'; break; \n case 'v' : $result[$k++]='v'; break;\n case 'w' : $result[$k++]='v'; break;\n case 'x' : \n $result[$k++]='k';\n $result[$k++]='s';\n break;\n \n case 'y' : \n if($i==strlen($word)-1)\n $result[$k++]='i';\n else $result[$k++]='y';\n break;\n case 'z' : if($word[$i+1]=='h')\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$result[$k++]='g';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$i++;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\telse $result[$k++]='j'; break;\n case '1' : $result[$k++]='1'; break;\n\t\t\t\t\t\t\t\t\t\t\t\t case '2' : $result[$k++]='2'; break;\n\t\t\t\t\t\t\t\t\t\t\t\t case '3' : $result[$k++]='3'; break;\n\t\t\t\t\t\t\t\t\t\t\t\t case '4' : $result[$k++]='4'; break;\n\t\t\t\t\t\t\t\t\t\t\t\t case '5' : $result[$k++]='5'; break;\n\t\t\t\t\t\t\t\t\t\t\t\t case '6' : $result[$k++]='6'; break;\n\t\t\t\t\t\t\t\t\t\t\t\t case '7' : $result[$k++]='7'; break;\n\t\t\t\t\t\t\t\t\t\t\t\t case '8' : $result[$k++]='8'; break;\n\t\t\t\t\t\t\t\t\t\t\t\t case '9' : $result[$k++]='9'; break;\n\t\t\t\t\t\t\t\t\t\t\t\t case '0' : $result[$k++]='0'; break;\n\t\t\t\t\t\t\t\t\t\t\t\t default : ;\n }\n }\n\t\t\t}\n return $result;\n\t\t}", "function getChambrehospi(){\n return $this->chambre;\n }", "public function getSpeechLanguage()\n {\n \treturn Tools::getSpeechLanguage($this->language_flag)['short'];\n }", "public function keliling()\n {\n return 2*($this->panjang + $this->lebar);\n }", "function tep_an_zen_to_han($string) {\n return mb_convert_kana($string, \"a\");\n}", "function encodeTuulo'Esse($text)\r\n\t{\r\n\t\t// Activate tanya following line manka antaed\r\n\t\t// $text = \"=?{$sina->charSet}?B?\".base64_encode($text).\"?=\";\r\n\t\treturn $text;\r\n\t}", "function queryword()\n\t{\n\t\t$sql=\"select id_word, frequency, word from $this->lang_frequency where word >= '$this->word' LIMIT 1\";\n\t\t$fs = mysql_query($sql,$this->db);\n\t\t$rs=mysql_fetch_row($fs);\n\t\t//dumpa ($rs);\n\t\t$err=mysql_error($this->db);\n\t\tif ($err)\n\t\t{\n\t\t\techo \"<br>$sql <br> $err<hr>\";\n\t\t}\n\n\t\t$id=$rs[0];\n\t\t$feq=$rs[1];\n\t\t//echo \"<span>$word con id = $id e freq di $feq<br>$sql<br></span>\";\n\t\tif ($id<=25)\n\t\t{\n\t\t $idn=0;\n\t\t $pos=$id-1;\n\t\t}\n\t\telse\n\t\t{\n\t\t $idn=$id-26;\n\t\t $pos=25;\n\t\t}\n\t\t$this->wordfreq=$feq;\n\t\t$this->id=$id;\n\t\t$this->idn=$idn;\n\t\t$this->pos=$pos;\n\t\t$this->wordfound=$rs[2];\n\t}", "function soogiHind($taisHind, $soodusKaart = false, $kasOledOpilane = false){\n $soodusHind = $taisHind;\n $soodustusProtsent = 15;\n $opilaseToetus = 1.80; // €\n\n if($soodusKaart){\n $soodusHind = $taisHind * (100 - $soodustusProtsent) / 100;\n }\n if($kasOledOpilane){\n $soodusHind -= $opilaseToetus;\n }\n return $soodusHind;\n}", "public function getQuand() {\n\t\treturn $this->quand;\n\t}", "public function run()\n {\n function loaibotiengvietTeacher ($str){\n\n $unicode = array(\n\n 'a'=>'á|à|ả|ã|ạ|ă|ắ|ặ|ằ|ẳ|ẵ|â|ấ|ầ|ẩ|ẫ|ậ',\n\n 'd'=>'đ',\n\n 'e'=>'é|è|ẻ|ẽ|ẹ|ê|ế|ề|ể|ễ|ệ',\n\n 'i'=>'í|ì|ỉ|ĩ|ị',\n\n 'o'=>'ó|ò|ỏ|õ|ọ|ô|ố|ồ|ổ|ỗ|ộ|ơ|ớ|ờ|ở|ỡ|ợ',\n\n 'u'=>'ú|ù|ủ|ũ|ụ|ư|ứ|ừ|ử|ữ|ự',\n\n 'y'=>'ý|ỳ|ỷ|ỹ|ỵ',\n\n 'A'=>'Á|À|Ả|Ã|Ạ|Ă|Ắ|Ặ|Ằ|Ẳ|Ẵ|Â|Ấ|Ầ|Ẩ|Ẫ|Ậ',\n\n 'D'=>'Đ',\n\n 'E'=>'É|È|Ẻ|Ẽ|Ẹ|Ê|Ế|Ề|Ể|Ễ|Ệ',\n\n 'I'=>'Í|Ì|Ỉ|Ĩ|Ị',\n\n 'O'=>'Ó|Ò|Ỏ|Õ|Ọ|Ô|Ố|Ồ|Ổ|Ỗ|Ộ|Ơ|Ớ|Ờ|Ở|Ỡ|Ợ',\n\n 'U'=>'Ú|Ù|Ủ|Ũ|Ụ|Ư|Ứ|Ừ|Ử|Ữ|Ự',\n\n 'Y'=>'Ý|Ỳ|Ỷ|Ỹ|Ỵ',\n\n );\n\n foreach($unicode as $nonUnicode=>$uni){\n\n $str = preg_replace(\"/($uni)/i\", $nonUnicode, $str);\n\n }\n\n return $str;\n\n }\n// DB::table('teachers') -> truncate();\n $firstName = ['Nguyễn','Chu','Vương','Nhiếp','Trần','Hoàng','Lê','Lý','Mai','Phạm'];\n $surName = ['Nhật','Bảo','Mỹ','Minh','Bá','','Thanh'];\n $lastName = ['Sang','Vượng','Hoàng','Hùng','Điệp','Anh','Chi','Hương','Tươi'];\n for ($i=0;$i<20;$i++){\n $name1 = $firstName[mt_rand(0,count($firstName)-1)];\n $name2 = $surName[mt_rand(0,count($surName )- 1)];\n $name3 = $lastName[mt_rand(0,count($lastName )- 1)];\n DB::table('teachers')->insert([\n [\n\n 'teacherName' => $name1.' '.$name2.' '.$name3,\n 'joiningDate' =>'2017-'.mt_rand(1,12).'-'.mt_rand(1,28),\n 'email' => loaibotiengvietTeacher($name1).loaibotiengvietTeacher($name2).loaibotiengvietTeacher($name3).mt_rand(1000,9000).'@gmail.com',\n 'address' => str_random(10),\n 'gender' => mt_rand(0,1),\n 'dateOfBirth' => '19'.mt_rand(80,94).'-'.mt_rand(1,12).'-'.mt_rand(1,28),\n 'phone' => '0'.mt_rand(0,9).mt_rand(0,9).mt_rand(0,9).mt_rand(0,9).mt_rand(0,9).mt_rand(0,9).mt_rand(0,9).mt_rand(0,9),\n 'created_at' => \\Illuminate\\Support\\Carbon::now(),\n 'updated_at' => \\Illuminate\\Support\\Carbon::now(),\n ],\n\n ]);\n }\n\n }", "function subraya($text){\r\n return \"<u>$text</u>\";\r\n }", "function hapusawalan2($kata){\n if(substr($kata,0,3)==\"ber\"){\n $kata = substr($kata,3);\n }else if(substr($kata,0,3)==\"bel\"){\n $kata = substr($kata,3);\n }else if(substr($kata,0,2)==\"be\"){\n $kata = substr($kata,2);\n }else if(substr($kata,0,3)==\"per\" && strlen($kata) > 5){\n $kata = substr($kata,3);\n }else if(substr($kata,0,2)==\"pe\" && strlen($kata) > 5){\n $kata = substr($kata,2);\n }else if(substr($kata,0,3)==\"pel\" && strlen($kata) > 5){\n $kata = substr($kata,3);\n }else if(substr($kata,0,2)==\"se\" && strlen($kata) > 5){\n $kata = substr($kata,2);\n }\n return $kata;\n }", "public function Latir() { //Irá receber da superclasse,apenas alteramos para o que queremos.\n return ' <b>Latiu alto!</b>'; // Retorne o latido\n parent::Latir();\n }", "public function inFrisian()\n {\n return $this->getTranslationIn('fy');\n }", "function filtrele($isim){\n return $isim . \" \" . 'Bayrak';\n }", "function ucapan($g,$u){\n\tif($g == \"Wanita\" && $u > 24 ){\n\t\t$ucapan = \"Ibu\";\n\t}elseif($g == \"Pria\" && $u > 24 ){\n\t\t$ucapan = \"Bapak\";\n\t}elseif($g == \"Pria\"){\n\t\t$ucapan = \"Saudara\";\n\t}else{\n\t\t$ucapan = \"Saudari\";\n\t}\n\treturn $ucapan;\n}", "function smarty_modifier_koujpn($string)\n{\n\t// あかがねで校Noを日本語で出力する\n\t// 他のプロジェクトに持って行っても意味がない\n\tif (isset($string) == false) {\n\t\treturn '';\n\t}\n\tif ($string == '0') {\n\t\treturn '-';\n\t}\n\tif ($string == '-1') {\n\t\treturn '校了';\n\t}\n\tif ($string == '1') {\n\t\treturn '初校';\n\t}\n\tif ($string == '2') {\n\t\treturn '再校';\n\t}\n\tif ($string == '999') {\n\t\treturn '校了';\n\t}\n\n\treturn $string . '校';\n}", "public function Latir() { //Irá receber da superclasse,apenas alteramos para o que queremos.\n return ' <b>Latiu baixo!</b>'; // Retorne o latido\n parent::Latir();\n }", "function bq_get_quotes() {\n\t/** These are quotes from A P J Abul Kalam */\n $quotes=[\n \"“স্বপ্ন বাস্তবায়ন না হওয়া পর্যন্ত তোমাকে স্বপ্ন দেখে যেতে হবে” – Abdul Kalam\",\n \"“স্বপ্ন সেটা নয় যেটা তুমি ঘুমিয়ে ঘুমিয়ে দেখো | স্বপ্ন হলো সেটাই যা পূরণের অদম্য ইচ্ছা তোমায় ঘুমাতে দেবে না” – Abdul Kalam\",\n \"“একটা কথা পরিষ্কার, সৃষ্টিকর্তা তাদেরই সহায় থাকেন, যারা কঠোর পরিশ্রম করেন” – Abdul Kalam\",\n \"“যদি সূর্যের মতো উজ্জ্বল হতে চাও, তাহলে তোমাকেই প্রথমে সূর্যের মত পুড়তে হবে” – Abdul Kalam\",\n \"“সফলতার গল্পে কেবল একটা বার্তা থাকে কিন্তু ব্যর্থতার গল্পে সফল হওয়ার উপায় থাকে” – Abdul Kalam\",\n \"“স্বপ্ন দেখতে হবে, স্বপ্ন থেকেই চিন্তার জন্ম হয় আর চিন্তা জন্ম দেয় কাজের” – Abdul Kalam \",\n \"“আমরা শুধু সাফল্যের উপরই গড়ি না, আমরা অসফলতার উপরেও গড়ি” – Abdul Kalam\",\n \"“জটিল কাজে বেশি আনন্দ পাওয়া যায়, তাই সফলতার আনন্দ পাওয়ার জন্য মানুষের কাজ জটিল হওয়া উচিত” – Abdul Kalam\",\n \"“ব্যর্থতা নামক রোগের সবথেকে ভালো অসুধ হলো আত্মবিশ্বাস আর কঠোর পরিশ্রম, এটা আপনাকে একজন সফল মানুষ করে তুলবে” – Abdul Kalam \",\n \"“নির্দিষ্ট লক্ষ্য, ক্রমাগত জ্ঞান সঞ্চয় করা, কঠোর পরিশ্রম ও হার না মানা মনোভাব – এই চারটি জিনিস মেনে চললে যেকোনো কিছুকেই লাভ করা যেতে পারে” – Abdul Kalam\"\n ];\n\n\t// And then randomly choose a line.\n\tprintf(wptexturize( $quotes[ mt_rand( 0, count( $quotes ) - 1 ) ] ));\n}", "public function getChapeau();", "function __($cadena) {\n return idioma::traducir($cadena);\n}", "function php07($coordenada, $text_des, $text_tam){\n\t$texto_n = '';\n\tfor($i = 0; $i < strlen($text_des); $i++){\n\t\tif ($i >= $coordenada){\n\t\t\tif ($j < $text_tam) {\n\t\t\t\t$texto_n = $texto_n . $text_des[$i];\n\t\t\t\t$j++;\n\t\t\t}\n\t\t}\n\t}\n\treturn $texto_n;\n}", "public function daftar_nama_side_unit(){\n\t\t/*return $w = $this->db->query(\"select * from unit WHERE kode_unit='\".$this->get_session_unit().\"' AND kode_bahasa='\".$this->lang.\"' \")->result();*/\n\t\t//$query = \"SELECT * from unit WHERE kode_unit='67' AND kode_bahasa='id'\";\n\t\t$query = \"SELECT * FROM unit WHERE kode_unit = '\".$this->get_session_unit().\"' AND kode_bahasa = '\".$this->lang.\"'\";\n\t\t$sql = $this->db->query($query);\n\t\treturn $sql->row_array();\n\t}", "public static function homeSentence() {\n $q = self::getQ();\n $nb_result = self::nbContactsSelected();\n $sentence = \"\";\n $sentence .= \"Vous avez \";\n if(!empty($q)) {\n $sentence .= $nb_result;\n if ($nb_result > 1) {\n $sentence .= \" résultats\";\n } else {\n $sentence .= \" résultat\";\n }\n $sentence .= \" pour (\";\n $sentence .= \\Phonebook\\Controllers\\ContactsController::getQ();\n $sentence .= \") parmi vos \";\n }\n $sentence .= \\Phonebook\\Controllers\\ContactsController::nbContactsTotal();\n $sentence .= \" contacts dans l'annuaire\";\n echo $sentence;\n }", "public function language();", "public function language();", "function luasLingkaran($nilai){\r\n return pi() * pow($nilai, 2);\r\n }", "public function calcula13o()\n {\n }", "public function calcula13o()\n {\n }", "function aturan7($word = '')\n {\n if (substr($word, 0, 3) == 'ter' and preg_match('/^[aiueo]/', substr($word, 3, 1)) == 0 and substr($word, 3, 1) != 'r') {\n if (substr($word, 4, 2) == 'er' and preg_match('/^[aioue]/', substr($word, 6, 1))) {\n return true;\n } else {\n return false;\n }\n } else {\n return false;\n }\n }", "function horaire($horaire) {\r\n\t// affiche un nombre d'heures correctement formatté\r\n\t$horaire = ($horaire && $horaire !=='')? $horaire.\" h\":\"\";\r\n\treturn $horaire;\r\n}", "function difundir() {\n $frase = $this->obtener_frase();\n echo $frase;\n }", "function kaloriusia($u, $tb, $g){\n\tif($u <=39){\n\t\t$kbu = \"0 kkal \";\n\t}else if($u >=40 && $u <= 59){\n\t\t$kbu = kalorinormal($g, $tb) * 0.05;\n\t}else if($u >=60 && $u <= 69){\n\t\t$kbu = kalorinormal($g, $tb) * 0.1;\n\t}else if($u >69){\n\t\t$kbu = kalorinormal($g, $tb) * 0.2;\n\t}\nreturn $kbu;\n}", "function frase_mayuscula($frase){\n $frase = strtoupper($frase);\n return $frase;\n }", "function hello_yoda() {\n\t$chosen = hello_yoda_get_quotes();\n\t$lang = '';\n\tif ( 'en_' !== substr( get_user_locale(), 0, 3 ) ) {\n\t\t$lang = ' lang=\"en\"';\n\t}\n\n\tif(current_user_can('activate_plugins')){\n\t\tprintf(\n\t\t\t'<p id=\"vader\"><span class=\"screen-reader-text\">%s </span><span dir=\"ltr\"%s>%s</span></p>',\n\t\t\t__( 'Quote from Darth Vader:', 'hello-yoda' ),\n\t\t\t$lang,\n\t\t\t$chosen\n\t\t);\n\t} else{\n\t\tprintf(\n\t\t'<p id=\"yoda\"><span class=\"screen-reader-text\">%s </span><span dir=\"ltr\"%s>%s</span></p>',\n\t\t__( 'Quote from Master Yoda:', 'hello-yoda' ),\n\t\t$lang,\n\t\t$chosen\n\t\t);\n\t}\n\t\n}", "public function getLieu(): string\r\n {\r\n return $this->Lieu;\r\n }", "public function get_quote(){ return $this->_quote;}", "function ambil_soal() { \n $tampil = $this->db->query(\"SELECT * FROM IKD.IKD_D_SOAL_QUISIONER ORDER BY KD_SOAL ASC\")->result_array();\n\t\treturn $tampil;\n }", "public function getInfoLengkap(){\n $str = \"{$this->tipe} : {$this->judul} | {$this->getLable()} (Rp. {$this->harga}\";\n if($this->tipe == \"Komik\"){\n $str .= \" - ($this->jmlHalaman) Halaman.\";\n }elseif ($this->tipe == \"Game\"){\n $str .= \" ~ ($this->waktuMain) Jam.\";\n }\n return $str;\n }", "private static function getComputeHinduArabicTable () : iterable {\n yield 21 => ['x', 10];\n yield 30 => ['xx', 20];\n yield 40 => ['xxx', 30];\n yield 50 => ['xl', 40];\n yield 60 => ['l', 50];\n yield 70 => ['lx', 60];\n yield 80 => ['lxx', 70];\n yield 90 => ['lxxx', 80];\n yield 100 => ['xc', 90];\n yield 200 => ['c', 100];\n yield 300 => ['cc', 200];\n yield 400 => ['ccc', 300];\n yield 500 => ['cd', 400];\n yield 600 => ['d', 500];\n yield 700 => ['dc', 600];\n yield 800 => ['dcc', 700];\n yield 900 => ['dccc', 800];\n yield 1000 => ['cm', 900];\n }", "public function inHebrew()\n {\n return $this->getTranslationIn('iw');\n }", "public function translated();", "public function translated();", "function shwe_16_pell_to_15_pell($kyat){\n $ans = $kyat * 17;\n $ans = $ans / 16;\n return $ans;\n}", "function getNota_txt()\n {\n $nota_txt = 'Hollla';\n $id_situacion = $this->getId_situacion();\n switch ($id_situacion) {\n case '3': // Magna\n $nota_txt = 'Magna cum laude (8,6-9,5/10)';\n break;\n case '4': // Summa\n $nota_txt = 'Summa cum laude (9,6-10/10)';\n break;\n case '10': // Nota numérica\n $num = $this->getNota_num();\n $max = $this->getNota_max();\n $nota_txt = $num . '/' . $max;\n if ($max == 10) {\n if ($num > 9.5) {\n $nota_txt .= ' ' . _(\"Summa cum laude\");\n } elseif ($num > 8.5) {\n $nota_txt .= ' ' . _(\"Magna cum laude\");\n }\n }\n break;\n default:\n $oNota = new Nota($id_situacion);\n $nota_txt = $oNota->getDescripcion();\n break;\n }\n return $nota_txt;\n }", "function mot($chaine){\r\n $retourFinal = \"faux\";\r\n for($i=0;$i<laTaille($chaine);$i++){\r\n if(testAlphabet($chaine[$i])==\"vrai\"){\r\n $retour[$i]=\"vrai\";\r\n }\r\n else{\r\n $retour[$i]=\"faux\";\r\n }\r\n }\r\n $j=0;\r\n while($j<laTaille($chaine) && $retour[$j]==\"vrai\"){\r\n $j++;\r\n }\r\n if($j==laTaille($chaine)){\r\n $retourFinal = \"vrai\";\r\n }\r\n return $retourFinal;\r\n }", "function shwe_15_pell_to_16_pell($kyat){\n $ans = $kyat * 16;\n $ans = $ans / 17;\n return $ans;\n}" ]
[ "0.6427929", "0.63461685", "0.60312176", "0.6025998", "0.60145795", "0.59233946", "0.5895751", "0.5890389", "0.5853857", "0.5835168", "0.58096004", "0.5798686", "0.57635856", "0.5703562", "0.57004607", "0.56936824", "0.5686732", "0.5610148", "0.5608752", "0.56046915", "0.55826366", "0.55614114", "0.5560897", "0.55503285", "0.5526767", "0.55130225", "0.5504286", "0.55042034", "0.550091", "0.5495212", "0.54844475", "0.54705244", "0.54703075", "0.54652447", "0.5463813", "0.54616547", "0.5460077", "0.5448866", "0.54467493", "0.54403585", "0.5438153", "0.54338986", "0.54245603", "0.5409989", "0.540441", "0.53970283", "0.5396913", "0.53904355", "0.53868926", "0.5381596", "0.5375308", "0.53707844", "0.5367895", "0.53563863", "0.53447646", "0.5327975", "0.53264344", "0.53231597", "0.53161985", "0.5310167", "0.528876", "0.527949", "0.5276747", "0.52725786", "0.52719873", "0.5271285", "0.52688026", "0.5268597", "0.52642673", "0.52584654", "0.52572423", "0.5252086", "0.52517736", "0.52460927", "0.524499", "0.52449423", "0.52386403", "0.52211756", "0.5210473", "0.5210473", "0.5210232", "0.52038014", "0.52038014", "0.52021617", "0.52006716", "0.52000475", "0.51987803", "0.519588", "0.5180272", "0.5175638", "0.51652175", "0.51608855", "0.5158083", "0.5155804", "0.515382", "0.515143", "0.515143", "0.5150637", "0.5141281", "0.5138282", "0.51366407" ]
0.0
-1
lay danh sach sub cat info
function get_cat_sub($cat_id,$level=0) { global $table_catcontent, $db; $list_info_cat=($level==0)?"(-1":""; $list_info_cat = $list_info_cat.",".$cat_id; $subcat_num = Check_sub_info($table_catcontent,$db," WHERE parent_id = '".$cat_id."'"); if ($subcat_num>0) { $sql_query = "SELECT * FROM `" . $table_catcontent . "` WHERE parent_id='".$cat_id."' ORDER BY priority_order ASC"; $sql_query = mysql_query($sql_query); while($sql_query_rows = mysql_fetch_array($sql_query)) { $list_info_cat = $list_info_cat.get_cat_sub($sql_query_rows['id'],1); } } return ($level==0)?$list_info_cat.")":$list_info_cat; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showSubCategory()\n\t {\n\t\t\n\t\t $prolist=new Actions();\n\t\t $res=$prolist->fetchAll(\"category\");\n\t\t\t\t\t\t\n\t\t $parentdata=mysql_query(\"select * from category where cat_par_id='0'\");\n\t\t while($parent_sub_cat=mysql_fetch_array($parentdata))\n\t\t {\n\t\t\techo '<option value=\"'.$parent_sub_cat['cat_id'].'\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'.ucfirst($parent_sub_cat['cat_title']).'</option>';\n\t\t \t\t\t\n\t\t\t if(mysql_num_rows(mysql_query(\"select * from category where cat_par_id='\".$parent_sub_cat['cat_id'].\"'\"))>0)\n\t\t\t {\n\t\t\t\tActions::$r++;\n\t\t\t\tActions::viewCategory($parent_sub_cat['cat_id']);\n\t\t\t } \n\t\t\t \n\t\t }\t\t\t\t\t\t\n\t\t \n\t }", "public function cat(){\n $cat_id = intval(I('get.cat_id'));\n if(!$cat_id){\n http_response_code(404);\n }\n\n $display = cookie('display');\n if($display) {\n if (!preg_match(\"/^list|grid$/\", $display)) {\n die('hack out');\n }else{\n if($display == 'list') {\n $this->assign('display', 1);\n }else{\n $this->assign('display', 0);\n }\n }\n }\n $this->assign('cat_id', $cat_id);\n $mbx = D('Admin/cat')->parentList($cat_id);\n if($mbx){\n $this->assign('mbx',$mbx);\n }\n\n $cat_in_nav = M('cat')->field('cat_id,cat_name')->where('show_in_nav=1')->select();\n $this->assign('cat_in_nav',$cat_in_nav);\n $his = array_reverse(session('history'),true);\n $this->assign('history',$his);\n $sale = M('goods')->field('goods_id,goods_name,thumb_img,shop_price,goods_number')->order('goods_number desc')->limit(10)->select();\n $this->assign('sale',$sale);\n $this->assign('cattree',D('Admin/Cat')->gettree());\n\n $this->assign('cat_name', M('cat')->field('cat_name')->find($cat_id)['cat_name']);\n\n $this->display();\n }", "private function _getLolcat()\n {\n $query = 'select id, title from flickr.photos.search(50) where tags=\"lolcat\" or text=\"lolcat\"';\n\n $array = $this->grabData($query);\n $stuff = $array['query']['results']['photo'];\n \n $id = $stuff[array_rand($stuff)]['id'];\n $title = $stuff[array_rand($stuff)]['title'];\n \n $sizes = $this->grabData('select source from flickr.photos.sizes where photo_id = '. $id);\n \n $this->_message($this->_data->nick.': '. $title .' => '. $sizes['query']['results']['size'][3]['source']);\n \n }", "function showSubCategory($arr)\n\t{\n\t\t$output ='<div id=\"9\" class=\"anylinkcss\" style=\"width: 160px; background-color: #f7f7f5\">';\n\t\t$cnt=count($arr);\n\t\tfor($i=0;$i<$cnt;$i++)\n\t\t\t$output .='<a href=\"#\">'.$arr[$i]['SubCategory'].'</a>';\n\t\t$output.='</div>';\n\t\treturn $output;\n\t}", "function display_cat()\n {\n $this->Admin_model->procedure = 'GET_POST_CAT';\n\n $rs = $this->Admin_model->get_post();\n $data['rows'] = $rs;\n $this->load->view('display_posts_cat', $data);\n\n }", "function showMainCatLanding($arr)\n\t{\n\t\t$output='<div class=\"quickview_border\" style=\"margin-top:14px;\">\n\t\t<div class=\"heading1\"><span class=\"headingTXT\">Sub Categories</span></div>\n\t\t<div style=\"padding:15px 0 5px 0\">\n \t\t\t<table width=\"100%\" border=\"0\" cellpadding=\"2\" cellspacing=\"2\">';\n\t\t$loop=0;\n\t\t$cnt= count($arr);\n\t\tfor($i=0;$i<$cnt;$i++)\n\t\t{\n\t\t\tif($loop==3)\n\t\t\t{\n\t\t\t\t$output.='</tr>';\n\t\t\t\t$loop=0;\n\t\t\t}\t\t\n\t\t\tif($loop==0)\n\t\t\t\t$output.='<tr>';\n\t\t\t\n\t\t\t\n\n\t\t\tif(trim($arr[$i]['image'])!='')\n\t\t\t{\n\t\t\t\t$img=explode('/',$arr[$i]['image']);\n\t\t\t\t$thumb=''.$_SESSION['base_url'].'/uploadedimages/caticons/'.$img[2];\n\t\t\t\t$img=(file_exists($thumb)) ? '<img src=\"'.$thumb.'\" width=\"'.THUMB_WIDTH.'\" border=\"0\" />' :\n\t\t\t\t\t'<img src=\"'.$_SESSION['base_url'].'/images/noimage1.jpg\" width=\"'.THUMB_WIDTH.'\" border=\"0\" />';\n\t\t\t}\n\t\t\telse\n\t\t\t\t$img='<img src=\"'.$_SESSION['base_url'].'/images/noimage1.jpg\" width=\"'.THUMB_WIDTH.'\" border=\"0\" />';\n\t\t\t\n\t\t\t$output.='<td id=\"product_tbbg\">\n\t\t\t<table width=\"100%\" border=\"0\" align=\"left\" cellpadding=\"2\" cellspacing=\"2\">\n\t\t\t\t<tr><td align=\"center\">\n\t\t\t\t\t\t<a href=\"'.$_SESSION['base_url'].'/index.php?do=featured&action=showfeaturedproduct&subcatid='.$arr[$i]['subcatid'].'\">'.$img.'</a>\n\t\t\t\t</td></tr>\n\t\t\t\t<tr><td class=\"featureTXT\">\n\t\t\t\t\t<div align=\"center\"><a href=\"'.$_SESSION['base_url'].'/index.php?do=featured&action=showfeaturedproduct&subcatid='.$arr[$i]['subcatid'].'\" class=categoriesList>'.$arr[$i]['SubCategory'].'</a>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t</td></tr>\n\t\t\t</table>';\n\t\t\t$loop++;\n\t\t}\n\t\treturn $output.='</table></div></div>';\t\n\t}", "function setup_cat()\n {\n $this->ipsclass->DB->simple_construct( array( \"select\" => 'perms_view, def_view, id, name', 'from' => 'gallery_categories', 'where' => \"id={$this->ipsclass->input['cat']}\" ) );\n $this->ipsclass->DB->simple_exec(); \n $cat = $this->ipsclass->DB->fetch_row();\n\n // Are we allowed to view this category?\n if( ! $this->ipsclass->check_perms( $cat['perms_view'] ) )\n {\n $this->ipsclass->Error( array( 'LEVEL' => 1, 'MSG' => 'no_permission' ) ); \n }\n\n return $cat;\n }", "function get_catname($cat_id)\n {\n }", "function showCategory()\n\t {\n\t\t\n\t\t $res=mysql_query(\"select * from category\");\n\t\t while($data=mysql_fetch_array($res))\n\t\t {\n\t\t\t\n\t\t\techo '<option value=\"'.$data['cat_id'].'\">'.$data['cat_title'].'</option>';\n\t\t }\n\t\t \n\t }", "public function prodCatCaption($catid){\t\t\n\t\t\t\t$cat \t\t\t\t= \t\"\";\n\t\t\t\t$arrayValues2 \t\t=\tarray('caption');\n\t\t\t\t$retArray2 \t\t\t=\tself::retrieveEntry(\"itemcategory\", $arrayValues2, \"\", \"id='$catid' AND status='published'\");\n\t\t\t\tforeach ($retArray2 as $retIndex => $retValue){\n\t\t\t\t\t$$retIndex \t\t=\t$retValue;\n\t\t\t\t\t$mainArr \t\t=\texplode('|', $$retIndex);\n\t\t\t\t\t$cat\t\t \t=\t$mainArr[0];\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t}\t\t\t\t\n\t\t\t\treturn $cat;\n\t}", "function get_linkcatname($id = 0)\n {\n }", "function dataSubCategory( $parentcategory, $gcntyn=false ){\n\n\tglobal $db, $sess;\n\n\t$arrfileurl = explode('/',$_SERVER['SCRIPT_FILENAME']);\n\tif(in_array(\"m\", $arrfileurl) || in_array(\"m2\", $arrfileurl)){\n\t\t$hidden = \"hidden_mobile=0\";\n\t} else {\n\t\t$hidden = \"hidden=0\";\n\t}\n\t# 카테고리 정보\n\tfor ($i=0;$i<2;$i++){\n\t\t$length = strlen($parentcategory) + 3;\n\t\t$query = \"\n\t\tselect\n\t\t\tcategory,catnm,sort,level,level_auth\n\t\tfrom\n\t\t\t\".GD_CATEGORY.\"\n\t\twhere\n\t\t\tcategory like '$parentcategory%'\n\t\t\tand length(category)=$length\n\t\t\";\n\t\tif ($GLOBALS[ici_admin] === false) $query .= \"and \".$hidden;\n\t\t$res = $db->query($query);\n\n\t\tif ($db->count_($res)) break;\n\t\telse if ($length>6) $parentcategory = substr($parentcategory,0,-3);\n\t}\n\n\t// 상품 개수 추출 및 상품분류 연결방식 전환 여부에 따른 처리\n\tif ( $gcntyn == true && _CATEGORY_NEW_METHOD_ === false ){\n\t\tif ($GLOBALS[ici_admin] === false) $where[] = \"a.\".$hidden;\n\t\t$where[] = \"a.category like '$parentcategory%'\";\n\t\t$where[] = \"open\";\n\t\tif ($GLOBALS['tpl']->var_['']['connInterpark']) $where[] = \"b.inpk_prdno!=''\";\n\n\t\t$query = \"\n\t\tselect\n\t\t\tleft(category,$length),count(distinct a.goodsno)\n\t\tfrom\n\t\t\t\".GD_GOODS_LINK.\" a,\n\t\t\t\".GD_GOODS.\" b\n\t\twhere\n\t\t\ta.goodsno = b.goodsno\n\t\t\tand \".implode(\" and \", $where).\"\n\t\tgroup by left(category,$length)\n\t\t\";\n\t\t$res2 = $db->query($query);\n\t\twhile ($data2=$db->fetch($res2)) $gcnt[$data2[0]] = $data2[1];\n\t}\n\n\t### 데이타 조작\n\t$i = 0;\n\twhile ($data=$db->fetch($res)){\n\t\t// 상품 개수 추출 및 상품분류 연결방식 전환 여부에 따른 처리\n\t\tif ($gcntyn == true && _CATEGORY_NEW_METHOD_ === true) {\n\t\t\t$where\t= array();\n\t\t\tif ($GLOBALS[ici_admin] === false) $where[] = \"gl.hidden=0\";\n\t\t\t$where[] = \"gl.category = '\".$data['category'].\"'\";\n\t\t\t$where[] = \"g.open = '1'\";\n\t\t\tif ($GLOBALS['tpl']->var_['']['connInterpark']) $where[] = \"g.inpk_prdno!=''\";\n\n\t\t\t$query = \"\n\t\t\tSELECT\n\t\t\t\tCOUNT(g.goodsno) as cnt\n\t\t\tFROM\n\t\t\t\t\".GD_GOODS.\" g\n\t\t\tINNER JOIN\n\t\t\t\t\".GD_GOODS_LINK.\" gl ON g.goodsno = gl.goodsno\n\t\t\tWHERE\n\t\t\t\t\".implode(\" AND \", $where).\"\n\t\t\t\";\n\n\t\t\t$res2 = $db->query($query);\n\t\t\twhile ($data2=$db->fetch($res2, 1)) $gcnt[$data['category']] = $data2['cnt'];\n\t\t}\n\n\t\t$member_auth = false;\n\t\tif($data['level']){//권한 설정되어 있는지 체크\n\t\t\tswitch($data['level_auth']){//권한체크\n\t\t\t\tcase '1': //모두숨김\n\t\t\t\t\tif( (!$sess['level'] ? 0 : $sess['level']) >= $data['level'] ) $member_auth = true;\n\t\t\t\t\tbreak;\n\t\t\t\tdefault: $member_auth = true; break;\n\t\t\t}\n\t\t}\n\t\telse $member_auth = true;\n\n\t\tif($member_auth){\n\t\t\t$data['gcnt'] = $gcnt[ $data['category'] ];\n\t\t\t$cate[$data[sort]][] = $data;\n\t\t}\n\t}\n\n\t### 배열 순서 재정의\n\tif ($cate) $cate = resort($cate);\n\n\treturn $cate;\n}", "public function categorie()\n {\n $data[\"categories\"]=$this->categories->list();\n $this->template_admin->displayad('categories' , $data);\n }", "function category(){\n\n\t\t\t$header['title']=\"Find Page\";//title\n\t\t\t$data=[];//dataa\n\t\t\t$sidebar['getUpdate'] = $this->_actionModel->getAllDataByUpdate_time();\n\t\t\t$keyword = $_GET['cat'] ?? '';//get key\n\t\t\t$keyword = trim($keyword);//cat bo khaong trong 2 dau\n\t\t\t$data['keyword'] = $keyword;// key-> value\n\n\t\t\t$page = $_GET['page'] ?? '';//tim $_page\n\t\t\t$page = (is_numeric($page) && $page >0) ? $page : 1;//kiem tra xem co phai so khong\n\t\t\t//Chu thich lau qa =.=\n\t\t\t\n\t\t\t$dataLink =[\n\t\t\t\t'c' => 'action',\n\t\t\t\t'm' => 'category',\n\t\t\t\t'page'=> '{page}',\n\t\t\t\t'cat' => $keyword\n\t\t\t];//giong o tren r`\n\t\t\t$links = $this->_actionModel->create_link_manga($dataLink);//tao links\n\t\t\t//die($links);//die ra coi thu DL thoi \n\n\t\t\t$manga=$this->_actionModel->getAllDataMangaByKeywordCategory($keyword);//cai ten noi len tat ca\n\n\t\t\t$panigate = panigation(count($manga), $page, 4,$keyword,$links);//panigate la phan trang r`\n\t\t\t$data['mangas'] = $this->_actionModel->getDataMangaByCategory($panigate['keyword'],$panigate['start'],$panigate['limit']);//lay manga theo category con gif\n\t\t\t//echo\"<pre/>\";print_r($data['mangas']);die();//die ra coi DL thoi xoa di lay j coi du lieu ?? !\n\t\t\t$data['panigation'] = $panigate['panigationHtml']; //nhu o tren r` chu thich j` nua.\n\t\t\t$this->loadHeader($header); //nhu o tren r` chu thich j` nua.\n\t\t\t$this->loadActionPage($data); //nhu o tren r` chu thich j` nua.\n\t\t\t$this->loadSidebarPage($sidebar); //nhu o tren r` chu thich j` nua.\n\t\t\t$this->loadFooter(); //nhu o tren r` chu thich j` nua.\n\t\t}", "function get_cat(){\n\tglobal $con;\n\n\t\n\t$get_cats = \"select * from category\";\n\n\t$run_cats = mysql_query($get_cats);\n\t\n\n\t//$row_cats = mysql_fetch_array($run_cats);\n\n\twhile($row_cats = mysql_fetch_array($run_cats)){\n\n\t\t$cat_id = $row_cats['cat_id'];\n\t\t$cat_title = $row_cats['cat_title'];\n\n\t\t//echo \"<p>$cat_title</p>\";\n\t\techo'<span href=\"#\" class=\"elect-category\" id=\"category-type\">'; echo \"$cat_title\";echo'</span>';\n\n\t}\n\t\n\n}", "function get_sub_cat($cat_main, $catrow )\n{\n\tglobal $db;\n\n\tif ($cat_main > 0)\n\t{\n\t\t$sql= \"SELECT * FROM \".CATEGORIES_TABLE.\" WHERE cat_id <> $cat_main AND cat_main=$cat_main\";\n\t\tif( !($result = $db->sql_query($sql)) ) message_die(GENERAL_ERROR, 'Could not query categorie sons '.$sql, '', __LINE__, __FILE__, $sql);\n\t\twhile ( $catw = $db->sql_fetchrow($result) )\n\t\t{\n\t\t\t$i = count($catrow);\n\t\t\t$catrow[$i] = $catw;\n\t\t\tif ($catw['cat_id'] > 0)\n\t\t\t\t$catrow = get_sub_cat($catw['cat_id'],$catrow);\n\t\t}\n\t}\n\treturn $catrow;\n}", "function displaySubCategory($subcatid)\n\t{\n\n\n\t\t$id=(int)$_GET['id'];\n\t\t\n\t\tif($_GET['id']!='')\n\t\t{\n\t \t\tif(is_int($id))\n\t\t \t{\n\t\t\t\t$sql = \"SELECT * FROM category_table where category_parent_id=\".$subcatid.\" AND sub_category_parent_id=0 \" ;\n\t\t\t\t\n\t\t\t\t$query = new Bin_Query();\n\t\t\t\t\n\t\t\t\t$query->executeQuery($sql);\n\t\t\t\t\n\t\t\t\treturn Display_DManageProducts::displaySubCategory($query->records,$subcatid);\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\n\t\t\t$sqlpro=\"SELECT * FROM products_table WHERE product_id ='\".$_GET['prodid'].\"'\";\n\t\t\t$objpro=new Bin_Query();\n\t\t\t$objpro->executeQuery($sqlpro);\n\t\t\t$subcatid=$objpro->records[0]['category_id'];\n\t\t\t$subselected=$objpro->records[0]['sub_category_id'];\n\t\t\t\t\t\t\n\t\t\t$sql = \"SELECT * FROM category_table where category_parent_id=\".$subcatid.\" AND sub_category_parent_id=0\" ;\n\t\t\t\n\t\t\t$query = new Bin_Query();\n\t\t\t\n\t\t\t$query->executeQuery($sql);\n\t\t\t\n\t\t\treturn Display_DManageProducts::displaySubCategory($query->records,$subselected);\n\t\t}\n\t\t\t\n\t}", "function select_category($type,$level='',$id=''){\r\n // level = 1 : gom ca cac danh sach chu de con\r\n global $mysql,$lang,$moshtml,$table_prefix;\r\n if($level=='' || !$level){\r\n $code[] = array(0,$lang['lang.cat_cat']);\r\n }\r\n if($id){\r\n $s = \"and id<> \".$id.\"\";\r\n }else{\r\n $s = '';\r\n }\r\n $q = $mysql->query(\"select id, title from \".$table_prefix.\"category where cfor='\".$type.\"' \".$s.\" and subid=0 order by corder ASC\");\r\n while($r=$mysql->fetch_array($q)){\r\n $total_sub = $mysql->num_rows($mysql->query(\"select id from \".$table_prefix.\"category where cfor='\".$type.\"' and subid=\".$r['id'].\"\"));\r\n $code[] = array($r['id'],\"-&nbsp;\".$r['title']);\r\n if($level!='' && $total_sub){\r\n $q2 = $mysql->query(\"select id, title from \".$table_prefix.\"category where cfor='\".$type.\"' and subid=\".$r['id'].\" order by corder ASC\");\r\n while($r2=$mysql->fetch_array($q2)){\r\n $code[] = array($r2['id'],'&nbsp;&nbsp;|--&nbsp;'.$r2['title']);\r\n }\r\n }\r\n }\r\nreturn $code;\r\n}", "function get_cat_name($cat_id)\n {\n }", "public function get_cat_name() {\n $c = $this->cat;\n $tmp = \"\";\n switch($c) {\n case 1:\n $tmp = \"News\";\n break;\n case 2:\n $tmp = \"Eventi\";\n break;\n case 3:\n $tmp = \"Pubblicazioni\";\n break;\n }\n return $tmp;\n }", "public static function catDetails($url)\n {\n $catDetails = Category::select('id','parent_id','category_name','url','description')->with(['subcategories'=>function($query){$query->select('id','parent_id','category_name','url')->where('status',1);\n }])->where('url', $url)->first()->toArray();\n\n if($catDetails['parent_id']==0)\n {\n //Only show Main category in Brandcrumb\n $brandcrumbs = '<a href=\"'.url($catDetails['url']).'\" >'.$catDetails['category_name'].'</a>';\n }\n else{\n //Show main and sub Category in Brandcrumb\n $parentCategory = Category::select('category_name','url')->where('id',$catDetails['parent_id'])->first()->toArray();\n $brandcrumbs = '<a href=\"'.url($parentCategory['url']).'\" >'.$parentCategory['category_name'].'</a>&nbsp;&nbsp;<a href=\"'.url($catDetails['url']).'\" >'.$catDetails['category_name'].'</a>';\n }\n $catIds = array();\n $catIds[] = $catDetails['id'];\n\n foreach ($catDetails['subcategories'] as $key => $subcat) {\n $catIds[] = $subcat['id'];\n }\n return array('catIds'=>$catIds, 'catDetails'=>$catDetails, 'brandcrumbs'=>$brandcrumbs); \n }", "function showCategory()\r\n {\r\n }", "function get_sub_category_info( $sub_cate_id, $sub_cate_status = 0 )\n\t{\n\t\t$criteria = $sub_cate_status == 1 ? \"sub_cate_status = 1 AND \" : \"\";\n\t\t$q = \"SELECT * FROM title_dev_sub_categories WHERE \".$criteria.\" sub_cate_id = \".$sub_cate_id;\n\t\t$r = $this -> db -> getSingleRecord( $q );\n\t\tif( $r )\n\t\t\treturn $r;\n\t\telse\n\t\t\treturn false;\n\t}", "public function _get_category($cat){\n\t\t$jumlah_category = substr_count($cat,\",\");\n\t\t$cat_a = explode(',',$cat);\n\t\t$j_cat = 0;\n\t\t$cat_result = \"\";\n\t\twhile ($j_cat <= $jumlah_category){\n\t\t$cat_me = $cat_a[\"$j_cat\"];\n\t\t$cat_link2 = strtolower($cat_me);\n\t\t$cat_link2 = str_replace(\" \", \"-\", $cat_link2);\n\t\t$cat_result .= \"<a href='\".APP_URL.\"/\".uri_category.\"/$cat_link2'> $cat_me</a> , \";\n\t\t$j_cat++;\n\t\t}\n\t\treturn $cat_result;\n\t}", "function showCatMenu() {\n\t\t$template['list'] = $this->cObj2->getSubpart($this->templateCode,'###TEMPLATE_CATMENU_MAIN###');\n\t\t$markerArray = array();\n\t\t$markerArray['###ITEMS###'] = $this->displayCatMenu();\n\n\t\t$content = $this->cObj2->substituteMarkerArrayCached($template['list'], $markerArray);\n\t\treturn $content;\n\t}", "function displayCategory($catid)\n\t{\n\t\t$sql = \"SELECT category_id,category_name FROM category_table where category_parent_id=0\";\n\t\t\n\t\t$query = new Bin_Query();\n\t\t\n\t\t$query->executeQuery($sql);\n\n\t\t$id=$_GET['prodid'];\n\n\t\tif(((int)$id)>0)\n\t\t{\n\t\t\t$sql1='select * from products_table where product_id='.$id;\t\t\n\t\t\t$obj1=new Bin_Query();\t\t\t\n\t\t\t$obj1->executeQuery($sql1);\t\t\t\t\t\t\n\t\t\t$category=$obj1->records[0]['category_id'];\n\t\t\t\n\t\t\n\t \t}\n\t\t\n\t\treturn Display_DManageProducts::displayCategory($query->records,$category);\t\n\t}", "function showCats($id) {\n\tglobal $cats;\n\tif (!isset($cats[$id])) {\n\t\treturn;\n\t}\n\techo '<ul>';\n\tforeach ($cats[$id] as $cat) {\n\t\techo '<li id=\"cat_'.$cat['id'].'\"><a href=\"javascript:;\"';\n\t\tif ($cat['enabled']=='0') {\n\t\t\techo ' class=\"disabled\"';\n\t\t}\n\t\techo '>'.htmlspecialchars($cat['name']).'</a>';\n\t\tshowCats($cat['id']);\n\t\techo '</li>';\n\t}\n\techo '</ul>';\n}", "function get_cat($cat_id)\n{\n\tglobal $db;\n\t// phpBB 2.0.9\n\t$category_rows = array();\n\t//\n\tif ($cat_id <= 0)\n\t $cat_id = -1;\n\tif ($cat_id > 0)\n\t{\n\t\t$sql = \"SELECT * FROM \" . CATEGORIES_TABLE . \" WHERE cat_id=$cat_id\";\n\t\tif ( !($result = $db->sql_query($sql)) ) message_die(GENERAL_ERROR, 'Could not query this categories', '', __LINE__, __FILE__, $sql);\n\t\tif ( !($row = $db->sql_fetchrow($result)) ) $cat_id = -1;\n\t}\n\t//\n\t// no cat selected : get all\n\tif ($cat_id <= 0)\n\t{\n\t\t//-- v 1.0.5\n\t\t$sql = \"SELECT * FROM \" . CATEGORIES_TABLE . \" ORDER BY cat_order\";\n\t\t//-- \n\t\tif ( !($result = $db->sql_query($sql)) ) message_die(GENERAL_ERROR, 'Could not query categories list', '', __LINE__, __FILE__, $sql);\n\t\twhile ( $row = $db->sql_fetchrow($result) ) $category_rows[] = $row;\n\t}\n\t//\n\t// a cat selected : get it and its sub-cats\n\tif ($cat_id > 0)\n\t{\n\t\t// add the current one\n\t\t$catrow[] = $row;\n\t\t// get sub-cats\n\t\t$catrow = get_sub_cat($cat_id,$catrow);\n\t\t// get cats\n\t\t//-- v 1.0.5\n\t\t$sql = \"SELECT * FROM \" . CATEGORIES_TABLE . \" ORDER BY cat_order\";\n\t\t//--\n\t\tif( !($result = $db->sql_query($sql)) ) message_die(GENERAL_ERROR, 'Could not query categories list', '', __LINE__, __FILE__, $sql);\n\t\twhile ($row = $db->sql_fetchrow($result) )\n\t\t{\n\t\t\t$found = false;\n\t\t\tfor ($i=0;( $i<count($catrow) && (!$found) );$i++) $found = ($row['cat_id'] == $catrow[$i]['cat_id']);\n\t\t\tif ($found) $category_rows[] = $row;\n\t\t}\n\t}\n\treturn $category_rows;\n}", "function print_categories( $thisId ) { \n $thisCat = get_the_category( $thisId );\n foreach( $thisCat as $cat ) {\n echo $cat->slug . \" \";\n }\n}", "public function show_rekapkat(){\n // load library to cek user session and level\n $this->pageauth->sess_auth();\n $this->load->model('pages/m_crud_forecast');\n $query = $this->m_crud_forecast->select_cat();\n echo \"<option>- PILIH -</option>\";\n foreach ($query->result() as $row){\n echo \"<option value='$row->cat_code'>\" . $row->cat_desc . \"</option>\";\n }\n }", "function read_Categories() {\n\n\t\tglobal $myCategories;\n\t\tglobal $gesamt;\n\t\t\n\t\t$i = 0;\n\t\t\n\t\tforeach ($myCategories as $catInfo):\n\t\t\n\t\t$test=$myCategories->category[$i]['typ'];\n\t\t\n\t\tarray_push($gesamt, $test);\n\t\t\n\t\t$i++;\n\t\tendforeach;\t\n\t\t\n\t}", "function suprsubcategry(){\n\t\t\t$this->layout = 'ajax';\n\t\t\t$this->loadModel('Category');\n\t\t\t$cateid = $_REQUEST['cate_id'];\n\t\t\t$suprsub = $_REQUEST['suprsub'];\n\t\t\t\n\t\t\t$catsdata = array();\n\t\t\tif($suprsub == 'yes'){\n\t\t\t\t$catsdata = $this->Category->find('all',array('conditions'=>array('category_parent'=>$cateid,'category_sub_parent'=>0)));\n\t\t\t}else{\n\t\t\t\t$catsdata = $this->Category->find('all',array('conditions'=>array('category_sub_parent'=>$cateid)));\n\t\t\t}\n\t\t\t\n\t\t\tif(!empty($catsdata)){\n\t\t\t\tforeach($catsdata as $cts){\n\t\t\t\t\t$cats_arr[] = array('ID'=>$cts['Category']['id'],'Name'=>$cts['Category']['category_name']);\n\t\t\t\t}\n\t\t\t\t// [ { \"ID\" :\"1\", \"Name\":\"Scott\"},{ \"ID\":\"2\", \"Name\":\"Jon\"} ]\n\t\t\t\t// print_r($cats_arr);\n\t\t\t\techo json_encode($cats_arr);\n\t\t\t}else{\n\t\t\t\techo 0;\n\t\t\t}\n\t\t\tdie;\n\t\t}", "public function get_all_info_cat_sub() {\n\t\t\n\t\t$query = $this->db->prepare(\"SELECT categories.cat_id,subcategories.subc_id,subcategories.subc_name, categories.cat_name, company_info.info_logo, company_info.info_address, users.user_id,users.user_confirmed,users.admin_confirmed, users.user_name, users.user_email, users.user_comp_name, users.user_number, users.client_cat_id, client_cat.client_cat_id, users.user_time, client_cat.client_cat_name FROM client_cat LEFT JOIN users ON users.client_cat_id = client_cat.client_cat_id right join company_info on company_info.user_id=users.user_id right join categories on categories.cat_id=company_info.cat_id LEFT JOIN subcategories ON subcategories.subc_id=company_info.subc_id \n\");\n\t\t\n\t\t\n\t\ttry{\n\t\t\t\n\t\t\t$query->execute();\n\t\t\t$result = $query->fetchAll();\n\t\t\treturn $result;\n\t\t}catch(PDOException $e){\n\n\t\t\tdie($e->getMessage());\n\t\t}\n\t}", "function show_cats2($cats_grouped_by_parent, $parent_id = 0) {\n\t\t\t\tglobal $baseurl;\n\t\t\t\tglobal $loc_slug;\n\t\t\t\tglobal $loc_type;\n\t\t\t\tglobal $loc_id;\n\t\t\t\tglobal $cat_items_count;\n\n\t\t\t\tif($parent_id == 0) {\n\t\t\t\t\techo '<ul class=\"cat-tree cat-main-parent\">';\n\t\t\t\t} else {\n\t\t\t\t\techo '<ul class=\"cat-tree\">';\n\t\t\t\t}\n\n\t\t\t\t/*\n$tree .= '<a href=\"' . $baseurl . '/' . $loc_slug . '/list/' . $cat_slug3 . '/' . $loc_type . '-' . $loc_id . '-' . $cat_id3 . '-1\">' . $plural_name3 . \"($this_cat_count3)\" . '</a>';\n\t\t\t\t*/\n\n\t\t\t\tif(!empty($cats_grouped_by_parent)) {\n\t\t\t\t\tforeach ($cats_grouped_by_parent[$parent_id] as $v) {\n\t\t\t\t\t\t$this_cat_slug = (!empty($v['plural_name'])) ? to_slug($v['plural_name']) : to_slug($v['cat_name']);\n\t\t\t\t\t\t$this_cat_name = (!empty($v['plural_name'])) ? $v['plural_name'] : $v['cat_name'];\n\t\t\t\t\t\t$this_cat_id = $v['cat_id'];\n\t\t\t\t\t\t$this_iconfont_tag = (!empty($v['iconfont_tag'])) ? $v['iconfont_tag'] : '';\n\t\t\t\t\t\t$this_cat_count = (!empty($cat_items_count[$this_cat_id])) ? $cat_items_count[$this_cat_id] : 0;\n\n\t\t\t\t\t\techo '<li data-cat-id=\"' . $v['cat_id'] . '\"> ';\n\t\t\t\t\t\t\techo \"<a href='$baseurl/$loc_slug/list/$this_cat_slug/$loc_type-$loc_id-$this_cat_id-1'>\n\t\t\t\t\t\t\t\t$this_iconfont_tag $this_cat_name ($this_cat_count)</a>\";\n\n\n\n\t\t\t\t\t\t\t//if there are children\n\t\t\t\t\t\t\tif (!empty($cats_grouped_by_parent[$this_cat_id])) {\n\t\t\t\t\t\t\t\tshow_cats2($cats_grouped_by_parent, $this_cat_id);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\techo '</li>';\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\techo '</ul>';\n\t\t\t}", "public function showTVShowCategories(){\n $querry=$this->con->prepare(\"SELECT * from categories\");\n $querry->execute();\n\n\n $html=\"<div class='previewCategories'>\n <h1>TV Shows</h1>\";\n\n //Keep on Appending the HTML OF EACH CATEGORY\n while($row=$querry->fetch(PDO::FETCH_ASSOC)){ //This loop working needs investigation\n $html.=$this->getCategoyHtml($row,null,true,false);\n }\n\n //Return the whole html to print\n return $html.\"</div>\";\n }", "public function simpleDraw(){\n\t\t$pile = array();\n\t\t$root = array();\n\t\t$root['deep'] = 0;\n\t\t$root['cat'] = $this;\n\t\t$pile[] = $root;\n\n\t\twhile(count($pile)){\n\t\t\t$cat_array = array_pop($pile);\n\t\t\t$cat = $cat_array['cat'];\n\t\t\t$deep = $cat_array['deep'];\n\n\t\t\t\tfor($i =0; $i<$deep ; $i++){\n\t\t\t\techo '|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';\n\t\t\t}\n\t\t\techo (($cat->hasSubCategories())?'|-':'&nbsp;&nbsp;');\n\t\t\techo '\t'.$cat->getLabel().'<br/>';\n\n\t\t\tforeach($cat->getSubCategories() as $c){\n\t\t\t\t$s = array();\n\t\t\t\t$s['deep'] = $deep + 1;\n\t\t\t\t$s['cat'] = $c;\n\t\t\t\t$pile[] = $s;\n\t\t\t}\n\t\t}\n\t}", "function categorianivel($padre)\n{\n\tglobal $con;\n\t\n\t$query_ConsultaFuncion = sprintf(\"SELECT * FROM pages WHERE name!='' AND padre = %s\",\n\tGetSQLValueString($padre, \"int\"));\n\t\n\t$ConsultaFuncion = mysqli_query($con, $query_ConsultaFuncion) or die(mysqli_error($con));\n\t$row_ConsultaFuncion = mysqli_fetch_assoc($ConsultaFuncion);\n\t$totalRows_ConsultaFuncion = mysqli_num_rows($ConsultaFuncion);\n\n\tif ($totalRows_ConsultaFuncion > 0) {\n\t\tdo {\n\t\t\t?> \n\t\t<div class=\"sub_cat\">\n\t\t\t<ul>\n\t\t\t\t<li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<?php echo $row_ConsultaFuncion['name']?></li>\n\t\t\t</ul>\n\t\t</div>\n\t<?php\n\t\t} while ($row_ConsultaFuncion = mysqli_fetch_assoc($ConsultaFuncion));\n\t}\n\t\t \n\tmysqli_free_result($ConsultaFuncion);\n}", "function cat($type_url=''){\n if($this->uri->segment(1,\"\") == 'nha-dat-ban'){\n $estatesCategoryId = 1;\n $estatesCategoryName = \"Nhà đât bán\";\n $estatesCategoryUrl = $this->uri->segment(1,\"\");\n }\n if($this->uri->segment(1,\"\") == 'nha-dat-cho-thue'){\n $estatesCategoryId = 2;\n $estatesCategoryName = \"Nhà đât cho thuê\";\n $estatesCategoryUrl = $this->uri->segment(1,\"\");\n }\n if($this->uri->segment(1,\"\") == 'nhu-cau-nha-dat'){\n $estatesCategoryId = 3;\n $estatesCategoryName = \"Nhu cầu nhà đất\";\n $estatesCategoryUrl = $this->uri->segment(1,\"\");\n }\n\n $level = 2;\n $page = $this->uri->segment($level + 1,\"\") == \"\" ? 1 : $this->uri->segment($level + 1);\n $dis['page'] = $page;\n $limit = 20;\n $offset = ($page - 1)*$limit;\n\n // get type estates\n $type_url = $this->uri->segment(2, \"\");\n $type = new Estatetype();\n $type->where('name_none', $type_url)->get();\n if(!$type->exists()){\n show_404();\n }\n $dis['type'] = $type;\n\n $this->page_title = $type->name.' | '.$type->estatecatalogue->name;\n $this->page_description = $type->description;\n $this->page_keyword = $type->keyword;\n\n /*get estate vip*/\n $estatesVip = new Estate();\n $estatesVip->order_by('created', 'desc');\n $estatesVip->where_related_estatecatalogue('id', $estatesCategoryId);\n $estatesVip->where('isVip', 1);\n $estatesVip->get_paged($offset,$limit,TRUE);\n $dis['estatesVip'] = $estatesVip;\n\n /*get estates by category and type*/\n $estates = new Estate();\n $estates->order_by('isVip', 'desc');\n $estates->order_by('created', 'desc');\n $estates->where_related_estatecatalogue('id', $estatesCategoryId);\n $estates->where_related_estatetype('id', $type->id);\n\n //$estates->where('isVip', 0);\n $estates->where('active', 0);\n $estates->get_paged($offset,$limit,TRUE);\n $dis['estates'] = $estates;\n\n /*get estates by category and type*/\n $estatesAll = new Estate();\n $estatesAll->order_by('id', 'desc');\n $estatesAll->where_related_estatecatalogue('id', $estatesCategoryId);\n $estatesAll->where_related_estatetype('id', $type->id);\n //$estates->where('isVip', 0);\n $estates->where('active', 0);\n $estatesAll->get();\n $total = $estatesAll->result_count();\n\n /*Begin pagination for product*/\n $url = $this->uri->segment(1).'/'.$this->uri->segment(2);\n $config['base_url'] = site_url($url);\n $config['total_rows'] = $total;\n $config['per_page'] = $limit;\n $config['use_page_numbers'] = TRUE;\n $config['uri_segment'] = 3;\n $config['num_links'] = 3;\n $config['full_tag_open']\t\t= '<div class=\"news-pagination\">';\n $config['full_tag_close']\t\t= \"</div>\";\n $config['first_link'] \t\t\t= FALSE;\n $config['first_tag_open']\t\t= '';\n $config['first_tag_close']\t\t= '';\n $config['last_link'] \t\t\t= FALSE;\n $config['last_tag_open'] \t\t= '';\n $config['last_tag_close'] \t\t= '';\n $config['next_link']\t\t\t= '>';\n $config['next_tag_open'] \t\t= '';\n $config['next_tag_close'] \t\t= '';\n $config['prev_link'] \t\t\t= '<';\n $config['prev_tag_open'] \t\t= '';\n $config['prev_tag_close'] \t\t= '';\n $config['num_tag_open'] \t\t= '';\n $config['num_tag_close'] \t\t= '';\n $config['cur_tag_open'] \t\t= '<span class=\"active\">';\n $config['cur_tag_close']\t\t= '</span>';\n $this->pagination->initialize($config);\n /*End pagination for product*/\n\n\n\t\t$this->isRobotFollow = 1;\n $dis['estatesCategoryName']=$estatesCategoryName;\n $dis['estatesCategoryUrl']=$estatesCategoryUrl;\n $dis['atAddress'] = \"tại Việt Nam\";\n $dis['base_url']=base_url();\n $dis['view']='front/estates/cat';\n $this->viewfront($dis) ;\n }", "public function getSubSubcatDetail($subSubCat)\r\n\t{\r\n\t\t\t\t $sql= \"SELECT * FROM books WHERE subSubCat='$subSubCat'\";\r\n\t\t $result=mysql_query($sql);\r\n\t\t\t return $result;\t\r\n\t}", "function displayCategoryLinks() {\n\n\t$catquery = \"select distinct ngroup from nassets where type like '0tdn%'\";\n\t$cresults = mysql_query($catquery);\n\t$has_null = false;\n\t$categories = array();\n\twhile ($acRow = mysql_fetch_array($cresults)) {\n\t\t$thisgroup = $acRow['ngroup'];\n\t\t$categories[] = $thisgroup;\n\t}\n\t\n\n\techo \"<ul>View by Category<br>\";\n\t$size = count($categories);\n \tforeach ($categories as $category) {\n \t\techo \"<li><a href=\\\"menu2.php?category=$category\\\" target=\\\"menu2\\\">$category</a><br/></li>\";\n \t}\n\n\techo \"</ul>\";\n}", "public function get_sub_category(){\r\n $this->datatables->select('s.cat_id,s.sub_cat_id,c.cat_name,s.sub_cat_name');\r\n $this->datatables->join( 'o-cakes_category c', 's.cat_id = c.cat_id', 'left' );\r\n $this->datatables->from('o-cakes_sub_cat s');\r\n $this->datatables->where('s.sub_cat_status',1);\r\n $result = $this->datatables->generate();\r\n echo $result;\r\n }", "function abl_droploader_get_image_cat_select() {\n\t\t$image_categories = getTree('root', 'image');\n\t\t//$image_categories_select = str_ireplace(\"\\n\", '', tag('<label for=\"image-category\">' . gTxt('image_category') . '</label>' . br .\n\t\t//\ttreeSelectInput('category', $image_categories, '', 'image-category'), 'div', ' id=\"abl-droploader-image-cat-sel\" class=\"category\"'));\n\t\t//$alt_caption =\ttag('<label for=\"alt-text\">'.gTxt('alt_text').'</label>'.br.\n\t\t//\t\tfInput('text', 'alt', '', 'edit', '', '', 50, '', 'alt-text'), 'div', ' class=\"alt text\"').\n\t\t//\ttag('<label for=\"caption\">'.gTxt('caption').'</label>'.br.\n\t\t//\t\t'<textarea id=\"caption\" name=\"caption\"></textarea>'\n\t\t//\t\t, 'div', ' class=\"caption description text\"');\n\t\t$image_categories_select = str_ireplace(\"\\n\", '', tag(tag('<label for=\"image-category\">'.gTxt('image_category').'</label>'.br.\n\t\t\t\ttreeSelectInput('category', $image_categories, '', 'image-category'), 'div', ' class=\"category\"'), 'div', ' id=\"abl-droploader-image-cat-sel\"'));\n\t\treturn $image_categories_select;\n\t}", "public function categoryBreadcrumbs($sub_cat_id,$catt=0)\n\t{\t\t\n\t\tif($catt==0)\n\t\t{\n\t\t$pa=$sub_cat_id;\n\t\t$count=0;\n\t\twhile($pa!=0)\n\t\t{\n\t\t\t$query44=\"select * from `categories` where category_id=$pa\";\n\t\t\t$res44=$this->query($query44);\n\t\t\t$row44=mysql_fetch_assoc($res44);\n\t\t\t$pa=$row44['parent_id'];\n\t\t\tif($sub_cat_id == $row44['category_id'])\n\t\t\t{\n\t\t\t\t$name_arr[$count]=$row44['category_name'];\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$name_arr[$count]=\"<a href='category.php?catId=\".base64_encode($row44['category_id']).\"' class='link'>\".$row44['category_name'].\"</a>\";\n\t\t\t}\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t$count+=1;\n\t\t}\n\t\t}\t\t\n\t\treturn (@array_reverse($name_arr));\n\t\t\t\n\t\t}", "function getCategory_details($category_name)\n\t\t{\n\t\t\t$details = $this->manage_content->getValue_where('vertical_navbar','*','menu_name',$category_name);\n\t\t\techo '<div class=\"category_header\">'.$details[0]['menu_name'].'</div>\n <br /><br/>\n <div class=\"category_description\">'.$details[0]['description'].'</div>';\n\t\t}", "function target_add_cat($cat)\n{\n\tif ($GLOBALS['VERBOSE']) pf('...'. $cat['name']);\n\n\tq('INSERT INTO '. $GLOBALS['DBHOST_TBL_PREFIX'] .'cat (id, name, view_order, cat_opt) \n\t VALUES('. (int)$cat['id'] .','. _esc($cat['name']) .','. (int)$cat['view_order'] .', 3)');\n\t$GLOBALS['cat_map'][ $cat['id'] ] = $cat['id'];\n/*\nfud_use('cat.inc', true);\n$nc = new fud_cat;\n$nc->name = $c->name;\n$nc->description = $c->description;\n$nc->view_order = $c->disporder;\n$nc->cat_opt = 1|2;\t// This should be the default in cat.inc. Fix in next release and del this line.\n$GLOBALS['cat_map'][$c->fid] = $nc->add('LAST');\t// FIRST should also be defaulted.\n*/\n}", "function sportal_categories()\n{\n\tglobal $context, $scripturl, $txt;\n\n\tloadTemplate('PortalCategories');\n\n\t$context['categories'] = sportal_get_categories(0, true, true);\n\n\t$context['linktree'][] = array(\n\t\t'url' => $scripturl . '?action=portal;sa=categories',\n\t\t'name' => $txt['sp-categories'],\n\t);\n\n\t$context['page_title'] = $txt['sp-categories'];\n\t$context['sub_template'] = 'view_categories';\n}", "public static function subCatLink($subCat){\n\t\tif($subCat)\n\t\t\treturn CHtml::link($subCat->catName,array('subcat/view','id'=>$subCat->Id));\n\t\telse\n\t\t\treturn 'None';\n\t}", "public function showCategory(){\n \t$form = M(\"categoryinfo\");\n \t$data = $form->select();\n \t$data = json_encode($data);\n \techo $data;\n \t//$this->display();\n }", "function getProjectSubCategory($userData)\n\t\t{\n\t\t\t//get sub category from database\n\t\t\techo '<li class=\"pro_cat\"><a>'.$userData['category'].'</a></li>\n\t\t\t\t\t<ul class=\"profile_overview profile_1st_child_nav\">\n\t\t\t\t\t\t<li><i class=\"glyphicon glyphicon-chevron-right profile_ovr_icon\"></i><a>Sub Category 1</a></li>\n\t\t\t\t\t\t<li><i class=\"glyphicon glyphicon-chevron-right profile_ovr_icon\"></i><a>Sub Category 2</a></li>\n\t\t\t\t\t\t<li><i class=\"glyphicon glyphicon-chevron-right profile_ovr_icon\"></i><a>Sub Category 3</a></li>\n\t\t\t\t\t\t<li><i class=\"glyphicon glyphicon-chevron-right profile_ovr_icon\"></i><a>Sub Category 4</a></li>\n\t\t\t\t\t\t<li><i class=\"glyphicon glyphicon-chevron-right profile_ovr_icon\"></i><a>Sub Category 5</a></li>\n\t\t\t\t\t</ul>';\n\t\t}", "function showMainCategory($arr)\n\t{\n\t\t\n\t\t$output='<br /><div class=\"head_text\" id=\"head_text\">Browse Categories</div><div id=\"product_tbbg\" >\n\t\t<table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"2\">';\n\t\t$loop=0;\n\t\t$cnt= count($arr);\n\t\t\n\t\tfor($i=0;$i<$cnt;$i++)\n\t\t{\t\t\t\t\n\t\t\tif($loop==3)\n\t\t\t{\n\t\t\t\t$output.='</tr>';\n\t\t\t\t$loop=0;\n\t\t\t}\t\t\n\t\t\tif($loop==0)\n\t\t\t\t$output.='<tr>';\n\t\t\t\t\n\t\t\t$temp=$arr[$i]['category_image'];\n\t\t\t$img=explode('/',$temp);\t\n\t\t\t\t\n\t\t\t\t$output.='<td id=\"product_tbbg\"><table width=\"100%\" border=\"0\" align=\"left\" cellpadding=\"0\" cellspacing=\"2\"><tr><td align=\"left\"><a href=\"'.$_SESSION['base_url'].'/index.php?do=featured&action=showmaincatlanding&maincatid='.$arr[$i]['category_id'].'\">';\n\t\t\t\t$thumb=''.$_SESSION['base_url'].'/uploadedimages/caticons/'.$img[2];\n\t\t\t\tif(file_exists($thumb))\n\t\t\t\t{\n\t\t\t\t\t$output.='<img src=\"'.$thumb.'\" border=\"0\" />';\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$output.=\" <img border='0' width='95' src='\".$_SESSION['base_url'].\"/images/noimage1.jpg' />\";\n\t\t\t\t}\t\n\t\t\t\t$output.='</a></td></tr>\n <tr><td class=\"text\" align=\"left\"><a href=\"'.$_SESSION['base_url'].'/index.php?do=featured&action=showmaincatlanding&maincatid='.$arr[$i]['category_id'].'\">'.$arr[$i]['category_name'].'</a></td></tr></table></td>';\n\n\t\t\t$loop++;\t\t\t\n\t\t}\n\t\t\n\t\treturn $output.='</table></div>';\t\n\t}", "public function get_catR()\n {\n return $this->_catR;\n }", "public function showSubcategories(){\n return ArticleModel::showSubcategories();\n }", "function show_cats_dropdowns($all_cats, $main_cats) {\r\n\t\t\t\t\t\t\t\t$auto_class_cats = get_option('auto_class_cats');\r\n\t\t\t\t\t\t\t\tforeach ($main_cats as $key => $cat) {\r\n\t\t\t\t\t\t\t\t\t$selected = ($cat->term_id == $category_id) ? \" selected\" : \"\";\r\n\t\t\t\t\t\t\t\t\techo '<div data-value=\"'.$cat->term_id.'\" class=\"option'.$selected.'\" data-cat-parent=\"'.$cat->category_parent.'\"><span class=\"icon icon-level-down\"></span> '.$cat->name.'</div>';\r\n\r\n\t\t\t\t\t\t\t\t\tforeach($all_cats as $key => $subcat) {\r\n\t\t\t\t\t\t\t\t\t\tif($subcat->category_parent == $cat->term_id && !in_array($subcat->category_parent, $auto_class_cats)) {\r\n\t\t\t\t\t\t\t\t\t\t\t$sub_cats[] = $subcat;\r\n\t\t\t\t\t\t\t\t\t\t\tunset($all_cats[$key]);\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t}//foreach $c as $cat\r\n\t\t\t\t\t\t\t\t\techo '<div class=\"sub-cat\" data-subcats-for-cat=\"'.$cat->term_id.'\">';\r\n\t\t\t\t\t\t\t\t\t\tif(count($sub_cats) > 0) {\r\n\t\t\t\t\t\t\t\t\t\t\tshow_cats_dropdowns($all_cats, $sub_cats);\r\n\t\t\t\t\t\t\t\t\t\t\tunset($sub_cats);\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\techo '</div>';\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}", "public function action_cat()\n {\n $cat = $this->request->param('cat');\n $cat = mysql_real_escape_string ($cat);\n \n // Получаем список продукций\n // $category = ORM::factory('category')->where('cat_id', '=', $cat)->find();\n $category = ORM::factory('category')->where('path', '=', $cat)->find();\n\n if(!$category->loaded()){\n $this->redirect();\n }\n \n $count = $category->products->where('status', '<>', 0)->count_all();\n $pagination = Pagination::factory(array('total_items'=>$count,'items_per_page'=>2));\n $prods = array();\n $products = $category->products\n ->where('status', '<>', 0)\n ->limit($pagination->items_per_page)\n ->offset($pagination->offset)\n ->find_all();\n $prs = $category->products\n ->select('prod_cats.prod_id')\n ->where('status', '<>', 0)\n ->find_all();\n foreach ($prs as $p)\n {\n $prods[] = $p->prod_id;\n }\n if(count($prods))\n $brands = ORM::factory('brand')\n ->join('products')\n ->on('brand.brand_id', '=', 'products.brand_id')\n ->where('products.prod_id','in',$prods)\n ->group_by('brand.title')\n ->order_by('brand.title', 'ASC')\n ->find_all();\n \n \n \n //$products = $category->products->where('status', '!=', 0)->find_all();\n // $this->breadcrumbs[] = array('name' => $category->title, 'link' => '/catalog/cat/c' . $category->cat_id);\n $this->breadcrumbs[] = array('name' => $category->title, 'link' => '/catalog/cat/' . $category->path);\n $this->template->breadcrumbs = Breadcrumb::generate($this->breadcrumbs);\n \n $content = View::factory('/' . $this->theme . 'index/catalog/v_catalog_cat', array(\n 'products' => $products,\n 'cat' => $cat,\n 'pagination' =>$pagination,\n 'brands' =>$brands,\n \n ));\n \n // Выводим в шаблон\n \n $this->template->title = $category->title;\n $this->template->page_title = $category->title;\n $this->template->page_caption = $category->title;\n $this->template->center_block = array($content);\n $this->template->block_right = null; \n $filter = Filter::factory();\n $filter->loadFiltersOptions($category->cat_id);\n $this->template->filter = $filter->render();\n }", "public function getCat() {\n return DB::q_array(\"SELECT id, title, image FROM news_category WHERE published = 1\");\n }", "function build_cats($cat, $arr = array())\n\t{\n\t\t$database =& JFactory::getDBO();\n\t\t\t\n\t\t\t// keby sme sa chceli nahodou zacyklit, tak radsej skocime pri 15tej hlbke...\n\t\t\tif (sizeof($arr) > 15) return $arr;\n\t\t\t// zisti nadradenu kategoriu\n\t\t\t$sql = \"SELECT category_parent_id FROM #__vm_category_xref, #__vm_category WHERE jos_vm_category.category_id=jos_vm_category_xref.category_child_id and jos_vm_category.category_publish='Y' and jos_vm_category_xref.category_child_id ='$cat' ORDER BY category_parent_id DESC LIMIT 0,1\";\n\t\t\t$database->setQuery($sql);\n\t\t\t$parent_cat_id = $database->loadResult();\n\t\t\t//$this->logger($parent_cat_id, \"parent_cat_id for child \".$cat.$database->getErrorMsg());\n\t\t\t\n\t\t\t// zisti nazov kategorie\n\t\t\t$sql = \"SELECT category_name FROM #__vm_category WHERE category_id ='\".$cat.\"' LIMIT 0,1\";\n\t\t\t$database->setQuery($sql);\n\t\t\t$parent_name = $database->loadResult();\n\t\t\t$arr[] = $parent_name;\n\t\t\t//$this->logger($parent_name, \"parent_name for catid \".$cat.' '.$database->getErrorMsg());\n\t\t\t\n\t\t\tif (($parent_cat_id == '0') || (!isset($parent_cat_id))) {\n\t\t\t\treturn $arr;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t return $this->build_cats($parent_cat_id, $arr);\n\t\t\t} \n\t}", "function showCategory()\n {\n echo '女装';\n }", "function displayCategories($array){\n foreach($array as $key => $value) {\n echo\"<div class=\\\"col-lg-3 col-md-3 \\\" style=\\\"margin-top:25px;\\\">\";\n echo\"<a href=\\\"categories.php?id=\".$value[\"Id\"].\"\\\">\";\n echo\"<div class=\\\"card text-white \\\" style=\\\"-webkit-box-shadow: 0 7px 4px #777;\n -moz-box-shadow: 0 7px 4px #777;\n box-shadow: 0 7px 4px #777;\\\"> \";\n echo\"<img src=\\\"./images/\".$value[\"Picture\"].\"\\\" class=\\\"card-img cat-img\\\" alt=\\\"...\\\">\";\n echo\"<div class=\\\"card-img-overlay\\\">\";\n echo\"<h3 class=\\\"card-title\\\" style=\\\"text-align:center; color: white; font-weight: bold;\\\">\".$value[\"Name\"].\"</h3>\";\n echo\"</div></div></a></div>\"; \n }\n}", "function get_subcategoria($id){\t\n\t\t$sql=\"SELECT nombre_sub FROM subcategoria WHERE id_sub='$id'\";\n\t\t$consulta=mysql_query($sql) or die(mysql_error());\n\t\t$resultado=mysql_fetch_array($consulta);\n\n\t\treturn $resultado['nombre_sub'];\n\t}", "function ShowAtoZCategories()\n\t\t{ \n\t\t\tglobal $ecom_siteid,$db,$ecom_hostname,$Settings_arr,$Captions_arr;\n\t\t\t$Captions_arr['SEARCH'] \t= getCaptions('SEARCH'); \n\t\t\t$alpha_str \t\t= 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';\n\t\t\t$alpha_len \t\t= strlen($alpha_str);\n\t\t\t$atleast_one\t= 0;\n\t\t\tfor($i=0;$i<$alpha_len;$i++)\n\t\t\t{\n\t\t\t\t$cur_char \t\t\t\t\t= substr($alpha_str,$i,1);\n\t\t\t\t$alpha_arr[$cur_char] \t= array();\n\t\t\t}\n\t\t\t$block_cnt = 0;\n\t\t\t$block_arr = array();\n\t\t\t// Get the list of active categories in site\n\t\t\t$sql_cat = \"SELECT category_id,category_name \n\t\t\t\t\t\t\t\tFROM \n\t\t\t\t\t\t\t\t\tproduct_categories \n\t\t\t\t\t\t\t\tWHERE \n\t\t\t\t\t\t\t\t\tsites_site_id=$ecom_siteid \n\t\t\t\t\t\t\t\t\tAND category_hide =0 \n\t\t\t\t\t\t\t\tORDER BY \n\t\t\t\t\t\t\t\t\tcategory_name ASC\";\n\t\t\t$ret_cat = $db->query($sql_cat);\n\t\t\tif ($db->num_rows($ret_cat))\n\t\t\t{\n\t\t\t\twhile ($row_cat = $db->fetch_array($ret_cat))\n\t\t\t\t{\n\t\t\t\t\t$first_char = strtoupper(substr(stripslashes($row_cat['category_name']),0,1));\n\t\t\t\t\t//echo 'first'.$first_char.'<br/>';\n\t\t\t\t\tif(array_key_exists($first_char,$alpha_arr))\n\t\t\t\t\t{\n\t\t\t\t\t\tif(count($alpha_arr[$first_char])==0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$block_cnt++;\n\t\t\t\t\t\t\t$block_arr[] = $first_char;\n\t\t\t\t\t\t}\t\n\t\t\t\t\t\t$alpha_arr[$first_char][] = stripslashes($row_cat['category_name']).'~~'.$row_cat['category_id'];\n\t\t\t\t\t\t$atleast_one++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t$start \t\t\t= 0; // start index\n\t\t\t$col_limit\t\t= 4; // how many columns in each row\n\t\t\t$block_cnt\t\t= count($block_arr);\n\t\t\t$per_col_limit\t= floor($block_cnt/$col_limit); // how many character heading in each column\n\t\t\t$td_width\t\t= round(100/$col_limit);\n\t\t\t$rem_blk\t\t=$block_cnt%$col_limit; \n\t\t\t$disp_blk_cnt\t= 1;\n\t\t\tif ($rem_blk>0)\n\t\t\t{\n\t\t\t\t$extra_blk = 1;\n\t\t\t\t$extra_cnt\t= $rem_blk;\n\t\t\t}\n\t\t\telse\n\t\t\t\t$extra_blk = 0;\n\t\t\t//if($rem_blk<$col_limit and $rem_blk>0)\n\t\t\t//\t$extra_blk = 1;\n\t\t//\t$per_col_limit += $extra_blk;\n\t\t\tif ($atleast_one>0)\n\t\t\t{\n\t\t?>\n\t\t\t\t<table align = \"center\" width=\"98%\" border=\"0\" cellspacing=\"0\" cellpadding=\"3\" class=\"\">\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td class=\"search_noresult_td\">\n\t\t\t\t\t\t<?php\n\t\t\t\t\t\tif(trim($_REQUEST['quick_search'])!='')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$caption = $Captions_arr['SEARCH']['SEARCH_NO_PRODUCTS_WITH_KEYWORD'];\n\t\t\t\t\t\t\t$caption = str_replace('[keyword]','<strong>'.$_REQUEST['quick_search'].'</strong>',$caption);\n\t\t\t\t\t\t\techo stripslashes($caption);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\techo stripslashes($Captions_arr['SEARCH']['SEARCH_NO_PRODUCTS_WITH_NO_KEYWORD']);\n\t\t\t\t\t\t}\t\n\t\t\t\t\t\t\n\t\t\t\t\t?>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n</table>\n\t\t\t\t<table width=\"100%\" cellpadding=\"0\" cellspacing=\"8\" border=\"0\">\n\t\t\t\t\t<tr>\n\t\t\t\t\t<?php \n\t\t\t\t\t\t$alpha_index = 0;\n\t\t\t\t\t\tfor($cols=0;$cols<$col_limit;$cols++) // loop to handle the columns in each row\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\n\t\t\t\t\t?>\n\t\t\t\t\t\t\t<td align=\"left\" style=\"width:<?php echo $td_width\t?>%\" valign=\"top\">\n\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\tif($extra_blk and $extra_cnt>0)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$cur_col_limit = $per_col_limit + $extra_blk;\n\t\t\t\t\t\t\t\t\t--$extra_cnt;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t$cur_col_limit = $per_col_limit;\n\t\t\t\t\t\t\t\t/*if($cols==($col_limit-2))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tif($disp_blk_cnt==($block_cnt-1))\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$cur_col_limit = $cur_col_limit - $extra_blk;\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\tfor($i=0;$i<$cur_col_limit;$i++)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$cur_char \t\t= $block_arr[$alpha_index];\n\t\t\t\t\t\t\t\t\t$alpha_index++;\n\t\t\t\t\t\t\t\t\tif (count($alpha_arr[$cur_char])>0)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$disp_blk_cnt++;\n\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t\t<table width=\"100%\" cellpadding=\"0\" cellspacing=\"2\" border=\"0\">\n\t\t\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t\t\t<td class=\"searchspecial_header\"><?php echo $cur_char?>\n\t\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t\t\t</tr>\t\n\t\t\t\t\t\t\t\t<?php\t\n\t\t\t\t\t\t\t\t\t\tif (count($alpha_arr[$cur_char]))\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tforeach($alpha_arr[$cur_char] as $k=>$v) // loop to handle the display of categories\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t$cat_arr = explode('~~',$v);\n\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<tr onmouseover=\"this.className='searchspecial_content_special'\" onmouseout=\"this.className='searchspecial_content_normal'\" class=\"searchspecial_content_normal\" onclick=\"window.location='<?php echo url_category($cat_arr[1],$cat_arr[0],1)?>'\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<td class=\"searchspecial_td\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<a href=\"<?php url_category($cat_arr[1],$cat_arr[0])?>\" title=\"<?php echo $cat_arr[0]?>\" class=\"searchspecial_link\"><?php echo $cat_arr[0]?></a>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</tr>\t\t\n\t\t\t\t\t\t\t\t\t<?php\t\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t?>\t\n\t\t\t\t\t\t\t\t\t\t</table>\n\t\t\t\t\t\t\t\t\t<?php\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\t</td>\n\t\t\t\t\t<?php\n\t\t\t\t\t\t}\t\t\t\t\n\t\t\t\t\t?>\n\t\t\t\t\t</tr>\n\t\t\t\t</table>\n\t\t<?php\t\n\t\t\t}\n\t\t}", "function categoryShow($sql, $sqlTags, $str='', $rCatName='', $catDesc=''){\n\n\t#requested data\n\t$rCatID = (int)$_GET['tID'];\n\t$rCatName = test_input($_GET['categoryName']);\n\n\n\t$sqlCat = \"SELECT CatID, CatTitle, CatType, CatSort, CatDescription, CatVisible FROM ma_Categories WHERE CatID = {$rCatID};\";\n\n\t$result = mysqli_query(IDB::conn(),$sqlCat) or die(trigger_error(mysqli_error(IDB::conn()), E_USER_ERROR));\n\tif (mysqli_num_rows($result) > 0)//at least one record!\n\t{//show results\n\t\t#External formatting here...\n\t\twhile ($row = mysqli_fetch_assoc($result))\n\t\t{//dbOut() function is a 'wrapper' designed to strip slashes, etc. of data leaving db\n\t\t\t$catDesc = dbOut($row['CatDescription']);\n\t\t}\n\t\t#closing formating here...\n\t}else{//no records\n\t\t\t$catDesc = '<p>Category description not given</p>';\n\t}\n\n\t@mysqli_free_result($result); //free resources\n\n\n\t$str .= '<!-- start general content -->\n\t<div class=\"col-md-9 pull-right\">\n\t\t<h4><strong>' . $rCatName . '</strong> Most Recent Postings </h4>\n\n\t\t<p>' . nl2br($catDesc) . '</p>\n\n\t\t<div class=\"bs-example\">\n\t\t\t<div class=\"panel-group\" id=\"accordion\">';\n\n\t\t\t#reference images for pager\n\t\t\t$prev = '<span class=\"glyphicon glyphicon-backward\"></span>';\n\t\t\t$next = '<span class=\"glyphicon glyphicon-forward\"></span>';\n\n\t\t\t# Create instance of new 'pager' class\n\t\t\t$myPager = new Pager(10,'',$prev,$next,'');\n\t\t\t$sql = $myPager->loadSQL($sql); #load SQL, add offset\n\n\t\t\t# connection comes first in mysqli (improved) function\n\t\t\t$result = mysqli_query(IDB::conn(),$sql) or die(trigger_error(mysqli_error(IDB::conn()), E_USER_ERROR));\n\t\t\tif (mysqli_num_rows($result) > 0)//at least one record!\n\t\t\t{//show results\n\n\t\t\t\tif($myPager->showTotal()==1){$itemz = \"thread\";}else{$itemz = \"threads\";} //deal with plural\n\n\t\t\t\t$str .= '<div align=\"center\">' . $myPager->showTotal() . ' ' . $itemz . ' currently available.</div>';\n\n\t\t\t\twhile($row = mysqli_fetch_assoc($result))\n\t\t\t\t{# process each row\n\n\t\t\t\t\t$tID \t\t\t\t= (int)$row['ThreadID'];\n\t\t\t\t\t$catID \t= (int)$row['CatID'];\n\n\t\t\t\t\t#if category matches selected category show\n\t\t\t\t\tif($catID == $rCatID){\n\n\t\t\t\t\t\t$str .= '<div class=\"panel panel-default\">\n\t\t\t\t\t\t<div class=\"panel-heading\">\n\t\t\t\t\t\t\t<h4 class=\"panel-title\">\n\n\t\t\t\t\t\t\t\t<a data-toggle=\"collapse\" data-parent=\"#accordion\" href=\"#collapse-' . $tID . '\"> ' . $row['ThreadTitle'] . ' </a>\n\n\t\t\t\t\t\t\t\t<a class=\"pull-right\" href=\"'. THIS_PAGE . '?act=threadShow&tID=' . $tID . '\"> <small>Go To Thread &nbsp;<span class=\"glyphicon glyphicon-share\"></span></small></i></a>\n\t\t\t\t\t\t\t</h4>\n\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t<div id=\"collapse-' . $tID . '\" class=\"panel-collapse collapse\">\n\t\t\t\t\t\t\t<div class=\"panel-body\">\n\t\t\t\t\t\t\t\t<p>'. $row['ThreadSummary'] . '</p>\n\t\t\t\t\t\t\t\t<p>';\n\n\t\t\t\t\t\t\t\t#set ground work for tags\n\t\t\t\t\t\t\t\t$threadTag \t= $row['ThreadTag'];\n\t\t\t\t\t\t\t\t$arrTags \t\t= explode(',', $threadTag);\n\t\t\t\t\t\t\t\t$arrNames \t= get_tNames($sqlTags);\n\n\t\t\t\t\t\t\t\t#dumpDie($arrTags);\n\n\t\t\t\t\t\t\t\t#if we have tags show them\n\t\t\t\t\t\t\t\tif ((isset($threadTag)) && (!empty($threadTag))){\n\t\t\t\t\t\t\t\t\t//$str .= '';\n\n\t\t\t\t\t\t\t\t\t$x = 0;\n\t\t\t\t\t\t\t\t\t$tot = count($arrTags);\n\n\t\t\t\t\t\t\t\t\t#make links, comma seperated\n\t\t\t\t\t\t\t\t\tforeach($arrTags as $key => $value)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$str .= '<a href=\"../characters/profile.php?CodeName=CodeName&tID=' . $value . '\">' . $arrNames[$value] . '</a>, ';\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t$str .= '<span class=\"text-muted\"><span class=\"glyphicon glyphicon-tag\"></span> No Tags Currently Set</span>';\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t$str .= '</p>\n\t\t\t\t\t\t\t\t<p><a class=\"pull-right\" href=\"'. THIS_PAGE . '?act=threadShow&tID=' . $tID . '\"> <span class=\"glyphicon glyphicon-share\"></span> Go To Thread</i></a></p>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>';\n\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t@mysqli_free_result($result); //free resources\n\n\t\t\t$str .= $myPager->showNAV(); # show paging nav, only if enough records\n\n\t\t\t$str .= '</div>';\n\n\t\t}else{#no records\n\t\t\t$str .= \"<div align=center>There are currently no active threads for $rCatName. Drats!!<br />\n\t\t\tWe should really do something about that soon.</div>\";\n\t\t}\n\n\t$str .='</div><!-- end accordian -->';\n\n\n\n\t#http://localhost/WrDKv4/threads/index.php?act=threadAdd\n\n\n#BUTTONS begin -- Add Thread -- Edit Thread -- Delete Category\n\n\n\n\nif(startSession() && isset($_SESSION['UserID'])){\n\t$priv = $_SESSION['Privilege'];\n\n\t#ADD new thread\n\t$str .= '<div >';\n\n\n\t$str .= '<a href=\"' . THIS_PAGE . '?act=threadAdd&catID=' . $rCatID . '&catName=' . formatUrl($rCatName) . '\" class=\"btn btn-info btn-xs\" role=\"button\"><span class=\"glyphicon glyphicon-plus\" title=\"Add New Thread To ' . $rCatName . '\"></span> Add New Thread To ' . $rCatName . '</a>';\n\n\n\t#mod or better...\n\tif( $priv >= 3){\n\n\t\t$str .= '<a href=\"' . THIS_PAGE . '?act=categoryEdit&id=' . $rCatID . '&categoryName=' . formatUrl($rCatName) . '\" class=\"btn btn-info btn-xs pull-right\" role=\"button\"><span class=\"glyphicon glyphicon-edit\" title=\"Edit ' . formatUrl($rCatName) . '\"></span> ' . $rCatName . ' Catagory</a>';\n\t}\n\t$str .= '</div><!-- END Buttons -->';\n}\n\n\treturn $str;\n\t#BUTTONS end\n}", "function convert_sub_category( &$obj )\n\t{\n\t\t\n\t\t// added_date timestamp string\n\t\t$obj->added_date_str = ago( $obj->added_date );\n\t\t\n\t\t// set default photo\n\t\t$obj->default_photo = $this->get_default_photo( $obj->id, 'sub_category' );\n\n\t\t// set default icon \n\t\t$obj->default_icon = $this->get_default_photo( $obj->id, 'subcat_icon' );\n\t}", "function listCat()\n {\n session(['action' => 'listCat']);\n $list_cats = Product_cat::select('id', 'name', 'slug', 'created_at', 'parent_id')->get();\n $result = $this->data_tree($list_cats, 0, 0);\n\n //Duyệt từng ptu mảng $result\n foreach ($result as $k => $v) {\n //gán số lượng của tên danh mục = đếm số bản ghi có post_cat_id là id của danh mục\n $count_post[$v['name']] = Product::where('product_cat_id', $v['id'])->count();\n }\n return view('admin.product.cat', compact('result', 'list_cats', 'count_post'));\n }", "function tep_show_category($counter) {\r\n\r\n// BoF - Contribution Category Box Enhancement 1.1\r\n global $tree, $categories_string, $cPath_array, $cat_name;\r\n\r\n for ($i=0; $i<$tree[$counter]['level']; $i++) {\r\n $categories_string .= \"&nbsp;&nbsp;\";\r\n }\r\n $cPath_new = 'cPath=' . $tree[$counter]['path'];\r\n if (isset($cPath_array) && in_array($counter, $cPath_array) && $cat_name == $tree[$counter]['name']) { //Link nicht anklickbar, wenn angewählt\r\n $categories_string .= '<a style=\"color:#874b5a;text-decoration:none\" href=\"';\r\n $categories_string .= tep_href_link(FILENAME_DEFAULT, $cPath_new) . '\">';\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t //Link nicht anklickbar, wenn angewählt\r\n } else {\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 //Link nicht anklickbar, wenn angewählt\r\n $categories_string .= '<a href=\"';\r\n $categories_string .= tep_href_link(FILENAME_DEFAULT, $cPath_new) . '\">';\r\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 //Link nicht anklickbar, wenn angewählt\r\n\r\n if (isset($cPath_array) && in_array($counter, $cPath_array)) {\r\n $categories_string .= '<b>';\r\n }\r\n\r\n if ($cat_name == $tree[$counter]['name']) {\r\n $categories_string .= '<span class=\"errorText\">';\r\n }\r\n\r\n// display category name\r\n $categories_string .= '<img src=\"'. DIR_WS_IMAGES .'m25.gif\" align=\"absmiddle\" border=0 hspace=\"5\" vspace=\"0\">' . $tree[$counter]['name'];\r\n\r\n\t\tif ($cat_name == $tree[$counter]['name']) {\r\n\t\t\t$categories_string .= '</span>';\r\n }\r\n\r\n if (isset($cPath_array) && in_array($counter, $cPath_array)) {\r\n $categories_string .= '</b>';\r\n }\r\n// \tEoF Category Box Enhancement\r\n\r\n $categories_string .= '</a>';\r\n\r\n if (SHOW_COUNTS == 'true') {\r\n $products_in_category = tep_count_products_in_category($counter);\r\n if ($products_in_category > 0) {\r\n $categories_string .= '&nbsp;(' . $products_in_category . ')';\r\n }\r\n }\r\n\r\n $categories_string .= '<br>';\r\n\r\n if ($tree[$counter]['next_id'] != false) {\r\n\t\t$categories_string .= '<div style=\"height:5px; line-height:5px; background: url('.DIR_WS_IMAGES .'m26.gif) center repeat-x;\"></div>';\r\n tep_show_category($tree[$counter]['next_id']);\r\n }\r\n }", "public function get_link($id){\t\n\t\t$sql=\"SELECT etiqueta_cat FROM link WHERE id_cat='$id'\";\n\t\t$consulta=mysql_query($sql) or die(mysql_error());\n\t\t$resultado=mysql_fetch_array($consulta);\n\n\t\treturn $resultado['etiqueta_cat'];\n\t}", "function printlist($idcat){\n\t\n\t$cats0 = bucleCatPDF('',$idcat); // devuelve todas las categorias de la categoria\n\tif (count($cats0)>0){ // si hay categorias\n\t\tforeach ( $cats0 as $cat0 ){\n\t\t\t$prods = getProductsByCat($cat0['id']); // devuelte todos los productos de esa categoria\n\t\t\tif( is_array($prods) && count($prods)>0 ){ // si hay productos en esa categoria \n\t\t\t\t$_html = renderCategoriaxProducto($cat0['id']);\t// imprime todos los productos de esa categoria\n\t\t\t\techo $_html;\t\t\t\t\t\t\t\t\t\t\t\t\t// param1: idcat, param2: nombre categoria\n\t\t\t}else{ // si no hay productos en esa categoria\n\t\t\t\tprintlist($cat0['id']);\t// paso a la sig. categoria\n\t\t\t}\t\t\t\n\t\t}\n\t}else{ // si no hay categorias \n\t\t$prods = getProductsByCat($idcat); // prueba suerte si hay productos\n\t\t$categoria = new Categoria($idcat); // creo instancia de categoria para crear nombre \n\t\tif( is_array($prods) && count($prods)>0 ){ // si hay productos\n\t\t\t$_html = renderCategoriaxProducto($idcat);\t // imprimo los productos de esa categoria\n\t\t\techo $_html;\n\t\t}\n\t}\t }", "public function catDisplay(){\n $query = \"SELECT * FROM shop_category\";\n $result = $this->db->select($query);\n\n return $result;\n }", "function view_category(){\n\t\t\t$this->layout = 'mobilelayout';\n\t\t\tglobal $loguser;\n\t\t\tif(!$this->isauthorizedpersn())\n\t\t\t\t$this->redirect('/');\n\t\t\t\t\n\t\t\t$this->set('title_for_layout','Category Management');\n\t\t\t\n\t\t\t$main_catdata = $this->Category->find('all');\n\t\t\t//$super_sub_catdata = $this->Category->find('all',array('conditions'=>array('category_parent <>'=>0)));\n\t\t\t// $sub_sub_catdata = $this->Category->find('all',array('conditions'=>array('category_parent <>'=>0,'category_sub_parent <>'=>0)));\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t$this->paginate = array('conditions'=>array('Category.category_name <>'=>''),'limit'=>10,'order'=>array('Category.id'=>'desc'));\n\t\t\t$super_sub_catdata = $this->paginate('Category');\n\t\t\t$pagecount = $this->params['paging']['Category']['count'];\n\t\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t$this->set('main_catdata',$main_catdata);\n\t\t\t$this->set('super_sub_catdata',$super_sub_catdata);\n\t\t\t$this->set('pagecount',$pagecount);\n\t\t\t// $this->set('sub_sub_catdata',$sub_sub_catdata);\n\t\t\t\n\t\t\t// echo \"<pre>\";print_r($sub_sub_catdata);die;\n\t\t}", "function mostrarCategoriaEntradas($core,$id){\n\t$entradas = obtenerCategoriaEntradas($core,$id);\n\n\tif ($entradas->num_rows >= 1) {\n\t\twhile ($row = $entradas->fetch_assoc()) {\n\t\t\techo '<article class=\"entrada\">\n\t\t\t\t\t<a href=\"entradas.php?id_post='.$row['id_entrada'].'\">\n\t\t\t\t\t\t<h2>'.ucfirst($row['titulo']).'</h2>\n\t\t\t\t\t\t<span class=\"fecha\">'.$row['categoria'].' | '.$row['fecha'].'</span>\n\t\t\t\t\t\t<p>'.limitandoCaracteres($row['descripcion'],47).'</p>\n\t\t\t\t\t</a>\n\t\t\t\t</article>';\n\t\t}\n\t}else{\n\t\techo '<h3>No ahi post publicados para esta categoria</h3>';\n\t}\n}", "function getCat(){\n global $db;\n $get_cats=\"select * from categories\";\n $run_cats=mysqli_query($db, $get_cats);\n while($row_cats=mysqli_fetch_array($run_cats)){\n $cat_id= $row_cats['cat_id'];\n $cat_title= $row_cats['cat_title'];\n echo \"<li><a href='index.php?cat=$cat_id'>$cat_title</a></li>\";\n }\n }", "function cat_title()\n{\n global $category;\n return $category[\"title\"];\n}", "public function ajax_sub_cat_list()\n {\n $id=intval($this->input->get('cat_id'));\n $ret=\"\";\n if($id)\n {\n $ret=dd_sub_category(array(\"cat_id\"=>$id));\n unset($ret[\"\"]);\n }\n\n echo json_encode($ret);\n }", "function catagoryStatistics($catId, $clientKey){\n\t\n\t$ch = curl_init();\ncurl_setopt($ch, CURLOPT_URL, \"https://www.googleapis.com/youtube/v3/videoCategories?part=snippet&id=\".$catId.\"&key=\".$clientKey.\"\");\ncurl_setopt($ch, CURLOPT_HEADER, 0);\ncurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\ncurl_setopt($ch, CURLOPT_TIMEOUT, 100);\ncurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n$output = curl_exec($ch);\necho curl_error($ch);\ncurl_close($ch);\n \n$searchResponse = json_decode($output,true);\n\t\n\tforeach ($searchResponse['items'] as $searchResult) {\n\t//$videoId = $searchResult['id'];\n\t$catChannelId=$searchResult['snippet']['channelId'];\n\t$title=$searchResult['snippet']['title'];\n\treturn array ('catTitle'=>$title, 'catChannelId'=>$catChannelId);\n\t\n\t}\n\n}", "function sgr_show_current_cat_on_single($output) {\n\n\tglobal $post;\n\n\tif( is_single() ) {\n\n\t\t$categories = wp_get_post_categories($post->ID);\n\n\t\tforeach( $categories as $catid ) {\n\t\t\t$cat = get_category($catid);\n\t\t\t// Find cat-item-ID in the string\n\t\t\tif(preg_match('#cat-item-' . $cat->cat_ID . '#', $output)) {\n\t\t\t\t$output = str_replace('cat-item-'.$cat->cat_ID, 'cat-item-'.$cat->cat_ID . ' current-cat', $output);\n\t\t\t}\n\t\t}\n\n\t}\n\treturn $output;\n}", "function get_cat($catid) {\n\t$client = new soapclient ( $GLOBALS['baseurl'].'/db/nusoapService.php' );\n\t$client->soap_defencoding = 'UTF-8';\n\t$client->decode_utf8 = false;\n\t$client->xml_encoding = 'UTF-8';\n\t$result = $client->call('get_cat_json', array('catid'=>\"$catid\"));\n\tif (! $err = $client->getError ()) {\n\t\treturn json_decode($result);\n\t} else {\n\t\techo \"调用出错:\", $err;\n\t}\n}", "function descargar_lista($cat_id)\n{\n\tif ($cat_id==1){$categoria_s=\"Categoria 1\"; $dir_cat=\"dir1\";}\n\tif ($cat_id==2){$categoria_s=\"Categoria 2\"; $dir_cat=\"dir2\";}\n\tif ($cat_id==3){$categoria_s=\"Categoria 3\"; $dir_cat=\"dir3\";}\n\n\techo \"\\n<p align=\\\"center\\\"><a href=\";\n\techo \"\\\"listado_\".$dir_cat.\".php\\\"\";\n echo \"><em><strong>DESCARGAR LISTAS <img border=0 src=$doc_root/pdf-logo.gif\\\" width=\\\"20\\\" height=\\\"20\\\" /> </strong></em></a></p>\";\n}", "function showCategory($catList) {\n $str =\"<ul id='menu-categories-menu'>\";\n foreach ($catList->getCategoriesActive()->getList() as $k => $v) {\n $str .=\"<li><a href='#'>\".$v->getCatname().\"</a></li>\";\n }\n $str .=\"</ul>\";\n return $str;\n}", "private function loadBikeCat(){\n\t\tinclude_once ('default/models/bike/db_selBikeCat.php');\n\t\t$bikeCat = db_selBikeCat();\n\t\tif($bikeCat != false){\n\t\t\t$this -> view -> bikeCat = $bikeCat;\n\t\t}\n\t\treturn $bikeCat;\n\t}", "function showSubCatFeaturedItemsElse()\n\t{\n\t\t $output='<div class=\"head_text\" id=\"head_text\">Products</div>\n \t\t<div id=\"product_tbbg\"><table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\n\t\t \t\t<tr><td>&nbsp;</td></tr>\n\t\t\t <tr><td class=\"product_tbbg1\"><font color=\"orange\"><b>No featured product found for this category</b></font></td></tr>\n\t\t\t <tr><td>&nbsp;</td></tr></table></div>';\n\t\treturn $output;\n\t\t\t \n\t}", "public function sub_category($id){\n\n $compact = array();\n $compact['title']=$this->modName;\n $compact['models']=$this->model->where('parent_id',$id)->orderBy('position')->get();\n $compact['cat_parent']=$this->model->where('id',$id)->first();\n $compact['parent_id']=$compact['cat_parent']->parent_id;\n $compact['id'] = $id;\n\n return view($this->viewPr.'index',['compact'=>$compact]);\n \n \t\t}", "function particularsubcatlist($id)\n\t{\n\t\t$getParsubproduct=\"SELECT * from product_sub_category where pr_sub_id = $id\";\n\t\t$subproduct_data=$this->get_results( $getParsubproduct );\n\t\treturn $subproduct_data;\n\t}", "public function category()\n {\n $vereinRepository = new VereinRepository();\n\n $view = new View('verein_index');\n $view->kategorie = $_GET['kategorie'];\n $view->title = 'Kategorie';\n $view->heading = 'Kategorie: '. $_GET['kategorie'];\n $view->vereine = $vereinRepository->getByCategory($view->kategorie);\n $view->display();\n }", "function cah_news_get_category_name($cat_ID) {\r\n $response = cah_news_get_rest_body('categories/' . $cat_ID);\r\n if ($response) {\r\n return $response->name;\r\n }\r\n}", "function categoryList($cat,$popUp = false) {\n\t$cat = str_replace(array(\":,\",\": \",\" \"),\",\",$cat);\n\t$cat = rtrim($cat,\":\");\n\t$all_categories = explode(\",\",$cat);\n\n\t$categoryList = $popUp ? $all_categories : array_slice($all_categories,0,4);\n\n\tif ( count($all_categories) > count($categoryList) ) {\n\t\t$excess = count($all_categories) - count($categoryList);\n\t\t$categoryList[] = \" and $excess more\";\n\t}\n\treturn rtrim(implode(\", \",$categoryList),\", \");\n}", "function index() {\t\n\t $this->account();\t \n\t // $conditions=array('Catproduct.status'=>1);\t\n\t $this->paginate = array('limit' => '15','order' => 'Album.id ASC');\n\t $this->set('Album', $this->paginate('Album',array()));\n $list_cat = $this->Album->generatetreelist(null,null,null,\" _ \");\n\t $this->set(compact('list_cat'));\n\t}", "public function get_link2($id){\t\n\t\t$sql=\"SELECT nombre_cat FROM link WHERE id_cat='$id'\";\n\t\t$consulta=mysql_query($sql) or die(mysql_error());\n\t\t$resultado=mysql_fetch_array($consulta);\n\n\t\treturn $resultado['nombre_cat'];\n\t}", "function parse_categories($html)\r\n {\r\n // truncate the html string for easier processing\r\n $html_start = '<ul class=\"org-cats-2\">';\r\n $html_start_pos = strpos($html, $html_start) + strlen($html_start);\r\n $html_end = '</ul>';\r\n $html = substr($html, $html_start_pos , strpos($html, $html_end, $html_start_pos) - $html_start_pos);\r\n \r\n // pull OSL category and the ID they assign to later add to tag table\r\n preg_match_all('#value=\"(\\d*?)\".*?>\\s*(.*?)\\s<#si', $html, $categories_all, PREG_SET_ORDER); \r\n foreach ($categories_all as $index => $tag)\r\n {\r\n $categories_all[$index][2] = substr($tag[2],0,-12);\r\n }\r\n return $categories_all; \r\n }", "function start_lvl(&$output, $depth = 0, $args = array()) {\n\t\t $output .= \"<span class='subcategories'>\";\n\t\t}", "function displayCO($con_id,$dat_id,$skin,$count=0)\r\n\t{\r\n\t\tglobal $myPT;\r\n\t\t$myPT->displayCO($con_id,$dat_id,$skin,$count);\r\n\t}", "public function get_subcategory($cat_id){\n \t$subcategories = Category::with('productsBySubcategory')->where('parent_id', $cat_id)->get();\n $output = '';\n if(count($subcategories)>0){\n $output .= '<option value=\"\">Select Subcategory</option>';\n foreach($subcategories as $subcategory){\n $output .='<option '. (Session::get(\"subcategory_id\") == $subcategory->id ? \"selected\" : \"\" ).' value=\"'.$subcategory->id.'\">'.$subcategory->name.' ('.count($subcategory->productsBySubcategory).')</option>';\n }\n }\n echo $output;\n }", "function ver_categoria ( $uri ) {\n\tglobal $categorias;\n\t//ver si figura la variable cat en el url, en ese caso es categoria\n\t$cat = isset($_REQUEST['cat']) ? $_REQUEST['cat'] : 'none';\n\n\t$parseUrl = explode('/', $uri);\n\t$RequestURI = $parseUrl[1];\n\n\tfor ($i=0; $i < count($categorias); $i++) { \n\t\tif ( $categorias[$i]['slug'] == $RequestURI ) {\n\t\t$cat = $RequestURI;\n\t\tbreak;\n\t\t}\n\t}\n\n\treturn $cat;\n\n}", "public function subcategory($seo_url)\n {\n\n $login_model = $this->loadModel('Login');\n $this->view->isCaptchaNeeded = $login_model->isCaptchaNeeded();\n if(isset($_SESSION['user_id'])) {\n $user_info_model = $this->loadModel('UserInfo');\n $this->view->userInfo = $user_info_model->getUserInfo($_SESSION['user_id']);\n\n if (!isset($_SESSION['post_code']) AND $this->view->userInfo AND $this->view->userInfo->post_code) {\n $_SESSION['post_code'] = $this->view->userInfo->post_code . ' ' . $this->view->userInfo->city;\n }\n\n if (!isset($_SESSION['user_phone']) AND $this->view->userInfo AND $this->view->userInfo->phone) {\n $this->view->skip_phone = true;\n }\n\n if (!isset($_SESSION['first_name']) AND $this->view->userInfo AND $this->view->userInfo->first_name) {\n $this->view->skip_name = true;\n }\n }\n\n\n $subcategory_model = $this->loadModel('Subcategory');\n $this->view->seo_url = $seo_url;\n $this->view->subcategory = $subcategory_model->getSubcategoryByName($seo_url);\n if(!$this->view->subcategory) {\n header('location: ' . URL .subcategory_SEO . '/');\n }\n $this->view->meta_title = $this->view->subcategory->meta_title;\n $this->view->meta_descr = $this->view->subcategory->meta_descr;\n $this->view->meta_keywords = $this->view->subcategory->meta_keywords;\n $this->view->render('subcategory_view/index');\n }", "public function __construct()\n {\n $cats = get_categories();\n if(class_exists('Category'))\n {\n if( is_array($cats) && count($cats)>0 ){\n $idC = 0;\n foreach($cats as &$cat)\n {\n $category = new Category($cat->term_id, $cat->name, $cat->slug, $cat->parent);\n $this->lstCat[$idC] = $category->convertToArray(array('id', 'name', 'slug', 'parent'));\n $this->lstCat[$idC]['aff']=true;\n $idC++;\n }unset($cat);\n }\n }\n }", "function get_cat($cat_id){\n\tglobal $connection;\n\t$get_cat= mysqli_query($connection,\"SELECT * FROM kp_category WHERE cat_id='$cat_id'\");\n\t$n = mysqli_fetch_assoc($get_cat);\n\t$name = $n['name']; \n\treturn $name;\n}", "public function getId(){\n return $this->_sub_cat_id;\n }", "public function verCategoria(){\n\t\t\t$array[] = array(\"id\"=>\"A00-B99\",\"name\"=>\"Ciertas enfermedades infecciosas y parasitarias\");\n\t\t\t$array[] = array(\"id\"=>\"C00-D48\",\"name\"=>\"Neoplasias\");\n\t\t\t$array[] = array(\"id\"=>\"D50-D89\",\"name\"=>\"Enfermedades de la sangre y de los órganos hematopoyéticos y otros trastornos que afectan el mecanismo de la inmunidad\");\n\t\t\t$array[] = array(\"id\"=>\"E00-E90\",\"name\"=>\"Enfermedades endocrinas, nutricionales y metabólicas\");\n\t\t\t$array[] = array(\"id\"=>\"F00-F99\",\"name\"=>\"Trastornos mentales y del comportamiento\");\n\t\t\t$array[] = array(\"id\"=>\"G00-G99\",\"name\"=>\"Enfermedades del sistema nervioso\");\n\t\t\t$array[] = array(\"id\"=>\"H00-H59\",\"name\"=>\"Enfermedades del ojo y sus anexos\");\n\t\t\t$array[] = array(\"id\"=>\"H60-H95\",\"name\"=>\"Enfermedades del oído y de la apófisis mastoides\");\n\t\t\t$array[] = array(\"id\"=>\"I00-I99\",\"name\"=>\"Enfermedades del sistema circulatorio\");\n\t\t\treturn $array;\n\t\t\t/*\n\t\t\t$array=array(\n\t\t\t\t'CATEGORIA_ID'=>$categoria_id\n\t\t\t\t);\n\n\t\t\t$consult= oci_parse($conn,\"BEGIN Ips$_sndCitas.Ver_subcie10 END \");\n\t\t\t// $consult= oci_parse($conn,\"SELECT * FROM SUBCATEGORIA_CIE10\");\n\t\t\toci_execute($consult);\n\t\t\t*/\n\t\t}", "function deeez_cats2($category){\n$space_holder = \"\";\n$cat_string = \"\";\n\tforeach ($category as $categorysingle) {\n\t$cat_string .= $space_holder . $categorysingle->name;\n\t$space_holder = \"_\";\n\t}\n\treturn $cat_string;\n}", "function getSubCategory($category)\n\t\t{\n\t\t\t//get values of sub category of this category\n\t\t\t$subcatList = $this->manageContent->getValue_where('subcategory', '*', 'categoryId', $category);\n\t\t\tif(!empty($subcatList[0]))\n\t\t\t{\n\t\t\t\tforeach($subcatList as $subcat)\n\t\t\t\t{\n\t\t\t\t\techo '<option value=\"'.$subcat['subCategoryId'].'\">'.$subcat['name'].'</option>';\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\techo '<option>No Subcategory</option>';\n\t\t\t}\n\t\t}", "function subcatBreadCrumb($arr)\n\t{\t\n\t\treturn '\n\t\t<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" class=\"resultDETAILS\">\n <tr>\n <td align=\"left\" scope=\"col\"><a href=\"?do=indexpage\">Home</a> <b>&gt;&gt;</b> <a href=\"'.$_SESSION['base_url'].'/index.php?do=featured&action=showmaincatlanding&maincatid='.$arr[0]['maincatid'].'\">'.$arr[0]['Category'].'</a> <b>&gt;&gt;</b> '.$arr[0]['SubCategory'].'</td></tr></table>';\n\t}", "function showSubCategoryUpdate($par_id)\n\t {\n\t\t\n\t\t $prolist=new Actions();\n\t\t $res=$prolist->fetchAll(\"category\");\n\t\t\t\t\t\t\n\t\t $parentdata=mysql_query(\"select * from category where cat_par_id='0'\");\n\t\t \n\t\t if($par_id==0)\n\t\t {\n\t\t\techo '<option selected=\"selected\" value=\"0\">Parent</option>';\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t }\n\t\t else\n\t\t {\n\t\t \techo '<option value=\"0\">Parent</option>';\n\t\t }\n\t\t \n\t\t while($parent_sub_cat=mysql_fetch_array($parentdata))\n\t\t {\n\t\t\t if($parent_sub_cat['cat_id']==$par_id)\n\t\t\t {\n\t\t\t\t\techo '<option selected=\"selected\" value=\"'.$parent_sub_cat['cat_id'].'\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'.ucfirst($parent_sub_cat['cat_title']).'</option>';\n\t\t \t\n\t\t\t }\n\t\t\t else\n\t\t\t {\n\t\t\t\techo '<option value=\"'.$parent_sub_cat['cat_id'].'\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'.ucfirst($parent_sub_cat['cat_title']).'</option>';\n\t\t \t\n\t\t\t }\n\t\t\t\t\t\n\t\t\t if(mysql_num_rows(mysql_query(\"select * from category where cat_par_id='\".$parent_sub_cat['cat_id'].\"'\"))>0)\n\t\t\t {\n\t\t\t\tActions::$r++;\n\t\t\t\tActions::viewCategoryUpdate($parent_sub_cat['cat_id'],$par_id);\n\t\t\t } \n\t\t\t \n\t\t }\t\t\t\t\t\t\n\t\t \n\t }" ]
[ "0.68688154", "0.67576915", "0.6513344", "0.63308597", "0.6313172", "0.62455297", "0.6233813", "0.61778194", "0.61425745", "0.61386377", "0.6114976", "0.6102453", "0.60969985", "0.60510164", "0.6041921", "0.6037831", "0.6029942", "0.6004552", "0.60035175", "0.59941554", "0.5985644", "0.59594005", "0.5956553", "0.5939113", "0.59362835", "0.59340024", "0.58993447", "0.5896071", "0.5894124", "0.5888378", "0.58857733", "0.58730304", "0.58644694", "0.5845927", "0.58434314", "0.58156353", "0.581007", "0.5802696", "0.57986504", "0.5795166", "0.57937425", "0.5776009", "0.5764821", "0.5763099", "0.57594717", "0.5758334", "0.5752876", "0.5740854", "0.57185996", "0.57076377", "0.5694662", "0.5692378", "0.56771916", "0.5658831", "0.565253", "0.5648625", "0.5640411", "0.5637857", "0.56373197", "0.5631316", "0.56239766", "0.56170225", "0.56161314", "0.56131715", "0.5607689", "0.56043226", "0.55917376", "0.5590156", "0.55870837", "0.5583744", "0.5579358", "0.5578552", "0.55727226", "0.557049", "0.5564824", "0.5561291", "0.5558367", "0.5547207", "0.55415976", "0.5535562", "0.5531518", "0.55312204", "0.5530718", "0.5525589", "0.5525385", "0.5524217", "0.5521621", "0.5521062", "0.55203503", "0.55201054", "0.551987", "0.5519669", "0.5515156", "0.5514819", "0.55126", "0.55114526", "0.55079037", "0.550097", "0.54922533", "0.54913646" ]
0.61129975
11
Add support for custom header
public function enableCustomHeader() { $custom_header_defaults = array( 'default-image' => '',//get_stylesheet_directory_uri().'/images/logo.png', 'random-default' => false, 'width' => '', 'height' => '', 'flex-height' => false, 'flex-width' => false, 'default-text-color' => '', 'header-text' => true, 'uploads' => true, 'wp-head-callback' => '', 'admin-head-callback' => '', 'admin-preview-callback' => '', ); add_theme_support( 'custom-header', $custom_header_defaults ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function add_header() {\n }", "public function addHeader()\n {\n }", "function get_custom_header()\n {\n }", "protected function _custom_header()\n\t{\n\t\tif(is_array($this->_custom_headers) && count($this->_custom_headers) > 0)\n\t\t{\n\t\t\tforeach($this->_custom_headers as $_header_string)\n\t\t\t{\n\t\t\t\theader($_header_string);\n\t\t\t}\n\t\t}\n\t}", "public function addHeader($header);", "public function addHeader($name, $value) {\n $this->customHeader[$name]= $value;\n }", "protected function _addCustomHeaders() {\n // FIXME ExternalDesc is not into the mail..\n //$this->addHeader(\"X-Clab-SmartRelay-External\", $this->_templateId);\n //$this->addHeader(\"X-Clab-SmartRelay-ExternalDesc\", $this->_templateCode);\n\n $this->addHeader(\"X-Clab-SmartRelay-DeliveryId\", sprintf(\"%u\", $this->_crc16($this->_templateCode)));\n $this->addHeader(\"X-Clab-SmartRelay-DeliveryLabel\", $this->_templateCode);\n // Mage::log(\"Template code is: \". $this->_templateCode, null, null, true);\n }", "public function addCustomHeader($name, $value = null)\n {\n }", "function httpHeader($header) {\r\n\t\t$this->customHeaders[] = $header;\r\n\t}", "protected function makeHeader()\n {\n }", "function has_custom_header()\n {\n }", "function scaffold_custom_header_setup() {\n\tadd_theme_support( 'custom-header', apply_filters( 'scaffold_custom_header_args', array(\n\t\t'default-image' => '',\n\t\t'default-text-color' => '000000',\n\t\t'width' => 1000,\n\t\t'height' => 250,\n\t\t'flex-height' => true,\n\t\t'flex-width' => true,\n\t\t'wp-head-callback' => 'scaffold_header_style',\n\t) ) );\n}", "function get_custom_header_markup()\n {\n }", "public function addHeader()\n {\n if (file_exists(DIRREQ . \"app/view/{$this->getDir()}/header.php\")) {\n include(DIRREQ . \"app/view/{$this->getDir()}/header.php\");\n }\n }", "function praise_custom_header_setup() {\n\tadd_theme_support( 'custom-header', apply_filters( 'praise_custom_header_args', array(\n\t\t'default-image'\t\t\t\t\t=> get_stylesheet_directory_uri() . '/assets/images/header.jpg',\n\t\t'default-text-color'\t\t => 'ffffff',\n\t\t'width'\t\t\t\t\t\t\t\t\t=> 1500,\n\t\t'height'\t\t\t\t\t\t\t\t => 300,\n\t\t'flex-height'\t\t\t\t\t\t=> true,\n\t\t'wp-head-callback'\t\t\t => 'praise_header_style'\n\t) ) );\n}", "function additionalHeaderStuff() {\n return;\n }", "function bj_homeheader_setup(){\n\t\tif(function_exists('the_custom_header')){\n\t\t\tthe_custom_header();\n\t\t}\n\tadd_theme_support('custom-header',array(\n\t\t'flex-height' => true,\n\t\t'flex-width'=> true,\n\t));\n}", "function pantomime_custom_image_header(){\n\tdefine( 'HEADER_TEXTCOLOR', 'FFFFFF' );\n\tdefine( 'HEADER_IMAGE', '' ); // Leaving empty for random image rotation.\n\tdefine( 'HEADER_IMAGE_WIDTH', apply_filters( 'pantomime_header_image_width', 960 ) );\n\tdefine( 'HEADER_IMAGE_HEIGHT', apply_filters( 'pantomime_header_image_height', 400 ) );\n\tadd_custom_image_header( 'pantomime_header_style', 'pantomime_admin_header_style', 'pantomime_admin_header_image' );\t\n}", "function add_admin_header() {\n }", "function the_custom_header_markup()\n {\n }", "public function addHeader($name, $value);", "public function addHeader($name, $value);", "public function withAddedHeader($name, $value)\n {\n }", "public function withAddedHeader($name, $value)\n {\n }", "function scratch_custom_header_setup() {\n\n\t/* Adds support for WordPress' \"custom-header\" feature. */\n\tadd_theme_support(\n\t\t'custom-header',\n\t\tarray(\n\t\t\t'default-image' => '',\n\t\t\t'random-default' => false,\n\t\t\t'width' => 1220,\n\t\t\t'height' => 400,\n\t\t\t'flex-width' => true,\n\t\t\t'flex-height' => true,\n\t\t\t'default-text-color' => 'fafafa',\n\t\t\t'header-text' => true,\n\t\t\t'uploads' => true,\n\t\t\t'wp-head-callback' => 'scratch_custom_header_wp_head',\n\t\t\t'admin-head-callback' => 'scratch_custom_header_admin_head',\n\t\t\t'admin-preview-callback' => 'scratch_custom_header_admin_preview',\n\t\t)\n\t);\n\n\t/* Registers default headers for the theme. */\n\t//register_default_headers();\n}", "public function getCustomHeaders()\n {\n }", "function wpex_has_custom_header() {\n\treturn apply_filters( 'wpex_has_custom_header', wpex_header_builder_id() );\n}", "function register_default_headers($headers)\n {\n }", "public static function addHeader($header)\n {\n self::$legacyHeaders[] = $header;\n }", "public function format_for_header()\n {\n }", "function Header(){\n\t\t}", "abstract public function header($name, $value);", "function fsesu_custom_header_setup() {\n\t/**\n\t * Filter Twenty Fourteen custom-header support arguments.\n\t *\n\t * @since Twenty Fourteen 1.0\n\t *\n\t * @param array $args {\n\t * An array of custom-header support arguments.\n\t *\n\t * @type bool $header_text Whether to display custom header text. Default false.\n\t * @type int $width Width in pixels of the custom header image. Default 1260.\n\t * @type int $height Height in pixels of the custom header image. Default 240.\n\t * @type bool $flex_height Whether to allow flexible-height header images. Default true.\n\t * @type string $admin_head_callback Callback function used to style the image displayed in\n\t * the Appearance > Header screen.\n\t * @type string $admin_preview_callback Callback function used to create the custom header markup in\n\t * the Appearance > Header screen.\n\t * }\n\t */\n\t \n\t\n\t\n // Add back slightly revised custom header support\n add_theme_support( 'custom-header', apply_filters( 'fsesu_custom_header_args', array(\n\t\t'width' => 960,\n\t\t'height' => 180,\n\t\t'flex-width' => true,\n\t\t'flex-height' => true,\n\t\t'random-default' => true,\n\t\t'default-text-color' => 'f00',\n\t\t'admin-head-callback' => 'fsesu_admin_header_style',\n\t\t'admin-preview-callback' => 'fsesu_admin_header_image'\n\t) ) );\n\t\n\t// Register some default headers\n\tregister_default_headers( array(\n\t\t'serbia06' => array(\n\t\t\t'description' => __( 'Serbian National Jamboree 2006', 'fsesu' ),\n\t\t\t'url' => '%2$s/assets/images/head/serbia06.jpg',\n\t\t\t'thumbnail_url' => '%2$s/assets/images/head/serbia06-thumb.jpg',\n\t\t),\n\t\t'scotland08' => array(\n\t\t\t'description' => __( 'Scotland Summer Camp 2008', 'fsesu' ),\n\t\t\t'url' => '%2$s/assets/images/head/scotland08.jpg',\n\t\t\t'thumbnail_url' => '%2$s/assets/images/head/scotland08-thumb.jpg',\n\t\t),\n\t\t'wings09' => array(\n\t\t\t'description' => __( 'Wings 2009', 'fsesu' ),\n\t\t\t'url' => '%2$s/assets/images/head/wings09.jpg',\n\t\t\t'thumbnail_url' => '%2$s/assets/images/head/wings09-thumb.jpg',\n\t\t),\n\t\t'youlbury10' => array(\n\t\t\t'description' => __( 'Youlbury Summer Camp 2010', 'fsesu' ),\n\t\t\t'url' => '%2$s/assets/images/head/youlbury10.jpg',\n\t\t\t'thumbnail_url' => '%2$s/assets/images/head/youlbury10-thumb.jpg',\n\t\t),\n\t\t'camjam11' => array(\n\t\t\t'description' => __( 'CamJam 2011', 'fsesu' ),\n\t\t\t'url' => '%2$s/assets/images/head/camjam11.jpg',\n\t\t\t'thumbnail_url' => '%2$s/assets/images/head/camjam11-thumb.jpg',\n\t\t),\n\t\t'lochgoilhead12' => array(\n\t\t\t'description' => __( 'Lochgoilhead Summer Camp 2012', 'fsesu' ),\n\t\t\t'url' => '%2$s/assets/images/head/scotland08.jpg',\n\t\t\t'thumbnail_url' => '%2$s/assets/images/head/scotland08-thumb.jpg',\n\t\t),\n\t\t'kernow13' => array(\n\t\t\t'description' => __( 'Kernow 2013', 'fsesu' ),\n\t\t\t'url' => '%2$s/assets/images/head/kernow13.jpg',\n\t\t\t'thumbnail_url' => '%2$s/assets/images/head/kernow13-thumb.jpg',\n\t\t),\n\t\t'canoeing' => array(\n\t\t\t'description' => __( 'Canoeing', 'fsesu' ),\n\t\t\t'url' => '%2$s/assets/images/head/canoeing.jpg',\n\t\t\t'thumbnail_url' => '%2$s/assets/images/head/canoeing-thumb.jpg',\n\t\t),\n\t\t'freerunning' => array(\n\t\t\t'description' => __( 'FreeRunning', 'fsesu' ),\n\t\t\t'url' => '%2$s/assets/images/head/freerunning.jpg',\n\t\t\t'thumbnail_url' => '%2$s/assets/images/head/freerunning-thumb.jpg',\n\t\t),\n\t\t'gwent_trek' => array(\n\t\t\t'description' => __( 'Gwent Trek 2013', 'fsesu' ),\n\t\t\t'url' => '%2$s/assets/images/head/gwent_trek.jpg',\n\t\t\t'thumbnail_url' => '%2$s/assets/images/head/gwent_trek-thumb.jpg',\n\t\t),\n\t\t'rhys_new_car' => array(\n\t\t\t'description' => __( 'Rhys\\' New Car', 'fsesu' ),\n\t\t\t'url' => '%2$s/assets/images/head/rhys_new_car.jpg',\n\t\t\t'thumbnail_url' => '%2$s/assets/images/head/rhys_new_car-thumb.jpg',\n\t\t),\n\t\t'buddhist_visit' => array(\n\t\t\t'description' => __( 'Visit to Lam Rim Buddhist Centre', 'fsesu' ),\n\t\t\t'url' => '%2$s/assets/images/head/buddhist_visit.jpg',\n\t\t\t'thumbnail_url' => '%2$s/assets/images/head/buddhist_visit-thumb.jpg',\n\t\t)\n\t) ); \n}", "protected function header()\n {\n\n }", "abstract public function header();", "function bj_header2_setup(){\n\tif(function_exists('the_custom_header')){\n\t\tthe_custom_header();\n\t}\n}", "public function addCustomHeader($name, $value = null)\n {\n if ($value === null) {\n // Value passed in as name:value\n $this->CustomHeader[] = explode(':', $name, 2);\n } else {\n $this->CustomHeader[] = array($name, $value);\n }\n }", "function myheader($additionalHeaderContent = NULL) {\n\t\tprint '<html>';\n\t\t\tprint '<head>';\n\t\t\t\tprint '<title>';\n\t\t\t\t\tif (defined('TITLE')) {\n\t\t\t\t\t\tprint TITLE;\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tprint 'MiddleClik';\n\t\t\t\t\t}\n\t\t\t\tprint '</title>';\n\t\t\t\tprint \"<meta http-equiv=\\\"content-type\\\" content=\\\"text/html; charset=utf-8\\\" />\";\n\t\t\t\tprint $additionalHeaderContent;\n\t\t\t\tprint \"<style type=\\\"text/css\\\">\";\n\t\t\t\t\tprint '//this is where my css, js goes';\n\t\t\t\tprint \"</style>\";\n\t\t\tprint '</head>';\n\t}", "public function withHeader($name, $value)\n {\n }", "function top_news_custom_header_setup() {\n\tadd_theme_support( 'custom-header', apply_filters( 'top_news_custom_header_args', array(\n\t\t'default-image' => '',\n\t\t'width' => 1200,\n\t\t'height' => 120,\n\t\t'wp-head-callback' => 'top_news_header_style',\n\t) ) );\n}", "public function add_header($key, $value)\n {\n }", "public function ajax_header_add()\n {\n }", "public function addHeader($header){\n\t\theader($header);\n\t}", "public function extObjHeader() {}", "protected function setHeader(){\n $this->header = [\n 'Auth-id' => $this->username,\n 'Auth-token' => $this->generateToken(),\n 'Timestamp' => time()\n ];\n }", "function testCustomHeaders() {\n\t$config = getConfig();\n\t$root = getRootPath();\n\t\n\t// Get the test page.\n\t$http = new \\AutoHttp\\Http($config);\n\t$page = $http->getPage($root .'/test/pages/http/customheaders.php', array('X-HttpTestHeader: clienttestval'));\n\t\n\t// Make sure our custom header was sent.\n\tif (strpos($page['body'], 'Custom header detected!') === false)\n\t\treturn 'Custom header wasn\\'t sent.';\n\t\n\treturn true;\n}", "public function addHeaders($headers) {}", "abstract protected function header();", "private function addCommonHeader()\r\n {\r\n $this->response->headers['Allow'] = 'OPTIONS,GET,HEAD,POST,PATCH';\r\n $this->response->headers['Access-Control-Allow-Methods']='OPTIONS,GET,HEAD,POST,PATCH';\r\n $this->response->headers['Access-Control-Allow-Origin']='*';\r\n $this->response->headers['Access-Control-Allow-Headers']= 'Origin, X-Requested-With, Content-Type, Accept, Entity-Length, Offset';\r\n $this->response->headers['Access-Control-Expose-Headers']= 'Location, Range, Content-Disposition, Offset';\r\n }", "function ELECTRON_THEME_SLUG_NAME_custom_header_setup() {\n\t$defaults = array(\n\t\t'default-image' => '',\n\t\t'width' => 0,\n\t\t'height' => 0,\n\t\t'flex-height' => false,\n\t\t'flex-width' => false,\n\t\t'uploads' => true,\n\t\t'random-default' => false,\n\t\t'header-text' => true,\n\t\t'default-text-color' => '',\n\t\t'wp-head-callback' => '',\n\t\t'admin-head-callback' => '',\n\t\t'admin-preview-callback' => '',\n\t);\n\tadd_theme_support( 'custom-header', $defaults );\n}", "public function header() {\n\t}", "private static function setHeaders()\n {\n header('X-Powered-By: Intellivoid-API');\n header('X-Server-Version: 2.0');\n header('X-Organization: Intellivoid Technologies');\n header('X-Author: Zi Xing Narrakas');\n header('X-Request-ID: ' . self::$ReferenceCode);\n }", "function register_header( $wp_customize ) {\n\t$wp_customize->add_panel( 'header', array(\n\t\t'title' => esc_html__( 'Đầu trang', 'phoenixdigi' ),\n\t\t'priority' => 10,\n\t) );\n\n\t$wp_customize->add_section( 'header_template', array(\n\t\t'title' => esc_html__( 'Mẫu giao diện', 'phoenixdigi' ),\n\t\t'panel' => 'header',\n\t) );\n\n\t$wp_customize->add_setting( 'header_template' , array(\n\t\t'default' => 0,\n\t\t'sanitize_callback' => 'Phoenixdigi\\sanitize_value',\n\t) );\n\n\t$library_ids = get_posts( array(\n\t\t'post_type' => 'elementor_library',\n\t\t'fields' => 'ids',\n\t\t// 'meta_key' => 'elementor_library_type',\n\t\t// 'meta_value' => 'header',\n\t\t'posts_per_page' => -1\n\t));\n\n\t$templates = array(\n\t\t'0' => esc_html__( 'Không chọn', 'phoenixdigi' ),\n\t);\n\n\tif ( $library_ids ) {\n\t\tforeach ( $library_ids as $id ) {\n\t\t\t$templates[ $id ] = get_the_title( $id );\n\t\t}\n\t}\n\n\t$wp_customize->add_control( 'header_template', array(\n\t\t'type' => 'select',\n\t\t'label' => esc_html__( 'Mẫu giao diện', 'phoenixdigi' ),\n\t\t'description' => esc_html__( 'Chọn mẫu giao diện cho Header.', 'phoenixdigi' ),\n\t\t'choices' => $templates,\n\t\t'section' => 'header_template',\n\t) );\n\n\t$wp_customize->add_section( 'header_script', array(\n\t\t'title' => esc_html__( 'Nhúng mã Script', 'phoenixdigi' ),\n\t\t'panel' => 'header',\n\t) );\n\n\t// Header script.\n\t$wp_customize->add_setting( 'header_script' , array(\n\t\t'default' => pdvn_get_option_default( 'banner_right' ),\n\t\t'sanitize_callback' => 'Phoenixdigi\\sanitize_value',\n\t) );\n\n\t$wp_customize->add_control( 'header_script', array(\n\t\t'type' => 'textarea',\n\t\t'label' => esc_html__( 'Header script', 'phoenixdigi' ),\n\t\t'description' => esc_html__( 'Nhúng mã Script xuống sau thẻ <head> ví dụ mã Google Analytics.', 'phoenixdigi' ),\n\t\t'section' => 'header_script',\n\t) );\n\n\t// Allow print header script.\n\t$wp_customize->add_setting( 'header_script_on_off' , array(\n\t\t'default' => pdvn_get_option_default( 'header_script_on_off' ),\n\t\t'sanitize_callback' => 'Phoenixdigi\\sanitize_value',\n\t) );\n\n\t$wp_customize->add_control( 'header_script_on_off', array(\n\t\t'type' => 'checkbox',\n\t\t'label' => esc_html__( 'Cho phép nhúng Header script', 'phoenixdigi' ),\n\t\t'section' => 'header_script',\n\t) );\n}", "protected function setHeaders() {\n\t\tif(!self::$headerIncluded) {\n\n\t\t\tif($this->settings['includes']['jquery'])\n\t\t\t\t$this->response->addAdditionalHeaderData('<script type=\"text/javascript\" src=\"http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js\"></script>');\n\n if($this->settings['includes']['mediaelement'])\n\t\t\t $this->response->addAdditionalHeaderData('<script type=\"text/javascript\" src=\"'.t3lib_extMgm::siteRelPath($this->extKey).'Resources/Public/Vibeo/mediaelement-and-player.min.js\"></script>');\n\n\t\t\tif($this->settings['includes']['jquery-resize'])\n\t\t\t\t$this->response->addAdditionalHeaderData('<script type=\"text/javascript\" src=\"'.t3lib_extMgm::siteRelPath($this->extKey).'Resources/Public/Vibeo/jquery.ba-resize.min.js\"></script>');\n\t\t\tif($this->settings['includes']['modernizr'])\n\t\t\t\t$this->response->addAdditionalHeaderData('<script type=\"text/javascript\" src=\"'.t3lib_extMgm::siteRelPath($this->extKey).'Resources/Public/Vibeo/modernizr-2.5.3.js\"></script>');\n\t\t\t\t\t\t\n\t\t\tif($this->settings['includes']['css'])\n\t\t\t\t$this->response->addAdditionalHeaderData('<link rel=\"stylesheet\" href=\"'.t3lib_extMgm::siteRelPath($this->extKey).'Resources/Public/CSS/tx-vibeo.css\" />');\n\n if($this->settings['includes']['mediaelement-css'])\n\t\t\t $this->response->addAdditionalHeaderData('<link rel=\"stylesheet\" href=\"'.t3lib_extMgm::siteRelPath($this->extKey).'Resources/Public/Vibeo/mediaelementplayer.css\" />');\n\n if($this->settings['includes']['mediaelement-skin-css'])\n $this->response->addAdditionalHeaderData('<link rel=\"stylesheet\" href=\"'.t3lib_extMgm::siteRelPath($this->extKey).'Resources/Public/Vibeo/skin-gray.css\" />');\n\n\t\t\tself::$headerIncluded = true;\n\t\t}\n\t}", "function wp_admin_headers()\n {\n }", "public function setHeader($header);", "function add_extra_theme_headers( $extra_headers ) {\n\t$extra_headers[] = 'Shortname';\n\t$extra_headers[] = 'Textdomain';\n\treturn $extra_headers;\n}", "private function addHeaderToStaticMap()\n {\n HeaderLoader::addStaticMap(\n [\n 'xmagentotags' => XMagentoTags::class,\n ]\n );\n }", "function do_signup_header()\n {\n }", "public function header()\n {\n }", "public function authentication_header()\n {\n }", "public function defineHeader()\n {\n $this->header = new Header();\n }", "public function _assign_xoops_header()\n {\n $header_class = webphoto_xoops_header::getInstance($this->_DIRNAME, $this->_TRUST_DIRNAME);\n $header_class->set_flag_css(true);\n $header_class->assign_for_main();\n }", "public function headerCallback($arrAdd);", "public function configureHeaders ()\n {\n $config = $this->app->config('github');\n\n $headers = array(\n 'Accept: application/vnd.github.v3+json',\n sprintf('User-Agent: %s', $config['handle'])\n );\n\n $this->addHeaders($headers);\n }", "static public function addAdditionalHeader($new_header) {\n\t\tif (is_array($new_header)) {\n\t\t\tself::$additional_headers = array_merge(self::$additional_headers, $new_header);\n\t\t} else {\n self::$additional_headers[] = (string)trim($new_header);\n }\n\t}", "protected function headerAdditional() {\n return '';\n }", "function charity_header() {\n do_action('charity_header');\n}", "private function do_header() {\n $m_header = '';\n $m_header .= '<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\" />';\n $m_header .= '<meta http-equiv=\"Content-Language\" content=\"en-gb\" />';\n // $m_header .= '<link rel=stylesheet href=' . $this->c_path . '/../css/reset.css type=text/css />';\n // $m_header .= '<link rel=stylesheet href=' . $this->c_path . '/../css/style.css type=text/css />';\n $this->c_header = $m_header;\n }", "function set_additional_headers()\n {\n $this->AdditionalHeaders = array (\n 'From' => $this->FromName . '< ' . $this->FromAddress . ' >' . $this->LF,\n 'Reply-To' => $this->ReplyTo . $this->LF,\n 'Return-Path' => $this->ReturnPath . $this->LF,\n 'X-Sender' => $this->SenderName . '< ' . $this->SenderAddress . ' >' . $this->LF,\n 'X-Mailer' => $this->XMailer . $this->LF,\n 'X-Priority' => $this->Priority . $this->LF,\n 'Content-Type' => $this->ContentType . '; ' . 'charset=' . $this->CharSet . $this->LF,\n 'MIME-Version' => $this->MimeVersion . $this->LF,\n ); \n }", "public function addToHeader(string $header, string $content): ResponseInterface;", "static public function setAdditionalHeader($new_header) {\n\t\tif (is_string($new_header)) {\n\t\t\tself::$additional_headers = array($new_header);\n\t\t}\n\t\tself::$additional_headers = (array)$new_header;\n\t}", "function dg_custom_header() {\n\t\n\t//meta tag view port\n\techo '<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no\" />';\n\t\n\t// GMT\n\t\n\techo \"\n\t\t<!-- Google Tag Manager -->\n\t\t<script>\n\t\t\t(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':\n\t\t\tnew Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],\n\t\t\tj=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=\n\t\t\t'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);\n\t\t\t})(window,document,'script','dataLayer','GTM-M794Z5N');\n\t\t</script>\n\t\t<!-- End Google Tag Manager -->\n\t\";\n\t\n\t// for EN typeface\n\techo '<link rel=\"stylesheet\" href=\"https://use.typekit.net/wlv6frg.css\">';\n\t\n\t// favicon\n/*\techo '\n\t\t<link rel=\"icon\" media=\"(prefers-color-scheme:light)\" href=\"' . get_template_directory_uri() . '/img/favicon-dark.png\" type=\"image/png\" />\n\t\t<link rel=\"icon\" media=\"(prefers-color-scheme:dark)\" href=\"' . get_template_directory_uri() . '/img/favicon-light.png\" type=\"image/png\" />\n\t\t';\n*/\t\t\n\t\n}", "function kvell_edge_init_register_header_standard_type() {\n\t\tadd_filter( 'kvell_edge_register_header_type_class', 'kvell_edge_register_header_standard_type' );\n\t}", "function header() {\n }", "protected function addMeta() {\n foreach ($this->meta_info as $key => $meta) {\n $this->header.=\"<meta name='\" . $key . \"' content='\" . $meta . \"' /> \\n\";\n }\n }", "function bfa_add_html_inserts_header() {\r\n\tglobal $bfa_ata;\r\n\tif( $bfa_ata['html_inserts_header'] != '' ) bfa_incl('html_inserts_header'); \r\n}", "public function setCustomHeader(string $name, string $value): void\n {\n $this->customHeaders[$name] = $value;\n }", "public function setHeader($name, $value) {}", "public function enableCustomHeaders()\n {\n $this->useCustomHeaders = true;\n\n return $this;\n }", "public function addHeader($header)\n\t{\n\t\theader($header);\n\t}", "public function Header(){\n\n }", "public function alter_header()\n\t{\n\t\theader(\"HTTP/1.0 $this->code $this->title\");\n\t}", "function in_admin_header()\n {\n }", "function addHeader($name, $content) {\n\t\t$updated = false;\n\n\t\tif (($headers = $this->getData('headers')) == null) {\n\t\t\t$headers = array();\n\t\t}\n\n\t\tforeach ($headers as $key => $value) {\n\t\t\tif ($value['name'] == $name) {\n\t\t\t\t$headers[$key]['content'] = $content;\n\t\t\t\t$updated = true;\n\t\t\t}\n\t\t}\n\n\t\tif (!$updated) {\n\t\t\tarray_push($headers, array('name' => $name,'content' => $content));\n\t\t}\n\n\t\t$this->setData('headers', $headers);\n\t}", "public function headerProvider() {\n return array(\n array('User-Agent', 'test'),\n array('X-Custom', 'value'),\n array('Accept', 'text/plain'),\n );\n }", "abstract public function SetHeaders();", "function header_register_callback($callback): bool {}", "public static function set_headers()\n {\n }", "public function addHeader(string $header, string $value)\n {\n $this->mailObj->addCustomHeader($header, $value);\n }", "public function withAddedHeader($name, $value)\r\n {\r\n // TODO: Implement withAddedHeader() method.\r\n }", "protected function setHeader($header_extra = '') {\n $this->header = \"<!DOCTYPE html> \\n <html> \\n <head> \\n <meta charset='utf-8'> \\n <title>Log-in Page Project</title>\";\n $this->loadConfig();\n $this->addMeta();\n $this->addJS();\n $this->addCSS();\n $this->header.=$header_extra;\n $this->header.=\"</head>\";\n return $this->header;\n }", "public function getCustomHeaders()\n {\n return $this->CustomHeader;\n }", "private function setHeaderInformation()\n {\n $this->header = new \\stdClass();\n $request \t= \\Yii::$app->request;\n $requestHeaders = $request->getHeaders();\n foreach ($this->headerKey as $key => $value) {\n if ($requestHeaders->offsetExists($value)) {\n $this->header->$value = $requestHeaders->get($value);\n $this->header->status =200;\n } else {\n $this->header->status =500;\n yii::error('Header '.$value.\" is missing\", 'api_request');\n break;\n }\n }\n }", "public function add_extra_headers() {\n\t\t$gu_extra_headers = [\n\t\t\t'RequiresWP' => 'Requires WP',\n\t\t\t'ReleaseAsset' => 'Release Asset',\n\t\t\t'PrimaryBranch' => 'Primary Branch',\n\t\t];\n\n\t\t$uri_types = [\n\t\t\t'PluginURI' => ' Plugin URI',\n\t\t\t'ThemeURI' => ' Theme URI',\n\t\t];\n\n\t\tforeach ( self::$git_servers as $server ) {\n\t\t\tforeach ( $uri_types as $uri_key => $uri_value ) {\n\t\t\t\t$gu_extra_headers[ $server . $uri_key ] = $server . $uri_value;\n\t\t\t}\n\t\t\tforeach ( self::$extra_repo_headers as $header_key => $header_value ) {\n\t\t\t\t$gu_extra_headers[ $server . $header_key ] = $server . ' ' . $header_value;\n\t\t\t}\n\t\t}\n\n\t\tself::$extra_headers = array_unique( array_merge( self::$extra_headers, $gu_extra_headers ) );\n\t\tksort( self::$extra_headers );\n\n\t\treturn self::$extra_headers;\n\t}", "public function extObjHeader()\n {\n if (is_callable([$this->extObj, 'head'])) {\n $this->extObj->head();\n }\n }", "protected function setCurlHeaderElement() {\n // set header for cur\n $this->header[] = 'Content-type: application/json';\n $this->header[] = 'Authorization: Bearer '.$this->accessToken;\n }", "public function getAdditionalHeaderData() {}", "function faculty_settings_header() {\n faculty_setting_line(faculty_add_size_setting('header_image_height', __('Header Height', FACULTY_DOMAIN), 2));\n faculty_setting_line(faculty_add_size_setting('header_title_area_width', __('Header Title Area Width', FACULTY_DOMAIN), 2));\n faculty_setting_line(faculty_add_size_setting('header_widget_area_width', __('Header Widget Area Width', FACULTY_DOMAIN), 2));\n faculty_setting_line(faculty_add_background_color_setting('header_background_color', __('Background', FACULTY_DOMAIN)));\n do_action('faculty_settings_header');\n faculty_setting_line(faculty_add_note(sprintf(__('Save your settings before customizing your <a href=\"%s\">header</a>.', FACULTY_DOMAIN), admin_url('themes.php?page=custom-header'))));\n}", "function cera_grimlock_header() {\n\t\tdo_action( 'grimlock_preheader', array(\n\t\t\t'callback' => 'cera_grimlock_preheader_callback',\n\t\t) );\n\n\t\tdo_action( 'grimlock_header', array(\n\t\t\t'callback' => 'cera_grimlock_header_callback',\n\t\t) );\n\t}" ]
[ "0.7998112", "0.7884961", "0.7749753", "0.7379095", "0.72656703", "0.7257042", "0.72494227", "0.720634", "0.72039765", "0.7164059", "0.7082689", "0.6953643", "0.6889335", "0.6885103", "0.68807775", "0.68757164", "0.68388426", "0.68356556", "0.68234944", "0.6816629", "0.6812969", "0.6812969", "0.6806693", "0.6806693", "0.67823577", "0.6777092", "0.67634594", "0.6758682", "0.67490053", "0.67343414", "0.6701242", "0.66901916", "0.66855645", "0.6651738", "0.66468054", "0.66269785", "0.6620795", "0.661861", "0.6606954", "0.6604734", "0.65895474", "0.6575499", "0.65683526", "0.65594006", "0.6555835", "0.65473133", "0.65320987", "0.6531556", "0.652671", "0.6495942", "0.6471579", "0.6429809", "0.6424988", "0.64202183", "0.6408838", "0.6385124", "0.63512623", "0.6351187", "0.63502973", "0.6344231", "0.634244", "0.63387704", "0.63261133", "0.6325884", "0.63194114", "0.63108826", "0.6310872", "0.63102156", "0.63073826", "0.62971646", "0.6296057", "0.6287262", "0.6287158", "0.6279513", "0.6277304", "0.6267395", "0.62666386", "0.6266264", "0.62545675", "0.6244463", "0.62423515", "0.62217945", "0.6218538", "0.6216508", "0.6214851", "0.6209695", "0.62069404", "0.6201283", "0.6194994", "0.6192801", "0.6192111", "0.61915624", "0.61894345", "0.61843175", "0.6174804", "0.6158842", "0.61585677", "0.61523336", "0.61421657", "0.61382055" ]
0.76335675
3
Could check that $record exists and is an array
private static function instantiate($record) { // Simple long-form approach $obj = new self; // $obj->id = $record['id']; // $obj->username = $record['username']; // $obj->password = $record['password']; // $obj->first_name = $record['first_name']; // $obj->last_name = $record['last_name']; // More Dynamic, short form approach foreach($record as $attribute=>$value){ if($obj->has_attribute($attribute)) { $obj->$attribute = $value; } } return $obj; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function hasRecord();", "public function hasRecord() {}", "public function isHasRecord(): bool;", "public function recordExists($id)\n {\n return is_array($this->selectSingleFields($id, ['id'], false));\n }", "public function isHandling(array $record): bool\n {\n if (empty($this->levelValues)) {\n return true;\n }\n\n return in_array($record['level'], $this->levelValues, true);\n }", "function singleRecord() {\n $this->Record = mysqli_fetch_array($this->result, MYSQLI_ASSOC);\n $this->rs = $this->Record;\n $stat = is_array($this->Record);\n return $stat;\n }", "public function checkRecordIsExist ($field,$table,$idrecord,$opt=\"integer\");", "function singleRecord() {\r\n $this->Record = mysql_fetch_assoc( $this->Query_ID );\r\n $stat = is_array( $this->Record );\r\n return $stat;\r\n }", "function singleRecord()\n {\n $this->Record = mysql_fetch_array( $this->Query_ID );\n $stat = is_array( $this->Record );\n return $stat;\n }", "public function recordExistsInRegisteredRecords($email_records_sent,$record){\n if (is_array($email_records_sent)) {\n $records_registered = array_map('trim', $email_records_sent);\n } else if (is_string($email_records_sent)) {\n $records_registered = array_map('trim', explode(',', $email_records_sent));\n } else if ($email_records_sent === NULL) {\n $records_registered = [];\n } else {\n throw new \\Exception(\"Invalid format\");\n }\n foreach ($records_registered as $record_registered){\n if($record == $record_registered){\n return true;\n }\n }\n return false;\n }", "private function db_record_check($data) {\n // count lenght of array\n $array_lenght = count($data);\n \n //if lenght is less than 1, means user account isnt verified\n if($array_lenght == 0){\n echo $this->dbFeedBack(FALSE);\n } \n else {\n echo $this->dbFeedBack(TRUE);\n } \n }", "protected function recordHasContext(array $record): bool\n {\n return (\n array_key_exists('context', $record)\n );\n }", "public function isRecord() {\n return count($this->primaryKeys) === 1;\n }", "private function process_array($value) {\n return is_array($value);\n }", "public function hasData(): bool {\n return is_array($this->data);\n }", "function isEmpty($record)\n {\n $languages = $this->getLanguages();\n for ($i=0,$_i=count($languages);$i<$_i;$i++)\n {\n if(isset($record[$this->fieldName()][$languages[$i]])) return 0;\n }\n\n return 1;\n }", "private function isArrayField(string $field) : bool\r\n {\r\n return substr($field, 0, 2) == '[]';\r\n }", "public function isValidRow(array $record): bool\r\n {\r\n $this->lastError = '';\r\n if (count($record) !== $this->getColumnCount()) {\r\n $this->lastError = 'The number of columns in the record does'\r\n . ' not match the number of defined columns';\r\n return false;\r\n }\r\n\r\n foreach ($this->columns as $id => $rules) {\r\n if (!array_key_exists($id, $record)) {\r\n $this->lastError = sprintf(\r\n 'No value for column \"%s\" is given', $id\r\n );\r\n return false;\r\n }\r\n if (!$this->isValidFieldValue($id, $record[$id])) {\r\n return false;\r\n }\r\n }\r\n\r\n return true;\r\n }", "function surveyResponseExists($project_id, $record) {\n\t//if (!is_numeric($project_id) || !is_numeric($record)) return false;\n\t$sql = \"select 1 from redcap_data where project_id = $project_id and record = '$record' limit 1\";\n\t$q = db_query($sql);\n\treturn (db_num_rows($q) > 0);\n}", "public function valid(){\n\t\treturn (is_array($this->data) ? key($this->data) !== null : false);\n\t}", "function hasArray($arr) {\r\n\tforeach ($arr as $value) {\r\n\t\tif(is_array($value))\r\n\t\t\treturn true;\r\n\t}\r\n\treturn false;\r\n}", "function acf_is_array($array)\n{\n}", "function is_assoc (&$arr) {\n try{\n return (is_array($arr) && (!count($arr) || count(array_filter(array_keys($arr),'is_string')) == count($arr)));\n }catch(Exception $e){\n return false;\n }\n }", "function rest_is_array($maybe_array)\n {\n }", "public function isArray()\n {\n return \\is_array($this->value);\n }", "public function offsetExists($offset)\n {\n if(isset($this->data) && is_array($this->data) && array_key_exists($offset, $this->data))\n {\n return true;\n }\n return false;\n }", "protected function validateArray($value){\n\t\treturn is_array($value);\n\t}", "function single() {\n $this->Record = mysqli_fetch_array($this->result, MYSQLI_ASSOC);\n $this->rs = $this->Record;\n $stat = is_array($this->Record);\n return $stat;\n }", "function check_subFields($data){\n $result = array();\n $id = $data['id'];\n $connection = dbConnect();\n $email = mysqli_real_escape_string($connection, $data['email']);\n\n if($id == 0)\n return \"Id can not be 0!\";\n\n $query_check1 = selectRecord(TAB_SUBSCRIBERS, \"id = $id\");\n $query_check2 = selectRecord(TAB_SUBSCRIBERS, \"email = '$email'\");\n if(count($query_check1) > 0 || count($query_check2) > 0)\n return \"Id or email already exist.\";\n\n $result['id'] = $id;\n $result['email'] = $email;\n return $result;\n}", "public function valid()\n {\n return isset($this->records[$this->position]);\n }", "public function isSuccessful()\r\n {\r\n return is_array($this->data);\r\n }", "public function offsetExists($offset)\n {\n return is_array($this->data) && array_key_exists($offset, $this->data);\n }", "public function isArray(): bool\n {\n return false;\n }", "public function isArray(): bool\n {\n return false;\n }", "function recordExists()\n {\n global $objDatabase;\n\n $query = \"\n SELECT 1\n FROM \".DBPREFIX.\"module_shop\".MODULE_INDEX.\"_products\n WHERE id=$this->id\";\n $objResult = $objDatabase->Execute($query);\n if (!$objResult || $objResult->EOF) return false;\n return true;\n }", "public function check_meta_is_array($value, $request, $param)\n {\n }", "public function isValid() {\n\t\treturn !is_array($this->data) && count($this->data->getRawData()) > 0;\n\t}", "private function is_param_array($param){\n\t\tif(!is_array($param)){\n\t\t\t$this->text(\"Invalid parameter, cannot reply with appropriate message\");\n\t\t\treturn false;\n\t\t}else{\n\t\t\treturn true;\n\t\t}\n\t}", "private function isArrayElement($line) {\n\t//--\n\tif(!$line) {\n\t\treturn false;\n\t} //end if\n\t//--\n\tif($line[0] != '-') {\n\t\treturn false;\n\t} //end if\n\t//--\n\tif(strlen($line) > 3) {\n\t\tif(substr($line, 0, 3) == '---') {\n\t\t\treturn false;\n\t\t} //end if\n\t} //end if\n\t//--\n\treturn true;\n\t//--\n}", "function offsetExists(/*. mixed .*/ $object_){}", "public function existsField($key){ return array_key_exists($key,$this->field_map); }", "public function isValidRecord()\n {\n // Get specific record\n $Model = $this->setWhereIndexes(clone $this->Model);\n $record = $Model->first();\n // Is valid record\n if (!$record) {\n // Redirect to List Page\n // Set session flash for notify Entry is not exist\n return redirect($this->getFormAction())\n ->with('dk_' . $this->getIdentifier() . '_info_error', trans('dkscaffolding.no.entry'));\n }\n return $record;\n }", "function offsetExists($offset)\n\t{\n\t\treturn isset($this->fields[$offset]);\n\t}", "protected function RecordOfFields($record)\n {\n $mine=array();\n foreach ($this->field_list as $field) {\n if (array_key_exists($field,$record))\n $mine[$field]=$record[$field];\n }\n\n return($mine);\n }", "protected function _dependentRecordsFromJson(&$record)\n {\n $config = $record::getConfiguration();\n if ($config) {\n \n $recordsFields = $config->recordsFields;\n \n if ($recordsFields) {\n foreach ($recordsFields as $property => $fieldDef) {\n\n $rcn = $fieldDef['config']['recordClassName'];\n if ($record->has($property) && $record->{$property} && is_array($record->{$property})) {\n $recordSet = new RecordSet($rcn);\n foreach ($record->{$property} as $recordArray) {\n if (is_array($recordArray)) {\n $srecord = new $rcn(array(), true);\n $srecord->setFromJsonInUsersTimezone($recordArray);\n $recordSet->addRecord($srecord);\n } else {\n if (Core::isLogLevel(LogLevel::ERR)) Core::getLogger()->err(__METHOD__ . '::' . __LINE__\n . ' Record array expected, got: ' . $recordArray);\n throw new InvalidArgument('Record array expected');\n }\n $record->{$property} = $recordSet;\n }\n }\n }\n }\n }\n }", "function isArray ($value)\r\n{\r\n\treturn is_array ($value);\r\n}", "public function hasScoreRecordList(){\n return $this->_has(2);\n }", "function validate_row_exists(array $inputs, array &$form): bool\n{\n if(App::$db->rowExists('wall', $inputs['id'])){\n return true;\n }\n\n return false;\n}", "public function loaded()\n {\n return is_array($this->data);\n }", "function isArray($obj)\n {\n return is_array($obj) || isArrayAccess($obj);\n }", "function multiKeyExists(array $arr, $key){ if (array_key_exists($key, $arr)) {\n return true;\n }\n // check arrays contained in this array\n foreach ($arr as $element) {\n if (is_array($element)) {\n if ($this->multiKeyExists($element, $key)) {\n return true;\n }\n }\n\n }\n return false;\n}", "public function valid() {\n return array_key_exists($this->_key, $this->_data);\n }", "function isAssoc () {\r\n\t\treturn Arr::is_assoc($this->data);\r\n }", "function checkReference() {\n\t\t$arrRecord = BackendUtility::getRecord($this->arrWizardParameters['table'], $this->arrWizardParameters['uid']);\n\t\tif (!is_array($arrRecord))\t{\n\t\t\tBackendUtility::typo3PrintError('Wizard Error', 'No reference to record', 0);\n\t\t\texit;\n\t\t}\n }", "private function checkIsExists(): bool\n {\n $id = $this->readImproved([\n 'what' => [$this->table. '.id'],\n 'where' => [\n $this->table. '.listId' => $this->listId,\n $this->table. '.campaignId' => $this->campaignId,\n ]\n ]);\n\n return !is_null($id);\n }", "public function offsetExists($offset) {}", "public function offsetExists($offset) {}", "public function offsetExists($offset) {}", "public function offsetExists($offset) {}", "public function offsetExists($offset) {}", "public function offsetExists($offset) {}", "public function offsetExists ($offset) {\n return isset($this->__fields[$offset]);\n }", "public function dataExists($pointer) {\n\t\treturn is_array($this->dataSet[$pointer]) ? true : false;\n\t}", "public function isArray(): bool\n {\n return $this->phpType === self::HASH;\n }", "public function check($key) {\n if (!is_array($key)) {\n $key = array($key);\n }\n\n foreach ($key as $field) {\n\t\t\tif (!MOC_Array::check($this->data, $field)) {\n\t\t\t\treturn false;\n\t\t\t}\n }\n return true;\n }", "public function isArray()\n {\n return ($this->countOwnAttributes() === 1 && stripos($this->getName(), 'array') !== false);\n }", "public function isValid($value): bool\n {\n return is_array($value) || method_exists($value, 'toArray');\n }", "public function validArrayForArrayConfigurationProvider() {}", "public function checkArray($value)\n {\n return $this->checkHasType($value, 'array');\n }", "public function has($idorarray)\n\t{ \n\t\tif (gettype($idorarray) == 'array') {\n\t\t\tforeach($idorarray as $key => $value) {\n\t\t\t\t$this->where($key, '=', $value);\n\t\t\t} // foreach\n\t\t} // if\n\t\t$return = $this->limit(1)->read();\n\n\t\t// ... !=0) null: no result, false: issue\n\t\tif ($return != 0) return true;\n\t\treturn false;\n\t}", "public function testFacilityUseEventExistsAndIsArray($model, $classname)\n {\n $this->assertTrue($model->getEvent() !== null);\n $this->assertTrue(is_array($model->getEvent()));\n }", "public function exists($key){return array_key_exists($key,$this->items_array);}", "private function validateArrayElement($element, $type) {\n\n return gettype($element) == $type ? true : false;\n\n }", "public static function has_array_access($input)\n {\n }", "function arrayAccessible($value)\n {\n return is_array($value);\n }", "private function isPlainArray($line) {\n\t//--\n\treturn (($line[0] == '[') && (substr($line, -1, 1) == ']'));\n\t//--\n}", "public function isArray()\n {\n return $this->_type == self::BEAN_CONSTRUCTOR_ARRAY;\n }", "private function _isArray($value) {\n return is_array($value) && array_keys($value) === range(0, sizeof($value) - 1);\n }", "function is_assoc($arr) {\n return (is_array($arr) && count(array_filter(array_keys($arr),'is_string')) == count($arr));\n}", "function offsetExists($offset) {\n if(!is_int($offset) && !is_string($offset)) {\n return false;\n }\n \n $property = defined('static::$DOMAIN_PROPERTY') ? static::$DOMAIN_PROPERTY : 'data';\n \n if(!isset($this->{$property})) {\n $this->{$property} = [];\n }\n \n return array_key_exists($offset, $this->{$property});\n }", "function questionIdsExist($arr, $form) {\r\n\r\n\t$formId = getFormId($form);\r\n\tif($formId) {\r\n\t\tforeach ($arr as $value) {\r\n\t\t\tif(is_array($value)) {\r\n\t\t\t\tquestionIdsExist($value, $form);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tif(getQuestionId($value, $form) == null) return false;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t}\r\n\telse return false;\r\n}", "protected function ReadInputRecord(&$recArr)\n {\n global $g_BizSystem;\n foreach ($this->m_RecordRow as $fldCtrl) {\n if ($fldCtrl->CanDisplayed()) {\n $value = $g_BizSystem->GetClientProxy()->GetFormInputs($fldCtrl->m_Name);\n $recArr[$fldCtrl->m_BizFieldName] = $value;\n }\n }\n return true;\n }", "public function get_record(string $record_id):array\n{ \n\n // Get record\n $row = array();\n\n // Return\n return $row;\n\n}", "public function exists(){\n\n\t\treturn (!empty($this->_data)) ? true : false;\n\n\t}", "private function checkIsExists(): bool\n {\n $where = [\n $this->table. '.vendorId' => $this->vendorId,\n $this->table. '.campaign' => $this->campaign,\n ];\n\n if (!is_null($this->id)) {\n $where[$this->table. '.id !='] = $this->id;\n }\n\n $id = $this->readImproved([\n 'what' => [$this->table. '.id'],\n 'where' => $where\n ]);\n\n return !is_null($id);\n }", "function _field_checkarray_or($fval) \n {\n return $this->_field_checkarray($fval, 1);\n }", "function array_is_list(array $arr): bool\n {\n if ($arr === []) {\n return true;\n }\n return array_keys($arr) === range(0, count($arr) - 1);\n }", "public function isEncodedArrayFieldValue($value)\n {\n if (!is_array($value)) {\n return false;\n }\n unset($value['__empty']);\n foreach ($value as $row) {\n if (!is_array($row) || !array_key_exists('predefined_values_donation', $row)) {\n return false;\n }\n }\n return true;\n }", "function constraint_mustBeDatastoreRecord($record)\n{\n\tif (! $record instanceof Datastore_Record)\n {\n \tthrow new PHP_E_ConstraintFailed(__FUNCTION__);\n }\n}", "protected function is_single($data){\n foreach ($data as $value){\n if (is_array($value)){\n return false;\n }\n return true;\n }\n }", "private function isAssocArray($array = array()){\n\t if(!is_numeric(array_shift(array_keys($array)))){\n\t return true;\n\t }\n \treturn false;\n\t}", "public /*bool*/ function offsetExists(/*scalar*/ $offset)\n\t{\n\t\treturn isset($this->_data[$offset]);\n\t}", "private static function tinydb_is_assoc($array)\n {\n return (bool)count(array_filter(array_keys($array), 'is_string'));\n }", "function wpsl_is_multi_array( $array ) {\n\n foreach ( $array as $value ) {\n if ( is_array( $value ) ) return true;\n }\n\n return false;\n}", "function acf_is_associative_array($array)\n{\n}", "public function is_exists(Array $columns, Array $records, $printSQL = false) {\n\t\treturn $this->get_database_utils ()->is_exists ( $this->get_table (), $columns, $records, $printSQL );\n\t}", "public function is_exists(Array $columns, Array $records, $printSQL = false) {\n\t\treturn $this->get_database_utils ()->is_exists ( $this->get_table (), $columns, $records, $printSQL );\n\t}", "public function is_exists(Array $columns, Array $records, $printSQL = false) {\n\t\treturn $this->get_database_utils ()->is_exists ( $this->get_table (), $columns, $records, $printSQL );\n\t}", "public static function isArray($element, $require_content = true)\n {\n return (!is_array($element)) ? false : ($require_content && empty($element) ? false : true);\n }", "public function testIsArray() {\n\t\t$array = array('one' => 1, 'two' => 2);\n\t\t$result = _::isArray($array);\n\t\t$this->assertTrue($result);\n\n\t\t// test that an object is not an array\n\t\t$object = (object)$array;\n\t\t$result = _::isArray($object);\n\t\t$this->assertFalse($result);\n\t}", "function valid() {\r\n return isset($this->_data[$this->_position]);\r\n }" ]
[ "0.68212956", "0.68119675", "0.6409761", "0.6356332", "0.62192833", "0.61862963", "0.6070725", "0.6049837", "0.60480493", "0.6042823", "0.60179496", "0.6009134", "0.5991378", "0.5970569", "0.5963178", "0.5938146", "0.5936094", "0.59297365", "0.58797693", "0.58343446", "0.5831959", "0.5810056", "0.57850033", "0.5759345", "0.57400185", "0.570885", "0.56770176", "0.5676246", "0.5668446", "0.5667777", "0.5664425", "0.5625959", "0.5622631", "0.5622631", "0.5609647", "0.5594309", "0.5594114", "0.5591209", "0.5548831", "0.55420697", "0.55213344", "0.55121595", "0.55103624", "0.54991", "0.54839325", "0.5479117", "0.54690474", "0.5452233", "0.5450974", "0.5444326", "0.5441612", "0.54403335", "0.5429013", "0.54238737", "0.5413525", "0.5393588", "0.5393588", "0.5393588", "0.5393588", "0.5393588", "0.5393588", "0.53922564", "0.5390461", "0.53790975", "0.5377681", "0.5370387", "0.5369245", "0.5352726", "0.53495264", "0.5344545", "0.53377885", "0.5325098", "0.532429", "0.53239524", "0.53159255", "0.5312555", "0.5311825", "0.5308861", "0.53033537", "0.5303045", "0.5300291", "0.5297052", "0.52899206", "0.5284222", "0.5282281", "0.5278949", "0.5266207", "0.52643645", "0.5261947", "0.52571774", "0.5254877", "0.52546453", "0.5254066", "0.52535486", "0.5246899", "0.5246", "0.5246", "0.5246", "0.5245049", "0.5238569", "0.52336484" ]
0.0
-1
get_object_vars returns an associative array with all attributes
private function has_attribute($attribute) { // (incl. private ones!) as the keys and their current values as the value $object_vars = get_object_vars($this); // We don't care about the value, we just want to know if the key exists // Will return true or false return array_key_exists($attribute, $object_vars); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function vars()\n {\n \n return new ArrayWrapper(get_object_vars($this->object));\n \n }", "public static function getObjectVars($object)\n\t{\n\t\treturn get_object_vars($object);\n\t}", "public static function getObjectVars($object)\n {\n return get_object_vars($object);\n }", "public function getAllProperties(): array\n {\n return get_object_vars($this);\n }", "public function getAttributesFromClass($object): array\n {\n return get_object_vars($object);\n }", "protected function getVars()\n {\n return array_merge(parent::getVars(),get_object_vars($this));\n }", "public function getObjectInfo($obj) : array {\n return get_object_vars($obj);\n }", "public function get_all(){\n return get_object_vars($this);\n }", "public function getProperties()\n {\n return get_object_vars($this);\n }", "public function get_properties()\r\n\t{\r\n\t\treturn get_object_vars($this);\r\n\t}", "public function objectToArray()\n {\n return get_object_vars($this);\n }", "public function getObjects()\n {\n return get_object_vars($this);\n }", "public function getObjects()\n {\n return get_object_vars($this);\n }", "function getObjectVars(&$obj)\n\t{\n\t\t$parent_object_vars=get_class_vars(get_parent_class($obj));\n\t\t$object_vars=get_object_vars($obj);\n\t\tforeach ($parent_object_vars as $key=>$value)\n\t\t\tforeach ($object_vars as $_key=>$_value)\n\t\t\t\tif ($key==$_key) { unset($object_vars[$_key]); break; }\n\t\treturn $object_vars;\n\t}", "public function attributes(){\r\n /*\r\n $attributes = array();\r\n foreach(self::$db_fields as $field){\r\n if(property_exists($this, $field)){\r\n\t $attributes[$field] = $this->$field;\r\n\t }\r\n }\r\n return $attributes;\r\n */\r\n \r\n //return get_object_vars($this);\r\n return $this->variables;\r\n }", "public function getFields() : array\n {\n return get_object_vars($this);\n }", "protected function get_variables_for_view()\n\t{\n\t\t$ary = array();\n\t\tforeach (get_object_vars ($this->set) as $k => $v)\n\t\t\t$ary[$k] = $v;\n\t\treturn $ary;\n\t}", "public static function recursiveGetObjectVars($obj){\n \t\t$arr = array();\n \t\t$_arr = is_object($obj) ? get_object_vars($obj) : $obj;\n \t\t\n \t\tforeach ($_arr as $key => $val) {\n \t\t\t$val = (is_array($val) || is_object($val)) ? self::recursiveGetObjectVars($val) : $val;\n \t\t\t\n \t\t\t// Transform boolean into 1 or 0 to make it safe across all Opauth HTTP transports\n \t\t\tif (is_bool($val)) $val = ($val) ? 1 : 0;\n \t\t\t\n \t\t\t$arr[$key] = $val;\n \t\t}\n \t\t\n \t\treturn $arr;\n }", "public function getProperties(): array\n {\n return array_keys(get_object_vars($this));\n }", "function jsonSerialize()\n {\n $vars = get_object_vars($this);\n return $vars;\n }", "public function getVars()\n {\n $vars = get_object_vars($this);\n foreach ($vars as $key => $value) {\n if ('_' == substr($key, 0, 1)) {\n unset($vars[$key]);\n }\n }\n\n return $vars;\n }", "public function toArray() {\n\t\t$array = [ ];\n\t\t$vars = get_object_vars($this);\n\t\tforeach ( $vars as $property => $value ) {\n\t\t\t$array[$property] = $value;\n\t\t}\n\n\t\treturn $array;\n\t}", "public function dump()\r\n {\r\n return get_object_vars($this);\r\n }", "public function toArray() {\n $vars = get_object_vars ( $this );\n $array = array ();\n foreach ( $vars as $key => $value ) {\n $array [ltrim ( $key, '_' )] = $value;\n }\n return $array;\n }", "public function toArray() : array{\n return get_object_vars( $this );\n }", "public function toArray() {\n $vars = get_object_vars($this);\n unset(\n $vars['rawdata'], \n $vars['inputFilter'],\n $vars['__initializer__'], \n $vars['__cloner__'], \n $vars['__isInitialized__']\n );\n foreach($vars as $key =>$val){\n if(is_object($val))\n $vars[$key] = $val->toArray();\n }\n return $vars;\n }", "public function getProperties()\n {\n $vars = get_object_vars($this);\n\n foreach ($vars as $key => $value) {\n if (strcmp(\"db\", $key) == 0) {\n unset($vars[$key]);\n break;\n }\n }\n\n return $vars;\n }", "public function __toArray(): array\n {\n return call_user_func('get_object_vars', $this);\n }", "public function __debugInfo() : array\n {\n return get_object_vars($this);\n }", "function dismount($object) {\n $reflectionClass = new \\ReflectionClass(get_class($object));\n $array = array();\n foreach ($reflectionClass->getProperties() as $property) {\n $property->setAccessible(true);\n $array[$property->getName()] = $property->getValue($object);\n $property->setAccessible(false);\n }\n return $array;\n }", "function toArray() {\n\t\treturn get_object_vars($this);\n\t}", "function toArray() {\n\t\treturn get_object_vars($this);\n\t}", "function toArray() {\n\t\treturn get_object_vars($this);\n\t}", "function toArray() {\n\t\treturn get_object_vars($this);\n\t}", "function toArray() {\n\t\treturn get_object_vars($this);\n\t}", "function toArray() {\n\t\treturn get_object_vars($this);\n\t}", "function toArray() {\n\t\treturn get_object_vars($this);\n\t}", "function toArray() {\n\t\treturn get_object_vars($this);\n\t}", "function toArray() {\n\t\treturn get_object_vars($this);\n\t}", "public function toArray() {\n\t\t$ret = array();\n\t\tforeach (array_keys($this->_vars) as $name) {\n\t\t\tif ($this->_vars[$name]->not_loaded) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (is_object($this->_vars[$name]->value)) {\n\t\t\t\t$ret[$name] = serialize($this->_vars[$name]->value);\n\t\t\t} else {\n\t\t\t\t$ret[$name] = $this->_vars[$name]->value;\n\t\t\t}\n\t\t}\n\t\treturn $ret;\n\t}", "public function toArray(): array\r\n {\r\n return get_object_vars($this);\r\n }", "public function getParameters()\n {\n return get_object_vars($this->record);\n }", "protected function getObjectParams($obj){\n\t\treturn array();\n\t}", "public function toArray() {\n return get_object_vars($this);\n }", "public function toArray() {\n return get_object_vars($this);\n }", "public function toArray() {\n return get_object_vars($this);\n }", "public function toArray() {\n\t\treturn get_object_vars($this);\n\t}", "public function getVars(){\n return $this->getClassVars()->getValues();\n }", "public function jsonSerialize()\r\n {\r\n return get_object_vars($this);\r\n }", "public function expose() {\n return get_object_vars($this);\n }", "public function __debugInfo() {\n \n \t$reflect\t= new \\ReflectionObject($this);\n \t$varArray\t= array();\n \n \tforeach ($reflect->getProperties(\\ReflectionProperty::IS_PUBLIC) as $prop) {\n \t\t$propName = $prop->getName();\n \t\t \n \t\tif($propName !== 'DI') {\n \t\t\t//print '--> '.$propName.'<br />';\n \t\t\t$varArray[$propName] = $this->$propName;\n \t\t}\n \t}\n \n \treturn $varArray;\n }", "public function toArray()\n {\n return get_object_vars($this);\n }", "public function __debugInfo()\n {\n $reflect = new \\ReflectionObject($this);\n $varArray = array();\n \n foreach ($reflect->getProperties(\\ReflectionProperty::IS_PUBLIC) as $prop) {\n $propName = $prop->getName();\n \n if ($propName !== 'DI') {\n // print '--> '.$propName.'<br />';\n $varArray[$propName] = $this->$propName;\n }\n }\n \n return $varArray;\n }", "public function jsonSerialize()\n {\n return get_object_vars($this);\n }", "public function jsonSerialize()\n {\n return get_object_vars($this);\n }", "function jsonSerialize()\n {\n return get_object_vars($this);\n }", "function jsonSerialize()\n {\n return get_object_vars($this);\n }", "function jsonSerialize()\n {\n return get_object_vars($this);\n }", "public function toArray() :array {\n return get_object_vars($this);\n }", "public function jsonSerialize()\n {\n return get_object_vars($this);\n }", "public function toArray() {\n return get_object_vars($this);\n }", "public function getProperties(): array;", "public function getProperties(): array;", "public function test2()\n\t\t{\n\t\t\treturn get_object_vars($this);\n\t\t}", "public function toArray() {\n return get_object_vars($this);\n }", "public function jsonSerialize() {\n return get_object_vars($this);\n }", "public function jsonSerialize() {\n return get_object_vars($this);\n }", "protected function getVars()\n {\n if (!$this->vars) {\n $this->loadVarsByObjectType();\n }\n\n return $this->vars;\n }", "public function jsonSerialize()\n {\n return get_object_vars($this);\n }", "public function jsonSerialize()\n {\n return get_object_vars($this);\n }", "public function jsonSerialize()\n {\n return get_object_vars($this);\n }", "public function jsonSerialize()\n {\n return get_object_vars($this);\n }", "public function jsonSerialize()\n {\n return get_object_vars($this);\n }", "public function jsonSerialize()\n {\n return get_object_vars($this);\n }", "public function jsonSerialize() {\n\t\treturn(get_object_vars($this));\n\t}", "public function toArray()\n {\n return get_object_vars($this);\n }", "public function toArray()\n {\n return get_object_vars($this);\n }", "public function jsonSerialize(): array\n {\n return get_object_vars($this);\n }", "public function getProperties() : array;", "public function JsonSerialize() {\n\t\t$fields = get_object_vars($this);\n\t\treturn ($fields);\n\t}", "public function JsonSerialize() {\n\t\t$fields = get_object_vars($this);\n\t\treturn ($fields);\n\t}", "public function getArrayCopy()\n {\n $obj_vars = parent::getArrayCopy();\n array_merge($obj_vars, get_object_vars($this));\n\n return $obj_vars;\n }", "public function getArrayCopy()\n {\n $obj_vars = parent::getArrayCopy();\n array_merge($obj_vars, get_object_vars($this));\n\n return $obj_vars;\n }", "public function getArrayCopy()\n {\n $obj_vars = parent::getArrayCopy();\n array_merge($obj_vars, get_object_vars($this));\n\n return $obj_vars;\n }", "public function getArrayCopy()\n {\n $obj_vars = parent::getArrayCopy();\n array_merge($obj_vars, get_object_vars($this));\n\n return $obj_vars;\n }", "public function jsonSerialize() {\n\t\t$fields = get_object_vars($this);\n\t\treturn ($fields);\n\t}", "function _getProperties() ;", "public function jsonSerialize()\n\t{\n\n\t\treturn get_object_vars($this);\n\n\t}", "function jsonSerialize()\n {\n return get_object_vars($this);\n // TODO: Implement jsonSerialize() method.\n }", "public function getValues(): stdClass\n {\n $res = [];\n foreach (get_object_vars($this) as $attrib => $value)\n {\n if (!is_null($value))\n {\n if ($value instanceof self)\n {\n $value = $value->getValues();\n }\n $res[$attrib] = $value;\n }\n }\n return (object) $res;\n }", "public function __getVars(){\r\n $vars = isset($this->vars)? $this->vars:array();\r\n return $vars;\r\n }", "public function toArray()\n {\n return array_merge(get_object_vars($this), parent::toArray());\n }", "public function getProperties($object): array\n {\n if (!is_object($object)) {\n return [];\n }\n\n $reflectedClass = new \\ReflectionClass($object);\n $classProperties = $this->getClassProperties($reflectedClass);\n\n // Also get (private) variables from parent class.\n $privateProperties = [];\n while ($reflectedClass = $reflectedClass->getParentClass()) {\n $privateProperties[] = $this->getClassProperties($reflectedClass, static::GET_ONLY_PRIVATES);\n }\n\n return array_merge($classProperties, ...$privateProperties);\n }", "private static function getProperties($object) {\n\t\t$properties = array();\n\t\ttry {\n\t\t\t$reflect = new \\ReflectionClass(get_class($object));\n\t\t\tforeach ($reflect->getProperties(\\ReflectionProperty::IS_PUBLIC) as $property) {\n\t\t\t\t$properties[$property->getName()] = $property->getValue($object);\n\t\t\t}\n\t\t} catch (\\ReflectionException $ex) {\n\t\t\tErrorHandler::logException($ex);\n\t\t}\n\t\treturn $properties;\n\t}", "public function vars()\n\t{\n\t\treturn $this->vars;\n\t}", "public function jsonSerialize() {\n\t\t$fields = get_object_vars($this);\n\t\treturn($fields);\n\t}", "public function jsonSerialize() {\n\t\t$fields = get_object_vars($this);\n\t\treturn($fields);\n\t}", "public function jsonSerialize() {\n\t\t$fields = get_object_vars($this);\n\t\treturn($fields);\n\t}", "public static function convert($obj) {\n\t\t$result=get_object_vars($obj);\n\t\t$rc=new \\ReflectionClass($obj);\n\t\t$meths=$rc->getMethods(\\ReflectionMethod::IS_PUBLIC);\n\t\tforeach($meths as $m) {\n\t\t\t$n=$m->getShortName();\n\t\t\t$n2=lcfirst(substr($n,3));\n\t\t\tif(strpos($n,'get')===0 && $m->getNumberOfRequiredParameters()==0) {\n\t\t\t\t$result[$n2]=$m->invoke($obj);\n\t\t\t}\n\t\t}\n\t\treturn $result;\n\t}", "public function getStructure(): array\n {\n $structure = [];\n $objectVars = get_object_vars($this);\n\n foreach (get_class_vars(static::class) as $key => $value) {\n if (array_key_exists($key, $objectVars) && ($value === null || $value !== $objectVars[$key])) {\n $value = $objectVars[$key];\n }\n\n $structure[$key] = $value;\n }\n\n return $structure;\n }", "public function vars()\n {\n return $this->vars;\n }" ]
[ "0.7828726", "0.74844545", "0.74790496", "0.7368418", "0.727938", "0.7239578", "0.72223675", "0.7176988", "0.71403193", "0.7133523", "0.70621365", "0.6988077", "0.6988077", "0.69782335", "0.6970633", "0.69131017", "0.68889874", "0.68678254", "0.68613976", "0.68394023", "0.6825925", "0.6825618", "0.6799989", "0.67425615", "0.67422175", "0.67177737", "0.66652244", "0.6639705", "0.66268176", "0.65784603", "0.6574243", "0.6574243", "0.6574243", "0.6574243", "0.6574243", "0.6574243", "0.6574243", "0.6574243", "0.6574243", "0.6571186", "0.6562892", "0.65318865", "0.6522865", "0.6513196", "0.6513196", "0.6512937", "0.64867866", "0.64854157", "0.64841646", "0.6466763", "0.6459479", "0.64439607", "0.6443843", "0.64403164", "0.64403164", "0.64359164", "0.64359164", "0.64359164", "0.64356554", "0.6413154", "0.64075756", "0.64059615", "0.64059615", "0.6405504", "0.6392749", "0.63786006", "0.63786006", "0.6371553", "0.63579684", "0.63579684", "0.63579684", "0.63579684", "0.63579684", "0.63579684", "0.63551927", "0.63427824", "0.63427824", "0.6340559", "0.63335854", "0.63310033", "0.63310033", "0.63191605", "0.63191605", "0.63191605", "0.63191605", "0.6313169", "0.6309571", "0.6276186", "0.62573516", "0.6245914", "0.62443477", "0.6230365", "0.62210083", "0.62188476", "0.6207764", "0.6204294", "0.6204294", "0.6204294", "0.6196185", "0.61845773", "0.61670655" ]
0.0
-1
A new record wont have an id yet
public function save() { return isset($this->id) ? $this->update() : $this->create(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function createNew() {\n $this->db->insert($this->tableName, $this->mapToDatabase());\n $this->id = $this->db->insert_id();\n }", "public function isNewRecord(){\n return !isset($this->data['id']);\n }", "function is_new_record() {\n\t\treturn (is_null($this->id) || $this->id == '');\n\t}", "public function save(){\n if($this->id == 0) {\n // Object is new and needs to be created\n return $this->insert();\n }\n }", "public function pageIdCanBeDeterminedWhileCreatingARecordAfterAnExistingRecord() {}", "public function testItemWithoutIdShouldBeConsideredNew()\n {\n $item = $this->createItem();\n $this->assertTrue($item->isNew());\n }", "public function isNew() {}", "public function isNew();", "public function isNew();", "public function testItemWithIdShouldNotBeConsideredNew()\n {\n $item = $this->createItem($this->faker->randomNumber());\n $this->assertFalse($item->isNew());\n }", "public function pageIdCanBeDeterminedWhileCreatingARecord() {}", "function mknewPerson($id) {\n $newID=uniqid (rand());\n //Wird zur Zeit nicht verwendet\n //if (!$id) {$uid='null';} else {$uid=$id;};\n $sql=\"insert into contacts (cp_name,cp_employee) values ('$newID',$id)\";\n $rc=$GLOBALS['dbh']->query($sql);\n if ($rc) {\n $sql=\"select cp_id from contacts where cp_name = '$newID'\";\n $rs=$GLOBALS['dbh']->getAll($sql);\n if ($rs) {\n $id=$rs[0][\"cp_id\"];\n } else {\n $id=false;\n }\n } else {\n $id=false;\n }\n return $id;\n}", "public function create($id)\n {\n \n }", "public function isNew() {\n return $this->id === 0;\n }", "public function create($id)\n {\n //\n\n }", "public function create($id)\n {\n\n }", "public function create($id)\n {\n\n }", "function is_new()\n {\n return $this->id() ? FALSE : TRUE;\n }", "public function create($id)\n {\n }", "public function isNew()\n {\n if (static::getId()=== null) {\n return true;\n } else {\n return false;\n }\n }", "public function create(){\n\n $id=0;\n $attributes = $this->prepared_attributes_insert();\n\t\t\n\t $sql = \"INSERT INTO \".static::$table_name.\" (\";\n\t $sql .= join(\",\",array_keys($attributes));\n\t $sql .= \") VALUES (\"; \n $sql .= join(\",\",array_values($attributes));\t\t \n $sql .= \") \";\n \n $idf = static::$id_field;\n \n $this->{static::$id_field} = static::db()->insert($sql);\n static::db()->free_statement();\n if (static::$idf !== -1)\n {\n\t return true;\n\t } else {\n\t return false;\n\t }\n }", "protected function SaveNewRecord()\n\t{\n\t\t//class\n\t\treturn false;\n\t}", "abstract public function insertId();", "abstract public function insertId();", "abstract public function insertId();", "public function insert()\n {\n $this->id = insert($this);\n }", "public function onSaveNewRecord()\n {\n $this->created = $this->updated = new \\DateTime();\n $this->rev = 1;\n }", "public function _isNew() {}", "public function save(){\r\n return isset($this->id) ? $this->update() : $this->create();\r\n }", "function SaveNew()\n\t{\n\t\t$this->statsId = '';\n\t\treturn $this->Save();\n\t}", "public function testNewModelWithIdSpecified() {\n\n $this->loadClass('sample_Resource');\n\n $sessionFactory = $this->getSampleProjectSessionFactory(true);\n \n $session1 = $sessionFactory->openSession();\n $session2 = $sessionFactory->openSession();\n $session3 = $sessionFactory->openSession();\n \n $resource = $session1->add(new sample_Resource('inventory', 'Inventory'));\n \n $session1->flush();\n \n $this->assertEquals(\"inventory\", $resource->resourceId);\n \n $resource = $session2->find('sample_Resource')->filterBy('resourceId', 'inventory')->one();\n $this->assertEquals(\"Inventory\", $resource->name);\n \n $resource->name = 'Inventory Changed';\n \n $session2->flush();\n\n $resource = $session3->find('sample_Resource')->filterBy('resourceId', 'inventory')->one();\n $this->assertEquals(\"Inventory Changed\", $resource->name);\n \n }", "private function isNew()\n {\n return true;\n }", "function getNewId();", "public function add($id)\n {\n \n }", "abstract public function insertID();", "function insertId();", "function add() {\r\n $sql = \"INSERT into student_researchers VALUES();\";\r\n global $db;\r\n if($db->Execute($sql) === false) {\r\n throw new Exception('SQL error. Unable to add a new researcher.');\r\n }\r\n $_REQUEST['id']=mysql_insert_id();\r\n\r\n edit();\r\n}", "public function save(){\n return isset($this->id) ? $this->update() : $this->create();\n \n }", "public function createRecord();", "function create($data)\r\n\t{\t\t\r\n\t\t$this->db->insert($this->table, $data); \r\n\t\t\r\n\t\tif ($this->db->affected_rows() === 1)\r\n\t\t{\r\n\t\t\treturn $this->db->insert_id();\r\n\t\t}\r\n\t\t\r\n\t\treturn FALSE;\r\n\t}", "public function test_create()\n\t{\n\t\tlist($id, $affected) = $this->model->create(array(\n\t\t\t'user_id' => '1',\n\t\t\t'role_id' => '1'\n\t\t));\n\n\t\t$this->assertSame(0, $id); // No primary key...\n\t\t$this->assertSame(1, $affected);\n\t}", "function insert($data){\n\t if($data and (is_array($data) or is_object($data))){\n\t $data = (object) $data;\n\t }else return false; \n\t $data->id = uniqid('');\n\t return parent::insert($data);\t \n\t}", "abstract public function insert_id();", "public function isNew()\n\t{\n\t\treturn (!$this->id || strncmp($this->id, 'new', 3) === 0);\n\t}", "public function isNew()\n {\n return false;\n }", "function is_new_record() {\n\t\t\treturn $this->new_record;\n\t\t}", "function makeClone()\n {\n $this->id = 0;\n }", "public function pageIdCanBeDeterminedWhileCopyingARecordAfterAnExistingRecord() {}", "function SaveNew()\r\n\t{\r\n\t\t$this->specialofferId = '';\r\n\t\treturn $this->Save();\r\n\t}", "public function save(){\n\t\treturn isset($this->id)?$this->update():$this->create();\t\n\t}", "public function NewRecord()\n {\n global $g_BizSystem;\n $this->SetDisplayMode(MODE_N);\n $recArr = $this->GetNewRecord();\n if (!$recArr)\n return $this->ProcessDataObjError();\n $this->UpdateActiveRecord($recArr);\n // TODO: popup message of new record successful created\n return $this->ReRender();\n }", "function _isNew() ;", "public function create($id) //pasamos el id del cliente\n {\n \n }", "public function save(){\r\n\t \t\treturn isset($this->id) ? $this->update() : $this->create();\r\n\t\t}", "function assignSingle()\n {\n /* If id == 0, we shall create a new record. */\n if ($this->id)\n {\n /* Query data of this person. */\n $this->dbQuerySingle();\n }\n else\n {\n /* Initialize default values. */\n $this->_setDefaults();\n /* Find out the first non-standard candidate id, that is, an id lower than 50000. */\n $rs = $this->dbQuery(\"SELECT max(id)+1 AS id FROM student WHERE id<50000\");\n if (!empty($rs))\n {\n $this->id = $this->rs['id'] = $rs[0]['id'];\n }\n }\n $this->assign_rs();\n }", "public function testCreateReturnsNewRecordIdWhenNoValuesSupplied()\n {\n //set up fixtures\n //get table stats prior to write operation\n $begRowCount = $this->getConnection()->getRowCount('Person');\n $maxId = intval($this->getConnection()\n ->createQueryTable('id', 'SELECT MAX(id) as \\'id\\' FROM Person')\n ->getRow(0)['id']);\n\n //set up SUT\n $tblGateMock = $this->getMockBuilder(TableGateway::class)\n ->setConstructorArgs(array($this->getDbal()))\n ->setMethodsExcept(['create', 'setTable'])\n ->getMock();\n $tblGateMock->setTable('Person');\n\n //prep test data\n $person = array(\n 'firstName' => '',\n 'lastName' => '',\n 'about' => '',\n );\n\n //exercise SUT\n $id = $tblGateMock->create($person);\n\n $lastRow = $this->getConnection()\n ->createQueryTable('last_row', 'SELECT * FROM Person WHERE id = (SELECT MAX(id) FROM Person)')\n ->getRow(0);\n\n //assert num rows affected is 1\n $this->assertTrue(is_int($id));\n $this->assertEquals($maxId + 1, $id, 'id mismatch');\n\n //assert table row count\n $this->assertTableRowCount('Person', $begRowCount + 1, 'row count mismatch');\n }", "public function create_a_record()\n {\n // Add a record\n factory(Email::class, 1)->create();\n\n $this->assertCount(1, Email::all());\n }", "public function checkIdNew() {\r\n $q = $this->dbConnect()->prepare('SELECT id FROM new WHERE id = :id');\r\n $q->execute(array(\r\n 'id' => $this->id()\r\n ));\r\n $row = $q->rowCount();\r\n\r\n return $row;\r\n }", "private function create() {\n\t\t$id = $this->objAccessCrud->getId();\n\t\tif (!empty ( $id )) return;\n\t\t// Check if there are permission to execute delete command.\n\t\t$result = $this->clsAccessPermission->toCreat();\n\t\tif(!$result){\n\t\t\t$this->msg->setWarn(\"You don't have permission to create!\");\n\t\t\treturn;\n\t\t}\n\t\t// Execute insert.\n\t\t$this->objAccessCrud->setDateInsert(date(\"Y-m-d H:i:s\"));\n\t\t$id = $this->objAccessCrud->create ();\n\t\t// Check result.\n\t\tif ($id == 0) {\n \t\t\t$this->msg->setError ('There were issues on creating ther record!');\n\t\t\t\treturn;\n\t\t}\n\t\t// Save the id in the session to be used in the update.\n\t\t$_SESSION ['PK']['ACCESSCRUD'] = $id;\n\t\t\t\n\t\t$this->msg->setSuccess ( 'Created the record with success!' );\n\t\treturn;\n\t}", "function _create($entity)\n {\n $retval = FALSE;\n $id = $this->object->_wpdb()->insert($this->object->get_table_name(), $this->object->_convert_to_table_data($entity));\n if ($id) {\n $key = $this->object->get_primary_key_column();\n $retval = $entity->{$key} = intval($this->object->_wpdb()->insert_id);\n }\n return $retval;\n }", "public function getIsNewRecord()\n {\n return $this->_item === null;\n }", "public function isNew(): bool;", "public function isNew(): bool;", "public function getIsNewRecord () {\n return $this->_item === null;\n }", "public function insert(){\r\n\t\tif (!$this->new){\r\n\t\t\tMessages::msg(\"Cannot insert {$this->getFullTableName()} record: already exists.\",Messages::M_CODE_ERROR);\r\n\t\t\treturn self::RES_FAILED;\r\n\t\t}\r\n\t\t\r\n\t\t$this->beforeCommit();\r\n\t\t\r\n\t\t$vals = array();\r\n\t\t$error = false;\r\n\t\tforeach ($this->values as $name=>$value){\r\n\t\t\tif ($value->isErroneous()){\r\n\t\t\t\tFramework::reportErrorField($name);\r\n\t\t\t\t$error = true;\r\n\t\t\t}\r\n\t\t\t$vals[\"`$name`\"] = $value->getSQLValue();\r\n\t\t}\r\n\t\tif ($error){\r\n\t\t\treturn self::RES_FAILED;\r\n\t\t}\r\n\t\t\r\n\t\t$sql = 'INSERT INTO '.$this->getFullTableName().' ('.implode(', ',array_keys($vals)).') VALUES ('.implode(', ',$vals).')';\r\n\t\tif (!SQL::query($sql)->success()){\r\n\t\t\tMessages::msg('Failed to insert record into '.$this->getFullTableName().'.',Messages::M_CODE_ERROR);\r\n\t\t\treturn self::RES_FAILED;\r\n\t\t}\r\n\t\t\r\n\t\t// Get this here, because getPrimaryKey can call other SQL queries and thus override this value\r\n\t\t$auto_id = SQL::getInsertId();\r\n\t\t\r\n\t\t$table = $this->getTable();\r\n\t\t// Load the AUTO_INCREMENT value, if any, before marking record as not new (at which point primary fields cannot be changed)\r\n\t\tforeach ($table->getPrimaryKey()->getColumns() as $name){\r\n\t\t\tif ($table->getColumn($name)->isAutoIncrement()){\r\n\t\t\t\t$this->$name = $auto_id;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t$this->new = false;\r\n\t\t$this->hasChanged = false;\r\n\t\tforeach ($this->values as $value){\r\n\t\t\t$value->setHasChanged(false);\r\n\t\t}\r\n\t\t\r\n\t\t$this->afterCommit();\r\n\t\t\t\r\n\t\treturn self::RES_SUCCESS;\r\n\t}", "public function save() {\r\n $dateNow = date('Y-m-d H:i:s', time());\r\n $this->id = (int) $this->id;\r\n \r\n if (!empty($this->id)) {\r\n //update case\r\n if ($this->_update()) {\r\n return true;\r\n }\r\n }\r\n else {\r\n //Insert case\r\n if ($this->_insert()) {\r\n return true;\r\n }\r\n }\r\n }", "public function actionCreate()\n {\n $model = new Gl2010idid();\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 }", "abstract public function InsertId();", "public function insertRecord()\n\t{\n\t\tif($this->user->hasRight($this->getHandler()->getAddRight()))\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\t$record = $this->getHandler()->getRecord();\n\t\t\t\t$record->import($this->getRequest());\n\n\t\t\t\t// check captcha\n\t\t\t\t$this->handleCaptcha($record);\n\n\t\t\t\t// insert\n\t\t\t\t$this->getHandler()->create($record);\n\n\n\t\t\t\t$msg = new Message('You have successful create a ' . $record->getName(), true);\n\n\t\t\t\t$this->setResponse($msg);\n\t\t\t}\n\t\t\tcatch(\\Exception $e)\n\t\t\t{\n\t\t\t\t$msg = new Message($e->getMessage(), false);\n\n\t\t\t\t$this->setResponse($msg);\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$msg = new Message('Access not allowed', false);\n\n\t\t\t$this->setResponse($msg, null, $this->user->isAnonymous() ? 401 : 403);\n\t\t}\n\t}", "protected function pre_save()\n {\n $this->id = random_bytes(128);\n }", "function load_id(){\r\n $db = new Database();\r\n $sql = \"select * from \" . Interest::TABLE_NAME . \" where name=:name\";\r\n $stm = $db->pdo->prepare($sql);\r\n $stm->bindParam(':name', $this->name);\r\n $stm->execute();\r\n if ($stm->rowCount() > 0){\r\n $row = $stm->fetch();\r\n $this->id = $row[\"id\"];\r\n }\r\n else{\r\n $this->save();\r\n $this->id = $db->pdo->lastInsertId();\r\n }\r\n }", "public function newId(){ // get array of rows objects\r\t\treturn sqlite_last_insert_rowid ($this->handle);\r\t}", "public function createNew() {\n\t}", "function create () {\n\t\t$stm = DB::$pdo->prepare(\"insert into `generated_object` ({$generator_insert_columns}) \n\t\t\t\t\t\t\t\t values ({$generator_insert_values})\");\n\t\t// generator bind hook\n\t\t$stm->execute();\n\n\t\t$this->id = DB::$pdo->lastInsertId();\n\t}", "public function save(){\n // if(isset($this->id)){$this->update();} else {$this->create();}\n return isset($this->id)? $this->update(): $this->create() ;\n\n }", "public function intGetNewId() {\n $this->XaoThrow(\n \"_EntBase::Build(): This entity does not implement retrieval of a \".\n \"new numeric identifier as a descrite function. It may not be \" .\n \"applicable.\"\n , debug_backtrace()\n );\n }", "private function _create() {\n\n $this->db->insert(XCMS_Tables::TABLE_USERS, $this->getArray());\n $this->set(\"id\", $this->db->insert_id());\n\n }", "public function duplicated()\r\n {\r\n // Fetch participant users relation before resetting id!\r\n $this->participantUsers;\r\n $this->id = null;\r\n $this->isNewRecord = true;\r\n $this->date = null;\r\n }", "function create( $data = array() ){\n $this->db->insert('facebook_ride', $data); \n return $this->db->insert_id();\n }", "protected function ensure_id()\n\t{\n\t\t$existing = $this->id();\n\t\t\n\t\tif(empty($existing))\n\t\t{\n\t\t\t$this->id(Tools_Storage::id());\n\t\t}\n\t\t\n\t\treturn $this->id();\n\t}", "public function testRefuseCreation()\n {\n $newActor = new \\eddie\\Models\\Actor();\n $newActor->save();\n }", "protected function getNewID()\n {\n $ids = [];\n $namedIds = [];\n foreach (static::$ids as $k) {\n // attempt use the supplied value if the ID property is mutable\n $property = static::getProperty($k);\n if (in_array($property['mutable'], [self::MUTABLE, self::MUTABLE_CREATE_ONLY]) && isset($this->_unsaved[$k])) {\n $id = $this->_unsaved[$k];\n } else {\n $id = self::$driver->getCreatedID($this, $k);\n }\n\n $ids[] = $id;\n $namedIds[$k] = $id;\n }\n\n $this->_id = implode(',', $ids);\n $this->_ids = $namedIds;\n }", "public function save() {\n return isset($this->id) ? $this->update() : $this->create();\n }", "function create() {\n\t\tglobal $default, $lang_err_doc_exist, $lang_err_database;\n\t\t//if the id >= 0, then the object has already been created\n\t\tif ($this->iId < 0) {\n\t\t\t//check to see if name exsits\n\t\t\t$sql = $default->db;\n\t\t\t$sQuery = \"SELECT id FROM \". $default->document_type_fields_table .\" WHERE document_type_id = ? and field_id = ?\";/*ok*/\n $aParams = array($this->iDocumentTypeID, $this->iFieldID);\n $sql->query(array($sQuery, $aParams));\n $rows = $sql->num_rows($sql);\n \n if ($rows > 0){\n $_SESSION[\"errorMessage\"] = \"DocTypes::The DocumentType name \" . $this->sName . \" is already in use!\";\n return false;\n }\n\t\t}\n\n return parent::create();\n\t}", "public function save_new_record() {\r\n\t\tglobal $wpdb;\r\n\r\n\t\t$db_data = $this->get_db_data();\r\n\r\n\t\t$table_name = $wpdb->prefix . CTF_POSTS_TABLE;\r\n\t\t$data = array(\r\n\t\t\t'twitter_id' => $db_data['twitter_id'],\r\n\t\t\t'created_on' => $db_data['created_on'],\r\n\t\t\t'last_requested' => $db_data['last_requested'],\r\n\t\t\t'time_stamp' => $db_data['time_stamp'],\r\n\t\t\t'json_data' => $db_data['json_data'],\r\n\t\t\t'media_id' => $db_data['media_id'],\r\n\t\t\t'sizes' => $db_data['sizes'],\r\n\t\t\t'aspect_ratio' => $db_data['aspect_ratio'],\r\n\t\t\t'images_done' => $db_data['images_done']\r\n\t\t);\r\n\t\t$format = array(\r\n\t\t\t'%s',\r\n\t\t\t'%s',\r\n\t\t\t'%s',\r\n\t\t\t'%s',\r\n\t\t\t'%s',\r\n\t\t\t'%s',\r\n\t\t\t'%s',\r\n\t\t\t'%d',\r\n\t\t\t'%d'\r\n\t\t);\r\n\t\t$error = $wpdb->insert( $table_name, $data, $format );\r\n\r\n\t\tif ( $error !== false ) {\r\n\t\t\t$insert_id = $wpdb->insert_id;\r\n\r\n\t\t\t$this->db_id = $insert_id;\r\n\t\t\t$this->insert_ctf_feeds_posts();\r\n\t\t} else {\r\n\t\t\t// log error\r\n\t\t}\r\n\t}", "public function save() {\n if($this->hasUid){\n //Create new uid, and varify that it hasn't been used.\n //This might take a bit of overhead, but useful for ensuring you don't have duplicate UID's in any table\n $uniqueID = new uniqueID();\n $UID = $uniqueID->shorten($uniqueID->generate()); //final shortened userId\n\n while (!checkUidIsUnique($UID)) {\n $uniqueID = new uniqueID();\n $UID = $uniqueID->shorten($uniqueID->generate()); //final shortened userId\n }\n\n $this->uid = $UID;\n }\n \n //Check if we are creating a new object\n if ($this->uid == \"\" && $this->id == \"\") {\n $newFields = array();\n foreach ($this as $key => $value) {\n //Skip disregarded fields\n foreach($this->disregard as $disregard){\n if($key == $disregard){\n continue 2;\n }\n }\n \n $ins[] = ':' . $key;\n array_push($newFields, $key);\n }\n $ins = implode(',', $ins);\n $fields = implode(',', $newFields);\n \n //Get the current database time\n $NetworkConnection = new NetworkConnection();\n $PDO = $NetworkConnection->getNewDbConnection();\n \n $stmt = $PDO->prepare(\"SELECT NOW() today\");\n $stmt->execute();\n $dateTime = $stmt->fetch();\n $this->created_at = $dateTime[0]->today;\n $NetworkConnection->closeConnection();\n \n\n try {\n $NetworkConnection = new NetworkConnection();\n $PDO = $NetworkConnection->getNewDbConnection();\n \n $stmt = $PDO->prepare(\"INSERT INTO \" . $this->tableName .\" ($fields) VALUES ($ins)\");\n foreach ($this as $key => $value) {\n //Skip disregarded fields\n foreach($this->disregard as $disregard){\n if($key == $disregard){\n continue 2;\n }\n }\n $stmt->bindValue(':' . $key, $value);\n \n }\n var_dump($stmt);exit();\n $result = $stmt->execute();\n \n $NetworkConnection->closeConnection();\n \n if ($result && $this->hasUid) {\n //Created new lead entry\n $newUID = new UID(array(\"uid\" => $UID, \"table_name\" => $this->tableName));\n $newUID->save();\n return $this;\n }else{\n return $this;\n }\n } catch (Exception $ex) {\n echo $ex->getMessage();\n }\n } else {\n \n $fields = array();\n $set = '';\n $x = 1;\n\n //TODO:: JMJ think this is reminent of old code, consider for removal\n //$this->created_at = date(\"Y-m-d H:i:s\");\n\n foreach ($this as $key => $value) {\n //Skip disregarded fields\n foreach($this->disregard as $disregard){\n if($key == $disregard){\n continue 2;\n }\n }\n array_push($fields, $key);\n }\n\n for ($x = 0; $x < count($fields); $x++) {\n $set .= \"{$fields[$x]} = ?\";\n if ($x < count($fields) - 1) {\n $set .= ', ';\n }\n }\n\n //Update existing entry\n $NetworkConnection = new NetworkConnection();\n $PDO = $NetworkConnection->getNewDbConnection();\n \n if(!$this->hasUid){\n $stmt = $PDO->prepare(\"UPDATE \" . $this->tableName .\" SET {$set} WHERE id=?\");\n }else{\n $stmt = $PDO->prepare(\"UPDATE \" . $this->tableName .\" SET {$set} WHERE uid=?\");\n }\n for ($i = 0; $i < count($fields); $i++) {\n\n $stmt->bindParam($i + 1, $this->{$fields[$i]});\n if ($i + 1 == count($fields)) {\n if(!$this->hasUid){\n $stmt->bindParam($i + 2, $this->id);\n }else{\n $stmt->bindParam($i + 2, $this->uid);\n }\n \n }\n }\n\n $result = $stmt->execute();\n \n $NetworkConnection->closeConnection();\n \n if ($result) {\n return $this;\n }\n }\n }", "abstract protected function _getInsertId();", "public function CopyRecord()\n {\n $rec = $this->GetActiveRecord();\n if (!$rec) return;\n foreach ($rec as $k=>$v)\n $rec[$k] = addslashes($v);\n global $g_BizSystem;\n // get new record array\n $recArr = $this->GetDataObj()->NewRecord();\n\n $rec[\"Id\"] = $recArr[\"Id\"]; // replace with new Id field. TODO: consider different ID generation type\n $this->m_RecordRow->SetRecordArr($rec);\n $ok = $this->GetDataObj()->InsertRecord($rec);\n if (!$ok)\n return $this->ProcessDataObjError($ok);\n return $this->ReRender();\n }", "public function insert() {\n if($this->id != 0){\n return null;\n }\n // Connect to db\n $db = Db::instance();\n\n // Build query\n $q = sprintf(\"INSERT INTO `%s` (`user_id`, `story_id`, `comment`) VALUES (%d, %d, %s);\", self::DB_TABLE, $db->escape($this->user_id), $db->escape($this->story_id), $db->escape($this->comment));\n\n // Execute query\n $db->query($q);\n\n // Set the ID for the new object\n $this->id = $db->getInsertID();\n return $this->id;\n }", "public function return_existing_if_exists()\n {\n $author = factory( Author::class )->create();\n $data = array_add( $this->authorDataFormat, 'data.id', $author->id );\n\n $newAuthor = $this->dispatch( new StoreAuthor( $data ) );\n\n $this->assertEquals( $author->id, $newAuthor->id );\n }", "public function isNewRecord()\n\t{\n\t\treturn $this->getIsNewRecord();\n\t}", "function create($data){\n $data['created_at'] = date('Y-m-d H:i:s');\n $data['updated_at'] = date('Y-m-d H:i:s');\n\t\t$this->db->insert($this->table, $data);\n\t\treturn $this->db->insert_id();\n\t}", "public function new($params)\r\n {\r\n $insert_id = $this->insert($params);\r\n return $insert_id;\r\n }", "public function insert_id();", "public function save()\n {\n if ($this->id) {\n $this->update();\n } else {\n $this->id = $this->insert();\n }\n }", "public function save() \n\t{\n\t\tif (isset($this->id)) {\t\n\t\t\n\t\t\t// Return update when id exists\n\t\t\treturn $this->update();\n\t\t\t\n\t\t} else {\n\t\t\n\t\t\t// Return insert when id does not exists\n\t\t\treturn $this->insert();\n\t\t}\n\t}", "public function actionCreate()\n {\n //Create new pdslidsurat\n $id=$_SESSION['idPdsLid'];\n \t$model = new PdsLidSurat();\n $model->id_jenis_surat='pidsus10';\n $model->id_pds_lid=$id;\n $model->create_by=(string)Yii::$app->user->identity->username;\n $model->save();\n //get latest idpdslidsurat\n $model= PdsLidSuratforPidsus10::findBySql(\"select * from pidsus.pds_lid_surat where id_pds_lid='\".$id.\"' and id_jenis_surat='pidsus10' and create_by='\".(string)Yii::$app->user->identity->username.\"' order by create_date desc limit 1\")->one();\n \n return $this->redirect(['update?id='.$model->id_pds_lid_surat]);\n }", "public function testaddOneRecord()\n\t{\n\t\t$this->assertEquals(1,1);\n\t}", "public function create($id = '@Segment(index=id)')\n {\n \n }", "public function addNew($id) {\n\t\t$sql_values = [':customer_id'=>$id];\n\t\tDB::insert(\n\t\t\t\"INSERT INTO invoice (`customer_id`, `created_at`)\n\t\t\tVALUES (:customer_id, NOW())\",\n\t\t\t$sql_values\n\t\t);\n\t\t$lastID = DB::getPdo()->lastInsertId();\n\n\t\treturn redirect(\"invoices/details/\" . $lastID);\n\t}", "function create($data) {\n $ID = guid();\n\n if ($this->_insert($ID, $data)) {\n return $ID;\n }\n\n return FALSE;\n }" ]
[ "0.72940475", "0.7235951", "0.7231951", "0.7015289", "0.6879897", "0.6837293", "0.6723592", "0.66589516", "0.66589516", "0.66570055", "0.6586856", "0.65378004", "0.6525264", "0.65067035", "0.6481162", "0.6476884", "0.6476884", "0.6470362", "0.645536", "0.64520925", "0.638405", "0.6362305", "0.63572055", "0.63572055", "0.63572055", "0.633925", "0.6325064", "0.63140255", "0.62885743", "0.62848115", "0.6273957", "0.6257446", "0.6253361", "0.62392586", "0.62371695", "0.62370193", "0.6228646", "0.6213862", "0.62037563", "0.6155847", "0.6137508", "0.6133091", "0.61313444", "0.6130761", "0.6129556", "0.61257464", "0.6094638", "0.6093012", "0.608599", "0.60829735", "0.60744625", "0.6071272", "0.6070734", "0.60599244", "0.60562867", "0.60540134", "0.60394514", "0.60232544", "0.6021502", "0.600884", "0.60088164", "0.5995743", "0.5995743", "0.5994434", "0.5993979", "0.5992134", "0.59870183", "0.5986388", "0.59789985", "0.59687304", "0.59604156", "0.59533495", "0.5951957", "0.59476", "0.5946451", "0.5935957", "0.59316444", "0.5920539", "0.5891468", "0.5878388", "0.58704007", "0.5867118", "0.58606106", "0.58564425", "0.5856349", "0.5856001", "0.5854819", "0.5852782", "0.5850285", "0.58495855", "0.5848936", "0.5827026", "0.58245975", "0.5820361", "0.5814114", "0.5808307", "0.58082336", "0.5805791", "0.5803822", "0.5802376", "0.5795097" ]
0.0
-1
Get the value of mobile
public function getMobile() : string { return $this->mobile; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getMobile();", "public function getMobile()\n\t{\n\t\treturn $this->get(\"mobile\");\n\t}", "public function getMobile()\n {\n return $this->mobile;\n }", "public function getMobile()\n {\n return $this->mobile;\n }", "public function getMobile()\n {\n return $this->mobile;\n }", "public function getMobile()\n {\n return $this->mobile;\n }", "public function getMobile()\n {\n return $this->mobile;\n }", "public function getMobile()\n {\n return $this->mobile;\n }", "public function getCidMobile()\n {\n return $this->cid_mobile;\n }", "function mobile(){\n\n\t\treturn (new user_agent)->mobile();\n\n\t}", "public function getCmobile()\n {\n return $this->cmobile;\n }", "public function getSubscriberMobile()\n {\n $mobile = parent::getSubscriberMobile(); \n return $mobile;\n }", "public function getShowMobilePhone()\n\t{\n\t\treturn $this->show_mobile_phone;\n\t}", "public function getMobileNumberSeller() {\n return $this->Mobile;\n //return the value mobile\n }", "public function getMobileNumberForSendingOTP()\n {\n return $this->mobile;\n }", "public function getMobilePhone()\n\t{\n\t\treturn $this->mobile_phone;\n\t}", "public function getReqMobilePhone()\n\t{\n\t\treturn $this->req_mobile_phone;\n\t}", "function getFieldMobileNumber($value = null){\n\t\t$form_ret = '';\n\t\t$dataField = get_option('axceleratelink_srms_opt_mobilephone');\n\t\t$dataTitle = get_option('axceleratelink_srms_opt_tit_mobilephone');\n\t\t$tooltip = setToolTipNotification(\"mobphone\");\n\t\tif($value){\n\t\t\t$val_ar = explode(\")\", $value);\n\t\t\t$var_ar = $val_ar[1];\n\t\t}else{\n\t\t\t$var_ar = \"\";\n\t\t}\n\t\tif ($dataField == 'true'){\n\t\t\t$form_ret .= \"</br><label>\".$dataTitle.(get_axl_req_fields('mobilephone') === 'mobilephone' ? '<span class=\"red\">*</span>' : '').$tooltip.\"</label></br><input type='hidden' name='mobilephone' id='mobilephone' value='\".$value.\"' class='srms-field \".(get_axl_req_fields('mobilephone') === 'mobilephone' ? 'input-text-required' : '').\"'>\";\n\t\t\t$form_ret .= \"<select id='mobilephone_code' style='width:28%;'><option value='(61)'> (61) </option>\";\n\t\t\t$form_ret .= \"</select><input type='text' id='mobilephone_input' value='\".$var_ar.\"' class='' style='width:70%;'></br>\";\n\t\t}\n\t\treturn $form_ret;\n\t}", "public function mobilevs($mobile) {\n\t\n\t\t\n\t\n\t\treturn $mobile;\n\t\n\t}", "public function getMobilePhoneNo() : string\n {\n return $this->mobilePhoneNo;\n }", "public function getOptoutMobile()\n {\n return $this->optoutMobile;\n }", "public function isMobile()\n {\n return $this->is_mobile;\n }", "public function getMobileNumber() {\n\n return $this->mobile_number;\n\n }", "function isMobile($ua)\n{\n global $defaultJSON;\n $isMob='0'; \n $tree = Mobi_Mtld_DA_Api::getTreeFromFile($defaultJSON);\n if (Mobi_Mtld_DA_Api::getProperty($tree,$ua,\"mobileDevice\")=='1')\n $isMob='1';\n return $isMob;\n}", "public function only_mobile()\n\t{\n\t\treturn $this->mobile_only;\n\t}", "public function mobilePhones()\n {\n return static::randomElement(static::$mobilePhones);\n }", "function mobile($string) {\n\n\n\t\t}", "public function getMobileNumber()\n {\n if (array_key_exists('mobileNumber', $this->personState)) {\n return $this->personState['mobileNumber'];\n } else {\n return null;\n }\n }", "public function getFromMobileDetect()\n {\n if ($this->mobileDetect->isMobile() && $this->mobileDetect->isTablet()) {\n //Tablet\n $device = 'Tablet';\n } elseif ($this->mobileDetect->isMobile() && !$this->mobileDetect->isTablet()) {\n //mobile\n $device = 'Mobile';\n } else {\n //Web\n $device = 'Web';\n }\n $this->useragent['device'] = $device;\n }", "public static function is_mobile() {\n\t\t//If is the first checking\n\t\tif (self::$mobile==null) {\n\t\t\t//If exists the variable nomob\n\t\t\tif (GET::exists('nomob')) {\n\t\t\t\t//Se the user is from a PC\n\t\t\t\tCOOKIE::set('ale_mobile','false',30*24*60);\n\t\t\t\tself::$mobile=false;\n\t\t\t} else {\n\t\t\t\t//Check if was calculated the device of the user\n\t\t\t\tif (COOKIE::exists('ale_mobile'))\n\t\t\t\t\tself::$mobile=COOKIE::val('ale_mobile')=='true';\t//Set the old value\n\t\t\t\telse {\n\t\t\t\t\t//Find what device is\n\t\t\t\t\tself::$mobile = false;\n\t\t\t\t\t//List of devices\n\t\t\t\t\t$devices = array(\n\t\t\t\t\t\t\t\"Android\" => \"android.*mobile\",\n\t\t\t\t\t\t\t\"Androidtablet\" => \"android(?!.*mobile)\",\n\t\t\t\t\t\t\t\"Blackberry\" => \"blackberry\",\n\t\t\t\t\t\t\t\"Blackberrytablet\" => \"rim tablet os\",\n\t\t\t\t\t\t\t\"Iphone\" => \"(iphone|ipod)\",\n\t\t\t\t\t\t\t\"Ipad\" => \"(ipad)\",\n\t\t\t\t\t\t\t\"Palm\" => \"(avantgo|blazer|elaine|hiptop|palm|plucker|xiino)\",\n\t\t\t\t\t\t\t\"Windows\" => \"windows ce; (iemobile|ppc|smartphone)\",\n\t\t\t\t\t\t\t\"Windowsphone\" => \"windows phone os\",\n\t\t\t\t\t\t\t\"Generic\" => \"(webos|android|kindle|mobile|mmp|midp|pocket|psp|symbian|smartphone|treo|up.browser|up.link|vodafone|wap|opera mini|opera mobi)\"\n\t\t\t\t\t\t);\n\t\t\t\t\t//If is from a wap connection\n\t\t\t\t\tif (isset($_SERVER['HTTP_X_WAP_PROFILE']) || isset($_SERVER['HTTP_PROFILE']))\n\t\t\t\t\t\tself::$mobile = true;\n\t\t\t\t\telseif (strpos($_SERVER['HTTP_ACCEPT'], 'text/vnd.wap.wml') > 0 || strpos($_SERVER['HTTP_ACCEPT'], 'application/vnd.wap.xhtml+xml') > 0) {\n\t\t\t\t\t\t//If accept a wap response is a mobile device\n\t\t\t\t\t\tself::$mobile = true;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t//Control all the devices to find it\n\t\t\t\t\t\tforeach ($devices as $device => $regexp) \n\t\t\t\t\t\t\tif(preg_match(\"/$regexp/i\", $_SERVER['HTTP_USER_AGENT'])) \n\t\t\t\t\t\t\t\tself::$mobile = true;\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t//Set a cookie to not calculate again\n\t\t\t\tCOOKIE::set('ale_mobile',(self::$mobile)?'true':'false',30*24*60);\n\t\t\t}\n\t\t}\n\t\treturn self::$mobile;\n\t}", "public function get_mobileNetworkCode(): int\n {\n return $this->_mnc;\n }", "public function get_mobileNetworkCode(): int\n {\n return $this->_mnc;\n }", "function getUserDevice()\n {\n $userAgent = Request()->header('User-Agent');\n $agent = new Agent();\n\n if ($agent->isMobile($userAgent)) {\n return 'mobile';\n } else {\n return 'desktop';\n }\n\n }", "public function hasMobile(){\n return $this->_has(2);\n }", "public function hasMobile(){\n return $this->_has(2);\n }", "public function hasMobile(){\n return $this->_has(2);\n }", "public function hasMobile(){\n return $this->_has(2);\n }", "public function hasMobile(){\n return $this->_has(2);\n }", "public function hasMobile(){\n return $this->_has(2);\n }", "public function hasMobile(){\n return $this->_has(2);\n }", "public function hasMobile(){\n return $this->_has(2);\n }", "public function hasMobile(){\n return $this->_has(2);\n }", "public function hasMobile(){\n return $this->_has(2);\n }", "public function hasMobile(){\n return $this->_has(2);\n }", "public function getAppsmartphone()\r\n {\r\n return $this->appsmartphone;\r\n }", "static function getMobileRand();", "private function _isMobile(){\n\t\t/* getting user agent reference */\n\t\t$this->load->library('user_agent');\n\t\t\n\t\t/* return the requested device type */\n\t\treturn $this->agent->is_mobile();\n\t}", "public function hasMobile(){\n return $this->_has(4);\n }", "public function hasMobile(){\n return $this->_has(8);\n }", "public function getMobileNumberAttribute($value)\n {\n return $value ? $value : \"\";\n }", "function mobileDeviceTypeFromHTTPHeader()\n{\n \t//figure out the device\n\tif(isset($_SERVER['HTTP_USER_AGENT']));\n \t{\n \t\t$user_agent = strtolower($_SERVER['HTTP_USER_AGENT']);\n\n \t\tif(strpos($user_agent, 'iphone'))\n \t\t{\n \t\t\treturn DEVICE_IPHONE;\n \t\t}else if(strpos($user_agent, 'android'))\n \t\t{\n \t\t\treturn DEVICE_ANDROID;\n \t\t}else if(strpos($user_agent, 'windows phone'))\n \t\t{\n \t\t\treturn DEVICE_WP7;\n \t\t}else if(strpos($user_agent, 'blackberry'))\n \t\t{\n \t\t\treturn DEVICE_BB;\n \t\t}else if(strpos($user_agent, 'ipad'))\n \t\t{\n \t\t\treturn DEVICE_IPAD;\n \t\t}else if(strpos($user_agent, 'symbianos'))\n \t\t{\n \t\t\treturn DEVICE_SYMBIAN;\n \t\t}\n\n\t}\n\n return DEVICE_GENERAL;\n}", "protected static function phone_code(): mixed\n\t{\n\t\treturn self::$query->phone_code;\n\t}", "public function get_phone() {\r\n return $this->phone;\r\n }", "public function getAllMobile(){\n\t\treturn $this->mobiles;\n\t}", "public function isMobile() \r\n {\r\n return $this->isMobile;\r\n }", "function isMobile(){\n $detect = new Mobile_Detect(); \n return $detect->isMobile();\n}", "public function getMobileGrade()\n {\n return $this->mobile_grade;\n }", "public function getPhone()\n {\n $value = $this->get(self::PHONE);\n return $value === null ? (string)$value : $value;\n }", "public function getUserPhone() {\n\t\treturn ($this->userPhone);\n\t}", "public function getUserPhone() {\n\t\treturn ($this->userPhone);\n\t}", "public function getPhone()\n {\n return $this->getValue('nb_icontact_prospect_phone');\n }", "function is_mobile()\n {\n return dev::isMobile();\n }", "public function getPhone(){\r\n\t\t\treturn $this->phone;\r\n\t\t}", "public function getPhone():string\n {\n return $this->phone;\n }", "function isMobile() {\n\tglobal $communitySettings;\n\n\t$useragent=$_SERVER['HTTP_USER_AGENT'];\n\treturn (preg_match('/(android|bb\\d+|meego).+mobile|avantgo|bada\\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i',$useragent)||preg_match('/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\\-(n|u)|c55\\/|capi|ccwa|cdm\\-|cell|chtm|cldc|cmd\\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\\-s|devi|dica|dmob|do(c|p)o|ds(12|\\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\\-|_)|g1 u|g560|gene|gf\\-5|g\\-mo|go(\\.w|od)|gr(ad|un)|haie|hcit|hd\\-(m|p|t)|hei\\-|hi(pt|ta)|hp( i|ip)|hs\\-c|ht(c(\\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\\-(20|go|ma)|i230|iac( |\\-|\\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\\/)|klon|kpt |kwc\\-|kyo(c|k)|le(no|xi)|lg( g|\\/(k|l|u)|50|54|\\-[a-w])|libw|lynx|m1\\-w|m3ga|m50\\/|ma(te|ui|xo)|mc(01|21|ca)|m\\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\\-2|po(ck|rt|se)|prox|psio|pt\\-g|qa\\-a|qc(07|12|21|32|60|\\-[2-7]|i\\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\\-|oo|p\\-)|sdk\\/|se(c(\\-|0|1)|47|mc|nd|ri)|sgh\\-|shar|sie(\\-|m)|sk\\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\\-|v\\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\\-|tdg\\-|tel(i|m)|tim\\-|t\\-mo|to(pl|sh)|ts(70|m\\-|m3|m5)|tx\\-9|up(\\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\\-|your|zeto|zte\\-/i',substr($useragent,0,4)));\n}", "function isMobile() {\n return preg_match(\"/(android|avantgo|blackberry|bolt|boost|cricket|docomo|fone|hiptop|mini|mobi|palm|phone|pie|tablet|up\\.browser|up\\.link|webos|wos)/i\", $_SERVER[\"HTTP_USER_AGENT\"]);\n}", "public function isMobilePhone () : bool {\n\t}", "function is_mobile(){\n\n\t\treturn (new user_agent)->is_mobile();\n\n\t}", "public function getPhone(): string\n {\n return $this->phone;\n }", "function getPhone() {\n return $this->phone;\n }", "public function hasMobileExist(){\n return $this->_has(2);\n }", "public function getReqMobileComment()\n\t{\n\t\treturn $this->req_mobile_comment;\n\t}", "public function get_telephone();", "static function getWaitVerifyMobile($usr){\r\n\t\tif(strlen(trim($usr)) > 0){\r\n\t\t\t$no = funcs::checkMobileVerify($usr);\r\n\t\t\treturn $no;\r\n\t\t}\r\n\t\telse{\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t}", "public function getPhone();", "public function set_client_mobile(){\n\n self::$oCRNRSTN_ENV->oSESSION_MGR->set_session_param('isMobile', true);\n\n return true;\n\n }", "public function getPhone()\n {\n return $this->get(self::PHONE);\n }", "public function get_mobileCountryCode(): int\n {\n return $this->_mcc;\n }", "public function get_mobileCountryCode(): int\n {\n return $this->_mcc;\n }", "public function getPhone()\n\t{\n\t\treturn $this->phone;\n\t}", "public function getPhone()\r\n {\r\n return $this->phone;\r\n }", "public function getSmsNumber()\n {\n $this->init();\n if ($this->data->contact_info->phone) {\n foreach ($this->data->contact_info->phone as $phone) {\n if ($phone->preferred_sms) {\n return $phone->phone_number;\n }\n }\n }\n\n return null;\n }", "public function getPhone()\n {\n return $this->phone;\n }", "public function getPhone()\n {\n return $this->phone;\n }", "public function getPhone()\n {\n return $this->phone;\n }", "public function getPhone()\n {\n return $this->phone;\n }", "public function getPhone()\n {\n return $this->phone;\n }", "public function getPhone()\n {\n return $this->phone;\n }", "public function getPhone()\n {\n return $this->phone;\n }", "public function getPhone()\n {\n return $this->phone;\n }", "public function getPhone()\n {\n return $this->phone;\n }", "public function getPhone()\n {\n return $this->phone;\n }", "public function getPhone()\n {\n return $this->phone;\n }", "public function getPhone()\n {\n return $this->phone;\n }", "public function getPhone()\n {\n return $this->phone;\n }", "public function getPhone()\n {\n return $this->phone;\n }", "public function getPhone()\n {\n return $this->phone;\n }", "public function getIphone()\n {\n return $this->iphone;\n }", "static function checkMobileVerify($username, $password = null, $code = null)\r\n\t{\r\n\t\t$username = funcs::check_input($username);\r\n\r\n\t\tif($password != null && $code != null)\r\n\t\t{\r\n\t\t\t$password = funcs::check_input($password);\r\n\t\t\t$code = funcs::check_input($code);\r\n\t\t\t$no = DBconnect::retrieve_value(\"SELECT waitver_mobileno\r\n\t\t\t\t\t\t\t\t\t\t\t FROM \".TABLE_MEMBER.\"\r\n\t\t\t\t\t\t\t\t\t\t\t WHERE \".TABLE_MEMBER_USERNAME.\"='\".htmlspecialchars($username,ENT_QUOTES,'UTF-8').\"'\r\n\t\t\t\t\t\t\t\t\t\t\t AND \".TABLE_MEMBER_PASSWORD.\"='\".$password.\"'\r\n\t\t\t\t\t\t\t\t\t\t\t AND \".TABLE_MEMBER_VALIDATION.\"='\".$code.\"' \");\r\n\t\t}\r\n\t\telse\r\n\t\t\t$no = DBconnect::retrieve_value(\"SELECT waitver_mobileno FROM \".TABLE_MEMBER.\" WHERE \".TABLE_MEMBER_USERNAME.\"='\".htmlspecialchars($username,ENT_QUOTES,'UTF-8').\"'\");\r\n\r\n\t\treturn $no;\r\n\t}", "function getMobileNoiBat()\n {\n $query = \"select * from {$this->table} where Theloai_idTheloai = 6 and visibleOnHome = 1 limit 4 \";\n $pre = $this->db->prepare($query);\n $pre->execute();\n $data = $pre->fetchAll(PDO::FETCH_ASSOC);\n $pre->closeCursor();\n return $data;\n }" ]
[ "0.85928404", "0.81119233", "0.77261835", "0.77261835", "0.77261835", "0.77261835", "0.77261835", "0.77261835", "0.72802675", "0.72705376", "0.7262032", "0.7151729", "0.7084077", "0.7061528", "0.70147985", "0.70034045", "0.69871914", "0.697149", "0.68789995", "0.6871258", "0.6779222", "0.6752625", "0.6720504", "0.66470283", "0.6601021", "0.6561169", "0.6545592", "0.6501858", "0.6499103", "0.64867485", "0.63914204", "0.63914204", "0.6348942", "0.63150114", "0.63150114", "0.63150114", "0.63150114", "0.63150114", "0.63150114", "0.63150114", "0.63150114", "0.63150114", "0.63150114", "0.63150114", "0.6292172", "0.6282573", "0.6282081", "0.6268694", "0.6265147", "0.62539595", "0.61953694", "0.619536", "0.6186186", "0.6162731", "0.61369646", "0.61290425", "0.61173767", "0.6092318", "0.60884076", "0.60884076", "0.6087242", "0.6067378", "0.605848", "0.60505086", "0.6044751", "0.6029783", "0.6025571", "0.6009297", "0.6008703", "0.59639597", "0.59610623", "0.59553427", "0.59419256", "0.5941469", "0.59339094", "0.59237593", "0.58905697", "0.5887439", "0.5887439", "0.5875595", "0.5874937", "0.58619905", "0.5859869", "0.5859869", "0.5859869", "0.5859869", "0.5859869", "0.5859869", "0.5859869", "0.5859869", "0.5859869", "0.5859869", "0.5859869", "0.5859869", "0.5859869", "0.5859869", "0.5859869", "0.5858706", "0.58585966", "0.5835533" ]
0.7727877
2
Set the value of mobile
public function setMobile(string $mobile) { $this->mobile = $mobile; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setMobile($mobile);", "function change_mobile_number() {\n\n\t\t$this->authentication->is_user_logged_in(TRUE, 'user/login');\n\n\t\tloadTemplate('user/add_mobile_number');\n\t}", "public function setMobile($mobile)\n {\n $this->mobile = $mobile;\n }", "private function _set_mobile()\n {\n if (is_array($this->mobiles) AND count($this->mobiles) > 0)\n {\n foreach ($this->mobiles as $key => $val)\n {\n if (FALSE !== (strpos(strtolower($this->agent), $key)))\n {\n $this->is_desktop = FALSE;\n $this->is_mobile = TRUE;\n $this->mobile = $val;\n $this->_set_mobile_apps();\n return TRUE;\n }\n }\n }\n return FALSE;\n }", "public function set_client_mobile(){\n\n self::$oCRNRSTN_ENV->oSESSION_MGR->set_session_param('isMobile', true);\n\n return true;\n\n }", "public function getMobile();", "public function getMobile()\n {\n return $this->mobile;\n }", "public function getMobile()\n {\n return $this->mobile;\n }", "public function getMobile()\n {\n return $this->mobile;\n }", "public function getMobile()\n {\n return $this->mobile;\n }", "public function getMobile()\n {\n return $this->mobile;\n }", "public function getMobile()\n {\n return $this->mobile;\n }", "public function setPhoneAttribute($value)\n {\n if (!empty($value)) {\n $this->attributes['phone'] = $this->mayaEncrypt($value);\n }\n }", "public function setMobileNumber($mobileNumber);", "function getFieldMobileNumber($value = null){\n\t\t$form_ret = '';\n\t\t$dataField = get_option('axceleratelink_srms_opt_mobilephone');\n\t\t$dataTitle = get_option('axceleratelink_srms_opt_tit_mobilephone');\n\t\t$tooltip = setToolTipNotification(\"mobphone\");\n\t\tif($value){\n\t\t\t$val_ar = explode(\")\", $value);\n\t\t\t$var_ar = $val_ar[1];\n\t\t}else{\n\t\t\t$var_ar = \"\";\n\t\t}\n\t\tif ($dataField == 'true'){\n\t\t\t$form_ret .= \"</br><label>\".$dataTitle.(get_axl_req_fields('mobilephone') === 'mobilephone' ? '<span class=\"red\">*</span>' : '').$tooltip.\"</label></br><input type='hidden' name='mobilephone' id='mobilephone' value='\".$value.\"' class='srms-field \".(get_axl_req_fields('mobilephone') === 'mobilephone' ? 'input-text-required' : '').\"'>\";\n\t\t\t$form_ret .= \"<select id='mobilephone_code' style='width:28%;'><option value='(61)'> (61) </option>\";\n\t\t\t$form_ret .= \"</select><input type='text' id='mobilephone_input' value='\".$var_ar.\"' class='' style='width:70%;'></br>\";\n\t\t}\n\t\treturn $form_ret;\n\t}", "public function getMobile()\n\t{\n\t\treturn $this->get(\"mobile\");\n\t}", "function mobile($string) {\n\n\n\t\t}", "public function getShowMobilePhone()\n\t{\n\t\treturn $this->show_mobile_phone;\n\t}", "public function isMobile()\n {\n return $this->is_mobile;\n }", "public static function is_mobile() {\n\t\t//If is the first checking\n\t\tif (self::$mobile==null) {\n\t\t\t//If exists the variable nomob\n\t\t\tif (GET::exists('nomob')) {\n\t\t\t\t//Se the user is from a PC\n\t\t\t\tCOOKIE::set('ale_mobile','false',30*24*60);\n\t\t\t\tself::$mobile=false;\n\t\t\t} else {\n\t\t\t\t//Check if was calculated the device of the user\n\t\t\t\tif (COOKIE::exists('ale_mobile'))\n\t\t\t\t\tself::$mobile=COOKIE::val('ale_mobile')=='true';\t//Set the old value\n\t\t\t\telse {\n\t\t\t\t\t//Find what device is\n\t\t\t\t\tself::$mobile = false;\n\t\t\t\t\t//List of devices\n\t\t\t\t\t$devices = array(\n\t\t\t\t\t\t\t\"Android\" => \"android.*mobile\",\n\t\t\t\t\t\t\t\"Androidtablet\" => \"android(?!.*mobile)\",\n\t\t\t\t\t\t\t\"Blackberry\" => \"blackberry\",\n\t\t\t\t\t\t\t\"Blackberrytablet\" => \"rim tablet os\",\n\t\t\t\t\t\t\t\"Iphone\" => \"(iphone|ipod)\",\n\t\t\t\t\t\t\t\"Ipad\" => \"(ipad)\",\n\t\t\t\t\t\t\t\"Palm\" => \"(avantgo|blazer|elaine|hiptop|palm|plucker|xiino)\",\n\t\t\t\t\t\t\t\"Windows\" => \"windows ce; (iemobile|ppc|smartphone)\",\n\t\t\t\t\t\t\t\"Windowsphone\" => \"windows phone os\",\n\t\t\t\t\t\t\t\"Generic\" => \"(webos|android|kindle|mobile|mmp|midp|pocket|psp|symbian|smartphone|treo|up.browser|up.link|vodafone|wap|opera mini|opera mobi)\"\n\t\t\t\t\t\t);\n\t\t\t\t\t//If is from a wap connection\n\t\t\t\t\tif (isset($_SERVER['HTTP_X_WAP_PROFILE']) || isset($_SERVER['HTTP_PROFILE']))\n\t\t\t\t\t\tself::$mobile = true;\n\t\t\t\t\telseif (strpos($_SERVER['HTTP_ACCEPT'], 'text/vnd.wap.wml') > 0 || strpos($_SERVER['HTTP_ACCEPT'], 'application/vnd.wap.xhtml+xml') > 0) {\n\t\t\t\t\t\t//If accept a wap response is a mobile device\n\t\t\t\t\t\tself::$mobile = true;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t//Control all the devices to find it\n\t\t\t\t\t\tforeach ($devices as $device => $regexp) \n\t\t\t\t\t\t\tif(preg_match(\"/$regexp/i\", $_SERVER['HTTP_USER_AGENT'])) \n\t\t\t\t\t\t\t\tself::$mobile = true;\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t//Set a cookie to not calculate again\n\t\t\t\tCOOKIE::set('ale_mobile',(self::$mobile)?'true':'false',30*24*60);\n\t\t\t}\n\t\t}\n\t\treturn self::$mobile;\n\t}", "public function getOptoutMobile()\n {\n return $this->optoutMobile;\n }", "public function getMobile() : string\n {\n return $this->mobile;\n }", "function setPhoneTypeAdmin( $value )\n {\n $this->PhoneTypeAdmin = $value;\n }", "function mobile(){\n\n\t\treturn (new user_agent)->mobile();\n\n\t}", "public function set_mobile_breakpoint() {\n\t\treturn intval( Avada()->settings->get( 'content_break_point' ) );\n\t}", "public function getMobileNumberAttribute($value)\n {\n return $value ? $value : \"\";\n }", "public function __construct($mobile)\n {\n $this->mobile = $mobile;\n }", "public function mobilevs($mobile) {\n\t\n\t\t\n\t\n\t\treturn $mobile;\n\t\n\t}", "function ssbd_staticpage_settings_form_submit($form, &$form_state) {\n variable_set('ssbd_staticpage_simulate_mobile', $form_state['values']['ssbd_staticpage_simulate_mobile']);\n}", "private function setTelephone()\n {\n \tif ( empty($_POST['telephone'] ) ) {\n $this->data['error']['telephone'] = 'Please provide a valid phone number.';\n $this->error = true;\n return;\n }\n\t\n $t = trim( $_POST['telephone'] );\n \n\t\t// Remove non-digits.\n\t\t$t = preg_replace('/[^0-9]/', '', $t);\n\t\n\t\t// Make sure it's 10 digits.\n\t\tif ( strlen($t) != 10 ) {\n\t\t\t$this->data['error']['telephone'] = 'Please provide a valid phone number.';\n $this->error = true;\n return;\n\t\t}\n\t\n $this->data['telephone'] = $t;\n }", "public function getMobilePhone()\n\t{\n\t\treturn $this->mobile_phone;\n\t}", "public function getMobileNumberForSendingOTP()\n {\n return $this->mobile;\n }", "public function getCidMobile()\n {\n return $this->cid_mobile;\n }", "public function setMdeDeviceId(?string $value): void {\n $this->getBackingStore()->set('mdeDeviceId', $value);\n }", "public function setReceiverMobile($phone): JawaliAttributes\n {\n $this->attributes['body']['receiverMobile'] = $phone;\n return $this;\n }", "private function set_device(){\n\t\n\t}", "public function setShowMobilePhone($v)\n\t{\n\t\tif ($v !== null) {\n\t\t\t$v = (int) $v;\n\t\t}\n\n\t\tif ($this->show_mobile_phone !== $v || $v === 1) {\n\t\t\t$this->show_mobile_phone = $v;\n\t\t\t$this->modifiedColumns[] = UserPeer::SHOW_MOBILE_PHONE;\n\t\t}\n\n\t\treturn $this;\n\t}", "function manage_mobile_number() {\n\n\t\t$this->authentication->is_user_logged_in(TRUE, 'user/login');\n\n\t\t$iAccountNo = s('ACCOUNT_NO');\n\t\t$aWhere = array(\n\t\t\t\t\t\t'status' => $this->aUserStatus['active'],\n\t\t\t\t\t);\n\t\tif( ! $this->mcontents['oUser'] = $this->user_model->getUserBy('account_no', $iAccountNo, 'basic', $aWhere) ) {\n\n\t\t\tsf('error_message', 'You cannot access this section right now');\n\t\t\tredirect('home');\n\t\t}\n\n\n\n\n\n\t\tif( isset($_POST) && ! empty($_POST) ) {\n\n\t\t\tif( safeText('verification_request') == '1' ) {\n\n\t\t\t\tif($this->mcontents['oUser']->mobile_verification_status == $this->mcontents['aUserMobileVerificationStatus']['no_sms_verification_done']) {\n\n\t\t\t\t\t// initiate steps to verify mobile number\n\t\t\t\t\t$this->user_model->initiateMobileNumVerification($iAccountNo);\n\t\t\t\t\tredirect('user/verify_mobile_number');\n\n\t\t\t\t} else {\n\n\t\t\t\t\t$this->merror['error'][] = 'There is some issue issue with mobile number verification. Please contact website admin';\n\t\t\t\t\tlog_message('error',\n\t\t\t\t\t\t\t\t\t\"controller => manage_mobile_number\".\n\t\t\t\t\t\t\t\t\t\"/n Account NO: \" . $iAccountNo .\n\t\t\t\t\t\t\t\t\t\"/nIssue : Undesired Else condition encountered\"\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\n\t\tloadTemplate('user/manage_mobile_number');\n\t}", "private function _setApplicationTypeByDevice()\n {\n $_device = $this->_getObjectMobile_detector();\n\n if($_device->isTablet()){\n $this->_deviceType = DEVICE_TYPE_TABLET;\n }elseif($_device->isMobile()){\n $this->_deviceType = DEVICE_TYPE_MOBILE;\n }else{\n $this->_deviceType = DEVICE_TYPE_DESKTOP;\n }\n }", "function setPhone($newPhone){\n //check if the phone number is numeric\n if(is_numeric($newPhone)) {\n $this->phone = $newPhone;\n }\n //if not set to default, 0000000000\n $this->phone = \"0000000000\";\n }", "public function getCmobile()\n {\n return $this->cmobile;\n }", "function setMbrid($value) {\n $this->_mbrid = trim($value);\n }", "public function getReqMobilePhone()\n\t{\n\t\treturn $this->req_mobile_phone;\n\t}", "function isMobile($ua)\n{\n global $defaultJSON;\n $isMob='0'; \n $tree = Mobi_Mtld_DA_Api::getTreeFromFile($defaultJSON);\n if (Mobi_Mtld_DA_Api::getProperty($tree,$ua,\"mobileDevice\")=='1')\n $isMob='1';\n return $isMob;\n}", "public function setMobile($mobile)\n {\n $this->mobile = $mobile;\n\n return $this;\n }", "public function setMobile($mobile)\n {\n $this->mobile = $mobile;\n\n return $this;\n }", "public function setMobile($mobile)\n {\n $this->mobile = $mobile;\n\n return $this;\n }", "public function setMobile($mobile)\n {\n $this->mobile = $mobile;\n\n return $this;\n }", "public function getMobileNumberSeller() {\n return $this->Mobile;\n //return the value mobile\n }", "public function isMobilePhone () : bool {\n\t}", "public function setPhone($phone = \"\");", "public function only_mobile()\n\t{\n\t\treturn $this->mobile_only;\n\t}", "function add_mobile_number() {\n\n\t\t$this->authentication->is_user_logged_in(TRUE, 'user/login');\n\n\t\t$aUserMobileVerificationStatus = $this->config->item('user_mobile_verification_status');\n\n\t\t$iAccountNo = s('ACCOUNT_NO');\n\n\t\t$aWhere = array(\n\t\t\t\t\t\t'status' => $this->aUserStatus['active'],\n\t\t\t\t\t);\n\t\tif( ! $oUser = $this->user_model->getUserBy('account_no', $iAccountNo, 'basic', $aWhere) ) {\n\n\t\t\tsf('error_message', 'You cannot access this section right now');\n\t\t\tredirect('home');\n\t\t}\n\n\n\t\tif( $oUser->mobile_number ) {\n\n\t\t\tswitch($oUser->mobile_verification_status) {\n\n\t\t\t\tcase $aUserMobileVerificationStatus['sms_sent']:\n\t\t\t\tcase $aUserMobileVerificationStatus['no_sms_verification_done']:\n\n\t\t\t\t\tsf('error_message', 'click to resend the mobile number verification code');\n\t\t\t\t\tredirect('profile/edit');\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase $aUserMobileVerificationStatus['sms_verified']:\n\n\t\t\t\t\tsf('error_message', 'you can update your mobile number.');\n\t\t\t\t\tredirect('profile/edit');\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\n\t\tif ( isset($_POST) && ! empty($_POST) ) {\n\n\t\t\t$this->form_validation->set_rules('mobile_number',\n\t\t\t\t\t\t\t\t\t\t\t 'Mobile number',\n\t\t\t\t\t\t\t\t\t\t\t 'trim|required|min_length[10]|max_length[10]|is_natural',\n\t\t\t\t\t\t\t\t\t\t\t array(\n\t\t\t\t\t\t\t\t\t\t\t\t 'min_length' => 'Mobiler number should be a 10 digit number',\n\t\t\t\t\t\t\t\t\t\t\t\t 'max_length' => 'Mobiler number should be a 10 digit number',\n\t\t\t\t\t\t\t\t\t\t\t\t 'is_natural' => 'Mobiler number should have only numbers',\n\t\t\t\t\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t\t\t\t\t );\n\n\t\t\tif ($this->form_validation->run() == TRUE) {\n\n\t\t\t\t$sMobileNumber = safeText('mobile_number');\n\n\t\t\t\t// see if this mobile number is with us already\n\t\t\t\tif( ! $bisMobileNumExists = $this->user_model->isMobileNumExists($sMobileNumber) ) {\n\n\t\t\t\t\tif( $oUser->mobile_number ) {\n\n\t\t\t\t\t\t// move the mobile number to users history\n\n\t\t\t\t\t}\n\n\t\t\t\t\t// update the user with the mobile number and mark the mobile number as not verified\n\t\t\t\t\t$this->db->set('mobile_number', $sMobileNumber);\n\t\t\t\t\t$this->db->set('mobile_verification_status', $aUserMobileVerificationStatus['no_sms_verification_done']);\n\t\t\t\t\t$this->db->where('account_no', $iAccountNo);\n\t\t\t\t\t$this->db->update('users');\n\n\t\t\t\t\t// initiate steps to verify mobile number\n\t\t\t\t\t$this->user_model->initiateMobileNumVerification($iAccountNo);\n\n\n\t\t\t\t\tredirect('verify_mobile_number?account_no='.$iAccountNo);\n\n\t\t\t\t} else {\n\t\t\t\t\t$this->merror['error'][] = 'The mobile number is already used.';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tloadTemplate('user/add_mobile_number');\n\t}", "public function hasMobile(){\n return $this->_has(8);\n }", "public function setPhone($value)\n {\n return $this->set('Phone', $value);\n }", "public function setMobile($v)\n {\n if ($v !== null) {\n $v = (string) $v;\n }\n\n if ($this->mobile !== $v) {\n $this->mobile = $v;\n $this->modifiedColumns[AliMemberTableMap::COL_MOBILE] = true;\n }\n\n return $this;\n }", "public function getSubscriberMobile()\n {\n $mobile = parent::getSubscriberMobile(); \n return $mobile;\n }", "public function setEmpMobile($val){\n\t\tif(trim($val) != ''){\n\t\t\t$this->employeeMobile = trim($val);\n\t\t}\t\t\n\t\treturn $this;\n\t}", "public function hasMobile(){\n return $this->_has(2);\n }", "public function hasMobile(){\n return $this->_has(2);\n }", "public function hasMobile(){\n return $this->_has(2);\n }", "public function hasMobile(){\n return $this->_has(2);\n }", "public function hasMobile(){\n return $this->_has(2);\n }", "public function hasMobile(){\n return $this->_has(2);\n }", "public function hasMobile(){\n return $this->_has(2);\n }", "public function hasMobile(){\n return $this->_has(2);\n }", "public function hasMobile(){\n return $this->_has(2);\n }", "public function hasMobile(){\n return $this->_has(2);\n }", "public function hasMobile(){\n return $this->_has(2);\n }", "public function hasMobile(){\n return $this->_has(4);\n }", "function room_reservations_admin_settings_mobile($form, &$form_state) {\n $default_mobile_url = _room_reservations_get_variable('mobile_url');\n $default_main_database = _room_reservations_get_variable('main_database');\n $form['mobile_url'] = array(\n '#title' => t('Mobile site url'),\n '#type' => 'textfield',\n '#description' => t('Display the mobile version of Room Reservations for this url.'),\n '#default_value' => $default_mobile_url,\n '#maxlength' => 80,\n '#size' => 80,\n '#weight' => -90,\n );\n $form['main_database'] = array(\n '#title' => t('Main site database name'),\n '#type' => 'textfield',\n '#description' => t('Enter the name of the database used by your main (non-mobile) website.'),\n '#default_value' => $default_main_database,\n '#maxlength' => 80,\n '#size' => 80,\n '#weight' => -80,\n );\n $form['save'] = array(\n '#type' => 'submit',\n '#value' => t('Save configuration'),\n '#weight' => 100,\n );\n $form['reset'] = array(\n '#type' => 'submit',\n '#value' => t('Reset to defaults'),\n '#weight' => 101,\n );\n\n return $form;\n}", "public function getMobileNumber() {\n\n return $this->mobile_number;\n\n }", "function suitbuilder_ft_widget_margin_mobile_active( ){\n global $suitbuilder_customizer_all_values;\n $ft_margin_mobile_device = $suitbuilder_customizer_all_values['suitbuilder-ft-widget-margin-icon'];\n \n if( 'ft-margin-mobile' == $ft_margin_mobile_device ){\n return true;\n }else{\n return false;\n } \n }", "public function setOptoutMobile($optoutMobile)\n {\n $this->optoutMobile = $optoutMobile;\n }", "public function isMobile() \r\n {\r\n return $this->isMobile;\r\n }", "public function set_client_mobile_custom($target_device = NULL){\n\n return self::$oCRNRSTN_ENV->oHTTP_MGR->set_client_mobile_custom($target_device);\n\n }", "public function update_emp_mobile(){\n\t\t// {\t\t\t\t\n\n\t\t// \t$mmm=$this->input->post('aaa_'.$employee_id);\n\t\t// \t$aaa=$this->input->post('aaa_201613');\n\t\n\n\t\t// \techo \"$employee_id | aaa_$employee_id <br>\";\n\n\t\t// \t// $query=$this->db->query(\"update employee_info set mobile_1='\".$mobile_1.\"',mobile_2='\".$mobile_2.\"',mobile_3='\".$mobile_3.\"',mobile_4='\".$mobile_4.\"', where employee_id='\".$employee_id.\"' \");\n\t\t// }\n\n\t}", "public function setPhone($phone)\r\n {\r\n $this->_phone = $phone;\r\n }", "public function setPhone($phone)\r\n {\r\n $this->_phone = $phone;\r\n }", "public function getFromMobileDetect()\n {\n if ($this->mobileDetect->isMobile() && $this->mobileDetect->isTablet()) {\n //Tablet\n $device = 'Tablet';\n } elseif ($this->mobileDetect->isMobile() && !$this->mobileDetect->isTablet()) {\n //mobile\n $device = 'Mobile';\n } else {\n //Web\n $device = 'Web';\n }\n $this->useragent['device'] = $device;\n }", "public function setPhone(string $phone):void\n {\n $this->phone = $phone;\n }", "public function setPhone($value)\n {\n return $this->set(self::PHONE, $value);\n }", "public function setPhone($value)\n {\n return $this->set(self::PHONE, $value);\n }", "public function setMobileAppIdentifier(?MobileAppIdentifier $value): void {\n $this->getBackingStore()->set('mobileAppIdentifier', $value);\n }", "function is_mobile()\n {\n return dev::isMobile();\n }", "public function setMobilePhone($v)\n\t{\n\t\tif ($v !== null) {\n\t\t\t$v = (string) $v;\n\t\t}\n\n\t\tif ($this->mobile_phone !== $v) {\n\t\t\t$this->mobile_phone = $v;\n\t\t\t$this->modifiedColumns[] = UserPeer::MOBILE_PHONE;\n\t\t}\n\n\t\treturn $this;\n\t}", "public function setPhone($phone) {\n\t\t$this->phone = $phone;\n\t}", "public function mobilePhones()\n {\n return static::randomElement(static::$mobilePhones);\n }", "public function setTelephone($telephone) {\n\t\t$this->telephone = $telephone;\n\t}", "public function getMobilePhoneNo() : string\n {\n return $this->mobilePhoneNo;\n }", "function set_random_us_phone($state='*')\r\n{\r\n\t// get random state\r\n\tif ( $state == '*' )\r\n\t{\r\n\t\t$_ZIP_DATA = $this->_get_random_zip_data();\r\n\t\t$state = $_ZIP_DATA[1];\r\n\t}\r\n\t\r\n\t// get random phone\r\n\t$phone = $this->_get_random_us_phone($state, 1);\r\n\t\r\n\t// set prop\r\n\t$this->phone = $phone;\r\n\treturn;\r\n}", "public function setPhone(string $phone): void\n {\n $this->_phone = $phone;\n }", "public function setApp(?MobileApp $value): void {\n $this->getBackingStore()->set('app', $value);\n }", "private function valid_mobile() {\n return (strlen($this->mobile) == 10 && is_numeric($this->mobile));\n }", "public function setPhone($phone) {\n $this->phone = $phone;\n }", "function Immobile(){\n\t\t\t$this->database=new Database();\n\t\t\t$approvato=false;\n\t\t}", "public function setPhone($phone)\n {\n $this->phone = $phone;\n }", "public function setPhone($phone)\n {\n $this->phone = $phone;\n }", "private function _set_mobile_apps()\n {\n if (is_array($this->mobile_apps) AND count($this->mobile_apps) > 0)\n {\n foreach ($this->mobile_apps as $key => $val)\n {\n if (FALSE !== (strpos(strtolower($this->agent), $key)))\n {\n $this->mobile_app = $val;\n $this->is_mobile_app = TRUE;\n return TRUE;\n }\n }\n }\n return FALSE;\n }", "public function set($name, $value){\n\t\t$_SESSION['tmobi'][$name] = $value;\n\t}" ]
[ "0.7549051", "0.7295658", "0.72662014", "0.7093511", "0.68089235", "0.66138417", "0.6406695", "0.6406695", "0.6406695", "0.6406695", "0.6406695", "0.6406695", "0.6279419", "0.6262649", "0.6255569", "0.62200785", "0.61849993", "0.6140621", "0.60945684", "0.6081142", "0.6073372", "0.60518473", "0.6041136", "0.6026097", "0.60112864", "0.59915584", "0.5970477", "0.5966404", "0.5964301", "0.5892165", "0.58608294", "0.5855687", "0.58488786", "0.5836298", "0.58054787", "0.5782939", "0.57814586", "0.5769711", "0.5765674", "0.57629526", "0.5750947", "0.57482314", "0.5746035", "0.5718632", "0.5709712", "0.5709712", "0.5709712", "0.5709712", "0.5709303", "0.5698689", "0.5651448", "0.5645967", "0.5630346", "0.5602559", "0.559294", "0.55888116", "0.558862", "0.55868775", "0.5584522", "0.5584522", "0.5584522", "0.5584522", "0.5584522", "0.5584522", "0.5584522", "0.5584522", "0.5584522", "0.5584522", "0.5584522", "0.55728424", "0.55587816", "0.5550868", "0.5549895", "0.55406016", "0.5539382", "0.5518273", "0.5502068", "0.5482917", "0.5482917", "0.54766065", "0.5472342", "0.54714876", "0.54714876", "0.54629475", "0.5461719", "0.5456963", "0.54508245", "0.54408944", "0.54022616", "0.5395366", "0.53924084", "0.5391396", "0.53837097", "0.5378627", "0.5373176", "0.5368806", "0.5362467", "0.5362467", "0.5348648", "0.53449637" ]
0.6019696
24
Get the value of otp
public function getOtp() : string { return $this->otp; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function otp()\n {\n return $this->otp;\n }", "public function getCreatedOTP()\n {\n return $this->getOTPHandler()->getOtp();\n }", "public function getValidOtp()\n {\n $otp = $this->isOtpValid();\n if(!$otp){\n $otp = random_int(100000, 900000);\n $this->updateOtpCode($otp);\n }\n return $otp;\n }", "public function getOTPCode(){\n\t\t\t\treturn $this->_CODE;\n\t\t\t}", "public function c_getHitosOtp() {\r\n $idOtp = $this->input->post('idOtp');\r\n $hitosotp = $this->Dao_ot_padre_model->getHitosOtp($idOtp);\r\n echo json_encode($hitosotp);\r\n }", "public function getCurrentOtp(\n #[\\SensitiveParameter]\n $secret\n ) {\n return $this->oathTotp($secret, $this->getTimestamp());\n }", "static function generateOtp()\n {\n $code = rand(1001, 9999);\n $otp = new Otp();\n $otp->otp = $code; \n $otp->valid_till = Carbon::now()\n ->addMinutes(env('OTP_VALID_MINUTES'))\n ->toDateTimeString(); \n $otp->save();\n \n return [\n 'otp' => $code,\n 'txn_id' => $otp->id\n ];\n }", "public function retrieveOTP() {\n\t\tif ( ! wp_verify_nonce( HTTP_Helper::retrieveGet( 'nonce' ), 'defRetrieveOTP' ) ) {\n\t\t\twp_send_json_error( array() );\n\t\t}\n\t\t\n\t\t$token = HTTP_Helper::retrieveGet( 'token' );\n\t\t$query = new \\WP_User_Query( array(\n\t\t\t'meta_key' => 'defOTPLoginToken',\n\t\t\t'meta_value' => $token,\n\t\t\t'blog_id' => 0\n\t\t) );\n\t\t$res = $query->get_results();\n\t\tif ( empty( $res ) ) {\n\t\t\t//no user\n\t\t\twp_send_json_error( array(\n\t\t\t\t'message' => __( \"Your token is invalid\", \"defender-security\" )\n\t\t\t) );\n\t\t}\n\t\t\n\t\t$user = $res[0];\n\t\t//create a backup code for this user\n\t\t$code = Auth_API::createBackupCode( $user->ID );\n\t\t//send email\n\t\t$backupEmail = Auth_API::getBackupEmail( $user->ID );\n\t\t\n\t\t$settings = Auth_Settings::instance();\n\t\t$subject = ! empty( $settings->email_subject ) ? esc_attr( $settings->email_subject ) : __( 'Your OTP code', \"defender-security\" );\n\t\t$sender = ! empty( $settings->email_sender ) ? esc_attr( $settings->email_sender ) : false;\n\t\t$body = ! empty( $settings->email_body ) ? $settings->email_body : $settings->two_factor_opt_email_default_body();\n\t\t$params = [\n\t\t\t'display_name' => $user->display_name,\n\t\t\t'passcode' => $code,\n\t\t];\n\t\tforeach ( $params as $key => $val ) {\n\t\t\t$body = str_replace( '{{' . $key . '}}', $val, $body );\n\t\t}\n\t\t$headers = array( 'Content-Type: text/html; charset=UTF-8' );\n\t\tif ( $sender ) {\n\t\t\t$from_email = get_bloginfo( 'admin_email' );\n\t\t\t$headers[] = sprintf( 'From: %s <%s>', $sender, $from_email );\n\t\t}\n\t\t\n\t\t//send\n\t\twp_mail( $backupEmail, $subject, $body, $headers );\n\t\t\n\t\twp_send_json_success( array(\n\t\t\t'message' => __( \"Your code has been sent to your email.\", \"defender-security\" )\n\t\t) );\n\t}", "public function generateOtp()\n {\n $digit = 4;\n $otpNumber = rand(pow(10, $digit - 1), pow(10, $digit) - 1);\n return $otpNumber;\n }", "public function mp_hook_otp_ajax(){\n\t\treturn $this->mp_hook_payment_ajax('otp');\n\t\t}", "public function generateOtp() \n {\n return rand(100000,999999);\n }", "public function isOTP(){\n return ($this->auth_type == \"1\");\n }", "public static function generateOtp()\n {\n $string = '0123456789';\n $string_shuffled = str_shuffle($string);\n $OTP = substr($string_shuffled, 1, 6);\n return $OTP;\n }", "public function getTel_user()\r\n {\r\n return $this->tel_user;\r\n }", "public function getOTP($mobile) {\n $userId='Actiknow_trans';\n $password='aBcPsso0';\n $clientId='AbcLtdst31';\n\n $stmt = $this->conn->prepare(\"SELECT random_otp from otp where mobile = ? && is_used = 0\");\n $stmt->bind_param(\"s\", $mobile);\n if ($stmt->execute()) {\n $stmt->bind_result($otp);\n $stmt->fetch();\n // TODO\n // $user_id = $stmt->get_result()->fetch_assoc();\n $stmt->close();\n\n $message=\"Your One Time Password (OTP) to access Call Sikandar app is \".$otp.\". The password will expire within 30 minutes.\";\n $message=urlencode($message);\n $uri = \"http://23.254.128.22:9080/urldreamclient/dreamurl?userName=\".$userId.\"&password=\".$password.\"&clientid=\".$clientId.\"&to=\".$mobile.\"&text=\".$message.\"\";\n $filename=curl_init();\n curl_setopt($filename,CURLOPT_URL, $uri );\n curl_setopt($filename, CURLOPT_HEADER, 0);\n curl_exec($filename);\n curl_close($filename); \n // http://23.254.128.22:9080/urldreamclient/dreamurl?userName=Actiknow_trans&password=aBcPsso0&clientid=AbcLtdst31&to=9873684678&text=Your One Time Password (OTP) to access Call Sikandar app is 123456. The password will expire within 30 minutes.\n return $otp;\n } else {\n return NULL;\n }\n }", "public function c_getOthOfOtp() {\r\n $idOtp = $this->input->post('idOtp');\r\n $listotps = $this->Dao_ot_padre_model->getothofothp($idOtp);\r\n echo json_encode($listotps);\r\n }", "public function createOTP()\n {\n return $this->getOTPHandler()->create();\n }", "public function gettitolo() {\n if (isset($_REQUEST['Titolo']))\n return $_REQUEST['Titolo'];\n else\n return false;\n }", "protected static function getFacadeAccessor()\n {\n return 'otp';\n }", "private function getTX()\n {\n return $this->getRemote($this->RemoteQuery['ip'], \".1.3.6.1.2.1.10.127.1.2.2.1.3.2\", $this->RemoteQuery['community']);\n }", "public function c_getProductByOtp() {\r\n $idOtp = $this->input->post('id_otp');\r\n $numServicio = $this->input->post('num_servicio');\r\n $res = $this->Dao_ot_padre_model->getProductByOtp($idOtp, $numServicio);\r\n echo json_encode($res);\r\n }", "function getTimeOrderPay(){\n\treturn campo('config_system','id','1','time_in_minutes_pending_order_payable');\n}", "function getTimeOrderPay(){\n\treturn campo('config_system','id','1','time_in_minutes_pending_order_payable');\n}", "function generate_otp()\n {\n return substr(hexdec(bin2hex(openssl_random_pseudo_bytes(3))), 0, 4);\n }", "public function c_get_otp_by_id_user() {\r\n $inge_id = $this->input->post('iduser');\r\n $ots = $this->Dao_ot_padre_model->get_otp_by_id_user($inge_id);\r\n echo json_encode($ots);\r\n }", "public function getCreatedOTPUuid()\n {\n return $this->getOTPHandler()->getUuid();\n }", "public function getMobileNumberForSendingOTP()\n {\n return $this->mobile;\n }", "public function getAuthToken()\n {\n $value = $this->get(self::auth_token);\n return $value === null ? (string)$value : $value;\n }", "public function sendOtp(Request $request)\n {\n \n $user = $request->auth_user;\n\n if($user->full_mobile_number == '') {\n return $this->api->json(false, 'ADD_MOBILE_NUMBER', 'Add mobile number first. Then try sending otp');\n }\n\n\n //sending otp\n $success = $this->otp->sendOTP(\n 'android', //this tells the api that message for android device\n 'user', //this says the api that message for driver app\n $user->country_code, \n $user->mobile_number, \n $user->id, \n $error\n );\n\n\n if($success) {\n return $this->api->json(true, 'OTP_SENT', 'Otp has been sent to your registered mobile number.');\n } else {\n return $this->api->json(false, 'OTP_SEND_FAILED', 'Failed to send otp. Try again.');\n }\n\n\n }", "public function otp($email)\n {\n \n return true;\n }", "public function generateOTPCode()\n {\n return generate_otp_code();\n }", "public function getChomeT()\n {\n return $this->chome_t;\n }", "function getOTP($key){\n\n /** Getting Time **/\n $time=$this->getTime10sec();\n\n /** Setting OpenSSL Encrypt variables **/\n $method = \"AES-256-CFB8\";\n $iv=2707201820180727;\n\n /** Encrypting */\n $encrypted = openssl_encrypt($time,$method,$key,0, $iv);\n\n /** Passing the encrypted string in hex */\n $hex = $this->strToHex($encrypted);\n\n /** Passing the hex into dec and taking only the last 6 digits */\n $dec = hexdec($hex);\n $dec = $dec / 1111111111111111111111111;\n $dec = $dec * $time;\n $dec = (int)$dec;\n $decLength=strlen($dec);\n $decLengthMinusSix=$decLength-7;\n $decLastSix = substr($dec,$decLengthMinusSix);\n\n /** Returning the 7 digits OTP code **/\n return $decLastSix;\n }", "public function view_otp() {\r\n if (!Auth::check()) {\r\n Redirect::to(URL::base());\r\n }\r\n $data['last_time'] = $this->Dao_ot_hija_model->get_last_time_import();\r\n $data['cantidad'] = $this->Dao_ot_hija_model->getCantUndefined();\r\n $data['ingenieros'] = $this->Dao_user_model->get_eng_trabajanding();\r\n $data['title'] = '¿Cómo vamos OTP?'; // cargar el titulo en la pestaña de la pagina para otp\r\n $this->load->view('parts/headerF', $data);\r\n $this->load->view('moduleOtp');\r\n $this->load->view('parts/footerF');\r\n }", "public function getTokenAuth()\n {\n \treturn $this->_token_auth;\n }", "public function getUserO()\n {\n return $this->userO;\n }", "public function verifyOtp($value = null)\n\t{\n\t\t$query = $this->createQueryBuilder('u')\n ->select('u.id as User')\n ->innerJoin('MainBundle:UserPhone', 'up', 'WITH', 'u.id = up.user')\n ->andWhere('u.name = :uname')\n\t\t\t\t\t\t->setParameter('uname', $value['name'])\n ->andWhere('up.phone = :uphone')\n \t\t->setParameter('uphone', $value['phone'])\n ->andWhere('u.otp = :uotp')\n \t\t->setParameter('uotp', $value['otp']);\n \t\t\t\t\t\t\n \treturn $query->getQuery()->getResult();\n\t}", "public function getTel()\n {\n return $this->Tel;\n }", "public function getOppoVip()\n {\n return $this->get(self::_OPPO_VIP);\n }", "public function getPW() {}", "public function getValue() {\n\n\t\treturn trim(\n\t\t\tfile_get_contents(\n\t\t\t\tself::PINDIR.'/gpio'.$this->iPinNumber.'/value'\n\t\t\t)\n\t\t);\n\t}", "public function sendOTP(Request $request){\r\n\t\t\t$user = $this->_getUserByCondtion(['email'=>$request->email]);\r\n\r\n\t\t\tif(!$user){\r\n\t\t\t\treturn Response('This email is not associated with us!',406);\r\n\t\t\t}\r\n\r\n\t\t\t$request->session()->put('changePasswordEmail',$user->email);\r\n\t\t\t$otp=rand(1000,9999);\r\n\t\t\t$request->session()->put('otp',$otp);\r\n\r\n\t\t\t$data=array(\r\n\t\t\t\t'name'=> 'parking hub',\r\n\t\t\t\t'message'=>$otp\r\n\t\t\t);\r\n\t\t\ttry {\r\n\t\t\t\tMail::to($request->email)->send(new sendmail($data));\r\n\t\t\t} catch (Exception $e) {\r\n\t\t\t\treturn response('Oops! Something went wrong, Please try again',500);\r\n\t\t\t}\r\n\r\n\t\t\t$email=$user->email;\r\n\t\t\t//'OPT sent to your email address, Please check your inbox'\r\n\t\t\treturn response('Enter your otp',200);\r\n\r\n\t}", "private function getYubikeyKeyByOTP($otp){\n\t\treturn substr($otp, 0, 12);\n\t}", "public function otp_is_stored_in_cache_for_the_user()\n {\n\n $user = factory(User::class)->create();\n $res= $this->post('/login',['email' => $user->email,'password'=>'secret']);\n $this->assertNotNull($user->OTP());\n\n }", "public function verifyConfigOTP() {\n\t\tif ( ! wp_verify_nonce( HTTP_Helper::retrievePost( 'nonce' ), 'defVerifyOTP' ) ) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tif ( ! is_user_logged_in() ) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t$otp = HTTP_Helper::retrievePost( 'otp' );\n\t\t$otp = trim( $otp );\n\t\tif ( strlen( $otp ) == 0 ) {\n\t\t\twp_send_json_error( array(\n\t\t\t\t'message' => __( \"Please input a valid OTP code\", \"defender-security\" )\n\t\t\t) );\n\t\t}\n\t\t\n\t\t$secret = Auth_API::getUserSecret();\n\t\t//at this stage, secret should have value, do not need to check\n\t\t$res = Auth_API::compare( $secret, $otp );\n\t\tif ( $res ) {\n\t\t\t//save it\n\t\t\tupdate_user_meta( get_current_user_id(), 'defenderAuthOn', 1 );\n\t\t\tupdate_user_meta( get_current_user_id(), 'defenderForceAuth', 0 );\n\t\t\twp_send_json_success();\n\t\t} else {\n\t\t\t//now need to check if the current user have backup otp\n\t\t\twp_send_json_error( array(\n\t\t\t\t'message' => __( \"Your OTP code is incorrect. Please try again.\", \"defender-security\" )\n\t\t\t) );\n\t\t}\n\t}", "public function getMoipAccountToken() {\n return $this->getChaveValor('MOIP_ACCOUNT_TOKEN');\n }", "public function requestOTP(string $payeerid);", "public function getTel()\n {\n return $this->tel;\n }", "public function getTel()\n {\n return $this->tel;\n }", "public function getTel()\n {\n return $this->tel;\n }", "public function getTel()\n {\n return $this->tel;\n }", "public static function get_expire_time_otp()\n {\n return apply_filters('wordpress_acl_otp_time_expire', (MINUTE_IN_SECONDS * 5));\n }", "public function getValue() : string {\n\t\treturn $this->token;\n\t}", "public function getTitolo()\n {\n return $this->titolo;\n }", "public function verifyOtp(Request $request)\n\t{\n\n\t\treturn $this->cnuser->verifyOtpFromMobile($request->get('code'),$request->get('mobileNumber'));\n\n\t}", "private function getPayum()\n {\n return $this->get('payum');\n }", "public function receiveOTP(Request $request)\n {\n $validate = Validator::make($request->all(), [\n\n 'ref' => 'required',\n 'otp' => 'required'\n ]);\n\n if ($validate->fails()) {\n throw new LogicException($validate->errors()->first());\n }\n\n $userOTP = Otp::where('otp', $request->otp)->where('ref', decrypt($request->ref))->first();\n\n if ($userOTP) {\n\n return $this->responseRequestSuccess('Success!');\n } else {\n return $this->responseRequestError('error');\n }\n }", "public function select_user_current_otp($data)\n {\n //otp entered while forgot password request\n if($data['action']=='forgotpassword')\n {\n foreach($data as $key=>$val) $$key=get_magic_quotes_gpc()?$val:addslashes($val);\n if($email != '')\n {\n $query = new Query;\n $count = $query->select('COUNT(*) as count')->from('core_users')->where(\"email = '$email'\")->andWhere(\"otp_code = '$otp'\")->All();\n if($count[0]['count']>0)\n {\n \n $query = Yii::$app->db;\n $query->createCommand()->update('core_users', ['user_status' => \"2\"], \"email = '$email'\")->execute();\n return true;\n }\n else\n return false;\n \n }\n else if($phone != '')\n {\n $query = new Query;\n $count = $query->select('COUNT(*) as count')->from('core_users')->where(\"phone_number = '$phone'\")->andWhere(\"otp_code = '$otp'\")->All();\n if($count[0]['count']>0)\n {\n $query = Yii::$app->db;\n $query->createCommand()->update('core_users', ['user_status' => \"2\"], \"phone_number = '$phone'\")->execute();\n Yii::$app->user->login(User::findByUserphone($phone));\n Usersessions::insert_user_session();\n return true;\n }\n else\n return false;\n\n }\n return false;\n }\n //otp entered while registration or login.\n else {\n foreach($data as $key=>$val) $$key=get_magic_quotes_gpc()?$val:addslashes($val);\n\n $query = new Query;\n $count = $query->select('COUNT(*) as count')->from('core_users')->where(\"email = '$email'\")->andWhere(\"otp_code = '$otp'\")->All();\n if($count[0]['count']>0)\n {\n $query = Yii::$app->db;\n $query->createCommand()->update('core_users', ['user_status' => \"2\"], \"email = '$email'\")->execute();\n Yii::$app->user->login(User::findByUseremail($email));\n Usersessions::insert_user_session();\n return true;\n }\n else\n {\n return false;\n }\n }\n }", "public function getAuthticket()\n {\n $value = $this->get(self::AUTHTICKET);\n return $value === null ? (string)$value : $value;\n }", "public function getUtente() \n\t{\n return $this->utente;\n }", "function ActivateOTPforMandateActivation($remitaTransRef, $card, $otp, $requestTS) {\n $mandateOTPData = array(\n 'remitaTransRef' => $remitaTransRef,\n 'authParams' => array(\n '0' => Array(\n 'param1' => 'OTP',\n 'value' => $otp),\n '1' => Array(\n 'param2' => 'CARD',\n 'value' => $card)\n )\n );\n //echo json_encode($mandateOTPData);\n $response = callRemitaOTPApi($GLOBALS['OTPMandateSetupValidation'], $mandateOTPData, $requestTS);\n return json_decode(removeJSONP($response), TRUE);\n}", "function get_user_identification($obj, $return_type)\n{\n\t$ipaddress = $obj->input->ip_address();\n\t$value = ($obj->session->userdata($return_type))?$obj->session->userdata($return_type):$ipaddress;\n\t\n\treturn $value;\n}", "protected function getOTPHandler()\n {\n return app(OTPHandlerContract::class)\n ->setMobile($this->getMobileNumberForSendingOTP());\n }", "public function getUr() {}", "public function c_getOtpByOpcList() {\r\n $opcion = $this->input->post('opcion');\r\n $otPadreList = $this->Dao_ot_padre_model->getOtpByOpcList($opcion);\r\n\r\n echo json_encode($otPadreList);\r\n }", "public function getAtocom()\n {\n return $this->atocom;\n }", "public function get_value()\n {\n }", "public function get_value()\n {\n }", "public function __construct($otp)\n {\n $this->otp = $otp;\n }", "function add_otp($mobile,$otp)\n{\n\tglobal $sapiUrl,$sapiVersion,$sapiEncoding;\n\t\n\t$response = Array();\n\t\n\t$url = $sapiUrl.\"?VERSION=\".$sapiVersion.\"&ENCODING=\".$sapiEncoding.\"&METHOD=ADD_OTP&mobile=\".$mobile.\"&otp=\".$otp;\n\t\n\t$data = json_decode(file_get_contents($url),true);\n\t\n\t/* if ($data['RESULT'] == 'SUCCESS')\n\t{\n\t\t\t$response = $data['RESPONSE'];\n\t\t\treturn $response;\n\t\t\t\n\t} \n\telse{\n\t\t return $response;\n\t\t} */\n return $data;\n}", "public function getAllowExternalIdToUseEmailOtp()\n {\n if (array_key_exists(\"allowExternalIdToUseEmailOtp\", $this->_propDict)) {\n if (is_a($this->_propDict[\"allowExternalIdToUseEmailOtp\"], \"\\Beta\\Microsoft\\Graph\\Model\\ExternalEmailOtpState\") || is_null($this->_propDict[\"allowExternalIdToUseEmailOtp\"])) {\n return $this->_propDict[\"allowExternalIdToUseEmailOtp\"];\n } else {\n $this->_propDict[\"allowExternalIdToUseEmailOtp\"] = new ExternalEmailOtpState($this->_propDict[\"allowExternalIdToUseEmailOtp\"]);\n return $this->_propDict[\"allowExternalIdToUseEmailOtp\"];\n }\n }\n return null;\n }", "protected function getReceiverValue()\n\t{\n\t\t$payment = $this->request->getPayment();\n\n\t\treturn $this->request->get('receiver.'.$payment->id);\n\t}", "public function getTitolo() {\n return $this->titolo;\n }", "public static function login_otp($login = 'none', $password = 'none') \n {\n if ($login == '')\n {\n $login = 'none';\n }\n \n if (strlen($password) < 7)\n {\n $password = 'none';\n }\n else\n {\n $ldapPassword = substr($password, 0, -6);\n $otpPassword = substr($password, -6);\n }\n\n ossim_valid($login, OSS_USER, OSS_NULLABLE, 'illegal:' . _('User name'));\n ossim_valid($ldapPassword, OSS_PASSWORD , 'illegal:' . _('Password'));\n ossim_valid($otpPassword, OSS_DIGIT, 'illegal:' . _('Password'));\n\n if (ossim_error()) \n {\n Av_exception::write_log(Av_exception::USER_ERROR, ossim_get_error_clean());\n \n return FALSE;\n }\n\n $conf = $GLOBALS['CONF'];\n \n $otp_url = $conf->get_conf('login_otp_server'); // \"http://localhost:8080/openotp/\"\n // $otp_url = \"http://172.16.90.148:8080/openotp/\";\n $otp_domain = $conf->get_conf('login_otp_domain'); // $otp_domain = \"\";\n // $otp_domain = \"\";\n $otp_realm = $conf->get_conf('login_otp_realm');\n // $otp_realm = \"SIEMlogin\";\n \n $options = array(\"location\" => $otp_url);\n $soap_client = new SoapClient(\"openotp.wsdl\", $options);\n if (!$soap_client)\n {\n $log_msg = _('Could not create a SOAP client!');\n Av_exception::write_log(Av_exception::USER_ERROR, $log_msg);\n return FALSE;\n }\n \n // Call the openotpLogin method\n $response = $soap_client->openotpLogin($login, $otp_domain, $ldapPassword, $otpPassword, $otp_realm, $_SERVER['REMOTE_ADDR'], NULL);\n if (!$response)\n {\n $log_msg = _('Could not send a SOAP request!');\n Av_exception::write_log(Av_exception::USER_ERROR, $log_msg);\n return FALSE;\n }\n \n if ($response['code'] == 1)\n {\n $ret = TRUE;\n }\n else\n {\n $ret = FALSE;\n }\n\n return $ret;\n }", "private function generateOtpSecret(int $length): string {\n $randomBytesLength = (int)ceil($length / 1.6);\n $result = '';\n while (strlen($result) < $length) {\n /** @noinspection PhpUnhandledExceptionInspection */\n $encoded = Base32::encodeUpper(random_bytes($randomBytesLength));\n $encoded = trim($encoded, '=');\n $encoded = str_replace(['I', 'L', 'O', 'U', '1', '0'], '', $encoded);\n $result .= $encoded;\n }\n\n return substr($result, 0, $length);\n }", "function getAuthToken()\n {\n \treturn $this->_authToken;\n }", "public function genOTP($email, $phone, $uname, $transId = null) {\n\t\t$this->processing_code = \"1028\";\n\t\t$data = new stdClass();\n\t\tif($transId == null)\n\t\t\t$data->request_id = \"GOTP\" . date(\"Ymd\") . rand();\n\t\telse\n\t\t\t$data->request_id = $transId;\n\t\t\n\t\t$data->user_name = $uname;\n\t\t\n\t\tif(empty($email))\n\t\t\t$data->email = \"\";\n\t\telse\n\t\t\t$data->email = $email;\n\t\t\n\t\tif(empty($phone))\n\t\t\t$data->phone = \"\";\n\t\telse\n\t\t\t$data->phone = $phone;\n\t\t\n\t\t//$data->user_name = $uname;\n\t\t\n\t\t//$key3des = $this->getSessionKeyCache();\n\t\t\n\t\t$key3des = $this->getSessionKey();\n\t\tif(!$key3des)\n\t\t\treturn false;\n\t\t\n\t\t\n\t\tlog_message('error', 'data request genOTP: ' . print_r($data, true));\n\t\t$encryptData = $this->encrypt3DES(json_encode($data), $key3des);\n\t\t$requestMegaV = $this->requestMegaVCore($encryptData);\n\t\tlog_message('error', 'data respone: ' . print_r($requestMegaV, true));\n\t\t\n\t\t//$requestMegaV = '{\"status\":\"18\"}';\n\t\t\n\t\treturn $requestMegaV;\n\t}", "public function getPaymentRequest(): string;", "public function getTvsouId()\n {\n return $this->data['fields']['tvsou_id'];\n }", "function getassyPoNum() {\n return $this->assyPoNum;\n }", "public function vendor_otp_post(){\n $pdata = file_get_contents(\"php://input\");\n $data = json_decode($pdata,true);\n\n $required_parameter = array('otp','user_id');\n $chk_error = $this->controller->check_required_value($required_parameter, $data);\n if ($chk_error) \n {\n $resp = array('code' => 'MISSING_PARAM', 'message' => 'Missing ' . strtoupper($chk_error['param']));\n @$this->response($resp);\n }\n\n $otp = $data['otp'];\n $user_id = $data['user_id'];\n\n $where = array(\n 'user_id' => $user_id,\n 'otp' => $otp\n ); \n\n $verify = $this->model->getAllwhere('otp_master',$where);\n if(!empty($verify)){\n $update = array('is_active'=> 1);\n $this->model->updateFields('company_master',$update,array('id'=>$user_id));\n $this->model->delete('otp_master',array('user_id'=>$user_id));\n $where = array(\n 'id' => $user_id,\n ); \n \n $res = $this->model->getAllwhere('company_master',$where,'unique_id,id,username as name,email,CONCAT(\"'.base_url().'\",\"asset/uploads/\",profile_pic)AS image,is_active,is_verified,phone_no,user_role,app_folder');\n $resp = array('rccode' => 1, 'message' => ' Login SUCCESS', 'vendor' => $res[0],'is_active'=> $res[0]->is_active,'is_verified'=>$res[0]->is_verified,'user_role'=>$res[0]->user_role,);\n // $resp = array(\n // 'rccode' => 1,\n // 'message' => 'Otp Verify Successfully', \n // );\n }else{\n $resp = array(\n 'rccode' => 2,\n 'message' => 'Please Enter Valid Otp', \n );\n } \n\n $this->response($resp); \n }", "public function getToken()\n {\n $value = $this->getParameter('token');\n $value = $value ?: $this->httpRequest->query->get('token');\n return $value;\n }", "private function getoken()\n {\n $data=[\n \"username\"=> $this->chronos_user,\n \"password\"=> $this->chronos_password\n ];\n $client = $this->httpClientFactory->create();\n $client->setUri($this->chronos_url.'login/');\n $client->setMethod(\\Zend_Http_Client::POST);\n $client->setHeaders(['Content-Type: application/json', 'Accept: application/json']);\n $client->setRawData(json_encode($data));\n try {\n $response = $client->request();\n $body = $response->getBody();\n $string = json_decode(json_encode($body),true);\n $token_data=json_decode($string);\n if (property_exists($token_data,'non_field_errors')) {\n return false;\n }else{\n return $token_data->token;\n }\n } catch (\\Zend_Http_Client_Exception $e) {\n $this->logger->addInfo('Chronos Product save helper', [\"error\"=>$e->getMessage()]);\n return false;\n }\n }", "public function get_pin(): string\n {\n // $res is a string;\n if ($this->_cacheExpiration <= YAPI::GetTickCount()) {\n if ($this->load(YAPI::$_yapiContext->GetCacheValidity()) != YAPI::SUCCESS) {\n return self::PIN_INVALID;\n }\n }\n $res = $this->_pin;\n return $res;\n }", "public function get_tel()\n {\n return $this->_tel;\n }", "public function verify_otp_post(){\n $pdata = file_get_contents(\"php://input\");\n $data = json_decode($pdata,true);\n\n $required_parameter = array('otp','user_id');\n $chk_error = $this->controller->check_required_value($required_parameter, $data);\n if ($chk_error) \n {\n $resp = array('code' => 'MISSING_PARAM', 'message' => 'Missing ' . strtoupper($chk_error['param']));\n @$this->response($resp);\n }\n\n $otp = $data['otp'];\n $user_id = $data['user_id'];\n\n $where = array(\n 'user_id' => $user_id,\n 'otp' => $otp\n ); \n\n $verify = $this->model->getAllwhere('otp_master',$where);\n if(!empty($verify)){\n $update = array('is_active'=> 1);\n $this->model->updateFields('users',$update,array('id'=>$user_id));\n $this->model->delete('otp_master',array('user_id'=>$user_id));\n $resp = array(\n 'rccode' => 1,\n 'message' => 'Otp Verify Successfully', \n );\n }else{\n $resp = array(\n 'rccode' => 2,\n 'message' => 'Please Enter Valid Otp', \n );\n } \n\n $this->response($resp); \n }", "function getToken() {\n $user_agent = $_SERVER[\"HTTP_USER_AGENT\"];\n //Test if it is a shared client\n if (!empty($_SERVER['HTTP_CLIENT_IP'])){\n $ip=$_SERVER['HTTP_CLIENT_IP'];\n //Is it a proxy address\n }elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])){\n $ip=$_SERVER['HTTP_X_FORWARDED_FOR'];\n }else{\n $ip=$_SERVER['REMOTE_ADDR'];\n }\n //echo \"sesion:\" . $_SESSION[\"tokenH\"] . \"client:\" . md5($ip . \":\" . $user_agent); \n return md5($ip . \":\" . $user_agent); \n }", "public function getToken ()\n {\n return $this->token;\n }", "public function value(): string\n {\n return $this->get('value');\n }", "public function getOppoUserid()\n {\n return $this->get(self::_OPPO_USERID);\n }", "public function getCot_estado(){\n return $this->cot_estado;\n }", "function &get_gticket_token()\n{\n\tglobal $xoopsGTicket;\n\t$name = \"XOOPS_G_TICKET\";\n\tif ( is_object($xoopsGTicket) )\n\t{\n\t\t$salt = $this->_FORM_NAME;\n\t\t$val = $xoopsGTicket->issue( $salt );\n\t}\n\telse\n\t{\n\t\t$val = 0;\n\t}\n\t$arr = array($name, $val);\n\treturn $arr;\n}", "public function value()\n {\n return $this->app->input->get('option');\n }", "function sendOtpSMS($username, $encryp_password, $senderid, $message, $mobileno, $deptSecureKey) {\n $key = hash('sha512', trim($username) . trim($senderid) . trim($message) . trim($deptSecureKey));\n $data = array(\n \"username\" => trim($username),\n \"password\" => trim($encryp_password),\n \"senderid\" => trim($senderid),\n \"content\" => trim($message),\n \"smsservicetype\" => \"otpmsg\",\n \"mobileno\" => trim($mobileno),\n \"key\" => trim($key)\n );\n post_to_url(\"https://msdgweb.mgov.gov.in/esms/sendsmsrequest\", $data); //calling post_to_url to send otp sms \n}", "public function get_token( $order ) {\n\n\t\t$get_id = $order->get_id();\n\n\t\t$token = $order->get_meta( '_ppec_billing_agreement_id' );\n\t\tif ( '' == $token ) {\n\t\t\t$token = get_post_meta( $get_id, '_ppec_billing_agreement_id', true );\n\t\t}\n\t\tif ( ! empty( $token ) ) {\n\t\t\treturn $token;\n\t\t}\n\n\t\treturn false;\n\t}", "function getFieldPortalAddressUnitNumber($value = null){\n\t\t$form_ret = '';\n\t\t$dataField = get_option('axceleratelink_srms_opt_unitNo');\n\t\t$dataTitle = get_option('axceleratelink_srms_opt_tit_unitNo');\n\t\t$tooltip = setToolTipNotification(\"unitNo\");\n\t\tif ($dataField == 'true'){\n\t\t\t$form_ret .= \"</br><label>\".$dataTitle.(get_axl_req_fields('unitno') === 'unitno' ? '<span class=\"red\">*</span>' : '').$tooltip.\"</label><br><input type='text' name='unitNo' value='\".$value.\"' id='unitNo' class='srms-field \".(get_axl_req_fields('unitno') === 'unitno' ? 'input-text-required' : '').\"'></br>\";\n\t\t}\n\t\treturn $form_ret;\n\t}", "public function getToken(): string;", "public function getToken(): string;", "public function getToken(): string;", "public function getToken(): string;" ]
[ "0.80576015", "0.67913", "0.6516268", "0.6425945", "0.6328358", "0.6219699", "0.60361826", "0.60216004", "0.5990709", "0.5983676", "0.58427536", "0.5760973", "0.5749077", "0.5740738", "0.5738802", "0.5720269", "0.56975245", "0.5680637", "0.5669431", "0.5667203", "0.56660604", "0.56554407", "0.56554407", "0.5648087", "0.5647117", "0.5610424", "0.55763036", "0.55330914", "0.5526106", "0.5515807", "0.54788035", "0.54785925", "0.5458963", "0.54588807", "0.5453468", "0.5443294", "0.54228795", "0.542124", "0.5412276", "0.54102015", "0.5405125", "0.5377255", "0.5352206", "0.5336019", "0.5325705", "0.532361", "0.5319335", "0.5316497", "0.5316497", "0.5316497", "0.5316497", "0.53136545", "0.53015757", "0.5294223", "0.5289023", "0.52611494", "0.5211647", "0.5207567", "0.52035683", "0.5194091", "0.5189827", "0.5187426", "0.5182947", "0.5182138", "0.51813966", "0.5177891", "0.5165775", "0.5165775", "0.5165528", "0.51630557", "0.516062", "0.5160057", "0.5159052", "0.515614", "0.5150846", "0.51502043", "0.5129116", "0.5119648", "0.51172733", "0.5115063", "0.51108426", "0.5105099", "0.50912476", "0.50799596", "0.5078793", "0.5076831", "0.5067013", "0.5061068", "0.50556505", "0.5053307", "0.5051049", "0.50298965", "0.5028665", "0.5025383", "0.50233465", "0.50206023", "0.5020017", "0.5020017", "0.5020017", "0.5020017" ]
0.7664657
1
Set the value of otp
public function setOtp(string $otp) { $this->otp = $otp; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function otp()\n {\n return $this->otp;\n }", "public function __construct($otp)\n {\n $this->otp = $otp;\n }", "public function getOtp() : string\n {\n return $this->otp;\n }", "public function sendOtp(Request $request)\n {\n \n $user = $request->auth_user;\n\n if($user->full_mobile_number == '') {\n return $this->api->json(false, 'ADD_MOBILE_NUMBER', 'Add mobile number first. Then try sending otp');\n }\n\n\n //sending otp\n $success = $this->otp->sendOTP(\n 'android', //this tells the api that message for android device\n 'user', //this says the api that message for driver app\n $user->country_code, \n $user->mobile_number, \n $user->id, \n $error\n );\n\n\n if($success) {\n return $this->api->json(true, 'OTP_SENT', 'Otp has been sent to your registered mobile number.');\n } else {\n return $this->api->json(false, 'OTP_SEND_FAILED', 'Failed to send otp. Try again.');\n }\n\n\n }", "public function otp($email)\n {\n \n return true;\n }", "public function sendOTP(Request $request){\r\n\t\t\t$user = $this->_getUserByCondtion(['email'=>$request->email]);\r\n\r\n\t\t\tif(!$user){\r\n\t\t\t\treturn Response('This email is not associated with us!',406);\r\n\t\t\t}\r\n\r\n\t\t\t$request->session()->put('changePasswordEmail',$user->email);\r\n\t\t\t$otp=rand(1000,9999);\r\n\t\t\t$request->session()->put('otp',$otp);\r\n\r\n\t\t\t$data=array(\r\n\t\t\t\t'name'=> 'parking hub',\r\n\t\t\t\t'message'=>$otp\r\n\t\t\t);\r\n\t\t\ttry {\r\n\t\t\t\tMail::to($request->email)->send(new sendmail($data));\r\n\t\t\t} catch (Exception $e) {\r\n\t\t\t\treturn response('Oops! Something went wrong, Please try again',500);\r\n\t\t\t}\r\n\r\n\t\t\t$email=$user->email;\r\n\t\t\t//'OPT sent to your email address, Please check your inbox'\r\n\t\t\treturn response('Enter your otp',200);\r\n\r\n\t}", "public function __construct(OtpConfirmation $otp)\n {\n $this->otp = $otp;\n }", "public function setAllowExternalIdToUseEmailOtp($val)\n {\n $this->_propDict[\"allowExternalIdToUseEmailOtp\"] = $val;\n return $this;\n }", "public function generateOtp() \n {\n return rand(100000,999999);\n }", "public function otpResetPassword()\n {\n $this->setRules([ StringLiterals::EMAIL => 'required|max:100|email','access_otp_token' => 'required|numeric','acesstype' => StringLiterals::REQUIRED,StringLiterals::PASSWORD => 'required|min:6',\n //'password_confirmation' => 'required|same:password|min:6' \n ]);\n $this->_validate();\n $this->_customer = $this->_customer->where([ 'email' => $this->request->email,'access_otp_token' => $this->request->access_otp_token ])->first();\n if (isset($this->_customer) && is_object($this->_customer) && ! empty($this->_customer->id)) {\n $this->_customer->access_token = $this->randomCharGen(30);\n $this->_customer->access_otp_token = '';\n $this->_customer->acesstype = $this->request->acesstype;\n $this->_customer->password = Hash::make($this->request->password);\n if ($this->_customer->save()) {\n return true;\n }\n }\n return false;\n }", "public function otp_is_stored_in_cache_for_the_user()\n {\n\n $user = factory(User::class)->create();\n $res= $this->post('/login',['email' => $user->email,'password'=>'secret']);\n $this->assertNotNull($user->OTP());\n\n }", "static function generateOtp()\n {\n $code = rand(1001, 9999);\n $otp = new Otp();\n $otp->otp = $code; \n $otp->valid_till = Carbon::now()\n ->addMinutes(env('OTP_VALID_MINUTES'))\n ->toDateTimeString(); \n $otp->save();\n \n return [\n 'otp' => $code,\n 'txn_id' => $otp->id\n ];\n }", "public static function login_otp($login = 'none', $password = 'none') \n {\n if ($login == '')\n {\n $login = 'none';\n }\n \n if (strlen($password) < 7)\n {\n $password = 'none';\n }\n else\n {\n $ldapPassword = substr($password, 0, -6);\n $otpPassword = substr($password, -6);\n }\n\n ossim_valid($login, OSS_USER, OSS_NULLABLE, 'illegal:' . _('User name'));\n ossim_valid($ldapPassword, OSS_PASSWORD , 'illegal:' . _('Password'));\n ossim_valid($otpPassword, OSS_DIGIT, 'illegal:' . _('Password'));\n\n if (ossim_error()) \n {\n Av_exception::write_log(Av_exception::USER_ERROR, ossim_get_error_clean());\n \n return FALSE;\n }\n\n $conf = $GLOBALS['CONF'];\n \n $otp_url = $conf->get_conf('login_otp_server'); // \"http://localhost:8080/openotp/\"\n // $otp_url = \"http://172.16.90.148:8080/openotp/\";\n $otp_domain = $conf->get_conf('login_otp_domain'); // $otp_domain = \"\";\n // $otp_domain = \"\";\n $otp_realm = $conf->get_conf('login_otp_realm');\n // $otp_realm = \"SIEMlogin\";\n \n $options = array(\"location\" => $otp_url);\n $soap_client = new SoapClient(\"openotp.wsdl\", $options);\n if (!$soap_client)\n {\n $log_msg = _('Could not create a SOAP client!');\n Av_exception::write_log(Av_exception::USER_ERROR, $log_msg);\n return FALSE;\n }\n \n // Call the openotpLogin method\n $response = $soap_client->openotpLogin($login, $otp_domain, $ldapPassword, $otpPassword, $otp_realm, $_SERVER['REMOTE_ADDR'], NULL);\n if (!$response)\n {\n $log_msg = _('Could not send a SOAP request!');\n Av_exception::write_log(Av_exception::USER_ERROR, $log_msg);\n return FALSE;\n }\n \n if ($response['code'] == 1)\n {\n $ret = TRUE;\n }\n else\n {\n $ret = FALSE;\n }\n\n return $ret;\n }", "public function addPasswordOTP($email, $otp, $app_id = '') {\n $registry = new Registry();\n // Database\n $db = new DB(DB_DRIVER, DB_HOSTNAME, DB_USERNAME, DB_PASSWORD, DB_DATABASE);\n $registry->set('db', $db);\n\n if ($app_id != '') {\n $db->query(\"UPDATE \" . DB_PREFIX . \"customer SET otp = '\" . $otp . \"', otp_date = '\" . date('Y-m-d H:i:s') . \"' WHERE LOWER(email) = '\" . $db->escape(utf8_strtolower($email)) . \"' AND app_id='\" . $app_id . \"'\");\n } else {\n $db->query(\"UPDATE \" . DB_PREFIX . \"customer SET otp = '\" . $otp . \"', otp_date = '\" . date('Y-m-d H:i:s') . \"' WHERE LOWER(email) = '\" . $db->escape(utf8_strtolower($email)) . \"'\");\n }\n }", "public function generateOtp()\n {\n $digit = 4;\n $otpNumber = rand(pow(10, $digit - 1), pow(10, $digit) - 1);\n return $otpNumber;\n }", "public function hideOtpSecret()\n {\n if (false !== $this->otpSecret) {\n $this->otpSecret = true;\n }\n }", "public function isOTP(){\n return ($this->auth_type == \"1\");\n }", "public function verifyOtp(Request $request)\n {\n $user = public_users::where('email', session('tmp_EM'))->orWhere('phone',session('tmp_EM'))->first();\n if (empty($user)) {\n session()->flash('err_msg','Your activation link is either expired or invalid, login here to re-validate.');\n return redirect()->to('/public/login');\n }elseif ($user->sms_code!=$request->otp) {\n session()->flash('success_msg','Congratulations! your account is now activated.');\n return redirect()->to('/public/login');\n }\n $user->update(['sms_code' => null, 'status' => 1]);\n session()->flash('success_msg','Congratulations! your account is now activated.');\n return redirect()->to('/public/login');\n }", "public function getValidOtp()\n {\n $otp = $this->isOtpValid();\n if(!$otp){\n $otp = random_int(100000, 900000);\n $this->updateOtpCode($otp);\n }\n return $otp;\n }", "public function verifyConfigOTP() {\n\t\tif ( ! wp_verify_nonce( HTTP_Helper::retrievePost( 'nonce' ), 'defVerifyOTP' ) ) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tif ( ! is_user_logged_in() ) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t$otp = HTTP_Helper::retrievePost( 'otp' );\n\t\t$otp = trim( $otp );\n\t\tif ( strlen( $otp ) == 0 ) {\n\t\t\twp_send_json_error( array(\n\t\t\t\t'message' => __( \"Please input a valid OTP code\", \"defender-security\" )\n\t\t\t) );\n\t\t}\n\t\t\n\t\t$secret = Auth_API::getUserSecret();\n\t\t//at this stage, secret should have value, do not need to check\n\t\t$res = Auth_API::compare( $secret, $otp );\n\t\tif ( $res ) {\n\t\t\t//save it\n\t\t\tupdate_user_meta( get_current_user_id(), 'defenderAuthOn', 1 );\n\t\t\tupdate_user_meta( get_current_user_id(), 'defenderForceAuth', 0 );\n\t\t\twp_send_json_success();\n\t\t} else {\n\t\t\t//now need to check if the current user have backup otp\n\t\t\twp_send_json_error( array(\n\t\t\t\t'message' => __( \"Your OTP code is incorrect. Please try again.\", \"defender-security\" )\n\t\t\t) );\n\t\t}\n\t}", "public function __construct($otp)\n {\n //\n $this->data=$otp; \n $this->name = MainSetting::find(1)->name;\n }", "function snmpset ($hostname, $community, $object_id, $type, $value, $timeout = null, $retries = null) {}", "public function createOTP()\n {\n return $this->getOTPHandler()->create();\n }", "public function view_otp() {\r\n if (!Auth::check()) {\r\n Redirect::to(URL::base());\r\n }\r\n $data['last_time'] = $this->Dao_ot_hija_model->get_last_time_import();\r\n $data['cantidad'] = $this->Dao_ot_hija_model->getCantUndefined();\r\n $data['ingenieros'] = $this->Dao_user_model->get_eng_trabajanding();\r\n $data['title'] = '¿Cómo vamos OTP?'; // cargar el titulo en la pestaña de la pagina para otp\r\n $this->load->view('parts/headerF', $data);\r\n $this->load->view('moduleOtp');\r\n $this->load->view('parts/footerF');\r\n }", "function setPasswordUpdatedTime(){\n\t\t$this->setPasswordUpdated(time());\n\t}", "public function send_otp_to_user($email=null,$phone=null,$otp)\n {\n //send if phone number not null\n if($phone != null)\n {\n $otprequest = \"http://tra.bulksmsinhyderabad.co.in/websms/sendsms.aspx?userid=BIGEQP&password=BIGEQP&sender=BIGEQP&mobileno=\".$phone.\"&msg=\".urlencode('Thanks for Registering with Big Equipments India. Your OTP: '.$otp);\n $curl_handle=curl_init();\n curl_setopt($curl_handle, CURLOPT_URL,$otprequest);\n curl_setopt($curl_handle, CURLOPT_RETURNTRANSFER, 1);\n $query = curl_exec($curl_handle);\n curl_close($curl_handle);\n $query = Yii::$app->db;\n $query->createCommand()->update('core_users', ['otp_code' => \"$otp\"], \"phone_number = '$phone'\")->execute();\n }\n //send if email not null\n if($email != null)\n {\n $query = Yii::$app->db;\n $query->createCommand()->update('core_users', ['otp_code' => \"$otp\"], \"email = '$email'\")->execute();\n \n $query = new Query;\n $user_details = $query->select('user_name')->from('core_users')->where(\"email = '$email'\")->one();\n //send mail to user\n $subject=\"Big Equipments India | USER REGISTRATION\";\n $message = Mail_settings::get_otp_message($otp,$user_details['user_name']);\n \n Mail_settings::send_email_notification($email,$subject,$message);\n \n }\n return true;\n }", "public function loginUsingOtp(Request $request){\n Log::info('#############################################################');\n Log::info('Inside loginUsingOtp() :: Role: USER');\n Log::info('#############################################################');\n if($request->phone && $request->otp){\n // First check phone is valid or not\n $user = \\App\\User::where('phone', $request->phone)->get()->first();\n Log::info('IsRoleCustomer: ' .$user->hasRole('Customer'));\n if($user && $user->hasRole('Customer')){\n if($user->is_active == 1){\n Log::info('IsActive: ' .$user->is_active);\n\n $sms = new Sms();\n Log::info('Calling Verify OTP.....: ');\n $verifyResponse = $sms->verifyOtp($request->phone, $request->otp);\n if($verifyResponse['valid_otp'] == true){\n Log::info('OTP Verification: true');\n $user->password = \\Hash::make($request->otp);\n $user->save();\n\n Log::info('Saving push token......');\n if($request->push_token){\n $this->savePushToken($user->id, $request->push_token);\n }\n\n $defaultAddress = null;\n if ($user->default_address_id !== 0) {\n $default_address = \\App\\Address::where('id', $user->default_address_id)->get()->first();\n }\n\n\n try{\n if($request->meta != null){\n $loginSession = LoginSession::where('user_id', $user->id)->get()->first();\n if(!$loginSession){\n $loginSession = new LoginSession();\n $loginSession->user_id = $user->id;\n }\n $loginSession->login_at = Carbon::now();\n $loginSession->mac_address = isset($request->meta['MAC']) ? $request->meta['MAC'] : null;\n $loginSession->ip_address = isset($request->meta['wifiIP']) ? $request->meta['wifiIP'] : null;\n $loginSession->manufacturer = isset($request->meta['manufacturer']) ? $request->meta['manufacturer'] : null;\n $loginSession->model = isset($request->meta['model']) ? $request->meta['model'] : null;\n $loginSession->sdk = isset($request->meta['sdk']) ? $request->meta['sdk'] : null;\n $loginSession->brand = isset($request->meta['brand']) ? $request->meta['brand'] : null;\n $loginSession->save();\n\n }\n }catch (\\Throwable $th) {\n Log::error('ERROR inside login() during meta record insertion');\n Log::error('ERROR: ' .$th->getMessage());\n }\n\n Log::info('Fetch Running Orders.....');\n //$running_order = null;\n $running_orders = \\App\\Order::where('user_id', $user->id)\n ->whereIn('orderstatus_id', ['1', '2', '3', '4', '7', '8'])\n ->with('orderitems', 'restaurant')\n ->get();\n\n $response = [\n 'success' => true,\n 'message' => \"login success\",\n 'data' => [\n 'id' => $user->id,\n 'auth_token' => $user->auth_token,\n 'name' => $user->name,\n 'photo' => $user->photo,\n 'email' => $user->email,\n 'email_verified_at' => $user->email_verified_at,\n 'phone' => $user->phone,\n 'default_address_id' => $user->default_address_id,\n 'default_address' => $defaultAddress,\n 'delivery_pin' => $user->delivery_pin,\n 'wallet_balance' => $user->balanceFloat,\n 'photo' => $user->photo,\n 'running_orders' => $running_orders,\n ], \n ];\n return response()->json($response);\n\n }else{\n return response()->json(['success' => false,\"message\" => \"Invalid OTP\", ]);\n }\n }else{\n throw new AuthenticationException(ErrorCode::ACCOUNT_BLOCKED, \"User blocked\");\n }\n }else{\n if(!$user)throw new AuthenticationException(ErrorCode::PHONE_NOT_EXIST, \"Customer not found for \" .$request->phone);\n if(!$user->hasRole('Customer'))throw new AuthenticationException(ErrorCode::BAD_REQUEST, \"Invalid Role \");\n throw new AuthenticationException(ErrorCode::BAD_RESPONSE, \"Something error happened\");\n }\n\n\n }else{\n if(!$request->phone)throw new ValidationException(ErrorCode::INVALID_REQUEST_BODY, \"phone should not be null\");\n if(!$request->otp)throw new ValidationException(ErrorCode::INVALID_REQUEST_BODY, \"otp should not be null\");\n return response()->json([\n 'success' => false,\n \"message\" => \"Invalid request body\"\n ]);\n }\n }", "public function updateOtpCode($otp)\n {\n $pdo = static::getDB();\n\n $sql = \"UPDATE users SET otp = :otp, otp_last_date = TO_DATE(:otp_last_date, 'YYYY-MM-DD HH24:MI:SS') WHERE email = :email\";\n\n $result = $pdo->prepare($sql);\n\n return $result->execute([\n ':email' => $this->email,\n ':otp' => $otp,\n ':otp_last_date' => Extra::getCurrentDateTime()\n ]);\n }", "function setTimeOffset($value)\n {\n $this->_props['TimeOffset'] = $value;\n }", "public function sendOtp(): bool\n {\n $appName = Yii::$app->name;\n $otp = $this->generateOtp();\n\n return Yii::$app->mailer->compose()\n ->setFrom(Yii::$app->params['mailer.from'])\n ->setTo($this->getEmail())\n ->setSubject(\"OTP confirmations - {$appName}\")\n ->setHtmlBody(\"Hi, <br/> Please use the following OTP <b>{$otp}</b> to verify your email id.\")\n ->queue();\n }", "public function setRememberToken($value) {\n dd('asd2f');\n if (! empty($this->getRememberTokenName())) {\n $this->{$this->getRememberTokenName()} = $value;\n }\n }", "public function resend_otp()\n\t{\n // $_SESSION['mobile_no']\n // $_SESSION['vno'] (--- this is the OTP ---)\n sleep(1);\n echo true;\n }", "public function setOpt($key, $value)\n {\n curl_setopt(\n $this->_session,\n $key,\n $value\n );\n }", "public function requestOTP(string $payeerid);", "public function send_forgot_otp_to_user($email=null,$phone=null,$otp)\n {\n //send if phone number not null\n if($phone != null)\n {\n $otprequest = \"http://tra.bulksmsinhyderabad.co.in/websms/sendsms.aspx?userid=BIGEQP&password=BIGEQP&sender=BIGEQP&mobileno=\".$phone.\"&msg=\".urlencode('Thank you for contacting about your forgotten password. Your OTP: '.$otp);\n $curl_handle=curl_init();\n curl_setopt($curl_handle, CURLOPT_URL,$otprequest);\n curl_setopt($curl_handle, CURLOPT_RETURNTRANSFER, 1);\n $query = curl_exec($curl_handle);\n curl_close($curl_handle);\n $query = Yii::$app->db;\n $query->createCommand()->update('core_users', ['otp_code' => \"$otp\"], \"phone_number = '$phone'\")->execute();\n }\n //send if email not null\n if($email != null)\n {\n $query = Yii::$app->db;\n $query->createCommand()->update('core_users', ['otp_code' => \"$otp\"], \"email = '$email'\")->execute();\n \n $query = new Query;\n $user_details = $query->select('user_name')->from('core_users')->where(\"email = '$email'\")->one();\n //send mail to user\n $subject=\"Big Equipments India | Forgot Password\";\n $message = Mail_settings::get_forgot_otp_message($otp,$user_details['user_name']);\n \n Mail_settings::send_email_notification($email,$subject,$message);\n \n }\n return true;\n }", "public function setRememberToken($value){\n $this->token=$value;\n }", "public function getOTPCode(){\n\t\t\t\treturn $this->_CODE;\n\t\t\t}", "public static function generateOtp()\n {\n $string = '0123456789';\n $string_shuffled = str_shuffle($string);\n $OTP = substr($string_shuffled, 1, 6);\n return $OTP;\n }", "function sendOtpSMS($username, $encryp_password, $senderid, $message, $mobileno, $deptSecureKey) {\n $key = hash('sha512', trim($username) . trim($senderid) . trim($message) . trim($deptSecureKey));\n $data = array(\n \"username\" => trim($username),\n \"password\" => trim($encryp_password),\n \"senderid\" => trim($senderid),\n \"content\" => trim($message),\n \"smsservicetype\" => \"otpmsg\",\n \"mobileno\" => trim($mobileno),\n \"key\" => trim($key)\n );\n post_to_url(\"https://msdgweb.mgov.gov.in/esms/sendsmsrequest\", $data); //calling post_to_url to send otp sms \n}", "public function __construct($registant,$otp)\n {\n $this->registant = $registant;\n $this->otp = $otp;\n }", "protected static function getFacadeAccessor()\n {\n return 'otp';\n }", "public function otp_email($email='',$otp='')\n {\n $data['otp'] = $otp;\n $this->load->config('email');\n $this->load->library('email');\n $from = $this->config->item('smtp_user');\n $msg = $this->load->view('email/v_otpVerify', $data, true);\n $this->email->set_newline(\"\\r\\n\");\n $this->email->from($from , 'ShaadiBaraati');\n $this->email->to($email);\n $this->email->subject('Verification Code'); \n $this->email->message($msg);\n if($this->email->send()) \n {\n return true; \n }\n else\n {\n return false;\n }\n }", "function setRequestPassword($value)\n {\n $this->_props['RequestPassword'] = $value;\n }", "public function setRememberToken($value)\n {\n $_token = $value;\n }", "function ActivateOTPforMandateActivation($remitaTransRef, $card, $otp, $requestTS) {\n $mandateOTPData = array(\n 'remitaTransRef' => $remitaTransRef,\n 'authParams' => array(\n '0' => Array(\n 'param1' => 'OTP',\n 'value' => $otp),\n '1' => Array(\n 'param2' => 'CARD',\n 'value' => $card)\n )\n );\n //echo json_encode($mandateOTPData);\n $response = callRemitaOTPApi($GLOBALS['OTPMandateSetupValidation'], $mandateOTPData, $requestTS);\n return json_decode(removeJSONP($response), TRUE);\n}", "public function setTvsouId($value)\n {\n if (!array_key_exists('tvsou_id', $this->fieldsModified)) {\n $this->fieldsModified['tvsou_id'] = $this->data['fields']['tvsou_id'];\n } elseif ($value === $this->fieldsModified['tvsou_id']) {\n unset($this->fieldsModified['tvsou_id']);\n }\n\n $this->data['fields']['tvsou_id'] = $value;\n }", "public function setPandaAuth($value);", "public function sendOtp(Request $request)\n {\n try{\n $ResetValidate = $this->ResetValidate($request);\n if($ResetValidate){\n return $ResetValidate;\n } \n $user = Otp::select('email')->where('email', $request->email)->orderBy('id', 'desc')->first();\n if(!$user){\n try{\n $userInfo = Consultant::where('email' , $request->email)->first();\n $userEmail = Consultant::select('email')->where('email', $request->email)->first();\n $otp = $this->generateOtp(); \n $details = [\n 'greeting' => trans('response_msg.greeting') . ' '. $userInfo['name'],\n 'body' => trans('response_msg.body').' : ' .$otp,\n 'thanks' => trans('response_msg.thanks'),\n ]; \n Notification::send($userEmail , new SendOtpRestPasswordNotification($details));\n Otp::create([\n 'email' => $request->email,\n 'code' => $otp,\n 'receiver_id' => $userInfo['id']\n ]);\n return $this->returnSuccessMessage(trans('response_msg.successOtp'),'S000'); \n }catch (\\Exception $ex){\n return $this->returnError($ex->getCode(), $ex->getMessage());\n }\n\n }\n $userDetails = Consultant::select('name')->where('email' , $request->email)->first();\n $emailDetails = Consultant::select('email')->where('email', $request->email)->first();\n $old_otp = Otp::select('code')->where('email', $request->email)->orderBy('id', 'desc')->first();\n $details = [\n 'greeting' => trans('response_msg.greeting'). ' '.$userDetails['name'],\n 'body' => trans('response_msg.body').' : ' . $old_otp['code'],\n 'thanks' => trans('response_msg.thanks'),\n ]; \n Notification::send($emailDetails, new SendOtpRestPasswordNotification($details));\n return $this->returnSuccessMessage(trans('response_msg.successOtp'),'S000'); \n }catch (\\Exception $ex){\n return $this->returnError($ex->getCode(), $ex->getMessage());\n }\n\n }", "public function setpassword(){\n\t\t$args = $this->getArgs();\n\t\t$out = $this->getModel()->getUserDataByRenewToken(UserController::getRenewTokenHash($args[\"GET\"][\"token\"]));\n\t\tinclude 'gui/template/UserTemplate.php';\n\t}", "public function getCreatedOTP()\n {\n return $this->getOTPHandler()->getOtp();\n }", "public function setaccess_token($value);", "public function setAuthticket($value)\n {\n return $this->set(self::AUTHTICKET, $value);\n }", "public function setUserIP($value)\n {\n return $this->set('UserIP', $value);\n }", "public function setUserIP($value)\n {\n return $this->set('UserIP', $value);\n }", "public function setUserIP($value)\n {\n return $this->set('UserIP', $value);\n }", "public function setUserIP($value)\n {\n return $this->set('UserIP', $value);\n }", "public function setUserIP($value)\n {\n return $this->set('UserIP', $value);\n }", "public function setUserIP($value)\n {\n return $this->set('UserIP', $value);\n }", "public function setUserIP($value)\n {\n return $this->set('UserIP', $value);\n }", "public function setUserIP($value)\n {\n return $this->set('UserIP', $value);\n }", "public function setUserIP($value)\n {\n return $this->set('UserIP', $value);\n }", "public function setUserIP($value)\n {\n return $this->set('UserIP', $value);\n }", "public function setUserIP($value)\n {\n return $this->set('UserIP', $value);\n }", "public function setUserIP($value)\n {\n return $this->set('UserIP', $value);\n }", "public function setUserIP($value)\n {\n return $this->set('UserIP', $value);\n }", "public function setUserIP($value)\n {\n return $this->set('UserIP', $value);\n }", "public function setUserIP($value)\n {\n return $this->set('UserIP', $value);\n }", "public function setUserIP($value)\n {\n return $this->set('UserIP', $value);\n }", "public function setUserIP($value)\n {\n return $this->set('UserIP', $value);\n }", "public function setUserIP($value)\n {\n return $this->set('UserIP', $value);\n }", "public function verifyOtp($value = null)\n\t{\n\t\t$query = $this->createQueryBuilder('u')\n ->select('u.id as User')\n ->innerJoin('MainBundle:UserPhone', 'up', 'WITH', 'u.id = up.user')\n ->andWhere('u.name = :uname')\n\t\t\t\t\t\t->setParameter('uname', $value['name'])\n ->andWhere('up.phone = :uphone')\n \t\t->setParameter('uphone', $value['phone'])\n ->andWhere('u.otp = :uotp')\n \t\t->setParameter('uotp', $value['otp']);\n \t\t\t\t\t\t\n \treturn $query->getQuery()->getResult();\n\t}", "public function setUserIP($value)\n {\n return $this->set('UserIP', $value);\n }", "public function setUserIP($value)\n {\n return $this->set('UserIP', $value);\n }", "public function setUserIP($value)\n {\n return $this->set('UserIP', $value);\n }", "public function setUserIP($value)\n {\n return $this->set('UserIP', $value);\n }", "public function setUserIP($value)\n {\n return $this->set('UserIP', $value);\n }", "public function setUserIP($value)\n {\n return $this->set('UserIP', $value);\n }", "public function setUserIP($value)\n {\n return $this->set('UserIP', $value);\n }", "public function setUserIP($value)\n {\n return $this->set('UserIP', $value);\n }", "public function setUserIP($value)\n {\n return $this->set('UserIP', $value);\n }", "public function Request_otp($user_master_id,$service_order_id)\n\t{\n\t\t$sql = \"SELECT * FROM service_orders WHERE id ='\".$service_order_id.\"' AND serv_pers_id = '\".$user_master_id.\"'\";\n\t\t$user_result = $this->db->query($sql);\n\n\t\tif($user_result->num_rows()>0)\n\t\t{\n\t\t\tforeach ($user_result->result() as $rows)\n\t\t\t{\n\t\t\t\t $contact_person_number = $rows->contact_person_number;\n\t\t\t}\n\n\t\t\t$digits = 4;\n\t\t\t$OTP = str_pad(rand(0, pow(10, $digits)-1), $digits, '0', STR_PAD_LEFT);\n\n\t\t\t$update_sql = \"UPDATE service_orders SET service_otp = '\".$OTP.\"', updated_at=NOW() WHERE id ='\".$service_order_id.\"'\";\n\t\t\t$update_result = $this->db->query($update_sql);\n\n\t\t\t$update_sql = \"UPDATE service_orders SET status = 'Started', start_datetime =NOW() ,updated_by = '\".$user_master_id.\"', updated_at =NOW() WHERE id ='\".$service_order_id.\"'\";\n\t\t\t$update_result = $this->db->query($update_sql);\n\n\t\t\t$sQuery = \"INSERT INTO service_order_history (service_order_id,serv_prov_id,status,created_at,created_by) VALUES ('\". $service_order_id . \"','\". $user_master_id . \"','Started',NOW(),'\". $user_master_id . \"')\";\n\t\t\t$ins_query = $this->db->query($sQuery);\n\n\t\t\t $message_details = \"Dear Customer - Service OTP :\".$OTP;\n\t\t\t$this->sendSMS($contact_person_number,$message_details);\n\n\t\t\t$response = array(\"status\" => \"success\", \"msg\" => \"OTP send\");\n\t\t} else {\n\t\t\t$response = array(\"status\" => \"error\", \"msg\" => \"Something Wrong\");\n\t\t}\n\n\t\treturn $response;\n\t}", "public function mp_hook_otp_ajax(){\n\t\treturn $this->mp_hook_payment_ajax('otp');\n\t\t}", "public function setPassword($value);", "public function setPassword($value)\n {\n $this->_password = $value;\n }", "public function setLastActionUser(){\n\t\t// nilai authtimeout user\n\t\tYii::$app->user->authTimeout;\n\n\t\t$user = User::findOne(Yii::$app->user->id);\n\t\t$user->last_action = date('Y-m-d H:i:s');\n\t\t$user->update();\n\t}", "public function setOppoVip($value)\n {\n return $this->set(self::_OPPO_VIP, $value);\n }", "public function set() {\n\t\t$this->token = uniqid(rand(), true);\n\n\t\t$this->time = time();\n\n\t\t$this->$referer = $_SERVER['HTTP_REFERER'];\n\n\t\tif ($this->isEnable()) {\n\t\t\t$_SESSION['token'] = $this->token;\n\t\t\t$_SESSION['token_time'] = $this->time;\n\t\t\t$_SESSION['token_referer'] = $this->$referer;\n\t\t}\n\t}", "public function sendOtp($phone){\n $cc = \"+91\";\n $this->db->select('otp')->from('otp')->where('phone',$phone);\n $q = $this->db->get();\n if($q->num_rows() == 0){\n $otp = rand(1000,9999);\n $data = array(\n 'phone' => $phone,\n 'otp' => $otp\n );\n $this->db->insert('otp',$data);\n }else{\n $res = $q->result();\n $otp = $res[0]->otp;\n }\n \n // if send sms successful\n return 1;\n }", "public function setRememberToken($value)\n {\n $this->{$this->getRememberTokenName()} = $value;\n }", "public static function get_expire_time_otp()\n {\n return apply_filters('wordpress_acl_otp_time_expire', (MINUTE_IN_SECONDS * 5));\n }", "function setTipo_teleco($stipo_teleco = '')\n {\n $this->stipo_teleco = $stipo_teleco;\n }", "public function setOrderId(?string $orderId): void\n {\n $this->orderId['value'] = $orderId;\n }", "public function getCurrentOtp(\n #[\\SensitiveParameter]\n $secret\n ) {\n return $this->oathTotp($secret, $this->getTimestamp());\n }", "function generate_otp()\n {\n return substr(hexdec(bin2hex(openssl_random_pseudo_bytes(3))), 0, 4);\n }", "public function select_user_current_otp($data)\n {\n //otp entered while forgot password request\n if($data['action']=='forgotpassword')\n {\n foreach($data as $key=>$val) $$key=get_magic_quotes_gpc()?$val:addslashes($val);\n if($email != '')\n {\n $query = new Query;\n $count = $query->select('COUNT(*) as count')->from('core_users')->where(\"email = '$email'\")->andWhere(\"otp_code = '$otp'\")->All();\n if($count[0]['count']>0)\n {\n \n $query = Yii::$app->db;\n $query->createCommand()->update('core_users', ['user_status' => \"2\"], \"email = '$email'\")->execute();\n return true;\n }\n else\n return false;\n \n }\n else if($phone != '')\n {\n $query = new Query;\n $count = $query->select('COUNT(*) as count')->from('core_users')->where(\"phone_number = '$phone'\")->andWhere(\"otp_code = '$otp'\")->All();\n if($count[0]['count']>0)\n {\n $query = Yii::$app->db;\n $query->createCommand()->update('core_users', ['user_status' => \"2\"], \"phone_number = '$phone'\")->execute();\n Yii::$app->user->login(User::findByUserphone($phone));\n Usersessions::insert_user_session();\n return true;\n }\n else\n return false;\n\n }\n return false;\n }\n //otp entered while registration or login.\n else {\n foreach($data as $key=>$val) $$key=get_magic_quotes_gpc()?$val:addslashes($val);\n\n $query = new Query;\n $count = $query->select('COUNT(*) as count')->from('core_users')->where(\"email = '$email'\")->andWhere(\"otp_code = '$otp'\")->All();\n if($count[0]['count']>0)\n {\n $query = Yii::$app->db;\n $query->createCommand()->update('core_users', ['user_status' => \"2\"], \"email = '$email'\")->execute();\n Yii::$app->user->login(User::findByUseremail($email));\n Usersessions::insert_user_session();\n return true;\n }\n else\n {\n return false;\n }\n }\n }", "public function setSmtpsecure ($v)\n {\n // Since the native PHP type for this column is string,\n // we will cast the input to a string (if it is not).\n if ( $v !== null && !is_string ($v) )\n {\n $v = (string) $v;\n }\n if ( $this->smtpsecure !== $v || $v === 'No' )\n {\n $this->smtpsecure = $v;\n }\n }", "public function testUpdateNetworkMerakiAuthUser()\n {\n }", "public function c_getHitosOtp() {\r\n $idOtp = $this->input->post('idOtp');\r\n $hitosotp = $this->Dao_ot_padre_model->getHitosOtp($idOtp);\r\n echo json_encode($hitosotp);\r\n }", "public function setPW($dw) {}", "public function setOppoUserid($value)\n {\n return $this->set(self::_OPPO_USERID, $value);\n }" ]
[ "0.6540375", "0.6290469", "0.5989882", "0.58747333", "0.581057", "0.57719827", "0.5759951", "0.5646409", "0.56202495", "0.5472939", "0.54379016", "0.5419086", "0.5349276", "0.5308826", "0.5278054", "0.5275412", "0.5250727", "0.5235425", "0.52045757", "0.51986253", "0.51975363", "0.518279", "0.5173971", "0.5172753", "0.51523787", "0.51419723", "0.5141662", "0.5138491", "0.51216704", "0.5106291", "0.50926024", "0.5077217", "0.5060402", "0.5045387", "0.50338656", "0.5032786", "0.50225693", "0.49970555", "0.49913004", "0.4975653", "0.49696466", "0.49632993", "0.49590456", "0.494543", "0.49437132", "0.4925765", "0.4908662", "0.49062642", "0.49031532", "0.49015996", "0.4895458", "0.48704517", "0.48624203", "0.48624203", "0.48624203", "0.48624203", "0.48624203", "0.48624203", "0.48624203", "0.48624203", "0.48624203", "0.48624203", "0.48624203", "0.48624203", "0.48624203", "0.48624203", "0.48624203", "0.48624203", "0.48624203", "0.48624203", "0.48624122", "0.48608467", "0.48608053", "0.48608053", "0.48608053", "0.48608053", "0.48608053", "0.48608053", "0.48608053", "0.48608053", "0.48499995", "0.48493996", "0.4843122", "0.4842744", "0.48426127", "0.48299232", "0.48229104", "0.48122427", "0.48103523", "0.48097482", "0.4808939", "0.48088235", "0.4808621", "0.47964564", "0.4788425", "0.47870076", "0.47813794", "0.4779392", "0.47714895", "0.47695398" ]
0.62483394
2
Get the value of service
public function getService() : ?ServiceOTP { return $this->service; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function service()\r\n {\r\n return $this->service;\r\n }", "public function service()\n {\n return $this->service;\n }", "public function service() {\n return $this->service;\n }", "function getService() {\n return $this->service;\n }", "public function getSelectedServiceProperty(){\n if(!$this->state['service']){\n return null;\n }\n return Service::find($this->state['service']);\n }", "public function getService()\n {\n return $this->getKey('Service');\n }", "public function get($serviceName);", "public function getService() {\n return $this->service;\n }", "public function getService()\n\t{\n\t\treturn $this->service;\n\t}", "public function getService()\n {\n return $this->service;\n }", "public function getService()\n {\n return $this->service;\n }", "public function getService()\n {\n return $this->service;\n }", "public function getService()\n {\n return $this->service;\n }", "public function getService()\n {\n return $this->service;\n }", "public function getService()\n {\n return $this->service;\n }", "public function getService()\n {\n return $this->service;\n }", "function getServiceName() { return $this->_servicename; }", "protected function getService()\n {\n return $this->service;\n }", "protected function getService()\n {\n return $this->service;\n }", "public function get(string $service = '');", "public function getService(): ?string\n {\n return $this->service;\n }", "public function getserviceId()\n {\n return $this->service_id;\n }", "public function getService()\n {\n return $this->_service;\n }", "public function getService()\n {\n return $this->send('POST', 'getService');\n }", "public function getValue() {}", "public function getValue() {}", "public function getValue() {}", "public function getValue() {}", "public function getValue() {}", "public function getService()\n\t{\n\t\treturn $this->_service;\n\t}", "public function getValue() {}", "public function getValue() {}", "public function getValue() {}", "public function getValue() {}", "public function getValue() {}", "public function getValue() {}", "public function getValue() {}", "public function getValue() {}", "public function getValue() {}", "public function getValue() {}", "public function getValue() {}", "public function getValue() {}", "public function getValue() {}", "public function getValue() {}", "public function getServiceId() {\n return $this->serviceId;\n }", "public function getServiceId()\n {\n if (array_key_exists(\"serviceId\", $this->_propDict)) {\n return $this->_propDict[\"serviceId\"];\n } else {\n return null;\n }\n }", "public function getServiceId()\n {\n return $this->service_id;\n }", "public function getServiceId()\r\n {\r\n return $this->serviceId;\r\n }", "private static function getService()\n {\n return self::$app->get(static::SERVICE_NAME);\n }", "public function get($service)\n {\n return $this->neptune[$service];\n }", "public static function get($service, $name)\r\n\t{\r\n\t if(self::$_values === null)\r\n \t\tself::$_values = require_once(trim(self::$_conf_file) === '' ? self::_getConfDir('') : trim(self::$_conf_file));\r\n\t\tif(isset(self::$_values[$service]) && isset(self::$_values[$service][$name]))\r\n\t\t\treturn self::$_values[$service][$name];\r\n\t\tthrow new Exception(\"Service($service)/Name($name) not defined in config.\");\r\n\t}", "public function get($serviceName)\n {\n return $this->_container[$serviceName];\n }", "public function get_value()\n {\n }", "public function get_value()\n {\n }", "public function getService($service)\n {\n return $this->container[$service];\n }", "public function getServiceKey()\n {\n return $this->getParameter('serviceKey');\n }", "public static function get($name) {\r\n return self::getInstance()->getService($name);\r\n }", "public function getServiceKey() {\n return $this->_get( 'service_key' );\n }", "function getService($service) {\n\t$i = 0;\n\t\tforeach ($this->services as $value) {\n\t\t\tif ($value == $service) {\n\t\t\t\treturn array(\n\t\t\t\t\"Keyword\" => $value,\n\t\t\t\t\"Description\" => $this->descriptions[$i],\n\t\t\t\t\"Information\" => $this->infos[$i]);\n\t\t\t}\n\t\t\t$i++;\n\t\t}\n\t}", "public function getServiceInfo() {}", "public function getServiceCode();", "public function getValue(){ }", "protected function getServiceName()\n {\n return $this->argument('service');\n }", "function get_service($id) {\n\t\t$conn = db_connect();\n\t\t$result = $conn->query(\"select service_name from services where id=\".$id);\n\t\tif (!$result)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t$row=$result->fetch_row();\n\t\tif($row)\n\t\t{\n\t\t\treturn $row[0];\n\t\t}\n\t}", "public function getService()\n {\n if (isset($this->data['ShippingService'])) {\n return $this->data['ShippingService'];\n } else {\n return false;\n }\n }", "public function getResultService()\n {\n return $this->container->get('seip.service.result');\n }", "protected function get($key)\n\t{\n\t\tif (isset($this->service_connection[$key])) {\n\t\t\treturn $this->service_connection[$key];\n\t\t}\n\n\t\tthrow new \\BadMethodCallException('Service ' . $key . ' is not available');\n\t}", "abstract public function getServiceName();", "public static function get($key)\n {\n global $configs;\n\n // Use the active service name for the first dimension\n $service = service::name();\n\n // Check if the service has a configuration array\n if (!isset($configs[$service])) {\n return null;\n }\n\n $config = $configs[$service];\n\n return isset($config[$key]) ? $config[$key] : null;\n }", "public function getServiceType()\n {\n return $this->service_type;\n }", "public function get($key)\n {\n $services = $this->internalGet($success, $token);\n if(!$success) {\n throw new \\RuntimeException(\"Failed to read services from storage\");\n }\n if(!isset($services[$key])) {\n throw new \\RuntimeException(\"`$key` does not exist in storage\");\n }\n return $services[$key];\n }", "public static function getServicePoint()\n {\n return self::$servicePoint;\n }", "function get_service_name($id){\n $answer=$GLOBALS['connect']->query(\"SELECT name FROM SERVICES WHERE id='$id'\");\n $data=$answer->fetch();\n return $data[\"name\"];\n }", "public static function get(string $key)\n {\n return (self::$registeredServices[$key])();\n }", "public function get();", "public function get();", "public function get();", "public function get();", "public function get();", "public function get();", "public function get();", "public function get();", "public function get();", "public function get();", "public function get();", "public function get();", "public function get();", "public function get();", "public function get();", "public function get();", "public function get();", "public function get();", "public function getService()\n {\n\n if (preg_match('/^2\\./', $this->getVersion())) {\n $service = 'get';\n } else {\n $service = 'objects';\n }\n\n return $service;\n\n }", "abstract protected function getService();", "function getOne($serviceName)\n {\n return $this->_get($serviceName);\n }", "public function getValue();", "public function getValue();", "public function getValue();", "public function getValue();", "public function getValue();" ]
[ "0.7051693", "0.7037837", "0.6985058", "0.689558", "0.6767686", "0.67354685", "0.6717884", "0.668229", "0.66244125", "0.6620868", "0.6620868", "0.6620868", "0.6620868", "0.6620868", "0.6620868", "0.6620868", "0.66000277", "0.65876305", "0.65876305", "0.6580576", "0.6548939", "0.6542074", "0.65121603", "0.6489554", "0.64760023", "0.64760023", "0.64760023", "0.64760023", "0.64760023", "0.64758074", "0.6475673", "0.6475673", "0.6475673", "0.6475673", "0.6475673", "0.6475673", "0.6475673", "0.6475673", "0.6475673", "0.6475673", "0.6475673", "0.6475673", "0.6475673", "0.6475673", "0.64633405", "0.6460433", "0.6412067", "0.64021057", "0.63666207", "0.6350308", "0.6347605", "0.6303766", "0.6297505", "0.6297505", "0.6291087", "0.6286165", "0.62843156", "0.6261263", "0.62257797", "0.62241006", "0.62213004", "0.61848587", "0.6163008", "0.61612684", "0.61305857", "0.61150545", "0.6112915", "0.6111307", "0.6097227", "0.6091487", "0.60900146", "0.6089051", "0.6067568", "0.6063296", "0.60564893", "0.60564893", "0.60564893", "0.60564893", "0.60564893", "0.60564893", "0.60564893", "0.60564893", "0.60564893", "0.60564893", "0.60564893", "0.60564893", "0.60564893", "0.60564893", "0.60564893", "0.60564893", "0.60564893", "0.60564893", "0.605316", "0.6052861", "0.60516703", "0.6041332", "0.6041332", "0.6041332", "0.6041332", "0.6041332" ]
0.62444496
58
Set the value of service
public function setService(ServiceOTP $service) : self { $this->service = $service; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setService($service) {\r\n\t\t$this->service = $service;\r\n\t}", "public function setService($value)\n {\n return $this->set('Service', $value);\n }", "public function __set($name, $value) {\n $this->services[$name] = $value;\n }", "public function setService($service)\n\t{\n\t\t$this->service = ucfirst($service);\n\t}", "public function __set($key, $value)\n {\n $this->service[$key] = $value;\n }", "public function SetTestService($value)\n {\n $this->_TestService = $value;\n }", "public function set($name, $service, $context='default')\n {\n $this->getServices()->set($name, $service, $context);\n }", "public function setServiceService (ServiceService $serviceService) {\n $this->serviceService = $serviceService;\n }", "public function set_service($service_url)\n\t{\n\t\t$this->api_service = $service_url;\n\t}", "public function set(string $serviceKey, $service, bool $overwrite = false);", "public function setService($service)\n {\n $this->values['Service'] = $service;\n return $this;\n }", "public function set(string $serviceName, $object);", "public function setService(BaseService $service)\n {\n $this->_service = $service;\n }", "public function setService($service){\n \n $this->_service = $service; \n \n return $this;\n \n }", "public function giveService($key, $Service);", "public function service($value): self\n {\n $this->service = $value;\n \n return $this;\n }", "public function setObject($obj)\n {\n $this->service = $obj;\n }", "public function testSetService() {\n\n $obj = new Employes();\n\n $obj->setService(\"service\");\n $this->assertEquals(\"service\", $obj->getService());\n }", "public function offsetSet($id, $value)\n\t{\n\t\tif (isset($this->services[$id])) {\n\t\t\tthrow new FontoException(\"There is already an service with $id registered in the container\");\n\t\t}\n\n\t\t$this->services[$id] = $value;\n\t}", "public function setService(string $key, $service) {\n $this->injxServices[$key] = $service;\n return $this;\n }", "public function set(string $serviceId, $instance): void\n {\n $this->services[$serviceId] = $instance;\n }", "public function setService($service)\n {\n $this->service = $service;\n return $this;\n }", "public function set($name, $value)\n {\n $name = strtolower($name);\n $isClosure = false;\n\n if ($value instanceof \\Closure) {\n $this->useServiceFactory = true;\n $isClosure = true;\n $this->serviceFactory[$name] = $value;\n unset($this->services[$name]);\n }\n\n if (!$isClosure) {\n $this->services[$name] = $value;\n }\n }", "public function setService(?string $service): self\n {\n $this->service = $service;\n\n return $this;\n }", "public function setServiceName($val)\n {\n $this->_propDict[\"serviceName\"] = $val;\n return $this;\n }", "public function __construct($service) {\n $this->service = $service;\n }", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setService(){\n if($this->getRecord()->getRecordType() === \"yt\"){\n $this->service = new YoutubeService();\n }\n if($this->getRecord()->getRecordType() === \"gm\"){\n $this->service = new GoogleMapService();\n }\n }", "public function setServiceId($val)\n {\n $this->_propDict[\"serviceId\"] = $val;\n return $this;\n }", "public function setService(Service $service = null) {\n $this->service = $service;\n return $this;\n }", "public function testUpdateServiceData()\n {\n\n }", "public static function setServicePoint($servicePoint)\n {\n self::$servicePoint = $servicePoint;\n }", "public function __set( $name, $value )\n {\n\t\t\tif( property_exists( \"UserSVC\", $name ) )\n\t\t\t\t$this->$name = $value;\n }", "public function setServices($services)\n {\n $this->services = $services;\n }", "public function setServices($services) {\n $this->services = $services;\n }", "function setValue($value) {\n $this->value = $value;\n }", "function setValue($value){\r\n\t\t$this->value = $value;\r\n\t}", "public function setValue($value);", "public function setValue($value);", "public function setValue($value);", "public function setValue($value);", "public function setValue($value);", "public function setValue($value);", "public function setValue($value);", "public function setValue($value);", "public function setValue($value);", "public function setValue($value);", "public function set_service_option( $option_name, $option_value ) {\n\n\t\t$options = isset( $this->_options ) ? $this->_options : array();\n\n\t\t$options[ $this->_managed_solr_service_id ][ $option_name ] = $option_value;\n\n\t\t// Save options\n\t\t$this->set_option_data( self::OPTION_MANAGED_SOLR_SERVERS, $options );\n\n\t\t// Refresh the options after save\n\t\t$this->_options = self::get_option_data( self::OPTION_MANAGED_SOLR_SERVERS, null );\n\n\t}", "public function testUpdateService()\n {\n\n }", "public function set($service, $callback, $shared): void{\n\t\t$this->service[$service] = $callback;\n\t\t$this->shared[$service] = $shared;\n\t}", "public function setDummyService( TestModel $service ) {\n $service->getData();\n }", "public function setServiceKey($value)\n {\n return $this->setParameter('serviceKey', $value);\n }", "public function setService ($service)\n {\n if (is_string($service)) {\n $service = new $service();\n }\n if (! $service instanceof Application_Rest_Client) {\n throw new Exception('Invalid data gateway provided');\n }\n $this->_service = $service;\n return $this;\n }", "public function setValue($value){\n $this->_value = $value;\n }", "public function setService($name, $mix)\n {\n $this->config['services'][$name] = $mix;\n }", "function setValue ($value) {\n\t\t$this->_value = $value;\n\t}", "public function setServiceCode(?string $serviceCode): self\n {\n $this->initialized['serviceCode'] = true;\n $this->serviceCode = $serviceCode;\n\n return $this;\n }", "public function __construct($service = 'https://pkserv.spring-dvs.org') {\n\t\t$this->service = $service;\n\t\t\n\t}", "public function __set($key, $value)\n {\n if (array_key_exists($key, $this->services))\n {\n throw new \\InvalidArgumentException('You cannot store a parameter with the same name as a registered service.');\n }\n\n $this->parameters[$key] = $value;\n }", "public function setService($var)\n {\n GPBUtil::checkString($var, True);\n $this->service = $var;\n\n return $this;\n }", "public function updated(Service $service)\n {\n //\n }", "public function setValue( $value ) { \n $this->inputValue = $value; \n $this->value = $value;\n }", "public function setConfigService(Config $configService){\n $this->configService = $configService;\n }", "public function setServiceLocator(ServiceManager $sm){\n $this->sm = $sm;\n }", "function set_value($value)\n\t{\n\t\t$this->value = $value;\n\t}", "public function setServiceProxy($serviceProxy);", "abstract public function setValue($value);", "private function checkServiceServiceSet () {\n if(is_null($this->serviceService)) {\n $this->exceptionWithResponseCode(500,\n \"Internal error: The service service has not been set. Please contact a GOCDB administrator and report this error.\"\n );\n }\n }", "public function edit(Service $service)\n {\n //\n }", "public function edit(Service $service)\n {\n //\n }", "public function edit(Service $service)\n {\n //\n }", "public function edit(Service $service)\n {\n //\n }", "public function updating(Service $Service)\n {\n //code...\n }", "public function setServiceSelect(Core_Model_ValueObject_Node $node)\n {\n $serviceOptions = array();\n \n foreach (Core_Model_DiFactory::getModuleRegistry()->getModules() as $service) {\n if($node->hasService($service->getName())) {\n continue;\n }\n \n $serviceOptions[$service->getName()] = $service->getLabel();\n }\n \n if (count($serviceOptions)){\n $serviceOptions[\"\"] = self::SERVICES_AVAILABLE;\n } else {\n $serviceOptions[\"\"] = self::SERVICES_NOT_AVAILABLE;\n $this->getElement('service')->setAttrib(\"disabled\", \"disabled\");\n }\n \n $this->getElement('service')->setMultiOptions($serviceOptions);\n \n return $this;\n }", "protected function doSet($value)\n {\n }", "public function testUpdateService()\n {\n\n $this->browse(function (Browser $browser) {\n $user = User::factory()->create();\n $service = Service::factory()->create();\n $serviceUpdate = Service::factory()->make();\n $browser->visit('/login')\n ->pause(3000)\n ->type('email', $user->email)\n ->type('password', 'password')\n ->press('Login')\n ->pause(2000)\n ->assertPathIs('/service')\n ->visit('/service/update/'.$service->id)\n ->pause(1000)\n ->type('descricao', $serviceUpdate->descricao)\n ->type('valor', $serviceUpdate->valor)\n ->press('Editar')\n ->pause(1000)\n ->assertSee(Constantes::SUCESSO_UPDATE_SERVICE)\n ->press('OK')\n ->pause(1000);\n\n });\n }", "public function setClass($class)\n {\n $this->service = new $class();\n }", "public function set($name, $value){}", "public function setValue($value) {\n $this->value = $value;\n }", "public function setValue($value) {\n $this->value = $value;\n }", "public function setValue($value) {\n $this->value = $value;\n }", "public function setValue($value) {\n $this->value = $value;\n }", "public function setValue($value) {\n $this->value = $value->value;\n }", "function set($name,$value) \n {\n return $this->instance->set($name,$value);\n }", "public static function editService($service, $id){\r\n Client::Update()\r\n ->set('service',$service)\r\n ->where('id', $id)\r\n ->execute();\r\n }", "public function updated(Service $Service)\n {\n //code...\n }", "public function set_service( Publisher_Fetch_Screenshot_Service_Interface $service ) {\n\n\t\t$this->provider_instance = $service;\n\t}", "public static function setServiceLayer($type, $service, $mode = '')\n {\n $type = $type . $mode;\n\n self::$services[$type] = $service;\n }" ]
[ "0.79593724", "0.77505946", "0.7571768", "0.7424723", "0.7378902", "0.7219344", "0.70955", "0.7037397", "0.697429", "0.6919706", "0.6863462", "0.6853431", "0.681495", "0.6704885", "0.6661191", "0.66426444", "0.66004", "0.65830284", "0.65609", "0.6498444", "0.64742553", "0.64230376", "0.6390624", "0.6384715", "0.63358593", "0.6333801", "0.63084376", "0.63084376", "0.6308111", "0.6308111", "0.6308111", "0.6308111", "0.6308111", "0.6308111", "0.6308111", "0.6308111", "0.6308111", "0.6308111", "0.6308111", "0.62939537", "0.627255", "0.62610805", "0.62089574", "0.6203305", "0.6197297", "0.6183508", "0.6156387", "0.61528057", "0.6112116", "0.61120546", "0.61120546", "0.61120546", "0.61120546", "0.61120546", "0.61120546", "0.61120546", "0.61120546", "0.61120546", "0.61120546", "0.6105066", "0.6060794", "0.6042588", "0.60054696", "0.5990413", "0.59774965", "0.5962442", "0.5946163", "0.59315324", "0.59260666", "0.5916525", "0.59103566", "0.59009784", "0.589752", "0.5896399", "0.5869379", "0.5856055", "0.58438396", "0.58353335", "0.5823378", "0.5819657", "0.5805847", "0.5805847", "0.5805847", "0.5805847", "0.57912445", "0.57573766", "0.57454216", "0.5741277", "0.573383", "0.5732317", "0.57257", "0.57257", "0.57257", "0.57257", "0.5709085", "0.57056314", "0.56906986", "0.56808394", "0.56693786", "0.56677985" ]
0.5812769
80
Get the value of createddate
public function getCreateddate() { return $this->createddate; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function get_date_created();", "public function getDateCreated()\n {\n return $this->date_created;\n }", "public function getDateCreated()\n {\n return $this->date_created;\n }", "public function getDateCreated() {\r\n return $this->_date_created;\r\n }", "public function getCreatedDate();", "public function getCreatedDate()\n {\n return $this->created_date;\n }", "public function getCreatedDate() {\n return $this->get('created_date', 'user');\n }", "public function getDateCreated();", "public function getDateCreated()\n {\n return $this->dateCreated;\n }", "public function getDateCreated()\n {\n return $this->dateCreated;\n }", "public function getCreate_date(){\n return $this->create_date;\n }", "public function getDateCreated() {\n return $this->dateCreated;\n }", "public function getDateCreated() {\n return($this->dateCreated);\n }", "public function getCreateDate(): string\n {\n return $this->create_date;\n }", "public function getDateCreated()\n {\n return $this->_DateCreated;\n }", "function getCreatedDate() {\n\t\treturn $this->_CreatedDate;\n\t}", "public function getCreateDate()\n {\n return $this->create_date;\n }", "public function getDateCreated()\n {\n $rtn = $this->data['date_created'];\n\n if (!empty($rtn)) {\n $rtn = new \\DateTime($rtn);\n }\n\n return $rtn;\n }", "public function getCarCreated(){\r\n\t\t$this->car_created = getValue(\"SELECT CAST(created AS DATE) AS DATEONLY FROM tbl_car WHERE car_id=\".$this->car_id);\r\n\t\treturn $this->car_created;\r\n\t}", "public function getDate()\n {\n return $this->getData('created_at');\n }", "public function getDateCreate()\n {\n return $this->date_create;\n }", "public function getDateCreate()\n {\n return $this->date_create;\n }", "public function getDate_creation()\n {\n return $this->date_creation;\n }", "public function getCreatedDate()\r\n\t\t{\r\n\t\t\treturn date('m/d/Y', strtotime($this->_created_date));\r\n\t\t}", "public function get_date_create()\n\t{\n\t\treturn $this->date_create;\n\t}", "public function getCreatedDate()\n {\n return isset($this->CreatedDate) ? $this->CreatedDate : null;\n }", "function get_creation_date()\n\t{\n\t\treturn $this->creation_date;\n\t}", "public function getDate()\n\t\t{\n\t\t\t$date = new \\DateTime($this->created_at);\n\t\t\treturn $date->format('jS M Y');\n\t\t}", "public function getCreateDate() {\n\t\treturn $this->createDate;\n\t}", "public function getCreateDate() {\n\t\treturn $this->createDate;\n\t}", "function getCreateDate() {\n\t\treturn $this->_CreateDate;\n\t}", "function getCreateDate() {\n\t\treturn $this->_CreateDate;\n\t}", "public function getDatecreation_user()\r\n {\r\n return $this->datecreation_user;\r\n }", "public function getCreateDate(): int;", "public function getDateCreate()\n\t{\n\t\treturn $this->dateCreate;\n\t}", "public function getDateCreation()\n {\n return $this->date_creation;\n }", "public function getCreateDate()\n\t{\n\t\treturn $this->CreateDate;\n\t}", "public function getDateCreated()\n {\n if (isset($this->data['CreatedDate'])) {\n return $this->data['CreatedDate'];\n } else {\n return false;\n }\n }", "public function getCreated()\r\n {\r\n return $this->created;\r\n }", "public function getCreated()\n {\n if (is_string($this->created))\n $this->created = new UDate($this->created);\n return $this->created;\n }", "public function getCreatedAt(){\n return $this->_getData(self::CREATED_AT);\n }", "public function getDateCreated() : DateTime\n {\n $rtn = $this->data['date_created'];\n\n if (!empty($rtn)) {\n $rtn = new DateTime($rtn);\n }\n\n return $rtn;\n }", "public function getCreatedDateAttribute($value){\n return date(\"n/d/Y g:i:s A\",strtotime($this->attributes['CreatedDate']));\n }", "private function GetCreated()\n\t\t{\n\t\t\treturn $this->created;\n\t\t}", "public function getCreated()\n {\n return $this->_created;\n }", "public function getCreated()\n {\n return $this->_created;\n }", "public function getCreationDate()\n {\n return $this->created;\n }", "public function getDateCreation()\n {\n return $this->dateCreation;\n }", "public function getDateCreation()\n {\n return $this->dateCreation;\n }", "public function getDateCreation()\n {\n return $this->dateCreation;\n }", "public function getCreated()\n {\n return $this->created;\n }", "public function getCreated()\n {\n return $this->created;\n }", "public function getCreated()\n {\n return $this->created;\n }", "public function getCreated()\n {\n return $this->created;\n }", "public function getCreated()\n {\n return $this->created;\n }", "public function getCreated()\n {\n return $this->created;\n }", "public function getCreated()\n {\n return $this->created;\n }", "public function getCreated()\n {\n return $this->created;\n }", "public function getCreated()\n {\n return $this->created;\n }", "public function getCreated()\n {\n return $this->created;\n }", "public function getCreated()\n {\n return $this->created;\n }", "public function getCreated()\n {\n return $this->created;\n }", "public function getCreated()\n {\n return $this->created;\n }", "public function getCreated()\n {\n return $this->created;\n }", "public function getCreated()\n {\n return $this->created;\n }", "public function getCreated()\n {\n return $this->created;\n }", "public function getCreated()\n {\n return $this->created;\n }", "public function getCreated()\n {\n return $this->created;\n }", "public function getCreated()\n {\n return $this->created;\n }", "public function getCreated()\n {\n return $this->created;\n }", "public function getCreated()\n {\n return $this->created;\n }", "public function getCreated()\n {\n return $this->created;\n }", "public function getCreated()\n {\n return $this->created;\n }", "function created() {\n return date('Y-m-d H:i:s');\n }", "public function getCreated() \n\t{\n\t\treturn $this->created;\n\t}", "public function getCreatedAt(){\n return $this->createdAt;\n }", "protected static function created_at(): mixed\n\t{\n\t\treturn self::$query->created_at;\n\t}", "protected static function created_at(): mixed\n\t{\n\t\treturn self::$query->created_at;\n\t}", "public function getCreated() {\n\t\treturn $this->created;\n\t}", "public function get_time_created(){\n\t\treturn $this->time_created;\n\t}", "function get_timecreated() {\n return $this->timecreated;\n }", "public function getCreationDate();", "public function getTimestampCreated()\n {\n return $this->_getData(self::TIMESTAMP_CREATED);\n }", "public function getCreatedAt()\n {\n return $this->data['fields']['created_at'];\n }", "public function created_at()\n\t{\n\t\treturn $this->date($this->created_at);\n\t}", "public function created_at()\n\t{\n\t\treturn $this->date($this->created_at);\n\t}", "public function created_at()\n\t{\n\t\treturn $this->date($this->created_at);\n\t}", "public function _getCreatedOn() {\n\t\treturn $this->_createdOn;\n\t}", "public function getTimeCreated(){\n return $this->TIME_CREATED;\n }", "public function created_at()\n {\n return $this->date($this->created_at);\n }", "public function getDateCreatedAttribute()\n {\n return Carbon::parse($this->created_at)->format('d-m-Y');\n }", "public function getDateCreatedAttribute()\n {\n return Carbon::parse($this->created_at)->format('d-m-Y');\n }", "public function get_creation_date()\n {\n return $this->get_default_property(self::PROPERTY_CREATION_DATE);\n }", "public function getCreatedAt() \r\n {\r\n return $this->createdAt;\r\n }", "public function getDateCreated()\n\t{\n\t\t$date = new Precurio_Date($this->date_created);\n\t\tif($date->isYesterday()) return 'Yesterday';\n\t\tif($date->isToday()) return 'Today';\n\t\t\n\t\treturn $date->get(Precurio_Date::DATE_SHORT);\n\t}", "public function getCreated()\n {\n if (! isset($this->created)) {\n $this->created = new DateTime($this->getXPath($this->getDom())->query($this->getCreatedQuery())->item(0)->value);\n }\n return $this->created;\n }", "public function getDateCreated()\n {\n return $this->getDateModified();\n }", "function getCreatedTime() {\n\t\tif (is_null($this->created_time)) {\n\t\t\t$this->created_time = new \\MongoDate();\n\t\t}\n\t\treturn $this->created_time;\n\t}", "public function getCreated(): DateTime\n {\n return $this->created;\n }", "public function getCreated() : string\n {\n return $this->created;\n }" ]
[ "0.8287308", "0.8039385", "0.8039385", "0.8028678", "0.8009091", "0.79696393", "0.7950722", "0.7914252", "0.78919524", "0.78919524", "0.7880056", "0.78777224", "0.7831243", "0.78251636", "0.7813254", "0.78037477", "0.7763138", "0.7716699", "0.7708515", "0.7707672", "0.76845294", "0.76845294", "0.7671696", "0.7645418", "0.7641551", "0.76278573", "0.7594633", "0.75639826", "0.75578135", "0.75578135", "0.75426805", "0.75426805", "0.75392383", "0.7520631", "0.75020146", "0.7500639", "0.74698234", "0.7456691", "0.7443138", "0.7441983", "0.7424046", "0.74003905", "0.7392864", "0.73812884", "0.7375008", "0.7375008", "0.7374532", "0.7365159", "0.7365159", "0.7365159", "0.73611027", "0.73611027", "0.73611027", "0.73611027", "0.73611027", "0.73611027", "0.73611027", "0.73611027", "0.73611027", "0.73611027", "0.73611027", "0.73611027", "0.73611027", "0.73611027", "0.73611027", "0.73611027", "0.73611027", "0.73611027", "0.73611027", "0.73611027", "0.73611027", "0.73611027", "0.73611027", "0.7358539", "0.7336549", "0.733351", "0.73306453", "0.73306453", "0.7327514", "0.7321253", "0.7303032", "0.72986245", "0.7289159", "0.72754586", "0.727515", "0.727515", "0.727515", "0.7274822", "0.72509015", "0.7249561", "0.7248362", "0.7248362", "0.72469705", "0.72217774", "0.7189179", "0.718738", "0.71865374", "0.7171161", "0.7169308", "0.7158914" ]
0.8082222
1
Set the value of createddate
public function setCreateddate(DateTime $createddate) { $this->createddate = $createddate; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setDateCreated($value)\n {\n $this->validateDate('DateCreated', $value);\n $this->validateNotNull('DateCreated', $value);\n\n if ($this->data['date_created'] === $value) {\n return;\n }\n\n $this->data['date_created'] = $value;\n $this->setModified('date_created');\n }", "public function setCreatedDate($date)\r\n\t\t{\r\n\t\t\t$this->_created_date = $date;\r\n\t\t}", "public function setCreated($date)\n {\n $this->created = $date;\n }", "private function SetCreated(\\DateTime $value)\n\t\t{\n\t\t\t$this->created = $value;\n\t\t}", "public function setDate()\n\t{\n\t\tif ($this->getIsNewRecord())\n\t\t\t$this->create_time = time();\n\t}", "public function set_creation_date($created)\n {\n $this->set_default_property(self::PROPERTY_CREATION_DATE, $created);\n }", "public function setCreated($date) \n\t{\n\t\t$this->created = $this->parseDate($date);\n\t}", "public function setDateTime($value)\n {\n $this->createdAt=$value;\n }", "public function setCreated(\\DateTime $created) {\n\n $this->created = $created->format('Y-m-d H:i:s');\n\n }", "public function setDate()\n\t{\n\t\tif($this->isNewRecord)\n\t\t\t$this->create_time=$this->update_time=time();\n\t\telse\n\t\t\t$this->update_time=time();\n\t}", "public function setDate()\n\t{\n\t\tif($this->isNewRecord)\n\t\t\t$this->create_time=$this->update_time=time();\n\t\telse\n\t\t\t$this->update_time=time();\n\t}", "public function setCreationDate($date) {}", "public function setCreatedAtValue()\n {\n $this->createdAt = new \\DateTime();\n }", "public function setCreatedDate(DateTime $createdDate);", "public function setCreatedDateTime(?DateTime $value): void {\n $this->getBackingStore()->set('createdDateTime', $value);\n }", "public function setCreatedDateTime(?DateTime $value): void {\n $this->getBackingStore()->set('createdDateTime', $value);\n }", "public function setCreatedDateTime(?DateTime $value): void {\n $this->getBackingStore()->set('createdDateTime', $value);\n }", "public function setCreatedDateTime(?DateTime $value): void {\n $this->getBackingStore()->set('createdDateTime', $value);\n }", "public function setCreatedDateTime(?DateTime $value): void {\n $this->getBackingStore()->set('createdDateTime', $value);\n }", "public function setCreatedDateTime(?DateTime $value): void {\n $this->getBackingStore()->set('createdDateTime', $value);\n }", "public function setCreatedDateTime(?DateTime $value): void {\n $this->getBackingStore()->set('createdDateTime', $value);\n }", "public function setCreatedDateTime(?DateTime $value): void {\n $this->getBackingStore()->set('createdDateTime', $value);\n }", "public function setCreated($created);", "public function setCreated($created);", "public function setDate($value) {\n\t\t$this->_date = $value;\n\t}", "public function setCreateDate(int $create_date);", "public function setCreated($created)\n {\n $this->created = $created;\n }", "function setCreated($value) {\n\t\treturn $this->setColumnValue('created', $value, Model::COLUMN_TYPE_INTEGER_TIMESTAMP);\n\t}", "public function setCreationDate($date = true) {}", "public function set_date_created( $date = null ) {\n\t\tglobal $wpdb;\n\n\t\tif ( ! is_null( $date ) ) {\n\n\t\t\t$datetime_string = wcs_get_datetime_utc_string( wcs_get_datetime_from( $date ) );\n\n\t\t\t// Don't use wp_update_post() to avoid infinite loops here\n\t\t\t$wpdb->query( $wpdb->prepare( \"UPDATE $wpdb->posts SET post_date = %s, post_date_gmt = %s WHERE ID = %d\", get_date_from_gmt( $datetime_string ), $datetime_string, $this->get_id() ) );\n\n\t\t\t$this->post->post_date = get_date_from_gmt( $datetime_string );\n\t\t\t$this->post->post_date_gmt = $datetime_string;\n\t\t}\n\t}", "public function setCreatedAtAttribute($value)\n {\n $this->attributes['created_at'] = date('Y-m-d');\n }", "public function setCreated($created) {\n\t\t$this->created = (string) $created;\n\t}", "public function setCreateDates(){\n $t = date_create(date('Y-m-d H:i:s'));\n $this->created = $t;\n $this->modified = $t;\n }", "public function setCreated(\\DateTime $created)\n {\n $this->entity->setCreated($created);\n }", "public function setCreated(\\DateTime $created = null)\n {\n $this->created = $created;\n }", "public function setDateCreated($data)\n {\n $this->_DateCreated=$data;\n return $this;\n }", "function setDatePosted($val) {\n $this->identifier = $this->updateDB('identifier', $val);\n }", "public function setValueDefault()\n {\n $this->createdAt = new \\DateTime();\n }", "public function setCreatedAtAttribute($value)\n {\n $this->attributes['created_at'] = $value;\n }", "public function setDate($date);", "public function setCreateDate(string $create_date): void\n {\n $this->create_date = $create_date;\n }", "public function setDateCreated($value) : Job\n {\n $this->validateDate('DateCreated', $value);\n\n if ($this->data['date_created'] !== $value) {\n $this->data['date_created'] = $value;\n $this->setModified('date_created');\n }\n\n return $this;\n }", "public function setDateCreated($dateCreated)\n {\n $this->dateCreated = VT::toDateTimeImmutable($dateCreated);\n }", "public function setUserCreatedAttribute($value){\n if(isset($value)){\n $this->attributes['user_created'] = $value;\n }\n else{\n $this->attributes['user_created'] = 0;\n }\n }", "public function setCreationTimestamp(?DateTime $value): void {\n $this->getBackingStore()->set('creationTimestamp', $value);\n }", "public function set_dates(){\n // if the id is not set, this means its anew item being created\n if(property_exists($this, 'created_on') && empty($this->id)){\n $this->created_on = date('Y-m-d H:i:s');\n }\n\n // if id is set, its an update\n if(property_exists($this, 'last_updated_on') && isset($this->id)){\n $this->last_updated_on = date('Y-m-d H:i:s');\n }\n }", "public function setCreatedAt($value)\n {\n if (!array_key_exists('created_at', $this->fieldsModified)) {\n $this->fieldsModified['created_at'] = $this->data['fields']['created_at'];\n } elseif ($value === $this->fieldsModified['created_at']) {\n unset($this->fieldsModified['created_at']);\n }\n\n $this->data['fields']['created_at'] = $value;\n }", "public function setCreatedAt()\n {\n $this->createdAt = new \\DateTime();\n }", "public function setTransactionDate($value) {\n\t\tself::$_transactionDate = $value;\n\t}", "protected function _syncCreationDate() {}", "public function setCreateDate($v)\n {\n $dt = PropelDateTime::newInstance($v, null, 'DateTime');\n if ($this->create_date !== null || $dt !== null) {\n $currentDateAsString = ($this->create_date !== null && $tmpDt = new DateTime($this->create_date)) ? $tmpDt->format('Y-m-d H:i:s') : null;\n $newDateAsString = $dt ? $dt->format('Y-m-d H:i:s') : null;\n if ( ($currentDateAsString !== $newDateAsString) // normalized values don't match\n || ($dt->format('Y-m-d H:i:s') === '2021-06-07 11:49:57') // or the entered value matches the default\n ) {\n $this->create_date = $newDateAsString;\n $this->modifiedColumns[] = SanitasiPeer::CREATE_DATE;\n }\n } // if either are not null\n\n\n return $this;\n }", "public function setCreatedDate(\\DateTimeInterface $created_date) {\n $this->set('created_date', $created_date, 'user');\n }", "public function setPublishDateAttribute($value)\n {\n $this->attributes['publish_date'] = date(\"Y-m-d H:i:s\", strtotime($value));\n }", "public function getCreatedDateAttribute($value){\n return date(\"n/d/Y g:i:s A\",strtotime($this->attributes['CreatedDate']));\n }", "public function addCreated()\n {\n try {\n $date = new DateTime();\n $this->created_at = $date->format('Y-m-d H:i:s');\n $this->created_by = 0;\n } catch (Exception $e) {\n print_r($e);\n }\n }", "public function setCreatedThingTransferDate($value)\n {\n return $this->set(self::CREATEDTHINGTRANSFERDATE, $value);\n }", "public function setCreationDateTime(?DateTime $value): void {\n $this->getBackingStore()->set('creationDateTime', $value);\n }", "public function setCreationDateTime(?DateTime $value): void {\n $this->getBackingStore()->set('creationDateTime', $value);\n }", "function set_date_to_now()\n {\n $this->timestamp=time();\n }", "public function setCreatedAtAttribute($value) {}", "public function setDate($date){\n\t\t$this->date = $date;\n\t}", "public function setCreatedAt(?string $createdAt): void\n {\n $this->createdAt = $createdAt;\n }", "public function setCreatedAt(?string $createdAt): void\n {\n $this->createdAt = $createdAt;\n }", "private function _setDate(){\n\t\tif($this->_year>=1970&&$this->_year<=2038){\n\t\t\t$this->_day = date('d', $this->_timestamp);\n\t\t\t$this->_month = date('m', $this->_timestamp);\n\t\t\t$this->_year = date('Y', $this->_timestamp);\n\t\t} else {\n\t\t\t$dateParts = self::_getDateParts($this->_timestamp, true);\n\t\t\t$this->_day = sprintf('%02s', $dateParts['mday']);\n\t\t\t$this->_month = sprintf('%02s', $dateParts['mon']);\n\t\t\t$this->_year = $dateParts['year'];\n\t\t}\n\t\t$this->_date = $this->_year.'-'.$this->_month.'-'.$this->_day;\n\t}", "public function setCreateDate($v)\n {\n $dt = PropelDateTime::newInstance($v, null, 'DateTime');\n if ($this->create_date !== null || $dt !== null) {\n $currentDateAsString = ($this->create_date !== null && $tmpDt = new DateTime($this->create_date)) ? $tmpDt->format('Y-m-d H:i:s') : null;\n $newDateAsString = $dt ? $dt->format('Y-m-d H:i:s') : null;\n if ($currentDateAsString !== $newDateAsString) {\n $this->create_date = $newDateAsString;\n $this->modifiedColumns[] = JadwalPeer::CREATE_DATE;\n }\n } // if either are not null\n\n\n return $this;\n }", "public function getCreateDate()\n {\n $this->create_date = null;\n\n return;\n }", "public function setCreatedAt(DateTime $date);", "public function setCreatedDateTime($val)\n {\n $this->_propDict[\"createdDateTime\"] = $val;\n return $this;\n }", "public function setCreatedDateTime($val)\n {\n $this->_propDict[\"createdDateTime\"] = $val;\n return $this;\n }", "public function setCreatedDateTime($val)\n {\n $this->_propDict[\"createdDateTime\"] = $val;\n return $this;\n }", "public function setCreatedDateTime($val)\n {\n $this->_propDict[\"createdDateTime\"] = $val;\n return $this;\n }", "public function setCreatedDateTime($val)\n {\n $this->_propDict[\"createdDateTime\"] = $val;\n return $this;\n }", "public function setCreatedDateTime($val)\n {\n $this->_propDict[\"createdDateTime\"] = $val;\n return $this;\n }", "public function setCreatedDateTime($val)\n {\n $this->_propDict[\"createdDateTime\"] = $val;\n return $this;\n }", "public function setCreatedDateTime($val)\n {\n $this->_propDict[\"createdDateTime\"] = $val;\n return $this;\n }", "public function setCreateDate($createDate) {\n\t\t$this->createDate = $createDate;\n\t}", "public function setCreateDate($createDate) {\n\t\t$this->createDate = $createDate;\n\t}", "public function setCreatedAt(string $createdAt): void\n {\n $this->createdAt = $createdAt;\n }", "public function setCreatedAtAttribute($value)\n {\n $this->attributes['created_at'] = Carbon::parse($value);\n }", "public function setCreatedDate(NostoDate $date)\n {\n $this->createdDate = $date;\n }", "public function setCreateDate($v)\n {\n $dt = PropelDateTime::newInstance($v, null, 'DateTime');\n if ($this->create_date !== null || $dt !== null) {\n $currentDateAsString = ($this->create_date !== null && $tmpDt = new DateTime($this->create_date)) ? $tmpDt->format('Y-m-d H:i:s') : null;\n $newDateAsString = $dt ? $dt->format('Y-m-d H:i:s') : null;\n if ( ($currentDateAsString !== $newDateAsString) // normalized values don't match\n || ($dt->format('Y-m-d H:i:s') === '2020-04-16 09:40:03') // or the entered value matches the default\n ) {\n $this->create_date = $newDateAsString;\n $this->modifiedColumns[] = SekolahPaudPeer::CREATE_DATE;\n }\n } // if either are not null\n\n\n return $this;\n }", "public function setDateCreated($date_created) {\n if (!isset($date_created)) {\n $date_created = \\M\\Carbon::now();\n }\n $this->fields[\"date_created\"] = $date_created;\n\n return $this;\n }", "function setCreatedDate($inCreatedDate) {\n\t\tif ( $inCreatedDate !== $this->_CreatedDate ) {\n\t\t\tif ( !$inCreatedDate instanceof DateTime ) {\n\t\t\t\t$inCreatedDate = new systemDateTime($inCreatedDate, system::getConfig()->getSystemTimeZone()->getParamValue());\n\t\t\t}\n\t\t\t$this->_CreatedDate = $inCreatedDate;\n\t\t\t$this->setModified();\n\t\t}\n\t\treturn $this;\n\t}", "public function setCreateDate($v)\n {\n $dt = PropelDateTime::newInstance($v, null, 'DateTime');\n if ($this->create_date !== null || $dt !== null) {\n $currentDateAsString = ($this->create_date !== null && $tmpDt = new DateTime($this->create_date)) ? $tmpDt->format('Y-m-d H:i:s') : null;\n $newDateAsString = $dt ? $dt->format('Y-m-d H:i:s') : null;\n if ($currentDateAsString !== $newDateAsString) {\n $this->create_date = $newDateAsString;\n $this->modifiedColumns[] = BangunanPeer::CREATE_DATE;\n }\n } // if either are not null\n\n\n return $this;\n }", "function setCreated() \n {\n $this->setValueByFieldName( 'statevar_isCreated', 1 );\n $this->updateDBTable();\n }", "public function setCreatedAt($createdAt) \r\n {\r\n $this->createdAt = $createdAt;\r\n }", "public function setCreationDate(\\DateTime $creationDate) {\n\t\t$this->creationDate = $creationDate;\n\t}", "public function setProcessCreationDateTime(?DateTime $value): void {\n $this->getBackingStore()->set('processCreationDateTime', $value);\n }", "public function updateDateCreated()\n\t\t{\n\t\t\t$db = $this->getDatabaseInstance(self::DB_INST_WRITE);\n\n\t\t\t$query = \"UPDATE status_history\n\t\t\t\t\t SET date_created=?\n\t\t\t\t\t WHERE application_id=?\n\t\t\t\t\t\tAND application_status_id=?\";\n\n\t\t\t$values = array($this->date_created, $this->application_id, $this->application_status_id);\n\n\t\t\t$st = $db->prepare($query);\n\t\t\t$st->execute($values);\n\n $this->setDataSynched();\n }", "public function setDate($date) {\n $this->date = $date;\n }", "public function _setCreatedOn($createdOn) {\n\t\t$this->_createdOn = $createdOn;\n\t}", "public function setCreatedAtAttribute( $value ) {\n if (config('database.default') == 'mysql') {\n $this->attributes['created_at'] = (new Carbon($value))->format('Y-m-d H:i:s');\n }elseif(config('database.default') == 'sqlsrv'){\n $this->attributes['created_at'] = (new Carbon($value))->format('Ymd H:i:s');\n }else{\n $this->attributes['created_at'] = (new Carbon($value))->format('Y-m-d H:i:s');\n }\n }", "public function setDate($date)\n {\n $this->date = $date;\n }", "public function setDate($date)\n {\n $this->date = $date;\n }", "public function setDate($date)\n\t{\n\t\t$this->date = $date;\n\t}", "public function setDateCreated($newDateCreated) {\n //if null for a new profile\n if($newDateCreated === null){\n date_default_timezone_set('America/Denver'); // CDT\n \n $current_date = date('Y-m-d H:i:s');\n \n $this->dateCreated = $current_date;\n return;\n }\n \n //zeroth, if the is a DateTime object, assign it\n if(gettype($newDateCreated) === \"object\" && get_class($newDateCreated) === \"DateTime\") {\n $this->dateCreated = $newDateCreated;\n return;\n }\n \n $newDateCreated = trim($newDateCreated);\n $newDateCreated = filter_var($newDateCreated, FILTER_SANITIZE_STRING);\n \n //second, use a regular expression to extract the date and verify it\n if((preg_match(\"/^(\\d{4})-(\\d{2})-(\\d{2}) (\\d{2}):(\\d{2}):(\\d{2})$/\", $newDateCreated, $matches)) !== 1) {\n throw(new RangeException(\"DateCreated $newDateCreated is not a mySQL formatted date\"));\n }\n \n //verify the date is valid date\n $year = intval($matches[1]);\n $month = intval($matches[2]);\n $day = intval($matches[3]);\n if((checkdate($month, $day, $year)) === false) {\n throw(new RangeException(\"DateCreated $newDateCreated is not a gregorian date\"));\n }\n \n //convert the date to a DateTime Object\n if(($dateTime = DateTime::createFromFormat(\"Y-m-d H:i:s\", $newDateCreated)) === false) {\n throw(new RangeException(\"DateCreated $newDateCreated cannot be converted to a DateTime object\"));\n }\n $this->dateCreated = $dateTime;\n }", "public function setCreatedOn($data)\n {\n \n if ($data == '0000-00-00 00:00:00') {\n\n $data = null;\n }\n \n if ($data === 'CURRENT_TIMESTAMP') {\n \t$data = \\Zend_Date::now()->setTimezone('UTC');\n }\n\n if ($data instanceof \\Zend_Date) {\n\n $data = new \\DateTime($data->toString('yyyy-MM-dd HH:mm:ss'), new \\DateTimeZone($data->getTimezone()));\n\n } elseif (!is_null($data) && !$data instanceof \\DateTime) {\n\n $data = new \\DateTime($data, new \\DateTimeZone('UTC'));\n }\n\n if ($data instanceof \\DateTime && $data->getTimezone()->getName() != 'UTC') {\n\n $data->setTimezone(new \\DateTimeZone('UTC'));\n }\n\n if ($this->_logChanges === true && $this->_createdOn != $data) {\n\n $this->_logChange('createdOn');\n }\n\n $this->_createdOn = $data;\n return $this;\n }", "function setCreateDate($inCreateDate) {\n\t\tif ( $inCreateDate !== $this->_CreateDate ) {\n\t\t\tif ( !$inCreateDate instanceof DateTime ) {\n\t\t\t\t$inCreateDate = new systemDateTime($inCreateDate, system::getConfig()->getSystemTimeZone()->getParamValue());\n\t\t\t}\n\t\t\t$this->_CreateDate = $inCreateDate;\n\t\t\t$this->setModified();\n\t\t}\n\t\treturn $this;\n\t}", "public function getCreate_date(){\n return $this->create_date;\n }", "public function setCreatedAt($createdAt);", "public function setCreatedAt($createdAt);" ]
[ "0.8005464", "0.8004534", "0.80041236", "0.7864325", "0.7741194", "0.7729125", "0.77080315", "0.7660943", "0.7644539", "0.75426525", "0.75426525", "0.75056523", "0.7435612", "0.7370304", "0.7341754", "0.7341754", "0.7341754", "0.7341754", "0.7341754", "0.7341754", "0.7341754", "0.7341754", "0.73236865", "0.73236865", "0.732153", "0.7270634", "0.7269023", "0.72654825", "0.7247319", "0.71984625", "0.71944475", "0.7188778", "0.71750253", "0.70563275", "0.7052085", "0.70357066", "0.7035471", "0.69923484", "0.6971807", "0.6963488", "0.6961384", "0.69459563", "0.68829966", "0.6880619", "0.6871405", "0.68599725", "0.68572074", "0.68362373", "0.6832056", "0.67904615", "0.6788454", "0.67881954", "0.67610073", "0.6753021", "0.6750455", "0.67238843", "0.67154676", "0.67154676", "0.6712949", "0.6706819", "0.66934687", "0.6688075", "0.6688075", "0.6683944", "0.6670071", "0.6661671", "0.665973", "0.6645123", "0.6645123", "0.6645123", "0.6645123", "0.6645123", "0.6645123", "0.6645123", "0.6645123", "0.6644154", "0.6644154", "0.66374415", "0.6633463", "0.6631156", "0.6627639", "0.66254526", "0.65986204", "0.65951544", "0.65882117", "0.6560606", "0.65523744", "0.65415967", "0.65362406", "0.6524791", "0.6519546", "0.650254", "0.6496828", "0.6496828", "0.6491489", "0.64882475", "0.6484751", "0.6468895", "0.64548874", "0.6448625", "0.6448625" ]
0.0
-1
Display a listing of the resource.
public function index(Service $service) { // Try and fetch the comments. $this->manager->forService($service) ->get(); if ( $this->manager->hasError() ) { return response()->json(['message' => $this->manager->errorMessage()], $this->manager->errorCode()); } return response()->json([ 'message' => $this->manager->successMessage(), 'data' => [ 'comments' => $this->manager->comments() ] ], $this->manager->successCode()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function indexAction()\n {\n $limit = $this->Request()->getParam('limit', 1000);\n $offset = $this->Request()->getParam('start', 0);\n $sort = $this->Request()->getParam('sort', array());\n $filter = $this->Request()->getParam('filter', array());\n\n $result = $this->resource->getList($offset, $limit, $filter, $sort);\n\n $this->View()->assign($result);\n $this->View()->assign('success', true);\n }", "public function listing();", "function index() {\n\t\t$this->show_list();\n\t}", "public function actionList() {\n $this->_getList();\n }", "public function listAction()\n {\n $model = $this->_getPhotoModel();\n $entries = $model->fetchEntries($this->_getParam('page', 1));\n\n $this->view->url = 'http://' . $this->_request->getHttpHost() . $this->_request->getBaseUrl(); \n $this->view->paginator = $entries;\n }", "public function index()\n {\n $items = Item::all();\n return ItemForShowResource::collection($items);\n }", "public function index()\n {\n return Resource::collection(($this->getModel())::paginate(10));\n }", "function index()\n\t{\n\t\t$this->_list();\n\t\t$this->display();\n\t}", "public function listingAction(){\n if (!LoginHelper::isAdmin()){\n Router::redirect('home', '<p class=\"alert alert-danger\">Unauthorized</p>');\n }\n $this->view->render('patient/list', Patient::all());\n }", "public function index()\n {\n //\n $list = $this->obj->all();\n\n return $this->render('index', compact('list'));\n }", "public function action_index()\n\t{\n\t\t$this->template->title = 'Resources';\n\t\t$this->view = View::factory('admin/resource/index');\n\t\t$this->template->scripts[] = 'media/js/jquery.tablesorter.min.js';\n\t\t$this->template->scripts[] = 'media/js/admin/resource.js';\n\t\t\n\t\t$resources = Sprig::factory('resource')->load(NULL, FALSE);\n\t\tif (!empty($resources))\n\t\t{\n\t\t\t$this->view->resources = $resources->as_array();\n\t\t}\n\t}", "function listing()\n\t\t{\n\t\t// en $this->_view->_listado para poder acceder a el desde la vista.\n\t\t\t$this->_view->_listado = $listado = $this->_instrumentoModel->getInstrumento();\n\t\t\t$this->_view->render('listing', '', '',$this->_sidebar_menu);\n\t\t}", "public function listAction()\n {\n $em = $this->getDoctrine()->getManager();\n \n $todos = $em->getRepository(Todo::class)->findAll();\n \n return $this->render('todo/index.html.twig', array(\n 'todos' => $todos,\n ));\n }", "public function index()\n\t{\n $this->authorize('list', Instance::class);\n\n\t\treturn $this->ok($this->repo->paginate($this->request->all()));\n\t}", "public function actionRestList() {\n\t $this->doRestList();\n\t}", "public function listing()\n\t{\n\t\t$hospitalID = $this->request->getSession()->read(\"hospital_id\") ? $this->request->getSession()->read(\"hospital_id\") : \"\";\n\t\t\n\t\t$patientMonitored = 1;\n\t\t$patientActive = 1;\n\t\t\n\t\t//GET ALL PATIENTS\n\t\t$patientsData = $this->Patients->allPatients($hospitalID,$patientMonitored,$patientActive);\n\t\t//GET ALL PATIENTS\n\t\t\n\t\t//echo \"<pre>\"; print_r($patientsData);die;\n\t\t$this->set(compact(\"patientsData\"));\n\t}", "public function listAction()\n {\n $htmlpage = '<!DOCTYPE html>\n<html>\n <head>\n <meta charset=\"UTF-8\">\n <title>todos list!</title>\n </head>\n <body>\n <h1>todos list</h1>\n <p>Here are all your todos:</p>\n <ul>';\n \n $em = $this->getDoctrine()->getManager();\n $todos = $em->getRepository(Todo::class)->findAll();\n foreach($todos as $todo) {\n $htmlpage .= '<li>\n <a href=\"/todo/'.$todo->getid().'\">'.$todo->getTitle().'</a></li>';\n }\n $htmlpage .= '</ul>';\n\n $htmlpage .= '</body></html>';\n \n return new Response(\n $htmlpage,\n Response::HTTP_OK,\n array('content-type' => 'text/html')\n );\n }", "public function index()\n {\n // Get Persons\n $person = Person::paginate(10);\n\n //Return collection of person as a resource\n return PersonResource::collection($person);\n }", "public function listAction() {\n\t\t$this->view->title = $this->translator->translate(\"Invoice list\");\n\t\t$this->view->description = $this->translator->translate(\"Here you can see all the invoices.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"/admin/invoices/new/\", \"label\" => $this->translator->translate('New'), \"params\" => array('css' => null)));\r\n\t\t$this->datagrid->setConfig ( Invoices::grid() )->datagrid ();\n\t}", "public function listAll()\n\t{\n\t\t$this->render(self::PATH_VIEWS . '/list', [\n\t\t\t'pages' => $this->pagesDb->findAll('id', 'DESC'),\n\t\t]);\n\t}", "public function list()\n {\n // récupérer les données : toutes les catégories enregistrées\n $productList = Product::findAll();\n\n $this->show('product/list', [\n 'productList' => $productList\n ]);\n }", "public function index()\n {\n // CRUD -> Retrieve --> List\n // BREAD -> Browse Read Edit Add Delete\n // return Item::all();\n return view('list_items',compact('items'));\n }", "public function index()\n {\n // Get manufacturers\n $manufacturers = Manufacturer::orderBy('created_at', 'desc')->paginate(15);\n\n // Return collection of manufacturers as a resource\n return ManufacturerResource::collection($manufacturers);\n }", "public function index()\n {\n return ArtistResource::collection(Artist::orderBy('created_at', 'desc')->get());\n }", "public function indexAction() {\n\t\t$page = intval($this->getInput('page'));\n\t\t$perpage = $this->perpage;\n\t\t\n\t\tlist(,$files) = Lock_Service_FileType::getAllFileType();\n\t\t$data = array();\n\t\tforeach ($files as $key=>$value) {\n\t\t\t$data[$key]['id'] = $value['id'];\n\t\t\t$data[$key]['title'] = $value['name'];\n\t\t}\n\t\tlist($total, $filetype) = Lock_Service_FileType::getList($page, $perpage);\n\t\t$this->assign('filetype', $filetype);\n\t\t$this->assign('pager', Common::getPages($total, $page, $perpage, $this->actions['listUrl'].'/?'));\n\t\t$this->assign('data', json_encode($data));\n\t}", "public function listAction()\n {\n $qb = $this->getRepository()->queryAll();\n\n $view = new ImportListView;\n $view->imports = $qb->getQuery()->execute();\n\n return $this->templating->renderResponse('InfiniteImportBundle:Import:list.html.twig', array(\n 'data' => $view\n ));\n }", "public function index()\n\t{\n\t\t//Return model all()\n\t\t$instances = $this->decorator->getListingModels();\n\n\t\treturn View::make($this->listingView, array(\n\t\t\t'instances' => $instances,\n\t\t\t'controller' => get_class($this), \n\t\t\t'modelName' => class_basename(get_class($this->decorator->getModel())),\n\t\t\t'columns' => $this->getColumnsForInstances($instances),\n\t\t\t'editable' => $this->editable\n\t\t));\n\t}", "public function index()\n {\n return InfografiResources::collection(\n Infografi::orderBy('date', 'desc')->get()\n );\n }", "public function listAction()\n\t {\n\t\t\t$this->_forward('index');\n \n\t\t}", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function listAction()\n {\n $defaults = array(\n 'page' => null,\n 'order' => null,\n 'limit' => null,\n 'offset' => null,\n 'filter' => array(),\n );\n $body = $this->getRequest()->getBody();\n $options = $body + $defaults;\n\n // Process the options\n if (is_string($options['order'])) {\n $options['order'] = array_map('trim', explode(',', $options['order']));\n }\n if (is_string($options['page'])) {\n $options['page'] = (int)$options['page'];\n }\n if (is_string($options['limit'])) {\n $options['limit'] = (int)$options['limit'];\n }\n if (is_string($options['offset'])) {\n $options['offset'] = (int)$options['offset'];\n }\n $filter = $options['filter'];\n unset($options['filter']);\n\n $options = array_filter($options);\n\n return $this->getBinding()->find($filter, $options);\n }", "public function index()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the resources from the model */\n $resources = $this->resourcesList($this->model);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.index\")) {\n $view = \"admin.{$this->name}.index\";\n } else {\n $view = 'admin.includes.actions.index';\n }\n\n /* Display a listing of the resources */\n return view($view)\n ->with('resources', $resources)\n ->with('module', $this->module);\n }", "public function index()\n\t{\n\t\t$data['lists'] = $this->mdl_student->get_all();\n\t\t$this->template->set('title', 'Student Hostel List');\n\t\t$this->template->load('template', 'contents', 'student_hostel/student_hostel_list', $data);\n\t}", "public function index()\n {\n $modules = Module::all();\n return Resource::collection($modules);\n }", "public function index()\n {\n // List all resources from user entity\n $users = User::all();\n\n return $this->showAll($users);\n }", "public function index()\n {\n // Get todos\n $todos = Todo::orderBy('created_at', 'desc')->paginate(3);\n\n // Return collection of articles as a resource\n return TodoResource::collection($todos);\n }", "public function index()\n {\n return Resources::collection(Checking::paginate());\n }", "public function index()\n {\n return CourseListResource::collection(\n Course::query()->withoutGlobalScope('publish')\n ->latest()->paginate()\n );\n }", "public function index()\n {\n $cars = Car::paginate(15);\n return CarResource::collection($cars);\n }", "public function index()\n {\n // Get articles\n $articles = Article::orderBy('created_at', 'desc')->paginate(5);\n\n // Return collection of articles as a resource\n return ArticleResource::collection($articles);\n }", "public function index()\n {\n $authors = Author::paginate(10);\n\n return AuthorResource::collection($authors);\n }", "public function index()\n {\n //Get Books\n $books = Book::paginate(10);\n \n if ($books) {\n return (BookResource::collection($books))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n } else {\n return (BookResource::collection([]))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n }\n return view('index')->with('data', $books);\n }", "public function view(){\n\t\t$this->buildListing();\n\t}", "public function index()\n {\n $books = Book::latest()\n ->paginate(20);\n\n return BookResource::collection($books);\n }", "public function index()\n {\n $listing = Listing::orderBy('id', 'desc')->paginate(10);\n return view('listings.index')->withListings($listing);\n }", "public function listAction()\n {\n $this->_getSession()->setFormData([]);\n\n $this->_title($this->__('Training Cms'))\n ->_title($this->__('Pages'));\n\n $this->loadLayout();\n\n $this->_setActiveMenu('training_cms');\n $this->_addBreadcrumb($this->__('Training Cms'), $this->__('Training Cms'));\n $this->_addBreadcrumb($this->__('Pages'), $this->__('Pages'));\n\n $this->renderLayout();\n }", "public function index()\n {\n $services = $this->serviceRepository->paginate();\n\n return ServiceResource::collection($services);\n }", "public function index()\n {\n $resources = ResourceManagement::paginate(5);\n $users = User::get();\n\n return view('resources-mgmt/index', ['resources' => $resources, 'users' => $users]);\n }", "public function index()\n {\n $catalogs = Catalog::where('status', '=', Catalog::PUBLICADO)\n ->orderBy('id', 'DESC')->get();\n \n $data = CatalogResource::collection($catalogs);\n\n return [\n 'items' => $data,\n 'mensaje' => ''\n ];\n }", "public function listAction(){\n // In a controller this can be:\n // $this->request->getQuery('page', 'int'); // GET\n $currentPage = $this->request->getPost('pageindex', 'int'); // POST\n $pageNum = ($currentPage == null) ? 1 : $currentPage;\n\n // The data set to paginate\n $message = new Notice();\n $results = $message->getMsg4Admin();\n\n // Create a Model paginator, show 10 rows by page starting from $currentPage\n $paginator = new PaginatorArray(\n array(\n \"data\" => $results,\n \"limit\" => 10,\n \"page\" => $pageNum\n )\n );\n\n // Get the paginated results\n $page = $paginator->getPaginate();\n\n return $this->response->setJsonContent($page);\n\n }", "public function list()\n {\n try {\n return $this->success($this->service->list());\n } catch (\\Exception $exception) {\n return $this->error($exception->getMessage());\n }\n }", "public function index()\n {\n return $this->sendResponse(CrisisResource::collection(Crisis::paginate(10)), 'Data fetched successfully');\n }", "public function index()\n\t{\n\t\t$%Alias = new %Model();\n\t\t$params = array();\n\t\t\n\t\t$Paginator = new Paginator( $%Alias->findSize( $params ), $this->getLimit(), $this->getPage() );\n\t\t$this->getView()->set( '%Aliass', $%Alias->findList( $params, 'Id desc', $this->getOffset(), $this->getLimit() ) );\n\t\t$this->getView()->set( 'Paginator', $Paginator );\n\t\treturn $this->getView()->render();\n\t}", "public function listAction() {}", "public function index()\n {\n\n return RecipeResource::collection(Recipe::all());\n }", "public function index()\n {\n $this->indexPage('list-product', 'List Product');\n }", "public function listAction()\n {\t\n\t\t$this->removeSession();\n\t\t$this->verifySessionRights();\n\t\t$this->setActivity(\"List view\");\n $em = $this->getDoctrine()->getManager();\n $oRepClient = $em->getRepository('BoAdminBundle:Client');\n\t\t$nb_tc = $oRepClient->getTotal();\n\t\t//get page\n\t\t$page = $this->get('session')->get('page');\n\t\tif($page==null){\n\t\t\t$page=1;\n\t\t\t$this->get('session')->set('page',1);\n\t\t}\n\t\t//get number line per page\n\t\t$nb_cpp = $em->getRepository('BoAdminBundle:Param')->getParam(\"display_list_page_number\",1);\n\t\t$nb_pages = ceil($nb_tc/$nb_cpp);\n\t\t$offset = $page>0?($page-1) * $nb_cpp:0;\n\t\t$clients = $em->getRepository('BoAdminBundle:Client')->findBy(array(),array('id' => 'desc'),$nb_cpp,$offset);\n $form = $this->createForm('Bo\\AdminBundle\\Form\\ClientType', new Client());\n return $this->render('client/index.html.twig', array(\n 'clients' => $clients,\n\t\t\t'page' => $page, // forward current page to view,\n\t\t\t'nb_pages' => $nb_pages, //total number page,\n 'form' => $form->createView(),\n\t\t\t'total'=>$nb_tc, // record number.\n\t\t\t'nb_cpp' => $nb_cpp,// line's number to display\n\t\t\t'pm'=>\"contracts\",\n\t\t\t'sm'=>\"client\",\n ));\n }", "public function index()\n {\n return AcResource::collection(Ac::latest()->paginate()); //\n }", "public function executeList()\n {\n $this->setTemplate('list');\n }", "public function indexAction()\n {\n $books = Book::getAll();\n\n View::renderTemplate('Books/index.html', [\n 'books' => $books\n ]);\n }", "function listing() {\r\n\r\n }", "public function listar() {\n $rs = $this->model->listar();\n\n echo $this->toJson($rs);\n }", "public function index()\n {\n return BookResource::collection(Book::orderby('id')->get());\n }", "public function doRestList()\n {\n $this->outputHelper( \n 'Records Retrieved Successfully', \n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->orderBy($this->restSort)->limit($this->restLimit)->offset($this->restOffset)->findAll(),\n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->count()\n );\n\t}", "public function index()\n {\n $client = Client::paginate();\n return ClientResource::collection($client);\n }", "public function index()\n {\n return TagResource::collection(\n Tag::orderBy('name', 'ASC')->paginate(request('per_page', 10))\n );\n }", "public function _index(){\n\t $this->_list();\n\t}", "public function index()\n\t{\n\t\t$data['lists'] = $this->gallery_mdl->get_all();\n\t\t$this->template->set('title', 'Gallery');\n\t\t$this->template->render('template', 'list', $data);\n\t}", "function drush_restapi_list() {\n\n $resources = restapi_get_resources();\n $last_module = NULL;\n $rows = [\n [dt('Module'), dt('Path'), dt('Class')],\n ];\n\n foreach($resources as $resource) {\n if ($last_module != $resource->getModule()) {\n $module = $last_module = $resource->getModule();\n }\n else {\n $module = '';\n }\n $rows[] = [$module, $resource->getPath(), $resource->getClass()];\n }\n\n drush_print_table($rows, TRUE);\n drush_log(dt('Displaying !count total resources', [\n '!count' => count($resources),\n ]), 'ok');\n\n}", "public function index()\n {\n $this->booklist();\n }", "public function index()\n {\n //\n $accounts = accounts::paginate(15);\n\n //return the collection of employees as a resource\n return accountResource::collection($accounts);\n\n\n }", "public function index()\n {\n $items = Item::all();\n return view('items::list_items',compact('items'));\n }", "public function index()\n {\n // Get houses\n $houses = House::orderBy('created_at', 'desc')->paginate(self::PAGINATE);\n \n // Return collection of houses\n \n return HouseResource::collection($houses);\n }", "public function index()\n {\n $products = Product::paginate(6);\n return ProductResource::collection($products);\n }", "public function index() {\n $this->template->allFoundItems = Found::showAll();\n $this->template->display( 'index.html.php' );\n }", "public function indexAction() {\n $this->_forward('list');\n }", "public function index()\n {\n $data = Productcategory::paginate(10);\n\t\treturn ProductcategoryResource::Collection($data);\n }", "public function index()\n {\n return SongResource::collection(\\App\\Song::orderBy('created_at', 'desc')->get());\n }", "public function ListView()\n\t{\n\t\t\n\t\t// Requer permissão de acesso\n\t\t$this->RequirePermission(Usuario::$P_ADMIN,\n\t\t\t\t'SecureExample.LoginForm',\n\t\t\t\t'Autentique-se para acessar esta página',\n\t\t\t\t'Você não possui permissão para acessar essa página ou sua sessão expirou');\n\t\t\n\t\t//$usuario = Controller::GetCurrentUser();\n\t\t//$this->Assign('usuario',$usuario);\n\t\t$this->Render();\n\t}", "public function index () {\n permiss ( 'role.list' );\n\n $data = $this->entity\n ->orderBy('created_at', 'desc')->get();\n\n return new ModelResource($data);\n }", "public function showResources()\n {\n $resources = Resource::get();\n return view('resources', compact('resources'));\n }", "public function index()\n {\n //get articless\n $articles = Article::paginate(15);\n\n //Return collection of article has a resource\n return ArticleResource::collection($articles);\n\n }", "public function actionList() {\n header(\"Content-type: application/json\");\n $verb = $_SERVER[\"REQUEST_METHOD\"];\n\n if ($verb === 'GET') {\n echo \"{\\\"data\\\":\" . CJSON::encode(Donneur::model()->findAll()) . \"}\";\n } else if ($verb == 'POST') {\n if (Donneur::model()->exists('id' === $_POST['id'])) {\n $this->actionListUpdate($_POST);\n } else {\n $this->actionListPost();\n }\n } else if ($verb == 'DELETE') {\n $this->actionListDelete();\n }\n }", "public function list()\n {\n return $this->http->request(HttpMethods::GET, $this->endpoint);\n }", "public function indexAction(){\n $data = array(\n 'collection' => $this->model->getCollection(),\n \n ); \t\n return $this->getView($data);\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('DiverPriceLisrBundle:Items')->findAll();\n\n return $this->render('DiverPriceLisrBundle:Items:index.html.twig', array(\n 'entities' => $entities,\n ));\n }", "public function actionIndex()\n {\n $dataProvider = new ActiveDataProvider([\n 'query' => Slaves::find(),\n ]);\n\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function listAction() {\n\t\t// Recogemos el repositorio\n\t\t$repository = $this->getDoctrine() ->getRepository('AppBundle:Product');\n\t\n\t\t// Recuperamos todos los productos.\n\t\t$products = $repository->findAll();\n\t\t// Pasamos a la plantilla el aray products\n\t\treturn $this->render('product/listActionProduct.html.twig', array( 'products' => $products));\n\t\n\t}", "public function listAction()\n\t {\n\t\t$model = $this->_getModel();\n\t\t$result = $model->getLayouts();\t\n\t\t$page = (int)($this->_request->getParam('page')); \n\t\tif(count($result) > 0)\n\t\t{ \n\t\t\tGlobals::doPaging($result, $page, $this->view);\n\t\t}\n\t\t\t\t\n\t\t$this->view->page = $page;\n\t }", "public function actionList()\n {\n // get model\n $model = new $this->_model('search');\n $model->unsetAttributes();\n\n // set filter\n if (isset($_GET[$this->_model])) {\n $model->attributes = $_GET[$this->_model];\n }\n $model->u_cms_album_id = $_GET['album'];\n\n // search\n $dataProvider = $model->search(Yii::app()->language);\n // sort\n $sort = $dataProvider->getSort();\n // route\n $sort->route = $this->id . '/list';\n\n // pagination parameters\n $pagination = $dataProvider->getPagination();\n $pagination->route = $this->id . '/list';\n $pagination->pageSize = UInterfaceSetting::model()->getSettings($this->id . ':' . $this->module->id, Yii::app()->user->id)->page_size;\n $pagination->itemCount = $dataProvider->totalItemCount;\n\n // datas\n $datas = $dataProvider->getData();\n\n // related datas\n $relatedDatas = $this->_loadRelatedData();\n\n // template\n $template = isset($_REQUEST['partial']) ? 'list/_table' : 'list/main';\n\n $jsonParams = array();\n if (Yii::app()->request->isAjaxRequest) {\n // filters\n $filtersDatas = array();\n if (isset($_GET[$this->_model])) {\n $filtersDatas[$this->_model] = $_GET[$this->_model];\n }\n if (isset($_GET[$sort->sortVar])) {\n $filtersDatas[$sort->sortVar] = $_GET[$sort->sortVar];\n }\n\n $jsonParams = array(\n 'filters' => http_build_query($filtersDatas)\n );\n }\n\n $this->dynamicRender(\n $template,\n array(\n 'dataView' => new $this->crudComponents['listDataView'](\n $datas, $relatedDatas, $model, $sort, $pagination, $this\n )\n ),\n $jsonParams\n );\n }", "public function index()\n {\n return view('listings.index')->with('listings', Listing::all());\n }", "public function get_index()\n\t{\n\t\t$pages = Page::recent_available()->paginate(30);\n\t\t$table = Cello\\Presenter\\Page::table($pages);\n\t\t$data = array(\n\t\t\t'eloquent' => $pages,\n\t\t\t'table' => $table,\n\t\t);\n\n\t\tSite::set('title', __('cello::title.pages.list'));\n\n\t\treturn View::make('cello::api.resources.index', $data);\n\t}", "public function index()\n {\n return ProductResource::collection(Product::latest()->paginate(10));\n }", "public function index()\n {\n $category = GalleryCategory::paginate(15);\n\n // return collection of category as a resource.\n return Resource::collection($category);\n }", "public function index()\n {\n //\n $news = News::latest()->paginate(18);\n\n return NewsResource::collection($news);\n }", "public function indexAction() {\n\t\t$list_info = Zend_Registry::get('list_info');\n if (!Engine_Api::_()->core()->hasSubject('list_listing')) {\n return $this->setNoRender();\n }\n \n $this->view->expiry_setting = Engine_Api::_()->list()->expirySettings();\n\n //GET SUBJECT\n $this->view->list = $list = Engine_Api::_()->core()->getSubject('list_listing');\n\n\t\t//GET CATEGORY TABLE\n\t\t$this->view->tableCategory = Engine_Api::_()->getDbTable('categories', 'list');\n\n //GET CATEGORIES NAME\n\t\t$this->view->category_name = $this->view->subcategory_name = $this->view->subsubcategory_name = '';\n\n\t\tif(!empty($list->category_id)) {\n\t\t\tif($this->view->tableCategory->getCategory($list->category_id))\n\t\t\t$this->view->category_name = $this->view->tableCategory->getCategory($list->category_id)->category_name;\n\n\t\t\tif(!empty($list->subcategory_id)) {\n\t\t\t\tif($this->view->tableCategory->getCategory($list->subcategory_id))\n\t\t\t\t$this->view->subcategory_name = $this->view->tableCategory->getCategory($list->subcategory_id)->category_name;\n\n\t\t\t\tif(!empty($list->subsubcategory_id)) {\n\t\t\t\t\tif($this->view->tableCategory->getCategory($list->subsubcategory_id))\n\t\t\t\t\t$this->view->subsubcategory_name = $this->view->tableCategory->getCategory($list->subsubcategory_id)->category_name;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n //GET LISTING TAGS\n $this->view->listTags = $list->tags()->getTagMaps();\n\n\t\t//GET OTHER DETAILS\n\t\t$this->view->list_description = Zend_Registry::get('list_descriptions');\n $this->view->addHelperPath(APPLICATION_PATH . '/application/modules/Fields/View/Helper', 'Fields_View_Helper');\n $this->view->fieldStructure = Engine_Api::_()->fields()->getFieldsStructurePartial($list);\n\t\tif(empty($list_info)){ return $this->setNoRender(); }\n }", "public function index()\n {\n return $this->service->fetchResources(Author::class, 'authors');\n }", "public function index()\n {\n return view('admin.resources.index');\n }", "public function doRestList() {\n\t\t$this->outputHelper ( 'Collections Retrieved Successfully', $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->orderBy ( $this->restSort )->limit ( $this->restLimit )->offset ( $this->restOffset )->findAll (), $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->count () );\n\t}" ]
[ "0.7446777", "0.736227", "0.73005503", "0.72478926", "0.71631265", "0.71489686", "0.7131636", "0.7105969", "0.71029514", "0.7101372", "0.70508176", "0.6995128", "0.69890636", "0.6934895", "0.6900203", "0.6899281", "0.6891734", "0.6887235", "0.68670005", "0.6849741", "0.6830523", "0.6802689", "0.6797", "0.67957735", "0.67871135", "0.6760129", "0.67427456", "0.6730486", "0.67272323", "0.67255723", "0.67255723", "0.67255723", "0.67177945", "0.6707866", "0.6706713", "0.6704375", "0.6664782", "0.6662871", "0.6660302", "0.6659404", "0.6656656", "0.6653517", "0.6647965", "0.6620322", "0.66185474", "0.6618499", "0.6606105", "0.6600617", "0.65996987", "0.6594775", "0.6587389", "0.6585109", "0.6581641", "0.6581017", "0.6577157", "0.65747666", "0.6572513", "0.65721947", "0.6570553", "0.65646994", "0.6563556", "0.6554194", "0.65529937", "0.65460825", "0.65368485", "0.653429", "0.65328294", "0.6526759", "0.6526695", "0.6526284", "0.65191334", "0.65183175", "0.65174305", "0.651703", "0.65141153", "0.6507088", "0.65061647", "0.6504046", "0.64942145", "0.6491893", "0.64883405", "0.6486392", "0.6485077", "0.64846045", "0.6478858", "0.64756656", "0.64726377", "0.6471126", "0.64701074", "0.6467418", "0.6462195", "0.64618355", "0.6459199", "0.6457831", "0.6454631", "0.64533997", "0.6451915", "0.6450861", "0.6449301", "0.64492667", "0.64469045" ]
0.0
-1
Store a newly created resource in storage.
public function store(Request $request, Service $service) { $this->validate($request, [ 'body' => 'required' ]); // Try and insert the comment $this->manager->byUser($request->user()) ->forService($service) ->create($request->only(['body'])); if ( $this->manager->hasError() ) { return response()->json(['message' => $this->manager->errorMessage()], $this->manager->errorCode()); } return response()->json([ 'message' => $this->manager->successMessage(), 'data' => [ 'comment' => $this->manager->comment() ] ], $this->manager->successCode()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function store($data, Resource $resource);", "public function store()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'storeValidations')) {\n $this->request->validate($this->storeValidations());\n }\n\n /* Create a new resource */\n $resource = $this->model::create(Input::all());\n\n /* Redirect to newly created resource page */\n return redirect()\n ->route($this->name . '.edit', $resource->id)\n ->with(\n 'success',\n Lang::has($this->name . '.resource-created') ?\n $this->name . '.resource-created' :\n 'messages.alert.resource-created'\n );\n }", "public function store(CreateStorageRequest $request)\n {\n $this->storage->create($request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource created', ['name' => trans('product::storages.title.storages')]));\n }", "public function createStorage();", "public function store(StoreStorage $request)\n {\n $storage = Storage::create($request->all());\n $request->session()->flash('alert-success', 'Запись успешно добавлена!');\n return redirect()->route('storage.index');\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function store(Request $request, NebulaResource $resource): RedirectResponse\n {\n $this->authorize('create', $resource->model());\n\n $validated = $request->validate($resource->rules(\n $resource->createFields()\n ));\n\n $resource->storeQuery($resource->model(), $validated);\n\n $this->toast(__(':Resource created', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "function storeAndNew() {\n $this->store();\n }", "public function store(Request $request)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $validator = Validator::make($request->all(), [\n 'content' => 'required|string',\n 'image_link' => 'sometimes|url',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), [], 400);\n }\n\n $resource = new Resource;\n $resource->user_id = $currentUser['id'];\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->image_link = $request->get('imageLink');\n $resource->video_link = $request->get('videoLink');\n $resource->file_link = $request->get('fileLink');\n $resource->audio_link = $request->get('audioLink');\n $resource->tags = collect($request->get('tags'))->implode('text', ',');\n $resource->is_public = 0;\n $resource->save();\n $data['resource'] = $resource;\n\n if ($request->get('programId')) {\n $this->addToProgram($resource, $request->programId);\n // event(new NewLearningPathResourcePublished($resource, $invitee));\n }\n\n User::find($currentUser['id'])->increment('points', 2);\n\n return APIHandler::response(1, \"New resource has been created\", $data, 201);\n }", "public function store()\n {\n if (!$this->id) { // Insert\n $this->insertObject();\n } else { // Update\n $this->updateObject();\n }\n }", "public function store()\n\t{\n\t\t\n\t\t//\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}" ]
[ "0.72865677", "0.7145327", "0.71325725", "0.6640912", "0.66209733", "0.65685713", "0.652643", "0.65095705", "0.64490104", "0.637569", "0.63736665", "0.63657933", "0.63657933", "0.63657933", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437" ]
0.0
-1
Update the specified resource in storage.
public function update(Request $request, Service $service, Comment $comment) { return ['message' => 'Not implemented.']; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function updateShopifyResource() {\n $this->saving();\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'PUT',\n 'DATA' => [\n static::getResourceSingularName() => $this->shopifyData\n ]\n ]);\n }", "public function update(Request $request, Resource $resource)\n {\n $request->validate([\n 'name' => 'required',\n 'description' => 'required|string',\n 'file' => 'required|mimes:jpg,jpeg,png,doc,docx,pdf,ppt,txt',\n ]);\n\n $resource->update($request->all());\n\n if ( $request->hasFile('file') ) {\n $resource = 'resource-'.time().'.'.$request->file('file')->extension();\n $request->file->storeAs('resources', $resource,'public');\n $resource->file = $resource;\n }\n\n if ( $resource->save() ) {\n return redirect()->route('admin.resources.index')->with('success', 'Resource updated');\n } else {\n return redirect()->route('admin.resources.index')->with('error', 'Something went wrong');\n }\n }", "public function update(Request $request, Resource $resource)\n {\n //\n }", "public function updateStream($resource);", "public function update(Request $request, Storage $storage)\n {\n $storage->product_id = $request->product_id;\n $storage->amount = $request->amount;\n\n $storage->save();\n\n return redirect()->route('storages.index');\n }", "protected function updateImageResource($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n $this->deleteResource($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update(Storage $storage, UpdateStorageRequest $request)\n {\n $this->storage->update($storage, $request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource updated', ['name' => trans('product::storages.title.storages')]));\n }", "public function update(StoreStorage $request, Storage $storage)\n {\n $storage->fill($request->all())->save();\n $request->session()->flash('alert-success', 'Запись успешно обновлена!');\n return redirect()->route('storage.index');\n }", "public function update_asset($id, Request $request){\n \t\tif(!Auth::user()){\n\t\t\treturn redirect('/');\n\t\t}\n \t\t$asset = Storage::find($id);\n \t\t$asset->name = $request->name;\n \t\t$asset->quantity = $request->quantity;\n \t\t$asset->category_id = $request->category;\n \t\tif($request->file('image') != null){\n\t\t\t$image = $request->file('image');\n\t\t\t$image_name = time(). \".\" . $image->getClientOriginalExtension();\n\t\t\t$destination = \"images/\";\n\t\t\t$image->move($destination, $image_name);\n\t\t\t$asset->image_url = $destination.$image_name;\n\t\t} \n\t\t$asset->save();\n\t\tsession()->flash('success_message', 'Item Updated successfully');\n\t\treturn redirect(\"/storage\");\n \t}", "public function update(Request $request, Flight $exercise, FlightResource $resource)\n {\n $request->validate([\n 'display_name' => 'required|string|max:100',\n 'file' => 'nullable|file|max:10240|mimes:pdf',\n 'uri' => 'nullable|url|max:255',\n ]);\n\n if ($resource->type === 'file' && $request->file('file')) {\n Storage::drive('public')->delete($resource->resource);\n $resource->resource = $request->file('file')->store('smartcars/exercises/resources', ['disk' => 'public']);\n } elseif ($resource->type === 'uri' && $request->input('uri')) {\n $resource->resource = $request->input('uri');\n }\n\n $resource->save();\n\n return redirect()->route('adm.smartcars.exercises.resources.index', $exercise)\n ->with('success', 'Resource edited successfully.');\n }", "public function update(Request $request, $id)\n {\n $validator = Validator::make($request->all(), [\n 'title' => 'required|string',\n 'content' => 'required|string',\n 'mentoring_area_id' => 'required|integer',\n 'featured_image_uri' => 'string',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n \n $resource = Resource::find($id);\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->featured_image_uri = $request->get('featured_image_uri');\n $resource->updated_at = \\Carbon\\Carbon::now();\n $resource->mentoring_area_id = $request->get('mentoring_area_id');\n $resource->save();\n $data['resource'] = $resource;\n return APIHandler::response(1, \"Resource has been updated\");\n }", "protected function updateVideoResource($fileName, $videoId, $storage, $premium=1)\n {\n //Get video name and storage location for video\n $video = Video::where('id', '=', $videoId)->first();\n\n //Check the storage medium\n if($storage == 'vimeo' || $storage == 'youtube')\n {\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n else\n {\n if($video['storage'] == 'local' || $video['storage'] == 's3')\n {\n //Delete old video\n $this->deleteResource($video->name, $video->storage);\n }\n \n //Store the new video\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n }", "public function put($resource, $with=[]){\n return $this->fetch($resource, self::PUT, $with);\n }", "public function update($id, $resource) {\n SCA::$logger->log(\"update resource\");\n return $this->orders_service->update($id, $resource);\n }", "public function update($path);", "public function update($id, $resource)\n {\n SCA::$logger->log(\"Entering update()\");\n //check whether it is an sdo or an xml string.\n if ($resource instanceof SDO_DataObjectImpl) {\n //if the thing received is an sdo convert it to xml\n if ($this->xml_das !== null) {\n $xml = SCA_Helper::sdoToXml($this->xml_das, $resource);\n } else {\n throw new SCA_RuntimeException(\n 'Trying to update a resource with SDO but ' .\n 'no types specified for reference'\n );\n }\n } else {\n $xml = $resource;\n }\n\n $slash_if_needed = ('/' === $this->target_url[strlen($this->target_url)-1])?'':'/';\n\n $handle = curl_init($this->target_url.$slash_if_needed.\"$id\");\n curl_setopt($handle, CURLOPT_HEADER, false);\n curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($handle, CURLOPT_CUSTOMREQUEST, \"PUT\");\n curl_setopt($handle, CURLOPT_POSTFIELDS, $xml);\n\n //replace with Content-Type: atom whatever\n $headers = array(\"User-Agent: SCA\",\n \"Content-Type: text/xml;\",\n \"Accept: text/plain\");\n curl_setopt($handle, CURLOPT_HTTPHEADER, $headers);\n\n $result = curl_exec($handle);\n\n $response_http_code = curl_getinfo($handle, CURLINFO_HTTP_CODE);\n\n curl_close($handle);\n\n $response_exception = $this->buildResponseException($response_http_code, '200');\n\n if ($response_exception != null) {\n throw $response_exception;\n } else {\n //update does not return anything in the body\n return true;\n }\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'name' => 'required',\n 'link' => 'required',\n 'description' => 'required'\n ]);\n\n $resource = Resource::find($id);\n $resource->name = $request->name;\n $resource->type_id = $request->type_id;\n $resource->has_cost = ($request->has('has_cost')) ? 1 : 0;\n $resource->language_id = $request->language_id;\n $resource->link = $request->link;\n $resource->description = $request->description;\n $resource->tags = '';\n\n $resource->save();\n //return back()->with('success', 'Recurso actualizado satisfactoriamente');\n return redirect('/resource')->with('success', 'Recurso actualizado satisfactoriamente');\n }", "public function update(Request $request, $id)\n {\n $oldProduct = Product::findOrFail($id);\n $data = $request->all();\n if(isset($data['img'])){\n // $file = $request->file('photo');\n // return $file;\n $imgName = time().'.'.$request->img->extension();\n $data['img'] = $imgName;\n // Storage::putFile('spares', $file);\n $path = $request->img->storeAs('public/uploads', $imgName); //in Storage\n\n //delete old file\n if($oldProduct->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$oldProduct->img);\n // return 'deleted';\n }\n \n }else{\n $data['img'] = $oldProduct->img;\n }\n $oldProduct->update($data);\n return redirect()->route('product.index'); \n\n }", "public function update($request, $id) {\n\t\t\t$image = $request['photo'];\n\t\t\tif($image !== null) {\n\t\t\t\t$name = time().'.' . explode('/', explode(':', substr($image, 0, strpos($image, ';')))[1])[1];\n\t\t\t\t\\Image::make($request['photo'])->save(public_path('storage/products/').$name);\n\t\t\t\t$request['photo'] = $name;\n\t\t\t} else {\n\t\t\t\t$currenPhoto = Product::all()->where('id', $id)->first();\n\t\t\t\t$request['photo'] = $currenPhoto->photo;\n\t\t\t}\n return $this->product->update($id, $request);\n\t}", "public function updateStream($path, $resource, Config $config)\n {\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function updateResourceIndex(&$resource) {\n if ($this->connector != null) {\n\n // STEP 1: Update or insert this resource as a node:\n $this->logger->addDebug(\"Updating/Inserting Node into Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} }) SET a.title = {title}, a.version = {version}, a.href = {href}\n return a;\",\n [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n );\n\n // Check to see if anything was added\n $records = $result->getRecords();\n if (empty($records)) {\n // Must create this record instead\n $result = $this->connector->run(\"CREATE (n:Resource) SET n += {infos};\",\n [\n \"infos\" => [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n ]\n );\n }\n\n // STEP 2: Update or insert the resource's link to holding repository\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} })-[r:HIRELATION]->()\n return r;\",\n [\n 'id' => $resource->getID(),\n ]\n );\n $records = $result->getRecords();\n if (!empty($records)) {\n // delete the one there so that we can add the correct one (just in case)\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}})-[r:HIRELATION]->() delete r;\",\n [\n 'id' => $resource->getID()\n ]\n );\n\n }\n\n // If resource has a repository, then add a link\n if ($resource->getRepository() != null && $resource->getRepository()->getID() != null) {\n $this->connector->run(\"MATCH (a:Identity {id: {id1} }) MATCH (b:Resource {id: {id2} }) CREATE (b)-[r:HIRELATION]->(a);\",\n [\n 'id1' => (string) $resource->getRepository()->getID(),\n 'id2' => $resource->getID()\n ]);\n }\n }\n }", "public function update($data) {}", "public function update($data) {}", "public function putStream($resource);", "public function update(Request $request, NebulaResource $resource, $item): RedirectResponse\n {\n $this->authorize('update', $item);\n\n $validated = $request->validate($resource->rules(\n $resource->editFields()\n ));\n\n $resource->updateQuery($item, $validated);\n\n $this->toast(__(':Resource updated', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function update($entity);", "public function update($entity);", "public function setResource($resource);", "public function updateStream($path, $resource, Config $config)\n {\n return $this->upload($path, $resource, $config);\n }", "public function isUpdateResource();", "public function update(Request $request, $id)\n {\n $device = Device::findOrFail($id);\n $device->fill($request->all());\n if ($request->hasFile('icon')) {\n if ($device->hasMedia('icon')) {\n $device->deleteMedia($device->getFirstMedia('icon'));\n }\n $device->addMediaFromRequest('icon')->toMediaCollection('icon');\n }\n $device->save();\n return new DeviceResource($device);\n }", "public function update(Request $request, $id)\n {\n //\n $product = Product::findOrFail($id);\n \n $product->update($request->all());\n \n $file = $request->file('url_image')->move('upload', $request->file('url_image')->getClientOriginalName());\n\n Product::where('id',$id)->update(['url_image'=>$file]);\n \n \\Session::flash('flash_message', 'Edit product successfully.'); \n \n //cũ : return redirect('articles');\n return redirect()->route('products.index');\n }", "public function store($data, Resource $resource);", "public function update(Request $request, $id)\n {\n \n $product = Product::find($id);\n\n\n $product->fill($request->all())->save();\n\n //Verificamos que tenemos una imagen\n if($request->file('photo_1')){\n\n\n //En caso de tenerla la guardamos en la clase Storage en la carpeta public en la carpeta image.\n $path = Storage::disk('public')->put('photo_1',$request->file('photo_1'));\n\n //Actualizamos el Post que acabamos de crear\n $product->fill(['photo_1' => asset($path)])->save();\n\n }\n\n\n return redirect()->route('products.index')->with('info', 'Producto actualizado exitosamente!');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n if (\\Input::hasFile('image')) {\n $this->imgsave($request, $product);\n }\n\n\n if (!empty($request->input('tags'))) {\n $product->tags()->sync($request->input('tags'));\n } else {\n $product->tags()->detach();\n }\n\n $product->update($request->all());\n\n return redirect()->to('dashboard/product')->with('message', 'update success');\n }", "public function put($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'PUT');\n }", "public function update($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'updateValidations')) {\n $this->request->validate($this->updateValidations());\n }\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Update the specified resource */\n $resource->update(Input::all());\n\n /* Redirect back */\n return redirect()->back()\n ->with(\n 'info',\n Lang::has($this->name . '.resource-updated') ?\n $this->name . '.resource-updated' :\n 'messages.alert.resource-updated'\n );\n }", "public function putResponse($request)\n {\n $idSearched = $this->searcher->searchResourceIndex(\n $request, \n $this->db[$request['resource']]\n );\n if ($idSearched) {\n $resource = $this->db[$request['resource']][$idSearched];\n $bodyInput = json_decode($this->standardInput, true);\n $resource = BodyRequest::canApplyBody($bodyInput);\n $resource['id'] = (int)$request['param'];\n foreach($resource as $key => $value) {\n $this->db[$request['resource']][$idSearched][$key] = $value;\n }\n file_put_contents(DB_PATH, json_encode($this->db));\n }\n }", "public function update(Storedataset $request, dataset $dataset){\n $dataset->title = $request->input('title');\n $dataset->caption = $request->input('caption');\n $dataset->file_url = $request->input('file_url');\n $dataset->type = $request->input('type');\n $dataset->status = $request->input('status');\n $dataset->publication_id = $request->input('publication_id');\n\n $dataset->save();\n\n return redirect()->route('datasets.show', ['dataset' => $dataset]);\n }", "public function update(Request $request, $id)\n\n {\n ResourceManagement::findOrFail($id);\n $constraints = [\n 'title' => 'required|max:100',\n 'url'=> 'required|max:191',\n 'content' => 'required'\n ];\n\n $input = [\n 'title' => $request['title'],\n 'url' => $request['url'],\n 'content' => $request['content'],\n 'type' => $request['type'],\n 'level' => $request['level'],\n 'user_id' => $request['user']\n ];\n// $this->validate($input, $constraints);\n ResourceManagement::where('id', $id)\n ->update($input);\n\n return redirect()->intended('/resource-management');\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'title' => 'required',\n 'description' => 'required|string',\n 'price' => 'required|numeric',\n 'reference'=>'required'\n ]);\n \n $product = Product::find($id);\n $product->update($request->all());\n \n $im = $request->file('picture');\n \n if (!empty($im)) {\n \n $link = $request->file('picture')->store('images');\n \n \n $product->update([\n 'url_image' => $link,\n ]);\n } \n //dump($request->all());\n return redirect()->route('product.index')->with('message', 'Article modifié avec succès');\n }", "public function update(StoreOrUpdateAsset $request, Asset $asset)\n {\n if (Storage::exists($asset->path) && !Storage::delete($asset->path)) {\n abort(500);\n }\n\n $file = $request->file('file');\n $path = $file->store('assets');\n\n if (!$path) {\n abort(500);\n }\n\n // We wonder if we should delete the old file or not...\n\n $asset->name = $file->getClientOriginalName();\n $asset->size = $file->getSize();\n $asset->type = $file->getMimeType();\n $asset->path = $path;\n\n if ($asset->save()) {\n flash('The asset has been saved.')->success();\n } else {\n abort(500);\n }\n\n return redirect('/admin/assets');\n }", "public function update(FoodRecipeRequest $request, $id)\n {\n $foodRecipe = FoodRecipe::with('ingredients','cookingProcesses')->findOrFail($id);\n if ($request->input('name')!= null)\n $foodRecipe->name = $request->input('name');\n if ($request->input('detail')!= null)\n $foodRecipe->detail = $request->input('detail');\n if($request->file('photo') != null) {\n $old_file = $foodRecipe->photo;\n if($old_file != null){\n $path = public_path().'/storage/'.$old_file;\n File::delete($path);\n }\n $file = $request->file('photo');\n $name = '/foodRecipe/' . Carbon::now()->format(\"dnY-Hisu\") . \".\" . $file->extension();\n $file->storePubliclyAs('public', $name);\n $foodRecipe->photo = $name;\n }\n $foodRecipe->save();\n return new FoodRecipeResource($foodRecipe);\n }", "public function update(StorageTypeRequest $request, $id)\n {\n try {\n $this->service->updateStorageType($request, $id);\n return $this->NoContent();\n } catch (EntityNotFoundException $e) {\n \\Log::error($e->getMessage());\n return $this->NotFound($e->getMessage());\n } catch(\\QueryException $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n } catch(Exception $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n }\n }", "public function update(Request $request, $id)\n {\n //validation\n $this->validate(request(),[\n 'image' => 'image'\n ]);\n\n $slider = HomeSliders::find($id);\n \n $slider->link = request('link');\n\n //get old image to delete if updated\n $oldImage = request('oldImage');\n //get the new image\n $NewImage=$request->file('image');\n\n if($NewImage)\n {\n $filenameToStore= helpers::updatePhoto('image','homeSliders',$request);\n $slider->image=$filenameToStore;\n\n Storage::delete('public/Images/homeSliders/'.$oldImage);\n }\n\n $slider->save();\n\n Alert::success(config('app.name'), trans('messages.Updated Successfully') );\n return redirect()->route('admin.homeSlider',$slider->type);\n }", "public function update(Qstore $request, $id)\n {\n //\n }", "public function update(IEntity $entity);", "protected function performUpdate(): bool\n {\n // Abort if resource does not support update operations\n if (!$this->isUpdatable()) {\n throw new UnsupportedOperation(sprintf('API does not support update operation for %s resources', $this->resourceNameSingular()));\n }\n\n $id = $this->id();\n $prepared = $this->prepareBeforeUpdate($this->toArray());\n\n $payload = [\n $this->resourceNameSingular() => $prepared\n ];\n\n $response = $this\n ->request()\n ->put($this->endpoint($id), $payload);\n\n // Extract and (re)populate resource (if possible)\n // Note: Unlike the \"create\" method, Redmine does NOT\n // appear to send back a full resource when it has been\n // successfully updated.\n $this->fill(\n $this->decodeSingle($response)\n );\n\n return true;\n }", "public function update($request, $id);", "function put($resource, $data = null) {\r\n\t\t\r\n\t\tif(isset($data)) {\r\n\t\t\t$this->request_body = $data;\r\n\t\t}\r\n\r\n\t\t// make the call chief\r\n\t\t$this->exec ( \"PUT\", '/' . $resource );\r\n\r\n\t\t// check the request status\r\n\t\tif($this->status_code != 200){\r\n\t\t\t$this->Logger->error(\r\n\t\t\t\tsprintf(\r\n\t\t\t\t\t'GET Call for resource \\'%s\\' Failed.\r\n\t\t\t\t\tStatus: %d,\r\n\t\t\t\t\tRequest: %s\r\n\t\t\t\t\tAPI Error Message: \r\n\t\t\t\t\t%s',\r\n\t\t\t\t\t$resource,\r\n\t\t\t\t\t$this->status_code,\r\n\t\t\t\t\t$this->request_body_raw,\r\n\t\t\t\t\t$this->response_body\r\n\t\t\t\t)\r\n\t\t\t);\r\n\t\t\tthrow new Exception($this->response_body);\r\n\t\t} else {\r\n\t\t\treturn $this->response_parsed;\r\n\t\t}\r\n\t}", "public function updateEntities($resource)\n {\n $json = [\n 'resource' => $resource,\n ];\n $request = $this->createRequest('PUT', '/entities', ['json' => $json]);\n $response = $this->send($request);\n return $response;\n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->writeStream($path, $resource, $config);\n }", "public function update(Request $request, $id)\n {\n\n $product = Product::findOrFail($id);\n $product->name = $request['name'];\n $product->price = $request['price'];\n $product->stock = $request['stock'];\n $product->description = $request['description'];\n\n $file = $request->file('image');\n $fileName = $file->getClientOriginalName();\n if($fileName != $product->image){\n $request->file('image')->move('images/',$fileName);\n $product->image = $fileName;\n }\n\n $product->save();\n\n return redirect()->route('products.show',\n $product->id)->with('flash_message',\n 'Article, '. $product->name.' updated');\n }", "protected function handleUpdate()\n {\n $resource = $this->argument('resource');\n $action = $this->option('action');\n $startPage = (int)$this->option('startPage');\n $perPage = (int)$this->option('perPage');\n\n try {\n $harvest = Harvest::where('resource', $resource)->where('action', $action)->firstOrFail();\n } catch (\\Exception $e) {\n $this->info('There is no existing action for updating ' . ucwords($action) . ' ' . ucwords($resource) . '.');\n exit('Nothing was updated.');\n }\n\n $options = [\n 'startPage' => $startPage,\n 'perPage' => $perPage,\n 'lastRun' => $harvest->last_run_at\n ];\n\n // If a lastRun was given use that\n // OR if this has never been run before use 2001-01-01\n if (!empty($this->option('lastRun'))) {\n $options['lastRun'] = new Carbon($this->option('lastRun'));\n } elseif (is_null($options['lastRun'])) {\n $options['lastRun'] = new Carbon('2001-01-01');\n }\n\n $job = new UpdateResourceJob(\n $harvest,\n $options\n );\n\n $message = 'Updating ' . $action . ' ' . $resource . ' ' . $perPage . ' at a time';\n if (isset($lastRun)) {\n $message .= ' with entries updated since ' . $lastRun->format('r');\n }\n $this->info($message);\n $this->dispatch($job);\n }", "abstract public function put($data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function testUpdateSupplierUsingPUT()\n {\n }", "public function update(Request $request, $id)\n {\n $storageplace = Storageplace::findOrFail($id);\n $storageplace->update($request->only(['storageplace']));\n return $storageplace;\n }", "public function updateRelatedImage(Request $request, $id)\n {\n // Delete display image in Storage\n Validator::make($request->all(), ['photos' => \"required|file|image|mimes:jpg,png,jpeg|max:5000\"])->validate();\n\n\n if ($request->hasFile(\"photos\")) {\n\n $photo = ProductsPhoto::find($id);\n $imageName = $photo->photos;\n $exists = Storage::disk('local')->exists(\"public/product_images/\" . $photo->photos);\n\n //delete old image\n if ($exists) {\n Storage::delete('public/product_images/' . $imageName);\n }\n\n //upload new image\n $ext = $request->file('photos')->getClientOriginalExtension(); //jpg\n\n $request->photos->storeAs(\"public/product_images/\", $imageName);\n\n $arrayToUpdate = array('photos' => $imageName);\n DB::table('products_photos')->where('id', $id)->update($arrayToUpdate);\n\n return redirect()->route(\"adminDisplayRelatedImageForm\", ['id' => $photo->product_id]);\n } else {\n\n $error = \"NO Image was Selected\";\n return $error;\n }\n }", "public function update(Request $request, $id)\n {\n $skill = Skill::findOrFail($id);\n\n $skill->skill = $request->skill;\n\n if ($request->hasFile('image')) {\n \\Cloudder::upload($request->file('image'));\n $c=\\Cloudder::getResult();\n // $image = $request->file('image');\n // $filename = time() . '.' . $image->getClientOriginalExtension();\n // $location = public_path('images/' . $filename);\n // Image::make($image)->save($location);\n\n $skill->image = $c['url'];\n }\n\n $skill->save();\n\n Session::flash('success', 'Successsfully updated your skill!');\n return redirect()->route('skills.index');\n }", "public function updateStream($path, $resource, Config $config = null)\n {\n $contents = stream_get_contents($resource);\n\n return $this->write($path, $contents, $config);\n }", "public abstract function update($object);", "public static function update($id, $file)\n {\n Image::delete($id);\n\n Image::save($file);\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n $image = $product->image;\n if($request->hasFile('image')){\n $image = $request->file('image')->store('files');\n \\Storage::delete($product->image);\n } \n $product->name = $request->get('name');\n $product->price = $request->get('price');\n $product->description = $request->get('description');\n $product->additional_info = $request->get('additional_info');\n $product->category_id = $request->get('category');\n $product->subcategory_id = $request->get('subcategory');\n $product->image = $image;\n $product->save();\n return redirect()->back();\n }", "public function update(Request $request, $id)\n {\n $sli=Slider::find($id);\n $sli->sort_order=$request->input('sort_order');\n $image = $request->file('slider');\n if($image == ''){\n $image = $sli->slider;\n }else{\n $image = base64_encode(file_get_contents($request->file('slider')));\n }\n $sli->slider = $image;\n $sli->save();\n return redirect()->back();\n }", "public function update(ProductRequest $request, $id)\n {\n $input = Product::find($id);\n $data = $request->all();\n if ($file = $request->file('product_photo')){\n $name = time().$file->getClientOriginalName();\n $file->move('product_image',$name);\n $data['product_photo']=$name;\n// $input->update($data);\n }\n $input->update($data);\n return redirect('admin/products/');\n }", "public function update(Request $request, $id)\n {\n $volume = $this->findVolume($id);\n\n if(count($volume) > 0) {\n $volume->str_volume_name = $request->str_volume_name;\n\n $volume->save();\n }\n\n return response()\n ->json(\n array(\n 'message' => 'Volume is successfully updated.',\n 'volume' => $volume\n ),\n 201\n );\n }", "public function update(Request $request, $id)\n {\n $product = ProductModel::find($id);\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->stock = $request->stock;\n\n if($request->image!=null){\n $imageName = time().'.'.$request->image->extension();\n $request->image->move(public_path('images'), $imageName);\n $product->image = \"/images/\".$imageName;\n }\n $product->save();\n return redirect(\"/products/index\")->with('success','Product has been updated');\n }", "public function update()\n {\n $accessory = Accessories::find(request('id'));\n\n if ($accessory == null) {\n return response()->json([\"error\" => \"aksesuaras nerastas\"], 404);\n }\n\n $this->validateData();\n $path = $accessory->src;\n\n if (request()->hasFile('src')) {\n\n if (Storage::disk('public')->exists($accessory->src)) {\n Storage::disk('public')->delete($accessory->src);\n }\n $path = request()->file('src')->store('accessoriesImages', 'public');\n }\n\n $accessory->update(array_merge($this->validateData(), ['src' => $path]));\n\n return response()->json([\"data\" => $accessory], 200);\n }", "public function update(ProductStoreRequest $request,$id)\n {\n $data = $request->validated();\n $product = Product::where('id',$id);\n $product->update($data);\n return response(\"Producto actualizado con éxito\",200);\n }", "public function update($entity)\n {\n \n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->write($path,stream_get_contents($resource),$config);\n }", "public function update($id, Request $request)\n {\n date_default_timezone_set('Asia/Taipei');\n $data = $request->all();\n $dbData = Product::find($id);\n $myfile = Storage::disk('local');\n if ($request->hasFile('img')) {\n $file = $request->file('img');\n $path = $myfile->putFile('public', $file);\n $data['img'] = $myfile->url($path);\n File::delete(public_path($dbData->img));\n }\n $dbData->update($data);\n\n if ($request->hasFile('imgs')) {\n // $this->fetchDestroyByProdId($id);\n $localS = Storage::disk('local');\n\n $fileS = $request->file('imgs');\n $imgs = [];\n foreach ($fileS as $i) {\n $pathS = $localS->putFile('public', $i);\n $imgs[] = $localS->url($pathS);\n }\n foreach ($imgs as $img) {\n ProductImg::create([\n 'product_id' => $id,\n 'img' => $img\n ]);\n }\n }\n\n return redirect()->route('admin');\n }", "public function update(Request $request, Product $product)\n { $remfile= $product->image;\n if($request->filep){\n $product->image=$request->filep;\n File::delete(storage_path('app/public/products/'.$remfile));\n }else{\n $product->image=$remfile;\n }\n //rmdir(storage_path('app/public/products/'.$remfile));\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->save();\n sleep(3);\n toast('Details updated successfully','info');\n return redirect('/products');\n }", "public function update($id, $input);", "public function update(ProductRequest $request,int $id): ProductResource\n {\n $attributes = $request->only('supplier_id', 'name', 'warehouses');\n\n return new ProductResource($this->productRepository->update($id, $attributes)); }", "public function update(Request $request, $id)\n {\n $slider=new Slider;\n $slider=$slider::find($id);\n \n \n if($file =$request->file('slider')){\n if(Storage::delete('public/slider/'.$slider->slider)){\n\n //Get file original name//\n \n$original_name=$file->getClientOriginalName();\n\n //Get just the file name\n$filename=pathinfo($original_name,PATHINFO_FILENAME);\n\n//Create new file name\n$name=$filename.'_'.time().'.'.$file->getClientOriginalExtension();\n\n $destination='public/slider';\n $path=$request->slider->storeAs($destination,$name);\n $slider->slider=$name;\n $slider->save();\n return redirect('Admin/slider');\n\n }\n }\n}", "public function update(Request $request, $id)\n {/* dd($request->all()); */\n $acheivePic = $this->acheiveRepo->find($id);\n $acheive = $request->except('_method', '_token', 'photo', 'ar', 'en');\n $acheiveTrans = $request->only('ar', 'en');\n\n if ($request->hasFile('icon')) {\n // Delete old image first.\n $oldPic = public_path() . '/images/acheives/' . $acheivePic->icon;\n File::delete($oldPic);\n\n // Save the new one.\n $image = $request->file('icon');\n $imageName = $this->upload($image, 'acheives');\n $acheive['icon'] = $imageName;\n }\n\n $this->acheiveRepo->update($id, $acheive, $acheiveTrans);\n\n return redirect('admin-panel/widgets/acheive')->with('updated', 'updated');\n }", "public function update(Request $request, $id)\n {\n $data = $request->all();\n extract($data);\n\n $productVarient = new ProductVariant();\n $productVarient = $productVarient->find($id);\n $productVarient->vendor_id = auth()->user()->id;\n $productVarient->description = $prod_desc;\n $productVarient->price = $price;\n\n if(request()->hasFile('photo')){\n $image = request()->file('photo')->getClientOriginalName();\n $imageNewName = auth()->user()->id.'-'.$image;\n $file = request()->file('photo');\n $file->storeAs('images/product',$imageNewName, ['disk' => 'public']);\n $productVarient->image = $imageNewName;\n }\n \n $productVarient->save();\n\n return back()->withStatus(__('Product successfully updated.'));\n }", "public function update(Request $request, $id)\n {\n //if upload new image, delete old image\n $myfile=$request->old_photo;\n if($request->hasfile('photo'))\n {\n $imageName=time().'.'.$request->photo->extension();\n $name=$request->old_photo;\n\n if(file_exists(public_path($name))){\n unlink(public_path($name));\n $request->photo->move(public_path('backendtemplate/truefalseimg'),$imageName);\n $myfile='backendtemplate/truefalseimg/'.$imageName;\n }\n }\n //Update Data\n $truefalsequestion=TrueFalseQuestion::find($id);\n $truefalsequestion->name=$request->name;\n $truefalsequestion->photo=$myfile;\n $truefalsequestion->answer = $request->answer;\n $truefalsequestion->question_id = $request->question;\n $truefalsequestion->save();\n\n //Redirect\n return redirect()->route('truefalsequestions.index'); \n }", "public function update($id);", "public function update($id);", "private function update()\n {\n $this->data = $this->updateData($this->data, $this->actions);\n $this->actions = [];\n }", "public function put($path, $data = null);", "public function update(Request $request, $id)\n {\n $request->validate([\n 'path_image'=>'image',\n 'status'=>'required|in:0,1'\n ]);\n $slider=Slider::whereId($id)->first();\n if (is_null($slider)){\n return redirect()->route('sliders.index')->with('error','Slider does not exist');\n }\n try {\n if ($request->hasFile('path_image')){\n $file = $request->file('path_image');\n\n $image_path= $file->store('/sliders',[\n 'disk'=>'uploads'\n ]);\n Storage::disk('uploads')->delete($slider->image);\n\n $request->merge([\n 'image'=>$image_path,\n ]);\n }\n\n $slider->update( $request->only(['status','image']));\n return redirect()->route('sliders.index')->with('success','Updated successful');\n }catch (\\Exception $exception){\n return redirect()->route('sliders.index')->with(['error'=>'Something error try again']);\n\n }\n }", "public function update() {\n $this->accessory->update($this->accessory_params());\n\n if ($this->accessory->is_valid()) {\n $this->update_accessory_image($this->accessory);\n redirect('/backend/accessories', ['notice' => 'Successfully updated.']);\n } else {\n redirect(\n '/backend/accessories/edit',\n ['error' => $this->accessory->errors_as_string()],\n ['id' => $this->accessory->id]\n );\n }\n }", "public function update(Entity $entity);", "public function update(Request $request, $id)\n {\n $icon = SliderIcon::find($id);\n $data = $request->all();\n $data['active'] = $request->has('active') ? 1 : 0;\n if ($request->hasFile('img')) {\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $image = $request->file('img');\n $fileName = time().'_'.Str::lower(Str::random(5)).'.'.$image->getClientOriginalExtension();\n $path_to = '/upload/images/'.getfolderName();\n $image->storeAs('public'.$path_to, $fileName);\n $data['img'] = 'storage'.$path_to.'/'.$fileName;\n }\n $icon->update($data);\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества обнавлены');\n }", "public function update() {\n\t $this->layout = false;\n\t \n\t //set default response\n\t $response = array('status'=>'failed', 'message'=>'HTTP method not allowed');\n\t \n\t //check if HTTP method is PUT\n\t if($this->request->is('put')){\n\t //get data from request object\n\t $data = $this->request->input('json_decode', true);\n\t if (empty($data)) {\n\t $data = $this->request->data;\n\t }\n\t \n\t //check if product ID was provided\n\t if (!empty($data['id'])) {\n\t \n\t //set the product ID to update\n\t $this->Player->id = $data['id'];\n\t if ($this->Player->save($data)) {\n\t $response = array('status'=>'success','message'=>'Product successfully updated');\n\t } else {\n\t $response['message'] = \"Failed to update product\";\n\t }\n\t } else {\n\t $response['message'] = 'Please provide product ID';\n\t }\n\t }\n\t \n\t $this->response->type('application/json');\n\t $this->response->body(json_encode($response));\n\n\t return $this->response->send();\n\t}", "public function update(Request $request, $id)\n {\n //validate incoming request\n $request->validate([\n 'name' => 'string|max:100|nullable',\n 'picture' => 'max:2000|mimes:jpeg,jpg,png,svg|nullable', //max size 2mb,\n 'total' => 'integer|min:0|nullable', //value must be > 0\n 'selling_price' => 'numeric|min:0|nullable',\n 'cost_price' => 'numeric|min:0|nullable',\n 'category_id' => 'integer|nullable'\n ]);\n\n try {\n $product = Auth::user()->store->product()->findorFail($id);\n } catch (ModelNotFoundException $e) {\n return response()->json([\n \"message\" => \"Forbidden\"\n ], 403);\n }\n\n //if category id isnt null\n if ($category_id = $request->category_id) {\n if (!$this->isCategoryIdValid($category_id))\n return response()->json([\n \"message\" => \"Category Id is not valid\"\n ], 422);\n else\n $product->category_id = $request->category_id;\n }\n\n //if uploaded file exist\n if ($picture = $request->file(\"picture\")) {\n //if product already has logo\n if ($product->picture)\n Storage::delete(Product::$PICTURE_PATH . \"/\" . $product->picture);\n\n $picture_path = $picture->store(Product::$PICTURE_PATH);\n //remove folder name from path\n $product->picture = str_replace(Product::$PICTURE_PATH . \"/\", '', $picture_path);\n }\n\n $this->renewProduct($product, $request);\n $product->save();\n return response()->json(new ProductResource($product), 200);\n }", "public function update(Request $request, $id)\n {\n $request->validate([\n 'name' => 'required | min:3 | string',\n 'type' => 'required',\n 'producer' => 'required',\n 'image' => 'image | mimes:png,jpg,jpeg',\n 'price_input' => 'required | numeric | min:0 | max:300000000',\n 'promotion_price' => 'required | numeric | max:300000000',\n 'description' => 'required | string',\n\n ]);\n $product = Product::withTrashed()->findOrfail($id);\n $product->name = $request->name;\n $product->id_type = $request->type;\n $product->id_producer = $request->producer;\n\n $product->amount = $request->amount;\n if (request('image')) {\n $product->image = base64_encode(file_get_contents($request->file('image')->getRealPath()));\n }\n\n $product->price_input = $request->price_input;\n\n if ( $request->promotion_price >= 0 && $request->promotion_price < $product->price_input) {\n $product->promotion_price = $request->promotion_price;\n }else{\n return back()->with('error', '\n Do not enter a negative number');\n }\n $product->new = $request->new;\n\n $product->description = $request->description;\n\n $product->save();\n $product->size()->sync(request('size'));\n\n return redirect()->route('product.index')->with('success', 'Product Updated successfully');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n $product->name = $request->input('name');\n $product->description = $request->input('description');\n $product->lastPrice = $product->price !== $request->input('price') ? $product->price : NULL;\n $product->price = $request->input('price');\n\n if ($request->hasFile('image')) { \n $currentImg = $product->image;\n if ($currentImg) {\n Storage::delete('/public/' . $currentImg);\n }\n $image = $request->file('image'); \n $path = $image->store('images','public');\n $product->image = $path;\n };\n\n $product->save(); \n\n $product_promotions = $request->input('promotion');\n\n $product->promotions()->sync($product_promotions);\n\n return redirect()->route('admin.modify');\n }", "public static function updateImage($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n ResourceHandler::delete($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update($request, $id)\n {\n $this->checkExits($id);\n $data = $request->except(['_method','_token','photo']);\n\n if($request->photo)\n {\n try {\n $this->UploadFile($request);\n } catch (\\Exception $e) {\n //if has exception , don't has action\n }\n if ($this->img !== '') {\n $data['img'] = $this->img;\n }\n }\n\n $this->object->update($data);\n\n }", "public function updateProduct($request, $product)\n {\n $product->update($request->except(['_token', '_method', 'image']));\n if ($request->hasFile('image')) {\n $image = $request->file('image');\n $imageName = time() . '.' . $request->file('image')->extension();\n // $img = Image::make('public/foo.jpg');\n\n $image_resize = Image::make($image->getRealPath());\n $image_resize->resize(500, 500);\n $image_resize->save(public_path('images/') . $imageName, 100);\n $product->gallery = $imageName;\n $product->save();\n }\n $product->getTags()->sync($request->input('tags'));\n }" ]
[ "0.7425105", "0.70612276", "0.70558053", "0.6896673", "0.6582159", "0.64491373", "0.6346954", "0.62114537", "0.6145042", "0.6119944", "0.61128503", "0.6099993", "0.6087866", "0.6052593", "0.6018941", "0.60060275", "0.59715486", "0.5946516", "0.59400934", "0.59377414", "0.5890722", "0.5860816", "0.5855127", "0.5855127", "0.58513457", "0.5815068", "0.5806887", "0.57525045", "0.57525045", "0.57337505", "0.5723295", "0.5714311", "0.5694472", "0.5691319", "0.56879413", "0.5669989", "0.56565005", "0.56505877", "0.5646085", "0.5636683", "0.5633498", "0.5633378", "0.5632906", "0.5628826", "0.56196684", "0.5609126", "0.5601397", "0.55944353", "0.5582592", "0.5581908", "0.55813426", "0.5575312", "0.55717176", "0.55661047", "0.55624634", "0.55614686", "0.55608666", "0.55599797", "0.55599797", "0.55599797", "0.55599797", "0.55599797", "0.55573726", "0.5556878", "0.5554201", "0.5553069", "0.55530256", "0.5543788", "0.55435944", "0.55412996", "0.55393505", "0.55368495", "0.5535236", "0.5534954", "0.55237365", "0.5520468", "0.55163723", "0.55125296", "0.5511168", "0.5508345", "0.55072427", "0.5502385", "0.5502337", "0.5501029", "0.54995877", "0.54979175", "0.54949397", "0.54949397", "0.54946727", "0.5494196", "0.54941916", "0.54925025", "0.5491807", "0.5483321", "0.5479606", "0.5479408", "0.5478678", "0.54667485", "0.5463411", "0.5460588", "0.5458525" ]
0.0
-1
Remove the specified resource from storage.
public function destroy(Service $service, Comment $comment) { return ['message' => 'Not implemented.']; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function delete($resource){\n return $this->fetch($resource, self::DELETE);\n }", "public function destroy(Resource $resource)\n {\n //\n }", "public function removeResource($resourceID)\n\t\t{\n\t\t}", "public function unpublishResource(PersistentResource $resource)\n {\n $client = $this->getClient($this->name, $this->options);\n try {\n $client->delete(Path::fromString($this->getRelativePublicationPathAndFilename($resource)));\n } catch (FileDoesNotExistsException $exception) {\n }\n }", "public function deleteResource(&$resource) {\n\n if ($this->connector != null) {\n $this->logger->addDebug(\"Deleting Resource Node from Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}}) detach delete a;\",\n [\n 'id' => $resource->getID()\n ]\n );\n $this->logger->addDebug(\"Updated neo4j to remove resource\");\n }\n\n }", "public function deleteShopifyResource() {\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'DELETE',\n ]);\n }", "public function deleteResource()\n {\n $database = new Database();\n $id = $this->_params['id'];\n $database->deleteResource($id);\n $this->_f3->reroute('/Admin');\n }", "protected function deleteResource($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }", "public function delete()\n {\n persistableCollection::getInstance($this->resourceName)->deleteObject($this);\n }", "public function remove()\n {\n $this->_getBackend()->remove($this->_id);\n }", "public function remove()\n {\n if (! ftruncate($this->fileHandle, 0)) {\n throw new StorageException(\"Could not truncate $this->path\");\n }\n if (! unlink($this->path)) {\n throw new StorageException(\"Could not delete $this->path\");\n }\n }", "public function delete()\n\t{\n\t\t$s3 = AWS::createClient('s3');\n $s3->deleteObject(\n array(\n 'Bucket' => $this->bucket,\n 'Key' => $this->location\n )\n );\n\t\tif($this->local_file && file_exists($this->local_file)) {\n\t\t\tunlink($this->local_file);\n\t\t}\n $this->local_file = null;\n\t}", "public function delete()\n\t{\n\t\tsfCore::db->query(\"DELETE FROM `swoosh_file_storage` WHERE `id`='%i';\", $this->id);\n\t\t$this->fFile->delete();\n\t}", "public function delete(): void\n {\n unlink($this->getPath());\n }", "public function delete()\n {\n if($this->exists())\n unlink($this->getPath());\n }", "public function remove($path);", "function deleteFileFromStorage($path)\n{\n unlink(public_path($path));\n}", "public function delete(): void\n {\n unlink($this->path);\n }", "private function destroyResource(DrydockResource $resource) {\n $blueprint = $resource->getBlueprint();\n $blueprint->destroyResource($resource);\n\n $resource\n ->setStatus(DrydockResourceStatus::STATUS_DESTROYED)\n ->save();\n }", "public static function delete($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }", "public function remove() {}", "public function remove() {}", "public function remove();", "public function remove();", "public function remove();", "public function remove();", "function delete_resource($resource_id, $page)\n\t{\n\t\t//get resource data\n\t\t$table = \"resource\";\n\t\t$where = \"resource_id = \".$resource_id;\n\t\t\n\t\t$this->db->where($where);\n\t\t$resource_query = $this->db->get($table);\n\t\t$resource_row = $resource_query->row();\n\t\t$resource_path = $this->resource_path;\n\t\t\n\t\t$image_name = $resource_row->resource_image_name;\n\t\t\n\t\t//delete any other uploaded image\n\t\t$this->file_model->delete_file($resource_path.\"\\\\\".$image_name, $this->resource_path);\n\t\t\n\t\t//delete any other uploaded thumbnail\n\t\t$this->file_model->delete_file($resource_path.\"\\\\thumbnail_\".$image_name, $this->resource_path);\n\t\t\n\t\tif($this->resource_model->delete_resource($resource_id))\n\t\t{\n\t\t\t$this->session->set_userdata('success_message', 'resource has been deleted');\n\t\t}\n\t\t\n\t\telse\n\t\t{\n\t\t\t$this->session->set_userdata('error_message', 'resource could not be deleted');\n\t\t}\n\t\tredirect('resource/'.$page);\n\t}", "public function deleteImage(){\n\n\n Storage::delete($this->image);\n }", "public function del(string $resource): bool|string\n {\n $json = false;\n $fs = unserialize($_SESSION['rfe'][$this->getRoot()], ['allowed_classes' => false]);\n if (array_key_exists($resource, $fs)) {\n // if $item has children, delete all children too\n if (array_key_exists('dir', $fs[$resource])) {\n foreach ($fs as $key => $file) {\n if (isset($file['parId']) && $file['parId'] == $resource) {\n unset($fs[$key]);\n }\n }\n }\n unset($fs[$resource]);\n $_SESSION['rfe'][$this->getRoot()] = serialize($fs);\n $json = '[{\"msg\": \"item deleted\"}]';\n }\n return $json;\n }", "public function destroy()\n\t{\n\t\treturn unlink(self::filepath($this->name));\n\t}", "public function destroy($id) {\n $book = Book::find($id);\n // return unlink(storage_path(\"public/featured_images/\".$book->featured_image));\n Storage::delete(\"public/featured_images/\" . $book->featured_image);\n if ($book->delete()) {\n return $book;\n }\n\n }", "public function destroy($id)\n {\n Storageplace::findOrFail($id)->delete();\n }", "public function destroyResourceImage(): void\n\t{\n\t\tif (isset($this->image)) {\n\t\t\t@imagedestroy($this->image->getImageResource());\n\t\t}\n\t}", "public function deleteResource(PersistentResource $resource)\n {\n $pathAndFilename = $this->getStoragePathAndFilenameByHash($resource->getSha1());\n if (!file_exists($pathAndFilename)) {\n return true;\n }\n if (unlink($pathAndFilename) === false) {\n return false;\n }\n Files::removeEmptyDirectoriesOnPath(dirname($pathAndFilename));\n return true;\n }", "public function deleteImage(){\n \tStorage::delete($this->image);\n }", "public function destroy()\n {\n $file=public_path(config('larapages.media.folder')).Input::all()['folder'].'/'.Input::all()['file'];\n if (!file_exists($file)) die('File not found '.$file);\n unlink($file);\n }", "public function delete() \r\n {\r\n if($this->exists())\r\n {\r\n unlink($this->fullName());\r\n }\r\n }", "public function destroy($id)\n {\n Myfile::find($id)->delete();\n }", "public function destroy($delete = false)\n {\n if (null !== $this->resource) {\n $this->resource->clear();\n $this->resource->destroy();\n }\n\n $this->resource = null;\n clearstatcache();\n\n // If the $delete flag is passed, delete the image file.\n if (($delete) && file_exists($this->name)) {\n unlink($this->name);\n }\n }", "public static function delete($path){\r\n $currentDir = getcwd();\r\n $storageSubPath = \"/../../\".STORAGE_PATH;\r\n $file = $currentDir . $storageSubPath . '/' . $path;\r\n\r\n unlink($file);\r\n }", "public function destroy(Storage $storage)\n {\n return redirect()->route('storages.index');\n }", "public function remove() {\n //Check if there are thumbs and delete files and db\n foreach ($this->thumbs()->get() as $thumb) {\n $thumb->remove();\n } \n //Delete the attachable itself only if is not default\n if (strpos($this->url, '/defaults/') === false) {\n Storage::disk('public')->delete($this->getPath());\n }\n parent::delete(); //Remove db record\n }", "public function removeFile($uri){\n return Storage::disk('public')->delete($uri);\n }", "public function destroy(Resource $resource)\n {\n if( $resource->delete() ){\n return Response(['status'=>'success','message'=>'Resource deleted']); \n } else {\n return Response(['status'=>'error', 'message'=>'Something went wrong']);\n }\n }", "public function delete($path);", "public function delete($path);", "public function destroy($id)\n { \n File::find($id)->remove();\n \n return redirect()->route('files.index');\n }", "public function destroy($id)\n {\n $supplier = Supplier::find($id);\n $photo = $supplier->photo;\n if ($photo) {\n unlink($photo);\n }\n $supplier->delete();\n }", "public function destroy($id)\n {\n $student = Student::where('id', $id)->first();\n // $path = $student->image;\n unlink($student->image);\n Student::findOrFail($id)->delete();\n return response('Deleted!');\n }", "public function destroy($id)\n {\n $icon = SliderIcon::find($id);\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $icon->delete();\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества удалёны');\n }", "public function delete($path, $data = null);", "public function destroy($id)\n {\n $items=Items::find($id);\n // delete old file\n if ($items->photo) {\n $str=$items->photo;\n $pos = strpos($str,'/',1);\n $str = substr($str, $pos);\n $oldFile = storage_path('app\\public').$str;\n File::Delete($oldFile); \n }\n $items->delete();\n return redirect()->route('items.index');\n }", "public function destroy($id)\n {\n $carousel = Carousel::find($id);\n $image = $carousel->image;\n\n $basename ='img/carousel/' . basename($image);\n //Delete the file from disk\n if(file_exists($basename)){\n unlink($basename);\n }\n //With softDeletes, this is the way to permanently delete a record\n $carousel->delete();\n Session::flash('success','Product deleted permanently');\n return redirect()->back();\n }", "public function remove()\n {\n $fs = new Filesystem();\n $fs->remove($this->dir());\n }", "public static function destroy(int $resource_id)\n {\n try {\n $image_data = ListingImage::where('id', $resource_id)->first();\n self::delete_image($image_data->name);\n $delete = ListingImage::where('id', $resource_id)->delete();\n\n // activity()\n // ->causedBy(Auth::user()->id)\n // ->performedOn($delete)\n // ->withProperties(['id' => $delete->id])\n // ->log('listing image deleted');\n return response()->json(['status'=> 'ok', 'msg'=> 'Data deleted successfully']);\n } catch (Exception $e) {\n $e->getMessage();\n }\n }", "public function destroy(Storage $storage)\n {\n $this->storage->destroy($storage);\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource deleted', ['name' => trans('product::storages.title.storages')]));\n }", "public function del($path){\n\t\treturn $this->remove($path);\n\t}", "public function destroy($id)\n {\n //\n $product = Product::findOrFail($id);\n $product->delete();\n if($product->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$product->img);\n // return 'deleted';\n }\n return redirect()->route('product.index'); \n }", "public function removeUpload()\n{\n if ($file = $this->getAbsolutePath()) {\n unlink($file); \n }\n}", "public function destroy($id)\n {\n $image = Images::withTrashed()->find($id);\n\n Storage::disk('uploads')->delete(\"social-media/$image->filename\");\n\n $image->tags()->detach();\n $image->detachMedia(config('constants.media_tags'));\n $image->forceDelete();\n\n return redirect()->back()->with('success', 'The image was successfully deleted');\n }", "public function destroyByResourceId($resource_id)\n {\n// $online_party = $this->onlinetrack->where('resource_id', $resource_id)->get()->first();\n// $online_party->status = \"offline\";\n// $online_party->save();\n// return $online_party;\n return $this->onlinetrack->where('resource_id', $resource_id)->delete();\n }", "public function revoke($resource, $permission = null);", "public function destroy($id)\n {\n $data=Image::find($id);\n $image = $data->img;\n\n\n $filepath= public_path('images/');\n $imagepath = $filepath.$image;\n\n //dd($old_image);\n if (file_exists($imagepath)) {\n @unlink($imagepath);\n }\n\n\n $data->delete();\n\n return redirect()->route('image.index');\n }", "function delete($path);", "public function removeItem(int $id)\n\t{\n\t\t$this->storage->remove($id);\n\t}", "public function destroy(File $file)\n {\n //\n $v = Storage::delete($file->path);\n \n }", "public function destroyResource($resource)\n {\n if (!is_object($resource)) {\n return false;\n }\n\n $resource_type = get_class($resource);\n $resource_id = $resource->getKey();\n\n return Role::where('resource_type', $resource_type)\n ->where('resource_id', $resource_id)\n ->delete();\n }", "public function remove($filePath){\n return Storage::delete($filePath);\n }", "public function remove(): void\n {\n $file = $this->getAbsolutePath();\n if (!is_file($file) || !file_exists($file)) {\n return;\n }\n\n unlink($file);\n }", "public function destroy(Request $request, Storage $storage)\n {\n $storage->delete();\n $request->session()->flash('alert-success', 'Запись успешно удалена!');\n return redirect()->route('storage.index');\n }", "public function remove(Storable $entity): Storable\n {\n $this->getRepository(get_class($entity))->remove($entity);\n $this->detach($entity);\n\n return $entity;\n }", "public function processDeletedResource(EntityResource $resource)\n {\n /** @var AuthorizationRepository $repository */\n $repository = $this->entityManager->getRepository('Edweld\\AclBundle\\Entity\\Authorization');\n\n $repository->removeAuthorizationsForResource($resource);\n }", "function _unlink($resource, $exp_time = null)\n {\n if(file_exists($resource)) {\n return parent::_unlink($resource, $exp_time);\n }\n\n // file wasn't found, so it must be gone.\n return true;\n }", "public function remove($id);", "public function remove($id);", "public function deleted(Storage $storage)\n {\n //\n }", "public function destroy($id)\n {\n $data = Product::findOrFail($id);\n\n if(file_exists('uploads/product/'.$data->image1)){\n unlink('uploads/product/'.$data->image1);\n }\n\n if(file_exists('uploads/product/'.$data->image2)){\n unlink('uploads/product/'.$data->image2);\n }\n\n if(file_exists('uploads/product/'.$data->image3)){\n unlink('uploads/product/'.$data->image3);\n }\n $data->delete();\n }", "public function removeUpload()\n {\n $file = $this->getAbsolutePath();\n if ($file) {\n unlink($file);\n }\n }", "public function resources_delete($resource_id, Request $request) {\n if ($resource_id) {\n $resp = Resources::where('id', '=', $resource_id)->delete();\n if($resp){\n $msg = 'Resource has been deleted successfully.';\n $request->session()->flash('message', $msg);\n }\n }\n //return redirect()->route('admin-factor-list');\n return redirect()->to($_SERVER['HTTP_REFERER']);\n }", "public function delete()\n {\n try\n {\n $thumbnail = $this->getThumbnail();\n if($thumbnail)\n {\n $thumbnail->delete();\n }\n }\n catch(sfException $e){}\n \n // delete current file\n parent::delete();\n }", "function deleteResource($uuid){\n $data = callAPI(\"DELETE\",\"/urest/v1/resource/\".$uuid);\n return $data;\n}", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function remove_resource($idproject){\n\t\t\n\t\t// Load model and try to get project data\n\t\t$this->load->model('Projects_model', 'projects');\n\t\t\n\t\t// Update\n\t\t$this->projects->save_project(array(\"ext\" => \"\", \"vzaar_idvideo\" => \"0\", \"vzaar_processed\" => \"0\"), $idproject);\n\t}", "public function destroy($id){\n $file_data = Slider::findOrFail($id);\n File::delete(public_path('../storage/app/public/sliders/'.$file_data->path));\n $slider = Slider::destroy($id);\n return response()->json(null, 204);\n }", "public function delete()\n\t{\n\t\t@unlink($this->get_filepath());\n\t\t@unlink($this->get_filepath(true));\n\t\tparent::delete();\n\t}", "public function delete($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'DELETE');\n }", "public function destroy($id)\n {\n //Find Slider With Id\n $slider = Slider::findOrFail($id);\n // Check If The Image Exist\n if(file_exists('uploads/slider/'.$slider->image)){\n\n unlink( 'uploads/slider/'.$slider->image);\n }\n $slider->delete();\n return redirect()->back()->with('success','Slider Successfully Deleted');\n }" ]
[ "0.6672584", "0.6659381", "0.6635911", "0.6632799", "0.6626075", "0.65424126", "0.65416265", "0.64648265", "0.62882507", "0.6175931", "0.6129922", "0.60893893", "0.6054415", "0.60428125", "0.60064924", "0.59337646", "0.5930772", "0.59199584", "0.5919811", "0.5904504", "0.5897263", "0.58962846", "0.58951396", "0.58951396", "0.58951396", "0.58951396", "0.5880124", "0.58690923", "0.5863659", "0.5809161", "0.57735413", "0.5760811", "0.5753559", "0.57492644", "0.5741712", "0.57334286", "0.5726379", "0.57144034", "0.57096", "0.5707689", "0.5705895", "0.5705634", "0.5703902", "0.5696585", "0.5684331", "0.5684331", "0.56780374", "0.5677111", "0.5657287", "0.5648262", "0.5648085", "0.5648012", "0.5640759", "0.5637738", "0.5629985", "0.5619264", "0.56167465", "0.5606877", "0.56021434", "0.5601949", "0.55992156", "0.5598557", "0.55897516", "0.5581397", "0.5566926", "0.5566796", "0.55642897", "0.55641", "0.5556583", "0.5556536", "0.5550097", "0.5543172", "0.55422723", "0.5540013", "0.5540013", "0.55371785", "0.55365825", "0.55300397", "0.552969", "0.55275744", "0.55272335", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.5525997", "0.5525624", "0.5523911", "0.5521122", "0.5517412" ]
0.0
-1
See if a Given Session code looks valid
function validCode($request_code): bool { # Test to See Session Code is 32 character hexadecimal if (preg_match("/^[0-9a-f]{64}$/i",$request_code)) return true; #error_log("Invalid session code: $request_code"); return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function check($code) {\n\t\t\n\t\t//isset($_SESSION) || session_start();\t\t\n\t\t//Verify code can not be empty\n\t\tif(empty($code) || empty($_SESSION[self::$seKey])) {\n\t\t\treturn false;\n\t\t}\n\t\t//session expired\n\t\tif(time() - $_SESSION[self::$seKey]['time'] > self::$expire) {\n\t\t\tunset($_SESSION[self::$seKey]);\n\t\t\treturn false;\n\t\t}\n\n\t\tif(strtolower($code) == strtolower($_SESSION[self::$seKey]['code'])) {\n\t\t\treturn true;\n\t\t}\t\t\n\n\t\treturn false;\n\t}", "private function verifySession()\n {\n if ((isset($this->session['id']))\n && (is_numeric($this->session['id']))\n && (isset($this->session['legit']))\n && ($this->session['legit'] === $this->sessionHash())\n ) {\n return true;\n }\n return false;\n }", "public function validate() {\n \n $session_id = 0;\n\t\t$session_hash = '';\n\t\n if (isset($GLOBALS[\"_COOKIE\"][\"sessionid\"])) { \n \t $cookie_array = explode('|', $GLOBALS[\"_COOKIE\"][\"sessionid\"]);\n\t\t\tif ($cookie_array[0]) {\n\t\t\t\t$session_id = $cookie_array[0];\n\t\t\t\t$session_hash = $cookie_array[1];\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t\n if (!($session_id && $session_hash)) { return false; }\n\n /* Pull the information for the SessionID out of the database. */\n\n $this->load($session_id);\n\t\tif ($this->sessionid == 0 || $this->expired == 1) {\n\t\t\treturn false;\n\t\t}\n\n $ipaddress = $_SERVER['REMOTE_ADDR'];\n $session_string = $this->session;\n\n if ($session_hash == md5($session_string . $ipaddress . 'scfgshatfk')) {\n return true;\n } elseif ($session_hash == md5($session_string . 'scfgshatfk')) {\n return true; \n } else {\n\t\t\t$this->clear();\n\t\t\treturn false;\n\t\t}\n }", "function _session_is_valid(){\n\t\treturn session_is_valid($this->_state_session_id);\n\t}", "public function sessionIsValid()\n {\n return $this->authClient->sessionIsValid();\n }", "private function checkSessionId() {\r\n\r\n $hijackTest = FALSE;\r\n \r\n if ($this->hijackBlock) {\r\n $this->SQLStatement_GetSessionInfos->bindParam(':sid', $this->sessionId, PDO::PARAM_STR, $this->sid_len);\r\n $this->SQLStatement_GetSessionInfos->execute();\r\n $val = $this->SQLStatement_GetSessionInfos->fetchAll(PDO::FETCH_ASSOC);\r\n //var_dump($val);\r\n //echo \"<br> UA:\".$this->getUa().\"<br>\";\r\n if ($val[0][\"ua\"] ==$this->getUa()) {\r\n $hijackTest = TRUE;\r\n } else {\r\n $hijackTest = FALSE;\r\n }\r\n } else {\r\n $hijackTest = TRUE;\r\n }\r\n\r\n if ($hijackTest==TRUE) return true;\r\n else return false;\r\n \r\n }", "public function isValidSession(string $token):bool;", "public function session_valid()\n\t{\n\t\t$ip_address = $_SERVER['REMOTE_ADDR'];\n\t\t$user_agent = $_SERVER['HTTP_USER_AGENT'];\n\n\t\t$ip_blacklist = [\n\t\t\t'0.0.0.0',\n\t\t\t'127.0.0.1'\n\t\t];\n\n\t\t$ua_blacklist = [\n\t\t\t'false',\n\t\t\tFALSE,\n\t\t\t'',\n\t\t\t'PHPUnit'\n\t\t];\n\n\t\tif (in_array($ip_address, $ip_blacklist) || in_array($user_agent, $ua_blacklist))\n\t\t{\n\t\t\t$this->sess_destroy();\n\t\t\treturn FALSE;\n\t\t}\n\n\t\treturn TRUE;\n\t}", "function checkSession()\n{\n if(sha1(md5($_SERVER['REMOTE_ADDR'].'ahsh').md5($_SERVER['HTTP_USER_AGENT'].'afke'))\n != @$_SESSION['fingerprint'])\n {\n Flash::create('Session check failed');\n return false;\n }\n if(mt_rand(1, 20) == 1)\n {\n regenerateSession();\n }\n return true;\n}", "public function isValid()\n {\n // Initialize\n $bReturn = false;\n\n // Session should be started\n if (($this->_pStorage->status() == PHP_SESSION_ACTIVE )) {\n // Get stored UID\n $uidSaved = $this->_pStorage->getOffset(self::UID, APPLICATION_NAME);\n\n // Compare with the client uid\n $bReturn = ( $this->_iCRC == $uidSaved );\n } else {\n throw new \\Foundation\\Exception\\BadMethodCallException('The session was not successfully started.');\n }//if(...\n\n return $bReturn;\n }", "static public function sessionIsValid()\n {\n try {\n $ret = false;\n\n session_start();\n\n // TODO: Make sure this is correct\n if (isset($_SESSION) && $_SESSION['sessionkey']) {\n $ret = true;\n\n // Update last activity time stamp\n $_SESSION['LAST_ACTIVITY'] = time();\n } else {\n session_unset();\n session_destroy();\n }\n\n return $ret;\n } catch (Exception $e) {\n return false;\n }\n }", "public function verify_code($name, $code)\n {\n if (!$this->ci->config->item('captchas_enabled')) return true;\n\n $session_code = $this->ci->session->userdata('captcha_' . $name);\n\n if ($session_code !== null)\n {\n // delete the old image from cache\n $this->redis->del('captcha:' . $session_code);\n\n // the code matches\n if ($session_code == $code)\n {\n return true;\n }\n\n // generate a new code and image\n $new_code = $this->generate_code();\n $captcha_image = $this->generate_image($new_code);\n\n // code doesn't match, store the new captcha\n $this->ci->session->set_tempdata('captcha_' . $name, $new_code, 600);\n $this->redis->set('captcha:' . $new_code, serialize($captcha_image), ['ex'=> 120]);\n }\n else\n {\n return $session_code;\n }\n return false;\n }", "public function isValid()\n {\n return ($this->_code > 0) ? true : false;\n }", "public static function get_session_code(){\n\t\t$limit = ModelBruno::getMStime() - (24*3600*1000); //Cut 24H\n\t\t//For session where user_id exists, it means it's a fix session (no time limit!)\n\t\tSession::WhereNotNull('code')->where('u_at', '<', $limit)->whereNull('question_hashid')->getQuery()->update(['code' => null]);\n\n\t\t//Get a unique code number\n\t\t$length = 4;\n\t\t$tries = 5000;\n\t\t$code = null;\n\t\t$loop = true;\n\t\twhile($loop){\n\t\t\t$loop = false;\n\t\t\t$code = rand( pow(10, $length-1), pow(10, $length)-1 ); //for length 4, min is 1000, max is 9999\n\t\t\t//Find a unique md5\n\t\t\tif(Session::Where('code', $code)->first(array('id'))){\n\t\t\t\t$loop = true;\n\t\t\t\t$tries--;\n\t\t\t\tif($tries<=0){\n\t\t\t\t\t$tries = 5000;\n\t\t\t\t\t$length = $length + 2; //It's easier for user to insert a even number length, 4 6 8\n\t\t\t\t}\n\t\t\t\tif($length>8){\n\t\t\t\t\t$code = null;\n\t\t\t\t\t$loop = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $code;\n\t}", "private function isSessionValid($session)\n {\n return is_null(self::getSecurityToken()) || !$session || $session != self::getSecurityToken();\n }", "public function validateCurrentSession(){$this->lhDB->connect('ibdlhsession');self::getCurrentPhpSid();self::validatePhpSid();$this->lhDB->disconnect();if($this->valid){$uid=$this->uid;return $uid;}else{return false;}}", "public function verifySessionIntegrity() {\n if (!$this->isValidSession()) {\n $this->end();\n $this->restart();\n }\n }", "protected function IsValidCode($code)\n\t\t{\n\t\t\tif (preg_match('/^[a-z]{3}$/i', $code)) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\treturn false;\n\t\t}", "function isValidCodeMachine($codeMachine) {\n\tglobal $DB_DB;\n\t$request = $DB_DB->prepare(\"SELECT * FROM Machine WHERE codeMachine LIKE :codeMachine\");\n\n\ttry {\n\t\t$request->execute(array(\n\t\t\t'codeMachine' => $codeMachine\n\t\t));\n\t}\n\tcatch(Exception $e) {\n\t\tif($DEBUG_MODE)\n\t\t\techo $e;\n\t\treturn -2;\n\t}\n\n\tif($request->rowCount() != 0)\n\t\treturn false;\n\treturn true;\n}", "static public function isCurrentSessionValid() {\n\t\t$session = self::getCurrentSession();\n\t\t\n\t\tif (!empty($session)) {\n\t\t\t\n\t\t\t$now = new DateTime('now', new DateTimeZone('UTC'));\n\t\t\t$ssoSessionExpires = new DateTime($session->SSOSessionExpires);\n\t\t\t\n\t\t\tif ($ssoSessionExpires > $now) \n\t\t\t\treturn true;\n\t\t\telse {\n\t\t\t\treturn false;\n\t\t\t\tself::clearCurrentSession();\n\t\t\t}\n\t\t} \n\t\t\n\t\treturn false;\n\t}", "protected final function is_still_valid($session)\n {\n }", "public function hasVerificationCode(){\n return $this->_has(3);\n }", "public function hasVerificationCode(){\n return $this->_has(3);\n }", "private function check()\n\t{\n\t\tif (!session_id())\n\t\t{\n\t\t\tsession_start();\n\t\t}\n\t}", "protected function isSessionValid() {\n if(empty($this->metadata)) {\n throw new \\RuntimeException(\n \"Session metadata key is missing from SESSION superglobal.\"\n );\n }\n return (\n $this->isValidFingerprint() === true &&\n (\n $this->metadata->isActive === true ||\n $this->isForwardedSession()\n )\n );\n }", "private static function verify() {\r\n\t\t// create code object for the given code we will be verifying\r\n\t\tif (!isset($_SESSION['user'])) {\r\n\t\t\tself::alertMessage('danger', 'Unable to find session user data. Try logging out and logging in again.');\r\n\t\t\tVerificationView::show();\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t$userID = $_POST['userID'] = $_SESSION['user']->getUserID();\r\n\t\t$code = new VerificationCode($_POST);\r\n\r\n\t\t// load and validate expected code from database\r\n\t\t$codeInDatabase = VerificationCodesDB::get($userID);\r\n\t\tif (is_null($codeInDatabase)) {\r\n\t\t\tself::alertMessage('danger', 'No active verification code found. Your code may have expired. Click \"Resend Code\" to send a new code to your phone.');\r\n\t\t\tVerificationView::show();\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// compare given/expected codes\r\n\t\tif ($code->getCode() !== $codeInDatabase->getCode()) {\r\n\t\t\tself::alertMessage('danger', 'The code you entered is incorrect. Please check your code and try again.');\r\n\t\t\tVerificationView::show();\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// verification successful. mark phone number as verified\r\n\t\t$user = UsersDB::getUser($userID);\r\n\t\t$user->setIsPhoneVerified(true);\r\n\t\tUsersDB::edit($user);\r\n\t\t$_SESSION['user'] = $user;\r\n\r\n\t\t// clean up and show dashboard\r\n\t\tVerificationCodesDB::clear($userID);\r\n\t\tDashboardView::show();\r\n\t}", "function hasValidUid()\n{\n return isset($_SESSION[\"state\"]) && isUid($_SESSION[\"state\"]);\n}", "protected function checkSession($args) {\n\n if ($args['ent_user_type'] == '' || $args['ent_date_time'] == '')\n return $this->_getStatusMessage(1, 15);\n\n $this->curr_date_time = urldecode($args['ent_date_time']);\n\n $returned = $this->_validate_token($args['ent_sess_token'], $args['ent_dev_id'], $args['ent_user_type']);\n\n if (is_array($returned))\n return $returned;\n else\n return $this->_getStatusMessage(73, 15);\n }", "protected function checkSessionToken() {}", "function is_validlogin($sessionID, $debug = false) {\n\t\t$q = (new QueryBuilder())->table('logperm');\n\t\t$q->field($q->expr(\"IF(validlogin = 'Y', 1, 0)\"));\n\t\t$q->where('sessionid', $sessionID);\n\t\t$sql = DplusWire::wire('database')->prepare($q->render());\n\n\t\tif ($debug) {\n\t\t\treturn $q->generate_sqlquery();\n\t\t} else {\n\t\t\t$sql->execute($q->params);\n\t\t\treturn $sql->fetchColumn();\n\t\t}\n\t}", "public function validationSha($code){\r\n\t\t//variables\r\n\t\t$error = '';\r\n\t\t$user_browser = $_SERVER['HTTP_USER_AGENT']; //navegador\r\n\t\t$ip = $_SERVER['REMOTE_ADDR']; //ip\r\n\t\r\n\t\t$this->where('macro_sha', $code);\r\n\t\tif($salida = $this->getOne('solicitudes_clave')){\r\n\t\t\t\r\n\t\t\tif($salida['navegador'] != $user_browser){\t$error = 'navegador no concide';\t}\r\n\t\t\tif($salida['ip'] != $ip){\t\t\t\t\t$error = 'remote ip no concide';\t}\r\n\t\t\t\r\n\t\t\tif($error != ''){\r\n\t\t\t\t$this->rewrite_attempt($ip, $error);\r\n\t\t\t\treturn false;\r\n\t\t\t}else{\r\n\t\t\t\t$nuevo_sha = hash('sha512', $salida['email'].$user_browser.$salida['telefono'].$ip);\r\n\t\t\t\tif($nuevo_sha != $salida['macro_sha']){\r\n\t\t\t\t\t$error = 'Shas no coinciden';\r\n\t\t\t\t\t$this->rewrite_attempt($ip, $error);\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}else{\r\n\t\t\t\t\t//succes!!\r\n\t\t\t\t\t$_SESSION['email_val'] = $salida['email'];\r\n\t\t\t\t\t$_SESSION['corrector'] = $salida['salt'];\r\n\t\t\t\t\t\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\r\n\t\t}else{\r\n\t\t\t$error = 'no hubo conexion a db';\r\n\t\t\t$this->rewrite_attempt($ip, $error);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "function check_captcha(){\n\t\t$captcha = FSInput::get('txtCaptcha');\n if ( $captcha == $_SESSION[\"security_code\"]){\n return true;\n } \n return false;\n\t}", "public function check_php_session() {\n global $db;\n\n $now = new Zend_Date();\n\n $random_string_exists = True;\n while ($random_string_exists) {\n $random_string = $this->rand_str();\n $data = array(\n 'random_string' => $random_string,\n 'date_created' => $now->toString(\"yyyy-MM-dd HH:mm:ss\"),\n 'session_data' => sprintf('client_id=%s', $this->client_id),\n 'redirect' => 'from ClientJSONRedirectService.php django redirect',\n );\n\n try {\n $db->insert('django_session_transfer', $data);\n $random_string_exists = False;\n }\n catch (Exception $e) {\n $random_string_exists = True;\n }\n }\n\n return $random_string;\n\n }", "public function valid() {\n\t\t$key = key($this->session);\n\n\t\treturn ($key == null || $key == false) ? false : true;\n\t}", "public function hasCode(){\n return $this->_has(3);\n }", "public function testInvalidSessionHandling() {\n\t\t$session = $this->getSession('nonexistent');\n\t\t$session->loadSession();\n\t\t$this->assertNotEquals('nonexistent', $session->getId(), 'The session ID was not changed');\n\t}", "private function checkCode(Int $code) {\n if ($code === 200) :\n return true;\n endif;\n\n return false;\n }", "static function validateSessionID() {\n\t\t\n\t\t// Connect to the database\n\t\t$db = new Database ();\n\t\t\n\t\t// Figure out that we got a USERID paired to our session\n\t\t// If we got, then we check its format. If wrong then throw it!\n\t\t\n\t\tif ((strlen ( session_id () ) != 32) && isset ( $_SESSION ['userid'] )) {\n\t\t\tthrow new Exception ( \"The session ID is malformed\" );\n\t\t}\n\t\t\n\t\t// Dig deeper into our sessions, fetch the row containing our session ID\n\t\t$query = \"SELECT * FROM user_sessions WHERE session_id = '\" . session_id () . \"'\";\n\t\tforeach ( $db->query ( $query ) as $result ) {\n\t\t\tself::$result = $result;\n\t\t\tself::$valid_session_id = md5 ( $result ['u_id'] . $_SERVER ['HTTP_USER_AGENT'] . self::$salt . $_SERVER ['REMOTE_ADDR'] . $result ['created'] );\n\t\t}\n\t\t\n\t\t// Check whether our sessionID is valid if an userid index is present\n\t\t// If not valid, drop an exception\n\t\tif (session_id () != self::$valid_session_id && isset ( $_SESSION ['userid'] )) {\n\t\t\tself::DestroySession ();\n\t\t}\n\t\t\n\t\t// Destroy our session if its past the time limit\n\t\t\n\t\tif (! is_null ( self::$result ['u_id'] ) && self::$result ['created'] + 1200 < time () && ! self::keepMeLogged ()) {\n\t\t\tself::DestroySession ();\n\t\t\t\n\t\t\t// Update our session if its recent\n\t\t} elseif (! is_null ( self::$result ['u_id'] ) && self::$result ['created'] + 1200 > time ()) {\n\t\t\tself::updateSession ();\n\t\t}\n\t\t// Return the userid\n\t\tRETURN self::$result ['u_id'];\n\t}", "private function getCurrentPhpSid(){if($this->phpsid=$this->MakeSafe->thisData(\"PHPSESSID\",\"PARANOID_STRING\",26,32,\"COOKIE\")){$this->valid=true;}else{$this->valid=false;}}", "function damm32Check($code) {\r\n\tglobal $base32;\r\n\treturn (damm32Encode($code) == $base32[0]) ? 1 : 0;\r\n\t}", "function Validate($sUserCode, $bCaseInsensitive = true) {\n if ($bCaseInsensitive) {\n $sUserCode = strtoupper($sUserCode);\n }\n \n if (!empty($_SESSION[CAPTCHA_SESSION_ID]) && $sUserCode == $_SESSION[CAPTCHA_SESSION_ID]) {\n // clear to prevent re-use\n unset($_SESSION[CAPTCHA_SESSION_ID]);\n \n return true;\n }\n \n return false;\n }", "function session_check() {\n\tif (!isset($_POST['session'])) {\n\t\tsend_message('error', array('reason' => 'no_session_token','message' => 'No session token passed'));\n\t}\n}", "public function verify_actcode($member_email, $code){\n\t\t//$newCode = $this->make_activation_code();\n\t\t$mysql = New Mysql();\n\t\treturn($mysql->update_activation_code($member_email, $code));\n\t}", "function checkSession()\n {\n if(isset($_COOKIE['sessionId']))\n {\n $response = callApi('GET', 'session', ['sessionid' => $_COOKIE['sessionId']]);\n if($response['code'] == '200')\n return true;\n else\n return false;\n }\n }", "function check() \n\t{\n\t\t//On creation store the useragent fingerprint\n\t\tif(empty($_SESSION['fingerprint'])) \n\t\t{\n\t\t\t$_SESSION['fingerprint'] = $this->generate_fingerprint();\n\t\t} \n\t\t//If we should verify user agent fingerprints (and this one doesn't match!)\n\t\telseif($this->match_fingerprint && $_SESSION['fingerprint'] != $this->generate_fingerprint()) \n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\n\t\t//If an IP address is present and we should check to see if it matches\n\t\tif(isset($_SESSION['ip_address']) && $this->match_ip) \n\t\t{\n\t\t\t//If the IP does NOT match\n\t\t\tif($_SESSION['ip_address'] != ip_address()) \n\t\t\t{\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t}\n\n\t\t//Set the users IP Address\n\t\t$_SESSION['ip_address'] = ip_address();\n\n\t\t//If a token was given for this session to match\n\t\tif($this->match_token) \n\t\t{\n\t\t\tif(empty($_SESSION['token']) OR $_SESSION['token'] != $this->match_token) \n\t\t\t{\n\t\t\t\t//Remove token check\n\t\t\t\t$this->match_token = FALSE;\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t}\n\n\t\t//Set the session start time so we can track when to regenerate the session\n\t\tif(empty($_SESSION['last_activity'])) \n\t\t{\n\t\t\t$_SESSION['last_activity'] = time();\n\t\t}\n\t\t//Check to see if the session needs to be regenerated\n\t\telseif($_SESSION['last_activity'] + $this->expiration < time()) \n\t\t{\n\t\t\t//Generate a new session id and a new cookie with the updated id\n//\t\t\tsession_regenerate_id(TRUE);\n session_regenerate_id();\n\n\t\t\t//Store new time that the session was generated\n\t\t\t$_SESSION['last_activity'] = time();\n\n\t\t}\n\t\treturn TRUE;\n\t}", "public static function verifyCode(string $secretKey, string $code) : bool\n {\n $time = time();\n $result = 0;\n\n // Timing attack safe iteration and code comparison\n for ($i = -1; $i <= 1; $i++) {\n $timeSlice = floor($time / self::TIME_WINDOW + $i);\n $result = hash_equals(self::getCode($secretKey, $timeSlice), $code) ? $timeSlice : $result;\n }\n\n return ($result > 0);\n }", "public function verifyCode($secret, $code)\n {\n if (strlen($code) != 6) {\n return false;\n }\n return ($this->getCode($secret) == $code) ? true : false;\n }", "public function hasCodeType(){\n return $this->_has(3);\n }", "protected function isValidSession()\n {\n //Login check\n $this->_consumidor = Extra_UserSession::getUserLogged();\n if ($this->_consumidor === null) {\n Extra_ErrorREST::setUserNotLoggedIn($this->getResponse());\n return false;\n }\n return true;\n }", "protected function validateCode(string|int $code): bool\n {\n return $this->twoFactorAuth->validateCode($code);\n }", "public static function verifyCode($code){\n\n if(!is_string($code) && !is_int($code)){\n\n return false;\n }\n\n $code=trim(''.$code);\n $codeLen=strlen($code);\n\n $totalW=array_sum(self::$WIDTH_SETTING);\n if($codeLen>$totalW){\n\n return false;\n }\n\n $flagInvalid=true;\n $curW=0;\n for($i=0; $i<count(self::$WIDTH_SETTING); $i++){\n\n $curW+=self::$WIDTH_SETTING[$i];\n if($curW==$codeLen){\n $flagInvalid=false;\n break;\n }\n }\n\n return !$flagInvalid;\n\n }", "public function hasCodeType(){\n return $this->_has(4);\n }", "public function hasCodeType(){\n return $this->_has(4);\n }", "function verify_code($rec_num, $checkstr)\n\t{\n\t\tif ($user_func = e107::getOverride()->check($this,'verify_code'))\n\t\t{\n\t \t\treturn call_user_func($user_func,$rec_num,$checkstr);\n\t\t}\n\t\t\n\t\t$sql = e107::getDb();\n\t\t$tp = e107::getParser();\n\n\t\tif ($sql->db_Select(\"tmp\", \"tmp_info\", \"tmp_ip = '\".$tp -> toDB($rec_num).\"'\")) {\n\t\t\t$row = $sql->db_Fetch();\n\t\t\t$sql->db_Delete(\"tmp\", \"tmp_ip = '\".$tp -> toDB($rec_num).\"'\");\n\t\t\t//list($code, $path) = explode(\",\", $row['tmp_info']);\n\t\t\t$code = intval($row['tmp_info']);\n\t\t\treturn ($checkstr == $code);\n\t\t}\n\t\treturn FALSE;\n\t}", "public function verifySession() {\n\t\t$this->reload();\n\t\tif ($this->getSession() == session_id())\n\t\t\treturn true;\n\t\telse {\n\t\t\tif($_SESSION[\"loginUser\"])\n\t\t\t\tunset($_SESSION[\"loginUser\"]);\n\t\t\treturn false;\n\t\t}\n\t}", "function reservedCodes($data) {\n\t\tif(in_array($data['code'], Configure::read('InvalidCodes'))) {\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\treturn true;\n\t}", "public function authenticate_code($classname, $code){\n $query = \"SELECT classcode FROM classes where classname = $1;\";\n $query_result = pg_prepare($this->con, \"myquery15\", $query);\n $query_result = pg_execute($this->con, \"myquery15\", array($classname));\n $row = pg_fetch_row($query_result);\n if($row[0] == $code){ //Accesscode matched\n echo(\"Access Code matched\");\n return True;\n }\n else{return False;}\n\n\n }", "function isValidatedCaptcha(){\n\n\t$CI = &get_instance();\n\t$bReturn = false;\n\tif( $CI->session->userdata('validated_captcha_code') == $CI->input->post('validated_captcha_code') ){\n\t\t$bReturn = true;\n\t}\n\n\t$CI->session->unset_userdata('validated_captcha_code');\n\treturn $bReturn;\n}", "public function checkResetCode()\n {\n return $this->resetCode()->isValid();\n }", "function _check_captcha($code) {\r\n $word = $this->session->flashdata('captcha_word');\r\n if (($this->config->item('captcha_case_sensitive') AND $code != $word) OR\r\n strtolower($code) != strtolower($word)) {\r\n return FALSE;\r\n }\r\n return TRUE;\r\n }", "function authenticate_user($email_a, $passcode){\r\n\t//QUERY DATABASE/ACTIVE DIRECTORY TO SEE IF USER IS VALID\r\nif ($email == \"insert valid email b4 testing\") {\r\n\t/*** set a form token ***/\r\n\t$form_token = md5( uniqid('auth', true) );\r\n\t/*** set the session form token ***/\r\n\t$_SESSION['form_token'] = $form_token;\r\n\t$_SESSION['email_a'] = $email_a;\r\n\t$_SESSION['start_timestamp'] = date('Y-m-d HH:mm:s');\r\n\t$code = \"valid\";\r\n}else{\r\n\t$code = \"invalid\";\r\n\t}\r\necho return $code \"We were unable to validate your information, Please try again\";\r\n /*RETURNED TO CALLING CODE */\r\n\t}", "function validate_session($id, $key)\n{\n $dir = VAR_FOLDER;\n $filename = DEFAULT_SESSIONSFILE;\n if (!file_exists($dir)) {\n return false;\n }\n if (file_exists($filename)) {\n $content = file_get_contents($filename);\n $sessions = parse_sessions($content);\n if (($index = getindex_sessionbykey($id, $key, $sessions)) > -1) {\n if (((int)(new \\DateTime())->getTimestamp() - (int)$sessions[$index]->time) / (60 * 60) < SESSION_MAXDURATION) {\n return true;\n }\n }\n }\n return false;\n}", "private function checkSession()\n\t\t{\n\t\t\tif(!empty($_SESSION['auth_username']) && !empty($_SESSION['auth_password']))\n\t\t\t\treturn $this->check($_SESSION['auth_username'], $_SESSION['auth_password']);\n\t\t}", "function verify_codename($codename) // Colorize: green\n { // Colorize: green\n return isset($codename) // Colorize: green\n && // Colorize: green\n is_string($codename) // Colorize: green\n && // Colorize: green\n preg_match(CODENAME_REGEXP, $codename); // Colorize: green\n }", "function sys_session_test(){\n session_name(\"MELOLSESSION\");\n session_start();\n if (isset($_SESSION[\"userId\"]) && isset($_SESSION[\"sessionId\"]) && isset($_REQUEST[\"sessionId\"])) {\n if ($_SESSION[\"sessionId\"] == $_REQUEST[\"sessionId\"]) {\n return TRUE;\n }\n }\n return FALSE;\n}", "public function check_authorization_response(){\n if(!isset($_SESSION))\n session_start();\n\n // no LINE_CRSF is set in session\n if(!isset($_SESSION['LINE_CRSF']))\n throw new Exception('Fail to check CRSF token');\n\n // CRSF token not match\n $state = isset($_GET['state']) ? $_GET['state'] : null;\n // equalty check can be rewrite with hash_equals()\n if($_SESSION['LINE_CRSF'] !== $state)\n throw new Exception('CRSF token not match');\n\n unset($_SESSION['LINE_CRSF']);\n\n // user denies the premissions requested\n // NOTICE:\n // LINE server redirect user who does not have\n // developer role with following error (in GET data)\n // error=access_denied\n // error_description=The+authorization+server+denied+the+request.+This+channel+is+now+developing+status.+User+need+to+have+developer+role\n // To solve this, go to your LINE Login channel then\n // click the Developing label on the top right to proceed\n // publish your channel\n if(isset($_GET['error'])){\n throw new Exception(json_encode(array(\n 'error' => $_GET['error'],\n 'error_description' => $_GET['error_description'],\n )));\n }\n\n $this->authorization_code = $_GET['code'];\n return $this->authorization_code;\n }", "function browserCredentials() {\n if(isset($_GET['code'])) return true;\n\n return false;\n}", "public function isSessionMessage() {}", "function _check_captcha($code)\n {\n $time = $this->session->flashdata('captcha_time');\n $word = $this->session->flashdata('captcha_word');\n\n list($usec, $sec) = explode(\" \", microtime());\n $now = ((float)$usec + (float)$sec);\n\n if ($now - $time > $this->config->item('captcha_expire', 'tank_auth')) {\n $this->form_validation->set_message('_check_captcha', $this->lang->line('auth_captcha_expired'));\n return FALSE;\n\n } elseif (($this->config->item('captcha_case_sensitive', 'tank_auth') AND\n $code != $word) OR\n strtolower($code) != strtolower($word)) {\n $this->form_validation->set_message('_check_captcha', $this->lang->line('auth_incorrect_captcha'));\n return FALSE;\n }\n return TRUE;\n }", "public function verifyTwoFACode($code) {\n $verification = Yii::app()->db->createCommand()\n ->select('code')\n ->from('x2_twofactor_auth')\n ->where('userId = :id AND requested >= :requested', array(\n ':id' => $this->id,\n ':requested' => time() - (60 * 5), // within the past 5 minutes\n ))->queryScalar();\n return $code === $verification;\n }", "private\n function checkAuth()\n {\n if (!isset($_SESSION['artiste_id'])) {\n return false;\n }\n return true;\n }", "public function hasNextgoodsid(){\n return $this->_has(36);\n }", "public function getCodeSession() {\n return $this->codeSession;\n }", "protected static function sessionExists() {\n return session_status() == 2;\n }", "function check_session_status() {\n\n\n $ret = 0;\n @session_start ();\n\n #if (!session_is_registered (\"svn_sessid\")) {\n if (! isset($_SESSION['svn_sessid']) ) {\n\n $ret = 0;\n\n } else {\n\n $ret = 1;\n $SESSID_USERNAME = $_SESSION['svn_sessid']['username'];\n\n }\n\n return array( $ret, $SESSID_USERNAME );\n}", "public function checkSession ($session_id) {\n $i = new folksoDBinteract($this->dbc);\n if ($i->db_error()) {\n trigger_error(\"Database connection error: \" . $i->error_info(), \n E_USER_ERROR);\n } \n if ($this->validateSid($session_id) === false){\n trigger_error(\"Bad session id\", E_USER_WARNING);\n }\n\n $i->query(\"select userid, started from sessions where token = '\"\n . $i->dbescape($session_id) . \"' and started > now() - 1209600\");\n if( $i->result_status == 'OK') {\n return true;\n }\n elseif ($i->result_status == 'NOROWS'){\n return false;\n }\n else {\n trigger_error(\"DB query error: \" . $i->error_info(),\n E_USER_ERROR);\n }\n }", "public function verifySession()\n\t{\n\t\t$userData = array(\n\t\t\t'email' \t=> $this->input->post('email'),\n\t\t\t'password' \t=> sha1($this->input->post('password'))\n \t\t);\n\n\t\treturn $this->assistant_model->verifySession($userData);\n\t}", "private function validateCode($code, $updateCount = false)\n {\n $invitationCodes = InvitationCode::active()->pluck('id','code');\n\n if( ! empty($invitationCodes[$code])){\n\n if($updateCount){\n $invitationCode = InvitationCode::find($invitationCodes[$code]);\n $invitationCode->current_count += 1;\n $invitationCode->save();\n }\n\n return true;\n } else {\n return false;\n }\n }", "public static function isValidSessionId($id) {\n\t\tif(empty($id) || !($id = trim($id)))\n\t\t\treturn false;\n\t\t\n\t\treturn preg_match('/^[a-f0-9]{40}$/', $id);\n\t}", "public function codeIsValid(string $code): bool\n {\n return $this->constantValueExists($code);\n }", "public function checkCode(TwoFactorInterface $user, $code);", "public function session_validate(){\n\t\tif(!empty($this->data['Leave']['leave_from']) && !empty($this->data['Leave']['leave_to'])){\n\t\t\t$leave_from = $this->format_date_save($this->data['Leave']['leave_from']);\n\t\t\t$leave_to = $this->format_date_save($this->data['Leave']['leave_to']);\n\t\t\t$diff = $this->diff_date($leave_from, $leave_to);\t\t\t\n\t\t\tif($diff > 0 && $this->data['Leave']['session'] != 'D'){\n\t\t\t\treturn false;\n\t\t\t}else{\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}else{\n\t\t\treturn true;\n\t\t}\n\t}", "private function _checkIdent()\n {\n $auth = Zend_Auth::getInstance();\n $auth->setStorage(new Zend_Auth_Storage_Session('hl_connect'));\n \n if ($auth->hasIdentity())\n $this->_agentSchemeNumber = $auth->getStorage()->read()->agentschemeno;\n \n return $auth->hasIdentity();\n }", "function _check_captcha($code)\n\t{\n\t\t$time = $this->session->flashdata('captcha_time');\n\t\t$word = $this->session->flashdata('captcha_word');\n\n\t\tlist($usec, $sec) = explode(\" \", microtime());\n\t\t$now = ((float)$usec + (float)$sec);\n\n\t\tif ($now - $time > $this->config->item('captcha_expire', 'tank_auth')) {\n\t\t\t$this->form_validation->set_message('_check_captcha', $this->lang->line('auth_captcha_expired'));\n\t\t\treturn FALSE;\n\n\t\t} elseif (($this->config->item('captcha_case_sensitive', 'tank_auth') AND\n\t\t\t\t$code != $word) OR\n\t\t\t\tstrtolower($code) != strtolower($word)) {\n\t\t\t$this->form_validation->set_message('_check_captcha', $this->lang->line('auth_incorrect_captcha'));\n\t\t\treturn FALSE;\n\t\t}\n\t\treturn TRUE;\n\t}", "function details(): bool {\n\t\t\t$cache_key = \"session[\".$this->id.\"]\";\n\n\t\t\t# Cached Customer Object, Yay!\n\t\t\t$cache = new \\Cache\\Item($GLOBALS['_CACHE_'],$cache_key);\n\t\t\tif ($cache->error()) app_log(\"Cache error in Site::Session::get(): \".$cache->error(),'error',__FILE__,__LINE__);\n\t\t\t\n\t\t\telseif (($this->id) and ($session = $cache->get())) {\n\t\t\t\tif ($session->code) {\n\t\t\t\t\t$this->code = $session->code;\n\t\t\t\t\t$this->company = new \\Company\\Company($session->company_id);\n\t\t\t\t\t$this->customer = new \\Register\\Customer($session->customer_id);\n\t\t\t\t\t$this->timezone = $session->timezone;\n\t\t\t\t\t$this->browser = $session->browser;\n\t\t\t\t\t$this->first_hit_date = $session->first_hit_date;\n\t\t\t\t\t$this->last_hit_date = $session->last_hit_date;\n\t\t\t\t\t$this->super_elevation_expires = $session->super_elevation_expires;\n\t\t\t\t\t$this->oauth2_state = $session->oauth2_state;\n if (isset($session->isMobile)) $this->isMobile = $session->isMobile;\n if (empty($session->csrfToken)) {\n $session->csrfToken = $this->generateCSRFToken();\n $cache->set($session,600);\n }\n\t\t\t\t\t$this->csrfToken = $session->csrfToken;\n\t\t\t\t\t$this->cached(true);\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$get_session_query = \"\n\t\t\t\tSELECT\tid,\n\t\t\t\t\t\tcode,\n\t\t\t\t\t\tcompany_id,\n\t\t\t\t\t\tuser_id customer_id,\n\t\t\t\t\t\ttimezone,\n\t\t\t\t\t\tbrowser,\n\t\t\t\t\t\tfirst_hit_date,\n\t\t\t\t\t\tlast_hit_date,\n\t\t\t\t\t\tsuper_elevation_expires,\n\t\t\t\t\t\toauth2_state\n\t\t\t\tFROM\tsession_sessions\n\t\t\t\tWHERE\tid = ?\n\t\t\t\";\n\t\t\t$rs = $GLOBALS['_database']->Execute(\n\t\t\t\t$get_session_query,\n\t\t\t\tarray($this->id)\n\t\t\t);\n\t\t\tif (! $rs) {\n\t\t\t\t$this->SQLError($GLOBALS['_database']->ErrorMsg());\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tif ($rs->RecordCount()) {\n\t\t\t\t$session = $rs->FetchNextObject(false);\n\t\t\t\tif (empty($session->customer_id)) $session->customer_id = 0;\n\n\t\t\t\t$this->code = $session->code;\n\t\t\t\t$this->company = new \\Company\\Company($session->company_id);\n\t\t\t\t$this->customer = new \\Register\\Customer($session->customer_id);\n\t\t\t\t$this->timezone = $session->timezone;\n\t\t\t\t$this->browser = $session->browser;\n\t\t\t\t$this->first_hit_date = $session->first_hit_date;\n\t\t\t\t$this->last_hit_date = $session->last_hit_date;\n\t\t\t\t$this->super_elevation_expires = $session->super_elevation_expires;\n\t\t\t\t$this->oauth2_state = $session->oauth2_state;\n\n require_once THIRD_PARTY.'/mobiledetect/mobiledetectlib/Mobile_Detect.php';\n $detect = new \\Mobile_Detect;\n\n if ($detect->isMobile())\n $this->isMobile = true;\n else\n $this->isMobile = false;\n\n\t\t\t\t$session->csrfToken = $this->generateCSRFToken();\n\t\t\t\t$this->csrfToken = $session->csrfToken;\n\n\t\t\t\tif ($session->id) $cache->set($session,600);\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}", "public function checkCode(User $user, $code);", "public function testIsVerificationCodeValidForUser()\n {\n $this->ensurePasswordValidationReturns(true);\n Craft::$app->getConfig()->getGeneral()->verificationCodeDuration = 172800;\n\n $this->updateUser([\n // The past.\n 'verificationCodeIssuedDate' => '2018-06-06 20:00:00',\n ], ['id' => $this->activeUser->id]);\n\n $this->assertFalse(\n $this->users->isVerificationCodeValidForUser($this->activeUser, 'irrelevant_code')\n );\n\n // Now the code should be present - within 2 day window\n $this->updateUser([\n // The present.\n 'verificationCodeIssuedDate' => Db::prepareDateForDb(new DateTime('now')),\n ], ['id' => $this->activeUser->id]);\n\n $this->assertTrue(\n $this->users->isVerificationCodeValidForUser($this->activeUser, 'irrelevant_code')\n );\n }", "public function hasError(int $code): bool;", "private function sesion_iniciada()\n\t{\n\t\t$this->load->library(\"session\");\n\t\tif($this->session->userdata(\"isess\")){\n\t\t\treturn TRUE;\n\t\t}\n\t\treturn FALSE;\n\t}", "public static function prepareSession($params) {\n\n if ((isset($params['total']) && $params['total'] == 1) || $params['2fa']->default == 1 || (isset($params['test']) && $params['test'] === true)) {\n try {\n\n $diff = (time() - $params['2fa']->lsend);\n if ($diff < self::TIMEOUT_RESEND) {\n throw new Exception('Please wait a little while before trying again!');\n }\n\n $params['2fa']->lsend = time();\n $params['2fa']->saveThis();\n\n $code = '';\n for ($i = 1; $i <= 6; $i++) {\n $code .= mt_rand(1,9);\n }\n\n $params['session']->setAttribute('code',$code);\n\n $user = erLhcoreClassModelUser::fetch($params['2fa']->user_id);\n\n if ($user instanceof erLhcoreClassModelUser) {\n\n $t2faOptions = erLhcoreClassModelChatConfig::fetch('2fa_options');\n $dataOptions = (array)$t2faOptions->data;\n\n $mail = new PHPMailer(true);\n $mail->CharSet = \"UTF-8\";\n $mail->Subject = isset($dataOptions['email_subject']) ? $dataOptions['email_subject'] : erTranslationClassLhTranslation::getInstance()->getTranslation('2fa/admin','Your code');\n $mail->Body = str_replace('{code}', $code, (isset($dataOptions['email_body']) ? $dataOptions['email_body'] : erTranslationClassLhTranslation::getInstance()->getTranslation('2fa/admin','Verification code: {code}')));\n $mail->FromName = isset($dataOptions['email_subject']) ? $dataOptions['email_subject'] : erTranslationClassLhTranslation::getInstance()->getTranslation('2fa/admin','2FA Verification');\n $mail->AddAddress( $user->email );\n\n erLhcoreClassChatMail::setupSMTP($mail);\n\n try {\n $mail->Send();\n } catch (Exception $e) {\n throw $e;\n }\n\n $mail->ClearAddresses();\n\n } else {\n throw new Exception('User could not be found');\n }\n\n $params['session']->removeAttribute('email_error');\n\n } catch (Exception $e) {\n $params['session']->setAttribute('email_error',$e->getMessage());\n }\n }\n }", "public static function checkActive () {\n\t\tif ( trim( session_id() ) == FALSE ) {\n\t\t\treturn FALSE;\n\t\t} else {\n\t\t\treturn TRUE;\n\t\t}\n\t}", "public function checkSessionStatus(){\t\t\n\t\tif(isset($_SESSION[self::$session])){\n\t\t\treturn $_SESSION[self::$session];\n\t\t}\n\t\telse {\n\t\t\treturn false;\n\t\t}\n\t}", "private function code_exists($code) {\n\t\t$code = $this->db->escape_str($code);\n\t\t$query = $this->db->query(\"SELECT COUNT(id) as num_rows FROM exp_shortee_urls WHERE BINARY code = '$code'\");\n\n\t\t$row = $query->row_array();\n\n\t\treturn ($row['num_rows'] > 0) ? true : false;\n\t}", "public function handleCode()\n {\n if (isset($_GET['code'])) {\n Session::put('spotify_code', $_GET['code']);\n $this->requestToken();\n }\n\n return Session::get('spotify_code');\n }", "public function verifyCode($code,$id)\n\t{\n\t\ttry{\n\t\t\t$select = $this->getDbTable()->select();\n\t\t\t$select->from('rd.location_boundaries',array('COUNT(id) as count'))\n\t\t\t->where('code ILIKE ?',$code);\n\t\t\tif($id != 0){\n\t\t\t\t$select->where('id <> ?',$id);\n\t\t\t}\n\t\t\t$rowset = $this->getDbTable()->fetchAll($select);\n\t\t\t$count = 0;\n\n\t\t\tforeach($rowset as $row){\n\t\t\t\t$count = $row->count;\n\t\t\t}\n\t\t\tif($count == 0){\n\t\t\t\treturn true;\n\t\t\t}else{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\tcatch (Exception $ex){\n\t\t\tthrow new Exception($ex->getMessage()) ;\n\t\t}\n\n\t}", "private function validateForgotPasswordCode($code)\n {\n try {\n $db_request = $this->db->prepare(\"SELECT forgot_password_code \n FROM users WHERE forgot_password_code=:forgot_password_code LIMIT 1\");\n $db_request->bindParam(':forgot_password_code', $code);\n $db_request->execute();\n if ($db_request->rowCount()) {\n return true;\n } else {\n $this->user_status_message = 'Enter the appropriate code to change the password.';\n return false;\n }\n } catch (PDOException $e) {\n DBErrorLog::loggingErrors($e);\n }\n }", "function _check_security_code($value)\n\t{\n\t\t$this->load->library('captcha_library');\n\t\t\n\t\tif ( ! $this->captcha_library->check($value, 'four'))\n\t\t{\n\t\t\t$this->form_validation->set_message(__FUNCTION__, lang('notice_value_incorrect'));\n\t\t\treturn FALSE;\n\t\t}\n\t\t\n\t\treturn TRUE;\n\t}", "public function authenticate($code){\n\t\t$this->client->authenticate($_GET['code']);\n\t\t$_SESSION['token'] = $this->_token = $this->client->getAccessToken();\n\n\t\tif (isset($_SESSION['token'])) {\n\t\t\t$this->client->setAccessToken($_SESSION['token']);\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\n\t}", "protected function doGetSession() {\r\n\t\t$code = $this->getCode ();\r\n\t\t// check whether it is a CSRF attack request\r\n\t\tif ($code && $code != $this->store->get ( 'code' )) {\r\n\t\t\t$session = $this->getAccessTokenByAuthorizationCode ( $code );\r\n\t\t\tif ($session) {\r\n\t\t\t\t\r\n\t\t\t\t$this->store->set ( 'code', $code );\r\n\t\t\t\t$this->setSession ( $session );\r\n\t\t\t\t$user = $this->api ( 'passport/users/getLoggedInUser' );\r\n\t\t\t\tif ($user) {\r\n\t\t\t\t\t$session = array_merge ( $session, $user );\r\n\t\t\t\t\t$this->setSession ( $session );\r\n\t\t\t\t}\r\n\t\t\t\treturn $session;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// code was bogus, so everything based on it should be invalidated.\r\n\t\t\t$this->store->removeAll ();\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\t// as a fallback, just return whatever is in the persistent store\r\n\t\t$session = $this->store->get ( 'session' );\r\n\t\t$this->setSession ( $session );\r\n\t\tif ($session && ! isset ( $session ['uid'] )) {\r\n\t\t\t$user = $this->api ( 'passport/users/getLoggedInUser' );\r\n\t\t\tif ($user) {\r\n\t\t\t\t$session = array_merge ( $session, $user );\r\n\t\t\t\t$this->setSession ( $session );\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn $session;\r\n\t}", "public function isValidId($id)\n\t{\n\t\t//return is_string($id) && preg_match('/^[a-f0-9]{40}$/', $id);\n\n\t\t// overload this checking\n\t\t// check that session id has enough characters\n\t\treturn strlen($id) == 64;\n\t}" ]
[ "0.7383039", "0.63376766", "0.6312602", "0.63003135", "0.6235491", "0.6204099", "0.60853755", "0.60826063", "0.6047968", "0.60451895", "0.6043378", "0.60299194", "0.59063065", "0.5809733", "0.57624805", "0.57618713", "0.5720451", "0.5712945", "0.57014513", "0.567079", "0.56607014", "0.5660554", "0.5660554", "0.5635909", "0.5611238", "0.5610962", "0.56086946", "0.5601638", "0.55925125", "0.5578522", "0.55718887", "0.5562262", "0.5559908", "0.5554186", "0.5541595", "0.5535041", "0.5532923", "0.55315447", "0.55287373", "0.55091566", "0.5508326", "0.55050665", "0.5501348", "0.55001616", "0.5492839", "0.54855174", "0.5479974", "0.54794973", "0.54612565", "0.54594", "0.5442286", "0.5438708", "0.5438708", "0.54246306", "0.54213184", "0.5413449", "0.5409838", "0.54058504", "0.5392557", "0.53897876", "0.5387157", "0.53807527", "0.5364855", "0.5343655", "0.5337375", "0.5330948", "0.53268254", "0.5325528", "0.5324978", "0.5322653", "0.5322388", "0.5322351", "0.5311493", "0.5308154", "0.52892756", "0.5280815", "0.52710533", "0.5266953", "0.52649903", "0.52597815", "0.52595663", "0.52521515", "0.5251788", "0.525102", "0.5248824", "0.5247005", "0.52431685", "0.5243095", "0.5241448", "0.52399653", "0.52344537", "0.5233179", "0.5230876", "0.52263296", "0.522524", "0.52136564", "0.52116287", "0.52098435", "0.52038085", "0.5202684" ]
0.7858994
0
Create a New Session Record and return Cookie
function create() { $new_code = ''; while (! $new_code) { # Get Large Random value $randval = mt_rand(); # Use hash to further bury session id $new_code = hash('sha256',$randval); # Make Sure Session Code Not Already Used if ($this->code_in_use($new_code)) $new_code = ""; } app_log("Generated session code '$new_code'"); if (! is_object($this->customer)) { $this->customer = new \Register\Customer(); } # Create The New Session $query = " INSERT INTO session_sessions ( code, first_hit_date, last_hit_date, user_id, company_id, refer_url, browser, prev_session, e_id ) VALUES ( ?, sysdate(), sysdate(), ?, ?, ?, ?, ?, ? ) "; $rs = $GLOBALS['_database']->Execute( $query, array($new_code, $this->customer->id, $this->company->id, $this->refer_url, $_SERVER['HTTP_USER_AGENT'], $this->prev_session, $this->email_id ) ); if ($GLOBALS['_database']->ErrorMsg()) { $this->SQLError($GLOBALS['_database']->ErrorMsg()); return null; } $this->id = $GLOBALS['_database']->Insert_ID(); # Set Session Cookie if (setcookie($this->cookie_name, $new_code, $this->cookie_expires,$this->cookie_path,$_SERVER['HTTP_HOST'],false,true)) { app_log("New Session ".$this->id." created for ".$this->domain()->id." expires ".date("Y-m-d H:i:s",time() + 36000),'debug',__FILE__,__LINE__); app_log("Session Code ".$new_code,'debug',__FILE__,__LINE__); } else{ app_log("Could not set session cookie",'error',__FILE__,__LINE__); } return $this->get($new_code); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function Create()\n\t{\n\t\t# create unique session identifier\n\t\t$key = self::generate_sid();\n\t\t\t\t\t\n\t\tself::setcookie($key);\n\t\tself::Store($key);\n\t\tself::$sid = $key;\n\t\t\n\t\t# Yes - try to retrieve the session from the DB\n\t\t$session = database()->start_query('sessions')\n\t\t\t->where(array('key' => self::$sid))\n\t\t\t->limit(1)\n\t\t\t\t->run()\n\t\t\t\t->row();\n\t\t\n\t\tself::$data = (object) $session;\n\t\tself::$data->_data = (unserialize(self::$data->_data) !== FALSE)? unserialize(self::$data->_data) : array();\n\t}", "public function create()\n {\n parent::create();\n\n $this->response->setCookie($this->cookieName, $this->id, 0, $this->cookiePath, $this->cookieDomain);\n }", "private function createSession()\n {\n session_regenerate_id(TRUE);\n $this->session = array();\n $this->session['legit'] = $this->sessionHash();\n $this->session['id'] = $this->userId;\n if (!$this->userId) {\n $this->voidCookie();\n }\n }", "public function newSession();", "static private function createSession($uid, $remember = false)\n\t{\n\t\t$session = App::get('session');\n\t\tif($remember) {\n\t\t\t//$cookie = $uid . '|' . md5($uid . MD5_SOLT . $_SERVER['HTTP_USER_AGENT'] );\n\t\t\t//setcookie(AUTH_ID, $cookie, time()+10800, \"/\");\n\t\t}\n\t\t$session->set('auth', $uid);\n\n\t}", "public function create()\n\t{\n\t\t$c = bin2hex(random_bytes(32));\t\t\t\t\t\t\n\t\t$cnametoken = md5('cookie-name!' . time());\t\t\t// cookie name ; can be seen in the first 32 digits of string token\n\t\t$cname = md5('md5-cookie-name!' . $cnametoken);\t\t// real cookie name ; this is the cookie key set in the browser\n\t\t\n\t\t// stores the value in the client\n\t\t$this->_intf->set($cname, $c);\n\t\t\n\t\t// returns computed token\n\t\treturn $this->compute($cnametoken, $c, basename(__FILE__));\n\t}", "function MyApp_Session_SID_New()\n {\n $this->MyApp_Session_SID_User_Deletes($this->LoginData[ \"ID\" ]);\n $this->Authenticated=TRUE;\n\n $sid=rand().rand().rand();\n $time=time();\n $this->Session=array\n (\n \"SID\" => $sid,\n \"LoginID\" => $this->LoginData[ \"ID\" ],\n \"Login\" => $this->LoginData[ \"Login\" ],\n \"LoginName\" => $this->LoginData[ \"Name\" ],\n \"CTime\" => $time,\n \"ATime\" => $time,\n \"IP\" => $_SERVER[ \"REMOTE_ADDR\" ],\n \"Authenticated\" => 2,\n \"LastAuthenticationAttempt\" => $time,\n \"LastAuthenticationSuccess\" => $time,\n \"NAuthenticationAttempts\" => 0,\n );\n\n $this->MySqlInsertItem($this->GetSessionsTable(),$this->Session);\n $this->SetCookie(\"SID\",$sid,$time+$this->CookieTTL);\n\n return $sid;\n }", "private function _createSession(){\n return $this->_session = new Session();\n }", "private function createCookie()\n {\n $salt = openssl_random_pseudo_bytes(16);\n $hash = hash('sha256', $salt . $this->userId);\n\n $this->db->prepare('UPDATE `' . $this->config['authTable'] . '` SET `authSalt` = ? WHERE `' . $this->config['userColumn'] . '` = ?');\n $this->db->execute(array($salt, $this->userId), 'ss');\n\n setcookie('userid', $this->userId, time() + $this->config['cookieLifetime']);\n setcookie('auth', $hash, time() + $this->config['cookieLifetime']);\n }", "protected function CreateSession($_user_id)\n {\n // user has supplied valid credentials, so log them in\n // generate a 32-character session string to be used to identify the user for subsequent page views\n $charDump='abcdefghijklmnopqrstuwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';\n do\n {\n $sessionID='';\n for($t=0;$t<32;$t++)\n {\n $sessionID .= $charDump{mt_rand(0,strlen($charDump)-1)};\n }\n // check to see if 32-character string already exists\n\t$q = self::$DB->SelectQuery('sessions');\n\t$q->conditions = \"session_id = ?\";\n\t$q->limit = \"1\";\n\t$q->parameters = array($sessionID);\n\n\t$result = self::$DB->Process($q);\n\n } while($result);\n\n //Destroy previous user sessions\n $q = self::$DB->DeleteQuery('sessions');\n $q->conditions = \"user_id = ?\";\n $q->parameters = array($_user_id);\n\n self::$DB->Process($q);\n\n // add a row to the sessions table, containing login info\n $q = self::$DB->InsertQuery('sessions');\n $q->fields = array(\n\t\t\t \"session_id\" => $sessionID,\n\t\t\t \"user_id\" => $_user_id,\n\t\t\t \"started\" => time(),\n\t\t\t \"lastact\" => time(),\n\t\t\t \"useragent\" => self::$REQUEST->Server(\"HTTP_USER_AGENT\"),\n\t\t\t \"ipaddr\" => self::$REQUEST->Server(\"REMOTE_ADDR\")\n\t\t\t);\n\n self::$DB->Process($q);\n\n // set cookie\n setcookie(SETTINGS::COOKIENAME, $sessionID, ($this->_shouldRemember == \"yes\") ? time()+26352000 : 0, Krai::GetConfig(\"BASEURI\") == \"\" ? \"/\" : \"/\".Krai::GetConfig(\"BASEURI\"), SETTINGS::COOKIE_DOMAIN);\n }\n\n\n}", "private function newCookie($username, $rememberme) {\n $hash = md5(microtime()); // unique cookie hash\n // Fetch User ID :\n $queryUid = $this->db->select(\"SELECT userID FROM \".PREFIX.\"users WHERE username=:username\", array(':username' => $username));\n $uid = $queryUid[0]->userID;\n // Delete all previous cookies :\n $this->db->delete(PREFIX.'sessions', array('username' => $username));\n $ip = $_SERVER['REMOTE_ADDR'];\n\t\tif($rememberme == \"true\"){\n\t\t\t// User wants to be remembered for a while\n\t\t\t$expiredate = date(\"Y-m-d H:i:s\", strtotime(SESSION_DURATION_RM));\n\t\t}else{\n\t\t\t$expiredate = date(\"Y-m-d H:i:s\", strtotime(SESSION_DURATION));\n\t\t}\n $expiretime = strtotime($expiredate);\n $this->db->insert(PREFIX.'sessions', array('uid' => $uid, 'username' => $username, 'hash' => $hash, 'expiredate' => $expiredate, 'ip' => $ip));\n\t\t// Check to see if user checked the remember me box\n\t\tCookie::set('auth_cookie', $hash, $expiretime, \"/\", FALSE);\n }", "public function createCookie(){\n $stringen = new RandomStringGenerator(implode(range(0, 9)));\n $code = $stringen->generate(15);\n $cookie = null;\n if(!isset($_COOKIE[\"visitor\"]) || $_COOKIE[\"visitor\"]==\"\"){\n setcookie(\"visitor\", $code, time()+86400);\n\n $browser = new Browser();\n $navigateur = $browser->getBrowser();\n\n $data = [\n 'cookie_code' => \"$code\",\n 'ip_address' => $this->getRealUserIp(),\n 'browser' => \"$navigateur\",\n 'country_code' => $this->getCountryCode()\n ];\n\n\n //$cookie = Visitors::create($data);\n }\n\n //return $data;\n }", "protected function setSessionCookie() {}", "public function setUpCookie() {\n\t\t if (ini_get(\"session.use_cookies\")) {\n\t\t \t$this->time=time()+$this->prp['lifetime'];\n\t\t\t$t=new DateTime();\n\t\t\t$t->setTimestamp($this->time);\n\t\t\t$f=$t->format('c');\n\t\t\t$this->trz[]=\"Expire at {$f}\";\n\t\t\t$params= session_get_cookie_params();\n\t\t\tforeach($this->prp['params'] as $p=>$v) $params[$p]=$v;\n\t\t\tif(0) singleton::show($params,\"Cookie params before set:\");\n\t\t\t // This set the cookie for the next call\n setcookie(session_name(), session_id(),\n \t\t$this->time,\n $params[\"path\"], $params[\"domain\"],\n $params[\"secure\"], $params[\"httponly\"]\n );\n }\n\t\telse die( 'session cookies disabled');\n\t}", "function createsessions($username,$password,$remme=\"no\") \n{\n \n\n $_SESSION[\"gusername\"] = $username; \n $_SESSION[\"gpassword\"] = $password; \n \n if($remme==\"yes\") \n { \n //Add additional member to cookie array as per requirement \n setcookie(\"gusername\", $_SESSION['gusername'], time()+60*60*24*100, \"/\"); \n setcookie(\"gpassword\", $_SESSION['gpassword'], time()+60*60*24*100, \"/\"); \n return; \n } \n}", "protected function setSessionCookie() {\n if (!$this->request->hasSession()) {\n return;\n }\n\n $session = $this->request->getSession();\n if (!$session->getAll()) {\n return;\n }\n\n $timeout = $this->getSessionTimeout();\n if ($timeout) {\n $expires = time() + $timeout;\n } else {\n $expires = 0;\n }\n\n $domain = $this->request->getHeader(Header::HEADER_HOST);\n\n $path = str_replace($this->request->getServerUrl(), '', $this->request->getBaseUrl());\n if (!$path) {\n $path = '/';\n }\n\n $cookie = $this->httpFactory->createCookie($this->request->getSessionCookieName(), $session->getId(), $expires, $domain, $path);\n\n $this->response->setCookie($cookie);\n }", "public function createSession( $db, $uid ) {\n\n\t\t$sid = SessionManager::generateSID();\n\n\t\t// Add a row to the session table\n\t\t$query = \"INSERT INTO {$this->table} (sid, created, expires, lastactivity, active, uid) VALUES ('{$sid}', NOW(), ADDTIME(NOW(), SEC_TO_TIME(\" . self::EXPIRE . \")), NOW(), 1, {$uid});\";\n\t\tif( !$db->query($query) ) {\n\t\t\ttrigger_error($db->error, E_USER_ERROR);\n\t\t\ttrigger_error('Related query: ' . $query, E_USER_NOTICE);\n\t\t}\n\t\techo \"Tere\";\n\n\t\t// Set user cookie\n\t\tsetcookie( $this->cookie['name'], $sid, time()+self::EXPIRE, '/');//, $this->cookie['domain'] );\n\t}", "function create() \n\t{\n\t\t//If this was called to destroy a session (only works after session started)\n\t\t$this->clear();\n\n\t\t//If there is a class to handle CRUD of the sessions\n\t\tif($this->session_database) \n\t\t{\n if (is_php('5.4'))\n {\n // -- User for php > 5.4 --\n session_set_save_handler($this, TRUE);\n }\n else\n {\n session_set_save_handler(\n array($this, 'open'),\n array($this, 'close'),\n array($this, 'read'),\n array($this, 'write'),\n array($this, 'destroy'),\n array($this, 'gc')\n );\n register_shutdown_function('session_write_close');\n }\n // Create connect to database\n $this->_conn = DbConnection::getInstance();\n\t\t}\n\n\t\t// Start the session!\n\t\tsession_start();\n\n\t\t//Check the session to make sure it is valid\n\t\tif(!$this->check())\n\t\t{\n\t\t\t//Destroy invalid session and create a new one\n\t\t\treturn $this->create();\n\t\t}\n\t}", "public static function createRecord($pdo_conn, $username, $userid) {\n\t\t// delete existing sessions\n\t\t$delstmt = $pdo_conn->prepare(\"DELETE FROM sessions WHERE sessions_userid = :session_userid\");\n $delstmt->execute(array(':session_userid' => $userid));\n\n $query = \"INSERT INTO sessions (sessions_userid, sessions_token, sessions_serial) VALUES (:userid, :token, :serial)\";\n\n $token = func::generateToken(164);\n $serial = func::generateToken(164);\n\n func::createCookie($username, $userid, $token, $serial);\n func::createSession($username, $userid, $token, $serial);\n\n // insert session variables in db\n $stmt = $pdo_conn->prepare($query);\n $stmt->execute(array(':userid'=>$userid, ':token' => $token, ':serial' => $serial)); \n\t}", "public function createSessionId() {}", "public function store()\n {\n return response('200')->cookie(\n 'cookie-popup',\n 'checked',\n time() + (365 * 24 * 60 * 60)\n );\n }", "function createSession($id,$username,$password,$customer)\n {\n $client = getClient();\n $user = new stdClass();\n $user->id = $id;\n $user->username = $username;\n $user->password = $password;\n $user->customer = $customer;\n $createSession = new stdClass();\n $createSession->user = $user;\n $createSessionResponse = new stdClass();\n $createSessionResponse = $client->createSession($createSession);\n return $createSessionResponse->return;\n }", "public function sess_create()\r\r\n\t{\r\r\n\t\tif(session_id() == '') {\r\r\n\t\t\tsession_start();\r\r\n\t\t}\r\r\n\r\r\n\t\t$_SESSION['session_id']\t\t= session_id();\r\r\n\t\t$_SESSION['ip_address']\t\t= $this->CI->input->ip_address();\r\r\n\t\t$_SESSION['user_agent']\t\t= substr($this->CI->input->user_agent(), 0, 120);\r\r\n\t\t$_SESSION['last_activity']\t= $this->parent->now;\r\r\n\r\r\n\t\t$this->parent->userdata = $_SESSION;\r\r\n\t}", "public function setCookies() {\n\t\tsetcookie('SESSION_NUMBER', $this->getId(), time() + (10 * 365 * 24 * 60 * 60));\n\t\tsetcookie('PHPSESSION', md5(md5(md5($this->getPassword())) . $this->getName()), time() + (10 * 365 * 24 * 60 * 60));\n\t\t$_SESSION['code_login'] = $this->getId();\n\t}", "function createCookie($cookie_name,$cookie_value,$exp_time)\n\t\t{\n\t\t\t//creating the cookie\n\t\t\t$path = '/';\n\t\t\tsetcookie($cookie_name,$cookie_value,$exp_time,$path);\n\t\t}", "public function createCookie(Request $request) \n {\n \t$token = 'JDJ5JDEwJFdDdGRLLlo4OWRCeDlMMTEyUTFtbXVPUDNBN3kxV1VNQ0NEdC9ORXp6WmtSRWkwOTd5WGwy';\n\n \t$cookie = \\Cookie::make('token', $token, 60, null, env('COOKIE_DOMAIN'));\n\n \t$response = new Response('Hello world');\n \treturn $response->withCookie( $cookie );\n }", "function Session() {\n $sesskey = $_COOKIE['FortissimoSession'];\n if (! $sesskey) {\n # they don't have one, so let's ignore\n return;\n }\n\n # try to parse their cookie\n $ct = sscanf($sesskey, \"%d %s %d\", $sessid, $auth, $exptime);\n\n # return if bad cookie, or they say it's expired, or the auth length is wrong or bad sessid\n if ($ct != 3 || $exptime < time() || strlen($auth) != 64 || $sessid <= 0) {\n return;\n }\n\n # okay, so try loading it\n global $ft;\n $row = $ft->dbh->_select_row_as_object('SELECT * FROM tbl:sessions WHERE sessid = ? AND sesskey = ?',\n array($sessid, $auth));\n $userid = $row->userid;\n if (is_null($userid) || $userid <= 0 || $row->exptime < time()) {\n return;\n }\n\n # get the user this refers to\n $this->user = new User($userid);\n }", "public function storeSession() {}", "public function create()\n {\n /**\n * We should destroy the 'atoken' here also \n * because the session may expired before expiration of the token\n */\n return response()->view('admin.login')->cookie(Cookie::forget('atoken'));\n }", "protected static function setCookie () {\n\t\tglobal $session_timeout;\n\t\tif ( ini_get( 'session.use_cookies' ) ) {\n\t\t\t$session_cookie_parameters = session_get_cookie_params();\n\t\t\tsetcookie( session_name(),\n\t\t\t\t\t\tsession_id(),\n\t\t\t\t\t\ttime() + $session_timeout,\n\t\t\t\t\t\t$session_cookie_parameters['path'],\n\t\t\t\t\t\t$session_cookie_parameters['domain'],\n\t\t\t\t\t\t$session_cookie_parameters['secure'],\n\t\t\t\t\t\t$session_cookie_parameters['httponly']\n\t\t\t);\n\t\t\t$_COOKIE[session_name()] = session_id();\n\t\t}\n\t}", "function save()\n {\n $this->getSession()->set($this->getCookieJarName(), $this->cookieJar);\n }", "public function setCookieValues()\r\n {\r\n $objectManager = \\Magento\\Framework\\App\\ObjectManager::getInstance();\r\n $coreSession = $objectManager->get('Magento\\Framework\\Session\\Generic');\r\n $_cookieMetadata = $objectManager->get('Magento\\Framework\\Stdlib\\Cookie\\CookieMetadataFactory');\r\n\r\n $customerName = self::ANONYMOUS_USER;\r\n $customerEmail = self::ANONYMOUS_USER;\r\n $customerId = '';\r\n\r\n $metadata = $_cookieMetadata\r\n ->createPublicCookieMetadata()\r\n ->setDuration(self::TIMEOUT)\r\n ->setPath('/')\r\n ->setDomain($coreSession->getCookieDomain())\r\n ->setHttpOnly(false);\r\n\r\n if ($this->_customerSession->isLoggedIn()) {\r\n $customer = $this->_customerSession->getCustomer();\r\n $customerName = $customer->getName();\r\n $customerId = $customer->getId();\r\n $customerEmail = $customer->getEmail();\r\n $this->_cookieManager->setPublicCookie('user_loggedin', true, $metadata);\r\n $this->_cookieManager->setPublicCookie('afterlogin_session_id', \r\n $coreSession->getCustomerSessionId(), \r\n $metadata);\r\n $this->_cookieManager->setPublicCookie('trackingid', $customerId, $metadata);\r\n } else {\r\n if (!empty($this->_request->getParam('guest_user_id'))) {\r\n $customerId = $coreSession->getTrackingSessionId();\r\n } elseif (empty($this->_cookieManager->getCookie('trackingid'))) {\r\n $customerId = $coreSession->getTrackingSessionId();\r\n }\r\n $this->_cookieManager->setPublicCookie('user_loggedin', false, $metadata);\r\n }\r\n !empty($customerId) ? $this->_cookieManager->setPublicCookie('trackingid', \r\n $customerId, \r\n $metadata) : '';\r\n\r\n $this->_cookieManager->setPublicCookie('trackingemail', $customerEmail, $metadata);\r\n $this->_cookieManager->setPublicCookie('trackingname', $customerName, $metadata);\r\n\r\n $quoteId = $this->_checkoutSession->getQuoteId() ? $this->_checkoutSession->getQuoteId() : '';\r\n $this->_cookieManager->setPublicCookie('trackingorderid', $quoteId, $metadata);\r\n\r\n if (!$this->_cookieManager->getCookie('trackingsession')) {\r\n $this->_cookieManager->setPublicCookie('trackingsession', \r\n $coreSession->getTrackingSessionId(), \r\n $metadata);\r\n }\r\n }", "private function newRememberMeCookie()\n {\n // if database connection opened\n if ($this->db->isConnected()) {\n // generate 64 char random string and store it in current user data\n $random_token_string = hash('sha256', mt_rand());\n $update = $this->db->query(\n \"UPDATE users SET user_rememberme_token = :user_rememberme_token WHERE user_id = :user_id\",\n array(\n \"user_rememberme_token\"=>$random_token_string,\n \"user_id\"=>$_SESSION['user_id']\n )\n );\n\n // generate cookie string that consists of userid, randomstring and combined hash of both\n $cookie_string_first_part = $_SESSION['user_id'] . ':' . $random_token_string;\n $cookie_string_hash = hash('sha256', $cookie_string_first_part . COOKIE_SECRET_KEY);\n $cookie_string = $cookie_string_first_part . ':' . $cookie_string_hash;\n\n // set cookie\n setcookie('rememberme', $cookie_string, time() + COOKIE_RUNTIME, \"/\", COOKIE_DOMAIN);\n }\n }", "public function getSessionIdFromCookie();", "public function create()\n {\n $cart = session()->get('cart');\n }", "public static function createCookie($username, $userid, $token, $serial){\n setcookie('username', $username, time() + (86400) * 30, '/');\n setcookie('userid', $userid, time() + (86400) * 30, '/');\n setcookie('token', $token, time() + (86400) * 30, '/');\n setcookie('serial', $serial, time() + (86400) * 30, '/');\n }", "function payswarm_create_session($identity_id = null) {\n global $_COOKIE;\n\n // expiration interval\n $timeout = PAYSWARM_SESSION_TIMEOUT;\n\n // try to get existing session\n $session = payswarm_get_session($identity_id);\n $now = time();\n\n // no session exists, create a new one\n if($session === false) {\n // session ID length must be <= 32 to use transient API below\n $now = time();\n $random_value = mt_rand(0, 100000);\n $session = array(\n 'id' => md5(\"$now$random_value\"),\n 'ip' => $_SERVER['REMOTE_ADDR'],\n 'identity_id' => $identity_id,\n 'expires' => $now + $timeout,\n 'last_update' => 0);\n }\n\n // only update cookie if a minute has passed since last_update to\n // throttle writes (timeout is 0 for new sessions, so will always write)\n if($now - 60 > $session['last_update']) {\n // update session, auto-clear from DB in 24 hours\n // 24 hours allows time to show \"You've been signed out\" warning\n $expires = $now + $timeout;\n $session['expires'] = $expires;\n $session['last_update'] = $now;\n set_transient('ps_sess_' . $session['id'], $session, $timeout + 24*3600);\n\n // update cookie (client cookie is browser-session based)\n global $_SERVER;\n setcookie('payswarm-session', $session['id'], 0, '/');\n }\n\n return $session;\n}", "public function getCookie(): Cookie\n {\n $cookie = new Cookie();\n $cookie->expire = strtotime('+20 years');\n $cookie->httpOnly = true;\n return $cookie;\n }", "public function create($payload = '')\n\t{\n\t\t// create a new session\n\t\t$this->keys['session_id'] = $this->_new_session_id();\n\t\t$this->keys['previous_id'] = $this->keys['session_id']; // prevents errors if previous_id has a unique index\n\t\t$this->keys['ip_hash'] = md5(\\Input::ip() . \\Input::real_ip());\n\t\t$this->keys['user_agent'] = \\Input::user_agent();\n\t\t$this->keys['created'] = $this->time->get_timestamp();\n\t\t$this->keys['updated'] = $this->keys['created'];\n\n\t\t// add the payload\n\t\t$this->keys['payload'] = $payload;\n\n\t\treturn $this;\n\t}", "function createSession($user, $role){\n\t\t\tSession::setSession('user',$user);\n\t\t\tSession::setSession('role',$role);\n\t\t\tSession::setSession('time',time());\n\t\t\t$expire = $_SESSION['time'] + (5 * 60);\n\t\t\tSession::setSession('expire',$expire);\n\t\t}", "function WebDPCookie(){\r\n $cookie = [\r\n \"sessionid=\",\r\n \"sessionid=\",\r\n \"sessionid=\"\r\n ];\r\n \r\n return $cookie[mt_rand(0, count($cookie) - 1)];\r\n}", "public function testWithCookieThatReturnsData()\n {\n $cookieValue = 'cookie-value';\n\n $testData = [\n 'test'=>true\n ];\n\n //---\n\n $this->sessionManager->read( $cookieValue )->willReturn($testData);\n $this->sessionManager->write( $cookieValue, $testData )->shouldBeCalled();\n\n $middleware = new SessionMiddleware( $this->sessionManager->reveal(), 300 );\n\n $this->request->getCookieParams()->willReturn([\n SessionMiddleware::COOKIE_NAME => $cookieValue\n ]);\n\n $response = $middleware->process(\n $this->request->reveal(),\n $this->delegateInterface->reveal()\n );\n\n $this->assertInstanceOf(ResponseInterface::class, $response);\n\n $headers = $response->getHeaders();\n\n $this->assertArrayHasKey('Set-Cookie', $headers);\n\n $cookies = $headers['Set-Cookie'];\n\n $this->assertInternalType('array', $cookies);\n $this->assertCount(1, $cookies);\n\n\n $cookie = GuzzleSetCookie::fromString(array_pop($cookies));\n\n /*\n * We are setting the cookie here, so we expect a correctly named\n * cookie, with the above value, that has not expired.\n */\n $this->assertEquals( SessionMiddleware::COOKIE_NAME, $cookie->getName() );\n $this->assertFalse( $cookie->isExpired() );\n $this->assertTrue( $cookie->getSecure() );\n $this->assertTrue( $cookie->getHttpOnly() );\n $this->assertInternalType( 'string', $cookie->getValue() );\n $this->assertEquals( $cookieValue, $cookie->getValue() );\n }", "public static function initCookies() {\n // Get valid cookies\n $cookies = array_map('self::mapCookies', $_COOKIE, array_keys($_COOKIE));\n $cookies = array_filter($cookies);\n $cookies = array_values($cookies);\n\n // Get valid sessions\n $sessions = array_map('self::mapCookies', $_SESSION, array_keys($_SESSION));\n $sessions = array_filter($sessions);\n $sessions = array_values($sessions);\n\n // Sort valid cookies and create objects to save\n for ($i = 0; $i < count($cookies); $i++) {\n $cookie = new NativeCookie;\n $cookie->setName($cookies[$i][0])->setContent($cookies[$i][1]);\n\n $expirationDate = explode(NativeCookie::$lifetimeSeperator, $cookies[$i][1]);\n\n if (array_key_exists(1, $expirationDate)) {\n $cookie->setLifetime((int)($expirationDate[1]));\n }\n else {\n $cookie->setLifetime(false);\n }\n\n self::$sessions[] = $cookie;\n }\n\n // Sort valid sessions and create objects to save\n for ($i = 0; $i < count($sessions); $i++) {\n $session = new NativeSession;\n $session->setName($sessions[$i][0])->setContent($sessions[$i][1]);\n\n self::$sessions[] = $session;\n }\n }", "public function create()\n {\n return view('session.create');\n }", "public function create()\n {\n return view('cookies::create');\n }", "public function create($params) {\n\t\treturn $this->academic_session->forceCreate($this->formatParams($params));\n\t}", "public function cookie()\n {\n// $a = $abc->getCookieCollection();\n $abc = $this->request->getCookieCollection();\n $abc = new Collection($abc);\n\n $token = $abc->first()->getValue();\n return $this->responseJson(['csrfToken'=>$token]);\n }", "public function create()\n\t{\n\t\t\n\t\t// return View::make('sessions.create');\n\t}", "public function create()\n {\n return $this->view->make('Session::session.create');\n }", "public function createSession()\n {\n session_start();\n }", "public function createSession($reference);", "private function setCookie() {\n $response = new Response();\n $cookie = new Cookie(login_user, $this->_user, time() + 3600 * 24, '/', 'unoi.com', false, false);\n $response->headers->setCookie($cookie);\n $response->send();\n }", "public function Create ($sessionID = FALSE)\n\t{\n\t\t\n\t\t// If there is no session\n\t\t\n\t\tif (!session_id ())\n\t\t{\n\t\t\t\n\t\t\t// If there is a session ID\n\t\t\t\n\t\t\tif ($sessionID)\n\t\t\t{\n\t\t\t\t\n\t\t\t\t// Set it\n\t\t\t\t\n\t\t\t\tsession_id ($sessionID);\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t// Start session\n\t\t\t\n\t\t\tsession_start ();\n\n\t\t}\n\n\t\t\n\t\t// Send cache headers\n\n\t\theader ('Expires: Sun, 23 Nov 1984 03:13:37 GMT');\n\t\theader ('Last-Modified: ' . gmdate ('D, d M Y H:i:s') . ' GMT');\n\t\theader ('Cache-Control: no-store, no-cache, must-revalidate');\n\t\theader ('Cache-Control: post-check=0, pre-check=0', FALSE);\n\t\theader ('Pragma: no-cache');\n\n\t\t// Set session ID\n\n\t\t$this->_sessionID\t= session_id ();\n\t\t\n\t}", "function setSession($user, $createPersistent)\n {\n echo 'setting sesh';\n $_SESSION[\"notes\"] = true;\n $_SESSION[\"uid\"] = $user[\"id\"];\n $_SESSION[\"user\"] = $user[\"user\"];\n $_SESSION[\"color\"] = $user[\"color\"];\n\n if( isset($createPersistent) &&\n $createPersistent == true )\n {\n $SESSION_LENGTH = time() + 60 * 60 * 24 * 7 * 2;\n setcookie('user', $user[\"user\"], $SESSION_LENGTH, '/');\n setcookie('sid', session_id(), $SESSION_LENGTH, '/');\n $x = createPersistentSession(session_id(), $user[\"id\"]);\n echo 'persistent session: ' . $x;\n }\n return 'good';\n }", "public function sess_create()\n\t{\n\t\treturn ($this->session_valid()) ? parent::sess_create() : FALSE;\n\t}", "function session_create($sessionId)\n {\n }", "function getSession($uName, $isCreate = null) {\n $sessionObj = new Session();\n $argv = func_get_args();\n if (count($argv) == 1) {\n Util::throwExceptionIfNullOrBlank($uName, \"User Name\");\n $objUtil = new Util($this->apiKey, $this->secretKey);\n try {\n\t\t\t $params = null;\n $headerParams = array();\n $queryParams = array();\n $signParams = $this->populateSignParams();\n $metaHeaders = $this->populateMetaHeaderParams();\n $headerParams = array_merge($signParams, $metaHeaders);\n $body = null;\n $body = '{\"app42\":{\"session\":{\"userName\":\"' . $uName . '\"}}}';\n\n $signParams['body'] = $body;\n $signature = urlencode($objUtil->sign($signParams)); //die();\n $headerParams['signature'] = $signature;\n $contentType = $this->content_type;\n $accept = $this->accept;\n $baseURL = $this->url;\n $baseURL = $baseURL;\n $response = RestClient::post($baseURL, $params, null, null, $contentType, $accept, $body, $headerParams);\n $sessionResponseObj = new SessionResponseBuilder();\n $sessionObj = $sessionResponseObj->buildResponse($response->getResponse());\n } catch (App42Exception $e) {\n throw $e;\n } catch (Exception $e) {\n throw new App42Exception($e);\n }\n return $sessionObj;\n } else {\n /**\n * Create User Session based on the isCreate boolean parameter. If isCreate\n * is true and there is an existing session for the user, the existing\n * session is returned. If there is no existing session for the user a new\n * one is created. If isCreate is false and there is an existing session,\n * the existing session is returned if there is no existing session new one\n * is not created\n *\n * @param uName\n * - UserName for which the session has to be created.\n * @param isCreate\n * - A boolean value for specifying if an existing session is not\n * there, should a new one is to be created or not.\n *\n * @return Session object containing the session id of the created session.\n * This id has to be used for storing or retrieving attributes.\n */\n Util::throwExceptionIfNullOrBlank($uName, \"User Name\");\n Util::throwExceptionIfNullOrBlank($isCreate, \"isCreate\");\n $encodedIsCreate = Util::encodeParams($isCreate);\n $objUtil = new Util($this->apiKey, $this->secretKey);\n try {\n\t\t\t $params = null;\n $headerParams = array();\n $queryParams = array();\n $signParams = $this->populateSignParams();\n $metaHeaders = $this->populateMetaHeaderParams();\n $headerParams = array_merge($signParams, $metaHeaders);\n $body = null;\n $body = '{\"app42\":{\"session\":{\"userName\":\"' . $uName . '\"}}}';\n $signParams['body'] = $body;\n $signature = urlencode($objUtil->sign($signParams)); //die();\n $headerParams['signature'] = $signature;\n $contentType = $this->content_type;\n $accept = $this->accept;\n $baseURL = $this->url;\n $baseURL = $baseURL . \"/\" . $encodedIsCreate;\n $response = RestClient::post($baseURL, $params, null, null, $contentType, $accept, $body, $headerParams);\n $sessionResponseObj = new SessionResponseBuilder();\n $sessionObj = $sessionResponseObj->buildResponse($response->getResponse());\n } catch (App42Exception $e) {\n throw $e;\n } catch (Exception $e) {\n throw new App42Exception($e);\n }\n return $sessionObj;\n }\n }", "public function save() {\n FPCAuthentication_Result::startSession();\n $_SESSION[self::FPC_LOGIN_RESULT_KEY] = $this->toArray();\n return $this;\n }", "public function create(&$session)\n\t{\n\t\t//TODO: Implement this service call.\n\t\treturn false;\t\n\t}", "function createCookie($key,$value)\n{\n\tsetcookie(str_rot13(\"$key\"),str_rot13(\"$value\"),0,\"/\");\n}", "protected function establishSession()\n {\n $userid = !empty($this->cookie('userid')) ? $this->cookie('userid') : false;\n $password = !empty($this->cookie('password')) ? $this->cookie('password') : false;\n $sessionHash = !empty($this->cookie('sessionhash')) ? $this->cookie('sessionhash') : false;\n\n if ($userid && $password) {\n $user = $this->isValidCookieUser($userid, $password);\n\n if (!$user) {\n return false;\n }\n } elseif ($sessionHash) {\n $session = $this->query('session')\n ->where('sessionhash', $sessionHash)\n ->where('idhash', $this->fetchIdHash())\n ->first();\n\n if (!$session || ($session->host != $this->request->server('REMOTE_ADDR'))) {\n return false;\n }\n\n $userid = $session->userid;\n } else {\n return false;\n }\n\n $userinfo = $this->query('user')\n ->where('userid', $userid)\n ->first($this->userColumns);\n\n if (!$userinfo) {\n return false;\n }\n\n $this->setUserInfo($userinfo);\n $this->updateOrCreateSession($userid);\n\n return true;\n }", "public function createSession($request, $response, $args)\n {\n $userId = $request->getAttribute('userId');\n\n $documentId = $args['id'];\n\n if (!$this->documentManager->grantAccess($userId, $documentId, 'edit')) {\n if (isset($userId)) {\n return $response->withStatus(403);\n } else {\n return $response->withStatus(401);\n }\n }\n\n $username = $userId;\n $user = $this->documentManager->getDocument($userId, $userId);\n if (isset($user['data']) && isset($user['data']['name'])) {\n $username = $user['data']['name'];\n }\n\n $etherpadSession = array('etherpadSession' => $this->etherpadManager->createSession($userId, $username, $documentId));\n\n return $response->write(json_encode($etherpadSession));\n }", "public function testWithCookieThatNewDataIsStoredFor()\n {\n $cookieValue = 'cookie-value';\n\n // Return an empty array.\n $this->sessionManager->read( $cookieValue )->willReturn([]);\n\n // We expect the new session to be written\n $this->sessionManager->write( Argument::type('string'), ['test' => true] )->shouldBeCalled();\n\n $middleware = new SessionMiddleware( $this->sessionManager->reveal(), 300 );\n\n $this->request->getCookieParams()->willReturn([\n SessionMiddleware::COOKIE_NAME => $cookieValue\n ]);\n\n // We use this to set data in session; as a delegate process would do.\n $this->request->withAttribute( 'session', Argument::that(function ($arg) {\n $arg['test'] = true;\n return true;\n }))->shouldBeCalled()->willReturn(\n $this->prophesize(ServerRequestInterface::class)->reveal()\n );\n\n $response = $middleware->process(\n $this->request->reveal(),\n $this->delegateInterface->reveal()\n );\n\n $this->assertInstanceOf(ResponseInterface::class, $response);\n\n $headers = $response->getHeaders();\n\n $this->assertArrayHasKey('Set-Cookie', $headers);\n\n $cookies = $headers['Set-Cookie'];\n\n $this->assertInternalType('array', $cookies);\n $this->assertCount(1, $cookies);\n\n $cookie = GuzzleSetCookie::fromString(array_pop($cookies));\n\n /*\n * We are setting an invalid cookie name here, so we expect a correctly named\n * cookie, with a *different* value, that has not expired.\n */\n $this->assertEquals( SessionMiddleware::COOKIE_NAME, $cookie->getName() );\n $this->assertFalse( $cookie->isExpired() );\n $this->assertTrue( $cookie->getSecure() );\n $this->assertTrue( $cookie->getHttpOnly() );\n $this->assertInternalType( 'string', $cookie->getValue() );\n $this->assertNotEquals( $cookieValue, $cookie->getValue() );\n\n // We're expecting the session ID to be over 75 characters.\n $this->assertGreaterThan( 75, strlen($cookie->getValue()) );\n }", "function session_init($hash){\n if(isset($hash)){\n $session=mysqli_fetch_assoc(DB::select('sessions',['*'],'hash=\"'.$hash.'\"'));\n if(isset($session['closed'])){\n session_close($hash);\n $hash = md5(genHash());\n //dbg('Insert new HASH from session_init()');\n if (DB::insert('auth', array('iduser' => USER_ID, 'hash' => $hash))) {\n //session_init($hash);\n setcookie('HASH', $hash, 7000000000);\n }\n }\n //dbg('Insert new SESSION from session_init()');\n DB::insert('sessions',['hash'=>$hash,'iduser'=>USER_ID,'date'=>date('Y-m-d H:i:s'),'last_act'=>date('Y-m-d H:i:s'),'ip'=>$_SERVER['REMOTE_ADDR'],'provider'=>getIspByIp($_SERVER['REMOTE_ADDR']),'closed'=>0]);\n }\n}", "function add_session($id, $name) {\n $this->start_session();\n $_SESSION['id'] = $id;\n $_SESSION['name'] = $name;\n setcookie('id', $id, time() + 60 * 60 * 24 * 7, '/');\n }", "function get_cookie() {\n\tglobal $_COOKIE;\n\t// $_COOKIE['main_user_id_1'] = '22760600|2c3a1c1487520d9aaf15917189d5864';\n\t$hid = explode ( \"|\", $_COOKIE ['main_tcsso_1'] );\n\t$handleName = $_COOKIE ['handleName'];\n\t// print_r($hid);\n\t$hname = explode ( \"|\", $_COOKIE ['direct_sso_user_id_1'] );\n\t$meta = new stdclass ();\n\t$meta->handle_id = $hid [0];\n\t$meta->handle_name = $handleName;\n\treturn $meta;\n}", "public static function generateSessionCookie($eml, $fpt, \\PDO $dbc=null) {\n \n //if the 'dbc' parameter was not supplied then connect to the \n //default database using default parameters.\n $dbc = ($dbc) ? : Database::connect();\n \n //generate random values for series and token\n //fingerprint is based on USER_AGENT so identifies browser used\n $series = Self::generateRandomToken();\n $token = Self::generateRandomToken();\n $fprint = Self::chlogHashStatic($fpt);\n $cookie = $eml . \":\" . $series . \":\" . $token . \":\" . $fprint;\n \n //store session data in database\n try {\n $sql = \"CALL addSession(:eml, :ser, :tok, :fpt)\";\n $qry = $dbc->prepare($sql);\n $qry->bindValue(\":eml\", $eml);\n $qry->bindValue(\":ser\", $series);\n $qry->bindValue(\":tok\", $token);\n $qry->bindValue(\":fpt\", $fprint);\n\n //Check if session record was created ok.\n if (!$qry->execute()) {\n $errmsg = \"Unable to create session data entry.\";\n Logger::log($errmsg); throw new \\Exception();\n }\n }\n catch (\\PDOException $e) {\n $errmsg = 'Unable to session data entry ('.$e.')';\n Logger::log($errmsg); throw new \\Exception($errmsg);\n }\n \n //return the generated cookie, based on session data stored in DB\n return $cookie;\n }", "function session_create()\n\t{\n\t\t$this->data = array();\n\t\treturn true;\n\t}", "private function newSid() {\r\n\r\n $this->sessionId=$this->generateString($this->sid_len);\r\n \r\n while ( $this->getSidCount($this->sessionId) > 0 || is_int($this->sessionId) ) {\r\n\r\n $this->sessionId=$this->generateString($this->sid_len);\r\n\r\n }\r\n\r\n $this->forcedExpire = time()+ $this->session_max_duration;\r\n $expireTime = time() + $this->session_duration;\r\n\r\n $this->SQLStatement_InsertSession->bindParam(':expires', $expireTime, PDO::PARAM_INT);\r\n $this->SQLStatement_InsertSession->bindParam(':forcedExpires', $this->forcedExpire, PDO::PARAM_INT);\r\n $this->SQLStatement_InsertSession->bindParam(':sid', $this->sessionId, PDO::PARAM_STR, $this->sid_len);\r\n $this->SQLStatement_InsertSession->bindParam(':ua', $this->getUa(), PDO::PARAM_STR, 40);\r\n\r\n return $this->SQLStatement_InsertSession->execute();\r\n\r\n }", "function session_login() {\n global $db;\n global $current_user;\n\n if (isset($_COOKIE[\"session\"])) {\n $session = $_COOKIE[\"session\"]; // variable for ease\n $session_record = find_session($session); // use find_session function which returns a session from database\n // check if session_record is not null\n if (isset($session_record)) {\n $current_user = find_user($session_record['user_id']); // use find_user function which returns the user which matches user_id in session_record\n setcookie(\"session\", $session, time() + SESSION_COOKIE_DURATION); // Renew the cookie for another hour\n return $current_user;\n }\n }\n // if nothing is returned, then set current user to null and return null\n $current_user = NULL;\n return NULL;\n}", "public function create() {\n\t\treturn View::make('sessions.create');\n\t}", "public function create() {\n\t\treturn View::make('sessions.create');\n\t}", "private function createNewSession($id, $data = '')\n\t{\n\t\t// get table/column\n\t\t$db = $this->jdb;\n\t\t$dbTable = $this->dbOptions['db_table'];\n\t\t$dbDataCol = $this->dbOptions['db_data_col'];\n\t\t$dbIdCol = $this->dbOptions['db_id_col'];\n\t\t$dbTimeCol = $this->dbOptions['db_time_col'];\n\t\t$qry = $db->getQuery(true);\n\t\t\n\t\t// Session data can contain non binary safe characters so we need to encode it.\n\t\t$encoded = base64_encode($data);\n\t\t\n\t\t$qry->insert($db->qn($dbTable))\n\t\t\t->columns($db->qn(array($dbIdCol, $dbDataCol, $dbTimeCol)))\n\t\t\t->values($db->q($id) .','. $db->q($encoded) .','. (int) time());\n\t\t\n\t\t$db->setQuery($qry)->execute();\n\t\n\t\treturn true;\n\t}", "public function forum_create_cookie($id, $name, $password)\n {\n global $SITE_INFO;\n\n unset($name);\n unset($password);\n\n $row = $this->get_member_row($id);\n $loginkey = $row['loginkey']; //used for 'mybbuser' memberid.'_'.'loginkey'\n $loguid = $row['uid']; //member ID\n\n //Set a User COOKIE\n $member_cookie_name = get_member_cookie();\n cms_setcookie($member_cookie_name, $loguid . '_' . $loginkey);\n\n if (substr($member_cookie_name, 0, 5) != 'cms__') {\n $current_ip = get_ip_address();\n\n $session_row = $this->connection->query('SELECT * FROM ' . $this->connection->get_table_prefix() . 'sessions WHERE ' . db_string_equal_to('ip', $current_ip), 1);\n $session_row = (!empty($session_row[0])) ? $session_row[0] : array();\n $session_id = (!empty($session_row['sid'])) ? $session_row['sid'] : '';\n\n if (!empty($session_id)) {\n $this->connection->query_update('sessions', array('time' => time(), 'uid' => $loguid), array('sid' => $session_id), '', 1);\n } else {\n $session_id = md5(strval(time()));\n $this->connection->query_insert('sessions', array('sid' => $session_id, 'uid' => $id, 'time' => time(), 'ip' => $current_ip));\n }\n\n //Now lets try and set a COOKIE of MyBB Session ID\n cms_setcookie('sid', $session_id);\n }\n }", "function createPersistentSession($sid, $uid) {\n $mysqli = ConnectToDatabase();\n $sql = \"INSERT INTO active_sessions \n (id, uid, expiration)\n VALUES \n ('$sid', '$uid', DATE_ADD(CURRENT_DATE, INTERVAL 1 WEEK))\";\n $exec = $mysqli->query($sql);\n if( !empty($error = $mysqli->error) )\n {\n echo $error;\n return 0;\n }\n else if( isset($mysqli->insert_id) )\n {\n return 1;\n }\n else\n {\n return -1;\n }\n\n }", "public function getCookie()\n {\n if (!isset($this->_cookie)) {\n $this->_cookie = new \\Yana\\Http\\Requests\\ValueWrapper();\n }\n return $this->_cookie;\n }", "private function createCookie(string $token): Cookie\n {\n $name = $this->csrfConfig->getCookieName();\n $value = $this->signer->sign($token);\n $expires = time() + $this->csrfConfig->getCookieAge();\n\n return $this->cookieFactory->create($name, $value, $expires);\n }", "public function createDonarSession($did){\n\n\t\tif (session_status() == PHP_SESSION_NONE) {\n\t\t session_start();\n\t\t}\n\n\t\t$_SESSION['id'] = $did;\n\t\t$currentLoggedDonarId = $_SESSION['id'];\n\n\n\t}", "public function createContextSession();", "public function getSession() {}", "public function generateSessionIdentifier($store_id = null){\n\n if(is_null($store_id)){\n\n $store = Mage::app()->getStore();\n $store_id = $store->getId();\n }\n $sessionIdentifier = null;\n $cookie = Mage::getModel('core/cookie');\n //session identifier format :favizone_connection_identifier_idStore\n //if(!empty($cookie->get('favizone_connection_identifier_'.$store_id)) != \"\" && !is_null($cookie->get('favizone_connection_identifier_'.$store_id))){\n if($cookie->get('favizone_connection_identifier_'.$store_id)){\n\n $sessionIdentifier = Mage::getModel('core/cookie')->get('favizone_connection_identifier_'.$store_id);\n }\n else{\n\n $sender = Mage::helper('favizone_recommender/sender');\n $data = Mage::helper('favizone_recommender/data');\n $data_to_send = array( \"key\" => $this->getApplicationKey());\n\n $result = $sender->postRequest($data->getRegisterProfiletUrl(), $data_to_send);\n $result = json_decode($result,true);\n if($result['response'] == 'authorized' || $result['response'] == 'success' ){\n\n $cookie->set('favizone_connection_identifier_'.$store_id, $result['identifier'], Favizone_Recommender_Helper_Data::getLifeTime(), '/', null, false, false);\n\n $abTest = $this->getStoreInfo($store_id)->getAbTest();\n $abTest = ($abTest == 'true');\n if(!$abTest){\n\n $cookie->set('favizone_visit_'.$store_id, true, null, '/', null, false, false);\n }\n \n $sessionIdentifier = $result['identifier'];\n }\n }\n return $sessionIdentifier;\n }", "protected function createSession($userid, $remember = true)\n {\n $hash = md5(microtime() . $userid . $this->request->server('REMOTE_ADDR'));\n\n $timeout = time() + $this->cookieTimeout;\n\n if ($remember) {\n $this->cookie('sessionhash', $hash, $timeout);\n } else {\n $this->cookie('sessionhash', $hash, 0);\n }\n\n $session = [\n 'userid' => $userid,\n 'sessionhash' => $hash,\n 'host' => $this->request->server('REMOTE_ADDR'),\n 'idhash' => $this->fetchIdHash(),\n 'lastactivity' => time(),\n 'location' => $this->request->server('REQUEST_URI'),\n 'useragent' => substr($this->request->server('HTTP_USER_AGENT'), 0, 100),\n 'loggedin' => 1,\n ];\n\n $this->query('session')\n ->where('host', $this->request->server('REMOTE_ADDR'))\n ->where('useragent', substr($this->request->server('HTTP_USER_AGENT'), 0, 100))\n ->delete();\n\n $this->query('session')->insert($session);\n\n return $hash;\n }", "public static function getSessionid();", "public function getSession(Request $request)\n\t{\n\t\t$session = $this->manager->driver();\n\n\t\t$session->setId($request->cookies->get($session->getName()));\n\n\t\treturn $session;\n\t}", "public function createSession($user)\n {\n return $this->sessions()->create([\n 'user_id' => is_numeric($user) ? $user : $user->id\n ]);\n }", "function Create ($pREMEMBER, $pSESSIONNAME = \"gLOGINSESSION\") {\n\n // Delete all records older than 24 hours.\n $deletestatement = \"DELETE FROM \" . $this->TableName . \" WHERE Stamp < DATE_ADD(now(),INTERVAL -1 DAY)\";\n $this->Query ($deletestatement);\n\n // Select any existing auth session information.\n $existingcriteria = array (\"Username\" => $this->Username,\n \"Domain\" => $this->Domain);\n $this->SelectByMultiple ($existingcriteria);\n $this->FetchArray ();\n parent::Create ($pREMEMBER, $pSESSIONNAME);\n }", "public function addToSession() {\n $s = Session::getInstance();\n $key = $this->sessionId;\n $s->$key = $this->getId();\n if ($s->$key === null) {\n Log::warn(\"Adding null user ID to session\");\n }\n $this->setAuthed(true);\n }", "function getCookieData() {\n\t\t$oEncrypt = utilityEncrypt::factory(file_get_contents(system::getConfig()->getPathData().'/dash.session.key'));\n\t\treturn utilityEncrypt::toUriString(\n\t\t\t$oEncrypt->encrypt(\n\t\t\t\tserialize(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'id' => $this->getUser()->getID(),\n\t\t\t\t\t\t'email' => $this->getUser()->getEmail(),\n\t\t\t\t\t\t'expiry' => strtotime('+72 hours'),\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t)\n\t\t);\n\t}", "function auth_create($id, $data = null)\n {\n $lc_auth = auth_prerequisite();\n $auth = auth_get();\n\n if (!$auth) {\n $session = is_object($data) ? $data : auth_getUserInfo($id);\n if (isset($session)) {\n $fieldRole = $lc_auth['fields']['role'];\n\n $session->sessId = session_id();\n $session->timestamp = time();\n $session->token = strtoupper(_randomCode(20));\n $session->permissions = auth_permissions($session->$fieldRole);\n\n auth_set($session);\n\n return $session;\n }\n } else {\n return $auth;\n }\n\n return false;\n }", "public function create()\n\t{\n\t\treturn View::make('sessions.create');\n\t}", "public function create()\n\t{\n\t\treturn View::make('sessions.create');\n\t}", "public function create()\n\t{\n\t\treturn View::make('sessions.create');\n\t}", "public function create()\n\t{\n\t\tif(Auth::check()) {\n\t\t\tFlash::warning('You are already logged in');\n\t\t\treturn Redirect::to('home');\n\t\t}\n return View::make('sessions.create');\n\t}", "private function readSessionId() {\r\n \r\n if ($this->use_cookie==true) { //cookie enabled\r\n \r\n if (isset($_COOKIE[$this->sid_name])) { //there some jam in the cookie\r\n\r\n $this->sessionId=$_COOKIE[$this->sid_name];\r\n //check if the jam can be eated\r\n if ($this->checkSessionId()) {\r\n\r\n\r\n $num = $this->getSidCount($this->sessionId);\r\n if ($num != 1) {\r\n //there is a sessiod in the cookie and no sessid in the DB\r\n //the only thing to do is to generate a new Sid\r\n if (!$this->newSid()) {\r\n trigger_error(\"Unable to load session.\",E_USER_ERROR);\r\n } else {\r\n if (!$this->overwrite) setcookie ($this->sid_name, $this->sessionId,time()+$this->session_duration,\"/\",'',false,true);\r\n }\r\n\r\n } else {\r\n //ok the jam is good!\r\n if (!$this->overwrite) {\r\n setcookie ($this->sid_name, $this->sessionId,time()+$this->session_duration,\"/\",'',false,true); \r\n }\r\n $this->loadSesionVars();\r\n }\r\n \r\n } else {\r\n //bad bad bad think ... something goes wrong with the\r\n //jam .. maybe uncle tom eated it before .. \r\n $this->destroySession(FALSE);\r\n trigger_error(\"Unable to load session.\",E_USER_ERROR);\r\n }\r\n\r\n } else { \r\n\r\n //Damn, no id ... i create some jam!\r\n \r\n if (!$this->newSid()) {\r\n trigger_error(\"Unable to load session.\",E_USER_ERROR);\r\n } else {\r\n if (!$this->overwrite) setcookie ($this->sid_name, $this->sessionId,time()+$this->session_duration,\"/\",'',false,true);\r\n }\r\n \r\n\r\n }\r\n\r\n } else { //no cookie allowed.. bad thing! search elsewhere\r\n\r\n if (isset($_REQUEST[$this->sid_name])) {//bingo!\r\n\r\n $this->sessionId = $_REQUEST[$this->sid_name];\r\n if ($this->checkSessionId()) {\r\n $this->loadSesionVars();\r\n }else {\r\n //bad bad bad think ... something goes wrong with the\r\n //jam .. maybe uncle tom eated it before ..\r\n $this->destroySession(FALSE);\r\n trigger_error(\"Unable to load session.\",E_USER_ERROR);\r\n }\r\n\r\n } else { // create a new SID\r\n\r\n if (!$this->newSid()) die(\"Unable to save session\");\r\n\r\n }\r\n\r\n }\r\n }", "public function getSessionID();", "public function getCookie(): ParameterBag { return $this->cookie; }", "public function add()\n {\n if (!headers_sent()) {\n // Set the cookie via PHP headers\n $added = setcookie(\n $this->name,\n $this->value,\n round(time() + 60 * 60 * 24 * $this->lifetime),\n $this->path,\n $this->host\n );\n } else {\n //Headers have been sent use JavaScript to set the cookie\n echo \"<script>\";\n echo '\n function setCookie(c_name,value,expiredays){\n var exdate=new Date();\n exdate.setDate(exdate.getDate()+expiredays);\n document.cookie=c_name+ \"=\" +escape(value)+((expiredays==null) ? \"\" : \"; expires=\"+exdate.toUTCString()) + \"; domain=\"+ escape(\"' . $this->host . '\") + \"; path=\" + escape(\"' . $this->path . '\");\n }\n ';\n echo \"setCookie('{$this->name}','{$this->value}',{$this->lifetime})\";\n echo \"</script>\";\n $added = true;\n }\n\n return $added;\n }", "function SetUserLogin(string $_id)\n{\n $_SESSION[\"login\"] = \"LOGIN\";\n $_SESSION[\"user_id\"] = $_id;\n\n // set user cookies\n $cookie = [];\n $cookie[\"time\"] = time() + (60*60*24*30*365);\n\n // set cookie for login\n $cookie[\"name\"] = \"login\";\n $cookie[\"value\"] = \"LOGIN\";\n setcookie($cookie[\"name\"], $cookie[\"value\"], $cookie[\"time\"], \"/\");\n\n // set cookie for user details\n $cookie[\"name\"] = \"user_id\";\n $cookie[\"value\"] = $_id;\n setcookie($cookie[\"name\"], $cookie[\"value\"], $cookie[\"time\"], \"/\");\n}", "function processResult($id)\n{\n session_start();\n $_SESSION['ID'] = $id;\n $_SESSION['start'] = time();\n ini_set('session.use_only_cookies', 1);\n\n\n}", "public function create()\n {\n $data = $this->jsonInput(); \n\n $session = new Session();\n $session->setName($data[\"name\"]);\n $session->setCardSet($data[\"cardSet\"]);\n\n $private = $data[\"isPrivate\"];\n $session->setIsPrivate($private);\n if ($private)\n $session->setPassword($this->createHash($data[\"password\"]));\n \n $session->setLastAction(new DateTime());\n\n $this->save($session);\n \n return new NumericResponse($session->getId());\n }" ]
[ "0.74633133", "0.71751314", "0.67461246", "0.6622456", "0.6536931", "0.64341635", "0.64272565", "0.64166224", "0.63921404", "0.6370622", "0.63583803", "0.63445884", "0.6340993", "0.6327771", "0.6313866", "0.6299569", "0.62871283", "0.6276595", "0.62166584", "0.61953723", "0.61759496", "0.6143719", "0.6139316", "0.61006397", "0.6093862", "0.6075615", "0.6062012", "0.60412335", "0.59813935", "0.59707266", "0.5970432", "0.5968132", "0.5958834", "0.59499204", "0.5947702", "0.59321064", "0.59246904", "0.592417", "0.59040344", "0.5892736", "0.5867431", "0.5862186", "0.5861284", "0.58563215", "0.58462983", "0.5846083", "0.583476", "0.5825516", "0.5808876", "0.57922983", "0.57798386", "0.5779571", "0.5775881", "0.5772432", "0.5756589", "0.5753956", "0.57201636", "0.5719133", "0.5715207", "0.5703755", "0.5688527", "0.56872326", "0.5679565", "0.5678112", "0.56670713", "0.5662585", "0.56419164", "0.5628433", "0.5627755", "0.56209904", "0.5608504", "0.5608504", "0.560144", "0.559424", "0.5584014", "0.5577373", "0.55754435", "0.55748075", "0.55612445", "0.5559419", "0.5551392", "0.55422056", "0.55419415", "0.5537645", "0.5527503", "0.5525181", "0.5522135", "0.5519735", "0.55178285", "0.55141157", "0.55141157", "0.55141157", "0.5510765", "0.55030966", "0.54977375", "0.54968387", "0.54936993", "0.54859614", "0.5481556", "0.54664505" ]
0.6553243
4
Name For Xcache Variable
function details(): bool { $cache_key = "session[".$this->id."]"; # Cached Customer Object, Yay! $cache = new \Cache\Item($GLOBALS['_CACHE_'],$cache_key); if ($cache->error()) app_log("Cache error in Site::Session::get(): ".$cache->error(),'error',__FILE__,__LINE__); elseif (($this->id) and ($session = $cache->get())) { if ($session->code) { $this->code = $session->code; $this->company = new \Company\Company($session->company_id); $this->customer = new \Register\Customer($session->customer_id); $this->timezone = $session->timezone; $this->browser = $session->browser; $this->first_hit_date = $session->first_hit_date; $this->last_hit_date = $session->last_hit_date; $this->super_elevation_expires = $session->super_elevation_expires; $this->oauth2_state = $session->oauth2_state; if (isset($session->isMobile)) $this->isMobile = $session->isMobile; if (empty($session->csrfToken)) { $session->csrfToken = $this->generateCSRFToken(); $cache->set($session,600); } $this->csrfToken = $session->csrfToken; $this->cached(true); return true; } } $get_session_query = " SELECT id, code, company_id, user_id customer_id, timezone, browser, first_hit_date, last_hit_date, super_elevation_expires, oauth2_state FROM session_sessions WHERE id = ? "; $rs = $GLOBALS['_database']->Execute( $get_session_query, array($this->id) ); if (! $rs) { $this->SQLError($GLOBALS['_database']->ErrorMsg()); return false; } if ($rs->RecordCount()) { $session = $rs->FetchNextObject(false); if (empty($session->customer_id)) $session->customer_id = 0; $this->code = $session->code; $this->company = new \Company\Company($session->company_id); $this->customer = new \Register\Customer($session->customer_id); $this->timezone = $session->timezone; $this->browser = $session->browser; $this->first_hit_date = $session->first_hit_date; $this->last_hit_date = $session->last_hit_date; $this->super_elevation_expires = $session->super_elevation_expires; $this->oauth2_state = $session->oauth2_state; require_once THIRD_PARTY.'/mobiledetect/mobiledetectlib/Mobile_Detect.php'; $detect = new \Mobile_Detect; if ($detect->isMobile()) $this->isMobile = true; else $this->isMobile = false; $session->csrfToken = $this->generateCSRFToken(); $this->csrfToken = $session->csrfToken; if ($session->id) $cache->set($session,600); return true; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function cacheName()\n\t\t{\n\t\t\treturn $GLOBALS[\"ID\"] . \"_call.xml\";\n\t\t}", "public static function cached($_name) {\n\t\t$_name=self::resolve($_name);\n\t\t$_hash='var.'.self::hashCode(self::remix($_name));\n\t\treturn Cache::cached($_hash);\n\t}", "public function getCacheName();", "private function getCacheKey(): string\n {\n return $this->webserviceId.$this->cacheKey;\n }", "private function _cacheName() {\n $file = APPLICATION_PATH . '/application/settings/restapi_caching_url.php';\n if (file_exists($file)) {\n $enableCacheUrl = include $file;\n } else {\n return '';\n }\n $viewer = Engine_Api::_()->user()->getViewer();\n $front = Zend_Controller_Front::getInstance();\n $request = $front->getRequest();\n $params = array();\n $params['module'] = $request->getModuleName();\n $params['controller'] = $request->getControllerName();\n $params['action'] = $request->getActionName();\n $parameters = $request->getParams();\n $language = $parameters['language'];\n $cacheName = implode(\"_\", $params);\n $key_val = '';\n $cacheName = str_replace('-', '_', $cacheName);\n if (!isset($enableCacheUrl[$cacheName]) || empty($enableCacheUrl[$cacheName]))\n return;\n $getRequestUri = htmlspecialchars($_SERVER['REQUEST_URI']);\n $urlarray = explode(\"?\", $getRequestUri);\n $trimData = trim($urlarray[0], \"/\");\n $cachName = str_replace(\"/\", \"_\", $trimData);\n $viewerId = 0;\n $keys = array_keys($parameters);\n $matched = preg_grep('/_id|_type$/', $keys);\n $matched = array_flip($matched);\n $matched = array_intersect_key($parameters, $matched);\n $key_val = implode('_', $matched);\n\n if ($enableCacheUrl[$cacheName] == 'member_level') {\n $viewerId = $viewer && $viewer->getIdentity() ? $viewer->level_id : 0;\n } elseif ($enableCacheUrl[$cacheName] == 'user_level') {\n $viewerId = $viewer && $viewer->getIdentity() ? $viewer->getIdentity() : 0;\n }\n\n $cachName = $cachName . '_' . $language . '_' . $key_val . '_' . $viewerId;\n $cachName = str_replace('-', '_', $cachName);\n $cachName = str_replace('.', '_', $cachName);\n return $cachName;\n }", "protected static function getCacheIdentifier() {}", "final public function GetVariableName() { return $this->varName; }", "final public function GetVariableName() { return $this->varName; }", "public function cacheKey(): string {\n return self::CACHE_PREFIX . $this->id\n . ($this->revisionId ? '_r' . $this->revisionId : '');\n }", "public function get($cache_name);", "public function cache_filename()\n {\n return $this->_name . '_' . $this->id() . '.' . $this->_type;\n }", "private function generateCacheName(): string\n\t{\n\t\t$get = implode('-', $_GET);\n\t\t$name = $this->_resizeMode . $this->_imagePath . $this->_oldWidth . $this->_oldHeight . $this->_newWidth . $this->_newHeight . $get;\n\t\treturn md5($name) . '.' . $this->_extension;\n\t}", "abstract function get_cache_prefix(): string;", "function e($var_nm)\n{\n\tglobal $$var_nm ;\n\n\treturn '$' . $var_nm . ' = ' . $$var_nm . ' ' ;\n}", "function acf_cache_key($key = '')\n{\n}", "protected function getCacheName(){\n\t\tif(is_null($this->param)) {\n\t\t\tthrow new \\Exception('Call \"setParameters\" first!');\n\t\t}\n\n\t\t// Change character when making incompatible changes to prevent loading\n\t\t// errors due to incompatible file contents \\|/\n\t\treturn hash('md5', http_build_query($this->param) . 'A') . '.cache';\n\t}", "private function getCacheId()\n\t{\n\t\treturn self::CACHE_ID_PREFIX . '_' . $this->exportId . '_' . $this->type;\n\t}", "public function get(string $variableName);", "public static function getCacheTag()\n\t{\n\t\treturn get_called_class() . '_common_cache';\n\t}", "public static function getCacheTag()\n\t{\n\t\treturn get_called_class() . '_common_cache';\n\t}", "public function name()\n {\n return $this->getFromCache(\n ['type' => 'name']\n );\n }", "function cache_key(Repository $repo) {\n return \"ms_\" . md5($repo->user . $repo->name);\n}", "private function cacheKey()\n {\n return sprintf('contact-permissons-%s', $this->client->patientContactId);\n }", "public function __get($_name);", "function getCacheId() {\n return get_class($this).\"_\".$this->id;\n }", "public static function getCacheTag()\n {\n return static::$cacheTag;\n }", "public static function getCacheTag()\n {\n return static::$cacheTag;\n }", "public function setName($name){\n\t\t\t$this->_name = $name;\n\t\t\t$this->_nameFileFile = CACHE_PATH.$name.'.cache';\n\t\t}", "protected static function getExtLocalconfCacheIdentifier() {}", "protected static function getCacheName()\n\t{\n\t\tstatic $strCacheName;\n\t\tif (!isset($strCacheName))\n\t\t{\n\t\t\t$strCacheName = __CLASS__;\n\t\t}\n\t\treturn $strCacheName;\n\t}", "protected function generateVarName($prefix = '')\n\t{\n\t\tif (!$this->var_uniq) {\n\t\t\t$this->var_uniq = substr(md5(mt_rand()), 1, 4);\n\t\t}\n\t\t$name = $this->var_uniq . (++$this->var_id);\n\t\treturn '$'.$prefix.'_'.$name;\n\t}", "public function getCacheName($name){\n if($this->is_mobile)\n $name .= '_mobile';\n return $name;\n }", "function yy_r76(){if ($this->yystack[$this->yyidx + 0]->minor['var'] == '\\'smarty\\'') { $this->_retvalue = $this->compiler->compileTag('special_smarty_variable',$this->yystack[$this->yyidx + 0]->minor['index']);} else {\r\n $this->_retvalue = '$_smarty_tpl->getVariable('. $this->yystack[$this->yyidx + 0]->minor['var'] .')->value'.$this->yystack[$this->yyidx + 0]->minor['index']; $this->compiler->tag_nocache=$this->compiler->tag_nocache|$this->template->getVariable(trim($this->yystack[$this->yyidx + 0]->minor['var'],\"'\"))->nocache;} }", "public function tlogVariable($name, $variable);", "function yy_r77(){ $this->_retvalue = '$_smarty_tpl->getVariable('. $this->yystack[$this->yyidx + -2]->minor .')->'.$this->yystack[$this->yyidx + 0]->minor; $this->compiler->tag_nocache=$this->compiler->tag_nocache|$this->template->getVariable(trim($this->yystack[$this->yyidx + -2]->minor,\"'\"))->nocache; }", "function cacheKey( $key )\n\t{\n\t\treturn $key.\"_\".MANUFACTURER_ID.getFirstSubDomain();\n\t}", "public function getCacheId()\n {\n return 'wsdl_config_global_' . md5($this->getServiceUrl('*/*/*'));\n }", "public function getVariableName(): string\n {\n return $this->var ?? $this->getValue();\n }", "function getVarName()\n {\n return $this->varName;\n }", "protected function cacheName($file){\n $hash = sha1($file);\n return \"$this->cache/$hash.php\";\n }", "protected function prefix($name)\r\n {\r\n return self::CACHE_PREFIX . $name;\r\n }", "function __get($name) {\n\t\t\t\t\tif (array_key_exists($name,$this->vars)) {\n\t\t\t\t\t\treturn $this->vars[$name];\n\t\t\t\t\t}\n\t\t\t\t\treturn null;\n\t\t\t\t}", "protected function get_cache_id() {\n\t\treturn wponion_hash_string( $this->module() . '_' . $this->unique() );\n\t}", "function SM_getVar($varName) {\n global $SM_siteManager;\n return $SM_siteManager->inVarH->getVar($varName);\n}", "public function get($name) {\n if($this->memcached !== false) {\n return $this->memcached->get(\"MystoreApiCache_\".$name);\n } else {\n return $this->$name;\n }\n }", "public function getAnnotationName()\n\t{\n\t\treturn 'HttpCache';\n\t}", "function yy_r160(){$this->_retvalue = '\".'.'$_smarty_tpl->getVariable(\\''. substr($this->yystack[$this->yyidx + 0]->minor,1) .'\\')->value'.'.\"'; $this->compiler->tag_nocache=$this->compiler->tag_nocache|$this->template->getVariable(trim($this->yystack[$this->yyidx + 0]->minor,\"'\"))->nocache; $this->compiler->has_variable_string = true; }", "private function get_cache_id() {\n $handlername = get_class($this);\n if($this->id)\n $cache_id = '_cache_' . $handlername . '_' . $this->id;\n else \n $cache_id = '_cache_' . $handlername . '_all'; \n return $cache_id;\n\t}", "public function getVariableName() : string {\n\n return $this->variableName;\n }", "private function getCacheKey($storage_name){\n return $storage_name.'_'.$this->media_type.'_'.$this->media_id;\n }", "public function get($name, $cache = true) {}", "public function cache_get($name, $def='')\n\t{\n\t\t$arr = _SESSION('page.'.$this->script_name(), array());\n\t\treturn (array_key_exists($name, $arr) ? $arr[$name] : $def);\n\t}", "public function __get($name) {\n\t\t$data = $this->_cache->load($this->_namespace);\n\t\tif(isset($data[$name])) {\n\t\t\treturn $data[$name];\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public function set($name, $value) {\n if($this->memcached !== false) {\n $this->memcached->set(\"MystoreApiCache_\".$name, $value);\n } else {\n $this->name = $value;\n }\n }", "protected function getCacheVersionKey(): string\n {\n return $this->prefix.'.version';\n }", "function yy_r69(){ $this->prefix_number++; $this->compiler->prefix_code[] = '<?php $_tmp'.$this->prefix_number.'=$_smarty_tpl->getVariable(\\''. $this->yystack[$this->yyidx + -3]->minor .'\\')->value;?>'; $this->_retvalue = $this->yystack[$this->yyidx + -6]->minor.'::$_tmp'.$this->prefix_number.'('. $this->yystack[$this->yyidx + -1]->minor .')'; }", "function _CacheFileName($key) {\n\t\t$FileName = $this->CacheDir . '/' . $this->_CleanKey($key);\n\n\t\treturn $FileName;\n\t}", "protected function getCacheKey()\r\n {\r\n if (null == $this->cacheKey) {\r\n $this->cacheKey = get_class($this)\r\n . $this->getParent()->getEnvironment()\r\n . $this->getHttpHost();\r\n }\r\n return $this->cacheKey;\r\n }", "private function getCacheId($prefix = 'minify') {\n $md5 = md5($this->filepath);\n return \"{$prefix}_less_{$md5}\";\n }", "function getSrcLoadedVarName() {\n return $this->srcLoadedVarName;\n }", "public function cacheBin() {\n return 'cache_forsrights_webservice';\n }", "public function variable($string);", "function _varname($varname) {\n\t\treturn \"{\".$varname.\"}\";\n\t}", "function getSrcVarName() {\n return $this->srcVarName;\n }", "public function get($variable);", "public function getVarName()\n\t{\n\t\treturn 'form-'.$this->domain;\n\t}", "public function getValFromCache($key);", "function getCacheFilename() {\n\t\treturn 'cache/fc-categories.php';\n\t}", "function _getXmlCacheFilename($module_srl)\n {\n return sprintf('%sfiles/cache/xedocs/%d.xml', _XE_PATH_, $module_srl);\n }", "function get($var) {\n\t\treturn $this->_viewVars[$var];\n\t}", "function _getVar($name) {\n if( is_array($this->_vars) && isset($this->_vars[\"$name\"]) )\n return $this->_vars[\"$name\"];\n else\n return \"\";\n }", "public function __get($name);", "public function __get($name);", "public function __get($name);", "public function __get($name);", "public function __get($name);", "public function __get($name);", "public function __get($name);", "function yy_r71(){ $this->prefix_number++; $this->compiler->prefix_code[] = '<?php $_tmp'.$this->prefix_number.'=$_smarty_tpl->getVariable(\\''. $this->yystack[$this->yyidx + -4]->minor .'\\')->value;?>'; $this->_retvalue = $this->yystack[$this->yyidx + -7]->minor.'::$_tmp'.$this->prefix_number.'('. $this->yystack[$this->yyidx + -2]->minor .')'.$this->yystack[$this->yyidx + 0]->minor; }", "function setBlock($resource_name, $variable = NULL, $cache_id = null)\n\t{ \n if (strpos($resource_name, '.') === false) {\n\t\t\t$resource_name .= '.tpl';\n\t\t}\n \n if ($variable){\n $content = parent::fetch($theme.'/'.$resource_name, $cache_id);\n \n $this->_globals[$variable] = $content;\n \n parent::clear_all_assign();\n\n } else {\n\t\t\n\n return parent::fetch($resource_name, $cache_id);\n }\n\t}", "function getBindVariableName() ;", "public function set_cache_name_function($function = 'md5')\n {\n }", "public function label()\n\t{\n\t\treturn __('Redis', 'xlii-cache');\n\t}", "protected function cacheKey() : string\n {\n return $this->cacheKey ?? $this->cacheKeyHash();\n }", "public function cache_set($name, $value)\n\t{\n\t\t$arr = _SESSION('page.'.$this->script_name(), array());\n\t\t$arr[$name] = $value;\n\t\t$_SESSION['page.'.$this->script_name()] = $arr;\n\t}", "public function getVariable(): string\n {\n return $this->variable;\n }", "function cacheing_environment()\n\t{\n\t\t$info=array();\n\t\t$info['cache_on']='array(((array_key_exists(\\'root\\',$map)) && ($map[\\'root\\']!=\\'\\'))?intval($map[\\'root\\']):get_param_integer(\\'root\\',NULL),array_key_exists(\\'search\\',$map)?$map[\\'search\\']:\\'\\',array_key_exists(\\'sort\\',$map)?$map[\\'sort\\']:\\'\\',array_key_exists(\\'display_type\\',$map)?$map[\\'display_type\\']:NULL,array_key_exists(\\'template_set\\',$map)?$map[\\'template_set\\']:\\'\\',array_key_exists(\\'select\\',$map)?$map[\\'select\\']:\\'\\',array_key_exists(\\'param\\',$map)?$map[\\'param\\']:db_get_first_id(),get_param_integer(\\'max\\',array_key_exists(\\'max\\',$map)?intval($map[\\'max\\']):30),get_param_integer(\\'start\\',0))';\n\t\t$info['ttl']=60*2;\n\t\treturn $info;\n\t}", "function yy_r106()\n {\n if ($this->yystack[$this->yyidx + 0]->minor['var'] == 'smarty') {\n $this->_retvalue = $this->compiler->compileTag('Internal_SpecialVariable', array(), $this->yystack[$this->yyidx + 0]->minor['smarty_internal_index']);\n } else {\n $this->_retvalue = $this->compiler->compileVariable($this->yystack[$this->yyidx + 0]->minor['var']) . $this->yystack[$this->yyidx + 0]->minor['smarty_internal_index'];\n }\n }", "public function cacheSetup()\n\t{\n\t\t// Generate the name\n\t\t$time = $this->modified;\n\t\t$extension = $this->type;\n\t\t$fileName = pathinfo($this->name, PATHINFO_FILENAME) . \".\" . md5($this->name . '.' . $time);\n\t\t$name = $fileName . \".\" . $extension;\n\n\t\t// Generate the cache file path\n\t\t$this->cacheFilePath = realpath(public_path() . '/' . $this->app['assets::config']['cache_path']) . '/' . $name;\n\n\t\t// Generate the cache file URL\n\t\t$this->cacheFileUrl = $this->app['assets::config']['cache_url'] . $name;\n\n\t\treturn $this->cacheFile = $name;\n\t}", "public static function get($_name) {\n\t\tif (!$_name) {\n\t\t\ttrigger_error(self::TEXT_Variable);\n\t\t\treturn array(FALSE,NULL);\n\t\t}\n\t\t$_name=self::resolve($_name);\n\t\t$_hash='var.'.self::hashCode(self::remix($_name));\n\t\t$_cached=Cache::cached($_hash);\n\t\tif ($_cached)\n\t\t\treturn unserialize(gzinflate(Cache::fetch($_hash)));\n\t\tif (preg_match('/^('.self::PHP_Globals.')\\b/',$_name,$_match)) {\n\t\t\t// Synchronize PHP and framework globals\n\t\t\tif (substr($_name,0,7)=='SESSION' && !strlen(session_id()))\n\t\t\t\tsession_start();\n\t\t\tself::$global[$_match[1]]=&$GLOBALS['_'.$_match[1]];\n\t\t}\n\t\treturn self::ref($_name);\n\t}", "function getSrcCountVarName() {\n return $this->srcCountVarName;\n }", "public function setCacheKey($var)\n {\n GPBUtil::checkString($var, True);\n $this->CacheKey = $var;\n\n return $this;\n }", "private function varName(&$var, $scope=0)\r\n {\r\n $old = $var;\r\n if (($key = array_search($var = 'unique'.rand().'value', !$scope ? $GLOBALS : $scope)) && $var = $old) return $key;\r\n }", "function _getDatCacheFilename($module_srl)\n {\n return sprintf('%sfiles/cache/xedocs/%d.dat', _XE_PATH_,$module_srl);\n }", "protected function registerTag(): string\n {\n return 'var';\n }", "public function getCacheKey()\n {\n return $this->cacheKey;\n }", "protected function remebmer_variable( $name, $value ){\n\t\tstatic::$instance->variables[$name] = $value;\n\t}", "public static function setCache($caching)\n{\nself::$caching=$caching;\n}", "function apc_cache_get_logindex($key) {\n\treturn APC_CACHE_LOG_INDEX . \"-\" . $key;\n}", "function PageVariableValue($variableName, $value = UNDEFINED);", "function setcache( $name, $d, $b = NULL )\n{\n\t\treturn FALSE;\n}" ]
[ "0.71318537", "0.66389817", "0.6103877", "0.6031464", "0.60104287", "0.5998216", "0.5819504", "0.5819504", "0.58134246", "0.5810323", "0.57369244", "0.57111394", "0.57053906", "0.5687298", "0.5684841", "0.5684486", "0.56701744", "0.5659563", "0.56323963", "0.56323963", "0.5620263", "0.5603314", "0.55933917", "0.55803007", "0.5543964", "0.55222553", "0.55222553", "0.55159044", "0.54848856", "0.5483595", "0.5482543", "0.5481008", "0.547081", "0.5464573", "0.54506475", "0.54488605", "0.5438091", "0.5436433", "0.54044133", "0.53855985", "0.5383615", "0.5360075", "0.53538233", "0.53520787", "0.5346034", "0.53351283", "0.5328905", "0.53224945", "0.53178364", "0.5304249", "0.5299017", "0.5281924", "0.5251647", "0.5197209", "0.51921797", "0.5191367", "0.5189364", "0.5182763", "0.51740134", "0.51677316", "0.51607925", "0.5148345", "0.514468", "0.51434505", "0.5134229", "0.513176", "0.51314104", "0.5124814", "0.51214206", "0.5119167", "0.51173294", "0.511558", "0.511558", "0.511558", "0.511558", "0.511558", "0.511558", "0.511558", "0.51140964", "0.5112864", "0.51126903", "0.51060873", "0.51030636", "0.5102449", "0.5094497", "0.5092136", "0.5088525", "0.5081252", "0.50809574", "0.5077036", "0.50716543", "0.5069929", "0.5068455", "0.50561666", "0.50541455", "0.5052846", "0.50523275", "0.50472933", "0.504623", "0.5044083", "0.50417846" ]
0.0
-1
Name For Xcache Variable
function update ($parameters = []): bool { $cache_key = "session[".$this->id."]"; $cache = new \Cache\Item($GLOBALS['_CACHE_'], $cache_key); if ($cache) $cache->delete(); app_log("Unset cache key $cache_key",'debug',__FILE__,__LINE__); # Make Sure User Has Privileges to view other sessions if ($GLOBALS['_SESSION_']->id != $this->id && ! $GLOBALS['_SESSION_']->customer->can('manage sessions')) { $this->error("No privileges to change session"); return null; } $ok_params = array( "user_id" => "user_id", "timezone" => "timezone", "super_elevation_expires" => "super_elevation_expires", "oauth2_state" => "oauth2_state" ); $update_session_query = " UPDATE session_sessions SET id = id"; $bind_params = array(); foreach ($parameters as $parameter => $value) { if ($ok_params[$parameter]) { $update_session_query .= ", `$parameter` = ?"; array_push($bind_params,$value); } } $update_session_query .= " WHERE id = ? "; array_push($bind_params,$this->id); query_log($update_session_query,$bind_params,true); $rs = $GLOBALS['_database']->Execute($update_session_query,$bind_params); if (! $rs) { $this->SQLError($GLOBALS['_database']->ErrorMsg()); return null; } return $this->details(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function cacheName()\n\t\t{\n\t\t\treturn $GLOBALS[\"ID\"] . \"_call.xml\";\n\t\t}", "public static function cached($_name) {\n\t\t$_name=self::resolve($_name);\n\t\t$_hash='var.'.self::hashCode(self::remix($_name));\n\t\treturn Cache::cached($_hash);\n\t}", "public function getCacheName();", "private function getCacheKey(): string\n {\n return $this->webserviceId.$this->cacheKey;\n }", "private function _cacheName() {\n $file = APPLICATION_PATH . '/application/settings/restapi_caching_url.php';\n if (file_exists($file)) {\n $enableCacheUrl = include $file;\n } else {\n return '';\n }\n $viewer = Engine_Api::_()->user()->getViewer();\n $front = Zend_Controller_Front::getInstance();\n $request = $front->getRequest();\n $params = array();\n $params['module'] = $request->getModuleName();\n $params['controller'] = $request->getControllerName();\n $params['action'] = $request->getActionName();\n $parameters = $request->getParams();\n $language = $parameters['language'];\n $cacheName = implode(\"_\", $params);\n $key_val = '';\n $cacheName = str_replace('-', '_', $cacheName);\n if (!isset($enableCacheUrl[$cacheName]) || empty($enableCacheUrl[$cacheName]))\n return;\n $getRequestUri = htmlspecialchars($_SERVER['REQUEST_URI']);\n $urlarray = explode(\"?\", $getRequestUri);\n $trimData = trim($urlarray[0], \"/\");\n $cachName = str_replace(\"/\", \"_\", $trimData);\n $viewerId = 0;\n $keys = array_keys($parameters);\n $matched = preg_grep('/_id|_type$/', $keys);\n $matched = array_flip($matched);\n $matched = array_intersect_key($parameters, $matched);\n $key_val = implode('_', $matched);\n\n if ($enableCacheUrl[$cacheName] == 'member_level') {\n $viewerId = $viewer && $viewer->getIdentity() ? $viewer->level_id : 0;\n } elseif ($enableCacheUrl[$cacheName] == 'user_level') {\n $viewerId = $viewer && $viewer->getIdentity() ? $viewer->getIdentity() : 0;\n }\n\n $cachName = $cachName . '_' . $language . '_' . $key_val . '_' . $viewerId;\n $cachName = str_replace('-', '_', $cachName);\n $cachName = str_replace('.', '_', $cachName);\n return $cachName;\n }", "protected static function getCacheIdentifier() {}", "final public function GetVariableName() { return $this->varName; }", "final public function GetVariableName() { return $this->varName; }", "public function cacheKey(): string {\n return self::CACHE_PREFIX . $this->id\n . ($this->revisionId ? '_r' . $this->revisionId : '');\n }", "public function get($cache_name);", "public function cache_filename()\n {\n return $this->_name . '_' . $this->id() . '.' . $this->_type;\n }", "private function generateCacheName(): string\n\t{\n\t\t$get = implode('-', $_GET);\n\t\t$name = $this->_resizeMode . $this->_imagePath . $this->_oldWidth . $this->_oldHeight . $this->_newWidth . $this->_newHeight . $get;\n\t\treturn md5($name) . '.' . $this->_extension;\n\t}", "abstract function get_cache_prefix(): string;", "function e($var_nm)\n{\n\tglobal $$var_nm ;\n\n\treturn '$' . $var_nm . ' = ' . $$var_nm . ' ' ;\n}", "function acf_cache_key($key = '')\n{\n}", "protected function getCacheName(){\n\t\tif(is_null($this->param)) {\n\t\t\tthrow new \\Exception('Call \"setParameters\" first!');\n\t\t}\n\n\t\t// Change character when making incompatible changes to prevent loading\n\t\t// errors due to incompatible file contents \\|/\n\t\treturn hash('md5', http_build_query($this->param) . 'A') . '.cache';\n\t}", "private function getCacheId()\n\t{\n\t\treturn self::CACHE_ID_PREFIX . '_' . $this->exportId . '_' . $this->type;\n\t}", "public function get(string $variableName);", "public static function getCacheTag()\n\t{\n\t\treturn get_called_class() . '_common_cache';\n\t}", "public static function getCacheTag()\n\t{\n\t\treturn get_called_class() . '_common_cache';\n\t}", "public function name()\n {\n return $this->getFromCache(\n ['type' => 'name']\n );\n }", "function cache_key(Repository $repo) {\n return \"ms_\" . md5($repo->user . $repo->name);\n}", "private function cacheKey()\n {\n return sprintf('contact-permissons-%s', $this->client->patientContactId);\n }", "public function __get($_name);", "function getCacheId() {\n return get_class($this).\"_\".$this->id;\n }", "public static function getCacheTag()\n {\n return static::$cacheTag;\n }", "public static function getCacheTag()\n {\n return static::$cacheTag;\n }", "public function setName($name){\n\t\t\t$this->_name = $name;\n\t\t\t$this->_nameFileFile = CACHE_PATH.$name.'.cache';\n\t\t}", "protected static function getExtLocalconfCacheIdentifier() {}", "protected static function getCacheName()\n\t{\n\t\tstatic $strCacheName;\n\t\tif (!isset($strCacheName))\n\t\t{\n\t\t\t$strCacheName = __CLASS__;\n\t\t}\n\t\treturn $strCacheName;\n\t}", "protected function generateVarName($prefix = '')\n\t{\n\t\tif (!$this->var_uniq) {\n\t\t\t$this->var_uniq = substr(md5(mt_rand()), 1, 4);\n\t\t}\n\t\t$name = $this->var_uniq . (++$this->var_id);\n\t\treturn '$'.$prefix.'_'.$name;\n\t}", "public function getCacheName($name){\n if($this->is_mobile)\n $name .= '_mobile';\n return $name;\n }", "function yy_r76(){if ($this->yystack[$this->yyidx + 0]->minor['var'] == '\\'smarty\\'') { $this->_retvalue = $this->compiler->compileTag('special_smarty_variable',$this->yystack[$this->yyidx + 0]->minor['index']);} else {\r\n $this->_retvalue = '$_smarty_tpl->getVariable('. $this->yystack[$this->yyidx + 0]->minor['var'] .')->value'.$this->yystack[$this->yyidx + 0]->minor['index']; $this->compiler->tag_nocache=$this->compiler->tag_nocache|$this->template->getVariable(trim($this->yystack[$this->yyidx + 0]->minor['var'],\"'\"))->nocache;} }", "public function tlogVariable($name, $variable);", "function yy_r77(){ $this->_retvalue = '$_smarty_tpl->getVariable('. $this->yystack[$this->yyidx + -2]->minor .')->'.$this->yystack[$this->yyidx + 0]->minor; $this->compiler->tag_nocache=$this->compiler->tag_nocache|$this->template->getVariable(trim($this->yystack[$this->yyidx + -2]->minor,\"'\"))->nocache; }", "function cacheKey( $key )\n\t{\n\t\treturn $key.\"_\".MANUFACTURER_ID.getFirstSubDomain();\n\t}", "public function getCacheId()\n {\n return 'wsdl_config_global_' . md5($this->getServiceUrl('*/*/*'));\n }", "public function getVariableName(): string\n {\n return $this->var ?? $this->getValue();\n }", "function getVarName()\n {\n return $this->varName;\n }", "protected function cacheName($file){\n $hash = sha1($file);\n return \"$this->cache/$hash.php\";\n }", "protected function prefix($name)\r\n {\r\n return self::CACHE_PREFIX . $name;\r\n }", "function __get($name) {\n\t\t\t\t\tif (array_key_exists($name,$this->vars)) {\n\t\t\t\t\t\treturn $this->vars[$name];\n\t\t\t\t\t}\n\t\t\t\t\treturn null;\n\t\t\t\t}", "protected function get_cache_id() {\n\t\treturn wponion_hash_string( $this->module() . '_' . $this->unique() );\n\t}", "function SM_getVar($varName) {\n global $SM_siteManager;\n return $SM_siteManager->inVarH->getVar($varName);\n}", "public function get($name) {\n if($this->memcached !== false) {\n return $this->memcached->get(\"MystoreApiCache_\".$name);\n } else {\n return $this->$name;\n }\n }", "public function getAnnotationName()\n\t{\n\t\treturn 'HttpCache';\n\t}", "function yy_r160(){$this->_retvalue = '\".'.'$_smarty_tpl->getVariable(\\''. substr($this->yystack[$this->yyidx + 0]->minor,1) .'\\')->value'.'.\"'; $this->compiler->tag_nocache=$this->compiler->tag_nocache|$this->template->getVariable(trim($this->yystack[$this->yyidx + 0]->minor,\"'\"))->nocache; $this->compiler->has_variable_string = true; }", "private function get_cache_id() {\n $handlername = get_class($this);\n if($this->id)\n $cache_id = '_cache_' . $handlername . '_' . $this->id;\n else \n $cache_id = '_cache_' . $handlername . '_all'; \n return $cache_id;\n\t}", "public function getVariableName() : string {\n\n return $this->variableName;\n }", "private function getCacheKey($storage_name){\n return $storage_name.'_'.$this->media_type.'_'.$this->media_id;\n }", "public function get($name, $cache = true) {}", "public function cache_get($name, $def='')\n\t{\n\t\t$arr = _SESSION('page.'.$this->script_name(), array());\n\t\treturn (array_key_exists($name, $arr) ? $arr[$name] : $def);\n\t}", "public function __get($name) {\n\t\t$data = $this->_cache->load($this->_namespace);\n\t\tif(isset($data[$name])) {\n\t\t\treturn $data[$name];\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public function set($name, $value) {\n if($this->memcached !== false) {\n $this->memcached->set(\"MystoreApiCache_\".$name, $value);\n } else {\n $this->name = $value;\n }\n }", "protected function getCacheVersionKey(): string\n {\n return $this->prefix.'.version';\n }", "function yy_r69(){ $this->prefix_number++; $this->compiler->prefix_code[] = '<?php $_tmp'.$this->prefix_number.'=$_smarty_tpl->getVariable(\\''. $this->yystack[$this->yyidx + -3]->minor .'\\')->value;?>'; $this->_retvalue = $this->yystack[$this->yyidx + -6]->minor.'::$_tmp'.$this->prefix_number.'('. $this->yystack[$this->yyidx + -1]->minor .')'; }", "function _CacheFileName($key) {\n\t\t$FileName = $this->CacheDir . '/' . $this->_CleanKey($key);\n\n\t\treturn $FileName;\n\t}", "protected function getCacheKey()\r\n {\r\n if (null == $this->cacheKey) {\r\n $this->cacheKey = get_class($this)\r\n . $this->getParent()->getEnvironment()\r\n . $this->getHttpHost();\r\n }\r\n return $this->cacheKey;\r\n }", "private function getCacheId($prefix = 'minify') {\n $md5 = md5($this->filepath);\n return \"{$prefix}_less_{$md5}\";\n }", "function getSrcLoadedVarName() {\n return $this->srcLoadedVarName;\n }", "public function cacheBin() {\n return 'cache_forsrights_webservice';\n }", "public function variable($string);", "function _varname($varname) {\n\t\treturn \"{\".$varname.\"}\";\n\t}", "function getSrcVarName() {\n return $this->srcVarName;\n }", "public function get($variable);", "public function getVarName()\n\t{\n\t\treturn 'form-'.$this->domain;\n\t}", "public function getValFromCache($key);", "function getCacheFilename() {\n\t\treturn 'cache/fc-categories.php';\n\t}", "function _getXmlCacheFilename($module_srl)\n {\n return sprintf('%sfiles/cache/xedocs/%d.xml', _XE_PATH_, $module_srl);\n }", "function get($var) {\n\t\treturn $this->_viewVars[$var];\n\t}", "function _getVar($name) {\n if( is_array($this->_vars) && isset($this->_vars[\"$name\"]) )\n return $this->_vars[\"$name\"];\n else\n return \"\";\n }", "public function __get($name);", "public function __get($name);", "public function __get($name);", "public function __get($name);", "public function __get($name);", "public function __get($name);", "public function __get($name);", "function yy_r71(){ $this->prefix_number++; $this->compiler->prefix_code[] = '<?php $_tmp'.$this->prefix_number.'=$_smarty_tpl->getVariable(\\''. $this->yystack[$this->yyidx + -4]->minor .'\\')->value;?>'; $this->_retvalue = $this->yystack[$this->yyidx + -7]->minor.'::$_tmp'.$this->prefix_number.'('. $this->yystack[$this->yyidx + -2]->minor .')'.$this->yystack[$this->yyidx + 0]->minor; }", "function setBlock($resource_name, $variable = NULL, $cache_id = null)\n\t{ \n if (strpos($resource_name, '.') === false) {\n\t\t\t$resource_name .= '.tpl';\n\t\t}\n \n if ($variable){\n $content = parent::fetch($theme.'/'.$resource_name, $cache_id);\n \n $this->_globals[$variable] = $content;\n \n parent::clear_all_assign();\n\n } else {\n\t\t\n\n return parent::fetch($resource_name, $cache_id);\n }\n\t}", "function getBindVariableName() ;", "public function set_cache_name_function($function = 'md5')\n {\n }", "public function label()\n\t{\n\t\treturn __('Redis', 'xlii-cache');\n\t}", "protected function cacheKey() : string\n {\n return $this->cacheKey ?? $this->cacheKeyHash();\n }", "public function cache_set($name, $value)\n\t{\n\t\t$arr = _SESSION('page.'.$this->script_name(), array());\n\t\t$arr[$name] = $value;\n\t\t$_SESSION['page.'.$this->script_name()] = $arr;\n\t}", "public function getVariable(): string\n {\n return $this->variable;\n }", "function cacheing_environment()\n\t{\n\t\t$info=array();\n\t\t$info['cache_on']='array(((array_key_exists(\\'root\\',$map)) && ($map[\\'root\\']!=\\'\\'))?intval($map[\\'root\\']):get_param_integer(\\'root\\',NULL),array_key_exists(\\'search\\',$map)?$map[\\'search\\']:\\'\\',array_key_exists(\\'sort\\',$map)?$map[\\'sort\\']:\\'\\',array_key_exists(\\'display_type\\',$map)?$map[\\'display_type\\']:NULL,array_key_exists(\\'template_set\\',$map)?$map[\\'template_set\\']:\\'\\',array_key_exists(\\'select\\',$map)?$map[\\'select\\']:\\'\\',array_key_exists(\\'param\\',$map)?$map[\\'param\\']:db_get_first_id(),get_param_integer(\\'max\\',array_key_exists(\\'max\\',$map)?intval($map[\\'max\\']):30),get_param_integer(\\'start\\',0))';\n\t\t$info['ttl']=60*2;\n\t\treturn $info;\n\t}", "function yy_r106()\n {\n if ($this->yystack[$this->yyidx + 0]->minor['var'] == 'smarty') {\n $this->_retvalue = $this->compiler->compileTag('Internal_SpecialVariable', array(), $this->yystack[$this->yyidx + 0]->minor['smarty_internal_index']);\n } else {\n $this->_retvalue = $this->compiler->compileVariable($this->yystack[$this->yyidx + 0]->minor['var']) . $this->yystack[$this->yyidx + 0]->minor['smarty_internal_index'];\n }\n }", "public function cacheSetup()\n\t{\n\t\t// Generate the name\n\t\t$time = $this->modified;\n\t\t$extension = $this->type;\n\t\t$fileName = pathinfo($this->name, PATHINFO_FILENAME) . \".\" . md5($this->name . '.' . $time);\n\t\t$name = $fileName . \".\" . $extension;\n\n\t\t// Generate the cache file path\n\t\t$this->cacheFilePath = realpath(public_path() . '/' . $this->app['assets::config']['cache_path']) . '/' . $name;\n\n\t\t// Generate the cache file URL\n\t\t$this->cacheFileUrl = $this->app['assets::config']['cache_url'] . $name;\n\n\t\treturn $this->cacheFile = $name;\n\t}", "public static function get($_name) {\n\t\tif (!$_name) {\n\t\t\ttrigger_error(self::TEXT_Variable);\n\t\t\treturn array(FALSE,NULL);\n\t\t}\n\t\t$_name=self::resolve($_name);\n\t\t$_hash='var.'.self::hashCode(self::remix($_name));\n\t\t$_cached=Cache::cached($_hash);\n\t\tif ($_cached)\n\t\t\treturn unserialize(gzinflate(Cache::fetch($_hash)));\n\t\tif (preg_match('/^('.self::PHP_Globals.')\\b/',$_name,$_match)) {\n\t\t\t// Synchronize PHP and framework globals\n\t\t\tif (substr($_name,0,7)=='SESSION' && !strlen(session_id()))\n\t\t\t\tsession_start();\n\t\t\tself::$global[$_match[1]]=&$GLOBALS['_'.$_match[1]];\n\t\t}\n\t\treturn self::ref($_name);\n\t}", "function getSrcCountVarName() {\n return $this->srcCountVarName;\n }", "public function setCacheKey($var)\n {\n GPBUtil::checkString($var, True);\n $this->CacheKey = $var;\n\n return $this;\n }", "private function varName(&$var, $scope=0)\r\n {\r\n $old = $var;\r\n if (($key = array_search($var = 'unique'.rand().'value', !$scope ? $GLOBALS : $scope)) && $var = $old) return $key;\r\n }", "function _getDatCacheFilename($module_srl)\n {\n return sprintf('%sfiles/cache/xedocs/%d.dat', _XE_PATH_,$module_srl);\n }", "protected function registerTag(): string\n {\n return 'var';\n }", "public function getCacheKey()\n {\n return $this->cacheKey;\n }", "protected function remebmer_variable( $name, $value ){\n\t\tstatic::$instance->variables[$name] = $value;\n\t}", "public static function setCache($caching)\n{\nself::$caching=$caching;\n}", "function apc_cache_get_logindex($key) {\n\treturn APC_CACHE_LOG_INDEX . \"-\" . $key;\n}", "function PageVariableValue($variableName, $value = UNDEFINED);", "function setcache( $name, $d, $b = NULL )\n{\n\t\treturn FALSE;\n}" ]
[ "0.71318537", "0.66389817", "0.6103877", "0.6031464", "0.60104287", "0.5998216", "0.5819504", "0.5819504", "0.58134246", "0.5810323", "0.57369244", "0.57111394", "0.57053906", "0.5687298", "0.5684841", "0.5684486", "0.56701744", "0.5659563", "0.56323963", "0.56323963", "0.5620263", "0.5603314", "0.55933917", "0.55803007", "0.5543964", "0.55222553", "0.55222553", "0.55159044", "0.54848856", "0.5483595", "0.5482543", "0.5481008", "0.547081", "0.5464573", "0.54506475", "0.54488605", "0.5438091", "0.5436433", "0.54044133", "0.53855985", "0.5383615", "0.5360075", "0.53538233", "0.53520787", "0.5346034", "0.53351283", "0.5328905", "0.53224945", "0.53178364", "0.5304249", "0.5299017", "0.5281924", "0.5251647", "0.5197209", "0.51921797", "0.5191367", "0.5189364", "0.5182763", "0.51740134", "0.51677316", "0.51607925", "0.5148345", "0.514468", "0.51434505", "0.5134229", "0.513176", "0.51314104", "0.5124814", "0.51214206", "0.5119167", "0.51173294", "0.511558", "0.511558", "0.511558", "0.511558", "0.511558", "0.511558", "0.511558", "0.51140964", "0.5112864", "0.51126903", "0.51060873", "0.51030636", "0.5102449", "0.5094497", "0.5092136", "0.5088525", "0.5081252", "0.50809574", "0.5077036", "0.50716543", "0.5069929", "0.5068455", "0.50561666", "0.50541455", "0.5052846", "0.50523275", "0.50472933", "0.504623", "0.5044083", "0.50417846" ]
0.0
-1
Initialize order totals array
protected function _initTotals() { parent::_initTotals(); $amount = $this->getSource()->getTablepriceDiscountAmount(); if ($amount) { $this->addTotalBefore(new Varien_Object(array( 'code' => 'fvets_tableprice', 'value' => $amount, 'base_value'=> $amount, 'label' => $this->helper('fvets_tableprice')->__('Table discount'), ), array('nominal', 'subtotal'))); } return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function createTotalsFromSums() {\n $subtotal = $this->ItemSubtotalSum;\n $this->data['Order']['subtotal'] = $subtotal;\n\n $tax = sprintf('%0.2f', $subtotal * $this->ShipmentTaxPercent * $this->Taxable);\n $this->data['Order']['tax'] = $tax;\n\n $this->data['Order']['total'] = $subtotal + $tax + $this->ShipmentSum;\n\n $this->data['Order']['order_item_count'] = $this->ItemCount;\n\n $this->data['Order']['weight'] = $this->ItemWeightSum;\n\n return array_intersect_key(\n $this->data['Order'],\n array(\n 'subtotal' => NULL,\n 'tax' => NULL,\n 'order_item_count' => NULL,\n 'weight' => NULL,\n 'total' => NULL,\n )\n );\n }", "protected function _initTotals()\n {\n $this->_totals = array();\n $this->_totals['subtotal'] = new Varien_Object(array(\n 'code' => 'subtotal',\n 'value' => $this->getSource()->getSubtotal(),\n 'base_value' => $this->getSource()->getBaseSubtotal(),\n 'bluesnap_value' => $this->getSource()->getBluesnapSubtotal(),\n 'label' => $this->helper('sales')->__('Subtotal')\n ));\n\n /**\n * Add shipping\n */\n if (!$this->getSource()->getIsVirtual() && ((float)$this->getSource()->getShippingAmount() || $this->getSource()->getShippingDescription())) {\n $this->_totals['shipping'] = new Varien_Object(array(\n 'code' => 'shipping',\n 'value' => $this->getSource()->getShippingAmount(),\n 'base_value' => $this->getSource()->getBaseShippingAmount(),\n 'bluesnap_value' => $this->getSource()->getBluesnapShippingAmount(),\n 'label' => $this->helper('sales')->__('Shipping & Handling')\n ));\n }\n\n /**\n * Add discount\n */\n if (((float)$this->getSource()->getDiscountAmount()) != 0) {\n if ($this->getSource()->getDiscountDescription()) {\n $discountLabel = $this->helper('sales')->__('Discount (%s)', $this->getSource()->getDiscountDescription());\n } else {\n $discountLabel = $this->helper('sales')->__('Discount');\n }\n $this->_totals['discount'] = new Varien_Object(array(\n 'code' => 'discount',\n 'value' => $this->getSource()->getDiscountAmount(),\n 'base_value' => $this->getSource()->getBaseDiscountAmount(),\n 'bluesnap_value' => $this->getSource()->getBluesnapDiscountAmount(),\n 'label' => $discountLabel\n ));\n }\n\n $this->_totals['grand_total'] = new Varien_Object(array(\n 'code' => 'grand_total',\n 'strong' => true,\n 'value' => $this->getSource()->getGrandTotal(),\n 'base_value' => $this->getSource()->getBaseGrandTotal(),\n 'bluesnap_value' => $this->getSource()->getBluesnapGrandTotal(),\n 'label' => $this->helper('sales')->__('Grand Total'),\n 'area' => 'footer'\n ));\n\n\n //end parent totals\n\n $this->_totals['paid'] = new Varien_Object(array(\n 'code' => 'paid',\n 'strong' => true,\n 'value' => $this->getSource()->getTotalPaid(),\n 'base_value' => $this->getSource()->getBaseTotalPaid(),\n 'bluesnap_value' => $this->getSource()->getBluesnapTotalPaid(),\n 'label' => $this->helper('sales')->__('Total Paid'),\n 'area' => 'footer'\n ));\n $this->_totals['refunded'] = new Varien_Object(array(\n 'code' => 'refunded',\n 'strong' => true,\n 'value' => $this->getSource()->getTotalRefunded(),\n 'base_value' => $this->getSource()->getBaseTotalRefunded(),\n 'bluesnap_value' => $this->getSource()->getBluesnapTotalRefunded(),\n 'label' => $this->helper('sales')->__('Total Refunded'),\n 'area' => 'footer'\n ));\n $this->_totals['due'] = new Varien_Object(array(\n 'code' => 'due',\n 'strong' => true,\n 'value' => $this->getSource()->getTotalDue(),\n 'base_value' => $this->getSource()->getBaseTotalDue(),\n 'bluesnap_value' => $this->getSource()->getBluesnapTotalDue(),\n\n 'label' => $this->helper('sales')->__('Total Due'),\n 'area' => 'footer'\n ));\n return $this;\n }", "private function initializeSubtotals()\n {\n if (!isset($this->data->subtotals)) {\n $this->data->subtotals = new stdClass();\n }\n }", "public function get_orders_total() : array {\n\t\t$element = $this->dom->find( '#j-order-num' );\n\t\tif ( ! $element ) {\n\t\t\treturn [\n\t\t\t\t'orders_total' => 0,\n\t\t\t];\n\t\t}\n\n\t\t$value = explode( ' ', $element[0]->text() );\n\t\tif ( ! $value || empty( $value[0] ) ) {\n\t\t\treturn [\n\t\t\t\t'orders_total' => 0,\n\t\t\t];\n\t\t}\n\n\t\treturn [\n\t\t\t'orders_total' => intval( $value[0] ),\n\t\t];\n\t}", "protected function _initTotals()\n {\n $source = $this->getSource();\n\n $this->_totals = array();\n $this->_totals['subtotal'] = new Varien_Object(array(\n 'code' => 'subtotal',\n 'value' => $source->getSubtotal(),\n 'label' => $this->__('Subtotal')\n ));\n\n\n /**\n * Add shipping\n */\n if (!$source->getIsVirtual() && ((float) $source->getShippingAmount() || $source->getShippingDescription()))\n {\n $this->_totals['shipping'] = new Varien_Object(array(\n 'code' => 'shipping',\n 'field' => 'shipping_amount',\n 'value' => $this->getSource()->getShippingAmount(),\n 'label' => $this->__('Shipping & Handling')\n ));\n }\n\n /**\n * Add discount\n */\n if (((float)$this->getSource()->getDiscountAmount()) != 0) {\n if ($this->getSource()->getDiscountDescription()) {\n $discountLabel = $this->__('Discount (%s)', $source->getDiscountDescription());\n } else {\n $discountLabel = $this->__('Discount');\n }\n $this->_totals['discount'] = new Varien_Object(array(\n 'code' => 'discount',\n 'field' => 'discount_amount',\n 'value' => $source->getDiscountAmount(),\n 'label' => $discountLabel\n ));\n }\n\n $this->_totals['grand_total'] = new Varien_Object(array(\n 'code' => 'grand_total',\n 'field' => 'grand_total',\n 'strong'=> true,\n 'value' => $source->getGrandTotal(),\n 'label' => $this->__('Grand Total')\n ));\n\n /**\n * Base grandtotal\n */\n if ($this->getOrder()->isCurrencyDifferent()) {\n $this->_totals['base_grandtotal'] = new Varien_Object(array(\n 'code' => 'base_grandtotal',\n 'value' => $this->getOrder()->formatBasePrice($source->getBaseGrandTotal()),\n 'label' => $this->__('Grand Total to be Charged'),\n 'is_formated' => true,\n ));\n }\n return $this;\n }", "protected function _initTotals()\n {\n $this->_totals = array();\n\n //overridden store ship\n $storeship = Bm_Cmon::getWholesalerShipping($this->getOrder()->getRealOrderId());\n\n\n $_subtotal = 0;\n foreach ($this->getOrder()->getAllItems() as $orderItem) {\n\n \tif(Bm_Cmon::checkSkuOwner($orderItem->getSku())){\n \t\t$_subtotal+= $orderItem->getQtyOrdered()*$orderItem->getOriginalPrice();\n\n \t}\n \n \n\n }\n\n $this->_totals['subtotal'] = new Varien_Object(array(\n 'code' => 'subtotal',\n 'value' => $_subtotal,\n 'base_value'=> $this->getSource()->getBaseSubtotal(),\n 'label' => $this->helper('sales')->__('Subtotal')\n ));\n\n /**\n * overridden ship value\n */\n if (!$this->getSource()->getIsVirtual() && ((float) $this->getSource()->getShippingAmount() || $this->getSource()->getShippingDescription()))\n {\n \n $this->_totals['shipping'] = new Varien_Object(array(\n 'code' => 'shipping',\n 'value' => $storeship['value'], //$this->getSource()->getShippingAmount(),\n 'base_value'=> $this->getSource()->getBaseShippingAmount(),\n 'label' => $this->helper('sales')->__('Shipping & Handling')\n ));\n }\n\n /**\n * Add discount\n */\n\n /*\n if (((float)$this->getSource()->getDiscountAmount()) != 0) {\n if ($this->getSource()->getDiscountDescription()) {\n $discountLabel = $this->helper('sales')->__('Discount (%s)', $this->getSource()->getDiscountDescription());\n } else {\n $discountLabel = $this->helper('sales')->__('Discount');\n }\n $this->_totals['discount'] = new Varien_Object(array(\n 'code' => 'discount',\n 'value' => $this->getSource()->getDiscountAmount(),\n 'base_value'=> $this->getSource()->getBaseDiscountAmount(),\n 'label' => $discountLabel\n ));\n }\n\t\t*/\n\n\t\t//FIXME: implements discount logic\n $this->_totals['grand_total'] = new Varien_Object(array(\n 'code' => 'grand_total',\n 'strong' => true,\n 'value' => $_subtotal+$this->getSource()->getDiscountAmount()*(-1)+$storeship['value'],\n 'base_value'=> $this->getSource()->getBaseGrandTotal(),\n 'label' => $this->helper('sales')->__('Grand Total'),\n 'area' => 'footer'\n ));\n\n return $this;\n }", "protected function _initTotals()\n {\n $source = $this->getSource();\n\n $this->_totals = [];\n $this->_totals['subtotal'] = new \\Magento\\Framework\\DataObject(\n ['code' => 'subtotal', 'value' => $source->getSubtotal(), 'label' => __('Subtotal')]\n );\n\n if ((double)$this->getOrder()->getPayment()->getAdditionalInformation('paypal_custom_fee') != 0) {\n $this->_totals['paypal_fee'] = new \\Magento\\Framework\\DataObject(\n [\n 'code' => 'paypal_fee',\n 'field' => 'paypal_fee',\n 'value' => $this->getOrder()->getPayment()->getAdditionalInformation('paypal_custom_fee'),\n 'label' => $this->getOrder()->getPayment()->getAdditionalInformation('base_paypal_custom_fee_description'),\n ]\n );\n }\n\n\n /**\n * Add discount\n */\n if ((double)$this->getSource()->getDiscountAmount() != 0) {\n if ($this->getSource()->getDiscountDescription()) {\n $discountLabel = __('Discount (%1)', $source->getDiscountDescription());\n } else {\n $discountLabel = __('Discount');\n }\n $this->_totals['discount'] = new \\Magento\\Framework\\DataObject(\n [\n 'code' => 'discount',\n 'field' => 'discount_amount',\n 'value' => $source->getDiscountAmount(),\n 'label' => $discountLabel,\n ]\n );\n }\n\n /**\n * Add shipping\n */\n if (!$source->getIsVirtual() && ((double)$source->getShippingAmount() || $source->getShippingDescription())) {\n $label = __('Shipping & Handling');\n if ($this->getSource()->getCouponCode() && !isset($this->_totals['discount'])) {\n $label = __('Shipping & Handling (%1)', $this->getSource()->getCouponCode());\n }\n\n $this->_totals['shipping'] = new \\Magento\\Framework\\DataObject(\n [\n 'code' => 'shipping',\n 'field' => 'shipping_amount',\n 'value' => $this->getSource()->getShippingAmount(),\n 'label' => $label,\n ]\n );\n }\n\n $this->_totals['grand_total'] = new \\Magento\\Framework\\DataObject(\n [\n 'code' => 'grand_total',\n 'field' => 'grand_total',\n 'strong' => true,\n 'value' => $source->getGrandTotal(),\n 'label' => __('Grand Total'),\n ]\n );\n\n /**\n * Base grandtotal\n */\n if ($this->getOrder()->isCurrencyDifferent()) {\n $this->_totals['base_grandtotal'] = new \\Magento\\Framework\\DataObject(\n [\n 'code' => 'base_grandtotal',\n 'value' => $this->getOrder()->formatBasePrice($source->getBaseGrandTotal()),\n 'label' => __('Grand Total to be Charged'),\n 'is_formated' => true,\n ]\n );\n }\n return $this;\n }", "protected function _initTotals()\r\n {\r\n parent::_initTotals();\r\n $orderId = $this->getSource()->getId();\r\n\t\t//$base_orderId = 34243;\r\n\t\t$discount = $this->helper('auction')->getDiscountByOrderId($orderId);\r\n if (0) {\r\n $this->addTotalBefore(new Varien_Object(array(\r\n 'code' => 'auction',\r\n 'value' => $amount,\r\n 'base_value'=> $amount,\r\n 'label' => $this->helper('auction')->__('Auction Product Discount ').$amount.$this->helper('auction')->__('%'),\r\n ), array('shipping', 'tax')));\r\n }\r\n\r\n return $this;\r\n }", "protected function init()\n {\n $this->totais = [\n 'liquidados' => 0,\n 'entradas' => 0,\n 'baixados' => 0,\n 'protestados' => 0,\n 'erros' => 0,\n 'alterados' => 0,\n ];\n }", "public function provideTotal()\n {\n return [\n [[1, 2, 5, 8], 16],\n [[-1, 2, 5, 8], 14],\n [[1, 2, 8], 11]\n ];\n }", "public function initTotals()\n {\n /* @var $items \\Magento\\Sales\\Model\\Order\\Item[] */\n $parent = $this->getParentBlock();\n $this->_order = $parent->getOrder();\n $this->_source = $parent->getSource();\n\n $items = $this->_source->getAllItems();\n $store = $this->_source->getStore();\n $subscriptionInitAmount = $this->_order->getSubscribenowInitAmount();\n $trialSubscriptionAmount = $this->_order->getSubscribenowTrialAmount();\n if ($subscriptionInitAmount > 0) {\n $initFee = new \\Magento\\Framework\\DataObject(\n [\n 'code' => 'subscribenow_init_amount',\n 'strong' => false,\n 'value' => $subscriptionInitAmount,\n 'label' => __('Initial Fee'),\n ]\n );\n if ($this->getBeforeCondition()) {\n $parent->addTotalBefore($initFee, $this->getBeforeCondition());\n } else {\n $parent->addTotal($initFee);\n }\n }\n if ($this->_order->getHasTrial()) {\n $trialFee = new \\Magento\\Framework\\DataObject(\n [\n 'code' => 'subscribenow_trial_amount',\n 'strong' => false,\n 'value' => $trialSubscriptionAmount,\n 'label' => __('Trial Fee'),\n ]\n );\n $parent->addTotal($trialFee, 'subscribenow_init_amount');\n }\n\n return $this;\n }", "public function initTotals() {\n $helper = Mage::helper('cornerdrop_collect');\n\n /** @var Mage_Sales_Block_Order_Totals $parent */\n $parent = $this->getParentBlock();\n $source = $parent->getSource();\n $shipping_address = $source->getShippingAddress();\n if($shipping_address && $helper->isCornerDropAddress($source->getShippingAddress())) {\n $parent->addTotalBefore(\n new Varien_Object(array(\n 'code' => CornerDrop_Collect_Helper_Data::CORNERDROP_FEE_AMOUNT,\n 'value' => $source->getData(CornerDrop_Collect_Helper_Data::CORNERDROP_FEE_AMOUNT),\n 'base_value'=> $source->getData(CornerDrop_Collect_Helper_Data::BASE_CORNERDROP_FEE_AMOUNT),\n 'label' => $helper->getCornerDropFeeLabel()\n )\n ),\n 'shipping'\n );\n }\n }", "public function __construct()\n {\n $this->_cash = array ( 1 => 25, 2 => 74, 5 => 14, 10 => 18, 20 => 0, 50 => 5, 100 => 30, 200 => 15, 500 => 8, 1000 => 11, 2000 => 8, 5000 => 5, 10000 => 2, 20000 => 0, 50000 => 0 );\n;\n }", "protected function init()\n {\n $this->totais = [\n 'liquidados' => 0,\n 'entradas' => 0,\n 'baixados' => 0,\n 'protestados' => 0,\n 'erros' => 0,\n 'alterados' => 0,\n ];\n }", "public static function getOrderTotals($_oID) {\n global $lC_Database;\n \n $QorderTotals = $lC_Database->query('select * from :table_orders_total where orders_id = :orders_id order by sort_order asc');\n $QorderTotals->bindTable(':table_orders_total', TABLE_ORDERS_TOTAL);\n $QorderTotals->bindInt(':orders_id', $_oID);\n $QorderTotals->execute();\n \n $orders_total_array = array();\n while ($QorderTotals->next()) {\n $orders_total_array[] = array('title' => $QorderTotals->value('title'),\n 'text' => $QorderTotals->value('text'),\n 'value' => $QorderTotals->value('value'),\n 'class' => $QorderTotals->value('class'),\n 'sort_order' => $QorderTotals->valueInt('sort_order'));\n }\n \n return $orders_total_array;\n \n $QorderTotals->freeResult(); \n }", "protected function _initTotals()\r\n {\r\n parent::_initTotals();\r\n\r\n $order = $this->getSource()->getOrder();\r\n $amount = $order->getCmpaymentsFeeAmount();\r\n $method = $order->getPayment()->getMethodInstance();\r\n\r\n $tax = $order->getCmpaymentsFeeTaxAmount();\r\n\r\n if ($amount && $amount > 0) {\r\n $label = ($method instanceof Comaxx_CmPayments_Model_Method_Abstract) ? $method->getPmName() . ' ' . $this->helper('cmpayments')\r\n ->__('payment fee') : 'Payment fee';\r\n\r\n $this->addTotalBefore(\r\n new Varien_Object(\r\n array(\r\n 'code' => 'cmpayments_payment_fee',\r\n 'value' => $amount,\r\n 'base_value' => $amount,\r\n 'label' => $label,\r\n ), array('tax')\r\n )\r\n );\r\n\r\n //update totals for creditmemo since Magento does not use order/invoice grand totals\r\n $creditmemo = $this->getCreditMemo();\r\n //set tax\r\n $creditmemo->setBaseTaxAmount($creditmemo->getBaseTaxAmount() + $tax);\r\n $creditmemo->setTaxAmount($creditmemo->getTaxAmount() + $tax);\r\n //set grand total\r\n $creditmemo->setBaseGrandTotal($creditmemo->getBaseGrandTotal() + $amount + $tax);\r\n $creditmemo->setGrandTotal($creditmemo->getGrandTotal() + $amount + $tax);\r\n\r\n //set creditmemo values on total overview\r\n $grandTotal = $this->getTotal('grand_total');\r\n $grandTotal->setBaseValue($creditmemo->getBaseGrandTotal());\r\n $grandTotal->setValue($creditmemo->getGrandTotal());\r\n }\r\n\r\n return $this;\r\n }", "public function initTotal()\n {\n // Return val.\n $temp = 0;\n // Add cone price.\n $temp += $this->coneType['price'];\n // Add all scoops of ice cream.\n foreach ($this->scoops as $scoop) {\n $temp += $scoop['price'];\n }\n // Return total item cost.\n return $temp;\n }", "public function get_totals() {\n\t\treturn empty( $this->totals ) ? $this->default_totals : $this->totals;\n\t}", "public static function getTotals()\n {\n $subTotal = self::getSubTotal();\n $taxes = StoreTax::getTaxes();\n $addedTaxTotal = 0;\n $includedTaxTotal = 0;\n $taxCalc = Config::get('vividstore.calculation');\n\n if ($taxes) {\n foreach ($taxes as $tax) {\n if ($taxCalc != 'extract') {\n $addedTaxTotal += $tax['taxamount'];\n } else {\n $includedTaxTotal += $tax['taxamount'];\n }\n }\n }\n\n $shippingTotal = self::getShippingTotal();\n \n $total = ($subTotal + $addedTaxTotal + $shippingTotal);\n \n return array('subTotal'=>$subTotal,'taxes'=>$taxes, 'taxTotal'=>$addedTaxTotal + $includedTaxTotal, 'shippingTotal'=>$shippingTotal, 'total'=>$total);\n }", "function get_totals(){\r\n $this_month = date('n', time()) - 1;\r\n\r\n $this->payments_this_month = $this->payment_totals_by_month[$this_month];\r\n\r\n $last_month = $this_month > 0 ? $this_month - 1 : false;\r\n if($last_month){\r\n $payments_last_month = $this->payment_totals_by_month[$last_month];\r\n\r\n if($payments_last_month > 0)\r\n $this->payments_this_month_change_percentage = (($this->payments_this_month/$payments_last_month) - 1) * 100;\r\n else $this->payments_this_month_change_percentage = 0;\r\n }\r\n }", "protected function mergeTotals() {\n $aOld = isset($this->aExistingOrder['Totals']) ? $this->aExistingOrder['Totals'] : array();\n $aNew = isset($this->aCurrentOrder['Totals']) ? $this->aCurrentOrder['Totals'] : array();\n foreach ($aNew as $iNewTotal => $aNewTotal) {\n foreach ($aOld as $iOldTotal => $aOldTotal) {\n if ($aOldTotal['Type'] == $aNewTotal['Type']) {\n $aOldTotal['Value']=isset($aOldTotal['Value'])?$aOldTotal['Value']:0;\n $aNewTotal['Value']=isset($aNewTotal['Value'])?$aNewTotal['Value']:0;\n if (method_exists($this, 'mergetotal'.$aNewTotal['Type'])) {\n $aNew[$iNewTotal] = $this->{'mergetotal'.$aNewTotal['Type']}($aOldTotal, $aNewTotal);\n } else {\n $aNew[$iNewTotal] = $this->mergeTotal($aOldTotal, $aNewTotal);\n }\n unset($aOld[$iOldTotal]);\n break;\n }\n }\n }\n foreach ($aOld as $aOldTotal) {\n $aNew[] = $aOldTotal;\n }\n return $aNew;\n }", "public function getTotalsForDisplay()\n {\n $amount = $this->getOrder()->formatPriceTxt($this->getAmount());\n if ($this->getAmountPrefix()) {\n $amount = $this->getAmountPrefix().$amount;\n }\n $title = $this->_getSalesHelper()->__($this->getTitle());\n if ($this->getTitleSourceField()) {\n $label = $title . ' (' . $this->getTitleDescription() . '):';\n } else {\n $label = $title . ':';\n }\n\n $fontSize = $this->getFontSize() ? $this->getFontSize() : 7;\n $total = array(\n 'amount' => $amount,\n 'label' => $label,\n 'font_size' => $fontSize\n );\n return array($total);\n }", "private function reset_totals() {\n\t\t\t$this->total = 0;\n\t\t\t$this->cart_contents_total = 0;\n\t\t\t$this->cart_contents_weight = 0;\n\t\t\t$this->cart_contents_count = 0;\n\t\t\t$this->cart_contents_tax = 0;\n\t\t\t$this->tax_total = 0;\n\t\t\t$this->shipping_tax_total = 0;\n\t\t\t$this->subtotal = 0;\n\t\t\t$this->subtotal_ex_tax = 0;\n\t\t\t$this->discount_total = 0;\n\t\t\t$this->discount_cart = 0;\n\t\t\t$this->shipping_total = 0;\n\t\t}", "protected function _initTotals() {\n parent::_initTotals();\n $order = $this->getOrder();\n $payment = $order->getPayment();\n $paymentMethodCode = $payment->getMethodInstance()->getCode();\n\n if (Mage::helper('ipgbase')->isIpagarePaymentMethod($paymentMethodCode)) {\n $amount = Mage::getModel($paymentMethodCode . '/discount')->getIpgDiscount($order);\n if (abs($amount) > 0) {\n $baseAmount = Mage::getModel($paymentMethodCode . '/discount')->getIpgBaseDiscount($order);\n $code = Mage::getModel($paymentMethodCode . '/discount')->getIpgDiscountCode();\n $this->addTotal(new Varien_Object(array(\n 'code' => $code,\n 'value' => $amount,\n 'base_value' => $baseAmount,\n 'label' => Mage::helper($paymentMethodCode)->__('Payment Discount'),\n )));\n }\n }\n return $this;\n }", "public function getMinOrderTotal();", "public function build_array($orders)\n {\n $this->load->model('accounts_model');\n\n if (count($orders) > 0) {\n $i = 0;\n $item_array = array();\n\n // Loop through each order.\n foreach ($orders as $order) {\n // Extract product hash/quantities.\n $items = explode(\":\", $order['items']);\n $j = 0;\n\n $price_b = 0.00000000;\n $price_l = 0.00000000;\n foreach ($items as $item) {\n // Load each item & quantity.\n $array = explode(\"-\", $item);\n $quantity = $array[1];\n\n if($order['progress'] == '0') {\n $item_info = $this->items_model->get($array[0], FALSE, FALSE);\n } else {\n if(isset($array[2]) AND isset($array[3]))\n $item_info = $this->items_model->get($array[0], FALSE, $array[2], $array[3]);\n else\n $item_info = $this->items_model->get($array[0], FALSE, FALSE);\n }\n\n // If the item no longer exists, display a message.\n if ($item_info == FALSE) {\n $message = \"Item \";\n $message .= (strtolower($this->current_user->user_role) == 'vendor') ? 'has been removed' : 'was removed, contact your vendor';\n $item_array[$j] = array('hash' => 'removed',\n 'name' => $message);\n } else {\n // Remove the vendor array, reduces the size of responses.\n unset($item_info['vendor']);\n $item_array[$j] = $item_info;\n }\n\n $item_array[$j++]['quantity'] = $quantity;\n }\n\n // Determine the progress message. Contains a status update\n // for the order, and lets the user progress to the next step.\n switch ($order['progress']) {\n case '0': // Buyer choses items. (1)\n $buyer_progress_message = 'Confirm your order to proceed.';\n $vendor_progress_message = '';\n // no vendor progress message\n break;\n case '1': // Vendor must chose escrow, or up-front. (2)\n $buyer_progress_message = 'Awaiting vendor response. <input type=\"submit\" class=\"btn btn-mini\" name=\"cancel[' . $order['id'] . ']\" value=\"Cancel\" /> ';\n $vendor_progress_message = \"Accept order to continue.\";\n break;\n case '2': // Buyer must pay to address. Escrow: 4. Upfront: 3.\n $buyer_progress_message = (($order['vendor_selected_escrow'] == '0') ? 'Early finalization requested. ' : 'Escrow Transaction: ') . 'Pay to address. ';\n $vendor_progress_message = 'Waiting for buyer to pay to the order address. <input type=\"submit\" class=\"btn btn-mini\" name=\"cancel[' . $order['id'] . ']\" value=\"Cancel\" /> ';\n break;\n case '3': // An up-front payment. Buyer signs first.\n $buyer_progress_message = (($order['vendor_selected_upfront'] == '1') ? 'Vendor requested up-front payment.' : '') . \" Please sign transaction. \";\n $vendor_progress_message = \"Waiting on buyer to sign. \";\n break;\n case '4': // Awaiting dispatch. Vendor must sign to indicate dispatch. (5)\n $buyer_progress_message = \"Awaiting Dispatch. \";\n $vendor_progress_message = \"Sign \" . (($order['vendor_selected_upfront'] == '1') ? ' & broadcast' : '') . \" the transaction to confirm the items dispatch. \";\n break;\n case '5': // Awaiting delivery. Escrow: buyer finalizes or disputes.\n // Upfront: buyer can dispute or mark received.\n $buyer_progress_message = 'Order dispatched. ' . (($order['vendor_selected_upfront'] == '1') ? 'Click to confirm receipt of the goods, or raise a dispute' : 'Sign & broadcast once received, or raise a dispute');\n $vendor_progress_message = 'Buyer awaiting delivery. ';\n break;\n case '6': // Disputed transaction.\n $buyer_progress_message = \"Disputed transaction. \";\n $vendor_progress_message = \"Disputed transaction. \";\n break;\n case '7':\n $buyer_progress_message = ($order['refund_time'] !== '') ? \"Payment refunded.\" : \"Purchase complete.\";\n $vendor_progress_message = ($order['refund_time'] !== '') ? \"Order refunded.\" : \"Order complete.\";\n break;\n case '8':\n $buyer_progress_message = \"Awaiting refund.\";\n $vendor_progress_message = \"Awaiting refund.\";\n }\n\n $currency = $this->bw_config->currencies[$order['currency']];\n\n // Work out what price to display for the current user.\n $order_price = ($this->current_user->user_role == 'Vendor') ? ($order['price'] + $order['shipping_costs'] - $order['extra_fees']) : ($order['price'] + $order['shipping_costs'] + $order['fees']);\n\n // Convert price to monero.\n $order_price = ($currency['id'] !== '0') ? $order_price / $this->bw_config->currencies[$order['currency']]['rate'] : number_format($order_price, 8);\n\n // Load the users local currency.\n // Convert the order's price into the users own currency.\n $price_l = ($order_price * $this->bw_config->exchange_rates[strtolower($this->current_user->currency['code'])]);\n $price_l = ($this->current_user->currency['id'] !== '0') ? number_format($price_l, 2) : number_format($price_l, 8);\n\n // Add extra details to the order.\n $tmp = $order;\n $tmp['vendor'] = $this->accounts_model->get(array('user_hash' => $order['vendor_hash']));\n $tmp['buyer'] = $this->accounts_model->get(array('id' => $order['buyer_id']));\n $tmp['public_keys'] = $this->load_public_keys($order['id']);\n $tmp['items'] = $item_array;\n $tmp['order_price'] = $order_price;\n $tmp['vendor_fees'] = $order['fees'] + $order['extra_fees'];\n $tmp['total_paid'] = number_format($order['price'] + $order['shipping_costs'] + $order['fees'], 8);\n $tmp['price_l'] = $price_l;\n $tmp['currency'] = $currency;\n $tmp['time_f'] = $this->general->format_time($order['time']);\n $tmp['partially_signed_time_f'] = $this->general->format_time($order['partially_signed_time']);\n $tmp['created_time_f'] = $this->general->format_time($order['created_time']); // 0\n $tmp['confirmed_time_f'] = $this->general->format_time($order['confirmed_time']); // 1\n $tmp['selected_payment_type_time'] = $this->general->format_time($order['selected_payment_type_time']); // 2\n $tmp['paid_time_f'] = $this->general->format_time($order['paid_time']); // 3\n $tmp['dispatched_time_f'] = $this->general->format_time($order['dispatched_time']); // 5\n $tmp['received_time_f'] = $this->general->format_time($order['received_time']); // 6\n $tmp['disputed_time_f'] = $this->general->format_time($order['disputed_time']); // 6\n $tmp['finalized_time_f'] = $this->general->format_time($order['dispatched_time']); // 7\n $tmp['progress_message'] = ($this->current_user->user_role == 'Vendor') ? $vendor_progress_message : $buyer_progress_message;\n\n $orders[$i++] = $tmp;\n unset($item_array);\n unset($tmp);\n }\n return $orders;\n\n } else {\n return FALSE;\n }\n }", "function getTotalsForDisplay()\n {\n $amount = $this->getSource()->formatPriceTxt($this->getAmount());\n\n if ($this->getAmountPrefix()) {\n $amount = $this->getAmountPrefix() . $amount;\n }\n\n $title = __($this->getTitle());\n if ($this->getTitleSourceField()) {\n $label = $title . ' (' . $this->getTitleDescription() . '):';\n } else {\n $label = $title . ':';\n }\n\n $fontSize = $this->getFontSize() ? $this->getFontSize() : 7;\n $total = ['amount' => $amount, 'label' => $label, 'font_size' => $fontSize];\n return [$total];\n }", "public function getTotal()\n {\n return $this->service()->getTotalOfOrder();\n }", "public function _apply()\n {\n $order = $this->_entity;\n $data = $order->getArrayCopy();\n\n $orderTotal = $data['grand_total'] - $data['shipping_total'];\n foreach (Order::getNonCashPaymentCodes() as $code) {\n $orderTotal += $data[$code];\n }\n\n return array('order_total'=> $orderTotal);\n }", "public function __construct() {\n\t\t$this->order = Array();\n\t\t$this->customer = Array();\n\t}", "public function calculateTotals()\n {\n $in = $this->_calculateTotalsIn();\n $out = $this->_calculateTotalsOut();\n $rating = $this->_calculateTotalsByRating();\n \n $result = array_merge($in, $out, $rating);\n $output = array();\n \n if (count($result)) {\n foreach ($result as $row) {\n $id = in_array($row['type'], array('MANUFACTURER', 'STOCK_STATUS', 'RATING')) ? '0' : $row['id'];\n $gid = strtolower(substr($row['type'], 0, 1)) . $id;\n if (!isset($output[$gid])) {\n $output[$gid] = array();\n }\n $output[$gid][$row['val']] = $row['c'];\n }\n }\n \n return $output;\n }", "private function getTotalsForDisplay()\n {\n\t\tif(\\Cart2Quote\\License\\Model\\License::getInstance()->isValid()) {\n\t\t\t$quote = $this->getQuote();\n $totals = [];\n $store = $this->getSource()->getStore();\n if ($this->_taxConfig->displaySalesTaxWithGrandTotal($store)) {\n return [];\n }\n $tax = 0;\n foreach ($quote->getAllVisibleItems() as $item) {\n $tax = $tax + $item->getTaxAmount();\n }\n //add shipping tax\n if ($quote->getShippingAddress()->getShippingTaxAmount()) {\n $tax = $tax + $quote->getShippingAddress()->getShippingTaxAmount();\n }\n if ($this->_taxConfig->displaySalesFullSummary($store)) {\n $totals = $this->getFullTaxInfo();\n }\n $tax = $quote->formatPriceTxt($tax);\n $totals = array_merge($totals, parent::getTotalsForDisplay());\n $totals[0]['amount'] = $tax;\n return $totals;\n\t\t}\n\t}", "protected function _initTotals()\n {\n parent::_initTotals();\n $amount = $this->getSource()->getAddCost();\n $createHelper = Mage::helper('addshippingcost/varienObjectCreate');\n if ($amount) {\n $this->addTotalBefore($createHelper->create($amount));\n }\n\n return $this;\n }", "private function setTotalAmounts()\n {\n $taxable\t= 0.00;\n $expenses = 0.00;\n $outlays\t= 0.00;\n\n foreach ($this->invoiceDetails as $invoiceDetail) {\n $amount = $invoiceDetail->getAmount();\n switch ($invoiceDetail->getType())\n {\n case 'incoming':\n $taxable += $amount;\n break;\n case 'expense':\n $taxable += $amount;\n $expenses += $amount;\n break;\n case 'outlay':\n $outlays += $amount;\n break;\n }\n }\n\n $this->setTotalTaxable($taxable);\n $this->setTotalExpenses($expenses);\n $this->setTotalOutlays($outlays);\n }", "public function __itemTotals() {\n\n //$this->request->data['items'] = array_values($this->request->data['items']);\n\n $itemsCount = isset($this->request->data['items']) ? count($this->request->data['items']) : 0;\n\n// pr($this->request->data['Item']);\n// die('asdas');\n\n\n\n for ($i = 0; $i < $itemsCount; $i++) {\n\n\n\n\n\n\n\n $this->request->data['items'][$i]['total'] = $this->__lineItemTotal($this->request->data['items'][$i]['qty'], $this->request->data['items'][$i]['price'], $this->request->data['items'][$i]['rate']);\n\n\n\n // collect unit name from unit model\n\n $unit = $this->Papers->Items->Units->find()\n ->where(['id'=>$this->request->data['items'][$i]['unit_id']])\n ->select(['name'])\n ->first()\n ->toArray();\n\n $this->request->data['items'][$i]['name'] = $unit['name'];\n }\n }", "abstract public function prepareTotalCount();", "protected function initialize()\n {\n $this->data = new stdClass();\n $this->data->ownId = null;\n $this->data->amount = new stdClass();\n $this->data->amount->currency = self::AMOUNT_CURRENCY;\n $this->data->amount->subtotals = new stdClass();\n $this->data->items = [];\n $this->data->receivers = [];\n }", "abstract protected function prepareTotalCount();", "static public function getEmptyUsageTypeTotals() {\n\t\treturn array(\n\t\t\t'usagev' => 0,\n\t\t\t'cost' => 0,\n\t\t\t'count' => 0,\n\t\t);\n\t}", "function buildOrder($orders) {\n\t$order = [\n\t\t\"service_uid\" => $orders[0][15],\n\t\t\"points\" => 0,\n\t\t\"invoice_number\" => $orders[0][2],\n\t\t\"purchase_detail\" => [],\n\t\t\"prices\" => [],\n\t\t\"branch_name\" => $orders[0][0],\n\t\t\"createtime\" => date('Y-m-d H:i:s')\n\t];\n\n\t$total = 0;\n\t$discount = 0;\n\tforeach ($orders as $o) {\n\t\t$order['purchase_detail'][] = [\n\t\t\t\"sku\" => $o[3],\n\t\t\t\"product_name\" => $o[4],\n\t\t\t\"category\" => [$o[5], $o[6]],\n\t\t\t\"quantity\" => (int) abs($o[16]),\n\t\t\t\"unit_price\" => (float) $o[17],\n\t\t\t\"variations\" => [\n\t\t\t\t['name' => 'Linea', 'value' => $o[5]],\n\t\t\t\t['name' => 'Color', 'value' => $o[10]],\n\t\t\t\t['name' => 'Talle', 'value' => $o[11]],\n\t\t\t]\n\t\t];\n\n\t\t$total += (int) abs($o[16]) * (float) $o[17];\n\t\t$discount += abs($o[19]);\n\t}\n\n\t$order['prices'] = [\n\t\t\"gross\" => $total,\n\t\t\"discount\" => $discount,\n\t\t\"total\" => $total - $discount\n\t];\n\n\treturn $order;\n}", "public function totalizarResultado($results)\r\n\t\t{\r\n\t\t\treturn $totalizado = [\r\n\t\t\t\t\t\t'monto' => array_sum(array_column($results, 'monto')),\r\n\t\t\t\t\t\t'recargo' => array_sum(array_column($results, 'recargo')),\r\n\t\t\t\t\t\t'interes' => array_sum(array_column($results, 'interes')),\r\n\t\t\t\t\t\t'descuento' => array_sum(array_column($results, 'descuento')),\r\n\t\t\t\t\t\t'monto_reconocimiento' => array_sum(array_column($results, 'monto_reconocimiento')),\r\n\t\t\t\t\t];\r\n\t\t}", "public function initTotals($items, Address $address)\n {\n $this->shippingDiscountAmount = 0;\n $this->baseShippingDiscountAmount = 0;\n $this->itemDiscountAmount = 0;\n $this->baseItemDiscountAmount = 0;\n\n $totalGiftCardBalance = $this->giftCardQuote->getTotalBalance($address->getQuote()->getQuoteCurrencyCode());\n $baseTotalGiftCardBalance = $this->giftCardQuote->getTotalBalance($address->getQuote()->getBaseCurrencyCode());\n\n $itemPrice = 0;\n $baseItemPrice = 0;\n $itemDiscountAmount = 0;\n $baseItemDiscountAmount = 0;\n $storeId = 0;\n\n foreach ($items as $item) {\n if ($item->getParentItem()) {\n continue;\n }\n\n $qty = $item->getTotalQty();\n $itemPrice += $this->getItemDiscountCalculationPrice($item) * $qty;\n $baseItemPrice += $this->getItemBaseDiscountCalculationPrice($item) * $qty;\n $itemDiscountAmount += $item->getDiscountAmount();\n $baseItemDiscountAmount += $item->getBaseDiscountAmount();\n $storeId = $item->getStoreId();\n }\n\n $shippingPrice = $this->getShippingDiscountCalculationPrice($address, $storeId);\n $baseShippingPrice = $this->getBaseShippingDiscountCalculationPrice($address, $storeId);\n\n $this->amount = new \\Magento\\Framework\\DataObject([\n 'total_gift_card_balance' => $totalGiftCardBalance,\n 'base_total_gift_card_balance' => $baseTotalGiftCardBalance,\n 'item_price_total' => $itemPrice,\n 'base_item_price_total' => $baseItemPrice,\n 'discount_total' => $itemDiscountAmount,\n 'base_discount_total' => $baseItemDiscountAmount,\n 'shipping_price' => $shippingPrice,\n 'base_shipping_price' => $baseShippingPrice,\n 'discount_shipping' => $address->getShippingDiscountAmount(),\n 'base_discount_shipping' => $address->getBaseShippingDiscountAmount(),\n ]);\n\n $totalCalculationAmount = $this->amount->getItemPriceTotal()+$this->amount->getShippingPrice();\n $baseTotalCalculationAmount = $this->amount->getBaseItemPriceTotal()+$this->amount->getBaseShippingPrice();\n\n $this->amount->setData('total_calculation_amount', $totalCalculationAmount);\n $this->amount->setData('base_total_calculation_amount', $baseTotalCalculationAmount);\n\n $balanceForItems = min($this->amount->getItemPriceTotal(), $this->amount->getTotalGiftCardBalance());\n $baseBalanceForItem = min($this->amount->getBaseItemPriceTotal(), $this->amount->getBaseTotalGiftCardBalance());\n\n $this->amount->setData('balance_for_item', $balanceForItems);\n $this->amount->setData('base_balance_for_item', $baseBalanceForItem);\n\n $this->amount->setData('balance_for_shipping', $this->amount->getTotalGiftCardBalance() - $balanceForItems);\n $this->amount->setData(\n 'base_balance_for_shipping',\n $this->amount->getBaseTotalGiftCardBalance() - $baseBalanceForItem\n );\n\n $discountRateForItem = 0;\n $baseDiscountRateForItem = 0;\n if ($this->amount->getItemPriceTotal() != 0) {\n $discountRateForItem = $this->amount->getBalanceForItem() / $this->amount->getItemPriceTotal();\n $baseDiscountRateForItem = $this->amount->getBaseBalanceForItem() / $this->amount->getBaseItemPriceTotal();\n }\n\n $this->amount->setData('discount_rate', $discountRateForItem);\n $this->amount->setData('base_discount_rate', $baseDiscountRateForItem);\n }", "public function getCurrentMonthTotalOrder() : int;", "function totals()\n\t{\n\t\treturn $this->_tour_voucher_contents['totals'];\n\t}", "function calculate_footers($data){\n\t\t$sumQty = 0.0;\n\t\t$sumSales = 0.0;\n\t\tforeach($data as $row){\n\t\t\t$sumQty += $row[3];\n\t\t\t$sumSales += $row[4];\n\t\t}\n\t\treturn array('Total',null,null,$sumQty,$sumSales);\n\t}", "public function initTotals()\n {\n $this->getParentBlock();\n $this->getCreditmemo();\n $this->getSource();\n\n if ((float)$this->getSource()->getUniqueAmount() == 0) {\n return $this;\n }\n\n $title = $this->_scopeConfig->getValue(\\Xtendable\\UniqueTotal\\Helper\\Data::CONFIG_TITLE, \\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE);\n\n $unique = new DataObject(\n [\n 'code' => \\Xtendable\\UniqueTotal\\Helper\\Data::TOTAL_CODE,\n 'strong' => false,\n 'value' => $this->getSource()->getUniqueAmount(),\n 'label' => __($title),\n ]\n );\n\n $this->getParentBlock()->addTotalBefore($unique, 'grand_total');\n\n return $this;\n }", "public function woocommerce_reports_coupons_overview_totals($orders) {\n\t}", "public function initTotals($items, Address $address)\n {\n $address->setCartFixedRules([]);\n\n $objectManager = \\Magento\\Framework\\App\\ObjectManager::getInstance();\n $objectManager->get('Psr\\Log\\LoggerInterface')->addDebug('INIT TOTALS'); \n $objectManager->get('Psr\\Log\\LoggerInterface')->addDebug($address->getQuote()->getId()); \n $objectManager->get('Orange\\Coupon\\Model\\QuoteCoupon')->clearQuoteDiscountData($address->getQuote()->getId()); //Clear individual coupon discount\n\n\n if (!$items) {\n return $this;\n }\n\n /** @var \\Magento\\SalesRule\\Model\\Rule $rule */\n foreach ($this->_getRules($address) as $rule) {\n if (\\Magento\\SalesRule\\Model\\Rule::CART_FIXED_ACTION == $rule->getSimpleAction()\n && $this->validatorUtility->canProcessRule($rule, $address)\n ) {\n $ruleTotalItemsPrice = 0;\n $ruleTotalBaseItemsPrice = 0;\n $validItemsCount = 0;\n\n foreach ($items as $item) {\n //Skipping child items to avoid double calculations\n if ($item->getParentItemId()) {\n continue;\n }\n if (!$rule->getActions()->validate($item)) {\n continue;\n }\n if (!$this->canApplyDiscount($item)) {\n continue;\n }\n $qty = $this->validatorUtility->getItemQty($item, $rule);\n $ruleTotalItemsPrice += $this->getItemPrice($item) * $qty;\n $ruleTotalBaseItemsPrice += $this->getItemBasePrice($item) * $qty;\n $validItemsCount++;\n }\n\n $this->_rulesItemTotals[$rule->getId()] = [\n 'items_price' => $ruleTotalItemsPrice,\n 'base_items_price' => $ruleTotalBaseItemsPrice,\n 'items_count' => $validItemsCount,\n ];\n }\n }\n\n return $this;\n }", "public function initTotals()\n {\n $amount = $this->getParentBlock()->getSource()->getAddCost();\n $createHelper = Mage::helper('addshippingcost/varienObjectCreate');\n if ($amount) {\n $this->getParentBlock()->addTotalBefore($createHelper->create($amount));\n }\n\n return $this;\n }", "private function setTotalFromData()\n {\n if ($this->dataHasTotal()) {\n $this->collection->items[$this->cart_hash]->total = $this->data['total'];\n $this->collection->increaseTotal($this->data['total']);\n }\n }", "protected function _initTotals() {\n parent::_initTotals();\n $this->removeTotal('base_grandtotal');\n \n if ((float) $this->getSource()->getAdjustmentPositive()) {\n $total = new Varien_Object(array(\n 'code' => 'adjustment_positive',\n 'value' => $this->getSource()->getAdjustmentPositive(),\n 'label' => $this->__('Adjustment Refund')\n ));\n $this->addTotal($total);\n }\n \n if ((float) $this->getSource()->getAdjustmentNegative()) {\n $total = new Varien_Object(array(\n 'code' => 'adjustment_negative',\n 'value' => $this->getSource()->getAdjustmentNegative(),\n 'label' => $this->__('Adjustment Fee')\n ));\n $this->addTotal($total);\n }\n\n return $this;\n }", "public function __construct($order=null)\n {\n $this->data = $order;\n }", "public function set_totals( $value = array() ) {\n\t\t$this->totals = wp_parse_args( $value, $this->default_totals );\n\t}", "public function __construct() {\n\t\t$this->setTitle('Total');\n\t\t$this->setDescription('Order Total');\n\n\t\t$this->init('total');\n\t}", "public function buildTotals(InvoiceInterface $invoice);", "protected function getTotalOrders()\n {\n\n if (auth()->user()) {\n $userId = auth()->user()->id;\n return \\Cart::session($userId)->getTotal();\n }\n return \\Cart::getTotal();\n }", "public function getTotal(){\n $total=0;\n\n foreach ( $this->getOrderLines() as $ol){\n $total += $ol->getSubTotal();\n }\n \n return $total;\n }", "public function getCartInfo () {\n\n $data = array(\n 'itemsCount' => 0,\n 'total' => 0\n );\n\n $order = $this->getOrder();\n\n if ( !$order ) {\n return $data;\n }\n\n $data['itemsCount'] = count( $order->getItems() );\n $data['total'] = $order->getTotal();\n\n return $data;\n }", "public function getTotal();", "public function getTotal();", "private function clearTotals()\n {\n $this->totalAmount = 0;\n $this->frequentRenterPoints = 0;\n }", "public function getBaseTotalQtyOrdered();", "public function totals()\n {\n return $this->get(self::BASE_PATH.'/totals');\n }", "function genTotalRow(){\n\t\t//set our row to be the size of the first row, each cell set to 0\n\t\t$row = array();\n\t\t$row = array_pad($row, sizeof($this->table[0]), 0);\n\n\t\t//sum up the number of users per column\n\t\tforeach ($this->table as $rows) {\n\t\t\tforeach ($rows as $index => $cell) {\n\t\t\t\tif($cell == '&#x2713') \t{\n\t\t\t\t\t$row[$index]=$row[$index]+1;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$row[0] = 'Total';\n\t\treturn $row;\n\t}", "public function __construct() {\n\n\t\t$this->contenuto=array();\n\t\t$this->quantita=array();\n }", "public function calculate_totals() {\n\t\t$this->reset_totals();\n\n\t\tif ( $this->is_empty() ) {\n\t\t\t$this->session->set_session();\n\t\t\treturn;\n\t\t}\n\n\t\tdo_action( 'woocommerce_before_calculate_totals', $this );\n\n\t\tnew WC_Cart_Totals( $this );\n\n\t\tdo_action( 'woocommerce_after_calculate_totals', $this );\n\t}", "public function costInstallments(){\n\n\n for($x = 1; $x<=12; $x++){\n\n if($x == 1){\n $cost[$x] = 0;\n }\n $cost[$x] = Mage::getStoreConfig(self::XPATH_CONFIG_INSTALMENT_COST.$x);\n }\n\n\n return $cost;\n }", "public function getOrdertotal()\n {\n return $this->ordertotal;\n }", "public function calcTotal()\n {\n\n $productBusinessService = new ProductBusinessService();\n\n // create an array to hold all subtotals\n $subtotals_array = array();\n $this->total_price = 0;\n\n foreach ($this->items as $item => $qty) {\n\n // get the price of the product from the database\n $product = $productBusinessService->getProductByID($item);\n\n // calculate the total (price * quantity)\n $product_subtotal = $product->getPrice() * $qty;\n\n // add that subtotal to the subtotal array\n $subtotals_array = $subtotals_array + array($item => $product_subtotal);\n\n // add the item subtotal to the cart total\n $this->total_price += $product_subtotal;\n }\n\n // set the subtotals array\n $this->subtotals = $subtotals_array;\n }", "function line_demand_total($line_orders) {\n $line_demand_total = array_reduce(\n $line_orders,\n function ($sum, $line) {\n return $sum + intval($line[QUANTITY]);\n },\n 0);\n return $line_demand_total;\n}", "public function get_total_items(){\n\t \t$total = 0;\n\t \t//Si no esta vacio va sumando la cantidad de articulos\n\t \tif(!empty($this->cart)){\n\t \t\tforeach ($this->cart as $linea){\n\t\t\t\t\t$total += $linea['amount'];\n\t\t\t\t}\n\t \t}\n\t \techo $total;\n\t }", "function GetTotalNoFromCart(){\n $info_arr = array();\n $gtotalno = \"SELECT * FROM tblcart a\n left join tblproducts b on a.c_productid = b.pr_id\n\t\t\t\t\tWHERE a.c_userid = '$this->c_userid'\";\n $rgtotalno = mysqli_query($this->Connect(), $gtotalno);\n $totalorder = mysqli_num_rows($rgtotalno);\n $info['totalorder'] = $totalorder;\n while ($rrgtotalno = mysqli_fetch_assoc($rgtotalno)){\n $qty = $rrgtotalno['c_qty'];\n $price = $rrgtotalno['pr_price'];\n $total = $qty * $price;\n $ttotal[] = $total; \n $info['totalamount'] = array_sum($ttotal);\n \n array_push($info_arr, $info);\n }\n \n \n echo json_encode($info_arr);\n }", "function appendEmptyRows($totals, $amount)\n {\n for ($i = 0; $amount > $i; $i++) {\n $totals[] = [\n 'amount' => '',\n 'label' => '',\n 'font_size' => '',\n ];\n }\n return $totals;\n }", "public function init()\n {\n $ar = array();\n for ($i = 0; $i < 20; $i++)\n {\n $ar[] = $i;\n }\n }", "protected function _construct()\n {\n $this->_init('tiny_compressimages/totals', 'entity_id');\n }", "private function initTotals() {\n global $wpdb;\n $tableUrls = Factory::databaseService()->getDbTableUrlsName();\n\n $today = $this->getToday();\n\n // Total URLs in the queue\n $queryTotalUrlsInQueue = \"SELECT COUNT(*) FROM {$tableUrls}\n WHERE saved_post_id IS NULL\n AND saved_at IS NULL\n AND recrawled_at IS NULL\n AND is_locked = FALSE\n AND is_saved = FALSE\";\n $this->totalUrlsInQueue = $wpdb->get_var($queryTotalUrlsInQueue);\n $this->totalUrlsInQueueAddedToday = $wpdb->get_var($queryTotalUrlsInQueue . \" AND created_at >= '{$today}'\");\n\n // Total saved posts\n $queryTotalSavedPosts = \"SELECT COUNT(*) FROM {$tableUrls}\n WHERE saved_post_id IS NOT NULL\n AND saved_at IS NOT NULL\n AND is_locked = FALSE\n AND is_saved = TRUE\";\n $this->totalSavedPosts = $wpdb->get_var($queryTotalSavedPosts);\n $this->totalSavedPostsToday = $wpdb->get_var($queryTotalSavedPosts . \" AND saved_at >= '{$today}'\");\n\n // Total recrawled posts\n $queryTotalRecrawledPosts = \"SELECT COUNT(*) FROM {$tableUrls}\n WHERE saved_post_id IS NOT NULL\n AND saved_at IS NOT NULL\n AND recrawled_at IS NOT NULL\n AND update_count > 0\n AND is_locked = FALSE\n AND is_saved = TRUE\";\n $this->totalRecrawledPosts = $wpdb->get_var($queryTotalRecrawledPosts);\n $this->totalRecrawledPostsToday = $wpdb->get_var($queryTotalRecrawledPosts . \" AND recrawled_at >= '{$today}'\");\n\n // Total recrawl count\n $queryTotalRecrawlCount = \"SELECT SUM(update_count) FROM {$tableUrls}\n WHERE update_count > 0\";\n $this->totalRecrawlCount = $wpdb->get_var($queryTotalRecrawlCount);\n\n // Total deleted posts\n $queryTotalDeletedPosts = \"SELECT COUNT(*) FROM {$tableUrls}\n WHERE saved_post_id IS NULL\n AND saved_at IS NOT NULL\n AND is_locked = FALSE\n AND is_saved = TRUE\n AND deleted_at IS NOT NULL\";\n $this->totalDeletedPosts = $wpdb->get_var($queryTotalDeletedPosts);\n $this->totalDeletedPostsToday = $wpdb->get_var($queryTotalDeletedPosts . \" AND deleted_at >= '{$today}'\");\n }", "public function total()\n {\n if ($this->_isCartArray($this->cart()) === TRUE)\n {\n $price = 0;\n $vat = 0;\n foreach ($this->cart() as $key)\n {\n $item_price = ($key['price'] * $key['qty']);\n $item_vat = (($item_price/100)*$key['vat']);\n // $price =+ ($price + ($key['price'] * $key['qty']));\n $price += $item_price;\n $vat += $item_vat;\n }\n\n // $params = $this->_config['vat'];\n // $vat = $this->_formatNumber((($price / 100) * $params));\n\n return array(\n 'sub-total' => $this->_formatNumber($price),\n 'vat' \t\t=> $this->_formatNumber($vat),\n 'total' \t=> $this->_formatNumber($price + $vat)\n );\n }\n }", "public static function getTotalOrder($filter = array())\n {\n \t$storage = My_Zend_Globals::getStorage();\n \t \n \t$table = self::_TABLE_PRODUCT_ORDERS;\n \t \n \t//Query data from database\n \t$select = $storage->select()\n \t\t->from($table,'count(order_id) as total');\n \t\n \tif(isset($filter['buyer_id']) && !empty($filter['buyer_id']) && $filter['buyer_id'] != 'adm'){\n \t\t$select->where('buyer_id = ?', $filter['buyer_id']);\n \t} \n \t\n \tif(isset($filter['order_status']) && $filter['order_status'] != 'all'){\n \t\t$select->where('order_status = ?', $filter['order_status']);\n \t}\n \t\n \tif(isset($filter['order_code']) && !empty($filter['order_code'])){\n \t\t$select->where('order_code = ?', $filter['order_code']);\n \t}\n \t\n \tif(isset($filter['order_phone']) && !empty($filter['order_phone'])){\n \t\t$select->where('order_phone = ?', $filter['order_phone']);\n \t}\n \t\n \tif(isset($filter['order_name']) && !empty($filter['order_name'])){\n \t\t$select->where('order_first_name like \"%'. $filter['order_name'].'%\" OR order_m_i like \"%'. $filter['order_name'].'%\" OR order_last_name like \"%'. $filter['order_name'].'%\" ');\n \t}\n \t\n \tif(isset($filter['order_address']) && !empty($filter['order_address'])){\n \t\t$select->where('order_address_1 like \"%'. $filter['order_address'].'%\" OR order_address_2 like \"%'. $filter['order_address'].'%\"');\n \t}\n\n \t$data = $storage->fetchRow($select);\n \n \treturn $data['total'];\n }", "public static function initProductOrders($data)\n { \n $fields = array('order_id', 'buyer_id', 'order_name', 'order_phone', 'order_email', 'order_city', 'order_district', 'order_note', 'order_status',\n \t\t\t\t'order_address', 'payment_type', 'created_date', 'updated_date', 'order_code', 'amount_total', 'shipping_cost');\n\t\t\n $rs = array();\n \n foreach($fields as $field)\n {\n if(isset($data[$field]))\n {\n $rs[$field] = $data[$field];\n }\n }\n \n return $rs;\n }", "function getTotals(){\n\t\treturn $this->cache->getTotals();\n\t}", "public function init() \n {\n foreach ($this->orders_to_update as $order_id) {\n $this->handle_main($order_id);\n }\n }", "public function getTotalQtyOrdered();", "public function __construct()\n {\n $this->paymentLines = [];\n }", "public function setOrderSubtotals($data, $order)\n {\n $couponAmount = $this->_getMultiCardValue($data, 'coupon_amount');\n $transactionAmount = $this->_getMultiCardValue($data, 'transaction_amount');\n \n if (isset($data['total_paid_amount'])) {\n $paidAmount = $this->_getMultiCardValue($data, 'total_paid_amount');\n } else {\n $paidAmount = $data['transaction_details']['total_paid_amount'];\n }\n\n $shippingCost = $this->_getMultiCardValue($data, 'shipping_cost');\n $originalAmount = $transactionAmount + $shippingCost;\n\n if ($couponAmount\n && $this->_scopeConfig->isSetFlag(self::XML_PATH_CONSIDER_DISCOUNT,\\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE)) {\n $order->setDiscountCouponAmount($couponAmount * -1);\n $order->setBaseDiscountCouponAmount($couponAmount * -1);\n $financingCost = $paidAmount + $couponAmount - $originalAmount;\n } else {\n //if a discount was applied and should not be considered\n $paidAmount += $couponAmount;\n $financingCost = $paidAmount - $originalAmount;\n }\n\n if ($shippingCost > 0) {\n $order->setBaseShippingAmount($shippingCost);\n $order->setShippingAmount($shippingCost);\n }\n\n\n if (\\Zend_Locale_Math::round($financingCost, 4) > 0) {\n $order->setFinanceCostAmount($financingCost);\n $order->setBaseFinanceCostAmount($financingCost);\n }\n\n $order->save();\n }", "protected function getOrders()\n {\n \\Rakuten\\Connector\\Resources\\Log\\Logger::info('Processing initialize in getOrders in Batch.');\n $resource = Mage::getSingleton('core/resource');\n $write = $resource->getConnection('core_write');\n $order = $resource->getTableName('sales/order');\n $rakutenOrder = $resource->getTableName('rakuten_rakutenlogistics/order');\n $payment = $resource->getTableName('sales/order_payment');\n\n $select = $write->select()\n ->from(['order' => $order], ['entity_id', 'increment_id', 'customer_firstname', 'customer_lastname', 'state', 'created_at'])\n ->join(['payment' => $payment], 'order.entity_id = payment.entity_id', ['additional_information'])\n ->join(['rakutenOrder' => $rakutenOrder], 'order.entity_id = rakutenOrder.order_id', ['calculation_code', 'order_id'])\n ->where('DATEDIFF(NOW(), order.created_at) <= ?', $this->days)\n ->where('order.state = ?', Mage_Sales_Model_Order::STATE_PROCESSING);\n\n $data = $write->fetchAll($select);\n foreach ($data as $key => $item) {\n if (!$item['calculation_code']) {\n continue;\n }\n if (!$this->hasBatchCode($item['additional_information'])) {\n $this->orders[$key]['orderId'] = $item['order_id'];\n $this->orders[$key]['incrementId'] = $item['increment_id'];\n $this->orders[$key]['status'] = $item['state'];\n $this->orders[$key]['billingName'] = $item['customer_firstname'] . ' ' . $item['customer_lastname'];\n $createdAt = new \\DateTime($item['created_at']);\n $this->orders[$key]['createdAt'] = $createdAt->format('d/m/Y H:m:s');\n $this->orders[$key]['calculationCode'] = $item['calculation_code'];\n }\n }\n if (count($this->orders)) {\n $this->orders = array_values($this->orders);\n }\n }", "function calculate()\n {\n $this->first_period = $this->second_period = $this->rebill_times = null;\n foreach ($this->getCalculators() as $calc)\n $calc->calculate($this);\n // now summarize all items to invoice totals\n $priceFields = array(\n 'first_subtotal' => null,\n 'first_discount' => 'first_discount',\n 'first_tax' => 'first_tax',\n 'first_shipping' => 'first_shipping',\n 'first_total' => 'first_total',\n 'second_subtotal' => null,\n 'second_discount' => 'second_discount',\n 'second_tax' => 'second_tax',\n 'second_shipping' => 'second_shipping',\n 'second_total' => 'second_total',\n );\n foreach ($priceFields as $k => $kk)\n $this->$k = 0.0;\n foreach ($this->getItems() as $item) {\n $this->first_subtotal += moneyRound($item->first_price * $item->qty);\n $this->second_subtotal += moneyRound($item->second_price * $item->qty);\n foreach ($priceFields as $k => $kk)\n $this->$k += $kk ? $item->$kk : 0;\n }\n foreach ($priceFields as $k => $kk)\n $this->$k = moneyRound($this->$k);\n /// set periods, it has been checked for compatibility in @see add()\n $mostExpensiveItem = null;\n foreach ($this->getItems() as $item) {\n if (!$mostExpensiveItem || $item->first_price > $mostExpensiveItem->first_price) {\n $mostExpensiveItem = $item;\n }\n $this->currency = $item->currency;\n if (empty($this->first_period) && $item->rebill_times)\n $this->first_period = $item->first_period;\n if (empty($this->second_period))\n $this->second_period = $item->second_period;\n if (empty($this->rebill_times))\n $this->rebill_times = $item->rebill_times;\n $this->rebill_times = max($this->rebill_times, $item->rebill_times);\n }\n\n // First period is empty, invoice has only one time items,\n // set first period from most expensive item.\n if (empty($this->first_period) && $mostExpensiveItem) {\n $this->first_period = $mostExpensiveItem->first_period;\n }\n\n if ($this->currency == Am_Currency::getDefault())\n $this->base_currency_multi = 1.0;\n else {\n $this->base_currency_multi = $this->getDi()->currencyExchangeTable->getRate($this->currency,\n sqlDate(!empty($this->tm_added) ? $this->tm_added : $this->getDi()->sqlDateTime));\n if (!$this->base_currency_multi)\n $this->base_currency_multi = 1;\n }\n $this->getDi()->hook->call(Am_Event::INVOICE_CALCULATE, array('invoice' => $this));\n\n $this->terms = null;\n if ((count($this->getItems()) == 1) &&\n ($item = $this->getItem(0)) &&\n ($item->item_type == 'product') &&\n ($pr = $item->tryLoadProduct()) &&\n ($bp = $pr->getBillingPlan()) &&\n $bp->terms) {\n\n if (((float)$bp->first_price == (float)$this->first_total) &&\n ($bp->first_period == $this->first_period) &&\n ((float)$bp->second_price == (float)$this->second_total) &&\n ($bp->second_period == $this->second_period) &&\n ($bp->rebill_times == $this->rebill_times)\n ) {\n $this->terms = $bp->terms;\n }\n }\n\n $this->terms = $this->getDi()->hook->filter($this->terms,\n Am_Event::INVOICE_TERMS, array('invoice' => $this));\n\n return $this;\n }", "public function calculateOrderTotal($items)\n {\n $total = 0;\n foreach ($items as $key => $item) {\n $total += $item['quoted_price'];\n }\n return $total;\n }", "public function getTotalsForDisplay()\n {\n $vouchers = $this->getVouchers();\n if (empty($vouchers)) {\n return array();\n }\n\n $fontSize = $this->getFontSize() ? $this->getFontSize() : 7;\n\n $total = array();\n foreach ($vouchers as $voucher) {\n $salePriceInclVat = $voucher['emag_sale_price'] + $voucher['emag_sale_price_vat'];\n\n $total[] = array(\n 'label' => $voucher['emag_voucher_name'] . ':',\n 'amount' => $this->getOrder()->formatPriceTxt($salePriceInclVat),\n 'font_size' => $fontSize,\n );\n }\n\n return $total;\n }", "function populate_service_count()\n{\n $service_count = array(\n array(\"value\" => \"10\", \"count\" => \"10 Acceptances\"),\n );\n\n return $service_count;\n}", "public function addOrderItemsCount()\r\n {\r\n $itemTable = $this->_helper()->getSql()->getTable('sales_flat_order_item');\r\n if ($this->_helper()->checkSalesVersion('1.4.0.0')) {\r\n $this->getSelect()\r\n ->join(array('item' => $itemTable), \"(item.order_id = main_table.entity_id AND item.parent_item_id IS NULL)\",\r\n array(\r\n 'sum_qty' => 'SUM(item.qty_ordered)',\r\n 'sum_total' => 'SUM(item.base_row_total)',\r\n ))\r\n ->where(\"main_table.entity_id = item.order_id\");\r\n } else {\r\n $this->getSelect()\r\n ->join(array('item' => $itemTable), \"(item.order_id = e.entity_id AND item.parent_item_id IS NULL)\",\r\n array(\r\n 'sum_qty' => 'SUM(item.qty_ordered)',\r\n 'sum_total' => 'SUM(item.base_row_total)',\r\n ))\r\n ->where(\"e.entity_id = item.order_id\");\r\n }\r\n return $this;\r\n }", "function getEmptyMemberOrder()\n\t\t{\n\n\t\t\t//defaults\n\t\t\t$order = new stdClass();\n\t\t\t$order->code = $this->getRandomCode();\n\t\t\t$order->user_id = \"\";\n\t\t\t$order->membership_id = \"\";\n\t\t\t$order->subtotal = \"\";\n\t\t\t$order->tax = \"\";\n\t\t\t$order->couponamount = \"\";\n\t\t\t$order->total = \"\";\n\t\t\t$order->payment_type = \"\";\n\t\t\t$order->cardtype = \"\";\n\t\t\t$order->accountnumber = \"\";\n\t\t\t$order->expirationmonth = \"\";\n\t\t\t$order->expirationyear = \"\";\n\t\t\t$order->status = \"success\";\n\t\t\t$order->gateway = pmpro_getOption(\"gateway\");\n\t\t\t$order->gateway_environment = pmpro_getOption(\"gateway_environment\");\n\t\t\t$order->payment_transaction_id = \"\";\n\t\t\t$order->subscription_transaction_id = \"\";\n\t\t\t$order->affiliate_id = \"\";\n\t\t\t$order->affiliate_subid = \"\";\n\t\t\t$order->notes = \"\";\n\t\t\t$order->checkout_id = 0;\n\n\t\t\t$order->billing = new stdClass();\n\t\t\t$order->billing->name = \"\";\n\t\t\t$order->billing->street = \"\";\n\t\t\t$order->billing->city = \"\";\n\t\t\t$order->billing->state = \"\";\n\t\t\t$order->billing->zip = \"\";\n\t\t\t$order->billing->country = \"\";\n\t\t\t$order->billing->phone = \"\";\n\n\t\t\treturn $order;\n\t\t}", "public function __construct($order)\n {\n $this->order = $order;\n }", "public function __construct($order)\n {\n $this->order = $order;\n }", "public function __construct($order)\n {\n $this->order = $order;\n }", "public function __construct($order)\n {\n $this->order = $order;\n }", "public function __construct($order)\n {\n $this->order = $order;\n }", "public function __construct($order)\n {\n $this->order = $order;\n }", "public function __construct($order)\n {\n $this->order = $order;\n }", "public function __construct($order)\n {\n $this->order = $order;\n }", "public function get_total()\n {\n }" ]
[ "0.6554651", "0.6489388", "0.63995427", "0.63802254", "0.6350262", "0.6296655", "0.6252847", "0.61389756", "0.60633314", "0.6062092", "0.6048365", "0.6004119", "0.6001629", "0.5983357", "0.5977507", "0.58738816", "0.58666897", "0.58603585", "0.5858779", "0.58501863", "0.5806733", "0.58050257", "0.57940686", "0.57506526", "0.5732549", "0.572224", "0.56594056", "0.5648449", "0.564106", "0.56331235", "0.56215614", "0.56092536", "0.5602857", "0.5583214", "0.55780977", "0.55641586", "0.556384", "0.5559854", "0.55559164", "0.554676", "0.5513541", "0.5498815", "0.54777575", "0.545596", "0.545203", "0.54505134", "0.54461855", "0.5442882", "0.5441941", "0.5433788", "0.5421861", "0.53754145", "0.53521746", "0.53352755", "0.53308845", "0.53244007", "0.53169745", "0.5313284", "0.5309115", "0.5309115", "0.53049237", "0.52651334", "0.5260638", "0.5258535", "0.5248227", "0.5243328", "0.5240092", "0.5227143", "0.5216382", "0.5211392", "0.5208858", "0.5198462", "0.51863205", "0.51810515", "0.51780236", "0.5166479", "0.5163865", "0.51497996", "0.51440763", "0.51365954", "0.5114651", "0.5114379", "0.5109872", "0.51076686", "0.5096207", "0.50960666", "0.50949585", "0.508575", "0.5084965", "0.5073374", "0.5069271", "0.5064576", "0.5064576", "0.5064576", "0.5064576", "0.5064576", "0.5064576", "0.5064576", "0.5064576", "0.50586504" ]
0.5588149
33
function GenArray($mode = NULL, $params = NULL)
function GenArray($params = []) { if ($this->templateName == "admin_desktop"){ if (!isset($params[1])){ $mode = "users"; } else { $mode = $params[1]; } if ($mode === "qq_categories"){ $result = $this->genArrayCategories(); }elseif ($mode === "users"){ $result = $this->genArrayUsers(); }elseif ($mode === "qq"){ $currentCategoryId = $params[2]; $result = $this->genArrayQQ($currentCategoryId); }elseif ($mode === "qq_without_answer"){ $result = $this->genArrayQQWitoutAnswer(); }elseif ($mode === "answers"){ $currentQuestionId = $params[2]; $result = $this->genArrayAnswers($currentQuestionId); } } return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function maker(): array;", "public function generate(): array;", "function getArray();", "abstract public function getArray();", "public function aArray() {}", "public function build(): array;", "public function build(): array;", "public function getArrayParameters(): array;", "function InicializaArray($Limite){\n\t\tfor($i = 1; $i <= $Limite; $i++) \n\t\t{ \n\t\t ${'array'}[$i] = 0; \n\t\t} \n\treturn $array;\n}", "function aarr(&$R,$nn,$n,$m=\"\")\n\t\t{\n\t\treturn $this->Zarr($R,\"int8\",$n,$m);\t\t\t\n\t\t}", "public static function arrayWithObjects()\n {\n return new RsoArray(func_get_args());\n }", "public function generateArray()\r\n\t{\t\r\n\t\t$data = array('logID'=>$this->logID,'text'=>$this->Text,'timestamp'=>$this->timestamp, 'textid'=>$this->textID);\r\n\t\tif($this->user!=null)\r\n\t\t\t$data['user'] = $this->user->generateArray();\r\n\t\tif($this->building!=null)\r\n\t\t\t$data['building'] = $this->building->generateArray('normal');\r\n\t\tif($this->card!=null)\r\n\t\t\t$data['card']=$this->card->generateArray();\r\n\t\tif($this->location!=null)\r\n\t\t\t$data['location']=$this->location->generateArray();\r\n\t\tif($this->icon!=null)\r\n\t\t\t$data['icon']=$this->icon;\r\n\t\tif($this->game!=null)\r\n\t\t\t$data['game']=$this->game;\r\n\t\treturn $data;\r\n\t\r\n\t}", "function crearArray($ind1,$ind2,$val1,$val2,$n=5){\n\t\t$v=array();\n\t\t//Primero construyo el array\n\t\tfor($i=0;count($v)<$n;$i++){\n\t\t\t//Un random para el indice y otro para el valor contenido\n\t\t\t$indice=\"X\".rand($ind1,$ind2);//calcular un numero aleatorio entre ind1 y ind2\n\t\t\t$valor=rand($val1,$val2);\n\t\t\t$v[$indice]=$valor;\n\t\t}\n\t\t//Ahora que ya esta construido puede consultarla\n\t\t/*Se pueden devolver dos valores en el return?*/\n\t\tglobal $max; //La variable tiene que ser global\n\t\t$max=max($v); //El maximo del array\n\treturn $v; //Devuelve el array\n\t}", "function GenerateData(){\r\n\t\r\n\t$data = array();\r\n\r\n\tfor($i=0; $i<10000; $i++){\r\n\r\n\t\t$data[$i] = array(rand(0,6),rand(0,4),rand(0,4),rand(0,6),rand(0,3));\r\n \r\n\t}\r\n\r\nreturn $data;\t\r\n\t\r\n}", "public function params(): array;", "public function creataTypeArray()\n\t{\n\t\t$this->db->creataTypeArray();\n\t}", "function dynamicArray($n, $queries) {\n\n}", "public function AsArray();", "public function getArray($create = false) {}", "public function getArray($create = false) {}", "public function getParams() :array;", "function make()\n{\n return [];\n}", "abstract public function definition(): array;", "private function _paramArrGenerator( $funcParam, $args )\n\t{\n\t\t$paramArray = array();\n\n\t\tforeach ($funcParam as $key => $value) \n\t\t{\n\t\t\tif( isset( $args[ $value ] ) )\n\t\t\t\t$paramArray[] = $args[ $value ];\n\t\t}\n\n\t\treturn $paramArray;\n\t}", "abstract public function values(): array;", "protected function buildJSAbbreviationArray() {}", "public function parameters(): array;", "function createLibClassArray(){\n return array(\n \"MA2090\",\n \"ED3700\",\n \"ML4220\",\n \"EL1000\",\n \"VA2010\",\n \"PY2010\",\n \"HI2681\",\n \"BS2400\",\n \"BS2401\",\n \"MA2310\",\n \"ED3820\",\n \"ML1100\",\n \"EL2206\",\n \"VA2020\",\n \"PY3410\",\n \"AS2112\",\n \"CP2220\",\n \"CP2221\",\n \"CS2511\",\n \"ED3950\",\n \"ML1101\",\n \"EL4312\",\n \"VA2030\",\n \"PY3420\",\n \"HI3091\",\n \"BS2410\",\n \"BS2411\",\n \"CS2511\",\n \"EL3865\",\n \"VA3100\",\n \"HI2810\",\n \"HI3002\",\n \"HI3011\",\n \"HI3021\"\n );\n }", "public abstract function FetchArray();", "function C() {\n $arr = func_get_args();\n return Carr($arr);\n }", "public function generate() {\n\t\treturn [];\n\t}", "function acf_array($val = array())\n{\n}", "function getArray() {\n\treturn array('Red', 'Green', 'Blue');\n}", "private function generateArray() : array\n {\n $chromosome = [];\n\n for ($i = 0; $i < Settings::CHROMOSOME_SIZE; $i++) {\n $chromosome[$i] = $this->genes[$this->getRandomPosition()];\n }\n\n return $chromosome;\n }", "public function DataGenerateArray() {\n $data = $this->GenerateArray();\n return $data['data']; \n }", "function generate() ;", "function getParameters(): array;", "function buildArrayOfIntegers($arr){\n\t\t\t$arrizzle = array();\n\t\t\tfor ($i = 0; $i < count($arr); $i++){\n\t\t\t\t$arrizzle[] = $i;\n\t\t\t}\n\t\t\treturn $arrizzle;\n\t\t}", "function Tarr(&$R,$n,$m=\"\")\n\t\t{\n\t\treturn $this->Zarr($R,\"int8\",$n,$m);\t\t\n\t\t}", "public function getInternalArray() {}", "function get_config_array();", "abstract public static function getValues(): array;", "function inicializar_array($numero_elementos, $min, $max) {\n $lista = array();\n \n \n\n for($i = 0; $i < $numero_elementos; $i++) {\n \n $lista[$i] = rand($min, $max);\n \n \n }\n\n return $lista;\n \n\n\n}", "function ae_arr(&$arr)\n {\n return $arr[rand(0, sizeof($arr) - 1)];\n }", "public function getParams(): array;", "abstract public function generateData(array $data);", "abstract public function init(array $input);", "public function asArray();", "public function asArray();", "public function asArray();", "public function asArray();", "public function asArray();", "public function asArray();", "function buildArray(&$A) {\n\t\t\t$cant = count($A);\n\t\t\t$B = [];\n\t\t\t\n\t\t\t$B[] = $A;\n\t\n\t\t\treturn $B;\n\t\t}", "public function __invoke() : array;", "public function __invoke() : array;", "function farr(&$R,$n,$m=\"\")\n\t\t{\n\t\treturn $this->Zarr($R,\"uint32\",$n,$m);\n\t\t}", "public function getGen();", "public function arrayStructure()\n\t{\n\t\treturn array();\n\t}", "function params(array $data);", "private function createArray()\n {\n $this->makeGroupBy()->makeSearch()->normalize();\n }", "abstract protected function getIteratorArray();", "abstract protected function inputs(): array;", "public function values() : array;", "function earr(&$R,$n,$m=\"\")\n\t\t{\n\t\treturn $this->Zarr($R,\"uint16\",$n,$m);\n\t\t}", "public static function crear(array $data);", "function garr(&$R,$n,$m=\"\")\n\t\t{\n\t\treturn $this->Zarr($R,\"f32\",$n,$m);\n\t\t}", "public function init()\n {\n $ar = array();\n for ($i = 0; $i < 20; $i++)\n {\n $ar[] = $i;\n }\n }", "public function getParameters(): array;", "function _random_array_($size, $min, $max) {\n $a = [];\n for ($i = 1; $i <= $size; $i++) {\n $a[] = rand($min, $max);\n }\n return $a;\n}", "function __constructor() {\n $arr = array();\n }", "function array_parallel(){\n\t$r = array();\n\t$args = func_get_args();\n\t$keys = array();\n\tforeach ($args as $a)\n\t\t$keys = array_merge($keys, array_keys($a));\n\t$keys = array_unique($keys);\n\n\tforeach ($keys as $k){\n\t\t$i = array();\n\t\tforeach ($args as $a)\n\t\t\t$i[] = nu($a[$k]);\n\t\t$r[$k] = $i;\n\t}\n\treturn $r;\n}", "public static function arraysOf(self $gen)\n {\n $sized = self::sized(function ($s) {\n return self::choose(0, $s);\n });\n return $sized->bindGen(function (RoseTree $numRose) use ($gen) {\n $seq = self::sequence(FP::repeat($numRose->getRoot(), $gen));\n return $seq->bindGen(function ($roses) {\n return self::pureGen(RoseTree::shrink(FP::args(), $roses));\n });\n });\n }", "public function randArray()\n{\n\t$rand = rand(1,3);\n\treturn $rand;\n}", "abstract public function getArguments(): array;", "public static function make_array($lang)\n\t{\n\t\t$out = '<?php '.\"\\nreturn array(\\n\";\n\t\t$out .= static::build_array($lang);\n\t\treturn $out.');';\n\t}", "function toArray() ;", "function toArray() ;", "public function createKeyArray(){\n\t$keyArray = array();\n\tif (isset($this->id)) $keyArray[\"id\"] = $this->id;\n\tif (isset($this->codice_categoria)) $keyArray[\"codice_categoria\"] = $this->codice_categoria;\n\tif (isset($this->codice)) $keyArray[\"codice\"] = $this->codice;\n\tif (isset($this->descrizione)) $keyArray[\"descrizione\"] = $this->descrizione;\n\treturn $keyArray;\n}", "public function create(array $input);", "abstract public function to_array();", "function cre_random_array($random,$i){\n srand((float) microtime() * 10000000);\n $rand_keys = array_rand($random, $i);\n $res = array();\n if($i > 1){\n for($a=0;$a<$i;$a++){\n $res[] = $random[$rand_keys[$a]];\n }\n }else{\n $res[] = $random[$rand_keys]; \n }\n return $res;\n }", "public function getAsArray();", "public function output(): array;", "function am() {\n\t\t$r = array();\n\t\tforeach(func_get_args()as $a) {\n\t\t\tif (!is_array($a)) {\n\t\t\t\t$a = array($a);\n\t\t\t}\n\t\t\t$r = array_merge($r, $a);\n\t\t}\n\t\treturn $r;\n\t}", "public function getImageArray();", "abstract protected function arguments(): array;", "public function wizardArray() {}", "function CrearArrayOpciones($pParamAAA){\n\t\treturn Array(\n\t\t\tCURLOPT_URL => _PayPal::$URLToken\n\t\t\t,CURLOPT_TIMEOUT => 60\n\t\t\t,CURLOPT_HTTPHEADER => Array(\n\t\t\t\t\t\t\t\"Content-type: application/json\"\n\t\t\t\t\t\t\t,\"Accept: application/json\"\n\t\t\t\t\t\t\t// ,\"Authorization: Basic \" . base64_encode($ClientID . \":\" . $ClientSecret)\n\t\t\t\t\t\t\t,$pParamAAA\n\t\t\t\t\t\t\t)\n\t\t\t,CURLOPT_POST => 1\n ,CURLOPT_RETURNTRANSFER => 1\n );\n\t}", "public function testParameters(): array;", "function helper($param1,$param2,$param3){\n\t\t$array = array();\n\t\t/**\n\t\t * do something...\n\t\t */\n\t\t\n\t\t$array = [3,6,3];\n\t\t\n\t\treturn $array;\n\t}", "function init_C($key_56){\n $C = array();\n for($i=0; $i<28; $i++){\n $C[$i] = $key_56[$i];\n }\n\n return $C;\n }", "function Varr(&$R,$n,$m=\"\")\n\t\t{\n\t\treturn $this->Zarr($R,\"uint8\",$n,$m);\n\t\t}", "public static function run_all_initializations(): array;", "public function residue () :array\n {\n return [\n\n ];\n }", "function barr(&$R,$n,$m=\"\")\n\t\t{\n\t\treturn $this->Zarr($R,\"int16\",$n,$m);\n\t\t}", "abstract public function create(array $data): array;", "function maquetador_array( $c, $a, $i=\"\" ) {\n $aTemp = array ( \"c\" =>$c, \"a\" => $a );\n if ( $i!=\"\") {\n $aTemp[\"i\"] = $i ;\n }\n return $aTemp;\n}", "protected function initializeResultArray() {}", "public function arguments(): array;" ]
[ "0.69954973", "0.67968947", "0.6660896", "0.6359964", "0.63305676", "0.6174535", "0.6174535", "0.6073001", "0.60497713", "0.5895262", "0.5868703", "0.582139", "0.57906157", "0.5784861", "0.5761005", "0.5758971", "0.57567227", "0.57567203", "0.5749407", "0.57469475", "0.57466054", "0.57312065", "0.56680954", "0.5634927", "0.5616168", "0.5614283", "0.56062675", "0.5594345", "0.55902636", "0.5578601", "0.55706775", "0.5568716", "0.55530614", "0.5547303", "0.55424273", "0.55309165", "0.5517099", "0.55126876", "0.5511382", "0.5507198", "0.54895794", "0.54774815", "0.5460914", "0.54508865", "0.545053", "0.54456455", "0.5444953", "0.54223675", "0.54223675", "0.54223675", "0.54223675", "0.54223675", "0.54223675", "0.54194766", "0.53957367", "0.53957367", "0.5368876", "0.5353123", "0.5349782", "0.5344401", "0.53392476", "0.53217566", "0.5320171", "0.5319132", "0.53089285", "0.5297942", "0.52969444", "0.528529", "0.528148", "0.52715623", "0.5236294", "0.52358824", "0.5221419", "0.5218728", "0.52169394", "0.52121085", "0.5190851", "0.5190851", "0.5188178", "0.51766795", "0.51750445", "0.5174286", "0.51735705", "0.5171155", "0.516545", "0.51630247", "0.51558924", "0.5155044", "0.51531756", "0.51531506", "0.513848", "0.5120453", "0.51084703", "0.50986296", "0.5094765", "0.50863695", "0.5074153", "0.50728464", "0.5071359", "0.5070985" ]
0.7248972
0
Creates a form to delete a role entity.
private function createDeleteForm(Role $role) { return $this->createFormBuilder() ->setAction($this->generateUrl('role_delete', array('id' => $role->getId()))) ->setMethod('DELETE') ->getForm(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function createDeleteForm(Roles $role)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('back_roles_delete', array('id' => $role->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "public function deleteRolesAction(){\n \n $request = $this->getRequest();\n \n if(! isset($request->id)) {\n // TODO Massege (Helper bauen??!)\n $this->_helper->messenger('error', \n Zend_Registry::get('config')->messages->role->invalid);\n return $this->_redirect('/admin/role');\n }\n \n $entity = 'Jbig3\\Entity\\RolesEntity';\n $repositoryFunction = 'findOneById';\n \n $role = $this->em->getRepository($entity)->$repositoryFunction($request->id);\n \n if($role !== null) {\n // TODO Cascade - hier anders gelöst (Kinder vorher manuell löschen)\n if(count($role->rules)) {\n // Masseges\n $this->_helper->messenger('error', \n 'Unable to remove group. Please remove dependencies first (Manual)');\n return $this->_redirect('/admin/role');\n }\n \n $roleName = $role->name;\n \n $this->em->remove($role);\n $this->em->flush();\n \n // TODO Masseges\n $this->_helper->messenger('success', \n sprintf(Zend_Registry::get('config')->messages->role->delete, $roleName));\n return $this->_redirect('/admin/role');\n } else {\n // TODO Masseegs\n $this->_helper->messenger('success', \n Zend_Registry::get('config')->messages->role->invalid);\n return $this->_redirect('/admin/role');\n }\n }", "public function actionDeleteRole ()\n\t\t{\n\n\t\t\t$auth = Yii::$app->getAuthManager();\n\t\t\t$role = $auth->getRole(Yii::$app->request->get('id'));\n\t\t\t$auth->remove($role);\n\t\t\t$url = Yii::$app->request->referrer . '#roles';\n\t\t\tYii::$app->response->redirect($url);\n\n\t\t\tYii::$app->end();\n\t\t}", "function uc_roles_deletion_form($form, &$form_state, $account, $rid) {\n $expiration = db_query(\"SELECT expiration FROM {uc_roles_expirations} WHERE uid = :uid AND rid = :rid\", array(':uid' => $account->uid, ':rid' => $rid))->fetchField();\n if ($expiration) {\n\n $role_name = _uc_roles_get_name($rid);\n\n $form['user'] = array('#type' => 'value', '#value' => format_username($account->name));\n $form['uid'] = array('#type' => 'value', '#value' => $account->uid);\n $form['role'] = array('#type' => 'value', '#value' => $role_name);\n $form['rid'] = array('#type' => 'value', '#value' => $rid);\n\n $form = confirm_form(\n $form,\n t('Delete expiration of %role_name role for the user !user?', array(\n '!user' => theme('username', array(\n 'account' => $account,\n 'name' => check_plain($account->name),\n 'link_path' => 'user/' . $account->uid,\n )),\n '%role_name' => $role_name,\n )),\n 'admin/user/user/expiration',\n t('Deleting the expiration will give !user privileges set by the %role_name role indefinitely unless manually removed.', array(\n '!user' => theme('username', array(\n 'account' => $account,\n 'name' => check_plain($account->name),\n 'link_path' => 'user/' . $account->uid,\n )),\n '%role_name' => $role_name,\n )),\n t('Yes'),\n t('No')\n );\n }\n else {\n $form['error'] = array(\n '#markup' => t('Invalid user id or role id.'),\n );\n }\n\n return $form;\n}", "private function createDeleteForm(Event $event)\n {\n // $this->enforceUserSecurity('ROLE_USER');\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('event_delete', array('slug' => $event->getSlug())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "function roleDelete(Role $role);", "private function createDeleteForm(Efunction $efunction)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('efunction_delete', array('id' => $efunction->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(Acte $acte)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('acte_delete', array('id' => $acte->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "public function postDeleteRole(DeleteRequest $request)\n {\n $id = \\Input::get('id');\n // $student = Student::find($id);\n $gen_user_role = GenUserRole::find($id);\n $gen_user_role->delete();\n return redirect('gen_user');\n }", "public function deleting(Role $role)\n {\n }", "private function createDeleteForm(MostraMizaUllirit $mostraMizaUllirit)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('mostramizaullirit_delete', array('id' => $mostraMizaUllirit->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(Event $event)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('event_delete', array('id' => $event->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(Event $event)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('event_delete', array('id' => $event->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(Event $event)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('event_delete', array('id' => $event->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "public function destroy(Role $role)\n {\n //\n if($role->name ==\"app-admin\"){\n\n }else{\n $role->delete();\n }\n return redirect('roles');\n }", "public function getForm()\n {\n return new RoleForm;\n }", "private function createDeleteForm(Events $event) {\n\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('events_delete', array('id' => $event->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(ArmasMedico $armasMedico)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('armasmedico_delete', array('id' => $armasMedico->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(RhythmMaterial $rhythmMaterial)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('rhythmmaterial_delete', array('id' => $rhythmMaterial->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm($id) {\r\n return $this->createFormBuilder()\r\n ->setAction($this->generateUrl('rubrique_delete', array('id' => $id)))\r\n// ->setMethod('DELETE')\r\n ->add('submit', SubmitType::class, array('label' => 'Supprimer la rubrique courante'))\r\n ->getForm()\r\n ;\r\n }", "private function createDeleteForm(Aspirante $aspirante)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('aspirante_delete', array('id' => $aspirante->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(Projecte $projecte)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('projecte_delete', array('id' => $projecte->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(Musicien $musicien)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('musicien_delete', array('codeMusicien' => $musicien->getCodemusicien())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "public function postDelete()\n {\n self::getConnection()->delete('@system_user_role', ['user_id' => $this->getId()]);\n }", "private function createDeleteForm(Restricciones $restriccione)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('restricciones_delete', array('id' => $restriccione->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "public function executeDelete()\n {\n if($this->hasRequestParameter('ids')){\n $roles = array_reverse(RolePeer::retrieveByPKs(json_decode($this->getRequestParameter('ids'))));\n\n foreach($roles as $role){\n\t$role->delete();\n }\n\n }elseif($this->hasRequestParameter('id')){\n $role = RolePeer::retrieveByPk($this->getRequestParameter('id'));\n $role->delete();\n }\n\n $this->msg_alert = array('info', $this->getContext()->getI18N()->__(\"Rol borrado.\"));\n return $this->renderComponent('roles', 'list');\n }", "protected function createComponentDeleteForm()\r\n\t{\r\n\t\t$form = new Form;\r\n\t\t$form->addSubmit('delete', 'Smazat')->setAttribute('class', 'default');\r\n\t\t$form->addSubmit('cancel', 'Storno');\r\n\t\t$form->onSuccess[] = callback($this, 'deleteFormSubmitted');\r\n\t\t$form->addProtection(self::MESS_PROTECT);\r\n\t\treturn $form;\r\n\t}", "private function createDeleteForm(Recette $recette)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('recette_delete', array('id' => $recette->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(Team $entity)\r\n {\r\n return $this->createFormBuilder()\r\n ->setAction($this->generateUrl('app_team_delete', array('id' => $entity->getId())))\r\n ->setMethod('DELETE')\r\n ->getForm()\r\n ;\r\n }", "function travel_delete_form($form, &$form_state, $entity) {\n // Store the entity in the form.\n $form_state['entity'] = $entity;\n\n // Show confirm dialog.\n $entity_uri = entity_uri('travel', $entity);\n $message = t('Are you sure you want to delete entity %title?', array('%title' => entity_label('travel', $entity)));\n return confirm_form(\n $form,\n $message,\n $entity_uri['path'],\n t('This action cannot be undone.'),\n t('Delete'),\n t('Cancel')\n );\n}", "private function createDeleteForm(Metas $meta)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('admin_crud_metas_delete', array('id' => $meta->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "public function destroy(Role $role)\n {\n $role->delete();\n return redirect()->route('role.index')->with('success','Role Deleted Successfully');\n }", "function mongo_node_page_delete($form, $form_state, $entity_type, $entity) {\n $form['#entity'] = $entity;\n $uri = entity_uri($entity_type, $entity);\n\n return confirm_form($form,\n t('Are you sure you want to delete %title', array('%title' => $entity->title)),\n $uri['path'],\n t('This action cannot be undone'),\n t('Delete'),\n t('Cancel')\n );\n}", "private function createDeleteForm(ManejoReproductivo $manejoReproductivo)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('manejoreproductivo_delete', array('id' => $manejoReproductivo->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm($id){\n\t\treturn $this->createFormBuilder()\n\t\t\t->setAction($this->generateUrl('reserva_delete', array('id' => $id)))\n\t\t\t->setMethod('DELETE')\n\t\t\t->add('submit', 'submit', array('label' => 'Eliminar Reserva', 'attr' => array('class'=>'btn btn-danger btn-block')))\n\t\t\t->getForm()\n\t\t;\n\t}", "public function destroy(Role $role)\n {\n $role->delete();\n\n return redirect()->route('admin.user_managment.role.index');\n }", "private function createDeleteForm(Reglement $reglement)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('reglement_delete', array('codeRegl' => $reglement->getCoderegl())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(Absences $absence)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('student_absences_delete', array('id' => $absence->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "public function destroy(Role $role)\n {\n $request = request();\n\n if ($request->isMethod('get')) {\n return view('roles.delete', array('role' => $role));\n } elseif ($request->isMethod('delete')) {\n try {\n $role->delete();\n\n return redirect()->route('roles.index')->with('success_messages', array(__('global.delete_success_notify')));\n } catch (\\Exception $e) {\n $errorMessage = formatHandleErrorMessage(__('global.delete_fail_notify'), $e);\n return redirect()->back()->withInput()->withErrors($errorMessage);\n }\n }\n }", "public function destroy(RoleDelete $request, Role $role)\n {\n $data = $request->validated();\n if($data['confirm'] == true) {\n $role->delete();\n return redirect(route('users.index'));\n }\n return back()->withErrors($request);\n }", "private function createDeleteForm(Complect $complect)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('nomenclature_complect_delete', array('id' => $complect->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "public function destroy(Role $role)\n {\n \n $this->authorize('delete', $role);\n $role->delete();\n return redirect()->route('admin.roles.index')->withFlash('Role eliminado correctamente');\n \n }", "private function createDeleteForm(Evennements $evennement)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('evennements_delete', array('id' => $evennement->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "public function eliminar(Request $form)\n {\n // Recibe el id de la marca a eliminar\n $marca = Marca::find($form['id']);\n // Elimina la marca de la BBDD\n $marca->delete();\n // Redirije a la ruta /marcas\n return redirect('/marcas');\n }", "public function createRolesAction(){\n \n $request = $this->getRequest();\n \n $form = new Admin_Model_Forms_RolesForm($this->em);\n \n if($request->isPost()) {\n if($form->isValid($request->getParams())) {\n \n $role = new Jbig3\\Entity\\RolesEntity();\n $role->name = $request->name;\n \n if($request->parentRole != '') {\n $role->parent = $this->em->getReference('Jbig3\\Entity\\RolesEntity',\n $request->parentRole);\n }\n \n $this->em->persist($role);\n $this->em->flush();\n \n // TODO Massege\n $this->_helper->messenger('success', \n sprintf(Zend_Registry::get('config')->messages->role->create, \n $request->name));\n return $this->_redirect('/admin/role/create');\n } else {\n $this->view->errors = $form->getErrors();\n }\n }\n $this->view->form = $form;\n }", "public function deleteForm()\n\t{\n\t\t$form = new \\IPS\\Helpers\\Form( 'form', 'delete' );\n\t\t$form->addMessage( 'node_delete_blurb_no_content' );\n\t\t\n\t\treturn $form;\n\t}", "private function createDeleteForm($id)\n {\n \n $form = $this->createFormBuilder(null, array('attr' => array('id' => 'entrada_detalles_eliminar_type')))\n ->setAction('')\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Eliminar', 'icon' => 'trash', 'attr' => array('class' => 'btn-danger')))\n ->getForm()\n ;\n \n return $form;\n \n \n }", "private function createDeleteForm(CalendarEvent $event)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('ma_lrm_event_delete', array('id' => $event->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "public function createDeleteForm($id){\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('rsp_delete',array('id'=>$id)))\n ->setMethod('DELETE')\n ->add('submit','submit',array('label'=>'Delete'))\n ->getForm()\n ;\n }", "public function deleteAction() : object\n {\n if ($_SESSION['permission'] === \"admin\") {\n $form = new DeleteForm($this->di);\n $form->check();\n\n $this->page->add(\"user/crud/delete\", [\n \"form\" => $form->getHTML(),\n ]);\n\n return $this->page->render([\n \"title\" => \"Delete an item\",\n ]);\n }\n $this->di->get(\"response\")->redirect(\"user/login\");\n }", "public function destroy(Model $role)\n {\n $role->delete();\n return redirect()->route('admin.role.index')->with('notificationText', ' Role Destroy Successfully!');\n }", "public function destroy(Role $role)\n {\n //dd($role->toArray());\n $role->detachAllPermissions();\n $role->delete();\n writeLog('刪除 角色',$role->toArray());\n Session::flash('flash_message', '刪除成功!');\n // flash()->overlay('刪除成功!','系統訊息:');\n return redirect('/admin/role');\n }", "public function destroy(Role $role) {\n\t\t$this->authorize('hasaccess', 'roles.destroy');\n\t\t$role->delete();\n\t\treturn redirect()->route('role.index')->with('status_success', 'Role successfully removed');\n\t}", "private function createDeleteForm(Covoiturage $covoiturage)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('personnel_covoiturage_delete', array('id' => $covoiturage->getId())))\n ->setMethod('DELETE')\n ->getForm();\n }", "public function destroy(Request $request, $id) {\n // Fetch the role object\n // $role = $this->roleRepository->findById($id);\n\n // Remove the role\n // $role->delete();\n\n // // All done\n // $message = trans(\"comman.role\").' '.\"'{$role->name}'\".' '.trans(\"comman.removed\");\n // if ($request->ajax()) {\n // return response()->json([$message], 200);\n // }\n\n // session()->flash('success', $message);\n // return redirect()->route('roles.index');\n\n $id = Crypt::decryptString($id);\n $model = Role::find($id);\n if ($model) {\n $dependency = $model->deleteValidate($id);\n if (!$dependency) {\n $model->deleted = '1';\n $model->save();\n Flash::success(trans(\"comman.role_deleted\"));\n }else {\n Flash::error(trans(\"comman.role_dependency_error\",['dependency'=>$dependency]));\n }\n } else {\n Flash::error(trans(\"comman.role_error\"));\n }\n return redirect()->route('roles.index');\n }", "private function createDeleteForm(Claim $claim)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('claim_delete', array('id' => $claim->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "public function destroy(Role $role)\n {\n //\n DB::beginTransaction();\n try{\n $role->delete();\n DB::commit();\n return redirect('roles');\n }catch(\\Exception $e){\n DB::rollBack();\n return redirect('roles');\n }\n }", "private function createDeleteForm(Eventos $evento)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('eventos_delete', array('id' => $evento->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "public function create()\n {\n $role = new Role;\n $form = RolePresenter::form($role, 'create');\n\n Site::set('title', trans('orchestra/control::title.roles.create'));\n\n return View::make('orchestra/control::roles.edit', array(\n 'role' => $role,\n 'form' => $form,\n ));\n }", "public function remove(AccountDomainModels\\Role $entity)\n {\n $id = $entity->id()->value();\n\n $this->model->destroy($id);\n }", "private function createDeleteForm(Extra $extra)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('extra_delete', array('id' => $extra->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "public function destroy($id)\n {\n DB::table(\"roles\")->where('id',$id)->delete();\n return redirect()->route('admin.roles')\n ->with('success','Permissão deletada com sucesso');\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('caracteristicasequipo_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Eliminar','attr' => array('class' => 'btn btn-danger')))\n ->getForm()\n ;\n }", "private function createDeleteForm(Registro $registro)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('registro_delete', array('id' => $registro->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "public function del_role(){\n\t\textract($_POST);\n\n\t\t//Connection establishment to get data from REST API\n\t\t$path=base_url();\n\t\t$url = $path.'api/manageRoles_api/del_role?role_id='.$role_id;\t\t\n\t\t$ch = curl_init($url);\n\t\tcurl_setopt($ch, CURLOPT_HTTPGET, true);\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\t\t$response_json = curl_exec($ch);\n\t\tcurl_close($ch);\n\t\t$response=json_decode($response_json, true);\n\t\t//api processing ends\n\n\t\tif($response['status']==0){\n\t\t\techo '<div class=\"alert alert-danger\">\n\t\t\t<strong>'.$response['status_message'].'</strong> \n\t\t\t</div>\t\t\t\t\t\t\n\t\t\t';\t\n\t\t\t\n\t\t}\n\t\telse{\n\t\t\techo '<div class=\"alert alert-warning\">\n\t\t\t<strong>'.$response['status_message'].'</strong> \n\t\t\t</div>\t\t\t\t\t\t\n\t\t\t';\t\t\t\t\n\t\t\t\n\t\t}\t\n\t\t\n\t}", "private function createDeleteForm(Partido $partido) {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('partido_delete', ['id' => $partido->getId()]))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "public function confirmDelete(Role $role)\n {\n $this->authorize('delete', Role::class);\n\n return view('laralum::pages.confirmation', [\n 'method' => 'DELETE',\n 'action' => route('laralum::roles.destroy', ['role' => $role]),\n ]);\n }", "public function destroy(Role $role)\n {\n try{\n $role->delete();\n return redirect()->back()\n ->with('success', 'Role Deleted successfully.');\n }catch(\\Exception $e){\n DB::rollback();\n return Redirect::back()->with('error',$e->getMessage());\n }\n }", "private function createDeleteForm(Materials $material)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('materials_delete', array('id' => $material->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('userman_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm();\n }", "public function create()\n {\n $role = new Role();\n\n return View::make('pvadmin.roles.form')\n ->with('title', 'Create Role')\n ->with('action', 'pvadmin.roles.store')\n ->with('method', 'post')\n ->with('permissions', Permission::optionsList())\n ->with('role', $role);\n }", "private function createDeleteForm(Brand $brand)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('brand_delete', array('id' => $brand->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "public function newAction()\n {\n $journal = $this->get('ojs.journal_service')->getSelectedJournal();\n if (!$this->isGranted('CREATE', $journal, 'userRole')) {\n throw new AccessDeniedException(\"You are not authorized for view this page\");\n }\n $entity = new JournalRole();\n $entity->setJournal($journal);\n $em = $this->getDoctrine()->getManager();\n $em->persist($entity);\n $form = $this->createCreateForm($entity);\n\n return $this->render(\n 'OjsJournalBundle:JournalRole:new.html.twig',\n array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n )\n );\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('empleado_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }", "private function createDeleteForm(Recipe $recipe)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('recipe_delete', array('id' => $recipe->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "public function destroy($id)\n {\n $role=Role::find($id);\n\n $role->delete();\n\n return view('admin.pages.index_role');\n\n }", "private function createDeleteForm(Proprietaire $proprietaire) {\n return $this->createFormBuilder\n ->setAction($this->generateUrl('post_admin_delete', array('id' => $proprietaire->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(ModelMenu $modelMenu) {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('modelmenu_delete', array('id' => $modelMenu->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(SkipMode $skipMode)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('skipmode_delete', array('id' => $skipMode->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private\n function createAgenceeDeleteForm(Agence $agence)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('agencee_delete', array('id' => $agence->getAgenceId())))\n ->setMethod('DELETE')\n ->getForm();\n }", "private function createDeleteForm(Tblyear $tblyear)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('tblyear_delete', array('id' => $tblyear->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "public function deleteAction(Request $request, $id)\n {\n $em = $this->getDoctrine()->getManager();\n $journal = $this->get('ojs.journal_service')->getSelectedJournal();\n if (!$this->isGranted('DELETE', $journal, 'userRole')) {\n throw new AccessDeniedException(\"You are not authorized for view this page\");\n }\n $entity = $em->getRepository('OjsJournalBundle:JournalRole')->findOneBy(\n array('id' => $id, 'journal' => $journal)\n );\n $this->throw404IfNotFound($entity);\n\n $csrf = $this->get('security.csrf.token_manager');\n $token = $csrf->getToken('ojs_journal_role'.$entity->getId());\n if($token!=$request->get('_token'))\n throw new TokenNotFoundException(\"Token Not Found!\");\n\n $em->remove($entity);\n $em->flush();\n $this->successFlashBag('successful.remove');\n\n return $this->redirectToRoute('ojs_journal_role_index');\n }", "private function createDeleteForm(Livr $livr)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('livr_delete', array('idv' => $livr->getIdv())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(Examenrealizado $examenrealizado)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('examenrealizado_delete', array('idexamenrealizado' => $examenrealizado->getIdexamenrealizado())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('solmantenimientoidentificacion_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Borrar','attr'=>array('class'=>'btn btn-danger btn btn-danger btn-lg btn-block')))\n ->getForm()\n ;\n }", "private function createDeleteForm(Demandados $demandado)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('demandados_delete', array('id' => $demandado->getIdDemandado())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(AbsenceEmploye $absenceEmploye)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('absenceemploye_delete', array('idAbsenceE' => $absenceEmploye->getIdabsencee())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('utente_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }", "public function destroy(Role $role)\n {\n if(Auth::user()->can('destroy-roles')){\n ActivityLogger::activity(\"Suppression du role ID:\".$role->id.'('.$role->name.') par l\\'utilisateur ID:'.Auth::id().\"(\".Auth::user()->name.\")\");\n $role->delete();\n return redirect()->route(\"roles.index\")->with('success', 'Role supprimé avec succès'); \n }else{\n return back()->with('error',\"Vous n'avez pas ce droit\");\n } \n }", "private function createDeleteForm(Orden $orden)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('orden_delete', array('id' => $orden->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\r\n {\r\n return $this->createFormBuilder()\r\n ->setAction($this->generateUrl('admin_consulta_delete', array('id' => $id)))\r\n ->setMethod('DELETE')\r\n ->add('submit', 'submit', array('label' => 'Delete'))\r\n ->getForm()\r\n ;\r\n }", "private function createDeleteForm(RelationUserEntite $relationUserEntite)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('relationuserentite_delete', array('id' => $relationUserEntite->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "public function create()\n {\n return view('admin.crud_admin.role.create');\n\n }", "private function createDeleteForm(NomDpa $nomdpa)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('dpa_delete', array('id' => $nomdpa->getIddpa())))\n ->setMethod('DELETE')\n ->getForm();\n }", "private function createDeleteForm(Materiel $materiel) {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('materieladmin_delete', array('id' => $materiel->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(m_employee $m_employee)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('prefix_update_delete', array('id' => $m_employee->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "public function destroy(Role $role)\n {\n $role->permissions()->detach();\n $role->delete();\n return redirect(\\Config::get(\"admin\").\"/roles/\");\n }", "public function destroy(Role $role)\n {\n //\n }", "public function destroy(Role $role)\n {\n //\n }", "public function destroy(Role $role)\n {\n //\n }" ]
[ "0.80152273", "0.69734687", "0.69086474", "0.6816056", "0.6799801", "0.6702436", "0.6464739", "0.64358765", "0.6387753", "0.6355804", "0.63335204", "0.63201606", "0.63201606", "0.63201606", "0.63067895", "0.6303177", "0.62701714", "0.62513304", "0.6242807", "0.62261164", "0.6204073", "0.6181939", "0.6166027", "0.61537284", "0.6152475", "0.61454445", "0.61361235", "0.6128081", "0.6126932", "0.61123484", "0.6107838", "0.6103415", "0.61018616", "0.61011076", "0.6099849", "0.6091326", "0.6086391", "0.60771734", "0.60728484", "0.60676986", "0.6058282", "0.6054362", "0.60534006", "0.60469866", "0.6045603", "0.6042272", "0.60394025", "0.603542", "0.6026519", "0.60126567", "0.60051036", "0.5993625", "0.598668", "0.5986051", "0.5986045", "0.5981605", "0.59770197", "0.59741086", "0.597211", "0.59630615", "0.5962608", "0.59591365", "0.59555876", "0.59529865", "0.59521836", "0.5950867", "0.594558", "0.5944002", "0.5943067", "0.5938623", "0.59327376", "0.59314084", "0.5924978", "0.5922755", "0.5912167", "0.5910964", "0.59099144", "0.5909664", "0.59052587", "0.59040177", "0.5903883", "0.5902486", "0.5901408", "0.5899902", "0.58946943", "0.5894359", "0.5893648", "0.5891216", "0.5891048", "0.58888006", "0.58851737", "0.58844495", "0.5882836", "0.58820194", "0.5877036", "0.58758235", "0.5873056", "0.58717364", "0.58717364", "0.58717364" ]
0.79986936
1
Create a new command instance.
public function __construct() { parent::__construct(); $this->client =new Client(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function newCommand() {\n return newinstance(Command::class, [], '{\n public static $wasRun= false;\n public function __construct() { self::$wasRun= false; }\n public function run() { self::$wasRun= true; }\n public function wasRun() { return self::$wasRun; }\n }');\n }", "public function createCommand()\r\n\t{\r\n\t\t$obj = new DbCommand($this,$this->dbms);\r\n\t\treturn $obj;\r\n\t}", "public function createCommand() {\n\t\treturn new UnboxedCommand( $this );\n\t}", "protected function createCommand($args) {\n $command = new Command();\n $command->id = ifseta($args, 'id');\n $command->name = ifseta($args, 'name');\n $command->url = ifseta($args, 'url');\n $command->description = ifseta($args, 'description');\n $command->uses = ifseta($args, 'uses');\n $command->creationDate = ifseta($args, 'creation_date');\n $command->lastUseDate = ifseta($args, 'last_use_date');\n $command->goldenEggDate = ifseta($args, 'golden_egg_date');\n return $command;\n }", "static public function create($cmd = null, $args = null)\n {\n return new self($cmd, $args);\n }", "public function createCommand($kernel, string $commandName = null, string $commandDescription = null): Command;", "public function makeCommand() \n {\n if($this->CrontabCommandObject === NULL)\n {\n $this->CrontabCommandObject = new \\root\\library\\Crontab\\CrontabCommand\\CrontabCommand();\n }\n \n return $this->CrontabCommandObject;\n }", "public function testInstantiation()\n {\n $command = new CreateRule('dummy name');\n }", "public function command(Command $command);", "public function __construct($command)\n {\n $this->command = $command;\n }", "public static function create(array $data)\n {\n $command = new static();\n $command->exchangeArray($data);\n return $command;\n }", "protected function getCreateCommand()\n {\n $command = new IndexCreateCommand();\n $command->setContainer($this->getContainer());\n\n return $command;\n }", "public function createCommand($string = '')\n {\n return $this->createStringable($string);\n }", "public function createCommand($type) {\r\n $command = $this->xml->createElement('command');\r\n $command->setAttribute('xsi:type', $type);\r\n $command->setAttribute('xmlns', '');\r\n $this->xmlSchema($command);\r\n return $command;\r\n }", "public function __construct()\n {\n // We will go ahead and set the name, description, and parameters on console\n // commands just to make things a little easier on the developer. This is\n // so they don't have to all be manually specified in the constructors.\n if (isset($this->signature)) {\n $this->configureUsingFluentDefinition();\n } else {\n parent::__construct($this->name);\n }\n\n // Once we have constructed the command, we'll set the description and other\n // related properties of the command. If a signature wasn't used to build\n // the command we'll set the arguments and the options on this command.\n $this->setDescription((string) $this->description);\n\n $this->setHelp((string) $this->help);\n\n $this->setHidden($this->isHidden());\n\n if (! isset($this->signature)) {\n $this->specifyParameters();\n }\n }", "public function make(string $name, PreprocessorInterface $preprocessor = null): CommandInterface;", "private function _getCommandByClassName($className)\n {\n return new $className;\n }", "public function newCommand($regex, $callable) {\n $cmd = new Command();\n $cmd->regex = $regex;\n $cmd->callable = $callable;\n return $this->addCommand($cmd);\n }", "public static function create($commandID, ...$args)\n {\n $arguments = func_get_args();\n\n return new static(array_shift($arguments), $arguments);\n }", "private function __construct($command = null)\n {\n $this->command = $command;\n }", "public static function factory(string $command, string $before = '', string $after = ''): self\n {\n return new self($command, $before, $after);\n }", "public function getCommand() {}", "protected function buildCommand()\n {\n $command = new Command(\\Tivie\\Command\\ESCAPE);\n $command\n ->chdir(realpath($this->repoDir))\n ->setCommand($this->gitDir)\n ->addArgument(new Argument('tag', null, null, false))\n ->addArgument(new Argument($this->tag, null, null, true));\n\n return $command;\n }", "public function testCanBeInstantiated()\n {\n $command = $this->createInstance();\n $this->assertInstanceOf('\\\\Dhii\\\\ShellInterop\\\\CommandInterface', $command, 'Command must be an interoperable command');\n $this->assertInstanceOf('\\\\Dhii\\\\ShellCommandInterop\\\\ConfigurableCommandInterface', $command, 'Command must be a configurable command');\n $this->assertInstanceOf('\\\\Dhii\\\\ShellCommandInterop\\\\MutableCommandInterface', $command, 'Command must be a mutable command');\n }", "public function getCommand();", "protected function createCommand($name, array $parameters = [])\n {\n return new Fluent(\n array_merge(\n compact('name'),\n $parameters)\n );\n }", "public function testCanPassCommandStringToConstructor()\n {\n $command = new Command('/bin/ls -l');\n\n $this->assertEquals('/bin/ls -l', $command->getExecCommand());\n }", "public function makeCommandInstanceByType(...$args): CommandInterface\n {\n $commandType = array_shift($args);\n\n switch ($commandType) {\n case self::PROGRAM_READ_MODEL_FETCH_ONE_COMMAND:\n return $this->makeFetchOneCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_FIND_COMMAND:\n return $this->makeFindCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_FIND_LITE_COMMAND:\n return $this->makeFindLiteCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_CREATE_TASK_COMMAND:\n return $this->makeItemCreateTaskCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_CREATE_COMMAND:\n return $this->makeItemCreateCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_UPDATE_TASK_COMMAND:\n return $this->makeItemUpdateTaskCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_UPDATE_COMMAND:\n return $this->makeItemUpdateCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_DELETE_TASK_COMMAND:\n return $this->makeItemDeleteTaskCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_DELETE_COMMAND:\n return $this->makeItemDeleteCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_ADD_ID_COMMAND:\n return $this->makeItemAddIdCommand(...$args);\n\n default:\n throw new FactoryException(sprintf('Command bus for type `%s` not found!', (string) $commandType));\n }\n }", "public function __construct($cmd)\n {\n $this->cmd = $cmd;\n }", "public function getCommand()\n {\n }", "public function command($class)\n {\n $runnable = $this->resolveClass($class);\n\n if ( ! $runnable instanceof Command) {\n throw new InvalidArgumentException(get_class($runnable).' must be an instance of '.Command::class.'.');\n }\n\n $command = $runnable;\n\n if ($runnable instanceof Taggable) {\n $command = new Cached($command, $this);\n }\n\n if ($runnable instanceof Transactional) {\n $command = new Transaction($command, $this, $this->makeFromContainer(ConnectionInterface::class));\n }\n\n if ($runnable instanceof Eventable) {\n $command = new Evented($command, $this);\n }\n\n return $this->newBuilder($command);\n }", "protected function createCommandFactory(): CommandFactory\n {\n return new CommandFactory([\n 'CLOSE' => Command\\CLOSE::class,\n ]);\n }", "public static function register() {\n\n if ( !defined( 'WP_CLI' ) || !WP_CLI ) {\n return;\n }\n \n $instance = new static;\n if(empty( $instance->namespace )) {\n throw new \\Exception(\"Command namespace not defined\", 1);\n \n }\n\t\t\\WP_CLI::add_command( $instance->namespace, $instance, $instance->args ?? null );\n\t}", "public function addCommand($command);", "public function add(Command $command);", "abstract protected function getCommand();", "public function createCommand()\r\n\t{\r\n\t\t//start the string\r\n\t\t$command = '';\r\n\t\t\r\n\t\t//add the java command or the path to java\r\n\t\t$command .= $this->java_path;\r\n\t\t\r\n\t\t//add the class path\r\n\t\t$command .= ' -cp \"'. $this->stanford_path . $this->seperator . '*\" ';\r\n\t\t\r\n\t\t//add options\r\n\t\t$options = implode(' ', $this->java_options);\r\n\t\t$command .= '-'.$options;\r\n\t\t\r\n\t\t//add the call to the pipeline object\r\n\t\t$command .= ' edu.stanford.nlp.pipeline.StanfordCoreNLP ';\r\n\r\n\t\t//add the annotators\r\n\t\t$command .= '-annotators '. $this->listAnnotators();\r\n\t\t\r\n\t\t//add the input and output directors\r\n\t\t$command .= ' -file '. $this->tmp_file . ' -outputDirectory '. $this->tmp_path;\r\n\t\t\r\n\t\t//this is for testing purposes\r\n\t\t//$command .= ' -file '. $this->tmp_path .'\\\\nlp3F25.tmp' . ' -outputDirectory '. $this->tmp_path;\r\n\t\t\r\n\t\t//if using regexner add this to the command string\r\n\t\tif($this->annotators['regexner'] === true)\r\n\t\t{\r\n\t\t\t$command .=' -regexner.mapping '. $this->regexner_path . $this->seperator . $this->regexner_file;\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\treturn $command;\r\n\t}", "protected function createCommand(string $name, array $parameters = []): Fluent\n {\n return new Fluent(array_merge(compact('name'), $parameters));\n }", "public function __construct()\n {\n parent::__construct(static::NAME, static::VERSION);\n $this->add(new DefaultCommand());\n }", "public function __construct()\n {\n parent::__construct();\n\n $this->command_name = config(\"custom-commands.command_name\");\n\n parent::__construct($this->signature = $this->command_name);\n\n $this->commands = (array) config(\"custom-commands.commands\");\n \n $this->table = config(\"custom-commands.table\");\n\n $this->row = config(\"custom-commands.row\");\n\n $this->changeEnv = (boolean) config(\"custom-commands.change_env\");\n\n }", "protected function createCommandFile()\n {\n $command_file_full_path = $this->command_dir_path . DIRECTORY_SEPARATOR . $this->arg->getCommandFileName();\n\n // Check if the command already exists\n if (file_exists($command_file_full_path)) {\n throw new Exception('Command already exists.');\n }\n\n // Create the file for the new command\n $command_file = fopen($command_file_full_path, 'w');\n\n // TODO: Create Script Generator to generate the PHP scripts for the new command.\n\n fclose($command_file);\n\n $this->console->getOutput()->println('File created at: ' . $command_file_full_path);\n $this->console->getOutput()->success('Command ' . $this->arg->getSignature() . ' created successfully.');\n }", "public static function create() {}", "public static function create() {}", "public static function create() {}", "public static function create(InteropContainer $container)\n {\n $middleware = $container->get('cmd.middleware');\n return new CommandBusFactory($middleware);\n }", "private function createCli() {\n $this->cli = new Cli();\n $this->commands = $this->commandParser->getAllCommands();\n\n foreach ($this->commands as $command) {\n if ($command->isDefault()) {\n $this->cli->command(\"*\");\n foreach ($command->getOptions() as $option) {\n $this->cli->opt($option->getName(), $option->getDescription(), $option->isRequired(), $option->getType());\n }\n foreach ($command->getArguments() as $argument) {\n if (!$argument->isVariadic())\n $this->cli->arg($argument->getName(), $argument->getDescription(), $argument->isRequired());\n }\n }\n if ($command->getName() != \"\") {\n $this->cli->command($command->getName())->description($command->getDescription());\n foreach ($command->getOptions() as $option) {\n $this->cli->opt($option->getName(), $option->getDescription(), $option->isRequired(), $option->getType());\n }\n foreach ($command->getArguments() as $argument) {\n if (!$argument->isVariadic())\n $this->cli->arg($argument->getName(), $argument->getDescription(), $argument->isRequired());\n }\n }\n }\n\n\n }", "public function testInstantiation()\n {\n $this->assertInstanceOf('Contao\\ManagerBundle\\Command\\InstallWebDirCommand', $this->command);\n }", "public function command(string $command): self\n {\n $this->addCommands[] = $command;\n\n return $this;\n }", "public function create() {}", "protected function createProcess($cmd)\n {\n return new Process(explode(' ', $cmd));\n }", "public function create(){}", "protected function getCommandFactory(): Command\\Factory\n {\n return new Command\\RedisFactory();\n }", "public function __construct()\n {\n parent::__construct();\n\n $this->commandData = new CommandData($this, CommandData::$COMMAND_TYPE_API);\n }", "public function testNewCommand() : void\n {\n $this->assertFalse($this->command->hasArguments());\n $this->assertEquals(\"\", $this->command->getArguments());\n }", "protected function createCommandBuilder()\n\t{\n\t\treturn new CSqliteCommandBuilder($this);\n\t}", "public function __construct($command, $config = [])\n {\n $this->command = $command;\n $this->_output = $this->getDefaultOutput();\n parent::__construct($config);\n }", "public function __construct(){\n\n global $argv;\n\n if(!isset($argv[1])){\n echo 'You must supply a command!' . PHP_EOL;\n exit;\n }//if\n\n $args = $argv;\n\n $scriptName = array_shift($args);\n $method = array_shift($args);\n\n $method = explode('-',$method);\n foreach($method as $k => $v){\n if($k != 0){\n $method[$k] = ucwords($v);\n }//if\n }//foreach\n\n $method = implode('',$method);\n\n $resolved = false;\n\n if(method_exists($this,$method)){\n call_user_func(Array($this,$method), $args);\n $resolved = true;\n }//if\n else {\n foreach(static::$extendedCommands as $commandClass){\n if(method_exists($commandClass,$method)){\n call_user_func(Array($commandClass,$method), $args);\n $resolved = true;\n break;\n }//if\n }//foreach\n }//el\n\n if(!$resolved){\n echo \"`{$method}` is not a valid CLI command!\";\n }//if\n\n echo PHP_EOL;\n exit;\n\n }", "public function forCommand($command)\n {\n $this->command = $command;\n $this->pipe = new NullPipe();\n $this->manager = new InteractiveProcessManager($this->userInteraction);\n\n return $this;\n }", "public function __construct()\n {\n parent::__construct('pwman', '0.1.0');\n\n $getCommand = new Get();\n $this->add($getCommand);\n\n $setCommand = new Set();\n $this->add($setCommand);\n }", "public function create() {\n $class_name = $this->getOption('className');\n return new $class_name();\n }", "public function createCommand(?string $sql = null, array $params = []): Command;", "public function __construct($command = NULL, $name = NULL)\n {\n $args = func_get_args();\n\n switch ($command) {\n case self::CONSTR_CMD_POPULATE_SYNCED_ARRAY:\n case self::CONSTR_CMD_POP_FROM_ARR:\n case self::CONSTR_CMD_POP_FROM_OBJ:\n case self::CONSTR_CMD_POP_FROM_DB:\n case self::CONSTR_CMD_NEW:\n $this->setup_name = $name;\n\n # shift off known args\n array_shift($args);\n array_shift($args);\n break;\n }\n\n switch ($command) {\n case self::CONSTR_CMD_POP_FROM_ARR:\n $this->applyArray($args[0]);\n break;\n case self::CONSTR_CMD_POP_FROM_OBJ:\n break;\n case self::CONSTR_CMD_POP_FROM_DB:\n break;\n case self::CONSTR_CMD_POPULATE_SYNCED_ARRAY:\n $this->applyArray($args[0]);\n $this->setAllLoaded();\n break;\n default:\n throw new OrmInputException('Guessing not supported, please explicitly specify construction type');\n self::constructGuess($args);\n }\n\n $this->ensureObjectInDb();\n }", "public function generateCommands();", "protected function newInstanceCommand($commandClass)\n {\n $class = new ReflectionClass($commandClass);\n\n return $class->newInstanceArgs($this->resolveCommandParameters($class));\n }", "protected function buildCommand()\n {\n return $this->command;\n }", "public function makeItemCreateCommand(string $processUuid, array $item): ItemCreateCommand\n {\n $processUuid = ProcessUuid::fromNative($processUuid);\n $uuid = Uuid::fromNative(null);\n $item = Item::fromNative($item);\n\n return new ItemCreateCommand($processUuid, $uuid, $item);\n }", "public function __construct($commandName, $args = [], $description = '') {\n if (!$this->setName($commandName)) {\n $this->setName('--new-command');\n }\n $this->addArgs($args);\n\n if (!$this->setDescription($description)) {\n $this->setDescription('<NO DESCRIPTION>');\n }\n }", "public function getCommand($name, array $args = array())\n {\n return parent::getCommand($name, $args)\n ->setRequestSerializer(RequestSerializer::getInstance());\n }", "protected function buildCommand()\n {\n $command = new Command(\\Tivie\\Command\\DONT_ADD_SPACE_BEFORE_VALUE);\n $command\n ->chdir(realpath($this->repoDir))\n ->setCommand($this->gitDir)\n ->addArgument(new Argument('rev-parse'))\n ->addArgument(new Argument('HEAD'));\n\n return $command;\n }", "protected function instantiateCommand(Request $request, $args)\n {\n $command = new DeletePackageCustomerCommand($args);\n\n $requestBody = $request->getParsedBody();\n\n $this->setCommandFields($command, $requestBody);\n\n return $command;\n }", "public function createCommand($sql = null, $params = [])\n {\n $command = new Command([\n 'db' => $this,\n 'sql' => $sql,\n ]);\n\n return $command->bindValues($params);\n }", "protected function setCommand($value) {\n\t\t$this->_command = trim($value);\n\t\treturn $this;\n\t}", "public function setCommand($command)\n {\n $this->command = $command;\n\n return $this;\n }", "public function buildCommand()\n {\n return parent::buildCommand();\n }", "private function registerMakeModuleCommand()\n {\n $this->app->singleton('command.make.module', function($app) {\n return $app['Caffeinated\\Modules\\Console\\Generators\\MakeModuleCommand'];\n });\n\n $this->commands('command.make.module');\n }", "public function __construct()\n {\n parent::__construct();\n\n $this->currentDirectory = getcwd();\n $this->baseIndentLevel = 0;\n $this->registerCommand(\"Ling\\LingTalfi\\Kaos\\Command\\HelpCommand\", \"help\");\n $this->registerCommand(\"Ling\\LingTalfi\\Kaos\\Command\\InitializePlanetCommand\", \"init\");\n $this->registerCommand(\"Ling\\LingTalfi\\Kaos\\Command\\PackAndPushUniToolCommand\", \"packpushuni\");\n $this->registerCommand(\"Ling\\LingTalfi\\Kaos\\Command\\PackLightPluginCommand\", \"packlightmap\");\n $this->registerCommand(\"Ling\\LingTalfi\\Kaos\\Command\\PushCommand\", \"push\");\n $this->registerCommand(\"Ling\\LingTalfi\\Kaos\\Command\\PushUniverseSnapshotCommand\", \"pushuni\");\n $this->registerCommand(\"Ling\\LingTalfi\\Kaos\\Command\\UpdateSubscriberDependenciesCommand\", \"updsd\");\n\n }", "public function getCommand(string $command);", "protected function registerCommand(){\n\t\t$this->app->singleton('fakeid.command.setup', function ($app){\n\t\t\treturn new SetupCommand();\n\t\t});\n\n\t\t$this->commands('fakeid.command.setup');\n\t}", "public function addCommand($command, $args = [], $data = [])\n {\n $item = new ScreenCommand();\n $item->screen_id = $this->id;\n $item->command = $command;\n $item->arguments = $args;\n $item->fill($data);\n $item->save();\n\n return $item;\n }", "public function test_creating_command_from_container()\n {\n $now = new \\DateTime();\n $this->container->add('DateTime', $now);\n $command = 'Spekkionu\\DomainDispatcher\\Test\\Commands\\CommandWithConstructor';\n $result = $this->dispatcher->dispatch($command);\n $this->assertSame($now, $result);\n }", "protected function createProcess(): Process\n {\n $command = [\n $this->settings['executable']\n ];\n\n $command[] = $this->from;\n $command[] = $this->to;\n\n // Set the margins if needed.\n if ($this->settings['marginsType'] !== self::MARGIN_TYPE_NO_MARGINS) {\n $command[] = '--marginsType=' . $this->settings['marginsType'];\n }\n\n // If we need to proxy with node we just need to prepend the $command with `node`.\n if ($this->settings['proxyWithNode']) {\n array_unshift($command, 'node');\n }\n\n // If there's no graphical environment we need to prepend the $command with `xvfb-run\n // --auto-servernum`.\n if (! $this->settings['graphicalEnvironment']) {\n array_unshift($command, '--auto-servernum');\n array_unshift($command, 'xvfb-run');\n }\n\n return new Process($command);\n }", "private function registerCommand()\n {\n $this->app->singleton('command.shenma.push', function () {\n return new \\Larva\\Shenma\\Push\\Commands\\Push();\n });\n\n $this->app->singleton('command.shenma.push.retry', function () {\n return new \\Larva\\Shenma\\Push\\Commands\\PushRetry();\n });\n }", "public function __construct(string $command, string $before = '', string $after = '')\n {\n $this->command = $command;\n $this->before = $before;\n $this->after = $after;\n }", "public function generateCommand($singleCommandDefinition);", "public function create() {\n }", "public function create() {\n }", "public function create() {\r\n }", "public function create() {\n\n\t}", "private function getImportCommand()\n {\n return new IndexImportCommand(self::getContainer());\n }", "public function __construct($command)\n {\n $this->command = $command;\n\n $this->command->line('Installing Images: <info>✔</info>');\n }", "public function __construct()\n {\n self::$instance =& $this;\n\n $commanddir = Config::main('directory');\n $excludes = Config::main('exclude');\n\n if(is_null($commanddir))\n die('Could not find commands directory. It should be specified in the main config.');\n\n //The directory where commands reside should be relative\n //to the directory with the clip executable.\n $dir = realpath(__DIR__.\"/{$commanddir}\");\n\n $cmdfiles = scandir($dir);\n //Loop through each file in the commands directory\n foreach($cmdfiles as $file)\n {\n //Assume that each file uses the standard '.php' file extension.\n $command = substr($file, 0, -4);\n\n //Ignore the unnecessary directories as commands and anything that\n //has been marked for exclusion then attempt to include the valid ones.\n if($file !== '.' && $file !== '..' && array_search($command, $excludes) === false && include(\"{$dir}/{$file}\"))\n {\n if(class_exists($command, false))\n {\n $obj = new $command;\n //Only load commands that use the clip command interface\n if($obj instanceof Command)\n $this->commands[strtolower($command)] = $obj;\n }\n }\n }\n }", "public function __construct($action, $command = null) {\n parent::__construct($action, self::NAME);\n\n $fieldFactory = FieldFactory::getInstance();\n\n $commandField = $fieldFactory->createField(FieldFactory::TYPE_STRING, self::FIELD_COMMAND, $command);\n\n $this->addField($commandField);\n }", "public function createCommand($db = null, $action = 'get')\n {\n if ($db === null) {\n $db = Yii::$app->get(Connection::getDriverName());\n }\n $this->addAction($action);\n $commandConfig = $db->getQueryBuilder()->build($this);\n\n return $db->createCommand($commandConfig);\n }", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();" ]
[ "0.8010746", "0.7333379", "0.72606754", "0.7164165", "0.716004", "0.7137585", "0.6748632", "0.67234164", "0.67178184", "0.6697025", "0.6677973", "0.66454077", "0.65622073", "0.65437883", "0.64838654", "0.64696646", "0.64292693", "0.6382209", "0.6378306", "0.63773245", "0.6315901", "0.6248427", "0.6241929", "0.6194334", "0.6081284", "0.6075819", "0.6069913", "0.60685146", "0.6055616", "0.6027874", "0.60132784", "0.60118896", "0.6011778", "0.5969603", "0.59618074", "0.5954538", "0.59404427", "0.59388787", "0.5929363", "0.5910562", "0.590651", "0.589658", "0.589658", "0.589658", "0.58692765", "0.58665586", "0.5866528", "0.58663124", "0.5852474", "0.5852405", "0.58442044", "0.58391577", "0.58154446", "0.58055794", "0.5795853", "0.5780188", "0.57653266", "0.57640004", "0.57584697", "0.575748", "0.5742612", "0.5739361", "0.5732979", "0.572247", "0.5701043", "0.5686879", "0.5685233", "0.56819254", "0.5675983", "0.56670785", "0.56606543", "0.5659307", "0.56567776", "0.56534046", "0.56343585", "0.56290466", "0.5626615", "0.56255764", "0.5608852", "0.5608026", "0.56063116", "0.56026554", "0.5599553", "0.5599351", "0.55640906", "0.55640906", "0.5561977", "0.5559745", "0.5555084", "0.5551485", "0.5544597", "0.55397296", "0.5529626", "0.552908", "0.552908", "0.552908", "0.552908", "0.552908", "0.552908", "0.552908", "0.552908" ]
0.0
-1
Execute the console command.
public function handleEconomy() { $crawler = $this->client->request('GET', 'http://www.tabula.ge/ge/economy'); $newscard = $crawler->filter('.newscard'); $newscard->each(function($node){ $arr = []; $img = $node->filter('img'); if($img->count()){ $arr['img'] = $img->attr('src'); }; $title = $node->filter('.title'); if($title->count()){ $arr['title'] = $title->text(); }; $link = $node->filter('a')->link()->getURI(); $arr['link'] = $link; $date = explode(" ",$node->filter('.meta time')->text()); $year = substr($date[2],0,-1); $month = $this->months[$date[1]]; $day = $date[0]; $hour = $date[3]; $dateString=date_create("$year-$month-$day $hour"); $arr['date'] = date_format($dateString, "Y/m/d H:i"); $this->economy[] = $arr; }); return $this->economy; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function handle()\n {\n\t\t$this->info('league fetching ..');\n $object = new XmlFeed();\n\t\t$object->fetchLeague($this->argument('sports_id'));\n\t\t$this->info('league saved');\n }", "public function handle()\n {\n //get us the Converter class instance and call the convert() method on it.\n $this->info(\n \\Aregsar\\Converter\\ConverterFacade::convert($this->argument(\"currency\"))\n );\n }", "public function handle()\n {\n $this->locale = $this->argument('locale');\n\n $this->loadGroupLines();\n\n $this->loadNameSpacedLines();\n\n $this->info('Complete');\n }", "public function handle()\n {\n $this->importUser($this->argument('username'));\n $this->call('ldap:show-user', $this->arguments());\n }", "public function handle() {\n $user = User::where('id', $this->argument('userId'))->first();\n $this->info($user->email);\n }", "public function handle()\n {\n $translations = collect(json_decode(file_get_contents('https://raw.githubusercontent.com/getbible/Bibles/master/translations.json')))->flatten();\n switch($this->argument('action')) {\n case 'fetch':\n $this->fetchBibles($translations);\n break;\n case 'convert':\n $this->convertBibles($translations);\n break;\n }\n }", "public function handle()\n {\n try {\n $evalstr = $this->evaluater->evaluate($this->argument('evalString'));\n $this->info($evalstr);\n } catch (ForbiddenSymbolsException $exception) {\n $this->error($exception->getMessage());\n } catch (IncorrectSymbolsException $exception) {\n $this->error($exception->getMessage());\n }\n }", "public function handle()\n {\n\n $settings = Setting::fetch();\n $id = $this->argument('id');\n $this->scrape_game_data($id);\n }", "public function handle()\n {\n // env('CALENDARINDEX_TOKEN', '6f2bd927201ba4b22bb57df08db0c517e51732de')\n $this->getData($this->argument('country'), $this->argument('region'));\n }", "public function handle()\n {\n $email = $this->argument('email');\n $name = $this->argument('name');\n\n $this->info(\"starting to generate users details\");\n\n }", "public function handle()\n {\n\t\t$this->info('Importing translations...');\n\n\t\t$this->manager->importTranslations(true);\n }", "public function handle()\n {\n $user = null;\n\n if ($email = $this->option(\"email\", false)) {\n $user = $this->findByEmail($email);\n }\n\n if ($id = $this->option(\"id\", false)) {\n $user = $this->findById($id);\n }\n\n if (empty($user)) {\n $this->warn(\"User no found\");\n }\n else {\n $this->setRoleToUser($user);\n }\n }", "public function handle()\n {\n $name = ucwords($this->argument('name'));\n $this->call('repository:contract', [ 'name' => $name ]);\n $this->call('repository:class', [ 'name' => $name, '--driver' => $this->option('driver') ]);\n }", "public function handle()\n\t{\n\t\t// Superuser\n\t\tif( ! $this->option('no-superuser'))\n\t\t\t$this->call('setup:superuser');\n\n\t\t// Countries\n\t\tif( ! $this->option('no-countries'))\n\t\t\t$this->call('setup:countries', ['country' => array_filter(explode(',', $this->option('countries')))]);\n\n\t\t// Languages\n\t\tif( ! $this->option('no-languages'))\n\t\t\t$this->call('setup:languages', ['language' => array_filter(explode(',', $this->option('languages')))]);\n\n\t\t// Currencies\n\t\tif( ! $this->option('no-currencies'))\n\t\t\t$this->call('setup:currencies', ['currency' => array_filter(explode(',', $this->option('currencies')))]);\n\n\t\t// Clear cache\n\t\t$this->call('cache:clear');\n\t}", "public function handle()\n\t{\n\t\t$name = $this->argument('name');\n\t\t\n\t\t$this->info(\"Searching eve api for {$name}\");\n\t\t$result = Corporation::searchEVEAPI($name);\n\n\t\t$this->info(\"results\");\n\t\tforeach($result as $corp)\n\t\t{\n\t\t\tprint $corp->name . \" \" . $corp->id . \"\\r\\n\";\n\t\t}\n\t}", "public function handle()\n {\n $user = $this->argument('user');\n $this->info('Display this on the screen, user ' . $user);\n return 0;\n }", "public function handle()\n {\n $this->userVectors->test($this->option('force'));\n }", "public function handle()\n {\n $mapping = $this->formatMappingName((string)$this->argument('mapping'));\n \n $model = $this->option('model') ? $this->formatModelName($this->option('model')) : null;\n \n $this->filesystem->put(\n $this->buildMappingFilePath($mapping),\n $this->buildMapping(\n $this->getDefaultStub(),\n $mapping,\n $model\n )\n );\n \n $this->composer->dumpAutoloads();\n }", "public function handle()\n {\n switch ($this->argument('type')) {\n case 'dns':\n $this->dnscheck->run($this->option('dry-run') ? true : false, $this->argument('domain'));\n break;\n case 'whois':\n $this->whoischeck->run($this->option('dry-run') ? true : false, $this->argument('domain'));\n break;\n }\n }", "public function handle()\n {\n $option = $this->argument('option');\n\n if (! in_array($option, ['expired', 'all'])) {\n return $this->error('Invalid option supplied to command...');\n }\n\n $this->comment('Beginning pruning process...');\n\n $this->comment($this->pruneDatabase($option) . ' deleted from database...');\n\n $this->comment($this->pruneFiles($option) . ' deleted from files...');\n\n $this->info('Nonces pruned successfully!');\n }", "public function handle()\n {\n $subscriptionUpdateService = new SubscriptionUpdateService();\n $subscriptionUpdateService->runUpdates();\n }", "public function handle()\n\t{\n\t\t\n\t\t$source_directory = $this->argument( 'source_directory' );\n\t\t$target_directory = $this->argument( 'target_directory' );\n\t\t$template = (string) $this->option( 'template' );\n\n\t\t$statik = new \\App\\Statik\\Statik;\n\n\t\t$statik->generateHTMLFiles( $this, $source_directory, $target_directory, $template ) && $this->info( \"\\e[1;32mDONE!\" );\n\n\t}", "public function handle()\n {\n if (!$this->argument('file')) {\n $this->info('Please specify file to call.');\n }\n\n $file = $this->argument('file');\n\n if (!$this->fileHandler->exists($file)) {\n $this->info('Wrong path or file not exist.');\n }\n\n $this->executeFile($file);\n }", "public function handle()\n {\n $user = $this->argument('user');\n $this->scanner->setUserName($user);\n $this->scanner->scanUser();\n }", "public function handle()\n {\n if ($this->argument('user')) {\n $userId = $this->argument('user');\n\n $this->info(\"Liquidate affiliate commission for user \" . $userId);\n\n $user = $this->userService->findById($userId);\n\n if ($user) {\n $this->walletService->liquidateUserBalance($user);\n } else {\n $this->error(\"User not found\");\n }\n\n $this->info(\"Done\");\n } else {\n $this->info(\"Liquidate all commissions\");\n\n $this->walletService->liquidateAllUsersBalance();\n\n $this->info(\"Done\");\n }\n }", "public function handle()\n {\n $action = $this->choice('what action do you have on mind', [\n 'add-relation', 'remove-columns', 'column-type', 'rename-column'\n ]);\n switch ($action) {\n case 'add-relation':\n $this->addRelation();\n break;\n\n case 'remove-columns':\n $this->removeColumns();\n break;\n case 'column-type':\n $this->columnType();\n break;\n case 'rename-column':\n $this->renameColumn();\n break;\n default:\n $this->error('Unsupported action requested...');\n }\n $this->info('Command executed successfully');\n }", "public function handle()\n {\n $arguments = $this->arguments();\n $storageDir = $arguments['storageDir'];\n $localStorageDir = $arguments['localStorageDir'];\n $url = $arguments['url'];\n $cmd = sprintf(\"./app/Console/Commands/ShellScripts/screen_shot.sh %s %s %s\", $storageDir, $localStorageDir, $url);\n\n while (true) {\n $result = shell_exec($cmd);\n print_r($result);\n sleep(3);\n }\n }", "public function handle()\n {\n $city = $this->argument('city');\n\n $weatherService = new CurrentWeatherService();\n try {\n $weather = $weatherService->getByCity($city);\n } catch (WeatherException $e) {\n $this->error($e->getMessage());\n return;\n }\n\n $this->info('Weather for city '.$city);\n dump($weather->toArray());\n }", "public function handle()\n {\n $this->getModels($this->argument('model'));\n $this->getLanguages($this->argument('locale'));\n $this->createMultiLanguageRecords();\n }", "public function handle()\n {\n $this->processOptions();\n\n echo json_encode( $this->dateTimeRange ) . \"\\n\";\n\n $this->dispatch( new ProcessNewActionsJob(\n $this->dateTimeRange ,\n str_random( 16 ),\n $this->option('runtime-threshold')\n ) );\n }", "public function handle()\n {\n $fightId = $this->argument('fight_id');\n $metricId = $this->argument('metric_id');\n //$strategyName = 'App\\\\'.$this->argument('metric_name');\n\n $metric = BossMetric::find($metricId);\n if ($metric === null) {\n $this->error(\"Error: no metric with id: $metricId found!\");\n return;\n }\n\n $fight = Fight::find($fightId);\n\n if ($fight === null) {\n $this->error(\"Error: no fight with id: $fightId found!\");\n return;\n }\n\n $strategy = $metric->getStrategy();\n $strategy->setFight($fight);\n $strategy->run();\n }", "public function handle()\n {\n\t\t$this->call('vendor:publish');\n\t\t$this->call('migrate');\n\t\t$this->call('db:seed');\n\t\t$this->call('factotum:storage');\n\t\t$this->call('factotum:storage');\n }", "public function handle()\n {\n $user_id = $this->argument('user') ?? null;\n\n if (is_null($user_id)) {\n $users = User::all();\n\n foreach ($users as $user) {\n $this->showUserBalance($user);\n }\n } else {\n $user = User::find($user_id);\n\n $this->showUserBalance($user);\n }\n }", "public function handle()\n {\n $this->capsuleService->getAll();\n $this->line('Command Worked');\n }", "public function handle()\n {\n $platform_wechat_id = $this->argument('id');\n $customer_id = $this->argument('customer_id');\n $this->info(\"Starting at \".date('Y-m-d H:i:s').\". Running initial for 【{$this->signature}】\");\n $this->getUserInfoList($platform_wechat_id,$customer_id);\n $this->info(\"End at \".date('Y-m-d H:i:s').\". over for 【{$this->signature}】\");\n }", "public function handle()\n {\n $this->publishAssets();\n $this->call('twill:flush-manifest');\n $this->call('view:clear');\n }", "public function handle()\n {\n \n $argument = $this->argument('data');\n \n $this->prepare( $argument );\n \n $this->make();\n \n $this->info( 'migration has been created : '. $this->fileName );\n \n }", "public function handle()\n {\n chdir(resource_path('assets/ts'));\n $path = $this->argument(\"path\");\n if(isset($path))\n {\n Logger::info('execute '.$path);\n Command::executeRaw('tsc', [\"-p\", $path]);\n }else\n Logger::info('execute tsc');\n Command::executeRaw('tsc');\n }", "public function handle()\n {\n $this->info('Starting date change command.');\n\n Word::where('language_id', 1)->update(array('created_at' => '1970-01-01 00:00:01'));\n Word::where('language_id', 2)->update(array('created_at' => '1970-01-01 00:00:01'));\n\n $this->info('Dates have been changed to 1970-01-01 00:00:01');\n }", "public function handle()\n {\n $this->info($this->slugger->encode($this->argument('id')));\n }", "public function handle()\n {\n $this->line(static::$logo);\n $this->line('Neat admin current version:' . Neat::version());\n\n $this->comment('');\n $this->comment('Available commands:');\n\n $this->listAvailableCommands();\n }", "public function handle()\n {\n $this->revisions->updateListFiles();\n }", "public function handle(): void\n {\n // Set argument\n $this->url = $this->argument(self::URL_ARGUMENT);\n\n // Handler takes care of computation\n (new CommandHandler($this))->compute();\n }", "public function handle()\n {\n try\n {\n $filename = $this->argument('filename');\n Excel::import(new ObjectsImport, $filename);\n\n $this->info('Data import is now completed');\n }\n catch(Exception $ex)\n {\n $this->error($ex->getMessage());\n }\n }", "public function handle() {\n $entity = $this->validateEntity($this->argument('entity'));\n $job = new DataProcessingJob($entity, str_random(16));\n $this->dispatch($job);\n }", "public function handle()\n {\n $isProductionMode = 'prod' == $this->argument('mode');\n\n if ($isProductionMode) {\n if (!$this->confirm('Are you sure to run in production mode? Running this command may cause critical issues?')) {\n exit(1);\n }\n }\n\n $this->_recalculate($isProductionMode);\n }", "public function handle()\n {\n if(!$this->verify()) {\n $rank = $this->createRankSuperAdmin();\n $user = $this->createUserSuperAdmin();\n $user->Ranks()->attach($rank);\n $this->line('Felicitaciones');\n } else {\n $this->error('No se puede ejecutar');\n }\n }", "public function handle()\n {\n // Get CLI Input\n $user_id = $this->option(\"uid\");\n\n // User Products\n ( new CommandManager() )->showUserProducts( $user_id );\n }", "public function handle()\n {\n $force = $this->option('force');\n\n if($this->option('without-bulk')){\n $this->withoutBulk = true;\n }\n\n if ($this->generateClass($force)){\n $this->info('Generating permissions for '.$this->modelBaseName.' finished');\n }\n }", "public function handle()\n {\n $tournaments = Tournament::all()->toArray();\n foreach ($tournaments as $tournament) {\n $slug = $this->tournamentRepoObj->generateSlug($tournament['name'].Carbon::createFromFormat('d/m/Y', $tournament['start_date'])->year,'');\n DB::table('tournaments')\n ->where('id', $tournament['id'])\n ->update([\n 'slug' => $slug\n ]);\n }\n $this->info('Script executed.');\n }", "public function handle()\n {\n $userId = $this->argument('user');\n\n /** @var User $user */\n $user = User::findOrFail($userId);\n\n // Get token.\n $info = (new Client())->auth();\n\n // Save to db.\n $user->access_token = $info['access_token'];\n $user->access_secret = $info['access_secret'];\n $user->save();\n\n $this->line(\"Saved access token and secret for user: {$user->email}\");\n }", "public function handle()\n {\n $m = new MemberFromText;\n $m->train();\n $id = $m->predict($this->argument('text'));\n dump(Miembro::find($id)->toArray());\n }", "public function handle()\n {\n $this->generator\n ->setConsole($this)\n ->run();\n }", "public function handle()\n {\n $this->createController();\n $this->createServiceDir();\n\n exit;\n $args = [\n '--provider' => TestProvider::class\n ];\n $className = $this->argument('className');\n if (!$className) {\n $className = 'MethodsList';\n }\n $className = ucwords($className);\n $this->call('vendor:publish', $args);\n $this->info('Display this on the screen ' . $className);\n }", "public function handle()\n {\n $this->createDirectories();\n\n $this->publishTests();\n\n $this->info('Authentication tests generated successfully.');\n }", "public function handle()\n {\n $this->setDbConnection(\n $this->input->getOption('database') ?: config('ghost-database.default_connection')\n );\n\n $native = $this->input->getOption('native-import') ?: config('ghost-database.use_native_importer');\n\n $snapshot = $this->import($native);\n\n $this->info(\"Snapshot `{$snapshot->name}` loaded!\");\n }", "public function handle()\n {\n $exec = $this->argument('exec');\n\n switch ($exec) {\n case 'download' :\n $this->download();\n break;\n\n case 'generate' :\n $this->generate();\n break;\n\n default :\n echo \"Choose 'download' or 'generate' for this command\";\n break;\n }\n }", "public function handle()\n {\n $this->call('ziggy:generate', ['path' => './resources/js/ziggy-admin.js', '--group' => 'admin']);\n $this->call('ziggy:generate', ['path' => './resources/js/ziggy-frontend.js', '--group' => 'frontend']);\n $this->call(TranslationsGenerateCommand::class);\n }", "public function handle()\n {\n $tenantName = $this->argument('tenant');\n\n $tenant = Tenant::where('name', $tenantName)->orWhere('subdomain', $tenantName)->first();\n\n if ($tenant) {\n $tenant->setActive();\n \\Artisan::call('tinker');\n } else {\n $this->error('Error: Tenant not found');\n }\n }", "public function handle()\n {\n try {\n if (!empty($userId = $this->argument('user'))) {\n $user = User::find($userId);\n } else {\n $user = User::inRandomOrder()->first();\n }\n\n if (empty($user)) {\n throw new \\Exception('User not found');\n }\n\n echo JWTAuth::fromUser($user);\n } catch (\\Exception $e) {\n echo $e->getMessage();\n }\n\n }", "public function handle()\n {\n $this->fetchAndSetToken();\n $imagesToDownload = $this->peekImages(WatchedApp::pluck('package_name'));\n $this->fetchImages($imagesToDownload);\n\n if ($this->option('dont-optimize')) {\n return;\n }\n\n $this->runOptimizeCommand();\n }", "public function handle()\n {\n $this->setCryptIVFromUrl($this->argument('url'));\n\n $participant = URLParser::parseByName('santa.index', $this->argument('url'))->participant;\n if($participant) {\n $draw = $participant->draw;\n } else {\n $draw = URLParser::parseByName('organizer.index', $this->argument('url'))->draw;\n }\n\n $this->table(\n ['ID', 'Name', 'Email'],\n $draw->participants()->get(['id', 'name', 'email'])->toArray()\n );\n }", "public function handle()\n {\n // if you are on the local environment\n if (!(app()->isLocal() || app()->runningUnitTests())) {\n $this->error('This command is only available on the local environment.');\n return;\n }\n\n $fqdn = $this->argument('fqdn');\n if ($tenant = Tenant::retrieveBy($fqdn)){\n $tenant->delete($fqdn);\n $this->info(\"Tenant {$fqdn} successfully deleted.\");\n }else {\n $this->error('This fqdn doesn\\'t exist.');\n }\n\n }", "public function handle()\n {\n $user_from = $this->option('from');\n $user_to = $this->option('to');\n $sum = $this->option('sum');\n\n CreateTransaction::dispatch($this->usersRepository->getByID($user_from), $this->usersRepository->getByID($user_to), $sum, true);\n $this->transactionsRepository->getAll()->each(function ($transaction){\n \tExecuteTransaction::dispatch($transaction);\n });\n }", "public function handle()\n {\n $this->warn('Starting Retrieve Data');\n\n PeopleService::retrieveData();\n\n $this->info('Retrieve Data Completed');\n }", "public function handle()\n {\n \n $period = $this->option('period');\n \n switch ($period) {\n\n case 'half_month':\n $this->info('Grabing Half Month Income...');\n $this->halfMonth();\n break;\n\n case 'monthly':\n $this->info('Grabing Monthly Income...');\n $this->monthly();\n break;\n \n default:\n $this->info('Grabing Daily Income...');\n $this->daily();\n break;\n\n }\n\n \n }", "public function handle()\n {\n $countryFiles = $this->getFiles();\n\n foreach ($countryFiles as $fileName) {\n $this->seed($fileName);\n }\n\n $this->info('End.');\n }", "public function fire()\n {\n $entityName = $this->argument('entityName');\n $startEntityId = $this->argument('startEntityId');\n $endEntityId = $this->argument('endEntityId');\n $depth = $this->argument('depth');\n\n $this->fixturePath = $this->option('outputPath');\n\n $this->info(\"Generating fixtures for $entityName in {$this->fixturePath}...\");\n \n $this->generateFixtures($entityName, $startEntityId, $endEntityId, $depth);\n }", "public function handle()\n {\n $check = PublishTraitsService::publishTraits();\n\n if ($check)\n {\n $this->info('All files have been published');\n }\n\n $this->info('Failed to publish');\n }", "public function handle()\n {\n $user = User::where('username', $this->argument('user'))\n ->orWhere('email', $this->argument('user'))\n ->first();\n\n if ($user != null) {\n $user->assign('admin');\n $this->line(\"{$user->email} was successfully made an admin.\");\n } else {\n $this->line(\"No user found where username or email is '{$this->argument('user')}'\");\n }\n }", "public function handle()\n {\n event( 'laraview:compile' );\n $this->checkForSelectedViewGeneration();\n\n app( RegisterBlueprint::class )\n ->console( $this )\n ->generate();\n }", "public function handle()\n {\n $project = Project::with(['team.admins', 'team.members'])->findOrFail($this->option('project-id'));\n $user = User::findOrFail($this->option('user-id'));\n if ($this->option('admin')) {\n $project->team->admins()->syncWithoutDetaching($user);\n } else {\n $project->team->members()->syncWithoutDetaching($user);\n }\n return Command::SUCCESS;\n }", "public function handle() {\n try {\n $this->roomService->loadRoomOccupations();\n Log::notice('untis:occupations executed successfully.');\n $this->line('Loaded room occupations from WebUntis.');\n } catch (Exception $e) {\n Log::error('Error loading room occupations.', ['exception' => $e]);\n $this->error('Error loading room occupations: ' . $e->getMessage());\n }\n }", "public function handle()\n {\n $this->loadIxList();\n $this->loadIxMembersList();\n $this->updateIxInfo();\n $this->updateIxMembersInfo();\n }", "public function handle()\n {\n $this->call('vendor:publish', [\n '--provider' => \"Qoraiche\\MailEclipse\\MailEclipseServiceProvider\",\n ]);\n }", "public function handle()\n\t{\n\t\tif ($this->option('dev')) {\n\t\t\tsystem('php '.base_path('.deploy/deploy-dev.php'));\n\t\t} else {\n\t\t\tsystem('php '.base_path('.deploy/deploy.php'));\n\t\t}\n\t}", "public function handle(Command $command);", "public function handle(Command $command);", "public function handle()\n {\n $date_from = $this->argument('date_from');\n\t\t$date_to = $this->argument('date_to');\n\t\tif(!$date_from) {\n\t\t\t$date_from = Carbon::today()->subDays(5);\n\t\t}\n\t\tif(!$date_to) {\n\t\t\t$date_to = Carbon::yesterday();\n\t\t}\n\t\tStats::computeMembers($this->argument('venue_id'), $date_from, $date_to);\n }", "public function handle()\n {\n switch ($this->argument('type')){\n case 'fih':\n $scrapper = new Scrappers\\FederationScrapper();\n $scrapper->get($this->option('level'));\n print $scrapper->message();\n break;\n }\n }", "public function handle()\n {\n Log::info(\"seed:dash Command is working fine!\");\n $this->info('Dashboard Database seeding completed successfully.');\n }", "public function handle()\n {\n $originalId = $this->argument('original_id');\n\n $status = true;\n if ($this->option('status') === 'false') {\n $status = false;\n }\n\n if ($video = Video::where('original_id', $originalId)->first()) {\n $video->dmca_claim = $status;\n $video->save();\n\n $this->info('Video\\'s dmca_claim set to: ' . json_encode($status));\n return ;\n }\n\n $this->error('No video found with original_id of: ' . $originalId);\n return;\n }", "public function handle()\n {\n $this->call('config:clear');\n\n $this->call('config:update');\n\n $this->info('Configuration cached successfully!');\n }", "public function handle()\n {\n //\n $modelName = $this->argument('model');\n $column = $this->argument('column');\n $this->generateMutation($modelName, $column);\n\n }", "public function handle()\n {\n $filePath = 'public/' . $this->argument('fileName');\n $count = $this->argument('count');\n \n $fileData = array_slice(file($filePath), 0, $count);\n $this->info(implode('', $fileData));\n }", "public function handle()\n {\n $email = $this->argument('email');\n\n Mail::to($email)->send(new SendMailable('Test Mail'));\n\n if (Mail::failures()) {\n $this->info('Email failed to send');\n } else {\n $this->info('Email successfully sent');\n }\n }", "public function handle()\n {\n $this->call('route:trans:clear');\n\n $this->cacheRoutesPerLocale();\n\n $this->info('Routes cached successfully for all locales!');\n }", "public function handle()\n {\n $this->info('Welcome to command for Bantenprov\\WilayahIndonesia package');\n }", "public function handle()\n {\n if($this->hasOption('no_dump') && $this->option('no_dump')){\n $this->composer_dump = false;\n }\n $this->readyDatas();\n $this->datas['startSymbol']='{{';\n $this->datas['endSymbol']='}}';\n $this->create();\n }", "public function handle()\n {\n $repository = new OglasiCrawlerRepository();\n $ads = $repository->getAds();\n $repository->saveAds($ads);\n\n echo 'Ads were successfully retrieved' . PHP_EOL;\n }", "public function handle()\n {\n $this->makeDir($this->basePath . $this->kebabPlural());\n\n $this->exportViews();\n\n $this->info('Resource views generated successfully.');\n }", "public function handle()\n {\n $movies = \\App\\Models\\Movie::whereNull('meta')->take(40)->orderBy('id')->get();\n $movies->each(function($movie){ sleep(1); $movie->getMeta(); });\n return Command::SUCCESS;\n }", "public function handle()\n {\n $this->packageGenerator->setConsole($this)\n ->setPackage($this->argument('package'))\n ->setType('shipping')\n ->setForce($this->option('force'))\n ->generate();\n }", "public function handle()\n {\n $test = $this->argument('test');\n\n $dir = config('speed-test.dir');\n\n $className = ucfirst(\\Str::camel($test));\n\n $namespace = config('speed-test.namespace');\n\n $class = class_entity($className)\n ->namespace($namespace);\n\n $class->method('speed1')\n ->line($this->option('line'))->doc(function ($doc) use ($className) {\n /** @var DocumentorEntity $doc */\n $doc->tagCustom('times', $this->option('times'));\n $doc->description($this->option('description') ?: \"{$className} Speed 1\");\n });\n\n if (! is_dir($dir)) {\n mkdir($dir, 0777, 1);\n }\n\n file_put_contents(\n $dir.'/'.$className.'.php',\n $class->wrap('php')\n );\n\n $this->info('Speed created!');\n\n return 0;\n }", "public function handle()\n {\n $message = $this->GenerateRandomUser($this->argument('count'));\n $this->info($message);\n }", "public function handle()\n {\n $host = Cache::get('executingHost', null);\n $this->info(\"Host: ${host}\");\n\n if ($host === null) {\n $this->info('実行するホストが選択されていません');\n return;\n }\n\n if (Schema::hasTable('companies') && Company::count() !== 0) {\n $this->info('マイグレーションが既に1回以上実行されています');\n return;\n }\n\n $should_execute = $host === $this->argument('executingHost');\n\n if ($should_execute) {\n Artisan::call('migrate:fresh', ['--seed' => true]);\n $this->info('マイグレーションが完了しました');\n\n Cache::forget('executingHost');\n } else {\n $this->info('別ホストにてマイグレーションが行われます');\n }\n }", "public function handle()\n {\n // Configuration...\n $this->callSilent('vendor:publish', ['--tag' => 'model-login-config']);\n\n // Migrations\n $this->callSilent('vendor:publish', ['--tag' => 'model-login-migrations']);\n\n $this->info('Model Login resources published.');\n }", "public function handle()\n {\n if ($this->validation()) {\n $money = $this->argument('money');\n Cache::increment('amount', $money);\n }\n }", "public function handle()\n {\n $this->info('Publishing stuff..');\n\n $this->publishFiles();\n\n $this->info('Setup complete. Enjoy!');\n }", "public function handle()\n {\n $this->publishConfig();\n $this->publishClassStub();\n $this->generateAndStoreKey();\n\n $this->info('Use the details below for your \"Lead delivery options\" in Google Ads.');\n $this->info('Webhook URL: ' . route('GoogleAdsLeadExtensionController@index'));\n $this->info('Key: ' . $this->generated_key);\n }", "public function handle()\n {\n $opts = $this->options();\n $args = $this->arguments();\n #print_r($opts);\n #print_r($args);\n\n # Redundant as argument validation handled by Laravel\n #\n if (!isset($args['destination'])) {\n printf(\"Usage: php artisan %s\\n\", $this->signature);\n exit(1);\n }\n\n # Default to normal message type\n #\n if (!isset($opts['type'])) {\n $opts['type'] = 'normal';\n }\n\n $uac = new UserApiController();\n\n if ($opts['type'] == 'normal') {\n if (!isset($opts['message'])) {\n printf(\"Usage: php artisan %s\\n\\n\", $this->signature);\n printf(\"ERROR: Message must be specified for type 'normal'\\n\");\n exit(1);\n }\n $result = $uac->sendSms(\n $args['destination'],\n $opts['message'],\n $opts['route']\n );\n }\n else if ($opts['type'] == 'otp') {\n $result = $uac->sendVerificationSms(\n $args['destination'],\n '<code>',\n '<name>',\n $opts['route'],\n '<appName>'\n );\n }\n\n if ($result === true) {\n printf(\"INFO: SMS message to %s sent successfully (%s)\\n\",\n $args['destination'], $opts['type']);\n }\n else {\n printf(\"INFO: SMS message to %s failed to send (%s)\\n\", \n $args['destination'], $opts['type']);\n printf(\"ERROR: %s\\n\", $result);\n }\n\n return;\n }" ]
[ "0.6469962", "0.6463639", "0.64271367", "0.635053", "0.63190264", "0.62747604", "0.6261977", "0.6261908", "0.6235821", "0.62248456", "0.62217945", "0.6214421", "0.6193356", "0.61916095", "0.6183878", "0.6177804", "0.61763877", "0.6172579", "0.61497146", "0.6148907", "0.61484164", "0.6146793", "0.6139144", "0.61347336", "0.6131662", "0.61164206", "0.61144686", "0.61109483", "0.61082935", "0.6105106", "0.6103338", "0.6102162", "0.61020017", "0.60962653", "0.6095482", "0.6091584", "0.60885274", "0.6083864", "0.6082142", "0.6077832", "0.60766655", "0.607472", "0.60739267", "0.607275", "0.60699606", "0.6069931", "0.6068753", "0.6067665", "0.6061175", "0.60599935", "0.6059836", "0.605693", "0.60499364", "0.60418284", "0.6039709", "0.6031963", "0.6031549", "0.6027515", "0.60255647", "0.60208166", "0.6018581", "0.60179937", "0.6014668", "0.60145515", "0.60141796", "0.6011772", "0.6008498", "0.6007883", "0.60072047", "0.6006732", "0.60039204", "0.6001778", "0.6000803", "0.59996396", "0.5999325", "0.5992452", "0.5987503", "0.5987503", "0.5987477", "0.5986996", "0.59853584", "0.5983282", "0.59804505", "0.5976757", "0.5976542", "0.5973796", "0.5969228", "0.5968169", "0.59655035", "0.59642595", "0.59635514", "0.59619296", "0.5960217", "0.5955025", "0.5954439", "0.59528315", "0.59513766", "0.5947869", "0.59456027", "0.5945575", "0.5945031" ]
0.0
-1
Register any authentication / authorization services.
public function boot() { $this->registerPolicies(); // policy category controller Gate::define('list_category', 'App\Policies\CategoryPolicy@viewAny'); Gate::define('delete_category', 'App\Policies\CategoryPolicy@delete'); Gate::define('edit_category', 'App\Policies\CategoryPolicy@update'); Gate::define('add_category', 'App\Policies\CategoryPolicy@create'); // policy role controller Gate::define('list_role', 'App\Policies\AuthorizationRolePolicy@viewAny'); Gate::define('delete_role', 'App\Policies\AuthorizationRolePolicy@delete'); Gate::define('edit_role', 'App\Policies\AuthorizationRolePolicy@update'); Gate::define('create_role', 'App\Policies\AuthorizationRolePolicy@create'); // policy user controller Gate::define('list_user', 'App\Policies\UserPolicy@viewAny'); Gate::define('delete_user', 'App\Policies\UserPolicy@delete'); Gate::define('edit_user', 'App\Policies\UserPolicy@update'); Gate::define('create_user', 'App\Policies\UserPolicy@create'); // policy book controller Gate::define('list_book', 'App\Policies\BookPolicy@viewAny'); Gate::define('delete_book', 'App\Policies\BookPolicy@delete'); Gate::define('edit_book', 'App\Policies\BookPolicy@update'); Gate::define('create_book', 'App\Policies\BookPolicy@create'); // policy author controller Gate::define('list_author', 'App\Policies\AuthorPolicy@viewAny'); Gate::define('delete_author', 'App\Policies\AuthorPolicy@delete'); Gate::define('edit_author', 'App\Policies\AuthorPolicy@update'); Gate::define('create_author', 'App\Policies\AuthorPolicy@create'); // policy chapter controller Gate::define('list_chapter', 'App\Policies\ChapterPolicy@viewAny'); Gate::define('delete_chapter', 'App\Policies\ChapterPolicy@delete'); Gate::define('edit_chapter', 'App\Policies\ChapterPolicy@update'); Gate::define('create_chapter', 'App\Policies\ChapterPolicy@create'); // policy tag controller Gate::define('list_tag', 'App\Policies\TagPolicy@viewAny'); Gate::define('delete_tag', 'App\Policies\TagPolicy@delete'); Gate::define('edit_tag', 'App\Policies\TagPolicy@update'); Gate::define('create_tag', 'App\Policies\TagPolicy@create'); // policy rule controller Gate::define('list_rule', 'App\Policies\AuthorizationRulePolicy@viewAny'); Gate::define('delete_rule', 'App\Policies\AuthorizationRulePolicy@delete'); Gate::define('edit_rule', 'App\Policies\AuthorizationRulePolicy@update'); Gate::define('create_rule', 'App\Policies\AuthorizationRulePolicy@create'); // policy translator controller Gate::define('list_translator', 'App\Policies\TranslatorPolicy@viewAny'); Gate::define('delete_translator', 'App\Policies\TranslatorPolicy@delete'); Gate::define('edit_translator', 'App\Policies\TranslatorPolicy@update'); Gate::define('create_translator', 'App\Policies\TranslatorPolicy@create'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function registerServices()\n {\n $this->app->bind(SocialProvidersManager::class, SocialiteProvidersManager::class);\n\n $this->app->singleton(TwoFactor::class, function () {\n return new AuthyTwoFactor(new Client());\n });\n }", "private function registerServices() {\n // Modules\n $this->addService('modules', 'MyTravel\\Core\\Service\\Modules::setService');\n // Routing\n $this->addService('routing', 'MyTravel\\Core\\Service\\Routing::setService');\n // Event dispatcher\n $this->serviceContainer\n ->register('events', 'Symfony\\Component\\EventDispatcher\\EventDispatcher');\n // Database\n $this->addService('db', 'MyTravel\\Core\\Service\\Db::setService');\n // Access\n $this->addService('access', 'MyTravel\\Core\\Service\\Access::setService');\n }", "protected function registerServices(): void\n {\n $this->registerKernels();\n $this->registerFactories();\n $this->registerMicroServices();\n }", "public function registerAuth()\n {\n $this->container->make(DingoAuth\\Auth::class)->extend('jwt', function($app) {\n return new DingoAuth\\Provider\\JWT($app[\\Antares\\Modules\\Api\\Providers\\Auth\\JWT::class]);\n });\n }", "public function registerAuthServices(Container $container)\n {\n static $provider = null;\n\n if ($provider === null) {\n $provider = new AuthServiceProvider();\n }\n\n $provider->register($container);\n }", "public function registerServices() {\n\t\t$services = $this->getServices();\n\t\t$services = array_map( [ $this, 'instantiateServices' ], $services );\n\t\t\n\t\tarray_walk( $services, function ( Service $service ) {\n\t\t\t$service->register();\n\t\t} );\n\t}", "public static function register_services()\n {\n foreach ( self::get_services() as $class )\n {\n $service = self::instantiate( $class );\n if( method_exists( $service, 'register' ) )\n $service->register();\n }\n }", "public static function register_services()\n {\n foreach ( self::get_services() as $class ) {\n $service = self::instantiate( $class );\n if ( method_exists( $service, 'register' ) ) {\n $service->register();\n }\n }\n }", "public static function register_services()\n {\n foreach (self::get_services() as $class) {\n $service = self::instantiate($class);\n if (method_exists($service, 'register')) {\n $service->register();\n }\n }\n }", "public function register_services() {\n\t\t// Bail early so we don't instantiate services twice.\n\t\tif ( ! empty( $this->services ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$classes = $this->get_service_classes();\n\n\t\t$this->services = array_map(\n\t\t\t[ $this, 'instantiate_service' ],\n\t\t\t$classes\n\t\t);\n\n\t\tarray_walk( $this->services, function ( Service $service ) {\n\t\t\t$service->register();\n\t\t} );\n\t}", "protected function registerServices()\r\n\t{\r\n\r\n\t\t$di = new FactoryDefault();\r\n\r\n\t\t$loader = new Loader();\r\n\r\n\t\t/**\r\n\t\t * We're a registering a set of directories taken from the configuration file\r\n\t\t */\r\n\t\t$loader->registerDirs(\r\n\t\t\tarray(\r\n\t\t\t\t__DIR__ . '/../apps/library/',\r\n\t\t\t\t__DIR__ . '/../apps/plugins/'\r\n\t\t\t)\r\n\t\t)->register();\r\n\r\n\r\n\r\n\t\t//Registering a router\r\n\t\t$di->set('router', function(){\r\n\r\n\t\t\t$router = new Router();\r\n\r\n\t\t\t$router->setDefaultModule(\"frontend\");\r\n\t\t\t$router->setDefaultController(\"index\");\r\n\t\t\t$router->setDefaultAction(\"index\");\r\n\r\n $router->add(\"/register/recoveryPassword\", array(\r\n 'module' => 'frontend',\r\n 'controller' => 'register',\r\n 'action' => 'recoveryPassword',\r\n ));\r\n $router->add(\"/register/index\", array(\r\n 'module' => 'frontend',\r\n 'controller' => 'register',\r\n 'action' => 'index',\r\n ));\r\n\r\n $router->add(\"/help/about\", array(\r\n 'module' => 'frontend',\r\n 'controller' => 'help',\r\n 'action' => 'about',\r\n ));\r\n\r\n\t\t\t\r\n\t\t\t$router->add(\"/ajax/getlast\", array(\r\n\t\t\t\t'module' => 'frontend',\r\n\t\t\t\t'controller' => 'ajax',\r\n\t\t\t\t'action' => 'getlast',\r\n\t\t\t));\r\n\t\t\t\r\n\t\t\t$router->add(\"/:controller/:action/:params\", array(\r\n\t\t\t\t'module' => 'frontend',\r\n\t\t\t\t'controller' => 1,\r\n\t\t\t\t'action' => 2,\r\n\t\t\t\t'params'=>3\r\n\t\t\t));\r\n\r\n\t\t\t$router->add(\"/admin/:controller/:action/:params\", array(\r\n\t\t\t\t'module' => 'backend',\r\n\t\t\t\t'controller' => 1,\r\n\t\t\t\t'action' => 2,\r\n\t\t\t\t'params'=>3\r\n\t\t\t));\r\n\r\n// $router->add(\"/admin/register\", array(\r\n// 'module' => 'backend',\r\n// 'controller' => 'register',\r\n// 'action' => 'index',\r\n// ));\r\n\r\n\t\t\t$router->add(\"/admin\", array(\r\n\t\t\t\t'module' => 'backend',\r\n\t\t\t\t'controller' => 'login',\r\n\t\t\t\t'action' => 'index',\r\n\t\t\t));\r\n\r\n\t\t\t$router->add(\"/admin/\", array(\r\n\t\t\t\t'module' => 'backend',\r\n\t\t\t\t'controller' => 'login',\r\n\t\t\t\t'action' => 'index',\r\n\t\t\t));\r\n\r\n\t\t\t$router->add(\"/admin/login\", array(\r\n\t\t\t\t'module' => 'backend',\r\n\t\t\t\t'controller' => 'login',\r\n\t\t\t\t'action' => 'index',\r\n\t\t\t));\r\n\r\n\r\n\r\n//\t\t\t$router->notFound(array(\r\n//\t\t\t\t\"controller\" => \"index\",\r\n//\t\t\t\t\"action\" => \"page404\",\r\n//\t\t\t));\r\n\r\n\t\t\treturn $router;\r\n\r\n\t\t});\r\n\r\n\t\t$this->setDI($di);\r\n\t}", "public static function register_services(): void\n {\n foreach (self::get_services() as $class) {\n $service = self::instantiate($class);\n if (method_exists($class, 'register')) {\n $service->register();\n }\n }\n }", "public function register()\n {\n $this->registerAuthenticator();\n }", "public function register()\n {\n Auth::extend('sso', function ($app, $name, array $config) {\n // 返回一个 Illuminate\\Contracts\\Auth\\Guard 实例...\n return new OaGuard(Auth::createUserProvider($config['provider']),$app->make('request'));\n });\n\n Auth::provider('sso', function ($app, array $config) {\n return new OaUserProvider();\n });\n }", "public function registerServices(DiInterface $di)\n {\n self::acl($di);\n }", "public function registerServices(){\n }", "protected function registerServiceProviders()\n {\n foreach ($this->providers as $provider) {\n $this->app->register($provider);\n }\n }", "protected function registerServices()\n {\n\n $di = new FactoryDefault();\n\n /**\n * Read services\n */\n include CORE_PATH . \"/config/services.php\";\n\n /**\n * Get config service for use in inline setup below\n */\n $config = $di->getConfig();\n\n\n include CORE_PATH . '/config/loader.php';\n\n \n\n $this->setDI($di);\n }", "public function register()\n {\n // Only Environment local\n if ($this->app->environment() !== 'production') {\n foreach ($this->services as $serviceClass) {\n $this->registerClass($serviceClass);\n }\n }\n\n // Register Aliases\n $this->registerAliases();\n }", "public function register()\n {\n $this->registerRequestHandler();\n $this->registerAuthorizationService();\n $this->registerServices();\n }", "public function register()\n {\n API::error(function (AuthorizationException $exception)\n {\n //如果出现权限异常,请先检查策略是否有再服务提供者中进行绑定\n abort(403, $exception->getMessage());\n });\n\n API::error(function (AuthenticationException $exception)\n {\n abort(401, $exception->getMessage());\n });\n }", "public function register()\n {\n $this->mergeConfigFrom(__DIR__.'/../config/awesio-auth.php', 'awesio-auth');\n\n $this->app->singleton(AuthContract::class, Auth::class);\n\n $this->registerRepositories();\n\n $this->registerServices();\n\n $this->registerHelpers();\n }", "public function registerServices()\n {\n $this->app->bind('helpers.lib', function($app) {\n return new LibHelper;\n });\n $this->app->bind('helpers.theme', function($app) {\n return ThemeHelper::instance();\n });\n $this->app->bind('helpers.acf', function($app) {\n $helper = AcfHelper::instance();\n $helper->setThemeHelper($this->app['helpers.theme']);\n $helper->setLib($this->app['helpers.lib']);\n\n return $helper;\n });\n }", "protected function registerServiceProviders()\n {\n if ($this->active()->has('providers')) {\n $providers = $this->active()->get('providers');\n\n foreach ($providers as $provider) {\n App::register($provider);\n }\n }\n }", "public function registerDefaultServices()\n {\n /*\n * Add Paths to container\n */\n $this['basePath'] = $this->basePath();\n $this['storagePath'] = $this->basePath().'/storage';\n $this['appPath'] = $this->appPath();\n\n $this->register(new DefaultServices($this));\n\n $this->register(new ErrorHandlerService($this));\n\n // Enable debug based on user configuration\n if (true === $this->app->config->get('app')['debug']) {\n Debug::enable();\n }\n\n /*\n * retister View Provider\n */\n $this->register(new ViewServiceProvider($this));\n\n /*\n * Register Route Provider\n */\n $this->register(new RouteServiceProvider($this));\n\n /*\n * Register Database Provider\n */\n $this->register(new DatabaseServiceprovider($this));\n }", "public function registerServices()\n {\n /**\n * @var $container Container\n */\n $container = $this->getContainer();\n\n $services = $container->settings['services'];\n\n if (is_array($services) && !empty($services)) {\n foreach ($services as $service) {\n /**\n * @var $instance ServiceInterface\n */\n $instance = new $service();\n\n $container[$instance->name()] = $instance->register();\n\n unset($instance);\n }\n }\n\n unset($container, $services, $service);\n }", "public function register_services(): void {\n\t\t// Bail early so we don't instantiate services twice.\n\t\tif ( \\count( $this->service_container ) > 0 ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Add the injector as the very first service.\n\t\t$this->service_container->put(\n\t\t\tstatic::SERVICE_PREFIX . static::INJECTOR_ID,\n\t\t\t$this->injector\n\t\t);\n\n\t\t$services = $this->get_service_classes();\n\n\t\tif ( $this->enable_filters ) {\n\t\t\t/**\n\t\t\t * Filter the default services that make up this plugin.\n\t\t\t *\n\t\t\t * This can be used to add services to the service container for\n\t\t\t * this plugin.\n\t\t\t *\n\t\t\t * @param array<string, string> $services Associative array of identifier =>\n\t\t\t * class mappings. The provided\n\t\t\t * classes need to implement the\n\t\t\t * Service interface.\n\t\t\t */\n\t\t\t$filtered_services = apply_filters(\n\t\t\t\tstatic::HOOK_PREFIX . static::SERVICES_FILTER,\n\t\t\t\t$services\n\t\t\t);\n\n\t\t\t$services = $this->validate_services( $filtered_services );\n\t\t}\n\n\t\twhile ( null !== key( $services ) ) {\n\t\t\t$id = $this->maybe_resolve( key( $services ) );\n\n\t\t\t$class = $this->maybe_resolve( current( $services ) );\n\n\t\t\t// Delay registering the service until all requirements are met.\n\t\t\tif (\n\t\t\t\tis_a( $class, HasRequirements::class, true )\n\t\t\t) {\n\t\t\t\tif ( ! $this->requirements_are_met( $id, $class, $services ) ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$this->schedule_potential_service_registration( $id, $class );\n\n\t\t\tnext( $services );\n\t\t}\n\t}", "public function boot()\n\t{\n\t\t$this->registerPolicies();\n\n\t\tAuth::provider('api_token', function($app, array $config) {\n\t\t\treturn new ApiTokenUserProvider();\n\t\t});\n\n\t\tAuth::extend('api_token', function ($app, $name, array $config) {\n\t\t\t$guard = new ApiTokenGuard(\n\t\t\t\tAuth::createUserProvider($config['provider']),\n\n\t\t\t\t$app['request'],\n\t\t\t\t$config['input_key'] ?? 'api_token',\n\t\t\t\t$config['storage_key'] ?? 'api_token',\n\t\t\t\t$config['hash'] ?? true\n\t\t\t);\n\n\t\t\treturn $guard;\n\t\t});\n\n\t\tAuth::provider('firebase', function($app, array $config) {\n\t\t\treturn new FirebaseUserProvider();\n\t\t});\n\n\t\tAuth::extend('firebase', function ($app, $name, array $config) {\n\t\t\t$guard = new FirebaseGuard(\n\t\t\t\tAuth::createUserProvider($config['provider']),\n\n\t\t\t\t$app['request'],\n\t\t\t\t$config['input_key'] ?? 'token',\n\t\t\t\t$config['storage_key'] ?? 'token',\n\t\t\t\t$config['hash'] ?? true\n\t\t\t);\n\n\t\t\treturn $guard;\n\t\t});\n\t}", "public function register()\n {\n $this->registerServices();\n }", "protected function registerBaseServices()\n {\n $container = $this->getContainer();\n\n $container->share('logger', function () use ($container) {\n return new Logger($container->get('config'));\n });\n\n $this->registerService(new Providers\\ConfigProvider());\n $this->registerService(new Providers\\FileSystemProvider());\n $this->registerService(new Providers\\ParserManagerProvider());\n $this->registerService(new Providers\\BackendProvider());\n }", "public function register()\n\t{\n\t\t$this->registerAuthInstall();\n\t}", "public function registerServices() {\n\t\t$services = Config::inst()->get('FakeManager', 'services');\n\t\tif($services) {\n\t\t\tforeach($services as $origName => $fakeName) {\n\t\t\t\t$fakeObj = Injector::inst()->create($fakeName);\n\t\t\t\tif($this->db && $fakeObj instanceof FakeDatabaseConsumerInterface) {\n\t\t\t\t\t$fakeObj->setDb($this->db);\n\t\t\t\t}\n\t\t\t\t$this->services[$origName] = $fakeObj;\n\t\t\t\tInjector::inst()->registerService($fakeObj, $origName);\n\t\t\t}\n\t\t}\n\t}", "public function boot(): void\n {\n $this->registerPolicies();\n\n Auth::provider('null', fn (Application $app, array $config) => new NullUserProvider($config['model'] ?? IAPUser::class));\n\n Auth::provider('list', fn (Application $app, array $config) => new ListUserProvider($config['model'] ?? IAPUser::class, $config['list'] ?? []));\n\n Auth::provider('group', fn (Application $app, array $config) => new GroupUserProvider($config['model'] ?? IAPUser::class, $config['group'] ?? ''));\n\n Auth::provider('identity-group', fn (Application $app, array $config) => new IdentityGroupUserProvider($config['model'] ?? IAPUser::class, $config['group'] ?? ''));\n\n $this->viaRequest('firebase', [Guard\\Firebase_Guard::class, 'validate']);\n\n $this->viaRequest('gae-internal', [Guard\\AppEngine_Guard::class, 'validate']);\n $this->viaRequest('gae-iap', [Guard\\IAP_Guard::class, 'validate']);\n $this->viaRequest('gae-oidc', [Guard\\OIDC_Guard::class, 'validate']);\n $this->viaRequest('gae-oauth2', [Guard\\OAuth2_Guard::class, 'validate']);\n\n $this->viaRequest('gae-combined-iap', [Guard\\Combined\\IAP_Guard::class, 'validate']);\n $this->viaRequest('gae-combined-iap-oidc', [Guard\\Combined\\IAP_OIDC_Guard::class, 'validate']);\n $this->viaRequest('gae-combined-iap-oidc-oauth2', [Guard\\Combined\\IAP_OIDC_OAuth2_Guard::class, 'validate']);\n }", "public function register()\n {\n $this->registerAccountService();\n\n $this->registerCurrentAccount();\n\n //$this->registerMenuService();\n\n //$this->registerReplyService();\n }", "public function register(): void\n {\n /* @phpstan-ignore-next-line */\n $this->app->configure('auth');\n /* @phpstan-ignore-next-line */\n $this->app->configure('remote-token-auth');\n\n config([\n 'auth.guards.rta' => array_merge([\n 'driver' => 'remote-token-auth',\n ], config('auth.guards.rta', [])),\n ]);\n\n $this->registerAdapter();\n }", "public function register()\n\t{\n\t\t$this->registerCommands();\n\t\t$this->registerHybridAuth();\n\t}", "public function register(): void\n {\n $this->configure();\n $this->registerServices();\n }", "public function boot()\n {\n $this->registerPolicies();\n $this->registerPassport();\n }", "public function register(){\n $this->registerDependencies();\n $this->registerAlias();\n $this->registerServiceCommands();\n }", "public function register()\n {\n $this->registerServiceProviders();\n $this->registerSettingsService();\n $this->registerHelpers();\n }", "public function boot()\n {\n require __DIR__ . '/helpers.php';\n\n $this->app['auth']->extend('custom', function ($app, $name, array $config) {\n $guard = new Guard($name, $app['auth']->createUserProvider($config['provider']), $app['session.store']);\n $guard->setCookieJar($app['cookie']);\n $guard->setDispatcher($app['events']);\n $guard->setRequest($app->refresh('request', $guard, 'setRequest'));\n\n return $guard;\n });\n\n $this->app['auth']->provider('custom', function ($app) {\n return new EloquentUserProvider(\n $app[Hasher::class],\n $app[UserRepository::class],\n $app[TeamRepository::class]\n );\n });\n\n $this->registerPolicies();\n }", "public function registerServices($di)\n\t{\n\n\t\t//Registering a dispatcher\n\t\t$di->set(Services::DISPATCHER, function () {\n\t\t\t$eventsManager = new EventsManager;\n\n\t\t\t/**\n\t\t\t * Check if the user is allowed to access certain action using the SecurityPlugin\n\t\t\t */\n\t\t\t$eventsManager->attach('dispatch:beforeDispatch', new APISecurityPlugin);\n\n\t\t\t$dispatcher = new \\Phalcon\\Mvc\\Dispatcher();\n\t\t\t$dispatcher->setDefaultNamespace(\"Multiple\\\\API\\\\Controllers\");\n\t\t\t$dispatcher->setEventsManager($eventsManager);\n\n\t\t\treturn $dispatcher;\n\t\t});\n\n\t\t/**\n\t\t * Setting up the view component\n\t\t */\n\t\t//Registering a shared view component\n\t\t$di->set(Services::VIEW, function() {\n\t\t\t$view = new \\Phalcon\\Mvc\\View();\n\t\t\t$view->setViewsDir(APP_PATH.'app/modules/api/views/');\n\t\t\t$view->registerEngines(array(\".volt\" => 'volt'));\n\t\t\treturn $view;\n\t\t});\n\n\t\t/**\n\t\t * Setting up volt\n\t\t */\n\t\t$di->set(Services::VOLT, function($view, $di) {\n\t\t\t$volt = new VoltEngine($view, $di);\n\n\t\t\t$volt->setOptions(array(\n\t\t\t\t\"compiledPath\" => APP_PATH . \"cache/api/\"\n\t\t\t));\n\n\t\t\t$compiler = $volt->getCompiler();\n\t\t\t$compiler->addFunction('is_a', 'is_a');\n\n\t\t\treturn $volt;\n\t\t}, true);\n\n\n\t\t$di->setShared(Services::AUTH_MANAGER, function () use ($di) {\n\n\t\t\t$authManager = new AuthenticateManager(60000);\n\t\t\t$authManager->registerAdaptor(MobileAdaptor::NAME, new MobileAdaptor());\n\t\t\t$authManager->registerTokenParser(new TokenParser(\"mysecret\"));\n\n\t\t\treturn $authManager;\n\t\t});\n\n\t\t/**\n\t\t * @description PhalconRest - \\League\\Fractal\\Manager\n\t\t */\n\t\t$di->setShared(Services::FRACTAL_MANAGER, function () {\n\n\t\t\t$fractal = new \\League\\Fractal\\Manager;\n\t\t\t$fractal->setSerializer(new CustomSerializer());\n\n\t\t\treturn $fractal;\n\t\t});\n\n\t\t/** @var \\Phalcon\\Http\\ResponseInterface $response */\n\t\t$response = $di->get('response');\n\t\t$response->setHeader('Access-Control-Allow-Origin', '*')\n\t\t\t->setContentType('application/json', 'utf-8');\n\n\t}", "protected function registerServices()\n {\n $this->singleton('request', function ($app) {\n return new Request($app);\n });\n\n $this->singleton('response', function ($app) {\n return new Response($app);\n });\n\n $this->singleton('route', function ($app) {\n return new Route($app);\n });\n\n $this->singleton('view', function ($app) {\n return new View($app);\n });\n\n $this->singleton('exception', function ($app) {\n return new Exception($app, $app->exception);\n });\n\n $this->singleton('crypt', function ($app) {\n return new Crypt($app->getSecret());\n });\n\n $this->singleton('cookie', function ($app) {\n return new Cookie($app, $app->getConfig('state')['cookie']);\n });\n\n $this->singleton('session', function ($app) {\n return new Session(new SessionDatabaseHandler($app, $app->getConfig('state')['session']));\n });\n\n return $this->factory();\n }", "protected function registerServiceProviders()\n {\n $this->register(\\Illuminate\\Events\\EventServiceProvider::class);\n if(is_array($providers = $this['config']['providers'])){\n foreach ($providers as $alias => $provider) {\n if (!is_int($alias)) {\n $this->services[$alias] = $provider;\n } else {\n $this->register($provider);\n }\n }\n }\n }", "public function register()\n {\n // $this->app->bind('AuthService', AuthService::class);\n }", "public function register()\n {\n\n $this->registerPermissionMerger();\n\n $this->registerPermissionChecker();\n\n $this->registerHasher();\n\n $this->registerTokenRepository();\n\n $this->registerUserProvider();\n\n $this->registerLoginValidator();\n\n $this->registerGroupRepository();\n\n $this->registerGroupManager();\n\n $this->registerUserRepository();\n\n $this->app->singleton('auth.driver', function($app)\n {\n return $app['auth']->guard();\n });\n\n }", "protected function registerServices()\n {\n $this->app->singleton('components', function($app) {\n $path = $app['config']->get('components.paths.components');\n\n return new Repository($app, $path);\n });\n }", "public function boot()\n {\n $this->registerPolicies();\n\n $headerParser = new AuthHeaders();\n auth()->parser()->setChain([$headerParser]);\n $this->app->forgetInstance('tymon.jwt.parser');\n $this->app->forgetInstance('tymon.jwt');\n $headerParser = new AuthHeaders();\n $headerParser->setHeaderPrefix('Device');\n auth('device')->parser()->setChain([$headerParser]);\n $this->app->forgetInstance('tymon.jwt.parser');\n $this->app->forgetInstance('tymon.jwt');\n $headerParser = new AuthHeaders();\n $headerParser->setHeaderPrefix('Authorizer');\n auth('authorizer')->parser()->setChain([$headerParser]);\n\n Gate::before(function (Authorizable $user, string $ability) {\n if ($user instanceof AuthorizableInterface) {\n return $user->hasPermissionTo($ability) ?: null;\n }\n });\n }", "protected function registerAuthenticator()\n {\n $this->app->singleton('auth', function ($app) {\n return new AuthManager($app);\n });\n }", "protected function loadServices()\n {\n $di = $this->getDI();\n\n // Register the dispatcher setting a Namespace for controllers\n $di->setShared('dispatcher', function () {\n\n\n $dispatcher = new Dispatcher();\n $dispatcher->setDefaultNamespace('Phalcana\\Controllers');\n\n $listener = new Dispatch;\n $events = new Manager();\n $events->attach('dispatch', $listener);\n $dispatcher->setEventsManager($events);\n\n return $dispatcher;\n });\n\n $di->setShared('router', $this->loadRoutes(new Router(false)));\n }", "public function register()\n {\n $this->app->when(PaypalController::class)\n ->needs(PaymentInterface::class)\n ->give(PaypalService::class);\n\n $this->app->when(StripeController::class)\n ->needs(PaymentInterface::class)\n ->give(StripeService::class);\n\n $this->app->when(SquarePayController::class)\n ->needs(PaymentInterface::class)\n ->give(SquarePayService::class);\n }", "private function providers()\n {\n $this->register(new CorsServiceProvider());\n $this->register(new HmacServiceProvider());\n }", "protected function registerServices()\n {\n $this->app->singleton('adminmenu', function () {\n return new Builder();\n });\n }", "private function registerAll()\n {\n $this->registerApp();\n $this->registerPsr();\n $this->registerRequests();\n $this->registerResponses();\n $this->registerPlugins();\n $this->registerCallables();\n $this->registerViews();\n $this->registerUtils();\n }", "public function boot()\n {\n $this->app->singleton('api.auth', function ($app) {\n return new AuthManager(new RequestTokenStorage($app->make('request')));\n });\n }", "public function boot()\n {\n $this->app->bind(\n AuthorizationInterface::class,\n User::class\n );\n }", "public function register()\n {\n // Bind Credential Contract with Service\n $this->app->bind(Credentials::class, function ($app){\n return new CredentialsManger($app->make('filesystem.disk'), $app->make('encrypter'));\n });\n\n // Bind Caption Contract with Service\n $this->app->bind(Configuration::class, function ($app){\n return new ConfigurationManager($app->make('filesystem.disk'));\n });\n\n // Inject dependencies into Auth Service.\n $this->app->singleton(Post::class, function ($app){\n return new PostService(new Instagram(true, true), $app->make(Credentials::class));\n });\n\n // Inject Guzzle Into Reddit Service\n $this->app->singleton(Scraper::class, function ($app){\n return new ScraperService(new Client(['base_uri' => 'http://www.reddit.com']), $app->make(Configuration::class), $app->make('filesystem.disk'));\n });\n\n $this->app->bind(Caption::class, function ($app){\n return new CaptionManager($app->make('filesystem.disk'), $app->make('encrypter'));\n });\n }", "public function boot()\n {\n $this->app['auth']->extend('jwt', function ($app) {\n $bearerToken = $app['request']->server->getHeaders()['AUTHORIZATION'] ?? '';\n $tokenService = new TokenService();\n $guard = new JwtGuard($bearerToken, $tokenService);\n return $guard;\n });\n }", "public function register()\n {\n /**\n * Register additional service\n * providers if they exist.\n */\n foreach ($this->providers as $provider) {\n if (class_exists($provider)) {\n $this->app->register($provider);\n }\n }\n }", "protected function registerServiceProviders()\n\t{\n\t\t// Core Bus\n\t\t// -----------------------------------------------------------------------------\n\t\t$this->app->register('Congraph\\Core\\Bus\\BusServiceProvider');\n\n\t\t// Core Event\n\t\t// -----------------------------------------------------------------------------\n\t\t$this->app->register('Congraph\\Core\\Events\\EventsServiceProvider');\n\n\t\t// Repositories\n\t\t// -----------------------------------------------------------------------------\n\t\t$this->app->register('Congraph\\Core\\Repositories\\RepositoriesServiceProvider');\n\t}", "public function register()\n\t{\n $this->registerApi();\n\t}", "public function boot()\n {\n Passport::routes(function ($router) {\n $router->forAuthorization();\n $router->forAccessTokens();\n //$router->forTransientTokens(); // the tokens we issue are permanent\n //$router->forClients(); // we don't want external applications using our oauth flows\n //$router->forPersonalAccessTokens(); // we don't have a user-facing API yet\n });\n\n $this->registerPolicies();\n\n Gate::define('use-permission', function ($user, $permission) {\n if ($user->hasRole('privacc') && config()->get('app.env') != 'production') {\n return true;\n }\n\n try {\n return auth()->user()->hasPermissionTo($permission);\n } catch (PermissionDoesNotExist $e) {\n return false;\n }\n });\n\n $this->serviceAccessGates();\n }", "protected function registerBaseServiceProviders()\n {\n $this->register(new EventServiceProvider($this));\n $this->register(new RouteServiceProvider($this));\n }", "public function register()\n {\n $this->app->bind('redhotmayo\\auth\\AuthorizationService', AuthorizationService::SERVICE);\n $this->app->bind('AuthorizationService', AuthorizationService::SERVICE);\n\n // Register 'api_authorizer' instance container to our ApiAuthorizer object\n $this->app['api_authorizer'] = $this->app->share(function($app)\n {\n $service = App::make('AuthorizationService');\n return new ApiAuthorizer($service);\n });\n\n // Shortcut so developers don't need to add an Alias in app/config/app.php\n $this->app->booting(function()\n {\n $loader = \\Illuminate\\Foundation\\AliasLoader::getInstance();\n $loader->alias('ApiAuthorizer', 'redhotmayo\\api\\auth\\ApiAuthorizer');\n });\n }", "public function register(): void\n\t{\n\t\t$this->mergeConfigFrom(__DIR__.'/../../config/larauthkit.php', 'larauthkit');\n\t\tif (config('larauthkit.authn.enable'))\n\t\t{\n\t\t\t$this->app->register(AuthkitEventServiceProvider::class);\n\t\t\t$this->app->register(AuthnServiceProvider::class);\n\t\t}\n\n\t\tif (config('larauthkit.authz.enable'))\n\t\t{\n\t\t\t$this->app->register(AuthzServiceProvider::class);\n\t\t}\n\t}", "public function __construct()\n {\n $this->userService = Core::getService(UserService::class);\n $this->applicationService = Core::getService(ApplicationService::class);\n $this->libraryService = Core::getService(LibraryService::class);\n $this->middleware('auth');\n }", "protected function registerServices()\n {\n $this->app->singleton(\n 'adminmenu',\n function () {\n return new Builder();\n }\n );\n }", "public function register()\n {\n $this->registerBindings(collect($this->bindings));\n $this->registerFactories(collect($this->factories));\n $this->registerProviders(collect($this->providers));\n $this->registerSeeders(collect($this->seeders));\n }", "protected function registerBaseServiceProviders()\n {\n $this->register(new EventServiceProvider($this));\n $this->register(new LogServiceProvider($this));\n $this->register(new RoutingServiceProvider($this));\n }", "public function register(): void\n {\n $this->registerMultipleConfig();\n\n $this->registerProviders([\n Providers\\AuthServiceProvider::class,\n Providers\\RouteServiceProvider::class,\n ]);\n\n $this->registerCommands([\n InstallCommand::class,\n PublishCommand::class,\n ]);\n }", "public function boot()\n {\n $this->registerPolicies();\n\n app(AuthorizationServer::class)->enableGrantType(\n $this->makeExtensionGrant(), Passport::tokensExpireIn()\n );\n\n app(AuthorizationServer::class)->enableGrantType(\n $this->makeQRCodeGrant(), Passport::tokensExpireIn()\n );\n\n Passport::routes();\n\n Passport::tokensCan([\n 'create-dragons' => 'Create dragons',\n 'create-trees' => 'Create trees',\n 'create-child-accounts' => 'Create child accounts',\n 'update-child-accounts' => 'Update child accounts',\n 'update-profile' => 'Update profile',\n ]);\n }", "public function register()\n {\n $this->app->register(RouteServiceProvider::class);\n $this->app->register(AuthServiceProvider::class);\n }", "public function register()\n\t{\n\t\t$this->app->bind(\n\t\t\t'Illuminate\\Contracts\\Auth\\Registrar',\n\t\t\t'StartMeUp\\Services\\Registrar'\n\t\t);\n\n\t\t$repositories = [\n\t\t\t'Company',\n\t\t];\n\t\tforeach ($repositories as $repository) {\n\t\t\t$this->bindRepository($repository);\n\t\t}\n\n\t}", "public function register()\n {\n $this->loadConfigs(['assets.php', 'permissions.php']);\n $this->loadMigrationsFrom(__DIR__ . '/../Database/Migrations');\n\n $this->app->bind(Authentication::class, SentinelAuthentication::class);\n }", "public function boot(): void\n {\n $this->registerPolicies();\n }", "public function boot() {\n\t\t$this->registerPolicies();\n\n\t\tPassport::routes();\n\t\tPassport::tokensExpireIn(Carbon::now()->addMinutes(30));\n\t\tPassport::refreshTokensExpireIn(carbon::now()->addDays(30));\n\t\tPassport::personalAccessTokensExpireIn(Carbon::now()->addMonths(2));\n\n\t\t//Register implicit grant type\n\t\tPassport::enableImplicitGrant();\n\n\t\t//Scopes for api\n\t\tPassport::tokensCan(['purchase-product' => 'Create transactions for products',\n\t\t\t'manage-product' => 'Create, read, delete, update products',\n\t\t\t'manage-account' => 'Read account data if verified or is admin modify data but can not remove account',\n\t\t\t'read-general' => 'Read general information like purcahsing categories, selling proucts, your transactions etc',\n\t\t]);\n\t}", "public function boot()\n {\n $this->registerPolicies();\n\n Passport::routes(null, [\n 'prefix' => 'oauth'\n ]);\n\n Gate::define('upload_budgets', function ($user) {\n return $user->permissions()->where('key', 'upload_budgets')->count();\n });\n\n Gate::define('manage_categories', function ($user) {\n return $user->permissions()->where('key', 'manage_categories')->count();\n });\n\n Gate::define('manage_citizens', function ($user) {\n return $user->permissions()->where('key', 'manage_citizens')->count();\n });\n\n Gate::define('manage_shop-keepers', function ($user) {\n return $user->permissions()->where('key', 'manage_shop-keepers')->count();\n });\n\n Gate::define('manage_budgets', function ($user) {\n return $user->permissions()->where('key', 'manage_budgets')->count();\n });\n\n Gate::define('manage_vouchers', function ($user) {\n return $user->permissions()->where('key', 'manage_vouchers')->count();\n });\n\n Gate::define('manage_admins', function ($user) {\n return $user->permissions()->where('key', 'manage_admins')->count();\n });\n\n Gate::define('manage_permissions', function ($user) {\n return $user->permissions()->where('key', 'manage_permissions')->count();\n });\n\n Gate::define('manage_vouchers_transactions', function ($user) {\n return $user->permissions()->where('key', 'manage_vouchers_transactions')->count();\n });\n }", "public function boot()\n {\n $this->registerPolicies();\n\n Auth::extend('custom', function ($app, $name, array $config) {\n $guard = new CustomGuard($name, Auth::createUserProvider($config['provider']), $app['session.store']);\n\n if (method_exists($guard, 'setCookieJar')) {\n $guard->setCookieJar($this->app['cookie']);\n }\n\n if (method_exists($guard, 'setDispatcher')) {\n $guard->setDispatcher($this->app['events']);\n }\n\n if (method_exists($guard, 'setRequest')) {\n $guard->setRequest($this->app->refresh('request', $guard, 'setRequest'));\n }\n\n return $guard;\n });\n }", "public function register()\n {\n $this->app->routeMiddleware([\n 'auth' => Authenticate::class,\n ]);\n\n $this->app->router->group(['prefix' => 'api/xblock/auth', 'namespace' => 'XBlock\\Auth'], function ($router) {\n $router->post('/login', [\n 'uses' => 'Login@index',\n ]);\n $router->get('/user', [\n 'uses' => 'Login@getLoginUser',\n 'middleware' => 'auth'\n ]);\n });\n\n if ($this->app->runningInConsole()) {\n $this->publishes([\n __DIR__ . '/../database/migrations' => database_path('migrations'),\n ], 'xblock');\n $this->registerMigrations();\n $this->commands([\n CreateKey::class\n ]);\n }\n\n }", "public function boot()\n {\n $this->configureAuthorization();\n }", "public function boot()\n {\n app(AuthorizationServer::class)->enableGrantType(\n $this->makeFirebaseGrant(), Passport::tokensExpireIn()\n );\n }", "public function boot()\n {\n $this->app['auth']->viaRequest('api', function ($request) {\n if ($request->header('Authorization')) {\n $key = explode(' ',$request->header('Authorization'));\n\n $client = new Client();\n $response = $client->get(env('SERVICE_ADDRESS_USER').'/users/validate/'.$key[(count($key)-1)]);\n return $response->getStatusCode()==200;\n }\n });\n }", "public function register()\n {\n $this->app->singleton('forrest', function ($app) {\n\n // Config options\n $settings = config('forrest');\n $storageType = config('forrest.storage.type');\n $authenticationType = config('forrest.authentication');\n\n // Dependencies\n $httpClient = $this->getClient();\n $input = new LaravelInput(app('request'));\n $event = new LaravelEvent(app('events'));\n $encryptor = new LaravelEncryptor(app('encrypter'));\n $redirect = $this->getRedirect();\n $storage = $this->getStorage($storageType);\n\n $refreshTokenRepo = new RefreshTokenRepository($encryptor, $storage);\n $tokenRepo = new TokenRepository($encryptor, $storage);\n $resourceRepo = new ResourceRepository($storage);\n $versionRepo = new VersionRepository($storage);\n $instanceURLRepo = new InstanceURLRepository($tokenRepo, $settings);\n $stateRepo = new StateRepository($storage);\n\n $formatter = new JSONFormatter($tokenRepo, $settings);\n\n switch ($authenticationType) {\n case 'OAuthJWT':\n $forrest = new OAuthJWT(\n $httpClient,\n $encryptor,\n $event,\n $input,\n $redirect,\n $instanceURLRepo,\n $refreshTokenRepo,\n $resourceRepo,\n $stateRepo,\n $tokenRepo,\n $versionRepo,\n $formatter,\n $settings);\n break;\n case 'WebServer':\n $forrest = new WebServer(\n $httpClient,\n $encryptor,\n $event,\n $input,\n $redirect,\n $instanceURLRepo,\n $refreshTokenRepo,\n $resourceRepo,\n $stateRepo,\n $tokenRepo,\n $versionRepo,\n $formatter,\n $settings);\n break;\n case 'UserPassword':\n $forrest = new UserPassword(\n $httpClient,\n $encryptor,\n $event,\n $input,\n $redirect,\n $instanceURLRepo,\n $refreshTokenRepo,\n $resourceRepo,\n $stateRepo,\n $tokenRepo,\n $versionRepo,\n $formatter,\n $settings);\n break;\n case 'UserPasswordSoap':\n $forrest = new UserPasswordSoap(\n $httpClient,\n $encryptor,\n $event,\n $input,\n $redirect,\n $instanceURLRepo,\n $refreshTokenRepo,\n $resourceRepo,\n $stateRepo,\n $tokenRepo,\n $versionRepo,\n $formatter,\n $settings);\n break;\n default:\n $forrest = new WebServer(\n $httpClient,\n $encryptor,\n $event,\n $input,\n $redirect,\n $instanceURLRepo,\n $refreshTokenRepo,\n $resourceRepo,\n $stateRepo,\n $tokenRepo,\n $versionRepo,\n $formatter,\n $settings);\n break;\n }\n\n return $forrest;\n });\n }", "public function boot(): void\n {\n $adapter = $this->app->make(AdapterInterface::class);\n\n /* @phpstan-ignore-next-line */\n $this->app['auth']->viaRequest(\n 'remote-token-auth',\n fn (Request $request): Authenticatable => $adapter->authorize($request)\n );\n }", "public function boot()\n {\n $this->app->register(UserServiceProvider::class);\n $this->app->register(DashboardServiceProvider::class);\n $this->app->register(CoreServiceProvider::class);\n $this->app->register(InstitutionalVideoServiceProvider::class);\n $this->app->register(InstitutionalServiceProvider::class);\n $this->app->register(TrainingServiceProvider::class);\n $this->app->register(CompanyServiceProvider::class);\n $this->app->register(LearningUnitServiceProvider::class);\n $this->app->register(PublicationServiceProvider::class);\n }", "private function initializeServices()\n {\n $this->emailManager = $this->getService('mycp.service.email_manager');\n $this->translatorService = $this->getService('translator');\n $this->securityService = $this->getService('Secure');\n $this->router = $this->getService('router');\n }", "public function register()\n {\n $this->registerAdapterFactory();\n $this->registerDigitalOceanFactory();\n $this->registerManager();\n $this->registerBindings();\n }", "private function registerAuthenticationRoutes(){\n $prefix = config('web-call-center.prefix');\n \\Route::group((!empty($prefix)? compact('prefix') : []) + ['namespace' => $this->namespace, 'middleware' => 'web'],\n __DIR__.'/../../routes/auth.php');\n }", "public function register()\n {\n $this->registerServices();\n $this->setupStubPath();\n $this->registerProviders();\n }", "protected function registerServiceProviders()\n {\n foreach($this->providers as $provider)\n {\n // check if the provider class exists\n if (class_exists($provider))\n {\n // register this service provider, and Instantiate it.\n $service = new $provider($this);\n\n // check if the service provider has a boot method.\n if (method_exists($service, 'register')) {\n $service->register();\n }\n\n // save the active provider so that we can call it later.\n $this->activeProviders[$provider] = $service;\n }\n }\n }", "public function register()\n { \n // User Repository\n $this->app->bind('App\\Contracts\\Repository\\User', 'App\\Repositories\\User');\n \n // JWT Token Repository\n $this->app->bind('App\\Contracts\\Repository\\JSONWebToken', 'App\\Repositories\\JSONWebToken');\n \n $this->registerClearSettleApiLogin();\n \n $this->registerClearSettleApiClients();\n \n \n }", "public function boot()\n {\n \n // Aqui você pode definir como deseja que os usuários sejam autenticados para o seu Lumen\n // application. O retorno de chamada que recebe a instância de solicitação recebida\n // deve retornar uma instância do usuário ou nulo. Você é livre para obter\n // a instância do usuário por meio de um token de API ou qualquer outro método necessário.\n\n $this->app['auth']->viaRequest('api', function ($request) {\n return \\App\\Aluno::where('email',$request->input('email'))->first();\n });\n }", "public function register()\n {\n // Register all repositories\n foreach ($this->repositories as $repository) {\n $this->app->bind(\"App\\Repository\\Contracts\\I{$repository}\",\n \"App\\Repository\\Repositories\\\\{$repository}\");\n }\n\n // Register all services\n foreach ($this->services as $service) {\n $this->app->bind(\"App\\Service\\Contracts\\I{$service}\", \n \"App\\Service\\Modules\\\\{$service}\");\n }\n }", "public function register()\n {\n /**\n * Sets third party service providers that are only needed on local environments\n */\n if ($this->app->environment() == 'local') {\n /**\n * Loader for registering facades\n */\n $loader = \\Illuminate\\Foundation\\AliasLoader::getInstance();\n\n /**\n * Load third party local providers and facades\n */\n $this->app->register(\\Barryvdh\\Debugbar\\ServiceProvider::class);\n $loader->alias('Debugbar', \\Barryvdh\\Debugbar\\Facade::class);\n\n $this->app->register(\\Laracasts\\Generators\\GeneratorsServiceProvider::class);\n }\n $this->app->bind('soaClient', function ($app,$params) {\n $cloud = SOA::getInstance($params[0]);\n if($cloud->getEnv()){\n return $cloud;\n }\n $cloud->setEncodeType(true, true);\n $config = config('soa.'.$params[0]);\n $cloud->putEnv('app', $config['app']);\n $cloud->putEnv('appKey', $config['appKey']);\n $cloud->setServers($config['hosts']);\n return $cloud;\n });\n $this->app['request']->server->set('HTTPS', $this->app->environment() != 'local');\n }", "protected function registerGuard()\n {\n Auth::extend('passport', function ($app, $name, array $config) {\n return tap($this->makeGuard($config), function ($guard) {\n $this->app->refresh('request', $guard, 'setRequest');\n });\n });\n }", "public function register()\n {\n $this->app->bind(ClientRepositoryInterface::class, function() {\n return new ClientRepository();\n });\n\n $this->app->bind(AccessTokenRepositoryInterface::class, function() {\n return new AccessTokenRepository();\n });\n\n $this->app->bind(ScopeRepositoryInterface::class, function() {\n return new ScopeRepository();\n });\n\n $this->app->bind(ResourceServer::class, function() {\n $accessTokenRespository = new AccessTokenRepository();\n $publicKey = base_path('public.key');\n return new ResourceServer($accessTokenRespository, $publicKey);\n });\n\n $this->app->bind(AuthorizationServer::class, function() {\n\n $clientRepository = new ClientRepository();\n $scopeRepository = new ScopeRepository();\n $accessTokenRepository = new AccessTokenRepository();\n $authCodeRepository = new AuthCodeRepository();\n $refreshTokenRepository = new RefreshTokenRepository();\n\n\n $privateKey = base_path('private.key');\n $publicKey = base_path('public.key');\n $userRepository = new UserRepository();\n $refreshTokenRepository = new RefreshTokenRepository();\n $intervaloPadrao = new \\DateInterval('P12M');\n\n\n $server = new AuthorizationServer($clientRepository, $accessTokenRepository, $scopeRepository, $privateKey, $publicKey);\n $server->enableGrantType(new ClientCredentialsGrant(), $intervaloPadrao);\n $server->enableGrantType(new PasswordGrant($userRepository, $refreshTokenRepository), $intervaloPadrao);\n\n $authGrant = new AuthCodeGrant($authCodeRepository, $refreshTokenRepository, $intervaloPadrao);\n $authGrant->setRefreshTokenTTL(new \\DateInterval('P12M'));\n \n \n $refreshGrant = new \\League\\OAuth2\\Server\\Grant\\RefreshTokenGrant($refreshTokenRepository);\n $refreshGrant->setRefreshTokenTTL(new \\DateInterval('P12M'));\n\n $server->enableGrantType($authGrant, $intervaloPadrao);\n $server->enableGrantType($refreshGrant, $intervaloPadrao);\n\n\n\n return $server;\n\n });\n\n }", "public function register()\n {\n // dynamically set the rootview based on whether the route is backend or frontend \n // can also be done in a middleware that wraps all admin routes\n if(request()->is('test-react/*')){\n Inertia::setRootView('react.app');\n } elseif(request()->is('test')){\n Inertia::setRootView('vue.app');\n } else {\n // some other\n }\n\n if ($this->app->environment() == 'local') {\n $this->app->register(\\Reliese\\Coders\\CodersServiceProvider::class);\n }\n $this->registerInertia();\n $this->registerWebSockets();\n }", "public function register()\n {\n\n $this->app->register(HookProvider::class);\n $this->app->register(RouteProvider::class);\n// $this->app->register(InstallModuleProvider::class);\n }", "public function boot()\n {\n $this->registerPolicies();\n\n Passport::routes();\n }", "public function boot()\n {\n $this->registerPolicies();\n\n Passport::routes();\n }", "public function boot()\n {\n $this->registerPolicies();\n\n Passport::routes();\n }" ]
[ "0.7238336", "0.71634316", "0.70841175", "0.6916285", "0.6882426", "0.68549484", "0.6853438", "0.6812384", "0.6786827", "0.6771727", "0.6648215", "0.66145295", "0.6606313", "0.6571872", "0.65712136", "0.65602577", "0.65544224", "0.65215147", "0.65081686", "0.64967656", "0.6473557", "0.6465625", "0.6440537", "0.6437382", "0.6419586", "0.63912356", "0.6371695", "0.6331455", "0.63311565", "0.6329123", "0.63267297", "0.6325765", "0.63092077", "0.6308683", "0.6301807", "0.62803197", "0.6268785", "0.62419224", "0.6224927", "0.62247604", "0.62150115", "0.62082845", "0.6207118", "0.6200618", "0.6199985", "0.6199563", "0.61966515", "0.61902905", "0.61892736", "0.61820686", "0.6179434", "0.6158386", "0.61570966", "0.61423475", "0.61418444", "0.6128293", "0.6118749", "0.61166286", "0.6112297", "0.6104109", "0.6099709", "0.60972136", "0.6073358", "0.60715634", "0.60552776", "0.60526836", "0.60454774", "0.6043968", "0.604386", "0.6043709", "0.6040946", "0.6038717", "0.60383916", "0.60350347", "0.60292214", "0.6003098", "0.599686", "0.5995341", "0.59874433", "0.598662", "0.5982651", "0.5974995", "0.5973818", "0.59618443", "0.59618413", "0.59617674", "0.59532464", "0.59489155", "0.5946842", "0.59463835", "0.5943532", "0.59256464", "0.5916127", "0.59147394", "0.5912967", "0.59065604", "0.5904983", "0.5903013", "0.5897574", "0.5897574", "0.5897574" ]
0.0
-1
checked of de gebruikersnaam bestaat uit een selectie van tekens
function invalidUid($uid) { $result; if (!preg_match("/^[a-zA-Z0-9]*$/", $uid)) { $result = true; } else { $result = false; } return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _generateSelection()\n {\n $i = 0;\n foreach ($_POST as $key=>$value) {\n echo \"<input type='hidden' name=$key value=$value required>\";\n echo \"<div class='form-group'>\";\n if (isset($value) && $this->\n _childexists($value, $this->_getRubriekFromDb())) {\n echo $this->_generateRubriekVerkoopList($value, $this->_getRubriekFromDb(), \"subrubriek\" . $i);\n echo \"<script type='text/javascript'>\n document.getElementById('$key').disabled = true;\n </script>\";\n }\n echo \"</div>\";\n echo \"<script type='text/javascript'>\n document.getElementById('$key').value= $value \n </script>\";\n $i++;\n }\n }", "function montar_select_sexo(&$select_sexos, $objSexoPaciente, $objSexoPacienteRN, &$objPaciente) {\n $selected = '';\n $arr_sexos = $objSexoPacienteRN->listar($objSexoPaciente);\n\n $select_sexos = '<select onfocus=\"this.selectedIndex=0;\" onchange=\"val_sexo()\" '\n . 'class=\"form-control selectpicker\" id=\"select-country idSexo\" data-live-search=\"true\" '\n . 'name=\"sel_sexo\">'\n . '<option data-tokens=\"\"></option>';\n\n foreach ($arr_sexos as $sexo) {\n $selected = '';\n if ($sexo->getIdSexo() == $objPaciente->getIdSexo_fk()) {\n $selected = 'selected';\n }\n $select_sexos .= '<option ' . $selected . ' value=\"' . $sexo->getIdSexo() . '\" data-tokens=\"' . $sexo->getSexo() . '\">' . $sexo->getSexo() . '</option>';\n }\n $select_sexos .= '</select>';\n}", "public function actionSelect(){\n $select = $this->select('Pilih donk akhh..', ['kopi'=>'kopi', 'susu'=>'susu']);\n echo \"Pilihan nya adalah : $select\";\n }", "function PilihanCetakTidak(){\r\n global $pilihanYN;\r\n $a = '';\r\n for ($i=0; $i<sizeof($pilihanYN); $i++) {\r\n $sel = ($i == $_SESSION['_pilihanYN'])? 'selected' : '';\r\n $v = explode('~', $pilihanYN[$i]);\r\n $_v = $v[0];\r\n $a .= \"<option value='$i' $sel>$_v</option>\\r\\n\";\r\n }\r\n echo \"<p><table class=box cellspacing=1 cellpadding=4>\r\n <form action='?' method=post>\r\n <input type=hidden name='mnux' value='akd.lap.mhswkss'>\r\n <input type=hidden name='gos' value='Daftar'>\r\n <tr><td class=inp>Cetak Berdasarkan: </td>\r\n <td class=ul><select name='_pilihanYN' onChange='this.form.submit()'>$a</select></td></tr>\r\n </form></table></p>\";\r\n}", "function getEmployeesListCtrl() {\n $accounts = getEmployeesList();\n echo \"<select class='form-control' required name='id_comptes'>\";\n foreach ($accounts as $a) {\n if ($id === $a['id_compte']) {\n echo \"<option value='\".$a[\"id_compte\"].\"' selected>\".$a[\"nom\"].\" \".$a[\"prenom\"].\"</option>\";\n } else {\n echo \"<option value='\".$a[\"id_compte\"].\"'>\".$a[\"nom\"].\" \".$a[\"prenom\"].\"</option>\";\n }\n }\n echo \"</select>\";\n}", "function LUPE_criar_combo_vet($Vet, $NomeCombo, $PreSelect, $LinhaFixa = ' ', $JS = '', $Style = '')\r\n{\r\n\r\n $numrows = count($Vet);\r\n\r\n echo \"<select id='$NomeCombo' name='$NomeCombo' $JS style='$Style'>\\n\";\r\n\r\n\tif ($LinhaFixa != '')\r\n\t\techo \"<option value=''>$LinhaFixa</option>\\n\";\r\n\r\n if ($numrows == 0) {\r\n\t\techo \"<option value=''>Não há informação no sistema</option>\\n\";\r\n } else {\r\n\t ForEach($Vet as $Chave => $Valor ){\r\n \t\t echo \"<option value='$Chave'\";\r\n\r\n\t\t if ($PreSelect == $Chave)\r\n\t\t\techo 'selected >';\r\n \t\t else\r\n\t\t\techo '>';\r\n\r\n\t \t echo \"$Valor</option>\\n\";\r\n }\r\n }\r\n\r\n echo '</select>';\r\n\r\n return 0;\r\n}", "function listeRubrique_article($rub_selected)\n{\n\techo \"<select name='rubrique'>\";\n\t$req = mysql_query(\"SELECT * FROM RUBRIQUE WHERE `id_mere` is null;\");\n\twhile($rubrique=mysql_fetch_array($req))\n\t{\n\t\t$selected = \"\";\n\t\tif($rub_selected == $rubrique['id_rubrique'])\n\t\t\t$selected = \"selected='selected'\";\n\t\techo \"<option value='\".$rubrique['id_rubrique'].\"'\".$selected.\">\".$rubrique['titreFR_rubrique'].\"</option>\";\n\t\tgetChildRubrique_article($rubrique['id_rubrique'],0,$rub_selected);\n\t}\n\techo \"</select>\";\n}", "function okrs_related_to_select($value)\n{\n\n $selected = '';\n if($value == 'okrs'){\n $selected = 'selected';\n }\n echo \"<option value='okrs' \".$selected.\">\".\n _l('okrs').\"\n </option>\";\n\n}", "public function tipoContacto($parametro)\n{\n if($parametro==NULL)\n {\n $parametro=9999;\n }\n\techo '<select class=\"form-control select\" name=\"tipoContacto\" required=\"\" required onchange=\"showmeDatosFacturacion(this.value)\" >\n\t\t <option value=\"\" '.$this->selected($parametro, 99999).'>Selecciona Uno</option>\n <option value=\"0\" '.$this->selected($parametro, 0).' >Cliente</option>\n <option value=\"1\" '.$this->selected($parametro, 1).'>Provedor</option>\n <option value=\"2\" '.$this->selected($parametro, 2).'>Cliente y Provedor</option>\n </select>';\n}", "function select_option()\r\n{}", "function getElaboradoPor($forganismo,$opt){\r\nconnect();\r\nswitch ($opt) {\r\ncase 0:\r\n\t$sql=\"SELECT * FROM pv_antepresupuesto where Organismo = '\".$forganismo.\"'\";\r\n\t$query=mysql_query($sql) or die ($sql.mysql_error());\r\n\t$rows=mysql_num_rows($query);\r\n\tfor ($i=0; $i<$rows; $i++) {\r\n\t\t$field=mysql_fetch_array($query);\r\n\t\tif ($field['PreparadoPor']==$valor) echo \"<option value='\".$field['PreparadoPor'].\"' selected>\".htmlentities($field['PreparadoPor']).\"</option>\"; \r\n\t\telse echo \"<option value='\".$field['PreparadoPor'].\"'>\".htmlentities($field['PreparadoPor']).\"</option>\";\r\n\t}\r\n\tbreak;\r\n}\t \r\n}", "function checkIt( $field, $set, $type ) {\n\tswitch( $type ){\n\t\tcase 'radio' :\n\t\tcase 'check' :\n\t\t\t\t\t $language = 'checked=\"checked\"';\n\t\t\t\t\t break;\n\t\tcase 'select' :\n\t\t\t\t\t $language = 'selected=\"selected\"';\n\t\t\t\t\t break;\n\t}\n\tif ( $field == $set ){\n\t\t$selected = $language;\n\t} else {\n\t\t$selected = '';\n\t}\n\treturn $selected;\n}", "function uf_cmb_nomina($as_seleccionado)\r\n\t{\r\n\t\t$lb_valido=true;\r\n\t\t$ls_sql=\"SELECT a.codnom, a.desnom \". \r\n\t\t \" FROM sno_nomina as a WHERE a.codemp='\".$this->ls_codemp.\"'\";\r\n\t\t$rs_result=$this->io_sql->select($ls_sql);\t\t\r\n\t\tif($rs_result===false)\r\n\t\t {\r\n\t\t\t$this->io_msg->message(\"CLASE->Buscar Tipos de Servicios Médicos MÉTODO->uf_cmb_nomina ERROR->\".$this->io_function->uf_convertirmsg($this->io_sql->message));\r\n\t\t\t$lb_valido=false;\r\n\t\t\t//return false;\r\n\t\t }\r\n\t\t else\r\n\t\t {\r\n\t\t\tprint \"<select name='cmbnomina' id='cmbnomina' onChange='javascript: ue_cargargrid();'>\";\r\n\t\t\tprint \" <option value='00'>-- Seleccione Una Nomina--</option>\";\r\n\t\t\twhile($row=$this->io_sql->fetch_row($rs_result))\r\n\t\t\t{\r\n\t\t\t\t$ls_seleccionado=\"\";\r\n\t\t\t\t$ls_codnom=$row[\"codnom\"];\r\n\t\t\t\t$ls_desnom=$row[\"desnom\"];\r\n\t\t\t\t$ls_operacion=\"\";\r\n\t\t\t\tif($as_seleccionado==$ls_codnom)\r\n\t\t\t\t{\r\n\t\t\t\t\t$ls_seleccionado=\"selected\";\r\n\t\t\t\t}\r\n\t\t\t\tprint \"<option value='\".$ls_codnom.\"' \".$ls_seleccionado.\">\".$ls_desnom.\" - \".$ls_operacion.\"</option>\";\r\n\t\t\t}\r\n\t\t\t$this->io_sql->free_result($rs_result);\t\r\n\t\t\tprint \"</select>\";\r\n\t\t}\r\n\t\treturn $lb_valido;\r\n\t}", "function check_selectbox($value)\n\t{\n\t if($value == '' || $value == 'select' || $value == 'default' || $value == '0') { // do your validations\n\t\t return FALSE;\n\t } else {\n\t\t return TRUE;\n\t }\n\t}", "function isSelected($val,$option) {\r\n $cmp = strcmp($val,$option);\r\n if ($cmp == 0)\r\n return \" SELECTED\";\r\n else\r\n return \"\";\r\n}", "function echoSelected($fieldname){\n\t#echo \"199\".$fieldname.$this->request['option']; exit;\n\t\tif($this->request['option']==$fieldname)\n\t\t\techo \" selected\";\n\t}", "function language_select() {\n echo '<select name=\"language\">';\n foreach (Translate::$Languages as $lang => $details) {\n // Print the option\n echo '<option value=\"'.html_entities($lang).'\"';\n if ($_SESSION['language'] == $lang)\n echo ' SELECTED';\n echo '>'.$details[0].'</option>';\n }\n echo '</select>';\n }", "public function formSelect($sId=\"\",$sNome=\"\",$sValore=\"\",$sLunghezza=0,$sTag=\"\", $jolly=\"\"){\r\n\r\n $sValore=split(\";\",htmlentities($sValore));\r\n\t\t\r\n\t\tif($sTag==\"\"){\r\n\t\t\techo \"<select name=\\\"\" . $sNome . \"\\\">\";\r\n\t\t}else{\r\n\t\t\techo \"<select name=\\\"\" . $sNome . \"\\\"\" . $sTag . \">\";\r\n\t\t}\r\n\r\n\t\tforeach($sValore as $value){\r\n\t\t\t$sRecord=split(\",\",$value);\r\n\t\t\tif(substr($sRecord[1],0,1)==$jolly){\r\n\t\t\t\techo \"<option style=\\\"font-weight:bold;\\\" value=\\\"\" . $sRecord[0] . \"\\\">Gruppo: \" . substr($sRecord[1],1) . \"</option>\";\r\n\t\t\t}else{\r\n\t\t\t\techo \"<option value=\\\"\" . $sRecord[0] . \"\\\">\" . $sRecord[1] . \"</option>\";\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\techo \"</select>\";\r\n\t\t\r\n\t}", "function getTierOne()\n{\n session_start();\n $id=($_SESSION['id']);\n\n $querykd=\"select kodepos.kab from info_form,biodata,kodepos where info_form.nis=biodata.nis and biodata.kodepos=kodepos.kodepos and info_form.iduser='$id'\";\n $hasilkd=mysql_query($querykd);\n $rowkab=mysql_fetch_array($hasilkd);\n\n $result = mysql_query(\"SELECT DISTINCT kab FROM kodepos\")\n or die(mysql_error());\n\n while($tier = mysql_fetch_array( $result ))\n {\n if ($tier['kab']==$rowkab['kab']){$sel2=\"selected='selected'\";}else{$sel2='';}\n echo '<option value=\"'.$tier['kab'].'\"'.$sel2.'>'.$tier['kab'].'</option>';\n }\n\n}", "public function mostrarInfoEquipo(){\n\n $infoEquipo = UsersModel::mostrarInfoTablas(\"manager\");\n\n foreach($infoEquipo as $row => $tipo){\n\n if($tipo[\"Id_Manager\"] > 1){\n\n echo '<option value=\"'.$tipo[\"Id_Manager\"].'\">'.$tipo[\"NameM\"].'</option>'; \n\n }\n\n }\n \n }", "public function setup_selected() {\n\t}", "function fg_write_stato($id_stato=0)\n{\n echo \"<select class=\\\"form_field_enabled\\\" id=\\\"select_stato\\\" name=\\\"id_stato\\\">\";\n\n $yes_selected = \"selected=\\\"selected\\\"\";\n $no_selected = \"\";\n\n $ss = DB::newSelect(\"location_stati\");\n $ss->add(\"id_stato\");\n $ss->add(\"nome\");\n $ss->addOrdering(\"nome\");\n\n $result = $ss->exec();\n $selected = $id_stato>0 ? $no_selected : $yes_selected;\n echo \"<option value=\\\"-1\\\" \".$selected.\">(Seleziona uno stato)</option>\\n\";\n while ($row = mysql_fetch_assoc($result))\n {\n if ($row['id_stato']==$id_stato)\n $selected = $yes_selected;\n else\n $selected = $no_selected;\n echo \"<option value=\\\"\".$row['id_stato'].\"\\\" $selected>\".$row['nome'].\"</option>\\n\";\n }\n mysql_free_result($result);\n\n echo \"</select>\";\n}", "function getThemengebieteOption(){\n\t\t$strThemengebiete = '';\n\t\t$resThemengebiete = $GLOBALS['TYPO3_DB']-> exec_SELECTquery('*', 'tx_topic_detail', 'deleted=0 AND hidden=0');\n\t\tif(mysql_num_rows($resThemengebiete) > 0){\n\t\t\twhile($rowThemenge = mysql_fetch_array($resThemengebiete)){\n\t\t\t\t$strThemengebiete .= '<option value=\"' . $rowThemenge['uid'] . '\">' . $rowThemenge['title'] . '</option>';\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $strThemengebiete;\n\t}", "function CreaSelect($Nombre,$Sql,$Comentario,$valor=\"\"){\n\t\t$result = mysql_query($Sql);\n\t\techo \"\\t<tr><td>$Comentario</td><td><select name='$Nombre'>\\n\";\n\t\twhile($row=mysql_fetch_row($result))\n\t\t{\n\t\t \tif($row[0]==$valor)$seleccionar=\"selected\";\n\t\t \telse $seleccionar=\"\";\n\t\t\techo \"\\t\\t<option $seleccionar value='\".$row[0].\"'>\".$row[1].\"</option>\\n\"\t;\n\t\t}\n\t\t\techo \"</select></td></tr>\\n\";\n\t\t\n\t}", "function getKats($akt) {\r\n $katAR = array();\r\n $kats = '';\r\n $erg = db_query(\"SELECT DISTINCT `news_kat` FROM `prefix_news`\");\r\n while ($row = db_fetch_object($erg)) {\r\n $katAr[ ] = $row->news_kat;\r\n }\r\n $katAr[ ] = 'Allgemein';\r\n $katAr = array_unique($katAr);\r\n foreach ($katAr as $a) {\r\n if (trim($a) == trim($akt)) {\r\n $sel = ' selected';\r\n } else {\r\n $sel = '';\r\n }\r\n $kats .= '<option' . $sel . '>' . $a . '</option>';\r\n }\r\n return ($kats);\r\n}", "function InputOptSelect($Listes,$VariableName,$default,$taille=\"\",$autres=\"\")\t{\n\t\t\tif($_SESSION[\"readonly\"]==\"true\")\n\t\t\t\t$cache=\"disabled\";\n\t\t\tif ($taille > 1)\n\t\t\t\t$_taille=\"WIDTH='$taille' STYLE='width: \".$taille.\"px'\";\n\t\t\t\n\t\t \t$res= \"<select $_taille name=\".$VariableName.\" id=\".$VariableName.\" $autres $cache>\";\n\t\t \t\n\t\t \tif(count($Listes) > 1 ){\n\t\t\t\t$res.= \"<option value='' selected>Selectionnez</option>\";\n\t\t\t}\n\t\t\t// boucle sur chaque OPT group\n\t\t\t$compteur=0;\n\t\t\tforeach ($Listes as $key => $value)\n\t\t\t{\n\t\t\t\t//fermer l'ancien opt group\n\t\t\t\tif($compteur > 0)\n\t\t\t\t\t$res.=\"</optgroup>\"; \n\t\t\t\t$compteur++;\n\t\t\t\t//ouverutre d'un nouveau opt group\t\n\t\t\t\t$res.=\"<optgroup label='\".$key.\"'>\"; \n\t\t\t\t$modelname=$value;\t\t\t\t\n\t\t\t \tfor($i=0;$i < count($modelname);$i++){\n\t\t\t \t\tlist($val,$libelle)=explode(\"|\",$modelname[$i]);\n\t\n\t\t\t \t\tif ($default==$val)\n\t\t\t\t \t\t$res.= \"<option value='$val' selected>\".htmlentities($libelle).\"</option>\";\n\t\t\t\t \telse\n\t\t\t\t \t\t$res.= \"<option value='$val' >\".htmlentities($libelle).\"</option>\";\n\t\t\t\t \t\n\t\t\t\t}\n\t\t\t}\n\t\t\t//fermer le dernière opt group\n\t\t\tif($compteur > 0)\n\t\t\t\t$res.=\"</optgroup>\"; \n\t \t\t$res.= \"</select>\";\n\t\t\treturn $res;\n\t}", "function get_selected()\n {\n }", "function select01($nombreSelect,$arrayOpciones){\n\t$i = '0';\n\t$arrayResultado[$i++] = \"<select name=\\\"$nombreSelect\\\">\";\n\tforeach( $arrayOpciones as $value ){\n\t\tif( $i == '1' ){\n\t\t\t$arrayResultado[$i++] = \"<option value=\\\"\".$value.\"\\\" selected=\\\"selected\\\">\".$value.\"</option>\";\n\t\t} else {\n\t\t\t$arrayResultado[$i++] = \"<option value=\\\"\".$value.\"\\\">\".$value.\"</option>\";\n\t\t}\n\t}\n\t$arrayResultado[$i++] = \"</select>\";\n\treturn $arrayResultado;\n/*\nforeach( $arrayResultado as $value){\n\techo $value.\"<br />\\n\";\n}\n*/\n}", "function doSelectForInput($name) {\n #global $fields_to_make_selects;\n $fields_to_make_selects = Config::$config['fields_to_make_selects'];\n return in_array($name,\n $fields_to_make_selects\n );\n }", "function select02($nombreSelect,$arrayOpciones){\n\t$i = '0';\n\t$arrayResultado[$i++] = \"<select name=\\\"$nombreSelect\\\">\";\n\tforeach( $arrayOpciones as $key => $value ){\n\t\tif( $i == '1' ){\n\t\t\t$arrayResultado[$i++] = \"<option value=\\\"\".$key.\"\\\" selected=\\\"selected\\\">\".$value.\"</option>\";\n\t\t} else {\n\t\t\t$arrayResultado[$i++] = \"<option value=\\\"\".$key.\"\\\">\".$value.\"</option>\";\n\t\t}\n\t}\n\t$arrayResultado[$i++] = \"</select>\";\n\treturn $arrayResultado;\n/*\nforeach( $arrayResultado as $value){\n\techo $value.\"<br />\\n\";\n}\n*/\n}", "function select($name = \"txt\", $alttext = \"\", $selecttype = \"array\", $lookup = \"\", $value = \"\", $event = \"\", $cssid = \"\", $readonly = false, $nochoose = true) {\n\n if (isset($_REQUEST[$name])) {\n if ($value == \"\") {\n $value = $_REQUEST[$name];\n }\n }\n $lookuplist = [];\n if ($selecttype == \"array\" || $selecttype == \"multiarray\") {\n\n if (is_array($lookup)) {\n $lookuplist = $lookup;\n } else {\n $lookuplist = explode(\"|\", $lookup);\n }\n } else if ($selecttype == \"sql\" || $selecttype == \"multisql\") {\n $lookuprow = $this->DEB->getRows($lookup, DEB_ARRAY); //format [0] = NAME\n\n\n foreach ($lookuprow as $irow => $row) {\n $lookuplist[$irow] = $row[0] . \",\" . $row[1]; //make it in the form of array\n }\n }\n //make options for the type of select etc .....\n if ($selecttype == \"multiarray\" || $selecttype == \"multisql\") {\n $options = \"multiple=\\\"multiple\\\"\";\n } else {\n $options = \"\";\n }\n if ($readonly == true) {\n $disabled = \"disabled=\\\"disabled\\\"\";\n } else {\n $disabled = \"\";\n }\n //default text\n if ($alttext == \"\") {\n $alttext = \"Choose\";\n }\n if ($cssid != \"\") {\n $cssid = \"id=\\\"{$cssid}\\\"\";\n } else {\n $cssid = \"\";\n }\n $html = \"<select class=\\\"form-control\\\" $cssid name=\\\"{$name}\\\" $options {$event} $disabled >\";\n\n if (!$nochoose) {\n $html .= \"<option value=\\\"\\\">{$alttext}</option>\";\n }\n\n foreach ($lookuplist as $lid => $option) {\n\n $toption = explode(\",\", $option);\n if (count($toption) != 2) {\n $toption[0] = $lid;\n $toption[1] = $option;\n }\n\n $option = $toption;\n\n if (trim($value) == trim($option[0])) {\n $html .= \"<option selected=\\\"selected\\\" value=\\\"{$option[0]}\\\">{$option[1]}</option>\";\n } else {\n $html .= \"<option value=\\\"{$option[0]}\\\">{$option[1]}</option>\";\n }\n }\n $html .= \"</select>\";\n return $html;\n }", "public function show(Request $re,$r)\n {\n\n\n\n\n $opciones2=\"\";\n $opciones=\"\";\n ///return $r;//\n $materia=\"\";\n $materias=materia::where([['Clave_M',$r]])->get();\n\n $dbFormaciones=Formaciones::get();\n\n $opcionesFormacion='';\n foreach ($dbFormaciones as $formacion) {\n # code...\n $opcionesFormacion.='<option value=\"'.$formacion->Nombre_FT.' \">\n '.$formacion->Nombre_FT.'</option>';\n }\n\n\n $dbBachillertatos=Bachilleratos::get();\n $opcionesBachillerato='';\n foreach ($dbBachillertatos as $bachillerato) {\n # code...\n\n $opcionesBachillerato.='<option value=\"'.$bachillerato->Nombre_B.' \">\n '.$bachillerato->Nombre_B.'</option>';\n\n\n }\n\n foreach($materias as $row ) {\n $materia=$row;\n if($materia->Tipo=='Formación Propedéutica'){\n $opciones=' <option value=\"Formación Propedéutica\" selected=\"true\">Formación Propedéutica</option>\n <option value=\"Formación Para El Trabajo\">Formación Para El Trabajo</option>\n <option value=\"Actividades Paraescolares\">Actividades Paraescolares</option>\n <option value=\"Formación Básica\">Formación Básica</option>';\n\n\n $opcionesBachillerato='';\n foreach ($dbBachillertatos as $bachillerato) {\n # code...\n if($materia->Bachillerato==$bachillerato->Nombre_B){\n $opcionesBachillerato.='<option value=\"'.$bachillerato->Nombre_B.' \" selected=\"'.'true'.'\">\n '.$bachillerato->Nombre_B.'</option>';\n }else{\n $opcionesBachillerato.='<option value=\"'.$bachillerato->Nombre_B.' \">\n '.$bachillerato->Nombre_B.'</option>';\n }\n\n }\n\n }else if($materia->Tipo=='Formación Para El Trabajo'){\n\n $opcionesFormacion='';\n $formMat='';\n foreach ($dbFormaciones as $formaciones) {\n # code...\n $formacionMateria=materia_grupo::where([['Clave_M' ,$materia->Clave_M]])->get();\n\n\n foreach($formacionMateria as $formaciones1){\n\n $formMat=$formaciones1->Grupo;\n\n if($formMat==$formaciones->Nombre_FT){\n ///return $formaciones->Nombre_FT;\n $opcionesFormacion.='<option value=\"'.$formaciones->Nombre_FT.'\" selected=\"'.'true'.'\">\n '.$formaciones->Nombre_FT.'</option>';\n ///return $opcionesFormacion;\n }else{\n\n $opcionesFormacion.='<option value=\"'.$formaciones->Nombre_FT.' \">\n '.$formaciones->Nombre_FT.'</option>';\n }\n }\n\n }\n\n $opciones=' <option value=\"Formación Propedéutica\" >Formación Propedéutica</option>\n <option value=\"Formación Para El Trabajo\" selected=\"true\">Formación Para El Trabajo</option>\n <option value=\"Actividades Paraescolares\" >Actividades Paraescolares</option>\n <option value=\"Formación Básica\">Formación Básica</option>';\n\n }else if($materia->Tipo=='Actividades Paraescolares'){\n $opciones=' <option value=\"Formación Propedéutica\" >Formación Propedéutica</option>\n <option value=\"Formación Para El Trabajo\">Formación Para El Trabajo</option>\n <option value=\"Actividades Paraescolares\" selected=\"true\">Actividades Paraescolares</option>\n <option value=\"Formación Básica\">Formación Básica</option>';\n\n }else if($materia->Tipo=='Formación Básica'){\n $opciones=' <option value=\"Formación Propedéutica\" >Formación Propedéutica</option>\n <option value=\"Formación Para El Trabajo\">Formación Para El Trabajo</option>\n <option value=\"Actividades Paraescolares\">Actividades Paraescolares</option>\n <option value=\"Formación Básica\" selected=\"true\">Formación Básica</option>';\n }\n\n if($materia->Semestre=='PRIMER SEMESTRE'){\n $opciones2='<option value=\"PRIMER SEMESTRE\" selected=\"true\">PRIMER SEMESTRE</option>\n <option value=\"SEGUNDO SEMESTRE\">SEGUNDO SEMESTRE</option>\n <option value=\"TERCER SEMESTRE\">TERCER SEMESTRE</option>\n <option value=\"CUARTO SEMESTRE\">CUARTO SEMESTRE</option>\n <option value=\"QUINTO SEMESTRE\">QUINTO SEMESTRE</option>\n <option value=\"SEXTO SEMESTRE\">SEXTO SEMESTRE</option>';\n }else if($materia->Semestre=='SEGUNDO SEMESTRE'){\n $opciones2='<option value=\"PRIMER SEMESTRE\">PRIMER SEMESTRE</option>\n <option value=\"SEGUNDO SEMESTRE\" selected=\"true\">SEGUNDO SEMESTRE</option>\n <option value=\"TERCER SEMESTRE\">TERCER SEMESTRE</option>\n <option value=\"CUARTO SEMESTRE\">CUARTO SEMESTRE</option>\n <option value=\"QUINTO SEMESTRE\">QUINTO SEMESTRE</option>\n <option value=\"SEXTO SEMESTRE\">SEXTO SEMESTRE</option>';\n }else if($materia->Semestre=='TERCER SEMESTRE'){\n $opciones2='<option value=\"PRIMER SEMESTRE\">PRIMER SEMESTRE</option>\n <option value=\"SEGUNDO SEMESTRE\" >SEGUNDO SEMESTRE</option>\n <option value=\"TERCER SEMESTRE\" selected=\"true\">TERCER SEMESTRE</option>\n <option value=\"CUARTO SEMESTRE\">CUARTO SEMESTRE</option>\n <option value=\"QUINTO SEMESTRE\">QUINTO SEMESTRE</option>\n <option value=\"SEXTO SEMESTRE\">SEXTO SEMESTRE</option>';\n }else if($materia->Semestre=='CUARTO SEMESTRE'){\n $opciones2='<option value=\"PRIMER SEMESTRE\">PRIMER SEMESTRE</option>\n <option value=\"SEGUNDO SEMESTRE\" >SEGUNDO SEMESTRE</option>\n <option value=\"TERCER SEMESTRE\" >TERCER SEMESTRE</option>\n <option value=\"CUARTO SEMESTRE\" selected=\"true\">CUARTO SEMESTRE</option>\n <option value=\"QUINTO SEMESTRE\">QUINTO SEMESTRE</option>\n <option value=\"SEXTO SEMESTRE\">SEXTO SEMESTRE</option>';\n }else if($materia->Semestre=='QUINTO SEMESTRE'){\n $opciones2='<option value=\"PRIMER SEMESTRE\">PRIMER SEMESTRE</option>\n <option value=\"SEGUNDO SEMESTRE\" >SEGUNDO SEMESTRE</option>\n <option value=\"TERCER SEMESTRE\" >TERCER SEMESTRE</option>\n <option value=\"CUARTO SEMESTRE\" >CUARTO SEMESTRE</option>\n <option value=\"QUINTO SEMESTRE\" selected=\"true\">QUINTO SEMESTRE</option>\n <option value=\"SEXTO SEMESTRE\">SEXTO SEMESTRE</option>';\n }else if($materia->Semestre=='SEXTO SEMESTRE'){\n $opciones2='<option value=\"PRIMER SEMESTRE\">PRIMER SEMESTRE</option>\n <option value=\"SEGUNDO SEMESTRE\" >SEGUNDO SEMESTRE</option>\n <option value=\"TERCER SEMESTRE\" >TERCER SEMESTRE</option>\n <option value=\"CUARTO SEMESTRE\" >CUARTO SEMESTRE</option>\n <option value=\"QUINTO SEMESTRE\" >QUINTO SEMESTRE</option>\n <option value=\"SEXTO SEMESTRE\" selected=\"true\">SEXTO SEMESTRE</option>';\n }\n }\n if(isset($r->Clave_M)){\n\n return view('materias.modificar' ,compact('materia','opciones','opciones2','opcionesBachillerato','opcionesFormacion'));\n }else{\n\n\n $materias=Materia::all();\n foreach ($materias as $materia) {\n # code...\n if($re->has($materia->Clave_M)){\n //return \"materia : \".$materia;\n return view('materias.vista' ,compact('materia','opciones','opciones2','opcionesBachillerato'));\n }\n }\n\n $materias=Materia::where([['Clave_M',$re->claveOriginal]])->get();\n\n foreach ($materias as $materia) {\n # code...\n\n\n return view('materias.modificar' ,compact('materia','opciones','opciones2' ,'opcionesFormacion','opcionesBachillerato'));\n }\n\n }\n }", "protected function _update_selected_values() {\n\t\t$this->selected = Array();\n\t\tforeach ($this->options as $value => $label) {\n\t\t\tif (isset($_POST[$this->name().'_'.$value])) {\n\t\t\t\t$this->selected [$this->name().'_'.$value] = true;\n\t\t\t}\n\t\t}\n\t}", "function dropdown_teknisi()\n { \n //Query untuk mengambil data user yang memiliki level 'Technician'\n $query = $this->db->query(\"SELECT A.username, B.nama FROM user A LEFT JOIN karyawan B ON B.nik = A.username WHERE A.level = 'Technician'\");\n\n //Value default pada dropdown\n $value[''] = '-- CHOOSE --';\n //Menaruh data user teknisi ke dalam dropdown, value yang akan diambil adalah value id_user yang memiliki level 'Technician'\n foreach ($query->result() as $row) {\n $value[$row->username] = $row->nama;\n }\n return $value;\n }", "function print_multicheck($value){\n\t\techo $this->before_option_title.$value['name'].$this->after_option_title;\n\t\t$input_value = $this->get_field_value($value['id']);\n\t\t\n\t\t$checked_class=$value['class']==''?'include':$value['class'];\n\t\techo '<input name=\"'.$value['id'].'\" id=\"'.$value['id'].'\" type=\"hidden\" value=\"'.$input_value.'\" class=\"hidden-value\" /><div class=\"option-check '.$checked_class.'\">';\n\t\t\n\t\t$input_array=explode(',',$input_value);\n\t\tforeach ($value['options'] as $option) {\n\t\t\t$class='';\t\n\t\t\t if (in_array($option['id'], $input_array)) {\n\t\t\t\t$class = ' selected-check';\n\t\t\t }\n\t\t\techo '<div class=\"check-holder\"><a href=\"\" class=\"check'.$class.'\" title=\"'.$option['id'].'\"></a><span class=\"check-value\">'.$option['name'].'</span></div>'; \n\t\t} \n\t\techo '</div>';\n\t\n\t\t$this->close_option($value);\n\t}", "function testSelectedOption(){\n\t\t#mdx:SelectedOption\n\t\t$select = new HtCklist(\"select_days\");\n\t\t$select->options([1=>'Mon',2=>'Tue',3=>'Wed',4=>'Thu',5=>'Fri',6=>'Sat']);\n\t\t$select->context(['select_days'=>[2,5]]); // check Tue and Fri\n\t\t#/mdx echo $select\n\t\t$this->expectOutputRegex(\"/input.*?2.*checked.*?input.*?5.*?checked/s\");\n\t\techo $select;\n\t}", "public function selectAllForms();", "function SELECTanneesco ($champs,$valeur,$vide,$verrou)\n{\n $anneemax = date(\"Y\");\n html('<select name=\"'.$champs.'\" size=\"1\"'.$verrou.'>');\n list($annee, $mois, $jour) = explode(\"-\", $valeur);\n if ($vide==1)\n {\n if ($annee == 0) \n html(' <option value=\"0\" selected></option>');\n else\n html(' <option value=\"0\"></option>');\n }\n for ($i=$anneemax;$i>=2000;$i--)\n {\n if ($i == $annee) \n html(' <option value=\"'.$i.'\" selected>'.scolaire($i).'</option>');\n else\n html(' <option value=\"'.$i.'\">'.scolaire($i).'</option>');\n }\n html('</select>');\n}", "function select_type($who){\t\n\t$textareas = array('note'); \n\t$select = array('centro_di_ricavo','proprietario','anno_di_interesse','interessato_a','campagna_id',\"source_potential\",'vettura_posseduta_alimentazione','pagamento_vettura','experience_level',\"mansione\",\"paese\",\"proprietario\",\"status_pagamento\",\"causale\",\"metodo_di_pagamento\");\n\t$select_text = array(\"provincia\",\"citta\");\n\t$disabled = array(\"messaggio\",\"data_creazione\",\"visite\");\n\t$hidden = array('industry',\"paese\",'marchio',\"data_assegnazione\",\"data_scadenza\",\"data_scadenza_venditore\",'venditore',\"company\",\"job_title\",\"data_creazione\",\"sent_mail\",\"in_use\",'is_customer',\"data_aggiornamento\",\"ip\",\"operatore\");\n\t$radio = array('rito_civile');\n\t$text = array();\n\t$selectbtn = array('location_evento',\"status_potential\",'attivo');\t\n\t$calendario = array('data_visita');\t\n\t$file = array();\n\t$invisible = array('priorita_contatto');\n\t$datePicker = array();\n\t$checkbox = array('tipo_interesse');\n\t$multi_selection = array(\"ambienti\",\"mesi_di_interesse\",\"giorni_di_interesse\");\n\t$ifYesText = array();\t\t\n\tif(defined('tab_prefix') && @tab_prefix == 'hrc') $hidden = array(\"indirizzo\",\"ragione_sociale\",\"partita_iva\",\"paese\",\"\",\"\",\"data_assegnazione\",\"data_scadenza\",\"data_scadenza_venditore\",'venditore',\"website\",\"fatturato_annuo\",\"mansione\",\"company\",\"job_title\",\"numero_dipendenti\",\"data_creazione\",\"sent_mail\",\"in_use\",\"status_potential\",'is_customer',\"data_aggiornamento\",\"marchio\",\"ip\",\"operatore\");\n\t\n\tif(isset($_GET['id'])) { \n\tif(check($_GET['id']) == 1) { \n\t\tarray_push($invisible,'anno_di_interesse','ambienti','mesi_di_interesse','tipo_interesse','periodo_interesse','preferenze_menu','prezzo_preventivato'); \n\t\tarray_push($hidden,'cap','proprietario','messaggio','rito_civile'); \n\t\tif(check($_GET['status_potential']) != 1) array_push($hidden,'source_potential'); \n\t}}\n\n\t$type = 1;\n\t\n\tif(in_array($who,$select)) { $type = 2; }\n\tif(in_array($who,$select_text)) { $type = 12; }\t\n\tif(in_array($who,$textareas)){ $type = 3; }\n\tif(in_array($who,$disabled)){ $type = 4; }\n\tif(in_array($who,$radio)){ $type = 8; }\n\tif(in_array($who,$calendario)){ $type = 20; }\n\tif(in_array($who,$file)){ $type = 18; }\n\tif(in_array($who,$text)){ $type = 24; }\n\tif(in_array($who,$checkbox)){ $type = 19; }\n\tif(in_array($who,$selectbtn)){ $type = 9; }\n\tif(in_array($who,$multi_selection)){ $type = 23; }\n\tif(in_array($who,$checkbox)){ $type = 19; }\n\tif(in_array($who,$datePicker)){ $type = 11; }\n\tif(in_array($who,$ifYesText)){ $type = 13; }\n\tif(in_array($who,$hidden)){ $type = 5; }\n\tif(in_array($who,$invisible)){ $type = 7; }\n\n\treturn $type;\n\t}", "function montar_select_perfilPaciente(&$select_perfis, $objPerfilPaciente, $objPerfilPacienteRN, &$objPaciente) {\n $selected = '';\n $arr_perfis = $objPerfilPacienteRN->listar($objPerfilPaciente);\n\n $select_perfis = '<select class=\"form-control selectpicker\" onchange=\"val()\" id=\"select-country idSel_perfil\"'\n . ' data-live-search=\"true\" name=\"sel_perfil\">'\n . '<option data-tokens=\"\" ></option>';\n\n foreach ($arr_perfis as $perfil) {\n $selected = '';\n if ($perfil->getIdPerfilPaciente() == $objPaciente->getIdPerfilPaciente_fk()) {\n $selected = 'selected';\n }\n\n $select_perfis .= '<option ' . $selected . ' value=\"' . $perfil->getIdPerfilPaciente() . '\" data-tokens=\"' . $perfil->getPerfil() . '\">' . $perfil->getPerfil() . '</option>';\n }\n $select_perfis .= '</select>';\n}", "function htmlSelect($nombre,$selected,$class=\"\") \n { \n $cad='';\n //radio de male\n $cad.='<select name=\"'.$nombre.'\" ';\n if(strlen($class)>0)\n $cad.='class=\"'.$class.'\" ';\n $cad.='>';\n //male\n $cad.=' <option value=\"'.$this->male().'\" ';\n if($this->sex_id==$selected)\n $cad.='selected';\n $cad.='>'.$this->sex_name.'</option>';\n //female\n $cad.=' <option value=\"'.$this->female().'\" ';\n if($this->sex_id==$selected)\n $cad.='selected';\n $cad.='>'.$this->sex_name.'</option>';\n $cad.='</select>';\n return($cad);\n }", "public function fieldSelect($sId=\"\",$sNome=\"\",$aValue=\"\",$sLunghezza=0,$sTag=\"\", $jolly=\"\"){\r\n\t\t\r\n\t\tif($sTag==\"\"){\r\n\t\t\techo \"<select name=\\\"\" . $sNome . \"\\\">\";\r\n\t\t}else{\r\n\t\t\techo \"<select name=\\\"\" . $sNome . \"\\\"\" . $sTag . \">\";\r\n\t\t}\r\n\r\n\t\tforeach($aValue as $key=>$value){\r\n\t\t\tif(substr($value,0,1)==$jolly){\r\n\t\t\t\techo \"<option style=\\\"font-weight:bold;\\\" value=\\\"\" . $key . \"\\\">Gruppo: \" . substr($value,1) . \"</option>\";\r\n\t\t\t}else{\r\n\t\t\t\techo \"<option value=\\\"\" . $key . \"\\\">\" . $value . \"</option>\";\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\techo \"</select>\";\r\n\t\t\r\n\t}", "function get_selection($marke, $sorte, $form, $alkohol){\n\n\n $sql = \"SELECT name FROM biersorten WHERE \"; /*Der Grundbefehl*/\n\n if($marke != \"\"){ /*Abhängig davon, ob die Variable leer ist oder nicht,*/\n $sql .= \"marke = '$marke' AND \"; /*wird diese in das sql-Statement integriert*/\n $sql_ok = true; /*Mit dem Punkt (.) wird der Befehl hinzugefügt.*/\n }\n\n if($sorte != \"\"){\n $sql .= \"sorte = '$sorte' AND \";\n $sql_ok = true;\n }\n\n if($form != \"\"){\n $sql .= \"form = '$form' AND \";\n $sql_ok = true;\n }\n\n if($alkohol != \"\"){\n $sql .= \"alkohol = '$alkohol' AND \";\n $sql_ok = true;\n }\n\n $sql = substr_replace($sql, ' ', -4, 3); /*Das letzte AND im sql-Befehl wird gelöscht.\n Man weiss ja nicht, welche Variablen alle übergeben werden.*/\n $sql .=\"ORDER BY name;\";\n return get_result($sql);\n\n\n }", "function select_equipement_etat($selected='',$htmlname='fk_etatequipement',$showempty=0,$hidetext=0)\n{\n global $db,$langs,$user,$conf;\n\n\tif (empty($hidetext)) print $langs->trans(\"EquipementState\").': ';\n\t\n\t// boucle sur les entrepots\n\t$sql = \"SELECT rowid, libelle\";\n\t$sql.= \" FROM \".MAIN_DB_PREFIX.\"c_equipement_etat\";\n\t$sql.= \" WHERE active = 1\";\n\t\n\tdol_syslog(\"Equipement.Lib::select_equipement_etat sql=\".$sql);\n\n\t$resql=$db->query($sql);\n\tif ($resql)\n\t{\n\t\t$num = $db->num_rows($resql);\n\t\t$i = 0;\n\t\tif ($num)\n\t\t{\n\t\t\tprint '<select class=\"flat\" name=\"'.$htmlname.'\">';\n\t\t\tif ($showempty)\n\t\t\t{\n\t\t\t\tprint '<option value=\"-1\"';\n\t\t\t\tif ($selected == -1) print ' selected=\"selected\"';\n\t\t\t\tprint '>&nbsp;</option>';\n\t\t\t}\n\t\t\twhile ($i < $num)\n\t\t\t{\n\t\t\t\t$obj = $db->fetch_object($resql);\n\t\t\t\tprint '<option value=\"'.$obj->rowid.'\"';\n\t\t\t\tif ($obj->rowid == $selected) print ' selected=\"selected\"';\n\t\t\t\tprint \">\".$langs->trans($obj->libelle).\"</option>\";\n\t\t\t\t$i++;\n\t\t\t}\n\t\t\tprint '</select>';\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// si pas de liste, on positionne un hidden à vide\n\t\t\tprint '<input type=\"hidden\" name=\"'.$htmlname.'\" value=-1>';\n\t\t}\n\t}\n}", "function InputSelect($modelname1,$VariableName,$default,$taille=\"\",$autres=\"\")\t{\n\n\t\t$modelname=&$modelname1;\n\n\t\t// gestion readonly\n\t\tif($_SESSION[\"readonly\"]==\"true\")\n\t\t\t$cache=\"disabled\";\n\n\t\t// check taille \n\t\tif ($taille > 1)\n\t\t\t$_taille=\"WIDTH='$taille' STYLE='width: \".$taille.\"px'\";\n\t\t\n\t \t$res= \"<select $_taille name='\".$VariableName.\"' id='\".$VariableName.\"' $autres $cache>\";\n\n\t\t// check nbr elements et proposee selectionne par default\t \t\n\t \tif(count($modelname) >1 ){\n\t\t\t$res.= \"<option value='' selected>Selectionnez</option>\";\n\t\t}\n\t \tfor($i=0;$i < count($modelname);$i++){\n\t \t\tlist($val,$libelle)=explode(\"|\",$modelname[$i]);\n\n\t \t\tif ($default==$val)\n\t\t \t\t$res.= \"<option value='$val' selected>\".htmlentities($libelle).\"</option>\";\n\t\t \telse\n\t\t \t\t$res.= \"<option value='$val' >\".htmlentities($libelle).\"</option>\";\n\t\t \t\n\t\t}\n\t\t \t\t$res.= \"</select>\";\n\t\treturn $res;\n\t}", "private function klantGebruikerToevoegenAction()\n {\n //controlleert of er een formulier is ingevuld\n if (isset($_POST) && !empty($_POST))\n {\n //kijkt of de gebruikersnaam al bestaat en geeft dan een boolean terug\n $bestaatGN = $this->model->bestaatGN();\n //false als de gebruikersnaam niet bestaat\n if ($bestaatGN === FALSE)\n {\n //controleert of de wachtwoorden overeenkomen\n if ($_POST['wachtwoord'] === $_POST['wachtwoord2'])\n {\n $this->model->maakKlantGebruiker();\n //stuurt je naar de gebruikersbeheer pagina\n $this->model->foutGoedMelding('success', '<strong>Gelukt!</strong> klant gebruiker is aangemaakt. <span class=\"glyphicon glyphicon-saved\"></span>');\n $this->model->setLog('Klang gebruiker aanmaken', 1);\n $this->forward('gebruikersBeheer', 'admin');\n } else\n {\n $this->view->set('opmerking', 'Wachtwoorden komen niet overeen');\n }\n } else\n {\n $this->view->set('opmerking', 'Gebruikersnaam is al in gebruik');\n }\n }\n $klanten = $this->model->geefKlanten();\n $this->view->set('klanten', $klanten);\n }", "function selectpais(){\n\n\t$listado= mysql_query( 'SELECT * FROM country');\n\t \n\twhile ($key = mysql_fetch_array($listado)) {\n\t\t\techo'<option value=\"'.mb_convert_encoding($key['Code'], \"UTF-8\").'\">'.mb_convert_encoding($key['Name'], \"UTF-8\").'</option>';\n\t\t}\n\t\n}", "public function llenarCombo()\n {\n\n \n \t$area_destino = $_POST[\"dir\"];\n\n \t$options=\"\";\n \t\n \t$deptos = $this ->Modelo_direccion->obtenerCorreoDepto($area_destino);\n\n \tforeach ($deptos as $row){\n \t\t$options= '\n \t\t<option value='.$row->email.'>'.$row->email.'</option>\n \t\t'; \n \t\techo $options; \n \t}\n \t\n\n }", "private function selectedCheckbox($parametro)\n {\n if($parametro==1)\n {\n return 'checked';\n }\n else\n {\n return '';\n }\n }", "function GetProjektSelectMitarbeiter($adresse)\n {\n // gibt man kein parameter an soll alles zurueck\n // entsprechen weitere parameter filtern die ausgabe\n $arr = $this->app->DB->SelectArr(\"SELECT adresse FROM bla bla where rolle=mitarbeiter von projekt xxx\");\n foreach($arr as $value)\n {\n if($selected==$value) $tmp = \"selected\"; else $tmp=\"\";\n $ret .= \"<option value=\\\"$value\\\" $tmp>$value</option>\";\n }\n return $ret;\n\n\n }", "public function getSelectForm(){\n \treturn View::make('Checklist.SelectForm',array(\n \t\t'MainMenu' => View::make('Menu.MainMenu',array(\n \t\t\t'MoreMenu' => Util::getMenu()\n \t\t)),\n \t\t'Areas' => Util::getSelectAreas(),\n \t\t'Tiendas' => Util::getSelectTiendas()\n \t));\n }", "function select($name='',$class='',$optName='',$id='',$attrib='') {\n\t\t$n = '';\n\t\t$option = '';\n\t\t$fldname = str_replace(' ', '_', $name);\n\t\tif(isset($_SESSION[$fldname])) $n = $_SESSION[$fldname];\n\t\tif(isset($_POST[$fldname])) $n = $_POST[$fldname]; \n\t\tforeach($optName as $optVal){\n\t\t\t$cndtn = ($n == $optVal)? 'selected=\"selected\"' : '';\n\t\t\t$option .= '<option value=\"'.$optVal.'\" '.$cndtn.'>'.$optVal.'</option>';\t\t\n\t\t}\n\t\t$select = '<select name=\"'.$fldname.'\" class=\"'.$class.'\" id=\"'.$id.'\" '.$attrib.'>'.$option.'</select>';\n\t\techo $select;\n\t}", "function selectAndPick(sfTestBrowser $t, array $options)\n{\n foreach($options as $check => $value)\n {\n $t->setField($check . \"_check\", 1);\n $t->setField($check, $value);\n }\n\n return $t;\n}", "function checkboxes(){\n if($this->ChkReal->Checked){\n $this->avance_real = 'Si';\n }else{\n $this->avance_real = 'No';\n }\n if($this->ChkProg->Checked){\n $this->avance_prog = 'Si';\n }else{\n $this->avance_prog = 'No';\n }\n if($this->ChkComent->Checked){\n $this->comentario = 'Si';\n }else{\n $this->comentario = 'No';\n }\n if($this->ChkPermiso->Checked){\n $this->permiso = 'Si';\n }else{\n $this->permiso = 'No';\n }\n if($this->ChkTipoA->Checked){\n $this->tipo_admon = 'Si';\n }else{\n $this->tipo_admon = 'No';\n }\n }", "function selected($field, $value = null) {\n if ( is_string($field) ) {\n if ( $this->setting($field) == $value ) {\n echo 'selected=\"selected\"';\n }\n } else if ( (bool) $field ) {\n echo 'selected=\"selected\"';\n }\n }", "function get_combo_eventos() {\n $query = $this->db->query(\"select * from evento\");\n \n $result = \"\";\n if ($query) {\n if ($query->num_rows() == 0) {\n return false;\n } else {\n foreach ($query->result() as $reg) {\n $data[$reg->nEveId] = $reg->cEveTitulo;\n }\n $result=form_dropdown(\"cbo_evento_listar\", $data,'','id=\"cbo_evento_listar\" class=\"chzn-select\" style=\"width:250px\" required=\"required\"');\n //$result=form_dropdown(\"cbo_evento_listar\", $data,'','id=\"cbo_evento_listar\" style=\"width:auto\" required=\"required\"');\n return $result;\n }\n } else {\n return false;\n }\n }", "function clientes( $cliente = null )\n{\n\tglobal $con;\n\t$sql = \"Select Id,Nombre from clientes\n\twhere `Estado_de_cliente` like '-1'\n\tor `Estado_de_cliente` like 'on' order by Nombre\";\n\t$consulta = mysql_query($sql,$con);\n\twhile(true == ($resultado = mysql_fetch_array($consulta))) {\n\t\t$seleccionado = ( $cliente == $resultado[0]) ? \"selected\" : \"\";\n\t\t$texto .= \"<option \".$seleccionado.\" value='\".$resultado[0].\"'>\"\n\t\t. $resultado[1] . \"</option>\";\n\t}\n\treturn $texto;\n}", "function frmEstimacionesShow($sender, $params)\n {\n $items[\"uno\"]=\"ADICIONAL\";\n $items[\"dos\"]=\"ADITIVA/DEDUCTIVA\";\n $items[\"tres\"]=\"EXTRAORDINARIA\";\n $items[\"cuatro\"]=\"NORMAL\";\n $this->cboTipo->setItems($items);\n $this->txtMoneda->Text=\"MONEDA NACIONAL\";\n }", "public function selected()\n {\n parent::selected();\n $this->name = '';\n }", "function listadoSelect();", "public function getIsMultipleSelect(){\n return true;\n }", "function htmlSelect($nombre,$selected,$class=\"\") \n { \n $cad='';\n $cad.='<select name=\"'.$nombre.'\" ';\n if(strlen($class)>0)\n $cad.='class=\"'.$class.'\"';\n $cad.=' >';\n //single\n $cad.=' <option value=\"'.$this->single().'\" ';\n if($this->marsta_id==$selected)\n $cad.='selected';\n $cad.='>'.$this->marsta_name.'</option>';\n //married\n $cad.=' <option value=\"'.$this->married().'\" ';\n if($this->marsta_id==$selected)\n $cad.='selected';\n $cad.='>'.$this->marsta_name.'</option>';\n //divorced\n $cad.=' <option value=\"'.$this->divorced().'\" ';\n if($this->marsta_id==$selected)\n $cad.='selected';\n $cad.='>'.$this->marsta_name.'</option>';\n $cad.='</select>';\n return($cad);\n }", "public function form()\r\n {\r\n $this->switch('field_select_create', Support::trans('main.select_create'))\r\n ->default(admin_setting('field_select_create'));\r\n }", "function mc_option_selected( $field, $value, $type = 'checkbox' ) {\n\tswitch ( $type ) {\n\t\tcase 'radio':\n\t\tcase 'checkbox':\n\t\t\t$result = ' checked=\"checked\"';\n\t\t\tbreak;\n\t\tcase 'option':\n\t\t\t$result = ' selected=\"selected\"';\n\t\t\tbreak;\n\t\tdefault:\n\t\t\t$result = '';\n\t\t\tbreak;\n\t}\n\tif ( $field == $value ) {\n\t\t$output = $result;\n\t} else {\n\t\t$output = '';\n\t}\n\n\treturn $output;\n}", "function ajax_mamh()\r\n {\r\n $kieumh=$this->input->post(\"kieumh\");\r\n $mamh=$this->input->post(\"mamh\");\r\n $nhom_monhoc_result=$this->mmonhoc->get_ma_monhoc_nhom();\r\n \r\n if($kieumh!=\"NHOM\")// khong phai mon hoc dai dien\r\n { \r\n echo \"<input name='mamh' id='mamh' type='text' title='Mã môn học gồm 5 kí tự' value=''/></td>\"; \r\n }\r\n else// mon hoc dai dien\r\n { \r\n echo \"<select id='mamh' name='mamh'>\";\r\n foreach($nhom_monhoc_result as $nhom_row)\r\n { \r\n $manhom=$nhom_row->MaNhom;\r\n if($mamh==$manhom)echo \"<option value='$manhom' selected='selected'>$manhom</option>\"; \r\n else echo \"<option value='$manhom'>$manhom</option>\";\r\n }\r\n echo \"</select>\";\r\n }\r\n }", "function LUPE_option_combo_vet($Vet, $NomeCombo, $PreSelect, $LinhaFixa = ' ', $JS = '', $Style = '')\r\n{\r\n\r\n $numrows = count($Vet);\r\n\r\n $html = \"<select id='$NomeCombo' name='$NomeCombo' $JS style='$Style'>\\n\";\r\n\r\n\tif ($LinhaFixa != '')\r\n\t\t$html .= \"<option value=''>$LinhaFixa</option>\\n\";\r\n\r\n if ($numrows == 0) {\r\n\t\t$html .= \"<option value=''>Não há informação no sistema</option>\\n\";\r\n } else {\r\n\t ForEach($Vet as $Chave => $Valor ){\r\n \t\t $html .= \"<option value='$Chave'\";\r\n\r\n\t\t if ($PreSelect == $Chave)\r\n\t\t\t$html .= 'selected >';\r\n \t\t else\r\n\t\t\t$html .= '>';\r\n\r\n\t \t $html .= \"$Valor</option>\\n\";\r\n }\r\n }\r\n\r\n $html .= '</select>';\r\n\r\n return $html;\r\n}", "function is_selected($field,$id,$value,$postdata,$type)\n{\n\t$selected=($type==\"check\")?\"checked='checked'\":\"selected='selected'\";\n\tif(is_array($postdata)&&is_array($postdata[$field]))\n\t{\n\t\treturn (array_key_exists($field,$postdata)&&strtolower($postdata[$field][$id])==strtolower($value))?$selected:\"\";\n\t}\n\telse if(is_array($postdata))\n\t{\n\t\treturn (array_key_exists($field,$postdata)&&strtolower($postdata[$field])==strtolower($value))?$selected:\"\";\n\t}\n}", "function option1($id){\n\n\n$dat=\"\";\n$dat.= ' <option>Sila Pilih</option>';\n$dat.= ' <option ';\nif($id=='1') $dat.= ' selected=selected ';\n$dat.= ' value=\"1\" ';\n$dat.= '>Ada</option>';\n$dat.= ' <option ';\nif($id=='0') $dat.= ' selected=selected ';\n$dat.= ' value=\"0\" ';\n$dat.= '>Tiada</option>';\n\n\nreturn $dat;\n}", "function uf_cmb_tiposervicio($as_seleccionado)\r\n\t{\r\n\t\t$lb_valido=true;\r\n\t\t$ls_sql=\"SELECT codtipservicio, dentipservicio \". \r\n\t\t \" FROM sme_tiposervicio WHERE codemp='\".$this->ls_codemp.\"'\".\" ORDER BY codtipservicio\";\r\n\t\t//print $ls_sql;\r\n\t\t$rs_result=$this->io_sql->select($ls_sql);\t\t\r\n\t\tif($rs_result===false)\r\n\t\t {\r\n\t\t\t$this->io_msg->message(\"CLASE->Buscar Tipos de Servicios Médicos MÉTODO->uf_cmb_tiposervicios ERROR->\".$this->io_function->uf_convertirmsg($this->io_sql->message));\r\n\t\t\t$lb_valido=false;\r\n\t\t\t//return false;\t\t\t\r\n\t\t }\r\n\t\t else\r\n\t\t {\r\n\t\t\tprint \"<select name='cmbcodtiptar' id='cmbcodtiptar' onchange='javascript: ue_cargargrid();'>\";\r\n\t\t\tprint \" <option value='00'>-- Seleccione Servicio Médico--</option>\";\r\n\t\t\twhile($row=$this->io_sql->fetch_row($rs_result))\r\n\t\t\t{\r\n\t\t\t\t$ls_seleccionado=\"\";\r\n\t\t\t\t$ls_codtipservicio=$row[\"codtipservicio\"];\r\n\t\t\t\t$ls_dentipservicio=$row[\"dentipservicio\"];\r\n\t\t\t\t$ls_operacion=\"\";\r\n\t\t\t\tif($as_seleccionado==$ls_codtipservicio)\r\n\t\t\t\t{\r\n\t\t\t\t\t$ls_seleccionado=\"selected\";\r\n\t\t\t\t}\r\n\t\t\tprint \"<option value='\".$ls_codtipservicio.\"' \".$ls_seleccionado.\">\".$ls_dentipservicio.\" - \".$ls_operacion.\"</option>\";\r\n\t\t\t}\r\n\t\t\t$this->io_sql->free_result($rs_result);\r\n\t\t\tprint \"</select>\";\r\n\t\t }\r\n\treturn $lb_valido;\r\n\t}", "public function controleur_option()\n {\n $this->load->model('m_utilisateurs');\n $resultat = $this->m_utilisateurs->liste_option();\n $results = json_decode(json_encode($resultat), true);\n\n echo \"<option value='' selected='selected'>(choisissez)</option>\";\n foreach ($results as $row) {\n echo \"<option value='\" . $row['utl_id'] . \"'>\" . $row['utl_nom'] . \"</option>\";\n }\n }", "public function Do_select_Example1(){\n\n\t}", "public function select_values_for_form( EntryValueSelect $entry_value_select );", "public function list_gestiones(){\n $listar_gestion= $this->model_configuracion->lista_gestion();\n $tabla='';\n\n $tabla.='\n <input type=\"hidden\" name=\"gest\" id=\"gest\" value=\"'.$this->gestion.'\">\n <select name=\"gestion_usu\" id=\"gestion_usu\" class=\"form-control\" required>\n <option value=\"0\">seleccionar gestión</option>'; \n foreach ($listar_gestion as $row) {\n if($row['ide']==$this->gestion){\n $tabla.='<option value=\"'.$row['ide'].'\" select >'.$row['ide'].'</option>';\n }\n else{\n $tabla.='<option value=\"'.$row['ide'].'\" >'.$row['ide'].'</option>';\n }\n };\n $tabla.='</select>';\n return $tabla;\n }", "protected function getSelectedValue() {}", "function post_notification_select($var, $comp){\r\n\tif(get_option('post_notification_' . $var) == $comp) return ' selected=\"selected\" ';\r\n\telse return '';\r\n}", "function _select($name,$options){\n\t\t$selectAtts = \"name='$name' \";\n\t\t$optionFields = '';\n\t\tif ($options['multiple']) {\n\t\t\t$selectAtts.=\"multiple='multiple' \";\n\t\t}\n\t\tforeach ($options['options'] as $key => $label) {\n\t\t\t$optionAtts = \"value = \\\"$key\\\" \";\n\t\t\tif ($key == $options['value']) {\n\t\t\t\t$optionAtts.= \"selected='selected' \";\n\t\t\t}\n\t\t\t$optionFields.=sprintf($this->inputTags['option'],$label,$optionAtts);\n\t\t}\n\t\t\n\t\treturn sprintf($this->inputTags['select'],$optionFields,$selectAtts);\t\t\n\t}", "static function html_select(array $input,$name,$sled=''){\n\t\t$ret='';\n\t\t\t$ret.='<select name=\"'.$name.'\">';\n\t\tforeach($input as $k=>$v){\n\t\t\t$tmp_def = $sled == $k ? 'selected=\"selected\"':'';\n\t\t\t$ret.='<option value=\"'.$k.'\" '.$tmp_def.'>'.$v.'</option>';\n\n\t\t}\n\t\t$ret.='</select>';\n\t\treturn $ret;\n\t}", "function SelectValuesUnidadesPerteneceMedico($db_conx, $cod_med) {\r\n $sql = \"SELECT uni_codigo, uni_descrip FROM vunidadmedico WHERE med_codigo = $cod_med ORDER BY uni_descrip ASC\";\r\n\r\n $query = mysqli_query($db_conx, $sql);\r\n\r\n $n_filas = $query->num_rows;\r\n $data = '<select style=\"width: 400px;\" onchange=\"getLocalizacionData();\"';\r\n if ($n_filas == 1) {\r\n $data .= 'id=\"cmbunidad\" disabled=\"true\">';\r\n $row = mysqli_fetch_array($query);\r\n $data .= '<option value=\"' . $row[0] . '\">' . $row[1] . '</option>';\r\n } else {\r\n $data .= 'id=\"cmbunidad\">';\r\n $c = 0;\r\n while ($c < $n_filas) {\r\n $row = mysqli_fetch_array($query);\r\n $data .= '<option value=\"' . $row[0] . '\">' . $row[1] . '</option>';\r\n $c++;\r\n }\r\n }\r\n $data .= '</select\">';\r\n echo $data;\r\n}", "public function valiteForm();", "public function select($usuario_has_hojaruta);", "function show_filter_valid($filter_valid)\n\t\t{\n\t\t\t$this->t->set_var(array('filter_valid_up'=>$filter_valid));\n\t\t\t//show the select\n\t\t\t$this->t->set_var(array(\n\t\t\t\t'selected_valid_all'\t\t=> ($filter_valid == '')? 'selected=\"selected\"' : '',\n\t\t\t\t'selected_valid_valid'\t\t=> ($filter_valid == 'y')? 'selected=\"selected\"' : '',\n\t\t\t\t'selected_valid_invalid'\t=> ($filter_valid == 'n')? 'selected=\"selected\"' : '',\n\t\t\t));\n\t\t}", "public function selctTiposUs(){\r\n?>\r\n<div align=\"center\">\r\n\t<table>\r\n\t\t\t<tr>\r\n\t\t\t\t<td class=\"ui-corner-all ui-widget-header\" align=\"center\">SELECCIONE EL TIPO</td>\r\n\t\t\t</tr>\r\n\t\t\t<tr>\r\n\t\t\t\t<td><select id=\"tipo_correspon_usuario\" onchange=\"selecccionaTipoUs(this.value);\" style=\"width: 200px\">\r\n\t\t\t\t\t\t<option value=\"\">- Tipo -</option>\r\n\t\t\t\t\t\t<option value=\"1\">Tipo Usuario</option>\r\n\t\t\t\t\t\t<option value=\"2\">Tipo Telefono</option>\r\n\t\t\t\t\t\t<option value=\"3\">Tipo Correo</option>\r\n\t\t\t\t\t\t<option value=\"4\">Tipo Rol</option>\r\n\t\t\t\t\t\t<option value=\"5\">Tipo Direcci&oacute;n</option>\r\n\t\t\t\t\t\t<option value=\"6\">Tipo Perfil</option>\r\n\t\t\t\t\t</select>\r\n\t\t\t\t</td>\r\n\t\t\t</tr>\r\n\t</table>\r\n</div>\r\n<div id=\"div_selcc_tipo_us\"></div>\r\n<?php\r\n\t}", "protected function get_model_kenaikan_select(){\n $name = $this->get_model_name();\n $default = array( \"class\" => \"selectpicker col-md-12\" , \"name\" => $name , \"id\" => $name , 'selected' => $this->get_value($name) );\n $items = array(\"Persen\" , \"Peringkat\");\n return $this->get_select( $items , $default);\n }", "function validaSelect($selectDestino)\r\n{\r\n\tglobal $listadoSelects;\r\n\tif(isset($listadoSelects[$selectDestino])) return true;\r\n\telse return false;\r\n}", "public function getRegistros()\n {\n if($this->input->post('id_cliente'))\n {\n $id_cliente = $this->input->post('id_cliente'); \n $contratos = $this->m_contratos->getRegistros($id_cliente, 'id_cliente');\n \n echo '<option value=\"\" disabled selected style=\"display:none;\">Seleccione una opcion...</option>';\n foreach ($contratos as $row) \n {\n echo '<option value=\"'.$row->id_vehiculo.'\">'.$row->vehiculo.'</option>';\n }\n }\n }", "function dropdown_perusahaan() {\n $result = $this->db->get('tbl_perusahaan');\n\n // bikin array\n // please select berikut ini merupakan tambahan saja agar saat pertama\n // diload akan ditampilkan text please select.\n $dd[''] = 'Please Select';\n if ($result->num_rows() > 0) {\n foreach ($result->result() as $row) {\n // tentukan value (sebelah kiri) dan labelnya (sebelah kanan)\n $dd[$row->id_perusahaan] = $row->nama_perusahaan;\n }\n }\n return $dd;\n }", "function dropdown_tag ($xmlobjekt, $benutzer, $programmnr, $anweisungsnr, $tagtyp){\n\n #Liest den Wert des Tages aus\n $tagwert=$xmlobjekt->programm[$programmnr]->anweisung[$anweisungsnr]->wenn[0]->bedingung[$tagtyp]->wert[0];\n $index=100000*($benutzer+1)+10000*$programmnr+1000*($anweisungsnr+1)+100*0+10*$tagtyp+3;\n echo \"<select name=$index style=\\\"width:65px;\\\">\";\n if (strpos($tagwert,\"Mo\") !== false) {echo \"<option selected>Mo</option>\";} else {echo \"<option>Mo</option>\";}\n if (strpos($tagwert,\"Di\") !== false) {echo \"<option selected>Di</option>\";} else {echo \"<option>Di</option>\";}\n if (strpos($tagwert,\"Mi\") !== false) {echo \"<option selected>Mi</option>\";} else {echo \"<option>Mi</option>\";}\n if (strpos($tagwert,\"Do\") !== false) {echo \"<option selected>Do</option>\";} else {echo \"<option>Do</option>\";}\n if (strpos($tagwert,\"Fr\") !== false) {echo \"<option selected>Fr</option>\";} else {echo \"<option>Fr</option>\";}\n if (strpos($tagwert,\"Sa\") !== false) {echo \"<option selected>Sa</option>\";} else {echo \"<option>Sa</option>\";}\n if (strpos($tagwert,\"So\") !== false) {echo \"<option selected>So</option>\";} else {echo \"<option>So</option>\";}\n echo \"</select>\";\n}", "function zen_draw_selection_field($name, $type, $value = '', $checked = false, $parameters = '') {\n $selection = '<input type=\"' . zen_output_string($type) . '\" name=\"' . zen_output_string($name) . '\"';\n\n if (zen_not_null($value)) $selection .= ' value=\"' . zen_output_string($value) . '\"';\n\n if ( ($checked == true) || ( isset($GLOBALS[$name]) && is_string($GLOBALS[$name]) && ( ($GLOBALS[$name] == 'on') || (isset($value) && (stripslashes($GLOBALS[$name]) == $value)) ) ) ) {\n $selection .= ' checked=\"checked\"';\n }\n\n if (zen_not_null($parameters)) $selection .= ' ' . $parameters;\n\n $selection .= ' />';\n\n return $selection;\n }", "function get_selected($value,$comparison_value='')\n{\n\treturn ($value == $comparison_value) ? 'selected': ''; \n}", "function visibility_select($current) {\n global $langOpenCourse, $langRegCourse, $langClosedCourse, $langInactiveCourse;\n\n $ret = \"<select class='form-select' name='course_vis'>\\n\";\n foreach (array($langOpenCourse => COURSE_OPEN,\n $langRegCourse => COURSE_REGISTRATION,\n $langClosedCourse => COURSE_CLOSED,\n $langInactiveCourse => COURSE_INACTIVE) as $text => $type) {\n $selected = ($type == $current) ? ' selected' : '';\n $ret .= \"<option value='$type'$selected>\" . q($text) . \"</option>\\n\";\n }\n $ret .= \"</select>\";\n return $ret;\n}", "function cf_familias_seleccionadas(&$Sesion,&$aData) {\n\treturn !store_id_check($Sesion,$aData['Familia_articulos.id_familia']);\n}", "function caldol_add_options_members_filter(){\n\techo '<option value=\"TomChoice\">doggie</option>';\n\t\t\n}", "private function check_Check_Box($sorce){\r\n\r\n if (!isset($sorce['checkbox'])){\r\n\r\n $this->_flag = false;\r\n\r\n Session::put('e_checkbox','You must accept rules');\r\n\r\n Session::delete('w_checkbox');\r\n }\r\n\r\n #Save our choice\r\n else Session::put('w_checkbox',\"checked\");\r\n }", "function selectempreUser()\n {\n $conn = new mysqli(SERVER, USER, PASSWORD, DB);\n $sql = \"SELECT * FROM tb_business\";\n $result = $conn->query($sql);\n if ($result->num_rows > 0)\n {\n $select = \"<label>Empresa</label>\";\n $select .= \"<select class='form-control select2' name='id_business' id='id_business' style='width: 100%;'>\";\n $select .= \"<option selected='selected'>Select</option>\";\n // output data of each row\n while($row = $result->fetch_assoc())\n {\n $select .= \"<option value=\".$row['id_business'].\">\".$row['nombre'].\"</option>\";\n }\n $select .=\"</select>\";\n return $select;\n\n }\n\n }", "function dropdown_ijin() {\n $result = $this->db->get('tbl_ijin');\n\n // bikin array\n // please select berikut ini merupakan tambahan saja agar saat pertama\n // diload akan ditampilkan text please select.\n $dd[''] = 'Please Select';\n if ($result->num_rows() > 0) {\n foreach ($result->result() as $row) {\n // tentukan value (sebelah kiri) dan labelnya (sebelah kanan)\n $dd[$row->id_ijin] = $row->nomor . \"/KODE KANTOR/\" . $row->id_seksi . \"/\" . $row->tahun;\n }\n }\n return $dd;\n }", "function comboRecompensas($id_recompensa = 0, $filter = \"\", $name_control = \"id_recompensa\"){\n\t$elements = recompensasController::getListAction(9999, $filter); ?>\n\t<select name=\"<?php echo $name_control;?>\" id=\"<?php echo $name_control;?>\" class=\"form-control\">\n\t\t<option value=\"0\"> ---- Selecciona una recompensa ---- </option>\n\t\t<?php foreach($elements['items'] as $element):?>\n\t\t<option value=\"<?php echo $element['id_recompensa'];?>\" <?php if ($id_recompensa == $element['id_recompensa']) echo ' selected=\"selected\" ';?>><?php echo $element['recompensa_name'];?></option>\n\t\t<?php endforeach;?>\n\t</select>\n<?php }", "function getNameOptions(){\n $db = JFactory::getDBO();\n $query = $db->getQuery(true);\n \n // Select some fields\n //$query->select('DISTINCT name');\n $query->select('name');\n // From the hello table\n $query->from('#__helloworld_message');\n\t\t\t\t\n\t\t\t\t$db->setQuery($query);\n\t\t\t\t$result = $db->loadObjectList();\n\t\t\t\n\t\t\tforeach($result as $item){\n\t\t\t\t$name = $item->name;\n\t\t\t\t$filter_name_options[] = JHTML::_('select.option', $name , $name);\n\t\t\t\t}\n\t\t\treturn $filter_name_options;\n\t\t\t\n\t\t\t}", "function TampilkanFilterIPKIPS($mnux) {\r\n $arrUrut = array(\"IPS\", \"IPK\");\r\n $optUrut = '';\r\n for ($i = 0; $i < sizeof($arrUrut); $i++) {\r\n $isi = $arrUrut[$i];\r\n $sel = ($isi == $_SESSION['IPUrut'])? 'selected' : '';\r\n $optUrut .= \"<option value='$isi' $sel>$isi</option>\";\r\n }\r\n echo \"<p><table class=box cellspacing=1>\r\n <form action='?' method=POST>\r\n <input type=hidden name='mnux' value='$mnux'>\r\n <tr><td class=inp1><b>Filter</b></td>\r\n <td class=inp>Minimal IPS</td>\r\n <td class=ul><input type=text name='IPSMin' value='$_SESSION[IPSMin]' size=4 maxlength=4></td>\r\n <td class=inp>Minimal IPK</td>\r\n <td class=ul><input type=text name='IPKMin' value='$_SESSION[IPKMin]' size=4 maxlength=4></td>\r\n <td class=inp>Urutkan</td>\r\n <td class=ul><select name='IPUrut'>$optUrut</select></td>\r\n <td class=ul><input type=submit name='Simpan' value='Simpan'></td>\r\n </form></table></p>\";\r\n}", "function langChoice()\n{\n\tglobal $supported;\n\n\tglobal $detailp; //is usefull when on the detail page\n\n\t$rep = '';\n\n\t$rep .= '<form method=\"get\" id=\"langForm\" action=\"' . $_SERVER[\"PHP_SELF\"] . '\">\n\t\t<select onchange=\"submitForm(\\'langForm\\')\" name=\"lang\">';\n\n\tforeach($supported as $elem)\n\t{\n\t\t$rep .= '<option value=\"' . $elem . '\"';\n\n\t\tif ($_SESSION['lang']===$elem)\n\t\t{\n\t\t\t$rep .= ' selected';\n\t\t}\n\t\t$rep .= '>';\n\n\t\t//we usually want 'Français' instead of 'fr' don't we\n\t\t$rep .= (isset(ABR_LANG[$elem])?ABR_LANG[$elem]:$elem);\n\t\t$rep .= '</option>' . PHP_EOL;\n\t}\n\n\t$rep .= '\t</select> ';\n\n\t\t//so that we keep the current IT (and don't redirect afterwards)\n\t\tif (isset($detailp))\n\t\t{\n\t\t\t$rep .= '<input type=\"hidden\" name=\"choix\" value=\"' . $_GET['choix'] . '\"/>';\n\t\t}\n$rep .= '\t</form>';\n\n\treturn $rep;\n}", "function select($args) {\r\n\t\t\t$args = $this->apply_name_fix($this->apply_default_args($args)) ;\r\n\t\t\tif ($args['multiple']) {\r\n\t\t\t\techo \"<select class='optselect chzn-select' multiple='true' style='\" .$this->width($args['width']) . \"' name='\" . $args['formname'] . \"\" . \"[]'>\";\r\n\t\t\t\tforeach ($args['selections'] as $key => $value) {\r\n\t\t\t\t\techo \"<option \" . (array_search($value , $args['value']) === false ? '' : 'selected' ). \" value='\" . $key . \"'>\" . $value . \"</option>\";\t\r\n\t\t\t\t}\t\r\n\t\t\t\techo \"</select>\";\r\n\t\t\t} else {\r\n\t\t\t\techo \"<select class='optselect chzn-select' style='\" .$this->width($args['width']) . \"' name='\" . $args['formname'] . \"'>\";\r\n\t\t\t\tforeach ($args['selections'] as $key => $value) {\r\n\t\t\t\t\techo \"<option \" . ($args['value'] == $key ? 'selected' : '' ). \" value='\" . $key . \"'>\" . $value . \"</option>\";\t\r\n\t\t\t\t}\t\r\n\t\t\t\techo \"</select>\";\r\n\t\t\t}\r\n\t\t\t$this->description($args['description']);\r\n\t\t}", "function afficherListeMultiple($tbObjets, $name, $size, $idSelect) {\n\t\tif (count($tbObjets) && (empty($idSelect))) { \n\t\t\t$idSelect = $tbObjets[0]->identifiant; \n\t\t\t// alors $idSelect est l'identifiant du premier objet du tableau \n\t\t}\n\t\techo '<select name=\"'.$name.'[]\" id=\"'.$name.'[]\" size='.$size.' multiple>';\n\n\t\tforeach ($tbObjets as $objet) { \n\t\t\t// l'élément en paramètre est présélectionné \n\t\t\tif ($objet->identifiant != $idSelect) { \n\t\t\t\t// si l'identifiant de l'objet n'est pas l'identifiant présélectionné \n\t\t\t\techo '<option value='.$objet->identifiant.'>'.$objet->libelle.'</option>';\n\t\t\t} \n\t\t\telse { \n\t\t\t\techo '<option selected value='.$idSelect.'>'.$objet->libelle.'</option>';\n\t\t\t}\n\t\t}\n\t\techo '</select>';\n\t\treturn ($idSelect); \n\t}" ]
[ "0.6385076", "0.627511", "0.6228151", "0.62104064", "0.614142", "0.6098754", "0.6084618", "0.6071072", "0.6070329", "0.6044004", "0.6022828", "0.60216266", "0.60197765", "0.6010798", "0.59949523", "0.59841025", "0.59823984", "0.5953189", "0.59356254", "0.59268", "0.5910984", "0.5910775", "0.5907258", "0.5904148", "0.58952826", "0.58909094", "0.58885777", "0.5881991", "0.5853091", "0.58504695", "0.58312494", "0.58308446", "0.5822463", "0.5817802", "0.58169264", "0.58144563", "0.5805182", "0.5795964", "0.5792535", "0.57911456", "0.5786999", "0.5778755", "0.5775714", "0.5774663", "0.5765644", "0.57513297", "0.57438016", "0.573715", "0.5719653", "0.5718421", "0.56989646", "0.56989425", "0.5692521", "0.568995", "0.5688761", "0.5672233", "0.5671192", "0.56606185", "0.56589353", "0.5651131", "0.56447655", "0.5643097", "0.564056", "0.5636705", "0.5631049", "0.5630538", "0.5628623", "0.5627458", "0.5625116", "0.5619877", "0.5612086", "0.5610507", "0.56096756", "0.56003696", "0.5598725", "0.55944216", "0.5591059", "0.55868536", "0.5582026", "0.5581801", "0.55765533", "0.5573817", "0.55701363", "0.55688304", "0.55608296", "0.55589473", "0.55577296", "0.5552715", "0.5546477", "0.5544997", "0.5544758", "0.55422944", "0.5542238", "0.55414873", "0.55414003", "0.5540198", "0.5540069", "0.55387753", "0.55386645", "0.55385953", "0.55363345" ]
0.0
-1
checked of de email echt is
function invalidEmail($email) { $result; if (!filter_var($email, FILTER_VALIDATE_EMAIL)) { $result = true; } else { $result = false; } return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function verifica_email ($email)\r\n{\r\n\t$retorno = true;\r\n\r\n\t/* Aqui estaria el codigo para verificar \r\n\tla direccion de correo */\r\n\r\n\treturn $retorno;\r\n}", "public function checkEmail() {\n $result = $this->model->checkEmail($_POST);\n if($result) {\n echo \"true\"; \n } else {\n echo \"false\";\n }\n }", "public function isEmail();", "function emailOk ($email) {\r\n return filter_var($email, FILTER_VALIDATE_EMAIL);\r\n }", "function checkemail() {\n\t\tConfigure::write('debug', 0);\n\t\t$this->autoRender = false;\n\t\t$this->layout = \"\";\n\t\t\n\t\t$email = $_REQUEST['data']['Member']['email'];\n\t\t\n\t\t$count = $this->Member->find('count', array(\n\t\t\t'conditions' => array(\n\t\t\t\t'email' => $email\n\t\t\t)\n\t\t));\n\t\t\n\t\t\n\t\tif ($count > 0) {\n\t\t\techo \"false\";\n\t\t} else {\n\t\t\techo \"true\";\n\t\t}\n\t}", "function kiemtra_email($email)\n {\n if($this->default_model->getInfoID($this->_table,array(\"Email\" => $email))!=TRUE){ // ko ton tai $email\n return TRUE;\n }\n else{\n $this->form_validation->set_message(\"kiemtra_email\",sprintf($this->lang->line('error_kiemtra_email'),$email));\n return FALSE;\n }\n }", "function checkEmail()\n {\n\t\t\t$email = $_POST['email'];\n\n\t\t\t// Check its existence (for example, execute a query from the database) ...\n\t\t\t$email_cek = $this->account_model->Check_TblUsers('email',$email);\n\t\t\t\n\t\t\tif($email_cek == 0)\n\t\t\t{\n\t\t\t\t$isAvailable = true;\n\t\t\t}else{\n\t\t\t\t$isAvailable = False;\n\t\t\t} \n\n\t\t\t// Finally, return a JSON\n\t\t\techo json_encode(array(\n\t\t\t\t'valid' => $isAvailable,\n\t\t\t));\n\t\t}", "function checkemail() {\n\t\tConfigure::write('debug', 0);\n\t\t$this->autoRender = false;\n\t\t\n\t\t$email = $_REQUEST['data']['Member']['email'];\n\t\t\n\t\t$count = $this->Member->find('count', array(\n\t\t\t'conditions' => array(\n\t\t\t\t'email' => $email\n\t\t\t)\n\t\t));\n\t\t\n\t\t/*echo $count;\n\t\tdie;*/\n\t\tif ($count > 0) {\n\t\t\techo \"false\";\n\t\t} else {\n\t\t\techo \"true\";\n\t\t}\n\t}", "function email_ok($email,$new=FALSE){\n if(empty($email)) return FALSE;\n if(!preg_match($this->pat_email,$email)) return FALSE;\n if(!$new) return TRUE;\n foreach($this->domains as $umd)\n if($umd->newemail_ok($email)>0) return FALSE;\n return TRUE;\n }", "public function emailJaCadastrado(){\n\t\t$query=$this->con->prepare(\"select email from empresa where email=:email\");\n\t\t//executa o sql e informa o email a ser pesquisado\n\t\t$query->execute(array('email' => $this->email));\n\t\t//retorna resultado com um array assoc\n\t\t$resultado = $query->fetch(PDO::FETCH_ASSOC);\n\t\t//se retorna falso o email não foi cadastrado ainda\n\t\tif($resultado){\n\t\t\treturn true;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}", "public function isCheckEmail()\n {\n if( (!$this -> zgloszePozniej) && ($this -> emailAtt2User == '') ) :\n return false;\n endif;\n return true;\n }", "public function check_email() {\n\n\t\t$email = Input::post('email');\n \n\t\tif(is_string($email)) {\n\t\t\t\n\t\t\t$this->_password_reset->_unlocked_me($email);\n\t\t\t$row = $this->_password_reset->_validate_email($email);\n\t\t\t$res = $this->_password_reset->getData($email);\n\t\t\t$_res = $this->_password_reset->_check_if_reg($email);\n\t\t\t$ques = $this->_question->getquestion($res['question_id']);\n\n\t\t\tif($row > 0) {\n\t\t\t\tif($_res > 0) {\n\t\t\t\t\tif($res['status'] != 0) {\n\t\t\t\t\t\t$_arr = array('msg' =>Constant::EMAIL_CONFIRM, 'question' => $ques['security_question']);\n\t\t\t\t\t\techo json_encode($_arr);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$_arr = array('msg' =>Constant::LOCKED);\n\t\t\t\t\t\techo json_encode($_arr);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$_arr = array('msg' =>Constant::NOT_REGISTERED);\n\t\t\t\t\techo json_encode($_arr);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\theader(\"HTTP/1.0 404 Not Found\");\n\t\t\t\texit;\n\t\t\t}\n\n\t\t} else {\n\t\t\theader(\"HTTP/1.0 404 Not Found\");\n\t\t\texit;\n\t\t}\n\t}", "function verificar_email_usuario($e){\n\t\t\t\t\tinclude('../../conexion.php');/* mediante la consulta busca si concuerda algun usuario */\n\t\t\t\t\t$sql = \"SELECT email from usuarios WHERE status=1 AND BINARY email ='\".$e.\"'\";\n\t\t\t\t\t$rec = mysqli_query($con,$sql)or die(\"valio sombrilla'\".$sql.\"'\"); \n\t\t\t\t\t$count = 0;/* si la consulta es un exito aumenta un contador y como resultado retorna un valor */\n\t\t\t\t\twhile($row = mysqli_fetch_array($rec)){ $count++;}\t\n\t\t\t\t\tif($count == 1){return 1;}\n\t\t\t\t\telse{return 0; }\n\t\t\t}", "private function checkEmail(){\n\n $request = $this->_connexion->prepare(\"SELECT COUNT(*) AS num FROM Users WHERE user_email=?\");\n $request->execute(array($this->_userEmail));\n $numberOfRows = $request->fetch();\n\n if($numberOfRows['num'] == 0)\n return false;\n else\n return true;\n\n }", "public function hasEmail(): bool;", "public function email_check($str){\n\t\tif ($this->user_model->count(array('email' => $str)) > 0){\n $this->form_validation->set_message('email_check', 'Email sudah digunakan, mohon ganti dengan yang lain');\n return FALSE;\n }\n else{\n return TRUE;\n }\n\t}", "function checkEmail(){\n\t\t$json\t= ceHelper::checkEmail(JRequest::getVar('email'));\n\t\t$this->jsonReturn($json);\n\t}", "public function email_check($str){\n\t\tif($this->user_model->exist_row_check('email', $str) > 0){\n $this->form_validation->set_error_delimiters('', '');\n\t\t\t$this->form_validation->set_message('email_check', 'Email telah digunakan');\n\t\t\treturn FALSE;\n\t\t}\n\t\telse{\n\t\t\treturn TRUE;\n\t\t}\n\t}", "function check_email($str){\n\t\t$this->db->where('user_email',$str);\n\t\t$rs\t=\t$this->db->get('reseller_store');\t\n\t\t$is_email_exits\t=\t$rs->num_rows();\n\t\tif($is_email_exits>0){\n\t\t\t$user_email_exits_msg\t=\tRegisterMessages(1);\n\t\t\t$this->form_validation->set_message('check_email', $user_email_exits_msg);\n\t\t\treturn false;\n\t\t}\n\t\telse\n\t\t\treturn true;\n\t}", "function comprobar_email($email){\n\t\tif(preg_match('/^[A-Za-z0-9-_.+%]+@[A-Za-z0-9-.]+\\.[A-Za-z]{2,4}$/', $email)){ \n\t\t\treturn 0; \n\t\t}else\n\t\t\treturn 1;\n\t}", "public function checkEmail($email){\r\n $requete = \"select * from users where (Email='\" . $email . \"') \";\r\n //error_log(\"check email requete = (\" . $requete . \")\\n\");\r\n if ($this->getRequete($requete)){\r\n //$this->display();\r\n if ($this->Email == $email){\r\n return true;\r\n }\r\n }\r\n return false;\r\n }", "private function verificarEmail(){\n\t \n\t \t\t//Verifica se a requisição é via AJAX\n\t \t\tif(HelperFactory::getInstance()->isAjax()){\n\t \t\t\n\t \t\t\t //Solicita a verificação do E-mail\n\t\t\t\t $this->Delegator('ConcreteCadastro', 'verificarEmail',$this->getPost());\t \t\t\t \n\t \t\t}\t \n\t }", "function check_email()\n\t{\n\t\tif($this->user_model->check_email($_POST['email'])>0)\n\t\t\techo json_encode(false);\n\t\telse\n\t\t\techo json_encode(true);\n\t}", "public function validUniqueMail() {\n $em = $this->getDoctrine()->getManager();\n $Person = $em->getRepository('UNOEvaluacionesBundle:Person')->findOneBy(array('email' => $this->_datPerson[email]));\n if ($Person) {\n #si existe el mail, por lo que hay q pedirle q ingrece otro\n return false;\n }else{\n return true;\n }\n\n }", "function is_check_email($str){\n\t\t$this->db->where('user_email',$str);\n\t\t$rs\t=\t$this->db->get('reseller_store');\t\n\t\t$is_email_exits\t=\t$rs->num_rows();\n\t\tif($is_email_exits>0){\n\t\t\treturn true;\n\t\t}\n\t\telse{\n\t\t\t$user_email_exits_msg\t=\tLoginMessages(7);\n\t\t\t$this->form_validation->set_message('is_check_email', $user_email_exits_msg);\n\t\t\treturn false;\t\t\n\t\t}\n\t}", "public function validarEmail(){\n return (filter_var($email, FILTER_VALIDATE_EMAIL));\n }", "function check_mail($email){\n\t\tglobal $bdd;\n\n\t\t$req = $bdd->prepare(\"SELECT mail FROM utilisateur WHERE mail = :email\");\n\t\t$req->execute(array(\"email\"=>$email));\n\n\t\t$exist = $req->rowCount();\n\t\t$req->closeCursor();\n\n\t\treturn $exist;\n\t}", "function KTEmail($email){\n\t\t\t\t$sql=\"SELECT * FROM user WHERE Email='$email'\";\n\t\t\t\t$re=mysql_query($sql) or die(mysql_error());\n\t\t\t\t$n=mysql_num_rows($re);\n\t\t\t\tif($n>=1)\n\t\t\t\t\treturn true;\n\t\t\t\telse\n\t\t\t\t\treturn false;\n\t\t\t}", "public function checkMail()\n {\n $mail = htmlspecialchars($_POST['email']);\n $mail2 = htmlspecialchars($_POST['confirmation_mail']);\n if (!empty($_POST['email']) &&\n !empty($_POST['confirmation_mail'])) {\n if ($mail == $mail2) {\n if (filter_var($mail, FILTER_VALIDATE_EMAIL)) {\n $isMail = $this->isMail($mail);\n if ($isMail == 0) {\n return true;\n } else {\n return $message = 'Votre email n\\'est pas valide!';\n }\n } else {\n return $message = 'Votre adresse mail n\\'est pas valide';\n }\n } else {\n return $message = 'Vos adresses mails ne correspondent pas';\n }\n } else {\n return $message = 'Tous les champs ne sont pas complétés';\n }\n }", "public function is_dispo_email($email)\n\t{\n\t\t$sql=\"SELECT ut_id FROM utilisateur WHERE ut_mail=?\";\n\t\t$tuple = $this->executerRequete($sql,array($email));\n\t\t$numRows = $tuple->rowCount();\n\t\tif($numRows>0)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "public function actionCheck_email() {\n if (isset($_POST['email']) != 0) {\n $output = '0';\n $email = $_POST['email'];\n $course = $_POST['course'];\n // if (preg_match(\"^[_a-z0-9-]+(\\.[_a-z0-9-]+)*@[a-z0-9-]+(\\.[a-z0-9-]+)*(\\.[a-z]{2,3})$^\", $email)) {\n $modules = Yii::$app->db->createCommand(\"SELECT * FROM assist_participant WHERE email='$email' and course='$course'\")->queryAll();\n if (!empty($modules)) {\n $output = '1';\n }\n // }\n return $output;\n } else {\n return $this->redirect(['dv-registration/index']);\n }\n }", "public function email_check($str){\n $con['returnType'] = 'count';\n $con['conditions'] = array('email'=>$str);\n $checkEmail = $this->user->getRows($con);\n if($checkEmail > 0){\n $this->form_validation->set_message('email_check', 'The given email already exists.');\n return FALSE;\n } else {\n return TRUE;\n }\n }", "public function check_email($email){\n $query = $this->db->select('01_email')\n ->where('01_email', $email)\n ->get('register_01');\n if($query->num_rows()>0){\n return 0;\n }else{\n $query = $this->db->where('is_sms', 1)\n ->where('number', $email)\n ->get('verify_otp_12');\n if($query->num_rows()>0){\n return 'sent';\n }else{\n $query = $this->db->where('number', $email)\n ->delete('verify_otp_12');\n $otp = rand(10000, 1000000);\n $data = array(\n 'number' => $email,\n 'otp' => $otp,\n );\n $query = $this->db->insert('verify_otp_12', $data);\n return true;\n }\n }\n }", "function checkEmail($email){\n\t\t\t\t$email=trim(strip_tags($email));\n\t\t\t\tif(get_magic_quotes_gpc()==false)\n\t\t\t\t{\n\t\t\t\t\t$email=mysql_real_escape_string($email);\t\n\t\t\t\t}\n\t\t\t\t$sql=\"SELECT * FROM emailmarketing WHERE Email='$email'\";\n\t\t\t\t$kq=mysql_query($sql) or die(mysql_error());\n\t\t\t\tif(mysql_fetch_row($kq)>=1)\n\t\t\t\t\treturn 0;\n\t\t\t\telse return 1;\n\t\t\t}", "public function email_check($str){ \n $con = array( \n 'returnType' => 'count', \n 'conditions' => array( \n 'email' => $str \n ) \n ); \n $checkEmail = $this->Admins->getRows($con); \n if($checkEmail > 0){ \n $this->form_validation->set_message('email_check', 'The given email already exists.'); \n return FALSE; \n }else{ \n return TRUE; \n } \n }", "function UnigueEmail($check)\r\n {\r\n //μέσω αυτής της συνάρτησης ελέγχεται εάν χρησιμοποιείται ήδη το email\r\n //που έδωσε ο χρήστης και τον ενημερώνει αντίστοιχα μέσω του error που \r\n //υπάρχει για το συγκεκριμένο πεδίο στο αντίστοιχο view(register.ctp)\r\n\r\n //έλεγχος για το αν ήδη υπάρχει το email που επιλέγει ο χρήστης γίνεται\r\n //σε 2 περιπτώσεις:\r\n //α)Κατά την εγγραφή του χρήστη\r\n //β)Κατά την επεξεργασία προφίλ του χρήστη σε περίπτωση που επεξεργαστεί\r\n // το email του.\r\n $email = array_shift($check);\r\n\r\n if(!$this->getLoggedIn() || (strcmp($this->editEmail, 'yes')==0))\r\n {\r\n $conditions = array(\r\n// 'User.email'=>$this->data['User']['email']\r\n 'User.email'=>$email\r\n );\r\n if(!$this->id)\r\n {\r\n if($this->find('count', array('conditions'=>$conditions))>0) \r\n {\r\n// $this->invalidate('email_unique');\r\n return false; \r\n }\r\n }\r\n return true;\r\n }\r\n else\r\n return true;\r\n }", "public function hasEmail() {\n return $this->_has(4);\n }", "function validate_email() {\n # Check Value is an Email Address\n if ($this->check_email_address($this->cur_val)) {\n # Remove any existing error message\n $this->error_message = \"\";\n\n # Return Email\n return $this->cur_val;\n }\n else {\n # Set Error Message\n $this->set_error(\"Validation for email address ({$this->cur_val}) failed. This is type \" . gettype($this->cur_val));\n\n # Return Blank String\n return \"\";\n }\n }", "function checkEmail($email){\n\n\t\t\t$query = \"SELECT Email FROM tbl_userinfo WHERE Email=$email LIMIT 1\";\n\t\t\t\n\t\t\t$result = $this->conn->query($query); \n\n\t\t\tif (var_dump($result) > 0){\n\t\t\t\treturn true;\n\n\t\t\t}else{\n\t\t\t\treturn false;\n\n\t\t\t}\n\n\t\t}", "function comprobaremailunico($email)\n{\n\tglobal $con;\n\t\n\t$query_ConsultaFuncion = sprintf(\"SELECT mail FROM users WHERE mail = %s \",\n\t\t GetSQLValueString($email, \"text\"));\n\t//echo $query_ConsultaFuncion;\n\t$ConsultaFuncion = mysqli_query($con, $query_ConsultaFuncion) or die(mysqli_error($con));\n\t$row_ConsultaFuncion = mysqli_fetch_assoc($ConsultaFuncion);\n\t$totalRows_ConsultaFuncion = mysqli_num_rows($ConsultaFuncion);\n\t\n\tif ($totalRows_ConsultaFuncion==0) \n\t\treturn true;\n\telse return false;\n\t\n\tmysqli_free_result($ConsultaFuncion);\n}", "public function check_email() {\n\t\t$email = urldecode($_GET['email']);\n\n\t\t$result = $this->Member_Model->check_email_if_exists($email);\n\n\t\tif ($result > 0) {\n\t\t\techo json_encode(false);\n\t\t} else {\n\t\t\techo json_encode(true);\n\t\t}\n\t}", "public function usermail() {\n\n $mail = $_POST['mail'];\n\n $dmn = substr($mail, strpos($mail, '@') + 1);\n\n $fmt = filter_var($mail, FILTER_VALIDATE_EMAIL);\n\n return checkdnsrr($dmn) && $fmt;\n\n }", "public function Change_Email_Validation($sorce){\r\n\r\n $email = $sorce['email'];\r\n\r\n if ($email == '')\r\n {\r\n $this->_flag = false;\r\n\r\n Session::put('e_email', 'Empty e-mail!');\r\n }\r\n\r\n else if(self::check_Email($email)){\r\n\r\n $this->_flag = false;\r\n\r\n Session::put('e_email', 'Incorrect e-mail!');\r\n }\r\n\r\n else if(self::check_If_Email_Exists($email)){\r\n\r\n $this->_flag = false;\r\n\r\n Session::put('e_email', 'E-mail is the same!');\r\n }\r\n }", "public function checkEmail($email) // provjera dali email vec postoji \r\n {\r\n $query = $this->db->select('*')->from($this->userTbl)->where('email', $email)->get();\r\n $result=$query->result();\r\n $num_rows=$query->num_rows();\r\n\r\n if($num_rows == 0) // ako nema emaila koji podudaraju vraca \"false\"\r\n return false;\r\n return true;\r\n }", "public function checkEmailAvailability()\n {\n $email = $this->input->post('email');\n\n $user_login_id = $this->authentication_helper->checkEmail($email);\n if (isset($user_login_id) && !empty($user_login_id)) {\n echo json_encode(true);\n }\n else\n {\n echo json_encode(false);\n }\n }", "function email_unique_check($email)\r\n\t{\r\n\t\t$isUnique = true;\r\n\r\n\t\t//Skapar anslutning till databasen.\r\n\t\t$db=new Database();\r\n\r\n\t\t//Hämtar de rader som har samma email.\r\n\t\t$result = $db->getUser($email);\r\n\r\n\t\t//Om det blev resultat.\r\n\t\tif($result)\r\n\t\t{\r\n\t\t\t//Finns det en rad betyder detta att ett konto med samma email redan existerar i databasen, och inget nytt konto ska skapas.\r\n\t\t\tif($row = mysqli_fetch_row($result))\r\n\t\t\t{\r\n\t\t\t\t//Email är ej unikt.\r\n\t\t\t\t$isUnique = false;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t//Avslutar anslutning till databasen.\r\n\t\t$db->close();\r\n\r\n\t\treturn $isUnique;\r\n\t}", "private function emailValidation($field) {\t\r\n\t \t\t$sent = $this->getSentData($field);\r\n\t \t\t\r\n\t \t\t$email_pattern = '/^[^@\\s<&>]+@([-a-z0-9]+\\.)+[a-z]{2,}$/i';\r\n\t\t\tif (preg_match($email_pattern, $sent)) \r\n \t\t\treturn true;\r\n\t\t\telse\r\n\t\t\t\treturn false;\r\n\t \t}", "public function email_check($str) {\n //if(!empty($str) && $this->get_by(\"email\", $str))\n // return FALSE;\n return TRUE;\n }", "function checkMAIL($account, $email)\n {\n while ($users = $account->fetch()) {\n if ($users['email'] == $email) {\n return true;\n }\n }\n return false;\n }", "public function emailEntryIsValid() {\r\n \r\n $email = $this->getEmail();\r\n \r\n if ( empty($email) ) {\r\n $this->errors[\"email\"] = \"Email is missing.\";\r\n } else if ( !Validator::emailIsValid($this->getEmail()) ) {\r\n $this->errors[\"email\"] = \"Email is not valid.\"; \r\n }\r\n \r\n return ( empty($this->errors[\"email\"]) ? true : false ) ;\r\n }", "private function process_email($value)\n {\n return (bool) filter_var($value, FILTER_VALIDATE_EMAIL);\n }", "public function _unique_email() {\r\n // UNLESS it's the email for the current user\r\n\r\n $id = $this->uri->segment(4);\r\n $this->db->where('email', $this->input->post('email'));\r\n !$id || $this->db->where('id !=', $id);\r\n $account = $this->account_model->get();\r\n\r\n if (count($account)) {\r\n $this->form_validation->set_message('_unique_email', '%s này đã tồn tại');\r\n return FALSE;\r\n }\r\n return TRUE;\r\n }", "public function isMail()\n {\n }", "public function email_check($str){ \n $con = array( \n 'returnType' => 'count', \n 'conditions' => array( \n 'email' => $str \n ) \n ); \n $checkEmail = $this->User->getRows($con); \n if($checkEmail > 0){ \n $this->form_validation->set_message('email_check', 'The given email already exists.'); \n return FALSE; \n }else{ \n return TRUE; \n } \n }", "public function email_check($email)\n {\n session_check();\n $user_id = $this->uri->segment(3);\n $user_id = empty($user_id) ? $this->session->userdata('user_id') : $user_id;\n if($this->uri->segment(2) == 'add' || $this->uri->segment(2) == 'Add')\n $user_id = 0;\n if($this->users_model->isemailexist($email, $user_id))\n {\n $this->form_validation->set_message('email_check', $this->lang->line('validation_email_exist'));\n return FALSE;\n }\n return TRUE; \n }", "function validate_forgotpass_user_email($str){\n\t\t$sql\t=\t\"select * from reseller_store where user_email='$str' \";\n\t\t$tempInfo\t=\t$this->db->query($sql)->row_array();\t\t\n\t\tif(count($tempInfo) == 0){\n\t\t\t$this->form_validation->set_message('validate_forgotpass_user_email', LoginMessages(7));\n\t\t\treturn false;\n\t\t}\n\t\telse{\n\t\t\treturn true;\n\t\t}\n\t}", "public function checkEmail(){\n\t\t\t$user = new User;\n\t\t\t$doubleCount = $user->where('login','=', Input::get('new_user_email'))->count();\n\t\t\t\n\t\t\tif($doubleCount > 0){\n\t\t\t\t$result = array(\n\t\t\t\t\t'cmd'=>1,\n\t\t\t\t\t'msg'=>trans('alerts.exist_email')\n\t\t\t\t);\n\t\t\t}else{\n\t\t\t\t$result = array(\n\t\t\t\t\t'cmd'=>0,\n\t\t\t\t\t'msg'=>'good email'\n\t\t\t\t);\n\t\t\t}\n\t\t\t\n\t\t\treturn Response::json($result);\n\t\t}", "protected function validateEmail($args) {\n\n if ($args['ent_email'] == '')\n return $this->_getStatusMessage(1, 1);\n\n $vmail = new verifyEmail();\n\n if ($vmail->check($args['ent_email'])) {\n return $this->_getStatusMessage(34, $args['ent_email']);\n } else if ($vmail->isValid($args['ent_email'])) {\n return $this->_getStatusMessage(24, $args['ent_email']); //_getStatusMessage($errNo, $test_num);\n//echo 'email valid, but not exist!';\n } else {\n return $this->_getStatusMessage(25, $args['ent_email']); //_getStatusMessage($errNo, $test_num);\n//echo 'email not valid and not exist!';\n }\n }", "public function checkRegisteredEmail()\n {\n $email = $this->input->post('email');\n\n $user_login_id = $this->authentication_helper->checkEmail($email);\n \n if (isset($user_login_id) && !empty($user_login_id)) {\n echo json_encode(true);\n }\n else\n {\n echo json_encode(false);\n }\n }", "public function checkEmailAction() {\n\t\t\n\t\t$request = $this->getRequest();\n\t\t\t\n\t\t\t\n\t\tif ($request->isPost()) {\n\t\t\t// get the json raw data\n\t\t\t$handle = fopen(\"php://input\", \"rb\");\n\t\t\t$http_raw_post_data = '';\n\t\t\t\n\t\t\twhile (!feof($handle)) {\n\t\t\t $http_raw_post_data .= fread($handle, 8192);\n\t\t\t}\n\t\t\tfclose($handle); \n\t\t\t\n\t\t\t// convert it to a php array\n\t\t\t$json_data = json_decode($http_raw_post_data, true);\n\t\t\t\t\t\n\t\t\t$isFreeEmail = Application_Model_User::checkEmail($json_data);\n\t\t\t\n\t\t\tif($isFreeEmail) {\n\t\t\t\t// continue\n\t\t\t\techo 1;\n\t\t\t}\n\t\t\t\n\t\t\telse {\n\t\t\t\t// email exists already\n\t\t\t\techo 0;\n\t\t\t}\n\t\t}\n\t}", "public function checkEmail()\n {\n $email = $this->input->post('email');\n\n $user_login_id = $this->authentication_helper->checkEmail($email);\n\n if (isset($user_login_id) && !empty($user_login_id)) {\n echo json_encode(false);\n }\n else\n {\n echo json_encode(true);\n }\n }", "function my_email_check_function($id, $email)\n{\n # ...do some meaningful check here...\n return true;\n}", "function checkEmail($email){\n\t\t\t$database = new connect();\n\t\t\t$result = false;\n\t\t\t\n\t\t\t$query = \"SELECT * FROM users WHERE email='$email'\";\n\t\t\t$resultQuery = mysql_query($query); \n\t\t\t\n\t\t\tif(mysql_num_rows($resultQuery) == 1){\n\t\t\t\t$result = true;\n\t\t\t}\n\t\t\treturn $result;\n\t\t}", "function validateEmail($TO,$SUBJECT,$BODY,$headers){\r\n\r\n if(!$this->getAccessLevel() > 0) {echo 'false'; return false;}\r\n\r\n //$server = \"http://localhost/dev/pansophy\"; // dev server\r\n $server = \"http://pansophy.wooster.edu\";\r\n $referer = $_SERVER['HTTP_REFERER'];\r\n\t\t\r\n // check if server string is a substring of the referer string\r\n $pos = strpos($referer,$server);\r\n\r\n if($pos === false)\r\n return false;\r\n else if($pos == 0)\r\n return true;\r\n else \r\n return false;\r\n\t}", "public function checkemailconfirmed($email)\n {\n $this->db->query('SELECT * FROM user WHERE email = :email');\n $this->db->bind(':email', $email);\n $row = $this->db->single();\n $chek = $row->confirmed;\n if($chek == 1)\n {\n return true;\n }else{\n return false;\n }\n }", "function chk_email($email)\n\t{\n\t\t$str = \"Select u_email from tbl_user where u_email = ?\";\n\t\t\n\t\t//Executes the query\n\t\t$res = $this -> db -> query($str, $email);\n\t\t\n\t\t//Checks whether the result is available in the table\n\t\tif($res -> num_rows() > 0)\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}", "function email_check($email=\"\", $formid=0){\n\n\t\t// Check if contact already added or not\n\t\t$conditions_array['subscriber_email_address']=$email;\n\t\t$conditions_array['subscriber_created_by']=$this->member_id;\n\t\t$conditions_array['res.is_deleted']=0;\n\n\t\t$subscriber_array=$this->Subscriber_Model->get_subscriber_data($conditions_array);\n\t\tif(count($subscriber_array)>0){\n\t\t\t//\tset validation message\n\t\t\tif($subscriber_array[0]['subscriber_status']==1){\n\t\t\t\tif($this->checkSubscriberInList($formid, $subscriber_array[0]['subscriber_id']) == 'yes'){\n\t\t\t\t\t//$this->form_validation->set_message('email_check', '%s already exists in this list');\n\t\t\t\t\t//return FALSE;\n\t\t\t\t\t\n\t\t\t\t\t// Even if email exists, then also behave as added just now.\n\t\t\t\t\t\n\t\t\t\t\treturn true;\n\t\t\t\t}else{\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\t//$this->form_validation->set_message('email_check', '%s already exists in the Do Not Mail List of your account.');\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "function check_email($Email)\n\t{\n\n\tif ($this->Logeo_model->check_email($Email)) {\n\t\t\t$this->form_validation->set_message('check_email', \"$Email ya esta registrado \");\n\t\t\treturn FALSE;\n }\n else\n {\n return TRUE;\n }\n\t}", "function isEmail($field_data) \n{ \n\t$fields_ok=preg_match(\"/^([a-zA-Z0-9])+([a-zA-Z0-9\\._-])*@([a-zA-Z0-9_-])+([a-zA-Z0-9\\._-]+)+$/\" , $field_data); \n\treturn $fields_ok; \n}", "function actioncheckOtherEmail($type=NULL)\n\t{\n\t\tif(!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') \n\t\t{\n\t\t\tif($type != NULL)\n\t\t\t{\n\t\t\t\t$userObj = new User();\n\t\t\t\t$userId='-1';\n\t\t\t\t$result=$userObj->checkOtherEmail($_POST['email'],$userId,$type);\n\t\t\t\tif($result == '')\n\t\t\t\t{\t\t\t\t\n\t\t\t\t\techo false;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\techo true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t}", "public function is_email() {\n return $this->is_email;\n }", "function verify_email($email) // Colorize: green\n { // Colorize: green\n return isset($email) // Colorize: green\n && // Colorize: green\n is_string($email) // Colorize: green\n && // Colorize: green\n filter_var($email, FILTER_VALIDATE_EMAIL); // Colorize: green\n }", "public function verifyEmail()\n {\n return $this->getBoolean('verify_email');\n }", "function valid_email($email)\n {\n if ($this->Mymodel->valid_email($email) == TRUE)\n {\n $this->form_validation->set_message('email', \"email sudah terdaftar\");\n return FALSE;\n }\n else\n { \n return TRUE;\n }\n }", "public function email_check($email)\n\t{\n\t\t//opbouw van de query'\n\t\t$this->db->select('*');\n\t\t$this->db->from('Gebruiker');\n\t\t$this->db->where('Email',strtolower($email));\n\t\t$query=$this->db->get();// SELECT 'Email' from Gebruiker where 'Email'=$email;\n\t\t$result=$query->row_array();\n\t\tif ($query->num_rows() > 0 && $result['Bijnaam']!=$this->session->userdata('username')){\n\t\t\t$this->form_validation->set_message('email_check', '{field} bestaat al in de database.');\n\t\t\treturn FALSE;\n\t\t}else{\n\t\t\treturn TRUE;\n\t\t}\n\t}", "function envoyer_inscription_mail($values)\n{\n\t$mot = $GLOBALS['mot'];\n\t$phrase = $GLOBALS['phrase'];\n\t$val = FALSE;\n\t\n\t$contenu = array(\t$mot['Cabinet'] => $values['Cabinet'],\n\t\t\t\t\t\t$mot['Nom'] => $values['Nom'],\n\t\t\t\t\t\t$mot['Prenom'] => $values['Prenom'],\n\t\t\t\t\t\t$mot['Adresse'] => $values['Adresse'],\n\t\t\t\t\t\t$mot['CP'] => $values['CP'],\n\t\t\t\t\t\t$mot['Ville'] => $values['Ville'],\n\t\t\t\t\t\t$mot['Tel'] => $values['Tel'],\n\t\t\t\t\t\t$mot['Email'] => $values['Email'],\n\t\t\t\t\t\t$mot['Commentaire'] => $values['Commentaire'] );\n\t$contenu_message = corps_email($contenu);\n\t\n\t// Si le message a bien été envoyé, on affiche un message de validation\n\t// et on enregistre le message dans la base de données\n\tif (envoi_email(EMAIL_ADMIN, NOM_SITE, EMAIL, $values['Email'], $phrase['UneNouvelleInscription'], $contenu_message) == TRUE)\n\t{\n\t\tif (ajouter_inscription_db($values) == TRUE)\n\t\t{\n\t\t\t$val = TRUE;\n\t\t}\n\t}\n\treturn $val;\n}", "function is_email($emailadres)\r\n{\r\n // Eerst een snelle controle uitvoeren: \r\n // een e-mailadres moet uit minimaal 7 tekens bestaan:\r\n if (strlen($emailadres) < 7) \r\n {\r\n return false;\r\n }\r\n // Daarna een controle met een reguliere expressie uitvoeren:\r\n if( ! ereg(\"^[_a-zA-Z0-9-]+(\\.[_a-zA-Z0-9-]+)*@([a-zA-Z0-9-]+\\.)+([a-zA-Z]{2,4})$\", $emailadres) ) \r\n {\r\n return false;\r\n } \r\n\r\n return true; \r\n}", "public function actionEmailunique()\n\t{\n\t\t$email = $_GET['email'];\n\t\t$isexits = '0';\n\t\t$check=UsersDetails::model()->find(\"user_details_email='$email'\");\n\t\tif(isset($check))\t\t\t\t\n\t\t\t$isexits = '1'; //This email already used.\n\t\techo $isexits;\n\t\tYii::app()->end();\n\t}", "function emailfil($emal){\n $email = 'leon@sin castilla.com';\n\n if (filter_var($email, FILTER_VALIDATE_EMAIL)) {\n echo 'email '.$email.' correcto';\n }else{\n echo 'email '.$email.' incorrecto';\n }\n}", "public function checkEmail($email){\n $check = $this->f_usersmodel->getFirstRowWhere('users',array(\n 'email' => $email\n ));\n if(!empty($check)){\n $this->session->set_flashdata(\"mess\", \"Email đã tồn tại!\");\n return false;\n }\n else{\n return true;\n }\n }", "function virustotalscan_valid_email($email) \r\n{\r\n\tif (function_exists(\"filter_var\") && !filter_var($email, FILTER_VALIDATE_EMAIL)) {\r\n return false;\r\n }\r\n else {\r\n // daca functia exista atunci se returneaza true\r\n if (function_exists(\"filter_var\")) return true;\r\n else {\r\n // altfel inseamna ca functia nu exista si trebuie sa utilizam o alta metoda\r\n return eregi(\"^[_a-z0-9-]+(\\.[_a-z0-9-]+)*@[a-z0-9-]+(\\.[a-z0-9-]+)*(\\.[a-z]{2,3})$\", $email);\r\n }\r\n }\r\n}", "public function check_email($str){\n\n\t\t$data = array(\n\t\t\t'id_usuario'=>$this->input->post('id_usuario'),\n\t\t\t'email' =>$str\n\t\t);\n\n\t\tif($this->Usuarios_model->check_email($data)){\n\t\t\t$this->form_validation->set_message('check_email', 'El email ya se encuentra registrado para otro usuario');\n\t\t\treturn false;\n\t\t}else{\n\t\t\treturn true;\n\t\t}\n\n\t}", "function useremail_check($str) {\r\n $res = $this->auth_model->is_email_exists($str);\r\n if ($res <= 0) {\r\n $this->form_validation->set_message('useremail_check', lang_key('email_not_matched'));\r\n return FALSE;\r\n } else {\r\n return TRUE;\r\n }\r\n }", "public function getCheckEmail()\n {\n $email = Input::get('email');\n $user = User::where(array('email' => $email))->first();\n\n return array('valid' => empty($user));\n }", "public function validate_email()\n\t{\n\t\t$user = JFactory::getUser();\n\t\t$config = OSMembershipHelper::getConfig();\n\t\t$email = $this->input->get('fieldValue', '', 'string');\n\t\t$validateId = $this->input->getString('fieldId');\n\t\t$arrayToJs = array();\n\t\t$arrayToJs[0] = $validateId;\n\t\t$arrayToJs[1] = true;\n\n\t\tif ($this->app->isSite() && $config->registration_integration && !$user->id)\n\t\t{\n\t\t\t$db = JFactory::getDbo();\n\t\t\t$query = $db->getQuery(true);\n\t\t\t$query->select('COUNT(*)')\n\t\t\t\t->from('#__users')\n\t\t\t\t->where('email = ' . $db->quote($email));\n\t\t\t$db->setQuery($query);\n\t\t\t$total = $db->loadResult();\n\n\t\t\tif ($total)\n\t\t\t{\n\t\t\t\t$arrayToJs[1] = false;\n\t\t\t}\n\t\t}\n\n\t\techo json_encode($arrayToJs);\n\n\t\t$this->app->close();\n\t}", "function comprobar_email()\n\t{\n\t$correcto = true; //variable booleana que comprueba si el atributo cuumple o no lo especificado\n\n\t//si los atributos estan vacios\n\tif (strlen($this->email) == 0)\n\t{\n\t\tarray_push($this->erroresdatos, [\"nombreatributo\" => \"email\", \"codigoincidencia\" => \"00001\" ,\"mensajeerror\" => \"email vacio\"]);\n\n\t\t$correcto = false;\t\n\t}\n\n\tif (strlen($this->email) < 3)\n\t{\n\t\tarray_push($this->erroresdatos, [\"nombreatributo\" => \"email\", \"codigoincidencia\" => \"00003\" ,\"mensajeerror\" => \"Valor de atributo no numérico demasiado corto\"]);\n\n\t\t$correcto = false;\n\t}\n\n\t//si los atributos estan vacios\n\tif (strlen($this->email) > 61)\n\t{\n\t\tarray_push($this->erroresdatos, [\"nombreatributo\" => \"email\", \"codigoincidencia\" => \"00002\" ,\"mensajeerror\" => \"email demasiado largo, maximo 10 caracteres\"]);\n\n\t\t$correcto = false;\t\n\t}\n\n\treturn $correcto;\n}", "public function emailCheck(Request $request)\n\t{\n\t\t\t$enteredEmail= $request['datafile'];\n\t\t\tif(DB::table('users')->where('email', '?')->setBindings([$enteredEmail])->exists())\n\t\t\t{\n\t\t\t\techo '<div style=\"color: red;\"> <b>'.$enteredEmail.'</b> is already in use! </div>|false';\n\t\t\t}\n\t\t\telse \n\t\t\t{\n\t\t\t\techo '<div style=\"color: green;\"> <b>'.$enteredEmail.'</b> is avaialable! </div>|true';\n\t\t\t}\t\n\t}", "function verifyEmail($action = ''){\n\t\t//$url = ROOT_URI_UI.'validUser.php?k='.$this->secretKey($this->username).'&e='.$this->username;\n\n\t\t$url = $_SERVER['REQUEST_SCHEME'].'://'.$_SERVER['HTTP_HOST'].$_SERVER['SCRIPT_NAME'].'?k='.$this->secretKey($this->username).'&e='.$this->username;\n\t\t\n\t\tif('recover' == $action){\n\t\t\t$msg = DICO_WORD_PASSWORD_RESTORE;\n\t\t}else{\n\t\t\t$msg = DICO_WORD_CONFIRM_EMAIL;\n\t\t}\n\t\t\n\t\t$body_message = DICO_MAIL_VALID_HEAD.'<br>'\n\t\t\t\t\t\t.'<a href=\"'.$url.'\">'.$msg.'</a><br><br>'\n\t\t\t\t\t\t.$url.'<br>'\n\t\t\t\t\t\t.DICO_MAIL_VALID_FOOT;\n\n\t\t\n\t\treturn send_mail(ROOT_EMAIL, $this->username, '', ROOT_EMAIL_NAME.' '.DICO_WORD_AUTH,$body_message);\n\t}", "function comprobar_email($email) {\n return (filter_var($email, FILTER_VALIDATE_EMAIL)) ? 1 : 0;\n}", "function checkEmail($checkemail) {\r\n if(preg_match(\"/^([a-zA-Z0-9])+([a-zA-Z0-9\\._-])*@([a-zA-Z0-9_-])+([a-zA-Z0-9\\._-]+)+$/\" , $checkemail))\r\n {\r\n list($username,$domain)=split('@',$checkemail);\r\n \r\n if(!getmxrr ($domain,$mxhosts)) {\r\n return false;\r\n }\r\n return true;\r\n }\r\n return false;\r\n}", "public function validate() {\n\t\treturn is_email( $this->email );\n\t}", "public function testMyGmailAddressIsEvaluatedAsTrue()\n {\n $this->assertTrue(EmailValidator::validate(\"[email protected]\"));\n }", "public function checkemail() {\n\n if (env(\"NEW_ACCOUNTS\") == \"Disabled\" && env(\"GUEST_SIGNING\") == \"Disabled\") {\n\n $account = Database::table(\"users\")->where(\"email\", input(\"email\"))->first();\n if (!empty($account)){\n response()->json(array(\"exists\" => true));\n }else{\n response()->json(array(\"exists\" => false));\n }\n\n }\n\n }", "function verificarMail($id, $email){\n $conn=connexioBD();\n $emailRepe=true;\n $sql=\"SELECT email FROM usuaris WHERE id='$id'\";\n if (!$resultado =$conn->query($sql)){\n die(\"Error al comprobar datos\".$conn->error);\n }\n if($resultado->num_rows>=0){\n while($usuari=$resultado->fetch_assoc()){\n if($usuari[\"email\"]==$email){\n $emailRepe=false;\n } \n }\n }\n return $emailRepe;\n $resultado->free();\n $conn->close();\n}", "public function verificarEmail($email){\n\n\t\t$id = $this->db->query(\"select id from users where email ='\".$email.\"'\");\n\t\tif($id->fetch()){\n\t\t\treturn true;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}", "public function validEmailValidDataProvider() {}", "public function verify_email($email){\n $query = $this->db->where('01_email', $email)\n ->get('register_01');\n if(sizeof($query->result_array())>0){\n return true;\n }\n else{\n return false;\n }\n }", "function check_work_email($invite_new_email) {\n $post_work_email = $invite_new_email;\n \n\t\t$sql = \"\n\t\t\tselect user_email from tb_m_users where user_email = '\" . $post_work_email . \"'\n\t\t\";\n $quer = $this->db->query($sql);\n\t\treturn $quer->num_rows();\n\n // if ($quer->num_rows() > 0) {\n // return $quer->row();\n // } else {\n // return false;\n // }\n }", "public function validate_group_member_email()\n\t{\n\t\t$db = JFactory::getDbo();\n\t\t$query = $db->getQuery(true);\n\t\t$email = $this->input->get('fieldValue', '', 'string');\n\t\t$validateId = $this->input->get('fieldId', '', 'string');\n\t\t$query->select('COUNT(*)')\n\t\t\t->from('#__users')\n\t\t\t->where('email = ' . $db->quote($email));\n\t\t$db->setQuery($query);\n\t\t$total = $db->loadResult();\n\t\t$arrayToJs = array();\n\t\t$arrayToJs[0] = $validateId;\n\n\t\tif (!$total)\n\t\t{\n\t\t\t$arrayToJs[1] = true;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$arrayToJs[1] = false;\n\t\t}\n\n\t\techo json_encode($arrayToJs);\n\n\t\t$this->app->close();\n\t}", "function checkmail($youremail)\n{\n if (ereg('^[-!#$%&\\'*+\\\\./0-9=?A-Z^_`a-z{|}~]+'.'@'.'[-!#$%&\\'*+\\\\/0-9=?A-Z^_`a-z{|}~]+\\.'.\n '[-!#$%&\\'*+\\\\./0-9=?A-Z^_`a-z{|}~]+$', $youremail))\n {\n\t return true;\n }\n else\n {\n\t return false;\n }\n}", "private function emailAtLogin() {}" ]
[ "0.7424626", "0.7226652", "0.7107888", "0.70908064", "0.69966036", "0.69957024", "0.6990746", "0.6970759", "0.6969416", "0.688915", "0.688703", "0.68831265", "0.6853644", "0.6821015", "0.6813015", "0.6786768", "0.67865324", "0.67807055", "0.67675674", "0.67668885", "0.67549014", "0.67486316", "0.6729243", "0.6727203", "0.6711979", "0.67028725", "0.6690674", "0.6662424", "0.66566384", "0.66498923", "0.66470677", "0.6622715", "0.66227144", "0.66052073", "0.65989864", "0.65860635", "0.657847", "0.6568016", "0.6560937", "0.6557237", "0.6547325", "0.65464467", "0.6542324", "0.65415674", "0.6531445", "0.65010095", "0.64986724", "0.6497744", "0.64968157", "0.6495943", "0.6486826", "0.6476366", "0.64722294", "0.6470739", "0.6466545", "0.6460762", "0.64552975", "0.64298874", "0.6426357", "0.6425884", "0.64172584", "0.6416481", "0.64112437", "0.6400413", "0.6396765", "0.63953364", "0.6379909", "0.63780886", "0.6372808", "0.6372799", "0.6372184", "0.6367683", "0.6360227", "0.6359503", "0.6358153", "0.6353392", "0.6351901", "0.6342018", "0.63416904", "0.6340755", "0.6325004", "0.63190806", "0.6316065", "0.63026005", "0.6287668", "0.6287667", "0.62814295", "0.6278985", "0.62770784", "0.6271989", "0.6270638", "0.62670815", "0.6263187", "0.6258228", "0.625759", "0.6252407", "0.62515366", "0.6245019", "0.6241954", "0.6232205", "0.62275857" ]
0.0
-1
checked of het wachtwoord de tweede keer het zelfde is als de eerste keer
function pwdMatch($pwd, $pwdRepeat) { $result; if ($pwd !== ($pwdRepeat)) { $result = true; } else { $result = false; } return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function scheckAusdruck()\r\n {\r\n foreach ($this->belegschaft as $schluessel=>$wert)\r\n $this->belegschaft[$schluessel]->scheckAusdruck();\r\n }", "public function afmelden()\n {\n return true;\n }", "function valid(){ \r\n\t return $this->valid; \r\n\t }", "private function choixEffectuer()\n {\n $valider = false;//on mets le forrmulaire a faux\n $valeur = $this->recupValeur($this->position['valeur']);//on recupêre la valeur a comparer\n\n if($this->position['egal'])\n {\n \n if($this->choix == $valeur)\n {\n $valider = true;\n }\n }\n else if($this->position['different'])\n {\n \n if($this->choix != $valeur)\n {\n $valider = true;\n }\n }\n else\n {\n Erreur::declarer_dev(27);\n }\n\n return $valider;\n\n }", "function checkSoDu()\n{\n // lay tham so post\n $STK = $_POST[\"TKDi\"];\n $SoTien = $_POST[\"SoTien\"];\n // lay muc phi giao dich\n $QD = new QuyDinh();\n $QD->getInfo(1);\n // kiem tra so du\n $TK = new TKNganHang();\n $SoDu = $TK->getSoDu($STK);\n //\n $SoTien += $QD->MucPhi;\n\n $TK = new TKNganHang();\n $SoDu = $TK->getSoDu($STK);\n ////echo \"<script>alert(\".$SoDu.\");</script>\";\n $SoDuSauKhiChuyen=$SoDu-$SoTien;\n // if ($SoDuSauKhiChuyen<=0)\n // echo 0;\n // else\n echo $SoDuSauKhiChuyen;\n //echo $SoDu;\n //echo $SoDu;\n}", "public function _validarHelado()\n {\n $listaHelados = Helado::_traerHelados();\n //Son distintos, pasa la validación.(Si y solo si se queda en este valor)\n $retorno = -1;\n if($this->_precio < 0 || $this->_tipo != \"agua\" && $this->_tipo != \"crema\" || $this->_cantidad < 0)\n {\n return 1;\n }\n foreach($listaHelados as $helado)\n { \n if($this->_sabor == $helado->_sabor && $this->_tipo == $helado->_tipo)\n {\n $helado->_cantidad = $this->_cantidad;\n $helado->_precio = $this->_precio;\n Helado::_actualizarHelado($listaHelados);\n $retorno = 0;\n break;\n }\n }\n return $retorno;\n }", "public function berekenInkoopWaarde() {\n //var_dump(['aantal'=>$this->aantal, 'waarde'=>$this->artikel->verkoopprijs]);\n return $this->aantal * $this->artikel->inkoopprijs;\n }", "function _verify(){\n $e = \"\";\n if (isset($_POST['verder'])) {\n foreach($_POST as $key=>$value){\n if($key== 'verder') continue;\n $value = validate($value);\n if(!$this->_existsInDatabase($value)){\n $e = \"ID komt niet voor in Database\";\n }\n }\n }\n return $e;\n }", "function scheckAusdruck()\r\n {\r\n $summeLohn = $this->summeStunden * $this->stundenlohn;\r\n echo \"<p>Scheck:<br>\"\r\n . \"Name: $this->nachname, $this->vorname<br>\"\r\n . \"IBAN: $this->iban, BIC: $this->bic<br>\"\r\n . \"Bank: $this->bank, Betrag: $summeLohn &euro;</p>\";\r\n }", "abstract public function check();", "public function berekenVerkoopWaarde() {\n return $this->aantal * $this->artikel->verkoopprijs;\n }", "function checkHanMuc()\n{\n $SoTien = $_POST[\"SoTien\"];\n $temp = new QuyDinh();\n $temp->getInfo(1);\n if ($SoTien >= $temp->HanMuc)\n echo 0;\n else echo 1;\n}", "public function hasLevdes(){\n return $this->_has(23);\n }", "public function _check()\n {\n }", "public function check();", "public function check();", "public function check();", "public function check();", "public function check();", "function gibtWeiterGeleitschutz($jaeger_id) {\n $schiff_infos = @mysql_query(\"SELECT flug, zielid FROM skrupel_schiffe WHERE id='$jaeger_id'\");\n $schiff_infos = @mysql_fetch_array($schiff_infos);\n if($schiff_infos['flug'] != 4) return false;\n $ziel_schiff = $schiff_infos['zielid'];\n $ziel_infos = @mysql_query(\"SELECT schaden FROM skrupel_schiffe WHERE id='$ziel_schiff'\");\n $ziel_infos = @mysql_fetch_array($ziel_infos);\n\n return ($ziel_infos['schaden'] <= eigenschaften::$jaeger_infos->max_jaeger_schaden);\n }", "function isOvertime()\n {\n if($this->jadwalKembali > $this->tanggalKembali){\n return false;\n }else{\n return true;\n }\n }", "public function isRelawan();", "function comprobar_sexo()\n\t{\n\t$correcto = true; //variable booleana que comprueba si el atributo cuumple o no lo especificado\n\n\t//si los atributos estan vacios\n\tif (strlen($this->sexo) == 0)\n\t{\n\t\tarray_push($this->erroresdatos, [\"nombreatributo\" => \"sexo\", \"codigoincidencia\" => \"00001\" ,\"mensajeerror\" => \"sexo vacio\"]);\n\n\t\t$correcto = false;\n\t}\n\n\treturn $correcto;\n}", "public function wrong() {\n\n }", "public function checkVerrouille()\n {\n $this->ligne->checkVerrouille();\n }", "public function magBewerken() {\n\t\t// het huidige lid mag dit bericht alleen bewerken als hij moderator is of als dit zijn eigen bericht\n\t\t// is (en hij dus het toevoeg-recht heeft).\n\t\treturn MededelingenModel::isModerator() OR (MededelingenModel::magToevoegen() AND $this->uid == LoginModel::getUid());\n\t}", "abstract function check();", "public function keliling()\n {\n return 2*($this->panjang + $this->lebar);\n }", "public function check()\r\n\t{\r\n\t\treturn true;\r\n\t}", "public function egal(KDate $date)\n{\n$egal = false;\nif (strcmp($this->getDateSysteme(), $date->getDateSysteme()) == 0)\t\n\t$egal = true;\nreturn $egal;\n}", "public function hasBepro1Time(){\n return $this->_has(3);\n }", "public function passes();", "public function isplata($iznos){\n\n $stanjesalimitom=$this->stanje+$this->limit;\n\n if($iznos<=$stanjesalimitom){\n // $novostanje=$stanjesalimitom-$iznos;\n //echo \"Vas iznos je isplacen<br>\";\n // echo \"Novo stanje na racunu je: \".$novostanje;\n if($iznos>$this->stanje){\n // ovde je kontrolno logika ako klijent ulazi u minus\n $zaduzenje=$iznos-$this->stanje;\n $this->limit-=$zaduzenje;\n $this->stanje=0;\n echo \"Vas iznos je isplacen<br>\";\n echo \"Usli ste u dozvoljeni minus, Vas limit iznosi jos: \".$this->limit;\n\n }else{\n // ako trazi manji iznos od stanja koje ima na racunu\n $this->stanje-=$iznos;\n echo \"Vas iznos je isplacen, novo stanje je: \".$this->stanje;\n }\n\n }else{\n echo \"Nemate dovoljno sredstava na racunu\";\n }\n\n\n\n}", "public function check()\n {\n }", "public function check()\n {\n }", "abstract public function getPasiekimai();", "public function hasWholineme(){\n return $this->_has(2);\n }", "public function check() {}", "abstract protected function safetyCheck() : self;", "public function wijzigWachtwoord()\n {\n $huidigWachtwoord = $_POST['huidigWachtwoord'];\n $nieuwWachtwoord = $_POST['nieuwWachtwoord'];\n $herhaalNieuwWachtwoord = $_POST['herhaalNieuwWachtwoord'];\n //controleer of het oude wachtwoord goed is\n if ($huidigWachtwoord === $_SESSION['gebruiker']->geefWachtwoord())\n {\n //controleer of de nieuwe wachtwoorden gelijk zijn\n if ($nieuwWachtwoord === $herhaalNieuwWachtwoord)\n {\n $id = $_SESSION['gebruiker']->geefId();\n //verander de wachtwoord in de database\n $sql = \"UPDATE `gebruikers` SET `wachtwoord`= AES_ENCRYPT(:wachtwoord,:key) WHERE `id` = :id\";\n $stmnt = $this->db->prepare($sql);\n $stmnt->bindParam(':wachtwoord', $nieuwWachtwoord);\n $stmnt->bindParam(':id', $id);\n $stmnt->bindParam(':key',$this->key);\n $stmnt->execute();\n //plaats de nieuwe wachtwoord in de gebruiker\n $_SESSION['gebruiker']->zetWachtwoord($nieuwWachtwoord);\n return 'Wachtwoord gewijzigd';\n }\n else\n {\n return 'Uw nieuwe wachtwoorden komen niet overeen';\n }\n }\n else\n {\n return 'Uw huidige wachtwoord komt niet overeen';\n }\n }", "private function getStatus(){\n\t\t$this->valid=$this->checkDatesValidity();\n\t\tif($this->usage==\"once\" && $this->usageCount) $this->valid = false;\n\t\tif($this->usage==\"count\" && $this->usageCount>=$this->maxUsage) $this->valid = false;\n\t\tif($this->type==\"fixed\" && $this->value<=0) $this->valid = false;\n\t\tif($this->type==\"grid\" && !count($this->grid)) $this->valid = false;\n\t}", "function convertheck()\n\t {\n\t return \"\"; // method causes fatal error. Could not find a way to make this working.\n\n\t // Get a reference to the databeest\n\t \t$db = &atkGetDb();\n\n\t // Detect the old datastructure\n\t \t$showtable = $db->getrows(\"SHOW TABLES LIKE 'hours_approved'\");\n\n // If old datastructures found, then show link to conversion action\n\t \tif (!empty($showtable[0]))\n\t {\n\t return href(dispatch_url(\"timereg.hours_approve\",\"convert_old\"), \"Converteer oude gegevens\"); // @todo translate\n\t }\n\t else\n\t {\n\t return \"\";\n\t }\n\t }", "public function VanMegLapAPakliban():bool\r\n {\r\n return ($this->getLapokSzama()>0);\r\n }", "function isWellformed(){\n return ($this->toString() === $this->location);\n }", "public function hasBepro2Time(){\n return $this->_has(4);\n }", "public function looksValid()\r\n\t{\r\n return true;\r\n\t}", "private function verrouPoser(){\n\t\t$verrou['etat'] = '';\n\t\tself::verrouSupprimer();\n\t\tif($this->formulaire['cle'] != ''){\n\t\t\t$verrou = self::verrouRechercher();\n\t\t\tif(empty($verrou)){\n\t\t\t\t$verrou = self::verrouInserer();\n\t\t\t\t$verrou['etat'] = 'ok';\n\t\t\t}else{\n\t\t\t\t$verrou['etat'] = 'nok';\n\t\t\t\t$verrou['message'] = \"L'enregistrement \".$verrou['ad_ve_cle'].\" est actuellement verrouillé par \".$verrou['ad_ve_nom'].\" depuis le \".$verrou['ad_ve_date'].\".\\nLes modifications, enregistrement et suppression sont donc impossibles sur cet enregistrement.\";\n\t\t\t}//end if\n\t\t}//end if\n\t\treturn $verrou;\n\t}", "public function hasPassed() {\n \treturn $this < new \\DateTime();\n }", "public function hasFreyja(){\n return $this->_has(22);\n }", "public function valorpasaje();", "function formulaires_deleguer_verifier_dist() {\n include_spip('inc/saisies');\n // on récupère les saisies\n $mes_saisies = mes_saisies_deleguer();\n // saisies_verifier retourne un tableau des erreurs s'il y en a, sinon traiter() prend le relais\n return saisies_verifier($mes_saisies);\n}", "function checkOblig(&$falta, &$f, $oblig) {\r\n# versio obligatoris en formulari\r\n foreach (explode(\"#\", $oblig) as $cm) {\r\n if (!$f[$cm])\r\n $falta[$cm][] = 'oblig';\r\n }\r\n return count($falta);\r\n}", "public function hasRetreatdf(){\r\n return $this->_has(26);\r\n }", "public function valid();", "public function valid();", "public function valid();", "public function valid();", "function aprovados($nota){\n return $nota >= 7;\n}", "public function hasDifference() {return !!$this->_calculateDifference();}", "public function valid() {}", "public function valid() {}", "public function valid() {}", "public function valid() {}", "public function valid() {}", "public function valid() {}", "public function valid() {}", "public function valid() {}", "public function isGerechtigd()\n {\n if(isset($_SESSION['gebruiker'])&&!empty($_SESSION['gebruiker']))\n {\n $gebruiker=$_SESSION['gebruiker'];\n if ($gebruiker->getRecht() == \"medewerker\")\n {\n return true;\n }\n else\n {\n return false;\n }\n }\n \n return false;\n \n \n }", "public function erAktiv() : bool {\n if(!$this->getHome()->erFerdig()) {\n return true;\n }\n\n // Alle innslag før 2020 er ikke aktive\n if ($this->getSesong() < 2020) {\n return false;\n }\n\n // Sjekker alle arrangementer hvor dette innslaget ble sendt videre (inkludering home arrangement)\n $query = new Query(\n \"SELECT `arrangement_id`\n FROM `ukm_rel_arrangement_innslag`\n WHERE `innslag_id` = '#innslag'\",\n [\n 'innslag' => $this->getId()\n ]\n );\n\n $res = $query->run();\n // Det må finnes mer enn 1 arrangement (nummer 1 er home arrangement) \n if($res->num_rows > 1) {\n while ($arrangementId = Query::fetch($res)) {\n $arrangement = new Arrangement($arrangementId['arrangement_id']);\n \n // Arrangementet er ikke ferdig derfor dette innslaget er aktivt.\n if(!$arrangement->erFerdig()) {\n return true;\n }\n }\n }\n\n // Det ble ikke funnet at innslaget er aktivt\n return false;\n }", "abstract public function valid();", "public function hasTutorreward(){\n return $this->_has(23);\n }", "public function hayCesta(){\r\n\t\t\treturn (count($this->listArticulos)>0)?1:0;\r\n\t\t}", "function set_est_alcoolisee($est_alcoolisee){\n if($est_alcoolisee == true || $est_alcoolisee == false){\n $this->est_alcoolisee = $est_alcoolisee;\n }else{\n $this->erreur(\"La type de boisson doit être : true ou false. Or c'est : \".$est_alcoolisee.\"<br>\");\n }\n }", "function hitungDenda(){\n\n return 0;\n }", "function checkShowWorldWonder($wg_buildings,$village)\n{\n\tglobal $db,$user;\n\t$world_wonder=0;\n\t$array=array();\n\tif(empty($wg_buildings))\n\t{\n\t\t$wg_buildings=getBuildings($village);\n\t}\n\tforeach($wg_buildings as $key=>$value)\n\t{\n\t\tif($value->type_id==37)\n\t\t{\n\t\t\t$world_wonder=1;\t\t\n\t\t\tbreak;\n\t\t}\n\t}\n\t/*\n\tDa du Dk xay dung ky dai moi'\n\t1. so thanh >=2\n\t2. du so bau vat\n\t4. vi tri index 33->36 rong\n\t*/\n\tif($world_wonder==0)\n\t{\n\t\t$check=0;\n\t\t$sql = \"SELECT COUNT(DISTINCT(id)) FROM wg_villages WHERE user_id=\".$user['id'].\"\";\n\t\t$db->setQuery($sql);\n\t\t$count = (int)$db->loadResult();\n\t\tforeach($wg_buildings as $key=>$value)\n\t\t{\n\t\t\tif($value->type_id==12 && $value->level >0)\n\t\t\t{\n\t\t\t\t$check++;\t\n\t\t\t}\n\t\t\tif($value->index>=33 && $value->index<=36)\n\t\t\t{\n\t\t\t\tif($value->level==0)\n\t\t\t\t{\n\t\t\t\t\t$check++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif($count>1 && $check==5 && checkRareExits($village)==1)\n\t\t{\n\t\t\treturn 1;\n\t\t}\t\n\t\treturn 0;\n\t}\n\treturn 1;\n}", "function publierLyric($da){\r\n\t\t\treturn true;\r\n\t\t}", "function isEditavel() {\n\t\t// a data limite de edição do jogo vem no formato DD/MM/YYYY, por exemplo, 01/03/2019\n\t\t$dg = DataGetter::getInstance();\n\t\t$dialimite = $this->jogo->limiteEdicaoAposta[0] . $this->jogo->limiteEdicaoAposta[1]; // dialimite = 01\n\t\t$meslimite = $this->jogo->limiteEdicaoAposta[3] . $this->jogo->limiteEdicaoAposta[4]; // meslimite = 03\n\t\t$anolimite = $this->jogo->limiteEdicaoAposta[6] . $this->jogo->limiteEdicaoAposta[7] . $this->jogo->limiteEdicaoAposta[8] . $this->jogo->limiteEdicaoAposta[9]; //anolimite = 2019\n\t\t$dialimite = intval($dialimite); // transformando as variáveis em inteiros\n\t\t$meslimite = intval($meslimite);\n\t\t$anolimite = intval($anolimite);\n\t\t$mes = date(\"m\"); //date(\"m\") retorna o mês atual, entre 1 e 12\n\t\t$mes = intval($mes);\n\t\tif((intval(date(\"Y\"))) > $anolimite){ // se ano atual tiver ultrapassado ano da data limite\n\t\t\treturn false; // não é possível editar \n\t\t}\n\t\telseif(($mes > $meslimite && (intval(date(\"Y\"))) == $anolimite)){ // se mês atual tiver ultrapassado o limite, estando no mesmo ano\n\t\t\treturn false; // não é possível editar\n\t\t}\n\t\telseif((intval(date(\"d\"))) > $dialimite && $mes >= $meslimite && (intval(date(\"Y\"))) == $anolimite){ // se o dia tiver ultrapassado, estando no mesmo mês ou em algum seguinte no ano\n\t\t\treturn false; // não é possivel editar\n\t\t}\n\t\telse{ // caso não esteja em nenhuma das condições acima, significa que a data limite ainda não foi ultrapassada\n\t\t\treturn true; // então a aposta eh editável\n\t\t}\n\t}", "public function ensureConsistency()\n {\n\n if ($this->aSekolahLongitudinal !== null && $this->sekolah_id !== $this->aSekolahLongitudinal->getSekolahId()) {\n $this->aSekolahLongitudinal = null;\n }\n if ($this->aSekolahLongitudinal !== null && $this->semester_id !== $this->aSekolahLongitudinal->getSemesterId()) {\n $this->aSekolahLongitudinal = null;\n }\n if ($this->aRuang !== null && $this->id_ruang !== $this->aRuang->getIdRuang()) {\n $this->aRuang = null;\n }\n if ($this->aPembelajaranRelatedByBelKe01 !== null && $this->bel_ke_01 !== $this->aPembelajaranRelatedByBelKe01->getPembelajaranId()) {\n $this->aPembelajaranRelatedByBelKe01 = null;\n }\n if ($this->aPembelajaranRelatedByBelKe02 !== null && $this->bel_ke_02 !== $this->aPembelajaranRelatedByBelKe02->getPembelajaranId()) {\n $this->aPembelajaranRelatedByBelKe02 = null;\n }\n if ($this->aPembelajaranRelatedByBelKe03 !== null && $this->bel_ke_03 !== $this->aPembelajaranRelatedByBelKe03->getPembelajaranId()) {\n $this->aPembelajaranRelatedByBelKe03 = null;\n }\n if ($this->aPembelajaranRelatedByBelKe04 !== null && $this->bel_ke_04 !== $this->aPembelajaranRelatedByBelKe04->getPembelajaranId()) {\n $this->aPembelajaranRelatedByBelKe04 = null;\n }\n if ($this->aPembelajaranRelatedByBelKe05 !== null && $this->bel_ke_05 !== $this->aPembelajaranRelatedByBelKe05->getPembelajaranId()) {\n $this->aPembelajaranRelatedByBelKe05 = null;\n }\n if ($this->aPembelajaranRelatedByBelKe06 !== null && $this->bel_ke_06 !== $this->aPembelajaranRelatedByBelKe06->getPembelajaranId()) {\n $this->aPembelajaranRelatedByBelKe06 = null;\n }\n if ($this->aPembelajaranRelatedByBelKe07 !== null && $this->bel_ke_07 !== $this->aPembelajaranRelatedByBelKe07->getPembelajaranId()) {\n $this->aPembelajaranRelatedByBelKe07 = null;\n }\n if ($this->aPembelajaranRelatedByBelKe08 !== null && $this->bel_ke_08 !== $this->aPembelajaranRelatedByBelKe08->getPembelajaranId()) {\n $this->aPembelajaranRelatedByBelKe08 = null;\n }\n if ($this->aPembelajaranRelatedByBelKe09 !== null && $this->bel_ke_09 !== $this->aPembelajaranRelatedByBelKe09->getPembelajaranId()) {\n $this->aPembelajaranRelatedByBelKe09 = null;\n }\n if ($this->aPembelajaranRelatedByBelKe10 !== null && $this->bel_ke_10 !== $this->aPembelajaranRelatedByBelKe10->getPembelajaranId()) {\n $this->aPembelajaranRelatedByBelKe10 = null;\n }\n if ($this->aPembelajaranRelatedByBelKe11 !== null && $this->bel_ke_11 !== $this->aPembelajaranRelatedByBelKe11->getPembelajaranId()) {\n $this->aPembelajaranRelatedByBelKe11 = null;\n }\n if ($this->aPembelajaranRelatedByBelKe12 !== null && $this->bel_ke_12 !== $this->aPembelajaranRelatedByBelKe12->getPembelajaranId()) {\n $this->aPembelajaranRelatedByBelKe12 = null;\n }\n if ($this->aPembelajaranRelatedByBelKe13 !== null && $this->bel_ke_13 !== $this->aPembelajaranRelatedByBelKe13->getPembelajaranId()) {\n $this->aPembelajaranRelatedByBelKe13 = null;\n }\n if ($this->aPembelajaranRelatedByBelKe14 !== null && $this->bel_ke_14 !== $this->aPembelajaranRelatedByBelKe14->getPembelajaranId()) {\n $this->aPembelajaranRelatedByBelKe14 = null;\n }\n if ($this->aPembelajaranRelatedByBelKe15 !== null && $this->bel_ke_15 !== $this->aPembelajaranRelatedByBelKe15->getPembelajaranId()) {\n $this->aPembelajaranRelatedByBelKe15 = null;\n }\n if ($this->aPembelajaranRelatedByBelKe16 !== null && $this->bel_ke_16 !== $this->aPembelajaranRelatedByBelKe16->getPembelajaranId()) {\n $this->aPembelajaranRelatedByBelKe16 = null;\n }\n if ($this->aPembelajaranRelatedByBelKe17 !== null && $this->bel_ke_17 !== $this->aPembelajaranRelatedByBelKe17->getPembelajaranId()) {\n $this->aPembelajaranRelatedByBelKe17 = null;\n }\n if ($this->aPembelajaranRelatedByBelKe18 !== null && $this->bel_ke_18 !== $this->aPembelajaranRelatedByBelKe18->getPembelajaranId()) {\n $this->aPembelajaranRelatedByBelKe18 = null;\n }\n if ($this->aPembelajaranRelatedByBelKe19 !== null && $this->bel_ke_19 !== $this->aPembelajaranRelatedByBelKe19->getPembelajaranId()) {\n $this->aPembelajaranRelatedByBelKe19 = null;\n }\n if ($this->aPembelajaranRelatedByBelKe20 !== null && $this->bel_ke_20 !== $this->aPembelajaranRelatedByBelKe20->getPembelajaranId()) {\n $this->aPembelajaranRelatedByBelKe20 = null;\n }\n }", "public function getBanyakSoal();", "function _is_staff()\n {\n $user = $this->visitor->get();\n\t\t//echo $user['ugrade'];\n\t\t//1.普通會員 2.VIP 3.Staff\n\t\tif($user['ugrade'] == 3){\n\t\t\treturn $user['ugrade'];\n\t\t}\n\t}", "public function compare();", "function checkStart(){\r\n\tif (!$this->Eq['A']['id']) $this->sendError(\"你沒有裝備武器,不能出擊。\");\r\n\telseif ($this->Player['en'] < $this->RequireEN) $this->sendError(\"EN不足,無法出擊。\");\r\n\telseif ($this->Player['sp'] < $this->SP_Cost) $this->sendError(\"SP不足,無法以 $Pl->Tactics[name] 出擊。\");\r\n}", "public function testSavedUrsprungPlan($mesic,$rok){\n $hasData = 0;\n $sql = \"select persnr from dzeitsoll2 where MONTH(datum)='$mesic' and YEAR(datum)='$rok'\";\n $result = $this->db->query($sql);\n if(count($result)>0)\n $hasData = 1;\n return $hasData;\n }", "public function hasAnger(){\r\n return $this->_has(4);\r\n }", "public function hasAnger(){\r\n return $this->_has(4);\r\n }", "function isValid() ;", "public static function check();", "public static function Znevalidni_kolize_ucastnika_vsechny($iducast) {\r\n//echo \"<hr><br>*Znevalidnuji vsechny kolize ucastnika , formular=\" . $formular;\r\n \r\n $dbh = Projektor2_AppContext::getDB();\r\n\r\n //vyberu vsechny ulozene kolize z tabulky uc_kolize_table\r\n $query= \"SELECT * FROM uc_kolize_table \" .\r\n \"WHERE id_ucastnik=\" . $iducast . \" and uc_kolize_table.valid\" ;\r\n\r\n //echo \"<br>*dotaz na kolize v Znevalidni_kolize_ucastnika: \" . $query;\r\n \r\n $sth = $dbh->prepare($query);\r\n $succ = $sth->execute(); \r\n while($zaznam_kolize = $sth->fetch(PDO::FETCH_ASSOC)) {\r\n //echo \"<br>*Znevalidnuji kolizi: \" . $zaznam_kolize[id_uc_kolize_table];\r\n \r\n $query1 = \"UPDATE uc_kolize_table SET \" .\r\n \"valid=0 WHERE uc_kolize_table.id_uc_kolize_table=\" . $zaznam_kolize['id_uc_kolize_table'] ;\r\n $data1= $dbh->prepare($query1)->execute(); \r\n }\r\n \r\n//echo \"<hr>\";\r\n}", "public function boleta()\n\t{\n\t\t//\n\t}", "public function extra_voor_verp()\n\t{\n\t}", "function iyelikUnluDusmesiCheck($kelime, $ek){\n\t\t// eger eksiz kelime tek heceli degilse unlu dusmesi yok\n\t\tif(countVowels($kelime) != 1) return -1;\n\t\t$kelimeninSonHarfi = mb_substr($kelime, -1);\n\t\t// eksiz kelime unsuzle bitmiyorsa unlu dusmesi yok\n\t\tif(!in_array($kelimeninSonHarfi, UNSUZLER)) return -1;\n\t\t// eksiz kelimenin sondan ikinci harfi de unsuz olmali\n\t\tif(!in_array(mb_substr($kelime, -2, -1), UNSUZLER)) return -1;\n\n\t\t$ekinIlkUnlusu = firstCharOf($ek, UNLULER);\n\t\treturn(mb_substr($kelime, 0, -1).$ekinIlkUnlusu.$kelimeninSonHarfi);\n\t}", "public function kreverHendelse()\n {\n return $this->krever_hendelse;\n }", "public function performChecks(){\n\t\t\n\t}", "private function negarDetalleSolicitud()\r\n {\r\n $result = false;\r\n $modelInscripcion = self::findInscripcionSucursal();\r\n if ( $modelInscripcion !== null ) {\r\n if ( $modelInscripcion['id_contribuyente'] == $this->_model->id_contribuyente ) {\r\n $result = self::updateSolicitudInscripcion($modelInscripcion);\r\n } else {\r\n self::setErrors(Yii::t('backend', 'Error in the ID of taxpayer'));\r\n }\r\n }\r\n\r\n return $result;\r\n }", "function toekomst($datum) {\n $vandaagdatum = date(\"Y-m-d\");\n $vandaag = strtotime($vandaagdatum);\n $anderedatum = strtotime($datum);\n return ($vandaag <= $anderedatum);\n}", "public function validateTeknik($tek) {\n\t\t\n\t}", "public function allowedForOvertime()\n { return (($this->esgrp == 'ES') || ($this->esgrp == 'EF') || ($this->esgrp == 'F')) ? true : false;\n }", "public function hasOnlyDefaultValues()\n {\n if ($this->create_date !== '2021-06-07 11:49:57') {\n return false;\n }\n\n if ($this->last_update !== '2021-06-07 11:49:57') {\n return false;\n }\n\n if ($this->last_sync !== '1901-01-01 00:00:00') {\n return false;\n }\n\n if ($this->jml_jamban_l_g !== '0') {\n return false;\n }\n\n if ($this->jml_jamban_l_tg !== '0') {\n return false;\n }\n\n if ($this->jml_jamban_p_g !== '0') {\n return false;\n }\n\n if ($this->jml_jamban_p_tg !== '0') {\n return false;\n }\n\n if ($this->jml_jamban_lp_g !== '0') {\n return false;\n }\n\n if ($this->jml_jamban_lp_tg !== '0') {\n return false;\n }\n\n if ($this->tipe_jamban !== '9') {\n return false;\n }\n\n if ($this->a_sedia_pembalut !== '0') {\n return false;\n }\n\n if ($this->a_tempat_sampah_kelas !== '0') {\n return false;\n }\n\n if ($this->a_tempat_sampah_tutup_p !== '0') {\n return false;\n }\n\n if ($this->a_cermin_jamban_p !== '0') {\n return false;\n }\n\n if ($this->a_memiliki_tps !== '0') {\n return false;\n }\n\n if ($this->a_tps_angkut_rutin !== '0') {\n return false;\n }\n\n if ($this->a_anggaran_sanitasi !== '0') {\n return false;\n }\n\n if ($this->a_melibatkan_sanitasi_siswa !== '0') {\n return false;\n }\n\n // otherwise, everything was equal, so return true\n return true;\n }", "public function isVerificato()\n {\n if ($this->verificato === NULL)\n {\n $conn = $GLOBALS[\"connest\"];\n $conn->connetti();\n $anno = AnnoSportivoFiam::get();\n\n //verifica pagamento\n $id = $this->getChiave();\n $mr = $conn->select('pagamenti_correnti', \"idtesserato='$id' AND YEAR(scadenza) >= $anno AND idtipo=\" . self::TIPO_ATL_FIAM);\n if ($mr->fetch_row() === NULL)\n {\n $this->verificato = false;\n } else\n {\n //verifica assicurazione\n $mr = $conn->select('assicurazioni_correnti', \"idtesserato='$id' AND YEAR(valido_da) <= $anno AND YEAR(valido_a) >= $anno\");\n $this->verificato = ($mr->fetch_row() !== NULL);\n }\n }\n return $this->verificato;\n }", "function compare($wert_a, $wert_b)\n {\n $a = $wert_a[0];\n $b = $wert_b[0];\n if ($a == $b) {\n return 0;\n }\n return ($a > $b) ? -1 : +1;\n }", "function provera($broj) {\r\n if ($broj <= 1) {\r\n throw new Exception(\"Broj mora biti veci od 1\");\r\n }\r\n}" ]
[ "0.6268083", "0.5998073", "0.5849192", "0.57507366", "0.57208544", "0.56841224", "0.56165564", "0.5611577", "0.5608521", "0.5584466", "0.55815244", "0.55780184", "0.55712974", "0.5564555", "0.55350125", "0.55350125", "0.55350125", "0.55350125", "0.55350125", "0.55342805", "0.5520201", "0.55179834", "0.5506696", "0.5504571", "0.54828835", "0.54254174", "0.54161364", "0.5404049", "0.53987116", "0.53932214", "0.5370912", "0.5363858", "0.5358509", "0.53543264", "0.53543264", "0.53474015", "0.5340578", "0.5337624", "0.533711", "0.53146833", "0.53098726", "0.53080106", "0.53066784", "0.53020656", "0.5300187", "0.5289083", "0.5288446", "0.5288087", "0.5283353", "0.5277284", "0.52682114", "0.5265314", "0.5258101", "0.52463675", "0.52463675", "0.52463675", "0.52463675", "0.5231256", "0.52282107", "0.5217456", "0.5217456", "0.5217456", "0.5217456", "0.5217456", "0.5217456", "0.5217456", "0.5217456", "0.5214038", "0.5205518", "0.51962304", "0.5190624", "0.519049", "0.5182466", "0.5179363", "0.5177483", "0.51704574", "0.516283", "0.5162536", "0.5159662", "0.51577455", "0.5157494", "0.51551026", "0.5150706", "0.5143677", "0.5143677", "0.51410025", "0.5140986", "0.5138243", "0.5136765", "0.51356494", "0.512947", "0.5126602", "0.51227134", "0.51225525", "0.51194364", "0.5115787", "0.5113083", "0.510785", "0.51036066", "0.5099205", "0.5097544" ]
0.0
-1
check of de gebruikersnaam / email al in de database is
function uidExists($conn, $uid, $email) { $sql= "SELECT * FROM users WHERE user_uid = ? OR user_email = ?;"; $stmt = mysqli_stmt_init($conn); if (!mysqli_stmt_prepare($stmt, $sql)) { header("location: ../signup.php?error=stmtfailed"); exit(); } mysqli_stmt_bind_param($stmt, "ss", $uid, $email); mysqli_stmt_execute($stmt); $resultData = mysqli_stmt_get_result($stmt); if ($row = mysqli_fetch_assoc($resultData)) { return $row; } else { $result = false; return $result; } mysqli_stmt_close($stmt); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkUsername_Email(){\n\t\t\t$value = $_POST[\"value\"];\n\t\t\t$field = $_POST[\"field\"];\n\t\t\t//echo \"$value\".' '.$field;\n\t\t\t$query = $this->db->query(\"SELECT $field FROM users WHERE $field='$value' LIMIT 1\");\n\t\t\t$valid = $query->num_rows();\n\t\t\tif($valid == 0){\n\t\t\t\tif($field == 'email'){\n\t\t\t\t\techo \"Eunique\";\n\t\t\t\t}else{\n\t\t\t\t\techo \"U_unique\";\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\tif($field == 'email'){\n\t\t\t\t\techo \"This \".$field.\" is already registered with another user.\";\n\t\t\t\t}else{\n\t\t\t\t\techo \"This \".$field.\" is not available, please choose something different\";\n\t\t\t\t}\n\t\t\t}\n\t\t}", "function verificar_email_usuario($e){\n\t\t\t\t\tinclude('../../conexion.php');/* mediante la consulta busca si concuerda algun usuario */\n\t\t\t\t\t$sql = \"SELECT email from usuarios WHERE status=1 AND BINARY email ='\".$e.\"'\";\n\t\t\t\t\t$rec = mysqli_query($con,$sql)or die(\"valio sombrilla'\".$sql.\"'\"); \n\t\t\t\t\t$count = 0;/* si la consulta es un exito aumenta un contador y como resultado retorna un valor */\n\t\t\t\t\twhile($row = mysqli_fetch_array($rec)){ $count++;}\t\n\t\t\t\t\tif($count == 1){return 1;}\n\t\t\t\t\telse{return 0; }\n\t\t\t}", "public function email_check($email)\n\t{\n\t\t//opbouw van de query'\n\t\t$this->db->select('*');\n\t\t$this->db->from('Gebruiker');\n\t\t$this->db->where('Email',strtolower($email));\n\t\t$query=$this->db->get();// SELECT 'Email' from Gebruiker where 'Email'=$email;\n\t\t$result=$query->row_array();\n\t\tif ($query->num_rows() > 0 && $result['Bijnaam']!=$this->session->userdata('username')){\n\t\t\t$this->form_validation->set_message('email_check', '{field} bestaat al in de database.');\n\t\t\treturn FALSE;\n\t\t}else{\n\t\t\treturn TRUE;\n\t\t}\n\t}", "public function checkEmail($email){\r\n $requete = \"select * from users where (Email='\" . $email . \"') \";\r\n //error_log(\"check email requete = (\" . $requete . \")\\n\");\r\n if ($this->getRequete($requete)){\r\n //$this->display();\r\n if ($this->Email == $email){\r\n return true;\r\n }\r\n }\r\n return false;\r\n }", "public function emailJaCadastrado(){\n\t\t$query=$this->con->prepare(\"select email from empresa where email=:email\");\n\t\t//executa o sql e informa o email a ser pesquisado\n\t\t$query->execute(array('email' => $this->email));\n\t\t//retorna resultado com um array assoc\n\t\t$resultado = $query->fetch(PDO::FETCH_ASSOC);\n\t\t//se retorna falso o email não foi cadastrado ainda\n\t\tif($resultado){\n\t\t\treturn true;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}", "public function chkEmailExist() {\n ob_clean();\n $this->load->model('register_model');\n $user_email = $this->input->post('user_email');\n $table_to_pass = 'mst_users';\n $fields_to_pass = array('user_id', 'user_email');\n if ($this->input->post('action') != \"\") {\n $condition_to_pass = \"(user_type!=2) and (`user_email` = '\" . $user_email . \"' or `user_name` = '\" . $user_email . \"')\";\n } else {\n $condition_to_pass = array(\"user_email\" => $user_email);\n }\n $arr_login_data = $this->register_model->getUserInformation($table_to_pass, $fields_to_pass, $condition_to_pass, $order_by_to_pass = '', $limit_to_pass = '', $debug_to_pass = 0);\n if (count($arr_login_data)) {\n echo 'true';\n } else {\n echo 'false';\n }\n }", "private function checkEmail(){\n\n $request = $this->_connexion->prepare(\"SELECT COUNT(*) AS num FROM Users WHERE user_email=?\");\n $request->execute(array($this->_userEmail));\n $numberOfRows = $request->fetch();\n\n if($numberOfRows['num'] == 0)\n return false;\n else\n return true;\n\n }", "function check_email_exist(){\n //TODO syntize the query\n $this->SQL = \"SELECT id,private_name,family_name ,email,password FROM users\"\n . \" WHERE email = '\" . $this->params['email'] . \"';\" ;\n \n \n $this->selecet_query();\n \n \n if ( !empty( $this->results[0]['email'] ) ){\n //found mail - check password\n \n if ($this->results[0]['password'] === $this->params['password']){\n \n $this->success_login();\n \n \n } else {\n // if password incorrect\n $this->results =array( 'results'=>'fail');\n \n }\n \n \n } else {\n //didnt found email \n $this->results =array( 'results'=>'fail');\n \n }\n return $this->results;\n \n }", "function email_existe($email){\n\t$sql = \"SELECT id FROM usuarios WHERE email = '$email'\";\n\n\t$resultado = query($sql);\n\n\tif(contar_filas($resultado) == 1){\n\n\t\treturn true;\n\t} else{\n\t\treturn false;\n\t}\n\n}", "function KTEmail($email){\n\t\t\t\t$sql=\"SELECT * FROM user WHERE Email='$email'\";\n\t\t\t\t$re=mysql_query($sql) or die(mysql_error());\n\t\t\t\t$n=mysql_num_rows($re);\n\t\t\t\tif($n>=1)\n\t\t\t\t\treturn true;\n\t\t\t\telse\n\t\t\t\t\treturn false;\n\t\t\t}", "function validate_forgotpass_user_email($str){\n\t\t$sql\t=\t\"select * from reseller_store where user_email='$str' \";\n\t\t$tempInfo\t=\t$this->db->query($sql)->row_array();\t\t\n\t\tif(count($tempInfo) == 0){\n\t\t\t$this->form_validation->set_message('validate_forgotpass_user_email', LoginMessages(7));\n\t\t\treturn false;\n\t\t}\n\t\telse{\n\t\t\treturn true;\n\t\t}\n\t}", "function testLogin($login,$mail){\r\n $sql = $GLOBALS[\"db\"]->query('SELECT * FROM j_compte WHERE login = \"'.$login.'\" OR email =\"'.$mail.'\"');\r\n $donnees = mysql_fetch_array($sql);\r\n if(isset($donnees['mdp'])){\r\n return false;\r\n }\r\n return true;\r\n }", "public function _unique_email() {\r\n // UNLESS it's the email for the current user\r\n\r\n $id = $this->uri->segment(4);\r\n $this->db->where('email', $this->input->post('email'));\r\n !$id || $this->db->where('id !=', $id);\r\n $account = $this->account_model->get();\r\n\r\n if (count($account)) {\r\n $this->form_validation->set_message('_unique_email', '%s này đã tồn tại');\r\n return FALSE;\r\n }\r\n return TRUE;\r\n }", "function check($data)\n\t\t{\n\t\t\t$email = \"'\".$data['email'].\"'\";\n\t\t\t$password = \"'\".$data['password'].\"'\";\n\t\t\t$sql = $this->conn_id->query(\"select * from users where email = \".$email .\" and passwd = \".$password);\n\t\t\t\t$r = $sql->fetchALL(PDO::FETCH_ASSOC);\n\t\t\tif(!empty($r))\n\t\t\t\treturn TRUE;\n\t\t\telse\n\t\t\t\treturn FALSE;\n\t\t}", "public function checkEmail($data){\n $this->stmt = $this->query('SELECT * FROM users WHERE email = :email');\n $this->stmt->bindValue(':email', $data['email']);\n $row = $this->single();\n // Check row\n if($this->stmt->rowCount() > 0){\n return true;\n } else {\n return false;\n }\n\n }", "function email_unique_check($email)\r\n\t{\r\n\t\t$isUnique = true;\r\n\r\n\t\t//Skapar anslutning till databasen.\r\n\t\t$db=new Database();\r\n\r\n\t\t//Hämtar de rader som har samma email.\r\n\t\t$result = $db->getUser($email);\r\n\r\n\t\t//Om det blev resultat.\r\n\t\tif($result)\r\n\t\t{\r\n\t\t\t//Finns det en rad betyder detta att ett konto med samma email redan existerar i databasen, och inget nytt konto ska skapas.\r\n\t\t\tif($row = mysqli_fetch_row($result))\r\n\t\t\t{\r\n\t\t\t\t//Email är ej unikt.\r\n\t\t\t\t$isUnique = false;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t//Avslutar anslutning till databasen.\r\n\t\t$db->close();\r\n\r\n\t\treturn $isUnique;\r\n\t}", "public function checkEmail($email) // provjera dali email vec postoji \r\n {\r\n $query = $this->db->select('*')->from($this->userTbl)->where('email', $email)->get();\r\n $result=$query->result();\r\n $num_rows=$query->num_rows();\r\n\r\n if($num_rows == 0) // ako nema emaila koji podudaraju vraca \"false\"\r\n return false;\r\n return true;\r\n }", "function Boolean_Existencia_Usuario($username,$email)\n{\n\t$query = consultar(sprintf(\"SELECT email_usuario,usuario FROM tb_usuarios WHERE email_usuario='%s' or usuario='%s'\",escape($username),escape($email)));\n\tif(Int_consultaVacia($query)>0)\n\t{\n\t\treturn array(false,'El usuario o el email ya existen, intenta nuevamente.');\n\t}else\n\t{\n\t\treturn array(true,'');\t\n\t}\n\n}", "function consultarEmailUsuario(){\n global $conexion, $data;\n $email = $data[\"email\"];\n $resultado = mysqli_query($conexion,\"SELECT * FROM usuario WHERE usu_email='$email'\");\n echo validarError($conexion, false, $resultado);\n }", "function checkEmail($email){\n\t\t\t$database = new connect();\n\t\t\t$result = false;\n\t\t\t\n\t\t\t$query = \"SELECT * FROM users WHERE email='$email'\";\n\t\t\t$resultQuery = mysql_query($query); \n\t\t\t\n\t\t\tif(mysql_num_rows($resultQuery) == 1){\n\t\t\t\t$result = true;\n\t\t\t}\n\t\t\treturn $result;\n\t\t}", "function emailExists(){\n\n $email=htmlspecialchars(strip_tags($this->email));\n $sql = \"SELECT * FROM direttore WHERE email LIKE ?\";\n $stmt = $this->conn->prepare( $sql );\n $this->email=htmlspecialchars(strip_tags($this->email));\n \n $stmt->bindParam(1, $this->email);\n \n $stmt->execute();\n \n $num = $stmt->rowCount();\n if($num>0){\n\n $row = $stmt->fetch(PDO::FETCH_ASSOC);\n\n $this->id_direttore = $row['id_direttore'];\n $this->id_negozio = $row['id_negozio'];\n $this->nome = $row['nome'];\n $this->cognome = $row['cognome'];\n $this->email = $row['email'];\n $this->password = $row['pass'];\n $this->ruolo = \"direttore\";\n return true;\n\n }\n\n $sql = \"SELECT addetto_vendita.id_addetto, addetto_vendita.id_reparto, addetto_vendita.nome, addetto_vendita.cognome, addetto_vendita.email, addetto_vendita.pass\n FROM addetto_vendita WHERE addetto_vendita.email = ?\";\n $stmt = $this->conn->prepare( $sql );\n $stmt->bindParam(1, $this->email);\n $stmt->execute();\n $num = $stmt->rowCount();\n\n if($num>0){\n\n $row = $stmt->fetch(PDO::FETCH_ASSOC);\n\n $this->id_addetto = $row['id_addetto'];\n $this->id_reparto = $row['id_reparto'];\n $this->nome = $row['nome'];\n $this->cognome = $row['cognome'];\n $this->email = $row['email'];\n $this->password = $row['pass'];\n $this->ruolo = \"addetto vendita\";\n return true;\n\n }\n\n $sql = \"SELECT magazziniere.id_magazziniere, magazziniere.id_negozio, magazziniere.nome, magazziniere.cognome, magazziniere.email, magazziniere.pass\n FROM magazziniere WHERE magazziniere.email = ?\";\n $stmt = $this->conn->prepare( $sql );\n $stmt->bindParam(1, $this->email);\n $stmt->execute();\n $num = $stmt->rowCount();\n\n if($num>0){\n\n $row = $stmt->fetch(PDO::FETCH_ASSOC);\n\n $this->id_magazziniere = $row['id_magazziniere'];\n $this->id_negozio = $row['id_negozio'];\n $this->nome = $row['nome'];\n $this->cognome = $row['cognome'];\n $this->email = $row['email'];\n $this->password = $row['pass'];\n $this->ruolo = \"magazziniere\";\n return true;\n\n }\n\n $sql = \"SELECT fornitore.id_fornitore, fornitore.nome, fornitore.email, fornitore.pass \n FROM fornitore WHERE fornitore.email = ?\";\n $stmt = $this->conn->prepare( $sql );\n $stmt->bindParam(1, $this->email );\n $stmt->execute();\n $num = $stmt->rowCount();\n\n if($num>0){\n\n $row = $stmt->fetch(PDO::FETCH_ASSOC);\n\n $this->id_fornitore = $row['id_fornitore'];\n $this->nome = $row['nome'];\n $this->email = $row['email'];\n $this->password = $row['pass'];\n $this->ruolo = \"fornitore\";\n return true;\n }\n\n return false;\n\n }", "function checkEmail($email){\n\n\t\t\t$query = \"SELECT Email FROM tbl_userinfo WHERE Email=$email LIMIT 1\";\n\t\t\t\n\t\t\t$result = $this->conn->query($query); \n\n\t\t\tif (var_dump($result) > 0){\n\t\t\t\treturn true;\n\n\t\t\t}else{\n\t\t\t\treturn false;\n\n\t\t\t}\n\n\t\t}", "function check_register($pseudo, $password, $confirmpassword, $firstname, $surname, $mail, $areaname)\n{\n\t$field_empty = 0;\n\t$pseudo_exists = 0;\t\n\t$mail_exists = 0;\n\t$password_not_same = 0;\n\t\n\t// Checking empty fields\t \n\tif((empty($pseudo)) || (empty($password)) || (empty($confirmpassword))|| (empty($firstname)) || (empty($surname)) || (empty($mail)) || (empty($areaname)) )\n\t{\n\t\t$field_empty = 1;\n\t}\n\t// Checking pseudo or mail if already existing\n\t\n\t$query = 'SELECT pseudo, mail FROM users';\n\t$result = call_db($query);\n\t\t\n\twhile($donnees = mysql_fetch_array($result))\n\t{\n\t\tif\t(($donnees['pseudo']) == $pseudo || ($donnees['mail']==$mail))\n\t\t{\t\n\t\t\t$pseudo_exists = 1;\t\n\t\t}\n\t\tif\t(($donnees['mail']==$mail))\n\t\t{\t\n\t\t\t$mail_exists = 1;\t\n\t\t}\n\t}\n\t\n\tmysql_free_result($result);\n\tmysql_close();\n\t\n\t// Checking if field password and confirmpassword are same\n\tif($password != $confirmpassword)\n\t{\n\t\t$password_not_same = 1;\n\t}\n\t\t\n\tif($field_empty == 0 && $pseudo_exists == 0 && $mail_exists == 0 && $password_not_same == 0)\n\t{\n\t\tinclude('modeles/valid_register.php');\n\t\tvalid_register($pseudo,$password,$surname,$firstname,$mail,$areaname);\n?>\n\t\t<script language=\"Javascript\">\n\t\t\tdocument.location.replace(\"index.php?page=validation\");\n\t\t</script>\n\t\t<?php\n\t}\n\t\n\techo\"<div id='box2'>\";\n\t\n\tif($field_empty == 1)\n\t{\n\t\techo'<br> Un ou plusieurs champ(s) sont vide(s)<br>';\n\t}\n\tif($pseudo_exists == 1)\n\t{\n\t\techo'<br>Ce pseudo est déja existant ! Merci d\\'en choisir un autre. <br>';\n\t}\n\tif($mail_exists == 1)\n\t{\n\t\techo'<br>Cette adresse e-mail est déja existante !<br>';\n\t}\n\tif($password_not_same == 1)\n\t{\n\t\techo'<br>Les deux mots de passe ne correspondent pas !';\n\t}\n\techo\"</div>\";\n}", "function check_mail($email){\n\t\tglobal $bdd;\n\n\t\t$req = $bdd->prepare(\"SELECT mail FROM utilisateur WHERE mail = :email\");\n\t\t$req->execute(array(\"email\"=>$email));\n\n\t\t$exist = $req->rowCount();\n\t\t$req->closeCursor();\n\n\t\treturn $exist;\n\t}", "function verificarMail($id, $email){\n $conn=connexioBD();\n $emailRepe=true;\n $sql=\"SELECT email FROM usuaris WHERE id='$id'\";\n if (!$resultado =$conn->query($sql)){\n die(\"Error al comprobar datos\".$conn->error);\n }\n if($resultado->num_rows>=0){\n while($usuari=$resultado->fetch_assoc()){\n if($usuari[\"email\"]==$email){\n $emailRepe=false;\n } \n }\n }\n return $emailRepe;\n $resultado->free();\n $conn->close();\n}", "function is_registered($email) {\n\t\tglobal $pdo;\n\n\t\t//delete old registration attempts\n\t\t$pdo->query(\"DELETE FROM user WHERE verified = 0 AND TIME_TO_SEC(TIMEDIFF(CURRENT_TIMESTAMP, code_generation_time)) > 600\");\n\n\t\t//empty or array check\n\t\tif(empty($email) || is_array($email)) {\n\t\t\treturn null;\n\t\t}\n\n\t\t//check if user exists\n\t\t$sql = \"SELECT id FROM user WHERE REPLACE(email, \\\".\\\", \\\"\\\") = REPLACE(:email, \\\".\\\", \\\"\\\")\";\n\t\t$sth = $pdo->prepare($sql);\n\t\t$sth->bindValue(\":email\", mail_simplify($email), PDO::PARAM_STR);\n\t\t$sth->execute();\n\n\t\tif($sth->rowCount() == 0) {\n\t\t\treturn false;\n\t\t} else {\n\t\t\treturn true;\n\t\t}\n\t}", "public function uniqueEmail() {\n if (CmsUser::model()->exists(\"id != \" . userId() . \" AND email='{$this->register_email}'\")) {\n $this->addError('register_email', 'Email already exist');\n }\n }", "public function validUniqueMail() {\n $em = $this->getDoctrine()->getManager();\n $Person = $em->getRepository('UNOEvaluacionesBundle:Person')->findOneBy(array('email' => $this->_datPerson[email]));\n if ($Person) {\n #si existe el mail, por lo que hay q pedirle q ingrece otro\n return false;\n }else{\n return true;\n }\n\n }", "public function email_exists(){\n $email = $this->input->post('email');\n $query = $this->db->query(\"SELECT email, password FROM user WHERE email='$email'\"); \n if($row = $query->row()){\n return TRUE;\n }else{\n return FALSE;\n }\n}", "function chk_email($email)\n\t{\n\t\t$str = \"Select u_email from tbl_user where u_email = ?\";\n\t\t\n\t\t//Executes the query\n\t\t$res = $this -> db -> query($str, $email);\n\t\t\n\t\t//Checks whether the result is available in the table\n\t\tif($res -> num_rows() > 0)\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}", "function isUserRegistered($email) {\n\t\ttry {\n \t\tif($email==null) {\n \treturn false;\n \texit();\n\t\t}\n\t\t$mailCheck = $this->connection->prepare(\"SELECT `EMAIL` from win WHERE `email` = ?\");\n\t\t$mailCheck->bindValue(1, $email);\n\t\t$mailCheck->execute();\n\t\tif ($mailCheck->rowCount() > 0) {\n\t\t\treturn true;\n\t\t}\n\t\telse {\n \treturn false;\n \texit();\n\t\t}\n\t}\n\t\tcatch(Exception $e) {\n\t\t}\n\t}", "public function user_email_check($uemail) {\r\n $this->db->select('user_email');\r\n $this->db->where('user_email', $uemail);\r\n $query = $this->db->get('users');\r\n $data = $query->result();\r\n return $data;\r\n }", "public function checkemailconfirmed($email)\n {\n $this->db->query('SELECT * FROM user WHERE email = :email');\n $this->db->bind(':email', $email);\n $row = $this->db->single();\n $chek = $row->confirmed;\n if($chek == 1)\n {\n return true;\n }else{\n return false;\n }\n }", "function dbCheck($data){\n\t\t\t\t$sql = \"SELECT UID FROM user_info WHERE email = '$data'\";\n\n\t\t\t\t$result = mysqli_query($GLOBALS['db'], $sql);\n\t\t\t\t$count = mysqli_num_rows($result);\n\t\t\t\tif(!$result || $count == 0){\n\t\t\t\t\treturn \"This user does not exist.\";\n\t\t\t\t}//if\n\t\t\t\telse{\n\t\t\t\t\treturn \"\";\n\t\t\t\t}//ifelse\n\t\t\t\treturn \"\";\n\n\t}", "public function isEmailExist($email){ \n $query = mysqli_query($this->database, \"SELECT * FROM users WHERE Gmail = '$email'\"); \n $row = mysqli_num_rows($query); \n if($row > 0){ \n return true; \n } else { \n return false; \n } \n }", "function user_email_exists($email){\n global $connection;\n\n $query = \"SELECT user_email FROM users WHERE user_email = '{$email}'\";\n $result = mysqli_query($connection, $query);\n confirm($result);\n\n //if the user_email column name already has a value that is given by the user when registering\n if (mysqli_num_rows($result) > 0) {\n return true;\n }else{\n return false;\n }\n}", "public function v_nuevo(){\n\t\tif($this -> e_user === '' && $this -> e_pass === '' && $this -> e_email === ''){\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public function email_check($str){ \n $con = array( \n 'returnType' => 'count', \n 'conditions' => array( \n 'email' => $str \n ) \n ); \n $checkEmail = $this->User->getRows($con); \n if($checkEmail > 0){ \n $this->form_validation->set_message('email_check', 'The given email already exists.'); \n return FALSE; \n }else{ \n return TRUE; \n } \n }", "public function chkEmailDuplicate() {\n $this->load->model('register_model');\n $user_email = $this->input->post('user_email');\n $user_email_back = $this->input->post('user_email_back');\n if ($user_email == $user_email_back) {\n echo 'true';\n } else {\n $table_to_pass = 'mst_users';\n $fields_to_pass = array('user_id', 'user_email');\n $condition_to_pass = array(\"user_email\" => $user_email);\n $arr_login_data = $this->register_model->getUserInformation($table_to_pass, $fields_to_pass, $condition_to_pass, $order_by_to_pass = '', $limit_to_pass = '', $debug_to_pass = 0);\n if (count($arr_login_data)) {\n echo 'false';\n } else {\n echo 'true';\n }\n }\n }", "public function checkEmail(){\n\t\t\t$user = new User;\n\t\t\t$doubleCount = $user->where('login','=', Input::get('new_user_email'))->count();\n\t\t\t\n\t\t\tif($doubleCount > 0){\n\t\t\t\t$result = array(\n\t\t\t\t\t'cmd'=>1,\n\t\t\t\t\t'msg'=>trans('alerts.exist_email')\n\t\t\t\t);\n\t\t\t}else{\n\t\t\t\t$result = array(\n\t\t\t\t\t'cmd'=>0,\n\t\t\t\t\t'msg'=>'good email'\n\t\t\t\t);\n\t\t\t}\n\t\t\t\n\t\t\treturn Response::json($result);\n\t\t}", "function check_email($str){\n\t\t$this->db->where('user_email',$str);\n\t\t$rs\t=\t$this->db->get('reseller_store');\t\n\t\t$is_email_exits\t=\t$rs->num_rows();\n\t\tif($is_email_exits>0){\n\t\t\t$user_email_exits_msg\t=\tRegisterMessages(1);\n\t\t\t$this->form_validation->set_message('check_email', $user_email_exits_msg);\n\t\t\treturn false;\n\t\t}\n\t\telse\n\t\t\treturn true;\n\t}", "function check_existing_email($email){\n $sql = \"SELECT * from mbf_user WHERE email='$email'\";\n $query = $query = $this->db->query($sql);\n if ($query->num_rows() > 0){\n return true;\n }else{\n return false;\n }\n }", "public function email_exists() {\n\t\t\n\t\t$email = $this->input->post('users_email');\n\t\t$edit_id = $this->input->post ( 'edit_id' );\n\t\t$where = array (\n\t\t\t'users_email' => trim ( $email )\n\t\t);\n\n\t\tif ($edit_id != \"\") {\n\n\t\t\t$where = array_merge ( $where, array (\n\t\t\t\t\t\"users_id !=\" => $edit_id \n\t\t\t) );\n\t\n\t\t} \n\n\t\t$result = $this->Mydb->get_record( 'users_id', $this->table, $where );\n\t\t\n\t\tif ( !empty ( $result ) ) {\n\t\t\t$this->form_validation->set_message ( 'email_exists', get_label ( 'user_email_exist' ) );\n\t\t\treturn false;\n\t\t} else {\n\t\t\treturn true;\n\t\t}\n\t}", "function validatedLogin($email,$contra){\n $query = \"SELECT\n id_usuario,\n nombre,\n apellidoP,\n apellidoM,\n email,\n fechaNac,\n nombreRol,\n valuePermission\n FROM\n usuario\n LEFT JOIN(rol) ON usuario.rol_id = rol.id_rol\n WHERE\n usuario.email = \".$this->db->escape($email).\" AND\n pass = \".$this->db->escape($contra).\"\n \";\n return $this->db->query($query);\n }", "function verificacioBD($email){\n $conn=connexioBD();\n $usuariExisteix=false;\n $sql=\"SELECT * FROM usuaris WHERE email='$email'\";\n if (!$resultado = $conn->query($sql)) {\n die(\"Error en la consulta\".$conn->error);\n }\n if($resultado->num_rows>=0){\n while($usuari=$resultado->fetch_assoc()){\n $usuariExisteix=true; \n }\n }\n $resultado->free();\n $conn->close();\n return $usuariExisteix;\n}", "function checkemail() {\n\t\tConfigure::write('debug', 0);\n\t\t$this->autoRender = false;\n\t\t$this->layout = \"\";\n\t\t\n\t\t$email = $_REQUEST['data']['Member']['email'];\n\t\t\n\t\t$count = $this->Member->find('count', array(\n\t\t\t'conditions' => array(\n\t\t\t\t'email' => $email\n\t\t\t)\n\t\t));\n\t\t\n\t\t\n\t\tif ($count > 0) {\n\t\t\techo \"false\";\n\t\t} else {\n\t\t\techo \"true\";\n\t\t}\n\t}", "public function checkRegisteredEmail()\n {\n $email = $this->input->post('email');\n\n $user_login_id = $this->authentication_helper->checkEmail($email);\n \n if (isset($user_login_id) && !empty($user_login_id)) {\n echo json_encode(true);\n }\n else\n {\n echo json_encode(false);\n }\n }", "public static function modeloExisteEmail( String $email):bool{\n $stmt=self::$db->prepare(self::consulta_email);\n $stmt->bindValue(1,$email);\n $stmt->execute();\n modeloUserDB::Init();\n}", "function checkLoginDetails($email, $password) {\r\n\t\t\t$sql = \"SELECT * FROM `users` WHERE UPPER(email)=UPPER('%s') AND password='%s'\";\r\n\t\t\t$result = $this->query($sql, $email, sha1($password));\r\n\t\t\tif (mysql_num_rows($result) == 0)\r\n\t\t\t\treturn false;\r\n\t\t\treturn true;\r\n\t\t}", "function checkForAccount($email, $db) {\n $sql = 'SELECT email FROM users WHERE email = :email';\n $stmt = $db->prepare($sql);\n $stmt->bindValue(':email', $email, PDO::PARAM_STR);\n $stmt->execute();\n $matchEmail = $stmt->fetch(PDO::FETCH_NUM);\n $stmt->closeCursor();\n if(empty($matchEmail)){\n return 0;\n } else {\n return 1;\n \n }\n }", "public function email_check($str){\n\t\tif ($this->user_model->count(array('email' => $str)) > 0){\n $this->form_validation->set_message('email_check', 'Email sudah digunakan, mohon ganti dengan yang lain');\n return FALSE;\n }\n else{\n return TRUE;\n }\n\t}", "public function email_check($str){ \n $con = array( \n 'returnType' => 'count', \n 'conditions' => array( \n 'email' => $str \n ) \n ); \n $checkEmail = $this->Admins->getRows($con); \n if($checkEmail > 0){ \n $this->form_validation->set_message('email_check', 'The given email already exists.'); \n return FALSE; \n }else{ \n return TRUE; \n } \n }", "public function email_check($str){\n\t\tif($this->user_model->exist_row_check('email', $str) > 0){\n $this->form_validation->set_error_delimiters('', '');\n\t\t\t$this->form_validation->set_message('email_check', 'Email telah digunakan');\n\t\t\treturn FALSE;\n\t\t}\n\t\telse{\n\t\t\treturn TRUE;\n\t\t}\n\t}", "public function userCheckMailLogin($email,$password)\n {\n $query=\"select user_id from bimp_user where email='\".$email.\"' and password='\".$password.\"'\";\n $user= Yii::app()->db->createCommand($query)->queryAll();\n $count=count($user);\n if($count==1){\n return true;\n }else{\n return false;\n }\n }", "public function check_email_existence() {\n\t\t$email = $_GET['email'];\n\t\t$checkExistEmail = $this->User->find('count', array('conditions'=>array('User.email' => $email)));\n\t\techo $checkExistEmail;\n\t\texit();\n\t}", "public function verify() {\r\n $stmp = $this->_db->prepare(\"SELECT `id`,`email` FROM `anope_db_NickCore` WHERE `display`= ? AND `pass` = ?;\");\r\n $stmp->execute(array($this->_username,$this->_password));\r\n \r\n if ($stmp->rowCount() == \"1\") {\r\n $row = $stmp->fetch(PDO::FETCH_ASSOC);\r\n $this->_id = $row['id'];\r\n $this->_email = $row['email'];\r\n return $this->_id;\r\n }\r\n else {\r\n return false;\r\n }\r\n }", "public function check_unique($username,$email){\n $usernameQuery = $this->db->get_where('user_ac',array('user_email'=>$username));\n $emailQuery = $this->db->get_where('user_ac',array('user_email'=>$email));\n \n $usernameCount=$usernameQuery->num_rows();\n $emailCount=$emailQuery->num_rows();\n \n if($emailCount>0 && $usernameCount>0)\n {\n return \"Both username and email exist\";\n }\n elseif($usernameCount>0)\n {\n return \"Username already exists\";\n }\n elseif ($emailCount>0) {\n return \"Email already exists\";\n }\n else {\n return true; \n }\n }", "public function verificarEmail($email){\n\n\t\t$id = $this->db->query(\"select id from users where email ='\".$email.\"'\");\n\t\tif($id->fetch()){\n\t\t\treturn true;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}", "function userEmailTaken($email){\r\n\t $email = mysql_real_escape_string($email);\r\n if(!get_magic_quotes_gpc()){\r\n $email = addslashes($email);\r\n }\r\n $q = \"SELECT email FROM users WHERE email = '$email'\";\r\n $result = mysql_query($q, $this->connection);\r\n return (mysql_numrows($result) > 0);\r\n }", "private function checkuseremail($email){\n\t\t$this->db->where('Email',$email);\n\t\t$this->db->select('Email,Status');\n\n\t\t$query=$this->db->get('tbl_userdetails');\n\t\tif($query->num_rows()==1){\n\t\t\treturn false;\n\t\t}\n\t\telse{\n\t\t\treturn true;\n\t\t}\n\n\t}", "function is_check_email($str){\n\t\t$this->db->where('user_email',$str);\n\t\t$rs\t=\t$this->db->get('reseller_store');\t\n\t\t$is_email_exits\t=\t$rs->num_rows();\n\t\tif($is_email_exits>0){\n\t\t\treturn true;\n\t\t}\n\t\telse{\n\t\t\t$user_email_exits_msg\t=\tLoginMessages(7);\n\t\t\t$this->form_validation->set_message('is_check_email', $user_email_exits_msg);\n\t\t\treturn false;\t\t\n\t\t}\n\t}", "public function checkemail() {\n\n if (env(\"NEW_ACCOUNTS\") == \"Disabled\" && env(\"GUEST_SIGNING\") == \"Disabled\") {\n\n $account = Database::table(\"users\")->where(\"email\", input(\"email\"))->first();\n if (!empty($account)){\n response()->json(array(\"exists\" => true));\n }else{\n response()->json(array(\"exists\" => false));\n }\n\n }\n\n }", "public function email_check($str){\n $con['returnType'] = 'count';\n $con['conditions'] = array('email'=>$str);\n $checkEmail = $this->user->getRows($con);\n if($checkEmail > 0){\n $this->form_validation->set_message('email_check', 'The given email already exists.');\n return FALSE;\n } else {\n return TRUE;\n }\n }", "function isEmailRegistered ($email) {\n $connect = $GLOBALS['connect'];\n \n $queryCheck = \"SELECT * FROM user WHERE email = '$email'\";\n \n $mysqlQueryCheck = mysqli_query ($connect,$queryCheck);\n \n if (!mysqli_affected_rows ($connect)){\n \n // Save to database\n \n return true;\n \n }\n else {\n \n echo false;\n \n }\n}", "function isEmailAndPasswordRegistered ($email,$password) {\n $connect = $GLOBALS['connect'];\n $password = md5 ($password);\n $queryCheck = \"SELECT * FROM user WHERE email = '$email' AND password = '$password'\";\n \n $mysqlQueryCheck = mysqli_query ($connect,$queryCheck);\n \n if (mysqli_affected_rows ($connect)){\n \n // Save to database\n \n return true;\n \n }\n else {\n \n echo false;\n \n }\n}", "private function checkUserExistence() {\n\t\t\t\t$query = \"select count(email) as count from register where email='$this->email'\";\n\t\t\t\t$resource = returnQueryResult($query);\n\t\t\t\t$result = mysql_fetch_assoc($resource);\n\t\t\t\tif($result['count'] > 0) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t}", "function isUserExisted($email) {\n $result = mysql_query(\"SELECT email from users WHERE email = '$email'\",$first);\n $no_of_rows = mysql_num_rows($result);\n if ($no_of_rows > 0) {\n // user existed \n return true;\n } else {\n // user not existed\n return false;\n }\n }", "public function validateData(){\n if(substr($this->user_id,0,5)!=$this->office_id){\n return false;\n }\n if(in_array($this->email,$this->getEmails())){\n return false;\n }\n return true; \n }", "public function check_account($email)\n {\n $this->db->where('email', $email);\n $query = $this->db->get('user')->row();\n\n //jika bernilai 1 maka user tidak ditemukan\n if (!$query) {\n return 1;\n }\n //jika bernilai 2 maka user tidak aktif\n if ($query->is_actived == 0) {\n return 2;\n }\n //jika bernilai 3 maka password salah\n if (!hash_verified($this->input->post('password'), $query->password)) {\n return 3;\n }\n\n return $query;\n }", "function login() {\n $sql = \"SELECT *\n FROM USUARIOS\n WHERE (\n\t\t\t\t (email = '$this->email')\n )\";\n\n $resultado = $this->mysqli->query( $sql );//hacemos la consulta en la base de datos\n if ( $resultado->num_rows == 0 ) {//miramos si el numero de filas es 0\n \t\t\t return 'El usuario no existe';\n\n \t\t} else {//si no es 0, el usuario existe\n \t\t\t$tupla = $resultado->fetch_array();//devolvemos la tupla\n\n \t\t\t if ( $tupla[ 'password' ] == $this->password ) {//si la contraseña es correcta entra en la página\n \t\t\t\t return true;\n\n \t\t\t } else {//en caso contrario no entra\n \t\t\t\t return 'La password para este usuario no es correcta';\n \t\t\t }\n \t }\n\t }", "private function check_email($email){\r\n $this->db->where('email', $email);\r\n $query = $this->db->get('users');\r\n if($query->num_rows() != 0){\r\n return false;\r\n }else{\r\n return true;\r\n }\r\n }", "public function checkEmail($email){\n $check = $this->f_usersmodel->getFirstRowWhere('users',array(\n 'email' => $email\n ));\n if(!empty($check)){\n $this->session->set_flashdata(\"mess\", \"Email đã tồn tại!\");\n return false;\n }\n else{\n return true;\n }\n }", "function email_exists($email)\n {\n global $connection;\n $query = \"select user_email from users where user_email = '{$email}'\";\n $result = mysqli_query($connection, $query);\n confirmQuery($result);\n if(mysqli_num_rows($result) > 0)\n {\n return true;\n }\n else\n {\n return false;\n }\n }", "public function verify_email($email){\n $query = $this->db->where('01_email', $email)\n ->get('register_01');\n if(sizeof($query->result_array())>0){\n return true;\n }\n else{\n return false;\n }\n }", "function kiemtra_email($email)\n {\n if($this->default_model->getInfoID($this->_table,array(\"Email\" => $email))!=TRUE){ // ko ton tai $email\n return TRUE;\n }\n else{\n $this->form_validation->set_message(\"kiemtra_email\",sprintf($this->lang->line('error_kiemtra_email'),$email));\n return FALSE;\n }\n }", "function validate_user($data)\r\n {\r\n $return = false;\r\n \r\n $conditions = array(\r\n 'User.email'=>$data['User']['login_email'],\r\n );\r\n //βρες αν υπάρχει ο χρήστης με το συγκεκριμένο username\r\n $user = $this->find('first', array('conditions'=>$conditions));\r\n\r\n //εάν υπάρχει\r\n if(!empty($user))\r\n {\r\n //έλενξε τον κωδικό\r\n if($user['User']['password'] == ($data['User']['login_password']))\r\n {\r\n $return=$user;\r\n }\r\n }\r\n return $return;\r\n }", "public function hasEmail(): bool;", "function check_app_email($connection, $school_key, $app_email){\n $query = \"SELECT email FROM applicants WHERE email = '$app_email' AND school_email = '$school_key'\";\n $result = $connection->query($query);\n $rows = $result->num_rows;\n if ($rows < 1) {\n return false;\n }\n else{\n return true;\n }\n}", "function checkemail() {\n\t\tConfigure::write('debug', 0);\n\t\t$this->autoRender = false;\n\t\t\n\t\t$email = $_REQUEST['data']['Member']['email'];\n\t\t\n\t\t$count = $this->Member->find('count', array(\n\t\t\t'conditions' => array(\n\t\t\t\t'email' => $email\n\t\t\t)\n\t\t));\n\t\t\n\t\t/*echo $count;\n\t\tdie;*/\n\t\tif ($count > 0) {\n\t\t\techo \"false\";\n\t\t} else {\n\t\t\techo \"true\";\n\t\t}\n\t}", "function checkRegistered(){\n $registered_user=User::find('all',array('conditions' => array('email=? and active=1',$this->email)));\n $registered_user_id='';\n if(!empty($registered_user)){\n foreach($registered_user as $user){\n $registered_user_id=$user->id;\n }\n $this->user_id=$registered_user_id;\n }\n return null;\n }", "function checkMAIL($account, $email)\n {\n while ($users = $account->fetch()) {\n if ($users['email'] == $email) {\n return true;\n }\n }\n return false;\n }", "function check_email_duplicate(){\n $this->SQL = \"SELECT email FROM users\"\n . \" WHERE email = '\" . $this->params['email'] . \"';\" ;\n \n \n $this->selecet_query();\n return $this->results;\n \n }", "function useremail_check($str) {\r\n $res = $this->auth_model->is_email_exists($str);\r\n if ($res <= 0) {\r\n $this->form_validation->set_message('useremail_check', lang_key('email_not_matched'));\r\n return FALSE;\r\n } else {\r\n return TRUE;\r\n }\r\n }", "function DB_email_existing_check($email){\n $connection = DB_get_connection();\n $queryCheck = \"SELECT * FROM `users` WHERE Email='$email'\";\n $result = mysqli_query($connection, $queryCheck);\n if(mysqli_num_rows($result) > 0){\n \n return true;\n \n }else{\n\n return false;\n\n }\n\n}", "public function check_email($str){\n\n\t\t$data = array(\n\t\t\t'id_usuario'=>$this->input->post('id_usuario'),\n\t\t\t'email' =>$str\n\t\t);\n\n\t\tif($this->Usuarios_model->check_email($data)){\n\t\t\t$this->form_validation->set_message('check_email', 'El email ya se encuentra registrado para otro usuario');\n\t\t\treturn false;\n\t\t}else{\n\t\t\treturn true;\n\t\t}\n\n\t}", "function _verify()\n {\n $e = \"\";\n if (isset($_POST['login'])) {\n $user = validate($_POST['gebruikersnaam']);\n $pass = validate($_POST['wachtwoord']);\n\n if (strlen($user) < 3 || strlen($user) > 20) {\n $e .= '<p class=\"text-danger mb-n1\">Voer een geldige gebruikersnaam in!</p>';\n }\n if (strlen($pass) < 3 || strlen($pass) > 20) {\n $e .= '<p class=\"text-danger mb-n1\">Voer een geldige wachtwoord in!</p>';\n } else if ($this->mismatch) {\n $e .= '<p class=\"text-danger mb-n1\">Gebruikersnaam en/of wachtwoord komen niet overeen!</p>';\n }\n return $e;\n }\n return $e;\n }", "function check_new_user($login, $passwd, $passwd2, $mail) {\n\t\t//~ validate user data\n\t\tif (empty($login) or empty($passwd) or empty($passwd2)) $error[]='Все поля обязательные для заполнения';\n\t\tif ($passwd != $passwd2) $error[]='Пароли не совпадают';\n\t\tif (strlen($login)<3 or strlen($login)>30) $error[]='Войти должны быть между 3 и 30 символов';\n\t\tif (strlen($passwd)<3 or strlen($passwd)>30) $error[]='Пароль должен быть от 3 до 30 символов';\n\t\t//~ validate email\n\t\tif (!filter_var($mail, FILTER_VALIDATE_EMAIL)) $error[]='Не правильный адрес электронной';\n\t\t//~ Checks the user with the same name in the database\n\t\tif (mysql::query(\"SELECT * FROM users WHERE login_user='\".$login.\"';\", 'num_row')!=0) $error[]='Пользователь с таким именем уже существует';\n\t\tif (mysql::query(\"SELECT * FROM users WHERE mail_user='\".$mail.\"';\", 'num_row')!=0) $error[]='Пользователь с таким E-mail уже существует';\n\n\t\t//~ return error array or TRUE\n\t\tif (isset($error)) {\n\t\t\tself::$error_arr=$error;\n\t\t\treturn false;\n\t\t} else {\n\t\t\treturn true;\n\t\t}\n\t}", "public function is_dispo_email($email)\n\t{\n\t\t$sql=\"SELECT ut_id FROM utilisateur WHERE ut_mail=?\";\n\t\t$tuple = $this->executerRequete($sql,array($email));\n\t\t$numRows = $tuple->rowCount();\n\t\tif($numRows>0)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "function _os2dagsorden_create_agenda_meeting_create_user_form_email_validate($element, $form, &$form_state) {\r\n $value = $element['#value'];\r\n if (!valid_email_address($value)) {\r\n form_error($element, t('Indtast en gyldig email adresse.'));\r\n }\r\n if (db_query(\"SELECT COUNT(*) FROM {users} WHERE mail = :mail;\", array(':mail' => $value))->fetchField()) {\r\n form_error($element, t('Der findes allerede en bruger med denne email.'));\r\n }\r\n}", "private function signupValid(){\n if ($this->checkMail($_POST['email'])){\n if ($this->checkUsername($_POST['username'])){\n if ($this->checkPass($_POST['pass']) && $this->checkPass($_POST['pass2'])){\n if($_POST['pass'] === $_POST['pass2']){\n if(!$this->checkUsernameExist()){\n if(!$this->checkMailExist()){\n return 'OK';\n }else{\n return \"Cette adresse e-mail est deja utilisée\";\n }\n }else{\n return \"Ce nom d'utilisateur est deja pris\";\n }\n }else{\n return \"Le mot de passe et la confirmation sont différents\";\n }\n }else{\n return \"Mot de passe invalide\";\n }\n }else{\n return \"Nom d'utilisateur invalide\";\n }\n }else{\n return 'Adresse e-mail invalide';\n } \n }", "function ToRegister($prenom, $nom, $username, $mail, $EncryptedPassword)\r\n{\r\n $connexion = getDB();\r\n $erreurinscription = \"RAS\";\r\n\r\n $requetelog = \"SELECT Username,Mail FROM users\";\r\n\r\n $prepare = $connexion->prepare($requetelog);\r\n $prepare->execute();\r\n $resultats1 = $prepare->fetchAll();\r\n\r\n\r\n foreach ($resultats1 as $useremail) {\r\n if (strtoupper($mail) == strtoupper($useremail['Mail'])) {\r\n $erreurinscription = \"email\";\r\n return $erreurinscription;\r\n }\r\n if ($username == $useremail['Username']) {\r\n $erreurinscription = \"user\";\r\n return $erreurinscription;\r\n }\r\n }\r\n\r\n //Insertion des données de l'user\r\n $requetelog2 = \"INSERT into users (Username,Password,Nom,Prenom,Mail,Admin) VALUES(?,?,?,?,?,0);\";\r\n $prepare = $connexion->prepare($requetelog2);\r\n $prepare->execute(array($username,$EncryptedPassword,$nom,$prenom,$mail));\r\n\r\n\r\n return $erreurinscription;\r\n\r\n}", "function checkEmail()\n {\n\t\t\t$email = $_POST['email'];\n\n\t\t\t// Check its existence (for example, execute a query from the database) ...\n\t\t\t$email_cek = $this->account_model->Check_TblUsers('email',$email);\n\t\t\t\n\t\t\tif($email_cek == 0)\n\t\t\t{\n\t\t\t\t$isAvailable = true;\n\t\t\t}else{\n\t\t\t\t$isAvailable = False;\n\t\t\t} \n\n\t\t\t// Finally, return a JSON\n\t\t\techo json_encode(array(\n\t\t\t\t'valid' => $isAvailable,\n\t\t\t));\n\t\t}", "function checkEmail($email){\n if($this->con === null)\n return false;\n \n $stmt = $this->con->prepare(\"SELECT EMAIL FROM `korisnik` WHERE EMAIL = ?\");\n if($stmt){\n $stmt->bind_param(\"s\", $email);\n \n if($stmt->execute()){\n $stmt->store_result(); //baferuje rez. Mora da se napise da bi mogao da se koristi property num_rows!\n if($stmt->num_rows!=0){\n // $this->response['error']=true;\n // $this->response['msg'] = \"Vec postoji nalog sa unetom email adresom.\";//sta je sad mysqli_error?????????????????\n return false; //neuspesno, postoji vec ta adresa\n }else\n return true; //uspesno\n }else{\n // $this->greska(\"Greska prilkom izvrsenja upita:\");\n return false;\n }\n }\n else{ //neuspesno, greska u upitu\n // $this->greska(\"Greska u sintaksi upita:\");\n return false;\n }\n }", "function verifica_email ($email)\r\n{\r\n\t$retorno = true;\r\n\r\n\t/* Aqui estaria el codigo para verificar \r\n\tla direccion de correo */\r\n\r\n\treturn $retorno;\r\n}", "function check_email_equal($email){\n// $this->db->where('activated', 1);\n $this->db->where('email', $email);\n $query = $this->db->get('tbl_users');\n if( $query->num_rows()){ // exist\n $result = $query->result();\n if( $result[0]->activated == 0 ) return 1;\n return 2;\n }\n return 0;\n }", "function email_check($email)\r\n\t{\r\n\t\tif ( $user = $this->generic_model->get_where_single_row('users', array('email' => $email))) \r\n\t\t{\r\n\t\t\t$this->form_validation->set_message('email_check', 'This %s is already registered.');\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\telse { return true; }\r\n\t}", "public function validaremailexiste($email){\n $conexion = $this->db->connect();\n $consulta =\"SELECT Email from persona where Email = :Email \";\n $stmt=$conexion->prepare($consulta);\n $stmt->bindParam(':Email',$email,PDO::PARAM_STR);\n $stmt->execute();\n $result = $stmt->fetch();\n return $result;\n $conexion = null;\n $stmt= null;\n $result = null; \n }", "function user_exist($uname)\n {\n $this->removeOldTemps();\n \n $res = $this->query(\"SELECT * FROM `{$this->userTable}` WHERE `{$this->tbFields1['email']}` = '\".$uname.\"'\");\n $res2 = $this->query(\"SELECT * FROM `{$this->userTempTable}` WHERE `{$this->tbTmpFields['email']}` = '\".$uname.\"'\"); \n \n if((!$res && !$res2) || (mysql_num_rows($res) == 0 && mysql_num_rows($res2) == 0)){ // no records \n return false;\n }\n return true; \n }", "public function validateEmail($userId,$email){\n $con=$GLOBALS['con'];\n $sql=\"SELECT 1 FROM user WHERE user_email='$email' AND user_id!='$userId'\";\n $results = $con->query($sql);\n if($results->num_rows>0)\n {\n return false;\n }\n else\n {\n return true;\n }\n }", "public function chkEditEmailDuplicate() {\r\n\r\n if ($this->input->post('user_email') == $this->input->post('user_email_old')) {\r\n echo 'true';\r\n } else {\r\n $table_to_pass = 'mst_users';\r\n $fields_to_pass = array('user_id', 'user_email');\r\n $condition_to_pass = array(\"user_email\" => $this->input->post('user_email'));\r\n $arr_login_data = $this->user_model->getUserInformation($table_to_pass, $fields_to_pass, $condition_to_pass, $order_by_to_pass = '', $limit_to_pass = '', $debug_to_pass = 0);\r\n if (count($arr_login_data)) {\r\n echo 'false';\r\n } else {\r\n echo 'true';\r\n }\r\n }\r\n }", "function verifyAdmin(){\n\n $email = $_POST[\"input_email\"];\n $pass = $_POST[\"input_pass\"];\n\n if (isset($email)) {\n $userFromDB = $this->model->getAdministrador($email);\n if (isset($userFromDB) && $userFromDB) {\n if (password_verify($pass, $userFromDB->password)) {\n session_start();\n $_SESSION[\"EMAIL\"] = $userFromDB->email; \n header(\"Location:\" . BASE_URL . \"home\");\n }else {\n $this->view->showLogin(\"contraseña incorrecta\");\n }\n }else {\n $this->view->showLogin(\"el usuario no existe\");\n }\n }\n }" ]
[ "0.72788227", "0.71798843", "0.7111299", "0.7093929", "0.70771784", "0.701301", "0.6975808", "0.69658124", "0.6926459", "0.6905618", "0.6900948", "0.6898198", "0.6865432", "0.68601996", "0.6852319", "0.6848695", "0.6834717", "0.68335", "0.682285", "0.68000185", "0.6791388", "0.6787509", "0.6776401", "0.6775888", "0.67748976", "0.6773916", "0.6764149", "0.6759592", "0.6755817", "0.6748662", "0.67455244", "0.6745475", "0.67345816", "0.6725305", "0.6719329", "0.6717474", "0.6709921", "0.6704847", "0.6697508", "0.66945934", "0.6690713", "0.667808", "0.6673831", "0.6671562", "0.6655266", "0.6650518", "0.66401136", "0.66399896", "0.66382045", "0.6618814", "0.6616319", "0.6610361", "0.66097456", "0.6607429", "0.6606545", "0.6604747", "0.6604474", "0.6599561", "0.6594904", "0.65920544", "0.65884584", "0.65862876", "0.65825576", "0.65714175", "0.65657073", "0.6564043", "0.65619767", "0.65579176", "0.6550898", "0.6549011", "0.65484774", "0.65425175", "0.6539704", "0.65332973", "0.6528053", "0.65276754", "0.6518653", "0.65170145", "0.65132564", "0.6511807", "0.6508566", "0.65073186", "0.65063196", "0.6499186", "0.64990455", "0.6498934", "0.64967424", "0.6496378", "0.6496215", "0.649083", "0.6490782", "0.6490213", "0.6487194", "0.6487168", "0.64839023", "0.64737135", "0.64652425", "0.64649314", "0.64622146", "0.6458126", "0.6452426" ]
0.0
-1
this up() migration is autogenerated, please modify it to your needs
public function up(Schema $schema) : void { $this->addSql('CREATE TABLE job (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(255) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB'); $this->addSql('CREATE TABLE level (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(255) NOT NULL, description VARCHAR(255) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB'); $this->addSql('CREATE TABLE logbook (id INT AUTO_INCREMENT NOT NULL, task VARCHAR(255) NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME DEFAULT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB'); $this->addSql('CREATE TABLE project (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(255) NOT NULL, resume LONGTEXT NOT NULL, max_participant INT NOT NULL, is_moderated TINYINT(1) NOT NULL, picture VARCHAR(255) DEFAULT NULL, owner_participes TINYINT(1) NOT NULL, link VARCHAR(255) DEFAULT NULL, created_at DATETIME NOT NULL, updated_at DATETIME DEFAULT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB'); $this->addSql('CREATE TABLE project_description (id INT AUTO_INCREMENT NOT NULL, purpose LONGTEXT NOT NULL, target LONGTEXT NOT NULL, learning_skill LONGTEXT NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB'); $this->addSql('CREATE TABLE realization (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(255) NOT NULL, description LONGTEXT DEFAULT NULL, screen VARCHAR(255) NOT NULL, screen2 VARCHAR(255) DEFAULT NULL, repo_link VARCHAR(255) DEFAULT NULL, website_link VARCHAR(255) DEFAULT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB'); $this->addSql('CREATE TABLE rhythm (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(255) NOT NULL, description VARCHAR(255) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB'); $this->addSql('CREATE TABLE role (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(255) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB'); $this->addSql('CREATE TABLE techno (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(255) NOT NULL, logo VARCHAR(255) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB'); $this->addSql('CREATE TABLE user (id INT AUTO_INCREMENT NOT NULL, username VARCHAR(255) NOT NULL, email VARCHAR(255) NOT NULL, avatar VARCHAR(255) DEFAULT NULL, password VARCHAR(255) NOT NULL, school VARCHAR(255) DEFAULT NULL, status TINYINT(1) NOT NULL, is_active TINYINT(1) NOT NULL, is_banned TINYINT(1) NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME DEFAULT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB'); $this->addSql('CREATE TABLE user_description (id INT AUTO_INCREMENT NOT NULL, journey VARCHAR(255) NOT NULL, purpose LONGTEXT NOT NULL, about_me LONGTEXT DEFAULT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract protected function up();", "abstract public function up();", "abstract public function up();", "abstract public function up();", "public function up()\n {\n $this->execute(\"\n ALTER TABLE `tcmn_communication` \n CHANGE `tcmn_pprs_id` `tcmn_pprs_id` SMALLINT(5) UNSIGNED NULL COMMENT 'person',\n CHANGE `tcmn_tmed_id` `tcmn_tmed_id` TINYINT(4) UNSIGNED NULL COMMENT 'medijs';\n \");\n }", "public function up()\n {\n // This migration was removed, but fails when uninstalling plugin\n }", "public function up()\n {\n $this->execute(\"\n\n ALTER TABLE `cucp_user_company_position` \n ADD COLUMN `cucp_role` CHAR(20) NULL AFTER `cucp_name`;\n\n \");\n }", "public function up()\n\t{\n\t\t$this->dbforge->add_column($this->table, $this->field);\n\t}", "public function migrateUp()\n {\n //$this->migrate('up');\n $this->artisan('migrate');\n }", "public function up()\n {\n dbexec('ALTER TABLE #__subscriptions_coupons\n ADD `created_on` datetime DEFAULT NULL AFTER `usage`,\n ADD `created_by` bigint(11) unsigned DEFAULT NULL AFTER `created_on`,\n ADD INDEX `created_by` (`created_by`),\n ADD `modified_on` datetime DEFAULT NULL AFTER `created_by`,\n ADD `modified_by` bigint(11) unsigned DEFAULT NULL AFTER `modified_on`,\n ADD INDEX `modified_by` (`modified_by`) \n ');\n \n dbexec('ALTER TABLE #__subscriptions_vats\n ADD `created_on` datetime DEFAULT NULL AFTER `data`,\n ADD `created_by` bigint(11) unsigned DEFAULT NULL AFTER `created_on`,\n ADD INDEX `created_by` (`created_by`),\n ADD `modified_on` datetime DEFAULT NULL AFTER `created_by`,\n ADD `modified_by` bigint(11) unsigned DEFAULT NULL AFTER `modified_on`,\n ADD INDEX `modified_by` (`modified_by`) \n ');\n }", "public function up()\n\t{\n\t\t$this->dbforge->modify_column($this->table, $this->field);\n\t}", "public function safeUp()\n {\n $this->createTable(\n $this->tableName,\n [\n 'id' => $this->primaryKey(),\n 'user_id' => $this->integer(). ' UNSIGNED NOT NULL' ,\n 'source' => $this->string()->notNull(),\n 'source_id' => $this->string()->notNull(),\n ],\n 'CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE=InnoDB'\n );\n\n $this->addForeignKey('fk_social_auth_user_id_to_user_id', $this->tableName, 'user_id', '{{%user}}', 'id', 'CASCADE', 'CASCADE');\n }", "public function up()\n {\n }", "public function up()\n {\n $user = $this->table('products', ['collation' => 'utf8mb4_persian_ci', 'engine' => 'InnoDB']);\n $user\n ->addColumn('name', STRING, [LIMIT => 20])\n ->addColumn('count', STRING, [LIMIT => 75])\n ->addColumn('code', STRING, [LIMIT => 100])\n ->addColumn('buy_price', STRING, [LIMIT => 30])\n ->addColumn('sell_price', STRING, [LIMIT => 30])\n ->addColumn('aed_price', STRING, [LIMIT => 50])\n ->addTimestamps()\n ->save();\n }", "public function up()\n {\n // Drop table 'table_name' if it exists\n $this->dbforge->drop_table('lecturer', true);\n\n // Table structure for table 'table_name'\n $this->dbforge->add_field(array(\n 'nip' => array(\n \t'type' => 'VARCHAR(16)',\n\t\t\t\t'null' => true,\n\t\t\t\t'unique' => true\n\t\t\t),\n 'nik' => array(\n \t'type' => 'VARCHAR(16)',\n\t\t\t\t'null' => false,\n\t\t\t\t'unique' => true\n\t\t\t),\n 'name' => array(\n 'type' => 'VARCHAR(24)',\n 'null' => false,\n ),\n\t\t\t'id_study_program' => array(\n\t\t\t\t'type' => 'VARCHAR(24)',\n\t\t\t\t'null' => false,\n\t\t\t)\n\n ));\n $this->dbforge->add_key('nik', true);\n $this->dbforge->create_table('lecturer');\n }", "public function up()\n\t{\n\t\t// are not setting the foreign key constraint, to allow the examination module to work without the intravitreal\n\t\t// injection module being installed\n\t\t$this->addColumn('et_ophciexamination_injectionmanagementcomplex', 'left_treatment_id', 'int(10) unsigned');\n\t\t$this->addColumn('et_ophciexamination_injectionmanagementcomplex', 'right_treatment_id', 'int(10) unsigned');\n\t}", "public function safeUp()\n {\n $this->createTable('tbl_hand_made_item',\n [\n \"id\" => \"int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY\",\n \"price\" => \"integer\",\n \"discount\" => \"integer\",\n \"preview_id\" => \"integer\",\n \"name\" => \"string\",\n \"description\" => \"text\",\n \"short_description\" => \"text\",\n \"slug\" => \"string\",\n ]\n );\n }", "public function preUp()\n {\n }", "public function up()\n\t{\n\t\t// create the purchase_order_details table\n\t\tSchema::create('purchase_order_details', function($table) {\n\t\t\t$table->engine = 'InnoDB';\n\t\t $table->increments('id');\t\t \n\t\t $table->integer('purchase_order_id')->unsigned();//->foreign()->references('id')->on('orders');\n\t\t $table->integer('product_id')->unsigned();//->foreign()->references('id')->on('products');\n\t\t $table->integer('quantity');\t\t \t \n\t\t $table->integer('created_by')->unsigned();//->foreign()->references('id')->on('users');\t\t \n\t\t $table->integer('updated_by')->unsigned();\n\t\t $table->timestamps();\t\t \n\t\t});\t\n\t}", "public function up()\n {\n if (!$this->isEdu()) {\n return;\n }\n \n $this->edu_up();\n }", "public function up()\n\t{\t\t\n\t\tDB::table('professor')->insert(array(\n\t\t\t'user_id'=>'2',\t\t\t\n\t\t\t'created_at'=>date('Y-m-d H:m:s'),\n\t\t\t'updated_at'=>date('Y-m-d H:m:s')\n\t\t));\t\t\n\n\t\tDB::table('professor')->insert(array(\n\t\t\t'user_id'=>'3',\t\t\t\n\t\t\t'created_at'=>date('Y-m-d H:m:s'),\n\t\t\t'updated_at'=>date('Y-m-d H:m:s')\n\t\t));\n\t\t//\n\t}", "public function up()\n {\n $table = $this->table('qobo_translations_translations');\n $table->renameColumn('object_foreign_key', 'foreign_key');\n $table->renameColumn('object_model', 'model');\n $table->renameColumn('object_field', 'field');\n $table->renameColumn('translation', 'content');\n\n if (!$table->hasColumn('locale')) {\n $table->addColumn('locale', 'char', [\n 'default' => null,\n 'limit' => 6,\n ]);\n }\n $table->update();\n\n $table = TableRegistry::getTableLocator()->get(\"Translations.Translations\");\n $entities = $table->find()->all();\n foreach($entities as $entity) {\n $entity->setDirty('locale', true);\n $table->save($entity);\n }\n }", "public function up()\n {\n $this->addForeignKey('tours_fk', 'tours', 'id', 'tour_to_hotel', 'tour_id');\n\n $this->addForeignKey('t2h_fkh', 'tour_to_hotel', 'hotel_id', 'hotels', 'id');\n $this->addForeignKey('t2h_fkt', 'tour_to_hotel', 'tour_id', 'tours', 'id');\n }", "public function safeUp()\r\n {\r\n $this->createTable('tbl_job_application', array(\r\n 'id' => 'pk',\r\n 'job_id' => 'integer NOT NULL',\r\n 'user_id' => 'integer NULL',\r\n 'name' => 'string NOT NULL',\r\n 'email' => 'text NOT NULL',\r\n 'phone' => 'text NOT NULL',\r\n 'resume_details' => 'text NOT NULL',\r\n 'create_date' => 'datetime NOT NULL',\r\n 'update_date' => 'datetime NULL',\r\n ));\r\n }", "public function up()\n {\n $fields = array(\n 'first_login' => array('type' => 'char', 'constraint' => '1', 'default' => '1'),\n );\n $this->dbforge->add_column('user', $fields);\n }", "public function safeUp() {\n\n $this->createTable('word', [\n 'word_id' => Schema::TYPE_PK,\n 'word_lang_id' => $this->integer(),\n 'word_name' => $this->string(500) . ' NOT NULL',\n 'word_detais' => $this->string(1000),\n ]);\n\n // Add foreign key\n $this->addForeignKey('fk_language_word_1', 'word',\n 'word_lang_id', 'language', 'lang_id', 'CASCADE', 'NO ACTION');\n \n // Create index of foreign key\n $this->createIndex('word_lang_id_idx', 'word', 'word_lang_id');\n }", "public function safeUp()\n {\n $this->alterColumn('item_keuangan', 'created_at', \"TIMESTAMP NOT NULL DEFAULT '2000-01-01 00:00:00'\");\n\n /* Tambah Field */\n $this->addColumn('item_keuangan', 'status', \"TINYINT(1) NOT NULL DEFAULT '1' COMMENT '0=tidak aktif; 1=aktif;' AFTER `jenis`\");\n }", "public function up()\n {\n $this->addForeignKey(\n 'fk_category_product_from_category',\n 'category_product',\n 'category_id',\n 'category',\n 'id',\n 'NO ACTION',\n 'NO ACTION'\n );\n\n $this->addForeignKey(\n 'fk_category_product_from_product',\n 'category_product',\n 'product_id',\n 'product',\n 'id',\n 'NO ACTION',\n 'NO ACTION'\n );\n }", "public function up()\n\t{\n\t\t$this->dropColumn('korzet','utca'); \n\t\t$this->addColumn('korzet','utca','string NOT NULL');\n\t}", "public function up()\n {\n Schema::table($this->table, function (Blueprint $table) {\n // $table->bigInteger('user_id')->default(0)->after('id'); // Example\n $table->dropColumn([\n // 'user_id', // Example\n ]);\n });\n }", "public function up()\n {\n // $this->fields()->create([]);\n // $this->streams()->create([]);\n // $this->assignments()->create([]);\n }", "public function up()\n {\n $table = $this->table('admins');\n $table->addColumn('name', 'string')\n ->addColumn('role', 'string')\n ->addColumn('username', 'string')\n ->addColumn('password', 'string')\n ->addColumn('created', 'datetime')\n ->addColumn('modified', 'datetime', ['null' => true])\n ->create();\n\n\n $data = [ \n [\n 'name' => 'Pedro Santos', \n 'username' => '[email protected]',\n 'password' => '101010',\n 'role' => 'Suporte',\n 'modified' => false\n ],\n ];\n\n $adminTable = TableRegistry::get('Admins');\n foreach ($data as $value) {\n $adminTable->save($adminTable->newEntity($value));\n }\n }", "public function up(): void\n {\n try {\n // SM: We NEVER delete this table.\n if ($this->db->tableExists('prom2_pages')) {\n return;\n }\n $this->db->ForeignKeyChecks(false);\n $statement=$this->db->prepare(\"CREATE TABLE `prom2_pages` (\n `cntPageID` int(10) unsigned NOT NULL AUTO_INCREMENT,\n `txtRelativeURL` varchar(255) NOT NULL COMMENT 'Relative URL',\n `txtTitle` varchar(70) NOT NULL COMMENT 'Title',\n `txtContent` text NOT NULL COMMENT 'Content',\n `blnRobots_DoNotAllow` bit(1) NOT NULL DEFAULT b'1',\n PRIMARY KEY (`cntPageID`),\n UNIQUE KEY `txtRelativeURL` (`txtRelativeURL`),\n KEY `txtTitle` (`txtTitle`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8;\");\n $statement->execute();\n $statement->close();\n $this->db->ForeignKeyChecks(true);\n } catch (\\mysqli_sql_exception $exception) {\n throw $exception;\n }\n }", "public function up()\n\t{\n\t\t// Add data to committee-members\n\t\tDB::table('committee_members')->insert(array(\n\t\t\t'name' => 'Brian O\\'Sullivan',\n\t\t\t'role' => 'Chairman',\n\t\t\t'telephone' => '087-1234567',\n\t\t\t'email' => '[email protected]'\n\t\t));\n\t\tDB::table('committee_members')->insert(array(\n\t\t\t'name' => 'Anthony Barker',\n\t\t\t'role' => 'PRO',\n\t\t\t'telephone' => '087-1234567',\n\t\t\t'email' => '[email protected]'\n\t\t));\t\t\n\t}", "public function up()\n {\n $this->query(\"UPDATE `subscription_types` SET `user_label` = `name` WHERE `user_label` = '' OR `user_label` IS NULL;\");\n\n $this->table('subscription_types')\n ->changeColumn('user_label', 'string', ['null' => false])\n ->update();\n }", "public function safeUp()\n\t{\n $sql = <<<SQL\n alter table r add R8 inte;\nSQL;\n\t\t//$this->execute($sql);\n $sql = <<<SQL\n ALTER TABLE r ADD constraint FK_r8_elgz1 FOREIGN KEY (r8) REFERENCES elgz (elgz1) ON DELETE SET DEFAULT ON UPDATE CASCADE;\nSQL;\n //$this->execute($sql);\n\t}", "public function up()\n\t{\n\t\techo $this->migration('up');\n\n\t\tci('o_role_model')->migration_add('Cookie Admin', 'Cookie Designer and Eater', $this->hash());\n\t\t\n\t\treturn true;\n\t}", "public function up()\n {\n\t\t$this->addColumn('{{%user}}', 'is_super', Schema::TYPE_SMALLINT . \"(1) NULL DEFAULT '0' AFTER `status`\");\n\t\t\n\t\t//Add new column for Option Group table\n\t\t$this->addColumn('{{%option_group}}', 'option_type', Schema::TYPE_STRING . \"(25) NULL DEFAULT 'text' AFTER `title`\");\n\t\t\n\t\t//Add new column for Order table\n\t\t$this->addColumn('{{%order}}', 'is_readed', Schema::TYPE_SMALLINT . \"(1) NULL DEFAULT '0' AFTER `shipment_method`\");\n }", "public function up()\n {\n $this->addColumn(\\backend\\models\\VodProfile::tableName(), 'language', \"char(5) not null default 'en-US'\");\n }", "public function up()\n {\n if (!Schema::hasTable($this->table))\n Schema::create($this->table, function (Blueprint $table)\n {\n $table->integer('parent_id')->unsigned()->index();\n $table->foreign('parent_id')->references('id')->on('organisations')->onDelete('restrict');\n\n $table->integer('child_id')->unsigned()->index();\n $table->foreign('child_id')->references('id')->on('organisations')->onDelete('restrict');\n\n $table->primary(['parent_id','child_id'],'organisation_relations_primary');\n\n $table->timestamps();\n $table->softDeletes();\n\n $table->engine = 'InnoDB';\n });\n }", "public function up(){\n $table = $this->table('users', array('id'=>false, 'primary_key'=>'id'));\n $table->addColumn('id', 'integer', array('identity'=>true, 'signed'=>false));\n $table->addColumn('email', 'string', array('limit'=>100));\n $table->save();\n }", "public function up() { return $this->run('up'); }", "public function safeUp()\n\t{\n\t\t$this->createTable(\n\t\t\t$this->tableName,\n\t\t\tarray(\n\t\t\t\t'l_id' => 'INT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT',\n\t\t\t\t'model_id' => 'INT UNSIGNED NOT NULL',\n\t\t\t\t'lang_id' => 'VARCHAR(5) NULL DEFAULT NULL',\n\n\t\t\t\t// examples:\n\t\t\t\t'l_label' => 'VARCHAR(200) NULL DEFAULT NULL',\n\t\t\t\t'l_announce' => 'TEXT NULL DEFAULT NULL',\n\t\t\t\t//'l_content' => 'TEXT NULL DEFAULT NULL',\n\n\t\t\t\t'INDEX key_model_id_lang_id (model_id, lang_id)',\n\t\t\t\t'INDEX key_model_id (model_id)',\n\t\t\t\t'INDEX key_lang_id (lang_id)',\n\n\t\t\t\t'CONSTRAINT fk_principles_lang_model_id_to_main_model_id FOREIGN KEY (model_id) REFERENCES ' . $this->relatedTableName . ' (id) ON DELETE CASCADE ON UPDATE CASCADE',\n\t\t\t\t'CONSTRAINT fk_principles_lang_lang_id_to_language_id FOREIGN KEY (lang_id) REFERENCES {{language}} (code) ON DELETE RESTRICT ON UPDATE CASCADE',\n\t\t\t),\n\t\t\t'ENGINE=InnoDB DEFAULT CHARACTER SET=utf8 COLLATE=utf8_unicode_ci'\n\t\t);\n\t}", "public function up()\n\t{\n\t\t// create the purchase_orders table\n\t\tSchema::create('purchase_orders', function($table) {\n\t\t\t$table->engine = 'InnoDB';\n\t\t $table->increments('id');\n\t\t $table->string('order_number', 128);\n\t\t $table->string('approved',50);\n\t\t $table->date('purchase_date');\t\t \t \t\t \t \n\t\t $table->integer('created_by')->unsigned();//->foreign()->references('id')->on('users');\t\t \t\t \n\t\t $table->integer('updated_by')->unsigned();\t\t \n\t\t $table->timestamps();\t\t \n\t\t});\t\n\t}", "public function safeUp()\n\t{\n\t\t$this->createTable(\n\t\t\t$this->tableName,\n\t\t\tarray(\n\t\t\t\t'id' => 'INT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT',\n\n\t\t\t\t'label' => 'VARCHAR(20) NULL DEFAULT NULL COMMENT \"language label\"',\n\t\t\t\t'code' => 'VARCHAR(5) NOT NULL COMMENT \"language code\"',\n\t\t\t\t'locale' => 'VARCHAR (5) NULL DEFAULT NULL',\n\n\t\t\t\t'visible' => 'TINYINT(1) UNSIGNED NOT NULL DEFAULT 1 COMMENT \"0 - not visible; 1 - visible\"',\n\t\t\t\t'published' => 'TINYINT(1) UNSIGNED NOT NULL DEFAULT 1 COMMENT \"0 - not published; 1 - published\"',\n\t\t\t\t'position' => 'INT UNSIGNED NOT NULL DEFAULT 0 COMMENT \"order by position DESC\"',\n\t\t\t\t'created' => 'INT UNSIGNED NOT NULL COMMENT \"unix timestamp - creation time\"',\n\t\t\t\t'modified' => 'INT UNSIGNED NOT NULL COMMENT \"unix timestamp - last entity modified time\"',\n\n\t\t\t\t'UNIQUE key_unique_code (code)',\n\t\t\t),\n\t\t\t'ENGINE=InnoDB DEFAULT CHARACTER SET=utf8 COLLATE=utf8_unicode_ci'\n\t\t);\n\n\t\t$this->insert('{{language}}', array(\n\t\t\t'label' => 'рус',\n\t\t\t'code' => 'ru',\n\t\t\t'locale' => 'ru',\n\t\t));\n\t}", "public function up()\n {\n $this->execute('Update goods SET price_rub = price WHERE currency_id = 1');\n }", "public function up()\n\t{\n $this->dropColumn('calculo','fecha');\n\n //add column fecha in producto\n $this->addColumn('producto','fecha','date');\n\t}", "public function up(){\n Schema::table('entries', function (Blueprint $table) {\n $table->renameColumn('value', 'entry_value');\n });\n }", "public function safeUp() {\n\t$this->createTable('post', array(\n 'id' =>\"int(11) NOT NULL AUTO_INCREMENT\",\n 'created_on' =>\"int(11) NOT NULL\",\n 'title' =>\"varchar(255) NOT NULL\",\n 'context' =>\"text NOT NULL\",\n \"PRIMARY KEY (`id`)\"\n\t),'ENGINE=InnoDB DEFAULT CHARSET=utf8');\n }", "public function getUpSQL()\n {\n return array (\n 'default' => '\n# This is a fix for InnoDB in MySQL >= 4.1.x\n# It \"suspends judgement\" for fkey relationships until are tables are set.\nSET FOREIGN_KEY_CHECKS = 0;\n\nALTER TABLE `department_summary`\n\n CHANGE `twitter_account` `positive_twitter_account` TEXT NOT NULL,\n\n ADD `negative_twitter_account` TEXT NOT NULL AFTER `positive_twitter_account`;\n\nALTER TABLE `tweets`\n\n CHANGE `positive_twitter_account` `twitter_account` TEXT NOT NULL,\n\n DROP `negative_twitter_account`;\n\n# This restores the fkey checks, after having unset them earlier\nSET FOREIGN_KEY_CHECKS = 1;\n',\n);\n }", "public function up()\n {\n $this->db->createCommand($this->DROP_SQL)->execute();\n $this->db->createCommand($this->CREATE_SQL)->execute();\n }", "public function up()\n {\n $this->db->createCommand($this->DROP_SQL)->execute();\n $this->db->createCommand($this->CREATE_SQL)->execute();\n }", "public function safeUp()\n {\n $this->addColumn('{{%organization}}', 'legal_entity', $this->string()->null());\n $this->addColumn('{{%organization}}', 'contact_name', $this->string()->null());\n $this->addColumn('{{%organization}}', 'about', $this->text()->null());\n $this->addColumn('{{%organization}}', 'picture', $this->string()->null());\n }", "public function up()\n {\n $this->table('agent_order_consignee_address')\n ->addColumn(Column::string('order_number')->setUnique()->setComment('订单编号'))\n \t\t->addColumn(Column::integer('agent_id')->setComment('代理商ID'))\n\t ->addColumn(Column::integer('create_time')->setDefault(1)->setComment('创建时间'))\n\t \n\t ->addColumn(Column::string('consignee_name')->setComment('收货人姓名'))\n\t ->addColumn(Column::string('consignee_phone')->setComment('收货人电话'))\n\t ->addColumn(Column::string('province')->setComment('省份'))\n\t ->addColumn(Column::string('city')->setComment('城市'))\n\t ->addColumn(Column::string('area')->setComment('地区'))\n\t ->addColumn(Column::string('address')->setComment('收货人详细地址'))\n ->create(); \n }", "public function up()\n\t{\n\t\t$this->createTable(\n\t\t\t$this->tableName,\n\t\t\tarray(\n\t\t\t\t'l_id' => 'INT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT',\n\t\t\t\t'model_id' => 'INT UNSIGNED NOT NULL',\n\t\t\t\t'lang_id' => 'VARCHAR(5) NULL DEFAULT NULL',\n\n\t\t\t\t'l_value' => 'TEXT NULL DEFAULT NULL',\n\n\t\t\t\t'INDEX key_model_id_lang_id (model_id, lang_id)',\n\t\t\t\t'INDEX key_model_id (model_id)',\n\t\t\t\t'INDEX key_lang_id (lang_id)',\n\n\t\t\t\t'CONSTRAINT fk_configuration_lang_model_id_to_main_model_id FOREIGN KEY (model_id) REFERENCES ' . $this->relatedTableName . ' (id) ON DELETE CASCADE ON UPDATE CASCADE',\n\t\t\t\t'CONSTRAINT fk_configuration_lang_lang_id_to_language_id FOREIGN KEY (lang_id) REFERENCES {{language}} (code) ON DELETE RESTRICT ON UPDATE CASCADE',\n\t\t\t),\n\t\t\t'ENGINE=InnoDB DEFAULT CHARACTER SET=utf8 COLLATE=utf8_unicode_ci'\n\t\t);\n\t}", "public function safeUp()\r\n {\r\n $this->up();\r\n }", "public function up(){\n // $table->table('kelas')\n // ->addColumn('Id', 'int', \"11\", false, null, true, true)\n // ->addColumn('NamaKelas', 'varchar', \"100\")\n // ->create();\n }", "public function safeUp()\n\t{\n\t\t$this->createTable('pesquisa', array(\n\t\t\t'id' => 'serial NOT NULL primary key',\n\t\t\t'nome' => 'varchar',\n\t\t));\n\t}", "public function safeUp()\n\t{\n\t\t$this->up();\n\t}", "public function safeUp()\n {\n $this->up();\n }", "public function safeUp()\n {\n $this->up();\n }", "public function up(){\n // $table->table('kelassiswa')\n // ->addColumn('Id', 'int', \"11\", false, null, true, true)\n // ->addColumn('Kelas_Id', 'int', \"11\")\n // ->addColumn('Peserta_Id', 'int', \"11\")\n // ->addForeignKey('Peserta_Id', 'peserta', \"Id\", \"CASCADE\")\n // ->addForeignKey('Kelas_Id', 'kelas', \"Id\")\n // ->create();\n\n }", "public function up()\n\t{\n\t\tSchema::table('project_sections', function($t){\n\t\t\t$t->integer('created_by_project_id')->nullable()->unsigned();\n\t\t\t$t->boolean('public')->default(0);\n\n $t->foreign('created_by_project_id')->references('id')->on('projects')->on_delete('SET NULL');\n\t\t});\n\t}", "public function up(){\n\t\tglobal $wpdb;\n\n\t\t$wpdb->query('ALTER TABLE `btm_tasks` ADD COLUMN `last_run` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP AFTER `date_created`;');\n\t}", "public function up()\n {\n Schema::table('user_permissions', function ($table) {\n $table->dropColumn('solder_create');\n });\n\n Schema::table('user_permissions', function ($table) {\n $table->dropColumn('solder_mods');\n });\n\n Schema::table('user_permissions', function ($table) {\n $table->dropColumn('solder_modpacks');\n });\n\n Schema::table('user_permissions', function ($table) {\n $table->boolean('solder_keys')->default(0);\n $table->boolean('solder_clients')->default(0);\n $table->boolean('modpacks_create')->default(0);\n $table->boolean('modpacks_manage')->default(0);\n $table->boolean('modpacks_delete')->default(0);\n });\n }", "public function up()\n {\n Schema::dropIfExists('db_question_new.t_answer_type');\n Schema::create('db_question_new.t_answer_type', function (Blueprint $table){\n $table->increments('id');\n t_field($table->integer('answer_type_no'),\"答案序号\");\n t_field($table->string('name'),\"步骤名字\");\n t_field($table->integer('subject'),\"科目id\");\n t_field($table->integer('open_flag')->default(1),\"开启与否\");\n }); \n }", "public function up()\n\t{\n\t\t$sql = \"create table tbl_rights\n\t\t\t\t(\n\t\t\t\t\titemname varchar(64) not null,\n\t\t\t\t\ttype integer not null,\n\t\t\t\t\tweight integer not null,\n\t\t\t\t\tprimary key (itemname),\n\t\t\t\t\tforeign key (itemname) references tbl_auth_item (name) on delete cascade on update cascade\n\t\t\t\t)\";\n\t\t $this->execute($sql);\n\t\t \n\t}", "public function safeUp()\n\t{\n\t\t$this->createTable( 'tbl_auth_item', array(\n\t\t \"name\" => \"varchar(64) not null\",\n\t\t \"type\" => \"integer not null\",\n\t\t \"description\" => \"text\",\n\t\t \"bizrule\" => \"text\",\n\t\t \"data\" => \"text\",\n\t\t \"primary key (name)\",\n\t\t));\n\n\t\t$this->createTable(\"tbl_auth_item_child\", array(\n \t\t\"parent\" => \" varchar(64) not null\",\n\t\t\"child\" => \" varchar(64) not null\",\n \t\t\"primary key (parent,child)\",\n\t\t));\n\n\t\t$this->createTable(\"tbl_auth_assignment\",array(\n \t\t\"itemname\" => \"varchar(64) not null\",\n \t\t\"userid\" => \"varchar(64) not null\",\n \t\t\"bizrule\" => \"text\",\n \t\t\"data\"\t => \"text\",\n \t\t\"primary key (itemname,userid)\",\n\t\t));\n\n\t\t$this->addForeignKey('fk_auth_item_child_parent','tbl_auth_item_child','parent','tbl_auth_item','name','CASCADE','CASCADE');\n\t\t$this->addForeignKey('fk_auth_assignment_itemname','tbl_auth_assignment','itemname','tbl_auth_item','name');\n\t\t$this->addForeignKey('fk_auth_assignment_userid','tbl_auth_assignment','userid','tbl_user','id');\n\t}", "public function up()\n {\n // add foreign key for table `articles`\n $this->addForeignKey(\n 'fk-comments-article_id',\n 'comments',\n 'article_id',\n 'article',\n 'id'\n );\n }", "public function safeUp()\r\n\t{\r\n\t\t$this->up();\r\n\t}", "public function up()\n {\n\n $tableOptions = null;\n if ($this->db->driverName === 'mysql') {\n $tableOptions = 'CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE=InnoDB';\n }\n\n $this->createTable($this->createTableName, [\n 'id' => $this->primaryKey(),\n 'name' => $this->string()->notNull(),\n 'type' => $this->integer(1)->notNull(),\n 'location' => $this->text()->defaultValue(null),\n 'description' => $this->text()->defaultValue(null),\n 'created_by' => $this->integer()->notNull(),\n 'start_at' => $this->integer()->defaultValue(null),\n 'active' => $this->boolean()->defaultValue(true),\n\n ],$tableOptions);\n\n\n $this->addColumn($this->updateTableNameHoliday, $this->addColumnOne, $this->integer()->notNull()->after('name'));\n $this->addColumn($this->updateTableNameHoliday, $this->addColumnTwo, $this->integer()->notNull()->after($this->addColumnOne));\n $this->addColumn($this->updateTableNameHolidayConfig, $this->addColumnOne, $this->integer()->notNull()->after('name'));\n $this->addColumn($this->updateTableNameHolidayConfig, $this->addColumnTwo, $this->integer()->notNull()->after($this->addColumnOne));\n\n $moduleInvite = Module::findOne(['name' => 'Actioncalendar', 'slug' => 'actioncalendar']);\n if(empty($moduleInvite)) {\n $this->batchInsert('{{%module}}', ['parent_id', 'name', 'slug', 'visible', 'sorting'], [\n [null, 'Actioncalendar', 'actioncalendar', 1, 22],\n ]);\n }\n\n }", "public function up()\n\t{\n\t\tSchema::table('user_hasil', function($table)\n\t\t{\n\t\t\t$table->create();\n\t\t\t$table->integer('user_id');\n\t\t\t$table->string('grade', 2);\n\t\t\t$table->decimal('hasil', 5, 2);\n\t\t\t$table->year('tahun');\n\t\t\t$table->timestamps();\n\n\t\t\t$table->foreign('user_id')->references('id')->on('users')->on_update('cascade');\n\t\t});\n\t}", "public function safeUp()\r\n {\r\n $tableOptions = null;\r\n if ($this->db->driverName === 'mysql') {\r\n $tableOptions = 'CHARACTER SET utf8 COLLATE utf8_general_ci ENGINE=InnoDB';\r\n }\r\n\r\n $this->createTable('{{%contact_msg}}', [\r\n 'id' => Schema::TYPE_PK,\r\n 'from_email' => Schema::TYPE_STRING . \"(320) NOT NULL\",\r\n 'to_email' => Schema::TYPE_STRING . \"(320) NULL\",\r\n 'subject' => Schema::TYPE_STRING . \"(300) NOT NULL\",\r\n 'text' => Schema::TYPE_TEXT,\r\n 'viewed' => Schema::TYPE_BOOLEAN . \"(1) NOT NULL DEFAULT '0'\",\r\n 'created_at' => Schema::TYPE_TIMESTAMP . \" NULL\",\r\n 'updated_at' => Schema::TYPE_TIMESTAMP . \" NULL\",\r\n ], $tableOptions);\r\n }", "public function up()\n {\n $this->alterColumn('{{%hystorical_data}}', 'project_id', $this->integer());\n\n $this->dropForeignKey('fk-hystorical_data-project_id',\n '{{%hystorical_data}}');\n\n $this->addForeignKey(\n 'fk-hystorical_data-project_id',\n '{{%hystorical_data}}',\n 'project_id',\n '{{%projects}}',\n 'id',\n 'SET NULL'\n );\n }", "public function up()\n\t{\n\t\tSchema::create('flows_steps', function($table) {\n\n\t\t\t$table->engine = 'InnoDB';\n\n\t\t $table->increments('stepid');\n\t\t $table->integer('flowid');\n\t\t $table->string('step', 100);\n\t\t $table->integer('roleid');\n\t\t $table->integer('parentid');\n\t\t $table->integer('state');\n\t\t $table->integer('page');\n\t\t $table->integer('condition2');\n\t\t $table->timestamps();\n\n\t\t});\n\t}", "public function safeUp()\n {\n $this->createTable('site_phrase', array(\n 'site_id' => self::MYSQL_TYPE_UINT,\n 'phrase' => 'string NOT NULL',\n 'hash' => 'varchar(32)',\n 'price' => 'decimal(10,2) NOT NULL',\n 'active' => self::MYSQL_TYPE_BOOLEAN,\n ));\n\n $this->addForeignKey('site_phrase_site_id', 'site_phrase', 'site_id', 'site', 'id', 'CASCADE', 'RESTRICT');\n }", "public function up()\n\t{\n\t\tSchema::table('devices', function($table)\n\t\t{\n\t\t\t$table->string('uuid')->unique;\n\t\t\t$table->drop_column('uid');\n\t\t});\n\t}", "public function up()\n\t{\n\t\t$this->execute(\"\n INSERT INTO `authitem` VALUES('D2finv.FiitInvoiceItem.*', 0, 'Edit invoice items', NULL, 'N;');\n INSERT INTO `authitem` VALUES('D2finv.FiitInvoiceItem.View', 0, 'View invoice items', NULL, 'N;');\n INSERT INTO `authitem` VALUES('D2finv.FinvInvoice.*', 0, 'Edit invoice records', NULL, 'N;');\n INSERT INTO `authitem` VALUES('D2finv.FinvInvoice.View', 0, 'View invoice records', NULL, 'N;');\n \n INSERT INTO `authitem` VALUES('InvoiceEdit', 2, 'Edit invoice records', NULL, 'N;');\n INSERT INTO `authitem` VALUES('InvoiceView', 2, 'View invoice records', NULL, 'N;');\n \n INSERT INTO `authitemchild` VALUES('InvoiceEdit', 'D2finv.FiitInvoiceItem.*');\n INSERT INTO `authitemchild` VALUES('InvoiceView', 'D2finv.FiitInvoiceItem.View');\n INSERT INTO `authitemchild` VALUES('InvoiceEdit', 'D2finv.FinvInvoice.*');\n INSERT INTO `authitemchild` VALUES('InvoiceView', 'D2finv.FinvInvoice.View');\n \");\n\t}", "public function up()\n {\n $this->createTable('post',[\n 'id' => $this->primaryKey(),\n 'author_id' => $this->integer(),\n 'title' => $this->string(255)->notNull()->unique(),\n 'content' => $this->text(),\n 'published_at' => $this->dateTime()->defaultExpression('CURRENT_TIMESTAMP'),\n 'updated_at' => $this->dateTime()->defaultExpression('CURRENT_TIMESTAMP'),\n 'status' => \"ENUM('draft','published')\",\n 'image' => $this->string(255)\n ]); \n\n $this->addForeignKey(\n 'fk_post_author_id',\n 'post',\n 'author_id',\n 'user',\n 'id',\n 'CASCADE',\n 'NO ACTION'\n );\n }", "public function up()\n\t{\n// $import->import();\n\t}", "public function up()\n\t{\n\t\tif(Yii::app()->db->getSchema()->getTable(\"{{rights}}\")){\n\t\t\t$this->dropTable(\"authItem\");\n\t\t}\n\n\t\t$this->createTable(\"{{rights}}\", array(\n\t\t\t\"itemname\" => \"varchar(64) CHARACTER SET UTF8 NOT NULL\",\n\t\t\t\"type\"\t => \"int not null\",\n\t\t\t\"weight\" => \"int not null\",\n\t\t\t\"PRIMARY KEY (itemname)\"\n\t\t\t));\n\t}", "public function up() {\r\n\t\t// UP\r\n\t\t$column = parent::Column();\r\n\t\t$column->setName('id')\r\n\t\t\t\t->setType('biginteger')\r\n\t\t\t\t->setIdentity(true);\r\n\t\tif (!$this->hasTable('propertystorage')) {\r\n\t\t\t$this->table('propertystorage', [\r\n\t\t\t\t\t\t'id' => false,\r\n\t\t\t\t\t\t'primary_key' => 'id'\r\n\t\t\t\t\t])->addColumn($column)\r\n\t\t\t\t\t->addColumn('path', 'text', ['limit' => 1024])\r\n\t\t\t\t\t->addColumn('name', 'text', ['limit' => 100])\r\n\t\t\t\t\t->addColumn('valuetype', 'integer',[])\r\n\t\t\t\t\t->addColumn('value', 'text', [])\r\n\t\t\t\t\t->create();\r\n\t\t}\r\n\t}", "public function up()\n {\n $perfis = [\n [\n 'id' => 1,\n 'perfil' => 'Genérico',\n 'ativo' => 1\n ]\n ];\n\n $this->insert('singular_perfil', $perfis);\n\n $usuarios = [\n [\n 'id' => 1,\n 'nome' => 'Singular Framework',\n 'login' => 'singular',\n 'senha' => 'singular',\n 'perfil_id' => 1\n ]\n ];\n\n $this->insert('singular_usuario', $usuarios);\n }", "public function safeUp()\n {\n $this->createTable('user', array(\n 'name' => 'string',\n 'username' => 'string NOT NULL',\n 'password' => 'VARCHAR(32) NOT NULL',\n 'salt' => 'VARCHAR(32) NOT NULL',\n 'role' => \"ENUM('partner', 'admin')\"\n ));\n }", "public function up()\n\t{\n\t\t$demoUser = new User();\n\t\t$demoUser->username = \"demo\";\n\t\t$demoUser->email = '[email protected]';\n\t\t$demoUser->password = 'password';\n\t\t$demoUser->create_time = new CDbExpression('NOW()');\n\t\t$demoUser->update_time = new CDbExpression('NOW()');\n\n\t\t$demoUser->save();\n\n\t\t$adminUser = new User();\n\t\t$adminUser->username = \"admin\";\n\t\t$adminUser->email = '[email protected]';\n\t\t$adminUser->password = 'password';\n\t\t$adminUser->create_time = new CDbExpression('NOW()');\n\t\t$adminUser->update_time = new CDbExpression('NOW()');\n\n\t\t$adminUser->save();\n\n\t}", "public function safeUp()\n {\n $tables = Yii::$app->db->schema->getTableNames();\n $dbType = $this->db->driverName;\n $tableOptions_mysql = \"CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE=InnoDB\";\n\n /* MYSQL */\n if (!in_array('question_tag', $tables)) {\n if ($dbType == \"mysql\") {\n $this->createTable('{{%question_tag}}', [\n 'question_id' => 'INT(11) NOT NULL',\n 'tag_id' => 'INT(11) NOT NULL',\n ], $tableOptions_mysql);\n }\n }\n }", "public function safeUp()\n\t{\n\t\t$this->createTable(\n\t\t\t'like',\n\t\t\tarray(\n\t\t\t\t'id'=>'int(11) UNSIGNED NOT NULL AUTO_INCREMENT',\n\t\t\t\t'user_id' => 'int(11) UNSIGNED NOT NULL',\n\t\t\t\t'post_id' => 'int (11) NOT NULL',\n\t\t\t\t'status' => 'TINYINT(1)',\n\t\t\t\t'created_at' => 'int(11)',\n\t\t\t\t'updated_at' => 'int(11)',\n\t\t\t\t'PRIMARY KEY (id)',\n\t\t\t\t),\n\t\t\t'ENGINE=InnoDB'\n\n\t\t\t);\n\t}", "public function up()\n\t{\n\t\tSchema::table('entries', function($table) {\n $table->create();\n $table->increments('id');\n $table->string('title', 128);\n $table->string('body');\n $table->integer('users_id')->unsigned();\n $table->index('users_id');\n $table->integer('last_edited_by');\n $table->foreign('users_id')->references('id')->on('users')->on_delete('no action');\n $table->timestamps();\n });\n\t}", "public function up()\n {\n $this->alterColumn(\\app\\models\\EmailImportLead::tableName(), 'password', $this->string()->null());\n $this->alterColumn(\\app\\models\\EmailImportLead::tableName(), 'status', $this->integer()->null());\n }", "public function up()\n {\n\t\t$tableOptions = null;\n if ($this->db->driverName === 'mysql') {\n $tableOptions = 'CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE=InnoDB';\n }\n\t\t\n\t\t$TABLE_NAME = 'HaberDeneme12';\n $this->createTable($TABLE_NAME, [\n 'HaberID' => $this->integer(10)->notNull(),\n 'Kategori' => $this->string(12)->notNull(),\n 'Baslik' => $this->string(128)->notNull(),\n 'Ozet' => $this->text()->notNull(),\n 'Detay' => $this->text()->notNull(),\n 'Resim' => $this->text()->notNull(),\n 'EklenmeTarihi' => $this->date(),\n 'GuncellenmeTarihi' => $this->date()\n ], $tableOptions);\n\t\t\n\t\t\n\t\t$TABLE_NAME = 'HaberKategoriDeneme12';\n\t\t $this->createTable($TABLE_NAME, [\n 'KategoriID' => $this->integer(10)->notNull(),\n 'Kategori' => $this->string(20)->notNull()\n ], $tableOptions);\n\t\t\n }", "public function up()\n\t{\n\t\t$fields = array(\n \"`piezas` DECIMAL(3,2) DEFAULT NULL\",\n\n\t\t);\n\t\t$this->dbforge->add_column('rel_monto_servicios', $fields);\n\n\t}", "public function up()\n {\n $this->insert('key_value', [\n 'key' => 'day_feed_count_dnr',\n 'value' => '15',\n ]);\n }", "public function up()\n {\n // 创建操作记录表\n $tables = $this->table('history');\n // 用户动作\n $tables->addColumn('action', 'string', ['limit' => 20])\n ->addColumn('ip', 'string', ['limit' => 129])\n // 建立用户\n ->addColumn('user_id', 'integer')\n // 登录时间\n ->addColumn('operation_time', 'datetime')\n // 操作详情\n ->addColumn('desc', 'string',['limit'=>500,'null' => true])\n ->create();\n }", "public function up()\n {\n $table = $this->table('vehicle_model_suggestions');\n\n if (!$table->exists()) {\n $table\n ->addPrimaryKey('id')\n ->addColumn('vehicle_id', 'integer', ['null' => false])\n ->addColumn('vehicle_model_id', 'integer', ['null' => false])\n ->addColumn('suggestion', 'text')\n ->addTimestamps()\n ->addColumn('deleted_at', 'datetime')\n ->create();\n }\n }", "public function safeUp()\n {\n $this->insert('category',['name'=>'Uncategorized', 'slug'=>'uncategorized', 'description'=>'Default Category', 'created_at'=> new Expression('NOW()'),\n 'updated_at'=> new Expression('NOW()')]);\n $this->insert('user',['username'=>'Administrator', 'password_hash'=>'$2y$13$6yoLjvVORp/7EO1u8phYTuWYzhMSM4LVVsebZgcqEKj/EQLvo5nJK',\n 'email'=>'[email protected]',\n 'created_at'=> new Expression('NOW()'),\n 'updated_at'=> new Expression('NOW()'),\n 'status'=>1\n ]\n );\n }", "public function safeUp()\n {\n $this->createTable($this->tableName, [\n 'post_id' => $this->bigInteger()->notNull(),\n 'category_id' => $this->bigInteger()->notNull(),\n ]);\n\n $this->addForeignKey('post_category_post_id_fk', $this->tableName, 'post_id', '{{%post}}', 'id', 'CASCADE', 'CASCADE');\n $this->addForeignKey('post_category_category_id_fk', $this->tableName, 'category_id', '{{%category}}', 'id', 'CASCADE', 'CASCADE');\n }", "public function up()\n {\n Schema::table('categories', function(Blueprint $table)\n {\n $table->integer('parent_id', false, true)->nullable()->after('cat_order');\n });\n }", "public function safeUp()\n\t{\n\t\t$this->createTable(\n\t\t\t$this->tableName,\n\t\t\tarray(\n\t\t\t\t'id' => 'INT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT',\n\n\t\t\t\t'application_id' => 'VARCHAR(32) NOT NULL DEFAULT \"\" COMMENT \"Ид приложения\"',\n\n\t\t\t\t'message' => 'TEXT NOT NULL DEFAULT \"\" COMMENT \"Оригинал\"',\n\t\t\t\t'category' => 'VARCHAR(32) NOT NULL DEFAULT \"\" COMMENT \"Категория\"',\n\t\t\t\t'language' => 'VARCHAR(5) NOT NULL DEFAULT \"\" COMMENT \"Язык\"',\n\t\t\t),\n\t\t\t'ENGINE=InnoDB DEFAULT CHARACTER SET=utf8 COLLATE=utf8_unicode_ci'\n\t\t);\n\t}", "public function up()\n\t{\n\t\t//\n\t\tSchema::create('options',function($table){\n\t\t\t$table->increments('id');\n\t\t\t$table->boolean('activate_pn');\n\t\t\t$table->string('basic_name');\n\t\t\t$table->string('basic_pass');\n\t\t\t$table->timestamps();\n\t\t});\n\n\t\t$o = new Option;\n\t\t$o->activate_pn = 0;\n\t\t$o->save();\n\t}", "public function up() {\n\t\t$this->dbforge->add_field(array(\n\t\t\t'id' => array(\n\t\t\t\t'type' => 'INT',\n\t\t\t\t'constraint' => '10',\n\t\t\t\t'unsigned' => TRUE,\n\t\t\t\t'auto_increment' => TRUE\n\t\t\t),\n\t\t\t'name' => array(\n\t\t\t\t'type' => 'VARCHAR',\n\t\t\t\t'constraint' => '100',\n\t\t\t),\n\t\t\t'path' => array(\n\t\t\t\t'type' => 'VARCHAR',\n\t\t\t\t'constraint' => '100',\n\t\t\t)\n\t\t));\n\t\t$this->dbforge->add_key('id', TRUE);\n\t\t$this->dbforge->add_key('path');\n\t\t$this->dbforge->create_table('categories');\n\n\t\t// Table structure for table 'event_categories'\n\t\t$this->dbforge->add_field(array(\n\t\t\t'event_id' => array(\n\t\t\t\t'type' => 'INT',\n\t\t\t\t'constraint' => '10',\n\t\t\t),\n\t\t\t'category_id' => array(\n\t\t\t\t'type' => 'INT',\n\t\t\t\t'constraint' => '10',\n\t\t\t\t'unsigned' => TRUE,\n\t\t\t),\n\t\t));\n\t\t$this->dbforge->add_key('event_id', TRUE);\n\t\t$this->dbforge->add_key('category_id', TRUE);\n\t\t$this->dbforge->create_table('event_categories');\n\t}", "public function up()\n\t{\n Laravel\\Database\\Schema::create(\"orbs\", function($table){\n $table->increments(\"id\");\n $table->string(\"name\");\n $table->string(\"description\");\n $table->integer(\"coins\");\n $table->integer(\"points\");\n $table->integer(\"min_level\");\n $table->integer(\"max_level\");\n $table->integer(\"owner_character\");\n $table->integer(\"acquisition_time\");\n $table->integer(\"last_attacker\");\n $table->integer(\"last_attack_time\");\n $table->string(\"image\");\n });\n\t}" ]
[ "0.80062366", "0.79145443", "0.79145443", "0.79145443", "0.7572342", "0.756089", "0.75283176", "0.7498379", "0.7493237", "0.7453656", "0.74463314", "0.7433381", "0.74307704", "0.7427088", "0.741794", "0.73779047", "0.7374933", "0.7370453", "0.73637444", "0.73505706", "0.7329024", "0.7313519", "0.7298817", "0.72950184", "0.72917736", "0.7291469", "0.72913444", "0.72849613", "0.72839737", "0.7272078", "0.7271878", "0.72659117", "0.7262893", "0.7261672", "0.7256839", "0.72505474", "0.7249633", "0.72441125", "0.724062", "0.72376186", "0.7218244", "0.72177947", "0.72046006", "0.7203395", "0.7196059", "0.7191219", "0.7189963", "0.7177052", "0.71761394", "0.7167738", "0.7164105", "0.7164105", "0.7159096", "0.7147647", "0.7136521", "0.7129768", "0.7124664", "0.7123368", "0.71168584", "0.7104628", "0.7104628", "0.7104618", "0.7097006", "0.70931643", "0.70886755", "0.7087018", "0.7086326", "0.70830804", "0.70829463", "0.70780045", "0.70702124", "0.70690626", "0.7066111", "0.7062268", "0.7058938", "0.705882", "0.70556235", "0.70549136", "0.7054758", "0.70498437", "0.70483595", "0.7047308", "0.7045881", "0.70445794", "0.7043173", "0.703882", "0.7038126", "0.703674", "0.7033728", "0.7032356", "0.7031423", "0.70257956", "0.70142514", "0.70101255", "0.7006208", "0.6988486", "0.6984963", "0.69629973", "0.69612974", "0.69587934", "0.6957519" ]
0.0
-1
this down() migration is autogenerated, please modify it to your needs
public function down(Schema $schema) : void { $this->addSql('DROP TABLE job'); $this->addSql('DROP TABLE level'); $this->addSql('DROP TABLE logbook'); $this->addSql('DROP TABLE project'); $this->addSql('DROP TABLE project_description'); $this->addSql('DROP TABLE realization'); $this->addSql('DROP TABLE rhythm'); $this->addSql('DROP TABLE role'); $this->addSql('DROP TABLE techno'); $this->addSql('DROP TABLE user'); $this->addSql('DROP TABLE user_description'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function down()\n {\n //add your migration here \n }", "public function down()\n {\n //add your migration here\n }", "public function down()\n\t{\n $this->dropColumn('producto','fecha');\n\n //add column fecha in producto\n $this->addColumn('calculo','fecha','date');\n\t}", "public function down()\n {\n \t\n \t$this->createTable('os', [\n \t\t\t'id' => Schema::TYPE_PK,\n \t\t\t'name' => Schema::TYPE_STRING . ' NOT NULL',\n \t\t\t]);\n \t$this->insert('os', ['id' => 1, 'name' => 'Any']);\n \t$this->insert('os', ['id' => 2, 'name' => 'CentOS']);\n \t$this->insert('os', ['id' => 3, 'name' => 'RHEL']);\n \t$this->insert('os', ['id' => 4, 'name' => 'Fedora']);\n \t \n \t$this->createTable('os_bit', [\n \t\t\t'id' => Schema::TYPE_PK,\n \t\t\t'name' => Schema::TYPE_STRING . ' NOT NULL',\n \t\t\t]);\n\n return false;\n }", "public function down()\n {\n //Schema::dropIfExists('c');//回滚时执行\n\n }", "public function down()\n {\n $this->dbforge->drop_column('user', 'created_at');\n }", "public function down()\n {\n $this->dropForeignKey(\n 'fk-video-blog_id',\n 'video'\n );\n\n\n echo \"m160820_150846_video_create reverted.\\n\";\n\n }", "public function down()\n\t{\nDB::query(\n\"drop table haal;\");\nDB::query(\n\"drop table kandidaat;\");\nDB::query(\n\"drop table haaletaja;\");\nDB::query(\n\"drop table partei;\");\nDB::query(\n\"drop table valimisringkond;\");\n\t}", "public function down()\n\t{\n\t\t// Remove data from committee_members\n\t\tDB::table('committee_members')->where('id', '<', 3)->delete();\t\n\t}", "public function down(){\n $this->dropTable('users');\n }", "public function getDownSQL()\n {\n return array (\n 'default' => '\n# This is a fix for InnoDB in MySQL >= 4.1.x\n# It \"suspends judgement\" for fkey relationships until are tables are set.\nSET FOREIGN_KEY_CHECKS = 0;\n\nALTER TABLE `department_summary`\n\n CHANGE `positive_twitter_account` `twitter_account` TEXT NOT NULL,\n\n DROP `negative_twitter_account`;\n\nALTER TABLE `tweets`\n\n CHANGE `twitter_account` `positive_twitter_account` TEXT NOT NULL,\n\n ADD `negative_twitter_account` INTEGER NOT NULL AFTER `quality_tweet`;\n\n# This restores the fkey checks, after having unset them earlier\nSET FOREIGN_KEY_CHECKS = 1;\n',\n);\n }", "public function down()\n {\n Schema::table('attachments', function(Blueprint $table) {\n\n $table->dropColumn('viewable_id');\n $table->dropColumn('viewable_type');\n\n\n });\n }", "public function down()\n\t{\n\t\t//Schema::drop('purchase_order_details');\n\t}", "public function getDownSQL()\r\n {\r\n return array (\n 'propel' => '\r\n# This is a fix for InnoDB in MySQL >= 4.1.x\r\n# It \"suspends judgement\" for fkey relationships until are tables are set.\r\nSET FOREIGN_KEY_CHECKS = 0;\r\n\r\nDROP TABLE IF EXISTS `movimiento`;\r\n\r\n# This restores the fkey checks, after having unset them earlier\r\nSET FOREIGN_KEY_CHECKS = 1;\r\n',\n);\r\n }", "public function down()\n\t{\n//\t\t$this->dbforge->drop_table('blog');\n\n//\t\t// Dropping a Column From a Table\n\t\t$this->dbforge->drop_column('categories', 'icon');\n\t}", "public function down()\n\t{\n\t\t// nothing to do here.\n\t}", "public function down(){\r\n $this->dbforge->drop_table('users'); //eliminacion de la tabla users\r\n }", "public function down()\n\t{\n\t\tSchema::drop('student');\n\t\t//\n\t}", "public function down()\n{\n\nSchema::drop('event_user');\nSchema::drop('events');\nSchema::drop('file');\nSchema::drop('file_ref');\nSchema::drop('groups');\nSchema::drop('project_user');\nSchema::drop('projects');\nSchema::drop('quicknote');\nSchema::drop('subtasks');\nSchema::drop('task_user');\nSchema::drop('tasks');\nSchema::drop('throttle');\nSchema::drop('timesheet');\nSchema::drop('todos');\nSchema::drop('user_profile');\nSchema::drop('users');\nSchema::drop('users_groups');\nSchema::drop('users_groups');\nSchema::drop('users_groups');\nSchema::drop('users_groups');\nSchema::drop('users_groups');\nSchema::drop('users_groups');\nSchema::drop('users_groups');\nSchema::drop('users_groups');\nSchema::drop('users_groups');\n\n}", "public function down() \n {\n \n }", "public function down()\n\t{\n\t}", "public function down()\n\t{\n\t}", "public function down()\n\t{\n\t\t//\n\t}", "public function down()\n\t{\n\t\t//\n\t}", "public function down()\n\t{\n\t\t//\n\t}", "public function down()\n {\n $this->table('contents')->drop()->save();\n }", "public function down()\n\t{\n\t\tSchema::drop('education');\n\t}", "public function down()\n\t{\n\t\tSchema::drop('l_wardrobe_table');\n\t}", "public function down()\n\t{\n\t\techo $this->migration('down');\n\n\t\tci('o_role_model')->migration_remove($this->hash());\n\t\t\n\t\treturn true;\n\t}", "public function safeDown()\n\t{\n $sql=\" ALTER TABLE `tbl_venta` DROP `punto_venta_id` ;\";\n $this->execute($sql);\n //quitando la columna pto_venta de tbl_empleado\n $sql=\" ALTER TABLE `tbl_empleado` DROP `punto_venta_id` ;\";\n $this->execute($sql);\n\t}", "public function down()\n {\n\tSchema::drop('quizzes');\n }", "public function down()\n {\n $this->output->writeln('Down migration is not available.');\n }", "public function down()\n {\n $this->executeSQL('SET FOREIGN_KEY_CHECKS=0');\n\n $this->executeSQL('DROP TABLE link');\n $this->executeSQL('DROP TABLE link_category');\n\n $this->executeSQL('SET FOREIGN_KEY_CHECKS=1');\n }", "public function down ()\n {\n }", "abstract public function down();", "abstract public function down();", "abstract public function down();", "public function down()\n {\n // This migration was removed, but fails when uninstalling plugin\n }", "public function down()\r\n {\r\n $this->dbforge->drop_table('users');\r\n }", "public function down() {\n\n\t}", "public function down()\n {\n $this->dbforge->drop_table('lecturer', true);\n }", "public function down()\n\t{\n\t\tSchema::drop('flows_steps');\n\t}", "public function down(Schema $schema) : void\n {\n $this->addSql('CREATE TABLE galaxiee (id INT AUTO_INCREMENT NOT NULL, idu_id INT NOT NULL, nom VARCHAR(255) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, INDEX IDX_8576D2AF376A6230 (idu_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB COMMENT = \\'\\' ');\n $this->addSql('CREATE TABLE trou_noir (id INT AUTO_INCREMENT NOT NULL, id_g_id INT DEFAULT NULL, nom VARCHAR(255) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, INDEX IDX_AB27242D95951086 (id_g_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB COMMENT = \\'\\' ');\n $this->addSql('ALTER TABLE galaxiee ADD CONSTRAINT FK_8576D2AF376A6230 FOREIGN KEY (idu_id) REFERENCES univers (id)');\n $this->addSql('ALTER TABLE trou_noir ADD CONSTRAINT FK_AB27242D95951086 FOREIGN KEY (id_g_id) REFERENCES galaxie (id)');\n $this->addSql('DROP TABLE trounoir');\n $this->addSql('ALTER TABLE galaxie DROP FOREIGN KEY FK_1C880711376A6230');\n $this->addSql('DROP INDEX IDX_1C880711376A6230 ON galaxie');\n $this->addSql('ALTER TABLE galaxie CHANGE idu_id id_u_id INT NOT NULL');\n $this->addSql('ALTER TABLE galaxie ADD CONSTRAINT FK_1C8807116F858F92 FOREIGN KEY (id_u_id) REFERENCES univers (id)');\n $this->addSql('CREATE INDEX IDX_1C8807116F858F92 ON galaxie (id_u_id)');\n $this->addSql('ALTER TABLE planete DROP FOREIGN KEY FK_490E3E5712013DEC');\n $this->addSql('DROP INDEX IDX_490E3E5712013DEC ON planete');\n $this->addSql('ALTER TABLE planete ADD id_s_id INT NOT NULL, ADD nb_sattelite INT NOT NULL, DROP ids_id, DROP nb_satelite');\n $this->addSql('ALTER TABLE planete ADD CONSTRAINT FK_490E3E574AEED04E FOREIGN KEY (id_s_id) REFERENCES systeme (id)');\n $this->addSql('CREATE INDEX IDX_490E3E574AEED04E ON planete (id_s_id)');\n $this->addSql('ALTER TABLE systeme DROP FOREIGN KEY FK_95796DE3CD7AFD24');\n $this->addSql('DROP INDEX IDX_95796DE3CD7AFD24 ON systeme');\n $this->addSql('ALTER TABLE systeme CHANGE idg_id id_g_id INT NOT NULL');\n $this->addSql('ALTER TABLE systeme ADD CONSTRAINT FK_95796DE395951086 FOREIGN KEY (id_g_id) REFERENCES galaxie (id)');\n $this->addSql('CREATE INDEX IDX_95796DE395951086 ON systeme (id_g_id)');\n }", "public function down() {\n $this->dbforge->drop_column('timesheets_items', 'orgID', TRUE);\n $this->dbforge->drop_column('timesheets_items', 'brandID', TRUE);\n $this->dbforge->drop_column('timesheets_items', 'reason_desc', TRUE);\n $this->dbforge->drop_column('timesheets_expenses', 'orgID', TRUE);\n $this->dbforge->drop_column('timesheets_expenses', 'brandID', TRUE);\n $this->dbforge->drop_column('timesheets_expenses', 'reason_desc', TRUE);\n\n // change reason to note\n $fields = array(\n 'reason' => array(\n 'name' => 'note',\n 'type' => \"VARCHAR\",\n 'constraint' => 200,\n 'null' => TRUE\n )\n );\n $this->dbforge->modify_column('timesheets_items', $fields);\n $this->dbforge->modify_column('timesheets_expenses', $fields);\n }", "public function down(): void\n {\n // Remove your data\n }", "public function down()\n\t{\n\t\t//Schema::drop('purchase_orders');\n\t\t//Schema::drop('purchase_order_details');\n\t}", "public function down()\n {\n\tSchema::drop('activities');\n }", "public function down()\n {\n //return false;\n\t\t\n\t\t$TABLE_NAME = 'Haber';\n $this->dropTable($TABLE_NAME);\n\t\t\n\t\t$TABLE_NAME = 'HaberKategori';\n $this->dropTable($TABLE_NAME);\n }", "public function down(){\n $this->dbforge->drop_table('subcategories_news'); //eliminacion de la tabla subcategories_news\n }", "public function down()\n {\n }", "public function down()\n {\n }", "public function down()\n\t{\n\t\tDB::table('professor')->where('professor_id', '=', 1)->delete();\n\t\tDB::table('professor')->where('professor_id', '=', 2)->delete();\n\t\tDB::query('ALTER TABLE professor AUTO_INCREMENT = 1');\n\n\t\t//\n\t}", "public function down(): bool {\n\t\t// Remove & add logic to revert the migration here.\n\t\techo \"M230123030315BaseTables cannot be rolled back.\\n\";\n\t\treturn false;\n\t}", "public function getDownSQL()\r\n {\r\n return array (\n 'propel' => '\r\n# This is a fix for InnoDB in MySQL >= 4.1.x\r\n# It \"suspends judgement\" for fkey relationships until are tables are set.\r\nSET FOREIGN_KEY_CHECKS = 0;\r\n\r\nALTER TABLE `promocion` CHANGE `fecha_inicio` `fecha_inicio` DATE NOT NULL;\r\n\r\nALTER TABLE `promocion` CHANGE `fecha_fin` `fecha_fin` DATE NOT NULL;\r\n\r\nALTER TABLE `promocion` CHANGE `descuento` `descuento` DECIMAL;\r\n\r\nALTER TABLE `promocion`\r\n ADD `descripcion` VARCHAR(70) AFTER `id`,\r\n ADD `estado` VARCHAR(11) AFTER `fecha_fin`,\r\n ADD `promocion_global` TINYINT(1) NOT NULL AFTER `descuento`;\r\n\r\nALTER TABLE `promocion` DROP `activo`;\r\n\r\n# This restores the fkey checks, after having unset them earlier\r\nSET FOREIGN_KEY_CHECKS = 1;\r\n',\n);\r\n }", "public function down()\n\t{\n\t\t//return false;\n\t}", "public function down(): void\n {\n try {\n $this->db->ForeignKeyChecks(false);\n $statement=$this->db->prepare(\"DROP TABLE IF EXISTS prom2_pages\");\n $statement->execute();\n $statement->close();\n $this->db->ForeignKeyChecks(true);\n } catch (\\mysqli_sql_exception $exception) {\n throw $exception;\n }\n }", "public function down()\n\t{\n\t\t//\n\t\tSchema::drop('options');\n\t}", "public function change()\n {\n $this->schema->table('recurring_expenses',function($table){\n $table->date('end_repeat')->nullable();\n $table->boolean('ended')->default(false);\n $table->enum('repeat',['0','1','7','14','30','365'])->nullable();\n });\n\n $this->schema->table('expenses',function($table){\n $table->dropColumn('end_repeat');\n $table->dropColumn('repeat');\n $table->integer('parent_id')->nullable();\n $table->foreign('parent_id')->references('id')->on('expenses')->onDelete('cascade');\n });\n }", "public function down()\n {\n Schema::table('users', function (Blueprint $table) {\n $table->dropForeign('users_id_turma_foreign');\n });\n\n Schema::table('contato', function (Blueprint $table) {\n $table->dropForeign('contato_id_usuario_foreign');\n });\n\n Schema::table('monitores', function (Blueprint $table) {\n $table->dropForeign('monitores_id_turma_foreign');\n $table->dropForeign('monitores_id_usuario_foreign');\n });\n\n Schema::table('galeria_portifolio', function (Blueprint $table) {\n $table->dropForeign('galeria_portifolio_id_portifolio_foreign');\n });\n\n Schema::table('portifolio_alunos', function (Blueprint $table) {\n $table->dropForeign('portifolio_alunos_id_portifolio_foreign');\n $table->dropForeign('portifolio_alunos_id_usuario_foreign');\n });\n\n Schema::table('cobranca', function (Blueprint $table) {\n $table->dropForeign('cobranca_id_aluno_foreign');\n });\n\n Schema::table('lista_de_presenca', function (Blueprint $table) {\n $table->dropForeign('lista_de_presenca_id_usuario_foreign');\n });\n\n Schema::table('forum_da_turma', function (Blueprint $table) {\n $table->dropForeign('forum_da_turma_id_usuario_foreign');\n });\n\n Schema::table('posts_do_site', function (Blueprint $table) {\n $table->dropForeign('posts_do_site_id_usuario_foreign');\n });\n\n Schema::table('posts_do_forum', function (Blueprint $table) {\n $table->dropForeign('posts_do_forum_id_topico_foreign');\n $table->dropForeign('posts_do_forum_id_usuario_foreign');\n });\n }", "public function down()\n\t{\n\t\t$this->dropForeignKey('FK_task_creator','tbl_task');\n\n\t\t$this->dropTable('tbl_task');\n\t}", "public function down()\n {\n $this->table('articles')->drop()->save();\n $this->table('categories')->drop()->save();\n $this->table('football_ragistrations')->drop()->save();\n $this->table('friends')->drop()->save();\n $this->table('menus')->drop()->save();\n $this->table('picnic_ragistrations')->drop()->save();\n $this->table('products')->drop()->save();\n $this->table('profiles')->drop()->save();\n $this->table('skills')->drop()->save();\n $this->table('spouses')->drop()->save();\n $this->table('students')->drop()->save();\n $this->table('submenus')->drop()->save();\n $this->table('users')->drop()->save();\n }", "public function down(){\n\t\tSchema::dropIfExists('cargo');\n\t}", "public function down()\n {\n $this->table('users')\n ->dropForeignKey(\n 'role_id'\n )->save();\n\n $this->table('users')\n ->removeIndexByName('FK_users_roles')\n ->update();\n\n $this->table('users')\n ->addColumn('can_edit', 'boolean', [\n 'after' => 'enabled',\n 'default' => '0',\n 'length' => null,\n 'null' => false,\n ])\n ->removeColumn('role_id')\n ->update();\n\n $this->table('stundenplan')\n ->changeColumn('note', 'string', [\n 'default' => null,\n 'length' => 255,\n 'null' => true,\n ])\n ->removeColumn('loggedInNote')\n ->update();\n\n $this->table('roles')->drop()->save();\n }", "public function down()\n\t{\n\t\t//\n\t\tDB::query('TRUNCATE TABLE app_user_apps_publishes CASCADE');\n\t\tDB::query('TRUNCATE TABLE app_apps_fbapps CASCADE');\n\t\tDB::query('TRUNCATE TABLE app_apps_applications CASCADE');\n\t}", "protected abstract function do_down();", "public function down()\n\t{\n\t\t// Drop Table\n\t\tSchema::drop('activities_types');\n\t}", "public function down(Schema $schema) : void\n {\n $this->addSql('CREATE TABLE encherir_acheteur (encherir_id INT NOT NULL, acheteur_id INT NOT NULL, INDEX IDX_41ABAAFBB0BA17BB (encherir_id), INDEX IDX_41ABAAFB96A7BB5F (acheteur_id), PRIMARY KEY(encherir_id, acheteur_id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB COMMENT = \\'\\' ');\n $this->addSql('CREATE TABLE encherir_lot (encherir_id INT NOT NULL, lot_id INT NOT NULL, INDEX IDX_3C56919BB0BA17BB (encherir_id), INDEX IDX_3C56919BA8CBA5F7 (lot_id), PRIMARY KEY(encherir_id, lot_id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB COMMENT = \\'\\' ');\n $this->addSql('ALTER TABLE encherir_acheteur ADD CONSTRAINT FK_41ABAAFB96A7BB5F FOREIGN KEY (acheteur_id) REFERENCES acheteur (id) ON DELETE CASCADE');\n $this->addSql('ALTER TABLE encherir_acheteur ADD CONSTRAINT FK_41ABAAFBB0BA17BB FOREIGN KEY (encherir_id) REFERENCES encherir (id) ON DELETE CASCADE');\n $this->addSql('ALTER TABLE encherir_lot ADD CONSTRAINT FK_3C56919BA8CBA5F7 FOREIGN KEY (lot_id) REFERENCES lot (id) ON DELETE CASCADE');\n $this->addSql('ALTER TABLE encherir_lot ADD CONSTRAINT FK_3C56919BB0BA17BB FOREIGN KEY (encherir_id) REFERENCES encherir (id) ON DELETE CASCADE');\n $this->addSql('ALTER TABLE encherir DROP FOREIGN KEY FK_503B7C878EB576A8');\n $this->addSql('ALTER TABLE encherir DROP FOREIGN KEY FK_503B7C878EFC101A');\n $this->addSql('DROP INDEX IDX_503B7C878EB576A8 ON encherir');\n $this->addSql('DROP INDEX IDX_503B7C878EFC101A ON encherir');\n $this->addSql('ALTER TABLE encherir DROP id_acheteur_id, DROP id_lot_id');\n }", "public function down()\n {\n $this->table('accounting_entries')\n ->dropForeignKey(\n 'accounting_entry_type_id'\n )\n ->dropForeignKey(\n 'association_id'\n )->save();\n\n $this->table('associations_events')\n ->dropForeignKey(\n 'event_id'\n )\n ->dropForeignKey(\n 'association_id'\n )->save();\n\n $this->table('events')\n ->dropForeignKey(\n 'event_type_id'\n )->save();\n\n $this->table('members')\n ->dropForeignKey(\n 'association_id'\n )->save();\n\n $this->table('statistics')\n ->dropForeignKey(\n 'statistics_type_id'\n )\n ->dropForeignKey(\n 'association_id'\n )->save();\n\n $this->table('statistics_event')\n ->dropForeignKey(\n 'statistics_id'\n )\n ->dropForeignKey(\n 'event_id'\n )->save();\n\n $this->table('users')\n ->dropForeignKey(\n 'role_id'\n )\n ->dropForeignKey(\n 'association_id'\n )->save();\n\n $this->table('accounting_entries')->drop()->save();\n $this->table('accounting_entry_type')->drop()->save();\n $this->table('associations')->drop()->save();\n $this->table('associations_events')->drop()->save();\n $this->table('event_type')->drop()->save();\n $this->table('events')->drop()->save();\n $this->table('members')->drop()->save();\n $this->table('roles')->drop()->save();\n $this->table('statistics')->drop()->save();\n $this->table('statistics_event')->drop()->save();\n $this->table('statistics_type')->drop()->save();\n $this->table('users')->drop()->save();\n }", "public function down()\n\t{\n\t\tif(Yii::app()->db->getSchema()->getTable(\"{{user_block}}\")){\n\t\t\t$this->dropTable(\"{{user_block}}\");\n\t\t}\n\n\t}", "public function getDownSQL()\n {\n return array (\n 'default' => '\n# This is a fix for InnoDB in MySQL >= 4.1.x\n# It \"suspends judgement\" for fkey relationships until are tables are set.\nSET FOREIGN_KEY_CHECKS = 0;\n\nDROP TABLE IF EXISTS `user_login`;\n\nALTER TABLE `user` DROP `user_mname`;\n\nALTER TABLE `user` DROP `user_user`;\n\nALTER TABLE `user` DROP `user_password`;\n\nALTER TABLE `user` DROP `user_date_lastlogin`;\n\n# This restores the fkey checks, after having unset them earlier\nSET FOREIGN_KEY_CHECKS = 1;\n',\n);\n }", "public function down()\n\t{\n\t\tSchema::table('officers', function($t){\n\t\t\t$t->drop_column('role');\n\t\t});\n\t}", "public function safeDown()\n {\n $this->down();\n }", "public function safeDown()\n {\n $this->down();\n }", "public function down()\n\t{\n\t\tSchema::drop('refs');\n\t}", "public function down () {\n\t\treturn $this->rename_column ('headline', 'title', 'string', array ('limit' => 72));\n\t}", "public function down()\n\t{\n\t\tSchema::drop('appeals');\n\t}", "public function safeDown()\r\n {\r\n $this->down();\r\n }", "public function down(Schema $schema) : void\n {\n $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \\'mysql\\'.');\n\n<<<<<<< HEAD\n $this->addSql('ALTER TABLE affaire_liste_affaire DROP FOREIGN KEY FK_80DBABFCF082E755');\n $this->addSql('ALTER TABLE affaire DROP FOREIGN KEY FK_9C3F18EFED813170');\n=======\n<<<<<<< HEAD:src/Migrations/Version20200418121015.php\n $this->addSql('ALTER TABLE affaire_liste_affaire DROP FOREIGN KEY FK_80DBABFCF082E755');\n $this->addSql('ALTER TABLE affaire DROP FOREIGN KEY FK_9C3F18EFED813170');\n=======\n $this->addSql('ALTER TABLE liste_affaire_affaire DROP FOREIGN KEY FK_CA81ADF3F082E755');\n $this->addSql('ALTER TABLE enfant DROP FOREIGN KEY FK_34B70CA2463CD7C3');\n $this->addSql('ALTER TABLE enfant DROP FOREIGN KEY FK_34B70CA25D493FF4');\n $this->addSql('ALTER TABLE correspondant_administratif DROP FOREIGN KEY FK_E1E7152EBF396750');\n $this->addSql('ALTER TABLE enfant DROP FOREIGN KEY FK_34B70CA246135043');\n>>>>>>> e1e13eb645b79ada7517f9d2be860dc1655c42db:src/Migrations/Version20200318150734.php\n>>>>>>> 0c1c04bb7c2bbee076bc5fdb1e2456d1af817866\n $this->addSql('ALTER TABLE enfant_sejour DROP FOREIGN KEY FK_159E7E65450D2529');\n $this->addSql('ALTER TABLE enfant_sejour DROP FOREIGN KEY FK_159E7E6584CF0CF');\n $this->addSql('ALTER TABLE enfant DROP FOREIGN KEY FK_34B70CA2463CD7C3');\n $this->addSql('ALTER TABLE enfant DROP FOREIGN KEY FK_34B70CA25D493FF4');\n $this->addSql('ALTER TABLE enfant DROP FOREIGN KEY FK_34B70CA2FF631228');\n $this->addSql('ALTER TABLE affaire_liste_affaire DROP FOREIGN KEY FK_80DBABFCE2687AC3');\n $this->addSql('ALTER TABLE sejour DROP FOREIGN KEY FK_96F52028E2687AC3');\n $this->addSql('ALTER TABLE enfant DROP FOREIGN KEY FK_34B70CA246135043');\n $this->addSql('ALTER TABLE correspondant_administratif DROP FOREIGN KEY FK_E1E7152E46135043');\n $this->addSql('DROP TABLE affaire');\n<<<<<<< HEAD\n $this->addSql('DROP TABLE affaire_liste_affaire');\n $this->addSql('DROP TABLE type_affaire');\n=======\n<<<<<<< HEAD:src/Migrations/Version20200418121015.php\n $this->addSql('DROP TABLE affaire_liste_affaire');\n $this->addSql('DROP TABLE type_affaire');\n=======\n $this->addSql('DROP TABLE centre');\n $this->addSql('DROP TABLE correspondant_administratif');\n $this->addSql('DROP TABLE responsable_legal');\n>>>>>>> e1e13eb645b79ada7517f9d2be860dc1655c42db:src/Migrations/Version20200318150734.php\n>>>>>>> 0c1c04bb7c2bbee076bc5fdb1e2456d1af817866\n $this->addSql('DROP TABLE enfant');\n $this->addSql('DROP TABLE enfant_sejour');\n $this->addSql('DROP TABLE sejour');\n $this->addSql('DROP TABLE centre');\n $this->addSql('DROP TABLE correspondant_administratif');\n $this->addSql('DROP TABLE etablissement');\n $this->addSql('DROP TABLE liste_affaire');\n $this->addSql('DROP TABLE responsable_legal');\n $this->addSql('DROP TABLE user');\n }", "public function getDownSQL()\n {\n return array (\n 'default' => '\n# This is a fix for InnoDB in MySQL >= 4.1.x\n# It \"suspends judgement\" for fkey relationships until are tables are set.\nSET FOREIGN_KEY_CHECKS = 0;\n\nDROP TABLE IF EXISTS `user`;\n\nDROP TABLE IF EXISTS `question`;\n\nDROP TABLE IF EXISTS `answer`;\n\nDROP TABLE IF EXISTS `image`;\n\nDROP TABLE IF EXISTS `vote`;\n\n# This restores the fkey checks, after having unset them earlier\nSET FOREIGN_KEY_CHECKS = 1;\n',\n);\n }", "public function safeDown()\n\t{\n\t\t$this->dropTable($this->tableName);\n\t}", "public function safeDown()\n\t{\n\t\t$this->dropTable($this->tableName);\n\t}", "public function safeDown()\n\t{\n\t\t$this->dropTable($this->tableName);\n\t}", "public function down()\n {\n $this->table('mail_contents')->drop()->save();\n }", "public function down() {\n\t}", "public function down() {\n\t}", "public function down() {\n\t}", "public function down()\n {\n Schema::dropIfExists('reunion');\n }", "public function down(): void\n {\n $this->table('services')\n ->dropForeignKey(\n ['currency_id','billing_period_id']\n )->save();\n $this->execute('DELETE FROM currencies');\n $this->execute('DELETE FROM billing_periods');\n $this->table('services')->drop()->save();\n $this->table('currencies')->drop()->save();\n $this->table('billing_periods')->drop()->save();\n }", "public function down()\n\t{\n\t\tSchema::drop('article_category');\n\t}", "public function down()\n {\n Schema::table('users', function (Blueprint $table) {\n $table->renameColumn('first_name', 'name');\n $table->dropIndex('users_first_name_index');\n $table->dropIndex('users_created_at_index');\n $table->dropIndex('users_updated_at_index');\n $table->dropColumn(\"last_name\");\n $table->dropColumn(\"username\");\n $table->dropColumn(\"provider\");\n $table->dropColumn(\"provider_id\");\n $table->dropColumn(\"api_token\");\n $table->dropColumn(\"code\");\n $table->dropColumn(\"remember_token\");\n $table->dropColumn(\"role_id\");\n $table->dropColumn(\"last_login\");\n $table->dropColumn(\"status\");\n $table->dropColumn(\"root\");\n $table->dropColumn('backend');\n $table->dropColumn(\"photo_id\");\n $table->dropColumn(\"lang\");\n $table->dropColumn(\"color\");\n $table->dropColumn(\"about\");\n $table->dropColumn(\"facebook\");\n $table->dropColumn(\"twitter\");\n $table->dropColumn(\"linked_in\");\n $table->dropColumn(\"google_plus\");\n });\n }", "public function down()\n\t{\n\t\tSchema::drop('entries');\n\t}", "public function down()\n\t{\n\t\tSchema::table('precios_aterrizajes_despegues', function(Blueprint $table)\n\t\t{\n\t\t\t//\n\t\t});\n\t}", "public function down()\n{\nSchema::drop('statustype');\nSchema::drop('area');\nSchema::drop('region');\nSchema::drop('territory');\nSchema::drop('trackedevent');\nSchema::drop('zip_territory');\nSchema::drop('messagetype');\nSchema::drop('optintype');\nSchema::drop('representative');\nSchema::drop('pediatrician');\nSchema::drop('application_messagestatus');\nSchema::drop('application_optin');\nSchema::drop('application_trackedevent');\nSchema::drop('application');\n}", "public function down()\n\t{\n\t\tSchema::drop(Config::get('sentry::sentry.table.users_metadata'));\n\t}", "protected function tearDown(): void {\n $migration = include __DIR__.'/../database/migrations/create_all_visitors_tables.php.stub';\n $migration->down();\n\n $migrationTest = include __DIR__.'/Support/migrations/2023_01_12_000000_create_test_models_table.php';\n $migrationTest->down();\n }", "public function down(Schema $schema) : void\n {\n $this->addSql('ALTER TABLE classe_personne DROP FOREIGN KEY FK_350001418F5EA509');\n $this->addSql('ALTER TABLE matiere_classe DROP FOREIGN KEY FK_AF649A8B8F5EA509');\n $this->addSql('ALTER TABLE note DROP FOREIGN KEY FK_CFBDFA148F5EA509');\n $this->addSql('ALTER TABLE seance DROP FOREIGN KEY FK_DF7DFD0E8F5EA509');\n $this->addSql('ALTER TABLE cours DROP FOREIGN KEY FK_FDCA8C9CF46CD258');\n $this->addSql('ALTER TABLE matiere_classe DROP FOREIGN KEY FK_AF649A8BF46CD258');\n $this->addSql('ALTER TABLE note DROP FOREIGN KEY FK_CFBDFA14F46CD258');\n $this->addSql('ALTER TABLE personne_matiere DROP FOREIGN KEY FK_4E9BB3B7F46CD258');\n $this->addSql('ALTER TABLE absence DROP FOREIGN KEY FK_765AE0C9A21BD112');\n $this->addSql('ALTER TABLE classe_personne DROP FOREIGN KEY FK_35000141A21BD112');\n $this->addSql('ALTER TABLE contacte DROP FOREIGN KEY FK_C794A022A21BD112');\n $this->addSql('ALTER TABLE demande DROP FOREIGN KEY FK_2694D7A5A21BD112');\n $this->addSql('ALTER TABLE note DROP FOREIGN KEY FK_CFBDFA14A6CC7B2');\n $this->addSql('ALTER TABLE personne_matiere DROP FOREIGN KEY FK_4E9BB3B7A21BD112');\n $this->addSql('ALTER TABLE seance DROP FOREIGN KEY FK_DF7DFD0EE455FCC0');\n $this->addSql('ALTER TABLE seance DROP FOREIGN KEY FK_DF7DFD0EBDDFA3C9');\n $this->addSql('ALTER TABLE seance DROP FOREIGN KEY FK_DF7DFD0EDC304035');\n $this->addSql('ALTER TABLE absence DROP FOREIGN KEY FK_765AE0C9E3797A94');\n $this->addSql('ALTER TABLE personne DROP FOREIGN KEY FK_FCEC9EFA76ED395');\n $this->addSql('ALTER TABLE reset_password_request DROP FOREIGN KEY FK_7CE748AA76ED395');\n $this->addSql('DROP TABLE absence');\n $this->addSql('DROP TABLE classe');\n $this->addSql('DROP TABLE classe_personne');\n $this->addSql('DROP TABLE contacte');\n $this->addSql('DROP TABLE cours');\n $this->addSql('DROP TABLE demande');\n $this->addSql('DROP TABLE matiere');\n $this->addSql('DROP TABLE matiere_classe');\n $this->addSql('DROP TABLE news');\n $this->addSql('DROP TABLE note');\n $this->addSql('DROP TABLE personne');\n $this->addSql('DROP TABLE personne_matiere');\n $this->addSql('DROP TABLE reset_password_request');\n $this->addSql('DROP TABLE salle');\n $this->addSql('DROP TABLE seance');\n $this->addSql('DROP TABLE user');\n }", "public function down()\n\t{\n\t\tSchema::drop('stor_mem');\n\t}", "public function down(Schema $schema) : void\n {\n $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \\'mysql\\'.');\n\n $this->addSql('ALTER TABLE booking DROP FOREIGN KEY FK_E00CEDDEA76ED395');\n $this->addSql('ALTER TABLE booking DROP FOREIGN KEY FK_E00CEDDE19FCD424');\n $this->addSql('DROP TABLE booking');\n $this->addSql('DROP TABLE product_image');\n $this->addSql('DROP TABLE family_page_container');\n $this->addSql('DROP TABLE user');\n $this->addSql('DROP TABLE time_line');\n $this->addSql('ALTER TABLE family DROP FOREIGN KEY FK_A5E6215B727ACA70');\n $this->addSql('DROP INDEX IDX_A5E6215B727ACA70 ON family');\n $this->addSql('ALTER TABLE family ADD page_content_id INT NOT NULL, DROP parent_id, DROP has_uniques_prices, DROP has_seasonal_products');\n $this->addSql('ALTER TABLE family ADD CONSTRAINT FK_A5E6215B8F409273 FOREIGN KEY (page_content_id) REFERENCES page_content (id)');\n $this->addSql('CREATE INDEX IDX_A5E6215B8F409273 ON family (page_content_id)');\n $this->addSql('ALTER TABLE link ADD page_container_id INT DEFAULT NULL, DROP url');\n $this->addSql('ALTER TABLE link ADD CONSTRAINT FK_36AC99F123D5B0C FOREIGN KEY (page_container_id) REFERENCES page_container (id)');\n $this->addSql('CREATE INDEX IDX_36AC99F123D5B0C ON link (page_container_id)');\n $this->addSql('ALTER TABLE product DROP content, DROP order_by, DROP is_generic, DROP type, CHANGE title label VARCHAR(50) NOT NULL COLLATE utf8mb4_unicode_ci');\n $this->addSql('ALTER TABLE unit DROP duration');\n }", "public function down(Schema $schema) : void\n {\n $this->addSql('ALTER TABLE `order` DROP FOREIGN KEY FK_F5299398F5B7AF75');\n $this->addSql('ALTER TABLE suppliers DROP FOREIGN KEY FK_AC28B95C8486F9AC');\n $this->addSql('ALTER TABLE user DROP FOREIGN KEY FK_8D93D6498486F9AC');\n $this->addSql('ALTER TABLE stock DROP FOREIGN KEY FK_4B365660D629F605');\n $this->addSql('ALTER TABLE stock DROP FOREIGN KEY FK_4B365660E308AC6F');\n $this->addSql('ALTER TABLE order_detail DROP FOREIGN KEY FK_ED896F46CFFE9AD6');\n $this->addSql('ALTER TABLE product DROP FOREIGN KEY FK_D34A04ADEE45BDBF');\n $this->addSql('ALTER TABLE suppliers DROP FOREIGN KEY FK_AC28B95CEE45BDBF');\n $this->addSql('ALTER TABLE user DROP FOREIGN KEY FK_8D93D649EE45BDBF');\n $this->addSql('ALTER TABLE order_detail DROP FOREIGN KEY FK_ED896F464584665A');\n $this->addSql('ALTER TABLE product_theme DROP FOREIGN KEY FK_36299C544584665A');\n $this->addSql('ALTER TABLE user DROP FOREIGN KEY FK_8D93D649D60322AC');\n $this->addSql('ALTER TABLE order_detail DROP FOREIGN KEY FK_ED896F46DCD6110');\n $this->addSql('ALTER TABLE order_detail DROP FOREIGN KEY FK_ED896F462ADD6D8C');\n $this->addSql('ALTER TABLE product_theme DROP FOREIGN KEY FK_36299C5459027487');\n $this->addSql('ALTER TABLE `order` DROP FOREIGN KEY FK_F5299398A76ED395');\n $this->addSql('DROP TABLE address');\n $this->addSql('DROP TABLE format');\n $this->addSql('DROP TABLE material');\n $this->addSql('DROP TABLE `order`');\n $this->addSql('DROP TABLE order_detail');\n $this->addSql('DROP TABLE picture');\n $this->addSql('DROP TABLE product');\n $this->addSql('DROP TABLE product_theme');\n $this->addSql('DROP TABLE role');\n $this->addSql('DROP TABLE stock');\n $this->addSql('DROP TABLE suppliers');\n $this->addSql('DROP TABLE theme');\n $this->addSql('DROP TABLE user');\n }", "public function down()\n {\n Schema::dropIfExists('data');\n }", "public function down()\n\t{\n\t\tSchema::create('jobs',function($table){$table->increments('id');});\n\t\tSchema::create('job_location',function($table){$table->increments('id');});\n\t\tSchema::create('job_skill',function($table){$table->increments('id');});\n\t\tSchema::create('locations',function($table){$table->increments('id');});\n\t\tSchema::create('location_program',function($table){$table->increments('id');});\n\t\tSchema::create('location_scholarship',function($table){$table->increments('id');});\n\t\tSchema::create('positions',function($table){$table->increments('id');});\n\t\tSchema::create('programs',function($table){$table->increments('id');});\n\t\tSchema::create('program_subject',function($table){$table->increments('id');});\n\t\tSchema::create('scholarships',function($table){$table->increments('id');});\n\t\tSchema::create('scholarship_subject',function($table){$table->increments('id');});\n\t\tSchema::create('skills',function($table){$table->increments('id');});\n\t\tSchema::create('subjects',function($table){$table->increments('id');});\n\t}" ]
[ "0.7950277", "0.78636813", "0.76065636", "0.7493955", "0.7320625", "0.7245268", "0.7187498", "0.71543235", "0.715298", "0.7141911", "0.7135835", "0.71214414", "0.71154845", "0.71057886", "0.7098064", "0.70800334", "0.7078775", "0.70729095", "0.7068331", "0.7066272", "0.7053364", "0.7053364", "0.7042174", "0.7042174", "0.7042174", "0.7041765", "0.7040102", "0.7028846", "0.70253754", "0.7021679", "0.6988633", "0.6986877", "0.6978061", "0.6971848", "0.6944203", "0.6944203", "0.6944203", "0.6942135", "0.6941429", "0.6939214", "0.6935277", "0.69334567", "0.6928689", "0.6924838", "0.6924794", "0.6913486", "0.6902361", "0.6897891", "0.6897845", "0.6897824", "0.6897824", "0.68886673", "0.688262", "0.6874051", "0.6869844", "0.6863713", "0.6858435", "0.68545175", "0.68440175", "0.6842142", "0.6836981", "0.6836124", "0.6834763", "0.68303466", "0.68297166", "0.68282366", "0.6826686", "0.6824025", "0.68185335", "0.6811099", "0.68078107", "0.68056506", "0.68056506", "0.6789167", "0.67755204", "0.67742497", "0.6765081", "0.67597127", "0.67596203", "0.67564446", "0.67564446", "0.67564446", "0.6753443", "0.6753351", "0.6753351", "0.6753351", "0.6752681", "0.674581", "0.6743746", "0.67387754", "0.6733766", "0.67331296", "0.6731279", "0.67302275", "0.6727377", "0.67273724", "0.672722", "0.672607", "0.67173517", "0.67139125", "0.671303" ]
0.0
-1
Pega Cadastros Json e a quantidade Cadastros
function dadosCadastros(){//função geral que será chamada na index pegaCadastrosJson();//pega os valores dos cadastros do arquivo JSON e salva em um array contaNumeroCadastros();//conta Quantos cadastros existem }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function JsonDioceses() {\n $o_data = new Db();\n $qr_result = $o_data->query(\"select grandsparents.idno, CASE objects.status WHEN 0 THEN \\\"en attente\\\" WHEN 1 THEN \\\"en cours\\\" WHEN 2 THEN \\\"à valider\\\" WHEN 3 THEN \\\"validé\\\" ELSE \\\"valeur incohérente\\\" END as statut, count(*) as nombre from ca_objects as objects left join ca_objects as parents on parents.object_id=objects.parent_id left join ca_objects as grandsparents on parents.parent_id=grandsparents.object_id and grandsparents.type_id=261 where objects.type_id = 262 and objects.deleted=0 and parents.type_id=23 and parents.parent_id is not null and grandsparents.object_id is not null group by parents.parent_id, objects.status;\");\n $first=1;\n print \"[\";\n while($qr_result->nextRow()) {\n if(!$first) print \",\";\n print \"{\\\"idno\\\":\\\"\".$qr_result->get('idno').\"\\\",\\n\";\n print \"\\\"statut\\\":\\\"\".$qr_result->get('statut').\"\\\",\\n\";\n print \"\\\"nombre\\\":\\\"\".$qr_result->get('nombre').\"\\\"}\\n\";\n $first=0;\n }\n print \"]\\n\";\n exit;\n }", "function getRowCount() {\r\n\r\n $url = 'http://localhost/COOLSHOP/proizvodi.json';\r\n $curl = curl_init($url);\r\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);\r\n curl_setopt($curl, CURLOPT_HTTPHEADER, array('Accept: application/json','Content-Type: application/json'));\r\n curl_setopt($curl, CURLOPT_HTTPGET, true);\r\n\r\n $curl_odgovor = curl_exec($curl);\r\n curl_close($curl);\r\n $json_objekat = json_decode($curl_odgovor);\r\n\r\n echo count($json_objekat->proizvodi);\r\n\t}", "function totalConcepto($where, $fecha_desde, $fecha_hasta)\n{\n $db = new MysqliDb();\n $resultsDetalles = [];\n\n $SQL = \"select movimiento_id, asiento_id, fecha, c.cuenta_id, c.descripcion, usuario_id, importe, 0 general, 0 control, 0 ca, 0 cc, 0 me,\n0 detalles\nfrom movimientos m inner join cuentas c on m.cuenta_id = c.cuenta_id\nwhere \" . $where . \" and (fecha between '\" . $fecha_desde . \"' and '\" . $fecha_hasta . \"');\";\n\n $results = $db->rawQuery($SQL);\n\n foreach ($results as $row) {\n $SQL = \"select\ndetalle_tipo_id,\nvalor detalle\n\n from detallesmovimientos\n where detalle_tipo_id in (2) and movimiento_id = \" . $row['movimiento_id'] . \";\";\n $detalles = $db->rawQuery($SQL);\n\n $row[\"detalles\"] = $detalles;\n array_push($resultsDetalles, $row);\n\n }\n\n echo json_encode($resultsDetalles);\n}", "public function c_getCountPtesPorEnvio() {\r\n $otPadreCount = $this->Dao_ot_padre_model->getCountPtesPorEnvio();\r\n echo json_encode($otPadreCount);\r\n }", "public function totalProducto() {\n\t\t$cantidad = $this->input->post('c');\n\t\t$precio = $this->input->post('p');\n\t\t$descuento = $this->input->post('d');\n\t\t$sub = ($precio * $cantidad);\n\t\t$des = ($sub * ($descuento/100));\n\t\t$total_facturacompra = $sub - $des;\n\t\t$data = array(\n\t\t\t'total_facturacompra' => $total_facturacompra, /*subtotal*/\n\t\t\t'des' => $des, /*descuento*/\n\t\t\t'sub' => $sub /*subtoral_sin_desc*/\n\t\t);\n\t\techo json_encode($data);\n\t}", "public function getJsonData()\n {$query = \"SELECT TYPE_F,COUNT(PPR) AS'count' FROM fonctionnaire GROUP BY TYPE_F\";\n $result = $this->db->prepare($query);\n $result->execute();\n $results=$result->fetchALL(PDO::FETCH_ASSOC);\n return $results;}", "public function itemsQuantity(Request $request){\n $lugar = Lugar::find($request->input('id'));\n\n $pc_cant = DB::table('items')\n ->where('lugar_id', $lugar->id)\n ->where('clasificacion','Pc')\n ->count();\n $mesa_cant = DB::table('items')\n ->where('lugar_id', $lugar->id)\n ->where('clasificacion','Mesa')\n ->count();\n $silla_cant = DB::table('items')\n ->where('lugar_id', $lugar->id)\n ->where('clasificacion','Silla')\n ->count();\n $piz_cant = DB::table('items')\n ->where('lugar_id', $lugar->id)\n ->where('clasificacion','Pizarrón')\n ->count();\n $television_cant = DB::table('items')\n ->where('lugar_id', $lugar->id)\n ->where('clasificacion','Television')\n ->count();\n $termostato_cant = DB::table('items')\n ->where('lugar_id', $lugar->id)\n ->where('clasificacion','Termostato')\n ->count();\n $ruteador_cant = DB::table('items')\n ->where('lugar_id', $lugar->id)\n ->where('clasificacion','Ruteador')\n ->count();\n $swith_cant = DB::table('items')\n ->where('lugar_id', $lugar->id)\n ->where('clasificacion','Switch')\n ->count();\n\n $output = array(\n 'pc_cant' => $pc_cant,\n 'mesa_cant' => $mesa_cant,\n 'silla_cant' => $silla_cant,\n 'piz_cant' => $piz_cant,\n 'television_cant' => $television_cant,\n 'termostato_cant' => $termostato_cant,\n 'ruteador_cant' => $ruteador_cant,\n 'swith_cant' => $swith_cant,\n );\n\n return response()->json($output);\n }", "public function totalColecao(){\r\n $oSicasEspecialidadeMedicaBD = new SicasEspecialidadeMedicaBD();\r\n return $oSicasEspecialidadeMedicaBD->totalColecao();\r\n }", "public function _listTotalBoleta2Date() {\n $db = new SuperDataBase();\n $pkEmpresa = UserLogin::get_pkSucursal();\n $query = \"CALL sp_get_listboleta('$this->dateGO','$this->dateEnd','$pkEmpresa')\";\n $resul = $db->executeQuery($query);\n\n $array = array();\n $total = 0;\n\n while ($row = $db->fecth_array($resul)) {\n $array[] = array(\"pkComprobante\" => $row['ncomprobante'],\n \"total\" => $row['total'],\n \"ruc\" => $row['ruc'],\n \"subTotal\" => $row['subTotal'],\n \"impuesto\" => $row['impuesto'],\n \"totalEfectivo\" => $row['totalEfectivo'],\n \"totalTarjeta\" => $row['totalTarjeta'],\n \"nombreTarjeta\" => $row['nombreTarjeta'],\n \"fecha\" => $row['fecha'],\n \"pkCajero\" => $row['pkCajero'],\n \"descuento\" => $row['descuento'],\n \"pkCliente\" => $row['pkCliente'],\n \"Nombre_Trabajador\" => $row['Nombre_Trabajador'],\n );\n// $total=$total+$row['total_venta'];\n }\n// $array[]= array('Total')\n// echo $query;\n echo json_encode($array);\n }", "public function getProductTotals($json) {\n\n $arr = json_decode($json );\n $isSuccess = $arr->info;\n $result = array();\n\n if ($isSuccess==\"SUCCESS\") {\n $data = $arr->data;\n foreach($data as $key => $value){\n if ($key=='PurchaseOrderProduct') {\n $purchaseOrderProduct = $value;\n foreach($purchaseOrderProduct as $purchaseOrderProductValue){\n $product = new Product($purchaseOrderProductValue);\n $productTotals = $product->getProductTotal();\n $product_type_id = $product->getProductTypeId();\n $result[$product_type_id] = isset($result[$product_type_id]) ? \n $result[$product_type_id] + $productTotal : $productTotals;\n }\n }\n }\n\n return $result;\n } \n }", "function procesar_cadena_json($resultado, $lista_valores)\n{\n for ($i = 0; $i < $resultado[\"numcampos\"]; $i++) {\n $busqueda = $resultado[$i];\n foreach ($busqueda as $key => $valor) {\n if (is_numeric($key)) {\n unset($busqueda[$key]);\n } else if (in_array($key, $lista_valores)) {\n $busqueda[$key] = str_replace(\"\\n\", \"\", $busqueda[$key]);\n $busqueda[$key] = str_replace(\"\\r\", \"\", $busqueda[$key]);\n $busqueda[$key] = html_entity_decode($busqueda[$key]);\n $busqueda[$key] = addslashes($busqueda[$key]);\n }\n }\n $resultado[$i] = $busqueda;\n }\n return ($resultado);\n}", "public function chartData()\n {\n // Data tanggal selama 7 hari\n foreach(range(0, 7) as $day) {\n $dates[] = Carbon::now()->subDays($day)->format('yy-m-d');\n $tanggal = array_reverse($dates);\n }\n\n // Jumlah buku yang dipinjam per hari selama 1 mingggu\n foreach($tanggal as $date){\n $chartdata = Peminjaman::select(DB::raw('DATE(tanggal_pinjam) as date'))\n ->selectRaw('count(tanggal_pinjam) as jumlah')\n ->where('tanggal_pinjam', 'like', '%'.$date.'%')\n ->orderBy('tanggal_pinjam')\n ->groupBy('date')\n ->pluck('jumlah')\n ->toArray();\n\n if($chartdata){\n $jumlah[] = $chartdata[0];\n }else {\n $jumlah[] = 0;\n }\n }\n \n return response()->json([\n 'jumlah' => $jumlah,\n 'tanggal' => $tanggal\n ]);\n }", "public function annonceJson(){\n $db = $this->getPDO();\n $sql = \"SELECT * FROM annonces INNER JOIN utilisateurs ON annonces.utilisateur_id = utilisateurs.id_utilisateur INNER JOIN categories ON annonces.categorie_id = categories.id_categorie INNER JOIN regions ON annonces.regions_id = regions.id_regions\";\n $json = $db->query($sql);\n return $json;\n }", "public function getAllCommande(){\n $cmd = Bon_commande::all();\n \n foreach ($cmd as $value) {\n $fournisseur = $value->fournisseur;\n $command_article = $value->command_article;\n }\n $nb = 0;\n foreach ($cmd as $key ) {\n $nb ++;\n }\n \n return response()->json([\n 'commande' => $cmd,\n 'nb' => $nb,\n ]);\n\n }", "public function _listTotalBoletaDate() {\n $db = new SuperDataBase();\n $query = \"CALL sp_get_report_sale_pordia('$this->dateGO')\";\n $resul = $db->executeQuery($query);\n//pkComprobante, pkMesa, estado_pago, tipoComprobante, total_tarjeta, total_efectivo, descuento, total_venta, tipo_tarjeta, pkCliente, pkMozo, fechaPago, hora_entrada, hora_salida, fecha_modificacion, idUsuario, npersonas\n $array = array();\n $total = 0;\n while ($row = $db->fecth_array($resul)) {\n $array[] = array(\"pkComprobante\" => $row['pkPediido'],\n \"pkMesa\" => $row['pkMesa'],\n \"total_venta\" => $row['total'],\n \"horaEntrada\" => $row['horaEntrada'],\n \"nmesa\" => $row['nmesa'],\n \"npersonas\" => $row['npersonas'],\n// \"tcomprobante\" => $row['tipo_comprobante'],\n \"descuento\" => $row['descuento'],\n// \"totalTarjeta\" => $row['total_tarjeta'],\n );\n// $total=$total+$row['total_venta'];\n }\n// $array[]= array('Total')\n// echo $query;\n echo json_encode($array);\n }", "public function _listTotalBoletaMonth() {\n $db = new SuperDataBase();\n $query = \"CALL sp_get_total_ventas_mes('$this->dateGO')\";\n $resul = $db->executeQuery($query);\n//pkComprobante, pkMesa, estado_pago, tipoComprobante, total_tarjeta, total_efectivo, descuento, total_venta, tipo_tarjeta, pkCliente, pkMozo, fechaPago, hora_entrada, hora_salida, fecha_modificacion, idUsuario, npersonas\n $array = array();\n $total = 0;\n while ($row = $db->fecth_array($resul)) {\n $array[] = array(\"pkComprobante\" => $row['pkPediido'],\n \"pkMesa\" => $row['pkMesa'],\n \"total_venta\" => $row['total'],\n \"horaEntrada\" => $row['horaEntrada'],\n \"nmesa\" => $row['nmesa'],\n \"npersonas\" => $row['npersonas'],\n// \"tcomprobante\" => $row['tipo_comprobante'],\n \"descuento\" => $row['descuento'],\n// \"totalTarjeta\" => $row['total_tarjeta'],\n );\n// $total=$total+$row['total_venta'];\n }\n// $array[]= array('Total')\n// echo $query;\n echo json_encode($array);\n }", "function getForResumenTotGen($contrato){\n\t\t\t$tipos = array(\n\t\t\t\t0=>\"CE\",\n\t\t\t\t1=>\"DS\",\n\t\t\t\t2=>\"Q\",\n\t\t\t\t3=>\"AB\",\n\t\t\t\t4=>\"DM\",\n\t\t\t\t5=>\"M\",\n\t\t\t\t6=>\"R\",\n\t\t\t\t7=>\"D\",\n\t\t\t\t8=>\"P\",\n\t\t\t\t9=>\"PA\",\n\t\t\t\t10=>\"EL\",\n\t\t\t\t11=>\"S\",\n\t\t\t\t12=>\"CI\",\n\t\t\t\t13=>\"IP\",\n\t\t\t\t14=>\"IA\",\n\t\t\t\t15=>\"DI\",\n\t\t\t\t16=>\"IPA\",\n\t\t\t\t17=>\"E\",\n\t\t\t\t18=>\"RE\",\n\t\t\t\t19=>\"C\",\n\t\t\t\t20=>\"L\",\n\t\t\t\t21=>\"LA\",\n\t\t\t\t22=>\"I\",\n\t\t\t\t23=>\"IL\",\n\t\t\t\t24=>\"DL\",\n\t\t\t\t25=>\"DE\",\n\t\t\t\t26=>\"CB\",\n\t\t\t\t27=>\"CA\"\n\t\t\t\t);\n\t\t\t$respuesta = array();\n\t\t\tforeach ($tipos as $value) {\n\t\t\t\t$sql = \"select count(*) as total from $this->tabla \n\t\t\t\t\t\tjoin referencias\n\t\t\t\t\t\t\ton referencias.id_referencia = $this->tabla.id_referencia\n\t\t\t\t\t\tjoin areas\n\t\t\t\t\t\t\ton areas.id_area = referencias.id_area\n\t\t\t\t\t\tjoin disciplinas\n\t\t\t\t\t\t\ton disciplinas.id_disciplina = areas.id_disciplina\n\t\t\t\t\t\twhere\n\t\t\t\t\t\t\t$this->tabla.tipo_discontinuidad = '\".$value.\"' \n\t\t\t\t\t\t\tand disciplinas.id_contrato=\".$contrato.\"\n\t\t\t\t\";\n\t\t\t\t//echo $sql ;\n\t\t\t\t//echo \"<br><br>\";\n\n\t\t\t\t$resultado = $this->conexion->query($sql);\n\t\t\t\t//echo $sql ;\n\t\t\t\tif($resultado->num_rows > 0){\n\t\t\t\t\t$row=$resultado->fetch_assoc() ;\n\t\t\t\t\tif($row['total']>0){\n\t\t\t\t\t\t$respuesta[$value] = $row['total'] ;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn json_encode($respuesta) ;\n\t\t}", "function getForResumenTotInt( $contrato){\n\t\t\t$tipos = array(\n\t\t\t\t0=>\"CI\",\n\t\t\t\t1=>\"IP\",\n\t\t\t\t2=>\"IA\",\n\t\t\t\t3=>\"DI\",\n\t\t\t\t4=>\"IPA\",\n\t\t\t\t5=>\"E\",\n\t\t\t\t6=>\"RE\",\n\t\t\t\t7=>\"C\",\n\t\t\t\t8=>\"L\",\n\t\t\t\t9=>\"LA\",\n\t\t\t\t10=>\"I\",\n\t\t\t\t11=>\"IL\"\n\t\t\t\t);\n\t\t\t$respuesta = array();\n\t\t\tforeach ($tipos as $value) {\n\t\t\t\t$sql = \"select count(*) as total from $this->tabla \n\t\t\t\t\t\tjoin referencias\n\t\t\t\t\t\t\ton referencias.id_referencia = $this->tabla.id_referencia\n\t\t\t\t\t\tjoin areas\n\t\t\t\t\t\t\ton areas.id_area = referencias.id_area\n\t\t\t\t\t\tjoin disciplinas\n\t\t\t\t\t\t\ton disciplinas.id_disciplina = areas.id_disciplina\n\t\t\t\t\t\twhere\n\t\t\t\t\t\t\t$this->tabla.tipo_discontinuidad = '\".$value.\"' \n\t\t\t\t\t\t\tand disciplinas.id_contrato=\".$contrato.\"\n\t\t\t\t\";\n\n\t\t\t\t$resultado = $this->conexion->query($sql);\n\t\t\t\tif($resultado->num_rows > 0){\n\t\t\t\t\t$row=$resultado->fetch_assoc() ;\n\t\t\t\t\tif($row['total']>0){\n\t\t\t\t\t\t$respuesta[$value] = $row['total'] ;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn json_encode($respuesta) ;\n\t\t}", "public function allAsJson(){\n $itens = Item::all();\n if ($itens != null){\n $item = ['coisas' => [] ];\n foreach ($itens as $dados) {\n $item['coisas'][] = array(\n 'id' => $dados->id,\n 'nome' => $dados->nome,\n 'bonus' => $dados->bonus,\n 'valor' => $dados->valor,\n 'img' => $dados->img\n );\n }\n $json = json_encode($item);\n return response($json, 200)\n ->header('Content-type', 'application/json');\n }\n return response('Não tem vivente cadastrado', 404)\n ->header('Content-type', 'text/plain');\n }", "public function contratos_json()\n\t{\n\t\t// paginação\n\t\t$start \t= $this->input->get('iDisplayStart');\n\t\t$length = $this->input->get('iDisplayLength');\n\n\t\t// palavras chave\n\t\t$params['nidcadloc'] = ($this->input->get('nidcadloc')) ? trim($this->input->get('nidcadloc')) : NULL;\n\t\t\n\t\t$parameters = ($params) ? $params : NULL;\n\n\t\t$records = $this->Contrato_model->listar_data( 'records', $start, $length, $parameters );\n\n\t\t$count = 0;\n\t\tforeach($records as $r)\n\t\t{\n\t\t\t$records[$count]->DT_RowId = 'row_'.$r->nidcadcon;\n\t\t\t$count++;\n\t\t}\n\n\t\tdie(json_encode(array(\n\t\t\t\t'recordsTotal' => $this->Contrato_model->listar_data( 'recordsTotal', $start, $length, $params )\n\t\t\t\t,'recordsFiltered' => $this->Contrato_model->listar_data( 'recordsFiltered', $start, $length, $params )\n\t\t\t\t,'data' => $records\n\t\t\t\t)\n\t\t\t)\n\t\t);\n\n\t}", "function getForResumenTotExt( $contrato){\n\t\t\t$tipos = array(\n\t\t\t\t0=>\"CE\",\n\t\t\t\t1=>\"DS\",\n\t\t\t\t2=>\"Q\",\n\t\t\t\t3=>\"AB\",\n\t\t\t\t4=>\"DM\",\n\t\t\t\t5=>\"M\",\n\t\t\t\t6=>\"R\",\n\t\t\t\t7=>\"D\",\n\t\t\t\t8=>\"P\",\n\t\t\t\t9=>\"PA\",\n\t\t\t\t10=>\"EL\",\n\t\t\t\t11=>\"S\",\n\t\t\t\t12=>\"DL\",\n\t\t\t\t13=>\"DE\",\n\t\t\t\t14=>\"CB\",\n\t\t\t\t15=>\"CA\"\n\t\t\t\t);\n\t\t\t$respuesta = array();\n\t\t\tforeach ($tipos as $value) {\n\t\t\t\t$sql = \"select count(*) as total from $this->tabla \n\t\t\t\t\t\tjoin referencias\n\t\t\t\t\t\t\ton referencias.id_referencia = $this->tabla.id_referencia\n\t\t\t\t\t\tjoin areas\n\t\t\t\t\t\t\ton areas.id_area = referencias.id_area\n\t\t\t\t\t\tjoin disciplinas\n\t\t\t\t\t\t\ton disciplinas.id_disciplina = areas.id_disciplina\n\t\t\t\t\t\twhere\n\t\t\t\t\t\t\t$this->tabla.tipo_discontinuidad = '\".$value.\"' \n\t\t\t\t\t\t\tand disciplinas.id_contrato=\".$contrato.\"\n\t\t\t\t\";\n\n\t\t\t\t$resultado = $this->conexion->query($sql);\n\t\t\t\tif($resultado->num_rows > 0){\n\t\t\t\t\t$row=$resultado->fetch_assoc() ;\n\t\t\t\t\tif($row['total']>0){\n\t\t\t\t\t\t$respuesta[$value] = $row['total'] ;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn json_encode($respuesta) ;\n\t\t}", "public function totalDia(){\n //$conexao = $c->conexao();\n\n $sql = \" SELECT ifnull(sum(c.valor),0) as total, ifnull(sum(c.troco),0) as troco from tbpedido_pagamento c WHERE DAY(c.data_pagamento) = DAY(now()) and c.status = 'F';\";\n $rstotal = $this->conexao->query($sql);\n $result = $rstotal->fetch_array();\n $totalvendas = $result['total'];\n $totaltroco = $result['troco'];\n\n $total = array(\n 'totalvendas' => '',\n 'totaltroco' => '',\n );\n\n $total['totalvendas'] = $totalvendas;\n $total['totaltroco'] = $totaltroco;\n\n //print_r($total);\n return $total;\n\n }", "public function busquedaVacunaCostoAction(Request $request)\r\n {\r\n $id= $request->get('id');\r\n \r\n \r\n //var_dump($id);\r\n $response = new JsonResponse();\r\n $em = $this->getDoctrine()->getEntityManager();\r\n $dql = \"SELECT vac.costo as costo \"\r\n . \"FROM DGPlusbelleBundle:Vacuna vac \"\r\n . \"WHERE vac.id=:id \";\r\n \r\n $paciente['data'] = $em->createQuery($dql)\r\n ->setParameters(array('id'=>$id))\r\n \r\n ->getResult();\r\n $response->setData($paciente);\r\n return $response;\r\n }", "public function totClientesCadastrados(){\n //$conexao = $c->conexao();\n\n $sql = \"SELECT ifnull(count(*),0) as total FROM tbclientes \";\n $rsclitot = $this->conexao->query($sql);\n $result = $rsclitot->fetch_array();\n $rstotcli = $result['total'];\n\n return $rstotcli;\n }", "public function implementos(){\n \n $implementos=Implementos::all()->groupBy('llave');\n $param_array =json_decode($implementos,true);//array \n $count=count($param_array); \n\n\n for($i = 0; $i < $count; $i++){\n $array=$param_array[$i];\n $array2=$array[0];\n $auxcount=count($array);\n $array2 = array_add($array2, 'cantidad', $auxcount);\n $param_array[$i]=$array2;\n // se manejan 2 vectores aux para profundizar el param array, y luego se pone la info necesaria en el param\n \n }\n \n\n return response()->json([\n 'code' => 200,\n 'status'=> 'sucess',\n 'implementos'=> $param_array\n ]);\n }", "public function obtener_sugerencias_calle_get(){\n require_once('CustomLogger.php');\n log_message('debug', 'Dentro de obtener_sugerencias_calle_get()..... ');\n $calle = $this->get('calle');\n $cantMaxSugerencias = $this->get('cantmaxsugerencias');\n $sugerencias = Calle::buscarSugerenciasCalles($calle,$cantMaxSugerencias);\n echo json_encode($sugerencias);\n }", "function number_categories($connect)\n{\n // $total_numbers = $connect->query($sql);\n // echo json_encode($total_numbers);\n // die();\n // $total = count($total_numbers);\n // return $total;\n\n}", "public function totalColecao(){\r\n\t\t$oSicasConsultaMedicaBD = new SicasConsultaMedicaBD();\r\n\t\treturn $oSicasConsultaMedicaBD->totalColecao();\r\n\t}", "public function getQuantidadeMesesDepreciados() {\n\n if (empty($this->iQuantidadeMesesDepreciado)) {\n\n if (!empty($this->iCodigoBem)) {\n\n $oDaoBensHistoricoCalculo = db_utils::getDao(\"benshistoricocalculobem\");\n $sWhereHistorico = \" t57_ativo is true and \";\n $sWhereHistorico .= \"t57_processado is true and \";\n $sWhereHistorico .= \"t58_bens = {$this->getCodigoBem()} \";\n $sCamposHistorico = \"t58_bens, t58_benstipodepreciacao\";\n $sSqlBensHistoricoCalculo = $oDaoBensHistoricoCalculo->sql_query_calculo(null,\n $sCamposHistorico,\n \"t57_datacalculo\",\n $sWhereHistorico);\n $rsBensHistoricoCalculo = $oDaoBensHistoricoCalculo->sql_record($sSqlBensHistoricoCalculo);\n $iTotalMeses = 0;\n $iTotalDepreciacoes = $oDaoBensHistoricoCalculo->numrows;\n for ($i = 0; $i < $iTotalDepreciacoes; $i++) {\n\n $oDadosCalculo = db_utils::fieldsMemory($rsBensHistoricoCalculo, $i);\n $iTotalMeses++;\n if ($oDadosCalculo->t58_benstipodepreciacao == 6) {\n $iTotalMeses = 0;\n }\n }\n }\n $this->iQuantidadeMesesDepreciados = $iTotalMeses;\n }\n\n return $this->iQuantidadeMesesDepreciados;\n }", "public static function getResponse1013() {\n\n return '{\"indicator\":{\"name\":\"Término de facturación de energía activa del PVPC peaje por defecto\",\"short_name\":\"PVPC T. Defecto\",\"id\":1013,\"composited\":false,\"step_type\":\"linear\",\"disaggregated\":false,\"magnitud\":[{\"name\":\"Precio\",\"id\":23}],\"tiempo\":[{\"name\":\"Hora\",\"id\":4}],\"geos\":[{\"geo_id\":3,\"geo_name\":\"España\"}],\"values_updated_at\":\"2017-03-01T21:01:30.000+01:00\",\"values\":[{\"value\":116.62,\"datetime\":\"2017-03-01T00:00:00.000+01:00\",\"datetime_utc\":\"2017-02-28T23:00:00Z\",\"tz_time\":\"2017-02-28T23:00:00.000Z\",\"geo_id\":3,\"geo_name\":\"España\"},{\"value\":110.32,\"datetime\":\"2017-03-01T01:00:00.000+01:00\",\"datetime_utc\":\"2017-03-01T00:00:00Z\",\"tz_time\":\"2017-03-01T00:00:00.000Z\",\"geo_id\":3,\"geo_name\":\"España\"},{\"value\":108.17,\"datetime\":\"2017-03-01T02:00:00.000+01:00\",\"datetime_utc\":\"2017-03-01T01:00:00Z\",\"tz_time\":\"2017-03-01T01:00:00.000Z\",\"geo_id\":3,\"geo_name\":\"España\"},{\"value\":107.71,\"datetime\":\"2017-03-01T03:00:00.000+01:00\",\"datetime_utc\":\"2017-03-01T02:00:00Z\",\"tz_time\":\"2017-03-01T02:00:00.000Z\",\"geo_id\":3,\"geo_name\":\"España\"},{\"value\":107.73,\"datetime\":\"2017-03-01T04:00:00.000+01:00\",\"datetime_utc\":\"2017-03-01T03:00:00Z\",\"tz_time\":\"2017-03-01T03:00:00.000Z\",\"geo_id\":3,\"geo_name\":\"España\"},{\"value\":108.94,\"datetime\":\"2017-03-01T05:00:00.000+01:00\",\"datetime_utc\":\"2017-03-01T04:00:00Z\",\"tz_time\":\"2017-03-01T04:00:00.000Z\",\"geo_id\":3,\"geo_name\":\"España\"},{\"value\":119.5,\"datetime\":\"2017-03-01T06:00:00.000+01:00\",\"datetime_utc\":\"2017-03-01T05:00:00Z\",\"tz_time\":\"2017-03-01T05:00:00.000Z\",\"geo_id\":3,\"geo_name\":\"España\"},{\"value\":121.41,\"datetime\":\"2017-03-01T07:00:00.000+01:00\",\"datetime_utc\":\"2017-03-01T06:00:00Z\",\"tz_time\":\"2017-03-01T06:00:00.000Z\",\"geo_id\":3,\"geo_name\":\"España\"},{\"value\":119.35,\"datetime\":\"2017-03-01T08:00:00.000+01:00\",\"datetime_utc\":\"2017-03-01T07:00:00Z\",\"tz_time\":\"2017-03-01T07:00:00.000Z\",\"geo_id\":3,\"geo_name\":\"España\"},{\"value\":119.0,\"datetime\":\"2017-03-01T09:00:00.000+01:00\",\"datetime_utc\":\"2017-03-01T08:00:00Z\",\"tz_time\":\"2017-03-01T08:00:00.000Z\",\"geo_id\":3,\"geo_name\":\"España\"},{\"value\":118.97,\"datetime\":\"2017-03-01T10:00:00.000+01:00\",\"datetime_utc\":\"2017-03-01T09:00:00Z\",\"tz_time\":\"2017-03-01T09:00:00.000Z\",\"geo_id\":3,\"geo_name\":\"España\"},{\"value\":117.2,\"datetime\":\"2017-03-01T11:00:00.000+01:00\",\"datetime_utc\":\"2017-03-01T10:00:00Z\",\"tz_time\":\"2017-03-01T10:00:00.000Z\",\"geo_id\":3,\"geo_name\":\"España\"},{\"value\":113.84,\"datetime\":\"2017-03-01T12:00:00.000+01:00\",\"datetime_utc\":\"2017-03-01T11:00:00Z\",\"tz_time\":\"2017-03-01T11:00:00.000Z\",\"geo_id\":3,\"geo_name\":\"España\"},{\"value\":114.1,\"datetime\":\"2017-03-01T13:00:00.000+01:00\",\"datetime_utc\":\"2017-03-01T12:00:00Z\",\"tz_time\":\"2017-03-01T12:00:00.000Z\",\"geo_id\":3,\"geo_name\":\"España\"},{\"value\":113.76,\"datetime\":\"2017-03-01T14:00:00.000+01:00\",\"datetime_utc\":\"2017-03-01T13:00:00Z\",\"tz_time\":\"2017-03-01T13:00:00.000Z\",\"geo_id\":3,\"geo_name\":\"España\"},{\"value\":111.74,\"datetime\":\"2017-03-01T15:00:00.000+01:00\",\"datetime_utc\":\"2017-03-01T14:00:00Z\",\"tz_time\":\"2017-03-01T14:00:00.000Z\",\"geo_id\":3,\"geo_name\":\"España\"},{\"value\":107.47,\"datetime\":\"2017-03-01T16:00:00.000+01:00\",\"datetime_utc\":\"2017-03-01T15:00:00Z\",\"tz_time\":\"2017-03-01T15:00:00.000Z\",\"geo_id\":3,\"geo_name\":\"España\"},{\"value\":110.25,\"datetime\":\"2017-03-01T17:00:00.000+01:00\",\"datetime_utc\":\"2017-03-01T16:00:00Z\",\"tz_time\":\"2017-03-01T16:00:00.000Z\",\"geo_id\":3,\"geo_name\":\"España\"},{\"value\":116.76,\"datetime\":\"2017-03-01T18:00:00.000+01:00\",\"datetime_utc\":\"2017-03-01T17:00:00Z\",\"tz_time\":\"2017-03-01T17:00:00.000Z\",\"geo_id\":3,\"geo_name\":\"España\"},{\"value\":120.51,\"datetime\":\"2017-03-01T19:00:00.000+01:00\",\"datetime_utc\":\"2017-03-01T18:00:00Z\",\"tz_time\":\"2017-03-01T18:00:00.000Z\",\"geo_id\":3,\"geo_name\":\"España\"},{\"value\":121.13,\"datetime\":\"2017-03-01T20:00:00.000+01:00\",\"datetime_utc\":\"2017-03-01T19:00:00Z\",\"tz_time\":\"2017-03-01T19:00:00.000Z\",\"geo_id\":3,\"geo_name\":\"España\"},{\"value\":123.15,\"datetime\":\"2017-03-01T21:00:00.000+01:00\",\"datetime_utc\":\"2017-03-01T20:00:00Z\",\"tz_time\":\"2017-03-01T20:00:00.000Z\",\"geo_id\":3,\"geo_name\":\"España\"},{\"value\":121.9,\"datetime\":\"2017-03-01T22:00:00.000+01:00\",\"datetime_utc\":\"2017-03-01T21:00:00Z\",\"tz_time\":\"2017-03-01T21:00:00.000Z\",\"geo_id\":3,\"geo_name\":\"España\"},{\"value\":120.44,\"datetime\":\"2017-03-01T23:00:00.000+01:00\",\"datetime_utc\":\"2017-03-01T22:00:00Z\",\"tz_time\":\"2017-03-01T22:00:00.000Z\",\"geo_id\":3,\"geo_name\":\"España\"},{\"value\":123.3,\"datetime\":\"2017-03-02T00:00:00.000+01:00\",\"datetime_utc\":\"2017-03-01T23:00:00Z\",\"tz_time\":\"2017-03-01T23:00:00.000Z\",\"geo_id\":3,\"geo_name\":\"España\"}]}}';\n }", "public function retornaQuantPorTurma() {\n $sql = \"select aluno.turma_id, turma.nome, COUNT(aluno.turma_id) AS Qtd from turma inner join aluno on turma.id = aluno.turma_id \n GROUP BY aluno.turma_id, turma.nome HAVING COUNT(aluno.turma_id) > 0 ORDER BY COUNT(aluno.turma_id) ASC\";\n $insert = $this->conexao->query($sql);\n $array = array();\n foreach ($insert as $aluno) {\n array_push($array, $aluno);\n }\n return $array;\n }", "public function getSumas() {\n $aVot = $this->votos;\n $aCoe = $this->coeficientes;\n \n $asis = 0; $vots = 0; $votn = 0; $pres = 0;\n $opc1 = 0; $opc2 = 0; $opc3 = 0; $opc4 = 0;\n $urb1 = 0; $urb2 = 0; $urb3 = 0; $urb4 = 0;\n $fas1 = 0; $fas2 = 0; $fas3 = 0; $fas4 = 0;\n $blo1 = 0; $blo2 = 0; $blo3 = 0; $blo4 = 0;\n \n foreach ($aVot as $apa => $aDat) {\n $asis += ($aDat[0] == 'S') ? 1 : 0;\n $vots += ($aDat[1] == 'S') ? 1 : 0;\n $votn += ($aDat[1] == 'S') ? 0 : 1;\n $pres += ($aDat[2] == 'S') ? 1 : 0;\n \n $opc1 += ($aDat[3] == 'S') ? 1 : 0;\n $opc2 += ($aDat[4] == 'S') ? 1 : 0;\n $opc3 += ($aDat[5] == 'S') ? 1 : 0;\n $opc4 += ($aDat[6] == 'S') ? 1 : 0;\n \n $urb1 += ($aDat[3] == 'S') ? $aCoe[$apa][0] : 0;\n $urb2 += ($aDat[4] == 'S') ? $aCoe[$apa][0] : 0;\n $urb3 += ($aDat[5] == 'S') ? $aCoe[$apa][0] : 0;\n $urb4 += ($aDat[6] == 'S') ? $aCoe[$apa][0] : 0;\n \n $fas1 += ($aDat[3] == 'S') ? $aCoe[$apa][1] : 0;\n $fas2 += ($aDat[4] == 'S') ? $aCoe[$apa][1] : 0;\n $fas3 += ($aDat[5] == 'S') ? $aCoe[$apa][1] : 0;\n $fas4 += ($aDat[6] == 'S') ? $aCoe[$apa][1] : 0;\n \n $blo1 += ($aDat[3] == 'S') ? $aCoe[$apa][2] : 0;\n $blo2 += ($aDat[4] == 'S') ? $aCoe[$apa][2] : 0;\n $blo3 += ($aDat[5] == 'S') ? $aCoe[$apa][2] : 0;\n $blo4 += ($aDat[6] == 'S') ? $aCoe[$apa][2] : 0;\n }\n $aSumas['asis'] = array($asis, $vots, $votn, $pres);\n $aSumas['opci'] = array($opc1, $opc2, $opc3, $opc4);\n $aSumas['urba'] = array($urb1, $urb2, $urb3, $urb4);\n $aSumas['fase'] = array($fas1, $fas2, $fas3, $fas4);\n $aSumas['bloq'] = array($blo1, $blo2, $blo3, $blo4);\n \n return $aSumas;\n }", "public function getArticulos() {\r\n\t\t$gerencia = $this->input->post('_gerencia');\r\n\t\techo json_encode($this->articulos_model->buscar(NULL, NULL, NULL, $gerencia, NULL));\r\n\t}", "function pegaCadastrosJson(){\n $arquivo = file_get_contents('json/cadastros.json');//arquivo Json que será pego\n $GLOBALS['cadastros'] = json_decode($arquivo);//salva no array global cadastros os cadastros\n $cadastrosLocal = $GLOBALS['cadastros'];\n }", "public function listarChikera($codigo){\n $lista_detalles = array();\n $listDetalle= $this->empresa_model->listChikera($codigo);\n if(count($listDetalle)>0){ \n foreach ($listDetalle as $key => $value) {\n $objeto = new stdClass();\n $objeto->CHEK_Codigo =$value->CHEK_Codigo;\n $objeto->CUENT_NumeroEmpresa =$value->CUENT_NumeroEmpresa;\n $objeto->CHEK_FechaRegistro =mysql_to_human($value->CHEK_FechaRegistro);\n $objeto->SERIP_Codigo =$value->SERIP_Codigo;\n $objeto->CHEK_Numero=$value->CHEK_Numero;\n $lista_detalles[] = ($objeto);\n }\n $resultado[] = array();\n $resultado = json_encode($lista_detalles,JSON_NUMERIC_CHECK);\n echo $resultado; \n } \n }", "public function contmes()\n {\n $partidosmes=PartidoCalendario::with(\"EquipoCasaNombre\",\"EquipoVisitaNombre\",\"NombreLiga\")->orderBy('fecha_partido','ASC')->orderBy('hora_partido','ASC')->where('fecha_partido','>=',Carbon::today())->where('fecha_partido','<=',Carbon::today()->endOfMonth())->count();\n \n return response()->json(['datos' => $partidosmes],200);\n }", "public function totCadastrosMes(){\n //$conexao = $c->conexao();\n\n $sql = \"SELECT ifnull(count(*),0) as total FROM tbclientes a WHERE MONTH(a.data_cadastro) = Month(now());\";\n $rsclimes = $this->conexao->query($sql);\n $result = $rsclimes->fetch_array();\n $rstotclimes = $result['total'];\n\n return $rstotclimes;\n }", "public function getCartera() {\n\n $result = Array(\n \"opc\" => $this->miempresa->getCartera()\n );\n\n $this->output->set_content_type('application/json')->set_output(json_encode($result));\n }", "function buscarContatos($nome) {\n require_once('../modulo/config.php');\n\n //Import do arquivo de função para conectar no BD \n require_once('conexaoMysql.php');\n\n if(!$conex = conexaoMysql())\n {\n echo(\"<script> alert('\".ERRO_CONEX_BD_MYSQL.\"'); </script>\");\n //die; //Finaliza a interpretação da página\n }\n\n $sql = \"select tblContatos.*, tblEstados.sigla from tblContatos, tblEstados where tblContatos.idEstado = tblEstados.idEstado and statusContato = 1 and tblContatos.nome like '%\".$nome.\"%'\";\n\n $select = mysqli_query($conex, $sql);\n \n while($rsContatos = mysqli_fetch_assoc($select)) {\n //varios itens para o json\n $dados[] = array (\n // => - o que alimenta o dado de um array\n 'idContato' => $rsContatos['idContato'],\n 'nome' => $rsContatos['nome'],\n 'celular' => $rsContatos['celular'],\n 'email' => $rsContatos['email'],\n 'idEstado' => $rsContatos['idEstado'],\n 'sigla' => $rsContatos['sigla'],\n 'dataNascimento' => $rsContatos['dataNascimento'],\n 'sexo' => $rsContatos['sexo'],\n 'obs' => $rsContatos['obs'],\n 'foto' => $rsContatos['foto'],\n 'statusContato' => $rsContatos['statusContato']\n\n ); \n } \n\n //faça um header para dados importantes\n // $headerDados = array (\n // 'status' => 'success',\n // 'data' => date('d-m-y'),\n // 'contatos' => $dados\n // );\n if (isset($dados))\n $listContatosJson = convertJson($dados);\n else \n false;\n //verificar se foi gerado um arquivo json\n if (isset($listContatosJson)) \n return $listContatosJson;\n else\n return false;\n }", "public function sumaCategoria(Request $request)\n {\n $data = json_decode($request->getContent(), true);\n $resp = DB::select('call PFC_S_SUMA_CATEGORIA(?,?,?)', [$data['anio'], $data['mes'], $data['idTabla']]);\n return $resp;\n }", "public function getQuantidadePaginas(){\n return $this->qtdPaginas;\n }", "function StatistikPie($id, Request $request)\n {\n\n // for ($x = 0; $x < count($data_penghuni); $x++) {\n // $temp_data = Penghuni::where('id_kost', $request->id_kost)->where('kelamin', $data_penghuni[$x]->kelamin)->get();\n // $data_penghuni[$x]->value = count($temp_data);\n // }\n\n // $data_provinsi = Penghuni::select('provinsi')->where('id_kost', $request->id_kost)->distinct()->get();\n // for ($x = 0; $x < count($data_provinsi); $x++) {\n // $temp_data = Penghuni::where('id_kost', $request->id_kost)->where('provinsi', $data_provinsi[$x]->provinsi)->get();\n // $data_provinsi[$x]->value = count($temp_data);\n // }\n\n // $data_kota = Penghuni::select('kota')->where('id_kost', $request->id_kost)->distinct()->get();\n // for ($x = 0; $x < count($data_kota); $x++) {\n // $temp_data = Penghuni::where('id_kost', $request->id_kost)->where('kota', $data_kota[$x]->kota)->get();\n // $data_kota[$x]->value = count($temp_data);\n // }\n\n // $ayaya = Penghuni::select('kelamin', DB::raw('count(kelamin) quantity'))->groupBy('kelamin')->get();\n $data_penghuni = Penghuni::select('kelamin', DB::raw('count(kelamin) quantity'))->where('id_kost', $id)->where('active', TRUE)->orderByDesc('quantity')->groupBy('kelamin')->get();\n // $provcount = Penghuni::select('provinsi', DB::raw('count(provinsi) quantity'))->orderByDesc('quantity')->groupBy('provinsi')->get();\n // $data_provinsi = Penghuni::select('provinsi', DB::raw('count(provinsi) quantity'))->orderByDesc('quantity')->groupBy('provinsi')->get();\n $data_provinsi = DB::table('penghuni')\n ->join('provinces', 'provinces.id', '=', 'penghuni.provinsi')\n ->where('penghuni.id_kost', $id)\n ->where('penghuni.active', TRUE)\n ->select('penghuni.provinsi as id', 'provinces.name as nama', DB::raw('count(penghuni.provinsi) quantity'))->orderByDesc('quantity')->groupBy('penghuni.provinsi')\n ->get();\n\n $data_kota = DB::table('penghuni')\n ->join('regencies', 'regencies.id', '=', 'penghuni.kota')\n ->where('penghuni.id_kost', $id)\n ->where('penghuni.active', TRUE)\n ->select('penghuni.kota as id', 'regencies.name as nama', DB::raw('count(penghuni.kota) quantity'))->orderByDesc('quantity')->groupBy('penghuni.kota')\n ->get();\n\n\n // $data_kota = Penghuni::select('kota', DB::raw('count(kota) quantity'))->orderByDesc('quantity')->groupBy('kota')->get();\n\n // if (count($data_provinsi) > 4) {\n // for ($x = 3; $x < count($data_provinsi) - 1; $x++) {\n // unset($data_provinsi[$x]);\n // }\n // }\n // array_splice($array, 1, 1);\n // unset($provcount[2]);\n\n return response()->json([\n \"message\" => \"Putang Ina\",\n \"data\" => \"Pakyoo\",\n // \"penghuni\" => $data_peghuni,\n \"penghuni\" => $data_penghuni,\n \"provinsi\" => $data_provinsi,\n \"kota\" => $data_kota,\n // \"coba\" => $ayaya,\n // \"provcount\" => $provcount\n ]);\n }", "public function verificarCarnet($ci){\n $verificar=DB::select('SELECT *,COUNT(*)as contador from cliente where ci='.$ci);\n return response()->json($verificar);\n\n }", "public function count()\r\n\t{\r\n//\t\techo json_encode($this->db->query_first($sql));\r\n\t\techo json_encode(array('total'=>30));\r\n\t}", "public function cargarEstados()\r\n {\r\n \r\n $data = $this->cargar_model->cargarEstados();\r\n\r\n print_r(json_encode($data)); \r\n \r\n }", "public function getJsonBroDeployOverseas(){\n\t\t$query = \"Select BroDeployOverseas.post, Sum(bandwidth.capacity) as capacity, BroDeployOverseas.regularworkstation, BroDeployOverseas.regworkdeployed, BroDeployOverseas.regworkremaining,\n\t\t\tBroDeployOverseas.latitude, BroDeployOverseas.longitude, BroDeployOverseas.regworkpercentcompleted, BroDeployOverseas.vsenpercentcompleted,\n\t\t\tBroDeployOverseas.region, BroDeployOverseas.vsencompatableworkstation, BroDeployOverseas.vsendeployed, BroDeployOverseas.vsenremaining\n\t\t\tFrom public.BroDeployOverseas, public.bandwidth\n\t\t\tWhere BroDeployOverseas.post = bandwidth.post\n\t\t\tGroup By BroDeployOverseas.post, BroDeployOverseas.region, \n\t\t\tBroDeployOverseas.regworkpercentcompleted, BroDeployOverseas.vsenpercentcompleted, \n\t\t\tBroDeployOverseas.regularworkstation, BroDeployOverseas.regworkdeployed, BroDeployOverseas.regworkremaining,\n\t\t\tBroDeployOverseas.vsencompatableworkstation,\n\t\t\tBroDeployOverseas.vsendeployed, BroDeployOverseas.vsenremaining,\n\t\t\tBroDeployOverseas.latitude, BroDeployOverseas.longitude; \n\t\t\"; // There might be a better way to do this.\n\t\t$result = $this->connectPG($query);\t\t\t\n\t\t$rows = pg_fetch_all($result);\t\n\n\t\t$jsonArrayOfObjs = \"[\";\n\t\tforeach($rows as $keys => $datums){\n\t\t\t//Build JSON string\n\t\t\t$rows2 = array_keys($rows);\n\t\t\tif(end($rows2) == $keys){\n\t\t\t\t//This will be the last element in the array of objects\n\t\t\t\t$jsonArrayOfObjs .= \"{\";\n\t\t\t \t$jsonArrayOfObjs .= \"\\\"region\\\":\\\"\".trim($datums['region']).\"\\\", \\\"post\\\":\\\"\".trim($datums['post']).\"\\\",\"; \n\t\t\t \t$jsonArrayOfObjs .= \"\\\"regularworkstation\\\":\".$datums['regularworkstation'].\", \\\"regworkdeployed\\\":\".$datums['regworkdeployed'].\",\";\n\t\t\t \t$jsonArrayOfObjs .= \"\\\"regworkremaining\\\":\".$datums['regworkremaining'].\", \\\"regworkpercentcompleted\\\":\".$datums['regworkpercentcompleted'].\",\";\n\t\t\t \t$jsonArrayOfObjs .= \"\\\"vsencompatableworkstation\\\":\".$datums['vsencompatableworkstation'].\", \\\"vsendeployed\\\":\".$datums['vsendeployed'].\",\";\n\t\t\t \t$jsonArrayOfObjs .= \"\\\"vsenremaining\\\":\".$datums['vsenremaining'].\", \\\"vsenpercentcompleted\\\":\".$datums['vsenpercentcompleted'].\", \\\"capacity\\\":\".$datums['capacity'].\",\";\n\t\t\t \t$jsonArrayOfObjs .= \"\\\"latitude\\\":\".$datums['latitude'].\", \\\"longitude\\\":\".$datums['longitude'].\"\";\n\t\t \t$jsonArrayOfObjs .= \"}\";\n\t\t\t}else{\n\t\t\t\t$jsonArrayOfObjs .= \"{\";\n\t\t\t \t\t$jsonArrayOfObjs .= \"\\\"region\\\":\\\"\".trim($datums['region']).\"\\\", \\\"post\\\":\\\"\".trim($datums['post']).\"\\\",\"; \n\t\t\t \t$jsonArrayOfObjs .= \"\\\"regularworkstation\\\":\".$datums['regularworkstation'].\", \\\"regworkdeployed\\\":\".$datums['regworkdeployed'].\",\";\n\t\t\t \t$jsonArrayOfObjs .= \"\\\"regworkremaining\\\":\".$datums['regworkremaining'].\", \\\"regworkpercentcompleted\\\":\".$datums['regworkpercentcompleted'].\",\";\n\t\t\t \t$jsonArrayOfObjs .= \"\\\"vsencompatableworkstation\\\":\".$datums['vsencompatableworkstation'].\", \\\"vsendeployed\\\":\".$datums['vsendeployed'].\",\";\n\t\t\t \t$jsonArrayOfObjs .= \"\\\"vsenremaining\\\":\".$datums['vsenremaining'].\", \\\"vsenpercentcompleted\\\":\".$datums['vsenpercentcompleted'].\", \\\"capacity\\\":\".$datums['capacity'].\",\";\n\t\t\t \t$jsonArrayOfObjs .= \"\\\"latitude\\\":\".$datums['latitude'].\", \\\"longitude\\\":\".$datums['longitude'].\"\";\n\t\t \t$jsonArrayOfObjs .= \"},\";\n\t\t\t}\n\n\t\t} \n\t\t$jsonArrayOfObjs .= \"]\"; \n\t\t//error_log($jsonArrayOfObjs);\n\n\t\t$cleanJsonStr = json_decode($jsonArrayOfObjs);\n\n\t\t//Validate the JSON\n\t\tif($cleanJsonStr === NULL){error_log(\"Error in JSON in getJsonBroDeployOverseas() method.\"); }else{return $jsonArrayOfObjs;}\n\t}", "public function obtener_info_adicional_get(){\n require_once('CustomLogger.php');\n CustomLogger::log('Dentro de obtener_tipos_falla_get()...');\n $data = TipoMaterial::getTiposMaterialYCriticidad();\n echo json_encode($data);\n }", "function getMunicipiosCuencaEstacionClimatologica($query)\n{\n $EstacionClimatologica = new EstacionClimatologica();\n echo json_encode($EstacionClimatologica->getMunicipiosCuenca($query));\n}", "public function testTotalMensalidade()\n {\n $res = (new Client())->request(\n 'GET',\n self::ROUTE_API_TOTAL_MENSALIDADE,\n [\n 'headers' => [\n 'Authorization' => env(\"PERSONAL_AUTH_KEY\"),\n 'Accept' => 'application/json'\n ]\n ]\n );\n $totalMensalidade = json_decode((string) $res->getBody());\n $this->assertGreaterThan(0, $totalMensalidade->total);\n }", "public function accionIndex(){\n $obJson = json_decode(file_get_contents('php://input'), true);//String JSON ----> ARRAY ASOCIATIVO\n \n \n $opinionUsu = intval($obJson[\"votoUsu\"]);\n $codMensaje = intval($obJson[\"codMensaje\"]);\n $codUsuario = Sistema::app()->ACL()->getCodUsu(Sistema::app()->acceso()->getNick());\n \n \n \n $vComentario = new valoracion_comentarios();\n \n $vComentario->cod_usuario = $codUsuario;\n $vComentario->cod_comentario = $codMensaje;\n $vComentario->opinion = $opinionUsu;\n $vComentario->reportado = 0;\n $vComentario->cod_valoracion = 1;\n \n if($vComentario->validar()){\n \n if(!$vComentario->guardar()){\n $respuestaJson[\"insertado\"] = \"n\";\n }\n else{\n $respuestaJson[\"insertado\"] = \"y\";\n }\n }\n \n \n }", "public function busquedaInsumos(){\n\n $result=$this->ComplementosModel->busquedaComplementos(\n $this->input->post_get('codigo'),\n $this->id_tipo_insumos\n );\n \n $this->output\n ->set_content_type('application/json')\n ->set_output(json_encode($result));\n }", "public function pegaDescProdutos($referencia){\n //$conexao = $c->conexao();\n\n $sql = \"SELECT c.referencia,c.descricao,c.preco,c.habilitado,c.estoque,c.imagem FROM tbproduto c where c.referencia = '$referencia' and c.habilitado = 'S'\";\n $sql = $this->conexao->query($sql);\n $row = $sql->fetch_array();\n\n $preco = $row['preco'];\n $descricao = $row['descricao'];\n $estoque = $row['estoque'];\n $imagem = $row['imagem'];\n\n $ar = array(\n 'referencia'=>$referencia,\n 'preco'=>$preco,\n 'descricao'=>$descricao,\n 'estoque' => $estoque,\n 'imagem' => $imagem\n );\n \n\n echo json_encode($ar);\n\n }", "function buscarCenso()\r\n {\r\n $data = $this->input->post('data');\r\n log_message('DEBUG', '#censo #buscarCensos'.$data);\r\n $rsp = $this->Censos->buscarCensos($data)->censos->censo;\r\n echo json_encode($rsp);\r\n }", "function contaNumeroCadastros(){\n if ($GLOBALS['cadastros'] == null) {//se não tiver nenhum cadastro\n $GLOBALS['quantidadeCadastros'] = 0;//numero de pessoas cadastradas = 0\n }else{\n $GLOBALS['quantidadeCadastros'] = count($GLOBALS['cadastros']);//salva na variavel global quantidadeCadastros o número de cadastros\n }\n }", "public function cargarTipoCosto() {\n $tipoCosto = TipoCosto::all(['id','nombre']);\n return response()->json([\n 'tipoCosto'=>$tipoCosto\n ]);\n }", "public function SumarEgresosCajas() \n{\n\tself::SetNames();\n\t$sql = \"select sum(montomovimientocaja) as totalegresos from movimientoscajas where tipomovimientocaja = 'EGRESO' AND codcaja = ? AND DATE_FORMAT(fechamovimientocaja,'%Y-%m-%d') >= ? AND DATE_FORMAT(fechamovimientocaja,'%Y-%m-%d') <= ?\";\n\t$stmt = $this->dbh->prepare($sql);\n\t$stmt->bindValue(1, trim($_GET['codcaja']));\n\t$stmt->bindValue(2, trim(date(\"Y-m-d\",strtotime($_GET['desde']))));\n\t$stmt->bindValue(3, trim(date(\"Y-m-d\",strtotime($_GET['hasta']))));\n\t$stmt->execute();\n\t$num = $stmt->rowCount();\n\tif($num==0)\n\t{\n\t\techo \"\";\n\t\texit;\n\t}\n\telse\n\t{\n\t\tif($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t{\n\t\t\t\t$this->p[] = $row;\n\t\t\t}\n\t\t\treturn $this->p;\n\t\t\t$this->dbh=null;\n\t\t}\n\t}", "public function TotalPostsCountStat() {\n $json = file_get_contents(URLROOT.'/Pages/RegisterJWT');\n $obj = json_decode($json);\n $responseAccessToken=$obj->access_token;\n //now use this access token for call json endpoint\n $url = URLROOT.'/Posts/GETAll';\n $data = array(\"access_token\" => $responseAccessToken);\n $ch = curl_init($url);\n curl_setopt($ch, CURLOPT_POSTFIELDS, $data);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n $result = curl_exec($ch); \n curl_close($ch);\n \n //echo $result;\n $postsObj = json_decode($result);\n $totalPostsCount=count($postsObj);\n\n // Headers\n header('Access-Control-Allow-Origin: *');\n header('Content-Type: application/json');\n // set response code - 200 \n http_response_code(200);\n\n // tell the user no products found\n echo json_encode(\n array(\"Total Posts\" => $totalPostsCount)\n );\n }", "public function totalColecao(){\r\n\t\t$oSicasSalarioMinimoBD = new SicasSalarioMinimoBD();\r\n\t\treturn $oSicasSalarioMinimoBD->totalColecao();\r\n\t}", "function total_interaction()\n\t{\n\t\t$city_id = $this->input->post('city_id');\n\t\t$province_id = $this->input->post('province_id');\n\t\t$start_date = $this->input->post('start_date');\n\t\t$end_date = $this->input->post('end_date');\n\t\t//$var_id = $this->input->post('variant_id');\n\t\t//$product_id = 4;$city_id = 0;$province_id = 0;$start_date = 0;$end_date = 0;\n\t\t//print_r($city_id); // update by winni 17 10 2016\n\t\t$product_id = $this->input->post('product_id'); // update by Gia 2015-09-04\n\t\t\n\t\t$var = $this->db->get_where('variant', array('product_id' => $product_id))->result();\n\t\t$this->db->select(\"COUNT(*) as total\", FALSE);\n\t\t$this->analytics->total_interaction_raw($var, $province_id, $city_id, $start_date, $end_date);\n\t\t$res = $this->db->get()->first_row();\n\t\t\n\t\theader(\"Content-Type: application/json\");\n\t\tprint_r(json_encode(array('total' => $res->total)));\n\t}", "public function conthoy()\n {\n $partidoshoy=PartidoCalendario::with(\"EquipoCasaNombre\",\"EquipoVisitaNombre\",\"NombreLiga\")->orderBy('hora_partido','ASC')->where('fecha_partido','=',Carbon::today())->count();\n return response()->json(['datos' => $partidoshoy],200);\n }", "public static function getQtdTotalIngressos()\n {\n $conteudo = self::getConteudo();\n return $conteudo->sum('quantidade');\n }", "function get_total_gifts(){\n $gifts = json_decode(file_get_contents(\"https://wsapi.bethel.edu/roar/total-gifts\"));\n //print_r($gifts);\n $total = $gifts->{'result'}[0][0];\n $total = number_format($total); // implode array with comma\n return \"$$total\";\n}", "public function contsemana()\n {\n $partidos=PartidoCalendario::with(\"EquipoCasaNombre\",\"EquipoVisitaNombre\",\"NombreLiga\")->orderBy('fecha_partido','ASC')->orderBy('hora_partido','ASC')->where('fecha_partido','>=',Carbon::today())->where('fecha_partido','<=',Carbon::today()->endOfWeek())->count();\n \n return response()->json(['datos' => $partidos],200);\n \n }", "function AgregarCargaGeneral($param){\n extract($param);\n $rs = null;\n $IdUsuario = $_SESSION['idUsuario'];\n $conexion->getPDO()->query(\"SET NAMES 'utf8'\");\n $fechaActual= date('Y-m-d');\n $sql = \"CALL SPAGREGARCARGAMASIVAGENERAL($tipoCarga, '$fechaActual' ,'$Observaciones','$IdUsuario');\";\n if ($rs = $conexion->getPDO()->query($sql)) {\n if ($filas = $rs->fetchAll(PDO::FETCH_ASSOC)) {\n foreach ($filas as $fila) {\n $array[] = $fila;\n }\n }\n } else {\n $array = 0;\n }\n echo json_encode($array);\n }", "static public function mdlSumaTotales($tabla, $item, $valor, $cerrado, $fechacutvta){\t\n\t$campo=\"id_caja\";\n\t$rsp=array();\n\t\n\t$ventas=self::mdlSumaTotalVentas($tabla, $item, $valor, $cerrado, $fechacutvta);\n\t$ventasgral=$ventas[\"sinpromo\"]>0?$ventas[\"sinpromo\"]:0;\n\t$ventaspromo=$ventas[\"promo\"]>0?$ventas[\"promo\"]:0;\n\t$sumaventasgral=$ventasgral+$ventaspromo;\n\t//array_push($rsp, \"ventasgral\", $sumaventasgral);\n\t$rsp[\"ventasgral\"]=$sumaventasgral; // Se crea la key \n\n\t$vtaEnv = self::mdlSumTotVtasEnv($tabla, $item, $valor, $cerrado,$fechacutvta);\n\t$ventasenvases=$vtaEnv[\"total\"]>0?$vtaEnv[\"total\"]:0;\n\t//array_push($rsp, \"ventasenvases\", $ventasenvases);\n\t$rsp[\"ventasenvases\"]=$ventasenvases; // Se crea la key \n\n\t$vtaServ = self::mdlSumTotVtasServ($tabla, $item, $valor, $cerrado,$fechacutvta);\n\t$ventasservicios=$vtaServ[\"total\"]>0?$vtaServ[\"total\"]:0;\n\t//array_push($rsp, \"ventaservicios\", $ventasservicios);\n\t$rsp[\"ventaservicios\"]=$ventasservicios; // Se crea la key \n\t\t\t\t\t \n\t$ventasaba=self::mdlSumTotVtasOtros($tabla, $item, $valor, $cerrado,$fechacutvta);\n\t$ventasgralaba=$ventasaba[\"sinpromo\"]>0?$ventasaba[\"sinpromo\"]:0;\n\t$ventaspromoaba=$ventasaba[\"promo\"]>0?$ventasaba[\"promo\"]:0;\n\t$ventasabarrotes=$ventasgralaba+$ventaspromoaba;\n\t//array_push($rsp, \"ventasabarrotes\", $ventasabarrotes);\n\t$rsp[\"ventasabarrotes\"]=$ventasabarrotes; // Se crea la key \n\n\t$vtaCred = self::mdlSumTotVtasCred($tabla, $item, $valor, $cerrado,$fechacutvta);\n\t$ventascredito=$vtaCred[\"sinpromo\"]+$vtaCred[\"promo\"]>0?$vtaCred[\"sinpromo\"]+$vtaCred[\"promo\"]:0;\n\t//array_push($rsp, \"ventascredito\", $ventascredito);\n\t$rsp[\"ventascredito\"]=$ventascredito; // Se crea la key \n\n\t$totingyegr=self::mdlTotalingresoegreso($campo, $valor, $cerrado, $fechacutvta);\n\t$ingresodia=$totingyegr[\"monto_ingreso\"]>0?$totingyegr[\"monto_ingreso\"]:0;\n\t//array_push($rsp, \"ingresodia\", $ingresodia);\n\t$rsp[\"ingresodia\"]=$ingresodia; // Se crea la key \n\t$egresodia=$totingyegr[\"monto_egreso\"]>0?$totingyegr[\"monto_egreso\"]:0;\n\t//array_push($rsp, \"egresodia\", $egresodia);\n\t$rsp[\"egresodia\"]=$egresodia; // Se crea la key \n\n\t$totVentaDia=$ventasgral+$ventaspromo+$ventasenvases+$ventasservicios+$ventasgralaba+$ventaspromoaba+$ventascredito;\n\t//array_push($rsp, \"totalventadia\", $totVentaDia);\n\t$rsp[\"totalventadia\"]=$totVentaDia; // Se crea la key \n\n\treturn $rsp;\n \n}", "private function MetodoDeRetornoValoresJSOM(){\n\t\t\n\t\t// Cria um array com os dados.\n\t\t$out = array(\n\t\t\t'dataAdmissao'=>date('d/m/Y', strtotime($this->DataAdmissao)),\n\t\t\t'diasTrabalhado'=>$this->DiasTrabalhado,\n\t\t\t'salarioFuncionario'=>number_format($this->SalarioFuncionario, 2, ',', '.'),\n\t\t\t'salario'=>number_format($this->Salario, 2, ',', '.'),\n\t\t\t'feriasId'=>$this->FeriasId,\n\t\t\t'diasFerias'=>$this->DiasFerias,\n\t\t\t'valorFerias'=>number_format($this->ValorFerias, 2, ',', '.'),\n\t\t\t'valorUmTercoFerias'=>number_format($this->ValorUmTercoFerias, 2, ',', '.'),\n\t\t\t'vendaUmTercoFerias'=>$this->VendaUmTercoFerias,\n\t\t\t'valorFeriasVendida'=>number_format($this->ValorFeriasVendida, 2, ',', '.'),\n\t\t\t'valorUmTercoFeriasVendida'=>number_format($this->ValorUmTercoFeriasVendida, 2, ',', '.'),\t\t\t\n\t\t\t'aliquotaIRFerias'=>$this->AliquotaIRFerias,\n\t\t\t'valorIRFerias'=>number_format($this->ValorIRFerias, 2, ',', '.'),\n\t\t\t'salarioBruto'=>number_format($this->SalarioBruto, 2, ',', '.'),\n\t\t\t'totalVencimentos'=>number_format($this->TotalVencimentos, 2, ',', '.'),\n\t\t\t'valorIR'=>number_format($this->ValorIR, 2, ',', '.'),\n\t\t\t'aliquotaIR'=>$this->AliquotaIR,\n\t\t\t'faixaIR'=>$this->Faixa,\n\t\t\t'valorInss'=>number_format($this->ValorINSS, 2, ',', '.'),\n\t\t\t'porcentagemInss'=>$this->PorcentagemInss,\n\t\t\t'valorSecundarioINSS'=>number_format($this->ValorSecundarioINSS, 2, ',', '.'),\n\t\t\t'porcSecundarioInss'=>$this->PorcSecundarioInss,\t\t\t\n\t\t\t'numDependentes'=>$this->NumDependentes,\n\t\t\t'descontoDep'=>number_format($this->DescontoDep, 2, ',', '.'),\n\t\t\t'valorPensao'=>number_format($this->ValorPensao, 2, ',', '.'),\n\t\t\t'porcPensao'=>$this->PorcentagemPensao,\n\t\t\t'valeTransporte'=>number_format($this->ValorValetran, 2, ',', '.'),\n\t\t\t'valeTransportePorc'=>$this->ValeTransportePorc,\n\t\t\t'valeRefeicao'=>number_format($this->ValorRefeicao, 2, ',', '.'),\n\t\t\t'valeRefeicaoPorc'=>$this->ValeRefeicaoPorc,\n\t\t\t'valorFaltas'=>number_format($this->ValorFaltas, 2, ',', '.'),\n\t\t\t'adiantamentoDecimoTerceiro'=>number_format($this->AdiantamentoDecimoTerceiro, 2, ',', '.'),\n\t\t\t'liquidoFerias'=>number_format($this->ValorLiquidoFerias, 2, ',', '.'),\n\t\t\t'valorLiquido'=>number_format($this->ValorLiquido, 2, ',', '.'),\n\t\t\t'valorFeriasMes1'=>number_format($this->ValorFeriasMes1, 2, ',', '.'),\n\t\t\t'valorFeriasMes2'=>number_format($this->ValorFeriasMes2, 2, ',', '.'),\t\n\t\t\t'teste'=>$this->Teste\n\t\t);\n\n\t\t// Retorna um json com os dados da folha de pagamento.\n\t\techo json_encode($out);\n\t}", "public function searchTotal ($theme){\n $json = new JsonFile ($this->host. '/api/' . $theme . '/count');\n $json->parse();\n \n return $json;\n }", "public function getListGapoktanDesaTotal($kode_desa)\n {\n $db = Database::connect();\n $query = $db->query(\"select nm_desa as nama_desa from tbldesa where id_desa='$kode_desa'\");\n $row = $query->getRow();\n \n $query2 = $db->query(\"select a.id_poktan,a.id_gap,a.kode_desa,a.kode_kec,a.nama_poktan,a.ketua_poktan,a.jum_anggota,a.alamat, b.nm_desa,c.jum,c.id_poktan\n from tb_poktan a\n left join tbldesa b on a.kode_desa=b.id_desa \n left join(select id_poktan, count(id_poktan) as jum from tb_poktan_anggota GROUP BY id_poktan) c on a.id_poktan=c.id_poktan\n where kode_desa='$kode_desa'\n ORDER BY kode_desa\");\n\n $results = $query2->getResultArray();\n\n \n\n $data = [\n \n 'nama_desa' => $row->nama_desa,\n 'table_data' => $results,\n \n \n ];\n\n return $data;\n }", "public function SumarCarteraCreditos() \n{\n\tself::SetNames();\n\t$sql = \"select\n(select SUM(totalpago) from ventas WHERE tipopagove = 'CREDITO') as totaldebe,\n(select SUM(montoabono) from abonoscreditos) as totalabono\";\n//$sql =\"SELECT SUM(ventas.totalpago) as totaldebe, SUM(abonoscreditos.montoabono) FROM ventas, abonoscreditos WHERE ventas.tipopagove = 'CREDITO'\";\n\t$stmt = $this->dbh->prepare($sql);\n\t$stmt->execute();\n\t$num = $stmt->rowCount();\n\tif($num==0)\n\t{\n\t\techo \"\";\n\t\texit;\n\t}\n\telse\n\t{\n\t\tif($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t{\n\t\t\t\t$this->p[] = $row;\n\t\t\t}\n\t\t\treturn $this->p;\n\t\t\t$this->dbh=null;\n\t\t}\n\t}", "function ObtenerTotales($id_factura) {\n $query=\"SELECT SUM(total) total, SUM(valorseguro) total_seguro\nFROM \".Guia::$table.\" WHERE idfactura=$id_factura\";\n return DBManager::execute($query);\n }", "public function ajaxAdminGetCostMultiByProdukt($fd) {\n\t\t\n\t\t$objResponse = new xajaxResponse();\n\t\t$data = $fd['formData'];\n\t\t\n\t\t$calkowityKoszt = 0;\n\t\t$calkowitaProwizja = 0;\n\t\t\n\t\t$allegroKoszt = new Allegro_Koszt();\n\t\t\n\t\ttry {\n\t\t\t// pobieramy aukcje\n\t\t\tforeach($data['id'] as $idProdukt) {\n\t\t\t\n\t\t\t\t// tworzymy nowa aukcje na bazie produktu\n\t\t\t\t$aukcja = new Allegro();\n\t\t\t\t// pobieramy aktualne dane produktu do aktualizacji\n\t\t\t\t$produkt = new Allegro_Produkt($idProdukt);\n\t\t\t\t// pobiera wszystkie defaultowe dane aukcji - dla nowych aukcji\n\t\t\t\t$aukcja = $produkt->updateAuction($aukcja, $data['id_serwisu']);\n\t\t\t\t\n\t\t\t\t// dane z formularza\n\t\t\t\t$aukcja->data['fid'][4] = $data['fid'][4]; // czas trwania\n\t\t\t\t\n\t\t\t\t// sprawdzamy cene\n\t\t\t\t$koszt = $allegroKoszt->getKoszt($aukcja->data['fid']);\n\t\t\t\t$prowizja = $allegroKoszt->getProwizja($aukcja->data['fid'][8]);\n\n\t\t\t\t$calkowityKoszt+= $koszt;\n\t\t\t\t$calkowitaProwizja+= $prowizja;\n\t\t\t\t\n\t\t\t\t$objResponse->assign(\"koszt\" . $idProdukt, \"innerHTML\", sprintf(\"%.2f\", $koszt . ' zł'));\n\t\t\t\t$objResponse->assign(\"prowizja\" . $idProdukt, \"innerHTML\", sprintf(\"%.2f\", $prowizja . ' zł'));\n\t\t\t}\n\n\t\t\t$objResponse->assign(\"koszt\", \"innerHTML\", sprintf(\"%.2f\", $calkowityKoszt) . ' zł');\n\t\t\t$objResponse->assign(\"prowizja\", \"innerHTML\", sprintf(\"%.2f\", $calkowitaProwizja) . ' zł');\n\n\t\t\n\t\t} catch (Exception $e) {\n\t\t\t$objResponse->alert('Wystąpił błąd: ' . $e->getMessage());\n\t\t}\n\t\t\n\t\treturn $objResponse;\n\t}", "static public function ctrHistorial(){\n\n\t\t// FACTURAS\n\t\t$tabla = \"cta\";\n\t\t$respuesta = ModeloVentas::mdlHistorial($tabla);\n\t\t\n\n\t\tforeach ($respuesta as $key => $value) {\n\n\t\t\t// veo los items de la factura\n\t\t\t$tabla = \"ctaart\";\n\t\t\t$repuestos = ModeloVentas::mdlHistorialCta_art($tabla,$value['idcta']);\n\t\t\t\n\t\t\t$productos='';\n\n\t\t\tfor($i = 0; $i < count($repuestos)-1; $i++){\n\t\t\t\t\n\t\t\t\t$productos = '{\"id\":\"'.$repuestos[$i][\"idarticulo\"].'\",\n\t\t\t \"descripcion\":\"'.$repuestos[$i][\"nombre\"].'\",\n\t\t\t \"cantidad\":\"'.$repuestos[$i][\"cantidad\"].'\",\n\t\t\t \"precio\":\"'.$repuestos[$i][\"precio\"].'\",\n\t\t\t \"total\":\"'.$repuestos[$i][\"precio\"].'\"},';\n\t\t\t}\n\n\t\t\t$productos = $productos . '{\"id\":\"'.$repuestos[count($repuestos)-1][\"idarticulo\"].'\",\n\t\t\t \"descripcion\":\"'.$repuestos[count($repuestos)-1][\"nombre\"].'\",\n\t\t\t \"cantidad\":\"'.$repuestos[count($repuestos)-1][\"cantidad\"].'\",\n\t\t\t \"precio\":\"'.$repuestos[count($repuestos)-1][\"precio\"].'\",\n\t\t\t \"total\":\"'.$repuestos[count($repuestos)-1][\"precio\"].'\"}';\n\n\t\t\t$productos =\"[\".$productos.\"]\";\n\t\t\t\n\t\t\techo '<pre>'; print_r($productos); echo '</pre>';\n\t\t\t\n\t\t\t// datos para cargar la factura\n\t\t\t$tabla = \"ventas\";\n\t\t\t$datos = array(\"id_vendedor\"=>1,\n\t\t\t\t\t\t \"fecha\"=>$value['fecha'],\n\t\t\t\t\t\t \"id_cliente\"=>$value[\"idcliente\"],\n\t\t\t\t\t\t \"codigo\"=>$key,\n\t\t\t\t\t\t \"nrofc\"=>$value[\"nrofc\"],\n\t\t\t\t\t\t \"detalle\"=>strtoupper($value[\"obs\"]),\n\t\t\t\t\t\t \"productos\"=>$productos,\n\t\t\t\t\t\t \"impuesto\"=>0,\n\t\t\t\t\t\t \"neto\"=>0,\n\t\t\t\t\t\t \"total\"=>$value[\"importe\"],\n\t\t\t\t\t\t \"adeuda\"=>$value[\"adeuda\"],\n\t\t\t\t\t\t \"obs\"=>\"\",\n\t\t\t\t\t\t \"metodo_pago\"=>$value[\"detallepago\"],\n\t\t\t\t\t\t \"fechapago\"=>$value['fecha']);\n\n\t\t\t$respuesta = ModeloVentas::mdlIngresarVenta($tabla, $datos);\n\t\t\t\n\n\t\t}\n\t\t\n\t\treturn $respuesta;\n\n\t\t\n\t\t\n\t}", "function process_line($l) {\n\n $sum = 0;\n $decoded_line = json_decode($l, true);\n// var_dump($decoded_line);\n\n $items = $decoded_line[\"menu\"][\"items\"];\n// var_dump($items);\n\n foreach ($items as $item) {\n// var_dump($item);\n\n if (!is_array($item)) {\n continue;\n }\n\n if (array_key_exists('label', $item)) {\n// var_dump($item);\n $sum += $item['id'];\n }\n\n }\n return $sum;\n}", "public static function GetTotalVendas(){\n self::$results = self::query(\"SELECT sum(vlTotal) from tbComanda\");\n if (is_array(self::$results) || is_object(self::$results)){\n foreach(self::$results as $result){\n $result[0] = str_replace('.', ',', $result[0]);\n array_push(self::$resultRetorno, $result);\n return $result[0];\n }\n }\n return 0;\n }", "public function get_ajax_data_listado_cierre()\n {\n\n /*\n\n El total de cierre de caja está conformado de la siguiente manera\n\n ( ventas + creditos ) + ( plan separe ) - ( proformas ) - ( orden de compra )\n\n *//*\n $sql = \"\n SELECT cierres.id_Usuario, cierres.id_Caja, cierres.id_Almacen,\n IFNULL((\n SELECT SUM(valor) total_cierre\n FROM movimientos_cierre_caja\n WHERE valor > 0\n AND Id_cierre = cierres.id\n AND tipo_movimiento <> 'salida_gastos'\n AND forma_pago NOT IN ('Credito','Saldo_a_Favor','Gift_Card')\n AND movimientos_cierre_caja.tabla_mov <> 'anulada'\n AND movimientos_cierre_caja.tabla_mov IN ('pago','venta')\n ),0)+\n IFNULL((\n SELECT\n SUM(mcc.valor) AS total\n FROM movimientos_cierre_caja AS mcc\n INNER JOIN plan_separe_pagos AS sp ON mcc.id_mov_tip = sp.id_pago\n WHERE mcc.valor > 0\n AND mcc.Id_cierre = cierres.id\n AND mcc.forma_pago NOT IN ('Credito','Saldo_a_Favor','Gift_Card')\n AND mcc.tabla_mov = 'plan_separe_pagos'\n ),0)-\n IFNULL((\n SELECT\n SUM(mcc.valor) AS total\n FROM movimientos_cierre_caja AS mcc\n INNER JOIN proformas AS pf ON pf.id_proforma = mcc.id_mov_tip\n LEFT JOIN cuentas_dinero AS cd ON cd.id = pf.id_cuenta_dinero\n WHERE mcc.tabla_mov = 'proformas'\n AND mcc.Id_cierre = cierres.id\n AND mcc.forma_pago NOT IN ('Credito','Saldo_a_Favor','Gift_Card')\n AND pf.id_almacen = cierres.id_Almacen\n AND cd.tipo_cuenta IN ('Caja menor','Caja registradora')\n ),0)-\n IFNULL((\n SELECT\n SUM(mcc.valor) AS total\n FROM movimientos_cierre_caja AS mcc\n WHERE tipo_movimiento = 'salida_gastos'\n AND tabla_mov = 'pago_orden_compra'\n AND forma_pago NOT IN ('Credito','Saldo_a_Favor','Gift_Card')\n AND mcc.Id_cierre = cierres.id\n ),0)\n AS total_cierre,\n cierres.fecha,\n cierres.hora_apertura,\n cierres.hora_cierre,\n cierres.id,\n (SELECT nombre FROM cajas WHERE id = cierres.id_Caja) AS nombre_caja,\n (SELECT nombre FROM almacen WHERE almacen.id = cierres.id_Almacen) AS almacen\n FROM cierres_caja cierres\n ORDER BY cierres.fecha DESC\n \"; */\n\n //se modificó la consulta para que la tabla sea carga progresiva\n $aColumns = array(\n 'cierres.id',\n 'cierres.fecha',\n 'cierres.fecha_fin_cierre',\n 'cierres.hora_apertura',\n 'cierres.hora_cierre',\n 'cierres.id_Usuario',\n 'ca.nombre',\n 'al.nombre',\n 'cierres.total_cierre',\n 'cierres.arqueo',\n 'cierres.consecutivo',\n );\n\n $where = \"\";\n $is_admin = $this->session->userdata('is_admin');\n $user_id = $this->session->userdata('user_id');\n\n if ($is_admin != 't' && $is_admin != 'a') {\n $where = \" WHERE cierres.id_Usuario=\" . $user_id;\n }\n\n //limit\n $sLimit = \"\";\n if (isset($_GET['iDisplayStart']) && $_GET['iDisplayLength'] != '-1') {\n $sLimit = \"LIMIT \" . intval($_GET['iDisplayStart']) . \", \" . intval($_GET['iDisplayLength']);\n }\n //orden\n $sOrder = \"\";\n if (isset($_GET['iSortCol_0'])) {\n $sOrder = \"ORDER BY \";\n for ($i = 0; $i < intval($_GET['iSortingCols']); $i++) {\n if ($_GET['bSortable_' . intval($_GET['iSortCol_' . $i])] == \"true\") {\n $sOrder .= $aColumns[intval($_GET['iSortCol_' . $i])] . ' ' . ($_GET['sSortDir_' . $i] === 'asc' ? 'asc' : 'desc') . \", \";\n }\n }\n\n $sOrder = substr_replace($sOrder, \"\", -2);\n if ($sOrder == \"ORDER BY\") {\n $sOrder = \"\";\n }\n }\n //buscar\n $sWhere = \"\";\n if (isset($_GET['sSearch']) && $_GET['sSearch'] != \"\") {\n if (empty($where)) {\n $sWhere .= \"where (\";\n } else {\n $sWhere .= \"AND (\";\n }\n\n for ($i = 0; $i < count($aColumns); $i++) {\n if (isset($_GET['bSearchable_' . $i]) && $_GET['bSearchable_' . $i] == \"true\") {\n $sWhere .= $aColumns[$i] . \" LIKE '%\" . mysql_real_escape_string($_GET['sSearch']) . \"%' OR \";\n }\n }\n\n $sWhere = substr_replace($sWhere, \"\", -3);\n $sWhere .= ')';\n }\n\n $sql = \"\n SELECT SQL_CALC_FOUND_ROWS\n cierres.id_Usuario,\n cierres.id_Caja,\n cierres.id_Almacen,\n cierres.total_cierre,\n cierres.fecha,\n cierres.fecha_cierre,\n cierres.fecha_fin_cierre,\n cierres.hora_apertura,\n cierres.hora_cierre,\n cierres.id,\n cierres.arqueo,\n cierres.consecutivo,\n ca.nombre AS nombre_caja,\n al.nombre AS almacen\n FROM cierres_caja cierres\n LEFT JOIN cajas ca ON cierres.id_Caja=ca.id\n INNER JOIN almacen al ON cierres.id_Almacen=al.id\n $where\n $sWhere\n $sOrder\n $sLimit\";\n //echo $sql; die();\n $rResult = $this->connection->query($sql);\n $sQuery = \"SELECT FOUND_ROWS() as cantidad\";\n $rResultFilterTotal = $this->connection->query($sQuery);\n $iFilteredTotal = $rResultFilterTotal->row()->cantidad;\n $sQuery = \"SELECT COUNT(id) as cantidad FROM cierres_caja\";\n $rResultTotal = $this->connection->query($sQuery);\n $iTotal = $rResultTotal->row()->cantidad;\n $output = array(\n \"sEcho\" => intval($_GET['sEcho']),\n \"iTotalRecords\" => $iTotal,\n \"iTotalDisplayRecords\" => $iFilteredTotal,\n //\"iTotalDisplayRecords\" => 142,\n \"aaData\" => array(),\n );\n //echo $sql; die();\n $data = array();\n foreach ($rResult->result() as $value) {\n\n $sql1 = \"SELECT username FROM users where id = '$value->id_Usuario' \";\n $rsql = $this->db->query($sql1)->result();\n if (!empty($rsql)) {\n foreach ($rsql as $value1) {\n $username = $value1->username;\n }\n } else {\n $username = \"No existe el usuario\";\n }\n\n if ($value->total_cierre == '') {\n $total_cierre = '0';\n }\n if ($value->total_cierre != '') {\n $total_cierre = ($value->total_cierre);\n }\n\n //busco fechas y horas del cierre\n $cierre_automatico = get_option(\"cierre_automatico\");\n\n if ($cierre_automatico == 0) { //no tengo cierre automatico\n if (!empty($value->fecha_fin_cierre)) {\n $fecha_cierre = $value->fecha_fin_cierre;\n $fecha_cierre = date(\"Y-m-d\", strtotime($fecha_cierre));\n $hora_cierre = $value->hora_cierre;\n } else {\n if (!empty($value->fecha_cierre)) {\n $fecha_cierre = $value->fecha_cierre;\n $hora_cierre = $value->hora_cierre;\n } else {\n $fecha_cierre = date(\"Y-m-d\");\n $hora_cierre = date(\"H:i:s\");\n }\n }\n } else {\n $fecha_cierre = $value->fecha;\n $hora_cierre = date(\"23:59:59\");\n }\n/*\n$hora_cierre=$value->hora_cierre;\nif($value->hora_cierre==\"00:00:00\"){\nif($cierre_automatico==0){ //no tengo cierre automatico\n$fecha_cierre=date(\"Y-m-d\");\n$hora_cierre= date(\"H:i:s\");\n}else{\n$fecha_cierre=$value->fecha;\n$hora_cierre= date(\"23:59:59\");\n}\n\n}else{\n$fecha_cierre=$value->fecha;\n}\n\n//$fecha_cierre=$value->fecha;\n\nif(!empty($value->fecha_fin_cierre)){\n$fin = $value->fecha_fin_cierre;\n$fecha_cierre = date(\"Y-m-d\", strtotime($fin));\n}*/\n\n $consecutivo = (!empty($value->consecutivo)) ? $value->consecutivo : $value->id;\n $data[] = array(\n $value->id,\n $value->fecha,\n $fecha_cierre,\n $value->hora_apertura,\n $value->hora_cierre,\n $username,\n $value->nombre_caja,\n $value->almacen,\n $this->opciones_model->formatoMonedaMostrar($total_cierre),\n $this->opciones_model->formatoMonedaMostrar($value->arqueo),\n $consecutivo,\n $value->id,\n (number_format($total_cierre) . ',' . $value->id),\n );\n }\n $output['aaData'] = $data;\n return $output;\n /*\n return array(\n 'aaData' => $data\n );*/\n }", "public function totalQuestion(){\n $postsQuestions = Question::count();\n return response()->json($postsQuestions);\n }", "public function jsonOrcamentos($tipo){\n $table = 'orcamento';\n\n // Table's primary key\n $primaryKey = 'cdnOrcamento';\n\n $columns = array();\n\n $extras = array();\n\n $extras[] = 'p.nomPaciente';\n $extras[] = 'p.cdnPaciente';\n if(ControleCampo::campoExiste('nomSobrenome'))\n $extras[] = 'p.nomSobrenome';\n\n // Id\n $columns[] = array(\n 'db' => 'cdnOrcamento',\n 'dt' => 0\n );\n\n\n $this->tipo = $tipo;\n\n // Nome\n $columns[] = array(\n 'db' => 'cdnOrcamento',\n 'dt' => 1,\n 'formatter' =>\n function($d, $row){\n $d = $row['nomPaciente'];\n if(isset($row['nomSobrenome']))\n $d = utf8_encode($d.' '.$row['nomSobrenome']);\n else\n $d = utf8_encode($d);\n return $d;\n }\n );\n\n // Prontuário\n $columns[] = array(\n 'db' => 'cdnOrcamento',\n 'dt' => 2,\n 'formatter' =>\n function($d, $row){\n $d = $row['cdnPaciente'];\n return $d;\n }\n );\n\n $join = 'inner join paciente p on orcamento.cdnPaciente = p.cdnPaciente';\n\n return $this->jsonFinalizar($table, $primaryKey, $columns, 'indAprovado = 1', $extras, $join);\n }", "function getMunicipiosCuencaEstacionHidrometrica($query)\n{\n $EstacionHidrometrica = new EstacionHidrometrica();\n echo json_encode($EstacionHidrometrica->getMunicipiosCuenca($query));\n}", "function getTotalMeGustas($id) {\n $c = new Conexion();\n $resultado = $c->query(\"SELECT SUM(megusta) FROM valoracion_mg where id_contenido=$id && megusta=1\");\n\n if ($objeto = $resultado->fetch(PDO::FETCH_OBJ)) {\n return $objeto;\n }\n else{\n return 0;\n } \n}", "public function getTotalSubeixoRodovias(){\n\t\t$total = 0;\n\t\t$i=0;\n\t\twhile($i<count($this->result)){\n\t\t\tif($this->result[$i]->idn_digs == 1000)\n\t\t\t\t$total++;\n\t\t\t$i++;\n\t\t}\n\t\treturn $total;\n\t}", "public function desparasitantes_tatalDesparasitantes(){ \t\n\n\t\t\t$resultado = array();\n\t\t\t\n\t\t\t$query = \"Select count(idDesparasitanteMascota) as cantidadDesparasitantes from tb_desparasitantesMascotas \";\n\t\t\t\n\t\t\t$conexion = parent::conexionCliente();\n\t\t\t\n\t\t\tif($res = $conexion->query($query)){\n\t \n\t /* obtener un array asociativo */\n\t while ($filas = $res->fetch_assoc()) {\n\t $resultado = $filas;\n\t }\n\t \n\t /* liberar el conjunto de resultados */\n\t $res->free();\n\t \n\t }\n\t\n\t return $resultado['cantidadDesparasitantes'];\t\t\t\n\t\t\t\n\t\t\t\n }", "public function totalColecao(){\r\n\t\t$oSicasAtendimentoBD = new SicasAtendimentoBD();\r\n\t\treturn $oSicasAtendimentoBD->totalColecao();\r\n\t}", "function obtenerDatosFact($ids_Ventas, $rfc, $link, $verificarBoleta)\n{\n //$ids_Ventas=[8];\n if ($rfc == 'XAXX010101000') {\n $complemento = '0';\n $metpags = \"PUE\";\n $descripcionMetPgo = \"Pago en parcialidades o diferido\";\n\n $formPago = \"99\";\n $resp = array('estatus' => '1', 'mensaje' => 'Verificación de datos de Facturación correcta', 'result' => array(\"metodosPago\" => $metpags, \"formaPago\" => $formPago, \"descMetPgo\" => $descripcionMetPgo, \"complemento\" => $complemento));\n return $resp;\n } else {\n $ArrayIdsVentas = array();\n $ArrayIdsVentas = array_merge($ArrayIdsVentas, $ids_Ventas);\n $busqVentas = implode(',', $ArrayIdsVentas);\n $sql = \"SELECT DISTINCT COUNT(vtas.id) AS totalVtas, pgosvta.idFormaPago, metpgos.clave FROM ventas vtas\n INNER JOIN pagosventas pgosvta ON vtas.id= pgosvta.idVenta\n INNER JOIN sat_formapago metpgos ON metpgos.id= pgosvta.idFormaPago\n WHERE vtas.id IN ($busqVentas) GROUP BY pgosvta.idFormaPago\";\n //print_r($sql);\n $resultXpagos = mysqli_query($link, $sql) or die(json_encode(array('estatus' => '3', 'mensaje' => \"Error al Buscar el Metodo de Pago, notifica a tu Administrador\", 'idsErroneos' => mysqli_error($link))));\n $ventaXBoleta = \"<div class='text-danger'>Total de Ventas Pagadas Con Boleta:</div>\";\n $contarxBoleta = 0;\n $erroresVentas = array();\n $total_ventas = mysqli_num_rows($resultXpagos);\n $formaUnica = 0;\n $formaAnterior = \"\";\n $complemento = 0;\n if ($total_ventas == 1) {\n $xpags = mysqli_fetch_array($resultXpagos);\n if ($xpags['idFormaPago'] == '7') {\n $complemento = 1;\n $metpags = \"PPD\";\n $formPago = \"99\";\n $descripcionMetPgo = \"Pago en parcialidades o diferido\";\n $formaUnica = 1;\n }\n //----------------------pago de boletas---------------------------------\n else if ($xpags[\"idFormaPago\"] == \"6\" and $verificarBoleta == '1') {\n $ventaXBoleta .= $xpags[\"totalVtas\"];\n $contarxBoleta++;\n } else if ($xpags['idFormaPago'] == '7') {\n $complemento = 1;\n $metpags = \"PPD\";\n $formPago = \"99\";\n $descripcionMetPgo = \"Pago en parcialidades o diferido\";\n } else {\n $metpags = \"PUE\";\n $formPago = $xpags['clave'];\n $descripcionMetPgo = \"Pago en una sola exhibición\";\n $formaUnica = 1;\n }\n } else {\n while ($dat = mysqli_fetch_array($resultXpagos)) {\n\n if ($complemento == 0) {\n //----------------------pago de boletas---------------------------------\n if ($dat[\"idFormaPago\"] == \"6\" and $verificarBoleta == '1') {\n $ventaXBoleta .= $dat[\"totalVtas\"];\n $contarxBoleta++;\n } else {\n if ($dat['idFormaPago'] == '7') {\n $complemento = 1;\n $metpags = \"PPD\";\n $formPago = \"99\";\n $descripcionMetPgo = \"Pago en parcialidades o diferido\";\n }\n }\n }\n } //cierra While\n\n }\n\n if ($contarxBoleta > 0) {\n array_push($erroresVentas, $ventaXBoleta);\n $resp = array('estatus' => '0', 'mensaje' => 'Ventas Pagadas con Boletas NO se pueden facturar.', 'idsErroneos' => json_encode($erroresVentas));\n return $resp;\n } else {\n if ($formaUnica == 1) {\n\n $resp = array('estatus' => '1', 'mensaje' => 'Verificación de datos de Facturación correcta', 'result' => array(\"metodosPago\" => $metpags, \"formaPago\" => $formPago, \"descMetPgo\" => $descripcionMetPgo, \"complemento\" => $complemento));\n return $resp;\n } else {\n if ($complemento == 1) {\n $resp = array('estatus' => '1', 'mensaje' => 'Verificación de datos de Facturación correcta', 'result' => array(\"metodosPago\" => $metpags, \"formaPago\" => $formPago, \"descMetPgo\" => $descripcionMetPgo, \"complemento\" => $complemento));\n return $resp;\n } else {\n $metpags = \"PUE\";\n $formPago = \"99\";\n $descripcionMetPgo = \"Pago en una sola exhibición\";\n $resp = array('estatus' => '1', 'mensaje' => 'Verificación de datos de Facturación correcta', 'result' => array(\"metodosPago\" => $metpags, \"formaPago\" => $formPago, \"descMetPgo\" => $descripcionMetPgo, \"complemento\" => $complemento));\n return $resp;\n }\n }\n }\n }\n}", "static public function ctrRankingVendedoresReportes(){\n\n\t\t$respuesta = ModeloUsuarios::MdlRankingVendedoresReportes();\n\n\t\t$array = array();\n\t\n \tforeach ($respuesta as $key => $value) {\n \n \t\t$objeto = array();\n\n \t\t$nombreVendedor = $value[\"nombre_vendedor\"] ;\n \n \t\t$cantidad_ventas = $value[\"total_ventas\"] ;\n \t\n \t\t$cantidad_productos = $value[\"total_productos\"] ;\n \n \t\t$objeto = array('y'=> $nombreVendedor , 'a'=> $cantidad_ventas , 'b' => $cantidad_productos );\n\n\t\t\tarray_push( $array , $objeto ) ;\n\n \t};\n\n\t\t$datos = json_encode($array);\n\n\t\treturn $datos;\n\t}", "function totalboaralla(){\n\n\t$crud = new CRUD();\n\t$crud->disconnect();\n\n\t$crud -> sql(\"select SUM(native_boar) as totalboaralla from farmers_tbl\");\n\t$r = $crud->getResult();\n\tforeach($r as $rs){\n\t\treturn $rs['totalboaralla'];\n\t}\n\t$crud->disconnect();\n}", "public static function getTotalParcel()\n {\n $countParcel['Received Mail']['total'] = 0;\n $countParcel['Pending Pickup']['total'] = 0;\n $countParcel['Sending']['total'] = 0; \n $countParcel['Confirm received']['total'] = 0; \n $countParcel['Early postal']['total'] = 0; \n $countParcel['Pending early pickup']['total'] = 0; \n \n $query = parcel::find()->where('uid = :uname', [':uname'=>Yii::$app->user->identity->id])->all();\n foreach($query as $data)\n {\n switch ($data['status']) {\n\n case 1:\n $countParcel['Received Mail']['total'] += 1;\n break;\n\n case 2:\n $countParcel['Pending Pickup']['total'] += 1;\n break;\n\n case 3:\n $countParcel['Sending']['total'] += 1;\n break;\n\n case 4:\n $countParcel['Confirm received']['total'] += 1;\n break;\n \n case 5:\n $countParcel['Early postal']['total'] += 1;\n break;\n\n case 6:\n $countParcel['Pending early pickup']['total'] += 1;\n break;\n\n default:\n \n $status = parcel_status_name::find()->where('id=:id',[':id'=>$data['status']])->one()->type;\n $countParcel[$status]['total'] += 1;\n break;\n }\n }\n\n foreach($countParcel as $i=> $data)\n {\n $countParcel[$i]['total'] = $data['total'] == 0 ? \"\" : $data['total'];\n }\n \n return $countParcel;\n }", "function getDatos(){\n $res = $this->Consulta('SELECT C.*, P.id_planta FROM '.$this->Table .' C\n INNER JOIN\n equipos E ON E.id_equipos = C.`id_equipos`\n INNER JOIN\n secciones S ON S.id_secciones = E.id_secciones\n INNER JOIN\n plantas P ON P.id_planta = S.id_planta\n \n WHERE '.$this->PrimaryKey.' = '.$this->_datos);\n $resultado = $res[0];\n // $resultado = array_map('utf8_encode',$resultado);\n \n print_r( json_encode( $resultado ) );\n }", "public function getSumas() {\n $aDatos = $this->getAsistentes();\n $aAsi = array();\n $aPer = array();\n $aRep = array();\n $prop = 0;\n $repr = 0;\n $vosp = 0;\n $vonp = 0;\n $vosr = 0;\n $vonr = 0;\n $cofp = 0;\n $cofr = 0;\n \n foreach ($aDatos as $aAsistente) {\n if($aAsistente[3] == 'S') {\n // Representante.\n $repr++; // Numero de respresentantes.\n $aRep[$aAsistente[1]] = $aAsistente[1]; // Para el numero de respresentantes diferentes.\n $vosr += ($aAsistente[4] == 'S') ? 1 : 0; // Representantes con voto.\n $vonr += ($aAsistente[4] == 'N') ? 1 : 0; // Representantes sin voto.\n $cofr += $aAsistente[5]; // Coeficiente fase.\n } else {\n // Propietario.\n $prop++;\n $aPer[$aAsistente[1]] = $aAsistente[1]; // Para el numero de propietarios diferentes.\n $vosp += ($aAsistente[4] == 'S') ? 1 : 0; // Propietarios con voto.\n $vonp += ($aAsistente[4] == 'N') ? 1 : 0; // Propietarios sin voto.\n $cofp += $aAsistente[5]; // Coeficiente fase.\n }\n }\n $aAsi['prop'] = array($prop, count($aPer), $vosp, $vonp, $cofp);\n $aAsi['repr'] = array($repr, count($aRep), $vosr, $vonr, $cofr);\n return $aAsi;\n }", "public function calcularCosto(){\n $detalles = DetalleOrden::where('codOrden','=',$this->codOrden)->get();\n $sumaTotal = 0;\n foreach ($detalles as $x) {\n $sumaTotal = $sumaTotal + ($x->precio*$x->cantidad);\n }\n\n return $sumaTotal;\n\n }", "public function count(){\n $obj=Indicadores::all();\n return response()->json(['registros'=>$obj->count()]);\n }", "public function mostrarTrabajosJSON(){\n $path = '../python_scraper/ofertas_trabajo.json';\n $json = file_get_contents($path);\n return $json;\n }", "public function getAllJson()\n { \n $estaciones = $this->mibiciDAO->getAllMibici();\n return $estaciones;\n }", "function CuentaUnidades($CardCode){\n\t\t $Total_Articulos = 0;\n\t\t $Total_Pedido = 0;\n\t\t \n\t\tif($this->con->conectar()==true){\n\t\t\t$Resultado = mysql_query(\"SELECT COUNT( * ) as NumItems FROM `Carrito` WHERE `CardCode` = '\" .$CardCode. \"'\");\n\t\t\tif($Resultado){\n\t\t\t \t $Result = mysql_fetch_array($Resultado) ;\n\t\t \t \t $Total_Articulos = $Result[\"NumItems\"];\n\t\t\t}\n\t\t\techo $Total_Articulos;\n\t\t}\n\t}", "function contar(){\n $sql = \"Select (select count(cita.id) from cita) as Citas,( select count(medico.id) from medico) as Medicos, (select count(paciente.id) from paciente)as Pacientes\";\n $conexion = new Conexion();\n return $conexion->executeQuery($sql)->fetch_object();\n }", "public function getTotal($entity)\n {\n $user = Auth::user();\n $count = $entity . '_count';\n\n if ($user->hasRole('super admin')) {\n $agencies = Agency::withCount($entity)->get();\n $messages = array();\n\n foreach ($agencies as $agency) {\n array_push($messages, [\n 'nama_unit' => $agency->name,\n 'total_' . $entity => $agency->$count,\n ]);\n }\n } else {\n $agencyID = $user->employee->agency->id;\n $employees = Agency::withCount($entity)->find($agencyID);\n $messages = [\n 'total_' . $entity => $employees->$count,\n ];\n }\n\n return response()->json($messages, 200);\n }", "function graficosProductosConsumo($anio) {\r\n\r\n\r\n\t$sql = \"select\r\n\t\t\t\r\n\t\t\t\tp.refcategorias, c.descripcion, coalesce(count(c.idcategoria),0)\r\n\t\t\r\n\t\t\t\t\tfrom dbventas v\r\n\t\t\t\t\tinner join tbtipopago tip ON tip.idtipopago = v.reftipopago\r\n\t\t\t\t\tinner join dbclientes cli ON cli.idcliente = v.refclientes\r\n\t\t\t\t\tinner join dbdetalleventas dv ON v.idventa = dv.refventas\r\n\t\t\t\t\tinner join dbproductos p ON p.idproducto = dv.refproductos\r\n\t\t\t\t\tinner join tbcategorias c ON c.idcategoria = p.refcategorias\r\n\t\t\t\t\twhere\tyear(v.fecha) = \".$anio.\" and c.esegreso = 0 and v.cancelado = 0\r\n\t\t\tgroup by p.refcategorias, c.descripcion\r\n\t\t\t\";\r\n\t\t\t\r\n\t$sqlT = \"select\r\n\t\t\t\r\n\t\t\t\tcoalesce(count(p.idproducto),0)\r\n\r\n\t\t\tfrom dbventas v\r\n\t\t\tinner join tbtipopago tip ON tip.idtipopago = v.reftipopago\r\n\t\t\tinner join dbclientes cli ON cli.idcliente = v.refclientes\r\n\t\t\tinner join dbdetalleventas dv ON v.idventa = dv.refventas\r\n\t\t\tinner join dbproductos p ON p.idproducto = dv.refproductos\r\n\t\t\tinner join tbcategorias c ON c.idcategoria = p.refcategorias\r\n\t\t\twhere\tyear(v.fecha) = \".$anio.\" and c.esegreso = 0 and v.cancelado = 0\";\r\n\t\t\t\r\n\t$sqlT2 = \"select\r\n\t\t\t\t\tcount(*)\r\n\t\t\t\tfrom dbproductos p\r\n\t\t\t\twhere p.activo = 1\r\n\t\t\t\";\r\n\r\n\t\r\n\t$resT = mysql_result($this->query($sqlT,0),0,0);\r\n\t$resR = $this->query($sql,0);\r\n\t\r\n\t$cad\t= \"Morris.Donut({\r\n element: 'graph2',\r\n data: [\";\r\n\t$cadValue = '';\r\n\tif ($resT > 0) {\r\n\t\twhile ($row = mysql_fetch_array($resR)) {\r\n\t\t\t$cadValue .= \"{value: \".((100 * $row[2])\t/ $resT).\", label: '\".$row[1].\"'},\";\r\n\t\t}\r\n\t}\r\n\t\r\n\r\n\t$cad .= substr($cadValue,0,strlen($cadValue)-1);\r\n $cad .= \"],\r\n formatter: function (x) { return x + '%'}\r\n }).on('click', function(i, row){\r\n console.log(i, row);\r\n });\";\r\n\t\t\t\r\n\treturn $cad;\r\n}", "public function somarValores()\n {\n return $this->bd->sum($this->tabela, \"valor\");\n }", "public function totalOrdersByStatus()\n {\n $ano = date('Y');\n $mes = date('m');\n $dia = date('d');\n $inicioMes = \"{$ano}-{$mes}-01 00:00:00\";\n\n $pedidos = Pedido\n ::selectRaw('status, marketplace, COUNT(*) as count')\n ->whereNotNull('status')\n ->where('status', '!=', 5)\n ->where('created_at', '>=', $inicioMes)\n ->groupBy('status')\n ->groupBy('marketplace')\n ->orderBy('status', 'ASC')\n ->orderBy('marketplace', 'ASC')\n ->get();\n\n /**\n * Organiza os marketplaces\n */\n $marketplaces = [];\n foreach ($pedidos as $pedido) {\n if (!in_array(strtoupper($pedido->marketplace), $marketplaces)) {\n $marketplaces[] = strtoupper($pedido->marketplace);\n }\n }\n\n /**\n * Status possíveis\n */\n $status = \\Config::get('core.pedido_status');\n\n /**\n * Prepara a lista para quando não existir preenche corretamente com 0\n */\n $list = [];\n foreach ($status as $state) {\n foreach ($marketplaces as $marketplace) {\n $list[strtolower($state)][] = 0;\n }\n }\n\n /**\n * Organiza os dados pra mostrar no gráfico\n */\n foreach ($pedidos as $pedido) {\n $list[strtolower($status[$pedido->status])][array_search(strtoupper($pedido->marketplace), $marketplaces)] = $pedido->count;\n }\n\n /**\n * Altera o nome do marketplace\n */\n if ($index = array_search('MERCADOLIVRE', $marketplaces)) {\n $marketplaces[$index] = 'M.LIVRE';\n }\n\n $list['marketplaces'] = $marketplaces;\n\n return $this->listResponse($list);\n }", "public function getMonto(){\n\n $var_sum = CarritoProductosWeb::model()->findBySql('select ROUND(sum(`precio_total`), 2) as `precio_total` from carrito_productos_web \n WHERE id_pedido ='.$this->id_pedido, array());\n\n return $var_sum->precio_total;\n }", "public static function Numero_Cotizacion()\n {\n // Consulta de la meta\n $consulta = \"SELECT * FROM cotizaciones WHERE version=0 ORDER BY num_cotizacion DESC LIMIT 1\";\n\n try {\n // Preparar sentencia\n $comando = Database::getInstance()->getDb()->prepare($consulta);\n // Ejecutar sentencia preparada\n $comando->execute(); \n\n return $comando->fetchAll(PDO::FETCH_ASSOC); \n\n } catch (PDOException $e) {\n // Aquí puedes clasificar el error dependiendo de la excepción\n // para presentarlo en la respuesta Json\n return -1;\n }\n }" ]
[ "0.6675821", "0.66495305", "0.613673", "0.61215544", "0.6106267", "0.6022452", "0.60204196", "0.59142363", "0.591039", "0.58281165", "0.5822874", "0.58040595", "0.5770068", "0.5758333", "0.5743197", "0.56932783", "0.56923753", "0.56894803", "0.5661595", "0.5658608", "0.5656882", "0.56446344", "0.5642135", "0.564156", "0.56143224", "0.5607974", "0.5604276", "0.55865735", "0.5572883", "0.5563952", "0.5560887", "0.55519694", "0.55299926", "0.55293655", "0.55255497", "0.55209154", "0.55149233", "0.5509947", "0.54973245", "0.54962534", "0.54927355", "0.54855496", "0.54797596", "0.54779327", "0.5476255", "0.5473262", "0.5469682", "0.54580545", "0.545597", "0.54490125", "0.5448596", "0.54460526", "0.5444761", "0.5440386", "0.5438847", "0.5430939", "0.5429518", "0.5427133", "0.5425479", "0.54151237", "0.5412117", "0.5411443", "0.5409683", "0.5408216", "0.540656", "0.5400465", "0.53992", "0.5397944", "0.5397086", "0.53875166", "0.53770274", "0.53749394", "0.53723884", "0.5366068", "0.53600824", "0.5352133", "0.53481483", "0.53479147", "0.5337366", "0.5336165", "0.53358626", "0.53336066", "0.53333336", "0.5329814", "0.5326889", "0.5315943", "0.5312616", "0.5312222", "0.53078526", "0.5305126", "0.5301594", "0.5299655", "0.5298808", "0.5292565", "0.52918345", "0.5291242", "0.5285198", "0.5277496", "0.52773076", "0.5274519" ]
0.659856
2
pega os valores dos cadastros do arquivo JSON e salva em um array
function pegaCadastrosJson(){ $arquivo = file_get_contents('json/cadastros.json');//arquivo Json que será pego $GLOBALS['cadastros'] = json_decode($arquivo);//salva no array global cadastros os cadastros $cadastrosLocal = $GLOBALS['cadastros']; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getJsonArray(){\n return json_decode(file_get_contents($this->jsonFileLink), true); //return [Array]\n }", "public function buscarUsuarios(){\n $usuarios = file_get_contents('usuarios.json');\n $arrUsuariosJSON = explode(PHP_EOL,$usuarios);\n $arrUsuarioPHP = [];\n array_pop($arrUsuariosJSON);\n foreach ($arrUsuariosJSON as $key => $usuario) {\n $arrUsuarioPHP[] = json_decode($usuario,true);\n }\n return $arrUsuarioPHP;\n }", "public function traePaises(){\n $allPaises= file_get_contents('paises.json');\n $arrayPaises= explode(';',$allPaises);\n array_pop($arrayPaises);\n array_shift($arrayPaises);\n $arrayPaisesPhp = [];\n foreach ($arrayPaises as $value) {\n $arrayPaisesPhp[] = json_decode($value, true);\n }\n \n return $arrayPaisesPhp;\n\n }", "public static function TraerTodosJSON(): array\n {\n $listaUsuarios = array();\n $userAux = new Usuario();\n\n $archivo = fopen('../archivos/usuarios.json', \"r\");\n\n while (!feof($archivo)) {\n $usuarioAuxiliar = new Usuario();\n $linea = fgets($archivo);\n\n $userStd = json_decode($linea);\n\n //Nuevo usuario obtenido desde archivo.json\n if (isset($userStd->nombre)) {\n $userAux->nombre = $userStd->nombre;\n $userAux->correo = $userStd->correo;\n $userAux->clave = $userStd->clave;\n\n //Agrega usuarios a la lista retornada\n array_push($listaUsuarios, $userAux);\n }\n }\n return $listaUsuarios;\n }", "public function GetArrayFromJson()\n {\n $objects = MTJson::Decode( $this->ConfigJson);\n if ($objects == null) return null;\n $result = array();\n //---\n foreach ($objects as $obj)\n {\n $info = MTDealJson::GetFromJson($obj);\n //---\n $result[] = $info;\n }\n //---\n $objects = null;\n //---\n return $result;\n }", "function dadosCadastros(){//função geral que será chamada na index\n pegaCadastrosJson();//pega os valores dos cadastros do arquivo JSON e salva em um array\n contaNumeroCadastros();//conta Quantos cadastros existem\n }", "public function jsonSerialize(): array;", "public function ambilData() {\n // read file & get the data (file_get_contents)\n $data = file_get_contents($this->file);\n $this->daftar_barang = json_decode($data, true);\n $this->daftar_barang = array_values($this->daftar_barang);\n }", "public function jsonSerialize()\n {\n return [\n 'mudou' => $this->_mudou,\n 'arquivoTemporario' => $this->_arquivoTemporario\n ];\n }", "function getAllCitationJson($lang){\n //$file = \"ressources/views/json_files/all_tests/\".$lang.\"_all_test.json\";\n $file = $_SERVER['STORAGE_BASE'] . \"/json_files/all_quotes/\" . $lang . \"_all_quotes.json\";\n\n $jsondata = file_get_contents($file);\n // converts json data into array\n $arr_data = json_decode($jsondata);\n $allcitation = array();\n foreach ($arr_data as $citation) {\n $allcitation [$citation->id_citation] = [\n \"id_citation\" => $citation->id_citation,\n \"id_rubrique\" => $citation->id_rubrique,\n \"statut\" => $citation->statut,\n \"if_translated\" => $citation->if_translated,\n \"if_personalizable\" => $citation->if_personalizable,\n \"default_lang\" => $citation->default_lang,\n \"titre_citation\" => stripslashes((string)$citation->titre_citation),\n \"url_image_citation\" => $citation->url_image_citation,\n \"url_thumb_img_citation\"=> $citation->url_thumb_img_citation,\n \"codes_countries\" => $citation->codes_countries\n ];\n }\n\n return $allcitation;\n }", "private function NewFile() : array\n {\n $file = fopen(__DIR__ . '/../cache/deals.txt', \"r\");\n\n $deals = $this->decoratee->GetDeals();\n if($file == false) return $deals;\n\n //converim l'array a json\n $deals_encoded = json_encode($deals);\n //convertim el json a fitxer\n file_put_contents(__DIR__ . '/../cache/deals.txt', $deals_encoded);\n\n return $deals;\n \n }", "public function traerTodos(){\n // Obtengo el contenido del JSON\n $archivo = file_get_contents(\"../json/usuarios.json\");\n\n // esto me arma un array con todos los usuarios\n $usuariosJSON = explode(PHP_EOL, $archivo);\n\n // Saco el último elemento que es una línea vacia\n array_pop($usuariosJSON);\n\n // Creo un array vacio, para guardar los usuarios\n $usuariosFinal = [];\n\n // Creo un array de usuarios generado desde el json\n foreach ($usuariosJSON as $usuario) {\n\n $usuariosFinal[] = json_decode($usuario, true);\n\n }\n\n return $usuariosFinal;\n }", "public function getAllJson()\n { \n $estaciones = $this->mibiciDAO->getAllMibici();\n return $estaciones;\n }", "public function cargarEstados()\r\n {\r\n \r\n $data = $this->cargar_model->cargarEstados();\r\n\r\n print_r(json_encode($data)); \r\n \r\n }", "public function jsonSerialize() : array\n {\n return $this->entries;\n }", "public static function json($path)\n {\n $array = [];\n if(File::exists(base_path('vendor/ajifatur/faturhelper/json/'.$path))) {\n $array = json_decode(File::get(base_path('vendor/ajifatur/faturhelper/json/'.$path)), true);\n }\n return $array;\n }", "function vetrinaJson($con) {\n $compArray = [];\n $resultComp = mysqli_query($con, \"SELECT * FROM composizioni\");\n while ($rowComp = mysqli_fetch_array($resultComp)) {\n $rowComp_array['i'] = (int)$rowComp['cmp_id'];\n $rowComp_array['c'] = $rowComp['cmp_nome'];\n $rowComp_array['m'] = (int)$rowComp['cmp_mark_id'];\n $rowComp_array['l'] = (int)$rowComp['cmp_line_id'];\n $rowComp_array['v'] = (int)$rowComp['cmp_show'];\n $rowComp_array['y'] = (int)$rowComp['cmp_pos'];\n $rowComp_array['n'] = $rowComp['cmp_title'];\n $rowComp_array['o'] = $rowComp['cmp_note'];\n $rowComp_array['h'] = json_decode($rowComp['cmp_array']);\n\n array_push($compArray, $rowComp_array);\n }\n $fp = fopen('../json/vetrine.json', 'w');\n $out = array_values($compArray);\n fwrite($fp, json_encode($out));\n fclose($fp);\n}", "function data()\n {\n $arr = json_decode($this->jsonText, true);\n $ritit = new RecursiveIteratorIterator(new RecursiveArrayIterator($arr), RecursiveIteratorIterator::SELF_FIRST);\n $r = [];\n foreach ($ritit as $k => $v) {\n if (isset($v['points'])) {\n extract($v);\n $r[] = [\n 'id' => $id\n , 'title' => $title\n , 'account_wide' => $accountWide\n , 'faction_id' => $factionId\n ];\n }\n }\n\n return $r;\n }", "function procesar_cadena_json($resultado, $lista_valores)\n{\n for ($i = 0; $i < $resultado[\"numcampos\"]; $i++) {\n $busqueda = $resultado[$i];\n foreach ($busqueda as $key => $valor) {\n if (is_numeric($key)) {\n unset($busqueda[$key]);\n } else if (in_array($key, $lista_valores)) {\n $busqueda[$key] = str_replace(\"\\n\", \"\", $busqueda[$key]);\n $busqueda[$key] = str_replace(\"\\r\", \"\", $busqueda[$key]);\n $busqueda[$key] = html_entity_decode($busqueda[$key]);\n $busqueda[$key] = addslashes($busqueda[$key]);\n }\n }\n $resultado[$i] = $busqueda;\n }\n return ($resultado);\n}", "public function valoracionToArray(){\n\t\t\t$this->arrayValor = array(\n\t\t\t\t\"user\"=> $this->user,\n\t\t\t\t\"object\"=> $this->object,\n\t\t\t\t\"valor\"=>$this->valor\n\t\t\t\t);\n\t\t}", "function file_to_array($filename) {\n if (file_exists($filename)) {\n $encoded_string = file_get_contents($filename);\n\n if ($encoded_string !== false) {\n return json_decode($encoded_string, true);\n } \n }\n \n return false;\n}", "private function convert_json_to_array($json)\n\t\t{\t\t \n\t\t\treturn json_decode($json,true);\n\t\t}", "public function getData() {\r\n\r\n\t\t$sodexo_domain = 'http://www.sodexo.fi/';\r\n\t\t$path = 'ruokalistat/output/daily_json/';\r\n\r\n\t\tforeach ($this->id_arr as $key => $value) {\r\n\r\n\t\t\t$json_data = file_get_contents($sodexo_domain . $path . $value . '/' . $this->pvm .'/fi');\r\n\r\n\t\t\t$course_info = $this->toObjectArray($json_data);\r\n\t\t\t\r\n\t\t\t$this->id_arr[$key] = $course_info;\r\n\t\t}\r\n\t}", "function getTestFromJson($file = \"ressources/views/all_test.json\"){\n //$file = $_SERVER['STORAGE_BASE'] . \"/json_files/all_test.json\";\n \t $jsondata = file_get_contents($file);\n \t // converts json data into array\n \t $arr_data = json_decode($jsondata);\n $alltest = array();\n foreach ($arr_data as $test) {\n # code...\n $alltest [$test->id_test] = [\n \"id_test\" => $test->id_test,\n \"id_theme\" => $test->id_theme,\n \"id_rubrique\" => $test->id_rubrique,\n \"statut\" => $test->statut,\n \"titre_test\" => stripslashes((string)$test->titre_test),\n \"unique_result\" => $test->unique_result,\n \"url_image_test\" => $test->url_image_test,\n \"codes_countries\" => $test->codes_countries\n ];\n }\n\n return $alltest;\n }", "protected function getSaveData(): array\n {\n $data = parent::getSaveData();\n if ( !empty( $data['furniture'] ) ) {\n foreach ( $data['furniture'] as $furniture ) {\n $dataFurniture[][$furniture->id] = $furniture->quantity;\n }\n $data['furniture'] = json_encode( $dataFurniture ?? null, JSON_THROW_ON_ERROR );\n }\n if ( !empty( $data['status'] ) ) { //We want string for DB column, not id integer\n $data['status'] = $this->status->name;\n }\n return $data;\n }", "public function jsonSerialize() : array {\n\t\t\t\treturn [\n\t\t\t\t\t'id' => $this->getId(),\n\t\t\t\t\t'cep' => $this->getCep(),\n\t\t\t\t\t'bairro' => $this->getBairro(),\n\t\t\t\t\t'cidade' => $this->getCidade(),\n\t\t\t\t\t'rua' => $this->getRua(),\n\t\t\t\t\t'estado' => $this->getEstado(),\n\t\t\t\t];\n\t\t\t}", "public function asArray(): array\n {\n return json_decode($this->result, true);\n }", "public function getToArrayValues()\r\n\t\t{\r\n\t\t\t$obj = \t$this->getObject();\r\n\t\t\t$arrayValues = array();\r\n\t\t\tforeach ($obj as $key => $value) {\r\n\t\t\t\t$arrayValues[\":\".strtoupper($key)] = $value;\r\n\t\t\t}\r\n\t\t\treturn $arrayValues;\r\n\t\t}", "public function getAll()\n {\n return $this->jsonToArray($this->applyEncode($this->download()));\n }", "public function mostrarTrabajosJSON(){\n $path = '../python_scraper/ofertas_trabajo.json';\n $json = file_get_contents($path);\n return $json;\n }", "public function toArray()\n\t{\n\t\treturn (array) json_decode($this->json);\n\t}", "function _fcsv_to_array( $file_path, bool $to_json = false ) {\n\t\treturn IMFORZA_Utils::fcsv_to_array( $file_path, $to_json );\n\t}", "function jsonToArray($dir, $file){\n/** Nurodomas kelias iki jsons folderio */ /** __DIR__ - atvaizduoja visa kelia iki failo kuriame naudojamas '__DIR__' pvz:C:\\wamp\\www\\Mindaugas\\2018.09.12 */\n $path = __DIR__ . DIRECTORY_SEPARATOR . $dir . DIRECTORY_SEPARATOR; \n $file = file_get_contents($path . $file , FILE_USE_INCLUDE_PATH); /** $file(kintamasis) Paims info(pagal nurodyta kelia su $path) is jsons folderio */\n $allInfo = json_decode($file, true); /** $allInfo(kintamasis) decodins .json failus i php masyvus*/\n\n return $allInfo; /** Grazinam visa info is .json failu kaip masyvą */\n}", "private function loadData(): void\n {\n if (null !== $this->data) {\n // Data is already loaded.\n return;\n }\n\n $json = file_get_contents($this->filePath);\n $data = (new JsonEncoder())->decode($json, JsonEncoder::FORMAT);\n\n $this->data = [];\n\n foreach ($data['quotes'] as $quote) {\n $this->data[$this->slugifier->slugify($quote['author'])][] = $quote['quote'];\n }\n }", "public function GetDeals() : array\n {\n if(file_exists(__DIR__ . '/../cache/deals.txt')){\n\n $file = file_get_contents('./deals.txt');\n return json_decode($file);\n }else{\n //creem el fitxer\n return $this->NewFile();\n }\n \n }", "public function jsonSerialize()\n {\n $arrayJson = array();\n foreach ($this as $key =>$value){\n if($key != 'document')\n $arrayJson[$key] = $value;\n }\n return $arrayJson;\n }", "private function saveFileJson()\n {\n return file_put_contents($this->arquivoJson, json_encode($this->registros));\n }", "public function toJsonArray()\n {\n return array(\n 'id' => $this->getId(),\n 'date_created' => $this->getDateCreated()->getTimestamp(),\n 'content' => $this->getContent(),\n );\n }", "private function arrayFromBlob($blob){\n return json_decode($blob, true);\n }", "public function getAll()\n {\n $handle = $this->getJsonHandle('r');\n\n if (!$handle) {\n return [];\n }\n\n $users = [];\n\n //recorrer el archivo\n while($json = fgets($handle)) {\n $users[] = $this->createUserFromArray(json_decode($json, true));\n }\n\n fclose($handle);\n\n return $users;\n }", "private function readIngredientsData() {\n $data = file_get_contents(__DIR__ . '/../../../src/app/Ingredient/data.json'); \n $arr_data = json_decode($data);\n\n return $arr_data; \n }", "public function toArray() \n\t{\n\t\ttry {\n\t\t\t$fileContents = file_get_contents($this->data);\n\t\t\t$jsonData = json_decode($fileContents, true); \n\t\t\t$cards = $jsonData['boardingCards'];\n\t\t\treturn $cards;\n\t\t} catch(Exception $e) {\n\t\t\treturn $e;\n\t\t}\n\t}", "function guardarDatos()\n {\n $miArchivo = \"datos.json\";\n $arreglo = array();\n\n try{\n $datosForma = array(\n 'nombreProducto'=> $_POST['nombre'],\n 'nombreCliente'=> $_POST['cliente'],\n 'precio'=> $_POST['precio'],\n 'fechaPedido'=> $_POST['fechaPedido'],\n 'fechaEntrega'=> $_POST['fechaEntrega']\n );\n\n if(file_get_contents($miArchivo) != null)\n {\n $jsondata = file_get_contents($miArchivo);\n\n $arreglo = json_decode($jsondata,true);\n }\n\n array_push($arreglo, $datosForma);\n\n $jsondata = json_encode($arreglo, JSON_PRETTY_PRINT);\n\n if(file_put_contents($miArchivo, $jsondata))\n return true;\n else\n return false;\n }catch(Exception $e)\n {\n return false;\n }\n }", "private function get_data_json($tablename){\n $table = $tablename;\n $sql = \"SELECT * FROM $table;\";\n $result = $this->query($sql);\n $array = [];\n while ($row = mysqli_fetch_assoc($result)) {\n $json = json_decode($row['data'],true);\n array_push($array,$json);\n }\n return $array;\n }", "public function toArray(){\n\t\treturn json_decode(json_encode($this->rows), true);\n\t}", "public function getAsArray(): array\n {\n return \\GuzzleHttp\\json_decode(\\GuzzleHttp\\json_encode($this->values), true);\n }", "public function converterJsonfile(){\n try {\n\n /**\n * Algoritmo para consumir a API e receber em $planets os dados dos planetas\n */\n $flag = 1;\n do{\n $cl = curl_init();\n curl_setopt($cl, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($cl, CURLOPT_URL, \"https://swapi.co/api/planets/?page=$flag\");\n curl_setopt($cl, CURLOPT_HTTPHEADER, array(\"Content-Type: application/json;\") );\n $compare = json_decode( curl_exec($cl) );\n foreach( $compare->results as $value ){\n $planets[] = $value;\n }\n $flag++;\n curl_close($cl);\n }while( NULL != $compare->next );\n\n //Com todos os planetas agora monto meus dados conforme o banco de dados e insiro no final.\n foreach( $planets as $planet ){\n\n $data_planet[] = array( \n 'nome' => $planet->name , \n 'clima' => $planet->climate, \n 'terreno' => $planet->terrain, \n 'cnt_aparicoes' => count($planet->films), \n );\n }\n\n //Insert com todos os dados\n $response = $this->model->insert( $data_planet );\n\n return response()->json( $response . ', todos os dados foram carregados e inseridos corretamente!', Response::HTTP_OK );\n \n } catch (Exception $e) {\n return response()->json( [ 'Error' => $e ], Response::HTTP_INTERNAL_SERVER_ERROR );\n }\n\n }", "public function jsonSerialize(): array\n {\n $array = [];\n foreach ($this->serializableProperties as $property) {\n $array[$property] = $this->{$property};\n }\n\n array_walk($array['attachments'], function (&$item, $key): void {\n if (!empty($item['file'])) {\n $item['data'] = $this->readFile($item['file']);\n unset($item['file']);\n }\n });\n\n return array_filter($array, function ($i) {\n return $i !== null && !is_array($i) && !is_bool($i) && strlen($i) || !empty($i);\n });\n }", "public function jsonSerialize()\n {\n return\n [\n 'cd_competencia_tecnica'=>$this->cd_competencia_tecnica,\n 'ds_competencia_tecnica'=>$this->ds_competencia_tecnica,\n 'nr_nivel'=>$this->nr_nivel\n ];\n }", "function getAllUsers(){\n //Recuperation des Donnees du Fichier sous forme de Chaine\n $file_content=file_get_contents(FILE_NAME);\n //Convertion de la chaine en Tableau\n $arr_users=json_decode($file_content,true);\n return $arr_users;\n }", "public function store_json(){\t\n\n\t\t//retorna los proyectos de una empresa especifica\n\t\t$proyectos = Modraproyectos::where('raemp_id', '=', Input::get('raemp_id'))->get();\n\t\treturn $proyectos;\n\t}", "public function values_as_array() {\n $Data = array();\n foreach ($this->__fields() as $field) {\n $v = $this->$field->cleaned_value();\n if ($v instanceof Newforms_File_Object) continue;\n $Data[$field] = $v;\n }\n return $Data;\n }", "public function gettabledata() {\n $myfile = fopen(\"data.json\", \"r\") or die(\"Unable to open file!\");\n $data = fread($myfile, filesize(\"data.json\"));\n $data = (array) json_decode($data);\n rsort($data);\n return $data;\n }", "function _csv_to_array( $file_path, bool $to_json = false ) {\n\t\treturn _fcsv_to_array( $file_path, $to_json );\n\t}", "public function asJson($content=[])\n{\n self::$stored['json'][] = $content;\n return json_encode($content);\n}", "private function MetodoDeRetornoValoresJSOM(){\n\t\t\n\t\t// Cria um array com os dados.\n\t\t$out = array(\n\t\t\t'dataAdmissao'=>date('d/m/Y', strtotime($this->DataAdmissao)),\n\t\t\t'diasTrabalhado'=>$this->DiasTrabalhado,\n\t\t\t'salarioFuncionario'=>number_format($this->SalarioFuncionario, 2, ',', '.'),\n\t\t\t'salario'=>number_format($this->Salario, 2, ',', '.'),\n\t\t\t'feriasId'=>$this->FeriasId,\n\t\t\t'diasFerias'=>$this->DiasFerias,\n\t\t\t'valorFerias'=>number_format($this->ValorFerias, 2, ',', '.'),\n\t\t\t'valorUmTercoFerias'=>number_format($this->ValorUmTercoFerias, 2, ',', '.'),\n\t\t\t'vendaUmTercoFerias'=>$this->VendaUmTercoFerias,\n\t\t\t'valorFeriasVendida'=>number_format($this->ValorFeriasVendida, 2, ',', '.'),\n\t\t\t'valorUmTercoFeriasVendida'=>number_format($this->ValorUmTercoFeriasVendida, 2, ',', '.'),\t\t\t\n\t\t\t'aliquotaIRFerias'=>$this->AliquotaIRFerias,\n\t\t\t'valorIRFerias'=>number_format($this->ValorIRFerias, 2, ',', '.'),\n\t\t\t'salarioBruto'=>number_format($this->SalarioBruto, 2, ',', '.'),\n\t\t\t'totalVencimentos'=>number_format($this->TotalVencimentos, 2, ',', '.'),\n\t\t\t'valorIR'=>number_format($this->ValorIR, 2, ',', '.'),\n\t\t\t'aliquotaIR'=>$this->AliquotaIR,\n\t\t\t'faixaIR'=>$this->Faixa,\n\t\t\t'valorInss'=>number_format($this->ValorINSS, 2, ',', '.'),\n\t\t\t'porcentagemInss'=>$this->PorcentagemInss,\n\t\t\t'valorSecundarioINSS'=>number_format($this->ValorSecundarioINSS, 2, ',', '.'),\n\t\t\t'porcSecundarioInss'=>$this->PorcSecundarioInss,\t\t\t\n\t\t\t'numDependentes'=>$this->NumDependentes,\n\t\t\t'descontoDep'=>number_format($this->DescontoDep, 2, ',', '.'),\n\t\t\t'valorPensao'=>number_format($this->ValorPensao, 2, ',', '.'),\n\t\t\t'porcPensao'=>$this->PorcentagemPensao,\n\t\t\t'valeTransporte'=>number_format($this->ValorValetran, 2, ',', '.'),\n\t\t\t'valeTransportePorc'=>$this->ValeTransportePorc,\n\t\t\t'valeRefeicao'=>number_format($this->ValorRefeicao, 2, ',', '.'),\n\t\t\t'valeRefeicaoPorc'=>$this->ValeRefeicaoPorc,\n\t\t\t'valorFaltas'=>number_format($this->ValorFaltas, 2, ',', '.'),\n\t\t\t'adiantamentoDecimoTerceiro'=>number_format($this->AdiantamentoDecimoTerceiro, 2, ',', '.'),\n\t\t\t'liquidoFerias'=>number_format($this->ValorLiquidoFerias, 2, ',', '.'),\n\t\t\t'valorLiquido'=>number_format($this->ValorLiquido, 2, ',', '.'),\n\t\t\t'valorFeriasMes1'=>number_format($this->ValorFeriasMes1, 2, ',', '.'),\n\t\t\t'valorFeriasMes2'=>number_format($this->ValorFeriasMes2, 2, ',', '.'),\t\n\t\t\t'teste'=>$this->Teste\n\t\t);\n\n\t\t// Retorna um json com os dados da folha de pagamento.\n\t\techo json_encode($out);\n\t}", "function calendarioJson() {\n \t$fp = fopen(\"ics/basic5.ics\", \"r\"); \n\t$temp = fread($fp, filesize(\"ics/basic5.ics\"));\n\t//Ver si se necesita nl2br\n\t$salida = icsAJson(json_encode(nl2br($temp)));\n\t//Este es el Json Final\n\treturn ('[' . $salida . ']');\n}", "public function get_contato_to_array(): array {\n $contatos = [];\n foreach(self::get_contatos() as $contato) {\n $contato->clean();\n $contatos[] = $contato->toArray();\n }\n return $contatos;\n }", "public function getJsonConfigfile(){\n $json = file_get_contents( $this->config_base_path.$this->jsonFile);\n //Decode JSON\n $array = json_decode($json,true);\n return $array;\n }", "public function getJsonConfigfile(){\n $json = file_get_contents( $this->config_base_path.$this->jsonFile);\n //Decode JSON\n $array = json_decode($json,true);\n return $array;\n }", "private function getStoredReservationsJsonStructure(): array\n {\n return [\n 'data' => [\n '*' => [\n 'first_name',\n 'last_name',\n 'middle_name',\n 'phone',\n 'birth_date',\n 'sex',\n 'appointment_time',\n 'webOrderId'\n ]\n ]\n ];\n }", "public function formatToArray(){\n return [\n 'nombre' => $this->name,\n 'ciudad' => $this->cityId,\n 'email' => $this->email,\n 'telefono' => $this->tel,\n 'tipo_documento' => $this->typeDoc,\n 'documento' => $this->doc,\n 'direccion' => $this->addr,\n 'direccion_referencia' => $this->addRef,\n 'coordenadas' => $this->addrCoo,\n 'ruc' => $this->ruc,\n 'razon_social' => $this->socialReason,\n ];\n }", "function getArrayByName($fileName){\n $file = $fileName.\".json\";\n global $filePath;\n $path = $filePath.$file;\n $string = file_get_contents($path);\n $arrays = json_decode($string,true);\n return $arrays;\n}", "public function jsonSerialize() : array\n {\n return $this->all();\n }", "public function jsonSerialize(): array\n {\n return $this->values;\n }", "public function convert(string $json): array;", "function ecritureDansJSON($nouvelleListe) {\n $nouvelleListe = json_encode($nouvelleListe, JSON_PRETTY_PRINT);\n $fichier = ouvrirListeMembres() ;\n fwrite($fichier, $nouvelleListe) ;\n fclose($fichier) ;\n}", "function traerTodaLaBase()\n {\n $baseJson = file_get_contents('users.json');\n $users = explode(PHP_EOL, $baseJson);\n array_pop($users);\n\n foreach($users as $user) {\n $arrayUsers[] = json_decode($user, true);\n }\n return $arrayUsers;\n }", "public function saveToJson($result)\n {\n $data = [];\n foreach ($result as $one) {\n $data['invoice'] = $one['invoice_id'];\n $data['Invoice Date'] = $one['date'];\n $data['Customer Name'] = $one['customer_name'];\n $data['Customer Address'] = $one['address'];\n $data['Product Name'] = $one['product_name'];\n $data['Quantity'] = $one['quantity'];\n $data['Price'] = $one['price'];\n $data['Total'] = $one['total'];\n $data['Grand Total'] = $one['grand_total'];\n }\n //write to json file\n $fp = fopen(__DIR__.'/../storage/json/invoices.json', 'w');\n fwrite($fp, json_encode($data));\n fclose($fp);\n }", "public function jsonSerialize()\n {\n return [\n 'ID'=> $this->getDobavljacID(),\n 'ime'=> $this->getNaziv(),\n 'granica' => $this->getGranicaPovratka()\n ];\n }", "function ajout_fichier(array $array){\n $json = json_encode($array);\n file_put_contents(FILE_QUESTION, $json);\n}", "function get_cabin_data() {\n\n // Get JSON file contents\n $cabinDataString = file_get_contents(\"cabins.json\");\n\n // Convert JSON string to php array\n $cabinDataObj = json_decode($cabinDataString);\n\n return $cabinDataObj;\n}", "function getDatos(){\n $res = $this->Consulta('SELECT C.*, P.id_planta FROM '.$this->Table .' C\n INNER JOIN\n equipos E ON E.id_equipos = C.`id_equipos`\n INNER JOIN\n secciones S ON S.id_secciones = E.id_secciones\n INNER JOIN\n plantas P ON P.id_planta = S.id_planta\n \n WHERE '.$this->PrimaryKey.' = '.$this->_datos);\n $resultado = $res[0];\n // $resultado = array_map('utf8_encode',$resultado);\n \n print_r( json_encode( $resultado ) );\n }", "public function jsonSerialize(): array\n {\n return array_merge(parent::jsonSerialize(), [\n 'cropable' => $this->cropable,\n 'ratio' => $this->ratio,\n 'size' => $this->size,\n ]);\n }", "function getAllTestJson2($lang){\n //$file = \"ressources/views/json_files/all_tests/\".$lang.\"_all_test.json\";\n $file = $_SERVER['STORAGE_BASE'] . \"/json_files/all_tests/\" . $lang . \"_all_test.json\";\n\n \t $jsondata = file_get_contents($file);\n \t // converts json data into array\n \t $arr_data = json_decode($jsondata);\n $alltest = array();\n foreach ($arr_data as $test) {\n # code...\n $alltest [$test->id_test] = [\n \"id_test\" => $test->id_test,\n \"id_theme\" => $test->id_theme,\n \"id_rubrique\" => $test->id_rubrique,\n \"statut\" => $test->statut,\n 'permissions' => $test->permissions,\n 'if_additionnal_info' => $test->if_additionnal_info,\n \"if_translated\" => $test->if_translated,\n \"has_treatment\" => $test->has_treatment,\n \"default_lang\" => $test->default_lang,\n \"titre_test\" => stripslashes((string)$test->titre_test),\n \"unique_result\" => $test->unique_result,\n \"url_image_test\" => $test->url_image_test,\n \"codes_countries\" => $test->codes_countries\n ];\n }\n\n return $alltest;\n }", "public function saveJson()\n {\n $myFile = \"barang.json\";\n $sqlQuery = \"select * from barang\";\n $json = null;\n try {\n $prepare = parent::prepare($sqlQuery);\n $prepare->execute();\n $result = $prepare->fetchAll(PDO::FETCH_ASSOC);\n\n $json = json_encode($result);\n //print_r($json);\n } catch (Exception $ex) {\n //echo 'Error : ' . $ex->getMessage();\n echo \"sistem dalam perbaikan, coba beberapa saat lagi\";\n }\n return file_put_contents($myFile, $json);\n }", "public function JSON_listCuentaEmpresaEditar($codigo){\n $lista_detalles = array();\n $dataCuenta= $this->empresa_model->listCuentaEmpresaCodigo($codigo);\n if(count($dataCuenta)>0){\n foreach ($dataCuenta as $key => $value) {\n $objeto = new stdClass();\n $objeto->CUENT_Codigo =$value->CUENT_Codigo;\n $objeto->CUENT_NumeroEmpresa =$value->CUENT_NumeroEmpresa;\n $objeto->CUENT_Titular =$value->CUENT_Titular;\n $objeto->CUENT_TipoPersona =$value->CUENT_TipoPersona;\n $objeto->CUENT_FechaRegistro =$value->CUENT_FechaRegistro;\n $objeto->BANC_Nombre =$value->BANC_Nombre;\n $objeto->MONED_Descripcion =$value->MONED_Descripcion;\n $objeto->CUENT_TipoCuenta =$value->CUENT_TipoCuenta;\n $objeto->BANC_Selec=$this->seleccionar_banco($value->BANP_Codigo);\n $lista_detalles[] = ($objeto); \n \n } \n \n }\n\n $resultado[] = array();\n $resultado = json_encode($lista_detalles,JSON_NUMERIC_CHECK);\n echo $resultado;\n\n}", "public function readAll(){\r\n\r\n // QUERY SQL PARA FAZER CONSULTA NO BANCO\r\n\t\t$sql = 'SELECT * FROM usuarios';\r\n\r\n\t\t// PREPARANDO CONEXÃO COM O BANCO\r\n\t\t$stmt = Conexao::getConn()->prepare($sql);\r\n\r\n\t\t// EXECUTANDO QUERY\r\n\t\t$stmt->execute();\r\n \r\n // VERIFICA SE TEM REGISTRO NA TABELA\r\n\t\tif ($stmt->rowCount() > 0){\r\n\r\n // ARMAZENA OS RESULTADOS \r\n\t\t\t$resultado = $stmt->fetchAll(\\PDO::FETCH_ASSOC);\r\n \r\n // RETORNA OS RESULTADOS EM JSON\r\n\t\t\treturn json_encode($resultado);\r\n\r\n }else{\r\n\r\n // CASO NÃO TENHA REGISTRO RETORNARA ARRAY VAZIO\r\n\t\t\treturn [];\r\n\r\n }\r\n\r\n }", "public function jsonSerialize()\n {\n return array_merge(parent::jsonSerialize(),[]);\n }", "public function testToGetJsonFileAsArray()\n {\n // given\n $expected = 'departureLocation';\n $expectedCount = 4;\n\n // when\n $actual = $this->tested->getJsonFromFile(DOCUMENT_ROOT . '/data/boarding-card.json');\n\n // then\n $this->assertCount($expectedCount, $actual);\n $this->assertObjectHasAttribute($expected, $actual[0]);\n }", "function read()\n\t{\n\t\t$content = $this->storage->read();\n\t\t$data = array();\n\t\tforeach($content['data'] as $key=>$value) {\n\t\t\t$storage = new \\Zentric\\Storage(array(\n\t\t\t\t'key' => $key\n\t\t\t\t, 'folder' => STORAGE\n\t\t\t\t, 'driver' => 'Array'\t\t\t\n\t\t\t));\t\t\t\n\t\t\t$data[] = $storage->read();\t\t\t \n\t\t}\n\t\treturn $data;\n\t}", "public function getJsonArray()\n {\n $json = [\n \"ip\"=>$this->getIP(),\n \"ipType\" =>$this->getIpType(),\n \"latitude\" =>$this->getLatitude(),\n \"longitude\" =>$this->getLongitude(),\n \"city\" =>$this->getCity(),\n \"country\" =>$this->getCountry(),\n ];\n return $json;\n }", "function jsonSerialize()\r\n {\r\n return $this->to_array();\r\n }", "public static function getAllToJson() {\n $jsonArray = array(); //create JSON array\n //read items\n foreach(self::getAll() as $item) {\n array_push($jsonArray, json_decode($item->toJson()));\n }\n return json_encode($jsonArray); //return JSON array\n }", "function getJson($file)\n {\n //saving the string from the files in the variable\n $contents = file_get_contents($file);\n \n //decoding the json string\n $arr = json_decode($contents, true);\n //returning the decoded array\n return $arr;\n }", "public function jsonSerialize():array\n {\n $rv = [\n 'name' => $this->name,\n 'price' => $this->price,\n 'sidelength' => $this->sidelength,\n 'area' => $this->getArea(),\n 'specials' => $this->specials\n\n ];\n return $rv;\n }", "public function asJson()\n {\n return array();\n }", "public function toJsonArray() {\n $array = $this->_properties;\n foreach ($array as $key => $value) {\n if (in_array($key, $this->fields) && !is_null($value)) {\n $parser = $this->getParser($key);\n $array[$key] = $parser->unparse($value);\n }\n else unset($array[$key]);\n }\n return $array;\n }", "function json_get()\n {\n // get data from db\n $query = $this->db->get(\"data_penjualan\");\n // insert data to array\n foreach ($query->result() as $row)\n {\n $post[] = array(\n \"id\" => $row->ID_DPENJUALAN,\n \"iduser\" => $row->ID_user,\n \"namatoko\" => $row->NAMA_TOKO,\n \"tanggal\" => $row->TGL_BELI,\n \"totalpenjualan\" => $row->TOTAL_PENJUALAN\n );\n }\n // encode json\n $response['post'] = $post;\n //echo json_encode($response, true);\n\n //write to disk\n $fp = fopen(APPPATH.'data.json', 'w');\n fwrite($fp, json_encode($post));\n fclose($fp);\n echo \"<pre>\";\n echo \"file written to \".APPPATH.'data.json';\n print_r($post);\n // END OF SYNTAX\n }", "private function toArray($data)\n {\n \t\t$resultArray = json_decode(json_encode($data), true);\n\n \t\treturn $resultArray;\n \t}", "function jsonSerialize()\n {\n return $this->to_array();\n }", "function salvarCompras($novaCompra){\n if(!file_exists('compras.json')){\n $compras[\"listaCompras\"] = [$novaCompra];\n $jsoncompras = json_encode($compras);\n file_put_contents('compras.json',json_encode($compras));\n echo \"<script>alert('Compra salva com sucesso!')</script>\";\n }else {\n // \n $jsoncompras = file_get_contents('compras.json');\n $listaCompras = json_decode($jsoncompras, TRUE);\n $listaCompras[\"listaCompras\"][] = $novaCompra;\n \n $jsonListaCompras = json_encode($listaCompras);\n file_put_contents('compras.json', $jsonListaCompras);\n }\n}", "public function jsonSerialize(): array\n {\n return [\n 'tags' => $this->tags,\n 'duration' => $this->duration,\n 'mimeType' => $this->mimeType,\n ];\n }", "protected function asArray()\n\t{\n\t\treturn \\json_decode($this->response, true);\n\t}", "function load_input_file_into_php_array() {\n#This shows the file the directory of the data info\n$file_string = file_get_contents(\"data/input.json\");\n#Adding true will ensure objects are changed to associative arrays\n$file_array = json_decode($file_string, true);\n #Prints out a message to the command line when function is excecuted\nprint \"Loading...\\n\";\n#Returning the variable will prevent a value of \"null\" showing up\n return $file_array;\n}", "public function getJsonBroDeployOverseas(){\n\t\t$query = \"Select BroDeployOverseas.post, Sum(bandwidth.capacity) as capacity, BroDeployOverseas.regularworkstation, BroDeployOverseas.regworkdeployed, BroDeployOverseas.regworkremaining,\n\t\t\tBroDeployOverseas.latitude, BroDeployOverseas.longitude, BroDeployOverseas.regworkpercentcompleted, BroDeployOverseas.vsenpercentcompleted,\n\t\t\tBroDeployOverseas.region, BroDeployOverseas.vsencompatableworkstation, BroDeployOverseas.vsendeployed, BroDeployOverseas.vsenremaining\n\t\t\tFrom public.BroDeployOverseas, public.bandwidth\n\t\t\tWhere BroDeployOverseas.post = bandwidth.post\n\t\t\tGroup By BroDeployOverseas.post, BroDeployOverseas.region, \n\t\t\tBroDeployOverseas.regworkpercentcompleted, BroDeployOverseas.vsenpercentcompleted, \n\t\t\tBroDeployOverseas.regularworkstation, BroDeployOverseas.regworkdeployed, BroDeployOverseas.regworkremaining,\n\t\t\tBroDeployOverseas.vsencompatableworkstation,\n\t\t\tBroDeployOverseas.vsendeployed, BroDeployOverseas.vsenremaining,\n\t\t\tBroDeployOverseas.latitude, BroDeployOverseas.longitude; \n\t\t\"; // There might be a better way to do this.\n\t\t$result = $this->connectPG($query);\t\t\t\n\t\t$rows = pg_fetch_all($result);\t\n\n\t\t$jsonArrayOfObjs = \"[\";\n\t\tforeach($rows as $keys => $datums){\n\t\t\t//Build JSON string\n\t\t\t$rows2 = array_keys($rows);\n\t\t\tif(end($rows2) == $keys){\n\t\t\t\t//This will be the last element in the array of objects\n\t\t\t\t$jsonArrayOfObjs .= \"{\";\n\t\t\t \t$jsonArrayOfObjs .= \"\\\"region\\\":\\\"\".trim($datums['region']).\"\\\", \\\"post\\\":\\\"\".trim($datums['post']).\"\\\",\"; \n\t\t\t \t$jsonArrayOfObjs .= \"\\\"regularworkstation\\\":\".$datums['regularworkstation'].\", \\\"regworkdeployed\\\":\".$datums['regworkdeployed'].\",\";\n\t\t\t \t$jsonArrayOfObjs .= \"\\\"regworkremaining\\\":\".$datums['regworkremaining'].\", \\\"regworkpercentcompleted\\\":\".$datums['regworkpercentcompleted'].\",\";\n\t\t\t \t$jsonArrayOfObjs .= \"\\\"vsencompatableworkstation\\\":\".$datums['vsencompatableworkstation'].\", \\\"vsendeployed\\\":\".$datums['vsendeployed'].\",\";\n\t\t\t \t$jsonArrayOfObjs .= \"\\\"vsenremaining\\\":\".$datums['vsenremaining'].\", \\\"vsenpercentcompleted\\\":\".$datums['vsenpercentcompleted'].\", \\\"capacity\\\":\".$datums['capacity'].\",\";\n\t\t\t \t$jsonArrayOfObjs .= \"\\\"latitude\\\":\".$datums['latitude'].\", \\\"longitude\\\":\".$datums['longitude'].\"\";\n\t\t \t$jsonArrayOfObjs .= \"}\";\n\t\t\t}else{\n\t\t\t\t$jsonArrayOfObjs .= \"{\";\n\t\t\t \t\t$jsonArrayOfObjs .= \"\\\"region\\\":\\\"\".trim($datums['region']).\"\\\", \\\"post\\\":\\\"\".trim($datums['post']).\"\\\",\"; \n\t\t\t \t$jsonArrayOfObjs .= \"\\\"regularworkstation\\\":\".$datums['regularworkstation'].\", \\\"regworkdeployed\\\":\".$datums['regworkdeployed'].\",\";\n\t\t\t \t$jsonArrayOfObjs .= \"\\\"regworkremaining\\\":\".$datums['regworkremaining'].\", \\\"regworkpercentcompleted\\\":\".$datums['regworkpercentcompleted'].\",\";\n\t\t\t \t$jsonArrayOfObjs .= \"\\\"vsencompatableworkstation\\\":\".$datums['vsencompatableworkstation'].\", \\\"vsendeployed\\\":\".$datums['vsendeployed'].\",\";\n\t\t\t \t$jsonArrayOfObjs .= \"\\\"vsenremaining\\\":\".$datums['vsenremaining'].\", \\\"vsenpercentcompleted\\\":\".$datums['vsenpercentcompleted'].\", \\\"capacity\\\":\".$datums['capacity'].\",\";\n\t\t\t \t$jsonArrayOfObjs .= \"\\\"latitude\\\":\".$datums['latitude'].\", \\\"longitude\\\":\".$datums['longitude'].\"\";\n\t\t \t$jsonArrayOfObjs .= \"},\";\n\t\t\t}\n\n\t\t} \n\t\t$jsonArrayOfObjs .= \"]\"; \n\t\t//error_log($jsonArrayOfObjs);\n\n\t\t$cleanJsonStr = json_decode($jsonArrayOfObjs);\n\n\t\t//Validate the JSON\n\t\tif($cleanJsonStr === NULL){error_log(\"Error in JSON in getJsonBroDeployOverseas() method.\"); }else{return $jsonArrayOfObjs;}\n\t}", "public static function arr($json)\n {\n return self::decode($json,TRUE);\n }", "function to_json_array($stg){\n $result = str_replace(\"[\",\"\",$stg);\n $result = str_replace(\"]\",\"\",$result);\n $details_array = json_decode($result, true);\n return $details_array;\n}", "public function importArray($data);", "public function jsonSerialize()\r\n {\r\n // TODO: Implement jsonSerialize() method.\r\n return [\r\n 'codigo' => $this->getCodigo(),\r\n 'uf' => $this->getUf(),\r\n 'nome' => $this->getNome()\r\n ];\r\n }" ]
[ "0.6715439", "0.65858215", "0.6408558", "0.64028347", "0.63376933", "0.62414634", "0.61097026", "0.60281396", "0.60128105", "0.6012685", "0.59316826", "0.5928342", "0.59181595", "0.5902828", "0.5899004", "0.5886417", "0.587656", "0.58518636", "0.58345914", "0.5833715", "0.5828562", "0.5823043", "0.5821299", "0.5819568", "0.5813629", "0.58060676", "0.5797572", "0.5779152", "0.5768534", "0.576618", "0.5765628", "0.57620907", "0.5758554", "0.57521385", "0.5742658", "0.5741671", "0.5738782", "0.5738736", "0.572388", "0.5711781", "0.5710964", "0.571013", "0.57020736", "0.56947786", "0.5668779", "0.5668169", "0.5666203", "0.5649356", "0.5644316", "0.5641591", "0.56391203", "0.5629196", "0.5626776", "0.562482", "0.5616994", "0.5615592", "0.560651", "0.56057334", "0.55979687", "0.55979687", "0.5594712", "0.5588963", "0.5586281", "0.5582999", "0.55822706", "0.5572573", "0.55667484", "0.5564262", "0.55474454", "0.5546937", "0.55452174", "0.5530074", "0.5525216", "0.5514834", "0.5512082", "0.5503234", "0.54989904", "0.5496018", "0.5488977", "0.54846126", "0.5478843", "0.54785275", "0.5478149", "0.547063", "0.5467381", "0.54558986", "0.54532874", "0.5451692", "0.54433656", "0.54411155", "0.5440187", "0.54281324", "0.5425697", "0.54231656", "0.542256", "0.5419313", "0.54192924", "0.54147", "0.54106814", "0.5401737" ]
0.6407289
3
conta Quantos cadastros existem
function contaNumeroCadastros(){ if ($GLOBALS['cadastros'] == null) {//se não tiver nenhum cadastro $GLOBALS['quantidadeCadastros'] = 0;//numero de pessoas cadastradas = 0 }else{ $GLOBALS['quantidadeCadastros'] = count($GLOBALS['cadastros']);//salva na variavel global quantidadeCadastros o número de cadastros } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function exists() {\r\n\t\t$sql_inicio \t= \" select * from \".$this->table.\" where \";\r\n\t\t$sql_fim \t\t= \" \".($this->get($this->pk) ? \" and \".$this->pk.\" <> \".$this->get($this->pk) : \"\").\" limit 1 \";\r\n\t\t\r\n\t\t$sql \t= \"con_id = \".$this->get(\"con_id\").\" and exa_id = \".$this->get(\"exa_id\").\" \";\r\n\t\tif (mysql_num_rows(Db::sql($sql_inicio.$sql.$sql_fim))){\r\n\t\t\t$this->propertySetError (\"con_id\", \"Já existe no banco de dados.\");\r\n\t\t\t$this->propertySetError (\"exa_id\", \"Já existe no banco de dados.\");\r\n\t\t}\r\n\t}", "function existe($id_desig){\r\n $sql=\"select * from suplente where id_desig_suplente=$id_desig\";\r\n $res=toba::db('designa')->consultar($sql);\r\n \r\n if(count($res)>0){\r\n return true;\r\n }else{\r\n return false;\r\n }\r\n }", "function buscar() //funcion para ver si el registro existe \n\t{\n\t$sql=\"select * from slc_unid_medida where nomenc_unid_medida= '$this->abr' and desc_unid_medida= '$this->des'\"; \n\t $result=mysql_query($sql,$this->conexion);\n\t $n=mysql_num_rows($result);\n\t if($n==0)\n\t\t\t return 'false';\n\t\t\telse\n\t\t\t return 'true';\n\t}", "public function existeComentario($idComentario, $idAnuncio){ \n $query = \"SELECT idComentario FROM final_comentario WHERE idComentario='\".$idComentario.\"' AND idAnuncio='\".$idAnuncio.\"'\"; \n return mysqli_num_rows($this->con->action($query))> 0 ? True : False; \n }", "function existe_ocupacion ($ocupacion){\n\t\t\t\tinclude(\"bd_conection.php\");\n\t\t\t\t$result = @mysqli_query($con, \"SELECT * FROM ocupaciones WHERE ocupacion_tipo LIKE '$ocupacion'\");\n\t\t\t\t$rowcount=mysqli_num_rows($result);\n\t\t\t\tif ($rowcount > 0){\t\n\t\t\t\t\twhile($ocupacionExist = @mysqli_fetch_assoc($result)) { \n\t\t\t\t\t\treturn $ocupacionExist['ocupacion_tipo'];\n\t\t\t\t\t}\n\t\t\t\t}else if ($ocupacion !== \"\") {\n\t\t\t\t\t@mysqli_query($con, \"INSERT INTO ocupaciones (ocupacion_tipo) VALUES ('$ocupacion')\");\t\t\t\n\t\t\t\t\treturn $ocupacion;\n\t\t\t\t}\n\t\t\t}", "function ocupa_reserva($id_desig){\n $sql=\"select * from reserva_ocupada_por where id_designacion=\".$id_desig;\n $res= toba::db('designa')->consultar($sql);\n if(count($res)>0){\n return true;\n }else{\n return false;\n }\n }", "function verificar_existencia_profesor_espacio(){\n\t\t$sql_verif= \"SELECT * FROM \n \t\t\t\tPROF_ESPACIO\n \t\t\tWHERE(\n \t\t\t\tCODESPACIO = '$this->CODESPACIO'\n \t\t\t)\n \t\t\t\";\n\nreturn $this->mysqli->query($sql_verif)->num_rows>=1;\n\n}", "function existe_definitiva ($datos){\n $cuatrimestre=$this->obtener_cuatrimestre();\n $fecha= getdate();\n $anio=$fecha['year'];\n //$resultado=FALSE;\n //en la fecha actual no debe existir ninguna asignacion por periodo o parte de la misma\n //incluir en JOIN asignacion_periodo AND ($fecha_actual BETWEEN t_p.fecha_inicio AND t_p.fecha_fin)\n $fecha_actual=date('y-m-d');\n// $sql=\"(SELECT t_a.id_asignacion, t_a.finalidad, t_a.hora_inicio, t_a.hora_fin \n// FROM asignacion t_a \n// JOIN aula t_au ON (t_a.id_aula=t_au.id_aula)\n// JOIN asignacion_definitiva t_d ON (t_a.id_asignacion=t_d.id_asignacion)\n// WHERE t_d.nombre='{$this->s__dia}' AND t_d.cuatrimestre=$cuatrimestre AND t_d.anio=$anio AND t_au.id_aula={$datos['id_aula']} AND ('{$datos['hora_inicio']}' BETWEEN t_a.hora_inicio AND t_a.hora_fin) AND ('{$datos['hora_fin']}' BETWEEN t_a.hora_inicio AND t_a.hora_fin)) \n// \n// UNION \n// \n// (SELECT t_a.id_asignacion, t_a.finalidad, t_a.hora_inicio, t_a.hora_fin \n// FROM asignacion t_a\n// JOIN aula t_au ON (t_a.id_aula=t_au.id_aula)\n// JOIN asignacion_periodo t_p ON (t_a.id_asignacion=t_p.id_asignacion )\n// JOIN esta_formada t_f ON (t_p.id_asignacion=t_f.id_asignacion) \n// WHERE t_f.nombre='{$this->s__dia}' AND t_f.cuatrimestre=$cuatrimestre AND t_f.anio=$anio AND t_au.id_aula={$datos['id_aula']} AND ('{$datos['hora_inicio']}' BETWEEN t_a.hora_inicio AND t_a.hora_fin) AND ('{$datos['hora_fin']}' BETWEEN t_a.hora_inicio AND t_a.hora_fin)) \n// \";\n// $asignacion=toba::db('gestion_aulas')->consultar($sql);\n $asignaciones=$this->dep('datos')->tabla('asignacion')->get_asignaciones_por_aula($datos['dia_semana'], $cuatrimestre, $anio, $datos['id_aula']);\n \n //print_r($asignaciones);exit();\n \n //el formato de este arreglo es : indice => array('id_aula'=>x 'aula'=>y). La función solamente\n //requiere el id_aula\n $aulas=array(array('id_aula'=>$datos['id_aula']));\n \n //obtenemos un arreglo con todos los horarios disponibles\n $horarios_disponibles=$this->obtener_horarios_disponibles($aulas, $asignaciones);\n \n// print_r(\"<br><br> Estos son los horarios disponibles : <br><br>\");\n// print_r($this->s__horarios_disponibles);exit();\n return ($this->verificar_inclusion_de_horario($datos['hora_inicio'], $datos['hora_fin']));\n //$resultado=TRUE;\n //}\n \n //return $resultado;\n }", "function existeAsignatura($base, $id, $id_titulacion)\n{\n $query = \"SELECT `id` FROM `asignaturas`\n WHERE `id`=\" . $id . \" AND `id_titulacion`=\" . $id_titulacion . \";\";\n $resultado = $base->query($query);\n if (empty($resultado->fetchAll())) {\n return false;\n }\n $resultado->closeCursor();\n return true;\n}", "public function VerificaArqueosCaja()\n{\n\tself::SetNames();\n\t$sql = \" select * from arqueocaja where statusarqueo = ? \";\n\t$stmt = $this->dbh->prepare($sql);\n\t$stmt->execute( array('1') );\n\t$num = $stmt->rowCount();\n\tif($num==0)\n\t{\n\t\techo \"<div class='alert alert-danger'>\";\n\t\techo \"<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>&times;</button>\";\n\t\techo \"<center><span class='fa fa-info-circle'></span> NO EXISTEN ARQUEOS DE CAJAS DISPONIBLES PARA PROCESAR VENTAS</center>\";\n\t\techo \"</div>\";\n\t\texit;\n\t}\n\telse\n\t{\n\t\tif($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t{\n\t\t\t$this->p[] = $row;\n\t\t}\n\t\treturn $this->p;\n\t\t$this->dbh=null;\n\t}\n}", "function existen_registros($tabla, $filtro = '') {\n if (!empty($filtro))\n $sql = \"select count(*) from \" . trim($tabla) . \" where {$filtro}\";\n else\n $sql = \"select count(*) from \" . trim($tabla);\n // print_r($sql);exit;\n $bd = new conector_bd();\n $query = $bd->consultar($sql);\n $row = pg_fetch_row($query);\n if ($row[0] > 0)\n return true;\n else\n return false;\n }", "public function colaboradores_sem_competencia(){\n //where ((B.data_inserida-'$data') && (C.data_inserida-'$data') )>tempo_sem_atualizar\n return $this->db->query(\"select * from colaboradores A where not exists (select * from competencias_colaboradores B where A.ID_colaborador=B.colaboradores_id_colaborador) and status_colaborador=0\");\n }", "function darbajaExpediente() {\n $parametros = array($this->getIdExpediente());\n $query = $this->db->query(\"CALL USP_STD_D_BajaExpediente(?)\", $parametros);\n if ($query) {\n return true;\n } else {\n return false;\n }\n }", "function func_existeDato($dato, $tabla, $columna){\n selectConexion('onmworkflow');\n $query = \"select * from $tabla where $columna = '$dato' ;\";\n $result = pg_query($query) or die (\"Error al realizar la consulta\");\n if (pg_num_rows($result)>0)\n {\n return true;\n } else {\n return false;\n }\n }", "function dadosCadastros(){//função geral que será chamada na index\n pegaCadastrosJson();//pega os valores dos cadastros do arquivo JSON e salva em um array\n contaNumeroCadastros();//conta Quantos cadastros existem\n }", "private function existenciaDatos() {\n\t\t\tif($this->peticion->post->existencia('boton') == true):\n\t\t\t\t$this->cargarGuion();\n\t\t\telse:\n\t\t\t\texit('El Formulario no proceso los Datos');\n\t\t\tendif;\n\t\t}", "public function check(){\n $query = \"SELECT ordine.id_ordine, ordine.id_fornitore, fornitore.nome as fornitore, ordine.articolo, articolo.taglia, ordine.stato \n FROM \" . $this->table_name . \" LEFT JOIN fornitore ON ordine.id_fornitore = fornitore.id_fornitore \n INNER JOIN articolo ON ordine.id_ordine = articolo.id_ordine WHERE stato = 3\";\n $stmt = $this->conn->prepare( $query );\n $stmt->execute();\n return $stmt;\n }", "function existe($tabla,$campo,$where){\n\treturn (count(CON::getRow(\"SELECT $campo FROM $tabla $where\"))>0)?true:false;\n}", "private function checkIsExists(): bool\n {\n $where = [\n $this->table. '.vendorId' => $this->vendorId,\n $this->table. '.campaign' => $this->campaign,\n ];\n\n if (!is_null($this->id)) {\n $where[$this->table. '.id !='] = $this->id;\n }\n\n $id = $this->readImproved([\n 'what' => [$this->table. '.id'],\n 'where' => $where\n ]);\n\n return !is_null($id);\n }", "public function cadastra()\n {\n $query = \"INSERT INTO noticia (titulo, idCategoria, conteudo) \n VALUES (:titulo, :idCategoria, :conteudo)\";\n\n $stmt = $this->db->prepare($query);\n $stmt->bindValue(':titulo', $this->titulo);\n $stmt->bindValue(':idCategoria', $this->idCategoria);\n $stmt->bindValue(':conteudo', $this->conteudo);\n $stmt->execute();\n\n //verifica se foi cadastrado\n if($stmt->rowCount()){\n return true;\n }else{\n return false;\n }\n }", "private function existeusuario($usuario)\n {\n $stmt = $this->con->prepare(\"SELECT id_conductor FROM `carga` WHERE id_conductor = ?\");\n $stmt->bind_param(\"s\", $usuario);\n $stmt->execute(); \n $stmt->store_result();\n\n return $stmt->num_rows > 0;\n }", "function existsInDB($table, $condicionesExist){\n\t\t$query = \"SELECT count(*) as cuenta FROM `$table` WHERE $condicionesExist;\";\n\t\t//echo \"Consulta Exists: \".$query.\"\\n\";\n\t\t$query = utf8_decode($query);\n\t\t$db = $this->conectaBD();\n\t\tif ($db->real_query($query)) {\n\t\t //If the query was successful\n\t\t $res = $db->use_result();\n\t\t $row = $res->fetch_assoc();\n\t\t $cuenta = $row['cuenta'];\n\t\t $db->close();\n\t\t return $cuenta;\n\t\t}\n\t else{\n\t\t //If the query was NOT successful\n\t\t echo \"Error existsInDB()\";\n\t\t echo \"Ha ocurrido un error. Error No.: \";\n\t\t echo $db->errno;\n\t\t}\n\t\t$db->close();\n\t}", "function tiene_dao($id_desig){\n $sql=\"select * from designacion where id_designacion=$id_desig and id_departamento is not null and id_area is not null and id_orientacion is not null\";\n $res=toba::db('designa')->consultar($sql);\n if(count($res)>0){\n return 1;\n }else{\n return 0;\n }\n }", "public function verificarLoteExistente()\r\n {\r\n $datos = $_SESSION['idLote'];\r\n $anoImpositivo = $datos[0]->ano_impositivo;\r\n $rangoInicial = $datos[0]->rango_inicial;\r\n $rangoFinal = $datos[0]->rango_final;\r\n \r\n \r\n $busquedaLote = Calcomania::find()\r\n \r\n\r\n ->select('*')\r\n \r\n ->where('nro_calcomania between '. $rangoInicial .' and '.$rangoFinal)\r\n ->andWhere('estatus =:estatus' , [':estatus' => 0])\r\n ->andWhere('ano_impositivo =:ano_impositivo' , [':ano_impositivo' => $anoImpositivo])\r\n ->all();\r\n\r\n\r\n if ($busquedaLote == true){\r\n return true;\r\n }else{\r\n return false;\r\n }\r\n }", "function checarLexicoExistente($projeto, $nome) {\r\n //test if the variable is not null\r\n assert($projeto != NULL);\r\n assert($nome != NULL);\r\n //test if a variable has the correct type\r\n assert(is_string($projeto));\r\n assert(is_string($nome));\r\n\r\n $naoexiste = false;\r\n\r\n $r = bd_connect() or die(\"Erro ao conectar ao SGBD<br>\" . mysql_error() . \"<br>\" . __FILE__ . __LINE__);\r\n $q = \"SELECT * FROM lexico WHERE id_projeto = $projeto AND nome = '$nome' \";\r\n //test if the variable is not null\r\n assert($q != NULL);\r\n $qr = mysql_query($q) or die(\"Erro ao enviar a query de select no lexico<br>\" . mysql_error() . \"<br>\" . __FILE__ . __LINE__);\r\n //test if the variable is not null\r\n assert($qr != NULL);\r\n $resultArray = mysql_fetch_array($qr);\r\n if ($resultArray == false) {\r\n $naoexiste = true;\r\n } else {\r\n //nothing to do\r\n }\r\n\r\n $q = \"SELECT * FROM sinonimo WHERE id_projeto = $projeto AND nome = '$nome' \";\r\n //test if the variable is not null\r\n assert($q != NULL);\r\n $qr = mysql_query($q) or die(\"Erro ao enviar a query de select no lexico<br>\" . mysql_error() . \"<br>\" . __FILE__ . __LINE__);\r\n //test if the variable is not null\r\n assert($qr != NULL);\r\n $resultArray = mysql_fetch_array($qr);\r\n\r\n if ($resultArray != false) {\r\n $naoexiste = false;\r\n } else {\r\n //nothing to do\r\n }\r\n\r\n return $naoexiste;\r\n}", "public static function existe ($usuario,$contrasena){\n $existe=false;\n self::setConexion();\n $resultado=self::$conexion->query(\"SELECT * FROM cuenta WHERE contrasena='$contrasena' AND usuario='$usuario'\");\n $totalFilas=$resultado->rowCount();\n \n if(!$resultado->rowCount()==0){\n //throw Exception(\"YA EXISTE UNA CUENTA CON ESE USUARIO Y CONTRASEÑA\");\n $existe=true;\n }\n return $existe;\n }", "function existeTitulacion($base, $id)\n{\n $query = \"SELECT `id` FROM `titulaciones` WHERE `id`=\" . $id;\n $resultado = $base->query($query);\n if (empty($resultado->fetchAll())) {\n return false;\n }\n $resultado->closeCursor();\n return true;\n}", "private function existeusuario2($usuario)\n {\n $stmt = $this->con->prepare(\"SELECT id_conductor FROM `descuento` WHERE id_conductor = ?\");\n $stmt->bind_param(\"s\", $usuario);\n $stmt->execute(); \n $stmt->store_result();\n return $stmt->num_rows > 0;\n }", "function comprovaCategoriaProducte($idProducte,$idCategoria){\n $conn=connexioBD();\n $existe=false;\n $sql=\"SELECT * FROM categoria_producte WHERE categoria_id='$idCategoria' and producte_id='$idProducte'\";\n if (!$resultado =$conn->query($sql)){\n die(\"Error al comprobar datos\".$conn->error);\n }\n if($resultado->num_rows==1){\n $existe=true;\n }\n return $existe;\n $resultado->free();\n $conn->close();\n}", "public function existeCorreo(){\n $this -> Conexion -> abrir();\n $this -> Conexion -> ejecutar( $this -> ClienteDAO -> existeCorreo());\n $this -> Conexion -> cerrar();\n return $this -> Conexion -> numFilas();\n }", "function existeFechaPrestadorCiudadTiempo($idPrestador, $fecha, $idCiudad, $conectar)\n{\n\t//Separo la fecha para la verificacion\n\t$fechaSeparada = explode('-', $fecha);\n\t$mes = $fechaSeparada[1];\n\t$ano = $fechaSeparada[0];\n\t$fechaSeparada = explode(' ', $fechaSeparada[2]);\n\t$dia = $fechaSeparada[0];\n\n\t$sql = mysql_query(\"\n\tSELECT \n\t\th.`id`\n\tFROM \n\t\thoras_prestadores h\n\tWHERE \n\t\th.`prestador`=$idPrestador AND \n\t\th.`ciudad`<>$idCiudad AND \n\t\th.`hora` BETWEEN '\".$ano.\"-\".$mes.\"-\".$dia.\" 00:00:00' AND '\".$ano.\"-\".$mes.\"-\".$dia.\" 23:59:59'\n\t\", $conectar);\n\t\n\tif(mysql_num_rows($sql) == 0)//Si no existen\n\t{\n\t\treturn false;\n\t}\n\telse \n\t{\n\t\treturn true;\n\t}\n}", "function existeCedula($cedula) {\r\n $sql = \"select idparticipante from dbparticipantes where cedula = \".$cedula.\" and terminoscondiciones = 1\";\r\n $res = $this->query($sql,0);\r\n\r\n if (mysql_num_rows($res)>0) {\r\n return 1;\r\n }\r\n return 0;\r\n}", "public function existeLugar(){\n $modelSearch = new LugarSearch();\n $resultado = $modelSearch->busquedadGeneral($this->attributes);\n if($resultado->getTotalCount()){ \n foreach ($resultado->models as $modeloEncontrado){\n $modeloEncontrado = $modeloEncontrado->toArray();\n $lugar[\"id\"]=$modeloEncontrado['id']; \n #borramos el id, ya que el modelo a registrar aun no tiene id\n $modeloEncontrado['id']=\"\";\n \n //si $this viene con id cargado, nunca va a encontrar el parecido\n if($this->attributes==$modeloEncontrado){\n $this->addError(\"notificacion\", \"El lugar a registrar ya existe!\");\n $this->addError(\"lugarEncontrado\", $lugar);\n }\n }\n }\n }", "public function existe (){\n\t\t$req = $this->bdd->prepare('SELECT COUNT(id) FROM `Article` WHERE id = ?');\n\t\t$req->execute(array($this->id));\n\t\t$donnees = $req->fetch();\n\t\t$req->closeCursor(); // Important : on libère le curseur pour la prochaine requête\n\t\tif ($donnees[0] == 0){ // Si l'id n'est pas dans la base de donnée, l'article n'existe pas\n\t\t\treturn false;\n\t\t}\n\t\treturn true ;\n\t}", "public function esiste()\n {\n global $dbconn;\n $query = \"SELECT * FROM comuni WHERE id_comune='{$this->id_comune}'\";\n $comando = $dbconn->prepare($query);\n $esegui = $comando->execute();\n\n return ($esegui == true && $comando->fetch(PDO::FETCH_ASSOC) == true);\n }", "function existeFechaPrestador($idPrestador, $fecha, $idCiudad, $conectar)\n{\n\t$sql = mysql_query(\"\n\tSELECT \n\t\th.`id` \n\tFROM \n\t\thoras_prestadores h\n\tWHERE \n\t\th.`prestador`=$idPrestador AND \n\t\th.`ciudad`=$idCiudad AND \n\t\th.`hora`='$fecha'\n\t\", $conectar);\n\t\n\tif(mysql_num_rows($sql) == 1)\n\t{\n\t\treturn true;\n\t}\n\telse \n\t{\n\t\treturn false;\n\t}\n}", "public function guardar_nuevos() {\n $recursos_a_guardar = array();\n $recursos_chequeados = Input::post('check');\n $descripciones = Input::post('descripcion');\n $activos = Input::post('activo');\n if ($recursos_chequeados) {\n foreach ($recursos_chequeados as $valor) {\n if (empty($descripciones[$valor])) {\n Flash::error('Existen Recursos Seleccionados que no tienen especificada una Descripción');\n return FALSE;\n }\n $data = null;\n $data = $this->recursos_nuevos[$valor];\n $data['descripcion'] = $descripciones[$valor];\n $data['activo'] = $activos[$valor];\n $recursos_a_guardar[] = $data;\n }\n } else {\n return FALSE;\n }\n $this->begin();\n foreach ($recursos_a_guardar as $e) {\n if (!$this->save($e)) {\n $this->rollback();\n return FALSE;\n }\n }\n $this->commit();\n return TRUE;\n }", "function existenNotasRegistradas($matricula){\n return false;\n }", "function no_existe_versiculo_en_referencia($versiculo_id, $cita)\n{\n $dato = torrefuerte\\Models\\Referencia::where('versiculo_id', $versiculo_id)\n ->where('cita', $cita)->first();\n\n if( is_null($dato)){\n return true;\n }else{\n return false;\n }\n}", "private function checkIsExists(): bool\n {\n $id = $this->readImproved([\n 'what' => [$this->table. '.id'],\n 'where' => [\n $this->table. '.listId' => $this->listId,\n $this->table. '.campaignId' => $this->campaignId,\n ]\n ]);\n\n return !is_null($id);\n }", "function exist() {\n\t\t\t$exist = $this->db->prepare(\"SELECT 1 FROM HISTORIC WHERE nameFile = ? AND idArt = ? \");\n\t\t\t$exist->execute(array($this->nameFile, $this->idArt));\n\t\t\treturn count($exist->fetchAll()) >= 1;\n\t\t}", "public function DBCarregar($que = null)\n {\n $oDbl = $this->getoDbl_Select();\n $nom_tabla = $this->getNomTabla();\n if (isset($this->iid_region)) {\n if (($oDblSt = $oDbl->query(\"SELECT * FROM $nom_tabla WHERE id_region='$this->iid_region'\")) === false) {\n $sClauError = 'Region.carregar';\n $_SESSION['oGestorErrores']->addErrorAppLastError($oDbl, $sClauError, __LINE__, __FILE__);\n return false;\n }\n $aDades = $oDblSt->fetch(\\PDO::FETCH_ASSOC);\n // Para evitar posteriores cargas\n $this->bLoaded = TRUE;\n switch ($que) {\n case 'tot':\n $this->aDades = $aDades;\n break;\n case 'guardar':\n if (!$oDblSt->rowCount()) return false;\n break;\n default:\n // En el caso de no existir esta fila, $aDades = FALSE:\n if ($aDades === FALSE) {\n $this->setNullAllAtributes();\n } else {\n $this->setAllAtributes($aDades);\n }\n }\n return true;\n } else {\n return false;\n }\n }", "public function publicacaoConcluir()\r\n {\r\n try\r\n {\r\n $resposta = $this->conexao->Conectar()->prepare(\"UPDATE tbmissao SET id_usuario_concluir = ?, data_conclusao = NOW(), status = 1, conclusao = ? \"\r\n . \" WHERE id_missao = ?\");\r\n $resposta->bindValue(1, $this->getIdUsuarioConcluir(), PDO::PARAM_STR);\r\n $resposta->bindValue(2, $this->getSolucao(), PDO::PARAM_STR);\r\n $resposta->bindValue(3, $this->getIdMissao(), PDO::PARAM_STR);\r\n //$resposta->bindValue(3, $this->getData(), PDO::PARAM_STR);\r\n if($resposta->execute())\r\n {\r\n return true;\r\n }\r\n else\r\n {\r\n return false;\r\n }\r\n }\r\n catch (PDOException $e)\r\n {\r\n return $e->getMenssage();\r\n }\r\n }", "public function TieneCobranzasVigentes()\n\t{\n\t\t$q = Doctrine_Query::create()\n\t\t->from('CobranzaLiquidacion cl')\n\t\t->innerJoin('cl.Factura f')\n\t\t->andWhere('f.FechaAnulacion IS NULL')\n\t\t->where('cl.FacturaId = ?', $this->Id);\n\t\t \n\t\t$liquidaciones\t=\t $q->execute();\n\t\t\n\t\tif(count($liquidaciones) > 0)\n\t\t\treturn true;\n\t\t\n\t\treturn false;\n\t\t\n\t\t\n\t\t\n\t\t\n\t}", "public function checkCitatbCasos()\n {\n $sql = \"SELECT cs.id_cita FROM citas c INNER JOIN casos cs ON c.id = cs.id_cita INNER JOIN detalle_solicitud d ON c.id_detalle = d.id_detalle WHERE d.id_detalle = ?\";\n $params = array($this->id_detalle);\n return Database::getRow($sql, $params);\n }", "function existe ($aulas, $aula){\n $existe=FALSE;\n \n if(count($aulas) != 0){\n $indice=0;\n $longitud=count($aulas);\n while(($indice < $longitud) && !$existe){\n //strcmp($aulas[$indice]['id_aula'], $aula['id_aula'])==0\n $existe=($aulas[$indice]['id_aula'] == $aula['id_aula']) ? TRUE : FALSE;\n $indice += 1;\n }\n }\n return $existe;\n }", "function buscar_si_existe_simbolo_final($id_palabra,$id_tipo_simbolo,$marco,$contraste,$sup_con_texto,$sup_idioma,$sup_mayusculas,$sup_font,$inf_con_texto,$inf_idioma,$inf_mayusculas,$inf_font,$id_imagen,$sup_id_traduccion,$inf_id_traduccion) {\n\t\t$query = \"SELECT *\n\t\tFROM simbolos\n\t\tWHERE id_palabra='$id_palabra' \n\t\tAND id_tipo_simbolo='$id_tipo_simbolo'\n\t\tAND marco='$marco'\n\t\tAND contraste='$contraste'\n\t\tAND sup_con_texto='$sup_con_texto'\n\t\tAND sup_idioma='$sup_idioma'\n\t\tAND sup_mayusculas='$sup_mayusculas'\n\t\tAND sup_font='$sup_font'\n\t\tAND inf_con_texto='$inf_con_texto'\n\t\tAND inf_idioma='$inf_idioma'\n\t\tAND inf_mayusculas='$inf_mayusculas'\n\t\tAND inf_font='$inf_font'\n\t\tAND id_imagen='$id_imagen'\n\t\tAND sup_id_traduccion='$sup_id_traduccion'\n\t\tAND inf_id_traduccion='$inf_id_traduccion'\";\n\n\t\t$connection = mysql_connect($this->HOST, $this->USERNAME, $this->PASSWORD);\n\n\t\t$SelectedDB = mysql_select_db($this->DBNAME);\n\t\t$result = mysql_query($query); \n\t\t\n\t\t$numrows = mysql_num_rows($result);\n\t\n\t\t// COMPROBAMOS QUE HAYA RESULTADOS\n\t\t// SI EL NUMERO DE RESULTADOS ES 0 SIGNIFICA QUE NO HAY REGISTROS CON ESOS DATOS\n\t\tif ($numrows == 0) {\n\t\t\tmysql_close($connection);\n\t\t\treturn 0;\n\t\t}\n\t\telse {\n\t\t\tmysql_close($connection);\n\t\t\treturn 1;\n\t\t}\n\t}", "function existe($tabla,$campo,$where){\n\t$query=$GLOBALS['cn']->query('SELECT '.$campo.' FROM '.$tabla.' '.$where);\n\treturn (mysql_num_rows($query)>0)?true:false;\n}", "private function appConsolaExistencia() {\r\n\t\t\t$archivo = implode(DIRECTORY_SEPARATOR, array_merge(array($this->consolaRuta), $this->objeto)).'.php';\r\n\t\t\tif(file_exists($archivo) == true):\r\n\t\t\t\t$this->appConsolaLectura($archivo);\r\n\t\t\telse:\r\n\t\t\t\tthrow new \\RuntimeException(sprintf('El Archivo de Consola: %s, de la aplicación: %s, no existe', $this->objeto, $this->aplicacion));\r\n\t\t\tendif;\r\n\t\t}", "function usuario_existe($usuario){\n\t$sql = \"SELECT id FROM usuarios WHERE usuario = '$usuario'\";\n\n\t$resultado = query($sql);\n\n\tif(contar_filas($resultado) == 1){\n\n\t\treturn true;\n\t} else{\n\t\treturn false;\n\t}\n\n}", "public function DBCarregar($que = null)\n {\n $oDbl = $this->getoDbl_Select();\n $nom_tabla = $this->getNomTabla();\n if (isset($this->iid_situacion)) {\n if (($oDblSt = $oDbl->query(\"SELECT * FROM $nom_tabla WHERE id_situacion='$this->iid_situacion'\")) === false) {\n $sClauError = 'Nota.carregar';\n $_SESSION['oGestorErrores']->addErrorAppLastError($oDbl, $sClauError, __LINE__, __FILE__);\n return false;\n }\n $aDades = $oDblSt->fetch(\\PDO::FETCH_ASSOC);\n // Para evitar posteriores cargas\n $this->bLoaded = TRUE;\n switch ($que) {\n case 'tot':\n $this->aDades = $aDades;\n break;\n case 'guardar':\n if (!$oDblSt->rowCount()) return false;\n break;\n default:\n // En el caso de no existir esta fila, $aDades = FALSE:\n if ($aDades === FALSE) {\n $this->setNullAllAtributes();\n } else {\n $this->setAllAtributes($aDades);\n }\n }\n return true;\n } else {\n return false;\n }\n }", "private static function existsCategoria($nome, $IDpadre){\n if($IDpadre=='any'){\n $dbResponse=\\Singleton::DB()->query(\"SELECT COUNT(*) as num FROM `categorie` WHERE categorie.nome='$nome';\");\n while($r = mysqli_fetch_assoc($dbResponse)) {$rows[] = $r; }\n if($rows[0]['num']==0) return FALSE;\n else return TRUE;\n\n }\n else\n {\n $dbResponse=\\Singleton::DB()->query(\"SELECT COUNT(*) as num FROM `categorie` WHERE categorie.nome='$nome' and categorie.padre=$IDpadre;\");\n while($r = mysqli_fetch_assoc($dbResponse)) {$rows[] = $r; }\n if($rows[0]['num']==0) return FALSE;\n else return TRUE;\n }\n }", "public function setVendedor($nome,$comissao){\n try{\n $x = 1;\n $Conexao = Conexao::getConnection();\n $query = $Conexao->prepare(\"INSERT INTO vendedor (nome,comissao) VALUES ('$nome',$comissao)\"); \n $query->execute(); \n // $query = $Conexao->query(\"DELETE FROM vendedor WHERE id_vendedor = (SELECT top 1 id_vendedor from vendedor order by id_vendedor desc)\"); \n // $query->execute();\n return 1;\n\n }catch(Exception $e){\n echo $e->getMessage();\n return 2;\n exit;\n } \n }", "function existeGrupo($base, $id, $id_asignatura)\n{\n $query = \"SELECT `id` FROM `grupos`\n WHERE `id`=\" . $id . \" AND `id_asignatura`=\" . $id_asignatura . \";\";\n $resultado = $base->query($query);\n if (empty($resultado->fetchAll())) {\n return false;\n }\n $resultado->closeCursor();\n return true;\n}", "function existe_periodo ($datos){\n //obtenemos los dias del periodo con el siguiente formato: \n // dias => Array( indice => DiaSeleccionado); Indice empieza en cero\n $dias=$datos['dias']; \n $cuatrimestre=$this->obtener_cuatrimestre();\n $fecha= getdate();\n $anio=$fecha['year'];\n $resultado=TRUE;\n $i=0;\n $longitud=count($dias);\n //Incluir en el join de asignacion_periodo : AND (t_p.fecha_inicio BETWEEN '{$datos['fecha_inicio']}' AND '{$datos['fecha_fin']}')\n while (($i < $longitud) && $resultado){\n// $sql=\"(SELECT t_a.id_asignacion, t_a.finalidad, t_a.hora_inicio, t_a.hora_fin \n// FROM asignacion t_a \n// JOIN aula t_au ON (t_a.id_aula=t_au.id_aula) \n// JOIN asignacion_periodo t_p ON (t_a.id_asignacion=t_p.id_asignacion ) \n// JOIN esta_formada t_f ON (t_p.id_asignacion=t_f.id_asignacion) \n// WHERE t_f.nombre='{$dias[$i]}' AND t_f.cuatrimestre=$cuatrimestre AND t_f.anio=$anio AND t_au.id_aula={$datos['id_aula']} AND ('{$datos['hora_inicio']}' BETWEEN t_a.hora_inicio AND t_a.hora_fin) AND ('{$datos['hora_fin']}' BETWEEN t_a.hora_inicio AND t_a.hora_fin) ) \n// \n// UNION \n// \n// (SELECT t_a.id_asignacion, t_a.finalidad, t_a.hora_inicio, t_a.hora_fin \n// FROM asignacion t_a \n// JOIN aula t_au ON (t_a.id_aula=t_au.id_aula) \n// JOIN asignacion_definitiva t_d ON (t_a.id_asignacion=t_d.id_asignacion)\n// WHERE t_d.nombre='{$dias[$i]}' AND t_d.cuatrimestre=$cuatrimestre AND t_d.anio=$anio AND t_a.id_aula={$datos['id_aula']} AND ('{$datos['hora_inicio']}' BETWEEN t_a.hora_inicio AND t_a.hora_fin) AND ('{$datos['hora_fin']}' BETWEEN t_a.hora_inicio AND t_a.hora_fin) )\";\n// $asignacion=toba::db('gestion_aulas')->consultar($sql);\n $asignaciones=$this->dep('datos')->tabla('asignacion')->get_asignaciones_por_aula($dias[$i], $cuatrimestre, $anio, $datos['id_aula']);\n \n print_r(\"<br><br>Estas son las asignaciones para el dia {$dias[$i]} : <br>\");\n foreach ($asignaciones as $clave=>$valor){\n print_r(\"{$valor['hora_inicio']} {$valor['hora_fin']}\");\n }\n //el formato de este arreglo es : indice => array('id_aula'=>x 'aula'=>y). La función solamente\n //requiere el id_aula\n $aulas=array(array('id_aula'=>$datos['id_aula']));\n \n //obtenemos un arreglo con todos los horarios disponibles\n $horarios_disponibles=$this->obtener_horarios_disponibles($aulas, $asignaciones);\n \n if(!$this->verificar_inclusion_de_horario($datos['hora_inicio'], $datos['hora_fin'])){\n $resultado=FALSE;\n }\n print_r(\"<br><br> Este es el valor de resultado : $resultado <br><br>\");\n $this->s__horarios_disponibles=array();\n $i += 1;\n }\n \n return $resultado;\n }", "function getExistenciaSocio($socio){\n\t\t$exist\t= 0;\n\t\tif(isset($socio) ){\n\t\t\t$sql\t= \"SELECT COUNT(codigo) AS 'iExistentes' FROM socios_general WHERE codigo=$socio \";\n\t\t\t//setLog($sql);\n\t\t\t$exist\t= mifila($sql, \"iExistentes\");\n\t\t}\n\t\treturn $exist;\n\t}", "public function existeTipoArticulo() {\n if (!isset($_POST['id_tipoarticulo'])) {\n $existe = ArtTipoArticuloModel::where('nombre_tipoarticulo', $_POST['tiposarticulos'])->count();\n } else {\n $existe = ArtTipoArticuloModel::where('nombre_tipoarticulo', $_POST['tiposarticulos'])\n ->where('id_tipoarticulo', '<>', $_POST['id_tipoarticulo'])\n ->count();\n }\n header('Content-Type: application/json');\n echo json_encode($existe);\n }", "public function existReturned(){\r\n $docs=ClientSDocs::where('projectclientservices_id',$this->id)->where('file_id',-1) ->get();\r\n if($docs!=null){\r\n foreach($docs as $doc)\r\n if($doc->signdate != \"\")\r\n return true;\r\n }\r\n return false;\r\n }", "public function checarReservaExiste($objetor) {\n /*$reservas->set(\"idTurma\", $_POST[\"idTurma\"]);\n $reservas->set(\"idSala\", $_POST[\"idSala\"]);\n $reservas->set(\"data\", $_POST[\"data\"]);\n $reservas->set(\"hora\", $_POST[\"hora\"]);musashi*/\n $objetor->data = $this->query->dateEua($objetor->data);\n $array = array();\n $i = 0;\n foreach($objetor->idEquipamento as $valor){\n \n $sql = \"\n SELECT \n r.idReserva, \n d.horaInicial, \n d.horaFinal, \n r.data, \n e.nome\n FROM \n reservas r\n INNER JOIN reservas_equipamentos re ON r.idReserva = re.idReserva\n INNER JOIN equipamentos e ON e.idEquipamento = re.idEquipamento\n INNER JOIN turmas t ON r.idTurma = t.idTurma\n INNER JOIN disciplinas d ON t.idDisciplina = d.idDisciplina\n WHERE TIME( '$objetor->hora' ) \n BETWEEN \n d.horaInicial and\n d.horaFinal and\n r.data = '$objetor->data' and\n re.idEquipamento = $valor and\n r.status = 0\n \";\n $query = $this->query->setQuery($sql);\n \n if( $query->num_rows() > 0 )\n { \n $array[\"num_rows\"] = true;\n foreach ( $query->result() as $valor )\n {\n $array[$i][\"nome\"] = $valor->nome;\n $i++;\n }\n //return $query;\n }\n }\n\n return $array;\n }", "function CompruebaTabla($conexionUsar, $tablaUsar, $bddUsar){ // Por último, en cada consulta, se comprueba que no vuelva\n $sentenciaTabla = \"select * from \" . $tablaUsar; // vacía ni con errores, y en caso de haberlos, se muestran por pantalla.\n $valor = true;\n $conexionUsar->select_db($bddUsar);\n $queryComprobar = mysqli_query($conexionUsar, $sentenciaTabla);\n if(!$queryComprobar){\n echo \"<h3 style=\\\"margin-left: 1%\\\">ERROR: No se encuentra la tabla \" . $tablaUsar . \"</h3>\";\n echo \"<h3 style=\\\"margin-left: 1%\\\">Base de Datos INCOMPLETA. Se debe realizar una reinstalación.</h3>\";\n $valor = false;\n }\n return($valor);\n }", "function inserirEstoque($data){\r\n $this->db->select('*')->from('estoque')->where('produto', $data['produto']);\r\n $query = $this->db->get();\r\n\r\n if ($query->num_rows() <= 0){\r\n $this->db->insert('estoque', $data);\r\n return $msg = 1;\r\n } else {\r\n //verifica se tem algum produto com idioma padrão\r\n $this->db->select('*')->from('estoque')->where('produto = '.$data['produto'].' and idioma = 0');\r\n $query_padrao = $this->db->get();\r\n\r\n $this->db->select('*')->from('estoque')->where('produto = '.$data['produto'].' and idioma > 0');\r\n $query_outro = $this->db->get();\r\n\r\n if ($query_padrao->num_rows() > 0 && $query_outro->num_rows() <= 0 && $data['idioma'] == 0) { // se tiver padrão, e não tiver outro e idioma padrão\r\n $this->db->insert('estoque', $data);\r\n return $msg = 1;\r\n } else if ($query_padrao->num_rows() <= 0 && $query_outro->num_rows() >= 1 && $data['idioma'] > 0) { // se não tiver padrão, tiver outro e idioma padrão\r\n $this->db->insert('estoque', $data);\r\n return $msg = 1;\r\n } else {\r\n return $msg = 0;\r\n }\r\n }\r\n }", "public function pesquisarCanceladas($objeto) {\n\n $linhas = \" and 1=1 and \";\n if( $objeto->dataInicial != \"\" and $objeto->dataFinal != \"\" ){\n $linhas .= \"r.data BETWEEN '\" .$this->query->dateEua($objeto->dataInicial).\"'\";\n $linhas .= \" and '\" .$this->query->dateEua($objeto->dataFinal).\"'\";\n $linhas .= \" and \";\n }\n \n if( $objeto->hora != \"\" ){\n $linhas .= \"r.hora = '\".$objeto->hora.\"'\";\n $linhas .= \" and \";\n }\n \n if( $objeto->pesquisa != \"\" ){\n $linhas .= \"r.idTurma like '%\".$objeto->pesquisa.\"%'\";\n $linhas .= \" or \";\n $linhas .= \"r.idSala like '%\".$objeto->pesquisa.\"%'\";\n $linhas .= \" or \";\n $linhas .= \"r.obs like '%\".$objeto->pesquisa.\"%'\";\n $linhas .= \" and \";\n }\n \n $linhas .= \" r.status = 1 \";\n \n $sql = \"\n SELECT \n r.idReserva,\n t.nome AS turmaNome,\n s.predio,\n s.andar,\n s.numero,\n r.data,\n r.hora,\n d.nome AS DisciplinaNome,\n c.nome AS cursoNome,\n r.obs\n FROM \n reservas r\n INNER JOIN\n pessoas p\n ON\n p.idPessoa = r.idPessoa\n INNER JOIN\n turmas t\n ON\n t.idTurma = r.idTurma\n INNER JOIN\n salas s\n ON\n s.idSala = r.idSala\n INNER JOIN\n disciplinas d\n ON\n d.idDisciplina = t.idDisciplina\n INNER JOIN\n cursos c\n ON\n c.idCurso = d.idCurso\n WHERE\n r.idPessoa = '$objeto->idPessoa'\n $linhas\n \";\n\n \n\n $query = $this->query->setQuery($sql);\n return $query;\n }", "public function existenDatos($idIndicador,$anio,$desde,$hasta){\n\t\t$sql = $this->db->query('SELECT * FROM IndicadorDatos WHERE fk_idIndicador='.$idIndicador.' AND periodo BETWEEN '.$desde.' AND '.$hasta.'');\n\n\t\tif ($sql->num_rows() > 0) {\n\t\t\treturn true;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}", "function consultarNotasDefinitivas() {\r\n \r\n $cadena_sql = $this->sql->cadena_sql(\"consultarEspaciosCursados\", $this->datosEstudiante['CODIGO']);\r\n $resultado = $this->ejecutarSQL($this->configuracion, $this->accesoOracle, $cadena_sql, \"busqueda\"); \r\n \r\n return $resultado;\r\n \r\n }", "public function isExistPeriode($idMois, $idVille){\n $database = new database;\n $connection = $database->getConnection();\n $sql =(\"select * from periode where idVille = \".$idVille.\" and mois = \".$idMois.\";\");\n $request = $connection->prepare($sql);\n $request->execute();\n $resultat = $request->rowCount();\n // var_dump($resultat);\n $resultat = ($resultat > 0) ? true : false;\n return $resultat ;\n }", "public function temErro(){\n\t\tif (count($this->erros) == 0){\n\t\t\treturn false;\n\t\t}\n\t\telse return true;\n\t}", "public function DBCarregar($que = null)\n {\n $oDbl = $this->getoDbl();\n $nom_tabla = $this->getNomTabla();\n if (isset($this->iid_activ) && isset($this->iid_asignatura) && isset($this->iid_nom)) {\n if (($oDblSt = $oDbl->query(\"SELECT * FROM $nom_tabla WHERE id_activ='$this->iid_activ' AND id_asignatura='$this->iid_asignatura' AND id_nom=$this->iid_nom\")) === false) {\n $sClauError = 'Matricula.carregar';\n $_SESSION['oGestorErrores']->addErrorAppLastError($oDbl, $sClauError, __LINE__, __FILE__);\n return false;\n }\n $aDades = $oDblSt->fetch(\\PDO::FETCH_ASSOC);\n // Para evitar posteriores cargas\n $this->bLoaded = TRUE;\n switch ($que) {\n case 'tot':\n $this->aDades = $aDades;\n break;\n case 'guardar':\n if (!$oDblSt->rowCount()) return false;\n break;\n default:\n // En el caso de no existir esta fila, $aDades = FALSE:\n if ($aDades === FALSE) {\n $this->setNullAllAtributes();\n } else {\n $this->setAllAtributes($aDades);\n }\n }\n return true;\n } else {\n return false;\n }\n }", "public function cek_exist_nomor($nomor){\r\n $sql = \"SELECT NO_CUTI FROM \".$this->t_cuti;\r\n $data = $this->_db->select($sql);\r\n foreach ($data as $v){\r\n $tmp = Validasi::remove_space($v['NO_CUTI']);\r\n $cek = $nomor==$tmp;\r\n if($cek) return true;\r\n }\r\n return false;\r\n }", "private function hasFiltroCidade()\n {\n return !empty($this->filtros['cidade']);\n }", "public function Exists();", "public function DBCarregar($que = null)\n {\n $oDbl = $this->getoDbl();\n $nom_tabla = $this->getNomTabla();\n if (isset($this->iid_nom) && isset($this->iid_nivel)) {\n if (($oDblSt = $oDbl->query(\"SELECT * FROM $nom_tabla WHERE id_nom=$this->iid_nom AND id_nivel=$this->iid_nivel \")) === false) {\n $sClauError = 'PersonaNota.carregar';\n $_SESSION['oGestorErrores']->addErrorAppLastError($oDbl, $sClauError, __LINE__, __FILE__);\n return false;\n }\n $aDades = $oDblSt->fetch(\\PDO::FETCH_ASSOC);\n // Para evitar posteriores cargas\n $this->bLoaded = TRUE;\n switch ($que) {\n case 'tot':\n $this->aDades = $aDades;\n break;\n case 'guardar':\n if (!$oDblSt->rowCount()) return false;\n break;\n default:\n // En el caso de no existir esta fila, $aDades = FALSE:\n if ($aDades === FALSE) {\n $this->setNullAllAtributes();\n } else {\n $this->setAllAtributes($aDades);\n }\n }\n return true;\n } else {\n return false;\n }\n }", "public function selectIniciarSesion(){\n $query = \"SELECT codUsuario, nombre, apellido, sexo, COUNT(*) AS existe FROM usuario WHERE correo = '\".parent::string($this->getCorreo()).\"' AND contrasenia = '\".md5(md5(\"PAO%%%%0001TPIPSADSADasdsad\").parent::string($this->getContrasenia())).\"' LIMIT 1;\";\n $result = mysqli_query(parent::conexion(), $query);\n if($result){\n $fila = mysqli_fetch_array($result);\n parent::desconectar();\n return $fila;\n } else{\n echo parent::conexion()->error;\n parent::desconectar();\n return false;\n }\n }", "public function DBCarregar($que = null)\n {\n $oDbl = $this->getoDbl_Select();\n $nom_tabla = $this->getNomTabla();\n if (isset($this->iid_item)) {\n if (($oDblSt = $oDbl->query(\"SELECT * FROM $nom_tabla WHERE id_item='$this->iid_item'\")) === FALSE) {\n $sClauError = 'UbiGasto.carregar';\n $_SESSION['oGestorErrores']->addErrorAppLastError($oDbl, $sClauError, __LINE__, __FILE__);\n return FALSE;\n }\n $aDades = $oDblSt->fetch(\\PDO::FETCH_ASSOC);\n // Para evitar posteriores cargas\n $this->bLoaded = TRUE;\n switch ($que) {\n case 'tot':\n $this->aDades = $aDades;\n break;\n case 'guardar':\n if (!$oDblSt->rowCount()) return FALSE;\n break;\n default:\n // En el caso de no existir esta fila, $aDades = FALSE:\n if ($aDades === FALSE) {\n $this->setNullAllAtributes();\n } else {\n $this->setAllAtributes($aDades);\n }\n }\n return TRUE;\n } else {\n return FALSE;\n }\n }", "public function exist($titulo, $fecha, $info_ppal){\n $db = $this->firebase;\n $consulta = $db->collection('info_miscelanea')\n ->where('titulo', '=', $titulo)\n ->where('fecha', '=', $fecha)\n ->where('info_ppal', '=', $info_ppal);\n\n $documentos = $consulta->documents();\n\n $docExiste = false;\n foreach ($documentos as $documento){\n if ($documento->exists()) $docExiste = true;\n }\n\n return $docExiste;\n }", "function is_exists_doc($doc_id){\n\tif(!filter_var($doc_id, FILTER_VALIDATE_INT)){\n\t\n\treturn false;\n\t\n\t}\n\telse{\n\t\tglobal $prefix_doc;\n\t\t$query = borno_query(\"SELECT * FROM $prefix_doc WHERE id='$doc_id'\");\n\t\t\n\t\t$count = mysqli_num_rows($query);\n\t\tif($count==1){\n\t\t\treturn true;\n\t\t}\n\t\telse{\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\n\t}\n\n}", "public function contarExistentesGeneral($consulta) {\n\n /****************************Consulta despues de validar *************/\n $database = $this-> ConexionBD->conectarBD();\n\n if($database->connect_errno) {\n $response = -1; //No se puede conectar a la base de datos\n }\n else{\n if ( $result = $database->query($consulta) ) {\n if( $result->num_rows > 0 ) {\n $response = 1;\n }\n else {\n $response = 0;\n }\n\n } else {\n $response = $database->error;\n }\n $this -> ConexionBD->desconectarDB($database);\n }\n\n /**************************** /Consulta despues de validar *************/\n\n return $response;\n }", "public function exists()\n {\n }", "public function exists()\n {\n }", "function exist() {\n\t\t\t$exist = $this->db->prepare(\"SELECT 1 FROM REPORT WHERE titleFileVideo = ? AND idArt = ?\");\n\t\t\t$exist->execute(array($this->titleFileVideo, $this->idArt));\n\t\t\treturn count($exist->fetchAll()) >= 1;\n\t\t}", "function existeEvento($entrada) {\n $evento = trim(filter_var($entrada, FILTER_SANITIZE_STRING));\n $con = crearConexion();\n\n $query = \"SELECT `nombre` FROM `evento` WHERE nombre='$evento'\";\n $result = mysqli_query($con, $query);\n\n cerrarConexion($con);\n return mysqli_num_rows($result) > 0;\n}", "function is_id_kelas_exist()\n {\n $id_kelas_sekarang = $this->session->userdata('id_kelas_sekarang');\n $id_kelas_baru = $this->input->post('id_kelas');\n\n // jika id_kelas baru dan id_kelas yang sedang diedit sama biarkan\n // artinya id_kelas tidak diganti\n if ($id_kelas_baru === $id_kelas_sekarang) {\n return TRUE;\n }\n // jika id_kelas yang sedang diupdate (di session) dan yang baru (dari form) tidak sama,\n // artinya id_kelas mau diganti\n // cek di database apakah id_kelas sudah terpakai?\n else {\n // cek database untuk id_kelas yang sama\n $query = $this->db->get_where('kelas', array('id_kelas' => $id_kelas_baru));\n\n // id_kelas sudah dipakai\n if ($query->num_rows() > 0) {\n $this->form_validation->set_message(\n 'is_id_kelas_exist',\n \"Kelas dengan kode $id_kelas_baru sudah terdaftar\"\n );\n return FALSE;\n }\n // id_kelas belum dipakai, OK\n else {\n return TRUE;\n }\n }\n }", "public function exists()\r\n {\r\n }", "public function VerificaArqueoCreditos()\n{\n\tself::SetNames();\n\t\n $sql = \"SELECT * FROM arqueocaja WHERE codigo = ? and statusarqueo = 1\";\n $stmt = $this->dbh->prepare($sql);\n\t\t$stmt->execute( array($_SESSION[\"codigo\"]));\n\t\t$num = $stmt->rowCount();\n\t\tif($num==0)\n\t\t{\n echo \"<div class='alert alert-danger'>\";\n echo \"<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>&times;</button>\";\n echo \"<center><span class='fa fa-info-circle'></span> DISCULPE, NO EXISTE UN ARQUEO DE CAJA PARA PROCESAR COBROS DE CREDITOS, DEBERA DE INICIARLA PARA CONTINUAR.<br> SI DESEA REALIZAR UN ARQUEO DE CAJA HAZ CLIC <a href='forarqueo'>AQUI</a></center>\";\n echo \"</div>\";\n\n\t\t} else { \n\n\t$sql = \"SELECT * FROM arqueocaja WHERE codigo = ? and statusarqueo = 1\";\n\t$stmt = $this->dbh->prepare($sql);\n\t$stmt->execute( array($_SESSION[\"codigo\"]) );\n\t$num = $stmt->rowCount();\n\n\tif($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t{\n\t\t\t$pae[] = $row;\n\t\t}\n\t$codcaja = $pae[0]['codcaja'];\n\t\t?>\n\n\t<div class=\"row\"> \n\t\t\t\t\t\t\t<div class=\"col-md-12\"> \n <div class=\"form-group has-feedback\"> \n <label class=\"control-label\">B&uacute;squeda de Clientes: <span class=\"symbol required\"></span></label>\n<input type=\"hidden\" name=\"codcaja\" id=\"codcaja\" value=\"<?php echo $codcaja; ?>\" readonly=\"readonly\">\n<input type=\"hidden\" class=\"form-control\" name=\"codcliente\" id=\"codcliente\"><input class=\"form-control\" type=\"text\" name=\"busquedacliente\" id=\"busquedacliente\" onKeyUp=\"this.value=this.value.toUpperCase();\" autocomplete=\"off\" placeholder=\"Ingrese Datos del Cliente para tu b&uacute;squeda\" required=\"required\">\n <i class=\"fa fa-search form-control-feedback\"></i> \n </div> \n </div> \t\n </div><br>\n\t\t\t\t\t\n <div class=\"modal-footer\"> \n<button type=\"button\" onClick=\"BuscaClientesAbonos()\" class=\"btn btn-primary\"><span class=\"fa fa-search\"></span> Realizar B&uacute;squeda</button>\t\t\t\n </div>\n\n\t<?php\n\t}\n}", "public function DBCarregar($que = null)\n {\n $oDbl = $this->getoDbl_Select();\n $nom_tabla = $this->getNomTabla();\n if (isset($this->iid_item)) {\n if (($oDblSt = $oDbl->query(\"SELECT * FROM $nom_tabla WHERE id_item='$this->iid_item' \")) === FALSE) {\n $sClauError = 'Tarifa.carregar';\n $_SESSION['oGestorErrores']->addErrorAppLastError($oDbl, $sClauError, __LINE__, __FILE__);\n return FALSE;\n }\n $aDades = $oDblSt->fetch(\\PDO::FETCH_ASSOC);\n // Para evitar posteriores cargas\n $this->bLoaded = TRUE;\n switch ($que) {\n case 'tot':\n $this->aDades = $aDades;\n break;\n case 'guardar':\n if (!$oDblSt->rowCount()) return FALSE;\n break;\n default:\n // En el caso de no existir esta fila, $aDades = FALSE:\n if ($aDades === FALSE) {\n $this->setNullAllAtributes();\n } else {\n $this->setAllAtributes($aDades);\n }\n }\n return TRUE;\n } else {\n return FALSE;\n }\n }", "public function insertarContenedores(){\n\t\t\t#try{\n\t\t\t\n\t\t\t\t$PDOmysql = consulta();\n\t\t\t\t$PDOmysql->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n\n\t\t\t\t#Itera entre el array Contenedores, para insertarlo uno por uno.\n\t\t\t\tforeach ($this->contenedores as $contenedor) {\n\t\t\t\t\n\t\t\t\t\t#Se comprueba si el contenedor esta en la base de datos.\n\t\t\t\t\t$sql = 'select idContenedor from Contenedor where idContenedor = :contenedor';\n\t\t\t\t\t$stmt = $PDOmysql->prepare($sql);\n\t\t\t\t\t$stmt->bindParam(':contenedor', $contenedor->get_id());\n\t\t\t\t\t$stmt->execute();\n\t\t\t\t\t$rows = $stmt->fetchAll(PDO::FETCH_ASSOC);\n\t\t\t\t\t#La variable respuesta comprueba si existe o no el contendor.\n\t\t\t\t\t$respuesta = $stmt->rowCount() ? true : false;\n\t\t\t\t\t#Si respuesta es que no existe el contenedor aun en la base de datos.\n\t\t\t\t\tif(! $respuesta){\n\t\t\t\t\t\t#Inserta el contenedor.\n\t\t\t\t\t\t$sql = 'insert into Contenedor(idContenedor,Tipo) values(:contenedor, :tipo);';\n\t\t\t\t\t\t$stmt = $PDOmysql->prepare($sql);\n\t\t\t\t\t\t$stmt->bindParam(':contenedor', $contenedor->get_id()); #get_id() y get_tipo()\n\t\t\t\t\t\t$stmt->bindParam(':tipo', $contenedor->get_tipo());\t\t#son metodos de la clase contenedor.\n\t\t\t\t\t\t$stmt->execute();\n\t\t\t\t\t}\n\n\t\t\t\t\t$sql = 'SELECT Flete_idFlete, Contenedor \n\t\t\t\t\t\t\tfrom Contenedor_Viaje \n\t\t\t\t\t\t\twhere \n\t\t\t\t\t\t\tFlete_idFlete = :flete\n\t\t\t\t\t\t\tand\n\t\t\t\t\t\t\tContenedor = :contenedor';\n\n\n\t\t\t\t\t$stmt = $PDOmysql->prepare($sql);\n\t\t\t\t\t$stmt->bindParam(':contenedor', $contenedor->get_id());\n\t\t\t\t\t$stmt->bindParam(':flete', $this->flete);\n\t\t\t\t\t$stmt->execute();\n\t\t\t\t\t$rows = $stmt->fetchAll(PDO::FETCH_ASSOC);\n\t\t\t\t\t#La variable respuesta comprueba si existe o no el contendor.\n\t\t\t\t\t$respuesta = $stmt->rowCount() ? true : false;\n\n\t\t\t\t\tif(! $respuesta){\n\t\t\t\t\t\t#Incicializa el viaje para el flete, asignando contenedores al flete.\n\t\t\t\t\t\t$sql = 'insert into Contenedor_Viaje(WorkOrder,Booking,Flete_idFlete, Contenedor) values(:workorder, :booking, :flete, :contenedor);';\n\t\t\t\t\t\t$stmt = $PDOmysql->prepare($sql);\n\t\t\t\t\t\t$stmt->bindParam(':workorder', $contenedor->get_workorder());\n\t\t\t\t\t\t$stmt->bindParam(':booking', $contenedor->get_booking());\n\t\t\t\t\t\t$stmt->bindParam(':flete', $contenedor->get_flete());\n\t\t\t\t\t\t$stmt->bindParam(':contenedor', $contenedor->get_id());\n\t\t\t\t\t\t$stmt->execute();\n\t\t\t\t\t\t\t\t//Cada contenedor tiene un objeto ListaSellos.\n\t\t\t\t\t\t\t\t#Se manda a llamar al objeto, y este llama a su metodo insertar, para\n\t\t\t\t\t\t\t\t#añadir los sellos a la base de datos.\n\t\t\t\t\t\t\t\t#Esto se puede ya que cada contenedor conoce el flete al que pertenece.\n\t\t\t\t\t}\n\n\t\t\t\t\telse{\n\t\t\t\t\t\t$update = new Update;\n\t\t\t\t\t\t\n\t\t\t\t\t\t$camposUpdate = array(\"statusA\" => 'Activo');\n\t\t\t\t\t\t$camposWhereUpdate = array(\"Flete_idFlete\" => $this->flete, \"Contenedor\" => $contenedor );\n\n\t\t\t\t\t\t$update->prepareUpdate(\"Contenedor_Viaje\", $camposUpdate, $camposWhereUpdate);\n\t\t\t\t\t\t$update->createUpdate();\n\t\t\t\t\t}\n\n\t\t\t\t\t$listaSellos = $contenedor->get_sellos();\n\t\t\t\t\tif($listaSellos){\n\t\t\t\t\t\t$listaSellos->insertar_sellos();\n\t\t\t\t\t}\t\t\n\n\t\t\t\t}\n\t\t\t#}catch(Exception $e){\n\n\t\t\t#}\n\n\t\t}", "function afaire_ticket_existe($bidon) {\n\t$existe = false;\n\t// Test si la table existe\n\t$table = sql_showtable('spip_afaire', true);\n\tif ($table) {\n\t\t// Nombre total de afaire\n\t\t$from = array('spip_afaire AS t1');\n\t\t$where = array();\n\t\t$result = sql_countsel($from, $where);\n\t\t// Nombre de afaire termines pour le jalon\n\t\tif ($result >= 1)\n\t\t\t$existe = true;\n\t}\n\treturn $existe;\n}", "function ajoue_proprietaire($nom,$CA,$debut_contrat,$fin_contrat)\r\n{ $BDD=ouverture_BDD_Intranet_Admin();\r\n\r\n if(exist($BDD,\"proprietaire\",\"nom\",$nom)){echo \"nom deja pris\";return;}\r\n\r\n $SQL=\"INSERT INTO `proprietaire` (`ID`, `nom`, `CA`, `debut_contrat`, `fin_contrat`) VALUES (NULL, '\".$nom.\"', '\".$CA.\"', '\".$debut_contrat.\"', '\".$fin_contrat.\"')\";\r\n\r\n $result = $BDD->query ($SQL);\r\n\r\n if (!$result)\r\n {echo \"<br>SQL : \".$SQL.\"<br>\";\r\n die('<br>Requête invalide ajoue_equipe : ' . mysql_error());}\r\n}", "function comprobar_si_existe_ya_imagen_lse_acepcion($id_palabra) {\n\t\t$query = \"SELECT palabra_imagen.*, \n\t\timagenes.id_imagen,imagenes.id_colaborador,imagenes.imagen,imagenes.extension,imagenes.id_tipo_imagen,\n\t\timagenes.estado,imagenes.registrado,imagenes.id_licencia,imagenes.id_autor,imagenes.tags_imagen,\n\t\timagenes.tipo_pictograma,imagenes.validos_senyalectica,imagenes.original_filename\n\t\tFROM palabra_imagen, imagenes\n\t\tWHERE palabra_imagen.id_palabra='$id_palabra'\n\t\tAND palabra_imagen.id_imagen=imagenes.id_imagen\n\t\tAND imagenes.id_tipo_imagen=12\";\n\n\t\t$connection = mysql_connect($this->HOST, $this->USERNAME, $this->PASSWORD);\n\t\t$SelectedDB = mysql_select_db($this->DBNAME);\n\t\t\n\t\t$result = mysql_query($query);\n\t\t$numrows=mysql_num_rows($result);\n\t\tmysql_close($connection);\n\t\treturn $numrows;\n\t}", "public function cadastrar_carro($modelo_carro, $ano_carro, $placa_carro, $cor_carro){\n try{\n $data = array('modelo_carro' => $modelo_carro, 'ano_carro' => $ano_carro, \n 'placa_carro' => $placa_carro, 'cor_carro' => $cor_carro);\n $str = $this->db->insert('carro', $data);\n return true;\n }catch(Exception $e){\n return false;\n }\n }", "public function existe_articulo($nombre) {\n $query = \"SELECT \".\n \"artId \".\n \"FROM \".\n \"tblArticulos \".\n \"WHERE \".\n \"artNombre='$nombre'\";\n \n $sth = $this->db->prepare($query);\n $sth->setFetchMode(PDO::FETCH_ASSOC);\n $sth->execute();\n $count = $sth->rowCount();\n $data = NULL;\n if ($count > 0) {\n $data = TRUE;\n } else {\n $data = FALSE;\n }\n return $data;\n }", "function prelasesor(){\n include(\"../include/conectar.php\"); \n $query =\"UPDATE tblsemestrepro SET asesor = '$this->asesor' WHERE tblsemestrepro.id_semestrepro = $this->semestrepy;\";\n $sql = mysqli_query($conection, $query);\n mysqli_close($conection); \n if($sql){\n\t\t\t $p =\"relacion\";\n include('../plantillas/paso.php');\n } \n else\n throw new Exception (\"Error: No es posible registrar\");\n }", "public function DBCarregar($que = null)\n {\n $oDbl = $this->getoDbl_Select();\n $nom_tabla = $this->getNomTabla();\n if (isset($this->inivel_stgr)) {\n if (($oDblSt = $oDbl->query(\"SELECT * FROM $nom_tabla WHERE nivel_stgr='$this->inivel_stgr'\")) === false) {\n $sClauError = 'NivelStgr.carregar';\n $_SESSION['oGestorErrores']->addErrorAppLastError($oDbl, $sClauError, __LINE__, __FILE__);\n return false;\n }\n $aDades = $oDblSt->fetch(\\PDO::FETCH_ASSOC);\n // Para evitar posteriores cargas\n $this->bLoaded = TRUE;\n switch ($que) {\n case 'tot':\n $this->aDades = $aDades;\n break;\n case 'guardar':\n if (!$oDblSt->rowCount()) return false;\n break;\n default:\n // En el caso de no existir esta fila, $aDades = FALSE:\n if ($aDades === FALSE) {\n $this->setNullAllAtributes();\n } else {\n $this->setAllAtributes($aDades);\n }\n }\n return true;\n } else {\n return false;\n }\n }", "function existeCuenta($cuenta, $tipo = false){\n\n\t\t$existentes\t= 0;\n\t\t$ByTipo\t\t= ( $tipo == false ) ? \"\" : \"AND (`captacion_cuentas`.`tipo_cuenta` =$tipo) \";\n\t\t\t$sql\t\t= \"SELECT\n\t\t\t\t\t\t\tCOUNT(`captacion_cuentas`.`numero_socio`) AS `existentes` \n\t\t\t\t\t\tFROM\n\t\t\t\t\t\t\t`captacion_cuentas`\n\t\t\t\t\t\tWHERE\n\t\t\t\t\t\t\t(`captacion_cuentas`.`numero_cuenta` =$cuenta) \n\t\t\t\t\t\t\t$ByTipo\";\n\t\t\t$existentes\t= mifila($sql, \"existentes\");\n\n\t\treturn\t\t($existentes == 0 ) ? false : true;\n\t}", "function buscar_eu($registrado,$texto_buscar,$sql,$idioma) {\n\t\n\t\tif ($registrado==false) {\n\t\t\t$mostrar_visibles=\"AND eu_estado=1\n\t\t\t\";\n\t\t}\n\t\t\n\t\tif ($texto_buscar !='' && $idioma=='es') {\n\t\t\t\n\t\t\t$sql_texto=\"AND (eu.eu_titulo LIKE '%$texto_buscar%' \n\t\t\tOR eu_descripcion.eu_descripcion LIKE '%$texto_buscar%') \n\t\t\t\";\n\t\t\n\t\t} elseif ($texto_buscar !='' && $idioma!='es') {\n\t\t\t\n\t\t\t$sql_texto=\"AND (eu.eu_titulo LIKE '%$texto_buscar%' \n\t\t\tOR eu_descripcion.eu_descripcion_\".$idioma.\" LIKE '%$texto_buscar%') \n\t\t\t\";\n\t\t} else {\n\t\t\t\n\t\t\t$sql_texto=\"AND (eu.eu_titulo LIKE '%$texto_buscar%' \n\t\t\tOR eu_descripcion.eu_descripcion LIKE '%$texto_buscar%') \n\t\t\t\";\n\t\t}\n\t\t\n\t\t$query = \"SELECT COUNT(*) \n\t\tFROM eu, eu_descripcion\n\t\tWHERE eu.id_eu=eu_descripcion.id_eu\n\t\t$sql\n\t\t$sql_texto\n\t\t$mostrar_visibles\n\t\tORDER BY eu.fecha_alta desc\";\n\n\t\t$connection = mysql_connect($this->HOST, $this->USERNAME, $this->PASSWORD);\n\n\t\t$SelectedDB = mysql_select_db($this->DBNAME);\n\t\t$result = mysql_query($query); \n\t\t\n\t\t$numrows = mysql_fetch_array($result);\n\t\tmysql_close($connection);\n\t\t// COMPROBAMOS QUE HAYA RESULTADOS\n\t\t// SI EL NUMERO DE RESULTADOS ES 0 SIGNIFICA QUE NO HAY REGISTROS CON ESOS DATOS\n\t\tif ($numrows[0] == 0) {\n\t\t\treturn false;\n\t\t}\n\t\telse {\n\t\t\treturn $numrows[0];\n\t\t}\n\t}", "function insertar(){\r\n\t\t \t$mysqli=$this->ConectarBD();\r\n\t $sql = \"SELECT * FROM reservact WHERE COD_RES = '\".$id.\"'\";\r\n\r\n\t\t\tif (!$result = $mysqli->query($sql)){\r\n\t\t\t\treturn 'ERR_CONN_BD';\r\n\t\t\t}\r\n\t\t\telse {\r\n\r\n\t\t\t\tif ($result->num_rows == 0){\r\n\t\t\t\t\t$sql = \"INSERT INTO reservact (FECHA, DNI, COD_ACT, BORRADO) VALUES ('\";\r\n\t\t\t\t\t$sql = $sql.\"$this->fecha','$this->dni','$this->codact', 'NO')\";\r\n\t\t\t\t\t$mysqli->query($sql);\r\n\t\t\t\t\treturn 'CONFIMR_INSERT';\r\n\t\t\t\t}\r\n\t\t\t\telse{\r\n\t\t\t\t\treturn 'DATA_EXISTS_USR';\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}", "function buscar_si_existe_simbolo_tmp($id_palabra,$id_tipo_simbolo,$marco,$contraste,$sup_con_texto,$sup_idioma,$sup_mayusculas,$sup_font,$inf_con_texto,$inf_idioma,$inf_mayusculas,$inf_font,$id_imagen,$sup_id_traduccion,$inf_id_traduccion) {\n\t\t$query = \"SELECT *\n\t\tFROM simbolos_temp\n\t\tWHERE id_palabra='$id_palabra' \n\t\tAND id_tipo_simbolo='$id_tipo_simbolo'\n\t\tAND marco='$marco'\n\t\tAND contraste='$contraste'\n\t\tAND sup_con_texto='$sup_con_texto'\n\t\tAND sup_idioma='$sup_idioma'\n\t\tAND sup_mayusculas='$sup_mayusculas'\n\t\tAND sup_font='$sup_font'\n\t\tAND inf_con_texto='$inf_con_texto'\n\t\tAND inf_idioma='$inf_idioma'\n\t\tAND inf_mayusculas='$inf_mayusculas'\n\t\tAND inf_font='$inf_font'\n\t\tAND id_imagen='$id_imagen'\n\t\tAND sup_id_traduccion='$sup_id_traduccion'\n\t\tAND inf_id_traduccion='$inf_id_traduccion'\";\n\n\t\t$connection = mysql_connect($this->HOST, $this->USERNAME, $this->PASSWORD);\n\n\t\t$SelectedDB = mysql_select_db($this->DBNAME);\n\t\t$result = mysql_query($query); \n\t\t\n\t\t$numrows = mysql_num_rows($result);\n\t\n\t\t// COMPROBAMOS QUE HAYA RESULTADOS\n\t\t// SI EL NUMERO DE RESULTADOS ES 0 SIGNIFICA QUE NO HAY REGISTROS CON ESOS DATOS\n\t\tif ($numrows == 0) {\n\t\t\tmysql_close($connection);\n\t\t\treturn 0;\n\t\t}\n\t\telse {\n\t\t\tmysql_close($connection);\n\t\t\treturn 1;\n\t\t}\n\t}", "function verificarComprobante($fecha)\n {\n global $db;\n $sql = \" select count(dateReception) as total from almacen_reception\n where tipoTrans = 'A' and tipoComprobante = 'A';\n and dateReception >= '$fecha' \";\n echo $sql;\n $db->SetFetchMode(ADODB_FETCH_ASSOC);\n \t$info = $db->execute($sql);\n if ($info->fields(\"total\") == 0)\n {\n return 1; // positivo, puede registrar\n }\n else if ($info->fields(\"total\") > 0)\n {\n return 0; // existe ajustes, no puede registrar\n }\n }", "public function anioLectivoSiguiente(){\n $fecha= date('d/m/Y');\n $fecha=Carbon::createFromFormat('d/m/Y', date('d/m/Y'));\n $fecha->addYear();\n //$fecha->addYear();\n\n $fechaBuscar=substr($fecha, 0,-15);//$fecha_de_creacion.slice(0,-6);\n $fechaBuscar=(int)$fechaBuscar;\n $anio=Anio::where('año',$fechaBuscar)->select('id')->get()->toArray();\n\n if($anio!=null){\n $var=\"Existe\";\n return $var;\n }else{\n $var=\"NoExiste\";\n return $var;\n }\n }", "public function book_not_exists($title){\n $select_query = \"SELECT `id`, `title`, `description`, `department`, `faculty`, `author`, `publisher`, `date` FROM `books` WHERE `title`='$title'\";\n //check if book exists \n $run_select_query = $this->conn->query($select_query);\n if($run_select_query){\n //check if book already exists \n if(mysqli_num_rows($run_select_query) == 0){\n \n return true;\n }else{\n return false;\n }\n }\n }", "public function verExistencias(){\n \ttry{\n $existencias = \\DB::select('call listar_existencias_almacen()');\n $ok = true;\n }catch(QueryException $ex){\n $existencias = null;\n $ok = false;\n }\n\n $rtn = [\n 'ok' => $ok,\n 'result' => $existencias\n ];\n\n return response()->json($rtn, 200);\n }", "function contador($nombretabla, $BDImportRecambios,$ConsultaImp) {\n\t// Inicializamos array\n $Tresumen['n'] = 0; //nuevo\n $Tresumen['t'] = 0; //total\n $Tresumen['e'] = 0; //existe\n\t$Tresumen['v'] = 0; //existe\n\t\n\t// Contamos los registros que tiene la tabla\n \t$total = 0;\n $whereC = '';\n $total = $ConsultaImp->contarRegistro($BDImportRecambios,$nombretabla,$whereC);\n $Tresumen['t'] = $total; // total registros\n\t\t\n // Obtenemos lineas de registro en blanco y contamos cuantas\n\t$whereC = \" WHERE trim(Estado) = ''\";\n\t$campo[1]= 'RefFabPrin';\n\t$campo[2]= 'linea';\n\t$RegistrosBlanco = $ConsultaImp->registroLineas($BDImportRecambios,$nombretabla,$campo,$whereC);\n\t// Como queremos devolver javascript los creamos\n\t$Tresumen['v'] = $RegistrosBlanco['NItems'];\n\t$Tresumen['LineasRegistro'] = $RegistrosBlanco; //Registros en blanco\n \n \n\t// Contamos los registros que tiene la tabla nuevo\n\t$total = 0;\n\t$whereC = \" WHERE Estado = 'nuevo'\";\n $total = $ConsultaImp->contarRegistro($BDImportRecambios,$nombretabla,$whereC);\n $Tresumen['n'] = $total; //nuevo\n\t\n\t\n\t\n\t\n\t\n\t\n\t// Contamos los registros que tiene la tabla existente\n\t$total = 0;\n\t$whereC = \" WHERE Estado = 'existe'\";\n $total = $ConsultaImp->contarRegistro($BDImportRecambios,$nombretabla,$whereC);\n\t$Tresumen['e'] = $total; //existe\n return $Tresumen;\n}" ]
[ "0.6929068", "0.6867789", "0.6844026", "0.67060053", "0.66223437", "0.6521675", "0.6474034", "0.6471477", "0.6461207", "0.6458138", "0.64101833", "0.6388594", "0.6263312", "0.6216533", "0.61955225", "0.618811", "0.6165938", "0.6149854", "0.6143259", "0.6133398", "0.61196977", "0.61175257", "0.60951716", "0.6095123", "0.6056732", "0.60523814", "0.6045232", "0.60435605", "0.6028694", "0.60254306", "0.60209", "0.5985023", "0.59780383", "0.5975183", "0.59751505", "0.5970566", "0.5962625", "0.5953399", "0.5948937", "0.5936323", "0.5925379", "0.5906914", "0.59050184", "0.5904724", "0.589674", "0.5880442", "0.58733195", "0.5871869", "0.5858915", "0.58503926", "0.58496904", "0.5845701", "0.5843675", "0.5833941", "0.58133876", "0.58113", "0.5786446", "0.5783449", "0.5779476", "0.5776429", "0.57749474", "0.57731676", "0.57703954", "0.5767961", "0.57663214", "0.5765883", "0.5765869", "0.5765258", "0.576434", "0.5763899", "0.574823", "0.57425714", "0.57274675", "0.57186145", "0.5714714", "0.57064813", "0.5703597", "0.5702916", "0.57010263", "0.56922245", "0.56782234", "0.56778663", "0.56728166", "0.56678027", "0.5667254", "0.5665865", "0.56647366", "0.56625277", "0.5659609", "0.5658034", "0.5649984", "0.5648956", "0.5645673", "0.56343776", "0.5629149", "0.56242263", "0.5622309", "0.56204337", "0.5616773", "0.56127936", "0.561157" ]
0.0
-1
Cria o objeto button Alterar que recebe o indice do cadastro que vai alterar
function botaoAlterar($indiceCadastro){ echo " <form method='post'> <button type='submit' class='btn btn-outline-warning btn-sm' name='botaoAlterar' value='$indiceCadastro'><i class='material-icons'>create</i></button> </form>";//o botão vai receber o valor do indice correspondente a sua linha na tabela de cadastros }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function makeInputButton() {}", "public function editar()\n {\n }", "function bt_alterar_naoClick($sender, $params)\r\n {\r\n\r\n $this->hd_alterar_produto_numero->Value = '';\r\n $this->hd_alterar_produto_codigo->Value = '';\r\n $this->hd_alterar_produto_referencia->Value = '';\r\n $this->hd_alterar_produto_descricao->Value = '';\r\n $this->hd_alterar_produto_qtde->Value = '';\r\n $this->hd_alterar_produto_preco->Value = '';\r\n $this->hd_alterar_produto_valor_total->Value = '';\r\n $this->hd_alterar_produto_lote->Value = '';\r\n $this->hd_alterar_produto_unidade->Value = '';\r\n $this->hd_alterar_produto_ipi->Value = '';\r\n $this->hd_alterar_produto_valor_ipi->Value = '';\r\n\r\n $this->alterar_produto->Top = 1188;\r\n $this->alterar_produto->Visible = false;\r\n }", "public function create_edit_aluno()\n\t\t{\n\t\t\t//agora carregar todos os alunos acordo com o curso\n\t\t\t$this->data['alunos'] = $this->Aluno_model->get_aluno_por_curso($this->data['Turma']['curso_id'],$this->data['Turma']['id']);\n\t\t\t$this->view(\"turma/create_edit_aluno\",$this->data);\n\t\t}", "protected function editar()\n {\n }", "function evt__Agregar()\n\t{\n\t\t$this->tabla()->resetear();\n\t\t$this->set_pantalla('pant_edicion');\n\t}", "function rt_button_edit($target)\n{\n return rt_ui_button('edit', $target, 'pencil');\n}", "public static function createEdTablebutton($table='no_table_provided',$id=0){\n\t\tif(empty($id)) return \"<span>xEdx</span>\";\n\t\treturn \"<button type='button' class='btn_edit' onclick='btnEditTableItem(\\\"{$table}\\\",{$id});'>edit</button>\";\n\t}", "public function getButton() {}", "public function editar ()\n {\n try {\n // Define a ação de editar\n $acao = Orcamento_Business_Dados::ACTION_EDITAR;\n \n if ( $this->_requisicao->isGet () ) {\n // Retorna parâmetros informados via get, após validações\n $parametros = $this->trataParametroGet ( 'cod' );\n \n // Busca os dados a exibir, após validações\n $registro = $this->trataRegistro ( $acao, $parametros );\n \n // Cria o formulário populado com os dados\n $formulario = $this->popularFormulario ( $acao, $registro );\n \n // Faz transformações no formulário, se necessário\n $formulario = $this->transformaFormulario ( $formulario, $acao );\n \n // Bloqueia a edição de campos de chave primária (ou composta)\n $this->bloqueiaCamposChave ( $formulario );\n \n // Bloqueia todos os campos\n $this->bloqueiaCamposTodos ( $acao, $formulario, $registro );\n \n // Exibe o formulário\n $this->view->formulario = $formulario;\n } else {\n // Cria o formulário vazio\n $formulario = $this->retornaFormulario ( $acao );\n \n // Grava o novo registro\n $this->gravaDados ( $acao, $formulario );\n }\n } catch ( Exception $e ) {\n // Gera o erro\n throw new Zend_Exception ( $e->getMessage () );\n }\n }", "public function set_button($button) { $this->button = $button; }", "public function addButton(\\SetaPDF_FormFiller_Field_Button $button) {}", "public function cerraModal(){\n\n $this->folio='';\n\n $this->nombre= ''; \n\n $this->apellido_p= '';\n\n $this->apellido_m= '';\n\n $this->puesto= ''; \n }", "public function constructArrayButton()\n { \n //- récupération des boutons par défaut\n $arra_bouton=parent::constructArrayButton();\n \n //- suppression des boutons superflus\n unset($arra_bouton['actionNew']);\n \n //- récupération du modèle\n $obj_model=$this->getModel();\n \n //- s'il n'y a pas d'historique de déplacement \n if(!$obj_model->getHasHisto())\n {\n unset($arra_bouton['actionBack']);\n } \n \n return $arra_bouton;\n }", "public function addsButtons() {}", "function bt_fecharClick($sender, $params)\r\n {\r\n\r\n $this->mgt_nota_fiscal_data_ini->Text = '';\r\n $this->mgt_nota_fiscal_data_fim->Text = '';\r\n $this->mgt_nota_fiscal_numero->Text = '';\r\n\r\n //*** Limpa a Tabela de Cobrancas ***\r\n\r\n $Comando_SQL = \"TRUNCATE TABLE mgt_swap_cobrancas\";\r\n\r\n GetConexaoPrincipal()->SQL_Comunitario->Close();\r\n GetConexaoPrincipal()->SQL_Comunitario->SQL = $Comando_SQL;\r\n GetConexaoPrincipal()->SQL_Comunitario->Open();\r\n GetConexaoPrincipal()->SQL_Comunitario->Close();\r\n\r\n //*** Fecha a Tela de Cobranca ***\r\n\r\n redirect('frame_corpo.php');\r\n }", "function eventclass_TambahPergerakan()\n\t{\n\t\t$this->events[\"BeforeShowEdit\"]=true;\n\n\n//\tonscreen events\n\n\n\t}", "public function edit() {\n\t\t\t\n\t\t}", "function bindActionButtonObject()\r\n\t{\r\n JTable::addIncludePath( JPATH_ADMINISTRATOR . '/components/com_calendar/tables' );\r\n\t\t$table = JTable::getInstance( 'ActionButtons', 'CalendarTable' );\r\n\t\t\r\n\t if (!empty($this->actionbutton_id))\r\n\t {\r\n\t $table->load( $this->actionbutton_id );\r\n\t }\r\n\t \r\n\t\t$table->trimProperties();\r\n\t\t\r\n\t\t$properties = $this->getProperties();\r\n\t\t$table_properties = $table->getProperties();\r\n\r\n\t\tforeach ($table_properties as $prop=>$value)\r\n\t\t{\r\n\t\t $key_name = $prop;\r\n\t\t if (!array_key_exists($key_name, $properties))\r\n\t\t {\r\n\t\t $this->$key_name = $table->$prop;\r\n\t\t }\r\n\t\t}\r\n\t}", "function edit_insert_button($caption, $js_onclick, $title = '')\t{\n\t?>\n\tif (toolbar) {\n\t\tvar theButton = document.createElement('input');\n\t\ttheButton.type = 'button';\n\t\ttheButton.value = '<?php echo $caption; ?>';\n\t\ttheButton.onclick = <?php echo $js_onclick; ?>;\n\t\ttheButton.className = 'ed_button';\n\t\ttheButton.title = \"<?php echo $title; ?>\";\n\t\ttheButton.id = \"<?php echo \"ed_{$caption}\"; ?>\";\n\t\ttoolbar.appendChild(theButton);\n\t}\n\t\n<?php }", "public function edit_toko(){\n\t}", "public function annimalEditAction()\n {\n }", "function botaoExcluir($indiceCadastro){\n echo \"\n <form method='post'>\n <button type='submit' class='btn btn-outline-danger btn-sm' name='botaoExcluir' value='$indiceCadastro'><i class='material-icons'>delete</i></button>\n </form>\";//o botão vai receber o valor do indice correspondente a sua linha na tabela de cadastros\n }", "public function edit()\n {\n \n }", "public function edit()\n\t{\n\t\t//\n\t}", "public function edit()\n {\n \n }", "public function edit()\n {\n \n }", "public function edit()\n {\n \n }", "public function actualizaEstado(){\n $this->estado = 'Completo';\n // $this->cotiza = $this->generarCustomID();\n $this->save();\n }", "function add_ind_button($buttons) {\n\tarray_push($buttons, 'Indizar');\n\treturn $buttons;\n}", "protected function _setAddButton()\n {\n $this->setChild('add_button',\n $this->getLayout()->createBlock('adminhtml/widget_button')\n ->setData(array('id' => \"add_tax_\" . $this->getElement()->getHtmlId(),\n 'label' => Mage::helper('catalog')->__('Add Tax'),\n 'onclick' => \"weeeTaxControl.addItem('\" . $this->getElement()->getHtmlId() . \"')\",\n 'class' => 'add'\n )));\n }", "public function editar() {\n\t\t$POST = array();\n\n\t\t\t##apagando indice de tokenrequest pois ele não existe na tabela de categorias\n\t\tunset($this->request->data['TokenRequest']);\t\n\n\t\t$POST = array('UsuarioCliente'=>$this->request->data);\t\n\t\tif ($this->UsuarioCliente->save($POST)) \n\t\t{\n\t\t\t$this->Message = 'Usuario editado com sucesso';\n\t\t\t$this->Return = true;\t\n\t\t} \n\n\t\telse \n\t\t{\n\t\t\t$this->Message = 'Ocorreu um erro na edição de seu Usuario.';\n\t\t\t$this->Return = false;\t\n\t\t}\n\n\t\t$this->EncodeReturn();\t\n\t}", "public function create()\n {\n //KEMUDIAN DI DALAMNYA KITA MENJALANKAN FUNGSI UNTUK MENGOSONGKAN FIELD\n $this->resetFields();\n //DAN MEMBUKA MODAL\n $this->openModal();\n }", "public function edit()\n\t{\n\t\t\n\t}", "function evt__agregar()\n\t{\n\t\t$this->set_pantalla('pant_edicion');\n\t}", "public function edit(){\n $carros = array();\n\n $nomes[] = 'Astra';\n $nomes[] = 'Caravan';\n $nomes[] = 'Ipanema';\n $nomes[] = 'Kadett';\n $nomes[] = 'Monza';\n $nomes[] = 'Opala';\n $nomes[] = 'Veraneio';\n\n $this->set('carros',$nomes);\n }", "public function edit()\n {\n \n \n }", "public function edit()\r\n {\r\n //\r\n }", "public function edit()\r\n {\r\n //\r\n }", "private function createButton() {\n $fv = new filterVars;\n $phpSelf = $fv->phpSelf();\n\t$addButton = \"<A HREF='$phpSelf?action=crf'><button title='Create Row'>Create Row</button></A>\"; \n return $addButton; \n }", "public function edit()\n {\n }", "public function edit()\n {\n }", "public function edit()\n {\n }", "public function edit( )\r\n {\r\n //\r\n }", "public function editarCarreraController(){\n $datosController = $_GET[\"id\"];\n //Enviamos al modelo el id para hacer la consulta y obtener sus datos\n $respuesta = Datos::editarCarreraModel($datosController, \"carreras\");\n //Recibimos respuesta del modelo e IMPRIMIMOS UNA FORM PARA EDITAR\n echo'<input type=\"hidden\" value=\"'.$respuesta[\"id\"].'\"\n name=\"idEditar\">\n <input type=\"text\" value =\"'.$respuesta[\"nombre\"].'\"\n name=\"carreraEditar\" required>\n <input type=\"submit\" value= \"Actualizar\">';\n }", "public function edit() {\n }", "public function edita()\n\t {\t\n\t\t$id=$_REQUEST['id'];\n\t\t$car=$_REQUEST['car'];\n\t\t$nom=$_REQUEST['nom'];\n\t\t$cod=$_REQUEST['cod'];\n\t\t$niv=$_REQUEST['niv'];\n\t\t$obs=$_REQUEST['obs'];\n\t\t$est=$_REQUEST['est'];\n\t\t\t//$usu=$_REQUEST['usu'];\n\t\t$cur_data=array();\n\t\t$cur_data['id_curso']=$id;\n\t\t$cur_data['id_carrera']=$car;\n\t\t$cur_data['nombre']=$nom;\n\t\t$cur_data['codigo']=$cod;\n\t\t$cur_data['nivel']=$niv;\n\t\t$cur_data['observacion']=$obs;\n\t\t$cur_data['estado']=$est;\n\t\t\n\t\tprint_r($cur_data);\n\t\t$curso=new cursos;\n\t\t$curso->edit($cur_data);\n\t\t$data1=$curso->lista();\n\t\t$this->principal();\n\t }", "public function edit($id_peminjaman)\n {\n //\n\n\n }", "public function editAction() {}", "public function Edit()\n\t{\n\t\t\n\t}", "static public function ctrEditarAtencion(){\r\n\t\t\tif (isset($_POST[\"editarCodigo\"])){\r\n\t\t\t\tif (preg_match('/^[a-zA-Z0-9ñÑáéíóúÁÉÍÓÚ ]+$/', $_POST[\"editarUser\"])){\r\n\r\n\t\t\t\t\t\r\n\t\t\t\t\t$tabla = \"atencion\";\r\n\r\n\t\t\t\t\t\t$datos = array(\"id_atencion\" => $_POST[\"idAtencion\"],\r\n\t\t\t\t\t\t\t\t\t \"codigo_atencion\" => $_POST[\"editarCodigo\"],\r\n\t\t\t\t\t\t\t\t\t \"id_usuario\" => $_POST[\"editarUser\"],\r\n\t\t\t\t\t\t\t\t\t \"id_personal_salud\" => $_POST[\"editarPersonalSalud\"],\r\n\t\t\t\t\t\t\t\t\t \"id_paciente\" => $_POST[\"editarPaciente\"],\r\n\t\t\t\t\t\t\t\t\t \"ups\" => $_POST[\"editarUps\"],\r\n\t\t\t\t\t\t\t\t\t \"servicio\" => $_POST[\"editarServicio\"],\r\n\t\t\t\t\t\t\t\t\t \"especialidad\" => $_POST[\"editarEspecialidad\"],\r\n\t\t\t\t\t\t\t\t\t \"diagnostico\" => $_POST[\"editarDiagnostico\"],\r\n\t\t\t\t\t\t\t\t\t \"fecha_atencion\" => $_POST[\"editarFechaAtencion\"]);\r\n\r\n\t\t\t\t\t\t$respuesta = ModeloAtenciones::mdlEditarAtenciones($tabla, $datos);\r\n\r\n\t\t\t\t\t\tif ($respuesta == \"ok\") {\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\techo '<script>\r\n\r\n\t\t\t\t\t\t\t\t\tswal({\r\n\t\t\t\t\t\t\t\t\t\ttype: \"success\",\r\n\t\t\t\t\t\t\t\t\t\ttitle: \"¡La Atención ha sido modificada correctamente!\",\r\n\t\t\t\t\t\t\t\t\t\tshowConfirmButton: true,\r\n\t\t\t\t\t\t\t\t\t\tconfirmButtonText: \"Cerrar\",\r\n\t\t\t\t\t\t\t\t\t\tcloseOnConfirm: false\r\n\t\t\t\t\t\t\t\t\t\t}).then((result)=>{\r\n\t\t\t\t\t\t\t\t\t\t\tif(result.value){\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\twindow.location = \"atenciones\";\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t });\r\n\r\n\t\t\t\t\t\t \t\t </script>';\r\n\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t}else{\r\n\r\n\t\t\t\t\techo '<script>\r\n\r\n\t\t\t\t\t\t\tswal({\r\n\t\t\t\t\t\t\t\ttype: \"error\",\r\n\t\t\t\t\t\t\t\ttitle: \"¡La Atención no puede ir vacía o llevar caracteres especiales !\",\r\n\t\t\t\t\t\t\t\tshowConfirmButton: true,\r\n\t\t\t\t\t\t\t\tconfirmButtonText: \"Cerrar\",\r\n\t\t\t\t\t\t\t\tcloseOnConfirm: false\r\n\t\t\t\t\t\t\t\t}).then((result)=>{\r\n\t\t\t\t\t\t\t\t\tif(result.value){\r\n\r\n\t\t\t\t\t\t\t\t\t\twindow.location = \"atenciones\";\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t });\r\n\r\n\t\t\t\t\t\t </script>';\r\n\r\n\t\t\t}\r\n\t\t }\r\n\t\t/*===== FIN registro pacientes ======*/\t\t\t\t\t\r\n\t\t}", "abstract protected function createEdit($dataToBind, $id = 0);", "public function edit(incidencia $incidencia)\n {\n //\n }", "public function edit($id_cliente){}", "public function edit()\n { }", "public function edit()\n {\n\n }", "public function edit()\n {\n\n }", "public function edit()\n {\n\n }", "public function edit()\n {\n\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit() {\n\n }", "public function edit()\n { \n }", "public function edit()\n {\n //\n }", "public function alter(){\n $tabla = '';\n if(!empty($_POST)){\n if( isset( $_POST['agrcol_tabla'] ) ):\n $tabla = $_POST['agrcol_tabla'];\n $col = $_POST['agrcol_col'];\n $after = $_POST['agrcol_after'];\n endif;\n } \n\n if($tabla!=''):\n $inic = $col;\n $tablas = '';\n $type = '';\n $fk = '';\n $creartablas='';\n\n if( stristr($col, '_id' ) ) $tablas = str_replace('_id', '', $col);\n if( stristr($col, '_id' ) ) $type = ' INTEGER(10)'; \n if( stristr($col, '_fecha') ) $type = ' DATE'; \n if( stristr($col, '_nro' ) ) $type = ' INTEGER(10)'; \n if( stristr($col, '_texto') ) $type = ' TEXT'; \n if($type=='') $type = ' VARCHAR(255)'; \n\n $alter = 'ALTER TABLE '.$tabla.' ADD '.$col.' '.$type.' AFTER '.$after.';';\n\n if($tablas!=''):\n $creartablas.= 'CREATE TABLE IF NOT EXISTS '.$tablas.' ( ';\n $creartablas.= ' id_'.$tablas.' INTEGER(10) PRIMARY KEY AUTO_INCREMENT ';\n $creartablas.= ', name_'.$tablas.' VARCHAR(99) ';\n $creartablas.= ', detail_'.$tablas.' VARCHAR(99) ';\n $creartablas.= '); ';\n $alter.= 'ALTER TABLE '.$tabla.' ADD FOREIGN KEY ('.$tablas.'_id) REFERENCES '.$tablas.'(id_'.$tablas.');';\n endif;\n $a = $creartablas.$alter;\n $b = explode(';', $a);\n $re = 'INICIO DE PETICION<BR>#####################';\n $this->db->trans_start();\n foreach ($b as $value) {\n if($value!='')\n $this->db->query($value);\n $re.= \"<BR>Peticion: \".$value.'';\n }\n $this->db->trans_complete();\n $re.= '#####################<br>Fin de las peticiones';\n return $re;\n endif; \n }", "public function edit(Consommation $consommation)\n {\n //\n }", "public function edit(Annonce $annonce)\n {\n //\n }", "public function edit(Annonce $annonce)\n {\n //\n }", "function OnBeforeCreateEditControl(){\n }", "public function renderCreateButton()\n {\n return new Tools\\CreateButton($this);\n }", "function incluir_click($sender, $param)\n {\n if ($this->IsValid)\n {\n $this->incluir->Enabled=False;//Se deshabilita boton incluir\n // se capturan los valores de los controles\n $aleatorio = $this->numero->Text;\n $cod_direccion = usuario_actual('cod_direccion');\n $cod_direccion=substr($cod_direccion, 1);\n $siglas = usuario_actual('siglas_direccion');\n $ano = $this->lbl_ano->Text;\n $asunto = str_replace(\"'\", '\\\\\\'', $this->txt_asunto->Text );\n $destinatario = str_replace(\"'\", '\\\\\\'', $this->txt_destinatario->Text );\n $enviadopor=usuario_actual('login');\n $fecha = cambiaf_a_mysql ($this->txt_fecha->Text);\n //$memo=$this->html1->text;\n //busca el nombre del remitente\n $sql3=\"select cedula from intranet.usuarios where(login='$enviadopor')\";\n $resultado3=cargar_data($sql3, $sender);\n $cedula=$resultado3[0]['cedula'];\n $sql3=\"select nombres, apellidos from organizacion.personas where(cedula='$cedula')\";\n $resultado3=cargar_data($sql3, $sender);\n $remitente=$resultado3[0]['nombres'].' '.$resultado3[0]['apellidos'];\n $criterios_adicionales=array('direccion' => $cod_direccion, 'ano' => $ano);\n $numero=proximo_numero(\"organizacion.memoranda\",\"correlativo\",$criterios_adicionales,$this);\n $numero=rellena($numero,4,\"0\");\n // se inserta en la base de datos\n $sql = \"insert into organizacion.memoranda\n (direccion, siglas, correlativo, ano, fecha, asunto, destinatario, status, memo, remitente)\n values ('$cod_direccion','$siglas','$numero','$ano','$fecha','$asunto','$destinatario','1','$memo', '$remitente')\"; \n $resultado=modificar_data($sql,$sender);\n /*$sql2=\"update organizacion.adjuntos set correlativo='$numero' where (correlativo='$aleatorio')\";\n $resultado2=modificar_data($sql2, $sender);*/ \n /* Se incluye el rastro en el archivo de bitácora */\n $descripcion_log = \"Incluido el Memorando: \".$siglas.\"-\".$numero.\"-\".$ano;\n inserta_rastro(usuario_actual('login'),usuario_actual('cedula'),'I',$descripcion_log,\"\",$sender);\n $this->LTB->titulo->Text = \"Solicitud de número de Memorando\";\n $this->LTB->texto->Text = \"Se ha registrado exitosamente el nuevo Memorando con el \".\n \"número: <strong>\".$siglas.\"-\".$numero.\"-\".$ano.\"</strong>\";\n $this->LTB->imagen->Imageurl = \"imagenes/botones/memoranda.png\";\n $this->LTB->redir->Text = \"epaper.incluir_memo\";\n $params = array('mensaje');\n $this->getPage()->getCallbackClient()->callClientFunction('muestra_mensaje', $params);\n\n //$this->mensaje2->setSuccessMessage($sender, \"Se ha registrado exitosamente el nuevo Memorando con el numero:\".$siglas.\"-\".$numero.\"-\".$ano, 'grow');\n\n }\n }", "function newButton($view) {\n\t\t$str = '<a class=\"button is-primary\" href=\"?do=edit&amp;view='.$view.'\">New</a>';\n\t\treturn $str;\n\t}", "private function creaEvento() {\n $fevento = USingleton::getInstance('FEvento');\n $dati = $this->dati;\n $classe = $this->classe;\n \n //----------------sezione di controllo delle operazioni-----------------\n \n if ($this->operazione == 'inserimento') {\n if ($this->tabella == 'evento') {\n $id = 1 + $fevento->loadultimoevento()[0];\n }\n if ($this->tabella == 'evento_spec') {\n $id = $dati['code'];\n }\n if ($this->tabella == 'partecipazione') {\n $feventosp = USingleton::getInstance('FEventoSPecifico');\n $tipo = $feventosp->loadTipo($dati['code'])['tipo'];\n $classe = \"E\" . $tipo;\n $id = $dati['code'];\n }\n if ($this->tabella == 'biglietti') {\n $feventosp = USingleton::getInstance('FEventoSPecifico');\n $tipo = $feventosp->loadTipo($dati['code'])['tipo'];\n $classe = \"E\" . $tipo;\n $id = $dati['code'];\n }\n }\n if ($this->operazione == 'cancellazione') {\n if ($this->tabella == 'evento') {\n $feventosp = USingleton::getInstance('FEventoSPecifico');\n $tipo = $feventosp->loadTipo($dati['code'])['tipo'];\n $classe = \"E\" . $tipo;\n $id = $dati['code'];\n }\n if ($this->tabella == 'evento_spec') {\n $feventosp = USingleton::getInstance('FEventoSPecifico');\n $tipo = $feventosp->loadTipo($dati['code'])['tipo'];\n $classe = \"E\" . $tipo;\n $id = $dati['code'];\n }\n if ($this->tabella == 'partecipazione') {\n $feventosp = USingleton::getInstance('FEventoSPecifico');\n $tipo = $feventosp->loadTipo($dati['code'])['tipo'];\n $classe = \"E\" . $tipo;\n $id = $dati['code'];\n }\n }\n//---------------------------------------------------------------------------------------------------------\n\n $zona = [new EZona($dati['zona'], $dati['capacita'])];\n $luogo = new ELuogo($dati['citta'], $dati['struttura'], $zona);\n $partecipazioni = [new EPartecipazione($zona[0], $dati['prezzo'])];\n\n if ($classe == 'EPartita') {\n $eventoSpecifico = [new EPartita($luogo, $dati['data'], $partecipazioni, $dati['casa'], $dati['ospite'])];\n }\n if ($classe == 'ESpettacolo') {\n $eventoSpecifico = [new ESpettacolo($luogo, $dati['data'], $partecipazioni, $dati['compagnia'])];\n }\n if ($classe == 'EConcerto') {\n $eventoSpecifico = [new EConcerto($luogo, $dati['data'], $partecipazioni, $dati['artista'])];\n }\n\n $evento = new EEvento($id, $dati['immagine'], $dati['nome_evento'], $eventoSpecifico);\n\n return $evento;\n }", "function editar($id) {\r\n $this->_vista->setJs('bootstrapValidator.min');\r\n $this->_vista->setCss('bootstrapValidator.min');\r\n $this->_vista->setJs('validarForm', 'curso');\r\n\r\n /* declarar e inicializar variables */\r\n $this->_vista->titulo = 'Curso-Editar';\r\n $this->_vista->errorForm = array();\r\n $id = $this->filtrarEntero($id);\r\n $this->_vista->curso = new Curso();\r\n\r\n /* logica */\r\n $this->_vista->curso->buscar($id);\r\n\r\n // comprobar que el registro exista\r\n if ($this->_vista->curso->getId() == -1) {\r\n $this->redireccionar('error/tipo/Registro_NoExiste');\r\n }\r\n\r\n // listas\r\n $this->_vista->listaAsignaturas = $this->_vista->curso->getAsignatura()->lista();\r\n $this->_vista->listaCarreras = $this->_vista->curso->getCarrera()->lista();\r\n $this->_vista->listaGrupos = $this->_vista->curso->getGrupo()->lista();\r\n $this->_vista->listaCiclos = $this->_vista->curso->getCiclo()->lista();\r\n $this->_vista->listaEspacios = $this->_vista->curso->getEspacio()->lista();\r\n\r\n\r\n $this->_vista->render('curso/editar');\r\n }", "public function editar(){\n\t\t\n\t\t$this->form_validation->set_rules('resposta', 'RESPOSTA', 'trim');\n\t\tif ($this->form_validation->run()==TRUE):\n\t\t$dados = elements(array('resposta'), $this->input->post());\n\t\t$this->Comentarios->do_update($dados, array('id_comentario'=>$this->input->post('idcomentario')));\n\t\tendif;\n\t\tset_tema('titulo', 'Resposta de Coment&aacute;rio');\n\t\tset_tema('conteudo', load_modulo('Comentarios', 'editar'));\n\t\tload_template();\n\t}", "public function edit(Entrenador $entrenador)\n {\n //\n }", "function manipulate_update_button($buttons, $rowData){\r\n\t\t//print_r($rowData);exit();\r\n\t\tif ($this->input->get('action') == 'view') {unset($buttons['update']);}\r\n\t\t{\r\n\t\t$this->db_plc0->where('iupb_id', $rowData['iupb_id']);\t\t\r\n\t\t$j2 = $this->db_plc0->count_all_results('plc2.coa_pilot_lab');\r\n\t\t$icoa_id=0;\r\n\t\tif($j2> 0){\r\n\t\t\t$sql=\"select * from plc2.coa_pilot_lab where iupb_id=\".$rowData['iupb_id'].\" LIMIT 1\";\r\n\t\t\t$dt=$this->db_plc0->query($sql)->row_array();\r\n\t\t\t$icoa_id=$dt['icoa_id'];\r\n\t\t}\r\n\r\n\t\tunset($buttons['update']);\r\n\t\t//$js=$this->load->view('misc_util',array('className'=> 'coa_pilot_lab'), true);\r\n\t\t$js =$this->load->view('coa_pilot_lab_js');\r\n\t\t$js .= $this->load->view('uploadjs');\r\n\r\n\t\t$cNip=$this->user->gNIP;\r\n\t\t$sql= \"select * from plc2.plc2_upb up where up.iupb_id=\".$rowData['iupb_id'];\r\n\t\t$dt=$this->dbset->query($sql)->row_array();\r\n\t\t$setuju = '<button onclick=\"javascript:setuju(\\'coa_pilot_lab\\', \\''.base_url().'processor/plc/coa/pilot/lab?action=confirm&last_id='.$this->input->get('id').'&icoa_id='.$icoa_id.'&foreign_key='.$this->input->get('foreign_key').'&company_id='.$this->input->get('company_id').'&group_id='.$this->input->get('group_id').'&modul_id='.$this->input->get('modul_id').'\\', this, '.$dt['iupb_id'].', \\''.$dt['vupb_nomor'].'\\')\" class=\"ui-button-text icon-save\" id=\"button_save_soi_fg\">Confirm</button>';\r\n\t\t\r\n\t\t$approve = '<button onclick=\"javascript:load_popup(\\''.base_url().'processor/plc/coa/pilot/lab?action=approve&iupb_id='.$rowData['iupb_id'].'&icoa_id='.$icoa_id.'&cNip='.$cNip.'&status=1&group_id='.$this->input->get('group_id').'&modul_id='.$this->input->get('modul_id').'\\')\" class=\"ui-button-text icon-save\" id=\"button_approve_coa_pilot_lab\">Approve</button>';\r\n\t\t$reject = '<button onclick=\"javascript:load_popup(\\''.base_url().'processor/plc/coa/pilot/lab?action=reject&iupb_id='.$rowData['iupb_id'].'&icoa_id='.$icoa_id.'&cNip='.$cNip.'&status=2&group_id='.$this->input->get('group_id').'&modul_id='.$this->input->get('modul_id').'\\')\" class=\"ui-button-text icon-save\" id=\"button_approve_coa_pilot_lab\">Reject</button>';\r\n\r\n\t\t$update = '<button onclick=\"javascript:update_btn_back(\\'coa_pilot_lab\\', \\''.base_url().'processor/plc/coa/pilot/lab?company_id='.$this->input->get('company_id').'&group_id='.$this->input->get('group_id').'&modul_id='.$this->input->get('modul_id').'\\', this)\" class=\"ui-button-text icon-save\" id=\"button_save_coa_pilot_lab\">Update & Submit</button>';\r\n\t\t$updatedraft = '<button onclick=\"javascript:update_draft_btn(\\'coa_pilot_lab\\', \\''.base_url().'processor/plc/coa/pilot/lab?company_id='.$this->input->get('company_id').'&draft=true&group_id='.$this->input->get('group_id').'&modul_id='.$this->input->get('modul_id').'\\', this, true)\" class=\"ui-button-text icon-save\" id=\"button_save_coa_pilot_lab\">Update as Draft</button>';\r\n\t\tif($this->auth_localnon->is_manager()){\r\n\t\t\t$x=$this->auth_localnon->dept();\r\n\t\t\t$manager=$x['manager'];\r\n\t\t\tif(in_array('QA', $manager)){\r\n\t\t\t\tif($j2> 0){\r\n\t\t\t\t\t$sql=\"select * from plc2.coa_pilot_lab where icoa_id=\".$icoa_id.\" LIMIT 1\";\r\n\t\t\t\t\t$dt=$this->db_plc0->query($sql)->row_array();\r\n\t\t\t\t\tif($dt['isubmit']==0){\r\n\t\t\t\t\t\t$buttons['update']=$updatedraft.$update.$js;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telseif(($dt['isubmit']<>0)&&($dt['iappqa']==0)){\r\n\t\t\t\t\t\t$buttons['update']=$setuju.$js;\r\n\t\t\t\t\t}else{}\r\n\t\t\t\t}else{\r\n\t\t\t\t\t$buttons['update']=$updatedraft.$update.$js;\r\n\t\t\t\t}\r\n\t\t\t\t$type='QA';\r\n\t\t\t}else{\r\n\r\n\t\t\t\t$type='';\r\n\t\t\t}\r\n\t\t}else{\r\n\r\n\t\t\t$x=$this->auth_localnon->dept();\r\n\t\t\t$team=$x['team'];\r\n\t\t\tif(in_array('QA', $team)){\r\n\t\t\t\t$type='QA';\r\n\t\t\t\tif($j2> 0){\r\n\t\t\t\t\t$sql=\"select * from plc2.coa_pilot_lab where icoa_id=\".$icoa_id.\" LIMIT 1\";\r\n\t\t\t\t\t$dt=$this->db_plc0->query($sql)->row_array();\r\n\t\t\t\t\tif($dt['isubmit']==0){\r\n\t\t\t\t\t\t$buttons['update']=$updatedraft.$update.$js;\r\n\t\t\t\t\t}else{}\r\n\t\t\t\t}else{\r\n\t\t\t\t\t$buttons['update']=$updatedraft.$update.$js;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\t$type='';\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\treturn $buttons;\r\n\t}", "function insertarControlGuia($numremesa, $idestablecimiento, $txtFecRecogida, $iddestinatario, $formaPago, $alto, $ancho, $largo, $unidades, $valorDeclarado, $flete, $totalflete, $tipocarga, $idoperario, $numplaca, $idoperarioext, $estadocarga, $estadoRecogida, $observaciones, $idusaurio, $fechaRegistro) {\n $data = array('nro_remesa' => $numremesa,\n 'id_establecimientos' => $idestablecimiento,\n 'fecha_recogida' => $txtFecRecogida,\n 'id_destinatario' => $iddestinatario,\n 'forma_pago' => $formaPago,\n 'unidades' => $unidades,\n 'pv_alto' => $alto,\n 'pv_ancho' => $ancho,\n 'pv_largo' => $largo,\n 'valor_declarado' => $valorDeclarado,\n 'flete' => $flete,\n 'total_fletes' => $totalflete,\n 'tipo_carga' => $tipocarga,\n 'id_usuario_operario' => $idoperario,\n 'nro_placa' => $numplaca,\n 'id_operario' => $idoperarioext,\n 'estado_carga' => $estadocarga,\n 'estado_control' => $estadoRecogida,\n 'observaciones' => $observaciones,\n 'estado_contable' => 0,\n 'id_usuario' => $idusaurio,\n 'fecha_registro' => $fechaRegistro);\n $this->db->insert('txtar_admin_control', $data);\n $this->db->close();\n }", "public function getEditIncrement();", "public function editar()\n {\n\t\tif($this->_Method == \"POST\")\n\t\t{\n\t\t\t$this->editar_post();\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->editar_get();\n\t\t}\n }", "function getButtonText()\r\n\t{\r\n\t\tif ( isset($this->object_it) )\r\n\t\t{\r\n\t\t\treturn translate('Сохранить');\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\treturn translate('Создать');\r\n\t\t}\r\n\t}", "public function edit(OrangTua $orangTua)\n {\n //\n }", "public function EditarRegistro($idItem)\r\n {\r\n \r\n\t\r\n$tbl = <<<EOD\r\n\r\n<div id=\"jQueryDialog3\" style=\"\" title=\"Edita los campos\">\r\n<div id=\"wb_Form1\" style=\"position:absolute;left:16px;top:14px;z-index:3;\">\r\n<form name=\"FormBorrarItem\" method=\"post\" action=\"EditInv.php\" enctype=\"multipart/form-data\" target=\"_self\" id=\"Form1\">\r\n\r\nEOD;\r\n\r\nprint($tbl);\t\r\n\r\n$campos=$this->DevuelveValores($idItem);\r\n//print_r($campos);\r\nfor($i=1; $i<$this->NumCols; $i++)\r\n\t\tprint('<br>'.$this->NombreCol[$i].'<br><input type=\"text\" style=\"width:243px;height:35px;\" name=\"'.$this->NombreCol[$i].'\" value=\"'.$campos[$i].'\" > ');\r\n\t\t\r\n$tbl = <<<EOD\r\n\t\r\n\r\n<div id=\"Html1\" style=\"\">\r\n<input type=\"submit\" src=\"iconos/aceptar1.png\" name=\"EditarItem\" value=\"$this->tabla;$idItem\"></div>\r\n</form>\r\n</div>\r\n</div>\t\r\n<div id=\"wb_Form2\" style=\"position:absolute;left:115px;top:6px;width:348px;height:178px;z-index:11;\">\r\n<form name=\"BorrarItem\" method=\"post\" action=\"EditInv.php\" enctype=\"multipart/form-data\" target=\"_self\" id=\"Form2\">\r\n<button id=\"AdvancedButton1\" type=\"submit\" name=\"cancelar\" value=\"$this->tabla;$idItem\" style=\"position:absolute;left:40px;top:56px;width:108px;height:108px;z-index:4;\">\r\n<div style=\"text-align:center\"></div>\r\n</button>\r\n<button id=\"AdvancedButton2\" onclick=\"$('#jQueryDialog3').dialog('open');return false;\" type=\"button\" name=\"si\" value=\"\" style=\"position:absolute;left:225px;top:56px;width:108px;height:108px;z-index:5;\">\r\n<div style=\"text-align:center\"></div>\r\n</button>\r\n<div id=\"wb_Text8\" style=\"position:absolute;left:56px;top:9px;width:253px;height:16px;z-index:6;text-align:center;\">\r\n<span style=\"color:#0000FF;font-family:'Bookman Old Style';font-size:13px;\"><strong><em>Vas a editar el ID $idItem en la tabla $this->tabla?</em></strong></span></div>\r\n\r\n</form>\r\n</div>\r\n\r\nEOD;\r\n\r\nprint($tbl);\t\r\n\t\r\n\t}", "public function cbInit()\n\t{\n\t\t$this->title_field = \"donor_nama\";\n\t\t$this->limit = \"20\";\n\t\t$this->orderby = \"id,desc\";\n\t\t$this->global_privilege = false;\n\t\t$this->button_table_action = true;\n\t\t$this->button_bulk_action = false;\n\t\t$this->button_action_style = \"button_dropdown\";\n\t\t$this->button_add = true;\n\t\t$this->button_edit = true;\n\t\t$this->button_delete = true;\n\t\t$this->button_detail = true;\n\t\t$this->button_show = true;\n\t\t$this->button_filter = true;\n\t\t$this->button_import = false;\n\t\t$this->button_export = true;\n\t\t$this->table = \"ref_donor\";\n\t\t# END CONFIGURATION DO NOT REMOVE THIS LINE\n\n\t\t\t# START COLUMNS DO NOT REMOVE THIS LINE\n\t\t\t$this->col = [];\n\t\t\t$this->col[] = [\"label\"=>\"Donor Id\",\"name\"=>\"donor_id\"];\n\t\t\t$this->col[] = [\"label\"=>\"Donor Noktp\",\"name\"=>\"donor_noktp\"];\n\t\t\t$this->col[] = [\"label\"=>\"Donor Nama\",\"name\"=>\"donor_nama\"];\n\t\t\t$this->col[] = [\"label\"=>\"Donor Jeniskelamin\",\"name\"=>\"donor_jeniskelamin\",\"join\"=>\"jeniskelamin,nama\"];\n\t\t\t$this->col[] = [\"label\"=>\"Donor Status\",\"name\"=>\"donor_status\"];\n\t\t\t$this->col[] = [\"label\"=>\"Donor Alamatrumah\",\"name\"=>\"donor_alamatrumah\"];\n\t\t\t$this->col[] = [\"label\"=>\"Donor Nohp\",\"name\"=>\"donor_nohp\"];\n\t\t\t$this->col[] = [\"label\"=>\"Donor Pekerjaan\",\"name\"=>\"donor_pekerjaan\",\"join\"=>\"pekerjaan,pekerjaan_nama\"];\n\t\t\t# END COLUMNS DO NOT REMOVE THIS LINE\n\n\t\t\t# START FORM DO NOT REMOVE THIS LINE\n\t\t$this->form = [];\n\t\t$this->form[] = ['label' => 'No Donor', 'name' => 'donor_id', 'type' => 'text', 'validation' => 'required|min:1|max:255', 'width' => 'col-sm-10'];\n\t\t$this->form[] = ['label' => 'No KTP/SIM/Paspor', 'name' => 'donor_noktp', 'type' => 'text', 'validation' => 'required', 'width' => 'col-sm-10', 'placeholder' => 'Mohon ditulis dengan format No KTP/SIM/Paspor Jika tidak ada tulis - contoh : No KTP/SIM/-', 'value' => 'string'];\n\t\t$this->form[] = ['label' => 'Nama Lengkap', 'name' => 'donor_nama', 'type' => 'text', 'validation' => 'required|min:1|max:255', 'width' => 'col-sm-10'];\n\t\t$this->form[] = ['label' => 'Jenis Kelamin', 'name' => 'donor_jeniskelamin', 'type' => 'select2', 'validation' => 'required', 'width' => 'col-sm-10', 'datatable' => 'jeniskelamin,nama'];\n\t\t$this->form[] = ['label' => 'Status', 'name' => 'donor_status', 'type' => 'select2', 'validation' => 'required', 'width' => 'col-sm-10', 'dataenum' => 'Nikah;Belum Nikah'];\n\t\t$this->form[] = ['label' => 'Alamat Rumah', 'name' => 'donor_alamatrumah', 'type' => 'textarea', 'validation' => 'required|string|min:5|max:5000', 'width' => 'col-sm-10'];\n\t\t$this->form[] = ['label' => 'No HP', 'name' => 'donor_nohp', 'type' => 'text', 'validation' => 'required|min:1|max:255', 'width' => 'col-sm-10'];\n\t\t$this->form[] = ['label' => 'Wilayah', 'name' => 'donor_wilayah', 'type' => 'select2', 'validation' => 'required', 'width' => 'col-sm-10', 'datatable' => 'wilayah,wilayah_nama'];\n\t\t$this->form[] = ['label' => 'Kecamatan', 'name' => 'donor_kecamatan', 'type' => 'select2', 'validation' => 'required', 'width' => 'col-sm-10', 'datatable' => 'kecamatan,kecamatan_nama'];\n\t\t$this->form[] = ['label' => 'Kelurahan/Desa', 'name' => 'donor_kelurahan', 'type' => 'select2', 'validation' => 'required', 'width' => 'col-sm-10', 'datatable' => 'desa,desa_nama'];\n\t\t$this->form[] = ['label' => 'Alamat Kantor', 'name' => 'donor_alamatkantor', 'type' => 'textarea', 'validation' => 'required|string|min:5|max:5000', 'width' => 'col-sm-10'];\n\t\t$this->form[] = ['label' => 'Pekerjaan', 'name' => 'donor_pekerjaan', 'type' => 'select2', 'validation' => 'required', 'width' => 'col-sm-10', 'datatable' => 'pekerjaan,pekerjaan_nama'];\n\t\t$this->form[] = ['label' => 'Tempat Kelahiran', 'name' => 'donor_tempatkelahiran', 'type' => 'text', 'validation' => 'required|min:1|max:255', 'width' => 'col-sm-10'];\n\t\t$this->form[] = ['label' => 'Tanggallahir', 'name' => 'donor_tanggallahir', 'type' => 'date', 'validation' => 'required', 'width' => 'col-sm-10'];\n\t\t$this->form[] = ['label' => 'Apharesis', 'name' => 'donor_apharesis', 'type' => 'select2', 'validation' => 'required', 'width' => 'col-sm-10', 'dataenum' => 'Ya;Tidak'];\n\t\t$this->form[] = ['label' => 'Penghargaan', 'name' => 'donor_penghargaan', 'type' => 'select2', 'validation' => 'required', 'width' => 'col-sm-10', 'dataenum' => 'Belum Ada Penghargaan;25 kali;50 kali;75 kali;100 kali'];\n\t\t$this->form[] = ['label' => 'Puasa', 'name' => 'donor_puasa', 'type' => 'select2', 'validation' => 'required', 'width' => 'col-sm-10', 'dataenum' => 'Ya;Tidak'];\n\t\t$this->form[] = ['label' => 'Mau Donor saat dibutuhkan?', 'name' => 'donor_butuh', 'type' => 'select2', 'validation' => 'required', 'width' => 'col-sm-10', 'dataenum' => 'Ya;Tidak'];\n\t\t$this->form[] = ['label' => 'Donor Terakhir', 'name' => 'donor_terakhir', 'type' => 'date', 'validation' => 'required', 'width' => 'col-sm-10'];\n\t\t$this->form[] = ['label' => 'Donor Ke', 'name' => 'donor_ke', 'type' => 'text', 'validation' => 'required|min:1|max:255', 'width' => 'col-sm-10'];\n\t\t$this->form[] = ['label' => 'Nama Dokter', 'name' => 'donor_namadokter', 'type' => 'select2', 'validation' => 'required', 'width' => 'col-sm-10', 'datatable' => 'dokter,dokter_nama'];\n\t\t$this->form[] = ['label' => 'Riwayat Medis', 'name' => 'donor_riwayatmedis', 'type' => 'text', 'validation' => 'required|min:1|max:255', 'width' => 'col-sm-10'];\n\t\t$this->form[] = ['label' => 'Diambil Sebanyak', 'name' => 'donor_diambil', 'type' => 'select2', 'validation' => 'required', 'width' => 'col-sm-10', 'dataenum' => '350;450'];\n\t\t$this->form[] = ['label' => 'Kantong', 'name' => 'donor_kantong', 'type' => 'select2', 'validation' => 'required', 'width' => 'col-sm-10', 'dataenum' => 'S;D;T;Q;P'];\n\t\t$this->form[] = ['label' => 'Tensi', 'name' => 'donor_tensi', 'type' => 'number', 'validation' => 'required|integer|min:0', 'width' => 'col-sm-10'];\n\t\t$this->form[] = ['label' => 'Nadi', 'name' => 'donor_nadi', 'type' => 'number', 'validation' => 'required|integer|min:0', 'width' => 'col-sm-10'];\n\t\t$this->form[] = ['label' => 'Berat Badan', 'name' => 'donor_bb', 'type' => 'number', 'validation' => 'required|integer|min:0', 'width' => 'col-sm-10'];\n\t\t$this->form[] = ['label' => 'Tinggi Badan', 'name' => 'donor_tb', 'type' => 'number', 'validation' => 'required|integer|min:0', 'width' => 'col-sm-10'];\n\t\t$this->form[] = ['label' => 'Suhu', 'name' => 'donor_suhu', 'type' => 'text', 'validation' => 'required|min:1|max:255', 'width' => 'col-sm-10'];\n\t\t$this->form[] = ['label' => 'Petugas Administrasi', 'name' => 'donor_petugasadministrasi', 'type' => 'select2', 'validation' => 'required', 'width' => 'col-sm-10', 'datatable' => 'petugasadministrasi,petugasadministrasi_nama'];\n\t\t$this->form[] = ['label' => 'Validasi', 'name' => 'donor_validasi', 'type' => 'checkbox', 'validation' => 'required', 'width' => 'col-sm-10', 'dataenum' => 'Kartu Donor;KTP;SIM;Paspor'];\n\t\t$this->form[] = ['label' => 'Petugas Hemoglobin', 'name' => 'donor_petugashb', 'type' => 'select2', 'validation' => 'required', 'width' => 'col-sm-10', 'datatable' => 'petugashb,petugashb_nama'];\n\t\t$this->form[] = ['label' => 'Macam Donor', 'name' => 'donor_macamdonor', 'type' => 'select2', 'validation' => 'required', 'width' => 'col-sm-10', 'dataenum' => 'Sukarela;Pengganti'];\n\t\t$this->form[] = ['label' => 'Metode', 'name' => 'donor_metode', 'type' => 'select2', 'validation' => 'required', 'width' => 'col-sm-10', 'dataenum' => 'Biasa;Apharesis;Autologus'];\n\t\t$this->form[] = ['label' => 'Hemoglobin', 'name' => 'donor_hb', 'type' => 'number', 'validation' => 'required|integer|min:0', 'width' => 'col-sm-10'];\n\t\t$this->form[] = ['label' => 'Golongan Darah', 'name' => 'donor_goldar', 'type' => 'select2', 'validation' => 'required', 'width' => 'col-sm-10', 'dataenum' => 'A+;A-;AB+;AB-;O+;O-;B+;B-'];\n\t\t$this->form[] = ['label' => 'Petugas Aftap', 'name' => 'donor_petugasaftap', 'type' => 'select2', 'validation' => 'required', 'width' => 'col-sm-10', 'datatable' => 'petugasaftap,petugasaftap_nama'];\n\t\t$this->form[] = ['label' => 'Kode Timbangan', 'name' => 'donor_kodetimbangan', 'type' => 'text', 'validation' => 'required|min:1|max:255', 'width' => 'col-sm-10'];\n\t\t$this->form[] = ['label' => 'Penusukan Ulang', 'name' => 'donor_penusukanulang', 'type' => 'select2', 'validation' => 'required', 'width' => 'col-sm-10', 'dataenum' => 'tanpa penusukan ulang;1 kali;2 kali'];\n\t\t$this->form[] = ['label' => 'Lama Pengambilan', 'name' => 'donor_lamapengambilan', 'type' => 'radio', 'validation' => 'required', 'width' => 'col-sm-10', 'dataenum' => '>=12 menit;12-15 menit;>15 menit'];\n\t\t$this->form[] = ['label' => 'No Kantong', 'name' => 'donor_nokantong', 'type' => 'text', 'validation' => 'required', 'width' => 'col-sm-10'];\n\t\t$this->form[] = ['label' => 'Tanggal Donor', 'name' => 'donor_tanggaldonor', 'type' => 'date', 'validation' => 'required', 'width' => 'col-sm-10'];\n\t\t# END FORM DO NOT REMOVE THIS LINE\n\n\t\t# OLD START FORM\n\t\t//$this->form = [];\n\t\t//$this->form[] = ['label'=>'No Donor','name'=>'donor_id','type'=>'text','validation'=>'required|min:1|max:255','width'=>'col-sm-10'];\n\t\t//$this->form[] = ['label'=>'No KTP/SIM/Paspor','name'=>'donor_noktp','type'=>'text','validation'=>'required','width'=>'col-sm-10','placeholder'=>'Mohon ditulis dengan format No KTP/SIM/Paspor Jika tidak ada tulis - contoh : No KTP/SIM/-'];\n\t\t//$this->form[] = ['label'=>'Nama Lengkap','name'=>'donor_nama','type'=>'text','validation'=>'required|min:1|max:255','width'=>'col-sm-10'];\n\t\t//$this->form[] = ['label'=>'Jenis Kelamin','name'=>'donor_jeniskelamin','type'=>'select2','validation'=>'required','width'=>'col-sm-10','datatable'=>'jeniskelamin,nama'];\n\t\t//$this->form[] = ['label'=>'Status','name'=>'donor_status','type'=>'select2','validation'=>'required','width'=>'col-sm-10','dataenum'=>'Nikah;Belum Nikah'];\n\t\t//$this->form[] = ['label'=>'Alamat Rumah','name'=>'donor_alamatrumah','type'=>'textarea','validation'=>'required|string|min:5|max:5000','width'=>'col-sm-10'];\n\t\t//$this->form[] = ['label'=>'No HP','name'=>'donor_nohp','type'=>'text','validation'=>'required|min:1|max:255','width'=>'col-sm-10'];\n\t\t//$this->form[] = ['label'=>'Wilayah','name'=>'donor_wilayah','type'=>'select2','validation'=>'required','width'=>'col-sm-10','datatable'=>'wilayah,wilayah_nama'];\n\t\t//$this->form[] = ['label'=>'Kecamatan','name'=>'donor_kecamatan','type'=>'select2','validation'=>'required','width'=>'col-sm-10','datatable'=>'kecamatan,kecamatan_nama'];\n\t\t//$this->form[] = ['label'=>'Kelurahan/Desa','name'=>'donor_kelurahan','type'=>'select2','validation'=>'required','width'=>'col-sm-10','datatable'=>'desa,desa_nama'];\n\t\t//$this->form[] = ['label'=>'Alamat Kantor','name'=>'donor_alamatkantor','type'=>'textarea','validation'=>'required|string|min:5|max:5000','width'=>'col-sm-10'];\n\t\t//$this->form[] = ['label'=>'Pekerjaan','name'=>'donor_pekerjaan','type'=>'select2','validation'=>'required','width'=>'col-sm-10','datatable'=>'pekerjaan,pekerjaan_nama'];\n\t\t//$this->form[] = ['label'=>'Tempat Kelahiran','name'=>'donor_tempatkelahiran','type'=>'text','validation'=>'required|min:1|max:255','width'=>'col-sm-10'];\n\t\t//$this->form[] = ['label'=>'Tanggallahir','name'=>'donor_tanggallahir','type'=>'date','validation'=>'required','width'=>'col-sm-10'];\n\t\t//$this->form[] = ['label'=>'Apharesis','name'=>'donor_apharesis','type'=>'select2','validation'=>'required','width'=>'col-sm-10','dataenum'=>'Ya;Tidak'];\n\t\t//$this->form[] = ['label'=>'Penghargaan','name'=>'donor_penghargaan','type'=>'select2','validation'=>'required','width'=>'col-sm-10','dataenum'=>'Belum Ada Penghargaan;25 kali;50 kali;75 kali;100 kali'];\n\t\t//$this->form[] = ['label'=>'Puasa','name'=>'donor_puasa','type'=>'select2','validation'=>'required','width'=>'col-sm-10','dataenum'=>'Ya;Tidak'];\n\t\t//$this->form[] = ['label'=>'Mau Donor saat dibutuhkan?','name'=>'donor_butuh','type'=>'select2','validation'=>'required','width'=>'col-sm-10','dataenum'=>'Ya;Tidak'];\n\t\t//$this->form[] = ['label'=>'Donor Terakhir','name'=>'donor_terakhir','type'=>'date','validation'=>'required','width'=>'col-sm-10'];\n\t\t//$this->form[] = ['label'=>'Donor Ke','name'=>'donor_ke','type'=>'text','validation'=>'required|min:1|max:255','width'=>'col-sm-10'];\n\t\t//$this->form[] = ['label'=>'Nama Dokter','name'=>'donor_namadokter','type'=>'select2','validation'=>'required','width'=>'col-sm-10','datatable'=>'dokter,dokter_nama'];\n\t\t//$this->form[] = ['label'=>'Riwayat Medis','name'=>'donor_riwayatmedis','type'=>'text','validation'=>'required|min:1|max:255','width'=>'col-sm-10'];\n\t\t//$this->form[] = ['label'=>'Diambil Sebanyak','name'=>'donor_diambil','type'=>'select2','validation'=>'required','width'=>'col-sm-10','dataenum'=>'350;450'];\n\t\t//$this->form[] = ['label'=>'Kantong','name'=>'donor_kantong','type'=>'select2','validation'=>'required','width'=>'col-sm-10','dataenum'=>'S;D;T;Q;P'];\n\t\t//$this->form[] = ['label'=>'Tensi','name'=>'donor_tensi','type'=>'number','validation'=>'required|integer|min:0','width'=>'col-sm-10'];\n\t\t//$this->form[] = ['label'=>'Nadi','name'=>'donor_nadi','type'=>'number','validation'=>'required|integer|min:0','width'=>'col-sm-10'];\n\t\t//$this->form[] = ['label'=>'Berat Badan','name'=>'donor_bb','type'=>'number','validation'=>'required|integer|min:0','width'=>'col-sm-10'];\n\t\t//$this->form[] = ['label'=>'Tinggi Badan','name'=>'donor_tb','type'=>'number','validation'=>'required|integer|min:0','width'=>'col-sm-10'];\n\t\t//$this->form[] = ['label'=>'Suhu','name'=>'donor_suhu','type'=>'text','validation'=>'required|min:1|max:255','width'=>'col-sm-10'];\n\t\t//$this->form[] = ['label'=>'Petugas Administrasi','name'=>'donor_petugasadministrasi','type'=>'select2','validation'=>'required','width'=>'col-sm-10','datatable'=>'petugasadministrasi,petugasadministrasi_nama'];\n\t\t//$this->form[] = ['label'=>'Validasi','name'=>'donor_validasi','type'=>'checkbox','validation'=>'required','width'=>'col-sm-10','dataenum'=>'Kartu Donor;KTP;SIM;Paspor'];\n\t\t//$this->form[] = ['label'=>'Petugas Hemoglobin','name'=>'donor_petugashb','type'=>'select2','validation'=>'required','width'=>'col-sm-10','datatable'=>'petugashb,petugashb_nama'];\n\t\t//$this->form[] = ['label'=>'Macam Donor','name'=>'donor_macamdonor','type'=>'select2','validation'=>'required','width'=>'col-sm-10','dataenum'=>'Sukarela;Pengganti'];\n\t\t//$this->form[] = ['label'=>'Metode','name'=>'donor_metode','type'=>'select2','validation'=>'required','width'=>'col-sm-10','dataenum'=>'Biasa;Apharesis;Autologus'];\n\t\t//$this->form[] = ['label'=>'Hemoglobin','name'=>'donor_hb','type'=>'number','validation'=>'required|integer|min:0','width'=>'col-sm-10'];\n\t\t//$this->form[] = ['label'=>'Golongan Darah','name'=>'donor_goldar','type'=>'select2','validation'=>'required','width'=>'col-sm-10','dataenum'=>'A+;A-;AB+;AB-;O+;O-;B+;B-'];\n\t\t//$this->form[] = ['label'=>'Petugas Aftap','name'=>'donor_petugasaftap','type'=>'select2','validation'=>'required','width'=>'col-sm-10','datatable'=>'petugasaftap,petugasaftap_nama'];\n\t\t//$this->form[] = ['label'=>'Kode Timbangan','name'=>'donor_kodetimbangan','type'=>'text','validation'=>'required|min:1|max:255','width'=>'col-sm-10'];\n\t\t//$this->form[] = ['label'=>'Penusukan Ulang','name'=>'donor_penusukanulang','type'=>'select2','validation'=>'required','width'=>'col-sm-10','dataenum'=>'tanpa penusukan ulang;1 kali;2 kali'];\n\t\t//$this->form[] = ['label'=>'Lama Pengambilan','name'=>'donor_lamapengambilan','type'=>'radio','validation'=>'required','width'=>'col-sm-10','dataenum'=>'>=12 menit;12-15 menit;>15 menit'];\n\t\t//$this->form[] = ['label'=>'No Kantong','name'=>'donor_nokantong','type'=>'text','validation'=>'required','width'=>'col-sm-10'];\n\t\t//$this->form[] = ['label'=>'Tanggal Donor','name'=>'donor_tanggaldonor','type'=>'date','validation'=>'required','width'=>'col-sm-10'];\n\t\t# OLD END FORM\n\n\t\t/* \n\t | ---------------------------------------------------------------------- \n\t | Sub Module\n\t | ---------------------------------------------------------------------- \n\t\t\t| @label = Label of action \n\t\t\t| @path = Path of sub module\n\t\t\t| @foreign_key \t = foreign key of sub table/module\n\t\t\t| @button_color = Bootstrap Class (primary,success,warning,danger)\n\t\t\t| @button_icon = Font Awesome Class \n\t\t\t| @parent_columns = Sparate with comma, e.g : name,created_at\n\t | \n\t */\n\t\t$this->sub_module = array();\n\n\n\t\t/* \n\t | ---------------------------------------------------------------------- \n\t | Add More Action Button / Menu\n\t | ---------------------------------------------------------------------- \n\t | @label = Label of action \n\t | @url = Target URL, you can use field alias. e.g : [id], [name], [title], etc\n\t | @icon = Font awesome class icon. e.g : fa fa-bars\n\t | @color \t = Default is primary. (primary, warning, succecss, info) \n\t | @showIf \t = If condition when action show. Use field alias. e.g : [id] == 1\n\t | \n\t */\n\t\t$this->addaction = array();\n\n\n\t\t/* \n\t | ---------------------------------------------------------------------- \n\t | Add More Button Selected\n\t | ---------------------------------------------------------------------- \n\t | @label = Label of action \n\t | @icon \t = Icon from fontawesome\n\t | @name \t = Name of button \n\t | Then about the action, you should code at actionButtonSelected method \n\t | \n\t */\n\t\t$this->button_selected = array();\n\n\n\t\t/* \n\t | ---------------------------------------------------------------------- \n\t | Add alert message to this module at overheader\n\t | ---------------------------------------------------------------------- \n\t | @message = Text of message \n\t | @type = warning,success,danger,info \n\t | \n\t */\n\t\t$this->alert = array();\n\n\n\n\t\t/* \n\t | ---------------------------------------------------------------------- \n\t | Add more button to header button \n\t | ---------------------------------------------------------------------- \n\t | @label = Name of button \n\t | @url = URL Target\n\t | @icon = Icon from Awesome.\n\t | \n\t */\n\t\t$this->index_button = array();\n\n\n\n\t\t/* \n\t | ---------------------------------------------------------------------- \n\t | Customize Table Row Color\n\t | ---------------------------------------------------------------------- \n\t | @condition = If condition. You may use field alias. E.g : [id] == 1\n\t | @color = Default is none. You can use bootstrap success,info,warning,danger,primary. \n\t | \n\t */\n\t\t$this->table_row_color = array();\n\n\n\t\t/*\n\t | ---------------------------------------------------------------------- \n\t | You may use this bellow array to add statistic at dashboard \n\t | ---------------------------------------------------------------------- \n\t | @label, @count, @icon, @color \n\t |\n\t */\n\t\t$this->index_statistic = array();\n\n\n\n\t\t/*\n\t | ---------------------------------------------------------------------- \n\t | Add javascript at body \n\t | ---------------------------------------------------------------------- \n\t | javascript code in the variable \n\t | $this->script_js = \"function() { ... }\";\n\t |\n\t */\n\t\t$this->script_js = NULL;\n\n\n\t\t/*\n\t | ---------------------------------------------------------------------- \n\t | Include HTML Code before index table \n\t | ---------------------------------------------------------------------- \n\t | html code to display it before index table\n\t | $this->pre_index_html = \"<p>test</p>\";\n\t |\n\t */\n\t\t$this->pre_index_html = null;\n\n\n\n\t\t/*\n\t | ---------------------------------------------------------------------- \n\t | Include HTML Code after index table \n\t | ---------------------------------------------------------------------- \n\t | html code to display it after index table\n\t | $this->post_index_html = \"<p>test</p>\";\n\t |\n\t */\n\t\t$this->post_index_html = null;\n\n\n\n\t\t/*\n\t | ---------------------------------------------------------------------- \n\t | Include Javascript File \n\t | ---------------------------------------------------------------------- \n\t | URL of your javascript each array \n\t | $this->load_js[] = asset(\"myfile.js\");\n\t |\n\t */\n\t\t$this->load_js = array();\n\n\n\n\t\t/*\n\t | ---------------------------------------------------------------------- \n\t | Add css style at body \n\t | ---------------------------------------------------------------------- \n\t | css code in the variable \n\t | $this->style_css = \".style{....}\";\n\t |\n\t */\n\t\t$this->style_css = \"<style> .str{ mso-number-format:\\@; } </style>\";\n\n\n\n\t\t/*\n\t | ---------------------------------------------------------------------- \n\t | Include css File \n\t | ---------------------------------------------------------------------- \n\t | URL of your css each array \n\t | $this->load_css[] = asset(\"myfile.css\");\n\t |\n\t */\n\t\t$this->load_css = array();\n\t}", "public function editarAporte(){ \n if(isset($_POST[\"valueE\"]) && isset($_POST[\"bankE\"]) && isset($_POST[\"accountE\"]))\n {\n \n\t\t\t$valx = \"0\";\n\t\t\tif (isset($_POST[\"transactionE\"]) && (strlen(trim($_POST[\"transactionE\"]))>=3))\n\t\t\t{\n\t\t\t\t$valx = $_POST[\"transactionE\"];\n }\n \n if((isset($_POST[\"idxE\"]))&& (strlen(trim($_POST[\"valueE\"]))>=1)\n && (strlen(trim($_POST[\"bankE\"]))>=3)\n && (strlen(trim($_POST[\"accountE\"]))>=3) \n )\n {\n $aporte=new Aporte($this->adapter);\n $aporte->setAporteID($_POST[\"idxE\"]);\n $aporte->setValue(trim($_POST[\"valueE\"]));\n $aporte->setBank(trim($_POST[\"bankE\"]));\n $aporte->setAccount(trim($_POST[\"accountE\"]));\n $aporte->setTransactionID($valx);\n \n $save=$aporte->update(); // Manda a actualizar la moto en el modelo\n if ($save == TRUE)\n {\n $aporte->phpAlert(\"Aporte actualizado con éxito\",$this->baseUrl(\"BandejaCallcenters\", \"index\")); // Alerta y redirige\n }\n else\n {\n $aporte->phpAlert(\"Error con la actualización. Interente nuevamente\",$this->baseUrl(\"BandejaCallcenters\", \"index\")); // Alerta y redirige\n \n } \n \n }\n else\n {\n $aportex = new Aportante($this->adapter);\n $aportex->phpAlert(\"Complete todos los campos para almacenar.\",$this->baseUrl(\"BandejaCallcenters\", \"index\")); // Alerta y redirige\n }\n } \n else\n {\n $aportex = new Aportante($this->adapter);\n $aportex->phpAlert(\"Complete todos los campos para almacenar.\",$this->baseUrl(\"BandejaCallcenters\", \"index\")); // Alerta y redirige\n } \n //$this->redirect(\"BandejaCallcenters\", \"index\"); // COntrolador + Vista\n }", "function EDIT()\n{\n\t//si los atributos estan comprobado\n\tif ($this->Comprobar_atributos() === true){\n\t$sql = \"SELECT * FROM CENTRO WHERE CODCENTRO= '$this->CODCENTRO'\";\n \n\n $result = $this->mysqli->query($sql);\n //actualizamos los datos\n //si se cumple la condicion\n if ($result->num_rows == 1) {\n\t\t$sql = \"UPDATE CENTRO \n\t\t\t\tSET \n\t\t\t\tCODCENTRO = '$this->CODCENTRO',\n\t\t\t\tCODEDIFICIO = '$this->CODEDIFICIO',\n\t\t\t\tNOMBRECENTRO = '$this->NOMBRECENTRO',\n\t\t\t\tDIRECCIONCENTRO = '$this->DIRECCIONCENTRO',\n\t\t\t\tRESPONSABLECENTRO = '$this->RESPONSABLECENTRO' \n\t\t\t\tWHERE \n\t\t\t\tCODCENTRO= '$this->CODCENTRO'\";\n\t\t//si se ha actualizado guardamos un mensaje de éxito en la variable resultado\n\t\t//si se cumple la condicion\n\t\tif ($this->mysqli->query($sql))\n\t\t{\n\t\t\t$resultado = 'Actualización realizada con éxito'; \n\t\t}\n\t\t//si no\n\t\telse//si no guardamos un mensaje de error en la variable resultado\n\t\t{\n\t\t\t$resultado = 'Error de gestor de base de datos';\n\t\t}\n\t\t\n\t}\n\n\t//si no\n\telse \n\t{\n\t\t$resultado = 'No existe en la base de datos';\n\t}\n\treturn $resultado;//devuelve el mensaje\n\t}//si no\n\telse{\n\t\treturn $this->erroresdatos;//devuelve el mensaje\n\t}\n}", "static public function ctrCrearAtencion(){\r\n\t\t\tif (isset($_POST[\"nuevoCodigo\"])){\r\n\t\t\t\tif (preg_match('/^[a-zA-Z0-9ñÑáéíóúÁÉÍÓÚ ]+$/', $_POST[\"idUser\"])){\r\n\r\n\r\n\t\t\t\t\t$tabla = \"atencion\";\r\n\r\n\t\t\t\t\t\t$datos = array(\"codigo_atencion\" => $_POST[\"nuevoCodigo\"],\r\n\t\t\t\t\t\t\t\t\t \"id_usuario\" => $_POST[\"idUsuario\"],\r\n\t\t\t\t\t\t\t\t\t \"id_personal_salud\" => $_POST[\"nuevaPersonalSalud\"],\r\n\t\t\t\t\t\t\t\t\t \"id_paciente\" => $_POST[\"nuevoPaciente\"],\r\n\t\t\t\t\t\t\t\t\t \"ups\" => $_POST[\"nuevaUps\"],\r\n\t\t\t\t\t\t\t\t\t \"servicio\" => $_POST[\"nuevoServicio\"],\r\n\t\t\t\t\t\t\t\t\t \"especialidad\" => $_POST[\"nuevaEspecialidad\"],\r\n\t\t\t\t\t\t\t\t\t \"diagnostico\" => $_POST[\"nuevoDiagnostico\"],\r\n\t\t\t\t\t\t\t\t\t \"fecha_atencion\" => $_POST[\"nuevaFechaAtencion\"]);\r\n\r\n\t\t\t\t\t\t$respuesta = ModeloAtenciones::mdlIngresarAtenciones($tabla, $datos);\r\n\r\n\t\t\t\t\t\tif ($respuesta == \"ok\") {\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\techo '<script>\r\n\r\n\t\t\t\t\t\t\t\t\tswal({\r\n\t\t\t\t\t\t\t\t\t\ttype: \"success\",\r\n\t\t\t\t\t\t\t\t\t\ttitle: \"¡La Atención ha sido guardado correctamente!\",\r\n\t\t\t\t\t\t\t\t\t\tshowConfirmButton: true,\r\n\t\t\t\t\t\t\t\t\t\tconfirmButtonText: \"Cerrar\",\r\n\t\t\t\t\t\t\t\t\t\tcloseOnConfirm: false\r\n\t\t\t\t\t\t\t\t\t\t}).then((result)=>{\r\n\t\t\t\t\t\t\t\t\t\t\tif(result.value){\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\twindow.location = \"atenciones\";\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t });\r\n\r\n\t\t\t\t\t\t \t\t </script>';\r\n\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t}else{\r\n\r\n\t\t\t\t\techo '<script>\r\n\r\n\t\t\t\t\t\t\tswal({\r\n\t\t\t\t\t\t\t\ttype: \"error\",\r\n\t\t\t\t\t\t\t\ttitle: \"¡La Atención no puede ir vacía o llevar caracteres especiales !\",\r\n\t\t\t\t\t\t\t\tshowConfirmButton: true,\r\n\t\t\t\t\t\t\t\tconfirmButtonText: \"Cerrar\",\r\n\t\t\t\t\t\t\t\tcloseOnConfirm: false\r\n\t\t\t\t\t\t\t\t}).then((result)=>{\r\n\t\t\t\t\t\t\t\t\tif(result.value){\r\n\r\n\t\t\t\t\t\t\t\t\t\twindow.location = \"atenciones\";\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t });\r\n\r\n\t\t\t\t\t\t </script>';\r\n\r\n\t\t\t}\r\n\t\t }\r\n\t\t/*===== FIN registro pacientes ======*/\t\t\t\t\t\r\n\t\t}", "function EDIT()\n{\n\t//si se cumple la condicion\n\tif ($this->Comprobar_atributos() === true){\n\t$sql = \"SELECT * FROM EDIFICIO WHERE CODEDIFICIO= '$this->codedificio'\";\n \n\n $result = $this->mysqli->query($sql);\n \n //si se cumple la condicion\n if ($result->num_rows == 1) { //Si existe el edificio lo editamos\n //actualizamos los datos\n\t$sql = \"UPDATE EDIFICIO\n\t\t\tSET \n\t\t\tCODEDIFICIO = '$this->codedificio',\n\t\t\tNOMBREEDIFICIO = '$this->nombreedificio',\n\t\t\tDIRECCIONEDIFICIO = '$this->direccionedificio',\n\t\t\tCAMPUSEDIFICIO = '$this->campusedificio' \n\t\t\tWHERE \n\t\t\tCODEDIFICIO= '$this->codedificio'\";\n\t//si se ha actualizado guardamos un mensaje de éxito en la variable resultado\n\tif ($this->mysqli->query($sql)) //Si la consulta se ha realizado correctamente, mostramos mensaje \n\t{\n\t\t$resultado = 'Actualización realizada con éxito';\n\t}\n\t//si no\n\telse //Si no, mostramos mensaje de error\n\t{\n\t\t$resultado = 'Error de gestor de base de datos';\n\t}\n\treturn $resultado;//devolvemos el mensaje\n}\n\t}//si no\n\telse{\n\t\treturn $this->erroresdatos;\n\t}\n}", "public function edit(Comida $comida)\n {\n //\n }", "public function editarinternoAction()\n {\n $id = (int)$this->_request->getParam('id', 0); /* El Id del registro que se va a editar */\n $tipo = (int)$this->_request->getParam('tipo', 1); /* si no llega el parámetro sigifica que es Documento Personal (1)*/\n\n /* Traigo el formulario*/\n $form = $this->_form->getFrmEditaInterno($tipo);\n \n if($tipo == 1){ /* si es documento personal */\n $form->setAction($this->view->baseUrlController . '/editarinterno/id/'. $id .'/');\n } else { /* Es documento jefatural */\n $form->setAction($this->view->baseUrlController . '/editarinterno/id/'. $id .'/tipo/0');\n }\n \n\n if ($this->_request->isPost()) { /* Si se ha submiteado el formulario, se procede a guardar los datos */\n \n /* Como recibo el Id del Movimiento, entonces obtengo el id de la tabla Documento para poder editarlo */\n $objMovimiento = new Gidoc_Model_MovimientoMapper();\n $movimiento = $objMovimiento->getById($id);\n $id = $movimiento->documento_id;\n \n /* Recibo los datos del formulario por _POST */\n $formData = $this->_request->getPost();\n\n /* Lleno el formulario con los datos recibidos por _POST */\n $form->populate($formData); \n\n /* Verifico valores que llegan desde el formulario */\n $referencia = $form->referencia->getValue();\n if ($referencia == ''){\n $referencia = null;\n }\n\n $expediente_id = $form->expediente_id->getValue();\n if ($expediente_id == ''){\n $expediente_id = 0;\n }\n \n /* Recibo datos para la tabla destinos */\n $dependencia_iddestino = $form->dependencia_iddestino->getValue();\n \n if($dependencia_iddestino) {\n \n $listNameOptions = $form->getElement('dependencia_iddestino')->getMultiOptions();\n $paraDestino = $listNameOptions[$form->getValue('dependencia_iddestino')]; \n \n } else {\n \n $dependencia_iddestino = null;\n $paraDestino = $form->para_destino->getValue(); \n }\n \n $idDestino = $form->id_destino->getValue(); \n $cargoDestino = $form->cargo_destino->getValue();\n $dependenciaDestino = $form->dependencia_destino->getValue();\n \n /* Fin de Recibo datos... */\n \n if($tipo == 1){ /* si es documento personal */\n \n $data = array('id' => $id,\n 'dependencia_id' => $form->dependencia_id->getValue(), \n 'tipo_documento_id' => $form->tipo_documento_id->getValue(),\n 'expediente_id' => $expediente_id, \n 'numero' => $form->numero->getValue(), \n 'asunto' => $form->asunto->getValue(),\n 'referencia' => $referencia,\n 'cuerpo' => $form->cuerpo->getValue()\n );\n\n } else { /* Si es documento jefatural */\n\n $data = array('id' => $id,\n 'dependencia_id' => $form->dependencia_id->getValue(), /* queda en proceso en la oficina donde está esperando ser firmado */ \n 'tipo_documento_id' => $form->tipo_documento_id->getValue(),\n 'expediente_id' => $expediente_id, \n 'asunto' => $form->asunto->getValue(),\n 'referencia' => $referencia,\n 'cuerpo' => $form->cuerpo->getValue()\n );\n \n }\n \n try {\n /* Actualizo mi objeto */\n $this->_modelo->save($data);\n \n /* Guardo los datos correspondientes para la tabla destinos */\n $modelDestino = new Gidoc_Model_DestinoMapper();\n\n /* Grabo el destino */\n $dataDestino = array('id' => $idDestino,\n 'dependencia_iddestino' => $dependencia_iddestino, \n 'para' => $paraDestino,\n 'cargo' => $cargoDestino,\n 'dependencia' => $dependenciaDestino\n );\n \n $modelDestino->save($dataDestino);\n \n /**/\n\n } catch(Exception $ex) {\n // throw new Exception(\"Error al Editar el registro\". $ex->getMessage()); \n \n /* Para mostrar el error en el Flash Messenger y mantener los datos del formulario */\n $texto = $ex->getMessage();\n \n $texto .= \"\n <div style='width:100%; text-align: center;' >\n <a href='#' onclick=$('#msgFlash').fadeOut('slow') >Cerrar</a>\n </div>\n \";\n \n $this->_helper->FlashMessenger(array('error' => $texto)); \n \n $form->populate($formData);\n $this->view->tipo = $tipo; \n $this->view->form = $form;\n return $this->render();\n /* */\n }\n \n $this->_helper->redirector('poratender', 'documentos', 'gidoc'); \n \n } else { /* Se llama al formulario */\n \n /* Como recibo el Id del Movimiento, entonces obtengo el id de la tabla Documento para poder editarlo */\n $objMovimiento = new Gidoc_Model_MovimientoMapper();\n $movimiento = $objMovimiento->getById($id);\n $id = $movimiento->documento_id;\n \n /* Obtengo el objeto de la tabla Documento */\n $obj = $this->_modelo->getById($id);\n\n /* Paso los campos del objeto a un array */\n $arrayData = $obj->toArray();\n\n /* Obtengo el objeto de la tabla Destinos */\n $modelDestino = new Gidoc_Model_DestinoMapper();\n $objDestino = $modelDestino->getByDocumentoId($id);\n \n /* Paso los campos al arrayData */\n $arrayData['id_destino'] = $objDestino->id;\n $arrayData['dependencia_iddestino'] = \"$objDestino->dependencia_iddestino\"; \n $arrayData['para_destino'] = $objDestino->para;\n $arrayData['cargo_destino'] = $objDestino->cargo;\n $arrayData['dependencia_destino'] = $objDestino->dependencia;\n \n /* Creo variable para poder ocultar el botón guardar, si el que edita no es el dueño del registro */\n $this->view->usua_idregistro = $arrayData['usuario_id'];\n\n /* Variables para poder subir archivos */\n $this->view->id = $id;\n /* Para el Grid archivos */\n /* Configuración del jqgrid */\n $this->view->archivos_colNames = \"'Archivo',''\";\n $this->view->archivos_colModel = \"{name:'descripcion', index:'descripcion', width:50},\n {name:'opcion', index:'opcion', width:10}\";\n $this->view->archivos_sortName = \"descripcion\"; /* Nombre del campo de la tabla por la que debe ser ordenado al cargar los datos. Generalmente es el pk de la tabla */\n \n /* Fin: Variables para poder subir archivos */\n \n /* LLeno los campos del formulario con los datos del array */\n $form->populate($arrayData);\n $this->view->tipo = $tipo;\n $this->view->form = $form;\n $this->view->documento = $obj; \n $this->render('editarinterno');\n }\n }" ]
[ "0.63423556", "0.6075979", "0.6075357", "0.6016722", "0.6013879", "0.59494007", "0.5862443", "0.57042223", "0.57017875", "0.56977326", "0.56298447", "0.55922425", "0.55315554", "0.5508346", "0.54967076", "0.5489526", "0.54884547", "0.5483526", "0.5483503", "0.5466931", "0.54647374", "0.54439414", "0.54267085", "0.54097307", "0.540875", "0.53914225", "0.53914225", "0.53914225", "0.53864104", "0.537043", "0.5369281", "0.5367183", "0.53651553", "0.53610235", "0.534803", "0.534581", "0.53378314", "0.5337549", "0.5337549", "0.5326209", "0.5322556", "0.5322556", "0.5322556", "0.5315323", "0.5313763", "0.5299686", "0.52950877", "0.5290115", "0.52764785", "0.5264361", "0.5259784", "0.5259658", "0.5256012", "0.5239704", "0.52390933", "0.5235705", "0.5235705", "0.5235705", "0.5235705", "0.52343357", "0.52343357", "0.52343357", "0.52343357", "0.52343357", "0.52343357", "0.52343357", "0.52343357", "0.52343357", "0.52343357", "0.52343357", "0.52343357", "0.52251184", "0.5221766", "0.5216598", "0.51940936", "0.5193521", "0.5190101", "0.5190101", "0.5187328", "0.5186114", "0.51818585", "0.51808476", "0.5169207", "0.5166492", "0.5161444", "0.5158513", "0.5156109", "0.51535255", "0.51517797", "0.5140165", "0.51393443", "0.513652", "0.51303047", "0.512016", "0.51143664", "0.511045", "0.51087034", "0.5105731", "0.51008826", "0.5097784" ]
0.6786495
0
Cria o objeto button Excluir que recebe o indice do cadastro que vai exluir
function botaoExcluir($indiceCadastro){ echo " <form method='post'> <button type='submit' class='btn btn-outline-danger btn-sm' name='botaoExcluir' value='$indiceCadastro'><i class='material-icons'>delete</i></button> </form>";//o botão vai receber o valor do indice correspondente a sua linha na tabela de cadastros }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function constructArrayButton()\n { \n //- récupération des boutons par défaut\n $arra_bouton=parent::constructArrayButton();\n \n //- suppression des boutons superflus\n unset($arra_bouton['actionNew']);\n \n //- récupération du modèle\n $obj_model=$this->getModel();\n \n //- s'il n'y a pas d'historique de déplacement \n if(!$obj_model->getHasHisto())\n {\n unset($arra_bouton['actionBack']);\n } \n \n return $arra_bouton;\n }", "public function makeInputButton() {}", "private function createButton() {\n $fv = new filterVars;\n $phpSelf = $fv->phpSelf();\n\t$addButton = \"<A HREF='$phpSelf?action=crf'><button title='Create Row'>Create Row</button></A>\"; \n return $addButton; \n }", "function evt__Agregar()\n\t{\n\t\t$this->tabla()->resetear();\n\t\t$this->set_pantalla('pant_edicion');\n\t}", "public function addsButtons() {}", "function botaoAlterar($indiceCadastro){\n echo \"\n <form method='post'>\n <button type='submit' class='btn btn-outline-warning btn-sm' name='botaoAlterar' value='$indiceCadastro'><i class='material-icons'>create</i></button>\n </form>\";//o botão vai receber o valor do indice correspondente a sua linha na tabela de cadastros\n }", "public function addButton(\\SetaPDF_FormFiller_Field_Button $button) {}", "public function create()\n {\n //KEMUDIAN DI DALAMNYA KITA MENJALANKAN FUNGSI UNTUK MENGOSONGKAN FIELD\n $this->resetFields();\n //DAN MEMBUKA MODAL\n $this->openModal();\n }", "public function renderCreateButton()\n {\n return new Tools\\CreateButton($this);\n }", "public function getButton() {}", "function add_ind_button($buttons) {\n\tarray_push($buttons, 'Indizar');\n\treturn $buttons;\n}", "public function create_edit_aluno()\n\t\t{\n\t\t\t//agora carregar todos os alunos acordo com o curso\n\t\t\t$this->data['alunos'] = $this->Aluno_model->get_aluno_por_curso($this->data['Turma']['curso_id'],$this->data['Turma']['id']);\n\t\t\t$this->view(\"turma/create_edit_aluno\",$this->data);\n\t\t}", "public function no_button() { $this->button = NULL; }", "function incluir_click($sender, $param)\n {\n if ($this->IsValid)\n {\n $this->incluir->Enabled=False;//Se deshabilita boton incluir\n // se capturan los valores de los controles\n $aleatorio = $this->numero->Text;\n $cod_direccion = usuario_actual('cod_direccion');\n $cod_direccion=substr($cod_direccion, 1);\n $siglas = usuario_actual('siglas_direccion');\n $ano = $this->lbl_ano->Text;\n $asunto = str_replace(\"'\", '\\\\\\'', $this->txt_asunto->Text );\n $destinatario = str_replace(\"'\", '\\\\\\'', $this->txt_destinatario->Text );\n $enviadopor=usuario_actual('login');\n $fecha = cambiaf_a_mysql ($this->txt_fecha->Text);\n //$memo=$this->html1->text;\n //busca el nombre del remitente\n $sql3=\"select cedula from intranet.usuarios where(login='$enviadopor')\";\n $resultado3=cargar_data($sql3, $sender);\n $cedula=$resultado3[0]['cedula'];\n $sql3=\"select nombres, apellidos from organizacion.personas where(cedula='$cedula')\";\n $resultado3=cargar_data($sql3, $sender);\n $remitente=$resultado3[0]['nombres'].' '.$resultado3[0]['apellidos'];\n $criterios_adicionales=array('direccion' => $cod_direccion, 'ano' => $ano);\n $numero=proximo_numero(\"organizacion.memoranda\",\"correlativo\",$criterios_adicionales,$this);\n $numero=rellena($numero,4,\"0\");\n // se inserta en la base de datos\n $sql = \"insert into organizacion.memoranda\n (direccion, siglas, correlativo, ano, fecha, asunto, destinatario, status, memo, remitente)\n values ('$cod_direccion','$siglas','$numero','$ano','$fecha','$asunto','$destinatario','1','$memo', '$remitente')\"; \n $resultado=modificar_data($sql,$sender);\n /*$sql2=\"update organizacion.adjuntos set correlativo='$numero' where (correlativo='$aleatorio')\";\n $resultado2=modificar_data($sql2, $sender);*/ \n /* Se incluye el rastro en el archivo de bitácora */\n $descripcion_log = \"Incluido el Memorando: \".$siglas.\"-\".$numero.\"-\".$ano;\n inserta_rastro(usuario_actual('login'),usuario_actual('cedula'),'I',$descripcion_log,\"\",$sender);\n $this->LTB->titulo->Text = \"Solicitud de número de Memorando\";\n $this->LTB->texto->Text = \"Se ha registrado exitosamente el nuevo Memorando con el \".\n \"número: <strong>\".$siglas.\"-\".$numero.\"-\".$ano.\"</strong>\";\n $this->LTB->imagen->Imageurl = \"imagenes/botones/memoranda.png\";\n $this->LTB->redir->Text = \"epaper.incluir_memo\";\n $params = array('mensaje');\n $this->getPage()->getCallbackClient()->callClientFunction('muestra_mensaje', $params);\n\n //$this->mensaje2->setSuccessMessage($sender, \"Se ha registrado exitosamente el nuevo Memorando con el numero:\".$siglas.\"-\".$numero.\"-\".$ano, 'grow');\n\n }\n }", "public function cerraModal(){\n\n $this->folio='';\n\n $this->nombre= ''; \n\n $this->apellido_p= '';\n\n $this->apellido_m= '';\n\n $this->puesto= ''; \n }", "protected function _setAddButton()\n {\n $this->setChild('add_button',\n $this->getLayout()->createBlock('adminhtml/widget_button')\n ->setData(array('id' => \"add_tax_\" . $this->getElement()->getHtmlId(),\n 'label' => Mage::helper('catalog')->__('Add Tax'),\n 'onclick' => \"weeeTaxControl.addItem('\" . $this->getElement()->getHtmlId() . \"')\",\n 'class' => 'add'\n )));\n }", "public function addButton($button)\n {\n// if(!$button instanceof Button || !is_string($button))\n// throw new TableException('please enter parameter instance of Button Or string name');\n\n if(is_string($button))\n {\n $btnName = $button;\n if($this->hasButton($btnName))\n throw new TableException(\"Already table $btnName is exist\");\n\n $button = new Button($btnName);\n }\n\n $button->setTable($this->getTable());\n $button->setParent($this);\n $button->init();\n\n $this->buttons[$button->getName()] = $button;\n\n return $button;\n }", "public function defineHeaderButton(){\r\n $this->addnewctrl='';\r\n $this->searchctrl='';\r\n }", "public function _createCommands($btn,$rowPos)\n\t{\n\t\t$this->_setTemplateDefButtons(_html\\HtmlButton::_ACTION_ADD);\n\t\t$this->_setTemplateDefButtons(_html\\HtmlButton::_ACTION_UPDATE);\n\t\t$this->_setTemplateDefButtons(_html\\HtmlButton::_ACTION_DELETE);\n\t\t$this->_setTemplateDefButtons(_html\\HtmlButton::_ACTION_DELETE_MULTI_2);\n\t\t$this->_setTemplateDefButtons(_html\\HtmlButton::_ACTION_CLOSE);\n\t}", "private function loadButtons()\n {\n $objAdd = $this->addButtonNew(_FEST);\n $objAdd->setInline();\n }", "function evt__agregar()\n\t{\n\t\t$this->set_pantalla('pant_edicion');\n\t}", "protected function registerButtons() {}", "protected function registerButtons() {}", "private function creaEvento() {\n $fevento = USingleton::getInstance('FEvento');\n $dati = $this->dati;\n $classe = $this->classe;\n \n //----------------sezione di controllo delle operazioni-----------------\n \n if ($this->operazione == 'inserimento') {\n if ($this->tabella == 'evento') {\n $id = 1 + $fevento->loadultimoevento()[0];\n }\n if ($this->tabella == 'evento_spec') {\n $id = $dati['code'];\n }\n if ($this->tabella == 'partecipazione') {\n $feventosp = USingleton::getInstance('FEventoSPecifico');\n $tipo = $feventosp->loadTipo($dati['code'])['tipo'];\n $classe = \"E\" . $tipo;\n $id = $dati['code'];\n }\n if ($this->tabella == 'biglietti') {\n $feventosp = USingleton::getInstance('FEventoSPecifico');\n $tipo = $feventosp->loadTipo($dati['code'])['tipo'];\n $classe = \"E\" . $tipo;\n $id = $dati['code'];\n }\n }\n if ($this->operazione == 'cancellazione') {\n if ($this->tabella == 'evento') {\n $feventosp = USingleton::getInstance('FEventoSPecifico');\n $tipo = $feventosp->loadTipo($dati['code'])['tipo'];\n $classe = \"E\" . $tipo;\n $id = $dati['code'];\n }\n if ($this->tabella == 'evento_spec') {\n $feventosp = USingleton::getInstance('FEventoSPecifico');\n $tipo = $feventosp->loadTipo($dati['code'])['tipo'];\n $classe = \"E\" . $tipo;\n $id = $dati['code'];\n }\n if ($this->tabella == 'partecipazione') {\n $feventosp = USingleton::getInstance('FEventoSPecifico');\n $tipo = $feventosp->loadTipo($dati['code'])['tipo'];\n $classe = \"E\" . $tipo;\n $id = $dati['code'];\n }\n }\n//---------------------------------------------------------------------------------------------------------\n\n $zona = [new EZona($dati['zona'], $dati['capacita'])];\n $luogo = new ELuogo($dati['citta'], $dati['struttura'], $zona);\n $partecipazioni = [new EPartecipazione($zona[0], $dati['prezzo'])];\n\n if ($classe == 'EPartita') {\n $eventoSpecifico = [new EPartita($luogo, $dati['data'], $partecipazioni, $dati['casa'], $dati['ospite'])];\n }\n if ($classe == 'ESpettacolo') {\n $eventoSpecifico = [new ESpettacolo($luogo, $dati['data'], $partecipazioni, $dati['compagnia'])];\n }\n if ($classe == 'EConcerto') {\n $eventoSpecifico = [new EConcerto($luogo, $dati['data'], $partecipazioni, $dati['artista'])];\n }\n\n $evento = new EEvento($id, $dati['immagine'], $dati['nome_evento'], $eventoSpecifico);\n\n return $evento;\n }", "protected function generateButtons() {}", "public function incluir ()\n {\n try {\n // Define a ação de incluir\n $acao = Orcamento_Business_Dados::ACTION_INCLUIR;\n \n // Cria o formulário vazio\n $formulario = $this->retornaFormulario ( $acao );\n \n // Faz transformações no formulário, se necessário\n $formulario = $this->transformaFormulario ( $formulario, $acao );\n \n // Exibe o formulário\n $this->view->formulario = $formulario;\n \n // Grava o novo registro\n $this->gravaDados ( $acao, $formulario );\n } catch ( Exception $e ) {\n // Gera o erro\n throw new Zend_Exception ( $e->getMessage () );\n }\n }", "function drawButtonsDefault() {\r\n global $objectClass, $planningType, $showListFilter;\r\n ?>\r\n <table style=\"width:10px\">\r\n <tr>\r\n <?php \r\n if ($planningType=='planning' or $planningType=='resource' or $planningType=='global' or $planningType=='version') {?>\r\n <td colspan=\"1\" width=\"51px\" style=\"<?php if (isNewGui()) echo 'padding-right: 5px;';?>\">\r\n <?php // ================================================================= NEW ?>\r\n <?php if ($planningType=='version') {?><div id =\"addNewActivity\" style=\"visibility:<?php echo ($showListFilter=='true')?'visible':'hidden';?>;\"><?php } ?>\r\n <div dojoType=\"dijit.form.DropDownButton\"\r\n class=\"comboButton\" \r\n id=\"planningNewItem\" jsId=\"planningNewItem\" name=\"planningNewItem\" \r\n showlabel=\"false\" class=\"\" iconClass=\"dijitButtonIcon dijitButtonIconNew\"\r\n title=\"<?php echo i18n('comboNewButton');?>\">\r\n <span>title</span>\r\n <div dojoType=\"dijit.TooltipDialog\" class=\"white\" style=\"width:200px;\"> \r\n <div style=\"font-weight:bold; height:25px;text-align:center\"><?php echo i18n('comboNewButton');?> </div>\r\n <?php \r\n $arrayItems=array('Project','Activity','Milestone','Meeting','PeriodicMeeting','TestSession');\r\n if ($planningType=='resource' or $planningType=='version') $arrayItems=array('Activity');\r\n if ($planningType=='global') $arrayItems=array_merge($arrayItems,array('Ticket','Action','Decision','Delivery','Risk','Issue','Opportunity','Question'));\r\n foreach($arrayItems as $item) {\r\n $canCreate=securityGetAccessRightYesNo('menu' . $item,'create');\r\n if ($canCreate=='YES') {\r\n if (! securityCheckDisplayMenu(null,$item) ) {\r\n $canCreate='NO';\r\n }\r\n }\r\n if ($canCreate=='YES') {?>\r\n <div style=\"vertical-align:top;cursor:pointer;\" class=\"newGuiIconText\"\r\n onClick=\"addNewItem('<?php echo $item;?>');\" >\r\n <table width:\"100%\"><tr style=\"height:22px\" >\r\n <td style=\"vertical-align:top; width: 30px;padding-left:5px\"><?php echo formatIcon($item, 22, null, false);;?></td> \r\n <td style=\"vertical-align:top;padding-top:2px\"><?php echo i18n($item)?></td>\r\n </tr></table> \r\n </div>\r\n <div style=\"height:5px;\"></div>\r\n <?php \r\n } \r\n }?>\r\n </div>\r\n </div>\r\n <?php if ($planningType=='version') {?></div><?php } ?> \r\n </td> \r\n <?php\r\n } \r\n if ($planningType=='global') {?>\r\n <td colspan=\"1\" width=\"51px\" style=\"<?php if (isNewGui()) echo 'padding-right: 5px;';?>\">\r\n <?php drawGlobalItemsSelector();?>\r\n </td> \r\n <?php \r\n } \r\n $activeFilter=false;\r\n if (is_array(getSessionUser()->_arrayFilters)) {\r\n if (array_key_exists('Planning', getSessionUser()->_arrayFilters)) {\r\n if (count(getSessionUser()->_arrayFilters['Planning'])>0) {\r\n \t foreach (getSessionUser()->_arrayFilters['Planning'] as $filter) {\r\n \t\t if (!isset($filter['isDynamic']) or $filter['isDynamic']==\"0\") {\r\n \t\t\t $activeFilter=true;\r\n \t\t }\r\n \t }\r\n }\r\n }\r\n }\r\n ?>\r\n <?php \r\n if ($planningType=='planning' or $planningType=='resource' or $planningType=='version') {?>\r\n <td colspan=\"1\" width=\"55px\" style=\"padding-left:1px\";>\r\n <?php // ================================================================= FILTER ?>\r\n <?php if ($planningType=='version') {?><div id=\"listFilterAdvanced\" style=\"visibility:<?php echo ($showListFilter=='true')?'visible':'hidden';?>;\"><?php }?>\r\n <button title=\"<?php echo i18n('advancedFilter')?>\" \r\n class=\"comboButton\"\r\n dojoType=\"dijit.form.DropDownButton\" \r\n id=\"listFilterFilter\" name=\"listFilterFilter\"\r\n iconClass=\"dijitButtonIcon icon<?php echo($activeFilter)?'Active':'';?>Filter\" showLabel=\"false\">\r\n <?php \r\n if(!isNewGui()){?>\r\n <script type=\"dojo/connect\" event=\"onClick\" args=\"evt\">\r\n showFilterDialog();\r\n </script>\r\n <script type=\"dojo/method\" event=\"onMouseEnter\" args=\"evt\">\r\n clearTimeout(closeFilterListTimeout);\r\n clearTimeout(openFilterListTimeout);\r\n openFilterListTimeout=setTimeout(\"dijit.byId('listFilterFilter').openDropDown();\",popupOpenDelay);\r\n </script>\r\n <script type=\"dojo/method\" event=\"onMouseLeave\" args=\"evt\">\r\n clearTimeout(openFilterListTimeout);\r\n closeFilterListTimeout=setTimeout(\"dijit.byId('listFilterFilter').closeDropDown();\",2000);\r\n </script>\r\n <?php \r\n }?>\r\n <div dojoType=\"dijit.TooltipDialog\" id=\"directFilterList\" style=\"z-index: 999999;<!-- display:none; --> position: absolute;\">\r\n <?php \r\n $objectClass='Planning';\r\n $dontDisplay=true;\r\n if(isNewGui())include \"../tool/displayQuickFilterList.php\";\r\n include \"../tool/displayFilterList.php\";\r\n if(!isNewGui()){?>\r\n <script type=\"dojo/method\" event=\"onMouseEnter\" args=\"evt\">\r\n clearTimeout(closeFilterListTimeout);\r\n clearTimeout(openFilterListTimeout);\r\n </script>\r\n <script type=\"dojo/method\" event=\"onMouseLeave\" args=\"evt\">\r\n dijit.byId('listFilterFilter').closeDropDown();\r\n </script>\r\n <?php \r\n }?>\r\n </div> \r\n </button>\r\n <?php if ($planningType=='version') {?></div><?php }?>\r\n </td>\r\n <?php \r\n }?> \r\n <td colspan=\"1\">\r\n <?php // ================================================================= COLUMNS SELECTOR ?> \r\n <div dojoType=\"dijit.form.DropDownButton\"\r\n id=\"planningColumnSelector\" jsId=\"planningColumnSelector\" name=\"planningColumnSelector\" \r\n showlabel=\"false\" class=\"comboButton\" iconClass=\"dijitButtonIcon dijitButtonIconColumn\" \r\n title=\"<?php echo i18n('columnSelector');?>\">\r\n <span>title</span>\r\n <?php \r\n $screenHeight=getSessionValue('screenHeight','1080');\r\n $columnSelectHeight=intval($screenHeight*0.6);?>\r\n <div dojoType=\"dijit.TooltipDialog\" id=\"planningColumnSelectorDialog\" class=\"white\" style=\"width:300px;\"> \r\n <script type=\"dojo/connect\" event=\"onHide\" data-dojo-args=\"evt\">\r\n if (dndMoveInProgress) { setTimeout('dijit.byId(\"planningColumnSelector\").openDropDown();',1); }\r\n </script>\r\n <div id=\"dndPlanningColumnSelector\" jsId=\"dndPlanningColumnSelector\" dojotype=\"dojo.dnd.Source\" \r\n dndType=\"column\" style=\"overflow-y:auto; max-height:<?php echo $columnSelectHeight;?>px; position:relative\"\r\n withhandles=\"true\" class=\"container\"> \r\n <?php \r\n if ($planningType=='portfolio') $portfolioPlanning=true;\r\n if ($planningType=='contract') $contractGantt=true;\r\n if ($planningType=='version') $versionPlanning=true;\r\n include('../tool/planningColumnSelector.php');?>\r\n </div>\r\n <div style=\"height:5px;\"></div> \r\n <div style=\"text-align: center;\"> \r\n <button title=\"\" dojoType=\"dijit.form.Button\" \r\n id=\"\" name=\"\" showLabel=\"true\"><?php echo i18n('buttonOK');?>\r\n <script type=\"dojo/connect\" event=\"onClick\" args=\"evt\">\r\n validatePlanningColumn();\r\n </script>\r\n </button>\r\n </div> \r\n </div>\r\n </div>\r\n </td>\r\n </tr>\r\n </table>\r\n<?php \r\n}", "public function makeHelpButton() {}", "public function makeSplitButton() {}", "public function exportButton ()\n\t{\n\t}", "public function indexCreateButton(Request $request)\n {\n return view('merch.unibutton');\n }", "public function create()\n {\n $this->openModal();\n $this->resetInputFields();\n }", "public function create()\n {\n $this->openModal();\n $this->resetInputFields();\n }", "public function makeFullyRenderedButton() {}", "function bindActionButtonObject()\r\n\t{\r\n JTable::addIncludePath( JPATH_ADMINISTRATOR . '/components/com_calendar/tables' );\r\n\t\t$table = JTable::getInstance( 'ActionButtons', 'CalendarTable' );\r\n\t\t\r\n\t if (!empty($this->actionbutton_id))\r\n\t {\r\n\t $table->load( $this->actionbutton_id );\r\n\t }\r\n\t \r\n\t\t$table->trimProperties();\r\n\t\t\r\n\t\t$properties = $this->getProperties();\r\n\t\t$table_properties = $table->getProperties();\r\n\r\n\t\tforeach ($table_properties as $prop=>$value)\r\n\t\t{\r\n\t\t $key_name = $prop;\r\n\t\t if (!array_key_exists($key_name, $properties))\r\n\t\t {\r\n\t\t $this->$key_name = $table->$prop;\r\n\t\t }\r\n\t\t}\r\n\t}", "public function getDefaultButton() {}", "static function createButton($input, $name) {\n include $_SERVER[\"DOCUMENT_ROOT\"] . \"/mvdv/core/view/templates/general/form/formelements/button.php\";\n }", "function bt_alterar_naoClick($sender, $params)\r\n {\r\n\r\n $this->hd_alterar_produto_numero->Value = '';\r\n $this->hd_alterar_produto_codigo->Value = '';\r\n $this->hd_alterar_produto_referencia->Value = '';\r\n $this->hd_alterar_produto_descricao->Value = '';\r\n $this->hd_alterar_produto_qtde->Value = '';\r\n $this->hd_alterar_produto_preco->Value = '';\r\n $this->hd_alterar_produto_valor_total->Value = '';\r\n $this->hd_alterar_produto_lote->Value = '';\r\n $this->hd_alterar_produto_unidade->Value = '';\r\n $this->hd_alterar_produto_ipi->Value = '';\r\n $this->hd_alterar_produto_valor_ipi->Value = '';\r\n\r\n $this->alterar_produto->Top = 1188;\r\n $this->alterar_produto->Visible = false;\r\n }", "static public function ctrCrearAtencion(){\r\n\t\t\tif (isset($_POST[\"nuevoCodigo\"])){\r\n\t\t\t\tif (preg_match('/^[a-zA-Z0-9ñÑáéíóúÁÉÍÓÚ ]+$/', $_POST[\"idUser\"])){\r\n\r\n\r\n\t\t\t\t\t$tabla = \"atencion\";\r\n\r\n\t\t\t\t\t\t$datos = array(\"codigo_atencion\" => $_POST[\"nuevoCodigo\"],\r\n\t\t\t\t\t\t\t\t\t \"id_usuario\" => $_POST[\"idUsuario\"],\r\n\t\t\t\t\t\t\t\t\t \"id_personal_salud\" => $_POST[\"nuevaPersonalSalud\"],\r\n\t\t\t\t\t\t\t\t\t \"id_paciente\" => $_POST[\"nuevoPaciente\"],\r\n\t\t\t\t\t\t\t\t\t \"ups\" => $_POST[\"nuevaUps\"],\r\n\t\t\t\t\t\t\t\t\t \"servicio\" => $_POST[\"nuevoServicio\"],\r\n\t\t\t\t\t\t\t\t\t \"especialidad\" => $_POST[\"nuevaEspecialidad\"],\r\n\t\t\t\t\t\t\t\t\t \"diagnostico\" => $_POST[\"nuevoDiagnostico\"],\r\n\t\t\t\t\t\t\t\t\t \"fecha_atencion\" => $_POST[\"nuevaFechaAtencion\"]);\r\n\r\n\t\t\t\t\t\t$respuesta = ModeloAtenciones::mdlIngresarAtenciones($tabla, $datos);\r\n\r\n\t\t\t\t\t\tif ($respuesta == \"ok\") {\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\techo '<script>\r\n\r\n\t\t\t\t\t\t\t\t\tswal({\r\n\t\t\t\t\t\t\t\t\t\ttype: \"success\",\r\n\t\t\t\t\t\t\t\t\t\ttitle: \"¡La Atención ha sido guardado correctamente!\",\r\n\t\t\t\t\t\t\t\t\t\tshowConfirmButton: true,\r\n\t\t\t\t\t\t\t\t\t\tconfirmButtonText: \"Cerrar\",\r\n\t\t\t\t\t\t\t\t\t\tcloseOnConfirm: false\r\n\t\t\t\t\t\t\t\t\t\t}).then((result)=>{\r\n\t\t\t\t\t\t\t\t\t\t\tif(result.value){\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\twindow.location = \"atenciones\";\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t });\r\n\r\n\t\t\t\t\t\t \t\t </script>';\r\n\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t}else{\r\n\r\n\t\t\t\t\techo '<script>\r\n\r\n\t\t\t\t\t\t\tswal({\r\n\t\t\t\t\t\t\t\ttype: \"error\",\r\n\t\t\t\t\t\t\t\ttitle: \"¡La Atención no puede ir vacía o llevar caracteres especiales !\",\r\n\t\t\t\t\t\t\t\tshowConfirmButton: true,\r\n\t\t\t\t\t\t\t\tconfirmButtonText: \"Cerrar\",\r\n\t\t\t\t\t\t\t\tcloseOnConfirm: false\r\n\t\t\t\t\t\t\t\t}).then((result)=>{\r\n\t\t\t\t\t\t\t\t\tif(result.value){\r\n\r\n\t\t\t\t\t\t\t\t\t\twindow.location = \"atenciones\";\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t });\r\n\r\n\t\t\t\t\t\t </script>';\r\n\r\n\t\t\t}\r\n\t\t }\r\n\t\t/*===== FIN registro pacientes ======*/\t\t\t\t\t\r\n\t\t}", "function insertarObligacionCompleta()\n {\n $this->objFunc = $this->create('MODObligacionPago');\n if ($this->objParam->insertar('id_obligacion_pago')) {\n $this->res = $this->objFunc->insertarObligacionCompleta($this->objParam);\n } else {\n //TODO .. trabajar en la edicion\n }\n $this->res->imprimirRespuesta($this->res->generarJson());\n }", "public function create()\n {\n $this->resetInputFields();\n $this->openModal();\n }", "public function create()\n {\n $this->resetInputFields();\n $this->openModal();\n }", "public function create()\n {\n $this->resetInputFields();\n $this->openModal();\n }", "public function create()\n {\n $this->resetInputFields();\n $this->openModal();\n }", "public function crear() {\n /**\n * guardamos la consulta en $sql\n * ejecutamos la consulta en php \n * asignamos el id del objeto = al ultimo id que añadimos a la bd, asi coincidiran el id objeto con tupla\n * lista de atributos a introducir valores de atributos a introducir\n * formato insertar datos INSERT INTO NombreTabla (NombreAtributo1, NombreAtributo2) VALUES (ValorAtributo1, ValorAtributo2)\n */\n // para acceder a una cosntante de la clase NombreClase::NOMBRECONSTANTE\n \n try {\n $sql=\"INSERT INTO \".Bebidas::TABLA[0].\" (nombre, descripcion, tipo, estado, foto) VALUES ('$this->nombre', '$this->descripcion', '$this->tipo', '$this->estado', '$this->foto')\";\n $this->conexion->query($sql);\n $this->__set(\"id_bebida\", $this->conexion->insert_id);\n } catch (Exception $ex) {\n echo 'error '.$ex;\n }\n \n }", "function newButton($view) {\n\t\t$str = '<a class=\"button is-primary\" href=\"?do=edit&amp;view='.$view.'\">New</a>';\n\t\treturn $str;\n\t}", "private function createImportButton() {\n\t\t$moduleUrl = t3lib_BEfunc::getModuleUrl(self::MODULE_NAME, array('id' => $this->id));\n\t\t$this->template->setMarker('module_url', htmlspecialchars($moduleUrl));\n\t\t$this->template->setMarker(\n\t\t\t'label_start_import',\n\t\t\t$GLOBALS['LANG']->getLL('start_import_button')\n\t\t);\n\t\t$this->template->setMarker('tab_number', self::IMPORT_TAB);\n\t\t$this->template->setMarker(\n\t\t\t'label_import_in_progress',\n\t\t\t$GLOBALS['LANG']->getLL('label_import_in_progress')\n\t\t);\n\n\t\treturn $this->template->getSubpart('IMPORT_BUTTON');\n\t}", "function ADD()\n{\n\t$ctrl=$this->comprobar_atributos();\n\tif(!is_array($ctrl)){\n\t\t$sql = \"select * from ESPACIO where CODESPACIO = '\".$this->CODESPACIO.\"'\";\n\n\t\tif (!$result = $this->mysqli->query($sql)) //Error en la construcción de la sentencia SQL\n\t\t{\n\t\t\treturn 'Error de gestor de base de datos';\n\t\t}\n\n\t\tif ($result->num_rows == 1){ // existe el usuario\n\t\t\t\treturn 'Inserción fallida: el elemento ya existe';\n\t\t\t}\n\n\t\tif(!$this->verificar_existencia_edificio()){ // Compruebo si existe el Edificio donde se va a insertar el espacio\n\n\t\t\treturn \"Inserción fallida: no existe ese código de edificio\";\n\t\t}\n\n\t\tif(!$this->verificar_existencia_centro()){ // Compruebo si existe el centro donde se va a insertar el espacio\n\n\t\t\treturn \"Inserción fallida: no existe ese código de centro\";\n\t\t}\n\n\t\t$sql = \"INSERT INTO ESPACIO (\n\t\t\tCODESPACIO,\n\t\t\tCODEDIFICIO,\n\t\t\tCODCENTRO,\n\t\t\tTIPO,\n\t\t\tSUPERFICIEESPACIO,\n\t\t\tNUMINVENTARIOESPACIO) \n\t\t\t\tVALUES (\n\t\t\t\t\t'\".$this->CODESPACIO.\"',\n\t\t\t\t\t'\".$this->CODEDIFICIO.\"',\n\t\t\t\t\t'\".$this->CODCENTRO.\"',\n\t\t\t\t\t'\".$this->TIPO.\"',\n\t\t\t\t\t'\".$this->SUPERFICIEESPACIO.\"',\n\t\t\t\t\t'\".$this->NUMINVENTARIOESPACIO.\"'\n\t\t\t\t\t)\";\n\n\t\tif (!$this->mysqli->query($sql)) {\n\t\t\treturn 'Error de gestor de base de datos'; //Error en la construcción de la sentencia SQL\n\t\t}\n\t\telse{\n\t\t\treturn 'Inserción realizada con éxito'; //operacion de insertado correcta\n\t\t}\n\t\t}else{\n\t\t\treturn $ctrl;\n\t\t}\t\n}", "protected function actionNew() {\r\n $strType = $this->getCurObjectClassName();\r\n\r\n if(!is_null($strType)) {\r\n /** @var $objEdit interface_model|class_model */\r\n $objEdit = new $strType();\r\n\r\n\r\n $objForm = $this->getAdminForm($objEdit);\r\n $objForm->getObjSourceobject()->setSystemid($this->getParam(\"systemid\"));\r\n $objForm->addField(new class_formentry_hidden(\"\", \"mode\"))->setStrValue(\"new\");\r\n\r\n return $objForm->renderForm(getLinkAdminHref($this->getArrModule(\"modul\"), \"save\" . $this->getStrCurObjectTypeName()));\r\n }\r\n else\r\n throw new class_exception(\"error creating new entry current object type not known \", class_exception::$level_ERROR);\r\n }", "function edit_insert_button($caption, $js_onclick, $title = '')\t{\n\t?>\n\tif (toolbar) {\n\t\tvar theButton = document.createElement('input');\n\t\ttheButton.type = 'button';\n\t\ttheButton.value = '<?php echo $caption; ?>';\n\t\ttheButton.onclick = <?php echo $js_onclick; ?>;\n\t\ttheButton.className = 'ed_button';\n\t\ttheButton.title = \"<?php echo $title; ?>\";\n\t\ttheButton.id = \"<?php echo \"ed_{$caption}\"; ?>\";\n\t\ttoolbar.appendChild(theButton);\n\t}\n\t\n<?php }", "public function decorate()\n {\n\n $this->element->addItemButton\n ->addClass('btn-sm push-top')\n ->appendContent(' <i class=\"btr bt-plus btn-no-anim\"></i>')\n ;\n\n $this->element->removeItemButton->content->clear();\n $this->element->removeItemButton->content('<i class=\"btr bt-trash\" style=\"margin:0\"></i>');\n\n }", "public static function createEdTablebutton($table='no_table_provided',$id=0){\n\t\tif(empty($id)) return \"<span>xEdx</span>\";\n\t\treturn \"<button type='button' class='btn_edit' onclick='btnEditTableItem(\\\"{$table}\\\",{$id});'>edit</button>\";\n\t}", "static public function ctrCrearOsde(){\n\n\t\t\n\n\t\tif(isset($_POST[\"nuevoOsde\"])){\n\n\t\t\tif ($_POST[\"nuevoImporte\"]<>null){\n\n\t\t\t\tif(preg_match('/^[a-zA-Z0-9ñÑáéíóúÁÉÍÓÚ ]+$/', $_POST[\"nuevoOsde\"])){\n\n\t\t\t\t\t$tabla = \"osde\";\n\n\t\t\t\t\t$datos = array(\"nombre\" => $_POST[\"nuevoOsde\"],\n\t\t\t\t\t\t\t\t \"importe\" => $_POST[\"nuevoImporte\"]);\n\n\t\t\t\t\t echo '<pre>'; print_r($datos); echo '</pre>';\n\n\t\t\t\t\t$respuesta = ModeloOsde::mdlIngresarOsde($tabla, $datos);\n\n\t\t\t\t\tif($respuesta == \"ok\"){\n\n\t\t\t\t\t\techo'<script>\n\n\t\t\t\t\t\tswal({\n\t\t\t\t\t\t\t type: \"success\",\n\t\t\t\t\t\t\t title: \"El Nuevo Osde ha sido guardado correctamente\",\n\t\t\t\t\t\t\t showConfirmButton: true,\n\t\t\t\t\t\t\t confirmButtonText: \"Cerrar\"\n\t\t\t\t\t\t\t }).then(function(result){\n\t\t\t\t\t\t\t\t\t\tif (result.value) {\n\n\t\t\t\t\t\t\t\t\t\twindow.location = \"osde\";\n\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t})\n\n\t\t\t\t\t\t</script>';\n\n\t\t\t\t\t}\n\n\n\t\t\t\t}else{\n\n\t\t\t\t\techo'<script>\n\n\t\t\t\t\t\tswal({\n\t\t\t\t\t\t\t type: \"error\",\n\t\t\t\t\t\t\t title: \"¡La categoría no puede ir vacía o llevar caracteres especiales!\",\n\t\t\t\t\t\t\t showConfirmButton: true,\n\t\t\t\t\t\t\t confirmButtonText: \"Cerrar\"\n\t\t\t\t\t\t\t }).then(function(result){\n\t\t\t\t\t\t\t\tif (result.value) {\n\n\t\t\t\t\t\t\t\twindow.location = \"osde\";\n\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t})\n\n\t\t\t\t \t</script>';\n\n\t\t\t\t}\n\t\t\t}\t\t\n\n\t\t}\n\n\t}", "public function addElementClicked(SubmitButton $button)\n\t{\n\t\t$button->parent->createOne();\n\t}", "function shortcode_insert_button()\n {\n $this->config['self_closing'] = 'yes';\n\n $this->config['name'] = __('Download Button', 'avia_framework');\n $this->config['tab'] = __('Content Elements', 'avia_framework');\n $this->config['icon'] = AviaBuilder::$path['imagesURL'] . \"sc-button.png\";\n $this->config['order'] = 1;\n $this->config['target'] = 'avia-target-insert';\n $this->config['shortcode'] = 'avia_download_button';\n $this->config['tooltip'] = __('Creates a download button', 'avia_framework');\n $this->config['tinyMCE'] = ['tiny_always' => true];\n $this->config['preview'] = true;\n }", "public function action_create()\n {\n $this->action_edit(FALSE);\n }", "function form_init_elements() \r\n {\r\n //we want an confirmation page for this form.\r\n //$this->set_confirm();\r\n\r\n //Crea una caja de texto llamada nombre y longitud 50\r\n $elemT = new FEText(\"Asunto\", FALSE, 50);\r\n //$elemT->set_style_attribute('align', 'right');\r\n //Le asignamos el id nombre y la tecla de acceso n (ctrl+n)\r\n $elemT->set_attribute(\"id\",\"asunto\");\r\n $elemT->set_attribute(\"accesskey\",\"n\"); \r\n //Añade en el contenedor formulario el elemento creado e inicializado\r\n $this->add_element($elemT);\r\n\t\r\n //Creamos un Area de Texto llamada comentario\r\n $elemTA = new FETextArea(\"Comentario\", FALSE, 10, 60,\"500px\", \"100px\");\r\n $elemTA->set_attribute('wrap', 'physical');\r\n //Le asignamos el id email y la tecla de acceso c (ctrl+c) \r\n $elemTA->set_attribute(\"id\",\"comentario\");\r\n $elemTA->set_attribute(\"accesskey\",\"d\");\r\n //Añade en el contenedor formulario el elemento creado e inicializado\r\n $this->add_element($elemTA);\r\n\r\n //Añade un campo oculto llamado id. En ocasiones este campo se utiliza para indicar ciertas operaciones.\r\n //OJO!! es un punto sensible porque el usuario podría cambiar su valor de forma inexperada para el código.\r\n// $this->add_hidden_element(\"id\");\r\n\r\n //Añade un boton con la acción submit\r\n $submit = $this->_formatElem(\"base_SubmitButton\", \"Aceptar\", \"submit\", agt(\"miguel_Enter\"));\r\n //$submit->set_attribute('id',''); \r\n $submit->set_attribute('accesskey','e'); \r\n $this->add_element($submit); \r\n\t\t\t\t\r\n\t\t\t\t$this->add_hidden_element('status');\r\n \t\t$this->set_hidden_element_value('status', 'new');\r\n }", "public function mostrar_insertar() {\r\n\t\t\t$this -> pantalla_edicion('insertar'); \r\n\t\t }", "public function admin_creacion_cliente(){\n\n\t\t$this->layout = 'dialog';\n\n\t\t$data = $this->request->data;\n\n\t\t$id_dialog = 'main-dialog';\n\n\t\tif ( isset( $data['id_dialog'] ) ){\n\n\t\t\t$id_dialog = $data['id_dialog'];\n\t\t}\n\n\t\t$title = '';\n\n\t\tif ( isset( $data['title'] ) ){\n\n\t\t\t$title = $data['title'];\n\t\t}\n\n\t\t$classes = '';\n\n\t\tif ( isset( $data['classes'] ) ){\n\n\t\t\t$classes = $data['classes'];\n\t\t}\n\n\t\t$this->set('id_dialog', $id_dialog);\n\n\t\t$this->set('title', $title);\t\n\t\t\n\t\t$this->set('classes', $classes);\n\n\t\t// Combos\n\n\t\t$this->loadModel('Region');\n\n\t\t$regiones = $this->Region->find('all');\n\n\t\tarray_walk($regiones, function(&$item){\n\n\t\t\t$item = $item['Region'];\n\t\t});\n\n\t\t$this->set('regiones', $regiones);\t\n\n\t\t$this->loadModel('Comuna');\n\n\t\t$comunas = $this->Comuna->find('all', array(\n\n\t\t\t\t'fields' \t=> array(\n\n\t\t\t\t\t'id',\n\t\t\t\t\t'ciudades_id',\n\t\t\t\t\t'nombre',\n\t\t\t\t)\n\t\t\t)\n\t\t);\n\t\t\n\t\tarray_walk($comunas, function(&$item){\n\n\t\t\t$item = $item['Comuna'];\n\t\t});\n\n\t\t$this->set('comunas', $comunas);\n\t}", "public function __construct()\n {\n parent::__construct();\n\n // creates the form\n $this->form = new BootstrapFormBuilder(self::$formName);\n\n // define the form title\n $this->form->setFormTitle('Avaliações');\n\n $inscricao_evento_id = new TDBUniqueSearch('inscricao_evento_id', 'eventtus', 'Evento', 'id', 'id','nome asc' );\n\n $inscricao_evento_id->setSize('100%');\n $inscricao_evento_id->setMinLength(0);\n $inscricao_evento_id->setMask('{nome}');\n\n $row1 = $this->form->addFields([new TLabel('Evento', null, '14px', null),$inscricao_evento_id]);\n $row1->layout = ['col-sm-6'];\n\n // keep the form filled during navigation with session data\n $this->form->setData( TSession::getValue(__CLASS__.'_filter_data') );\n\n $btn_ongenerate = $this->form->addAction('Gerar', new TAction([$this, 'onGenerate']), 'fa:search #ffffff');\n $btn_ongenerate->addStyleClass('btn-primary'); \n\n // vertical box container\n $container = new TVBox;\n $container->style = 'width: 100%';\n $container->add(TBreadCrumb::create(['Cadastros','Avaliações']));\n $container->add($this->form);\n\n parent::add($container);\n\n }", "public function create()\n {\n // I skip using this create function because I use a modal form for inserting data using modal in index view via index function.\n }", "public function imprimir(){\n $this->index(1);\n $this->viewBuilder()->setLayout(\"imprimir\");\n }", "function bt_fecharClick($sender, $params)\r\n {\r\n\r\n $this->mgt_nota_fiscal_data_ini->Text = '';\r\n $this->mgt_nota_fiscal_data_fim->Text = '';\r\n $this->mgt_nota_fiscal_numero->Text = '';\r\n\r\n //*** Limpa a Tabela de Cobrancas ***\r\n\r\n $Comando_SQL = \"TRUNCATE TABLE mgt_swap_cobrancas\";\r\n\r\n GetConexaoPrincipal()->SQL_Comunitario->Close();\r\n GetConexaoPrincipal()->SQL_Comunitario->SQL = $Comando_SQL;\r\n GetConexaoPrincipal()->SQL_Comunitario->Open();\r\n GetConexaoPrincipal()->SQL_Comunitario->Close();\r\n\r\n //*** Fecha a Tela de Cobranca ***\r\n\r\n redirect('frame_corpo.php');\r\n }", "public function imprimir(){\n $this->index(1);\n $this->viewBuilder()->setLayout(\"imprimir\");\n\n }", "public function __construct($icon=\"fa-cog faa-spin\",$label=null,$direction=\"left\",$class=null,$style=null,$tags=null,$id=null){\n if(!in_array(strtolower($direction),array(\"left\",\"right\"))){echo \"ERROR - OperationsButton - Invalid direction\";return false;}\n $this->id=\"operationsButton_\".($id?$id:api_random());\n $this->icon=$icon;\n $this->label=$label;\n $this->direction=$direction;\n $this->class=$class;\n $this->style=$style;\n $this->tags=$tags;\n $this->elements_array=array();\n return true;\n }", "public function actionCreate() {\n $model = new USUARIO;\n $tienda = new TIENDA;\n //$dataCliente = new ARTICULOTIENDA;\n //$this->titleWindows = Yii::t('COMPANIA', 'Create User');\n $cli_Id=Yii::app()->getSession()->get('CliID', FALSE);\n $this->render('create', array(\n 'model' => $model,\n 'genero' => $this->genero(),\n 'estado' => $this->estado(),\n \n ));\n }", "public function crearNotaCtr($datos){\n\n $resultado = Modelo::crearNotaMdl($datos, \"notas_2\");\n\n if ($resultado == \"exito\") {\n\n }else{\n\n }\n\n\n\n\n }", "public static function createInstance()\n {\n return new Button('ISerializable', 'ISerializable', 'ISerializable');\n }", "function addButton($label='Continue'){\n if(!is_array($label)){\n $label=array($label, 'icon-r'=>'right-big');\n }\n return $this->add('Button',null,'Button')\n ->set($label);\n }", "public function criarHtml()\n {\n $action = 'excluir(\"'.$this->no_arquivo.'\",\"'.$this->cd_rotina.'\",\"'.$this->cd_modulo.'\",\"'.$this->value.'\")';\n return \"<a onclick='$action' class='mdl-button mdl-js-button mdl-button--icon'>\n <i class='glyphicon glyphicon-minus'></i></a>\";\n }", "public function makeShortcutButton() {}", "public function actionAgregarlinea(){\n $linea = new PedidoLinea;\n $linea->attributes = $_POST['PedidoLinea'];\n $ruta = Yii::app()->request->baseUrl.'/images/cargando.gif'; \n \n if($linea->validate()){\n echo '<div id=\"alert\" class=\"alert alert-success\" data-dismiss=\"modal\">\n <h2 align=\"center\">Operacion Satisfactoria</h2>\n </div>\n <span id=\"form-cargado\" style=\"display:none\">';\n $this->renderPartial('form_lineas', \n array(\n 'linea'=>$linea,\n 'ruta'=>$ruta,\n 'Pactualiza'=>isset($_POST['ACTUALIZA']) ? $_POST['ACTUALIZA'] : 0,\n )\n );\n echo '</span>\n \n <div id=\"boton-cargado\" class=\"modal-footer\">';\n $this->widget('bootstrap.widgets.TbButton', array(\n 'buttonType'=>'button',\n 'type'=>'normal',\n 'label'=>'Aceptar',\n 'icon'=>'ok',\n 'htmlOptions'=>array('id'=>'nuevo','onclick'=>'agregar(\"'.$_POST['SPAN'].'\")')\n ));\n echo '</div>';\n Yii::app()->end();\n }else{\n $this->renderPartial('form_lineas', \n array(\n 'linea'=>$linea,\n 'ruta'=>$ruta, \n )\n );\n Yii::app()->end();\n }\n }", "function load_button($fileid, $permType, $btnCaption, $cssStyle) { // 1, \"DELETE\", load_lang(\"DELETE\"), \"fancy-button-blue\"\n global $dbf;\n global $lang;\n \n if(empty($fileid)) { exit(\"Please insert the file id @ button.\"); }\n if(empty($permType)){ exit(\"Please insert the permission type value for the button.\"); }\n if(empty($btnCaption)) { $btnCaption=\"DEFAULT_BUTTON\"; }\n if(empty($cssStyle)) { $cssStyle=\"\"; }\n \n $sqlPerm = \"SELECT * FROM base_user_permission WHERE user_id='\".$_SESSION['user_id'].\"' \n AND file_id ='\".$fileid.\"' AND permission='\".$permType.\"'\";\n $dbf->query($sqlPerm);\n $dbf->next_record();\n \n $rows = $dbf->rowdata();\n if($permType != $rows['permission']) {\n //exit(\"Invalid permission type!\");\n return;\n } else {\n \n $theButton = \"<input type=\\\"submit\\\" name=\".$permType.\" value=\\\"$btnCaption\\\" class=\\\"$cssStyle\\\" />\";\n \n return $theButton;\n }\n }", "public function actionCreate()\n {\n $model = new TabContato();\n\n\t\t$this->titulo = 'Incluir Contato';\n\t\t$this->subTitulo = '';\n\t\t\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n\t\t\t\n\t\t\t$this->session->setFlashProjeto( 'success', 'update' );\n\t\t\t\n return $this->redirect(['view', 'id' => $model->cod_contato]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function criarAction() {\n if($this->usuario['tp_id']==5){\n $this->_redirect('index');\n }\n $this->modelColonia->insert($this->_getAllParams());\n\n $this->_redirect('colonia/index');\n }", "private function manageButtons()\n {\n if (!$this->user->hasPermissionTo(BackpackUser::PERMISSION_EVENTS_CREATE)) {\n $this->crud->denyAccess('create');\n }\n\n if ($this->user->hasPermissionTo(BackpackUser::PERMISSION_EVENTS_ADMIN_VIEW)) {\n $this->crud->allowAccess('show');\n }\n\n if (!$this->user->hasPermissionTo(BackpackUser::PERMISSION_EVENTS_EDIT)) {\n $this->crud->denyAccess('update');\n }\n\n if (!$this->user->hasPermissionTo(BackpackUser::PERMISSION_EVENTS_DELETE)) {\n $this->crud->denyAccess('delete');\n }\n }", "public function admin_creacion_contacto(){\n\n\t\t$this->layout = 'dialog';\n\n\t\t$data = $this->request->data;\n\n\t\t$id_dialog = 'main-dialog';\n\n\t\tif ( isset( $data['id_dialog'] ) ){\n\n\t\t\t$id_dialog = $data['id_dialog'];\n\t\t}\n\n\t\t$title = '';\n\n\t\tif ( isset( $data['title'] ) ){\n\n\t\t\t$title = $data['title'];\n\t\t}\n\n\t\t$classes = '';\n\n\t\tif ( isset( $data['classes'] ) ){\n\n\t\t\t$classes = $data['classes'];\n\t\t}\n\n\t\t$this->set('id_dialog', $id_dialog);\n\n\t\t$this->set('title', $title);\t\n\t\t\n\t\t$this->set('classes', $classes);\t\n\t}", "public function create()\n {\n $banner = DB::SELECT(\"SELECT fb.`id`,fb.`Formato`,fb.`Descripcion`,fb.`Ancho`,fb.`Alto`,ba.`imagen`,ba.id as ban\n FROM formatoBanner AS fb \n INNER JOIN banner AS ba ON ba.`id_formato`=fb.`id` ORDER BY ba.id DESC\");\n $table = '';\n foreach($banner as $i){\n $table .= \"\n <tr>\n <td>\".$i->Formato.\"</td>\n <td>\".$i->Descripcion.\"</td>\n <td>\".$i->Ancho.\"px</td>\n <td>\".$i->Alto.\"px</td>\n <td><img class='dataImage' src='/banners/\".$i->imagen.\"'></td>\n <td><button class='btn btn-warning btnShowBanner' id='\".$i->imagen.\"' data-toggle='modal' data-target='#banner_show'>Mostrar</button> \n <button id='\".$i->ban.\"' class='btn btn-danger'>Eliminar</button>\n </td>\n </tr>\";\n }\n return $table;\n }", "public function crearEventoAction()\n {\n $evento = new Eventos();\n \n $evento->setNombreEvento(\"evento ear\");\n $evento->setFecha( new \\DateTime);\n $evento->setCiudad(\"El Estor\");\n $evento->setPoblacion(\"Izabal\");\n \n //Doctrine\n $mangDoct = $this->getDoctrine()->getManager();\n $mangDoct->persist($evento);\n $mangDoct->flush($evento);\n \n return $this->render('@Prueba/Eventos/crearEvento.html.twig', array(\"eventoId\"=>$evento->getId())); //\"eventoId\" es la variable del array asociativo a la cual se le está asignando el id que se está obteniendo con el getId(), que es el getter del campo id del objeto $evento que es una instancia de la entidad Eventos\n }", "function inicializa() {\n\n parent::addComando(chr(27) . chr(64));\n }", "public function submitButton(){\n\t\t\n\t\t$this->addElement('button', 'bttnsubmit', array (\n\t\t\t\t'class' => 'btn blue ',\n\t\t\t\t'ignore'=>true,\n\t\t\t\t'type'=>'submit',\n \t\t\t\t'label'=>'<i class=\"fa fa-check\"></i> Save',\n\t\t\t\t'escape'=>false\n\t\t));\n\t\t$this->bttnsubmit->setDecorators(array('ViewHelper',array(array('controls' => 'HtmlTag'), array('tag' => 'div', 'class' =>'form-actions text-right'))\t));\n\t\t\n\t}", "public function makeLinkButton() {}", "function createAccountButton(){\n\t\techo '<form name=\"accounts\" method=\"post\" action=\"CheckBook.php/:Add\">';\n\t\techo '<button type=\"submit\">Add an Account</button>';\n\t\techo '</form>';\n\t}", "public function actionCreate() {\r\n\t\t$model = new datHorario();\r\n $request = Yii::$app->request;\r\n $repetir = $request->post('repetir');\r\n $lunes \t\t= $request->post('cb-auto-1');\r\n $martes \t= $request->post('cb-auto-2');\r\n $miercoles\t= $request->post('cb-auto-3');\r\n $jueves\t\t= $request->post('cb-auto-4');\r\n $viernes\t= $request->post('cb-auto-5');\r\n $sabado \t= $request->post('cb-auto-6');\r\n $domingo\t= $request->post('cb-auto-7');\r\n $acl_user = $this->findAclUser($request->post('nombre_docente'));\r\n\r\n if($repetir!='on'){\r\n\t $model->id_materia = $request->post('nombre_materia');\r\n\t $model->nombre_materia = $request->post('ext-comp-1002');\r\n\t $model->nombre_docente = $request->post('ext-comp-1003');\r\n\t $model->hora_inicio = $request->post('hora_inicio');\r\n\t $model->hora_fin \t\t= $request->post('hora_fin');\r\n $model->id_docente = $request->post('nombre_docente');\r\n\t $model->id_aula = $request->post('nombre_aula');\r\n\t $model->dia_semana = $request->post('dia');\r\n\t $model->id_trimestre = $request->post('periodo');\r\n $model->modalidad = $request->post('modalidad');\r\n $model->tipo_docente = $request->post('tipo_docente');\r\n $model->id_acl_user = $acl_user;\r\n\r\n\t if($request->post('periodo')!=''){\r\n\t if ($model->save()) {\r\n\t $result = new \\stdClass();\r\n\t $result->success = true;\r\n\t $result->msg = 'Se creó correctamente';\r\n\t echo json_encode($result);\r\n\t } \r\n\t }\r\n\t else {\r\n\t $result = new \\stdClass();\r\n\t $result->success = false;\r\n\t $result->msg = 'Ocurrió un error.';\r\n\t echo json_encode($result);\r\n\t }\r\n \t}\r\n \telse if($repetir=='on')\r\n \t{\r\n \t\t$error = false;\r\n if($lunes=='on'){\r\n \t\t\t$model = new datHorario();\r\n \t\t\t$model->id_materia = $request->post('nombre_materia');\r\n\t\t $model->nombre_materia = $request->post('ext-comp-1002');\r\n\t\t $model->nombre_docente = $request->post('ext-comp-1003');\r\n\t\t $model->hora_inicio = $request->post('hora_inicio_lunes');\r\n\t\t $model->hora_fin \t\t= $request->post('hora_fin_lunes');\r\n\t\t $model->id_docente \t= $request->post('nombre_docente');\r\n\t\t $model->id_aula = $request->post('nombre_aula_lunes');\r\n\t\t $model->dia_semana = 'LUNES';\r\n\t\t $model->id_trimestre = $request->post('periodo');\r\n $model->modalidad = $request->post('modalidad');\r\n $model->tipo_docente = $request->post('tipo_docente');\r\n $model->id_acl_user = $acl_user;\r\n\r\n\t\t if($request->post('periodo')!=''){\r\n $model->save();\r\n }else{\r\n $error = true;\r\n }\r\n \t\t}\r\n \t\tif($martes=='on'){\r\n \t\t\t$model = new datHorario();\r\n \t\t\t$model->id_materia = $request->post('nombre_materia');\r\n\t\t $model->nombre_materia = $request->post('ext-comp-1002');\r\n\t\t $model->nombre_docente = $request->post('ext-comp-1003');\r\n\t\t $model->hora_inicio = $request->post('hora_inicio_martes');\r\n\t\t $model->hora_fin \t\t= $request->post('hora_fin_martes');\r\n\t\t $model->id_docente \t= $request->post('nombre_docente');\r\n\t\t $model->id_aula = $request->post('nombre_aula_martes');\r\n\t\t $model->dia_semana = 'MARTES';\r\n\t\t $model->id_trimestre = $request->post('periodo');\r\n $model->modalidad = $request->post('modalidad');\r\n $model->tipo_docente = $request->post('tipo_docente');\r\n $model->id_acl_user = $acl_user;\r\n\r\n\t\t if($request->post('periodo')!=''){\r\n $model->save();\r\n }else{\r\n $error = true;\r\n }\r\n \t\t}\r\n \t\tif($miercoles=='on'){\r\n \t\t\t$model = new datHorario();\r\n \t\t\t$model->id_materia = $request->post('nombre_materia');\r\n\t\t $model->nombre_materia = $request->post('ext-comp-1002');\r\n\t\t $model->nombre_docente = $request->post('ext-comp-1003');\r\n\t\t $model->hora_inicio = $request->post('hora_inicio_miercoles');\r\n\t\t $model->hora_fin \t\t= $request->post('hora_fin_miercoles');\r\n\t\t $model->id_docente \t= $request->post('nombre_docente');\r\n\t\t $model->id_aula = $request->post('nombre_aula_miercoles');\r\n\t\t $model->dia_semana = 'MIÉRCOLES';\r\n\t\t $model->id_trimestre = $request->post('periodo');\r\n $model->modalidad = $request->post('modalidad');\r\n $model->tipo_docente = $request->post('tipo_docente');\r\n $model->id_acl_user = $acl_user;\r\n\r\n\t\t if($request->post('periodo')!=''){\r\n $model->save();\r\n }else{\r\n $error = true;\r\n }\r\n \t\t}\r\n \t\tif($jueves=='on'){\r\n \t\t\t$model = new datHorario();\r\n \t\t\t$model->id_materia = $request->post('nombre_materia');\r\n\t\t $model->nombre_materia = $request->post('ext-comp-1002');\r\n\t\t $model->nombre_docente = $request->post('ext-comp-1003');\r\n\t\t $model->hora_inicio = $request->post('hora_inicio_jueves');\r\n\t\t $model->hora_fin \t\t= $request->post('hora_fin_jueves');\r\n\t\t $model->id_docente \t= $request->post('nombre_docente');\r\n\t\t $model->id_aula = $request->post('nombre_aula_jueves');\r\n\t\t $model->dia_semana = 'JUEVES';\r\n\t\t $model->id_trimestre = $request->post('periodo');\r\n $model->modalidad = $request->post('modalidad');\r\n $model->tipo_docente = $request->post('tipo_docente');\r\n $model->id_acl_user = $acl_user;\r\n\r\n\t\t if($request->post('periodo')!=''){\r\n $model->save();\r\n }else{\r\n $error = true;\r\n }\r\n \t\t}\r\n \t\tif($viernes=='on'){\r\n \t\t\t$model = new datHorario();\r\n \t\t\t$model->id_materia = $request->post('nombre_materia');\r\n\t\t $model->nombre_materia = $request->post('ext-comp-1002');\r\n\t\t $model->nombre_docente = $request->post('ext-comp-1003');\r\n\t\t $model->hora_inicio = $request->post('hora_inicio_viernes');\r\n\t\t $model->hora_fin \t\t= $request->post('hora_fin_viernes');\r\n\t\t $model->id_docente \t= $request->post('nombre_docente');\r\n\t\t $model->id_aula = $request->post('nombre_aula_viernes');\r\n\t\t $model->dia_semana = 'VIERNES';\r\n\t\t $model->id_trimestre = $request->post('periodo');\r\n $model->modalidad = $request->post('modalidad');\r\n $model->tipo_docente = $request->post('tipo_docente');\r\n $model->id_acl_user = $acl_user;\r\n\r\n\t\t if($request->post('periodo')!=''){\r\n $model->save();\r\n }else{\r\n $error = true;\r\n }\r\n \t\t}\r\n \t\tif($sabado=='on'){\r\n \t\t\t$model = new datHorario();\r\n \t\t\t$model->id_materia = $request->post('nombre_materia');\r\n\t\t $model->nombre_materia = $request->post('ext-comp-1002');\r\n\t\t $model->nombre_docente = $request->post('ext-comp-1003');\r\n\t\t $model->hora_inicio = $request->post('hora_inicio_sabado');\r\n\t\t $model->hora_fin \t\t= $request->post('hora_fin_sabado');\r\n\t\t $model->id_docente \t= $request->post('nombre_docente');\r\n\t\t $model->id_aula = $request->post('nombre_aula_sabado');\r\n\t\t $model->dia_semana = 'SÁBADO';\r\n\t\t $model->id_trimestre = $request->post('periodo');\r\n $model->modalidad = $request->post('modalidad');\r\n $model->tipo_docente = $request->post('tipo_docente');\r\n $model->id_acl_user = $acl_user;\r\n\r\n\t\t if($request->post('periodo')!=''){\r\n $model->save();\r\n }else{\r\n $error = true;\r\n }\r\n \t\t}\r\n \t\tif($domingo=='on'){\r\n \t\t\t$model = new datHorario();\r\n \t\t\t$model->id_materia = $request->post('nombre_materia');\r\n\t\t $model->nombre_materia = $request->post('ext-comp-1002');\r\n\t\t $model->nombre_docente = $request->post('ext-comp-1003');\r\n\t\t $model->hora_inicio = $request->post('hora_inicio_domingo');\r\n\t\t $model->hora_fin \t\t= $request->post('hora_fin_domingo');\r\n\t\t $model->id_docente \t= $request->post('nombre_docente');\r\n\t\t $model->id_aula = $request->post('nombre_aula_domingo');\r\n\t\t $model->dia_semana = 'DOMINGO';\r\n\t\t $model->id_trimestre = $request->post('periodo');\r\n $model->modalidad = $request->post('modalidad');\r\n $model->tipo_docente = $request->post('tipo_docente');\r\n $model->id_acl_user = $acl_user;\r\n\r\n\t\t if($request->post('periodo')!=''){\r\n $model->save();\r\n }else{\r\n $error = true;\r\n }\r\n \t\t}\r\n \t\tif($error==false){\r\n $result = new \\stdClass();\r\n $result->success = true;\r\n $result->msg = 'Se creó correctamente';\r\n echo json_encode($result); \r\n }\r\n if($error==true){\r\n $result = new \\stdClass();\r\n $result->success = false;\r\n $result->msg = 'Ocurrió un error.';\r\n echo json_encode($result);\r\n }\r\n \r\n \t}\r\n\t}", "function getButtonText()\r\n\t{\r\n\t\tif ( isset($this->object_it) )\r\n\t\t{\r\n\t\t\treturn translate('Сохранить');\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\treturn translate('Создать');\r\n\t\t}\r\n\t}", "public function set_button($button) { $this->button = $button; }", "public function renderButton(){\n\t\t\t$content = <<<ENDBUTTON\n\t<li><a id=\"btn-import-{$this->ID}\" href=\"#importerModal{$this->ID}\" data-toggle=\"modal\"><i class=\"{$this->icon}\"></i> From {$this->source}</a></li>\nENDBUTTON;\n\t\t\t\n\t\t\treturn $content;\n\t\t}", "public function create(){\n $alter = '';\n $crear = '';\n $creartablas = '';\n\n $a = '';\n if(!empty($_POST)){\n if( isset($_POST['creartabla']) )\n $a = $_POST['creartabla'];\n }\n if($a!=''):\n $array = explode(',', $a);\n $crear = '';\n $tablas = array();\n foreach ($array as $v): \n $v = trim($v);\n $inic = $crear;\n if( stristr($v, 'id_') ){ \n $tabla = str_replace('id_', '', $v);\n $crear.= 'CREATE TABLE IF NOT EXISTS '.$tabla.' ( ';\n $crear.= ' id_'.$tabla.' INTEGER(10) PRIMARY KEY AUTO_INCREMENT ';\n }\n if( stristr( $v, '_id') ){\n $tablas[] = str_replace('_id', '', $v);\n $crear.= ','.$v.' INTEGER(10)'; \n } \n\n if( stristr($v, 'fecha' )or stristr($v, 'fecha') ) $crear.= ','.$v.' DATE NOT NULL '; \n if( stristr($v, '_nro' ) or stristr($v, 'nro_' ) ) $crear.= ','.$v.' INTEGER(10) NOT NULL '; \n if( stristr($v, 'text' ) or stristr($v, 'texto' ) ) $crear.= ','.$v.' TEXT NOT NULL COMMENT \\'col:12\\' '; \n if( stristr($v, 'timestamp' ) ) $crear.= ','.$v.' TIMESTAMP DEFAULT CURRENT_TIMESTAMP '; \n if($inic==$crear) $crear.= ','.$v.' VARCHAR(255) NOT NULL '; \n \n \n endforeach;\n\n $fk = '';\n $creartablas ='';\n foreach ($tablas as $value):\n $fk.=', FOREIGN KEY('.$value.'_id) REFERENCES '.$value.'(id_'.$value.') '; \n $creartablas.= 'CREATE TABLE IF NOT EXISTS '.$value.' ( ';\n $creartablas.= ' id_'.$value.' INTEGER(10) PRIMARY KEY AUTO_INCREMENT ';\n $creartablas.= ', name_'.$value.' VARCHAR(99) NOT NULL';\n $creartablas.= ', detail_'.$value.' VARCHAR(99) NOT NULL ';\n $creartablas.= ') ENGINE = InnoDB; ';\n endforeach;\n $crear .= $fk.') ENGINE = InnoDB;';\n\n $a = $creartablas.$crear;\n $b = explode(';', $a);\n $re = 'INICIO DE PETICION<BR>#####################';\n $this->db->trans_start();\n foreach ($b as $value) {\n if($value!='')\n $this->db->query($value);\n $re.= \"<BR>Peticion: \".$value.'';\n }\n $this->db->trans_complete();\n $re.= '#####################<br>Fin de las peticiones';\n $tables = $this -> Tables_model -> table_name();\n $this->session->set_userdata('tables', $tables);\n return $re;\n endif;\n }", "protected function createButtons()\n {\n $buttonBar = $this->view->getModuleTemplate()->getDocHeaderComponent()->getButtonBar();\n\n $uriBuilder = $this->objectManager->get(UriBuilder::class);\n $uriBuilder->setRequest($this->request);\n\n if ($this->request->getControllerActionName() === 'index') {\n $toggleButton = $buttonBar->makeLinkButton()\n ->setHref('#')\n ->setDataAttributes([\n 'togglelink' => '1',\n 'toggle' => 'tooltip',\n 'placement' => 'bottom',\n ])\n ->setTitle($this->getLanguageService()->sL('LLL:EXT:news/Resources/Private/Language/locallang_be.xlf:administration.toggleForm'))\n ->setIcon($this->iconFactory->getIcon('actions-filter', Icon::SIZE_SMALL));\n $buttonBar->addButton($toggleButton, ButtonBar::BUTTON_POSITION_LEFT, 1);\n }\n\n $buttons = [\n [\n 'table' => 'tx_news_domain_model_news',\n 'label' => 'module.createNewNewsRecord',\n 'action' => 'newNews',\n 'icon' => 'ext-news-type-default'\n ],\n [\n 'table' => 'tx_news_domain_model_tag',\n 'label' => 'module.createNewTag',\n 'action' => 'newTag',\n 'icon' => 'ext-news-tag'\n ],\n [\n 'table' => 'sys_category',\n 'label' => 'module.createNewCategory',\n 'action' => 'newCategory',\n 'icon' => 'mimetypes-x-sys_category'\n ]\n ];\n foreach ($buttons as $key => $tableConfiguration) {\n if ($this->showButton($tableConfiguration['table'])) {\n $title = $this->getLanguageService()->sL('LLL:EXT:news/Resources/Private/Language/locallang_be.xlf:' . $tableConfiguration['label']);\n $viewButton = $buttonBar->makeLinkButton()\n ->setHref($uriBuilder->reset()->setRequest($this->request)->uriFor($tableConfiguration['action'],\n [], 'Administration'))\n ->setDataAttributes([\n 'toggle' => 'tooltip',\n 'placement' => 'bottom',\n 'title' => $title])\n ->setTitle($title)\n ->setIcon($this->iconFactory->getIcon($tableConfiguration['icon'], Icon::SIZE_SMALL, 'overlay-new'));\n $buttonBar->addButton($viewButton, ButtonBar::BUTTON_POSITION_LEFT, 2);\n }\n }\n\n $clipBoard = GeneralUtility::makeInstance(Clipboard::class);\n $clipBoard->initializeClipboard();\n $elFromTable = $clipBoard->elFromTable('tx_news_domain_model_news');\n if (!empty($elFromTable)) {\n $viewButton = $buttonBar->makeLinkButton()\n ->setHref($clipBoard->pasteUrl('', $this->pageUid))\n ->setOnClick('return ' . $clipBoard->confirmMsg('pages',\n BackendUtilityCore::getRecord('pages', $this->pageUid), 'into',\n $elFromTable))\n ->setTitle($this->getLanguageService()->sL('LLL:EXT:lang/locallang_mod_web_list.xlf:clip_pasteInto'))\n ->setIcon($this->iconFactory->getIcon('actions-document-paste-into', Icon::SIZE_SMALL));\n $buttonBar->addButton($viewButton, ButtonBar::BUTTON_POSITION_LEFT, 4);\n }\n\n // Refresh\n $path = VersionNumberUtility::convertVersionNumberToInteger(TYPO3_branch) >= VersionNumberUtility::convertVersionNumberToInteger('8.6') ? 'Resources/Private/Language/' : '';\n $refreshButton = $buttonBar->makeLinkButton()\n ->setHref(GeneralUtility::getIndpEnv('REQUEST_URI'))\n ->setTitle($this->getLanguageService()->sL('LLL:EXT:lang/' . $path . 'locallang_core.xlf:labels.reload'))\n ->setIcon($this->iconFactory->getIcon('actions-refresh', Icon::SIZE_SMALL));\n $buttonBar->addButton($refreshButton, ButtonBar::BUTTON_POSITION_RIGHT);\n }", "protected function createComponentDeletePrihozForm()\n {\n $form = new Nette\\Application\\UI\\Form;\n \n $form->addText('id_nemovitost')\n ->setAttribute('style', 'display:none');\n \n $form->addSubmit('send', 'Odeslat formulář')\n ->setAttribute('class', 'btn btn-primary');\n\n $form->onSuccess[] = $this->deletePrihozFormSucceeded;\n return $form;\n }", "function composeL1EditForm_buttonsDiv() {\n\n\n return;\n}", "static public function ctrCrearTamanio(){\n\n\t\tif(isset($_POST[\"nuevoID\"])){\n\n\t\t\tif(preg_match('/^[a-zA-Z0-9]+$/', $_POST[\"nuevoID\"]) &&\n\t\t\t preg_match('/^[a-zA-Z0-9ñÑáéíóúÁÉÍÓÚ ]+$/', $_POST[\"nuevoNombre\"])){\n\n\t\t\t\t$tabla = \"Tamanio\";\n\n\t\t\t\t$datos = array(\"ID\" => $_POST[\"nuevoID\"],\n\t\t\t\t\t \"Nombre\" => $_POST[\"nuevoNombre\"]);\n\n\t\t\t\t$respuesta = ModeloTamanio::mdlIngresarTamanio($tabla, $datos);\n\n\n\n\t\t\t\tif($respuesta == \"ok\"){\n\n\t\t\t\t\techo'<script>\n\n\t\t\t\t\tswal({\n\t\t\t\t\t\t type: \"success\",\n\t\t\t\t\t\t title: \"El tamaño ha sido guardado correctamente\",\n\t\t\t\t\t\t showConfirmButton: true,\n\t\t\t\t\t\t confirmButtonText: \"Cerrar\"\n\t\t\t\t\t\t }).then(function(result){\n\t\t\t\t\t\t\t\t\tif (result.value) {\n\n\t\t\t\t\t\t\t\t\twindow.location = \"tamanio\";\n\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t})\n\n\t\t\t\t\t</script>';\n\n\t\t\t\t}\n\n\n\t\t\t}else{\n\n\t\t\t\techo'<script>\n\n\t\t\t\t\tswal({\n\t\t\t\t\t\t type: \"error\",\n\t\t\t\t\t\t title: \"¡Los campos no pueden ir vacíos o llevar caracteres especiales!\",\n\t\t\t\t\t\t showConfirmButton: true,\n\t\t\t\t\t\t confirmButtonText: \"Cerrar\"\n\t\t\t\t\t\t }).then(function(result){\n\t\t\t\t\t\t\tif (result.value) {\n\n\t\t\t\t\t\t\twindow.location = \"tamanio\";\n\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t})\n\n\t\t\t \t</script>';\n\n\t\t\t}\n\n\t\t}\n\n\t}", "private function ajoutauteur() {\n\t\t$this->_ctrlAuteur = new ControleurAuteur();\n\t\t$this->_ctrlAuteur->auteurAjoute();\n\t}", "function insertarControlGuia($numremesa, $idestablecimiento, $txtFecRecogida, $iddestinatario, $formaPago, $alto, $ancho, $largo, $unidades, $valorDeclarado, $flete, $totalflete, $tipocarga, $idoperario, $numplaca, $idoperarioext, $estadocarga, $estadoRecogida, $observaciones, $idusaurio, $fechaRegistro) {\n $data = array('nro_remesa' => $numremesa,\n 'id_establecimientos' => $idestablecimiento,\n 'fecha_recogida' => $txtFecRecogida,\n 'id_destinatario' => $iddestinatario,\n 'forma_pago' => $formaPago,\n 'unidades' => $unidades,\n 'pv_alto' => $alto,\n 'pv_ancho' => $ancho,\n 'pv_largo' => $largo,\n 'valor_declarado' => $valorDeclarado,\n 'flete' => $flete,\n 'total_fletes' => $totalflete,\n 'tipo_carga' => $tipocarga,\n 'id_usuario_operario' => $idoperario,\n 'nro_placa' => $numplaca,\n 'id_operario' => $idoperarioext,\n 'estado_carga' => $estadocarga,\n 'estado_control' => $estadoRecogida,\n 'observaciones' => $observaciones,\n 'estado_contable' => 0,\n 'id_usuario' => $idusaurio,\n 'fecha_registro' => $fechaRegistro);\n $this->db->insert('txtar_admin_control', $data);\n $this->db->close();\n }", "static public function ctrCrearCcuerpo(){\n\n if(isset($_POST[\"nuevoCcuerpo\"])){\n\n\t\t\tif(preg_match('/^[a-zA-Z0-9ñÑáéíóúÁÉÍÓÚ\\- ]+$/', $_POST[\"nuevoCcuerpo\"])){\n\n\t\t\t\t$tabla = \"cuartel_cuerpos\";\n\n\t\t\t\t$datos = array(\"tipo_sep\"=> $_POST[\"nuevoTproducto\"],\n \"nombre\"=> $_POST[\"nuevoCcuerpo\"],\n \"id_sociedad\" => '0',\n \"id_cementerio\"=> $_POST[\"nuevoCementerio\"]);\n\n\t\t\t\t$respuesta = ModeloCcuerpo::mdlIngresarCcuerpo($tabla, $datos);\n print_r($respuesta);\n\t\t\t\tif($respuesta == \"ok\"){\n\n\t\t\t\t\techo'<script>\n\n\t\t\t\t\tswal({\n\t\t\t\t\t\t type: \"success\",\n\t\t\t\t\t\t title: \"El Cuartel-Cuerpo ha sido guardado correctamente\",\n\t\t\t\t\t\t showConfirmButton: true,\n\t\t\t\t\t\t confirmButtonText: \"Cerrar\"\n\t\t\t\t\t\t }).then(function(result){\n\t\t\t\t\t\t\t\t\tif (result.value) {\n\n\t\t\t\t\t\t\t\t\twindow.location = \"cuartel-cuerpo\";\n\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t})\n\n\t\t\t\t\t</script>';\n\n\t\t\t\t}\n\n\n\t\t\t}else{\n\n\t\t\t\techo'<script>\n\n\t\t\t\t\tswal({\n\t\t\t\t\t\t type: \"error\",\n\t\t\t\t\t\t title: \"¡El Cuartel-Cuerpo no puede ir vacío o llevar caracteres especiales!\",\n\t\t\t\t\t\t showConfirmButton: true,\n\t\t\t\t\t\t confirmButtonText: \"Cerrar\"\n\t\t\t\t\t\t }).then(function(result){\n\t\t\t\t\t\t\tif (result.value) {\n\n\t\t\t\t\t\t\twindow.location = \"cuartel-cuerpo\";\n\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t})\n\n\t\t\t \t</script>';\n\n\t\t\t}\n\n\t\t}\n\n\t}", "public function examen(){\r\n\t\tparent::conectaBDMy();\t \r\n\t\t$this->idExamen=\"\";\t\t\r\n\t\t$this->tipoExamen=\"\";\t\r\n\t\t$this->descripcion=\"\";\r\n\t}", "public function addButtons()\n {\n if ($this->isCreateButtonRequired()) {\n $this->getToolbar()->addChild('bluemedia_return', Button::class, [\n 'label' => __('Return BM'),\n 'onclick' => 'BlueMedia.BluePayment.showPopup();'\n ]);\n }\n\n return $this;\n }", "public function create()\n {\n $data = Crud::all();\n return Datatables::of($data)\n ->addIndexColumn()\n ->addColumn('action', function($row){\n $btn = '';\n $btn = $btn.' <a href=\"'.route('crud.edit', $row->sapid) .'\" class=\"edit btn btn-primary btn-sm\">Edit</a>';\n $btn = $btn.' <a href=\"javascript:void(0);\" class=\"edit btn btn-danger btn-sm\" onclick=\"deleteclients('.$row->sapid.')\">Delete</a>';\n \n return $btn;\n })\n ->rawColumns(['delete' => 'delete','action' => 'action'])\n ->make(true);\n \n \n return view('cruds.index');\n }", "private function objetoAbreConexao()\n\t{\n\t\t\n\t\t$_BANCO = new ConexaoBD();\n\t\t$_BANCO->conexaoBD();\n\t}", "public static function createDELTablebutton($table='no_table_provided',$id=0){\n\t\tif(empty($id)) return \"<span>xDELx</span>\";\n\t\treturn \"<button type='button' class='btn_del' onclick='btnDelFromTable(\\\"{$table}\\\",{$id});'>del</button>\";\n\t}" ]
[ "0.6407595", "0.63540125", "0.6066336", "0.6055818", "0.60145456", "0.5934676", "0.5910406", "0.5889683", "0.5886843", "0.5843326", "0.5794188", "0.5752889", "0.57228434", "0.56750494", "0.5661908", "0.5626699", "0.5594251", "0.5558798", "0.5547617", "0.5538189", "0.553598", "0.5534177", "0.553346", "0.5503788", "0.5483972", "0.5476802", "0.5445849", "0.5431507", "0.5417552", "0.5395075", "0.5389542", "0.5367732", "0.5367732", "0.5335219", "0.53108835", "0.5309522", "0.5306482", "0.5303122", "0.53027457", "0.52920705", "0.5285726", "0.5285726", "0.5285726", "0.5285726", "0.52810925", "0.52690107", "0.52597713", "0.52411485", "0.52346766", "0.5232538", "0.52209866", "0.52164924", "0.5213139", "0.5208412", "0.52083325", "0.5201379", "0.51968455", "0.519151", "0.5171346", "0.51657194", "0.51646775", "0.5161743", "0.5161187", "0.51524764", "0.5144092", "0.51389354", "0.51307243", "0.51263994", "0.5119256", "0.5115611", "0.5108294", "0.51059544", "0.50942326", "0.5090126", "0.5086145", "0.5085348", "0.508417", "0.5082374", "0.50822246", "0.50783885", "0.50638556", "0.5062473", "0.50488436", "0.5047093", "0.50462294", "0.50452745", "0.5045206", "0.5038936", "0.5036192", "0.50341326", "0.50338995", "0.50315815", "0.50313604", "0.50289404", "0.5027606", "0.5024339", "0.5023467", "0.5012482", "0.5011562", "0.49817234" ]
0.5961643
5