query
stringlengths 10
8.11k
| document
stringlengths 17
398k
| negatives
sequencelengths 19
20
| metadata
dict |
---|---|---|---|
Can multiply two numbers | public function test_can_multiply_two_numbers()
{
$this->assertSame('90', Math::multiply(30, 3));
$this->assertSame('-120', Math::multiply(-100, '1.2'));
$this->assertSame('0.9', Math::multiply('0.3', '3', 1));
} | [
"public function multiply($a, $b);",
"public function multiply(){\n \treturn $this->firstNumber*$this->secondNumber;\n\t}",
"function multiply()\r\n {\r\n }",
"public function multiply($value);",
"function multiply($num1, $num2)\n {\n return $num1 * $num2;\n }",
"public function testMultiply () {\n $equals = $this->calculator->multiply(1,2);\n $this->assertEqual(2, $equals);\n\n $equals = $this->calculator->multiply(100,-1);\n $this->assertEqual(-100, $equals);\n\n $equals = $this->calculator->multiply(-2,-5);\n $this->assertEqual(10, $equals);\n\n $equals = $this->calculator->multiply(0,10);\n $this->assertEqual(0, $equals);\n }",
"public function multiply($multiplier);",
"public function testMultiply()\n {\n $n1 = 5;\n $n2 = 10;\n $calculator = new Calculator();\n $this->assertEquals(50, $calculator->multiply($n1, $n2));\n }",
"protected function _mult()\n\t{\n\t\t$targetRegister = $this->_getTargetRegister();\n\t\t$value1 = $this->_getNextInstruction();\n\t\t$value2 = $this->_getNextInstruction();\n\n\t\t$product = ($value1 * $value2) % $this->_modulo;\n\t\t$this->_setRegister($targetRegister, $product);\n\t}",
"public static function mul($a, $b)\n {\n return $a * $b;\n }",
"public function testMultiply()\n {\n $calculator = new Calculator(12, 3);\n $this->assertEquals(36, $calculator->multiply(), 'El resultado de 12 * 3 debe ser 36.');\n }",
"public function multiplication()\n {\n //self production\n }",
"public function testMultiplyReturnsCorrectValue()\n {\n $this->assertSame(RequestLogger::multiply(4, 4), 16);\n $this->assertSame(RequestLogger::multiply(2, 9), 18);\n }",
"public function multiply ( $number1, $number2 ) {\n\t\treturn $number1 * $number2;\n\t}",
"public function test_can_multiply_two_large_numbers_together()\n {\n $result = Math::multiply('1234567890.123456789', '987654321.0987654321', 9);\n $this->assertSame('1219326311370217952.237463801', $result);\n }",
"public function testIfMultiplicationsIsCorrect()\n {\n $params = [12,4];\n $response = $this->multiplicationObject->calculate($params);\n $this->assertEquals(48, $response);\n }",
"private function _multiply()\r\n {\r\n list($a, $b) = $this->_stack->splice(-2, 2);\r\n \r\n $this->_validate($a);\r\n $this->_validate($b);\r\n \r\n $this->_stack->push(array_product(array($a, $b)));\r\n }",
"public function testMultiplyReturnsCorrectValue(): void\n {\n $this->assertSame(FiveOneOneDataExchange::multiply(4, 4), 16);\n $this->assertSame(FiveOneOneDataExchange::multiply(2, 9), 18);\n }",
"public function testMultiplyReturnsCorrectValue()\n {\n $this->assertSame(Skeleton::multiply(4, 4), 16);\n $this->assertSame(Skeleton::multiply(2, 9), 18);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return cart position as array | private function getPositionAsArray($position){
return [
'id'=>$position->getId(),
'name'=>$position->getProduct()->getName(),
'link'=>$position->getProduct()->getLink(),
'picture'=>$position->getProduct()->getMainPicture('thumb'),
'code'=>$position->getProduct()->getCode(),
'price'=>$position->getPrice(),
'cost'=>$position->getCost(),
'quantity'=>$position->getQuantity(),
];
} | [
"private function getCart() {\n $cart = Cart::content()->toArray();\n $arr = [];\n foreach($cart as $key=>$elem) {\n $arr[] = $elem;\n }\n return $arr;\n }",
"public function getCart(): array\n {\n $cartItems = $_SESSION[\"cart\"] ?? [];\n $output = [];\n $productEntries = $this->kernel->getModelService()->find(Product::class, [\"id\" => array_keys($cartItems)]);\n\n foreach ($productEntries as $product) {\n $cartItem = $cartItems[$product->id];\n $total = $product->cost_per_item * $cartItem[\"quantity\"];\n\n $output[] = array_merge([\"product\" => $product, \"total\" => $total], $cartItem);\n }\n\n return $output;\n }",
"public function getCartItems() : array\n {\n return $this->cartItems;\n }",
"public function getArrOrderCart() {\n if ($this->arrOrderCartInfo === null) {\n $this->arrOrderCartInfo = array();\n }\n\n return $this->arrOrderCartInfo;\n }",
"protected function getCartItemsInfo(): array\n {\n return LightKitStoreCartHelper::getCartInfo($this->getContainer());\n }",
"public function getPositions() {\r\n return $this->toArray();\r\n }",
"public function getCartProductInfo()\n {\n $quote = Mage::getSingleton('checkout/cart')->getQuote();\n $quoteItems = $quote->getAllVisibleItems();\n\n $out = array(\n 'ids' => array(),\n 'qty' => array(),\n );\n\n foreach ($quoteItems as $quoteItem) {\n $out['ids'][] = $quoteItem->getProduct()->getData('sku');\n $out['qty'][] = $quoteItem->getQty();\n }\n\n return $out;\n }",
"protected function cartToOrderItems(): array\n {\n return auth()->user()\n ->cart\n ->map(function (Cart $cart) {\n return [\n 'orderizable_id' => $cart->cartable_id,\n 'orderizable_type' => $cart->cartable_type,\n 'size' => $cart->size\n ];\n })->toArray();\n }",
"public function getCartItems()\n {\n return $this->cartItems;\n }",
"public function position() {\n\n\t\treturn array( 'lat' => $this->latitude(), 'lng' => $this->longitude() );\n\n\t}",
"public function cart_items(){\n if( isset( $_SESSION['cart_items'] ) ) {\n return $_SESSION['cart_items'];\n }\n return array();\n }",
"public function getCartItems() {\n\t\treturn $this->cartItems;\n\t}",
"public function fetchCart ()\n {\n $session = $this->getRequest()\n ->getSession();\n\n return $session->check('cart') ? $session->read('cart') : [];\n }",
"public static function getProductsIDListFromCart(): array\n {\n if(session_status() == PHP_SESSION_NONE)\n {\n session_start();\n return null;\n }\n // get data from session\n $productList = null;\n if(isset($_SESSION['cart']['products'])){\n $productList = $_SESSION['cart']['products'];\n }\n return $productList;\n }",
"public function getPurchasePositions() {\n\t\treturn $this->purchasePositions;\n\t}",
"public function getAllCartItems(){\n return $this->shoppingCart;\n }",
"public function getProductsQuantityArray()\r\n {\r\n return $this->productsQuantityArray;\r\n }",
"public function getArrQuotationCart() {\n if ($this->arrQuotationCartInfo === null) {\n $this->arrQuotationCartInfo = array();\n }\n\n return $this->arrQuotationCartInfo;\n }",
"public function getProductPosition()\n {\n return $this->getData(self::PRODUCT_POSITION);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Spell out all the numbers in a string. e.g., 3pio > threepio, hubcap92 > hubcapninetytwo | public static function spellOutNumbers(string $word): string
{
$formatter = new NumberFormatter("en", NumberFormatter::SPELLOUT);
return preg_replace_callback('/\d+/', fn($number) => $formatter->format((int)$number[0]), $word);
} | [
"function tools_only_numbers($str)\n {\n return preg_replace(\"/[^0-9]/\", \"\", $str);\n }",
"function numbersOnly(string $str): string\n{\n return preg_replace('/\\D/u', '', $str);\n}",
"function numbers($string)\n {\n return preg_replace('/\\D/', '', $string);\n }",
"function abbey_numerize( $string ){\n\t$result = preg_replace(\"/[^0-9.]/\", '', $string); //use regex to remove non digit characters //\n\treturn $result; // return the processed string i.e. those with digits only //\n}",
"function wordsToNumber($data) {\n $data = strtr(\n $data, array(\n 'zero' => '0',\n 'a' => '1',\n 'one' => '1',\n 'two' => '2',\n 'three' => '3',\n 'four' => '4',\n 'five' => '5',\n 'six' => '6',\n 'seven' => '7',\n 'eight' => '8',\n 'nine' => '9',\n 'ten' => '10',\n 'eleven' => '11',\n 'twelve' => '12',\n 'thirteen' => '13',\n 'fourteen' => '14',\n 'fifteen' => '15',\n 'sixteen' => '16',\n 'seventeen' => '17',\n 'eighteen' => '18',\n 'nineteen' => '19',\n 'twenty' => '20',\n 'thirty' => '30',\n 'forty' => '40',\n 'fourty' => '40', // common misspelling\n 'fifty' => '50',\n 'sixty' => '60',\n 'seventy' => '70',\n 'eighty' => '80',\n 'ninety' => '90',\n 'hundred' => '100',\n 'thousand' => '1000',\n 'million' => '1000000',\n 'billion' => '1000000000',\n 'and' => '',\n )\n );\n\n // Coerce all tokens to numbers\n $parts = array_map(\n function ($val) {\n return floatval($val);\n }, preg_split('/[\\s-]+/', $data)\n );\n\n $stack = new \\SplStack(); //Current work stack\n $sum = 0; // Running total\n $last = null;\n\n foreach ($parts as $part) {\n if (!$stack->isEmpty()) {\n // We're part way through a phrase\n if ($stack->top() > $part) {\n // Decreasing step, e.g. from hundreds to ones\n if ($last >= 1000) {\n // If we drop from more than 1000 then we've finished the phrase\n $sum += $stack->pop();\n // This is the first element of a new phrase\n $stack->push($part);\n } else {\n // Drop down from less than 1000, just addition\n // e.g. \"seventy one\" -> \"70 1\" -> \"70 + 1\"\n $stack->push($stack->pop() + $part);\n }\n } else {\n // Increasing step, e.g ones to hundreds\n $stack->push($stack->pop() * $part);\n }\n } else {\n // This is the first element of a new phrase\n $stack->push($part);\n }\n\n // Store the last processed part\n $last = $part;\n }\n\n return $sum + $stack->pop();\n }",
"function remove_numbers($t){\r\n$vv=\"\";\r\n// eemalda numbrid (näiteks indeks) osa\r\n$ovkomp=split(\" \",$t);\r\nforeach($ovkomp as $komp){\r\n if (!is_numeric($komp))\r\n $vv.=$komp.\" \";\r\n}\r\nreturn trim($vv);\r\n}",
"function filterNumberString($s){\r\n $pattern = \"~[^0-9]~\";\r\n $replacement = \"\";\r\n\r\n return preg_replace($pattern, $replacement, $s); \r\n\r\n}",
"public function sanitizeDigitCommas($str);",
"function convertNumberToWord($num = false)\n {\n $num = str_replace(array(',', ' '), '', trim($num));\n if (!$num) {\n return false;\n }\n $num = (int)$num;\n $words = array();\n $list1 = array(\n '', 'un', 'deux', 'trois', 'quatre', 'cinq', 'six', 'sept', 'huit', 'neuf', 'dix', 'onze',\n 'douze', 'treize', 'quatorze', 'quinze', 'seize', 'dix-sept', 'dix-huit', 'dix-neuf'\n );\n $list2 = array('', 'dix', 'vingt', 'trente', 'quarante', 'cinquante', 'soixante', 'septante', 'quatre-vingts', 'nonante', 'cent');\n $list3 = array(\n '', 'mille', 'million', 'milliard', 'billion', 'quadrillion', 'quintillion', 'sextillion', 'septillion',\n 'octillion', 'nonillion', 'decillion', 'undecillion', 'duodecillion', 'tredecillion', 'quattuordecillion',\n 'quindecillion', 'sexdecillion', 'septendecillion', 'octodecillion', 'novemdecillion', 'vigintillion'\n );\n $num_length = strlen($num);\n $levels = (int)(($num_length + 2) / 3);\n $max_length = $levels * 3;\n $num = substr('00' . $num, -$max_length);\n $num_levels = str_split($num, 3);\n for ($i = 0; $i < count($num_levels); $i++) {\n $levels--;\n $hundreds = (int)($num_levels[$i] / 100);\n $hundreds = ($hundreds ? ' ' . $list1[$hundreds] . ' cent' . ' ' : '');\n $tens = (int)($num_levels[$i] % 100);\n $singles = '';\n if ($tens < 20) {\n $tens = ($tens ? ' ' . $list1[$tens] . ' ' : '');\n } else {\n $tens = (int)($tens / 10);\n $tens = ' ' . $list2[$tens] . ' ';\n $singles = (int)($num_levels[$i] % 10);\n $singles = ' ' . $list1[$singles] . ' ';\n }\n $words[] = $hundreds . $tens . $singles . (($levels && ( int )($num_levels[$i])) ? ' ' . $list3[$levels] . ' ' : '');\n } //end for loop\n $commas = count($words);\n if ($commas > 1) {\n $commas = $commas - 1;\n }\n return implode(' ', $words);\n }",
"function wordfilter($checkstr,$output){\n\n/////////////////////////////////// Regaular Cleaning\n\n$iarray = explode(\",\",$checkstr) ;\n\nforeach($iarray as $i){\n\n$output = eregi_replace(trim($i),' ***** ',$output) ;\n\n}\n/////////////////////////////////////////////////////\n\n////////////////////////////////////// Phonetic Filter\n\n\nforeach($iarray as $i){\n//---------------------------------------------------------------- 1\n$checkz = explode(\" \",$output) ;\n\nforeach($checkz as $c){\n//---------------------------------------------------------------- 2\n\nif(metaphone(trim($c))== metaphone(trim($i))){\n\n$output = eregi_replace($c,' ***** ',$output) ;\n\n}\n\n//---------------------------------------------------------------- 2\n\n}\n//---------------------------------------------------------------- 1\n\n}\n\n//////////////////////////////////////////////////////\nreturn $output ;\n\n}",
"public function testSpellingWithNoNumbers()\n {\n $result = $this->NumbersToWords->spell('Dave is great!');\n $expected = 'Dave is great!';\n\n $this->assertSame($expected, $result);\n }",
"function spellCheck($string)\n{\n\tglobal $silpaspell_module; //the global link to the pspell module\n\t$retVal = \"\";\n\n \t$string = removeMicrosoftWordCharacters($string);\n\n \t//make all the returns in the text look the same\n\t$string = preg_replace(\"/\\r?\\n/\", \"\\n\", $string);\n\n \t//splits the string on any html tags, preserving the tags and putting them in the $words array\n \t$words = preg_split(\"/(<[^<>]*>)/\", $string, -1, PREG_SPLIT_DELIM_CAPTURE);\n\n \t$numResults = count($words); //the number of elements in the array.\n\n\t$misspelledCount = 0;\n\n\t//this loop looks through the words array and splits any lines of text that aren't html tags on space, preserving the spaces.\n\tfor ($i=0; $i<$numResults; $i++) {\n\t\t// Words alternate between real words and html tags, starting with words.\n\t\tif (($i & 1) == 0) { // Even-numbered entries are word sets.\n\n\t\t\t$words[$i] = preg_split(\"/(\\s+)/\", $words[$i], -1, PREG_SPLIT_DELIM_CAPTURE); //then split it on the spaces\n\n\t\t\t// Now go through each word and link up the misspelled ones.\n\t\t\t$numWords = count($words[$i]);\n\t\t\tfor ($j=0; $j<$numWords; $j++) {\n\t\t\t\t#preg_match(\"/[A-Z'0-9]+/i\", $words[$i][$j], $tmp); //get the word that is in the array slot $i\n\t\t\t\tpreg_match(\"/[^,!\\?\\.-]+/i\", $words[$i][$j], $tmp); //get the word that is in the array slot $i\n\t\t\t\t$tmpWord = $tmp[0]; //should only have one element in the array anyway, so it's just assign it to $tmpWord\n\n\t\t\t\t//And we replace the word in the array with the span.\n\t\t\t\tif (!silpaspell_check($silpaspell_module, $tmpWord)) {\n\t\t\t\t\t$words[$i][$j] = str_replace($tmpWord, '<span>' . $tmpWord . '</span>', $words[$i][$j]);\n\t\t\t\t\t$misspelledCount++;\n\t\t\t\t}\n\n\t\t\t\t$words[$i][$j] = str_replace(\"\\n\", \"<br />\", $words[$i][$j]); //replace any breaks with <br />'s, for html display\n\t\t\t}//end for $j\n\t\t} else { //otherwise, we wrap all the html tags in comments to make them not displayed\n\t\t\t$words[$i] = str_replace(\"<\", \"<!--<\", $words[$i]);\n\t\t\t$words[$i] = str_replace(\">\", \">-->\", $words[$i]);\n\t\t}\n\t}//end for $i\n\n\tif ($misspelledCount == 0) {\n\t echo 0;\n\t return;\n\t} else {\n\n \t$words = flattenArray($words); //flatten the array to be one dimensional.\n \t$numResults = count($words); //the number of elements in the array after it's been flattened.\n\n \t$string = \"\"; //return string\n\n \t// Concatenate all the words/tags/etc. back into a string and append it to the result.\n \t$string .= implode('', $words);\n\n \t//remove comments from around all html tags except\n \t//we want the html to be rendered in the div for preview purposes.\n \t$string = preg_replace(\"/<!--<br( [^>]*)?>-->/i\", \"<br />\", $string);\n \t$string = preg_replace(\"/<!--<p( [^>]*)?>-->/i\", \"<p>\", $string);\n \t$string = preg_replace(\"/<!--<\\/p>-->/i\", \"</p>\", $string);\n \t$string = preg_replace(\"/<!--<b( [^>]*)?>-->/i\", \"<b>\", $string);\n \t$string = preg_replace(\"/<!--<\\/b>-->/i\", \"</b>\", $string);\n \t$string = preg_replace(\"/<!--<strong( [^>]*)?>-->/i\", \"<strong>\", $string);\n \t$string = preg_replace(\"/<!--<\\/strong>-->/i\", \"</strong>\", $string);\n \t$string = preg_replace(\"/<!--<i( [^>]*)?>-->/i\", \"<i>\", $string);\n \t$string = preg_replace(\"/<!--<\\/i>-->/i\", \"</i>\", $string);\n \t$string = preg_replace(\"/<!--<small( [^>]*)?>-->/i\", \"<small>\", $string);\n \t$string = preg_replace(\"/<!--<\\/small>-->/i\", \"</small>\", $string);\n \t$string = preg_replace(\"/<!--<ul( [^>]*)?>-->/i\", \"<ul>\", $string);\n \t$string = preg_replace(\"/<!--<\\/ul>-->/i\", \"</ul>\", $string);\n \t$string = preg_replace(\"/<!--<li( [^>]*)?>-->/i\", \"<li>\", $string);\n \t$string = preg_replace(\"/<!--<\\/li>-->/i\", \"</li>\", $string);\n \t$string = preg_replace(\"/<!--<img (?:[^>]+ )?src=\\\"?([^\\\"]*)\\\"?[^>]*>-->/i\", \"<img src=\\\"\\\\1\\\" />\", $string);\n \t$string = preg_replace(\"/<!--<a (?:[^>]+ )?href=\\\"?([^\\\"]*)\\\"?[^>]*>-->/i\", \"<a href=\\\"\\\\1\\\" />\", $string);\n \t$string = preg_replace(\"/<!--<\\/a>-->/i\", \"</a>\", $string);\n\n \techo $string; //return value - string containing all the markup for the misspelled words.\n \treturn;\n\t}\n\n}",
"function strip_numbers ($text){\n\t\t$Stripped = eregi_replace(\"([0-9]+)\", \"\", $text);\n\t\treturn ($Stripped);\n\t}",
"function alpha_dash_space_utf8_numbers($str) {\r\n return (!preg_match(\"/^([a-zñáéíóúÑÁÉÍÓÚ\\-\\_\\.\\, 0-9])+$/i\", $str)) ? FALSE : TRUE;\r\n }",
"function soundex ($str) {}",
"private static function onlyNumbers($str)\n {\n return preg_replace(\"/[^0-9]/\", \"\", $str);\n }",
"function flu_english_num($number)\n{\n\treturn dindex(array(\n 1 => 'one', 'two', 'three', 'four', 'five',\n 'six', 'seven', 'eight', 'nine', 'ten'\n ), (int)$number, (string)$number);\n}",
"function alpha_dash_space_period_utf8_numbers($str) {\n return (!preg_match(\"/^([a-zñáéíóúÑÁÉÍÓÚüÜ0-9\\. \\-\\_])+$/i\", $str)) ? FALSE : TRUE;\n }",
"function removeNumbersWithDashes($text)\n{\n $tags = detectNumbersWithDashes($text);\n if(!empty($tags)) {\n foreach($tags AS $key => $value) {\n $text = str_ireplace($value, '', $text);\n }\n }\n\n return trim($text);\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets a NumberFormat object for displaying numbers and currencies. | public function getNumberFormat() : NumberFormat {
return $this->numberFormat;
} | [
"protected function get_number_formatter()\n\t{\n\t\treturn new NumberFormatter($this);\n\t}",
"private function getNumberFormatter()\n {\n if ($this->numberFormatter) {\n return $this->numberFormatter;\n }\n\n return $this->numberFormatter = NumberFormatter::create($this->locale, NumberFormatter::DECIMAL);\n }",
"public function getNumberFormat();",
"protected function getNumberFormatter()\n {\n $formatter = new \\NumberFormatter($this->locale, \\NumberFormatter::DECIMAL);\n\n if (null !== $this->precision) {\n $formatter->setAttribute(\\NumberFormatter::FRACTION_DIGITS, $this->precision);\n $formatter->setAttribute(\\NumberFormatter::ROUNDING_MODE, $this->roundingMode);\n }\n\n $formatter->setAttribute(\\NumberFormatter::GROUPING_USED, $this->grouping);\n\n return $formatter;\n }",
"public static function getDecimalFormat()\n {\n $format = craft()->locale->getDecimalFormat();\n\n $yiiToD3Formats = array(\n '#,##,##0.###' => ',.3f',\n '#,##0.###' => ',.3f',\n '#0.######' => '.6f',\n '#0.###;#0.###-' => '.3f',\n '0 mil' => ',.3f',\n );\n\n if(isset($yiiToD3Formats[$format]))\n {\n return $yiiToD3Formats[$format];\n }\n }",
"function formatCurrency($n, $locale);",
"public function getFormat(): string\n {\n if ($this->number instanceof Decimal) {\n return Format::FORMAT_DECIMAL;\n }\n\n if ($this->number instanceof Hexadecimal) {\n return Format::FORMAT_HEXADECIMAL;\n }\n\n return Format::FORMAT_BINARY;\n }",
"public function getPayerNumberFormatter()\n {\n if (!isset($this->payerNumberFormatter)) {\n $this->payerNumberFormatter = new Formatter\\PayerNumberFormatter;\n }\n\n return $this->payerNumberFormatter;\n }",
"public static function formattedCurrencyProvider()\n {\n return [\n ['en', 'USD', '$500,100.05', '500100.05'],\n ['en', 'USD', '-$1,059.59', '-1059.59'],\n ['en', 'USD', '($1,059.59)', '-1059.59'],\n ['bn', 'BND', '৫,০০,১০০.০৫BND', '500100.05'],\n ];\n }",
"public function getCurrencyFormats()\n {\n $formats = array();\n $storeId = $this->getRequest()->getParam('store');\n /** @var Mage_Core_Model_Store[] $stores */\n if (!empty($storeId)) {\n $stores = array(Mage::app()->getStore($storeId));\n } else {\n $stores = Mage::app()->getStores();\n }\n foreach ($stores as $store) {\n $formats[$store->getName()] = array();\n $currencyCodes = $store->getAvailableCurrencyCodes(true);\n if (is_array($currencyCodes) && count($currencyCodes) > 0) {\n $locale = $store->getConfig('general/locale/code');\n foreach ($currencyCodes as $currencyCode) {\n try {\n $formats[$store->getName()][] = new Zend_Currency($currencyCode, $locale);\n } catch (Zend_Exception $e) {\n continue;\n }\n }\n }\n }\n return $formats;\n }",
"public function format()\n {\n return $this->currency->symbol . number_format($this->value, $this->currency->decimal_digits, $this->currency->decimal_separator, $this->currency->thousands_separator);\n }",
"public function numberFormatDataProvider() {}",
"public function formatCurrency($number, $currency) {}",
"public function getCurrencyConverter();",
"public function providerNumberFormat()\n {\n return [\n [1024, \"1,024\"],\n [1024.23, \"1,024.23\"],\n [100.23, \"100.23\"],\n [\"test\", \"0\"]\n ];\n }",
"public function getFormat()\r\n\t{\r\n\t\treturn $this->originalFormatString;\r\n\t}",
"function numfmt_create($locale, $style, $pattern){}",
"public static function getNumberFormats()\n\t{\n\t\t$possibleFormats = array();\n\n\t\t// loop available formats\n\t\tforeach((array) self::getModuleSetting('core', 'number_formats') as $format => $example)\n\t\t{\n\t\t\t// reformat array\n\t\t\t$possibleFormats[$format] = $example;\n\t\t}\n\n\t\treturn $possibleFormats;\n\t}",
"public function setNumberFormat($val)\n {\n $this->_propDict[\"numberFormat\"] = $val;\n return $this;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
[getExchCountBySale description] get exchange count by saleId | public function getExchCountBySale($saleId,$countType){
$sql = 'select '.$countType.' as c from '.$this->tableName.' where saleId = '.$saleId;
$res = Yii::app()->db->createCommand($sql)->queryAll();
return $res[0]['c'];
} | [
"public function getSalesAccountCount();",
"public function getJoinCountBySale($saleId,$countType){\r\n\t\t$sql = 'select '.$countType.' as c from '.$this->tableName.' where saleId='.$saleId;\r\n\t\t$res = Yii::app()->db->createCommand($sql)->queryAll(); \r\n return $res[0]['c'];\r\n\t}",
"public function saleCount()\n {\n $sales = Sale::where('user_id', Auth::id())->count();\n\n // Returning success API response.\n return $this->success($sales, 'Sales was counted sucessfully.');\n }",
"public function getSalesCount()\n {\n return $this->salesCount;\n }",
"function countSales(){\n\t\ttry{\n\t\t\t$data = array();\n\t\t\t$stmt = $this->connection->prepare(\"select count(*) from products where not SalePrice = 0\");\n\t\t\t$stmt->execute();\n\t\t\t$stmt->store_result();\n\t\t\t$stmt->bind_result($count);\n\t\t\tif ($stmt->num_rows > 0) { //output when there is a count\n\t\t\t\twhile($row = $stmt->fetch()){ //fetch count\n\t\t\t\t\t$data[] = array(\n\t\t\t\t\t\t\t\t'count'=>$count,\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn $data;\n\t\t}catch(Exception $e){\n\t\t\techo $e->getMessage();\n\t\t\tdie();\n\t\t}\n\t}",
"public function getPurchaseOrderCount();",
"public function RetrieveMoneyEarnedSales() \n {\n $revenue = 0;\n \n foreach ($this->data as $log) {\n $revenue += $log['earnedSales'];\n }\n \n return $revenue;\n }",
"function getNumberOfSaleItems() {\n\t\tif($stmt = $this->connection->prepare(\"select salePrice from products;\")) {\n\t\t\t\t$stmt -> execute();\n\t\t\t\t$stmt->store_result();\n\t\t\t\t$stmt->bind_result($salePrice);\n\n\t\t\t\tif($stmt ->num_rows >0){\n\t\t\t\t\twhile($stmt->fetch() ){\n\t\t\t\t\t\t$saleData[] = array(\n\t\t\t\t\t\t\t'salePrice' => $salePrice\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$salePrice = array_filter($saleData);\n\t\t\t\t$numberOfSaleItems = sizeof($salePrice);\n\t\t}\n\t\treturn $numberOfSaleItems;\n\t}",
"public function getCountAction()\n {\n $shopId = (int) $this->Request()->getParam('shopId', 1);\n @set_time_limit(1200);\n $category = $this->SeoIndex()->countCategories($shopId);\n $article = $this->SeoIndex()->countArticles($shopId);\n $blog = $this->SeoIndex()->countBlogs($shopId);\n $emotion = $this->SeoIndex()->countEmotions();\n $content = $this->SeoIndex()->countContent($shopId);\n $static = $this->SeoIndex()->countStatic($shopId);\n $supplier = $this->SeoIndex()->countSuppliers($shopId);\n\n $counts = [\n 'category' => $category,\n 'article' => $article,\n 'blog' => $blog,\n 'emotion' => $emotion,\n 'static' => $static,\n 'content' => $content,\n 'supplier' => $supplier,\n 'contentType' => $this->SeoIndex()->countContentTypes(),\n ];\n\n $counts = $this->get('events')->filter(\n 'Shopware_Controllers_Seo_filterCounts',\n $counts,\n ['shopId' => $shopId]\n );\n\n $this->View()->assign([\n 'success' => true,\n 'data' => ['counts' => $counts],\n ]);\n }",
"function count_current_sales()\n\t{\n\t\t$query = $this->db->query(\"select salesId\n\t\t\t\t\t\t from sales\n\t\t\t\t\t\t left join customers\n\t\t\t\t\t\t on customers.customer_number=sales.customerNumber\n\t\t\t\t\t\t where saleStatus = 'OPEN' or saleStatus = 'PAID'\");\n\t\t$rows = $query->num_rows();\n\t\treturn $rows;\n\t}",
"public function get_total_waiter_type_items($sale_id)\n {\n $this->db->select('id');\n $this->db->from('tbl_sales_details');\n $this->db->where(\"sales_id\", $sale_id);\n $this->db->where(\"item_type\", \"Waiter Item\");\n return $this->db->get()->num_rows();\n }",
"public function getExpensesCount($where)\r\n {\r\n return $this->dbService->getObjectCount($where, 'Expense');\r\n }",
"public function totalSalePerSnack(){\n $orders = Order::select(DB::raw('sum(price) as Total_Sale, snack_id'))\n ->where('status', 'SUCCESS')\n ->groupBy('snack_id')\n ->orderBy(DB::raw('count(snack_id)'),'acs')\n ->get();\n\n return $this->addSnackNameToCollection($orders, 'Total_Sale');\n\n }",
"public function counterOfferById($sellerId, $offerId, $offerAmount, $comment);",
"public function get_sales_by_account($account_id){\n\t\t$query_result=$this->db->query(\"select count(psb_id) jumlah from new_psb where account_id='\".$account_id.\"'\");\n\t\t$result=$query_result->row();\n\t\treturn $result;\n\t}",
"public function getAction() {\n\t\t$id = array_filter(filter_var_array(explode(',', $this->_request->getParam('id')), FILTER_VALIDATE_INT));\n\t\tif (is_array($id) && !empty($id)){\n\t\t\treturn Models_Mapper_ProductMapper::getInstance()->fetchProductSalesCount($id);\n\t\t}\n\t}",
"public static function getDiscountSale()\n\t{\n\t\t$exist_account = Tbl_chart_of_account::where(\"account_shop_id\", Accounting::getShopId())->where(\"account_code\", \"discount-sale\")->first();\n if(!$exist_account)\n {\n $insert[\"account_shop_id\"] = Accounting::getShopId();\n $insert[\"account_type_id\"] = 11;\n $insert[\"account_number\"] = \"00000\";\n $insert[\"account_name\"] = \"Sale Discount\";\n $insert[\"account_description\"] = \"Sale Discount\";\n $insert[\"account_protected\"] = 1;\n $insert[\"account_code\"] = \"discount-sale\";\n \n return Tbl_chart_of_account::insertGetId($insert);\n }\n\n return $exist_account->account_id;\n\t}",
"public function getDeliveryCount($orderId);",
"public function getId_sales()\n {\n return $this->id_sales;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the commit stats for this transaction. Commit stats are only available after commit has been called with `return_commit_stats` => true. If commit is called multiple times, only the commitStats for the last commit will be available. Example: ``` $transaction>commit(["returnCommitStats" => true]); $commitStats = $transaction>getCommitStats(); ``` | public function getCommitStats()
{
return $this->commitStats;
} | [
"public function getCommitTs()\n {\n return $this->commit_ts;\n }",
"public function getCommitCount() {\n\n $apiUrl = $this->getGitApis('contributors');\n\t\tif($this->getOptions()['comments'] != null){\n\t\t\t $apiUrl = $this->getGitApis('commit_activity'); \n\t\t}\n\t\t$url = strtr($apiUrl,\n array(\n ':repository' => substr($this->getOptions('path'), 1)\n ));\n\t\t//echo $url;exit;\n $output = $this->executeCurl($url, $this->getOptions());\n\n $formattedResponse = $this->parseResponse($output,\n $this->getOptions('dataType'));\n\n $contributors = array();\n\n if (count($formattedResponse) > 0) {\n foreach ($formattedResponse as $contributor) {\n\t\t\t\t#print_r($contributor);exit;\n\t\t\t\tif(isset($contributor['contributions'])){\n\t\t\t\t\t$contributors[$contributor['login']] = $contributor['contributions'];\n\t\t\t\t}elseif(isset($contributor['author']['login'])){\n\t\t\t\t\t$contributors[$contributor['author']['login']] = 'Total Project: '.$contributor['total'].' Totals comments: '.$contributor['weeks'][0]['d'];\n\t\t\t\t}else{\n\t\t\t\t\t$contributors[$this->getOptions()['username']] = 'Total commits:'.$contributor['total'];\n\t\t\t\t}\n }\n }\n \n $contributorName = $this->getOptions('contributorName');\n if (!empty($contributorName)) {\n\t\t\t#print_R($contributors);exit;\n return array($contributorName => $contributors[$contributorName]);\n }\n\n return $contributors;\n }",
"function getCommitStats($commits){\n $avg_length = 1;\n $date_tuple = array();\n $commit_intervals = array(0);\n foreach ($commits as $c) {\n $avg_length += strlen($c[\"commit\"][\"message\"]);\n $date_tuple[] = $c[\"commit\"][\"committer\"][\"date\"];\n if(count($date_tuple) == 2){\n // Compare two commit dates and remove the oldest\n $d1 = new DateTime(array_shift($date_tuple));\n $d2 = new DateTime($date_tuple[0]);\n $commit_intervals[] = intval($d1->diff($d2)->format(\"%d\")); // Subtract older (d1) from newer (d1) commit\n }\n\n }\n $avg_length = round($avg_length / max(1, count($commits))); \n return array(\"avg_commit_length\" => $avg_length, \"commit_interval_avg\" => round(array_sum($commit_intervals) / count($commit_intervals)), \"commit_interval_max\" => max($commit_intervals));\n }",
"public function GetCommit()\n\t{\n\t\treturn $this->commit;\n\t}",
"public function getCommitCount();",
"public function getCommitTime()\n {\n return $this->commit_time;\n }",
"public function getCommitTimestamps()\n {\n return $this->commit_timestamps;\n }",
"public function getCommitTimestamp()\n {\n return $this->commit_timestamp;\n }",
"private function getGitCommit()\n {\n return $this->getCachedOrShellExecute(\n $this->makeGitHashRetrieverCommand(),\n static::VERSION_CACHE_KEY,\n $this->config('build.length')\n );\n }",
"public function getCommitCount() {\n\n $apiUrl = $this->getBitbucketApis('commits');\n\n $url = strtr($apiUrl, array(\n ':repository' => substr($this->getInputs('path'), 1)\n ));\n\n $output = $this->executeRequest($url, $this->getInputs());\n\n $formattedResponse = $this->parseResponse($output, $this->getInputs('dataType'));\n\n $contributors = array();\n\n if (count($formattedResponse) > 0) {\n\n foreach ($formattedResponse['values'] as $contributor) {\n\n $userName = isset($contributor['author']['user']['username']) ? $contributor['author']['user']['username'] : '';\n if (!empty($userName)) {\n if (array_key_exists($userName, $contributors)) {\n $contributors[$userName] += 1;\n } else {\n $contributors[$userName] = 1;\n }\n }\n }\n }\n\n $contributorName = $this->getInputs('contributorName');\n\n if (!empty($contributorName)) {\n $totalCount = isset($contributors[$contributorName]) ? $contributors[$contributorName] : 0;\n return array($contributorName => $totalCount);\n }\n\n return $contributors;\n }",
"public function GetCommit()\n\t{\n\t\treturn $this->GetProject()->GetCommit($this->commitHash);\n\t}",
"public function getCommitHash()\n {\n return $this->commitHash;\n }",
"public function getCommitPosition()\n {\n return $this->get(self::COMMIT_POSITION);\n }",
"function git_last_commit($reset = FALSE) {\n return _git_describe('commit');\n}",
"public function getCommit()\n {\n return $this->tag->getCommit();\n }",
"public function getLastCommitPosition()\n {\n return $this->last_commit_position;\n }",
"public function getLastCallStats()\n {\n return $this->lastCallStats;\n }",
"public function getGithubGeneralStats() {\n $dataArray = array('total_repos' => 0, 'total_commits' => 0);\n\n $totalReposQuery = \"SELECT COUNT(*) FROM github_repos\";\n $result = $this->connection->query($totalReposQuery);\n $result = $result->fetchAll(PDO::FETCH_ASSOC)[0]['COUNT(*)'];\n $dataArray['total_repos'] = (isset($result) && is_numeric($result)) ? $result : 0;\n\n $totalCommitsQuery = \"SELECT SUM(commits) FROM github_repos\";\n $result = $this->connection->query($totalCommitsQuery);\n $result = $result->fetchAll(PDO::FETCH_ASSOC)[0]['SUM(commits)'];\n $dataArray['total_commits'] = (isset($result) && is_numeric($result)) ? $result : 0;\n\n return $dataArray;\n }",
"public function getCommitType()\n {\n return $this->commitType;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Move up the position of one link on the menu | public static function setMenuUpPosition($id) {
global $db, $database;
$linktodown = $db->query('SELECT * FROM '.$database['tbl_prefix'].'dev_menus WHERE id = ?', DBDriver::AARRAY, array($id));
$position1 = $linktodown['position'] - 1;
$link = $db->query('SELECT id FROM '.$database['tbl_prefix'].'dev_menus WHERE type = ? AND position = ?', DBDriver::AARRAY, array($linktodown['type'], $position1));
$db->query('UPDATE '.$database['tbl_prefix'].'dev_menus SET position = ? WHERE id = ?', DBDriver::QUERY, array($linktodown['position'], $link['id']));
$db->query('UPDATE '.$database['tbl_prefix'].'dev_menus SET position = ? WHERE id = ?', DBDriver::QUERY, array($position1, $id));
} | [
"function moveItemUp()\n\t{\n\t\t$li =& $this->getNode();\n\t\t$prev =& $li->previous_sibling();\n\t\t$li_copy = $li->clone_node(true);\n\t\t$li_copy =& $prev->insert_before($li_copy, $prev);\n\t\t$li->unlink($li);\n\t}",
"public function moveUp() {\n $this->moveTo($this->position - 1);\n }",
"public function moveUp() {\n\t\t$this->owner->setPosition($this->owner->{$this->positionFiled} - 1);\n\t}",
"function moveUp()\r\n {\r\n $db =& eZDB::globalDatabase();\r\n $db->query_single( $qry, \"SELECT ID, Placement FROM eZLink_Attribute\r\n WHERE Placement<'$this->Placement' ORDER BY Placement DESC\",\r\n array( \"Limit\" => 1 ) );\r\n $listorder = $qry[ $db->fieldName( \"Placement\" ) ];\r\n $listid = $qry[ $db->fieldName( \"ID\" ) ];\r\n $db->begin();\r\n $db->lock( \"eZLink_Attribute\" );\r\n $res[] = $db->query( \"UPDATE eZLink_Attribute SET Placement='$listorder' WHERE ID='$this->ID'\" );\r\n $res[] = $db->query( \"UPDATE eZLink_Attribute SET Placement='$this->Placement' WHERE ID='$listid'\" );\r\n $db->unlock();\r\n\r\n if ( in_array( false, $res ) )\r\n $db->rollback();\r\n else\r\n $db->commit();\r\n }",
"public function moveUp()\n {\n $this->reorder(-1);\n }",
"public function move_up($item_id);",
"function moveItemDown()\r\n\t{\r\n\t\t$this->content_obj->moveItemDown();\r\n\t\t$_SESSION[\"il_pg_error\"] = $this->pg_obj->update();\r\n\t\t$this->ctrl->returnToParent($this, \"jump\".$this->hier_id);\r\n\t}",
"public function move_up () {\n\t\tif (!$this->can_move_up())\n\t\t\treturn false;\n\t\t$storage = Storage::getInstance();\n\n\t\t$node = $this->get_previous_ancestor();\n\t\t$this->sort--; $node->sort++;\n\t\t$storage->save($this); $storage->save($node);\n\t}",
"public function sorterMoveUp() {\r\n\t\t$this->sorterMove(true);\r\n\t}",
"function videoresource_item_move_up($item) {\n return move_item($item, 'up');\n}",
"public static function menuPosition()\n {\n return 40;\n }",
"function moveItemDown()\n\t{\n\t\t$li =& $this->getNode();\n\t\t$next =& $li->next_sibling();\n\t\t$next_copy = $next->clone_node(true);\n\t\t$next_copy =& $li->insert_before($next_copy, $li);\n\t\t$next->unlink($next);\n\t}",
"public static function menuPosition()\n {\n return 20;\n }",
"function movePageDown ($page) {\n\t\t$pagesTableName = $this->_db->getPrefix ().'pages';\n\t\t$placeInMenu = $page->getPlaceInMenu ();\n\t\t$parentPage = $page->getParentPage ();\n\t\tif ($placeInMenu == $parentPage->getMaxPlaceInMenu ()-1) {\n\t\t\treturn;\n\t\t}\n\t\t$ppID = $page->getParentPageID ();\n\t\t$sql = \"UPDATE $pagesTableName SET place_in_menu=(place_in_menu)-1 \n\t\t\tWHERE place_in_menu=($placeInMenu)+1 AND place_in_menu!=\".MORGOS_MENU_FIRST \n\t\t\t.\" AND place_in_menu!=\".MORGOS_MENU_LAST \n\t\t\t.\" AND place_in_menu!=\".MORGOS_MENU_INVISIBLE.\" AND parent_page_id='$ppID'\";\n\t\t$a = $this->_db->query ($sql);\n\t\tif (isError ($a)) {\n\t\t\treturn $a;\n\t\t}\n\t\t\n\t\t$sql = 'UPDATE '.$pagesTableName.' SET place_in_menu=(place_in_menu)+1 \n\t\t\tWHERE page_id=\\''.$page->getID ().'\\' AND place_in_menu!='.MORGOS_MENU_FIRST\n\t\t\t.\" AND place_in_menu!=\".MORGOS_MENU_LAST\n\t\t\t.\" AND place_in_menu!=\".MORGOS_MENU_INVISIBLE;\n\t\t$a = $this->_db->query ($sql);\n\t\tif (isError ($a)) {\n\t\t\treturn $a;\n\t\t}\n\t}",
"function moveUp()\n {\n \n $db =& eZDB::globalDatabase();\n $db->query_single( $qry, \"SELECT ID, ListOrder FROM eZAddress_AddressType\n WHERE Removed=0 AND ListOrder<'$this->ListOrder' ORDER BY ListOrder DESC\", array( \"Limit\" => \"1\" ) );\n $listorder = $qry[ $db->fieldName( \"ListOrder\" ) ];\n $listid = $qry[ $db->fieldName( \"ID\" ) ];\n\n $db->begin();\n $res[] = $db->query( \"UPDATE eZAddress_AddressType SET ListOrder='$listorder' WHERE ID='$this->ID'\" );\n $res[] = $db->query( \"UPDATE eZAddress_AddressType SET ListOrder='$this->ListOrder' WHERE ID='$listid'\" );\n eZDB::finish( $res, $db );\n }",
"function pagemenu_move_link($pagemenu, $linkid, $after) {\n\tglobal $DB;\n\t\n $link = new stdClass;\n $link->id = $linkid;\n\n // Remove the link from where it was (Critical: this first!)\n pagemenu_remove_link_from_ordering($link->id);\n\n if ($after == 0) {\n // Adding to front - get the first link\n if (!$firstid = pagemenu_get_first_linkid($pagemenu->id)) {\n print_error('errorfirstlinkid', 'pagemenu');\n }\n // Point the first link back to our new front link\n if (!$DB->set_field('pagemenu_links', 'previd', $link->id, array('id' => $firstid))) {\n print_error('errorlinkorderupdate', 'pagemenu');\n }\n // Set prev/next\n $link->nextid = $firstid;\n $link->previd = 0;\n } else {\n // Get the after link\n if (!$after = $DB->get_record('pagemenu_links', array('id' => $after))) {\n print_error('errorlinkid', 'magemenu');\n }\n // Point the after link to our new link\n if (!$DB->set_field('pagemenu_links', 'nextid', $link->id, array('id' => $after->id))) {\n print_error('errorlinkorderupdate', 'pagemenu');\n }\n // Set the next link in the ordering to look back correctly\n if ($after->nextid) {\n if (!$DB->set_field('pagemenu_links', 'previd', $link->id, array('id' => $after->nextid))) {\n print_error('errorlinkorderupdate', 'pagemenu');\n }\n }\n // Set next/prev\n $link->previd = $after->id;\n $link->nextid = $after->nextid;\n }\n\n if (!$DB->update_record('pagemenu_links', $link)) {\n print_error('errorlinkupdate', 'pagemenu');\n }\n\n return true;\n}",
"public static function setMenuDownPosition($id) {\n global $db, $database;\n\n\t\t$linktodown = $db->query('SELECT * FROM '.$database['tbl_prefix'].'dev_menus WHERE id = ?', DBDriver::AARRAY, array($id));\n $position1 = $linktodown['position'] + 1;\n $link = $db->query('SELECT id FROM '.$database['tbl_prefix'].'dev_menus WHERE type = ? AND position = ?', DBDriver::AARRAY, array($linktodown['type'], $position1));\n $db->query('UPDATE '.$database['tbl_prefix'].'dev_menus SET position = ? WHERE id = ?', DBDriver::QUERY, array($linktodown['position'], $link['id']));\n $db->query('UPDATE '.$database['tbl_prefix'].'dev_menus SET position = ? WHERE id = ?', DBDriver::QUERY, array($position1, $id));\n }",
"public static function menuPosition()\n {\n return 10;\n }",
"function down_menu( $user_id=NULL, $module_id=NULL, $display=NULL, $start=NULL, $sort=NULL, $level, $move )\n {\n if( $module_id ) $this->module_id = $module_id;\n if( $user_id ) $this->user_id = $user_id;\n if( $display ) $this->display = $display;\n if( $sort ) $this->sort = $sort;\n if( $start ) $this->start = $start;\n\n $q=\"select * from \".TblSysMenuAdm.\" where level='$level' AND move='$move'\";\n $res = $this->Right->Query( $q, $this->user_id, $this->module_id );\n if( !$res )return false;\n\n $rows = $this->Right->db_GetNumRows();\n $row = $this->Right->db_FetchAssoc();\n $move_up = $row['move'];\n $id_up = $row['id'];\n\n\n $q=\"select * from \".TblSysMenuAdm.\" where level='$level' AND move>'$move' order by move\";\n $res = $this->Right->Query( $q, $this->user_id, $this->module_id );\n if( !$res )return false;\n\n $rows = $this->Right->db_GetNumRows();\n $row = $this->Right->db_FetchAssoc();\n $move_down = $row['move'];\n $id_down = $row['id'];\n\n $q=\"update \".TblSysMenuAdm.\" set\n move='$move_down' where id='$id_up'\";\n $res = $this->Right->Query( $q, $this->user_id, $this->module_id );\n\n $q=\"update \".TblSysMenuAdm.\" set\n move='$move_up' where id='$id_down'\";\n $res = $this->Right->Query( $q, $this->user_id, $this->module_id );\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Tests ONGRFilterManagerExtension exception When filter factory is not loaded | public function testNoFactoryException()
{
$container = new ContainerBuilder();
$extension = new ONGRFilterManagerExtension();
$config = ['ongr_filter_manager'=>[
'filters' => [
'pager' => [
'pager' => [
'relations' => [],
'request_field' => 'page',
'count_per_page' => 10,
'max_pages' => 8
]
]
]
]];
$extension->load($config, $container);
} | [
"public function testNoFilterDefined() {\n $this->expectException('\\\\Phloem\\\\Exception\\\\FilterFactoryException');\n\n $this->factory->getFilter('unknown');\n }",
"abstract protected function getFilterManager();",
"public function testComAdobeGraniteApicontrollerFilterResolverHookFactory() {\n\n }",
"abstract protected function getFilterFactory();",
"public function testGetConfigForNoExistingFilter()\n {\n $filter = new TextFilter();\n $filter->getFilterConfig(\"no-such-filter\", []);\n }",
"public function testInvalidFilter()\n {\n $filter = new LdapFilter(array(), \"test\");\n }",
"public function testInexistentFilter()\n\t{\n\t\t$this->setExpectedException('Jyxo_Input_Exception');\n\t\t$this->factory->getFilterByName('foo');\n\t}",
"public function test_external_filter_detection() {\n $files = block_filtered_course_list_lib::get_filter_files();\n $this->assertCount(1, $files);\n $this->assertEquals('fcl_filter.php', $files[0]->getFilename());\n require_once($files[0]->getPathname());\n $classes = block_filtered_course_list_lib::get_filter_classes();\n $this->assertCount(1, $classes);\n $this->assertEquals('test_fcl_filter', reset($classes));\n }",
"protected function wrongFilterTest()\n {\n $task = $this->getTask('copy_task', [\n 'sources' => [],\n 'destinations' => [],\n 'filters' => [\n 'copy'\n ],\n ]);\n $copyFilter = $this\n ->getMockBuilder(CopyFilter::class)\n ->disableOriginalConstructor()\n ->getMock();\n $filters['copy'] = $copyFilter;\n $taskRunner = $this->getTaskRunner($filters);\n $this->assertExceptionThrown(function() use ($task, $taskRunner) {\n $taskRunner->run($task);\n }, 'No supported extensions found for the filter ');\n }",
"public function testIsNotificationFilterSet()\n {\n }",
"function yoast_wpseo_missing_filter_notice() {\n\t$message = esc_html__( 'The filter extension seem to be unavailable. Please ask your web host to enable it.', 'wordpress-seo' );\n\tyoast_wpseo_activation_failed_notice( $message );\n}",
"protected function getFilterFactory()\r\n {\r\n // TODO: Implement getFilterFactory() method.\r\n }",
"public function testComAdobeCqSecurityHcBundlesImplWcmFilterHealthCheck() {\n\n }",
"public function test_filters_automatic_updater_disabled()\n {\n }",
"public function testFilter() {\n\n\t\t$filter = SlackFactory::filter();\n\n\t\t$this->assertInstanceOf('HybridLogic\\Slack\\SlashFilter', $filter);\n\n\t}",
"protected function register_filters() {}",
"protected function resolveFilter(){ }",
"protected abstract function init_filters();",
"public function testInvalidFilterThrowsException(): void\n {\n $this->expectException(ORMException::class);\n\n $this->getEntityManager()->getFilters()->enable('invalid');\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
initialize view add some global vars to view | public function initializeView()
{
$this->view->assign('extConf', ObjectAccess::getGettableProperties($this->extConf));
$this->view->assign('id', $GLOBALS['TSFE']->id);
$this->view->assign('data', $this->configurationManager->getContentObject()->data);
} | [
"public function initializeView() {\n\t\t$this->view->assign('extConf', ObjectAccess::getGettableProperties($this->extConf));\n\t\t$this->view->assign('id', $GLOBALS['TSFE']->id);\n\t}",
"protected function _initBasicViewVariables()\n {\n //Add base url to view\n $this->view->setVar('_baseUri', BASE_URI);\n $this->view->setVar('_siteName', $this->config->website->siteName);\n $this->view->setVar('_currentUri', $_SERVER['REQUEST_URI']);\n\n //Get template default\n $this->_defaultTemplate = $this->di->get(\"config\")->frontendTemplate->defaultTemplate;\n\n //Add template default to view\n $this->view->setVar(\"_defaultTemplate\", $this->_defaultTemplate);\n\n $this->view->setVar('_user', $this->session->get('auth'));\n }",
"protected function initializeView() {}",
"public function initializeView() {}",
"public function initializeView() {\n\t}",
"public function initView()\n\t{\n\t\t$this->view = new Opt_View;\n\t}",
"public function initializeView() {\n\t\t\t$this->view->assign('loggedIn', FALSE);\n\t\t\tif (!empty($this->frontendUser)) {\n\t\t\t\t$this->view->assign('loggedIn', TRUE);\n\t\t\t\t$this->view->assign('userName', $this->frontendUser['username']);\n\t\t\t\t$this->view->assign('userId', $this->frontendUser['uid']);\n\t\t\t}\n\t\t}",
"protected function initializeView()\n\t{\n\t\t$this->passedActionMethodNames[ $this->actionMethodName ] = TRUE;\n\t\t\n\t\t$this->storeSessionData();\n \n\t}",
"private function setDefaultViewVars()\n {\n $this->extKey = 'Tp3ratings';\n //$this->layout = $this->settings[\"layout\"] ? $this->settings[\"layout\"] : \"style05\";\n //$this->cObj = GeneralUtility::makeInstance(TYPO3\\\\CMS\\\\Frontend\\\\ContentObject\\\\ContentObjectRenderer);\n $this->pageRenderer = \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::makeInstance('TYPO3\\\\CMS\\\\Core\\\\Page\\\\PageRenderer');\n //$this->view->assign('cObjData', $cObjData);\n }",
"public function setViewProperties() {\n\t\t$this->view->controller = Zend_Controller_Front::getInstance()->getRequest()->getControllerName();\n\t\t$this->view->action = Zend_Controller_Front::getInstance()->getRequest()->getActionName();\n\t\t$this->view->translator = $this->translator;\n\t\t$this->view->version = $this->config->app->version;\n\t}",
"protected function _initViewSettings()\n {\n \t$this->bootstrap('view');\r\n \t$this->_view = $this->getResource('view');\n \t\n Zend_Dojo::enableView($this->_view);\n Zend_Dojo_View_Helper_Dojo::setUseDeclarative();\n\n $this->_view->headTitle('BBA Power')->setSeparator(' - ');\n }",
"protected function initializeDefaultComponentsInView() {\n\t\t$this->view->assign('searchWordFilter', $this->solrExtlistContext->getSearchWordFilter());\n\t\t$this->view->assign('resultList', $this->solrExtlistContext->getRenderedListData());\n\t\t$this->view->assign('pager', $this->solrExtlistContext->getPager('delta'));\n\t\t$this->view->assign('pagerCollection', $this->solrExtlistContext->getPagerCollection());\n\t\t$this->view->assign('searchResultInformation', new Tx_PtSolr_Domain_SearchResultInformation($this->solrExtlistContext->getDataBackend()));\n\t\t$this->view->assign('solrExtlistContext', $this->solrExtlistContext);\n\t}",
"function __initVars()\n {\n $eventfeatures = $this->Event->Eventfeature->find('list');\n $this->set('buttonlist', $this->Access->getAccess('eventViewAll', 'l'));\n $this->set('phonetype', $this->phonetype);\n $this->set('venueactivities', $this->Venue->Venueactivity->find('list'));\n $venuetypes = $this->Venue->Venuetype->find('list');\n $countries_states = $this->Venue->Address->setCountryStates();\n $this->set('countries', $countries_states['countries']);\n $this->set('states', $countries_states['states']);\n $timeZones = $this->Event->Timezone->find('list');\n $this->set(compact('eventfeatures', 'timeZones', 'venuetypes'));\n\n }",
"public function init()\n {\n $this->getBootstrap()->bootstrap('view');\n $this->_view = $this->getBootstrap()->getResource('view');\n $this->setDojo();\n }",
"private static function _initViewData()\n {\n static::addViewData(\n [\n 'ajax_url' => UKMDesign::getAjaxUrl(),\n 'is_super_admin' => function_exists('is_super_admin') ? is_super_admin() : false,\n 'UKMDesign' => new UKMDesign(),\n 'singleMode' => ((isset($_POST['singleMode']) && 'true' == $_POST['singleMode']) || (isset($_GET['singleMode']) && 'true' == $_GET['singleMode'])),\n 'hideTopImage' => ((isset($_POST['hideTopImage']) && 'true' == $_POST['hideTopImage']) || (isset($_GET['hideTopImage']) && 'true' == $_GET['hideTopImage']))\n ]\n );\n }",
"public function initialize()\n {\n $this->view->setVar(\"page\", \"analytics\");\n }",
"public function init()\n {\n $this->getBootstrap()->bootstrap('view');\n $this->_view = $this->getBootstrap()->getResource('view');\n $this->setHeadScripts();\n }",
"protected function initializeStandaloneViewInstance() {}",
"public function init() {\n // initialize view\n $view = $this->initView();\n \n // set language\n $view->language = Zend_Registry::get('language');\n \n // set translate object\n $view->translate()->setTranslator($view->language);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get list of churches. Filter churches by district, state or country. | public function get_churches( $district = 0, $state = 0, $country = 0 ) {
$this->db->from( 'churches' );
// Filter by district.
if ( ! empty( $district ) ) {
$this->db->where( 'district', $district );
}
// Filter by state.
if ( ! empty( $state ) ) {
$this->db->where( 'state', $state );
}
// Filter by country.
if ( ! empty( $country ) ) {
$this->db->where( 'country', $country );
}
return $this->db->get()->result();
} | [
"public static function getAllChargers() {\n $query = new SelectQuery(\"chargers\", \"charger_id\", \"name\", \"lng\", \"lat\", \"address\", \"type\");\n $result = DBQuerrier::defaultQuery($query);\n $chargers = array();\n while ($row = @ mysqli_fetch_array($result)) {\n switch ($row['type']) {\n case \"supercharger\":\n array_push($chargers,\n new SuperCharger($row['charger_id'], $row['name'], new Location($row['lat'], $row['lng']),\n null, $row['address'], null, null, null));\n break;\n case \"destinationcharger\":\n array_push($chargers, new DestinationCharger($row['charger_id'], $row['name'],\n new Location($row['lat'], $row['lng']), null, $row['address']));\n break;\n default:\n throw new InvalidArgumentException(\"Invalid type of charger\");\n }\n }\n return $chargers;\n }",
"public function all()\n {\n Log :: channel( 'request-charger' ) -> info( 'GET_ALL_CHARGERS' );\n $service_url = $this -> url . '/es-services/mobile/ws/chargers';\n $result = $this -> fetchData( $service_url );\n \n switch( $result -> status )\n {\n case 0:\n return $result -> data -> chargers;\n default:\n throw new FindChargerException( \n 'Chargers couldn\\'t be retrieved from Misha\\'s DB.',\n 500,\n );\n }\n }",
"public function getChats()\n {\n return $this->run('getChats');\n }",
"public function getBranches()\n {\n return $this->hasMany(Branch::class, 'church_id');\n }",
"public static function getAllChefs() {\n CommonDao::connectToDb();\n $query = \"select c.*\n from chef c\n order by c.last_name, c.first_name\";\n return ChefDao::createChefsFromQuery($query);\n }",
"public static function getAllDestinationChargers() {\n $query = new SelectQuery(\"chargers\", \"charger_id\", \"name\", \"lat\", \"lng\", \"address\");\n $query->where(Where::whereEqualValue(\"type\", DBValue::stringValue(\"destinationcharger\")));\n $results = DBQuerrier::defaultQuery($query);\n $destinationChargers = array();\n while ($row = @ mysqli_fetch_array($results)) {\n array_push($destinationChargers,\n new DestinationCharger($row['charger_id'], $row['name'], new Location($row['lat'], $row['lng']),\n null, $row['address']));\n }\n return $destinationChargers;\n }",
"function getChampions() {\n\t\t\t$url = $GLOBALS['baseurl'].'api/lol/'.$GLOBALS['region'].'/v1.1/champion';\n\t\t\t$params = '?api_key='.$GLOBALS['key'];\n\t\t\t\n\t\t\treturn json_decode(file_get_contents($url.$params), true);\n\t\t}",
"protected function getChats()\n {\n return $this->collection->find(array('active' => true));\n }",
"public function getCities($country){\n $sql = \"SELECT * FROM cities WHERE country_id = '$country'\";\n return $this->fetchAll($sql);\n }",
"public function getCountrylist()\n {\n $cachePool = new FilesystemAdapter('', 0, \"cache\");\n \n if ($cachePool->hasItem('countries')) {\n $countries = $cachePool->getItem('countries')->get();\n } else {\n $countries = $this->client->request(\n 'GET',\n 'https://kayaposoft.com/enrico/json/v2.0?action=getSupportedCountries'\n )->toArray();\n $countriesCache = $cachePool->getItem('countries');\n \n if (!$countriesCache->isHit()) {\n $countriesCache->set($countries);\n $countriesCache->expiresAfter(60*60*24);\n $cachePool->save($countriesCache);\n }\n }\n\n return $countries;\n }",
"public function getChocolatiers()\r\n {\r\n $sql = 'select CHT_ID as id, CHT_NOM as nom,'\r\n . ' CHT_ADRESSE as adresse, CHT_TEL as tel,'\r\n . ' CHT_EMAIL as email'\r\n . ' from T_CHOCOLATIER'\r\n . ' order by nom asc';\r\n \r\n $chocolatiers = $this->executerRequete($sql);\r\n return $chocolatiers;\r\n }",
"function listDishesPlats() {\n $sql = $this->database->query('SELECT * FROM `lcdh_dishes` WHERE `categories_id` = \"2\" ');\n $result = $sql->fetchAll(PDO::FETCH_OBJ);\n return $result;\n }",
"public function cochesList(){\n $coches = Coche::orderBy('modelo')->simplePaginate(6);\n\n return view('admin.coches.coches', compact('coches'));\n }",
"public function getCountries() {\r\n\t\r\n\t\t$url = $this->_buildURL('countries');\r\n\t\treturn $this->_call($url);\r\n\t}",
"public function getChamps()\r\n {\r\n $this->champ_info = $this->getJson(\"http://ddragon.leagueoflegends.com/cdn/\".$this->curr_ver.\"/data/en_US/champion.json\");\r\n $champions = array();\r\n\r\n \r\n foreach($this->champ_info->data as $value)\r\n {\r\n $champions[$value->key] = array(\"id\" => $value->id, \"name\" => $value->name);\r\n }\r\n\r\n // For debugging.\r\n // echo \"<pre>\";\r\n // print_r($champions);\r\n // echo \"</pre>\";\r\n return $champions;\r\n }",
"public function loadChefs () {\n\t\t$sql = \"SELECT * FROM `users` WHERE `type`='3' AND activated = 1\";\n\t\t$query = $this->db->query($sql);\n\t\t$chefs = array();\n\t\t\n\t\tforeach ($query->result() as $row) {\n\t\t\t$chef = new stdClass();\n\t\t\t$sql = \"SELECT *, \n\t\t\t(SELECT COUNT(*) FROM `buyer_cart` AS `bc` WHERE `bc`.`meal`=`m`.`id` AND `bc`.`status`='1') AS `orders`,\n\t\t\t(SELECT image_url FROM `meal_images` WHERE `meal_images`.`meal` = `m`.`id`) as `image_url` \n\t\t\tFROM meals AS m WHERE `m`.`owner` = '{$row->id}'\";\n\t\t\t$meals = $this->db->query($sql);\n\t\t\t\n\t\t\t$chef->chef = $row;\n\t\t\t$chef->meals = $meals->result();\n\t\t\t\n\t\t\tforeach ($chef->meals as $meal) {\n\t\t\t\t$sql = \"SELECT * FROM `menus` WHERE `meal`= '{$meal->id}'\";\n\t\t\t\t$query = $this->db->query($sql);\n\t\t\t\t$meal->menu = $query->result();\n\t\t\t}\n\t\t\t$chefs[] = $chef;\n\t\t}\n\t\treturn $chefs;\n\t}",
"function findAllCountries(){\n $ports = self::$con->executeSelectStatement($this->selectCountryStmt(),array());\n return $this->getCollectionCountry($ports); \n }",
"public static function getGoldenWrenches() {\n if(self::$goldenWrenches == null) {\n self::$goldenWrenches = array();\n\n $data = json_decode(WebApi::getJSON('ITFItems_440', 'GetGoldenWrenches', 2));\n foreach($data->results->wrenches as $wrenchData) {\n self::$goldenWrenches[] = new TF2GoldenWrench($wrenchData);\n }\n }\n\n return self::$goldenWrenches;\n }",
"function church_podcasts($church){\r\n\t\t\tglobal $conn;\r\n\r\n\t\t\t$church = $conn->real_escape_string($church);\r\n\t\t\t$query = $conn->query(\"SELECT * FROM podcasts WHERE church =\\\"$church\\\" AND status = 'active' \") or die(\"Error getting church podcats $conn->error\");\r\n\t\t\t$pods = array();\r\n\r\n\t\t\twhile ($data = $query->fetch_assoc()) {\r\n\t\t\t\t$pods[] = $data;\r\n\t\t\t}\r\n\t\t\treturn $pods;\r\n\t\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Shows canceled subscriptions report | public function canceledAction()
{
if (!$this->getAcl()->canViewCanceledSubscriptionsReport()) {
return $this->forwardDenied();
}
$this->loadLayout();
$this->_title('Reports')->_title('Subscriptions')->_title('Canceled Subscriptions');
$this->_setActiveMenu('report/sheep_subscription/canceled_subscriptions');
$this->_addContent($this->getLayout()->createBlock('sheep_subscription/adminhtml_report_subscription_canceled'));
$this->renderLayout();
} | [
"public function canViewCanceledSubscriptionsReport()\n {\n return $this->getAdminSession()->isAllowed(self::REPORT_SUBSCRIPTION_CANCELED_SUBSCRIPTIONS_ACL);\n }",
"public function cancel($subscription_id) {}",
"public function requestCancel(){\n\t\t$this->checkWorkflow(self::STATUS_CANCELED, false);\n\t\tif ($this->hasCancelPeriod()) {\n\t\t\t$this->getSubscription()->setCancelRequest(true);\n\t\t\t$this->save();\n\t\t\t$this->sendCancelRequestEmail();\n\t\t\t$this->getLogger()->info('The cancelation of the subscription was requested.');\n\t\t}\n\t\telse {\n\t\t\t$this->cancel();\n\t\t\t$this->sendCancelEmail();\n\t\t}\n\t}",
"public function testCancelSubscriptionWithSubscriptionCanceled(){\n\t\tPayU::$apiLogin = PayUTestUtil::API_LOGIN;\n\t\tPayU::$apiKey = PayUTestUtil::API_KEY;\n\t\tEnvironment::setSubscriptionsCustomUrl(PayUTestUtil::SUBSCRIPTION_CUSTOM_URL);\n\t\n\t\t// Subscription parameters\n\t\t$parameters = PayUTestUtil::buildSubscriptionParameters();\n\t\t// Customer parameters\n\t\t$parameters = PayUTestUtil::buildSubscriptionParametersCustomer($parameters);\n\t\t// Plan parameters\n\t\t$parameters = PayUTestUtil::buildSuccessParametersPlan($parameters);\n\t\t// Credit card parameters\n\t\t$parameters = PayUTestUtil::buildSubscriptionParametersCreditCard($parameters);\n\t\n\t\n\t\t$response = PayUSubscriptions::createSubscription($parameters);\n\t\n\t\t$parameters = array(PayUParameters::SUBSCRIPTION_ID => $response->id);\n\t\n\t\t$response = PayUSubscriptions::cancel($parameters);\n\t\t$response = PayUSubscriptions::cancel($parameters);\n\t\n\t}",
"public function testCancelSubscription()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }",
"public function cancel()\n {\n $post = $_REQUEST;\n $model = & $this->getModel('jms');\n $model->cancelSubscription($post);\n $this->setRedirect('index.php?option=com_jms&view=jms&layout=cancel&id=' . $post['id'] . '&plan_id=' . $post['plan_id']);\n }",
"public function unsubscribe()\n {\n echo \"<br>\";\n echo \"Action: Cancelling Subscription !\";\n unset($this->plan);\n unset($this->server);\n unset($this->serverList);\n\n }",
"function cancel_list()\n {\n\n $single_info = BuyTicket::onlyTrashed();\n return view('dashboardpages/cancel',compact('single_info'));\n }",
"public function getSubscriptionCancel()\n {\n $user = Auth::user();\n if (!$user->payment_subscription_id)\n return back();\n\n $subscription_id = $user->payment_subscription_id;\n $customerId = $user->payment_customer_id;\n\n $subscription = $this->userSubscription($customerId)->cancel($subscription_id);\n\n $user->payment_subscription_id = NULL;\n $user->save();\n\n event(new UserSubscriptionCanceled($user, $subscription_id));\n\n return back()->with('success', 'Automatische incasso gestopt');\n }",
"public function cancel_subscription(){\n $data = array();\n $stripeSystem = new StripeSystem();\n $stripeSubscription = $this->StripeSubscriptions_model->getSubscription();\n if($stripeSubscription->stripe_id !=\"\"){\n $subscription = $stripeSystem->stripeSubscriptionRetrieve($stripeSubscription->stripe_id);\n $subscription->cancel_at_period_end = true;\n// $subscription->cancel(['cancel_at_period_end' => true]);\n $subscription->save();\n// $subscription->cancel();\n $this->StripeSubscriptions_model->cancelSubscription($subscription);\n $data['result'] =\"success\";\n $data['message'] = \"You cancelled subscription successfully.\";\n }else {\n $data['result'] =\"failed\";\n $data['message'] = \"You didn't have subscription.\";\n }\n echo json_encode($data);\n exit;\n }",
"public function today_all_cancelled_request_log(){\n return view('sales.today.all_cancelled_request_log');\n }",
"function cpnFilterCanceled() {\n\treturn pudl::notFind('event_details', 'canceled');\n}",
"public function actionCancelled()\n {\n $order = $this->module->orderModelName;\n $query = $order::getOrderQuery()->andWhere(['status'=>$order::STATUS_CANCELLED]);\n $dataProvider = new ActiveDataProvider([\n 'query'=>$query,\n ]);\n return $this->render('cancelled',[\n 'dataProvider'=>$dataProvider,\n ]);\n }",
"function reports_unsubscribes($id, $start = null, $end = null)\r\n {\r\n $ok = $this->call_api(Http::GET, 'reports/' . $id . '/unsubscribed/?paginate_by=100');\r\n if ($ok) {\r\n $this->result = array();\r\n foreach ($this->response->body['results'] as $unsub) {\r\n $this->result[] = array(\r\n 'email' => $unsub['contact'],\r\n 'date' => $unsub['created']\r\n );\r\n }\r\n }\r\n return $ok;\r\n }",
"function cancel_subscription(){\n\t\t$sub_id = $this->input->post('sub_id');\n\t\tif(!empty($sub_id)){\n\t\t\\Stripe\\Stripe::setApiKey(\"sk_test_NSDNftNd6HhWAxCJczahG70h\");\n\t\t$subscription = \\Stripe\\Subscription::retrieve($sub_id);\n\t\t //return $subscription->cancel();\n\t\t if($subscription->cancel()){\n\t\t\t$this->InteractModal->subscription_suspend($sub_id);\t\t\n\t\t }\t\t \n\t\t}else{\n\t\t\techo \"subcripition id not found\";\n\t\t}\n\t}",
"public function cancel() {\n\n\t\t$args = array(\n\t\t\t'status' => 'cancelled'\n\t\t);\n\n\t\tif( $this->subs_db->update( $this->id, $args ) ) {\n\n\t\t\tif( is_user_logged_in() ) {\n\n\t\t\t\t$userdata = get_userdata( get_current_user_id() );\n\t\t\t\t$user = $userdata->user_login;\n\n\t\t\t} else {\n\n\t\t\t\t$user = __( 'gateway', 'edd-recurring' );\n\n\t\t\t}\n\n\t\t\t$note = sprintf( __( 'Subscription #%d cancelled by %s', 'edd-recurring' ), $this->id, $user );\n\t\t\t$this->customer->add_note( $note );\n\n\t\t\tdo_action( 'edd_subscription_cancelled', $this->id, $this );\n\n\t\t}\n\n\t}",
"public function actionCancelSubscription($subid){\t\n\t\t\t\t\n\t\t$model = SubscriptionModel::find()->where(['eq_customer_id'=>\\Yii::$app->user->id,'subscription_id'=>$subid])->One();\n\t\t//$model->created_at = date(\"Y-m-d H:i:s\");\n\t\t//$model->status = 2;\n\t\tif($model)\n\t\t{\n\t\t $model->delete();\t\n\t\t return ['Success' => \"Subscription Is Cancelled To This User Successfully\"];\t\t\t \n\t\t}\n\t\telse { \n\t\t return ['Error' => $model->getErrors()]; \n\t\t}\n\t \t\t\n\t}",
"public function cancelSubscription($subscription_id);",
"protected function _processTransactionSubscriptionCanceled($parameters) {\n\t\t\t$subscriptionData = array(\n\t\t\t\tarray(\n\t\t\t\t\t'created' => $parameters['transaction_date'],\n\t\t\t\t\t'id' => $parameters['subscription_id'],\n\t\t\t\t\t'invoice_id' => $parameters['invoice_id'],\n\t\t\t\t\t'interval_type' => $parameters['interval_type'],\n\t\t\t\t\t'interval_value' => $parameters['interval_value'],\n\t\t\t\t\t'payment_method_id' => $parameters['payment_method_id'],\n\t\t\t\t\t'plan_id' => $parameters['plan_id'],\n\t\t\t\t\t'price' => $parameters['payment_amount'],\n\t\t\t\t\t'status' => 'canceled',\n\t\t\t\t\t'user_id' => $parameters['user_id']\n\t\t\t\t)\n\t\t\t);\n\n\t\t\tif (\n\t\t\t\t!empty($parameters['user']) &&\n\t\t\t\t$this->save('subscriptions', $subscriptionData)\n\t\t\t) {\n\t\t\t\t$paymentMethod = $this->fetch('payment_methods', array(\n\t\t\t\t\t'conditions' => array(\n\t\t\t\t\t\t'id' => $subscriptionData[0]['payment_method_id']\n\t\t\t\t\t),\n\t\t\t\t\t'fields' => array(\n\t\t\t\t\t\t'name'\n\t\t\t\t\t)\n\t\t\t\t));\n\n\t\t\t\tif (!empty($paymentMethod['count'])) {\n\t\t\t\t\t$subscriptionData[0]['payment_method_name'] = $paymentMethod['data'][0];\n\t\t\t\t\t$mailParameters = array(\n\t\t\t\t\t\t'from' => $this->settings['from_email'],\n\t\t\t\t\t\t'subject' => 'Subscription #' . $subscriptionData[0]['id'] . ' canceled',\n\t\t\t\t\t\t'template' => array(\n\t\t\t\t\t\t\t'name' => 'subscription_canceled',\n\t\t\t\t\t\t\t'parameters' => array(\n\t\t\t\t\t\t\t\t'subscription' => $subscriptionData[0],\n\t\t\t\t\t\t\t\t'transaction' => $parameters,\n\t\t\t\t\t\t\t\t'user' => $parameters['user']\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'to' => $parameters['user']['email']\n\t\t\t\t\t);\n\t\t\t\t\t$this->_sendMail($mailParameters);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn;\n\t\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Updates the content on this document. Reparses a source file, updates symbols and reports parsing errors that may have occured as diagnostics. | public function updateContent(string $content)
{
$this->content = $content;
// Unregister old definitions
if (isset($this->definitions)) {
foreach ($this->definitions as $fqn => $definition) {
$this->index->removeDefinition($fqn);
}
}
// Unregister old references
if (isset($this->referenceNodes)) {
foreach ($this->referenceNodes as $fqn => $node) {
$this->index->removeReferenceUri($fqn, $this->uri);
}
}
$this->referenceNodes = null;
$this->definitions = null;
$this->definitionNodes = null;
$errorHandler = new ErrorHandler\Collecting;
$stmts = $this->parser->parse($content, $errorHandler);
$this->diagnostics = [];
foreach ($errorHandler->getErrors() as $error) {
$this->diagnostics[] = Diagnostic::fromError($error, $this->content, DiagnosticSeverity::ERROR, 'php');
}
// $stmts can be null in case of a fatal parsing error
if ($stmts) {
$traverser = new NodeTraverser;
// Resolve aliased names to FQNs
$traverser->addVisitor(new NameResolver($errorHandler));
// Add parentNode, previousSibling, nextSibling attributes
$traverser->addVisitor(new ReferencesAdder($this));
// Add column attributes to nodes
$traverser->addVisitor(new ColumnCalculator($content));
// Parse docblocks and add docBlock attributes to nodes
$docBlockParser = new DocBlockParser($this->docBlockFactory);
$traverser->addVisitor($docBlockParser);
$traverser->traverse($stmts);
// Report errors from parsing docblocks
foreach ($docBlockParser->errors as $error) {
$this->diagnostics[] = Diagnostic::fromError($error, $this->content, DiagnosticSeverity::WARNING, 'php');
}
$traverser = new NodeTraverser;
// Collect all definitions
$definitionCollector = new DefinitionCollector($this->definitionResolver);
$traverser->addVisitor($definitionCollector);
// Collect all references
$referencesCollector = new ReferencesCollector($this->definitionResolver);
$traverser->addVisitor($referencesCollector);
$traverser->traverse($stmts);
// Register this document on the project for all the symbols defined in it
$this->definitions = $definitionCollector->definitions;
$this->definitionNodes = $definitionCollector->nodes;
foreach ($definitionCollector->definitions as $fqn => $definition) {
$this->index->setDefinition($fqn, $definition);
}
// Register this document on the project for references
$this->referenceNodes = $referencesCollector->nodes;
foreach ($referencesCollector->nodes as $fqn => $nodes) {
$this->index->addReferenceUri($fqn, $this->uri);
}
$this->stmts = $stmts;
}
} | [
"public function updateContent(string $content)\n {\n $this->content = $content;\n $stmts = null;\n\n $errorHandler = new ErrorHandler\\Collecting;\n $stmts = $this->parser->parse($content, $errorHandler);\n\n $diagnostics = [];\n foreach ($errorHandler->getErrors() as $error) {\n $diagnostics[] = Diagnostic::fromError($error, $this->content, DiagnosticSeverity::ERROR, 'php');\n }\n\n // $stmts can be null in case of a fatal parsing error\n if ($stmts) {\n $traverser = new NodeTraverser;\n\n // Resolve aliased names to FQNs\n $traverser->addVisitor(new NameResolver($errorHandler));\n\n // Add parentNode, previousSibling, nextSibling attributes\n $traverser->addVisitor(new ReferencesAdder($this));\n\n // Add column attributes to nodes\n $traverser->addVisitor(new ColumnCalculator($content));\n\n // Parse docblocks and add docBlock attributes to nodes\n $docBlockParser = new DocBlockParser($this->docBlockFactory);\n $traverser->addVisitor($docBlockParser);\n\n $traverser->traverse($stmts);\n\n // Report errors from parsing docblocks\n foreach ($docBlockParser->errors as $error) {\n $diagnostics[] = Diagnostic::fromError($error, $this->content, DiagnosticSeverity::WARNING, 'php');\n }\n\n $traverser = new NodeTraverser;\n\n // Collect all definitions\n $definitionCollector = new DefinitionCollector;\n $traverser->addVisitor($definitionCollector);\n\n // Collect all references\n $referencesCollector = new ReferencesCollector;\n $traverser->addVisitor($referencesCollector);\n\n $traverser->traverse($stmts);\n\n // Unregister old definitions\n if (isset($this->definitions)) {\n foreach ($this->definitions as $fqn => $node) {\n $this->project->removeSymbol($fqn);\n }\n }\n // Register this document on the project for all the symbols defined in it\n $this->definitions = $definitionCollector->definitions;\n $this->symbols = $definitionCollector->symbols;\n foreach ($definitionCollector->symbols as $fqn => $symbol) {\n $this->project->setSymbol($fqn, $symbol);\n }\n\n // Unregister old references\n if (isset($this->references)) {\n foreach ($this->references as $fqn => $node) {\n $this->project->removeReferenceUri($fqn, $this->uri);\n }\n }\n // Register this document on the project for references\n $this->references = $referencesCollector->references;\n foreach ($referencesCollector->references as $fqn => $nodes) {\n $this->project->addReferenceUri($fqn, $this->uri);\n }\n\n $this->stmts = $stmts;\n }\n\n if (!$this->isVendored()) {\n $this->client->textDocument->publishDiagnostics($this->uri, $diagnostics);\n }\n }",
"public function updateXMLDocument() {\r\n $this->xml_document = file_get_contents($this->_source_url);\r\n }",
"function parse()\n {\n $lines = explode(\"\\n\", $this->wiki->source);\n\n $this->wiki->source = '';\n\n foreach ($lines as $line) {\n $this->wiki->source .= $this->process($line) . \"\\n\";\n }\n $this->wiki->source = substr($this->wiki->source, 0, -1);\n }",
"function &parse()\n {\n \n\t\t$rootDoc =& new rootDoc($this);\n\t\t$ii = 0;\n\t\tforeach ($this->_files as $path => $files) {\n\t\t $this->_sourceIndex = $ii++;\n if (isset($this->_options['overview'])) $this->_overview = $this->makeAbsolutePath($this->_options['overview'], $this->sourcePath());\n if (isset($this->_options['package_comment_dir'])) $this->_packageCommentDir = $this->makeAbsolutePath($this->_options['package_comment_dir'], $this->sourcePath());\n \n foreach ($files as $filename) {\n if ($filename) {\n $this->message('Reading file \"'.$filename.'\"');\n $fileString = @file_get_contents($filename);\n if ($fileString !== FALSE) {\n\t\t\t\t\t\t$fileString = str_replace( \"\\r\\n\", \"\\n\", $fileString ); // fix Windows line endings\n\t\t\t\t\t\t$fileString = str_replace( \"\\r\", \"\\n\", $fileString ); // fix ancient Mac line endings\n\t\t\t\t\t\t\n $this->_currentFilename = $filename;\n \n $tokens = token_get_all($fileString);\n \n if (!$this->_verbose) echo 'Parsing tokens';\n \n /* This array holds data gathered before the type of element is\n discovered and an object is created for it, including doc comment\n data. This data is stored in the object once it has been created and\n then merged into the objects data fields upon object completion. */\n $currentData = array();\n \n $currentPackage = $this->_defaultPackage; // the current package\n if ($this->_useClassPathAsPackage) { // magic up package name from filepath\n $currentPackage .= '\\\\'.str_replace(' ', '\\\\', ucwords(str_replace(DIRECTORY_SEPARATOR, ' ', substr(dirname($filename), strlen($this->sourcePath()) + 1))));\n }\n $defaultPackage = $oldDefaultPackage = $currentPackage;\n $fileData = array();\n \n $currentElement = array(); // stack of element family, current at top of stack\n $ce =& $rootDoc; // reference to element at top of stack\n \n $open_curly_braces = FALSE;\n $in_parsed_string = FALSE;\n \n $counter = 0;\n $lineNumber = 1;\n $commentNumber = 0;\n \n $numOfTokens = count($tokens);\n for ($key = 0; $key < $numOfTokens; $key++) {\n $token = $tokens[$key];\n \n if (!$in_parsed_string && is_array($token)) {\n \n $lineNumber += substr_count($token[1], \"\\n\");\n \n if ($commentNumber == 1 && (\n $token[0] == T_CLASS ||\n $token[0] == T_INTERFACE ||\n $token[0] == T_FUNCTION ||\n $token[0] == T_VARIABLE\n )) { // we have a code block after the 1st comment, so it is not a file level comment\n $defaultPackage = $oldDefaultPackage;\n $fileData = array();\n }\n \n switch ($token[0]) {\n \n case T_COMMENT: // read comment\n case T_ML_COMMENT: // and multiline comment (deprecated in newer versions)\n case T_DOC_COMMENT: // and catch PHP5 doc comment token too\n $currentData = array_merge($currentData, $this->processDocComment($token[1], $rootDoc));\n if ($currentData) {\n $commentNumber++;\n if ($commentNumber == 1) {\n if (isset($currentData['package'])) { // store 1st comment incase it is a file level comment\n $oldDefaultPackage = $defaultPackage;\n $defaultPackage = $currentData['package'];\n }\n $fileData = $currentData;\n }\n }\n break;\n \n case T_CLASS:\n // read class\n $class =& new classDoc($this->_getProgramElementName($tokens, $key), $rootDoc, $filename, $lineNumber, $this->sourcePath()); // create class object\n $this->verbose('+ Entering '.get_class($class).': '.$class->name());\n if (isset($currentData['docComment'])) { // set doc comment\n $class->set('docComment', $currentData['docComment']);\n }\n $class->set('data', $currentData); // set data\n if (isset($currentData['package']) && $currentData['package'] != NULL) { // set package\n $currentPackage = $currentData['package'];\n }\n $class->set('package', $currentPackage);\n \n $parentPackage =& $rootDoc->packageNamed($class->packageName(), TRUE); // get parent package\n $parentPackage->addClass($class); // add class to package\n $class->setByRef('parent', $parentPackage); // set parent reference\n $currentData = array(); // empty data store\n if ($this->_includeElements($class)) {\n $currentElement[count($currentElement)] =& $class; // re-assign current element\n }\n $ce =& $class;\n break;\n \n case T_INTERFACE:\n // read interface\n $interface =& new classDoc($this->_getProgramElementName($tokens, $key), $rootDoc, $filename, $lineNumber, $this->sourcePath()); // create interface object\n $this->verbose('+ Entering '.get_class($interface).': '.$interface->name());\n if (isset($currentData['docComment'])) { // set doc comment\n $interface->set('docComment', $currentData['docComment']);\n }\n $interface->set('data', $currentData); // set data\n $interface->set('interface', TRUE); // this element is an interface\n if (isset($currentData['package']) && $currentData['package'] != NULL) { // set package\n $currentPackage = $currentData['package'];\n }\n $interface->set('package', $currentPackage);\n \n $parentPackage =& $rootDoc->packageNamed($interface->packageName(), TRUE); // get parent package\n $parentPackage->addClass($interface); // add class to package\n $interface->setByRef('parent', $parentPackage); // set parent reference\n $currentData = array(); // empty data store\n if ($this->_includeElements($interface)) {\n $currentElement[count($currentElement)] =& $interface; // re-assign current element\n }\n $ce =& $interface;\n break;\n \n case T_EXTENDS:\n // get extends clause\n $superClassName = $this->_getProgramElementName($tokens, $key);\n $ce->set('superclass', $superClassName);\n if ($superClass =& $rootDoc->classNamed($superClassName) && $commentTag =& $superClass->tags('@text')) {\n $ce->setTag('@text', $commentTag);\n }\n break;\n \n case T_IMPLEMENTS:\n // get implements clause\n $interfaceName = $this->_getProgramElementName($tokens, $key);\n $interface =& $rootDoc->classNamed($interfaceName);\n if ($interface) {\n $ce->set('interfaces', $interface);\n }\n break;\n \n case T_THROW:\n // throws exception\n $className = $this->_getProgramElementName($tokens, $key);\n $class =& $rootDoc->classNamed($className);\n if ($class) {\n $ce->setByRef('throws', $class);\n } else {\n $ce->set('throws', $className);\n }\n break;\n \n case T_PRIVATE:\n $currentData['access'] = 'private';\n break;\n \n case T_PROTECTED:\n $currentData['access'] = 'protected';\n break;\n \n case T_PUBLIC:\n $currentData['access'] = 'public';\n break;\n \n case T_ABSTRACT:\n $currentData['abstract'] = TRUE;\n break;\n \n case T_FINAL:\n $currentData['final'] = TRUE;\n break;\n \n case T_STATIC:\n $currentData['static'] = TRUE;\n break;\n \n case T_VAR:\n $currentData['var'] = 'var';\n break;\n \n case T_CONST:\n $currentData['var'] = 'const';\n break;\n \n case T_NAMESPACE:\n case T_NS_C:\n $namespace = '';\n while($tokens[++$key][0] != T_STRING);\n $namespace = $tokens[$key++][1];\n while($tokens[$key][0] == T_NS_SEPARATOR) {\n $namespace .= $tokens[$key++][1] . $tokens[$key++][1];\n }\n $currentPackage = $defaultPackage = $oldDefaultPackage = $namespace;\n $key--;\n break;\n \n case T_FUNCTION:\n // read function\n $name = $this->_getProgramElementName($tokens, $key);\n $method =& new methodDoc($name, $ce, $rootDoc, $filename, $lineNumber, $this->sourcePath()); // create method object\n $this->verbose('+ Entering '.get_class($method).': '.$method->name());\n if (isset($currentData['docComment'])) { // set doc comment\n $method->set('docComment', $currentData['docComment']); // set doc comment\n }\n $method->set('data', $currentData); // set data\n $ceClass = strtolower(get_class($ce));\n if ($ceClass == 'rootdoc') { // global function, add to package\n $this->verbose(' is a global function');\n if (isset($currentData['access']) && $currentData['access'] == 'private') $method->makePrivate();\n if (isset($currentData['package']) && $currentData['package'] != NULL) { // set package\n $method->set('package', $currentData['package']);\n } else {\n $method->set('package', $currentPackage);\n }\n $method->mergeData();\n $parentPackage =& $rootDoc->packageNamed($method->packageName(), TRUE); // get parent package\n if ($this->_includeElements($method)) {\n $parentPackage->addFunction($method); // add method to package\n }\n } elseif ($ceClass == 'classdoc' || $ceClass == 'methoddoc') { // class method, add to class\n $method->set('package', $ce->packageName()); // set package\n if ($method->name() == '__construct' || strtolower($method->name()) == strtolower($ce->name())) { // constructor\n $this->verbose(' is a constructor of '.get_class($ce).' '.$ce->name());\n $method->set(\"name\", \"__construct\");\n $ce->addMethod($method);\n } else {\n if ($this->_hasPrivateName($method->name())) $method->makePrivate();\n if (isset($currentData['access']) && $currentData['access'] == 'private') $method->makePrivate();\n $this->verbose(' is a method of '.get_class($ce).' '.$ce->name());\n if ($this->_includeElements($method)) {\n $ce->addMethod($method);\n }\n }\n }\n $currentData = array(); // empty data store\n $currentElement[count($currentElement)] =& $method; // re-assign current element\n $ce =& $method;\n break;\n \n case T_STRING:\n // read global constant\n if ($token[1] == 'define' || $token[1] == 'define_safe') {// && $tokens[$key + 2][0] == T_CONSTANT_ENCAPSED_STRING) {\n $const =& new fieldDoc($this->_getNext($tokens, $key, T_CONSTANT_ENCAPSED_STRING), $ce, $rootDoc, $filename, $lineNumber, $this->sourcePath()); // create constant object\n $this->verbose('Found '.get_class($const).': global constant '.$const->name());\n $const->set('final', TRUE); // is constant\n $value = '';\n do {\n $key++;\n } while(isset($tokens[$key]) && $tokens[$key] != ',');\n $key++;\n while(isset($tokens[$key]) && $tokens[$key] != ')') {\n if (is_array($tokens[$key])) {\n $value .= $tokens[$key][1];\n } else {\n $value .= $tokens[$key];\n }\n $key++;\n }\n $value = trim($value);\n if (substr($value, 0, 5) == 'array') {\n $value = 'array(...)';\n }\n $const->set('value', $value);\n if (is_numeric($value)) {\n $const->set('type', new type('int', $rootDoc));\n } elseif (strtolower($value) == 'true' || strtolower($value) == 'false') {\n $const->set('type', new type('bool', $rootDoc));\n } elseif (\n substr($value, 0, 1) == '\"' && substr($value, -1, 1) == '\"' ||\n substr($value, 0, 1) == \"'\" && substr($value, -1, 1) == \"'\"\n ) {\n $const->set('type', new type('str', $rootDoc));\n }\n unset($value);\n if (isset($currentData['docComment'])) { // set doc comment\n $const->set('docComment', $currentData['docComment']);\n }\n $const->set('data', $currentData); // set data\n if (isset($currentData['package'])) { // set package\n $const->set('package', $currentData['package']);\n } else {\n $const->set('package', $currentPackage);\n }\n $const->mergeData();\n $parentPackage =& $rootDoc->packageNamed($const->packageName(), TRUE); // get parent package\n if ($this->_includeElements($const)) {\n $parentPackage->addGlobal($const); // add constant to package\n }\n $currentData = array(); // empty data store\n \n // member constant\n } elseif (isset($currentData['var']) && $currentData['var'] == 'const') {\n do {\n $key++;\n if ($tokens[$key] == '=') {\n $name = $this->_getPrev($tokens, $key, array(T_VARIABLE, T_STRING));\n $value = '';\n } elseif(isset($value) && $tokens[$key] != ',' && $tokens[$key] != ';') { // set value\n if (is_array($tokens[$key])) {\n $value .= $tokens[$key][1];\n } else {\n $value .= $tokens[$key];\n }\n } elseif ($tokens[$key] == ',' || $tokens[$key] == ';') {\n if (!isset($name)) {\n $name = $this->_getPrev($tokens, $key, array(T_VARIABLE, T_STRING));\n }\n $const =& new fieldDoc($name, $ce, $rootDoc, $filename, $lineNumber, $this->sourcePath()); // create field object\n $this->verbose('Found '.get_class($const).': '.$const->name());\n if ($this->_hasPrivateName($const->name())) $const->makePrivate();\n $const->set('final', TRUE);\n if (isset($value)) { // set value\n $value = trim($value);\n if (strlen($value) > 30 && substr($value, 0, 5) == 'array') {\n $value = 'array(...)';\n }\n $const->set('value', $value);\n if (is_numeric($value)) {\n $const->set('type', new type('int', $rootDoc));\n } elseif (strtolower($value) == 'true' || strtolower($value) == 'false') {\n $const->set('type', new type('bool', $rootDoc));\n } elseif (\n substr($value, 0, 1) == '\"' && substr($value, -1, 1) == '\"' ||\n substr($value, 0, 1) == \"'\" && substr($value, -1, 1) == \"'\"\n ) {\n $const->set('type', new type('str', $rootDoc));\n }\n }\n if (isset($currentData['docComment'])) { // set doc comment\n $const->set('docComment', $currentData['docComment']);\n }\n $const->set('data', $currentData); // set data\n $const->set('package', $ce->packageName()); // set package\n $const->set('static', TRUE);\n $this->verbose(' is a member constant of '.get_class($ce).' '.$ce->name());\n $const->mergeData();\n if ($this->_includeElements($const)) {\n $ce->addConstant($const);\n }\n unset($name);\n unset($value);\n }\n } while(isset($tokens[$key]) && $tokens[$key] != ';');\n $currentData = array(); // empty data store\n \n // function parameter\n } elseif (strtolower(get_class($ce)) == 'methoddoc' && $ce->inBody == 0) {\n $typehint = NULL;\n do {\n $key++;\n if (!isset($tokens[$key])) break;\n if ($tokens[$key] == ',' || $tokens[$key] == ')') {\n unset($param);\n } elseif (is_array($tokens[$key])) {\n if ($tokens[$key][0] == T_STRING && !isset($param)) { // type hint\n $typehint = $tokens[$key][1];\n } elseif ($tokens[$key][0] == T_VARIABLE && !isset($param)) {\n $param =& new fieldDoc($tokens[$key][1], $ce, $rootDoc, $filename, $lineNumber, $this->sourcePath()); // create constant object\n $this->verbose('Found '.get_class($param).': '.$param->name());\n if (isset($currentData['docComment'])) { // set doc comment\n $param->set('docComment', $currentData['docComment']);\n }\n if ($typehint) {\n $param->set('type', new type($typehint, $rootDoc));\n $this->verbose(' has a typehint of '.$typehint);\n }\n $param->set('data', $currentData); // set data\n $param->set('package', $ce->packageName()); // set package\n $this->verbose(' is a parameter of '.get_class($ce).' '.$ce->name());\n $param->mergeData();\n $ce->addParameter($param);\n $typehint = NULL;\n } elseif (isset($param) && ($tokens[$key][0] == T_STRING || $tokens[$key][0] == T_CONSTANT_ENCAPSED_STRING || $tokens[$key][0] == T_LNUMBER)) { // set value\n $value = $tokens[$key][1];\n $param->set('value', $value);\n if (!$typehint) {\n if (is_numeric($value)) {\n $param->set('type', new type('int', $rootDoc));\n } elseif (strtolower($value) == 'true' || strtolower($value) == 'false') {\n $param->set('type', new type('bool', $rootDoc));\n } elseif (\n substr($value, 0, 1) == '\"' && substr($value, -1, 1) == '\"' ||\n substr($value, 0, 1) == \"'\" && substr($value, -1, 1) == \"'\"\n ) {\n $param->set('type', new type('str', $rootDoc));\n }\n }\n }\n }\n } while(isset($tokens[$key]) && $tokens[$key] != ')');\n $currentData = array(); // empty data store\n }\n break;\n \n case T_VARIABLE:\n // read global variable\n if (strtolower(get_class($ce)) == 'rootdoc') { // global var, add to package\n $global =& new fieldDoc($tokens[$key][1], $ce, $rootDoc, $filename, $lineNumber, $this->sourcePath()); // create constant object\n $this->verbose('Found '.get_class($global).': global variable '.$global->name());\n if (isset($tokens[$key - 1][0]) && isset($tokens[$key - 2][0]) && $tokens[$key - 2][0] == T_STRING && $tokens[$key - 1][0] == T_WHITESPACE) {\n $global->set('type', new type($tokens[$key - 2][1], $rootDoc));\n }\n while (isset($tokens[$key]) && $tokens[$key] != '=' && $tokens[$key] != ';') {\n $key++;\n }\n if (isset($tokens[$key]) && $tokens[$key] == '=') {\n $default = '';\n $key2 = $key + 1;\n do {\n if (is_array($tokens[$key2])) {\n if ($tokens[$key2][1] != '=') $default .= $tokens[$key2][1];\n } else {\n if ($tokens[$key2] != '=') $default .= $tokens[$key2];\n }\n $key2++;\n } while(isset($tokens[$key2]) && $tokens[$key2] != ';' && $tokens[$key2] != ',' && $tokens[$key2] != ')');\n $global->set('value', trim($default, ' ()')); // set value\n }\n if (isset($currentData['docComment'])) { // set doc comment\n $global->set('docComment', $currentData['docComment']);\n }\n $global->set('data', $currentData); // set data\n if (isset($currentData['package'])) { // set package\n $global->set('package', $currentData['package']);\n } else {\n $global->set('package', $currentPackage);\n }\n $global->mergeData();\n $parentPackage =& $rootDoc->packageNamed($global->packageName(), TRUE); // get parent package\n if ($this->_includeElements($global)) {\n $parentPackage->addGlobal($global); // add constant to package\n }\n $currentData = array(); // empty data store\n \n // read member variable\n } elseif (\n (isset($currentData['var']) && $currentData['var'] == 'var') || \n (isset($currentData['access']) && ($currentData['access'] == 'public' || $currentData['access'] == 'protected' || $currentData['access'] == 'private'))\n ) {\n unset($name);\n do {\n $key++;\n if ($tokens[$key] == '=') { // start value\n $name = $this->_getPrev($tokens, $key, T_VARIABLE);\n $value = '';\n $bracketCount = 0;\n } elseif (isset($value) && ($tokens[$key] != ',' || $bracketCount > 0) && $tokens[$key] != ';') { // set value\n if ($tokens[$key] == '(') {\n $bracketCount++;\n } elseif ($tokens[$key] == ')') {\n $bracketCount--;\n }\n if (is_array($tokens[$key])) {\n $value .= $tokens[$key][1];\n } else {\n $value .= $tokens[$key];\n }\n } elseif ($tokens[$key] == ',' || $tokens[$key] == ';') {\n if (!isset($name)) {\n $name = $this->_getPrev($tokens, $key, T_VARIABLE);\n }\n $field =& new fieldDoc($name, $ce, $rootDoc, $filename, $lineNumber, $this->sourcePath()); // create field object\n $this->verbose('Found '.get_class($field).': '.$field->name());\n if ($this->_hasPrivateName($field->name())) $field->makePrivate();\n if (isset($value)) { // set value\n $value = trim($value);\n if (strlen($value) > 30 && substr($value, 0, 5) == 'array') {\n $value = 'array(...)';\n }\n $field->set('value', $value);\n }\n if (isset($currentData['docComment'])) { // set doc comment\n $field->set('docComment', $currentData['docComment']);\n }\n $field->set('data', $currentData); // set data\n $field->set('package', $ce->packageName()); // set package\n $this->verbose(' is a member variable of '.get_class($ce).' '.$ce->name());\n $field->mergeData();\n if ($this->_includeElements($field)) {\n $ce->addField($field);\n }\n unset($name);\n unset($value);\n }\n } while(isset($tokens[$key]) && $tokens[$key] != ';');\n $currentData = array(); // empty data store\n \n }\n break;\n \n case T_CURLY_OPEN:\n case T_DOLLAR_OPEN_CURLY_BRACES: // we must catch this so we don't accidently step out of the current block\n $open_curly_braces = TRUE;\n break;\n }\n \n } else { // primitive tokens\n \n switch ($token) {\n case '{':\n if (!$in_parsed_string) {\n $ce->inBody++;\n }\n break;\n case '}':\n if (!$in_parsed_string) {\n if ($open_curly_braces) { // end of var curly brace syntax\n $open_curly_braces = FALSE;\n } else {\n $ce->inBody--;\n if ($ce->inBody == 0 && count($currentElement) > 0) {\n $ce->mergeData();\n $this->verbose('- Leaving '.get_class($ce).': '.$ce->name());\n array_pop($currentElement); // re-assign current element\n if (count($currentElement) > 0) {\n $ce =& $currentElement[count($currentElement) - 1];\n } else {\n unset($ce);\n $ce =& $rootDoc;\n }\n $currentPackage = $defaultPackage;\n }\n }\n }\n break;\n case ';': // case for closing abstract functions\n if (!$in_parsed_string && $ce->inBody == 0 && count($currentElement) > 0) {\n $ce->mergeData();\n $this->verbose('- Leaving empty '.get_class($ce).': '.$ce->name());\n array_pop($currentElement); // re-assign current element\n if (count($currentElement) > 0) {\n $ce =& $currentElement[count($currentElement) - 1];\n } else {\n unset($ce);\n $ce =& $rootDoc;\n }\n }\n break;\n case '\"': // catch parsed strings so as to ignore tokens within\n $in_parsed_string = !$in_parsed_string;\n break;\n }\n }\n \n $counter++;\n if ($counter > 99) {\n if (!$this->_verbose) echo '.';\n $counter = 0;\n }\n }\n if (!$this->_verbose) echo \"\\n\";\n \n $rootDoc->addSource($filename, $fileString, $fileData);\n \n } else {\n $this->error('Could not read file \"'.$filename.'\"');\n exit;\n }\n }\n }\n\t\t}\n \n // add parent data to child elements\n $this->message('Merging superclass data');\n $this->_mergeSuperClassData($rootDoc);\n\t\t\n\t\treturn $rootDoc;\n\t}",
"public function refreshContent() {\n if (Visio\\FileSystem::isReadable($this->_path)) {\n $this->content = file_get_contents($this->_path);\n } else {\n throw new Visio\\Exception\\File(\"Cannot read file '\" . $this->_path . \"'!\");\n }\n }",
"public function parseToFile()\n\t{\n\t\tSpoonFile::setContent($this->compileDirectory .'/'. $this->getCompileName($this->template), $this->getContent());\n\t}",
"public function process()\n {\n $tokens = $this->initializeTokens($this->contents, $this->filename);\n $this->parseTokenizer($tokens);\n }",
"public function updateContent()\n {\n }",
"public function updateSource()\n {\n $source = array(\n \"value\" => $this->value,\n \"tags\" => $this->tags,\n \"type\" => $this->type,\n \"body\" => $this->body,\n );\n\n $this->source = Yaml::dump($source, 100, 2);\n }",
"private function updateParser () {\n if ($this->component) {\n $this->loadParser($this->component->getHtmlString());\n }\n }",
"function parse()\n {\n $this->wiki->source = preg_replace_callback(\n $this->regex,\n array(&$this, 'process'),\n $this->wiki->source\n );\n }",
"function update()\n\t{\n\t\tglobal $ilBench;\n\n\t\t$this->upload_source();\n\n\t\t$ilBench->start(\"Editor\",\"Paragraph_update\");\n\t\t// set language and characteristic\n\t\t\n\t\t$this->content_obj->setLanguage($_POST[\"par_language\"]);\n\t\t$this->content_obj->setCharacteristic($_POST[\"par_characteristic\"]);\n\n\t\t//echo \"PARupdate:\".htmlentities($this->content_obj->input2xml($_POST[\"par_content\"])).\":<br>\"; exit;\n\n\t\t \n\t\t// set language and characteristic\n\t\t$this->content_obj->setLanguage($_POST[\"par_language\"]);\n\t\t$this->content_obj->setSubCharacteristic($_POST[\"par_subcharacteristic\"]);\n\t\t$this->content_obj->setDownloadTitle(str_replace('\"', '', ilUtil::stripSlashes($_POST[\"par_downloadtitle\"])));\n\t\t$this->content_obj->setShowLineNumbers($_POST[\"par_showlinenumbers\"]?\"y\":\"n\");\n\t\t$this->content_obj->setAutoIndent($_POST[\"par_autoindent\"]?\"y\":\"n\");\n\t\t$this->content_obj->setSubCharacteristic($_POST[\"par_subcharacteristic\"]);\n\t\t\t$this->content_obj->setCharacteristic(\"Code\");\n\n\t\t$this->updated = $this->content_obj->setText(\n\t\t\t$this->content_obj->input2xml($_POST[\"par_content\"], 0, false));\n\n\t\tif ($this->updated !== true)\n\t\t{\n\t\t\t//echo \"Did not update!\";\n\t\t\t$ilBench->stop(\"Editor\",\"Paragraph_update\");\n\t\t\t$this->edit();\n\t\t\treturn;\n\t\t}\n\n\t\t$this->updated = $this->pg_obj->update();\n\n\t\t$ilBench->stop(\"Editor\",\"Paragraph_update\");\n\n\t\tif ($this->updated === true && $this->ctrl->getCmd () != \"upload\" )\n\t\t{\n\t\t\t$this->ctrl->returnToParent($this, \"jump\".$this->hier_id);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->edit();\n\t\t}\n\t}",
"public function parseAll()\n\t{\n\t\tif($this->_config === null)\n\t\t{\n\t\t\tthrow new YaPhpDoc_Core_Parser_Exception(\n\t\t\t\t$this->l10n()->getTranslation('parser')\n\t\t\t\t->_('Configuration is missing.')\n\t\t\t);\n\t\t}\n\n\t\t$files = $this->getFilesToParse();\n\t\t\n\t\tif(empty($files))\n\t\t{\n\t\t\tthrow new YaPhpDoc_Core_Parser_Exception(\n\t\t\t\t$this->l10n()->getTranslation('parser')\n\t\t\t\t->_('There is no source to parse.')\n\t\t\t);\n\t\t}\n\t\t\n\t\t# Create the root node\n\t\t$this->_root = YaPhpDoc_Token_Abstract::getDocumentToken($this);\n\n\t\t# Start parsing\n\t\tforeach($files as $file)\n\t\t{\n\t\t\t$this->out()->verbose(sprintf($this->l10n()\n\t\t\t\t->getTranslation('parser')->_('Parsing %s'), $file),\n\t\t\tfalse);\n\t\t\t\n\t\t\t$this->_current_file = $file;\n\t\t\t$this->_parseFile($file);\n\t\t}\n\t\t$this->_current_file = null;\n\t\t\n\t\treturn $this;\n\t}",
"abstract public function update(Source $source);",
"protected function setContent(): void\n {\n $this->isFileReadable($this->path);\n $this->content = file_get_contents($this->path);\n }",
"protected function load()\n {\n if ($this->contentLoaded) {\n return;\n }\n\n $content = file_get_contents($this->path);\n\n if (!$content) {\n $this->contentLoaded = true;\n return;\n }\n\n preg_match_all('/\\@([a-z]+)\\s([^\\r\\n\\@]+)/i', $content, $matches, PREG_SET_ORDER);\n\n foreach ($matches as $match) {\n $fullMatch = $match[0];\n $variable = $match[1];\n $value = $match[2];\n\n $content = str_replace($fullMatch, '', $content);\n $this->metadata[$variable] = $value;\n }\n\n $this->content = trim($content, \"\\r\\n\");\n $this->contentLoaded = true;\n }",
"public function process(): void {\n if($this->shouldCache() && $this->hasCache()) {\n $this->restoreCache();\n\n return;\n }\n\n $folders = [];\n foreach($this->sources_to_parse as $source_to_parse) {\n $folder = $source_to_parse->getFolderToParse();\n if(!isset($folders[$folder])) {\n $folders[$folder] = [\n 'extensions' => [],\n 'flags' => [],\n ];\n }\n $folders[$folder]['extensions'] = [...$folders[$folder]['extensions'], ...$source_to_parse->getExtensions()];\n $folders[$folder]['flags'] = [...$folders[$folder]['flags'], ...$source_to_parse->getFlags()];\n }\n\n foreach($folders as $folder => $folder_sources) {\n $folder_sources['extensions'] = array_values(array_unique($folder_sources['extensions']));\n $folder_sources['flags'] = array_values(array_unique($folder_sources['flags']));\n $code_data = $this->analyzer->parseFolder($folder, $folder_sources);\n $this->info_data[] = $code_data;\n $i = count($this->info_data) - 1;\n foreach($folder_sources['flags'] as $flag) {\n if(!isset($this->info_data_flag_refs[$flag])) {\n $this->info_data_flag_refs[$flag] = [];\n }\n $this->info_data_flag_refs[$flag][] = $i;\n }\n $this->flags = [...$this->flags, ...$folder_sources['flags']];\n }\n $this->flags = array_values(array_unique($this->flags));\n\n if($this->shouldCache()) {\n file_put_contents(\n $this->file_cache,\n \"<?php\\n\\nreturn \" .\n var_export([\n 'info_data' => $this->info_data,\n 'info_data_flag_refs' => $this->info_data_flag_refs,\n ], true) . ';',\n );\n }\n }",
"protected function updateRawContent() {\n\t\t\n\t\t$this->rawContent = \"---\".PHP_EOL;\n\t\t$this->rawContent.= 'title: \"'.$this->title.'\"'.PHP_EOL;\n\t\t$this->rawContent.= 'date: '.$this->date.PHP_EOL;\n\t\t$this->rawContent.= 'categories: ['.implode(',',$this->categories).']'.PHP_EOL;\n\t\tif($this->draft) {\n\t\t\t$this->rawContent.='draft: true';\n\t\t}\n\n\t\t$this->rawContent.= '---'.PHP_EOL;\n\n\t\t$this->rawContent.= $this->content;\n\t}",
"public function parse(){\n $this->open();\n\n $this->_getOPF();\n $this->_getDcData();\n $this->_getManifest();\n $this->_getSpine();\n $this->_getTOC();\n\n $this->close();\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Test [if x not_equal=""]...[/if x] where x is a Hidden field | public function test_blank_not_equal_blank() {
$field = FrmField::getOne( 'hidden-field' );
$field_value = '';
$compare_type = 'not_equal';
$compare_to = '';
$opening_tag = '[if ' . $field->id . ' ' . $compare_type . '="' . $compare_to . '"]';
$content = 'Before ' . $opening_tag . 'Hide me[/if ' . $field->id . '] After';
$atts = $this->package_atts_for_jamie_entry( $compare_type, $compare_to, $opening_tag );
$tag = $field->id;
$args = array( 'field' => $field );
FrmProContent::check_conditional_shortcode( $content, $field_value, $atts, $tag, 'if', $args );
$this->assert_conditional_is_false( $content );
} | [
"public function test_blank_not_like_value() {\n\t\t$field = FrmField::getOne( 'hidden-field' );\n\n\t\t$field_value = '';\n\t\t$compare_type = 'not_like';\n\t\t$compare_to = 'fakeValue';\n\n\t\t$opening_tag = '[if ' . $field->id . ' ' . $compare_type . '=\"' . $compare_to . '\"]';\n\t\t$content = 'Before ' . $opening_tag . 'Show me[/if ' . $field->id . '] After';\n\n\t\t$atts = $this->package_atts_for_jamie_entry( $compare_type, $compare_to, $opening_tag );\n\t\t$tag = $field->id;\n\t\t$args = array( 'field' => $field );\n\n\t\tFrmProContent::check_conditional_shortcode( $content, $field_value, $atts, $tag, 'if', $args );\n\n\t\t$this->assert_conditional_is_true( $content );\n\t}",
"public function test_blank_not_equal_to_value() {\n\t\t$field = FrmField::getOne( 'hidden-field' );\n\n\t\t$field_value = '';\n\t\t$compare_type = 'not_equal';\n\t\t$compare_to = 'FakeValue';\n\n\t\t$opening_tag = '[if ' . $field->id . ' ' . $compare_type . '=\"' . $compare_to . '\"]';\n\t\t$content = 'Before ' . $opening_tag . 'Show me[/if ' . $field->id . '] After';\n\n\t\t$atts = $this->package_atts_for_jamie_entry( $compare_type, $compare_to, $opening_tag );\n\t\t$tag = $field->id;\n\t\t$args = array( 'field' => $field );\n\n\t\tFrmProContent::check_conditional_shortcode( $content, $field_value, $atts, $tag, 'if', $args );\n\n\t\t$this->assert_conditional_is_true( $content );\n\t}",
"public function test_hidden_field_equals_blank_true() {\n\t\t$field = FrmField::getOne( 'hidden-field' );\n\n\t\t$field_value = '';\n\t\t$compare_type = 'equals';\n\t\t$compare_to = '';\n\n\t\t$opening_tag = '[if ' . $field->id . ' ' . $compare_type . '=\"' . $compare_to . '\"]';\n\t\t$content = 'Before ' . $opening_tag . 'Show me[/if ' . $field->id . '] After';\n\n\t\t$atts = $this->package_atts_for_jamie_entry( $compare_type, $compare_to, $opening_tag );\n\t\t$tag = $field->id;\n\t\t$args = array( 'field' => $field );\n\n\t\tFrmProContent::check_conditional_shortcode( $content, $field_value, $atts, $tag, 'if', $args );\n\n\t\t$this->assert_conditional_is_true( $content );\n\t}",
"public function test_value_not_equal_blank() {\n\t\t$field = FrmField::getOne( 'text-field' );\n\n\t\t$field_value = 'Jamie';\n\t\t$compare_type = 'not_equal';\n\t\t$compare_to = '';\n\n\t\t$opening_tag = '[if ' . $field->id . ' ' . $compare_type . '=\"' . $compare_to . '\"]';\n\t\t$content = 'Before ' . $opening_tag . 'Show me[/if ' . $field->id . '] After';\n\n\t\t$atts = $this->package_atts_for_steve_entry( $compare_type, $compare_to, $opening_tag );\n\t\t$tag = $field->id;\n\t\t$args = array( 'field' => $field );\n\n\t\tFrmProContent::check_conditional_shortcode( $content, $field_value, $atts, $tag, 'if', $args );\n\n\t\t$this->assert_conditional_is_true( $content );\n\t}",
"public function test_value_like_non_matching_value() {\n\t\t$field = FrmField::getOne( 'text-field' );\n\n\t\t$field_value = 'Jamie';\n\t\t$compare_type = 'like';\n\t\t$compare_to = 'Steve';\n\n\t\t$opening_tag = '[if ' . $field->id . ' ' . $compare_type . '=\"' . $compare_to . '\"]';\n\t\t$content = 'Before ' . $opening_tag . 'Hide me[/if ' . $field->id . '] After';\n\n\t\t$atts = $this->package_atts_for_jamie_entry( $compare_type, $compare_to, $opening_tag );\n\t\t$tag = $field->id;\n\t\t$args = array( 'field' => $field );\n\n\t\tFrmProContent::check_conditional_shortcode( $content, $field_value, $atts, $tag, 'if', $args );\n\n\t\t$this->assert_conditional_is_false( $content );\n\t}",
"public function test_dynamic_field_equals_value_false() {\n\t\t$field = FrmField::getOne( 'dynamic-state' );\n\n\t\t$field_value = FrmEntry::get_id_by_key( 'cali_entry' );\n\t\t$compare_type = 'equals';\n\t\t$compare_to = 'Utah';\n\n\t\t$opening_tag = '[if ' . $field->id . ' ' . $compare_type . '=\"' . $compare_to . '\"]';\n\t\t$content = 'Before ' . $opening_tag . 'Hide me[/if ' . $field->id . '] After';\n\n\t\t$atts = $this->package_atts_for_steph_entry( $compare_type, $compare_to, $opening_tag );\n\n\t\t$tag = $field->id;\n\t\t$args = array( 'field' => $field );\n\n\t\tFrmProContent::check_conditional_shortcode( $content, $field_value, $atts, $tag, 'if', $args );\n\n\t\t$this->assert_conditional_is_false( $content );\n\t}",
"public function test_value_not_like_substring() {\n\t\t$field = FrmField::getOne( 'text-field' );\n\n\t\t$field_value = 'Jamie';\n\t\t$compare_type = 'not_like';\n\t\t$compare_to = 'J';\n\n\t\t$opening_tag = '[if ' . $field->id . ' ' . $compare_type . '=\"' . $compare_to . '\"]';\n\t\t$content = 'Before ' . $opening_tag . 'Hide me[/if ' . $field->id . '] After';\n\n\t\t$atts = $this->package_atts_for_jamie_entry( $compare_type, $compare_to, $opening_tag );\n\t\t$tag = $field->id;\n\t\t$args = array( 'field' => $field );\n\n\t\tFrmProContent::check_conditional_shortcode( $content, $field_value, $atts, $tag, 'if', $args );\n\n\t\t$this->assert_conditional_is_false( $content );\n\t}",
"public function test_dynamic_field_equals_blank_true() {\n\t\t$field = FrmField::getOne( 'dynamic-state' );\n\n\t\t$field_value = '';\n\t\t$compare_type = 'equals';\n\t\t$compare_to = '';\n\n\t\t$opening_tag = '[if ' . $field->id . ' ' . $compare_type . '=\"' . $compare_to . '\"]';\n\t\t$content = 'Before ' . $opening_tag . 'Show me[/if ' . $field->id . '] After';\n\n\t\t$atts = $this->package_atts_for_jamie_entry( $compare_type, $compare_to, $opening_tag );\n\t\t$tag = $field->id;\n\t\t$args = array( 'field' => $field );\n\n\t\tFrmProContent::check_conditional_shortcode( $content, $field_value, $atts, $tag, 'if', $args );\n\n\t\t$this->assert_conditional_is_true( $content );\n\t}",
"public function test_mailchimp_hidden_field_values() {\n\t\tlist( $html_name, $field ) = $this->initialize_mailchimp_field_value_variables( 'hidden-field' );\n\n\t\t$dropdown = $this->get_mailchimp_field_value_dropdown( $html_name, $field, '' );\n\n\t\t$expected = '<input type=\"text\" name=\"' . $html_name . '\" value=\"\" />';\n\n\t\t$this->assertSame( trim( $expected ), trim( $dropdown ) );\n\t}",
"function testHiddenPrintsHiddenField() {\t\t\n\t\t//arrange\n\t\t$HTML = $this->getMockBuilder( '\\CFPB\\Utils\\MetaBox\\HTML' )\n\t\t\t\t\t ->setMethods( null )\n\t\t\t\t\t ->getMock();\n\t\t\\WP_Mock::wpPassthruFunction( 'esc_attr' );\n\t\t$needle = '<input class=\"cms-toolkit-input set-input_12\" id=\"field_key\" name=\"field_key\" type=\"hidden\" value=\"value\" />';\n\n\t\t//act\n\t\tob_start();\n\t\t$HTML->hidden( 'field_key', 'value', 12 );\n\t\t$haystack = ob_get_flush();\n\n\t\t//assert\n\t\t$this->assertContains( $needle, $haystack );\n\t}",
"public function test_dynamic_field_show_field_false() {\n\t\t$field = FrmField::getOne( 'dynamic-state' );\n\n\t\t$field_value = FrmEntry::get_id_by_key( 'cali_entry' );\n\n\t\t$opening_tag = '[if ' . $field->id . ' show=extra-state-info\"]';\n\t\t$content = 'Before ' . $opening_tag . 'Hide me[/if ' . $field->id . '] After';\n\n\t\t$atts = $this->package_atts_for_steph_entry( '', '', $opening_tag, 'extra-state-info' );\n\n\t\t$tag = $field->id;\n\t\t$args = array( 'field' => $field );\n\n\t\tFrmProContent::check_conditional_shortcode( $content, $field_value, $atts, $tag, 'if', $args );\n\n\t\t$this->assert_conditional_is_false( $content );\n\t}",
"public function test_user_id_not_equal_current_false() {\n\t\t$field = FrmField::getOne( 'user-id-field' );\n\t\t$entry = FrmEntry::getOne( 'jamie_entry_key', true );\n\t\t$user_id = $entry->metas[ $field->id ];\n\n\t\twp_set_current_user( $user_id );\n\n\t\t$field_value = $user_id;\n\t\t$compare_type = 'not_equal';\n\t\t$compare_to = 'current';\n\n\t\t$opening_tag = '[if ' . $field->id . ' ' . $compare_type . '=\"' . $compare_to . '\"]';\n\t\t$content = 'Before ' . $opening_tag . 'Hide me[/if ' . $field->id . '] After';\n\n\t\t$atts = $this->package_atts_for_jamie_entry( $compare_type, $compare_to, $opening_tag );\n\t\t$tag = $field->id;\n\t\t$args = array( 'field' => $field );\n\n\t\tFrmProContent::check_conditional_shortcode( $content, $field_value, $atts, $tag, 'if', $args );\n\n\t\t$this->assert_conditional_is_false( $content );\n\t}",
"public function testFilterHiddenField()\n {\n $initial = ' test ';\n $this->_formagic->addItem('hidden', 'test', array(\n 'value' => $initial\n ));\n $result = $this->_formagic->render();\n $this->assertInternalType('string', $result);\n }",
"function test_hidden_tag_should_not_exist()\n\t{\n\t\t$id = $this->factory->post->create( array(\n\t\t\t'post_type' => 'wpcf7_contact_form',\n\t\t\t'post_content' => '[text* your-name]'\n\t\t) );\n\t\t$html = do_shortcode( '[contact-form-7 id=\"'.$id.'\"]' );\n\t\t$res = preg_match( '#<input type=\"hidden\" name=\"__goto\" value=\"http://wp.test/archives/1\".+?>#', $html );\n\t\t$this->assertSame( 0, $res );\n\t}",
"function test_hidden_tag_should_exist()\n\t{\n\t\t$id = $this->factory->post->create( array(\n\t\t\t'post_type' => 'wpcf7_contact_form',\n\t\t\t'post_content' => '[text* your-name]'\n\t\t) );\n\t\t$html = do_shortcode( '[contact-form-7 id=\"'.$id.'\" goto=\"http://wp.test/archives/1\"]' );\n\t\t$this->assertRegExp( '#<input type=\"hidden\" name=\"__goto\" value=\"http://wp.test/archives/1\".+?>#', $html );\n\t}",
"public function test_one_like_zero() {\n\t\t$field = FrmField::getOne( 'msyehy' );\n\n\t\t$field_value = '1';\n\t\t$compare_type = 'like';\n\t\t$compare_to = '0';\n\n\t\t$opening_tag = '[if ' . $field->id . ' ' . $compare_type . '=\"' . $compare_to . '\"]';\n\t\t$content = 'Before ' . $opening_tag . 'Hide me[/if ' . $field->id . '] After';\n\n\t\t$atts = $this->package_atts_for_jamie_entry( $compare_type, $compare_to, $opening_tag );\n\n\t\t$tag = $field->id;\n\t\t$args = array( 'field' => $field );\n\n\t\tFrmProContent::check_conditional_shortcode( $content, $field_value, $atts, $tag, 'if', $args );\n\n\t\t$this->assert_conditional_is_false( $content );\n\t}",
"function open_textbox_CONDITION($val){\n\t\t\t$var_cond=$val;\n\t\t\t$val_cond=$this->attributes['CONDITION_VALUE'];\n\t\tif ($this->attributes['HIDE']=='yes') {\n\t\t\tif (preg_match(\"/,/\", $val_cond)){\n\t\t\t\t$this->check_js.=\"\n valore=document.forms[0].\".$this->attributes['VAR'].\".value;\n\t\t\t\tdocument.forms[0].\".$this->attributes['VAR'].\".value='';\n\t\t\t if (document.getElementById('\".$this->attributes['VAR'].\"'))\n\t\t\t\t document.getElementById('\".$this->attributes['VAR'].\"').style.display='none';\n\t\t\t\t\";\n\t\t\t\t$vals=explode(\",\",$val_cond);\n\t\t\t\tforeach ($vals as $key => $value)\n\t\t\t\t\t$this->check_js.=\" \\n\n\t\t\t\t\tvalue=value_of('$var_cond', '0');\n\t\t\t\t\tif (value=='$value')\n\t\t\t\t\t{\n\t\t\t \tif (document.getElementById('\".$this->attributes['VAR'].\"'))\n\t\t\t\t\t\t\tdocument.getElementById('\".$this->attributes['VAR'].\"').style.display='';\n\t\t\t\t\t document.forms[0].\".$this->attributes['VAR'].\".value=valore;\n\n\t\t\t\t\t}\n\t\t\t\t\t\t\";\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$op ='!=';\n\t\t\t\tif (preg_match(\"/\\!/\", $val_cond)) {\n\t\t\t\t\t#echo \"<hr>$val_cond\";\n\t\t\t\t\t$val_cond=str_replace(\"!\", \"\",$val_cond);\n\t\t\t\t\t#echo \"<hr>$val_cond\";\n\t\t\t\t\t$op='==';\n\t\t\t\t}\n\t\t\t\t$this->check_js=\" \\n\n\t\t\t\tvalue=value_of('$var_cond', '0');\n\t\t\t\tif (value $op '$val_cond')\n\t\t\t\t{\n\t\t\t\t\t\";\n//\t\t\t\tforeach ($this->values as $key => $decode) $this->check_js.=\" \\n\tdocument.forms[0].\".$this->attributes['VAR'].\"[\".($key-1).\"].checked=false;\";\n\t\t\t\t$this->check_js.=\"\n\t\t\t\tdocument.forms[0].\".$this->attributes['VAR'].\".value='';\n\t\t\t if (document.getElementById('\".$this->attributes['VAR'].\"'))\n\t\t\t\t document.getElementById('\".$this->attributes['VAR'].\"').style.display='none';\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t if (document.getElementById('\".$this->attributes['VAR'].\"'))\n\t\t\t\t document.getElementById('\".$this->attributes['VAR'].\"').style.display='';\n\t\t\t\t\";\n\t\t\t}\n\t\t}\n\t\t\telse $this->check_js.=\"\n\t\t\tif (document.getElementById('\".$this->attributes['VAR'].\"'))\n\t\t\t\tdocument.getElementById('\".$this->attributes['VAR'].\"').style.display='';\";\n\t\t\t$this->html=\"<tr id='\".$this->attributes['VAR'].\"' style=\\\"display:\\\">\".$this->html.\"</tr>\";\n\t\t}",
"private function check_hide($name){\n\t\tif(in_array($name, $this->hide)){\n\t\t\t$this->dtstatus = \"Var IS hidden\";\n\t\t\treturn TRUE;\n\t\t}\n\t\telse{\n\t\t\t$this->dtstatus = \"Var IS NOT hidden\";\n\t\t\treturn false;\n\t\t}\n\t}",
"public function test_updated_by_equals_current_false() {\n\t\t$user = $this->get_user_by_role( 'subscriber' );\n\t\twp_set_current_user( $user->ID );\n\n\t\t$actual_id = 1;\n\n\t\t$tag = 'updated_by';\n\t\t$compare_type = 'equals';\n\t\t$compare_to = 'current';\n\n\t\t$opening_tag = '[if ' . $tag . ' ' . $compare_type . '=\"' . $compare_to . '\"]';\n\t\t$content = 'Before ' . $opening_tag . 'Hide me[/if ' . $tag . '] After';\n\n\t\t$atts = $this->package_atts_for_jamie_entry( $compare_type, $compare_to, $opening_tag );\n\n\t\tFrmProContent::check_conditional_shortcode( $content, $actual_id, $atts, $tag, 'if' );\n\n\t\t$this->assert_conditional_is_false( $content );\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set which class SimplePie uses for feed enclosures | public function set_enclosure_class($class = 'SimplePie_Enclosure')
{
} | [
"private function setFeedClass()\n\t{\n\t\t$feed_class = $this->supported_sites->getKey($this->site, 'namespace');\n\t\tif ( $this->feed_type == 'search' ) $feed_class .= ( $this->feed_format == 'unformatted' ) ? '\\Feed\\FetchFeedSearch' : '\\Feed\\Feed';\n\t\tif ( $this->feed_type == 'single' ) $feed_class .= ( $this->feed_format == 'unformatted' ) ? '\\Feed\\FetchFeedSingle' : '\\Feed\\Feed';\n\t\tif ( !class_exists($feed_class) ) return $this->sendError(__('Feed Not Found', 'socialcurator'));\n\t\t$this->feed_class = $feed_class;\n\t}",
"function set_sanitize_class($class = 'SimplePie_Sanitize')\n{\nif (SimplePie_Misc::is_subclass_of($class, 'SimplePie_Sanitize'))\n{\n$this->sanitize = new $class;\nreturn true;\n}\nreturn false;\n}",
"function set_restriction_class($class = 'SimplePie_Restriction')\n{\nif (SimplePie_Misc::is_subclass_of($class, 'SimplePie_Restriction'))\n{\n$this->restriction_class = $class;\nreturn true;\n}\nreturn false;\n}",
"function get_enclosures()\n{\nif (!isset($this->data['enclosures']))\n{\n$this->data['enclosures'] = array();\n\n// Elements\n$captions_parent = null;\n$categories_parent = null;\n$copyrights_parent = null;\n$credits_parent = null;\n$description_parent = null;\n$duration_parent = null;\n$hashes_parent = null;\n$keywords_parent = null;\n$player_parent = null;\n$ratings_parent = null;\n$restrictions_parent = null;\n$thumbnails_parent = null;\n$title_parent = null;\n\n// Let's do the channel and item-level ones first, and just re-use them if we need to.\n$parent = $this->get_feed();\n\n// CAPTIONS\nif ($captions = $this->get_item_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'text'))\n{\nforeach ($captions as $caption)\n{\n$caption_type = null;\n$caption_lang = null;\n$caption_startTime = null;\n$caption_endTime = null;\n$caption_text = null;\nif (isset($caption['attribs']['']['type']))\n{\n$caption_type = $this->sanitize($caption['attribs']['']['type'], SIMPLEPIE_CONSTRUCT_TEXT);\n}\nif (isset($caption['attribs']['']['lang']))\n{\n$caption_lang = $this->sanitize($caption['attribs']['']['lang'], SIMPLEPIE_CONSTRUCT_TEXT);\n}\nif (isset($caption['attribs']['']['start']))\n{\n$caption_startTime = $this->sanitize($caption['attribs']['']['start'], SIMPLEPIE_CONSTRUCT_TEXT);\n}\nif (isset($caption['attribs']['']['end']))\n{\n$caption_endTime = $this->sanitize($caption['attribs']['']['end'], SIMPLEPIE_CONSTRUCT_TEXT);\n}\nif (isset($caption['data']))\n{\n$caption_text = $this->sanitize($caption['data'], SIMPLEPIE_CONSTRUCT_TEXT);\n}\n$captions_parent[] = new $this->feed->caption_class($caption_type, $caption_lang, $caption_startTime, $caption_endTime, $caption_text);\n}\n}\nelseif ($captions = $parent->get_channel_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'text'))\n{\nforeach ($captions as $caption)\n{\n$caption_type = null;\n$caption_lang = null;\n$caption_startTime = null;\n$caption_endTime = null;\n$caption_text = null;\nif (isset($caption['attribs']['']['type']))\n{\n$caption_type = $this->sanitize($caption['attribs']['']['type'], SIMPLEPIE_CONSTRUCT_TEXT);\n}\nif (isset($caption['attribs']['']['lang']))\n{\n$caption_lang = $this->sanitize($caption['attribs']['']['lang'], SIMPLEPIE_CONSTRUCT_TEXT);\n}\nif (isset($caption['attribs']['']['start']))\n{\n$caption_startTime = $this->sanitize($caption['attribs']['']['start'], SIMPLEPIE_CONSTRUCT_TEXT);\n}\nif (isset($caption['attribs']['']['end']))\n{\n$caption_endTime = $this->sanitize($caption['attribs']['']['end'], SIMPLEPIE_CONSTRUCT_TEXT);\n}\nif (isset($caption['data']))\n{\n$caption_text = $this->sanitize($caption['data'], SIMPLEPIE_CONSTRUCT_TEXT);\n}\n$captions_parent[] = new $this->feed->caption_class($caption_type, $caption_lang, $caption_startTime, $caption_endTime, $caption_text);\n}\n}\nif (is_array($captions_parent))\n{\n$captions_parent = array_values(SimplePie_Misc::array_unique($captions_parent));\n}\n\n// CATEGORIES\nforeach ((array) $this->get_item_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'category') as $category)\n{\n$term = null;\n$scheme = null;\n$label = null;\nif (isset($category['data']))\n{\n$term = $this->sanitize($category['data'], SIMPLEPIE_CONSTRUCT_TEXT);\n}\nif (isset($category['attribs']['']['scheme']))\n{\n$scheme = $this->sanitize($category['attribs']['']['scheme'], SIMPLEPIE_CONSTRUCT_TEXT);\n}\nelse\n{\n$scheme = 'http://search.yahoo.com/mrss/category_schema';\n}\nif (isset($category['attribs']['']['label']))\n{\n$label = $this->sanitize($category['attribs']['']['label'], SIMPLEPIE_CONSTRUCT_TEXT);\n}\n$categories_parent[] = new $this->feed->category_class($term, $scheme, $label);\n}\nforeach ((array) $parent->get_channel_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'category') as $category)\n{\n$term = null;\n$scheme = null;\n$label = null;\nif (isset($category['data']))\n{\n$term = $this->sanitize($category['data'], SIMPLEPIE_CONSTRUCT_TEXT);\n}\nif (isset($category['attribs']['']['scheme']))\n{\n$scheme = $this->sanitize($category['attribs']['']['scheme'], SIMPLEPIE_CONSTRUCT_TEXT);\n}\nelse\n{\n$scheme = 'http://search.yahoo.com/mrss/category_schema';\n}\nif (isset($category['attribs']['']['label']))\n{\n$label = $this->sanitize($category['attribs']['']['label'], SIMPLEPIE_CONSTRUCT_TEXT);\n}\n$categories_parent[] = new $this->feed->category_class($term, $scheme, $label);\n}\nforeach ((array) $parent->get_channel_tags(SIMPLEPIE_NAMESPACE_ITUNES, 'category') as $category)\n{\n$term = null;\n$scheme = 'http://www.itunes.com/dtds/podcast-1.0.dtd';\n$label = null;\nif (isset($category['attribs']['']['text']))\n{\n$label = $this->sanitize($category['attribs']['']['text'], SIMPLEPIE_CONSTRUCT_TEXT);\n}\n$categories_parent[] = new $this->feed->category_class($term, $scheme, $label);\n\nif (isset($category['child'][SIMPLEPIE_NAMESPACE_ITUNES]['category']))\n{\nforeach ((array) $category['child'][SIMPLEPIE_NAMESPACE_ITUNES]['category'] as $subcategory)\n{\nif (isset($subcategory['attribs']['']['text']))\n{\n$label = $this->sanitize($subcategory['attribs']['']['text'], SIMPLEPIE_CONSTRUCT_TEXT);\n}\n$categories_parent[] = new $this->feed->category_class($term, $scheme, $label);\n}\n}\n}\nif (is_array($categories_parent))\n{\n$categories_parent = array_values(SimplePie_Misc::array_unique($categories_parent));\n}\n\n// COPYRIGHT\nif ($copyright = $this->get_item_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'copyright'))\n{\n$copyright_url = null;\n$copyright_label = null;\nif (isset($copyright[0]['attribs']['']['url']))\n{\n$copyright_url = $this->sanitize($copyright[0]['attribs']['']['url'], SIMPLEPIE_CONSTRUCT_TEXT);\n}\nif (isset($copyright[0]['data']))\n{\n$copyright_label = $this->sanitize($copyright[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);\n}\n$copyrights_parent = new $this->feed->copyright_class($copyright_url, $copyright_label);\n}\nelseif ($copyright = $parent->get_channel_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'copyright'))\n{\n$copyright_url = null;\n$copyright_label = null;\nif (isset($copyright[0]['attribs']['']['url']))\n{\n$copyright_url = $this->sanitize($copyright[0]['attribs']['']['url'], SIMPLEPIE_CONSTRUCT_TEXT);\n}\nif (isset($copyright[0]['data']))\n{\n$copyright_label = $this->sanitize($copyright[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);\n}\n$copyrights_parent = new $this->feed->copyright_class($copyright_url, $copyright_label);\n}\n\n// CREDITS\nif ($credits = $this->get_item_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'credit'))\n{\nforeach ($credits as $credit)\n{\n$credit_role = null;\n$credit_scheme = null;\n$credit_name = null;\nif (isset($credit['attribs']['']['role']))\n{\n$credit_role = $this->sanitize($credit['attribs']['']['role'], SIMPLEPIE_CONSTRUCT_TEXT);\n}\nif (isset($credit['attribs']['']['scheme']))\n{\n$credit_scheme = $this->sanitize($credit['attribs']['']['scheme'], SIMPLEPIE_CONSTRUCT_TEXT);\n}\nelse\n{\n$credit_scheme = 'urn:ebu';\n}\nif (isset($credit['data']))\n{\n$credit_name = $this->sanitize($credit['data'], SIMPLEPIE_CONSTRUCT_TEXT);\n}\n$credits_parent[] = new $this->feed->credit_class($credit_role, $credit_scheme, $credit_name);\n}\n}\nelseif ($credits = $parent->get_channel_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'credit'))\n{\nforeach ($credits as $credit)\n{\n$credit_role = null;\n$credit_scheme = null;\n$credit_name = null;\nif (isset($credit['attribs']['']['role']))\n{\n$credit_role = $this->sanitize($credit['attribs']['']['role'], SIMPLEPIE_CONSTRUCT_TEXT);\n}\nif (isset($credit['attribs']['']['scheme']))\n{\n$credit_scheme = $this->sanitize($credit['attribs']['']['scheme'], SIMPLEPIE_CONSTRUCT_TEXT);\n}\nelse\n{\n$credit_scheme = 'urn:ebu';\n}\nif (isset($credit['data']))\n{\n$credit_name = $this->sanitize($credit['data'], SIMPLEPIE_CONSTRUCT_TEXT);\n}\n$credits_parent[] = new $this->feed->credit_class($credit_role, $credit_scheme, $credit_name);\n}\n}\nif (is_array($credits_parent))\n{\n$credits_parent = array_values(SimplePie_Misc::array_unique($credits_parent));\n}\n\n// DESCRIPTION\nif ($description_parent = $this->get_item_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'description'))\n{\nif (isset($description_parent[0]['data']))\n{\n$description_parent = $this->sanitize($description_parent[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);\n}\n}\nelseif ($description_parent = $parent->get_channel_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'description'))\n{\nif (isset($description_parent[0]['data']))\n{\n$description_parent = $this->sanitize($description_parent[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);\n}\n}\n\n// DURATION\nif ($duration_parent = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ITUNES, 'duration'))\n{\n$seconds = null;\n$minutes = null;\n$hours = null;\nif (isset($duration_parent[0]['data']))\n{\n$temp = explode(':', $this->sanitize($duration_parent[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT));\nif (sizeof($temp) > 0)\n{\n$seconds = (int) array_pop($temp);\n}\nif (sizeof($temp) > 0)\n{\n$minutes = (int) array_pop($temp);\n$seconds += $minutes * 60;\n}\nif (sizeof($temp) > 0)\n{\n$hours = (int) array_pop($temp);\n$seconds += $hours * 3600;\n}\nunset($temp);\n$duration_parent = $seconds;\n}\n}\n\n// HASHES\nif ($hashes_iterator = $this->get_item_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'hash'))\n{\nforeach ($hashes_iterator as $hash)\n{\n$value = null;\n$algo = null;\nif (isset($hash['data']))\n{\n$value = $this->sanitize($hash['data'], SIMPLEPIE_CONSTRUCT_TEXT);\n}\nif (isset($hash['attribs']['']['algo']))\n{\n$algo = $this->sanitize($hash['attribs']['']['algo'], SIMPLEPIE_CONSTRUCT_TEXT);\n}\nelse\n{\n$algo = 'md5';\n}\n$hashes_parent[] = $algo.':'.$value;\n}\n}\nelseif ($hashes_iterator = $parent->get_channel_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'hash'))\n{\nforeach ($hashes_iterator as $hash)\n{\n$value = null;\n$algo = null;\nif (isset($hash['data']))\n{\n$value = $this->sanitize($hash['data'], SIMPLEPIE_CONSTRUCT_TEXT);\n}\nif (isset($hash['attribs']['']['algo']))\n{\n$algo = $this->sanitize($hash['attribs']['']['algo'], SIMPLEPIE_CONSTRUCT_TEXT);\n}\nelse\n{\n$algo = 'md5';\n}\n$hashes_parent[] = $algo.':'.$value;\n}\n}\nif (is_array($hashes_parent))\n{\n$hashes_parent = array_values(SimplePie_Misc::array_unique($hashes_parent));\n}\n\n// KEYWORDS\nif ($keywords = $this->get_item_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'keywords'))\n{\nif (isset($keywords[0]['data']))\n{\n$temp = explode(',', $this->sanitize($keywords[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT));\nforeach ($temp as $word)\n{\n$keywords_parent[] = trim($word);\n}\n}\nunset($temp);\n}\nelseif ($keywords = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ITUNES, 'keywords'))\n{\nif (isset($keywords[0]['data']))\n{\n$temp = explode(',', $this->sanitize($keywords[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT));\nforeach ($temp as $word)\n{\n$keywords_parent[] = trim($word);\n}\n}\nunset($temp);\n}\nelseif ($keywords = $parent->get_channel_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'keywords'))\n{\nif (isset($keywords[0]['data']))\n{\n$temp = explode(',', $this->sanitize($keywords[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT));\nforeach ($temp as $word)\n{\n$keywords_parent[] = trim($word);\n}\n}\nunset($temp);\n}\nelseif ($keywords = $parent->get_channel_tags(SIMPLEPIE_NAMESPACE_ITUNES, 'keywords'))\n{\nif (isset($keywords[0]['data']))\n{\n$temp = explode(',', $this->sanitize($keywords[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT));\nforeach ($temp as $word)\n{\n$keywords_parent[] = trim($word);\n}\n}\nunset($temp);\n}\nif (is_array($keywords_parent))\n{\n$keywords_parent = array_values(SimplePie_Misc::array_unique($keywords_parent));\n}\n\n// PLAYER\nif ($player_parent = $this->get_item_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'player'))\n{\nif (isset($player_parent[0]['attribs']['']['url']))\n{\n$player_parent = $this->sanitize($player_parent[0]['attribs']['']['url'], SIMPLEPIE_CONSTRUCT_IRI);\n}\n}\nelseif ($player_parent = $parent->get_channel_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'player'))\n{\nif (isset($player_parent[0]['attribs']['']['url']))\n{\n$player_parent = $this->sanitize($player_parent[0]['attribs']['']['url'], SIMPLEPIE_CONSTRUCT_IRI);\n}\n}\n\n// RATINGS\nif ($ratings = $this->get_item_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'rating'))\n{\nforeach ($ratings as $rating)\n{\n$rating_scheme = null;\n$rating_value = null;\nif (isset($rating['attribs']['']['scheme']))\n{\n$rating_scheme = $this->sanitize($rating['attribs']['']['scheme'], SIMPLEPIE_CONSTRUCT_TEXT);\n}\nelse\n{\n$rating_scheme = 'urn:simple';\n}\nif (isset($rating['data']))\n{\n$rating_value = $this->sanitize($rating['data'], SIMPLEPIE_CONSTRUCT_TEXT);\n}\n$ratings_parent[] = new $this->feed->rating_class($rating_scheme, $rating_value);\n}\n}\nelseif ($ratings = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ITUNES, 'explicit'))\n{\nforeach ($ratings as $rating)\n{\n$rating_scheme = 'urn:itunes';\n$rating_value = null;\nif (isset($rating['data']))\n{\n$rating_value = $this->sanitize($rating['data'], SIMPLEPIE_CONSTRUCT_TEXT);\n}\n$ratings_parent[] = new $this->feed->rating_class($rating_scheme, $rating_value);\n}\n}\nelseif ($ratings = $parent->get_channel_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'rating'))\n{\nforeach ($ratings as $rating)\n{\n$rating_scheme = null;\n$rating_value = null;\nif (isset($rating['attribs']['']['scheme']))\n{\n$rating_scheme = $this->sanitize($rating['attribs']['']['scheme'], SIMPLEPIE_CONSTRUCT_TEXT);\n}\nelse\n{\n$rating_scheme = 'urn:simple';\n}\nif (isset($rating['data']))\n{\n$rating_value = $this->sanitize($rating['data'], SIMPLEPIE_CONSTRUCT_TEXT);\n}\n$ratings_parent[] = new $this->feed->rating_class($rating_scheme, $rating_value);\n}\n}\nelseif ($ratings = $parent->get_channel_tags(SIMPLEPIE_NAMESPACE_ITUNES, 'explicit'))\n{\nforeach ($ratings as $rating)\n{\n$rating_scheme = 'urn:itunes';\n$rating_value = null;\nif (isset($rating['data']))\n{\n$rating_value = $this->sanitize($rating['data'], SIMPLEPIE_CONSTRUCT_TEXT);\n}\n$ratings_parent[] = new $this->feed->rating_class($rating_scheme, $rating_value);\n}\n}\nif (is_array($ratings_parent))\n{\n$ratings_parent = array_values(SimplePie_Misc::array_unique($ratings_parent));\n}\n\n// RESTRICTIONS\nif ($restrictions = $this->get_item_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'restriction'))\n{\nforeach ($restrictions as $restriction)\n{\n$restriction_relationship = null;\n$restriction_type = null;\n$restriction_value = null;\nif (isset($restriction['attribs']['']['relationship']))\n{\n$restriction_relationship = $this->sanitize($restriction['attribs']['']['relationship'], SIMPLEPIE_CONSTRUCT_TEXT);\n}\nif (isset($restriction['attribs']['']['type']))\n{\n$restriction_type = $this->sanitize($restriction['attribs']['']['type'], SIMPLEPIE_CONSTRUCT_TEXT);\n}\nif (isset($restriction['data']))\n{\n$restriction_value = $this->sanitize($restriction['data'], SIMPLEPIE_CONSTRUCT_TEXT);\n}\n$restrictions_parent[] = new $this->feed->restriction_class($restriction_relationship, $restriction_type, $restriction_value);\n}\n}\nelseif ($restrictions = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ITUNES, 'block'))\n{\nforeach ($restrictions as $restriction)\n{\n$restriction_relationship = 'allow';\n$restriction_type = null;\n$restriction_value = 'itunes';\nif (isset($restriction['data']) && strtolower($restriction['data']) === 'yes')\n{\n$restriction_relationship = 'deny';\n}\n$restrictions_parent[] = new $this->feed->restriction_class($restriction_relationship, $restriction_type, $restriction_value);\n}\n}\nelseif ($restrictions = $parent->get_channel_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'restriction'))\n{\nforeach ($restrictions as $restriction)\n{\n$restriction_relationship = null;\n$restriction_type = null;\n$restriction_value = null;\nif (isset($restriction['attribs']['']['relationship']))\n{\n$restriction_relationship = $this->sanitize($restriction['attribs']['']['relationship'], SIMPLEPIE_CONSTRUCT_TEXT);\n}\nif (isset($restriction['attribs']['']['type']))\n{\n$restriction_type = $this->sanitize($restriction['attribs']['']['type'], SIMPLEPIE_CONSTRUCT_TEXT);\n}\nif (isset($restriction['data']))\n{\n$restriction_value = $this->sanitize($restriction['data'], SIMPLEPIE_CONSTRUCT_TEXT);\n}\n$restrictions_parent[] = new $this->feed->restriction_class($restriction_relationship, $restriction_type, $restriction_value);\n}\n}\nelseif ($restrictions = $parent->get_channel_tags(SIMPLEPIE_NAMESPACE_ITUNES, 'block'))\n{\nforeach ($restrictions as $restriction)\n{\n$restriction_relationship = 'allow';\n$restriction_type = null;\n$restriction_value = 'itunes';\nif (isset($restriction['data']) && strtolower($restriction['data']) === 'yes')\n{\n$restriction_relationship = 'deny';\n}\n$restrictions_parent[] = new $this->feed->restriction_class($restriction_relationship, $restriction_type, $restriction_value);\n}\n}\nif (is_array($restrictions_parent))\n{\n$restrictions_parent = array_values(SimplePie_Misc::array_unique($restrictions_parent));\n}\n\n// THUMBNAILS\nif ($thumbnails = $this->get_item_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'thumbnail'))\n{\nforeach ($thumbnails as $thumbnail)\n{\nif (isset($thumbnail['attribs']['']['url']))\n{\n$thumbnails_parent[] = $this->sanitize($thumbnail['attribs']['']['url'], SIMPLEPIE_CONSTRUCT_IRI);\n}\n}\n}\nelseif ($thumbnails = $parent->get_channel_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'thumbnail'))\n{\nforeach ($thumbnails as $thumbnail)\n{\nif (isset($thumbnail['attribs']['']['url']))\n{\n$thumbnails_parent[] = $this->sanitize($thumbnail['attribs']['']['url'], SIMPLEPIE_CONSTRUCT_IRI);\n}\n}\n}\n\n// TITLES\nif ($title_parent = $this->get_item_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'title'))\n{\nif (isset($title_parent[0]['data']))\n{\n$title_parent = $this->sanitize($title_parent[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);\n}\n}\nelseif ($title_parent = $parent->get_channel_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'title'))\n{\nif (isset($title_parent[0]['data']))\n{\n$title_parent = $this->sanitize($title_parent[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);\n}\n}\n\n// Clear the memory\nunset($parent);\n\n// Attributes\n$bitrate = null;\n$channels = null;\n$duration = null;\n$expression = null;\n$framerate = null;\n$height = null;\n$javascript = null;\n$lang = null;\n$length = null;\n$medium = null;\n$samplingrate = null;\n$type = null;\n$url = null;\n$width = null;\n\n// Elements\n$captions = null;\n$categories = null;\n$copyrights = null;\n$credits = null;\n$description = null;\n$hashes = null;\n$keywords = null;\n$player = null;\n$ratings = null;\n$restrictions = null;\n$thumbnails = null;\n$title = null;\n\n// If we have media:group tags, loop through them.\nforeach ((array) $this->get_item_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'group') as $group)\n{\nif(isset($group['child']) && isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['content']))\n{\n// If we have media:content tags, loop through them.\nforeach ((array) $group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['content'] as $content)\n{\nif (isset($content['attribs']['']['url']))\n{\n// Attributes\n$bitrate = null;\n$channels = null;\n$duration = null;\n$expression = null;\n$framerate = null;\n$height = null;\n$javascript = null;\n$lang = null;\n$length = null;\n$medium = null;\n$samplingrate = null;\n$type = null;\n$url = null;\n$width = null;\n\n// Elements\n$captions = null;\n$categories = null;\n$copyrights = null;\n$credits = null;\n$description = null;\n$hashes = null;\n$keywords = null;\n$player = null;\n$ratings = null;\n$restrictions = null;\n$thumbnails = null;\n$title = null;\n\n// Start checking the attributes of media:content\nif (isset($content['attribs']['']['bitrate']))\n{\n$bitrate = $this->sanitize($content['attribs']['']['bitrate'], SIMPLEPIE_CONSTRUCT_TEXT);\n}\nif (isset($content['attribs']['']['channels']))\n{\n$channels = $this->sanitize($content['attribs']['']['channels'], SIMPLEPIE_CONSTRUCT_TEXT);\n}\nif (isset($content['attribs']['']['duration']))\n{\n$duration = $this->sanitize($content['attribs']['']['duration'], SIMPLEPIE_CONSTRUCT_TEXT);\n}\nelse\n{\n$duration = $duration_parent;\n}\nif (isset($content['attribs']['']['expression']))\n{\n$expression = $this->sanitize($content['attribs']['']['expression'], SIMPLEPIE_CONSTRUCT_TEXT);\n}\nif (isset($content['attribs']['']['framerate']))\n{\n$framerate = $this->sanitize($content['attribs']['']['framerate'], SIMPLEPIE_CONSTRUCT_TEXT);\n}\nif (isset($content['attribs']['']['height']))\n{\n$height = $this->sanitize($content['attribs']['']['height'], SIMPLEPIE_CONSTRUCT_TEXT);\n}\nif (isset($content['attribs']['']['lang']))\n{\n$lang = $this->sanitize($content['attribs']['']['lang'], SIMPLEPIE_CONSTRUCT_TEXT);\n}\nif (isset($content['attribs']['']['fileSize']))\n{\n$length = ceil($content['attribs']['']['fileSize']);\n}\nif (isset($content['attribs']['']['medium']))\n{\n$medium = $this->sanitize($content['attribs']['']['medium'], SIMPLEPIE_CONSTRUCT_TEXT);\n}\nif (isset($content['attribs']['']['samplingrate']))\n{\n$samplingrate = $this->sanitize($content['attribs']['']['samplingrate'], SIMPLEPIE_CONSTRUCT_TEXT);\n}\nif (isset($content['attribs']['']['type']))\n{\n$type = $this->sanitize($content['attribs']['']['type'], SIMPLEPIE_CONSTRUCT_TEXT);\n}\nif (isset($content['attribs']['']['width']))\n{\n$width = $this->sanitize($content['attribs']['']['width'], SIMPLEPIE_CONSTRUCT_TEXT);\n}\n$url = $this->sanitize($content['attribs']['']['url'], SIMPLEPIE_CONSTRUCT_IRI);\n\n// Checking the other optional media: elements. Priority: media:content, media:group, item, channel\n\n// CAPTIONS\nif (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['text']))\n{\nforeach ($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['text'] as $caption)\n{\n$caption_type = null;\n$caption_lang = null;\n$caption_startTime = null;\n$caption_endTime = null;\n$caption_text = null;\nif (isset($caption['attribs']['']['type']))\n{\n$caption_type = $this->sanitize($caption['attribs']['']['type'], SIMPLEPIE_CONSTRUCT_TEXT);\n}\nif (isset($caption['attribs']['']['lang']))\n{\n$caption_lang = $this->sanitize($caption['attribs']['']['lang'], SIMPLEPIE_CONSTRUCT_TEXT);\n}\nif (isset($caption['attribs']['']['start']))\n{\n$caption_startTime = $this->sanitize($caption['attribs']['']['start'], SIMPLEPIE_CONSTRUCT_TEXT);\n}\nif (isset($caption['attribs']['']['end']))\n{\n$caption_endTime = $this->sanitize($caption['attribs']['']['end'], SIMPLEPIE_CONSTRUCT_TEXT);\n}\nif (isset($caption['data']))\n{\n$caption_text = $this->sanitize($caption['data'], SIMPLEPIE_CONSTRUCT_TEXT);\n}\n$captions[] = new $this->feed->caption_class($caption_type, $caption_lang, $caption_startTime, $caption_endTime, $caption_text);\n}\nif (is_array($captions))\n{\n$captions = array_values(SimplePie_Misc::array_unique($captions));\n}\n}\nelseif (isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['text']))\n{\nforeach ($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['text'] as $caption)\n{\n$caption_type = null;\n$caption_lang = null;\n$caption_startTime = null;\n$caption_endTime = null;\n$caption_text = null;\nif (isset($caption['attribs']['']['type']))\n{\n$caption_type = $this->sanitize($caption['attribs']['']['type'], SIMPLEPIE_CONSTRUCT_TEXT);\n}\nif (isset($caption['attribs']['']['lang']))\n{\n$caption_lang = $this->sanitize($caption['attribs']['']['lang'], SIMPLEPIE_CONSTRUCT_TEXT);\n}\nif (isset($caption['attribs']['']['start']))\n{\n$caption_startTime = $this->sanitize($caption['attribs']['']['start'], SIMPLEPIE_CONSTRUCT_TEXT);\n}\nif (isset($caption['attribs']['']['end']))\n{\n$caption_endTime = $this->sanitize($caption['attribs']['']['end'], SIMPLEPIE_CONSTRUCT_TEXT);\n}\nif (isset($caption['data']))\n{\n$caption_text = $this->sanitize($caption['data'], SIMPLEPIE_CONSTRUCT_TEXT);\n}\n$captions[] = new $this->feed->caption_class($caption_type, $caption_lang, $caption_startTime, $caption_endTime, $caption_text);\n}\nif (is_array($captions))\n{\n$captions = array_values(SimplePie_Misc::array_unique($captions));\n}\n}\nelse\n{\n$captions = $captions_parent;\n}\n\n// CATEGORIES\nif (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['category']))\n{\nforeach ((array) $content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['category'] as $category)\n{\n$term = null;\n$scheme = null;\n$label = null;\nif (isset($category['data']))\n{\n$term = $this->sanitize($category['data'], SIMPLEPIE_CONSTRUCT_TEXT);\n}\nif (isset($category['attribs']['']['scheme']))\n{\n$scheme = $this->sanitize($category['attribs']['']['scheme'], SIMPLEPIE_CONSTRUCT_TEXT);\n}\nelse\n{\n$scheme = 'http://search.yahoo.com/mrss/category_schema';\n}\nif (isset($category['attribs']['']['label']))\n{\n$label = $this->sanitize($category['attribs']['']['label'], SIMPLEPIE_CONSTRUCT_TEXT);\n}\n$categories[] = new $this->feed->category_class($term, $scheme, $label);\n}\n}\nif (isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['category']))\n{\nforeach ((array) $group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['category'] as $category)\n{\n$term = null;\n$scheme = null;\n$label = null;\nif (isset($category['data']))\n{\n$term = $this->sanitize($category['data'], SIMPLEPIE_CONSTRUCT_TEXT);\n}\nif (isset($category['attribs']['']['scheme']))\n{\n$scheme = $this->sanitize($category['attribs']['']['scheme'], SIMPLEPIE_CONSTRUCT_TEXT);\n}\nelse\n{\n$scheme = 'http://search.yahoo.com/mrss/category_schema';\n}\nif (isset($category['attribs']['']['label']))\n{\n$label = $this->sanitize($category['attribs']['']['label'], SIMPLEPIE_CONSTRUCT_TEXT);\n}\n$categories[] = new $this->feed->category_class($term, $scheme, $label);\n}\n}\nif (is_array($categories) && is_array($categories_parent))\n{\n$categories = array_values(SimplePie_Misc::array_unique(array_merge($categories, $categories_parent)));\n}\nelseif (is_array($categories))\n{\n$categories = array_values(SimplePie_Misc::array_unique($categories));\n}\nelseif (is_array($categories_parent))\n{\n$categories = array_values(SimplePie_Misc::array_unique($categories_parent));\n}\n\n// COPYRIGHTS\nif (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['copyright']))\n{\n$copyright_url = null;\n$copyright_label = null;\nif (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['copyright'][0]['attribs']['']['url']))\n{\n$copyright_url = $this->sanitize($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['copyright'][0]['attribs']['']['url'], SIMPLEPIE_CONSTRUCT_TEXT);\n}\nif (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['copyright'][0]['data']))\n{\n$copyright_label = $this->sanitize($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['copyright'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);\n}\n$copyrights = new $this->feed->copyright_class($copyright_url, $copyright_label);\n}\nelseif (isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['copyright']))\n{\n$copyright_url = null;\n$copyright_label = null;\nif (isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['copyright'][0]['attribs']['']['url']))\n{\n$copyright_url = $this->sanitize($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['copyright'][0]['attribs']['']['url'], SIMPLEPIE_CONSTRUCT_TEXT);\n}\nif (isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['copyright'][0]['data']))\n{\n$copyright_label = $this->sanitize($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['copyright'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);\n}\n$copyrights = new $this->feed->copyright_class($copyright_url, $copyright_label);\n}\nelse\n{\n$copyrights = $copyrights_parent;\n}\n\n// CREDITS\nif (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['credit']))\n{\nforeach ($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['credit'] as $credit)\n{\n$credit_role = null;\n$credit_scheme = null;\n$credit_name = null;\nif (isset($credit['attribs']['']['role']))\n{\n$credit_role = $this->sanitize($credit['attribs']['']['role'], SIMPLEPIE_CONSTRUCT_TEXT);\n}\nif (isset($credit['attribs']['']['scheme']))\n{\n$credit_scheme = $this->sanitize($credit['attribs']['']['scheme'], SIMPLEPIE_CONSTRUCT_TEXT);\n}\nelse\n{\n$credit_scheme = 'urn:ebu';\n}\nif (isset($credit['data']))\n{\n$credit_name = $this->sanitize($credit['data'], SIMPLEPIE_CONSTRUCT_TEXT);\n}\n$credits[] = new $this->feed->credit_class($credit_role, $credit_scheme, $credit_name);\n}\nif (is_array($credits))\n{\n$credits = array_values(SimplePie_Misc::array_unique($credits));\n}\n}\nelseif (isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['credit']))\n{\nforeach ($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['credit'] as $credit)\n{\n$credit_role = null;\n$credit_scheme = null;\n$credit_name = null;\nif (isset($credit['attribs']['']['role']))\n{\n$credit_role = $this->sanitize($credit['attribs']['']['role'], SIMPLEPIE_CONSTRUCT_TEXT);\n}\nif (isset($credit['attribs']['']['scheme']))\n{\n$credit_scheme = $this->sanitize($credit['attribs']['']['scheme'], SIMPLEPIE_CONSTRUCT_TEXT);\n}\nelse\n{\n$credit_scheme = 'urn:ebu';\n}\nif (isset($credit['data']))\n{\n$credit_name = $this->sanitize($credit['data'], SIMPLEPIE_CONSTRUCT_TEXT);\n}\n$credits[] = new $this->feed->credit_class($credit_role, $credit_scheme, $credit_name);\n}\nif (is_array($credits))\n{\n$credits = array_values(SimplePie_Misc::array_unique($credits));\n}\n}\nelse\n{\n$credits = $credits_parent;\n}\n\n// DESCRIPTION\nif (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['description']))\n{\n$description = $this->sanitize($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['description'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);\n}\nelseif (isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['description']))\n{\n$description = $this->sanitize($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['description'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);\n}\nelse\n{\n$description = $description_parent;\n}\n\n// HASHES\nif (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['hash']))\n{\nforeach ($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['hash'] as $hash)\n{\n$value = null;\n$algo = null;\nif (isset($hash['data']))\n{\n$value = $this->sanitize($hash['data'], SIMPLEPIE_CONSTRUCT_TEXT);\n}\nif (isset($hash['attribs']['']['algo']))\n{\n$algo = $this->sanitize($hash['attribs']['']['algo'], SIMPLEPIE_CONSTRUCT_TEXT);\n}\nelse\n{\n$algo = 'md5';\n}\n$hashes[] = $algo.':'.$value;\n}\nif (is_array($hashes))\n{\n$hashes = array_values(SimplePie_Misc::array_unique($hashes));\n}\n}\nelseif (isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['hash']))\n{\nforeach ($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['hash'] as $hash)\n{\n$value = null;\n$algo = null;\nif (isset($hash['data']))\n{\n$value = $this->sanitize($hash['data'], SIMPLEPIE_CONSTRUCT_TEXT);\n}\nif (isset($hash['attribs']['']['algo']))\n{\n$algo = $this->sanitize($hash['attribs']['']['algo'], SIMPLEPIE_CONSTRUCT_TEXT);\n}\nelse\n{\n$algo = 'md5';\n}\n$hashes[] = $algo.':'.$value;\n}\nif (is_array($hashes))\n{\n$hashes = array_values(SimplePie_Misc::array_unique($hashes));\n}\n}\nelse\n{\n$hashes = $hashes_parent;\n}\n\n// KEYWORDS\nif (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['keywords']))\n{\nif (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['keywords'][0]['data']))\n{\n$temp = explode(',', $this->sanitize($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['keywords'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT));\nforeach ($temp as $word)\n{\n$keywords[] = trim($word);\n}\nunset($temp);\n}\nif (is_array($keywords))\n{\n$keywords = array_values(SimplePie_Misc::array_unique($keywords));\n}\n}\nelseif (isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['keywords']))\n{\nif (isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['keywords'][0]['data']))\n{\n$temp = explode(',', $this->sanitize($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['keywords'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT));\nforeach ($temp as $word)\n{\n$keywords[] = trim($word);\n}\nunset($temp);\n}\nif (is_array($keywords))\n{\n$keywords = array_values(SimplePie_Misc::array_unique($keywords));\n}\n}\nelse\n{\n$keywords = $keywords_parent;\n}\n\n// PLAYER\nif (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['player']))\n{\n$player = $this->sanitize($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['player'][0]['attribs']['']['url'], SIMPLEPIE_CONSTRUCT_IRI);\n}\nelseif (isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['player']))\n{\n$player = $this->sanitize($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['player'][0]['attribs']['']['url'], SIMPLEPIE_CONSTRUCT_IRI);\n}\nelse\n{\n$player = $player_parent;\n}\n\n// RATINGS\nif (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['rating']))\n{\nforeach ($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['rating'] as $rating)\n{\n$rating_scheme = null;\n$rating_value = null;\nif (isset($rating['attribs']['']['scheme']))\n{\n$rating_scheme = $this->sanitize($rating['attribs']['']['scheme'], SIMPLEPIE_CONSTRUCT_TEXT);\n}\nelse\n{\n$rating_scheme = 'urn:simple';\n}\nif (isset($rating['data']))\n{\n$rating_value = $this->sanitize($rating['data'], SIMPLEPIE_CONSTRUCT_TEXT);\n}\n$ratings[] = new $this->feed->rating_class($rating_scheme, $rating_value);\n}\nif (is_array($ratings))\n{\n$ratings = array_values(SimplePie_Misc::array_unique($ratings));\n}\n}\nelseif (isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['rating']))\n{\nforeach ($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['rating'] as $rating)\n{\n$rating_scheme = null;\n$rating_value = null;\nif (isset($rating['attribs']['']['scheme']))\n{\n$rating_scheme = $this->sanitize($rating['attribs']['']['scheme'], SIMPLEPIE_CONSTRUCT_TEXT);\n}\nelse\n{\n$rating_scheme = 'urn:simple';\n}\nif (isset($rating['data']))\n{\n$rating_value = $this->sanitize($rating['data'], SIMPLEPIE_CONSTRUCT_TEXT);\n}\n$ratings[] = new $this->feed->rating_class($rating_scheme, $rating_value);\n}\nif (is_array($ratings))\n{\n$ratings = array_values(SimplePie_Misc::array_unique($ratings));\n}\n}\nelse\n{\n$ratings = $ratings_parent;\n}\n\n// RESTRICTIONS\nif (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['restriction']))\n{\nforeach ($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['restriction'] as $restriction)\n{\n$restriction_relationship = null;\n$restriction_type = null;\n$restriction_value = null;\nif (isset($restriction['attribs']['']['relationship']))\n{\n$restriction_relationship = $this->sanitize($restriction['attribs']['']['relationship'], SIMPLEPIE_CONSTRUCT_TEXT);\n}\nif (isset($restriction['attribs']['']['type']))\n{\n$restriction_type = $this->sanitize($restriction['attribs']['']['type'], SIMPLEPIE_CONSTRUCT_TEXT);\n}\nif (isset($restriction['data']))\n{\n$restriction_value = $this->sanitize($restriction['data'], SIMPLEPIE_CONSTRUCT_TEXT);\n}\n$restrictions[] = new $this->feed->restriction_class($restriction_relationship, $restriction_type, $restriction_value);\n}\nif (is_array($restrictions))\n{\n$restrictions = array_values(SimplePie_Misc::array_unique($restrictions));\n}\n}\nelseif (isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['restriction']))\n{\nforeach ($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['restriction'] as $restriction)\n{\n$restriction_relationship = null;\n$restriction_type = null;\n$restriction_value = null;\nif (isset($restriction['attribs']['']['relationship']))\n{\n$restriction_relationship = $this->sanitize($restriction['attribs']['']['relationship'], SIMPLEPIE_CONSTRUCT_TEXT);\n}\nif (isset($restriction['attribs']['']['type']))\n{\n$restriction_type = $this->sanitize($restriction['attribs']['']['type'], SIMPLEPIE_CONSTRUCT_TEXT);\n}\nif (isset($restriction['data']))\n{\n$restriction_value = $this->sanitize($restriction['data'], SIMPLEPIE_CONSTRUCT_TEXT);\n}\n$restrictions[] = new $this->feed->restriction_class($restriction_relationship, $restriction_type, $restriction_value);\n}\nif (is_array($restrictions))\n{\n$restrictions = array_values(SimplePie_Misc::array_unique($restrictions));\n}\n}\nelse\n{\n$restrictions = $restrictions_parent;\n}\n\n// THUMBNAILS\nif (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['thumbnail']))\n{\nforeach ($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['thumbnail'] as $thumbnail)\n{\n$thumbnails[] = $this->sanitize($thumbnail['attribs']['']['url'], SIMPLEPIE_CONSTRUCT_IRI);\n}\nif (is_array($thumbnails))\n{\n$thumbnails = array_values(SimplePie_Misc::array_unique($thumbnails));\n}\n}\nelseif (isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['thumbnail']))\n{\nforeach ($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['thumbnail'] as $thumbnail)\n{\n$thumbnails[] = $this->sanitize($thumbnail['attribs']['']['url'], SIMPLEPIE_CONSTRUCT_IRI);\n}\nif (is_array($thumbnails))\n{\n$thumbnails = array_values(SimplePie_Misc::array_unique($thumbnails));\n}\n}\nelse\n{\n$thumbnails = $thumbnails_parent;\n}\n\n// TITLES\nif (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['title']))\n{\n$title = $this->sanitize($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['title'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);\n}\nelseif (isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['title']))\n{\n$title = $this->sanitize($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['title'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);\n}\nelse\n{\n$title = $title_parent;\n}\n\n$this->data['enclosures'][] = new $this->feed->enclosure_class($url, $type, $length, $this->feed->javascript, $bitrate, $captions, $categories, $channels, $copyrights, $credits, $description, $duration, $expression, $framerate, $hashes, $height, $keywords, $lang, $medium, $player, $ratings, $restrictions, $samplingrate, $thumbnails, $title, $width);\n}\n}\n}\n}\n\n// If we have standalone media:content tags, loop through them.\nif (isset($this->data['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['content']))\n{\nforeach ((array) $this->data['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['content'] as $content)\n{\nif (isset($content['attribs']['']['url']) || isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['player']))\n{\n// Attributes\n$bitrate = null;\n$channels = null;\n$duration = null;\n$expression = null;\n$framerate = null;\n$height = null;\n$javascript = null;\n$lang = null;\n$length = null;\n$medium = null;\n$samplingrate = null;\n$type = null;\n$url = null;\n$width = null;\n\n// Elements\n$captions = null;\n$categories = null;\n$copyrights = null;\n$credits = null;\n$description = null;\n$hashes = null;\n$keywords = null;\n$player = null;\n$ratings = null;\n$restrictions = null;\n$thumbnails = null;\n$title = null;\n\n// Start checking the attributes of media:content\nif (isset($content['attribs']['']['bitrate']))\n{\n$bitrate = $this->sanitize($content['attribs']['']['bitrate'], SIMPLEPIE_CONSTRUCT_TEXT);\n}\nif (isset($content['attribs']['']['channels']))\n{\n$channels = $this->sanitize($content['attribs']['']['channels'], SIMPLEPIE_CONSTRUCT_TEXT);\n}\nif (isset($content['attribs']['']['duration']))\n{\n$duration = $this->sanitize($content['attribs']['']['duration'], SIMPLEPIE_CONSTRUCT_TEXT);\n}\nelse\n{\n$duration = $duration_parent;\n}\nif (isset($content['attribs']['']['expression']))\n{\n$expression = $this->sanitize($content['attribs']['']['expression'], SIMPLEPIE_CONSTRUCT_TEXT);\n}\nif (isset($content['attribs']['']['framerate']))\n{\n$framerate = $this->sanitize($content['attribs']['']['framerate'], SIMPLEPIE_CONSTRUCT_TEXT);\n}\nif (isset($content['attribs']['']['height']))\n{\n$height = $this->sanitize($content['attribs']['']['height'], SIMPLEPIE_CONSTRUCT_TEXT);\n}\nif (isset($content['attribs']['']['lang']))\n{\n$lang = $this->sanitize($content['attribs']['']['lang'], SIMPLEPIE_CONSTRUCT_TEXT);\n}\nif (isset($content['attribs']['']['fileSize']))\n{\n$length = ceil($content['attribs']['']['fileSize']);\n}\nif (isset($content['attribs']['']['medium']))\n{\n$medium = $this->sanitize($content['attribs']['']['medium'], SIMPLEPIE_CONSTRUCT_TEXT);\n}\nif (isset($content['attribs']['']['samplingrate']))\n{\n$samplingrate = $this->sanitize($content['attribs']['']['samplingrate'], SIMPLEPIE_CONSTRUCT_TEXT);\n}\nif (isset($content['attribs']['']['type']))\n{\n$type = $this->sanitize($content['attribs']['']['type'], SIMPLEPIE_CONSTRUCT_TEXT);\n}\nif (isset($content['attribs']['']['width']))\n{\n$width = $this->sanitize($content['attribs']['']['width'], SIMPLEPIE_CONSTRUCT_TEXT);\n}\nif (isset($content['attribs']['']['url']))\n{\n$url = $this->sanitize($content['attribs']['']['url'], SIMPLEPIE_CONSTRUCT_IRI);\n}\n// Checking the other optional media: elements. Priority: media:content, media:group, item, channel\n\n// CAPTIONS\nif (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['text']))\n{\nforeach ($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['text'] as $caption)\n{\n$caption_type = null;\n$caption_lang = null;\n$caption_startTime = null;\n$caption_endTime = null;\n$caption_text = null;\nif (isset($caption['attribs']['']['type']))\n{\n$caption_type = $this->sanitize($caption['attribs']['']['type'], SIMPLEPIE_CONSTRUCT_TEXT);\n}\nif (isset($caption['attribs']['']['lang']))\n{\n$caption_lang = $this->sanitize($caption['attribs']['']['lang'], SIMPLEPIE_CONSTRUCT_TEXT);\n}\nif (isset($caption['attribs']['']['start']))\n{\n$caption_startTime = $this->sanitize($caption['attribs']['']['start'], SIMPLEPIE_CONSTRUCT_TEXT);\n}\nif (isset($caption['attribs']['']['end']))\n{\n$caption_endTime = $this->sanitize($caption['attribs']['']['end'], SIMPLEPIE_CONSTRUCT_TEXT);\n}\nif (isset($caption['data']))\n{\n$caption_text = $this->sanitize($caption['data'], SIMPLEPIE_CONSTRUCT_TEXT);\n}\n$captions[] = new $this->feed->caption_class($caption_type, $caption_lang, $caption_startTime, $caption_endTime, $caption_text);\n}\nif (is_array($captions))\n{\n$captions = array_values(SimplePie_Misc::array_unique($captions));\n}\n}\nelse\n{\n$captions = $captions_parent;\n}\n\n// CATEGORIES\nif (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['category']))\n{\nforeach ((array) $content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['category'] as $category)\n{\n$term = null;\n$scheme = null;\n$label = null;\nif (isset($category['data']))\n{\n$term = $this->sanitize($category['data'], SIMPLEPIE_CONSTRUCT_TEXT);\n}\nif (isset($category['attribs']['']['scheme']))\n{\n$scheme = $this->sanitize($category['attribs']['']['scheme'], SIMPLEPIE_CONSTRUCT_TEXT);\n}\nelse\n{\n$scheme = 'http://search.yahoo.com/mrss/category_schema';\n}\nif (isset($category['attribs']['']['label']))\n{\n$label = $this->sanitize($category['attribs']['']['label'], SIMPLEPIE_CONSTRUCT_TEXT);\n}\n$categories[] = new $this->feed->category_class($term, $scheme, $label);\n}\n}\nif (is_array($categories) && is_array($categories_parent))\n{\n$categories = array_values(SimplePie_Misc::array_unique(array_merge($categories, $categories_parent)));\n}\nelseif (is_array($categories))\n{\n$categories = array_values(SimplePie_Misc::array_unique($categories));\n}\nelseif (is_array($categories_parent))\n{\n$categories = array_values(SimplePie_Misc::array_unique($categories_parent));\n}\nelse\n{\n$categories = null;\n}\n\n// COPYRIGHTS\nif (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['copyright']))\n{\n$copyright_url = null;\n$copyright_label = null;\nif (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['copyright'][0]['attribs']['']['url']))\n{\n$copyright_url = $this->sanitize($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['copyright'][0]['attribs']['']['url'], SIMPLEPIE_CONSTRUCT_TEXT);\n}\nif (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['copyright'][0]['data']))\n{\n$copyright_label = $this->sanitize($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['copyright'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);\n}\n$copyrights = new $this->feed->copyright_class($copyright_url, $copyright_label);\n}\nelse\n{\n$copyrights = $copyrights_parent;\n}\n\n// CREDITS\nif (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['credit']))\n{\nforeach ($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['credit'] as $credit)\n{\n$credit_role = null;\n$credit_scheme = null;\n$credit_name = null;\nif (isset($credit['attribs']['']['role']))\n{\n$credit_role = $this->sanitize($credit['attribs']['']['role'], SIMPLEPIE_CONSTRUCT_TEXT);\n}\nif (isset($credit['attribs']['']['scheme']))\n{\n$credit_scheme = $this->sanitize($credit['attribs']['']['scheme'], SIMPLEPIE_CONSTRUCT_TEXT);\n}\nelse\n{\n$credit_scheme = 'urn:ebu';\n}\nif (isset($credit['data']))\n{\n$credit_name = $this->sanitize($credit['data'], SIMPLEPIE_CONSTRUCT_TEXT);\n}\n$credits[] = new $this->feed->credit_class($credit_role, $credit_scheme, $credit_name);\n}\nif (is_array($credits))\n{\n$credits = array_values(SimplePie_Misc::array_unique($credits));\n}\n}\nelse\n{\n$credits = $credits_parent;\n}\n\n// DESCRIPTION\nif (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['description']))\n{\n$description = $this->sanitize($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['description'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);\n}\nelse\n{\n$description = $description_parent;\n}\n\n// HASHES\nif (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['hash']))\n{\nforeach ($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['hash'] as $hash)\n{\n$value = null;\n$algo = null;\nif (isset($hash['data']))\n{\n$value = $this->sanitize($hash['data'], SIMPLEPIE_CONSTRUCT_TEXT);\n}\nif (isset($hash['attribs']['']['algo']))\n{\n$algo = $this->sanitize($hash['attribs']['']['algo'], SIMPLEPIE_CONSTRUCT_TEXT);\n}\nelse\n{\n$algo = 'md5';\n}\n$hashes[] = $algo.':'.$value;\n}\nif (is_array($hashes))\n{\n$hashes = array_values(SimplePie_Misc::array_unique($hashes));\n}\n}\nelse\n{\n$hashes = $hashes_parent;\n}\n\n// KEYWORDS\nif (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['keywords']))\n{\nif (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['keywords'][0]['data']))\n{\n$temp = explode(',', $this->sanitize($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['keywords'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT));\nforeach ($temp as $word)\n{\n$keywords[] = trim($word);\n}\nunset($temp);\n}\nif (is_array($keywords))\n{\n$keywords = array_values(SimplePie_Misc::array_unique($keywords));\n}\n}\nelse\n{\n$keywords = $keywords_parent;\n}\n\n// PLAYER\nif (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['player']))\n{\n$player = $this->sanitize($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['player'][0]['attribs']['']['url'], SIMPLEPIE_CONSTRUCT_IRI);\n}\nelse\n{\n$player = $player_parent;\n}\n\n// RATINGS\nif (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['rating']))\n{\nforeach ($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['rating'] as $rating)\n{\n$rating_scheme = null;\n$rating_value = null;\nif (isset($rating['attribs']['']['scheme']))\n{\n$rating_scheme = $this->sanitize($rating['attribs']['']['scheme'], SIMPLEPIE_CONSTRUCT_TEXT);\n}\nelse\n{\n$rating_scheme = 'urn:simple';\n}\nif (isset($rating['data']))\n{\n$rating_value = $this->sanitize($rating['data'], SIMPLEPIE_CONSTRUCT_TEXT);\n}\n$ratings[] = new $this->feed->rating_class($rating_scheme, $rating_value);\n}\nif (is_array($ratings))\n{\n$ratings = array_values(SimplePie_Misc::array_unique($ratings));\n}\n}\nelse\n{\n$ratings = $ratings_parent;\n}\n\n// RESTRICTIONS\nif (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['restriction']))\n{\nforeach ($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['restriction'] as $restriction)\n{\n$restriction_relationship = null;\n$restriction_type = null;\n$restriction_value = null;\nif (isset($restriction['attribs']['']['relationship']))\n{\n$restriction_relationship = $this->sanitize($restriction['attribs']['']['relationship'], SIMPLEPIE_CONSTRUCT_TEXT);\n}\nif (isset($restriction['attribs']['']['type']))\n{\n$restriction_type = $this->sanitize($restriction['attribs']['']['type'], SIMPLEPIE_CONSTRUCT_TEXT);\n}\nif (isset($restriction['data']))\n{\n$restriction_value = $this->sanitize($restriction['data'], SIMPLEPIE_CONSTRUCT_TEXT);\n}\n$restrictions[] = new $this->feed->restriction_class($restriction_relationship, $restriction_type, $restriction_value);\n}\nif (is_array($restrictions))\n{\n$restrictions = array_values(SimplePie_Misc::array_unique($restrictions));\n}\n}\nelse\n{\n$restrictions = $restrictions_parent;\n}\n\n// THUMBNAILS\nif (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['thumbnail']))\n{\nforeach ($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['thumbnail'] as $thumbnail)\n{\n$thumbnails[] = $this->sanitize($thumbnail['attribs']['']['url'], SIMPLEPIE_CONSTRUCT_IRI);\n}\nif (is_array($thumbnails))\n{\n$thumbnails = array_values(SimplePie_Misc::array_unique($thumbnails));\n}\n}\nelse\n{\n$thumbnails = $thumbnails_parent;\n}\n\n// TITLES\nif (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['title']))\n{\n$title = $this->sanitize($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['title'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);\n}\nelse\n{\n$title = $title_parent;\n}\n\n$this->data['enclosures'][] = new $this->feed->enclosure_class($url, $type, $length, $this->feed->javascript, $bitrate, $captions, $categories, $channels, $copyrights, $credits, $description, $duration, $expression, $framerate, $hashes, $height, $keywords, $lang, $medium, $player, $ratings, $restrictions, $samplingrate, $thumbnails, $title, $width);\n}\n}\n}\n\nforeach ((array) $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'link') as $link)\n{\nif (isset($link['attribs']['']['href']) && !empty($link['attribs']['']['rel']) && $link['attribs']['']['rel'] === 'enclosure')\n{\n// Attributes\n$bitrate = null;\n$channels = null;\n$duration = null;\n$expression = null;\n$framerate = null;\n$height = null;\n$javascript = null;\n$lang = null;\n$length = null;\n$medium = null;\n$samplingrate = null;\n$type = null;\n$url = null;\n$width = null;\n\n$url = $this->sanitize($link['attribs']['']['href'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($link));\nif (isset($link['attribs']['']['type']))\n{\n$type = $this->sanitize($link['attribs']['']['type'], SIMPLEPIE_CONSTRUCT_TEXT);\n}\nif (isset($link['attribs']['']['length']))\n{\n$length = ceil($link['attribs']['']['length']);\n}\n\n// Since we don't have group or content for these, we'll just pass the '*_parent' variables directly to the constructor\n$this->data['enclosures'][] = new $this->feed->enclosure_class($url, $type, $length, $this->feed->javascript, $bitrate, $captions_parent, $categories_parent, $channels, $copyrights_parent, $credits_parent, $description_parent, $duration_parent, $expression, $framerate, $hashes_parent, $height, $keywords_parent, $lang, $medium, $player_parent, $ratings_parent, $restrictions_parent, $samplingrate, $thumbnails_parent, $title_parent, $width);\n}\n}\n\nforeach ((array) $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'link') as $link)\n{\nif (isset($link['attribs']['']['href']) && !empty($link['attribs']['']['rel']) && $link['attribs']['']['rel'] === 'enclosure')\n{\n// Attributes\n$bitrate = null;\n$channels = null;\n$duration = null;\n$expression = null;\n$framerate = null;\n$height = null;\n$javascript = null;\n$lang = null;\n$length = null;\n$medium = null;\n$samplingrate = null;\n$type = null;\n$url = null;\n$width = null;\n\n$url = $this->sanitize($link['attribs']['']['href'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($link));\nif (isset($link['attribs']['']['type']))\n{\n$type = $this->sanitize($link['attribs']['']['type'], SIMPLEPIE_CONSTRUCT_TEXT);\n}\nif (isset($link['attribs']['']['length']))\n{\n$length = ceil($link['attribs']['']['length']);\n}\n\n// Since we don't have group or content for these, we'll just pass the '*_parent' variables directly to the constructor\n$this->data['enclosures'][] = new $this->feed->enclosure_class($url, $type, $length, $this->feed->javascript, $bitrate, $captions_parent, $categories_parent, $channels, $copyrights_parent, $credits_parent, $description_parent, $duration_parent, $expression, $framerate, $hashes_parent, $height, $keywords_parent, $lang, $medium, $player_parent, $ratings_parent, $restrictions_parent, $samplingrate, $thumbnails_parent, $title_parent, $width);\n}\n}\n\nif ($enclosure = $this->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'enclosure'))\n{\nif (isset($enclosure[0]['attribs']['']['url']))\n{\n// Attributes\n$bitrate = null;\n$channels = null;\n$duration = null;\n$expression = null;\n$framerate = null;\n$height = null;\n$javascript = null;\n$lang = null;\n$length = null;\n$medium = null;\n$samplingrate = null;\n$type = null;\n$url = null;\n$width = null;\n\n$url = $this->sanitize($enclosure[0]['attribs']['']['url'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($enclosure[0]));\nif (isset($enclosure[0]['attribs']['']['type']))\n{\n$type = $this->sanitize($enclosure[0]['attribs']['']['type'], SIMPLEPIE_CONSTRUCT_TEXT);\n}\nif (isset($enclosure[0]['attribs']['']['length']))\n{\n$length = ceil($enclosure[0]['attribs']['']['length']);\n}\n\n// Since we don't have group or content for these, we'll just pass the '*_parent' variables directly to the constructor\n$this->data['enclosures'][] = new $this->feed->enclosure_class($url, $type, $length, $this->feed->javascript, $bitrate, $captions_parent, $categories_parent, $channels, $copyrights_parent, $credits_parent, $description_parent, $duration_parent, $expression, $framerate, $hashes_parent, $height, $keywords_parent, $lang, $medium, $player_parent, $ratings_parent, $restrictions_parent, $samplingrate, $thumbnails_parent, $title_parent, $width);\n}\n}\n\nif (sizeof($this->data['enclosures']) === 0 && ($url || $type || $length || $bitrate || $captions_parent || $categories_parent || $channels || $copyrights_parent || $credits_parent || $description_parent || $duration_parent || $expression || $framerate || $hashes_parent || $height || $keywords_parent || $lang || $medium || $player_parent || $ratings_parent || $restrictions_parent || $samplingrate || $thumbnails_parent || $title_parent || $width))\n{\n// Since we don't have group or content for these, we'll just pass the '*_parent' variables directly to the constructor\n$this->data['enclosures'][] = new $this->feed->enclosure_class($url, $type, $length, $this->feed->javascript, $bitrate, $captions_parent, $categories_parent, $channels, $copyrights_parent, $credits_parent, $description_parent, $duration_parent, $expression, $framerate, $hashes_parent, $height, $keywords_parent, $lang, $medium, $player_parent, $ratings_parent, $restrictions_parent, $samplingrate, $thumbnails_parent, $title_parent, $width);\n}\n\n$this->data['enclosures'] = array_values(SimplePie_Misc::array_unique($this->data['enclosures']));\n}\nif (!empty($this->data['enclosures']))\n{\nreturn $this->data['enclosures'];\n}\nelse\n{\nreturn null;\n}\n}",
"function wp_simplepie_autoload($class)\n{\n}",
"public function set_source_class($class = 'SimplePie_Source')\n {\n }",
"public function set_item_class($class = 'SimplePie_Item')\n {\n }",
"public function __construct()\n\t{\n\t\tif (version_compare(PHP_VERSION, '5.2', '<'))\n\t\t{\n\t\t\ttrigger_error('PHP 4.x, 5.0 and 5.1 are no longer supported. Please upgrade to PHP 5.2 or newer.');\n\t\t\tdie();\n\t\t}\n\n\t\t// Other objects, instances created here so we can set options on them\n\t\t$this->sanitize = new SimplePie_Sanitize();\n\t\t$this->registry = new SimplePie_Registry();\n\n\t\tif (func_num_args() > 0)\n\t\t{\n\t\t\t$level = defined('E_USER_DEPRECATED') ? E_USER_DEPRECATED : E_USER_WARNING;\n\t\t\ttrigger_error('Passing parameters to the constructor is no longer supported. Please use set_feed_url(), set_cache_location(), and set_cache_duration() directly.', $level);\n\n\t\t\t$args = func_get_args();\n\t\t\tswitch (count($args)) {\n\t\t\t\tcase 3:\n\t\t\t\t\t$this->set_cache_duration($args[2]);\n\t\t\t\tcase 2:\n\t\t\t\t\t$this->set_cache_location($args[1]);\n\t\t\t\tcase 1:\n\t\t\t\t\t$this->set_feed_url($args[0]);\n\t\t\t\t\t$this->init();\n\t\t\t}\n\t\t}\n\t}",
"function init(){\r\n\t\t$this->set_item_class('SimplePie_Item_GCalendar');\r\n\r\n\t\t$new_url;\r\n\t\tif (!empty($this->multifeed_url)){\r\n\t\t\t$tmp = array();\r\n\t\t\tforeach ($this->multifeed_url as $value)\r\n\t\t\t$tmp[] = $this->check_url($value);\r\n\t\t\t$new_url = $tmp;\r\n\t\t}else{\r\n\t\t\t$new_url = $this->check_url($this->feed_url);\r\n\t\t}\r\n\t\t$this->set_feed_url($new_url);\r\n\r\n\t\tparent::init();\r\n\t}",
"function rss_enclosure()\n {\n }",
"public function set_author_class($class = 'SimplePie_Author')\n {\n }",
"function rssimport_include_simplepie(){\n\n\tif (!class_exists('SimplePie')) {\n require_once elgg_get_plugins_path() . 'rssimport/lib/simplepie-1.3.php';\n\t}\n}",
"public function set_file_class($class = 'SimplePie_File')\n {\n }",
"protected abstract function getRefineryClass();",
"protected function getFeed_OverallService()\n {\n return new \\phpbb\\feed\\overall(${($_ = isset($this->services['feed.helper']) ? $this->services['feed.helper'] : $this->getFeed_HelperService()) && false ?: '_'}, ${($_ = isset($this->services['config']) ? $this->services['config'] : $this->getConfigService()) && false ?: '_'}, ${($_ = isset($this->services['dbal.conn']) ? $this->services['dbal.conn'] : ($this->services['dbal.conn'] = new \\phpbb\\db\\driver\\factory($this))) && false ?: '_'}, ${($_ = isset($this->services['cache.driver']) ? $this->services['cache.driver'] : ($this->services['cache.driver'] = new \\phpbb\\cache\\driver\\file())) && false ?: '_'}, ${($_ = isset($this->services['user']) ? $this->services['user'] : $this->getUserService()) && false ?: '_'}, ${($_ = isset($this->services['auth']) ? $this->services['auth'] : ($this->services['auth'] = new \\phpbb\\auth\\auth())) && false ?: '_'}, ${($_ = isset($this->services['content.visibility']) ? $this->services['content.visibility'] : $this->getContent_VisibilityService()) && false ?: '_'}, ${($_ = isset($this->services['dispatcher']) ? $this->services['dispatcher'] : $this->getDispatcherService()) && false ?: '_'}, 'php');\n }",
"function getEmergencyFeed()\n\t{\n\t\t$url = $this->options['EMERGENCY_RSS_URL'];\n\t\t$feed = new SimplePie();\n\t\t$feed->set_timeout($GLOBALS['siteConfig']->getVar('HTTP_TIMEOUT'));\n\t\t$feed->set_feed_url($url);\n\t\t$feed->set_cache_location(CACHE_DIR);\n\t\t$feed->init();\n\t\t$this->feed = $feed;\n\t}",
"abstract protected function providerClass(): string;",
"public function set_sanitize_class($class = 'SimplePie_Sanitize')\n\t{\n\t\treturn $this->registry->register('Sanitize', $class, true);\n\t}",
"abstract protected function SetPayloadClass ();"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the metric points table name. | protected function getMetricPointsTable()
{
$prefix = app(System::class)->getTablePrefix();
return $prefix.'metric_points';
} | [
"protected function getMetricsTable()\n {\n $prefix = app(System::class)->getTablePrefix();\n\n return $prefix.'metrics';\n }",
"public function getTableName ()\n {\n return $this->getDbTable()->info('name');\n }",
"public function get_table_name()\n {\n }",
"public function getName(): string\n {\n return $this->tableName;\n }",
"protected function getTransactionScoreTableName()\n {\n return $this->getGatewayCollection()\n ->getGateway('pt_transaction_score')\n ->getMetaData()\n ->getName();\n\n }",
"public function getTimingsTableName()\n {\n return \"{{survey_\".$this->primaryKey.\"_timings}}\";\n }",
"public function get_table_name() {\n\t\treturn $this->get_table_prefix() . $this->table_name;\n\t}",
"public function dataTableName()\n {\n $tableName = 'pd2_' . Utils::normalizeString($this->product()->name)\n . '__' . Utils::normalizeString($this->name);\n return strtolower($tableName);\n }",
"protected function getTableName() {\n return Variable::tableName();\n }",
"public function get_table_name() {\n\t\treturn $this->table_prefix . self::TABLE_NAME;\n\t}",
"public function getFullyQualifiedTableName() : string\r\n {\r\n return DB::getTablePrefix() . 'geo';\r\n }",
"protected static function table_name(): mixed\n\t{\n\t\treturn self::$query->table_name;\n\t}",
"protected function getTableName(): string\n {\n return $this->subject->getTable();\n }",
"protected function getPivotTableName()\n {\n return implode('_', array_map('str_singular', $this->getSortedTableNames()));\n }",
"public function getDefaultTableName(): string\n {\n return \\implode('_', \\array_map(function ($element) {\n return Str::plural($element);\n }, \\array_merge(\n \\is_null($this->getModelGroup()) ? [] : \\explode('_', $this->getModelGroup()),\n ['pivot'],\n \\explode('_', $this->modelName),\n )));\n }",
"static function get_table_name()\r\n {\r\n return Utilities :: get_classname_from_namespace(self :: CLASS_NAME, true);\r\n }",
"protected function actualTableName()\r\n\t{\r\n\t\tif (isset($this->actualTable)) {\r\n\t\t\treturn $this->actualTable;\r\n\t\t}\r\n\t\t$groupModel = $this->getGroup();\r\n\t\tif ($groupModel->isJoin()) {\r\n\t\t\t$joinModel = $groupModel->getJoinModel();\r\n\t\t\treturn $joinModel->getJoin()->table_join;\r\n\r\n\t\t}\r\n\t\t$listModel = $this->getListModel();\r\n\t\t$this->actualTable = $listModel->getTable()->db_table_name;\r\n\t\treturn $this->actualTable;\r\n\t}",
"public function getTablename(){\r\n return $this->tablename;\r\n }",
"final function _get_table_name()\n\t{\n\t\treturn $this->table_name;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the value of pannier_litige | public function getPannier_litige()
{
return $this->pannier_litige;
} | [
"public function getLitige_panier()\n {\n return $this->litige_panier;\n }",
"public function getLien()\n {\n return $this->lien;\n }",
"public function setPannier_litige($pannier_litige)\n {\n $this->pannier_litige = $pannier_litige;\n\n return $this;\n }",
"public function getLivret()\n {\n return $this->_livret;\n }",
"public function getValvulaMitralL1()\n {\n return $this->valvulaMitralL1;\n }",
"public function getKetInstListrik()\n {\n return $this->ket_inst_listrik;\n }",
"public function getLivreur()\n {\n return $this->livreur;\n }",
"public function getTendikLainnya()\n {\n return $this->tendik_lainnya;\n }",
"public function getRPLibelleEn()\n {\n\n return $this->r_p_libelle_en;\n }",
"public function get_lieu()\n {\n return $this->_lieu;\n }",
"public function getLivre()\n {\n return $this->livre;\n }",
"public function getLieu()\r\n {\r\n return $this->lieu;\r\n }",
"public function hitung_luas (){\n Return $this->alas * $this->tinggi;\n }",
"public function getTallaPV()\n {\n return $this->tallaPV;\n }",
"function hitung_nilai_kontrak($idtender)\r\n\t{\r\n\t\t$biaya_bk = $this->hitung_biaya_konstruksi($idtender); \r\n\t\t$total_bk = $biaya_bk['total_bk'];\r\n\t\t$total_biaya_umum = $this->hitung_total_biaya_umum($idtender);\r\n\t\t$varcost = $this->hitung_varcost_item($idtender);\r\n\t\t$bank = $this->get_data_bank($idtender);\r\n\t\t$persen_bank = 0;\r\n\t\tforeach($bank['data'] as $bd)\r\n\t\t{\r\n\t\t\t$persen_bank = $persen_bank + $bd['persentase'];\r\n\t\t}\r\n\t\t$vc = (100 - $persen_bank - $varcost['data']['biaya_resiko'] - $varcost['data']['lapek'] - $varcost['data']['pph'] - $varcost['data']['biaya_pemasaran'] - $varcost['data']['biaya_lain']); // $varcost['data']['contingency'] -\r\n\t\t$nilai_kontrak = (($total_bk + $total_biaya_umum) / $vc ) * 100;\r\n\t\t$nilai_kontrak_ppn = ((($total_bk + $total_biaya_umum) / $vc ) * 100) * 1.1;\t\t\r\n\t\tif($nilai_kontrak > 0) return $nilai_kontrak;\r\n\t\t\telse return false;\r\n\t}",
"public function getKetRangkaPlafon()\n {\n return $this->ket_rangka_plafon;\n }",
"public function getNrLokalu()\n {\n return $this->nrLokalu;\n }",
"public function getEnLitige() {\n return $this->enLitige;\n }",
"public function setLitige_panier($litige_panier)\n {\n $this->litige_panier = $litige_panier;\n\n return $this;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ Plugin Name: Internet Explorer 8 Accelerator Plugin URI: Description: The Internet Explorer 8 Accelerator plugin enables you to post an entry with selected text of any webpage to your WordPress blog. Version: 1.0 Author: Anant Garg Author URI: Licence: This WordPress plugin is licenced under the GNU General Public Licence. For more information see: For documentation, please visit | function ie_accelerator() {
$url = $_POST['url'];
$description = $_POST['description'];
$title = $_POST['title'];
$description = preg_replace('/\r/', '', $description);
$description = preg_replace('/\n/', '\\n\\n', $description);
if ($url == "" || $title == "") {
} else {
?><script>
function accelerator() {
var url = '<?php echo $url?>';
var title = 'Talking about <?php echo $title?>';
title = unescape(title.replace(/\+/g, " "));
document.getElementById('title').value = title;
var description = '<?php echo $description?>';
description = unescape(description.replace(/\+/g, " "));
document.getElementById('content').value = '<strong><a href="'+url+'">'+title+'</a></strong>'+'\n\n'+description;
}
document.onload = accelerator();
</script>
<?php
}
} | [
"function plugin_support() {\r\n\t\t$content = '<p>If you\\'ve found a bug in this plugin, please submit it in the <a href=\"http://www.ivankristianto.com/about/\">IvanKristianto.com Contact Form</a> with a clear description.</p>';\r\n\t\t$this->postbox($this->plugin['pagenice'].'support', __('Found a bug?','ystplugin'), $content);\r\n\t}",
"function plugin_support() {\r\n\t\t\t$content = '<p>'.__('If you are having problems with this plugin, please talk about them in the', 'wordpress-seo' ).' <a href=\"http://wordpress.org/tags/'.$this->hook.'\">'.__(\"Support forums\", 'wordpress-seo' ).'</a>.</p>';\r\n\t\t\t$content .= '<p>'.sprintf( __(\"If you're sure you've found a bug, or have a feature request, please submit it in the %1$sbug tracker%2$s.\", \"wordpress-seo\"), \"<a href='http://yoast.com/bugs/wordpress-seo/'>\",\"</a>\").\"</p>\";\r\n\t\t\t$this->postbox($this->hook.'support', __('Need support?', 'wordpress-seo' ), $content);\r\n\t\t}",
"function main_call()\n{\n\techo (\"<h3> Website Performance Index Plugin<br> for Reef's Sites </h3>\");\n}",
"function hs4wp_callback_htm($a) {\r\n global $post,$hs4wp_plugin_uri,$hs4wp_insert_into_footer;\r\n $str = trim($a[1]);\r\n $contentID = $post->ID.md5($str);\r\n // get options\r\n $options = preg_match('#\\((.*)\\)#',$str,$reg)?explode(\";\",$reg[1],4):false;\r\n if(isset($options[0])&&isset($options[1])) {\r\n $subject = $options[0];\r\n $linkName = $options[1];\r\n } else {\r\n $subject = false;\r\n $linkName = false;\r\n }\r\n $width = intval($options[2]);\r\n $height = intval($options[3]);\r\n if($width > 1 && $height > 1)\r\n $style = ' align=\"left\" style=\"width:'.$width.'px;height:'.$height.'px;\"';\r\n else\r\n $style = ' align=\"left\"';\r\n $OUT = (hs4wp_getConf('hs4wp_ptag_workaround') == 'on')?'</p>':'';\r\n $OUT .= '<a class=\"highslide\" onclick=\"return hs.htmlExpand(this, {wrapperClassName: \\'draggable-header\\',contentId: \\'highslide-html_'.$contentID.'\\'';\r\n $img = (hs4wp_getConf('hs4wp_ext_icon') == 'on')?'<img src=\"'.$hs4wp_plugin_uri.'img/ext.png\" width=\"11\" height=\"9\" border=\"0\" alt=\"\" style=\"border:none;\">':'';\r\n if($subject != false) {\r\n $OUT .= \",headingText:'\".htmlentities($subject,ENT_QUOTES,'UTF-8').\"'\";\r\n // Check if LinkName == URL specifying an image; If So display the image instead the link name\r\n $Print_linkName = htmlentities($linkName,ENT_QUOTES,'UTF-8');\r\n $regex = \"((https?|ftp)\\:\\/\\/)?\"; // SCHEME\r\n $regex .= \"([a-z0-9+!*(),;?&=\\$_.-]+(\\:[a-z0-9+!*(),;?&=\\$_.-]+)?@)?\"; // User and Pass\r\n $regex .= \"([a-z0-9-.]*)\\.([a-z]{2,3})\"; // Host or IP\r\n $regex .= \"(\\:[0-9]{2,5})?\"; // Port\r\n $regex .= \"(\\/([a-z0-9+\\$_-]\\.?)+)*\\/?\"; // Path\r\n $regex .= \"(\\?[a-z+&\\$_.-][a-z0-9;:@&%=+\\/\\$_.-]*)?\"; // GET Query\r\n $regex .= \"(#[a-z_.-][a-z0-9+\\$_.-]*)?\"; // Anchor\r\n if(preg_match(\"/^\".$regex.\"$/i\",$linkName)) {\r\n // check for known image types\r\n if(preg_match(\"/\\.[jpe?g|gif|png]/i\", $linkName)) {\r\n $Print_linkName = \"<img src=\\\"\".$linkName.\"\\\" class=\\\"highslide-expander-image\\\" alt=\\\"\".htmlentities($subject,ENT_QUOTES,'UTF-8').\"\\\" title=\\\"\".htmlentities($subject,ENT_QUOTES,'UTF-8').\"\\\">\";\r\n }\r\n }\r\n\r\n\r\n\r\n\r\n $OUT .= '} )\" href=\"#\">'.$img.\" \".$Print_linkName.'</a>';\r\n $str = str_replace($reg[0],\"\",$str);\r\n } else {\r\n $OUT .= '} )\" href=\"#\">'.$img.' info</a>';\r\n }\r\n// $OUT .= \"\\n\";\r\n // opener\r\n\r\n $hs4wp_insert_into_footer .= '<div id=\"highslide-html_'.$contentID.'\" class=\"highslide-html-content\"'.$style.'>';\r\n // HTML Box Header\r\n\t$hs4wp_insert_into_footer .= '<div class=\"highslide-header\">\r\n <ul>\r\n <li class=\"highslide-move\"><a href=\"#\" onclick=\"return false\"> </a></li>\r\n <li class=\"highslide-close\"><a href=\"#\" onclick=\"return hs.close(this)\"> </a></li>\r\n </ul>\r\n </div>';\r\n\r\n // Flash handler\r\n if(hs4wp_getConf('hs4wp_handle_swf') == 'on') {\r\n $extension = strtolower(substr($str,strlen($str)-4));\r\n if($extension == \".swf\") {\r\n if($width < 100) $width = \"500\";\r\n if($height < 100) $height = \"370\";\r\n // Flash size reduce by x percent\r\n $F_Width = $width;\r\n $F_Height = floor($height/100*88);\r\n $swf = $str;\r\n $str = \"\";\r\n $str .= '<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" id=\"swf_'.$contentID.'\" width=\"'.$F_Width.'\" height=\"'.$F_Height.'\">'.\"\\n\";\r\n $str .= '<param name=\"movie\" value=\"'.$swf.'\" />'.\"\\n\";\r\n $str .= '<param name=\"wmode\" value=\"opaque\" />'.\"\\n\";\r\n $str .= '<!--[if !IE]>-->'.\"\\n\";\r\n $str .= '<object type=\"application/x-shockwave-flash\" data=\"'.$swf.'\" width=\"'.$F_Width.'\" height=\"'.$F_Height.'\" wmode=\"opaque\">'.\"\\n\";\r\n $str .= '<!--<![endif]-->'.\"\\n\";\r\n $str .= 'Flash plugin is required to view this object.'.\"\\n\";\r\n $str .= '<!--[if !IE]>-->'.\"\\n\";\r\n $str .= '</object>'.\"\\n\";\r\n $str .= '<!--<![endif]-->'.\"\\n\";\r\n $str .= '</object> '.\"\\n\";\r\n }\r\n }\r\n\r\n // HTML Box Body\r\n $hs4wp_insert_into_footer .= '<div class=\"highslide-body\">'.$str.'</div>';\r\n // HTML Box Footer\r\n $hs4wp_insert_into_footer .= '<div class=\"highslide-footer\"><div><span class=\"highslide-resize\" title=\"Resize\"> </span></div></div>';\r\n // closer\r\n $hs4wp_insert_into_footer .= '</div>';\r\n $hs4wp_insert_into_footer .= \"\\n\";\r\n return $OUT;\r\n\r\n// return htmlentities($OUT);\r\n}",
"function analyzer_install(){\n\t\tglobal $wpdb;\n\t\t//ibou's create table code\n\n\t\t//alem's create page code\n\n\n\t\t$the_page_title = 'QuestionPeach Analyzer GUI';\n\t\t$the_page_name = 'QuestionPeach-analyzer';\n\n\t\t// the menu entry...\n\t\tdelete_option(\"my_plugin_page_title\");\n\t\tadd_option(\"my_plugin_page_title\", $the_page_title, '', 'yes');\n\t\t// the slug...\n\t\tdelete_option(\"my_plugin_page_name\");\n\t\tadd_option(\"my_plugin_page_name\", $the_page_name, '', 'yes');\n\t\t// the id...\n\t\tdelete_option(\"my_plugin_page_id\");\n\t\tadd_option(\"my_plugin_page_id\", '0', '', 'yes');\n\n\t\t$the_page = get_page_by_title( $the_page_title );\n\n\t\tif ( ! $the_page ) {\n\n\t\t\t$admin = new Analyzer();\n\t\t\t// Create post object\n\t\t\t$_p = array();\n\t\t\t$_p['post_title'] = $the_page_title;\n\t\t\t$_p['post_content'] = $admin->{'creatUI'}();\n\t\t\t$_p['post_status'] = 'publish';\n\t\t\t$_p['post_type'] = 'page';\n\t\t\t$_p['comment_status'] = 'closed';\n\t\t\t$_p['ping_status'] = 'closed';\n\t\t\t$_p['post_category'] = array(1); // the default 'Uncatrgorised'\n\n\t\t\t// Insert the post into the database\n\t\t\t$the_page_id = wp_insert_post( $_p );\n\n\t\t}\n\t\telse {\n\t\t\t// the plugin may have been previously active and the page may just be trashed...\n\n\t\t\t$the_page_id = $the_page->ID;\n\n\t\t\t//make sure the page is not trashed...\n\t\t\t$the_page->post_status = 'publish';\n\t\t\t$the_page_id = wp_update_post( $the_page );\n\n\t\t}\n\n\t\tdelete_option( 'my_plugin_page_id' );\n\t\tadd_option( 'my_plugin_page_id', $the_page_id );\n\t}",
"function textus_install() {\n global $wpdb;\n // name it as like the other WP tables but add textus so it can be quickly found\n $table_name = $wpdb->prefix . \"textus_annotations\"; \n\t/*\n\t\"start\" : 300,\n\t\"end\" : 320,\n\t\"type\" : \"textus:comment\",\n\t\"userid\" : [wordpress-id]\n\t\"private\": false\n\t\"date\" : \"2010-10-28T12:34Z\",\n\t\"payload\" : {\n\t \"lang\" : \"en\"\n\t \"text\" : \"Those twenty characters really blow me away, man...\"\n\t} \n\n id will be int of the currently logged in user. \n*/\n $sql = \"CREATE TABLE $table_name (\n id mediumint(9) NOT NULL AUTO_INCREMENT,\n textid mediumint(9) NOT NULL, \n time datetime DEFAULT '0000-00-00 00:00:00' NOT NULL,\n start smallint NOT NULL,\n end smallint NOT NULL,\n userid smallint NOT NULL,\n private tinytext NOT NULL,\n language tinytext NOT NULL, \n text text NOT NULL,\n UNIQUE KEY id (id)\n );\";\n\n require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );\n dbDelta( $sql );\n\n}",
"function lmm_button_text($plugin_array) {\n\tif (!is_multisite()) { $adminurl = admin_url(); } else { $adminurl = get_admin_url(); }\n\t$text_add = __('Add Map','lmm');\n\t$link = LEAFLET_PLUGIN_URL . 'inc/js/tinymce_button_text.php?leafletpluginurl='.base64_encode(LEAFLET_PLUGIN_URL).'&adminurl='.base64_encode($adminurl).'&textadd='.base64_encode($text_add);\n\twp_register_script('html-dialog', $link);\n\twp_enqueue_script('html-dialog');\n\treturn $plugin_array;\n}",
"function UpdateCustomPlugin()\n{\n global $DB, $SDCache, $load_wysiwyg;\n \n $custompluginid = Is_Valid_Number(GetVar('custompluginid',0,'whole_number'),0,1,9999999);\n //SD313: check if $custompluginid is really valid\n if(empty($custompluginid))\n {\n DisplayMessage('Custom Plugin not found.', true);\n DisplayPlugins();\n return false;\n }\n\n // Clear cache files of all categories this custom plugin is placed in\n // \"sd_deletecachefile\" will itself check if cache folder exists\n //SD370: also create mobile pagesort entries\n foreach(array('','_mobile') as $suffix)\n {\n if($suffix && !SD_MOBILE_FEATURES) break;\n $tbl = PRGM_TABLE_PREFIX.'pagesort'.$suffix;\n if($getpagesort = $DB->query('SELECT DISTINCT categoryid'.\n ' FROM '.$tbl.\n \" WHERE pluginid = 'c\".$custompluginid.\"'\"))\n {\n while($catid = $DB->fetch_array($getpagesort,null,MYSQL_ASSOC))\n {\n if(!empty($catid['categoryid']))\n {\n $SDCache->delete_cacheid(($suffix?MOBILE_CACHE:'').CACHE_PAGE_PREFIX.$catid['categoryid']);\n }\n }\n }\n }\n\n $name = GetVar('name', '', 'string');\n $displayname = GetVar('displayname', '', 'html');\n $plugin = GetVar('plugincode', '', 'html');\n $includefile = trim(GetVar('includefile', '', 'html'));\n //SD361: sanity check for included file\n $includefile_org = $includefile;\n if(strlen($includefile))\n {\n if(!sd_check_pathchars($includefile))\n {\n $includefile = '';\n DisplayMessage('Invalid characters for include file!', true);\n }\n else\n {\n $includefile = strip_alltags($includefile);\n $includefile = SanitizeInputForSQLSearch($includefile,false,false,true);\n $includefile = trim($includefile);\n $includefile = str_replace('\\\\','/',$includefile);\n $includefile = str_replace('//','/',$includefile);\n if(empty($includefile) || ($includefile_org != $includefile))\n {\n $includefile = '';\n DisplayMessage('Invalid path to include file!', true);\n }\n else\n {\n $rootpath = realpath(ROOT_PATH);\n $pluginpath = realpath($rootpath.'/'.dirname($includefile));\n if(strlen($pluginpath) < strlen($rootpath))\n {\n $includefile = '';\n DisplayMessage('Invalid path to include file!', true);\n }\n }\n }\n }\n\n $CopyPlugin = GetVar('CopyPlugin', false, 'bool');\n $ignore_excerpt_mode = GetVar('ignore_excerpt_mode', 0, 'bool')?1:0; //SD342\n\n // SD 313: use $DB->escape_string()\n $DB->skip_curly = true;\n $DB->query('UPDATE '.PRGM_TABLE_PREFIX.'customplugins'.\n \" SET name = '$name',\".\n \" displayname = '\".$DB->escape_string($displayname).\"',\".\n \" plugin = '\" . $DB->escape_string($plugin) . \"',\".\n \" includefile = '\".$DB->escape_string($includefile).\"',\".\n \" ignore_excerpt_mode = \".$ignore_excerpt_mode.\n ' WHERE custompluginid = '.$custompluginid);\n $DB->skip_curly = false;\n\n if($CopyPlugin)\n {\n $DB->skip_curly = true;\n $DB->query('INSERT INTO '.PRGM_TABLE_PREFIX.'customplugins'.\n ' (name, displayname, plugin, includefile, settings, ignore_excerpt_mode)'.\n \" SELECT CONCAT(name,' *'), displayname, plugin, includefile, 17, ignore_excerpt_mode\".\n ' FROM '.PRGM_TABLE_PREFIX.'customplugins'.\n ' WHERE custompluginid = '.(int)$custompluginid);\n $DB->skip_curly = false;\n if($custompluginid = $DB->insert_id())\n {\n // install default usergroup settings\n $usergroups = $DB->query('SELECT usergroupid, adminaccess, banned, custompluginviewids, custompluginadminids FROM {usergroups} ORDER BY usergroupid');\n\n while($usergroup = $DB->fetch_array($usergroups))\n {\n $usergroupid = $usergroup['usergroupid'];\n $custompluginadminids = strlen($usergroup['custompluginadminids']) ? $usergroup['custompluginadminids'] : '';\n if(empty($usergroup['banned']))\n {\n $custompluginviewids = strlen($usergroup['custompluginviewids']) ? $usergroup['custompluginviewids'] . ',' . $custompluginid : $custompluginid;\n }\n\n // Administrators get admin access to new custom plugin\n if(!empty($usergroup['adminaccess']))\n {\n $custompluginadminids .= ',' . $custompluginid;\n }\n\n $DB->query(\"UPDATE {usergroups} SET custompluginviewids = '%s', custompluginadminids = '%s' \".\n 'WHERE usergroupid = '.$usergroupid, $custompluginviewids, $custompluginadminids);\n } //while\n }\n }\n\n global $pageid;\n RedirectPage('plugins.php?action=display_custom_plugin_form&custompluginid=' .\n $custompluginid.($load_wysiwyg?'&load_wysiwyg=1':'').\n ($pageid>1?'&page='.$pageid:''),\n AdminPhrase('plugins_custom_plugin_updated'));\n\n}",
"function create_shortcode()\n{\n\t# add_shortcode('recent_post','insert_str');\n\tadd_shortcode('get_from_IMTsite','get_from_url');\n}",
"function plugin_support (){\r\n\r\n // share buttons\r\n if ($this->_options['wpsc_top_of_products_page']==\"yes\"){add_action('wpsc_top_of_products_page', 'my_wp_ecommerce_share_links' );}\r\n if ($this->_options['wpsc_product_before_description']==\"yes\"){add_action('wpsc_product_before_description', 'my_wp_ecommerce_share_links' );}\r\n if ($this->_options['wpsc_product_addon_after_descr']==\"yes\"){add_action('wpsc_product_addon_after_descr', 'my_wp_ecommerce_share_links' );}\r\n\r\n // interactive buttons\r\n // after description\r\n if ($this->_options['like_wpsc_product_addon_after_descr']==\"yes\" || $this->_options['tweet_wpsc_product_addon_after_descr']==\"yes\" || $this->_options['stumble_wpsc_product_addon_after_descr']=='yes')\r\n {\r\n add_action('wpsc_product_addon_after_descr',array($this, 'wp_ecommerce_interactive_links_top' ));}\r\n // before\r\n if ($this->_options['like_wpsc_product_before_description']==\"yes\"||$this->_options['tweet_wpsc_product_before_description']==\"yes\" || $this->_options['stumble_wpsc_product_before_description']=='yes'){\r\n add_action('wpsc_product_before_description',array($this, 'wp_ecommerce_interactive_links_top' ));\r\n }\r\n // title\r\n if ($this->_options['tweet_wpsc_top_of_products_page']==\"yes\"||$this->_options['like_wpsc_top_of_products_page']==\"yes\"||$this->_options['stumble_wpsc_top_of_products_page']==\"yes\"){\r\n add_action('wpsc_top_of_products_page',array($this, 'wp_ecommerce_interactive_links_top' ));\r\n }\r\n }",
"function wp_dashboard_quick_press_output() {}",
"function cs_cf7() {\n\tload_plugin_textdomain( 'custom-template-cf7-email-add-on', false, basename( dirname( __FILE__ ) ) . '/languages' );\n}",
"function add_wpgcp_tinymce_plugin($plugin_array){\n $plugin_array['wpgcp'] = get_option('siteurl') . '/wp-content/plugins/wp-code-button/editor_plugin.js';\n return $plugin_array;\n}",
"function classicpress_show_migration_controls() {\n?>\n\t<h2 class=\"cp-migration-info cp-migration-ready\">\n\t\t<?php _e( \"It looks like you're ready to switch to ClassicPress!\", 'switch-to-classicpress' ); ?>\n\t</h2>\n\t<p class=\"cp-migration-info\">\n\t\t<?php _e( 'First things first, just in case something does not go as planned, <strong class=\"cp-emphasis\">please make a backup of your site files and database</strong>.', 'switch-to-classicpress' ); ?>\n\t</p>\n\t<p class=\"cp-migration-info\">\n\t\t<?php _e( 'After clicking the button below, the migration process will start.', 'switch-to-classicpress' ); ?>\n\t</p>\n\n\t<form\n\t\tid=\"cp-migration-form\"\n\t\tmethod=\"post\"\n\t\taction=\"update-core.php?action=do-core-upgrade&migrate=classicpress\"\n\t\tname=\"upgrade\"\n\t>\n\t\t<?php wp_nonce_field( 'upgrade-core' ); ?>\n\t\t<button class=\"button button-primary button-hero\" type=\"submit\" name=\"upgrade\">\n<?php\n\tif ( is_multisite() ) {\n\t\t_e(\n\t\t\t'Switch this <strong>entire multisite installation</strong> to ClassicPress <strong>now</strong>!',\n\t\t\t'migrate-to-classicpress'\n\t\t);\n\t} else {\n\t\t_e(\n\t\t\t'Switch this site to ClassicPress <strong>now</strong>!',\n\t\t\t'migrate-to-classicpress'\n\t\t);\n\t}\n?>\n\t\t</button>\n\t</form>\n\n\t<h2><?php _e( 'More Details', 'switch-to-classicpress' ); ?></h2>\n\n\t<p class=\"cp-migration-info\">\n\t\t<?php _e( 'All core WordPress files will be replaced with their ClassicPress versions. Depending on the server this website is hosted on, this process can take a while.', 'switch-to-classicpress' ); ?>\n\t</p>\n\t<p class=\"cp-migration-info\">\n\t\t<?php _e( 'We want to emphasise that <strong>all your own content (posts, pages, themes, plugins, uploads, wp-config.php file, .htaccess file, etc.) is 100% safe</strong> as the migration process is not touching any of that.', 'switch-to-classicpress' ); ?>\n\t</p>\n\t<p class=\"cp-migration-info\">\n\t\t<?php _e( 'Once the process has completed, you will see the about page of ClassicPress where you can read more information about the project.', 'switch-to-classicpress' ); ?>\n\t</p>\n\t<p class=\"cp-migration-info\">\n\t\t<?php _e( 'We thank you for switching from WordPress to ClassicPress!<br>The business-focused CMS. Powerful. Versatile. Predictable.', 'switch-to-classicpress' ); ?>\n\t</p>\n<?php\n}",
"function lightbox_submit(){\n\t\tinclude $this->plugin_path.'inc/submitdetails.php';\n\t\tdie();\n\t}",
"function px_shortcode_button() {\n\n if(wp_script_is(\"quicktags\"))\n {\n ?>\n <script type=\"text/javascript\">\n\n function getSel()\n {\n var txtarea = document.getElementById(\"content\");\n var start = txtarea.selectionStart;\n var finish = txtarea.selectionEnd;\n return txtarea.value.substring(start, finish);\n }\n\n QTags.addButton(\n \"parallax_shortcode\",\n \"ParallaxSlide\",\n callback\n );\n\n function callback()\n {\n var selected_text = getSel();\n QTags.insertContent(\"[parallax-img imagepath='image_url' id='1' px_title='First Title' title_color='#333333' img_caption='Your image caption']\");\n }\n </script>\n <?php\n }\n}",
"function pluginActivated() {\n if (!extension_loaded('imagick') && !extension_loaded('gd')) {\n $msg = EasyIndexTranslate::translate('EasyIndex requires either the GD or the Imagick PHP graphics extension.');\n wp_die($msg . '<br><a href=\"/wp-admin/plugins.php\">Go back</a>');\n return;\n }\n /**\n * Register our post type and flush the rewrite rules\n */\n $this->registerPostType('easyindex');\n flush_rewrite_rules();\n $settings = EasyIndexSettings::getInstance();\n $settings->displayHelp = true;\n $settings->update();\n }",
"function use_codepress()\n{\n}",
"function tableau_quicktag() {\n?>\n\t<script type=\"text/javascript\" charset=\"utf-8\">\n\t\tQTags.addButton( 'tableau-plugin', 'tableau', '\\n[tableau server=\"\" workbook=\"\" view=\"\" tabs=\"\" toolbar=\"\" revert=\"\" refresh=\"\" linktarget=\"\" width=\"800px\" height=\"600px\"]', '[/tableau]\\n' );\n\t</script>\n<?php\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
See if a user is considered a distributor for a given post | function pmp_user_is_distributor_of_post($post_id, $user_guid=null) {
if (empty($user_guid))
$user_guid = pmp_get_my_guid();
$sdk = new SDKWrapper();
$user = $sdk->fetchDoc($user_guid);
$pmp_guid = get_post_meta($post_id, 'pmp_guid', true);
if (empty($pmp_guid))
return false;
$doc = $sdk->fetchDoc($pmp_guid);
if (!empty($doc->links->distributor)) {
foreach ($doc->links->distributor as $distrib) {
if (SDKWrapper::guid4href($distrib->href) == $user_guid) {
return true;
}
}
}
return false;
} | [
"public function isOwnedBy($post, $user) {\n return $this->field('id', array('id' => $post, 'user_id' => $user)) !== false;\n }",
"public function isOwnedBy($post, $user) {\n\t\treturn $this->field('id', array('id' => $post, 'user_id' => $user)) !== false;\n\t}",
"function is_post_owner()\n\t{\n\t\t//initializing variables\n\t\tglobal $authordata;\n\t\t$user =& get_user();\n\t\t\n\t\tif (!is_object($user)) return false;\n\t\tif (!is_object($authordata)) return false;\n\t\tif ($authordata->ID != $user->ID) return false;\n\t\treturn true;\n\t}",
"function dokan_is_seller_trusted( $user_id ) {\n $publishing = get_user_meta( $user_id, 'dokan_publishing', true );\n\n if ( $publishing == 'yes' ) {\n return true;\n }\n\n return false;\n}",
"public function reviewer_has_purchased_download() {\n\t\tglobal $post;\n\n\t\t$current_user = wp_get_current_user();\n\n\t\tif ( edd_has_user_purchased( $current_user->user_email, $post->ID ) ) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}",
"public function isDistributor(){\n if(!$this->isClient()){\n return false;\n }\n $accountType = is_int($this->account->account_type) ? Account::stringifyType($this->account->account_type) : $this->account->account_type;\n return $accountType == 'DISTRIBUTOR';\n }",
"function dokan_is_product_author( $product_id = 0 ) {\n global $post;\n\n if ( !$product_id ) {\n $author = $post->post_author;\n } else {\n $author = get_post_field( 'post_author', $product_id );\n }\n\n if ( $author == get_current_user_id() ) {\n return true;\n }\n\n return false;\n}",
"function current_user_owns_post( $post_id = null ) {\n\t\tif ( null == $post_id ) {\n\t\t\treturn false;\n\t\t}\n\t\tglobal $current_user;\n\t\t$post = get_post( $post_id, 'OBJECT' );\n\t\treturn ( $post->post_author == $current_user->id );\n\t}",
"public function ownsPost(Post $post)\n {\n return $this->id === $post->user->id;\n }",
"private function is_post_created_by_user()\n\t{\n\t\treturn !isset($this->created_by) && $this->user->loaded() && $this->user_id > 0;\n\t}",
"public function isAuthor(object $gateauOuRecette)\n // public function isAuthor(object $gateauOuRecette)\n {\n /// on veut comparer $this-id au user_id de cette recette ou ce gateau\n\n if( $this->id == $gateauOuRecette->user_id ){\n return true;\n }else{\n\n return false;\n }\n\n }",
"public function isPublisher () {\n return $this->role->slug == 'publisher';\n }",
"function racketeers_is_user_organizer( $current_user_id ){\n\n\tglobal $debug;\n\n\t$user_info = get_userdata( $current_user_id );\n\n\tif ( ! $user_info ) {\n\t\techo \"[racketeers_is_user_organizer] can't get user data!?!\";\n\t\treturn false;\n\t}\n\n\t// if ( $debug ) {\n\t// \techo \"[racketeers_is_user_organizer] roles are: \";\n\t// \techo implode(', ', $user_info->roles).\"</br>\";\n\t// }\n\n\t$user_role = $user_info->roles;\n\n\tif \t( in_array ( 'author' , \t$user_role )){\n\t\treturn true;\n\t}\n\n\treturn false;\n}",
"function posterOrOwnerOfPost($idpost, $iduser){\n\t$sql = 'SELECT id_user FROM wall_post WHERE id='.$idpost;\n\t$query = mysql_query($sql);\n\n\tif(!$query) return false;\n\n\t$result = mysql_fetch_assoc($query);\n\treturn $result['id_user']==$iduser;\n}",
"public function publishing(User $user, Post $post)\n {\n # admin\n if ($user->isAdmin()) {\n return true;\n }\n\n # moderator can publish posts in its category\n if ($user->isModerator($post->category_id)) {\n return true;\n }\n\n return false;\n }",
"public function isAuthor(object $gateauOuRecette)\r\n {\r\n //on veut comparer $this->id au user_id\r\n if($this->id == $gateauOuRecette->user_id){\r\n return true;\r\n }else{\r\n return false;\r\n }\r\n }",
"function sulli_is_comment_by_post_author($comment = null)\n{\n\n if (is_object($comment) && $comment->user_id > 0) {\n\n $user = get_userdata($comment->user_id);\n $post = get_post($comment->comment_post_ID);\n\n if (!empty($user) && !empty($post)) {\n\n return $comment->user_id === $post->post_author;\n }\n }\n return false;\n}",
"public function isPaidByAdmin()\n {\n return $this->paid_by == self::ADMIN;\n }",
"function dokan_is_seller_enabled( $user_id ) {\n $selling = get_user_meta( $user_id, 'dokan_enable_selling', true );\n\n if ( $selling == 'yes' ) {\n return true;\n }\n\n return false;\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Listen to the rating restriction deleted event. | public function deleted($configurationRatingRestriction)
{
parent::deleted($configurationRatingRestriction);
Log::Info("Deleted rating restriction configuration entry", ['placeholder_configuration' => $configurationRatingRestriction->id]);
} | [
"protected function emitRatingDeleted(\\Lelesys\\Plugin\\News\\Domain\\Model\\Rating $rating) {\n\n\t}",
"public function forceDeleted(Rating $rating){\n //\n }",
"public function deleting($configurationRatingRestriction)\n {\n parent::deleting($configurationRatingRestriction);\n\n Log::Debug(\"Deleting rating restriction configuration entry\", ['placeholder_configuration' => $configurationRatingRestriction->id]);\n }",
"public function on_delete() {}",
"public function deleted(ReviewReaction $reviewReaction)\n {\n //\n }",
"public function deleted(MessageReaction $reaction): void\n {\n broadcast(new Removed($reaction))->toOthers();\n }",
"public function deleted(Review $review)\n {\n $this -> recalculateProductRating($review -> product_id);\n }",
"public function deleted(Review $review)\n {\n //\n }",
"public function afterDelete() {\n //property used to set pundit id from controller\n $PunditId = $this->callPunditId;\n //method to update pundit score\n $this->__updatePunditScore($PunditId);\n //refreshing all voted user score\n foreach($this->votedUserId as $userId) {\n $this->Vote->refreshUserScore($userId);\n }\n\n }",
"public static function delete_rating_handler(com_meego_comments_comment $comment)\n {\n $mvc = midgardmvc_core::get_instance();\n\n if ($comment)\n {\n $storage = new midgard_query_storage('com_meego_ratings_rating');\n $q = new midgard_query_select($storage);\n\n $qc = new midgard_query_constraint_group('AND');\n\n $qc->add_constraint(new midgard_query_constraint(\n new midgard_query_property('comment'),\n '=',\n new midgard_query_value($comment->id)\n ));\n $qc->add_constraint(new midgard_query_constraint(\n new midgard_query_property('rating'),\n '=',\n new midgard_query_value('')\n ));\n\n $q->set_constraint($qc);\n\n $q->execute();\n $ratings = $q->list_objects();\n\n if (count($ratings))\n {\n foreach ($ratings as $rating)\n {\n $res = $rating->delete();\n if ($res)\n {\n $mvc->log(__CLASS__, 'Rating object with id: ' . $rating->id . ' has been successfuly deleted.', 'info');\n }\n else\n {\n $mvc->log(__CLASS__, 'Rating object with id: ' . $rating->id . ' could not be deleted.', 'info');\n }\n }\n }\n }\n }",
"public function deleted(Review $entity)\n {\n ReviewDeletedEvent::dispatch($entity);\n }",
"static function listenToDeleteDocument(sfEvent $request)\n {\n $model = $event['object'];\n\n $docFields = $model->getSolrDocumentFields();\n $solr = uvmcSolrServicesManager::getInstance()->getService();\n $solr->deleteById($docFields['id']);\n }",
"public function deleted(Candidacy $candidacy)\n {\n //\n }",
"public function delete() {\n $this->setStatus(-1);\n $this->save();\n\n if (!is_null($this->getOrder())) {\n if (is_object($this->getOrder()->getCustomer())) {\n $fidelity = $this->getOrder()->getCustomer()->getFidelity();\n $transaction = $fidelity->getTransactionByTransactionDataAction($this->getOrderId(), 'rate_');\n if ($transaction['id'] > 0) {\n $fidelity->modifyTransaction($transaction['id'], -1);\n }\n $this->logger->info(sprintf(\"set fidelity transaction #%s to state -1 while deleting rating\", $transaction['id']));\n }\n }\n }",
"protected function afterDeletion() {}",
"protected function afterDelete () {}",
"public function deleted()\n {\n // Delete related images when model is deleted\n $this->deleteImages();\n }",
"abstract public function handleDelete($event);",
"public static function onDeleted(callable $fn): void\n\t{\n\t\tstatic::prepareModel();\n\t\tstatic::$listener[static::class]->addDeletedListener($fn);\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Retrun regitered content providers | public function content_providers() {
$providers = jet_smart_filters()->providers->get_providers();
$result = array(
'' => esc_html__( 'Select...', 'jet-smart-filters' ),
);
foreach ( $providers as $provider_id => $provider ) {
$result[ $provider_id ] = $provider->get_name();
}
return $result;
} | [
"abstract public function getProviders();",
"public function getProviders();",
"abstract public function providers(): array;",
"public function getProviders($provider)\n {\n }",
"protected function registerProviders()\r\n {\r\n $res = Cms::allModuleProvider();\r\n //print_r($res);exit;\r\n\r\n foreach ($res as $key => $provider) {\r\n $this->app->register($provider);\r\n }\r\n }",
"function registerAllProvider()\n {\n foreach($this->_providers as $name => $file )\n {\n $obj = $this->getInstance($name);\n $obj->register();\n }\n }",
"protected function _scan_providers () {\r\n\t\treturn $this->_scan_klasses('providers');\r\n\t}",
"function wp_get_sitemap_providers()\n {\n }",
"function wp_get_sitemap_providers() {}",
"function action_load_providers() {\n\t\t$module_dirs = array_diff( scandir( AD_CODE_MANAGER_ROOT . '/providers/' ), array( '..', '.' ) );\n\t\tforeach( $module_dirs as $module_dir ) {\n\t\t\t$module_dir = str_replace( '.php', '', $module_dir );\n\t\t\tif ( file_exists( AD_CODE_MANAGER_ROOT . \"/providers/$module_dir.php\" ) ) {\n\t\t\t\tinclude_once( AD_CODE_MANAGER_ROOT . \"/providers/$module_dir.php\" );\n\t\t\t}\n\n\t\t\t$tmp = explode( '-', $module_dir );\n\t\t\t$class_name = '';\n\t\t\t$slug_name = '';\n\t\t\t$table_class_name = '';\n\t\t\tforeach( $tmp as $word ) {\n\t\t\t\t$class_name .= ucfirst( $word ) . '_';\n\t\t\t\t$slug_name .= $word . '_';\n\t\t\t}\n\t\t\t$table_class_name = $class_name . 'ACM_WP_List_Table';\n\t\t\t$class_name .= 'ACM_Provider';\n\t\t\t$slug_name = rtrim( $slug_name, '_' );\n\n\t\t\t// Store class names, but don't instantiate\n\t\t\t// We don't need them all at once\n\t\t\tif ( class_exists( $class_name ) ) {\n\t\t\t\t$this->providers->$slug_name = array( 'provider' => $class_name,\n\t\t\t\t\t\t\t\t\t\t\t\t\t 'table' => $table_class_name,\n\t\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t}\n\n\t\t}\n\t\t\n\t\t/**\n\t\t * Configuration filter: acm_register_provider_slug\n\t\t *\n\t\t * We've already gathered a list of default providers by scanning the ACM plugin\n\t\t * directory for classes that we can use. To add a provider already included via\n\t\t * a different directory, the following filter is provided.\n\t\t */\n\t\t$this->providers = apply_filters( 'acm_register_provider_slug', $this->providers );\n\n\t\t/**\n\t\t * Configuration filter: acm_provider_slug\n\t\t *\n\t\t * By default we use doubleclick-for-publishers provider\n\t\t * To switch to a different ad provider use this filter\n\t\t */\n\t\t$this->current_provider_slug = apply_filters( 'acm_provider_slug', 'doubleclick_for_publishers' );\n\t\t\n\t\t// Instantiate one that we need\n\t\tif ( isset( $this->providers->{$this->current_provider_slug} ) )\n\t\t\t$this->current_provider = new $this->providers->{$this->current_provider_slug}['provider'];\n\n\t\t// Nothing to do without a provider\n\t\tif ( !is_object( $this->current_provider ) )\n\t\t\treturn ;\n\n\t\t/**\n\t\t * Configuration filter: acm_whitelisted_script_urls\n\t\t * A security filter to whitelist which ad code script URLs can be added in the admin\n\t\t */\n\t\t$this->current_provider->whitelisted_script_urls = apply_filters( 'acm_whitelisted_script_urls', $this->current_provider->whitelisted_script_urls );\n\n\t}",
"function action_load_providers() {\n\t\t$module_dirs = array_diff( scandir( AD_CODE_MANAGER_ROOT . '/providers/' ), array( '..', '.' ) );\n\t\tforeach ( $module_dirs as $module_dir ) {\n\t\t\t$module_dir = str_replace( '.php', '', $module_dir );\n\t\t\tif ( file_exists( AD_CODE_MANAGER_ROOT . \"/providers/$module_dir.php\" ) ) {\n\t\t\t\tinclude_once AD_CODE_MANAGER_ROOT . \"/providers/$module_dir.php\";\n\t\t\t}\n\n\t\t\t$tmp = explode( '-', $module_dir );\n\t\t\t$class_name = '';\n\t\t\t$slug_name = '';\n\t\t\t$table_class_name = '';\n\t\t\tforeach ( $tmp as $word ) {\n\t\t\t\t$class_name .= ucfirst( $word ) . '_';\n\t\t\t\t$slug_name .= $word . '_';\n\t\t\t}\n\t\t\t$table_class_name = $class_name . 'ACM_WP_List_Table';\n\t\t\t$class_name .= 'ACM_Provider';\n\t\t\t$slug_name = rtrim( $slug_name, '_' );\n\n\t\t\t// Store class names, but don't instantiate\n\t\t\t// We don't need them all at once\n\t\t\tif ( class_exists( $class_name ) ) {\n\t\t\t\t$this->providers->$slug_name = array(\n\t\t\t\t\t'provider' => $class_name,\n\t\t\t\t\t'table' => $table_class_name,\n\t\t\t\t);\n\t\t\t}\n\n\t\t}\n\n\t\t/**\n\t\t * Configuration filter: acm_register_provider_slug\n\t\t *\n\t\t * We've already gathered a list of default providers by scanning the ACM plugin\n\t\t * directory for classes that we can use. To add a provider already included via\n\t\t * a different directory, the following filter is provided.\n\t\t */\n\t\t$this->providers = apply_filters( 'acm_register_provider_slug', $this->providers );\n\n\t\t/**\n\t\t * Configuration filter: acm_provider_slug\n\t\t *\n\t\t * By default we use doubleclick-for-publishers provider\n\t\t * To switch to a different ad provider use this filter\n\t\t */\n\n\t\t$this->current_provider_slug = apply_filters( 'acm_provider_slug', $this->get_option( 'provider' ) );\n\n\t\t// Instantiate one that we need\n\t\tif ( isset( $this->providers->{$this->current_provider_slug} ) )\n\t\t\t$this->current_provider = new $this->providers->{$this->current_provider_slug}['provider'];\n\n\t\t// Nothing to do without a provider\n\t\tif ( !is_object( $this->current_provider ) )\n\t\t\treturn ;\n\t\t/**\n\t\t * Configuration filter: acm_whitelisted_script_urls\n\t\t * A security filter to whitelist which ad code script URLs can be added in the admin\n\t\t */\n\t\t$this->current_provider->whitelisted_script_urls = apply_filters( 'acm_whitelisted_script_urls', $this->current_provider->whitelisted_script_urls );\n\n\t}",
"public function upgradeContentProviders() : void {\n $callback = function ($row) {\n $entity = new ContentProvider();\n $entity->setContentOwner($this->findEntity(ContentOwner::class, $row['content_owner_id']));\n $entity->setPln($this->findEntity(Pln::class, $row['pln_id']));\n $entity->setPlugin($this->findEntity(Plugin::class, $row['plugin_id']));\n $entity->setUuid($row['uuid']);\n $entity->setPermissionUrl($row['permissionUrl']);\n $entity->setName($row['name']);\n $entity->setMaxFileSize($row['max_file_size']);\n $entity->setMaxAuSize($row['max_au_size']);\n\n return $entity;\n };\n $this->upgradeTable('content_providers', $callback);\n }",
"public function getServiceProviders()\n {\n # Process core \n $aConfig = $this->getConfig();\n \n $parentProviders = parent::getServiceProviders();\n $localProviders = [\n new Provider\\StorageExtensionsProvider($aConfig),\n new Provider\\CommandBusProvider($aConfig),\n new Provider\\CronParseProvider($aConfig),\n new Provider\\CustomValidationProvider($aConfig),\n new Provider\\ExtrasProvider($aConfig),\n new Provider\\FormProvider($aConfig),\n new Provider\\SearchQueryProvider($aConfig),\n new Provider\\MenuProvider($aConfig),\n new Provider\\DataTableProvider($aConfig),\n ];\n \n $aBunldes = [];\n \n # Process bundles\n foreach($aConfig['bundle'] as $sBundle => $bUseBundle) {\n if($bUseBundle) {\n $sClass = 'Bolt\\\\Extension\\\\IComeFromTheNet\\\\BookMe\\\\Bundle\\\\'.$sBundle.'\\\\'.$sBundle.'Bundle';\n $oClass = new $sClass($aConfig);\n \n $oClass->setBaseDirectory($this->getBaseDirectory());\n $oClass->setWebDirectory($this->getWebDirectory());\n \n $aBunldes[] = $oClass;\n }\n }\n \n \n return array_merge($parentProviders,$localProviders,$aBunldes);\n }",
"protected function &_loadProviders()\n\t{\n\t\tstatic $plugins;\n\n\t\tif (isset($plugins))\n\t\t{\n\t\t\treturn $plugins;\n\t\t}\n\n\t\t$db = JFactory::getDBO();\n\t\t$query = $db->getQuery(1);\n\t\t$query->select('element type, sp.*')->from('#__sso_providers sp')\n\t\t\t->rightJoin('#__plugins p ON p.id = sp.plugin_id')\n\t\t\t->where('sp.published >= 1')->where('p.published >= 1')\n\t\t\t->order('ordering');\n\n\t\t$db->setQuery($query);\n\n\t\t$plugins = $db->loadObjectList();\n\t\treturn $plugins;\n\t}",
"private function get_providers()\n {\n foreach($this->db->select('nom')->from('providers')->get()->result() as $v)\n {\n $providers[] = $v->nom;\n }\n return $providers;\n }",
"abstract function get_provider_information();",
"function wp_get_sitemap_providers() {\n\t$sitemaps = wp_sitemaps_get_server();\n\treturn $sitemaps->registry->get_providers();\n}",
"private function _loadProviders()\n {\n if($this->_providersLoaded)\n {\n return;\n }\n\n\n // providers\n\n foreach($this->getProviderSources() as $providerSource)\n {\n $lcHandle = strtolower($providerSource->getHandle());\n\n $record = $this->_getProviderRecordByHandle($providerSource->getHandle());\n\n $provider = Oauth_ProviderModel::populateModel($record);\n $provider->class = $providerSource->getHandle();\n\n\n // source\n\n if($record && !empty($provider->clientId))\n {\n // client id and secret\n\n $clientId = false;\n $clientSecret = false;\n\n // ...from config\n\n $oauthConfig = craft()->config->get('oauth');\n\n if($oauthConfig)\n {\n\n if(!empty($oauthConfig[$providerSource->getHandle()]['clientId']))\n {\n $clientId = $oauthConfig[$providerSource->getHandle()]['clientId'];\n }\n\n if(!empty($oauthConfig[$providerSource->getHandle()]['clientSecret']))\n {\n $clientSecret = $oauthConfig[$providerSource->getHandle()]['clientSecret'];\n }\n }\n\n // ...from provider\n\n if(!$clientId)\n {\n $clientId = $provider->clientId;\n }\n\n if(!$clientSecret)\n {\n $clientSecret = $provider->clientSecret;\n }\n\n // source\n $providerSource->initProviderSource($clientId, $clientSecret);\n $provider->setSource($providerSource);\n $this->_configuredProviders[$lcHandle] = $provider;\n }\n else\n {\n $provider->setSource($providerSource);\n }\n\n $this->_allProviders[$lcHandle] = $provider;\n }\n\n $this->_providersLoaded = true;\n }",
"public function registerCoreProviders()\n {\n foreach ($this->providers as $provider) {\n $this->make($provider)->register();\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the packageId Android Enterprise app configuration package id. | public function getPackageId()
{
if (array_key_exists("packageId", $this->_propDict)) {
return $this->_propDict["packageId"];
} else {
return null;
}
} | [
"public function getPackageId()\n {\n return $this->packageId;\n }",
"public function getPackageId()\n {\n return $this->package_id;\n }",
"public static function getAppID(){\n\t\treturn OptionHelper::getOption('app_id');\n\t}",
"private function getAppId() {\n $inventoryClass = new ReflectionClass(get_class($this));\n return $inventoryClass->getConstant('APP_ID');\n }",
"public function getAppID()\n {\n $id = SiteConfig::current_site_config()->FacebookAppID;\n \n if (!$id) {\n $id = self::config()->app_id;\n }\n \n return $id;\n }",
"public function getAppid() {\n $this->_appid = $this->getConfig()->webservice->ydnkeys->consumerkey;\n return $this->_appid;\n }",
"private function getAppId() {\n \t$configFactory = \\Drupal::configFactory()->getEditable('facebook_fetch_custom.settings');\n\t $app_id = $configFactory\n\t ->get('appId');\n\t return $app_id;\n }",
"public function packageId(): string\n {\n return $this->pluck('messageDetail.stickerMessageDetail.packageId');\n }",
"public function getAppid()\n\t\t{\n\t\t\treturn $this->appid;\n\t\t}",
"public function getDesignPackageId()\n {\n return $this->getProperty(\"DesignPackageId\");\n }",
"public function getApplicationId()\n {\n return $this->getValue('application');\n }",
"public function getAppDeploymentId(): string;",
"public function getAppBundleId()\n {\n return $this->appBundleId;\n }",
"public function getAppBundleId()\n {\n return $this->app_bundle_id;\n }",
"public function getAppId()\n {\n return isset($this->app_id) ? $this->app_id : '';\n }",
"public function getApplicationId()\n {\n return $this->appId;\n }",
"public function getApplicationId()\r\n\t{\r\n\t\treturn $this->appId;\r\n\t}",
"public function getPackageID() {\r\n\t\treturn $this->packageID;\r\n\t}",
"public function getAccessPackageId()\n {\n if (array_key_exists(\"accessPackageId\", $this->_propDict)) {\n return $this->_propDict[\"accessPackageId\"];\n } else {\n return null;\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ Cache Salts (helper) Use this function to compose Transient API keys, prepends a zd and generates a salt based on the username and the api_url and the provided postfix variable. | private function _salt( $postfix ) {
return 'zd-' . md5( 'zendesk-' . $this->username . $this->api_url . $postfix );
} | [
"public function generateSalt();",
"private function generateApiKey()\n {\n // TODO Add checks to make sure that the key is unique\n return md5( uniqid( rand(), true ) );\n }",
"private function generateApiKey()\r\n {\r\n return md5(uniqid(rand(), true));\r\n }",
"private function generateApiKey()\n {\n return md5(uniqid(rand(), true));\n }",
"public function action_regenerate_api_key() {\n\t\tif (!$this->request->is_ajax()) {\n\t\t\twp_die('Oops, this method can only be accessed via an AJAX request.');\n\t\t}\n\n\t\t$key = wp_generate_password(16, false);\n\t\tSocial::option('system_cron_api_key', $key, true);\n\t\techo $key;\n\t\texit;\n\t}",
"private function generateApiKey() {\r\n return md5(uniqid(rand(), true));\r\n }",
"private function generateApiKey() {\n return md5(uniqid(rand(), true));\n }",
"function generate( $args, $assoc_args ) {\n $defaults = array(\n 'format' => 'php',\n );\n $assoc_args = array_merge( $defaults, $assoc_args );\n\n $api = 'https://api.wordpress.org/secret-key/1.1/salt/';\n $data = file_get_contents( $api );\n $output = self::_format_data( $data, $assoc_args['format'] );\n\n if ( isset( $assoc_args['file'] ) ) {\n $file = $assoc_args['file'];\n\n if ( ! is_writable( $file ) )\n WP_CLI::error( 'File is not writable or path is not correct: ' . $file );\n\n if ( ! file_put_contents( $file, $output ) )\n WP_CLI::error( 'Could not write salts to: ' . $file );\n\n WP_CLI::success( 'Added salts to: ' . $file );\n return;\n }\n\n fwrite( STDOUT, $output );\n }",
"public function generateApiKey()\n {\n $characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';\n $apikey = '';\n for ($i = 0; $i < 64; ++$i) {\n $apikey .= $characters[rand(0, strlen($characters) - 1)];\n }\n $apikey = base64_encode(sha1(uniqid('ue'.rand(rand(), rand())).$apikey));\n $this->apiKey = $apikey;\n }",
"public static function addSalt()\n\t{\n\t\t/** @var IOInterface $io */\n\t\t$io = self::$io;\n\t\tif ( ! $salt = self::fetchSalt() )\n\t\t{\n\t\t\t$io->write( ' |- WordPress Remote API for Salt generation did not respond' );\n\t\t\treturn;\n\t\t}\n\t\telseif ( false === strpos( self::$source, 'AUTH_KEY' ) )\n\t\t{\n\t\t\tself::append( 'Auth Keys', array( $salt ) );\n\t\t}\n\t}",
"private function createKey() {\n $ts = time();\n $hash = md5($ts . $this->_privatekey . $this->_publickey);\n $key = 'ts=' . $ts . '&apikey=' . $this->_publickey . \n '&hash=' . $hash;\n return $key;\n }",
"function mswGenerateProductKey() {\n $_SERVER['HTTP_HOST'] = (isset($_SERVER['HTTP_HOST']) && $_SERVER['HTTP_HOST'] ? $_SERVER['HTTP_HOST'] : uniqid(rand(), 1));\n $_SERVER['REMOTE_ADDR'] = (isset($_SERVER['REMOTE_ADDR']) && $_SERVER['REMOTE_ADDR'] ? $_SERVER['REMOTE_ADDR'] : uniqid(rand(), 1));\n if (function_exists('sha1')) {\n $c1 = sha1($_SERVER['HTTP_HOST'] . date('YmdHis') . $_SERVER['REMOTE_ADDR'] . time());\n $c2 = sha1(uniqid(rand(), 1) . time());\n $prodKey = substr($c1 . $c2, 0, 60);\n } elseif (function_exists('md5')) {\n $c1 = md5($_SERVER['HTTP_POST'] . date('YmdHis') . $_SERVER['REMOTE_ADDR'] . time());\n $c2 = md5(uniqid(rand(), 1), time());\n $prodKey = substr($c1 . $c2, 0, 60);\n } else {\n $c1 = str_replace('.', '', uniqid(rand(), 1));\n $c2 = str_replace('.', '', uniqid(rand(), 1));\n $c3 = str_replace('.', '', uniqid(rand(), 1));\n $prodKey = substr($c1 . $c2 . $c3, 0, 60);\n }\n return strtoupper($prodKey);\n}",
"private function createSalt () {\n $salt = rand() . time() . rand();\n return $salt;\n }",
"public static function getFromAPI()\n {\n $response = file_get_contents('https://api.wordpress.org/secret-key/1.1/salt/');\n\n if (!$response) {\n throw new \\Exception(\"Couldn't generate salts keys from API.\");\n }\n\n return $response;\n }",
"protected function _mkSalt() {\n \t\t\t$this->_salt = mt_rand(476, mt_getrandmax());\n \t\t\t$this->_salt = md5(time() . $this->_salt);\n\t\t}",
"function generateApiKey($str_length){\n //base 62 map\n $chars = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';\n\n //get enough random bits for base 64 encoding (and prevent '=' padding)\n //note: +1 is faster than ceil()\n $bytes = openssl_random_pseudo_bytes(3*$str_length/4+1);\n\n //convert base 64 to base 62 by mapping + and / to something from the base 62 map\n //use the first 2 random bytes for the characters\n $repl = unpack('C2', $bytes);\n\n $first = $chars[$repl[1]%62];\n $second = $chars[$repl[2]%62];\n return strtr(substr(base64_encode($bytes), 0, $str_length), '+/', \"$first$second\");\n\n}",
"function getSalt(){\r\n\t\treturn \"sticeCraftAdministrationS@lT123\";\r\n\t}",
"public function setSalt();",
"public function generateKeyAndSecret() {\n $user = user_load($this->uid);\n\n $this->app_key = str_replace(array(' ', '', '-'), '_', strtolower($this->title));\n $this->app_secret = md5($user->name . $this->time);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Tests BACKGROUND: GIVEN I enabled the autocompletion feature | private function enableAutocompletion() {
$pluginSettingsDao =& DAORegistry::getDAO('PluginSettingsDAO'); /* @var $pluginSettingsDao PluginSettingsDAO */
// Enable the search feature.
$pluginSettingsDao->updateSetting(0, 'luceneplugin', 'autosuggest', true);
// Use the faceting implementation so that our scope tests will work.
$pluginSettingsDao->updateSetting(0, 'luceneplugin', 'autosuggestType', SOLR_AUTOSUGGEST_FACETING);
} | [
"function testCompletionNavigation()\n {\n if ($this->sharedFixture['browserId'] == \"o\") {\n $this->sharedFixture['listener']->addSkippedTest($this, new Exception(\"SKIPPED (don't work with Opera)\"));\n return;\n }\n// $this->assertFalse($this->sharedFixture['browserId'] == \"o\",\n// \"This test don't work with Opera (because of keyUp/keyPress don't work with Opera)\");\n\n $this->init();\n\n if ($this->sharedFixture['browserId'] == \"f\") {\n $this->selenium->typeKeys(\"autocomplete_query\", \"inf\");\n }\n else $this->selenium->type(\"autocomplete_query\", \"inf\");\n $this->selenium->keyUp(\"autocomplete_query\", \"\\\\\");\n sleep($this->sharedFixture['waitForExecution']);\n\n if ($this->sharedFixture['browserId'] == \"f\") {\n $this->selenium->keyPress(\"autocomplete_query\", \"o\");\n }\n else $this->selenium->type(\"autocomplete_query\", \"info\");\n $this->selenium->keyUp(\"autocomplete_query\", \"\\\\\");\n\n sleep($this->sharedFixture['waitForExecution']);\n $this->myAssertTrueRegEx('/Treffer.*\\b1\\b.*\\b5\\b.*\\binfo\\b/',$this->selenium->getText(\"hits_title\"));\n\n // Navigate through the completions using cursor down/up\n $this->selenium->keyUp(\"autocomplete_query\", \"\\\\40\");\n sleep($this->sharedFixture['waitForExecution']);\n $this->myAssertEquals(\"information\", $this->selenium->getValue(\"autocomplete_query\"));\n\n // Hits has to be unchanged\n $this->myAssertTrueRegEx('/Treffer.*\\b1\\b.*\\b5\\b.*\\binfo\\b/',$this->selenium->getText(\"hits_title\"));\n\n // Sollte \"info\" nicht am Anfang der Liste stehen? Hannah: ist ok\n $this->selenium->keyUp(\"autocomplete_query\", \"\\\\40\");\n sleep($this->sharedFixture['waitForExecution']);\n $this->myAssertEquals(\"info\", $this->selenium->getValue(\"autocomplete_query\"));\n\n $this->selenium->keyUp(\"autocomplete_query\", \"\\\\40\");\n sleep($this->sharedFixture['waitForExecution']);\n $this->myAssertEquals(\"infocom\", $this->selenium->getValue(\"autocomplete_query\"));\n\n $this->selenium->keyUp(\"autocomplete_query\", \"\\\\40\");\n sleep($this->sharedFixture['waitForExecution']);\n $this->myAssertEquals(\"informal\", $this->selenium->getValue(\"autocomplete_query\"));\n\n $this->selenium->keyUp(\"autocomplete_query\", \"\\\\40\");\n sleep($this->sharedFixture['waitForExecution']);\n $this->myAssertEquals(\"informal\", $this->selenium->getValue(\"autocomplete_query\"));\n\n $this->selenium->keyUp(\"autocomplete_query\", \"\\\\38\");\n sleep($this->sharedFixture['waitForExecution']);\n $this->myAssertEquals(\"infocom\", $this->selenium->getValue(\"autocomplete_query\"));\n\n $this->selenium->keyUp(\"autocomplete_query\", \"\\\\38\");\n sleep($this->sharedFixture['waitForExecution']);\n $this->myAssertEquals(\"info\", $this->selenium->getValue(\"autocomplete_query\"));\n\n $this->selenium->keyUp(\"autocomplete_query\", \"\\\\38\");\n sleep($this->sharedFixture['waitForExecution']);\n $this->myAssertEquals(\"information\", $this->selenium->getValue(\"autocomplete_query\"));\n\n // Now back to the first completion\n $this->selenium->keyUp(\"autocomplete_query\", \"\\\\38\");\n $this->selenium->keyUp(\"autocomplete_query\", \"\\\\38\");\n $this->selenium->keyUp(\"autocomplete_query\", \"\\\\38\");\n\n $this->myAssertEquals(\"info\", $this->selenium->getValue(\"autocomplete_query\"));\n\n // We are at the beginning of completions; further cursor up events have to result in unchanged input in autocomplete_query\n $this->selenium->keyUp(\"autocomplete_query\", \"\\\\38\");\n sleep($this->sharedFixture['waitForExecution']);\n $this->myAssertEquals(\"info\", $this->selenium->getValue(\"autocomplete_query\"));\n }",
"public function testAutocomplete() {\n // Declare\n $query = 'Phantom';\n $field = 'title';\n $stub_user = $this->getMock('User');\n $stub_user->expects($this->exactly(3))\n ->method('has_permission')\n ->will($this->returnValue( TRUE ));\n $stub_user->role = User::ROLE_ADMIN;\n $stub_user->company_id = self::COMPANY_ID;\n\n // Create\n $ph_user = $this->phactory->create('users');\n $this->phactory->create('websites', array( 'user_id' => $ph_user->user_id ) );\n\n // First autocomplete as Admin\n $accounts = $this->account->autocomplete( $query, $field, $stub_user );\n $expected_accounts = array( array( 'title' => self::TITLE ) );\n\n $this->assertEquals( $expected_accounts, $accounts );\n\n // Second check for the status\n $accounts = $this->account->autocomplete( $query, $field, $stub_user, Account::STATUS_ACTIVE );\n $expected_accounts = array( array( 'title' => self::TITLE ) );\n $this->assertEquals( $expected_accounts, $accounts );\n\n // Third change role\n $stub_user->role = User::ROLE_ONLINE_SPECIALIST;\n\n $accounts = $this->account->autocomplete( $query, $field, $stub_user );\n $expected_accounts = array( array( 'title' => self::TITLE ) );\n\n $this->assertEquals( $expected_accounts, $accounts );\n }",
"abstract protected function _getAutoCompleter();",
"public function testAutocompleteResponse()\n {\n }",
"public function testAirportAutocomplete()\n {\n }",
"public function testFlightAirportAutocomplete()\n {\n }",
"public function testAutoComplete()\r\n {\r\n $this->session->visit('http://localhost:8000/app_test.php/communication/search');\r\n // Get the page\r\n $page = $this->session->getPage();\r\n // Search box\r\n $this->assertNotNull($page->find('named', array('id', \"searchBox\")));\r\n // Search for a communication\r\n $page->find('named', array('id', \"searchBox\"))->setValue(\"P\");\r\n\r\n // Make Mink wait for the search to complete. This has to be REALLY long because the dev server is slow.\r\n $this->session->wait(5000);\r\n\r\n // Make sure autocomplete options show up (select on the CSS)\r\n $this->assertTrue($page->find('css', \".results.transition\")->isVisible());\r\n // Results we expect back\r\n $expectedResults = array(\"Phone\", \"In Person\");\r\n // Make sure we get the results we expect\r\n foreach ($page->findAll('css', \".result .content .title\") as $result)\r\n {\r\n $this->assertTrue(in_array($result->getText(), $expectedResults));\r\n }\r\n\r\n // Click Phone (should be the first result), and make sure it goes into the search box\r\n $page->find('css', \".result .content .title\")->click();\r\n $this->assertEquals($page->find('named', array('id', \"searchBox\"))->getValue(), \"Phone\");\r\n\r\n $this->session->wait(500);\r\n\r\n // Assert the complete went away\r\n $this->assertFalse($page->find('css', \"div.results.transition\")->isVisible());\r\n }",
"public function testQuerySuggestionsNameGet()\n {\n }",
"public function testOperatorAutocomplete()\n {\n }",
"public function testEndpoint()\n {\n $content = $this->get( $this->baseUrl() . '/search/autocomplete');\n\n $content->assertResponseStatus(200);\n\n $content->seeJsonStructure(['suggestions']);\n }",
"function test_autocom() //หน้าหลัก load autocomplete\n\t{\n\t\t $this->load->view('form_autocom2');\n\t}",
"protected function checkLiveResultsAutocomplete() {\n $assert_session = $this->assertSession();\n\n // First, enable \"Live results\" as the only suggester.\n $this->drupalGet($this->getAdminPath('edit'));\n $page = $this->getSession()->getPage();\n $this->click('input[name=\"suggesters[enabled][live_results]\"]');\n $page->find('css', 'details[data-drupal-selector=\"edit-suggesters-settings-live-results\"] > summary')->click();\n $edit = [\n 'suggesters[enabled][live_results]' => TRUE,\n 'suggesters[enabled][search_api_autocomplete_test]' => FALSE,\n 'suggesters[enabled][server]' => FALSE,\n 'suggesters[settings][live_results][fields][name]' => FALSE,\n 'suggesters[settings][live_results][fields][body]' => TRUE,\n ];\n $this->drupalPostForm(NULL, $edit, 'Save');\n $assert_session->pageTextContains('The autocompletion settings for the search have been saved.');\n\n // Then, set an appropriate search method for the test backend.\n $callback = [TestsHelper::class, 'search'];\n $this->setMethodOverride('backend', 'search', $callback);\n\n // Get the autocompletion results.\n $this->drupalGet('search-api-autocomplete-test');\n $suggestions = [];\n foreach ($this->getAutocompleteSuggestions() as $element) {\n $label = $this->getElementText($element, '.autocomplete-suggestion-label');\n $suggestions[$label] = $element;\n }\n\n // Make sure the suggestions are as expected.\n $expected = [\n $this->entities[3]->label(),\n $this->entities[4]->label(),\n $this->entities[2]->label(),\n ];\n $this->assertEquals($expected, array_keys($suggestions));\n\n // Make sure all the search query settings were as expected.\n /** @var \\Drupal\\search_api\\Query\\QueryInterface $query */\n $query = $this->getMethodArguments('backend', 'search')[0];\n $this->assertInstanceOf(QueryInterface::class, $query);\n $this->assertEquals(0, $query->getOption('offset'));\n $this->assertEquals(5, $query->getOption('limit'));\n $this->assertEquals(['body'], $query->getFulltextFields());\n $this->assertEquals('Tést', $query->getOriginalKeys());\n\n // Click on one of the suggestions and verify it takes us to the expected\n // page.\n $suggestions[$this->entities[3]->label()]->click();\n $this->logPageChange();\n $path = $this->entities[3]->toUrl()->getInternalPath();\n $assert_session->addressEquals('/' . $path);\n }",
"public function testAutoResumeAutoImport()\n {\n\n }",
"public function testBrowserAutocompleteOptionTrue()\n {\n $options = ['browser_autocomplete' => true];\n $form = $this->factory->create(OroPlaceholderPasswordType::class, null, $options);\n $view = $form->createView();\n // Use default browser's behaviour. Don't put any additional attributes\n $this->assertArrayNotHasKey('autocomplete', $view->vars['attr']);\n }",
"public function testAssistantScanComplete()\n {\n }",
"public function testPublisherSuggestionsList()\n {\n }",
"public function providerTestAutocompleteSuggestions() {\n $test_parameters = [];\n $test_parameters[] = [\n 'string' => 'Com',\n 'suggestions' => [\n 'Comment',\n ],\n ];\n $test_parameters[] = [\n 'string' => 'No',\n 'suggestions' => [\n 'Node',\n 'None & Such',\n ],\n ];\n $test_parameters[] = [\n 'string' => 'us',\n 'suggestions' => [\n 'User',\n ],\n ];\n $test_parameters[] = [\n 'string' => 'Banana',\n 'suggestions' => [],\n ];\n return $test_parameters;\n }",
"public function testDocumentAutocomplete()\n {\n $result = (string) $this->get('admin/pages/adddocument/documentautocomplete?term=EXIST')->getBody();\n $this->assertJson($result, 'Autocompleter should return JSON');\n $this->assertContains(\"File That Doesn't Exist (Title)\", $result);\n $this->assertContains('test-file-file-doesnt-exist-1', $result);\n $this->assertNotContains('doc-logged-in-users', $result);\n\n $document = $this->objFromFixture(DMSDocument::class, 'd2');\n $result = (string) $this->get('admin/pages/adddocument/documentautocomplete?term=' . $document->ID)->getBody();\n $this->assertContains($document->ID . \" - File That Doesn't Exist (Title)\", $result);\n }",
"public function testListPublisherSuggestions()\n {\n\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns an instance of the report class. The instance returned by this method depends on the report options selected in the forms. The form for these options are generated by the ReportController::initializeForm() method. | public function getReport()
{
switch(isset($_REQUEST["report_format"])?$_REQUEST["report_format"]:"pdf")
{
case "pdf":
$report = new PDFReport(
isset($_REQUEST["page_orientation"]) ?
$_REQUEST["page_orientation"] :
PDFReport::ORIENTATION_LANDSCAPE,
isset($_REQUEST["paper_size"]) ?
$_REQUEST["paper_size"] :
PDFReport::PAPER_A4
);
break;
case "html":
$report = new HTMLReport();
$report->htmlHeaders = true;
break;
case "html-no-headers":
$report = new HTMLReport();
break;
case "xls":
$report = new XLSReport();
break;
case "doc":
$report = new MSWordReport();
break;
case "json":
$report = new JSONReport();
break;
}
return $report;
} | [
"private function getReportInstance()\n {\n $name = $this->getReportClassName();\n ReportFactory::loadReportClass($name);\n\n return new $name;\n }",
"public function getFormReportCreate()\n {\n return $this->report->getCreateForm();\n }",
"private static function get_form_for_reports() {\n\t\t$form = false;\n\t\tif ( isset( $_REQUEST['form'] ) ) {\n\t\t\t$form = FrmForm::getOne( $_REQUEST['form'] );\n\t\t}\n\n\t\treturn $form;\n\t}",
"function ReportSelector() {\n\t\t$reports = ClassInfo::subclassesFor(\"SideReport\");\n\n\t\t$options[\"\"] = _t('CMSMain.CHOOSEREPORT',\"(Choose a report)\");\n\t\tforeach($reports as $report) {\n\t\t\tif($report != 'SideReport') $options[$report] = singleton($report)->title();\n\t\t}\n\t\treturn new DropdownField(\"ReportSelector\", _t('CMSMain.REPORT', 'Report'),$options);\n\t}",
"protected function _initReport()\n {\n $reportId = (int) $this->getRequest()->getParam('id');\n $report = Mage::getModel('bs_report/report');\n if ($reportId) {\n $report->load($reportId);\n }\n Mage::register('current_report', $report);\n return $report;\n }",
"protected function getReportClass() {\n /*If model have prolongation field filled, use Manager class */\n $external_cls = '';\n if ($this->model->getAcceptInModel() != 0) {\n $external_cls = self::MANAGER_AGREEMENT;\n }\n\n $cls = $this->model->getModelCategory()->getAgreementClass($external_cls);\n if (!empty($this->_class)) {\n $cls = $this->_class;\n }\n\n if ($this->model->getStatus() == 'accepted' && !$this->model->isValidModelCategory()) {\n $cls_report = $cls . 'ManagerReport';\n\n $cls = !class_exists($cls_report) ? ($cls . 'Report') : $cls_report;\n } else {\n if (!empty($this->_postfix)) {\n $cls .= ucfirst($this->_postfix);\n }\n }\n\n return new $cls($this->model, $this->_params);\n }",
"protected function getOroReport_Form_Type_ReportService()\n {\n return $this->services['oro_report.form.type.report'] = new \\Oro\\Bundle\\ReportBundle\\Form\\Type\\ReportType();\n }",
"public function GetReportDB()\n {\n if (!isset($reportDB)) {\n $reportDB = new SQLReport();\n }\n return $reportDB;\n }",
"public function getReport()\n {\n if (isset($this->centrifuge) && $this->centrifuge) {\n $this->report->setCentrifuge($this->centrifuge);\n }\n\n return $this->report;\n }",
"public function _report_form()\n\t{\n\t\t// Load the View\n\t\t$form = View::factory('actionable_form');\n\t\t// Get the ID of the Incident (Report)\n\t\t$id = Event::$data;\n\t\t\n\t\tif ($id)\n\t\t{\n\t\t\t// Do We have an Existing Actionable Item for this Report?\n\t\t\t$action_item = ORM::factory('actionable')\n\t\t\t\t->where('incident_id', $id)\n\t\t\t\t->find();\n\t\t\tif ($action_item->loaded)\n\t\t\t{\n\t\t\t\t$this->actionable = $action_item->actionable;\n\t\t\t\t$this->action_taken = $action_item->action_taken;\n\t\t\t\t$this->action_summary = $action_item->action_summary;\n\t\t\t\t$this->resolution_summary = $action_item->resolution_summary;\n\t\t\t}\n\t\t}\n\t\t\n\t\t$form->actionable = $this->actionable;\n\t\t$form->action_taken = $this->action_taken;\n\t\t$form->action_summary = $this->action_summary;\n\t\t$form->resolution_summary = $this->resolution_summary;\n\t\t$form->render(TRUE);\n\t}",
"protected function getReport()\n {\n return $this->report;\n }",
"public function actionPrintReport() {\n if(isset($_GET['id'])) {\n $report = Reports::model()->findByPk ($_GET['id']);\n } else {\n $type = $_GET['type'];\n $formModelName = ucfirst($type).'ReportFormModel';\n\n // Create Form Model to set default attributes\n $formModel = new $formModelName;\n $formModel->setAttributes ($_GET[$formModelName]);\n $formModel->validate ();\n\n // Create a report object to leverage the usage\n // of report->getInstance()\n $report = new Reports;\n $report->type = $type;\n $report->settings = CJSON::encode($formModel->attributes);\n }\n\n $this->render('printChart', array(\n 'report' => $report,\n ));\n }",
"public function getReport()\n {\n return $this->report;\n }",
"public abstract function getReportEngine();",
"public function getReportType()\n {\n return $this->reportType;\n }",
"public function prepareFromPost(): Report\n {\n $request = Craft::$app->getRequest();\n\n $reportId = $request->getBodyParam('id');\n\n if ($reportId && is_numeric($reportId)) {\n $report = SproutBaseReports::$app->reports->getReport($reportId);\n\n if (!$report) {\n $report->addError('id', Craft::t('sprout-base-reports', 'Could not find a report with id {reportId}', [\n 'reportId' => $reportId\n ]));\n }\n } else {\n $report = new Report();\n }\n\n $settings = $request->getBodyParam('settings');\n\n $report->name = $request->getBodyParam('name');\n $report->hasNameFormat = $request->getBodyParam('hasNameFormat');\n $report->nameFormat = $request->getBodyParam('nameFormat');\n $report->handle = $request->getBodyParam('handle');\n $report->description = $request->getBodyParam('description');\n $report->settings = is_array($settings) ? $settings : [];\n $report->dataSourceId = $request->getBodyParam('dataSourceId');\n $report->enabled = $request->getBodyParam('enabled', false);\n $report->groupId = $request->getBodyParam('groupId');\n\n $dataSource = $report->getDataSource();\n\n if (!$dataSource) {\n throw new NotFoundHttpException(Craft::t('sprout-base-reports', 'Date Source not found.'));\n }\n\n $report->allowHtml = $request->getBodyParam('allowHtml', $dataSource->getDefaultAllowHtml());\n\n return $report;\n }",
"public function getReport();",
"public static function init() {\n static $instance = false;\n\n if ( ! $instance ) {\n $instance = new WPUF_Report();\n }\n\n return $instance;\n }",
"protected function getOroReport_Form_Handler_ReportService()\n {\n if (!isset($this->scopedServices['request'])) {\n throw new InactiveScopeException('oro_report.form.handler.report', 'request');\n }\n\n return $this->services['oro_report.form.handler.report'] = $this->scopedServices['request']['oro_report.form.handler.report'] = new \\Oro\\Bundle\\ReportBundle\\Form\\Handler\\ReportHandler($this->get('oro_report.form.report'), $this->get('request'), $this->get('doctrine.orm.default_entity_manager'));\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Equivalent to PHP `glob` function. | public function glob($pattern); | [
"function rglob($pattern, $flags = 0)\r\n{\r\n $files = glob($pattern, $flags);\r\n foreach (glob(dirname($pattern) . '/*', GLOB_ONLYDIR | GLOB_NOSORT) as $directory) {\r\n $files = array_merge($files, rglob($directory . '/' . basename($pattern), $flags));\r\n }\r\n return $files;\r\n}",
"function rglob($pattern, $flags = 0) {\n $files = glob($pattern, $flags); \n foreach (glob(dirname($pattern).'/*', GLOB_ONLYDIR|GLOB_NOSORT) as $dir) {\n $files = array_merge($files, rglob($dir.'/'.basename($pattern), $flags));\n }\n return $files;\n}",
"function _glob($dir, $pattern) {\n global $_glob;\n if (empty($dir)) {\n return array();\n }\n if (empty($_glob)) {\n $_glob = array();\n }\n $name = md5($dir . $pattern);\n if (isset($_glob[$name])) {\n return $_glob[$name];\n }\n $dir = rtrim($dir, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR;\n $array = array();\n if (is_dir($dir) && $handle = opendir($dir)) {\n $count = 0;\n while (false !== ($file_name = readdir($handle))) {\n if ($file_name == '.' || $file_name == '..') {\n continue;\n }\n //_error_log(\"_glob: {$dir}{$file_name} [$pattern]\");\n //var_dump($pattern, $file_name, preg_match($pattern, $file_name));\n if (preg_match($pattern, $file_name)) {\n $array[] = \"{$dir}{$file_name}\";\n }\n }\n closedir($handle);\n }\n $_glob[$name] = $array;\n return $array;\n}",
"public function glob(string $pattern): array;",
"function zglob($pattern) {\n\t$results = array();\n\tif(preg_match('/(.*)\\{(.*)\\}(.*)/', $pattern, $matches)) {\n\t\t$braced = explode(\",\", $matches[2]);\n\t\tforeach($braced as $b) {\n\t\t\t$sub_pattern = $matches[1].$b.$matches[3];\n\t\t\t$results = array_merge($results, zglob($sub_pattern));\n\t\t}\n\t\treturn $results;\n\t}\n\telse {\n\t\t$r = glob($pattern);\n\t\tif($r) return $r;\n\t\telse return array();\n\t}\n}",
"function file_list($path,$pattern)\n{\n\t$d = dir($path);\n\twhile (false !== ($entry = $d->read()))\n\t{\n\t\tif (eregi($pattern,$entry))\n\t\t{\n\t\t\t$files_array[] = $entry;\n\t\t}\n\t}\n\treturn $files_array;\n}",
"public function testGlobFindsFiles()\n {\n file_put_contents(self::$temp.DS.'foo.txt', 'foo');\n file_put_contents(self::$temp.DS.'bar.txt', 'bar');\n\n $glob = File::glob(self::$temp.DS.'*.txt');\n\n $this->assertTrue(in_array(self::$temp.DS.'foo.txt', $glob));\n $this->assertTrue(in_array(self::$temp.DS.'bar.txt', $glob));\n }",
"function expand_globs( $paths, $flags = 'default' ) {\n }",
"function glob($pattern, $flags = null)\n{\n return GlobTester::$callback !== null\n ? call_user_func(GlobTester::$callback, $pattern, $flags)\n : \\glob($pattern, $flags);\n}",
"function recursiveGlob($pattern, $flags = 0)\n{\n $files = glob($pattern, $flags);\n foreach (glob(dirname($pattern).'/*', GLOB_ONLYDIR | GLOB_NOSORT) as $dir) {\n $files = array_merge($files, recursiveGlob($dir . '/' . basename($pattern), $flags));\n }\n return $files;\n}",
"function rglob($pattern, $getfiles=1,$getdirs=0,$flags=0) {\n\t$dirname = dirname($pattern);\n\t$basename = basename($pattern);\n\t$glob = glob($pattern, $flags);\n\t$files = array();\n\t$dirlist = array();\n\tforeach ($glob as $path) {\n//var_dump($path,$files,$dirs);\n\t\tif (is_file($path) && (!$getfiles)) {\n\t\t\tcontinue;\n\t\t}\n\t\tif (is_dir($path)) {\n\t\t\t$dirlist[] = $path;\n\t\t\tif (!$getdirs) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\t\t$files[] = $path;\n\t}\n//var_dump($files);\n\tforeach (glob(\"{$dirname}/*\", GLOB_ONLYDIR|GLOB_NOSORT) as $dir) {\n\t\t$dirfiles = rglob($dir.'/'.$basename, $getfiles,$getdirs,$flags);\n\t\t$files = array_merge($files, $dirfiles);\n\t}\n\treturn $files;\n}",
"public static function recGlob($pattern, $path)\n\t{\n\t\t$command = sprintf(\"%s %s -name %s\", 'find', escapeshellarg($path), escapeshellarg($pattern));\n\t\treturn array_filter(explode(\"\\n\", shell_exec($command)));\n\t}",
"public static function safe_glob($pattern, $flags=0) {\n\t\t$split = explode('/', str_replace('\\\\', '/', $pattern));\n\t\t$mask = array_pop($split);\n\t\t$path = implode('/', $split);\t\t\t\n\n\t\tif (($dir = @opendir($path . '/')) !== false or ($dir = @opendir($path)) !== false) {\n\t\t\t$glob = array();\n\t\t\twhile(($file = readdir($dir)) !== false) {\n\t\t\t\t// Recurse subdirectories (self::GLOB_RECURSE)\n\t\t\t\tif (($flags & self::GLOB_RECURSE) && is_dir($path . '/' . $file) && ( ! in_array($file, array('.', '..')))) {\n\t\t\t\t\t$glob = array_merge($glob, self::array_prepend(self::safe_glob($path . '/' . $file . '/' . $mask, $flags), ($flags & self::GLOB_PATH ? '' : $file . '/')));\n\t\t\t\t}\n\t\t\t\t// Match file mask\t\t\t\t\n\t\t\t\tif (self::fnmatch($mask, $file, self::FNM_CASEFOLD)) {\t\t\t\t\t\n\t\t\t\t\tif ((( ! ($flags & self::GLOB_ONLYDIR)) || is_dir(\"$path/$file\"))\n\t\t\t\t\t\t&& (( ! ($flags & self::GLOB_NODIR)) || ( ! is_dir($path . '/' . $file)))\n\t\t\t\t\t\t&& (( ! ($flags & self::GLOB_NODOTS)) || ( ! in_array($file, array('.', '..'))))\n\t\t\t\t\t) {\n\t\t\t\t\t\t$glob[] = ($flags & self::GLOB_PATH ? $path . '/' : '') . $file . ($flags & self::GLOB_MARK ? '/' : '');\n\t\t\t\t\t}\n\t\t\t\t}\t\t\t\t\n\t\t\t}\n\t\t\tclosedir($dir);\n\t\t\tif ( ! ($flags & self::GLOB_NOSORT)) sort($glob);\t\t\t\n\t\t\treturn $glob;\n\t\t} else {\n\t\t\treturn (strpos($pattern, \"*\") === false) ? array($pattern) : false;\n\t\t}\n\t}",
"function fsFind($in_from_path, $in_opt_mask=FALSE)\n{\n\t$result = array();\n\t$in_from_path = realpath($in_from_path);\n\t$root = scandir($in_from_path); \n\t\n foreach($root as $basename) \n { \n if ($basename === '.' || $basename === '..') { continue; }\n \t\t$path = $in_from_path . DIRECTORY_SEPARATOR . $basename;\n\t\t\n if (is_file($path))\n\t\t{\n\t\t\tif (FALSE !== $in_opt_mask)\n\t\t\t{ if (0 === preg_match($in_opt_mask, $basename)) { continue; } }\n\t\t\t$result[] = $path;\n\t\t\tcontinue;\n\t\t}\n\t\t\n foreach(fsFind($path, $in_opt_mask) as $basename) \n { $result[] = $basename; } \n } \n return $result;\n}",
"function globbetyglob($globber, $userfunc)\n{\n foreach (glob(\"$globber/*\") as $file) {\n if (is_dir($file)) {\n globbetyglob($file, $userfunc);\n }\n else {\n call_user_func($userfunc, $file);\n }\n }\n}",
"function load_glob($directory = './*') {\n foreach (glob($directory) as $filename) {\n require_once($filename);\n }\n}",
"protected function getFiles($path)\n {\n return glob($path);\n }",
"function glob_include( $path ) {\n\t$data = array_filter( glob( $path ) );\n\tif ( ! empty( $data ) ) {\n\t\tforeach ( $data as $p ) {\n\t\t\tinclude $p;\n\t\t}\n\t}\n}",
"static public function searchFile($root, $pattern = '*', $flags = 0)\n {\n $dirs = self::listDirs($root);\n array_unshift($dirs, $root);\n \n $foundFiles = [];\n \n foreach ($dirs as $dir) {\n $filePatt = $dir . '/' . $pattern;\n $files = glob($filePatt, $flags);\n \n if ($files) {\n $foundFiles = array_merge($foundFiles, $files);\n }\n }\n \n return $foundFiles;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Test case for createSignupPage Create signup page. | public function testCreateSignupPage()
{
} | [
"public function testSignup()\n {\n $this->visit('/')\n ->click('Register as Job Seejer')\n ->seePageIs('/register')\n ->see('Register');\n }",
"public function testGetSignupPage()\n {\n }",
"public function testSuccessfulSignup() {\n $testUser=uniqid('SignupTest_');\n $this->visit('/auth/register')\n ->type($testUser, 'name')\n ->type($testUser . '@gmail.com', 'email')\n ->type('somePassword', 'password')\n ->type('somePassword', 'password_confirmation')\n ->type('Dummy security question answer', 'recovery')\n ->press('Sign Up')\n ->see('Hello, ' . $testUser);\n }",
"public function signup()\r\n\t{\r\n\t\t$this->setView('new');\r\n\t\t$this->view->set('title', 'Create an account'); \r\n\t\treturn $this->view->output();\r\n\t}",
"public function signup() {\n $this->template->content = View::instance('v_users_signup');\n\n echo $this->template;\n }",
"public function testUserSignupSuccess()\n {\n $this->clearDB();\n\n $response = $this->post('/api/v1/auth/signup', $this->staticUserDetails);\n\n $response->assertStatus(201);\n\n $response = $response->json();\n\n $this->assertEquals($response['user']['email'], $this->staticUserDetails['email']);\n }",
"public static function signup() {\n self::render_view('user/signup.html');\n }",
"public function testDeleteSignupPage()\n {\n }",
"public function testCreateAccountButton() {\n\n $this->visit('/login')\n ->click(trans('login.register_button'))\n ->seePageIs('/register');\n\n }",
"public function SignUp()\n\t{\n\t\t\n\t}",
"private function _signUpPageRequested()\n {\n $this->utility->redirect('signup');\n }",
"function signUp(){\n\t\tif(isset($_POST['create'])){\n $signup = array(\n 'username' => $_POST['username'],\n 'email' => $_POST['email'],\n 'password' => $_POST['password'],\n 'firstname' => $_POST['firstname'],\n 'lastname' => $_POST['lastname']\n );\n // $register = $this->model->registerUser($signup);\n if($this->model->registerUser($signup) === true){\n $this->redirect(\"views/home.php\");\n }\n else{\n $this->redirect(\"views/createreject.php\");\n }\n\t\t}\n\t}",
"public function sign_up(){\n\t\t \n\t\t//Llamada a la vista\n\t\t$this->view('usuarios/sign_up', []);\n\t}",
"public function testAdminUserCreatePage() : void\n {\n $response = $this->actingAs(static::$user, 'web')\n ->get('/admin/users/create');\n\n $response->assertStatus(200)\n ->assertSee('Εισαγωγή χρήστη');\n }",
"public function testRegistrationSuccess(){\n $this->visit('register')\n ->type('Bilbo', 'name')\n ->type('bilbo@baggins.com', 'email')\n ->type('bilbo123', 'password')\n ->type('bilbo123', 'password_confirmation')\n ->press('Register')\n ->seePageIs('http://localhost/wizard/title')\n ->seeInDatabase('users', [\n 'email' => 'bilbo@baggins.com'\n ]);\n }",
"public function registerPageExists(AcceptanceTester $I){\n $I->amOnPage('/register');\n }",
"public function testRegisterForm()\n {\n $user_created = false;\n\n $name = 'Mr Bean';\n $username = 'MrBean';\n $email_register = 'mr.bean@gmail.com';\n $password_register = 'ABC123doremi29!';\n $password_register_confirmation = $password_register;\n\n $this->browse(function ($browser) use ($name, $username, $email_register, $password_register, $password_register_confirmation) {\n $browser->visit('/login')\n ->type('name', $name)\n ->type('username', $username)\n ->type('emailRegister', $email_register)\n ->type('passwordRegister', $password_register)\n ->type('passwordRegister_confirmation', $password_register_confirmation)\n ->press('Sign me up!')\n ->assertPathIs('/');\n });\n\n $user_found = User::where('username', $username)\n ->where('email', $email_register)\n ->first();\n\n if(isset($user_found)){\n $user_created = true;\n }\n\n $this->assertTrue($user_created);\n\n if($user_created) {\n $this->logout();\n $this->removeUser($user_found->id);\n }\n }",
"public function testRegisterAccountView() {\n $this->visit('/auth/register')\n ->see('form-register');\n }",
"public function clickOnSignUp()\n {\n $I = $this;\n $I->amonPage(LoginPage::$URL);\n $I->click(LoginPage::$signUp);\n $I->comment(\"Click Succes!\");\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the value of titularTarje | public function getTitularTarje()
{
return $this->titularTarje;
} | [
"public function getTarjTitular()\n {\n return $this->tarj_titular;\n }",
"public function getTarjtitular()\n {\n return $this->tarjtitular;\n }",
"public function getTitile()\n {\n return $this->titile;\n }",
"public function getTitulo()\n\t{\n\t\treturn $this->titulo;\n\t}",
"public function getTitresujet()\r\n {\r\n return $this->titresujet;\r\n }",
"public function getTitulo()\n\t{\n\n\t\treturn $this->titulo;\n\t}",
"public function getTitulo() {\n return $this->titulo;\n }",
"public function getTitulo()\n {\n return $this->Titulo;\n }",
"public function getTitulo()\n {\n return $this->titulo;\n }",
"function agenda_item_titel(){\n\t\t$return = '';\n\t\tif($this->agenda_item !== false){\n\t\t\t$return = $this->agenda_item['titel'];\n\t\t} else {\n\t\t\t$return = 'Agendaitem niet gevonden';\n\t\t}\n\t\treturn $return;\n\t}",
"public function get_titulo()\n {\n return $this->_titulo;\n }",
"public function getTitre()\r\n {\r\n return $this->titre;\r\n }",
"public function getTitre()\n {\n return $this->titre;\n }",
"public function getTitre()\n\t{\n\t\treturn $this->_titre;\n\t}",
"public function getTitre()\n {\n return $this->_titre;\n }",
"function getTitulo() {\n // mistura os arrays somente do bloco 1\n shuffle($this->bloco[1]);\n return ucfirst($this->bloco[1][0]); // deixa a primeira letra da string maiúscula\n }",
"private function getPerTitol(){\n $result = $this->llibreGateway->buscarPerTitol();\n \n return $this->crearResposta('200 OK', $result);\n }",
"public function getApellido_titular()\n {\n return $this->apellido_titular;\n }",
"public function titulo () \r\n\t\t{\r\n\t\t\techo $this->get_detail(name);\r\n\t\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Operation getBusinessTransactionTagsAsync Get the tags for a businessTransaction. | public function getBusinessTransactionTagsAsync($business_transaction_id)
{
return $this->getBusinessTransactionTagsAsyncWithHttpInfo($business_transaction_id)
->then(
function ($response) {
return $response[0];
}
);
} | [
"public function organizationTagsGetAsync()\n {\n return $this->organizationTagsGetAsyncWithHttpInfo()\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function getBusinessTransactionTags($business_transaction_id)\n {\n $this->getBusinessTransactionTagsWithHttpInfo($business_transaction_id);\n }",
"public function getBusinessTransactionTagsAsyncWithHttpInfo($business_transaction_id)\n {\n $returnType = '';\n $request = $this->getBusinessTransactionTagsRequest($business_transaction_id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n return [null, $response->getStatusCode(), $response->getHeaders()];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function businessTagsGet($business_id, string $contentType = self::contentTypes['businessTagsGet'][0])\n {\n list($response) = $this->businessTagsGetWithHttpInfo($business_id, $contentType);\n return $response;\n }",
"public function businessTagsGetAsyncWithHttpInfo($business_id, string $contentType = self::contentTypes['businessTagsGet'][0])\n {\n $returnType = '\\OpenAPI\\Client\\Model\\TagViewModel[]';\n $request = $this->businessTagsGetRequest($business_id, $contentType);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n if ($returnType === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n (string) $response->getBody()\n );\n }\n );\n }",
"public function listTags()\n {\n return $this->curl->get('accounts/listtags');\n }",
"public function getTags()\n {\n try {\n\n $apiPath = 'tags?api_key=' . $this->api_key;\n $response = $this->apiCall($apiPath);\n\n return $this->response($response);\n\n } catch (Exception $e) {\n throw new \\Exception($e->getMessage());\n }\n }",
"public function getTags()\n {\n $tags = $this->tagApi->getBy([\n \"nodes\" => $this->nodeSource->getNode(),\n \"translation\" => $this->nodeSource->getTranslation(),\n ]);\n\n return $tags;\n }",
"public function tagsForAgentMailbox()\n {\n return $this->tagRepository->getStatusAndCategoryTags();\n }",
"public function getAccountTagsAsync($accountId, $includedDeleted = 'false', $audit = 'NONE')\n {\n return $this->getAccountTagsAsyncWithHttpInfo($accountId, $includedDeleted, $audit)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function getTags()\n {\n return $this->tagApi->getBy([\n \"nodes\" => $this->nodeSource->getNode(),\n \"translation\" => $this->nodeSource->getTranslation(),\n ]);\n }",
"public function list_tags()\n {\n return $this->fetch_results('/api/s/' . $this->site . '/rest/tag');\n }",
"public function getTags() {\n if($this->id !== null) {\n $tagQuery = new BaseQuery('tg');\n $tagQuery->select()\n ->join('document_tag', 'dt', ['tg.id = dt.tag_id'])\n ->join('document', 'doc', ['dt.document_id = doc.id'])\n ->andWhere(['doc.id' => $this->id]);\n\n $objTags = new Tag();\n $tagList = $objTags->queryAllFromObject($tagQuery);\n\n if($tagList !== null)\n return $tagList;\n }\n return [];\n }",
"public function getAsnTagsAsync($asn_id)\n {\n return $this->getAsnTagsAsyncWithHttpInfo($asn_id)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function getAllTags()\n {\n return $this->cache->get(\n self::ALL_TAGS_CACHE_KEY,\n array($this,'getAllTagsFromDatabase')\n );\n }",
"protected function ble_tags() {\n if($this->method == 'GET') {\n return $this->database->select_ble_tags($this->company['ID']);\n }\n else {\n throw new Exception(\"Method $this->method is unsupported\");\n }\n }",
"public function getInvoiceWorksheetTagsAsync($invoice_worksheet_id)\n {\n return $this->getInvoiceWorksheetTagsAsyncWithHttpInfo($invoice_worksheet_id)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function getBillOfLadingTagsAsync($bill_of_lading_id)\n {\n return $this->getBillOfLadingTagsAsyncWithHttpInfo($bill_of_lading_id)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function getAllTags(){\n return $this->JACKED->MySQL->getRows($this->config->dbt_tags, 1);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ Gets the private 'doctrine.schema_validate_command' shared service. | protected function getDoctrine_SchemaValidateCommandService()
{
$this->privates['doctrine.schema_validate_command'] = $instance = new \Doctrine\Bundle\DoctrineBundle\Command\Proxy\ValidateSchemaCommand();
$instance->setName('doctrine:schema:validate');
return $instance;
} | [
"protected function getDoctrine_SchemaValidateCommandService()\n {\n include_once \\dirname(__DIR__, 4).'/vendor/symfony/console/Command/Command.php';\n include_once \\dirname(__DIR__, 4).'/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Console/Command/ValidateSchemaCommand.php';\n include_once \\dirname(__DIR__, 4).'/vendor/doctrine/doctrine-bundle/Command/Proxy/ValidateSchemaCommand.php';\n\n $this->privates['doctrine.schema_validate_command'] = $instance = new \\Doctrine\\Bundle\\DoctrineBundle\\Command\\Proxy\\ValidateSchemaCommand();\n\n $instance->setName('doctrine:schema:validate');\n\n return $instance;\n }",
"protected function getDoctrine_SchemaValidateCommandService()\n {\n return $this->services['doctrine.schema_validate_command'] = new \\Doctrine\\Bundle\\DoctrineBundle\\Command\\Proxy\\ValidateSchemaCommand();\n }",
"public function getValidatorForCommand($commandName);",
"protected function getDoctrine_SchemaUpdateCommandService()\n {\n include_once \\dirname(__DIR__, 4).'\\\\vendor\\\\symfony\\\\console\\\\Command\\\\Command.php';\n include_once \\dirname(__DIR__, 4).'\\\\vendor\\\\doctrine\\\\orm\\\\lib\\\\Doctrine\\\\ORM\\\\Tools\\\\Console\\\\Command\\\\SchemaTool\\\\AbstractCommand.php';\n include_once \\dirname(__DIR__, 4).'\\\\vendor\\\\doctrine\\\\orm\\\\lib\\\\Doctrine\\\\ORM\\\\Tools\\\\Console\\\\Command\\\\SchemaTool\\\\UpdateCommand.php';\n include_once \\dirname(__DIR__, 4).'\\\\vendor\\\\doctrine\\\\doctrine-bundle\\\\Command\\\\Proxy\\\\UpdateSchemaDoctrineCommand.php';\n\n $this->privates['doctrine.schema_update_command'] = $instance = new \\Doctrine\\Bundle\\DoctrineBundle\\Command\\Proxy\\UpdateSchemaDoctrineCommand();\n\n $instance->setName('doctrine:schema:update');\n\n return $instance;\n }",
"protected function getDoctrine_SchemaUpdateCommandService()\n {\n return $this->services['doctrine.schema_update_command'] = new \\Doctrine\\Bundle\\DoctrineBundle\\Command\\Proxy\\UpdateSchemaDoctrineCommand();\n }",
"protected function getDoctrine_SchemaUpdateCommandService()\n {\n include_once \\dirname(__DIR__, 4).'/vendor/symfony/console/Command/Command.php';\n include_once \\dirname(__DIR__, 4).'/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Console/Command/SchemaTool/AbstractCommand.php';\n include_once \\dirname(__DIR__, 4).'/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Console/Command/SchemaTool/UpdateCommand.php';\n include_once \\dirname(__DIR__, 4).'/vendor/doctrine/doctrine-bundle/Command/Proxy/UpdateSchemaDoctrineCommand.php';\n\n $this->privates['doctrine.schema_update_command'] = $instance = new \\Doctrine\\Bundle\\DoctrineBundle\\Command\\Proxy\\UpdateSchemaDoctrineCommand();\n\n $instance->setName('doctrine:schema:update');\n\n return $instance;\n }",
"protected function getDoctrine_SchemaDropCommandService()\n {\n include_once \\dirname(__DIR__, 4).'/vendor/symfony/console/Command/Command.php';\n include_once \\dirname(__DIR__, 4).'/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Console/Command/SchemaTool/AbstractCommand.php';\n include_once \\dirname(__DIR__, 4).'/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Console/Command/SchemaTool/DropCommand.php';\n include_once \\dirname(__DIR__, 4).'/vendor/doctrine/doctrine-bundle/Command/Proxy/DropSchemaDoctrineCommand.php';\n\n $this->privates['doctrine.schema_drop_command'] = $instance = new \\Doctrine\\Bundle\\DoctrineBundle\\Command\\Proxy\\DropSchemaDoctrineCommand();\n\n $instance->setName('doctrine:schema:drop');\n\n return $instance;\n }",
"protected function getDoctrine_SchemaCreateCommandService()\n {\n return $this->services['doctrine.schema_create_command'] = new \\Doctrine\\Bundle\\DoctrineBundle\\Command\\Proxy\\CreateSchemaDoctrineCommand();\n }",
"protected function getDoctrine_SchemaDropCommandService()\n {\n return $this->services['doctrine.schema_drop_command'] = new \\Doctrine\\Bundle\\DoctrineBundle\\Command\\Proxy\\DropSchemaDoctrineCommand();\n }",
"protected function getDoctrine_SchemaUpdateCommandService()\n {\n $this->privates['doctrine.schema_update_command'] = $instance = new \\Doctrine\\Bundle\\DoctrineBundle\\Command\\Proxy\\UpdateSchemaDoctrineCommand();\n\n $instance->setName('doctrine:schema:update');\n\n return $instance;\n }",
"public static function validateCommand()\n\t{\n\t\treturn array(\n\t\t\tnew Main\\Entity\\Validator\\Length(null, 255),\n\t\t);\n\t}",
"protected function getDoctrine_SchemaDropCommandService()\n {\n $this->privates['doctrine.schema_drop_command'] = $instance = new \\Doctrine\\Bundle\\DoctrineBundle\\Command\\Proxy\\DropSchemaDoctrineCommand();\n\n $instance->setName('doctrine:schema:drop');\n\n return $instance;\n }",
"protected abstract function getValidatorCommand(string $inputFile): string;",
"protected function getCheckIntegrityCommandService()\n {\n $this->services['TYPO3\\\\CMS\\\\Redirects\\\\Command\\\\CheckIntegrityCommand'] = $instance = \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::makeInstanceForDi(\\TYPO3\\CMS\\Redirects\\Command\\CheckIntegrityCommand::class);\n\n $instance->setName('redirects:checkintegrity');\n\n return $instance;\n }",
"protected function getDoctrineMigrations_DumpSchemaCommandService()\n {\n include_once \\dirname(__DIR__, 4).'\\\\vendor\\\\symfony\\\\console\\\\Command\\\\Command.php';\n include_once \\dirname(__DIR__, 4).'\\\\vendor\\\\doctrine\\\\migrations\\\\lib\\\\Doctrine\\\\Migrations\\\\Tools\\\\Console\\\\Command\\\\AbstractCommand.php';\n include_once \\dirname(__DIR__, 4).'\\\\vendor\\\\doctrine\\\\migrations\\\\lib\\\\Doctrine\\\\Migrations\\\\Tools\\\\Console\\\\Command\\\\DumpSchemaCommand.php';\n include_once \\dirname(__DIR__, 4).'\\\\vendor\\\\doctrine\\\\doctrine-migrations-bundle\\\\Command\\\\MigrationsDumpSchemaDoctrineCommand.php';\n\n $this->privates['doctrine_migrations.dump_schema_command'] = $instance = new \\Doctrine\\Bundle\\MigrationsBundle\\Command\\MigrationsDumpSchemaDoctrineCommand();\n\n $instance->setName('doctrine:migrations:dump-schema');\n\n return $instance;\n }",
"protected function getDoctrineMigrations_DiffCommandService()\n {\n return $this->services['doctrine_migrations.diff_command'] = new \\Doctrine\\Bundle\\MigrationsBundle\\Command\\MigrationsDiffDoctrineCommand();\n }",
"protected function getDoctrineMigrations_DumpSchemaCommandService()\n {\n include_once \\dirname(__DIR__, 4).'/vendor/symfony/console/Command/Command.php';\n include_once \\dirname(__DIR__, 4).'/vendor/doctrine/migrations/lib/Doctrine/Migrations/Tools/Console/Command/DoctrineCommand.php';\n include_once \\dirname(__DIR__, 4).'/vendor/doctrine/migrations/lib/Doctrine/Migrations/Tools/Console/Command/DumpSchemaCommand.php';\n\n $this->privates['doctrine_migrations.dump_schema_command'] = $instance = new \\Doctrine\\Migrations\\Tools\\Console\\Command\\DumpSchemaCommand(($this->privates['doctrine.migrations.dependency_factory'] ?? $this->getDoctrine_Migrations_DependencyFactoryService()), 'doctrine:migrations:dump-schema');\n\n $instance->setName('doctrine:migrations:dump-schema');\n\n return $instance;\n }",
"protected function getConsole_Command_YamlLintService()\n {\n $this->privates['console.command.yaml_lint'] = $instance = new \\Symfony\\Bundle\\FrameworkBundle\\Command\\YamlLintCommand();\n\n $instance->setName('lint:yaml');\n\n return $instance;\n }",
"protected function getDoctrineMigrations_DiffCommandService()\n {\n include_once \\dirname(__DIR__, 4).'/vendor/symfony/console/Command/Command.php';\n include_once \\dirname(__DIR__, 4).'/vendor/doctrine/migrations/lib/Doctrine/Migrations/Tools/Console/Command/DoctrineCommand.php';\n include_once \\dirname(__DIR__, 4).'/vendor/doctrine/migrations/lib/Doctrine/Migrations/Tools/Console/Command/DiffCommand.php';\n\n $this->privates['doctrine_migrations.diff_command'] = $instance = new \\Doctrine\\Migrations\\Tools\\Console\\Command\\DiffCommand(($this->privates['doctrine.migrations.dependency_factory'] ?? $this->getDoctrine_Migrations_DependencyFactoryService()), 'doctrine:migrations:diff');\n\n $instance->setName('doctrine:migrations:diff');\n\n return $instance;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
this testcase handles compressing the zero address | public function testCompressZero() {
$testip = "0:0:0:0:0:0:0:0";
$is = $this->ip->compress($testip);
$this->assertEquals( "::", $is);
} | [
"public function testUncompress2WithLeadingZeros() {\n $testip = \"::1\";\n $is = $this->ip->uncompress($testip, true);\n $this->assertEquals( \"0000:0000:0000:0000:0000:0000:0000:0001\", $is);\n }",
"public function testUncompressWithPrefixLengthWithLeadingZeros() {\n $testip = \"::ffff:5056:5000/116\";\n $is = $this->ip->uncompress($testip, true);\n\n $this->assertEquals( \"0000:0000:0000:0000:0000:ffff:5056:5000/116\", $is);\n }",
"public function testUncompress1WithLeadingZeros() {\n $testip = \"ff01::101\";\n $is = $this->ip->uncompress($testip, true);\n $this->assertEquals( \"ff01:0000:0000:0000:0000:0000:0000:0101\", $is);\n }",
"public function testBug14747_CompressShouldDoNothingOnCompressedIPs() {\n\n $testip = '2001:503:ba3e::2:30';\n $is = $this->ip->compress($testip);\n\n $this->assertEquals(\"2001:503:ba3e::2:30\", $is);\n\n $testip = 'ff01::101';\n $is = $this->ip->compress($testip);\n\n $this->assertEquals(\"ff01::101\", $is);\n }",
"public function testCompressWithPrefixLength() {\n $testip = \"0000:0000:0000:0000:0000:ffff:5056:5000/116\";\n $is = $this->ip->compress($testip);\n $this->assertEquals( \"::ffff:5056:5000/116\", $is);\n }",
"public function testCompressVariation()\n {\n $output = horde_lz4_compress($this->data);\n\n $this->assertNotEquals(\n md5($output),\n md5(horde_lz4_compress($output))\n );\n }",
"public function testCompressBasic()\n {\n // Compressing a big string\n $output = horde_lz4_compress($this->data);\n $this->assertEquals(\n 0,\n strcmp(horde_lz4_uncompress($output), $this->data)\n );\n\n // Compressing a smaller string\n $smallstring = \"A small string to compress\\n\";\n $output = horde_lz4_compress($smallstring);\n $this->assertEquals(\n 0,\n strcmp(horde_lz4_uncompress($output), $smallstring)\n );\n }",
"public function _compress($value) {}",
"public function testIp2BinCompressed() {\n $testip = \"ffff::FFFF:129:144:52:38\";\n $_ip2Bin = self::getMethod(\"_ip2Bin\");\n $is = $_ip2Bin->invoke(null, $testip);\n $this->assertEquals( \"1111111111111111\".\n \"0000000000000000\".\n \"0000000000000000\".\n \"1111111111111111\".\n \"0000000100101001\".\n \"0000000101000100\".\n \"0000000001010010\".\n \"0000000000111000\"\n ,$is);\n }",
"function compress($ip) {\n\t\t\tif (!IPv6::validate_ip($ip))\n\t\t\t\treturn false;\n\n\t\t\t// Uncompress the address, so we are sure the address isn't already compressed\n\t\t\t$ip = IPv6::uncompress($ip);\n\n\t\t\t// Remove all leading 0's; 0034 -> 34; 0000 -> 0\n\t\t\t$ip = preg_replace(\"/(^|:)0+(?=[a-fA-F\\d]+(?::|$))/\", \"$1\", $ip);\n\n\t\t\t// Find all :0:0: sequences\n\t\t\tpreg_match_all(\"/((?:^|:)0(?::0)+(?::|$))/\", $ip, $matches);\n\n\t\t\t// Search all :0:0: sequences and determine the longest\n\t\t\t$reg = \"\";\n\t\t\tforeach ($matches[0] as $match)\n\t\t\t\tif (strlen($match) > strlen($reg))\n\t\t\t\t\t$reg = $match;\n\n\t\t\t// Replace the longst :0 sequence with ::, but do it only once\n\t\t\tif (strlen($reg))\n\t\t\t\t$ip = preg_replace(\"/$reg/\", \"::\", $ip, 1);\n\n\t\t\treturn $ip;\n\t\t}",
"public function testBug3405() {\n $testip = \"2010:0588:0000:faef:1428:0000:0000:57ab\";\n $is = $this->ip->compress($testip);\n $this->assertEquals( \"2010:588:0:faef:1428::57ab\", $is);\n }",
"public function testCompress()\n\t{\n\t\t$this->assertEquals(bzcompress(\"a test string\"), $this->Compress_Bzip->process(\"a test string\"));\n\t}",
"public function testCompress()\n\t{\n\t\t$this->assertEquals(gzcompress(\"a test string\"), $this->Compress_Gzip->process(\"a test string\"));\n\t}",
"public function testBug13006_1() {\n $testip = \"2001:690:22c0:201::193.136.195.195\";\n $expected = \"2001:690:22c0:201::193.136.195.195\";\n $is = $this->ip->compress($testip);\n \n $this->assertEquals($expected, $is);\n }",
"public function testIp2BinUncompressed() {\n $testip = \"ffff:0:0:FFFF:129:144:52:38\";\n $_ip2Bin = self::getMethod(\"_ip2Bin\");\n $is = $_ip2Bin->invoke(null, $testip);\n $this->assertEquals( \"1111111111111111\".\n \"0000000000000000\".\n \"0000000000000000\".\n \"1111111111111111\".\n \"0000000100101001\".\n \"0000000101000100\".\n \"0000000001010010\".\n \"0000000000111000\"\n ,$is);\n }",
"public function testEmptyString()\n {\n $filter = new SnappyCompression();\n\n $content = $filter->compress(false);\n $content = $filter->decompress($content);\n $this->assertEquals('', $content, 'Snappy failed to decompress empty string.');\n }",
"public function testUncompress1() {\n $testip = \"ff01::101\";\n $is = $this->ip->uncompress($testip);\n $this->assertEquals( \"ff01:0:0:0:0:0:0:101\", $is);\n }",
"public function testIp2BinUncompressed()\n {\n $testip = \"ffff:0:0:FFFF:129:144:52:38\";\n $is = $this->ip->_ip2Bin($testip);\n $this->assertEquals(\n \"1111111111111111\".\n \"0000000000000000\".\n \"0000000000000000\".\n \"1111111111111111\".\n \"0000000100101001\".\n \"0000000101000100\".\n \"0000000001010010\".\n \"0000000000111000\",\n $is\n );\n }",
"function gzuncompress($data,$length)\n{\n\treturn '';\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Adds a hyperlink style to styles.xml | public function addLinkStyle($styleName, $styles)
{
PHPWord_Style::addLinkStyle($styleName, $styles);
} | [
"public function linkStyle($href) {\n\t\t\t$style = $this->createElement('link', '');\n\t\t\t$style->setAttribute('href', $href);\n\t\t\t$style->setAttribute('rel', 'stylesheet');\n\t\t\t$style->setAttribute('type', 'text/css');\n\t\t\t$this->getElementsByTagName('head')->Item(0)->appendChild($style);\n\t\t}",
"function addstyletolinks($text, $style)\n{\n return preg_replace_callback(\n '|<a href=\"(.*)\">(.*)</a>|',\n function($matches) use ($style) {\n return '<a href=\"' . $matches[1] . '\" ' . $style . '>' . $matches[2] . '</a>';\n },\n $text\n );\n}",
"public function addStyle($style){\n $this->styles[] = $style;\n }",
"function glossary_addlink_link() {\n\t\t$URL = new URL('glossary_addlink');\n\t\t$URL->remove(array(\"g\"));\n\t\t$glossary_addlink_link = $URL->generate('url');\n\t\tprint \"<small><a href=\\\"\" . $glossary_addlink_link . \"\\\">Add an external link</a></small>\";\n\t}",
"public function addStyle($style) {\n // Make sure that the $style param is not null\n if($style == null)\n return;\n\n // TODO: Check for duplications!\n\n // Add the style\n array_push($this->style, $syle);\n }",
"public function addStyle()\n {\n $this->addTo('style', func_get_args());\n }",
"public function addStyle(Style $style)\n {\n $this->styles[] = $style;\n }",
"public function AddStyleSheet($href) {\n\t\t$this->metaTags[] = \"<link href='$href' rel='Stylesheet' type='text/css' />\";\n\t}",
"function set_style_tag($href = '', $name = '')\n {\n Assets::addCss($href);\n }",
"public function insertDefaults(Hyperlink $a): Hyperlink {\n if ($this->target !== null) {\n $a->setTarget($this->target);\n }\n if ($this->defaultCssClasses !== null && $a instanceof ComponentInterface) {\n $a->addCssClass($this->defaultCssClasses);\n }\n return $a;\n }",
"public function addStylesheet($style) {\n $this->stylesheets[] = $style;\n }",
"function smarty_function_add_stylesheet($params, &$smarty) {\n $name = array_var($params, 'name');\n if(empty($name)) {\n return new InvalidParamError('name', $name, \"'name' parameter is required for 'add_stylesheet' helper\", true);\n } // if\n \n $module = array_var($params, 'module');\n \n if(!isset($params['type'])) {\n $params['type'] = 'text/css';\n } // if\n \n unset($params['name']);\n if(isset($params['module'])) {\n unset($params['module']);\n } // if\n \n PageConstruction::addLink(get_stylesheet_url($name, $module), 'stylesheet', $params);\n return '';\n }",
"private function do_background_link() {\n\n\t\t$link = $this->get_link();\n\n\t\t// If the background is a link, add a Link atom.\n\t\tif ( $this->is_background_link() && $link ) {\n\t\t\t$this->inside_tag = 'a';\n\t\t\t$this->inside_attributes['href'] = $link;\n\t\t}\n\t}",
"function hyperlink($url, $linkTxt, $class, $addAttrs = array()) {\n if ($linkTxt === false) //If no link text specified, then default to URL\n $linkTxt = $url;\n\n if(sizeof($addAttrs) !== 0)\n $attrs = asAttrs($addAttrs);\n else\n $attrs = \"\";\n\n return \"<a class='$class' href='$url' $attrs>$linkTxt</a>\";\n}",
"public function linkStyleProvider()\n {\n return [[new \\Urbania\\AppleNews\\Format\\TextStyle()]];\n }",
"function add(& $style)\n {\n if (is_a($style, \"Image_Graph_Element\")) {\n parent::add($style);\n } else {\n $this->addColor($style);\n }\n $this->_lineStyles[] = & $style;\n reset($this->_lineStyles);\n\n }",
"public function testAddStyle() {\r\n $this->_template->addStyle('myStyle.css');\r\n\r\n $payload = $this->_template->getPayload();\r\n\r\n $this->assertEquals(\r\n '<!DOCTYPE html><html lang=\"en\"><head><link type=\"text/css\" rel=\"stylesheet\" href=\"myStyle.css\" /></head><body></body></html>',\r\n $payload\r\n );\r\n }",
"public function addStyle(string $style) {\n if ($style != \"\")\n $this->styles[] = $this->pathFile($style);\n }",
"private function appendStyle(): string\n {\n $style = $this->state->getStyle();\n if ($style === \"none\") {\n return \"\";\n }\n\n /** @noinspection HtmlUnknownTarget */\n return \"<link href=\\\"{{asset('css/crudgenerator/$style.css')}}\\\" rel='stylesheet'>\\n\\n\";\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Test the property articleIds | public function testPropertyArticleIds($value)
{
$object = new PromoteArticleRequest();
$object->setArticleIds($value);
$this->assertEquals($value, $object->getArticleIds());
} | [
"public function testGetArticles()\n {\n $oDelivery = oxNew('oxDelivery');\n $oDelivery->load($this->_sOxId);\n\n // Main check\n $this->assertEquals(3, count($oDelivery->getArticles()));\n foreach ($oDelivery->getArticles() as $sId) {\n $this->assertTrue(in_array($sId, $this->aArticleIds));\n }\n }",
"public function testHasArticleIdNot()\n {\n $this->assertFalse($this->_oSubj->hasArticleId(\"id25\"));\n }",
"public function testLoadingArticleTagsWithSetArticleId()\n {\n $oArticleTagList = oxNew('oxArticleTagList');\n $oArticleTagList->load('1126');\n $aTags = $oArticleTagList->getArray();\n\n if ($this->getConfig()->getEdition() === 'EE') {\n $this->assertEquals(6, count($aTags));\n $this->assertTrue(array_key_exists(\"wild\", $aTags));\n } else {\n $this->assertEquals(9, count($aTags));\n $this->assertTrue(array_key_exists(\"fee\", $aTags));\n }\n }",
"private function prepareLookupStoreIds($articleId)\n {\n $entityConnectionName = 'connection_name';\n $tableName = 'aw_faq_article_store';\n $identifierField = 'article_id';\n $expected = [1, 2, 3, 4];\n\n $this->metadataPoolMock\n ->expects($this->once())\n ->method('getMetadata')\n ->with(ArticleInterface::class)\n ->willReturn($this->entityMetadataInterfaceMock);\n\n $this->entityMetadataInterfaceMock\n ->expects($this->once())\n ->method('getEntityConnectionName')\n ->willReturn($entityConnectionName);\n\n $this->resourceConnectionMock\n ->expects($this->once())\n ->method('getConnectionByName')\n ->with($entityConnectionName)\n ->willReturn($this->connectionMock);\n\n $this->connectionMock\n ->expects($this->once())\n ->method('select')\n ->willReturn($this->selectMock);\n\n $this->resourceConnectionMock\n ->expects($this->once())\n ->method('getTableName')\n ->with($tableName)\n ->willReturnArgument(0);\n\n $this->selectMock\n ->expects($this->once())\n ->method('from')\n ->with(['fas' => $tableName], 'store_ids')\n ->willReturnSelf();\n\n $this->entityMetadataInterfaceMock\n ->expects($this->once())\n ->method('getIdentifierField')\n ->willReturn($identifierField);\n\n $this->selectMock\n ->expects($this->once())\n ->method('where')\n ->with('fas.' . $identifierField . ' = :articleId')\n ->willReturnSelf();\n\n $this->connectionMock\n ->expects($this->once())\n ->method('fetchCol')\n ->with($this->selectMock, ['articleId' => $articleId])\n ->willReturn($expected);\n\n return $expected;\n }",
"private function getArticleIdList()\n {\n $limit = $this->pluginConfig['apiPollLimit'];\n $offset = $this->Request()->getParam('offset');\n $sort = '';\n\n $this->View()->assign('offset', $offset);\n $this->View()->assign('limit', $limit);\n\n $filter = array();\n\n # only articles with images\n /*if ( $this->pluginConfig['apiOnlyArticlesWithImg'] ) {\n $filter[] = array(\n 'property' => 'images.id',\n 'expression' => '>',\n 'value' => '0'\n );\n }*/\n\n # filter category id\n $categoriesId = $this->shop->getCategory()->getId();\n\n $filter[] = array(\n 'property' => 'categories.id',\n 'expression' => '=',\n 'value' => $categoriesId\n );\n\n # only active articles\n if ( $this->pluginConfig['apiOnlyActiveArticles'] ) {\n $filter[] = array(\n 'property' => 'article.active',\n 'expression' => '=',\n 'value' => '1'\n );\n $filter[] = array(\n 'property' => 'detail.active',\n 'expression' => '=',\n 'value' => '1'\n );\n }\n\n # only articles with an ean\n if ( $this->pluginConfig['apiOnlyArticlesWithEan'] ) {\n $filter[] = array(\n 'property' => 'detail.ean',\n 'expression' => '!=',\n 'value' => ''\n );\n }\n\n # check if all articles flag is set\n if ( $this->pluginConfig['apiAllArticles'] ) {\n $result = $this->channableArticleResource->getAllArticlesList($offset, $limit, $filter, $sort);\n } else {\n $result = $this->channableArticleResource->getList($offset, $limit, $filter, $sort);\n }\n\n return $result['data'];\n }",
"public function testGetByIds()\n {\n $object1 = $this->repository->get(1);\n $object2 = $this->repository->get(2);\n\n $read = $this->repository->getWhereIdIn([1, 2]);\n\n $expected = [$object1->getProperties(), $object2->getProperties()];\n $test = [$read[0]->getProperties(), $read[1]->getProperties()];\n\n $this->assertEquals($expected, $test);\n }",
"public function getArticles_idarticles()\n {\n return $this->articles_idarticles;\n }",
"public function testGetAllListIds() {\n $l = NewsletterList::fromData([\n 'source' => 'test',\n 'identifier' => 'test',\n 'title' => 'Test',\n ]);\n $l->save();\n\n $c = new Component(['type' => 'opt_in'], TRUE);\n $this->assertEqual([$l->list_id], $c->getAllListIds());\n }",
"public function testGetMatchingProductIds() { \n \n }",
"public function get_all_article_ids($storyline_id, $except_article_id = false) \n\t{\n\t\tif ($except_article_id !== false)\n\t\t{\n\t\t\t$this->db->where('id <> '.$except_article_id);\n\t\t}\n\t\treturn $this->select('id')->find_all_by('storyline_id',$storyline_id);\n\t}",
"public function testLoadRecommArticleIds()\n {\n $myDB = $this->getDb();\n $sShopId = $this->getConfig()->getShopId();\n // adding article to recommendlist\n $sQ = 'insert into oxrecommlists ( oxid, oxuserid, oxtitle, oxdesc, oxshopid ) values ( \"testlist\", \"oxdefaultadmin\", \"oxtest\", \"oxtest\", \"' . $sShopId . '\" ) ';\n $myDB->Execute($sQ);\n $sQ = 'insert into oxobject2list ( oxid, oxobjectid, oxlistid, oxdesc ) values ( \"testlist\", \"1651\", \"testlist\", \"test\" ),' .\n ' ( \"testlist2\", \"2000\", \"testlist\", \"test\" ), ( \"testlist3\", \"1126\", \"testlist\", \"test\" ) ';\n $myDB->Execute($sQ);\n $oTest = $this->getProxyClass('oxArticleList');\n $oTest->loadRecommArticleIds(\"testlist\", null);\n $aExpt = array(\"1651\" => \"1651\", \"2000\" => \"2000\", \"1126\" => \"1126\");\n $this->assertEquals(3, count($oTest));\n $this->assertEquals($aExpt['1651'], $oTest['1651']);\n }",
"public function isEntityIdProperty($propertyName) {\n return $this->properties[$propertyName]['type'] == 'entity_id';\n }",
"public function getEntitiesIds();",
"public function testCreateIdListFromSql()\n {\n $oTest = $this->getProxyClass('oxArticleList');\n $sQ = \"select * from oxarticles where oxid in('1354', '2000', 'not existant')\";\n $aExpt = array(\"1354\" => \"1354\", \"2000\" => \"2000\");\n $aRes = $oTest->UNITcreateIdListFromSQL($sQ);\n $this->assertEquals($aExpt[1354], $oTest[1354]);\n $this->assertEquals($aExpt[2000], $oTest[2000]);\n }",
"public function testCheckListOfIds(): void\n {\n $this->checkListOfIdsTrait(\n TimeperiodRepository::class,\n 'checkListOfIds'\n );\n }",
"public function testlistIdsDefaultSet () {\n\t\t$nid = $this->pc->listIds();\n\t\t$this->assertArrayHasKey('te/st', $nid);\n\t\t$this->assertArrayNotHasKey('test', $nid);\n\t}",
"protected function hasIdsParameter()\n {\n return isset($this->payload['ids']);\n }",
"public function testSearchArticles()\n {\n $article = factory(Article::class)->create();\n preg_match('/[A-Z0-9_]+/i', $article->title, $matches);\n\n $result = $this->service->searchArticles($this->user, explode(' ', $matches[0]));\n $this->assertEquals($article->id, $result->first()->id);\n }",
"function getArticleUids() {\n\t\treturn $this->articles_uids;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the ranking list for one or more competition types and year | function getRankings($competition_type, $year) {
if ($competition_type == "all") {
$results = array();
$query = "SELECT id,title
FROM #__categories
ORDER BY id";
$db =& JFactory::getDBO();
$db->setQuery($query);
foreach ($db->loadObjectList() as $comp) {
$results[$comp->title] =
$this->getIndividualRanking($comp->id, $year, $sort);
}
return $results;
}
else {
return $this->getIndividualRanking($competition_type, $year);
}
} | [
"public function getRankingByCompany();",
"public function getCourseRankings()\n\t{\n\t\t$ranks = $this->_getCourseRankComparisonFromDB();\n\t\t\n\t\tif ($ranks) {\n\t\t\t$count=1;\n\t\t\tforeach ($ranks as $vals) {\n\t\t\t\t$course = $vals['courseid'];\n\t\t\t\t$score = $vals['avscore'];\n\t\t\t\t\n\t\t\t\t$row[]=<<<EOROW\n\t\t\t\t<tr>\n\t\t\t\t\t<td>$count</td>\n\t\t\t\t\t<td>$course</td>\n\t\t\t\t\t<td>$score</td>\n\t\t\t\t</tr>\nEOROW;\n\t\t\t\t$count++;\n\t\t\t}\n\t\t\t\n\t\t\tif ($row) {\n\t\t\t\treturn \"<table id='allCourseRankings' class='table table-bordered table-striped dataTable'><thead><tr><th>Rank</th><th>Course</th><th>Rating</th></tr></thead><tbody>\".implode($row).\"</tbody></table>\";\n\t\t\t}\n\t\t}\n\t}",
"public function get_position_rankings($position,$year,$full=1){\r\n\r\n\t\r\n\t\t\r\n\t\t//get every distinct player id that scored that year. If they didn't score, they will be left out\r\n\t\t\r\n\t\t$fffl_player_id_query = $this->NFL_db->select('fffl_player_id')\r\n\t\t\t\t->distinct()\r\n\t\t\t\t->where('week>0 and week<17')\r\n\t\t\t\t->get('NFL_stats_'.$year);\r\n\t\t\r\n\t\t$rankings = array();\r\n\t\t\r\n\t\t\r\n\t\tforeach($fffl_player_id_query->result_array() as $player){\r\n\t\t\t$player_position = $this->Players->get_player_info(array($player['fffl_player_id']),\"fffl_player_id\",\"position\");\r\n\t\t\tif(isset($player_position['position'])){ \r\n\t\t\t\tif($player_position['position']==$position){\r\n\t\t\t\t\tif($full==1){\r\n\t\t\t\t\t\t$team_query= $this->NFL_db->select('player_team')\r\n\t\t\t\t\t\t\t\t\t\t->where('fffl_player_id',$player['fffl_player_id'])\r\n\t\t\t\t\t\t\t\t\t\t->order_by('week','DESC')\r\n\t\t\t\t\t\t\t\t\t\t->limit(1)\r\n\t\t\t\t\t\t\t\t\t\t->get('NFL_stats_'.$year);\r\n\t\t\t\t\t\t$team_row = $team_query->row();\r\n\t\t\t\t\t\t$team = $team_row->player_team;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t$score_data = $this->get_player_scores_season($year,$player['fffl_player_id'],1,1,16,0);\r\n\t\t\t\t\r\n\t\t\t\t\tif($full==1){\r\n\t\t\t\t\t\t$owners = $this->Players->get_player_owners($player['fffl_player_id'], \"fffl_player_id\");\r\n\t\t\t\t\t\t$owners_array=array();\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif($owners){\r\n\t\t\t\t\t\t\tforeach($owners as $team_id){\r\n\t\t\t\t\t\t\t\t$owners_array[]=$team_id->team_id;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif($full==1){\r\n\t\t\t\t\t\t$rankings[] = array(\r\n\t\t\t\t\t\t\t\t'average' => $score_data['average'],\r\n\t\t\t\t\t\t\t\t'fffl_player_id' => $player['fffl_player_id'],\r\n\t\t\t\t\t\t\t\t'team' => $team,\r\n\t\t\t\t\t\t\t\t'fffl_teams' => $owners_array\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\t$rankings[] = array(\r\n\t\t\t\t\t\t\t\t'average' => $score_data['average'],\r\n\t\t\t\t\t\t\t\t'fffl_player_id' => $player['fffl_player_id']\r\n\t\t\t\t\t\t);\r\n\t\t\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\t\r\n\t\t//these definitions are due to problems caused by rookies having no average\r\n\t\t$average=array(); $team_ar=array();\r\n\t\t// Obtain a list of columns\r\n\t\t\r\n\t\tforeach ($rankings as $key => $row) {\r\n\t\t\t$average[$key] = $row['average'];\r\n\t\t\t\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\t// Sort the data with average descending, \r\n\t\t// Add $rankings as the last parameter, to sort by the common key\r\n\t\tarray_multisort($average, SORT_DESC, $rankings);\r\n\t\t\r\n\t\t\r\n\t\treturn $rankings;\r\n\t\t\r\n\t}",
"public function getRankOptions()\n {\n $ranks = [];\n\n switch ($this->type) {\n case 'coats':\n case 'regf':\n case 'resf':\n $ranks = [\n 'ocdt' => 'acgp.flyingsite::lang.models.member.rank.ocdt',\n '2lt' => 'acgp.flyingsite::lang.models.member.rank.2lt',\n 'lt' => 'acgp.flyingsite::lang.models.member.rank.lt',\n 'capt' => 'acgp.flyingsite::lang.models.member.rank.capt',\n 'maj' => 'acgp.flyingsite::lang.models.member.rank.maj',\n 'lcol' => 'acgp.flyingsite::lang.models.member.rank.lcol',\n 'col' => 'acgp.flyingsite::lang.models.member.rank.col',\n ];\n break;\n case 'ci':\n case 'cv':\n $ranks = ['na' => 'acgp.flyingsite::lang.models.member.rank.na'];\n break;\n case 'cadet':\n default:\n $ranks = [\n 'cdt-ac' => 'acgp.flyingsite::lang.models.member.rank.cdt-ac',\n 'cdt-lac' => 'acgp.flyingsite::lang.models.member.rank.cdt-lac',\n 'cdt-cpl' => 'acgp.flyingsite::lang.models.member.rank.cdt-cpl',\n 'cdt-fcpl' => 'acgp.flyingsite::lang.models.member.rank.cdt-fcpl',\n 'cdt-sgt' => 'acgp.flyingsite::lang.models.member.rank.cdt-sgt',\n 'cdt-fsgt' => 'acgp.flyingsite::lang.models.member.rank.cdt-fsgt',\n 'cdt-wo2' => 'acgp.flyingsite::lang.models.member.rank.cdt-wo2',\n 'cdt-wo1' => 'acgp.flyingsite::lang.models.member.rank.cdt-wo1',\n ];\n break;\n }\n\n return $ranks;\n }",
"public static function generateRanks($year, $event)\n\t{\n\t\tif ($year < NationalChampionshipPeriod::minYear()) return True;\n\n\t\t$currentDate = date('Y-m-d');\n\t\t$dnf = Result::dnfNumericalValue();\n\t\t$resultType = $event->showAverage() ? 'average' : 'single'; // Result type to be used when comparing results\n\n\t\t// Delete all previous championship ranks for a given year\n\t\tResult::whereEventId($event->id)\n\t\t\t\t->where('championship_rank', '!=', '0')\n\t\t\t\t->where('results.date', '>=', $year . '-01-01')\n\t\t\t\t->where('results.date', '<=', $year . '-12-31')\n\t\t\t\t->update(array('championship_rank' => 0));\n\n\t\t// Fetch periods of the given year\n\t\t$periods = NationalChampionshipPeriod::where('year', $year)->get();\n\n\t\t$mergeWithPrevious = False;\n\t\t$mergedPeriods = 1;\n\t\t$previousPeriodStartDate = null;\n\t\tforeach ($periods as $i => $period) {\n\n\t\t\t$startDate = $mergeWithPrevious ? $previousPeriodStartDate : $period->start_date;\n\n\t\t\t// Get all users with valid results for a given period\n\t\t\t$periodResults = Result::select('user_id')\n\t\t\t\t->join('competitions', 'results.competition_id', '=', 'competitions.id')\n\t\t\t\t->where('competitions.championship', '1')\n\t\t\t\t->whereEventId($event->id)\n\t\t\t\t->where('results.date', '>=', $startDate)\n\t\t\t\t->where('results.date', '<=', $period->end_date)//;\n\t\t\t//if (FALSE && $year < 2015) {\n\t\t\t//\t$periodResults = $periodResults->where($resultType, '<', $dnf);\n\t\t\t//}\n\t\t\t//$periodResults = $periodResults\n\t\t\t\t->groupBy('user_id')\n\t\t\t\t->get();\n\n\t\t\t$countValidResults = 0;\n\t\t\tforeach ($periodResults as $r) {\n\t\t\t\t//if ((int) $r->$resultType < (int) $dnf) $countValidResults += 1; // Weird data coming out of GROUP BY ORDER BY!\n\t\t\t\t$temp = Result::select('results.*')\n\t\t\t\t\t->join('competitions', 'results.competition_id', '=', 'competitions.id')\n\t\t\t\t\t->where('competitions.championship', '1')\n\t\t\t\t\t->whereUserId($r->user_id)\n\t\t\t\t\t->whereEventId($event->id)\n\t\t\t\t\t->where('results.date', '>=', $startDate)\n\t\t\t\t\t->where('results.date', '<=', $period->end_date)\n\t\t\t\t\t->orderBy($resultType, 'asc')\n\t\t\t\t\t->orderBy('results.date', 'asc')\n\t\t\t\t\t->firstOrFail();\n\t\t\t\tif ((int) $temp->$resultType < (int) $dnf) $countValidResults += 1;\n\t\t\t}\n\t\t\t//if ($event->readable_id == \"333BLD\") var_dump($countValidResults);\n\t\t\t// If there are less than N results in a period, then periods get merged!\n\t\t\t// $i + 1 < count($periods), because the last period cannot be merged.\n\t\t\tif ($countValidResults < $period->min_results AND $i + 1 < count($periods)) {\n\n\t\t\t\t// If 2011 and 3 periods have already been merged, then we cannot merge any more periods!\n\t\t\t\tif (!($year == 2011) OR $mergedPeriods < 3) {\n\t\t\t\t\tif (!$mergeWithPrevious) $previousPeriodStartDate = $period->start_date;\n\t\t\t\t\t$mergeWithPrevious = True;\n\t\t\t\t\t$mergedPeriods++;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ($mergeWithPrevious) {\n\t\t\t\t$mergeWithPrevious = False;\n\t\t\t\t$mergedPeriods = 1;\n\t\t\t\t$previousPeriodStartDate = null;\n\t\t\t}\n\n\t\t\t// Everything's fine... start calculating!\n\n\t\t\t// Get best result for each user\n\t\t\t$results = array();\n\t\t\tforeach ($periodResults as $r) {\n\t\t\t\t$results[] = Result::select('results.*')\n\t\t\t\t\t->join('competitions', 'results.competition_id', '=', 'competitions.id')\n\t\t\t\t\t->where('competitions.championship', '1')\n\t\t\t\t\t->whereUserId($r->user_id)\n\t\t\t\t\t->whereEventId($event->id)\n\t\t\t\t\t->where('results.date', '>=', $startDate)\n\t\t\t\t\t->where('results.date', '<=', $period->end_date)\n\t\t\t\t\t->orderBy($resultType, 'asc')\n\t\t\t\t\t->orderBy('results.date', 'asc')\n\t\t\t\t\t->firstOrFail();\n\t\t\t}\n\n\t\t\t// Sort results by result type (single/average)\n\t\t\tusort($results, function($a, $b) use ($resultType) {\n\t\t\t\tif ($a->$resultType == $b->$resultType) return 0;\n\t\t\t\treturn ($a->$resultType > $b->$resultType) ? 1 : -1;\n\t\t\t});\n\n\t\t\t// Update championship ranks\n\t\t\t$rank = 0;\n\t\t\t$previousResult = NULL;\n\t\t\t$playersWithSameResult = 1;\n\t\t\tforeach ($results as $result) {\n\t\t\t\t// Calculate rank\n\t\t\t\tif ($previousResult === $result->$resultType) {\n\t\t\t\t\t$playersWithSameResult += 1;\n\t\t\t\t} else {\n\t\t\t\t\t$rank += $playersWithSameResult;\n\t\t\t\t\t$playersWithSameResult = 1;\n\t\t\t\t}\n\t\t\t\t$previousResult = $result->$resultType;\n\n\t\t\t\t// DNF, DNS, ...\n\t\t\t\tif ((int) $result->$resultType >= (int) Result::dnfNumericalValue()) {\n\t\t\t\t\t$rank = -1;\n\t\t\t\t\t$playersWithSameResult = 0;\n\t\t\t\t}\n\n\t\t\t\t// Save\n\t\t\t\t$result->championship_rank = $rank;\n\t\t\t\t$result->save();\n\t\t\t}\n\t\t}\n\n\t\treturn True;\n\t}",
"public function providerYearsList()\n {\n return array(\n array(1, 2010, array(2010 => 2010, 2009 => 2009)),\n array(2, 2010, array(2010 => 2010, 2009 => 2009, 2008 => 2008)),\n array(3, 2010, array(2010 => 2010, 2009 => 2009, 2008 => 2008, 2007 => 2007)),\n \t);\n }",
"public function ranking(){\n\t $ranking = getData(\"ordem\") ?: \"seguidores\";\n\t $pais = getData(\"pais\");\n\t $page = getData(\"page\", 1);\n\t $categoria = getData(\"categoria\");\n\t \n\t if($ranking == \"seguidores\") {\n\t $data['canais'] = call(\"Model/ModelChannel\")->lista(10, \"canalInscritos\", $pais, $categoria, $page); \n\t } else {\n\t $data['canais'] = call(\"Model/ModelChannel\")->lista(10, \"canalMediaVisualizacoes\", $pais, $categoria, $page);\n\t }\n\t \n\t $data['count'] = call(\"Model/ModelChannel\")->count_lista($pais, $categoria);\n\t $data['paginator'] = call('Helper/Paginator')->go($page, $data['count']->total, \"/canal/ranking/pais/\".$pais.\"/categoria/\".$categoria.\"/page/\", 10);\n\t \n\t $data['paises'] = call(\"Model/ModelCountry\")->getList();\n\t $data['categorias'] = call(\"Model/ModelCategory\")->getCategories();\n\t \n\t $data['form_pais'] = $pais;\n\t $data['form_categoria'] = $categoria;\n\t \n\t\tincludePage('TelaRankingCanais', false, $data);\n\t}",
"public static function get_all_ranks()\n {\n }",
"function getRank($player, $season, $type) {\n\tif ($type == 'Ladder') { // We rank ladder standings by RPI\n\t\tglobal $dbUser, $dbPass, $dbTable, $con;\n\t\t$players = array();\n\n\n\t\t$playerResult = mysqli_query($con,\"SELECT PlayerID FROM Players WHERE LadderSeason = '$season'\");\n\t\twhile($row = mysqli_fetch_assoc($playerResult)) {\n\t\t\t$players[] = $row;\n\t\t}\n\n\t\tforeach($players as $key => $value) {\n\t\t\t$players[$key]['rpi'] = getRPI($players[$key]['PlayerID'], $season, $type);\n\t\t}\n\n\t\tforeach ($players as $key => $row) {\n\t\t\t$rpi[$key] = $row['rpi'];\n\t\t}\n\n\t\tarray_multisort($rpi, SORT_DESC, $players);\n\t\t\n\t\tforeach ($players as $key => $value) {\n\t\t\tif ($players[$key]['PlayerID'] === $player) {\n\t\t\t\treturn $key+1;\n\t\t\t}\n\t\t}\n\n\t} else { // We rank league standings by least number of losses with an RPI tie-breaker\n\t\tglobal $dbUser, $dbPass, $dbTable, $con;\n\t\t$players = array();\n\n\n\t\t$playerResult = mysqli_query($con,\"SELECT PlayerID FROM Players WHERE LadderSeason = '$season'\");\n\t\twhile($row = mysqli_fetch_assoc($playerResult)) {\n\t\t\t$players[] = $row;\n\t\t}\n\n\t\tforeach($players as $key => $value) {\n\t\t\t$players[$key]['losses'] = substr(getRecord($players[$key]['PlayerID'], $season, $type), -1);\n\t\t}\n\n\t\tforeach ($players as $key => $row) {\n\t\t\t$losses[$key] = $row['losses'];\n\t\t}\n\n\t\tarray_multisort($losses, SORT_ASC, $players);\n\t\t\n\t\tforeach ($players as $key => $value) {\n\t\t\tif ($players[$key]['PlayerID'] === $player) {\n\t\t\t\treturn $key+1;\n\t\t\t}\n\t\t}\n\t}\n}",
"public function get_list_ranks() {\n\t\techo json_encode($this -> employee_model -> get_list_ranks());\n\t}",
"function getRankingsTable($seasonid,$returnrows,$minitab,$widtype) {\r\n\t\t//seasonid = relates to which season\r\n\t\t//returnrows = enables the function just to return the top x rows\r\n\t\t//minitab = 1=only return Rank/Name/Pts cols, 0=all cols\r\n\t\t//widtype = if the table's going on a widget that needs to be scrollable=1,0=not on a widget\r\n\t\t\r\n\t\tglobal $rootlocal;\r\n\t\tglobal $wpdb;\r\n\t\t$location = $_SERVER['DOCUMENT_ROOT'];\r\n\t\t\t\t\r\n\t\tinclude ($location . $rootlocal . '/wp-config.php');\r\n\t\tinclude ($location . $rootlocal . '/wp-load.php');\r\n\t\tinclude ($location . $rootlocal . '/wp-includes/pluggable.php');\r\n\t\t \r\n\t\t$rankingtext = '';\r\n\t\tif ($widtype==1){\r\n\t\t\t$tabclass = '<table class=\"mtab-pranking\">';\r\n\t\t} else {\r\n\t\t\t$tabclass = '<table class=\"ftab-pranking\">';\r\n\t\t}\r\n\t\t$rankingtext = $rankingtext . $tabclass;\r\n\t\t\t\r\n\t\t// Get the season name for the ranking sql command\r\n\t\t$season1 = $wpdb->get_var($wpdb->prepare(\"SELECT SeasonDesc FROM seasons WHERE SeasonId = %d\", $seasonid));\r\n\t\t// Take the first second part of the year and adds the 20 for century and set vars for this season and the one before\r\n\t\t$season1 = '20' . substr($season1,5,2); //\r\n\t\t$season0 = $season1-1;\r\n\t\t$season1desc = $season0 . '-' . substr($season1,2,2) ;\r\n\t\t$season0desc = $season0-1 . '-' . substr($season0,2,2) ;\r\n\t\t$seasonid0 = $seasonid-1;\r\n\t\t// Now the query to get the results\r\n\t\t$qryrankings = $wpdb->get_results($wpdb->prepare(\"SELECT UId,Name,LP1, CP1, BP1, If(Isnull(Yr1),0,Yr1) AS Yr1, If(Isnull(Yr0),0,Yr0) AS Yr0, If(Isnull(Yr1),0,Yr1)+If(Isnull(Yr0),0,Yr0) AS RTot\r\n\t\t\t\t\t\tFROM\r\n\t\t\t\t\t\t(\r\n\t\t\t\t\t\tSELECT u.UPlayerId as UId, CONCAT(u.Forename,' ' , u.Surname) AS Name, Sum(Case when SeasonId = %d then LeaguePts END) AS LP1, Sum(Case when SeasonId = %d then CompetitionPts END) AS CP1, Sum(Case when SeasonId = %d then BreakPts END) AS BP1,\r\n\t\t\t\t\t\t Sum(Case when SeasonId = %d then LeaguePts+CompetitionPts+BreakPts END) AS Yr1,\r\n\t\t\t\t\t\t Sum(Case when SeasonId = %d then LeaguePts+CompetitionPts+BreakPts END) AS Yr0\r\n\t\t\t\t\t\tFROM playerrankings as p\r\n\t\t\t\t\t\tINNER JOIN uniqueplayers as u ON u.UPlayerId = p.UPlayerId\r\n\t\t\t\t\t\tWHERE SeasonId = %d or SeasonId = %d\r\n\t\t\t\t\t\tGROUP BY u.UPlayerId\r\n\t\t\t\t\t\tORDER BY Yr1 DESC\r\n\t\t\t\t\t\t ) AS d\r\n\t\t\t\t\t\t GROUP BY UId\r\n\t\t\t\t\t\t ORDER BY RTot DESC\",$seasonid, $seasonid, $seasonid, $seasonid, $seasonid0, $seasonid, $seasonid0));\r\n\t\t//$qryrankings = $wpdb->get_results($rankquery);\r\n\t\t\r\n\t\t//Is this a mini table or full?\r\n\t\tif ($minitab==0) {\r\n\t\t\t$rankingtext= $rankingtext.'\r\n\t\t\t\t\t\t\t\t<thead><tr>\r\n\t\t\t\t\t\t\t\t<th class=\"ftab-weekno\">Rank</th>\r\n\t\t\t\t\t\t\t\t<th class=\"ftab-player1\">Player</th>\r\n\t\t\t\t\t\t\t\t<th class=\"ftab-lpts\">League Pts</th>\r\n\t\t\t\t\t\t\t\t<th class=\"ftab-cpts\">Comp Pts</th>\r\n\t\t\t\t\t\t\t\t<th class=\"ftab-bpts\">Break Pts</th>\r\n\t\t\t\t\t\t\t\t<th class=\"ftab-bpts\">' . $season1desc . '</th>\r\n\t\t\t\t\t\t\t\t<th class=\"ftab-bpts\">' . $season0desc . '</th>\r\n\t\t\t\t\t\t\t\t<th class=\"ftab-tpts\">Total</th>\r\n\t\t\t\t\t\t\t\t<th class=\"ftab-hcap\">Handicap</th>\r\n\t\t\t\t\t\t\t\t</tr></thead><tbody>';\r\n\t\t} else {\r\n\t\t\t$rankingtext= $rankingtext.'<thead><tr>\r\n\t\t\t\t\t\t\t\t<th class=\"mtab-player1\">Player</th>\r\n\t\t\t\t\t\t\t\t<th class=\"mtab-pts\">Total</th>\r\n\t\t\t\t\t\t\t\t<th class=\"mtab-hcap\">Handicap</th>\r\n\t\t\t\t\t\t\t\t</tr></thead><tbody>';\r\n\t\t}\r\n\t\t \r\n\t\t$counter = 1;\r\n\r\n\t\tforeach ($qryrankings as $rank) {\r\n\t\t\t\r\n\t\t\t// Now get the handicap from the Handicap table\r\n\t\t\t$handicap = $wpdb->get_var($wpdb->prepare(\"SELECT Handicap FROM playerhandicaps WHERE SeasonId = %d AND UPlayerId = %d\", $seasonid,$rank->UId));\r\n\t\t\r\n\t\t \tif ($minitab==0) {\t\t\t\r\n\t\t\t\t$rankingtext = $rankingtext .\r\n\t\t\t\t'<tr '. $rowhide . '>\r\n\t\t\t\t\t<td class=\"ftab-weekno\">' . $counter . '</td>\r\n\t\t\t\t\t<td class=\"ftab-player1\"><a href=\"http://www.bdcsnooker.org/players?playerid=' . $rank->UId . '\">' .$rank->Name . '</a></td>\r\n\t\t\t\t\t<td class=\"ftab-lpts\">' . $rank->LP1 . '</td>\r\n\t\t\t\t\t<td class=\"ftab-cpts\">' .$rank->CP1 . '</td>\r\n\t\t\t\t\t<td class=\"ftab-bpts\">' .$rank->BP1 . '</td>\r\n\t\t\t\t\t<td class=\"ftab-bpts\">' . $rank->Yr1 . '</td>\r\n\t\t\t\t\t<td class=\"ftab-bpts\">' . $rank->Yr0 . '</td>\r\n\t\t\t\t\t<td class=\"ftab-tpts\">' . $rank->RTot . '</td>\r\n\t\t\t\t\t<td class=\"ftab-hcap\">' . $handicap . '</td>\r\n\t\t\t\t\t\r\n\t\t\t\t</tr>';\r\n\t\t\t} else {\r\n\t\t\t\t$rankingtext = $rankingtext .\r\n\t\t\t\t'<tr '. $rowhide . '>\r\n\t\t\t\t\t<td class=\"mtab-weekno\">' . $counter . '</td>\r\n\t\t\t\t\t<td class=\"mtab-player1\"><a href=\"http://www.bdcsnooker.org/players?playerid=' . $rank->UId . '\">' .$rank->Name . '</a></td>\r\n\t\t\t\t\t<td class=\"mtab-pts\">' . $rank->RTot . '</td>\r\n\t\t\t\t\t<td class=\"mtab-hcap\">' . $handicap . '</td>\r\n\t\t\t\t</tr>';\r\n\t\t\t} // end minitab\r\n\t\t\t\r\n\t\t\t$counter = $counter+1;\r\n\t\t\t//Only return the rows the call actually requires and hide the rest using a css class\r\n\t\t\tif ($counter===$returnrows) {\r\n\t\t\t\t$rowhide = 'class=\"hiddenrow-averages\"';\r\n\t\t\t}\r\n\t\t\t\r\n\t\t} // end rank loop\r\n\t\t\r\n\t\t$rankingtext = $rankingtext . '</tbody></table>';\r\n\t\t//$rankingtext =\"xxxx \" . $sqlquery;\t\r\n\t\treturn $rankingtext;\r\n\t}",
"function getSeasonYearTypes($db,$group_id) {\n //$season_years = getSeasonYears(); //get all years\n\n //$season_types = getSeasonTypes(); //get all types\n $sql = \"SELECT season_year, season_type, group_id FROM picks\\n\"\n . \"UNION\\n\"\n . \"SELECT season_year, season_type, group_id FROM g_seasons\";\n $result = mysqli_query($db, $sql) or die(mysqli_error_list($db));\n while($row = mysqli_fetch_array($result)) {\n $season_years[] = $row['season_year'];\n $season_types[] = $row['season_type'];\n $groups[] = $row['group_id'];\n }\n return [$groups, $season_years, $season_types];\n}",
"public function getStatsBetalteByQuarter($grundType, $year) {\n\n $quarters = array();\n $quarters[1] = [1, 2, 3];\n $quarters[2] = [4, 5, 6];\n $quarters[3] = [7, 8, 9];\n $quarters[4] = [10, 11, 12];\n\n $result = array();\n\n for ($i = 1; $i <= 4; $i++) {\n $sql = \"SELECT SUM(pris) as pris,SUM(salgsPrisUMoms) as salgspris, count(pris) as thecount \";\n $sql .= \"FROM Grund WHERE type = ? AND salgStatus = '\" . GrundSalgStatus::SOLGT . \"' \";\n $sql .= \"AND YEAR(COALESCE(beloebAnvist,accept)) = ? \";\n $sql .= \"AND MONTH(COALESCE(beloebAnvist,accept)) IN (?)\";\n\n $values = [$grundType, $year, $quarters[$i]];\n $types = [\\PDO::PARAM_STR, \\PDO::PARAM_INT, Connection::PARAM_INT_ARRAY];\n $stmt = $this->getEntityManager()->getConnection()->executeQuery($sql, $values, $types);\n\n $result[$i] = $stmt->fetch(\\PDO::FETCH_ASSOC);\n }\n\n return $result;\n }",
"function displayPlayersByRank($teamId, $rankYear, $rank, $isReadOnly) {\n \t$lastYear = $rankYear - 1;\n \t$ranks = RankDao::getRanksByTeamYearRank($teamId, $rankYear, $rank);\n \techo \"<h5>\" . $rank . \"'s</h5>\";\n \tif (count($ranks) > 15) {\n \t echo \"<div class=\\\"alert alert-error\\\">Too many \" . $rank . \"s!</div>\";\n \t}\n \techo \"<table class='table vertmiddle table-striped table-condensed table-bordered center\n \t smallfonttable'>\";\n \techo \"<thead><tr><th>Player</th><th>FPTS</th><th>Rank</th></tr></thead>\";\n\n \tforeach ($ranks as $rank) {\n // if rank is a placeholder, update style\n \t echo \"<tr\";\n \t if ($rank->isPlaceholder()) {\n \t \techo \" class='placeholder_row'\";\n \t }\n \t $fantasyPts = ($rank->getPlayer()->getStatLine($lastYear) != null) ?\n $rank->getPlayer()->getStatLine($lastYear)->getFantasyPoints() : \"--\";\n \t echo \"><td>\" . $rank->getPlayer()->getIdNewTabLink(true, $rank->getPlayer()->getFullName()) .\n \t \"</td>\n \t <td>\" . $fantasyPts . \"</td>\";\n \t echo \"<td>\";\n \t if ($rank->isPlaceholder() || $isReadOnly) {\n \t \t// placeholder; show read-only value\n \t \techo $rank->getRank();\n \t } else {\n \t \t// not a placeholder; show drop-down for selecting rank\n \t \tdisplaySelectForPlayer($rank->getPlayer(), $rank->getRank());\n \t }\n \t echo \"</td></tr>\";\n \t}\n \techo \"</table>\";\n }",
"public function listRanks()\n {\n $ranks = array(\n '' => \"No Rank\",\n -1 => \"Speeding Ticket\",\n 1 => \"1\",\n 2 => \"2\",\n 3 => \"3\",\n 4 => \"4\",\n 5 => \"5\",\n 6 => \"6\",\n 7 => \"7\",\n 8 => \"8\",\n 98 => \"No Show\",\n 99 => \"DQ\",\n );\n return $ranks;\n }",
"private function _getPreparedYearsList()\n {\n $expectedYearsList = [];\n for ($index = 0; $index <= Config::YEARS_RANGE; $index++) {\n $year = (int)self::CURRENT_YEAR + $index;\n $expectedYearsList[$year] = $year;\n }\n return $expectedYearsList;\n }",
"public function rankingTable($atts)\n {\n $a = shortcode_atts(array(\n 'year' => 0,\n 'team' => 0,\n 'type' => 1,\n 'highlight' => 1,\n ), $atts);\n if ($a['year'] == 0 || $a['team'] == 0)\n return \"\";\n\n $apiHandler = \\WP_SUAPI\\WP_SUAPI_API_Handler::GET_INITIALIZED_API_HANDLER();\n $apiHandler->setYearForQuery($a['year']);\n $rankingsTable = $apiHandler->getRankingForTeam(new Team($a['team'], ''));\n\n $args = array('rankings' => $rankingsTable->getRankings());\n\n if($a['highlight'] == 1)\n $args = array_merge($args, array('team' => $apiHandler->getTeamById($a['team'])));\n\n switch ($a['type']) {\n case 1:\n return $this->twig->render('wp-suapi-rankingtable-1.twig.html', $args);\n case 2:\n return $this->twig->render('wp-suapi-rankingtable-2.twig.html', $args);\n case 3:\n return $this->twig->render('wp-suapi-rankingtable-3.twig.html', $args);\n default:\n return \"\";\n }\n }",
"public function rankYear(int $year) {\n $key = \"voting_ranks_year_$year\";\n $ranks = self::$cache->get_value($year);\n if ($ranks == false) {\n self::$db->prepared_query(\"\n SELECT v.GroupID,\n v.Score\n FROM torrents_votes AS v\n INNER JOIN torrents_group AS g ON (g.ID = v.GroupID)\n WHERE g.Year = ?\n ORDER BY v.Score DESC\n LIMIT 100\n \", $year\n );\n $ranks = $this->voteRanks(self::$db->to_pair(0, 1, false));\n self::$cache->cache_value($key, $ranks, 259200);\n }\n return $ranks[$this->groupId] ?? false;\n }",
"public static function getTeamRanking($projectid, $division_id) {\n // Reference global application object\n $app = JFactory::getApplication();\n // JInput object\n $jinput = $app->input;\n $option = $jinput->getCmd('option');\n // Create a new query object.\t\t\n $db = sportsmanagementHelper::getDBConnection(TRUE, self::$cfg_which_database);\n $query = $db->getQuery(true);\n\n if (COM_SPORTSMANAGEMENT_SHOW_DEBUG_INFO) {\n $my_text = 'projectid -><pre>' . print_r($projectid, true) . '</pre>';\n //$my_text .= 'getErrorMsg -><pre>'.print_r($db->getErrorMsg(),true).'</pre>'; \n sportsmanagementHelper::setDebugInfoText(__METHOD__, __FUNCTION__, __CLASS__, __LINE__, $my_text);\n //$app->enqueueMessage(JText::_(__METHOD__.' '.__LINE__.' projectid<br><pre>'.print_r($projectid,true).'</pre>'),'');\n }\n\n //$app->enqueueMessage(JText::_(__METHOD__.' '.__LINE__.' projectid<br><pre>'.print_r($projectid,true).'</pre>'),'');\n\n $rank = array();\n\n sportsmanagementModelProject::setProjectID($projectid, self::$cfg_which_database);\n $project = sportsmanagementModelProject::getProject(self::$cfg_which_database);\n $tableconfig = sportsmanagementModelProject::getTemplateConfig(\"ranking\", self::$cfg_which_database);\n $ranking = JSMRanking::getInstance($project, self::$cfg_which_database);\n $ranking->setProjectId($project->id, self::$cfg_which_database);\n $temp_ranking = $ranking->getRanking(0, sportsmanagementModelProject::getCurrentRound(null, self::$cfg_which_database), $division_id, self::$cfg_which_database);\n foreach ($temp_ranking as $ptid => $value) {\n//\t\t\tif ($value->getPtid() == self::$projectteamid)\n//\t\t\t{\n//\t\t\t\t$rank['rank'] = $value->rank;\n//\t\t\t\t$rank['games'] = $value->cnt_matches;\n//\t\t\t\t$rank['points'] = $value->getPoints();\n//\t\t\t\t$rank['series'] = $value->cnt_won . \"/\" . $value->cnt_draw . \"/\" . $value->cnt_lost;\n//\t\t\t\t$rank['goals'] = $value->sum_team1_result . \":\" . $value->sum_team2_result;\n//\t\t\t\tbreak;\n//\t\t\t} \n if ($value->getTeamId() == self::$teamid) {\n $rank['rank'] = $value->rank;\n $rank['games'] = $value->cnt_matches;\n $rank['points'] = $value->getPoints();\n $rank['series'] = $value->cnt_won . \"/\" . $value->cnt_draw . \"/\" . $value->cnt_lost;\n $rank['goals'] = $value->sum_team1_result . \":\" . $value->sum_team2_result;\n break;\n }\n }\n\n //}\n\n if (COM_SPORTSMANAGEMENT_SHOW_DEBUG_INFO) {\n $my_text = 'rank -><pre>' . print_r($rank, true) . '</pre>';\n //$my_text .= 'getErrorMsg -><pre>'.print_r($db->getErrorMsg(),true).'</pre>'; \n sportsmanagementHelper::setDebugInfoText(__METHOD__, __FUNCTION__, __CLASS__, __LINE__, $my_text);\n //$app->enqueueMessage(JText::_(get_class($this).' '.__FUNCTION__.' '.__LINE__.' rank<br><pre>'.print_r($rank,true).'</pre>'),'');\n }\n $db->disconnect(); // See: http://api.joomla.org/cms-3/classes/JDatabaseDriver.html#method_disconnect\n\n return $rank;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function : system_version_list params : None. Created On : 22042012 | function system_version_list(){
##check admin session live or not
$this->session_check_admin();
##fetch data from project type table for listing
$field='';
$condition = "delete_status = '0'";
if(isset($this->data['versions']['searchkey']) && $this->data['versions']['searchkey']){
$searchkeyword = $this->data['versions']['searchkey'];
$condition .= " and (system_version_name LIKE '%".$searchkeyword."%' OR note LIKE '%".$searchkeyword."%' )";
}
$this->Pagination->sortByClass = 'SystemVersion'; ##initaite pagination
$this->Pagination->total= count($this->SystemVersion->find('all',array("conditions"=>$condition)));
list($order,$limit,$page) = $this->Pagination->init($condition,$field);
$sys_ver_data = $this->SystemVersion->find('all',array("conditions"=>$condition, 'order' =>$order, 'limit' => $limit, 'page' => $page));
##set project type data in variable
$this->set("sys_ver_data",$sys_ver_data);
} | [
"public function getVersions() {}",
"public function getVersions();",
"public function ajajGetFeatureVersionList() {\n\t\t$v =& $this->scene;\n\t\tif ($this->checkAllowed('config', 'modify')) {\n\t\t\t$dbMeta = $this->getProp('SetupDb');\n\t\t\ttry {\n\t\t\t\t$v->results = APIResponse::resultsWithData($dbMeta->getFeatureVersionList());\n\t\t\t} catch (Exception $e) {\n\t\t\t\tthrow BrokenLeg::tossException($this, $e);\n\t\t\t}\n\t\t}\n\t}",
"public function getVersions()\r\n {\r\n $info = array(\r\n 'moduleVersion' => Mage::helper('ordermonitor_agent')->getOmVersion(),\r\n 'platformVersion' => Mage::getVersion()\r\n );\r\n\r\n return $info;\r\n }",
"public function get_version(){\n\t\treturn array($this->version_major,$this->version_revision);\n\t}",
"public function getVersionList($osType,$pageinfo) {\n\n $list = DB::table('app_version')->where('os_type', $osType)->orderBy('create_time', 'desc')->paginate($pageinfo->length);\n return $list;\n }",
"public function getVersionList()\n {\n /** @var Concrete\\Core\\File\\File $instance */\n return $instance->getVersionList();\n }",
"public function getVersionsList() {\n\t\t$versionsList = $this->detailsDialogElement->find(\n\t\t\t\"xpath\", $this->versionsListXpath\n\t\t);\n\t\t$this->assertElementNotNull(\n\t\t\t$versionsList,\n\t\t\t__METHOD__ .\n\t\t\t\" could not find versions list for current file\"\n\t\t);\n\t\t$this->waitTillElementIsNotNull($this->versionsListXpath);\n\t\treturn $versionsList;\n\t}",
"public static function get_versions()\n\t{\n\t\t$result = array();\n\n\t\t$modules = Module_Manager::get_modules(false);\n\t\tforeach ($modules as $module)\n\t\t{\n\t\t\t$module_id = $module->get_module_info()->id;\n\t\t\t$version = self::get_db_version($module_id);\n\t\t\t$result[$module_id] = $version;\n\t\t}\n\n\t\treturn $result;\n\t}",
"public function getVersion() {\r\n\t\t$vers = array ();\r\n\t\t$vers[] = 'MediaWiki ' . SpecialVersion::getVersion();\r\n\t\t$vers[] = __CLASS__ . ': $Id: ApiMain.php 24494 2007-07-31 17:53:37Z yurik $';\r\n\t\t$vers[] = ApiBase :: getBaseVersion();\r\n\t\t$vers[] = ApiFormatBase :: getBaseVersion();\r\n\t\t$vers[] = ApiQueryBase :: getBaseVersion();\r\n\t\t$vers[] = ApiFormatFeedWrapper :: getVersion(); // not accessible with format=xxx\r\n\t\treturn $vers;\r\n\t}",
"public function getVersions () {\r\n\t$this->ensureLoggedIn();\r\n\r\n\treturn $this->request(array('req' => 'getversions'));\r\n\t}",
"function get_product_list()\n\t{\n\t\t$product_list = $this->object->get_registry()->get_product_list();\n\t\t$version_list = array();\n\n\t\tforeach ($product_list as $product_id)\n\t\t{\n\t\t\t$product = $this->object->get_registry()->get_product($product_id);\n\n\t\t\t$version_list[$product_id] = $product->module_version;\n\t\t}\n\n\t\treturn $version_list;\n\t}",
"public function getAllLinearVersions();",
"function admin_cms_update_file_list($version)\n\t{\n\t\tglobal $_cms_update, $_cms_domain, $_cms_check;\n\t\tif ($_cms_update == \"\") return array();\n\t\t$url = $_cms_update . \"domain=$_cms_domain&check=$_cms_check&do=cms_update_file_list&module=$module&version=$version&v=2\";\n\t\t// Åbner forbindelse\n\t\tif ($fp = @fopen($url, \"r\"))\n\t\t{\n\t\t\t// Henter data\n\t\t\t$data = \"\";\n\t\t\twhile (!feof($fp)) $data .= fread($fp, 1024);\n\t\t\t// Lukker forbindelse\n\t\t\tfclose($fp);\n\t\t\t// Behandler data\n\t\t\t$data = str_replace(\"\\r\", \"\", $data);\n\t\t\t$array1 = split(\"[\\n]\", $data);\n\t\t\t$array2 = array();\n\t\t\tfor ($i = 0; $i < count($array1); $i++)\n\t\t\t{\n\t\t\t\t$array3 = split(\"[|]\", $array1[$i]);\n\t\t\t\tif ($array3[1] <> \"\") $array2[count($array2)] = $array3;\n\t\t\t}\n\t\t\t// Returnerer modul-liste\n\t\t\treturn $array2;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Returnerer fejl\n\t\t\treturn array();\n\t\t}\n\t}",
"public function getVersionOrder();",
"public function getInstallerVersions(){\n try {\n $result = file_get_contents(\"https://redcap.vanderbilt.edu/plugins/redcap_consortium/versions.php\");\n $results = json_decode($result,true);\n $opt_groups = array();\n foreach ($results as $branch => $versions) {\n $options = array();\n if (!is_array($versions)) continue;\n foreach ($versions as $version) {\n $val = $branch . \"--\" . $version['version_number'];\n $options[] = \"<option value='$val'>v\" .\n $version['version_number'] .\n \" Released \" . $version['release_date'] .\n (empty($version['release_notes']) ? \"\" : \" (\" . $version['release_notes'] . \")\" ) .\n \"</option>\";\n }\n // Add them in reverse order so STD goes before LTS\n array_unshift($opt_groups,\"<optgroup label='$branch'>\" . implode(\"\", $options) . \"</optgroup>\");\n }\n $result = implode(\"\",$opt_groups);\n } catch (RuntimeException $e) {\n $this->errors[] = $e->getMessage() . \" in \" . __FUNCTION__;\n $result = false;\n }\n return $result;\n }",
"public function APIVersions(){\n $dir = Config::inst()->get('Swagger', 'data_dir');\n $api_data_dir = (isset($dir)) ? Director::baseFolder().$dir : Director::baseFolder().\"/assets/api\";\n if (file_exists($api_data_dir)){\n $dirlist = array();\n foreach (new DirectoryIterator($api_data_dir) as $subdir) {\n if($subdir->isDir() && !$subdir->isDot())\n $dirlist[] = strtolower($subdir->getFileName());\n }\n if (count($dirlist) > 0){\n sort($dirlist);\n $out = new ArrayList();\n for ($pos = 0; $pos < count($dirlist); $pos++){\n $out->push(new ArrayData(array(\n \"Path\" => $dirlist[$pos],\n \"Name\" => str_replace('v', 'version ', $dirlist[$pos]),\n \"Selected\" => (($pos === count($dirlist) - 1) ? 'selected' : '')\n )));\n }\n return $out;\n }\n }\n return null;\n }",
"public function getAvailableVersions()\n {\n return array($this->getCurrentVersion());\n }",
"private function get_versions() {\n $versions = array();\n $versions['sdk_version'] = $this->version;\n\n // Collect these diagnostic information only if it's allowed.\n if ( FS_Permission_Manager::instance( $this )->is_diagnostic_tracking_allowed() ) {\n $versions['platform_version'] = get_bloginfo( 'version' );\n $versions['programming_language_version'] = phpversion();\n }\n\n foreach ( $versions as $k => $version ) {\n $versions[ $k ] = self::get_api_sanitized_property( $k, $version );\n }\n\n return $versions;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set Statements value This property is removable from request (nillable=true+minOccurs=0), therefore if the value assigned to this property is null, it is removed from this object | public function setStatements(\Mu4ddi3\Compensa\Webservice\ArrayType\ArrayOfCompensaStatement $statements = null)
{
if (is_null($statements) || (is_array($statements) && empty($statements))) {
unset($this->Statements);
} else {
$this->Statements = $statements;
}
return $this;
} | [
"public function setStatements(\\Mu4ddi3\\Compensa\\Webservice\\ArrayType\\ArrayOfStatement $statements = null)\n {\n if (is_null($statements) || (is_array($statements) && empty($statements))) {\n unset($this->Statements);\n } else {\n $this->Statements = $statements;\n }\n return $this;\n }",
"public function setStatements(array $statements);",
"public static function resetStatements()\n {\n static::$statements = static::makeStatementCollection();\n }",
"public function setStatement(\\CGROSS\\Drinkaccounting\\Domain\\Model\\Statement $statement) {\n\t\t$this->statement = $statement;\n\t}",
"public function setDelete($statement) {\n\t \n\t $this->delete = $statement;\n\t }",
"public function unsetStatementDescription(): void\n {\n $this->statementDescription = [];\n }",
"public function testSetValuesException()\n {\n $this->stmt->setValues($this->values);\n }",
"function setStatements(array $statements){\n\t\t$this->statements = array();\n\t\tforeach($statements as $k => $statement){\n\n\t\t\tif(is_numeric($k)){\n\t\t\t\t$select_as = null;\n\t\t\t} else {\n\t\t\t\t$select_as = $k;\n\t\t\t}\n\t\t\t$this->addStatement($statement, $select_as);\n\t\t}\n\t\t\n\t\treturn $this;\n\t}",
"public function setStatementDescription(?string $statementDescription): void\n {\n $this->statementDescription['value'] = $statementDescription;\n }",
"public function setAcceptanceStatement(?string $value): void {\n $this->getBackingStore()->set('acceptanceStatement', $value);\n }",
"function setStatements(&$statements, $replace = METADATA_DESCRIPTION_REPLACE_PROPERTIES) {\n\t\tassert(in_array($replace, $this->_allowedReplaceLevels()));\n\n\t\t// Make a backup copy of all existing statements.\n\t\t$statementsBackup = $this->getAllData();\n\n\t\tif ($replace == METADATA_DESCRIPTION_REPLACE_ALL) {\n\t\t\t// Delete existing statements\n\t\t\t$emptyArray = array();\n\t\t\t$this->setAllData($emptyArray);\n\t\t}\n\n\t\t// Add statements one by one to detect invalid values.\n\t\tforeach($statements as $propertyName => $content) {\n\t\t\tassert(!empty($content));\n\n\t\t\t// Transform scalars or translated fields to arrays so that\n\t\t\t// we can handle properties with different cardinalities in\n\t\t\t// the same way.\n\t\t\tif (is_scalar($content) || is_string(key($content))) {\n\t\t\t\t$values = array(&$content);\n\t\t\t} else {\n\t\t\t\t$values =& $content;\n\t\t\t}\n\n\t\t\tif ($replace == METADATA_DESCRIPTION_REPLACE_PROPERTIES) {\n\t\t\t\t$replaceProperty = true;\n\t\t\t} else {\n\t\t\t\t$replaceProperty = false;\n\t\t\t}\n\n\t\t\t$valueIndex = 0;\n\t\t\tforeach($values as $value) {\n\t\t\t\t$firstValue = ($valueIndex == 0) ? true : false;\n\t\t\t\t// Is this a translated property?\n\t\t\t\tif (is_array($value)) {\n\t\t\t\t\tforeach($value as $locale => $translation) {\n\t\t\t\t\t\t// Handle cardinality many and one in the same way\n\t\t\t\t\t\tif (is_scalar($translation)) {\n\t\t\t\t\t\t\t$translationValues = array(&$translation);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$translationValues =& $translation;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$translationIndex = 0;\n\t\t\t\t\t\tforeach($translationValues as $translationValue) {\n\t\t\t\t\t\t\t$firstTranslation = ($translationIndex == 0) ? true : false;\n\t\t\t\t\t\t\t// Add a statement (replace existing statement if any)\n\t\t\t\t\t\t\tif (!($this->addStatement($propertyName, $translationValue, $locale, $firstTranslation && $replaceProperty))) {\n\t\t\t\t\t\t\t\t$this->setAllData($statementsBackup);\n\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tunset($translationValue);\n\t\t\t\t\t\t\t$translationIndex++;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tunset($translationValues);\n\t\t\t\t\t}\n\t\t\t\t\tunset($translation);\n\t\t\t\t} else {\n\t\t\t\t\t// Add a statement (replace existing statement if any)\n\t\t\t\t\tif (!($this->addStatement($propertyName, $value, null, $firstValue && $replaceProperty))) {\n\t\t\t\t\t\t$this->setAllData($statementsBackup);\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tunset($value);\n\t\t\t\t$valueIndex++;\n\t\t\t}\n\t\t\tunset($values);\n\t\t}\n\t\treturn true;\n\t}",
"function XMLDBStatement($name) {\n parent::XMLDBObject($name);\n $this->table = NULL;\n $this->type = XMLDB_STATEMENT_INCORRECT;\n $this->sentences = array();\n }",
"public function setValue($value)\n {\n parent::setValue(\"\");\n }",
"function setnoValue($s)\n {\n $this->noValue = $s;\n }",
"public function getStatements()\n\t{\n\t\treturn $this->statements;\n\t}",
"public function setSQLStatement($sqlStatement){ }",
"public function getStatements()\n {\n return $this->statements;\n }",
"public function set($value) {}",
"public function setSmsUnits(?int $value): void {\n $this->getBackingStore()->set('smsUnits', $value);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Filter the query on the ArspYtdCommPaid column Example usage: $query>filterByArspytdcommpaid(1234); // WHERE ArspYtdCommPaid = 1234 $query>filterByArspytdcommpaid(array(12, 34)); // WHERE ArspYtdCommPaid IN (12, 34) $query>filterByArspytdcommpaid(array('min' => 12)); // WHERE ArspYtdCommPaid > 12 | public function filterByArspytdcommpaid($arspytdcommpaid = null, $comparison = null)
{
if (is_array($arspytdcommpaid)) {
$useMinMax = false;
if (isset($arspytdcommpaid['min'])) {
$this->addUsingAlias(ArSaleper1TableMap::COL_ARSPYTDCOMMPAID, $arspytdcommpaid['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($arspytdcommpaid['max'])) {
$this->addUsingAlias(ArSaleper1TableMap::COL_ARSPYTDCOMMPAID, $arspytdcommpaid['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(ArSaleper1TableMap::COL_ARSPYTDCOMMPAID, $arspytdcommpaid, $comparison);
} | [
"public function limitToPaid() {\n\t\t$this->whereClauseParts['paid'] = SEMINARS_TABLE_ATTENDANCES .\n\t\t\t'.datepaid != 0';\n\t}",
"public function filterByPaid($value)\n {\n $this->builder->where('paid', $value === 'paid');\n }",
"public function filterByPaidamount($paidamount = null, $comparison = null)\n\t{\n\t\tif (is_array($paidamount)) {\n\t\t\t$useMinMax = false;\n\t\t\tif (isset($paidamount['min'])) {\n\t\t\t\t$this->addUsingAlias(CustomerreceiptsPeer::PAIDAMOUNT, $paidamount['min'], Criteria::GREATER_EQUAL);\n\t\t\t\t$useMinMax = true;\n\t\t\t}\n\t\t\tif (isset($paidamount['max'])) {\n\t\t\t\t$this->addUsingAlias(CustomerreceiptsPeer::PAIDAMOUNT, $paidamount['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(CustomerreceiptsPeer::PAIDAMOUNT, $paidamount, $comparison);\n\t}",
"public function filterByPaidamount($paidamount = null, $comparison = null)\n {\n if (is_array($paidamount)) {\n $useMinMax = false;\n if (isset($paidamount['min'])) {\n $this->addUsingAlias(CustomerreceiptsPeer::PAIDAMOUNT, $paidamount['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($paidamount['max'])) {\n $this->addUsingAlias(CustomerreceiptsPeer::PAIDAMOUNT, $paidamount['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(CustomerreceiptsPeer::PAIDAMOUNT, $paidamount, $comparison);\n }",
"public function filterByPaidDate($paidDate = null, $comparison = null)\n {\n if (is_array($paidDate)) {\n $useMinMax = false;\n if (isset($paidDate['min'])) {\n $this->addUsingAlias(UserCouponsPeer::PAID_DATE, $paidDate['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($paidDate['max'])) {\n $this->addUsingAlias(UserCouponsPeer::PAID_DATE, $paidDate['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(UserCouponsPeer::PAID_DATE, $paidDate, $comparison);\n }",
"public function filterByPaid($paid = null, $comparison = null)\n {\n if (is_string($paid)) {\n $paid = in_array(strtolower($paid), array('false', 'off', '-', 'no', 'n', '0', '')) ? false : true;\n }\n\n return $this->addUsingAlias(UserCouponsPeer::PAID, $paid, $comparison);\n }",
"protected function filter($c)\n {\n //FROM UNTIL SET (SERIAL_TYPE -> SERIAL)\n if ($this->hasRequestParameter('from')){ //ver que es YYYY-mm-dd\n $criterion = $c->getNewCriterion(MmPeer::PUBLICDATE, $this->getRequestParameter('from'), Criteria::GREATER_EQUAL);\n }\n \n if ($this->hasRequestParameter('until')){ //ver que es YYYY-mm-dd\n if (isset($criterion)){\n\t$criterion->addAnd($c->getNewCriterion(MmPeer::PUBLICDATE, $this->getRequestParameter('until'), Criteria::LESS_EQUAL));\n }else{\n\t$criterion = $c->getNewCriterion(MmPeer::PUBLICDATE, $this->getRequestParameter('until'), Criteria::LESS_EQUAL);\n }\n }\n \n if (isset($criterion)){\n $c->add($criterion);\n }\n\n if($this->hasRequestParameter('set')&&(is_int($this->getRequestParameter('set')))){\n $c->addJoin(MmPeer::SERIAL_ID, SerialPeer::ID);\n $c->add(SerialPeer::SERIAL_TYPE_ID, intval($this->getRequestParameter('set')));\n }\n\n\n if(($this->hasRequestParameter('set'))&&($ret = strstr($this->getRequestParameter('set'), ':('))){\n $c->addJoin(MmPeer::SERIAL_ID, SerialPeer::ID);\n $c->add(SerialPeer::SERIAL_TYPE_ID, intval($this->getRequestParameter('set')));\n\n $c->add(MmPeer::SERIAL_ID, intval(substr($ret, 2))); \n }\n\n }",
"public static function course_archive_wc_filter_paid( $query ){\n\n if( isset( $_GET['course_filter'] ) && 'paid' == $_GET['course_filter']\n && 'course' == $query->get( 'post_type') && $query->is_main_query() ){\n\n // get all the paid WooCommerce products that has regular\n // and sale price greater than 0\n // will be used later to check for course with the id as meta\n $paid_product_ids_with_sale = get_posts( array(\n 'post_type' => 'product',\n 'posts_per_page' => '1000',\n 'fields' => 'ids',\n 'meta_query'=> array(\n 'relation' => 'AND',\n array(\n 'key'=> '_regular_price',\n 'compare' => '>',\n 'value' => 0,\n ),\n array(\n 'key'=> '_sale_price',\n 'compare' => '>',\n 'value' => 0,\n ),\n ),\n ));\n\n // get all the paid WooCommerce products that has regular price\n // greater than 0 without a sale price\n // will be used later to check for course with the id as meta\n $paid_product_ids_without_sale = get_posts( array(\n 'post_type' => 'product',\n 'posts_per_page' => '1000',\n 'fields' => 'ids',\n 'meta_query'=> array(\n 'relation' => 'AND',\n array(\n 'key'=> '_regular_price',\n 'compare' => '>',\n 'value' => 0,\n ),\n array(\n 'key'=> '_sale_price',\n 'compare' => '=',\n 'value' => '',\n ),\n ),\n ));\n\n // combine products ID's with regular and sale price grater than zero and those without\n // sale but regular price greater than zero\n $woocommerce_paid_product_ids = array_merge( $paid_product_ids_with_sale, $paid_product_ids_without_sale );\n\n // setup the course meta query\n $meta_query = array(\n array(\n 'key' => '_course_woocommerce_product',\n 'value' => $woocommerce_paid_product_ids,\n 'compare' => 'IN',\n ),\n );\n\n // manipulate the query to return free courses\n $query->set('meta_query', $meta_query );\n\n }\n\n return $query;\n\n }",
"public function filterByAid($aid = null, $comparison = null)\n {\n if (is_array($aid)) {\n $useMinMax = false;\n if (isset($aid['min'])) {\n $this->addUsingAlias(AliPcTableMap::COL_AID, $aid['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($aid['max'])) {\n $this->addUsingAlias(AliPcTableMap::COL_AID, $aid['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(AliPcTableMap::COL_AID, $aid, $comparison);\n }",
"public function filterByArspltdcommpaid($arspltdcommpaid = null, $comparison = null)\n {\n if (is_array($arspltdcommpaid)) {\n $useMinMax = false;\n if (isset($arspltdcommpaid['min'])) {\n $this->addUsingAlias(ArSaleper2TableMap::COL_ARSPLTDCOMMPAID, $arspltdcommpaid['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($arspltdcommpaid['max'])) {\n $this->addUsingAlias(ArSaleper2TableMap::COL_ARSPLTDCOMMPAID, $arspltdcommpaid['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(ArSaleper2TableMap::COL_ARSPLTDCOMMPAID, $arspltdcommpaid, $comparison);\n }",
"function get_paid_for_students($paid_for=1,$financial_year_id,$programarea_id,$year,$scholarship_status=1, $page=0, $limit=0){ //i changed it from 'finacial_year_id' to 'financial_year_id'\n $not=\"\";\n if($paid_for==0){\n $not=\"NOT\";\n }\n \n //they should not be in payment request and they have tobe active\n $filter =\"ifnull(sp.`status`,0)=1 and `sponsored_student_id` $not IN (SELECT spack.`sponsored_student_sponsored_student_id` FROM \n scholarship_payment spay left join scholarship_package spack \n on spay.`scholarship_package_scholarship_package_id`=spack.`scholarship_package_id`\n left join payment_request p\n on spay.payment_request_payment_request_id=p.payment_request_id\n where p.`financial_year_financial_year_id`=$financial_year_id)\";\n \n if($programarea_id!=0){\n $filter.=\" and `programarea_id`=$programarea_id\";\n }\n \n if($year!=0){\n $filter.=\" and `app_submission_year`=$year\";\n }\n \n if($scholarship_status!=0){\n $filter.=\" and ifnull(sp.`status`,0)=$scholarship_status\";\n }\n \n $this->count=$this->get_students_count($filter);\n \n return $this->get_students($filter,$page,$limit);\n }",
"public function apply_active_filter()\n\t{\n\t\tif (isset($this->_table_columns[$this->_active_column]))\r\n\t\t{\r\n\t\t\t// Filter only active records\r\n\t\t\t$this->where($this->_object_name.'.'.$this->_active_column, '>', 0);\r\n\t\t}\n\t}",
"public function filterByPaidDate($paidDate = null, $comparison = null)\n {\n if (is_array($paidDate)) {\n $useMinMax = false;\n if (isset($paidDate['min'])) {\n $this->addUsingAlias(AdvPacketsPeer::PAID_DATE, $paidDate['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($paidDate['max'])) {\n $this->addUsingAlias(AdvPacketsPeer::PAID_DATE, $paidDate['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(AdvPacketsPeer::PAID_DATE, $paidDate, $comparison);\n }",
"public function apply_active_filter()\n\t{\n\t\tif (isset($this->_table_columns[$this->_active_column]))\n\t\t{\n\t\t\t// Filter only active records\n\t\t\t$this->where($this->_object_name.'.'.$this->_active_column, '>', 0);\n\t\t}\n\t}",
"function getItemsFiltered($alldata, $cdad, $tipo, $preciobj, $precioat) {\n $priceFilter = array_filter($alldata, function($val, $key) use ($preciobj, $precioat) {\n $priceNum = intval(str_replace(',','',substr($val['Precio'],1)));\n if($priceNum >= $preciobj and $priceNum <= $precioat) {\n return $priceNum;\n }\n }, ARRAY_FILTER_USE_BOTH);\n $cityFilter = $cdad != '' ? array_filter($priceFilter, function($val, $key) use ($cdad) {\n return $val['Ciudad'] == $cdad;\n }, ARRAY_FILTER_USE_BOTH) : $priceFilter;\n $typeFilter = $tipo != '' ? array_filter($cityFilter, function($val, $key) use ($tipo) {\n return $val['Tipo'] == $tipo;\n }, ARRAY_FILTER_USE_BOTH) : $cityFilter;\n return $typeFilter;\n}",
"function setRevenueFilter($min) {\n $this->WHERE['rev_avg >= '] = $min;\n }",
"public function filterPaymentMethods($query);",
"public function filterByApidptctry($apidptctry = null, $comparison = null)\n {\n if (null === $comparison) {\n if (is_array($apidptctry)) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(ApInvoiceDetailTableMap::COL_APIDPTCTRY, $apidptctry, $comparison);\n }",
"private static function priceFilter($array, $arguments) {\n $r_array = array();\n \n foreach($array as $entry) {\n if($entry->Price >= $arguments[0] && $entry->Price <= $arguments[1])\n array_push($r_array, $entry);\n }\n \n return $r_array;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns a gradient value string. Must be passed a gradient setting array from a gradient field. | static public function gradient( $setting ) {
$gradient = '';
$values = array();
if ( ! is_array( $setting ) ) {
return $gradient;
}
foreach ( $setting['colors'] as $i => $color ) {
$stop = $setting['stops'][ $i ];
if ( empty( $color ) ) {
$color = 'rgba(255,255,255,0)';
}
if ( ! strstr( $color, 'rgb' ) ) {
$color = '#' . $color;
}
if ( ! is_numeric( $stop ) ) {
$stop = 0;
}
$values[] = $color . ' ' . $stop . '%';
}
$values = implode( ', ', $values );
if ( 'linear' === $setting['type'] ) {
if ( ! is_numeric( $setting['angle'] ) ) {
$setting['angle'] = 0;
}
$gradient = 'linear-gradient(' . $setting['angle'] . 'deg, ' . $values . ')';
} else {
$gradient = 'radial-gradient(at ' . $setting['position'] . ', ' . $values . ')';
}
return $gradient;
} | [
"public function get_string() {\n\t\tif ( empty( $this->color_stops ) ) {\n\t\t\treturn '';\n\t\t}\n\n\t\treturn $this->angle . ', ' . implode( ', ', $this->color_stops );\n\t}",
"function encode_gradient( $value ) {\n // don't try this at home, kids\n $regex = '/gradient[^\\)]*?\\( #exp descr\n ( #[1]\n ( #[2]\n (to\\x20)? #[3] reverse\n (top|bottom|left|right)? #[4] direction1\n (\\x20 #[5]\n (top|bottom|left|right))? #[6] direction2\n |\\d+deg),)? # or angle\n (color-stop\\()? #[7] optional\n ([^\\w\\#\\)]*[\\'\"]? #[8]\n (\\#\\w{3,8} #[9] color (hex)\n |rgba?\\([\\d.,\\x20]+?\\) # red green blue (alpha)\n |hsla?\\([\\d%.,\\x20]+?\\) # hue sat. lum. (alpha)\n |[a-z]+) # color (name)\n (\\x20+[\\d.]+%?)?) #[10] stop position\n (\\),\\x20*)? #[11] optional close\n (color-stop\\()? #[12] optional\n ([^\\w\\#\\)]*[\\'\"]? #[13]\n (\\#\\w{3,8} #[14] color (hex)\n |rgba?\\([\\d.,\\x20]+?\\) # red green blue (alpha)\n |hsla?\\([\\d%.,\\x20]+?\\) # hue sat. lum. (alpha)\n |[a-z]+) # color (name)\n (\\x20+[\\d.]+%?)?) #[15] stop position\n (\\))? #[16] optional close\n ([^\\w\\)]*gradienttype=[\\'\"]? #[17] IE\n (\\d) #[18] IE\n [\\'\"]?)? # IE\n [^\\w\\)]*\\)/ix';\n $param = $parts = array();\n preg_match( $regex, $value, $parts );\n //$this->ctc()->debug( 'gradient value: ' . $value . ' parts: ' . print_r( $parts, TRUE ), __FUNCTION__, __CLASS__ );\n if ( empty( $parts[ 18 ] ) ):\n if ( empty( $parts[ 2 ] ) ):\n $param[ 0 ] = 'top';\n elseif ( 'to ' == $parts[ 3 ] ):\n \n $param[ 0 ] = ( 'top' == $parts[ 4 ] ? 'bottom' :\n ( 'left' == $parts[ 4 ] ? 'right' : \n ( 'right' == $parts[ 4 ] ? 'left' : \n 'top' ) ) ) ;\n else: \n $param[ 0 ] = trim( $parts[ 2 ] );\n endif;\n if ( empty( $parts[ 10 ] ) ):\n $param[ 2 ] = '0%';\n else:\n $param[ 2 ] = trim( $parts[ 10 ] );\n endif;\n if ( empty( $parts[ 15 ] ) ):\n $param[ 4 ] = '100%';\n else:\n $param[ 4 ] = trim( $parts[ 15 ] );\n endif;\n elseif( '0' == $parts[ 18 ] ):\n $param[ 0 ] = 'top';\n $param[ 2 ] = '0%';\n $param[ 4 ] = '100%';\n elseif ( '1' == $parts[ 18 ] ): \n $param[ 0 ] = 'left';\n $param[ 2 ] = '0%';\n $param[ 4 ] = '100%';\n endif;\n if ( isset( $parts[ 9 ] ) && isset( $parts[ 14 ] ) ):\n $param[ 1 ] = $parts[ 9 ];\n $param[ 3 ] = $parts[ 14 ];\n ksort( $param );\n return implode( ':', $param );\n else:\n return $value;\n endif;\n }",
"function the7_less_prepare_gradient_var( $gradient ) {\n\tif ( is_a( $gradient, 'The7_Less_Gradient' ) ) {\n\t\t$gradient_obj = $gradient;\n\t} else {\n\t\t$gradient_obj = the7_less_create_gradient_obj( $gradient );\n\t}\n\n\treturn array(\n\t\t$gradient_obj->get_color_stop( 1 )->get_color(),\n\t\t$gradient_obj->get_string(),\n\t);\n}",
"function gradient()\n{\n $gradients = array(\n array(\"#bc4e9c\", \"#f80759\"),\n array(\"#40E0D0\", \"#FF8C00\", \"#FF0080\"),\n array(\"#11998e\", \"#38ef7d\"),\n array(\"#108dc7\", \"#ef8e38\"),\n array(\"#FC5C7D\", \"#6A82FB\"),\n array(\"#FC466B\", \"#3F5EFB\"),\n array(\"#fffbd5\", \"#b20a2c\"),\n array(\"#00b09b\", \"#96c93d\"),\n array(\"#D3CCE3\", \"#E9E4F0\"),\n array(\"#800080\", \"#ffc0cb\"),\n array(\"#00F260\", \"#0575E6\"),\n array(\"#fc4a1a\", \"#f7b733\"),\n array(\"#74ebd5\", \"#ACB6E5\"),\n array(\"#ff9966\", \"#ff5e62\"),\n array(\"#3A1C71\", \"#D76D77\", \"#FFAF7B\"),\n\n array(\"#667db6\", \"#0082c8\", \"#0082c8\", \"#667db6\"),\n );\n\n $gr = $gradients[array_rand($gradients)];\n $renkstr = implode(\",\", $gr);\n return \"background: linear-gradient(to right, $renkstr);\";\n}",
"public function getComponentsString()\n {\n $rgb = $this->toRgbArray();\n return sprintf('%F %F %F', $rgb['red'], $rgb['green'], $rgb['blue']);\n }",
"public function getOutGradientResources()\n {\n if ($this->pdfa || empty($this->gradients)) {\n return '';\n }\n $grp = '';\n $grs = '';\n foreach ($this->gradients as $idx => $grad) {\n // gradient patterns\n $grp .= ' /p'.$idx.' '.$grad['pattern'].' 0 R';\n // gradient shadings\n $grs .= ' /Sh'.$idx.' '.$grad['id'].' 0 R';\n }\n return ' /Pattern <<'.$grp.' >>'.\"\\n\"\n .' /Shading <<'.$grs.' >>'.\"\\n\";\n }",
"public function getColorAsString () {}",
"public function getHeatIndexStr() {\r\n return isset($this->_heatIndexStr) ? $this->_heatIndexStr :\r\n $this->_heatIndexF . \"° F\" . \" (\" .\r\n round($this->convertF2C($this->_heatIndexF), 1) . \"° C)\";\r\n }",
"protected function _getGradientEndColour() {\n $base_colour = $this->_getColour();\n $colour = \"\";\n foreach (array(0, 2, 4) as $pos) {\n $rgb_val = hexdec(substr($base_colour, $pos, 2));\n $rgb_val = max(0, min(255, $rgb_val - (self::GRADIENT_COLOUR_STEP / 2)));\n $colour .= str_pad(dechex($rgb_val), 2, \"0\", STR_PAD_LEFT);\n }\n return $colour;\n }",
"public function getBackgroundGradientCSS()\n {\n $colors = Identity::get_colors('rgb');\n return\n \"linear-gradient(\" .\n $this->config()->gradient_direction . ',' .\n \"rgba({$colors['primary-gradient-start']}, \" . $this->config()->gradient_start_opacity . \"),\" .\n \"rgba({$colors['primary-gradient-end']}, \" . $this->config()->gradient_end_opacity . \")\" .\n \")\";\n }",
"public function __toString(): string\n {\n $color = new Color($this->fgColor, $this->bgColor, $this->options);\n\n return $color->apply($this->value);\n }",
"public function getColorValue(): string\n {\n return $this->input['params']['color'];\n }",
"function string() {\n $styles = [];\n if ($this->fg !== null) {\n $styles []= $this->fg;\n }\n\n if ($this->bg !== null) {\n $styles []= $this->bg;\n }\n\n $styles = array_merge($styles, $this->format);\n\n if (empty($styles)) {\n return $this->str;\n } else {\n $escape = \"\\e[\" . join(';', $styles) . 'm';\n return $escape . $this->str . \"\\e[\" . self::ANSI_OFF . 'm';\n }\n }",
"function toGradientCss(array $a) // four element numeric array $a[0] left red, $a[1] left green, $a[2] right red, $a[3] rigit green\n{\necho <<<_CSS\n\n\t\tbackground: -webkit-linear-gradient(to right, rgba($a[0], $a[1], 0, 0.7), rgba($a[2], $a[3], 0, 1));\n\t\tbackground: -o-linear-gradient(to right, rgba($a[0], $a[1], 0, 0.7), rgba($a[2], $a[3], 0, 1));\n\t\tbackground: -moz-linear-gradient(to right, rgba($a[0], $a[1], 0, 0.7), rgba($a[2], $a[3], 0, 1));\n\t\tbackground: linear-gradient(to right, rgba($a[0], $a[1], 0, 0.7), rgba($a[2], $a[3], 0, 1));\n\n_CSS;\n}",
"public function getStringRepresentation() {\n $r = '';\n foreach ($this->lifeCoords as $x => $col) {\n foreach ($col as $y => $unused) {\n $r .= '{' . $x . '-' . $y . '}';\n }\n }\n return $r;\n }",
"private function FlagsString()\n {\n $result = '';\n foreach ($this->flags as $flag)\n {\n if ($result)\n {\n $result .= ',';\n }\n $result .= $flag->ToString();\n }\n if ($result)\n {\n $result = '[' . $result . ']';\n }\n return $result;\n }",
"function _getFillStyle($fillStyle = false)\n {\n $result = '';\n if ($fillStyle === false) {\n $fillStyle = $this->_fillStyle;\n }\n\n if (is_array($fillStyle)) {\n if ($fillStyle['type'] == 'gradient') {\n $id = 'gradient_' . ($this->_id++);\n $startColor = $this->_color($fillStyle['start']);\n $endColor = $this->_color($fillStyle['end']);\n $startOpacity = $this->_opacity($fillStyle['start']);\n $endOpacity = $this->_opacity($fillStyle['end']);\n\n switch ($fillStyle['direction']) {\n case 'horizontal':\n case 'horizontal_mirror':\n $x1 = '0%';\n $y1 = '0%';\n $x2 = '100%';\n $y2 = '0%';\n break;\n\n case 'vertical':\n case 'vertical_mirror':\n $x1 = '0%';\n $y1 = '100%';\n $x2 = '0%';\n $y2 = '0%';\n break;\n\n case 'diagonal_tl_br':\n $x1 = '0%';\n $y1 = '0%';\n $x2 = '100%';\n $y2 = '100%';\n break;\n\n case 'diagonal_bl_tr':\n $x1 = '0%';\n $y1 = '100%';\n $x2 = '100%';\n $y2 = '0%';\n break;\n\n case 'radial':\n $cx = '50%';\n $cy = '50%';\n $r = '100%';\n $fx = '50%';\n $fy = '50%';\n break;\n\n }\n\n if ($fillStyle['direction'] == 'radial') {\n $this->_addDefine(\n '<radialGradient id=\"' . $id . '\" cx=\"' .\n $cx .'\" cy=\"' . $cy .'\" r=\"' . $r .'\" fx=\"' .\n $fx .'\" fy=\"' . $fy .'\">'\n );\n $this->_addDefine(\n ' <stop offset=\"0%\" style=\"stop-color:' .\n $startColor. ';' . ($startOpacity ? 'stop-opacity:' .\n $startOpacity . ';' : ''). '\"/>'\n );\n $this->_addDefine(\n ' <stop offset=\"100%\" style=\"stop-color:' .\n $endColor. ';' . ($endOpacity ? 'stop-opacity:' .\n $endOpacity . ';' : ''). '\"/>'\n );\n $this->_addDefine(\n '</radialGradient>'\n );\n } elseif (($fillStyle['direction'] == 'vertical_mirror') ||\n ($fillStyle['direction'] == 'horizontal_mirror'))\n {\n $this->_addDefine(\n '<linearGradient id=\"' . $id . '\" x1=\"' .\n $x1 .'\" y1=\"' . $y1 .'\" x2=\"' . $x2 .'\" y2=\"' .\n $y2 .'\">'\n );\n $this->_addDefine(\n ' <stop offset=\"0%\" style=\"stop-color:' .\n $startColor. ';' . ($startOpacity ? 'stop-opacity:' .\n $startOpacity . ';' : ''). '\"/>'\n );\n $this->_addDefine(\n ' <stop offset=\"50%\" style=\"stop-color:' .\n $endColor. ';' . ($endOpacity ? 'stop-opacity:' .\n $endOpacity . ';' : ''). '\"/>'\n );\n $this->_addDefine(\n ' <stop offset=\"100%\" style=\"stop-color:' .\n $startColor. ';' . ($startOpacity ? 'stop-opacity:' .\n $startOpacity . ';' : ''). '\"/>'\n );\n $this->_addDefine(\n '</linearGradient>'\n );\n } else {\n $this->_addDefine(\n '<linearGradient id=\"' . $id . '\" x1=\"' .\n $x1 .'\" y1=\"' . $y1 .'\" x2=\"' . $x2 .'\" y2=\"' .\n $y2 .'\">'\n );\n $this->_addDefine(\n ' <stop offset=\"0%\" style=\"stop-color:' .\n $startColor. ';' . ($startOpacity ? 'stop-opacity:' .\n $startOpacity . ';' : ''). '\"/>'\n );\n $this->_addDefine(\n ' <stop offset=\"100%\" style=\"stop-color:' .\n $endColor. ';' . ($endOpacity ? 'stop-opacity:' .\n $endOpacity . ';' : ''). '\"/>'\n );\n $this->_addDefine(\n '</linearGradient>'\n );\n }\n\n return 'fill:url(#' . $id . ');';\n }\n } elseif (($fillStyle != 'transparent') && ($fillStyle !== false)) {\n $result = 'fill:' . $this->_color($fillStyle) . ';';\n if ($opacity = $this->_opacity($fillStyle)) {\n $result .= 'fill-opacity:' . $opacity . ';';\n }\n return $result;\n } else {\n return 'fill:none;';\n }\n }",
"public function __toString() \n {\n \n return (string)$this->floatValue;\n \n }",
"public function getEdgesString()\n {\n $string = '';\n\n foreach($this->tour as $edge) {\n $string .= sprintf(\"(%s, %s, %s) \", $edge->getFirst(), $edge->getSecond(), $edge->getWeight());\n }\n\n return $string;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the chatInfo The chat information. Required information for meeting scenarios. | public function getChatInfo()
{
if (array_key_exists("chatInfo", $this->_propDict)) {
if (is_a($this->_propDict["chatInfo"], "\Beta\Microsoft\Graph\Model\ChatInfo") || is_null($this->_propDict["chatInfo"])) {
return $this->_propDict["chatInfo"];
} else {
$this->_propDict["chatInfo"] = new ChatInfo($this->_propDict["chatInfo"]);
return $this->_propDict["chatInfo"];
}
}
return null;
} | [
"public function getChatInfo(){\n $update = json_decode(file_get_contents(\"php://input\"), true);\n $chatID = $update[\"message\"][\"chat\"][\"id\"];\n $message = $update[\"message\"][\"text\"];\n $this->updateChatList($chatID);\n\n return array('chatID' => $chatID, 'message' => $message);\n }",
"public function chat()\n {\n return $this->message()->chat ?? null;\n }",
"public function getChatInfo(int $chatId): array;",
"public function getChatId()\n {\n return array_get($this->get('message'), 'chat.id');\n }",
"protected function updateChatInfo()\n {\n $this->setChatConfig('info', $this->getContext()->getChat()->toJson(true));\n }",
"private function get_chat_data ()\n\t{\n\t\t$html = $this->get_html(\"https://rstforums.com/chat/?ajax=true&lastID={$this->lastID}\");\n\n\t\tif ($xml = simplexml_load_string($html, null, LIBXML_NOCDATA))\n\t\t{\n\t\t\t$this->users = $xml->users->user ? $xml->users->user : null;\n\t\t\t$this->messages = $xml->messages->message ? $xml->messages->message : null;\n\t\t\t$this->lastID = $this->messages[count($this->messages) - 1];\n\t\t\t\n\t\t\tif ($this->messages !== null)\n\t\t\t\t$this->channel = $this->messages[0]->attributes()->channelID == 69 ? 'RSTech' : 'RST';\n\t\t}\n\t\telse\n\t\t\t$this->log('Could not get the messages!');\n\t}",
"public function getChat()\n {\n return $this->hasOne(Chat::class, ['id' => 'chat_id'])\n ->private()\n ->viaTable(ChatMember::tableName(), ['user_id' => 'id']);\n }",
"public function getChatRoomData()\n {\n $value = $this->get(self::CHATROOMDATA);\n return $value === null ? (string)$value : $value;\n }",
"public function getChatId()\n {\n return $this->get(self::_CHAT_ID);\n }",
"public function setChatInfo($val)\n {\n $this->_propDict[\"chatInfo\"] = $val;\n return $this;\n }",
"public function getFriendChat() {\n //Call from auto ?\n $bIsAuto = (boolean) $this->get('auto');\n //Paging\n if (!$sPage = $this->get('p')) {\n $sPage = 1;\n }\n if (!$iSize = $this->get('size')) {\n $iSize = 0;\n }\n /** @var Messenger_Service_Process $oProcess */\n $oProcess = Phpfox::getService('messenger.process');\n $aFriends = $oProcess->getChatFriend(Phpfox::getUserId(), $sPage, $iSize);\n if (count($aFriends) < $oProcess->getDefaultPageSize() || empty($aFriends)) {\n $sPage = 0; // Paging end\n } else {\n $sPage += 1; // Page next\n }\n $aData = array(\n 'is_first' => $this->get('p') ? false : true,\n // --> Chat paging info\n 'page_size' => $oProcess->getDefaultPageSize(),\n 'page_next' => $sPage,\n // --> flag as this request is reload from server\n 'auto' => $bIsAuto,\n // --> Convert minute to second\n 'reload_interval' => $oProcess->getChatCacheTime() * 60,\n // End reload options\n // --> Friends is an array of data which contain in chat main\n 'friends' => array(),\n );\n $aData['friends'] = $oProcess->buildFriendListJson($aFriends);\n\n $this->call('$Core.betterMobileMessengerHandle.getFriends(' . json_encode($aData) . ');');\n }",
"public function getNewChatroomData()\n {\n return $this->get(self::NEWCHATROOMDATA);\n }",
"public function getTelegramChatId();",
"public function getTeamChatMessages()\n {\n if (array_key_exists(\"teamChatMessages\", $this->_propDict)) {\n return $this->_propDict[\"teamChatMessages\"];\n } else {\n return null;\n }\n }",
"public function ChatID()\n {\n $type = $this->getUpdateType();\n if ($type == self::CALLBACK_QUERY) {\n return @$this->data['callback_query']['message']['chat']['id'];\n }\n if ($type == self::CHANNEL_POST) {\n return @$this->data['channel_post']['chat']['id'];\n }\n if ($type == self::EDITED_MESSAGE) {\n return @$this->data['edited_message']['chat']['id'];\n }\n if ($type == self::INLINE_QUERY) {\n return @$this->data['inline_query']['from']['id'];\n }\n\n return $this->data['message']['chat']['id'];\n }",
"public function getChatId(): int\n {\n return $this->chatId;\n }",
"public function Callback_ChatID()\n {\n return $this->data['callback_query']['message']['chat']['id'];\n }",
"function getChat() {\n\t\t//Get time of last check.\n\t\t//If time is not set, assume this is the first time, and set a time stamp.\n\t\tif (!isset($_SESSION['lastPing'])) {\n\t\t\t$_SESSION['lastPing'] = $this->microtime_milli();\n\t\t}\n\t\t\n\t\t$pingTime = $_SESSION['lastPing'];\n\t\t$query = \"SELECT name, message, timestamp \n\t\t\t\t\tFROM \".SQL_PREFIX.\"chat \n\t\t\t\t\tWHERE timestamp > ? \n\t\t\t\t\tORDER BY timestamp ASC\";\n\t\t\t\t\t\n\t\tif($stmt = $this->mysqli->prepare($query)) {\n\t\t\t$_SESSION['lastPing'] = $this->microtime_milli();\n\t\t\t$stmt->bind_param('d', $pingTime);\n\t\t\t$data = returnAssArray($stmt);\n\n\t\t\t$stmt->close();\n\n\t\t\treturn $data;\n\t\t}\n\t}",
"public function getMeetingChatEnabled()\n {\n if (array_key_exists(\"meetingChatEnabled\", $this->_propDict)) {\n return $this->_propDict[\"meetingChatEnabled\"];\n } else {\n return null;\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Query metadata Generated from protobuf field .Ydb.Table.QueryMeta query_meta = 3; | public function setQueryMeta($var)
{
GPBUtil::checkMessage($var, \Ydb\Table\QueryMeta::class);
$this->query_meta = $var;
return $this;
} | [
"private function preQueryMetaTables($query = 'all')\n {\n //Perhaps data already exists\n if ($this->metaTableQuery == true) {\n return;\n }\n\n global $wpdb;\n $tablePrefix = $wpdb->prefix;\n\n $sqlQueries = array(\n 'postmeta' => \"SELECT\n meta_value as attachment_id,\n meta_id as object_id,\n CASE WHEN meta_key = '_thumbnail_id' THEN 'thumbnail' ELSE 'postmeta' END as relation_type,\n meta_key,\n post_id\n FROM {$tablePrefix}postmeta LEFT JOIN {$tablePrefix}posts ON {$tablePrefix}postmeta.meta_value = {$tablePrefix}posts.ID\n WHERE {$tablePrefix}posts.post_type = 'attachment' AND {$tablePrefix}postmeta.meta_value REGEXP '^[0-9]+$';\",\n 'termmeta' => \"SELECT\n meta_value as attachment_id,\n meta_id as object_id,\n 'termmeta' as relation_type,\n meta_key,\n term_id\n FROM {$tablePrefix}termmeta LEFT JOIN {$tablePrefix}posts ON {$tablePrefix}termmeta.meta_value = {$tablePrefix}posts.ID\n WHERE {$tablePrefix}posts.post_type = 'attachment' AND {$tablePrefix}termmeta.meta_value REGEXP '^[0-9]+$';\",\n 'options' => \"SELECT\n option_value as attachment_id,\n option_id as object_id,\n 'option' as relation_type,\n option_name\n FROM {$tablePrefix}options LEFT JOIN {$tablePrefix}posts ON {$tablePrefix}options.option_value = {$tablePrefix}posts.ID\n WHERE {$tablePrefix}posts.post_type = 'attachment' AND {$tablePrefix}options.meta_value REGEXP '^[0-9]+$';\",\n );\n\n $sqlQueries = apply_filters('MediaUsage/Scanner/metaQueries', $sqlQueries, $query);\n error_log(print_r($sqlQueries['options'], true));\n\n foreach ($sqlQueries as $key => $sql) {\n if (is_string($query) && $query != 'all' && $key != $query || is_array($query) && !in_array($key, $query)) {\n continue;\n }\n\n if (get_transient('media_scanner_' . $key)) {\n $this->$key = get_transient('media_scanner_' . $key);\n continue;\n }\n\n $results = $wpdb->get_results($sql, ARRAY_A);\n $this->$key = $results;\n\n //Cache results\n set_transient('media_scanner_' . $key, $results, 1 * HOUR_IN_SECONDS);\n }\n\n //Let us know the data is avalible\n $this->metaTableQuery = true;\n }",
"public static function meta_query() {\n\t\treturn self::$meta_query ? : ( self::$meta_query = new MetaQueryType() );\n\t}",
"public function _getMetadata()\r\n\t{\t\r\n\t\tif ( $this->metainfo !== null ) \r\n\t\t{\r\n\t\t\t$response['fields'] = $this->fields;\r\n\t\t\t$response['primarykeys'] = $this->primarykeys;\r\n\t\t\t$response['metainfo'] = $this->metainfo;\r\n\t\t}else\r\n\t\t{\r\n\t\t\t$filename = \"models/metadata/$this->tablename.php\";\r\n\t\t\tif (file_exists($filename) )\r\n\t\t\t{\r\n\t\t\t\tinclude($filename);\r\n\r\n\t\t\t\treturn $metadata;\r\n\t\t\t}\r\n\t\t\t$conn = ORMConnection::getConnection(); \r\n\t\t\t$rs = $conn->MetaColumns($this->tablename,False);\r\n\t\r\n\t\t\tforeach($rs as $item)\r\n\t\t\t{\t\r\n\t\t\t\t$fields[$item->name]=null;\r\n\t\t\t\t$metainfo[$item->name]= (array)$item; //array(\"type\"=>$item->type,\"length\"=>$item->max_length);\r\n\t\t\t\tif (isset($item->primary_key) && $item->primary_key === true )\r\n\t\t\t\t{\r\n if(isset($item->auto_increment))\r\n\t\t\t\t\t$primarykeys[$item->name] = ($item->auto_increment===true)?-1:0;\r\n else\r\n $primarykeys[$item->name] = 0;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t//$metainfo = $rs;\r\n\t\t\t$response[\"fields\"] = &$fields;\r\n\t\t\t$response[\"primarykeys\"] = &$primarykeys;\r\n\t\t\t$response[\"metainfo\"] = &$metainfo;\r\n \r\n\t\t}\r\n\t\t\r\n\t\treturn $response;\r\n\t}",
"public static function get_main_meta_query()\n {\n }",
"public function addQuerySpecs(\\ElggMetadata $metadata) {\n\n\t\t// Return this metadata object when _elgg_get_metastring_based_objects() is called\n\t\t$e_access_sql = _elgg_get_access_where_sql(array('table_alias' => 'e'));\n\t\t$md_access_sql = _elgg_get_access_where_sql(array(\n\t\t\t'table_alias' => 'n_table',\n\t\t\t'guid_column' => 'entity_guid',\n\t\t));\n\n\t\t$dbprefix = elgg_get_config('dbprefix');\n\t\t$sql = \"SELECT DISTINCT n_table.*, n.string as name, v.string as value\n\t\t\tFROM {$dbprefix}metadata n_table\n\t\t\t\tJOIN {$dbprefix}entities e ON n_table.entity_guid = e.guid\n\t\t\t\tJOIN {$dbprefix}metastrings n on n_table.name_id = n.id\n\t\t\t\tJOIN {$dbprefix}metastrings v on n_table.value_id = v.id\n\t\t\t\tWHERE (n_table.id IN ({$metadata->id}) AND $md_access_sql) AND $e_access_sql\n\t\t\t\tORDER BY n_table.time_created ASC, n_table.id ASC, n_table.id\";\n\n\t\t$this->specs[$metadata->id][] = $this->db->addQuerySpec([\n\t\t\t'sql' => $sql,\n\t\t\t'results' => function() use ($metadata) {\n\t\t\t\treturn [$metadata];\n\t\t\t},\n\t\t]);\n\n\t\t$sql = \"INSERT INTO {$dbprefix}metadata\n\t\t\t\t(entity_guid, name_id, value_id, value_type, owner_guid, time_created, access_id)\n\t\t\t\tVALUES (:entity_guid, :name_id, :value_id, :value_type, :owner_guid, :time_created, :access_id)\";\n\n\t\t$this->specs[$metadata->id][] = $this->db->addQuerySpec([\n\t\t\t'sql' => $sql,\n\t\t\t'params' => [\n\t\t\t\t':entity_guid' => $metadata->entity_guid,\n\t\t\t\t':name_id' => elgg_get_metastring_id($metadata->name),\n\t\t\t\t':value_id' => elgg_get_metastring_id($metadata->value),\n\t\t\t\t':value_type' => $metadata->value_type,\n\t\t\t\t':owner_guid' => $metadata->owner_guid,\n\t\t\t\t':time_created' => $metadata->time_created,\n\t\t\t\t':access_id' => $metadata->access_id,\n\t\t\t],\n\t\t\t'insert_id' => $metadata->id,\n\t\t]);\n\n\t\t$sql = \"UPDATE {$dbprefix}metadata\n\t\t\tSET name_id = :name_id,\n\t\t\t value_id = :value_id,\n\t\t\t\tvalue_type = :value_type,\n\t\t\t\taccess_id = :access_id,\n\t\t\t owner_guid = :owner_guid\n\t\t\tWHERE id = :id\";\n\n\t\t$this->specs[$metadata->id][] = $this->db->addQuerySpec([\n\t\t\t'sql' => $sql,\n\t\t\t'params' => [\n\t\t\t\t':name_id' => elgg_get_metastring_id($metadata->name),\n\t\t\t\t':value_id' => elgg_get_metastring_id($metadata->value),\n\t\t\t\t':value_type' => $metadata->value_type,\n\t\t\t\t':owner_guid' => $metadata->owner_guid,\n\t\t\t\t':access_id' => $metadata->access_id,\n\t\t\t\t':id' => $metadata->id,\n\t\t\t],\n\t\t\t'row_count' => 1,\n\t\t]);\n\n\t\t// Enable/disable metadata\n\t\t$sql = \"UPDATE {$dbprefix}metadata SET enabled = :enabled where id = :id\";\n\n\t\t$this->specs[$metadata->id][] = $this->db->addQuerySpec([\n\t\t\t'sql' => $sql,\n\t\t\t'params' => [\n\t\t\t\t':id' => $metadata->id,\n\t\t\t\t':enabled' => 'yes',\n\t\t\t],\n\t\t\t'row_count' => 1,\n\t\t]);\n\n\t\t$this->specs[$metadata->id][] = $this->db->addQuerySpec([\n\t\t\t'sql' => $sql,\n\t\t\t'params' => [\n\t\t\t\t':id' => $metadata->id,\n\t\t\t\t':enabled' => 'no',\n\t\t\t],\n\t\t\t'row_count' => 1,\n\t\t]);\n\t}",
"function graphql_init_meta_query() {\n\treturn new \\WPGraphQL\\MetaQuery();\n}",
"public function getTableMeta()\n {\n return $this->get(self::TABLE_META);\n }",
"private function loadMetadataFromSongIntoQuery($file_path, UpdateQuery $query, $file_name = null) {\n\n /** @var Metadata $metadata */\n $metadata = FFProbe::read($file_path, $file_name)\n ->getOrThrow(InvalidAudioFileException::class);\n\n $query->set(TSongs::T_ARTIST, $metadata->meta_artist)\n ->set(TSongs::T_YEAR, $metadata->meta_date)\n ->set(TSongs::T_TITLE, $metadata->meta_title)\n ->set(TSongs::T_NUMBER, $metadata->meta_track_number)\n ->set(TSongs::DISC, $metadata->meta_disc_number)\n ->set(TSongs::BITRATE, $metadata->bitrate)\n ->set(TSongs::LENGTH, $metadata->duration)\n ->set(TSongs::A_ARTIST, $metadata->meta_album_artist)\n ->set(TSongs::T_GENRE, $metadata->meta_genre)\n ->set(TSongs::T_ALBUM, $metadata->meta_album)\n ->set(TSongs::T_COMMENT, $metadata->meta_comment)\n ->set(TSongs::IS_COMP, $metadata->is_compilation)\n ->set(TSongs::FORMAT, $metadata->format_name);\n\n }",
"private function handle_describe_query(){\n\t\t$pattern = '/^\\\\s*(DESCRIBE|DESC)\\\\s*(.*)/i';\n\t\tif (preg_match($pattern, $this->_query, $match)) {\n\t\t\t$tablename = preg_replace('/[\\';]/', '', $match[2]);\n\t\t\t$this->_query = \"PRAGMA table_info($tablename)\";\n\t\t}\n\t}",
"protected function printQueryMetadata($metadata)\n {\n // don't show stats unless explicitly requested\n if (!$this->input->getOption('show-stats')) {\n return;\n }\n $this->output->writeln('-- search meta -- ');\n $this->output->writeln('max_id_str: '.$metadata['max_id_str']);\n $this->output->writeln('since_id_str: '.$metadata['since_id_str']);\n $this->output->writeln('Page Count: '.$metadata['count']);\n $this->output->writeln('query: '.$metadata['query']);\n\n if (array_key_exists('next_results', $metadata)) {\n $this->output->writeln('next results: '.$metadata['next_results']);\n }\n $this->output->writeln('// search meta // ');\n }",
"public function scopeMeta($query)\n {\n return $query->join($this->getMetaTable(), $this->getTable() . '.id', '=', $this->getMetaTable() . '.' . $this->getMetaKeyName());\n }",
"private function getMetaInformation()\n {\n $method = 'meta__query'.$this->method;\n if(\\method_exists($this->class, $method))\n {\n return \\Savant\\AGenericCallInterface::call($this->class, $method);\n }\n else\n {\n return false;\n }\n }",
"protected function loadMetaData()\r\n\t{\r\n\t\t$rows = (new Query)\r\n\t\t ->select('*')\r\n\t\t ->from($this->metaTableName())\r\n\t\t ->where([\r\n\t\t \t'record_id'\t=> $this->{$this->getPkName()}\r\n\t\t ])\r\n\t\t ->all();\r\n\r\n\t\t$this->metaData = $rows;\r\n\t}",
"private function getCoreUcmTableFieldMetadata()\n {\n return array(\n //------------------------------------------------------------------------------------------------------------------------------------------------------------\n 'note' => (object) ['Field' => 'note', 'Type' => 'varchar(255)', 'Null' => 'YES', 'Default' => NULL],\n //------------------------------------------------------------------------------------------------------------------------------------------------------------\n );\n }",
"public function get_queryInfoObject()\n {\n $value = $this->get(self::QUERYINFO);\n $instance = new QueryInfo();\n $instance->copy($value);\n return $instance;\n }",
"protected function query($query) {\n\n\t\t$retval = array();\n\n\t\t//\n\t\t// We want metadata to be first, as it makes debugging a little bit easier.\n\t\t//\n\t\t$data = $this->splunk->query($query);\n\t\t$retval[\"metadata\"] = $this->splunk->getResultsMeta();\n\t\t$retval[\"data\"] = $data;\n\n\t\treturn($retval);\n\n\t}",
"public abstract function get_query();",
"public function getTableMeta()\n {\n return $this->table_meta;\n }",
"function getResultsMeta() {\n\n\t\treturn($this->metadata);\n\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Retrieve child view model registered to capture | public function getChildViewModel($capture) {
return $this->getLayoutSchemeService()->getChildViewModel($capture);
} | [
"public abstract function getModelFromView();",
"public function getChildViewModels() {\n\t\treturn $this->getLayoutSchemeService()->getChildViewModels();\n\t}",
"public function getReferencedModel(){ }",
"public function getModel()\n\t{\n\t\treturn $this->parent;\n\t}",
"public function getViewObject(){\n\t\treturn $this->m_viewObject;\n\t}",
"public function getViewObject() {\n\t\treturn $this->_viewObject;\n\t}",
"abstract public function modelForView(ViewServiceProvider $view);",
"public function get_model(){\n return $this->ui_model->get_model();\n }",
"public function getViewInstance()\n\t{\n\t\treturn $this->viewInstance;\n\t}",
"protected function getModelInstance()\n {\n return call_user_func([$this->owner->modelClass, 'instance']);\n }",
"public function model()\n {\n return $this;\n }",
"public static function model() {\n return parent::model(get_called_class());\n }",
"public function camera()\n {\n return $this->belongsTo(Camera::class);\n }",
"public function formGetModel()\n {\n return $this->model;\n }",
"public function getTargetModel();",
"public function getChild()\n {\n return $this->child;\n }",
"public function eloquent()\n {\n return $this->model;\n }",
"public function getChildModels()\n {\n return $this->getEntities();\n }",
"public function child()\n {\n return $this->morphTo();\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Initializes a new order fulfillment updated update object. | public function build(): OrderFulfillmentUpdatedUpdate
{
return CoreHelper::clone($this->instance);
} | [
"public static function init(): self\n {\n return new self(new UpdateOrderResponse());\n }",
"public function testUpdateFulfillmentOrder()\n {\n }",
"public function testUpdateAnOrder()\n {\n }",
"public function updated(RequestOrder $requestOrder)\n {\n //\n }",
"public static function init(): self\n {\n return new self(new OrderFulfillment());\n }",
"public function setFulfillmentUpdate(?array $fulfillmentUpdate): void\n {\n $this->fulfillmentUpdate['value'] = $fulfillmentUpdate;\n }",
"private function _update_construct() {\n $this->_steps = Definition::loadRegistry(CORE_INSTALLER_INCLUDES_PATH.'/registry/update.steps.registry');\n }",
"public static function init(): self\n {\n return new self(new UpsertOrderCustomAttributeResponse());\n }",
"private function updateOrderData()\n {\n $sign = $this->connector->signRequestKid(\n null,\n $this->connector->accountURL,\n $this->orderURL\n );\n\n $post = $this->connector->post($this->orderURL, $sign);\n if (strpos($post['header'], \"200 OK\") !== false) {\n $this->status = $post['body']['status'];\n $this->expires = $post['body']['expires'];\n $this->identifiers = $post['body']['identifiers'];\n $this->authorizationURLs = $post['body']['authorizations'];\n $this->finalizeURL = $post['body']['finalize'];\n if (array_key_exists('certificate', $post['body'])) {\n $this->certificateURL = $post['body']['certificate'];\n }\n $this->updateAuthorizations();\n } else {\n //@codeCoverageIgnoreStart\n $this->log->error(\"Failed to fetch order for {$this->basename}\");\n //@codeCoverageIgnoreEnd\n }\n }",
"public function update_orders() {\r\n\t\treturn; // TODO: re-evaluate offering tracking as this does not work reliably.\r\n\t\t$open_orders = array();\r\n\t\t/** \r\n\t\t * @startDate - oldest completed order with valid fulfillment and without tracking\r\n\t\t * @endDate - today is not inclusive and future scope is ok \r\n\t\t */\r\n\t\t\r\n\t\t$args = array(\r\n\t\t\t'order' => 'ASC',\r\n\t\t\t'post_status' => $this->complete_status,\r\n\t\t\t'meta_query' => array(\r\n\t\t\t\t'relation' => 'AND',\r\n\t\t\t\tarray(\r\n\t\t\t\t\t'key' => 'woo_sf_order_id',\r\n\t\t\t\t\t'value' => 0,\r\n\t\t\t\t\t'compare' => '>',\r\n\t\t\t\t\t'type' => 'NUMERIC',\r\n\t\t\t\t),\r\n\t\t\t\tarray(\r\n\t\t\t\t\t'key' => '_tracking_number',\r\n\t\t\t\t\t'value' => 'test',\r\n\t\t\t\t\t'compare' => 'NOT EXISTS'\r\n\t\t\t\t)\r\n\t\t\t),\r\n\t\t);\r\n\t\t$orders = $this->get_orders_with($args);\r\n\t\t$start_date = !empty($orders->post) ? date('Y-m-d', strtotime($orders->post->post_date_gmt)) : '2014-01-01';\r\n\t\t$request = array(\r\n\t\t\t\"startDate\" => $start_date, \r\n\t\t\t\"endDate\" => date('Y-m-d', strtotime('tomorrow')), \r\n\t\t);\r\n\t\t$response = $this->api('update', $request);\r\n\t\tif ( $response && !empty($response->Orders)) {\r\n\t\t\t$tracking_providers = array_map( 'sanitize_title', array( 'Fedex', 'OnTrac', 'UPS', 'USPS' ) );\r\n\t\t\tforeach($response->Orders as $order) {\r\n\t\t\t\t// nothing shipped yet\r\n\t\t\t\tif ( $order->OrderDetailShippedCount === 0 ) continue;\r\n\r\n\t\t\t\t// shipped and has woocommerce order number\r\n\t\t\t\tif ( !empty($order->ThirdPartyOrderNumber)) {\r\n\t\t\t\t\t$order_id = $order->ThirdPartyOrderNumber;\r\n\t\t\t\t\t$open_orders[$order_id] = $order->OrderNumber;\r\n\t\t\t\t\tforeach($order->Shipments as $shipment) {\r\n\t\t\t\t\t\t$provider = @$shipment->ServiceProvider ? sanitize_title($shipment->ServiceProvider) : false;\r\n\t\t\t\t\t\t$date_shipped = @$shipment->ShipDate;\r\n\t\t\t\t\t\t$tracking_no = @$shipment->TrackingNumber;\r\n\r\n\t\t\t\t\t\tif ( empty($provider) || empty($date_shipped) || empty($tracking_no) ) continue;\r\n\r\n\t\t\t\t\t\t// add extra if Plugin 'Shipment Tracking for WooCommerce' detected\r\n\t\t\t\t\t\tif ( get_option('woo_sf_shipment_tracking') ) {\r\n\t\t\t\t\t\t\t// use custom if not default\r\n\t\t\t\t\t\t\tif ( !in_array( $provider, $tracking_providers) ) {\r\n\t\t\t\t\t\t\t\tupdate_post_meta( $order_id, '_custom_tracking_link', $tracking_no ); // this should be in a link format\r\n\t\t\t\t\t\t\t\tupdate_post_meta( $order_id, '_custom_tracking_provider', $provider );\r\n\t\t\t\t\t\t\t\tdelete_post_meta( $order_id, '_tracking_provider' ); // remove stale tracking\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\tupdate_post_meta( $order_id, '_tracking_provider', $provider );\r\n\t\t\t\t\t\t\t\tupdate_post_meta( $order_id, '_tracking_number', $tracking_no );\r\n\t\t\t\t\t\t\t\tdelete_post_meta( $order_id, '_custom_tracking_provider' ); // remove stale tracking\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tupdate_post_meta( $order_id, '_date_shipped', strtotime($date_shipped) );\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}\r\n\t\treturn $open_orders;\r\n\t}",
"public function updated(Order $Order)\n {\n //code...\n }",
"function initialiseUpdates() {\n\t}",
"public function update_order_from_object($order)\n {\n }",
"public function __construct()\n {\n $this->orders = [];\n }",
"public function fromArray($update)\n {\n if (is_array($update)) {\n foreach ($update as $key => $value) {\n $this->{$key} = $value;\n }\n }\n }",
"private function updateOrderData()\n {\n $sign = $this->connector->signRequestKid('', $this->connector->accountURL, $this->orderURL);\n $post = $this->connector->post($this->orderURL, $sign);\n if($post['status'] === 200)\n {\n $this->status = $post['body']['status'];\n $this->expires = $post['body']['expires'];\n $this->identifiers = $post['body']['identifiers'];\n $this->authorizationURLs = $post['body']['authorizations'];\n $this->finalizeURL = $post['body']['finalize'];\n if(array_key_exists('certificate', $post['body'])) $this->certificateURL = $post['body']['certificate'];\n $this->updateAuthorizations();\n }\n else\n {\n if($this->log instanceof \\Psr\\Log\\LoggerInterface)\n {\n $this->log->info('Cannot update data for order \\'' . $this->basename . '\\'.');\n }\n elseif($this->log >= LEClient::LOG_STATUS) LEFunctions::log('Cannot update data for order \\'' . $this->basename . '\\'.', 'function updateOrderData');\n }\n }",
"public function init_update() {\n\t\tif ( $this->update_needed() ) {\n\t\t\t/**\n\t\t\t * Provides an opportunity to change the maximum number of events that will be\n\t\t\t * updated with timezone data in a single batch.\n\t\t\t *\n\t\t\t * @param int number of events to be processed in a single batch\n\t\t\t */\n\t\t\t$batch_size = (int) apply_filters( 'tribe_events_timezone_updater_batch_size', 50 );\n\t\t\t$this->initial_count = $this->count_ids();\n\t\t\t$this->process( $batch_size );\n\t\t}\n\n\t\t$this->notice_setup();\n\t}",
"public function it_updates_a_order()\n {\n Http::fake();\n\n (new Shopify('shop', 'token'))->orders(123)->put($order = [\n 'key1' => 'value1'\n ]);\n\n $order['id'] = 123;\n\n Http::assertSent(function (Request $request) use ($order) {\n return $request->url() == 'https://shop.myshopify.com/admin/orders/123.json'\n && $request->method() == 'PUT'\n && $request->data() == compact('order');\n });\n }",
"public function testUpdateOrder()\n\t{\n\t\tprint 'Run test for #updateOrder...';\n\t\t$api = new DefaultApi();\n\t\t$response = $this->provideApiKey($api, function ($api, $apiKey) {\n\t\t\treturn $api->updateOrder(\n\t\t\t\t(new UpdateOrderRequest())\n\t\t\t\t\t->setApiKey($apiKey)\n\t\t\t\t\t->setFolders(array(0))\n\t\t\t);\n\t\t});\n\t\tprint($response);\n\t\t$this->assertEquals('ok', $response->getStatus());\n\t\t$this->assertStringMatchesFormat('Order Updated', $response->getMsg());\n\t\t$this->assertNotEmpty($response->getCode());\n\t\tprint('');\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the value of MEDICO. | public function getMEDICO()
{
return $this->MEDICO;
} | [
"public function getMedico() {\n return $this->medico;\n }",
"public function getMedida() {\n return $this->iMedida;\n }",
"public function getCodMedico()\n {\n return $this->getModel()->getValor(\"codMedico\");\n }",
"public function getPazientiMedico() {\n return $this->_pazienti;\n }",
"public function getMedicoFisio(){\n return $this->Medico_Fisio;\n }",
"public function getMEDICAMENTO()\n {\n return $this->MEDICAMENTO;\n }",
"public function getHistoriaMedica()\n\t{\n\t\treturn $this->historia_medica;\n\t}",
"public function getCodMedico()\n {\n $this->relacionamentoNome = \"Medico\";\n $this->setTabelaIntermediaria(\"tClinicaMedico\");\n $this->setRelacionamento(\"tMedico\");\n return $this->getModel()->getValor(\"codMedico\");\n }",
"public function get_medico()\n {\n \n // loads the associated object\n if (empty($this->medico))\n $this->medico = new Medicos($this->medico_id);\n \n // returns the associated object\n return $this->medico;\n }",
"public function getIdmedico()\n {\n\n return $this->idmedico;\n }",
"public function getMedicina()\n {\n return $this->medicina;\n }",
"public function getMed()\n\t{\n\t\treturn $this->med;\n\t}",
"public function getMedida1()\n {\n return $this->medida1;\n }",
"public function consultarMedicamentoGeneral() {\n\n $dao = new DaoMedicamento();\n $valor = $dao->consultarMedicamentoGeneral();\n return $valor;\n }",
"public function getValor_moeda()\n {\n return $this->valor_moeda;\n }",
"public function getId_medico()\r\n\t{\r\n\t\treturn($this->id_medico);\r\n\t}",
"public function getCdMedida()\n {\n return $this->cd_medida;\n }",
"public function getUnidadeMedida()\n {\n return $this->unidade_medida;\n }",
"public function getNumIscrizioneMedico() {\n return $this->_numIscrizione;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Normalize some MS Word special characters. | public static function normalize_msword($str)
{
$str = (string)$str;
if (!isset($str[0])) {
return '';
}
static $UTF8_MSWORD_KEYS_CACHE = null;
static $UTF8_MSWORD_VALUES_CACHE = null;
if ($UTF8_MSWORD_KEYS_CACHE === null) {
$UTF8_MSWORD_KEYS_CACHE = array_keys(self::$UTF8_MSWORD);
$UTF8_MSWORD_VALUES_CACHE = array_values(self::$UTF8_MSWORD);
}
return str_replace($UTF8_MSWORD_KEYS_CACHE, $UTF8_MSWORD_VALUES_CACHE, $str);
} | [
"public static function normalize_msword(string $str):string{\n\t\t$invalid = array('Š'=>'S', 'š'=>'s', 'Đ'=>'Dj', 'đ'=>'dj', 'Ž'=>'Z', 'ž'=>'z','Č'=>'C', 'č'=>'c', 'Ć'=>'C', 'ć'=>'c', 'À'=>'A', 'Á'=>'A', 'Â'=>'A', 'Ã'=>'A','Ä'=>'A', 'Å'=>'A', 'Æ'=>'A', 'Ç'=>'C', 'È'=>'E', 'É'=>'E', 'Ê'=>'E', 'Ë'=>'E','Ì'=>'I', 'Í'=>'I', 'Î'=>'I', 'Ï'=>'I', 'Ñ'=>'N', 'Ò'=>'O', 'Ó'=>'O', 'Ô'=>'O','Õ'=>'O', 'Ö'=>'O', 'Ø'=>'O', 'Ù'=>'U', 'Ú'=>'U', 'Û'=>'U', 'Ü'=>'U', 'Ý'=>'Y','Þ'=>'B', 'ß'=>'Ss', 'à'=>'a', 'á'=>'a', 'â'=>'a', 'ã'=>'a', 'ä'=>'a', 'å'=>'a','æ'=>'a', 'ç'=>'c', 'è'=>'e', 'é'=>'e', 'ê'=>'e', 'ë'=>'e', 'ì'=>'i', 'í'=>'i','î'=>'i', 'ï'=>'i', 'ð'=>'o', 'ñ'=>'n', 'ò'=>'o', 'ó'=>'o', 'ô'=>'o', 'õ'=>'o','ö'=>'o', 'ø'=>'o', 'ù'=>'u', 'ú'=>'u', 'û'=>'u', 'ý'=>'y', 'ý'=>'y', 'þ'=>'b','ÿ'=>'y', 'Ŕ'=>'R', 'ŕ'=>'r', \"`\" => \"'\", \"´\" => \"'\", \"„\" => \",\", \"`\" => \"'\",\"´\" => \"'\", \"“\" => \"\\\"\", \"”\" => \"\\\"\", \"´\" => \"'\", \"’\" => \"'\", \"{\" => \"\",\"~\" => \"\", \"–\" => \"-\", \"’\" => \"'\");\n\t\t$str = str_replace(array_keys($invalid), array_values($invalid), $str);\n\t\treturn $str;\n\t}",
"private function normalize_special_characters($str) {\n\t\t$unwanted_array = array( 'Š'=>'S', 'š'=>'s', 'Ž'=>'Z', 'ž'=>'z', 'À'=>'A', 'Á'=>'A', 'Â'=>'A', 'Ã'=>'A', 'Ä'=>'A', 'Å'=>'A', 'Æ'=>'A', 'Ç'=>'C', 'È'=>'E', 'É'=>'E',\n\t\t\t\t\t\t\t\t\t'Ê'=>'E', 'Ë'=>'E', 'Ì'=>'I', 'Í'=>'I', 'Î'=>'I', 'Ï'=>'I', 'Ñ'=>'N', 'Ò'=>'O', 'Ó'=>'O', 'Ô'=>'O', 'Õ'=>'O', 'Ö'=>'O', 'Ø'=>'O', 'Ù'=>'U',\n\t\t\t\t\t\t\t\t\t'Ú'=>'U', 'Û'=>'U', 'Ü'=>'U', 'Ý'=>'Y', 'Þ'=>'B', 'ß'=>'Ss', 'à'=>'a', 'á'=>'a', 'â'=>'a', 'ã'=>'a', 'ä'=>'a', 'å'=>'a', 'æ'=>'a', 'ç'=>'c',\n\t\t\t\t\t\t\t\t\t'è'=>'e', 'é'=>'e', 'ê'=>'e', 'ë'=>'e', 'ì'=>'i', 'í'=>'i', 'î'=>'i', 'ï'=>'i', 'ð'=>'o', 'ñ'=>'n', 'ò'=>'o', 'ó'=>'o', 'ô'=>'o', 'õ'=>'o',\n\t\t\t\t\t\t\t\t\t'ö'=>'o', 'ø'=>'o', 'ù'=>'u', 'ú'=>'u', 'û'=>'u', 'ý'=>'y', 'ý'=>'y', 'þ'=>'b', 'ÿ'=>'y', ' '=>'-', '/'=>'-', '\\\\'=>'-' );\n\t\t$str = strtr($str, $unwanted_array);\n\t\t$str = strtolower(preg_replace('/[^a-zA-Z0-9_-]/s', '', $str));\n\t\treturn $str;\n\t}",
"function removeMicrosoftWordCharacters($t)\n{\n\t$a=array(\n \t\"\\xe2\\x80\\x9c\"=>'\"',\n \t\"\\xe2\\x80\\x9d\"=>'\"',\n \t\"\\xe2\\x80\\x99\"=>\"'\",\n \t\"\\xe2\\x80\\xa6\"=>\"...\",\n \t\"\\xe2\\x80\\x98\"=>\"'\",\n \t\"\\xe2\\x80\\x94\"=>\"---\",\n \t\"\\xe2\\x80\\x93\"=>\"--\",\n \t\"\\x85\"=>\"...\",\n \t\"\\221\"=>\"'\",\n \t\"\\222\"=>\"'\",\n \t\"\\223\"=>'\"',\n \t\"\\224\"=>'\"',\n \t\"\\x97\"=>\"---\",\n \t\"\\x96\"=>\"--\"\n\t );\n\n\tforeach ($a as $k=>$v) {\n\t\t$oa[]=$k;\n\t\t$ra[]=$v;\n\t}\n\n\t$t=trim(str_replace($oa,$ra,$t));\n\treturn $t;\n\n}",
"function normalize_special_characters($str) {\r\n\t\t# Quotes cleanup\r\n\t\t$str = ereg_replace ( chr ( ord ( \"`\" ) ), \"'\", $str ); # `\r\n\t\t$str = ereg_replace ( chr ( ord ( \"�\" ) ), \"'\", $str ); # �\r\n\t\t$str = ereg_replace ( chr ( ord ( \"�\" ) ), \",\", $str ); # �\r\n\t\t$str = ereg_replace ( chr ( ord ( \"`\" ) ), \"'\", $str ); # `\r\n\t\t$str = ereg_replace ( chr ( ord ( \"�\" ) ), \"'\", $str ); # �\r\n\t\t$str = ereg_replace ( chr ( ord ( \"�\" ) ), \"\\\"\", $str ); # �\r\n\t\t$str = ereg_replace ( chr ( ord ( \"�\" ) ), \"\\\"\", $str ); # �\r\n\t\t$str = ereg_replace ( chr ( ord ( \"�\" ) ), \"'\", $str ); # �\r\n\t\t\r\n\r\n\t\t$unwanted_array = array ('�' => 'S', '�' => 's', '�' => 'Z', '�' => 'z', '�' => 'A', '�' => 'A', '�' => 'A', '�' => 'A', '�' => 'A', '�' => 'A', '�' => 'A', '�' => 'C', '�' => 'E', '�' => 'E', '�' => 'E', '�' => 'E', '�' => 'I', '�' => 'I', '�' => 'I', '�' => 'I', '�' => 'N', '�' => 'O', '�' => 'O', '�' => 'O', '�' => 'O', '�' => 'O', '�' => 'O', '�' => 'U', '�' => 'U', '�' => 'U', '�' => 'U', '�' => 'Y', '�' => 'B', '�' => 'Ss', '�' => 'a', '�' => 'a', '�' => 'a', '�' => 'a', '�' => 'a', '�' => 'a', '�' => 'a', '�' => 'c', '�' => 'e', '�' => 'e', '�' => 'e', '�' => 'e', '�' => 'i', '�' => 'i', '�' => 'i', '�' => 'i', '�' => 'o', '�' => 'n', '�' => 'o', '�' => 'o', '�' => 'o', '�' => 'o', '�' => 'o', '�' => 'o', '�' => 'u', '�' => 'u', '�' => 'u', '�' => 'y', '�' => 'y', '�' => 'b', '�' => 'y' );\r\n\t\t$str = strtr ( $str, $unwanted_array );\r\n\t\t\r\n\t\t# Bullets, dashes, and trademarks\r\n\t\t$str = ereg_replace ( chr ( 149 ), \"•\", $str ); # bullet �\r\n\t\t$str = ereg_replace ( chr ( 150 ), \"–\", $str ); # en dash\r\n\t\t$str = ereg_replace ( chr ( 151 ), \"—\", $str ); # em dash\r\n\t\t$str = ereg_replace ( chr ( 153 ), \"™\", $str ); # trademark\r\n\t\t$str = ereg_replace ( chr ( 169 ), \"©\", $str ); # copyright mark\r\n\t\t$str = ereg_replace ( chr ( 174 ), \"®\", $str ); # registration mark\r\n\t\t\r\n\r\n\t\treturn $str;\r\n\t}",
"function normalizeText($str)\n{\n // remove the accents\n $unwanted_array = array(\n 'Š' => 'S', 'š' => 's', 'Ž' => 'Z', 'ž' => 'z', 'À' => 'A', 'Á' => 'A', 'Â' => 'A', 'Ã' => 'A', 'Ä' => 'A', 'Å' => 'A', 'Æ' => 'A', 'Ç' => 'C', 'È' => 'E', 'É' => 'E',\n 'Ê' => 'E', 'Ë' => 'E', 'Ì' => 'I', 'Í' => 'I', 'Î' => 'I', 'Ï' => 'I', 'Ñ' => 'N', 'Ò' => 'O', 'Ó' => 'O', 'Ô' => 'O', 'Õ' => 'O', 'Ö' => 'O', 'Ø' => 'O', 'Ù' => 'U',\n 'Ú' => 'U', 'Û' => 'U', 'Ü' => 'U', 'Ý' => 'Y', 'Þ' => 'B', 'ß' => 'ss', 'à' => 'a', 'á' => 'a', 'â' => 'a', 'ã' => 'a', 'ä' => 'a', 'å' => 'a', 'æ' => 'a', 'ç' => 'c',\n 'è' => 'e', 'é' => 'e', 'ê' => 'e', 'ë' => 'e', 'ì' => 'i', 'í' => 'i', 'î' => 'i', 'ï' => 'i', 'ð' => 'o', 'ñ' => 'n', 'ò' => 'o', 'ó' => 'o', 'ô' => 'o', 'õ' => 'o',\n 'ö' => 'o', 'ø' => 'o', 'ù' => 'u', 'ú' => 'u', 'û' => 'u', 'ý' => 'y', 'þ' => 'b', 'ÿ' => 'y'\n );\n $str = strtr($str, $unwanted_array);\n // make every first word uppercase\n $str = ucfirst(strtolower($str));\n // remove other extraneous chars\n $str = preg_replace(\"/[^a-zA-Z ]/\", \"\", $str);\n return implode('_', explode(' ', $str));\n}",
"function normalise_text($text)\n{\n\t// clean\n\t$text = clean_text($text);\n\t$text = unaccent($text);\n\t\n\t// remove punctuation\n\t//$text = preg_replace('/[' . PUNCTUATION_CHARS . ']+/u', '', $text);\n\t$text = preg_replace('/[^a-z0-9 ]/i', '', $text);\n\t\n\t// lowercase\n\t$text = mb_convert_case($text, MB_CASE_LOWER);\n\t\n\treturn $text;\n}",
"function normalizetextwinpage($str, $charset='utf-8'){\n $str = htmlentities($str, ENT_NOQUOTES, $charset);\n $str = preg_replace('#&([A-za-z])(?:acute|cedil|caron|circ|grave|orn|ring|slash|th|tilde|uml);#', '\\1', $str);\n $str = preg_replace('#&([A-za-z]{2})(?:lig);#', '\\1', $str);\n $str = preg_replace('#&[^;]+;#', '', $str);\n $str = str_replace('_',' ',$str);\n $str = str_replace(' ','%20',$str);\n $str = mb_convert_case($str, MB_CASE_TITLE, \"UTF-8\");\n return $str;\n}",
"function fix1252($s) {\n$replacement = array(\n\t\"\\x80\" => '€', \"\\x81\" => ' ', \"\\x82\" => '‚', \"\\x83\" => 'ƒ',\n\t\"\\x84\" => '„', \"\\x85\" => '…', \"\\x86\" => '†', \"\\x87\" => '‡',\n\t\"\\x88\" => 'ˆ', \"\\x89\" => '‰', \"\\x8a\" => 'Š', \"\\x8b\" => '‹',\n\t\"\\x8c\" => 'Œ', \"\\x8d\" => ' ', \"\\x8e\" => 'Ž', \"\\x8f\" => ' ',\n\t\"\\x90\" => ' ', \"\\x91\" => '‘', \"\\x92\" => '’', \"\\x93\" => '“',\n\t\"\\x94\" => '”', \"\\x95\" => '•', \"\\x96\" => '–', \"\\x97\" => '—',\n\t\"\\x98\" => '˜', \"\\x99\" => '™', \"\\x9a\" => 'š', \"\\x9b\" => '›',\n\t\"\\x9c\" => 'œ', \"\\x9d\" => ' ', \"\\x9e\" => 'ž', \"\\x9f\" => 'Ÿ',\n\t\"\\xa0\" => ' ', \"\\xa1\" => '¡', \"\\xa2\" => '¢', \"\\xa3\" => '£',\n\t\"\\xa4\" => '¤', \"\\xa5\" => '¥', \"\\xa6\" => '¦', \"\\xa7\" => '§',\n\t\"\\xa8\" => '¨', \"\\xa9\" => '©', \"\\xaa\" => 'ª', \"\\xab\" => '«',\n\t\"\\xac\" => '¬', \"\\xad\" => '­', \"\\xae\" => '®', \"\\xaf\" => '¯',\n\t\"\\xb0\" => '°', \"\\xb1\" => '±', \"\\xb2\" => '²', \"\\xb3\" => '³',\n\t\"\\xb4\" => '´', \"\\xb5\" => 'µ', \"\\xb6\" => '¶', \"\\xb7\" => '·',\n\t\"\\xb8\" => 'ç', \"\\xb9\" => '¹', \"\\xba\" => 'º', \"\\xbb\" => '»',\n\t\"\\xbc\" => '¼', \"\\xbd\" => '½', \"\\xbe\" => '¾', \"\\xbf\" => '¿',\n\t\"\\xc0\" => 'À', \"\\xc1\" => 'Á', \"\\xc2\" => 'Â', \"\\xc3\" => 'Ã',\n\t\"\\xc4\" => 'Ä', \"\\xc5\" => 'Å', \"\\xc6\" => 'Æ', \"\\xc7\" => 'Ç',\n\t\"\\xc8\" => 'È', \"\\xc9\" => 'É', \"\\xca\" => 'Ê', \"\\xcb\" => 'Ë',\n\t\"\\xcc\" => 'Ì', \"\\xcd\" => 'Í', \"\\xce\" => 'Î', \"\\xcf\" => 'Ï',\n\t\"\\xd0\" => 'Ð', \"\\xd1\" => 'Ñ', \"\\xd2\" => 'Ò', \"\\xd3\" => 'Ó',\n\t\"\\xd4\" => 'Ô', \"\\xd5\" => 'Õ', \"\\xd6\" => 'Ö', \"\\xd7\" => '×',\n\t\"\\xd8\" => 'Ø', \"\\xd9\" => 'Ù', \"\\xda\" => 'Ú', \"\\xdb\" => 'Û',\n\t\"\\xdc\" => 'Ü', \"\\xdd\" => 'Ý', \"\\xde\" => 'Þ', \"\\xdf\" => 'ß',\n\t\"\\xe0\" => 'à', \"\\xe1\" => 'á', \"\\xe2\" => 'â', \"\\xe3\" => 'ã',\n\t\"\\xe4\" => 'ä', \"\\xe5\" => 'å', \"\\xe6\" => 'æ', \"\\xe7\" => 'ç',\n\t\"\\xe8\" => 'è', \"\\xe9\" => 'é', \"\\xea\" => 'ê', \"\\xeb\" => 'ë',\n\t\"\\xec\" => 'ì', \"\\xed\" => 'í', \"\\xee\" => 'î', \"\\xef\" => 'ï',\n\t\"\\xf0\" => 'ð', \"\\xf1\" => 'ñ', \"\\xf2\" => 'ò', \"\\xf3\" => 'ó',\n\t\"\\xf4\" => 'ô', \"\\xf5\" => 'õ', \"\\xf6\" => 'ö', \"\\xf7\" => '÷',\n\t\"\\xf8\" => 'ø', \"\\xf9\" => 'ù', \"\\xfa\" => 'ú', \"\\xfb\" => 'û',\n\t\"\\xfc\" => 'ü', \"\\xfd\" => 'ý', \"\\xfe\" => 'þ', \"\\xff\" => 'ÿ'\n\t);\n\treturn(str_replace(array_keys($replacement), array_values($replacement), $s));\n}",
"function CleanupSmartQuotes($text) {\r\n $badwordchars = array(\r\n chr(145),\r\n chr(146),\r\n chr(147),\r\n chr(148),\r\n chr(151)\r\n );\r\n $fixedwordchars = array(\r\n \"'\",\r\n \"'\",\r\n '"',\r\n '"',\r\n '—'\r\n );\r\n return str_replace($badwordchars, $fixedwordchars, $text);\r\n}",
"function wp_kses_normalize_entities2( $matches )\n{\n if ( empty( $matches[ 1 ] ) ) {\n return '';\n }\n\n $i = $matches[ 1 ];\n if ( valid_unicode( $i ) ) {\n $i = str_pad( ltrim( $i, '0' ), 3, '0', STR_PAD_LEFT );\n $i = \"&#$i;\";\n }\n else {\n $i = \"&#$i;\";\n }\n\n return $i;\n}",
"function wp_kses_normalize_entities( $string )\n{\n // Disarm all entities by converting & to &\n $string = str_replace( '&', '&', $string );\n\n // Change back the allowed entities in our entity whitelist\n $string = preg_replace_callback( '/&([A-Za-z]{2,8}[0-9]{0,2});/', 'wp_kses_named_entities', $string );\n $string = preg_replace_callback( '/&#(0*[0-9]{1,7});/', 'wp_kses_normalize_entities2', $string );\n $string = preg_replace_callback( '/&#[Xx](0*[0-9A-Fa-f]{1,6});/', 'wp_kses_normalize_entities3', $string );\n\n return $string;\n}",
"function fts_kses_normalize_entities( $string ) {\n\t// Disarm all entities by converting & to &\n\n\t$string = str_replace( '&', '&', $string );\n\n\t// Change back the allowed entities in our entity whitelist\n\n\t$string = preg_replace_callback( '/&([A-Za-z]{2,8}[0-9]{0,2});/', 'fts_kses_named_entities', $string );\n\t$string = preg_replace_callback( '/&#(0*[0-9]{1,7});/', 'fts_kses_normalize_entities2', $string );\n\t$string = preg_replace_callback( '/&#[Xx](0*[0-9A-Fa-f]{1,6});/', 'fts_kses_normalize_entities3', $string );\n\n\treturn $string;\n}",
"protected function cleanup($text, $allowed_chars = null, $encoding = 'utf-8')\n\t{\n\t\tstatic $conv = array(), $conv_loaded = array();\n\t\t$words = $allow = array();\n\n\t\t// Convert the text to UTF-8\n\t\t$encoding = strtolower($encoding);\n\t\tif ($encoding != 'utf-8')\n\t\t{\n\t\t\t$text = utf8_recode($text, $encoding);\n\t\t}\n\n\t\t$utf_len_mask = array(\n\t\t\t\"\\xC0\"\t=>\t2,\n\t\t\t\"\\xD0\"\t=>\t2,\n\t\t\t\"\\xE0\"\t=>\t3,\n\t\t\t\"\\xF0\"\t=>\t4\n\t\t);\n\n\t\t/**\n\t\t* Replace HTML entities and NCRs\n\t\t*/\n\t\t$text = htmlspecialchars_decode(utf8_decode_ncr($text), ENT_QUOTES);\n\n\t\t/**\n\t\t* Load the UTF-8 normalizer\n\t\t*\n\t\t* If we use it more widely, an instance of that class should be held in a\n\t\t* a global variable instead\n\t\t*/\n\t\t\\utf_normalizer::nfc($text);\n\n\t\t/**\n\t\t* The first thing we do is:\n\t\t*\n\t\t* - convert ASCII-7 letters to lowercase\n\t\t* - remove the ASCII-7 non-alpha characters\n\t\t* - remove the bytes that should not appear in a valid UTF-8 string: 0xC0,\n\t\t* 0xC1 and 0xF5-0xFF\n\t\t*\n\t\t* @todo in theory, the third one is already taken care of during normalization and those chars should have been replaced by Unicode replacement chars\n\t\t*/\n\t\t$sb_match\t= \"ISTCPAMELRDOJBNHFGVWUQKYXZ\\r\\n\\t!\\\"#$%&'()*+,-./:;<=>?@[\\\\]^_`{|}~\\x00\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\x0B\\x0C\\x0E\\x0F\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1A\\x1B\\x1C\\x1D\\x1E\\x1F\\xC0\\xC1\\xF5\\xF6\\xF7\\xF8\\xF9\\xFA\\xFB\\xFC\\xFD\\xFE\\xFF\";\n\t\t$sb_replace\t= 'istcpamelrdojbnhfgvwuqkyxz ';\n\n\t\t/**\n\t\t* This is the list of legal ASCII chars, it is automatically extended\n\t\t* with ASCII chars from $allowed_chars\n\t\t*/\n\t\t$legal_ascii = ' eaisntroludcpmghbfvq10xy2j9kw354867z';\n\n\t\t/**\n\t\t* Prepare an array containing the extra chars to allow\n\t\t*/\n\t\tif (isset($allowed_chars[0]))\n\t\t{\n\t\t\t$pos = 0;\n\t\t\t$len = strlen($allowed_chars);\n\t\t\tdo\n\t\t\t{\n\t\t\t\t$c = $allowed_chars[$pos];\n\n\t\t\t\tif ($c < \"\\x80\")\n\t\t\t\t{\n\t\t\t\t\t/**\n\t\t\t\t\t* ASCII char\n\t\t\t\t\t*/\n\t\t\t\t\t$sb_pos = strpos($sb_match, $c);\n\t\t\t\t\tif (is_int($sb_pos))\n\t\t\t\t\t{\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t* Remove the char from $sb_match and its corresponding\n\t\t\t\t\t\t* replacement in $sb_replace\n\t\t\t\t\t\t*/\n\t\t\t\t\t\t$sb_match = substr($sb_match, 0, $sb_pos) . substr($sb_match, $sb_pos + 1);\n\t\t\t\t\t\t$sb_replace = substr($sb_replace, 0, $sb_pos) . substr($sb_replace, $sb_pos + 1);\n\t\t\t\t\t\t$legal_ascii .= $c;\n\t\t\t\t\t}\n\n\t\t\t\t\t++$pos;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t/**\n\t\t\t\t\t* UTF-8 char\n\t\t\t\t\t*/\n\t\t\t\t\t$utf_len = $utf_len_mask[$c & \"\\xF0\"];\n\t\t\t\t\t$allow[substr($allowed_chars, $pos, $utf_len)] = 1;\n\t\t\t\t\t$pos += $utf_len;\n\t\t\t\t}\n\t\t\t}\n\t\t\twhile ($pos < $len);\n\t\t}\n\n\t\t$text = strtr($text, $sb_match, $sb_replace);\n\t\t$ret = '';\n\n\t\t$pos = 0;\n\t\t$len = strlen($text);\n\n\t\tdo\n\t\t{\n\t\t\t/**\n\t\t\t* Do all consecutive ASCII chars at once\n\t\t\t*/\n\t\t\tif ($spn = strspn($text, $legal_ascii, $pos))\n\t\t\t{\n\t\t\t\t$ret .= substr($text, $pos, $spn);\n\t\t\t\t$pos += $spn;\n\t\t\t}\n\n\t\t\tif ($pos >= $len)\n\t\t\t{\n\t\t\t\treturn $ret;\n\t\t\t}\n\n\t\t\t/**\n\t\t\t* Capture the UTF char\n\t\t\t*/\n\t\t\t$utf_len = $utf_len_mask[$text[$pos] & \"\\xF0\"];\n\t\t\t$utf_char = substr($text, $pos, $utf_len);\n\t\t\t$pos += $utf_len;\n\n\t\t\tif (($utf_char >= UTF8_HANGUL_FIRST && $utf_char <= UTF8_HANGUL_LAST)\n\t\t\t\t|| ($utf_char >= UTF8_CJK_FIRST && $utf_char <= UTF8_CJK_LAST)\n\t\t\t\t|| ($utf_char >= UTF8_CJK_B_FIRST && $utf_char <= UTF8_CJK_B_LAST))\n\t\t\t{\n\t\t\t\t/**\n\t\t\t\t* All characters within these ranges are valid\n\t\t\t\t*\n\t\t\t\t* We separate them with a space in order to index each character\n\t\t\t\t* individually\n\t\t\t\t*/\n\t\t\t\t$ret .= ' ' . $utf_char . ' ';\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (isset($allow[$utf_char]))\n\t\t\t{\n\t\t\t\t/**\n\t\t\t\t* The char is explicitly allowed\n\t\t\t\t*/\n\t\t\t\t$ret .= $utf_char;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (isset($conv[$utf_char]))\n\t\t\t{\n\t\t\t\t/**\n\t\t\t\t* The char is mapped to something, maybe to itself actually\n\t\t\t\t*/\n\t\t\t\t$ret .= $conv[$utf_char];\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t/**\n\t\t\t* The char isn't mapped, but did we load its conversion table?\n\t\t\t*\n\t\t\t* The search indexer table is split into blocks. The block number of\n\t\t\t* each char is equal to its codepoint right-shifted for 11 bits. It\n\t\t\t* means that out of the 11, 16 or 21 meaningful bits of a 2-, 3- or\n\t\t\t* 4- byte sequence we only keep the leftmost 0, 5 or 10 bits. Thus,\n\t\t\t* all UTF chars encoded in 2 bytes are in the same first block.\n\t\t\t*/\n\t\t\tif (isset($utf_char[2]))\n\t\t\t{\n\t\t\t\tif (isset($utf_char[3]))\n\t\t\t\t{\n\t\t\t\t\t/**\n\t\t\t\t\t* 1111 0nnn 10nn nnnn 10nx xxxx 10xx xxxx\n\t\t\t\t\t* 0000 0111 0011 1111 0010 0000\n\t\t\t\t\t*/\n\t\t\t\t\t$idx = ((ord($utf_char[0]) & 0x07) << 7) | ((ord($utf_char[1]) & 0x3F) << 1) | ((ord($utf_char[2]) & 0x20) >> 5);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t/**\n\t\t\t\t\t* 1110 nnnn 10nx xxxx 10xx xxxx\n\t\t\t\t\t* 0000 0111 0010 0000\n\t\t\t\t\t*/\n\t\t\t\t\t$idx = ((ord($utf_char[0]) & 0x07) << 1) | ((ord($utf_char[1]) & 0x20) >> 5);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t/**\n\t\t\t\t* 110x xxxx 10xx xxxx\n\t\t\t\t* 0000 0000 0000 0000\n\t\t\t\t*/\n\t\t\t\t$idx = 0;\n\t\t\t}\n\n\t\t\t/**\n\t\t\t* Check if the required conv table has been loaded already\n\t\t\t*/\n\t\t\tif (!isset($conv_loaded[$idx]))\n\t\t\t{\n\t\t\t\t$conv_loaded[$idx] = 1;\n\t\t\t\t$file = $this->phpbb_root_path . 'includes/utf/data/search_indexer_' . $idx . '.' . $this->php_ext;\n\n\t\t\t\tif (file_exists($file))\n\t\t\t\t{\n\t\t\t\t\t$conv += include($file);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (isset($conv[$utf_char]))\n\t\t\t{\n\t\t\t\t$ret .= $conv[$utf_char];\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t/**\n\t\t\t\t* We add an entry to the conversion table so that we\n\t\t\t\t* don't have to convert to codepoint and perform the checks\n\t\t\t\t* that are above this block\n\t\t\t\t*/\n\t\t\t\t$conv[$utf_char] = ' ';\n\t\t\t\t$ret .= ' ';\n\t\t\t}\n\t\t}\n\t\twhile (1);\n\n\t\treturn $ret;\n\t}",
"function normalize()\n {\n foreach ($this->tokens as &$word) {\n $word = strtolower($word);\n }\n }",
"function mongoUserSanitize($val) {\n return preg_replace('/\\W/', '', $val);\n}",
"function remove_special_chars($string){\r\n $string = str_replace(array('[\\', \\']'), '', $string);\r\n $string = preg_replace('/\\[.*\\]/U', '', $string);\r\n $string = preg_replace('/&(amp;)?#?[a-z0-9]+;/i', '-', $string);\r\n $string = htmlentities($string, ENT_COMPAT, 'utf-8');\r\n $string = preg_replace('/&([a-z])(acute|uml|circ|grave|ring|cedil|slash|tilde|caron|lig|quot|rsquo);/i', '\\\\1', $string );\r\n $string = preg_replace(array('/[^a-z0-9]/i', '/[-]+/') , '-', $string);\r\n $string = strtolower(trim($string, '-'));\r\n\t$string = str_replace('-', '_', $string);\r\n\treturn $string;\r\n}",
"private function _normalizeEncodedWords($words)\n {\n $words = trim($words);\n $charset = \"\";\n $encoding = \"\";\n if (preg_match('/=\\?(.+?)\\?(B|Q)\\?(.+?)\\?=/i', $words, $m))\n {\n $charset = $m[1];\n $encoding = strtoupper($m[2]);\n if (strtolower($charset) == 'iso-2022-jp')\n {\n $words = preg_replace('/\\?ISO-2022-JP\\?/i', '?ISO-2022-JP-MS?', $words);\n }\n }\n if ($encoding != \"\") { $words = mb_decode_mimeheader($words); }\n return $words;\n }",
"function normalizeString($string) { \n\t\t\t// Strip whitespace\n\t\t\t$string = trim($string);\n\t\t\t// Remove punctuation from $string\n\t\t\t$string = preg_replace(\"#[[:punct:]]#\", \" \", $string);\n\t\t\t// Make the $string lowercase\n\t\t\t$string = mb_strtolower($string, 'UTF-8');\n\t\t\t// Remove accented UTF-8 characters from $string\n\t\t\t$search = explode(\",\",\"ç,æ,œ,á,é,í,ó,ú,à,è,ì,ò,ù,ä,ë,ï,ö,ü,ÿ,â,ê,î,ô,û,å,e,i,ø,u\");\n\t\t\t$replace = explode(\",\",\"c,ae,oe,a,e,i,o,u,a,e,i,o,u,a,e,i,o,u,y,a,e,i,o,u,a,e,i,o,u\");\n\t\t\t$string = str_replace($search, $replace, $string);\n\t\t\treturn $string;\n \t\t}",
"function cleanInput2($strRawText, $strAllowableChars, $blnAllowAccentedChars)\n{\n $iCharPos = 0;\n $chrThisChar = \"\";\n $strCleanedText = \"\";\n \n //Compare each character based on list of acceptable characters\n while ($iCharPos < strlen($strRawText))\n {\n // Only include valid characters **\n $chrThisChar = substr($strRawText, $iCharPos, 1);\n if (strpos($strAllowableChars, $chrThisChar) !== FALSE)\n {\n $strCleanedText = $strCleanedText . $chrThisChar;\n }\n elseIf ($blnAllowAccentedChars == TRUE)\n {\n // Allow accented characters and most high order bit chars which are harmless **\n if (ord($chrThisChar) >= 191)\n {\n \t$strCleanedText = $strCleanedText . $chrThisChar;\n }\n }\n \n $iCharPos = $iCharPos + 1;\n }\n \n return $strCleanedText;\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
test update or create consumer | public function testUpdateOrCreateConsumer()
{
// prepare document
$document = new Document();
$document
->setUsername('testUpdateOrCreateConsumer');
// assert
$response = $this->node->updateOrCreateConsumer($document);
$data = json_decode($response->getBody()->getContents(), true);
$this->assertSame(201, $response->getStatusCode());
$this->assertSame('Created', $response->getReasonPhrase());
$this->assertArraySubset([
'username' => 'testUpdateOrCreateConsumer',
], $data);
} | [
"public function test_it_updates_current_status()\n {\n $consumer = \\App\\Consumer::find(1);\n $consumerData = $consumer->toArray();\n $this->be(\\App\\User::find(1));\n\n $newData = [\n 'status_id' => \\App\\ConsumerStatus::MAIN_MEMBER,\n 'break' => true,\n 'membership_number' => '123456789',\n 'date' => '07/10/2017',\n 'main_consumer_id' => null,\n ];\n\n $consumerData['status_id'] = $newData['status_id'];\n $consumerData['break'] = $newData['break'];\n $consumerData['membership_number'] = $newData['membership_number'];\n $consumerData['date'] = $newData['date'];\n\n $this->put('/consumers/1', $consumerData)->assertResponseStatus(302);\n $this->assertEquals($newData['status_id'], $consumer->current_status->status_id);\n $this->assertEquals($newData['date'], $consumer->current_status->date->format('d/m/Y'));\n $this->assertEquals($newData['membership_number'], $consumer->current_status->membership_number);\n $this->assertEquals($newData['break'], $consumer->current_status->break);\n\n $nbStatuses = $consumer->statuses->count();\n\n $newData['status_id'] = \\App\\ConsumerStatus::DEPENDANT_MEMBER;\n $newData['main_consumer_id'] = 1;\n $newData['date'] = '07/11/2017';\n\n $consumerData['status_id'] = $newData['status_id'];\n $consumerData['main_consumer_id'] = $newData['main_consumer_id'];\n $consumerData['date'] = $newData['date'];\n\n $this->put('/consumers/1', $consumerData)->assertResponseStatus(302);\n $this->assertEquals($newData['status_id'], $consumer->current_status->status_id);\n $this->assertEquals($newData['date'], $consumer->current_status->date->format('d/m/Y'));\n $this->assertEquals($newData['main_consumer_id'], $consumer->current_status->main_consumer_id);\n }",
"public function testCancelBrokerageOrderUsingPut()\n {\n }",
"public function test_likeCreateChangeStreamPostLikesChangeStream() {\n\n }",
"public function testSamePassTwo()\n {\n $method = 'cbSamePassTwo';\n $h = $this->getHandler($this->getBindName(true));\n $h->setConsumer(array($this,$method));\n \n $msg = array();\n $msg['method'] = $method;\n \n $msg['i'] = 1;\n $this->assertTrue($h->publish($msg));\n \n $msg['i'] = 2;\n $this->assertTrue($h->publish($msg));\n \n $h->consume();\n $h->consume();\n $this->assertSame(2,$this->cb_count);\n \n }",
"public function testWebinarPollUpdate()\n {\n }",
"public function updateConsumer ( Auth_OAuth_Store_Consumer $consumer );",
"public function testInvitationTicketsChangeStreamGet()\n {\n\n }",
"public function consumer()\n {\n // Arrange\n $app = Mockery::mock('Illuminate\\Container\\Container', 'ArrayAccess');\n $redirectUri = 'https://example.org/callback';\n $scopes = ['email', 'read'];\n $credentials = ['client_id' => 'cl13nt1d', 'client_secret' => 'cl13nts3cr3t'];\n $twitter = new Twitter;\n\n $app->shouldReceive('make')->once()\n ->with('OAuth\\Services\\Twitter')->andReturn($twitter);\n $app->shouldReceive('offsetGet')->once()\n ->with('config')->andReturn($app);\n $app->shouldReceive('get')->once()\n ->with('php-oauth::oauth.consumers.twitter')->andReturn($credentials);\n\n $manager = new Manager($app);\n\n // Act\n $consumer = $manager->consumer('twitter', $redirectUri, $scopes);\n\n // Assert\n $this->assertEquals($credentials, $consumer->getCredentials());\n $this->assertEquals($scopes, $consumer->getScopes());\n $this->assertEquals($redirectUri, $consumer->getRedirectUri());\n }",
"public function testMeetingUpdate()\n {\n }",
"public function test_can_update_leader()\n {\n $updated = [\n 'name' => 'dipen shah',\n 'age' => 5,\n 'address' => '123 main st',\n ];\n $this->withoutExceptionHandling();\n $response = $this->put('/api/leaders/1', $updated)\n ->assertStatus(200)\n ->assertJson($updated)\n ;\n }",
"public function testChangeSubscription()\n {\n }",
"public function testCreateOrUpdate(){\n // Todo\n }",
"public function testCrceGroupAdministrationUpdateSubscription()\n {\n\n }",
"public function testUserServiceUserUpdate()\n {\n }",
"public function testReviewCreateChangeStreamPostReviewsChangeStream()\n {\n\n }",
"public function testAdminMessageCreateChangeStreamGetAdminMessagesChangeStream()\n {\n\n }",
"public function test_updateOrderSourceReservation() {\n\n }",
"public function testUpdateBrokerageClientUsingPut()\n {\n }",
"public function testTopupTopupServiceCommit()\n {\n\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ NAME Query Queries WMI interface PROTOTYPE $array = $wmi > Query ( $query, $base_class = 'WmiInstance', $namespace = 'Wmi' ) ; DESCRIPTION Performs a query on the Windows WMI interface and returns the results as an array of objects belonging to class $base_class. PARAMETERS $query (string) Query for the WMI interface, eg : SELECT FROM Win32_Process $base_class (string) The Query() method creates a new class for the WMI table being queried. The new class will have the table name prepended with 'Wmi' ; for example, querying Win32_Process will return objects of class WmiWin32_Process, inheriting from $base_class which is, by default, the WmiInstance class. If you want to encapsulate the generated class, simply declare a new class inheriting from WmiInstance and specify its name to the Query() call. $namespace (string) Indicates the namespace where new classes are to be created. An empty value means the current namespace. RETURN VALUE Returns an array of Wmixxx objects, where "xxx" is the name of the WMI table being queried. An empty array is returned if the query returned no results. | public function Query($query, $base_class = 'WmiInstance', $namespace = false)
{
if (!preg_match('/FROM \s+ (?P<table> \w+)/imsx', $query, $match))
throw (new Exception("The supplied query does not contain a FROM clause."));
$wmi_class = $match['table'];
$full_class_path = $this->__get_class_path($wmi_class, $namespace);
$class_exists = class_exists($full_class_path, false);
$rs = $this->WmiObject->ExecQuery($query);
$result = array();
foreach ($rs as $row) {
if (!$class_exists) {
$this->__create_class($row, $wmi_class, $base_class, $namespace);
if (!is_subclass_of($full_class_path, 'WmiInstance'))
throw (new RuntimeException("Class \"$full_class_path\" should inherit from WmiInstance"));
$class_exists = true;
}
$result[] = $this->__get_instance($row, $full_class_path);
}
return ($result);
} | [
"public function QueryInstances ( $table, $base_class = 'WmiInstance', $namespace = false )\n\t {\n\t\treturn ( $this -> Query ( \"SELECT * FROM $table\", $base_class, $namespace ) ) ;\n\t }",
"public function QueryInstances($table, $base_class = 'WmiInstance', $namespace = false)\r\n {\r\n return ($this->Query(\"SELECT * FROM $table\", $base_class, $namespace));\r\n }",
"private function consultaSap($query){\n $dns = \"sap_server\";\n $usuario = \"SYSTEM\";\n $pass = \"B1Admin$\";\n $cid = odbc_connect($dns, $usuario, $pass);\n if(!$cid){\n echo \"<strong>Ya ocurrido un error tratando de conectarse con el origen de datos.</strong>\";\n }else{\n $result = odbc_exec($cid, $query) or die(\"Error en odbc_exce\");\n $items = 0;\n $rs = array();\n while($row = odbc_fetch_array($result)){\n $rs[$items] = $row;\n $items ++;\n }\n return $rs;\n }\n }",
"protected function query($query) {\n\n\t\t$retval = array();\n\n\t\t//\n\t\t// We want metadata to be first, as it makes debugging a little bit easier.\n\t\t//\n\t\t$data = $this->splunk->query($query);\n\t\t$retval[\"metadata\"] = $this->splunk->getResultsMeta();\n\t\t$retval[\"data\"] = $data;\n\n\t\treturn($retval);\n\n\t}",
"function query() {\n\t\treturn parent::query('system.multicall', $this->calls);\n\t}",
"function DB_Queries($queries,$fetch=\"Assoc_List\",$ignoreerror=FALSE)\n {\n $fetchmethod=\"DB_Query_2\".$fetch;\n \n $res=array();\n foreach ($queries as $id => $query)\n {\n $result = $this->$fetchmethod($query,$ignoreerror);\n }\n \n return $res;\n }",
"function sqlQueryArray($query, $bindParams = null) {\n\t\t$startTime = $this->CalculExecution();\n\t\t$result = $this->_sqlQueryArrayExec($query, $bindParams); \n\t\t\n\t\t$tab = array();\n\t\t$icnt = 0;\n\t\twhile($data = mysqli_fetch_object($result))\n\t\t{\n\t\t \t$tab[$icnt] = $data;\n\t\t\t$icnt++;\n\t\t}\n\t\t$endTime = $this->CalculExecution();\n\t\t\n\t\treturn $tab;\n\t}",
"function commandQuery ( $query ) {\r\n\t$dsn = unserialize(DSN);\t// connection info for use in PEAR\r\n\r\n\t$db =& DB::connect($dsn);\t// connect to database\r\n\r\n\tif ( PEAR::isError($db) ) {\t// if error connecting, abort\r\n\t\tdie($db->getMessage());\r\n\t}\r\n\r\n\t$res =& $db->query($query);\t// run query\r\n\r\n\tif( $res != DB_OK ) {\r\n//\t\tif ( PEAR::isError($res) ) { // if error querying, abort\r\n\t\t$success = FALSE;\r\n\t} else { \r\n\t\t$success = TRUE;\r\n\t}\r\n//\t\t$res->free(); // delete result set and free used memory\r\n//\t}\r\n\t\r\n\t$db->disconnect();\t\t\t// disconnect from the database\r\n\t\r\n\r\n\treturn $success;\r\n}",
"public function searchByQuery($query) {\n\t\t$results = $this->ldap->search($this->basedn, $query);\n\t\treturn $results;\n\t}",
"public function search(array $query)\n {\n return empty(self::$selectedMonitors)\n ? $this->searchDefaultMonitors($query)\n : $this->searchSelectedMonitors($query);\n }",
"function mc_query($string)\n{\n $mcdb = new database\\db;\n $result = $mcdb->query($string);\n return $result; \n}",
"public static function pureQuery($query)\n {\n // saving a query if debug mode is on\n \n if(defined('WM_Debug'))\n {\n self::$queriesArray[] = $query;\n }\n \n // executing query, and returning DBResult if everything is fine\n \n $queryResult = mysql_query($query);\n \n if($queryResult)\n {\n return new DBResult($queryResult);\n }\n \n // on error - throwing an exception\n \n throw new WMException('Napotkano błąd podczas wykonywania zapytania do bazy danych: \"' . mysql_error() . '\"', 'DB:queryError');\n }",
"public function runAndReturnArray($query)\n\t{\n\t\t\n\t\t//run query\n\t\t$results = $this->runAndReturn($query);\n\t\t\n\t\t//convert results into an associative array\n\t\t$resultsArray = array();\n\t\twhile($row = $results->fetchArray())\n\t\t{\n\t\t\t$resultsArray[] = $row;\n\t\t}\n\t\t\n\t\treturn $resultsArray;\n\t}",
"public function getArray($query){\n\t\t$result = array();\n\t\t$rs = parent::query($query, MYSQLI_STORE_RESULT);\n\t\tif (mysqli_error($this))\n\t\t{\n\t\t\tthrow new Exception(mysqli_error($this), mysqli_errno($this));\n\t\t}\n\t\tif (true == $rs)\n\t\t{\n\t\t\twhile($row = $rs->fetch_assoc())\n\t\t\t{\n\t\t\t\t$result[] = $row;\n\t\t\t}\n\t\t\t$rs->free_result();\n\t\t}\n\t\treturn $result;\n\t}",
"function _query($query) {\n\t\t$this->query = $this->_eval_query($query);\n if (!empty($this->query) && is_resource($this->MRes)) {\n\tUdm_Set_Agent_Param($this->MRes,UDM_PARAM_QUERY,$this->query);\n if($this->_result = udm_find($this->MRes,$this->query)) {\n\t\t\t\t$this->_set_ResParam('ResRows',UDM_PARAM_NUM_ROWS);\n\t\t\t\t$this->_set_ResParam('ResFound',UDM_PARAM_FOUND);\n\t\t\t\t$this->_set_ResParam('ResTime',UDM_PARAM_SEARCHTIME);\n\t\t\t\t$this->_set_ResParam('ResFDoc',UDM_PARAM_FIRST_DOC);\n\t\t\t\t$this->_set_ResParam('ResLDoc',UDM_PARAM_LAST_DOC);\n $this->maxPages = ceil($this->ResFound / $this->NumRows);\n\t\t\treturn TRUE;\n\t\t\t}\n \n return array(\"error\"=>\"mnogosearch:\" . udm_Error($this->MRes));;\n\t\t\n } else {\n\n\t\t\treturn FALSE;\n\t\t}\n\t}",
"public abstract function get_query();",
"public static function query() {\n\t\treturn new Query ( get_called_class (), true );\n\t}",
"public function getQueryClass();",
"function query($query) {\n\t\t$result = mysql_query($query);\n\t\tif ($result == FALSE) {\n\t\t\t// $result = $this->query(\"SELECT @@ERROR AS 'Last error was:'\");\n\t\t\tthrow new Exception ( \"Database error: \" . mysql_error($this->handle) );\n\t\t}\n\t\tif ($result === TRUE) {\n\t\t\t// mysql_query() returnes TRUE if no rows were returned. Here, I catch before mysql_fetch_assoc() can be \n\t\t\t// called and return 0. I prefer 0 to true because it tells me more explicitly that 0 results were returned.\n\t\t\treturn 0;\n\t\t}\n\t\t$this->last_query_num_rows = mysql_num_rows($result);\n\t\tif ($this->last_query_num_rows > 1) {\n\t\t\t$ret = array();\n\t\t\t$i = 0;\n\t\t\t$j = $this->last_query_num_rows;\n\t\t\twhile ($i++ < $j) $ret[] = mysql_fetch_assoc($result);\n\t\t\treturn $ret;\n\t\t}\n\t\treturn mysql_fetch_assoc($result);\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check if smilies are enabled on the content | public function content_smilies_enabled()
{
return ($this->data['block_content_bbcode_options'] & OPTION_FLAG_SMILIES);
} | [
"function thistle_disable_smilies() {\n add_filter( 'pre_option_use_smilies', '__return_null' );\n }",
"public function generate_smilies() { \n\t\tglobal $phpbbForum;\n\t\tif ($this->get_setting('phpbbSmilies')) {\n\t\t\techo $phpbbForum->get_smilies();\n\t\t}\n\t}",
"function rocket_lazyload_smilies() {\n\tif ( ! rocket_lazyload_get_option( 'images' ) || ! apply_filters( 'do_rocket_lazyload', true ) ) {\n\t\treturn;\n\t}\n\n\tremove_filter( 'the_content', 'convert_smilies' );\n\tremove_filter( 'the_excerpt', 'convert_smilies' );\n\tremove_filter( 'comment_text', 'convert_smilies', 20 );\n\n\tadd_filter( 'the_content', 'rocket_convert_smilies' );\n\tadd_filter( 'the_excerpt', 'rocket_convert_smilies' );\n\tadd_filter( 'comment_text', 'rocket_convert_smilies', 20 );\n}",
"public static function smilies_init()\n {\n $wpsmiliestrans = array(\n ':mrgreen:' => 'icon_mrgreen.gif',\n ':neutral:' => 'icon_neutral.gif',\n ':twisted:' => 'icon_twisted.gif',\n ':arrow:' => 'icon_arrow.gif',\n ':shock:' => 'icon_eek.gif',\n ':smile:' => 'icon_smile.gif',\n ':???:' => 'icon_confused.gif',\n ':cool:' => 'icon_cool.gif',\n ':evil:' => 'icon_evil.gif',\n ':grin:' => 'icon_biggrin.gif',\n ':idea:' => 'icon_idea.gif',\n ':oops:' => 'icon_redface.gif',\n ':razz:' => 'icon_razz.gif',\n ':roll:' => 'icon_rolleyes.gif',\n ':wink:' => 'icon_wink.gif',\n ':cry:' => 'icon_cry.gif',\n ':eek:' => 'icon_surprised.gif',\n ':lol:' => 'icon_lol.gif',\n ':mad:' => 'icon_mad.gif',\n ':sad:' => 'icon_sad.gif',\n '8-)' => 'icon_cool.gif',\n '8-O' => 'icon_eek.gif',\n ':-(' => 'icon_sad.gif',\n ':-)' => 'icon_smile.gif',\n ':-?' => 'icon_confused.gif',\n ':-D' => 'icon_biggrin.gif',\n ':-P' => 'icon_razz.gif',\n ':-o' => 'icon_surprised.gif',\n ':-x' => 'icon_mad.gif',\n ':-|' => 'icon_neutral.gif',\n ';-)' => 'icon_wink.gif',\n '8)' => 'icon_cool.gif',\n '8O' => 'icon_eek.gif',\n ':(' => 'icon_sad.gif',\n ':)' => 'icon_smile.gif',\n ':?' => 'icon_confused.gif',\n ':D' => 'icon_biggrin.gif',\n ':P' => 'icon_razz.gif',\n ':o' => 'icon_surprised.gif',\n ':x' => 'icon_mad.gif',\n ':|' => 'icon_neutral.gif',\n ';)' => 'icon_wink.gif',\n ':!:' => 'icon_exclaim.gif',\n ':?:' => 'icon_question.gif',\n );\n\n if (count($wpsmiliestrans) == 0) {\n return;\n }\n\n /*\n * NOTE: we sort the smilies in reverse key order. This is to make sure\n * we match the longest possible smilie (:???: vs :?) as the regular\n * expression used below is first-match\n */\n krsort($wpsmiliestrans);\n\n $wp_smiliessearch = '/(?:\\s|^)';\n\n $subchar = '';\n foreach ( (array) $wpsmiliestrans as $smiley => $img ) {\n $firstchar = substr($smiley, 0, 1);\n $rest = substr($smiley, 1);\n\n // new subpattern?\n if ($firstchar != $subchar) {\n if ($subchar != '') {\n $wp_smiliessearch .= ')|(?:\\s|^)';\n }\n $subchar = $firstchar;\n $wp_smiliessearch .= preg_quote($firstchar, '/') . '(?:';\n } else {\n $wp_smiliessearch .= '|';\n }\n $wp_smiliessearch .= preg_quote($rest, '/');\n }\n\n $wp_smiliessearch .= ')(?:\\s|$)/m';\n }",
"function convert_smilies( $text ) {\n\tglobal $wp_smiliessearch;\n\t$output = '';\n\tif ( get_option( 'use_smilies' ) && ! empty( $wp_smiliessearch ) ) {\n\t\t// HTML loop taken from texturize function, could possible be consolidated\n\t\t$textarr = preg_split( '/(<.*>)/U', $text, -1, PREG_SPLIT_DELIM_CAPTURE ); // capture the tags as well as in between\n\t\t$stop = count( $textarr );// loop stuff\n\n\t\t// Ignore proessing of specific tags\n\t\t$tags_to_ignore = 'code|pre|style|script|textarea';\n\t\t$ignore_block_element = '';\n\n\t\tfor ( $i = 0; $i < $stop; $i++ ) {\n\t\t\t$content = $textarr[$i];\n\n\t\t\t// If we're in an ignore block, wait until we find its closing tag\n\t\t\tif ( '' == $ignore_block_element && preg_match( '/^<(' . $tags_to_ignore . ')>/', $content, $matches ) ) {\n\t\t\t\t$ignore_block_element = $matches[1];\n\t\t\t}\n\n\t\t\t// If it's not a tag and not in ignore block\n\t\t\tif ( '' == $ignore_block_element && strlen( $content ) > 0 && '<' != $content[0] ) {\n\t\t\t\t$content = preg_replace_callback( $wp_smiliessearch, 'translate_smiley', $content );\n\t\t\t}\n\n\t\t\t// did we exit ignore block\n\t\t\tif ( '' != $ignore_block_element && '</' . $ignore_block_element . '>' == $content ) {\n\t\t\t\t$ignore_block_element = '';\n\t\t\t}\n\n\t\t\t$output .= $content;\n\t\t}\n\t} else {\n\t\t// return default text.\n\t\t$output = $text;\n\t}\n\treturn $output;\n}",
"protected function smilies($text)\n {\n $smile = array(\n ':mrgreen:' => 'icon_mrgreen.gif',\n ':neutral:' => 'icon_neutral.gif',\n ':twisted:' => 'icon_twisted.gif',\n ':arrow:' => 'icon_arrow.gif',\n ':shock:' => 'icon_eek.gif',\n ':smile:' => 'icon_smile.gif',\n ':???:' => 'icon_confused.gif',\n ':cool:' => 'icon_cool.gif',\n ':evil:' => 'icon_evil.gif',\n ':grin:' => 'icon_biggrin.gif',\n ':idea:' => 'icon_idea.gif',\n ':oops:' => 'icon_redface.gif',\n ':razz:' => 'icon_razz.gif',\n ':roll:' => 'icon_rolleyes.gif',\n ':wink:' => 'icon_wink.gif',\n ':cry:' => 'icon_cry.gif',\n ':eek:' => 'icon_surprised.gif',\n ':lol:' => 'icon_lol.gif',\n ':mad:' => 'icon_mad.gif',\n ':sad:' => 'icon_sad.gif',\n '8-)' => 'icon_cool.gif',\n '8-O' => 'icon_eek.gif',\n ':-(' => 'icon_sad.gif',\n ':-)' => 'icon_smile.gif',\n ':-?' => 'icon_confused.gif',\n ':-D' => 'icon_biggrin.gif',\n ':-P' => 'icon_razz.gif',\n ':-o' => 'icon_surprised.gif',\n ':-x' => 'icon_mad.gif',\n ':-|' => 'icon_neutral.gif',\n ';-)' => 'icon_wink.gif',\n '8)' => 'icon_cool.gif',\n '8O' => 'icon_eek.gif',\n ':(' => 'icon_sad.gif',\n ':)' => 'icon_smile.gif',\n ':?' => 'icon_confused.gif',\n ':D' => 'icon_biggrin.gif',\n ':P' => 'icon_razz.gif',\n ':o' => 'icon_surprised.gif',\n ':x' => 'icon_mad.gif',\n ':|' => 'icon_neutral.gif',\n ';)' => 'icon_wink.gif',\n ':!:' => 'icon_exclaim.gif',\n ':?:' => 'icon_question.gif',\n );\n\n if (count($smile) > 0) {\n\n foreach ($smile as $replace_this => $value) {\n $path = '/Media/smilies/';\n $path .= $value;\n $with_this = '<span><img src=\"' . $path . '\" alt=\"' . $value . '\" class=\"smiley-class\" /></span>';\n $text = str_ireplace($replace_this, $with_this, $text);\n }\n }\n\n return $text;\n }",
"public function lazyloadSmilies()\r\n {\r\n if (! $this->shouldLazyload()) {\r\n return;\r\n }\r\n\r\n if (! $this->option_array->get('images')) {\r\n return;\r\n }\r\n\r\n $filters = [\r\n 'the_content' => 10,\r\n 'the_excerpt' => 10,\r\n 'comment_text' => 20,\r\n ];\r\n \r\n foreach ($filters as $filter => $prio) {\r\n if (! has_filter($filter)) {\r\n continue;\r\n }\r\n\r\n remove_filter($filter, 'convert_smilies', $prio);\r\n add_filter($filter, [$this->image, 'convertSmilies'], $prio);\r\n }\r\n }",
"function convert_smilies($text) {\n\tglobal $wp_smiliessearch;\n\t$output = '';\n\tif ( get_option('use_smilies') && !empty($wp_smiliessearch) ) {\n\t\t// HTML loop taken from texturize function, could possible be consolidated\n\t\t$textarr = preg_split(\"/(<.*>)/U\", $text, -1, PREG_SPLIT_DELIM_CAPTURE); // capture the tags as well as in between\n\t\t$stop = count($textarr);// loop stuff\n\t\tfor ($i = 0; $i < $stop; $i++) {\n\t\t\t$content = $textarr[$i];\n\t\t\tif ((strlen($content) > 0) && ('<' != $content{0})) { // If it's not a tag\n\t\t\t\t$content = preg_replace_callback($wp_smiliessearch, 'translate_smiley', $content);\n\t\t\t}\n\t\t\t$output .= $content;\n\t\t}\n\t} else {\n\t\t// return default text.\n\t\t$output = $text;\n\t}\n\treturn $output;\n}",
"function convert_smilies($text) {\n\tglobal $smiliessearch;\n\t$output = '';\n\tif ( get_option('use_smilies') && !empty($smiliessearch) ) {\n\t\t// HTML loop taken from texturize function, could possible be consolidated\n\t\t$textarr = preg_split(\"/(<.*>)/U\", $text, -1, PREG_SPLIT_DELIM_CAPTURE); // capture the tags as well as in between\n\t\t$stop = count($textarr);// loop stuff\n\t\tfor ($i = 0; $i < $stop; $i++) {\n\t\t\t$content = $textarr[$i];\n\t\t\tif ((strlen($content) > 0) && ('<' != $content[0])) { // If it's not a tag\n\t\t\t\t$content = preg_replace_callback($smiliessearch, 'translate_smiley', $content);\n\t\t\t}\n\t\t\t$output .= $content;\n\t\t}\n\t} else {\n\t\t// return default text.\n\t\t$output = $text;\n\t}\n\treturn $output;\n}",
"public function isEnableEmoticons(): bool\n {\n return $this->enable_emoticons;\n }",
"function enableSphereItLink( $content ) {\n\n\tglobal $min_words;\n\tglobal $min_chars;\n\tglobal $sphereit_threshold;\n\n\t// negation always takes precedence\t\n\tif ( strpos( $content, '<!--nosphereit-->' ) !== FALSE ) {\n\t\treturn FALSE;\n\t}\n\n\t// manual override?\n\tif ( strpos( $content, '<!--sphereit-->' ) !== FALSE ) {\n\t\treturn TRUE;\n\t}\n\n\t// passes threshold?\n\tif ($sphereit_threshold) {\n\t\t$num_words= count( explode( ' ', $content) );\n\t\t$num_chars= strlen( $content );\n\t\n\t\tif ( $num_words < $min_words && $num_chars < $min_chars )\n\t\t\treturn FALSE;\n\t}\n\n\treturn TRUE;\n}",
"function parse_smilies($text, $do_html = false)\n\t{\n\t\treturn $text;\n\t}",
"function html_add_smilie_box($in_html=\"\")\n\t{\n\t\treturn $in_html;\n\t\t\n\t\t/*\n\t\t$show_table = 0;\n\t\t$count = 0;\n\t\t$smilies = \"<tr align='center'>\\n\";\n\t\t$smilie_id = 0;\n\t\t$total = 0;\n\t\t\n\t\t//-----------------------------------------\n\t\t// Get the smilies from the DB\n\t\t//-----------------------------------------\n\t\t\n\t\tif ( ! is_array( $this->ipsclass->cache['emoticons'] ) )\n\t\t{\n\t\t\t$this->ipsclass->cache['emoticons'] = array();\n\t\t\t\n\t\t\t$this->ipsclass->DB->simple_construct( array( 'select' => 'typed,image,clickable,emo_set', 'from' => 'emoticons' ) );\n\t\t\t$this->ipsclass->DB->simple_exec();\n\t\t\n\t\t\twhile ( $r = $this->ipsclass->DB->fetch_row() )\n\t\t\t{\n\t\t\t\t$this->ipsclass->cache['emoticons'][] = $r;\n\t\t\t}\n\t\t}\n\t\t\n\t\tusort( $this->ipsclass->cache['emoticons'] , array( 'class_post', 'smilie_alpha_sort' ) );\n\t\t\n\t\tforeach( $this->ipsclass->cache['emoticons'] as $clickable )\n\t\t{\n\t\t\tif ( $clickable['emo_set'] != $this->ipsclass->skin['_emodir'] )\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t\t\t\t\n\t\t\tif( $clickable['clickable'] )\n\t\t\t{\n\t\t\t\t$total++;\n\t\t\t}\n\t\t}\n\t\t\n\t\tforeach( $this->ipsclass->cache['emoticons'] as $elmo )\n\t\t{\n\t\t\tif ( $elmo['emo_set'] != $this->ipsclass->skin['_emodir'] )\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t\n\t\t\tif ( ! $elmo['clickable'] )\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t\n\t\t\t$show_table++;\n\t\t\t$count++;\n\t\t\t$smilie_id++;\n\t\t\t\n\t\t\t\n\t\t\t//-----------------------------------------\n\t\t\t// Make single quotes as URL's with html entites in them\n\t\t\t// are parsed by the browser, so ' causes JS error :o\n\t\t\t//-----------------------------------------\n\t\t\t\n\t\t\tif (strstr( $elmo['typed'], \"'\" ) )\n\t\t\t{\n\t\t\t\t$in_delim = '\"';\n\t\t\t\t$out_delim = \"'\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$in_delim = \"'\";\n\t\t\t\t$out_delim = '\"';\n\t\t\t}\n\t\t\t\n\t\t\t$smilies .= \"<td><a href={$out_delim}javascript:emoticon($in_delim\".$elmo['typed'].\"$in_delim, {$in_delim}smid_$smilie_id{$in_delim}){$out_delim}><img id='smid_$smilie_id' src=\\\"\".$this->ipsclass->vars['EMOTICONS_URL'].\"/\".$elmo['image'].\"\\\" alt=$in_delim\".$elmo['typed'].\"$in_delim border='0' /></a></td>\\n\";\n\t\t\t\n\t\t\tif ($count == $this->ipsclass->vars['emo_per_row'])\n\t\t\t{\n\t\t\t\t$smilies .= \"</tr>\\n\\n\";\n\n\t\t\t\tif( $smilie_id < $total )\n\t\t\t\t{\n\t\t\t\t\t$count = 0;\n\t\t\t\t\t$smilies.= \"<tr align='center'>\";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t//-----------------------------------------\n\t\t// Write 'em\n\t\t//-----------------------------------------\n\t\t\n\t\tif ( $count != $this->ipsclass->vars['emo_per_row'] AND $count != 0 )\n\t\t{\n\t\t\tfor ($i = $count ; $i < $this->ipsclass->vars['emo_per_row'] ; ++$i)\n\t\t\t{\n\t\t\t\t$smilies .= \"<td> </td>\\n\";\n\t\t\t}\n\t\t\t$smilies .= \"</tr>\";\n\t\t}\n\t\t\n\t\t$table = $this->ipsclass->compiled_templates['skin_post']->smilie_table();\n\t\t\n\t\tif ($show_table != 0)\n\t\t{\n\t\t\t$table = str_replace( \"<!--THE SMILIES-->\", $smilies, $table );\n\t\t\t$in_html = str_replace( \"<!--SMILIE TABLE-->\", $table, $in_html );\n\t\t}\n\t\t\n\t\treturn $in_html;*/\n\t}",
"function xoops_module_install_smilies(&$module)\n{\n $data = array(\n array(':-D', 'smilies/smil3dbd4d4e4c4f2.gif', 'Very Happy', 1),\n array(':-)', 'smilies/smil3dbd4d6422f04.gif', 'Smile', 1),\n array(':-(', 'smilies/smil3dbd4d75edb5e.gif', 'Sad', 1),\n array(':-o', 'smilies/smil3dbd4d8676346.gif', 'Surprised', 1),\n array(':-?', 'smilies/smil3dbd4d99c6eaa.gif', 'Confused', 1),\n array('8-)', 'smilies/smil3dbd4daabd491.gif', 'Cool', 1),\n array(':lol:', 'smilies/smil3dbd4dbc14f3f.gif', 'Laughing', 1),\n array(':-x', 'smilies/smil3dbd4dcd7b9f4.gif', 'Mad', 1),\n array(':-P', 'smilies/smil3dbd4ddd6835f.gif', 'Razz', 1),\n array(':oops:', 'smilies/smil3dbd4df1944ee.gif', 'Embaressed', 0),\n array(':cry:', 'smilies/smil3dbd4e02c5440.gif', 'Crying (very sad)', 0),\n array(':evil:', 'smilies/smil3dbd4e1748cc9.gif', 'Evil or Very Mad', 0),\n array(':roll:', 'smilies/smil3dbd4e29bbcc7.gif', 'Rolling Eyes', 0),\n array(';-)', 'smilies/smil3dbd4e398ff7b.gif', 'Wink', 0),\n array(':pint:', 'smilies/smil3dbd4e4c2e742.gif', 'Another pint of beer', 0),\n array(':hammer:', 'smilies/smil3dbd4e5e7563a.gif', 'ToolTimes at work', 0),\n array(':idea:', 'smilies/smil3dbd4e7853679.gif', 'I have an idea', 0),\n );\n $types = array(\\PDO::PARAM_STR, \\PDO::PARAM_STR, \\PDO::PARAM_STR, \\PDO::PARAM_INT);\n $db = \\Xoops::getInstance()->db();\n foreach ($data as $sm) {\n list($smiley_code, $smiley_url, $smiley_emotion, $smiley_display) = $sm;\n $smiley = array(\n 'smiley_code' => $smiley_code,\n 'smiley_url' => $smiley_url,\n 'smiley_emotion' => $smiley_emotion,\n 'smiley_display' => $smiley_display,\n );\n $db->insertPrefix('smilies', $smiley, $types);\n }\n return true;\n}",
"function isWikified($content,$checkLinks=false){\n\tif (preg_match(\"|\\n==([^=]+)==|U\",$content))\n\t\treturn true;\n\tif (preg_match(\"|\\n===([^=]+)===|U\",$content))\n\t\treturn true;\n\tif (preg_match(\"|''([^']+)''|U\",$content)) // will find both bold and italic\n\t\treturn true;\n\t// some articles will contain links but no other formatting. We check for links as evidence of wikfication only if requested.\n\tif ($checkLinks){\t// THESE TWO REGULAR EXPRESSIONS ARE NOT TESTED YET\n\t\tif (preg_match(\"|\\[{2}([^\\[\\]]+)\\]{2}|\",$content)) // internal links\n\t\t\treturn true;\n\t\tif (preg_match(\"|\\[http://([^\\[\\]]+)\\]|\",$content)) // external links\n\t\t\treturn true;\n\t}\n\treturn false;\n}",
"function cache_smilies()\n\n {\n\n global $cache;\n\n $this->smilies_cache = array();\n\n\n\n $smilies = $cache->read(\"smilies\");\n\n if(is_array($smilies))\n\n {\n\n foreach($smilies as $sid => $smilie)\n\n {\n\n $this->smilies_cache[$smilie['find']] = \"<img src=\\\"{$this->base_url}{$smilie['image']}\\\" style=\\\"vertical-align: middle;\\\" border=\\\"0\\\" alt=\\\"{$smilie['name']}\\\" title=\\\"{$smilie['name']}\\\" />\";\n\n }\n\n }\n\n }",
"public function content_disable_smilies()\n\t{\n\t\t$this->set_content_option(OPTION_FLAG_SMILIES, true);\n\n\t\treturn $this;\n\t}",
"function sf_convert_custom_smileys($postcontent)\n{\n\tglobal $sfglobals;\n\n\tif($sfglobals['smileyoptions']['sfsmallow'] && $sfglobals['smileyoptions']['sfsmtype']==1)\n\t{\n\t\tif($sfglobals['smileys'])\n\t\t{\n\t\t\tforeach ($sfglobals['smileys'] as $sname => $sinfo)\n\t\t\t{\n\t\t\t\t$postcontent = str_replace($sinfo[1], '<img src=\"'.SFSMILEYS.$sinfo[0].'\" title=\"'.$sname.'\" alt=\"'.$sname.'\" />', $postcontent);\n\t\t\t}\n\t\t}\n\t}\n\treturn $postcontent;\n}",
"function getSmilie($bbcode)\n{\n if (isset($GLOBALS['Smilie_Search'])) {\n $search = &$GLOBALS['Smilie_Search']['code'];\n $replace = &$GLOBALS['Smilie_Search']['img'];\n } else {\n $results = trim(file_get_contents(PHPWS_SOURCE_DIR . '/core/conf/smiles.pak'));\n if (empty($results)) {\n return $bbcode;\n }\n $smiles = explode(\"\\n\", $results);\n foreach ($smiles as $row) {\n $icon = explode('=+:', $row);\n\n if (count($icon) < 3) {\n continue;\n }\n $search[] = '@(?!<.*?)' . preg_quote($icon[2]) . '(?![^<>]*?>)@si';\n $replace[] = sprintf('<img src=\"images/core/smilies/%s\" title=\"%s\" alt=\"%s\" />',\n $icon[0], $icon[1], $icon[1]);\n\n }\n\n $GLOBALS['Smilie_Search']['code'] = $search;\n $GLOBALS['Smilie_Search']['img'] = $replace;\n }\n\n $bbcode = preg_replace($search, $replace, $bbcode);\n return $bbcode;\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/Obtenemos datos de la nota por su nombre | public static function datosNota($nombre) {
if ($nombre) {
return NotaMapper::findByNomNota($nombre);
} else {
return NULL;
}
} | [
"public static function datosNota($nombre) {\n if ($nombre) {\n return NotaMapper::findByNomNota($nombre);\n } else {\n return \"ERROR, no existe la nota\";\n }\n }",
"public function loadDataFromNom(){\r\n $nom = addslashes($this -> getNom());\r\n if( ! empty($nom)){\r\n $query = \"select * from VilleTab where Ville_nom='\".$nom.\"'\";\r\n\r\n $res = execute($query);\r\n if(mysql_num_rows($res) > 0 ){\r\n while($l = mysql_fetch_assoc($res))\r\n $this -> placerChamps($l);//Affectation au champ de cet objet\r\n \r\n }\r\n }\r\n\r\n }",
"public function buscarInstrumentoNom($nombre){ \n $bd = ControladorBD::getControlador();\n $bd->abrirBD();\n $consulta = \"SELECT * FROM instrumentos WHERE nombre = :nombre\";\n $parametros = array(':nombre' => $nombre);\n $filas = $bd->consultarBD($consulta, $parametros);\n $res = $bd->consultarBD($consulta,$parametros);\n $filas=$res->fetchAll(PDO::FETCH_OBJ);\n if (count($filas) > 0) {\n foreach ($filas as $a) {\n $instrumento = new instrumento($a->id, $a->nombre, $a->referencia, $a->distribuidor, $a->tipo, $a->precio, $a->descuento, $a->stockinicial, $a->imagen);\n }\n $bd->cerrarBD();\n return $instrumento;\n }else{\n return null;\n } \n }",
"public static function bucarNombre($cadena){\n $c = Connection::dameInstancia();\n $conexion = $c->dameConexion();\n $consulta = \"Select * from cursos where titulo like '%\".$cadena.\"%' ;\";\n $resultado = $conexion->query($consulta);\n if($resultado->num_rows != 0){\n while($row = $resultado->fetch_assoc()){\n $rows[] = $row ;\n }\n $datos = array('numero' => $resultado->num_rows,'filas_consulta' => $rows );\n return $datos ;\n } else {\n return $datos = array('numero' => 0 ) ;\n }\n }",
"public function nombreAsocId($nombre){\n $todosLosUsuarios = $this->buscarUsuarios();\n $datosDeUsuario = [];\n $idDelUsuario='';\n foreach ($todosLosUsuarios as $usuario) {\n if($usuario['nombre'] == $nombre){\n $datosDeUsuario[] = $usuario;\n }\n }\n foreach ($datosDeUsuario as $dato) {\n $idDelUsuario = $dato['id'];\n }\n\n return $idDelUsuario;\n }",
"private function retrieveGeneralInformation() {\n\n\t\t// istanza della classe\n\t\t$dbc = new DBConnector();\n\t\t// chiamata alla funzione di connessione\n\t\t$dbc->connect();\n\t\t// interrogazione della tabella\n\t\t$sql = \"SELECT id, nome \".\n\t\t\t\t\"FROM classe_documenti AS c \".\n\t\t\t\t\"WHERE c.id = \".$this->id.\" AND c.versione = \".$this->version.\";\";\n\t\t$raw_data = $dbc->query($sql);\n\t\t\t\n\t\tif ($dbc->rows($raw_data)==1) {\n\t\t\t// chiamata alla funzione per l'estrazione dei dati\n\t\t\t$res = $dbc->extract_object($raw_data);\n\t\t\t$this->name = $res->nome;\n\t\t}\n\t\t\t\n\t\t// disconnessione da MySQL\n\t\t$dbc->disconnect();\n\t}",
"public function mostrarUsuariosPorNombreEnTabla()\n\t{\n\t\t$consulta = \"SELECT * FROM \" . $this->tabla . \" WHERE estado = 'ACTV' AND tipo_usuario = 'USU' ORDER BY nombre ASC\";\n\t\t$resultados = Usuarios::ejecutarQuery($consulta);\n\t\t\n\t\t// Pintamos los resultados\n\t\tUsuarios::mostrarResultadosUsuarios($resultados);\n\t}",
"function consultarNotaAprobatoria() {\n\n $variables=array('codProyectoEstudiante'=> $this->datosEstudiante['codProyectoEstudiante'] \n );\n $cadena_sql = $this->sql->cadena_sql(\"nota_aprobatoria\", $variables);\n $resultado = $this->ejecutarSQL($this->configuracion, $this->accesoOracle, $cadena_sql, \"busqueda\");\n return $resultado[0][0];\n }",
"function getNoticiaPrincipal(){\r\n\t\t\t$sql = \"select * from noticias where principal='si'\";\r\n\t\t\t\r\n\t\t\tglobal $conn;\r\n\t\t\tif($result = $conn->query($sql)){\r\n\t\t\t\twhile($row = $result->fetch_row()){\r\n\t\t$seccion = $row[0];\r\n\t\t\t$subseccion= $row[1];\r\n\t\t\t\t\t$indice = $row[2];\r\n $titulo1= $row[3];\r\n $titulo2 = $row[4];\r\n $entradilla = $row[5];\r\n\t\t\t\t\t$texto = $row[6];\r\n\t\t\t\t\t$imagen = $row[7];\r\n \r\n $noticia = new Noticia($subseccion, $indice,$seccion,$titulo1,$titulo2,$entradilla,$texto,$imagen);\r\n array_push($this->array_noticias, $noticia);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn $this->array_noticias;\r\n\t\t}",
"function consultarNotaAprobatoria() {\r\n\r\n $variables=array('codProyectoEstudiante'=> $this->datosEstudiante['CARRERA'] \r\n );\r\n $cadena_sql = $this->sql->cadena_sql(\"nota_aprobatoria\", $variables);\r\n $resultado = $this->ejecutarSQL($this->configuracion, $this->accesoOracle, $cadena_sql, \"busqueda\");\r\n return $resultado[0][0];\r\n }",
"function consultarNotaAprobatoria() {\r\n\r\n $variables=array('codProyectoEstudiante'=> $this->datosEstudiante['CODIGO_CRA'] \r\n );\r\n $cadena_sql = $this->sql->cadena_sql(\"nota_aprobatoria\", $variables);\r\n $resultado = $this->ejecutarSQL($this->configuracion, $this->accesoOracle, $cadena_sql, \"busqueda\");\r\n return $resultado[0][0];\r\n }",
"function getDatosId_nom()\n {\n $nom_tabla = $this->getNomTabla();\n $oDatosCampo = new core\\DatosCampo(array('nom_tabla' => $nom_tabla, 'nom_camp' => 'id_nom'));\n $oDatosCampo->setEtiqueta(_(\"jefe zona\"));\n $oDatosCampo->setTipo('opciones');\n $oDatosCampo->setArgument('personas\\model\\entity\\PersonaDl'); // nombre del objeto relacionado\n $oDatosCampo->setArgument2('getPrefApellidosNombre'); // método para obtener el valor a mostrar del objeto relacionado.\n $oDatosCampo->setArgument3('getListaSacd'); // método con que crear la lista de opciones del Gestor objeto relacionado.\n return $oDatosCampo;\n }",
"function getnameperfilactual(){\n\t\t$dataperfil = $this->getuserdataperfil();\n\t\t$nombre =\"\";\t\t\n\t\tforeach ($dataperfil as $row) {\t\t\t\n\t\t\t$nombre = $row[\"nombreperfil\"];\n\t\t}\n\t\treturn $nombre;\n\t}",
"private function obtenerPorDatos()\r\n {\r\n if ($this->nombre && $this->sector) {\r\n $consulta = \"SELECT * FROM aula WHERE nombre='{$this->nombre}' AND sector='{$this->sector}'\";\r\n $resultado = Conexion::getInstancia()->obtener($consulta);\r\n if (gettype($resultado[0]) == \"array\") {\r\n $fila = $resultado[0];\r\n $this->id = $fila['id'];\r\n $this->nombre = $fila['nombre'];\r\n $this->sector = $fila['sector'];\r\n return array(2, \"Se obtuvo la información del aula correctamente\");\r\n }\r\n return $resultado;\r\n }\r\n Log::guardar(\"INF\", \"AULA --> OBTENER POR DATOS :NOMBRE O SECTOR INVALIDO\");\r\n return array(0, \"No se pudo hacer referencia al aula por su nombre y sector\");\r\n }",
"function get_name() \n\t{\n\t\treturn $this->_aPedido[nombre];\n\t}",
"function mostrarTituloDestacado($conexion,$num){\n //Consultamos que proyecto esta en destacados\n $query = mysqli_query($conexion,\"SELECT * FROM destacados WHERE num='$num' order by num asc limit 1\");\n $row = mysqli_fetch_array($query);\n $id_ps = $row['id_p'];\n //Traemos el nombre del proyecto\n $query = mysqli_query($conexion,\"SELECT * FROM proyecto WHERE id='$id_ps'\");\n $row = mysqli_fetch_array($query);\n $titulo = $row['nom_proyecto'];\n //Retornamos el dato\n return $titulo;\n}",
"function nombre($codigo){\n return TUniversidad::get($codigo,'nombre');\n }",
"public function listaAnexoNome(){\n\t\t$this->sql = \"SELECT anexo_nome from vsites_anexo_nome as an where status='Ativo' order by anexo_nome\";\n\t\t$this->values = array();\n\t\treturn $this->fetch();\n\t}",
"function consultarNombre($Tabla,$CampoCodi,$CampoNomb,$CampoId=\"\")\n\t{\n \t\t$sql=\"SELECT $CampoNomb\n\t\t\t FROM $Tabla\n\t\t\t WHERE $CampoCodi='$CampoId'\";\n\t\t$row=query($sql,1);\n\t\treturn($row[0]);\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Test if handler can output to stdout. | private function canOutput()
{
return !$this->loggerOnly();
} | [
"protected function hasStdoutSupport()\n {\n return false;\n }",
"protected function hasStdoutSupport(): bool\n {\n return false === $this->isRunningOS400();\n }",
"protected function _hasStdoutSupport()\n {\n return ('OS400' != php_uname('s'));\n }",
"public function isOutputting() {}",
"protected function hasStdoutSupport()\n {\n return ('OS400' != php_uname('s'));\n }",
"public function can_output() {\n\t\treturn $this->is_action();\n\t}",
"public function hasStdoutData(): bool\n\t{\n\t\treturn $this->_hasPipeData(1);\n\t}",
"public function usesStdout()\n {\n return true;\n }",
"public function usesStdout()\n {\n return false;\n }",
"public function hasOutput();",
"private static function isStdoutVisible () {\n return static::getInstance()->isStdoutVisible;\n }",
"public function hasOutput($name);",
"protected function hasOutput()\n {\n return $this->output !== null;\n }",
"public static function can_output_buffer() {\n\n\t\t// Output buffering for validation can only be done while overall output buffering is being done for the response.\n\t\tif ( ! AMP_Theme_Support::is_output_buffering() ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Abort when in shutdown since output has finished, when we're likely in the overall output buffering display handler.\n\t\tif ( did_action( 'shutdown' ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Check if any functions in call stack are output buffering display handlers.\n\t\t$called_functions = array();\n\t\tif ( defined( 'DEBUG_BACKTRACE_IGNORE_ARGS' ) ) {\n\t\t\t$arg = DEBUG_BACKTRACE_IGNORE_ARGS; // phpcs:ignore PHPCompatibility.PHP.NewConstants.debug_backtrace_ignore_argsFound\n\t\t} else {\n\t\t\t$arg = false;\n\t\t}\n\t\t$backtrace = debug_backtrace( $arg ); // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_debug_backtrace -- Only way to find out if we are in a buffering display handler.\n\t\tforeach ( $backtrace as $call_stack ) {\n\t\t\t$called_functions[] = '{closure}' === $call_stack['function'] ? 'Closure::__invoke' : $call_stack['function'];\n\t\t}\n\t\treturn 0 === count( array_intersect( ob_list_handlers(), $called_functions ) );\n\t}",
"abstract protected function outputIsOk($hostname, $output);",
"public static function can_output_buffer() {\n\n\t\t// Output buffering for validation can only be done while overall output buffering is being done for the response.\n\t\tif ( ! AMP_Theme_Support::is_output_buffering() ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Abort when in shutdown since output has finished, when we're likely in the overall output buffering display handler.\n\t\tif ( did_action( 'shutdown' ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Check if any functions in call stack are output buffering display handlers.\n\t\t$called_functions = [];\n\t\tif ( defined( 'DEBUG_BACKTRACE_IGNORE_ARGS' ) ) {\n\t\t\t$arg = DEBUG_BACKTRACE_IGNORE_ARGS; // phpcs:ignore PHPCompatibility.Constants.NewConstants.debug_backtrace_ignore_argsFound\n\t\t} else {\n\t\t\t$arg = false;\n\t\t}\n\t\t$backtrace = debug_backtrace( $arg ); // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_debug_backtrace -- Only way to find out if we are in a buffering display handler.\n\t\tforeach ( $backtrace as $call_stack ) {\n\t\t\tif ( '{closure}' === $call_stack['function'] ) {\n\t\t\t\t$called_functions[] = 'Closure::__invoke';\n\t\t\t} elseif ( isset( $call_stack['class'] ) ) {\n\t\t\t\t$called_functions[] = sprintf( '%s::%s', $call_stack['class'], $call_stack['function'] );\n\t\t\t} else {\n\t\t\t\t$called_functions[] = $call_stack['function'];\n\t\t\t}\n\t\t}\n\t\treturn 0 === count( array_intersect( ob_list_handlers(), $called_functions ) );\n\t}",
"public static function can_output_buffer()\n {\n // Output buffering for validation can only be done while overall output buffering is being done for the response.\n if (!\\Google\\Web_Stories_Dependencies\\AMP_Theme_Support::is_output_buffering()) {\n return \\false;\n }\n // Abort when in shutdown since output has finished, when we're likely in the overall output buffering display handler.\n if (\\did_action('shutdown')) {\n return \\false;\n }\n // Check if any functions in call stack are output buffering display handlers.\n $called_functions = [];\n $backtrace = \\debug_backtrace(\\DEBUG_BACKTRACE_IGNORE_ARGS);\n // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_debug_backtrace -- Only way to find out if we are in a buffering display handler.\n foreach ($backtrace as $call_stack) {\n if ('{closure}' === $call_stack['function']) {\n $called_functions[] = 'Closure::__invoke';\n } elseif (isset($call_stack['class'])) {\n $called_functions[] = \\sprintf('%s::%s', $call_stack['class'], $call_stack['function']);\n } else {\n $called_functions[] = $call_stack['function'];\n }\n }\n return 0 === \\count(\\array_intersect(\\ob_list_handlers(), $called_functions));\n }",
"public function hasOutput()\n\t{\n\t\treturn empty($this->outputs) ? false : true;\n\t}",
"public function hasDebugOutput();"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get OAuth token from Twitch. If it exists on disk, read from that instead. If it's too old then get a new one. | public static function getAccessToken($force = false)
{
// token should last 60 days, delete it after 30 just to be sure
if (file_exists(self::$accessTokenFile)) {
// $tokenRefresh = time() - filemtime( self::$accessTokenFile ) > TwitchHelper::$accessTokenRefresh;
// $tokenExpire = time() - filemtime( self::$accessTokenFile ) > TwitchHelper::$accessTokenExpire;
if (time() > filemtime(self::$accessTokenFile) + TwitchHelper::$accessTokenRefresh) {
self::logAdvanced(self::LOG_INFO, "helper", "Deleting old access token");
unlink(self::$accessTokenFile);
}
}
if (!$force && file_exists(self::$accessTokenFile)) {
self::logAdvanced(self::LOG_DEBUG, "helper", "Fetched access token from cache");
return file_get_contents(self::$accessTokenFile);
}
if (!TwitchConfig::cfg('api_secret') || !TwitchConfig::cfg('api_client_id')) {
self::logAdvanced(self::LOG_ERROR, "helper", "Missing either api secret or client id, aborting fetching of access token!");
return false;
}
// oauth2
$oauth_url = 'https://id.twitch.tv/oauth2/token';
$client = new \GuzzleHttp\Client();
try {
$response = $client->post($oauth_url, [
'query' => [
'client_id' => TwitchConfig::cfg('api_client_id'),
'client_secret' => TwitchConfig::cfg('api_secret'),
'grant_type' => 'client_credentials'
],
'headers' => [
'Client-ID: ' . TwitchConfig::cfg('api_client_id')
]
]);
} catch (\Throwable $th) {
self::logAdvanced(self::LOG_FATAL, "helper", "Tried to get oauth token but server returned: " . $th->getMessage());
sleep(5);
return false;
}
$server_output = $response->getBody()->getContents();
$json = json_decode($server_output, true);
if (!$json || !isset($json['access_token']) || !$json['access_token']) {
self::logAdvanced(TwitchHelper::LOG_ERROR, "helper", "Failed to fetch access token: {$server_output}");
throw new \Exception("Failed to fetch access token: {$server_output}");
return false;
}
$access_token = $json['access_token'];
self::$accessToken = $access_token;
file_put_contents(self::$accessTokenFile, $access_token);
self::logAdvanced(TwitchHelper::LOG_INFO, "helper", "Fetched new access token");
return $access_token;
} | [
"private function getOAuthToken()\n {\n if (!isset($this->cache['token'])) {\n if (isset($this->cache['user_id'])) {\n unset($this->cache['user_id']);\n }\n $this->cache['token'] = $this->fetchOAuthToken();\n }\n\n return $this->cache['token'];\n }",
"function jolt_twitch_getToken() {\n $token = get_transient('jolt_twitch_token');\n\n if (false !== $token) {\n return $token;\n }\n\n $twitchClientId = get_option('jolt_twitchClientId', '0');\n $twitchSecret = get_option('jolt_twitchSecret', 'change this secret key');\n $oauthUrl = 'https://id.twitch.tv/oauth2/token';\n\n $payload = [\n 'client_id' => $twitchClientId,\n 'client_secret' => $twitchSecret,\n 'grant_type' => 'client_credentials'\n ];\n\n $headers = [\n 'Content-Type' => 'application/json'\n ];\n\n $response = wp_remote_post($oauthUrl, [\n 'headers' => $headers,\n 'body' => wp_json_encode($payload),\n 'timeout' => 10\n ]);\n\n if (is_wp_error($response)) {\n error_log('Attempt to get token has failed.');\n return false;\n }\n\n $body = wp_remote_retrieve_body($response);\n\n $body = json_decode($body, true);\n\n if ($body === false || !isset($body['access_token'])) {\n return false;\n }\n\n $token = base64_encode($body['access_token']);\n\n set_transient( 'jolt_twitch_token', $token, $body['expires_in'] - 30 );\n\treturn $token;\n}",
"function get_token()\n\t\t{\n\t\t\t$token_file = __DIR__.'/configs/iremote_token.json';\n\t\t\t$token_file = str_replace('/classes','',$token_file);\n\t\t\t\n\t\t\t//load the config variables\n\t\t\tif (@file_exists($token_file))\n\t\t\t{\n\t\t\t\t$current_date = new \\DateTime('', new \\DateTimeZone(\"Europe/London\"));\n\t\t\t\t\n\t\t\t\t//load the config variables\n\t\t\t\tif (@file_exists($token_file))\n\t\t\t\t{\n\t\t\t\t\t$token_array = json_decode(file_get_contents($token_file),1);\n\t\t\t\t\n\t\t\t\t\t//has the token expired?\n\t\t\t\t\t$current_date = new \\DateTime('', new \\DateTimeZone(\"Europe/London\"));\n\t\t\t\t\t$expiry_date = new \\DateTime($token_array['token_expiry']);\n\t\t\t\t\t\n\t\t\t\t\t//token has expired :(\n\t\t\t\t\tif ($current_date > $expiry_date)\n\t\t\t\t\t{\n\t\t\t\t\t\t//but we can get a new one! yay!\n\t\t\t\t\t\t$token_array = iRemote::get_new_token();\n\t\t\t\t\t}\n\n\t\t\t\t\tif ($token_array == null)\n\t\t\t\t\t{\n\t\t\t\t\t\t$token_array = iRemote::get_new_token();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t//otherwise get a new token to play with!\n\t\t\telse\n\t\t\t{\n\t\t\t\t$token_array = iRemote::get_new_token();\n\t\t\t}\n\t\t\treturn $token_array['access_token'];\n\t\t}",
"private function getToken()\n {\n $wbsCommandDir = $this->getWbsCommandDir();\n $tokenPath = $wbsCommandDir . DIRECTORY_SEPARATOR . self::GITHUB_TOKEN_NAME;\n\n $token = @file_get_contents($tokenPath);\n\n if ( ! $token)\n {\n $token = $this->promptToken();\n $this->saveToken($token);\n }\n\n return $token;\n }",
"private static function obtain_token() {\n\t\tglobal $CFG;\n\n\t\t$url = \"https://api.hipchat.com/v2/oauth/token\";\n\n\t\t$ch = curl_init();\n\n\t\tcurl_setopt($ch, CURLOPT_URL, $url);\n\t\tcurl_setopt($ch, CURLOPT_USERPWD, $CFG->oauth_id . \":\" . $CFG->oauth_secret);\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\t\tcurl_setopt($ch, CURLOPT_POST, 1);\n\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS, \"grant_type=client_credentials&scope=admin_room\");\n\t\tcurl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/x-www-form-urlencoded'));\n\n\t\t$body = curl_exec($ch);\n\t\t$data = json_decode($body);\n\n\t\tif (isset($data->access_token)) {\n\t\t\treturn $data->access_token;\n\t\t}\n\t}",
"function get_stored_access_token()\n\t{\n\t\t$string = file_get_contents($this->Dir.'token.json');\n\t\t$result = json_decode($string, true);\n\n\t\treturn $result;\n\t}",
"private function loadAccessToken() {\n\n try {\n $savedAccessTokenString = file_get_contents(self::TOKEN_FILE_PATH);\n $this->log('File token loaded.');\n }\n catch (\\Exception $e) {\n $this->log(\"Failed to open token file. {$e->getMessage()}\", self::LOG_ERROR);\n throw new \\Exception(\"Failed to open token file. {$e->getMessage()}\");\n }\n \n return json_decode($savedAccessTokenString, true);\n\n }",
"function getToken(): string {\n //return $this->_c['inseeToken'];\n if ($this->inseeToken)\n return $this->inseeToken;\n if (($contents = @file_get_contents(__DIR__.'/inseetoken.json')) === false) {\n $this->inseeToken = $this->generateToken(); // génération d'un nouveau token\n return $this->inseeToken;\n }\n $contents = json_decode($contents, true);\n \n $mtime = filemtime(__DIR__.'/inseetoken.json');\n //echo \"fichier modifié le \",date(DATE_ATOM, $mtime),\"<br>\\n\";\n //echo \"fichier modififié il y a \",time()-$mtime,\" secondes<br>\\n\";\n if (time() - $mtime < $contents['expires_in'] - 3600) { // vérification que le token est encore valide\n if (!isset($contents['access_token']))\n throw new Exception(\"Erreur access_token absent du fichier inseetoken.json\");\n $this->inseeToken = $contents['access_token'];\n }\n else {\n $this->inseeToken = $this->generateToken(); // génération d'un nouveau token\n }\n return $this->inseeToken;\n }",
"private function getToken()\n {\n if (!$token = $this->storage->get('access_token')) {\n if (!$token = $this->storage->get('request_token')) {\n $token = new \\stdClass();\n $token->oauth_token = null;\n $token->oauth_token_secret = null;\n }\n }\n return $token;\n }",
"public function getBearerToken()\n {\n\n if ($this->cachePath && file_exists($this->cachePath)) {\n return file_get_contents($this->cachePath);\n }\n\n $token = $this->fetchBearerToken();\n\n if ($this->cachePath) {\n file_put_contents($this->cachePath, $token);\n }\n\n return $token;\n }",
"public function loadAccessToken()\n {\n $loader = new ConfigLoader(__DIR__ . '/../../../config');\n return $loader->load('slack', 'token');\n }",
"function getRequestToken() {\n\t\t$r = $this->oAuthRequest ( $this->requestTokenURL () );\n\t\t$token = $this->oAuthParseResponse ( $r );\n\t\t$this->token = new OAuthConsumer ( $token ['oauth_token'], $token ['oauth_token_secret'] );\n\t\treturn $token;\n\t}",
"public function getAuthToken() \n {\n $lockFile = fopen(\"lock.txt\", \"r\");\n $tokenFile = fopen(\"token.txt\", \"r\");\n while (!feof($tokenFile)) {\n $authToken = rtrim(fgets($tokenFile), \"\\n\");\n $timeout = fgets($tokenFile)-600;\n $timestamp = fgets($tokenFile);\n }\n fclose($tokenFile);\n\n //Lock check.\n if (flock($lockFile, LOCK_EX)) {\n $tokenFile = fopen(\"token.txt\", \"w+\");\n $result = $this->apiAuthenticationToken();\n fwrite($tokenFile, $result['authenticationToken'].\"\\n\");\n fwrite($tokenFile, $result['authenticationTimeout'].\"\\n\");\n fwrite($tokenFile, $result['authenticationTimeStamp']);\n fclose($tokenFile);\n return $result['authenticationToken'];\n } else {\n return $authToken;\n }\n fclose($lockFile); \n }",
"function auth_token_retrieve($scope, $token) {\n $data = db_getOne('\n select data\n from token\n where scope = ? and token = ?', array($scope, $token));\n\n /* Madness. We have to unescape this, because the PEAR DB library isn't\n * smart enough to spot BYTEA columns and do it for us. */\n $data = pg_unescape_bytea($data);\n\n $pos = 0;\n $res = rabx_wire_rd(&$data, &$pos);\n if (rabx_is_error($res)) {\n $res = unserialize($data);\n if (is_null($res))\n err(\"Data for scope '$scope', token '$token' are not valid\");\n }\n\n return $res;\n}",
"protected function _getOAuth () {\n\n\t\t$callback = 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];\n\t\t$encrypter = new \\Dropbox\\OAuth\\Storage\\Encrypter(self::encrypter_secret);\n\t\t$storage = new \\Dropbox\\OAuth\\Storage\\Session($encrypter);\n\n\t\t// spoof storage using token stored with plugin\n\t\tif ($this->is_authorized()) {\n\t\t\t$storage->set($this->_plugin->setting(self::token_setting), 'access_token');\n\t\t}\n\n\t\t$OAuth = new \\Dropbox\\OAuth\\Consumer\\Curl(self::consumer_key, self::consumer_secret, $storage, $callback);\n\n\t\treturn $OAuth;\n\t}",
"public function getOAuthToken()\n {\n return $this->oauthToken->getToken();\n }",
"function load_credentials_from_file()\n{\n // Get OAuth 2.0 credentials from auth_credentials.json file.\n $credentials = file_get_contents(dirname(__FILE__) . '/auth_credentials.json');\n if ($credentials===false) {\n throw new \\Exception(\"Couldn't read OAuth credentials from auth_credentials.json. Make sure \" .\n \"the file exists (if not, copy from auth_credentials.json.dist).\");\n }\n\n $credentials = json_decode($credentials, true);\n if (!is_array($credentials)) {\n throw new \\Exception(\"Invalid auth credentials\\n\"); \n }\n\n // Try to read access_token.json and merge it with the rest of credentials.\n if (is_readable(dirname(__FILE__) . '/access_token.json')) {\n $accessToken = file_get_contents(dirname(__FILE__) . '/access_token.json');\n\n $accessToken = json_decode($accessToken, true);\n if (!is_array($accessToken)) {\n throw new Exception(\"Invalid access token format\"); \n }\n\n $credentials = array_merge($credentials, $accessToken);\n }\n \n return $credentials;\n}",
"function loadToken() {\r\n\t\treturn isset($_SESSION['token']) ? $_SESSION['token'] : null;\r\n\t}",
"public function ReadToken() {\n if ($token = $this->Session->read('Auth.User.fb_token')) {\n //Destroy current token\n $this->Session->delete('Auth.User.fb_token');\n //return\n return $token;\n } else {\n return NULL;\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns a list of refund objects linked with this capture. | public function getRefunds() {
return $this->refunds;
} | [
"public function getRefunds()\n {\n return $this->refunds;\n }",
"public function getRefundItems();",
"public function all()\n {\n $items = array();\n\n // API request\n $resp = $this->api->request->getAll(\"/payments/{$this->payment}/refunds\");\n\n foreach ($resp as $item) {\n $items[] = new Refund($this->api, $item);\n }\n\n return $items;\n }",
"public function getRefunds ()\n {\n return $this->getShopRefunds();\n }",
"public function getRefundArray()\n {\n return $this->refundArray;\n }",
"public function getRefundableItems() {\n\t\t$items = $this->getCaptureItems();\n\t\tforeach ($this->getRefunds() as $refund) {\n\t\t\t$items = Customweb_Util_Invoice::substractLineItems($items, $refund->getRefundItems());\n\t\t}\n\t\n\t\treturn $items;\n\t}",
"public function refunds()\n {\n return new Refund($this);\n }",
"public function listRefundsPayment(){\n return new ListaDeDevolucionesDeUnPagoApi($this->client, $this->config, $this->headerSelector);\n }",
"public function refund_items()\n {\n return $this->hasMany(RefundItemProxy::modelClass());\n }",
"public function getRefunds(): ?array\n {\n return $this->refunds;\n }",
"public function getRefundLines()\n {\n return $this->refundLines;\n }",
"function getRefunds($tid)\r\n {\r\n $url_path = \"transactions/$tid/refunds\";\r\n\r\n try {\r\n \t$request = new Request($this->security);\r\n \t$response = $request->get($url_path);\r\n }\r\n catch (\\Exception $e){\r\n \t$response = new RefundListResponse();\r\n \t$response->setReturnCode(ReturnCode::UNSUCCESSFUL);\r\n \t$response->setReturnMessage($e->getMessage());\r\n return $response;\r\n }\r\n \r\n $refundListResponse = RefundListResponse::mapFromJson($response);\r\n\r\n return $refundListResponse;\r\n }",
"public function refundDetails(){\n return new ObtieneLosDetallesDeUnaDevolucinRealizadaApi($this->client, $this->config, $this->headerSelector);\n }",
"public function getRefund()\n {\n if (isset($this->data->refunds[0])) {\n return $this->objectHelper->buildRefund($this->data->refunds[0]);\n }\n return null;\n }",
"public function getRefundTransactionArray()\n {\n return $this->refundTransactionArray;\n }",
"public function getRefundEvents()\n {\n if (isset($this->list['Refund'])) {\n return $this->list['Refund'];\n } else {\n return false;\n }\n }",
"public function refund()\n {\n return $this->belongsTo(RefundProxy::modelClass());\n }",
"public function testGETCaptureIdRefunds()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }",
"public function getRefundEventList()\n {\n if ($this->_fields['RefundEventList']['FieldValue'] == null)\n {\n $this->_fields['RefundEventList']['FieldValue'] = array();\n }\n return $this->_fields['RefundEventList']['FieldValue'];\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Determine whether the user can view unpublished articles. | public function viewUnpublished(User $user): bool
{
return true;
} | [
"public function canBeViewed()\n\t{\n\t\treturn $this->isPublished()\n\t\t\t|| ($this->getPostStatus() === 'private' && Mage::getSingleton('customer/session')->isLoggedIn());\n\t}",
"public function isPublished()\n {\n return $this->access !== LibBaseDomainBehaviorPrivatable::ADMIN;\n }",
"public function isUnpublished() {\n\t\treturn $this->hasStatus(self::statusUnpublished);\n\t}",
"public function visibleArticle() {\n\t\treturn $this->isPublished () || ($this->isAwaitingChanges () && $this->checkIfWriter ()) || isEditor ();\n\t}",
"public function canView($user, Article $article)\n {\n if ($article->get('visibility') !== 'public' && empty($user)) {\n return false;\n }\n\n return true;\n }",
"function isViewable()\n {\n \n if (sfContext::getInstance()->getUser()->hasCredential(\"viewallcontent\"))\n { \r\n \tsfContext::getInstance()->getLogger()->info(\"You have the fu, you can see me.\");\n \treturn true;\n } \n\n // Access to approved artork is for anyone\n if ($this->isApproved()) \n {\n sfContext::getInstance()->getLogger()->info(\"This artwork is approved, so it is viewable\");\n \treturn true;\n }\n\n // Access to removed artwork is only for admin (returned true above)\n if ($this->isRemoved())\n {\n sfContext::getInstance()->getLogger()->info(\"This artwork is removed, and cannot be seen\");\n \treturn false;\n }\n \n // also allow access to owner of artwork - unless they have removed it\n if (sfContext::getInstance()->getUser()->isAuthenticated()\n && $this->getUserId() == sfContext::getInstance()->getUser()->getGuardUser()->getId())\n {\n sfContext::getInstance()->getLogger()->info(\"You can see this artwork since you are the owner\");\n \treturn true;\n }\n\n sfContext::getInstance()->getLogger()->info(\"This artwork is not approved, and cannot be seen\");\n return false;\n }",
"public function testAnonymousCannotViewUnpublishedNodesWithoutTermPermissions(): void {\n $this->assertFalse($this->nodes['node_unpublished']->isPublished());\n $this->assertEquals(AccessResult::neutral(), permissions_by_entity_entity_access($this->nodes['node_unpublished'], 'view', $this->anonymousUser));\n $this->assertFalse($this->nodes['node_unpublished']->access('view', $this->anonymousUser));\n }",
"public function non_admin_users_cannot_visit_the_admin_news_page()\n {\n // Permite obtener más detalles al correr las pruebas\n // $this->withoutExceptionHandling();\n \n $this->actingAs($this->createOperator())\n ->get(route('admin.admin_news_page'))\n // Indica que la ruta está prohibida. La ruta puede existir y uno está conectado, pero no tiene permiso para verla\n ->assertStatus(403);\n }",
"public function canPublish() {\n\t\treturn $this->canEdit();\n\t}",
"public function unpublished()\n\t{\n\t\treturn ! $this->published();\n\t}",
"public function canUserView()\n\t{\n\t\tfor($i = 0; $i < sizeof($this->_nonViewers); $i++)\n\t\t{\n\t\t\tif($this->_userRole == $this->_nonViewers[$i] && $this->layout != null)\n\t\t\t{\n\t\t\t\t$this->actionIndex();\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}",
"public function isPrivate()\n\t{\n\t\treturn $this->get('status') == App\\CustomView::CV_STATUS_PRIVATE;\n\t}",
"private function checkPermission()\r\n {\r\n $result = array();\r\n // get article status and its node status\r\n $valide = $this->model->action('article','getStatus',\r\n array('id_article' => (int)$this->current_id_article,\r\n 'result' => & $result));\r\n\r\n // check if the article is accessible\r\n if( ($valide == false) ||\r\n ($result['nodeStatus'] < $this->node_status) ||\r\n ($result['articleStatus'] < $this->article_status))\r\n {\r\n // switch to the index page\r\n $this->router->redirect();\r\n }\r\n\r\n if( $this->viewVar['isUserLogged'] == false )\r\n {\r\n // the requested article is only available for registered users\r\n if( ($result['nodeStatus'] == 3) ||\r\n ($result['articleStatus'] == 5) )\r\n {\r\n // set url vars to come back to this page after login\r\n $this->model->session->set('url','id_article/'.$this->current_id_article);\r\n // switch to the login page\r\n $this->router->redirect( 'cntr/login' );\r\n }\r\n }\r\n }",
"static public function isUserHasSomeViewAccess()\n\t{\n\t\ttry{\n\t\t\tself::checkUserHasViewAccess( $idSites );\n\t\t\treturn true;\n\t\t} catch( Exception $e){\n\t\t\treturn false;\n\t\t}\n\t}",
"public function unpublished()\n {\n return $this->published_at === NULL;\n }",
"public function canView()\n\t{\n\t\t// Assert the object is loaded.\n\t\t$this->assertIsLoaded();\n\n\t\t// Check if an access level is set.\n\t\tif (isset($this->access))\n\t\t{\n\t\t\t// Get the user's authorised view levels.\n\t\t\t$levels = $this->user->getAuthorisedViewLevels();\n\n\t\t\t// Check if the user has access.\n\t\t\treturn in_array($this->access, $levels);\n\t\t}\n\n\t\treturn null;\n\t}",
"public function isViewAllowed()\n {\n return $this->isAllowedAction('view');\n }",
"public function viewAny()\n {\n return auth()->user()->can('permission_access');\n }",
"function is_post_publicly_viewable($post = \\null)\n {\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create request for operation 'blockDigitalKey' | protected function blockDigitalKeyRequest($site_id, $medium_id, $body = null)
{
// verify the required parameter 'site_id' is set
if ($site_id === null || (is_array($site_id) && count($site_id) === 0)) {
throw new \InvalidArgumentException(
'Missing the required parameter $site_id when calling blockDigitalKey'
);
}
// verify the required parameter 'medium_id' is set
if ($medium_id === null || (is_array($medium_id) && count($medium_id) === 0)) {
throw new \InvalidArgumentException(
'Missing the required parameter $medium_id when calling blockDigitalKey'
);
}
$resourcePath = '/{siteId}/digitalKey/{mediumId}/block';
$formParams = [];
$queryParams = [];
$headerParams = [];
$httpBody = '';
$multipart = false;
// path params
if ($site_id !== null) {
$resourcePath = str_replace(
'{' . 'siteId' . '}',
ObjectSerializer::toPathValue($site_id),
$resourcePath
);
}
// path params
if ($medium_id !== null) {
$resourcePath = str_replace(
'{' . 'mediumId' . '}',
ObjectSerializer::toPathValue($medium_id),
$resourcePath
);
}
// body params
$_tempBody = null;
if (isset($body)) {
$_tempBody = $body;
}
if ($multipart) {
$headers = $this->headerSelector->selectHeadersForMultipart(
['application/json']
);
} else {
$headers = $this->headerSelector->selectHeaders(
['application/json'],
['application/json']
);
}
// for model (json/xml)
if (isset($_tempBody)) {
// $_tempBody is the method argument, if present
$httpBody = $_tempBody;
if($headers['Content-Type'] === 'application/json') {
// \stdClass has no __toString(), so we should encode it manually
if ($httpBody instanceof \stdClass) {
$httpBody = \GuzzleHttp\json_encode($httpBody);
}
// array has no __toString(), so we should encode it manually
if(is_array($httpBody)) {
$httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
}
}
} elseif (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
$multipartContents[] = [
'name' => $formParamName,
'contents' => $formParamValue
];
}
// for HTTP post (form)
$httpBody = new MultipartStream($multipartContents);
} elseif ($headers['Content-Type'] === 'application/json') {
$httpBody = \GuzzleHttp\json_encode($formParams);
} else {
// for HTTP post (form)
$httpBody = \GuzzleHttp\Psr7\Query::build($formParams);
}
}
// this endpoint requires HTTP basic authentication
if ($this->config->getUsername() !== null || $this->config->getPassword() !== null) {
$headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword());
}
$defaultHeaders = [];
if ($this->config->getUserAgent()) {
$defaultHeaders['User-Agent'] = $this->config->getUserAgent();
}
$headers = array_merge(
$defaultHeaders,
$headerParams,
$headers
);
$query = \GuzzleHttp\Psr7\Query::build($queryParams);
return new Request(
'POST',
$this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
} | [
"protected function getPrivateKeysRequest()\n {\n\n $resourcePath = '/v1/account/privkey';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\Query::build($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if ($this->config->getUsername() !== null || $this->config->getPassword() !== null) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\Query::build($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function swarmUnlockkeyRequest()\n {\n\n $resourcePath = '/swarm/unlockkey';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json', 'text/plain']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json', 'text/plain'],\n []\n );\n }\n\n // for model (json/xml)\n if (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\Query::build($formParams);\n }\n }\n\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\Query::build($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function createSigningKeyRequest($create_signing_key_request = null)\n {\n $resourcePath = '/signing_key';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // For model (json/xml)\n if (isset($create_signing_key_request)) {\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($create_signing_key_request));\n } else {\n $httpBody = $create_signing_key_request;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem,\n ];\n }\n }\n\n // For HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n } else {\n // For HTTP post (form)\n $httpBody = ObjectSerializer::buildQuery($queryParams);\n }\n }\n\n // this endpoint requires OAuth (access token)\n if (! empty($this->config->getAccessToken())) {\n $headers['Authorization'] = 'Bearer '.$this->config->getAccessToken();\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = ObjectSerializer::buildQuery($queryParams);\n\n return new Request(\n 'POST',\n $this->config->getHost().$resourcePath.($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function request() {\n\t\t$request_id = $this->api->post('/portal/requests', array(\n\t\t\t'by_user' => $this->user->get_tyk_id(),\n\t\t\t'for_plan' => $this->policy,\n\t\t\t// it's possible to have key requests approved manually\n\t\t\t'approved' => TYK_AUTO_APPROVE_KEY_REQUESTS,\n\t\t\t// this is a bit absurd but tyk api doesn't set this by itself\n\t\t\t'date_created' => date('c'),\n\t\t\t'version' => 'v2',\n\t\t\t));\n\n\t\t// save key request id\n\t\tif (is_string($request_id)) {\n\t\t\t$this->id = $request_id;\n\t\t}\n\t\telse {\n\t\t\tthrow new UnexpectedValueException('Received an invalid response for key request');\n\t\t}\n\t}",
"function libvirt_domain_send_key_api($res, int $codeset, int $holdtime, array $keycodes, int $flags = 0) : bool\n{\n}",
"protected function generateWebhookSecretRequest()\n {\n\n $resourcePath = '/v1/account/webhook_settings/secret';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\Query::build($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if ($this->config->getUsername() !== null || $this->config->getPassword() !== null) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\Query::build($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function getSigningKeysRequest()\n {\n $resourcePath = '/signing_key';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // For model (json/xml)\n if (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem,\n ];\n }\n }\n\n // For HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n } else {\n // For HTTP post (form)\n $httpBody = ObjectSerializer::buildQuery($queryParams);\n }\n }\n\n // this endpoint requires OAuth (access token)\n if (! empty($this->config->getAccessToken())) {\n $headers['Authorization'] = 'Bearer '.$this->config->getAccessToken();\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = ObjectSerializer::buildQuery($queryParams);\n\n return new Request(\n 'GET',\n $this->config->getHost().$resourcePath.($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function getSignatureRequestKey();",
"public function createRequest($data = array()) {\n return new Service24PayRequest($this, $data);\n }",
"protected function blacklistedKeyCreateRequest($project_id, $blacklisted_key_create_parameters, $x_phrase_app_otp = null)\n {\n // verify the required parameter 'project_id' is set\n if ($project_id === null || (is_array($project_id) && count($project_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $project_id when calling blacklistedKeyCreate'\n );\n }\n // verify the required parameter 'blacklisted_key_create_parameters' is set\n if ($blacklisted_key_create_parameters === null || (is_array($blacklisted_key_create_parameters) && count($blacklisted_key_create_parameters) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $blacklisted_key_create_parameters when calling blacklistedKeyCreate'\n );\n }\n\n $resourcePath = '/projects/{project_id}/blacklisted_keys';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // header params\n if ($x_phrase_app_otp !== null) {\n $headerParams['X-PhraseApp-OTP'] = ObjectSerializer::toHeaderValue($x_phrase_app_otp);\n }\n\n // path params\n if ($project_id !== null) {\n $resourcePath = str_replace(\n '{' . 'project_id' . '}',\n ObjectSerializer::toPathValue($project_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n if (isset($blacklisted_key_create_parameters)) {\n $_tempBody = $blacklisted_key_create_parameters;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\Query::build($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\Query::build($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"private function get_block_trip_request($booking_params) {\r\n\t\t$age_band = json_decode(base64_decode($booking_params['age_band']),true);\t\r\n\t\t$response ['status'] = true;\r\n\t\t$response ['data'] = array ();\r\n\t\t$request = array();\r\n\t\t$request['ProductCode'] = $booking_params['product_code'];\r\n\t\t$request['GradeCode'] = $booking_params['grade_code'];\r\n\t\t$request['BookingDate'] = $booking_params['booking_date'];\r\n\t\t$request['ResultToken'] = $booking_params['tour_uniq_id'];\r\n\t\t$request['ageBands'] = $age_band;\r\n\t\t$response ['data'] ['request'] = json_encode ( $request );\r\n\t\t$this->credentials ( 'BlockTrip' );\r\n\t\t$response ['data'] ['service_url'] = $this->service_url;\r\n\t\treturn $response;\r\n\t}",
"function sign_checkout_request($amount, $currency, $private_key)\n{\n $data = json_encode(array(\n 'charge' => array(\n 'amount' => $amount,\n 'currency' => $currency\n )\n ));\n\n $signarute = hash_hmac('sha256', $data, $private_key);\n return base64_encode($signarute . \"|\" . $data);\n}",
"function create()\n {\n $createKeyResponse = $this->keyVaultKey->create($this->name, $this->key_type, $this->key_size);\n\n if ($createKeyResponse[\"responsecode\"] == 200) {\n\n //Extract the modulus \"n\" amd exponent \"e\" of the public key\n $this->public_key_n = $createKeyResponse['data']['key']['n'];\n $this->public_key_e = $createKeyResponse['data']['key']['e'];\n\n //Extract the possible key operations as an array\n $this->key_ops = json_encode( $createKeyResponse['data']['key']['key_ops']);\n\n //Extract the key key reference in Azure\n $this->key_version = $createKeyResponse['data']['key']['kid'];\n\n //Generate a unique random ID for the Keys ID column\n $this->id = uniqid(rand(),false);\n\n //Usage is \"General\" for the \"Create Key\" request\n $this->usage = \"General\";\n\n $this->vault_id = '1320b3cb-860b-4ea4-8a60-a01e138834ff';\n\n /*Insert Key and attributes into Database\n */\n $query = \"INSERT INTO \n \".$this->table_name.\"\n (`id`, `name`, `user_id`, `use`, `public_key_n`,`vault_id`,`public_key_e`, `key_ops`,`key_type`, `key_size`,`key_version`) \n VALUES \n ('$this->id','$this->name','$this->user_id','$this->usage', '$this->public_key_n','$this->vault_id','$this->public_key_e','$this->key_ops','$this->key_type','$this->key_size','$this->key_version')\";\n\n\n //prepare query\n $stmt = $this->conn->prepare($query);\n\n try{\n if( $stmt->execute())\n return true;\n\n } catch(PDOException $exception){\n echo \"Connection error: \" . $exception->getMessage();\n }\n\n return false;\n }\n\n else{\n return false;\n }\n\n }",
"public function createRequest($data = array()) {\n\t\treturn new Service24PayRequest($this, $data);\n\t}",
"protected function getPublicKeysRequest()\n {\n\n $resourcePath = '/v1/account/pubkey';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\Query::build($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if ($this->config->getUsername() !== null || $this->config->getPassword() !== null) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\Query::build($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"function openssl_spki_new(&$privkey, &$challenge, $algorithm = false)\n{\n}",
"protected function getDigitalKeyRequest($site_id, $medium_id)\n {\n // verify the required parameter 'site_id' is set\n if ($site_id === null || (is_array($site_id) && count($site_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $site_id when calling getDigitalKey'\n );\n }\n // verify the required parameter 'medium_id' is set\n if ($medium_id === null || (is_array($medium_id) && count($medium_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $medium_id when calling getDigitalKey'\n );\n }\n\n $resourcePath = '/{siteId}/digitalKey/{mediumId}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($site_id !== null) {\n $resourcePath = str_replace(\n '{' . 'siteId' . '}',\n ObjectSerializer::toPathValue($site_id),\n $resourcePath\n );\n }\n // path params\n if ($medium_id !== null) {\n $resourcePath = str_replace(\n '{' . 'mediumId' . '}',\n ObjectSerializer::toPathValue($medium_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n \n if($headers['Content-Type'] === 'application/json') {\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n // array has no __toString(), so we should encode it manually\n if(is_array($httpBody)) {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));\n }\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\Query::build($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if ($this->config->getUsername() !== null || $this->config->getPassword() !== null) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\Query::build($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function RequestNewApiKey() {\n return $this->sendRequest('account/requestnewapikey', array());\n }",
"public function createDigitalAccessKeyRequest($amazonOrderId, $marketplaceIds, $body)\n {\n // verify the required parameter 'amazonOrderId' is set\n if ($amazonOrderId === null || (is_array($amazonOrderId) && count($amazonOrderId) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $amazonOrderId when calling createDigitalAccessKey'\n );\n }\n // verify the required parameter 'marketplaceIds' is set\n if ($marketplaceIds === null || (is_array($marketplaceIds) && count($marketplaceIds) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $marketplaceIds when calling createDigitalAccessKey'\n );\n }\n if (count($marketplaceIds) > 1) {\n throw new \\InvalidArgumentException('invalid value for \"$marketplaceIds\" when calling MessagingApi.createDigitalAccessKey, number of items must be less than or equal to 1.');\n }\n\n // verify the required parameter 'body' is set\n if ($body === null || (is_array($body) && count($body) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $body when calling createDigitalAccessKey'\n );\n }\n\n $resourcePath = '/messaging/v1/orders/{amazonOrderId}/messages/digitalAccessKey';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if (is_array($marketplaceIds)) {\n $marketplaceIds = ObjectSerializer::serializeCollection($marketplaceIds, 'form', true);\n }\n if ($marketplaceIds !== null) {\n $queryParams['marketplaceIds'] = $marketplaceIds;\n }\n\n\n // path params\n if ($amazonOrderId !== null) {\n $resourcePath = str_replace(\n '{' . 'amazonOrderId' . '}',\n ObjectSerializer::toPathValue($amazonOrderId),\n $resourcePath\n );\n }\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/hal+json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/hal+json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($body)) {\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($body));\n } else {\n $httpBody = $body;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Read line from given SB socket | private function sb_readln($socket) {
$data = @fgets($socket, 4096);
if ($data !== false) {
$data = trim($data);
$this->debug_message("SB: <<< $data");
}
return $data;
} | [
"function readsockline($socket)\n{\n $line = '';\n while (true)\n {\n $byte = socket_read($socket, 1024);\n if ($byte == '')\n break;\n $line .= $byte;\n }\n\n return trim($line);\n}",
"function socketReadLine(){\r\n\t\treturn fgets($this->socketFromClientToServer);\r\n\t}",
"function handleRead($sock, $line) {\n $line = trim($line);\n $this->parseLine($sock, $line);\n }",
"public function readLine();",
"public function readLine(): string\n\t{\n\t\t$line = fgets($this->connection);\n\n\t\tif($line === false || $line === '')\n\t\t{\n\t\t\tthrow new RedisException($this->appendReadErrorReason('Failed to read line from the server.'));\n\t\t}\n\n\t\treturn $line;\n\t}",
"protected function readLine() {\n\t\tif (!$this->buffer || strpos($this->buffer, \"\\n\") === FALSE) {\n\t\t\t$buffer = fread($this->handle, 4096);\n\t\t\t$this->buffer .= $buffer;\n\t\t}\n\t\t$pos = strpos($this->buffer, \"\\n\");\n\t\tif ($pos > 0) {\n\t\t\t$line = rtrim(substr($this->buffer, 0, $pos), \"\\r\");\n\t\t\t$this->buffer = substr($this->buffer, $pos + 1);\n\t\t} else {\n\t\t\t$line = rtrim($this->buffer, \"\\r\");\n\t\t\t$this->buffer = '';\n\t\t}\n\t\t$this->line++;\n\t\treturn trim($line);\n\t}",
"public function smtp_getline() \n {\n $ret = \"\"; \n \n if (count(explode(\"\\n\",$this->_sock_buff)) < 2) { \n $ret = null; \n while ($line = @ socket_read($this->_socket,512,PHP_BINARY_READ)) {\n $this->_sock_buff .= $line;\n if (count(explode(\"\\n\",$this->_sock_buff)) > 1) {\n $ret = \"\";\n break;\n } \n }\n }\n \n if ($ret === null) { \n return null;\n }\n \n $tmpa = explode(\"\\n\",$this->_sock_buff);\n $ret = array_shift($tmpa);\n if (count($tmpa) > 0) {\n $this->_sock_buff = implode(\"\\n\",$tmpa);\n } else {\n $this->_sock_buff = \"\";\n }\n \n $tmp = strlen($ret);\n if ($tmp > 0) {\n if ($ret[$tmp - 1] == \"\\r\") {\n $ret = substr($ret,0,$tmp - 1);\n }\n }\n return $ret; \n }",
"public static function read_line_from_socket($socket, $bytes_to_read = null, $timeout = null, $trim = true){\r\n\r\n if ($timeout === null){\r\n $timeout = 2;\r\n }\r\n $sockets = array($socket);\r\n $line = \"\";\r\n $return_found = false;\r\n while (1){\r\n $write = null;\r\n $except = null;\r\n $num_sockets_modified = socket_select($sockets, $write, $except, $timeout);\r\n if (!$num_sockets_modified || count($sockets) == 0){\r\n // no more data coming in, so just return what we have\r\n if ($trim){\r\n $line = trim($line);\r\n }\r\n return array(\r\n \"success\" => true,\r\n \"line\" => $line\r\n );\r\n }\r\n $data = @socket_read($socket, 1, PHP_BINARY_READ);\r\n\r\n // connection was dropped\r\n if ($data === false) {\r\n return array(\r\n \"success\" => false,\r\n \"error_msg\" => \"Connection has been dropped\"\r\n );\r\n }\r\n\r\n $line .= $data;\r\n\r\n if ($bytes_to_read !== null){\r\n if (strlen($line) == $bytes_to_read){\r\n if ($trim){\r\n $line = trim($line);\r\n }\r\n return array(\r\n \"success\" => true,\r\n \"line\" => $line,\r\n );\r\n }\r\n }\r\n\r\n if ($data == \"\\r\"){\r\n $return_found = true;\r\n }\r\n else if ($return_found && $data == \"\\n\"){\r\n if ($trim){\r\n $line = trim($line);\r\n }\r\n return array(\r\n \"success\" => true,\r\n \"line\" => $line,\r\n );\r\n }\r\n else {\r\n $return_found = false;\r\n }\r\n\r\n }\r\n\r\n }",
"function read(){ \n $data = \"\";\n while (true){\t\t\t\n $c = @socket_read($this->sock, 1);\t\t\t\n \n if ($c === false || $c == \"\") return \"\";\n if ($c == \"\\n\") return $data;\n $data .= $c;\n } \n }",
"public function readLineFromSocketWithGivenLength()\n {\n $this->mockSocket->expects($this->once())\n ->method('readLine')\n ->with($this->equalTo(3))\n ->will($this->returnValue('foo'));\n $this->assertEquals('foo', $this->socketInputStream->readLine(3));\n }",
"function read()\n\t{\n\t\t$data = fread($this->_socket, 1);\n\t\t$status = socket_get_status($this->_socket);\n\t\tif (isset($status['unread_bytes']) && $status['unread_bytes'] > 0)\n\t\t\t$data .= fread($this->_socket, $status['unread_bytes']);\n\t\treturn substr($data, 4);\n\t}",
"public function read($socket)\n {\n return trim(socket_read($socket, 2048, PHP_BINARY_READ));\n }",
"public function read_line ()\n {\n if (feof ($this->resource))\n return false;\n\n return fgets ($this->resource, 4096);\n }",
"function stream_get_line ($handle, $length, $ending = null) {}",
"public function get_message_part_line() {\n\n\t\t$line=false;\n\t\t$leftOver = $this->message_part_size-$this->message_part_read;\n\t\tif($leftOver>0){\n\n\t\t\t//reading exact length doesn't work if the last char is just one char somehow.\n\t\t\t//we cut the left over later with substr.\n\t\t\t$blockSize = 1024;//$leftOver>1024 ? 1024 : $leftOver;\n\t\t\t$line = fgets($this->handle,$blockSize);\n\t\t\t$this->message_part_read+=strlen($line);\n\t\t}\n\n\t\tif ($this->message_part_size < $this->message_part_read) {\n\n\t\t\t$line = substr($line, 0, ($this->message_part_read-$this->message_part_size)*-1);\n\t\t}\n\n\t\tif($line===false){\n\n\t\t\t//read and check left over response.\n\t\t\t$response=$this->get_response();\n\t\t\t$this->check_response($response);\n\n\t\t}\n\t\treturn $line;\n\t}",
"function parseLine($sock, $line) {\n $this->gM('ParseUtil')->clear();\n $this->last_in = $line;\n $this->eventServer->sendEvent(new IrcEvent('raw', Array($line)));\n $dt = strftime('%m/%d/%y %T');\n echo \"DATA IN [$dt]: $line\\r\\n\";\n if($line[0] == ':') {\n $line = substr($line, 1);\n }\n //split line by spaces\n $arg = explode(' ', $line);\n //get line after :\n $text = arg_range($arg, 3, -1);\n if(strlen($text) > 0 && $text[0] == ':') {\n $text = substr($text, 1);\n }\n //$text = substr($line, strpos($line, ':')); //this will break if channel name has :\n switch($arg[0]) {\n case 'PING':\n $this->pSockets->send($sock, \"PONG $arg[1]\\r\\n\");\n return;\n default:\n $nick = explode('!', $arg[0]);\n if(array_key_exists(1, $nick)) { //sometimes the irc server itself sets things\n $host = $nick[1];\n } else {\n $host = $nick[0];\n }\n $nick = $nick[0];\n }\n $this->gM('ParseUtil')->set('nick', $nick);\n $this->gM('ParseUtil')->set('access', $host);\n $this->gM('ParseUtil')->set('hand', $host);\n $this->gM('ParseUtil')->set('host', $host);\n \n $this->Nicks->tppl($nick, $host);\n \n switch($arg[1]) {\n case 'JOIN':\n $this->pJoin($nick, $host, $arg);\n break;\n case 'NICK':\n $this->pNick($nick, $arg);\n break;\n case 'PART':\n $this->pPart($nick, $arg);\n break;\n case 'KICK':\n $this->pKick($nick, $arg);\n break;\n case 'PRIVMSG':\n $this->pPrivmsg($nick, $arg, $text);\n break;\n case 'NOTICE':\n $this->pNotice($nick, $arg, $text);\n break;\n case 'TOPIC':\n $this->pTopic($nick, $arg, $text);\n break;\n case 'QUIT':\n $this->pQuit($nick, $arg);\n break;\n case 'MODE': //TODO handle hook masks on all hooktype that use\n $this->pMode($nick, $arg);\n break;\n default:\n //check it its numeric\n if (!is_numeric($arg[1])) {\n break;\n }\n $this->parseNumeric($arg, $line);\n }\n }",
"public function readLine($sequence)\n {\n if (isset($this->out) && !feof($this->out)) {\n $line = fgets($this->out);\n if (strlen($line) == 0) {\n $metas = stream_get_meta_data($this->out);\n if (isset($metas['timedout']) && ($metas['timedout'])) {\n throw new Exception('Connection to ' . $this->getReadConnectionDescription() . ' Timed Out');\n }\n }\n\n return $line;\n }\n }",
"public function read_nntp_buffer($socket)\n {\n $this_line =\"\";\n $buffer =\"\";\n\n while($this_line!=\".\\r\\n\") { // Read until lone . found on line\n $this_line = fgets($socket); // Read line from socket\n $buffer = $buffer . $this_line;\n #\n # UNCOMMENT THE FOLLOWING LINE IF YOU NEED TO SEE PROGRESS (This script may take a long time to run).\n # echo \"this_line=$this_line;<br>\";\n #\n }\n return $buffer;\n }",
"public function readLine()\n {\n // Retrieve a handle for reading.\n $handle = $this->getReadHandle();\n // Read a line.\n $firstLine = (ftell($handle) === 0);\n $rawLine = fgets($handle);\n // Return next line or EOF.\n if ($rawLine === false) {\n $line = null;\n // If this is the first line, remove the BOM if present.\n } else {\n if ($firstLine) {\n $line = DFileStream::removeBom($rawLine);\n } else {\n $line = $rawLine;\n }\n }\n\n return $line;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Generated from protobuf field .AutoMsg.FriendListResult Friend = 9; | public function setFriend($var)
{
GPBUtil::checkMessage($var, \AutoMsg\FriendListResult::class);
$this->Friend = $var;
return $this;
} | [
"public static function get_list_of_friends();",
"public function getFriends();",
"public function getFriends()\n {\n return $this->friends;\n\r\n }",
"public function getFriendsList()\r\n {\r\n if ( null === $this->Friends ) {\r\n $this->Friends = new Warecorp_User_Friend_List();\r\n $this->Friends->setUserId($this->getId());\r\n }\r\n\r\n return $this->Friends;\r\n }",
"public function getFriendChat() {\n //Call from auto ?\n $bIsAuto = (boolean) $this->get('auto');\n //Paging\n if (!$sPage = $this->get('p')) {\n $sPage = 1;\n }\n if (!$iSize = $this->get('size')) {\n $iSize = 0;\n }\n /** @var Messenger_Service_Process $oProcess */\n $oProcess = Phpfox::getService('messenger.process');\n $aFriends = $oProcess->getChatFriend(Phpfox::getUserId(), $sPage, $iSize);\n if (count($aFriends) < $oProcess->getDefaultPageSize() || empty($aFriends)) {\n $sPage = 0; // Paging end\n } else {\n $sPage += 1; // Page next\n }\n $aData = array(\n 'is_first' => $this->get('p') ? false : true,\n // --> Chat paging info\n 'page_size' => $oProcess->getDefaultPageSize(),\n 'page_next' => $sPage,\n // --> flag as this request is reload from server\n 'auto' => $bIsAuto,\n // --> Convert minute to second\n 'reload_interval' => $oProcess->getChatCacheTime() * 60,\n // End reload options\n // --> Friends is an array of data which contain in chat main\n 'friends' => array(),\n );\n $aData['friends'] = $oProcess->buildFriendListJson($aFriends);\n\n $this->call('$Core.betterMobileMessengerHandle.getFriends(' . json_encode($aData) . ');');\n }",
"protected function getFriends()\n {\n $url = $this->getBaseUrl() . '&action=2';\n $request = $this->send($url);\n \n $friends = simplexml_load_string($request->getBody());\n foreach($friends->friend as $friend)\n {\n $attributes = $friend->attributes();\n echo $attributes['name'] . \"\\n\";\n }\n $attributes = $friends->listfriend->attributes();\n echo $attributes['nb'] . ' friend(s)' . \"\\n\";\n }",
"public function getMyfriends()\n {\n return $this->myfriends;\n }",
"public function userGetFriends()\n {\n $service = \"/{$this->get('version')}/user/{$this->get('user')}/friends.xml\";\n return $this->_getInfo($service);\n }",
"function getFriends() {\n\t\t\treturn $this->API->getFriends($this->ID);\n\t\t}",
"public function myfriends(){\n\t\t$url = 'http://local.kizzangchef.com/api/playerinvite/myfriends/10/0';\n\t\t$token = null;\t\t\n\t\t$method = 'get';\n\t\t$api_key = $this->getKey();\n\t\t$params = array();\n\t\t$response = $this->doCurl($url, $params, $api_key, $token, $method);\n\t\tvar_dump($response);\n\t\texit;\n\t}",
"function getFriends(){\n\t\t\n\t\t// MOVE THIS TO A MODEL (all Fb calls, api and stuff should be in there, easier to access from anywhere)\n\t\t\n\t\tif(!$this->li){\n\t\t\treturn array();\n\t\t}\n\t\t\n\t\t//Cache::set(array('duration' => '1 hour'));\n\t\t//$results = Cache::read('fb_friends_'.GLOBAL_CACHE.FRIENDS_CACHE.'_'.$this->uid);\n\t\t$results = false;\n\t\tif($results === false || !is_array($results)){\n\t\t\t\n\t\t\t\t$data = $this->api('/me/friends');\n\t\t\t\t\n\t\t\t\tif($data !== false){\n\t\t\t\t\t$ids = Set::extract($data['data'],'{n}.id');\n\t\t\t\t\n\t\t\t\t\t//Cache::set(array('duration' => '1 hour'));\n\t\t\t\t\t//Cache::write('fb_friends_'.GLOBAL_CACHE.FRIENDS_CACHE.'_'.$this->uid, $ids);\n\t\t\t\t\n\t\t\t\t\treturn $ids;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\treturn $results;\n\t\t\t}\n\t\t\t\n\t}",
"private function buildFriendsAddressBook()\n {\n $list_of_friends = '';\n $friends_list = $this->Messages_Model->getFriends($this->current_user['user_id']);\n\n while ($friends = parent::$db->fetchArray($friends_list)) {\n\n $friends['dpath'] = DPATH;\n $list_of_friends .= parent::$page->get('messages/messages_ab_user_row_view')->parse($friends);\n }\n \n return $list_of_friends;\n }",
"public function getFriend()\n {\n return $this->friend;\n }",
"function friends($limit=null, $offset=null) {\r\n\t\treturn $this->api('/me/friends/?1' . (($limit) ? \"&limit=\" . $limit : '') . (($offset) ? \"&offset=\" . $offset : ''));\r\n\t}",
"function AddReadFriends()\n {\n $where=$this->FriendSelectCGI2Where();\n\n $friends=array();\n $subtitle=\"\";\n if (!empty($where))\n {\n $friends=$this->SelectHashesFromTable\n (\n \"\",\n $where,\n $this->FriendSelectDatas,\n FALSE,\n \"\",\n FALSE\n );\n }\n\n return $friends;\n }",
"protected function Friend() {\n require \"./app/core/http/endpoints/friend.endpoint.php\";\n $friendsHandler = new Endpoints\\Friend($this);\n return $friendsHandler->_handleRequest();\n }",
"function chat_friends ($user_guid) {\n\t$user = get_user($user_guid);\n\tif (!$user) {\n\t\tforward('chat/all');\n\t}\n\n\t$params = array();\n\t$params['filter_context'] = 'friends';\n\t$params['title'] = elgg_echo('chat:title:friends');\n\n\t$crumbs_title = $user->name;\n\telgg_push_breadcrumb($crumbs_title, \"chat/owner/{$user->username}\");\n\telgg_push_breadcrumb(elgg_echo('friends'));\n\n\telgg_register_title_button();\n\n\t$options = array(\n\t\t'type' => 'object',\n\t\t'subtype' => 'chat',\n\t\t'relationship' => 'member',\n\t\t'relationship_guid' => $user_guid,\n\t\t'inverse_relationship' => false,\n\t\t'limit' => 10,\n\t\t'pagination' => true,\n\t\t'full_view' => false,\n\t);\n\n\tif ($friends = get_user_friends($user_guid, ELGG_ENTITIES_ANY_VALUE, 0)) {\n\t\tforeach ($friends as $friend) {\n\t\t\t$options['container_guids'][] = $friend->getGUID();\n\t\t}\n\t\t$params['content'] = elgg_list_entities_from_relationship($options);\n\t}\n\n\tif (empty($params['content'])) {\n\t\t$params['content'] = elgg_echo('chat:none');\n\t}\n\n\treturn $params;\n}",
"public function getFriendIds()\n {\n try {\n $data = $this->rest->api_client->friends_getAppUsers();\n if ($data) {\n return $data;\n }\n }\n catch (Exception $e) {\n info_log('[Snsplus_RestApi::getFriendIds]: ' . $e->getMessage(), 'RestApi_Err');\n }\n return null;\n }",
"public function addfriendstolist($aData)\n\t{\n\t\t$iFriendListId = isset($aData['iFriendListId']) ? (int)$aData['iFriendListId'] : 0;\n\t\tif ($iFriendListId < 1)\n\t\t{\n\t\t\treturn array(\n\t\t\t\t'error_code' => 1,\n\t\t\t\t'error_element' => 'iFriendListId',\n\t\t\t\t'error_message' => Zend_Registry::get('Zend_Translate') -> _(\"Parameter(s) is not valid!\")\n\t\t\t);\n\t\t}\n\t\t$viewer = Engine_Api::_() -> user() -> getViewer();\n\t\t// Check list\n\t\t$listTable = Engine_Api::_() -> getItemTable('user_list');\n\t\t$list = $listTable -> find($iFriendListId) -> current();\n\t\tif (!$list || $list -> owner_id != $viewer -> getIdentity())\n\t\t{\n\t\t\treturn array(\n\t\t\t\t'error_code' => 1,\n\t\t\t\t'error_message' => Zend_Registry::get('Zend_Translate') -> _('Missing list/not authorized')\n\t\t\t);\n\t\t}\n\n\t\t$aTemp = explode(',', $aData['sFriendId']);\n\t\t$aFriendId = array();\n\n\t\tforeach ($aTemp as $iFriendId)\n\t\t{\n\t\t\t$friend = Engine_Api::_() -> getItem('user', $iFriendId);\n\t\t\tif (!$friend)\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t// Check if already target status\n\t\t\tif ($list -> has($friend))\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$list -> add($friend);\n\t\t}\n\t\treturn array(\n\t\t\t'result' => 1,\n\t\t\t'message' => Zend_Registry::get('Zend_Translate') -> _('Members added to list.')\n\t\t);\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Provides data for testSplitByWorksAsPlanned. | public function DataForTestSplitByWorksAsPlannedProvider() {
$tests = array();
$tests[] = array(
"In the Loft<br/>Studios",
'In the Loft Studios',
2,
"<br/>",
);
$tests[] = array(
"do\nre",
'do re',
2,
"\n",
);
return $tests;
} | [
"public function testDataProcessingsInsights()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }",
"public function splittingTestDataProvider()\n {\n $data = array();\n for ($i = 1; $i < 2; $i++) {\n $data[] = $this->getDataSample($i);\n }\n return $data;\n }",
"public function getPresetData() {\r\n\t\t$data['title']\t\t\t\t= $this->getTaskTitle();\r\n\t\t$data['description']\t\t= $this->getDescription();\r\n\t\t$data['estimated_workload']\t= $this->getEstimatedWorkload();\r\n\t\t$data['is_public']\t\t\t= $this->getIsPublic();\r\n\t\t$data['id_activity']\t\t= $this->getActivityID();\r\n\t\t$data['status']\t\t\t\t= $this->getStatus();\r\n\r\n\t\tif( $this->hasDateStart() ) {\r\n\t\t\t$data['date_start'] = $this->getDateStart();\r\n\t\t}\r\n\t\tif( $this->hasDateEnd() ) {\r\n\t\t\t$data['date_end'] = $this->getDateEnd();\r\n\t\t}\r\n\t\tif( $this->hasDateDeadline() ) {\r\n\t\t\t$data['date_deadline'] = $this->getDateDeadline();\r\n\t\t}\r\n\t\tif( $this->hasPersonAssigned() ) {\r\n\t\t\t$data['id_person_assigned'] = $this->getPersonAssignedID();\r\n\t\t}\r\n\t\tif( $this->hasPersonOwner() ) {\r\n\t\t\t$data['id_person_owner'] = $this->getPersonOwnerID();\r\n\t\t}\r\n\r\n\t\treturn $data;\r\n\t}",
"public function splitIntoBlockDataProvider() {}",
"public function getTrainingPlanForSplitAction() \n {\n $aParams = $this->getAllParams();\n\n if ($userId = $this->findCurrentUserId()) {\n if (is_numeric($userId)\n && 0 < $userId\n && true === array_key_exists('user_id', $aParams)\n && true === is_numeric($aParams['user_id'])\n && 0 < $aParams['user_id']\n && true === array_key_exists('training_plan_id', $aParams)\n && true === is_numeric($aParams['training_plan_id'])\n && 0 < $aParams['training_plan_id']\n ) {\n $aData = array(\n 'training_plan_training_plan_layout_fk' => 1,\n 'training_plan_parent_fk' => $aParams['training_plan_id'],\n 'training_plan_user_fk' => $aParams['user_id']\n );\n\n $sContent = '';\n\n try {\n $currentName = 'NewPlan'.uniqid();\n $this->view->assign('name', $currentName);\n $sContent = '<ul class=\"nav nav-tabs\"><li><a data-toggle=\"tab\" href=\"#'.$currentName.'\">New Plan</a>' .\n '<div class=\"training-plans detail-options\"><div class=\"glyphicon glyphicon-trash delete-button\" data-id=\"' .\n $currentName . '\"></div></div></li></ul>';\n $sContent .= $this->view->render('loops/training-plan-edit.phtml');\n } catch (Exception $oException) {\n $sContent = $oException->getMessage();\n }\n $this->view->assign('sContent', $sContent);\n } else {\n $sContent = json_encode(\n array(\n array(\n 'type' => 'fehler', 'message' => 'Konnte Trainingsplan nicht anlegen!'\n )\n )\n );\n $this->view->assign('sContent', $sContent);\n }\n } else {\n $sContent = json_encode(\n array(\n array(\n 'type' => 'fehler', 'message' => 'Für diese Aktion müssen Sie angemeldet sein!'\n )\n )\n );\n $this->view->assign('sContent', $sContent);\n }\n }",
"public function dataTestBuildDataObject()\n\t{\n\t\treturn array(\n\t\t\tarray(100, 40, 20, 3,\n\t\t\t\tarray(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'text' => 'JLIB_HTML_VIEW_ALL',\n\t\t\t\t\t\t'base' => '0',\n\t\t\t\t\t\t'link' => 'index.php',\n\t\t\t\t\t\t'prefix' => '',\n\t\t\t\t\t\t'active' => '',\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'text' => 'JLIB_HTML_START',\n\t\t\t\t\t\t'base' => '0',\n\t\t\t\t\t\t'link' => 'index.php?limitstart=0',\n\t\t\t\t\t\t'prefix' => '',\n\t\t\t\t\t\t'active' => '',\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'text' => 'JPREV',\n\t\t\t\t\t\t'base' => '20',\n\t\t\t\t\t\t'link' => 'index.php?limitstart=20',\n\t\t\t\t\t\t'prefix' => '',\n\t\t\t\t\t\t'active' => '',\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'text' => 'JNEXT',\n\t\t\t\t\t\t'base' => '60',\n\t\t\t\t\t\t'link' => 'index.php?limitstart=60',\n\t\t\t\t\t\t'prefix' => '',\n\t\t\t\t\t\t'active' => '',\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'text' => 'JLIB_HTML_END',\n\t\t\t\t\t\t'base' => '80',\n\t\t\t\t\t\t'link' => 'index.php?limitstart=80',\n\t\t\t\t\t\t'prefix' => '',\n\t\t\t\t\t\t'active' => '',\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'text' => '3',\n\t\t\t\t\t\t'base' => '',\n\t\t\t\t\t\t'link' => null,\n\t\t\t\t\t\t'prefix' => '',\n\t\t\t\t\t\t'active' => true,\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t),\n\t\t);\n\t}",
"function testdata()\n\t{\n\t\t$this->layout = \"\";\n\t\t$this->autoRendar = false;\n\t\n\t\t$testDataArray = array(\n\t\t\t\t'test1'=>'test1',\n\t\t\t\t'test2'=>'test2',\n\t\t\t\t'test3'=>'test3',\n\t\t\t\t'test4'=>'test4',\n\t\t\t\t'test5'=>'test5',\n\t\t\t\t'test6'=>'test6',\n\t\t\t\t'test7'=>'test7',\n\t\t\t\t'test8'=>'test8',\n\t\t\t\t'test9'=>'test9',\n\t\t\t\t'test10'=>'test10'\n\t\t);\n\t\n\t\treturn $testDataArray;\n\t}",
"public static function get_splits_list()\n {\n return self::$splits_list;\n }",
"public function provide_test_run_data()\n\t{\n\t\treturn $this->provide_test_execute_data();\n\t}",
"public function testDataProcessingsCreate()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }",
"public function providerTestStore()\n {\n $data[] = [\n \"test success\",\n [\n \"name\" => \"Duy Ho Ngc\",\n \"start_date\"=> \"2018-12-21T01:30:00\",\n \"end_date\" => \"2018-12-21T23:30:00\",\n ],\n empty(1)\n ];\n\n $data[] = [\n \"test fail\",\n [\n \"name\" => \"Duy Ho Ngc\",\n \"start_date\"=> \"2018-12-21T01:30:00\",\n ],\n 0\n ];\n return $data;\n }",
"public function providerTestField() {\n $data = [];\n $data['new->validation'] = ['new', ['create', 'cancel'], 'fulfillment', 'create', 'validation'];\n $data['new->canceled'] = ['new', ['create', 'cancel'], 'completed', 'cancel', 'canceled'];\n // The workflow defines validation->fulfillment and validation->canceled\n // transitions, but the second one is forbidden by the GenericGuard.\n $data['validation->fulfillment'] = ['validation', ['validate'], 'completed', 'validate', 'fulfillment'];\n // The workflow defines fulfillment->completed and fulfillment->canceled\n // transitions, but the second one is forbidden by the FulfillmentGuard.\n $data['fulfillment->completed'] = ['fulfillment', ['fulfill'], 'new', 'fulfill', 'completed'];\n\n return $data;\n }",
"public function splitCalcDataProvider() {}",
"function _standings() {\n\n/* ... data declarations */\n $data = array();\n $positions = array();\n \n/* ... we'll determine each division on it's own - so get the list of divisions */\n $divList = $this->Model_Team->getListOfDivisions();\n foreach ($divList as $curDivision) {\n\n/* ... step 1: get the team IDs in the current division */\n $teamList = $this->Model_Team->getTeamsInDivision( $curDivision );\n\n/* ... step 2: get the list of games for all teams in the division */\n $schedDetails = $this->Model_Schedule->getScheduleDetails( $curDivision );\n\n/* ... step 3: initialize our data collection array to zero */\n foreach ($teamList as $teamID) {\n $data['wins'][$teamID] = 0;\n $data['losses'][$teamID] = 0;\n $data['ties'][ $teamID] = 0;\n $data['runsFor'][$teamID] = 0;\n $data['runsAga'][$teamID] = 0;\n }\n\n/* ... step 4: go through the games and record the appropriate results for the games played */\n for ($i = 0; $i < count( $schedDetails ); $i++) {\n if ($schedDetails[$i]['Status'] == \"PLAYED\") {\n $this->_processGameResult( $schedDetails[$i], $data );\n }\n }\n\n/* ... step 5: determine the number of points each team has */\n foreach ($teamList as $teamID) {\n $data['points'][$teamID] = 2 * $data['wins'][$teamID] + $data['ties'][$teamID];\n }\n\n/* ... step 6: determine which tiebreaker formula we are to use and then use it to get a standings order */\n if ($this->config->item( 'my_tiebreakerFormula' ) == \"ADVANCED\") {\n list( $positions[$curDivision], $data['tiebreaks'][$curDivision] ) = $this->_breakTieAdvanced( $teamList, $data );\n }\n else {\n $positions[$curDivision] = $this->_breakTieBasic( $teamList, $data );\n }\n\n }\n\n/* ... time to go */\n return( array( $data, $positions ) );\n }",
"public function getIsSplittable()\n {\n return $this->is_splittable;\n }",
"public function getTotalSplits()\n {\n return $this->total_splits;\n }",
"protected function getTestParameters() {\n return array(\n 'Write Stimulus' => 'RND/4KiB',\n ' TOIO - TC/QD' => sprintf('TC %d/QD %d', $this->options['threads_total'], $this->options['oio_per_thread']),\n ' Durations' => BlockStorageTestHir::BLOCK_STORAGE_TEST_HIR_WAIT_LOOP_DURATION,\n 'Idle State' => 'Host Idle',\n ' TOIO - TC/QD ' => '',\n ' Durations ' => '5,10,15,25,50',\n ' Wait States' => '1,2,3,5,10'\n );\n }",
"private function fixStaffStatisticsData($data)\n {\n\n $i = 0;\n foreach ($data['in_progress_projects_mini_list'] as $project) {\n\n $project['status'] = $this->timber->helpers->fixProjectStatus($project['pr_id'], $project['status'], $project['start_at'], $project['end_at']);\n\n $data['in_progress_projects_mini_list'][$i] = array();\n $data['in_progress_projects_mini_list'][$i]['pr_id'] = $project['pr_id'];\n $data['in_progress_projects_mini_list'][$i]['title'] = $project['title'];\n $data['in_progress_projects_mini_list'][$i]['reference'] = $project['reference'];\n $data['in_progress_projects_mini_list'][$i]['ref_id'] = \"PRO-\" . str_pad($project['pr_id'], 8, '0', STR_PAD_LEFT);\n $data['in_progress_projects_mini_list'][$i]['description'] = $project['description'];\n $data['in_progress_projects_mini_list'][$i]['version'] = $project['version'];\n $data['in_progress_projects_mini_list'][$i]['progress'] = $this->timber->helpers->measureProgressByDates($project['start_at'], $project['end_at']);\n $data['in_progress_projects_mini_list'][$i]['budget'] = $project['budget'];\n $data['in_progress_projects_mini_list'][$i]['status'] = $project['status'];\n $data['in_progress_projects_mini_list'][$i]['nice_status'] = str_replace(\n array('1','2','3','4','5'),\n array($this->timber->translator->trans('Pending'), $this->timber->translator->trans('In Progress'), $this->timber->translator->trans('Overdue'), $this->timber->translator->trans('Done'), $this->timber->translator->trans('Archived')), $project['status']\n );\n $data['in_progress_projects_mini_list'][$i]['owner_id'] = $project['owner_id'];\n $data['in_progress_projects_mini_list'][$i]['tax'] = $project['tax'];\n $tax = explode('-', $project['tax']);\n $data['in_progress_projects_mini_list'][$i]['tax_value'] = $tax[0];\n $data['in_progress_projects_mini_list'][$i]['tax_type'] = $tax[1];\n $data['in_progress_projects_mini_list'][$i]['discount'] = $project['discount'];\n $discount = explode('-', $project['discount']);\n $data['in_progress_projects_mini_list'][$i]['discount_value'] = $discount[0];\n $data['in_progress_projects_mini_list'][$i]['discount_type'] = $discount[1];\n $data['in_progress_projects_mini_list'][$i]['attach'] = $project['attach'];\n $data['in_progress_projects_mini_list'][$i]['created_at'] = $project['created_at'];\n $data['in_progress_projects_mini_list'][$i]['updated_at'] = $project['updated_at'];\n $data['in_progress_projects_mini_list'][$i]['start_at'] = $project['start_at'];\n $data['in_progress_projects_mini_list'][$i]['end_at'] = $project['end_at'];\n $data['in_progress_projects_mini_list'][$i]['view_link'] = $this->timber->config('request_url') . '/admin/projects/view/' . $project['pr_id'];\n\n $i += 1;\n }\n\n $i = 0;\n foreach ($data['pending_tickets_mini_list'] as $ticket) {\n\n $ticket['status'] = $this->timber->helpers->fixTicketStatus($ticket['ti_id'], $ticket['status']);\n\n $data['pending_tickets_mini_list'][$i] = array();\n $data['pending_tickets_mini_list'][$i]['ti_id'] = $ticket['ti_id'];\n $data['pending_tickets_mini_list'][$i]['pr_id'] = $ticket['pr_id'];\n\n # Get Project Name\n $data['pending_tickets_mini_list'][$i]['pr_title'] = $this->timber->translator->trans(\"Not Exist\");\n $project = $this->timber->project_model->getProjectById($ticket['pr_id']);\n\n if( (false !== $project) && (is_object($project)) ){\n $project = $project->as_array();\n $data['pending_tickets_mini_list'][$i]['pr_title'] = $project['title'];\n }\n $data['pending_tickets_mini_list'][$i]['parent_id'] = $ticket['parent_id'];\n $data['pending_tickets_mini_list'][$i]['reference'] = $ticket['reference'];\n $data['pending_tickets_mini_list'][$i]['owner_id'] = $ticket['owner_id'];\n $data['pending_tickets_mini_list'][$i]['status'] = $ticket['status'];\n $data['pending_tickets_mini_list'][$i]['type'] = $ticket['type'];\n $data['pending_tickets_mini_list'][$i]['depth'] = $ticket['depth'];\n $data['pending_tickets_mini_list'][$i]['subject'] = $ticket['subject'];\n $data['pending_tickets_mini_list'][$i]['content'] = $ticket['content'];\n $data['pending_tickets_mini_list'][$i]['attach'] = $ticket['attach'];\n $data['pending_tickets_mini_list'][$i]['created_at'] = $ticket['created_at'];\n $data['pending_tickets_mini_list'][$i]['updated_at'] = $ticket['updated_at'];\n $data['pending_tickets_mini_list'][$i]['nice_status'] = str_replace(\n array('1','2','3','4'),\n array($this->timber->translator->trans('Pending'), $this->timber->translator->trans('Opened'), $this->timber->translator->trans('Closed')), $ticket['status']\n );\n $data['pending_tickets_mini_list'][$i]['nice_type'] = str_replace(\n array('1','2','3','4','5'),\n array($this->timber->translator->trans('Inquiry'), $this->timber->translator->trans('Suggestion'), $this->timber->translator->trans('Normal Bug'), $this->timber->translator->trans('Critical Bug'), $this->timber->translator->trans('Security Bug')), $ticket['type']\n );\n $data['pending_tickets_mini_list'][$i]['view_link'] = $this->timber->config('request_url') . '/admin/projects/view/' . $ticket['pr_id'] .'?tab=tickets&sub_tab=view&tick_id=' . $ticket['ti_id'];\n\n $i += 1;\n }\n\n $i = 0;\n foreach ($data['in_progress_tasks_mini_list'] as $task) {\n\n $task['status'] = $this->timber->helpers->fixTaskStatus($task['ta_id'], $task['status'], $task['start_at'], $task['end_at']);\n\n $data['in_progress_tasks_mini_list'][$i] = array();\n $data['in_progress_tasks_mini_list'][$i]['ta_id'] = $task['ta_id'];\n\n # Get Project Name\n $data['in_progress_tasks_mini_list'][$i]['pr_title'] = $this->timber->translator->trans(\"Not Exist\");\n $project = $this->timber->project_model->getProjectById($task['pr_id']);\n if( (false !== $project) && (is_object($project)) ){\n $project = $project->as_array();\n $data['in_progress_tasks_mini_list'][$i]['pr_title'] = $project['title'];\n }\n $data['in_progress_tasks_mini_list'][$i]['title'] = $task['title'];\n $data['in_progress_tasks_mini_list'][$i]['description'] = $task['description'];\n $data['in_progress_tasks_mini_list'][$i]['status'] = $task['status'];\n $data['in_progress_tasks_mini_list'][$i]['progress'] = $this->timber->helpers->measureProgressByDates($task['start_at'], $task['end_at']);\n $data['in_progress_tasks_mini_list'][$i]['priority'] = $task['priority'];\n $data['in_progress_tasks_mini_list'][$i]['nice_status'] = str_replace(\n array('1','2','3','4'),\n array($this->timber->translator->trans('Pending'), $this->timber->translator->trans('In Progress'), $this->timber->translator->trans('Overdue'), $this->timber->translator->trans('Done')), $task['status']\n );\n $data['in_progress_tasks_mini_list'][$i]['nice_priority'] = str_replace(\n array('1','2','3','4'),\n array($this->timber->translator->trans('Low'), $this->timber->translator->trans('Middle'), $this->timber->translator->trans('High'), $this->timber->translator->trans('Critical')), $task['priority']\n );\n $data['in_progress_tasks_mini_list'][$i]['start_at'] = $task['start_at'];\n $data['in_progress_tasks_mini_list'][$i]['end_at'] = $task['end_at'];\n $data['in_progress_tasks_mini_list'][$i]['created_at'] = $task['created_at'];\n $data['in_progress_tasks_mini_list'][$i]['updated_at'] = $task['updated_at'];\n\n $i += 1;\n }\n\n $i = 0;\n foreach ($data['overdue_tasks_mini_list'] as $task) {\n\n $task['status'] = $this->timber->helpers->fixTaskStatus($task['ta_id'], $task['status'], $task['start_at'], $task['end_at']);\n\n $data['overdue_tasks_mini_list'][$i] = array();\n $data['overdue_tasks_mini_list'][$i]['ta_id'] = $task['ta_id'];\n\n # Get Project Name\n $data['overdue_tasks_mini_list'][$i]['pr_title'] = $this->timber->translator->trans(\"Not Exist\");\n $project = $this->timber->project_model->getProjectById($task['pr_id']);\n if( (false !== $project) && (is_object($project)) ){\n $project = $project->as_array();\n $data['overdue_tasks_mini_list'][$i]['pr_title'] = $project['title'];\n }\n $data['overdue_tasks_mini_list'][$i]['title'] = $task['title'];\n $data['overdue_tasks_mini_list'][$i]['description'] = $task['description'];\n $data['overdue_tasks_mini_list'][$i]['status'] = $task['status'];\n $data['overdue_tasks_mini_list'][$i]['progress'] = $this->timber->helpers->measureProgressByDates($task['start_at'], $task['end_at']);\n $data['overdue_tasks_mini_list'][$i]['priority'] = $task['priority'];\n $data['overdue_tasks_mini_list'][$i]['nice_status'] = str_replace(\n array('1','2','3','4'),\n array($this->timber->translator->trans('Pending'), $this->timber->translator->trans('In Progress'), $this->timber->translator->trans('Overdue'), $this->timber->translator->trans('Done')), $task['status']\n );\n $data['overdue_tasks_mini_list'][$i]['nice_priority'] = str_replace(\n array('1','2','3','4'),\n array($this->timber->translator->trans('Low'), $this->timber->translator->trans('Middle'), $this->timber->translator->trans('High'), $this->timber->translator->trans('Critical')), $task['priority']\n );\n $data['overdue_tasks_mini_list'][$i]['start_at'] = $task['start_at'];\n $data['overdue_tasks_mini_list'][$i]['end_at'] = $task['end_at'];\n $data['overdue_tasks_mini_list'][$i]['created_at'] = $task['created_at'];\n $data['overdue_tasks_mini_list'][$i]['updated_at'] = $task['updated_at'];\n\n $i += 1;\n }\n\n return $data;\n }",
"private function splittestSendStats($split_statid, $jobid, $stats_newsletters_fields=array())\n\t{\n\t\t$query = 'SELECT SUM(news.bouncecount_soft + news.bouncecount_hard + news.bouncecount_unknown) AS bouncecount';\n\t\tfor ($i = 0; $i < count($stats_newsletters_fields); $i++) {\n\t\t\t$query .= ', SUM(news.' . $stats_newsletters_fields[$i] . ') AS ' . $stats_newsletters_fields[$i];\n\t\t\tif ($i < count($stats_newsletters_fields)-1) {\n\t\t\t\t$query .= ', ';\n\t\t\t}\n\t\t}\n\t\t$query .= ' FROM [|PREFIX|]splittests s, [|PREFIX|]splittest_statistics ss, [|PREFIX|]splittest_statistics_newsletters ssn, [|PREFIX|]stats_newsletters news\n\t\t\t\t\t\tWHERE ss.split_statid = ' . intval($split_statid) . '\n\t\t\t\t\t\tAND ss.jobid = ' . intval($jobid) . '\n\t\t\t\t\t\tAND ss.splitid = s.splitid\n\t\t\t\t\t\tAND ssn.split_statid = ss.split_statid\n\t\t\t\t\t\tAND ssn.newsletter_statid = news.statid\n\t\t\t\t\t\tAND news.sendtype = \\'splittest\\'';\n\t\t$result = $this->Db->Query($query);\n\t\t$row = $this->Db->Fetch($result);\n\t\t$row['lists'] = $this->getCampaignLists($split_statid, $jobid);\n\t\t$this->Db->FreeResult($result);\n\t\treturn $row;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets all the fields a user is permitted to see for a specific modulename | private static function getPermittedFieldsFor($modname) {
global $current_user, $adb, $log;
$ret = array();
$webserviceObject = VtigerWebserviceObject::fromName($adb, $modname);
$handlerPath = $webserviceObject->getHandlerPath();
$handlerClass = $webserviceObject->getHandlerClass();
require_once $handlerPath;
$handler = new $handlerClass($webserviceObject, $current_user, $adb, $log);
$fields = $handler->describe($modname)['fields'];
foreach ($fields as $field) {
$ret[strtolower($modname) . '||' . $field['name']] = $field;
}
return $ret;
} | [
"public static function getUserFields()\n\t{\n\t\tif (version_compare(JVERSION, '3.7.0', 'ge'))\n\t\t{\n\t\t\t$db = JFactory::getDbo();\n\t\t\t$query = $db->getQuery(true);\n\t\t\t$query->select('id, name')\n\t\t\t\t->from('#__fields')\n\t\t\t\t->where($db->quoteName('context') . '=' . $db->quote('com_users.user'))\n\t\t\t\t->where($db->quoteName('state') . ' = 1');\n\t\t\t$db->setQuery($query);\n\n\t\t\treturn $db->loadObjectList('name');\n\t\t}\n\n\t\treturn [];\n\t}",
"function et_get_user_fields_by_role($role = 'all'){\n\tglobal $et_global;\n\t$user_fields = $et_global['user_fields'];\n\n}",
"public function fields()\r\n\t{\r\n\t\t$fullResult = $this->client->call(\r\n\t\t\t'crm.userfield.fields'\r\n\t\t);\r\n\t\treturn $fullResult;\r\n\t}",
"private function getAdminInformation()\n {\n global $db;\n $userQry = 'SELECT email,firstname,lastname \r\n\t \t\t\t\t FROM ' . DB_PREFIX . '_acl_user As usr\r\n\t\t\t\t\t\t\tINNER JOIN (SELECT MIN(user_id) AS usr_id FROM ' . DB_PREFIX . '_acl_user) AS users ON (usr_id = usr.user_id)\r\n\t\t\t\t\t\t\tWHERE user_id = (SELECT c.group_id FROM ' . DB_PREFIX\n . '_acl_groups As c INNER JOIN (SELECT MIN(user_id) AS id FROM ' . DB_PREFIX\n . '_acl_user) AS custId ON (custId.id = c.group_id))';\n $result = $db->Execute($userQry);\n\n return $result->fields;\n }",
"public function get_user_fields() {\n\n\t\t}",
"public static function listFields(){\n\t\treturn [ \n\t\t\t\"permission_id\",\n\t\t\t\"model_type\",\n\t\t\t\"model_id\" \n\t\t];\n\t}",
"public function getFields()\n {\n $fullResult = $this->client->call(\n 'task.item.userfield.getfields'\n );\n return $fullResult;\n }",
"public function getAllowedFields();",
"public function getFields();",
"public function getMemberFields()\n {\n return $this->filterNonModifiable($this->db->getFieldNames('members'));\n }",
"public function getListFields();",
"public function getMembershipFields()\n {\n return $this->filterNonModifiable($this->db->getFieldNames('memberships'));\n }",
"protected static function getFieldPermissions() {\n\t\treturn array();\n\t}",
"public function getAccessibleUsersForModule()\n\t{\n\t\t$curentUserPrivileges = \\Users_Privileges_Model::getCurrentUserPrivilegesModel();\n\t\tif ($this->currentUser->isAdmin() || $curentUserPrivileges->hasGlobalWritePermission()) {\n\t\t\t$users = $this->getAccessibleUsers('');\n\t\t} else {\n\t\t\t$sharingAccessModel = $this->moduleName ? \\Settings_SharingAccess_Module_Model::getInstance($this->moduleName) : false;\n\t\t\tif ($sharingAccessModel && $sharingAccessModel->isPrivate()) {\n\t\t\t\t$users = $this->getAccessibleUsers('private');\n\t\t\t} else {\n\t\t\t\t$users = $this->getAccessibleUsers('');\n\t\t\t}\n\t\t}\n\t\treturn $users;\n\t}",
"public function getFields(){\n return\n AMI::getResourceModel('ext_eshop_custom_fields/table')\n ->getList()\n ->addColumns(array('id', 'name', 'fnum', 'ftype', 'value_type', 'default_gui_type'))\n ->addWhereDef(\n DB_Query::getSnippet(\"AND i.`default_params` LIKE %s\")\n ->q('%admin_filter\";s:1:\"1\"%')\n )\n ->addOrder('name', 'asc')\n ->load();\n }",
"public function getRestrictedFields()\n {\n return $this->restricted_fields;\n }",
"protected function get_special_fields()\n {\n\n // exportable user data ##\n $special_fields = array(\n # 'roles' // list of WP Roles\n #, 'groups' // BP Groups\n );\n\n\t\t\t// should we allow groups ##\n\t\t\tif ( isset( $_POST['groups'] ) && '1' == $_POST['groups'] ) {\n\n\t\t\t\t$special_fields[] = 'groups'; // add groups ##\n\n\t\t\t}\n\n\t\t\t// should we allow groups ##\n\t\t\tif ( isset( $_POST['roles'] ) && '1' == $_POST['roles'] ) {\n\n\t\t\t\t$special_fields[] = 'roles'; // add groups ##\n\n\t\t\t}\n\n\t\t\t// kick back the array ##\n return apply_filters( 'export_user_data_special_fields', $special_fields );\n\n }",
"function the_admin_members_fields() {\n\n // Call the Members class\n $members = (new MidrubBaseAdminComponentsCollectionMembersClasses\\Members);\n\n // Returns the fields\n return $members->load_fields();\n \n }",
"function _getUserEditableFields()\n {\n // if you don't want any of your fields to be editable by the user, set fb_userEditableFields to\n // \"array()\" in your DataObject-derived class\n if ($this->userEditableFields) {\n return $this->userEditableFields;\n }\n // all fields may be updated by the user since fb_userEditableFields is not set\n if ($this->fieldsToRender) {\n return $this->fieldsToRender;\n }\n return array_keys($this->_getFieldsToRender());\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets wrapping cost excluding tax | public function setWrappingCostExcludingTax(?float $amount): self
{
$this->wrapping_cost_ex_tax = $amount;
return $this;
} | [
"protected function addTax()\n {\n $this->fullCost = $this->purchased + ($this->purchased * .07);\n }",
"private function _getWrappingValues(){\n return number_format(Tools::ps_round($this->context->cart->getOrderTotal(TRUE, Cart::ONLY_WRAPPING), 2), 2, '.', '');\n }",
"public function setGiftWrapTax($value)\n {\n $this->_fields['GiftWrapTax']['FieldValue'] = $value;\n return $this;\n }",
"private function setTax()\n {\n if($this->taxIncluded){\n $this->tax = $this->calculateTaxIncluded();\n $this->setTotalBeforeTax();\n }else{\n $this->tax = $this->calculateTaxAddOn();\n } \n }",
"public function setCost($val)\n {\n if ($this->getCost() === $val) {\n //prevent un-necessary setting\n return;\n }\n $this->touch(); //there are new pending changes\n $val = round(floatval($val), 4);//force cost to be float, 4 decimal places\n $this->cost = $val;\n }",
"public function setAllTax()\n {\n $store = $this->getStore();\n\n $this->setRowTotalInclTax(\n $store->roundPrice($this->getRowTotal() + $this->getTaxAmount())\n );\n $this->setBaseRowTotalInclTax(\n $store->roundPrice($this->getBaseRowTotal() + $this->getTaxAmount())\n );\n\n $this->setPriceInclTax(\n $store->roundPrice($this->getPrice() + $this->getTaxPerItem())\n );\n $this->setBasePriceInclTax(\n $store->roundPrice($this->getBasePrice() + $this->getTaxPerItem())\n );\n\n if ($this->getTaxChangeAmount() > 0) {\n $this->reinvoiceTax();\n } elseif ($this->getTaxChangeAmount() < 0) {\n $this->creditMemoTax();\n }\n\n return $this;\n }",
"private function setTotal()\n {\n if($this->taxIncluded){\n $this->total = $this->subtotal;\n }else{\n $this->total = $this->subtotal + $this->tax;\n } \n }",
"private function setTotalBeforeTax()\n {\n if($this->taxIncluded){\n $this->totalBeforeTax = $this->subtotal - $this->tax;\n }else{\n $this->totalBeforeTax = $this->subtotal;\n } \n }",
"public function setGiftWrapPrice($value) \n {\n $this->_fields['GiftWrapPrice']['FieldValue'] = $value;\n return;\n }",
"function setTaxes()\n {\n $this->taxes = round($this->subtotal*TAX_RATE/100, 2);\n }",
"protected function assignPriceAndTax(){\n $customer_id = (isset($this->context->customer) ? (int)$this->context->customer->customer_id : 0);\n $group_id = (int)JeproshopGroupModelGroup::getCurrent()->group_id;\n $country_id = (int)$customer_id ? JeproshopCustomerModelCustomer::getCurrentCountry($customer_id) : JeproshopSettingModelSetting::getValue('default_country');\n\n $group_reduction = JeproshopGroupReductionModelGroupReduction::getValueForProduct($this->product->product_id, $group_id);\n if ($group_reduction === false){\n $group_reduction = JeproshopGroupModelGroup::getReduction((int)$this->context->cookie->customer_id) / 100;\n }\n // Tax\n $tax = (float)$this->product->getTaxesRate(new JeproshopAddressModelAddress((int)$this->context->cart->{JeproshopSettingModelSetting::getValue('tax_address_type')}));\n $this->assignRef('tax_rate', $tax);\n\n $product_price_with_tax = JeproshopProductModelProduct::getStaticPrice($this->product->product_id, true, null, 6);\n if (JeproshopProductModelProduct::$_taxCalculationMethod == COM_JEPROSHOP_TAX_INCLUDED)\n $product_price_with_tax = JeproshopTools::roundPrice($product_price_with_tax, 2);\n $product_price_without_eco_tax = (float)$product_price_with_tax - $this->product->ecotax;\n\n $ecotax_rate = (float)JeproshopTaxModelTax::getProductEcotaxRate($this->context->cart->{JeproshopSettingModelSetting::getValue('tax_address_type')});\n $ecotax_tax_amount = JeproshopTools::roundPrice($this->product->ecotax, 2);\n if (JeproshopProductModelProduct::$_taxCalculationMethod == COM_JEPROSHOP_TAX_INCLUDED && (int)JeproshopSettingModelSetting::getValue('use_tax'))\n $ecotax_tax_amount = JeproshopTools::roundPrice($ecotax_tax_amount * (1 + $ecotax_rate / 100), 2);\n\n $currency_id = (int)$this->context->cookie->currency_id;\n $product_id = (int)$this->product->product_id;\n $shop_id = $this->context->shop->shop_id;\n\n $quantity_discounts = JeproshopSpecificPriceModelSpecificPrice::getQuantityDiscounts($product_id, $shop_id, $currency_id, $country_id, $group_id, null, true, (int)$this->context->customer->customer_id);\n foreach ($quantity_discounts as &$quantity_discount){\n if ($quantity_discount->product_attribute_id){\n $combination = new JeproshopCombinationModelCombination((int)$quantity_discount->product_attribute_id);\n $attributes = $combination->getAttributesName((int)$this->context->language->lang_id);\n foreach ($attributes as $attribute){\n $quantity_discount->attributes = $attribute->name .' - ';\n }\n $quantity_discount->attributes = rtrim($quantity_discount->attributes , ' - ');\n }\n if ((int)$quantity_discount->currency_id == 0 && $quantity_discount->reduction_type == 'amount')\n $quantity_discount->reduction = JeproshopTools::convertPriceFull($quantity_discount->reduction, null, JeproshopContext::getContext()->currency);\n }\n\n $product_price = $this->product->getPrice(JeproshopProductModelProduct::$_taxCalculationMethod == COM_JEPROSHOP_TAX_INCLUDED, false);\n $address = new JeproshopAddressModelAddress($this->context->cart->{JeproshopSettingModelSetting::getValue('tax_address_type')});\n $quantity_discounts = $this->formatQuantityDiscounts($quantity_discounts, $product_price, (float)$tax, $ecotax_tax_amount);\n $this->assignRef('quantity_discounts', $quantity_discounts);\n $this->assignRef('ecotax_tax_included', $ecotax_tax_amount);\n $ecotax_tax_excluded = JeproshopTools::roundPrice($this->product->ecotax, 2);\n $this->assignRef('ecotax_tax_excluded', $ecotax_tax_excluded);\n $this->assignRef('ecotaxTax_rate', $ecotax_rate);\n $display_price = JeproshopSettingModelSetting::getValue('display_price');\n $this->assignRef('display_price', $display_price);\n $product_price_without_eco_tax = (float)$product_price_without_eco_tax;\n $this->assignRef('product_price_without_ecotax', $product_price_without_eco_tax);\n $this->assignRef('group_reduction', $group_reduction);\n $no_tax = JeproshopTaxModelTax::taxExcludedOption() || !$this->product->getTaxesRate($address);\n $this->assignRef('no_tax', $no_tax);\n $ecotax = (!count($this->errors) && $this->product->ecotax > 0 ? JeproshopTools::convertPrice((float)$this->product->ecotax) : 0);\n $this->assignRef('ecotax', $ecotax);\n $tax_enabled = JeproshopSettingModelSetting::getValue('use_tax');\n $this->assignRef('tax_enabled', $tax_enabled);\n $customer_group_without_tax = JeproshopGroupModelGroup::getPriceDisplayMethod($this->context->customer->default_group_id);\n $this->assignRef('customer_group_without_tax', $customer_group_without_tax);\n }",
"public function setHandlingCostExcludingTax(?float $cost): self\n {\n $this->handling_cost_ex_tax = $cost;\n \n return $this;\n }",
"public function setHandlingCost($value)\r\n\t{\r\n\t\t$this->handlingCost = $value;\r\n\t\treturn $this;\r\n\t}",
"protected function amount_include_tax(){}",
"public function testGetFWrappingCosts_noCost()\n {\n $oBasket = $this->getMock( 'oxbasket', array( 'getCosts' ) );\n $oBasket->expects( $this->once() )->method( 'getCosts' )->will( $this->returnValue( false ) );\n\n $this->assertFalse( $oBasket->getFWrappingCosts() );\n }",
"function calculateCost(&$cost, $tax)\n {\n $cost = $cost + ($cost * $tax);\n // Perform some random change to the $tax variable.\n $tax += 4;\n }",
"protected function assignPriceAndTax()\n {\n $id_customer = (isset($this->context->customer) ? (int)$this->context->customer->id : 0);\n $id_group = (int)Group::getCurrent()->id;\n $id_country = (int)$id_customer ? Customer::getCurrentCountry($id_customer) : Configuration::get('PS_COUNTRY_DEFAULT');\n\n $group_reduction = GroupReduction::getValueForProduct($this->product->id, $id_group);\n if ($group_reduction == 0)\n $group_reduction = Group::getReduction((int)$this->context->cookie->id_customer) / 100;\n\n // Tax\n $tax = (float)$this->product->getTaxesRate(new Address((int)$this->context->cart->{Configuration::get('PS_TAX_ADDRESS_TYPE')}));\n $this->context->smarty->assign('tax_rate', $tax);\n\n $product_price_with_tax = Product::getPriceStatic($this->product->id, true, null, 6);\n if (Product::$_taxCalculationMethod == PS_TAX_INC)\n $product_price_with_tax = Tools::ps_round($product_price_with_tax, 2);\n $product_price_without_eco_tax = (float)$product_price_with_tax - $this->product->ecotax;\n\n $ecotax_rate = (float)Tax::getProductEcotaxRate($this->context->cart->{Configuration::get('PS_TAX_ADDRESS_TYPE')});\n $ecotax_tax_amount = Tools::ps_round($this->product->ecotax, 2);\n if (Product::$_taxCalculationMethod == PS_TAX_INC && (int)Configuration::get('PS_TAX'))\n $ecotax_tax_amount = Tools::ps_round($ecotax_tax_amount * (1 + $ecotax_rate / 100), 2);\n\n $id_currency = (int)$this->context->cookie->id_currency;\n $id_product = (int)$this->product->id;\n $id_shop = $this->context->shop->id;\n\n $quantity_discounts = SpecificPrice::getQuantityDiscounts($id_product, $id_shop, $id_currency, $id_country, $id_group, null, true, (int)$this->context->customer->id);\n foreach ($quantity_discounts as &$quantity_discount)\n if ($quantity_discount['id_product_attribute'])\n {\n $combination = new Combination((int)$quantity_discount['id_product_attribute']);\n $attributes = $combination->getAttributesName((int)$this->context->language->id);\n foreach ($attributes as $attribute)\n $quantity_discount['attributes'] = $attribute['name'].' - ';\n $quantity_discount['attributes'] = rtrim($quantity_discount['attributes'], ' - ');\n }\n\n $product_price = $this->product->getPrice(Product::$_taxCalculationMethod == PS_TAX_INC, false);\n $address = new Address($this->context->cart->{Configuration::get('PS_TAX_ADDRESS_TYPE')});\n $this->context->smarty->assign(array(\n 'quantity_discounts' => $this->formatQuantityDiscounts($quantity_discounts, $product_price, (float)$tax, $ecotax_tax_amount),\n 'ecotax_tax_inc' => $ecotax_tax_amount,\n 'ecotax_tax_exc' => Tools::ps_round($this->product->ecotax, 2),\n 'ecotaxTax_rate' => $ecotax_rate,\n 'productPriceWithoutEcoTax' => (float)$product_price_without_eco_tax,\n 'group_reduction' => (1 - $group_reduction),\n 'no_tax' => Tax::excludeTaxeOption() || !$this->product->getTaxesRate($address),\n 'ecotax' => (!count($this->errors) && $this->product->ecotax > 0 ? Tools::convertPrice((float)$this->product->ecotax) : 0),\n 'tax_enabled' => Configuration::get('PS_TAX')\n ));\n }",
"public function setExtraCharge(Cost $cost): void;",
"public function testPutModifyShippingCostToZero()\n\t{\n\t $orderInput = array(\n\t 'customer_id' => 0,\n\t 'date_created' => 'Thu, 04 Oct 2012 03:24:40 +0000',\n\t 'billing_address' => $this->_getDummyAddress(),\n\t 'products' => array (\n\t array (\n\t 'product_id' => 27,\n\t 'quantity' => 2,\n\t ),\n\t ),\n\t 'shipping_cost_ex_tax' => 50,\n\t 'shipping_cost_inc_tax' => 70,\n\t );\n\t $order = $this->_postOrder($orderInput)->getData(true);\n\t $originalSubtotalExTax = $order['subtotal_ex_tax'];\n\t $originalSubtotalIncTax = $order['subtotal_inc_tax'];\n\t $originalSubtotalTax = $order['subtotal_tax'];\n\t $originalTotalExTax = $order['total_ex_tax'];\n\t $originalTotalIncTax = $order['total_inc_tax'];\n\t $originalTotalTax = $order['total_tax'];\n\t\n\t $input = array(\n\t 'id' => $order['id'],\n\t 'shipping_cost_ex_tax' => 0,\n\t 'shipping_cost_inc_tax' => 0,\n\t );\n\t\n\t $data = $this->_putOrder($input)->getData(true);\n\t\n\t $this->assertEquals($originalSubtotalExTax, $data['subtotal_ex_tax']);\n\t $this->assertEquals($originalSubtotalIncTax, $data['subtotal_inc_tax']);\n\t $this->assertEquals($originalSubtotalTax, $data['subtotal_tax']);\n\t $this->assertEquals($originalTotalExTax - 50, $data['total_ex_tax']);\n\t $this->assertEquals($originalTotalIncTax - 70, $data['total_inc_tax']);\n\t $this->assertEquals($originalTotalTax - 20, $data['total_tax']);\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Add required Square inputs to form. | public function add_square_inputs( $content, $field, $value, $lead_id, $form_id ) {
// If this form does not have a Square feed or if this is not a Square card field, return field content.
if ( ! $this->has_feed( $form_id ) || $field->get_input_type() !== 'square_creditcard' ) {
return $content;
}
// Populate Square card data to hidden fields if they exist.
$square_nonce = sanitize_text_field( rgpost( 'square_nonce' ) );
if ( $square_nonce ) {
$content .= '<input type="hidden" name="square_nonce" id="' . $form_id . '_square_nonce" value="' . esc_attr( $square_nonce ) . '" />';
}
$square_verification = sanitize_text_field( rgpost( 'square_verification' ) );
if ( $square_verification ) {
$content .= '<input type="hidden" name="square_verification" id="' . $form_id . '_square_verification" value="' . esc_attr( $square_verification ) . '" />';
}
$square_last_four = sanitize_text_field( rgpost( 'square_credit_card_last_four' ) );
if ( $square_last_four ) {
$content .= '<input type="hidden" name="square_credit_card_last_four" id="' . $form_id . '_square_credit_card_last_four" value="' . esc_attr( $square_last_four ) . '" />';
}
$square_card_type = sanitize_text_field( rgpost( 'square_credit_card_type' ) );
if ( $square_card_type ) {
$content .= '<input type="hidden" name="square_credit_card_type" id="' . $form_id . '_square_credit_card_type" value="' . esc_attr( $square_card_type ) . '" />';
}
return $content;
} | [
"private static function drawInputs()\n {\n if(empty(self::$_this->formSettings['css']))\n throw new \\Exception('Error : FormStyle must be Defined');\n else\n if(self::$_this->formSettings['css'] == 'form-horizontal')\n self::formHorizontal();\n else\n self::formVertical();\n }",
"public function requires_square_card_message() {\n\t\t$url = add_query_arg(\n\t\t\tarray(\n\t\t\t\t'view' => null,\n\t\t\t\t'subview' => null,\n\t\t\t)\n\t\t);\n\n\t\treturn sprintf( esc_html__( \"You must add a Square Card field to your form before creating a feed. Let's go %1\\$sadd one%2\\$s!\", 'gravityformsquare' ), \"<a href='\" . esc_url( $url ) . \"'>\", '</a>' );\n\t}",
"private function addSignUpFields()\n {\n $this->add([\n 'name' => 'username',\n 'type' => 'text',\n 'options' => [\n 'label' => 'Username',\n ],\n 'attributes' => [\n 'class'=> 'form-control'\n ]\n ]);\n $this->add([\n 'name' => 'passwordConfirm',\n 'type' => 'password',\n 'options' => [\n 'label' => 'Confirm Password',\n ],\n 'attributes' => [\n 'class'=> 'form-control'\n ]\n ]);\n \n $this->add([\n 'name' => 'firstname',\n 'type' => 'text',\n 'options' => [\n 'label' => 'First name',\n ],\n 'attributes' => [\n 'class'=> 'form-control'\n ]\n ]); \n $this->add([\n 'name' => 'lastname',\n 'type' => 'text',\n 'options' => [\n 'label' => 'Last name',\n ],\n 'attributes' => [\n 'class'=> 'form-control'\n ]\n ]);\n $this->add([\n 'name' => 'registration_type',\n 'type' => 'radio',\n 'options' => [\n 'value_options' => [\n '1' => [\n 'label' => '<span></span> Client',\n 'label_attributes' => ['class' => 'css-input css-radio css-radio-success push-10-r'],\n 'disable_html_escape' => true,\n 'value' => '1'\n ],\n '2' => [\n 'label' => '<span></span> Artisant',\n 'label_attributes' => ['class' => 'css-input css-radio css-radio-success'],\n 'value' => '2'\n ],\n ],\n 'label' => 'You are?',\n 'label_options' => [\n 'disable_html_escape' => true,\n ]\n ],\n 'attributes' => [\n 'class'=> 'form-control'\n ]\n ]);\n }",
"public function addAddFormInput(): void\n {\n if($this->isAddAble())\n {\n $container = $this->netteGrid->getAddContainer();\n $input = $this->getAddInput();\n $container->addComponent($input, $this->name);\n }\n }",
"function bfg_search_form_input($attributes, $context, $args) {\n\n\t$attributes['required'] = true;\n\n\treturn $attributes;\n\n}",
"function sf_register_math()\n{\n\t$sflogin = array();\n\t$sflogin = get_option('sflogin');\n\tif($sflogin['sfregmath'])\n\t{\n\t\tinclude_once('forum/sf-primitives.php');\n\n\t\t$spammath = sf_math_spam_build();\n\n\t\t$out ='<input type=\"hidden\" size=\"30\" name=\"url\" value=\"\" /></p>'.\"\\n\";\n\t\t$out.='<p><strong>'.__(\"Math Required!\", \"sforum\").'</strong><br />'.\"\\n\";\n\t\t$out.=sprintf(__(\"What is the sum of: <strong> %s + %s </strong>\", \"sforum\"), $spammath[0], $spammath[1]).' '.\"\\n\";\n\t\t$out.='<input type=\"text\" tabindex=\"3\" size=\"7\" id=\"sfvalue1\" name=\"sfvalue1\" value=\"\" /></p>'.\"\\n\";\n\t\t$out.='<input type=\"hidden\" name=\"sfvalue2\" value=\"'.$spammath[2].'\" />'.\"\\n\";\n\t\techo $out;\n\t}\n\treturn;\n}",
"private function addRequiredRule()\n {\n $inputs = $this->getDefinedInputs();\n if (!empty($inputs)) {\n foreach ($inputs as $input) {\n if (!$input instanceof Input) {\n continue;\n }\n\n $input->addRule(new ValidatorRule('required'));\n }\n\n $this->setDefinedInputs($inputs);\n }\n }",
"private function prepareInput(): void\n {\n echo \"preparing input\";\n echo \"\\n\";\n\n foreach ($this->options as $index => $option) {\n echo sprintf(\"%s: \", $option);\n $answer = $this->getAnswer();\n\n $this->isTheFirstIndex($index)\n ? $this->addType($answer)\n : $this->addParam($option, $answer);\n }\n\n $input = new ShapeInput($this->input[$this->count]);\n\n $this->addShapeInputToCurrentInput($input);\n $this->dispatch(new ShapeInputWasReceived($input));\n }",
"protected function build_add_form()\n {\n $this->setDefaults(array('hid_user_id' => $this->evaluation_object->get_user_id(),\n 'hid_category_id' => $this->evaluation_object->get_category_id(),\n 'hid_course_code' => $this->evaluation_object->get_course_code(), 'created_at' => api_get_utc_datetime()));\n $this->build_basic_form(0);\n if ($this->evaluation_object->get_course_code() == null) {\n $this->addElement('checkbox', 'adduser', null, get_lang('AddUserToEval'));\n } else {\n $this->addElement('checkbox', 'addresult', null, get_lang('AddResult'));\n }\n $this->addButtonCreate(get_lang('AddAssessment'), 'submit');\n }",
"protected abstract function prepareNotEmptyForm();",
"public function add_form_logic() { }",
"abstract protected function prepareNotEmptyForm();",
"public function addMissingRequired() {\n\t $required = array(\n\t\t 'Option' => '',\n\t\t 'Revision' => '2',\n\t\t 'ImageParameters' => '');\n\t /*\n \t$required = array(\n \t\t'1:Revision' => '',\n \t\t'2:ImageParameters' => '',\n \t\t'2:PermitNumber' => '',\n \t\t'4:PermitIssuingPOZip5' => '',\n \t\t'14:POZipCode' => '',\n\n \t\t'34:FacilityType' => 'DDU',\n \t\t'35:MailClassEnclosed' => 'Other',\n \t\t'36:MailClassOther' => 'Free Samples',\n \t\t'37:WeightInPounds' => '22',\n \t\t'38:WeightInOunces' => '10',\n \t\t'39:ImageType' => 'PDF',\n \t\t'40:SeparateReceiptPage' => 'false',\n \t\t'41:AllowNonCleansedFacilityAddr' => 'false',\n \t\t'42:HoldForManifest' => 'N',\n \t\t'43:CommercialPrice' => 'N',\n \t\t);\n\t */\n\t foreach($required as $item => $value) {\n\t\t $this->setField($item, $value);\n\t }\n }",
"private function AddRequiredField()\n {\n $field = new Checkbox('Required', '1', $this->radio->GetRequired());\n $this->AddField($field);\n }",
"function make_sku_required($stock_fields, $product_id, $product_type)\r\n\t{\r\n\tunset($stock_fields['sku']);\r\n\tunset($stock_fields['sold_individually']);\r\n\tunset($stock_fields['backorders']);\r\n\tunset($stock_fields['manage_stock']);\r\n\t$stock_fields['stock_qty']['custom_attributes'] = array(\r\n\t\t'required' => 1\r\n\t);\r\n\treturn $stock_fields;\r\n\t}",
"public function mainFormItems()\n {\n $this->addFormItem('name_first')\n // ->whichIsRequired()\n ->withClass('form-default')\n ;\n\n $this->addFormItem('name_last')\n ->whichIsRequired()\n ;\n\n if ($this->usernameField() != 'mobile') {\n $this->addFormItem('mobile')\n ->withClass('ltr')\n ->withValidationRule('phone:mobile')\n ->withPurificationRule('ed')\n ;\n }\n }",
"function insert_4square () {\n\t\t$option = get_option(\"foursquare_option\");\n\t\t$url \t= 'http://api.foursquare.com/v1/user?badges=1&mayor=1';\n\t\t\n\t\t$arrayData = get_foursquare_data($option['user'],$option['pass'],$url);\n\t\t$badges \t= $arrayData['user']['badges'][0]['badge'];\n\t\t$mayors \t= $arrayData['user']['mayor'][0]['venue'];\n\n\t\t$locationdata =get_foursquare_data($option['user'],$option['pass'],\"http://api.foursquare.com/v1/history?l=1\");\n\t\t$location = $locationdata['checkins']['checkin'];\n\n\t\tupdate_option('foursquare_badges',$badges);\n\t\tupdate_option('foursquare_mayors',$mayors);\n\t\tupdate_option('foursquare_location',$location);\n\t}",
"protected function addElements() \n {\n // Add \"email\" field\n $this->add([ \n 'type' => 'text',\n 'name' => 'email',\n 'options' => [\n 'label' => 'user_email_label',\n ],\n ]);\n // Add the CSRF field\n $this->add([\n 'type' => 'csrf',\n 'name' => 'csrf',\n 'options' => [\n 'csrf_options' => [\n 'timeout' => 600\n ]\n ],\n ]);\n // Add the Submit button\n $this->add([\n 'type' => 'submit',\n 'name' => 'submit',\n 'attributes' => [ \n 'value' => 'user_submit_value_request',\n ],\n ]);\n }",
"public function add() \n { \n $data['users'] = $this->userss->add();\n $data['action'] = 'users/save';\n \n $this->template->js_add('\n $(document).ready(function(){\n // binds form submission and fields to the validation engine\n $(\"#form_users\").parsley();\n });','embed');\n \n $this->template->render('users/form',$data);\n\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
sets members of project | public function setMembers($members)
{
$this->members = $members;
} | [
"public function setMembers($members);",
"public function set_members($members)\n\t{\n\t\tif (is_null($members)) {\n\t\t\tthrow new InvalidArgumentException(\"Project Members Invalid!\");\n\t\t}\n\n\t\t$this->members = $members;\n\t}",
"public function setGroupMemberSet($principal, array $members) {\n\t}",
"public function setMembers(CompanyMembership $members);",
"function members($project_id = 0) {\n $this->access_only_team_members();\n $view_data['project_id'] = $project_id;\n $this->load->view(\"projects/project_members/index\", $view_data);\n }",
"function fillMembers()\n\t{\n\t\t$dataSource = Security::getUgMembersDatasource();\n\t\t$dc = new DsCommand();\n\t\t\n\t\t$dc->order = array();\n\t\t$dc->order[] = array( \"column\" => \"UserName\" );\n\t\t$dc->order[] = array( \"column\" => \"GroupID\" );\n\t\t\n\t\t// ugmembers username field may contains username or security plugin user id value\n\t\t$qResult = $dataSource->getList( $dc );\n\t\twhile( $tdata = $qResult->fetchAssoc() ) {\n\t\t\t$provider = $tdata[\"Provider\"];\n\t\t\t$this->members[] = array( \n\t\t\t\t\"userId\" => $tdata[\"UserName\"], \n\t\t\t\t\"groupId\" => $tdata[\"GroupID\"],\n\t\t\t\t\"provider\" => $provider\n\t\t\t);\n\t\t}\n\t}",
"public function setTeamMembers(array $teamMembers): void\n {\n $this->teamMembers = $teamMembers;\n }",
"public function initProjectPermissions()\n\t{\n\t\t$this->collProjectPermissions = array();\n\t}",
"function AddMembersToProject ($members = array (), $newgroupID = null) {\n\tglobal $IMAGES, $PRICES, $ARTISTS, $TOPICS, $KEYWORDS, $COMMENTS, $RATINGS, $SETS, $GROUPS, $PROJECTS, $PARTS, $SNIPPETS, $STORIES;\n\tglobal $msg, $error;\n\t\n\t$DEBUG = 0;\n\tisset($newgroupID) || $newgroupID = $this->ID;\n\t\n\t\t\n\tif (! is_array($members)) { $members = array ($members); }\n\tforeach ($members as $artistID) {\n\t\tif ($artistID != FP_ADMINISTRATOR) {\n\t\t\t//MemberCount(false) checks for all members, not just showing members\n\t\t\tif ($this->MemberCount(false) < MAX_GROUP_SIZE) {\n\t\t\t\t// check to see if artist is already in this group\n\t\t\t\t// This version checks if the artist is the owner of the group, too.\n\t\t\t\t$query = \"select distinct $PARTS.ID from $PARTS, $GROUPS where ($PARTS.ArtistID = '$artistID' AND $PARTS.PartID = '$newgroupID' AND $PARTS.PartTable = '$GROUPS') OR ($GROUPS.ID = '$newgroupID' AND $GROUPS.ArtistID = '$artistID')\";\n\t\t\t\t$DEBUG && $error .= __FUNCTION__.__LINE__.\": $query<BR>\";\n\t\t\t\t$result = mysqli_query ($this->mysqli_connection, $query);\n\t\t\t\tif (mysqli_num_rows ($result) == 0) {\n\t\t\t\t\t$pairs = array ('ArtistID'\t=>\t$artistID,\n\t\t\t\t\t\t\t\t\t'PartTable' =>\t$GROUPS,\n\t\t\t\t\t\t\t\t\t'PartID'\t=>\t$newgroupID,\n\t\t\t\t\t\t\t\t\t'ProjectID' =>\tnull\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\tEditTable ('insert', $PARTS, '', $pairs);\n\t\t\t\t\t$DEBUG && $error .= __FUNCTION__.__LINE__.\": Added $artistID to the group<BR>\";\n\t\t\t\t} else {\n\t\t\t\t\t$DEBUG && $error .= __FUNCTION__.__LINE__.\": Artist $artistID is already in the group.<BR>\";\n\t\t\t\t\t//$error .= \"AddMembersToGroup: $artistID is already part of group $newgroupID<BR>\";\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$error .= \"Error: This group is full. Only \".MAX_GROUP_SIZE.\" members are allowed.<br>\";\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t}\n\t}\n\treturn TRUE;\n}",
"function RecruitMembers ($members = array ()) {\n\t$this->MoveMembers ($members, $this->ID, PUBLIC_GROUP_ID);\n}",
"public function setMembers(Request $request)\n {\n $data = Request::all();\n $team = Team::find($data[\"id\"]);\n $team->members = $data[\"name\"];\n $team->save();\n return 1;\n }",
"private function set_member_groups()\n\t{\n\t\tif ( ! self::$member_groups)\n\t\t{\n\t\t\t$this->EE->load->model('member_model');\n\t\t\t$member_groups = $this->EE->member_model->get_member_groups();\n\n\t\t\tforeach ($member_groups->result_array() as $group)\n\t\t\t{\n\t\t\t\t// Set member group ID as array key\n\t\t\t\tself::$member_groups[ $group['group_id'] ] = $group['group_title'];\n\t\t\t}\n\t\t}\n\n\t\treturn $this;\n\t}",
"public function initProjectUsers()\n\t{\n\t\t$this->collProjectUsers = array();\n\t}",
"private function _bindCampaignsOnProjects() {\n $campaigns = \\App\\Models\\Backoffice\\Campaign::all();\n foreach ($campaigns as $campaign) {\n $campaign->project_id = rand(1, 2);\n $campaign->user_id = 1;\n $campaign->save();\n }\n }",
"public function __construct($members = []) {\n\n $this->members = $members;\n\n }",
"public function members()\n {\n return $this->hasMany(ProjectMember::class);\n }",
"private function setTeamMembersListTag(): void {\n $team_member_type = $this->teamMemberStorage->getEntityType();\n $this->appendEntityTypeListCacheTags($team_member_type);\n }",
"public function setProjectPermissions()\n {\n // - Project (superadmin, Project Mangager) (Audit : Read)\n // * Reporting \n // * Actions (SME: Read, Add)\n // * Risk (SME: Read)\n // * Decision\n // * Issue\n // * Configuration\n\n $auth = \\Yii::$app->authManager;\n\n // Top Level Permissions\n $projectNoAccess = $auth->createPermission('projectNoAccess');\n $projectRead = $auth->createPermission('projectRead');\n $projectAdd = $auth->createPermission('projectAdd');\n $projectFull = $auth->createPermission('projectFull');\n\n $auth->add($projectNoAccess);\n $auth->add($projectRead);\n $auth->add($projectAdd);\n $auth->add($projectFull);\n\n // Reporting Permissions\n $projectReportingNoAccess = $auth->createPermission('projectReportingNoAccess');\n $projectReportingRead = $auth->createPermission('projectReportingRead');\n $projectReportingAdd = $auth->createPermission('projectReportingAdd');\n $projectReportingFull = $auth->createPermission('projectReportingFull');\n\n $auth->add($projectReportingNoAccess);\n $auth->add($projectReportingRead);\n $auth->add($projectReportingAdd);\n $auth->add($projectReportingFull);\n $auth->addChild($projectReportingFull, $projectReportingAdd);\n $auth->addChild($projectReportingAdd, $projectReportingRead);\n\n // Actions Permissions\n $projectActionsNoAccess = $auth->createPermission('projectActionsNoAccess');\n $projectActionsRead = $auth->createPermission('projectActionsRead');\n $projectActionsAdd = $auth->createPermission('projectActionsAdd');\n $projectActionsFull = $auth->createPermission('projectActionsFull');\n\n $auth->add($projectActionsNoAccess);\n $auth->add($projectActionsRead);\n $auth->add($projectActionsAdd);\n $auth->add($projectActionsFull);\n $auth->addChild($projectActionsFull, $projectActionsAdd);\n $auth->addChild($projectActionsAdd, $projectActionsRead);\n\n // Risk Permissions\n $projectRiskNoAccess = $auth->createPermission('projectRiskNoAccess');\n $projectRiskRead = $auth->createPermission('projectRiskRead');\n $projectRiskAdd = $auth->createPermission('projectRiskAdd');\n $projectRiskFull = $auth->createPermission('projectRiskFull');\n\n $auth->add($projectRiskNoAccess);\n $auth->add($projectRiskRead);\n $auth->add($projectRiskAdd);\n $auth->add($projectRiskFull);\n $auth->addChild($projectRiskFull, $projectRiskAdd);\n $auth->addChild($projectRiskAdd, $projectRiskRead);\n\n // Decision Permissions\n $projectDecisionNoAccess = $auth->createPermission('projectDecisionNoAccess');\n $projectDecisionRead = $auth->createPermission('projectDecisionRead');\n $projectDecisionAdd = $auth->createPermission('projectDecisionAdd');\n $projectDecisionFull = $auth->createPermission('projectDecisionFull');\n\n $auth->add($projectDecisionNoAccess);\n $auth->add($projectDecisionRead);\n $auth->add($projectDecisionAdd);\n $auth->add($projectDecisionFull);\n $auth->addChild($projectDecisionFull, $projectDecisionAdd);\n $auth->addChild($projectDecisionAdd, $projectDecisionRead);\n\n // Issue Permissions\n $projectIssueNoAccess = $auth->createPermission('projectIssueNoAccess');\n $projectIssueRead = $auth->createPermission('projectIssueRead');\n $projectIssueAdd = $auth->createPermission('projectIssueAdd');\n $projectIssueFull = $auth->createPermission('projectIssueFull');\n\n $auth->add($projectIssueNoAccess);\n $auth->add($projectIssueRead);\n $auth->add($projectIssueAdd);\n $auth->add($projectIssueFull);\n $auth->addChild($projectIssueFull, $projectIssueAdd);\n $auth->addChild($projectIssueAdd, $projectIssueRead);\n\n // Configuration Permissions\n $projectConfigurationNoAccess = $auth->createPermission('projectConfigurationNoAccess');\n $projectConfigurationRead = $auth->createPermission('projectConfigurationRead');\n $projectConfigurationAdd = $auth->createPermission('projectConfigurationAdd');\n $projectConfigurationFull = $auth->createPermission('projectConfigurationFull');\n\n $auth->add($projectConfigurationNoAccess);\n $auth->add($projectConfigurationRead);\n $auth->add($projectConfigurationAdd);\n $auth->add($projectConfigurationFull);\n $auth->addChild($projectConfigurationFull, $projectConfigurationAdd);\n $auth->addChild($projectConfigurationAdd, $projectConfigurationRead);\n\n // Set project permission tree\n // Read\n $auth->addChild($projectRead, $projectReportingRead);\n $auth->addChild($projectRead, $projectActionsRead);\n $auth->addChild($projectRead, $projectRiskRead);\n $auth->addChild($projectRead, $projectDecisionRead);\n $auth->addChild($projectRead, $projectIssueRead);\n $auth->addChild($projectRead, $projectConfigurationRead);\n\n // Add\n $auth->addChild($projectAdd, $projectRead);\n $auth->addChild($projectAdd, $projectReportingAdd);\n $auth->addChild($projectAdd, $projectActionsAdd);\n $auth->addChild($projectAdd, $projectRiskAdd);\n $auth->addChild($projectAdd, $projectDecisionAdd);\n $auth->addChild($projectAdd, $projectIssueAdd);\n $auth->addChild($projectAdd, $projectConfigurationAdd);\n\n // Full\n $auth->addChild($projectFull, $projectAdd);\n $auth->addChild($projectFull, $projectReportingFull);\n $auth->addChild($projectFull, $projectActionsFull);\n $auth->addChild($projectFull, $projectRiskFull);\n $auth->addChild($projectFull, $projectDecisionFull);\n $auth->addChild($projectFull, $projectIssueFull);\n $auth->addChild($projectFull, $projectConfigurationFull);\n\n // Set permissions for certain roles\n // Project Manager has Full control over project module\n $projectManager = $auth->getRole('projectManager');\n $auth->addChild($projectManager, $projectFull);\n\n // Audit has read access over project module\n $audit = $auth->getRole('audit');\n $auth->addChild($audit, $projectRead);\n\n // SME has read access for Access and Risk pages under project module\n $sme = $auth->getRole('sme');\n $auth->addChild($sme, $projectActionsAdd);\n $auth->addChild($sme, $projectRiskRead);\n\n return true;\n }",
"protected function PopulateProjects()\n\t{\n\t\t$this->curlevel = 0;\n\t\t$this->RecurseDir($this->projectDir);\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
$query = $this>db>query('select a.,(select engname from state where id = a.stateid)statename,(select engname from parties where id = a.partycode)partyname,count(a.partycode)as votes from pre_results a where a.stateid = (select id from state where engname like "'.$state.'") and a.status=1 and a.year != 0 and a.year is not null group by partyname,year order by a.year desc,votes desc; '); | function get_vote_share_json_by_state($state)
{
$query = $this->db->query('select a.year,group_concat(distinct(b.shortname) )partyname,group_concat(a.totalshare)voteshare from voteshare a left join parties b on b.id = a.partycode where a.stateid = (select id from state where engname like "'.$state.'") and rtype = "state" group by a.stateid,a.year ');
return $query->result_array();
} | [
"public function count_vacancies_by_state(){\n $condition = \"vac.vacancies_status = 1 AND org.organization_status=1 AND dist.district_status=1 AND st.state_status = 1\";\n $this->db->select('count(state_id) as count_st,st.state_id,st.state_name');\n $this->db->from('tr_organization_vacancies AS vac');\n $this->db->join('tr_organization_profile AS org', 'org.organization_id = vac.vacancies_organization_id', 'inner');\n $this->db->join('tr_district AS dist', 'dist.district_id = org.organization_district_id', 'inner');\n $this->db->join('tr_state AS st', 'st.state_id = dist.district_state_id', 'inner');\n $this->db->where($condition);\n $this->db->order_by('count_st','desc');\n $this->db->group_by('st.state_name');\n $query = $this->db->get()->result_array();\n // echo \"staterecord\";\n // print_r($query);\n return $query;\n }",
"function get_topVotes() {\n\tglobal $db;\n\t//$q6 = \"select distinct actorID as aID, (select movieID from votes where actorID=aID group by userID order by count(*) DESC limit 0,1) as topMovie, (select distinct movieImg from votes where movieID=topMovie) as movieImg, (select distinct movieSynopsis from votes where movieID=topMovie) as movieSynopsis from votes\";\n\t$q6 = \"select actorID as aID, movieImg, movieSynopsis, (select movieID from votes where actorID=aID group by userID order by count(*) DESC limit 0,1) as topMovie from votes group by actorID\";\n\t$topVotes = $db->query($q6);\n\treturn $topVotes;\n}",
"function Getnooftestsinaugust($province,$year)\n{\n$startdate=$year.\"-08-01\";\n$enddate=$year.\"-08-31\";\n$strQuery=mysql_query(\"SELECT COUNT(samples.ID) as 'noofprovincialtests' FROM samples,patients,facilitys,districts WHERE samples.patientid=patients.AutoID AND samples.result IS NOT NULL AND YEAR(samples.datetested)='$year' AND (samples.datetested >='$startdate' AND samples.datetested <='$enddate') AND samples.facility=facilitys.ID AND facilitys.district=districts.ID AND districts.province='$province'\")or die(mysql_error());\n\n$resultarray=mysql_fetch_array($strQuery);\n$provincialtests=$resultarray['noofprovincialtests'];\nreturn $provincialtests;\n}",
"function Getnooftestsinapril($province,$year)\n{\n\n$startdate=$year.\"-04-01\";\n$enddate=$year.\"-04-30\";\n$strQuery=mysql_query(\"SELECT COUNT(samples.ID) as 'noofprovincialtests' FROM samples,patients,facilitys,districts WHERE samples.patientid=patients.AutoID AND samples.result IS NOT NULL AND YEAR(samples.datetested)='$year' AND (samples.datetested >='$startdate' AND samples.datetested <='$enddate') AND samples.facility=facilitys.ID AND facilitys.district=districts.ID AND districts.province='$province'\")or die(mysql_error());\n\n$resultarray=mysql_fetch_array($strQuery);\n$provincialtests=$resultarray['noofprovincialtests'];\nreturn $provincialtests;\n}",
"function Getnooftestsinjuly($province,$year)\n{\n$startdate=$year.\"-07-01\";\n$enddate=$year.\"-07-31\";\n$strQuery=mysql_query(\"SELECT COUNT(samples.ID) as 'noofprovincialtests' FROM samples,patients,facilitys,districts WHERE samples.patientid=patients.AutoID AND samples.result IS NOT NULL AND YEAR(samples.datetested)='$year' AND (samples.datetested >='$startdate' AND samples.datetested <='$enddate') AND samples.facility=facilitys.ID AND facilitys.district=districts.ID AND districts.province='$province'\")or die(mysql_error());\n\n$resultarray=mysql_fetch_array($strQuery);\n$provincialtests=$resultarray['noofprovincialtests'];\nreturn $provincialtests;\n}",
"function Getnooftestsinmay($province,$year)\n{\n\n$startdate=$year.\"-05-01\";\n$enddate=$year.\"-05-31\";\n$strQuery=mysql_query(\"SELECT COUNT(samples.ID) as 'noofprovincialtests' FROM samples,patients,facilitys,districts WHERE samples.patientid=patients.AutoID AND samples.result IS NOT NULL AND YEAR(samples.datetested)='$year' AND (samples.datetested >='$startdate' AND samples.datetested <='$enddate') AND samples.facility=facilitys.ID AND facilitys.district=districts.ID AND districts.province='$province'\")or die(mysql_error());\n\n$resultarray=mysql_fetch_array($strQuery);\n$provincialtests=$resultarray['noofprovincialtests'];\nreturn $provincialtests;\n}",
"public function constructCountylessQuery(){\n\t\t$this->query = $this->qBase . $this->year .'/'. $this->survey .'?key='.$this->key.'&get='.$this->table.'&for=state:'.$this->stateNum;\n\t}",
"public function count_female_owners()\n{\n // $this->db->where($query);\n // $this->db->where(['application_bplo.status' => 'Active'])->or_where('application_bplo.status =', 'Expired');\n $this->db->select('owners.firstName, owners.gender')->from($this->table)->join($this->table_business,'owners.ownerId = businesses.ownerId')->join($this->table_bplo, 'businesses.businessId = application_bplo.businessId')->where(['owners.gender' => 'female', 'application_bplo.status' => 'active'])->or_where('application_bplo.status', 'expired');\n $this->db->group_by('owners.firstName');\n\n return $this->db->count_all_results();\n}",
"function loadLedger($year,$id){\r\n$sql = \"SELECT payroll.*, employee.employeeName FROM payroll, employee WHERE payroll.employeeId='$id' AND employee.employeeId='$id' AND payroll.year= '$year' ORDER BY sn DESC\";\r\nreturn $this->query($sql);\r\n}",
"function Getnooftestsindec($province,$year)\n{\n$startdate=$year.\"-12-1\";\n$enddate=$year.\"-12-31\";\n\n$strQuery=mysql_query(\"SELECT COUNT(samples.ID) as 'noofprovincialtests' FROM samples,patients,facilitys,districts WHERE samples.patientid=patients.AutoID AND samples.result IS NOT NULL AND YEAR(samples.datetested)='$year' AND ((samples.datetested >=$startdate) AND (samples.datetested <=$enddate)) AND samples.facility=facilitys.ID AND facilitys.district=districts.ID AND districts.province='$province'\")or die(mysql_error());\n$resultarray=mysql_fetch_array($strQuery);\n$provincialtests=$resultarray['noofprovincialtests'];\nreturn $provincialtests;\n}",
"function ot_get_project_version_statistics($version_id)\n{\n $query = mysql_query(\"\n SELECT *\n FROM tr_project_version_language_stats pvls\n INNER JOIN tr_languages l ON pvls.language_id = l.language_id\n WHERE pvls.version_id = $version_id\n ORDER BY l.language_name\n \") or die(mysql_error());\n\n return $query;\n}",
"function getCollegeCount($dbh, $customer_id){\n $componentsArr = createWhereClauseUsingCriteria($dbh, $customer_id);\n $where = $componentsArr[0];\n $distCols = $componentsArr[1];\n $distHaving = $componentsArr[2];\n $where .= $distHaving;\n\n $query = \"SELECT count(*) as count FROM (\n select institutions.unitid $distCols from institutions, admissions_info\n where institutions.unitid = admissions_info.unitid $where\n ) as count\";\n #####echo \"query:$query\\n\";\n $data = execSqlSingleRowPREPARED($dbh, $query);\n return $data;\n}",
"public function meal_school_distic_based_count_details($districtid)\n {\n\t \n $sql=\"\nselect aa.district_id,aa.district_name,aa.school_name,aa.school_id,aa.block_name,aa.udise_code,aa.total, bb.meals from \n(SELECT district_id, district_name,school_id,school_name,block_name,udise_code,SUM(c1_b+c1_g+c1_t+c2_b+c2_g+c2_t+c3_b+c3_g+c3_t+c4_b+c4_g+c4_t+c5_b+c5_g+c5_t+c6_b+c6_g+c6_t+c7_b+c7_g+c7_t+c8_b+c8_g+c8_t) AS total FROM students_school_child_count where students_school_child_count.school_type_id in (1 ,2) and students_school_child_count.management='Corporation School' and district_id= \".$districtid.\" GROUP BY district_id,school_id) aa\n left join\n(\nselect students_school_child_count.district_id,students_school_child_count.school_id,students_school_child_count.school_name,count(*) meals from schoolnew_schemeindent \nleft join students_child_detail on students_child_detail.id =schoolnew_schemeindent.student_id \nleft join students_school_child_count on students_school_child_count.school_id =students_child_detail.school_id where students_school_child_count.school_type_id in (1 ,2) and schoolnew_schemeindent.scheme_id=15 and students_school_child_count.district_id = \".$districtid.\" and students_school_child_count.management='Corporation School'\ngroup by students_school_child_count.school_id) bb\n\non aa.school_id = bb.school_id \";\n $query = $this->db->query($sql);\n return $query->result();\n }",
"public function state_summary() {\n\n\n\n\t\t/*SELECT `SearchAreas`.`AreaName`, COUNT(`SearchAreas`.`AreaName`) AS `AreaCount` \n\t\tFROM `Search` \n\t\tINNER JOIN `SearchAreas` ON `Search`.`id` = `SearchAreas`.`SearchID`\n\t\tWHERE `Search`.`Active`=1 GROUP BY `SearchAreas`.`AreaName` ORDER BY `AreaCount` DESC*/\n\n\t\t$this->db->select('SearchAreas.AreaName, COUNT(SearchAreas.AreaName) AS AreaCount')->from('Search')->join('SearchAreas', 'Search.id = SearchAreas.SearchID')->where('Search.Active', 1)->group_by('SearchAreas.AreaName')->order_by('AreaCount', 'desc');\n\t\t$query = $this->db->get();\n if ($query->num_rows() > 0) {\n return $this->process_results($query->result());\n } else {\n return array();\n } \n\t\t\n\t\t//return $this->get_all_using_params(array('Search.Active'=>1, 'group_by'=>array('SearchAreas.AreaName'), 'order_by'=>array('AreaCount'=>'desc')), array('AreaName', 'COUNT(*) AS AreaCount'), 'SearchAreas');\n\t}",
"function bobotsoal(){\n\t\t$query=$this->db->query(\"SELECT idsoal, soal, bobot FROM soalquiz2 ORDER BY idsoal ASC\");\n\t\treturn $query->result();\n\t}",
"function getPWKAsal()\n {\n $sql=\"SELECT a.*,\nSUM(CASE WHEN quarter(a.tmt) = 1 AND year(a.tmt)= YEAR(SUBDATE(CURDATE(), INTERVAL 1 YEAR)) THEN 1 ElSE 0 END) AS Q1,\nSUM(CASE WHEN quarter(a.tmt) = 2 AND year(a.tmt)= YEAR(SUBDATE(CURDATE(), INTERVAL 1 YEAR)) THEN 1 ELSE 0 END) AS Q2, \nSUM(CASE WHEN quarter(a.tmt) = 3 AND year(a.tmt)= YEAR(SUBDATE(CURDATE(), INTERVAL 1 YEAR)) THEN 1 ELSE 0 END) AS Q3, \nSUM(CASE WHEN quarter(a.tmt) = 4 AND year(a.tmt)= YEAR(SUBDATE(CURDATE(), INTERVAL 1 YEAR)) THEN 1 ELSE 0 END) AS Q4 \nFROM (SELECT a.instansi_asal ,a.tmt FROM pwk a WHERE year(tmt) = year(SUBDATE(CURDATE(),INTERVAL 1 YEAR))\n) a\nGROUP BY a.instansi_asal\";\t\n\t\t$query = $this->db1->query($sql);\n\t\treturn $query;\n }",
"function queryViewAllVendors(){\n#\t$query = \"select * from vendor_vendor vv, country_country cc where vv.vc_id = cc.vc_id and vv.vs_id = 1 order by v_name;\";\n\t$query = \"select * from vendor_vendor where vs_id = 1 order by v_name;\";\n\n\treturn $query;\n}",
"function result($id)\n\t{\n\n\t\t$result = $this->db->query(\" SELECT * FROM ci_voting_counter INNER JOIN ci_voting\n ON ci_voting_counter.v_voting_id = ci_voting.dv_id\n WHERE dv_id=$id \")->row();\n\t\treturn $result;\n\t}",
"function get_exp_tot_pub($exp_id){\n $query = $this->db->query(\"SELECT COUNT(DISTINCT publication_id) AS total_publication FROM publication NATURAL JOIN alias_match_publication NATURAL JOIN expert_alias NATURAL JOIN expert_match_alias WHERE `expert_id` = $exp_id AND `match_success`= 'true' AND `confirm_match` = 'true'\");\n //$query = $this->db->query(\"SELECT COUNT(DISTINCT publication_id) AS total_publication FROM publication WHERE publication_id IN ( SELECT DISTINCT publication_id FROM publication NATURAL JOIN expert_match_alias NATURAL JOIN expert_alias WHERE `expert_id` = $exp_id AND `authors` LIKE CONCAT('%',`alias_name`, '%'))\");\n $row = $query->row_array();\n return $row['total_publication'];\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set the value of pkgName | public function setPkgName($pkgName)
{
$this->pkgName = $pkgName;
return $this;
} | [
"public function setPackageName(string $name): void\n {\n $this->name = $name;\n }",
"public function setNamePackage($name){\n $this->_namePackage = $name;\n return $this;\n }",
"public function setDefaultpackagename($name) {\n\t\t$this->defaultPackageName = $name;\n\t}",
"public function setPackageName($name){\r\n\t\t\t$valid = false;\r\n\t\t\tif (preg_match(\"/^[a-zA-Z ]+$/\",$name)){\r\n\t\t\t\t$this->package_name = $name;\r\n\t\t\t\t$valid = true;\r\n\t\t\t}\r\n\t\t\treturn $valid;\r\n\t}",
"public function setPackage($var) {}",
"function setModuleName($name) {\r\n\t\t$this->dt_mod_name = $name;\r\n\t}",
"private function setName()\n {\n $this->name = isset($this->config->plugin_name) \n ? $this->config->plugin_name \n : null;\n }",
"function setProductName($productName);",
"public static function setPackage($str) {\n\t\tself::$package = $str;\n\t}",
"public function set_module_name($name) {\n\t\t$this->my_module_name = $name;\n\t}",
"function setSyncProdName()\n {\n }",
"public static function setModuleName($module_name);",
"public function setSystemName($name) {\n\t\t$this->element = $name;\n\t}",
"public function setAppPackageFamilyName(?string $value): void {\n $this->getBackingStore()->set('appPackageFamilyName', $value);\n }",
"public function setPackage(?string $value): void {\n $this->getBackingStore()->set('package', $value);\n }",
"public function setManifestName($value)\n {\n $this->_manifestName = $value;\n }",
"public function setPackageDownloadName($sName);",
"final public function setName($name) {\n\t\t$this->_external_name = $name;\n\t}",
"public function setModuleName($name) {\n $this->moduleName = $name;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Validate supported search engines | public function validateSearchEngine( $match = '' )
{
if( empty( $this->policy ) || ! is_array( $this->policy ) ) {
return false;
}
switch( mb_strtolower( $match ) )
{
case('googlebot'):
return $this->validateGoogleBot();
break;
case('bingbot'):
case('msnbot'):
return $this->validateBingBot();
break;
case('slurp'):
case('yahoo'):
return $this->validateYahoo();
break;
case('duckduckbot'):
return $this->validateDuck();
break;
default:
// echo 'Search engine name is not supported (' . $match . ')';
break;
}
return false;
} | [
"private function should_display_search_engines_discouraged_notice()\n {\n }",
"function wp_ozh_wsa_is_fromsearchengine() {\r\n\tglobal $wp_ozh_wsa;\r\n\t$ref = $_SERVER['HTTP_REFERER'];\r\n\tif (isset($wp_ozh_wsa['my_search_engines'])) {\r\n\t\t$SE = $wp_ozh_wsa['my_search_engines'];\r\n\t} else {\r\n\t\t$SE = array('/search?', '.google.', 'web.info.com', 'search.', 'del.icio.us/search',\r\n\t\t'soso.com', '/search/', '.yahoo.', \r\n\t\t);\r\n\t}\r\n\tforeach ($SE as $url) {\r\n\t\tif (strpos($ref,$url)!==false) return true;\r\n\t}\r\n\treturn false;\t\r\n}",
"private function getSupportedSearchEngines()\n {\n return $this->supportedSearchEngines;\n }",
"public function Check_Search_Engines ($search_engine_name, $search_engine = null) {\r\n\t\t\r\n\t\t\tif( strstr($search_engine, $search_engine_name) ) {\r\n\t\t\t\treturn 1;\r\n\t\t\t}\r\n\t\t}",
"public function searchQueryChecker();",
"function site_uses_google_search() {\n\treturn site_uses_search() && gcse_id();\n}",
"public function checkFulltextSupport();",
"private function detectRefererSearchEngine()\n\t{\n\t\t/*\n\t\t * A referer is a search engine if the URL's host is in the SearchEngines array\n\t\t * and if we found the keyword in the URL.\n\t\t *\n\t\t * For example if someone comes from http://www.google.com/partners.html this will not\n\t\t * be counted as a search engines, but as a website referer from google.com (because the\n\t\t * keyword couldn't be found in the URL)\n\t\t */\n\t\trequire \"modules/DataFiles/SearchEngines.php\";\n\n\t\tif(array_key_exists($this->refererHost, $GLOBALS['Piwik_SearchEngines']))\n\t\t{\n\t\t\t// which search engine ?\n\t\t\t$searchEngineName = $GLOBALS['Piwik_SearchEngines'][$this->refererHost][0];\n\t\t\t$variableName = $GLOBALS['Piwik_SearchEngines'][$this->refererHost][1];\n\n\t\t\t// if there is a query, there may be a keyword...\n\t\t\tif(isset($this->refererUrlParse['query']))\n\t\t\t{\n\t\t\t\t$query = $this->refererUrlParse['query'];\n\n\t\t\t\t// search for keywords now &vname=keyword\n\t\t\t\t$key = trim(strtolower(Piwik_Common::getParameterFromQueryString($query, $variableName)));\n\n\t\t\t\tif((function_exists('iconv'))\n\t\t\t\t\t&& (isset($GLOBALS['Piwik_SearchEngines'][$this->refererHost][2])))\n\t\t\t\t{\n\t\t\t\t\t$charset = trim($GLOBALS['Piwik_SearchEngines'][$this->refererHost][2]);\n\n\t\t\t\t\tif(!empty($charset))\n\t\t\t\t\t{\n\t\t\t\t\t\t$key = htmlspecialchars(\n\t\t\t\t\t\t\t\t\t@iconv(\t$charset,\n\t\t\t\t\t\t\t\t\t\t\t'utf-8//TRANSLIT',\n\t\t\t\t\t\t\t\t\t\t\t//TODO testthis fnction exists!! use upgrade.php\n\t\t\t\t\t\t\t\t\t\t\thtmlspecialchars_decode($key, Piwik_Common::HTML_ENCODING_QUOTE_STYLE))\n\t\t\t\t\t\t\t\t\t, Piwik_Common::HTML_ENCODING_QUOTE_STYLE);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\n\t\t\t\tif(!empty($key))\n\t\t\t\t{\n\t\t\t\t\t$this->typeRefererAnalyzed = Piwik_Common::REFERER_TYPE_SEARCH_ENGINE;\n\t\t\t\t\t$this->nameRefererAnalyzed = $searchEngineName;\n\t\t\t\t\t$this->keywordRefererAnalyzed = $key;\n\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"static public function extractSearchEngineInformationFromUrl($refererUrl)\n\t{\n\t\t$refererParsed = @parse_url($refererUrl);\n\t\t$refererHost = '';\n\t\tif(isset($refererParsed['host']))\n\t\t{\n\t\t\t$refererHost = $refererParsed['host'];\n\t\t}\n\t\tif(empty($refererHost))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\tif(!isset($refererParsed['query']))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\trequire_once \"DataFiles/SearchEngines.php\";\n\n\t\tif(!array_key_exists($refererHost, $GLOBALS['Piwik_SearchEngines']))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\t$searchEngineName = $GLOBALS['Piwik_SearchEngines'][$refererHost][0];\n\t\t$variableNames = $GLOBALS['Piwik_SearchEngines'][$refererHost][1];\n\t\tif(!is_array($variableNames))\n\t\t{\n\t\t\t$variableNames = array($variableNames);\n\t\t}\n\t\t$query = $refererParsed['query'];\n\n\t\tif($searchEngineName == 'Google Images')\n\t\t{\n\t\t\t$query = urldecode(trim(strtolower(Piwik_Common::getParameterFromQueryString($query, 'prev'))));\n\t\t\t$query = str_replace('&', '&', strstr($query, '?'));\n\t\t}\n\n\t\tforeach($variableNames as $variableName)\n\t\t{\n\t\t\t// search for keywords now &vname=keyword\n\t\t\t$key = strtolower(Piwik_Common::getParameterFromQueryString($query, $variableName));\n\t\t\t$key = trim(urldecode($key));\n\t\t\tif(!empty($key))\n\t\t\t{\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif(empty($key))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\tif(function_exists('iconv')\n\t\t\t&& isset($GLOBALS['Piwik_SearchEngines'][$refererHost][3]))\n\t\t{\n\t\t\t$charset = trim($GLOBALS['Piwik_SearchEngines'][$refererHost][3]);\n\t\t\tif(!empty($charset))\n\t\t\t{\n\t\t\t\t$key = @iconv($charset, 'utf-8//IGNORE', $key);\n\t\t\t}\n\t\t}\n\t\treturn array(\n\t\t\t'name' => $searchEngineName,\n\t\t\t'keywords' => $key,\n\t\t);\n\t}",
"function validateSearch() {\n if (!isset($_GET['search']) || is_null($_GET['search']) || !is_string($_GET['search']) || strlen($_GET['search']) <= 0) {\n return false;\n }\n\n return true;\n }",
"public function search_engines_discouraged_notice()\n {\n }",
"function get_search_validate()\r\n {\r\n return $this->get_search_form()->validate();\r\n }",
"public function isTypoCorrectedSearch();",
"public static function parseReferer($url)\n {\n // Search Engines\n $engines = array(\n 'Google PPC' => array(\n 'host_pattern_preg' => '!(googleadservices|google)(\\\\.[a-z]+)+$!',\n 'path_pattern' => '!^/aclk!',\n 'query_variable' => 'q'\n ),\n 'Google Images' => array(\n 'host_pattern_preg' => '!google(\\\\.[a-z]+)+$!',\n 'path_pattern' => '!^/imgres!',\n 'query_variable' => 'q'\n ),\n 'Google' => array(\n 'host_pattern_preg' => '!google(\\\\.[a-z]+)+$!',\n 'path_pattern' => '!^/!',\n 'query_variable' => 'q'\n ),\n 'Yahoo!' => array(\n 'host_pattern_preg' => '!([a-z]+\\\\.)*search.yahoo.[a-z]+!',\n 'path_pattern' => '!^/(search|tablet)!',\n 'query_variable' => 'p'\n ),\n 'Live search' => array(\n 'host_pattern_preg' => '!search\\\\.(live|msn)\\\\.[a-z]+!',\n 'path_pattern' => '!^/results.aspx!',\n 'query_variable' => 'q'\n ),\n 'Bing' => array(\n 'host_pattern_preg' => '!bing\\\\.[a-z]+!',\n 'path_pattern' => '!^/search!',\n 'query_variable' => array('q', 'MT')\n ),\n 'MyWebSearch' => array(\n 'host_pattern_preg' => '!mywebsearch(\\\\.[a-z]+)+$!',\n 'path_pattern' => '!^/!',\n 'query_variable' => 'searchfor'\n ),\n 'Ask.com' => array(\n 'host_pattern_preg' => '!ask(\\\\.[a-z]+)+$!',\n 'path_pattern' => '!^/!',\n 'query_variable' => 'q'\n ),\n 'AOL' => array(\n 'host_pattern_preg' => '!search.aol(\\\\.[a-z]+)+$!',\n 'path_pattern' => '!^/!',\n 'query_variable' => array('q', 'query')\n ),\n 'Facebook' => array(\n 'host_pattern_preg' => '!facebook.com$!',\n 'path_pattern' => '!^/l.php!',\n 'query_variable' => 'q'\n )\n );\n // Parse URL\n $url_data = parse_url($url);\n // Detect Google PPC\n if (preg_match('!googleadservices!', $url_data['host'])) {\n return array('source' => 'Google PPC');\n }\n // Google PPC Auto-Tagged\n if (preg_match('!' . Http_Host::getDomain() . '!', $url_data['host'])) {\n parse_str($url_data['query'], $query_data);\n if (!empty($query_data['gclid'])) {\n return array('source' => 'Google PPC');\n }\n }\n // Detect Search Engine\n foreach ($engines as $engine_name => $engine) {\n if (preg_match($engine['host_pattern_preg'], $url_data['host']) && preg_match($engine['path_pattern'], $url_data['path'])) {\n parse_str($url_data['query'], $query_data);\n // Find Keywords\n $variables = is_array($engine['query_variable']) ? $engine['query_variable'] : array($engine['query_variable']);\n foreach ($variables as $variable) {\n $keywords = $query_data[$variable];\n if (!empty($keywords)) {\n return array('source' => $engine_name, 'keywords' => $keywords);\n }\n }\n }\n }\n // Unknown\n return null;\n }",
"public function setEngine($str='google.com'){\n global $searchEngine;\n\n //check if str is empty\n if(empty($str)){\n throw new Exceptions(\"Search Engine value cannot be empty\");\n }else{\n $searchEngine = $str;\n }\n\n return $searchEngine;\n }",
"public function manage_search_engines_discouraged_notification()\n {\n }",
"function prepareSearchEngines()\n{\n\tglobal $modSettings;\n\n\t$engines = array();\n\tif (!empty($modSettings['additional_search_engines']))\n\t{\n\t\t$search_engines = ElkArte\\Util::unserialize($modSettings['additional_search_engines']);\n\t\tforeach ($search_engines as $engine)\n\t\t{\n\t\t\t$engines[strtolower(preg_replace('~[^A-Za-z0-9 ]~', '', $engine['name']))] = $engine;\n\t\t}\n\t}\n\n\treturn $engines;\n}",
"protected function _validateNewsSearch($options)\n {\n $valid_options = array('appid', 'query', 'results', 'start', 'sort', 'language', 'type', 'site');\n if (!is_array($options)) {\n return;\n }\n\n $this->_compareOptions($options, $valid_options);\n\n if (isset($options['results'])) {\n if (!Zend_Filter::isBetween($options['results'], 1, 20, true)) {\n throw new Zend_Service_Exception($options['results'] . ' is not valid for the \"results\" option.');\n }\n }\n if (isset($options['start'])) {\n if (!Zend_Filter::isBetween($options['start'], 1, 1000, true)) {\n throw new Zend_Service_Exception($options['start'] . ' is not valid for the \"start\" option.');\n }\n }\n\n if (isset($language)) {\n $this->_validateLanguage($language);\n }\n\n $this->_validateInArray('sort', $options['sort'], array('rank', 'date'));\n $this->_validateInArray('type', $options['type'], array('all', 'any', 'phrase'));\n\n }",
"public function discourage_search_engines_check_beta() {\n\t\t$public = get_option('blog_public');\n\t\tif ( get_development_environment() === 'beta' && (int) $public === 1 ) {\n\t\t\t?>\n\t\t\t\t<div class=\"notice notice-error is-dismissible\">\n\t\t\t\t\t<p><?php _e('👀 \"Discourage search engines\" should be on during beta (Settings > Reading). <a href=\"' . get_developer_options_link() . '\">Hide developer alerts.</a>', 'bco'); ?></p>\n\t\t\t\t</div>\n\t\t\t<?php\t\n\t\t}\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Finds the ScanWeimaDetail model based on its primary key value. If the model is not found, a 404 HTTP exception will be thrown. | protected function findModel($id)
{
if (($model = ScanWeimaDetail::findOne($id)) !== null) {
return $model;
} else {
throw new NotFoundHttpException('The requested page does not exist.');
}
} | [
"protected function findModel($id_riwayat)\n {\n if (($model = Riwayat::findOne($id_riwayat)) !== null) {\n return $model;\n } else {\n throw new HttpException(404, 'The requested page does not exist.');\n }\n }",
"protected function findModel($id)\n\t{\n\t\tif (($model = WiRequest::findOne($id)) !== null) {\n\t\t\treturn $model;\n\t\t} else {\n\t\t\tthrow new HttpException(404, 'The requested page does not exist.');\n\t\t}\n\t}",
"protected function findModel($masterlist_id)\n\t{\n\t\tif (($model = WiMasterlist::findOne($masterlist_id)) !== null) {\n\t\t\treturn $model;\n\t\t} else {\n\t\t\tthrow new HttpException(404, 'The requested page does not exist.');\n\t\t}\n\t}",
"protected function findModel()\n {\n if (($model = WebsiteInfo::find()->one()) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException(Yii::t('backend', 'The requested page does not exist.'));\n // throw new NotFoundHttpException(BackendModule::t('backend','The requested page does not exist.'));\n }",
"protected function getModelRecordFromRoute()\n {\n //get primary key fields\n $primaryKey = $this->model->getConfig()->primaryKey;\n $where = [[$primaryKey, $this->routeParameters->$primaryKey]];\n $record = $this->model->first($where);\n if(!$record) {\n throw new \\Exception(\"Current route is supposed to retrieve a record but record is not found\", 1);\n }\n return $record;\n }",
"protected function findModel($id)\n {\n \t$model = SoSheetDetail::find()->alias('soDetail')\n \t->joinWith('order order')\n \t->joinWith('package package')\n \t->joinWith('product product')\n \t->where(['soDetail.id' => $id])->one();\n \t \n \tif($model !==null){\n// if (($model = SoSheetDetail::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException(Yii::t('app', 'The requested page does not exist.'));\n }\n }",
"protected function findModel($id)\n\t{\n\t\tif (($model = Budget::findOne($id)) !== null) {\n\t\t\treturn $model;\n\t\t} else {\n\t\t\tthrow new HttpException(404, 'The requested page does not exist.');\n\t\t}\n\t}",
"public function find(mixed $primaryKey): ?ModelInterface;",
"protected function findModel($id)\n {\n $modelClass = $this->getModel();\n if (($model = $modelClass->findOne($id)) !== null) {\n return $model;\n } else {\n throw new HttpException(404, Yii::t('app', 'The requested page does not exist.'));\n }\n }",
"protected function findModel($id){ \n \n if (($model = TransWh::findOne($id)) !== null) { \n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n \n }",
"public static function find( $primaryKey )\n\t{\n\t\tself::init();\n\t\t\n\t\t// Select one item by primary key in Database\n\t\t$result = Database::selectOne(\"SELECT * FROM `\" . static::$table . \"` WHERE `\" . static::$primaryKey . \"` = ?\", $primaryKey);\t\t\n\t\tif( $result == null )\n\t\t{\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\t// Create & return new object of Model\n\t\treturn self::newItem($result);\n\t}",
"protected function findModel()\n {\n $id = Yii::$app->request->get('id');\n $id = $id ? $id : Yii::$app->request->post('id');\n if (($model = ShipAddress::findOne($id)) !== null) {\n return $model;\n }\n\n throw new HttpException('The requested page does not exist.');\n }",
"protected function findModel($id)\n {\n // if (($model = WaterSinglertustation::findOnex(rtu_555555,$id)) !== null) {\n if (($model = WaterSinglertustation::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }",
"protected function findModel($id)\n\t{\n\t\tif (($model = Page::findOne($id)) !== null) {\n\t\t\treturn $model;\n\t\t} else {\n\t\t\tthrow new HttpException(404, 'The requested page does not exist.');\n\t\t}\n\t}",
"protected function findModel($id)\n {\n if (($model = ContentSource::findOne($id)) !== null)\n {\n return $model;\n }\n else\n {\n throw new HttpException(404, Yii::t('backend', 'The requested page does not exist.'));\n }\n }",
"protected function findModel($id)\n {\n if (($model = AeExtTickerTrade::findOne($id)) !== null) {\n return $model;\n } else {\n throw new HttpException(404, 'The requested page does not exist.');\n }\n }",
"protected function findModel($id)\n {\n if (($model = ApiKeys::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }",
"protected function findModel($id) {\n if (($model = Bcf15Detail::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }",
"protected function findModel($id)\r\n {\r\n if (($model = Project::findOne($id)) !== null) {\r\n return $model;\r\n } else {\r\n throw new HttpException(404, 'The requested page does not exist.');\r\n }\r\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Deletes a revision entry based on $revision_id | public function removeRevision($revision_id)
{
$delete = $this->remove('file_revisions', array('id' => $revision_id));
return $delete;
} | [
"public function deleteRevision($revision_id);",
"public function revision_delete_action() {\n\n\t\t/**\n\t\t * Bail if required values unset.\n\t\t */\n\t\tif ( ! isset( $_GET['revision'] ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$revision_id = sanitize_key( $_GET['revision'] );\n\n\t\t/**\n\t\t * Verify revision ID valud.\n\t\t */\n \t\tif ( ! $revision = wp_get_post_revision( $revision_id ) ) {\n\t\t\tbreak;\n\t\t}\n\n\t\t/**\n\t\t * Verify parent post valid.\n\t\t */\n\t\tif ( ! $post = get_post( $revision->post_parent ) ) {\n\t\t\tbreak;\n\t\t}\n\n\t\t/**\n\t\t * Verify current user can edit parent post.\n\t\t */\n\t\tif ( ! current_user_can( 'edit_post', $post ) ) {\n\t\t\tbreak;\n\t\t}\n\n\t\t/**\n\t\t * Verify revisions not disabled and we're not looking at an autosave.\n\t\t */\n\t\tif ( ! constant('WP_POST_REVISIONS') && ! wp_is_post_autosave( $revision ) ) {\n\t\t\tbreak;\n\t\t}\n\n\t\t/**\n\t\t * Check the nonce.\n\t\t */\n\t\tcheck_admin_referer( \"delete-revision_$post->ID|$revision->ID\" );\n\n\t\t/**\n\t\t * Every checks out, delete the revision.\n\t\t */\n\t\twp_delete_post_revision( $revision->ID );\n\t\twp_redirect (\n\t\t\tadd_query_arg(\n\t\t\t\tarray(\n\t\t\t\t\t'message' => 99,\n\t\t\t\t\t'revision' => $revision->ID,\n\t\t\t\t),\n\t\t\t\tget_edit_post_link( $post->ID, 'url' )\n\t\t\t)\n\t\t);\n\t\texit();\n\t}",
"function regression_regression_revision_delete($id) {\n entity_delete('regression_revision', entity_id('regression_revision', $id));\n}",
"function wp_delete_post_revision($revision)\n {\n }",
"protected function deleteRevision()\n\t{\n\t\tif( !\\IPS\\Member::loggedIn()->group['g_pmviewer_editposts'] )\n\t\t{\n\t\t\t\\IPS\\Output::i()->error( 'pmviewer_no_permission', '2C137/2', 403, '' );\n\t\t}\n\n\t\tif ( !\\IPS\\Request::i()->id )\n\t\t{\n\t\t\t\\IPS\\Output::i()->error( 'node_error', '2B221/1', 404, '' );\n\t\t}\n\n\t\t$post = \\IPS\\DB::i()->select( '*', 'pmviewer_edithistory', array( 'eh_id=?', \\IPS\\Request::i()->id ) )->first();\n\n\t\t\\IPS\\Db::i()->delete( 'pmviewer_edithistory', array( 'eh_id=?', \\IPS\\Request::i()->id ) );\n\n\t\t$conversation \t= \\IPS\\core\\Messenger\\Conversation::load( $post['eh_conversation_id'] );\n\n\t\t/* Admin log */\n\t\t\\IPS\\Session::i()->log( 'pmviewer_revision_deleted', array( $post['eh_post_id'] => TRUE, $conversation->id => TRUE, $conversation->title => TRUE ), FALSE );\n\n\t\tif( !$this->countRevisions( $post['eh_post_id'] ) )\n\t\t{\n\t\t\t\\IPS\\Db::i()->update( 'core_message_posts', array( 'msg_edited_pmviewer' => 0 ), 'msg_id = '. $post['eh_post_id'] );\n\t\t}\n\n\t\t\\IPS\\Output::i()->redirect( \\IPS\\Http\\Url::internal( \"app=pmviewer&module=viewer&controller=conversations&do=view&id=\" . $conversation->id ), 'pmviewer_revision_deleted_short' );\n\t}",
"function _revisioning_delete_revision(&$node, $vid = NULL) {\n $node_revision = is_object($node) ? $node : node_load($node, $vid);\n module_invoke_all('revisionapi', 'pre delete', $node_revision);\n db_delete('node_revision')\n ->condition('vid', $node_revision->vid)\n ->execute();\n module_invoke_all('node_' . $node_revision, 'delete revision');\n watchdog('content', '@type: deleted %title revision %revision.', array('@type' => $node_revision->type, '%title' => $node_revision->title, '%revision' => $node_revision->vid));\n}",
"public function admin_delete($id) {\n \n \tif (is_numeric($id)) {\n \t\t// Is this the current revision? Do not allow deletes\n \t\t$revision = $this->Revision->findById($id);\n \t\tif ($revision) {\n\t \t\n\t \t\t// Cannot delete current active revision\n\t \t\tif ($revision['Revision']['is_current'] !== 1) {\n\t\t \t\t\n\t\t \t\tif ($this->Revision->delete($id)) {\n\t\t \t\t\t$this->Session->setFlash(__('Deleted revision'), true);\n\t\t \t\t} else {\n\t\t \t\t\t$this->Session->setFlash(__('Unable to delete revision'), true);\n\t\t \t\t}\n\t\t \t\n\t\t \t} else {\n\t\t \t\t$this->Session->setFlash(__('Cannot delete current revision'), true);\n\t\t \t}\n\t\t\t} \t\t\n \t} else {\n \t\t$this->Session->setFlash(__('Invalid revision id to delete', true));\n\t }\n\t \n\t $this->redirect($this->referer());\n }",
"public function deleteEntry($entry_id)\r\n {\r\n // the sql statement to delete the entry from the database\r\n $sql = \"DELETE FROM blog_entry\r\n WHERE id = ?\";\r\n\r\n $data = array($entry_id);\r\n\r\n // execute the statement\r\n $this->makeStatement($sql, $data);\r\n }",
"public function deleteAction(Request $request, Revision $revision)\n {\n $form = $this->createDeleteForm($revision);\n $form->handleRequest($request);\n if ($form->isSubmitted() && $form->isValid()) {\n $em = $this->getDoctrine()->getManager();\n $em->remove($revision);\n $em->flush();\n }\n return $this->redirectToRoute('revision_index');\n }",
"public function deleteRevision()\n {\n // Ajax only controller\n if (!Request::ajax()) {\n return Response::notFound();\n }\n\n $postID = Input::get('postID');\n $userID = Input::get('userID');\n if ($postID > 0 && Mrcore::user()->isAuthenticated()) {\n $post = Post::find($postID);\n if (isset($post)) {\n if ($userID > 0) {\n // Delete the only one by post and user\n if ($post->hasPermission('write')) {\n $revision = Revision::where('post_id', '=', $postID)\n ->where('created_by', '=', $userID)\n ->where('revision', '=', 0)\n ->first();\n if (isset($revision)) {\n $revision->delete();\n }\n } else {\n return Response::notFound();\n }\n } else {\n // Delete all by post\n if ($post->hasPermission('write')) {\n $revisions = Revision::where('post_id', '=', $postID)\n ->where('revision', '=', 0)\n ->get();\n if (isset($revisions)) {\n foreach ($revisions as $revision) {\n $revision->delete();\n }\n }\n } else {\n return Response::notFound();\n }\n }\n } else {\n return Response::notFound();\n }\n } else {\n return Response::notFound();\n }\n }",
"public function deleteRevista($id){\n\t \t$mysqli = DataBase::connex();\n\t\t$query = '\n\t\t\tDELETE FROM \n\t\t\t\trevistas \n\t\t\tWHERE \n\t\t\t\trevistas.id = '.$id.'\n\t\t\tLIMIT\n\t\t\t\t1\n\t\t';\n\t\t$mysqli->query($query);\n\t\t$mysqli->close();\n\t}",
"public function performDeletion() {\n $this->controller->deleteRevision($this->revision);\n }",
"function delete_review($rev_id){\r\n\t\tglobal $wpdb;\r\n\t\t$sql = \"DELETE FROM $this->reviews_tbl WHERE `rev_id`=$rev_id LIMIT 1\";\r\n\t\t$wpdb->query($sql);\r\n\t}",
"public function deleteJournalEntry($recid) {\n\t\t$sql = \"UPDATE journal SET deleted = 1 WHERE recid = $recid\";\n\t\treturn($this->mysqli->query($sql));\n\t}",
"public static function delete($versionid) {\n global $DB;\n\n $version = static::get_policy_version($versionid);\n if (!self::can_delete_version($version)) {\n // Current version can not be deleted.\n return;\n }\n\n $DB->delete_records('tool_policy_versions', ['id' => $versionid]);\n\n if (!$DB->record_exists('tool_policy_versions', ['policyid' => $version->policyid])) {\n // This is a single version in a policy. Delete the policy.\n $DB->delete_records('tool_policy', ['id' => $version->policyid]);\n }\n }",
"public function get_revision($revision_id);",
"public function deletePage($id, $version) {}",
"function textblock_delete_revision($revision, $curr)\n{\n if ($curr == false) {\n $name = $revision['name'];\n $timestamp = $revision['timestamp'];\n $query = \"DELETE FROM `ia_textblock_revision`\n WHERE `name` = \".db_quote($name).\" &&\n `timestamp` = \".db_quote($timestamp);\n db_query($query);\n } else {\n $name = $revision['name'];\n $query = \"REPLACE INTO `ia_textblock`\n (SELECT * FROM `ia_textblock_revision`\n WHERE `name` = \".db_quote($name).\"\n ORDER BY `timestamp` DESC LIMIT 1)\";\n db_query($query);\n\n //delete last_rev from ia_textblock_revision\n $query = \"DELETE FROM `ia_textblock_revision`\n WHERE `name` = \".db_quote($name).\"\n ORDER BY `timestamp` DESC LIMIT 1\";\n db_query($query);\n }\n}",
"public function delete($id)\n {\n $query=\"DELETE FROM l_event_release WHERE id=\".$id;\n\n $this->executeQuery($query);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ Return the HTML for a div containing a label, a combo box and a 'go' button. | function comboBoxHtml($label, $map, $selectedRowValue, $size=1) {
$html = "<div class='combobox'><span class='combo-label'>$label:</span> ";
$html .= "<select id='$label' name='$label' size='$size'>";
foreach ($map as $id => $name) {
if ($id === intval($selectedRowValue)) {
$selected = 'selected';
} else {
$selected = '';
}
$html .= "<option value='$id' $selected>$name</option>\n";
}
$html .= "</select>\n";
$html .= "<input type='submit' name='$label-submit' value='Go'>\n";
$html .= "</div>";
return $html;
} | [
"function rcw_buttontext_menu()\r\n{\r\n \techo '<label>Button Text:<select name=\"rcw_buttontext\">\r\n <option value=\"Buy Now\">Buy Now</option>\r\n <option value=\"Checkout\">Checkout</option>\r\n <option value=\"Add To Basket\">Add To Basket</option>\r\n <option value=\"Add To Cart\">Add To Cart</option>\r\n <option value=\"Add To Shopping Cart\">Add To Shopping Cart</option>\r\n <option value=\"Add To Shopping Basket\">Add To Shopping Basket</option>\r\n </select></label>';\r\n}",
"public function GetControlHtml() {\n\t\t$strHtml = '';\n\t\tif ($this->HasDataBinder()) {\n\t\t\t$this->CallDataBinder();\n\t\t}\n\t\t$strHtml = $this->RenderNav();\n\t\t$strHtml .= $this->RenderPanels();\n\n\t\tif ($this->HasDataBinder()) {\n\t\t\t$this->RemoveAllItems();\n\t\t}\n\n\t\treturn $strHtml;\n\t}",
"protected function getControlHtml()\n {\n $attrOverride = array('type' => 'checkbox', 'name' => $this->strControlId, 'value' => 'true');\n return $this->renderButton($attrOverride);\n }",
"public function getOptionsAsHTML()\n {\n global $interface;\n \n if (isset($_GET['next_query_field']) && !empty($_GET['next_query_field'])) {\n $interface->assign('next_query_field', $_GET['next_query_field']);\n $interface->assign(\n 'next_facet_field',\n isset($_GET['next_facet_field']) ? $_GET['next_facet_field'] : null\n );\n $interface->assign(\n 'next_target',\n isset($_GET['next_target']) ? $_GET['next_target'] : null\n );\n }\n $this->output($this->_processSearch('Browse/options.tpl'), JSON::STATUS_OK);\n }",
"public function render_content() {\n\t\tif ( empty( $this->choices ) ) {\n\t\t\treturn;\n\t\t}\n\t\t?>\n\t\t<label>\n\t\t\t<?php if ( ! empty( $this->label ) ) : ?>\n\t\t\t<span class=\"customize-control-title\"><?php echo esc_html( $this->label ); ?></span>\n\t\t\t<?php endif; ?>\n\n\t\t\t<?php if ( ! empty( $this->description ) ) : ?>\n\t\t\t<span class=\"description customize-control-description\"><?php echo $this->description; ?></span>\n\t\t\t<?php endif; ?>\n\n\t\t\t<select <?php $this->link(); ?>>\n\t\t\t\t<?php\n\t\t\t\tforeach ( $this->choices as $value => $label ) :\n\t\t\t\t\techo '<option value=\"' . esc_attr( $value ) . '\"' . selected( $this->value(), $value, false ) . '>' . $label . '</option>';\n\t\t\t\tendforeach;\n\t\t\t\t?>\n\t\t\t</select>\n\t\t</label>\n\t\t<?php\n\t}",
"public function controlsHtml()\n {\n $htmlControls = <<<EOD\n <div class=\"game-control\">\n <a class=\"game-button\" href=\"?action=roll\">Slå tärning</a>\n <a class=\"game-button\" href=\"?action=endround\">Säkra potten</a>\n <a class=\"game-button\" href=\"?action=restartgame\">Starta om spelet</a>\n </div>\nEOD;\n return $htmlControls;\n }",
"function ua_injector_render_admin_tracking_option($checkboxOpt, $category, $categoryOpt, $label, $defaultCategory) {\n echo \"<div class='uaOption'>\".\n \"<div class='trackBox'><input class='cBox' name='\".$checkboxOpt.\"' type='checkbox' id='\".$checkboxOpt.\"' \".ua_injector_get_checked(get_option($checkboxOpt)).\" /> <span class='checkboxLabel'>\".$label.\"</span></div>\".\n \"<span class='label \".ua_injector_is_disabled(get_option($checkboxOpt)).\"'>\".__('Custom label:', 'ua-injector').\"</span>\".\n \"<input type='text' name='\".$category.\"' id='\".$category.\"' value='\".$categoryOpt.\"' class='\".ua_injector_is_disabled(get_option($checkboxOpt)).\"' \".ua_injector_is_disabled(get_option($checkboxOpt)).\" />\".\n \"<span class='categoryText \". ua_injector_is_disabled(get_option($checkboxOpt)).\"'>\".$defaultCategory.\"</span>\".\n \"</div>\";\n}",
"private function renderContentChooseBlock()\n\t{\n\t\t$header = Html::tag('div', $this->renderChooseHeader(), ['class' => $this->cssChooseBlockContentHeader]);\n\t\t$autocomplete = Html::tag('div', $this->renderAutocomplete(), ['class' => $this->cssChooseBlockContentAutoComplete]);\n\t\t$locations = Html::tag('div', $this->renderSubmitButton(), ['class' => $this->cssChooseBlockContentButton]);\n\t\t$html = $header . $autocomplete . $locations;\n\n\t\treturn Html::tag('div', $html, ['class' => $this->cssChooseBlockContentWrapper]);\n\t}",
"public function get_option_label_html(){\n\t\t$html = \"\";\n\t\t$classes = $this->get_label_html_classes();\n\t\t$required = $this->required ? \"*\" : \"\";\n\t\t$html .= \"<label class='$classes' for='{$this->id}'>{$this->label}{$required}</label>\";\n\t\treturn $html;\n\t}",
"public function generate_html() {\n\n\t\t// start HTML\n\t\t$html = \"\";\n\t\tif (isset($this->tooltip)) $html .= \"<div onmouseover=\\\"openToolTip('{$this->tooltip}');\\\" onmouseout=\\\"closeToolTip();\\\">\";\n\t\t\n\t\t// IDs are extended with a sequential integer in radio groups\n\t\t$i = 0;\n\t\t\n\t\tforeach ($this->options as $optval => $optlab) {\n\t\t\t$html .= \"<input type=\\\"radio\\\" name=\\\"{$this->name}\\\" id=\\\"{$this->id}_{$i}\\\" value=\\\"{$optval}\\\"\";\n\t\t\tif (!isset($this->selected) && $i == 0) $html .= \" checked\";\n\t\t\tif (isset($this->selected) && $optval == $this->selected) $html .= \" checked\";\n\t\t\t$html .= \" /> <label for=\\\"{$this->id}_{$i}\\\">{$optlab}</label> \";\n\t\t\tif (!$this->inline) $html .= \"<br/>\";\n\t\t\t$i++;\n\t\t}\n\t\t\n\t\t// trim and complete HTML\n\t\tif (!$this->inline) $html = substr($html,0,-5);\n\t\tif (isset($this->tooltip)) $html .= \"</div>\";\n\t\t\n\t\treturn $html;\n\t\t\n\t}",
"private function getFieldsAsHtml(){\n $html = \"\";\n\n foreach($this->fields as $key =>$element){\n $label = new HtmlTag(\"label\", [], ucfirst($key) );\n $div = new HtmlTag(\"div\", [], $label . $element);\n $html .= $div;\n }\n\n // Ajout du bouton valider\n $button = new HtmlTag(\"button\", [\"type\"=>\"submit\"], \"Valider\");\n $html .= $button;\n\n return $html;\n }",
"function render_dropdown_question($label, $inputname, $options = array(), $current=\"\", $extra=\"\", array $ctx = array())\n {\n $div_class = array(\"Question\");\n if(isset($ctx[\"div_class\"]) && is_array($ctx[\"div_class\"]) && !empty($ctx[\"div_class\"]))\n {\n $div_class = array_merge($div_class, $ctx[\"div_class\"]);\n }\n $input_class = isset($ctx[\"input_class\"]) ? $ctx[\"input_class\"] : \"stdwidth\";\n\n $onchange = (isset($ctx[\"onchange\"]) && trim($ctx[\"onchange\"]) != \"\" ? trim($ctx[\"onchange\"]) : \"\");\n $onchange = ($onchange != \"\" ? sprintf(\"onchange=\\\"%s\\\"\", $onchange) : \"\");\n\n $extra .= \" {$onchange}\";\n\t?>\n\t<div class=\"<?php echo implode(\" \", $div_class); ?>\">\n\t\t<label><?php echo $label; ?></label>\n\t\t<select name=\"<?php echo $inputname ?>\" class=\"<?php echo $input_class ?>\" id=\"<?php echo $inputname?>\" <?php echo $extra; ?>>\n\t\t<?php\n\t\tforeach ($options as $optionvalue=>$optiontext)\n\t\t\t{\n\t\t\t?>\n\t\t\t<option value=\"<?php echo htmlspecialchars(trim($optionvalue))?>\" <?php if (trim($optionvalue)==trim($current)) {?>selected<?php } ?>><?php echo htmlspecialchars(trim($optiontext))?></option>\n\t\t\t<?php\n\t\t\t}\n\t\t?>\n\t\t</select>\n <div class=\"clearerleft\"></div>\n </div>\n <?php\n return;\n }",
"function popup_form ($common, $options, $formname, $selected=\"\", $nothing=\"choose\", $help=\"\", $helptext=\"\", $return=false, $targetwindow=\"self\") {\n/// $common = the URL up to the point of the variable that changes\n/// $options = A list of value-label pairs for the popup list\n/// $formname = name must be unique on the page\n/// $selected = the option that is already selected\n/// $nothing = The label for the \"no choice\" option\n/// $help = The name of a help page if help is required\n/// $helptext = The name of the label for the help button\n/// $return = Boolean indicating whether the function should return the text\n/// as a string or echo it directly to the page being rendered\n\n global $CFG;\n\n if ($nothing == \"choose\") {\n $nothing = get_string(\"choose\").\"...\";\n }\n\n $startoutput = \"<form target=\\\"{$CFG->framename}\\\" name=$formname>\";\n $output = \"<select name=popup onchange=\\\"$targetwindow.location=document.$formname.popup.options[document.$formname.popup.selectedIndex].value\\\">\\n\";\n\n if ($nothing != \"\") {\n $output .= \" <option value=\\\"javascript:void(0)\\\">$nothing</option>\\n\";\n }\n\n foreach ($options as $value => $label) {\n if (substr($label,0,1) == \"-\") {\n $output .= \" <option value=\\\"\\\"\";\n } else {\n $output .= \" <option value=\\\"$common$value\\\"\";\n if ($value == $selected) {\n $output .= \" selected\";\n }\n }\n if ($label) {\n $output .= \">$label</option>\\n\";\n } else {\n $output .= \">$value</option>\\n\";\n }\n }\n $output .= \"</select>\";\n $output .= \"</form>\\n\";\n\n if ($return) {\n return $startoutput.$output;\n } else {\n echo $startoutput;\n if ($help) {\n helpbutton($help, $helptext);\n }\n echo $output;\n }\n}",
"public function getBrowseButtonHtml()\n {\n return $this->getChildHtml('browse_button');\n }",
"protected function getControlHtml()\n {\n return parent::renderTag('span'); // render invisible tag so we get a control id in javascript to attach events to\n }",
"function getButton(){\r\n\t\treturn '';\r\n\t\treturn '<div style=\"width: 45px; height:18px; border:1px ridge #000000; margin:0; ' .\r\n\t\t\t\t'background-color:#' .$this->get(). '; '.\r\n\t\t\t\t'padding:0; float:left;\" ' .\r\n\t\t\t\t'onClick=\"showColorPicker(this,document.forms[0].rgb2)\"' .\r\n\t\t\t\t'>Change</div>';\r\n\t}",
"function div_form_button($name,$button_label)\n{\n print(\"<button type=\\\"submit\\\" name=\\\"$name\\\" value=\\\"$button_label\\\" class=\\\"btn btn-default update\\\">$button_label</button>\\r\\n\");\n}",
"function writeSelectBox ($curr_el) {\n\t\t\techo \"<tr><td width=\\\"30%\\\" align=\\\"right\\\" valign=\\\"top\\\" class=\\\"formLabel\\\">\" . $curr_el->label . \": </td><td>\";\n\t\t\tif ($curr_el->multiple)\n\t\t\t\techo \"<select name=\\\"\" . $curr_el->name . \"[]\\\" multiple style=\\\"width: 230px;\\\">\";\n\t\t\telse\n\t\t\t\techo \"<select name=\\\"\" . $curr_el->name . \"\\\">\";\n\t\t\tif ($curr_el->query != \"\") {\n\t\t\t\tif (!$curr_el->multiple)\n\t\t\t\t\techo \"<option value=\\\"-1\\\"></option>\";\n\t\t\t\t$rs = mysql_query ($curr_el->query) or die (\"ERROR: \" . mysql_error());\n\t\t\t\twhile ($row = mysql_fetch_array ($rs)) {\n\t\t\t\t\techo \"<option value=\\\"\" . $row[$curr_el->valueColumn] . \"\\\" \";\n\t\t\t\t\tif (is_array ($curr_el->value) && is_numeric (array_search($row[$curr_el->valueColumn], $curr_el->value)))\n\t\t\t\t\t\techo \"selected>\";\n\t\t\t\t\telse if (!is_array($curr_el->value) && $row[$curr_el->valueColumn] == $curr_el->value)\n\t\t\t\t\t\techo \"selected>\";\n\t\t\t\t\telse\n\t\t\t\t\t\techo \">\";\n\t\t\t\t\tfor ($j=0; $j<count($curr_el->displayColumns); $j++) {\n\t\t\t\t\t\techo $row[$curr_el->displayColumns[$j]];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\techo \"</select>\";\n\t\t\tif ($curr_el->instructions != \"\")\n\t\t\t\techo \"<br><span class=\\\"forminstructions\\\">\" . $curr_el->instructions . \"</span>\";\n\t\t\techo \"</td></tr>\";\n\t\t}",
"function fr_dropdown_comics(){\n\t\t\techo '<div class=\"selector\" onclick=\"toggleMenu(this)\">manga: '.fr_selected_comic();\n\t\t\techo '<div class=\"options\">';\n \tforeach(fr_available_comics() as $key=>$value){\n \t\techo \"<a title='\".$value.\"' href='\".fr_get_href($value).\"'><div class='option'>$value</div></a>\";\n \t}\n \techo '</div></div>';\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create an instance of the Conductor_Query_Builder_Admin_Views class. | function Conduct_Query_Builder_Admin_Views() {
return Conductor_Query_Builder_Admin_Views::instance();
} | [
"function viewBuilder()\n {\n return app('viewBuilder');\n }",
"private static function viewsInstance()\n\t{\n\t\treturn View_MD::getInstance();\n\t}",
"public function views() {}",
"public function createView ()\n {\n }",
"public function setBuilder(ViewBuilder $builder): View;",
"protected function getBasicView() {\n // Create the basic view.\n $view = new View(array(), 'view');\n $view->name = 'test_view';\n $view->add_display('default');\n $view->base_table = 'views_test';\n\n // Set up the fields we need.\n $display = $view->new_display('default', 'Master', 'default');\n $display->override_option('fields', array(\n 'id' => array(\n 'id' => 'id',\n 'table' => 'views_test',\n 'field' => 'id',\n 'relationship' => 'none',\n ),\n 'name' => array(\n 'id' => 'name',\n 'table' => 'views_test',\n 'field' => 'name',\n 'relationship' => 'none',\n ),\n 'age' => array(\n 'id' => 'age',\n 'table' => 'views_test',\n 'field' => 'age',\n 'relationship' => 'none',\n ),\n ));\n\n // Set up the sort order.\n $display->override_option('sorts', array(\n 'id' => array(\n 'order' => 'ASC',\n 'id' => 'id',\n 'table' => 'views_test',\n 'field' => 'id',\n 'relationship' => 'none',\n ),\n ));\n\n return $view;\n }",
"protected function makeEditView() {\n\t\t$vg = new ViewEditGenerator($this->files, $this->command);\n\t\t$vg->generate($this->name, $this->schema);\n\t}",
"public function initView()\n\t{\n\t\t$this->view = new Opt_View;\n\t}",
"public function materializedViews() {}",
"public function view()\n {\n if (is_string($this->viewPlugin) && class_exists($this->viewPlugin) && is_object($this->view)) {\n $this->view->instance = $this->factory($this->viewPlugin);\n // Shorter version for direct plugin access.\n $this->views =& $this->view->instance;\n }\n }",
"public function views();",
"protected function makeCreateView() {\n\t\t$vg = new ViewCreateGenerator($this->files, $this->command);\n\t\t$vg->generate($this->name, $this->schema);\n\t}",
"function create_views () {\n\t\t$form_fields = '';\n\n\t\tforeach ($this->columns as $name => $type) {\n\t\t\t// set form fields for create/update\n\t\t\tif ($type != 'ai') {\n\t\t\t\t$form_fields .= '\t\t\t<div class=\"form-group\">'.PHP_EOL;\n\t\t\t\t$form_fields .= '\t\t\t\t<label for=\"'.$name.'\" class=\"control-label\">'.ucfirst(str_replace('_', ' ', $name)).'</label>'.PHP_EOL;\n\t\t\t}\n\t\t\t\n\t\t\tif ($type == 'int') {\n\t\t\t\t$form_fields .= '\t\t\t\t<input name=\"'.$name.'\" id=\"'.$name.'\" type=\"number\" class=\"form-control\" value=\"<?php echo $this->sanitize($this->model->'.$name.'); ?>\">'.PHP_EOL;\n\t\t\t}\n\t\t\telse if ($type == 'varchar') {\n\t\t\t\t$form_fields .= '\t\t\t\t<input name=\"'.$name.'\" id=\"'.$name.'\" type=\"text\" class=\"form-control\" value=\"<?php echo $this->sanitize($this->model->'.$name.'); ?>\">'.PHP_EOL;\n\t\t\t}\n\t\t\telse if ($type == 'text') {\n\t\t\t\t$form_fields .= '\t\t\t\t<textarea name=\"'.$name.'\" id=\"'.$name.'\" rows=\"5\" class=\"form-control\"><?php echo $this->sanitize($this->model->'.$name.'); ?></textarea>'.PHP_EOL;\n\t\t\t}\n\n\t\t\tif ($type != 'ai') {\n\t\t\t\t$form_fields .= '\t\t\t</div>'.PHP_EOL;\n\t\t\t}\n\t\t}\n\n\t\t// create & update\n\t\t$actions = ['create', 'update'];\n\t\tforeach ($actions as $action) {\n\t\t\t$file_content = file_get_contents('generator/generated_object_'.$action.'.php');\n\t\t\t$file_content = $this->replace_names($file_content);\n\t\t\t$file_content = str_replace('\t\t\t<!-- generator form fields -->', rtrim($form_fields, PHP_EOL), $file_content);\n\t\t\tfile_put_contents('app/views/'.$this->name['variable'].'_'.$action.'.php', $file_content);\n\n\t\t}\n\t\t\n\t\t// index\n\t\t$file_content = file_get_contents('generator/generated_object_index.php');\n\t\t$file_content = $this->replace_names($file_content);\n\t\t$content = '';\n\t\tforeach ($this->columns as $name => $type) {\n\t\t\tif ($name == 'id') {\n\t\t\t\t$th = 'ID';\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$th = ucfirst(str_replace('_', ' ', $name));\n\t\t\t}\n\n\t\t\t$content .= '\t\t\t\t\t<th>'.$th.'</th>'.PHP_EOL;\n\t\t}\n\t\t$file_content = str_replace('\t\t\t\t\t<!-- generator table headings -->', rtrim($content, PHP_EOL), $file_content);\n\t\tfile_put_contents('app/views/'.$this->name['variable'].'_index.php', $file_content);\n\n\t\t// datatable\n\t\t$file_content = file_get_contents('generator/generated_object_datatable.php');\n\t\t$file_content = $this->replace_names($file_content);\n\t\t$content = '';\n\t\tforeach ($this->columns as $name => $type) {\n\t\t\t$content .= '\t\t$row[\\''.$name.'\\'],'.PHP_EOL;\n\t\t}\n\t\t$file_content = str_replace('\t\t// generator datatable columns', rtrim($content, PHP_EOL), $file_content);\n\t\tfile_put_contents('app/views/'.$this->name['variable'].'_datatable.php', $file_content);\n\t}",
"public function createView() {\n\t\t$tableView = new TableView($this, $this->tableType, $this->options, $this->columns);\n\t\t$this->buildView($tableView, $this->tableType);\n\t\t$tableView->vars['dom_based'] = true;\n\t\treturn $tableView;\n\t}",
"public function index()\n {\n $view = new View();\n $view->renderAdmin('admin_view.php', 'admin_view.php');\n }",
"public function getView()\n\t{\n\t\treturn new $this->_viewClass;\n\t}",
"function getViews() {\n return mysql_query(sprintf('SELECT TABLE_NAME, VIEW_DEFINITION FROM information_schema.views WHERE TABLE_SCHEMA=\\'%s\\'', $this->config[\"database\"]));\n }",
"public function materializedViews();",
"function CreateFormView() {\n\t\tif(! $this->m_formView){\n\n\t\t\t$lViewMetadata = $this->m_pubdata;\n\n\t\t\t$lViewMetadata = array_merge($lViewMetadata, array(\n\t\t\t\t'name_in_viewobject' => $this->m_nameInViewObject,\n\t\t\t\t'fields_metadata' => $this->m_fieldsMetadata,\n\t\t\t\t'err_cnt' => $this->m_errCnt,\n\t\t\t\t'global_errors' => $this->m_globalErrors,\n\t\t\t\t'fields_errors' => $this->m_fieldErrors,\n\t\t\t\t'fields_values' => $this->m_fieldsValues,\n\t\t\t\t'form_name' => $this->m_formName,\n\t\t\t\t'form_method' => $this->m_formMethod,\n\t\t\t\t'use_captcha' => $this->m_useCaptcha,\n\t\t\t\t'add_back_url' => $this->AddBackUrl(),\n\t\t\t\t'js_validation' => (int)$this->m_jsValidation,\n\t\t\t\t'check_field' => $this->m_checkField,\n\t\t\t\t'fields_templ_name' => $this->m_formFieldsTemplName,\n\t\t\t));\n\n\t\t\t$this->m_formView = new evForm_View($lViewMetadata);\n\t\t}\n\t\treturn $this->m_formView;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function generate the sql for all attributes of a layer in mysql | function generate_layer_attributes($schema, $table, $table_attributes) {
foreach ($table_attributes AS $table_attribute) {
$sql .= $this->generate_layer_attribute($schema, $table, $table_attribute);
if ($table_attribute['type_type'] == 'c') {
$sql .= $this->generate_datatype($schema, $table_attribute);
}
}
return $sql;
} | [
"public function getAttributesDdlSql(){\n $padding = $this->getPadding();\n $eol = $this->getEol();\n $content = '';\n $content .= $this->getParentEntitiesFkAttributes($padding, true);\n if ($this->getIsFlat()){\n foreach ($this->getAttributes() as $attribute){\n $content .= $padding.$attribute->getDdlSqlColumn().$eol;\n }\n }\n if ($this->getIsFlat()) {\n $simulated = $this->getSimulatedAttributes(null, false);\n }\n elseif ($this->getIsTree()) {\n $simulated = $this->getSimulatedAttributes('tree', false);\n }\n else {\n $simulated = array();\n }\n foreach ($simulated as $attr){\n $content .= $padding.$attr->getDdlSqlColumn().$eol;\n }\n return substr($content,0, strlen($content) - strlen($eol));\n }",
"function generate_layer_attribute($schema, $table, $table_attribute) {\n\t\t$this->debug->write(\"<p>generate_layer_attribute: {$table_attribute}\", 4);\n\t\tif ($table_attribute['type_type'] == 'e')\n\t\t\t$enum_options = $this->pgdatabase->get_enum_options($schema, $table_attribute);\n\t\telse\n\t\t\t$enum_options = array('option' => '', 'constraint' => '');\n\n\t\t$sql .= $this->database->generate_layer_attribute($table_attribute, $table, $enum_options);\n\t\treturn $sql;\n\t}",
"public function get_sql();",
"function generate_sql()\n\t{\n\t\tlog_debug(\"sql_query\", \"Executing generate_sql()\");\n\n\t\t$this->string = \"SELECT \";\n\n\n\t\t// add all select fields\n\t\t$num_values = count($this->sql_structure[\"fields\"]);\n\n\t\tfor ($i=0; $i < $num_values; $i++)\n\t\t{\n\t\t\t$fieldname = $this->sql_structure[\"fields\"][$i];\n\n\t\t\tif (isset($this->sql_structure[\"field_dbnames\"][$fieldname]))\n\t\t\t{\n\t\t\t\t$this->string .= $this->sql_structure[\"field_dbnames\"][$fieldname] .\" as \";\n\t\t\t}\n\t\t\t\n\t\t\t$this->string .= $fieldname;\n\t\t\t\n\n\t\t\tif ($i < ($num_values - 1))\n\t\t\t{\n\t\t\t\t$this->string .= \", \";\n\t\t\t}\n\t\t}\n\n\t\t$this->string .= \" \";\n\n\n\t\t// add database query\n\t\t$this->string .= \"FROM `\". $this->sql_structure[\"tablename\"] .\"` \";\n\n\t\t// add all joins\n\t\tif (isset($this->sql_structure[\"joins\"]))\n\t\t{\n\t\t\tforeach ($this->sql_structure[\"joins\"] as $sql_join)\n\t\t\t{\n\t\t\t\t$this->string .= $sql_join .\" \";\n\t\t\t}\n\t\t}\n\n\n\t\t// add WHERE queries\n\t\tif (isset($this->sql_structure[\"where\"]))\n\t\t{\n\t\t\t$this->string .= \"WHERE \";\n\t\t\n\t\t\t$num_values = count($this->sql_structure[\"where\"]);\n\t\n\t\t\tfor ($i=0; $i < $num_values; $i++)\n\t\t\t{\n\t\t\t\t$this->string .= $this->sql_structure[\"where\"][$i] . \" \";\n\n\t\t\t\tif ($i < ($num_values - 1))\n\t\t\t\t{\n\t\t\t\t\t$this->string .= \"AND \";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// add groupby rules\n\t\tif (isset($this->sql_structure[\"groupby\"]))\n\t\t{\n\t\t\t$this->string .= \"GROUP BY \";\n\t\t\t\n\t\t\t$num_values = count($this->sql_structure[\"groupby\"]);\n\t\n\t\t\tfor ($i=0; $i < $num_values; $i++)\n\t\t\t{\n\t\t\t\t$this->string .= $this->sql_structure[\"groupby\"][$i] . \" \";\n\n\t\t\t\tif ($i < ($num_values - 1))\n\t\t\t\t{\n\t\t\t\t\t$this->string .= \", \";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\n\t\t// add orderby rules\n\t\tif (isset($this->sql_structure[\"orderby\"]))\n\t\t{\n\t\t\t$this->string .= \"ORDER BY \";\n\t\t\n\t\t\n\t\t\t// run through all the order by fields\n\t\t\t$num_values = count($this->sql_structure[\"orderby\"]);\n\n\t\t\tfor ($i=0; $i < $num_values; $i++)\n\t\t\t{\n\t\t\t\t// fieldname\n\t\t\t\t$this->string .= $this->sql_structure[\"orderby\"][$i][\"fieldname\"];\n\t\t\t\n\t\t\t\t// sort method\n\t\t\t\tif ($this->sql_structure[\"orderby\"][$i][\"type\"] == \"asc\")\n\t\t\t\t{\n\t\t\t\t\t$this->string .= \" ASC \";\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$this->string .= \" DESC \";\n\t\t\t\t}\n\n\t\t\t\t// add joiner\n\t\t\t\tif ($i < ($num_values - 1))\n\t\t\t\t{\n\t\t\t\t\t$this->string .= \", \";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\n\n\t\t// add limit (if any)\n\t\tif (isset($this->sql_structure[\"limit\"]))\n\t\t{\n\t\t\t$this->string .= \" LIMIT \". $this->sql_structure[\"limit\"];\n\t\t}\n\t\t\n\t\treturn 1;\n\t}",
"public abstract function getSql();",
"function get_layer_attributes(){\n\t\t$sql_str = \"SELECT \"\n\t\t\t\t\t. \"tng_spatial_layer.layer_name, \"\n\t\t\t\t\t. \"tng_spatial_attribute_table.view_name, \"\n\t\t\t\t\t. \"tng_spatial_data.pk_col_name, \"\n\t\t\t\t\t. \"tng_spatial_data.geometry_type, \"\n\t\t\t\t\t. \"tng_spatial_layer.proj_string, \"\n\t\t\t\t\t. \"tng_spatial_attribute.attr_name \"\n\t\t\t\t. \"FROM \"\n\t\t\t\t\t. \"tng_spatial_layer \"\n\t\t\t\t\t. \"INNER JOIN tng_spatial_attribute_table \" \n\t\t\t\t\t\t\t\t\t. \"ON tng_spatial_layer.attr_table_id = tng_spatial_attribute_table.attr_table_id \"\n\t\t\t\t\t. \"INNER JOIN tng_spatial_data \" \n\t\t\t\t\t\t\t\t\t. \"ON tng_spatial_attribute_table.spatial_table_id = tng_spatial_data.spatial_table_id \"\n\t\t\t\t\t// note last clause is left join\n\t\t\t\t\t// because not all schema may need\n\t\t\t\t\t// CLASSITEMs\n\t\t\t\t\t. \"LEFT JOIN tng_spatial_attribute \"\n\t\t\t\t\t\t\t\t\t. \"ON tng_spatial_attribute_table.ms_classitem_attr_id = tng_spatial_attribute.attr_id \" \n\t\t\t\t. \"WHERE \"\n\t\t\t\t\t. \"tng_spatial_layer.layer_id = \" . $this->layer_id;\n\t\t\n\t\t$this->dbconn->connect();\n\t\t\t\t\n\t\t$result = pg_query($this->dbconn->conn, $sql_str);\n\t\t\n\t\tif(!$result){\n\t\t\techo \"An error occurred while executing the query - \" . $sql_str .\" - \" . pg_last_error($this->dbconn->conn);\n\t\t\t$this->dbconn->disconnect();\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t// successfuly ran the query\n\t\t// store layer attributes\n\t\t$this->layer_name = pg_fetch_result($result, 0, 0);\n\t\t$this->view_name = pg_fetch_result($result, 0, 1);\n\t\t$this->geom_pk_col_name = pg_fetch_result($result, 0, 2);\n\t\t$this->geom_type = pg_fetch_result($result, 0, 3);\n\t\t$this->layer_proj= pg_fetch_result($result, 0, 4);\n\t\t$this->layer_ms_classitem = strtolower(pg_fetch_result($result, 0, 'attr_name'));\n\t\t\n\t\t$this->dbconn->disconnect();\n\t\t\n\t\treturn true;\n\t}",
"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}",
"function tree2sql() {\n\t\t$table = $this->packageInfo['table'];\n\t\twhile(list($tableNum,$tableData) = @each($table)) {\n\t\t\tunset($sql);\n\t\t\t$cols = $tableData['column'];\n\t\t\t$thistablename = $tableData['attributes']['name'];\n\t\t\twhile(list($colNum,$col) = @each($cols)) {\n\t\t\t\t$_string = \"\";\n\t\t\t\t$len = \"\";\n\t\t\t\textract($col);\n\t\t\t\t$_string .= \"$field $type \";\n\t\t\t\tif ($len) { $_string .= \"($len) \"; }\n\t\t\t\tif ($null) { $_string .=\" NULL \"; } else { $_string .= \" NOT NULL \"; }\n\t\t\t\t$_string .= \" default '$default' \";\n\t\t\t\tif ($extra) { $_string .= \" $extra \"; }\n\t\t\t\t$sql[] = $_string;\n\t\t\t}\n\t\t\t$idx = $tableData['indexes'];\n\t\t\t$col = \"\";\n\t\t\twhile(list($num,$indx) = @each($idx)) {\n\t\t\t\twhile(list($numpos,$cols) = each($indx['index'])) {\n\t\t\t\t\textract($indx['attributes'][$numpos]);\n\t\t\t\t\t$col[$name]= @implode(\",\",$cols['columns']);\n\t\t\t\t}\n\t\t\t}\n\t\t\t$sqlindex = \"\";\n\t\t\t$sqlindexes = \"\";\n\t\t\twhile(list($key,$val) = @each($col)) {\n\t\t\t\tif (strtoupper($key)=='PRIMARY') { $key = \" PRIMARY KEY \"; } else { $key = \" KEY $key \"; }\n\t\t\t\t$sqlindex[] = \"$key ($val)\";\n\t\t\t}\n\t\t\t$sqlindexes = @implode(\",\",$sqlindex);\n\t\t\tif ($sqlindexes) { $sqlindexes =\" , $sqlindexes\"; }\n\t\t\t$finalsql[] = \"drop table if exists $thistablename\";\n\t\t\t$finalsql[] = \" create table $thistablename ( \".@implode(\",\",$sql).\" $sqlindexes ) \";\n\n\t\t\t$rows = $tableData['data'][$tableNum]['row'];\n\t\t\twhile(list($rownum,$rowdata) = @each($rows)) { \n\t\t\t\t$keys = \"\";\n\t\t\t\t$vals = \"\";\n\t\t\t\twhile(list($k,$v) = each($rowdata)) { \n\t\t\t\t\t$keys[]=$k;\n\t\t\t\t\t$vals[]=$v;\n\t\t\t\t}\n\t\t\t\t$datasql[] = \"insert into $thistablename (\".implode(\",\",$keys).\") values ('\".implode(\"','\",$vals).\"')\";\n\t\t\t}\n\t\t}\n\t\t$this->datasql = $datasql;\n\t\t$this->sql = $finalsql;\n\t\treturn $finalsql;\n\t}",
"public function sql()\n {\n $sql = $this->sql->append('SELECT ');\n \n if($this->prop->get('distinct'))\n {\n $sql->append('DISTINCT ');\n }\n\n $sql->append($this->prop->get('retrieve'))\n ->append(' FROM ')\n ->append($this->tablename);\n\n if(!$this->join->empty())\n {\n foreach($this->join->get() as $join)\n {\n $sql->append(' ' . strtoupper($join['type']))\n ->append(' JOIN')\n ->append(' ' . $join['tablename'])\n ->append(' ON');\n\n foreach($join['columns'] as $key1 => $key2)\n {\n $sql->append(' ' . $this->tablename . '.' . $key1)\n ->append(' = ' . $join['tablename'] . '.' . $key2)\n ->append(' AND ');\n }\n\n if($sql->endWith(' AND '))\n {\n $sql->move(0, 5);\n }\n }\n }\n\n $where = $this->generateWhere();\n \n if(!is_null($where))\n {\n $sql->append(' WHERE ')->append($where);\n }\n\n if($this->prop->get('order_dir') === 'rand')\n {\n $sql->append(' ORDER BY RAND()');\n }\n else\n {\n if(!is_null($this->prop->get('order_by')))\n {\n $sql->append(' ORDER BY ')\n ->append($this->prop->get('order_by'))\n ->append(' ')\n ->append(strtoupper($this->prop->get('order_dir')));\n }\n }\n\n if(!is_null($this->prop->get('limit_length')))\n {\n $sql->append(' LIMIT ')\n ->append($this->prop->get('limit_start'))\n ->append(', ')\n ->append($this->prop->get('limit_length'));\n }\n\n return $sql->get();\n }",
"private function _add_sql_params(&$str){\n \n // Build Get params for Associated data.\n \n foreach($this->associations as $k => $v){\n\n \t// Build AS clause for each parameter.\n foreach($v as $x => $z){\n $param = explode('_',$x);\n if('id' == $x && $this->model != $k){\n \t$str .= $k.\".\".$x.\" AS \".$k.\"_\".$x.\", \";\n }\n // Determine if key is in lookup table...\n // for simplification of output parameters...\n // ie. expected_tax_code_id ==> taxcode_id\n elseif(!empty($this->lookUp[$x])){\n \t$str .= $k.\".\".$x.\" AS \".$this->lookUp[$x].\", \";\n \t$temp = $this->associations[$k][$x];\n \tunset($this->associations[$k][$x]);\n \t$this->associations[$k][$this->lookUp[$x]] = $z;\n }\n else {\n $str .= $k.\".\".$x.\" AS \".$x.\", \";\n }\n }\n }\n\n return;\n }",
"private static function buildNameParametersSQL() {\n $namedParams = '';\n foreach (static::$tableSchema as $columnName => $type) {\n $namedParams .= $columnName . ' = :' . $columnName . ', ';\n }\n return trim($namedParams, ', ');\n }",
"public function toSql()\n {\n /* fetch by current query */\n $query = $this->_query;\n $sql = $query->build();\n $vars = $query->vars;\n foreach( $vars as $name => $value ) {\n $sql = str_replace( $name, $value, $sql );\n }\n return $sql;\n }",
"public function getStatmentSql()\n {\n $sql = 'SELECT '; \n \n\n if (isset($this->params['select']) && $this->params['select'] && is_array($this->params['select'])) {\n $sql .= $this->getSelectSql($this->params['select']);\n } else {\n $sql .= '*';\n }\n \n $sql .= ' FROM ' . $this->tableName;\n \n\n if (isset($this->params['left join']) && $this->params['left join']) {\n $sql .= $this->getLeftJoinSql($this->params['left join']);\n }\n\n if (isset($this->params['where']) && $this->params['where']) {\n $sql .= $this->getWhereConnditionSql($this->params['where']);\n }\n\n if (isset($this->params['group']) && $this->params['group']) {\n $sql .= $this->getGroupBy($this->params['group']);\n }\n\n if (isset($this->params['order']) && $this->params['order']) {\n $sql .= $this->getOrderSql($this->params['order']);\n }\n\n if (isset($this->params['limit']) && $this->params['limit']){\n $sql .= $this->getLimitSql();\n }\n\n if (isset($this->params['offset']) && $this->params['offset']){\n $sql .= $this->getLimitSql();\n }\n\n return $sql;\n }",
"public function build()\n\t{\n\t\t$tables = BQ . Dao::current()->storeNameOf($this->class_name) . BQ . SP . 't0';\n\t\tforeach ($this->joins->getJoins() as $join) if ($join) {\n\t\t\t$tables .= $join->toSql();\n\t\t}\n\t\treturn $tables;\n\t}",
"public function toSql()\n {\n /* fetch by current query */\n $query = $this->_query;\n $sql = $query->build();\n $vars = $query->vars;\n foreach( $vars as $name => $value ) {\n $sql = preg_replace( \"/$name\\b/\", $value, $sql );\n }\n return $sql;\n }",
"function generateSQL($row) { /* abstract */ }",
"public function sql()\r\n {\r\n return $this->generate();\r\n }",
"public function getUpSQL()\n {\n return array(\n 'propel' => \"\n ALTER TABLE `multimedia` ADD `slug` VARCHAR(128) NOT NULL AFTER `name`;\n ALTER TABLE `multimedia` ADD `position` SMALLINT UNSIGNED DEFAULT 65535 AFTER `is_primary`;\n ALTER TABLE `multimedia` CHANGE `type` `type` ENUM('image','video','pdf') NOT NULL DEFAULT 'image';\n \",\n 'archive' => \"\n ALTER TABLE `multimedia_archive` ADD `slug` VARCHAR(128) NOT NULL AFTER `name`;\n ALTER TABLE `multimedia_archive` ADD `position` SMALLINT UNSIGNED DEFAULT 65535 AFTER `is_primary`;\n ALTER TABLE `multimedia_archive` CHANGE `type` `type` ENUM('image','video','pdf') NOT NULL DEFAULT 'image';\n \"\n );\n }",
"public function getStatementSQL();"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns a list of all new posts that have not been mailed yet | protected function get_unmailed_posts($starttime, $endtime, $now = null) {
global $CFG, $DB;
$params = array();
$params['mailed'] = FORUM_MAILED_PENDING;
$params['ptimestart'] = $starttime;
$params['ptimeend'] = $endtime;
$params['mailnow'] = 1;
if (!empty($CFG->forum_enabletimedposts)) {
if (empty($now)) {
$now = time();
}
$selectsql = "AND (p.created >= :ptimestart OR d.timestart >= :pptimestart)";
$params['pptimestart'] = $starttime;
$timedsql = "AND (d.timestart < :dtimestart AND (d.timeend = 0 OR d.timeend > :dtimeend))";
$params['dtimestart'] = $now;
$params['dtimeend'] = $now;
} else {
$timedsql = "";
$selectsql = "AND p.created >= :ptimestart";
}
return $DB->get_records_sql(
"SELECT
p.id,
p.discussion,
d.forum,
d.course,
p.created,
p.parent,
p.userid
FROM {forum_posts} p
JOIN {forum_discussions} d ON d.id = p.discussion
WHERE p.mailed = :mailed
$selectsql
AND (p.created < :ptimeend OR p.mailnow = :mailnow)
$timedsql
ORDER BY p.modified ASC",
$params);
} | [
"public function getNewPosts()\n {\n return $this->new_posts;\n }",
"function extendedforum_get_unmailed_posts($starttime, $endtime, $now=null) {\n global $CFG;\n\n if (!empty($CFG->extendedforum_enabletimedposts)) {\n if (empty($now)) {\n $now = time();\n }\n $timedsql = \"AND (d.timestart < $now AND (d.timeend = 0 OR d.timeend > $now))\";\n } else {\n $timedsql = \"\";\n }\n \n \n return get_records_sql(\"SELECT p.*, d.course, d.extendedforum\n FROM {$CFG->prefix}extendedforum_posts p\n JOIN {$CFG->prefix}extendedforum_discussions d ON d.id = p.discussion\n WHERE p.mailed = 0\n AND p.created >= $starttime\n AND (p.created < $endtime OR p.mailnow = 1)\n $timedsql\n ORDER BY p.modified ASC\");\n \n \n \n}",
"public function getPostsNotByFocus()\n {\n $select = $this->select()->where('is_active = ?', 1)->where('in_focus != ?', 1);\n return $this->fetchAll($select);\n }",
"public function removeAllPosts() {}",
"public function testGetUnpostedPosts() {\n // Create\n $ph_fb_page = $this->phactory->create('sm_facebook_page');\n $this->phactory->create( 'sm_posting', array( 'sm_facebook_page_id' => $ph_fb_page->id ) );\n $this->phactory->create( 'sm_posting_posts', array( 'sm_facebook_page_id' => $ph_fb_page->id ) );\n\n // Now get them\n $posts = $this->post->get_unposted_posts();\n $post = current( $posts );\n\n // Assert\n $this->assertContainsOnlyInstancesOf( 'SocialMediaPostingPost', $posts );\n $this->assertEquals( self::POST, $post->post );\n }",
"function schedule_missed_posts() {\n\t$args = array(\n\t\t'numberposts' => - 1,\n\t\t'post_type' => 'post',\n\t\t'post_status' => 'any'\n\t);\n\t$posts = get_posts( $args );\n\t$datetime = new DateTime();\n\t$unixtime = $datetime->getTimestamp();\n\n\tforeach ( $posts as $post ) {\n\t\t$publishtime = strtotime( $post->post_date_gmt );\n\t\tif ( $post->post_status == 'published' AND $publishtime < $unixtime ) {\n\t\t\t$postarr = array(\n\t\t\t\t'ID' => $post->ID,\n\t\t\t\t'post_status' => 'published',\n\t\t\t);\n\t\t\twp_update_post( $postarr );\n\t\t}\n\t}\n}",
"function get_no_post_notification()\n\t\t{\n\t\t\treturn __(\"No posts found.\", 'wpdrs');\n\t\t\t}",
"protected function getUnseenMails()\n {\n return $this->mailbox->searchMailbox('UNSEEN');\n }",
"public function findUnsentMails() {\n\t\t$select = $this->select()->where('sent=?', false);\n\t\treturn $this->fetchAll($select);\n\t}",
"public static function clear_appeared_posts() {\n\t\tself::$appeared_posts = array();\n\t}",
"public function unanswered()\n {\n return $this\n ->builder\n ->groupBy('id')\n ->having('replies_count', '=', 0);\n }",
"public function getRecentPosts()\n\t{\n\t\t$sql = \"SELECT * FROM posts WHERE published = 1 ORDER BY created_at DESC LIMIT 4\";\n\t\treturn $this->findAll($sql, 'obj');\n\t}",
"public function takeSkipPosts()\n {\n return $this->posts->takeSkipPosts();\n\n }",
"protected function unanswered()\n {\n return $this->builder->where('replies_count', 0);\n }",
"public function listUnapprovedAction()\n {\n $postManager = $this->container->get('avro_blog.post_manager');\n\n $posts = $postManager->findBy(array('isApproved' => false));\n\n return array(\n 'posts' => $posts\n );\n }",
"public function getPublishedPosts()\n\t{\n\t\t$sql = \"SELECT * FROM posts WHERE published = 1 ORDER BY created_at DESC LIMIT 6\";\n\t\treturn $this->findAll($sql, 'obj');\n\t}",
"public function removeAllPosts()\n {\n $this->posts = new \\TYPO3\\CMS\\Extbase\\Persistence\\ObjectStorage();\n }",
"public function unpublished()\n {\n return Post::where('published', '=', false)\n ->orderBy('created_at', 'DESC')\n ->get()\n ->toJson();\n }",
"public function get_unseen_discussions() {\n $this->db->select('p._id as pid, p.post_title as title, count(discussions._id) as dcount');\n $this->db->join('posts as p', 'p._id = discussions.post_id', 'inner');\n $this->db->join('accounts as a', 'a._id = p.account_id', 'inner');\n $this->db->group_by('p._id');\n $result = $this->db->get_where(Constant::TABLE_DISCUSSIONS, [\n 'a._id' => $this->posted_user,\n 'discussions.discussed_by != ' => $this->posted_user,\n 'discussions.seen' => 0\n ])->result_array();\n if (!is_null($result) && !empty($result)) {\n return $result;\n } else {\n return NULL;\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the research experience attribute. | public function getResearchExperienceAttribute(); | [
"public function getExperience()\n {\n return $this->experience;\n }",
"public function getExperience()\n {\n return($this->experience);\n }",
"public function experience()\n\t{\n\t\treturn $this->hasOne(Experience::class);\n\t}",
"protected function _getExperienceById()\n {\n $id = $this->_properties['experince_id'];\n if (array_key_exists($id, \\Api\\Model\\Service\\Core::$experience)) {\n return \\Api\\Model\\Service\\Core::$experience[$id];\n }\n return '';\n }",
"public function ratesExperience()\n {\n return $this->value(@$this->attributes->rates->experience);\n }",
"public function getExperience()\n {\n return $this->hasOne(MgfExperience::className(), ['id' => 'experience_id']);\n }",
"public function experience() {\n\t\treturn $this->belongsTo('Experience');\n\t}",
"public function getExperienceOfNature()\n {\n return $this->experienceOfNature;\n }",
"public function getExperience()\n {\n return $this->hasOne(CompanyExperience::className(), ['id' => 'experience_id']);\n }",
"public function getSkillNameExperience()\n\t{\n\t\tif(!isset($this->skillnames['Experience']))\n\t\t{\n\t\t\t$this->skillnames['Experience'] = $this->getSkillName('Experience');\n\t\t}\n\t\treturn $this->skillnames['Experience'];\n\t}",
"public function experience();",
"public function getEducation() {\r\n return $this->education;\r\n }",
"public function getEducation()\n\t{\n\t\treturn $this->education;\n\t}",
"public function getExperiences()\n {\n return $this->experiences;\n }",
"public function getSkillIntuition()\n {\n return $this->skill_intuition;\n }",
"public function getExperienceRequirements()\n {\n return $this->experienceRequirements;\n }",
"public function getCampaignExperiment()\n {\n return $this->campaign_experiment;\n }",
"public function getPersonnalExperiences() {\n return $this->personnalExperiences;\n }",
"public function getSkillOccultEd()\n {\n return $this->skill_occult_ed;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sanitize a string component | protected function sanitizeComponent($str)
{
if (is_null($str)) {
return $str;
}
$str = filter_var((string) $str, FILTER_UNSAFE_RAW, array('flags' => FILTER_FLAG_STRIP_LOW));
$str = trim($str);
return $str;
} | [
"function sanitizeString() {\n\treturn filterVar( FILTER_SANITIZE_STRING );\n}",
"function sanitiseString($dirty){\n $dirty = filter_var($dirty, FILTER_SANITIZE_FULL_SPECIAL_CHARS);\n $clean = filter_var($dirty, FILTER_SANITIZE_STRING);\n return $clean;\n }",
"private function sanitize() {}",
"function clean_string(string $input_string) {\n $sanitised_string = filter_var($input_string, FILTER_SANITIZE_STRING);\n trim($sanitised_string);\n return $sanitised_string;\n}",
"function sanitizeString($str_input) {\r\n $str_input = strip_tags($str_input);\r\n $str_input = htmlentities($str_input);\r\n $str_input = stripslashes($str_input);\r\n return $str_input;\r\n}",
"public function testSanitizeStringStringFilter(UnitTester $I)\n {\n $value = 'abcdefghijklmnopqrstuvwzyx1234567890!@#$%^&*()_ `~=+<>';\n $expected = 'abcdefghijklmnopqrstuvwzyx1234567890!@#$%^&*()_ `~=+';\n $this->sanitizer($I, 'string', $expected, $value);\n }",
"function fsl_scrub($string){\n \n $xss = new xss_filter();\n $string = $xss->filter_it($string); \n return $string;\n}",
"public abstract function sanitize( $input );",
"function clean_input($str) {\n // get rid of magic quotes if on\n if (get_magic_quotes_gpc()) {\n $str = stripslashes($str);\n }\n\n return trim($str);\n }",
"public function sanitize($value);",
"abstract public function sanitize($value);",
"function helper_sanitize_name($str){\n $this->bad = array(\n \"<!--\",\n \"-->\",\n \"'\",\n \"<\",\n \">\",\n '\"',\n '&',\n '$',\n '=',\n ';',\n '?',\n '/',\n '%',\n '[',\n ']',\n '|',\n \"%20\",\n \"%22\",\n \"%3c\",\t// <\n \"%253c\", \t// <\n \"%3e\", \t// >\n \"%0e\", \t// >\n \"%28\", \t// (\n \"%29\", \t// )\n \"%2528\", \t// (\n \"%26\", \t// &\n \"%24\", \t// $\n \"%3f\", \t// ?\n \"%3b\", \t// ;\n \"%3d\"\t// =\n );\n $str = str_replace($this->bad, '', $str);\n $str = str_replace(\"[^A-Za-z0-9 _-]\", \"\", $str);\n if (REMOVE_SPACE){\n $str = preg_replace('/\\s+/', '-',$str);\n }else{\n $str = preg_replace('/\\s+/', ' ',$str);\n }\n return stripslashes($str);\n}",
"function sanitiseInput($input){\n\t\t$input = trim($input); // get rid of leading/trailing whitespaces\n\t\t$input = stripslashes($input); // get rid of slashses\n\t\t$input = htmlspecialchars($input); // get ride of special characters\n\t\treturn $input;\n\t}",
"function sanitize($string, $force_lowercase = true, $anal = false, $trunc = 100) {\n $strip = array(\"~\", \"`\", \"!\", \"@\", \"#\", \"$\", \"%\", \"^\", \"&\", \"*\", \"(\", \")\", \"_\", \"=\", \"+\", \"[\", \"{\", \"]\",\n \"}\", \"\\\\\", \"|\", \";\", \":\", \"\\\"\", \"'\", \"‘\", \"’\", \"“\", \"”\", \"–\", \"—\",\n \"—\", \"–\", \",\", \"<\", \".\", \">\", \"/\", \"?\");\n $clean = trim(str_replace($strip, \"\", strip_tags($string)));\n // $clean = preg_replace('/\\s+/', \"-\", $clean);\n $clean = ($anal ? preg_replace(\"/[^a-zA-Z0-9]/\", \"\", $clean) : $clean);\n $clean = ($trunc ? substr($clean, 0, $trunc) : $clean);\n return ($force_lowercase) ?\n (function_exists('mb_strtolower')) ?\n mb_strtolower($clean, 'UTF-8') :\n strtolower($clean) :\n $clean;\n}",
"protected function validateAndSanitize() {\n\t\t}",
"private function sanitize() {\n\n //\n }",
"function sanitize($string, $force_lowercase = true, $anal = false) {\n $strip = array(\"~\", \"`\", \"!\", \"@\", \"#\", \"$\", \"%\", \"^\", \"&\", \"*\", \"(\", \")\", \"_\", \"=\", \"+\", \"[\", \"{\", \"]\",\n \"}\", \"\\\\\", \"|\", \";\", \":\", \"\\\"\", \"'\", \"‘\", \"’\", \"“\", \"”\", \"–\", \"—\",\n \"—\", \"–\", \",\", \"<\", \".\", \">\", \"/\", \"?\");\n $clean = trim(str_replace($strip, \"\", strip_tags($string)));\n $clean = preg_replace('/\\s+/', \"-\", $clean);\n $clean = ($anal) ? preg_replace(\"/[^a-zA-Z0-9]/\", \"\", $clean) : $clean ;\n return ($force_lowercase) ?\n (function_exists('mb_strtolower')) ?\n mb_strtolower($clean, 'UTF-8') :\n strtolower($clean) :\n $clean;\n }",
"function sanitize($string, $force_lowercase = true, $anal = false) {\n $strip = array(\"~\", \"`\", \"!\", \"@\", \"#\", \"$\", \"%\", \"^\", \"&\", \"*\", \"(\", \")\", \"_\", \"=\", \"+\", \"[\", \"{\", \"]\",\n \"}\", \"\\\\\", \"|\", \";\", \":\", \"\\\"\", \"'\", \"‘\", \"’\", \"“\", \"”\", \"–\", \"—\",\n \"—\", \"–\", \",\", \"<\", \".\", \">\", \"/\", \"?\");\n $clean = trim(str_replace($strip, \"\", strip_tags($string)));\n $clean = preg_replace('/\\s+/', \"-\", $clean);\n $clean = ($anal) ? preg_replace(\"/[^a-zA-Z0-9]/\", \"\", $clean) : $clean ;\n return ($force_lowercase) ?\n (function_exists('mb_strtolower')) ?\n mb_strtolower($clean, 'UTF-8') :\n strtolower($clean) :\n $clean;\n }",
"public static function xss_clean($str)\n {\n return App_Input::instance()->xss_clean($str);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ function to delete identity_option | function delete_identity_option($ID_IDENTITY_OPTION)
{
return $this->db->delete('IDENTITY_OPTION',array('ID_IDENTITY_OPTION'=>$ID_IDENTITY_OPTION));
} | [
"public function removeOptions($option){}",
"function iVolunteer_deleteOptions ()\n {\n delete_option (IVOLUNTEER_OPTIONS);\n }",
"public function clearIdentity(): void;",
"public function unsetItemOptionId(): void\n {\n $this->itemOptionId = [];\n }",
"public function unsetModifierOptionId(): void\n {\n $this->modifierOptionId = [];\n }",
"public function delete_identity($identity, $opt = null)\n\t{\n\t\tif (!$opt) $opt = array();\n\t\t$opt['Identity'] = $identity;\n\t\t\n\t\treturn $this->authenticate('DeleteIdentity', $opt);\n\t}",
"function milk_ops_deactivation(){\n\t\t\n\t\t\tdelete_option($this->optionsName);\n\t\t\n\t\t}",
"protected function _removeOptions()\r\n {\r\n \\delete_option('eawp_path');\r\n \\delete_option('eawp_url');\r\n }",
"public function remove_option($option)\n {\n }",
"function delete_option($key) {\n do_action('dbnavt', NAVT_GEN, sprintf(\"%s::%s Key: %s\\n\", __CLASS__, __FUNCTION__, $key));\n delete_option($key);\n }",
"public static function removeIdentity() {\n\t\tCore_Store::remove('identity');\n\t}",
"function agnosia_unregister_option( $name ) {\r\n\r\n\tdo_action( 'agnosia_before_unregister_option', $name );\r\n\r\n\tglobal $agnosia_options;\r\n\r\n\t$options = $agnosia_options->options;\r\n\r\n\tif ( isset( $options[$name] ) ) { \r\n\t\tunset( $options[$name] ); \r\n\t}\r\n\r\n\t$agnosia_options->options = $options;\r\n\r\n\tdo_action( 'agnosia_after_unregister_option', $name );\r\n\r\n}",
"public function deleteOption()\n\t{\n\t\tdelete_option( $this->optionName );\n\t}",
"function myplugin_delete_option() {\n\n\t/*\n\t\tdelete_option(\n\t\t\tstring $option\n\t\t)\n\t*/\n\n\tdelete_option( 'myplugin-option-name' );\n\n}",
"function templatize_delete_plugin_options() {\r\n\tdelete_option('templatize_options');\r\n}",
"function epub_remove_options()\n\t{\t\tdelete_option('epub_order');\n\t\tdelete_option('epub_general');\n\t\tdelete_option('epub_cover');\n\t\tdelete_option('epub_toc');\n\t\tdelete_option('epub_csun');\n\t\tdelete_option('epub_undergrad');\n\t\tdelete_option('epub_student-services');\n\t\tdelete_option('epub_special-programs');\n\t\tdelete_option('epub_gened');\n\t\tdelete_option('epub_grad');\n\t\tdelete_option('epub_credential');\n\t\tdelete_option('epub_courses');\n\t\tdelete_option('epub_policies');\n\t\tdelete_option('epub_faculty');\n\t\tdelete_option('epub_emeriti');\n\t}",
"function pvw_options_reset() {\n\t\t\n\t\t$delete = delete_option('pvw_'.NAP_PVW_PLUGIN_SHORTCODE.'_options');\n\t\tself::pvw_options_setup();\n\t\t\n\t}",
"function delete_blog_option($id, $option)\n {\n }",
"public function testDeleteIdentity()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function used by uasort to sort feed fields by weight. | function feed_fields_sort($a, $b) {
$a_weight = (is_object($a) && isset($a->data['weight'])) ? $a->data['weight'] : 0;
$b_weight = (is_object($b) && isset($b->data['weight'])) ? $b->data['weight'] : 0;
if ($a_weight == $b_weight) {
return 0;
}
return ($a_weight < $b_weight) ? -1 : 1;
} | [
"function dfm_weight_sort($r1, $r2) {\n return $r1['weight'] - $r2['weight'];\n}",
"function _nexteuropa_inpage_nav_sort_by_weight($a, $b) {\n return $a['weight'] - $b['weight'];\n}",
"function cmp_weight($p1, $p2) {\n return (int)$p1['weight'] - (int)$p2['weight'];\n}",
"private static function sortWeights(&$arr)\n{\n\t$sortby = array('access'=>array(), 'default'=>array(), 'weight'=>array());\n\tforeach ($arr as $item)\n\t{\n\t\t$sortby['last'][] = (empty($item['weight'])) ? 0 : 1;\n\t\t$sortby['location'][] = (empty($item['location'])) ? 0 : $item['location'];\n\t\t$sortby['access'][] = (empty($item['access']) && $item['weight'] > 0) ? 0 : 1;\n\t\t$sortby['default'][] = (empty($item['default'])) ? 0 : 1;\n\t\t$sortby['weight'][] = $item['weight'];\n\t}\n\treturn array_multisort(\n\t\t$sortby['last'], SORT_DESC,\n\t\t$sortby['location'], SORT_DESC,\n\t\t$sortby['access'], SORT_DESC,\n\t\t$sortby['default'], SORT_DESC,\n\t\t$sortby['weight'], SORT_DESC,\n\t\t$arr);\n}",
"function weight_sort($arr, $weight_key='weight') {\n $ret1=array();\n\n if(!$arr)\n return array();\n\n // first put all elements into an assoc. array\n foreach($arr as $k=>$cur) {\n if(is_object($cur)) {\n $wgt = isset($cur->$weight_key) ? $cur->$weight_key : 0;\n $data = $cur;\n }\n else if (!is_array($cur)) {\n $wgt = 0;\n $data = $cur;\n }\n else if((sizeof($cur)==2)&&array_key_exists(0, $cur)&&array_key_exists(1, $cur)) {\n $wgt=$cur[0];\n $data = $cur[1];\n }\n else {\n $wgt=(isset($cur[$weight_key])?$cur[$weight_key]:0);\n $data = $cur;\n }\n\n if(is_callable($wgt))\n $wgt = call_user_func($wgt);\n\n $ret1[$wgt][$k] = $data;\n }\n\n // get the keys, convert to value, order them\n ksort($ret1);\n $ret2=array();\n\n // iterate through array and compile final return value\n foreach($ret1 as $cur) {\n foreach($cur as $j=>$d) {\n $ret2[$j]=$cur[$j];\n }\n }\n\n return $ret2;\n}",
"protected function sortItems()\n {\n usort($this->items, static function ($a, $b) {\n if ($a->weight === $b->weight) {\n return $a->title <=> $b->title;\n }\n\n return $a->weight <=> $b->weight;\n });\n }",
"protected function sortElements (array &$elements)\n {\n uasort($elements, function($a, $b) {\n if ($a['weight'] == $b['weight']) return 0;\n return ($a['weight'] < $b['weight']) ? -1:1;\n });\n }",
"function aecom_weighted_random_sort( $weight_a, $weight_b ) {\n $order_a = mt_rand( 0, 1000 ) + ( (int) $weight_a * 10000 );\n $order_b = mt_rand( 0, 1000 ) + ( (int) $weight_b * 10000 );\n return $order_b - $order_a;\n}",
"function sort_taxonomy_by_weight($options){\n\n $weights = array();\n foreach ($options as $key => $value) {\n \t$term = taxonomy_term_load($key);\n \t$weights[$term->weight] = $term->tid;\n }\n\n ksort($weights);\n\n $ops = array();\n foreach ($weights as $k => $v) {\n \t$term = taxonomy_term_load($v);\n \t$ops[$term->tid] = $term->name;\n }\n\n return $ops;\n\n}",
"public function getSortWeights()\n {\n $value = $this->get(self::sort_weights);\n return $value === null ? (integer)$value : $value;\n }",
"function _cfb_arraysort ($a, $b) {\n if (isset($a['weight']) && isset($b['weight'])) {\n return $a['weight'] < $b['weight'] ? -1 : 1;\n }\n return 0;\n}",
"function c4m_search_sort_taxonomy(array $a, array $b) {\n $a_count = (isset($a['#taxonomy_weight'])) ? $a['#taxonomy_weight'] : 0;\n $b_count = (isset($b['#taxonomy_weight'])) ? $b['#taxonomy_weight'] : 0;\n if ($a_count == $b_count) {\n return 0;\n }\n return ($a_count < $b_count) ? -1 : 1;\n}",
"public static function sortTags($a, $b) {\n\t\t\tif ($a['weight'] == $b['weight']) {\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t\treturn ($a['weight'] < $b['weight']) ? -1 : 1;\n\t\t}",
"public static function order($items) {\n\t\tif (empty($items)) {\n\t\t\treturn array();\n\t\t}\n\n\t\t$_items = array_combine(array_keys($items), Hash::extract($items, '{s}.weight'));\n\t\tasort($_items);\n\n\t\tforeach (array_keys($_items) as $key) {\n\t\t\t$_items[$key] = $items[$key];\n\t\t}\n\n\t\treturn $items;\n\t}",
"protected function sort($assets)\n {\n // We should keep order for assets with equal weight. Thus we must\n // combine original order and weight property before real sort.\n $tmp = array();\n $offset = 0;\n foreach ($assets as $asset) {\n $key = $asset['weight'] . '|' . $offset;\n $tmp[$key] = $asset;\n $offset++;\n }\n\n uksort($tmp, function ($a, $b) {\n list($a_weight, $a_offset) = explode('|', $a, 2);\n list($b_weight, $b_offset) = explode('|', $b, 2);\n\n if ($a_weight != $b_weight) {\n return ($a_weight < $b_weight) ? -1 : 1;\n }\n\n // Weights are equal. Check the offset to determine which asset was\n // attached first.\n if ($a_offset != $b_offset) {\n return ($a_offset < $b_offset) ? -1 : 1;\n }\n\n return 0;\n });\n\n // Artificial sorting keys should be removed from the resulting array.\n return array_values($tmp);\n }",
"public function recommend() {\n unset($this->weightList); // Unset way list, case it contains data\n foreach($this->museumList as $index => $museum) {\n $this->weightList[$index] = 0.6*($museum->getRating() / 10) +\n 0.4*( 1 - $museum->getDistance() / 10000);\n }\n arsort($this->weightList);\n \n return array_keys($this->weightList);\n }",
"public function asort () {}",
"public function setSortWeights($value)\n {\n return $this->set(self::sort_weights, $value);\n }",
"function pi_sort_grouped_item_list($group_order, $grouped_items, $weight_index)\n{\n\t$item_ids = array();\n\t$item_groups = array();\n\t$item_weights = array();\n\t$items = array();\n\tforeach($grouped_items as $group_name => $group)\n\t{\n\t\tif( is_array($item_ids) )\n\t\t{ \n\t\t\tif( !array_key_exists($group_name, $item_ids) || \n\t\t\t\t( array_key_exists($group_name, $item_ids) && !is_array($item_ids[$group_name]) ) )\n\t\t\t{\n\t\t\t\t$item_ids[$group_name] = array();\n\t\t\t}\n\t\t}\n\n\t\tif( is_array($item_weights) )\n\t\t{ \n\t\t\tif( !array_key_exists($group_name, $item_weights) || \n\t\t\t\t( array_key_exists($group_name, $item_weights) && !is_array($item_weights[$group_name]) ) )\n\t\t\t{\n\t\t\t\t$item_weights[$group_name] = array();\n\t\t\t}\n\t\t}\n\t\t\n\t\tforeach($group as $item_id => $item)\n\t\t{\n\t\t\t$item_ids[$group_name][] = $item_id;\n\t\t\t$item_weights[$group_name][] = $item[$weight_index];\n\t\t\t$items[$item_id] = $item;\n\t\t}\n\t}\n\n\t// If new groups appear that aren't in the default list, append them to the end of the list:\n\tforeach(array_keys($item_ids) as $other_group)\n\t{\n\t\tif(!in_array($other_group, $group_order))\n\t\t{\n\t\t\t$group_order[] = $other_group;\n\t\t}\n\t}\n\t$sorted_items = array();\n\tforeach($group_order as $group)\n\t{\n\t\tif(array_key_exists($group, $item_ids)!=NULL)\n\t\t{\n\t\t\t$sort_weights = $item_weights[$group];\n\t\t\t$sort_ids = $item_ids[$group];\n\t\t\tarray_multisort($sort_weights, $sort_ids);\n\t\t\tforeach($sort_ids as $item_id)\n\t\t\t{\n\t\t\t\t$items[$item_id][$weight_index] = count($sorted_items);\n\t\t\t\t$sorted_items[$item_id] = $items[$item_id];\n\t\t\t}\n\t\t}\n\t}\n\treturn $sorted_items;\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Handle do type = "call" | public function handleCall() {
$code = '';
if ($this->assign) $code .= $this->parseEntity($this->assign).' = ';
if (substr($this->method, 0, 5) == 'this.') {
$code .= '$'.str_replace('.', '->', $this->method).'(';
} else {
$code .= $this->adapterLink.'->'.$this->method.'(';
}
if (isset($this->params) && isset($this->params->param)) {
foreach($this->params->param as $p) {
if (isset($p->name)) {
$code .= $this->parseEntity($p->name);
} else {
$code .= $this->getFieldValue($p->value);
}
$code .= ', ';
}
$code = rtrim($code, ', ');
}
$code .= ');';
if (isset($this->return)) {
$this->writeLine($this->parseEntity($this->return).' = ');
}
$this->writeLine($code);
} | [
"public static function call()\n {\n return self::getServiceType(self::SERVICE_TYPE_CALL);\n }",
"public function incoming_call(){\n\t\t$this->CallModel->incoming_call();\n\t}",
"function resolveCall() {\n $uriPath = explode('/',$this->getUriPath()); \n if ( count($uriPath) != 2 ) {\n trigger_error('Invalid call syntax',E_USER_ERROR);\n return FALSE;\n }\n \n //check the class name\n if ( preg_match('/^[a-zA-Z]+[0-9a-zA-Z_]*$/',$uriPath[0]) != 1 ) {\n trigger_error('Invalid handler name: '.$uriPath[0],E_USER_ERROR);\n return FALSE;\n }\n //method name\n if ( preg_match('/^[a-zA-Z_]+[0-9a-zA-Z_\\.]*$/',$uriPath[1]) != 1 ) {\n trigger_error('Invalid handler method: '.$uriPath[1],E_USER_ERROR);\n return FALSE;\n }\n \n if ( !array_key_exists($uriPath[0],$this->descriptions) ) {\n trigger_error('Unknown handler: '.$uriPath[0],E_USER_ERROR);\n return FALSE;\n }\n \n if ( !in_array($uriPath[1],$this->descriptions[$uriPath[0]]->methods) ) {\n trigger_error('Unknown handler method: '.$uriPath[1],E_USER_ERROR);\n return FALSE;\n }\n \n $method = explode('.', $uriPath[1]);\n\t\t \n $this->calledClass = $uriPath[0];\n $this->calledMethod = array_shift($method);\n \t$this->callID = implode('.',$method);;\n\n return TRUE;\n \n }",
"public function getCall();",
"protected function _call() {\n\n\t\t$argList = func_get_args();\n\n\t\t$method \t= $argList[0];\n\t\t$methodArgList \t= array_slice($argList, 1);\n\n\t\t//print $method;\n\t\t//print var_dump($argList);\n\t\t//print var_dump($methodArgList);\n\n\t\treturn $this->_request($method, $methodArgList);\n\t}",
"abstract function callService();",
"function eis_call($url,$timestamp,$from,$type,$cmd,$param,&$returnmsg) {\n\tglobal $eis_conf;\n\teis_clear_error();\n\t// prepare data\n\t$calldata=array(\"timestamp\"=>$timestamp,\"from\"=>$from,\"type\"=>$type,\"cmd\"=>$cmd,\"param\"=>$param);\n\t$to=$url;\n\t// check if host is alive\n\tif(substr($url,-1)==\"/\") $url=$url.\"control.php\"; else $url=$url.\"/control.php\";\n\tif (!($p=parse_url($url,PHP_URL_PORT))) $p=80;\n\tif (($st=@fsockopen(parse_url($url,PHP_URL_HOST),$p,$errno,$errstr,$eis_conf[\"atimeout\"]))!==false)\n\t\tfclose($st);\n\telse \n\t\treturn eis_error(\"system:hostNotAlive\",$url);\n\t// encode data\n\t$calldata=eis_encode($calldata);\n\t// make the POST call and get return data back\n \t$options=array(\"method\"=>\"POST\",\"content\"=>$calldata,\"timeout\"=>$eis_conf[\"timeout\"],\n \t\t\"header\"=>\"Content-Type: application/json\\r\\nAccept: application/json\\r\\nCache-Control: no-cache,must-revalidate\\r\\n\");\n \t$ctx=stream_context_create(array(\"http\"=>$options));\n \t@$fp=fopen($url,'rb',false,$ctx);\n \tif (!$fp) return eis_error(\"system:HTTPcall\",\"no response or timeout from $url\");\n \t// check if the message is an eis message\n \tif (!($token=@stream_get_contents($fp,3))) return eis_error(\"system:HTTPcall\",stream_get_meta_data($fp)); \n\tif ($token!=\"eis\") {\n\t\t// false, return raw data\n\t\tif (!($returndata=@stream_get_contents($fp))) return eis_error(\"system:HTTPcall\",stream_get_meta_data($fp));\n\t\t$returndata=$token.$returndata;\n\t}\n\telse {\n\t\t// true, get message size and read it\n\t\tif (!($len=@stream_get_contents($fp,10))) return eis_error(\"system:HTTPcall\",stream_get_meta_data($fp));\n\t\t$len=intval($len);\n\t\tif (!($returndata=@stream_get_contents($fp,$len))) return eis_error(\"system:HTTPcall\",stream_get_meta_data($fp));\n\t}\n \t@fclose($fp);\n // decode return data\n\t$returnmsg=eis_decode($returndata);\n\tif (!is_array($returnmsg) or !array_key_exists(\"error\",$returnmsg) or !array_key_exists(\"returnpar\",$returnmsg))\n\t\treturn eis_error(\"system:callRetData\",$returndata);\n\t// check if the call returned an error\n\tif ($returnmsg[\"error\"]) return eis_error($returnmsg[\"error\"],$returnmsg[\"returnpar\"][\"errordata\"]);\n\t// everything is ok, return true\n\treturn true;\n}",
"abstract public function invoke($method,$params);",
"public function exampleCall()\n {\n return \"howdy\";\n }",
"public function calltokenHandler(){}",
"function callEvent($tenant,$eventName,$handle = \"\",$data=array()) \n\t{\n\t\t//call with handle or eventname\n\t\t//execute master events\n\t\t//...\n\t\t\n\t\tif ($handle==\"\")\n\t\t\t//execute Tenant events\n\t\t\t$eventInfo=select($tenant,\"events\",array(\"BROrder\"=>1,\"hit\"=>1,\"name\"=>1,\"enabled\"=>1,\"BRFunctionName\"=>1,\"type\"=>1),array(\"name\"=>$eventName));\n\t\telse\n\t\t\t$eventInfo=select($tenant,\"events\",array(\"BROrder\"=>1,\"hit\"=>1,\"name\"=>1,\"enabled\"=>1,\"handle\"=>1,\"BRFunctionName\"=>1,\"type\"=>1),array(\"handle\"=>$handle));\n\t\t\t//$eventInfo=select($tenant,\"events\",array(\"BROrder\"=>1,\"hit\"=>1,\"name\"=>1,\"enabled\"=>1),array('$and'=>array(array(\"name\"=>$eventName),array(\"handle\"=>$handle))));\n\t\t\n\t\t$eventInfo=json_decode($eventInfo,true);\n\t\t\n\t\tif (count($eventInfo)>0) //if event found\n\t\t{\n\t\t\tif ($eventInfo[0][\"enabled\"]==true)\n\t\t\t{\n\t\t\t\t$retValue=\"\";\n\t\t\t\tif ($eventInfo[0][\"type\"]==\"user-defined\")\n\t\t\t\t\tinclude_once(tenantPath.$tenant.\"/Actions/\".$eventInfo[0][\"BROrder\"]);\n\t\t\t\telse\n\t\t\t\t\tinclude_once(\"Actions/\".$eventInfo[0][\"BROrder\"]);\n\t\t\t\t\t\t\t\t\n\t\t\t\t$retValue=$eventInfo[0][\"BRFunctionName\"]($data);\n\t\t\t\t\n\t\t\t\tif ($handle==\"\")\n\t\t\t\tupdate($tenant,\"events\",array(\"hit\"=>++$eventInfo[0][\"hit\"]),array(\"name\"=>$eventName));\n\t\t\t\telse\n\t\t\t\tupdate($tenant,\"events\",array(\"hit\"=>++$eventInfo[0][\"hit\"]),array(\"handle\"=>$handle));\n\t\t\t\t\n\t\t\t\treturn $retValue;\n\t\t\t}\n\t\t}\n\t\t\n\t}",
"public function handle_rpc_call($arr)\n\t{\n\t\textract($arr);\n\n\t\t// now, catch all output\n\t\tob_start();\n\n\t\t// load rpc handler\n\t\t$inst = new $method();\n\t\tif (!is_object($inst))\n\t\t{\n\t\t\t$this->raise_error(\"ERR_ORB_RPC_NO_HANDLER\",sprintf(t(\"orb::handle_rpc_call - Could not load request handler for request method '%s'\"), $method), true,false);\n\t\t}\n\n\t\t// decode request\n\t\t$request = $inst->decode_request();\n\n\t\tif (empty($request[\"class\"]))\n\t\t{\n\t\t\t$inst->handle_error(1, \"No class given\");\n\t\t}\n\n\t\t// do the method calling thing\n\t\t$orb_defs = $this->try_load_class($request[\"class\"]);\n\n\t\t$params = $this->check_method_params($orb_defs, $request[\"params\"], $request[\"class\"], $request[\"action\"]);\n\n\t\tif (!isset($orb_defs[$request[\"class\"]][$request[\"action\"]]))\n\t\t{\n\t\t\t$this->raise_error(\"ERR_ORB_MNOTFOUND\",sprintf(\"No action with name %s defined in class %s! Malformed XML?\",$request[\"action\"],$request[\"class\"]),true,$this->silent);\n\t\t}\n\n\t\t$ret = $this->do_local_call($orb_defs[$request[\"class\"]][$request[\"action\"]][\"function\"], $request[\"class\"], $params,$orb_defs[$request[\"class\"]][\"___folder\"]);\n\n\n\t\t$output = (string) ob_get_contents();\n\t\tob_end_clean();\n\n\t\tif (strlen($output))\n\t\t{\n\t\t\t$output = htmlentities($output);\n\t\t\t$inst->handle_error(2, \"Output generated during RPC call! content: '{$output}'\");\n\t\t}\n\n\t\treturn $inst->encode_return_data($ret);\n\t}",
"public function __invoke()\n {\n $data = json_decode(request('payload'), true);\n\n switch (Arr::get($data, 'type')) {\n case 'block_actions':\n // The user clicked an action button, such as \"Close Results\"\n $this->handleBlockAction($data);\n break;\n\n default:\n # code...\n break;\n }\n }",
"function call($hook_name, $arguments=array())\n {\n $thiis =& SE_Hook::create();\n \n // Prioritize\n if( $thiis->_needs_prioritize ) $thiis->prioritize();\n \n // Iterate over each callback\n $hook_index = $thiis->_hooks[$hook_name];\n foreach( $thiis->_callbacks[$hook_index] as $callback_index=>$callback )\n {\n if( !is_callable($callback) ) continue;\n // TODO: Capture output\n call_user_func($callback, $arguments);\n }\n \n return;\n }",
"function callHandler($action)\n {\n $handler = getNodeHandler($this->m_type, $action);\n\n // handler function\n if ($handler != NULL && function_exists($handler))\n {\n atkdebug(\"Calling external handler function for '\".$action.\"'\");\n $handler($this, $action);\n }\n\n // no (valid) handler\n else\n {\n $this->m_handler = &$this->getHandler($action);\n $this->m_handler->handle($this, $action, $this->m_postvars);\n }\n }",
"function resolveCall() {\r\n // Hack between server.php?class/method and server.php/class/method\r\n $uriPath = $_SERVER['QUERY_STRING'];\r\n\r\n if ( $uriPath ) {\r\n if ( preg_match('/\\/$/',$uriPath) ) {\r\n $uriPath = substr($uriPath,0, strlen($uriPath)-1);\r\n }\r\n } else {\r\n $uriPath = JPSpan_Server::getUriPath();\r\n }\r\n\r\n $uriPath = explode('/',$uriPath);\r\n\r\n if ( count($uriPath) != 2 ) {\r\n trigger_error('Invalid call syntax',E_USER_ERROR);\r\n return FALSE;\r\n }\r\n\r\n if ( preg_match('/^[a-z]+[0-9a-z_]*$/',$uriPath[0]) != 1 ) {\r\n trigger_error('Invalid handler name: '.$uriPath[0],E_USER_ERROR);\r\n return FALSE;\r\n }\r\n\r\n if ( preg_match('/^[a-z]+[0-9a-z_]*$/',$uriPath[1]) != 1 ) {\r\n trigger_error('Invalid handler method: '.$uriPath[1],E_USER_ERROR);\r\n return FALSE;\r\n }\r\n\r\n if ( !array_key_exists($uriPath[0],$this->descriptions) ) {\r\n trigger_error('Unknown handler: '.$uriPath[0],E_USER_ERROR);\r\n return FALSE;\r\n }\r\n\r\n if ( !in_array($uriPath[1],$this->descriptions[$uriPath[0]]->methods) ) {\r\n trigger_error('Unknown handler method: '.$uriPath[1],E_USER_ERROR);\r\n return FALSE;\r\n }\r\n\r\n $this->calledClass = $uriPath[0];\r\n $this->calledMethod = $uriPath[1];\r\n\r\n return TRUE;\r\n\r\n }",
"function handleRequest() \n\t{\n\t\tif($params['function'] && in_array($params['function'],$validRequests) && in_array($requesType, $validRequests[$params['function']]) && function_exists($params['function']))\n\t\t{ \n\t\t\t//unset the function index from the params\n\t\t\tunset($params['function']);\n\t\t\t//make function call\n\t\t\t$request['function']($params);\n\t\t} else \n\t\t{\n\t\t\tprint 'Invalid request. Please call the right function';\n\t\t}\n\t}",
"function context_call($call, $ctx='')\n{\n\tif (is_array($ctx)) \n\t{\n\t\tforeach($ctx as $postname)\n\t\t{\n\t\t \t$context[$postname] = get_post($postname);\n\t\t}\n\t} else \n\t\t$context = isset($_SESSION[$ctx]) ? $_SESSION[$ctx] : null;\n\n\tarray_unshift($_SESSION['Context'], array('name' => $ctx, \n\t\t'ctx' => $context,\n\t\t'caller' => $_SERVER['PHP_SELF'],\n\t\t'ret' => array()));\n\tmeta_forward($call);\n}",
"function handler_call($action, $arguments=null)\r\n{\r\n\tglobal $HANDLER;\r\n\tif (!isset($HANDLER[$action])) return false;\r\n\tforeach ((array)$HANDLER[$action] as $f)\r\n\t{\r\n\t\tif (!function_exists($f)) continue;\r\n\t\tif (true === call_user_func_array($f, (array)$arguments)) break;\r\n\t}\r\n\treturn true;\r\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Lists all series entities. | public function indexAction()
{
$em = $this->getDoctrine()->getManager();
$entities = $em->getRepository('uniSeriesBundle:series')->findAll();
return $this->render('uniSeriesBundle:series:index.html.twig', array(
'entities' => $entities,
));
} | [
"public function getAllSeries() {\r\n $sql = 'SELECT * FROM series';\r\n\r\n $this->_lastResult = $this->_db->Execute($sql);\r\n\r\n $result = $this->_getItemsFromResult();\r\n return $result;\r\n }",
"public function listSeries()\n {\n $series = Series::where('active', '=', '1')->get();\n $this->layout->content = View::make('user/listSeries', array('series' => $series));\n }",
"function getAllSeries() {\n $service_url = \"/series/series.json\";\n if($series = self::getJSON($service_url)){\n return $series->catalogs;\n } else return false;\n }",
"function getAllSeries() {\n\n $service_url = \"/series.json\";\n if($series = $this->getJSON($service_url)){\n //$x = \"search-results\";\n //$episodes = $search->$x->result;\n return $series;\n } else return false;\n }",
"public function getAllEntities()\n {\n return $this->getRepository()->findAll();\n }",
"public function index()\n {\n $series = $this->series->with('posts')\n ->latest()\n ->paginate(25);\n\n return View::make('admin.series.index', compact('series'))\n ->withTitle('All series');\n }",
"public function indexAction()\r\n {\r\n $em = $this->getDoctrine()->getManager();\r\n\r\n $entities = $em->getRepository('FcFantaBundle:Season')->findAll();\r\n\r\n return array(\r\n 'entities' => $entities,\r\n );\r\n }",
"public function indexAction() {\n $em = $this->getDoctrine()->getEntityManager();\n $entities = $em->getRepository('EphpGestoriBundle:Gestore')->findAll();\n\n return array('entities' => $entities);\n }",
"public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('FXLMusicBundle:Scene')->findAll();\n\n return array(\n 'entities' => $entities,\n );\n }",
"public function all() {\n return $this->app->entityManager->getRepository($this->model_name)->findAll();\n }",
"public function showAll()\n {\n $series = Series::all();\n $genres = $this->genre->showAll();\n $parameters = [\n 'series' => $series,\n 'genres' => $genres\n ];\n return view('serie.series',$parameters);\n }",
"function get_all_series()\n {\n return $this->db->get('series')->result_array();\n }",
"public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('JordoCalendarBundle:Event')->findAll();\n\n return array(\n 'entities' => $entities,\n );\n }",
"public function indexAction()\n {\n $em = $this->getDoctrine()->getEntityManager();\n\n $entities = $em->getRepository('Area4ContableBundle:Egreso')->findAll();\n\n return array('entities' => $entities);\n }",
"public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('MinsalsifdaBundle:SifdaEquipoTrabajo')->findAll();\n\n return array(\n 'entities' => $entities,\n );\n }",
"public function indexAction() {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('SistemaBundle:Periodo')->findAll();\n\n return array(\n 'entities' => $entities,\n );\n }",
"public function indexAction()\n {\n $em = $this->getDoctrine()->getEntityManager();\n\n $entities = $em->getRepository('AcseoStartupWeekendBundle:Event')->findAll();\n\n return array('entities' => $entities);\n }",
"public function indexAction()\n {\n $em = $this->getDoctrine()->getEntityManager();\n\n $entities = $em->getRepository('FnxAdminBundle:ServicoEscala')->findAll();\n\n return array('entities' => $entities);\n }",
"public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n //$entities = $em->getRepository('ApplicationEservicesBundle:EproduitHistory')->findAll();\n $entities = $em->getRepository('ApplicationEservicesBundle:EproduitHistory')->myFindAll()->getResult();\n return $this->render('ApplicationEservicesBundle:EproduitHistory:index.html.twig', array(\n 'entities' => $entities,\n ));\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Obtains a new inputs object. Includes setters appropriate for this GetTranslationsArray Choreo. | public function newInputs($inputs = array())
{
return new Microsoft_Translator_GetTranslationsArray_Inputs($inputs);
} | [
"public function newInputs($inputs = array())\n {\n return new Microsoft_Translator_AddTranslationArray_Inputs($inputs);\n }",
"public function newInputs($inputs = array())\n {\n return new Microsoft_Translator_GetLanguagesForTranslate_Inputs($inputs);\n }",
"public function newInputs($inputs = array())\n {\n return new Microsoft_Translator_GetLanguageNames_Inputs($inputs);\n }",
"public function newInputs($inputs = array())\n {\n return new Microsoft_Translator_DetectArray_Inputs($inputs);\n }",
"public function newInputs($inputs = array())\n {\n return new Microsoft_Translator_AddTranslation_Inputs($inputs);\n }",
"public function newInputs($inputs = array())\n {\n return new Microsoft_Translator_GetLanguagesForSpeak_Inputs($inputs);\n }",
"public function getTranslations();",
"public function setTranslationsFromArray(array $translations): self\n {\n $this->translations = $translations;\n\n return $this;\n }",
"public function setInputs($var)\n {\n $arr = GPBUtil::checkRepeatedField($var, \\Google\\Protobuf\\Internal\\GPBType::MESSAGE, \\Google\\Cloud\\Video\\Transcoder\\V1\\Input::class);\n $this->inputs = $arr;\n\n return $this;\n }",
"public function newInputs($inputs = array())\n {\n return new Microsoft_Translator_GetToken_Inputs($inputs);\n }",
"public function newInputs($inputs = array())\n {\n return new Twilio_Conferences_GetParticipant_Inputs($inputs);\n }",
"public function newInputs($inputs = array())\n {\n return new Microsoft_Translator_Speak_Inputs($inputs);\n }",
"public static function createFromTranslations(array $translations)\n {\n return (new Translatable())->setTranslations($translations);\n }",
"public function newInputs($inputs = array())\n {\n return new Amazon_S3_GetBucketRequestPayment_Inputs($inputs);\n }",
"public function newInputs($inputs = array())\n {\n return new PayPal_Payments_LookupPayment_Inputs($inputs);\n }",
"public function getFieldsTranslations();",
"public function newInputs($inputs = array())\n {\n return new LittleSis_Reference_GetReferences_Inputs($inputs);\n }",
"public function newInputs($inputs = array())\n {\n return new Google_Plus_Domains_Activities_Get_Inputs($inputs);\n }",
"public function initTranslations();"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Operation taxInvoicesEmailDocumentPostAsync Send Email tax invoice document | public function taxInvoicesEmailDocumentPostAsync($authorization, $send_email_coppies)
{
return $this->taxInvoicesEmailDocumentPostAsyncWithHttpInfo($authorization, $send_email_coppies)
->then(
function ($response) {
return $response[0];
}
);
} | [
"protected function taxInvoicesEmailDocumentPostRequest($authorization, $send_email_coppies)\n {\n // verify the required parameter 'authorization' is set\n if ($authorization === null || (is_array($authorization) && count($authorization) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $authorization when calling taxInvoicesEmailDocumentPost'\n );\n }\n // verify the required parameter 'send_email_coppies' is set\n if ($send_email_coppies === null || (is_array($send_email_coppies) && count($send_email_coppies) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $send_email_coppies when calling taxInvoicesEmailDocumentPost'\n );\n }\n\n $resourcePath = '/tax-invoices/email-document';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // header params\n if ($authorization !== null) {\n $headerParams['Authorization'] = ObjectSerializer::toHeaderValue($authorization);\n }\n\n\n // body params\n $_tempBody = null;\n if (isset($send_email_coppies)) {\n $_tempBody = $send_email_coppies;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function testTaxInvoicesEmailDocumentPost()\n {\n }",
"public function cashInvoicesEmailDocumentPostAsync($authorization, $send_email_coppies)\n {\n return $this->cashInvoicesEmailDocumentPostAsyncWithHttpInfo($authorization, $send_email_coppies)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"protected function expensesEmailDocumentPostRequest($authorization, $send_email_simple)\n {\n // verify the required parameter 'authorization' is set\n if ($authorization === null || (is_array($authorization) && count($authorization) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $authorization when calling expensesEmailDocumentPost'\n );\n }\n // verify the required parameter 'send_email_simple' is set\n if ($send_email_simple === null || (is_array($send_email_simple) && count($send_email_simple) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $send_email_simple when calling expensesEmailDocumentPost'\n );\n }\n\n $resourcePath = '/expenses/email-document';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // header params\n if ($authorization !== null) {\n $headerParams['Authorization'] = ObjectSerializer::toHeaderValue($authorization);\n }\n\n\n // body params\n $_tempBody = null;\n if (isset($send_email_simple)) {\n $_tempBody = $send_email_simple;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function taxInvoicesPostAsync($authorization, $simple_document)\n {\n return $this->taxInvoicesPostAsyncWithHttpInfo($authorization, $simple_document)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function taxInvoicesEmailDocumentPostWithHttpInfo($authorization, $send_email_coppies)\n {\n $request = $this->taxInvoicesEmailDocumentPostRequest($authorization, $send_email_coppies);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n switch($statusCode) {\n case 200:\n if ('\\OpenAPI\\Client\\Model\\SendEmailResponse' === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\OpenAPI\\Client\\Model\\SendEmailResponse', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\OpenAPI\\Client\\Model\\SendEmailResponse';\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\OpenAPI\\Client\\Model\\SendEmailResponse',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function sendInvoicePost($options)\n {\n $request_data['Post'] = $options;\n\n return $this->post('/invoices/post', $request_data);\n }",
"protected function billingNotesEmailDocumentPostRequest($authorization, $send_email_coppies)\n {\n // verify the required parameter 'authorization' is set\n if ($authorization === null || (is_array($authorization) && count($authorization) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $authorization when calling billingNotesEmailDocumentPost'\n );\n }\n // verify the required parameter 'send_email_coppies' is set\n if ($send_email_coppies === null || (is_array($send_email_coppies) && count($send_email_coppies) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $send_email_coppies when calling billingNotesEmailDocumentPost'\n );\n }\n\n $resourcePath = '/billing-notes/email-document';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // header params\n if ($authorization !== null) {\n $headerParams['Authorization'] = ObjectSerializer::toHeaderValue($authorization);\n }\n\n\n // body params\n $_tempBody = null;\n if (isset($send_email_coppies)) {\n $_tempBody = $send_email_coppies;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"protected function taxInvoicesInlinePostRequest($authorization, $inline_document)\n {\n // verify the required parameter 'authorization' is set\n if ($authorization === null || (is_array($authorization) && count($authorization) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $authorization when calling taxInvoicesInlinePost'\n );\n }\n // verify the required parameter 'inline_document' is set\n if ($inline_document === null || (is_array($inline_document) && count($inline_document) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $inline_document when calling taxInvoicesInlinePost'\n );\n }\n\n $resourcePath = '/tax-invoices/inline';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // header params\n if ($authorization !== null) {\n $headerParams['Authorization'] = ObjectSerializer::toHeaderValue($authorization);\n }\n\n\n // body params\n $_tempBody = null;\n if (isset($inline_document)) {\n $_tempBody = $inline_document;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"protected function taxInvoicesInlinePostRequest($authorization, $inline_document)\n {\n // verify the required parameter 'authorization' is set\n if ($authorization === null || (is_array($authorization) && count($authorization) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $authorization when calling taxInvoicesInlinePost'\n );\n }\n // verify the required parameter 'inline_document' is set\n if ($inline_document === null || (is_array($inline_document) && count($inline_document) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $inline_document when calling taxInvoicesInlinePost'\n );\n }\n\n $resourcePath = '/tax-invoices/inline';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // header params\n if ($authorization !== null) {\n $headerParams['Authorization'] = ObjectSerializer::toHeaderValue($authorization);\n }\n\n\n // body params\n $_tempBody = null;\n if (isset($inline_document)) {\n $_tempBody = $inline_document;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function billingNotesEmailDocumentPostAsync($authorization, $send_email_coppies)\n {\n return $this->billingNotesEmailDocumentPostAsyncWithHttpInfo($authorization, $send_email_coppies)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function withholdingTaxesEmailDocumentPostWithHttpInfo($authorization, $send_email_simple)\n {\n $request = $this->withholdingTaxesEmailDocumentPostRequest($authorization, $send_email_simple);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n switch($statusCode) {\n case 200:\n if ('\\OpenAPI\\Client\\Model\\SendEmailResponse' === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\OpenAPI\\Client\\Model\\SendEmailResponse', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\OpenAPI\\Client\\Model\\SendEmailResponse';\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\OpenAPI\\Client\\Model\\SendEmailResponse',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function sendInvoiceEmail(Request $request)\n {\n\n $self = 'manage-invoices';\n if (Auth::user()->username !== 'admin') {\n $get_perm = Permission::permitted($self);\n\n if ($get_perm == 'access denied') {\n return redirect('permission-error')->with([\n 'message' => language_data('You do not have permission to view this page'),\n 'message_important' => true\n ]);\n }\n }\n\n $id = $request->get('cmd');\n\n $v = \\Validator::make($request->all(), [\n 'subject' => 'required'\n ]);\n\n if ($v->fails()) {\n return redirect('invoices/view1/' . $id)->withErrors($v->errors());\n }\n $inv = Invoices::find($id);\n $client = Client::where('status', 'Active')->find($inv->cl_id);\n $inv_items = InvoiceItems::where('inv_id', $id)->get();\n $tax_sum = InvoiceItems::where('inv_id', $id)->sum('tax');\n $dis_sum = InvoiceItems::where('inv_id', $id)->sum('discount');\n $data = view('admin.invoice-print-view', compact('client', 'inv', 'inv_items', 'tax_sum', 'dis_sum'));\n $html = $data->render();\n $file_name = 'Invoice_' . time() . '.pdf';\n $file_path = public_path('assets/invoice_file/' . $file_name);\n $attachment_path = config('app.url') . '/assets/invoice_file/' . $file_name;\n $pdf = \\App::make('snappy.pdf.wrapper');\n $pdf->loadHTML($html)->setPaper('a4')->setOption('margin-bottom', 0)->save($file_path);\n\n $template = $request->message;\n $subject = $request->subject;\n $client_name = $client->fname . ' ' . $client->lname;\n\n try {\n \\Mail::to($client->email)->send(new SendInvoice($client_name, $subject, $template, $attachment_path, $file_path, $file_name));\n\n return redirect('invoices/view1/' . $id)->with([\n 'message' => language_data('Invoice Send Successfully')\n ]);\n } catch (\\Exception $ex) {\n return redirect('invoices/view1/' . $id)->with([\n 'message' => $ex->getMessage()\n ]);\n }\n\n\n }",
"private function _sendInvoices()\n {\n $this->output->writeln(\"==========\");\n\n /** Configure mailer */\n $this->mailer->setTemplateAlias('cros2019.common');\n\n /** @var InvoiceRepository $invoiceRepo */\n $invoiceRepo = $this->em->getRepository(Invoice::class);\n $invoicesData = $invoiceRepo->getInfoToSend();\n $this->log(\"Found \".count($invoicesData).\" invoices which will be send to organizations.\");\n\n foreach ($invoicesData as $invoiceData) {\n $this->output->writeln('*');\n $sendCc = json_decode($invoiceData['emails'], true);\n $sendTo = array_shift($sendCc);\n\n $file = $this->b2bApi->getOrderInvoiceFile($invoiceData['b2b_order_guid']);\n\n if ($file['http_code'] !== 200) {\n $this->log(\"Document for Invoice (ID: {$invoiceData['id']}) doesn't exist yet.\");\n } else {\n /** @var Invoice $invoice */\n $invoice = $this->em->find(Invoice::class, $invoiceData['id']);\n\n $this->mailer->addAttachment([\n 'data_base64' => base64_encode($file['data']),\n 'filename' => $invoice->getDocumentName(),\n 'contentType' => 'application/pdf',\n ]);\n\n $invoice->setIsSent(true);\n\n try {\n $this->log(\"Try to send document of Invoice (ID: {$invoiceData['id']}) to members.\", [\n 'send_to' => $sendTo,\n 'send_cc' => $sendCc,\n ]);\n $this->em->persist($invoice);\n $this->mailer->send(\"КРОС-2019: \".$invoiceData['org_name'], ['header' => 'Вам выставлен счет.'], $sendTo, $sendCc, $this->invoiceBccEmails);\n $this->em->flush();\n\n $this->log(\"Document of Invoice (ID: {$invoiceData['id']}) has been sent.\");\n } catch (\\Exception $e) {\n $this->log(\"Catch error while send Invoice (ID: {$invoiceData['id']}). Error: {$e->getMessage()}.\");\n }\n\n $this->mailer->clearAttachments();\n }\n }\n }",
"private function sendInvoiceEmail()\n {\n // We can't send an invoice if we don't know the current transaction\n if (!isset($this->_postArray['brq_transactions'])) {\n return;\n }\n\n /** @var Mage_Sales_Model_Resource_Order_Invoice_Collection $invoiceCollection */\n $invoiceCollection = $this->_order->getInvoiceCollection()\n ->addFieldToFilter('transaction_id', array('eq' => $this->_postArray['brq_transactions']))\n ->setOrder('entity_id', Mage_Sales_Model_Resource_Order_Invoice_Collection::SORT_ORDER_DESC);\n\n /** @var Mage_Sales_Model_Order_Invoice $invoice */\n $invoice = $invoiceCollection->getFirstItem();\n\n if ($invoice->getId() && !$invoice->getEmailSent()) {\n $comment = $this->getNewestInvoiceComment($invoice);\n\n $invoice->sendEmail(true, $comment)\n ->setEmailSent(true)\n ->save();\n }\n }",
"public function cashInvoicesEmailDocumentPostAsyncWithHttpInfo($authorization, $send_email_coppies)\n {\n $returnType = '\\OpenAPI\\Client\\Model\\SendEmailResponse';\n $request = $this->cashInvoicesEmailDocumentPostRequest($authorization, $send_email_coppies);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function billingNotesEmailDocumentPostAsyncWithHttpInfo($authorization, $send_email_coppies)\n {\n $returnType = '\\OpenAPI\\Client\\Model\\SendEmailResponse';\n $request = $this->billingNotesEmailDocumentPostRequest($authorization, $send_email_coppies);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function actionSendDocumentByEmail()\n {\n if (Yii::app()->request->isAjaxRequest && isset($_POST['email']) && isset($_POST['docId'])) {\n $docId = intval($_POST['docId']);\n $email = trim($_POST['email']);\n $email_array = Helper::splitEmails($email) ;\n if ($docId > 0 && $email != '' && Documents::hasAccess($docId)) {\n $document = Documents::model()->findByPk($docId);\n $condition = new CDbCriteria();\n $condition->condition = \"Document_ID='\" . $document->Document_ID . \"'\";\n $user = Users::model()->findByPk(Yii::app()->user->userID);\n $file = Images::model()->find($condition);\n\n $payment = Payments::model()->with('vendor', 'document', 'aps')->findByAttributes(array(\n 'Document_ID' => $docId,\n ));\n\n $vendor = $payment->vendor;\n $client = $vendor->client;\n\n $filePath = 'protected/data/docs_to_email/' . $file->File_Name;\n file_put_contents($filePath, stripslashes($file->Img));\n\n //send document(s)\n foreach ($email_array as $email_item) {\n Emails::logEmailSending(Yii::app()->user->clientID,Yii::app()->user->userID,Yii::app()->user->projectID,$email_item);\n Mail::sendDocument($email, $file->File_Name, $filePath, $client->company->Company_Name,$user);\n }\n\n //delete file\n unlink($filePath);\n\n echo 1;\n } else {\n echo 0;\n }\n }\n }",
"public function testSendInvoiceViaPost()\n {\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Establecer como confirmado el recibo de sueldo de la liquidacion | public function confirmar($id_legajo, $id_liquidacion) {
$r = array('error' => 0, 'mensaje' => '');
$this->db->set('id_liquidacion', (int)$id_liquidacion)
->set('id_legajo', (int)$id_legajo);
if( $this->db->insert('sitio_recibo_sueldo_digital.recibo_confirmado') )
{
// guardamos el log
$this->log_model->guardar($this->session->userdata('id_legajo'), 5);
$r['mensaje'] = 'Se confirmó el Recibo de Sueldo con éxito.';
}
else
{
$r['error'] = 1;
$r['mensaje'] = 'Nro: '.$this->db->_error_number().' - '.$this->db->_error_message();
}
return $r;
} | [
"function confirmar()\n {\n $_REQUEST['ano']=$this->ano;\n $_REQUEST['periodo']=$this->periodo;\n //verificar si el espacio ha sido cancelado\n $cancelado=$this->verificarCancelado($_REQUEST);\n if ($cancelado=='ok')\n {\n $retorno['mensaje']=\"El espacio academico ya ha sido cancelado. No se puede cancelar de nuevo\";\n $this->enlaceNoCancelar($retorno);\n }\n $_REQUEST['ano']=$this->ano;\n $_REQUEST['periodo']=$this->periodo;\n //verificar si el espacio ha sido reprobado\n $reprobado=$this->validacion->validarReprobado($_REQUEST);\n if ($reprobado=='ok')\n {\n $retorno['mensaje']=\"El espacio academico ha sido reprobado. No se puede cancelar.\";\n $this->enlaceNoCancelar($retorno);\n }\n //solicitar confirmacion de la cancelacion\n $this->solicitarConfirmacion('');\n }",
"public function requestaCanceladmin()\n\t{\n\t\t$datas = self::$data;\n\t\t$this->create_history($this->input->post('contract_id'), 7, 'BY ADMIN : ' . html_escape($this->input->post('messagetoBuyer', true)), '');\n\t\t$this->change_contract_status($this->input->post('contract_id'), 7);\n\t\t$invoice_id \t= $this->database->_get_single_data('tbl_contracts', array('contract_id' => $contract_id), 'invoice_id');\n\t\t$this->_change_invoice_status($invoice_id, 3);\n\t\t$this->database->_update_to_table('tbl_disputes', array('status' => 1), array('contract_id' => $this->input->post('contract_id')));\n\t\tif ($datas['settings'][0]['email_notifications'] === '1') {\n\t\t\t$this->email_op->_user_email_notification('accept-cancel', $this->input->post('contract_id'));\n\t\t}\n\t\tredirect($this->session->userdata('url'));\n\t\treturn;\n\t}",
"function verificarEspacioReprobado() {\n $reprobado=$this->validacion->validarReprobado($_REQUEST);\n if ($reprobado!='ok' && is_array($reprobado))\n {\n $_REQUEST['confirmacion']=\"reprobado\";\n $nombreEspacio=$this->consultarNombreEspacio();\n $mensaje=\"El estudiante en <b>Prueba Académica</b> no ha reprobado <b>\".$nombreEspacio.\"</b> código <b>\".$reprobado['espacio'].\"</b><br>\";\n $mensaje.=\" ¿Desea inscribirlo al estudiante?\";\n $this->solicitarConfirmacion($mensaje,$_REQUEST);\n }\n }",
"public function rejectInvitaion()\n\t{\n\t\t$data = $this->request->data;\n\t\t$id = $data['id'];\n\t\t\n\t\t//update the request as accepted\n\t\t$invite['Chat']['id'] = $id;\n\t\t\n\t\t//set status 1 as denied\n\t\t$invite['Chat']['status'] = 1;\n\t\t$invite['Chat']['pis_read'] = 1;\n\t\t$invite['Chat']['dis_read'] = 0;\n\t\t$result = $this->Chat->save($invite);\n\t\t\n\t\t//check for response\n\t\tif (!$result) {\n\t\t\techo \"false\";\n\t\t\texit;\n\t\t}\n\t\techo \"true\";\n\n\t\t//set notification\n\t\t$oldCount = $this->Session->read('oldCount');\n\t\tif ($oldCount>0) {\n\t\t\t$newCount = $oldCount-1;\n\t\t\t$this->Session->write('oldCount',$newCount);\n\t\t}\n\t\texit;\n\t}",
"public function confirm(): void\n {\n $this->confirmation = Timestamp::createNow();\n }",
"public function confirmPayment(): bool;",
"function confirmord()\n\t{\n\t\t$input \t= JFactory::getApplication()->input;\n\t\t$dbo \t= JFactory::getDbo();\n\n\t\t$oid \t\t= $input->getUint('oid', 0);\n\t\t$conf_key \t= $input->getString('conf_key');\n\t\t\n\t\tif (empty($conf_key))\n\t\t{\n\t\t\techo '<div class=\"vap-confirmpage order-error\">'.JText::_('VAPCONFORDNOROWS').'</div>';\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t$q = $dbo->getQuery(true)\n\t\t\t->select($dbo->qn(array('id', 'sid', 'status')))\n\t\t\t->from($dbo->qn('#__vikappointments_reservation'))\n\t\t\t->where(array(\n\t\t\t\t$dbo->qn('id') . ' = ' . $oid,\n\t\t\t\t$dbo->qn('conf_key') . ' = ' . $dbo->q($conf_key),\n\t\t\t));\n\n\t\t$dbo->setQuery($q, 0, 1);\n\t\t$dbo->execute();\n\n\t\tif (!$dbo->getNumRows())\n\t\t{\n\t\t\techo '<div class=\"vap-confirmpage order-error\">'.JText::_('VAPCONFORDNOROWS').'</div>';\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t$order = $dbo->loadObject();\n\n\t\tif ($order->status != 'PENDING')\n\t\t{\n\t\t\tif ($order->status == 'CONFIRMED')\n\t\t\t{\n\t\t\t\techo '<div class=\"vap-confirmpage order-notice\">'.JText::_('VAPCONFORDISCONFIRMED').'</div>';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\techo '<div class=\"vap-confirmpage order-error\">'.JText::_('VAPCONFORDISREMOVED').'</div>';\n\t\t\t}\n\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t$q = $dbo->getQuery(true)\n\t\t\t->update($dbo->qn('#__vikappointments_reservation'))\n\t\t\t->set($dbo->qn('status') . ' = ' . $dbo->q('CONFIRMED'))\n\t\t\t->where(array(\n\t\t\t\t$dbo->qn('id') . ' = ' . $oid,\n\t\t\t\t$dbo->qn('id_parent') . ' = ' . $oid,\n\t\t\t), 'OR');\n\n\t\t$dbo->setQuery($q);\n\t\t$dbo->execute();\n\n\t\t// the status has been altered, we can track it\n\t\tVAPOrderStatus::getInstance()->keepTrack('CONFIRMED', $oid, 'VAP_STATUS_CONFIRMED_WITH_LINK');\n\t\t//\n\t\t\n\t\techo '<div class=\"vap-confirmpage order-good\">'.JText::_('VAPCONFORDCOMPLETED').'</div>';\n\t\t\n\t\t$order_details = VikAppointments::fetchOrderDetails($oid, $order->sid);\n\t\tVikAppointments::sendCustomerEmail($order_details);\n\t\t////////\n\t\t$order_details_original = VikAppointments::fetchOrderDetails($order_details[0]['id'], $order_details[0]['sid'], VikAppointments::getDefaultLanguage('site'));\n\t\tVikAppointments::sendAdminEmail($order_details_original);\n\t}",
"public function actionRequestcompletion(){\n if(isset($_GET['id'])){\n $id = (int) $_GET['id'];\n $accepted = AcceptedOrders::findOne($id);\n $accepted->complete_request = 1;\n $accepted->complete_request_date = date('Y-m-d H:i:s', time());\n if($accepted->validate()){\n $notification = new Notification;\n $notification->user_id = $accepted->user_id;\n $notification->source = \\Yii::$app->user->getId();\n $notification->notification = Users::findOne(Yii::$app->user->getId())->display_name . ' requested you to close the task.';\n $notification->datetimestamp = date('Y-m-d H:i:s', time());\n $notification->type = 'close_task_request';\n $notification->post_id = $accepted->order_id;\n if($notification->validate()){\n $accepted->save();\n $notification->save();\n echo \"true\";\n }else{\n echo \"false\";\n }\n }else{\n echo \"false\";\n }\n }\n }",
"public function confirm() {\n\t\t\t\n\t\t\t$this->status = 'confirmed';\n\t\t\t$this->save();\n\t\t}",
"function confirm($inviteid) {\n $this->process_invite($inviteid, true);\n }",
"public function onConfirmPayment()\n {\n $data = post();\n\n try{\n\n $order = Order::whereOrderNo($data['order_no'])->first();\n\n if(!$order) {\n throw new \\ApplicationException(\"Order doesn't exist\");\n } else if(Confirm::whereOrderNo($data['order_no'])->exists()) {\n throw new \\ApplicationException(\"You have confirmed your payment before, we will tell you if your payment has been confirmed.\");\n // \\Log::info(Confirm::whereOrderNo($data['order_no'])->exists());\n } else if($order->status_code != \"waiting\") {\n throw new \\ApplicationException(\"Your order has been paid\");\n } else if($order->invoice->payment_method->name != \"Bank Transfer\") {\n throw new \\ApplicationException(\"Your order didn't use bank transfer method\");\n } else {\n if($confirm = Confirm::create($data)) {\n $paymentConfirmation = $order->payment_confirmation()->orderBy('created_at', 'DESC')->first();\n Mail::send('octobro.banktransfer::mail.payment_confirmation', compact('order', 'paymentConfirmation'), function($message) use($order) {\n $message->to($order->email, $order->name);\n $message->subject('Konfirmasi Pembayaran anda [#'.$order->order_no.']');\n });\n }\n\n Flash::success($this->property(\"successMessage\"));\n return Redirect::to(Page::url($this->property('redirectPage')));\n }\n\n } catch(Exception $e) {\n throw new \\ApplicationException(\"Your order is not valid\");\n }\n }",
"public function sendConfirmationOfReceipt() {\n global $smarty, $user, $language;\n\n $smarty->assign('user', $user);\n $smarty->assign('cart', $this);\n $smarty->assign('date', new DateTime());\n\n $mailOutput = $smarty->fetch('mail_' . $language . '_receipt.tpl');\n mail($user->getUsername(), \"Plants for your Home\", $mailOutput, \"From: plants-for-your-home@no-host\");\n }",
"public function decline() {\n header('Content-type: application/json');\n $requestId = input(\"requestid\");\n Database::table(\"requests\")->where(\"id\", $requestId)->update(array(\"status\" => \"Declined\"));\n $request = Database::table(\"requests\")->where(\"id\", $requestId)->first();\n $sender = Database::table(\"users\")->where(\"id\", $request->sender)->first();\n $documentLink = env(\"APP_URL\").\"/document/\".$request->document;\n $send = Mail::send(\n $sender->email, \"Signing invitation declined by \".$request->email,\n array(\n \"title\" => \"Signing invitation declined.\",\n \"subtitle\" => \"Click the link below to view document.\",\n \"buttonText\" => \"View Document\",\n \"buttonLink\" => $documentLink,\n \"message\" => $request->email.\" has declined the signing invitation you had sent. Click the link above to view the document.<br><br>Thank you<br>\".env(\"APP_NAME\").\" Team\"\n ),\n \"withbutton\"\n );\n $actionTakenBy = escape($request->email);\n /*\n * Check, whether IP address register is allowed in .env\n * If yes, then capture the user's IP address\n */\n if (env('REGISTER_IP_ADDRESS_IN_HISTORY') == 'Enabled') {\n $actionTakenBy .= ' ['.getUserIpAddr().']';\n }\n $activity = '<span class=\"text-primary\">'.$actionTakenBy.'</span> declined a signing invitation of this document.';\n Signer::keephistory($request->document, $activity, \"default\");\n $notification = '<span class=\"text-primary\">'.escape($request->email).'</span> declined a signing invitation of this <a href=\"'.url(\"Document@open\").$request->document.'\">document</a>.';\n Signer::notification($sender->id, $notification, \"decline\");\n if (!$send) { exit(json_encode(responder(\"error\", \"Oops!\", $send->ErrorInfo))); }\n exit(json_encode(responder(\"success\", \"Declined!\", \"Request declined and sender notified.\",\"reload()\")));\n }",
"public function testPositiveAutoPaymentRequestConfirm()\n {\n $data = $this->getPositivePaymentRequest();\n $data['head']['external']['order_id'] = 'A12345';\n $this->json('POST', 'trx', $data, $this->_positive_header)\n ->seeJson([\"successful\" => true, \"reason_message\" => \"Request successful\"]);\n }",
"public function actionConfirm()\n {\n $this->checkDetails();\n }",
"public function confirm() {\n\n\t\t//Use false to prevent valid boolean to get deleted\n\t\t$cart = retinashopCart::getCart();\n\t\tif ($cart) {\n\t\t\t$cart->confirmDone();\n\t\t\t$view = $this->getView('cart', 'html');\n\t\t\t$view->setLayout('order_done');\n\t\t\t// Display it all\n\t\t\t$view->display();\n\t\t} else {\n\t\t\t$mainframe = JFactory::getApplication();\n\t\t\t$mainframe->redirect(JRoute::_('index.php?option=com_retinashop&view=cart'), RText::_('COM_RETINASHOP_CART_DATA_NOT_VALID'));\n\t\t}\n\t}",
"public function confirm_delivery(Request $request)\n {\n $trans_id = $request->transaction_id;\n $tracking_number = $request->tracking_number;\n $couriers = Courier::where('transaction_id', $trans_id);\n $update_couriers = $couriers->update([\n 'confrim' => 1,\n 'tracking_number' => $tracking_number\n ]); \n\n if($update_couriers){\n\n $user = DB::table('order_confirm_view')\n ->where('transaction_id', $trans_id)\n ->first();\n\n $detail_order = DB::table('order_detail_view')\n ->where('id', $trans_id)\n ->get();\n \n // This for send mails if Admin has been cofirm Tracking Delivery the reques order\n event(new CourierConfirm($user, $detail_order));\n \n \\Session::flash('success', 'Konfirmasi Pengiriman Berhasil dan Email Terkirim ke Customer');\n return redirect()->route('admin.transaksi_delivery');\n }else{\n \\Session::flash('failled', 'Konfirmasi Pengiriman Gagal dan Email tidak Terkirim ke Customer');\n return redirect()->route('admin.transaksi_delivery');\n }\n\n }",
"function petitionPaymentCancel()\n\t\t{\t\t\t\t\t\t\t\t\n\t\t\tglobal $_CONF;\t\t\t\n\t\t\t$article_id = trim($_REQUEST[\"article_id\"]);\n\t\t\t$visitor_id = base64_decode(trim($_REQUEST[\"visitor_id\"]));\t\t\t\n\t\t\t$rs = $this->oModel->setUserTypeOneTimeSubscriber($visitor_id);\t\t\t\n\t\t\theader(\"location:./index.php?stage=visitor&mode=EmailMessage&message=Sign up completed but error in petition payment.\");\t\t\t\n\t\t\tdie();\t\t\t\t\n\t\t}",
"public function confirm($id)\r\n {\r\n $id = base64_decode($id);\r\n $contact = Contact::findOrFail($id);\r\n\r\n // If user tries to access the link again then no need to confirm again or send email.\r\n if($contact->confirmed == 'No') {\r\n $contact->fill(['confirmed' => 'Yes'])->save(); // update contact data\r\n\r\n // send email to subscriber and notifiy to list admin\r\n $contact->notify(new ContactAdded('welcome-email', 'confirm', 'notify-email-contact-confirm'));\r\n \\Artisan::call('queue:work', ['--once' => true]); // execute queue\r\n activity('confirm')->withProperties(['app_id' => $contact->app_id])->log(__('app.contact') . \" ({$contact->email}) \". __('app.log_confirm')); // log\r\n }\r\n \r\n return redirect()->route('page.show', ['slug' => 'thankyou', 'id' => base64_encode($id)]);\r\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set the trs code tarif2 sens. | public function setTrsCodeTarif2Sens(?string $trsCodeTarif2Sens): Clients2 {
$this->trsCodeTarif2Sens = $trsCodeTarif2Sens;
return $this;
} | [
"public function setTrsCodeTarif5Sens($trsCodeTarif5Sens) {\n $this->trsCodeTarif5Sens = $trsCodeTarif5Sens;\n return $this;\n }",
"public function setTrsCodeTarif3Sens($trsCodeTarif3Sens) {\n $this->trsCodeTarif3Sens = $trsCodeTarif3Sens;\n return $this;\n }",
"public function getTrsCodeTarif4Sens() {\n return $this->trsCodeTarif4Sens;\n }",
"public function getTrsCodeTarif6Sens() {\n return $this->trsCodeTarif6Sens;\n }",
"public function setTrsCodeTarif4Sens($trsCodeTarif4Sens) {\n $this->trsCodeTarif4Sens = $trsCodeTarif4Sens;\n return $this;\n }",
"public function setTbLivroSinopse($tbLivroSinopse){\n\t$this->tbLivroSinopse = $tbLivroSinopse;\n}",
"public function setTarif2($PTarif2)\n {\n $this->tarif2 = $PTarif2;\n }",
"function setSecondTaxRateId($value) {\n return $this->setFieldValue('second_tax_rate_id', $value);\n }",
"public function setTrsCodeTarif6(?string $trsCodeTarif6): Clients2 {\n $this->trsCodeTarif6 = $trsCodeTarif6;\n return $this;\n }",
"public function setTrsCodeTarif4(?string $trsCodeTarif4): Clients2 {\n $this->trsCodeTarif4 = $trsCodeTarif4;\n return $this;\n }",
"public function setSiret(int $siret) {\n $this->_siret = $siren;\n }",
"public function getTrsCodeTarif3Sens() {\n return $this->trsCodeTarif3Sens;\n }",
"public function testSetCodeIntitContratTrav() {\n\n $obj = new EmpDadsuGene();\n\n $obj->setCodeIntitContratTrav(\"codeIntitContratTrav\");\n $this->assertEquals(\"codeIntitContratTrav\", $obj->getCodeIntitContratTrav());\n }",
"function setSf_sv($isf_sv = '')\n {\n $this->isf_sv = $isf_sv;\n }",
"public function setTwoFactorCode(): void\n {\n $this->twoFactorToken = '';\n for ($i = 0; $i < 6; ++$i) {\n $this->twoFactorToken .= random_int(0, 9);\n }\n }",
"function setLSCCode($code)\n {\n $this->__lsccode = $code ;\n }",
"private function changesku(){\t \r\n\t $this->chartValue(); //adding to output\r\n\t $this->idleStHealthChk(); //adding to output\r\n\t}",
"public function testSetPrixNetTr2() {\n\n $obj = new Tarifs();\n\n $obj->setPrixNetTr2(true);\n $this->assertEquals(true, $obj->getPrixNetTr2());\n }",
"public function testSetCodeContratTrav() {\n\n $obj = new EmpDadsuGene();\n\n $obj->setCodeContratTrav(\"codeContratTrav\");\n $this->assertEquals(\"codeContratTrav\", $obj->getCodeContratTrav());\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get scanned old files | public function getScannedOldFiles()
{
return $this->scannedOldFiles;
} | [
"public function getOldFiles();",
"protected function getOldFiles() {\n\t\t$cutOfTime = time() - 3600;\n\t\t$files = [];\n\t\t$dh = opendir($this->tmpBaseDir);\n\t\tif ($dh) {\n\t\t\twhile (($file = readdir($dh)) !== false) {\n\t\t\t\tif (substr($file, 0, 7) === self::TMP_PREFIX) {\n\t\t\t\t\t$path = $this->tmpBaseDir . '/' . $file;\n\t\t\t\t\t$mtime = filemtime($path);\n\t\t\t\t\tif ($mtime < $cutOfTime) {\n\t\t\t\t\t\t$files[] = $path;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $files;\n\t}",
"function scanFiles(){\n $this->filesSeen = [];\n\t\t$this->filesSeenThumb = [];\n\t\t\n foreach (scandir($this->folderGrabs) as $fname){\n if (strpos($fname,\".fail.\")) continue;\n if (count(explode(\".\",$fname))<4) continue;\n $this->filesSeen[]=$fname;\n }\n sort($this->filesSeen);\n\t\t\n foreach (scandir($this->folderThumbs) as $fname){\n if (strpos($fname,\".fail.\")) continue;\n if (count(explode(\".\",$fname))<4) continue;\n $this->filesSeenThumb[]=$fname;\n }\n sort($this->filesSeenThumb);\n }",
"function prev_files(){\n\tglobal $sleep;\n\t$files_list = array();\n\t$scan_dir = scandir(OUTPUT_FOLDER, 1);\n\t$prev_file = isset($scan_dir[0]) ? $scan_dir[0] : '';\n\tif(empty($prev_file) || $prev_file == '.' || $prev_file == '..'){\n\t\treturn $files_list;\n\t}\n\t$prev_file = OUTPUT_FOLDER.'/'.$prev_file;\n\tif(file_exists($prev_file)){\n\t\t$available_list = $dir_lists = array();\n\t\t$file_content = file_get_contents($prev_file);\n\t\t$json = json_decode($file_content);\n\t\tforeach($json as $file_info){\n\t\t\t$file = $file_info->file;\n\t\t\tif(!is_dir($file)){\n\t\t\t\t$dir_array = explode('/',$file);\n\t\t\t\t$dir_count = count($dir_array);\n\t\t\t\t$dir_list = '';\n\t\t\t\tfor($x = 0; $x < $dir_count - 1; $x++){\n\t\t\t\t\t$dir_list .= $dir_array[$x].'/';\n\t\t\t\t}\n\t\t\t\tif(!in_array($dir_list,$dir_lists)){\n\t\t\t\t\tarray_push($dir_lists,$dir_list);\n\t\t\t\t}\n\t\t\t}\n\t\t\t$info = $file_info->info;\n\t\t\t$dt = array();\n\t\t\tforeach($info as $key=>$val){\n\t\t\t\t$dt[$key] = $val;\n\t\t\t}\n\t\t\t$data = array(\n\t\t\t\t'file'=>$file,\n\t\t\t\t'info'=>$dt\n\t\t\t);\n\t\t\tarray_push($files_list,$data);\n\t\t}\n\t\tif(count($dir_lists) > 0){\n\t\t\t//See if we have directories that are not listed as scanned from previous scan\n\t\t\tforeach($dir_lists as $dir){\n\t\t\t\tif(array_multi_search($files_list,'file',$dir)){\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t$dir_stat = stat($dir);\n\t\t\t\t$dt = array();\n\t\t\t\tforeach($dir_stat as $key=>$val){\n\t\t\t\t\t$dt[$key] = $val;\n\t\t\t\t}\n\t\t\t\t$data = array(\n\t\t\t\t\t'file'=>$dir,\n\t\t\t\t\t'info'=>$dt\n\t\t\t\t);\n\t\t\t\tarray_push($files_list,$data);\n\t\t\t}\n\t\t}\n\t}\n\treturn $files_list;\n}",
"public function getOldFileOffenders()\n\t{\n\t $this->load->model('cleanup','',FALSE);\n\t $this->load->model('configuration');\n\t $dbList = $this->configuration->getDBList();\n\t foreach($dbList->result() as $db) {\n\t \t//if($db == \"som\") {\n\t \techo \"Starting Old File Detection For: \".$db->friendlyName;\n\t \techo \"<br />\";\n\t \t$this->cleanup->getOldFiles($db->dbGroup,$db->fullpath,$db->fsInodeNumber,$db->friendlyName);\n\t \techo \"<hr /><br />\";\n\t //}\n\t }\n\t //$this->cleanup->sendNotices(\"oldfile\");\n\t}",
"public function getObsoleteFiles() { return array(); }",
"public function getChangedFiles() : array\n {\n $oldFileList = $this->fileCache;\n\n /** @var array<int, string> $changedFileList */\n $changedFileList = [];\n\n /** @var array<string, int> $newFullFileList*/\n $newFullFileList = [];\n\n foreach ($this->createFileFinder() as $file) {\n $newFullFileList[$file->getPathname()] = $file->getMTime();\n if (array_key_exists($file->getPathname(), $oldFileList) &&\n $oldFileList[$file->getPathname()] === $file->getMTime()\n ) {\n continue;\n }\n\n $changedFileList[] = $file->getPathname();\n }\n $this->fileCache = $newFullFileList;\n\n return $changedFileList;\n }",
"function get_list_of_not_new_files() {\n $result = $this->pdo->query('SELECT * FROM files WHERE newfile = 0 AND flaggedfile = 0 ORDER BY date DESC');\n return $result;\n }",
"public function getFilesToCheck() {\r\n\t\tglobal $PIE_DIR;\r\n\t\tglobal $REFRESHER_FILE;\r\n\t\tglobal $REFRESHER_FILES;\r\n\r\n\t\tif (isset($REFRESHER_FILE) && file_exists($REFRESHER_FILE)) {\r\n\t\t\treturn array($REFRESHER_FILE);\r\n\t\t}\r\n\t\telse {\r\n\t\t\t$REFRESHER_FILES = array();\r\n\r\n\t\t\t/**\r\n\t\t\t * Add a file to an associative array of file paths and modified times.\r\n\t\t\t * @param $path: the path of the file to check.\r\n\t\t\t * @return true to continue.\r\n\t\t\t */\r\n\t\t\tfunction addFile($path) {\r\n\t\t\t\tglobal $REFRESHER_FILES;\r\n\t\t\t\tif (strpos($path, '/.') === false\r\n\t\t\t\t\t&& substr($path, -4) != '.log'\r\n\t\t\t\t\t&& substr($path, -11) != '.cache.html') {\r\n\t\t\t\t\t// Add the file and its modified time.\r\n\t\t\t\t\t$REFRESHER_FILES[$path] = FileUtility::getModifiedTime($path);\r\n\t\t\t\t}\r\n\t\t\t\t// Keep walking.\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\r\n\t\t\t// Walk through the Pie directory looking for the most recently modified files.\r\n\t\t\tDirectoryUtility::walk($PIE_DIR, 'addFile');\r\n\r\n\t\t\t// Sort files in descending order of modified time.\r\n\t\t\tarsort($REFRESHER_FILES);\r\n\r\n\t\t\t// Return the 10 most recently modified files.\r\n\t\t\treturn array_keys(array_slice($REFRESHER_FILES, 0, 10));\r\n\t\t}\r\n\t}",
"public function getModifiedFiles();",
"function get_list_of_new_files() {\n $result = $this->pdo->query('SELECT * FROM files WHERE newfile = 1 ORDER BY date DESC');\n return $result;\n }",
"private function getNewFunctionFiles(): array\n {\n return array_filter(scandir($this->functionPath), [$this, 'excludeInvalidFiles']);\n }",
"public function getSkippedOldFiles()\n {\n return $this->skippedOldFiles;\n }",
"public function getOldPullRequests() {\n $return = array();\n $dir = array_filter(scandir($this->config->getValue('data_dir')) , __CLASS__.'::filterPullRequestFiles');\n foreach ($dir as $file) {\n $return[str_replace('.json', '', $file)] = json_decode(file_get_contents($this->config->getValue('data_dir') . '/' .\n $file));\n }\n return $return;\n }",
"public function getRemovedFiles() {\n\t\t$fileNew = $this->getFile();\n $fileOld = AddonManager::getLocalFile($this->aid);\n\n\t\t$zipNew = new \\ZipArchive();\n\t\t$zipOld = new \\ZipArchive();\n $resNew = $zipNew->open($fileNew);\n $resOld = $zipOld->open($fileOld);\n\n if($resNew === TRUE && $resOld === TRUE) {\n\t\t\t$newFiles = array();\n for ($i = 0; $i < $zipNew->numFiles; $i++) {\n $newFiles[] = $zipNew->getNameIndex($i);\n }\n\n\t\t\t$oldFiles = [];\n for ($i = 0; $i < $zipOld->numFiles; $i++) {\n $oldFiles[] = $zipOld->getNameIndex($i);\n }\n\n\t\t\t$removed = array_diff($oldFiles, $newFiles);\n\t\t\t$removed = array_diff($removed, ['glass.json', 'version.json', 'namecheck.txt']);\n\t\t\treturn $removed;\n } else {\n return [\n\t\t\t\t\"status\" => \"error\",\n\t\t\t\t\"new\" => $resNew,\n\t\t\t\t\"old\" => $resOld\n\t\t\t];\n }\n\t}",
"function etbx_scan_update_files($module) {\n $updates_path = module_updates_dir_path($module);\n\n return file_scan_directory($updates_path, RGX__ETBX_UPDATE_FILE);\n}",
"function findAllTouchedFiles( $the_dir, $the_array, $date_modified, $filter=''){\n if(!is_dir($the_dir)) {\n return $the_array;\n }\n $d = dir($the_dir);\n while (false !== ($f = $d->read())) {\n if( $f == \".\" || $f == \"..\" ){\n continue;\n }\n if( is_dir( \"$the_dir/$f\" ) ){\n // i think depth first is ok, given our cvs repo structure -Bob.\n $the_array = findAllTouchedFiles( \"$the_dir/$f\", $the_array, $date_modified, $filter);\n }\n else {\n $file_date = date('Y-m-d H:i:s', strtotime(date('Y-m-d H:i:s', filemtime(\"$the_dir/$f\"))) - date('Z'));\n\n if(strtotime($file_date) > strtotime($date_modified) && (empty($filter) || preg_match($filter, $f))){\n array_push( $the_array, \"$the_dir/$f\");\n }\n }\n }\n return $the_array;\n}",
"public function findNewestFiles() {\r\n //clearstatcache(); // Otherwise it may select wrong name\r\n $numFiles = count($this->files);\r\n if ($this->files == NULL or $numFiles == 0) {\r\n return NULL;\r\n }\r\n $newestNameList = array($this->files[0]);\r\n $newestTime = filemtime($this->files[0]);\r\n //echo $this->files[0].\": $newestTime\\n\";\r\n for ($i = 1; $i < $numFiles; $i++) {\r\n $name = $this->files[$i];\r\n $mtime = filemtime($name);\r\n //echo \"$name: $mtime\\n\";\r\n if ($newestTime < $mtime) { //then start fresh\r\n $newestNameList = array($name);\r\n $newestTime = $mtime;\r\n } else if($newestTime === $mtime) {\r\n $newestNameList[] = $name;\r\n }\r\n }\r\n return $newestNameList;\r\n }",
"function getAllPreviousKorbenSourceFiles($client)\r\n{\r\n $client_source_path=constant($client.\"_SOURCE_PATH\");\r\n $client_config_file=constant($client.\"_CONFIG_FILE\");\r\n \r\n $pattern = $client_source_path.'/'.$client.'*.*';\r\n $arraySource = glob($pattern); \r\n //sort($arraySource);\r\n usort($arraySource, function($a, $b) {\r\n return filemtime($a) < filemtime($b);\r\n });\r\n return $arraySource;\r\n \r\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return password recovery token by it's value. | public function getPasswordRecoveryToken($token) {
/** @var Token $tokenClass */
$tokenClass = $this->module->tokenModel;
return $tokenClass::findByToken($token, $tokenClass::TYPE_PASSWORD_RECOVERY);
} | [
"public function generateTwoFactorToken(): Token;",
"public function generate_recovery_mode_token() {}",
"private function getToken()\n\t{\n\t\t// Create database object and check that token matches that of the user stored in the db\n\t\t$db = App::get('db');\n\t\t$db->setQuery('SELECT id, params FROM `#__users` WHERE block = 0 AND username = ' . $db->Quote($this->user->get('username')));\n\n\t\treturn $db->loadObject();\n\t}",
"public function getTokenpassword()\n {\n return $this->tokenpassword;\n }",
"public function getEncryptedTokenFromEncryptedValue($value);",
"public function getResetPasswordToken();",
"private function getTokenValue(): string\n {\n return $this->session_handler->getSessionValue(\n $this->form_name,\n $this->token_prefix\n );\n }",
"public function getTokenPassword()\n {\n return $this->tokenPassword;\n }",
"public function getPasswordResetToken();",
"static function tokenValue()//value to be used in form\n {\n \tif(!isset($_SESSION[\"rvalue\"]))\n \t\t$_SESSION[\"rvalue\"]=self::randomToken();\n \treturn $_SESSION[\"rvalue\"];\n }",
"public function getEncryptedTokenFromPlainValue($value);",
"public function generate_recovery_mode_token()\n {\n }",
"public function generatePasswordRecoveryId(): string;",
"public function getRegistrationPassword();",
"protected function getToken()\n {\n return $this->app['encryptor']->getToken();\n }",
"protected function value_xsrf_guard()\n\t{\n\t\t$x = $this->xsrf_guard();\n\t\tif ( $x )\n\t\t\treturn $x->token();\n\t}",
"function sapistats_get_token_orig($value = '') {\n return drupal_hmac_base64($value, drupal_get_private_key() . drupal_get_hash_salt());\n}",
"public function getTokenKey()\n {\n return Mage::getStoreConfig('alliance_fivehundredfriends/access_credentials/token_key');\n }",
"public static function getResetTokenField(): string;"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Validates the Score Section element | public function isValidScoreSection($section)
{
$this->pushDebugStr(__METHOD__, 1);
if(count($section) == 0)
{
$this->pushErrorId(CLQL_STATUS_INVALID_SCORE_FIELD);
$this->pushErrorId(CLQL_STATUS_EMPTY_SECTION);
return false; // empty section
}
foreach($section as $key => $value)
{
// only field names with scalars here
if(is_array($value))
{
$this->pushErrorStr('-->`' . $key . '` Score Value Can\'t be an array or structure');
$this->pushErrorId(CLQL_STATUS_INVALID_SCORE_FIELD);
return false;
}
if(!$this->isScoreableField($key))
{
$this->pushErrorStr('-->`'. $key .'`');
$this->pushErrorId(CLQL_STATUS_INVALID_SCORE_FIELD);
return false;
}
// add float type check if needed
if(!is_int($value))
{
$this->pushErrorStr('-->`'. $value . '` ' . gettype($value) . ' Found, Expecting Integer');
$this->pushErrorId(CLQL_STATUS_ERROR_INT_EXPECTED);
$this->pushErrorId(CLQL_STATUS_INVALID_SCORE_FIELD);
return false;
}
}
return true;
} | [
"public function validate(array $section);",
"function validateSectionTag() {\n\t\n\t\t$validateValue=$_REQUEST['fieldValue'];\n\t\t$validateId=$_REQUEST['fieldId'];\n\t\t\n\t\t$quoteid = $_REQUEST['Edit-quoteid'];\n\t\t$pheight = $_REQUEST['Edit-pheight'];\n\t\tif($pheight==\"\")\n\t\t{$event=\"create\";}\n\t\telse\n\t\t{$event=\"edit\";}\n\t\t\n\t\t$validateError= \"This Tag is already assigned\";\n\t\t$validateSuccess= \"Tag is available\";\n\t\t\n\t\t/* RETURN VALUE */\n\t\t$arrayToJs = array();\n\t\t$arrayToJs[0] = $validateId;\n\t\t\n\t\t//Lookup duplicate entries for section tag\n\t\tif($event==\"create\")\n\t\t{\n\t\t$sql=\"SELECT id FROM fresco_costing_frontarray WHERE sectiontag = '\".$validateValue.\"' AND quoteid = '\".$quoteid.\"'\";\t\t\n\t\t$result = mysql_query($sql);\n\t\t\n\t\t\n\t\t//Set the flag if duplicate exist\n\t\twhile($row = mysql_fetch_array($result))\n\t\t {\n\t\t\tIf($row['id'])\n\t\t\t$duplicate = \"yes\";\n\t\t }\n\t\t\n\t\t}\n\t\t//Return Array with success/failure\n\t\tif($duplicate <>\"yes\"){\t\t// validate??\n\t\t\t$arrayToJs[1] = true;\t\t\t// RETURN TRUE\n\t\t\techo json_encode($arrayToJs);\t\t\t// RETURN ARRAY WITH success\n\t\t}else{\n\t\t\tfor($x=0;$x<1000000;$x++){\n\t\t\t\tif($x == 990000){\n\t\t\t\t\t$arrayToJs[1] = false;\n\t\t\t\t\t\n\t\t\t\t\techo json_encode($arrayToJs);\t\t// RETURN ARRAY WITH ERROR\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t}",
"private function valid_section($section){\n\t\tswitch ($section) {\n\t\t\tcase \"highscore\":\n\t\t\tcase \"alliances\":\n\t\t\tcase \"players\":\n\t\t\tcase \"playerData\":\n\t\t\tcase \"universe\":\n\t\t\tcase \"serverData\":\n\t\t\t\treturn true;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\treturn false; // if the name isn'T a valid section, stop here.\n\t\t\t\tbreak;\n\t\t}\n\t}",
"public function validatePoints()\n {\n if ( $this->points_awarded > 100 ) {\n $this->addError('points_awarded', 'Marks should be less than a hundred');\n }\n }",
"public function validateSection($data, $section) {\n $pass = true;\n if (!empty($this->sectionValidation[$section])) {\n $modelValidation = $this->validate;\n $this->validate = $this->sectionValidation[$section];\n $this->set($data);\n if (!$this->validates()) {\n $pass = false;\n }\n $this->validate = $modelValidation;\n }\n return $pass;\n }",
"public function validate ()\n\t{\n\t\tif ($this->ruleset !== false) {\n\t\t}\n\t}",
"public function validateElements(){\n\t\t$this->_isValid = true;\n\t\t$values = $this->getParams();\n\t\t\n\t\t$this->recValidateElements($this->_elements, $values);\n\t}",
"public function isValid()\n {\n if ($this->get('page-template')->getValue() == 'blank') {\n $this->setValidationGroup(\n [\n 'url',\n 'title',\n 'main-layout',\n ]\n );\n } else {\n $this->setValidationGroup(\n [\n 'url',\n 'title',\n 'page-template',\n ]\n );\n }\n\n return parent::isValid();\n }",
"public function isValid()\n {\n $docType = get_class($this->source);\n if (isset($this->options['required'][$docType])) {\n $this->validateTags($docType);\n } else if (isset($this->options['required']['__ALL__'])) {\n $this->validateTags('__ALL__');\n }\n }",
"protected function checkScore()\n {\n $validScores = array(\n 25, 20, 19,\n 18, 17, 16,\n 15, 14, 13,\n 12, 11, 10,\n 9, 8, 7,\n 6, 5, 4,\n 3, 2, 1,\n 0\n );\n\n if (!in_array($this->getScore(), $validScores)) {\n throw InvalidArrowException::invalidScore($this->getScore());\n }\n }",
"protected function validateSummary()\n {\n $this->validator->sometimes(['summary_en', 'summary_fr'], 'required', function () {\n return ! empty($this->operationalDetails->summary_content);\n });\n }",
"public function validate() {\n//\t\tif( intval($this->params[\"startYear\"] < date(\"yyyy\"))) $this->add_validation_error(\"Season cannot exist in the past.\");\n\t}",
"public function validate(string $content):bool {\n\t\t\t\\preg_match($this->pattern, $content, $matches, \\PREG_OFFSET_CAPTURE);\n\n\t\t\tif (\\count($matches) == 2) {\n\t\t\t\t$this->isValid = true;\n\t\t\t\t$this->sectionStart = $matches[0][1];\n\t\t\t\t$this->sectionLength = \\strlen($matches[0][0]);\n\t\t\t\t$this->content = $matches[1][0];\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t}",
"protected function validateSectionType()\n\t\t{\n\t\t\tif( !isset( $this->rules['sectionType'] ) )\n\t\t\t\treturn true;\n\n\t\t\tif( !is_array( $this->rules['sectionType'] ) )\n\t\t\t\t$this->rules['sectionType'] = [ $this->rules['sectionType'] ];\n\n\t\t\tif( in_array( $this->section->type, $this->rules['sectionType'] ) )\n\t\t\t\treturn true;\n\n\t\t\treturn false;\t\n\t\t}",
"public static function validateSectionsName()\n\t{\n\t\treturn array(\n\t\t\tnew Entity\\Validator\\Length(null, 100),\n\t\t);\n\t}",
"protected function _validate()\n {\n if (empty($this->layout)) {\n $this->addError('layout', __('A layout must be provided for each exhibit page.'));\n }\n\n if (!strlen($this->title)) {\n $this->addError('title', __('Exhibit pages must be given a title.'));\n }\n\n }",
"private function validateSection($criterion, $criterionid) {\n\t\t// A section has to have an array of criteria\n\t\tif(!isset($criterion->criteria)) {\n\t\t\t$this->error(\"'section' is missing property 'criteria'\");\n\t\t} else {\n\t\t\t$this->validateCriteriaCollection($criterion->criteria, $criterionid);\n\t\t}\n\t}",
"protected function validateElementValues() {\n\t\t}",
"public function validate()\n\t{\n\t\tif ($this->is_discount AND ! $this->price()->is(Jam_Price::LESS_THAN_OR_EQUAL_TO, 0))\n\t\t{\n\t\t\t$this->errors()->add('price', 'numeric_less_than_or_equal_to', array(':less_than_or_equal_to' => 0));\n\t\t}\n\n\t\tif ( ! $this->is_discount AND ! $this->price()->is(Jam_Price::GREATER_THAN_OR_EQUAL_TO, 0))\n\t\t{\n\t\t\t$this->errors()->add('price', 'numeric_greater_than_or_equal_to', array(':greater_than_or_equal_to' => 0));\n\t\t}\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Overridden template methods Initialize form data from the associated chapter. | function initData() {
AppLocale::requireComponents(LOCALE_COMPONENT_APP_DEFAULT, LOCALE_COMPONENT_PKP_SUBMISSION);
$monograph = $this->getMonograph();
$this->setData('submissionId', $monograph->getId());
$chapter = $this->getChapter();
if ($chapter) {
$this->setData('chapterId', $chapter->getId());
$this->setData('title', $chapter->getTitle());
$this->setData('subtitle', $chapter->getSubtitle());
} else {
$this->setData('title', null);
$this->setData('subtitle', null);
}
} | [
"abstract protected function prepareForm();",
"function load_from_form () {\n if (array_key_exists('request_id', $_POST)) {\n $this->request_id = $_POST['request_id'];\n }\n if (array_key_exists('author', $_POST)) {\n $this->author = $_POST['author'];\n }\n if (array_key_exists('date', $_POST)) {\n $this->date = $_POST['date'];\n }\n if (array_key_exists('text', $_POST)) {\n $this->text = $_POST['text'];\n }\n }",
"protected function prepareData()\n {\n $this->form = new CatSymbolForm();\n ;\n $this->customContent .= $this->form->apply();\n }",
"public function initialize_fields() {\n // set the fields to be filled in \n $this->fields = array(\"title\" => \"\",\n \"keywords\" => array(),\n \"filename\" => \"\",\n // advisor, committee and department will no longer be populated;\n // leaving empty arrays to avoid potential errors if any code is missed\n // that still expects these values\n \"department\" => \"\",\n \"advisor\" => array(), \n \"committee\" => array(), \n // table of contents will no longer be populated, since detection \n // and formatting is often incomplete and unreliable\n \"toc\" => \"\",\n // NOTE: abstract detection will be attempted since it abstract text\n // is used to clean the title, but abstract text may be incomplete or unreliable\n \"abstract\" => \"\",\n \"distribution_agreement\" => false);\n }",
"function readForm() {\n\t\t$this->ProductID = $this->formHelper(\"ProductID\", 0);\n\t\t$this->ProductNaam = $this->formHelper(\"ProductNaam\", \"\");\n\t\t$this->ProductEenheid = $this->formHelper(\"ProductEenheid\", \"\");\n\t}",
"public function builder_form_data() {\n\n\t\t$this->form_data = WPForms_Builder::instance()->form_data;\n\t}",
"function initData() {\n\t\tif ($this->reviewFormId != null) {\n\t\t\t$conference =& Request::getConference();\n\t\t\t$reviewFormDao =& DAORegistry::getDAO('ReviewFormDAO');\n\t\t\t$reviewForm =& $reviewFormDao->getReviewForm($this->reviewFormId, ASSOC_TYPE_CONFERENCE, $conference->getId());\n\n\t\t\tif ($reviewForm == null) {\n\t\t\t\t$this->reviewFormId = null;\n\t\t\t} else {\n\t\t\t\t$this->_data = array(\n\t\t\t\t\t'title' => $reviewForm->getTitle(null), // Localized\n\t\t\t\t\t'description' => $reviewForm->getDescription(null), // Localized\n 'templateForDirector' => $reviewForm->getTemplateForDirector(null), // Localized\n 'templateSurvey' => $reviewForm->getTemplateSurvey(null) // Localized\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}",
"public function prepareForm() : void {\n\t\t$field = new Input('text', 'name');\n\t\t$this->add($field->setLabel(\"Name\")->setRequired(true));\n\n\t\t$this->categoryHelper->field($this,'MEDIA');\n\t\t$field = new Select('team_id', auth()->user()->teams()->pluck('name', 'id'));\n\t\t$this->add(\n\t\t\t$field->setLabel(\"Team\")\n\t\t\t\t->setPlaceholder(\"Please select a team\")\n\t\t);\n\n\t\t$field = new Input('file', 'media');\n\t\t$this->add($field->setLabel(\"Media\"));\n\n\t\t$field = new Input('text', 'filename');\n\t\t$this->add($field->setLabel(\"Filename\"));\n\n\t\t$field = new Rating('rating');\n\t\t$field->setLabel(\"Rating\");\n\t\t$this->add($field);\n\n\t\t$field = new TextArea('license_ta');\n\t\t$this->add($field->setLabel(\"License Information\"));\n\n\t\t//get my tags.\n\t\t$tags = $this->model->tags()->pluck('id')->all();\n\t\t//get all tags.. These are NOT subscribers..\n\t\t$base = Category::reference(\"Media\",\"TAGS\")->first();\n\t\t$groups = Tag::optGroup($base);\n\t\tforeach ($groups as $name => $group) {\n\t\t\t$field = new Select('tag[]',$group);\n\t\t\t$field->setMultiple(true)->setValueType(AbstractField::TYPE_ARRAY)->setLabel($name)->setValue($tags);\n\t\t\t$this->add($field);\n\t\t}\n\t}",
"function form_init_data()\r\n {\r\n $this->set_hidden_element_value('_action', FT_ACTION_UPDATE) ;\r\n $this->set_hidden_element_value('swimmerid', $this->getSwimmerId()) ;\r\n\r\n $swimmer = new Swimmer() ;\r\n $swimmer->LoadSwimmerById($this->getSwimmerId()) ;\r\n\r\n $this->set_element_value('First Name', $swimmer->getSwimmerFirstName()) ;\r\n $this->set_element_value('Middle Name', $swimmer->getSwimmerMiddleName()) ;\r\n $this->set_element_value('Last Name', $swimmer->getSwimmerLastName()) ;\r\n $this->set_element_value('Gender', $swimmer->getGender()) ;\r\n $this->set_element_value('USS', $swimmer->getUSS()) ;\r\n $this->set_element_value('USS New', $swimmer->getUSSNew()) ;\r\n\r\n $date = $swimmer->getBirthDate(false) ;\r\n $this->set_element_value('Birth Date', array('year' => substr($date, 4, 4),\r\n 'month' => substr($date, 0, 2), 'day' => substr($date, 2, 2))) ;\r\n }",
"function initData() {\n\t\tif ($this->reviewFormElementId != null) {\n\t\t\t$journal =& Request::getJournal();\n\t\t\t$reviewFormElementDao =& DAORegistry::getDAO('ReviewFormElementDAO');\n\t\t\t$reviewFormElement =& $reviewFormElementDao->getReviewFormElement($this->reviewFormElementId);\n\n\t\t\tif ($reviewFormElement == null) {\n\t\t\t\t$this->reviewFormElementId = null;\n\t\t\t\t$this->_data = array(\n\t\t\t\t\t'included' => 1\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\t$this->_data = array(\n\t\t\t\t\t'question' => $reviewFormElement->getQuestion(null), // Localized\n\t\t\t\t\t'required' => $reviewFormElement->getRequired(),\n\t\t\t\t\t'included' => $reviewFormElement->getIncluded(),\n\n\t\t\t\t\t'elementType' => $reviewFormElement->getElementType(),\n\t\t\t\t\t'possibleResponses' => $reviewFormElement->getPossibleResponses(null) //Localized\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}",
"public function form()\n {\n $this->_setMetaData();\n }",
"public function init_form_fields()\n {\n }",
"public function addChapterFormAction()\n {\n $this->checkIfAdmin();\n\n include(__DIR__ . '/../view/addChapterView.php');\n include(__DIR__ . '/../admin/pages/adminTemplate.php');\n }",
"function readForm() {\n\t\t$this->FiscaalGroepID = $this->formHelper(\"FiscaalGroepID\", 0);\n\t\t$this->FiscaalGroupType = $this->formHelper(\"FiscaalGroupType\", 0);\n\t\t$this->GewijzigdDoor = $this->formHelper(\"GewijzigdDoor\", 0);\n\t\t$this->GewijzigdOp = $this->formHelper(\"GewijzigdOp\", \"\");\n\t}",
"private function populateForm()\n {\n $this->form->get('version')->setValue($this->continuationDetailData['version']);\n }",
"public function setup_form_data()\n {\n $this->util->set_time_limit();\n $state_data = $this->migration_state_manager->set_post_data();\n\n if (empty($this->form_data)) {\n // ***+=== @TODO - revisit usage of parse_migration_form_data\n $this->parse_and_save_migration_form_data($state_data['form_data']);\n }\n }",
"abstract protected function initInternalForms(): void;",
"function prepareForSubscribeForm() {\n\t\tglobal $pommo;\n\t\t$dbo =& $pommo->_dbo;\n\t\trequire_once($pommo->_baseDir . 'inc/helpers/fields.php');\n\n\t\t// Get array of fields. Key is ID, value is an array of the demo's info\n\t\t$fields = PommoField::get(array('active' => TRUE,'byName' => FALSE));\n\t\tif (!empty ($fields))\n\t\t\t$this->assign('fields', $fields);\n\t\t\t\n\t\tforeach ($fields as $field) {\n\t\t\tif ($field['type'] == 'date')\n\t\t\t$this->assign('datePicker', TRUE);\n\t\t}\n\t\t\t\n\t\t// process.php appends serialized values to _GET['input']\n\t\t// TODO --> look into this behavior... necessary?\n\t\tif (isset ($_GET['input'])) \n\t\t\t$this->assign(unserialize($_GET['input']));\n\t\telseif (isset($_GET['Email'])) \n\t\t\t$this->assign(array('Email' => $_GET['Email']));\n\t\t\n\t\t$this->assign($_POST);\n\t}",
"function initData() {\n\n\t\t$this->_metadataFormImplem->initData($this->monograph);\n\n\t\treturn parent::initData();\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create request for operation 'updateTheme' | public function updateThemeRequest($theme_id, $theme)
{
// verify the required parameter 'theme_id' is set
if ($theme_id === null || (is_array($theme_id) && count($theme_id) === 0)) {
throw new \InvalidArgumentException(
'Missing the required parameter $theme_id when calling updateTheme'
);
}
// verify the required parameter 'theme' is set
if ($theme === null || (is_array($theme) && count($theme) === 0)) {
throw new \InvalidArgumentException(
'Missing the required parameter $theme when calling updateTheme'
);
}
$resourcePath = '/themes/{theme_id}';
$formParams = [];
$queryParams = [];
$headerParams = [];
$httpBody = '';
$multipart = false;
// path params
if ($theme_id !== null) {
$resourcePath = str_replace(
'{' . 'theme_id' . '}',
ObjectSerializer::toPathValue($theme_id),
$resourcePath
);
}
if ($multipart) {
$headers = $this->headerSelector->selectHeadersForMultipart(
['application/json']
);
} else {
$headers = $this->headerSelector->selectHeaders(
['application/json'],
['application/json']
);
}
// for model (json/xml)
if (isset($theme)) {
if ($headers['Content-Type'] === 'application/json') {
$httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($theme));
} else {
$httpBody = $theme;
}
} elseif (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
$formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
foreach ($formParamValueItems as $formParamValueItem) {
$multipartContents[] = [
'name' => $formParamName,
'contents' => $formParamValueItem
];
}
}
// for HTTP post (form)
$httpBody = new MultipartStream($multipartContents);
} elseif ($headers['Content-Type'] === 'application/json') {
$httpBody = \GuzzleHttp\json_encode($formParams);
} else {
// for HTTP post (form)
$httpBody = \GuzzleHttp\Psr7\build_query($formParams);
}
}
$defaultHeaders = [];
if ($this->config->getUserAgent()) {
$defaultHeaders['User-Agent'] = $this->config->getUserAgent();
}
$headers = array_merge(
$defaultHeaders,
$headerParams,
$headers
);
$query = \GuzzleHttp\Psr7\build_query($queryParams);
return new Request(
'PATCH',
$this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
} | [
"public function updateTheme($themeId, $request)\n {\n return $this->start()->uri(\"/api/theme\")\n ->urlSegment($themeId)\n ->bodyHandler(new JSONBodyHandler($request))\n ->put()\n ->go();\n }",
"function createOrUpdateTheme(PopulatedTheme $theme);",
"public function updateAction(Request $request, $id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('SettingToolBundle:MobileTheme')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find MobileTheme entity.');\n }\n\n $deleteForm = $this->createDeleteForm($id);\n $editForm = $this->createEditForm($entity);\n $editForm->handleRequest($request);\n\n if ($editForm->isValid()) {\n $entity ->upload();\n $em->flush();\n\n $this->get('session')->getFlashBag()->add(\n 'success',\"Data has been updated successfully\"\n );\n return $this->redirect($this->generateUrl('mobiletheme_edit', array('id' => $id)));\n }\n\n return $this->render('SettingToolBundle:MobileTheme:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }",
"public function deleteThemeRequest($theme_id)\n {\n // verify the required parameter 'theme_id' is set\n if ($theme_id === null || (is_array($theme_id) && count($theme_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $theme_id when calling deleteTheme'\n );\n }\n\n $resourcePath = '/themes/{theme_id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($theme_id !== null) {\n $resourcePath = str_replace(\n '{' . 'theme_id' . '}',\n ObjectSerializer::toPathValue($theme_id),\n $resourcePath\n );\n }\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'DELETE',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function approveTheme(Request $request)\n {\n $theme = $this->theme->find($request->get('id'));\n return response()->json(['html' => view('admin::modal.approve-theme', compact('theme'))->render()]);\n }",
"public function setThemeName($themeName, Request $request);",
"public function theme() {\n\t\t$this->set('pageTitle', __('Change theme: %s', $this->Auth->user('name')));\n\t\t$this->set('subTitle', __(''));\n\t\t$model = ClassRegistry::init(\"UserSetting\");\n\t\t$currentTheme = $model->findByNameAndUserId(\"UserInterface.theme\", $this->Auth->user('id'));\n\t\tif ($this->request->is('post')) {\n\n\t\t\t$data = $this->_cleanPost(array(\"Setting.UserInterface.theme\"));\n\t\t\t$save = array('UserSetting' => array(\n\t\t\t\t'user_id' => $this->Auth->user('id'),\n\t\t\t\t'name' => 'UserInterface.theme',\n\t\t\t\t'value' => (string)$data['Setting']['UserInterface']['theme']\n\t\t\t));\n\n\t\t\tif (!empty($currentTheme)) {\n\t\t\t\t$save['UserSetting']['id'] = $currentTheme['UserSetting']['id'];\n\t\t\t}\n\n\t\t\tif ($model->save($save)) {\n\t\t\t\t$this->Session->setFlash(__('Your changes have been saved.'), 'default', array(), 'success');\n\t\t\t\treturn $this->redirect(array('action' => 'theme'));\n\t\t\t} else {\n\t\t\t\t$this->Session->setFlash(__('There was a problem saving your changes. Please try again.'), 'default', array(), 'error');\n\t\t\t}\n\t\t}\n\n\t\tif (!empty($currentTheme)) {\n\t\t\t$currentTheme = $currentTheme['UserSetting']['value'];\n\t\t} else {\n\t\t\t$currentTheme = 'default';\n\t\t}\n\n\t\t$this->request->data['Setting'] = array('UserInterface' => array('theme' => $currentTheme));\n\t\t$this->set('username', $this->Auth->user('name'));\n\t}",
"public function updateOptionThemeForShop()\n {\n }",
"function save()\n {\n global $current_user, $template_uri;\n\n // get theme options\n $constructor = $this->_options;\n $admin = $this->_admin;\n\n // get theme name\n $theme = isset($_REQUEST['theme'])?$_REQUEST['theme']:$admin['theme'];\n $theme_new = strtolower($theme);\n $theme_new = preg_replace('/\\W/', '-', $theme_new);\n $theme_new = preg_replace('/[-]+/', '-', $theme_new);\n\n if ($this->isDefaultTheme($theme_new)) {\n $theme_new = $theme_new .'_'. date('His');\n }\n\n $path_new = CONSTRUCTOR_CUSTOM_THEMES .'/'. $theme_new;\n $path_old = CONSTRUCTOR_CUSTOM_THEMES .'/current';\n\n $theme_uri = isset($_REQUEST['theme-uri'])?$_REQUEST['theme-uri']:'';\n $description = stripslashes(isset($_REQUEST['description'])?$_REQUEST['description']:'');\n $version = isset($_REQUEST['version'])?$_REQUEST['version']:'0.0.1';\n $author = isset($_REQUEST['author'])?$_REQUEST['author']:'';\n $author_uri = isset($_REQUEST['author-uri'])?$_REQUEST['author-uri']:$current_user->user_nicename;\n\n // create new folder for new theme\n if (is_dir($path_new) &&\n !is_writable($path_new)) {\n $this->returnResponse(RESPONSE_KO, sprintf(__('Directory \"%s\" is not writable.', 'constructor'), $path_new));\n } else {\n if (!wp_mkdir_p($path_new)) {\n $this->returnResponse(RESPONSE_KO, sprintf(__('Directory \"%s\" is not writable.', 'constructor'), CONSTRUCTOR_CUSTOM_THEMES .'/'));\n }\n }\n // copy all theme images to new? directory\n foreach ($constructor['images'] as $img => $data) {\n if (!empty($data['src'])) {\n $old_image = $path_old .'/'. $data['src'];\n $new_image = $path_new .'/'. $data['src'];\n\n if ($old_image != $new_image) {\n // we are already check directory permissions\n if (!@copy($old_image, $new_image)) {\n $this->returnResponse(RESPONSE_KO, sprintf(__('Can\\'t copy file \"%s\".', 'constructor'), $old_image));\n }\n }\n }\n }\n\n // copy all images (*.png, *.jpeg, *.jpg, *.gif)\n // and check it\n $files = scandir($path_old);\n $files = array_diff($files, array('.','..','.svn','screenshot.png','config.php','style.css'));\n foreach ($files as $file) {\n if (in_array(pathinfo($file, PATHINFO_EXTENSION), array('png', 'jpg', 'jpeg', 'gif'))\n && @getimagesize($path_old . '/'. $file)\n ) {\n @copy($path_old.'/'.$file, $path_new.'/'.$file);\n }\n }\n\n // copy default screenshot (if not exist)\n if (!file_exists($path_new.'/screenshot.png') &&\n file_exists($path_old.'/screenshot.png')) {\n if (!@copy($path_old.'/screenshot.png', $path_new.'/screenshot.png')) {\n $this->returnResponse(RESPONSE_KO, sprintf(__('Can\\'t copy file \"%s\".', 'constructor'), $path_old.'/screenshot.png'));\n }\n } elseif (!file_exists($path_new.'/screenshot.png')) {\n if (!@copy(CONSTRUCTOR_DIRECTORY.'/admin/images/screenshot.png', $path_new.'/screenshot.png')) {\n $this->returnResponse(RESPONSE_KO, sprintf(__('Can\\'t copy file \"%s\".', 'constructor'), '/admin/images/screenshot.png'));\n }\n }\n\n\n require_once ABSPATH . 'wp-admin/includes/class-wp-filesystem-base.php';\n\t require_once ABSPATH . 'wp-admin/includes/class-wp-filesystem-direct.php';\n\n $wp_filesystem_direct = new WP_Filesystem_Direct(null);\n\n // update style file\n if (file_exists($path_old.'/style.css')) {\n $style = $wp_filesystem_direct->get_contents($path_old.'/style.css');\n // match first comment /* ... */\n $style = preg_replace('|\\/\\*(.*)\\*\\/|Umis', '', $style, 1);\n } else {\n $style = '';\n }\n\n $style = \"/*\nTheme Name: $theme\nTheme URI: $theme_uri\nDescription: $description\nVersion: $version\nAuthor: $author\nAuthor URI: $author_uri\n*/\".$style;\n\n unset($constructor['theme']);\n\n $config = \"<?php \\n\".\n \"/* Save on \".date('Y-m-d H:i').\" */ \\n\".\n \"return \".\n var_export($constructor, true).\n \"\\n ?>\";\n\n // update files content\n // style CSS\n if (!$wp_filesystem_direct->put_contents(CONSTRUCTOR_CUSTOM_THEMES .'/'.$theme_new.'/style.css', $style, 0644)) {\n $this->returnResponse(RESPONSE_KO, sprintf(__('Can\\'t save file \"%s\".', 'constructor'), CONSTRUCTOR_CUSTOM_THEMES .'/'.$theme_new.'/style.css'));\n }\n\n // theme config\n if (!$wp_filesystem_direct->put_contents(CONSTRUCTOR_CUSTOM_THEMES .'/'.$theme_new.'/config.php', $config, 0644)) {\n $this->returnResponse(RESPONSE_KO, sprintf(__('Can\\'t save file \"%s\".', 'constructor'), CONSTRUCTOR_CUSTOM_THEMES .'/'.$theme_new.'/config.php'));\n }\n\n $this->returnResponse(RESPONSE_OK, __('Theme was saved, please reload page for view changes', 'constructor'));\n }",
"function _maybe_update_themes() {}",
"function wp_ajax_query_themes() {\n\tglobal $themes_allowedtags, $theme_field_defaults;\n\n\tif ( ! current_user_can( 'install_themes' ) ) {\n\t\twp_send_json_error();\n\t}\n\n\t$args = wp_parse_args( wp_unslash( $_REQUEST['request'] ), array(\n\t\t'per_page' => 20,\n\t\t'fields' => $theme_field_defaults\n\t) );\n\n\tif ( isset( $args['browse'] ) && 'favorites' === $args['browse'] && ! isset( $args['user'] ) ) {\n\t\t$user = get_user_option( 'wporg_favorites' );\n\t\tif ( $user ) {\n\t\t\t$args['user'] = $user;\n\t\t}\n\t}\n\n\t$old_filter = isset( $args['browse'] ) ? $args['browse'] : 'search';\n\n\t/** This filter is documented in wp-admin/includes/class-wp-theme-install-list-table.php */\n\t$args = apply_filters( 'install_themes_table_api_args_' . $old_filter, $args );\n\n\t$api = themes_api( 'query_themes', $args );\n\n\tif ( is_wp_error( $api ) ) {\n\t\twp_send_json_error();\n\t}\n\n\t$update_php = network_admin_url( 'update.php?action=install-theme' );\n\tforeach ( $api->themes as &$theme ) {\n\t\t$theme->install_url = add_query_arg( array(\n\t\t\t'theme' => $theme->slug,\n\t\t\t'_wpnonce' => wp_create_nonce( 'install-theme_' . $theme->slug )\n\t\t), $update_php );\n\n\t\t$theme->name = wp_kses( $theme->name, $themes_allowedtags );\n\t\t$theme->author = wp_kses( $theme->author, $themes_allowedtags );\n\t\t$theme->version = wp_kses( $theme->version, $themes_allowedtags );\n\t\t$theme->description = wp_kses( $theme->description, $themes_allowedtags );\n\t\t$theme->stars = wp_star_rating( array( 'rating' => $theme->rating, 'type' => 'percent', 'number' => $theme->num_ratings, 'echo' => false ) );\n\t\t$theme->num_ratings = number_format_i18n( $theme->num_ratings );\n\t\t$theme->preview_url = set_url_scheme( $theme->preview_url );\n\t}\n\n\twp_send_json_success( $api );\n}",
"function xanthia_admin_addTheme()\n{\n\n\t// Check Permissions\n\tif (!pnSecAuthAction(0, 'Xanthia::', '::', ACCESS_EDIT)) {\n return pnVarPrepHTMLDisplay(_MODULENOAUTH);\n\t}\n\n\t// Load user API\n\tif (!pnModAPILoad('Xanthia','user')) {\n pnSessionSetVar('errormsg', pnVarPrepHTMLDisplay(_XA_APILOADFAILED));\n pnRedirect(pnModURL('Xanthia', 'admin', 'view'));\n return true;\n\t}\n\n\t// Load admin API\n\tif (!pnModAPILoad('Xanthia', 'admin')) {\n pnSessionSetVar('errormsg', pnVarPrepHTMLDisplay(_XA_APILOADFAILED));\n pnRedirect(pnModURL('Xanthia', 'admin', 'view'));\n return true;\n\t}\n\n\t$id = pnVarCleanFromInput('skin');\n\t$returninfo = pnModAPIFunc('Xanthia','admin','insertNewXanthiaTheme',\n\t\t\t\t\t\t\t\t\tarray('id' => $id));\n\n\tif ($returninfo) {\n\t\tpnSessionSetVar('statusmsg', _XA_THEMEADDED);\n\t\tpnRedirect(pnModURL('Xanthia', 'admin', 'view'));\n\t\treturn true;\n\t} else {\n\t\tpnSessionSetVar('statusmsg', 'Theme Not Added');\n\t\tpnRedirect(pnModURL('Xanthia', 'admin', 'view'));\n\t\treturn true;\n\t}\n\n}",
"public function themeRequest($theme_id, $fields = null)\n {\n // verify the required parameter 'theme_id' is set\n if ($theme_id === null || (is_array($theme_id) && count($theme_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $theme_id when calling theme'\n );\n }\n\n $resourcePath = '/themes/{theme_id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if ($fields !== null) {\n if('form' === 'form' && is_array($fields)) {\n foreach($fields as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['fields'] = $fields;\n }\n }\n\n\n // path params\n if ($theme_id !== null) {\n $resourcePath = str_replace(\n '{' . 'theme_id' . '}',\n ObjectSerializer::toPathValue($theme_id),\n $resourcePath\n );\n }\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"function thistle_disable_wporg_theme_update( $r, $url ) {\n\n // If it's not a theme update request, bail.\n if ( strpos( $url, 'https://api.wordpress.org/themes/update-check/1.1/' ) !== 0 ) {\n return $r;\n }\n\n // Decode the JSON response\n $themes = json_decode( $r['body']['themes'] );\n\n // Remove the active parent and child themes from the check\n $parent = get_option( 'template' );\n $child = get_option( 'stylesheet' );\n\n unset( $themes->themes->$parent, $themes->themes->$child );\n\n // Encode the updated JSON response\n $r['body']['themes'] = json_encode( $themes );\n\n return $r;\n }",
"public function disable_wporg_request( $r, $url ){\r\n\r\n\t\t/* WP.org theme update check URL */\r\n\t\t$wp_url_string = 'api.wordpress.org/themes/update-check';\r\n\r\n\t\t/* If it's not a theme update check request, bail early */\r\n\t\tif ( false === strpos( $url, $wp_url_string ) ){\r\n\t\t\treturn $r;\r\n\t\t}\r\n\r\n\t\t/* Get this theme slug (active theme) */\r\n\t\t$theme_slug = get_option( 'template' );\r\n\r\n\t\t/* Get response body (json/serialize data) */\r\n\t\t$r_body = wp_remote_retrieve_body( $r );\r\n\r\n\t\t/* Get theme request */\r\n\t\t$r_themes = '';\r\n\t\t$r_themes_json = false;\r\n\t\tif( isset( $r_body['themes'] ) ){\r\n\r\n\t\t\t/* Check if data can be serialized */\r\n\t\t\tif ( is_serialized( $r_body['themes'] ) ){\r\n\r\n\t\t\t\t/* unserialize data ( PRE WP 3.7 ) */\r\n\t\t\t\t$r_themes = @unserialize( $r_body['themes'] );\r\n\t\t\t\t$r_themes = (array) $r_themes; //make sure it's an array\r\n\t\t\t}\r\n\r\n\t\t\t/* if unserialize didn't work ( POST WP.3.7 using json ) */\r\n\t\t\telse{\r\n\t\t\t\t/* use json decode to make body request to array */\r\n\t\t\t\t$r_themes = json_decode( $r_body['themes'], true );\r\n\t\t\t\t$r_themes_json = true;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t/* check if themes request is not empty */\r\n\t\tif ( !empty( $r_themes ) ){\r\n\r\n\t\t\t/* Unset this theme */\r\n\t\t\tif ( true === $r_themes_json ){ // json encode data\r\n\t\t\t\tunset( $r_themes['themes'][ $theme_slug ] );\r\n\t\t\t\t$r['body']['themes'] = json_encode( $r_themes );\r\n\t\t\t}\r\n\t\t\telse{ // serialize data\r\n\t\t\t\tunset( $r_themes[ $theme_slug ] );\r\n\t\t\t\t$r['body']['themes'] = serialize( $r_themes );\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t/* return the request */\r\n\t\treturn $r;\r\n\t}",
"public function update_contrast(Request $request)\n {\n $id = Auth::id();\n $user = User::findOrFail($id);\n User::where('id', $id)->update(['theme' => 'contrast' ]);\n\n return back()\n ->with('succes', 'Thema geactiveerd');\n }",
"protected function apply_package() {\n\t\t$update_themes = get_site_transient( 'update_themes' );\n\t\tif ( ! is_object( $update_themes ) ) {\n\t\t\t$update_themes = new stdClass();\n\t\t}\n\n\t\t$theme_info = array();\n\t\t$theme_info['theme'] = $this->theme_slug;\n\t\t$theme_info['new_version'] = $this->version;\n\t\t$theme_info['slug'] = $this->theme_slug;\n\t\t$theme_info['package'] = sprintf( 'https://downloads.wordpress.org/theme/%s.%s.zip', $this->theme_slug, $this->version );\n\n\t\t$update_themes->response[ $this->theme_slug ] = $theme_info;\n\t\tset_site_transient( 'update_themes', $update_themes );\n\t}",
"public function select_theme_submit(Request $request) {\n\n $all = $request->all();\n\n if (array_has($all, 'id')) {\n\n $request->session()->put('theme-id', $all['id']);\n\n return response()->json(['redirect' => url('admin/space/add')]);\n\n } else {\n abort(404);\n }\n }",
"function theme_options_update_callback() {\n require(TEMPLATEPATH . '/framework/theme-options/theme-options-action.php');\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
PageLines Body Classes Sets up classes for controlling design and layout and is used on the body tag | function pagelines_body_classes(){
global $pagelines_addclasses, $plpg;
$special_body_class = (pl_setting('special_body_class')) ? pl_setting('special_body_class') : '';
$classes = array();
$classes[] = $special_body_class;
// child theme name
$classes[] = sanitize_html_class( strtolower( PL_CHILDTHEMENAME ) );
// pro
$classes[] = (pl_is_pro()) ? 'pl-pro-version' : 'pl-basic-version';
// for backwards compatiblity, dms is:
$classes[] = 'responsive';
$classes[] = 'full_width';
// externally added via global variable (string)
if ( isset( $pagelines_addclasses ) && $pagelines_addclasses )
$classes = array_merge( $classes, (array) explode( ' ', $pagelines_addclasses ) );
// Add last imported template for styling
if( is_object( $plpg ) && false != $plpg->template && '' != $plpg->template )
$classes[] = sprintf( 'last-imported-%s', $plpg->template );
// ensure no duplicates or empties
$classes = array_unique( array_filter( $classes ) );
// filter & convert to string
$body_classes = join(' ', (array) apply_filters('pagelines_body_classes', $classes) );
return $body_classes;
} | [
"function pmw_get_body_class()\r\n{\r\n\t$classes = [];\r\n\t$classes[] = 'page';\r\n\t$classes[] = 'page-' . ConfigHelper::get( 'page' );\r\n\treturn implode( ' ', $classes );\r\n}",
"function yb_body_class( $classes ) {\n\t/* Combine yb_layout_class array with body classes */\n\t$page_classes = yb_layout_class();\n\t$classes = array_merge($classes, $page_classes);\n\n\t/* Combine blog layout classes */\n\t//$blog_classes = yb_blog_layout_class();\n\t//$classes = array_merge($classes, $blog_classes);\n\n\treturn $classes;\n}",
"function inhabitent_body_class_for_pages( $classes ) {\n if ( is_singular( 'page' ) ) {\n global $post;\n $classes[] = 'page-' . $post->post_name;\n }\n return $classes;\n}",
"function admin_body_class($classes)\n {\n }",
"function thyme_add_body_class( $classes ) {\n\n\t$classes[] = 'landing-page';\n\treturn $classes;\n\n}",
"function lpd_body_class( $classes ) {\n\n\tif ( is_page( LPD_PAGE_SLUG ) ) {\n $classes[] = 'partner-dashboard';\n\t}\n\n\tif ( isset( $_GET[ 'date_filter' ] ) ) {\n\t\t$classes[] = 'date_filtered';\n\t}\n\n\tforeach ( $_GET as $key => $val ) {\n\t\t$classes[] = $key . '-' . $val;\n\t}\n\n return $classes;\n\n}",
"function display_body_classes() {\n\techo render_body_classes();\n}",
"public function admin_body_class($classes)\n {\n }",
"public function output_body_class( $classes ) {\n\t\t\t\tif ( is_page( wc_get_page_id( 'auction' ) ) ) {\n\t\t\t\t\t$classes[] = 'woocommerce auctions-page';\n\t\t\t\t}\n\t\t\t\treturn $classes;\n\t\t\t}",
"function add_body_class( $classes ) {\n\n\t$classes[] = 'front-page';\n\treturn $classes;\n\n}",
"function minimize_add_body_class( $classes ) {\n\t$classes[] = 'landing-page';\n\n\treturn $classes;\n}",
"public function add_body_classes($classes) {\r\n foreach ($classes as $class) {\r\n $this->add_body_class($class);\r\n }\r\n }",
"function uos_team_body_class( $classes ) {\n\n\t$classes[] = 'team-page';\n\treturn $classes;\n\n}",
"function segenvita_home_body_class( $classes ) {\n\n\t$classes[] = 'home-page';\n\treturn $classes;\n\n}",
"function jpak_project_single_body_classes( $classes ) {\n\n $classes[] = 'full-width-content';\n $classes[] = 'page';\n $classes[] = 'no-mini-hero';\n\n return $classes;\n\n }",
"private function _addBodyClassAttr()\n {\n $request = $this->app()->request();\n $doc = $this->app()->response()->document();\n $content = $request->param(\"_content_active\");\n\n if ((!$doc instanceof PHPFrame_HTMLDocument)) {\n return;\n }\n\n $body_class = $request->controllerName().\"-\".$request->action();\n\n if ($content instanceof Content) {\n $body_class .= \" content-type-\";\n\n switch (get_class($content)) {\n case \"FeedContent\" :\n $body_class .= \"feed\";\n break;\n case \"MVCContent\" :\n $body_class .= \"mvc\";\n break;\n case \"PageContent\" :\n $body_class .= \"page\";\n break;\n case \"PostContent\" :\n $body_class .= \"post\";\n break;\n case \"PostsCollectionContent\" :\n $body_class .= \"blog\";\n break;\n }\n\n $body_class .= \" content-item-\".$content->id();\n }\n\n $body_node = $doc->dom()->getElementsByTagName(\"body\")->item(0);\n $doc->addNodeAttr($body_node, \"class\", $body_class);\n }",
"protected function setBodyClass()\n {\n $bodyClass = $this->prepareBodyClass();\n \n $bodyClass = array_unique($bodyClass);\n \n foreach($bodyClass as $_i => $_class){\n if ( trim($_class) === '' ){\n unset($bodyClass[$_i]);\n }\n }\n \n $this->data['bodyclass'] = implode(' ', $bodyClass);\n }",
"function photolaboratory_body_classes( $classes ) {\r\n\r\n\t\t$classes[] = 'photolaboratory_body';\r\n\t\t$classes[] = 'body_style_' . trim(photolaboratory_get_custom_option('body_style'));\r\n\t\t$classes[] = 'body_' . (photolaboratory_get_custom_option('body_filled')=='yes' ? 'filled' : 'transparent');\r\n\t\t$classes[] = 'article_style_' . trim(photolaboratory_get_custom_option('article_style'));\r\n\t\t\r\n\t\t$blog_style = photolaboratory_get_custom_option(is_singular() && !photolaboratory_storage_get('blog_streampage') ? 'single_style' : 'blog_style');\r\n\t\t$classes[] = 'layout_' . trim($blog_style);\r\n\t\t$classes[] = 'template_' . trim(photolaboratory_get_template_name($blog_style));\r\n\t\t\r\n\t\t$body_scheme = photolaboratory_get_custom_option('body_scheme');\r\n\t\tif (empty($body_scheme) || photolaboratory_is_inherit_option($body_scheme)) $body_scheme = 'original';\r\n\t\t$classes[] = 'scheme_' . $body_scheme;\r\n\r\n\t\t$top_panel_position = photolaboratory_get_custom_option('top_panel_position');\r\n\t\tif (!photolaboratory_param_is_off($top_panel_position)) {\r\n\t\t\t$classes[] = 'top_panel_show';\r\n\t\t\t$classes[] = 'top_panel_' . trim($top_panel_position);\r\n\t\t} else \r\n\t\t\t$classes[] = 'top_panel_hide';\r\n\t\t$classes[] = photolaboratory_get_sidebar_class();\r\n\r\n\t\tif (photolaboratory_get_custom_option('show_video_bg')=='yes' && (photolaboratory_get_custom_option('video_bg_youtube_code')!='' || photolaboratory_get_custom_option('video_bg_url')!=''))\r\n\t\t\t$classes[] = 'video_bg_show';\r\n\r\n\t\tif (!photolaboratory_param_is_off(photolaboratory_get_theme_option('page_preloader')))\r\n\t\t\t$classes[] = 'preloader';\r\n\r\n\t\treturn $classes;\r\n\t}",
"function yiw_theme_layout_body_class( $classes ) {\n\t$classes[] = yiw_get_option( 'theme_layout' ) . '-layout';\n\treturn $classes;\t\t\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Submit the rebuild form, and start the batch. | function leftandright_rebuild_form_submit($form, $form_state){
// Lets
$operations = array();
foreach($form_state['values']['vocabularies'] as $key => $vid){
if($vid){
$operations[] = array(
'leftandright_rebuild_tree', array($vid, 10000)
);
$operations[] = array(
'leftandright_move_rebuilt_tree', array($vid)
);
}
}
$batch = array(
'operations' => $operations,
'finished' => 'leftandright_rebuild_finished',
'title' => t('Rebuilding Vocabularies'),
'init_message' => t('The rebuilding of your vocabularies is starting.'),
'progress_message' => t('Written record @current of @total'),
'error_message' => t('Something went wrong, please contact an administrator'),
'file' => drupal_get_path('module','leftandright').'/leftandright.rebuild.inc'
);
batch_set($batch);
} | [
"function run() { $this->runForm(); }",
"function privatemsg_filter_inbox_rebuid_form_submit($form, &$form_state) {\n $batch = array(\n 'title' => t('Rebuilding inbox'),\n 'operations' => array(\n array('privatemsg_filter_inbox_rebuild_process', array()),\n ),\n 'finished' => 'privatemsg_filter_inbox_rebuild_finished',\n 'file' => drupal_get_path('module', 'privatemsg_filter') . '/privatemsg_filter.admin.inc',\n );\n batch_set($batch);\n}",
"protected function buildFormAction() {\n\t\t// Handle compilation, if needed\n\t\t$output = '';\n\t\t$operation = GeneralUtility::_POST('operation');\n\t\tif ($operation) {\n\t\t\t$output = $this->handleCompilation($operation);\n\t\t}\n\n\t\t$sphinxVersion = SphinxBuilder::getSphinxVersion();\n\t\tif (SphinxBuilder::isSystemVersion()) {\n\t\t\t$sphinxVersion .= ' (system)';\n\t\t}\n\t\t$configuration = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf'][$this->extKey]);\n\t\tswitch ($configuration['pdf_builder']) {\n\t\t\tcase 'pdflatex':\n\t\t\t\t$renderPdf = \\TYPO3\\CMS\\Core\\Utility\\CommandUtility::getCommand('pdflatex') !== '';\n\t\t\tbreak;\n\t\t\tcase 'rst2pdf':\n\t\t\t\t$renderPdf = TRUE;\n\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$renderPdf = FALSE;\n\t\t\tbreak;\n\t\t}\n\t\t$values = array(\n\t\t\t'project' => $this->project,\n\t\t\t'build' => array(\n\t\t\t\t'sphinxVersion' => ($sphinxVersion ?: 'n/a'),\n\t\t\t\t'baseDirectory' => substr($this->project['basePath'], strlen(PATH_site)),\n\t\t\t),\n\t\t\t'disableCompile' => empty($sphinxVersion),\n\t\t\t'hasPdflatex' => $renderPdf,\n\t\t\t'consoleOutput' => $output,\n\t\t);\n\n\t\t/** @var $view \\TYPO3\\CMS\\Fluid\\View\\StandaloneView */\n\t\t$view = $this->objectManager->get('TYPO3\\\\CMS\\\\Fluid\\\\View\\\\StandaloneView');\n\t\t$template = \\TYPO3\\CMS\\Core\\Utility\\ExtensionManagementUtility::extPath($this->extKey) . 'Resources/Private/Templates/Console/BuildForm.html';\n\t\t$view->setTemplatePathAndFilename($template);\n\t\t$view->assignMultiple($values);\n\t\t$this->content .= $view->render();\n\t}",
"function update_manager_update_form_submit($form, &$form_state) {\n $projects = array();\n foreach (array('projects', 'disabled_projects') as $type) {\n if (!empty($form_state['values'][$type])) {\n $projects = array_merge($projects, array_keys(array_filter($form_state['values'][$type])));\n }\n }\n $operations = array();\n foreach ($projects as $project) {\n $operations[] = array(\n 'update_manager_batch_project_get',\n array(\n $project,\n $form_state['values']['project_downloads'][$project],\n ),\n );\n }\n $batch = array(\n 'title' => t('Downloading updates'),\n 'init_message' => t('Preparing to download selected updates'),\n 'operations' => $operations,\n 'finished' => 'update_manager_download_batch_finished',\n 'file' => drupal_get_path('module', 'update') . '/update.manager.inc',\n );\n batch_set($batch);\n}",
"function atos_esuite_batch_run_all_submit($form, &$form_state) {\n module_load_include('inc', 'atos_esuite', 'atos_esuite.import');\n atos_esuite_import_batch_start(array('product', 'vac'));\n}",
"protected function queueIndexRebuild()\n\t{\n\t\t\\IPS\\Content\\Search\\Index::i()->rebuild();\n\t\n\t\t\\IPS\\Session::i()->log( 'acplogs__queued_search_index' );\n\t\t\\IPS\\Output::i()->redirect( \\IPS\\Http\\Url::internal( 'app=core&module=settings&controller=search' ), 'search_index_rebuilding' );\n\t}",
"function flag_export_form_submit($form, &$form_state) {\n $form_state['rebuild'] = TRUE;\n}",
"function om_show_om_showreport_form_submit($form, &$form_state) {\n $form_state['rebuild'] = TRUE;\n}",
"public function batchFormAction()\n {\n // Append breadcrumbs\n $this->view->getBreadcrumbBag()->addOne('Photogallery', 'Photogallery:Admin:Browser@indexAction')\n ->addOne('Batch photo uploading');\n\n return $this->view->render('batch.form', array(\n 'albums' => $this->getModuleService('albumManager')->getAlbumsTree(false)\n ));\n }",
"public function build()\n {\n echo \"Running jobs found at: \". $this->data['jobs']['location']. \"\\n\";\n $this->work();\n\n echo \"Outputting to: \". $this->data['output']['location']. \"\\n\";\n $this->dump();\n }",
"function runForm() {\n\n if ($this->formHasRun)\n return;\n\n // blank form?\n if (empty($this->entityList)) {\n $this->debugLog('form was blank!');\n return;\n }\n\n foreach ($this->entityList as &$ent) {\n\n // make sure entity has a group, default if none other\n if (empty($ent->fieldset)) {\n $ent->fieldset = 'default';\n $this->groupList['default'][] = $ent;\n }\n\n // apply filters/frobbers if this isn't a ftl (ie, dont do server side if this is a first time load)\n if (!$this->ftl) {\n $ent->applyFilters();\n $ent->inputEntity->applyFrobbers();\n }\n\n }\n\n // Mark that this form has run\n $this->formHasRun = TRUE;\n\n }",
"public function submit()\n {\n $this->getDriver()->submitForm($this->getXpath());\n }",
"public function _run()\n {\n $this->id = $this->_request->getParam(\n 'id',\n $this->_request->getPost(\n 'id',\n $this->_request->getParam(\n Defines::CONTENT_ID,\n $this->_request->getPost(\n Defines::CONTENT_ID,\n null,\n Request::FILTER_INT),\n Request::FILTER_INT),\n Request::FILTER_INT),\n Request::FILTER_INT);\n $this->_view->id = $this->id;\n \n $this->data(\n $this->_request->getPost(\n self::DATA,\n $this->_request->getParam(\n self::DATA,\n null,\n Request::FILTER_ARRAY),\n Request::FILTER_ARRAY));\n $this->filter(\n $this->_request->getPost(\n self::FILTER,\n $this->_request->getParam(\n self::FILTER,\n null,\n Request::FILTER_ARRAY),\n Request::FILTER_ARRAY));\n $this->order(\n $this->_request->getPost(\n self::ORDER, \n $this->_request->getParam(\n self::ORDER, \n null, \n Request::FILTER_STRING),\n Request::FILTER_STRING));\n \n $this->setCurrentActiveUser();\n// $this->checkAccessRules();\n \n $this->createControllerModel( $this->_request->getControllerName() );\n \n $this->formSiteTitle(Config::SITE_NAME);\n \n $this->_commonInit();\n\t\t$this->_init();\n \n $this->setDefaultBreadCrumb();\n $this->setDefaultSiteTitle();\n }",
"public function start(): void\n {\n $job = (new BuildBuilding($this->buildingType, $this))\n ->delay(now()->addMinutes($this->buildingType->buildingTime));\n\n $jobID = $this->dispatch($job);\n\n $this->jobID = $jobID;\n $this->save();\n }",
"public function buildForm()\n {\n $this->addResults();\n }",
"protected function queueIndexRebuild()\n\t{\n\t\t/* Clear MySQL minimum word length cached value */\n\t\tunset( \\IPS\\Data\\Store::i()->mysqlMinWord );\n\t\tunset( \\IPS\\Data\\Store::i()->mysqlMaxWord );\n\n\t\t\\IPS\\Content\\Search\\Index::i()->rebuild();\n\t\n\t\t\\IPS\\Session::i()->log( 'acplogs__queued_search_index' );\n\t\t\\IPS\\Output::i()->redirect( \\IPS\\Http\\Url::internal( 'app=core&module=discovery&controller=search' ), 'search_index_rebuilding' );\n\t}",
"public function triggerBuild()\n {\n $buildWebhookUrl = Craft::parseEnv(Plugin::getInstance()->getSettings()->buildWebhookUrl);\n\n if (!empty($buildWebhookUrl) && $this->_buildQueued === false) {\n $this->_buildQueued = true;\n Craft::$app->on(Application::EVENT_AFTER_REQUEST, function() use ($buildWebhookUrl) {\n $guzzle = Craft::createGuzzleClient([\n 'headers' => [\n 'x-preview-update-source' => 'Craft CMS',\n 'Content-type' => 'application/json'\n ]\n ]);\n $guzzle->request('POST', $buildWebhookUrl);\n }, null, false);\n }\n }",
"function asu_isearch_import_isearch_form_submit($form, &$form_state) {\n system_settings_form_submit($form, $form_state);\n\n $force_update = FALSE;\n\n if ($form_state['clicked_button']['#name'] == 'force_update') {\n $force_update = TRUE;\n }\n\n _asu_isearch_begin_batch($force_update);\n}",
"public function execute() {\n if (!count($this->config['files'])) {\n return;\n }\n \n if (isset($_POST) && count($_POST) > 0) {\n $this->createFiles();\n $this->returnZipFile();\n } else {\n echo $this->renderInputForm();\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Update post meta field based on post ID. ( edited by payamweber ) Use the $prev_value parameter to differentiate between meta fields with the same key and post ID. If the meta field for the post does not exist, it will be added. | function pmw_update_post_meta( $object_id, $meta_key, $meta_value, $prev_value = '', $meta_type = 'post' )
{
global $wpdb;
if ( ! $meta_type || ! $meta_key || ! is_numeric( $object_id ) )
{
return FALSE;
}
$object_id = absint( $object_id );
if ( ! $object_id )
{
return FALSE;
}
$table = _get_meta_table( $meta_type );
if ( ! $table )
{
return FALSE;
}
$column = sanitize_key( $meta_type . '_id' );
$id_column = 'user' == $meta_type ? 'umeta_id' : 'meta_id';
// expected_slashed ($meta_key)
$raw_meta_key = $meta_key;
$meta_key = wp_unslash( $meta_key );
$passed_value = $meta_value;
$meta_value = $meta_value;
$meta_value = sanitize_meta( $meta_key, $meta_value, $meta_type );
/**
* Filters whether to update metadata of a specific type.
*
* The dynamic portion of the hook, `$meta_type`, refers to the meta
* object type (comment, post, or user). Returning a non-null value
* will effectively short-circuit the function.
*
* @since 3.1.0
*
* @param null|bool $check Whether to allow updating metadata for the given type.
* @param int $object_id Object ID.
* @param string $meta_key Meta key.
* @param mixed $meta_value Meta value. Must be serializable if non-scalar.
* @param mixed $prev_value Optional. If specified, only update existing
* metadata entries with the specified value.
* Otherwise, update all entries.
*/
$check = apply_filters( "update_{$meta_type}_metadata", NULL, $object_id, $meta_key, $meta_value, $prev_value );
if ( NULL !== $check )
{
return (bool) $check;
}
// Compare existing value to new value if no prev value given and the key exists only once.
if ( empty( $prev_value ) )
{
$old_value = get_metadata( $meta_type, $object_id, $meta_key );
if ( count( $old_value ) == 1 )
{
if ( $old_value[ 0 ] === $meta_value )
{
return FALSE;
}
}
}
$meta_ids = $wpdb->get_col( $wpdb->prepare( "SELECT $id_column FROM $table WHERE meta_key = %s AND $column = %d", $meta_key, $object_id ) );
if ( empty( $meta_ids ) )
{
return add_metadata( $meta_type, $object_id, $raw_meta_key, $passed_value );
}
$_meta_value = $meta_value;
$meta_value = maybe_serialize( $meta_value );
$data = compact( 'meta_value' );
$where = [
$column => $object_id,
'meta_key' => $meta_key,
];
if ( ! empty( $prev_value ) )
{
$prev_value = maybe_serialize( $prev_value );
$where[ 'meta_value' ] = $prev_value;
}
foreach ( $meta_ids as $meta_id )
{
/**
* Fires immediately before updating metadata of a specific type.
*
* The dynamic portion of the hook, `$meta_type`, refers to the meta
* object type (comment, post, or user).
*
* @since 2.9.0
*
* @param int $meta_id ID of the metadata entry to update.
* @param int $object_id Object ID.
* @param string $meta_key Meta key.
* @param mixed $meta_value Meta value.
*/
do_action( "update_{$meta_type}_meta", $meta_id, $object_id, $meta_key, $_meta_value );
if ( 'post' == $meta_type )
{
/**
* Fires immediately before updating a post's metadata.
*
* @since 2.9.0
*
* @param int $meta_id ID of metadata entry to update.
* @param int $object_id Object ID.
* @param string $meta_key Meta key.
* @param mixed $meta_value Meta value.
*/
do_action( 'update_postmeta', $meta_id, $object_id, $meta_key, $meta_value );
}
}
$result = $wpdb->update( $table, $data, $where );
if ( ! $result )
{
return FALSE;
}
wp_cache_delete( $object_id, $meta_type . '_meta' );
foreach ( $meta_ids as $meta_id )
{
/**
* Fires immediately after updating metadata of a specific type.
*
* The dynamic portion of the hook, `$meta_type`, refers to the meta
* object type (comment, post, or user).
*
* @since 2.9.0
*
* @param int $meta_id ID of updated metadata entry.
* @param int $object_id Object ID.
* @param string $meta_key Meta key.
* @param mixed $meta_value Meta value.
*/
do_action( "updated_{$meta_type}_meta", $meta_id, $object_id, $meta_key, $_meta_value );
if ( 'post' == $meta_type )
{
/**
* Fires immediately after updating a post's metadata.
*
* @since 2.9.0
*
* @param int $meta_id ID of updated metadata entry.
* @param int $object_id Object ID.
* @param string $meta_key Meta key.
* @param mixed $meta_value Meta value.
*/
do_action( 'updated_postmeta', $meta_id, $object_id, $meta_key, $meta_value );
}
}
return TRUE;
} | [
"function update_post_meta($post_id, $meta_key, $meta_value, $prev_value = '')\n{\n}",
"function update_meta( $item_id, $meta_key, $meta_value, $prev_value = '' ) {\n\t\treturn update_post_meta( $item_id, $meta_key, $meta_value, $prev_value );\n\t}",
"function update_post_term_meta( int $post_id, int $term_id, string $meta_key, $meta_value, $prev_value = '' ) {\n\t\treturn \\wpinc\\meta\\post_term_meta\\update_post_term_meta( $post_id, $term_id, $meta_key, $meta_value, $prev_value );\n\t}",
"function update_book_meta( $id, $key, $value, $prev_value = '' ) {\r\n\treturn update_post_meta($id, $key, $value, $prev_value);\r\n}",
"function update_post_term_meta( int $post_id, int $term_id, string $meta_key, $meta_value, $prev_value = '' ) {\n\treturn update_post_meta( $post_id, get_key( $term_id, $meta_key ), $meta_value, $prev_value );\n}",
"function updated_postmeta( $meta_id, $object_id, $meta_key, $meta_value ) {\n\t\tif ( in_array( $meta_key, array( '_wpml_media_duplicate', '_wpml_media_featured' ) ) ) {\n\t\t\tglobal $sitepress;\n\t\t\t$el_type = 'post_' . get_post_type( $object_id );\n\t\t\t$trid = $sitepress->get_element_trid( $object_id, $el_type );\n\t\t\t$translations = $sitepress->get_element_translations( $trid, $el_type, true, true );\n\t\t\tforeach ( $translations as $translation ) {\n\t\t\t\tif ( $translation->element_id != $object_id ) {\n\t\t\t\t\t$t_meta_value = get_post_meta( $translation->element_id, $meta_key, true );\n\t\t\t\t\tif ( $t_meta_value != $meta_value ) {\n\t\t\t\t\t\tupdate_post_meta( $translation->element_id, $meta_key, $meta_value );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"function updated_postmeta( $meta_id, $object_id, $meta_key, $meta_value )\n\t{\n\t\tif ( in_array( $meta_key, array( '_wpml_media_duplicate', '_wpml_media_featured' ) ) ) {\n\t\t\tglobal $sitepress;\n\t\t\t$el_type = 'post_' . get_post_type( $object_id );\n\t\t\t$trid = $sitepress->get_element_trid( $object_id, $el_type );\n\t\t\t$translations = $sitepress->get_element_translations( $trid, $el_type, true, true );\n\t\t\tforeach ( $translations as $translation ) {\n\t\t\t\tif ( $translation->element_id != $object_id ) {\n\t\t\t\t\t$t_meta_value = get_post_meta( $translation->element_id, $meta_key, true );\n\t\t\t\t\tif ( $t_meta_value != $meta_value ) {\n\t\t\t\t\t\tupdate_post_meta( $translation->element_id, $meta_key, $meta_value );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"function thb_update_post_meta( $post_id, $key, $value = '' ) {\n\t\tupdate_post_meta( $post_id, THB_META_KEY . $key, $value );\n\t}",
"function give_update_payment_meta( $payment_id = 0, $meta_key = '', $meta_value = '', $prev_value = '' ) {\n\treturn give_update_meta( $payment_id, $meta_key, $meta_value );\n}",
"function update_meta( $object_id = 0, $meta_key = '', $meta_value = '', $prev_value = '' ) {\n\t\treturn update_metadata( $this->meta_type(), $object_id, $meta_key, $meta_value, $prev_value );\n\t}",
"function update_meta( $item_id, $meta_key, $meta_value, $prev_value = '' ) {\n\t\treturn update_term_meta( $item_id, $meta_key, $meta_value, $prev_value );\n\t}",
"public function post_meta_updated( $meta_id, $post_id, $meta_key, $meta_value ) {\n\t\tif ( $post_id == $this->ID ) {\n\t\t\t$this->refresh();\n\t\t}\n\t}",
"public function postMetaUpdated($meta_id, $post_id, $meta_key, $meta_value)\n {\n if($post_id == $this->ID)\n {\n $this->refresh();\n }\n }",
"function update_meta( $affiliate_id = 0, $meta_key = '', $meta_value, $prev_value = '' ) {\n\t\treturn update_metadata( 'affiliate', $affiliate_id, $meta_key, $meta_value, $prev_value );\n\t}",
"private function update_post_meta( $post_id, $meta_key, $meta_value ) {\n\t\tif ( is_array( $_POST[ $meta_key ] ) ) {\n\t\t\t$meta_value = array_filter( $_POST[ $meta_key ] );\n\t\t}\n\t\tupdate_post_meta( $post_id, $meta_key, $meta_value );\n\t}",
"function update_revision_meta_field( $revision_id ){\r\n\t\t\t\t$post_parent = wp_is_post_revision($revision_id);\r\n\t\t\t\t\r\n\t\t\t\tforeach( self::$revision_fields as $revision_field ){\r\n\t\t\t\t\t$meta_value = get_post_meta($post_parent, $revision_field['meta_key'], true);\r\n\t\t\t\t\tif( !empty($meta_value) ){\r\n\t\t\t\t\t\tadd_metadata('post', $revision_id, $revision_field['meta_key'], $meta_value);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}",
"function wpbs_update_form_meta($form_id, $meta_key, $meta_value, $prev_value = '')\n{\n\n return wp_booking_system()->db['formmeta']->update($form_id, $meta_key, $meta_value, $prev_value);\n\n}",
"function update_revision_meta_field( $revision_id ){\n\t\t\t\t$post_parent = wp_is_post_revision($revision_id);\n\t\t\t\t\n\t\t\t\tforeach( self::$revision_fields as $revision_field ){\n\t\t\t\t\t$meta_value = get_post_meta($post_parent, $revision_field['meta_key'], true);\n\t\t\t\t\tif( !empty($meta_value) ){\n\t\t\t\t\t\tadd_metadata('post', $revision_id, $revision_field['meta_key'], $meta_value);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}",
"function save_meta_value($post_id, $field) {\n if (isset($_POST[$field])) // Get the posted data\n $new_meta_value = $_POST[$field];\n else\n $new_meta_value = '';\n \n $meta_value = get_post_meta($post_id, $field, true); // Get the meta value of the custom field key.\n \n if ($new_meta_value && '' == $meta_value) // If a new meta value was added and there was no previous value, add it.\n add_post_meta($post_id, $field, $new_meta_value, true);\n elseif ($new_meta_value && $new_meta_value != $meta_value) // If the new meta value does not match the old value, update it.\n update_post_meta($post_id, $field, $new_meta_value);\n elseif ('' == $new_meta_value && $meta_value) // If there is no new meta value but an old value exists, delete it.\n delete_post_meta($post_id, $field, $meta_value);\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Register the validation factory. | protected function registerValidationFactory()
{
$this->app->singleton('validator', function ($app) {
$validator = new Factory($app['translator'], $app);
// The validation presence verifier is responsible for determining the existence of
// values in a given data collection which is typically a relational database or
// other persistent data stores. It is used to check for "uniqueness" as well.
if (isset($app['db'], $app['validation.presence'])) {
$validator->setPresenceVerifier($app['validation.presence']);
}
return $validator;
});
} | [
"protected function registerValidationFactory()\n {\n $this->app->singleton('validator', function ($app) {\n $validator = new Factory($app['translator'], $app);\n\n // The validation presence verifier is responsible for determining the existence\n // of values in a given data collection, typically a relational database or\n // other persistent data stores. And it is used to check for uniqueness.\n if (isset($app['db']) && isset($app['validation.presence'])) {\n $validator->setPresenceVerifier($app['validation.presence']);\n }\n\n return $this->registerCustomRules($validator);\n });\n }",
"protected function registerValidationFactory()\n {\n $this->royalcms->singleton('validator', function ($royalcms) {\n $validator = new Factory($royalcms['translator'], $royalcms);\n\n // The validation presence verifier is responsible for determining the existence\n // of values in a given data collection, typically a relational database or\n // other persistent data stores. And it is used to check for uniqueness.\n if (isset($royalcms['validation.presence'])) {\n $validator->setPresenceVerifier($royalcms['validation.presence']);\n }\n\n return $validator;\n });\n }",
"protected function registerValidationFactory()\n {\n $this->app->singleton('validator', function ($app) {\n $validator = new Factory($app['translator'], $app);\n\n $validator->resolver(function($translator, $data, $rules, $messages, $customAttributes) use ($validator) {\n return new Validator($translator, $data, $rules, $messages, $customAttributes);\n });\n\n // The validation presence verifier is responsible for determining the existence\n // of values in a given data collection, typically a relational database or\n // other persistent data stores. And it is used to check for uniqueness.\n if (isset($app['validation.presence'])) {\n $validator->setPresenceVerifier($app['validation.presence']);\n }\n\n return $validator;\n });\n\n Rule::registerCustomValidator();\n }",
"protected function registerValidationFactory()\n {\n $this->app->singleton('validator', function ($app) {\n $validator = new \\Illuminate\\Validation\\Factory($app['translator'], $app);\n\n // The validation presence verifier is responsible for determining the existence of\n // values in a given data collection which is typically a relational database or\n // other persistent data stores. It is used to check for \"uniqueness\" as well.\n if (isset($app['db'], $app['validation.presence'])) {\n $validator->setPresenceVerifier($app['validation.presence']);\n }\n\n return $validator;\n });\n }",
"protected function getValidationFactory()\r\n {\r\n return app('validator');\r\n }",
"protected function getValidationFactory()\n {\n return app('validator');\n }",
"protected function registerValidators(): void\n\t{\n\t\t$this->app->resolving(Factory::class, static function(Factory $validation_factory, Container $app) {\n\t\t\t$validator = new Validator($app->make(LaravelAddressing::class));\n\n\t\t\t$validation_factory->extend('country', Closure::fromCallable([$validator, 'looseCountry']));\n\t\t\t$validation_factory->extend('country_code', Closure::fromCallable([$validator, 'countryCode']));\n\t\t\t$validation_factory->extend('country_name', Closure::fromCallable([$validator, 'countryName']));\n\n\t\t\t$validation_factory->extend('administrative_area', Closure::fromCallable([$validator, 'looseAdministrativeArea']));\n\t\t\t$validation_factory->extend('administrative_area_code', Closure::fromCallable([$validator, 'administrativeArea']));\n\t\t\t$validation_factory->extend('administrative_area_name', Closure::fromCallable([$validator, 'administrativeAreaName']));\n\n\t\t\t$validation_factory->extend('postal_code', Closure::fromCallable([$validator, 'postalCode']));\n\t\t});\n\t}",
"protected function getValidationFactory()\n\t{\n\t\treturn app('Illuminate\\Contracts\\Validation\\Factory');\n\t}",
"protected function getValidationFactory()\n\t{\n\t\treturn UniversalBuilder::resolveClass( ValidationFactory::class );\n\t}",
"public function getValidationFactory(): callable {\n return $this->validationFactory;\n }",
"public function registerRules(Factory $validator): void\n {\n $validator->extend(\n 'postal_code',\n 'Axlon\\PostalCodeValidation\\PostalCodeValidator@validatePostalCode',\n 'The :attribute must be a valid postal code.'\n );\n\n $validator->extendDependent(\n 'postal_code_with',\n 'Axlon\\PostalCodeValidation\\PostalCodeValidator@validatePostalCodeWith',\n 'The :attribute must be a valid postal code.'\n );\n\n $validator->replacer(\n 'postal_code',\n 'Axlon\\PostalCodeValidation\\PostalCodeValidator@replacePostalCode'\n );\n\n $validator->replacer(\n 'postal_code_with',\n 'Axlon\\PostalCodeValidation\\PostalCodeValidator@replacePostalCodeWith'\n );\n }",
"protected function registerValidationService()\n {\n $this->app->singleton('laravelmodulescore.validation', function ($app) {\n return new ValidationService();\n });\n }",
"protected function getValidator_ValidatorFactoryService()\n {\n return $this->services['validator.validator_factory'] = new \\Symfony\\Bundle\\FrameworkBundle\\Validator\\ConstraintValidatorFactory($this, array('validator.expression' => 'validator.expression', 'Symfony\\\\Component\\\\Validator\\\\Constraints\\\\ExpressionValidator' => 'validator.expression', 'Symfony\\\\Component\\\\Validator\\\\Constraints\\\\EmailValidator' => 'validator.email', 'security.validator.user_password' => 'security.validator.user_password', 'Symfony\\\\Component\\\\Security\\\\Core\\\\Validator\\\\Constraints\\\\UserPasswordValidator' => 'security.validator.user_password', 'doctrine.orm.validator.unique' => 'doctrine.orm.validator.unique', 'Symfony\\\\Bridge\\\\Doctrine\\\\Validator\\\\Constraints\\\\UniqueEntityValidator' => 'doctrine.orm.validator.unique', 'sonata.core.validator.inline' => 'sonata.core.validator.inline', 'Sonata\\\\CoreBundle\\\\Validator\\\\InlineValidator' => 'sonata.admin.validator.inline', 'sonata.admin.validator.inline' => 'sonata.admin.validator.inline', 'sonata.page.validator.unique_url' => 'sonata.page.validator.unique_url', 'Sonata\\\\PageBundle\\\\Validator\\\\UniqueUrlValidator' => 'sonata.page.validator.unique_url', 'cmf_routing.validator.route_defaults' => 'cmf_routing.validator.route_defaults', 'Symfony\\\\Cmf\\\\Bundle\\\\RoutingBundle\\\\Validator\\\\Constraints\\\\RouteDefaultsValidator' => 'cmf_routing.validator.route_defaults', 'sonata.formatter.validator.formatter' => 'sonata.formatter.validator.formatter', 'Sonata\\\\FormatterBundle\\\\Validator\\\\Constraints\\\\FormatterValidator' => 'sonata.formatter.validator.formatter', 'sonata.media.validator.format' => 'sonata.media.validator.format', 'Sonata\\\\MediaBundle\\\\Validator\\\\FormatValidator' => 'sonata.media.validator.format'));\n }",
"protected function createValidation(): Validation {\n return call_user_func($this->getValidationFactory());\n }",
"protected function getValidationFactory(): Factory\n {\n if (!$this->validationFactory instanceof Factory) {\n $this->validationFactory = $this->app->make(Factory::class);\n }\n\n return $this->validationFactory;\n }",
"public function registerValidationVerifier()\n {\n $this->app->bind('validation.presence', function() {\n return new DoctrinePresenceVerifier($this->app[EntityManagerInterface::class]);\n }, true);\n }",
"public function createValidator() : IValidator;",
"public function createValidator();",
"protected function registerHttpValidation()\r\n {\r\n $this->app->singleton('restfy.http.validator', function ($app) {\r\n return new RequestValidator($app);\r\n });\r\n\r\n $this->app->singleton(Domain::class, function ($app) {\r\n return new Validation\\Domain($this->config('domain'));\r\n });\r\n\r\n $this->app->singleton(Prefix::class, function ($app) {\r\n return new Validation\\Prefix($this->config('prefix'));\r\n });\r\n\r\n $this->app->singleton(Accept::class, function ($app) {\r\n return new Validation\\Accept(\r\n $this->app[AcceptParser::class],\r\n $this->config('strict')\r\n );\r\n });\r\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates a form to create a SourceColonie entity. | private function createCreateForm(SourceColonie $entity)
{
$form = $this->createForm(new SourceColonieType(), $entity, array(
'action' => $this->generateUrl('sourcecolonie_create'),
'method' => 'POST',
));
$form->add('submit', 'submit', array('label' => 'Enregistrer'));
return $form;
} | [
"public function newAction() {\n $source = new Source();\n\n $this->addRules($source);\n\n $st = $this->getDoctrine()\n ->getEntityManager()\n ->getRepository('ToxParserBundle:SourceType')\n ->find(1);\n $source->setType($st);\n $form = $this->createForm(new SourceType(), $source);\n\n return array(\n 'source' => $source,\n 'form' => $form->createView()\n );\n }",
"public function create()\n {\n return view(\"aasource.addform\");\n }",
"public function actionCreate()\n {\n $model = new EnergySources();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n //return $this->redirect(['view', 'id' => $model->id]);\n return $this->redirect(['index']);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }",
"public function createAction() {\n $source = new Source();\n $request = $this->getRequest();\n $form = $this->createForm(new SourceType(), $source);\n $form->bindRequest($request);\n if ($form->isValid()) {\n $em = $this->getDoctrine()->getEntityManager();\n $em->persist($source);\n foreach ($source->getRules() as $k => $rule) {\n if (!$rule->getPattern()) {\n $source->removeRule($rule);\n } else {\n $rule->setSource($source);\n $em->persist($rule);\n }\n }\n $em->flush();\n\n return $this->redirect($this->generateUrl('source_show', array('id' => $source->getId())));\n\n }\n\n return array(\n 'source' => $source,\n 'form' => $form->createView()\n );\n }",
"public function newAction()\n {\n \t$entity = new InstanciaEvento();\n \n $eventoid = $this->getRequest()->query->get('evento_id', 0);\n \tif ($eventoid)\n \t\t$entity->setEvento($this->getRepository('CpmJovenesBundle:Evento')->find($eventoid));\n \t\t\n $form = $this->createForm(new InstanciaEventoType(), $entity);\n\t\t$form['preview']->setData(true);\n return array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n );\n }",
"public function newAction()\n {\n/* \t$numfields = $this->getDoctrine()\n \t->getRepository('HegesAppConfigBundle:Configlinetype')\n \t->find($fieldsnumber);\n */\n \t\n \t\n $entity = new Configline();\n $form = $this->createForm(new ConfiglineType(), $entity);\n\n return $this->render('HegesAppConfigFileBundle:Configline:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView()\n ));\n }",
"private function createCreateForm()\n {\n\n \n $form = $this->createForm(new EntregasHcType($this->getDoctrine()->getManager()),null, array(\n 'action' => $this->generateUrl('entregas_hc'),\n 'method' => 'POST',\n 'attr' => array('id' => 'entregas-form')\n ));\n\n \n $form->add('submit', 'submit', array('label' => 'Agregar',\n 'attr' => array('class' =>'btn btn-success')));\n\n \n \n return $form;\n }",
"public function newAction()\n {\n $em = $this->getDoctrine()->getManager();\n \n // Leemos los parámetros\n $parameters = $em->getRepository('IMSysTurBundle:Parameters')->find(1);\n if (!$parameters) {\n throw $this->createNotFoundException('No se pueden encontrar los parámetros de sistema.');\n }\n \n $entity = new Cliente();\n $form = $this->createCreateForm($entity);\n\n return $this->render('IMSysTurBundle:Cliente:newCliente.html.twig', array(\n 'parameters' => $parameters,\n 'entity' => $entity,\n 'edit_form' => $form->createView(),\n ));\n }",
"public function fieldCreateAction() {\n parent::fieldCreateAction();\n\n //GENERATE FORM\n $form = $this->view->form;\n\n if ($form) {\n\n //$form->setTitle('Add Profile Question');\n $form->removeElement('show');\n $form->addElement('hidden', 'show', array('value' => 0));\n\n $display = $form->getElement('display');\n $display->setLabel('Show on profile page?');\n\n $display->setOptions(array('multiOptions' => array(\n 1 => 'Show on profile page',\n 0 => 'Hide on profile page'\n )));\n\n $search = $form->getElement('search');\n $search->setLabel('Show on the search options?');\n\n $search->setOptions(array('multiOptions' => array(\n 0 => 'Hide on the search options',\n 1 => 'Show on the search options'\n )));\n }\n }",
"public function newAction()\n {\n $entity = new Factura();\n $request = $this->getRequest();\n\t\n $form = $this->createForm(new FacturaType(), $entity);\n $form->bind($request);\n \n if ($form->isValid()) {\n \t$em = $this->getDoctrine()->getManager();\n \t//$cliente = $entity->getCliente();\n \t//$entity->setFormapagoFactura($cliente->getFormapagoCliente());\n \t\n \t$em->persist($entity);\n\t \treturn $this->render('PBVentasBundle:Factura:new.html.twig', array(\n\t \t\t\t'entity' => $entity,\n\t \t\t\t'formstep' => 2,\n\t \t\t\t'form' => $form->createView(),\n\t \t));\n }\n return $this->render('PBVentasBundle:Factura:new.html.twig', array(\n \t\t'entity' => $entity,\n \t\t'formstep' => 1,\n \t\t'form' => $form->createView(),\n ));\n }",
"public function newAction()\n {\n $entity = new Sponsor();\n $form = $this->createForm(new SponsorType(), $entity);\n\n return $this->render('CineminoSiteBundle:Sponsor:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }",
"public function newAction()\n {\n $filtro = $this->getDoctrine()->getRepository('BackendBundle:Step')->setFiltroByUser(\n $this->get('security.authorization_checker'), $this->get('security.token_storage')\n );\n $entity = new \\CoolwayFestivales\\BackendBundle\\Entity\\FeastStage();\n $form = $this->createForm(new FeastStageType($filtro, 'crear'), $entity);\n\n return array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n );\n }",
"private function createCreateForm(Ipsexcecoes $entity)\n {\n $form = $this->createForm(new IpsexcecoesType(), $entity, array(\n 'action' => $this->generateUrl('ipsexcecoes_create'),\n 'method' => 'POST',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Criar'));\n\n return $form;\n }",
"public function prenewAction()\n {\n $entity = new Factura();\n $hoy = new \\DateTime();\n $entity->setFecha($hoy);\n $entity->setFechacobro($hoy);\n $form = $this->createForm(new FacturaType(), $entity);\n\n return $this->render('PBVentasBundle:Factura:new.html.twig', array(\n 'entity' => $entity,\n \t'formstep' => 1,\n 'form' => $form->createView(),\n ));\n }",
"private function createUrlForm()\n {\n $this->form = $this->formFactory->create(UrlFormType::class);\n }",
"public function newAction()\n {\n $request = $this->container->get('request');\n $options = $request->get('options');\n $alias = $request->get('alias');\n\n $metadata = $this->getMetadata($options['class']);\n $entity = $this->newEntityInstance($metadata);\n\n $fields = $this->getFields($metadata, $options, 'new');\n $type = $this->getCustomFormType($options, 'new');\n\n $form = $this->createCreateForm($entity, $alias, $fields, $type);\n\n return $this->render(\n 'SgDatatablesBundle:Crud:new.html.twig',\n array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'list_action' => DatatablesRoutingLoader::PREF . $alias . '_index',\n 'heading' => $this->getHeading()\n )\n );\n }",
"public function createAction()\n {\n $entity = new CentreSante();\n $request = $this->getRequest();\n $form = $this->createForm(new CentreSanteType(), $entity);\n $form->bindRequest($request);\n\n\n $em = $this->getDoctrine()->getEntityManager();\n $em->persist($entity);\n $em->flush();\n\n return $this->redirect($this->generateUrl('centresante_show', array('id' => $entity->getId())));\n \n\n return array(\n 'entity' => $entity,\n 'form' => $form->createView()\n );\n }",
"public function actionCreateDatasourceDialog()\n {\n Form::create(\n Yii::t('app', \"Create a new datasource\"),\n [\n 'namedId' => [\n 'type' => 'textfield',\n 'label' => Yii::t('app', \"ID of the datasource\")\n ],\n 'schema' => [\n 'type' => \"selectbox\",\n 'label' => Yii::t('app', \"Schema\"),\n 'options' => Schema::find()->select(\"name as label, namedId as value\")->asArray()->all()\n ],\n\n ],\n true,\n Yii::$app->controller->id, \"create-datasource-handler\", []\n );\n return \"Created dialog to add a datasource\";\n }",
"public function newAction()\n {\n $entity = new DataSolicitudes();\n $options=array('path'=>'datasolicitudes_create','tipoL'=>'ROLE_CENTRO_HIPICO'); \n //tipoL= CH:'Autorizacion' , Oper:'Licencia' \n $form = $this->createCreateForm($entity,$options);\n if(!$form) { throw new \\Symfony\\Component\\HttpKernel\\Exception\\HttpException(500,'Lo siento pero Faltan Datos en la Base de Datos Contacte con el Administrador');}\n //if(!$form) { throw new \\Symfony\\Component\\Config\\Definition\\Exception\\Exception('Lo siento pero Faltan Datos en la Base de Datos Contacte con el Administrador',500);}\n return $this->render('SolicitudesCitasBundle:DataSolicitudes:crear.html.twig',array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ Validates file extension of a give path. | public function validateFileExtension($path) {
if($this->valid_file_extensions === false) {
return true;
}
if(!is_string($path)) {
throw new Exception("validateFileExtension: path is not a string.");
}
if(!is_array($this->valid_file_extensions)) {
throw new Exception("validateFileExtension: valid_file_extensions is not an array.");
}
$extension = array_pop(explode('.', $path));
return in_array($extension, $this->valid_file_extensions);
} | [
"public function validateFileType( $path=null )\n\t{\n\t\tif ($path===null) {\n\t\t\t$path=$this->path->value;\n\t\t}\n\t\treturn (in_array(substr(strrchr($path, \".\"), 1), $this->allowed_extensions));\n\t}",
"function validate_ext() {\n\t\t$extension = $this->get_ext($this->theFile);\n\t\t$ext_array = $this->extensions;\n\t\tif (in_array($extension, $ext_array)) { //Check if file's ext is in the list of allowed exts\n\t\t\treturn true;\n\t\t} else {\n\t\t\t$this->error[] = \"That file type is not supported. The supported file types are: \".$this->extString;\n\t\t\treturn false;\n\t\t}\n\t}",
"function path_has_extension($path)\n{\n\treturn path_extension_index($path) !== FALSE;\n}",
"public function testValidFileExtension()\n {\n $validImage = public_path(\"img/rp/baby.png\");\n\n $validImageExt = pathinfo($validImage, PATHINFO_EXTENSION);\n\n $this->assertTrue(in_array($validImageExt, self::VALID_FILETYPES));\n }",
"function checkExtension() {\n // corregir el nombre del archivo solo en estos casos\n $this->cls_filename = preg_replace(\"/ /\", \"_\", $this->cls_filename);\n $this->cls_filename = preg_replace(\"/%20/\", \"_\", $this->cls_filename);\n $extension = strtolower($this->getExtension($this->getFilename())); \n \n // Chequear si la extension es v�lida\n $this->cls_accepted = in_array($extension, $this->cls_arr_ext_accepted); \n $this->cls_errorCode = (!$this->cls_accepted) ? 1 : 0;\n $this->cls_file_ext = (!$this->cls_accepted) ? '' : $extension;\n // Retornar true si el tipo es valido \n return $this->cls_accepted;\n //return true;\n }",
"public function isExtensionValid(): bool {\n $fileExt = $this->getFileExt();\n return in_array($fileExt, self::SUPPORTED_EXTENSIONS);\n }",
"private function validate_filename($path, $filename, $ext) {\n\n $ext = '.' . $ext;\n\n if ( ! file_exists($path.$filename)) {\n return $filename;\n }\n\n $filename = str_replace($ext, '', $filename);\n if(strlen($filename) > 200) {\n $filename = substr($filename, 80);\n }\n\n $new_filename = '';\n for ($i = 1; TRUE; $i++){\n if ( ! file_exists($path.$filename.$i.$ext)) {\n $new_filename = $filename.$i.$ext;\n break;\n }\n }\n\n if ($new_filename == '') {\n set_flash_error('upload_bad_filename');\n redirect_to_referral();\n }\n\n return $new_filename;\n }",
"function checkExtension()\n\t{\n\t\t$ext = substr( strrchr( $this->mediaName , '.' ) , 1 ) ;\n\t\tif( ! empty( $this->allowedExtensions ) && ! in_array( strtolower( $ext ) , $this->allowedExtensions ) ) {\n\t\t\treturn false;\n\t\t} else {\n\t\t\treturn true;\n\t\t}\n\t}",
"private function isFileExtValid($ext) {\n\t\t$authDirs = $this->getSecuritySettings('fileExts');\n\t\tif ($authDirs['ERROR'] === true) {\n\t\t\treturn false;\n\t\t}\n\t\treturn in_array($ext, $authDirs['EXTLIST']);\t\n\t}",
"protected function checkFileExtension()\n\t{\n\t\t$fileInfo = pathinfo($this -> sourceFile);\n\t\treturn $fileInfo['extension'] == $this -> fileExtension;\n\t}",
"function path_has_extension($path, $extensions = NULL, $ignoreCase = NULL){\n return forward_static_call_array([\\Webmozart\\PathUtil\\Path::class, 'hasExtension'], func_get_args());\n }",
"function check_ext($name) { \n $ext = pathinfo($name, PATHINFO_EXTENSION);\n $allowed=array('txt');\n if( ! in_array( $ext, $allowed ) ) {\n exit;\n }\n}",
"protected function checkExtensions()\n {\n return in_array(\n pathinfo($this->name, PATHINFO_EXTENSION),\n $this->_transfer->allowedExtensions\n );\n }",
"function validar_ext($extension){\n\t \tif($extension=='jpg'|| $extension=='png' || $extension=='bmp' || $extension=='gif'){\n\t \t\treturn \"Y\";\n\t \t}else{\n\t \t\treturn \"N\";\n\t \t}\n \t}",
"private function checkCorrectExtension(){\n\t\treturn (in_array($this->extension, $this->allowedExt));\n\t}",
"public static function ValidExtension()\n {\n $dir = self::GetCwd();\n\n if(\n // Templates\n is_dir($dir . \"/templates\") &&\n\n // Peg configuration file\n (file_exists($dir . \"/peg.conf\") || file_exists($dir . \"/peg.json\"))\n )\n {\n return true;\n }\n\n return false;\n }",
"function check_file_extension($ext, $allowed) {\nif (in_array($ext, $allowed)) {\nreturn true;\n}else {\necho \"Only .txt file allow to be uploaded\";\n}\n}",
"function extensionFromPath ( $path ){\n\t\t\t\t$extension = explode ( '.', $path );\n\t\t\t\t$extension = end( $extension );\n\t\t\t\treturn $extension;\n\t\t\t}",
"public function validateExtension() {\n // if the allowed extension valie is null, all file extensions are allowed\n if (is_null($this->allowedExtensions())) {\n return true;\n }\n \n // if the allowed extensions list is not an array or if the uploaded file\n // extension is not in the list of allowed extensions, throw an exception\n if (!is_array($this->allowedExtensions()) || !in_array($this->extension(), $this->allowedExtensions())) {\n throw new UploadException(\\Th\\FileUploader\\FileUploader::FILE_WRONG_EXTENSION);\n }\n \n // everything ok\n return true;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates a new DirectPurchase model. If creation is successful, the browser will be redirected to the 'update' page. | public function actionCreate()
{
Yii::$app->formatter->timeZone = 'Asia/Jakarta';
$model = new DirectPurchase();
$model->date = Yii::$app->formatter->asDate(time());
$modelDirectPurchaseTrx = new DirectPurchaseTrx();
if (Yii::$app->request->isAjax && $model->load(Yii::$app->request->post())) {
Yii::$app->response->format = Response::FORMAT_JSON;
return ActiveForm::validate($model);
}
if (!empty(($post = Yii::$app->request->post())) && $model->load($post)) {
Yii::$app->formatter->timeZone = 'UTC';
$transaction = Yii::$app->db->beginTransaction();
$flag = false;
if (($flag = ($model->id = Settings::getTransNumber('no_dp')) !== false)) {
if (($flag = $model->save())) {
$model->jumlah_item = 0;
$model->jumlah_harga = 0;
foreach ($post['DirectPurchaseTrx'] as $i => $directPurchaseTrx) {
if ($i !== 'index') {
$temp['DirectPurchaseTrx'] = $directPurchaseTrx;
$newModelDirectPurchaseTrx = new DirectPurchaseTrx();
$newModelDirectPurchaseTrx->load($temp);
$newModelDirectPurchaseTrx->direct_purchase_id = $model->id;
$newModelDirectPurchaseTrx->jumlah_harga = $newModelDirectPurchaseTrx->jumlah_item * $newModelDirectPurchaseTrx->harga_satuan;
if (($flag = $newModelDirectPurchaseTrx->save())) {
$flag = Stock::setStock(
$newModelDirectPurchaseTrx->item_id,
$newModelDirectPurchaseTrx->item_sku_id,
$newModelDirectPurchaseTrx->storage_id,
$newModelDirectPurchaseTrx->storage_rack_id,
$newModelDirectPurchaseTrx->jumlah_item
);
if ($flag) {
$flag = StockMovement::setInflow(
'Inflow-DP',
$newModelDirectPurchaseTrx->item_id,
$newModelDirectPurchaseTrx->item_sku_id,
$newModelDirectPurchaseTrx->storage_id,
$newModelDirectPurchaseTrx->storage_rack_id,
$newModelDirectPurchaseTrx->jumlah_item,
Yii::$app->formatter->asDate(time()),
$newModelDirectPurchaseTrx->direct_purchase_id
);
}
}
if (!$flag) {
break;
}
$model->jumlah_item += $newModelDirectPurchaseTrx->jumlah_item;
$model->jumlah_harga += $newModelDirectPurchaseTrx->jumlah_harga;
}
}
if ($flag) {
$flag = $model->save();
}
}
}
if ($flag) {
Yii::$app->session->setFlash('status', 'success');
Yii::$app->session->setFlash('message1', 'Tambah Data Sukses');
Yii::$app->session->setFlash('message2', 'Proses tambah data sukses. Data telah berhasil disimpan.');
$transaction->commit();
return $this->redirect(['update', 'id' => $model->id]);
} else {
$model->setIsNewRecord(true);
Yii::$app->session->setFlash('status', 'danger');
Yii::$app->session->setFlash('message1', 'Tambah Data Gagal');
Yii::$app->session->setFlash('message2', 'Proses tambah data gagal. Data gagal disimpan.');
$transaction->rollBack();
}
}
return $this->render('create', [
'model' => $model,
'modelDirectPurchaseTrx' => $modelDirectPurchaseTrx,
]);
} | [
"public function actionCreate()\n {\n $this->layout=\"main-admin\";\n $model = new SalesPurchase();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreate()\n {\n $model = new PurchaseOrder();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }",
"public function actionCreate()\n {\n $model = new Purchase();\n if ($model->load(Yii::$app->request->post()) && $model->validate()) {\n\n $file = UploadedFile::getInstance($model, 'purchaseFile');\n if($file!= null){\n $path = date('Y-m-d', time());\n $file->saveAs('../uploads/purchaseFile/' . $path);\n $model->purchaseFile = $file->baseName . '.' . $file->extension;\n }\n\n\n $result = $model->createOrUpdateOne(MyPurchaseController::MODULE_NAME);\n //修改状态\n $dd = new Purchase();\n $name = 'SQ';\n $dd->atuoCreateStatus($name, $model->purchaseID);\n Yii::$app->session->setFlash($result['type'], $result['msg']);\n return $this->redirect(['create-detail', 'id' => $model->purchaseID]);\n }\n return $this->render('create-update', [\n 'model' => $model,\n ]);\n }",
"public function actionCreate()\n {\n $model = new Productpurchaseprice();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->ID]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreate()\n\t{\n\t\t\n\t\t$model = new PurchaseOrder;\n\t\t\n\t\t/*\n\t\tif (!GenericUtils::checkAccess($operation))\n\t\t{\n\t\t\tthrow new CHttpException(403,GenericUtils::ERROR_NO_ACCESS);\n\t\t} */\n\t\t\n\t\tif (isset($_POST['PurchaseOrder']))\n\t\t{\n\t\t\t$model->attributes=$_POST['PurchaseOrder'];\n\t\t\t$model->created_by = LmUtil::UserId();\n\t\t\t$model->status_id = PurchaseOrder::STATUS_NEW;\n\t\t\t\n\t\t\t\n\t\t\tif($model->validate() && $model->save())\n\t\t\t{\n\t\t\t\t\n\t\t\t\n\t\t\t\t//generate our PO number based on format specified\n\t\t\t\t//todo perhaps we can move this to store procedure\n\t\t\t\t//or use AR before/afterSave method\n\t\t\t\t\n\t\t\t\t$model->text_id = DocumentIdSetting::formatID($model->library_id,PurchaseOrder::DOCUMENT_TYPE,$model->id);\n\t\t\t\tif ($model->save())\n\t\t\t\t{\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\tYii::app()->user->setFlash('success','Purchase Order created');\n\t\t\t\t$this->redirect(array('update',\n\t\t\t\t\t\t\t\t\t\t 'id'=>$model->id\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}else \n\t\t\t\t{\n\t\t\t\t\tLmUtil::logError('Error assigning PO ID');\t\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t//error while saving\n\t\t\t\tYii::log('Error saving Purchase order','error','PurchaseOrderController.Create');\n\t\t\t}\n\t\t} \n\t\t//handle vendor lookup\n\t\t$vendor = new Vendor('search');\t\n\t\tif (isset($_GET['Vendor']))\n\t\t{\n\t\t\t$vendor->unsetAttributes();\n\t\t\t$vendor->attributes=$_GET['Vendor'];\n\t\t}\n\t\t$vendorDP = $vendor->search();\t\n\t\t\n\t\t\n\t\t$this->render('create',array('model'=>$model,'vendorDP'=>$vendorDP));\n\t\t\n\t\n\t\n\t}",
"public function actionCreate()\n { \n $model = new Payment();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->renderAjax('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreate()\n {\n $model = new ChargeProduct();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }",
"public function actionCreate()\n {\n $model = new Payments();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreate()\n {\n $model = new Payment();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }",
"public function actionCreate()\n {\n $model = new VtigerSalesorder();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->salesorderid]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreate()\n {\n $model = new EtsyShopDetails();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreate()\n {\n $model = new Delivery();\n\n if ($model->load(Yii::$app->request->post()) && $model->validate()) {\n $model->save();\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }",
"public function actionCreate()\n {\n $model = new StoreCommission();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }",
"public function actionCreate()\n {\n $model = new PaymentsAmount();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id, 'payments_id' => $model->payments_id, 'payment_setup_id' => $model->payment_setup_id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreate()\n {\n $model = new Recharge();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreate()\r\n {\r\n $model = new Delivery();\r\n\r\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\r\n return $this->redirect(['view', 'id' => $model->id]);\r\n } else {\r\n return $this->render('create', [\r\n 'model' => $model,\r\n ]);\r\n }\r\n }",
"public function actionCreate()\n {\n $model = new PurchaseOrder();\n // getting the list of all purchase order statuses\n // for choosing from dropdown Select2 widget\n $po_status_list = ArrayHelper::map(PoStatus::find()->all(), 'id', 'status_name');\n // setting default order status - \"in progress\"\n $model->status_id = 1;\n // logging the user who creates and updates purchase order\n $model->created_by = Yii::$app->user->id;\n $model->updated_by = Yii::$app->user->id;\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['/purchase-order-details/add-products-to-po', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n 'po_status_list' => $po_status_list,\n ]);\n }\n }",
"public function actionCreate()\n {\n $model = new BonanzaPayment();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreate()\n {\n $model = new Wxshop();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->s_id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the rights of withdrawal information. | public function getRightsOfWithdrawalInformation() {
if (self::$rightsOfWithdrawalInformation==null) {
self::$rightsOfWithdrawalInformation = new RightsOfWithdrawalInformation();
}
return self::$rightsOfWithdrawalInformation;
} | [
"public function get_available_rights();",
"public function withdrawals(){\n $response = $this->curl(\"viewer/withdrawals\");\n if ($this->errors($response,'withdrawals')) {\n return $response;\n }\n }",
"public function getRights() {\n return $this->get('rights', 'user');\n }",
"public function getWorshipWithdraw()\n {\n return $this->get(self::_WORSHIP_WITHDRAW);\n }",
"public abstract function getRequiredRights();",
"public function exportRights()\n\t{\n\t\treturn $this->rights;\n\t}",
"public function Rights()\n {\n return $this->rights;\n }",
"public function getRights()\n {\n return $this->rights;\n }",
"public function getRights()\n\t{\n\t\tglobal $user;\n\n\t\treturn $user->rights->fournisseur->commande;\n\t}",
"public function getRights()\n {\n $principal = System_Api_Principal::getCurrent();\n\n $query = 'SELECT r.project_id, r.user_id, r.project_access FROM {rights} AS r';\n if ( !$principal->isAdministrator() )\n $query .= ' JOIN {effective_rights} AS r2 ON r2.project_id = r.project_id AND r2.user_id = %d';\n $query .= ' JOIN {projects} AS p ON p.project_id = r.project_id'\n . ' WHERE p.is_archived = 0';\n\n return $this->connection->queryTable( $query, $principal->getUserId() );\n }",
"public function get_deposits_withdrawals();",
"public function getRights();",
"public function checkApprovalRights(){\n $check = YumUser::approvalRights($this->id);\n return $check['has_right'];\n }",
"public function getRights() {\n return $this->rights;\n }",
"public function getWarranty();",
"public function getPrivilegies(){\n \treturn $this->privilege;\n }",
"public function getUserRights(){\n\t\treturn $GLOBALS['db']->select(\"select * from user_rights order by id\");\t\n\t}",
"private function getWithdrawals() {\n $result = pg_query_params(\n \"SELECT * from student_withdrawals WHERE student=$1 \" . \n \"AND date>=$2 AND date<=$3 \" .\n \"ORDER BY date ASC\", \n array($this->studentId, $this->startDate, $this->endDate));\n \n if (!$result) {\n throw new Exception(pg_last_error());\n }\n \n return pg_fetch_all($result);\n }",
"public function getAccessResources() {\n //in this case we can change the rights without loggin out\n return $this->getTable()->getAccessResources(); \n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
OneToMany (owning side) Get fkArrecadacaoParcelaDocumentos | public function getFkArrecadacaoParcelaDocumentos()
{
return $this->fkArrecadacaoParcelaDocumentos;
} | [
"public function getFkArrecadacaoDocumentos()\n {\n return $this->fkArrecadacaoDocumentos;\n }",
"public function getFkArrecadacaoParcelas()\n {\n return $this->fkArrecadacaoParcelas;\n }",
"public function getFkArrecadacaoParcela()\n {\n return $this->fkArrecadacaoParcela;\n }",
"public function getFkArrecadacaoParcelaProrrogacoes()\n {\n return $this->fkArrecadacaoParcelaProrrogacoes;\n }",
"public function getFkDocumentodinamicoDocumentos()\n {\n return $this->fkDocumentodinamicoDocumentos;\n }",
"public function getFkArrecadacaoObservacaoPagamentos()\n {\n return $this->fkArrecadacaoObservacaoPagamentos;\n }",
"public function getFkArrecadacaoFundamentacaoProrrogacoes()\n {\n return $this->fkArrecadacaoFundamentacaoProrrogacoes;\n }",
"public function getFkPessoalArquivoCargos()\n {\n return $this->fkPessoalArquivoCargos;\n }",
"public function getFkAdministracaoModeloArquivosDocumentos()\n {\n return $this->fkAdministracaoModeloArquivosDocumentos;\n }",
"public function getFkArrecadacaoParcelaReemissoes()\n {\n return $this->fkArrecadacaoParcelaReemissoes;\n }",
"public function getDirectoresPorPeliculas()\n {\n return $this->hasMany(DirectoresPorPelicula::className(), ['idpelicula' => 'id']);\n }",
"public function getFkPatrimonioArquivoColetoraDados()\n {\n return $this->fkPatrimonioArquivoColetoraDados;\n }",
"public function getFkArrecadacaoDocumentoEmissao()\n {\n return $this->fkArrecadacaoDocumentoEmissao;\n }",
"public function getForeignKeys ();",
"public function getFkImobiliarioTransferenciaDocumentos()\n {\n return $this->fkImobiliarioTransferenciaDocumentos;\n }",
"public function getFkArrecadacaoArrecadacaoModulos()\n {\n return $this->fkArrecadacaoArrecadacaoModulos;\n }",
"public function getDocumentoConsignado()\r\n\t\t{\r\n\t\t\treturn $this->hasMany(DocumentoConsignado::className(), ['id_documento' => 'id_documento']);\r\n\t\t}",
"public function getFkPessoalContratoServidores()\n {\n return $this->fkPessoalContratoServidores;\n }",
"public function getFkPessoalOcorrencia()\n {\n return $this->fkPessoalOcorrencia;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the name of the association from the target table to the junction table, this name is used to generate alias in the query and to later on retrieve the results. | protected function _junctionAssociationName(): string
{
if (!isset($this->_junctionAssociationName)) {
$this->_junctionAssociationName = $this->getTarget()
->getAssociation($this->junction()->getAlias())
->getName();
}
return $this->_junctionAssociationName;
} | [
"protected function getJoinTable(): string\n {\n return \"{$this->define(SchemaInterface::TABLE)} AS {$this->getAlias()}\";\n }",
"public function generateJoinAlias(string $association): string;",
"public function getJunctionTable(): string\n {\n return $this->options['junctionTable'] ?? '';\n }",
"public function getQualifiedRelatedKeyName()\n {\n return $this->table.$this->relatedKey;\n }",
"public function varJoinName()\n\t{\n\t\treturn $this->propertyName($this->joinRef);\n\t}",
"public function getCategoriesAssocTableName()\n {\n $prefix = '';\n if (defined('TABLE_PREFIX')) {\n $prefix = TABLE_PREFIX;\n }\n return $prefix . $this->_categoriesAssocTableName;\n }",
"public function getQualifiedOtherKeyName()\n {\n return $this->related->getTable().'.'.$this->otherKey;\n }",
"public function getReferencedTableName()\n {\n if ($this->isReferenced()) {\n return ltrim($this->name, '@');\n }\n\n return $this->name;\n }",
"public function get_target_table_name();",
"private function mapRelationForeignKey()\n {\n $tablePrefixes = [\n 't_',\n 'tm_',\n 'tr_',\n 'tb_',\n ];\n\n return $this->referencePrimaryKey . '_' . str_replace($tablePrefixes, '', $this->referenceTable);\n }",
"public function getRelationshipMethodName()\n {\n return $this->relatedAlias ? $this->relatedAlias : str_singular(lcfirst(class_basename($this->relatedClassName)));\n }",
"public function getForeignTableAlias() {\n\t\treturn $this->foreignTableAlias;\n\t}",
"public function getAlias(){\n return $this->table_as;\n }",
"function getAssociationMappedByTargetField($assocName);",
"function joinName($thisTable, $joinedTable) {\n\t\tif ($thisTable == T_CARDS && $joinedTable == T_FIXTURES) return \"Authorised Fixtures\";\n\t\tif ($thisTable == T_FIXTURES && $joinedTable == T_CARDS) return \"Authorised Cards\";\n\n\t\treturn $joinedTable;\n\t}",
"public function getName() {\n\n//\t\techo get_class($this) . ' => ';\n//\t\techo \"getName(): $this->targetDBTableName: $this->alias, $this->prefix\\n\";\n\n\t\tif (!$this->alias) {\n\t\t\t$this->alias = $this->makeAlias();\n\t\t}\n\n\t\tif ($this->alias === null) {\n\t\t\t// filter out local table prefix in target table name\n\t\t\t$regex = '/^(?:' . preg_quote($this->localDBTableName)\n\t\t\t\t\t. '|' . preg_quote(NameMaker::singular($this->localDBTableName)) . ')'\n\t\t\t\t\t. '_(?P<target>.+)$/';\n\t\t\tif ($this->isTrimLocalTablePrefix() &&\n\t\t\t\t\tpreg_match($regex, $this->targetDBTableName, $matches)) {\n\t\t\t\t$target = $matches['target'];\n\t\t\t} else {\n\t\t\t\t$target = $this->targetDBTableName;\n\t\t\t}\n\n\t\t\tif ($this instanceof ModelRelationHasOne) {\n\t\t\t\t$name = NameMaker::modelFromDB($target);\n\t\t\t} else if ($this instanceof ModelRelationHasMany) {\n\t\t\t\t$name = NameMaker::pluralizeModel(NameMaker::modelFromDB($target));\n\t\t\t} else {\n\t\t\t\tprint_r($this);\n\t\t\t\tthrow new IllegalStateException(get_class($this) . ' => ' . $this);\n\t\t\t}\n\t\t\treturn $this->formatAlias($name);\n\t\t} else {\n\t\t\treturn $this->alias;\n\t\t}\n\t}",
"public function getRelationshipName();",
"public function getQualifiedForeignKeyName()\n {\n return $this->foreignKey;\n }",
"protected function joining_table()\n\t{\n\t\treturn $this->connection()->table($this->joining);\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the private 'TYPO3\CMS\Extbase\Mvc\RequestHandlerResolver' shared autowired service. | protected function getRequestHandlerResolverService()
{
$this->privates['TYPO3\\CMS\\Extbase\\Mvc\\RequestHandlerResolver'] = $instance = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstanceForDi(\TYPO3\CMS\Extbase\Mvc\RequestHandlerResolver::class, ($this->services['TYPO3\\CMS\\Extbase\\Configuration\\RequestHandlersConfigurationFactory'] ?? $this->getRequestHandlersConfigurationFactoryService()));
$instance->injectObjectManager(($this->services['TYPO3\\CMS\\Extbase\\Object\\ObjectManager'] ?? $this->getObjectManagerService()));
return $instance;
} | [
"protected function getFrontendRequestHandlerService()\n {\n $this->services['TYPO3\\\\CMS\\\\Extbase\\\\Mvc\\\\Web\\\\FrontendRequestHandler'] = $instance = \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::makeInstanceForDi(\\TYPO3\\CMS\\Extbase\\Mvc\\Web\\FrontendRequestHandler::class);\n\n $instance->injectConfigurationManager(($this->services['TYPO3\\\\CMS\\\\Extbase\\\\Configuration\\\\ConfigurationManager'] ?? $this->getConfigurationManagerService()));\n $instance->injectDispatcher(($this->services['TYPO3\\\\CMS\\\\Extbase\\\\Mvc\\\\Dispatcher'] ?? $this->getDispatcherService()));\n $instance->injectRequestBuilder(($this->services['TYPO3\\\\CMS\\\\Extbase\\\\Mvc\\\\Web\\\\RequestBuilder'] ?? $this->getRequestBuilderService()));\n $instance->injectObjectManager(($this->services['TYPO3\\\\CMS\\\\Extbase\\\\Object\\\\ObjectManager'] ?? $this->getObjectManagerService()));\n $instance->injectEnvironmentService(($this->services['TYPO3\\\\CMS\\\\Extbase\\\\Service\\\\EnvironmentService'] ?? $this->getEnvironmentServiceService()));\n\n return $instance;\n }",
"protected function getRequestHandlerService()\n {\n return $this->services['TYPO3\\\\CMS\\\\Backend\\\\Http\\\\RequestHandler'] = \\TYPO3\\CMS\\Backend\\ServiceProvider::getRequestHandler($this);\n }",
"public function &getRequestHandler(): \\WEPPO\\Routing\\RequestHandler {\n return $this->requestHandler;\n }",
"public function getRequestHandler()\n {\n return $this->coreContainer[RequestHandler::class];\n }",
"protected function getControllerResolverService()\n {\n return $this->services['controller_resolver'] = new \\Drupal\\Core\\Controller\\ControllerResolver($this->get('class_resolver'), $this->get('logger.channel.default'));\n }",
"protected function getControllerResolverService()\n {\n return $this->services['controller_resolver'] = new \\WellCommerce\\Core\\Component\\Controller\\ControllerResolver($this);\n }",
"public function getRequestHandler(): RequestHandler\n {\n return $this->g(RequestHandler::class);\n }",
"protected function getControllerResolverService()\n {\n return $this->services['controller_resolver'] = new \\Symfony\\Bundle\\FrameworkBundle\\Controller\\ControllerResolver($this, $this->get('controller_name_converter'), $this->get('monolog.logger.request', ContainerInterface::NULL_ON_INVALID_REFERENCE));\n }",
"protected function getStaticRouteResolverService()\n {\n return $this->services['TYPO3\\\\CMS\\\\Frontend\\\\Middleware\\\\StaticRouteResolver'] = \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::makeInstanceForDi(\\TYPO3\\CMS\\Frontend\\Middleware\\StaticRouteResolver::class, ($this->services['TYPO3\\\\CMS\\\\Core\\\\Http\\\\RequestFactory'] ?? $this->getRequestFactoryService()), ($this->services['TYPO3\\\\CMS\\\\Core\\\\LinkHandling\\\\LinkService'] ?? ($this->services['TYPO3\\\\CMS\\\\Core\\\\LinkHandling\\\\LinkService'] = \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::makeInstanceForDi(\\TYPO3\\CMS\\Core\\LinkHandling\\LinkService::class))));\n }",
"protected function getSiteResolver2Service()\n {\n return $this->services['TYPO3\\\\CMS\\\\Frontend\\\\Middleware\\\\SiteResolver'] = \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::makeInstanceForDi(\\TYPO3\\CMS\\Frontend\\Middleware\\SiteResolver::class, ($this->services['TYPO3\\\\CMS\\\\Core\\\\Routing\\\\SiteMatcher'] ?? $this->getSiteMatcherService()));\n }",
"protected function getControllerResolverService()\n {\n return $this->services['controller_resolver'] = new \\Symfony\\Bundle\\FrameworkBundle\\Controller\\ControllerResolver($this, $this->get('controller_name_converter'), $this->get('logger'));\n }",
"public function resolveRequestHandler() {\n\t\t$availableRequestHandlerClassNames = $this->reflectionService->getAllImplementationClassNamesForInterface('F3\\FLOW3\\MVC\\RequestHandlerInterface');\n\n\t\t$suitableRequestHandlers = array();\n\t\tforeach ($availableRequestHandlerClassNames as $requestHandlerClassName) {\n\t\t\tif (!$this->objectManager->isObjectRegistered($requestHandlerClassName)) continue;\n\n\t\t\t$requestHandler = $this->objectManager->getObject($requestHandlerClassName);\n\t\t\tif ($requestHandler->canHandleRequest()) {\n\t\t\t\t$priority = $requestHandler->getPriority();\n\t\t\t\tif (isset($suitableRequestHandlers[$priority])) throw new \\F3\\FLOW3\\MVC\\Exception('More than one request handler with the same priority can handle the request, but only one handler may be active at a time!', 1176475350);\n\t\t\t\t$suitableRequestHandlers[$priority] = $requestHandler;\n\t\t\t}\n\t\t}\n\t\tif (count($suitableRequestHandlers) === 0) throw new \\F3\\FLOW3\\MVC\\Exception('No suitable request handler found.', 1205414233);\n\t\tksort($suitableRequestHandlers);\n\t\treturn array_pop($suitableRequestHandlers);\n\t}",
"protected function getDebug_ControllerResolverService()\n {\n return $this->get('controller_resolver');\n }",
"protected function getArgumentResolver_RequestService()\n {\n return $this->services['argument_resolver.request'] = new \\Symfony\\Component\\HttpKernel\\Controller\\ArgumentResolver\\RequestValueResolver();\n }",
"protected function getAutocompleteControllerService()\n {\n $instance = \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::makeInstanceForDi(\\TYPO3\\CMS\\Fluid\\ViewHelpers\\Widget\\Controller\\AutocompleteController::class);\n\n $instance->injectConfigurationManager(($this->services['TYPO3\\\\CMS\\\\Extbase\\\\Configuration\\\\ConfigurationManager'] ?? $this->getConfigurationManagerService()));\n $instance->injectObjectManager(($this->services['TYPO3\\\\CMS\\\\Extbase\\\\Object\\\\ObjectManager'] ?? $this->getObjectManagerService()));\n $instance->injectSignalSlotDispatcher(($this->services['TYPO3\\\\CMS\\\\Extbase\\\\SignalSlot\\\\Dispatcher'] ?? $this->getDispatcher2Service()));\n $instance->injectValidatorResolver(($this->services['TYPO3\\\\CMS\\\\Extbase\\\\Validation\\\\ValidatorResolver'] ?? $this->getValidatorResolverService()));\n $instance->injectViewResolver(($this->privates['TYPO3\\\\CMS\\\\Extbase\\\\Mvc\\\\View\\\\GenericViewResolver'] ?? $this->getGenericViewResolverService()));\n $instance->injectReflectionService(($this->services['TYPO3\\\\CMS\\\\Extbase\\\\Reflection\\\\ReflectionService'] ?? $this->getReflectionServiceService()));\n $instance->injectCacheService(($this->services['TYPO3\\\\CMS\\\\Extbase\\\\Service\\\\CacheService'] ?? $this->getCacheServiceService()));\n $instance->injectHashService(($this->services['TYPO3\\\\CMS\\\\Extbase\\\\Security\\\\Cryptography\\\\HashService'] ?? $this->getHashServiceService()));\n $instance->injectMvcPropertyMappingConfigurationService(($this->services['TYPO3\\\\CMS\\\\Extbase\\\\Mvc\\\\Controller\\\\MvcPropertyMappingConfigurationService'] ?? $this->getMvcPropertyMappingConfigurationServiceService()));\n $instance->injectEventDispatcher(($this->services['Psr\\\\EventDispatcher\\\\EventDispatcherInterface_decorated_1'] ?? $this->getEventDispatcherInterfaceDecorated1Service()));\n\n return $instance;\n }",
"protected function getFoundhandlerService()\n {\n return $this->services['foundhandler'] = new \\Slim\\Handlers\\Strategies\\RequestResponse();\n }",
"protected function getAbstractControllerService()\n {\n $instance = \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::makeInstanceForDi(\\TYPO3\\CMS\\Extensionmanager\\Controller\\AbstractController::class);\n\n $instance->injectConfigurationManager(($this->services['TYPO3\\\\CMS\\\\Extbase\\\\Configuration\\\\ConfigurationManager'] ?? $this->getConfigurationManagerService()));\n $instance->injectObjectManager(($this->services['TYPO3\\\\CMS\\\\Extbase\\\\Object\\\\ObjectManager'] ?? $this->getObjectManagerService()));\n $instance->injectSignalSlotDispatcher(($this->services['TYPO3\\\\CMS\\\\Extbase\\\\SignalSlot\\\\Dispatcher'] ?? $this->getDispatcher2Service()));\n $instance->injectValidatorResolver(($this->services['TYPO3\\\\CMS\\\\Extbase\\\\Validation\\\\ValidatorResolver'] ?? $this->getValidatorResolverService()));\n $instance->injectViewResolver(($this->privates['TYPO3\\\\CMS\\\\Extbase\\\\Mvc\\\\View\\\\GenericViewResolver'] ?? $this->getGenericViewResolverService()));\n $instance->injectReflectionService(($this->services['TYPO3\\\\CMS\\\\Extbase\\\\Reflection\\\\ReflectionService'] ?? $this->getReflectionServiceService()));\n $instance->injectCacheService(($this->services['TYPO3\\\\CMS\\\\Extbase\\\\Service\\\\CacheService'] ?? $this->getCacheServiceService()));\n $instance->injectHashService(($this->services['TYPO3\\\\CMS\\\\Extbase\\\\Security\\\\Cryptography\\\\HashService'] ?? $this->getHashServiceService()));\n $instance->injectMvcPropertyMappingConfigurationService(($this->services['TYPO3\\\\CMS\\\\Extbase\\\\Mvc\\\\Controller\\\\MvcPropertyMappingConfigurationService'] ?? $this->getMvcPropertyMappingConfigurationServiceService()));\n $instance->injectEventDispatcher(($this->services['Psr\\\\EventDispatcher\\\\EventDispatcherInterface_decorated_1'] ?? $this->getEventDispatcherInterfaceDecorated1Service()));\n\n return $instance;\n }",
"protected function getDispatcherService()\n {\n return $this->services['TYPO3\\\\CMS\\\\Extbase\\\\Mvc\\\\Dispatcher'] = \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::makeInstanceForDi(\\TYPO3\\CMS\\Extbase\\Mvc\\Dispatcher::class, ($this->services['TYPO3\\\\CMS\\\\Extbase\\\\Object\\\\ObjectManager'] ?? $this->getObjectManagerService()), $this, ($this->services['Psr\\\\EventDispatcher\\\\EventDispatcherInterface_decorated_1'] ?? $this->getEventDispatcherInterfaceDecorated1Service()));\n }",
"protected function getRequestHelperService()\n {\n return $this->services['Yoast\\\\WP\\\\SEO\\\\Helpers\\\\Request_Helper'] = new \\Yoast\\WP\\SEO\\Helpers\\Request_Helper();\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
A posthook for Device edit calls. The $request['before'] and $request['after'] variables contain the respective device data. The $flags contain any flags passed by the system (this is not widely used). This method is optional. | public function onafteredit($request = [], $flags = [])
{
// If the label doesn't contain the word "cool" then do something.
if (isset($request['before']['label']) && stripos($request['before']['label'],'cool')) {
// Do something
}
return true;
} | [
"public function callbackAfterEdit(Request $request, BaseModel $item) {}",
"function hook__pre_edit(&$data) { return true; }",
"protected function beforeEdit()\n {\n }",
"function postEdit(Domain $domain){\n\n\t}",
"public function editDevice(){\n }",
"public function hook_after_edit($id)\n {\n //Your code here\n\n }",
"public function handleSubmittedData($request, $context) {\n $sane= TRUE;\n switch ($this->getValue('mode')) {\n case 'update':\n $event= Event::getByEvent_id($this->wrapper->getEvent_id());\n break;\n \n case 'create':\n default:\n $event= new Event();\n break;\n }\n\n $event->setName($this->wrapper->getName());\n $event->setDescription($this->wrapper->getDescription());\n $event->setTeam_id($this->wrapper->getTeam());\n $event->setEvent_type_id($this->wrapper->getEvent_type());\n $event->setChangedby($context->user->getUsername());\n $event->setLastchange(Date::now());\n \n $targetdate= $this->wrapper->getTarget_date();\n list($th, $tm)= preg_split('/[:\\.\\-]/', $this->wrapper->getTarget_time(), 2);\n $targetdate= Date::create(\n $targetdate->getYear(),\n $targetdate->getMonth(),\n $targetdate->getDay(),\n $th,\n $tm,\n 0\n );\n \n $deadline= $this->wrapper->getDeadline_date();\n if ($deadline instanceof Date) {\n list($dh, $dm)= preg_split('/[:\\.\\-]/', $this->wrapper->getDeadline_time(), 2);\n $deadline= Date::create(\n $deadline->getYear(),\n $deadline->getMonth(),\n $deadline->getDay(),\n $dh,\n $dm,\n 0\n );\n }\n \n // Check order of dates. Now < deadline < target_date\n with ($now= Date::now()); {\n if ($now->isAfter($targetdate)) {\n $this->addError('order', 'target_date');\n $sane= FALSE;\n }\n \n if (\n $deadline &&\n $targetdate->isBefore($deadline)\n ) {\n $this->addError('order', 'deadline_date');\n $sane= FALSE;\n }\n }\n \n // Max attendees must be greater or requal than requireds\n if ($this->wrapper->getMax() < $this->wrapper->getReq()) {\n $this->addError('order', 'max');\n $this->addError('order', 'req');\n $sane= FALSE;\n }\n \n $event->setTarget_date($targetdate);\n $event->setDeadline($daedline);\n \n $event->setMax_attendees($this->wrapper->getMax());\n $event->setReq_attendees($this->wrapper->getReq());\n $event->setAllow_guests($this->wrapper->getGuests());\n \n // Some check failed, bail out...\n if (!$sane) return FALSE;\n \n switch ($this->getValue('mode')) {\n case 'update': {\n $event->update();\n break;\n }\n\n case 'create':\n default: {\n $event->insert();\n break;\n }\n }\n \n return TRUE;\n }",
"public function hook_after_edit($id) {\n\t //Your code here\n\n\t }",
"public function postEditorModeUpdate(Request $request) {\n if(!$this->canAccess()) return;\n $settings = Settings::first();\n if($settings == null) {\n $settings = new Settings();\n }\n $settings->editormode = $request->input('toggle');\n $settings->save();\n }",
"function setEditData($flag=TRUE) {\n if($flag)\n $this->_editData = 1;\n else\n $this->_editData = 0;\n }",
"private function setCustomRequestPath()\n {\n curl_setopt($this->curl, CURLOPT_CUSTOMREQUEST, 'PATCH');\n\n $this->setPostFields();\n }",
"function editon($req) {\n switch ($req) {\n case 6 :$request = 'Name of';\n break;\n case 7 :$request = 'Long Description of';\n break;\n case 8: $request = 'Short Description of';\n break;\n case 9: $request = 'Image of';\n break;\n }\n return $request;\n }",
"public function setFlags($flags){}",
"public function saveDataAfterRequest()\n {\n if (!$this->_waitingToSaveModifiedConfigData) {\n Craft::$app->on(Application::EVENT_AFTER_REQUEST, [$this, 'saveModifiedConfigData']);\n $this->_waitingToSaveModifiedConfigData = true;\n }\n }",
"protected function onAfterUpdate(Item $item, Request $request)\n {\n }",
"function hook_flag_options_alter(array &$options, FlagInterface $flag) {\n\n}",
"public function modifyInstanceAttribute($request);",
"public function doEditFlagField() {\n $flag_id = $this->flag->id();\n\n $this->drupalGet('node/' . $this->nodeId);\n\n // Get the details form.\n $this->clickLink($this->flag->getShortText('unflag'));\n\n $node_url = Url::fromRoute('entity.node.canonical', ['node' => $this->nodeId]);\n $this->assertUrl('flag/details/edit/' . $flag_id . '/' . $this->nodeId, [\n 'query' => [\n 'destination' => $node_url->toString(),\n ],\n ]);\n\n // See if the details message is displayed.\n $this->assertText($this->flagDetailsMessage);\n\n // See if the field value was preserved.\n $this->assertFieldByName('field_' . $this->flagFieldId . '[0][value]', $this->flagFieldValue);\n\n // Update the field value.\n $this->flagFieldValue = $this->randomString();\n $edit = [\n 'field_' . $this->flagFieldId . '[0][value]' => $this->flagFieldValue,\n ];\n $this->submitForm($edit, $this->updateButtonText);\n\n // Get the details form.\n $this->drupalGet('flag/details/edit/' . $flag_id . '/' . $this->nodeId);\n\n // See if the field value was preserved.\n $this->assertFieldByName('field_' . $this->flagFieldId . '[0][value]', $this->flagFieldValue);\n }",
"public function afterRequest()\n\t{\n\t\t$this->trigger('afterRequest');\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the value of digitoVerificador | public function getDigitoVerificador()
{
return $this->digitoVerificador;
} | [
"public function getDigitoagencia()\n\t{\n\t\treturn $this->digitoagencia;\n\t}",
"public function getDigitoCodigoBarras() {\n return $this->iDigitoVerificador;\n }",
"public function getValorVenta()\n {\n return $this->valorVenta;\n }",
"function digitoVerificador($nroCodBar)\n {\n // $Numero = '0123456789';\n $j = strlen($nroCodBar);\n $par = 0;\n $impar = 0;\n for ($i = 0; $i < $j; $i++) {\n if ($i % 2 == 0) {\n $par = $par + $nroCodBar[$i];\n } else {\n $impar = $impar + $nroCodBar[$i];\n }\n }\n $par = $par * 3;\n $suma = $par + $impar;\n for ($i = 0; $i < 9; $i++) {\n if (fmod(($suma + $i), 10) == 0) {\n $verificador = $i;\n }\n }\n $digito = 10 - ($suma - (intval($suma / 10) * 10));\n if ($digito == 10) {\n $digito = 0;\n }\n return $nroCodBar . $digito;\n }",
"private function getVatNumber() {\n\n return substr($this->vatId['vatId'], 2);\n }",
"public function getVatNumber(): string\n {\n return $this->vatNumber;\n }",
"public function veriCode() {}",
"public function getVerif()\n {\n return $this->Verif;\n }",
"public function digitoVerificadorNossoNumero($nosso_numero)\n {\n //die($nosso_numero);\n $modulo = self::modulo11($nosso_numero, 7);\n\n //die(print_r($modulo));\n\n $digito = 11 - $modulo['resto'];\n\n if ($digito == 10) {\n $dv = \"P\";\n } elseif ($digito == 11) {\n $dv = 0;\n } else {\n $dv = $digito;\n }\n\n return $dv;\n }",
"function __getDigitoVerificador($lcBloque) {\n\t\t$Pond = 9713;\n\t\t$lnSuma = 0;\n\t\t$lnLargo = strlen($lcBloque);\n\t\t$j=3;\n\t\tfor($i=1;$i<=$lnLargo;$i++){\n\t\t\t$lnSuma = $lnSuma + (substr($lcBloque, $lnLargo - $i, 1)) * (substr($Pond, $j, 1));\n\t\t\tif ($j==0) {\n\t\t\t\t$j=3;\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$j--;\n\t\t\t}\n\t\t}\n\t\treturn ((10 - ($lnSuma%10))%10);\n\t}",
"public function getCodeVentilVente() {\n return $this->codeVentilVente;\n }",
"public function getVatNumber()\n {\n return $this->response['vatNumber'];\n }",
"public function getTapvcodigo()\n\t{\n\t\treturn $this->tapvcodigo;\n\t}",
"public function getValorRecebido()\n {\n return $this->valor_principal;\n }",
"public function getValorNota()\r\n {\r\n return $this->valornota;\r\n }",
"public function getValor()\n {\n return $this->valor;\n }",
"public function getVNumeroCompte() {\n return $this->vNumeroCompte;\n }",
"public function getValor()\n {\n return $this->valor;\n }",
"public function getDecryptedValue(): string {\n\t\t$token = explode(':', $this->value);\n\t\tif (\\count($token) !== 2) {\n\t\t\treturn '';\n\t\t}\n\t\t$obfuscatedToken = $token[0];\n\t\t$secret = $token[1];\n\t\treturn base64_decode($obfuscatedToken) ^ base64_decode($secret);\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Registers a singleton abstract against the container. | public function singleton(string $abstract, Closure $concrete): void; | [
"protected function registerSingletons()\n {\n }",
"protected function registerSingletons(): void\n {\n $this->app->singleton(LoginInterface::class, Login::class);\n }",
"public function registerSingleton($hint, $class);",
"abstract public function register();",
"public function registerSingleton($className, $params);",
"protected static function _singletonContainer()\n {\n if (!self::$_singletons) {\n self::$_singletons = new Object();\n }\n }",
"protected function registerSingletons() {\n $this->app->singleton(PerfectlyCache::class);\n }",
"public function register(): void\n {\n $this->app->singleton(ContainerInterface::class, Container::class);\n }",
"public function register(string $abstract, Closure $concrete): void;",
"public function register(Container $container);",
"public function registerSingletons()\n {\n $this->instance(\n 'fileloader',\n new FileLoader(\n array(\n 'config' => $this['path.config'],\n 'views' => $this['path.views'],\n )\n )\n );\n }",
"protected function registerService()\n {\n $this->app->singleton('rockid', function () {\n return new Rockid();\n });\n }",
"public static function setInstance(Container $container);",
"public function registerSingleton ($beanName, $singletonObject);",
"protected function registerMetaContainer(): void\n {\n $this->app->singleton('orchestra.meta', static function () {\n return new Meta();\n });\n }",
"public static function getSingleton()\n {\n if (self::$singleton === null)\n self::$singleton = new RegisterHandler();\n\n return self::$singleton;\n }",
"public function resolveSingleton($name);",
"public function testSingleton()\n {\n $container = new \\calderawp\\CalderaContainers\\Service\\Container();\n\n $classRef =\\calderawp\\CalderaContainers\\Tests\\Mocks\\Something::class;\n $container->singleton( $classRef, new \\calderawp\\CalderaContainers\\Tests\\Mocks\\Something());\n\n $this->assertSame( $container->make($classRef), $container->make($classRef));\n\t}",
"public function testResolveSingleton() {\n $container = \\com\\snsp\\DIContainer::Create();\n\n $container->register('myAClass', function($di) {\n return new \\tests\\com\\snsp\\mocks\\AClass();\n }, \\com\\snsp\\DIContainer::$SINGLETON);\n\n $resolvedAClass = $container->resolve('myAClass');\n \n $resolvedAClass->increaseCount();\n $this->assertEquals(1, $resolvedAClass->getCount());\n $resolvedSecondTimeAClass = $container->resolve('myAClass');\n $resolvedSecondTimeAClass->increaseCount();\n $this->assertEquals(2, $resolvedSecondTimeAClass->getCount());\n \n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the total posts ever made on the forum. | function get_num_forum_posts()
{
return $this->connection->query_value('posts','COUNT(*)');
} | [
"function bp_get_the_topic_total_posts() {\n\t\tglobal $forum_template;\n\n\t\treturn apply_filters( 'bp_get_the_topic_total_posts', $forum_template->topic->topic_posts );\n\t}",
"function total_posts() {\n\treturn Registry::get('total_posts');\n}",
"static public function getAllPostsAmount () {\n\n $amount = static::getPostAll();\n return count($amount);\n\n }",
"public function posts()\n {\n return (int) $this->AACAccount()->forum_posts;\n }",
"public function countTotalPosts() {\r\n $sql = 'SELECT COUNT(*) AS contenu'\r\n . ' FROM T_POST';\r\n $req = $this->executeRequest($sql);\r\n $numberOfPosts = $req->fetchColumn();\r\n return $numberOfPosts;\r\n }",
"public function getTotal(): int\n {\n return $this->posts->count();\n }",
"function bp_the_topic_total_post_count() {\n\techo bp_get_the_topic_total_post_count();\n}",
"public function getTotalNoOfPosts() {\n $sqlQuery = \"select count(*) from laf873.posts\";\n\n $statement = $this->_dbHandle->prepare($sqlQuery);\n $statement->execute();\n\n $total = $statement->fetchColumn();\n\n return $total;\n }",
"public static function getTotalPosts(){\n $sql = new Sql();\n $total = $sql->select(\"SELECT count(*) as total FROM tb_posts\");\n return $total[0][\"total\"];\n }",
"public function getPostCount()\r\n {\r\n return Yii::app()->db->createCommand()\r\n ->select('count(*) as num')\r\n ->from(Post::model()->tableName() .' p')\r\n ->join(Thread::model()->tableName() .' t', 't.id=p.thread_id')\r\n ->where('t.forum_id=:id', array(':id'=>$this->id))\r\n ->queryScalar();\r\n }",
"private function getNumberOfPosts() {\n \treturn $this->properties->getWidgetProperty(self::PROPERTY_POSTS, self::DEFAULT_POSTS);\n }",
"public function getPostsCount()\n {\n return $this->posts_count;\n }",
"protected function _get_num_new_forum_posts()\n {\n return $this->connection->query_value_if_there('SELECT COUNT(*) FROM ' . $this->connection->get_table_prefix() . 'messages WHERE posterTime>' . strval(time() - 60 * 60 * 24));\n }",
"public function countPosts()\n {\n $db = $this->dbConnect();\n $req = $db->query('SELECT COUNT(*) FROM posts');\n $req->execute();\n $countingPost = $req->fetchColumn();\n \n return $countingPost;\n }",
"public function postCount()\n\t{\n\t\treturn $this->posts()->count();\n\t}",
"public function getPostCount()\n {\n return $this->post_count;\n }",
"public function getTotalPosts()\n {\n $qb = $this->createQueryBuilder('p');\n\n $qb\n ->select($qb->expr()->count('p.id'))\n ->where(\n $qb->expr()->isNotNull('p.published_at')\n )\n ;\n\n return $qb->getQuery()->getSingleScalarResult();\n }",
"function _get_num_new_forum_posts()\n\t{\n\t\treturn $this->connection->query_value_null_ok_full('SELECT COUNT(*) FROM '.$this->connection->get_table_prefix().'f_posts WHERE p_time>'.strval(time()-60*60*24));\n\t}",
"public function getNumPosts() {\r\n return $this->num_posts;\r\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Initializes a field group for automatic saving. | function pyis_dpd_helpscout_init_field_group( $group ) {
pyis_dpd_helpscout_fieldhelpers()->fields->save->initialize_fields( $group );
} | [
"function vibrant_life_init_field_group( $group ) {\n\tvibrant_life_field_helpers()->fields->save->initialize_fields( $group );\n}",
"protected function _init() {\n\t\t$this->_fields += array(\n\t\t\t'id' => new Sprig_Field_Auto,\n\t\t\t'version' => new Sprig_Field_Integer(array(\n\t\t\t\t'editable' => FALSE,\n\t\t\t\t'default' => 1,\n\t\t\t)),\n\t\t\t// Internal, not in DB\n\t\t\t'editor' => new Sprig_Field_Integer(array(\n\t\t\t\t'editable' => FALSE,\n\t\t\t\t'in_db' => FALSE,\n\t\t\t\t'default' => 1,\n\t\t\t)),\n\t\t\t'comments' => new Sprig_Field_Char(array(\n\t\t\t\t'editable' => FALSE,\n\t\t\t\t'in_db' => FALSE,\n\t\t\t\t'default' => array(),\n\t\t\t)),\n\t\t);\n\t}",
"function acf_prepare_field_group_for_import($field_group)\n{\n}",
"public function set_group() {\n\t\t$this->group = new CT_Ultimate_GDPR_Model_Group;\n\t\t$this->group->add_levels( $this->get_group_levels() );\n\t}",
"private function init()\n {\n foreach ($this->originalData as $key => $value) {\n $field = new DataField($key, $value, ['errors' => []]);\n\n $this->fields[$field->getName()] = $field;\n }\n\n $this->keys = array_keys($this->originalData);\n }",
"function add_local_field_group(){\n // ...\n }",
"function rbm_fh_deprecated_save_meta() {\n\t\n\trbm_fh_init_field_group( 'default' );\n\t\n}",
"public function initGroups()\n {\n $collectionClassName = EventAudienceTableMap::getTableMap()->getCollectionClassName();\n\n $this->collGroups = new $collectionClassName;\n $this->collGroupsPartial = true;\n $this->collGroups->setModel('\\ChurchCRM\\Group');\n }",
"function _create_field_group($field_group)\n\t{\n\t\tglobal $DB, $PREFS;\n\n\t\t$field_group_data = $field_group->attributes;\n\t\t\n\t\t$original_name = $field_group_data['group_name'];\n\t\t\n\t\t$field_group_data['site_id'] = $PREFS->ini('site_id');\n\t\t\n\t\t$field_group_data['group_name'] = $this->_rename('exp_field_groups', $original_name, 'group_name');\n\n\t\tif ($field_group_data['group_name'] === FALSE)\n\t\t{\n\t\t\treturn $this->_log_error('field_group_exists', $original_name);\n\t\t}\n\t\t\n\t\t$group_id = $this->_insert('exp_field_groups', $field_group_data);\n\t\t\n\t\t$this->_log_install('field_group', $field_group_data['group_name']);\n\n\t\t$field_order = 1;\n\n\t\tforeach ($field_group->children as $field_group_child)\n\t\t{\n\t\t\tswitch ($field_group_child->tag)\n\t\t\t{\n\t\t\t\tcase 'field':\n\t\t\t\t\t$this->_create_field($field_group_child, $group_id, $field_order);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'fieldframe':\n\t\t\t\t\t$this->_create_field($field_group_child, $group_id, $field_order, TRUE);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'ff_matrix':\n\t\t\t\t\t$this->_create_field($field_group_child, $group_id, $field_order, TRUE, TRUE);\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t$field_order++;\n\t\t}\n\n\t\treturn $group_id;\n\t}",
"function acf_import_field_group( $field_group ) {\n}",
"function acf_prepare_field_group_for_import( $field_group ) {\n\treturn acf_prepare_internal_post_type_for_import( $field_group, 'acf-field-group' );\n}",
"function acf_import_field_group( $field_group ) {\n\t\n\t// Disable filters to ensure data is not modified by local, clone, etc.\n\t$filters = acf_disable_filters();\n\t\n\t// Validate field group (ensures all settings exist).\n\t$field_group = acf_get_valid_field_group( $field_group );\n\t\n\t// Prepare group for import (modifies settings).\n\t$field_group = acf_prepare_field_group_for_import( $field_group );\n\t\n\t// Prepare fields for import (modifies settings).\n\t$fields = acf_prepare_fields_for_import( $field_group['fields'] );\n\t\n\t// Stores a map of field \"key\" => \"ID\".\n\t$ids = array();\n\t\n\t// If the field group has an ID, review and delete stale fields in the database. \n\tif( $field_group['ID'] ) {\n\t\t\n\t\t// Load database fields.\n\t\t$db_fields = acf_prepare_fields_for_import( acf_get_fields( $field_group ) );\n\t\t\n\t\t// Generate map of \"index\" => \"key\" data.\n\t\t$keys = wp_list_pluck( $fields, 'key' );\n\t\t\n\t\t// Loop over db fields and delete those who don't exist in $new_fields.\n\t\tforeach( $db_fields as $field ) {\n\t\t\t\n\t\t\t// Add field data to $ids map.\n\t\t\t$ids[ $field['key'] ] = $field['ID'];\n\t\t\t\n\t\t\t// Delete field if not in $keys.\n\t\t\tif( !in_array($field['key'], $keys) ) {\n\t\t\t\tacf_delete_field( $field['ID'] );\n\t\t\t}\n\t\t}\n\t}\n\t\n\t// When importing a new field group, insert a temporary post and set the field group's ID.\n\t// This allows fields to be updated before the field group (field group ID is needed for field parent setting).\n\tif( !$field_group['ID'] ) {\n\t\t$field_group['ID'] = wp_insert_post( array( 'post_title' => $field_group['key'] ) );\n\t}\n\t\n\t// Add field group data to $ids map.\n\t$ids[ $field_group['key'] ] = $field_group['ID'];\n\t\n\t// Loop over and add fields.\n\tif( $fields ) {\n\t\tforeach( $fields as $field ) {\n\t\t\t\n\t\t\t// Replace any \"key\" references with \"ID\".\n\t\t\tif( isset($ids[ $field['key'] ]) ) {\n\t\t\t\t$field['ID'] = $ids[ $field['key'] ];\t\n\t\t\t}\n\t\t\tif( isset($ids[ $field['parent'] ]) ) {\n\t\t\t\t$field['parent'] = $ids[ $field['parent'] ];\t\n\t\t\t}\n\t\t\t\n\t\t\t// Save field.\n\t\t\t$field = acf_update_field( $field );\n\t\t\t\n\t\t\t// Add field data to $ids map for children.\n\t\t\t$ids[ $field['key'] ] = $field['ID'];\n\t\t}\n\t}\n\t\n\t// Save field group.\n\t$field_group = acf_update_field_group( $field_group );\n\t\n\t// Enable filters again.\n\tacf_enable_filters( $filters );\n\t\n\t/**\n\t * Fires immediately after a field_group has been imported.\n\t *\n\t * @date\t12/02/2014\n\t * @since\t5.0.0\n\t *\n\t * @param\tarray $field_group The field_group array.\n\t */\n\tdo_action( 'acf/import_field_group', $field_group );\n\t\n\t// return new field group.\n\treturn $field_group;\n}",
"function acf_prepare_field_group_for_export( $field_group = array() ) {\n}",
"public function init_form_fields()\n {\n }",
"public function initialize_fields() {\n\t\t\tWPS\\Core\\Fields::get_instance();\n\t\t}",
"public function add_setting_custom_fields_group() {\n\t\tif ( ! ( $this->requires_custom_field_group ) ) {\n\t\t\t// only add these settings once, even if the programmer calls this function multiple times.\n\t\t\t$this->requires_custom_field_group = true;\n\n/*\t\t\t$this->add_setting(\n\t\t\t\tself::prefix . $this->get_name() . '_custom_field',\n\t\t\t\t'Custom Field Group ID',\n\t\t\t\t'The ID of the custom fields\\' group. The shortcode will only be replaced if this group is added to the page in the Custom Fields settings, and if specific Custom Fields within that group are properly set by the user.'\n\t\t\t);\n*/\t\t}\n\t}",
"function initGroups() {\n $root = createGroup('COMPANY_ROOT');\n $germany = createGroup('Germany', $root);\n createGroup('Office Berlin', $germany);\n createGroup('Office Dresden', $germany);\n \n $uk = createGroup('UK', $root);\n createGroup('Office London', $uk);\n createGroup('Office Edinburgh', $uk);\n}",
"function acf_prepare_field_group_for_export($field_group = array())\n{\n}",
"function acf_add_local_field_group( $field_group ) {\n\t\n\t// Apply default properties needed for import.\n\t$field_group = wp_parse_args($field_group, array(\n\t\t'key'\t\t=> '',\n\t\t'title'\t\t=> '',\n\t\t'fields'\t=> array(),\n\t\t'local'\t\t=> 'php'\n\t));\n\t\n\t// Generate key if only name is provided.\n\tif( !$field_group['key'] ) {\n\t\t$field_group['key'] = 'group_' . acf_slugify($field_group['title'], '_');\n\t}\n\t\n\t// Bail early if field group already exists.\n\tif( acf_is_local_field_group($field_group['key']) ) {\n\t\treturn false;\n\t}\n\t\n\t// Prepare field group for import (adds menu_order and parent properties to fields).\n\t$field_group = acf_prepare_field_group_for_import( $field_group );\n\t\n\t// Extract fields from group.\n\t$fields = acf_extract_var( $field_group, 'fields' );\n\t\n\t// Add to store\n\tacf_get_local_store( 'groups' )->set( $field_group['key'], $field_group );\n\t\n\t// Add fields\n\tif( $fields ) {\n\t\tacf_add_local_fields( $fields );\n\t}\n\t\n\t// Return true on success.\n\treturn true;\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get image by id, name or filename | public function getImageByIdNameOrFilename( $id, $name, $filename )
{
$image = Image::where('id', '=', $id)
->orWhere('name','=',$name)
->orWhere('filename','=',$filename)->first();
return $image;
} | [
"public function findImageById($id);",
"public function getById($image_id);",
"static public function getImage($id) {\n return static::findOne(['id' => $id]);\n }",
"function get_image($id = null)\n {\n if ( ! $id ) {\n return;\n }\n return Cache::rememberForever('image-'.$id, function () use ($id) {\n $model = config('medialibrary.media_model');\n return $model::where('id', $id)->first();\t\n });\n }",
"public static function FindById($id){\r\n\t\t$query = new Query();\r\n\t\t$query->createSelect(array('*'), 'images', array(), 'id = \"'.$id.'\"');\r\n\t\t$imageArray = $query->execute();\r\n\t\t$image = false;\r\n\t\tif(!empty($imageArray)){\r\n\t\t\t$image = self::CreateObjectFromArray($imageArray);\r\n\t\t}\r\n\t\treturn $image;\r\n\t}",
"function zp_load_image_from_id($id){\n\t$sql = \"SELECT `albumid`, `filename` FROM \" .prefix('images') .\" WHERE `id` = \" . $id;\n\t$result = query_single_row($sql);\n\t$filename = $result['filename'];\n\t$albumid = $result['albumid'];\n\n\t$sql = \"SELECT `folder` FROM \". prefix('albums') .\" WHERE `id` = \" . $albumid;\n\t$result = query_single_row($sql);\n\t$folder = $result['folder'];\n\n\t$album = zp_load_album($folder);\n\t$currentImage = newImage($album, $filename);\n\tif (!$currentImage->exists) return false;\n\treturn $currentImage;\n}",
"function retrieveImageByName(string $name):string;",
"function get_image($id)\n {\n return $this->db->get_where('image',array('id'=>$id))->row_array();\n }",
"public function image_get($id = 0)\n {\n // Otherwise, a single image will be returned.\n $con = $id ? array('id' => $id) : array();\n // print_r($con);die;\n $images = $this->image->getRows($con);\n\n // Check if the image data exists\n if (!empty($images)) {\n // Set the response and exit\n //OK (200) being the HTTP response code\n $this->response($images, REST_Controller::HTTP_OK);\n } else {\n // Set the response and exit\n //NOT_FOUND (404) being the HTTP response code\n $this->response([\n 'status' => FALSE,\n 'message' => 'No image was found.'\n ], REST_Controller::HTTP_NOT_FOUND);\n }\n }",
"public function getImageByName($name)\r\n {\r\n $query = Image::find()->where([\r\n 'object_id' => $this->owner->primaryKey,\r\n 'handler_hash' => $this->owner->getHash()\r\n ]);\r\n $query->andWhere(['name' => $name]);\r\n // $imageQuery = Image::find();\r\n\r\n //$finder = $this->getImagesFinder(['name' => $name]);\r\n //$imageQuery->where($finder);\r\n //$imageQuery->orderBy(['is_main' => SORT_DESC, 'id' => SORT_ASC]);\r\n //$imageQuery->orderBy(['ordern' => SORT_DESC]);\r\n\r\n $img = $query->one();\r\n if (!$img) {\r\n // return Yii::$app->getModule('images')->getPlaceHolder();\r\n return NULL;\r\n }\r\n\r\n return $img;\r\n }",
"public function findPhoto($id);",
"public function get_image_by_id($id){\n\t\t\t$sql = \"SELECT * FROM images WHERE id={$id}\";\n\t\t\t$result = $this->mysqli->query($sql);\n\t\t\tif($this->mysqli->error || $this->mysqli->errno){\n\t\t\t\techo \"Error getting gallery image: \" . $this->mysqli->error;\n\t\t\t\treturn false;\n\t\t\t}else{\n\t\t\t\tif($result->num_rows > 0){\n\t\t\t\t\t$row = $result->fetch_assoc();\n\t\t\t\t\treturn $row;\n\t\t\t\t}else{\n\t\t\t\t\t//no rows returned\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t}",
"public function getPhoto($id)\n {\n $res = $this->db->select(\"SELECT * FROM `{$this->domainPhoto}` WHERE itemName()='{$id}'\", array('ConsistentRead' => 'true'));\n $this->logErrors($res);\n if(isset($res->body->SelectResult->Item))\n return self::normalizePhoto($res->body->SelectResult->Item);\n else\n return false;\n }",
"public function fetchFileNameById($id)\r\n {\r\n return $this->findColumnByPk($id, 'image');\r\n }",
"public function getimagebyid($id)\n{\n// return $query;\n}",
"function get_item_photo_from_id($id) {\n\t\t$this->load->model('model_items');\n\t\t$result = $this->model_items->items_details_show($id);\n\t\treturn $result->PHOTO;\n\t}",
"public function getImageId ();",
"function get_img_usrbyID($id){\n\t$result = select(\"select fotografia from usuario where id=\".$id.\"\")[0];\n\tif (!empty($result)) {\n\t\treturn array_values($result)[0];\t\t\t\n\t}else{\n\t\treturn \"usr_img\\0.png\";\n\t}\n}",
"function gesso__get_image( $id ) {\n\tif ( strlen( $id ) ) {\n\t\treturn new TimberImage( $id );\n\t} else {\n\t\treturn null;\n\t}\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.