query
stringlengths
10
8.11k
document
stringlengths
17
398k
negatives
sequencelengths
19
20
metadata
dict
Sets the templateSubtype The template's subtype. Possible values are: none, firewall, diskEncryption, attackSurfaceReduction, endpointDetectionReponse, accountProtection, antivirus, firewallSharedAppList, firewallSharedIpList, firewallSharedPortlist.
public function setTemplateSubtype($val) { $this->_propDict["templateSubtype"] = $val; return $this; }
[ "public function getTemplateSubtype()\n {\n if (array_key_exists(\"templateSubtype\", $this->_propDict)) {\n if (is_a($this->_propDict[\"templateSubtype\"], \"\\Beta\\Microsoft\\Graph\\Model\\DeviceManagementTemplateSubtype\") || is_null($this->_propDict[\"templateSubtype\"])) {\n return $this->_propDict[\"templateSubtype\"];\n } else {\n $this->_propDict[\"templateSubtype\"] = new DeviceManagementTemplateSubtype($this->_propDict[\"templateSubtype\"]);\n return $this->_propDict[\"templateSubtype\"];\n }\n }\n return null;\n }", "public function setSubtype($subtype) {\n\t\t$this->subtype = $subtype;\n\t}", "public function setSubtype(string $subtype) : void\n {\n $this->subtype = $subtype;\n }", "public function setSubtype ($subtype) {\n\t$this->subtype = $subtype;\n\treturn $this;\n}", "public function setTemplateType($value)\n\t{\n\t\t$this->_templateType = $value;\n\t}", "public function set_subTemplate($st) {\n\t\t$this->subTemplate = $st;\n\t}", "public function setIsSubtype($isSubtype)\n {\n $this->isSubtype = $isSubtype;\n return $this;\n }", "public function setTemplateSub($sub)\n {\n $this->templateSub = intval($sub);\n }", "protected function setSubTemplateInOutput()\n {\n $this->data->subTemplate = $this->subTemplate;\n }", "function SetSubtype($subtype, $dbupdate = true)\r\n\t{\r\n\t\treturn $this->UpdateValue('subtype', $subtype, $dbupdate);\r\n\t}", "public function getTemplateSubtype(): ?DeviceManagementTemplateSubtype {\n $val = $this->getBackingStore()->get('templateSubtype');\n if (is_null($val) || $val instanceof DeviceManagementTemplateSubtype) {\n return $val;\n }\n throw new \\UnexpectedValueException(\"Invalid type found in backing store for 'templateSubtype'\");\n }", "public function setTemplateType(?EnrollmentNotificationTemplateType $value): void {\n $this->getBackingStore()->set('templateType', $value);\n }", "public function setTemplate(FieldTemplate $template)\n {\n $this->template = $template;\n }", "public function set_template($template)\n\t{\n\t\t//Assign the breadcrumb template\n\t\t$this->template = wp_kses(apply_filters('bcn_breadcrumb_template', $template, $this->type, $this->id), $this->allowed_html);\n\t}", "public function setSubType($var)\n {\n GPBUtil::checkString($var, True);\n $this->sub_type = $var;\n\n return $this;\n }", "public function setTemplateType($val)\n {\n $this->_propDict[\"templateType\"] = $val;\n return $this;\n }", "public function setSubType($value){\n return $this->setParameter('sub_type', $value);\n }", "private function initialize_multipart_subtype($val) {\n if ( ! is_string($val) || ! in_array($val, array('mixed', 'related'))) {\n $this->invalid_argument_value('multipart_subtype');\n }\n $this->multipart_subtype = $val;\n }", "public function setTaskSubtype($taskSubtype)\n {\n $this->taskSubtype = $taskSubtype;\n return $this;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Initializes the collAlats collection. By default this just sets the collAlats collection to an empty array (like clearcollAlats()); however, you may wish to override this method in your stub class to provide setting appropriate to your application for example, setting the initial array to the values stored in database.
public function initAlats($overrideExisting = true) { if (null !== $this->collAlats && !$overrideExisting) { return; } $this->collAlats = new PropelObjectCollection(); $this->collAlats->setModel('Alat'); }
[ "public function initArtists()\n {\n $collectionClassName = ArtistLyricTableMap::getTableMap()->getCollectionClassName();\n\n $this->collArtists = new $collectionClassName;\n $this->collArtistsPartial = true;\n $this->collArtists->setModel('\\Tekstove\\ApiBundle\\Model\\Artist');\n }", "public function initCamps()\n\t{\n\t\t$this->collCamps = array();\n\t}", "public function initAirports()\n\t{\n\t\t$this->collAirports = array();\n\t}", "public function initAlumnos()\n\t{\n\t\t$this->collAlumnos = array();\n\t}", "protected function initLaneSet()\n {\n $this->setLanes(new Collection);\n }", "public function initAnaks($overrideExisting = true)\n {\n if (null !== $this->collAnaks && !$overrideExisting) {\n return;\n }\n $this->collAnaks = new PropelObjectCollection();\n $this->collAnaks->setModel('Anak');\n }", "public function initStudents()\n\t{\n\t\t$this->collStudents = array();\n\t}", "protected function initRoles()\n {\n $this->roles = new ArrayCollection();\n }", "public function clearAlats()\n {\n $this->collAlats = null; // important to set this to null since that means it is uninitialized\n $this->collAlatsPartial = null;\n\n return $this;\n }", "public function initTbvagass()\n\t{\n\t\t$this->collTbvagass = array();\n\t}", "public function initC005tActaAnies()\n\t{\n\t\t$this->collC005tActaAnies = array();\n\t}", "public function initJ001tAlcanceForenses()\n\t{\n\t\t$this->collJ001tAlcanceForenses = array();\n\t}", "public function initEstSolicitudess()\n\t{\n\t\t$this->collEstSolicitudess = array();\n\t}", "public function initAgendamentos()\n\t{\n\t\t$this->collAgendamentos = array();\n\t}", "public function initImportacaos()\n\t{\n\t\t$this->collImportacaos = array();\n\t}", "public function initTraAsignacioness()\n\t{\n\t\t$this->collTraAsignacioness = array();\n\t}", "public function initC003tActaAccs()\n\t{\n\t\t$this->collC003tActaAccs = array();\n\t}", "public function __construct()\r\n {\r\n $this->placas = new ArrayCollection();\r\n }", "public function __construct()\n {\n $this->placas = new ArrayCollection();\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the class property linker for the given class
public function classLinker(string $class): ClassLinker { $classLinkerType = $this->classLinkerType; if (class_exists($class) || interface_exists($class) || trait_exists($class)) { $classLinker = new $classLinkerType($class, $this->urls()); } else { $test = $this->ns . "\\$class"; if (class_exists($test) || interface_exists($test) || trait_exists($test)) { $classLinker = new $classLinkerType($test, $this->urls()); } else { throw new SphpException("Class '$class' does not exist"); } } $classLinker->setDefaultHyperlinkAttributes($this->getDefaultHyperlinkAttributes()); return $classLinker; }
[ "public function getPropertyClass() : string {\n\t\treturn($this->propertyClass);\n\t}", "private function getReflexMappedClass() : \\ReflectionProperty\n {\n return $this->getReflex('mappedClass');\n }", "private function getClassAlias($class)\r\n {\r\n if(isset($this->aliases[$class])) return $this->aliases[$class];\r\n }", "public function propertyUrl(ReflectionProperty $property, ReflectionClass $class = NULL)\n\t{\n\t\t$className = $class !== NULL ? $class->getName() : $property->getDeclaringClassName();\n\t\treturn $this->classUrl($className) . '#' . ($property->isMagic() ? 'm' : '') . '$' . $property->getName();\n\t}", "public function getReferenceClass();", "private function uriFor(XPClass $class) {\n try {\n $Urimethod= $class->getClassLoader()->getClass()->getMethod('classURI');\n $Urimethod->setAccessible(TRUE);\n return $Urimethod->invoke($class->getClassLoader(), $class->getName());\n } catch (Exception $ignored) {\n return $class->getClassName();\n }\n }", "private static function doGetClassDirUrl($class)\n {\n return UrlPaths::root().\n \\str_replace(\n StrUtils::PHP_NS_SEPARATOR,\n StrUtils::URL_SEPARATOR,\n \\trim($class, \\basename($class)));\n }", "public function getClassPath($class)\n {\n $class = strtolower($class);\n\n return isset($this->classes[$class]) ? $this->classes[$class] : null;\n }", "public function getRuleClass()\n {\n return $this->namespace . '\\\\' . $this->_class;\n }", "function zing_class_path($class) {\n if (is_object($class)) $class = get_class($class);\n return strtolower(preg_replace('|([^^/])([A-Z])|', '$1_$2', str_replace('\\\\', '/', $class)));\n}", "protected function getPath($class)\n {\n return '\\League\\CLImate\\TerminalObject\\\\' . $class;\n }", "public static function getAlias($class) {\n\t\treturn array_search($class, static::$aliases, true);\n\t}", "public function getPropertySymbolizer() \n {\n if (!($this->propertySymbolizer instanceof PropertyReferenceSymbolizer)) {\n $this->propertySymbolizer = new PropertyReferenceSymbolizer($this->throwOnError);\n }\n return $this->propertySymbolizer;\n }", "protected function getPropertyClass()\n {\n $class = $this->propertyClass;\n if (!class_exists($class)) {\n $class = trim($this->propertyNs, '\\\\') . '\\\\' . trim($class, '\\\\');\n /** @noinspection NotOptimalIfConditionsInspection */\n if (!class_exists($class)) {\n static::fail('Unable to find test property class: ' . $this->propertyClass);\n }\n }\n return $class;\n }", "public function getClassAliases($class) {\n return array_keys($this->alias2class, $class);\n }", "function get($class) {\n\t\tif ($this->has($class)) {\n\t\t\treturn $this[$class];\n\t\t}\n\n\t\treturn $this->create($class);\n\t}", "protected function getClassUrl() {\n try {\n $url = $this->getUrl('api.class');\n } catch (RouterException $e) {\n $url = null;\n }\n\n return $url;\n }", "protected function getClassDirUrl()\n {\n return self::doGetClassDirUrl(\\get_class($this));\n }", "protected function classUri($class) {\n return $this->archive.strtr($class, '.', '/').xp::CLASS_FILE_EXT;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Checking is category filter enabled
public function isCategoryFilterEnabled() { return array_search(\Magento\Catalog\Model\Layer\FilterList::CATEGORY_FILTER, $this->getSelectedAttributeCodes()) !== false; }
[ "protected function _filtered() {\n\t\tif (!empty($this->params['category'])) {\n\t\t\treturn 'category';\n\t\t}\n\t\treturn false;\n\t}", "public function categoriesAreRequested()\n {\n return (bool) Mage::getStoreConfig('bxSearch/autocomplete/category');\n }", "public function supportsCategories();", "public function hasCategories():bool;", "public function hasCategories();", "function check_filter_enabled()\n{\n if (function_exists('filter_list')) {\n \n return true;\n \n } else {\n \n return false;\n \n }\n \n}", "function canFilter(){\n\t\t\treturn true;\n\t\t}", "function canFilter() {\n return true;\n }", "public function isFilterable();", "function hasFilter();", "public function hasCategoryList(){\n\t\treturn true;\n\t}", "function is_category() {\n\t$pcat = CAT_ID;\n\treturn(!empty($pcat));\n}", "public function hasCategoryList(){\n\t\treturn false;\n\t}", "function cat_admin_access($category_id)\n{\n global $user;\n\n // $filter['visible_categories'] and $filter['visible_images']\n // are not used because it's not necessary (filter <> restriction)\n if (in_array($category_id, explode(',', $user['forbidden_categories'])))\n {\n return false;\n }\n return true;\n}", "public function isFilter() {\n return $this->definition['filter'] === TRUE;\n }", "protected function _isCategory() {\n return $this->_getRouteName() == 'catalog'\n && $this->_getControllerName() == 'category';\n }", "public function isCategory() {\n\t\treturn $this->libraryType == self::TYPE_CATEGORY;\n\t}", "function cftf_is_filter() {\n\treturn (isset($_REQUEST['cftf_action']) && $_REQUEST['cftf_action'] == 'filter');\n}", "public function filterEnabled() {\n\t\treturn $this->_showFilter;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Testing Only getHandShakeResponse("Testing"); getHandShakeResponse Receives a string message, adds the handshake defined salt (addSalt), encrypts the message (encryptMessage), and returns the encrypted string. Logs the IP address of the request during the process. [required] Parameter $message, which defines the information to be encrypted.
function getHandShakeResponse($message){ writeLogInfo("Handshake Request to :". $_SERVER['SERVER_NAME'] ." | From :". $_SERVER['REMOTE_ADDR']); $message = addSalt($message, "handshake"); $message = encryptMessage($message); return $message; }
[ "function encryptMessage($message){\n\treturn sha1($message);\n}", "protected function prepareMessage($message) {\n $plaintext = json_encode($message);\n\n $ciphertext = $this->preparePlaintext($plaintext);\n\n $hash = static::hash($ciphertext, $this->key_hmac);\n if($hash === false)\n throw new RuntimeException(\"Cowardly refusing to return ciphertext when hash calculation fails. Check that the appropriate HMAC algorithm is available.\");\n\n return ['message' => $ciphertext, 'hash' => $hash];\n }", "public function testFunction(Request $request)\n {\n $remote_ip = $request->GATEWAY_IP;\n $remote_port = env('PORT_GATEWAY');\n\n $sRet = \"\";\n\n //Send Encrypted Data\n if($request->RAW_MESSAGE){\n $sRet = $this->sendToSocket($remote_ip, $remote_port,\n $request->RAW_MESSAGE);\n echo \"Raw: \\n\";\n return $sRet;\n }\n //Collecting data to be send\n $msg = '{\"mode\":\"'.$request->FUNCTION.'\",\"device_id\":\"'.\n $request->DEVICE_ID.'\",\"command\":\"'.$request->COMMAND.'\"}';\n\n $message = $this->encryptMessage($msg);\n echo $message. \"\\n\\n\";\n $sRet = $this->sendToSocket($remote_ip, $remote_port, $message);\n return $message . \"\\n\\n\". $sRet . \"\\n\\n\";\n }", "protected function action_handshake()\n {\n $this->sendContent([\n 'success' => true,\n 'result' => [\n 'say' => 'HELLO'\n ]]);\n }", "public function onHandshake() {\n\t \n Daemon::log($this->client->clientAddr . ' : Handshake success') ;\n\t}", "private function _send_handshake_request()\n {\n $this->SendDebug(\"Used Seed\", $this->Seed, 0);\n\n $random_seed = \"\\x10\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\";\n openssl_public_encrypt($random_seed, $cryptedKey, $this->get_Public_Key_RSA(), OPENSSL_PKCS1_OAEP_PADDING);\n\n $Packet = \"\\x18\\x01\\x00\\x00\";\n $Packet .= \"\\x20\\x00\\x00\\x00\";\n $Packet .= $cryptedKey;\n $Packet .= $this->Seed;\n $this->_send_msg($Packet);\n $this->ReceiveEncrypted = true;\n }", "public function encryptMessage($message)\n {\n // Do not use encrypt() because it will serialize $message\n $encrypted = Crypt::encryptString($message);\n $data = json_decode(base64_decode($encrypted), true);\n\n $iv = $data['iv'];\n $value = $data['value'];\n $length = strlen(base64_decode($value));\n\n $encryptedMessage ='{\"message\":\"'. $value .'\",\"iv_key\":\"'.$iv.'\",\"length\":\"'.$length.'\"}'.\"\\n\";\n\n return base64_encode($encryptedMessage);\n }", "public function getResponseMessage () {}", "function send_SpecialData($message)\n{\n\techo DELIMITOR.aes_encrypt(base64_decode($message)).DELIMITOR;\n}", "private function encrypt(string $message): string\n {\n if (null === $this->encryptionKey) {\n throw new LogicException('Encryption key must be defined to encrypt data.');\n }\n\n // Check versions with Heartbleed vulnerabilities\n if (OPENSSL_VERSION_NUMBER <= 268443727) {\n throw new RuntimeException('OpenSSL Version too old.');\n }\n\n $ivSize = openssl_cipher_iv_length(self::AES_METHOD);\n\n try {\n $iv = random_bytes($ivSize);\n } catch (\\Throwable $e) {\n throw new RuntimeException('Can not generate IV.');\n }\n\n $ciphertext = openssl_encrypt(\n $message,\n self::AES_METHOD,\n $this->encryptionKey,\n OPENSSL_RAW_DATA,\n $iv\n );\n $ciphertextHex = bin2hex($ciphertext);\n $ivHex = bin2hex($iv);\n\n return \"$ivHex:$ciphertextHex\";\n }", "function hkdfForHmacSha256($sharedKey, $message) {\n\t\t $hash = hash_hkdf(self::HASHING_ALGORITHM, $sharedKey, self::HASH_CODE_LENGTH, $message);\n\n\t\t return strtr(base64_encode($hash), '+/', '-_');\n }", "public function mobileShake()\n {\n return $this->driverCommand(BaseConstants::$POST, '/appium/device/shake');\n }", "function encrypt($msg, $salt) \n{\n\t$encrypt = trim(base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_256, $salt, $msg, MCRYPT_MODE_ECB, \n\t\t\t\t\t\t\tmcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB), \n\t\t\t\t\t\t\tMCRYPT_RAND))));\n//\tfile_put_contents('/var/www/php-stuff/vbrand2/var/test.log' , \"\\n\".'Encrypt: '. $encrypt . ' Msg: '. $msg . ' Salt: ' . $salt, FILE_APPEND );\n\treturn $encrypt; \n}", "public function getSecretHandshake() {\n return '1';\n /**\n * If we use the below code for the secret handshake, it will make the\n * secret handshake not-forgable but will break multistore setups that\n * don't share the same encryption key, which it turns out is a common\n * use case, even though it is kind of a hack and really shouldn't be\n * done. Fortunately forging the secret handshake shouldn't really be\n * a security vulnerability since it won't show any information that\n * wouldn't be available anyways (like debug headers), it would just\n * cause ESI injection despite the request not passing through Varnish\n * for ESI parsing/handling.\n */\n // return Mage::helper( 'turpentine/data' )->secureHash(\n // Mage::getStoreConfig( 'turpentine_varnish/servers/auth_key' ) );\n }", "public function handshake() {\n $extra_headers = '';\n foreach ($this->headers as $k => $line) {\n if ($k !== 'STATUS') {\n $extra_headers .= $line . \"\\r\\n\";\n }\n }\n\n if (!$this->send_handshake_reply($extra_headers)) {\n error_log(get_class($this) . '::' . __METHOD__ . ' : Handshake protocol failure for client \"\"'); // $this->addr\n $this->close();\n return false;\n }\n\n $this->handshaked = true;\n $this->headers_sent = true;\n $this->state = static::STATE_HANDSHAKED;\n return true;\n }", "function dohandshake(WsUser $user,$headers);", "public static function encrypt(string $message) : string\n {\n $nonce = random_bytes(\\SODIUM_CRYPTO_SECRETBOX_NONCEBYTES);\n $encryptedMessage = sodium_crypto_secretbox($message, $nonce, self::getSecretKey());\n\n return sodium_bin2base64($nonce . $encryptedMessage , \\SODIUM_BASE64_VARIANT_URLSAFE_NO_PADDING);\n }", "public function send($message) {\n\n\t\t/*\n\t\t * Convert message object into JSON string\n\t\t */\n\t\t$json_message = json_encode($message);\n\t\t\n\t\t/*\n\t\t * Print debug info if in 'debug' mode\n\t\t */\n\t\tif($this->debug) \n\t\t\techo \"<br><br>\".\n\t\t\t\t \"Corp2World client debug info:<br>\".\n\t\t\t\t \"Sending message: \".$json_message.\"<br>\".\n\t\t\t\t \"to service at: \".$this->url.\"<br>\".\n\t\t\t\t \"as user: \".$this->user.\n\t\t\t\t \" using server certificate file: \".$this->certificate.\n\t\t\t\t \"<br>\";\n\t\t\n\t\t\n\t\t/*\n\t\t * Initializing curl\n\t\t */ \n\t\t$ch = curl_init( $this->url );\n\t\t\n\t\t/*\n\t\t * Configuring curl options\n\t\t */ \n\t\t$options = array(\n\t\t\t\tCURLOPT_RETURNTRANSFER => true,\n\t\t\t\tCURLOPT_USERPWD => $this->user . \":\" . $this->password, \n\t\t\t\tCURLOPT_HTTPHEADER => array('Content-type: application/json') ,\n\t\t\t\tCURLOPT_POSTFIELDS => $json_message\n\t\t);\n\t\t\n\t\t/*\n\t\t * Set certificate if required\n\t\t */\n\t\tif($this->certificate != NULL) {\n\t\t\t$options[CURLOPT_CAINFO] = ( $this->certificate );\n\t\t}\n\t\t\n\t\t/*\n\t\t * Setting curl options\n\t\t */ \n\t\tcurl_setopt_array( $ch, $options );\n\t\t\n\t\t/*\n\t\t * Making call to service\n\t\t */ \n\t\t$result = curl_exec($ch); \n\t\t\n\t\t$error = curl_error ( $ch );\n\t\t\n\t\tif($error)\n\t\t\t$result = $result.\" Error: \".$error;\n\t\t\n\t\t/*\n\t\t * Closing connection\n\t\t */\n\t\tcurl_close($ch);\n\t\t\n\t\t/*\n\t\t * Printing debug info if in 'debug' mode\n\t\t */\n\t\tif($this->debug)\n\t\t\techo \"Result: \".$result.\"<br><br>\";\n\t\t\n\t\t/*\n\t\t * Return result\n\t\t */\n\t\treturn $result;\n\t}", "public function decode($challenge_message);" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the 1based error column, or 0 if unknown. This will return the corresponding unexpected token only when there's exactly one token with that value on the line with the error.
private static function guessErrorColumnUsingTokens( FileCacheEntry $file_cache_entry, Error $native_parse_error ): int { if (!\function_exists('token_get_all')) { return 0; } $message = $native_parse_error->getMessage(); $prefix = "unexpected (?:token )?('(?:.+)'|\"(?:.+)\")"; if (!\preg_match("/$prefix \((T_\w+)\)/", $message, $matches)) { if (!\preg_match("/$prefix, expecting/", $message, $matches)) { if (!\preg_match("/$prefix$/D", $message, $matches)) { return 0; } } } $token_name = $matches[2] ?? null; if (\is_string($token_name)) { if (!\defined($token_name)) { return 0; } $token_kind = \constant($token_name); } else { $token_kind = null; } $token_str = \substr($matches[1], 1, -1); $tokens = \token_get_all($file_cache_entry->getContents()); $candidates = []; $desired_line = $native_parse_error->getLine(); foreach ($tokens as $i => $token) { if (!\is_array($token)) { if ($token_str === $token) { $candidates[] = $i; } continue; } $line = $token[2]; if ($line < $desired_line) { continue; } elseif ($line > $desired_line) { break; } if ($token_kind !== $token[0]) { continue; } if ($token_str !== $token[1]) { continue; } $candidates[] = $i; } if (\count($candidates) !== 1) { return 0; } return self::computeColumnForTokenAtIndex($tokens, $candidates[0], $desired_line); }
[ "final public function getErrorColumn()\n {\n return $this->errorColumn;\n }", "private function getErrorPosition(): string\n {\n if ($this->displayErrorLine) {\n $pieces = preg_split('/\\\\r\\\\n|\\\\n\\\\r|\\\\n|\\\\r/', substr($this->data, 0, $this->position));\n $line = count($pieces);\n $column = strlen(end($pieces));\n\n return \" at line {$line} column {$column}\";\n }\n\n return \" at byte {$this->position}\";\n }", "public function testUpdatesColumnNumbersInErrorForFileContext()\n {\n $caughtError = null;\n\n try {\n /** @noinspection PhpUnhandledExceptionInspection */\n $source = new Source('?', 'foo.php', new SourceLocation(1, 5));\n $this->getLexer($source)->advance();\n } catch (SyntaxErrorException $e) {\n $caughtError = $e;\n }\n\n $this->assertEquals(\n \"Syntax Error: Cannot parse the unexpected character \\\"?\\\".\\n\" .\n \"\\n\" .\n \"foo.php (1:5)\\n\" .\n \"1: ?\\n\" .\n \" ^\\n\",\n (string)$caughtError\n );\n }", "public function getLineError()\n {\n return $this->lineError;\n }", "public function getErrorLine() : int\n {\n return $this->errorLine;\n }", "public function getLineNumber()\n {\n $token = $this->_token;\n if( is_array( $this->_token )){\n return $this->_token[2];\n }\n return false;\n }", "public function getErrorCursorH(): int\n {\n if ($this->captureAnsi(\"\\e[6n\", true) === null) {\n throw Exceptional::Runtime(\n 'Unable to detect cursor position'\n );\n }\n\n return $this->getErrorCursor()[1];\n }", "public function error_line()\r\n\t{\r\n\t\tif ($errorline = @xml_get_current_line_number($this->obj_xml_parser))\r\n\t\t{\r\n\t\t\t\treturn $errorline;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t}", "public function getErrorCursorV(): int\n {\n return $this->getErrorCursor()[0];\n }", "private final function columnValidate(array &$line): ?string\n {\n $diff = array_diff($line, $this->csvColumns);\n\n if (count($diff) > 0) throw new CsvColumnException('The number of columns in the uploaded csv does not match the expected value');\n\n $encode_suggest = $this->judgeEncodingType($line);\n\n if (!$encode_suggest) throw new CsvColumnException('The character code of the CSV file may have failed to be read, or the csv column may be partially invalid.');\n\n return $encode_suggest;\n }", "public function getLastErrorLine()\n {\n $lines = explode(PHP_EOL, $this->Message);\n\n return $lines[0];\n }", "public function getColumn() : int;", "private function tokenOffset ()\n\t{\n\t\t$found = false;\n\t $cpt = 0;\n\t while ($cpt < count($this->tokenFileToTable()) && !$found) {\n\t\t\tif ($this->tokenFileToTable()[$cpt][\"token\"] == $this->token) {\n\t\t\t $found = true;\n } else {\n\t\t\t $cpt++;\n }\n\t\t}\n\n\t\tif ($found) {\n\t\t\treturn $cpt;\n\t\t} else {\n\t\t\treturn -1;\n\t\t}\n\t}", "public function getLine ()\n {\n return $this->exception->getLine();\n }", "function get_error_code() {\n\t\t$codes = $this->get_error_codes();\n\n\t\tif ( empty($codes) )\n\t\t\treturn '';\n\n\t\treturn $codes[0];\n\t}", "public function lastErrorNumber() {\n\t\t$info = $this->getConnection()->errorInfo();\n\t\treturn (int)$info[1];\n\t}", "public function getErrorNumber()\n {\n return $this->errNum;\n }", "protected function getLine(): string\n {\n return $this->exception->getLine();\n }", "public function getErrcode()\n {\n return $this->get(self::ERRCODE);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Return the user providers that allows password authentication.
public function getLoginPasswordProviders() { $providers = []; foreach ($this->providers as $key => $provider) { if ($provider instanceof LoginPasswordProviderInterface) { $providers[$key] = $provider; } } return $providers; }
[ "public function isPasswordProvider()\n {\n return array(\n // any\n array(\"password\", 8, \"any\", null, true),\n array(\"\", 8, \"any\", null, false),\n array(\"pass\", 4, \"any\", null, true),\n array(\"pass\", 6, \"any\", null, false),\n // alpha_num\n array(\"password123\", 8, \"alpha_num\", null, true),\n array(\"password123_\", 8, \"alpha_num\", null, false),\n // alpha\n array(\"password\", 8, \"alpha\", null, true),\n array(\"password1\", 8, \"alpha\", null, false),\n // any_no_space\n array(\"password_123\", 8, \"any_no_space\", null, true),\n array(\"password 123\", 8, \"any_no_space\", null, false),\n // num\n array(\"12345678\", 8, \"num\", null, true),\n array(\"1234567.8\", 8, \"num\", null, false),\n // custom\n array(\"123-4567\", 0, \"custom\", \"/[0-9]{3}-[0-9]{4}/i\", true),\n array(\"1234-567\", 0, \"custom\", \"/[0-9]{3}-[0-9]{4}/i\", false)\n );\n }", "public function providerForValidPassword()\n {\n return [\n ['password1'],\n ['pass-word1'],\n ['Pass word'],\n ['Password1'],\n ['Pass1'],\n ['Pass1#!']\n ];\n }", "function extauth_enabled_providers()\n{\n\t// Load the available providers\n\t$enabled_providers = array();\n\t$config = extauth_config();\n\n\tforeach ($config['providers'] as $name => $provider)\n\t{\n\t\tif ($provider['enabled'])\n\t\t{\n\t\t\t$enabled_providers[] = $name;\n\t\t}\n\t}\n\n\treturn $enabled_providers;\n}", "public static function providers()\n\t{\n\t\tif ( ! Module::is_active('oauth2'))\n {\n\t\t\treturn array();\n } // End If\n\n\t\t$config = Viper::$config->load('oauth2')->get('providers', array());\n \n\t\t$providers = array();\n\n\t\tforeach($config as $name => $provider)\n\t\t{\n\t\t\tif ($provider['enable'] === TRUE)\n\t\t\t{\n\t\t\t\t$providers[$name] = array(\n\t\t\t\t\t'name' => $name,\n\t\t\t\t\t'url' => Route::get('oauth2/provider')\n ->uri(array(\n 'provider' => $name, \n 'action' => 'login',\n )),\n\t\t\t\t\t'icon' => isset($provider['icon']) ? $provider['icon'] : 'facebook',\n\t\t\t\t);\n\t\t\t} // End If\n\t\t} // End Foreach\n \n\t\treturn $providers;\n\t}", "public static function providers()\n {\n return Config::get('authchain::providers', array());\n }", "function uu_allowed_auths() {\n global $CFG;\n\n // only following plugins are guaranteed to work properly\n // TODO: add support for more plguins in 2.0\n $whitelist = array('manual', 'nologin', 'none', 'email');\n $plugins = get_enabled_auth_plugins();\n $choices = array();\n foreach ($plugins as $plugin) {\n $choices[$plugin] = auth_get_plugin_title ($plugin);\n }\n\n return $choices;\n}", "protected function getUseAuths() {\n return $this::parseAuths($this->getConf('auths'));\n }", "public function getUserPasswordList()\n\t{\n\t\treturn $this->_users_password;\n\t}", "public function providerForInvalidPassword()\n {\n return [\n [null],\n [0],\n [''],\n ['password'],\n ['PASS'],\n ['P1'],\n ];\n }", "public static function providers()\n {\n return app('oauth.bridge')->getProviders();\n }", "public function getProviders()\n {\n return $this->oauth_providers;\n }", "public function getProviders()\n {\n $haconfig = $this->config['hybridauth'];\n $providers = array();\n\n // Iterate over the social providers in the config\n foreach (array_get($haconfig, 'providers', array()) as $provider => $config) {\n if (array_get($config, 'enabled')) {\n $providers[] = $provider;\n }\n }\n\n return $providers;\n }", "public function goodPasswordProvider()\n {\n return [\n ['ABi$B47es.Pfg3n9PjPi'],\n ['potence tipple would frisk shoofly'],\n ];\n }", "public function get_available_providers()\r\n {\r\n // Get provider records from database.\r\n $this->db\r\n ->select('ea_users.*')\r\n ->from('ea_users')\r\n ->join('ea_roles', 'ea_roles.id = ea_users.id_roles', 'inner')\r\n ->where('ea_roles.slug', DB_SLUG_PROVIDER);\r\n\r\n $providers = $this->db->get()->result_array();\r\n\r\n // Include each provider services and settings.\r\n foreach ($providers as &$provider)\r\n {\r\n // Services\r\n $services = $this->db->get_where('ea_services_providers',\r\n ['id_users' => $provider['id']])->result_array();\r\n\r\n $provider['services'] = [];\r\n foreach ($services as $service)\r\n {\r\n $provider['services'][] = $service['id_services'];\r\n }\r\n\r\n // Settings\r\n $provider['settings'] = $this->db->get_where('ea_user_settings',\r\n ['id_users' => $provider['id']])->row_array();\r\n unset($provider['settings']['username']);\r\n unset($provider['settings']['password']);\r\n unset($provider['settings']['salt']);\r\n }\r\n\r\n // Return provider records.\r\n return $providers;\r\n }", "protected function getUserProvider()\n {\n return config('adldap_auth.provider', DatabaseUserProvider::class);\n }", "public function getAcceptedProviders()\n {\n return [\n 'bitbucket',\n 'facebook',\n 'google',\n 'github',\n 'linkedin',\n 'twitter',\n ];\n }", "function tja_get_sso_providers_not_authenticated_for_current_user() {\n\n\t$authenticated_providers = tja_get_sso_providers_for_current_user();\n\t$unauthenticated_providers = array();\n\t\n\tforeach( tja_get_sso_providers() as $p ) {\n\t\tif( !in_array( $p, $authenticated_providers ) )\n\t\t\t$unauthenticated_providers[] = $p;\n\t}\n\t\n\treturn $unauthenticated_providers;\n}", "public function getPasswordMethods()\n {\n if (array_key_exists(\"passwordMethods\", $this->_propDict)) {\n return $this->_propDict[\"passwordMethods\"];\n } else {\n return null;\n }\n }", "public function getProviders()\n {\n return $this->providers;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Wrap a string as a URL before returning
private function wrapURL($value){ if( $value ){ return url($value); } return ""; }
[ "static function httpWrap($link){\n\t\treturn 'http://archive.azcentral.com/'.$link;\n\t}", "public function escapeUrl($url){ }", "abstract public function withUri(): string;", "function db2url($str) {\n return $str ? db2html($str) : 'http://';\n}", "function tourl($strValue)\r\n{\r\n return urlencode($strValue);\r\n}", "function tourl($strValue)\n{\n return urlencode($strValue);\n}", "function autoLink($string) {\n\n return $this->autoLinkUrl($this->autoLinkEmail($string));\n \n}", "function constructURL($object);", "function placeholder_link()\n{\n\t$text=\"<a href='http://www.example.com/'>test link</a>\";\n\tif (function_exists('ocp_mark_as_escaped')) ocp_mark_as_escaped($text);\n\treturn make_string_tempcode($text);\n}", "public function FormatStringWithLink($string) {\n\t\tif(preg_match('/[a-zA-Z]+:\\/\\/[0-9a-zA-Z;.\\/?:@=_#&%~,+$]+/', $string, $matches)) {\n\t\t\tforeach ($matches as $match) {\n\t\t\t\t$string = str_replace($match, \"<a href='\" . $match . \"'>\" . $match . \"</a>\", $string);\t\t\t\t\t\t\n\t\t\t}\n\t\t}\n\t\treturn $string;\t\t\n\t}", "protected function replaceLinks($str): string {\n $cb = function ($matches) {\n $url = $matches[0];\n\n // Detect Youtube\n if (preg_match('#^https?://www\\.youtube\\.com/watch\\?(?:.*?&)?v=([^&]+)#ui', $url, $matches)) {\n return '<div class=\"embed\"><iframe width=\"560\" height=\"315\" src=\"https://www.youtube.com/embed/' . $this->escape($matches[1]) . '\" frameborder=\"0\" allowfullscreen></iframe></div>';\n }\n\n $url = $this->escape($url);\n $isImage = null;\n // Detect image from extension\n $ext = explode('?', $url, 2)[0];\n $ext = explode('.', $ext);\n $ext = array_pop($ext);\n if (in_array($ext, ['jpg', 'jpeg', 'gif', 'png'], true)) {\n $isImage = true;\n }\n\n // Detect image from Content-Type\n if (null === $isImage) {\n $ch = curl_init($url);\n curl_setopt_array($ch, [\n CURLOPT_NOBODY => true,\n CURLOPT_FOLLOWLOCATION => true,\n CURLOPT_HEADER => true,\n CURLOPT_RETURNTRANSFER => true\n ]);\n curl_exec($ch);\n $content = curl_getinfo($ch, CURLINFO_CONTENT_TYPE);\n if (in_array($content, ['image/jpg', 'image/gif', 'image/png'], true)) {\n $isImage = true;\n }\n }\n\n return $isImage\n ? '<div class=\"embed\"><a href=\"' . $url . '\"><img src=\"' . $url . '\" alt=\"' . $url . '\"></a></div>'\n : '<a href=\"' . $url . '\">' . $url . '</a>';\n };\n\n return preg_replace_callback('#https?://[^\\s]+#ui', $cb, $str);\n }", "function link_souce($text){\n\n if(post::isValidURL($text)){\n $text = '<a href=\"'.$text.'\">'.$text.'</a>';\n } \n return $text;\n }", "function urls_to_links($str)\n{\n $pattern = '/((?:http|https)(?::\\\\/{2}[\\\\w]+)(?:[\\\\/|\\\\.]?)(?:[^\\\\s\"]*))/is';\n $replace = '<a target=\"blank\" href=\"$1\">$1</a>';\n return preg_replace($pattern, $replace, $str);\n}", "function BuildUnescapedURI(){}", "function replace_uri($str) {\n $pattern = '#(^|[^\\\"=]{1})(http://|ftp://|mailto:|news:)([^\\s<>]+)([\\s\\n<>]|$)#sm';\n return preg_replace($pattern,\"\\\\1<a href=\\\"\\\\2\\\\3\\\">\\\\3</a>\\\\4\",$str);\n}", "public function to_uri($string)\n {\n }", "function mgl_instagram_format_link($str)\n{\n // Remove http:// and https:// from url\n $str = preg_replace('#^https?://#', '', $str);\n return $str;\n}", "private function returnValidUrl($input) {\n\t\t\tif (strpos($input, \"http://\") !== 0 && strpos($input, \"https://\") !== 0) {\n\t\t $url = \"http://\" . $input;\n\t\t } else {\n\t\t \t$url = $input;\n\t\t }\n\t\t\t\n\t\t\treturn $url;\n\t\t}", "function url(string $path) : string {\n return StreamWrapper::url($path);\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
updateToPreviousVersion Stel het huidige object opnieuw in met de waarden van een vorig object
abstract public function updateToPreviousVersion( $previous );
[ "public function testGetPreviousVersion($data)\n {\n $className = $this->modelPrefix . $data['name'];\n $model = $className::create( $data )->fresh();\n\n $firstUpdatedName = 'Updated ' . $data['name'];\n $secondUpdatedName = 'Updated again ' . $data['name'];\n\n $model->name = $firstUpdatedName;\n $model->save();\n\n $model->name = $secondUpdatedName;\n $model->save();\n\n $previousVersion = $model->getPreviousModel();\n $this->assertEquals(($model->version - 1), $previousVersion->version);\n $this->assertEquals($firstUpdatedName, $previousVersion->name);\n\n $originalVersion = $previousVersion->getPreviousModel();\n $this->assertEquals(($previousVersion->version - 1), $originalVersion->version);\n $this->assertEquals($data['name'], $originalVersion->name);\n\n $nonExistingVersion = $originalVersion->getPreviousModel();\n $this->assertEquals(null, $nonExistingVersion);\n }", "public function revertLastEdits() {\n\t\t// that could be complicated ..\n\t\t\n\t\t$conditions = new PreparedStatementConditionBuilder();\n\t\t$conditions->add(\"userID IN (?)\", array($this->objectIDs));\n\t\t$conditions->add('time > ?', array(TIME_NOW - self::PERIODE));\n\t\t$conditions->add(\"versionID IN (SELECT MAX(versionID) FROM wbb\" . WCF_N . \"_post_history_version GROUP BY postID)\", array()); \n\t\t\n\t\t// first, we should select the postings\n\t\t$sql = \"SELECT postID FROM wbb\" . WCF_N . \"_post_history_version post_history_version \".$conditions;\n\t\t$stmt = WCF::getDB()->prepareStatement($sql);\n\t\t$stmt->execute($conditions->getParameters());\n\n\t\t$rversion = array(); \n\t\t\n\t\twhile ($postID = $stmt->fetchArray()) {\n\t\t\t$postID = $postID['postID'];\n\t\t\t\n\t\t\t\n\t\t\t$conditions = new PreparedStatementConditionBuilder();\n\t\t\t$conditions->enableWhereKeyword(false); \n\t\t\t$conditions->add(\"post_history_version.userID NOT IN(?)\", $this->objectIDs);\n\t\t\t\n\t\t\t$sql = \"SELECT versionID FROM wbb\" . WCF_N . \"_post_history_version post_history_version WHERE (post_history_version.time > ? AND \". $conditions .\" AND post_history_version.postID = ?) OR (post_history_version.time < ? AND post_history_version.postID = ?) ORDER BY post_history_version.time DESC LIMIT 1\";\n\t\t\t$stmt = WCF::getDB()->prepareStatement($sql);\n\t\t\t$stmt->execute(array_merge(array(TIME_NOW - self::PERIODE), $conditions->getParameters(), array($postID, TIME_NOW - self::PERIODE, $postID)));\n\t\t\t$version = $stmt->fetchColumn();\n\t\t\tif ($version != 0) {\n\t\t\t\t$rversion[] = intval($version);\n\t\t\t} else {\n\t\t\t\t// try to fetch the first version\n\t\t\t\t$sql = \"SELECT MIN(versionID) FROM wbb\" . WCF_N . \"_post_history_version WHERE postID = ? GROUP BY postID\";\n\t\t\t\t$stmt = WCF::getDB()->prepareStatement($sql); \n\t\t\t\t$stmt->execute(array($postID)); \n\t\t\t\t$rversion[] = intval($stmt->fetchColumn()); \n\t\t\t}\n\t\t}\n\t\t\n\t\t$action = new PostHistoryVersionAction($rversion, 'revert');\n\t\t\n\t\ttry {\n\t\t\t$action->validateAction();\n\t\t} catch (\\wcf\\system\\exception\\PermissionDeniedException $e) {\n\t\t\t// we should ignore this\n\t\t\t// because this is an board-exception\n\t\t}\n\t\t\n\t\t$action->executeAction();\n\t\t\n\t\t$this->unmarkItems(); \n\t}", "public function onAfterRevertToLive()\n {\n /** @var File $draftRecord */\n if (class_exists(Versioned::class) &&\n $draftRecord = Versioned::get_by_stage(self::class, Versioned::DRAFT)->byID($this->ID)\n ) {\n $draftRecord->updateDependantObjects();\n }\n }", "public function revertAction() {\n /* @var $history Wsu_Auditing_Model_History */\n $history = Mage::getModel('wsu_auditing/history')->load($this->getRequest()->getParam('id'));\n\n if (!$history->getId()) {\n $model = $history->getOriginalModel();\n $model->addData($history->getDecodedContentDiff());\n $model->save();\n Mage::getSingleton('adminhtml/session')->addSuccess(\n $this->__(\n 'Revert of %1$s with id %2$d successful',\n $history->getObjectType(),\n $history->getObjectId()\n )\n );\n }\n\n $this->_redirect('*/*/index');\n }", "function cleanupPreviousVersions()\n\t{\n\t\t$this->db->where(array('registry_object_id'=>$this->ro->id));\n\t\t$this->db->update('record_data', array('current'=>DB_FALSE));\n\n\t\t$this->pruneExtrif();\n\t}", "function previousVersion()\n {\n $db = eZDB::instance();\n $versions = $db->arrayQuery(\"SELECT version FROM ezcontentobject_version\n WHERE contentobject_id='$this->ID'\n ORDER BY version DESC\", array('limit' => 2));\n if (count($versions) > 1 and isset($versions[1]['version'])) {\n return $versions[1]['version'];\n } else {\n return false;\n }\n }", "static public function update_last_version($new_value) {\r\n\t\t\tif ($new_value!='') {\r\n\t\t\t\t$options = self::get_options();\r\n\t\t\t\t\r\n\t\t\t\t// Update the value in options\r\n\t\t\t\t$options['last_version'] = $new_value;\r\n\t\t\t\t\t\t\r\n\t\t\t\tself::update_options($options);\r\n\t\t\t}\r\n\t\t}", "public function previousVersion()\n {\n return $this->versions()->orderBy((new Version())->getKeyName(), 'DESC')->limit(1)->offset(1)->first();\n }", "public function getPreviousVersion()\n {\n return $this->previous_version;\n }", "public function revert($oldId) {\n\t\tglobal $wgUser, $wgLang;\n\t\t$rev = Revision::newFromId($oldId);\n\t\t$gpml = $rev->getText();\n\t\tif(self::isDeletedMark($gpml)) {\n\t\t\tthrow new Exception(\"You are trying to revert to a deleted version of the pathway. Please choose another version to revert to.\");\n\t\t}\n\t\tif($gpml) {\n\t\t\t$usr = $wgUser->getSkin()->userLink($wgUser->getId(), $wgUser->getName());\n\t\t\t$date = $wgLang->timeanddate( $rev->getTimestamp(), true );\n\t\t\t$this->updatePathway($gpml, \"Reverted to version '$date' by $usr\");\n\t\t} else {\n\t\t\tthrow new Exception(\"Unable to get gpml content\");\n\t\t}\n\t}", "public function previousRevision() : ?RevisionableContract;", "public function getPreviousVersion()\n {\n return $this\n ->versions()\n ->orderBy('created_at', 'DESC')\n ->limit(1)\n ->offset(1)\n ->first();\n }", "private function flush_versions() {\n global $DB;\n\n // Sort versions into id order.\n ksort($this->versions);\n\n // Loop through, saving each one.\n $transaction = $DB->start_delegated_transaction();\n foreach ($this->versions as $data) {\n // Insert version.\n $oldid = $data->id;\n $newversionid = $DB->insert_record('ouwiki_versions', $data);\n $this->set_mapping('ouwiki_version', $oldid, $newversionid, true);\n\n // Insert any links.\n foreach ($data->links as $link) {\n $link->fromversionid = $newversionid;\n // Note: The 'topageid' is still pointing to old id - we cannot\n // use mapping yet because not all pages have been retrieved,\n // so this needs to be update after_execute.\n $DB->insert_record('ouwiki_links', $link);\n }\n\n // If this version was the \"currentversion\" in the old database, update it.\n $page = $DB->get_record('ouwiki_pages', array('id' => $data->pageid),\n 'id, currentversionid');\n if ($oldid == $page->currentversionid) {\n $page->currentversionid = $newversionid;\n $DB->update_record('ouwiki_pages', $page);\n }\n }\n $transaction->allow_commit();\n\n // Clear array.\n $this->versions = array();\n }", "public function getPrevVersion()\n {\n return $this->getRelativeVersion($this->getCurrentVersion(), -1);\n }", "protected function updateDependantObjects()\n {\n // Skip live stage\n if (class_exists(Versioned::class) && Versioned::get_stage() === Versioned::LIVE) {\n return;\n }\n\n // Need to flush cache to avoid outdated versionnumber references\n $this->flushCache();\n\n // Trigger update of all parent owners on change\n /** @var DataObject|FileLinkTracking $object */\n foreach ($this->BackLinkTracking() as $object) {\n // Update sync link tracking\n $object->syncLinkTracking();\n if ($object->isChanged()) {\n $object->write();\n }\n }\n }", "public function saveUpdatedVersion()\n {\n $updated = false;\n\n if ($this->updatedToVersion->major > $this->version->major)\n $updated = true;\n else if ($this->updatedToVersion->major == $this->version->major && $this->updatedToVersion->minor > $this->version->minor)\n $updated = true;\n else if ($this->updatedToVersion->major == $this->version->major && $this->updatedToVersion->minor == $this->version->minor\n && $this->updatedToVersion->point > $this->version->point)\n $updated = true;\n\n $newversion = $this->updatedToVersion->major.\".\".$this->updatedToVersion->minor.\".\".$this->updatedToVersion->point;\n\n if ($updated)\n {\n $settings = $this->account->getServiceManager()->get(\"Netric/Settings/Settings\");\n $settings->set(\"system/schema_version\", $newversion);\n }\n }", "public function rollback($version_id)\n\t{\n\t\tglobal $ilDB, $ilUser;\n\t\t\n\t\t$source = $this->getSpecificVersion($version_id);\n\t\tif ($source === false)\n\t\t{\n\t\t\t$this->ilErr->raiseError($this->lng->txt(\"obj_not_found\"), $this->ilErr->MESSAGE);\n\t\t}\n\t\t\n\t\t// get the new version number\n\t\t$new_version_nr = $this->getVersion() + 1;\n\t\t\n\t\t// copy file \n\t\t$source_path = $this->getDirectory($source[\"version\"]) . \"/\" . $source[\"filename\"];\n\t\t$dest_dir = $this->getDirectory($new_version_nr);\n\t\tif (@!is_dir($dest_dir))\n\t\t\tilUtil::makeDir($dest_dir);\n\n\t\tcopy($source_path, $dest_dir . \"/\" . $source[\"filename\"]);\n\t\t\n\t\t// create new history entry based on the old one\n\t\tinclude_once(\"./Services/History/classes/class.ilHistory.php\");\n\t\tilHistory::_createEntry(\n\t\t\t$this->getId(), \n\t\t\t\"rollback\", \n\t\t\t$source[\"filename\"] . \",\" . $new_version_nr . \"|\" . $source[\"version\"] . \"|\" . $ilUser->getId());\n\t\t\n\t\t// get id of newest entry\n\t\t$new_version = $this->getSpecificVersion($ilDB->getLastInsertId());\n\t\t\n\t\t// change user back to the original uploader\n\t\tilHistory::_changeUserId($new_version[\"hist_entry_id\"], $source[\"user_id\"]);\n\t\t\n\t\t// update this file with the new version\n\t\t$this->updateWithVersion($new_version);\n\t\t\n\t\t$this->addNewsNotification(\"file_updated\");\n\t\t\n\t\treturn $new_version;\n\t}", "public function previousVersion()\n {\n return $this->getLatestVersions()->limit(1)->offset(1)->first();\n }", "public function getPreviousObject()\n {\n return $this->__object;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
xml_domit_rss_category Returns the category
function getCategory() { return $this->node->firstChild->toString(); }
[ "function getRSScategory($path, $tag=\"\", $searchby=\"\")\n{\n\tif(!$path) return [];\n\t\n\t$xpath = \"/rss/channel/item\";\n\t$posts = $xml = [];\n\t$path = substr($path, 0, 1) == \"/\" ? $_SERVER[\"DOCUMENT_ROOT\"].$path : $path;\n\tif(!$xml = simplexml_load_file($path)) return [];\n\t\n\t#\n\t# Create the XPATH\n\tif($tag){\n\t\t#\n\t\t# If tag was passed to the function, create a xPath to search by it.\n\t\t# $searchby is a parameter that can possibly be given if you want to search by some other tag in the RSS file than <category>\n\t\t$tag = strpos($tag, \",\") ? explode(\",\", $tag) : $tag;\t\n\t\t$tag = is_array($tag) ? trim($tag[0]) : trim($tag); // If tag is an array, get the first index only\n\t\t$xpath .= \"[\" . (empty($searchby) ? \"category\" : $searchby) . \"='\" . $tag . \"']\";\n\t} else {\n\t\t#\n\t\t# Tag could come from the URL. In this case, create an xPath to search by that category. If no \"tag\" parameter, get all items in the RSS feed\n\t\t$xpath .= filter_input(INPUT_GET, \"tag\", FILTER_SANITIZE_STRING) \n\t\t\t? \"[\" . (empty($searchby) ? \"category\" : $searchby) . \"='\" . filter_input(INPUT_GET, \"tag\", FILTER_SANITIZE_STRING) . \"']\" \n\t\t\t: \"\";\n\t}\n\t\n\t$items = $xml->xpath($xpath);\n\n\tforeach($items as $item){\n\t\t$item->registerXPathNamespace(\"media\", \"http://search.yahoo.com/mrss/\");\n\t\t$img = $item->xpath('./media:content');\n\t\t$pubDate = (new DateTime($item->pubDate, new DateTimeZone(\"America/New_York\")))->getTimestamp();\n\t\t$endDate = isset($item->endDate) ? (new DateTime($item->endDate, new DateTimeZone(\"America/New_York\")))->getTimestamp() : NULL;\n\t\t\n\t\t$posts[] = [\n\t\t\t\"title\" => strval($item->title),\n\t\t\t\"description\" => strval($item->description),\n\t\t\t\"author\" => strval($item->author),\n\t\t\t\"link\" => strval($item->link),\n\t\t\t\"pubDate\" => $pubDate,\n\t\t\t\"endDate\" => $endDate,\n\t\t\t\"category\" => $item->category,\n\t\t\t\"image\" => isset($img[0]) ? [\n\t\t\t\t\"src\" => strval($img[0]->attributes()->url),\n\t\t\t\t\"thumb\" => strval($item->xpath('./media:content/media:thumbnail')[0]->attributes()->url),\n\t\t\t\t\"alt\" => strval($item->xpath('./media:content/media:title')[0])\n\t\t\t] : []\n\t\t];\n\t}\n\tusort($posts, \"compare\"); // Sort items descending by pubDate;\n\treturn $posts;\t\n}", "function xmlrpc_getpostcategory( $content ) {\n\tglobal $post_default_category;\n\tif ( preg_match( '/<category>(.+?)<\\/category>/is', $content, $matchcat ) ) {\n\t\t$post_category = trim( $matchcat[1], ',' );\n\t\t$post_category = explode( ',', $post_category );\n\t} else {\n\t\t$post_category = $post_default_category;\n\t}\n\treturn $post_category;\n}", "function &getCategory($index) {\n\t\treturn $this->domit_rss_categories[$index];\n\t}", "function category() {\n $db = new DB(\"categories\");\n $db->select(\"category_id = '\" . $this->_vars['category'] . \"'\");\n $db->nextRecord();\n return $db->category_icon;\n }", "private function getPostCategory()\n\t{\n\t\t$default_category=$this->pluginOptions['default_category'];\n\n\t\t$this->categoriesStringToArray();\n\n\t\t$categories=$this->feed_item->categories;\n\n\t\t$this->feed_item->category=$default_category;\n\n\t\tif(count($categories)==0&&count($this->feed->categories_array)==0)\n\t\t{\n\t\t\t$this->feed_item->category='';\n\t\t\t//\n\t\t}\n\t\telse if(count($categories)==0)\n\t\t{\n\t\t\tforeach($this->feed->categories_array as $k=>$v)\n\t\t\t{\n\t\t\t\tif($k=='')\n\t\t\t\t{\n\t\t\t\t\t$this->feed_item->category=$v;\n\t\t\t\t\tbreak;\n\t\t\t\t}\t\t\t\t\n\t\t\t}\n\t\t}\n\t\telse if(count($this->feed->categories_array)==0)\n\t\t{\n\t\t\t//\n\t\t}\n\t\t/* */\n\t\telse\n\t\t{\n\t\t\tforeach($this->feed->categories_array as $k=>$v)\n\t\t\t{\n\t\t\t\tforeach($categories as $cat)\n\t\t\t\t{\n\t\t\t\t\tif($cat==$k||$k=='')\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->feed_item->category=$v;\n\t\t\t\t\t}\n\t\t\t\t\tif($cat==$k)\n\t\t\t\t\t{\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function getCategory()\n\t{\n\t\t$Category = new Product_Category();\n\t\treturn $Category->findItem( array( 'Layout = '.get_class( $this ) ) );\n\t}", "function get_category_rss_link($echo = \\false, $cat_ID = 1)\n{\n}", "public function getCategory()\r\n {\r\n return $this->category;\r\n }", "protected function itemprop_recipe_category(){\n $this->set_tag($this->get_recipe_category_tag(), $this->get_recipe_category_attributes(), $this->get_recipe_category());\n return $this->get_tag();\n }", "function solr_get_the_category() {\n\t\tif ( isset($this->solr_post['categories']) ) {\n\t\t\treturn $this->solr_post['categories'];\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public function getCategory()\n {\n return Mage::registry('current_category');\n }", "public function getCategory()\n {\n return $this->readOneof(6);\n }", "public function getCategory(): string\n {\n return $this->category;\n }", "public function getFeed($category);", "function fth_rss_categories($postId)\n{\n //Snippets of code taken from `get_the_category_rss()` inside of `wp-includes\\feed.php`\n $categories = get_the_category($postId);\n $the_list = '';\n $cat_names = array();\n if (!empty($categories)) {\n foreach ((array)$categories as $category) {\n if ($category->parent === 0) {\n $cat_names[] = sanitize_term_field('name', $category->name, $category->term_id, 'category', 'rss');\n }\n }\n }\n foreach ($cat_names as $cat_name) {\n $the_list .= \"\\t\\t<category><![CDATA[\" . @html_entity_decode(\n $cat_name,\n ENT_COMPAT,\n get_option('blog_charset')\n ) . \"]]></category>\\n\";\n }\n return $the_list;\n}", "public function GetRandomRssChannelCategory(){\n\t\t$query = \"\n\t\t\tSELECT\n\t\t\t\t*\n\t\t\tFROM\n\t\t\t\tzt_rss_channel_categories\n\t\t\tORDER BY RAND()\n\t\t\tLIMIT 1;\n\t\t\";\n\t\t\n\t\t$rssChannelCategoryQueryResult = $this->db->query($query)->row();\n\n\t\treturn $this->CreateObject($rssChannelCategoryQueryResult);\n\t\t\n\t}", "function get_category() {\n $category = null;\n\n if (!empty($this->categoryid)) {\n $category = grade_category::fetch('id', $this->categoryid);\n } elseif (!empty($this->iteminstance) && $this->itemtype == 'category') {\n $category = grade_category::fetch('id', $this->iteminstance);\n }\n\n return $category;\n }", "function get_item_category() {\n if (!$this->is_course_item() and !$this->is_category_item()) {\n return false;\n }\n return grade_category_local::fetch(array('id'=>$this->iteminstance));\n }", "private function get_category($mdk) {\n $srch = $this->search($mdk);\n if ($srch !== false) {\n list($cat, $key) = $srch;\n return $cat;\n }\n\n return false;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Loops through and fully optimizes an address
function fullOptimizeAddress($address) { $_SESSION['LAST_ACTIVITY'] = time(); // Get balance $balance = getBalance($address); if ($balance['availableBalance'] > 0) { // Open wallet optimizer ulitity exec(WALLET_OPTIMIZER_PATH . " " . WALLET_URL . " " . WALLET_PASSWORD . " " . $address . " " . $balance['availableBalance']); } }
[ "public function findSimilar($address);", "protected function _processAddress()\n {\n $shippingAddressStreet = $this->_order->getShippingAddress()->getStreet(-1);\n if (strlen($shippingAddressStreet) >= self::BILLING_ADDRESS_STREET_MAX_LENGTH) {\n $streetParts = explode(' ', $shippingAddressStreet);\n for ($i = 1; $i <= 4; $i++) {\n $xmlAddressField = 'b_padd' . $i;\n $xmlAddressFieldValue = '';\n foreach ($streetParts as $streetPartId => $streetPart) {\n if (strlen($xmlAddressFieldValue . ' ' . $streetPart) <= self::BILLING_ADDRESS_STREET_MAX_LENGTH) {\n $xmlAddressFieldValue .= ' ' . $streetPart;\n unset($streetParts[$streetPartId]);\n }\n }\n $this->_preparedXmlData[$xmlAddressField] = $xmlAddressFieldValue;\n }\n } else {\n $this->_preparedXmlData['b_padd1'] = $this->_order->getShippingAddress()->getStreet(-1);\n }\n }", "private function checkSameAddresses() {\n\t\t$geodata = unserialize($this->geocache);\n\t\tif (is_array($geodata)) {\n\t\t\t$allOk = TRUE;\n\t\t\tif (count($geodata) <> count($this->addresses)) {\n\t\t\t\t$allOk = FALSE;\n }\n\t\t\tforeach($geodata as $k=>$v) {\n\t\t\t\tif(trim($this->addresses[$k]) <> $v['cacheAddress']) {\n\t\t\t\t\t$allOk = FALSE;\n }\n\t\t\t\tif($v['geoData']['lon'] == 0 && $v['geoData']['lat'] == 0) {\n\t\t\t\t\t$allOk = FALSE;\n }\n\t\t\t}\n\t\t\tif (!$allOk) {\n\t\t\t\t$this->getNewGeoData();\n }\n\t\t} else {\n\t\t\t$this->getNewGeoData();\n }\n\t}", "function arcgis_geocode_bbbs_event_addresses($bbbs_events_array)\n{\n\t$sql_connection= NULL;\n\t$arcgis_api_token= NULL;\n\t$batch_addresses= array();\n\t$cached_address_count= 0;\n\t\n\tif (!is_null($bbbs_events_array) && (0 < count($bbbs_events_array)))\n\t{\n\t\tdebug::log(\"parsing \" . count($bbbs_events_array) . \" events...\");\n\t\t\n\t\t// obtain ArcGIS API token\n\t\t$arcgis_token_json= generate_arcgis_api_token();\n\t\t\n\t\tif (!is_null($arcgis_token_json))\n\t\t{\n\t\t\t$json_object= json_decode($arcgis_token_json, true);\n\t\t\t\n\t\t\tif (!is_null($json_object))\n\t\t\t{\n\t\t\t\tif (isset($json_object[JSON_KEY_SUCCESS]) &&\n\t\t\t\t\tTRUE === $json_object[JSON_KEY_SUCCESS] &&\n\t\t\t\t\tisset($json_object[ARCGIS_API_ACCESS_TOKEN_KEY]))\n\t\t\t\t{\n\t\t\t\t\t$arcgis_api_token= $json_object[ARCGIS_API_ACCESS_TOKEN_KEY];\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tdebug::log(\"arcgis_geocode_addresses() failed to decode JSON for ArcGIS API token!\");\n\t\t\t\t}\n\t\t\t}\n\t\t} // ArcGIS API token\n\t\t\n\t\t// any previously obtained geocoding results are tracked here, so as to avoid attempts at duplicate entries into the db (which would fail anyway)\n\t\t$already_cached_addresses= array();\n\t\t\n\t\t// assemble input for batch geocode operation\n\t\tif (!is_null($arcgis_api_token))\n\t\t{\n\t\t\t$sql_connection= initialize_database_connection();\n\t\t\t\n\t\t\tif (!is_null($sql_connection))\n\t\t\t{\n\t\t\t\t$event_index= 0;\n\t\t\t\t\n\t\t\t\tforeach ($bbbs_events_array as $input_event)\n\t\t\t\t{\n\t\t\t\t\tif (is_array($input_event))\n\t\t\t\t\t{\n\t\t\t\t\t\tdebug::error(\"arcgis_geocode_addresses(): input_event [\" . $event_index . \"] was an array, not a c_bbbs_event! input_event= \" . print_r($input_event, TRUE));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif (\"c_bbbs_event\" != get_class($input_event))\n\t\t\t\t\t{\n\t\t\t\t\t\tdebug::error(\"arcgis_geocode_addresses(): input_event [\" . $event_index . \"] not a c_bbbs_event! input_event= \" . print_r($input_event, TRUE));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// get the input event data (we're about to attempt to retrieve ArcGIS data for it)\n\t\t\t\t\t$input_event_data= $input_event->get_event_data();\n\t\t\t\t\t\n\t\t\t\t\t// $input_event[c_bbbs_event::k_key_arcgis_data] is expected to be an array itself\n\t\t\t\t\tif (!is_array($input_event_data[c_bbbs_event::k_key_arcgis_data]))\n\t\t\t\t\t{\n\t\t\t\t\t\tdebug::error(\"arcgis_geocode_addresses(): input_event_data[\". $event_index . \"][\" . c_bbbs_event::k_key_arcgis_data . \"] needs to be an array, but is not!\");\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$event_location_index= 0;\n\t\t\t\t\t\n\t\t\t\t\tforeach ($input_event_data[c_bbbs_event::k_key_arcgis_data] as $address_entry)\n\t\t\t\t\t{\n\t\t\t\t\t\t$single_line_address= $address_entry[c_bbbs_event::k_key_arcgis_single_line_address];\n\t\t\t\t\t\t\n\t\t\t\t\t\t// the absolute index into the events array is used as the object identifier for now\n\t\t\t\t\t\t//##stefan $NOTE might want to use a Google Calendar event id here?\n\t\t\t\t\t\t// for now, we assume there could be up to c_bbbs_event::k_maximum_locations_per_event locations per event\n\t\t\t\t\t\t$location_object_index= (int)(c_bbbs_event::k_maximum_locations_per_event * $event_index + $event_location_index++);\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (c_bbbs_event::k_maximum_locations_per_event <= $event_location_index)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tdebug::log(\"arcgis_geocode_addresses():address_geocode_data_try_and_get(): found an event with \" . c_bbbs_event::k_maximum_locations_per_event . \"+ locations!\");\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t// do we already have ArcGIS positional data cached for this address?\n\t\t\t\t\t\t// result JSON: { \"success\": <boolean> [, \"address_found\": boolean] }\n\t\t\t\t\t\t$cached_arcgis_data_json= address_geocode_data_try_and_get($sql_connection, $single_line_address);\n\t\t\t\t\t\t$cached_arcgis_data= json_decode($cached_arcgis_data_json, TRUE);\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (!is_null($cached_arcgis_data))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (isset($cached_arcgis_data[JSON_KEY_SUCCESS]) &&\n\t\t\t\t\t\t\t\t(TRUE === $cached_arcgis_data[JSON_KEY_SUCCESS]))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif (isset($cached_arcgis_data[ADDRESS_FOUND_JSON_KEY]) &&\n\t\t\t\t\t\t\t\t\tTRUE === $cached_arcgis_data[ADDRESS_FOUND_JSON_KEY] &&\n\t\t\t\t\t\t\t\t\tisset($cached_arcgis_data[k_db_row_address]) &&\n\t\t\t\t\t\t\t\t\tisset($cached_arcgis_data[k_db_row_address_hash]) &&\n\t\t\t\t\t\t\t\t\tisset($cached_arcgis_data[k_db_row_geocode_score]) &&\n\t\t\t\t\t\t\t\t\tisset($cached_arcgis_data[k_db_row_spatial_reference]) &&\n\t\t\t\t\t\t\t\t\tisset($cached_arcgis_data[k_db_row_x]) &&\n\t\t\t\t\t\t\t\t\tisset($cached_arcgis_data[k_db_row_y]) &&\n\t\t\t\t\t\t\t\t\tisset($cached_arcgis_data[k_db_row_display_x]) &&\n\t\t\t\t\t\t\t\t\tisset($cached_arcgis_data[k_db_row_display_y]) &&\n\t\t\t\t\t\t\t\t\t!empty($cached_arcgis_data[k_db_row_address]) &&\n\t\t\t\t\t\t\t\t\t!empty($cached_arcgis_data[k_db_row_address_hash]))\n\t\t\t\t\t\t\t\t\t/* NOTE some of these may be '0' for 'poor addresses', so this sort of checking is too agressive\n\t\t\t\t\t\t\t\t\t&& !empty($cached_arcgis_data[k_db_row_geocode_score]))*/\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t// we haved cached geocoding data for this entry; attach it to this event record\n\t\t\t\t\t\t\t\t\t//###stefan $NOTE this uses the cached result regardless of the score value which was previously saved\n\t\t\t\t\t\t\t\t\t//debug::log(\"found cached address data for [\" . $single_line_address . \"] : \" . $cached_arcgis_data_json);\n\t\t\t\t\t\t\t\t\t$input_event->add_arcgis_geocoding_data(\n\t\t\t\t\t\t\t\t\t\t$event_location_index,\n\t\t\t\t\t\t\t\t\t\t$single_line_address,\n\t\t\t\t\t\t\t\t\t\t$cached_arcgis_data[k_db_row_geocode_score],\n\t\t\t\t\t\t\t\t\t\t$cached_arcgis_data[k_db_row_spatial_reference],\n\t\t\t\t\t\t\t\t\t\t$cached_arcgis_data[k_db_row_x],\n\t\t\t\t\t\t\t\t\t\t$cached_arcgis_data[k_db_row_y],\n\t\t\t\t\t\t\t\t\t\t$cached_arcgis_data[k_db_row_display_x],\n\t\t\t\t\t\t\t\t\t\t$cached_arcgis_data[k_db_row_display_y]);\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t// remember the fact that we already have this address data in the db, to avoid duplicate attempts to cache it in the same program run\n\t\t\t\t\t\t\t\t\t$already_cached_addresses[]= $single_line_address;\n\t\t\t\t\t\t\t\t\t$cached_address_count+= 1;\n\t\t\t\t\t\t\t\t\t//debug::log(\"Found {$cached_address_count} cached addresses...\");\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse if (isset($cached_arcgis_data[ADDRESS_FOUND_JSON_KEY]) &&\n\t\t\t\t\t\t\t\t\t(FALSE === $cached_arcgis_data[ADDRESS_FOUND_JSON_KEY]))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t// no cached geocoding data for this address; add this entry to our batch geocoding request input\n\t\t\t\t\t\t\t\t\t//debug::log(\"No geocode data for [\" . $single_line_address . \"]\");\n\t\t\t\t\t\t\t\t\t$input_record= new c_arcgis_address_input_record($location_object_index, $single_line_address);\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t$batch_addresses[]= $input_record;\n\t\t\t\t\t\t\t\t\t//debug::log(\"Need to geocode \" . count($batch_addresses) . \" addresses...\");\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tdebug::error(\"arcgis_geocode_addresses():address_geocode_data_try_and_get() failed to query db on input address [{$single_line_address}]!\");\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tdebug::error(\"arcgis_geocode_bbbs_event_addresses(): failed to query database!\");\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tdebug::error(\"arcgis_geocode_bbbs_event_addresses(): failed to decode ArcGIS JSON [{$cached_arcgis_data_json}]!\");\n\t\t\t\t\t\t}\n\t\t\t\t\t} // foreach ($input_event_data[c_bbbs_event::k_key_arcgis_data] as $address_entry)\n\t\t\t\t\t$event_index+= 1;\n\t\t\t\t} // foreach ($bbbs_events_array as $input_event)\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tdebug::error(\"arcgis_geocode_bbbs_event_addresses(): failed to connect to db for cached geocoding data lookup!\");\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tdebug::error(\"arcgis_geocode_bbbs_event_addresses(): failed to retrieve an ArcGIS API token!\");\n\t\t}\n\t\t\n\t\t// perform batch geocoding call\n\t\tif (0 < count($batch_addresses))\n\t\t{\n\t\t\t$batch_geocode_response= NULL;\n\t\t\t$batch_geocode_response_json= \"\";\n\t\t\t\n\t\t\t//###stefan $TODO perform some fixup on singleline address that don't start w/ street number for ArcGIS geocoding \n\t\t\tdebug::log(\"arcgis_geocode_bbbs_event_addresses(): batch geocoding \" . count($batch_addresses) . \" addresses...\");\n\t\t\t\n\t\t\t//addresses={\"records\":[{\"attributes\":{\"OBJECTID\":1,\"Address\":\"380 New York St\",\"Neighborhood\":\"\",\"City\":\"Redlands\",\"Subregion\":\"\",\"Region\":\"CA\"}},{\"attributes\":{\"OBJECTID\":2,\"Address\":\"1 World Way\",\"Neighborhood\":\"\",\"City\":\"Los Angeles\",\"Subregion\":\"\",\"Region\":\"CA\"}}]}\n\t\t\t$batch_addresses_json= \"{\\\"records\\\":\" . json_encode($batch_addresses) . \"}\";\n\t\t\t$batch_geocode_url= \"http://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer/geocodeAddresses\";\n\t\t\t// NOTE: forcing web mercator projection spacial reference!\n\t\t\t$query_kvp= array(\n\t\t\t\t\"addresses\"=> $batch_addresses_json,\n\t\t\t\t\"sourceCountry\"=> \"USA\",\n\t\t\t\t\"token\"=> $arcgis_api_token,\n\t\t\t\t\"outSR\"=> k_web_mercator_projection_spatial_reference,\n\t\t\t\t\"f\"=> \"json\"\n\t\t\t);\n\t\t\t$batch_geocode_response_json= perform_http_get_json($batch_geocode_url, $query_kvp, TRUE);\n\t\t\tif (!is_null($batch_geocode_response_json))\n\t\t\t{\n\t\t\t\t$batch_geocode_response= json_decode($batch_geocode_response_json, TRUE);\n\t\t\t}\n\t\t\t\n\t\t\tif (!is_null($batch_geocode_response) &&\n\t\t\t\tisset($batch_geocode_response[k_key_json_key_spatial_reference]) &&\n\t\t\t\tisset($batch_geocode_response[k_json_key_locations]) &&\n\t\t\t\tis_array($batch_geocode_response[k_json_key_locations]))\n\t\t\t{\n\t\t\t\t// store the spatial reference\n\t\t\t\t$spatial_reference= $batch_geocode_response[k_key_json_key_spatial_reference][k_key_json_key_spatial_reference_wkid];\n\t\t\t\t\n\t\t\t\t// iterate through results and act accordingly\n\t\t\t\tforeach ($batch_geocode_response[k_json_key_locations] as $location)\n\t\t\t\t{\n\t\t\t\t\t$location_point= (isset($location[k_json_key_location]) && is_array($location[k_json_key_location])) ? $location[k_json_key_location] : NULL;\n\t\t\t\t\t$location_attributes= isset($location[k_json_key_attributes]) ? $location[k_json_key_attributes] : NULL;\n\t\t\t\t\t$single_line_address= \"\";\n\t\t\t\t\t$location_score= 0.0;\n\t\t\t\t\t$location_x= 0.0;\n\t\t\t\t\t$location_y= 0.0;\n\t\t\t\t\t$display_x= 0.0;\n\t\t\t\t\t$display_y= 0.0;\n\t\t\t\t\t\n\t\t\t\t\tif (is_null($location_attributes) || !isset($location_attributes[k_json_key_result_id]))\n\t\t\t\t\t{\n\t\t\t\t\t\t// if we didn't get back ResultID, skip this entry entirely\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// ResultID is passed in as ((event_index * c_bbbs_event::k_maximum_locations_per_event) + location_index)\n\t\t\t\t\t$result_id= (int)$location_attributes[k_json_key_result_id];\n\t\t\t\t\t$event_location_index= (int)($result_id % (int)c_bbbs_event::k_maximum_locations_per_event);\n\t\t\t\t\t$event_index= (int)(($result_id - $event_location_index) / (int)c_bbbs_event::k_maximum_locations_per_event);\n\t\t\t\t\t$event_data_array= $bbbs_events_array[$event_index]->get_event_data();\n\t\t\t\t\t$single_line_address= $event_data_array[c_bbbs_event::k_key_arcgis_data][$event_location_index][c_bbbs_event::k_key_arcgis_single_line_address];\n\t\t\t\t\t\n\t\t\t\t\tif (is_null($location_point) ||\n\t\t\t\t\t\t!isset($location[k_json_key_score]) ||\n\t\t\t\t\t\t!isset($location_attributes[k_json_key_display_x]) ||\n\t\t\t\t\t\t!isset($location_attributes[k_json_key_display_y]))\n\t\t\t\t\t{\n\t\t\t\t\t\t// don't bother logging this, it happens regularly for events that couldn't be geocoded\n\t\t\t\t\t\t//debug::warning(\"arcgis_geocode_bbbs_event_addresses(): batch geocoding returned a location with missing data! [\" . print_r($location, TRUE) . \"]\");\n\t\t\t\t\t\t// we will go ahead and cache this entry to the database so that we don't bother trying to geocode it again in the future\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$location_score= $location[k_json_key_score];\n\t\t\t\t\t\t$location_x= $location_point[k_json_key_x];\n\t\t\t\t\t\t$location_y= $location_point[k_json_key_y];\n\t\t\t\t\t\t$display_x= (double)$location_attributes[k_json_key_display_x];\n\t\t\t\t\t\t$display_y= (double)$location_attributes[k_json_key_display_y];\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// save off whatever we found\n\t\t\t\t\t$bbbs_events_array[$event_index]->add_arcgis_geocoding_data($event_location_index, $single_line_address, $location_score, $spatial_reference, $location_x, $location_y, $display_x, $display_y);\n\t\t\t\t\t\n\t\t\t\t\tif ((k_geocode_score_acceptance_threshold <= $location_score) || CACHE_LOW_SCORE_GEOCODE_RESULTS)\n\t\t\t\t\t{\n\t\t\t\t\t\t// update database with any addresses we didn't previously have on record\n\t\t\t\t\t\tif (!in_array($single_line_address, $already_cached_addresses))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// save this geocode result out to the database\n\t\t\t\t\t\t\t$db_update_result_json= address_set_geocode_data($sql_connection, $single_line_address, $location_score, $spatial_reference, $location_x, $location_y, $display_x, $display_y);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$db_update_result= json_decode($db_update_result_json, TRUE);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif (!is_null($db_update_result) &&\n\t\t\t\t\t\t\t\tisset($db_update_result[JSON_KEY_SUCCESS]) &&\n\t\t\t\t\t\t\t\tTRUE === $db_update_result[JSON_KEY_SUCCESS])\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t// db update successful! remember that we already cached this address, to avoid duplicate attempts in the same run\n\t\t\t\t\t\t\t\t$already_cached_addresses[]= $single_line_address;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t//debug::log(print_r($already_cached_addresses, TRUE));\n\t\t\t\t\t\t\t\tdebug::error(\"arcgis_geocode_bbbs_event_addresses(): failed to update db with geocode data for event[\" . $event_index . \"].address [\" . $location_index . \"] <\" .\n\t\t\t\t\t\t\t\t\t$single_line_address . \">! db result JSON= \" . $db_update_result_json);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// this address has already been cached to the db\n\t\t\t\t\t\t\t//debug::log(\"we've already cached address [\" . $single_line_address . \"] to the database\");\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tdebug::log(\"arcgis_geocode_bbbs_event_addresses(): disregarding batch geocoding results for id= [\" .\n\t\t\t\t\t\t\t$location_index . \"] : score [\" . $location_score . \"] is below threshold value [\" .\n\t\t\t\t\t\t\tk_geocode_score_acceptance_threshold . \"].\");\n\t\t\t\t\t}\n\t\t\t\t} // foreach(location)\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tdebug::error(\"arcgis_geocode_bbbs_event_addresses(): batch geocoding returned an unexpected response! JSON= [\" . $batch_geocode_response_json . \"] => [\" . print_r($batch_geocode_response, TRUE) . \"]\");\n\t\t\t}\n\t\t}\n\t\telse if (($cached_address_count == count($batch_addresses)) || (0 == count($batch_addresses)))\n\t\t{\n\t\t\t// this means that every input event address had already been cached, or there is nothing to check - so, nothing more needed\n\t\t\t//debug::log(\"arcgis_geocode_bbbs_event_addresses(): all addresses querried were previously cached, nothing to do (yay!)\");\n\t\t}\n\t\telse\n\t\t{\n\t\t\tdebug::warning(\"arcgis_geocode_addresses() failed to generate batch address request input!\");\n\t\t}\n\t}\n\telse\n\t{\n\t\tdebug::log(\"arcgis_geocode_addresses() called with no addresses to query!\");\n\t}\n\t\n\t// close db connection\n\tif (!is_null($sql_connection))\n\t{\n\t\tdispose_database_connection($sql_connection);\n\t}\n\t\n\t// return the input array, now with any discovered geocoding results added to it\n\t\n\treturn $bbbs_events_array;\n}", "function BroLoopRef($tok) {\n global $BroInfoA;\n $segs = explode('@', $tok); # function BroRef($ref, $noErrorB=false)\n if (($n = count($segs)) > 1 && ($broRef = BroRef($seg0 = $segs[0], false)) !== false) { # Got '@' segs && RegisteredOffice or SchInputEntity.Officers.Name is a Bro\n $broId = (int)$broRef; # (int) to get BroId in case of dimensions\n #echo \"BroLoopRef $tok $broId segs[1]=$segs[1]<br>\";\n $broBits = $BroInfoA[$broId][BroI_Bits];\n #if (($dataTypeN = $BroInfoA[$broId][BroI_DataTypeN]) != DT_String)\n # return RGError(\"The Bro $seg0 is type $dataTypeN \". DataTypeStr($dataTypeN).' not string as a Bro loop requires');\n switch ($segs[1]) {\n case 'Address':\n # RegisteredOffice@Address -> RegisteredOffice.AddressLine1\n # TPAs:TPAType.Accountants@Address -> TPAs.AddressLine1:TPAType.Accountants\n # SchInputEntity.ThirdPartyAgents.MeansContact.Address,TPAType.Accountants@Address -> SchInputEntity.ThirdPartyAgents.MeansContact.Address.Line1:TPAType.Accountants\n # SchInputEntity.MeansContact.Address,ContactType.RegisteredOffice -> SchInputEntity.MeansContact.Address.Line1:ContactType.RegisteredOffice\n if ($broBits&BroB_Ele) return RGError(\"The @Address loop option is only valid with a Bro Set but $seg0 is not a Set\");\n if (strpos($seg0, ',') !== false)\n $first = str_replace('Address,', 'Address.Line1,', $seg0); # SchInputEntity.ThirdPartyAgents.MeansContact.Address:TPAType.Accountants@Address -> SchInputEntity.ThirdPartyAgents.MeansContact.Address.Line1:TPAType.Accountants\n else\n return RGError(\"The @Address loop option expects a Bro Set name ending in '.Address' followed by ,TPAType. ... or :ContactType. ...\");\n # echo \"first=$first<br>\";\n if (($broRef = BroRef($first)) === false) return RGError(\"The Bro $first does not exist but is required for the @Address loop option\");\n # pBroRef = BroRef of first element of loop e.g. SchInputEntity.Officers.Name@Directors in parameter form\n # num = number of times to loop\n # type = 0 if BroId loop as for addresses, 1 if ManDiMeId loop as for Directors\n # testIdDelta = optional id delta from BroId to the BroId of a boolean element of the BRO set with output only if true\n return [PBroRef($broRef), BRO_NumAddressLines, 0, 0];\n\n case 'Directors':\n if ($broBits&BroB_Set) return RGError(\"The @Directors loop option is only valid with a Bro Element but $seg0 is a Set\");\n $fullName = $seg0 . ',.Director1'; # SchInputEntity.Officers.Name,.Director1\n $num = BRO_NumDirectors;\n $type = 1;\n break;\n\n default: return RGError(\"Unknown name $segs[1] for @ loop option\");\n }\n\n if (($broRef = BroRef($fullName)) === false) return RGError(\"The Bro $fullName does not exist but is required for the @{$segs[1]} loop option\");\n BroRefToBroIdAndParamForm($broRef, $broId, $pBroRef);\n $testIdDelta = 0;\n if ($n > 2) {\n # SchInputEntity.Officers.Name@Directors@DirectorSigningAccounts\n # Check for the part of 0 minus the last level name & seg[2] & dim from fullname -> SchInputEntity.Officers.DirectorSigningAccounts:.Director1\n # echo \"$set.1.{$segs[1]}<br>\";\n $testBroName = substr($seg0, 0, strrpos($seg0, '.')+1) . $segs[2] . strrchr($fullName, ':');\n if (($testBroRef = BroRef($testBroName)) === false) return RGError(\"Bro loop test element $testBroName not found\");\n $testBroId = (int)$testBroRef;\n if ($BroInfoA[$testBroId][BroI_DataTypeN] != DT_Boolean) return RGError(\"Bro loop test element $testBroName not a boolean\");\n $testIdDelta = $testBroId - $broId;\n }\n return [$pBroRef, $num, $type, $testIdDelta];\n }\n return false;\n}", "function find_address($spec)\n {\n\tforeach ($spec as $x)\n\t{\n\t $ca = $this->get_address($x);\n\t if ($ca->id) break;\n\t}\n\treturn $ca;\n }", "public function extractAddress($object);", "function scrape_addresses()\n{\n global $gasp;\n $office_locations_path = 'index.cfm?FuseAction=Contact.OfficeLocations';\n $office_loc_search = \"div[id=copyMargins] td td\";\n \n $dom = get_page_dom($office_locations_path);\n $office_els = $dom->find($office_loc_search);\n \n $num_els = count($office_els);\n for ($o=0; $o < $num_els; $o++) { \n print $office_els[$o]->plaintext . \"\\n\\n\";\n if (!DEBUG) $gasp->add_office($office_els[$o]->plaintext);\n }\n}", "public function invoiceAddress() {\n $result = $this->purchases->flatInvoice();\n foreach ($result as $key => $value) {\n $getAdress = $this->purchases->companyAddress($value->CustomerCompanyID);\n $data = array('Params' => $getAdress[0]->Params);\n $response = $this->purchases->invoiceAdressupdate($value->InvoiceID, $data);\n echo $response . \"<br/>\";\n }\n }", "private function populateAddressVars()\r\n {\r\n if (!$this->service_results || !$this->service_results->results[0]) {\r\n return false;\r\n }\r\n foreach ($this->service_results->results[0]->address_components as $component) {\r\n if (in_array('street_number', $component->types)) {\r\n $this->streetNumber = $component->long_name;\r\n } elseif (in_array('locality', $component->types)) {\r\n $this->locality = $component->long_name;\r\n } elseif (in_array('postal_town', $component->types)) {\r\n $this->town = $component->long_name;\r\n } elseif (in_array('administrative_area_level_2', $component->types)) {\r\n $this->country = $component->long_name;\r\n } elseif (in_array('country', $component->types)) {\r\n $this->country = $component->long_name;\r\n } elseif (in_array('administrative_area_level_1', $component->types)) {\r\n $this->district = $component->long_name;\r\n } elseif (in_array('postal_code', $component->types)) {\r\n $this->postcode = $component->long_name;\r\n } elseif (in_array('route', $component->types)) {\r\n $this->streetAddress = $component->long_name;\r\n }\r\n }\r\n }", "private function populateAddressVars()\n {\n if (!$this->service_results || !$this->service_results->results[0]) {\n return false;\n }\n\n foreach ($this->service_results->results[0]->address_components as $component) {\n if (in_array('street_number', $component->types)) {\n $this->streetNumber = $component->long_name;\n } elseif (in_array('locality', $component->types)) {\n $this->locality = $component->long_name;\n } elseif (in_array('postal_town', $component->types)) {\n $this->town = $component->long_name;\n } elseif (in_array('administrative_area_level_2', $component->types)) {\n $this->country = $component->long_name;\n } elseif (in_array('country', $component->types)) {\n $this->country = $component->long_name;\n } elseif (in_array('administrative_area_level_1', $component->types)) {\n $this->district = $component->long_name;\n } elseif (in_array('postal_code', $component->types)) {\n $this->postcode = $component->long_name;\n } elseif (in_array('route', $component->types)) {\n $this->streetAddress = $component->long_name;\n }\n }\n }", "public function get_addresses();", "public function getAddressAtOffset($n);", "private function ip2location(){\n global $profiler;\n global $db;\n $profiler->add(\"ip2location() called\");\n if($db->checktable('ip2location')){\n $q=$db->querydb(\"SELECT * FROM raw_stats\");\n if($q->num_rows){\n while($ro=$q->fetch_object()){\n $ip=$ro->REMOTE_ADDRESS;\n $values=$this->ipdb($ip);\n $values['BROWSER_ID']=$ro->BROWSER_ID;\n $db->replace('ip2location', $values);\n }\n }\n $profiler->add(\"Returned from ip2location()\");\n }\n }", "function gmapApiQuery($start, $finish, $addresses = []){\n $function = \"gmapApiQuery('$start', '$finish', '\" . json_encode($addresses) . \"')\";\n $result = cacheGet($function, 0, '');\n if ($result) return $result;\n\n $db = \\label\\DB::getInstance(\\label\\DB::USAGE_WRITE);\n $dbr = \\label\\DB::getInstance(\\label\\DB::USAGE_READ);\n $n = str_replace('GMAP_API_key', '', str_replace('_default', '', \\Config::get($db, $dbr, 'defgmap')));\n if (!strlen($n)) $n = 1;\n\n foreach ($addresses as $key => $address) {\n $address = str_replace('removed', '', $address);\n $address = trim($address);\n if($address[0] == ',') $address = trim(substr($address, 1));\n $addresses[$key] = $address;\n }\n\n $url_str = 'https://maps.googleapis.com/maps/api/directions/json?'\n . 'origin=' . urlencode($start)\n . '&destination=' . urlencode($finish)\n . '&waypoints=optimize:true|' . urlencode(implode('|', $addresses));\n $errors = '';\n\n for ($i = 1; $i <= 8; $i++) {\n $gkey = \\Config::get($db, $dbr, 'GMAP_API_key' . $n);\n $url2route = $url_str . '&key=' . $gkey;\n\n $ch = new \\Curl($url2route, [\n CURLOPT_RETURNTRANSFER => 1,\n CURLOPT_ENCODING => '',\n ]);\n $route_json = $ch->exec();\n $route_decoded = json_decode($route_json);\n gmap_stat($url_str, $route_decoded->status);\n\n switch ($route_decoded->status) {\n case \"OK\":\n break 2;\n case \"ZERO_RESULTS\": // check all addresses\n case \"NOT_FOUND\": // and show just points on map without route\n $errors .= gmapCheckAddress($start, $gkey);\n $errors .= gmapCheckAddress($finish, $gkey);\n foreach ($addresses as $auction_id => $addr) {\n $errors .= gmapCheckAddress($addr, $gkey, $auction_id);\n }\n $route_json = false;\n break 2;\n case \"OVER_QUERY_LIMIT\": // switch key, no break foreach\n $n_with_error = $n;\n $n++;\n $n = ($n > 8) ? 1 : $n;\n \\Config::set($db, $dbr, 'defgmap', \"GMAP_API_key{$n}_default\");\n $errors .= \"<p>Status: {$route_decoded->status}; key #{$n_with_error}; query: <a href='$url2route'\n target='_blank'>link</a>; message: {$route_decoded->error_message}</p>\";\n sleep(1);\n break 1;\n default: // unknown error\n $errors .= \"<p>Status: {$route_decoded->status}; key #$n; query: <a href='$url2route'\n target='_blank'>link</a>; message: {$route_decoded->error_message}</p>\";\n break 2;\n }\n }\n\n if(strlen($errors)){\n echo \"<div style='margin:10px;padding:0 20px;background:pink;border:1px solid red;'>$errors</div>\";\n };\n\n if($route_decoded->status != 'OVER_QUERY_LIMIT'){\n cacheSet($function, 0, '', $route_json);\n }\n\n return $route_json;\n}", "protected function checkAddressDuplicates()\n {\n return true;\n }", "function getLocation($address) {\n\tset_time_limit(60);\n\t$address = urlencode($address);\n\t//wait 1/2 second so that Google won't throttle\n\tusleep(500000);\n\t//geotag the location\n\t$geo = json_decode(file_get_contents(\"http://maps.googleapis.com/maps/api/geocode/json?address=$address&sensor=false\"));\n\t//check the first result as it's the one with highest probability\n\tif ($geo && count($geo->results)>0) {\n\n\t\t//check if the addess is in Bulgaria\n\t\tif ($geo->results[0]->address_components)\n\t\t\tfor ($i=0;$i<count($geo->results[0]->address_components);$i++) \n\t\t\t\tif ($geo->results[0]->address_components[$i]->long_name==\"Bulgaria\")\n\t\t\t\t\treturn -1;\n\n\t\t//calculate the marker position\n\t\tif ($geo->results[0]->geometry) {\n\t\t\t$geom=$geo->results[0]->geometry;\n\t\t\t$span=1;\n\t\t\t\n\t\t\t//get the city bounds, divide them by half and limit it to one unit\n\t\t\tif ($geom->bounds) {\n\t\t\t\t$lat_span=abs(doubleval($geom->bounds->northeast->lat)-doubleval($geom->bounds->southwest->lat));\n\t\t\t\t$lng_span=abs(doubleval($geom->bounds->northeast->lng)-doubleval($geom->bounds->southwest->lng));\n\t\t\t\t$span = ($lat_span+$lng_span)/4;\n\t\t\t\tif ($span>1)\n\t\t\t\t\t$span=1;\n\t\t\t}\n\n\t\t\t//get the center of the city and distribute the markers in radial pattern with random distance and degrees\n\t\t\tif ($geom->location) {\n\t\t\t\t$lat = doubleval($geom->location->lat)+rand()/getrandmax()*rand()/getrandmax()*$span*sin(rand()/getrandmax()*2*pi());\n\t\t\t\t$lng = doubleval($geom->location->lng)+rand()/getrandmax()*rand()/getrandmax()*$span*cos(rand()/getrandmax()*2*pi());\n\t\t\t\treturn array($lat,$lng);\n\t\t\t}\n\t\t}\n\t} \n\n\treturn 0;\n}", "function snes_to_pc(int $address)\n{\n return (($address & 0x7F0000) >> 1) | ($address & 0x7FFF);\n}", "private function _saveAddress()\n\t {\n\t\t$slicer = new AddressSlicer($this->_advert->city . \", \" . $this->_advert->address);\n\n\t\tif ($slicer->valid() === true && isset($this->_advert->phone) === true)\n\t\t {\n\t\t\t$hash = sha1($slicer->hash . $this->_advert->phone);\n\t\t\tif ($this->_exists(\"addresses\", $hash) === false)\n\t\t\t {\n\t\t\t\t$this->_db->exec(\"INSERT INTO `addresses` SET \" .\n\t\t\t\t \"`city` = '\" . $this->_advert->city . \"', \" .\n\t\t\t\t \"`hash` = '\" . $hash . \"', \" .\n\t\t\t\t \"`address` = '\" . $slicer->address . \"', \" .\n\t\t\t\t \"`phone` = '\" . $this->_advert->phone . \"'\"\n\t\t\t\t);\n\t\t\t } //end if\n\n\t\t }\n\t\telse if (isset($this->_advert->phone) === true)\n\t\t {\n\t\t\t$hash = sha1($this->_advert->city . \", \" . $this->_advert->address . $this->_advert->phone);\n\t\t\tif ($this->_exists(\"addresses\", $hash) === false)\n\t\t\t {\n\t\t\t\t$this->_db->exec(\"INSERT INTO `addresses` SET \" .\n\t\t\t\t \"`city` = '\" . $this->_advert->city . \"', \" .\n\t\t\t\t \"`hash` = '\" . $hash . \"', \" .\n\t\t\t\t \"`address` = '\" . $this->_advert->address . \"', \" .\n\t\t\t\t \"`phone` = '\" . $this->_advert->phone . \"'\"\n\t\t\t\t);\n\t\t\t } //end if\n\n\t\t } //end if\n\n\t }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/Retorna el ultimo dia de cada mes; tiene en cuenta si este es biciesto o no
public function ultimoDiaMes(){ switch($this->getMes()){ case 1: return 31; case 2: if ($this->bisiesto()){ return 29; } else { return 28; } break; case 3: return 31; case 4: return 30; case 5: return 31; case 6: return 30; case 7: return 31; case 8: return 31; case 9: return 30; case 10: return 31; case 11: return 30; case 12: return 31; } }
[ "function contarNumerosMesesCompletos($fecha_inicio, $fecha_fin) {\n\n\n $inicio_dia = intval(getFechaPatron($fecha_inicio, 'd'));\n\n $inicio_mes = intval(getFechaPatron($fecha_inicio, 'm'));\n $fin_mes = intval(getFechaPatron($fecha_fin, 'm'));\n\n $num_mes = ($fin_mes - $inicio_mes) + 1;\n\n //condicion 01\n\n if ($inicio_dia > 1):\n $num_mes = $num_mes - 1;\n endif;\n\n\n //condicion 02\n if (getFechaPatron($fecha_inicio, 'Y') < getFechaPatron($fecha_fin, 'Y')) {\n $num_mes = 6;\n } else {\n\n\n\n if ($num_mes >= 6):\n echo \"MESES MAS DE 6 MESE O =\" . $num_mes;\n $num_mes = 6;\n //GRATIFICACION MORMAL\n elseif ($num_mes > 0 && $num_mes < 6): // tienen trabajador 5 meses o menos \n echo \"MENOS DE 6 MESES $num_mes\";\n //GRATIFICACION PROPORCIONAL\n else:\n ECHO \"0 meses o negativo $num_mes\";\n $num_mes = 0;\n //SIN GRATIFICACION\n endif;\n }\n\n echoo($num_mes);\n return $num_mes;\n}", "function calcularCantidadMeses($fecha_inicio,$fecha_fin){\r\n $dia_inicio= substr($fecha_inicio, -2);\r\n $mes_inicio= substr($fecha_inicio, 4,2);\r\n $ano_inicio= substr($fecha_inicio, 0,4);\r\n $dia_fin= substr($fecha_fin, -2);\r\n $mes_fin= substr($fecha_fin, 4,2);\r\n $ano_fin= substr($fecha_fin, 0,4);\r\n $dif_anios = $ano_fin- $ano_inicio;\r\n if($dif_anios == 1){\r\n $mes_inicio = 12 - $mes_inicio;\r\n $meses = $mes_fin + $mes_inicio;\r\n \r\n \r\n }\r\n else{\r\n if($dif_anios == 0){\r\n $meses=$mes_fin - $mes_inicio;\r\n \r\n \r\n }\r\n else{\r\n if($dif_anios > 1){\r\n $mes_inicio = 12 - $mes_inicio;\r\n $meses = $mes_fin + $mes_inicio + (($dif_anios - 1) * 12);\r\n \r\n }\r\n else { exit; }\r\n }\r\n }\r\n return $meses;\r\n }", "function getUltimoDiaMes($elAnio,$elMes) {\n return date(\"d\",(mktime(0,0,0,$elMes+1,1,$elAnio)-1));\n }", "public function ultimoDiaMes($ano, $mes){ \r\n\r\n\t\r\n\r\n if (((fmod($ano,4)==0) and (fmod($ano,100)!=0)) or (fmod($ano,400)==0)) { \r\n $dias_fevereiro = 29; \r\n } else { \r\n $dias_fevereiro = 28; \r\n } \r\n \r\n\r\n switch(intval($mes)) { \r\n case '01': \r\n return 31; \r\n break; \r\n case '02': \r\n return $dias_fevereiro; \r\n break; \r\n case '03': \r\n return 31; \r\n break; \r\n case '04': \r\n return 30; \r\n break; \r\n case '05': \r\n return 31; \r\n break; \r\n case '06': \r\n return 30; \r\n break; \r\n case '07': \r\n return 31; \r\n break; \r\n case '08': \r\n return 31;\r\n break; \r\n case '09': \r\n return 30;\r\n break; \r\n case '10':\r\n return 31; \r\n break; \r\n case '11': \r\n return 30; \r\n break; \r\n case '12': \r\n return 31; \r\n break; \r\n } \r\n }", "function ultimoConsecutivoEncuesta($centro_poblado) {\r\n $sql = \"SELECT max(enc_consecutivo)as mayor from generador_encuesta where enc_consecutivo LIKE '\" . $centro_poblado . \"%'\";\r\n //echo $sql;\r\n $r = $this->db->ejecutarConsulta($sql);\r\n $w = mysql_fetch_array($r);\r\n if ($w['mayor'] <= 0) {\r\n return ($centro_poblado * 1000);\r\n } else {\r\n return $w['mayor'];\r\n }\r\n }", "public function contaDia()\n\t{\n\t\t$this->diasUteis = 0;\n\t\t\t// cal_days_in_month = (CALENDARIO, MES, ANO);\n\t\t$this->totalDiasMes = cal_days_in_month(CAL_GREGORIAN, $this->mes, $this->ano);\n\t\t\t// Pega todos os dias do mes e ano digitados\n\n\t\t\t// Pega somente os dias uteis (Seg. a Sex.)\n\t\tfor ($this->dia = 1; $this->dia <= $this->totalDiasMes; $this->dia++) {\n\t\t\t$timeStamp = mktime(0, 0, 0, $this->mes, $this->dia, $this->ano);\n\t\t\t$this->diaSemana = date('N', $timeStamp);\n\t\t\tif ($this->diaSemana < 6) $this->diasUteis++;\n\t\t}\n\t\treturn $this->diasUteis;\n\t}", "public function getNuevaFechaMensual($fecha_de_Pago,$dia_pago){\n\t\t\n\t\t/*Esta es la fecha de hoy*/\n\t\t$fecha_actual = $this->getTodayDate();\n\n\t\t/*Esta es la fecha de pago*/\n\t\t$fecha_de_Pago = (date($fecha_de_Pago));\n\n\t\t/*Es el dia que el usuario escogio para cancelar cada mes*/\n\t\t$dia_de_pago = $dia_pago;\n\n\t\t/*esta va hacer la nueva fecha de pago*/\n\t\t$siguiente_nueva_fecha_pago =null;\n\n\t\t/*Desfragmentamos la fecha de hoy*/\n\t\tlist($anio_hoy, $mes_hoy, $dia_hora_hoy) = explode(\"-\",$fecha_actual);\n\t\tlist($dia_hoy,$hora_hoy) = explode(\" \",$dia_hora_hoy);\n\n\n\t\t/*Desfragmentamos la fecha de Pago*/\n\t\tlist($anio_pago, $mes_pago, $diahora_pago) = explode(\"-\",$fecha_de_Pago);\n\t\tlist($dia_pago,$hora_pago) = explode(\" \",$diahora_pago); \n\n\t\t/*Se verificar cual es el mes siguiente*/\n\t\tif($mes_hoy < 12){\n\t\t\t\t\t\n\t\t\t$siguiente_mes = $mes_hoy +1;\n\t\t\t\n\t\t\tif($siguiente_mes < 10){\n\n\t\t\t\t$siguiente_mes = \"0\".$siguiente_mes;\n\t\t\t}\n\t\t\t\n\t\t}else{\n\t\t\t$siguiente_mes = 01;\n\t\t}\n\n\t\t/*metodo que devuelve el ultimo dia del mes y año ingresado*/\n\t\t$last_number_month = (int)$this->getUltimoDiaMes($anio_hoy,$siguiente_mes);\n\n\t\t/* Esta logica es para calcular la fecha unicamente cuando el mes actual es enero */\n\t\tif($dia_de_pago > 28 && $mes_pago == 01 ){\n\t\t\t\n\t\t\t/* Se crea la nueva fecha de pago para el siguiente mes */\n\t\t\t$siguiente_nueva_fecha_pago = $anio_pago.'-'.$siguiente_mes.'-'.$last_number_month.' '.$hora_pago;\n\n\t\t}else{\n\t\t\t\n\t\t\t/* Se valida si el dia de pago de un usuario es mayor al ultimo dia del mes siguiente */\n\t\t\tif($dia_de_pago <= $last_number_month ){\n\n\t\t\t\t/*Se le suma a la fecha de pago actual el numero total de dias del siguiente mes, para obtener la nueva fecha*/\n\t\t\t\t$nuevafecha = strtotime ( '+'.$last_number_month.' day' , strtotime ( $fecha_de_Pago ) ) ;\n\t\t\t\t$nuevafecha = date ( 'Y-m-j H:m:s' , $nuevafecha );\n\n\t\t\t\t/*Desfragmentamos la nueva fecha*/\n\t\t\t\tlist($nuevafecha_anio_pago, $nuevafecha_mes_pago, $nuevafecha_diahora_pago) = explode(\"-\",$nuevafecha);\n\t\t\t\tlist($nuevafecha_dia_pago,$nuevafecha_hora_pago) = explode(\" \",$diahora_pago);\n\n\t\t\t\t/* Se crea la nueva fecha de pago para el siguiente mes */\n\t\t\t\t$siguiente_nueva_fecha_pago = $nuevafecha_anio_pago.'-'.$nuevafecha_mes_pago.'-'.$dia_de_pago.' '.$nuevafecha_hora_pago;\n\n\t\t\t}else{\n\t\t\t\t\n\t\t\t\t/**\n\t\t\t\t * Como el dia de pago es mayor al ultimo dia del mes siguiente se le reste un dia\n\t\t\t\t * a la fecha actual de pago\n\t\t\t\t **/\n\t\t\t\t$nuevafecha = strtotime ( '-1 day' , strtotime ( $fecha_de_Pago ) ) ;\n\t\t\t\t$nuevafecha = date ( 'Y-m-j H:m:s' , $nuevafecha );\n\n\t\t\t\t/**\n\t\t\t\t * ahora que se le ha restado un dia al mes actual, ya se puede sumar un mes\n\t\t\t\t * a la fecha actual de pago\n\t\t\t\t **/\n\t\t\t\t$nuevafecha = strtotime ( '+1 month' , strtotime ( $nuevafecha )) ;\n\t\t\t\t$siguiente_nueva_fecha_pago = date ( 'Y-m-j H:m:s' , $nuevafecha );\n\n\n\t\t\t\t/* Se crea la nueva fecha de pago para el siguiente mes */\n\t\t\t\t$siguiente_nueva_fecha_pago = $anio_pago.'-'.$siguiente_mes.'-'.$last_number_month.' '.$hora_pago;\n\t\t\t}\n\t\t}\n\t\t/*return de la nueva fecha de pago*/\n\t\treturn $siguiente_nueva_fecha_pago;\n\t}", "public function getMesMedicion(){\n // obtener el numero de mediciones realizadas hasta el momento\n $c = new Criteria();\n $c->add(SubactividadProcedimientoPoaEjecucionPeer::SUBACTIVIDAD_POA_ID, $this->getId());\n $medicion = SubactividadProcedimientoPoaEjecucionPeer::doCount($c);\n\n // comprobar que quedan mediciones disponibles\n if (($this->getDuracion()-$medicion) < 1)\n {\n return 0;\n } else {\n return $medicion+1;\n }\n }", "function sumasdiasemana($fecha,$dias)\r\n{\r\n\t$datestart= strtotime($fecha);\r\n\t$diasemana = date('N',$datestart); // es para obtener el dia de la semana ejemplo (Jueves = 4) entonces N = 4\r\n\t\r\n\t$totaldias = $diasemana+$dias;\r\n\t\r\n\t$findesemana = intval( $totaldias/5) *2 ; \r\n\t\r\n\t$diasabado = $totaldias % 5 ; \r\n\tif ($diasabado==6) $findesemana++;\r\n\tif ($diasabado==0) $findesemana=$findesemana-2;\r\n\t\r\n\t$total = (($dias+$findesemana) * 86400)+$datestart ; //multiplicacion 86400 de numero de horas en el a�o \r\n\t\r\n//\treturn $twstart=date('Y-m-d', $total);\r\n\treturn $twstart=date('d-m-Y', $total);\r\n}", "function calculo($inicio, $fin, $bultos) {\n\tglobal $hoy;\n\tif ($fin == '0000-00-00') {\n\t\t$dias = round ( (strtotime ( $hoy ) - strtotime ( $inicio )) / (24 * 60 * 60), 0 );\n\t\t$total = $bultos * $dias * importeAlmacen ();\n\t\t$total = 'En Almacen';\n\t} else {\n\t\t$dias = round ( (strtotime ( $fin ) - strtotime ( $inicio )) / (24 * 60 * 60), 0 );\n\t\t$total = $bultos * $dias * importeAlmacen ();\n\t\t$total = round ( $total, 2 );\n\t\t$total = $total . \"&euro;\";\n\t}\n\treturn $total;\n}", "function inicio_ultima_quinzena()\n{\n $data_atual = getdate();\n\n if ($data_atual['mday'] <= 15)\n {\n $mes = $data_atual['mon'] - 1;\n $ano = $data_atual['year'];\n if ($mes == 0)\n {\n $mes = 12;\n $ano --;\n }\n return date(\"d/m/y\",strtotime($ano . sprintf(\"%02d\", $mes) . \"16\"));\n }\n else\n {\n return date(\"d/m/y\",strtotime($data_atual['year'] .\n sprintf(\"%02d\", $data_atual['mon']) . \"01\"));\n }\n}", "public function estimar_con_tipo(){\n $tareas = Tarea::all();\n $suma = 0;\n $div = 0;\n foreach ($tareas as $tarea) {\n if (strtolower($tarea->estado_tarea->Nombre_estado_tarea) == strtolower('Aprobada')) {\n if ($tarea->Tipo_tarea_id==$this->Tipo_tarea_id) {\n if ($tarea->Fecha_fin != null) {\n $inicio = new Carbon($tarea->Fecha_inicio);\n $fin = new Carbon($tarea->Fecha_fin);\n $suma += ($inicio->diffInMinutes($fin));\n\n $div += 1;\n }\n }\n }\n }\n if ($div != 0) {\n $resul = $suma / $div;\n $resul = $resul / 60;\n $resul = round ( $resul, 0 );\n if ($resul<1) {\n $resul = 1;\n }\n return $resul;\n } else {\n return 5;\n }\n }", "public function getPrazoDiasAttribute()\n {\n return intval(($this->attributes['prazo_minutos'] / 24) / 60);\n }", "function calcular_limite_fecha_prestacion($mes_vig, $ano_vig) {\r\n if ($mes_vig == '12') {\r\n $mes_vig1 = '01';\r\n $ano_vig1 = $ano_vig + 1;\r\n }\r\n if ($mes_vig != '12') {\r\n $mes_vig1 = $mes_vig + 1;\r\n $ano_vig1 = $ano_vig;\r\n if ($mes_vig1 < 10) {\r\n $mes_vig1 = '0' . $mes_vig1;\r\n }\r\n }\r\n return '10/' . $mes_vig1 . '/' . $ano_vig1;\r\n}", "public static function sumarMeses($fecha, $cantMeses){\n $fecha = new \\DateTime($fecha); \n $fecha->add(new \\DateInterval('P'.$cantMeses.'M'));\n return $fecha->format('Y-m-d');\n }", "final public function get_visitas() : int {\n $sql = $this->db->query(\"SELECT cantidad,timer FROM visitas WHERE id='1' LIMIT 1;\");\n $data = $sql->fetch();\n\n # Si ya ha pasado un día, reiniciamos el contador a 0\n if($data['timer'] <= time()) {\n $e = array(\n 'cantidad' => 0,\n 'timer' => time() + (60*60*24)\n );\n $this->db->update('visitas',$e,\"id='1'\");\n\n return 0;\n }\n\n return $data['cantidad'];\n }", "public function getMontoFinanciamiento()\n {\n $montoFinanciamiento = 0;\n foreach($this->fuentes as $fuente)\n {\n $moneda=$fuente->getMoneda();\n $montoFinanciamiento+=($fuente->getMonto()*$moneda->getPrecioBs());\n }\n return $montoFinanciamiento;\n }", "function ultimoDia() {\n $month = date('m');\n $year = date('Y');\n $day = date(\"d\", mktime(0,0,0, $month+1, 0, $year));\n\n return date('Y-m-d', mktime(0,0,0, $month, $day, $year));\n }", "function ultimatum($delta=60000) {\r\n $resultado = ahora();\r\n return date('Y-m-d H:i:s', strtotime($resultado)+$delta);\r\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Registers asset writer, writes to the 'assetic.path_to_web' folder
protected function registerAsseticWriter() { $this->app['assetic.asset_writer'] = $this->app->share(function ($app) { return new CheckedAssetWriter($app['assetic.path_to_web']); }); }
[ "protected function getAsseticWriterService()\n {\n return $this->services['assetic_writer'] = new \\Assetic\\AssetWriter('D:\\\\Git\\\\WellCommerce\\\\design');\n }", "private function assetPublisher() {\n $assetOrigin = $this->getDir().$this->getPathConfig().'/assets';\n if ($this->fs->exists($assetOrigin)) {\n $assetDest = $this->getPublicPath($this->getPathConfig());\n $this->fs->copyDirectory($assetOrigin,$assetDest);\n }\n }", "public function onBeforeWrite() {\n\t\t$this->owner->setField('Filename', 'assets/' . $this->owner->generateFilename());\n\t}", "public function registerAssets()\n {\n }", "abstract protected function registerAssets();", "protected function _getAssetWriter()\n {\n if (!isset($this->_assetWriter)) {\n $this->_assetWriter = new AssetWriter($this->_getConfig('writePath'));\n }\n\n return $this->_assetWriter;\n }", "public function register_assets() {\n\t}", "public function onBeforeWrite()\n {\n $this->owner->setField('Filename', 'assets/' . $this->owner->generateFilename());\n }", "private function injectAssets() : void\n\t{\n\t\t$src = __DIR__ . '/../Assets/injection/media/asset.jext';\n\t\t$dest = $this->workingDirectory . '/media/' .\n\t\t\tComponentHelper::getModifiedName($this->getName(), 'prefix') .\n\t\t\t'/joomla.asset.json';\n\n\t\t$parser = new InjectionParser;\n\t\t$parser->setMeta($this->getMeta($this->getName()));\n\t\t$parser->setType('components_view_assets')\n\t\t\t->src($src)\n\t\t\t->dest($dest)\n\t\t\t->parse();\n\t}", "public function register_assets_handler() {\n\t\t$this->assets_handler->register();\n\t}", "protected function registerAssets() {\n $this->publishAssets();\n $this->registerCssFiles();\n $this->registerJsFiles();\n }", "function mgWriteAsset($id, $name, $data, $path = FRAMEWORK_ASSETS_PATH) {\n\t\t// form path\n\t\t$path = sprintf(\"%s%s/\", $path, $id);\n\t\t// check if path exists\n\t\tif(!is_dir($path)) {@mkdir($path);}\n\t\t// write file\n\t\t@file_put_contents(sprintf(\"%s%s.%s\", $path, $id, $name), $data);\n\t}", "public function publishAssets()\r\n {\r\n $dir = dirname(__FILE__).DIRECTORY_SEPARATOR.'assets';\r\n \r\n $this->baseUrl = Yii::app()->getAssetManager()->publish($dir);\r\n }", "public function addAssets()\r\n {\r\n if (!$this->environment->hasExtension('assets')) {\r\n return;\r\n }\r\n\r\n if ($this->autoInclude) {\r\n $path = $this->environment\r\n ->getExtension('assets')\r\n ->getAssetUrl($this->basePath);\r\n\r\n echo sprintf('<link href=\"%s/css/doc.css\" media=\"all\" rel=\"stylesheet\" type=\"text/css\" />', $path);\r\n echo sprintf('<script src=\"%s/js/external/ajaxupload/ajaxupload.min.js\" type=\"text/javascript\"></script>', $path);\r\n echo sprintf('<script src=\"%s/js/application.js\" type=\"text/javascript\"></script>', $path);\r\n\r\n $this->autoInclude = false;\r\n }\r\n }", "public function publishResourceAssets()\n {\n// $assets = [\n// __DIR__ . '/../../public/plugins/jstree' => public_path('plugins/jstree'),\n// ];\n//\n// $this->publishes($assets, 'motor-media-install');\n }", "protected function registerAssetFinder() : void {\n\t\t$this->app->singleton('basset.finder', function($app) {\n\t\t\treturn new AssetFinder($app['files'], $app['config'], base_path() . '/resources/assets');\n\t\t});\n\t}", "public function registerCustomerAssets()\n {\n $assetsUrl = Yii::app()->assetManager->publish(dirname(__FILE__).'/assets/customer', false, -1, MW_DEBUG);\n Yii::app()->clientScript->registerScriptFile($assetsUrl . '/js/payment-form.js');\n }", "public function addAsset($asset, $path);", "public function setOutputExtension(Asset $asset);" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
adds/removes a statement into/from an index. mode=0 removes the statement from the index; mode=1 adds the statement into the index. returns the statements position.
function _indexOpr(&$statement,$k,$ind,$mode){ // determine position in adequate index switch($ind){ case 1: $s=$statement->getSubject(); $p=$statement->getPredicate(); $o=$statement->getObject(); $pos=$s->getLabel().$p->getLabel().$o->getLabel(); break; case 2: $s=$statement->getSubject(); $p=$statement->getPredicate(); $pos=$s->getLabel().$p->getLabel(); break; case 3: $s=$statement->getSubject(); $o=$statement->getObject(); $pos=$s->getLabel().$o->getLabel(); break; case 4: $s=$statement->getSubject(); $pos=$s->getLabel(); break; case 5: $p=$statement->getPredicate(); $pos=$p->getLabel(); break; case 6: $o=$statement->getObject(); $pos=$o->getLabel(); break; } switch($mode){ // add in Index case 1: if(isset($this->indexArr[$ind][$pos])){ $this->indexArr[$ind][$pos][] = $k; }else{ $this->indexArr[$ind][$pos][0] = $k; } break; // remove from Index case 0: $subject=$statement->getSubject(); $predicate=$statement->getPredicate(); $object=$statement->getObject(); $k=-1; if(!isset($this->indexArr[$ind][$pos])){ return -1; } $num=count($this->indexArr[$ind][$pos]); foreach($this->indexArr[$ind][$pos] as $key => $value){ $t=$this->triples[$value]; if($this->matchStatement($t,$subject,$predicate,$object)){ $k=$value; if($num==1){ unset($this->indexArr[$ind][$pos]); }else{ unset($this->indexArr[$ind][$pos][$key]); } return $k; } } break; } return $k; }
[ "function compileStatementDropIndex(array $statement);", "public function getStatementIndex()\n {\n if (array_key_exists(\"statementIndex\", $this->_propDict)) {\n return $this->_propDict[\"statementIndex\"];\n } else {\n return null;\n }\n }", "private function initiateMethodStatementIndex()\n {\n $mainStatementIndex = $this->getCurrentMainStatementIndex();\n $this->methodStatementIndex[$mainStatementIndex] = 0;\n }", "public abstract function insert_mode($mode);", "public function setSqlMode(array $modes = []);", "public function unsetStatements($index)\n {\n unset($this->statements[$index]);\n }", "public static function setMode($mode = self::SQL_MODE_NONE)\n {\n if (is_int($mode)) {\n static::$MODE = $mode;\n\n return;\n }\n\n static::$MODE = self::SQL_MODE_NONE;\n if ($mode === '') {\n return;\n }\n\n $modes = explode(',', $mode);\n foreach ($modes as $sqlMode) {\n static::$MODE |= self::getModeFromString($sqlMode);\n }\n }", "function setIndex()\n{\n global $listTables;\n global $db_aj2007;\n\n // Add index in adultexperience \n $sqlSelect = \"SELECT * FROM adultexperience ORDER BY ParticipantID, Year DESC\";\n $result = mysql_query($sqlSelect);\n $index = 1;\n $previousPID = \"\";\n\n while($theRow = mysql_fetch_object($result))\n {\n if ($previousPID!=$theRow->ParticipantID || $previousPID==\"\")\n $index=1;\n else\n $index++;\n\n $sqlUpdate = \"UPDATE adultexperience SET OrderIndex=\".$index.\" WHERE ParticipantID='\".addslashes($theRow->ParticipantID).\"' AND Event='\".getValidString($theRow->Event).\"' AND Year='\".$theRow->Year.\"' AND Role='\".getValidString($theRow->Role).\"'\";\n print(\"SQL:\".$sqlUpdate.\"<br><br>\");\n var_dump(mysql_query($sqlUpdate, $db_aj2007));\n $previousPID = $theRow->ParticipantID;\n }\n // Add index in directfamilymember\n $sqlSelect = \"SELECT * from directfamilymember ORDER BY participantid, familymembername\";\n $result = mysql_query($sqlSelect);\n $index = 1;\n $previousPID = \"\";\n\n while($theRow = mysql_fetch_object($result))\n {\n if ($previousPID!=$theRow->ParticipantID || $previousPID==\"\")\n $index=1;\n else\n $index++;\n\n $sqlUpdate = \"UPDATE directfamilymember SET OrderIndex=\".$index.\" WHERE ParticipantID='\".$theRow->ParticipantID.\"' AND FamilyMemberName='\".getValidString($theRow->FamilyMemberName).\"' AND FamilyMemberRelation='\".getValidString($theRow->FamilyMemberRelation).\"'\";\n print(\"SQL:\".$sqlUpdate.\"<br><br>\");\n var_dump(mysql_query($sqlUpdate, $db_aj2007));\n $previousPID = $theRow->ParticipantID;\n }\n \n // Add index in participantregularmedication\n $sqlSelect = \"SELECT * from participantregularmedication ORDER BY participantid, DrugName\";\n $result = mysql_query($sqlSelect);\n $index = 1;\n $previousPID = \"\";\n\n while($theRow = mysql_fetch_object($result))\n {\n if ($previousPID!=$theRow->ParticipantID || $previousPID==\"\")\n $index=1;\n else\n $index++;\n\n $sqlUpdate = \"UPDATE participantregularmedication SET OrderIndex=\".$index.\" WHERE ParticipantID='\".$theRow->ParticipantID.\"' AND DrugName='\".getValidString($theRow->DrugName).\"' AND Dose='\".getValidString($theRow->Dose).\"' AND AdministrationMethod='\".getValidString($theRow->AdministrationMethod).\"'\";\n print(\"SQL:\".$sqlUpdate.\"<br><br>\");\n var_dump(mysql_query($sqlUpdate, $db_aj2007));\n $previousPID = $theRow->ParticipantID;\n }\n}", "public function set_sql_mode($modes = array())\n {\n }", "public function set_sql_mode($modes = array())\n {\n }", "private function parseSimpleStmt(int $mode): array\n {\n $x = $this->parseLhsList();\n\n // REPL対応\n if ($this->curToken->type->getType() === TokenType::T_SEMICOLON\n && $this->peekToken->type->getType() === TokenType::T_EOF) {\n return [$x[0], false];\n }\n\n switch ($this->curToken->type->getType()) {\n case TokenType::T_DEFINE:\n case TokenType::T_ASSIGN:\n case TokenType::T_ADD_ASSIGN:\n case TokenType::T_SUB_ASSIGN:\n case TokenType::T_MUL_ASSIGN:\n case TokenType::T_QUO_ASSIGN:\n case TokenType::T_REM_ASSIGN:\n case TokenType::T_AND_ASSIGN:\n case TokenType::T_OR_ASSIGN:\n case TokenType::T_XOR_ASSIGN:\n case TokenType::T_SHL_ASSIGN:\n case TokenType::T_SHR_ASSIGN:\n case TokenType::T_AND_NOT_ASSIGN:\n // assignment statement, possibly part of a range clause\n // TODO: pos, tok := p.pos, p.tok\n $tok = $this->curToken;\n $this->nextToken();\n /** @var array<ExpressionInterface> $y * */\n $y = [];\n $isRange = false;\n if ($mode == self::RANGE_OK && $this->curToken->type->getType() == TokenType::T_RANGE\n && ($tok->type->getType() == TokenType::T_DEFINE || $tok->type->getType() == TokenType::T_ASSIGN)) {\n // TODO: pos := p.pos\n $this->nextToken();\n // y = []ast.Expr{&ast.UnaryExpr{OpPos: pos, Op: token.RANGE, X: p.parseRhs()}}\n $y[] = new UnaryExpr(new Token(new RangeType(), ''), $this->parseRhs());\n $isRange = true;\n } else {\n $y = $this->parseRhsList();\n }\n $as = new AssignStmt($x, $tok, $y);\n if ($tok->type->getType() == TokenType::T_DEFINE) {\n $this->shortVarDecl($as, $x);\n }\n return [$as, $isRange];\n }\n\n if (count($x) > 1) {\n // errorExpected(x[0].Pos(), \"1 expression\")\n // continue with first expression\n echo 'continue with first expression';\n }\n switch ($this->curToken->type->getType()) {\n case TokenType::T_COLON:\n // labeled statement\n // colon := p.pos\n $this->nextToken();\n // if label, isIdent := x[0].(*ast.Ident); mode == labelOk && isIdent {\n // // Go spec: The scope of a label is the body of the function\n // // in which it is declared and excludes the body of any nested\n // // function.\n // stmt := &ast.LabeledStmt{Label: label, Colon: colon, Stmt: p.parseStmt()}\n // p.declare(stmt, nil, p.labelScope, ast.Lbl, label)\n // return stmt, false\n // }\n // The label declaration typically starts at x[0].Pos(), but the label\n // declaration may be erroneous due to a token after that position (and\n // before the ':'). If SpuriousErrors is not set, the (only) error\n // reported for the line is the illegal label error instead of the token\n // before the ':' that caused the problem. Thus, use the (latest) colon\n // position for error reporting.\n // p.error(colon, \"illegal label declaration\")\n // return &ast.BadStmt{From: x[0].Pos(), To: colon + 1}, false\n throw new BadMethodCallException(\"parseSimpleStmt: not implementation COLON yet.\");\n case TokenType::T_ARROW:\n // send statement\n // arrow := p.pos\n // p.next()\n // y := p.parseRhs()\n // return &ast.SendStmt{Chan: x[0], Arrow: arrow, Value: y}, false\n throw new BadMethodCallException(\"parseSimpleStmt: not implementation ALLOW yet.\");\n case TokenType::T_INC:\n case TokenType::T_DEC:\n // increment or decrement\n // s := &ast.IncDecStmt{X: x[0], TokPos: p.pos, Tok: p.tok}\n // p.next()\n // return s, false\n throw new BadMethodCallException(\"parseSimpleStmt: not implementation INC or DEC yet.\");\n }\n // expression\n $expr = new ExprStmt($x[0]);\n return [$expr, false];\n }", "function array_set_pos(&$array, $to_insert, $pos, $mode = INSERT_AT_INDEX) {\n foreach ((array)$to_insert as $value) {\n $pos_del = array_search($value, $array);\n if ($pos_del !== false)\n unset ($array[$pos_del]);\n }\n\n switch ($mode) {\n case INSERT_BEFORE_VALUE:\n case INSERT_AFTER_VALUE:\n $pos_insert = array_search($pos, $array);\n if ($pos_insert === false)\n return;\n if ($mode == INSERT_AFTER_VALUE)\n $pos_insert++;\n\n array_splice($array, $pos_insert, 0, $to_insert);\n break;\n\n case INSERT_AT_INDEX:\n array_splice($array, $pos, 0, $to_insert);\n break;\n }\n}", "public function getPositionMode();", "public function actSkills($mode){\r\n\t\t$mode = strtoupper($mode);\r\n\t\tswitch($mode){\r\n\t\t\tcase \"I\":\r\n\t\t\t\t$Sql = \"INSERT INTO rs_tbl_skills(\r\n\t\t\t\t\t\t\tskills_id,\r\n\t\t\t\t\t\t\tposotion_id,\r\n\t\t\t\t\t\t\tskill_name,\r\n\t\t\t\t\t\t\tis_active)\r\n\t\t\t\t\t\tVALUES(\";\r\n\t\t\t\t$Sql .= $this->isPropertySet(\"skills_id\", \"V\") ? $this->getProperty(\"skills_id\") : \"NULL\";\r\n\t\t\t\t$Sql .= \",\";\r\n\t\t\t\t$Sql .= $this->isPropertySet(\"posotion_id\", \"V\") ? \"'\" . $this->getProperty(\"posotion_id\") . \"'\" : \"NULL\";\r\n\t\t\t\t$Sql .= \",\";\r\n\t\t\t\t$Sql .= $this->isPropertySet(\"skill_name\", \"V\") ? \"'\" . $this->getProperty(\"skill_name\") . \"'\" : \"NULL\";\r\n\t\t\t\t$Sql .= \",\";\r\n\t\t\t\t$Sql .= $this->isPropertySet(\"is_active\", \"V\") ? \"'\" . $this->getProperty(\"is_active\") . \"'\" : \"NULL\";\r\n\t\t\t\t$Sql .= \")\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"U\":\r\n\t\t\t\t$Sql = \"UPDATE rs_tbl_skills SET \";\r\n\t\t\t\t\r\n\t\t\t\tif($this->isPropertySet(\"skill_name\", \"K\")){\r\n\t\t\t\t\t$Sql .= \"$cat skill_name='\" . $this->getProperty(\"skill_name\") . \"'\";\r\n\t\t\t\t\t$cat = \",\";\r\n\t\t\t\t}\t\t\t\r\n\t\t\t\tif($this->isPropertySet(\"posotion_id\", \"K\")){\r\n\t\t\t\t\t$Sql .= \"$cat posotion_id='\" . $this->getProperty(\"posotion_id\") . \"'\";\r\n\t\t\t\t\t$cat = \",\";\r\n\t\t\t\t}\r\n\t\t\t\tif($this->isPropertySet(\"is_active\", \"K\")){\r\n\t\t\t\t\t$Sql .= \"$cat is_active='\" . $this->getProperty(\"is_active\") . \"'\";\r\n\t\t\t\t\t$cat = \",\";\r\n\t\t\t\t}\r\n\t\t\t\t$Sql .= \" WHERE 1=1\";\r\n\t\t\t\t$Sql .= \" AND skills_id=\" . $this->getProperty(\"skills_id\");\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"D\":\r\n\t\t\t\t$Sql = \"DELETE FROM rs_tbl_skills \r\n\t\t\t\t\t\t WHERE 1=1\";\r\n\t\t\t\tif($this->isPropertySet(\"skills_id\", \"K\")){\r\n\t\t\t\t\t$Sql .= \" AND skills_id=\" . $this->getProperty(\"skills_id\");\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t\treturn $this->dbQuery($Sql);\r\n\t}", "private function tools_deleted_category($mode)\n {\n $returned = array(-1,0,'');\n\n if($mode=='analyse')\n {\n $sql=\"SELECT count(id) as NbRecord, category_id \";\n $sql.=\" FROM \".HISTORY_TABLE;\n $sql.=\" WHERE \".HISTORY_TABLE.\".category_id NOT IN (SELECT id FROM \".CATEGORIES_TABLE.\") and category_id > 0\";\n $sql.=\" GROUP BY category_id ORDER BY NbRecord\";\n $result=pwg_query($sql);\n\n if($result)\n {\n $returned[0]=0;\n $returned[1]=0;\n $returned[2]=[];\n while ($row = pwg_db_fetch_row($result))\n {\n $returned[2][$returned[0]][0] = $row[0];\n $returned[2][$returned[0]][1] = $row[1];\n $returned[0]++;\n $returned[1]+=$row[0];\n }\n\n }\n }\n elseif($mode=='to0')\n {\n $sql=\"UPDATE \".HISTORY_TABLE.\"\n SET category_id = NULL, section = 'deleted_cat'\n WHERE \".HISTORY_TABLE.\".category_id > 0\n AND \".HISTORY_TABLE.\".category_id NOT IN (SELECT id FROM \".CATEGORIES_TABLE.\")\";\n $result=pwg_query($sql);\n\n if($result)\n {\n $returned[0]=1;\n }\n }\n return($returned);\n }", "public function mode_delete (){\n\n if( $this->acl and !$this->kernel->acl_can_delete() ){\n $this->kernel->templ->assign(\"result_message\", \"no_access\");\n return;\n }\n\n if( !$this->record_in_use() ){\n $this->kernel->templ->assign(\"result_message\", \"record_deleted\" );\n $this->remove();\n } else\n $this->kernel->templ->assign(\"result_message\", \"record_in_use\" );\n\n $this->mode_list();\n\n }", "function appendCreateFulltextIndex(array &$statements, $table, $name, array $def)\n {\n $statements[] = \"CREATE FULLTEXT INDEX $name ON $table \" . $this->buildIndexList($def);\n }", "public function trackMode($mode) \n {\n if($mode == 2) {\n $this->anchorTags = false;\n }\n }", "public function storeSortMode($mode)\n\t{\n\t\t$mode = strtolower($mode);\n\t\tif($mode !== self::SORT_MODE_ORDINARY && $mode !== self::SORT_MODE_MIX)\n\t\t{\n\t\t\t$mode = self::SORT_MODE_ORDINARY;\n\t\t}\n\n\t\t\\CUserOptions::setOption(Driver::INTERNAL_MODULE_ID, 'grid', array(\n\t\t\t'sortMode' => $mode,\n\t\t\t'viewMode' => $this->getViewMode(),\n\t\t));\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Finds the Area model based on its primary key value. If the model is not found, a 404 HTTP exception will be thrown.
protected function findArea($id) { if (($model = Area::findOne($id)) !== null) { return $model; } else { throw new NotFoundHttpException('The requested page does not exist.'); } }
[ "public function findModel($id)\n {\n if (($model = Area::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 {\n if (($model = Area::findOne($id)) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException(Yii::t('backend', 'The requested page does not exist.'));\n }", "protected function findModel($id)\n {\n if (($model = Area::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 {\n if (($model = CdekArea::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 = ManagementArea::findOne($id)) !== null) {\r\n return $model;\r\n } else {\r\n throw new NotFoundHttpException('The requested page does not exist.');\r\n }\r\n }", "public function getById($area_id)\n {\n return Area::find($area_id);\n }", "public function getByIdOrDefault(string $id): AreaContract;", "public function getBySlug($area_slug)\n {\n return Area::where('slug', $area_slug)->first();\n }", "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 = SedesAreasEnsenanza::findOne($id)) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException('The requested page does not exist.');\n }", "public function find($uid) {\n\t\ttry {\n\t\t\t$model = $this->map->get($uid);\n\t\t} catch (tx_oelib_Exception_NotFound $exception) {\n\t\t\t$model = $this->createGhost($uid);\n\t\t}\n\n\t\treturn $model;\n\t}", "protected function findModel($id)\n {\n if (($model = Tareas::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 {\n if (($model = Map::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 {\n if (($model = Menu::findOne([ 'id' => $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 if (($model = Config::findOne($id)) !== null) {\n return $model;\n } else {\n throw new HttpException(404);\n }\n }", "public function find(int $id)\n {\n $area = $this->areas->find($id);\n\n if ($area === null)\n {\n throw new ServiceAreaNotFound(trans('messages.serviceAreaNotFound', ['id' => $id]));\n }\n\n return $area;\n }", "protected function findModel(array $pk) {\n /** @var ActiveRecord $class */\n $class = $this->getModelClass();\n if (($model = $class::findOne($pk)) !== null) {\n return $model;\n }\n\n $error = \\Yii::t('yii', 'The requested page does not exist.');\n Yii::$app->session->addFlash('error', $error );\n\n return null;\n }", "protected function findModel($id)\n {\n if (($model = Locations::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "public function find(mixed $primaryKey): ?ModelInterface;" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
add exception Delete a link between a away team and a match (sever the link isAwayTeam from Match to Team).
public function deleteTeamAwayTeamMatch($team, $match);
[ "public function delete_gamelink()\n\t\t{\n\t\t\treturn null;\n\t\t}", "public function testLeadsDelete()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "public function delete() {\n // Get all the contestant relations\n $crelations = tourney_relation_query('tourney_match', $this->id)->entityCondition('bundle', 'contestant');\n $crids = $crelations->execute();\n foreach (array_keys($crids) as $rid) {\n relation_delete($rid);\n }\n\n // Get all the game relations and games\n $gquery = tourney_relation_query('tourney_match', $this->id)->entityCondition('bundle', 'has_game');\n $game_relations = $gquery->execute();\n\n // Delete the games in this match\n foreach (array_keys($game_relations) as $rid) {\n $relation = relation_load($rid);\n relation_delete($rid);\n $game = tourney_game_load($relation->endpoints['und'][1]['entity_id']);\n if (is_object($game)) {\n $game->delete();\n }\n else {\n drupal_set_message(t('Could not delete game entity %id. Does not exist', array(\n '%id' => $relation->endpoints['und'][1]['entity_id'],\n )), 'warning');\n }\n }\n\n parent::delete();\n }", "function teamdelete(){\n $this->auth(COMP_ADM_LEVEL);\n $team_id = $this->uri->segment(3);\n $contest_id = urldecode($this->uri->segment(4));\n $this->m_key->removeTeam($team_id);\n $this->m_team->delete($team_id, $contest_id);\n $this->teams($contest_id);\n }", "function deleteAthleteFromTeam() {\n global $connection_production;\n if (isset($_POST['delete_team_association'])) {\n if (!!$_POST['query_team_id']) {\n $profile_franchise_sm_id = $_POST['profile_franchise_sm_id'];\n $post_profile_id_set = $_POST['profile_id_set'];\n $delete_team_id = $_POST['query_team_id'];\n\n $sql_team_video = \"SELECT DISTINCT video.id AS video_id, profile_franchise_sm_video_sm.id AS profile_franchise_sm_video_sm_id FROM video\n \tLEFT JOIN profile_franchise_sm_video_sm ON video.id=profile_franchise_sm_video_sm.videoId\n \tLEFT JOIN profile_franchise_sm ON profile_franchise_sm_video_sm.profileFranchiseSmId=profile_franchise_sm.id\n \tLEFT JOIN profile ON profile_franchise_sm.profileId=profile.id\n \tLEFT JOIN franchise ON franchise.id=profile_franchise_sm.franchiseId\n \tLEFT JOIN franchise_team_sm ON franchise_team_sm.franchiseId=franchise.id\n \tLEFT JOIN team ON team.id=franchise_team_sm.teamId\n \tWHERE team.id=? AND profile.id=?\";\n $stmt = $connection_production->prepare($sql_team_video);\n $stmt->bind_param(\"ii\", $delete_team_id, $post_profile_id_set);\n $stmt->execute();\n $result = $stmt->get_result();\n if ($result->num_rows > 0) {\n while ($row_delete_video = $result->fetch_assoc()) {\n $video_id = $row_delete_video[\"video_id\"];\n $profile_franchise_sm_video_sm_id = $row_delete_video[\"profile_franchise_sm_video_sm_id\"];\n\n if (!!$profile_franchise_sm_video_sm_id && ($profile_franchise_sm_video_sm_id != NULL)) {\n $stmt2 = $connection_production->prepare(\"delete from `profile_franchise_sm_video_sm` WHERE id = ?\");\n $stmt2->bind_param(\"i\", $profile_franchise_sm_video_sm_id);\n $stmt2->execute();\n $stmt2->close();\n }\n // if (!!$video_id && ($video_id != NULL)) {\n // $stmt2 = $connection_production->prepare(\"delete from `video` WHERE id = ?\");\n // $stmt2->bind_param(\"i\", $video_id);\n // $stmt2->execute();\n // $stmt2->close();\n // }\n if ((!!$profile_franchise_sm_video_sm_id && ($profile_franchise_sm_video_sm_id != NULL))\n\t\t\t\t\t\t\t|| (!!$video_id && ($video_id != NULL))) {\n\n $update_string = 'profile: '.$_POST['profile_id_set'].' deleted team - video id: '.$video_id.', from team id: '.$delete_team_id.', deleted profile franchse video join table id: '.$profile_franchise_sm_video_sm_id;\n insertChange($_SESSION['account_id'], 'profile', 'delete team - video', $post_profile_id_set, $update_string);\n }\n }\n }\n\n $sql_team_period = \"SELECT DISTINCT profile_franchise_sm.id AS profile_franchise_sm_id,\n\t\t\t\t\tprofile_franchise_sm_period_sm.id AS profile_franchise_sm_period_sm_id, period.id AS period_id\n \tFROM profile LEFT JOIN profile_franchise_sm ON profile_franchise_sm.profileId=profile.id\n \tLEFT JOIN franchise ON franchise.id=profile_franchise_sm.franchiseId\n \tLEFT JOIN franchise_team_sm ON franchise_team_sm.franchiseId=franchise.id\n \tLEFT JOIN team ON team.id=franchise_team_sm.teamId\n \tLEFT JOIN profile_franchise_sm_period_sm ON profile_franchise_sm_period_sm.profileFranchiseSmId=profile_franchise_sm.id\n \tLEFT JOIN period ON period.id=profile_franchise_sm_period_sm.periodId\n \tWHERE team.id=? AND profile.id=?\";\n $stmt = $connection_production->prepare($sql_team_period);\n $stmt->bind_param(\"ii\", $delete_team_id, $post_profile_id_set);\n $stmt->execute();\n $result = $stmt->get_result();\n if ($result->num_rows > 0) {\n while ($row_delete_team_period = $result->fetch_assoc()) {\n\n $delete_profile_franchise_sm_period_sm_id = $row_delete_team_period[\"profile_franchise_sm_period_sm_id\"];\n $delete_period_id = $row_delete_team_period[\"period_id\"];\n\n if (!!$delete_profile_franchise_sm_period_sm_id && ($delete_profile_franchise_sm_period_sm_id != NULL)) {\n $stmt_delete_p_f_sm_a_r_sm = \"DELETE FROM profile_franchise_sm_period_sm WHERE id=?\";\n $stmt_delete_p_f_sm_a_r_sm = $connection_production->prepare($stmt_delete_p_f_sm_a_r_sm);\n $stmt_delete_p_f_sm_a_r_sm->bind_param(\"i\", $delete_profile_franchise_sm_period_sm_id);\n $stmt_delete_p_f_sm_a_r_sm->execute();\n $stmt_delete_p_f_sm_a_r_sm->close();\n }\n if (!!$delete_period_id && ($delete_period_id != NULL)) {\n $stmt_delete_period = \"DELETE FROM period WHERE id=?\";\n $stmt_delete_period = $connection_production->prepare($stmt_delete_period);\n $stmt_delete_period->bind_param(\"i\", $delete_period_id);\n $stmt_delete_period->execute();\n $stmt_delete_period->close();\n }\n if ((!!$delete_profile_franchise_sm_period_sm_id && ($delete_profile_franchise_sm_period_sm_id != NULL))\n\t\t\t\t\t\t\t|| (!!$delete_period_id && ($delete_period_id != NULL))) {\n\n $update_string = 'profile: '.$_POST['profile_id_set'].' deleted team - period id: '.$delete_period_id.', from team id: '.$delete_team_id.', deleted profile franchse activity period join table id: '.$delete_profile_franchise_sm_period_sm_id;\n insertChange($_SESSION['account_id'], 'profile', 'delete team - period', $_POST['profile_id_set'], $update_string);\n }\n }\n }\n\n $sql_team_role = \"SELECT DISTINCT activity_role.role AS role_name, profile_franchise_sm_activity_role_sm.id AS p_f_sm_a_r_sm_id\n FROM activity_role\n LEFT JOIN profile_franchise_sm_activity_role_sm ON profile_franchise_sm_activity_role_sm.activityRoleId=activity_role.id\n LEFT JOIN profile_franchise_sm ON profile_franchise_sm.id=profile_franchise_sm_activity_role_sm.profileFranchiseSmId\n LEFT JOIN profile ON profile.id=profile_franchise_sm.profileId\n LEFT JOIN franchise ON franchise.id=profile_franchise_sm.franchiseId\n LEFT JOIN franchise_team_sm ON franchise_team_sm.franchiseId=franchise.id\n LEFT JOIN team ON team.id=franchise_team_sm.teamId\n WHERE team.id=? AND profile.id=?\";\n $stmt = $connection_production->prepare($sql_team_role);\n $stmt->bind_param(\"ii\", $delete_team_id, $post_profile_id_set);\n $stmt->execute();\n $result = $stmt->get_result();\n if ($result->num_rows > 0) {\n while ($row_delete_team_role = $result->fetch_assoc()) {\n $p_f_sm_a_r_sm_id = $row_delete_team_role[\"p_f_sm_a_r_sm_id\"];\n $role_name = $row_delete_team_role[\"role_name\"];\n\n if (!!$p_f_sm_a_r_sm_id && $p_f_sm_a_r_sm_id != NULL) {\n $sql_delete_p_f_sm_a_r_sm = \"DELETE FROM profile_franchise_sm_activity_role_sm WHERE id=?\";\n $stmt_delete_p_f_sm_a_r_sm = $connection_production->prepare($sql_delete_p_f_sm_a_r_sm);\n $stmt_delete_p_f_sm_a_r_sm->bind_param(\"i\", $p_f_sm_a_r_sm_id);\n $stmt_delete_p_f_sm_a_r_sm->execute();\n $stmt_delete_p_f_sm_a_r_sm->close();\n\n $update_string = 'profile: '.$_POST['profile_id_set'].' deleted team - role : '. $role_name.', from team id: '.$delete_team_id.', deleted profile franchse activity role join table id: '.$p_f_sm_a_r_sm_id;\n insertChange($_SESSION['account_id'], 'profile', 'delete team - role', $post_profile_id_set, $update_string);\n }\n }\n }\n $sql_delete_p_f_sm = \"DELETE FROM profile_franchise_sm WHERE id=?\";\n $stmt_delete_p_f_sm = $connection_production->prepare($sql_delete_p_f_sm);\n $stmt_delete_p_f_sm->bind_param(\"i\", $profile_franchise_sm_id);\n $stmt_delete_p_f_sm->execute();\n $stmt_delete_p_f_sm->close();\n\n $update_string = 'profile: '.$_POST['profile_id_set'].' deleted profile team association : '.$profile_franchise_sm_id.', from team id: '.$delete_team_id;\n insertChange($_SESSION['account_id'], 'profile', 'delete team association', $post_profile_id_set, $update_string);\n header(\"location: categories.php?source=profile_update_athlete&profile_id=\".$_POST['profile_id_set'].\"#teams\");\n } else {\n echo \"<h3 style='color:red;'>something went wrong with deleting activity</h3>\";\n }\n }\n }", "public function createTeamAwayTeamMatch($team, $match);", "function delete_match_has_team($idmatch_has_team)\n {\n return $this->db->delete('match_has_team',array('idmatch_has_team'=>$idmatch_has_team));\n }", "public function deleteTeam($team)\n {\n // see if there are any associated matches first\n $homeMatches = $this->objectLayer->restoreTeamHomeTeamMatch($team, null);\n $awayMatches = $this->objectLayer->restoreTeamAwayTeamMatch($team, null);\n if ($homeMatches->size() > 0 or $awayMatches->size() > 0) {\n throw new RDException('Delete failure: There are matches associated with this team.');\n }\n\n\n // see if the team is a winner\n /*$winners = $this->objectLayer->restoreTeamWinnerOfLeague($team, null);\n die(var_dump($winners));\n if ($winners != null) {\n throw new RDException('Delete failure: This team is a winner of a league. We need to keep a record.');\n }*/\n\n // // see if the team is a winner\n // $winners = $this->objectLayer->restoreTeamWinnerOfLeague($team, null);\n // if ($winners->size() > 0) {\n // throw new RDException('Delete failure: This team is a winner of a league. We need to keep a record.');\n // }\n\n // delete league assoication\n $league = $this->objectLayer->restoreTeamParticipatesInLeague($team, null)->current();\n if ($league) {\n $this->objectLayer->deleteTeamParticipatesInLeague($team, $league);\n }\n\n // delete capatain association\n $capatain = $this->objectLayer->restoreStudentCaptainOfTeam(null, $team)->current();\n if ($capatain) {\n $this->objectLayer->deleteStudentCaptainOfTeam($capatain, $team);\n }\n\n // delete student association --- a lot of students\n $students = $this->objectLayer->restoreStudentMemberOfTeam(null, $team);\n while ($students->current()) {\n $student = $students->current();\n $this->objectLayer->deleteStudentMemberOfTeam($student, $team);\n $students->next();\n }\n\n $this->objectLayer->deleteTeam($team);\n }", "public function storeTeamAwayTeamMatch( $team, $match);", "public function deleteTeamWinnerOfLeague( $team, $league );", "public function testDeleteEventLink() {\n\t\t\t// first, verify mySQL connected OK\n\t\t\t$this->assertNotNull($this->mysqli);\n\n\t\t\t// second, create an eventLink to post to mySQL\n\t\t\t$this->eventLink = new EventLink($this->eventCategory->getEventCategoryId(), $this->event->getEventId());\n\n\t\t\t// third, insert the eventLik to mySQL\n\t\t\t$this->eventLink->insert($this->mysqli);\n\n\t\t\t// fourth, verify the eventLink was inserted\n\t\t\t$this->assertNotNull($this->eventCategory->getEventCategoryId());\n\t\t\t$this->assertTrue($this->eventCategory->getEventCategoryId() > 0);\n\t\t\t$this->assertNotNull($this->event->getEventId());\n\t\t\t$this->assertTrue($this->event->getEventId() > 0);\n\n\t\t\t// fifth, delete the eventLink\n\t\t\t$this->eventLink->delete($this->mysqli);\n\t\t\t$this->eventLink = null;\n\n\t\t\t// finally, try to get the eventLink and assert we didn't get a thing\n\t\t\t$hopefulEventLink = EventLink::getEventLinkByEventCategoryIdAndEventId($this->mysqli, $this->eventCategory->getEventCategoryId(), $this->event->getEventId());\n\n\t\t\t$this->assertNull($hopefulEventLink);\n\t\t}", "function delete_link($data)\n {\n \tif( ($link_id = $this->get_link_id($data['name'])) === NULL )\n \t\treturn;\n\n\t\tif( wp_delete_link($link_id) === false )\n\t\t{\n \t\t\t$this->log['error'][] = \"An error occured while deleting the link: \".$link['name'];\n }\n else\n {\n \t$this->imported++;\n }\n }", "public function deleteMatch($match );", "function delete(){\n throw new Exception(\"Deleting a couple isn't allowed for this project.\");\n }", "public function deleted(MatchInvitation $matchInvitation)\n {\n \n }", "function deleteLeague();", "function wpsyslog_delete_link($arg='null', $arg2='null') {\n\tglobal $wpsyslogHaveTriggered, $wpsyslogDoTrigger;\n\tif ('true' === $wpsyslogDoTrigger['delete_link']) {\n\t\twpsyslog('core', sprintf( __('Blogroll link deleted. Id: #%s.', 'wpsyslog'), $arg ), 1);\n\t\t$wpsyslogHaveTriggered['delete_link'] = true;\n\t}\n}", "public function deleteMatch($match)\n {\n $mgmt = new MatchManager($this->db, $this->objLayer);\n $mgmt->delete($match);\n }", "function delete_negative_linktimes($start_time, $end_time) {\n echo \"Deleting negative linktimes...\";\n $sql = \"DELETE FROM batch_journey_all \"\n \t .\"WHERE (uniqueid, stopid) IN \"\n\t .\"(SELECT uniqueid, destination.stopid AS end \"\n\t .\"FROM batch_journey_all AS source JOIN batch_journey_all AS destination USING(uniqueid), \"\n\t .\"(SELECT DISTINCT a.stopid as x, b.stopid as y \"\n\t .\"FROM (route_reference NATURAL JOIN stop_reference) AS a JOIN \"\n\t .\"(route_reference NATURAL JOIN stop_reference) AS b \"\n\t .\"ON a.linename = b.linename \"\n\t .\"AND a.directionid = b.directionid \"\n\t .\"AND (b.stopnumber - a.stopnumber) = 1) as connected_stops \"\n\t .\"WHERE source.estimatedtime BETWEEN $start_time AND $end_time \"\n\t .\"AND x = source.stopid \"\n\t .\"AND y = destination.stopid \"\n\t .\"AND EXTRACT(EPOCH FROM AGE(destination.estimatedtime, source.estimatedtime)) < 0)\";\n\n $this->database->execute_sql($sql);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
returns a random wall from the walls array
function getRandomWall(){ $randIndex = rand(0, count($this->Walls)-1); return array($this->Walls[$randIndex], $randIndex); }
[ "protected function randTile() {\n $array_rand = array_rand($this->tilestack, 1);\n $return = $this->tilestack[$array_rand];\n unset($this->tilestack[$array_rand]);\n return $return;\n }", "public function getRandomBee() : Bee\r\n {\r\n $beeIndex = rand(0, count($this->bees) - 1);\r\n return $this->bees[$beeIndex];\r\n }", "public function getWall()\n {\n return $this->wall;\n }", "protected function buildRandom()\n {\n $emptyCells = $this->_map->getValidBuildCells();\n if (!count($emptyCells))\n {\n return [null, null, null];\n }\n \n $cell = $emptyCells[rand(0,count($emptyCells)-1)];\n $building = rand(0,2);\n \n return [$cell->x,$cell->y,$building];\n }", "private function generate() {\n $return = array();\n foreach ($this->settings as $key => $tile) {\n $temp = array(\n 'type' => $tile['type'],\n 'tile' => $tile['type'],\n );\n switch ($tile['type']) {\n case \"port\":\n $temp['tile'] = $this->randPort();\n $rand_direction = array_rand($tile['diropt']);\n $temp['dir'] = $tile['diropt'][$rand_direction];\n break;\n case 'sea':\n $temp['dir'] = rand(1, 6);\n break;\n case 'tile':\n $temp['tile'] = $this->randTile();\n if ($temp['tile'] != 'desert') {\n $temp['fiche_dir'] = rand(1, 4);\n $temp['fiche'] = $this->randFiche($key);\n }\n $temp['dir'] = rand(0, 5);\n break;\n }\n $this->board[$key] = $temp;\n }\n\n // All fiches and tiles are ready.\n // Now let's check if all red are on the right spot!\n foreach ($this->board as $key => $tile) {\n if ($tile['type'] == 'tile' && $tile['tile'] != 'desert' && $this->isRed($tile['fiche'])) {\n if ($this->neighboursAreRed($key)) {\n $tileKey = $this->findNotRedNeighbours($key);\n $tempTile = $this->board[$key];\n $this->board[$key] = $this->board[$tileKey];\n $this->board[$tileKey] = $tempTile;\n }\n }\n }\n }", "function randomImage ( $array ) {\n\n $total = count($array);\n\n $call = rand(0,$total-1);\n\n return $array[$call];\n\n}", "public function generateRandomShape();", "public function get_random_activity(){\n $arrayElem = array_rand($this->postIDArray);\n $randomActivityID = $this->postIDArray[$arrayElem];\n $this->randomPost = get_post( $randomActivityID );\n }", "function findPlaceOnBoard(&$board, $shipSize) {\r\n $orientation = rand(0,1);\r\n\t\t\r\n $maxStartCoord = (count($board[0]) - $shipSize);\r\n\t\t\r\n if ($orientation == 0) {\r\n // Horizontal\r\n $startX = rand(0,$maxStartCoord);\r\n $startY = rand(0,count($board) - 1);\r\n }\r\n else {\r\n // Vertical\r\n $startX = rand(0,count($board[0]) - 1);\r\n $startY = rand(0,$maxStartCoord);\r\n }\r\n\t\t\r\n return array(\"start_x\" => $startX, \"start_y\" => $startY, \"orientation\" => $orientation);\r\n}", "private function randomEmptyRoom() {\n while(true) {\n $ndx = rand(1, count($this->rooms));\n $room = $this->getRoom($ndx);\n if($room->isEmpty()) {\n return $room;\n }\n }\n }", "public function getExcellentFirstMove()\n {\n return array_random(Board::corners());\n }", "function random_story_from_db() {\n\t\n\t$story_db = stories_db_combined();\n\t\n\t$numberofstories = count($story_db);\n\t\n\t$random_number = rand(0,$numberofstories);\n\t\n\t$random_story = array();\n\t\n\t$random_story = $story_db[$random_number];\n\t\n\treturn $random_story;\n\n\n}", "function findRandomEdge($flock_id, $first = null, $last = null)\n {\n $loops = $this->db->query_all('select sheep_id from sheep where flock_id=? and first=last and state!=? and state!=?',\n array($flock_id, 'archive', 'expunge'));\n $found = false;\n for ($i = 0; $i < 20 && !$found; $i++) {\n $sheep[0] = $first === null ? (int)$loops[rand(0, count($loops) - 1)]['sheep_id'] : $first;\n $sheep[1] = $last === null ? (int)$loops[rand(0, count($loops) - 1)]['sheep_id'] : $last;\n if ($sheep[0] != $sheep[1]) {\n $result = $this->db->query_init('select sheep_id from sheep where flock_id=? and first=? and last=?',\n array($flock_id, $sheep[0], $sheep[1]));\n if ($result === false) {\n $found = true;\n }\n }\n }\n\n if ($found) {\n return $sheep;\n }\n\n return false;\n }", "protected function getRandMember(array &$array)\n {\n return $array[array_rand($array)];\n }", "function _getReactionVideoRandom($array){\n\t\t//pick random item from array\n\t\t$name = $array[rand(0, count($array)-1)];\n\t\treturn $this->_getReactionVideoByName($name);\n\t}", "public function getRandomShapes() {\n\t\t$shapes = $this->shapes->toArray();\n\t\tshuffle($shapes);\n\n\t\treturn $shapes;\n\n\t}", "public static function getRandomMove()\n {\n return array_rand(Game::$moves);\n }", "function getRandomShow(){\n global $shows;\n return array_rand($shows, 1);\n}", "public function getWalls(){\n\t\treturn $this->get(\"/wall\");\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Convert targets array to string for using in the YQL query.
protected static function targetsToString($targets, $prefix = '', $suffix = '') { $array = []; foreach ($targets as $currency) { $array[] = '"' . $prefix . $currency . $suffix . '"'; } return implode(', ', $array); }
[ "private function targetsToString(): string\n {\n return \\implode(' ', $this->targets);\n }", "protected static function parseTargets( $targets ) {\n\t\t$lines = array();\n\t\tforeach ( $targets as $target ) {\n\t\t\tif ( array_key_exists( 'site', $target ) ) {\n\t\t\t\t$lines[] = $target['title'] . '@' . $target['site'];\n\t\t\t} else {\n\t\t\t\t$lines[] = $target['title'];\n\t\t\t}\n\t\t}\n\t\treturn implode( \"\\n\", $lines );\n\t}", "protected function getLabelsFromTarget(array $labels): array\n {\n if (!empty($labels)) {\n foreach ($labels as $key => $label) {\n $labels[$key] = $label[0]['target'];\n }\n }\n\n return $labels;\n }", "function _penton_custom_dfp_get_query_targetings($names, &$tag) {\n foreach ($names as $name) {\n $value = filter_input(INPUT_GET, $name);\n if (!empty($value)) {\n $value = explode(',', $value);\n $value = array_shift($value);\n $tag->targeting[] = array(\n 'target' => $name,\n 'value' => penton_custom_dfp_remove_unwanted_chars($value, 'targeting'),\n );\n }\n }\n}", "public function GetTargets()\n {\n $Q = $this->DB->GET('MUP.domains.targets', ['active' => '1','mailing' => '1'], '*', 10000);\n foreach ($Q as $i => $q) {\n $this->TDOMS[$q['domain']] = $q['target'];\n $this->TGETS[$q['target']] = $q['target'];\n }\n $this->ALERTS[] = \" ~ Targets: (\".GRN.count($Q).WHT.\")\";\n }", "public function setTestTargets($var)\n {\n $arr = GPBUtil::checkRepeatedField($var, \\Google\\Protobuf\\Internal\\GPBType::STRING);\n $this->test_targets = $arr;\n\n return $this;\n }", "public function translate($target)\n {\n if (is_string($target)) {\n return $this->translator->trans($target);\n }\n\n if (is_array($target)) {\n foreach ($target as &$value) {\n if (is_string($value) && $this->translator->has($value)) {\n if (is_string($translated = $this->translator->trans($value))) {\n $value = $translated;\n }\n } elseif (is_array($value)) {\n $value = $this->translate($value);\n }\n }\n }\n\n return $target;\n }", "public function getTargetNames()\n {\n return array_keys($this->targets);\n }", "function parse_targets($targets) {\r\n $targets_list = array();\r\n if (strlen(trim($targets)) == 0) return $targets_list;\r\n $units = explode('=', $targets);\r\n foreach ($units as $unit) {\r\n if (strlen(trim($unit) ) == 0) throw new Exception('\"\"');\r\n $parsed_unit = $this->parse_unit($unit);\r\n if ($parsed_unit === null) throw new Exception('\"'.$unit.'\"');\r\n $targets_list[] = $parsed_unit;\r\n }\r\n return $targets_list;\r\n }", "public function getTargets() {\n\t\tforeach($this->__payload['targets'] as $key => $data) {\n\t\t\t$getMethod = \"get$key\";\n\t\t\treturn $this->__api->$getMethod($data);\n\t\t}\n\t}", "public function targets () {\n\t\tif ($this->targets !== null) {\n\t\t\treturn $this->targets;\n\t\t}\n\n\t\tif (preg_match_all ('/--- ?(.*) ?: ?(.*) ?---/', $this->doc, $regs)) {\n\t\t\t$this->targets = array ();\n\t\t\tfor ($i = 0; $i < count ($regs[1]); $i++) {\n\t\t\t\tif (! isset ($this->targets[$regs[1][$i]])) {\n\t\t\t\t\t$this->targets[$regs[1][$i]] = array ($regs[2][$i]);\n\t\t\t\t} else {\n\t\t\t\t\t$this->targets[$regs[1][$i]][] = $regs[2][$i];\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t$this->targets = array ();\n\t\t}\n\t\treturn $this->targets;\n\t}", "private function keywords_as_string() {\n\t\treturn trim( implode( ', ', $this->keywords ), ', ' );\n\t}", "protected function to_string($arr){\n\t\t\t\n\t\t}", "protected function parseTargetsToArray(Target $target){\n\t$targetArr = array(\n\t 'name'\t =>\t$target->getName(),\n\t 'description' =>\t$target->getDescription(),\n\t 'isHidden'\t =>\t$target->isHidden()\n\t \n\t // NOTE: Its possible to add more information here,\n\t // should it be needed\n\t\t\n\t);\n\t\n\treturn $targetArr;\n }", "public function getEmptyTargets() {\n\t\t$targets = array();\n\t\t\t\t\n\t\t$languages = $this->getLanguages();\n\t\t\n\t\t$query = $this->db->query(\"SELECT c.category_id, ut.language_id, ut.sort_order, ut.keyword FROM \" . DB_PREFIX . \"category c LEFT JOIN \" . DB_PREFIX . \"url_target ut ON (ut.route = CONCAT('category_id=', c.category_id))\");\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\tforeach ($query->rows as $result) {\n\t\t\t$route = 'category_id=' . $result['category_id'];\n\t\t\t$targets[$route]['route'] = $route;\n\t\t\t\n\t\t\tif (!isset($targets[$route]['target_keyword'])) {\n\t\t\t\t$targets[$route]['target_keyword'] = array();\n\t\t\t}\n\t\t\t\n\t\t\tif ($result['language_id'] && $result['sort_order'] && $result['keyword']) {\n\t\t\t\t$targets[$route]['target_keyword'][$result['language_id']][$result['sort_order']] = $result['keyword'];\n\t\t\t}\n\t\t}\n\t\t\t\t\n\t\t$query = $this->db->query(\"SELECT p.product_id, ut.language_id, ut.sort_order, ut.keyword FROM \" . DB_PREFIX . \"product p LEFT JOIN \" . DB_PREFIX . \"url_target ut ON (ut.route = CONCAT('product_id=', p.product_id)) GROUP BY p.product_id, ut.language_id\");\n\t\t\n\t\tforeach ($query->rows as $result) {\n\t\t\t$route = 'product_id=' . $result['product_id'];\n\t\t\t$targets[$route]['route'] = $route;\n\t\t\t\n\t\t\tif (!isset($targets[$route]['target_keyword'])) {\n\t\t\t\t$targets[$route]['target_keyword'] = array();\n\t\t\t}\n\t\t\t\n\t\t\tif ($result['language_id'] && $result['sort_order'] && $result['keyword']) {\n\t\t\t\t$targets[$route]['target_keyword'][$result['language_id']][$result['sort_order']] = $result['keyword'];\n\t\t\t}\n\t\t}\n\t\t\n\t\t$query = $this->db->query(\"SELECT m.manufacturer_id, ut.language_id, ut.sort_order, ut.keyword FROM \" . DB_PREFIX . \"manufacturer m LEFT JOIN \" . DB_PREFIX . \"url_target ut ON (ut.route = CONCAT('manufacturer_id=', m.manufacturer_id)) GROUP BY m.manufacturer_id, ut.language_id\");\n\t\t\n\t\tforeach ($query->rows as $result) {\n\t\t\t$route = 'manufacturer_id=' . $result['manufacturer_id'];\n\t\t\t$targets[$route]['route'] = $route;\n\t\t\t\n\t\t\tif (!isset($targets[$route]['target_keyword'])) {\n\t\t\t\t$targets[$route]['target_keyword'] = array();\n\t\t\t}\n\t\t\t\n\t\t\tif ($result['language_id'] && $result['sort_order'] && $result['keyword']) {\n\t\t\t\t$targets[$route]['target_keyword'][$result['language_id']][$result['sort_order']] = $result['keyword'];\n\t\t\t}\n\t\t}\n\t\t\n\t\t$query = $this->db->query(\"SELECT i.information_id, ut.language_id, ut.sort_order, ut.keyword FROM \" . DB_PREFIX . \"information i LEFT JOIN \" . DB_PREFIX . \"url_target ut ON (ut.route = CONCAT('information_id=', i.information_id)) GROUP BY i.information_id, ut.language_id\");\n\t\t\n\t\tforeach ($query->rows as $result) {\n\t\t\t$route = 'information_id=' . $result['information_id'];\n\t\t\t$targets[$route]['route'] = $route;\n\t\t\t\n\t\t\tif (!isset($targets[$route]['target_keyword'])) {\n\t\t\t\t$targets[$route]['target_keyword'] = array();\n\t\t\t}\n\t\t\t\n\t\t\tif ($result['language_id'] && $result['sort_order'] && $result['keyword']) {\n\t\t\t\t$targets[$route]['target_keyword'][$result['language_id']][$result['sort_order']] = $result['keyword'];\n\t\t\t}\n\t\t}\n\t\t\n\t\t$empty_targets = array();\n\t\t\n\t\tforeach ($targets as $target) {\n\t\t\tforeach ($languages as $language) {\n\t\t\t\tif (!isset($target['target_keyword'][$language['language_id']]) || (isset($target['target_keyword'][$language['language_id']]) && !$target['target_keyword'][$language['language_id']])) {\n\t\t\t\t\tif (!isset($empty_targets[$target['route']])) {\n\t\t\t\t\t\t$empty_targets[$target['route']] = $target;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\t\n\t\treturn $empty_targets;\n\t}", "public function __toString() {\n // This could cause a problem when using a lot of urls, may need to hash.\n $urls = implode(', ', $this->sourceUrls);\n return $urls;\n }", "public function setTargetTags($var)\n {\n $arr = GPBUtil::checkRepeatedField($var, \\Google\\Protobuf\\Internal\\GPBType::STRING);\n $this->target_tags = $arr;\n\n return $this;\n }", "private function getStringifiedTables($tables = array()):string{\n if(is_string($tables)){\n return $tables;\n }\n //otherwise tables are in the form of array\n $tables_string = \"\";\n foreach ($tables as $table){\n $tables_string .= $table.\", \";\n }\n return rtrim($tables_string,', ');\n }", "function convertArrayToCommaseparatedString($inputArray) {\n\t\t$result = '';\n\n\t\tforeach ($inputArray as $uid) {\n\t\t\t$result .= ', ' . $uid;\n\t\t}\n\n\t\treturn trim($result, ',');\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get the value of orderDescription
public function getOrderDescription() { return $this->orderDescription; }
[ "public function getOrderDescription() {\n\t\treturn $this->get_field( Pronamic_Pay_Gateways_Ogone_Parameters::COM );\n\t}", "public function get_order_value() {\n return $this->order_value;\n }", "public function getMerchantOrderDesc()\n {\n return $this->merchantOrderDesc;\n }", "public function getOrder()\r\n {\r\n return $this->fields['Order']['value'];\r\n }", "public function _getOrderDescription($order)\n {\n $descriptionItems = array();\n $description = '';\n $lengs = 0;\n foreach ($order->getAllItems() as $item) {\n if ($item->getParentItem()) continue;\n // we know that Ingenico Payment Services is not able to handle characters that are not available in iso-8859-1\n// $descriptionItems[] = mb_ereg_replace(\"[^a-zA-Z0-9äáàéèíóöõúüûÄÁÀÉÍÓÖÕÚÜÛ_ ]\" , \"\" , $item->getName());\n $descriptionItems[] = $this->convertToLatin1($item->getName());\n $description = Mage::helper('core/string')->substr(implode(', ', $descriptionItems), 0, 100);\n //COM field is limited to 100 chars max\n if (100 <= Mage::helper('core/string')->strlen($description)) {\n break;\n }\n }\n return $description;\n }", "public function getOrder_details()\n {\n return $this->order_details;\n }", "public function getOrderDetail()\n {\n return $this->order_detail;\n }", "public function getDescription()\n {\n return $this->getDataItem('ORDERDESC');\n }", "static function get_description_from_order($order_id) {\n\n\t\t$order = WC()->order_factory->get_order($order_id);\n\t\t\n\t\t// if default content description is defined in settings\n\t\tif( get_option('EMC_CONTENT_AS_DESC') == 'yes' && get_option('EMC_NATURE') != '' ) {\n\t\t\tglobal $wpdb;\n\t\t\t$results = $wpdb->get_results( 'SELECT cat_name FROM '.$wpdb->prefix.'emc_categories WHERE cat_id = '.$wpdb->prepare('%s', get_option('EMC_NATURE')) ,OBJECT);\n\t\t\tself::handle_sql_error();\n\t\t\treturn $results[0]->cat_name;\n\t\t}\n\t\t// else concatenate product info\n\t\telse {\n\t\t\t$description = '';\n\t\t\tforeach( $order->get_items( 'line_item' ) as $value ) {\n\t\t\t\t$product = wc_get_product( $value['product_id'] );\n\t\t\t\t$description .= $product->get_title() . ';';\n\t\t\t}\n\t\t\treturn $description;\n\t\t}\n\t}", "public function getAmountDescription()\n {\n return $this->_fields['AmountDescription']['FieldValue'];\n }", "public function getProduct_desc () {\n\t$preValue = $this->preGetValue(\"product_desc\"); \n\tif($preValue !== null && !\\Pimcore::inAdmin()) { \n\t\treturn $preValue;\n\t}\n\t$data = $this->getClass()->getFieldDefinition(\"product_desc\")->preGetData($this);\n\treturn $data;\n}", "public function getProductDescription() \n {\n return $this->_fields['ProductDescription']['FieldValue'];\n }", "public function getValueDescription();", "public function getDescription(){\r\n if(!$this->description){\r\n $this->getDescriptionFromProduct();\r\n }\r\n else{\r\n return $this->description;\r\n }\r\n }", "function the_order_description( $order_id = null ) {\n\techo get_the_order_description( $order_id );\n}", "public function getPaymentDescription();", "public function getProductDescription()\n {\n $value = $this->get(self::product_description);\n return $value === null ? (string)$value : $value;\n }", "public function getOrderNo()\n {\n $value = $this->get(self::order_no);\n return $value === null ? (string)$value : $value;\n }", "public function getUomdesc()\n {\n return $this->uomdesc;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Retrieve a custom report containing the provided fields for all employees (active AND inactive). Optionally only include employees whose fields have changed since the $lastChanged date and time (ISO 8601).
public function customReport($title, array $fields, $lastChanged = null, $format = "JSON") { $xml = "<report>"; $xml .= "<title>{$title}</title>"; if ($lastChanged) { $xml .= "<filters><lastChanged includeNull=\"no\">{$lastChanged}</lastChanged></filters>"; } $xml .= "<fields>"; foreach ($fields as $field) { $xml .= "<field id=\"{$field}\" />"; } $xml .= "</fields>"; $xml .= "</report>"; return $this->post("reports/custom", $xml, ['format' => $format]); }
[ "function getEmployeesWithPreviousEmployer($gData = array()){\n \t$qry = array();\n \t$endDate = $gData['year'].'-12-31';\n \t$startDate = $gData['year'].'-01-01';\n \tIF($gData['branchinfo_id']!=0){//get Location parameter.\n\t\t\t$qry[] = \"a.branchinfo_id = '\".$gData['branchinfo_id'].\"'\";\n\t\t}\n\t\t$qry[] = \"d.bldsched_period = '1'\";\n\t\t$qry[] = \"a.comp_id = '\".$gData['comp'].\"'\";\n\t\t$qry[] = \"d.bldsched_period != '2'\";\n\t\t$qry[] = \"d.empdd_id = '5'\";\n\t\t$qry[] = \"a.emp_stat = '7'\";\n\t\t$qry[] = \"a.emp_id NOT IN (select emp_id from period_benloanduc_sched where empdd_id=5 and bldsched_period=4)\";\n\t\t//$qry[] = \"((a.emp_hiredate >= '{$startDate}' AND a.emp_hiredate <= '{$endDate}') AND ((a.emp_resigndate = '0000-00-00' OR a.emp_resigndate IS NULL) AND (a.emp_retiredate = '0000-00-00' OR a.emp_retiredate IS NULL)))\";\n\t\t$qry[] = \"e.bir_alphalist_year='\".$gData['year'].\"'\";\n\t\t$criteria = count($qry)>0 ? \" WHERE \".implode(' AND ',$qry) : '';\n \t$sql = \"SELECT DISTINCT a.emp_id, b.pi_tin, CONCAT(b.pi_lname,', ',b.pi_fname,' ',b.pi_mname) AS fullname, c.taxep_code, e.*,\n \t\t\tb.pi_lname,b.pi_fname,b.pi_mname\n\t\t\t\tFROM emp_masterfile a \n\t\t\t\tJOIN emp_personal_info b ON (b.pi_id=a.pi_id)\n\t\t\t\tJOIN tax_excep c ON (c.taxep_id=a.taxep_id)\n\t\t\t\tJOIN period_benloanduc_sched d ON (d.emp_id=a.emp_id)\n\t\t\t\tJOIN bir_alphalist_prev_emp e ON (e.emp_id=a.emp_id)\n\t\t\t\t$criteria\n\t\t\t\tORDER BY b.pi_lname\";\n $rsResult = $this->conn->GetAll($sql);\n return $rsResult;\n }", "public function getReportsFields(array $fields);", "public function filter_employee($report,$company,$division,$department,$section,$subsection,$classification,$location,$civil_status,$employment,$gender,$religion,$date_employed,$taxcode,$paytype,$status,$age,$age_comparator,$years,$years_comparator)\n\t{\n\t\t$this->data['report_fields'] = $this->reports->report_fields($report);\n\t\t$this->data['filter'] = $this->reports->filter_employee($report,$company,$division,$department,$section,$subsection,$classification,$location,$civil_status,$employment,$gender,$religion,$date_employed,$taxcode,$paytype,$status,$age,$age_comparator,$years,$years_comparator);\n\t\tif ($this->data['filter']) \n\t\t{\n\t\t\t$this->load->view('app/reports/employee/view_employee_report',$this->data);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->session->set_flashdata('message', 'No Available Record');\n\t\t\t$this->load->view('app/reports/employee/view_employee_report',$this->data);\n\t\t}\n\t}", "public function getAllEmployeesActivated(): array\n {\n //TO DO Manage add option to send year in parameter to get older info\n\n $employees = array_map(\n function (Employee $employee) {\n $dt = new DateTime($employee->getRegistered());\n // Only Activated Employee and subcribed this year \n if ($employee->getIsActive() && date(\"Y\") === $dt->format('Y')) {\n // 'Y-m-d H:i:sP' to have all date in the same format\n return json_encode([\n \"id\" => $employee->getIid(),\n \"profile\" => [\n \"firstName\" => $employee->getProfile()->getFirstName(),\n \"lastName\" => $employee->getProfile()->getLastName(),\n ],\n \"email\"=> $employee->getEmail(),\n \"address\"=> $employee->getAddress(),\n \"registered\"=> $dt->format('Y-m-d H:i:sP'),\n \"isActive\"=> $employee->getIsActive()\n ]);\n }\n },\n $this->getAllEmployees()\n );\n\n // remouve null value\n return array_filter($employees);\n }", "public function getRecentEmployees(){\n \n \t$recentEmp = $this->timesheet_login->recentEmployees();\n\t\t\n\t\techo json_encode($recentEmp);\n \n }", "protected function _ReportAdjustmentsByEmployeeSummary()\n\t{\n\t\t$arrCols = Array();\n\t\t$arrCols['Employee']\t= \"CONCAT(Employee.FirstName, ' ', Employee.LastName)\";\n\t\t$arrCols['Description']\t= \"Charge.Description\";\n\t\t$arrCols['Instances']\t= \"COUNT(Charge.Id)\";\n\t\t$arrCols['Min']\t\t\t= \"MIN(Charge.Amount)\";\n\t\t$arrCols['Max']\t\t\t= \"MAX(Charge.Amount)\";\n\t\t$arrCols['Mean']\t\t= \"AVG(Charge.Amount)\";\n\t\t$arrCols['TotalCharge']\t= \"SUM(Charge.Amount)\";\n\t\t$arrCols['Nature']\t\t= \"Charge.Nature\";\n\t\t$selAdjustments\t= new StatementSelect(\"Charge JOIN Employee ON Charge.CreatedBy = Employee.Id\", $arrCols, \"InvoiceRun = <InvoiceRun>\", \"Charge.Nature\", NULL, \"Charge.CreatedBy, Charge.Description\");\n\t\t\n\t\t// Create Workbook\n\t\t$strFilename = \"/home/vixen/{$GLOBALS['**arrCustomerConfig']['Customer']}/reports/\".date(\"Y/m/\", strtotime(\"-1 month\", time())).\"Adjustments_by_Employee_Summary.xls\";\n\t\t@unlink($strFilename);\n\t\t$wkbWorkbook = new Spreadsheet_Excel_Writer($strFilename);\n\t\t\n\t\t// Init formats\n\t\t$arrFormat = $this->_InitExcelFormats($wkbWorkbook);\n\t\t\n\t\t// Create Worksheet & Header\n\t\t$wksWorksheet =& $wkbWorkbook->addWorksheet(\"Adjustments by Employee Summary\");\n\t\t$wksWorksheet->setLandscape();\n\t\t$wksWorksheet->hideGridlines();\n\t\t$wksWorksheet->fitToPages(1, 99);\n\t\t\n\t\t$strPageTitle = strtoupper(date(\"F\", strtotime(\"-1 month\", strtotime($this->_arrProfitData['ThisMonth']['BillingDate']))).\" Adjustment by Employee Summary for Telco Blue\");\n\t\t$wksWorksheet->writeString(0, 2, $strPageTitle, $arrFormat['PageTitle']);\n\t\t\n\t\t$wksWorksheet->writeString(3, 0, \"Bill Date\"\t\t, $arrFormat['TextBold']);\n\t\t$wksWorksheet->writeString(4, 0, \"Billing Period\"\t, $arrFormat['TextBold']);\n\t\t$wksWorksheet->writeString(5, 0, \"Invoice Run\"\t\t, $arrFormat['TextBold']);\n\t\t\n\t\t$wksWorksheet->writeString(3, 6, date(\"d/m/Y\", strtotime($this->_arrProfitData['ThisMonth']['BillingDate'])));\n\t\t$wksWorksheet->writeString(4, 6, date(\"F Y\", strtotime(\"-1 month\", strtotime($this->_arrProfitData['ThisMonth']['BillingDate']))));\n\t\t$wksWorksheet->writeString(5, 6, $this->_arrProfitData['ThisMonth']['InvoiceRun']);\n\t\t\n\t\tfor ($i = 0; $i <= 6; $i++)\n\t\t{\n\t\t\t$wksWorksheet->writeBlank(2, $i, $arrFormat['BlankUnderline']);\n\t\t\t$wksWorksheet->writeBlank(6, $i, $arrFormat['Spacer']);\n\t\t}\n\t\t\n\t\t// Breakdown\t\n\t\t$selAdjustments->Execute($this->_arrProfitData['ThisMonth']);\n\t\t$arrAdjustments = $selAdjustments->FetchAll();\n\t\t\n\t\t$arrEmployees = Array();\n\t\tforeach ($arrAdjustments as $arrAdjustment)\n\t\t{\n\t\t\t$arrEmployees[$arrAdjustment['Employee']][$arrAdjustment['Nature']][$arrAdjustment['Description']]\t= $arrAdjustment;\n\t\t}\n\t\t\n\t\t$intRow = 6;\n\t\tksort($arrEmployees, SORT_STRING);\n\t\tforeach ($arrEmployees as $strEmployee=>$arrEmployee)\n\t\t{\n\t\t\tfor ($i = 0; $i <= 6; $i++)\n\t\t\t{\n\t\t\t\t$wksWorksheet->writeBlank($intRow, $i, $arrFormat['BlankOverline']);\n\t\t\t\t//$wksWorksheet->writeBlank($intRow+1, $i, $arrFormat['BlankUnderline']);\n\t\t\t\t$wksWorksheet->writeBlank($intRow+2, $i, $arrFormat['BlankUnderline']);\n\t\t\t}\n\t\t\t\n\t\t\t$intRow\t+= 2;\n\t\t\t$wksWorksheet->writeString($intRow, 0, $strEmployee\t\t\t, $arrFormat['Title']);\n\t\t\t$intRow++;\n\t\t\t\n\t\t\t$fmtTitleFormat = $arrFormat['ColTitle'];\n\t\t\tforeach ($arrEmployee as $strNature=>$arrSummaries)\n\t\t\t{\t\t\n\t\t\t\tif ($strNature == 'CR')\n\t\t\t\t{\n\t\t\t\t\t$strNoun\t= \"Credit\";\n\t\t\t\t\t$strAbbr\t= 'CR';\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$strNoun\t= \"Debit\";\n\t\t\t\t\t$strAbbr\t= 'DR';\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Title Row\n\t\t\t\t$wksWorksheet->writeString($intRow, 0, \"{$strNoun}s\"\t\t\t, $fmtTitleFormat);\n\t\t\t\t$wksWorksheet->writeString($intRow, 1, \"Description\"\t\t\t, $fmtTitleFormat);\n\t\t\t\t$wksWorksheet->writeString($intRow, 2, \"Instances\"\t\t\t\t, $fmtTitleFormat);\n\t\t\t\t$wksWorksheet->writeString($intRow, 3, \"Smallest $strNoun\"\t\t, $fmtTitleFormat);\n\t\t\t\t$wksWorksheet->writeString($intRow, 4, \"Largest $strNoun\"\t\t, $fmtTitleFormat);\n\t\t\t\t$wksWorksheet->writeString($intRow, 5, \"Average $strNoun\"\t\t, $fmtTitleFormat);\n\t\t\t\t$wksWorksheet->writeString($intRow, 6, \"Total {$strNoun}ed\"\t\t, $fmtTitleFormat);\n\t\t\t\t\n\t\t\t\t$intRow++;\n\t\t\t\tforeach ($arrSummaries as $strDescription=>$arrSummary)\n\t\t\t\t{\n\t\t\t\t\tif ($strNature == 'CR')\n\t\t\t\t\t{\n\t\t\t\t\t\t$arrSummary['Min']\t\t\t= 0 - $arrSummary['Min'];\n\t\t\t\t\t\t$arrSummary['Max']\t\t\t= 0 - $arrSummary['Max'];\n\t\t\t\t\t\t$arrSummary['Mean']\t\t\t= 0 - $arrSummary['Mean'];\n\t\t\t\t\t\t$arrSummary['TotalCharge']\t= 0 - $arrSummary['TotalCharge'];\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$wksWorksheet->writeBlank($intRow, 0, $arrFormat['LeftSpacer']);\n\t\t\t\t\t$wksWorksheet->writeString($intRow, 1, $strDescription);\n\t\t\t\t\t$wksWorksheet->writeNumber($intRow, 2, $arrSummary['Instances']\t\t, $arrFormat['Integer']);\n\t\t\t\t\t$wksWorksheet->writeNumber($intRow, 3, $arrSummary['Min']\t\t\t, $arrFormat['CreditDebit']);\n\t\t\t\t\t$wksWorksheet->writeNumber($intRow, 4, $arrSummary['Max']\t\t\t, $arrFormat['CreditDebit']);\n\t\t\t\t\t$wksWorksheet->writeNumber($intRow, 5, $arrSummary['Mean']\t\t\t, $arrFormat['CreditDebit']);\n\t\t\t\t\t$wksWorksheet->writeNumber($intRow, 6, $arrSummary['TotalCharge']\t, $arrFormat['CreditDebit']);\n\t\t\t\t\t\n\t\t\t\t\t$intRow++;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Add in Grand Totals\n\t\t\t\t$wksWorksheet->writeBlank($intRow, 0, $arrFormat['LeftSpacer']);\n\t\t\t\t$wksWorksheet->writeBlank($intRow, 1, $arrFormat['BlankOverline']);\n\t\t\t\t$wksWorksheet->writeBlank($intRow, 2, $arrFormat['BlankOverline']);\n\t\t\t\t$wksWorksheet->writeBlank($intRow, 3, $arrFormat['BlankOverline']);\n\t\t\t\t$wksWorksheet->writeBlank($intRow, 4, $arrFormat['BlankOverline']);\n\t\t\t\t$wksWorksheet->writeString($intRow, 5, \"Grand Total $strAbbr\", $arrFormat['OverlineBold']);\n\t\t\t\t$wksWorksheet->writeNumber($intRow, 6, $arrFormat['BlankOverline']);\n\t\t\t\t$intRow++;\n\t\t\t\t\n\t\t\t\t// Switch to alternate title\n\t\t\t\t$fmtTitleFormat = $arrFormat['AltColTitle'];\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Bottom Line\n\t\tfor ($i = 0; $i <= 6; $i++)\n\t\t{\n\t\t\t$wksWorksheet->writeBlank($intRow, $i, $arrFormat['BlankOverline']);\n\t\t}\n\t\t\n\t\t// Set Column Widths\n\t\t$fltExcelWidthRatio = 5;\n\t\t$wksWorksheet->setColumn(0, 0, 4 * $fltExcelWidthRatio);\n\t\t$wksWorksheet->setColumn(1, 1, 9 * $fltExcelWidthRatio);\n\t\t$wksWorksheet->setColumn(2, 2, 2 * $fltExcelWidthRatio);\n\t\t$wksWorksheet->setColumn(3, 3, 3 * $fltExcelWidthRatio);\n\t\t$wksWorksheet->setColumn(4, 4, 3 * $fltExcelWidthRatio);\n\t\t$wksWorksheet->setColumn(5, 5, 3 * $fltExcelWidthRatio);\n\t\t$wksWorksheet->setColumn(6, 6, 3 * $fltExcelWidthRatio);\n\t\t\n\t\t// Close Workbook\n\t\t$wkbWorkbook->close();\n\t\tchmod($strFilename, 0777);\n\t\t\n\t\treturn Array($strFilename);\n\t}", "public function getEmployment() // {{{\n {\n global $CCV_CONST;\n $records = array();\n $elements = $this->m_xpath->query(\"//section[@id='b857f61b33484cb093068bd2da764f99']\");\n for ($i = 0; !is_null($elements) && $i < $elements->length; $i++)\n {\n $record = array();\n $id = $this->get_xpath(\"@recordId\", $elements->item($i));\n $record['type'] = $this->get_xpath(\"field[@id='9510a03a308f43ceb8cd046aeffa9499']/lov/@id\", $elements->item($i));\n $record['title'] = $this->get_xpath(\"field[@id='886807b87b624978bc8ca9045ff56e47']/value\", $elements->item($i));\n $record['status'] = $this->get_xpath(\"field[@id='ef7bd6fa8dd040449fa181f0ca4530e4']/lov/@id\", $elements->item($i));\n $record['rank'] = $this->get_xpath(\"field[@id='500e1360abd14972bc1ef844a8b98087']/lov/@id\", $elements->item($i));\n $date = $this->get_xpath(\"field[@id='c7e85d10d10249c68b28c71fc80ec570']/value\", $elements->item($i));\n @list($record[\"start_year\"], $record[\"start_month\"]) = explode(\"/\", $date);\n $date = $this->get_xpath(\"field[@id='b4681f52d85440829faa3160ba3bb31f']/value\", $elements->item($i));\n @list($record[\"end_year\"], $record[\"end_month\"]) = explode(\"/\", $date);\n $record[\"end_year\"] = ($record[\"end_year\"] == null) ? \"\" : $record[\"end_year\"];\n $record[\"end_month\"] = ($record[\"end_month\"] == null) ? \"\" : $record[\"end_month\"];\n \n $record['organization_country'] = $this->get_xpath(\"field[@id='5dd34f14c1ea47c09e8ddcd202653814']/refTable/linkedWith[@label='Country']/@value\", $elements->item($i));\n $record['organization_subdivision'] = $this->get_xpath(\"field[@id='5dd34f14c1ea47c09e8ddcd202653814']/refTable/linkedWith[@label='Subdivision']/@value\", $elements->item($i));\n $record['organization_type'] = $this->get_xpath(\"field[@id='5dd34f14c1ea47c09e8ddcd202653814']/refTable/linkedWith[@label='Organization Type']/@value\", $elements->item($i));\n $record['organization_name'] = $this->get_xpath(\"field[@id='5dd34f14c1ea47c09e8ddcd202653814']/refTable/linkedWith[@label='Organization']/@value\", $elements->item($i));\n $record['department'] = $this->get_xpath(\"field[@id='cd6e5e97994e42f893bd5c9e7212c94b']/value\", $elements->item($i));\n $record['faculty'] = $this->get_xpath(\"field[@id='58cf7001d283421b91f5da21f0ef2188']/value\", $elements->item($i));\n $record['tenure'] = $this->get_xpath(\"field[@id='b0eca39ad77346648180dec948d13432']/lov/@id\", $elements->item($i));\n $records[$id] = $record;\n }\n return $records;\n }", "public function getDataChanges(\n SugarBean &$bean\n )\n {\n \t$changed_values=array();\n\t\t$audit_fields=$bean->getAuditEnabledFieldDefinitions();\n\n\t\tif (is_array($audit_fields) and count($audit_fields) > 0) {\n\t\t\tforeach ($audit_fields as $field=>$properties) {\n\n\t\t\t\tif (!empty($bean->fetched_row) && array_key_exists($field, $bean->fetched_row)) {\n\n\t\t\t\t\t$before_value=$bean->fetched_row[$field];\n\t\t\t\t\t$after_value=$bean->$field;\n\t\t\t\t\tif (isset($properties['type']))\n\t\t\t\t\t\t$field_type=$properties['type'];\n\t\t\t\t\telse {\n\t\t\t\t\t\tif (isset($properties['dbType']))\n\t\t\t\t\t\t\t$field_type=$properties['dbType'];\n\t\t\t\t\t\telse if(isset($properties['data_type']))\n\t\t\t\t\t\t\t$field_type=$properties['data_type'];\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\t$field_type=$properties['dbtype'];\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t//Because of bug #25078(sqlserver haven't 'date' type, trim extra \"00:00:00\" when insert into *_cstm table). so when we read the audit datetime field from sqlserver, we have to replace the extra \"00:00:00\" again.\n\t\t\t\t\tif(!empty($field_type) && $field_type == 'date'){\n\t\t\t\t\t\t$before_value = from_db_convert($before_value , $field_type);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t//if the type and values match, do nothing.\n\t\t\t\t\tif (!(emptyValue($before_value,$field_type) && emptyValue($after_value,$field_type))) {\n\t\t\t\t\t\tif (trim($before_value) !== trim($after_value)) {\n\t\t\t\t\t\t\tif (!(isTypeNumber($field_type) && (trim($before_value)+0) == (trim($after_value)+0))) {\n\t\t\t\t\t\t\t\tif (!(isTypeBoolean($field_type) && (getBooleanValue($before_value)== getBooleanValue($after_value)))) {\n\t\t\t\t\t\t\t\t\t$changed_values[$field]=array('field_name'=>$field,\n\t\t\t\t\t\t\t\t\t\t'data_type'=>$field_type,\n\t\t\t\t\t\t\t\t\t\t'before'=>$before_value,\n\t\t\t\t\t\t\t\t\t\t'after'=>$after_value);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $changed_values;\n\t}", "private function getEmployeeReportData(int $employeeID = null): array {\n if (!isset($employeeID)) {\n $employeeID = $this->args['empID'];\n }\n if (is_numeric($employeeID)) {\n $this->db->exec(\"SET TIME ZONE 'Australia/Brisbane'\");\n $query = \"\n WITH last_week_sales AS (\n SELECT \n employee_id,\n sum(qty * sales_amount) AS last_week_sales_amount\n FROM \n sales\n WHERE \n employee_id = {$employeeID}\n AND\n sales_date \n BETWEEN\n NOW()::DATE-EXTRACT(DOW FROM NOW())::INTEGER-7\n AND \n NOW()::DATE-EXTRACT(DOW from NOW())::INTEGER-1\n GROUP BY\n employee_id\n ), \n current_week_sales AS (\n SELECT \n employee_id,\n sum(qty * sales_amount) AS current_week_sales\n FROM \n sales\n WHERE \n employee_id = {$employeeID}\n AND\n sales_date \n BETWEEN\n NOW()::DATE-EXTRACT(DOW FROM NOW())::INTEGER\n AND \n NOW()::DATE-EXTRACT(DOW from NOW())::INTEGER+6\n GROUP BY\n employee_id\n )\n SELECT \n e.employee_id,\n e.employee_name, \n p.position_name,\n cws.current_week_sales,\n lws.last_week_sales_amount\n FROM \n employee e \n LEFT JOIN\n current_week_sales cws\n USING\n (employee_id)\n LEFT JOIN\n last_week_sales lws\n USING\n (employee_id)\n JOIN\n position p\n USING\n (position_id)\n WHERE \n e.employee_id = {$employeeID}\";\n return $this->db->getAll($query);\n } else {\n return [];\n }\n }", "public function get_employee_details(){\n\t\t$this->loadModel('User');\n\t\t$role_id = $this->request->data['Report']['role_id'];\n\t\t$branch_id = $this->request->data['Report']['branch_id'];\n\t\t$roleCond = !empty($role_id) ? array('roles_id' => $role_id) : '';\n\t\t$branchCond = !empty($branch_id) ? array('location_id' => $branch_id) : '';\n\t\treturn $this->User->find('list', array('fields' => array('id','first_name'), 'order' => array('first_name ASC'),'conditions' => array('status' => 0, $roleCond, $branchCond)));\n\t}", "function getModifiedEmployees($modifiedSince) {\n if ($modifiedSince == 'null') {\n $modifiedSince = \"1000-01-01\";\n }\n $employees = $_SESSION['employees'];\n $result = array();\n foreach ($employees as $employee) {\n if ($employee->lastModified > $modifiedSince) {\n $result[] = $employee;\n }\n }\n echo json_encode($result);\n}", "public function getEmployeeTimeLogReport(Request $request)\n {\n $business_id = request()->session()->get('user.business_id');\n\n if (!(auth()->user()->can('superadmin') || $this->moduleUtil->hasThePermissionInSubscription($business_id, 'project_module'))) {\n abort(403, 'Unauthorized action.');\n }\n\n if ($request->ajax()) {\n try {\n $user_ids = $request->input('user_id');\n $project_ids = $request->input('project_id');\n $start_date = $request->input('start_date');\n $end_date = $request->input('end_date');\n\n $query = ProjectUser::with(['projects' => function ($query) use ($project_ids) {\n //filter by project id\n if (!empty($project_ids)) {\n $query->whereIn('pjt_projects.id', $project_ids);\n }\n },\n 'projects.timeLogs' => function ($query) use ($start_date, $end_date) {\n // filter by start & end date\n if (!empty($start_date) && !empty($end_date)) {\n if ($start_date == $end_date) {\n $query->whereDate('start_datetime', $start_date);\n } else {\n $query->whereBetween('start_datetime', [$start_date, $end_date]);\n }\n }\n },\n 'projects.timeLogs.task'])\n ->where('business_id', $business_id);\n\n //filter by user\n if (!empty($user_ids)) {\n $query->whereIn('id', $user_ids);\n }\n\n $users = $query->get();\n\n //filter time log for particular user\n foreach ($users as $index => $user) {\n $is_available_user_timelog = false;\n foreach ($user->projects as $project) {\n foreach ($project->timeLogs as $key => $timeLog) {\n //if timelog user id doesn't match with current user; unset(remove) the timelog\n if ($timeLog->user_id != $user->id) {\n unset($project->timeLogs[$key]);\n } else {\n $is_available_user_timelog = true;\n }\n }\n }\n //if user's timelog doesn't exist, remove that user\n if (!$is_available_user_timelog) {\n unset($users[$index]);\n }\n }\n\n $timelog_report_html = View::make('project::reports.partials.employee_timelog')\n ->with(compact('users'))\n ->render();\n\n $output = [\n 'success' => true,\n 'timelog_report' => $timelog_report_html,\n 'msg' => __('lang_v1.success')\n ];\n } catch (Exception $e) {\n \\Log::emergency(\"File:\" . $e->getFile(). \"Line:\" . $e->getLine(). \"Message:\" . $e->getMessage());\n\n $output = [\n 'success' => false,\n 'msg' => __('messages.something_went_wrong')\n ];\n }\n\n return $output;\n }\n\n //data for filter\n $employees = ProjectUser::forDropdown($business_id, false);\n $projects = Project::projectDropdown($business_id);\n\n return view('project::reports.employee_timelog')\n ->with(compact('projects', 'employees'));\n }", "function _erpal_employee_helper_get_working_time_nodes_employee_by_type($uid, $year, $month, $type) {\n $monthNull = str_pad($month, 2 ,'0', STR_PAD_LEFT);\n\t$ldom = erpal_lib_date_ldom($month, $year); //last day of month\n\t$range_from = \"$year-$monthNull-01 00:00:00\";\n\t$range_till = \"$ldom 23:59:59\";\n $date_till_unix = strtotime($range_till);\n $date_from_unix = strtotime($range_from);\n \n //get all working time of the user and always check if he is employee at the time of the working time node entry\n $query = new EntityFieldQuery();\n\n $query->entityCondition('entity_type', 'node')\n ->entityCondition('bundle', 'erpal_working_time')\n ->propertyCondition('status', 1)\n ->propertyCondition('uid', $uid)\n ->fieldCondition('field_date_time', 'value', $date_from_unix, '>=')\n ->fieldCondition('field_date_time', 'value', $date_till_unix, '<=')\n ->fieldCondition('field_working_time_type', 'value', $type)\n ->addMetaData('account', user_load(1)); // Run the query as user 1.\n\n $result = $query->execute();\n\n $working_time_nodes = array();\n if (isset($result['node'])) {\n $working_time_nids = array_keys($result['node']);\n $working_time_nodes = entity_load('node', $working_time_nids);\n }\n \n //now filter the nodes and keep only the once at the time when user was employee\n $nodes = array();\n foreach ($working_time_nodes as $working_time_node) {\n $booking_time_from = $working_time_node->field_date_time[LANGUAGE_NONE][0]['value2']; //use value2 because this is the latest day the contract could be committed to be valid for this date.\n \n //add this only, if user is emplyee at the time of the timetracking entity.\n $contract_data = _erpal_profile_helper_get_current_contract($uid, array(), $booking_time_from);\n if (!$contract_data || !is_array($contract_data) || $contract_data['member_type'] != 'full_employee')\n continue; //no contract or no full employee, no \"must working hours\" this day (may be he has a contract later)!! \n\n $nodes[] = $working_time_node;\n }\n \n return $nodes;\n}", "function _erpal_employee_helper_get_reduce_hours($uid, $year, $month) {\n $monthNull = str_pad($month, 2 ,'0', STR_PAD_LEFT);\n\t$ldom = erpal_lib_date_ldom($month, $year); //last day of month\n\t$range_from = \"$year-$monthNull-01 00:00:00\";\n\t$range_till = \"$ldom 23:59:59\";\n $date_till_unix = strtotime($range_till);\n $date_from_unix = strtotime($range_from);\n \n $query = new EntityFieldQuery();\n\n $query->entityCondition('entity_type', 'node')\n ->entityCondition('bundle', 'erpal_working_time')\n ->propertyCondition('status', 1)\n ->propertyCondition('uid', $uid)\n ->fieldCondition('field_date_time', 'value', $date_from_unix, '>=')\n ->fieldCondition('field_date_time', 'value', $date_till_unix, '<=')\n ->fieldCondition('field_working_time_type', 'value', 'reduce_hours') \n ->addMetaData('account', user_load(1)); // Run the query as user 1.\n\n $result = $query->execute();\n\n $timetracking_nodes = array();\n if (isset($result['node'])) {\n $timetracking_nids = array_keys($result['node']);\n $timetracking_nodes = entity_load('node', $timetracking_nids);\n }\n \n //get only the timetrackings that the user booked as employee!\n $timetracking_dates = _erpal_calendar_helper_get_dates_in_range($year, $month, $timetracking_nodes, 'field_date_time', 'field_date_time', array(LANGUAGE_NONE, 0, 'value'), array(LANGUAGE_NONE, 0, 'value'));\n \n //get the sum of all timetrackings (duration, not billing duration)\n $total_duration = 0;\n foreach ($timetracking_nodes as $node) {\n //take only these that are in timetracking_dates!\n $timetracking_date = $node->field_date_time[LANGUAGE_NONE][0]['value'];\n $timetracking_date_str = date('Y-m-d', $timetracking_date);\n $is_valid_date = false;\n foreach ($timetracking_dates as $date) {\n $date_str = date('Y-m-d', $date); \n if ($date_str == $timetracking_date_str) { \n $is_valid_date = true;\n break;\n }\n }\n \n if ($is_valid_date) {\n $duration = $node->field_duration_calc[LANGUAGE_NONE][0]['value'];\n $total_duration += $duration;\n }\n }\n \n return $total_duration;\n\n}", "function getNewEmployees()\n\t{\n\t\t$data=array();\n\n\t\t$sql=\"SELECT * \n\t\t\t\t\t\t\tFROM pzbload\n\t\t\t\t\t\t WHERE (NOT EXISTS (SELECT 1 \n\t\t\t\t\t\t FROM psu_identity.person_attribute a,\n\t\t\t\t\t\t psu_identity.attribute_meta m \n\t\t\t\t\t\t WHERE a.pidm=pzbload_pidm\n\t\t\t\t\t\t AND a.type_id = 2\n\t\t\t\t\t\t AND a.type_id = m.type_id\n\t\t\t\t\t\t AND a.attribute = m.attribute\n\t\t\t\t\t\t AND m.meta = 'hr')\n\t\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t\tOR pzbload_pidm IS NULL\n\t\t\t\t\t\t ORDER BY pzbload_last_name,pzbload_first_name,pzbload_mi\";\n\t\tif($results=$this->_ADOdb->Execute($sql))\n\t\t{\n\t\t\twhile($row=$results->FetchRow())\n\t\t\t{\n\t\t\t\t$data[]=PSUTools::cleanKeys('pzbload_','',$row);\n\t\t\t}//end while\n\t\t}//end if\n\n\t\treturn $data;\n\t}", "protected function getEmployeeInfoForworkplanUpdateAlert($employee_id){\n\t\t$conditions = array(\n\t\t\t'joins'=>array(\n\t\t\t\tarray(\n\t\t\t\t\t'table'=>'employees',\n\t\t\t\t\t'type'=>'inner',\n\t\t\t\t\t'alias'=>'Employee',\n\t\t\t\t\t'conditions'=>array('CurrentJobDetail.id = Employee.employee_id')\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'table'=>'current_job_details',\n\t\t\t\t\t'type'=>'inner',\n\t\t\t\t\t'alias'=>'SupervisorJob',\n\t\t\t\t\t'conditions'=>array('CurrentJobDetail.supervisor_id = SupervisorJob.id')\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'table'=>'current_job_details',\n\t\t\t\t\t'type'=>'inner',\n\t\t\t\t\t'alias'=>'ReviewerJob',\n\t\t\t\t\t'conditions'=>array('SupervisorJob.supervisor_id = ReviewerJob.id')\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'table'=>'employees',\n\t\t\t\t\t'type'=>'inner',\n\t\t\t\t\t'alias'=>'SupervisorJobName',\n\t\t\t\t\t'conditions'=>array('SupervisorJob.supervisor_id = SupervisorJobName.employee_id')\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'table'=>'employees',\n\t\t\t\t\t'type'=>'inner',\n\t\t\t\t\t'alias'=>'ReviewerJobName',\n\t\t\t\t\t'conditions'=>array('ReviewerJob.id = ReviewerJobName.employee_id')\n\t\t\t\t)\n\t\t\t),\n\t\t\t'conditions'=>array(\n\t\t\t\t'CurrentJobDetail.id'=>$employee_id\n\t\t\t),\n\t\t\t'fields'=>array(\n\t\t\t\t'Employee.title,Employee.employee_id,Employee.first_name,Employee.last_name',\n\t\t\t\t'SupervisorJob.employee_id,SupervisorJob.title,SupervisorJob.first_name,SupervisorJob.last_name',\n\t\t\t\t'ReviewerJobName.employee_id,ReviewerJobName.title,ReviewerJobName.first_name,ReviewerJobName.last_name'\n\t\t\t),\n\t\t\t'recursive'=>-1\n\t\t);\n\t\ttry{\n\t\t\t$employee = $this->CurrentJobDetail->find('all',$conditions);\n\t\t\treturn $employee;\n\t\t}\n\t\tcatch(Exception $e){\n\t\t\t$message = 'Caught exception: '.$e->getMessage();\n\t\t\tCakeLog::critical($message);\n\t\t\treturn false;\n\t\t}\n\t}", "function getEmployeesScreenedToday(){\n\n // Connect to the database\n $connection = db_connect();\n\n // Build the SQL string to get the number who have submitted today.\n $sql = \"SELECT COUNT(ID) as SubmittedToday FROM People WHERE LastCheckin=CURDATE();\";\n \n // Get the data from the database\n $results = $connection->query($sql);\n if ($results->num_rows > 0) {\n $result = $results->fetch_assoc();\n $chartData = $result['SubmittedToday']. \",\";\n }\n else {\n $chartData = \"0,\";\n }\n\n // Build the SQL string to get the number who haven't submitted today.\n $sql = \"SELECT COUNT(ID) as NotSubmittedToday FROM People WHERE (LastCheckin<CURDATE() OR LastCheckin IS NULL) AND Active=TRUE;\";\n \n // Get the data from the database\n $results = $connection->query($sql);\n if ($results->num_rows > 0) {\n $result = $results->fetch_assoc();\n $chartData .= $result['NotSubmittedToday'];\n }\n else {\n $chartData .= \"0\";\n }\n\n // Return the results\n return $chartData;\n\n}", "function getEmployeeDetail($id='',$field='employee')\n {\n\n //profiling::\n $this->debug_methods_trail[] = __function__;\n\n //declare\n $conditional_sql = \"\";\n\t\t$additional_sql = \"\";\n\t\t\n\n //if no valie client id, return false\n if (! is_numeric($id)) {\n return false;\n }\n\n\t\tif($field=='employee'){\n\t\t\t $conditional_sql = \" AND e.id = $id\";\n\t\t}\n\t\telse{\n\t\t\t$conditional_sql = \" AND ep.id = $id\";\n\t\t}\n\n\n\n //check if sorting type was passed\n $sort = ($sort == 'asc' || $sort == 'desc') ? $sort : 'ASC';\n\n //----------sql & benchmarking start----------\n $this->benchmark->mark('code_start');\n\n //_____SQL QUERY_______\n $query = $this->db->query(\"SELECT *,CONCAT(IFNULL(fname,''),' ',IFNULL(mname,''),' ',IFNULL(lname,'')) AS name,CONCAT(IFNULL(SUBSTR(fname, 1, 1),''),IFNULL(SUBSTR(mname, 1, 1),''),IFNULL(SUBSTR(lname, 1, 1),'')) AS initial,partner_branch,employee_type,employment_type,wage_type,job_percentage,jobtitle,start_date,end_date,salary\n FROM a_employee as e\n\t\t\t\t\t\t\t\t\t\t LEFT JOIN a_employee_p_branch as ep ON e.id = ep.employee \n\t\t\t\t\t\t\t\t\t\t WHERE 1=1 $conditional_sql\n\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t\t $additional_sql\n \");\n\t\t\t\t\t\t\t\t\t\t \n\n $results = $query->row_array(); // row array\n\n //benchmark/debug\n $this->benchmark->mark('code_end');\n $execution_time = $this->benchmark->elapsed_time('code_start', 'code_end');\n\n //debugging data\n $this->__debugging(__line__, __function__, $execution_time, __class__, $results);\n //----------sql & benchmarking end----------\n\n //return results\n return $results;\n\n }", "public function get_data_statement_of_changes_in_equity($data_filter){\n $from_date = date('Y-01-01');\n $to_date = date('Y-m-d');\n\n if(isset($data_filter['from_date'])){\n $from_date = to_sql_date($data_filter['from_date']);\n }\n\n if(isset($data_filter['to_date'])){\n $to_date = to_sql_date($data_filter['to_date']);\n }\n\n $account_type_details = $this->get_account_type_details();\n $data_report = [];\n $data_total = [];\n $data_accounts = [];\n \n foreach ($account_type_details as $key => $value) {\n if($value['account_type_id'] == 10){\n $data_accounts['owner_equity'][] = $value;\n }\n }\n\n foreach ($data_accounts as $data_key => $data_account) {\n $data_report[$data_key] = [];\n $total = 0;\n foreach ($data_account as $key => $value) {\n $this->db->where('active', 1);\n $this->db->where('account_detail_type_id', $value['id']);\n $accounts = $this->db->get(db_prefix().'acc_accounts')->result_array();\n foreach ($accounts as $val) {\n $this->db->select('sum(credit) as credit, sum(debit) as debit');\n $this->db->where('(date >= \"' . $from_date . '\" and date <= \"' . $to_date . '\")');\n $this->db->where('account', $val['id']);\n $account_history = $this->db->get(db_prefix().'acc_account_history')->row();\n $credits = $account_history->credit != '' ? $account_history->credit : 0;\n $debits = $account_history->debit != '' ? $account_history->debit : 0;\n $name = $val['name'] != '' ? $val['name'] : _l($val['key_name']);\n \n $data_report[$data_key][] = ['account_detail_type_id' => $value['id'], 'name' => $name, 'amount' => $credits - $debits];\n $total += $credits - $debits;\n\n }\n }\n $data_total[$data_key] = $total;\n }\n\n return ['data' => $data_report, 'total' => $data_total, 'from_date' => $from_date, 'to_date' => $to_date];\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the parents of the specified item. If type is not given all parents are returned.
public function getItemEParents($names, $type=null) { if (empty($names)) return array(); $owner = $this->getOwner(); if(is_string($names)) $condition = 'child='.$owner->db->quoteValue($names); else if(is_array($names)) { foreach($names as &$name) $name = $owner->db->quoteValue($name); $condition = 'child IN ('.implode(', ',$names).')'; } $condition .= " AND name=parent"; if (is_int($type)) $condition .= " AND type=$type"; $sql="SELECT name, type, description, bizrule, data FROM {$owner->itemTable}, {$owner->itemChildTable} WHERE $condition ORDER BY type DESC, name"; return $this->itemsFromSql($owner, $sql); }
[ "public function getItemEParents($type=null) {\r\n\t\treturn $this->_item->getEParents($type);\t\t\r\n\t}", "final public static function getParentTypesFor($itemType)\n {\n $itemType = trim($itemType);\n if (!$itemType) {\n //sanity check, return empty array since expects to always return array\n return array();\n }\n\n //make sure the types are loaded\n self::loadTypes();\n\n //make sure the requested item is real\n if (!isset(self::$orderTypes[$itemType])) {\n //can't tell what the parent types are if item type not known\n return array();\n }\n\n //all of the parent types will be set in there, if that key is set.\n return self::$orderTypes[$itemType]['parents'];\n }", "public function getParentsOfType($parentType)\n {\n $parents = array();\n\n $parentNode = $this->parent;\n while (is_object($parentNode)) {\n if ($parentNode instanceof $parentType) {\n array_unshift($parents, $parentNode);\n }\n $parentNode = $parentNode->getParent();\n }\n return $parents;\n }", "public function ParentOf($item)\n {\n return $item->GetParent();\n }", "public static function getParentTypes()\n {\n //for \"parent\" order item, returne empty string.\n\n return array('classified','auction','job_posting');\n }", "public function\tgetParents() {\n $cast = $this;\n do {\n $par = $cast->par;\n if (!empty($par))\n\t$parents[] = $par;\n $cast = $cast->par;\n } while (!empty($par));\n if (empty($parents))\n return $parents;\n return array_reverse($parents);\n }", "public static function getOrderItemFromParent($parent, $item_type)\n {\n if (!is_object($parent)) {\n $parent = intval($parent);\n if ($parent) {\n $parent = geoOrderItem::getOrderItem($parent);\n }\n //if still not object\n if (!is_object($parent)) {\n //no parent, no item to get.\n return null;\n }\n }\n\n if ($parent->getType() == $item_type) {\n return ($parent);\n }\n if (!is_object($parent->getOrder())) {\n return null;\n }\n //order keeps track of items attached to order\n $order = $parent->getOrder();\n $items = $order->getItem($item_type);\n if (is_array($items)) {\n foreach ($items as $i => $val) {\n if (is_object($val) && is_object($val->getParent())) {\n $p = $val->getParent();\n if ($p->getId() == $parent->getId()) {\n //parent is equal to parent, so whoohoo, we found it...\n return ($val);\n }\n }\n }\n }\n //so sad, item not found :(\n return null;\n }", "public function getAncestors($item)\n {\n // get all the items that link TO $item\n $items = $this->getLinkedItems($item, 'to');\n \n $out = new ArrayObject();\n $out = $items;\n foreach ($items as $parent) {\n $grandParents = $this->getAncestors($parent);\n foreach ($grandParents as $gp) {\n $out[] = $gp;\n }\n }\n\n return $out;\n }", "public function getParentNames($itemName);", "public function getParents()\n {\n return $this->newQuery()->parents()->get();\n }", "public function getAllParents();", "public function getParents()\n {\n $parents = array();\n for ($x = $this; $x['id_parent'] != null; $x = $x->getParent()) {\n array_unshift($parents, $x);\n }\n\n return $parents; //TODO find cycles in structure?\n }", "public static function parents()\n {\n return self::whereRaw('(parent_id is NULL OR parent_id = 0)')\n ->orderBy('title')\n ->get();\n }", "static public function get_node_parent_by_type( $node, $type = '' ) {\n\t\t// Get node object if node ID set\n\t\tif ( ! is_object( $node ) ) {\n\t\t\t$node = self::get_node( $node );\n\t\t}\n\n\t\t// Return early if no node object found or node has no parent\n\t\tif ( empty( $node ) || empty( $node->parent ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Helper array of parent types and their categories for each node type\n\t\t$parent_types = array(\n\t\t\t'module' => array(\n\t\t\t\t'type' => 'column',\n\t\t\t\t'category' => 'columns',\n\t\t\t),\n\t\t\t'column' => array(\n\t\t\t\t'type' => 'column-group',\n\t\t\t\t'category' => 'groups',\n\t\t\t),\n\t\t\t'column-group' => array(\n\t\t\t\t'type' => 'row',\n\t\t\t\t'category' => 'rows',\n\t\t\t),\n\t\t);\n\n\t\t// Helper array of node type hierarchies\n\t\t$hierarchy = array(\n\t\t\t'module' => 10,\n\t\t\t'column' => 20,\n\t\t\t'column-group' => 30,\n\t\t\t'row' => 40,\n\t\t);\n\n\t\t// Set immediate parent type of the node when:\n\t\t// - type is not of allowed types\n\t\t// - type is the same as node type\n\t\t// - type is lower in hierarchy than the node type\n\t\tif ( ! in_array( $type, array_keys( $hierarchy ) ) || $type == $node->type || $hierarchy[ $parent_types[ $node->type ]['type'] ] > $hierarchy[ $type ] ) {\n\t\t\t$type = $parent_types[ $node->type ]['type'];\n\t\t}\n\n\t\t// Get all layout nodes, categorized\n\t\t$nodes = array_filter( self::get_categorized_nodes() );\n\n\t\t// Null out the output initially\n\t\t$output = '';\n\n\t\t// Parse layout nodes to get the correct output\n\t\tif ( ! empty( $nodes ) ) {\n\t\t\twhile ( empty( $output ) ) {\n\t\t\t\tif ( ! empty( $node->parent ) && isset( $nodes[ $parent_types[ $node->type ]['category'] ] ) ) {\n\n\t\t\t\t\t$break_while = true;\n\n\t\t\t\t\tforeach ( $nodes[ $parent_types[ $node->type ]['category'] ] as $parent ) {\n\t\t\t\t\t\tif ( $parent->node == $node->parent ) {\n\n\t\t\t\t\t\t\t$break_while = false;\n\n\t\t\t\t\t\t\tif ( $parent_types[ $node->type ]['type'] == $type ) {\n\t\t\t\t\t\t\t\t// We have got the type we wanted! Set the output and break from while and foreach loops.\n\t\t\t\t\t\t\t\t$output = $parent;\n\t\t\t\t\t\t\t\tbreak; // From foreach\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// We now need node parents to crawl the tree\n\t\t\t\t\t\t\t$node = $parent;\n\t\t\t\t\t\t\tbreak; // From foreach\n\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// If we get this far without changing $break_while, something is wrong\n\t\t\t\t\tif ( $break_while ) {\n\t\t\t\t\t\tbreak; // From while\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tbreak; // From while\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $output;\n\t}", "public function getParents();", "function getCategoriesForItemType(\\ItemType $itemType);", "public function get_parents() {\n\t\t$list = [];\n\t\t$temp = $this;\n\t\tfor ($i = 0; $i < 100 && $temp->parent_category; $i++) {\n\t\t\t$list[] = $temp->parent_category;\n\t\t\t$temp = $temp->parent_category;\n\t\t}\n\t\treturn $list;\n\t}", "private function getAuthItemParentsRecursive($itemName, $items, $direct)\n\t{\n\t\t$parents = array();\n\t\tforeach( $items as $childName=>$children )\n\t\t{\n\t\t \tif( $children!==array() )\n\t\t \t{\n\t\t \t\tif( isset($children[ $itemName ]) )\n\t\t \t\t{\n\t\t \t\t\tif( isset($parents[ $childName ])===false )\n\t\t \t\t\t\t$parents[ $childName ] = $childName;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t \t\t\tif( ($p = $this->getAuthItemParentsRecursive($itemName, $children, $direct))!==array() )\n\t\t \t\t\t{\n\t\t \t\t\t\tif( $direct===false && isset($parents[ $childName ])===false )\n\t\t \t\t\t\t\t$parents[ $childName ] = $childName;\n\n\t\t \t\t\t\t$parents = array_merge($parents, $p);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $parents;\n\t}", "public function getParents() {\n return $this->parents;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Test adding an or where clause to the relation.
public function testOrWhere() { $this->mockSelect->shouldReceive('columns')->once()->with('r.*')->andReturnSelf(); $this->mockSelect->shouldReceive('from')->once()->with('related', 'r')->andReturnSelf(); $this->mockSelect->shouldReceive('where')->once()->with('r.foreign_key', '=', 5)->andReturnSelf(); $this->mockSelect->shouldReceive('orWhere')->once()->with('column', '!=', 'value'); $relation = (new DummyRelationship($this->entity))->has(RelationshipTestRelated::class, 'r', 'foreign_key'); $this->assertEquals($relation, $relation->orWhere('column', '!=', 'value')); }
[ "public function orWhere($clause);", "public function orWhere();", "public function orWhere($cond);", "public function testUpdateWhereOr()\n {\n $connection = $this->getQueryBuilderConnection();\n\n $statement = $connection\n ->update('querybuilder_tests')\n ->set(['field' => 'asdf'])\n ->where('id', '=', 1)\n ->whereOr('id', '=', 2)\n ->execute();\n\n $this->assertInstanceOf(\\PDOStatement::class, $statement);\n $this->assertEquals(2, $statement->rowCount());\n\n $result = $connection\n ->select()\n ->from('querybuilder_tests')\n ->where('id', '=', 1)\n ->whereOr('id', '=', 2)\n ->getList('field');\n\n $this->assertEquals(['asdf', 'asdf'], $result);\n }", "public function testOrWhereExpression(): void\n {\n $this->builder->shouldReceive('whereExpression')\n ->with('(field == 1)', 'or')\n ->once()\n ->andReturn($this->builder);\n\n $response = $this->builder->orWhereExpression('(field == 1)');\n\n $this->assertEquals($this->builder, $response);\n }", "public function whereOR()\n {\n $this->where_clause .= \" OR \";\n }", "#[@test]\n public function nestedOrQuery() {\n $this->assertEquals(\n 'column = \"empty\" or (otherColumn = \"value\" or anotherColumn = \"value\")',\n $this->fixture\n ->addOr(create(new JiraQueryCriteria('otherColumn', 'value', JiraQueryOp::$EQUALS))\n ->addOr('anotherColumn', 'value', JiraQueryOp::$EQUALS)\n )\n ->getQuery()\n );\n }", "function db_or() {\n return new DatabaseCondition('OR');\n}", "public function testOrWhereColumn()\n {\n $this->mockSelect->shouldReceive('columns')->once()->with('r.*')->andReturnSelf();\n $this->mockSelect->shouldReceive('from')->once()->with('related', 'r')->andReturnSelf();\n $this->mockSelect->shouldReceive('where')->once()->with('r.foreign_key', '=', 5)->andReturnSelf();\n\n $this->mockSelect->shouldReceive('orWhereColumn')->once()->with('column', '!=', 'value');\n\n $relation = (new DummyRelationship($this->entity))->has(RelationshipTestRelated::class, 'r', 'foreign_key');\n $this->assertEquals($relation, $relation->orWhereColumn('column', '!=', 'value'));\n }", "public function testOrWhereRaw()\n {\n $this->mockSelect->shouldReceive('columns')->once()->with('r.*')->andReturnSelf();\n $this->mockSelect->shouldReceive('from')->once()->with('related', 'r')->andReturnSelf();\n $this->mockSelect->shouldReceive('where')->once()->with('r.foreign_key', '=', 5)->andReturnSelf();\n\n $this->mockSelect->shouldReceive('orWhereRaw')->once()->with('column', '!=', 'value');\n\n $relation = (new DummyRelationship($this->entity))->has(RelationshipTestRelated::class, 'r', 'foreign_key');\n $this->assertEquals($relation, $relation->orWhereRaw('column', '!=', 'value'));\n }", "public function orWhere($cond, array $bind = []);", "public function testSelectWithOrWhere()\n {\n $runSelectQuery = self::$builder->table('authors')\n ->fields(\n ['first_name', 'last_name']\n )\n ->where(['first_name', '=', 'Tony'])\n ->orWhere(['last_name', '=', 'Walker'])\n ->select()\n ->run();\n\n $getSelectQuery = self::$builder->table('authors')\n ->fields(\n ['first_name', 'last_name']\n )\n ->where(['first_name', '=', 'Tony'])\n ->orWhere(['last_name', '=', 'Walker'])\n ->select()\n ->getQuery();\n\n $this->assertEquals(\n count($runSelectQuery),\n 2\n );\n\n $this->assertEquals(\n \"SELECT first_name, last_name FROM authors WHERE first_name = 'Tony' OR last_name = 'Walker'\",\n $getSelectQuery\n );\n }", "public function orWhere($column, $operator = '', $value = '');", "public function orWhere($column, $value, $operator = '=');", "private function containsOr()\n {\n if (!$this->wheres) {\n return false;\n }\n\n return in_array('or', array_pluck($this->wheres, 'boolean'));\n }", "public function testOrRule()\n {\n $rule = $this->getRuleBuilder()->fromArray(array(\n 'false',\n 'true'\n ), 'or');\n $this->assertTrue($rule->validate());\n\n $rule = $this->getRuleBuilder()->fromArray(array(\n 'false',\n 'false'\n ), 'or');\n $this->assertFalse($rule->validate());\n }", "public function testOrEvaluatorReturnsTrueWhenAnyOneConditionEvaluatesTrue()\n {\n $this->assertTrue(\n $this->conditionTreeEvaluator->evaluate(\n ['or', $this->conditionA, $this->conditionB],\n $this->getLeafEvaluator(false, true)\n )\n );\n }", "public function db_or()\n {\n return db_or();\n }", "public function has_or_relation()\n {\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
constructor/conexion El constructor inicializa la conexion a base de datos y inicializa la fecha, hora.
function __construct() { $this->db= new db(); date_default_timezone_set('America/Bogota'); $this->fecha= date("d-m-Y"); $this->hora = date("h:i:s a"); }
[ "public function __construct() \r\n {\r\n \t$this->con = new cConexion();\r\n\t\t$this->tabla = \"postgrado\";\r\n }", "public function __construct()\n {\n $this->conexion = Conexion::conectar();\n }", "public function __construct()\n { // langsung connect ke class databasenya.\n $this->db = new Database(); // instansiasi kelas database.\n }", "function __construct() {\n $this->codigo = null;\n\t\t$this->nome = null;\n\t\t$this->senha = null;\n\t\t$this->cpf = null;\n\t\t$this->planoDeSaude = null;\n\t\t$this->genero = null;\n\t\t$this->tipoSanguineo = null;\n\t\t$this->dtNascimento = null;\n\t\t$this->endereco = null;\n\t\t$this->telefone = null;\n\t\t$this->email = null;\n\t\t$this->reg_date = null;\n\t\t$this->semEspaco = false;\n\t\t$this->tablePathPaciente = $_SERVER['DOCUMENT_ROOT'].\"/BancoDeDados/db/tPaciente.xml\";\n }", "public function __construct(){\n\t\t$this->idAdjuntos = \"\";\n $this->nombre_archivo = \"\";\n\t\t$this->url = \"\";\n\t\t$this->fecha_vencimiento = \"NULL\";\n $this->etiqueta=\"NULL\";\n $this->observaciones=\"NULL\";\n\t\n }", "function __construct() {\n\t\t\t$conexion = new Conexion(APPBD, APP);\n\t\t\t$this->entidad = $conexion->doctrineORM();\n\t\t}", "public function __construct(){\n // Llamando la conexion a la base de datos\n $this->db = Conexion::connect();\n // Declarando houses como un array para almacenar datos\n $this->houses = array();\n }", "public function __construct() {\r\n $this->conn = ConnectDataBase::conectaBD();\r\n }", "public function __construct(){\n // spusti session pro spravu prihlaseni uzivatele\n session_start();\n // importuje funkce pro praci s databazi\n include_once(\"Databaze.class.php\");\n $this->db = new Databaze();\n }", "function __construct(){\n // se definen los datos del servidor de base de datos\n $conection['server']=\"localhost\"; //host\n $conection['user']=\"root\"; // usuario\n $conection['pass']=\"admin\"; //password\n $conection['base']=\"INNSADB\"; //base de datos\n\n // crea la conexion pasandole el servidor , usuario y clave\n $conect= mysql_connect($conection['server'],$conection['user'],$conection['pass']);\n mysql_set_charset('utf8',$conect);\n\n if ($conect) {// si la conexion fue exitosa , selecciona la base\n mysql_select_db($conection['base']);\n $this->con=$conect;\n }\n\n }", "function __construct() {\r\n\t\t$this->connBanco = new Db();\r\n\t}", "function __construct()\n\n\t\t{\n\n\t\t\t//conecta ao banco\n\n\t\t\t$this->connect();\n\n\t\t}", "function __construct() {\n $this->codigo = null;\n\t\t$this->titulo = null;\n\t\t$this->descricao = null;\n\t\t$this->genero = null;\n\t\t$this->ano = null;\n\t\t$this->avaliacao = null;\n\t\t$this->diretor = null;\n\t\t$this->elenco = null;\n\t\t$this->reg_date = null;\n\t\t$this->semEspaco = false;\n\t\t//$this->tablePathFilme = $_SERVER['DOCUMENT_ROOT'].\"/Database/db/tFilme.xml\";\n\t\t$this->tablePathFilme = \"../db/tFilme.xml\";\n }", "public function __construct() {\n $this->db = Database::conectar();\n }", "function __construct()\n {\n $this->giornoPrenotazione = date_create();\n parent::__construct();\n }", "public function __construct()\n {\n $this->inicializar();\n $this->executar();\n }", "public function __construct(){\n $this->conn = new \\PDO(\"mysql:host=camposwebsolutions.com.br;dbname=camposwe_vabcorretora\", \"camposwe_boss\", \"nicolas1408\");\n }", "public function __construct()\n {\n// $this->datumTerug = new \\DateTime('now');\n }", "public function __construct() {\n parent::__construct('127.0.0.1', '1151178', '1871', 'control_polizas', 3306);\n if (mysqli_connect_errno()) {\n printf(\"Falló la conexión: %s\\n\", mysqli_connect_error());\n exit();\n }\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns an instance of the LoaderOptions
public function getOptions() { if (null === $this->options) { $this->options = new PhpArrayLoaderOptions(); } return $this->options; }
[ "public function getLoaderOptions()\n {\n return $this->loaderOptions;\n }", "public function getLoader(): Loader\n {\n return $this->loader;\n }", "protected function getLoader()\n {\n // Construct object for loading cover images if it does not already exist:\n if (!$this->loader) {\n $cacheDir = $this->getCacheDir();\n $this->loader = new Loader(\n $this->getConfig(),\n $this->getServiceLocator()->get('VuFind\\ContentCoversPluginManager'),\n $this->getServiceLocator()->get('VuFindTheme\\ThemeInfo'),\n $this->getServiceLocator()->get('VuFind\\Http')->createClient(),\n $cacheDir\n );\n \\VuFind\\ServiceManager\\Initializer::initInstance(\n $this->loader, $this->getServiceLocator()\n );\n }\n return $this->loader;\n }", "protected function getConsoleOptionLoader()\n {\n return $this->consoleOptionLoader;\n }", "public function getLoader() {\n return $this->loader;\n }", "protected function getLoader()\n {\n return $this->loader;\n }", "public function getLoader()\n {\n return $this->_loader;\n }", "protected function getConfigLoader()\n\t{\n\t\treturn new FileLoader(new Filesystem, $this->defaultPath);\n\t}", "public function getConfigurationLoader()\n {\n return $this->configurationLoader;\n }", "protected function getLoader()\n {\n if (!$this->loader) {\n $this->loader = new PHPConfigurationLoader();\n }\n\n return $this->loader;\n }", "public function getLoader()\n {\n return $this->loader;\n }", "protected function getLoader()\n {\n // Construct object for loading cover images if it does not already exist:\n if (!$this->loader) {\n //wie gehen wir mit dem cache Manager um??\n $cacheDir = $this->getServiceLocator()->get('Resources\\CacheManager')\n ->getCache('cover')->getOptions()->getCacheDir();\n\n //I think we don't need the ThemeInfo Type for our purposes\n $this->loader = new Loader(\n $this->getConfig(),\n $this->getServiceLocator()->get('Resources\\ContentCoversPluginManager'),\n //$this->getServiceLocator()->get('VuFindTheme\\ThemeInfo'),\n $this->getServiceLocator()->get('VuFind\\Http')->createClient(),\n $cacheDir\n );\n //Initializers are not necessary - an assumption\n //\\VuFind\\ServiceManager\\Initializer::initInstance(\n // $this->loader, $this->getServiceLocator()\n //);\n }\n return $this->loader;\n }", "public function loadOptions()\n {\n }", "protected function getConfigLoader()\n {\n if (null === $this->configLoader) {\n $this->configLoader = new ConfigLoader($this->getPath() . '/resources/config');\n }\n\n return $this->configLoader;\n }", "public function Loader() {\n if (self::$instance == null)\n self::$instance = new self();\n return self::$instance;\n }", "public function getConfigLoader()\n\t{\n\t\treturn new FileLoader(new Filesystem, $this['path'].'/config');\n\t}", "public function getConfigLoader()\n {\n return new FileLoader(new Filesystem(), $this['path'] . '/config');\n }", "public function getLoaderContext(): LoaderContext\n {\n return $this->loaderContext;\n }", "protected function getFeatures_LoaderService()\n {\n $class = $this->getParameter('features.loader.class');\n $instance = new $class($this->getParameter('features.path'), $this->getParameter('container'));\n\n return $instance;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ Gets the public 'DiContainerBenchmarks\Fixture\Class2' autowired service.
protected function getClass2Service() { return new \DiContainerBenchmarks\Fixture\Class2(new \DiContainerBenchmarks\Fixture\Class1()); }
[ "protected function getFixtureB2Service()\n {\n return $this->services['DiContainerBenchmarks\\\\Fixture\\\\B\\\\FixtureB2'] = new \\DiContainerBenchmarks\\Fixture\\B\\FixtureB2();\n }", "protected function getClass1Service()\n {\n return new \\DiContainerBenchmarks\\Fixture\\Class1();\n }", "protected function getClass1Service()\n {\n return $this->services['class1'] = new \\DiContainerBenchmarks\\Fixture\\Class1();\n }", "protected function getFixtureB642Service()\n {\n return $this->services['DiContainerBenchmarks\\\\Fixture\\\\B\\\\FixtureB642'] = new \\DiContainerBenchmarks\\Fixture\\B\\FixtureB642();\n }", "protected function getFixtureB1Service()\n {\n return $this->services['DiContainerBenchmarks\\\\Fixture\\\\B\\\\FixtureB1'] = new \\DiContainerBenchmarks\\Fixture\\B\\FixtureB1();\n }", "protected function getFixtureB182Service()\n {\n return $this->services['DiContainerBenchmarks\\\\Fixture\\\\B\\\\FixtureB182'] = new \\DiContainerBenchmarks\\Fixture\\B\\FixtureB182();\n }", "protected function getFixtureB322Service()\n {\n return $this->services['DiContainerBenchmarks\\\\Fixture\\\\B\\\\FixtureB322'] = new \\DiContainerBenchmarks\\Fixture\\B\\FixtureB322();\n }", "protected function getClass82Service()\n {\n return new \\DiContainerBenchmarks\\Fixture\\Class82(new \\DiContainerBenchmarks\\Fixture\\Class81(new \\DiContainerBenchmarks\\Fixture\\Class80(new \\DiContainerBenchmarks\\Fixture\\Class79(new \\DiContainerBenchmarks\\Fixture\\Class78(new \\DiContainerBenchmarks\\Fixture\\Class77(new \\DiContainerBenchmarks\\Fixture\\Class76(new \\DiContainerBenchmarks\\Fixture\\Class75(new \\DiContainerBenchmarks\\Fixture\\Class74(new \\DiContainerBenchmarks\\Fixture\\Class73(new \\DiContainerBenchmarks\\Fixture\\Class72(new \\DiContainerBenchmarks\\Fixture\\Class71(new \\DiContainerBenchmarks\\Fixture\\Class70(new \\DiContainerBenchmarks\\Fixture\\Class69(new \\DiContainerBenchmarks\\Fixture\\Class68(new \\DiContainerBenchmarks\\Fixture\\Class67(new \\DiContainerBenchmarks\\Fixture\\Class66(new \\DiContainerBenchmarks\\Fixture\\Class65(new \\DiContainerBenchmarks\\Fixture\\Class64(new \\DiContainerBenchmarks\\Fixture\\Class63(new \\DiContainerBenchmarks\\Fixture\\Class62(new \\DiContainerBenchmarks\\Fixture\\Class61(new \\DiContainerBenchmarks\\Fixture\\Class60(new \\DiContainerBenchmarks\\Fixture\\Class59(new \\DiContainerBenchmarks\\Fixture\\Class58(new \\DiContainerBenchmarks\\Fixture\\Class57(new \\DiContainerBenchmarks\\Fixture\\Class56(new \\DiContainerBenchmarks\\Fixture\\Class55(new \\DiContainerBenchmarks\\Fixture\\Class54(new \\DiContainerBenchmarks\\Fixture\\Class53(new \\DiContainerBenchmarks\\Fixture\\Class52(new \\DiContainerBenchmarks\\Fixture\\Class51(new \\DiContainerBenchmarks\\Fixture\\Class50(new \\DiContainerBenchmarks\\Fixture\\Class49(new \\DiContainerBenchmarks\\Fixture\\Class48(new \\DiContainerBenchmarks\\Fixture\\Class47(new \\DiContainerBenchmarks\\Fixture\\Class46(new \\DiContainerBenchmarks\\Fixture\\Class45(new \\DiContainerBenchmarks\\Fixture\\Class44(new \\DiContainerBenchmarks\\Fixture\\Class43(new \\DiContainerBenchmarks\\Fixture\\Class42(new \\DiContainerBenchmarks\\Fixture\\Class41(new \\DiContainerBenchmarks\\Fixture\\Class40(new \\DiContainerBenchmarks\\Fixture\\Class39(new \\DiContainerBenchmarks\\Fixture\\Class38(new \\DiContainerBenchmarks\\Fixture\\Class37(new \\DiContainerBenchmarks\\Fixture\\Class36(new \\DiContainerBenchmarks\\Fixture\\Class35(new \\DiContainerBenchmarks\\Fixture\\Class34(new \\DiContainerBenchmarks\\Fixture\\Class33(new \\DiContainerBenchmarks\\Fixture\\Class32(new \\DiContainerBenchmarks\\Fixture\\Class31(new \\DiContainerBenchmarks\\Fixture\\Class30(new \\DiContainerBenchmarks\\Fixture\\Class29(new \\DiContainerBenchmarks\\Fixture\\Class28(new \\DiContainerBenchmarks\\Fixture\\Class27(new \\DiContainerBenchmarks\\Fixture\\Class26(new \\DiContainerBenchmarks\\Fixture\\Class25(new \\DiContainerBenchmarks\\Fixture\\Class24(new \\DiContainerBenchmarks\\Fixture\\Class23(new \\DiContainerBenchmarks\\Fixture\\Class22(new \\DiContainerBenchmarks\\Fixture\\Class21(new \\DiContainerBenchmarks\\Fixture\\Class20(new \\DiContainerBenchmarks\\Fixture\\Class19(new \\DiContainerBenchmarks\\Fixture\\Class18(new \\DiContainerBenchmarks\\Fixture\\Class17(new \\DiContainerBenchmarks\\Fixture\\Class16(new \\DiContainerBenchmarks\\Fixture\\Class15(new \\DiContainerBenchmarks\\Fixture\\Class14(new \\DiContainerBenchmarks\\Fixture\\Class13(new \\DiContainerBenchmarks\\Fixture\\Class12(new \\DiContainerBenchmarks\\Fixture\\Class11(new \\DiContainerBenchmarks\\Fixture\\Class10(new \\DiContainerBenchmarks\\Fixture\\Class9(new \\DiContainerBenchmarks\\Fixture\\Class8(new \\DiContainerBenchmarks\\Fixture\\Class7(new \\DiContainerBenchmarks\\Fixture\\Class6(new \\DiContainerBenchmarks\\Fixture\\Class5(new \\DiContainerBenchmarks\\Fixture\\Class4(new \\DiContainerBenchmarks\\Fixture\\Class3(new \\DiContainerBenchmarks\\Fixture\\Class2(new \\DiContainerBenchmarks\\Fixture\\Class1())))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))));\n }", "protected function getFixtureB321Service()\n {\n return $this->services['DiContainerBenchmarks\\\\Fixture\\\\B\\\\FixtureB321'] = new \\DiContainerBenchmarks\\Fixture\\B\\FixtureB321();\n }", "protected function getFixtureB242Service()\n {\n return $this->services['DiContainerBenchmarks\\\\Fixture\\\\B\\\\FixtureB242'] = new \\DiContainerBenchmarks\\Fixture\\B\\FixtureB242();\n }", "protected function getFixtureB279Service()\n {\n return $this->services['DiContainerBenchmarks\\\\Fixture\\\\B\\\\FixtureB279'] = new \\DiContainerBenchmarks\\Fixture\\B\\FixtureB279();\n }", "protected function getFixtureB653Service()\n {\n return $this->services['DiContainerBenchmarks\\\\Fixture\\\\B\\\\FixtureB653'] = new \\DiContainerBenchmarks\\Fixture\\B\\FixtureB653();\n }", "protected function getFixtureB654Service()\n {\n return $this->services['DiContainerBenchmarks\\\\Fixture\\\\B\\\\FixtureB654'] = new \\DiContainerBenchmarks\\Fixture\\B\\FixtureB654();\n }", "protected function getFixtureB342Service()\n {\n return $this->services['DiContainerBenchmarks\\\\Fixture\\\\B\\\\FixtureB342'] = new \\DiContainerBenchmarks\\Fixture\\B\\FixtureB342();\n }", "protected function getFixtureB473Service()\n {\n return $this->services['DiContainerBenchmarks\\\\Fixture\\\\B\\\\FixtureB473'] = new \\DiContainerBenchmarks\\Fixture\\B\\FixtureB473();\n }", "protected function getFixtureB474Service()\n {\n return $this->services['DiContainerBenchmarks\\\\Fixture\\\\B\\\\FixtureB474'] = new \\DiContainerBenchmarks\\Fixture\\B\\FixtureB474();\n }", "protected function getFixtureB520Service()\n {\n return $this->services['DiContainerBenchmarks\\\\Fixture\\\\B\\\\FixtureB520'] = new \\DiContainerBenchmarks\\Fixture\\B\\FixtureB520();\n }", "protected function getFixtureB877Service()\n {\n return $this->services['DiContainerBenchmarks\\\\Fixture\\\\B\\\\FixtureB877'] = new \\DiContainerBenchmarks\\Fixture\\B\\FixtureB877();\n }", "protected function getFixtureB742Service()\n {\n return $this->services['DiContainerBenchmarks\\\\Fixture\\\\B\\\\FixtureB742'] = new \\DiContainerBenchmarks\\Fixture\\B\\FixtureB742();\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
end testShouldCompareAdverts() Should compare adverts with bad addresses
public function testShouldCompareAdvertsWithBadAddresses() { $advert = new SimpleXMLElement(file_get_contents(__DIR__ . "/datasets/adverts/comparing/bad/1.xml")); $comparing = new Comparing($advert); $testdata = []; $expected = [ "2" => true, "3" => false, "4" => true, "5" => false, ]; for ($i = 2; $i <= 5; $i++) { $testdata[] = array( "advert" => new Advert(new SimpleXMLElement(file_get_contents(__DIR__ . "/datasets/adverts/comparing/bad/" . $i . ".xml"))), "expected" => $expected[$i], ); } //end for foreach ($testdata as $data) { $this->assertEquals($data["expected"], $comparing->compare($data["advert"])); } //end foreach }
[ "function commerce_avatax_address_compare($original, $validated_address) {\n $result = array(\n 'result' => '',\n 'msg' => '',\n 'suggestions' => array(),\n );\n\n // If the address couldn't be validated, stop there.\n if (!$validated_address) {\n $result['result'] = 'invalid';\n $result['msg'] = '<p>' . t('We could not validate the shipping address entered. Please check that you have entered the correct address.') . '</p>';\n $result['msg'] .= '<p>' . t('Entered address is:') . '</p>' . theme('commerce_avatax_address', array('address' => $original));\n return $result;\n }\n\n // Map the response back to Addressfield names.\n $address_mapping = commerce_avatax_address_fields_mapping(TRUE);\n $correct_address = array();\n $address_mismatch = FALSE;\n\n // Create an array of field keys to compare.\n $keys_to_compare = drupal_map_assoc(array(\n 'thoroughfare',\n 'premise',\n 'locality',\n 'administrative_area',\n 'country',\n ));\n\n foreach ($validated_address as $key => $value) {\n if (!isset($address_mapping[$key])) {\n continue;\n }\n $correct_key = $address_mapping[$key];\n $correct_address[$correct_key] = $value;\n\n // Compare the user entered address & the validated address.\n if (isset($keys_to_compare[$correct_key]) && $correct_address[$correct_key] != $original[$correct_key]) {\n $address_mismatch = TRUE;\n }\n }\n\n // Validate the postal code.\n $post_code_full_validation = variable_get(COMMERCE_AVATAX_VAR_PREFIX . 'address_postal_code', TRUE);\n $autocomplete_post_code = variable_get(COMMERCE_AVATAX_VAR_PREFIX . 'autocomplete_postal_code', TRUE);\n $validated_postal_code = $correct_address['postal_code'];\n $original_postal_code = $original['postal_code'];\n if (!$post_code_full_validation || $autocomplete_post_code) {\n $validated_postal_code = substr($validated_postal_code, 0, 5);\n $original_postal_code = substr($original_postal_code, 0, 5);\n }\n $postal_code = $validated_postal_code == $original_postal_code;\n $suggestions = array($correct_address);\n\n if ($address_mismatch || !$postal_code) {\n $result['result'] = 'needs_correction';\n $form = drupal_get_form('commerce_avatax_address_suggestion_form', $original, $suggestions);\n $result['msg'] = drupal_render($form);\n $result['suggestions'] = $suggestions;\n }\n else {\n $result['result'] = 'valid';\n $result['msg'] = '';\n $result['suggestions'] = $suggestions;\n }\n\n return $result;\n}", "public function testCheckAddress() {\n\t$this->assertTrue(Bitcoin::checkAddress(\"1pA14Ga5dtzA1fbeFRS74Ri32dQjkdKe5\"));\n\t$this->assertTrue(Bitcoin::checkAddress(\"1MU97wyf7msCVdaapneW2dW1uXP7oEQsFA\"));\n\t$this->assertTrue(Bitcoin::checkAddress(\"1F417eczAAbh41V4oLGNf3DqXLY72hsM73\"));\n\t$this->assertTrue(Bitcoin::checkAddress(\"1ASgNrpNNejRJVfqK2jHmfJ3ZQnMSUJkwJ\"));\n\t$this->assertFalse(Bitcoin::checkAddress(\"1ASgNrpNNejRJVfqK2jHmfJ3ZQnMSUJ\"));\n\t$this->assertFalse(Bitcoin::checkAddress(\"1111111fnord\"));\n\t}", "public function testShouldGetGeoLocationOfObjectAddress()\n\t {\n\t\t$xml = new SimpleXMLElement(file_get_contents(__DIR__ . \"/datasets/adverts/a.xml\"));\n\t\t$advert = new Advert($xml);\n\n\t\t$advert->getGeoLocation();\n\t\t$this->assertRegExp(\"/[0-9]{1,2}\\.[0-9]{1,2}\\.[0-9]{4}/ui\", $advert->date);\n\t\t$advert->createXML();\n\t\t$this->assertEquals(104.360772, $advert->lat);\n\t\t$this->assertEquals(52.250526, $advert->lang);\n\n\t\t$expectedxml = new SimpleXMLElement(file_get_contents(__DIR__ . \"/datasets/adverts/b.xml\"));\n\t\t$advertxml = new SimpleXMLElement($advert->doc->saveXML());\n\t\t$props = [\"country\", \"region\", \"city\", \"address\", \"lat\", \"lang\", \"description\", \"price\", \"phone\", \"link\", \"rooms\", \"area\", \"name\", \"comission\", \"floor\", \"floors\"];\n\t\tforeach ($props as $prop)\n\t\t {\n\t\t\tif (empty($advertxml->$prop) === false && empty($expectedxml) === false)\n\t\t\t {\n\t\t\t\t$this->assertEquals($expectedxml->$prop, $advertxml->$prop);\n\t\t\t } //end if\n\n\t\t } //end foreach\n\n\t }", "public function testShouldClassifyAdverts()\n\t {\n\t\t$advert = new SimpleXMLElement(file_get_contents(__DIR__ . \"/datasets/adverts/classify/1.xml\"));\n\n\t\t$classify = new Classify($advert);\n\t\t$result = $classify->classify();\n\n\t\t$this->assertEquals(\"agency\", $result[\"person\"]);\n\t\t$this->assertEquals(0, $result[\"total_score\"]);\n\t }", "function testVerifyAddressFail1() {\n\t\t//use the override class, so that qas_query(), etc. don't run. we'll test them later ^_^\n\t\t$this->verifyProcess = New testVerifyAddress;\n\n\t\t//what we'll pretend qas_query() has returned\n\t\t$this->verifyProcess->qas_query_return = \"\";\n\t\t//what we'll pretend get_qas_check_code() has returned\n\t\t$this->verifyProcess->get_qas_check_code_return = array(array(\"SQUIGGLE BOP\", \"EXTRA DATA\"), \"R123\");\n\t\t//what we'll pretend disect_verified_address() has returned\n\t\t$this->verifyProcess->disect_verified_address_return = array(\"address\" => \"EXTRA DATA\\nSQUIGGLE BOP\");\n\t\t\n\t\t//get the model override class, so we can pretend we have a database\n\t\t$this->verifyProcess->verify_model = New testVerifyAddressModel;\n\t\t//this will be set to true if cant_verify() is called\n\t\t$this->verifyProcess->verify_model->cant_verify_called = false;\n\t\t//this will be set to true if can_verify() is called\n\t\t$this->verifyProcess->verify_model->can_verify_called = false;\n\t\t\n\t\t//get testing\n\t\t$this->verifyProcess->verify_address(\"EXTRA DATA, SQUIGGLE BOP\");\n\t\t\n\t\t//can_verify() should have been called\n\t\tassert($this->verifyProcess->verify_model->cant_verify_called === true);\n\t\t//can_verify() SHOULD NOT have been called\n\t\tassert($this->verifyProcess->verify_model->can_verify_called === false);\n\n\t\t//verification_successful counter SHOULD NOT have been incremented\n\t\tassert(is_integer($this->verifyProcess->verification_successful));\n\t\tassert($this->verifyProcess->verification_successful === 0);\n\n\t\t//verification_failed counter should have been incremented\n\t\tassert(is_integer($this->verifyProcess->verification_failed));\n\t\tassert($this->verifyProcess->verification_failed > 0);\n\t}", "public function testFindLeads()\n {\n\n }", "public function testInsertAd()\n {\n $client = static::createClient(array(\n 'environment' => 'test',\n ));\n $client->followRedirects(false);\n $entityManager = $client->getContainer()->get('doctrine')->getEntityManager();\n // for the empty database, inserted ad has to have the id number 1\n $row = $entityManager->getRepository('AdItemsBundle:Ads')->getOneAd($this->adId, false);\n // now compare the database values with inserted ones\n $areTheSame = false;\n $badField = '';\n if(isset($row['id_ad']))\n {\n // get form fields values too\n $formFields = $entityManager->getRepository('AdItemsBundle:AdsFormFields')->getFieldsByAd($this->adId, $row['id_ca']);\n foreach($formFields as $f => $field)\n {\n $row[$field['codeName']] = $field['fieldValue'];\n }\n $tags = $entityManager->getRepository('AdItemsBundle:AdsTags')->getTagsByAd($this->adId);\n $restTags = 0;\n foreach($tags as $t => $tag)\n {\n $i = $t + 1;\n $row['tag'.$i] = $tag['tagName'];\n $restTags++;\n }\n for($i = ($restTags+1); $i < 11; $i++)\n {\n $row['tag'.$i] = '';\n }\n $payments = $entityManager->getRepository('AdItemsBundle:AdsPayments')->getPaymentsByAd($this->adId);\n foreach($payments as $p => $payment)\n {\n $row['adPayments'][(int)$payment['payments_id_pa']] = (int)$payment['payments_id_pa'];\n }\n $row['adCountry'] = (int)$row['id_co'];\n $row['adCity'] = (int)$row['id_ci'];\n $row['adCategory'] = (int)$row['id_ca'];\n $row['adTax'] = Tax::getTaxByValue((float)$row['adTax']);\n// TODO : validate adValidity too\nunset($this->addAd['AddAd']['adValidity']);\nunset($this->addAd['AddAd']['adAtHomePage']);\n $areTheSame = true;\n foreach($this->addAd['AddAd'] as $k => $value)\n {\n if($value != $row[$k])\n {\n// DEBUG MODE echo $value.'-------'.$row[$k].'------'.$k;\n $areTheSame = false;\n $badField = $k;\n break;\n }\n }\n }\n $this->assertTrue($areTheSame, 'Bad filled field value for field '.$badField);\n }", "public function testShouldCheckMatchStrings()\n\t {\n\t\t$addresses = [\n\t\t \"1\" => array(\n\t\t\t \"a\" => \"им Героя Советского Союза В.В.Вильского, 8\",\n\t\t\t \"b\" => \"Вильского, 8\",\n\t\t\t \"exp\" => true,\n\t\t\t ),\n\t\t \"2\" => array(\n\t\t\t \"a\" => \"Александра Невского, 15\",\n\t\t\t \"b\" => \"М. Конева, 15\",\n\t\t\t \"exp\" => false,\n\t\t\t ),\n\t\t \"3\" => array(\n\t\t\t \"a\" => \"\",\n\t\t\t \"b\" => \"\",\n\t\t\t \"exp\" => false,\n\t\t\t ),\n\t\t];\n\n\t\tforeach ($addresses as $expected => $data)\n\t\t {\n\t\t\t$comparison = new Comparison($data[\"a\"], $data[\"b\"]);\n\t\t\t$this->assertEquals($data[\"exp\"], $comparison->match);\n\t\t }\n\n\t }", "public function testCollectionAddressReturnFalse(){\n $this->assertFalse($this->_consignment->getCollectionAddress(), 'Consignment should be returning false');\n }", "function testCheckURLsInvalid3()\n {\n $strictness = Services_Trackback::STRICTNESS_HIGH;\n\n $url1 = \"http://www.example.com/trackback/index.php\";\n $url2 = \"http://www.example.com/trackback/index.htm\";\n\n try {\n $this->trackback->checkURLs($url1, $url2, $strictness);\n \n $this->fail(\"Expected exception\");\n } catch (Services_Trackback_Exception $ste) {}\n }", "public function testValidatePaymentStringAlternateAccounts() {\n $paymentString = \"SPD*1.0*ACC:CZ3155000000001043006511+RBCZ66*ALT-ACC:CZ3155000000001043006511+RBCZ66,CZ3155000000001043006511+RBCZ66,CZ3155000000001043006511+RBCZ66\";\n $result = SpaydValidator::validatePaymentString($paymentString);\n // 0 error is expected\n Assert::null($result);\n }", "private function checkSameAddresses() {\n\t\t$geodata = unserialize($this->geocache);\n\t\tif (is_array($geodata)) {\n\t\t\t$allOk = TRUE;\n\t\t\tif (count($geodata) <> count($this->addresses)) {\n\t\t\t\t$allOk = FALSE;\n }\n\t\t\tforeach($geodata as $k=>$v) {\n\t\t\t\tif(trim($this->addresses[$k]) <> $v['cacheAddress']) {\n\t\t\t\t\t$allOk = FALSE;\n }\n\t\t\t\tif($v['geoData']['lon'] == 0 && $v['geoData']['lat'] == 0) {\n\t\t\t\t\t$allOk = FALSE;\n }\n\t\t\t}\n\t\t\tif (!$allOk) {\n\t\t\t\t$this->getNewGeoData();\n }\n\t\t} else {\n\t\t\t$this->getNewGeoData();\n }\n\t}", "function CheckAdresses( $aad )\r\n\t\t{\r\n//echo \"CheckAdress: \";echo is_array($aad)==1?\"table\":\"Ntable\";echo \"<br>\";\r\n\t\tif( is_array( $aad ) )\r\n\t\t\t{\r\n\t\t\tfor( $i=0; $i< sizeof( $aad ); $i++ )\r\n\t\t\t\t{\r\n\t\t\t\t$res = $this->ValidEmail( $aad[ $i ], $this );\r\n\t\t\t\tif( $res == false )\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t} \r\n\t\t\t}\r\n\t\telse\r\n\t\t\t$res = $this->ValidEmail( $aad, $this );\r\n\t\tif( ! $res )\r\n\t\t\t{\r\n\t\t\t$this->errNum = ERR_ADRESSE_INVALIDE;\r\n\t\t\t$this->errMsg = $aad;\r\n\t\t\t}\r\n\t\treturn $res;\r\n\t\t}", "public function testOneAdvert()\n {\n $client = new Client();\n $response = $client->request('GET', 'localhost:8000/adverts/10');\n\n $this->assertSame($response->getStatusCode(), 200);\n }", "#[@test]\n public function differentIPsShouldBeDifferent() {\n $this->assertNotEquals(new Inet6Address('::1'), new Inet6Address('::fe08'));\n }", "public function testThrowExceptionOnInvalidDashAddress()\n {\n $this->expectException(Exceptions\\InvalidAddressFormatException::class);\n Wallet::validate(self::INVALID_ADDRESS, Wallet::DASH);\n }", "function testVerifyAddressFail4() {\n\t\t//use the override class, so that qas_query(), etc. don't run. we'll test them later ^_^\n\t\t$this->verifyProcess = New testVerifyAddress;\n\n\t\t//what we'll pretend qas_query() has returned\n\t\t$this->verifyProcess->qas_query_return = \"R123\\n\\n\";\n\t\t//what we'll pretend get_qas_check_code() has returned\n\t\t$this->verifyProcess->get_qas_check_code_return = array(array(\"\", \"\"), \"R123\");\n\t\t//what we'll pretend disect_verified_address() has returned\n\t\t$this->verifyProcess->disect_verified_address_return = array(\"address\" => \"\\n\");\n\t\t\n\t\t//get the model override class, so we can pretend we have a database\n\t\t$this->verifyProcess->verify_model = New testVerifyAddressModel;\n\t\t//this will be set to true if cant_verify() is called\n\t\t$this->verifyProcess->verify_model->cant_verify_called = false;\n\t\t//this will be set to true if can_verify() is called\n\t\t$this->verifyProcess->verify_model->can_verify_called = false;\n\t\t\n\t\t//get testing\n\t\t$this->verifyProcess->verify_address(\"EXTRA DATA, SQUIGGLE BOP\");\n\t\t\n\t\t//can_verify() should have been called\n\t\tassert($this->verifyProcess->verify_model->cant_verify_called === true);\n\t\t//can_verify() SHOULD NOT have been called\n\t\tassert($this->verifyProcess->verify_model->can_verify_called === false);\n\n\t\t//verification_successful counter SHOULD NOT have been incremented\n\t\tassert(is_integer($this->verifyProcess->verification_successful));\n\t\tassert($this->verifyProcess->verification_successful === 0);\n\n\t\t//verification_failed counter should have been incremented\n\t\tassert(is_integer($this->verifyProcess->verification_failed));\n\t\tassert($this->verifyProcess->verification_failed > 0);\n\t}", "public function testReserved() {\n $validator = new \\alexeevdv\\ip\\Validator([\n \"allowReserved\" => false,\n ]);\n \n $bad = [\n \"0.0.0.0\",\n \"0.1.2.3\",\n \"169.254.0.0\",\n \"169.254.3.64\",\n \"192.0.2.6\",\n \"224.56.110.25\", \n ];\n \n foreach($bad as $ip) {\n $this->assertFalse($validator->validate($ip), $ip);\n } \n }", "public function testGetLeads()\n {\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ function hangoutRequestDetailsAction return hangoutRequestDetailsview param null
public function hangoutRequestDetailsAction(Request $request, $token) { if (isset($token)) { $hangId = Core::decodeIdAction($token); $message = Hangouts::select('hangouts.*', 'users.name', 'users.profileimage') ->join('users', function($sql) { $sql->on('users.id', 'hangouts.sender_id'); $sql->orOn('users.id', 'hangouts.receiver_id'); }) ->where('hangouts.id', $hangId) ->orderBy('hangouts.id', 'asc') ->first()->toArray(); if ($message['sender_id'] == Auth::user()->id) { $user = User::find($message['receiver_id'])->toArray(); } else { $user = User::find($message['sender_id'])->toArray(); } return view('profile::hangout_request')->with(['user' => $user, 'hangout' => $message, 'my' => Auth::user()->id, 'token' => $token]); } else { return redirect('hangout'); } }
[ "public function responseAction()/*{{{*/\n {\n $post = Mage::app()->getRequest()->getParams();\n #echo '<pre>'.print_r($post, 1).'</pre>';\n\n Mage::log(\"Heidelpay - responseAction: post\");\n Mage::log($post);\n $returnvalue = '';\n if (isset($post['PROCESSING_RESULT'])) $returnvalue = $post['PROCESSING_RESULT'];\n if ($returnvalue){\n $shortid = $orderId = $uniqueid = $authType = $statusCode = $processReturn = $frontendCancel = $payCode = $custId = '';\n $accBrand = $accExpMonth = $accExpYear = $accHolder = $accNumber = $accBank = $actPM = '';\n $conAccCountry = $conAccHolder = $conAccNumber = $conAccBank = $conAccBic = $conAccIban = $presAmount = $presCurrency = $pm = '';\n if (isset($post['IDENTIFICATION_SHORTID']))\t\t\t\t\t$shortid\t\t\t\t= $post['IDENTIFICATION_SHORTID'];\n if (isset($post['IDENTIFICATION_TRANSACTIONID'])) \t\t$orderId\t\t\t\t= $post['IDENTIFICATION_TRANSACTIONID'];\n if (isset($post['IDENTIFICATION_UNIQUEID']))\t\t\t\t$uniqueid\t\t\t\t= $post['IDENTIFICATION_UNIQUEID'];\n if (isset($post['AUTHENTICATION_TYPE']))\t\t\t\t\t$authType\t\t\t\t= $post['AUTHENTICATION_TYPE'];\n if (isset($post['PROCESSING_STATUS_CODE']))\t\t\t$statusCode\t\t\t= $post['PROCESSING_STATUS_CODE'];\n if (isset($post['PROCESSING_RETURN'])) \t\t$processReturn\t\t= $post['PROCESSING_RETURN'];\n if (isset($post['FRONTEND_REQUEST_CANCELLED'])) $frontendCancel\t= $post['FRONTEND_REQUEST_CANCELLED'];\n if (isset($post['PAYMENT_CODE']))\t\t\t\t\t\t\t\t$payCode\t\t\t\t= $post['PAYMENT_CODE'];\n if (isset($post['ACCOUNT_BRAND']))\t\t\t\t\t\t\t\t$accBrand\t\t\t= $post['ACCOUNT_BRAND'];\n if (isset($post['ACCOUNT_EXPIRY_MONTH']))\t\t\t\t$accExpMonth\t\t= $post['ACCOUNT_EXPIRY_MONTH'];\n if (isset($post['ACCOUNT_EXPIRY_YEAR']))\t\t\t\t\t$accExpYear\t\t= $post['ACCOUNT_EXPIRY_YEAR'];\n if (isset($post['ACCOUNT_HOLDER']))\t\t\t\t\t\t\t$accHolder\t\t\t= $post['ACCOUNT_HOLDER'];\n if (isset($post['ACCOUNT_NUMBER']))\t\t\t\t\t\t\t$accNumber\t\t\t= $post['ACCOUNT_NUMBER'];\n if (isset($post['ACCOUNT_BANK']))\t\t\t\t\t\t\t\t$accBank\t\t\t\t= $post['ACCOUNT_BANK'];\n if (isset($post['CONNECTOR_ACCOUNT_COUNTRY']))\t$conAccCountry\t= $post['CONNECTOR_ACCOUNT_COUNTRY'];\n if (isset($post['CONNECTOR_ACCOUNT_HOLDER']))\t\t$conAccHolder\t\t= $post['CONNECTOR_ACCOUNT_HOLDER'];\n if (isset($post['CONNECTOR_ACCOUNT_NUMBER']))\t$conAccNumber\t= $post['CONNECTOR_ACCOUNT_NUMBER'];\n if (isset($post['CONNECTOR_ACCOUNT_BANK']))\t\t\t$conAccBank\t\t= $post['CONNECTOR_ACCOUNT_BANK'];\n if (isset($post['CONNECTOR_ACCOUNT_BIC']))\t\t\t\t$conAccBic\t\t\t= $post['CONNECTOR_ACCOUNT_BIC'];\n if (isset($post['CONNECTOR_ACCOUNT_IBAN']))\t\t\t$conAccIban\t\t\t= $post['CONNECTOR_ACCOUNT_IBAN'];\n if (isset($post['PRESENTATION_AMOUNT']))\t\t\t\t\t$presAmount\t\t\t= $post['PRESENTATION_AMOUNT'];\n if (isset($post['PRESENTATION_CURRENCY']))\t\t\t\t$presCurrency\t\t= $post['PRESENTATION_CURRENCY'];\n if (isset($post['CRITERION_PAYMETHOD']))\t\t\t\t\t$pm\t\t\t\t\t\t= $post['CRITERION_PAYMETHOD'];\n if (isset($post['actPM'])) \t\t\t\t\t\t$actPM\t\t\t\t\t= $post['actPM']; \n\n $invoiceMailComment = 'Short ID: '.$shortid; \n\n // PNO Meldung Special Hack bei PROCESSING.RETURN.CODE=100.400.110\n $returnCode = '';\n if (isset($post['PROCESSING_RETURN_CODE'])) $returnCode = $post['PROCESSING_RETURN_CODE'];\n if (strpos($returnCode, '100.400.110') !== false){\n $processReturn = $this->_getHelper('heidelpay')->__('HP_PNO_ERROR');\n }\n\n // Order ID extrahieren\n if (strpos($orderId, '-') !== false){\n $parts = explode('-', $orderId);\n $orderId = $parts[0];\n $custId = $parts[1];\n }\n\n // Order Object\n $order = $this->getOrder();\n if (!empty($orderId)){\n $order->loadByIncrementId($orderId);\n // Payment Object # Change 25.05.2012\n if ($order->getPayment() !== false){\n \t$payment = $order->getPayment()->getMethodInstance();\n } else {\n \t$payment = $this->getHPPayment();\n }\n #echo '<pre>'.print_r($payment, 1).'</pre>';\n }\n\n if ($payCode == 'IV.PA' && $post['ACCOUNT_BRAND'] == 'BILLSAFE'){\n\t $repl = array(\n '{AMOUNT}' => $post['CRITERION_BILLSAFE_AMOUNT'], \n '{CURRENCY}' => $post['CRITERION_BILLSAFE_CURRENCY'], \n '{ACC_OWNER}' => $post['CRITERION_BILLSAFE_RECIPIENT'], \n '{ACC_BANKNAME}' => $post['CRITERION_BILLSAFE_BANKNAME'], \n '{ACC_NUMBER}' => $post['CRITERION_BILLSAFE_ACCOUNTNUMBER'], \n '{ACC_BANKCODE}' => $post['CRITERION_BILLSAFE_BANKCODE'],\n '{ACC_BIC}' => $post['CRITERION_BILLSAFE_BIC'], \n '{ACC_IBAN}' => $post['CRITERION_BILLSAFE_IBAN'], \n '{SHORTID}' => $post['CRITERION_BILLSAFE_REFERENCE'],\n '{LEGALNOTE}' => $post['CRITERION_BILLSAFE_LEGALNOTE'],\n '{NOTE}' \t\t=> $post['CRITERION_BILLSAFE_NOTE'],\n );\n\n $locale = explode('_', Mage::app()->getLocale()->getLocaleCode());\n if (is_array($locale) && ! empty($locale))\n $language = $locale[0];\n else\n $language = $this->getDefaultLocale();\n\n define('HP_SUCCESS_BILLSAFE', $this->_getHelper('heidelpay')->__('HP_SUCCESS_BILLSAFE'));\n\n $bsData = strtr(HP_SUCCESS_BILLSAFE, $repl);\n $bsData.= ' '.$post['CRITERION_BILLSAFE_LEGALNOTE'].' ';\n //$bsData.= substr($post['CRITERION_BILLSAFE_NOTE'], 0, strlen($post['CRITERION_BILLSAFE_NOTE'])-11).' '.date('d.m.Y', mktime(0,0,0,date('m'),date('d')+$post['CRITERION_BILLSAFE_PERIOD'],date('Y'))).'.';\n $bsData.= preg_replace('/{DAYS}/', $post['CRITERION_BILLSAFE_PERIOD'], $this->_getHelper('heidelpay')->__('HP_LEGALNOTE_BILLSAFE'));\n $bsData = nl2br(htmlentities($bsData));\n $invoiceMailComment = $bsData;\n $order->setCustomerNote($bsData);\n $order->save();\n }\n\n $params = '';\n $prePaidData = '';\n // Vorkasse Sonderkrams\n if ($payCode == 'PP.PA'){\n $params.= '&pcode='.$payCode.'&';\n foreach($this->importantPPFields AS $k => $v){\n if (isset($post[$v])) $params.= $v.'='.$post[$v].'&';\n }\n $repl = array(\n '{AMOUNT}' => $presAmount, \n '{CURRENCY}' => $presCurrency, \n '{ACC_COUNTRY}' => $conAccCountry, \n '{ACC_OWNER}' => $conAccHolder, \n '{ACC_NUMBER}' => $conAccNumber, \n '{ACC_BANKCODE}' => $conAccBank,\n '{ACC_BIC}' => $conAccBic, \n '{ACC_IBAN}' => $conAccIban, \n '{SHORTID}' => $shortid,\n );\n\n $locale = explode('_', Mage::app()->getLocale()->getLocaleCode());\n if (is_array($locale) && ! empty($locale))\n $language = $locale[0];\n else\n $language = $this->getDefaultLocale();\n\n define('HP_SUCCESS_PREPAID', $this->_getHelper('heidelpay')->__('HP_SUCCESS_PREPAID'));\n\n $prePaidData = strtr(HP_SUCCESS_PREPAID, $repl);\n $invoiceMailComment = $prePaidData;\n }\n\n // Wenn die OT Zahlung nicht erfolgreich war, dann gespeicherte Kontodaten l�schen\n if (!strstr($returnvalue,\"ACK\") && strpos($payCode, 'OT') !== false){\n \tif ($custId != \"\"){\n \t\t$customer = Mage::getModel('customer/customer')->load($custId);\n \t\tif ($customer->getEmail() != \"\"){\n \t\t\tMage::log(\"Heidelpay - responseAction: customer->save() \" . $custId . \", \" . $customer->getEmail());\n \t\t\t$customer->setHeidelpayLastBlz($accBank);\n \t\t\t$customer->setHeidelpayLastKto($accNumber);\n \t\t\t$customer->setHeidelpayLastHolder($accHolder);\n \t\t\t$customer->save();\n \t\t}\n \t}\n }\n\n #echo '<pre>'.print_r($order, 1).'</pre>'; exit();\n if (strstr($returnvalue,\"ACK\")) {\n if (strpos($payCode, 'RG') !== false){\n # Register\n } else {\n if (!empty($orderId)){\n // fill order\n\t\t\tif ($order->canInvoice()) {\n\t\t\t\ttry {\n\t\t\t\t\t$invoice = Mage::getModel('sales/service_order', $order)->prepareInvoice();\n\t\t\t\t\tif (!$invoice->getTotalQty()) {\n\t\t\t\t\t\tMage::throwException(Mage::helper('core')->__('Cannot create an invoice without products.'));\n\t\t\t\t\t}\n\t\t\t\t\t$invoice->setRequestedCaptureCase(Mage_Sales_Model_Order_Invoice::CAPTURE_ONLINE);\n\t\t\t\t\t$invoice->register();\n\t\t\t\t\t$transactionSave = Mage::getModel('core/resource_transaction')\n\t\t\t\t\t\t->addObject($invoice)\n\t\t\t\t\t\t->addObject($invoice->getOrder())\n\t\t\t\t\t\t->save();\n\t\t\t\t\tif ($this->_invoiceOrderEmail) $invoice->sendEmail(true, $invoiceMailComment); // Rechnung versenden\n\t\t\t\t}\n\t\t\t\tcatch (Mage_Core_Exception $e) {\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n \tMage::log(\"Heidelpay - responseAction: order->setState \" .$payment->getPaymentState());\n $order->setState($payment->getPaymentState());\n $order->addStatusToHistory($payment->getPaymentState(), 'Short ID: '.$shortid.' '.$invoiceMailComment, $order->getCustomerNoteNotify());\n if (strpos($payCode, 'PA') !== false){ # Nur bei PA speichern.\n // TransID f�r PIXI speichern\n $order->getPayment()->setLastTransId($uniqueid);\n }\n // $order->getPayment()->registerCaptureNotification($presAmount);\n $order->setCustomerNote($invoiceMailComment); // Kommentar auch in EMail\n $order->save();\n }\n }\n if ($statusCode == '90' && $authType == '3DSecure'){\n #print $base.\"/index.php/default/Heidelpay/payment/afterThreeDSecure/\"; \n echo Mage::getUrl('heidelpay/payment/afterThreeDSecure/', array('_secure' => true));\n } else {\n if (strpos($payCode, 'RG') !== false){\n #echo '<pre>Custid: '.print_r($custId, 1).'</pre>';\n if ($custId > 0){\n $customer = Mage::getModel('customer/customer')->load($custId);\n #echo '<pre>'.print_r($customer, 1).'</pre>';\n if (strpos($payCode, 'OT') !== false){\n $customer->setHeidelpayLastBlz($accBank);\n $customer->setHeidelpayLastKto($accNumber);\n $customer->setHeidelpayLastHolder($accHolder);\n }\n if (strpos($payCode, 'CC') !== false){\n if (strpos($actPM, 'XC') !== false){\n $customer->setHeidelpayXcardUniqueId($uniqueid);\n $customer->setHeidelpayXcardPaymentType($payCode);\n $customer->setHeidelpayXcard($accNumber);\n $customer->setHeidelpayXcardValidUntil($accExpMonth.' / '.$accExpYear);\n $customer->setHeidelpayXcardBrand($accBrand);\n $customer->setHeidelpayXcardHolder($accHolder);\n } else {\n $customer->setHeidelpayCcardUniqueId($uniqueid);\n $customer->setHeidelpayCcardPaymentType($payCode);\n $customer->setHeidelpayCcard($accNumber);\n $customer->setHeidelpayCcardValidUntil($accExpMonth.' / '.$accExpYear);\n $customer->setHeidelpayCcardBrand($accBrand);\n $customer->setHeidelpayCcardHolder($accHolder);\n }\n }\n if (strpos($payCode, 'DC') !== false){\n $customer->setHeidelpayDcardUniqueId($uniqueid);\n $customer->setHeidelpayDcardPaymentType($payCode);\n $customer->setHeidelpayDcard($accNumber);\n $customer->setHeidelpayDcardValidUntil($accExpMonth.' / '.$accExpYear);\n $customer->setHeidelpayDcardBrand($accBrand);\n $customer->setHeidelpayDcardHolder($accHolder);\n }\n $customer->save();\n }\n echo Mage::getUrl('heidelpay/payment/afterRegister/', array('_secure' => true)).'?uniqueId='.$uniqueid;\n } else {\n echo Mage::getUrl('heidelpay/payment/success/', array('_secure' => true)).'?uniqueId='.$uniqueid.$params;\n }\n }\n } else if ($frontendCancel == 'true'){\n if (!empty($orderId)){\n $order->setState($payment->getCancelState());\n $order->addStatusToHistory($payment->getCancelState(), 'Cancelled by User', $order->getCustomerNoteNotify());\n $order->save();\n }\n // Bei CC und DC nur bei DIRECT die CANCEL Methode nutzen.\n //if (!empty($orderId) && (strpos($payCode, 'CC') !== false || strpos($payCode, 'DC') !== false) && $payment->getConfigData('bookingmode') == 'DIRECT'){\n if ((strpos($payCode, 'CC') !== false || strpos($payCode, 'XC') !== false || strpos($payCode, 'DC') !== false)){\n print Mage::getUrl('heidelpay/payment/cancel/', array('_secure' => true, 'error' => 'Cancelled by User')).\"?pc=\".$payCode;\n } else {\n print Mage::getUrl('checkout/onepage/', array('_secure' => true));\n }\n } else {\n if (!empty($orderId)){\n $order->setState($payment->getErrorState());\n $order->addStatusToHistory($payment->getErrorState(), utf8_encode($processReturn), $order->getCustomerNoteNotify());\n $order->save();\n }\n if ($processReturn == 'Canceled by user'){\n print Mage::getUrl('checkout/onepage/', array('_secure' => true));\n } else {\n if(strpos($payCode, 'CC')!==false || strpos($payCode, 'XC')!==false || strpos($payCode, 'DC')!==false){\n \t$isIframe = 1;\n \tMage::log(\"Heidelpay - responseAction: \".$payCode.\" Zahlung mit Fehlercode \" . $processReturn .\", \" . $this->getSession()->getData('hp_iframe_opened'));\n } else {\n \t$isIframe = 0;\n }\n print Mage::getUrl('heidelpay/payment/error/', array('_secure' => true)).'?error='.urlencode($processReturn).\"&isiframe=\".$isIframe.\"&pc=\".$payCode;\n }\n }\n } else {\n echo 'FAIL';\n }\n }", "function viewingRequest(){\n\tif(isset($_POST['formData'])){\n\n\t\t//setup the request data\n\t\t$rData = array(\n\t\t\t'propertyId'=>$this->currentRef,\n\t\t\t'createdDate'=>time(),\n\t\t\t'viewingRequested'=>true,\n\t\t\t'message'=>$_POST['message'],\n\t\t\t'contactData'=>array(\n\t\t\t\t'firstName'=>$_POST['firstName'],\n\t\t\t\t'lastName'=>$_POST['lastName'],\n\t\t\t\t'tel1'=>$_POST['tel'],\n\t\t\t\t'email'=>$_POST['email'],\n\t\t\t)\n\t\t);\n\n\t\t//run the api request\n\t\t$this->api->newRequest($rData);\n\n\t\t$modalOutput = $this->processTpl('','thanks.html',array());\n\t\t//send a success message to the user\n\t\t$this->jsonEcho($modalOutput);\n\t}\n}", "function view_request_call_back($id)\n {\n $selected_lang = ($this->session->userdata('language')) ? $this->session->userdata('language') : 1;\n $data['selected_lang'] = $selected_lang;\n\n $id = decode_url($id);\n $chk_enq = $this->Custom_model->row_present_check(REQUEST_FOR_CALL, array('id'=>$id));\n if($chk_enq==FALSE){\n redirect(base_url() . 'admin/master/list_enquery');\n }\n $request_data = $this->Custom_model->fetch_data(REQUEST_FOR_CALL,\n array(REQUEST_FOR_CALL.'.*', COUNTRIES.'.id as country_id', COUNTRIES.'.nicename'),\n array(REQUEST_FOR_CALL.'.id'=>$id, REQUEST_FOR_CALL.'.language_id' => $selected_lang),\n array(COUNTRIES=>COUNTRIES.'.id='.REQUEST_FOR_CALL.'.country'));\n $data['request_for_call_data'] = array();\n if(!empty($request_data))\n $data['request_for_call_data'] = $request_data[0];//echo '<pre>';print_r($data);die;\n\n $partials = array('content' => 'view_request_call_back', 'left_menu' => 'left_menu', 'header' => 'header');\n $this->template->load('template', $partials, $data);\n }", "public function getRequestAction();", "public function upwardRequest(){\n\n }", "public function view_ON_apdetails($request_id = NULL){\n\t\t$val = $this->get_ondetails_DB($request_id);\n\t\t$on = $val[0];\n\t\t$endorser = $val[1];\n\t\t$head = $val[2];\n\t\t$tl = $val[3];\n\t\t$sv = $val[4];\n\t\t$dates = $val[5];\n\t\treturn view('on_approval_details', ['on' => $on, 'endorser' => $endorser, 'head' => $head, 'tl' => $tl, 'sv' => $sv, 'request_id' => $request_id, 'dates' => $dates]);\n\t}", "public function view_return_form_request(){\n\t\t$data['requests'] = $this->db->query('select * from return_exchange_form')->result();\n\t\t$this->load->view('admin/view_return_requests',$data);\n\t}", "public function c_get_detail_again(){\n \n }", "public function inviteresponseAction() {\n $request = $this->getRequest();\n $user= new DatabaseObject_User($this->db);\n $data=array();\n if ($user->loadByValidatedSession($request->getParam('userId'), $request->getParam('authToken'),$request->getParam('lat'),$request->getParam('lon'))){\n $fp = new FormProcessor_RespondToInvite($user,$this->config);\n $status=array();\n if ($fp->process($request)){\n $status['code']='200';\n $status['msg']=$fp->msg();\n $data['og_url']=$fp->ogURL();\n }else{\n $status['code']='300';\n $status['msg']=\"Could not respond to the invite\";\n $status['errors']=implode(\",\",$fp->getErrors());\n }\n }else{\n $status['code']='401';\n $status['msg']=\"Could not authenticate\";\n }\n $response['status']=$status;\n $response['data']=$data;\n $this->sendJson($response);\n }", "public function trusteeRequestAction(){\n $trusteeTable = new Application_Model_DbTable_Trustee();\n $userTable = new Application_Model_DbTable_Users();\n $decoded = $this->common->Decoded();\n $userSecurity = $decoded['userSecurity'];\n $userId = $decoded['userId'];\n if($userSecurity == $this->servicekey){ \n $this->common->checkEmptyParameter1(array($userId));\n $this->common->isUserLogin($decoded['userId'],$decoded['userDeviceId']);\n $userTable->updateRequestTime(\"trusteeRequestTime\",$userId);\n $trusteeRowset = $trusteeTable->getIncomingOutgoingRequest($userId);\n $trusteeData = array();\n foreach($trusteeRowset as $trusteeRow){\n $trusteeData[] = array(\n 'id' => $trusteeRow->id,\n 'trusteeId' => ($trusteeRow->user_id)?$trusteeRow->user_id:\"\",\n 'trusteeName' => ($trusteeRow->trusteeName && $trusteeRow->is_send_request)?$trusteeRow->trusteeName: ($trusteeRow->userFullName ? $trusteeRow->userFullName:\"\"),\n 'trusteeEmail' => ($trusteeRow->trusteeEmail && $trusteeRow->is_send_request)?$trusteeRow->trusteeEmail: ($trusteeRow->userEmail ?$trusteeRow->userEmail:\"\" ),\n 'trusteePhone' => ($trusteeRow->trusteePhone && $trusteeRow->is_send_request)?$trusteeRow->trusteePhone: ($trusteeRow->phoneWithCode ? $trusteeRow->phoneWithCode:\"\"),\n 'isOnline' => ($trusteeRow->isOnline)?$trusteeRow->isOnline:\"0\",\n 'lastSeenTime' => ($trusteeRow->lastSeenTime)?$trusteeRow->lastSeenTime:$trusteeRow->creationDate,\n 'is_send_request' => $trusteeRow->is_send_request,\n 'trusteeImage' => ($trusteeRow->userImage)? $this->makeUrl($trusteeRow->userImage):\"\",\n 'creationDate' => $trusteeRow->creationDate,\n 'modifyDate' => $trusteeRow->modifyDate,\n 'quickBloxId' => $trusteeRow->quickBloxId,\n );\n }\n $this->common->displayMessage(\"Incoming outgoing trustees request list\",\"0\",$trusteeData,\"0\");\n }else{\n $this->common->displayMessage(\"You could not access this web-service\",\"1\",array(),\"2\");\n }\n \n exit;\n }", "public function in_request ()\n {\n return view('blood_bank.in_patient.InRequest');\n }", "public function infoboxAction() {\n\n $request = $this->getRequest();\n $printerId = (integer) $request->getParam('printerId', null);\n \n if (!is_null($printerId)) {\n $states_history = Yourdelivery_Model_DbTable_Printer_StatesHistory::getStatesHistory($printerId);\n }\n \n $this->view->states_history = $states_history;\n }", "public function view_request()\n\t{\n\t\tif(!empty($this->session->userdata('login_id')) \n \t\t\t\t && $this->session->userdata('login') == TRUE)\n\t\t{\n\t\t\t$data = array(\n\t\t\t\t\t\t'title'\t=>\t'Employees :: Application Request',\n\t\t\t\t\t\t'get_all_request' => $this->user_model->get_all_leave_request()\n\t\t\t\t\t);\n\t\t\t$this->load->view('includes/user/session_in_dashboard');\n\t\t\t$this->load->view('includes/header/header',$data);\n\t\t\t$this->load->view('user/request');\n\t\t\t$this->load->view('includes/footer/footer');\n\t\t}\n\t\telse\n\t\t{\n\t\t\tredirect(base_url().'index');\n\t\t\texit();\n\t\t}\n\t}", "public function payoutinfoAction()\n {\n $this->_forward('payout-info', 'member');\n }", "public function DispatchRequest()\n {\n $profile = $this->GetUserProfile();\n if ($this->CheckSessionTimeout($profile)) // show timeout view\n {\n global $g_BizSystem;\n $g_BizSystem->GetSessionContext()->Destroy();\n return $this->RenderView($this->m_UserTimeoutView);\n }\n\n // ?view=...&form=...&rule=...&mode=...&...\n // ?vw=...&fm=...&rl=...&md=...&...\n $getKeys = array_keys($_GET);\n if ($getKeys[0] == \"view\") {\n $form = isset($_GET['form']) ? $_GET['form'] : \"\";\n $rule = isset($_GET['rule']) ? $_GET['rule'] : \"\";\n $hist = isset($_GET['hist']) ? $_GET['hist'] : \"\";\n $viewName = $_GET['view'];\n $params = $this->GetParameters();\n if (!$this->CheckViewAccess($viewName, $profile)) //access denied error\n return $this->RenderView($this->m_AccessDeniedView);\n return $this->RenderView($viewName,$form,$rule,$params,$hist);\n }\n\n $retval = $this->Invoke();\n\n print($retval.\" \");\n exit();\n }", "protected function _getRequest()\n\t{\n\t}", "public function detailAction() \n {\n $objTranslate = Zend_Registry::get ( PS_App_Zend_Translate ); \n $objError = new Zend_Session_Namespace ( PS_App_Error );\n $objSess = new Zend_Session_Namespace ( PS_App_Auth );\n $objRequest = $this->getRequest ();\n $this->view->siteTitle = $objTranslate->translate ( 'contractor - contract detail' );\n \n $objModel = new Models_Contract();\n $arrData = $objModel->fetchEntry($objRequest->id);\n //_pr($arrData ,1);\n \n $jobStatus = array('1'=>'active','2'=>'paused','3'=>'closed');\n $jobStatusAlert = array('1'=>'success','2'=>'warning','3'=>'danger');\n \n $jobType = array('1'=>'fixed cost job' ,'2'=>'hourly job');\n \n\t\t$this->view->message = $objError->message;\n $this->view->messageType = $objError->messageType;\n\t\t$objError->message = \"\";\n $objError->messageType = '';\n $this->view->arrData = $arrData;\n $this->view->jobStatus = $jobStatus;\n $this->view->jobStatusAlert = $jobStatusAlert;\n $this->view->jobType = $jobType;\n }", "function jobApplicantDetail_post(){\n\n $this->check_service_auth();\n $this->form_validation->set_rules('job_id', 'Job id', 'trim|required');\n $this->form_validation->set_rules('user_id', 'User id', 'trim|required');\n if($this->form_validation->run() == FALSE){\n $response = array('status' => FAIL, 'message' => preg_replace(\"/[\\\\n\\\\r]+/\", \" \",strip_tags(validation_errors())));\n $this->response($response);die();\n\n }else{\n $job_id = $this->post('job_id');\n $user_id = $this->post('user_id');\n $userId = $this->authData->userId;\n $where = array('jobId'=>$job_id,'posted_by_user_id'=>$userId);\n $jobs = $this->common_model->getsingle(JOBS,$where,$fld =NULL,$order_by = '',$order = '');\n\n if(empty($jobs)){\n\n $response = array('status' => FAIL, 'message' =>'You are not authorised for this action.');\n $this->response($response);die(); \n }\n\n $where = array('job_id'=>$job_id,'applied_by_user_id'=>$user_id);\n $jobexits = $this->common_model->getsingle(JOB_APPLICANTS,$where,$fld =NULL,$order_by = '',$order = '');\n\n if(empty($jobexits)){\n\n $response = array('status' => FAIL, 'message' =>'No data found.');\n $this->response($response);die();\n\n }else if(!empty($jobexits) AND $this->authData->userType!='business'){\n\n $response = array('status' => FAIL, 'message' =>'You are not authorised for this action.');\n $this->response($response);die();\n }else{\n\n $detail= $this->Jobs_model->get_job_applicant_detail($job_id,$user_id,$jobs->job_type);\n $response = array('status' => SUCCESS, 'message' =>200,'data'=>$detail);\n $this->response($response);die();\n }\n\n }\n\n }", "private function _getRemoteRequest(){\n return (object) array('isSuccess'=>TRUE);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns enabled currency exchange rate provider plugins, sorted by weight.
protected function getPlugins() { $plugin_ids = array_keys(array_filter($this->loadConfiguration())); $plugins = array(); foreach ($plugin_ids as $plugin_id) { $plugins[$plugin_id] = $this->currencyExchangeRateProviderManager->createInstance($plugin_id); } return $plugins; }
[ "abstract protected function getExchangeRateProviders();", "public static function getCurrencyRateModules()\n {\n $modules = [];\n $installedModules = static::getInstalledCurrencyRateModules();\n foreach ($installedModules as $moduleInfo) {\n /** @var CurrencyRateModule $module */\n $module = Module::getInstanceById($moduleInfo['id_module']);\n if (Validate::isLoadedObject($module)) {\n $modules[$module->name] = $module->getSupportedCurrencies();\n }\n }\n\n return $modules;\n }", "public function getExchangeRatesProviders();", "public function getSortedByWeight() {\n $instances = [];\n\n /** @var BlockPluginInterface $instance */\n foreach ($this as $instance) {\n $configuration = $instance->getConfiguration();\n $instances[$configuration['uuid']] = $instance;\n }\n\n uasort($instances, function (BlockPluginInterface $a, BlockPluginInterface $b) {\n $a_config = $a->getConfiguration();\n $a_weight = isset($a_config['weight']) ? $a_config['weight'] : 0;\n\n $b_config = $b->getConfiguration();\n $b_weight = isset($b_config['weight']) ? $b_config['weight'] : 0;\n\n if ($a_weight == $b_weight) {\n return strcmp($a->label(), $b->label());\n }\n\n return $a_weight > $b_weight ? 1 : -1;\n });\n\n return $instances;\n }", "public function get_enabled_currencies() {\n\t\t$enabled_currencies = $this->current_settings(self::FIELD_ENABLED_CURRENCIES);\n\t\tif(!is_array($enabled_currencies) || empty($enabled_currencies)) {\n\t\t\t// Base currency is always enabled\n\t\t\t$enabled_currencies\t= array($this->base_currency());\n\t\t}\n\t\treturn array_unique($enabled_currencies);\n\t}", "abstract public function getSupportedCurrencies();", "public static function getSupportedCurrencies(): array\n {\n return require(__DIR__ . '/currency_lib.php');\n }", "function getEnabledPlugins();", "abstract protected function getSupportedCurrencies();", "public function exchange_rates_providers_options() {\n\t\t$result = array();\n\t\tforeach($this->exchange_rates_models as $key => $properties) {\n\t\t\t$result[$key] = get_value('label', $properties);\n\t\t}\n\n\t\treturn $result;\n\t}", "public function getAvailableCurrencies(): array;", "public function get_recommended_plugins() {\n\t\t$plugins = get_transient( self::RECOMMENDED_PLUGINS_TRANSIENT );\n\n\t\tif ( false === $plugins ) {\n\t\t\t$request = wp_remote_get( 'https://woocommerce.com/wp-json/wccom/marketing-tab/1.1/recommendations.json' );\n\t\t\t$plugins = [];\n\n\t\t\tif ( ! is_wp_error( $request ) && 200 === $request['response']['code'] ) {\n\t\t\t\t$plugins = json_decode( $request['body'], true );\n\t\t\t}\n\n\t\t\tset_transient(\n\t\t\t\tself::RECOMMENDED_PLUGINS_TRANSIENT,\n\t\t\t\t$plugins,\n\t\t\t\t// Expire transient in 15 minutes if remote get failed.\n\t\t\t\t// Cache an empty result to avoid repeated failed requests.\n\t\t\t\tempty( $plugins ) ? 900 : 3 * DAY_IN_SECONDS\n\t\t\t);\n\t\t}\n\n\t\treturn array_values( $plugins );\n\t}", "public function pluginsSorted(): array {\n $plugins = $this->plugins();\n usort($plugins, function (HiddenTabPluginBase $a, HiddenTabPluginBase $b) {\n return $a->weight() > $b->weight();\n });\n return $plugins;\n }", "public function getEnabledProviderPlugins() {\n $geocoder_plugins = $this->providerPluginManager->getPlugins();\n $plugins_settings = $this->getSetting('plugins');\n\n // Filter out unchecked plugins.\n $provider_plugin_ids = array_filter($plugins_settings, function ($plugin) {\n return isset($plugin['checked']) && $plugin['checked'] == TRUE;\n });\n\n $provider_plugin_ids = array_combine(array_keys($provider_plugin_ids), array_keys($provider_plugin_ids));\n\n foreach ($geocoder_plugins as $plugin) {\n if (isset($provider_plugin_ids[$plugin['id']])) {\n $provider_plugin_ids[$plugin['id']] = $plugin;\n }\n }\n\n return $provider_plugin_ids;\n }", "function crypton_blog_cryptocurrency_tgmpa_required_plugins($list=array()) {\n\t\tif (crypton_blog_storage_isset('required_plugins', 'cryptocurrency-prices')) {\n $path = crypton_blog_get_file_dir('plugins/cryptocurrency-prices/cryptocurrency-prices.zip');\n\t\t\t$list[] = array(\n\t\t\t\t'name' \t\t=> crypton_blog_storage_get_array('required_plugins', 'cryptocurrency-prices'),\n\t\t\t\t'slug' \t\t=> 'cryptocurrency-prices',\n 'source'\t=> !empty($path) ? $path : 'upload://cryptocurrency-prices.zip',\n\t\t\t\t'required' \t=> false\n\t\t\t);\n\t\t}\n\t\treturn $list;\n\t}", "function wpex_recommended_plugins() {\n\treturn apply_filters( 'wpex_recommended_plugins', array(\n\t\t'js_composer' => array(\n\t\t\t'name' => 'WPBakery Visual Composer',\n\t\t\t'slug' => 'js_composer',\n\t\t\t'version' => WPEX_VC_SUPPORTED_VERSION,\n\t\t\t'source' => WPEX_FRAMEWORK_DIR_URI .'plugins/js_composer.zip',\n\t\t\t'required' => false,\n\t\t\t'force_activation' => false,\n\t\t),\n\t\t'templatera' => array(\n\t\t\t'name' => 'Templatera',\n\t\t\t'slug' => 'templatera',\n\t\t\t'source' => WPEX_FRAMEWORK_DIR_URI .'plugins/templatera.zip',\n\t\t\t'version' => '1.1.12',\n\t\t\t'required' => false,\n\t\t\t'force_activation' => false,\n\t\t),\n\t\t'revslider' => array(\n\t\t\t'name' => 'Slider Revolution',\n\t\t\t'slug' => 'revslider',\n\t\t\t'version' => '5.4.3.1',\n\t\t\t'source' => WPEX_FRAMEWORK_DIR_URI .'plugins/revslider.zip',\n\t\t\t'required' => false,\n\t\t\t'force_activation' => false,\n\t\t),\n\t\t'contact-form-7' => array(\n\t\t\t'name' => 'Contact Form 7',\n\t\t\t'slug' => 'contact-form-7',\n\t\t\t'required' => false,\n\t\t\t'force_activation' => false,\n\t\t),\n\t) );\n}", "public function filterDataProviderForExchangeRates() {\n return [ \n ['From', 'USD'],\n ['To', 'EUR'],\n ['From', 'TJS'],\n ['Status', 1],\n ['Status', 0],\n ['Date', '2016-07-05'],\n ['Date', '2016-06-30'], \n ];\n }", "public function getAvailablePlugins();", "public function getEnabledProviderPlugins() {\n $geocoder_plugins = $this->providerPluginManager->getPlugins();\n $plugins_settings = isset($this->configuration['plugins']) ? $this->configuration['plugins'] : [];\n\n // Filter out unchecked plugins.\n $provider_plugin_ids = array_filter($plugins_settings, function ($plugin) {\n return isset($plugin['checked']) && $plugin['checked'] == TRUE;\n });\n\n $provider_plugin_ids = array_combine(array_keys($provider_plugin_ids), array_keys($provider_plugin_ids));\n\n foreach ($geocoder_plugins as $plugin) {\n if (isset($provider_plugin_ids[$plugin['id']])) {\n $provider_plugin_ids[$plugin['id']] = $plugin;\n }\n }\n\n return $provider_plugin_ids;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Hack: Run MakeGlobalVariablesScript for backwards compatability. The MakeGlobalVariablesScript hook was added to MediaWiki 1.14 in revision 38397:
private static function MGVS_hack( &$script ) { global $wgVersion, $IP; if (version_compare($wgVersion, '1.14.0', '<')) { $script = ""; $vars = array(); wfRunHooks('MakeGlobalVariablesScript', array(&$vars)); foreach( $vars as $name => $value ) { $script .= "\t\tvar $name = " . json_encode($value) . ";\n"; } return true; } return false; }
[ "function fiorello_mikado_get_global_variables() {\n\t\t$global_variables = array();\n\n\t\t$global_variables['mkdfAddForAdminBar'] = is_admin_bar_showing() ? 32 : 0;\n\t\t$global_variables['mkdfElementAppearAmount'] = -100;\n\t\t$global_variables['mkdfAjaxUrl'] = esc_url( admin_url( 'admin-ajax.php' ) );\n\n\t\t$global_variables = apply_filters( 'fiorello_mikado_filter_js_global_variables', $global_variables );\n\n\t\twp_localize_script( 'fiorello-mikado-modules', 'mkdfGlobalVars', array(\n\t\t\t'vars' => $global_variables\n\t\t) );\n\t}", "function globalVars()\n{\n $result = [];\n\n //define php superglobals, will be skipped\n $skip = [\n 'GLOBALS',\n '_ENV',\n 'HTTP_ENV_VARS',\n '_POST',\n 'HTTP_POST_VARS',\n '_GET',\n 'HTTP_GET_VARS',\n '_COOKIE',\n 'HTTP_COOKIE_VARS',\n '_SERVER',\n 'HTTP_SERVER_VARS',\n '_FILES',\n 'HTTP_POST_FILES',\n '_REQUEST',\n 'HTTP_SESSION_VARS',\n '_SESSION',\n 'mobile_detect',\n 'content',\n ];\n\n //define specified user variables, will be replaced by simple string\n $long_vars = ['page_content' => ['content', 'page_text'], 'page_text'];\n foreach ($GLOBALS as $k => $v) {\n //skip superglobals\n if ( ! in_array($k, $skip)) {\n\n //replaced content of the user vars\n if (in_array($k, $long_vars)) {\n foreach ($long_vars as $sk => $sv) {\n if (is_array($sv)) {\n foreach ($sv as $k1 => $v1) {\n $result[$sk][$v1] = 'debug: disabled content';\n }\n } else {\n $result[$sv] = 'debug: disabled content';\n }\n }\n } else {\n $result[$k] = $v;\n }\n }\n }\n\n return $result;\n}", "function bp_setup_globals() {\n\tdo_action( 'bp_setup_globals' );\n}", "function thaw() {\r\n \r\n $vals = $this->that->ac_get_value($this->id, $this->name);\r\n \r\n $GLOBALS[$this->vars_array] = unserialize($vals);\r\n \r\n if ($this->register_globals && is_array ($GLOBALS[$this->vars_array]) ) {\r\n \r\n reset ($GLOBALS[$this->vars_array]);\r\n while (list ($k, $v) = each ($GLOBALS[$this->vars_array])) {\r\n $GLOBALS[$k] = $v;\r\n $GLOBALS[$this->vars_array][$k] =& $GLOBALS[$k]; // change the entry in user vars array, so it is now a reference pointing to a global variable. \r\n }\r\n \r\n }\r\n \r\n }", "protected function _applyGlobalVars() \n {\n $this->view->getEnvironment()->share('g', $this->output->cfg('globals'));\n }", "function mkglobal($vars) {\n\tif (!is_array($vars))\n\t$vars = explode(\":\", $vars);\n\tforeach ($vars as $v) {\n\t\tif (isset($_GET[$v]))\n\t\t$GLOBALS[$v] = unesc($_GET[$v]);\n\t\telseif (isset($_POST[$v]))\n\t\t$GLOBALS[$v] = unesc($_POST[$v]);\n\t\telse\n\t\treturn false;\n\t}\n\treturn true;\n}", "function ajan_setup_globals() {\n\tdo_action( 'ajan_setup_globals' );\n}", "protected static function initializeGlobalVariables() {}", "private function globalVars(){\n\t\ttry {\n\t\t\t$sql = \"SELECT * FROM \".$this->dbh->p.\"settings WHERE language = \".$this->language[\"id\"];\n\t\t\t$sth = $this->dbh->query($sql);\n\t\t}\n\t\tcatch(PDOException $e) {\n\t\t\t$out = err( t(\"Ayarlar bulunamadı.\"), $e );\n\t\t\tdie(\"Sistem Hatası\");\n\t\t}\n\t\t\n\t\t$all = $sth->fetchAll();\n\t\t$array = array();\n\t\t\n\t\tforeach ($all as $row) {\n\t\t\t$array[$row[\"db\"]] = $row[\"value$row[type]\"];\n\t\t}\n\t\t\t\t\n\t\t$this->globals = $array;\n\t\n\t}", "private function set_global_variable( $core ) {\n\t\t\tif ( ! empty( $core->args['global_variable'] ) ) {\n\t\t\t\t$options_global = $core->args['global_variable'];\n\n\t\t\t\t/**\n\t\t\t\t * filter 'redux/options/{opt_name}/global_variable'\n\t\t\t\t *\n\t\t\t\t * @param array $value option value to set global_variable with\n\t\t\t\t */\n\n\t\t\t\t// phpcs:ignore WordPress.NamingConventions.ValidHookName\n\t\t\t\t$GLOBALS[ $options_global ] = apply_filters( \"redux/options/{$core->args['opt_name']}/global_variable\", $core->options );\n\n\t\t\t\t// Last save key.\n\t\t\t\tif ( isset( $core->transients['last_save'] ) ) {\n\t\t\t\t\t$GLOBALS[ $options_global ]['REDUX_LAST_SAVE'] = $core->transients['last_save'];\n\t\t\t\t}\n\n\t\t\t\t// Last compiler hook key.\n\t\t\t\tif ( isset( $core->transients['last_compiler'] ) ) {\n\t\t\t\t\t$GLOBALS[ $options_global ]['REDUX_LAST_COMPILER'] = $core->transients['last_compiler'];\n\t\t\t\t}\n\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\treturn false;\n\t\t}", "public function setUpGlobalVars()\n\t{\n\t}", "function wg_globals() {\n\tglobal $config, $wgg;\n\n\t// Reload config.xml to get any recent changes\n\t$config = parse_config(true);\n\n\t// An array of configuration paths we need\n\t$conf_paths \t= array(\n\t\t\t\t'config' => array_merge($wgg['xml_path'], array('config', 0)),\n\t\t\t\t'tunnels' => array_merge($wgg['xml_path'], array('tunnels', 'item')),\n\t\t\t\t'peers' => array_merge($wgg['xml_path'], array('peers', 'item')));\n\n\t// Need to initialize these config paths as arrays and then assign by reference to $wgg\n\tforeach ($conf_paths as $key => $path) {\n\t\twg_init_config_arr($config, $path);\n\t\t$wgg[$key] = &array_get_value($config, $path);\n\t}\n}", "private function __globalvars()\n {\n $result=array();\n $skip=array('GLOBALS','_ENV','HTTP_ENV_VARS',\n '_POST','HTTP_POST_VARS','_GET',\n 'HTTP_GET_VARS',\n '_COOKIE',\n 'HTTP_COOKIE_VARS','_SERVER',\n 'HTTP_SERVER_VARS',\n '_FILES','HTTP_POST_FILES',\n '_REQUEST','HTTP_SESSION_VARS',\n '_SESSION');\n foreach($GLOBALS as $k=>$v)\n if(!in_array($k,$skip))\n $result[$k]=$v;\n return $result;\n }", "public function unsetReservedGlobalVariables() {}", "public static function unsetReservedGlobalVariables() {}", "public static function loadGlobals()\n {\n foreach (array_keys($GLOBALS) as $key)\n {\n if (substr($key, 0, 7) == 'config_')\n {\n global $$key;\n }\n }\n \n require_once($config_atkroot.\"atk/defaultconfig.inc.php\");\n require_once($config_application_dir.\"config.inc.php\");\n require_once($config_atkroot.\"../config.php\");\n \n foreach (get_defined_vars() as $key => $value)\n {\n if (substr($key, 0, 7) == 'config_')\n {\n global $$key;\n $$key = $value;\n }\n }\n }", "function importGlobalVariable($variable)\n{ \n switch (strtolower($variable))\n { case 'server' :\n if (isset($_SERVER)) { return $_SERVER; }\n else\n { return $GLOBALS['HTTP_SERVER_VARS']; }\n break;\n/* case 'session' :\n if (isset($_SESSION)) { return $_SESSION; }\n else\n { return $GLOBALS['HTTP_SESSION_VARS']; }\n break;*/\n case 'post' :\n if (isset($_POST)) { return $_POST; }\n else\n { return $GLOBALS['HTTP_POST_VARS']; }\n break;\n case 'get' :\n if (isset($_GET)) { return $_GET; }\n else\n { return $GLOBALS['HTTP_GET_VARS']; }\n break;\n case 'cookie' :\n if (isset($_COOKIE)) { return $_COOKIE; }\n else\n { return $GLOBALS['HTTP_COOKIE_VARS']; }\n break;\n default:return null;\n break;\n }\n}", "function defineglobal()\n\t{\n\t\tglobal $template, $basic_lang, $Cl_root_path4template;\n\t\t\n\t\t// some general vars\n\t\t$template->assign_vars( array(\n\t\t\t'L_BACK' => $basic_lang[ 'Back' ],\n\t\t\t'L_RELOAD' => $basic_lang[ 'Reload' ],\n\t\t\t\n\t\t\t'L_SUBMIT' => $basic_lang[ 'Submit' ],\n\t\t\t'L_RESET' => $basic_lang[ 'Reset' ],\n\t\t\t\n\t\t\t'ROOT_PATH' => $Cl_root_path4template,\n\t\t\t'U_BACK' => $this->back_URL,\n\t\t) );\n\t}", "private function globalize_var($vars,$debug){\n \t\n \tif($debug)$this->progress .= \"<br>AR_utilities Class:globalize_var(): received vars:<pre>\".print_r($vars,true).'</pre>';\n \t\n \t$new_para = null;\n \tforeach($vars as $var){\n \t\t$v = explode('-',$var);\n \t\tif(count($v) > 1){ \t\n \t\t\t$m = null;\n \t\t\tforeach($v as $g){\n \t\t\t\t$pos = strpos($g, '$');\n \t\t\t\tif($pos !== false){ \n \t\t\t\t\t$GLOBALS[$g] = substr($g, 1); \t\t\t\t\t\n \t\t\t\t\t//$new_para .= $GLOBALS[$g].'-';\n \t\t\t\t\t \t\t\t \t\t\t\t\t\n \t\t\t\t}\t\t \t\t\t\t \t\t\t \n \t\t\t}//end foreach\n \t\t\t//$new_para = rtrim($new_para,'-');\n \t\t\t\t\n \t\t}else{\n \t\t\t\n \t\t\t$pos = strpos($var, '$'); \t\t\t\n \t\t\tif($pos !== false){\n \t\t\t\t$GLOBALS[$var] = substr($var, 1);\t\t\t\t\n \t\t\t}\n \t\t\t \t\t\t\n \t\t}//end if \t\t\n \t}//end foreach\n\n \tif($debug)$this->progress .= \"<br>AR_utilities Class:globalize_var(): globalization done:<pre>\".print_r($vars,true).'</pre>';\n \t\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Add a ground overlay to the map.
public function addGroundOverlay(GroundOverlay $groundOverlay) { $this->groundOverlays[] = $groundOverlay; if ($this->autoZoom) { $this->bound->extend($groundOverlay); } }
[ "public function addGroundOverlay(Overlays\\GroundOverlay $groundOverlay)\n {\n $this->groundOverlays[] = $groundOverlay;\n\n if($this->autoZoom)\n $this->bound->extend($groundOverlay);\n }", "public function testGroundOverlayServiceWithoutConfiguration()\n {\n $groundOverlay = self::createContainer()->get('ivory_google_map.ground_overlay');\n\n $this->assertInstanceOf('Ivory\\GoogleMapBundle\\Model\\Overlays\\GroundOverlay', $groundOverlay);\n $this->assertEquals(substr($groundOverlay->getJavascriptVariable(), 0, 15), 'ground_overlay_');\n $this->assertEquals($groundOverlay->getUrl(), '');\n $this->assertEquals($groundOverlay->getBound()->getNorthEast()->getLatitude(), 1);\n $this->assertEquals($groundOverlay->getBound()->getNorthEast()->getLongitude(), 1);\n $this->assertTrue($groundOverlay->getBound()->getNorthEast()->isNoWrap());\n $this->assertEquals($groundOverlay->getBound()->getSouthWest()->getLatitude(), -1);\n $this->assertEquals($groundOverlay->getBound()->getSouthWest()->getLongitude(), -1);\n $this->assertTrue($groundOverlay->getBound()->getSouthWest()->isNoWrap());\n }", "public function testGroundOverlayServiceWithConfiguration()\n {\n $groundOverlay = self::createContainer(array('environment' => 'test'))->get('ivory_google_map.ground_overlay');\n\n $this->assertEquals(substr($groundOverlay->getJavascriptVariable(), 0, 2), 'go');\n $this->assertEquals($groundOverlay->getUrl(), 'url');\n $this->assertEquals($groundOverlay->getBound()->getNorthEast()->getLatitude(), 1.1);\n $this->assertEquals($groundOverlay->getBound()->getNorthEast()->getLongitude(), 2.1);\n $this->assertFalse($groundOverlay->getBound()->getNorthEast()->isNoWrap());\n $this->assertEquals($groundOverlay->getBound()->getSouthWest()->getLatitude(), -1.1);\n $this->assertEquals($groundOverlay->getBound()->getSouthWest()->getLongitude(), -2.1);\n $this->assertTrue($groundOverlay->getBound()->getSouthWest()->isNoWrap());\n }", "protected function addGroundOverlaySection(ArrayNodeDefinition $node)\n {\n $node\n ->children()\n ->arrayNode('ground_overlay')->addDefaultsIfNotSet()\n ->children()\n ->scalarNode('class')->defaultValue('Ivory\\GoogleMapBundle\\Model\\GroundOverlay')->end()\n ->scalarNode('helper')->defaultValue('Ivory\\GoogleMapBundle\\Templating\\Helper\\GroundOverlayHelper')->end()\n ->scalarNode('prefix_javascript_variable')->defaultValue('ground_overlay_')->end()\n ->arrayNode('bound')->addDefaultsIfNotSet()\n ->children()\n ->arrayNode('south_west')->addDefaultsIfNotSet()\n ->children()\n ->scalarNode('latitude')->defaultValue(0)->end()\n ->scalarNode('longitude')->defaultValue(0)->end()\n ->scalarNode('no_wrap')->defaultTrue()->end()\n ->end()\n ->end()\n ->arrayNode('north_east')->addDefaultsIfNotSet()\n ->children()\n ->scalarNode('latitude')->defaultValue(0)->end()\n ->scalarNode('longitude')->defaultValue(0)->end()\n ->scalarNode('no_wrap')->defaultTrue()->end()\n ->end()\n ->end()\n ->end()\n ->end()\n ->arrayNode('options')\n ->useAttributeAsKey('options')->prototype('scalar')->end()\n ->end()\n ->end()\n ->end()\n ->end();\n }", "public function setGroundOverlayHelper(GroundOverlayHelper $groundOverlayHelper)\n {\n $this->groundOverlayHelper = $groundOverlayHelper;\n }", "public function render(GroundOverlay $groundOverlay, Map $map)\n {\n $groundOverlayOptions = $groundOverlay->getOptions();\n\n $groundOverlayJSONOptions = sprintf('{\"map\":%s',\n $map->getJavascriptVariable()\n );\n\n if(!empty($groundOverlayOptions))\n $groundOverlayJSONOptions .= ','.substr(json_encode($groundOverlayOptions), 1);\n else\n $groundOverlayJSONOptions .= '}';\n\n $html = array();\n\n $html[] = $this->boundHelper->render($groundOverlay->getBound());\n $html[] = sprintf('var %s = new google.maps.GroundOverlay(\"%s\", %s, %s);'.PHP_EOL,\n $groundOverlay->getJavascriptVariable(),\n $groundOverlay->getUrl(),\n $groundOverlay->getBound()->getJavascriptVariable(),\n $groundOverlayJSONOptions\n );\n\n return implode('', $html);\n }", "protected function getIvoryGoogleMap_GroundOverlay_BuilderService()\n {\n $this->services['ivory_google_map.ground_overlay.builder'] = $instance = new \\Ivory\\GoogleMapBundle\\Model\\Overlays\\GroundOverlayBuilder('Ivory\\\\GoogleMap\\\\Overlays\\\\GroundOverlay', $this->get('ivory_google_map.bound.builder'));\n\n $instance->setUrl('');\n $instance->setOptions(array());\n\n return $instance;\n }", "public function setAsOverlay();", "public function renderGroundOverlays(Map $map)\n {\n $html = array();\n\n foreach ($map->getGroundOverlays() as $groundOverlay) {\n $html[] = $this->groundOverlayHelper->render($groundOverlay, $map);\n }\n\n return implode('', $html);\n }", "public function addOverlay(ImageInterface $image): void;", "public static function invalidGroundOverlayBoundCoordinates()\n {\n return new static('A ground overlay bound must have a south west & a north east coordinate.');\n }", "function cspm_ground_overlays_fields(){\r\n\t\t\t\r\n\t\t\t$fields = array();\r\n\t\t\t \r\n\t\t\t$fields[] = array(\r\n\t\t\t\t'id' => $this->metafield_prefix . '_ground_overlay_section',\r\n\t\t\t\t'name' => 'Ground Overlays Settings',\r\n\t\t\t\t'desc' => 'Use the ground overlays to place images on the map. The image will be rendered on the map, constrained to the given bounds, and conformed using the map\\'s projection.',\r\n\t\t\t\t'type' => 'title',\r\n\t\t\t\t'attributes' => array(\r\n\t\t\t\t\t'style' => 'font-size:20px; color:#008fed; font-weight:400;'\r\n\t\t\t\t),\r\n\t\t\t);\r\n\t\t\t\t\t\r\n\t\t\t$fields[] = array(\r\n\t\t\t\t'id' => $this->metafield_prefix . '_ground_overlays_option',\r\n\t\t\t\t'name' => 'Ground overlays option',\r\n\t\t\t\t'desc' => 'Select \"Yes\" to enable this option in your map. Defaults to \"No\".',\r\n\t\t\t\t'type' => 'radio',\r\n\t\t\t\t'default' => 'false',\r\n\t\t\t\t'options' => array(\r\n\t\t\t\t\t'true' => 'Yes',\r\n\t\t\t\t\t'false' => 'No'\r\n\t\t\t\t)\r\n\t\t\t);\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t$fields[] = array(\r\n\t\t\t\t'id' => $this->metafield_prefix . '_ground_overlays',\r\n\t\t\t\t'name' => 'Images (Ground Overlays)',\r\n\t\t\t\t'desc' => 'Click on the button \"Add New Image\" to add a new image. You can add Multiple images!',\r\n\t\t\t\t'type' => 'group',\r\n\t\t\t\t'repeatable' => true,\r\n\t\t\t\t'options' => array(\r\n\t\t\t\t\t'group_title' => esc_attr__( 'Image {#}', 'cspm' ),\r\n\t\t\t\t\t'add_button' => esc_attr__( 'Add New Image', 'cspm' ),\r\n\t\t\t\t\t'remove_button' => esc_attr__( 'Remove Image', 'cspm' ),\r\n\t\t\t\t\t'sortable' => true,\r\n\t\t\t\t\t'closed' => true,\r\n\t\t\t\t),\r\n\t\t\t\t'fields' => array(\t\r\n\t\t\t\t\tarray(\r\n\t\t\t\t\t\t'id' => 'image_label',\r\n\t\t\t\t\t\t'name' => 'Image Label/Title', \r\n\t\t\t\t\t\t'desc' => 'Give a title to this image. The title will help to distinct an image between multiple images. (Example: \"Lodon Image\")',\r\n\t\t\t\t\t\t'type' => 'text',\r\n\t\t\t\t\t\t'default' => '',\r\n\t\t\t\t\t\t'attributes' => array(\r\n\t\t\t\t\t\t\t'data-group-title' => 'text'\r\n\t\t\t\t\t\t)\r\n\t\t\t\t\t),\r\n\t\t\t\t\tarray(\r\n\t\t\t\t\t\t'name' => '',\r\n\t\t\t\t\t\t'desc' => '<strong style=\"font-size:15px; display: inline-block; padding: 5px 0;\">How to add your image overlay?</strong><br />\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t\t Before getting started, you need to pan the map to your desired area. \r\n\t\t\t\t\t\t\t\t You can use the address search field or geolocate your position for that purpose!<br />\r\n\t\t\t\t\t\t\t\t <strong>1.</strong> Click (if not already selected) on the rectangle button/icon on the map (next to the hand button/icon).<br />\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t\t <strong>2.</strong> Draw a rectangle around your desired area by clicking on a specific spot on the map, then, drag the cursor \r\n\t\t\t\t\t\t\t\t to cover the whole area.<br />\r\n\t\t\t\t\t\t\t\t <strong>3.</strong> Paste your image URL in the field <u>\"Image URL\"</u>, then, click on the button <u>\"Project image\"</u> to project \r\n\t\t\t\t\t\t\t\t your image on the map.<br />\r\n\t\t\t\t\t\t\t\t <strong>4.</strong> Once finished, you can edit the rectangle by dragging a vertex/point to another spot. To drag \r\n\t\t\t\t\t\t\t\t the whole rectangle, first, check the option <u>\"Activate dragging mode\"</u> on top of the map, then start dragging it.<br />\r\n\t\t\t\t\t\t\t\t <strong>5.</strong> To remove the image, clear the field <u>\"Image URL\"</u>, then, click on the button <u>\"Project image\"</u>.<br />\r\n\t\t\t\t\t\t\t\t <strong>6.</strong> If you need to start drawing from scratch, click on the button <u>\"Draw from scratch\"</u>, then, start \r\n\t\t\t\t\t\t\t\t tracing new bounds.<br />\r\n\t\t\t\t\t\t\t\t <strong>7.</strong> Once satisfied with the position of your image on the map, click on the button <u>\"Display bounds\"</u>.<br />\r\n\t\t\t\t\t\t\t\t <span style=\"color:red;\">\r\n\t\t\t\t\t\t\t\t <strong>Hint:</strong> For more precision while tracing the bounds, use the map\\'s full screen mode!\r\n\t\t\t\t\t\t\t\t </span>',\r\n\t\t\t\t\t\t'id' => 'image_url_and_bounds',\r\n\t\t\t\t\t\t'type' => 'cs_gmaps_drawing',\r\n\t\t\t\t\t\t'default' => '',\r\n\t\t\t\t\t\t'options' => array(\r\n\t\t\t\t\t\t\t'api_key' => isset($this->plugin_settings['api_key']) ? $this->plugin_settings['api_key'] : '',\r\n\t\t\t\t\t\t\t'disable_gmaps_api' => false,\r\n\t\t\t\t\t\t\t'disable_gmap3_plugin' => false,\r\n\t\t\t\t\t\t\t'map_height' => '200px',\r\n\t\t\t\t\t\t\t'map_width' => '100%',\r\n\t\t\t\t\t\t\t'map_center' => $this->cspm_get_field_default('map_center', '51.53096,-0.121064'),\r\n\t\t\t\t\t\t\t'map_zoom' => 12,\r\n\t\t\t\t\t\t\t'img_url_field_name' => 'image_url',\t\t\r\n\t\t\t\t\t\t\t'ne_coordinates_field_name' => 'ne_bounds',\r\n\t\t \t\t\t\t\t'sw_coordinates_field_name' => 'sw_bounds',\t\t\t\t\t\r\n\t\t\t\t\t\t\t'labels' => array(\r\n\t\t\t\t\t\t\t\t'address' => 'Enter a location & search or Geolocate your position',\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t'search' => 'Search',\r\n\t\t\t\t\t\t\t\t'pinpoint' => 'Display bounds',\r\n\t\t\t\t\t\t\t\t'clear_overlay' => 'Draw from scratch',\r\n\t\t\t\t\t\t\t\t'ne_label' => 'North-East coordinates',\r\n\t\t\t\t\t\t\t\t'sw_label' => 'South-West coordinates',\r\n\t\t\t\t\t\t\t\t'toggle' => 'Image overlay URL & Bounds',\r\n\t\t\t\t\t\t\t\t'top_desc' => 'Create a ground overlay by providing an image URL and its \"Lat,Lng\" bounds.<br />\r\n\t\t\t\t\t\t\t\t\t\t\t <span style=\"color:red;\">Read the insctructions below for more details about finding the image overlay bounds!</span><hr />',\r\n\t\t\t\t\t\t\t),\r\n\t\t\t\t\t\t\t'fields_desc' => array(\r\n\t\t\t\t\t\t\t\t'img_url' => 'Upload or Enter the image URL.',\r\n\t\t\t\t\t\t\t\t'ne' => 'Enter the north-east (top-right) corner of the image bounds. The coordinates (Latitude & Longitude) of the image top-right corner.',\r\n\t\t\t\t\t\t\t\t'sw' => 'Enter the south-west (bottom-left) corner of the image bounds. The coordinates (Latitude & Longitude) of the image bottom-left corner.',\r\n\t\t\t\t\t\t\t),\r\n\t\t\t\t\t\t\t'draw_mode' => 'image',\r\n\t\t\t\t\t\t\t'save_coordinates' => true,\r\n\t\t\t\t\t\t\t'toggle' => true,\r\n\t\t\t\t\t\t\t'close' => false,\r\n\t\t\t\t\t\t),\r\n\t\t\t\t\t),\t\t\t\t\t\r\n\t\t\t\t\tarray(\r\n\t\t\t\t\t\t'id' => 'opacity',\r\n\t\t\t\t\t\t'name' => 'Image opacity',\r\n\t\t\t\t\t\t'desc' => 'Select the image opacity, between 0.0 and 1.0.',\r\n\t\t\t\t\t\t'type' => 'select',\r\n\t\t\t\t\t\t'default' => '0,9',\r\n\t\t\t\t\t\t'options' => array(\r\n\t\t\t\t\t\t\t'0,0' => '0.0',\r\n\t\t\t\t\t\t\t'0,1' => '0.1',\r\n\t\t\t\t\t\t\t'0,2' => '0.2',\r\n\t\t\t\t\t\t\t'0,3' => '0.3',\r\n\t\t\t\t\t\t\t'0,4' => '0.4',\r\n\t\t\t\t\t\t\t'0,5' => '0.5',\r\n\t\t\t\t\t\t\t'0,6' => '0.6',\r\n\t\t\t\t\t\t\t'0,7' => '0.7',\r\n\t\t\t\t\t\t\t'0,8' => '0.8',\r\n\t\t\t\t\t\t\t'0,9' => '0.9',\r\n\t\t\t\t\t\t\t'1' => '1',\r\n\t\t\t\t\t\t),\r\n\t\t\t\t\t\t'before_row' => str_replace(array('[title]'), array('Image options'), $this->toggle_before_row),\t\t\t\r\n\t\t\t\t\t),\r\n\t\t\t\t\tarray(\r\n\t\t\t\t\t\t'id' => 'image_visibility',\r\n\t\t\t\t\t\t'name' => 'Image visibility',\r\n\t\t\t\t\t\t'desc' => 'Choose the image visibility on the map. Defaults to \"Always visible\".',\r\n\t\t\t\t\t\t'type' => 'radio',\r\n\t\t\t\t\t\t'default' => 'always',\r\n\t\t\t\t\t\t'options' => array(\r\n\t\t\t\t\t\t\t'always' => 'Always visible',\r\n\t\t\t\t\t\t\t'hide' => 'Hide on map load and allow users to show & hide it when they want',\r\n\t\t\t\t\t\t\t'show' => 'Show on map load and allow users to hide & show it when they want',\r\n\t\t\t\t\t\t\t'marker_connected' => 'Connect the image to a marker and show/hide it depending on that marker visibility',\r\n\t\t\t\t\t\t\t'disable' => 'Disable'\r\n\t\t\t\t\t\t) \r\n\t\t\t\t\t),\r\n\t\t\t\t\tarray(\r\n\t\t\t\t\t\t'id' => 'image_connected_post',\r\n\t\t\t\t\t\t'name' => 'Image connected post', \r\n\t\t\t\t\t\t'desc' => 'Enter the post ID. By connecting this image to a specific post, the image visibility will depend on \r\n\t\t\t\t\t\t\t\t\tthat post visibility on the map',\r\n\t\t\t\t\t\t'type' => 'text',\r\n\t\t\t\t\t\t'attributes' => array(\r\n\t\t\t\t\t\t\t'type' => 'number',\r\n\t\t\t\t\t\t\t'pattern' => '\\d*',\r\n\t\t\t\t\t\t),\t\t\t\t\t\t\r\n\t\t\t\t\t),\r\n\t\t\t\t\tarray(\r\n\t\t\t\t\t\t'id' => 'image_clickable',\r\n\t\t\t\t\t\t'name' => 'Clickable',\r\n\t\t\t\t\t\t'desc' => 'Indicate whether this image handles mouse events. Defaults to \"No\".',\r\n\t\t\t\t\t\t'type' => 'radio',\r\n\t\t\t\t\t\t'default' => 'false',\r\n\t\t\t\t\t\t'options' => array(\r\n\t\t\t\t\t\t\t'true' => 'Yes',\r\n\t\t\t\t\t\t\t'false' => 'No'\r\n\t\t\t\t\t\t)\r\n\t\t\t\t\t),\r\n\t\t\t\t\tarray(\r\n\t\t\t\t\t\t'id' => 'image_redirect_url',\r\n\t\t\t\t\t\t'name' => 'Image redirect URL',\r\n\t\t\t\t\t\t'desc' => 'If provided, the URL will be executed when the Image is clicked. <span style=\"color:red;\">Works only when \"Clickable\" is set to \"Yes\"!</span>',\r\n\t\t\t\t\t\t'type' => 'text_url',\r\n\t\t\t\t\t\t'default' => ''\r\n\t\t\t\t\t),\r\n\t\t\t\t\tarray(\r\n\t\t\t\t\t\t'id' => 'image_url_target',\r\n\t\t\t\t\t\t'name' => 'URL target',\r\n\t\t\t\t\t\t'desc' => 'Choose an option to open the Image redirect URL. Defaults to \"Open in a new window\".',\r\n\t\t\t\t\t\t'type' => 'radio',\r\n\t\t\t\t\t\t'default' => 'new_window',\r\n\t\t\t\t\t\t'options' => array(\r\n\t\t\t\t\t\t\t'new_window' => 'Open in a new window',\r\n\t\t\t\t\t\t\t'same_window' => 'Open in the same window',\r\n 'popup' => 'Open inside a modal/popup',\r\n\t\t\t\t\t\t)\r\n\t\t\t\t\t),\r\n\t\t\t\t\tarray(\r\n\t\t\t\t\t\t'id' => 'show_btn_icon',\r\n\t\t\t\t\t\t'name' => 'Show button icon',\r\n\t\t\t\t\t\t'desc' => 'Upload the image to display in the show button. This button will allow the users to show the image.',\r\n\t\t\t\t\t\t'type' => 'file',\r\n\t\t\t\t\t\t'default' => $this->plugin_url.'img/switch-on.png',\r\n\t\t\t\t\t\t'text' => array(\r\n\t\t\t\t\t\t\t'add_upload_file_text' => 'Upload icon',\r\n\t\t\t\t\t\t),\r\n\t\t\t\t\t\t'preview_size' => array( 24, 24 ),\r\n\t\t\t\t\t\t'query_args' => array(\r\n\t\t\t\t\t\t\t'type' => 'image',\r\n\t\t\t\t\t\t)\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t),\r\n\t\t\t\t\tarray(\r\n\t\t\t\t\t\t'id' => 'hide_btn_icon',\r\n\t\t\t\t\t\t'name' => 'Hide buttom icon',\r\n\t\t\t\t\t\t'desc' => 'Upload the image to display in the hide button. This button will allow the users to hide the image.',\r\n\t\t\t\t\t\t'type' => 'file',\r\n\t\t\t\t\t\t'default' => $this->plugin_url.'img/switch-off.png',\r\n\t\t\t\t\t\t'text' => array(\r\n\t\t\t\t\t\t\t'add_upload_file_text' => 'Upload icon',\r\n\t\t\t\t\t\t),\r\n\t\t\t\t\t\t'preview_size' => array( 24, 24),\r\n\t\t\t\t\t\t'query_args' => array(\r\n\t\t\t\t\t\t\t'type' => 'image',\r\n\t\t\t\t\t\t)\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t),\r\n\t\t\t\t\tarray(\r\n\t\t\t\t\t\t'id' => 'btn_position',\r\n\t\t\t\t\t\t'name' => 'Icon position',\r\n\t\t\t\t\t\t'desc' => 'By default, the show/hide icon will be displayed in the North-East (top-right) corner of the image (ground overlay).\r\n\t\t\t\t\t\t\t\t If you want to change the icon position, specify other coordinates \"Latitude\" & \"Longitude\" or leave this field empty.',\r\n\t\t\t\t\t\t'type' => 'text',\r\n\t\t\t\t\t\t'default' => '',\r\n\t\t\t\t\t\t'after_row' => $this->toggle_after_row,\r\n\t\t\t\t\t),\t\t\t\t\r\n\t\t\t\t)\r\n\t\t\t);\r\n\t\t\t\t\t\t\r\n\t\t\treturn $fields;\r\n\t\t\t\r\n\t\t}", "public function addOverlay($overlay)\n {\n if (!$overlay->getVarName()) {\n $this->javaScriptStack[] = $overlay->getCode();\n }\n $js = sprintf('%s.addOverlay(%s);',\n $this->container,\n $overlay->getVarName());\n $this->javaScriptStack[] = $js;\n }", "public function add_layer() {\n\t\tENDA_Woocommerce_Bundle_Shipping::display_layer();\n\t\texit();\n\t}", "public function getGround()\n {\n return $this->ground;\n }", "public function createOverlay($id, $overlay) {\n $osda = $this->_interface->OsdAssociator();\n\n $overlay['id'] = $id;\n unset($overlay['content']);\n\n $params = self::toObject(\n $overlay,\n 'CreateOverlayParams',\n array(\n 'id',\n 'content',\n array('fore_color', 'PlayerColor', array('color','alpha')),\n array('back_color', 'PlayerColor', array('color','alpha')),\n array('link_color','PlayerColor',array('color','alpha')),\n array('hover_color','PlayerColor',array('color','alpha')),\n 'x_location',\n 'y_location',\n 'width',\n array('margins','PlayerMargins',array('left','top','right','bottom')),\n 'ttl',\n 'show'\n )\n );\n\n $cs = $osda->CreateOverlayType($params);\n return $cs->success_ ? null : $cs->error_;\n }", "public static function invalidGroundOverlayUrl()\n {\n return new static('The url of a ground overlay must be a string value.');\n }", "public function executeAddGrounds()\n {\n $mm_id = $this->getRequestParameter('id', 0); //OJO SI NO EXISTEN\n $ground_ids = explode('_', $this->getRequestParameter('grounds')); //OJO SI NO EXISTEN\n\n foreach($ground_ids as $ground_id){\n $gv = GroundMmPeer::retrieveByPK($ground_id, $mm_id);\n if (!$gv){\n $gv = new GroundMm();\n $gv->setMmId($mm_id);\n $gv->setGroundId($ground_id);\n $gv->save();\n }\n }\n\n $c = new Criteria();\n $c->add(GroundTypePeer::DISPLAY, true);\n $c->addAscendingOrderByColumn(GroundTypePeer::RANK);\n $this->groundtypes = GroundTypePeer::doSelectWithI18n($c, 'es'); \n\n $this->mm = MmPeer::retrieveByPk($mm_id); \n $this->grounds = GroundPeer::doSelectWithI18n(new Criteria(), 'es');\n $this->grounds_sel = $this->mm->getGrounds();\n\n return $this->renderPartial('edit_ground');\n }", "public function setDrawingMode(google_maps_OverlayType $drawingMode){}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Checks a piece of data is a valid number
private function is_valid_number($data) { $data = trim($data); if(is_numeric($data)) { return $data; } else { return false; } }
[ "function ValidateNumber($data)\n\t{\n\t\tif(is_numeric($data))\n\t\t\treturn true;\n\t\telse\n\t\t\treturn false;\n\t}", "public function isNumericData($data)\n { \n $errFlag = 1;\n if(preg_match('/^\\d+$/',$data))\n $errFlag = 0;\n return $errFlag;\n }", "private function validateNumber()\n\t{\n\t\tif(!is_numeric($this->testValue))\n\t\t{\n\t\t\t$this->returnData['type']='error';\n\t\t\t$this->returnData['message'] = 'The field does not consist of all numbers.';\n\t\t\t$this->returnData['valid'] = false;\n\t\t}\n\t}", "function isInt($data){\n return (preg_match(\"/^-?\\d+$/\",$data));\n }", "function validarNumber($elDato)\r\n{\r\n\t$val = FALSE;\r\n\t$dato = numberNotAdmited();\r\n\t\r\n\tfor($i = 0; $i < count($dato); $i++)\r\n\t{\r\n\t\t$posicion = strpos(strval($elDato), strval($dato[$i]));\r\n\t\t\r\n\t\tif($posicion !== FALSE)\r\n\t\t\t$val = TRUE;\r\n\t}\r\n\t\r\n\treturn $val;\r\n}", "private static function _validNum($number){\n\t\t$trim_number = bcadd($number,0);\n\t\tif($trim_number !== $number){\n\t\t\tthrow new Exception(\"input contains invalid chars!\");\n\t\t}\n\t}", "function vhcs_limit_check ( $data, $num )\r\n\t{\r\n\r\n\t\t$res = preg_match(\"/^(-1|0|[1-9][0-9]*)$/\", $data, $match);\r\n\r\n\t\tif ($res == 0) return 0;\r\n\r\n\t\tif ($data > $num) return 0;\r\n\r\n\t\treturn 1;\r\n\t}", "function isValidNumber()\n\t\t{//_9_5_1_5e60209_1149166999843_924482_375\n\t\t\treturn $this->parseResult;\n\t\t}", "public function isValid($number);", "function validaNumero ($numero){\n\treturn is_numeric($numero);\n}", "function func_check_isnumber($strnum)\r\n\t{\r\n\t\tif (ereg('^[[:digit:]]+$', $strnum))\r\n\t\t\treturn 1;\r\n\t\telse\r\n\t\t\treturn 0;\r\n\t}", "function validNumberInput($value){\n return is_numeric($value);\n }", "function isNbValid($number)\n{\n if (is_int($number) ===false) {\n // si non, convertir en nombre entier\n $number = intval($number);\n }\n return $number;\n \n}", "public function id($data){\n\t\t$valid = false;\n\t\t//8 max digits, 2 min\n\t\t$regexp = \"^[[:digit:]]{1,11}$\";\n\t\t \t\n\t\tif(is_numeric($data) && eregi($regexp, $data))\n\t\t\t$valid = true;\n\t\t \t\t\n\t\treturn $valid; \t\n\t }", "public function isNumExist($data){\n if (isset($data) === true AND $data !== null AND $data !== \"\" AND $data !== [] AND is_int($data) === true) {\n return true;\n } else \n {\n return false;\n }\n }", "function is_whole_number($var)\n{\n $var = (string)$var;\n\n for ($i = 0, $len = dp_strlen($var); $i < $len; $i++) {\n if (($ascii_code = ord($var[$i])) < 48 || $ascii_code > 57) {\n return FALSE;\n }\n }\n return TRUE;\n}", "private function testCheckDigit(): bool\n {\n $sum = 0;\n\n for ($i = 1; $i <= 11; $i += 2) {\n $sum += 3 * $this->barcode[$i];\n }\n\n for ($i = 0; $i <= 10; $i += 2) {\n $sum += $this->barcode[$i];\n }\n\n return ($sum + $this->barcode[12]) % 10 == 0;\n }", "function validar_numero($numero){\nif (Validate::number($numero,array('decimal' => '', 'min' => 0, 'max' => 99999999999999 ))) {return true;}\n\telse {return false;}\n}", "public function convertToNumericDataIsValid(array $data)\n {\n $validTypes = array_keys($this->getNumericDataTypes());\n return (\n isset($data['numeric_convert']['property'])\n && is_numeric($data['numeric_convert']['property'])\n && isset($data['numeric_convert']['type'])\n && in_array($data['numeric_convert']['type'], $validTypes)\n );\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
table name manipulation functions prepend table schema etc
public static function full_tablename($tablename) { global $db_type; if ($db_type == 'pgsql') { $table_schemas = array( #todo get from database 'company' => 'market', 'quote' => 'market', ); if (isset($table_schemas[$tablename])) { $schema = $table_schemas[$tablename]; return "$schema.$tablename"; } else { return $tablename; } } else { return $tablename; } }
[ "abstract public function prefixTable($table);", "public function stlHandleTable(){\n\t\t$table = $this->getTable();\n\t\tif( $prefix = $this->getPrefix() ){\n\t\t\t$table = str_replace($prefix, '', $table);\n\t\t}\n\t\treturn strtolower($table);\n\t}", "public function replaceTableNamePrefix($input);", "private function __prefixTable() {\n\t\treturn ($this->use_table !== NULL) ? $this->use_table . '.' : '';\n\t}", "abstract protected function getTableName();", "function testTablePrefix($dbTableName);", "public function getNewTablePrefix();", "function add_table_prefix( $tablename ) {\n\n\tglobal $wpdb;\n\n\t$apdTablePrefix = APD_TABLE_PREFIX;\n\n\t$tablenameArray = explode( \"_\", $tablename );\n\n\t$tablename1 = strtolower( $tablenameArray[0] );\n\t$tablename2 = strtolower( $tablenameArray[1] );\n\t$tablename3 = strtolower( $tablenameArray[2] );\n\n\t$desiredPrefix = strtolower( $wpdb->prefix . $apdTablePrefix );\n\n\tif ( $tablename1 . \"_\" . $tablename2 . \"_\" == $desiredPrefix ) {\n\t\t//tablename has both prefixes\n\t\treturn $tablename;\n\n\t} else if ( $tablename1 . \"_\" . $apdTablePrefix == $desiredPrefix ) {\n\t\t//tablename was WordPress prefix\n\t\treturn $tablename = $wpdb->prefix . $apdTablePrefix . $tablename2;\n\n\t} else {\n\t\t//tablename has no prefix\n\t\treturn $tablename = $wpdb->prefix . $apdTablePrefix . $tablename;\n\t}\n\n}", "function assign_table_names(){\n\t\tglobal $wpdb;\n\t\tforeach($this->tables as $table_name => $fields){\n\t\t\t$this->table_names[] = $wpdb->prefix . $table_name;\n\t\t}\n\t}", "private function initTableName() {\n\t\tif($this->table) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t$reflection = new \\ReflectionClass($this);\n\t\t$shortName = Str::plural($reflection->getShortName());\t\t\n\t\t$this->table = Str::plural(Str::snake($shortName));\n\t}", "protected function _setupTableName()\n {\n $config = $this->_db->getConfig();\n if (isset($config['prefix']) && !empty($config['prefix'])) {\n $this->_name = $config['prefix'] . $this->_name;\n }\n parent::_setupTableName();\n }", "protected function _setupTableName()\n\t{\n\t\t//Get the class name of this object\n\t\t$class = get_class($this);\n\n\t\t//Explode out the namespace tree\n\t\t$namespaceTree = explode('\\\\', $class);\n\n\t\t//Snake_case the object name\n\t\t$name = Utility::snakeCase(array_pop($namespaceTree));\n\n\t\t//Split and find the final word in the class name\n\t\t$words = explode('_', $name);\n\t\t$finalWord = array_pop($words);\n\n\t\t//Check that the final word is not \"model\"\n\t\tif($finalWord == 'model')\n\t\t\t$finalWord = array_pop($words);\n\n\t\t//pluralize the final word\n\t\t$plural = Utility::pluralize($finalWord);\n\n\t\t//Push it back into the array\n\t\tarray_push($words, $plural);\n\n\t\t//Collapse and set the table name\n\t\t$this->_table = implode('_', $words);\n\t}", "abstract protected function DefineTableName();", "public static function get_prefix_tabla($table_name, $db_name = null) ;", "function make_table_name() {\n\n\t\tglobal $wpdb;\n\n\t\t// get WP's table preffix\n\t\t$table_prefix = $wpdb->prefix;\n\t\t$t_name = \"subform_settings\";\n\n\t\t$table_name = $table_prefix . $t_name;\n\n\t\treturn $table_name;\n\t}", "protected function _setupTableName() {\n\t\tif (! $this->_name) {\n\t\t\tif (preg_match ( '/(?P<namespace>.+\\\\\\)?(?P<class>[^\\\\\\]+$)/', get_class ( $this ), $matches )) {\n\t\t\t\t$this->_name = \\Core\\Camel::fromCamelCase ( $matches ['class'] );\n\t\t\t} else {\n\t\t\t\t$this->_name = \\Core\\Camel::fromCamelCase ( basename ( get_class ( $this ) ) );\n\t\t\t}\n\t\t} else if (strpos ( $this->_name, '.' )) {\n\t\t\tlist ( $_schema, $_name ) = explode ( '.', $this->_name );\n\t\t\tif (preg_match ( '/(?P<namespace>.+\\\\\\)?(?P<class>[^\\\\\\]+$)/', $_schema, $matches )) {\n\t\t\t\t$this->_schema = \\Core\\Camel::fromCamelCase ( $matches ['class'] );\n\t\t\t} else {\n\t\t\t\t$this->_schema = \\Core\\Camel::fromCamelCase ( basename ( $_schema ) );\n\t\t\t}\n\t\t\tif (preg_match ( '/(?P<namespace>.+\\\\\\)?(?P<class>[^\\\\\\]+$)/', $_name, $matches )) {\n\t\t\t\t$this->_name = \\Core\\Camel::fromCamelCase ( $matches ['class'] );\n\t\t\t} else {\n\t\t\t\t$this->_name = \\Core\\Camel::fromCamelCase ( basename ( $_schema ) );\n\t\t\t}\n\t\t}\n\t}", "function table_prefix($table)\n\t{\n\t\t$pre ='';\n\t\tif($table == \"propertyinforp\")\n\t\t\t$pre=\"proprp\";\n\t\t\n\t\telseif($table == \"applianceinforp\")\n\t\t\t$pre=\"apprp\";\n\t\telseif($table == \"financialinforp\")\n\t\t\t$pre=\"finrp\";\n\t\telseif($table == \"leasetermrp\")\n\t\t\t$pre=\"lstrmrp\";\n\t\telseif($table == \"limitinforp\")\n\t\t\t$pre=\"limitrp\";\n\t\telseif($table == \"miscinforp\")\n\t\t\t$pre=\"miscrp\";\n\t\telseif($table == \"petinforp\")\n\t\t\t$pre=\"petrp\";\n\t\telseif($table == \"residentinforp\")\n\t\t\t$pre=\"resrp\";\n\t\telseif($table == \"unitaddressrp\")\n\t\t\t$pre=\"unitrp\";\n\t\telseif($table == \"vehicleparkrp\")\n\t\t\t$pre=\"vehrp\";\n\t\telseif($table == \"storageinforp\")\n\t\t\t$pre=\"storerp\";\t\t\n\t\telseif($table == \"utilityinforp\")\n\t\t\t$pre=\"utilityrp\";\t\n\t\telse\n\t\t\t$pre=\"UNKNOWN_ERROR\";\t\n\t\treturn($pre);\n\t}", "function prefix($tablename='')\n\t{\n\t\tif ( $tablename != '' ) \n\t\t{\n\t\t\treturn $this->prefix .'_'. $tablename;\n\t\t}\n\t\telse \n\t\t{\n\t\t\treturn $this->prefix;\n\t\t}\n\t}", "public function autoSetTableNames();" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Vector Trigonometric Sin Calculates the sine for each value in real and returns the resulting array.
public static function sin(array $real): array { $real = \array_values($real); $endIdx = count($real) - 1; $outReal = []; self::checkForError(self::getMathTransform()::sin(0, $endIdx, $real, self::$outBegIdx, self::$outNBElement, $outReal)); return self::adjustIndexes($outReal, self::$outBegIdx); }
[ "public function sin()\n {\n $e = new Complex(M_E, 0);\n $i = new Complex(0, 1);\n $negativeI = new Complex(0, -1);\n $numerator = $e->complexPow($i->multiply($this))->subtract($e->complexPow($negativeI->multiply($this)));\n return $numerator->divide(new Complex(0, 2));\n }", "public function sinh(array $real): array;", "public static function sin ($v) {\n\t\treturn sin($v);\n\t}", "#[Pure]\n public static function sin(float $number): float\n {\n return self::sine($number);\n }", "public function sin($angle);", "function sin(float $num): float\n{\n return php_sin($num);\n}", "public function sin($angle)\n\t{\n\t\treturn $this->executionEngine->sin($angle);\n\t}", "public static function sine(float $number): float\n {\n return sin($number);\n }", "public function cos(array $real): array;", "public function tan(array $real): array;", "function Sine($angle)\n{\n $sine = sin(deg2rad($angle));\n return $sine; \n}", "public function sin() : self\n {\n return $this->map('sin');\n }", "public static function tan(array $real): array\n {\n $real = \\array_values($real);\n $endIdx = count($real) - 1;\n $outReal = [];\n self::checkForError(self::getMathTransform()::tan(0, $endIdx, $real, self::$outBegIdx, self::$outNBElement, $outReal));\n\n return self::adjustIndexes($outReal, self::$outBegIdx);\n }", "public static function sin($z) {\n if (!($z instanceof Complex)) $z = static::parse($z);\n\n return static::create(sin($z->x)*cosh($z->y), cos($z->x)*sinh($z->y));\n }", "public function sinh($angle)\n\t{\n\t\treturn $this->executionEngine->sinh($angle);\n\t}", "public function sinh($angle)\n {\n return $this->expressionEngine->sinh($angle);\n }", "function vectorize($value, $mn, $mx) { \n $span = ($mx-$mn);\n while( $value < $mn ) { \n $value += $span;\n }\n while( $value >= $mx ) { \n $value -= $span;\n }\n $p = 2*M_PI*($value-$mn)/$span;\n return array( round(cos($p), 14), round(sin($p), 14) );\n }", "function sinh(Complex $c1) {\n $r = $c1->getReal();\n $i = $c1->getIm();\n return \\complex(\\sinh($r) * \\cos($i), \\cosh($r) * \\sin($i));\n}", "private function ArcSin($arg) {\r\n\r\n\t\tif(abs($arg) >= 1.0)\r\n\t\t\treturn ($this -> Sign($arg) * Globals::pio2);\r\n\t\telse\r\n\t\t\treturn (atan($arg / sqrt(1.0 - $arg * $arg)));\r\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the index view of the TicketTypes.
public function index() { $ticket_types = TicketType::orderBy('name')->paginate(10); return view('ticket_types.index', ['ticket_types' => $ticket_types]); }
[ "public function getIndex()\n {\n return view('admin.world_expansion.faction_types', [\n 'types' => FactionType::orderBy('sort', 'DESC')->get()\n ]);\n }", "public function getIndexType();", "public function indexTypes()\n\t{\n\t\t$types = ProjectType::get();\n\n\t\treturn $types;\n\t}", "public function getIndex()\n {\n return view('admin.world_expansion.location_types', [\n 'types' => LocationType::orderBy('sort', 'DESC')->get()\n ]);\n }", "function getIndexType(){\r\n\t\treturn $this->indexed;\r\n\t}", "public function index()\n {\n $transaction_types = TransactionType::all();\n\n return view('transaction_types.index', compact('transaction_types'));\n }", "public function index()\n {\n return view('admin::appraisal.types.index');\n }", "protected function _getTypeIndexers()\n {\n if (empty($this->_indexers)) {\n foreach ($this->_catalogProductType->getTypesByPriority() as $typeId => $typeInfo) {\n $indexerClassName = isset($typeInfo['stock_indexer']) ? $typeInfo['stock_indexer'] : '';\n\n $indexer = $this->_indexerFactory->create($indexerClassName)\n ->setTypeId($typeId)\n ->setIsComposite(!empty($typeInfo['composite']));\n\n $this->_indexers[$typeId] = $indexer;\n }\n }\n return $this->_indexers;\n }", "public function getIndex()\n {\n $name = Inflector::camelize($this->table);\n\n return IndexRegistry::get($name);\n }", "public function getIndexType()\n {\n return $this->indexType;\n }", "public function getIndexes($type);", "public function index()\n\t{\n $voteTypes = VoteType::all(); // Get vote types for the list\n\n\t\treturn view('votetypes.index', compact('voteTypes'));\n\t}", "public function index()\n {\n $itemsTypes = ItemsType::all();\n\n return $itemsTypes;\n }", "public function getTypeIndexers()\n {\n if (is_null($this->_indexers)) {\n $this->_indexers = array();\n $types = Mage::getSingleton('catalog/product_type')->getTypesByPriority();\n foreach ($types as $typeId => $typeInfo) {\n if (isset($typeInfo['price_indexer'])) {\n $modelName = $typeInfo['price_indexer'];\n } else {\n $modelName = $this->_defaultPriceIndexer;\n }\n $isComposite = !empty($typeInfo['composite']);\n $indexer = Mage::getResourceModel($modelName)\n ->setTypeId($typeId)\n ->setIsComposite($isComposite);\n\n $this->_indexers[$typeId] = $indexer;\n }\n }\n\n return $this->_indexers;\n }", "function getIndex($type=null)\r\n\t{\r\n\t\treturn $this->obj->getIndex($type);\r\n\t}", "public function index()\n {\n // get all the nerds\n $income_types = $this->income_types_repo->allActiveEdit();\n\n // load the view and pass the nerds\n return view('income-types.index')\n ->with(array('income_types' => $income_types));\n }", "public function index()\n {\n $eventTypes = Cache::remember('eventTypes', 60, function () {\n return EventType::all();\n });\n\n return view('pages.eventtype.index', compact('eventTypes'));\n }", "public function index()\n\t{\n\t\t$pagetitle = 'Client Type';\n\n\t\t$clienttype = DB::table('types')->orderBy('id', 'desc')->paginate(5);\n\t\treturn View::make('client_type.index', compact('pagetitle', 'clienttype'));\n\t}", "public static function get_index_custom($type_tokens = array()){\n\n // Pull in global variables\n $db = cms_database::get_database();\n\n // Generate a token string for the database query\n $type_tokens_string = array();\n foreach ($type_tokens AS $type_token){ $type_tokens_string[] = \"'{$type_token}'\"; }\n $type_tokens_string = implode(', ', $type_tokens_string);\n\n // Collect the requested type's info from the database index\n $type_fields = self::get_index_fields(true);\n $type_index = $db->get_array_list(\"SELECT {$type_fields} FROM mmrpg_index_types WHERE type_token IN ({$type_tokens_string});\", 'type_token');\n\n // Parse and return the data if not empty, else nothing\n if (!empty($type_index)){\n $type_index = self::parse_index($type_index);\n return $type_index;\n } else {\n return array();\n }\n\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Create a unique token id using the name given
public function createToken($name) { $uni = uniqid(sha1($name . microtime()), true); $session_varname = $this->getTokenName($name); $this->set($session_varname, $uni); return $uni; }
[ "private function getTokenName($name) {\n\t\treturn 'uniqueID_' . $name;\n\t}", "public function crearToken(){\n //uniqid: Da unos 13 digitos. Es para generar Ids pero vale para tokens\n $this->token = uniqid();\n\n }", "public function generateUniqueToken();", "public function generateIdentifierAndToken()\n {\n if ($this->isNewRecord) {\n $this->identifier = uniqid('lcp');\n $this->access_token = str_replace(['-', '_'], random_int(1, 9), Yii::$app->security->generateRandomString(32));\n }\n }", "private function makeId()\n {\n $random = mt_rand();\n $random = md5($random);\n $random = substr($random, 0, 12);\n $name = $this->config['name'];\n $length = strlen($name);\n if ($length > 22) {\n $name = substr($name, 0, 22);\n }\n return $name . '-' . $random;\n }", "function generateToken($username, $name){\t\n\t$mydate = getdate();\n\t$token = sha1($name.$username);\n\treturn $token;\n}", "private function createId(): string\n {\n return '_' . time() . '_' . explode(' ', microtime())[0];\n }", "function createToken(){\n\t\t\n\t\t$token = $this -> uName . config('core.SEED') . $this -> uPass;\n\n\t\tfor ($i = 0; $i < 100000; $i += 1) {\n\t\t\t$token = hash(\"sha256\", $token, false);\n\t\t}\n\n\t\treturn hash(\"sha256\", $token, false);\n\n\t}", "public function createToken();", "public function generateToken()\n {\n return sha1(uniqid(\"token\"));\n }", "public function uniqueTokenID()\n\t{\n\t\treturn time() . mt_rand(0, 0xffff);\n\t}", "public function generateToken()\n {\n return uniqid(\"reminder_\");\n }", "public function generateToken()\n {\n }", "protected function generateRequestToken()\n {\n return uniqid();\n }", "protected function generate_identifier()\n {\n $this->identifier = uniqid();\n }", "protected function genAccessToken()\n {\n return Uuid::uuid4();\n }", "public function generateToken(): string\n {\n return sha1(base64_encode(uniqid()));\n }", "function generateUserToken() {\n return uniqid('', false);\n }", "private function generateToken() {\n return md5(time().uniqid(rand(), TRUE));\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the value of field precoBase
public function getPrecoBase() { return $this->precoBase; }
[ "public function getPreco() {\n \t return $this->$Preco;\n \t}", "public function getValorBase() {\n return $this->nValorBase;\n }", "public function getPreco()\n {\n return $this->preco;\n }", "public function getPreco()\n {\n return $this->preco;\n }", "function getPrenotazione()\n\t{\n\t\treturn f_persistance::getInstance()->carica(e_libro::class, $this->id, f_target::CARICA_PRENOTAZIONE);\n\t}", "public function getPrezzo(){\n return $this -> prezzo;\n }", "public function getPreu()\r\n {\r\n return $this->preu;\r\n }", "public function getFormaProBase() {\n return $this->formaProBase;\n }", "function getPrezzo() {\r\n return $this->prezzo;\r\n }", "public function getPrecoDia()\n {\n return $this->precoDia;\n }", "public function get_base_type(){\n return $this->get_info('field_base_type');\n }", "public function getBaseValue()\n {\n return $this->options['base_value'];\n }", "public function getPreu()\n{\nreturn $this->preu;\n}", "public function getFormaProBase(): ?float {\n return $this->formaProBase;\n }", "public function getProd_niche () {\n\t$preValue = $this->preGetValue(\"prod_niche\"); \n\tif($preValue !== null && !\\Pimcore::inAdmin()) { \n\t\treturn $preValue;\n\t}\n\t$data = $this->getClass()->getFieldDefinition(\"prod_niche\")->preGetData($this);\n\treturn $data;\n}", "public function getBaseRaw() {\n\n return $this->_data[2];\n //===\n\n }", "public function getPrenume()\n {\n return $this->prenume;\n }", "public function getNiche_code () {\n\t$preValue = $this->preGetValue(\"niche_code\"); \n\tif($preValue !== null && !\\Pimcore::inAdmin()) { \n\t\treturn $preValue;\n\t}\n\t$data = $this->niche_code;\n\treturn $data;\n}", "public function getPrecoCusto()\r\n {\r\n return $this->precoCusto;\r\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets the global currency code for the order.
public function setGlobalCurrencyCode($code);
[ "public function setOrderCurrencyCode($code);", "protected function _setDefaultCurrencyCode()\n {\n $currencyCode = $this->_getConfigDataCall(Mage_Directory_Model_Currency::XML_PATH_CURRENCY_DEFAULT, $this->_getStoreId() );\n $this->_currencyCode = strtoupper($currencyCode);\n }", "public function setBaseCurrencyCode($code);", "public function setCurrency($code);", "public function setDefaultBaseCurrency($currency_code = 'USD')\n {\n $this->currency = $currency_code;\n }", "function set_currency_code($currency_code){\n $this->currency_code = $currency_code;\n return $currency_code;\n }", "protected function setCurrency() {\n $request = $this->getRequest();\n\n if ( !empty($request['currency']) && $request['currency'] === \"original\" ) \n {\n $regrate = RegistrationRate::getSpecificRateByTempID($this->registration->regrate_id);\n\n $this->currency_char = $regrate->currency;\n \n switch ($this->currency_char) {\n case '$':\n $this->currency_abbr = 'USD';\n break;\n \n case '&euro;':\n $this->currency_abbr = 'EUR';\n break;\n \n case '&pound;':\n $this->currency_abbr = 'GBP';\n break;\n\n default:\n $this->currency_abbr = 'USD';\n break;\n }\n }\n else {\n $this->currency_abbr = 'USD';\n }\n }", "public static function set_currency(string $currency) { self::$currency = $currency; }", "public function setCurrencyCode($cur) {\r\n\t\tswitch($cur) {\r\n\t\t\tcase \"USD\":\r\n\t\t\t\t$this->setCurrency(840);\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"EUR\":\r\n $this->setCurrency(978);\r\n break;\r\n case \"LBP\":\r\n $this->setCurrency(422);\r\n break;\r\n case \"GBP\":\r\n $this->setCurrency(826);\r\n break;\r\n\t\t\tdefault:\r\n\t\t\t\t$this->setCurrency($cur);\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t}", "public function setStoreCurrencyCode($code);", "public function set_currency($code=null, $rate=null){\n\t\t$this->set_currency_code($code);\n\t\t$this->set_currency_rate($rate);\n\t}", "public function getOrderCurrencyCode(){\n return $this->_get(self::ORDER_CURRENCY_CODE);\n }", "public function getOrderCurrencyCode()\n {\n return $this->orderCurrencyCode;\n }", "public function getOrderCurrencyCode();", "public function setBaseCurrencyCode($baseCurrencyCode);", "public function __construct() {\n $this->main_currency = 'GBP';\n }", "public function pushTransactionCurrency($code)\n {\n $this->data['ecommerce']['currencyCode'] = $code;\n }", "private function get_currency_code() {\n\t\treturn apply_filters( 'gb_epay_currency_code', self::$currency_code );\n\t}", "public function setCurrency($currency);" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Prints the appropriate response to a menu quick search.
function _wp_ajax_menu_quick_search( $request = array() ) { $args = array(); $type = isset( $request['type'] ) ? $request['type'] : ''; $object_type = isset( $request['object_type'] ) ? $request['object_type'] : ''; $query = isset( $request['q'] ) ? $request['q'] : ''; $response_format = isset( $request['response-format'] ) && in_array( $request['response-format'], array( 'json', 'markup' ) ) ? $request['response-format'] : 'json'; if ( 'markup' == $response_format ) { $args['walker'] = new Walker_Nav_Menu_Checklist; } if ( 'get-post-item' == $type ) { if ( post_type_exists( $object_type ) ) { if ( isset( $request['ID'] ) ) { $object_id = (int) $request['ID']; if ( 'markup' == $response_format ) { echo walk_nav_menu_tree( array_map('wp_setup_nav_menu_item', array( get_post( $object_id ) ) ), 0, (object) $args ); } elseif ( 'json' == $response_format ) { echo wp_json_encode( array( 'ID' => $object_id, 'post_title' => get_the_title( $object_id ), 'post_type' => get_post_type( $object_id ), ) ); echo "\n"; } } } elseif ( taxonomy_exists( $object_type ) ) { if ( isset( $request['ID'] ) ) { $object_id = (int) $request['ID']; if ( 'markup' == $response_format ) { echo walk_nav_menu_tree( array_map('wp_setup_nav_menu_item', array( get_term( $object_id, $object_type ) ) ), 0, (object) $args ); } elseif ( 'json' == $response_format ) { $post_obj = get_term( $object_id, $object_type ); echo wp_json_encode( array( 'ID' => $object_id, 'post_title' => $post_obj->name, 'post_type' => $object_type, ) ); echo "\n"; } } } } elseif ( preg_match('/quick-search-(posttype|taxonomy)-([a-zA-Z_-]*\b)/', $type, $matches) ) { if ( 'posttype' == $matches[1] && get_post_type_object( $matches[2] ) ) { $post_type_obj = _wp_nav_menu_meta_box_object( get_post_type_object( $matches[2] ) ); $args = array_merge( $args, array( 'no_found_rows' => true, 'update_post_meta_cache' => false, 'update_post_term_cache' => false, 'posts_per_page' => 10, 'post_type' => $matches[2], 's' => $query, ) ); if ( isset( $post_type_obj->_default_query ) ) { $args = array_merge( $args, (array) $post_type_obj->_default_query ); } $search_results_query = new WP_Query( $args ); if ( ! $search_results_query->have_posts() ) { return; } while ( $search_results_query->have_posts() ) { $post = $search_results_query->next_post(); if ( 'markup' == $response_format ) { $var_by_ref = $post->ID; echo walk_nav_menu_tree( array_map('wp_setup_nav_menu_item', array( get_post( $var_by_ref ) ) ), 0, (object) $args ); } elseif ( 'json' == $response_format ) { echo wp_json_encode( array( 'ID' => $post->ID, 'post_title' => get_the_title( $post->ID ), 'post_type' => $matches[2], ) ); echo "\n"; } } } elseif ( 'taxonomy' == $matches[1] ) { $terms = get_terms( $matches[2], array( 'name__like' => $query, 'number' => 10, )); if ( empty( $terms ) || is_wp_error( $terms ) ) return; foreach ( (array) $terms as $term ) { if ( 'markup' == $response_format ) { echo walk_nav_menu_tree( array_map('wp_setup_nav_menu_item', array( $term ) ), 0, (object) $args ); } elseif ( 'json' == $response_format ) { echo wp_json_encode( array( 'ID' => $term->term_id, 'post_title' => $term->name, 'post_type' => $matches[2], ) ); echo "\n"; } } } } }
[ "public function printSearchBox() {}", "public function print_search() {\n pmsearchbox($this);\n }", "private function outputSearch() {\n\t\t?>\n\t\t<form\n\t\t\taction=\"<?php $this->text( 'wgScript' ) ?>\"\n\t\t\trole=\"search\"\n\t\t\tclass=\"mw-portlet\"\n\t\t\tid=\"p-search\"\n\t\t>\n\t\t\t<input type=\"hidden\" name=\"title\" value=\"<?php $this->text( 'searchtitle' ) ?>\" />\n\t\t\t<h3>\n\t\t\t\t<label for=\"searchInput\"><?php echo $this->getMsg( 'search' )->escaped() ?></label>\n\t\t\t</h3>\n\t\t\t<?php echo $this->makeSearchInput( array( 'id' => 'searchInput' ) ) ?>\n\t\t\t<?php echo $this->makeSearchButton( 'go', array( 'id' => 'searchGoButton', 'class' => 'searchButton' ) ) ?>\n\t\t\t<input type=\"hidden\" name=\"title\" value=\"<?php $this->text( 'searchtitle' ) ?>\"/>\n\t\t</form>\n\t\t<?php\n\t}", "function _showQuickSearch2()\n {\n if ($this->_objTpl->blockExists('step_1')) {\n $this->_objTpl->touchBlock('step_1');\n }\n\n $this->_objTpl->setVariable(array(\n 'IMMO_SEARCH_ACTION' => 'index.php?section=immo&cmd=immolist',\n ));\n\n //buy\n //get buy info\n foreach ($this->categories as $id => $category) {\n $this->_objTpl->setVariable(array(\n 'IMMO_CHECKBOX_ID' => $id,\n 'IMMO_CHECKBOX_NAME' => 'rent',\n 'IMMO_CHECKBOX_VALUE' => $category,\n 'IMMO_CHECKBOX_CHECKED' => $_SESSION['immo']['search']['cat_rent'][$category] ? 'checked=\"checked\"' : '',\n 'IMMO_CHECKBOX_LABEL' => $category\n ));\n $this->_objTpl->parse('buyResult');\n }\n\n //rent\n //get rent info\n foreach ($this->categories as $id => $category) {\n $this->_objTpl->setVariable(array(\n 'IMMO_CHECKBOX_ID' => $id,\n 'IMMO_CHECKBOX_NAME' => 'rent',\n 'IMMO_CHECKBOX_VALUE' => $category,\n 'IMMO_CHECKBOX_CHECKED' => $_SESSION['immo']['search']['cat_rent'][$category] ? 'checked=\"checked\"' : '',\n 'IMMO_CHECKBOX_LABEL' => $category\n ));\n $this->_objTpl->parse('rentResult');\n }\n $this->_objTpl->parse('step_2');\n }", "private function outputSearch() {\n?>\n <form\n action=\"<?php $this->text( 'wgScript' ) ?>\"\n role=\"search\"\n class=\"mw-portlet\"\n id=\"p-search\"\n >\n <input type=\"hidden\" name=\"title\" value=\"<?php $this->text( 'searchtitle' ) ?>\" />\n <h3>\n <label for=\"searchInput\"><?php echo $this->getMsg( 'search' )->escaped() ?></label>\n </h3>\n <?php echo $this->makeSearchInput( array( 'id' => 'searchInput' ) ) ?>\n <?php echo $this->makeSearchButton( 'go', array( 'id' => 'searchGoButton', 'class' => 'searchButton' ) ) ?>\n <input type=\"hidden\" name=\"title\" value=\"<?php $this->text( 'searchtitle' ) ?>\"/>\n </form>\n<?php\n }", "public function print_search() {\n parent::print_search();\n $parent = $this->optional_param('id', 0, PARAM_INT);\n if (!$parent) {\n $subsets = $this->optional_param('subsets', 0, PARAM_INT);\n $url = $this->url;\n $url->remove_params('subsets');\n echo html_writer::checkbox('subsets', 1, $subsets, get_string('userset_subsets', 'local_elisprogram'), array(\n 'onclick' => 'window.location=\"'.$url.'&subsets=\"+(this.checked ? \"1\" : \"0\");',\n 'language' => 'javascript'));\n }\n }", "function showquery() {\r\n #~ echo '<td align=right>'; // see nav.inc.php for reason\r\n echo '<form name=\"search\" method=POST action=\"'.$_SERVER['PHP_SELF'].'\">';\r\n #~ echo '<img src=\"images/b_search.png\" border=\"0\">';\r\n echo lang('Search').' ';\r\n echo '<input type=hidden name=m value=\"'.$this->module.'\">';\r\n echo '<input type=hidden name=act value=\"browse\">';\r\n echo '<input type=text name=query value=\"'.$this->_query.'\" size=10>';\r\n echo ' '.lang('in').' ';\r\n echo '<select name=\"qf\">';\r\n #~ echo '<option value=\"\">With selected:</option>';\r\n echo '<option value=\"*\">'.lang('All fields').'</option>';\r\n echo \"<option value=''>______________</option>\";\r\n foreach ($this->properties as $key=>$col) {\r\n if (!$col->queryable or $col->colname=='') continue;\r\n $key == $_REQUEST['qf']? $ischecked = 'selected': $ischecked = '';\r\n echo \"<option value='$key' $ischecked>{$col->label}</option>\";\r\n }\r\n echo '</select>';\r\n #~ echo '<input type=submit value=\"Query\">';\r\n echo '</form>';\r\n #~ echo '</td>'; // see nav.inc.php for reason\r\n\r\n #~ echo '</td></tr></table>';\r\n }", "private function show_results() {\n\t\t$query = fix_chars($_REQUEST['query']);\n\t\t$template = new TemplateHandler('results.xml', $this->path.'templates/');\n\t\t$template->set_mapped_module($this->name);\n\t\t$template->register_tag_handler('cms:result_list', $this, 'tag_SearchResults');\n\n\t\t$params = array(\n\t\t\t\t'query' => $query,\n\t\t\t\t'form_action' => backend_UrlMake($this->name, 'show_results'),\n\t\t\t);\n\n\t\t$template->restore_xml();\n\t\t$template->set_local_params($params);\n\t\t$template->parse();\n\t}", "public function search() {\r\n\t\t$mintURL = $this->Configuration->findByName('Mint URL');\r\n\t\t$queryURL = $mintURL['Configuration']['value'];\r\n\t\t$query = '';\r\n\t\tif (isset($this->params['url']['query'])) {\r\n\t\t\t$query = $this->params['url']['query'];\r\n\t\t}\r\n\r\n\t\t$queryURL = $queryURL.\"/Parties_People/opensearch/lookup?searchTerms=\".$query;\r\n\t\t$queryResponse = \"error\";\r\n\n\t\t$ch = curl_init();\r\n\t\t$timeout = 5;\r\n\t\tcurl_setopt($ch,CURLOPT_URL,$queryURL);\r\n\t\tcurl_setopt($ch,CURLOPT_RETURNTRANSFER,1);\r\n\t\tcurl_setopt($ch,CURLOPT_CONNECTTIMEOUT,$timeout);\r\n\t\t$queryResponse = curl_exec($ch);\r\n\t\tcurl_close($ch);\r\n\r\n\t\t$this->autoRender = false;\r\n\t\t$this->response->type('json');\r\n\r\n\t\t$this->response->body($queryResponse);\r\n\t}", "private function printAnswerPage() {\n\t\t$correctVocabulary = 0;\n\t\t$wrongVocabulary = 1;\n\t\tinclude ('html/vocabularyAnswer.php');\n\t}", "public function Search() {\n\t\t\t// Declare Classes\n\t\t\t$RepQuestion\t\t= new RepQuestion();\n\t\t\t$ModQuestion\t\t= new ModQuestion();\n\t\t\t// Define sub menu selection\n\t\t\t$GLOBALS['menu']['questions']['opt2_css'] = 'details_item_on';\n\t\t\t// Intialize variables\n\t\t\t$return\t\t\t\t= '<br />(no questions found)';\n\t\t\t$search\t\t\t\t= (isset($_POST['search'])) ? trim($_POST['search']) : false;\n\t\t\t$search\t\t\t\t= ((!$search) && (isset($GLOBALS['params'][1]))) ? trim($GLOBALS['params'][1]) : false;\n\t\t\t// Get first 20 entries\n\t\t\t$result\t\t\t\t= $RepQuestion->getAll(20);\n\t\t\t// If there are entries\n\t\t\tif ($result) {\n\t\t\t\t// Separate returned data an paging info\n\t\t\t\t$rows\t\t\t= $result[0];\n\t\t\t\t$paging_info\t= $result[1];\n\t\t\t\t// Model Result\n\t\t\t\t$return\t\t\t= $ModQuestion->listQuestions($rows, 'q.id', 'ASC');\n\t\t\t}\n\t\t\t// Define Pager info\n\t\t\t$pager\t\t\t\t= Pager::pagerOptions($paging_info, 'questions', 'partialResult');\n\t\t\t// Prepare info to be displayed\n\t\t\tView::set('pager', $pager);\n\t\t\tView::set('return', $return);\n\t\t\t// render view\n\t\t\tView::render('questionsSearch');\n \t\t}", "public function help() {\n list($title, $body) = Trigger::current()->call(\"help_\".$_GET['id']);\n\n switch($_GET['id']) {\n case \"filtering_results\":\n $title = __(\"Filtering Results\");\n $body = \"<p>\".__(\"Use this to search for specific items. You can either enter plain text to match the item with, or use keywords:\").\"</pre>\";\n $body.= \"<h2>\".__(\"Keywords\").\"</h2>\";\n $body.= \"<cite><strong>\".__(\"Usage\").\"</strong>: <code>attr:val</code></cite>\\n\".__(\"Use this syntax to quickly match specific results. Keywords will modify the query to match items where <code>attr</code> is equal to <code>val</code> (case insensitive).\");\n break;\n case \"slugs\":\n $title = __(\"Post Slugs\");\n $body = __(\"Post slugs are strings to use for the URL of a post. They are directly responsible for the <code>(url)</code> attribute in a post's clean URL, or the <code>/?action=view&amp;url=<strong>foo</strong></code> in a post's dirty URL. A post slug should not contain any special characters other than hyphens.\");\n break;\n case \"trackbacks\":\n $title = __(\"Trackbacks\");\n $body = __(\"Trackbacks are special urls to posts from other blogs that your post is related to or references. The other blog will be notified of your post, and in some cases a comment will automatically be added to the post in question linking back to your post. It's basically a way to network between blogs via posts.\");\n break;\n case \"alternate_urls\":\n $title = __(\"Alternate URL\");\n $body = \"<p>\".__(\"An alternate URL will allow you to keep Chyrp in its own directory, while having your site URLs point to someplace else. For example, you could have Chyrp in a <code>/chyrp</code> directory, and have your site at <code>/</code>. There are two requirements for this to work.\").\"</p>\\n\\n\";\n $body.= \"<ol>\\n\\t<li>\".__(\"Create an <code>index.php</code> file in your destination directory with the following in it:\").\"\\n\\n\";\n $body.= \"<pre><code>&lt;?php\n require \\\"path/to/chyrp/index.php\\\";\n?&gt;</code></pre>\";\n $body.= \"</li>\\n\\t<li>\".__(\"Move the .htaccess file from the original Chyrp directory, and change the <code>RewriteBase</code> line to reflect the new website location.\").\"</li>\\n</ol>\";\n }\n\n require \"help.php\";\n }", "private function printMenu() {\n\t\t$this->logo();\n\t\t$this->line(\"Please select the number of options below:\");\n\t\t$action = $this->choice('Main Menu', $this->menu);\n\t\t$this->processAction($action);\n\t}", "public function displaySearch()\n\t{\n\t\t$conditions = new Conditions(self::searchFormHandler());\n\t\tself::view('listing/listingSearch', [\n\t\t\t'category' => $conditions->category,\n\t\t\t'search' => $conditions->search,\n\t\t\t'seller' => $conditions->seller]);\n\t}", "function actionShowHelpSelection() {\n\t $this->getInputManager()->setLookupGlobals(utilityInputManager::LOOKUPGLOBALS_GET);\n\t $data = $this->getInputManager()->doFilter();\n\n\t $this->addInputToModel($data, $this->getModel());\n\t \n\t $oView = new helpPagesView($this);\n\t $oView->showHelpContentsSelection();\n }", "public function indexAction() {\n\t\t\t$page_menu = $this->getPageMenu();\n\t\t\tif ( 'options' === $page_menu[ $this->getResultId() ]['type'] ) {\n\t\t\t\t$this->showOptions();\n\t\t\t} else {\n\t\t\t\t$this->showPage();\n\t\t\t}\n\t\t}", "function printSearchHeader($restriction, $isbn, $title, $author, $page, $num_pages, $num_results, $display, $orderby) {\n\t\techo '<br/><strong>'.$num_results.' book(s) found!</strong><br/>';\n\t\t\n\t\t\n\t\techo 'Parameters to search:<br/>';\n\t\techo 'isbn->\"'.$isbn.'\"<br/>';\n\t\techo 'title->\"'.$title.'\"<br/>'; \n\t\techo 'author->\"'.$author.'\"<br/>';\n\t\t//echo 'restriction->\"'.$restriction.'\"<br/>';\n\t\techo 'display->\"'.$display.'\"<br/>';\n\t\techo 'ordered by->\"'.$orderby.'\"<br/><br/>';\n\t\t\n\t}", "public function displayAutocompleteSuggest()\n\t{\n\t\tif($this->oPrediggoConfig->web_site_id_checked\n\t\t&& $this->oPrediggoConfig->search_active\n\t\t&& $this->oPrediggoConfig->autocompletion_active)\n\t\t\treturn $this->display(__FILE__, 'views/templates/hook/autocomplete_suggest.tpl');\n\t}", "function Search_showResults() {\n\tglobal $PLUGINS;\n\t// { variables\n\tglobal $PAGEDATA;\n\t$start=(int)@$_REQUEST['start'];\n\t$search=@$_REQUEST['search'];\n\tif (!$search) {\n\t\treturn '<em id=\"searchResultsTitle\">no search text entered</em>';\n\t}\n\t$c='';\n\t// }\n\t// { pages\n\t$q=dbAll(\n\t\t'select * from pages where (name like \"%'.$search.'%\" or body like \"%'\n\t\t.$search.'%\") order by edate desc limit '.$start.',20'\n\t);\n\t$n=count($q);\n\tif ($n>0) {\n\t\tforeach ($q as $p) {\n\t\t\tPage::getInstance($p['id'], $p);\n\t\t}\n\t\t$q=array_slice($q, $start, 20);\n\t\t$c.='<h2>Page Search Results</h2><em id=\"searchResultsTitle\">';\n\t\tif ($n==1) {\n\t\t\t$c.='1 result found';\n\t\t}\n\t\telse {\n\t\t\t$c.=$n . ' results found';\n\t\t}\n\t\t$c.='</em> <div>';\n\t\tif ($start>0) {\n\t\t\t$c.='[<a href=\"'.$PAGEDATA->getRelativeURL().'?search='\n\t\t\t\t.urlencode($search).'&amp;start='.($start-20).'\">previous 20</a>] ';\n\t\t}\n\t\tif ($start+20<$n) {\n\t\t\t$c.='[<a href=\"'.$PAGEDATA->getRelativeURL().'?search='\n\t\t\t\t.urlencode($search).'&amp;start='.($start+20).'\">next 20</a>] ';\n\t\t}\n\t\t$c.='<ol start=\"'.($start+1).'\" id=\"searchResults\">';\n\t\tforeach ($q as $r) {\n\t\t\t$title=($r['title']=='')?$r['name']:$r['title'];\n\t\t\t$c.='<li><h4>'.htmlspecialchars($title).'</h4>'\n\t\t\t\t.'<p>'.substr(preg_replace('/<[^>]*>/', '', $r['body']), 0, 200)\n\t\t\t\t.'...<br /><a href=\"/'.urlencode($r['name']).'?search='.$search\n\t\t\t\t.'\">/'.htmlspecialchars($r['name']).'</a></p></li>';\n\t\t}\n\t\t$c.='</ol></div>';\n\t}\n\t// }\n\t// { others\n\tforeach ($PLUGINS as $plugin) {\n\t\tif (@$plugin['search']) {\n\t\t\t$c.=$plugin['search']();\n\t\t}\n\t}\n\t// }\n\tif (!$c) {\n\t\treturn '<em id=\"searchResultsTitle\">'\n\t\t\t.__('no results found', 'core').'</em>';\n\t}\n\treturn $c;\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
public function reset($connection_group = NULL) Resets the connection to the default used for all the model
public function reset() { if(isset($connection_group)) { $this->_database->close(); $this->_set_connection(); } return $this; }
[ "public function resetConnections() : void {}", "public function resetConnection()\n {\n if(isset($connection_group))\n {\n $this->_database->close();\n $this->_setConnection();\n }\n return $this;\n }", "public static function resetConnection()\r\n {\r\n self::$_dbAdapter = null;\r\n }", "public static function reset() {\n // Reset the connection\n \\Config::set('database.default', 'mysql');\n\n // Reconnect to the default DifferDB database\n \\DB::reconnect('mysql');\n }", "public static function clearOverrideConnection()\n {\n unset(static::$connections['override']);\n }", "public function resetDAL();", "public static function resetConnection() {\n\t\tself::$redis = null;\n\t}", "public static function resetAdapter()\r\n {\r\n self::$_adapter = self::DEFAULT_ADAPTER;\r\n }", "public function reset()\n\t{\n\t\t$this->resetSql();\n\t}", "public function reset()\n {\n $this->models = [];\n $this->operations = [];\n $this->serviceDescription = null;\n }", "private function _resetConnection() {\n // Release the DB connection\n unset($this->_conn);\n $this->_conn = null;\n\n // Clear the prepared statement cache\n $this->_statementCache->clear();\n }", "public function clearConnection()\n {\n $this->_connection = null;\n }", "public function reset()\n {\n $this->send(\"RESET\");\n }", "public static function reset(){\n\t\tforeach(self::$_INSTANCES as $instance){\n\t\t\t//$instance->close();\n\t\t\t$instance->connect();\n\t\t}\n\t}", "public function reset() {\n\n\t\t\t$this->data = $this->defaults;\n\t\t}", "static function dropAllConnection(){\r\n foreach(self::I()->connection as $name => &$connection)\r\n {\r\n $connection = null;\r\n unset(self::I()->connection[$name]);\r\n }\r\n }", "public static function resetModel() {\n \tself::$model = array();\n \tself::$counter = array();\n \tGraph::$graph = array();\n }", "public function reset() {\n $this::$nid = NULL;\n }", "public function resetDataModel() {\r\n $this->arrModel = array();\r\n $intPackageId = NULL;\r\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ Activate user's account action
public function activateAction() { // already logged in ? if ($this->auth->hasIdentity()) return $this->_helper->redirector('index', 'site'); // find user by hash $result = $this->user->getMapper()->findByField('SHA1(CONCAT(password, id))', $this->request->getParam('hash'), $this->user); if (is_array($result) && count($result) > 0) { $user = reset($result); /* * add user as member of Petolio Service: Upgrade Service */ if ( $user->getActive() != 1 ) { $service = new Petolio_Model_PoServices(); $service->find(570); // service id is 570 <HARDCODED> if ( $service->getId() ) { // service was found $link = new Petolio_Model_PoServiceMembersUsers(); $link->setUserId($user->getId()); $link->setServiceId($service->getId()); $link->setStatus(1); // accepted link $link->save(); } } // activate $user->setActive(1)->save(); // msg $this->msg->messages[] = $this->translate->_("Your account was activated with success."); } else $this->msg->messages[] = $this->translate->_("User does not exists."); // redirect return $this->_helper->redirector('index', 'site'); }
[ "function activate()\n\t{\n\t\t$user_id\t\t= $this->uri->segment(3);\n\t\t$new_email_key\t= $this->uri->segment(4);\n\n\t\t// Activate user\n\t\tif ($this->tank_auth->activate_user($user_id, $new_email_key)) {\t\t// success\n\t\t\t$this->tank_auth->logout();\n\t\t\t$this->_show_message($this->lang->line('auth_message_activation_completed').' '.anchor('/auth/login/', 'Login'));\n\n\t\t} else {\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// fail\n\t\t\t$this->_show_message($this->lang->line('auth_message_activation_failed'));\n\t\t}\n\t}", "public function activateAction()\n {\n $process = User::activate($this->route_params['token']);\n\n if($process){\n Flash::addMessage('Account activated successfully','success');\n $this->redirect('/Login/index');\n }else{\n Flash::addMessage('Oops! Can\\'t activate your account. Activation link is too old or wrong.','danger');\n $this->redirect('/register/activation');\n }\n\n\n }", "public function activate() {\r\n\t\t$this->updateUser(array(\"is_activated\" => 1));\r\n\t}", "function activate()\n\t{\n\t\t$user_id\t\t= $this->uri->segment(3);\n\t\t$new_email_key\t= $this->uri->segment(4);\n\n\t\t// Activate user\n\t\tif ($this->tank_auth->activate_user($user_id, $new_email_key)) {\t\t// success\n\t\t\t$this->tank_auth->logout();\n\t\t\t//$this->_show_message($this->lang->line('auth_message_activation_completed').' '.anchor('/auth/login/', 'Login'));\n\t\t\t$this->session->set_flashdata('message', $this->lang->line('auth_message_activation_completed'));\n\t\t\t\t\t\tredirect('/auth/login');\n\n\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// fail\n\t\t\t$this->session->set_flashdata('message', $this->lang->line('auth_message_activation_failed'));\n\t\t\tredirect('/auth/login');\n\t\t\t//$this->_show_message($this->lang->line('auth_message_activation_failed'));\n\t\t}\n\t}", "function activate()\n\t{\n\t\t$user_id\t\t= $this->uri->segment(3);\n\t\t$new_email_key\t= $this->uri->segment(4);\n\n\t\t// Activate user\n\t\tif ($this->tank_auth->activate_user($user_id, $new_email_key))\n\t\t{\n\t\t\t// success\n\t\t\t//Add it into newletter\n\t\t\t$user = $this->database->GetUserById($user_id);\n\t\t\tadd_subscriber($user['email'], $user['username']);\n\t\t\t\n\t\t\t$this->tank_auth->logout();\n\t\t\t$this->_show_message($this->lang->line('auth_message_activation_completed').' '.anchor('/auth/login/', 'Login'));\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// fail\n\t\t\t$this->_show_message($this->lang->line('auth_message_activation_failed'));\n\t\t}\n\t}", "public function action_activateaccount()\n\t{\n\t\tglobal $context, $modSettings;\n\n\t\tisAllowedTo('moderate_forum');\n\n\t\tif (isset($this->_req->query->save, $this->_profile['is_activated'])\n\t\t\t&& $this->_profile['is_activated'] != 1)\n\t\t{\n\t\t\trequire_once(SUBSDIR . '/Members.subs.php');\n\n\t\t\t// If we are approving the deletion of an account, we do something special ;)\n\t\t\tif ($this->_profile['is_activated'] == 4)\n\t\t\t{\n\t\t\t\tdeleteMembers($context['id_member']);\n\t\t\t\tredirectexit();\n\t\t\t}\n\n\t\t\t// Actually update this member now, as it guarantees the unapproved count can't get corrupted.\n\t\t\tapproveMembers(array('members' => array($context['id_member']), 'activated_status' => $this->_profile['is_activated']));\n\n\t\t\t// Log what we did?\n\t\t\tlogAction('approve_member', array('member' => $this->_memID), 'admin');\n\n\t\t\t// If we are doing approval, update the stats for the member just in case.\n\t\t\tif (in_array($this->_profile['is_activated'], array(3, 4, 13, 14)))\n\t\t\t{\n\t\t\t\tupdateSettings(array('unapprovedMembers' => ($modSettings['unapprovedMembers'] > 1 ? $modSettings['unapprovedMembers'] - 1 : 0)));\n\t\t\t}\n\n\t\t\t// Make sure we update the stats too.\n\t\t\trequire_once(SUBSDIR . '/Members.subs.php');\n\t\t\tupdateMemberStats();\n\t\t}\n\n\t\t// Leave it be...\n\t\tredirectexit('action=profile;u=' . $this->_memID . ';area=summary');\n\t}", "public function activateUser()\n {\n $i = Input::except('_token');\n $user = \\User::find($i['id']);\n $user->user_active = $i['userActive'];\n $user->save();\n }", "function activate_account(){\n\t\t$data['title']\t= 'Procurement System';\n\t\t$data['main_content'] \t= 'home/user_activation';\n\t\t$data['page']\t\t= 'user_activation';\n\t\t$this->load->view('home/default/template',$data);\n\t}", "public function activateAccount()\n {\n // Decode email and token\n $this->email = urldecode($this->email);\n $this->token = urldecode($this->token);\n\n $result = \"\";\n // Get the key corresponding to the email provided\n $stmt = $this->pdo->prepare(\"SELECT activation_key, activation FROM storagehost_hosting.user WHERE email = :email\");\n if ($stmt->execute(\n array(\n ':email' => $this->email,\n )\n ) && $row = $stmt->fetch()) {\n $key_db = $row['activation_key']; // Get the key from the DB\n $activation_status = $row['activation']; // Get the activation status from the DB (the value is either 0 or 1)\n }\n\n // Testing the value of $activation_status.\n // If the value in the column of the activation status is 1 (account already enabled), we redirect to another page.\n if ($activation_status == '1') {\n $result .= \"already_enabled\";\n // We start the comparisons.\n } else {\n if ($this->token == $key_db) {\n // The program should then update the activation status in the DB\n $stmt = $this->pdo->prepare('UPDATE storagehost_hosting.user SET activation = 1 WHERE email = :email');\n $stmt->bindParam(':email', $this->email);\n $stmt->execute();\n\n // If the keys are the same, we redirect to another page.\n $result .= 'ok';\n\n // And finally, if the two are different, we redirect to an error page.\n } else {\n $result .= false;\n }\n }\n return $result;\n }", "public function activate_account($id)\n {\n\t\n\t\t//update user to active\n\t\t$query = \"UPDATE user SET activated =1 WHERE id=$id \";\n\t\t//preper statment\n\t\t$stmt = $this->_db->prepare($query);\n\t\t//execute\n\t\t$stmt->execute();\n\t}", "function activate_user(){\n\t\t$encoded_email = ee()->TMPL->fetch_param('email');\n\t\t$email = base64_decode($encoded_email);\n\t\t$query = ee()->db->query(\"UPDATE exp_members SET group_id = 6 WHERE email = '$email'\");\n\t\t\n\t\tif($query){\n\t\t\theader(\"Location: /account/activated\");\n\t\t\texit;\n\t\t}\n\t\t\n\t}", "public function activate($user);", "public function activateBCAccount() {\n\t\t$this->_dbAdapter->updateBCAccountActive($this->getSubBCAccountInfo(\"Id\"));\n\t}", "public function activate($id) {\n\t\ttry {\n\t\t\tif ($this->User->activate($id)) {\n $this->Session->setFlash(__d('access', 'Account activated.', true), 'success');\n\t\t\t} else {\n $this->Session->setFlash(__d('access', 'No changes. Account activated yet.', true), 'success');\n\t\t\t}\n\t\t} catch (InvalidArgumentException $e) {\n $this->Session->setFlash(\n __d('access', 'Invalid User or User was active. No account was activated.', true),\n 'alert'\n );\n\t\t} catch (Exception $e) {\n $this->Session->setFlash(\n __d('access', 'Account activated, but I\\'ve been unable to send email.', true),\n 'alert'\n );\n\t\t}\n\t\t$this->redirect($this->referer());\n\t}", "public function activateUser() {\r\n\t\t$user_activation_model = $this->load_model('UserActivationModel');\r\n\t\t\r\n\t\t//if the hash is valid and 24 hours haven't passed yet\r\n\t\tif($user_activation_model->checkHash($this->params['user_id'], $this->params['hash'])){\r\n\t\t\tif($user_activation_model->activateUser($this->params['user_id'])){\r\n\t\t\t\t$this->sendResponse(1, true);\r\n\t\t\t}else{\r\n\t\t\t\t$this->sendResponse(0, false);\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\t$this->sendResponse(0, false);\r\n\t\t}\r\n\t\t\r\n\t}", "public function activatedAction()\n {\n View::renderTemplate('User/Signup/activated.html');\n }", "function activateUser()\n {\n // Sets the value of activated to yes\n $int = 1;\n\n $mysqli = $this->conn;\n\n /* Prepared statement, stage 1: prepare */\n if (!($stmt = $mysqli->prepare(\"UPDATE User SET \n \t\tactiveUser = ?\n \t\t\tWHERE ID = ?\"))\n ) {\n echo \"Prepare failed: (\" . $mysqli->errno . \") \" . $mysqli->error;\n }\n\n /* Prepared statement, stage 2: bind and execute */\n\n if (!($stmt->bind_param(\"ii\",\n $int,\n $this->id))\n ) {\n echo \"Binding parameters failed: (\" . $stmt->errno . \") \" . $stmt->error;\n }\n\n if (!$stmt->execute()) {\n echo \"Execute failed: (\" . $stmt->errno . \") \" . $stmt->error;\n }\n\n }", "public function activateAction()\n\t{\n\t\tif ($this->hasIdentity()) {\n\t\t\treturn $this->redirect()->toUrl('/');\n\t\t}\n\t\t\n\t\t$sl = $this->getServiceLocator();\n\t\t$key = $this->getRequest()->getQuery('key', false);\n\t\t/* @var $userCollection \\HtUser\\Model\\UserCollection */\n\t\t$authInternal = $sl->get('AuthAccountInternal');\n\t\t/* @var $authInternal \\HtAuthentication\\Model\\Adapter\\Internal */\n\t\t$internalLogin = $authInternal->getOne(array('activation_key' => $key));\n\n\t\tif (!$internalLogin || !$key) {\n\t\t\treturn array('errorMessage' => $this->translate('Invalid activation key.'));\n\t\t}\n\n\t\tif ($internalLogin->getIsActivated()) {\n\t\t\treturn array('errorMessage' => $this->translate('User is already activated.'));\n\t\t}\n\n\t\t$authAccount = $sl->get('AuthAccount');\n\t\t/* @var $authAccount \\HtAuthentication\\Model\\AuthenticationAccount */\n\n\t\tif (!$authAccount->load($internalLogin->getAuthenticationAccountId())) {\n\t\t\treturn array('errorMessage' => $this->translate('Not found authentication account.'));\n\t\t}\n\n\t\t/* @var $user \\HtUser\\Model\\User */\n\t\t$user = $sl->get('User');\n\n\t\tif (!$user->load($authAccount->getUserId())) {\n\t\t\treturn array('errorMessage' => $this->translate('Not found user.'));\n\t\t}\n\n\t\t$connection = $this->getConnection();\n\t\ttry {\n\t\t\t$connection->beginTransaction();\n\t\t\t$user->setIsEnabled(true);\n\t\t\t$user->save();\n\t\t\t$internalLogin->setIsActivated(true);\n\t\t\t$internalLogin->save();\n\n\t\t\t/* @var $userApp \\HtAuthentication\\Model\\UserApplication */\n\t\t\t$userApp = $sl->get('UserApp');\n\t\t\t$userApp->setDefaultApplicationAndServer($user);\n\n\t\t\t//@todo: may make a separate method for this and move Register and Login controller to HtAuthentication\n\t\t\t//auto log user in\n\t\t\t//Set up the authentication adapter\n\t\t\t$identity = $user->toStdClass();\n\t\t\t$identity->authenticationProvider = AuthenticationAccount::TYPE_INTERNAL;\n\n\t\t\t$this->logUserIn($identity);\n\n\t\t\t$this->writeLog(Log::TYPE_LOGIN_SUCCESS, $this->translate('Activated internal login success.'));\n\t\t\t$connection->commit();\n\t\t} catch(\\Exception $e) {\n\t\t\t$connection->rollback();\n\t\t\tthrow $e;\n\t\t}\n\n\t\t$this->flashMessenger()->addSuccessMessage($this->translate('Activate successfully! Please start create profile'));\n\t\treturn $this->redirect()->toRoute('profile');\n\t}", "public function activateAccount(ActiveRecord $model);" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns strings for the operations.
function operationStrings() { return array( 'tab title' => 'Tokens', ) + parent::operationStrings(); }
[ "function operationStrings() {\n return array(\n 'tab title' => 'Form',\n 'page title' => '@label',\n 'button label' => t('Perform action'),\n 'confirm question' => t('Are you sure you want to proceed?'),\n 'submit message' => t('Action completed on %entity-type %label.', array(\n // This intentionally has no replacements for the placeholders; these\n // are replaced in getOperationString().\n )),\n );\n }", "function operationStrings() {\n return array(\n 'tab title' => 'View',\n ) + parent::operationStrings();\n }", "protected function operationsToString($operations)\n {\n $out = [];\n foreach ($operations as $operation) {\n $out[] = implode(' ', $operation);\n }\n\n return implode(\"\\n\", $out);\n }", "public function getOperation(): string;", "public function getOperations();", "public function getOperations()\n {\n return $this->operations;\n }", "public function getOpDescription()\n {\n\n return $this->op_description;\n }", "public function getSelectedOperations() {\n $selectedOperations = \"\";\n if (isset($_POST[self::$fahrenheitToCelsius])) {\n $selectedOperations .= \"1\";\n }\n if (isset($_POST[self::$celsiusToFahrenheit])) {\n $selectedOperations .= \"2\";\n }\n if (isset($_POST[self::$milesToKilometers])) {\n $selectedOperations .= \"3\";\n }\n if (isset($_POST[self::$kilometersToMiles])) {\n $selectedOperations .= \"4\";\n }\n if (isset($_POST[self::$inchesToCentemeters])) {\n $selectedOperations .= \"5\";\n }\n if (isset($_POST[self::$centemetersToInches])) {\n $selectedOperations .= \"6\";\n }\n if (isset($_POST[self::$poundsToKilograms])) {\n $selectedOperations .= \"7\";\n }\n if (isset($_POST[self::$kilogramsToPounds])) {\n $selectedOperations .= \"8\";\n }\n return $selectedOperations;\n }", "public static function operators() {\n\t\treturn apply_filters( 'vsp/price_calculation/operators', array(\n\t\t\t'add' => esc_html__( 'Add (+)', 'vsp-framework' ),\n\t\t\t'sub' => esc_html__( 'Subtract (-)', 'vsp-framework' ),\n\t\t) );\n\t}", "protected function methodsToString()\n {\n $string = '';\n foreach ( $this->getMethods() as $method )\n {\n $string .= $method->__toString( ' ' ) . PHP_EOL;\n }\n return $string;\n }", "public function operationName(): string\n {\n return $this->operationName;\n }", "public static function getStringRepresentationRequestMethods()\n {\n $output = '';\n foreach (REQUEST_METHODS as $request_method) {\n $output .= ' ' . $request_method;\n }\n return $output;\n }", "protected abstract function getOperationName();", "private function _getOperationOptions()\n {\n return array(\n '' => __('All Actions'),\n HistoryLogEntry::OPERATION_CREATE => __('Record Created'),\n HistoryLogEntry::OPERATION_UPDATE => __('Record Updated'),\n HistoryLogEntry::OPERATION_DELETE => __('Record Deleted'),\n HistoryLogEntry::OPERATION_IMPORT => __('Record Imported'),\n HistoryLogEntry::OPERATION_EXPORT => __('Record Exported'),\n );\n }", "public function getOperatorName() {\n\t\treturn array(\n\t\t\t'first-name' => $this->user->first_name,\n\t\t\t'last-name' => $this->user->last_name,\n\t\t);\n\t}", "public function toString()\n {\n $action_string = '';\n if (is_string($this->action))\n {\n $action_string = $this->action;\n }\n else if (is_array($this->action))\n {\n if (is_object($this->action[0]))\n {\n $action_string = get_class($this->action[0]) . '::' . $this->action[1];\n }\n else\n {\n $action_string = $this->action[0] . '::' . $this->action[1];\n }\n }\n return $action_string;\n }", "public function get_ops() {\n return array($this->arg1_val, $this->arg2_val);\n }", "public function getOperation()\n\t{\n\t\treturn $this->operation; \n\n\t}", "public function dataForTestGetOperatorMethod()\n {\n return [\n [Calculator::OP_ADD, 'add'],\n [Calculator::OP_DIV, 'div'],\n [Calculator::OP_MOD, 'mod'],\n [Calculator::OP_MUL, 'mul'],\n [Calculator::OP_SUB, 'sub'],\n ];\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Recursively collects complex type dependencies
private function collectComplexTypeDependencies(&$complexTypeRefs) { foreach ($complexTypeRefs as $complexTypeRef) { $dependencies = $complexTypeRef->getPropertyDependencies(); foreach ($dependencies as $dependency) { if (!array_key_exists($dependency->getName(), $complexTypeRefs)) { $complexTypeRefs[$dependency->getName()] = $dependency; $this->collectComplexTypeDependencies($complexTypeRefs); } } } }
[ "protected static function rebuildDependencyTree() {\n foreach (static::$classNames as $class => $classDetails) {\n if (!empty($classDetails['extends'])) {\n static::$classNames[ltrim($classDetails['extends'], '\\\\')]['extenders'][] = $class;\n }\n if (!empty($classDetails['implements'])) {\n foreach ($classDetails['implements'] as $implement) {\n static::$classNames[ltrim($implement, '\\\\')]['implementers'][] = $class;\n }\n }\n }\n foreach (static::$classNames as $class => &$classDetails) {\n if (!empty($classDetails['extenders'])) {\n $classDetails['extenders'] = array_unique($classDetails['extenders']);\n }\n if (!empty($classDetails['implementers'])) {\n $classDetails['implementers'] = array_unique($classDetails['implementers']);\n }\n }\n }", "public function initializeTypeDependencies(): void\n {\n }", "function etbx_info_sort_by_dependencies(array $data) {\n // Sorting dependencies to avoid errors during build.\n $dependencies = array();\n $filtered = array_filter_by_value($data, TRUE, 'fieldable');\n foreach ($filtered as $type => $info) {\n if (!empty($info['dependencies'])) {\n foreach ($info['dependencies'] as $dependency) {\n $dependencies[$dependency][] = $type;\n }\n }\n }\n foreach ($dependencies as $dependency => $dependents) {\n $weight = count($dependencies[$dependency]) * -1;\n $filtered[$dependency]['weight'] = $weight;\n }\n uasort($filtered, 'drupal_sort_weight');\n $data_ = array();\n foreach ($filtered as $f => $i) {\n $data_[$f] = $i;\n $data_[$f . '_type'] = $data[$f . '_type'];\n }\n\n return $data_;\n}", "protected function _buildFieldsByType()\n {\n $this->object_fields_by_type = array(\n 'num'=>array(),\n 'str'=>array(),\n 'rel'=>array()\n );\n foreach ($this->getStructureEntry('structure') as $_field=>$_data) {\n if (\n preg_match('/^integer(\\((.*)\\))?/i', $_data['type']) ||\n preg_match('/^float(\\((.*)\\))?/i', $_data['type'])\n ) $this->object_fields_by_type['num'][] = $_field;\n elseif (\n preg_match('/^varchar(\\((.*)\\))?/i', $_data['type']) ||\n preg_match('/(.*)text$/i', $_data['type'])\n ) $this->object_fields_by_type['str'][] = $_field;\n elseif (\n preg_match('/^(.*)_id$/i', $_data['type'])\n ) $this->object_fields_by_type['rel'][] = $_field;\n }\n }", "public function visitComplex(\\stdClass $data, Property\\ComplexType $property, $path);", "protected function _build__elements() {\n $collect = array();\n\n foreach ( $this->_json->elements as $element ) {\n $collect[] = $this->_getModule( $element->type, $element );\n }\n\n return $collect;\n }", "public function calculateDependencies();", "private\nfunction getDeps($name)\n{\n $paths = array();\n foreach ($this->files[$name]->deps as $dependant) {\n $_paths = $this->getDeps($dependant);\n if (count($_paths)) {\n $paths = \\array_merge($paths, $_paths);\n }\n }\n if ($this->files[$name]->path) {\n $paths[] = $this->files[$name]->path;\n }\n return $paths;\n}", "function tidy_get_nodes_recursive($node, $type, array $attributes, &$result){\n\t\tif($node != null){\n\t\t\tif (\n\t\t\t\t@$node->id == $type\n\t\t\t\t and ! empty ($attributes)\n\t\t\t\t and count ($attributes) == count (array_intersect_assoc ($attributes, (array)$node->attribute))\n\t\t\t ) $result[] = $node;\n\n\t\t\tif ($node->child != null){\n\t\t\t\tforeach($node->child as $child){\n\t\t\t\ttidy_get_nodes_recursive($child, $type, $attributes, $result);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "private function collect(): array\n {\n if ($this->ref instanceof \\ReflectionClass\n || $this->ref instanceof \\ReflectionObject) {\n return Objects::getInterfaces($this->ref->name);\n }\n\n $ret = [];\n\n if ($this->ref instanceof \\ReflectionMethod\n || $this->ref instanceof ReflectionCallable) {\n $ret = array_filter(\n $this->ref->getDeclaringClass()->getInterfaces(),\n fn($ref) => (\n $ref->hasMethod($this->ref->name) &&\n $ref->getMethod($this->ref->name)->class == $ref->name\n )\n );\n } elseif ($this->ref instanceof \\ReflectionClassConstant) {\n $ret = array_filter(\n $this->ref->getDeclaringClass()->getInterfaces(),\n fn($ref) => (\n $ref->hasConstant($this->ref->name) &&\n $ref->getReflectionConstant($this->ref->name)->class == $ref->name\n )\n );\n }\n\n return array_values($ret);\n }", "abstract function get_prerequisites();", "public function completeDependencies()\n {\n foreach($this->dependencies as $details) {\n foreach($details as $dependency) {\n isset($this->dependencies[$dependency]) or $this->dependencies[$dependency] = array();\n }\n }\n }", "public function getIndirectSubclasses();", "protected function initChildren() {\n foreach ($this->datas as $name => $data) {\n $fields = $data->getDefinition()->getFieldNames();\n foreach ($fields as $field) {\n if ($data->getDefinition()->getType($field) == 'reference') {\n $this->datas[$data->getDefinition()->getSubTypeField($field, 'reference', 'entity')]->getDefinition()->addChild($data->getDefinition()->getTable(), $field, $name);\n }\n }\n }\n }", "public function getDependencies()\n {\n // Get our interfaces\n $result = $this->implements;\n\n // We got an error that this is nor array, weird but build up a final frontier here\n if (!is_array($result)) {\n $result = array($result);\n }\n\n // Add our parent class (if any)\n if (!empty($this->extends)) {\n $result[] = $this->extends;\n }\n\n return $result;\n }", "abstract public function modelReflectionSets();", "public function getDependencies()\n {\n $dependencies = array();\n if ($this->extendsClassDefinition) {\n $classDefinition = $this->extendsClassDefinition;\n if (method_exists($classDefinition, 'increaseDependencyRank')) {\n $dependencies[] = $classDefinition;\n }\n }\n\n if ($this->implementedInterfaceDefinitions) {\n foreach ($this->implementedInterfaceDefinitions as $interfaceDefinition) {\n if (method_exists($interfaceDefinition, 'increaseDependencyRank')) {\n $dependencies[] = $interfaceDefinition;\n }\n }\n }\n return $dependencies;\n }", "function _kapi_manager_getDependenciesSchema() {\n $schema = array(\n 'descritpion' => t('Stores dependecies of products'),\n 'fields' => array(\n 'product_id' => array(\n 'type' => 'int',\n 'unsigend' => TRUE,\n 'not null' => TRUE,\n 'description' => t('The product ID'),\n ),\n 'dependency_id' => array(\n 'type' => 'int',\n 'unsigend' => TRUE,\n 'not null' => TRUE,\n 'description' => t('The product ID of a dependency product'),\n ),\n 'factor' => array(\n 'type' => 'float',\n 'unsigend' => TRUE,\n 'not null' => TRUE,\n 'description' => t('The factor of the dependency product'),\n )\n ),\n 'unique keys' => array(\n 'dep' => array('product_id', 'dependency_id'),\n ),\n 'foreign_keys' => array(\n 'table' => 'kapi_manager_products',\n 'columns' => array(\n 'product_id' => 'id',\n 'dependency_id' => 'id',\n ),\n ),\n 'index' => array(\n 'idx_product_id' => array('product_id'),\n )\n );\n return $schema;\n}", "public function mark_dependencies() {\n\t\t$items = $this->items;\n\n\t\t$venue_global_ids = array();\n\t\t$organizer_global_ids = array();\n\n\t\tforeach ( $items as &$item ) {\n\t\t\t$item = (object) $item;\n\t\t\t$item->depends_on = array();\n\n\t\t\tif ( isset( $item->venue ) ) {\n\t\t\t\t$venue = (object) $item->venue;\n\t\t\t\tif ( ! isset( $venue->global_id ) ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t$venue_global_id = $venue->global_id;\n\t\t\t\tif ( in_array( $venue_global_id, $venue_global_ids, true ) ) {\n\t\t\t\t\t$item->depends_on[] = $venue_global_id;\n\t\t\t\t} else {\n\t\t\t\t\t$venue_global_ids[] = $venue_global_id;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( isset( $item->organizer ) ) {\n\t\t\t\t$organizers = $item->organizer;\n\n\t\t\t\tif ( is_object( $item->organizer ) ) {\n\t\t\t\t\t$organizers = array( $item->organizer );\n\t\t\t\t}\n\n\t\t\t\tforeach ( $organizers as $organizer ) {\n\t\t\t\t\t$organizer = (object) $organizer;\n\t\t\t\t\tif ( ! isset( $organizer->global_id ) ) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\t$organize_global_id = $organizer->global_id;\n\t\t\t\t\tif ( in_array( $organize_global_id, $organizer_global_ids, true ) ) {\n\t\t\t\t\t\t$item->depends_on[] = $organize_global_id;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$organizer_global_ids[] = $organize_global_id;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ( empty( $item->depends_on ) ) {\n\t\t\t\tunset( $item->depends_on );\n\t\t\t}\n\t\t}\n\n\t\t$this->items = $items;\n\n\t\treturn $this;\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get the prenom employe.
public function getPrenomEmploye(): ?string { return $this->prenomEmploye; }
[ "public function getPrenomEmploye() {\n return $this->prenomEmploye;\n }", "public function getPrenomE()\n {\n return $this->prenomE;\n }", "public function getAnalytiqueEmploye() {\n return $this->analytiqueEmploye;\n }", "public function getNomEmploye() {\n return $this->nomEmploye;\n }", "public function getQualiteEmploi() {\n return $this->qualiteEmploi;\n }", "public function getPrenom()\r\n\t{\r\n\t\treturn $this->_Prenom;\r\n\t}", "public function getNumeroEmploye() {\n return $this->numeroEmploye;\n }", "public function getEmprestimoId()\n {\n return $this->emprestimo_id;\n }", "public function getProfessionDuPere()\n {\n return $this->profession_du_pere;\n }", "public function getPresidente()\n {\n return $this->presidente;\n }", "public function getEmpleadoNss()\n {\n\n return $this->empleado_nss;\n }", "public function getProgramaEntrenamiento()\n\t{\n\t\treturn $this->programa_entrenamiento;\n\t}", "public function getempleado()\r\n {\r\n return $this->empleado;\r\n }", "public function getNom_employeur()\n {\n return $this->nom_employeur;\n }", "public function getCodeEmploye() {\n return $this->codeEmploye;\n }", "public function getPrenume()\n {\n return $this->prenume;\n }", "public function getParaleloOculto()\n {\n return $this->paraleloOculto;\n }", "public function getEmployee()\n {\n return $this->employee;\n }", "public function getProfesion()\n {\n return $this->hasOne(Profesiones::className(), ['id' => 'profesion_id'])->inverseOf('empleos');\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Check the ESI flag and set the ESI header if needed Events: http_response_send_before
public function setFlagHeaders( $eventObject ) { $response = $eventObject->getResponse(); if( Mage::helper( 'turpentine/esi' )->shouldResponseUseEsi() ) { $response->setHeader( 'X-Turpentine-Esi', Mage::registry( 'turpentine_esi_flag' ) ? '1' : '0' ); Mage::helper( 'turpentine/debug' )->logDebug( 'Set ESI flag header to: %s', ( Mage::registry( 'turpentine_esi_flag' ) ? '1' : '0' ) ); } }
[ "public function testEventBeforeSendHeaders(UnitTester $I)\n {\n $this->newFactoryDefault();\n\n $eventsManager = $this->getDI()->getShared('eventsManager');\n $eventsManager->attach('response:beforeSendHeaders', function (Event $event, $response) {\n return false;\n });\n\n $response = $this->getResponseObject();\n $response->setEventsManager($eventsManager);\n \n $I->assertFalse($response->sendHeaders());\n }", "function send_nosniff_header() {}", "function extraHeaders()\n {\n $status_string = @self::$status[$this->code];\n header('HTTP/1.1 '.$this->code.' '.$status_string);\n }", "public function setHeader() {\n \n header('X-Frame-Options: SAMEORIGIN');\n header('X-XSS-Protection: 1; mode=block');\n header('X-Content-Type-Options: nosniff');\n header('X-CSRF-Protection: OWASP CSRFP 1.0.0');\n header('Content-Type: text/html; charset=iso-8859-1'); \n\n $rewrite = array();\n\n foreach ( headers_list() as $header ) {\n if (strpos($header, 'Set-Cookie:') === false ) { \n continue; \n }\n\n if ( stripos($header, '; httponly' ) !== false ) {\n $rewrite[] = $header;\n continue;\n }\n $rewrite[] = $header . '; httponly';\n }\n\n if ( ! empty( $rewrite ) ) {\n header_remove('Set-Cookie');\n\n foreach ( $rewrite as $cookie ) {\n header($cookie, false);\n }\n\n }\n\n if ( \n $_SERVER['SERVER_PORT'] != 443 &&\n (! isset( $_SERVER['HTTP_X_FORWARDED_PROTO']) ||\n $_SERVER['HTTP_X_FORWARDED_PROTO'] != 'https') \n ) {\n return;\n }\n\n header('Strict-Transport-Security: max-age=16070400; includeSubDomains');\n }", "protected function valid_etag_response() {\n $this->rendered = true;\n $this->response = Response::build(304);\n }", "function send_nosniff_header()\n {\n }", "private static function setHeaders()\n {\n header('X-Powered-By: Intellivoid-API');\n header('X-Server-Version: 2.0');\n header('X-Organization: Intellivoid Technologies');\n header('X-Author: Zi Xing Narrakas');\n header('X-Request-ID: ' . self::$ReferenceCode);\n }", "public function setHeaderStart()\n\t\t\t{\n\t\t\t\tob_start();\n\t\t\t\theader(\"Pragma: no-cache\");\n\t\t\t\theader(\"Cache-Control: no-cache, must-revalidate\"); // HTTP/1.1\n\t\t\t\theader(\"Expires: 0\"); // Date in the past\n\t\t\t\theader(\"Content-type: text/xml; charset=iso-8859-1\");\n\t\t\t}", "public function InStock_WPNotifier_avoid_header_sent() {\n\t\t\tob_start();\n\t\t}", "public function canSetHeader()\n {\n return !headers_sent();\n }", "public function onKernelResponse( $event ) {\n\n if( !$this->framework->isInitialized() ) {\n return;\n }\n\n if( !\\Contao\\CMSConfig::get('testmode') ) {\n return;\n }\n\n $response = $event->getResponse();\n\n $response->headers->set('X-CMS-Test-Mode', 'active');\n }", "protected function setErrorHeader() {\n\t\tif ($this->response_code >= 400 && $this->response_code < 500) {\n\t\t\theader('HTTP/1.1 ' . $this->response_code . \" \" . SVException::g($this->response_code));\n\t\t\texit(0);\n\t\t}\n\t}", "public function alter_header()\n\t{\n\t\theader(\"HTTP/1.0 $this->code $this->title\");\n\t}", "protected function negotiateEtag() : void\n {\n // Content-Length is required by Firefox,\n // otherwise it does not send the If-None-Match header\n $this->setContentLength(\\strlen($this->getBody()));\n $etag = \\hash($this->autoEtagHashAlgo, $this->getBody());\n $this->setEtag($etag);\n $etag = '\"' . $etag . '\"';\n // Cache of unchanged resources:\n $ifNoneMatch = $this->getRequest()->getHeader(RequestHeader::IF_NONE_MATCH);\n if ($ifNoneMatch !== null\n && ($ifNoneMatch === $etag || $ifNoneMatch === 'W/' . $etag)\n && \\in_array(\n $this->getRequest()->getMethod(),\n [Method::GET, Method::HEAD],\n true\n )\n ) {\n $this->setNotModified();\n $this->setBody('');\n return;\n }\n // Avoid mid-air collisions:\n $ifMatch = $this->getRequest()->getHeader(RequestHeader::IF_MATCH);\n if ($ifMatch !== null && $ifMatch !== $etag) {\n $this->setBody('');\n $this->setStatus(Status::PRECONDITION_FAILED);\n }\n }", "protected function _sendHeadResponse()\n\t{\n\t\t$this->getResponse()\n\t\t ->setHttpResponseCode(200);\n\t}", "private function send_headers()\n\t{\n\t\tif (!empty(self::$headers[$this->error_code]) && !headers_sent()) {\n\t\t\t header(self::$headers[$this->error_code]);\n\t\t}\t\t\n\t}", "function check_esewa_response() {\n\n\t\t\t@ob_clean();\n\n\t\t\tif ( ! empty( $_REQUEST ) && $this->check_esewa_response_is_valid() ) {\n\n\t\t\t\tdo_action( 'valid-esewa-standard-response' );\n\n\t\t\t} else {\n\n\t\t\t\twp_die( 'eSewa Response Validation Failure' );\n\n\t\t\t}\n\n\t\t}", "public function start_etag_ob() {\n\t\tob_start();\n\t}", "public function sendHeadersOnly()\n {\n $this->sendCookies();\n http_response_code($this->statusCode);\n $this->sendHeaders();\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
determine signup contact categories
function getContactUsCategories(){ $query = "SELECT l.lookuptypevalue as optionvalue, l.lookupvaluedescription as optiontext FROM lookuptypevalue AS l INNER JOIN lookuptype AS v ON l.lookuptypeid = v.id WHERE v.name = 'CONTACTUS_CATEGORIES' "; return getOptionValuesFromDatabaseQuery($query); }
[ "function leaveregistration_user_insert(&$edit, $account, $category)\r\n{\r\n $email = $account->mail;\r\n $roles = array();\r\n foreach($account->roles as $rid => $name){\r\n $role = user_role_load($rid);\r\n $roles[$rid] = $role->name;\r\n }\r\n\r\n $results = civicrm_api(\"Contact\",\"get\", array ('version' => '3','sequential' =>'1', 'email' => $email));\r\n \r\n if (in_array('employee', $roles)) {\r\n $results = civicrm_api(\"Contact\",\"update\", array ('version' => '3','sequential' =>'1', 'id' => $results['values'][0]['contact_id'], 'contact_sub_type' =>'Employee'));\r\n }\r\n}", "protected function has_mailchimp_signup()\n {\n }", "function check_email_category($name,$emailcategory)\n{\n if($emailcategory>= 32)\n {\n if($name == \"test\")\n {\n return true;\n }\n $emailcategory -= 32;\n }\n\n if($emailcategory >= 16)\n {\n if($name == \"error\")\n {\n return true;\n }\n $emailcategory -= 16;\n }\n \n if($emailcategory >= 8)\n {\n if($name == \"warning\")\n {\n return true;\n }\n $emailcategory -= 8;\n }\n \n if($emailcategory >= 4)\n {\n if($name == \"configure\")\n {\n return true;\n }\n $emailcategory -= 4;\n }\n \n if($emailcategory >= 2)\n {\n if($name == \"update\")\n {\n return true;\n }\n }\n \n return false;\n}", "protected function registerCategory()\n {\n if (count(self::$parameter['categories']) == 1) {\n // we have exacly one category - the key contains the ID ...\n reset(self::$parameter['categories']);\n self::$category_type_id = key(self::$parameter['categories']);\n return $this->registerContact();\n }\n\n $form = $this->ContactForm->getFormContactCategory(\n self::$parameter['categories'],\n array('contact_type' => self::$contact_type));\n\n return $this->app['twig']->render($this->app['utils']->getTemplateFile(\n '@phpManufaktur/Contact/Template', 'command/register.contact.category.twig',\n $this->getPreferredTemplateStyle()),\n array(\n 'basic' => $this->getBasicSettings(),\n 'form' => $form->createView()\n ));\n }", "private function createSocialUsers() {\n $contacts = array();\n $contactsTypeToCreate = array(\n 'useractive' => array('percent' => 85),\n 'userpending' => array('percent' => 4, 'status' => 37),\n 'usersuspended' => array('percent' => 3, 'status' => 39),\n 'userarchive' => array('percent' => 1, 'status' => 41),\n 'userdeleted' => array('percent' => 2, 'status' => 40),\n 'modactive' => array('percent' => 1, 'type' => 'moderator'),\n 'usermoderator' => array('percent' => 2, 'type' => 'usermoderator'),\n 'contentmoderator' => array('percent' => 1, 'type' => 'contentmoderator'),\n 'userupdateonly' => array('percent' => 1, 'type' => 'updateonly')\n );\n\n $userCount = ($userCount < 1 ) ? round($userCount * 10) : round($userCount);\n $userType = $userType && $contactsToCreate[$userType] ? $userType : 'useractive';\n foreach ($contactsTypeToCreate as $contactsType => $contactInfo) {\n $userTypeCount = ($contactInfo['percent'] / 100) * $this->userCount;\n $userTypeCount = ($userTypeCount < 1 ) ? round($userTypeCount * 10) : round($userTypeCount);\n\n for ($u = 0; $u < $userTypeCount; $u++) {\n if ($u % 10 === 0) {\n $this->flushOutput();\n }\n $login = $this->generateRandomUserName();\n $contact = new Connect\\Contact();\n $contact->Login = $login;\n $contact->Name->First = $login;\n $contact->Name->Last = $login;\n $contact->NewPassword = '';\n\n $email = new Connect\\Email();\n $contact->Emails[0] = $email;\n $contact->Emails[0]->AddressType = new Connect\\NamedIDOptList();\n $contact->Emails[0]->AddressType->LookupName = \"Email - Primary\"; //Primary email\n $contact->Emails[0]->Address = $userType. '-'. $login . \"@social.com.invalid\";\n $contact->Emails[0]->Invalid = false;\n\n $this->saveObject($contact, $login);\n\n //Create Social User\n $socialUser = new Connect\\SocialUser();\n\n $socialUser->StatusWithType = new Connect\\SocialUserStatuses();\n $socialUser->StatusWithType->Status->ID = $contactInfo['status'] ?: 38;\n $timestamp = $this->getTimestamp();\n $socialUser->CreatedTime = $timestamp;\n $socialUser->UpdatedTime = $timestamp;\n $socialUser->DisplayName = $login;\n $socialUser->Contact = $contact;\n $this->saveObject($socialUser, $login);\n $this->commonUserToRoleSet($contactInfo['type'], $socialUser->ID);\n if ($contactsType !== 'userdeleted' && $socialUser && $socialUser->ID) {\n $contacts[] = $socialUser->ID;\n }\n }\n echo PHP_EOL . \"Total social users created for user type $contactsType :: $userTypeCount \" . PHP_EOL;\n }\n $this->users = $contacts;\n }", "public static function read_template_categories() {\n\n $template_cats = array();\n\n if (!isset(self::$instance->definitions)) {\n return;\n }\n\n //print_r($extension_data);\n foreach (self::$instance->definitions as $key => $val) {\n\n if (strstr($key, 'inbound-email') || !isset($val['info']['category'])) continue;\n\n /* allot for older lp_data model */\n if (isset($val['category'])) {\n $cats = $val['category'];\n } else {\n if (isset($val['info']['category'])) {\n $cats = $val['info']['category'];\n }\n }\n\n $cats = explode(',', $cats);\n\n foreach ($cats as $cat_value) {\n $cat_value = trim($cat_value);\n $name = str_replace(array('-', '_'), ' ', $cat_value);\n $name = ucwords($name);\n\n if (!isset($template_cats[$cat_value])) {\n $template_cats[$cat_value]['count'] = 1;\n } else {\n $template_cats[$cat_value]['count']++;\n }\n\n $template_cats[$cat_value]['value'] = $cat_value;\n $template_cats[$cat_value]['label'] = \"$name\";\n }\n }\n\n self::$instance->template_categories = $template_cats;\n }", "function expert_cv_education_check_count($contact_id) {\n global $user;\n civicrm_initialize();\n $group_info = civicrm_api3('CustomGroup', 'getsingle', array('name' => 'Education'));\n $count = _pum_expert_mycv_get_record_count($contact_id, $group_info['table_name']);\n if (!empty($group_info['max_multiple']) && $count >= $group_info['max_multiple']) {\n drupal_set_message(t('You cannot have more than @count education items', array('@count' => $group_info['max_multiple'])), 'error');\n if (in_array(\"Expert\", $user->roles)) {\n drupal_goto('expert/my-cv');\n } elseif (in_array(\"Candidate expert\", $user->roles)) {\n drupal_goto('portal');\n }\n }\n}", "function afficherCateg() {\r\n\t\t$result=mysql_query(\"SELECT numcateg FROM if_cont_categ WHERE numcontact='$this->numcontact'\");\r\n\t\twhile ($row=mysql_fetch_row($result)) {\r\n\t\t\t $laCateg=new Menu();\r\n\t\t\t $laCateg->type=\"categorie\";\r\n\t\t\t $laCateg->nomkey=\"numcateg\";\r\n\t\t\t $laCateg->nummenu=$row[0]; \r\n\t\t\t $laCateg->infosMenu();\r\n\t\t\t $this->listcateg[]=$laCateg;\r\n\t\t} \r\n\t\tif (count($this->listcateg)>=1) return true;\r\n\t}", "private function fillCategory($axis) {\n\n // ------------------------------------------------------------\n // Choose message recipients\n // ------------------------------------------------------------\n $this->PAGE->addContent($p = new XPort(\"2. Choose recipients\"));\n $p->add(new XP(array(), \"You may send a message to as many individuals as you'd like at a time. First, select the recipients using this port. Once you have added all recipients, use the form below to send the message.\"));\n\n $p->add($f = $this->createForm(XForm::GET));\n $f->add(new XHiddenInput('axis', $axis));\n\n switch ($axis) {\n // conference\n case Outbox::R_CONF:\n $f->add(new FReqItem(sprintf(\"All users in %s:\", DB::g(STN::CONFERENCE_TITLE)), $sel = new XSelectM('list[]')));\n $sel->set('size', 7);\n foreach (DB::getConferences() as $conf)\n $sel->add(new FOption($conf->id, $conf));\n break;\n\n case Outbox::R_SCHOOL:\n // schools\n $f->add(new FReqItem(\"All users in schools:\", $sel = new XSelectM('list[]')));\n $sel->set('size', 10);\n foreach (DB::getConferences() as $conf) {\n $sel->add($grp = new XOptionGroup($conf));\n foreach ($conf->getSchools() as $school) {\n $grp->add(new FOption($school->id, $school));\n }\n }\n break;\n\n case Outbox::R_ROLE:\n // roles\n $f->add(new FReqItem(\"All users with role:\", XSelect::fromArray('list[]', Account::getRoles())));\n break;\n\n case Outbox::R_STATUS:\n // regatta status\n $f->add(new FReqItem(\"Scorers for regattas:\", XSelect::fromArray('list[]', Outbox::getStatusTypes())));\n break;\n\n case Outbox::R_USER:\n // user\n $this->PAGE->head->add(new XScript('text/javascript', WS::link('/inc/js/userSelect.js')));\n $f->add(new FReqItem(\"Specific users:\", new XTextArea('inline-list', \"\", array('id'=>'user-select')), \"Add one e-mail address per line.\"));\n break;\n }\n\n $f->add($xp = new XSubmitP('recipients', \"Write message →\"));\n $xp->add(new XA($this->link(), \"Cancel\"));\n }", "function add_to_author_profile( $contactmethods ) {\n \n $contactmethods['rss_url'] = 'RSS URL';\n $contactmethods['google_profile'] = 'Google Profile URL';\n $contactmethods['twitter_profile'] = 'Twitter Profile URL';\n $contactmethods['facebook_profile'] = 'Facebook Profile URL';\n $contactmethods['linkedin_profile'] = 'Linkedin Profile URL';\n $contactmethods['tumblr_profile'] = 'Tumblr Profile URL';\n \n return $contactmethods;\n}", "public function checkContactType() {\n if ($this->cust_phone != \"\"){\n //First use phone number\n $this->usePhone = true;\n //I'm not validating the phone number due to time constraints.\n //That should probably be done \n } else if($this->cust_email != \"\" && filter_var($this->cust_email, FILTER_VALIDATE_EMAIL)){\n //Then use email if valid\n $this->useEmail = true;\n } else if($this->cust_email != \"\" && !filter_var($this->cust_email, FILTER_VALIDATE_EMAIL)) {\n $this->recommend = false;\n $this->message = 'email is invalid';\n } else {\n $this->recommend = false;\n $this->message = 'no email or phone number';\n }\n }", "function _s_modify_user_contact_methods( $user_contact ) {\n\t$user_contact['facebook'] = __( 'Facebook URL' );\n\t$user_contact['twitter'] = __( 'Twitter URL' );\n $user_contact['instagram'] = __( 'Instagram URL' );\n $user_contact['youtube'] = __( 'YouTube URL' );\n \n\treturn $user_contact;\n}", "function flow_elated_add_user_custom_fields($user_contact) {\n\n\t\t/**\n\t\t * Function that add custom user fields\n\t\t **/\n\t\t$user_contact['instagram'] = esc_html__( 'Instagram', 'flow');\n\t\t$user_contact['twitter'] = esc_html__( 'Twitter', 'flow');\n\t\t$user_contact['pinterest'] = esc_html__( 'Pinterest', 'flow' );\n\t\t$user_contact['tumblr'] = esc_html__( 'Tumbrl', 'flow' );\n\t\t$user_contact['facebook'] = esc_html__( 'Facebook', 'flow');\n\t\t$user_contact['googleplus'] = esc_html__( 'Google Plus', 'flow');\n\t\t$user_contact['linkedin'] = esc_html__( 'Linkedin', 'flow' );\n\t\t$user_contact['vimeo'] = esc_html__( 'Vimeo', 'flow' );\n\t\t$user_contact['youtube'] = esc_html__( 'Youtube', 'flow' );\n\t\t$user_contact['skype'] = esc_html__( 'Skype', 'flow' );\n\t\t$user_contact['yahoo'] = esc_html__( 'Yahoo', 'flow' );\n\n\t\treturn $user_contact;\n\t}", "function check_for_all_condition($evalue_users,$data,$other_gender)\n{\n\tglobal $SITE_URL;\n\t$prof=implode(\",\",$evalue_users);\n\t$prof_filter=array();\n\tif(!$data['PROFILEID'])\n\t{\n\t\t$reason=\"<span style='font-weight:normal'>To view contact details of this users <a href='$SITE_URL/profile/login.php?SHOW_LOGIN_WINDOW=1' class='thickbox'>Login here</a>.</span>\";\n\t}\n\telse \n\t{\n\t\t$profilechecksum=createChecksumForSearch($data['PROFILEID']);\n\t\t$activated=$data['ACTIVATED'];\n\t\t$incomplete=$data['INCOMPLETE'];\n\n\t\tif($incomplete == \"Y\")\n \t$reason=\"<span style='font-weight:normal'>You need to complete your profile before viewing the user's contact details. Please <a href=\\\"$SITE_URL/profile/viewprofile.php?checksum=&profilechecksum=$profilechecksum&EditWhatNew=incompletProfile\\\">click here</a> to complete your profile.</span>\";\n\t\telseif($activated == \"N\" || $activated == \"U\" || $activated == \"P\")\n \t$reason=\"<span style='font-weight:normal'>You can view the contact details of the user only after your profile is screened.</span>\";\n\t\telseif($data['GENDER']==$other_gender)\n\t\t{\n\t\t\t$reason=\"<span style='font-weight:normal'>You cannot see the contact details of this profile as the profile is of the same gender.</span>\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\tinclude_once($_SERVER['DOCUMENT_ROOT'].\"/profile/contact.inc\");\ninclude_once(JsConstants::$docRoot.\"/commonFiles/jpartner_include.inc\");\n\t\t\t$is_spam=is_spam($data['PROFILEID']);\n\t\t $my_parameters=get_my_parameters_for_dpp_match($data['PROFILEID']);\n\t\t\tfor($i=0;$i<count($evalue_users);$i++)\n\t\t\t{\n\t\t\t\t\tif($evalue_users[$i])\n\t\t\t\t\t\t$prof_filter[$evalue_users[$i]]=getFilteredContact($data['PROFILEID'],$evalue_users[$i],$is_spam,$my_parameters,'viewContactDetails');\n\t\t\t}\n\t\t}\n\t}\n\tif($reason)\n\t\treturn $reason;\n\telse\n\t\treturn $prof_filter;\n\n}", "function openlab_group_contact_field() {\n\t// Don't show on courses or portfolios.\n\t$group_id = 0;\n\tif ( bp_is_group() ) {\n\t\t$group_id = bp_get_current_group_id();\n\t}\n\n\t$group_type = cboxol_get_edited_group_group_type();\n\n\t// @todo supports additional faculty\n\tif ( is_wp_error( $group_type ) || ! $group_type->get_supports_group_contact() ) {\n\t\treturn;\n\t}\n\n\t// Enqueue JS and CSS.\n\t$ver = openlab_get_asset_version();\n\twp_enqueue_script( 'openlab-group-contact', get_template_directory_uri() . '/js/group-contact.js', array( 'jquery-ui-autocomplete' ), $ver );\n\twp_enqueue_style( 'openlab-group-contact', get_template_directory_uri() . '/css/group-contact.css', array(), $ver );\n\n\t$existing_contacts = array();\n\tif ( $group_id ) {\n\t\t$existing_contacts = groups_get_groupmeta( $group_id, 'group_contact', false );\n\t\tif ( ! is_array( $existing_contacts ) ) {\n\t\t\t$existing_contacts = array( bp_loggedin_user_id() );\n\t\t}\n\t} else {\n\t\t$existing_contacts[] = bp_loggedin_user_id();\n\t}\n\n\t$existing_contacts_data = array();\n\tforeach ( $existing_contacts as $uid ) {\n\t\t$u = new WP_User( $uid );\n\t\t$existing_contacts_data[] = array(\n\t\t\t'label' => sprintf( '%s (%s)', esc_html( bp_core_get_user_displayname( $uid ) ), esc_html( $u->user_nicename ) ),\n\t\t\t'value' => esc_attr( $u->user_nicename ),\n\t\t);\n\t}\n\n\twp_localize_script( 'openlab-group-contact', 'OL_Group_Contact_Existing', $existing_contacts_data );\n\n\t$group_type_label = $group_type->get_label( 'group_contact' );\n\n\t?>\n\n\t<div id=\"group-contact-admin\" class=\"panel panel-default\">\n\t\t<div class=\"panel-heading\"><label for=\"group-contact-autocomplete\"><?php echo esc_html( $group_type_label ); ?></label></div>\n\n\t\t<div class=\"panel-body\">\n\t\t\t<p><?php echo esc_html( $group_type->get_label( 'group_contact_help_text' ) ); ?></p>\n\n\t\t\t<label for=\"group-contact-autocomplete\"><?php echo esc_html( $group_type_label ); ?></label>\n\t\t\t<input class=\"hide-if-no-js form-control\" type=\"textbox\" id=\"group-contact-autocomplete\" value=\"\" <?php disabled( bp_is_group_create() ); ?> />\n\t\t\t<?php wp_nonce_field( 'openlab_group_contact_autocomplete', '_ol_group_contact_nonce', false ) ?>\n\t\t\t<input type=\"hidden\" name=\"group-contact-group-id\" id=\"group-contact-group-id\" value=\"<?php echo intval( $group_id ); ?>\" />\n\n\t\t\t<ul id=\"group-contact-list\" class=\"inline-element-list\"></ul>\n\n\t\t\t<label class=\"sr-only hide-if-js\" for=\"group-contacts\"><?php echo esc_html( $group_type_label ); ?></label>\n\t\t\t<input class=\"hide-if-js\" type=\"textbox\" name=\"group-contacts\" id=\"group-contacts\" value=\"<?php echo esc_attr( implode( ', ', $existing_contacts ) ) ?>\" />\n\n\t\t</div>\n\t</div>\n\n\t<?php\n}", "function amt_add_facebook_contactmethod( $contactmethods ) {\n\n // Add Facebook Author Profile URL\n if ( !isset( $contactmethods['amt_facebook_author_profile_url'] ) ) {\n $contactmethods['amt_facebook_author_profile_url'] = __('Facebook author profile URL', 'add-meta-tags') . ' (AMT)';\n }\n\n // The publisher profile box in the WordPress user profile page can be deactivated via filtering.\n if ( apply_filters( 'amt_allow_publisher_settings_in_user_profiles', false ) ) {\n // Add Facebook Publisher Profile URL\n if ( !isset( $contactmethods['amt_facebook_publisher_profile_url'] ) ) {\n $contactmethods['amt_facebook_publisher_profile_url'] = __('Facebook publisher profile URL', 'add-meta-tags') . ' (AMT)';\n }\n }\n\n // Remove test\n // if ( isset( $contactmethods['test'] ) {\n // unset( $contactmethods['test'] );\n // }\n\n return $contactmethods;\n}", "public function extra_user_profile_fields( $user ){ \n //only admin can see and save the categories\n if ( !current_user_can( 'manage_options' ) ) { return false; }\n global $current_user;\n // XTEC ************ MODIFICAT - Added to avoid some debug warnings\n // 2021.06.03 @nacho\n $current_user = wp_get_current_user();\n //************ ORIGINAL\n /*\n get_currentuserinfo();\n */\n //************ FI\n if ($current_user->ID == $user->ID) { return false; }\n $select = wp_dropdown_categories(array(\n 'orderby' => 'name',\n 'show_count' => 0,\n 'hierarchical' => 1,\n 'hide_empty' => 0,\n 'echo' => 0,\n 'name' => 'author_cat[]'));\n $saved = get_user_meta($user->ID, '_author_cat', true );\n foreach((array)$saved as $c){\n $select = str_replace('value=\"'.$c.'\"','value=\"'.$c.'\" selected=\"selected\"',$select);\n }\n $select = str_replace('<select','<select multiple=\"multiple\"',$select);\n echo '<h3>'.__('Author Category', 'author_cat').'</h3>\n <table class=\"form-table\">\n <tr>\n <th><label for=\"author_cat\">'.__('Category',$this->txtDomain).'</label></th>\n <td>\n '.$select.'\n <br />\n <span class=\"description\">'.__('select a category to limit an author to post just in that category (use Crtl to select more then one).',$this->txtDomain).'</span>\n </td>\n </tr>\n <tr>\n <th><label for=\"author_cat_clear\">'.__('Clear Category',$this->txtDomain).'</label></th>\n <td>\n <input type=\"checkbox\" name=\"author_cat_clear\" value=\"1\" />\n <br />\n <span class=\"description\">'.__('Check if you want to clear the limitation for this user.',$this->txtDomain).'</span>\n </td>\n </tr>\n </table>';\n }", "function gen_contact_types ($dbh,$case_id)\r\n{\r\n\r\n\t$get_default_types = $dbh->prepare(\"SELECT type from cm_contacts_types ORDER BY type ASC\");\r\n\r\n\t$get_default_types->execute();\r\n\r\n\t$default_types = $get_default_types->fetchAll(PDO::FETCH_ASSOC);\r\n\r\n\t// add any user-defined contact types\r\n\r\n\t$get_db_types = $dbh->prepare(\"SELECT DISTINCT type from `cm_contacts` WHERE assoc_case = :case_id\");\r\n\r\n\t$data = array('case_id' => $case_id);\r\n\r\n\t$get_db_types->execute($data);\r\n\r\n\t$db_types = $get_db_types->fetchAll(PDO::FETCH_ASSOC);\r\n\r\n\t//$custom_types = array_diff_assoc($default_types, $db_types);\r\n\r\n\t$all_types = array_unique_deep(array_merge($db_types,$default_types));\r\n\r\n\t$type_options = null;\r\n\r\n\tforeach ($all_types as $type) {\r\n\t\t$type_options .= \"<option value = '$type'>$type</option>\";\r\n\t}\r\n\r\n\treturn $type_options;\r\n}", "function check_all_contact_limit($profileid,$total_contact,$add_slashes=0)\n{\n\tglobal $from_viewprofile;\n\t//data storing the relevant information of the user.\n\tglobal $data;\n\tglobal $from_search;\n\tglobal $fromNewSearch;\n\tglobal $searchId;\n\t//Fetching all the contacts made by user\n\tassign_contact_history($profileid);\t\n\t\n\tif($profileid)\n\t{\n\t\t$total_ini_total=$data['TODAY_INI_TOTAL']+$total_contact;\n\t\t$week_ini_total=$data['WEEK_INI_TOTAL']+$total_contact;\n\t\t$month_ini_total=$data['MONTH_INI_TOTAL']+$total_contact;\n\t\t$total_contacts_made=$data['TOTAL_CONTACTS_MADE']+$total_contact;\n\t\t$day_limit=$data['DAY_LIMIT'];\n\t\t$weekly_limit=$data['WEEKLY_LIMIT'];\n\t\t$month_limit=$data['MONTH_LIMIT'];\n\t\t$overall_limit=$data['OVERALL_LIMIT'];\n\t\t$subscription=$data['SUBSCRIPTION'];\n\t\t$notValidNumber_limit=$data[NOT_VALID_NUMBER_LIMIT];\n\t\t\n\t\tif($total_ini_total>$day_limit )\n\t\t{\n\t\t\t\t$TYPE='T';\n\t\t\t\t$contact_limit_message=\"Contact cannot be initiated. You have reached your daily contact limit\";\n\t\t\t\tif($from_search)\n\t\t\t\t$contact_limit_message=\"You have exceeded your daily limit of Expression of interest\";\n\t\t\t\t\n\t\t}\n\t\telse if($week_ini_total>$weekly_limit)\n\t\t{\n\t\t\t$TYPE='W';\n\t\t\t$contact_limit_message=\"Contact cannot be initiated. You have reached your weekly contact limit\";\n\t\t\tif($from_search)\n\t\t\t\t$contact_limit_message=\"You have exceeded your weekly limit of Expression of interest\";\n\n\t\t}\n\t\telse if($month_ini_total>$month_limit)\n\t\t{\n\t\t\t$TYPE='M';\n\t\t\t$contact_limit_message=\"Contact cannot be initiated. You have reached your monthly contact limit\";\n\t\t\tif($from_search)\n\t\t\t\t$contact_limit_message=\"You have exceeded your monthy limit of Expression of interest\";\n\n\t\t}\n\t\telse if($total_contacts_made>$overall_limit)\n\t\t{\n\t\t\t\t$TYPE='O';\n\t\t\t\tif(isPaid($subscription))\n\t\t\t\t\t$contact_limit_message=\"Contact cannot be initiated. Your contact limit as a paid member has been reached.\";\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t\n\t\t\t\t\tif(!$add_slashes)\n\t\t\t\t\t\t$contact_limit_message=addslashes(\"Contact cannot be initiated. Your contact limit as a free member has been reached. Please <a href='javascript:{\\$.colorbox.close();document.location=\\\"mem_comparison.php\\\";}'>pay</a> to make more contacts\");\n\t\t\t\t\telse\n\t\t\t\t\t\t$contact_limit_message=\"Contact cannot be initiated. Your contact limit as a free member has been reached. Please <a href='javascript:{\\$.colorbox.close();document.location=\\\"mem_comparison.php\\\";}'>pay</a> to make more contacts\";\n\t\t\t\t\tif($from_search)\n\t\t\t\t$contact_limit_message=\"You have exceeded your overall limit of Expression of interest <BR><BR><b>To get unlimited Expression of Interest<BR><a href='/profile/mem_comparison.php?from_source=seo'>Become a paid members now </a></b>\";\t\n\t\t\t\t}\n\t\t}\n\t\telse if(checkPhoneVerificationLayerCondition($profileid))\n\t\t{\n\t\t\t$total_contacts_made=get_dup_overall_cnt($profileid)+$total_contact;\n\t\t\tif($total_contacts_made>$notValidNumber_limit)\n\t\t\t{\n\t\t\t\t$TYPE='I';\n\t\t\t\t$verify_url=\"$.colorbox({href:'/profile/myjs_verify_phoneno.php?sourcePage=EOI&fromNewSearch=$fromNewSearch&searchId=$searchId'})\";\n\t\t\t\tif(!$from_viewprofile)\n\t\t\t\t\t$verify_url=stripslashes($verify_url);\n\t\t\t\t$contact_limit_message=\"Your phone number is not verified. <a href=\\\"/profile/myjs_verify_phoneno.php?sourcePage=EOI&width=700\\\" class=\\\"thickbox\\\" onclick=\\\"javascript:{close_all_con_layer();$verify_url;return hide_exp_layer()}\\\">Click here</a> to Verify your phone number. Or call 18004196299 for help.\";\n\t\t\t\tif($from_viewprofile)\n\t\t\t\t\t$contact_limit_message=\"<div style=\\\"width:350px;color:black;font-size:13px\\\">$contact_limit_message</div>\";\n\t\t\t}\n\t\t}\n\t\tif($TYPE)\n\t\t\tcontact_hit_limit($profileid,$TYPE);\n\t\t\t\n\t\treturn $contact_limit_message;\n\t}\n\t\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Set the value of nbFenetres
public function setNbFenetres($nbFenetres) { if ($nbFenetres >= 0) { $this->nbFenetres = $nbFenetres; } else { trigger_error("Le nombre de fenêtre doit être supérieur ou égale à 0", E_USER_WARNING); } return $this; }
[ "function setImageCount($value)\n \t{\n \t\t$this->_imageCount = intval($value);\n \t}", "public function testSetNbFacture() {\n\n $obj = new Clients();\n\n $obj->setNbFacture(10);\n $this->assertEquals(10, $obj->getNbFacture());\n }", "public function setNb($nb)\n\t{\n\t\t$this->nb = $nb;\n\t}", "public function setNbf(?int $value): void {\n $this->getBackingStore()->set('nbf', $value);\n }", "public function setFieldCount() {\r\n\t\t$this->fieldCount = count($this->fieldNames);\r\n\t}", "public function setDetectionCount(?int $value): void {\n $this->getBackingStore()->set('detectionCount', $value);\n }", "public function set_num_fields()\n {\n $this->num_fields = pg_num_fields($this->resource);\n }", "function setFRecordCount($cnt)\n {\n $this->_f_record_count = $cnt ;\n }", "public function setInputNeurons( $count ) {\n\t\t$this->neuronCount = $count;\n\t}", "public function testSetNbCentrImprimeesFact() {\n\n $obj = new Compteur();\n\n $obj->setNbCentrImprimeesFact(10);\n $this->assertEquals(10, $obj->getNbCentrImprimeesFact());\n }", "function setNumberOfPages(){\n $this->pages = ceil($this->getTotal()/$this->getPerPage());\n }", "protected function _setNrOfArtPerPage()\n {\n $myConfig = $this->getConfig();\n\n //setting default values to avoid possible errors showing article list\n $iNrofCatArticles = $myConfig->getConfigParam('iNrofCatArticles');\n $iCel_DefaultPageSize = (int) $myConfig->getConfigParam('iCel_DefaultPageSize');\n $iNrofCatArticles = ( $iNrofCatArticles ) ? $iNrofCatArticles : $iCel_DefaultPageSize;\n\n // checking if all needed data is set\n switch ($this->getListDisplayType()) {\n case 'grid':\n $aNrofCatArticles = $myConfig->getConfigParam('aNrofCatArticlesInGrid');\n break;\n case 'line':\n case 'infogrid':\n default:\n $aNrofCatArticles = $myConfig->getConfigParam('aNrofCatArticles');\n }\n\n $aNrofCatArticles = isset($aNrofCatArticles[0]) ? $aNrofCatArticles : array($iNrofCatArticles);\n $myConfig->setConfigParam('aNrofCatArticles', $aNrofCatArticles);\n\n $iNrofCatArticles = $this->_setViewConfigWithArtPerPage($myConfig, $aNrofCatArticles);\n\n //setting number of articles per page to config value\n $myConfig->setConfigParam('iNrofCatArticles', $iNrofCatArticles);\n }", "function set_tope_max_filas($cantidad)\n\t{\n\t\tif ($cantidad == '')\n\t\t\t$cantidad = 0;\t\t\n\t\tif(is_numeric($cantidad) && $cantidad >= 0){\n\t\t\t$this->_tope_max_filas = $cantidad;\t\n\t\t\tif ($cantidad != 1) {\n\t\t\t\t$this->set_es_unico_registro(false);\t\n\t\t\t}\n\t\t}else{\n\t\t\tthrow new toba_error_def(\"El valor especificado en el TOPE MAXIMO de registros es incorrecto\");\n\t\t}\n\t}", "public function testSetNbAnaImprimeesFact() {\n\n $obj = new Compteur();\n\n $obj->setNbAnaImprimeesFact(10);\n $this->assertEquals(10, $obj->getNbAnaImprimeesFact());\n }", "public function setNbPortes($nbPortes)\r\n {\r\n $this->nbPortes = $nbPortes;\r\n }", "public function setCount($count);", "public function testSetNbJrnImprimeesFact() {\n\n $obj = new Compteur();\n\n $obj->setNbJrnImprimeesFact(10);\n $this->assertEquals(10, $obj->getNbJrnImprimeesFact());\n }", "public function getNumImagenes()\n {\n return $this->numImagenes;\n }", "function SetColumnCount($count){}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Build header String This method builds the header string to be passed to the request.
private function buildHeaderString() { $out = ''; foreach($this->headers as $header => $value) { $out .= "$header: $value\r\n"; } return $out; }
[ "public function buildRequestHeader()\n {\n $requestHeaderString = $this->method . ' ' .$this->urlParts['path'] . $this->urlParts['querystring'] . \" HTTP/1.1\\r\\n\";\n foreach ($this->requestHeaders as $headerKey => $headerValue) {\n $requestHeaderString .= $headerKey . ': ' . $headerValue . \"\\r\\n\";\n }\n\n if ($this->cookieContainer && $this->cookieContainer->length) {\n $cookieBatchString = $this->cookieContainer->serveBatch($this->urlParts['originalUrl']);\n\n if ($cookieBatchString) {\n $requestHeaderString .= 'cookie: ' . $cookieBatchString . \"\\r\\n\";\n }\n }\n\n // stream requires 2 line breaks between header and content\n $requestHeaderString .= \"\\r\\n\";\n\n return $requestHeaderString;\n }", "public\tstatic function buildHeader() {\n\t\t\t\n\t\t\t$headers = array(); \n\t\t\t\n\t\t\t\tforeach(self::$_oAuth as $key=>$value) {\n\t\t\t\t\n\t\t\t\t\tarray_push($headers, $key . '=\"' . rawurlencode($value) . '\"'); \n\t\t\t\t\n\t\t\t\t}\n\t\t\t\n\t\t\treturn 'Authorization: OAuth ' . implode(', ', $headers);\n\t\t\t \n\t\t}", "private function buildRequestHeader() {\n\t $header = $this->top_header;\n\t foreach($this->request_header as $key=>$val) {\n\t $header .= \"$key: $val\\r\\n\";\n\t }\n\t $header .= \"\\r\\n\";\n\t return $header;\n\t}", "public function buildHeader()\r\n\t{\r\n\t\tif ($this->method == 'POST')\r\n\t\t{\r\n\t\t\t$header = 'POST '.$this->path.\" HTTP/1.0\\r\\n\";\r\n\t\t\t$header .= 'Host: '.$this->host.\"\\r\\n\";\r\n\t\t\t$header .= \"Content-type: application/x-www-form-urlencoded\\r\\n\";\r\n\t\t\t$header .= 'Content-length: '.Tools::strlen($this->data).\"\\r\\n\\r\\n\";\r\n\t\t\t$header .= $this->data;\r\n\t\t}\r\n\t\telseif ($this->method == 'GET')\r\n\t\t{\r\n\t\t\tif (Tools::strlen($this->path.$this->data) > 2048)\r\n\t\t\t\tCertissimLogger::insertLog(__METHOD__.' : '.__LINE__, 'Maximum length in get method reached('.Tools::strlen($this->path.$this->data).')');\r\n\t\t\t$header = 'GET '.$this->path.'?'.$this->data.\" HTTP/1.1\\r\\n\";\r\n\t\t\t$header .= 'Host: '.$this->host.\"\\r\\n\";\r\n\t\t\t$header .= \"Connection: close\\r\\n\\r\\n\";\r\n\t\t}\r\n\r\n\t\treturn ($header);\r\n\t}", "public function buildHeader ()\n {\n $header = array();\n foreach ($this->header as $param => $value) {\n if ($value != \"\") {\n array_push($header, $param . ': ' . $value);\n }\n }\n return $header;\n }", "public function buildHeader();", "function buildHeader() \n {\n }", "function _build_http_headers()\r\n\t{\r\n\t\t$headers = array();\r\n\t\tksort($this->_http_header, SORT_NUMERIC);\r\n\t\tforeach ($this->_http_header as $val) {\r\n\t\t\t$val = $val[key($val)];\r\n\t\t\t$headers[] = key($val).': '.$val[key($val)];\r\n\t\t}\r\n\t\treturn implode($this->_nl_rn, $headers);\r\n\t}", "public function build_authenticationheader() {\n return \"Authorization: Bearer $this->accesstoken\";\n }", "public function buildAuthorizationHeader ()\n {\n $this->addHeader('Authorization', 'Basic ' . base64_encode($this->clientId . ':' . $this->clientSecret));\n $this->is_preauthorized_request = 1;\n }", "private function _generateAuthorizationHeader()\n\t{\n\t\t$headers = '(request-target) host date original-date digest x-request-id';\n\t\t$this->_signature = $this->_generateSignature($this->_composeSigningString());\n\t\t\n\t\t$authHeader = \"Signature keyId=\\\"$this->_key_id\\\",algorithm=\\\"$this->_sign_algorithm\\\",headers=\\\"$headers\\\", signature=\\\"$this->_signature\\\"\";\n\t\treturn $authHeader;\n\t}", "function makeHeader()\n {\n /* $cnonce should be an int between 0 and 99999. */\n $cnonce = rand(0, 99999);\n\n /* $timestamp should include milliseconds. */\n $timestamp = round(microtime(true) * 1000);\n\n $auth = array();\n $auth['Mauth realm'] = 'http://webrtc.intel.com';\n $auth['mauth_signature_method'] = 'HMAC_SHA256';\n $auth['mauth_serviceid'] = $this->config->owt->serviceId;\n $auth['mauth_cnonce'] = $cnonce;\n $auth['mauth_timestamp'] = $timestamp;\n\n /* Generate the signature and convert to base64. */\n $rawSignature = hash_hmac('sha256', $timestamp . ',' . $cnonce, $this->config->owt->serviceKey);\n $auth['mauth_signature'] = base64_encode($rawSignature);\n\n /* Implode the keys and values of the $auth array into a string connected by comma and linebreak along with contentType json. */\n return array('Authorization: ' . urldecode(http_build_query($auth, null, \",\")), 'Content-Type: application/json');\n }", "private function buildStatusHeader() : string\n {\n return sprintf('HTTP/%s %s %s', $this->version, $this->code, $this->text);\n }", "public function to_header()\n {\n $out ='Authorization: OAuth realm=\"\"';\n $total = array();\n foreach ($this->parameters as $k => $v)\n {\n if (substr($k, 0, 5) != \"oauth\") continue;\n if (is_array($v)) throw new OAuthException('Arrays not supported in headers');\n $out .= ',' . OAuthUtil::urlencode_rfc3986($k) . '=\"' . OAuthUtil::urlencode_rfc3986($v) . '\"';\n }\n return $out;\n }", "private function buildHeader()\n\t{\n\t\treturn \t[\n\t\t\t'SiteId' \t\t=> $this->SiteId,\n\t\t\t'DeviceId' \t\t=> $this->DeviceId,\n\t\t\t'LicenseId' \t=> $this->LicenseId,\n\t\t\t'UserName' \t\t=> $this->UserName,\n\t\t\t'Password' \t\t=> $this->Password,\n\t\t\t'DeveloperId'\t=> $this->DeveloperId,\n\t\t\t'VersionNbr'\t=> $this->VersionNbr\n\t\t];\n\t}", "private function buildHeaders()\n {\n $headerLines = [\n 'Accept' => 'application/json, application/problem+json',\n 'Content-Type' => 'application/json',\n 'User-agent' => 'LPA-ADMIN'\n ];\n\n $apiToken = $this->getTokenData('token');\n\n // If the logged in user has an auth token already then set that in the header\n if (is_string($apiToken)) {\n $headerLines['token'] = $apiToken;\n }\n\n return $headerLines;\n }", "private function buildHeaders()\n {\n $headerLines = [\n 'Accept' => 'application/json',\n 'Content-Type' => 'application/json',\n 'User-agent' => 'LPA-ADMIN'\n ];\n\n $apiToken = $this->getTokenData('token');\n\n // If the logged in user has an auth token already then set that in the header\n if (!is_null($apiToken)) {\n $headerLines['token'] = $apiToken;\n }\n\n return $headerLines;\n }", "private function generateAuthHeaderValue()\n {\n $date = date('Y-m-d\\TH:i:s.000O');\n $signature = hash_hmac('sha256', $date, $this->apiKey);\n\n return \"username=$this->username date=$date hmac-sha256-hex=$signature\";\n }", "private function buildHeaders() \n {\n $headers = array(\n 'Authorization: basic ' . $this->token,\n 'Content-Type: text/xml; charset=utf-8',\n );\n return $headers;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Show the application support page.
public function support() { return view('front.support'); }
[ "public function supportAction()\r\n {\r\n $this->initHtml();\r\n\r\n $this->html->h3($this->_('Support'));\r\n $this->html->pInfo()->sprintf(\r\n $this->_('There is more than one way to get support for %s.'),\r\n $this->project->getName()\r\n );\r\n\r\n if ($url = $this->project->getDocumentationUrl()) {\r\n $this->html->h4($this->_('Documentation'));\r\n\r\n $this->html->pInfo()->sprintf($this->_('All available documentation is gathered at: %s'))\r\n ->a($url, array('rel' => 'external', 'target' => 'documentation'));\r\n }\r\n\r\n if ($url = $this->project->getManualUrl()) {\r\n $this->html->h4($this->_('Manual'));\r\n\r\n $this->html->pInfo()->sprintf($this->_('The manual is available here: %s'))\r\n ->a($url, array('rel' => 'external', 'target' => 'manual'));\r\n }\r\n\r\n if ($url = $this->project->getForumUrl()) {\r\n $this->html->h4($this->_('The forum'));\r\n\r\n $this->html->pInfo()->sprintf($this->_(\r\n 'You will find questions asked by other users and ask new questions at our forum site: %s'\r\n ))->a($url, array('rel' => 'external', 'target' => 'forum'));\r\n }\r\n\r\n if ($url = $this->project->getSupportUrl()) {\r\n $this->html->h4($this->_('Support site'));\r\n\r\n $this->html->pInfo()->sprintf($this->_('Check our support site at %s.'))\r\n ->a($url, array('rel' => 'external', 'target' => 'support'));\r\n }\r\n\r\n $this->html->h4($this->_('Or contact'));\r\n $this->html->append($this->_getOrganizationsList());\r\n }", "public function admin_help_page() {\n include('views/html-wf-help-guide.php');\n }", "function showAboutUsPage()\n {\n $xtpl = new XTemplate('about_us.xtpl', TEMPLATES);\n\n $xtpl->parse('main');\n $xtpl->out('main');\n }", "public function index()\n {\n // browse of suporters\n $suporters =Support::all();\n return view('Admin.supported.browse',compact('suporters'));\n \n }", "public function index() {\n\t\t// Set title and loading support's type\n\t\t$data['title'] = 'Support';\n\t\t$data['ticket'] = $this->support_model->getTicket();\n\n\t\t// Construct this page\n\t\t$this->construct_page('ticket/index', $data);\n\t}", "function loadSupportCreationPage()\r\n{\r\n require('view/frontend/supportCreationView.php');\r\n}", "public function mobilesupport() { $this->load->view('Support/Mobile/mobilesupport'); }", "function displayPage()\n {\n $this->getState()->template = 'module-page';\n $this->getState()->setData([\n 'modulesToInstall' => $this->getInstallableModules()\n ]);\n }", "public function render_faq_support() {\n $this->render( 'backend/partials/faq-support' );\n }", "public function show_admin_page() {\n\t\t$this->view->render();\n\t}", "private function show_page ()\n\t{\n\t\t$data = '';\n\t\t\n\t\t$this->template->page ( TUTORIAL_FOLDER . 'tutorial_view' , $data );\n\t}", "public function navigationHelp()\n\t{\n\t\t$page_title = array('Admin - Navigation Help');\n\t\t\n\t\trequire('views/admin/navigationHelp.html');\n\t}", "public function aboutUs()\n\t{\n\t\t$this->render('aboutus');\n\t}", "function speaker_help() \n {\n $this->writeContentPage('help/speaker_help');\n }", "function about_us()\n\t{\n\t\t$data['show_data'] = $this->CMSPage->getData('1');\n\t\t$this->loadViews('aboutus', $this->global, $data, NULL);\n\t}", "public function actionViewDemo() {\n $searchModel = new DataAnalysisAppSearch();\n // retreive information on default demo application\n $appDemo = $searchModel->getApplicationInformation(\n $searchModel::DEFAULT_TEST_DEMO_APP\n );\n // connection error or application not loaded\n if (!empty($appDemo)) {\n $appDemoInformation = $appDemo[$searchModel::DEFAULT_TEST_DEMO_APP];\n $this->redirect($appDemoInformation[DataAnalysisAppSearch::APP_INDEX_URL]);\n } else {\n return $this->render('/site/error', [\n 'name' => Yii::t('app/warning', 'Informations'),\n 'message' => Yii::t('app/messages', 'Demonstration application not available')\n ]\n );\n }\n }", "protected function displayMaintenancePage()\n {\n }", "protected function displayMaintenancePage()\n {\n return;\n }", "public function about()\n {\n $this->render('Application/about.html.twig');\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/return array( array('value'=>2, 'label'=>'No Counter'), array('value'=>1, 'label'=>'Vertical Counter'), array('value'=>0, 'label'=>'Horizontal Counter'), );
public function getcounters() { $countersarray=array("2"=>"No Conter","1"=>"Vertical Counter","0"=>"Horizontal Counter"); //$countersarray=array("2"=>"No Conter"); return $countersarray; }
[ "public function getCounters();", "function getCounterValue() {return $this->_countervalue;}", "function dataLabel($db='', $kondisi=''){\n\t\t\t\t\t\t\t\t$Si_Tot = array();\n\t\t\t\t\t\t\t\t$query_Si_Tot = \"SELECT label, COUNT(label) jml FROM `tbl_kasus` $kondisi GROUP BY label\";\n\t\t\t\t\t\t\t\t$sql_Si_Tot = $db->query($query_Si_Tot);\n\t\t\t\t\t\t\t\twhile ($row = $db->fetch_assoc($sql_Si_Tot)) {\n\t\t\t\t\t\t\t\t\t$Si_Tot[] = array(\n\t\t\t\t\t\t\t\t\t\t'label'=>$row['label'],\n\t\t\t\t\t\t\t\t\t\t'jml' => (int)$row['jml']\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\treturn $Si_Tot;\n\t\t\t\t\t\t\t\t// var_dump($Si_Tot[0]['label']);\n\t\t\t\t\t\t\t}", "public function getHitCounterStyles()\n\t{\n\t\t$hit_counter_options = array(\n\t\t\t\tarray('value'=>'BasicStyle','label'=>Mage::helper('magebid')->__('BasicStyle')),\n\t\t\t\tarray('value'=>'GreenLED','label'=>Mage::helper('magebid')->__('GreenLED')),\n\t\t\t\tarray('value'=>'HiddenStyle','label'=>Mage::helper('magebid')->__('HiddenStyle')),\n\t\t\t\tarray('value'=>'HonestyStyle','label'=>Mage::helper('magebid')->__('HonestyStyle')),\n\t\t\t\tarray('value'=>'NoHitCounter','label'=>Mage::helper('magebid')->__('NoHitCounter')),\n\t\t\t\tarray('value'=>'RetroStyle','label'=>Mage::helper('magebid')->__('RetroStyle'))\n\t\t\t\t);\n\t\tarray_unshift($hit_counter_options, array('value'=>'', 'label'=>Mage::helper('magebid')->__('-- Please select --')));\t\n\t\t\n\t\treturn $hit_counter_options;\t\t\t\t\t\n\t}", "public function getCounter();", "private function counterCode()\r\n\t{\r\n\t\t$output = '';\r\n\r\n\t\tif($this->params->get('word_count') == 1)\r\n\t\t{\r\n\t\t\tif($this->params->get('field_title') == 1)\r\n\t\t\t{\r\n\t\t\t\t$output .= \"new WordCount('counter_title', {inputName:'title', wordText:'\".JText::_('PLG_EASYFRONTENDSEO_WORDS').\"', charText:'\".JText::_('PLG_EASYFRONTENDSEO_CHARACTERS').\"'}); new WordCount('counter_title', {inputName:'title', eventTrigger: 'click', wordText:'\".JText::_('PLG_EASYFRONTENDSEO_WORDS').\"', charText:'\".JText::_('PLG_EASYFRONTENDSEO_CHARACTERS').\"'});\";\r\n\t\t\t}\r\n\r\n\t\t\tif($this->params->get('field_description') == 1)\r\n\t\t\t{\r\n\t\t\t\t$output .= \"new WordCount('counter_description', {inputName:'description', wordText:'\".JText::_('PLG_EASYFRONTENDSEO_WORDS').\"', charText:'\".JText::_('PLG_EASYFRONTENDSEO_CHARACTERS').\"'}); new WordCount('counter_description', {inputName:'description', eventTrigger: 'click', wordText:'\".JText::_('PLG_EASYFRONTENDSEO_WORDS').\"', charText:'\".JText::_('PLG_EASYFRONTENDSEO_CHARACTERS').\"'});\";\r\n\t\t\t}\r\n\r\n\t\t\tif($this->params->get('field_keywords') == 1)\r\n\t\t\t{\r\n\t\t\t\t$output .= \"new WordCount('counter_keywords', {inputName:'keywords', wordText:'\".JText::_('PLG_EASYFRONTENDSEO_WORDS').\"', charText:'\".JText::_('PLG_EASYFRONTENDSEO_CHARACTERS').\"'}); new WordCount('counter_keywords', {inputName:'keywords', eventTrigger: 'click', wordText:'\".JText::_('PLG_EASYFRONTENDSEO_WORDS').\"', charText:'\".JText::_('PLG_EASYFRONTENDSEO_CHARACTERS').\"'});\";\r\n\t\t\t}\r\n\r\n\t\t\tif($this->params->get('field_generator') == 1)\r\n\t\t\t{\r\n\t\t\t\t$output .= \"new WordCount('counter_generator', {inputName:'generator', wordText:'\".JText::_('PLG_EASYFRONTENDSEO_WORDS').\"', charText:'\".JText::_('PLG_EASYFRONTENDSEO_CHARACTERS').\"'}); new WordCount('counter_generator', {inputName:'generator', eventTrigger: 'click', wordText:'\".JText::_('PLG_EASYFRONTENDSEO_WORDS').\"', charText:'\".JText::_('PLG_EASYFRONTENDSEO_CHARACTERS').\"'});\";\r\n\t\t\t}\r\n\r\n\t\t\tif($this->params->get('field_robots') == 1)\r\n\t\t\t{\r\n\t\t\t\t$output .= \"new WordCount('counter_robots', {inputName:'robots', wordText:'\".JText::_('PLG_EASYFRONTENDSEO_WORDS').\"', charText:'\".JText::_('PLG_EASYFRONTENDSEO_CHARACTERS').\"'}); new WordCount('counter_robots', {inputName:'robots', eventTrigger: 'click', wordText:'\".JText::_('PLG_EASYFRONTENDSEO_WORDS').\"', charText:'\".JText::_('PLG_EASYFRONTENDSEO_CHARACTERS').\"'});\";\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn $output;\r\n\t}", "function theme_mongodb_statistics_node_counters($variables) {\n $record = $variables['record'];\n $items = array(\n t('Day views count: @count', array('@count' => $record['daycount'])),\n t('Total views count: @count', array('@count' => $record['totalcount'])),\n t('Day generation: @count', array('@count' => $record['daygen'])),\n t('Total generation: @count', array('@count' => $record['totalgen'])),\n t('Last access: @date', array('@date' => format_date($record['timestamp'], 'short'))),\n );\n $build['mongodb_counters_list'] = array(\n '#type' => 'markup',\n '#markup' => theme_item_list(array(\n 'items' => $items,\n 'title' => t('Node Counters'),\n 'type' => 'ul',\n 'attributes' => array()\n ))\n );\n return drupal_render($build);\n}", "public function collectCounters(): array;", "public function getFrontendCounter();", "private function getLabelsArray()\n{\n \n $returnArray=array();\n \n //set up labels array.\n if (isset($this->tableStructure)) {\n foreach ($this->tableStructure as $ind => $fieldArray) {\n $returnArray[$fieldArray['columnName']]=isset($fieldArray['label']) ? $fieldArray['label'] : $fieldArray['columnName'];\n }\n }\n \n return $returnArray; \n}", "public function storesValueLabelArray() {\n $stores = $this->stores;\n $output = array();\n if (!is_null($stores)) {\n $i = 0;\n foreach ($stores as $store) {\n $output[] = array(\n 'value' => strval($i),\n 'label' => $this->__($store),\n );\n \n ++$i;\n }\n }\n return $output;\n }", "public function getLabel() {\n return $this->cntLabels;\n }", "public function labels()\n {\n }", "function foodbakery_load_shortcode_counters_progressbar_callback($counters) {\r\n\t$counters['foodbakery_counter_progressbars'] = 0;\r\n\t$counters['foodbakery_counter_progressbars_node'] = 0;\r\n\t$counters['foodbakery_global_counter_progressbars'] = 0;\r\n\t$counters['foodbakery_shortcode_counter_progressbars'] = 0;\r\n\treturn $counters;\r\n }", "function getStatistic()\n {\n $ret = array();\n foreach ($this->data as $entry) {\n if (array_key_exists($entry['entryType'], $ret)) {\n $ret[$entry['entryType']]++;\n } else {\n $ret[$entry['entryType']] = 1;\n }\n }\n return $ret;\n }", "function foodbakery_load_shortcode_counters_spacer_callback($counters) {\r\n\t$counters['foodbakery_counter_spacer'] = 0;\r\n\t$counters['foodbakery_shortcode_counter_spacer'] = 0;\r\n\t$counters['foodbakery_global_counter_spacer'] = 0;\r\n\treturn $counters;\r\n }", "function newStudentCount()\n{\n\tglobal $students_count;\n\tif($students_count != NULL)\n\t{\n\t\tforeach ($students_count as $key => $studentcount) \n\t\t{\n\t\t\t$nummber = $studentcount;\n\t\t}\n\t\techo \"<span class='badge'>\".$nummber.\"</span>\";\n\t}\n}", "public function getLabelValues()\n{\n $values = (array)$this->getAttributeObject()->getFrontend()->getLabel();\n $storeLabels = $this->getAttributeObject()->getStoreLabels();\n foreach ($this->getStores() as $store) {\n if ($store->getId() != 0) {\n $values[$store->getId()] = isset($storeLabels[$store->getId()]) ? $storeLabels[$store->getId()] : '';\n }\n }\n return $values;\n}", "function foodbakery_load_shortcode_counters_map_callback($counters) {\r\n\t$counters['foodbakery_global_counter_map'] = 0;\r\n\t$counters['foodbakery_shortcode_counter_map'] = 0;\r\n\t$counters['foodbakery_counter_map'] = 0;\r\n\treturn $counters;\r\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Creates a new Gallery model. If creation is successful, the browser will be redirected to the 'index' page.
public function actionCreate() { $model = $this->module->manager->createGallery(['scenario' => 'create']); $model->loadDefaultValues(); if ($model->load(\Yii::$app->request->post()) && $model->create()) { \Yii::$app->getSession()->setFlash('gallery.success', \Yii::t('gallery', 'Gallery has been created')); return $this->redirect(['index']); } return $this->render('create', [ 'model' => $model ]); }
[ "public function actionCreate()\n {\n $model = new Gallery();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['index']);\n } else {\n return $this->render('create',\n [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new Gallery();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->gallery_id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new Gallery();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['update', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new Galleries();\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 Gallery();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n if (isset($_SESSION['gallery'])) {\n\t\t\t\tYii::$app->session->setFlash('success', 'Галерея создана. Можно её наполнять содержимым в режиме редактирования.');\n\t\t\t\tswitch ($_SESSION['gallery']['type']) {\n\t\t\t\t\tcase Gallery::GALLERY_ANIMAL:\n\t\t\t\t\t\t$url = 'animals';\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase Gallery::GALLERY_USER:\n\t\t\t\t\t\t$url = 'family';\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tdefault: $url = 'index';\n\t\t\t\t}\n\t\t\t\treturn $this->redirect([$url]);\n\t\t\t} else {\n\t\t\t\tYii::$app->session->setFlash('error', 'Галерея создана. Можно её наполнять содержимым в режиме редактирования.');\n\t\t\t\treturn $this->redirect(['view', 'id' => $model->id]);\n\t\t\t}\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function actionCreate()\r\n {\r\n $model = new GalleryAlbum();\r\n $model->loadDefaultValues();\r\n $model->automaticTranslationSaving = true;\r\n\r\n if($model->load(Yii::$app->request->post()) && $model->save()) {\r\n $model->saveImages();\r\n return $this->redirect(['view', 'id' => $model->id]);\r\n }\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 Gallery();\n\n if ($model->load(Yii::$app->request->post())) \n {\n /* Gets the image instance and uploads image to the specified directory\n * and then saves the model data */\n \n $image = UploadedFile::getInstance($model, 'image'); \n \n $image->saveAs('uploads/' . $image->baseName . '.' . $image->extension);\n $model->image = $image->baseName . '.' . $image->extension;\n \n $model->save();\n \n return $this->redirect(['view', 'id' => $model->id]);\n \n } \n else \n {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new GalleryMedias;\n\n if ($model->load(Yii::$app->request->post())) {\n $language = Language::find()->where(['default' => 1])->one();\n $model->language = $language->id;\n if ($model->save()) {\n $model->saveImage('image');\n return $this->redirect([\n 'view',\n 'id' => $model->id\n ]);\n }\n }\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function actionCreate()\n {\n $model = new Fotos();\n if ($model->load(Yii::$app->request->post()))\n {\n if($model->save()) \n {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionPhotogallerycreate()\n\t{\n\t\t$model = new Photogallery();\n\n\t\tif ($model->load(Yii::$app->request->post()) && $model->save()) {\n\t\t\treturn $this->redirect(['photogalleryview', 'id' => $model->id]);\n\t\t} else {\n\t\t\treturn $this->render('photogallerycreate', [\n\t\t\t\t'model' => $model,\n\t\t\t\t'file' => $file,\n\t\t\t]);\n\t\t}\n\t}", "public function store()\n\t{\n\t\t$validator = Validator::make($data = Input::all(), Gallery::$rules);\n\n\t\tif ($validator->fails())\n\t\t{\n\t\t\treturn Redirect::back()->withErrors($validator)->withInput();\n\t\t}\n\n\t\tGallery::create($data);\n\n\t\treturn Redirect::route('galleries.index');\n\t}", "public function createAction()\n {\n $entity = new VideoGallery();\n $request = $this->getRequest();\n $form = $this->createForm(new VideoGalleryType(), $entity);\n $form->bindRequest($request);\n\n if ($form->isValid()) {\n $em = $this->getDoctrine()->getEntityManager();\n $em->persist($entity);\n $em->flush();\n\n return $this->redirect($this->generateUrl('videogallery_admin'));\n \n }\n\n return $this->render('ImiBorbasVideoGalleryBundle:VideoGallery:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView()\n ));\n }", "public function create()\n {\n return view('admin.galleries.create');\n }", "public function actionCreate()\n {\n $model = new Images();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->image_id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "function create_gallery() \n\t{\n\t\t$this->check_authentication();\n\t\t\n\t\tif (trim($_POST['title']) == \"\") {\n\t\t\t$this->session->set_flashdata('error_cg',true);\n\t\t\tredirect('admin/cms/galleries');\n\t\t}\n\t\t$data = array(\n\t\t\t'title' => $_POST['title'],\n\t\t\t'created' => date('Y-m-d H:i:s'),\n\t\t\t'modified' => date('Y-m-d H:i:s')\n\t\t);\n\t\t$gid = $this->Gallery_model->create_gallery($data);\n\t\t\n\t\t$path = \"/home/stkildaf/public_html/2015-s2/uploads/galleries\";\n\t\t$newfolder = md5('cdkgallery'.$gid);\n\t\t$dir = $path.\"/\".$newfolder;\n\t\tif(!is_dir($dir))\n\t\t{\n\t\t mkdir($dir);\n\t\t chmod($dir,0777);\n\t\t $fp = fopen($dir.'/index.html', 'w');\n\t\t fwrite($fp, '<html><head>Permission Denied</head><body><h3>Permission denied</h3></body></html>');\n\t\t fclose($fp);\n\t\t}\n\t\t\n\t\t$dir .= \"/thumbnails\";\n\t\tif(!is_dir($dir))\n\t\t{\n\t\t mkdir($dir);\n\t\t chmod($dir,0777);\n\t\t $fp = fopen($dir.'/index.html', 'w');\n\t\t fwrite($fp, '<html><head>Permission Denied</head><body><h3>Permission denied</h3></body></html>');\n\t\t fclose($fp);\n\t\t}\t\t\n\t\tredirect('admin/cms/galleries');\n\t}", "public function actionCreate() {\n $model = new Camera();\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 PhotoCatalog();\n\n\n if ($model->load(Yii::$app->request->post()) ) {\n\n $model->photosUpload = UploadedFile::getInstance($model, 'photosUpload');\n $model->photoPreviewUpload = UploadedFile::getInstance($model, 'photoPreviewUpload');\n\n if($model->save()){\n return $this->redirect(['index']);\n }\n\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $params = $this->request->getQueryParams();\n $model = new Images();\n $imageQuery = new ImagesQuery($model);\n $order = $imageQuery->getTheMaxOrder($params['collection_id']);\n\n $model->setCollectionId($params['collection_id']);\n $model->setImageStatus(TRUE);\n $model->setImageOrder((int)$order['max_order'] + 1);\n\n if ($this->request->isPost) {\n if ($model->load($this->request->post()) && $model->save()) {\n return $this->redirect([\n 'view',\n 'id' => $model->image_id,\n 'collection_id' => $model->getCollectionId()\n ]);\n }else{\n\n }\n } else {\n $model->loadDefaultValues();\n }\n\n return $this->render('create', [\n 'model' => $model,\n 'collection_id' => $params['collection_id']\n ]);\n }", "public function newAction()\n {\n $entity = new Gallery();\n $form = $this->createForm(new GalleryType(), $entity);\n\n return $this->render('ACInst3MediaBundle:Gallery:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView()\n ));\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Reader page user is blocked.
function page_user_blocked() { header('Location: user-blocked.php'); }
[ "public function userIsBlocked();", "public function blockUser();", "public function blocked()\n\t{\n\t\t// callables to fetch user data\n\t\t$fetchUsers = function($start, $pageSize) {\n\t\t\tlist($totalUsers, $users) = qa_db_select_with_pending(\n\t\t\t\tqa_db_selectspec_count(qa_db_users_with_flag_selectspec(QA_USER_FLAGS_USER_BLOCKED)),\n\t\t\t\tqa_db_users_with_flag_selectspec(QA_USER_FLAGS_USER_BLOCKED, $start, $pageSize)\n\t\t\t);\n\n\t\t\treturn array($totalUsers['count'], $users);\n\t\t};\n\t\t$userLevel = function($user) {\n\t\t\treturn qa_html(qa_user_level_string($user['level']));\n\t\t};\n\n\t\t$qa_content = $this->rankedUsersContent($fetchUsers, $userLevel);\n\n\t\t$qa_content['title'] = empty($qa_content['ranking']['items'])\n\t\t\t? qa_lang_html('users/no_blocked_users')\n\t\t\t: qa_lang_html('users/blocked_users');\n\n\t\t$qa_content['ranking']['sort'] = 'level';\n\n\t\treturn $qa_content;\n\t}", "public function isBlocked()\n {\n if (!$this->exists()) {\n return false;\n }\n $this->read();\n switch (true)\n {\n /*\n * 1) is deactivated\n */\n case $this->_max <= 0:\n /*\n * 2) no data found (yet) - occurs during first run\n */\n case $this->isEmpty():\n /*\n * 3) dataset is invalid (unexpected)\n */\n case count($this->content) < 3:\n /*\n * 4) user is other than the last\n */\n case strpos($this->content[0], $_SERVER['REMOTE_ADDR']) === false:\n /*\n * 5) maximum number of entries not reached yet\n */\n case $this->content[2] < $this->_max:\n return false;\n /*\n * 6) user has exceeded maximum number of entries\n */\n default:\n return true;\n } /* end switch */ \n }", "public function check_block() {\n if ($this->session->userdata('block_user')) {\n $get_count = $this->session->userdata('block_user');\n if (($get_count['time'] > time() - 3600) AND ( $get_count['tried'] == 5)) {\n display_mess(48);\n die();\n } else {\n if (($get_count['time'] < time() - 3600)) {\n $this->session->unset_userdata('block_user');\n }\n }\n }\n }", "public function check_block() {\n \n if ( $this->session->userdata('block_user') ) {\n \n $get_count = $this->session->userdata('block_user');\n \n if ( ($get_count['time'] > time() - 3600) AND ( $get_count['tried'] == 5) ) {\n \n display_mess(48);\n die();\n \n } else {\n \n if ( ($get_count['time'] < time() - 3600) ) {\n \n $this->session->unset_userdata('block_user');\n \n }\n \n }\n \n }\n \n }", "public function isBlocked();", "public function bflwp_block(){\r\n $ip = $this->getIp();\r\n \r\n $denylist = $this->getIPList('denylist');\r\n\r\n if(in_array($ip, $denylist)){\r\n header('HTTP/1.0 403 Forbidden');\r\n die('No podras pasar');\r\n }\r\n\r\n foreach ($denylist as $value) {\r\n if($this->ip_in_range($ip,$value)){\r\n header('HTTP/1.0 403 Forbidden');\r\n die('No podras pasar');\r\n }\r\n }\r\n }", "public function checkAccess()\n {\n if ($this->bl_manager->isLocked($this->remote_address, LockScope::WEBSITE)) {\n self::blockAccessTemporarily($this->remote_address);\n }\n }", "public function checkIsBlocked()\n\t{\n\t\tif (!$this->user->get('active')) {\n\t\t\t$this->user->set('active', 1);\n\t\t}\n\n\t\treturn parent::checkIsBlocked();\n\t}", "public function blockAccount() {\n\t\tif(check($this->_userid)) {\n\t\t\t\n\t\t}\n\t\t\n\t\tif(check($this->_username)) {\n\t\t\t\n\t\t}\n\t\t\n\t\tif(check($this->_email)) {\n\t\t\t\n\t\t}\n\t\t\n\t\treturn;\n\t}", "function cot_blockguests()\n{\n\tglobal $env, $usr, $sys;\n\n\tif ($usr['id'] < 1)\n\t{\n\t\t$env['status'] = '403 Forbidden';\n\t\tcot_redirect(cot_url('message', \"msg=930&\".$sys['url_redirect'], '', true));\n\t}\n\treturn FALSE;\n}", "public function isBlockedByAction()\n {\n $userDto = Zend_Registry::get('api_user');\n $targetUserDto = $this->getUser($this->_getParam('unique_id', 0));\n \n $blockedState = $this->getBusiness()->isBlockedBy($userDto, $targetUserDto);\n $this->success(array('blocked' => (int) $blockedState));\n }", "public function blockCurrentUser()\n\t{\n\t\t//show block message via wp_die\n\t\t$blockTime = $this->configuration->getOptionValue(NextADInt_Adi_Configuration_Options::BLOCK_TIME);\n\t\t\n\t\t$this->showBlockMessage($blockTime);\n\t}", "public function isBlock()\n {\n return (bool) auth()->user()->is_block;\n }", "function block_page() {\n\t\n\tinclude (plugin_dir_path(__FILE__).'/settings-conditional.php');\t\n\t\n\tif ( is_user_logged_in() ) {\n\n\t} else {\n\t\techo \"You can not view this file.<br> To view this file please <a href='\" . $login_url . \"'>Login</a>.\";\n\t\t//echo \"You can not view this file.<br> To view this file please <a href='http://google.com'>Login</a>.\";\n\t\texit;\n\t}\n}", "public function blockAccess()\n {\n $this->f403();\n $this->blockForward();\n }", "public function isBlockable()\n {\n return false;\n }", "public static function isBlocked()\n {\n return static::singleton()->x_uri_blocked;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets the navigation properties declared in this entity definition.
public function declaredNavigationProperties(): array;
[ "public function navigationProperties(): array;", "public function propertyInfo() {\n return entity_get_property_info($this->entityType);\n }", "public function get_foreign_properties()\n {\n return $this->get_specific_properties(self::PROPERTIES_FOREIGN);\n }", "public function getReflectionProperties()\n {\n return $this->reflFields;\n }", "public function getPropertyDefinitions() {\n return $this->fieldDefinition->getPropertyDefinitions();\n }", "public function getRelatedListProperties()\n {\n return $this->relatedListProperties;\n }", "public function get_properties()\n {\n return $this->properties;\n }", "public function __getLazyProperties()\n {\n // TODO: Implement __getLazyProperties() method.\n }", "public function getProperties()\n {\n return array_filter($this->context->getProperties());\n }", "public function getEntityRelations()\n {\n return $this->entity_relations;\n }", "public function getAllProperties() {\n $foreign_keys = array_map(\"strtolower\", array_values($this->tableDefinition->getForeignKeys()));\n $info = array();\n foreach($this->info as $key => $val) {\n if(in_array($key, $foreign_keys) != true) {\n $info[$key] = $val;\n }\n }\n return $info;\n }", "public function properties()\n {\n return $this->hasMany('App\\Property');\n }", "public function getProperties() {\n\t\tif (is_object($this->contentObjectProxy)) {\n\t\t\treturn \\TYPO3\\Flow\\Reflection\\ObjectAccess::getGettableProperties($this->contentObjectProxy->getObject());\n\t\t} else {\n\t\t\treturn $this->properties;\n\t\t}\n\t}", "public function getRelatedEntity() : Property\n {\n return $this->related_entity;\n }", "public function properties()\n {\n return $this->hasMany(CurrencyProperty::class, CurrencyProperty::FIELD_ID_CURRENCY, self::FIELD_ID);\n }", "public function getRelations()\n {\n if ($this->def->getTarget() === null) {\n return [];\n }\n\n $relations = [];\n foreach ($this->def->getTarget()->getRelations() as $relation) {\n $relations[$relation->getLocalProperty()] = $relation;\n }\n\n return $relations;\n }", "function &getProperties() {\n\t\t$metadataSchema =& $this->getMetadataSchema();\n\t\treturn $metadataSchema->getProperties();\n\t}", "public function getEntityFields()\n {\n return $this->entity->getFields();\n }", "public function getProperties()\n {\n return $this\n ->hasMany(\n Property::className(),\n [\n 'id' => 'property_id',\n ]\n )\n ->via('groupProperties');\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/! \brief Returns a list of all local products.
public function get_local_products($host = "") { /* Append host attribute to query data */ $data = array(); if(!empty($host)){ $data['hostId'] = trim($host); } $res = $this->send_data("gosa_opsi_get_local_products",$this->target,$data,TRUE); $items = array(); if(isset($res['XML'][0]['ITEM'])){ foreach($res['XML'][0]['ITEM'] as $entry){ $e = array("DESC" => $entry['DESCRIPTION'][0]['VALUE'], "NAME" => $entry['PRODUCTID'][0]['VALUE']); $items[$entry['PRODUCTID'][0]['VALUE']] = $e; } } return($items); }
[ "public function get_all(){ \n\t\treturn $this->call('GET', '/admin/products.json', array()); \n\t}", "public function getProductList() {}", "public function getProducts()\n\t{\n\t\t/**\n\t\t* todo\n\t\t*/ \n\t}", "public function listProducts()\n {\n return $this->request('GET', '/products');\n }", "public function getAllProducts();", "public function listProducts()\n {\n return Product::all();\n }", "public function listProducts()\n {\n $query = new Query();\n\n $query->select(['*'])\n ->from('products')\n ->where(['>=', 'num', 1]);\n\n if(!empty($this->f_articul))\n $query->andFilterCompare('articul', $this->f_articul);\n if(!empty($this->f_name))\n $query->andFilterCompare('name', $this->f_name);\n if(!empty($this->f_description))\n $query->andFilterCompare('description', $this->f_description, 'like');\n if(!empty($this->f_price_min))\n $query->andFilterCompare('price', '>='.$this->f_price_min);\n if(!empty($this->f_price_max))\n $query->andFilterCompare('price', '<='.$this->f_price_max);\n\n $rows = $query->orderBy(['id' => SORT_DESC])\n ->all();\n\n return $rows;\n }", "public function getAllProducts() {\n $query = \"SELECT STORE_PRODUCT.PRODUCT_ID,\n STORE_PRODUCT.PRODUCT_NAME,\n STORE_PRODUCT.PRODUCT_DESC,\n STORE_PRODUCT.PRODUCT_COST\n FROM STORE.STORE_PRODUCT\";\n $dbConnection = new mysqli(DB_SERVER,DB_USERNAME,DB_PASSWORD);\n $results = $dbConnection->query($query);\n $products = $this->processResults($results);\n $dbConnection->close();\n return $products;\n }", "public function getListOfProductsProducts()\n {\n return Zend_Json::decode(Mage::getStoreConfig('hermes/api_data/props_list_of_products_atg/products'));\n }", "public function getAllProductList()\n {\n\n return Product::all();\n }", "public function getProducts();", "public function listLocalParties() {\r\n\t\tif($this->localparties == null) {\r\n\t\t\t$pr = new LocalParty();\r\n\t\t\t$this->localparties = $pr->getList('', 'WHERE party = '.$this->party, 'ORDER BY p.name');\r\n\t\t}\r\n\t\treturn $this->localparties;\r\n\t}", "public function getAllProductsForCache()\n\t{\n\t\t$this->resetLocalCacheData('allProducts');\n\t\t$products = $this->getProducts(array(), array('join' => Brivium_Store_Model_Product::FETCH_FULL));\n\t\treturn $products;\n\t}", "public function waspProducts() {\n $product_list = array();\n\n $products = Mage::getModel('catalog/product')->getCollection();\n $products->addAttributeToSelect('name');\n\n foreach ($products as $product) {\n $product_list[$product->getId()] = $product->getName();\n }\n\n return $product_list;\n }", "public function all()\n {\n return $this->products;\n }", "public function get_all_products() {\n\n\t\treturn array(\n\t\t\t__( 'Themes', APP_TD ) => $this->get_all_themes(),\n\t\t\t__( 'Plugins', APP_TD ) => $this->get_all_plugins(),\n\t\t);\n\n\t}", "abstract protected function get_all_local_modules();", "public function getAvailableProducts()\n {\n $productModel = Admin::getModel('Product');\n\n $productsQuery = $productModel->selectRaw('\n products.product_type,\n products.id, products.name, products.price,\n products.vat_id, products.discount_operator, products.discount,\n parentProduct.name as parent_product_name\n ')\n ->where(function($query){\n $query->where(function($query){\n $query->variantProducts();\n })->orWhere(function($query){\n $query->nonVariantProducts();\n });\n });\n\n $products = $productsQuery\n ->leftJoin('products as parentProduct', function($join){\n $join->on('parentProduct.id', '=', 'products.product_id');\n })\n\n //CHECK attributesLimitLoad attribute, attributes may not be available after\n //certain limit of products\n ->when($productsQuery->count() < $this->attributesLimitLoad, function($query){\n $query->with([\n 'attributesItems' => function($query){\n $query->withTextAttributes();\n }\n ]);\n })\n ->get();\n\n return $products->map(function($product) use ($productModel) {\n if ( config('admineshop.attributes.attributesVariants', false) == true ) {\n $attributesText = $product->attributesVariantsText;\n } else if ( config('admineshop.attributes.attributesText', false) == true ) {\n $attributesText = $product->attributesText;\n } else {\n $attributesText = null;\n }\n\n $name = ($product->getValue('name') ?: $product->getValue('parent_product_name')) ?: '';\n $name .= $attributesText ? ' - '.$attributesText : '';\n if ( $product->hasFieldParam('name', 'locale') ) {\n $name = [Localization::getLocale() => $name];\n }\n\n $product->setAttribute('name', $name);\n\n $product\n ->setVisible(['id', 'name', 'priceWithVat', 'priceWithoutVat', 'vatValue', 'product_type'])\n ->setAppends([\n 'priceWithVat',\n 'priceWithoutVat',\n 'vatValue'\n ]);\n\n return $product;\n });\n }", "protected function getProducts()\n {\n /**\n * Search provider being taken trough container. This is src/Product/SearchProvider class\n */\n $searchProvider = $this->getContainer()->get('invertus.training.product.search_provider');\n\n $context = new ProductSearchContext($this->context);\n\n $query = new ProductSearchQuery();\n\n $query\n ->setResultsPerPage(20)\n ->setPage(1)\n ;\n\n /**\n * We get product list using context and query\n * Context is simply required for context of page like language\n * Query tells what sort of list we went to provider. Query might contain idCategory,\n * idManufacturer and so but it only matters if searchProvider takes them into account\n */\n $result = $searchProvider->runQuery(\n $context,\n $query\n );\n\n /**\n * Assemble is required to assemble product data and add missing properties\n */\n $assembler = new ProductAssembler($this->context);\n\n /**\n * Presentation settings hold settings that might affect how to dispaly products\n * Example: if Catalog mode is on you shouldn't display add to cart.\n */\n $presenterFactory = new ProductPresenterFactory($this->context);\n $presentationSettings = $presenterFactory->getPresentationSettings();\n\n /**\n * Present is responsible for presenting additional data like images links etc,\n */\n $presenter = new ProductListingPresenter(\n new ImageRetriever(\n $this->context->link\n ),\n $this->context->link,\n new PriceFormatter(),\n new ProductColorsRetriever(),\n $this->context->getTranslator()\n );\n\n $products_for_template = [];\n\n foreach ($result->getProducts() as $rawProduct) {\n $products_for_template[] = $presenter->present(\n $presentationSettings,\n $assembler->assembleProduct($rawProduct),\n $this->context->language\n );\n }\n\n return $products_for_template;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
static $folders_path = '../../content/folders.json';
private static function folders_path(){ return dirname(__DIR__) . '/content/folders.json'; }
[ "public function include_json_folders()\n {\n }", "public function include_json_folder($path = '')\n {\n }", "function getDataFolder(){\n return dirname(__FILE__) . '/../data';\n}", "protected function get_cms_folders()\n\t{\n\t\t$json = <<<EOF\n{\n \"name\": \"cms_folders\",\n \"columns\": {\n \"folder_path\": {\n \"allow_null\": true,\n \"auto_increment\": false,\n \"binary\": false,\n \"comment\": \"\",\n \"decimals\": null,\n \"default\": null,\n \"length\": 0,\n \"name\": \"folder_path\",\n \"type\": \"TEXT\",\n \"unsigned\": false,\n \"values\": [\n\n ],\n \"zerofill\": false\n },\n \"folder_last_modified\": {\n \"allow_null\": false,\n \"auto_increment\": false,\n \"binary\": false,\n \"comment\": \"\",\n \"decimals\": null,\n \"default\": \"0\",\n \"length\": 11,\n \"name\": \"folder_last_modified\",\n \"type\": \"INT\",\n \"unsigned\": false,\n \"values\": [\n\n ],\n \"zerofill\": false\n },\n \"folder_id\": {\n \"allow_null\": false,\n \"auto_increment\": true,\n \"binary\": false,\n \"comment\": \"\",\n \"decimals\": null,\n \"default\": null,\n \"length\": 10,\n \"name\": \"folder_id\",\n \"type\": \"INT\",\n \"unsigned\": true,\n \"values\": [\n\n ],\n \"zerofill\": false\n },\n \"folder_parent_id\": {\n \"allow_null\": false,\n \"auto_increment\": false,\n \"binary\": false,\n \"comment\": \"\",\n \"decimals\": null,\n \"default\": \"0\",\n \"length\": 10,\n \"name\": \"folder_parent_id\",\n \"type\": \"INT\",\n \"unsigned\": true,\n \"values\": [\n\n ],\n \"zerofill\": false\n },\n \"folder_name\": {\n \"allow_null\": true,\n \"auto_increment\": false,\n \"binary\": false,\n \"comment\": \"\",\n \"decimals\": null,\n \"default\": null,\n \"length\": 250,\n \"name\": \"folder_name\",\n \"type\": \"VARCHAR\",\n \"unsigned\": false,\n \"values\": [\n\n ],\n \"zerofill\": false\n }\n },\n \"indexes\": {\n \"PRIMARY\": {\n \"type\": \"primary\",\n \"name\": \"PRIMARY\",\n \"length\": [\n null\n ],\n \"columns\": [\n \"folder_id\"\n ]\n }\n },\n \"comment\": \"\"\n}\nEOF;\n\n\t\treturn json_decode( trim( $json ), TRUE );\n\t}", "public function directory() {\n $config = \\Drupal::config('webspark_isearch.settings');\n $directory_url = $config->get('directory_path');\n return $this->retriveJsonFromService($directory_url);\n }", "public function folders();", "function getStorageFolder(){\n return getDataFolder() . '/diagrams';\n }", "public function getJsonFolderPath()\n {\n\t \n\t $config = craft()->config->get('select2'); // Make Global\n\t \n\t\t$templateFolderPath = craft()->path->getSiteTemplatesPath(); // Make Global\n\t\t\n\t\t$jsonFolder = ($config['jsonFolder']) ? $config['jsonFolder'] : 'select2';\n\t\t\n\t\treturn $jsonFolderPath = $templateFolderPath . $jsonFolder . '/';\n\t \n }", "public function files()\n {\n $this->treeData = new DirTree(config('folder.defaultFolder'));\n\n return json_encode($this->treeData, JSON_PRETTY_PRINT);\n }", "protected static function getJsonFolder(): string\n {\n return apply_filters('wpgb_extended/sync/json_folder', get_stylesheet_directory() . DIRECTORY_SEPARATOR . 'wpgb-json');\n }", "public function get_local_json_path() {\n return BF::$dir . 'acf-json';\n }", "public function getFolders();", "static function FilesPath()\n {\n return Path::Combine(PHINE_PATH, 'Public/files');\n }", "public static function getJsonFilePath()\n {\n $menusetConfig = self::getMenusetConfig();\n //return Globals::getWorkFolder() . $menusetConfig->setting->fileName;\n return Globals::getDataFilePath($menusetConfig->setting->fileName_detail);\n }", "public function resourcesFolder(): string;", "public function retrieveYamlFilesFromStorageFolders() : array {}", "public function dirs() {\r\n\t\t$dirs = array();\r\n\t\t$path = $this->app->request->get('path', 'string');\r\n\t\tforeach ($this->app->path->dirs('root:'.$this->getDirectory().$path) as $dir) {\r\n\t\t\t$count = count($this->app->path->files('root:'.$this->getDirectory().$path.'/'.$dir, false, $this->filter));\r\n\t\t\t$dirs[] = array('name' => basename($dir) . \" ($count)\", 'path' => $path.'/'.$dir, 'type' => 'folder');\r\n\t\t}\r\n\r\n\t\treturn json_encode($dirs);\r\n\t}", "public function getExampleDirectories(): array {}", "public function getDataFolder(): string{\n\t\treturn $this->__init->getDataFolder() . $this->getName() . \"/\";\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get shortcode data from post body.
protected function extract_shortcode_data( int $id ) { $post = $this->get_post( $id ); $response = $post->get_shortcode(); return $response; }
[ "protected function getShortcodeData()\n {\n if($this->shortcodedata){\n return $this->shortcodedata;\n }\n $data = false;\n if($shortcode = $this->request->requestVar('Shortcode')){\n //remove BOM inside string on cursor position...\n $shortcode = str_replace(\"\\xEF\\xBB\\xBF\", '', $shortcode);\n $data = singleton('\\Silverstripe\\Shortcodable\\ShortcodableParser')->the_shortcodes(array(), $shortcode);\n if(isset($data[0])){\n $this->shortcodedata = $data[0];\n return $this->shortcodedata;\n }\n }\n }", "public function getPostContent()\n {\n return $this->post_content;\n }", "function getPostContent() {\n\t\t$template = $this->getSubTemplate('TINYMCE_POST_JS');\n\t\treturn $this->fillTemplate($template, 'tinymce', $this->cObj->data);\n\t}", "function getPostContent()\n{\n global $post;\n return $post[0]['content'];\n}", "public function getPostContent(): string {\n\t\treturn $this->postContent;\n\t}", "public function getPostContent() {\n\t\treturn $this->postContent;\n\t}", "public function getPostContent(): string {\n\t\treturn ($this->postContent);\n\t}", "public function get_content() {\n\t\treturn $this->post->post_content;\n\t}", "function ml_postcontent( $atts ){\n $a = shortcode_atts( array(\n 'id' => '',), $atts );\n $post_id = $a['id'];\n $queried_post = get_post($post_id);\n $title = $queried_post->post_title;\n return do_shortcode(wpautop($queried_post->post_content));\n}", "public function getShorContent($post)\r\n {\r\n $content = $post->getData('short_content');\r\n return $this->_filterProvider->getPageFilter()->filter($content);\r\n }", "public function get_post_data() {\n\t\treturn $this->post;\n\t}", "public function getPostData();", "public function content()\n {\n return apply_filters('the_content', $this->post->post_content);\n }", "public function ParsePostData() {}", "public function getTheContent()\n {\n return apply_filters('the_content', $this->get('post_content'));\n }", "public static function get_active_snippet_body ($shortcode, $template_name = '') {\n\t\t$html = '';\n\t\t$template = PL_Shortcode_CPT::load_template($template_name, $shortcode);\n\t\tif (!empty($template['snippet_body'])) {\n\t\t\t$html = $template['snippet_body'];\n\t\t}\n\t\treturn $html;\n\t}", "protected function readPostBody()\n {\n return $this->postBody;\n }", "public function getPostBody()\n {\n return $this->postBody;\n }", "public function post_body() {\n\t\treturn file_get_contents( 'php://input' );\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns organization settings for post approval and custom blacklist
public function getOrgContentSettings($orgID){ $this->createOrgSettings($orgID); $settings = $this->dl->getOrgContentSettings($orgID); return [$settings['enablePostApproval'],$settings['enableBlacklist']]; }
[ "function filterOrganizationSettings() {\n\treturn array(\n\t\t'id'\t\t\t=> 'organizations.id',\n\t\t'name'\t\t\t=> filterOrganizationByKeyword(Input::get('keyword', false)),\n\t\t'alt_name'\t\t=> 'organizations.alt_name',\n\t\t'orderby'\t\t=> filterOrganizationByDefaultSort(\n\t\t\tInput::get('orderby', false), \n\t\t\tInput::get('order', 'asc')\n\t\t)\n\t);\t\n}", "function opalmembership_get_settings() {\n\n\t$settings = get_option( 'opalmembership_settings' );\n\n\treturn (array) apply_filters( 'opalmembership_get_settings', $settings );\n\n}", "public function get_sub_settings() {\n\t\treturn array(\n\t\t\tarray(\n\t\t\t\t'id' => 'site_url',\n\t\t\t\t'title' => __( 'Custom Site URL', 'google-site-kit-dev-settings' ),\n\t\t\t\t'description' => __( 'This will override your actual site URL, causing Site Kit to request and display insights for the site URL you enter here.', 'google-site-kit-dev-settings' ),\n\t\t\t\t'section' => 'general',\n\t\t\t\t'class' => 'regular-text code',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'id' => 'oauth2_client_id',\n\t\t\t\t'title' => __( 'Google OAuth2 Client ID', 'google-site-kit-dev-settings' ),\n\t\t\t\t'section' => 'authentication',\n\t\t\t\t'class' => 'regular-text code',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'id' => 'oauth2_client_secret',\n\t\t\t\t'title' => __( 'Google OAuth2 Client Secret', 'google-site-kit-dev-settings' ),\n\t\t\t\t'section' => 'authentication',\n\t\t\t\t'class' => 'regular-text code',\n\t\t\t),\n\t\t);\n\t}", "public static function get_allowed_settings_by_group()\n {\n }", "function ciniki_ags_settingsGet($ciniki) {\n // \n // Find all the required and optional arguments\n // \n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'prepareArgs');\n $rc = ciniki_core_prepareArgs($ciniki, 'no', array(\n 'tnid'=>array('required'=>'yes', 'blank'=>'no', 'name'=>'Tenant'), \n )); \n if( $rc['stat'] != 'ok' ) { \n return $rc;\n } \n $args = $rc['args'];\n \n // \n // Make sure this module is activated, and\n // check permission to run this function for this tenant\n // \n ciniki_core_loadMethod($ciniki, 'ciniki', 'ags', 'private', 'checkAccess');\n $rc = ciniki_ags_checkAccess($ciniki, $args['tnid'], 'ciniki.ags.settingsGet'); \n if( $rc['stat'] != 'ok' ) { \n return $rc;\n }\n $modules = $rc['modules'];\n \n //\n // Grab the settings for the tenant from the database\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbDetailsQuery');\n $rc = ciniki_core_dbDetailsQuery($ciniki, 'ciniki_ags_settings', 'tnid', $args['tnid'], 'ciniki.ags', 'settings', '');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n\n if( !isset($rc['settings']) ) {\n return array('stat'=>'ok', 'settings'=>array());\n }\n $settings = $rc['settings'];\n\n //\n // Check if different settings used for each type of exhibit\n //\n if( ciniki_core_checkModuleFlags($ciniki, 'ciniki.ags', 0x0400) ) {\n //\n // Get the types used\n //\n $strsql = \"SELECT DISTINCT tag_name AS name, permalink \"\n . \"FROM ciniki_ags_exhibit_tags \"\n . \"WHERE tnid = '\" . ciniki_core_dbQuote($ciniki, $args['tnid']) . \"' \"\n . \"AND tag_type = 20 \"\n . \"ORDER BY permalink \"\n . \"\";\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbHashQueryArrayTree');\n $rc = ciniki_core_dbHashQueryArrayTree($ciniki, $strsql, 'ciniki.ags', array(\n array('container'=>'types', 'fname'=>'permalink', 'fields'=>array('name', 'permalink'),\n ),\n ));\n if( $rc['stat'] != 'ok' ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.ags.24', 'msg'=>'Unable to load tags', 'err'=>$rc['err']));\n }\n $types = isset($rc['types']) ? $rc['types'] : array();\n \n $settings['typecards'] = array();\n foreach($types as $type) {\n foreach(['image', 'template', 'artist-prefix', 'include-size', 'last-line', 'qr-code-prefix', 'title', 'description'] as $item) {\n if( isset($settings[\"namecards-{$type['permalink']}-{$item}\"]) ) {\n $type[$item] = $settings[\"namecards-{$type['permalink']}-{$item}\"];\n } else {\n $type[$item] = '';\n }\n }\n $settings['typecards'][$type['permalink']] = $type;\n }\n\n }\n\n\n return array('stat'=>'ok', 'settings'=>$settings);\n}", "public function getOrganization()\n {\n return [\n 'orgCode' => self::getClaim('org_code')['value']\n ];\n }", "public function getExcludedSettings() { }", "function catalyst_get_page_settings() {\n $post_id = apply_filters( 'catalyst_page_settings_post_id', is_singular() ? get_the_ID() : '' );\n $settings = array(\n 'layout' => get_post_meta( $post_id, '_catalyst_layout', true ),\n 'floating_header' => get_post_meta( $post_id, '_catalyst_floating_header', true ),\n 'hide_banner' => get_post_meta( $post_id, '_catalyst_hide_banner', true ),\n 'banner_title' => get_post_meta( $post_id, '_catalyst_banner_title', true ),\n 'banner_tagline' => get_post_meta( $post_id, '_catalyst_banner_tagline', true ),\n 'banner_menu' => get_post_meta( $post_id, '_catalyst_banner_menu', true ),\n 'banner_image' => get_post_meta( $post_id, '_catalyst_banner_image', true ),\n );\n return apply_filters( 'catalyst_page_settings', $settings );\n}", "public function getThirdPartySettings();", "function get_all_bloementuin_organisations_list($period = 2) {\n\n\t\t$args = array(\n\t\t\t'posts_per_page' => -1,\n \t\t'post_type' => 'Cab_Organisation',\n \t\t'post_status' => array('publish')\n );\n\n\t\t$all_organisations = get_posts( $args );\n\n\t\t$organisation_list = array();\n\n\t\t// Walk through all organisations to check if the organisation needs to be shown\n\t\t// in \"bloementuin\"\n\t\tforeach ($all_organisations as $key => $organisation) {\n\t\t\tif ($this->is_application_allowed($organisation->ID, \"bloementuin\")) {\n\n\t\t\t\t$owner_id = $this->get_user_id_by_organisation_id($organisation->ID);\n\n\t\t\t\t$organisation_name = get_user_meta($owner_id, 'user-cab_organisatie-naam');\n\n\t\t\t\tarray_push($organisation_list, array(\"id\"=>$organisation->ID,\"name\"=>$organisation_name[0]));\n\t\t\t}\n\t\t}\n\n\t\treturn $organisation_list;\n\t}", "public function getAuthorizationOptions()\n\t{\n\t\t$providerConfig = Craft::app()->config->get($this->getHandle(), 'social');\n\n\t\tif ($providerConfig && isset($providerConfig['authorizationOptions']))\n\t\t{\n\t\t\treturn $providerConfig['authorizationOptions'];\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn $this->getDefaultAuthorizationOptions();\n\t\t}\n\t}", "function wpwebapp_settings_field_block_wp_backend_access_choices() {\n $block_wp_backend_access = array(\n 'admin' => array(\n 'value' => 'admin',\n 'label' => __( 'Admin', 'wpwebapp' )\n ),\n 'editor' => array(\n 'value' => 'editor',\n 'label' => __( 'Editor', 'wpwebapp' )\n ),\n 'author' => array(\n 'value' => 'author',\n 'label' => __( 'Author', 'wpwebapp' )\n ),\n 'contributor' => array(\n 'value' => 'contributor',\n 'label' => __( 'Contributor', 'wpwebapp' )\n ),\n 'subscriber' => array(\n 'value' => 'subscriber',\n 'label' => __( 'Subscriber', 'wpwebapp' )\n )\n );\n\n return apply_filters( 'wpwebapp_settings_field_block_wp_backend_access_choices', $block_wp_backend_access );\n}", "function get_customizations() {\n\n\t\t$menu_customizations = false;\n\t\t$dash_widgets = array();\n\n\t\tif ( $customizations = get_option( \"ac_customize_$this->current_role\" ) ) {\n\n\t\t\tif ( isset( $customizations['menu'] ) && ! empty( $customizations['menu'] ) ) {\n\t\t\t\t$menu_customizations = $customizations['menu'];\n\t\t\t}\n\n\t\t\tif ( isset( $customizations['widgets'] ) && ! empty( $customizations['widgets'] ) ) {\n\t\t\t\t$dash_widgets = $customizations['widgets'];\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Allows filtering the custom menu.\n\t\t *\n\t\t * @since 0.1.0\n\t\t */\n\t\t$this->customize_adminmenu->custom_menu = apply_filters( 'ac_custom_menu', $menu_customizations );\n\n\t\t/**\n\t\t * Allows filtering the new widgets.\n\t\t *\n\t\t * @since 0.1.0\n\t\t */\n\t\t$this->customize_dashwidgets->dash_widgets = apply_filters( 'ac_dash_widgets', $dash_widgets );\n\t}", "function _site_collect_theme_settings() {\n $settings = [];\n\n // Header bar\n $settings['header_bar']['tour_url'] = theme_get_setting('tour_url');\n $settings['header_bar']['contact_url'] = theme_get_setting('contact_url');\n\n // Contact information\n $settings['contact_information']['business_owner_name'] = theme_get_setting('business_owner_name');\n $settings['contact_information']['business_startup_year'] = theme_get_setting('business_startup_year');\n $settings['contact_information']['address'] = theme_get_setting('address');\n $settings['contact_information']['zipcode'] = theme_get_setting('zipcode');\n $settings['contact_information']['city'] = theme_get_setting('city');\n $settings['contact_information']['phone_system'] = theme_get_setting('phone_system');\n $settings['contact_information']['phone_readable'] = theme_get_setting('phone_readable');\n $settings['contact_information']['email'] = theme_get_setting('email');\n $settings['contact_information']['working_hours'] = theme_get_setting('working_hours');\n\n // Social\n $settings['social']['facebook']['active'] = theme_get_setting('facebook');\n $settings['social']['facebook']['url'] = theme_get_setting('facebook_url');\n $settings['social']['facebook']['tooltip'] = theme_get_setting('facebook_tooltip');\n $settings['social']['twitter']['active'] = theme_get_setting('twitter');\n $settings['social']['twitter']['url'] = theme_get_setting('twitter_url');\n $settings['social']['twitter']['tooltip'] = theme_get_setting('twitter_tooltip');\n $settings['social']['googleplus']['active'] = theme_get_setting('googleplus');\n $settings['social']['googleplus']['url'] = theme_get_setting('googleplus_url');\n $settings['social']['googleplus']['tooltip'] = theme_get_setting('googleplus_tooltip');\n $settings['social']['instagram']['active'] = theme_get_setting('instagram');\n $settings['social']['instagram']['url'] = theme_get_setting('instagram_url');\n $settings['social']['instagram']['tooltip'] = theme_get_setting('instagram_tooltip');\n $settings['social']['linkedin']['active'] = theme_get_setting('linkedin');\n $settings['social']['linkedin']['url'] = theme_get_setting('linkedin_url');\n $settings['social']['linkedin']['tooltip'] = theme_get_setting('linkedin_tooltip');\n $settings['social']['pinterest']['active'] = theme_get_setting('pinterest');\n $settings['social']['pinterest']['url'] = theme_get_setting('pinterest_url');\n $settings['social']['pinterest']['tooltip'] = theme_get_setting('pinterest_tooltip');\n $settings['social']['vimeo']['active'] = theme_get_setting('vimeo');\n $settings['social']['vimeo']['url'] = theme_get_setting('vimeo_url');\n $settings['social']['vimeo']['tooltip'] = theme_get_setting('vimeo_tooltip');\n $settings['social']['youtube']['active'] = theme_get_setting('youtube');\n $settings['social']['youtube']['url'] = theme_get_setting('youtube_url');\n $settings['social']['youtube']['tooltip'] = theme_get_setting('youtube_tooltip');\n\n return $settings;\n}", "public function get_settings_options(){\r\n\t\t\r\n\t\t$info = $this->component_info();\r\n\t\t$optionname = $info['option_name'];\r\n\t\t\r\n\t\t$settings = array();\r\n\t\t\r\n\t\t\r\n\t\t$temp = array();\r\n\t\t$temp['name'] = __('Content Page disabled for','admin2020');\r\n\t\t$temp['description'] = __(\"Content Page will be disabled for any users or roles you select\",'admin2020');\r\n\t\t$temp['type'] = 'user-role-select';\r\n\t\t$temp['optionName'] = 'disabled-for'; \r\n\t\t$temp['value'] = $this->utils->get_option($optionname,$temp['optionName'], true);\r\n\t\t$settings[] = $temp;\r\n\t\t\r\n\t\t$temp = array();\r\n\t\t$temp['name'] = __('Post types available in content page','admin2020');\r\n\t\t$temp['description'] = __(\"Only the selected post types will be available in the content page.\",'admin2020');\r\n\t\t$temp['type'] = 'post-type-select';\r\n\t\t$temp['optionName'] = 'post-types-content'; \r\n\t\t$temp['value'] = $this->utils->get_option($optionname,$temp['optionName'], true);\r\n\t\t$settings[] = $temp;\r\n\t\t\r\n\t\t$temp = array();\r\n\t\t$temp['name'] = __('Enable private library mode','admin2020');\r\n\t\t$temp['description'] = __(\"When enabled, the content page will only show content created by or uploaded by the currently logged in user. This includes folders..\",'admin2020');\r\n\t\t$temp['type'] = 'switch';\r\n\t\t$temp['optionName'] = 'private-mode'; \r\n\t\t$temp['value'] = $this->utils->get_option($optionname,$temp['optionName']);\r\n\t\t$settings[] = $temp;\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\treturn $settings;\r\n\t\t\r\n\t}", "function getTenantConfig();", "function getDomainSettings(){\n\t\t//get current domain from server name as variable\n\t\t$domain = preg_replace('/^www\\./', '', $_SERVER['SERVER_NAME']);\n\t\t//Load domain model data\n\t\t$this->loadModel('Domain');\n\t\t//retrieve only current domain table record\n\t\t$domain_settings = $this->Domain->find('all', array('conditions' => \n\t\tarray('Domain.domain' => $domain))); \n\t\tforeach($domain_settings as $value){\n\t\t\t//create Configure::Write variables from domain record to use elsewhere in application\n\t\t\tConfigure::write('domain', $value['Domain']['domain']);\n\t\t\tConfigure::write('domain_id', $value['Domain']['id']);\n\t\t\tConfigure::write('ga_code', $value['Domain']['ga_code']);\n\t\t\tConfigure::write('meta_title', $value['Domain']['meta_title']);\n\t\t\tConfigure::write('meta_keywords', $value['Domain']['meta_keywords']);\n\t\t\tConfigure::write('meta_description', $value['Domain']['meta_description']); \n\t\t\t\n\t\t\t//etc retrieve as many domain specific values as required from database\n\t\t}\n\t}", "protected function getOrganization() {\n $account_id = $this->getAccountId();\n $data = $this->get('https://www.drupal.org/api-d7/node.json?type=organization&title=' . urlencode($account_id));\n if (isset($data['list']) && count($data['list']) === 1) {\n return reset($data['list']);\n }\n else {\n return [];\n }\n }", "public function getSettings();" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Create request for operation 'tmuNoticesGet'
protected function tmuNoticesGetRequest($facility = null, $children = null, $onlyactive = null) { $resourcePath = '/tmu/notices'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; // query params if ($facility !== null) { $queryParams['facility'] = ObjectSerializer::toQueryValue($facility); } // query params if ($children !== null) { $queryParams['children'] = ObjectSerializer::toQueryValue($children); } // query params if ($onlyactive !== null) { $queryParams['onlyactive'] = ObjectSerializer::toQueryValue($onlyactive); } // body params $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( ['application/json'] ); } else { $headers = $this->headerSelector->selectHeaders( ['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\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( 'GET', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); }
[ "protected function officesGetRequest()\n {\n\n $resourcePath = '/offices';\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 ['*/*']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['*/*'],\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\\build_query($formParams);\n }\n }\n\n // this endpoint requires OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function availableOperationsRequest()\n {\n\n $resourcePath = '/user';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\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 'OPTIONS',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "private function getNotificationsRequest()\n {\n $resourcePath = \"/notifications\";\n\n $requestUrl = $this->config->getHost() . $resourcePath;\n $request = new Request('GET', $requestUrl);\n\n return $request;\n }", "public function upcomingInvoicesRequest()\n {\n\n $resourcePath = '/v2/billing/invoices/upcoming';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\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 }", "protected function getBalanceNotificationOptionsRequest()\n {\n\n $resourcePath = '/api/v2/user/notification/balance/bundles';\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 ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n \n if($headers['Content-Type'] === 'application/json') {\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n // array has no __toString(), so we should encode it manually\n if(is_array($httpBody)) {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));\n }\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires 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\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "protected function getTermsRequest()\n {\n\n $resourcePath = '/v1/account/terms';\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 allCheckNotificationsRequest()\n {\n\n $resourcePath = '/api/check/notifications';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\Query::build($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('auth-livewatch-token');\n if ($apiKey !== null) {\n $headers['auth-livewatch-token'] = $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 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "protected function getPendingTransactionsRequest()\n {\n\n $resourcePath = '/pending-transactions';\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 ['application/x-www-form-urlencoded']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires 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\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function availableTenantResourceOperationsRequest()\n {\n\n $resourcePath = '/tenant';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\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 'OPTIONS',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "protected function getTickersRequest()\n {\n\n $resourcePath = '/tickers';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('X-API-Token');\n if ($apiKey !== null) {\n $headers['X-API-Token'] = $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\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "protected function onlineInvoiceRequest()\n {\n return new Remote\\Request(\n $this->_application,\n $this->onlineInvoiceRemoteUrl()\n );\n }", "public function retrieveInvoicesAction()\n {\n $invoiceId = $this->container->get('request')->get('id'); \n $baseUrl = $this->setGetContract->subUrlsInvoices.\"/$invoiceId\";\n $customerUrl= $baseUrl.\"?customer=$this->customerId\";\n $this->url = (isset($this->customerId)) ? $baseUrl : $customerUrl;\n $this->currentSubUrl = 'subUrlsInvoices';\n $this->datas = array();\n \n return $this->prepareRequest(); \n }", "public function apiV2PortalTosRetrieveRequest($uuid)\n {\n // verify the required parameter 'uuid' is set\n if ($uuid === null || (is_array($uuid) && count($uuid) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $uuid when calling apiV2PortalTosRetrieve'\n );\n }\n\n $resourcePath = '/api/v2/portal/tos/{uuid}/';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($uuid !== null) {\n $resourcePath = str_replace(\n '{' . 'uuid' . '}',\n ObjectSerializer::toPathValue($uuid),\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 // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Session');\n if ($apiKey !== null) {\n \n }\n // this endpoint requires Bearer (JWT) authentication (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\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\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function listLogNewrelicRequest($options)\n {\n // unbox the parameters from the associative array\n $service_id = array_key_exists('service_id', $options) ? $options['service_id'] : null;\n $version_id = array_key_exists('version_id', $options) ? $options['version_id'] : null;\n\n // verify the required parameter 'service_id' is set\n if ($service_id === null || (is_array($service_id) && count($service_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $service_id when calling listLogNewrelic'\n );\n }\n // verify the required parameter 'version_id' is set\n if ($version_id === null || (is_array($version_id) && count($version_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $version_id when calling listLogNewrelic'\n );\n }\n\n $resourcePath = '/service/{service_id}/version/{version_id}/logging/newrelic';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($service_id !== null) {\n $resourcePath = str_replace(\n '{' . 'service_id' . '}',\n ObjectSerializer::toPathValue($service_id),\n $resourcePath\n );\n }\n // path params\n if ($version_id !== null) {\n $resourcePath = str_replace(\n '{' . 'version_id' . '}',\n ObjectSerializer::toPathValue($version_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\\Query::build($formParams);\n }\n }\n\n // this endpoint requires API token authentication\n $apiToken = $this->config->getApiTokenWithPrefix('Fastly-Key');\n if ($apiToken !== null) {\n $headers['Fastly-Key'] = $apiToken;\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 $operationHosts = [\"https://api.fastly.com\"];\n if ($this->hostIndex < 0 || $this->hostIndex >= sizeof($operationHosts)) {\n throw new \\InvalidArgumentException(\"Invalid index {$this->hostIndex} when selecting the host. Must be less than \".sizeof($operationHosts));\n }\n $operationHost = $operationHosts[$this->hostIndex];\n\n $query = \\GuzzleHttp\\Psr7\\Query::build($queryParams);\n return new Request(\n 'GET',\n $operationHost . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "protected function plantbatchesV1InactiveGetRequest()\n {\n\n $resourcePath = '/plantbatches/v1/inactive';\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 []\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n [],\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 \n if($headers['Content-Type'] === 'application/json') {\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n // array has no __toString(), so we should encode it manually\n if(is_array($httpBody)) {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));\n }\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "protected function listNoticeResponsibilitiesRequest($filter = null, $top = null, $skip = null, $order_by = null, $x_avalara_client = 'Swagger UI; 20.9.0; Custom; 1.0')\n {\n\n $resourcePath = '/api/v2/definitions/noticeresponsibilities';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if ($filter !== null) {\n $queryParams['$filter'] = ObjectSerializer::toQueryValue($filter);\n }\n // query params\n if ($top !== null) {\n $queryParams['$top'] = ObjectSerializer::toQueryValue($top);\n }\n // query params\n if ($skip !== null) {\n $queryParams['$skip'] = ObjectSerializer::toQueryValue($skip);\n }\n // query params\n if ($order_by !== null) {\n $queryParams['$orderBy'] = ObjectSerializer::toQueryValue($order_by);\n }\n // header params\n if ($x_avalara_client !== null) {\n $headerParams['X-Avalara-Client'] = ObjectSerializer::toHeaderValue($x_avalara_client);\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 \n if($headers['Content-Type'] === 'application/json') {\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n // array has no __toString(), so we should encode it manually\n if(is_array($httpBody)) {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));\n }\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n // 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\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "protected function getAktiveTeilnehmerUsingGETRequest()\n {\n\n $resourcePath = '/v2/teilnehmer';\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 ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n \n if($headers['Content-Type'] === 'application/json') {\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n // array has no __toString(), so we should encode it manually\n if(is_array($httpBody)) {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));\n }\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "protected function informationsRequest()\n {\n\n $resourcePath = '/informations';\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\\build_query($formParams);\n }\n }\n\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n if ($this->config->getAccessToken()) {\n $defaultHeaders['Authorization'] = sprintf('Bearer %s', $this->config->getAccessToken());\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function getNotices()\n {\n return $this->hasMany(Notices::className(), ['notice_type_id' => 'id']);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
=================================================================================================================================================== Get a list of Workouts assigned to log_result Events for a Client on a Date ===================================================================================================================================================
public function getWorkoutsForClientDate( $p_client_id, $p_ccyymmdd ) { $sql = ""; $sql .= "SELECT "; $sql .= "library_workout.name 'library_workout.name', library_workout.id 'library_workout.id', "; $sql .= "library_workout.library_workout_recording_type_id `library_workout.library_workout_recording_type_id` "; $sql .= "FROM "; $sql .= "server, "; $sql .= "client, "; $sql .= "calendar, "; $sql .= "calendar_event, "; $sql .= "calendar_event_participation, "; $sql .= "workout_log, "; $sql .= "library_workout "; $sql .= "WHERE client.id = " . $p_client_id . " "; $sql .= "AND calendar.client_id = client.id "; $sql .= "AND calendar_event.calendar_id = calendar.id "; $sql .= "AND DATE_FORMAT(CONVERT_TZ(FROM_UNIXTIME(calendar_event.start),server.timezone,calendar.timezone),'%Y%m%d') = '" . $p_ccyymmdd . "' "; $sql .= "AND calendar_event_participation.calendar_event_id = calendar_event.id "; $sql .= "AND workout_log.calendar_event_participation_id = calendar_event_participation.id "; $sql .= "AND library_workout.id = workout_log.library_workout_id "; $sql .= "AND library_workout.library_workout_recording_type_id IS NOT NULL "; $sql .= "GROUP BY library_workout.name, library_workout.id"; // echo "$sql<br />"; $query = $this->db->query($sql); if ($query->num_rows() == 0) { return $this->return_handler->results(204,"No Entry Found",array()); } $rows = $query->result(); $entries = array(); foreach( $rows as $row ) { // print_r($row); echo "<br />"; // store the entry info $entry = new stdClass(); $entry->id = cast_int($row->{'library_workout.id'}); $entry->name = $row->{'library_workout.name'}; $entry->workout_recording_type_id = cast_int($row->{'library_workout.library_workout_recording_type_id'}); // put entry into entries array_push($entries,$entry); // clear the entry from memory unset($entry); } return $this->return_handler->results(200,"",$entries); }
[ "public function getClientWorkoutsWithLogsForUserDate($p_user_id,$p_start) {\n\t\t\n\t\t$sql = \"SELECT \";\n\t\t$sql .= \"client.id 'client.id', client.name 'client.name', \";\n\t\t$sql .= \"library_workout.id 'library_workout.id', library_workout.name 'library_workout.name', \";\n\t\t$sql .= \"library_workout.library_workout_recording_type_id `library_workout.library_workout_recording_type_id` \";\n\t\t$sql .= \"FROM \";\n\t\t$sql .= \"server, \";\n\t\t$sql .= \"client_user, \";\n\t\t$sql .= \"client, \";\n\t\t$sql .= \"calendar, \";\n\t\t$sql .= \"calendar_event, \";\n\t\t$sql .= \"calendar_event_participation, \";\n\t\t$sql .= \"workout_log, \";\n\t\t$sql .= \"library_workout \";\n\t\t$sql .= \"WHERE client_user.user_id = \" . $p_user_id . \" AND client_user.deleted IS NULL \";\n\t\t$sql .= \"AND client.id = client_user.client_id \";\n\t\t$sql .= \"AND calendar.client_id = client_user.client_id \";\n\t\t$sql .= \"AND calendar_event.calendar_id = calendar.id \";\n\t\t$sql .= \"AND \";\n\t\t$sql .= \"DATE_FORMAT(CONVERT_TZ(FROM_UNIXTIME(calendar_event.start),server.timezone,calendar.timezone),'%Y%m%d') = '\" . $p_start . \"' \";\n\t\t$sql .= \"AND calendar_event_participation.calendar_event_id = calendar_event.id \";\n\t\t$sql .= \"AND workout_log.calendar_event_participation_id = calendar_event_participation.id \";\n\t\t$sql .= \"AND workout_log.library_workout_recording_type_id IS NOT NULL \";\n\t\t$sql .= \"AND library_workout.id = workout_log.library_workout_id \";\n\t\t$sql .= \"GROUP BY client.id, library_workout.id \";\n\n\t\t// echo \"$sql<br />\";\n\n\t\t$query = $this->db->query($sql);\n\t\tif ($query->num_rows() == 0) {\n\t\t\treturn $this->return_handler->results(204,\"No Entry Found\",array());\n\t\t}\n\t\t$rows = $query->result();\n\t\t\n\t\t$client = array();\n\t\t$c = -1;\n\t\tforeach( $rows as $row ) {\n\t\t\t// print_r($row); echo \"<br />\";\n\t\t\t\n\t\t\t// cast the column values in the row to their column type\n\t\t\tmysql_schema::cast_row('workoutdb',$row);\n\t\t\t// objectify the row by table\n\t\t\t$row = mysql_schema::objectify_row($row);\n\t\t\t// print_r($row); echo \"<br />\";\n\t\t\t\n\t\t\tif ( $c < 0 || $client[$c]->id != $row->client->id ) {\n\t\t\t\t++$c;\n\t\t\t\t$client[$c]->id = $row->client->id;\n\t\t\t\t$client[$c]->name = $row->client->name;\n\t\t\t\t// initialize the class array\n\t\t\t\t$client[$c]->workout = array();\n\t\t\t\t$workout = &$client[$c]->workout;\n\t\t\t\t$w = -1;\n\t\t\t}\n\t\t\tif ( $w < 0 || $workout[$w]->id != $row->library_workout->id ) {\n\t\t\t\t++$w;\n\t\t\t\t$workout[$w]->id = $row->library_workout->id;\n\t\t\t\t$workout[$w]->name = $row->library_workout->name;\n\t\t\t\t$workout[$w]->workout_recording_type_id = $row->library_workout->library_workout_recording_type_id;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $this->return_handler->results(200,\"\",$client);\n\t}", "public function getLocationScheduleForClientDateWorkout( $p_client_id, $p_ccyymmdd, $p_library_workout_id ) {\n\t\t$sql = \"\";\n\t\t$sql .= \"SELECT \";\n\t\t$sql .= \"location.id `location.id`, location.name `location.name`, \";\n\t\t$sql .= \"location.timezone `location.timezone`, \";\n\t\t$sql .= \"calendar_event.id `calendar_event.id`, calendar_event.name `calendar_event.name`, calendar_event.start `calendar_event.start` \";\n\t\t$sql .= \"FROM \";\n\t\t$sql .= \"server, \";\n\t\t$sql .= \"client, \";\n\t\t$sql .= \"calendar \";\n\t\t$sql .= \"LEFT OUTER JOIN location \";\n\t\t$sql .= \"ON location.id = calendar.location_id, \";\n\t\t$sql .= \"calendar_event, \";\n\t\t$sql .= \"calendar_event_participation, \";\n\t\t$sql .= \"workout_log \";\n\t\t$sql .= \"WHERE client.id = \" . $p_client_id . \" \";\n\t\t$sql .= \"AND calendar.client_id = client.id \";\n\t\t$sql .= \"AND calendar_event.calendar_id = calendar.id \";\n\t\t$sql .= \"AND DATE_FORMAT(CONVERT_TZ(FROM_UNIXTIME(calendar_event.start),server.timezone,calendar.timezone),'%Y%m%d') = '\" . $p_ccyymmdd . \"' \";\n\t\t$sql .= \"AND calendar_event_participation.calendar_event_id = calendar_event.id \";\n\t\t$sql .= \"AND workout_log.calendar_event_participation_id = calendar_event_participation.id \";\n\t\t$sql .= \"AND workout_log.library_workout_id = \" . $p_library_workout_id . \" \";\n\t\t$sql .= \"GROUP BY location.name, calendar_event.name, calendar_event.start, calendar_event.id \";\n\n\t\t// echo \"$sql<br />\";\n\n\t\t$query = $this->db->query($sql);\n\t\tif ($query->num_rows() == 0) {\n\t\t\treturn $this->return_handler->results(204,\"No Entry Found\",array());\n\t\t}\n\t\t$rows = $query->result();\n\t\t\n\t\t$location = array();\n\t\t$l = -1;\n\t\tforeach( $rows as $row ) {\n\t\t\t// print_r($row); echo \"<br />\";\n\t\t\t\n\t\t\t// cast the column values in the row to their column type\n\t\t\tmysql_schema::cast_row('workoutdb',$row);\n\t\t\t// objectify the row by table\n\t\t\t$row = mysql_schema::objectify_row($row);\n\t\t\t// print_r($row); echo \"<br />\";\n\t\t\t\n\t\t\tif ( $l < 0 || $location[$l]->id != $row->location->id ) {\n\t\t\t\t++$l;\n\t\t\t\t$location[$l]->id = $row->location->id;\n\t\t\t\t$location[$l]->name = $row->location->name;\n\t\t\t\t$location[$l]->timezone = $row->location->timezone;\n\t\t\t\t// get the timezone_offset for the calendar's timezone\n\t\t\t\t$location[$l]->timezone_offset = format_timezone_offset($row->location->timezone);\n\t\t\t\t// initialize the class array\n\t\t\t\t$location[$l]->class = array();\n\t\t\t\t$class = &$location[$l]->class;\n\t\t\t\t$c = -1;\n\t\t\t}\n\t\t\tif ( $c < 0 || $class[$c]->id != $row->calendar_event->id ) {\n\t\t\t\t++$c;\n\t\t\t\t$class[$c]->id = $row->calendar_event->id;\n\t\t\t\t$class[$c]->name = $row->calendar_event->name;\n\t\t\t\t$class[$c]->start = $row->calendar_event->start;\n\t\t\t}\n\t\t}\n\t\t\t\n\t\treturn $this->return_handler->results(200,\"\",$location);\n\t}", "function get_workouts_by_user($username)\r\n{\r\n\t$query =\"SELECT * FROM users WHERE username ='$username'\";\r\n\t$result = queryMysql($query);\r\n\t$user_data = mysql_fetch_array($result);\r\n\t$user_id = $user_data['id'];\r\n\t\r\n\t\r\n\t$query = \"SELECT id FROM workouts WHERE user_id ='$user_id' ORDER BY date\";\r\n\t$result = queryMysql($query);\r\n\t\r\n\t$workout_object_list = array();\r\n\twhile($workout_data = mysql_fetch_array($result))\r\n\t{\r\n\t\t$workout_id = $workout_data['id'];\r\n\t\t$workout_object = get_workout_by_workout_id($workout_id);\r\n\t\t$workout_object_list[] = $workout_object;\r\n\t}\r\n\treturn $workout_object_list;\r\n}", "public function listWorkouts(DateTime $startDate, DateTime $endDate);", "function getEntriesForDate(DateTime $date)\n {\n $togglEntries = $this->api->getTimeEntriesInRange($date, $date);\n $workspaces = $this->api->getWorkspaces();\n\n // Filter workspaces\n if (!empty($this->workspace)) {\n $workspaces = array_filter($workspaces, function ($workspace) {\n return $workspace->name === $this->workspace;\n });\n\n if (!empty($workspaces)) {\n $wid = $workspaces[0]->id;\n\n $togglEntries = array_filter($togglEntries, function ($entry) use ($wid) {\n return $entry->wid === $wid;\n });\n }\n }\n\n // Load extra info\n $togglEntries = array_map(function ($entry) {\n $entry = json_decode(json_encode($entry), true);\n $extra = [];\n\n if (!empty($entry['pid'])) {\n $project = $this->api->getProject($entry['pid']);\n $extra['project'] = $project->name;\n\n if ($this->workspace) {\n $extra['workspace'] = $this->workspace;\n } elseif (!empty($project->wid)) {\n $workspace = $this->api->getWorkspace($project->wid);\n $extra['workspace'] = $workspace->name;\n }\n\n if (!empty($project->cid)) {\n $client = $this->api->getClientById($project->cid);\n $extra['client'] = $client->name;\n }\n }\n\n return array_merge($entry, $extra);\n }, $togglEntries);\n\n // Transform\n return array_map(function ($entry) {\n return $this->transformEntry($entry);\n }, $togglEntries);\n }", "function getMyWorkLogs($userid) {\n $db = DB::getInstance();\n $logs = $db->query(\n \"SELECT id, last_update, note\n FROM sage_work_log\n WHERE user_id = \".$userid)->results(true);\n return $logs;\n }", "private function getUserProgramWorkouts($userId){\n $userProgramWorkout = ClassRegistry::init('UserWorkout');\n $data = $userProgramWorkout->find('list',array(\n 'conditions'=>array('user_id'=>$userId,'completed_status'=>1),\n 'contain'=>false,\n 'fields'=>array('id','program_workout_id')\n ));\n return $data;\n }", "public function getWorkouts()\n {\n return $this->workouts;\n }", "public function getWorkouts () {\n $workouts = Workout::forCurrentUser()->get();\n\n //get all the series that are in each workout\n foreach ($workouts as $workout) {\n $workout->contents = $workout->series()->select('exercise_series.id', 'name')->orderBy('name', 'asc')->get();\n }\n\n return $workouts;\n }", "public function getWlcClientsLastAction()\n {\n $summaries = $this->get('doctrine_mongodb')\n ->getRepository('SmartwifiBundle:Summary')\n ->findBy(array(),\n array('summary_number'=>'DESC')\n );\n\n $em = $this->get('doctrine_mongodb')->getManager();\n $em->getConnection()->close();\n\n //GETTING WLC Clients\n $documents = $this->get('doctrine_mongodb')\n ->getManager()\n ->createQueryBuilder('SmartwifiBundle:Wlcclients')\n ->field('date_of_record')->range($summaries[0]->getSummaryStart(),$summaries[0]->getSummaryStop())\n ->getQuery()\n ->execute();\n\n $wlcclients = array();\n foreach($documents as $clients){\n array_push($wlcclients,$clients);\n }\n $em = $this->get('doctrine_mongodb')->getManager();\n $em->getConnection()->close();\n\n return $wlcclients;\n\n }", "public function getLogs($options = array())\n {\n $default = array(\n 'page' => 1,\n 'limit' => null,\n 'sort' => array('t' => 1),\n 'event_level' => array(),\n 'event_type' => '',\n 'date_after' => null,\n 'date_before' => null,\n 'type' => 'find'\n );\n\n\n $options = array_merge($default, $options);\n\n\n if ($options['date_before'] !== null && !is_int($options['date_before'])) {\n $options['date_before'] = strtotime($options['date_before']);\n }\n\n if ($options['date_after'] !== null && !is_int($options['date_after'])) {\n $options['date_after'] = strtotime($options['date_after']);\n }\n\n $conditions = array();\n\n\n if (!empty($options['event_level'])) {\n $conditions['d.level'] = array(\n '$in' => array_map(\n function ($level) {\n return (int)$level;\n },\n $options['event_level']\n )\n );\n }\n\n if (!empty($options['date_after'])) {\n $conditions['t']['$gte'] = new \\MongoDate($options['date_after']);\n }\n\n if (!empty($options['date_before'])) {\n $conditions['t']['$lt'] = new \\MongoDate($options['date_before']);\n }\n\n $results = array();\n\n $jobsCollection = Service::Mongo()->selectCollection(Service::$settings['Mongo']['database'], $options['event_type'] . '_events');\n\n $jobsCursor = $jobsCollection->find($conditions);\n $jobsCursor->sort($options['sort']);\n\n if (!empty($options['page']) && !empty($options['limit'])) {\n $jobsCursor->skip(($options['page']-1) * $options['limit'])->limit($options['limit']);\n }\n\n if ($options['type'] == 'count') {\n return $jobsCursor->count();\n }\n\n foreach ($jobsCursor as $cursor) {\n $temp = array();\n\n $temp['date'] = new \\DateTime('@' . $cursor['t']->sec);\n\n if (isset($cursor['d']['worker'])) {\n $temp['worker'] = $cursor['d']['worker'];\n }\n\n if (isset($cursor['d']['level'])) {\n $temp['level'] = $cursor['d']['level'];\n }\n\n if (isset($cursor['d']['job_id'])) {\n $temp['job_id'] = $cursor['d']['job_id'];\n } else if (isset($cursor['d']['args']['payload']['id'])) {\n $temp['job_id'] = $cursor['d']['args']['payload']['id'];\n }\n\n $temp['event_type'] = $options['event_type'];\n\n $results[] = $temp;\n }\n\n\n usort(\n $results,\n function (\n $a,\n $b\n ) {\n if ($a['date'] == $b['date']) {\n return 0;\n }\n return ($a['date'] < $b['date']) ? -1 : 1;\n }\n );\n\n return $results;\n }", "public function getConsolidatedWorklistTracking() \r\n {\r\n try\r\n {\r\n $sql = \"SELECT * FROM raptor_ticket_tracking\";\r\n $sqlResult = db_query($sql);\r\n $ticketTrackingResult = $this->createMapOnIEN($sqlResult);\r\n\r\n $sql = \"SELECT c.IEN, c.collaborator_uid, c.requester_notes_tx, c.requested_dt, u.username, u.usernametitle, u.firstname, u.lastname, u.suffix FROM raptor_ticket_collaboration c left join raptor_user_profile u on c.collaborator_uid=u.uid WHERE active_yn\";\r\n $sqlResult = db_query($sql);\r\n $ticketCollaborationResult = $this->createMapOnIEN($sqlResult);\r\n\r\n $sql = \"SELECT * FROM raptor_schedule_track\";\r\n $sqlResult = db_query($sql);\r\n $scheduleTrackResult = $this->createMapOnIEN($sqlResult);\r\n\r\n return array(\r\n \"raptor_ticket_tracking\" => $ticketTrackingResult,\r\n \"raptor_ticket_collaboration\" => $ticketCollaborationResult,\r\n \"raptor_schedule_track\" => $scheduleTrackResult);\r\n } catch (\\Exception $ex) {\r\n error_log(\"FAILED getConsolidatedWorklistTracking because $ex\");\r\n throw $ex;\r\n }\r\n }", "public function getWlcClientsFromYesterdayAction(){\n //QUERY BUILDER\n $summaries = $this->get('doctrine_mongodb')\n ->getManager()\n ->createQueryBuilder('SmartwifiBundle:Summary')\n //->hydrate(false)\n ->field('summary_start')->range(new \\DateTime('yesterday'),new \\DateTime('today'))\n ->sort('summary_number', 'ASC')\n ->getQuery()\n ->execute();\n\n $wlcclients = array();\n\n foreach($summaries as $summary){\n //array_push($summaries,$summary);\n //GETTING CLIENTS\n\n $documents = $this->get('doctrine_mongodb')\n ->getManager()\n ->createQueryBuilder('SmartwifiBundle:Wlcclients')\n ->field('date_of_record')->range($summary->getSummaryStart(),$summary->getSummaryStop())\n ->getQuery()\n ->execute();\n\n foreach($documents as $clients){\n array_push($wlcclients,$clients);\n }\n }\n\n $em = $this->get('doctrine_mongodb')->getManager();\n $em->getConnection()->close();\n\n return $wlcclients;\n }", "protected function createEventObjectsForIlmSessions($userId, array $results)\n {\n return array_map(function ($arr) use ($userId) {\n $event = new CalendarEvent();\n $event->user = $userId;\n $event->name = $arr['title'];\n $event->startDate = $arr['dueDate'];\n $endDate = new \\DateTime();\n $endDate->setTimestamp($event->startDate->getTimestamp());\n $event->endDate = $endDate->modify('+15 minutes');\n $event->ilmSession = $arr['id'];\n $event->color = $arr['calendarColor'];\n $event->lastModified = $arr['updatedAt'];\n $event->isPublished = $arr['sessionPublished'] && $arr['coursePublished'];\n $event->isScheduled = $arr['sessionPublishedAsTbd'] || $arr['coursePublishedAsTbd'];\n $event->courseTitle = $arr['courseTitle'];\n $event->sessionTypeTitle = $arr['sessionTypeTitle'];\n $event->courseExternalId = $arr['courseExternalId'];\n $event->sessionDescription = $arr['sessionDescription'];\n $event->session = $arr['sessionId'];\n $event->courseId = $arr['courseId'];\n $event->attireRequired = $arr['attireRequired'];\n $event->equipmentRequired = $arr['equipmentRequired'];\n $event->supplemental = $arr['supplemental'];\n $event->attendanceRequired = $arr['attendanceRequired'];\n return $event;\n }, $results);\n }", "protected function results(){\n if( $this->_results === null ){\n $this->_results = $this->eventListObj->get();\n }\n return $this->_results;\n }", "public function getAll($issueKey)\n {\n return $this->sendRequest('issue/' . urlencode($issueKey) .\n '/worklog/');\n }", "public function getEvents() {\n\t\t$listEntries = Temboo_Results::getSubItemByKey($this->base, \"items\");\n\t\t$resultArray = array();\n\t\tif(!is_null($listEntries)) {\n\t\t\tforeach ($listEntries as $entry) {\n\t\t \tarray_push($resultArray, new Google_Calendar_Event_output($entry));\n\t\t\t}\n\t\t}\n\t\treturn $resultArray;\n\t}", "function GetMyProjectEvents()\n\t{\n\t\t$result = $this->sendRequest(\"GetMyProjectEvents\", array());\t\n\t\treturn $this->getResultFromResponse($result);\n\t}", "function GetWorkoutsArray($userID) {\n\t\t\t\n\t\t\t$stmt = 'SELECT DISTINCT workoutName, description FROM workouts JOIN users ON \\''.$userID.'\\' = workouts.userID';\n\n\t\t\tif ($result = $this->connection->query($stmt)) {\n\n\t\t\t\t$arr = array();\n\n\t\t\t\twhile ($row = $result->fetch_assoc()) {\n\t\t\t\t\tarray_push($arr, array(\"workoutName\" => $row['workoutName'], \"description\" => $row['description']));\n\t\t\t\t}\n\n\t\t\t\techo json_encode($arr);\n\n\t\t\t\t$result->close();\n\t\t\t}\n\n\t\t\t$this->connection->close();\n\n\t\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Create reward for the module
public function createReward() { //Get reward name $rewardName = request()->rewardName; //Get module list ID $moduleID = request()->moduleList; //Get the amount number $amountAchieve = request()->amountAchieve; //Get module from module ID $module = Module::find($moduleID); //Check errors $error = $this->checkCreateRewardError($module, $rewardName, $amountAchieve); if (sizeof($error) == 0) { $this->saveReward($rewardName, $amountAchieve, $moduleID); session(['rewardSuccess' => 'Reward has created']); } else { session(['rewardError' => $error]); } //Redirect to the reward page return redirect('/reward'); }
[ "public function testCreateReward()\n {\n }", "public function postRedeemReward(Request $request) {\n $account = app()->make('account');\n $campaign = \\Platform\\Models\\Campaign::withoutGlobalScopes()->whereUuid(request('campaign', 0))->firstOrFail();\n $customerNumber = $request->number;\n $segments = $request->segments;\n\n // Find customer by number\n $customer = Customer::where('active', 1)->where('campaign_id', $campaign->id)->where('customer_number', $customerNumber)->first();\n\n if ($customer === null) {\n return response()->json([\n 'status' => 'error',\n 'errors' => ['number' => 'Customer not found']\n ], 422);\n }\n\n $reward = $request->reward;\n $reward = \\Platform\\Models\\Reward::whereUuid(request('reward', 0))->firstOrFail();\n\n // Check if customer has sufficient balance\n if ($reward->points_cost > $customer->points) {\n return response()->json([\n 'status' => 'error',\n 'errors' => ['reward' => 'Customer does not have enough points']\n ], 422);\n }\n\n $history = new History;\n $history->customer_id = $customer->id;\n $history->campaign_id = $campaign->id;\n $history->staff_id = auth('staff')->user()->id;\n $history->staff_name = auth('staff')->user()->name;\n $history->staff_email = auth('staff')->user()->email;\n $history->reward_id = $reward->id;\n $history->reward_title = $reward->title;\n $history->points = -$reward->points_cost;\n $history->event = 'Redeemed with customer number';\n $history->created_by = $campaign->created_by;\n\n $history->save();\n\n // Segments\n if (is_array($segments) && count($segments) > 0) {\n $history->segments()->sync($segments);\n }\n\n // Increment reward redemptions\n $reward->increment('number_of_times_redeemed');\n\n return response()->json([\n 'status' => 'success'\n ], 200);\n }", "public function sendReward() {\n // loop all required fields\n foreach($this->required as $v) {\n // check if all required fields are set\n if(!isset($this->params[$v])) {\n // throw exception if a required field is not set\n throw new \\Exception('`' . $v . '` is required.');\n }\n }\n \n // prepare request payload\n $payload = array('outboundRewardRequest' => array(\n 'app_id' => $this->params['key'],\n 'app_secret' => $this->params['secret'],\n 'reward_token' => $this->params['token'],\n 'address' => $this->params['address'],\n 'promo' => $this->params['promo']));\n \n // request payload should be a json string\n $payload = json_encode($payload);\n \n // initialize custom curl\n $curl = new Curl();\n // prepare post request\n $curl->post(self::REWARD_URL, $payload);\n // set request json header\n $curl->setHeader(array('Content-type: application/json'));\n // return curl response\n return $curl->exec();\n }", "private function constructReward(Request $request)\n {\n $reward = [\n 'tenant_id' => $this->requester->getTenantId(),\n 'company_id' => $request->companyId,\n 'eff_begin' => $request->effBegin,\n 'eff_end' => $request->effEnd,\n 'code' => $request->code,\n 'name' => $request->name,\n 'description' => $request->description,\n 'lov_rwty' => $request->lovRwty\n ];\n return $reward;\n }", "public static function reward($id, $data = [])\n {\n\n\t global $_config;\n\n \t$launch_blocks = REWARD_SCHEME['launch']['blocks'];\n\t $launch_reward = REWARD_SCHEME['launch']['reward'];\n\t $base_reward = BASE_REWARD;\n\n \t$mining_segments = REWARD_SCHEME['mining']['segments'];\n \t$mining_segment_block = REWARD_SCHEME['mining']['block_per_segment'];\n \t$mining_decrease_per_segment = $base_reward;\n\n \t$combined_segmnets = REWARD_SCHEME['combined']['segments'];\n \t$combined_segment_block = REWARD_SCHEME['combined']['block_per_segment'];\n \t$combined_decrease_per_segment = BASE_REWARD / $combined_segmnets;\n\n \t$deflation_segments = REWARD_SCHEME['deflation']['segments'];\n \t$deflation_segment_block = REWARD_SCHEME['deflation']['block_per_segment'];\n \t$deflation_decrease_per_segment = BASE_REWARD / $deflation_segments;\n\n \t$mining_end_block = ($mining_segments * $mining_segment_block) + $launch_blocks;\n \t$combined_end_block = ($combined_segmnets * $combined_segment_block) + $mining_end_block;\n \t$deflation_end_block = ($deflation_segments * $deflation_segment_block) + $combined_end_block;\n\n\t $total = 0;\n\t $miner = 0;\n\t $mn_reward = 0;\n\t $generator = 0;\n\t $pos_reward = 0;\n\t if($id == 1) {\n\t \t//genesis\n\t\t $total = GENESIS_REWARD;\n\t\t $miner = $total;\n\t\t $mn_reward = 0;\n\t\t $generator = 0;\n\t\t $pos_reward = 0;\n\t } else if ($id <= $launch_blocks ) {\n\t\t\t//launch from 1\n\t\t $total = $launch_reward;\n\t\t $miner = $total * 0.9;\n\t\t $generator = $total * 0.1;\n\t\t $mn_reward = 0;\n\t\t $pos_reward = 0;\n\t } else if ($id <= $mining_end_block) {\n\t\t //mining from 210000\n\t\t $total = ($mining_segments - floor(($id -1 - $launch_blocks) / $mining_segment_block)) * $mining_decrease_per_segment;\n\t\t $miner = $total * 0.9;\n\t\t $generator = $total * 0.1;\n\t\t $mn_reward = 0;\n\t\t $pos_reward = 0;\n\t } else if ($id <= $combined_end_block) {\n\t\t\t// combined\n\t\t $total = $base_reward;\n\t\t $miner_reward = ($combined_segmnets - 1 - floor(($id - 1 - $mining_end_block) / $combined_segment_block)) * $combined_decrease_per_segment;\n\t\t $remain_reward = $base_reward - $miner_reward;\n\t\t $miner = $miner_reward * 0.9;\n\t\t $generator = $miner_reward * 0.1;\n\t\t $pos_ratio = 0.2;\n\t\t $pos_reward = $pos_ratio * $remain_reward;\n\t\t $mn_reward = $remain_reward - $pos_reward;\n\t\t if($miner == 0 && $_config['testnet']) {\n\t\t\t $total = 1;\n\t\t\t $miner = 0.9;\n\t\t\t $generator = 0.1;\n\t\t\t $mn_reward = 0;\n\t\t\t $pos_reward = 0;\n\t\t }\n\t } else if ($id <= $deflation_end_block) {\n\t \t//deflation\n\t\t $total = ($deflation_segments - 1 - floor(($id -1 - $combined_end_block) / $deflation_segment_block))*$deflation_decrease_per_segment;\n\t\t $pos_ratio = 0.2;\n\t\t $pos_reward = $pos_ratio * $total;\n\t\t $mn_reward = $total - $pos_reward;\n\t\t $miner = 0;\n\t\t $generator = 0;\n\t\t if($miner == 0 && $_config['testnet']) {\n\t\t\t $total = 1;\n\t\t\t $miner = 0.9;\n\t\t\t $generator = 0.1;\n\t\t\t $mn_reward = 0;\n\t\t\t $pos_reward = 0;\n\t\t }\n\t } else {\n\t\t $total = 0;\n\t\t $miner = 0;\n\t\t $mn_reward = 0;\n\t\t $pos_reward = 0;\n\t\t $generator = 0;\n\t\t if($miner == 0 && $_config['testnet']) {\n\t\t\t $total = 1;\n\t\t\t $miner = 0.9;\n\t\t\t $generator = 0.1;\n\t\t\t $mn_reward = 0;\n\t\t\t $pos_reward = 0;\n\t\t }\n\t }\n\t $out = [\n\t \t'total'=>$total,\n\t\t 'miner'=>$miner,\n\t\t 'generator'=>$generator,\n\t\t 'masternode'=>$mn_reward,\n\t\t 'pos'=>$pos_reward,\n\t\t 'key'=>\"$total-$miner-$generator-$mn_reward-$pos_reward\"\n\t ];\n //_log(\"Reward \", json_encode($out));\n\t return $out;\n }", "public function newCampaignReward($post){\n\t\t$account_id = $this->account_id;\n\t\t$api_key = $this->api_key;\n\t\t$user_id = $this->user_id;\n\t\t\n\t\tif(empty($post['campaign_id'])){\n \t\tthrow new Exception('campaign_id field is Required');\n\t } elseif(empty($post['reward_level'])){\n \t\tthrow new Exception('reward_level field is Required');\n\t } elseif(empty($post['reward_description'])){\n \t\tthrow new Exception('reward_description field is Required');\n\t }\t\n\t\t\n\t\t$fields = array(\n\t\t\t'user_id'\t\t\t=> $user_id,\n\t\t\t'user_password'\t\t=> $api_key,\n\t\t\t'account_id'\t\t=> $account_id,\n\t\t\t'action'\t\t\t=> 'reward',\n\t\t\t'type'\t\t\t\t=> 'campaign_new',\n\t\t\t'campaign_id'\t\t=> $post['campaign_id'],\n\t\t\t'reward_level'\t\t=> $post['reward_level'],\n\t\t\t'reward_description'=> $post['reward_description']\n\t\t);\n\t\tif(!empty($post['reward_identifier'])) $fields['reward_identifier'] = $post['reward_identifier'];\n\t\treturn $this->sendData($fields);\n\t}", "private function constructReward(Request $request)\n {\n $personReward = [\n 'tenant_id' => $this->requester->getTenantId(),\n 'company_id' => $request->companyId,\n 'person_id' => $request->personId,\n 'reward_code' => $request->rewardCode,\n 'eff_begin' => $request->effBegin,\n 'eff_end' => $request->effEnd,\n 'description' => $request->description\n ];\n return $personReward;\n }", "public function getBlockReward();", "public function prepareFromReward()\n {\n $store = $this->getReward()->getStore();\n if ($store === null) {\n $store = $this->_storeManager->getStore();\n }\n $this->setRewardId(\n $this->getReward()->getId()\n )->setWebsiteId(\n $this->getReward()->getWebsiteId()\n )->setStoreId(\n $store->getId()\n )->setPointsBalance(\n $this->getReward()->getPointsBalance()\n )->setPointsDelta(\n $this->getReward()->getPointsDelta()\n )->setCurrencyAmount(\n $this->getReward()->getCurrencyAmount()\n )->setCurrencyDelta(\n $this->getReward()->getCurrencyDelta()\n )->setAction(\n $this->getReward()->getAction()\n )->setComment(\n $this->getReward()->getComment()\n );\n\n $this->addAdditionalData(\n [\n 'rate' => [\n 'points' => $this->getReward()->getRate()->getPoints(),\n 'currency_amount' => $this->getReward()->getRate()->getCurrencyAmount(),\n 'direction' => $this->getReward()->getRate()->getDirection(),\n 'currency_code' => $this->_storeManager->getWebsite(\n $this->getReward()->getWebsiteId()\n )->getBaseCurrencyCode(),\n ],\n ]\n );\n\n if ($this->getReward()->getIsCappedReward()) {\n $this->addAdditionalData(\n ['is_capped_reward' => true, 'cropped_points' => $this->getReward()->getCroppedPoints()]\n );\n }\n return $this;\n }", "public static function rewards()\n {\n global $json_api;\n try {\n $reward_listing = new RewardListing($json_api->query);\n api_handler::outSuccessDataWeSoft($reward_listing->getResultArr());\n } catch (Exception $e) {\n api_handler::outFail($e->getCode(), $e->getMessage());\n }\n }", "function earnRewards($gName, $gUserName, $rewardName, $rewardPoints) {\n\n Util::throwExceptionIfNullOrBlank($gName, \"Game Name\");\n Util::throwExceptionIfNullOrBlank($gUserName, \"User Name\");\n Util::throwExceptionIfNullOrBlank($rewardName, \"Reward Name\");\n Util::throwExceptionIfNullOrBlank($rewardPoints, \"Reward Point\");\n\n\n $objUtil = new Util($this->apiKey, $this->secretKey);\n\n try {\n\t\t $params = null;\n $headerParams = array();\n $queryParams = array();\n $signParams = $this->populateSignParams();\n $metaHeaders = $this->populateMetaHeaderParams();\n $headerParams = array_merge($signParams, $metaHeaders);\n $body = null;\n $body = '{\"app42\":{\"rewards\":{\"reward\":{\"gameName\":\"' . $gName . '\",\"userName\":\"' . $gUserName . '\",\"name\":\"' . $rewardName . '\",\"points\":\"' . $rewardPoints . '\"}}}}';\n $signParams['body'] = $body;\n $signature = urlencode($objUtil->sign($signParams)); //die();\n $headerParams['signature'] = $signature;\n $contentType = $this->content_type;\n $accept = $this->accept;\n $baseURL = $this->url;\n $baseURL = $baseURL . \"/earn\";\n $response = RestClient::post($baseURL, $params, null, null, $contentType, $accept, $body,$headerParams);\n $rewardResponseObj = new RewardResponseBuilder();\n $rewardObj = $rewardResponseObj->buildResponse($response->getResponse());\n } catch (App42Exception $e) {\n throw $e;\n } catch (Exception $e) {\n throw new App42Exception($e);\n }\n return $rewardObj;\n }", "public function add_reward(array $data)\n\t{\n\t\t$reward = new Model_Photo_Contest_Reward;\n\t\t$reward->set_fields($data);\n\t\t$reward->photo_contest_id = $this->id;\n\t\t$reward->save();\n\n\t\treturn $reward;\n\t}", "public function enableRewardAction()\n {\n if (!Mage::helper('rewardpoints')->isEnable(Mage::helper('rewardpoints/customer')->getStoreId())) {\n $result['status'] = \"success\";\n $result['code'] = 100;\n $result['message'] = \"rewards point is disable.\";\n echo Mage::helper('core')->jsonEncode($result);\n exit();\n }\n if ($this->getQuote()->getBaseGrandTotal() < 0.0001\n && !$this->getCalculation()->getTotalRulePoint()\n ) {\n $result['status'] = \"success\";\n $result['code'] = 100;\n $result['message'] = \"rewards point is disable.\";\n echo Mage::helper('core')->jsonEncode($result);\n exit();\n }\n if (!Mage::helper('rewardpoints/customer')->isAllowSpend($this->getQuote()->getStoreId())) {\n $result['status'] = \"success\";\n $result['code'] = 100;\n $result['message'] = \"rewards point is disable.\";\n echo Mage::helper('core')->jsonEncode($result);\n exit();\n }\n $result['status'] = \"success\";\n $result['code'] = 200;\n $result['message'] = \"rewards point is enable.\";\n\n echo Mage::helper('core')->jsonEncode($result);\n }", "public static function reward($params)\n {\n if (empty($params['user']) || empty($params['object']))\n throw new InvalidArgumentException('Invalid Parameters');\n\n $params['message'] = Lang::get('dma.friends::lang.log.reward', [\n 'name' => $params['user']->name, \n 'title' => $params['object']->title\n ]); \n\n self::write('reward', $params);\n }", "public function add_reward($reward_cost,$reward_source_id,$reward_img,$reward_name,$reward_description,$reward_payout,$reward_region,$reward_status=1,$reward_expiration,$reward_weight=0,$reward_limit=0)\n {\n\n $db_columns = array(\n 'reward_cost'=>intval($reward_cost),\n 'reward_source_id'=>$reward_source_id,\n 'reward_name'=>$reward_name,\n 'reward_description'=>$reward_description,\n 'reward_payout'=>floatval($reward_payout),\n 'reward_region'=>$reward_region,\n 'reward_status'=>$reward_status,\n 'reward_img'=>$reward_img,\n 'reward_weight'=>$reward_weight,\n 'reward_limit'=>$reward_limit,\n 'reward_expiration'=>$reward_expiration,\n 'reward_tcreate'=>time(),\n 'reward_tmodified'=>time()\n );\n $result = $this->db_create(self::REWARD_SYS_TABLE_NAME,$db_columns);\n return $result;\n }", "public function rewardDetailsAction() {\n\n $this->_helper->layout->setLayout('admin-simple');\n\n $viewer = Engine_Api::_()->user()->getViewer();\n $viewerIdentity = $viewer->getIdentity();\n if (empty($viewerIdentity)) {\n return;\n }\n\n $project_id = $this->_getParam('project_id');\n $this->view->reward_id = $reward_id = $this->_getParam('reward_id');\n\n $this->view->project = $project = Engine_Api::_()->getItem('sitecrowdfunding_project', $project_id);\n $this->view->projectOwner = Engine_Api::_()->getItem('user', $project->owner_id);\n\n $reward = $this->view->reward = Engine_Api::_()->getItem('sitecrowdfunding_reward', $reward_id);\n $this->view->selectedRewardCount = $reward->spendRewardQuantity();\n $this->view->dispatchedRewardQuantity = $reward->spendRewardQuantity(true);\n }", "public function reward(Model_User $user)\n\t{\n\t\t$user->set_property('points', $user->get_property('points') + $this->_reward);\n\t}", "static public function addRewardUser()\n {\n register_rest_route(self::ROUTE_NAME, '/addrewarduser', [\n 'methods' => 'POST',\n 'callback' => function (WP_REST_Request $request) {\n $current_user = wp_get_current_user();\n $userid = $current_user->data->ID;\n $rewardid = $request->get_param(\"rewardid\");\n\n if ($userid === null || $rewardid === null) {\n return new WP_Error('400', 'error');\n } else {\n Database::addRewardByUser($userid, $rewardid);\n $response = new WP_REST_Response('reward added');\n return $response;\n }\n }\n ]);\n }", "public function __mlmCanRewardByBasic();" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Operation restStockmanagementWarehousesWarehouseIdStockBookOutgoingItemsPutAsyncWithHttpInfo Book outgoing stock
public function restStockmanagementWarehousesWarehouseIdStockBookOutgoingItemsPutAsyncWithHttpInfo($warehouse_id, $_rest_stockmanagement_warehouses_warehouse_id_stock_book_outgoing_items = null) { $returnType = ''; $request = $this->restStockmanagementWarehousesWarehouseIdStockBookOutgoingItemsPutRequest($warehouse_id, $_rest_stockmanagement_warehouses_warehouse_id_stock_book_outgoing_items); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { return [null, $response->getStatusCode(), $response->getHeaders()]; }, function ($exception) { $response = $exception->getResponse(); $statusCode = $response->getStatusCode(); throw new ApiException( sprintf( '[%d] Error connecting to the API (%s)', $statusCode, $exception->getRequest()->getUri() ), $statusCode, $response->getHeaders(), $response->getBody() ); } ); }
[ "public function restStockmanagementWarehousesWarehouseIdStockBookOutgoingItemsPut($warehouse_id, $_rest_stockmanagement_warehouses_warehouse_id_stock_book_outgoing_items = null)\n {\n $this->restStockmanagementWarehousesWarehouseIdStockBookOutgoingItemsPutWithHttpInfo($warehouse_id, $_rest_stockmanagement_warehouses_warehouse_id_stock_book_outgoing_items);\n }", "public function ordersV2PutAsyncWithHttpInfo($id2, $amount, $customer_id, $currency_code, $created_utc, $vat_amount, $roundings_amount, $delivered_amount, $delivered_vat_amount, $delivered_roundings_amount, $delivery_customer_name, $delivery_address1, $delivery_address2, $delivery_postal_code, $delivery_city, $delivery_country_code, $your_reference, $our_reference, $invoice_address1, $invoice_address2, $invoice_city, $invoice_country_code, $invoice_customer_name, $invoice_postal_code, $delivery_method_name, $delivery_method_code, $delivery_term_name, $delivery_term_code, $eu_third_party, $customer_is_private_person, $order_date, $status, $number, $modified_utc, $delivery_date, $house_work_amount, $house_work_automatic_distribution, $house_work_corporate_identity_number, $house_work_property_name, $rows, $shipped_date_time, $rot_reduced_invoicing_type, $rot_property_type, $persons, $reverse_charge_on_construction_services, $uses_green_technology, $id)\n {\n $returnType = 'object';\n $request = $this->ordersV2PutRequest($id2, $amount, $customer_id, $currency_code, $created_utc, $vat_amount, $roundings_amount, $delivered_amount, $delivered_vat_amount, $delivered_roundings_amount, $delivery_customer_name, $delivery_address1, $delivery_address2, $delivery_postal_code, $delivery_city, $delivery_country_code, $your_reference, $our_reference, $invoice_address1, $invoice_address2, $invoice_city, $invoice_country_code, $invoice_customer_name, $invoice_postal_code, $delivery_method_name, $delivery_method_code, $delivery_term_name, $delivery_term_code, $eu_third_party, $customer_is_private_person, $order_date, $status, $number, $modified_utc, $delivery_date, $house_work_amount, $house_work_automatic_distribution, $house_work_corporate_identity_number, $house_work_property_name, $rows, $shipped_date_time, $rot_reduced_invoicing_type, $rot_property_type, $persons, $reverse_charge_on_construction_services, $uses_green_technology, $id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }", "public function quotesV2PutAsyncWithHttpInfo($id2, $number, $customer_id, $due_date, $quote_date, $created_utc, $approved_date, $currency_code, $status, $currency_rate, $company_reference, $eu_third_party, $customer_reference, $invoice_customer_name, $invoice_address1, $invoice_address2, $invoice_postal_code, $invoice_city, $invoice_country_code, $delivery_customer_name, $delivery_address1, $delivery_address2, $delivery_postal_code, $delivery_city, $delivery_country_code, $delivery_method_name, $delivery_method_code, $delivery_term_code, $delivery_term_name, $customer_is_private_person, $includes_vat, $is_domestic, $rot_reduced_invoicing_type, $rot_property_type, $rot_reduced_invoicing_property_name, $rot_reduced_invoicing_org_number, $rot_reduced_invoicing_amount, $rot_reduced_invoicing_automatic_distribution, $persons, $terms_of_payment, $sales_document_attachments, $rows, $total_amount, $vat_amount, $roundings_amount, $uses_green_technology, $id)\n {\n $returnType = 'object';\n $request = $this->quotesV2PutRequest($id2, $number, $customer_id, $due_date, $quote_date, $created_utc, $approved_date, $currency_code, $status, $currency_rate, $company_reference, $eu_third_party, $customer_reference, $invoice_customer_name, $invoice_address1, $invoice_address2, $invoice_postal_code, $invoice_city, $invoice_country_code, $delivery_customer_name, $delivery_address1, $delivery_address2, $delivery_postal_code, $delivery_city, $delivery_country_code, $delivery_method_name, $delivery_method_code, $delivery_term_code, $delivery_term_name, $customer_is_private_person, $includes_vat, $is_domestic, $rot_reduced_invoicing_type, $rot_property_type, $rot_reduced_invoicing_property_name, $rot_reduced_invoicing_org_number, $rot_reduced_invoicing_amount, $rot_reduced_invoicing_automatic_distribution, $persons, $terms_of_payment, $sales_document_attachments, $rows, $total_amount, $vat_amount, $roundings_amount, $uses_green_technology, $id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }", "public function restShopBuilderContentsPutAsyncWithHttpInfo()\n {\n $returnType = 'object';\n $request = $this->restShopBuilderContentsPutRequest();\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 quoteDraftsV2PutAsyncWithHttpInfo($id2, $number, $customer_id, $due_date, $quote_date, $created_utc, $approved_date, $currency_code, $status, $currency_rate, $company_reference, $eu_third_party, $customer_reference, $invoice_customer_name, $invoice_address1, $invoice_address2, $invoice_postal_code, $invoice_city, $invoice_country_code, $delivery_customer_name, $delivery_address1, $delivery_address2, $delivery_postal_code, $delivery_city, $delivery_country_code, $delivery_method_name, $delivery_method_code, $delivery_term_code, $delivery_term_name, $customer_is_private_person, $includes_vat, $is_domestic, $rot_reduced_invoicing_type, $rot_property_type, $rot_reduced_invoicing_property_name, $rot_reduced_invoicing_org_number, $rot_reduced_invoicing_amount, $rot_reduced_invoicing_automatic_distribution, $persons, $terms_of_payment, $sales_document_attachments, $rows, $total_amount, $vat_amount, $roundings_amount, $uses_green_technology, $id)\n {\n $returnType = 'object';\n $request = $this->quoteDraftsV2PutRequest($id2, $number, $customer_id, $due_date, $quote_date, $created_utc, $approved_date, $currency_code, $status, $currency_rate, $company_reference, $eu_third_party, $customer_reference, $invoice_customer_name, $invoice_address1, $invoice_address2, $invoice_postal_code, $invoice_city, $invoice_country_code, $delivery_customer_name, $delivery_address1, $delivery_address2, $delivery_postal_code, $delivery_city, $delivery_country_code, $delivery_method_name, $delivery_method_code, $delivery_term_code, $delivery_term_name, $customer_is_private_person, $includes_vat, $is_domestic, $rot_reduced_invoicing_type, $rot_property_type, $rot_reduced_invoicing_property_name, $rot_reduced_invoicing_org_number, $rot_reduced_invoicing_amount, $rot_reduced_invoicing_automatic_distribution, $persons, $terms_of_payment, $sales_document_attachments, $rows, $total_amount, $vat_amount, $roundings_amount, $uses_green_technology, $id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }", "public function warehouseTransferOutPOSTRequestPostAsyncWithHttpInfo($accept, $jiwa_stateful = null, $destination_warehouse_id = null, $last_saved_date_time = null, $transfer_date = null, $activated_date = null, $status = null, $created_by_staff_id = null, $created_by_staff_user_name = null, $created_by_staff_title = null, $created_by_staff_first_name = null, $created_by_staff_surname = null, $source = null, $source_type = null, $source_id = null, $source_no = null, $notes = null, $source_warehouse_id = null, $source_warehouse_logical_description = null, $source_warehouse_physical_description = null, $source_warehouse_mask = null, $destination_warehouse_logical_description = null, $destination_warehouse_physical_description = null, $destination_warehouse_mask = null, $transfer_no = null, $use_in_transit = null, $transit_notes = null, $in_transit_warehouse_id = null, $in_transit_warehouse_logical_description = null, $in_transit_warehouse_physical_description = null, $in_transit_warehouse_mask = null, $added_cost1 = null, $added_cost2 = null, $added_cost3 = null, $picked_by_staff_id = null, $picked_by_staff_user_name = null, $picked_by_staff_title = null, $picked_by_staff_first_name = null, $picked_by_staff_surname = null, $added_cost_method_name = null, $transferred_cost = null, $total_cost = null, $receive_ins = null, $lines = null, $body = null)\n {\n $returnType = '\\Jiwa\\Model\\WarehouseTransferOut';\n $request = $this->warehouseTransferOutPOSTRequestPostRequest($accept, $jiwa_stateful, $destination_warehouse_id, $last_saved_date_time, $transfer_date, $activated_date, $status, $created_by_staff_id, $created_by_staff_user_name, $created_by_staff_title, $created_by_staff_first_name, $created_by_staff_surname, $source, $source_type, $source_id, $source_no, $notes, $source_warehouse_id, $source_warehouse_logical_description, $source_warehouse_physical_description, $source_warehouse_mask, $destination_warehouse_logical_description, $destination_warehouse_physical_description, $destination_warehouse_mask, $transfer_no, $use_in_transit, $transit_notes, $in_transit_warehouse_id, $in_transit_warehouse_logical_description, $in_transit_warehouse_physical_description, $in_transit_warehouse_mask, $added_cost1, $added_cost2, $added_cost3, $picked_by_staff_id, $picked_by_staff_user_name, $picked_by_staff_title, $picked_by_staff_first_name, $picked_by_staff_surname, $added_cost_method_name, $transferred_cost, $total_cost, $receive_ins, $lines, $body);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }", "public function quoteDraftsV2PutWithHttpInfo($id2, $number, $customer_id, $due_date, $quote_date, $created_utc, $approved_date, $currency_code, $status, $currency_rate, $company_reference, $eu_third_party, $customer_reference, $invoice_customer_name, $invoice_address1, $invoice_address2, $invoice_postal_code, $invoice_city, $invoice_country_code, $delivery_customer_name, $delivery_address1, $delivery_address2, $delivery_postal_code, $delivery_city, $delivery_country_code, $delivery_method_name, $delivery_method_code, $delivery_term_code, $delivery_term_name, $customer_is_private_person, $includes_vat, $is_domestic, $rot_reduced_invoicing_type, $rot_property_type, $rot_reduced_invoicing_property_name, $rot_reduced_invoicing_org_number, $rot_reduced_invoicing_amount, $rot_reduced_invoicing_automatic_distribution, $persons, $terms_of_payment, $sales_document_attachments, $rows, $total_amount, $vat_amount, $roundings_amount, $uses_green_technology, $id)\n {\n $returnType = 'object';\n $request = $this->quoteDraftsV2PutRequest($id2, $number, $customer_id, $due_date, $quote_date, $created_utc, $approved_date, $currency_code, $status, $currency_rate, $company_reference, $eu_third_party, $customer_reference, $invoice_customer_name, $invoice_address1, $invoice_address2, $invoice_postal_code, $invoice_city, $invoice_country_code, $delivery_customer_name, $delivery_address1, $delivery_address2, $delivery_postal_code, $delivery_city, $delivery_country_code, $delivery_method_name, $delivery_method_code, $delivery_term_code, $delivery_term_name, $customer_is_private_person, $includes_vat, $is_domestic, $rot_reduced_invoicing_type, $rot_property_type, $rot_reduced_invoicing_property_name, $rot_reduced_invoicing_org_number, $rot_reduced_invoicing_amount, $rot_reduced_invoicing_automatic_distribution, $persons, $terms_of_payment, $sales_document_attachments, $rows, $total_amount, $vat_amount, $roundings_amount, $uses_green_technology, $id);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if (!in_array($returnType, ['string','integer','bool'])) {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n 'object',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }", "public function restStockmanagementWarehousesWarehouseIdStockBookIncomingItemsPutAsync($warehouse_id, $_rest_stockmanagement_warehouses_warehouse_id_stock_book_incoming_items = null)\n {\n return $this->restStockmanagementWarehousesWarehouseIdStockBookIncomingItemsPutAsyncWithHttpInfo($warehouse_id, $_rest_stockmanagement_warehouses_warehouse_id_stock_book_incoming_items)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }", "public function ordersV2PostAsyncWithHttpInfo($body)\n {\n $returnType = '\\Swagger\\Client\\Model\\OrderApi';\n $request = $this->ordersV2PostRequest($body);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }", "public function orderActionExecutePostAsyncWithHttpInfo($body)\n {\n $returnType = '\\AndyDune\\MgmtIntaxxApi\\Model\\Response';\n $request = $this->orderActionExecutePostRequest($body);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }", "public function restStockmanagementWarehousesWarehouseIdStockBookIncomingItemsPut($warehouse_id, $_rest_stockmanagement_warehouses_warehouse_id_stock_book_incoming_items = null)\n {\n $this->restStockmanagementWarehousesWarehouseIdStockBookIncomingItemsPutWithHttpInfo($warehouse_id, $_rest_stockmanagement_warehouses_warehouse_id_stock_book_incoming_items);\n }", "public function stockTransferPOSTRequestPostAsyncWithHttpInfo($accept, $jiwa_stateful = null, $transfer_no = null, $status = null, $transfer_date = null, $reference = null, $logical_warehouse_id = null, $logical_warehouse_description = null, $physical_warehouse_id = null, $physical_warehouse_description = null, $last_saved_by_staff_id = null, $last_saved_by_staff_user_name = null, $last_saved_by_staff_title = null, $last_saved_by_staff_first_name = null, $last_saved_by_staff_surname = null, $last_saved_date_time = null, $created_by_staff_id = null, $created_by_staff_user_name = null, $created_by_staff_title = null, $created_by_staff_first_name = null, $created_by_staff_surname = null, $created_date_time = null, $lines = null, $notes = null, $documents = null, $custom_field_values = null, $stock_transfer_reason_rec_id = null, $stock_transfer_reason_name = null, $stock_transfer_reason_is_default = null, $stock_transfer_reason_write_off_ledger_account_override = null, $stock_transfer_reason_write_off_ledger_account_rec_id = null, $stock_transfer_reason_write_off_ledger_account_no = null, $stock_transfer_reason_write_off_ledger_account_description = null, $stock_transfer_reason_write_on_ledger_account_override = null, $stock_transfer_reason_write_on_ledger_account_rec_id = null, $stock_transfer_reason_write_on_ledger_account_no = null, $stock_transfer_reason_write_on_ledger_account_description = null, $body = null)\n {\n $returnType = '\\Jiwa\\Model\\StockTransfer';\n $request = $this->stockTransferPOSTRequestPostRequest($accept, $jiwa_stateful, $transfer_no, $status, $transfer_date, $reference, $logical_warehouse_id, $logical_warehouse_description, $physical_warehouse_id, $physical_warehouse_description, $last_saved_by_staff_id, $last_saved_by_staff_user_name, $last_saved_by_staff_title, $last_saved_by_staff_first_name, $last_saved_by_staff_surname, $last_saved_date_time, $created_by_staff_id, $created_by_staff_user_name, $created_by_staff_title, $created_by_staff_first_name, $created_by_staff_surname, $created_date_time, $lines, $notes, $documents, $custom_field_values, $stock_transfer_reason_rec_id, $stock_transfer_reason_name, $stock_transfer_reason_is_default, $stock_transfer_reason_write_off_ledger_account_override, $stock_transfer_reason_write_off_ledger_account_rec_id, $stock_transfer_reason_write_off_ledger_account_no, $stock_transfer_reason_write_off_ledger_account_description, $stock_transfer_reason_write_on_ledger_account_override, $stock_transfer_reason_write_on_ledger_account_rec_id, $stock_transfer_reason_write_on_ledger_account_no, $stock_transfer_reason_write_on_ledger_account_description, $body);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }", "public function warehouseTransferOutPOSTRequestPostWithHttpInfo($accept, $jiwa_stateful = null, $destination_warehouse_id = null, $last_saved_date_time = null, $transfer_date = null, $activated_date = null, $status = null, $created_by_staff_id = null, $created_by_staff_user_name = null, $created_by_staff_title = null, $created_by_staff_first_name = null, $created_by_staff_surname = null, $source = null, $source_type = null, $source_id = null, $source_no = null, $notes = null, $source_warehouse_id = null, $source_warehouse_logical_description = null, $source_warehouse_physical_description = null, $source_warehouse_mask = null, $destination_warehouse_logical_description = null, $destination_warehouse_physical_description = null, $destination_warehouse_mask = null, $transfer_no = null, $use_in_transit = null, $transit_notes = null, $in_transit_warehouse_id = null, $in_transit_warehouse_logical_description = null, $in_transit_warehouse_physical_description = null, $in_transit_warehouse_mask = null, $added_cost1 = null, $added_cost2 = null, $added_cost3 = null, $picked_by_staff_id = null, $picked_by_staff_user_name = null, $picked_by_staff_title = null, $picked_by_staff_first_name = null, $picked_by_staff_surname = null, $added_cost_method_name = null, $transferred_cost = null, $total_cost = null, $receive_ins = null, $lines = null, $body = null)\n {\n $returnType = '\\Jiwa\\Model\\WarehouseTransferOut';\n $request = $this->warehouseTransferOutPOSTRequestPostRequest($accept, $jiwa_stateful, $destination_warehouse_id, $last_saved_date_time, $transfer_date, $activated_date, $status, $created_by_staff_id, $created_by_staff_user_name, $created_by_staff_title, $created_by_staff_first_name, $created_by_staff_surname, $source, $source_type, $source_id, $source_no, $notes, $source_warehouse_id, $source_warehouse_logical_description, $source_warehouse_physical_description, $source_warehouse_mask, $destination_warehouse_logical_description, $destination_warehouse_physical_description, $destination_warehouse_mask, $transfer_no, $use_in_transit, $transit_notes, $in_transit_warehouse_id, $in_transit_warehouse_logical_description, $in_transit_warehouse_physical_description, $in_transit_warehouse_mask, $added_cost1, $added_cost2, $added_cost3, $picked_by_staff_id, $picked_by_staff_user_name, $picked_by_staff_title, $picked_by_staff_first_name, $picked_by_staff_surname, $added_cost_method_name, $transferred_cost, $total_cost, $receive_ins, $lines, $body);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Jiwa\\Model\\WarehouseTransferOut',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 403:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Jiwa\\Model\\WarehouseTransferOut',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 201:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Jiwa\\Model\\WarehouseTransferOut',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 401:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Jiwa\\Model\\WarehouseTransferOut',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }", "public function apiTeamsWorkspacesOrdersItemsShipmentItemsGetSubresourceAsyncWithHttpInfo($id, $workspaces, $orders, $items, $id2 = null, $shipmentId = null, $shipmentId2 = null, $shipmentTrackingNumber = null, $orderItemId = null, $orderItemId2 = null, $orderId = null, $orderQty = null, $qty = null, $qty2 = null, $qtyBetween = null, $qtyGt = null, $qtyGte = null, $qtyLt = null, $qtyLte = null)\n {\n $returnType = '\\TrackMage\\Client\\Swagger\\Model\\ShipmentItemGetShipmentItem[]';\n $request = $this->apiTeamsWorkspacesOrdersItemsShipmentItemsGetSubresourceRequest($id, $workspaces, $orders, $items, $id2, $shipmentId, $shipmentId2, $shipmentTrackingNumber, $orderItemId, $orderItemId2, $orderId, $orderQty, $qty, $qty2, $qtyBetween, $qtyGt, $qtyGte, $qtyLt, $qtyLte);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n }\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 postBlockOutAsyncWithHttpInfo($block_out)\n {\n $returnType = '\\Piksel\\Kigo\\Model\\ResourceBookingMutationResponseErrorCodes';\n $request = $this->postBlockOutRequest($block_out);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n }\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 quotesV2PostAsyncWithHttpInfo($id, $number, $customer_id, $due_date, $quote_date, $created_utc, $approved_date, $currency_code, $status, $currency_rate, $company_reference, $eu_third_party, $customer_reference, $invoice_customer_name, $invoice_address1, $invoice_address2, $invoice_postal_code, $invoice_city, $invoice_country_code, $delivery_customer_name, $delivery_address1, $delivery_address2, $delivery_postal_code, $delivery_city, $delivery_country_code, $delivery_method_name, $delivery_method_code, $delivery_term_code, $delivery_term_name, $customer_is_private_person, $includes_vat, $is_domestic, $rot_reduced_invoicing_type, $rot_property_type, $rot_reduced_invoicing_property_name, $rot_reduced_invoicing_org_number, $rot_reduced_invoicing_amount, $rot_reduced_invoicing_automatic_distribution, $persons, $terms_of_payment, $sales_document_attachments, $rows, $total_amount, $vat_amount, $roundings_amount, $uses_green_technology)\n {\n $returnType = '\\Swagger\\Client\\Model\\QuoteApi';\n $request = $this->quotesV2PostRequest($id, $number, $customer_id, $due_date, $quote_date, $created_utc, $approved_date, $currency_code, $status, $currency_rate, $company_reference, $eu_third_party, $customer_reference, $invoice_customer_name, $invoice_address1, $invoice_address2, $invoice_postal_code, $invoice_city, $invoice_country_code, $delivery_customer_name, $delivery_address1, $delivery_address2, $delivery_postal_code, $delivery_city, $delivery_country_code, $delivery_method_name, $delivery_method_code, $delivery_term_code, $delivery_term_name, $customer_is_private_person, $includes_vat, $is_domestic, $rot_reduced_invoicing_type, $rot_property_type, $rot_reduced_invoicing_property_name, $rot_reduced_invoicing_org_number, $rot_reduced_invoicing_amount, $rot_reduced_invoicing_automatic_distribution, $persons, $terms_of_payment, $sales_document_attachments, $rows, $total_amount, $vat_amount, $roundings_amount, $uses_green_technology);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }", "public function bookingsPostBookingAsyncWithHttpInfo($data)\n {\n $returnType = '\\FomF\\Ungerboeck\\Client\\Model\\BookingsModel';\n $request = $this->bookingsPostBookingRequest($data);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }", "public function putOutboundWrapupcodemappingsAsyncWithHttpInfo($body)\n {\n $returnType = '\\PureCloudPlatform\\Client\\V2\\Model\\WrapUpCodeMapping';\n $request = $this->putOutboundWrapupcodemappingsRequest($body);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }", "public function articlesV2PostAsyncWithHttpInfo($id, $is_active, $number, $name, $name_english, $net_price, $gross_price, $coding_id, $coding_name, $unit_id, $unit_name, $unit_abbreviation, $stock_balance, $stock_balance_manually_changed_utc, $stock_balance_reserved, $stock_balance_available, $created_utc, $changed_utc, $house_work_type, $purchase_price, $purchase_price_manually_changed_utc, $send_to_webshop, $uses_moss, $article_labels, $is_stock, $stock_location_reference, $freight_costs, $freight_costs_manually_changed_utc, $update_stock_prices, $barcodes, $stock_value, $green_technology_type)\n {\n $returnType = '\\Swagger\\Client\\Model\\ArticleApi';\n $request = $this->articlesV2PostRequest($id, $is_active, $number, $name, $name_english, $net_price, $gross_price, $coding_id, $coding_name, $unit_id, $unit_name, $unit_abbreviation, $stock_balance, $stock_balance_manually_changed_utc, $stock_balance_reserved, $stock_balance_available, $created_utc, $changed_utc, $house_work_type, $purchase_price, $purchase_price_manually_changed_utc, $send_to_webshop, $uses_moss, $article_labels, $is_stock, $stock_location_reference, $freight_costs, $freight_costs_manually_changed_utc, $update_stock_prices, $barcodes, $stock_value, $green_technology_type);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Builds an SQL string to get all messages from the message_content table.
public static function get_stored_messages() { $m_sql_query_string = "SELECT number, receiver, time, bearer, ref, message "; $m_sql_query_string .= "FROM message_content "; return $m_sql_query_string; }
[ "public function getMessagesFromDB()\n {\n $query_string = \"SELECT retrievedmessages.retrievedmessageid, retrievedmessages.messagesentto, retrievedmessages.messagesentfrom, \";\n $query_string .= \"retrievedmessages.receivedtime, retrievedmessages.bearer, retrievedmessages.messageref , retrievedmessages.stateid, \";\n $query_string .= \"circuitboardstates.stateid, circuitboardstates.switch01state, circuitboardstates.switch02state, circuitboardstates.switch03state, circuitboardstates.switch04state, \";\n $query_string .= \"circuitboardstates.fanstate, circuitboardstates.heatertemperature, circuitboardstates.keypadvalue \";\n $query_string .= \"FROM retrievedmessages INNER JOIN circuitboardstates ON retrievedmessages.stateid = circuitboardstates.stateid\";\n\n return $query_string;\n }", "public static function select_messages_table() {\r\n $query_string = \"SELECT * FROM messages\";\r\n\r\n return $query_string;\r\n }", "function getAllMessages() {\n $query = \"SELECT *\n FROM \" . MSG_DB;\n \n $this->db->query($query);\n \n $this->db->debug();\n }", "function getAllMsg() {\n\t \t$sql=\"SELECT * FROM tbl_msg\";\n\t return $this->executeQuery($sql);\n\t }", "public function getAllMessages(){\n\t\treturn $this->query(\"SELECT * FROM %s WHERE chan=%s\");\n\t}", "public static function getMessageTable()\n {\n $schema = new Schema();\n\n $table = $schema->createTable('milio_message');\n $table->addColumn('id', 'integer', ['autoincrement' => true, 'unsigned' => true]);\n $table->addColumn('thread_id', 'guid', ['length' => 36]);\n $table->addColumn('message_id', 'guid', ['length' => 36]);\n $table->addColumn('sender', 'guid', ['length' => 36]);\n $table->addColumn('body', 'text');\n $table->addColumn('created_at', 'datetime');\n $table->setPrimaryKey(array('id'));\n $table->addUniqueIndex(array('message_id'));\n\n return $table;\n }", "public static function getSql(): string\n {\n $fields = [];\n foreach (static::getDceFieldMappings() as $fieldName => $fieldType) {\n $fields[] = $fieldName . ' ' . $fieldType;\n }\n if (!empty($fields)) {\n return 'CREATE TABLE tt_content (' . PHP_EOL . implode(',' . PHP_EOL, $fields) . PHP_EOL . ');';\n }\n\n return '';\n }", "function genEmailsQuery() {\n $select_query = \" SELECT *\";\n $select_query .= \" FROM emailman\";\n $select_query .= \" WHERE send_date_time <= \". db_convert(\"'\".gmdate('Y-m-d H:i:s').\"'\" ,\"datetime\");\n $select_query .= \" AND (in_queue ='0' OR ( in_queue ='1' AND in_queue_date <= \" .db_convert(\"'\". gmdate('Y-m-d H:i:s', strtotime(\"-1 day\")) .\"'\" ,\"datetime\").\"))\";\n if ($this->campaign_id)\n $select_query.=\" AND campaign_id = '{$this->campaign_id}'\";\n $select_query .= \" AND NOT deleted\";\n $select_query .= \" ORDER BY campaign_id, user_id, list_id\";\n\n return $select_query;\n }", "public function listar() {\n try {\n $query = \"select *\n from message m\";\n\n $stmt = $this->conn->prepare($query);\n $stmt->execute();\n return $stmt->fetchAll();\n\n } catch (Exception $e) {\n echo \"Erro ao listar as mensagens \\n\".$e->getMessage();\n }\n }", "protected function lookForContentSQL() {\n\t\t$hidePrivateItems = false;\n\t\tif ($this->setting('hide_private_items') == 1) {\n\t\t\t$hidePrivateItems = true;\n\t\t}\n\t\t\n\t\t$tableJoins = $this->lookForContentTableJoins();\n\t\tif ($this->setting('category_filters_dropdown') == 'show_content_with_matching_categories' && !$tableJoins) {\n\t\t\t$sql = false;\n\t\t} else {\n\t\t\t$sql =\n\t\t\t\tze\\content::sqlToSearchContentTable(\n\t\t\t\t\t$hidePrivateItems, $this->setting('only_show'), \n\t\t\t\t\t$tableJoins\n\t\t\t\t).\n\t\t\t\t$this->lookForContentWhere();\n\t\t}\n\t\treturn $sql;\n\t}", "private function generateQuery()\n\t{\n\n\t\t/*\n\t\tWARNING :\n\t\tMysql does not give any functionality to extract substrings in field \n\t\tselection section, for example there is not such a statement like \n\t\t\tselect (substring_with_regex(fieldX, regex) as fieldName\n\n\t\tBecause of this, the system cannot support field extraction too.\n\t\tUser have to tell an exact name of table column for each required fields.\n\t\t*/\n\n\t\t//select __FIELDNAMES__ From __COLLECTION_NAME__ where __FILTERS__\n\n\t\t\n\t\t$collectionName = $this->logConfig->collectionName;\n\t\t$fieldMapper = $this->logConfig->fieldMapper;\n\t\t$fields = $fieldMapper->toJson();\n\n\t\t$fieldNames = implode(', ', array_map(function($field){\n\t\t\treturn '`'.$field->fieldName.'`';\n\t\t}, $fields)); \n\n\n\t\t$filters = $this->filters;\n\t\t$filterParts = array();\n\n\t\tif ($filters['search'] != null)\n\t\t\t$filterParts[] = '`'.$fields['message']->fieldName.'` like \\'%'.$filters['search'] . '%\\'';\n\n\t\tif ($filters['level'] != null)\n\t\t\t$filterParts[] = '`'.$fields['level']->fieldName.'` like \\'%' . $filters['level'] .'%\\'';\n\n\t\tif ($filters['date']['greaterThan'] != null)\n\t\t\t$filterParts[] = '`'.$fields['date']->fieldName.'` > \\''. $filters['date']['greaterThan'] .'\\'';\n\n\t\tif ($filters['date']['lowerThan'] != null)\n\t\t\t$filterParts[] = '`'.$fields['date']->fieldName.'` > \\'' . $filters['date']['lowerThan'] . '\\'';\n\n\t\tif (count($filterParts) > 0)\n\t\t\t$filterSQL = \"where \" . implode(' and ', $filterParts);\n\t\telse\n\t\t\t$filterSQL = null;\n\n\n\t\t$sql = \"select $fieldNames from $collectionName $filterSQL limit $this->limit\";\n\n\t\treturn $sql;\n\t}", "private function _fetchMessages(){\n\t\t// only send one message per user... oldest message first\n\t\t$sql = \"SELECT\n\t\t\t\t`apns_messages`.`pid`,\n\t\t\t\t`apns_messages`.`message`,\n\t\t\t\t`apns_devices`.`devicetoken`,\n\t\t\t\t`apns_devices`.`development`\n\t\t\tFROM `apns_messages`\n\t\t\tLEFT JOIN `apns_devices` ON (`apns_devices`.`pid` = `apns_messages`.`fk_device` AND `apns_devices`.`clientid` = `apns_messages`.`clientid`)\n\t\t\tWHERE `apns_messages`.`status`='queued'\n\t\t\t\tAND `apns_messages`.`delivery` <= NOW()\n\t\t\t\tAND `apns_devices`.`status`='active'\n\t\t\tGROUP BY `apns_messages`.`fk_device`\n\t\t\tORDER BY `apns_messages`.`created` ASC\n\t\t\tLIMIT 100;\";\n\n\t\t$this->_iterateMessages($sql);\n\t}", "public function getAllMessagesList()\n {\n $select = $this ->_db->select()\n ->from('mailtemplates__messages', 'id')\n ->order('id');\n\n $messages = $this->_db->fetchCol($select);\n\n foreach ($messages as &$message) {\n $message = new Socnet_Mail_Message($message);\n }\n return $messages;\n }", "protected function buildSql()\n {\n $this->selectSQL = ''; // reset query string\n\n $this->appendSql(\"SELECT \" . $this->buildFieldsList() . \" FROM \" . $this->fromTable)\n ->appendSql(!empty($this->joinsString) ? \" \" . $this->joinsString : \"\")\n ->appendSql(\" WHERE \" . (!empty($this->whereString) ? \" \" . $this->whereString : \" 1\"))\n ->appendSql(!empty($this->groupbyString) ? \" GROUP BY \" . $this->groupbyString : \"\")\n ->appendSql(!empty($this->orderbyString) ? \" ORDER BY \" . $this->orderbyString : \"\")\n ->appendSql(!empty($this->limitString) ? \" \" . $this->limitString : \"\");\n }", "function generate_message_log($jid,$date = \"now()\")\n{\n $limit = $GLOBALS[\"limit\"];\n $tpl = $GLOBALS[\"tpl\"];\n $db = $GLOBALS[\"db\"];\n $page = $GLOBALS[\"page\"];\n $orderby = $GLOBALS[\"orderby\"];\n $search = $GLOBALS[\"search\"];\n\n $start = ($page - 1) * $limit;\n\n $date_condition = \"DATE_FORMAT( message_timestamp, '%Y%m%d' ) = DATE_FORMAT( $date , '%Y%m%d' ) \";\n\n if ($search)\n {\n $search_condition = \"AND ( (message_to LIKE '%$search%') OR (message_from LIKE '%$search%') OR (message_body LIKE '%$search%') OR (message_subject LIKE '%$search%'))\";\n }\n $sqlquery = \"SELECT message_from, message_to, message_type, message_subject, message_body, DATE_FORMAT(message_timestamp, '%e %b %Y, %l:%i %p') as date FROM message WHERE (message_from LIKE '%$jid%' OR message_to LIKE '%$jid%') AND $date_condition $search_condition ORDER BY $orderby LIMIT $start,$limit\";\n $queryresult = $db->query($sqlquery); \n\n if (DB::isError($queryresult))\n {\n generate_error('Database query error',$queryresult->getMessage(). \" [$sqlquery]\");\n }\n\n while ($queryrow = $queryresult->fetchRow())\n {\n $from = $queryrow[0]; \n $to = $queryrow[1];\n $type = $queryrow[2];\n $subject = $queryrow[3];\n $body = $queryrow[4];\n $timestamp = $queryrow[5];\n\t\t\n if (!$subject) $subject = \"[None]\";\n\t\t\n // for our purposes, only 3 types of messages. Blank \"type\" values indicate \"normal\" (default) messages\n if(($type <> \"chat\") && ($type <> \"groupchat\"))\n {\n $type = \"normal\";\n }\n\n switch ($type)\n {\n case \"chat\":\n $color_send = $GLOBALS[\"color_chat_1\"];\n $color_receive = $GLOBALS[\"color_chat_2\"];\n break;\n\n case \"groupchat\":\n $color_send = $GLOBALS[\"color_groupchat_1\"];\n $color_receive = $GLOBALS[\"color_groupchat_2\"];\n break;\n\n case \"normal\":\n $color_send = $GLOBALS[\"color_normal_1\"];\n $color_receive = $GLOBALS[\"color_normal_2\"];\n break;\n }\n\t\t\n\t\t\n $tpl->setCurrentBlock(\"message_log_table\");\n\n if (stristr($from,$jid))\n {\n $tpl->setVariable\n (array\n (\n \"OTHERPARTY\" => \"To: \". create_jid_link($to),\n \"ICON_IMAGE\" => \"images/message_$type.gif\",\n \"ICON_IMAGE_ALT\" => \"$type message\",\n \"DIRECTION_IMAGE\" => 'images/direction_to.gif',\n \"DIRECTION_IMAGE_ALT\" => \"FROM: $jid TO: $to\",\n \"BGCOLOR\" => $color_send\n )\n );\n }\n\n else\n {\n $tpl->setVariable\n (array\n (\n \"OTHERPARTY\" => 'From: '. create_jid_link($from),\n \"ICON_IMAGE\" => \"images/message_$type.gif\",\n \"ICON_IMAGE_ALT\" => \"$type message\",\n \"DIRECTION_IMAGE\" => 'images/direction_from.gif',\n \"DIRECTION_IMAGE_ALT\" => \"FROM: $from TO: $jid\",\n \"BGCOLOR\" => $color_receive\n )\n );\n }\n $tpl->setVariable\n (array\n (\n \"BODY\" => $body,\n \"SUBJECT\" => $subject,\n \"DATE\" => $timestamp\n )\n );\n\n $tpl->parse(\"message_log_table\");\n $result .= $tpl->get(\"message_log_table\");\n unset($tpl->blockdata[\"message_log_table\"]); // Wipe the template block clean so we can reuse it\n }\n\n return $result;\n}", "protected function buildQuery() {\n\t\treturn \"SELECT\t\t\".$this->sqlSelects.\"\n\t\t\t\t\tstory.*\n\t\t\tFROM \t\tsls\".SLS_N.\"_story story\n\t\t\t\".$this->sqlJoins.\"\n\t\t\tWHERE\t\tstory.storyID IN (\".$this->storyIDs.\")\n\t\t\tORDER BY\t\".$this->sqlOrderBy;\n\t}", "function __getCPChatMessages()\r\n\t{\r\n\t\t//---------------------------------------\r\n\t\t//\tInit\r\n\t\t//---------------------------------------\r\n\t\r\n\t\t$messages\t\t= array();\r\n\t\t$this->pearRegistry->db->query(\"SELECT c.*, u.member_name FROM pear_admin_chat c, pear_members u WHERE c.member_id = u.member_id ORDER BY c.message_id DESC\");\r\n\t\r\n\t\t//---------------------------------------\r\n\t\t//\tBuild...\r\n\t\t//---------------------------------------\r\n\t\twhile( ($message = $this->pearRegistry->db->fetchRow()) !== FALSE )\r\n\t\t{\r\n\t\t\t//---------------------------------------\r\n\t\t\t//\tFormat data\r\n\t\t\t//---------------------------------------\r\n\t\r\n\t\t\t$message['message_added_time']\t\t=\t$this->pearRegistry->getDate($message['message_added_time']);\r\n\t\r\n\t\t\t//---------------------------------------\r\n\t\t\t//\tFilter the post content\r\n\t\t\t//---------------------------------------\r\n\t\r\n\t\t\t$messages[] = $message;\r\n\t\t}\r\n\t\r\n\t\treturn $messages;\r\n\t}", "public function fetchAll()\n {\n return $this->messageRepository->findAll();\n }", "function getMessages($where, $value = array(), $order = NULL, $limit = NULL){\n\t\tglobal $con;\n\t\t$limit = $limit != NULL ? ' LIMIT ' \t. $limit : '';\n\t\t$order = $order != NULL ? ' ORDER BY ' \t. $order : '';\n\n\t\t$stmt = $con->prepare('\n\t\t\t\t\tSELECT users.FullName, users.image, messages.sender_id, messages.reciever_read, messages.id\n\t\t\t\t\tFROM users\n\t\t\t\t\tINNER JOIN messages\n\t\t\t\t\tON users.id = messages.sender_id\n\t\t\t\t\t\n\t\t\t\t\tWHERE ' . $where . ' ' . $order . $limit\n\t\t\t\t);\n\t\t$stmt->execute($value);\n\t\treturn $stmt->fetchAll();\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get all of the asset sizes that are assigned this design.
public function assetSizes() { return $this->morphedByMany(MorphType::AssetSize, 'designable'); }
[ "public function getAssetSizes()\n\t{\n\t\t$this->_loadAssetSizes();\n\n\t\treturn $this->_assetSizes;\n\t}", "public function allSizes()\n {\n return $this->sizes;\n }", "public function getSizes()\n\t{\n\t\treturn $this->sizes;\n\t}", "public static function getSizes()\n\t{\n\t\treturn self::$_sizes;\n\t}", "public function getSizes() {\n if (is_null($this->_sizes) && $this->getCurrent()) {\n $rows = $this->getCurrent()\n ->findDependentRowset('Yourdelivery_Model_DbTable_Meal_SizesNn');\n $result = array();\n foreach ($rows as $size) {\n $mealParent = $size->findParentRow('Yourdelivery_Model_DbTable_Meal_Sizes');\n if ($mealParent) {\n $result[$mealParent->id] = array_merge(\n $mealParent->toArray(),\n //append some more informations about product\n array(\n 'cost' => $rows->current()->cost,\n 'pfand' => $rows->current()->pfand,\n 'mealId' => $rows->current()->mealId\n )\n );\n }\n }\n $this->_sizes = $result;\n }\n return $this->_sizes;\n }", "public static function getSizes()\n {\n $db = DataBase::connect();\n\n $sortOrder = SIZE_SORT_ORDER ? \"ASC\" : \"DESC\" ;\n $result = $db->query(\"SELECT * FROM `size` ORDER BY `id` {$sortOrder}\");\n\n $sizes = [];\n\n $i = 1;\n\n while($row = $result->fetch()) {\n $sizes[$i]['size'] = $row['size'];\n $sizes[$i]['leonardo_prices'] = $row['leonardo_prices'];\n $sizes[$i]['frodo_prices'] = $row['frodo_prices'];\n $sizes[$i]['back_leg'] = $row['back_leg'];\n $sizes[$i]['image_size'] = $row['image_size'];\n\n $i++;\n }\n return $sizes;\n }", "public function getSizes()\n\t{\n\t\tif (is_null($this->getCakeId()))\n\t\t\tthrow new Exception('Cake Id not set');\n\t\t\t\n\t\treturn $this->_db->fetchPairs('SELECT `cake_sizes`.`size`, `cake_sizes`.`size` FROM `cake_prices` JOIN `cake_sizes` USING (`size_id`) WHERE `cake_id` = ?', $this->getCakeId());\n\t}", "public function getSizes()\n\t{\n\n\t\t$strOptionsArray = array();\n\n\t\tforeach ($this->products as $objProduct) {\n\t\t\t$strSize = $objProduct->product_size;\n\n\t\t\tif (!empty($strSize) &&\n\t\t\t\t!in_array($strSize, $strOptionsArray) &&\n\t\t\t\t$objProduct->IsDisplayable\n\t\t\t)\n\t\t\t\t$strOptionsArray[$strSize] = $strSize;\n\n\t\t}\n\n\t\treturn $strOptionsArray;\n\t}", "public function getImageSizeList()\r\n\t{\r\n\t\t$arrSizes = System::getImageSizes();\r\n\t\t$arrSizes['image_sizes'] = array_intersect_key($arrSizes['image_sizes'], array_flip(deserialize($this->sizeList)));\r\n\t\t\r\n\t\tif ($this->canEnterSize)\r\n\t\t{\r\n\t\t\treturn $arrSizes;\r\n\t\t}\r\n\t\treturn $arrSizes['image_sizes'];\r\n\t}", "private function getResponsiveSizes()\n {\n if (empty($this->responsiveSizes)) {\n if(!empty($this->s->get(\"responsive_sizes\"))) {\n //fetch from settings\n $this->responsiveSizes = array_map(\n function ($el) {\n if (empty($el)) {\n return null;\n }\n\n return (int)trim($el);\n },\n explode(\",\", $this->s->get(\"responsive_sizes\"))\n );\n //limit max size to settings\n $this->responsiveSizes = array_filter($this->responsiveSizes, function($el){\n if(!empty($el) && (empty($this->getMaxWidth()) || $this->getMaxWidth() >= $el)) {\n return true;\n }\n });\n } else {\n $this->responsiveSizes = array();\n }\n }\n return $this->responsiveSizes;\n }", "public function getSizes()\r\n {\r\n $sizes = array();\r\n foreach ($this as $bs) {\r\n /* @var ByteString $bs */\r\n $sizes[] = $bs->getSize();\r\n }\r\n return $sizes;\r\n }", "public function getSizes() {\n return $this->_client->invokeExpecting(\n 'flickr.photos.getSizes',\n array('photo_id' => $this->getId()),\n 'com.flickr.FlickrPhotoSizes'\n );\n }", "public function getImageSizes() {\n\t\t\treturn $this->imageSizes;\n\t\t}", "public function setSize() {\n //Available sizes\n $sizes = [\n 'xs' => '16',\n 'sm' => '24',\n 'md' => '32',\n 'lg' => '48',\n 'xl' => '64',\n 'xxl' => '80',\n ];\n\n //Size class\n if(isset($sizes[$this->compParams['size']])) {\n $this->data['classList'][] = $this->getBaseClass().\"--size-\".$this->compParams['size'];\n } else {\n $this->data['classList'][] = $this->getBaseClass() . \"--size-inherit\";\n }\n\n return $this->data;\n }", "public function get_company_sizes_returns_all_company_sizes()\n {\n $this->assertEquals((new CompanySize)->get_company_sizes(), CompanySize::all());\n }", "public function sizes()\n {\n // belongsToMany(RelatedModel, pivotTable, thisKeyOnPivot = color_id, otherKeyOnPivot = size_id)\n return $this->belongsToMany(Size::class);\n }", "public function setSize()\n {\n //Available sizes\n $sizes = [\n 'xs' => '16',\n 'sm' => '24',\n 'md' => '32',\n 'lg' => '48',\n 'xl' => '64',\n 'xxl' => '80',\n ];\n\n //Size class\n if (isset($sizes[$this->compParams['size']])) {\n $this->data['classList'][] = $this->getBaseClass() . \"--size-\" . $this->compParams['size'];\n } else {\n $this->data['classList'][] = $this->getBaseClass() . \"--size-inherit\";\n }\n\n return $this->data;\n }", "private function getFilteredSizes(): array\n {\n if (! empty($this->width)) {\n return array_filter(config('responsive-image-craft.sizes'), function ($responsiveWidth) {\n return $responsiveWidth <= $this->width;\n });\n }\n\n return config('responsive-image-craft.sizes');\n }", "public static function getImageSizes() {\n return self::$_imgSizes;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Check is group price value fixed or percent of original price
public function isGroupPriceFixed() { return true; }
[ "public function testCheckPriceRendersCorrectlyWithApplyAsPercentageOfOriginalRule(): void\n {\n $priceHtml = $this->getProductPriceHtml('simple-product-tax-none');\n $this->assertFinalPrice($priceHtml, 184.50);\n $this->assertRegularPrice($priceHtml, 205.00);\n }", "public function supportsGroupPrices()\n\t{\n\t\treturn $this->db()->isTableExists($this->getTablePrefix() . 'catalog_product_entity_group_price');\n\t}", "public function testPriceGroupWithVariants()\n {\n $number = __FUNCTION__;\n $context = $this->getContext();\n\n $data = $this->createPriceGroupProduct($number, $context, true);\n\n $this->helper->createArticle($data);\n\n $listProduct = $this->helper->getListProduct($number, $context, [\n 'useLastGraduationForCheapestPrice' => true,\n ]);\n\n /* @var ListProduct $listProduct */\n static::assertEquals(7, $listProduct->getCheapestPrice()->getCalculatedPrice());\n }", "public function testGetGroupPricePriceC()\n {\n $oArticle = $this->_createArticle('_testArt');\n $oArticle->oxarticles__oxpricec = new oxField(12, oxField::T_RAW);\n $oArticle->save();\n $oUser = $this->getMock(\\OxidEsales\\Eshop\\Application\\Model\\User::class, array('inGroup'));\n $oUser->expects($this->any())->method('inGroup')->will($this->onConsecutiveCalls($this->returnValue(false), $this->returnValue(false), $this->returnValue(true)));\n $oArticle = oxNew('oxArticle');\n $oArticle->load('_testArt');\n $oArticle->setUser($oUser);\n $oArticle->oxarticles__oxprice->value = 15;\n $this->assertEquals(12, $oArticle->UNITgetGroupPrice());\n }", "public function isTierPriceFixed()\n {\n return $this->isGroupPriceFixed();\n }", "public function getPricePercentPerItem();", "public function hasRegularPrice() {\n\t\treturn ($this->isEventDate())\n\t\t\t? $this->getTopic()->hasRegularPrice()\n\t\t\t: $this->hasFloat('price_regular');\n\t}", "public function testGetGroupPricePriceB()\n {\n $oArticle = $this->_createArticle('_testArt');\n $oArticle->oxarticles__oxpriceb = new oxField(12, oxField::T_RAW);\n $oArticle->save();\n $oUser = $this->getMock(\\OxidEsales\\Eshop\\Application\\Model\\User::class, array('inGroup'));\n $oUser->expects($this->any())->method('inGroup')->will($this->onConsecutiveCalls($this->returnValue(false), $this->returnValue(true), $this->returnValue(false)));\n $oArticle = oxNew('oxArticle');\n $oArticle->load('_testArt');\n $oArticle->setUser($oUser);\n $this->assertEquals(12, $oArticle->UNITgetGroupPrice());\n }", "public function computeListpriceAfterBaseMarginChange() {\n\t\treturn $this->computelistpriceorcost == 'L';\n\t}", "public function isPercentage(): bool\n {\n return data_get($this->discount, 'amount') === 'percent';\n }", "public function has_variable_prices() {\n\n\t\t$option = give_get_meta( $this->ID, '_give_price_option', true );\n\t\t$ret = 0;\n\n\t\tif ( $option === 'multi' ) {\n\t\t\t$ret = 1;\n\t\t}\n\n\t\t/**\n\t\t * Filter: Override whether the donation form has variables prices.\n\t\t *\n\t\t * @param bool $ret Does donation form have variable prices?\n\t\t * @param int|string $ID The ID of the donation form.\n\t\t */\n\t\treturn (bool) apply_filters( 'give_has_variable_prices', $ret, $this->ID );\n\n\t}", "private static function func_check_item_price($price, $package_limits)\n {\n if (isset($package_limits['price']) && $price > $package_limits['price'])\n return false;\n\n return true;\n }", "public function isUnitPriceOverridden();", "public function isWCRegularPrice($price='', $_product=''){\n global $Lasercommerce_Tier_Tree;\n $postID = $Lasercommerce_Tier_Tree->getPostID( $_product ); \n if($_product and isset($postID)){\n $WC_regular_price = get_post_meta($postID, '_regular_price', True);\n // if(WP_DEBUG and PRICE_DEBUG) error_log(\"-> regular price (\".$postID.\") : \".$WC_regular_price);\n if( floatval($WC_regular_price) == floatval($price)){\n // if(WP_DEBUG and PRICE_DEBUG) error_log(\"-> isWCRegularPrice returned true\");\n return true;\n }\n }\n // if(WP_DEBUG and PRICE_DEBUG) error_log(\"-> isWCRegularPrice returned false\");\n return false;\n }", "public function isIncludedInPrice();", "public function updateAllProductsVipGroupPrice()\n {\n $groupPrice = array();\n $productCollection = Mage::getsingleton('catalog/product')->getResourceCollection()\n ->joinAttribute('price', 'catalog_product/price', 'entity_id')\n ->addAttributeToFilter('visibility', array('in' => array(Mage_Catalog_Model_Product_Visibility :: VISIBILITY_BOTH,\n Mage_Catalog_Model_Product_Visibility :: VISIBILITY_IN_CATALOG,\n )));\n\n $select = $productCollection->getSelect();\n if ($data = $select->query(PDO::FETCH_ASSOC)->fetchAll()) {\n try {\n // empty table\n $adapter = $this->_getWriteAdapter();\n $adapter->query('Delete From ' . $this->getGroupPriceTablePriceTableName());\n $vipDiscounts = $this->getVipDiscounts();\n $adapter->beginTransaction();\n\n foreach ($data as $_data) {\n foreach ($vipDiscounts as $groupId => $discount) {\n $groupPrice[] = array('entity_id' => $_data['entity_id'],\n 'all_groups' => self::IS_ALL_GROUPS,\n 'customer_group_id' => $groupId,\n 'value' => round($_data['price'] * $discount, 1),\n 'website_id' => $this->getWebsiteId()\n );\n }\n\n $adapter->insertOnDuplicate($this->getGroupPriceTablePriceTableName(), $groupPrice, array(\n 'customer_group_id',\n 'value',\n 'entity_id',\n 'all_groups',\n ));\n }\n\n $adapter->commit();\n //reindex price\n $this->reindexPrice();\n return TRUE;\n } catch (Exception $e) {\n Mage::logException($e);\n return FALSE;\n }\n }\n return TRUE;\n }", "function isMinPrice() : bool ;", "public function hasDifferentPrices()\n {\n $order = $this->getOrder();\n $shopgateOrder = $this->getShopgateOrder()->getShopgateOrderObject();\n\n if (!$shopgateOrder instanceof ShopgateOrder) {\n return false;\n }\n\n return !Mage::helper('shopgate')->isOrderTotalCorrect($shopgateOrder, $order, $msg);\n }", "function wpsc_the_variation_price() {\n\tglobal $wpdb, $wpsc_query;\n\t\n if(count($wpsc_query->variation_groups) == 1) {\n\t\t//echo \"<pre>\".print_r($wpsc_query->variation, true).\"</pre>\";\n\t\t$product_id = $wpsc_query->product['id'];\n\t\t$variation_group_id = $wpsc_query->variation_group['variation_id'];\n\t\t$variation_id = $wpsc_query->variation['id'];\n\t\t\n\t\t$priceandstock_id = $wpdb->get_var(\"SELECT `priceandstock_id` FROM `\".WPSC_TABLE_VARIATION_COMBINATIONS.\"` WHERE `product_id` = '{$product_id}' AND `value_id` IN ( '$variation_id' ) AND `all_variation_ids` IN('$variation_group_id') LIMIT 1\");\n\t\t\n\t\t$variation_price = $wpdb->get_var(\"SELECT `price` FROM `\".WPSC_TABLE_VARIATION_PROPERTIES.\"` WHERE `id` = '{$priceandstock_id}' LIMIT 1\");\n\n\t\t$output = nzshpcrt_currency_display($variation_price, $wpsc_query->product['notax'], true); \t\t\n } else {\n \t$output = false;\n }\n\n\treturn $output;\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Check the given availability patterns against the given reference value
protected function _checkAvailabilityPatterns($patterns, $referenceValue, $excluded = false) { if (!is_array($patterns) || empty($patterns)) { return true; } $matched = false; foreach ($patterns as $pattern) { if (preg_match($this->_getAvailabilityRegex($pattern), $referenceValue)) { $matched = true; break; } } return ($matched ? !$excluded : $excluded); }
[ "function getAbcAvailability($calId, $abcFromValue, $abcToValue, $dbFormat = 0, $bookingId = 0) {\n $success = false;\n if(getAbcRoomId($calId, $abcFromValue, $abcToValue, $dbFormat, $bookingId) > 0){\n $success = true;\n }\n return $success;\n}", "public function canMatch($pattern);", "public function testCanDetermineSupport(): void\n {\n $matcher = new PatternMatcher(\n ['COUNTRY' => 'pattern', 'COUNTRY WITHOUT PATTERN' => null],\n ['OVERRIDDEN COUNTRY' => 'pattern']\n );\n\n $this->assertTrue($matcher->supports('country'));\n $this->assertTrue($matcher->supports('country without pattern'));\n $this->assertTrue($matcher->supports('overridden country'));\n $this->assertFalse($matcher->supports('unsupported country'));\n }", "public function check_availability();", "function if_uri_pattern($patterns)\n {\n return app('active')->checkUriPattern($patterns);\n }", "function if_route_pattern($patterns)\n {\n return app('active')->checkRoutePattern($patterns);\n }", "function _password_changer_api_check_pattern($password, $pattern, $value, $error_message = 'Password complexity error.') {\r\n\r\n //Check if password required upper case\r\n $has_item = preg_match_all($pattern, $password, $matches);\r\n \r\n //if is require and it does not have this value at lea\r\n if ($value > 0 && $has_item < $value ) {\r\n watchdog('[password_changer_api_complexity][password_changer_api_check_pattern]' ,\r\n 'Value is required and is not in the password.' .\r\n $error_message, WATCHDOG_ERROR);\r\n throw new passwordChangerApiExeption($error_message); \r\n }//if is this value is deny and it has this value throw an error\r\n elseif ($value < 0 && $has_item > 0 ) {\r\n watchdog('[password_changer_api_complexity][password_changer_api_check_pattern]',\r\n 'Value is deny and is in the password' .\r\n $error_message, WATCHDOG_ERROR);\r\n throw new passwordChangerApiExeption($error_message); \r\n }\r\n \r\n \r\n}", "private function _testPattern()\n\t {\n\t\t$description = $this->_descriptor->describe(\"Restrictions/patternRestriction\");\n\t\t$this->assertEquals(true, $this->_restrictionmanager->validate(\"test@test.com\", $description[\"restrictions\"]));\n\t\t$this->assertEquals(true, $this->_restrictionmanager->validate(\"test@test.com.au\", $description[\"restrictions\"]));\n\t\t$this->assertEquals(true, $this->_restrictionmanager->validate(\"test.test@test.com.au\", $description[\"restrictions\"]));\n\t\t$this->assertEquals(true, $this->_restrictionmanager->validate(\"Test2014@test.com\", $description[\"restrictions\"]));\n\t\t$this->assertEquals(false, $this->_restrictionmanager->validate(\"Test?201.[/]4@com\", $description[\"restrictions\"]));\n\t }", "public function matches($someValue);", "function reblex_is_patterns_available() {\n\treturn function_exists( 'register_block_pattern' );\n}", "public function match($value, $pattern);", "static private function regExpFindMatch($patterns, $value) {\r\n foreach($patterns as $pattern) {\r\n assert('preg_match($pattern, $value)!==FALSE /* Invalid SimpleRDF pattern: '.str_replace('*/', '*[ESC]/', $pattern.', value: '.$value).' */');\r\n if (preg_match($pattern, $value)) {\r\n\treturn true;\r\n }\r\n }\r\n\r\n return false;\r\n }", "public function isValid($checkMatching = false);", "public function supportsPattern($pattern);", "function ABCheck($str) {\n\n //Verify that if \"a\" exists in the string, then three places after, a \"b\" value exists\n preg_match_all('/[a].{3}[b]/', $str, $matches);\n\n //If values are found matching the above criteria, return a true value.\n if (count($matches[0]) > 0) {\n $str = \"true\";\n }\n else {\n //Otherwise, return false\n $str = \"false\";\n }\n\n //Return the final value\n return $str;\n}", "private function checkPatterns($value, array $patterns)\n {\n foreach ($patterns as $pattern) {\n if (Str::is($pattern, $value)) return true;\n }\n\n return false;\n }", "function reality_check ($activity, $check) {\n\n\t$legal = array (1 => 'BCFG','BLDU','BLSA','BLSN','BLPY','DRDU',\n\t\t\t\t\t\t'DRSA','DRSN','FZDZ','FZFG','FZRA','MIFG',\n\t\t\t\t\t\t'PRFG','SHGR','SHGS','SHPL','SHRA','SHSN',\n\t\t\t\t\t\t'TSGR','TSGS','TSPL','TSRA','TSSN');\n\t\n\t$legal_count = count ($legal);\n\t\n\tswitch ($check) {\n\t\tcase 'precip':\n\t\t\t$combo = $activity['descriptor'] . $activity['precipitation'];\n\t\t\t\n\t\t\tfor ($i = 0; $i < $legal_count; $i++) {\n\t\t\t\tif ($combo == $legal[$i]) {\n\t\t\t\t\treturn $activity;\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\t\t\n\t\tcase 'obscur':\n\t\t\t$combo = $activity['descriptor'] . $activity['obscuration'];\n\t\t\t\n\t\t\tfor ($i = 0; $i < $legal_count; $i++) {\n\t\t\t\tif ($combo == $legal[$i]) {\n\t\t\t\t\treturn $activity;\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\n\t\tcase 'other':\n\t\t\t$combo = $activity['descriptor'] . $activity['other'];\n\t\t\t\n\t\t\tfor ($i = 0; $i < $legal_count; $i++) {\n\t\t\t\tif ($combo == $legal[$i]) {\n\t\t\t\t\treturn $activity;\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\t\t\n\t\tdefault:\n\t\t\tbreak;\n\t}\n\treturn '';\n}", "public function simulateEnabledMatchSpecificConditionsSucceeds() {}", "public function test_validate_reference_success()\n\t{\n\t\t// reference validator\n\t\t$validator = new phpIso11649;\n\n\t\t// eg: input 'RF18539007547034' should give true\n\t\t$isValid = $validator->validateRfReference('RF18539007547034');\n\t\t$this->assertTrue($isValid);\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This method will send order detail to customer via email
public static function customer0rderDetailMailer($customerInfo, $order_id) { $email['From'] = Yii::app()->params['adminEmail']; $email['To'] = Yii::app()->user->user_email; $email['Subject'] = "Your Order Detail"; $email['Body'] = self::getController()->renderPartial('//payment/_order_email_template2', array('customerInfo' => $customerInfo, 'order_id' => $order_id), true, false); $email['Body'] = self::getController()->renderPartial('/common/_email_template', array('email' => $email), true, false); self::getController()->sendEmail2($email); }
[ "public function sendEmailToCustomer()\n {\n Mail::to($this->model->customer)\n ->send(new SendOrderToCustomerMailable($this->findOrderById($this->model->id)));\n }", "public function sendNewOrderEmail()\n {\n \t\t\ttry{ \n \t\t\t$payment_method = $this->getPayment()->getMethodInstance()->getCode();\n\t \t\t\tif($payment_method == \"cashondelivery\"){\n\t \t\t\t\t\n\t \t\t\t\t//code to save cod order detail in model\t\n\t \t\t\t\t$cod_order = Mage::getModel('orderemail/codorders');\n\t \t\t\t\t$formKey = Mage::getSingleton('core/session')->getFormKey();\n\t \t\t\t\t$cod_order->setIncrementId($this->getIncrementId());\n\t \t\t\t\t$cod_order->setCustomerId($this->getCustomerId());\n\t \t\t\t\t$expiredate = date('Y-m-d h:i:s', strtotime(date(\"Y-m-d h:i:s\").'2 days'));\t\n\t \t\t\t\t$cod_order->setExpireDate($expiredate);\n\t \t\t\t\t$cod_order->setExpirekey($formKey);\n\t \t\t\t\t$cod_order->save();\n\t \t\t\t\t$customer = Mage::getModel('customer/customer')->load($this->getCustomerId());\n\n\t \t\t\t\t$verify_url = Mage::getUrl('orderemail').'?orderid='.$this->getIncrementId().'&key='.$formKey;\n\t \t\t\t\t// code to send custom email for confirmation\n\t \t\t\t\t$vars = array('order' => $this,'cod_verify_url'=> $verify_url);\n \n// $translate = Mage::getSingleton('core/translate');\n// $templateId = 11;\n $senderName = Mage::getStoreConfig('trans_email/ident_support/name');\n $senderEmail = Mage::getStoreConfig('trans_email/ident_support/email'); \n $sender = array('name' => $senderName,'email' => $senderEmail);\n $recepientEmail = $customer->getEmail();\n $recepientName = $customer->getName();\n $store = Mage::app()->getStore()->getId();\n//\n// // Send Transactional Email\n// Mage::getModel('core/email_template')\n// ->sendTransactional($templateId, $sender, $recepientEmail, $recepientName, $vars, $store);\n// \n// $translate->setTranslateInline(true); \n /* Code to send order email */\n $emailTemplate = Mage::getModel('core/email_template')->loadDefault('cod_order'); \n $emailtemplatevarible = array();\n $emailtemplatevarible[\"customer\"]= $customer;\n $emailtemplatevarible[\"store\"]= Mage::app()->getStore()->getId();\n $emailtemplatevarible[\"orderlink\"] = $verify_url;\n $emailtemplatevarible[\"order\"] = $this;\n $emailTemplate->setSenderName($senderName);\n $emailTemplate->setSenderEmail($senderEmail);\n $emailTemplate->setType('html');\n $emailTemplate->setTemplateSubject('COD confirmation');\n $emailTemplate->send($recepientEmail,$recepientName,$emailtemplatevarible);\n return true;\n /* End code to send order email */ \n \n\n\t \t\t\t}else{\n\t \t\t\t\tparent::sendNewOrderEmail();\n\t \t\t\t}\n \t\t\t}catch(Exception $ex){\n \t\t\t\tMage::throwException(\n Mage::helper('sales')->__('Order Email Not Send '.$ex->getMessage())\n );\n \t\t\t\t\n \t\t\t}\n\n\t}", "public function sendOrderPaidCustomerEmail($orderId);", "function _send_order_mail($order_info)\n\t{\n\t\t$user = $order_info['user'];\n\t\t$orders = $this->database->GetOrdersForUser($order_info['user_id']);\n\t\t$order_num = count($orders);\n\n\t\t$data['site_name'] = $this->config->item('website_name', 'tank_auth');\n\t\t$data['username'] = $user['username'];\n\t\t$data['order_id'] = $order_info['txn_id'];\n\t\t$data['product_table'] = generate_product_table_for_order($order_info['txn_id']);\n\t\t$data['address'] = format_address($order_info['address']);\n\t\t$data['payment_mode'] = $order_info['payment_mode'];\n\t\t\n\t\t//For special mails\n\t\tswitch ($order_num)\n\t\t{\n\t\t\tcase '1':\n\t\t\t\t$params = mg_create_mail_params('first_order', $data);\n\t\t\t\tmg_send_mail($user['email'], $params);\n\t\t\t\tbreak;\n\n\t\t\tcase '2':\n\t\t\t\t$params = mg_create_mail_params('second_order', $data);\n\t\t\t\tmg_send_mail($user['email'], $params);\n\t\t\t\tbreak;\n\n\t\t\tcase '3':\n\t\t\t\t$params = mg_create_mail_params('third_order', $data);\n\t\t\t\tmg_send_mail($user['email'], $params);\n\t\t\t\tbreak;\n\t\t\t\n\t\t\tcase '4':\n\t\t\t\t$params = mg_create_mail_params('fourth_order', $data);\n\t\t\t\tmg_send_mail($user['email'], $params);\n\t\t\t\tbreak;\n\n\t\t\tcase '5':\n\t\t\t\t$params = mg_create_mail_params('fifth_order', $data);\n\t\t\t\tmg_send_mail($user['email'], $params);\n\t\t\t\tbreak;\n\n\t\t\t\n\t\t\tdefault:\n\t\t\t\t# code...\n\t\t\t\tbreak;\n\t\t}\n\n\t\t//This is to be sent for each order\n\t\t$params = mg_create_mail_params('order', $data);\n\t\tmg_send_mail($user['email'], $params);\n\t}", "function send_order_details_email($email, $products, $first_name, $last_name, $address_street, $address_city, $address_zip, $address_country, $subtotal, $order_id)\n{\n if (!mail_enabled) {\n return;\n }\n $subject = 'Order Details';\n $headers = 'From: ' . mail_from . \"\\r\\n\" . 'Reply-To: ' . mail_from . \"\\r\\n\" . 'Return-Path: ' . mail_from . \"\\r\\n\" . 'X-Mailer: PHP/' . phpversion() . \"\\r\\n\" . 'MIME-Version: 1.0' . \"\\r\\n\" . 'Content-Type: text/html; charset=UTF-8' . \"\\r\\n\";\n ob_start();\n include 'order-details-template.php';\n $order_details_template = ob_get_clean();\n mail($email, $subject, $order_details_template, $headers);\n}", "public function SendMailtocustomer() {\r\n \r\n if ((Mage::helper('customerfollowup')->isCustomerfollowupEnabled())) {\r\n $status = Mage::getStoreConfig('customerfollowup/config/order_status');\r\n $statusValues = explode(',', $status);\r\n $customerGroup = Mage::getStoreConfig('customerfollowup/config/customer_groups');\r\n $groupValues = explode(',', $customerGroup);\r\n $orderAmount = Mage::getStoreConfig('customerfollowup/config/amount_in_cart');\r\n $amountEquals = Mage::getStoreConfig('customerfollowup/config/amount_equals');\r\n\r\n /**\r\n * getting product details in cart page who given place order in the checkout page\r\n * and send mail to that customers\r\n */\r\n $this->getOrderdetails($statusValues, $groupValues, $orderAmount, $amountEquals);\r\n\r\n /**\r\n * getting product details in cart page who logged in to the site\r\n * and send mail to that customers\r\n */\r\n $this->getCartdetails($statusValues, $groupValues, $orderAmount, $amountEquals);\r\n }\r\n return $this;\r\n }", "function sendPaymentDetailsEmail($data){\r\n \r\n\t\t\r\n\t\t$orderTable = JTable::getInstance(\"Order\", \"JTable\", array());\r\n\t\t$orderTable->load($data->order_id);\r\n\t\r\n\t\t$properties = $orderTable->getProperties(1);\r\n\t\t$order = JArrayHelper::toObject($properties, 'JObject');\r\n\t\t$order->details = $data;\r\n\t\t\r\n\t\t$companiesTable = $this->getTable(\"Company\");\r\n\t\t$company = $companiesTable->getCompany($order->company_id);\r\n\t\t\r\n\t\t$packageTable = $this->getTable(\"Package\");\r\n\t\t$order->package = $packageTable->getPackage($order->package_id);\r\n\r\n $taxesTable = JTable::getInstance(\"Taxes\", \"Table\", array());\r\n $order->taxes = $taxesTable->getTaxes();\r\n if($this->appSettings->enable_multilingual){\r\n JBusinessDirectoryTranslations::updateEntityTranslation($order->taxes, TAX_DESCRIPTION_TRANSLATION);\r\n }\r\n if (!empty($order->taxes)) {\r\n foreach ($order->taxes as &$tax) {\r\n if ($tax->tax_type == 2) {\r\n $tax->percentage = $tax->tax_amount;\r\n $tax->tax_amount = $tax->tax_amount * $order->initial_amount / 100;\r\n }\r\n }\r\n $order->taxesDetails = $this->prepareOrderEmail($order);\r\n }\r\n\t\t\r\n\t\tif(!isset($company->email))\r\n\t\t\treturn;\r\n\t\r\n\t\treturn EmailService::sendPaymentDetailsEmail($company, $order);\r\n\t}", "function orderEmailNotification($varOrderID) {\n $objOrderProcess = new OrderProcess();\n $arrOrderDetail = $objOrderProcess->GetOrderDetails($varOrderID);\n\n $this->SentEmailToCustomer($arrOrderDetail[0]);\n $this->SentEmailToWholesaler($arrOrderDetail[0]);\n //$this->SentEmailToLogisticcompany($arrOrderDetail[0]);\n $this->SentEmailToCountryPortal($arrOrderDetail[0]);\n $this->SentEmailToSuperAdmin($arrOrderDetail[0]);\n//exit;\n }", "public function sendInvoiceToCustomer() {\n\t\t$this->order->sendInvoiceToCustomer($this->id);\n\t}", "function resend_orderEmail_cust($emailid,$orderid)\n{\n\tglobal $db,$ecom_siteid,$ecom_site_activate_invoice;\n\t// Get the details of the email\n\t$sql_email = \"SELECT email_to,email_subject,email_messagepath,email_headers\t\t\t\t\t\t\t\n\t\t\t\t\t\tFROM\n\t\t\t\t\t\t\torder_emails_tocust\n\t\t\t\t\t\tWHERE\n\t\t\t\t\t\t\torders_order_id = $orderid\n\t\t\t\t\t\t\tAND order_email_cust_id = $emailid\n\t\t\t\t\t\tLIMIT\n\t\t\t\t\t\t\t1\";\n\t$ret_email = $db->query($sql_email);\n\tif ($db->num_rows($ret_email))\n\t{\n\t\t$row_email \t\t= $db->fetch_array($ret_email);\n\t\t$to\t\t\t\t= explode(\",\",stripslashes($row_email['email_to']));\n\t\t$header\t\t\t= stripslashes($row_email['email_headers']);\n\t\t$subject\t\t= stripslashes($row_email['email_subject']);\n\t\t//$content\t\t= stripslashes($row_email['email_message']);\n\t\t$content\t\t= strip_tags(read_emailcust_from_file($emailid));\t\t\n\t\t\n\t\t\tfor ($i=0;$i<count($to);$i++)\n\t\t\t{\n\t\t\t\tmail($to[$i],$subject,$content,$header);\n\t\t\t}\n\t\t\t\n\t}\n}", "static function sendOrderNotification($order)\n {\n $email = \\Swift_Message::newInstance();\n $cannedMessage['content'] = html_entity_decode($order['content']);\n $cannedMessage['subject'] = $order['subject'];\n\n $email->setFrom(config_item('email_from')); //email address the website sends from\n $email->setTo($order['recipient']);\n //$email->setBcc(config_item('email_to')); //admin email the website sends to\n $email->setReturnPath(config_item('email_to')); //this is the bounce if they submit a bad email\n $email->setSubject($cannedMessage['subject']);\n $email->setBody($cannedMessage['content'], 'text/html');\n\n self::sendEmail($email);\n }", "function paid_sendEmail_customer($details) {\n\t\t\t\n\t\t\t$currencycode = $details->currCode;\n\t\t\t$currencysign = $details->currSymbol;\n\n\n\t\t\t\t$total_amount = $details->checkoutTotal;\n\t\t\t\t $abc = $details->Extra_data->normal_price - $total_amount;\n if($abc < 0){\n $save = '0';\n\n }else{\n $save = number_format($details->Extra_data->normal_price - $total_amount,0);\n\t\t\t\t\t}\n\n\t\t\t\t$id = $details->id;\n\t\t\t\t$itemid = $details->itemid;\n\t\t\t\t$custid = $details->bookingUser;\n\t\t\t\t$country = $details->userCountry;\n\t\t\t\t$name = $details->userFullName;\n\t\t\t\t$stars = $details->stars;\n\t\t\t\t$code = $details->code;\n\t\t\t\t$booking_adults = $details->Extra_data->adults;\n\t\t\t\t$child = $details->Extra_data->child;\n\t\t\t\t\n\t\t\t\t$phone = $details->userMobile;\n\t\t\t\t$paymethod = $details->paymethod;\n\t\t\t\t$invoiceid = $details->id;\n\t\t\t\t$refno = $details->code;\n\t\t\t\t$deposit = $details->subItem->price;\n\t\t\t\t$quantity = $details->subItem->quantity;\n\t\t\t\t$hotel_title = $details->subItem->title;\n\t\t\t\t$duedate = $details->expiry;\n\t\t\t\t$date = $details->date;\n\t\t\t\t$sendto = $details->accountEmail;\n\n\t\t\t\t$additionaNotes = $details->additionaNotes;\n\n\t\t\t\t$remaining = $details->remainingAmount;\n\t\t\t\t$HOTEL_NAME = $details->title;\n\t\t\t\t$location = $details->location;\n\t\t\t\t$room_name = $details->subItem->title;\n\t\t\t\t$booking_adults = $details->subItem->booking_adults;\n\t\t\t\t$room_price = $details->subItem->price;\n\t\t\t\t\n\t\t\t\t$checkin = $details->checkin;\n\t\t\t\t\n\t\t\t\t$checkout = $details->checkout;\n\t\t\t\t$couponRate = $details->couponRate;\n\t\t\t\t\n\t\t\t\t$date = date ( \"m/d/Y\" , strtotime ( \"-1 day\" , strtotime ( $details->checkin ) ) );\n\t\t\t\t$no_of_room = $details->subItem->quantity;\n\t\t\t\t$thumbnail = str_replace(\"demo.tarzango.com/\",\"tarzango.com/\",$details->thumbnail);\n\t\t\t\t$hotel_id = $details->itemid;\n\n\t\t\t\t$guest_name = $details->Extra_data->guest_name;\n\t\t\t\t$guest_age = $details->Extra_data->guest_age;\n\t\t\t\t$chil = $details->Extra_data->child;\n\t\t\t\t$child_name = isset($details->Extra_data->child_name) ? $details->Extra_data->child_name : 0;\n\t\t\t\t$child_age = isset($details->Extra_data->child_age) ? $details->Extra_data->child_age : 0;\n\t\t\t\t\n\t\t\t\t$sitetitle = \"\";\n\n\t\t\t\t$invoicelink = \"\";\n\t\t\t\t\n\t\t\t\t$sendto = $details->accountEmail;\n\t\t\t\t\n\t\t\t\t $ptheme = pt_default_theme();\n\t\t\t\t\t$this->_config = config_item('theme');\n\t\t\t\t\t$uu = $this->_config['url'];\n\t\t\t\t$email_temp_img = $uu.$ptheme.'/email_temp_img/gb_email_temp_img/';\n\t\t\t\t/*$template = $this->shortcode_variables(\"bookingpaidcustomer\");\n\t\t\t\t$details = email_template_detail(\"bookingpaidcustomer\");*/\n\n\t\t\t\t $book_room = $no_of_room;\n \n $room_per_guest = $booking_adults / $book_room;\n \n for ($r_i=0; $r_i < $book_room ; $r_i++) {\n \t$cc = $r_i+1;\n \t$no_top_hotel .= '<li class=\"title\" style=\"float: left; width: 100%; list-style-type: none; margin-left:0px;\">\n <p style=\"font-size: 11px;color: #a5a6b4;padding-top: 15px;margin-left: -30px;\">ROOM '.$cc.'</p>\n </li>';\n\t for($g_d_a=0; $g_d_a < $room_per_guest; $g_d_a++){\n\n\t $jj = $g_d_a + $r_i;\n\t $dd = $guest_name[$jj];\n\t $age = $guest_age[$jj];\n\t \n\n\t \t$no_top_hotel .= '<li class=\"username\" style=\"list-style-type: none;width: 100%;float:left;border-bottom: 1px solid #e6e7ed; margin-left:0px; \">\n\t\t <h5 class=\"left\" style=\"font-size: 16px;color: #0c134f;float: left; margin-left: -30px;\">'.$dd.'</h5>\n \t\t<h5 class=\"right\" style=\"float:right;font-size: 16px;color: #0c134f;margin-right: 5px;\">'.$age.' Years</h5>\n\t\t </li>';\n\t }\n }\n\n if($chil > 0){\n\t $no_top_hotel .= ' <li class=\"title\" style=\"float: left; width: 100%; list-style-type: none; margin-left:0px; \">\n \t\t\t\t <p style=\"font-size: 11px;color: #a5a6b4;padding-top: 15px;\">CHILD DETAILS</p>\n \t\t\t\t </li>';\n \t for($c_i=0;$c_i<$chil;$c_i++){\n \t \t $ii = $c_i;\n\t \t\t $child_name1 = $child_name[$ii];\n\t \t\t $child_age1= $child_age[$ii];\n \t \t\n \t \t $no_top_hotel .= '<li class=\"username\" style=\"list-style-type: none;width: 96%;float:left;border-bottom: 1px solid #e6e7ed; margin-left:0px;\">\n \t\t\t<h5 class=\"left\" style=\"font-size: 16px;color: #0c134f;float: left; margin-left: -30px;\">'.$child_name1.'</h5>\n \t\t<h5 class=\"right\" style=\"font-size: 16px;color: #0c134f;float: right;margin-right: 5px;\"><img src=\"'.$email_temp_img.'paynow_icon8.png\"> '.$child_age1.' Years</h5>\n \t\t\t</li>';\n \t}\n }\n\n \t$this->db->select('hotel_latitude,hotel_longitude,hotel_desc,hotel_map_city,hotel_stars');\n\t\t \t$this->db->where('hotel_id', $itemid);\n\t\t \t$query = $this->db->get('pt_hotels');\t\n\t\t \t$hotel_data = $query->result();\n\n\t\t \t$star_temp_img = $uu.$ptheme.'/images/';\n\n\t\t\t\t\t/*echo $hotel_data[0]->hotel_stars;*/\n\n\t\t\t\t\t$aaa = '';\n\t\t\t\t\tfor ($st_i=0; $st_i < 5 ; $st_i++) { \n \tif($st_i < $hotel_data[0]->hotel_stars){\n \t\t$aaa .= '<img src=\"'.$star_temp_img.'/star-on.png\">';\n \t}else{\n \t\t$aaa .= '<img src=\"'.$star_temp_img.'/star-off.png\">';\n \t}\n }\n\n\t\t \t$arrayInfo['checkIn'] = date(\"m/d/Y\", strtotime(\"+1 days\"));\n\t\t \t$arrayInfo['checkOut'] = date(\"m/d/Y\", strtotime(\"+2 days\"));\n\t\t \t$arrayInfo['adults'] = '1';\n\t\t \t$arrayInfo['child'] = '';\n\t\t \t$arrayInfo['room'] = '1';\n\t\t \t/*error_reporting(E_ALL);*/\n\t\t \t\t//$this->ci = & get_instance();\n\t\t\t\t\t\t// $this->db = $this->ci->db;\n\t\t\t\t\t$this->load->model('hotels/hotels_model');\n\t\t \t\n\t\t \t$local_hotels = $this->hotels_model->search_hotels_by_lat_lang($hotel_data[0]->hotel_latitude, $hotel_data[0]->hotel_longitude,$arrayInfo);\n\n\t\t \t$top_hotel = '<div class=\"col-sm-12 hotels\">';\n\n\t\t \tfor ($i=0; $i < count($local_hotels['hotels']) ; $i++) { \n\t\t \t\tif($i < 3){\n\t\t \t\t $image = str_replace(\"demo.tarzango.com/\",\"tarzango.com/\",$bb[$i]->thumbnail);\n\t\t \t\t$bb = $local_hotels['hotels'];\n\t\t \t\t $bb[$i]->title;\n\t\t \t\t$top_hotel .= '<a class=\"col-sm-4\" href=\"'.$bb[$i]->slug.'\" style=\"margin-left: 2%;padding:10px;text-decoration: none; width:27.3333%;float: left; box-sizing: border-box;position: relative;\">';\n\t\t \t\t\t\t\t\tif($image == \"\"){\n\n\t\t\t\t\t\t\t\t\t\t\t$top_hotel .= '<img height=185px class=\"img-responsive\" src=\"'.$uu.$ptheme.'/email_temp_img/gb_email_temp_img/email-d-lasvegas.png\" style=\"width: 100%; min-height: 185px; height: 185px; max-height: 185px;\">';\n\t\t\t\t\t\t\t\t\t\t}else{\n\n\t\t\t\t\t\t\t\t\t\t\t$top_hotel .= '<img height=185px class=\"img-responsive\" src=\"'.$image.'\" style=\"width: 100%; min-height: 185px; height: 185px; max-height: 185px;\">';\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t$top_hotel .= '<p style=\"text-align:center;margin:0px;color: rgb(12, 19, 79);font-size: 14px;margin: 20px 0 10px;font-family: \\'Roboto\\',sans-serif;\">'.$this->custom_echo($bb[$i]->title, 25).'</p>\n\t\t\t\t\t\t\t\t\t\t\t<h4 style=\" text-align:center;margin:0px; color: rgb(28, 192, 251);font-size: 20px;font-weight: 600;font-family: \\'Roboto\\',sans-serif;\">'.$bb[$i]->currCode.$bb[$i]->price.'</h4>\n\t\t\t\t\t\t\t\t\t\t</a>';\n\t\t \t} \n\t\t }\n\n\t\t \t$map = '<div class=\"col-sm-12 map\" style=\"width: 100%;padding-left: 0;float: left; box-sizing: border-box;min-height: 1px; padding-right:0px; position: relative;\">\n\t\t\t\t\t\t\t\t <a href=\"http://maps.google.com/?daddr={hotel_name}\" target=\"_blank\"> \n <img style=\"width:100%\" border=\"0\" src=\"https://maps.googleapis.com/maps/api/staticmap?center='.$hotel_data[0]->hotel_latitude.','.$hotel_data[0]->hotel_longitude.'&zoom=14&size=620x260&markers=size:mid%7Ccolor:red%7C'.$hotel_data[0]->hotel_latitude.','.$hotel_data[0]->hotel_longitude.'&key=AIzaSyAH65sTGsDsP4mMpmbHC8zqRiM1Qh07iL8\" alt=\"Google map\"></a>\n\t\t\t\t\t\t\t</div>';\n\n\t\t\t\t$res = $this->settings_model->get_contact_page_details();\n\t\t\t\t$contact_phone = $res[0]->contact_phone;\n\t\t\t\t$contact_email = $res[0]->contact_email;\n\t\t\t\t$contact_address = $res[0]->contact_address;\n\n\t\t\t\t\n\n\t\t\t\t$template = array(\"{invoice_id}\", \"{hotel_name}\", \"{stars}\", \"{location}\", \"{code}\",\"{invoice_code}\", \"{deposit_amount}\", \"{total_amount}\", \"{customer_email}\", \"{customer_id}\", \"{country}\", \"{phone}\", \"{currency_code}\", \"{currency_sign}\", \"{invoice_link}\", \"{site_title}\", \"{remaining_amount}\", \"{fullname}\",\"{room_name}\",\"{date}\",\"{checkin}\",\"{checkout}\",\"{no_of_room}\",\"{thumbnail}\",\"{booking_adults}\",\"{room_price}\",\"{couponRate}\",\"{additionaNotes}\",\"{email_temp_img}\",\"{quantity}\",\"{hotel_title}\",\"{booking_adults}\",\"{child}\",\"{no_top_hotel}\",\"{top_hotel}\",\"{map}\",\"{aaa}\",\"{save}\");\n\t\t\t\t//$smsdetails = sms_template_detail(\"bookingpaidcustomer\");\n\t\t\t\t$values = array($invoiceid, $HOTEL_NAME, $stars, $location, $code, $refno, $deposit, $total_amount, $sendto, $custid, $country, $phone, $currencycode, $currencysign, $invoicelink, $sitetitle, $remaining , $name, $room_name, $date, $checkin, $checkout, $no_of_room, $thumbnail,$booking_adults,$room_price,$couponRate,$additionaNotes,$email_temp_img, $quantity,$hotel_title,$booking_adults,$child,$no_top_hotel,$top_hotel,$map,$aaa,$save);\n\n\t\t\t\t$HTML_DATA = file_get_contents( $uu.$ptheme.'/invoice.html');\n\t\t\t\t$message = str_replace($template, $values, $HTML_DATA);\n\n\t\t\t\t\n\t\t\t\t/*$message = $this->mailHeader;*/\n\t\t\t\t/*echo '<pre>'.json_encode($message).'</pre>';\n\t\t\t\texit();*/\n\t\t\t\t/*$details = $this->html_template_booking($hotel_id,$invoiceid);\n\t\t\t\t$message .= str_replace($template, $values, $details);*/\n\t\t\t\t//$message .= $this->mailFooter;\n\t\t\t\t/*echo $message;\n\t\t\t\texit;*/\n\t\t\t\t//$smsmessage = str_replace($template, $values, $smsdetails[0]->temp_body);\n\t\t\t\t//sendsms($smsmessage, $phone, \"bookingpaidcustomer\");\n\t\t\t\t$this->email->set_newline(\"\\r\\n\");\n\t\t\t\t$this->email->from($this->sendfrom);\n\t\t\t\t$this->email->to($sendto);\n\t\t\t\t$this->email->subject('Thanks for Booking at the '.$HOTEL_NAME);\n\t\t\t\t$this->email->message($message);\n\t\t\t\t$this->email->send();\n\t\t\t\t\n\t\t}", "function paid_sendEmail_customer($details) {\n\t\t\t$currencycode = $details->currCode;\n\t\t\t$currencysign = $details->currSymbol;\n\n\t\t\t\t$custid = $details->bookingUser;\n\t\t\t\t$country = $details->userCountry;\n\t\t\t\t$name = $details->userFullName;\n\t\t\t\t$phone = $details->userMobile;\n\t\t\t\t$paymethod = $details->paymethod;\n\t\t\t\t$invoiceid = $details->id;\n\t\t\t\t$refno = $details->code;\n\t\t\t\t$totalamount = $details->checkoutTotal;\n\t\t\t\t$deposit = $details->checkoutAmount;\n\t\t\t\t$duedate = $details->expiry;\n\t\t\t\t$date = $details->date;\n\t\t\t\t$sendto = $details->accountEmail;\n\n\t\t\t\t$remaining = $details->remainingAmount;\n\t\t\t\t$sitetitle = \"\";\n\n\t\t\t\t$invoicelink = \"<a href=\" . base_url() . \"invoice?id=\" . $invoiceid . \"&sessid=\" . $refno . \" >\" . base_url() . \"invoice?id=\" . $invoiceid . \"&sessid=\" . $refno . \"</a>\";\n\t\t\t\t$template = $this->shortcode_variables(\"bookingpaidcustomer\");\n\t\t\t\t$details = email_template_detail(\"bookingpaidcustomer\");\n\t\t\t\t//$smsdetails = sms_template_detail(\"bookingpaidcustomer\");\n\t\t\t\t$values = array($invoiceid, $refno, $deposit, $totalamount, $sendto, $custid, $country, $phone, $currencycode, $currencysign, $invoicelink, $sitetitle, $remaining, $name);\n\t\t\t\t\n\t\t\t\t$message = $this->mailHeader;\n\t\t\t\t$message .= str_replace($template, $values, $details[0]->temp_body);\n\t\t\t\t$message .= $this->mailFooter;\n\n\t\t\t\t//$smsmessage = str_replace($template, $values, $smsdetails[0]->temp_body);\n\t\t\t\t//sendsms($smsmessage, $phone, \"bookingpaidcustomer\");\n\t\t\t\t$this->email->set_newline(\"\\r\\n\");\n\t\t\t\t$this->email->from($this->sendfrom);\n\t\t\t\t$this->email->to($sendto);\n\t\t\t\t$this->email->subject($details[0]->temp_subject);\n\t\t\t\t$this->email->message($message);\n\t\t\t\t$this->email->send();\n\t\t}", "public function sendOrderConfirmationEmail() {\n\n // prepare confirmation email data\n $httpHost = t3lib_div::getIndpEnv('HTTP_HOST'); // this is empty in CLI mode\n $orderHost = (!empty($httpHost) ? $httpHost : $this->gsaShopConfig['shopName']);\n $mailRecipient = $this->orderWrapperObj->get_feCustomerObj()->get_feUserObj()->get_email1();\n $mailSubject = sprintf(tx_pttools_div::getLLL(__CLASS__.'.orderEmailSubject', $this->llArray), $orderHost);\n \n // prepare email body\n $orderPresentatorObj = new tx_ptgsashop_orderPresentator($this->orderWrapperObj->get_orderObj());\n $mailBody = $orderPresentatorObj->getPlaintextPresentation($this->gsaShopConfig['templateFileFinalOrderMail'], $this->orderWrapperObj->get_relatedDocNo()); // get final order as plaintext\n if (is_int(stripos($mailBody, 'Smarty error'))) {\n throw new tx_pttools_exception('Error in smarty template'); // recognize error in mail body\n }\n #die('<pre>'.$mailBody.'</pre>'); // for development only: display mail body and die (outcomment this line in production environment!!)\n\n // prepare mail object\n $mail = new tx_ptmail_mail($this, 'orderConfirmation'); \n $mail->set_subject($mailSubject); \n $mail->set_body($mailBody);\n $mail->set_to(new tx_ptmail_addressCollection(new tx_ptmail_address($mailRecipient))); \n \n // additional email configuration (from, cc, bcc, reply-to) is done via typoscript, basic config see pt_gsashop/static/pt_mail_config/setup.txt\n /*\n $mailSender = (!empty($this->gsaShopConfig['orderEmailSender']) ? $this->gsaShopConfig['orderEmailSender'] : $this->extKey.'@'.$orderHost); \n $mail->set_from(new tx_ptmail_address($mailSender));\n if (!empty($this->gsaShopConfig['orderEmailRecipient'])) {\n $mail->set_cc(new tx_ptmail_addressCollection(new tx_ptmail_address($this->gsaShopConfig['orderEmailRecipient'])));\n }\n if (!empty($this->gsaShopConfig['orderConfirmationEmailBcc'])) {\n $mail->set_bcc(new tx_ptmail_addressCollection(new tx_ptmail_address($this->gsaShopConfig['orderConfirmationEmailBcc'])));\n }\n if (!empty($this->gsaShopConfig['orderConfirmationEmailReplyTo'])) {\n $mail->set_reply(new tx_ptmail_address($this->gsaShopConfig['orderConfirmationEmailReplyTo']));\n }\n */\n \n // TODO: charsets? language?\n \n // send mail\n $result = $mail->sendMail();\n tx_pttools_assert::isTrue($result, array('message' => 'Error while sending the order confirmation email!'));\n \n }", "function gb_sendEmail_owner($details) {\n\t\t\t\t$currencycode = $details->currCode;\n\t\t\t\t$currencysign = $details->currSymbol;\n\n\t\t\t\t$custid = $details->bookingUser;\n\t\t\t\t$country = $details->userCountry;\n\t\t\t\t$name = $details->userFullName;\n\t\t\t\t$phone = $details->userMobile;\n\t\t\t\t$paymethod = $details->paymethod;\n\t\t\t\t$invoiceid = $details->id;\n\t\t\t\t$refno = $details->code;\n\t\t\t\t$totalamount = $details->checkoutTotal;\n\t\t\t\t$deposit = $details->checkoutAmount;\n\t\t\t\t$duedate = $details->expiry;\n\t\t\t\t$date = $details->date;\n\t\t\t\t$remaining = $details->remainingAmount;\n\t\t\t\t$custemail = $details->accountEmail;\t\t\t\t\n\t\t\t\n\t\t\t\t$sendto = $this->ownerEmail($details->module, $details->itemid);\n\t\t\t\t$sitetitle = \"\";\n\t\t\t\t\n\t\t\t\t$message = $this->mailHeader;\n\t\t\t\t$message .= \"<h4><b>Booking Paid Successfully</b></h4>\";\n\t\t\t\t$message .= \"Invoice No.: \" . $invoiceid . \".<br>\";\n\t\t\t\t//$message .= \"Payment Method: \" . $paymethod . \".<br><br>\";\n\t\t\t\t$message .= \"Deposit Amount: \" . $currencycode . \" \" . $currencysign . $deposit . \"<br>\";\n\t\t\t\t$message .= \"Total Amount: \" . $currencycode . \" \" . $currencysign . $totalamount . \"<br><br>\";\n\t\t\t\t$message .= \"<h4><b>Customer Information</b></h4>\";\n\t\t\t\t$message .= \"Customer ID: \" . $custid . \"<br>\";\n\t\t\t\t$message .= \"Name : \" . $name . \"<br>\";\n\t\t\t\t$message .= \"Email : \" . $custemail . \"<br>\";\n\t\t\t\t$message .= \"Country : \" . $country . \"<br>\";\n\t\t\t\t$message .= \"Phone : \" . $phone . \"<br>\";\n\t\t\t\t$message .= \"<br> To view Invoice <a href=\" . base_url() . \"invoice?id=\" . $invoiceid . \"&sessid=\" . $refno . \" >\" . base_url() . \"invoice?id=\" . $invoiceid . \"&sessid=\" . $refno . \"</a>\";\n\t\t\t\t$message .= $this->mailFooter;\n\t\t\t\t$this->email->set_newline(\"\\r\\n\");\n\t\t\t\t$this->email->from($this->sendfrom);\n\t\t\t\t$this->email->to($sendto);\n\t\t\t\t$this->email->subject('Booking Payment Notification');\n\t\t\t\t$this->email->message($message);\n\t\t\t\t$this->email->send();\n\t\t}", "public function sendNewOrderEmail()\n {\n Mage::register('sending_order_email', 1);\n return parent::sendNewOrderEmail();\n Mage::unregister('sending_order_email');\n }", "function merchant_checkout_send_buyer_email( $purchase, $details, $email ) {\n\n\t\t// Make sure email content exists\n\t\tif ( !is_array( $details ) || !array_key_exists( 'email_1_subject', $details ) || !array_key_exists( 'email_1_content', $details ) ) return;\n\n\t\t// Variables\n\t\t$admin_email = sanitize_email( get_option( 'admin_email' ) );\n\t\t$name = get_bloginfo( 'name' );\n\t\t$domain = merchant_get_site_domain();\n\n\t\t// Setup email\n\t\t$to = sanitize_email( $email );\n\t\t$headers = array(\n\t\t\t'From: ' . $name . ' <notifications@' . $domain . '>',\n\t\t\t'Sender: ' . $name . ' <' . $admin_email . '>',\n\t\t\t'Reply-To: ' . $name . ' <' . $admin_email . '>',\n\t\t);\n\t\t$subject = $details['email_1_subject'];\n\t\t$message = nl2br( $details['email_1_content'] );\n\n\t\t// Send email\n\t\twp_mail( $to, $subject, $message, $headers );\n\n\t}", "private function _sendSmsEmail() {\r\n\r\n $orderIncrementId = Mage::getSingleton('checkout/session')->getLastRealOrderId();\r\n $orderPlaced = Mage::helper('Boonagel_Cba')->orderObjectGetNew($orderIncrementId);\r\n $orderDetails = $orderPlaced->getData();\r\n\r\n if ($orderDetails == null) {\r\n return;\r\n }\r\n\r\n /**$lastOrder = Mage::getModel('sales/order')->load(Mage::getSingleton('checkout/session')->getLastOrderId());\r\n $billingAddress = $lastOrder->getBillingAddress();**/\r\n \r\n $billingAddress = $orderPlaced->getBillingAddress();\r\n\r\n //Thank you steve,your order number is 10000123,kindly pay through M-pesa by\r\n $smsMessage = \"Thank you \" . $orderDetails['customer_firstname'] . \" for shopping at Alladin.\\n\"\r\n . \"1.Go to safaricom menu and select Mpesa option.\\n\"\r\n . \"2.Select Lipa na Mpesa.\\n\"\r\n . \"3.Select Pay Bill.\\n\"\r\n . \"4.Enter business number as : \" . Mage::helper('Boonagel_Cba')->payBill() . \"\\n\"\r\n . \"5.Enter account number as : $orderIncrementId\" . \"\\n\"\r\n . \"6.Enter amount : \" . Mage::helper('Boonagel_Cba')->getCurrentCurrency() . ' ' . Mage::helper('Boonagel_Cba')->formatNumber($orderDetails['grand_total'], 2) . \"\\n\"\r\n . \"7.Enter your Mpesa pin.\\n\"\r\n . \"8.Confirm and press Ok to complete payment.\\n\";\r\n $receipt = $billingAddress->getTelephone();\r\n\r\n //determine it is a kenyan number ie get the last 9 digits\r\n if ($receipt != null) {\r\n $recipients = \"+254\" . substr($receipt, -9);\r\n $this->_sendSmsAfricasTalking($smsMessage, $recipients);\r\n }\r\n\r\n /* * billing data* */\r\n /**$billingEmail = $billingAddress->getEmail();\r\n\r\n if ($billingEmail == null) {\r\n return;\r\n }\r\n $billingFirstName = $billingAddress->getFirstname();\r\n /* * * */\r\n\r\n /**$this->_sendEmailMpesaInstructions(\r\n array('firstName' => $orderDetails['customer_firstname'],\r\n 'grandTotal' => Mage::helper('Boonagel_Cba')->formatNumber($orderDetails['grand_total'], 2),\r\n 'orderIncrementId' => $orderIncrementId,\r\n 'billingEmail' => $billingEmail,\r\n 'biilingFirstName' => $billingFirstName)\r\n );**/\r\n }", "private function sendEmail(Order $order)\n\t{\n\t\t$theme=Yii::t('OrdersModule.core', 'Your order #').$order->id;\n\n\t\t$lang=Yii::app()->language;\n\t\t$emailBodyFile=Yii::getPathOfAlias(\"application.emails.$lang\").DIRECTORY_SEPARATOR.'new_order.php';\n\t\t\n\t\t// If template file does not exists use default russian translation\n\t\tif(!file_exists($emailBodyFile))\n\t\t\t$emailBodyFile=Yii::getPathOfAlias(\"application.emails.ru\").DIRECTORY_SEPARATOR.'new_order.php';\n\t\t$body = $this->renderFile($emailBodyFile, array('order'=>$order), true);\n\n\t\t$mailer = Yii::app()->mail;\n\t\t// $mailer->IsSMTP();\n\t\t$mailer->From = Yii::app()->params['adminEmail'];\n\t\t$mailer->FromName = Yii::app()->settings->get('core', 'siteName');\n\t\t$mailer->Subject = $theme;\n\t\t$mailer->Body = $body;\n\t\t$mailer->AddAddress($order->user_email);\n\t\t$mailer->AddReplyTo(Yii::app()->params['adminEmail']);\n\t\t$mailer->isHtml(true);\n\t\t$mailer->Send();\n\t\t$mailer->ClearAddresses();\n\t\t$mailer->ClearReplyTos();\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Generated from protobuf field repeated int64 orderIds = 1;
public function getOrderIds() { return $this->orderIds; }
[ "public function setOrderIds($var)\n {\n $arr = GPBUtil::checkRepeatedField($var, \\Google\\Protobuf\\Internal\\GPBType::INT64);\n $this->orderIds = $arr;\n\n return $this;\n }", "public function getIncrementalOrderIds()\n {\n $this->getResource()->setIdFieldName('order_id');\n return $this->getCollection()->getAllIds();\n\n }", "protected function _getOrderIds()\n {\n $orderIds = $this->getRequest()->getPost('order_ids');\n sort($orderIds);\n return $orderIds;\n }", "public function getOrderTypeIds();", "protected function getOrderIds()\n {\n $where = sprintf(\n '`id_shop_group` = %s AND `id_shop` = %s AND `id_lang` = %s',\n pSQL((string)NostoHelperContext::getShopGroupId()),\n pSQL((string)NostoHelperContext::getShopId()),\n pSQL((string)NostoHelperContext::getLanguageId())\n );\n\n $sql = sprintf(\n '\n SELECT id_order\n FROM %sorders\n WHERE %s\n ORDER BY date_add DESC\n LIMIT %d\n OFFSET %d\n ',\n pSQL(_DB_PREFIX_),\n $where,\n $this->limit,\n $this->offset\n );\n\n $rows = Db::getInstance()->executeS($sql);\n $orderIds = array();\n foreach ($rows as $row) {\n $orderIds[] = (int)$row['id_order'];\n }\n\n return $orderIds;\n }", "public function getRealOrderIds()\n {\n if (!$this->_realOrderIds) {\n if ($this->_cybermutResponse) {\n $this->_realOrderIds = explode(',', $this->_cybermutResponse['reference']);\n } elseif ($realOrderIds = Mage::getSingleton('checkout/session')->getCybermutRealOrderIds()) {\n $this->_realOrderIds = explode(',', $realOrderIds);\n } else {\n return array();\n }\n }\n return $this->_realOrderIds;\n }", "public function getPartnersOrdersIds()\n {\n $sql=\"SELECT client_id, rel_id FROM extension_meta WHERE extension = 'mod_partner' AND rel_type='client_order'\";\n $ids = R::getAll($sql);\n \n $result = array();\n foreach($ids as $r) {\n $result[$r['client_id']][] = $r['rel_id'];\n }\n return $result;\n }", "public function getAllOrderIds(): array\n {\n $ids = [];\n foreach ($this->getItems() as $item) {\n $ids[] = $item->getOrderId();\n }\n return $ids;\n }", "public function getIdOrders()\n {\n return $this->idOrders;\n }", "public function getProcessedOrderIds() {\n // Get the session service.\n $sessionService = $this->getContainer()->get('session');\n\n // Get session items.\n $processedOrderIds = $sessionService->get('processed_order_ids');\n if (!is_array($processedOrderIds)) {\n $processedOrderIds = array();\n }\n\n return $processedOrderIds;\n }", "private function getSimilarOrderIds(Order $order)\n {\n $query = $this->createGetSimilarQuery($order);\n\n $response = $this->match($query, 1000);\n\n return $this->getIds($response);\n }", "public function getOrderIdsCount()\n {\n return $this->count(self::order_ids);\n }", "public function getShopOrdersFromShopOrderIdsMulti()\r\n {\r\n return $this->getMulti(ShopOrder::class, [\r\n 'id' => 'shop_order_ids',\r\n ]); \r\n }", "private function getOrderIdsFromIncrementIds(array $incrementIds): array\n {\n return $this->orderCollectionFactory->create()\n ->addFieldToFilter(\n 'main_table.increment_id',\n ['in' => $incrementIds]\n )\n ->getColumnValues('entity_id');\n }", "protected function getOrderNumbers()\n {\n $incrementIds = array();\n\n // Collect orders with state 'processing' and a SAP order queue status\n // of 'delivered'\n $collection = Mage::getModel('sales/order')->getCollection();\n $collection\n ->addFieldToSelect(array('entity_id', 'increment_id'))\n //->addFieldToSelect('*')\n //->addFieldToFilter('sap_order_queue.order_id', array('notnull' => 1))\n ->addFieldToFilter('sap_order_queue.status', Inecom_Sap_Helper_Order::DELIVERED)\n // status filter disabled for development\n //->addFieldToFilter('state', 'new')\n ->addFieldToFilter('state', array(\"in\"=>array('new','processing','pending','payment_review')))\n //->addFieldToFilter('state', 'complete')\n ->getSelect()\n ->joinLeft(\n 'sap_order_queue',\n 'sap_order_queue.order_id = main_table.entity_id',\n array('sap_order_queue.order_id', 'sap_order_queue.queue_id')\n );\n\n foreach ($collection as $order) {\n $incrementIds[$order->getEntityId()] = $order->getIncrementId();\n }\n return $incrementIds;\n }", "private function generate_order_ids() {\t\t\r\n\t\t$taxcloud_ids = WT_Orders::get_meta( $this->order_id, 'taxcloud_ids' );\r\n\r\n\t\tforeach ( WT_Orders::get_meta( $this->order_id, 'lookup_data' ) as $location => $items ) {\r\n\t\t\tif ( !isset( $taxcloud_ids[ $location ] ) ) {\r\n\t\t\t\t$taxcloud_ids[ $location ] = array(\r\n\t\t\t\t\t'cart_id' => '',\r\n\t\t\t\t\t'order_id' => wootax_generate_order_id(),\r\n\t\t\t\t);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn $taxcloud_ids;\r\n\t}", "public function setIds($var)\n {\n $arr = GPBUtil::checkRepeatedField($var, \\Google\\Protobuf\\Internal\\GPBType::INT64);\n $this->ids = $arr;\n\n return $this;\n }", "public function defineOrderIDMeta() {\n\t\t$this->order_id_meta = [\n\t\t\t'alt_locations' => [ 'request' => 'order_id' ],\n\t\t\t'generate' => true, // freaking FINALLY.\n\t\t\t'disallow_decimals' => true, // hacky hack hack...\n\t\t];\n\t}", "public function providerOrderIds()\n {\n \treturn array(\n \t\tarray(2637540)\n \t);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets the current FileControllerCollection as an Iterator that lib all controllers and child route collections.
public function getIterator() { return new \ArrayIterator($this->controllers); }
[ "public function getIterator()\n {\n return new \\ArrayIterator($this->routes);\n }", "public function getIterator()\n {\n return new ArrayIterator($this->routes);\n }", "protected function getControllers()\n {\n $controllers = new Collection();\n\n if ($controller = $this->option('use-controller')) {\n $this->addControllerIfNotExists($controllers, \\app($controller));\n\n return $controllers;\n }\n\n foreach ($this->router->getRoutes() as $collections) {\n foreach ($collections as $route) {\n if ($controller = $route->getControllerInstance()) {\n $this->addControllerIfNotExists($controllers, $controller);\n }\n }\n }\n\n return $controllers;\n }", "public function getControllers()\n {\n $resources = array();\n $directory = new DirectoryIterator($this->path);\n $CcFilter = new Zend_Filter_Word_CamelCaseToDash;\n\n WHILE($directory->valid()) {\n IF($directory->isFile() && !in_array($directory->getFilename(), $this->skip, TRUE)) {\n // load the file\n REQUIRE_ONCE($directory->getPathname());\n\n $reflect = new Zend_Reflection_File($directory->getPathName());\n $name = substr(\n $reflect->getClass()->getName(),\n strrpos($reflect->getClass()->getName(), \"_\") + 1\n );\n\n $controller = new Admin_Model_DbRow_Controller(array(\n 'moduleName' => 'webdesktop',\n 'controllerName' => strtolower($name),\n 'virtual' => 1\n ));\n\n $resources[] = $controller;\n }\n $directory->next();\n }\n RETURN $resources;\n }", "public function getIterator()\n {\n return new ArrayIterator($this->_resources);\n }", "public function getIterator()\n {\n return new ArrayIterator($this->paths);\n }", "public function getIterator()\n {\n return $this->collection->getIterator();\n }", "public function getIterator()\n {\n return new \\ArrayIterator($this->models);\n }", "public function getIterator() \n {\n return new DirectoryIterator($this->path);\n }", "public function getIterator(): Generator\n {\n foreach ($this->get() as $file) {\n yield new File($file, true);\n }\n }", "public function getIterator()\n {\n return new \\ArrayIterator($this->parts);\n }", "#[\\ReturnTypeWillChange]\n public function getIterator(): \\Traversable\n {\n return new ArrayIterator($this->_actions);\n }", "public function getIterator() {\n\t\treturn $this->children; \n\t}", "public function getIterator()\n\t{\n\t\treturn new \\Framework\\Model\\CModelIterator($this);\n\t}", "public function getIterator()\n {\n return $this->items;\n }", "public function getIterator() {\n\t\tif (!$this->loaded) $this->load();\n\t\t\n\t\treturn parent::getIterator();\n\t}", "private function __getControllers()\n {\n $path = App::path('Controller');\n $dir = new Folder($path[0]);\n $files = $dir->findRecursive('.*Controller\\.php');\n $results = [];\n foreach ($files as $file) {\n $controller = str_replace(App::path('Controller'), '', $file);\n $controller = explode('.', $controller)[0];\n $controller = str_replace('Controller', '', $controller);\n array_push($results, $controller);\n }\n\n return $results;\n }", "public function iterateDirectory()\n\t{\n\t\treturn new FilesystemIterator($this->getPath());\t\n\t}", "public function getIterator()\n {\n return new \\IteratorIterator($this->devices);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Getter and Setter for messageBody
public function getMessageBody() { return $this->messageBody; }
[ "abstract public function setMessageBody($messageBody);", "public function getMessageBody()\n {\n return $this->messageBody;\n }", "protected function setMessageBody( $message_body ){\r\n \r\n $this->message_body = $message_body;\r\n \r\n }", "public function getBody() {\n return @$this->message['body'];\n }", "public function getCustomizedMessageBody()\n {\n if (array_key_exists(\"customizedMessageBody\", $this->_propDict)) {\n return $this->_propDict[\"customizedMessageBody\"];\n } else {\n return null;\n }\n }", "public function setBody() {\n }", "public function setBody( $body );", "protected function _adMessageBody()\r\n\t{\r\n\t}", "public function getRawBody()\n {\n return $this->job->msgBody;\n }", "function setBody($value) {\n return $this->setFieldValue('body', $value);\n }", "public function getBody()\n {\n return $this->body;\n }", "public function getBody()\n {\n if (!isset($this->body)) {\n $this->body = $this->createDefaultBody();\n }\n \n return $this->body;\n }", "public function setBody($var)\n {\n GPBUtil::checkMessage($var, \\Chat\\proto\\Body::class);\n $this->body = $var;\n\n return $this;\n }", "public function getRawBody()\n {\n return $this->job->getMessageBody();\n }", "public function readBody()\n {\n $targetURI = $this->_inputStream->readUtf();\n $responseURI = $this->_inputStream->readUtf();\n $length = $this->_inputStream->readLong();\n\n try {\n $data = $this->_deserializer->readTypeMarker();\n } catch (Exception $e) {\n require_once 'Zend/Amf/Exception.php';\n throw new Zend_Amf_Exception('Unable to parse ' . $targetURI . ' body data ' . $e->getMessage(), 0, $e);\n }\n\n // Check for AMF3 objectEncoding\n if ($this->_deserializer->getObjectEncoding() == Zend_Amf_Constants::AMF3_OBJECT_ENCODING) {\n /*\n * When and AMF3 message is sent to the server it is nested inside\n * an AMF0 array called Content. The following code gets the object\n * out of the content array and sets it as the message data.\n */\n if(is_array($data) && $data[0] instanceof Zend_Amf_Value_Messaging_AbstractMessage){\n $data = $data[0];\n }\n\n // set the encoding so we return our message in AMF3\n $this->_objectEncoding = Zend_Amf_Constants::AMF3_OBJECT_ENCODING;\n }\n\n return new Zend_Amf_Value_MessageBody($targetURI, $responseURI, $data);\n }", "public function getAppMsgBody ()\n {\n\n return $this->app_msg_body;\n }", "function decode_message_body()\n\t{\n\t\t$this->body = decode_string($this->body, $this->headers['content-transfer-encoding'], $this->headers['__other_hdr__']['content-type']['charset']);\n\t}", "public function setPlainBody(string $body): IMessage {\n\t\t$this->swiftMessage->setBody($body);\n\t\treturn $this;\n\t}", "public function setBody()\n {\n $body = '';\n \n $body .= \"Hey there,\\n\\n\";\n $body .= \"Someone new has signed up to meditate.\";\n $body .= \"\\n\\nYour friendly server robots\";\n \n $this->body = $body;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Lists all GoodsPromotion models.
public function actionPromotion(){ $searchModel = new GoodsPromotionSearch(); $dataProvider = $searchModel->search(ArrayHelper::merge(Yii::$app->request->queryParams, [$searchModel->formName() => [ 'status' => GoodsPromotion::STATUS_ENABLE, ]]), 1); $pageSize = Yii::$app->request->get($dataProvider->Pagination->pageSizeParam); $dataProvider->Pagination->pageSize = $pageSize ? $pageSize : $dataProvider->Pagination->pageSize; $returnData = [ 'data' => [], ]; foreach ($dataProvider->getModels() as $model) { $returnData['data'] = $model->toArray(); } if (isset($returnData['data']['json'])){ $returnData['data'] = json_decode($returnData['data']['json']); } $returnData['page'] = [ 'link' => $dataProvider->Pagination->getLinks(), 'totalCount' => $dataProvider->Pagination->totalCount, 'pageSize' => $dataProvider->Pagination->getPageSize(), 'pageCount' => $dataProvider->Pagination->getPageCount(), ]; return $this->result(0,$returnData,'success'); }
[ "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('WoojinGoodsBundle:Promotion')->findAll();\n\n return array(\n 'entities' => $entities,\n );\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $promotions = $em->getRepository('AppBundle:Promotion')->findAll();\n\n return $this->render('promotion/index.html.twig', array(\n 'promotions' => $promotions,\n ));\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getEntityManager();\n\n $entities = $em->getRepository('AngeAngeBundle:Promotion')->findAll();\n\n return $this->render('AngeAngeBundle:Promotion:index.html.twig', array(\n 'entities' => $entities\n ));\n }", "public function getAllPromos(){\r\n \t$this->campMod->getAllPromos();\r\n }", "public function getAllPromos();", "public function promotions()\n {\n return $this->hasMany(Promotion::class);\n }", "public function index()\n\t{\n\t\t$promotions = $this->promotionRepository->paginate(10);\n\n\t\treturn view('promotions.index')\n\t\t\t->with('promotions', $promotions);\n\t}", "public function actionIndex()\n {\n $searchModel = new PromotionSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "static function getAll() {\n\t\tglobal $db;\n\t\t$ga = array();\n\t\ttry {\n\t\t\t$stmt = $db->query(\"Select promoId From promotions Order by promoId;\");\n\t\t\twhile ($row = $stmt->fetchObject()) {\n\t\t\t\t$ga[] = new Promotion($row->promoId);\n\t\t\t}\n\t\t\t$stmt->closeCursor();\n\t\t} catch (PDOException $e) {\n\t\t\tdebug('Promotion / getAll() / ' . $e->getMessage());\n\t\t}\n\t\treturn $ga;\n\t}", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('C2JEasySaisieBundle:StudentPromotion')->findAll();\n\n return array(\n 'entities' => $entities,\n );\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n $produitEnPromotions = $em->getRepository('AppBundle:ProduitEnPromotion')->findAll();\n\n\n return $this->render('produitenpromotion/index.html.twig', array(\n 'produitEnPromotions' => $produitEnPromotions,\n ));\n }", "public function indexAction() {\n $em = $this->getDoctrine()->getManager();\n\n $promos = $em->getRepository('CoreBundle:Promo')->findAll();\n\n return $this->render('promo/index.html.twig', array(\n 'promos' => $promos,\n ));\n }", "public function produtos()\n {\n return Produto::All();\n }", "function loadPromotions() {\n $promotions = Promotion::paginate(10);\n \n return view('cms.promotions', ['promotions' => $promotions]);\n }", "public function promotions()\n {\n return $this->belongsToMany(Promotion::class, 'product_promotions');\n }", "public function all() {\n return $this->app->entityManager->getRepository($this->model_name)->findAll();\n }", "public static function getShopList()\n {\n return (new shopModel())->getList();\n }", "public function getAll()\n {\n return R::findAll('webshop');\n }", "function viewPromotedProducts(){\n $product = new productModel();\n\n return $product->viewPromoted();\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
convert the prop array into a valid css definition
function _style2string($prop_arr, $multiline=TRUE) { $out = ''; $delm = $multiline ? "\n" : ''; $spacer = $multiline ? ' ' : ''; $indent = $multiline ? $this->indent_chars : ''; if (is_array($prop_arr)) foreach ($prop_arr as $prop => $value) if (strlen($value)) $out .= sprintf('%s%s:%s%s;%s', $indent, $prop, $spacer, $value, $delm); return $out; }
[ "function css_from_array( $css_array ) {\n\t$css_text = '';\n\tforeach ( $css_array as $selector => $style ) {\n\t\t$css_text .= ' ' . $selector . ' { ';\n\t\tforeach ( $style as $attribute => $value ) {\n\t\t\t$css_text .= $attribute . ': ' . $value . '; ';\n\t\t}\n\t\t$css_text .= ' }';\n\t}\n\treturn $css_text;\n}", "function convert_array_css($array){ \n return implode(';', array_map(\n function ($v, $k) { return sprintf(\"%s:%s\", $k, $v); },\n $array,\n array_keys($array)\n ));\n}", "function combine_props_list($props) {\n\t\t// each call sends the current part of the stylesheet being worked on,\n\t\t// the combined property,\n\t\t// the parts which makes up this property\n\n\t\t$props = $this->combine_props($props, 'padding', array('padding-top', 'padding-right', 'padding-bottom', 'padding-left'));\n\n\t\t$props = $this->combine_props($props, 'margin', array('margin-top', 'margin-right', 'margin-bottom', 'margin-left'));\n\n\t\t$props = $this->combine_props($props, 'list-style', array('list-style-type', 'list-style-position', 'list-style-image'));\n\t\t$props = $this->combine_props($props, 'list-style', array('list-style-type', 'list-style-position'));\n\n\t\t$props = $this->combine_props($props, 'outline', array('outline-color', 'outline-style', 'outline-width'));\n\n\t\t// to do: this might be improvable\n\t\t$props = $this->combine_props($props, 'background', array('background-color', 'background-image', 'background-repeat', 'background-attachment', 'background-position'));\n\n\t\t// to do: combine all border-[places] if they're the same (need a special function for that)\n\t\t$props = $this->combine_props($props, 'border-bottom', array('border-bottom-width', 'border-bottom-style', 'border-bottom-color'));\n\t\t$props = $this->combine_props($props, 'border-top', array('border-top-width', 'border-top-style', 'border-top-color'));\n\t\t$props = $this->combine_props($props, 'border-left', array('border-left-width', 'border-left-style', 'border-left-color'));\n\t\t$props = $this->combine_props($props, 'border-right', array('border-right-width', 'border-right-style', 'border-right-color'));\n\n\t\t// to do: this needs some checking\n\t\t$props = $this->combine_props($props, 'font', array('font-style', 'font-variant', 'font-weight', 'font-size', 'line-height', 'font-family'));\n\t\t$props = $this->combine_props($props, 'font', array('font-style', 'font-variant', 'font-weight', 'font-size', 'font-family'));\n\t\t$props = $this->combine_props($props, 'font', array('font-variant', 'font-weight', 'font-size', 'line-height', 'font-family'));\n\t\t$props = $this->combine_props($props, 'font', array('font-style', 'font-weight', 'font-size', 'line-height', 'font-family'));\n\t\t$props = $this->combine_props($props, 'font', array('font-style', 'font-variant', 'font-size', 'line-height', 'font-family'));\n\t\t$props = $this->combine_props($props, 'font', array('font-variant', 'font-weight', 'font-size', 'font-family'));\n\t\t$props = $this->combine_props($props, 'font', array('font-style', 'font-weight', 'font-size', 'font-family'));\n\t\t$props = $this->combine_props($props, 'font', array('font-style', 'font-variant', 'font-size', 'font-family'));\n\t\t$props = $this->combine_props($props, 'font', array('font-variant', 'font-size', 'font-family'));\n\t\t$props = $this->combine_props($props, 'font', array('font-weight', 'font-size', 'font-family'));\n\t\t$props = $this->combine_props($props, 'font', array('font-style', 'font-size', 'font-family'));\n\t\t\n\t\treturn $props;\n\t}", "private function compile_css() {\n\t\t$helpers = new Fusion_Dynamic_CSS_Helpers();\n\t\treturn $helpers->parser( self::$styles_array, true );\n\t}", "private function _parse_properties($str) {\n $properties = preg_split(\"/;(?=(?:[^\\(]*\\([^\\)]*\\))*(?![^\\)]*\\)))/\", $str);\n\n // Create the style\n $style = new StyleParser($this);\n foreach ($properties as $prop) {\n // If the $prop contains an url, the regex may be wrong\n // @todo: fix the regex so that it works everytime\n /*if (strpos($prop, \"url(\") === false) {\n if (preg_match(\"/([a-z-]+)\\s*:\\s*[^:]+$/i\", $prop, $m))\n $prop = $m[0];\n }*/\n //A css property can have \" ! important\" appended (whitespace optional)\n //strip this off to decode core of the property correctly.\n //Pass on in the style to allow proper handling:\n //!important properties can only be overridden by other !important ones.\n //$style->$prop_name = is a shortcut of $style->__set($prop_name,$value);.\n //If no specific set function available, set _props[\"prop_name\"]\n //style is always copied completely, or $_props handled separately\n //Therefore set a _important_props[\"prop_name\"]=true to indicate the modifier\n\n /* Instead of short code, prefer the typical case with fast code\n $important = preg_match(\"/(.*?)!\\s*important/\",$prop,$match);\n if ( $important ) {\n $prop = $match[1];\n }\n $prop = trim($prop);\n */\n\n $important = false;\n $prop = trim($prop);\n if (substr($prop,-9) === 'important') {\n $prop_tmp = rtrim(substr($prop,0,-9));\n if (substr($prop_tmp,-1) === '!') {\n $prop = rtrim(substr($prop_tmp,0,-1));\n $important = true;\n }\n }\n\n if ($prop == \"\") {\n continue;\n }\n\n $i = mb_strpos($prop, \":\");\n if ( $i === false ) {\n continue;\n }\n\n $prop_name = rtrim(mb_strtolower(mb_substr($prop, 0, $i)));\n $value = ltrim(mb_substr($prop, $i+1));\n\n //New style, anyway empty\n //if ($important || !$style->important_get($prop_name) ) {\n //$style->$prop_name = array($value,$important);\n //assignment might be replaced by overloading through __set,\n //and overloaded functions might check _important_props,\n //therefore set _important_props first.\n if ($important) {\n $style->important_set($prop_name);\n }\n //For easier debugging, don't use overloading of assignments with __set\n $style->$prop_name = $value;\n //$style->props_set($prop_name, $value);\n }\n\n return $style;\n }", "function _convert_raw_css()\n {\n $this->tokens = array();\n\n foreach ($this->css as $medium => $val)\n {\n if ($this->parser->get_cfg('sort_selectors')) ksort($val);\n if ($medium != DEFAULT_AT) {\n $this->parser->_add_token(AT_START, $medium, true);\n }\n\n foreach ($val as $selector => $vali)\n {\n if ($this->parser->get_cfg('sort_properties')) ksort($vali);\n $this->parser->_add_token(SEL_START, $selector, true);\n\n foreach ($vali as $property => $valj)\n {\n $this->parser->_add_token(PROPERTY, $property, true);\n $this->parser->_add_token(VALUE, $valj, true);\n }\n\n $this->parser->_add_token(SEL_END, $selector, true);\n }\n\n if ($medium != DEFAULT_AT) {\n $this->parser->_add_token(AT_END, $medium, true);\n }\n }\n }", "function csstoolsexp_array_to_pythonified($css_array)\n{\n $css_pythonified = '';\n foreach ($css_array as $media_query => $ruleset) {\n $css_pythonified .= \"\\n\" . $media_query;\n foreach ($ruleset as $selector => $declarations) {\n $css_pythonfied .= \"\\n\\t\" . $selector;\n foreach ($declarations as $property => $value) {\n $css_pythonified .= \"\\n\\t\\t\" . $property . ': ' . $value;\n } \n }\n }\n return trim($css_pythonified);\n}", "function arrayToCss($array){\n $css = '';\n if(is_array($array) && count($array) > 0) {\n foreach($array as $level_1_key => $level_1_value) {\n $css .= stripslashes($level_1_key).\" {\\n\";\n foreach($level_1_value as $level_2_key=>$level_2_value) {\n $css .= \"\\t\".stripslashes($level_2_key).\" : \".stripslashes($level_2_value).\";\\n\";\n }\n $css .= \"}\\n\";\n }\n }\n return $css;\n}", "function css($array) {\n return implode('; ', array_map(\n function($k, $v) { return $k . ': ' . $v; }, \n array_keys($array), \n array_values($array)\n )\n );\n}", "public function parse_db_to_css($css_array, $nl = \"\\n\\r\"){\n\t\t$css = '';\n\t\t$deformations = $this->get_deformation_css_tags();\n\t\t\n\t\t$transparency = array(\n\t\t\t'color'\t\t\t\t=> 'color-transparency',\n\t\t\t'background-color'\t=> 'background-transparency',\n\t\t\t'border-color'\t\t=> 'border-transparency'\n\t\t);\n\t\t\n\t\t$check_parameters = array(\n\t\t\t'border-width'\t=> 'px',\n\t\t\t'border-radius'\t=> 'px',\n\t\t\t'padding'\t\t=> 'px',\n\t\t\t'font-size'\t\t=> 'px',\n\t\t\t'line-height'\t=> 'px'\n\t\t);\n\t\t\n\t\tforeach($css_array as $id => $attr){\n\t\t\t$stripped\t= (strpos($attr['handle'], '.tp-caption') !== false) ? trim(str_replace('.tp-caption', '', $attr['handle'])) : '';\n\t\t\t$attr['advanced'] = json_decode($attr['advanced'], true);\n\t\t\t$styles\t\t= json_decode(str_replace(\"'\", '\"', $attr['params']), true);\n\t\t\t$styles_adv\t= $attr['advanced']['idle'];\n\t\t\t$css\t\t.= $attr['handle'];\n\t\t\t$css\t\t.= (!empty($stripped)) ? ', '.$stripped : '';\n\t\t\t$css\t\t.= ' {'.$nl;\n\t\t\t\n\t\t\tif(is_array($styles) || is_array($styles_adv)){\n\t\t\t\tif(is_array($styles)){\n\t\t\t\t\tforeach($styles as $name => $style){\n\t\t\t\t\t\tif(in_array($name, $deformations) && $name !== 'cursor') continue;\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(!is_array($name) && isset($transparency[$name])){ //the style can have transparency!\n\t\t\t\t\t\t\tif(isset($styles[$transparency[$name]]) && $style !== 'transparent'){\n\t\t\t\t\t\t\t\t$style = $this->hex2rgba($style, $styles[$transparency[$name]] * 100);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(!is_array($name) && isset($check_parameters[$name])){\n\t\t\t\t\t\t\t$style = $this->add_missing_val($style, $check_parameters[$name]);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(is_array($style) || is_object($style)) $style = implode(' ', $style);\n\t\t\t\t\t\t\n\t\t\t\t\t\t$ret = $this->check_for_modifications($name, $style);\n\t\t\t\t\t\tif($ret['name'] == 'cursor' && $ret['style'] == 'auto') continue;\n\t\t\t\t\t\t\n\t\t\t\t\t\t$css .= $ret['name'].':'.$ret['style'].\";\".$nl;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(is_array($styles_adv)){\n\t\t\t\t\tforeach($styles_adv as $name => $style){\n\t\t\t\t\t\tif(in_array($name, $deformations) && $name !== 'cursor') continue;\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(is_array($style) || is_object($style)) $style = implode(' ', $style);\n\t\t\t\t\t\t$ret = $this->check_for_modifications($name, $style);\n\t\t\t\t\t\tif($ret['name'] == 'cursor' && $ret['style'] == 'auto') continue;\n\t\t\t\t\t\t$css .= $ret['name'].':'.$ret['style'].\";\".$nl;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t$css .= '}'.$nl.$nl;\n\t\t\t\n\t\t\t//add hover\n\t\t\t$setting = json_decode($attr['settings'], true);\n\t\t\tif(isset($setting['hover']) && $setting['hover'] == 'true'){\n\t\t\t\t$hover = json_decode(str_replace(\"'\", '\"', $attr['hover']), true);\n\t\t\t\t$hover_adv = $attr['advanced']['hover'];\n\t\t\t\t\n\t\t\t\tif(is_array($hover) || is_array($hover_adv)){\n\t\t\t\t\t$css .= $attr['handle'].':hover';\n\t\t\t\t\tif(!empty($stripped)) $css .= ', '.$stripped.':hover';\n\t\t\t\t\t$css .= ' {'.$nl;\n\t\t\t\t\tif(is_array($hover)){\n\t\t\t\t\t\tforeach($hover as $name => $style){\n\t\t\t\t\t\t\tif(in_array($name, $deformations) && $name !== 'cursor') continue;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif(!is_array($name) && isset($transparency[$name])){ //the style can have transparency!\n\t\t\t\t\t\t\t\tif(isset($hover[$transparency[$name]]) && $style !== 'transparent'){\n\t\t\t\t\t\t\t\t\t$style = $this->hex2rgba($style, $hover[$transparency[$name]] * 100);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif(!is_array($name) && isset($check_parameters[$name])){\n\t\t\t\t\t\t\t\t$style = $this->add_missing_val($style, $check_parameters[$name]);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif(is_array($style)|| is_object($style)) $style = implode(' ', $style);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$ret = $this->check_for_modifications($name, $style);\n\t\t\t\t\t\t\tif($ret['name'] == 'cursor' && $ret['style'] == 'auto') continue;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$css .= $ret['name'].':'.$ret['style'].\";\".$nl;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif(is_array($hover_adv)){\n\t\t\t\t\t\tforeach($hover_adv as $name => $style){\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif(in_array($name, $deformations) && $name !== 'cursor') continue;\n\t\t\t\t\t\t\tif(is_array($style)|| is_object($style)) $style = implode(' ', $style);\n\t\t\t\t\t\t\t$ret = $this->check_for_modifications($name, $style);\n\t\t\t\t\t\t\tif($ret['name'] == 'cursor' && $ret['style'] == 'auto') continue;\n\t\t\t\t\t\t\t$css .= $ret['name'].':'.$ret['style'].\";\".$nl;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$css .= '}'.$nl.$nl;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $css;\n\t}", "public static function toCssStyles(array $array): string\n {\n $styleList = static::wrap($array);\n\n $styles = [];\n\n foreach ($styleList as $class => $constraint) {\n if (is_numeric($class)) {\n $styles[] = Text::finish($constraint, ';');\n } elseif ($constraint) {\n $styles[] = Text::finish($class, ';');\n }\n }\n\n return implode(' ', $styles);\n }", "public function getStyles()\n\t{\n\t\t$array = array();\n\t\t$properties = func_get_args();\n\t\tforeach($properties as $property)\n\t\t{\n\t\t\t$array[(string)$property] = $this->getStyle($property);\n\t\t}\n\n\t\treturn $array;\n\t}", "function nl_readCSS($css)\n{\n\n $styles = array();\n\n // Match rule sets.\n $re = '/[^{]+\\s*\\{\\s*[^}]+\\s*}/';\n preg_match_all($re, $css, $matches);\n foreach ($matches[0] as $set) {\n\n // Match selector.\n $re = '/\\.(?P<selector>[a-z0-9_]+)\\s*\\{/';\n preg_match($re, $set, $matches);\n $selector = $matches['selector'];\n $styles[$selector] = array();\n\n // Match rules.\n $re = '/[a-z0-9-]+:\\s*[^;]+;/';\n preg_match_all($re, $set, $matches);\n foreach ($matches[0] as $rule) {\n\n // Match property.\n $re = '/(?P<property>[a-z0-9-]+)\\s*:/';\n preg_match($re, $rule, $matches);\n $prop = str_replace('-', '_', $matches['property']);\n\n // Match value.\n $re = '/:\\s*(?P<value>[^;]+)\\s*;/';\n preg_match($re, $rule, $matches);\n $val = $matches['value'];\n\n // Add to array.\n $styles[$selector][$prop] = $val;\n\n }\n\n }\n\n return $styles;\n\n}", "private static function objectify_css($css)\n {\n $css = explode('}', $css);\n \n $parsed = new StdClass;\n foreach($css as $line)\n {\n if(empty($line[0]))\n continue; \n $line = explode('{', $line);\n $element = trim($line[0]);\n $parsed->$element = trim($line[1]);\n }\n return $parsed;\n }", "static private function properties (array $props)\n {\n return \"<h6>Assigned properties</h6><table class=grid>\n\" . str_replace ([\"'\", '...'], [\"<i>'</i>\", '<i>...</i>'], implode ('',\n map ($props, function ($v, $k) {\n return \"<tr><th>$k<td>\" .\n (is_string ($v) ? \"'\" . htmlspecialchars (trimText ($v, 300, '...')) . \"'\" : Debug::toString ($v));\n })), $o) . \"\n</table>\";\n }", "public function getStyleArray($array)\n {\n switch ($this->_parentPropertyName) {\n case '_endColor':\n $key = 'endcolor';\n break;\n \n case '_color':\n $key = 'color';\n break;\n \n case '_startColor':\n $key = 'startcolor';\n break;\n }\n return $this->_parent->getStyleArray(array(\n $key => $array\n ));\n }", "private function _generateStylesString()\n\t{\n\t\t$sTemp = PXH_EMPTY_STRING;\n\n\t\tforeach ($this->_asStyles as $sN => $sV)\n\t\t{\n\t\t\tif (_sl($sV))\n\t\t\t{\n\t\t\t\t$sTemp .= $sN.\":\".$sV.\";\";\n\t\t\t}\n\t\t}\n\n\t\tif (_sl($sTemp))\n\t\t{\n\t\t\t$this->_hsAttrs2[\"style\"] = $sTemp;\n\t\t}\n\t}", "function csstoolsexp_box_side_properties($property)\n{\n if (preg_match('/^(.*)\\-(width|style|color)$/', $property, $m)) {\n $p = $m[1];\n $s = '-' . $m[2];\n } else {\n $p = $property;\n $s = '';\n }\n \n return array(\n $p . '-top' . $s,\n $p . '-right' . $s,\n $p . '-bottom' . $s,\n $p . '-left' . $s,\n );\n}", "function wp_typography_get_css_variable_inline_style($attributes, $feature, $css_property)\n {\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns validators for DETAIL_PAGE_URL field.
public static function validateDetailPageUrl() { return array( new Entity\Validator\Length(null, 255), ); }
[ "public static function validateDetailUrl()\n {\n return array(\n new Entity\\Validator\\Length(null, 255),\n );\n }", "private function getURLValidator()\n {\n $validator = function ($value) {\n $result = filter_var($value, FILTER_VALIDATE_URL, FILTER_FLAG_SCHEME_REQUIRED);\n if ($result === false) {\n throw new \\Exception('Please enter a valid URL.', 1405361650);\n }\n\n return $result;\n };\n\n return $validator;\n }", "private function sitesValidationRules() {\n $rules = [\n 'confirm_ownership' => 'required'\n ];\n\n foreach (request('sites') as $key => $val) {\n if ($val) {\n $rules['sites.' . $key] = function ($attribute, $value, $fail) {\n $host = parse_url($value, PHP_URL_HOST);\n if (!$host) {\n $match = preg_match('/^([\\w-]+\\.)*[\\w\\-]+\\.\\w{2,10}$/', $value);\n if (!$match) {\n $fail(\n \"Please enter a valid URL (e.g. 'https://www.example.com') or domain (e.g. 'example.com').\"\n );\n }\n }\n };\n }\n }\n\n return $rules;\n }", "private function makeValidURIRule()\n\t{\n\t\treturn function($field, $value)\n\t\t{\n\t $c_page_uri = preg_replace(\"#[^a-zA-Z0-9_\\-/\\.]+$#i\", '',\n\t str_replace(ee()->config->item('site_url'), '', $value));\n\n\t if ($c_page_uri !== $value)\n\t {\n\t return 'invalid_page_uri';\n\t }\n\n\t\t\treturn TRUE;\n\t\t};\n\t}", "public static function validateYmlUrl()\n\t{\n\t\treturn array(\n\t\t\tnew Main\\Entity\\Validator\\Length(null, 255),\n\t\t);\n\t}", "public function getValidationUrl()\n {\n return $this->getUrl('customer/*/validate', ['_current' => true]);\n }", "public function getValidationUrl()\r\n {\r\n return $this->getUrl('*/*/validate', array('_current'=>true));\r\n }", "public function getValidationUrl()\n {\n return $this->getUrl('*/*/validate', ['_current' => true]);\n }", "public function getValidationUrl()\n {\n return $this->helper('breadcheckout')->getValidateTotalsUrl();\n }", "public function isUrl()\n {\n return \\Yana\\Data\\UrlValidator::validate($this->_getValue());\n }", "private function AddUrlField()\n {\n $name = 'Url';\n $this->AddField(Input::Text($name, $this->page->GetUrl()));\n $this->SetRequired($name);\n $this->AddValidator($name, DatabaseCount::UniqueFieldAnd($this->page, $name, $this->SiteCondition()));\n }", "public static function validatePersonalPager()\n {\n return [\n new LengthValidator(null, 255),\n ];\n }", "public static function validateBotHandlerUrl()\n {\n return array(\n new Main\\Entity\\Validator\\Length(null, 2048),\n );\n }", "public function isValidUrlInvalidRessourceDataProvider() {}", "public function pageValidator(){\n $this->runValidation(new ReqValidator($this, ['field'=>'title', 'msg' => 'Title is required.']));\n $this->runValidation(new UniqueValidator($this, ['field'=>'title', 'msg' => 'This title already exists. Page titles must be unique']));\n $this->runValidation(new MaxValidator($this, ['field'=>'title', 'rule'=>80, 'msg' => 'Title must be less than 80 characters']));\n $this->runValidation(new AlphaNumValidator($this, ['field'=>'title', 'msg' => 'Title can only contain letters, numbers and spaces']));\n if(isset($this->intro)){\n $this->runValidation(new MaxValidator($this, ['field'=>'intro', 'rule'=>200, 'msg' => 'Intro must be less than 200 characters']));\n }\n $this->runValidation(new ReqValidator($this, ['field'=>'content', 'msg' => 'Content is required.']));\n $this->runValidation(new ReqValidator($this, ['field'=>'page_type', 'msg' => 'Page type is required.']));\n $this->runValidation(new NumericValidator($this, ['field'=>'page_type', 'msg' => 'Page type is incorrect.']));\n }", "public function pageurlvalidationAction() {\n\n $this->validateRequestMethod();\n\n $page_url = $this->_getParam('page_url');\n if (!$page_url)\n $this->respondWithValidationError('parameter_missing', array('page_url' => \"parameter named page_url missing\"));\n\n $sitepageUrlEnabled = Engine_Api::_()->getDbtable('modules', 'core')->isModuleEnabled('sitepageurl');\n if (!empty($sitepageUrlEnabled)) {\n $urlArray = Engine_Api::_()->sitepage()->getBannedUrls();\n }\n if (empty($page_url)) {\n $this->respondWithValidationError('urlNotvalid', \"Url not valid\");\n }\n\n $url_lenght = strlen($page_url);\n if ($url_lenght < 3) {\n $this->respondWithValidationError('urlNotvalid', \"Url should be atleast 3 characters long\");\n } elseif ($url_lenght > 255) {\n $this->respondWithValidationError('urlNotvalid', \"url should be atmost 255 characters long\");\n }\n\n $change_url = Engine_Api::_()->getApi('settings', 'core')->getSetting('sitepage.change.url', 1);\n $check_url = $this->_getParam('check_url');\n if (!empty($check_url)) {\n $pageId = $this->_getParam('page_id');\n $page_id = Engine_Api::_()->sitepage()->getPageId($page_url, $pageId);\n } else {\n $page_id = Engine_Api::_()->sitepage()->getPageId($page_url);\n }\n if (!empty($sitepageUrlEnabled)) {\n if (!empty($page_id) || (in_array(strtolower($page_url), $urlArray))) {\n $this->respondWithValidationError('urlNotvalid', \"Url not available\");\n }\n } else {\n if (!empty($page_id)) {\n $this->respondWithValidationError('urlNotvalid', \"Url not available\");\n }\n }\n\n\n\n if (!preg_match(\"/^[a-zA-Z0-9-_]+$/\", $page_url)) {\n $this->respondWithValidationError('urlNotvalid', \"URL component can contain alphabets, numbers, underscores & dashes only\");\n } else {\n $this->successResponseNoContent('no_content');\n }\n }", "public static function validateUri()\n\t{\n\t\treturn array(\n\t\t\tnew Main\\Entity\\Validator\\Length(null, 2000),\n\t\t);\n\t}", "public function get_allowed_urls()\n {\n }", "public static function validators() {\n return [\n 'application_id' => 'validateApplicationId',\n 'infra_id' => 'validateInfraId',\n 'name' => 'validateName',\n 'price' => 'validatePrice',\n 'version' => 'validateVersion'\n ];\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Adds a new rule to a property
public function addPropertyRule(string $property, Rule $rule): void;
[ "abstract protected function addRule($rule);", "function _add_rule( $oRule )\n\t{\n\t\t$this->_aoRules[] = $oRule;\n\t}", "public function add($rule)\n {\n $this->_rules[] = $rule;\n }", "public function addRule(bnfRule $rule){\n\t\t$this->rules[] = $rule;\t\t\n\t}", "public function addRule(Rule\\RuleIface $rule);", "public function add(Rule $rule)\n {\n $this->rules[] = $rule;\n }", "public function addRule(\\PricePolicyRule\\Rule $rule) {\n $this->rules[] = $rule;\n }", "public function addRule(Rule $rule)\n {\n $this->addReason(spl_object_hash($rule), array(\n 'rule' => $rule,\n 'job' => $rule->getJob(),\n ));\n }", "public function addRule(ScssRule $rule)\n {\n $this->list[] = $rule;\n }", "public function add_rule(css_rule $newrule) {\n foreach ($newrule->split_by_selector() as $rule) {\n $hash = $rule->get_selector_hash();\n if (!array_key_exists($hash, $this->rules)) {\n $this->rules[$hash] = $rule;\n } else {\n $this->rules[$hash]->add_styles($rule->get_styles());\n }\n }\n }", "public function addRule(IRouterRule $rule) {\n $this->rules[] = $rule;\n }", "function addrule($x)\n {\n $x = func_get_args();\n // if (isset($this->rules) == FALSE) $this->rules = array();\n array_push($this->rules, $x);\n }", "public function addRule()\n {\n $args = func_get_args();\n $argsCount = count($args);\n\n $role = null;\n $resource = null;\n $action = null;\n\n if ( $argsCount == 4 || $argsCount == 3 ) {\n $role = $args[0];\n $resource = $args[1];\n $rule = $args[2];\n if ( $argsCount == 4) {\n $action = $args[3];\n }\n } elseif( $argsCount == 2 ) {\n $rule = $args[0];\n $action = $args[1];\n } elseif ( $argsCount == 1 ) {\n $rule = $args[0];\n } else {\n throw new InvalidArgumentException(__METHOD__ . ' accepts only one, tow, three or four arguments');\n }\n\n if ( ! is_null($role) && ! $role instanceof Role ) {\n throw new InvalidArgumentException('Role must be an instance of SimpleAcl\\Role or null');\n }\n\n if ( ! is_null($resource) && ! $resource instanceof Resource ) {\n throw new InvalidArgumentException('Resource must be an instance of SimpleAcl\\Resource or null');\n }\n\n if ( is_string($rule) ) {\n $ruleClass = $this->getRuleClass();\n $rule = new $ruleClass($rule);\n }\n\n if ( ! $rule instanceof Rule ) {\n throw new InvalidArgumentException('Rule must be an instance of SimpleAcl\\Rule or string');\n }\n\n if ( $exchange = $this->hasRule($rule) ) {\n $rule = $exchange;\n }\n\n if ( ! $exchange ) {\n $this->rules[] = $rule;\n }\n\n if ( $argsCount == 3 || $argsCount == 4 ) {\n $rule->setRole($role);\n $rule->setResource($resource);\n }\n\n if ( $argsCount == 2 || $argsCount == 4 ) {\n $rule->setAction($action);\n }\n }", "public function add_rule( WP_Autoload_Rule $rule );", "public function rule($column, Rule $rule)\n\t{\n\t\t//Make sure the property exists.\n\t\t$this->model->hasProperty($column);\n\t\tif($rule instanceof RequiredRule){\n\t\t\t$this->required[] = $column;\n\t\t}\n\t\t//Get the rules for this property.\n\t\t$rules = $this->rules->get($column);\n\t\tif($rules === null){\n\t\t\t$rules = array();\n\t\t}\n\t\t$rules[] = $rule;\n\t\t$this->rules->set($column, $rules);\t\t\t\t\n\t}", "public static function addRule()\n {\n $args = func_get_args();\n if (is_array($args[0]))\n {\n foreach ($args[0] as $path => $arg_keys)\n {\n self::$router_rule_list[self::tidyPath($path)] = $arg_keys;\n }\n }\n else\n {\n self::$router_rule_list[self::tidyPath($args[0])] = $args[1];\n }\n }", "public function addRule(string $attribute, $rule): void\n {\n if (empty($this->rules[$attribute])) {\n $this->rules[$attribute] = [];\n }\n if (!is_array($this->rules[$attribute])) {\n if (is_string($this->rules[$attribute])) {\n $this->rules[$attribute] = array_map(function ($item) {\n return $item;\n }, explode('|', $this->rules[$attribute]));\n } else {\n $this->rules[$attribute] = array($this->rules[$attribute]);\n }\n }\n $this->rules[$attribute][] = $rule;\n }", "public function addProperty($property);", "public function addRule(Rule $rule): Manager\n {\n $this->rules[] = $rule;\n return $this;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
======================================================================= Convert statsArray to a flat one dimensional array
protected function flatoutStatsArray($array, $basekey) { $result = array(); $dirDetails = new FileDetails($basekey); $dirDetails->mimeType = 'folder'; $result[$basekey] = $dirDetails; foreach ($array as $key => $value) { if (is_array($value)) { $r = $this->flatoutStatsArray($value, $key); $first = true; foreach ($r as $k => $v) { if ($first) { $first = false; $dirDetails->fileSize += $v->fileSize; $dirDetails->linesOfCode += $v->linesOfCode; } $result[$basekey.'\\'.$k] = $v; } } else { $result[$basekey.'\\'.$key] = $value; $dirDetails->fileSize += $value->fileSize; $dirDetails->linesOfCode += $value->linesOfCode; } } return $result; }
[ "public function toFlatArray();", "function wp_xprt_flatten_array( &$array ) {\n\treturn array_walk( $array, create_function( '&$value', '$value = $value[0];' ) );\n}", "private function makeStatArray($stats)\n {\n return array_merge(\n array_fill_keys([\n 'dev',\n 'ino',\n 'mode',\n 'nlink',\n 'uid',\n 'gid',\n 'rdev',\n 'size',\n 'atime',\n 'mtime',\n 'ctime',\n 'blksize',\n 'blocks'\n ], 0),\n $stats\n );\n }", "static function array_flat($array) {\n $single = array();\n foreach($array as $one) {\n foreach($one as $key => $value) {\n $single[$key] = $value;\t\n }\n }\n return $single;\n }", "function data_array_flatten() {\n\t\treturn array(\n\t\t\tarray(\n\t\t\t\tarray(1, 2, 3, 4),\n\t\t\t\tarray(1, 2, 3, 4),\n\t\t\t),\n\t\t\tarray(\n\t\t\t\tarray(\n\t\t\t\t\t1,\n\t\t\t\t\tarray(\n\t\t\t\t\t\t2,\n\t\t\t\t\t\tarray(3, 4),\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\tarray(1, 2, 3, 4),\n\t\t\t),\n\t\t);\n\t}", "function array_flatten(array $array)\n {\n $array = array_values($array);\n return call_user_func_array('array_merge', $array);\n }", "function exportArray()\n {\n $parent = parent::exportArray();\n\n switch ($this->statsBreakdown) {\n case 'day':\n $key_format = 'date';\n break;\n case 'hour':\n $key_format = 'time';\n break;\n default:\n $key_format = 'text';\n break;\n }\n\n $headers = array_merge(array($this->statsKey), $parent['headers']);\n $formats = array_merge(array($key_format), $parent['formats']);\n $data = array();\n\n $headers[] = $this->statsKey;\n\n foreach ($this->aStatsData as $h) {\n $row = array();\n if ($this->statsBreakdown == 'week') {\n $row[] = $h['week'];\n } else {\n $row[] = $h['date_f'];\n }\n foreach (array_keys($this->aColumns) as $ck) {\n if ($this->showColumn($ck)) {\n $row[] = $h[$ck];\n }\n }\n\n $data[] = $row;\n }\n\n return array(\n 'headers' => $headers,\n 'formats' => $formats,\n 'data' => $data\n );\n }", "protected function _unflattenArray(array $array)\n\t{\n\t\tforeach ($array as $key => $value) {\n\t\t\t\n\t\t\tif (is_array($array[$key])) {\n\t\t\t\t\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t\n\t\t\t$array[$key] = array($value[0]);\n\t\t}\n\t\t\n\t\treturn $array;\n\t}", "function array_flat($array) {\n $single = array();\n foreach($array as $one) {\n foreach($one as $key => $value) {\n $single[$key] = $value;\t\n }\n }\n return $single;\n}", "function metadata_array_to_values($array) {\n\t$valuearray = [];\n\n\tif (is_array($array)) {\n\t\tforeach ($array as $element) {\n\t\t\t$valuearray[] = $element->value;\n\t\t}\n\t}\n\n\treturn $valuearray;\n}", "public static function collapse($array)\n {\n $results = [];\n\n foreach ($array as $values) {\n if ($values instanceof \\Imran\\Collection\\Collection) {\n $values = $values->all();\n } elseif (! is_array($values)) {\n continue;\n }\n\n $results[] = $values;\n }\n\n return array_merge([], ...$results);\n }", "public static function collapse(array $array): array\n {\n $results = [];\n\n foreach ($array as $values) {\n if ( ! \\is_array($values)) {\n continue;\n }\n\n $results = \\array_merge($results, $values);\n }\n\n return $results;\n }", "public static function collapse($array)\n {\n $results = [];\n\n foreach ($array as $values) {\n if ($values instanceof Collection) {\n $values = $values->all();\n } elseif (! is_array($values)) {\n continue;\n }\n\n $results[] = $values;\n }\n\n return array_merge([], ...$results);\n }", "public static function array_flatten($array) {\r\n $return = array();\r\n\r\n array_walk_recursive($array, function($x) use (&$return) {\r\n $return[] = $x;\r\n });\r\n\r\n return $return;\r\n }", "function array_flatten($array)\n\t{\n\t\t$return = array();\n\n\t\tarray_walk_recursive($array, function($x) use (&$return)\n\t\t{\n\t\t\t$return[] = $x;\n\t\t});\n\n\t\treturn $return;\n\t}", "public static function flatten($array)\n {\n $return = array();\n\n array_walk_recursive($array, function($x) use (&$return) { $return[] = $x; });\n\n return $return;\n }", "function supercolumns_or_columns_to_array($array)\n {\n $ret = null;\n for ($i=0; $i<count($array); $i++)\n foreach ($array[$i] as $object)\n {\n if ($object)\n {\n // If supercolumn\n if (isset($object->columns))\n {\n $record = array();\n for ($j=0; $j<count($object->columns); $j++)\n {\n $column = $object->columns[$j];\n $record[$column->name] = $column->value;\n }\n $ret[$object->name] = $record;\n }\n // (Otherwise - not supercolumn)\n else\n {\n $ret[$object->name] = $object->value;\n }\n }\n }\n\n return $ret;\n }", "abstract public function convertArray();", "private function simplifyArray(array $array) :array\n {\n $result = [];\n foreach($array as $element){\n $result[] = $element['number'];\n }\n return $result;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get product reserved quantity on store.
protected function getStoreReservedQuantity(): float { return (float)($this->getStoreProductRow()['QUANTITY_RESERVED'] ?? 0.0); }
[ "public function getAvailableQuantity()\n {\n return $this->available_quantity;\n }", "abstract protected function getNewStoreReservedQuantity(): float;", "protected function getProductTotalReservedQuantity(): float\n\t{\n\t\treturn (float)($this->getProductRow()['QUANTITY_RESERVED'] ?? 0.0);\n\t}", "public function getQuantityAvailable()\n {\n return $this->quantityAvailable;\n }", "public function getQuantity();", "function get_available_quantity($product)\n\t{\n\t\trequire_code('catalogues');\n\n\t\t$res=$GLOBALS['SITE_DB']->query_select('catalogue_entries',array('*'),array('id'=>$product));\n\n\t\tif (!array_key_exists(0,$res)) return 0;\n\n\t\t$product_det=$res[0];\n\n\t\t$fields=get_catalogue_entry_field_values($product_det['c_name'],$product_det['id'],NULL,NULL,true);\n\n\t\t$str=NULL;\n\n\t\tif (is_object($fields[3]['effective_value'])) $fields[3]['effective_value']=$fields[3]['effective_value']->evaluate();\n\t\tif ((is_null($fields[3]['effective_value'])) || (intval($fields[3]['effective_value'])==0)) return NULL;\n\n\t\tif ($fields[3]['effective_value']!='' && $fields[3]['effective_value']!=do_lang('NA'))\n\t\t{\n\t\t\t$available_stock=intval($fields[3]['effective_value']);\n\n\t\t\t//Locked order check\n\t\t\t$query='SELECT sum(t2.p_quantity) as qty FROM '.get_table_prefix().'shopping_order t1 JOIN '.get_table_prefix().'shopping_order_details t2 ON t1.id=t2.order_id WHERE t1.c_member='.strval($GLOBALS['FORUM_DRIVER']->get_guest_id()).' AND add_date>'.strval(time()-60*60*24).' AND '.db_string_equal_to('t1.order_status','ORDER_STATUS_awaiting_payment').' AND t2.p_id='.strval(intval($product));\n\t\t\tif (is_guest())\n\t\t\t{\n\t\t\t\t$query.=' AND t1.session_id<>'.strval(get_session_id());\n\t\t\t} else\n\t\t\t{\n\t\t\t\t$query.=' AND t1.c_member<>'.strval(get_member());\n\t\t\t}\n\t\t\t$res=$GLOBALS['SITE_DB']->query($query);\n\n\t\t\tif (array_key_exists(0,$res))\n\t\t\t\t$item_count=intval($res[0]['qty']);\n\t\t\telse\n\t\t\t\t$item_count=0;\n\n\t\t\treturn ($available_stock-$item_count);\n\t\t}\n\n\t\treturn NULL;\n\t}", "public function getQty()\n {\n if ($this->_stockItem->getItemId()) {\n return $this->_stockItem->getQty();\n }\n }", "public function getProductsQtyToGenerate(): int\n {\n return (int)$this->scopeConfig->getValue(self::XML_PATH_PRODUCTS_QTY_TO_GENERATE);\n }", "public function getQuantity()\n {\n return isset($this->quantity) ? $this->quantity : null;\n }", "public function getMinQuantity();", "public function getQuantity()\n {\n return $this->_fields['Quantity']['FieldValue'];\n }", "public function getQty()\n {\n return $this->qty;\n }", "public function getQuantity()\r\n {\r\n return $this->quantity;\r\n }", "public function getOversupplyQuantity()\n {\n return $this->oversupplyQuantity;\n }", "public function get_quantity()\n\t\t{\n return $this->get_bundle_item_quantity();\n\t\t}", "function getQuantity() {\n return $this->getFieldValue('quantity');\n }", "public function getInventoryQuantity()\n\t{\n\t\treturn $this->inventoryQuantity;\n\t}", "public function getMinimumQuantity();", "public function getMinSaleQty();" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Verifies if it is the root's password. Returns true it it is the password, otherwise false.
static public function isValidRoot($password){ $sql = 'CALL root_is_valid(:password)'; $params = array(':password' => $password); return (boolean)DatabaseHandler::getOne($sql, $params); }
[ "static public function isValidRoot($password){\n\t\treturn ($password == self::$_mRootPassword ? true : false);\n\t}", "function checkrootpass ($pass) {\n\t\t\t// root:$1$14404027$lKo71A38VJcjJJ3uU8L9I/:13115:0:99999:7:::\n\t\t\t$ark = \"/etc/shadow\";\n\t\t\t$fd = fopen($ark,\"r\");\n\t\t\t$shadow = fread ($fd, filesize ($ark));\n\t\t\tfclose($fd);\t\n\t\t\t$linhas = explode (\"\\n\",$shadow);\n\t\t\tfor ($i=0;$i<count($shadow);$i++) {\n\t\t\t\t$tmp = explode(\":\",$shadow);\n\t\t\t\tif ($tmp[0]==\"root\") {\n\t\t\t\t\t$nlinha = $i;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$linha = explode(\":\",$linhas[$nlinha]);\n\t\t\t$rootpass = $linha[1];\n\t\t\t\n\t\t\t$tmp = explode(\"\\$\",$rootpass);\n\t\t\t$salt = $tmp[2];\n\t\t\t\n\t\t\t$pass = md5crypt($pass,$salt);\n\t\t\t\n\t\t\tif ($pass == $rootpass) { \n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t\t\n\t\t}", "public function isValidPassword(){\r\n // shortcut for if else checks to see if true (else) : false\r\n return ( $this->getPassword() === Config::PASS_CODE ? true : false );\r\n }", "public function hasPassword()\n {\n if($this->logPassword === false){\n return false;\n } else {\n return true;\n }\n\n }", "function passwordIsCorrect() {\n //Encrypt the submitted password\n $encryptedSubmitPassword = $this->createEncryptedPassword($this->submitPassword);\n\n //Remove the random string from the password in the database\n $databasePasswordWithoutRandom = substr($this->databasePassword, 0, -20);\n return ($encryptedSubmitPassword == $databasePasswordWithoutRandom) == true;\n }", "public function hasPassword(): bool;", "protected function testUserPassword(): bool {\n $loginValid = FALSE;\n if ($this->serverDrupalUser->get('bind_method') === 'user') {\n $loginValid = TRUE;\n }\n else {\n $this->ldapBridge->setServer($this->serverDrupalUser);\n // @todo Verify value in userPW, document!\n CredentialsStorage::storeUserDn($this->ldapEntry->getDn());\n CredentialsStorage::testCredentials(TRUE);\n $bindResult = $this->ldapBridge->bind();\n CredentialsStorage::testCredentials(FALSE);\n if ($bindResult) {\n $loginValid = TRUE;\n }\n else {\n $this->detailLog->log(\n '%username: Error testing user credentials on server %id with %bind_method.', [\n '%username' => $this->authName,\n '%bind_method' => $this->serverDrupalUser->getFormattedBind(),\n '%id' => $this->serverDrupalUser->id(),\n ], 'ldap_authentication'\n );\n }\n }\n return $loginValid;\n }", "public function hasPassword() : bool;", "public function verify(string $cleanPassword): bool;", "private function chkPasswd() {\r\n\t\t\r\n\t\t\t// Query the database for user and password\r\n\t\t\t$this->db->read(\r\n\t\t\t\t'SELECT '.USER_NAME_FIELD.' \r\n\t\t\t\tFROM '.USER_TABLE.' \r\n\t\t\t\tWHERE `'.USER_NAME_FIELD.'` = \\''.$this->user.'\\' \r\n\t\t\t\t\tAND `'.USER_PASS_FIELD.'` = \\''. $this->genPasswd() .'\\';'\r\n\t\t\t);\r\n\t\t\t\r\n\t\t\t// Check if the password was correct and return\r\n\t\t\tif($this->db->rows()) {\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t\r\n\t\t}", "public function confirmpass() {\r\n $valid = false;\r\n if ($this->data['User']['password'] == $this->data['User']['cpassword']) {\r\n $valid = true;\r\n }\r\n\r\n return $valid;\r\n }", "public function havePassword()\n {\n return !empty($this->password);\n }", "public function checkPasswordReturnsTrueWithValidAlphaCharClassPasswordAndFixedHash() {}", "public function hasPass()\r\n {\r\n return strlen($this->pass) ? TRUE : FALSE;\r\n }", "public function hasPassword()\n {\n return (bool) $this->password;\n }", "public function hasPassword()\n {\n return $this->password !== null;\n }", "public function verify($ps_password) {\n\t\treturn (md5($ps_password) == $this->get(\"password\")) ? true : false;\n\t}", "public function passwordEntryIsValid() {\r\n \r\n if ( empty($this->password) ) {\r\n $this->errors[\"password\"] = \"Password is missing.\";\r\n } else if ( !Validator::passwordIsValid($this->password) ) {\r\n $this->errors[\"password\"] = \"Password is not valid.\"; \r\n } \r\n \r\n return ( empty($this->errors[\"password\"]) ? true : false ) ;\r\n }", "public function checkPassword() {}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Add new "DocTypes" taxonomy to Posts
function add_custom_taxonomies() { register_taxonomy( 'doctype', 'post', array( // Hierarchical taxonomy (like categories) 'hierarchical' => true, // This array of options controls the labels displayed in the WordPress Admin UI 'labels' => array( 'name' => _x( 'DocTypes', 'taxonomy general name' ), 'singular_name' => _x( 'DocType', 'taxonomy singular name' ), 'search_items' => __( 'Search DocTypes' ), 'all_items' => __( 'All DocTypes' ), 'parent_item' => __( 'Parent DocType' ), 'parent_item_colon' => __( 'Parent DocType:' ), 'edit_item' => __( 'Edit DocType' ), 'update_item' => __( 'Update DocType' ), 'add_new_item' => __( 'Add New DocType' ), 'new_item_name' => __( 'New DocType Name' ), 'menu_name' => __( 'DocTypes' ), ), // Control the slugs used for this taxonomy 'rewrite' => array( 'slug' => 'doctypes', // This controls the base slug that will display before each term 'with_front' => false, // Don't display the category base before "/locations/" 'hierarchical' => true // This will allow URL's like "/locations/boston/cambridge/" ), ) ); // Add new "TargetGroups" taxonomy to Posts register_taxonomy( 'targetgroup', 'post', array( // Hierarchical taxonomy (like categories) 'hierarchical' => true, // This array of options controls the labels displayed in the WordPress Admin UI 'labels' => array( 'name' => _x( 'TargetGroups', 'taxonomy general name' ), 'singular_name' => _x( 'TargetGroup', 'taxonomy singular name' ), 'search_items' => __( 'Search TargetGroups' ), 'all_items' => __( 'All TargetGroups' ), 'parent_item' => __( 'Parent TargetGroup' ), 'parent_item_colon' => __( 'Parent TargetGroup:' ), 'edit_item' => __( 'Edit TargetGroup' ), 'update_item' => __( 'Update TargetGroup' ), 'add_new_item' => __( 'Add New TargetGroup' ), 'new_item_name' => __( 'New TargetGroup Name' ), 'menu_name' => __( 'TargetGroups' ), ), // Control the slugs used for this taxonomy 'rewrite' => array( 'slug' => 'targetgroups', // This controls the base slug that will display before each term 'with_front' => false, // Don't display the category base before "/locations/" 'hierarchical' => true // This will allow URL's like "/locations/boston/cambridge/" ), ) ); // Add new "TargetGroups" taxonomy to Posts register_taxonomy( 'businessunit', 'post', array( // Hierarchical taxonomy (like categories) 'hierarchical' => true, // This array of options controls the labels displayed in the WordPress Admin UI 'labels' => array( 'name' => _x( 'BusinessUnits', 'taxonomy general name' ), 'singular_name' => _x( 'BusinessUnit', 'taxonomy singular name' ), 'search_items' => __( 'Search BusinessUnits' ), 'all_items' => __( 'All BusinessUnits' ), 'parent_item' => __( 'Parent BusinessUnit' ), 'parent_item_colon' => __( 'Parent BusinessUnit:' ), 'edit_item' => __( 'Edit BusinessUnit' ), 'update_item' => __( 'Update BusinessUnit' ), 'add_new_item' => __( 'Add New BusinessUnit' ), 'new_item_name' => __( 'New BusinessUnit Name' ), 'menu_name' => __( 'BusinessUnits' ), ), // Control the slugs used for this taxonomy 'rewrite' => array( 'slug' => 'businessunits', // This controls the base slug that will display before each term 'with_front' => false, // Don't display the category base before "/locations/" 'hierarchical' => true // This will allow URL's like "/locations/boston/cambridge/" ), ) ); register_taxonomy( 'country', 'post', array( // Hierarchical taxonomy (like categories) 'hierarchical' => false, // This array of options controls the labels displayed in the WordPress Admin UI 'labels' => array( 'name' => _x( 'Countries', 'taxonomy general name' ), 'singular_name' => _x( 'Country', 'taxonomy singular name' ), 'search_items' => __( 'Search Countries' ), 'all_items' => __( 'All Countries' ), 'parent_item' => __( 'Parent Country' ), 'parent_item_colon' => __( 'Parent Country:' ), 'edit_item' => __( 'Edit Country' ), 'update_item' => __( 'Update Country' ), 'add_new_item' => __( 'Add New Country' ), 'new_item_name' => __( 'New Country Name' ), 'menu_name' => __( 'Countries' ), ), // Control the slugs used for this taxonomy 'rewrite' => array( 'slug' => 'countries', // This controls the base slug that will display before each term 'with_front' => false, // Don't display the category base before "/locations/" 'hierarchical' => false // This will allow URL's like "/locations/boston/cambridge/" ), ) ); }
[ "function doc_create_taxonomies() {\n\t$labels = array(\n\t 'name' => _x( 'Document Types', 'taxonomy general name' ),\n\t 'singular_name' => _x( 'Document Type', 'taxonomy singular name' ),\n\t 'search_items' => __( 'Search Document Types' ),\n\t 'all_items' => __( 'All Document Types' ),\n\t 'parent_item' => __( 'Parent Document' ),\n\t 'parent_item_colon' => __( 'Parent Document:' ),\n\t 'edit_item' => __( 'Edit Document Type' ), \n\t 'update_item' => __( 'Update Document Type' ),\n\t 'add_new_item' => __( 'Add New Document Type' ),\n\t 'new_item_name' => __( 'New Document Type Name' ),\n\t 'menu_name' => __( 'Document Type' ),\n\t ); \t\n\t\n\t// Document type\n register_taxonomy('documenttype',array('chrgj-document'),array(\n 'hierarchical' => true,\n 'labels' => $labels,\n 'singular_name' => 'Document Type',\n 'show_ui' => true,\n 'query_var' => true,\n 'rewrite' => array('slug' => 'document-type' ),\n\t\t'capabilities' => array('manage_categories'.'edit_posts')\n ));\n}", "function documentaries_post_type(){\n create_custom_post_type(\"Documentaries\");\n}", "public function add_custom_taxonomy() {\n //http://code.tutsplus.com/articles/custom-post-type-helper-class--wp-25104\n }", "protected function register_taxonomy_categories() {\n\t\t$labels = array(\n\t\t\t'name' => __( 'Doc Categories', 'documentation-post-type' ),\n\t\t\t'singular_name' => __( 'Doc Category', 'documentation-post-type' ),\n\t\t\t'menu_name' => __( 'Doc Categories', 'documentation-post-type' ),\n\t\t\t'edit_item' => __( 'Edit Doc Category', 'documentation-post-type' ),\n\t\t\t'update_item' => __( 'Update Doc Category', 'documentation-post-type' ),\n\t\t\t'add_new_item' => __( 'Add New Doc Category', 'documentation-post-type' ),\n\t\t\t'new_item_name' => __( 'New Doc Category Name', 'documentation-post-type' ),\n\t\t\t'parent_item' => __( 'Parent Doc Category', 'documentation-post-type' ),\n\t\t\t'parent_item_colon' => __( 'Parent Doc Category:', 'documentation-post-type' ),\n\t\t\t'all_items' => __( 'All Doc Categories', 'documentation-post-type' ),\n\t\t\t'search_items' => __( 'Search Doc Categories', 'documentation-post-type' ),\n\t\t\t'popular_items' => __( 'Popular Doc Categories', 'documentation-post-type' ),\n\t\t\t'separate_items_with_commas' => __( 'Separate doc categories with commas', 'documentation-post-type' ),\n\t\t\t'add_or_remove_items' => __( 'Add or remove doc categories', 'documentation-post-type' ),\n\t\t\t'choose_from_most_used' => __( 'Choose from the most used doc categories', 'documentation-post-type' ),\n\t\t\t'not_found' => __( 'No doc categories found.', 'documentation-post-type' ),\n\t\t);\n\n\t\t$args = array(\n\t\t\t'labels' => $labels,\n\t\t\t'public' => true,\n\t\t\t'show_in_nav_menus' => true,\n\t\t\t'show_ui' => true,\n\t\t\t'show_tagcloud' => true,\n\t\t\t'hierarchical' => true,\n\t\t\t'rewrite' => array( 'slug' => 'documentation-category' ),\n\t\t\t'show_admin_column' => true,\n\t\t\t'query_var' => true,\n\t\t);\n\n\t\t$args = apply_filters( 'documentation_post_type_category_args', $args );\n\n\t\tregister_taxonomy( $this->taxonomies[0], $this->post_type, $args );\n\t}", "function create_post_types(){\n\t\t$glossaryPermalink = get_option('red_glossaryPermalink');\n\t\t$args = array(\n\t\t\t'label' => 'Glossary',\n\t\t\t'description' => '',\n\t\t\t'public' => true,\n\t\t\t'show_ui' => true,\n\t\t\t'_builtin' => false,\n\t\t\t'capability_type' => 'post',\n\t\t\t'hierarchical' => false,\n\t\t\t'rewrite' => array('slug' => $glossaryPermalink),\n\t\t\t'query_var' => true,\n\t\t\t'supports' => array('title','editor','author','excerpt'));\n\t\tregister_post_type('glossary',$args);\n\t\tflush_rewrite_rules();\n\t}", "function flei_add_taxonomies_to_attachments()\n{\n register_taxonomy_for_object_type('my_expertise', 'attachment');\n}", "public function create_post_types() {\n }", "public function createTaxonomy();", "public function registerTypeTaxonomy() {\n $args = array(\n 'public' => true,\n 'label' => 'Type',\n 'description' => 'The \"file type\" of the data posts'\n );\n register_taxonomy(\n $this->getTypeTaxonomyName(),\n $this->post_type,\n $args\n );\n }", "function create_my_taxonomies() {\n register_taxonomy(\n 'test_post_test_blog',\n 'test_post',\n array(\n 'labels' => array(\n 'name' => 'Blog',\n 'add_new_item' => 'Add New Blog',\n 'new_item_name' => \"New Blog\"\n ),\n 'show_ui' => true,\n 'show_tagcloud' => false,\n 'hierarchical' => true\n )\n );\n}", "function registerTaxonomy()\n{\n\n // Use GenerateWP for generating code for custom taxonomy\n // https://generatewp.com/taxonomy/\n}", "function apachesolr_add_taxonomy_to_document(&$document, $node) {\r\n if (isset($node->taxonomy) && is_array($node->taxonomy)) {\r\n foreach ($node->taxonomy as $term) {\r\n // Double indexing of tids lets us do effecient searches (on tid)\r\n // and do accurate per-vocabulary faceting.\r\n\r\n // By including the ancestors to a term in the index we make\r\n // sure that searches for general categories match specific\r\n // categories, e.g. Fruit -> apple, a search for fruit will find\r\n // content categorized with apple.\r\n $ancestors = taxonomy_get_parents_all($term->tid);\r\n foreach ($ancestors as $ancestor) {\r\n $document->setMultiValue('tid', $ancestor->tid);\r\n $document->setMultiValue('im_vid_'. $ancestor->vid, $ancestor->tid);\r\n $name = apachesolr_clean_text($ancestor->name);\r\n $document->setMultiValue('vid', $ancestor->vid);\r\n $document->{'ts_vid_'. $ancestor->vid .'_names'} .= ' '. $name;\r\n // We index each name as a string for cross-site faceting\r\n // using the vocab name rather than vid in field construction .\r\n $document->setMultiValue('sm_vid_'. apachesolr_vocab_name($ancestor->vid), $name);\r\n }\r\n }\r\n }\r\n}", "function create_taxonomies() {\n\t// taxonomy_init(\n\t// \t$settings = array(\n\t// \t\t'slug' \t=> 'sample',\t\t\t// Required\n\t// \t\t'singular' \t=> 'Sample',\t\t\t// Required\n\t// \t\t'plural' \t=> 'Samples',\t\t\t// Required\n\t// \t\t'post_types'\t=> 'your_CPT',\t\t\t// Required\n\t// \t)\n\t// );\n}", "public function registerTaxonomies() {\n\t\tforeach ( $this->newTaxonomies as $taxonomy_name => $tax ) {\n\t\t\t// Register the taxonomy with WordPress\n\t\t\tregister_taxonomy( $taxonomy_name, $this->postTypeName, $tax->options );\n\t\t}\n\t}", "function tpt_enable_taxonomy_as_needed() {\n\t$types = tpt_all_post_types();\n\t$options = get_option(TPT_OPTIONS_ID);\n\tforeach($types as $type=>$type_obj) {\n\t\tif(isset($options[TPT_OPTION_PREFIX.'tag_'.$type]) && $options[TPT_OPTION_PREFIX.'tag_'.$type] == '1') {\n\t\t\tregister_taxonomy_for_object_type('post_tag', $type);\n\t\t}\n\t\tif(isset($options[TPT_OPTION_PREFIX.'date_'.$type]) && $options[TPT_OPTION_PREFIX.'tag_'.$type] == '1') {\n\t\t\tregister_taxonomy_for_object_type('post_date', $type);\n\t\t}\n\t\tif(isset($options[TPT_OPTION_PREFIX.'author_'.$type]) && $options[TPT_OPTION_PREFIX.'tag_'.$type] == '1') {\n\t\t\tregister_taxonomy_for_object_type('author_tag', $type);\n\t\t}\n\t\tif(isset($options[TPT_OPTION_PREFIX.'category_'.$type]) && $options[TPT_OPTION_PREFIX.'category_'.$type] == '1') {\n\t\t\tregister_taxonomy_for_object_type('category', $type);\n\t\t}\n\t}\n}", "public function registerExistingTaxonomies() {\n\t\tforeach ( $this->existingTaxonomies as $taxonomy_name ) {\n\t\t\tregister_taxonomy_for_object_type( $taxonomy_name, $this->postTypeName );\n\t\t}\n\t}", "public function register_post_types() {}", "function hc_create_custom_post_types_cat() {\n global $hc_all_custom_post_types;\n hc_load_taxonomies($hc_all_custom_post_types);\n flush_rewrite_rules();\n}", "function create_new_topic_index() {\n\t// Add new taxonomy\n $types = array('post','page','attachment','nav_menu_item', 'learning_resource');\n register_taxonomy('asn_topic_index', $types, array(\n 'hierarchical' => true,\n 'labels' => array(\n 'name' => _x( 'ASN Topic Index', 'taxonomy general name' ),\n 'singular_name' => _x( 'Topic', 'taxonomy singular name' ),\n 'search_items' => __( 'Search Topics' ),\n 'all_items' => __( 'All Topics' ),\n 'parent_item' => __( 'Parent Topic' ),\n 'parent_item_colon' => __( 'Parent Topic:' ),\n 'edit_item' => __( 'Edit Topic' ),\n 'update_item' => __( 'Update Topic' ),\n 'add_new_item' => __( 'Add New Topic' ),\n 'new_item_name' => __( 'New Topic Name' ),\n 'menu_name' => __( 'Topic Index' ),\n ),\n //Slugs used for this taxonomy\n 'rewrite' => array(\n 'slug' => 'topic_index', \n 'with_front' => false,\n 'hierarchical' => true \n ),\n ));\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Remove an attribute "checked" from a element.
public function setUnchecked() { $this->node->removeAttribute('checked'); return $this; }
[ "public function testCheckedAttributeShouldBeCleared()\n {\n $formNoSubmit = new HTML_QuickForm2('neverSubmitted');\n $box1 = new HTML_QuickForm2_Element_InputCheckbox('box1', 'checked');\n $box2 = new HTML_QuickForm2_Element_InputCheckbox('box2');\n $formNoSubmit->appendChild($box1);\n $formNoSubmit->appendChild($box2);\n\n $this->assertNotNull($box1->getAttribute('checked'));\n $this->assertNull($box2->getAttribute('checked'));\n\n $formNoSubmit->addDataSource(new HTML_QuickForm2_DataSource_Array(array(\n 'box2' => true\n )));\n $this->assertNotNull($box2->getAttribute('checked'));\n $this->assertNull($box1->getAttribute('checked'));\n\n $box2->setName('box3');\n $this->assertNull($box2->getAttribute('checked'));\n }", "public function uncheck()\n {\n $this->con->executeStep(sprintf('_sahi._uncheck(%s)', $this->getAccessor()));\n }", "public function setCheckedState($checked){\n if( $checked ) $this->attributes['checked'] = 'checked';\n else unset($this->attributes['checked']);\n }", "function remove_attribute($name)\n\t{\n\t\tunset($this->attributes[$name]);\n\t}", "function removeAttribute($attribute);", "public function removeAttribute($name)\n {\n if (isset($this->htmlAttributes[$name])) {\n unset($this->htmlAttributes[$name]);\n }\n }", "function remove_attribute($attrib) \r\n\t{\r\n \tunset($this->attributes[strtolower($attrib)]);\r\n\t}", "public function setUnchecked() : void\n {\n $this->checked = false;\n }", "public function removeAttribute(string $attribute);", "public function uncheckCheckbox($selector)\n {\n $this->browse(function (Browser $browser) use ($selector) {\n $browser->uncheck($selector);\n });\n }", "public function removeAttribute($attribute);", "function getCheckedAttribute($bool) {\n\tif ($bool) {\n\t\treturn ' checked=\"checked\"';\n\t}\n\treturn \"\";\n}", "public function removeHashable($attribute);", "static function rmAttributes( $element , $inputFilter ) {\n\t\t//remove HTML5 validation, it messed up with js validators\n\t\t$toRemove = [ 'minlength' , 'required' , ];\n\n\t\tforeach( $toRemove as $attr ) { \n\t\t\t$element->removeAttribute( $attr );\n\t\t}\n\t}", "function miniva_sanitize_checkbox( $checked ) {\n\t// Boolean check.\n\treturn ( ( isset( $checked ) && true === $checked ) ? true : false );\n}", "public function removeItemAttr($name)\n {\n unset($this->itemAttr[$name]);\n }", "function UncheckItem(wxTreeListItem $item){}", "function haven_sanitize_checkbox( $checked ) {\n\treturn ( ( isset( $checked ) && true == $checked ) ? true : false );\n}", "public function unsetAttribute($index)\n {\n unset($this->attribute[$index]);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Show the Date that a ToDo Item was Completed
public function show_completed( $completed, $layout = 'table' ) { if ( CTDL_Loader::$settings['show_completed_date'] && $completed != '0000-00-00 00:00:00' ) { $date = ( isset( $completed ) ? date( CTDL_Loader::$settings['date_format'], strtotime( $completed ) ) : '' ); if ( $layout == 'table' ) { $this->list .= '<td class="todo-completed">'.esc_attr( $date ).'</td>'; } else { $this->list .= ' - '.apply_filters( 'ctdl_completed', esc_html__( 'Completed', 'cleverness-to-do-list' ) ).': '.esc_attr( $date ); } } }
[ "public function getDateCompleted()\n {\n return $this->dateCompleted;\n }", "private function get_completed_date() {\n\t\treturn apply_filters( 'give_payment_completed_date', $this->completed_date, $this->ID, $this );\n\t}", "public function getDateCompleted() \n {\n return $this->_fields['DateCompleted']['FieldValue'];\n }", "public function getTodoDate() : string {\n\t\treturn($this->todoDate);\n\t}", "protected function maybe_set_date_completed()\n {\n }", "public function getDueDate();", "public function getDate_completed()\n {\n if( !is_null($this->sDate_completed) )\n {\n if( $this->sDate_completed==='' )\n {\n return NULL;\n }\n else\n {\n return $this->sDate_completed;\n }\n }\n else\n {\n $this->hydrateFromBDD(array('date_completed'));\n $this->callHydrateFromBDDOnGet++;\n if($this->callHydrateFromBDDOnGet>10)\n {\n echo \"<br />WARNING : trop d'appel en base depuis l'accesseur \". __CLASS__ .\"::\". __FUNCTION__ .\"\";\n }\n return $this->sDate_completed;\n }\n }", "function getCompletedOnDate() {\n $on = $this->getAdditionalProperty('completed_filter_on');\n\n return $on ? new DateValue($on) : null;\n }", "private function get_todo_status($todo)\n {\n if ($todo->completed == true) :\n $status = '<span class=\"completed-todo\">Completed</span>';\n else:\n $status = '<span class=\"uncompleted-todo\">Uncompleted</span>';\n endif;\n return $status;\n }", "public function get_dueDate() { return $this->_dueDate; }", "public function getDueDate()\r\n {\r\n return $this->dueDate;\r\n }", "function getDateDue() {\n\t\treturn $this->getData('dateDue');\n\t}", "public function getDueDate()\n {\n return $this->dueDate;\n }", "public function getDueDate()\n {\n return $this->DueDate;\n }", "public function getCompletedAt()\n {\n return $this->completedAt;\n }", "public function getDateTask()\n {\n return $this->date_task;\n }", "public function getTodoDate(): \\DateTime {\n\t\treturn $this->todoDate;\n\t}", "public function getCompletedOn(): \\DateTime\n {\n return $this->completedOn;\n }", "public function getTodoDate() : \\DateTime {\n\t\t\t\treturn($this->todoDate);\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Test the array filter plugin with a single value.
public function testArrayFilterWithSingleValue() { $this->setExpectedException(TamperException::class, 'Input should be an array.'); $this->plugin->tamper('foo'); }
[ "public function testFilterWithArrayValue()\n {\n $input = array(\n 'key1' => 'value1',\n 'key2' => 'value2',\n 'key3' => array(\n 'key3_1' => 'value3_1',\n 'key3_2' => 'value3_2',\n )\n );\n $expected = array(\n 'key1' => Formagic_Filter_Mock_MockFilter::FILTERED_VALUE,\n 'key2' => Formagic_Filter_Mock_MockFilter::FILTERED_VALUE,\n 'key3' => array(\n 'key3_1' => Formagic_Filter_Mock_MockFilter::FILTERED_VALUE,\n 'key3_2' => Formagic_Filter_Mock_MockFilter::FILTERED_VALUE,\n )\n );\n \n $item = new Formagic_Item_Select('test');\n $item->setMultiple(true);\n\n // one rule, validates true\n $actual = $item\n ->setValue($input)\n ->addFilter('Mock_MockFilter')\n ->getValue();\n $this->assertInternalType('array', $actual);\n $this->assertEquals($expected, $actual);\n }", "public function testArrayFilterValues() {\n\t\t\t$data = array( 'foo' => 'bar', 'bar' => 'baz', 'baz' => null );\n\n\t\t\t$result = array_filter_values( $data, array( 'bar' ) );\n\t\t\t$expected = array( 'foo' => 'bar' );\n\t\t\t$this->assertEqual( $result, $expected, var_export( $result, true ) );\n\n\t\t\t$result = array_filter_values( $data, array( 'bar' ), true );\n\t\t\t$expected = array( 'bar' => 'baz', 'baz' => null );\n\t\t\t$this->assertEqual( $result, $expected, var_export( $result, true ) );\n\t\t}", "public function testArrayFilterWithMultipleValues() {\n $original = ['foo', 0, '', 'bar', FALSE, 'baz', [], 'zip'];\n $expected = ['foo', 'bar', 'baz', 'zip'];\n $this->assertArrayEquals($expected, $this->plugin->tamper($original));\n }", "public function filter($value);", "public function testArrayItem() {\n \n $cltObj = new ChaperoneContextFilter();\n try {\n $cltObj->addItem(array(1, 2, 3));\n $this->fail('addItem() failed to generate an exception');\n } catch (ChaperoneException $e) {\n $this->assertEquals($e->getMessage(), 'Filter item \"Array\" is invalid');\n }\n }", "public function filterValue($value, $filter);", "public function testFilter()\n {\n $myArray = new BasicArray([\n 1, 2, 3, 4, 5, 6, 7, 8, 9\n ]);\n $myArray2 = $myArray->filter(function ($index, $value) {\n return ($index % 2 === 0);\n });\n $this->assertEquals(5, $myArray2->length());\n $this->assertEquals(1, $myArray2->first());\n $this->assertEquals(9, $myArray2->last());\n }", "public function testAddFilterWithEmptyArrayValue(): void {\n $model = $this->getModel('testdata');\n\n // NOTE: we have to override the error handler for a short period of time\n set_error_handler(null, E_USER_NOTICE);\n\n //\n // WARNING: to avoid any issue with error handlers\n // we try to keep the amount of calls not covered by the generic handler\n // at a minimum\n //\n try {\n @$model->addFilter('testdata_text', []); // this is discarded internally/has no effect\n } catch (\\Throwable $t) {}\n\n restore_error_handler();\n\n $this->assertEquals(error_get_last()['message'], 'Empty array filter values have no effect on resultset');\n $this->assertEquals(4, $model->getCount());\n }", "public function isFiltered(array $datarow, $value);", "abstract function applyFilter($value);", "private function apply_filter(&$value, $filter){\r\n }", "public function testPopulateFromArray() {\n $this->filter->populateFromArray(array('value' => 'xyz', 'name' => 'test'));\n $this->assertEquals('xyz', $this->filter->getValue());\n $this->assertEquals('test', $this->filter->getName());\n }", "public function testIsValidSingleFilterA()\n\t{\n\t\t$value = 123;\n\t\t$field = 'my-field';\n\t\t$params = new Dictionary();\n\t\t$defaultError = 'I am a default error';\n\t\t\n\t\t/* create a new coorinator with the source the filter will pull from */\n\t\t$coord = new Coordinator(array($field=>$value));\n\n\t\t$filter = $this->getMockFilter();\n\t\t$filter->expects($this->once())\n\t\t\t ->method('filter')\n\t\t\t ->with($this->equalTo($value), $this->equalTo($params))\n\t\t\t ->will($this->returnValue($value));\n\n\t\t$filter->expects($this->once())\n\t\t\t ->method('getDefaultError')\n\t\t\t ->will($this->returnValue($defaultError));\n\n\t\t$filter->expects($this->once())\n\t\t\t ->method('isFailure')\n\t\t\t ->will($this->returnValue(false));\n\n\t\t$validator = new Validator($field, $filter);\n\t\t$this->assertTrue($validator->isValid($coord));\n\t\t$this->assertEquals($value, $coord->getClean($field));\n\t\t$this->assertFalse($coord->isError());\n\t}", "public static function dataFilter(array $array, $index, $value,\n $equal = true);", "public function testArrayValueExist(){\n $array = array('PI' => '3.14', 'ln(e)' => '1');\n $boolean = ArrayValidator::arrayValueExist($array,'1');\n $this->assertTrue($boolean);\n }", "public function testFilterEmptyResult() {\n $inputArray = [1, 2, 3, 4, 5, 6, 7, 8, 9];\n $collection = new GenericCollection();\n $collection->addArray($inputArray);\n $filtered = $collection->filter(function($object) {\n return $object > 99;\n });\n self::assertEquals($inputArray, $collection->getAll());\n self::assertEquals([], $filtered->getAll());\n self::assertEquals(0, $filtered->count());\n }", "public function testValidateFilteredValue()\n {\n $item = new Formagic_Item_Mock_MockItem('test');\n $rule = $this->getMockForAbstractClass('Formagic_Rule_Abstract', array(), '', false);\n $filter = new Formagic_Filter_Replace(array('foo' => 'bar'));\n\n $rule\n ->expects($this->once())\n ->method('validate')\n ->with('bar')\n ->will($this->returnValue(true));\n\n // one rule, validates true\n $validationResult = $item\n ->setValue('foo')\n ->addRule($rule)\n ->addFilter($filter)\n ->validate();\n $this->assertTrue($validationResult);\n }", "public function getFilterValue();", "function is_filtered()\n {\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Method to display the options from the available property
private function display_options () { foreach ($this->available as $key => $value) { display ( "$key - $value" ); } }
[ "function display_options()\n\t{\n\t\treturn $this->display_options;\n\t}", "function print_options(){\n\t\tforeach ($this->options as $value) {\n\t\t\t$this->print_option($value);\n\t\t}\n\t}", "public function displayOptions()\n {\n require_once 'wpop.php';\n WPop::call( 'wpop_page_theme_options', $this );\n }", "public function showOptions()\n {\n return $this->getConfigData('checkout/delivery_options');\n }", "function printOptions()\n {\n $lines = $this->outputOptions();\n echo join( \"\\n\" , $lines );\n }", "public function getAdvancedOptions();", "public function prnt()\n {\n $this->display(\n\n $this->opt()\n\n );\n }", "public function viewDiscountOptions() {\n echo $this;\n// Helper::displayInfoMessage(\"The discount options available for this vehicle\");\n foreach ($this->discountOptions as $option) {\n echo $option;\n }\n }", "public function show_plugin_settings(){\r\n\t\t\t\t\r\n\t\techo \"<pre>\";\r\n\t\t\tprint_r($this->opt);\r\n\t\techo \"</pre>\";\r\n\t\t\t\r\n\t}", "protected function renderOptions()\n {\n $options = '';\n foreach ($this->options as $optionValue => $option){\n \t$options.= '<option value=\"'.$optionValue.'\"';\n \tif ($this->isSelected($optionValue, $option)) $options.= ' selected';\n \tif (isset($option['isDisabled']) && $option['isDisabled']) $options.= ' disabled';\n \tif (isset($option['label']) && $option['label']) $options.= ' label=\"'.$options['label'].'\"';\n \t$options.= '>'.$option['text'].'</option>';\n }\n \treturn $options;\n }", "public function getOptionDescription();", "public function getOptionValues();", "public function renderOptions() {\r\r\n if ($this->fields_options && is_array($this->fields_options)) {\r\r\n if (isset($this->display) && $this->display != 'options' && $this->display != 'list') {\r\r\n $this->show_toolbar = false;\r\r\n } else {\r\r\n $this->display = 'options';\r\r\n }\r\r\n\r\r\n unset($this->toolbar_btn);\r\r\n $this->initToolbar();\r\r\n $helper = new Inix2HelperOptions($this);\r\r\n $this->setHelperDisplay($helper);\r\r\n $helper->module = $this->module;\r\r\n $helper->id = $this->id;\r\r\n $helper->tpl_vars = $this->tpl_option_vars;\r\r\n $options = $helper->generateOptions($this->fields_options);\r\r\n\r\r\n return $options;\r\r\n }\r\r\n }", "function show($prop) {\r\n\r\n echo $this->properties[$prop];\r\n }", "public function getFormattedOptions();", "function list_options( $args, $assoc_args ) {\n\n\t\t$options = wpro()->options->get_all_options();\n\t\tif (isset($assoc_args['keys'])) {\n\t\t\tforeach ($options as $key => $val) {\n\t\t\t\techo($key . \"\\n\");\n\t\t\t}\n\t\t} else {\n\t\t\tforeach ($options as $key => $val) {\n\t\t\t\techo($key . '=' . $val . \"\\n\");\n\t\t\t}\n\t\t}\n\n\t}", "public function render_screen_options()\n {\n }", "function show($prop) {\n\n\t\techo $this->properties[$prop];\n\t}", "private function renderOptions(): string\n {\n $str = '';\n if ($this->defaultText !== false) {\n $option = new OptionElement();\n $option->text = $this->defaultText;\n $option->value = $this->defaultValue;\n $str .= $option->render();\n }\n foreach ($this->arrOption as $option) {\n $this->setAutoOptionTitle($option);\n $str .= $option->render();\n }\n\n return $str;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Run the operation callback on the current LDAP connection.
protected function runOperationCallback(Closure $operation): mixed { return $operation($this->ldap); }
[ "public function execute(LdapOperationInterface $operation);", "function authLdapAction($callback, $user, &$object)\n{\n global $auth;\n global $ldap_host;\n global $ldap_port;\n global $ldap_v3;\n global $ldap_tls;\n global $ldap_base_dn;\n global $ldap_user_attrib;\n global $ldap_dn_search_attrib;\n global $ldap_dn_search_dn;\n global $ldap_dn_search_password;\n\n if (!function_exists(\"ldap_connect\"))\n {\n die(\"<hr><p><b>ERROR: PHP's 'ldap' extension is not installed/enabled. \".\n \"Please check your MRBS and web server configuration.</b></p><hr>\\n\");\n }\n\n $all_ldap_base_dn = array();\n $all_ldap_user_attrib = array();\n\n // Check that if there is an array of hosts and an array of ports\n // then the number of each must be the same or the authenication\n // is forced to fail.\n if (is_array( $ldap_base_dn ) && is_array( $ldap_user_attrib ) &&\n count($ldap_user_attrib) != count($ldap_base_dn) )\n {\n return 0;\n }\n\n // Transfer the based dn(s) to an new value to ensure that\n // an array is always used.\n // If a single value is passed then turn it into an array\n if (is_array( $ldap_base_dn ) )\n {\n $all_ldap_base_dn = $ldap_base_dn;\n }\n else\n {\n $all_ldap_base_dn = array($ldap_base_dn);\n }\n\n // Transfer the array of user attributes to a new value.\n // Create an array of the user attributes to match the number of\n // base dn's if a single user attribute has been passed.\n if (is_array( $ldap_user_attrib ) )\n {\n $all_ldap_user_attrib = $ldap_user_attrib;\n }\n else\n {\n while ( each($all_ldap_base_dn ) )\n {\n $all_ldap_user_attrib[] = $ldap_user_attrib;\n }\n }\n\n // establish ldap connection\n // the '@' suppresses errors\n if (isset($ldap_port))\n {\n $ldap = @ldap_connect($ldap_host, $ldap_port);\n }\n else\n {\n $ldap = @ldap_connect($ldap_host);\n }\n\n // Check that connection was established\n if ($ldap)\n {\n authLdapDebug(\"authLdapAction: Got LDAP connection\");\n\n if ($ldap_v3)\n {\n ldap_set_option($ldap, LDAP_OPT_PROTOCOL_VERSION, 3);\n }\n if ($ldap_tls)\n {\n ldap_start_tls($ldap);\n }\n\n // now process all base dn's until authentication is achieved\n // or fail\n foreach ( $all_ldap_base_dn as $idx => $base_dn)\n {\n authLdapDebug(\"authLdapAction: start of foreach $base_dn\");\n if (isset($ldap_dn_search_attrib))\n {\n if (isset($ldap_dn_search_dn) &&\n isset($ldap_dn_search_password))\n {\n // Bind with DN and password\n $res = @ldap_bind($ldap, $ldap_dn_search_dn,\n $ldap_dn_search_password);\n }\n else\n {\n // Anonymous bind\n $res = @ldap_bind($ldap);\n }\n authLdapDebug(\"authLdapAction: Result of initial bind is $res\");\n\n if ($res)\n {\n $res = @ldap_search($ldap,\n $base_dn,\n \"(\". $ldap_dn_search_attrib .\"=$user)\");\n\n if (@ldap_count_entries($ldap, $res) == 1)\n {\n authLdapDebug(\"authLdapAction: Found one entry using \".\n \"\\$ldap_dn_search_attrib\");\n $entries = ldap_get_entries($ldap, $res);\n $dn = $entries[0][\"dn\"];\n $user_search = \"distinguishedName=\" . $dn;\n }\n else\n {\n authLdapDebug(\"authLdapAction: Didn't find entry using \".\n \"\\$ldap_dn_search_attrib\");\n }\n authLdapDebug(\"authLdapAction: base_dn $base_dn user $user \".\n \"dn $dn\");\n }\n }\n else\n {\n // construct dn for user\n $user_search = $all_ldap_user_attrib[$idx] . \"=\" . $user;\n $dn = $user_search . \",\" . $base_dn;\n\n authLdapDebug(\"authLdapAction: Constructed dn $dn and \".\n \"user_search $user_search using \".\n \"\\$ldap_user_attrib\");\n }\n\n $res = $callback($ldap, $base_dn, $dn, $user_search, $user, $object);\n if ($res)\n {\n return $res;\n }\n\n } // foreach\n\n @ldap_unbind($ldap);\n } // if ($ldap)\n}", "function authLdapAction($callback, $user, &$object)\n{\n global $auth;\n global $ldap_host;\n global $ldap_port;\n global $ldap_v3;\n global $ldap_tls;\n global $ldap_base_dn;\n global $ldap_user_attrib;\n global $ldap_dn_search_attrib;\n global $ldap_dn_search_dn;\n global $ldap_dn_search_password;\n global $ldap_filter;\n global $ldap_group_member_attrib;\n global $ldap_admin_group_dn;\n global $ldap_email_attrib;\n global $ldap_disable_referrals;\n global $ldap_deref;\n global $ldap_filter_base_dn;\n global $ldap_filter_user_attr;\n\n if (!function_exists(\"ldap_connect\"))\n {\n die(\"<hr><p><b>ERROR: PHP's 'ldap' extension is not installed/enabled. \".\n \"Please check your MRBS and web server configuration.</b></p><hr>\\n\");\n }\n\n $ns_callback = __NAMESPACE__ . \"\\\\$callback\";\n \n // Transfer the values from the config variables into a local\n // associative array, turning them all into arrays\n \n $config_items = array(\n 'ldap_host',\n 'ldap_port',\n 'ldap_base_dn',\n 'ldap_user_attrib',\n 'ldap_dn_search_attrib',\n 'ldap_dn_search_dn',\n 'ldap_dn_search_password',\n 'ldap_filter',\n 'ldap_group_member_attrib',\n 'ldap_admin_group_dn',\n 'ldap_v3',\n 'ldap_tls',\n 'ldap_email_attrib',\n 'ldap_disable_referrals',\n 'ldap_deref',\n 'ldap_filter_base_dn',\n 'ldap_filter_user_attr'\n );\n\n $all_ldap_opts = array();\n\n \n foreach ($config_items as $item)\n {\n if (!isset($$item))\n {\n continue;\n }\n if (is_array($$item))\n {\n $all_ldap_opts[$item] = $$item;\n }\n // The case where the config item _isn't_ an array is handled\n // further down\n }\n\n $count = null;\n foreach ($all_ldap_opts as $key => $value)\n {\n if (isset($count))\n {\n if (count($value) != $count)\n {\n authLdapDebug(\"Count of LDAP array config variables doesn't match, aborting!\");\n fatal_error(\"MRBS configuration error: Count of LDAP array config variables doesn't match, aborting!\");\n return false;\n }\n }\n $count = count($value);\n }\n\n // Turn any non-array config items into arrays in $all_ldap_opts\n if (!isset($count))\n {\n $count = 1;\n }\n foreach ($config_items as $item)\n {\n if (!isset($$item))\n {\n continue;\n }\n if (!is_array($$item))\n {\n $all_ldap_opts[$item] = array_fill(0, $count, $$item);\n }\n }\n\n foreach ($all_ldap_opts['ldap_host'] as $idx => $host)\n {\n // establish ldap connection\n // the '@' suppresses errors\n if (isset($all_ldap_opts['ldap_port'][$idx]))\n {\n $ldap = @ldap_connect($host, $all_ldap_opts['ldap_port'][$idx]);\n }\n else\n {\n $ldap = @ldap_connect($host);\n }\n\n // Check that connection was established\n if ($ldap)\n {\n authLdapDebug(\"authLdapAction: Got LDAP connection\");\n\n if (isset($all_ldap_opts['ldap_deref'][$idx]))\n {\n ldap_set_option($ldap, LDAP_OPT_DEREF, $all_ldap_opts['ldap_deref'][$idx]);\n }\n if (isset($all_ldap_opts['ldap_v3'][$idx]) &&\n $all_ldap_opts['ldap_v3'][$idx])\n {\n ldap_set_option($ldap, LDAP_OPT_PROTOCOL_VERSION, 3);\n }\n if (isset($all_ldap_opts['ldap_tls'][$idx]) &&\n $all_ldap_opts['ldap_tls'][$idx])\n {\n ldap_start_tls($ldap);\n }\n if(isset($all_ldap_opts['ldap_disable_referrals'][$idx]) && $all_ldap_opts['ldap_disable_referrals'][$idx])\n {\n // Required to do a search on Active Directory for Win 2003+\n ldap_set_option($ldap, LDAP_OPT_REFERRALS, 0);\n }\n \n if (isset($all_ldap_opts['ldap_dn_search_attrib'][$idx]))\n {\n if (isset($all_ldap_opts['ldap_dn_search_dn'][$idx]) &&\n isset($all_ldap_opts['ldap_dn_search_password'][$idx]))\n {\n // Bind with DN and password\n $res = @ldap_bind($ldap, $all_ldap_opts['ldap_dn_search_dn'][$idx],\n $all_ldap_opts['ldap_dn_search_password'][$idx]);\n }\n else\n {\n // Anonymous bind\n $res = @ldap_bind($ldap);\n }\n\n if (!$res)\n {\n authLdapDebug(\"authLdapAction: Initial bind failed: \".ldap_error($ldap));\n }\n else\n {\n authLdapDebug(\"authLdapAction: Initial bind was successful\");\n\n $res = @ldap_search($ldap,\n $all_ldap_opts['ldap_base_dn'][$idx],\n \"(\". $all_ldap_opts['ldap_dn_search_attrib'][$idx] .\"=$user)\");\n\n if (@ldap_count_entries($ldap, $res) == 1)\n {\n authLdapDebug(\"authLdapAction: Found one entry using '\".\n $all_ldap_opts['ldap_dn_search_attrib'][$idx].\"'\");\n $entries = ldap_get_entries($ldap, $res);\n $dn = $entries[0][\"dn\"];\n $user_search = \"distinguishedName=\" . $dn;\n }\n else\n {\n authLdapDebug(\"authLdapAction: Didn't find entry using '\".\n $all_ldap_opts['ldap_dn_search_attrib'][$idx].\"'\");\n }\n authLdapDebug(\"authLdapAction: base_dn '\".\n $all_ldap_opts['ldap_base_dn'][$idx].\n \"' user '$user' dn '$dn'\");\n }\n }\n else\n {\n // construct dn for user\n $user_search = $all_ldap_opts['ldap_user_attrib'][$idx] . \"=\" . $user;\n $dn = $user_search . \",\" . $all_ldap_opts['ldap_base_dn'][$idx];\n\n authLdapDebug(\"authLdapAction: Constructed dn '$dn' and \".\n \"user_search '$user_search' using '\".\n $all_ldap_opts['ldap_user_attrib'][$idx].\"'\");\n }\n\n foreach ($config_items as $item)\n {\n if (isset($all_ldap_opts[$item][$idx]))\n {\n $object['config'][$item] = $all_ldap_opts[$item][$idx];\n }\n }\n\n if (!$dn)\n {\n authLdapDebug(\"authLdapAction: No DN determined, not calling callback\");\n }\n else\n {\n $res = $ns_callback($ldap, $all_ldap_opts['ldap_base_dn'][$idx], $dn,\n $user_search, $user, $object);\n if ($res)\n {\n return $user;\n }\n }\n\n } // if ($ldap)\n\n @ldap_unbind($ldap);\n } // foreach\n \n return false;\n}", "function ldap_set_rebind_proc ($link, $callback) {}", "function ldap_set_rebind_proc($link, $callback): bool {}", "function doLDAPAuth($username, $password) {\n\t\tglobal $fmdb;\n\n\t\t/** Get LDAP variables */\n\t\tif (empty($ldap_server)) $ldap_server = getOption('ldap_server');\n\t\tif (empty($ldap_port)) $ldap_port = getOption('ldap_port');\n\t\tif (empty($ldap_port_ssl)) $ldap_port_ssl = getOption('ldap_port_ssl');\n\t\tif (empty($ldap_version)) $ldap_version = getOption('ldap_version');\n\t\tif (empty($ldap_encryption)) $ldap_encryption = getOption('ldap_encryption');\n\t\tif (empty($ldap_referrals)) $ldap_referrals = getOption('ldap_referrals');\n\t\tif (empty($ldap_dn)) $ldap_dn = getOption('ldap_dn');\n\t\tif (empty($ldap_group_require)) $ldap_group_require = getOption('ldap_group_require');\n\t\tif (empty($ldap_group_dn)) $ldap_group_dn = getOption('ldap_group_dn');\n\t\tif (empty($ldap_group_attribute)) $ldap_group_attribute = getOption('ldap_group_attribute');\n\n\t\t$ldap_dn = str_replace('<username>', $username, $ldap_dn);\n\n\t\tif ($ldap_encryption == 'SSL') {\n\t\t\t$ldap_connect = @ldap_connect('ldaps://' . $ldap_server, $ldap_port_ssl);\n\t\t} else {\n\t\t\t$ldap_connect = @ldap_connect($ldap_server, $ldap_port);\n\t\t}\n\t\t\n\t\tif ($ldap_connect) {\n\t\t\t/** Set protocol version */\n\t\t\tif (!@ldap_set_option($ldap_connect, LDAP_OPT_PROTOCOL_VERSION, $ldap_version)) {\n\t\t\t\t$this->closeLDAPConnect($ldap_connect);\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t\t/** Set referrals */\n\t\t\tif(!@ldap_set_option($ldap_connect, LDAP_OPT_REFERRALS, $ldap_referrals)) {\n\t\t\t\t$this->closeLDAPConnect($ldap_connect);\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t\t/** Start TLS if requested */\n\t\t\tif ($ldap_encryption == 'TLS') {\n\t\t\t\tif (!@ldap_start_tls($ldap_connect)) {\n\t\t\t\t\t$this->closeLDAPConnect($ldap_connect);\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$ldap_bind = @ldap_bind($ldap_connect, $ldap_dn, $password);\n\t\t\t\n\t\t\tif ($ldap_bind) {\n\t\t\t\tif ($ldap_group_require) {\n\t\t\t\t\tif (strpos($ldap_dn, '@') !== false) {\n\t\t\t\t\t\t/** Convert AD ldap_dn to real ldap_dn */\n\t\t\t\t\t\t$ldap_dn_parts = explode('@', $ldap_dn);\n\t\t\t\t\t\t$ldap_dn = 'dc=' . join(',dc=', explode('.', $ldap_dn_parts[1]));\n\t\t\t\t\t\t\n\t\t\t\t\t\t/** Process AD group membership */\n\t\t\t\t\t\t$ldap_group_response = $this->checkGroupMembership($ldap_connect, $this->getDN($ldap_connect, $username, $ldap_dn), $ldap_group_dn, $ldap_group_attribute);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t/** Process LDAP group membership */\n\t\t\t\t\t\t$ldap_group_response = @ldap_compare($ldap_connect, $ldap_group_dn, $ldap_group_attribute, $username);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif ($ldap_group_response !== true) {\n\t\t\t\t\t\t$this->closeLDAPConnect($ldap_connect);\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t/** Get user permissions from database */\n\t\t\t\t$fmdb->get_results(\"SELECT * FROM `fm_users` WHERE `user_status`='active' AND `user_auth_type`=2 AND `user_template_only`='no' AND `user_login`='$username'\");\n\t\t\t\tif (!$fmdb->num_rows) {\n\t\t\t\t\tif (!$this->createUserFromTemplate($username)) {\n\t\t\t\t\t\t$this->closeLDAPConnect($ldap_connect);\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$this->setSession($fmdb->last_result[0]);\n\n\t\t\t\t$this->closeLDAPConnect($ldap_connect);\n\t\t\t\t\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\t\n\t\t\t/** Close LDAP connection */\n\t\t\t$this->closeLDAPConnect($ldap_connect);\n\t\t}\n\t\t\n\t\treturn false;\n\t}", "protected function _openLDAP() {\n if($this->con) return true; // connection already established\n\n $this->bound = 0;\n\n $port = $this->getConf('port');\n $bound = false;\n $servers = explode(',', $this->getConf('server'));\n foreach($servers as $server) {\n $server = trim($server);\n $this->con = @ldap_connect($server, $port);\n if(!$this->con) {\n continue;\n }\n\n /*\n * When OpenLDAP 2.x.x is used, ldap_connect() will always return a resource as it does\n * not actually connect but just initializes the connecting parameters. The actual\n * connect happens with the next calls to ldap_* funcs, usually with ldap_bind().\n *\n * So we should try to bind to server in order to check its availability.\n */\n\n //set protocol version and dependend options\n if($this->getConf('version')) {\n if(!@ldap_set_option(\n $this->con, LDAP_OPT_PROTOCOL_VERSION,\n $this->getConf('version')\n )\n ) {\n error('Setting LDAP Protocol version '.$this->getConf('version').' failed', -1);\n $this->_debug('LDAP version set: '.htmlspecialchars(ldap_error($this->con)), 0, __LINE__, __FILE__);\n } else {\n //use TLS (needs version 3)\n if($this->getConf('starttls')) {\n if(!@ldap_start_tls($this->con)) {\n error('Starting TLS failed', -1);\n $this->_debug('LDAP TLS set: '.htmlspecialchars(ldap_error($this->con)), 0, __LINE__, __FILE__);\n }\n }\n // needs version 3\n if($this->getConf('referrals')) {\n if(!@ldap_set_option(\n $this->con, LDAP_OPT_REFERRALS,\n $this->getConf('referrals')\n )\n ) {\n error('Setting LDAP referrals to off failed', -1);\n $this->_debug('LDAP referal set: '.htmlspecialchars(ldap_error($this->con)), 0, __LINE__, __FILE__);\n }\n }\n }\n }\n\n //set deref mode\n if($this->getConf('deref')) {\n if(!@ldap_set_option($this->con, LDAP_OPT_DEREF, $this->getConf('deref'))) {\n error('Setting LDAP Deref mode '.$this->getConf('deref').' failed', -1);\n $this->_debug('LDAP deref set: '.htmlspecialchars(ldap_error($this->con)), 0, __LINE__, __FILE__);\n }\n }\n /* As of PHP 5.3.0 we can set timeout to speedup skipping of invalid servers */\n if(defined('LDAP_OPT_NETWORK_TIMEOUT')) {\n ldap_set_option($this->con, LDAP_OPT_NETWORK_TIMEOUT, 1);\n }\n\n if($this->getConf('binddn') && $this->getConf('bindpw')) {\n $bound = @ldap_bind($this->con, $this->getConf('binddn'), $this->getConf('bindpw'));\n $this->bound = 2;\n } else {\n $bound = @ldap_bind($this->con);\n }\n if($bound) {\n break;\n }\n }\n\n if(!$bound) {\n error(\"LDAP: couldn't connect to LDAP server\", -1);\n return false;\n }\n\n $this->cando['getUsers'] = true;\n return true;\n }", "private function check_ldap_connection() {\n $this->log->LogInfo(\"Verification de la connexion LDAP\");\n // A FAIRE SI BESOIN\n }", "private function checkLdapConnection()\n\t{\n\t\tif (empty($this->ldapAuth['LdapConnectorAuthentication']['auth_users'])) {\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t$connector = $this->ldapAuth['AuthUsers'];\n\n\t\t$LdapConnector = $this->LdapConnectorsMgt->getConnector($connector);\n\t\t$ldapConnection = $LdapConnector->connect();\n\t\t$LdapConnector->unbind();\n\n\t\t$this->set('ldapConnection', $ldapConnection);\n\t}", "public function set_rebind_proc($callback)\n {\n return @ldap_set_rebind_proc($this->link, $callback);\n }", "abstract function onOpenDirectory();", "public function close() {\n ldap_close ($this->_conn);\n }", "protected function connect(): void\n {\n if (is_resource($this->connection)) {\n return;\n }\n\n $this->connection = ldap_connect($this->protocol . $this->host, $this->port);\n\n ldap_set_option($this->connection, LDAP_OPT_PROTOCOL_VERSION, $this->ldapVersion);\n ldap_set_option($this->connection, LDAP_OPT_REFERRALS, $this->followReferrals);\n\n ldap_set_option($this->connection, LDAP_OPT_NETWORK_TIMEOUT, $this->connectTimeout);\n ldap_set_option($this->connection, LDAP_OPT_TIMELIMIT, $this->timeout);\n\n if (!$this->connection) {\n throw new Yii2LdapAuthException(\n 'Unable to connect to LDAP. Code '\n . ldap_errno($this->connection)\n . '. Message: '\n . ldap_error($this->connection)\n );\n }\n\n if (!@ldap_bind($this->connection, $this->searchUserName, $this->searchUserPassword)) {\n throw new Yii2LdapAuthException(\n 'Unable to bind LDAP search user. Code '\n . ldap_errno($this->connection)\n . '. Message: '\n . ldap_error($this->connection)\n );\n }\n }", "private function doSearch()\n {\n $function = $this->search_function;\n $this->search_result = @$function(\n $this->conn,\n $this->base,\n $this->filter,\n $this->attrs,\n 0,\n $this->size_limit,\n $this->time_limit,\n $this->deref\n );\n if (!$this->search_result) {\n throw new LdapException($this->conn);\n }\n\n // retrieve the first result\n $this->current_entry = ldap_first_entry($this->conn, $this->search_result);\n }", "function ldap_bind(#[PhpVersionAware(['8.1' => 'LDAP\\Connection'], default: 'resource')] $ldap, ?string $dn, ?string $password): bool {}", "function conn_ldap($host,$port,$user,$pwd,$username, &$err) {\n\t$err = '';\n $ldapconn = ldap_connect($host, $port);\n ldap_set_option($ldapconn, LDAP_OPT_NETWORK_TIMEOUT, 5);\n if ($ldapconn) {\n // binding to ldap server\n syslog(LOG_INFO, \"$username: Info: LDAP: Trying to connect to $host:$port\");\n $ldapbind = ldap_bind($ldapconn, $user, $pwd);\n // verify binding\n if ($ldapbind) {\n syslog(LOG_INFO, \"$username: Info: LDAP: Successfully BIND as <\".$user.'>.');\n\t\t\treturn $ldapconn;\n }\n else {\n $err = 'LDAP: Error trying to bind on <'.$host.'> as <'.$user.'>: '.ldap_error($ldapconn);\n\t\t\tldap_get_option($ldapconn, LDAP_OPT_DIAGNOSTIC_MESSAGE, $detail);\n\t\t\tif (!is_null($detail)) $err.= \". Details: $detail.\";\n syslog(LOG_ERR, \"$username: Error: $err.\");\n ldap_unbind($ldapconn);\n\t\t\t$err = str_replace(\" on <$host> as <$user>\", '', $err);\n\t\t\treturn FALSE;\n }\n }\n else {\n $err = 'LDAP: Could not connect to LDAP server '.$host.':'.$port;\n\t\tldap_get_option($ldapconn, LDAP_OPT_DIAGNOSTIC_MESSAGE, $detail);\n\t\t$err .= \". Details: $detail.\";\n syslog(LOG_ERR, $username.\": Error: $err. Details: $detail.\");\n\t\treturn FALSE;\n }\n}", "public static function authenticateUsing(callable $callback)\n {\n static::$authenticateUsingCallback = $callback;\n }", "public function setRebindCallback(callable $callback)\n {\n return ldap_set_rebind_proc($this->connection, $callback);\n }", "function plugin_auth_ldap($username, $password) {\n\t\t$ldapServers = explode(',',AUTHBACKENDHOST);\n\t\tforeach($ldapServers as $key => $value) {\n\t\t\t// Calculate parts\n\t\t\t$digest = parse_url(trim($value));\n\t\t\t$scheme = strtolower((isset($digest['scheme'])?$digest['scheme']:'ldap'));\n\t\t\t$host = (isset($digest['host'])?$digest['host']:(isset($digest['path'])?$digest['path']:''));\n\t\t\t$port = (isset($digest['port'])?$digest['port']:(strtolower($scheme)=='ldap'?389:636));\n\n\t\t\t// Reassign\n\t\t\t$ldapServers[$key] = $scheme.'://'.$host.':'.$port;\n\t\t}\n\n\t\t// returns true or false\n\t\t$ldap = ldap_connect(implode(' ',$ldapServers));\n\t\tif(empty(AUTHBACKENDDOMAINFORMAT)){\n\t\t\tif ($bind = ldap_bind($ldap, AUTHBACKENDDOMAIN.'\\\\'.$username, $password)) {\n\t\t\t\twriteLog(\"success\", \"LDAP authentication success\");\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\twriteLog(\"error\", \"LDAP could not authenticate\");\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}else{\n\t\t\tldap_set_option($ldap, LDAP_OPT_PROTOCOL_VERSION, 3);\n\t\t\tldap_set_option($ldap, LDAP_OPT_REFERRALS, 0);\n\t\t\t$bind = @ldap_bind($ldap, sprintf(AUTHBACKENDDOMAINFORMAT, $username), $password);\n\t\t\tif ($bind) {\n\t\t\t\twriteLog(\"success\", \"LDAP authentication success\");\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\twriteLog(\"error\", \"LDPA could not authenticate\");\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n \t\twriteLog(\"error\", \"LDAP could not authenticate\");\n\t\treturn false;\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Remove $needle from the beginning of $string
public static function removeLeft( string $string, string $needle, bool $caseSensitive = false, $encoding = null ) : string { if (static::startsWith($string, $needle, $caseSensitive, $encoding)) { return static::sub($string, static::length($needle, $encoding), null, $encoding); } return $string; }
[ "public static function removeStart(string $haystack, string $needle): string\n {\n return static::startsWith($haystack, $needle) ? substr($haystack, strlen($needle)) : $haystack;\n }", "function string_without($haystack, $needle)\n {\n if (! empty($haystack) && ! empty($needle)) {\n if (strpos($haystack, $needle) !== false) {\n return str_replace($needle, '', $haystack);\n }\n }\n\n return $haystack;\n }", "function str_remove_first(string $needle, string $object)\n {\n return Str::removeFirst($needle, $object);\n }", "function adace_str_replace_first( $needle, $replace, $haystack ) {\n\t$newstring = $haystack;\n\t$pos = strpos( $haystack, $needle );\n\tif ( false !== $pos ) {\n\t\t$newstring = substr_replace( $haystack, $replace, $pos, strlen( $needle ) );\n\t}\n\treturn $newstring;\n}", "public static function remove_first($input, $string)\n\t{\n\t\tif (($pos = strpos($input, $string)) !== false) {\n\t\t\t$input = substr_replace($input, '', $pos, strlen($string));\n\t\t}\n\n\t\treturn $input;\n\t}", "public static function stringWithout($haystack, $needle)\n {\n if (!empty($haystack) && !empty($needle)) {\n if (strpos($haystack, $needle) !== false) {\n return str_replace($needle, '', $haystack);\n }\n }\n return $haystack;\n }", "function first_str_replace($haystack, $needle, $replace) {\n\t$pos = strpos($haystack, $needle);\n\tif ($pos !== false) return substr_replace($haystack, $replace, $pos, strlen($needle));\n\treturn $haystack;\n}", "private function strReplaceFirst($needle, $replace, $haystack) {\n\t\t$pos = strpos($haystack, $needle, $this->replacementOffset);\n\t\t\n\t\tif ($pos !== false) {\n\t\t\t$this->replacementOffset = $pos + strlen($replace);\n\t\t\treturn substr_replace($haystack, $replace, $pos, strlen($needle));\n\t\t}\n\t\t\n\t\treturn $haystack;\n\t}", "function str_before($haystack, $needle)\n{\n\tif ((int) $needle) {\n\t\treturn substr($haystack, -$needle);\n\t}\n\n\tif (str_contains($haystack, $needle)) {\n\t\treturn strstr($haystack, $needle, true);\n\t}\n\n\treturn $haystack;\n}", "function str_replace_once($needle, $replace, $haystack) {\n\t$pos = strpos($haystack, $needle);\n\tif ($pos === false) {\n\t\t// Nothing found\n\t\treturn $haystack;\n\t}\n\treturn substr_replace($haystack, $replace, $pos, strlen($needle));\n}", "function str_replace_first( string $needle, string $replacement, string $haystack ) {\n \n // Replace the first occurrence.\n return str_replace_nth($needle, $replacement, $haystack, 1);\n \n}", "public static function unmakeStartsWith(string $string = \"\", string $startsWith = \"\"): string\n {\n if (self::startsWith($string, $startsWith) === true) {\n return substr_replace($string, '', 0, strlen($startsWith));\n }\n\n return $string;\n }", "public static function beforeLast( string $needle, string $haystack ) : string\n {\n if( ! str_contains( $haystack, $needle )) {\n return self::$SP0;\n }\n return substr( $haystack, 0, self::strrevpos( $haystack, $needle ));\n }", "function str_replace_first($search, $replace, $subject)\n{\n\t$pos = strpos($subject, $search);\n\n\tif ($pos !== false) {\n\t\t$subject = substr_replace($subject, $replace, $pos, strlen($search));\n\t}\n\n\treturn $subject;\n}", "function str_replace_first($find, $replace, $string) {\r\n\t$pos = strpos($string, $find);\r\n\tif ($pos !== false) {\r\n\t\treturn substr_replace($string, $replace, $pos, strlen($find));\r\n\t}\r\n\treturn $string;\r\n}", "public static function stripLeading($replace, $string)\r\n {\r\n if (substr($string, 0, strlen($replace)) == $replace) {\r\n return substr($string, strlen($replace));\r\n } else {\r\n return $string;\r\n }\r\n }", "function str_replace_first($search_for, $replace_with, $in) {\n $pos = strpos($in, $search_for);\n if($pos === false) {\n return $in;\n } else {\n return substr($in, 0, $pos) . $replace_with . substr($in, $pos + strlen($search_for), strlen($in));\n } // if\n}", "public static function replaceFirst($haystack, $needle, $replace)\n {\n $pos = strpos($haystack, $needle);\n if ($pos === false) {\n return $haystack;\n }\n\n return substr_replace($haystack, $replace, $pos, strlen($needle));\n }", "public static function before( string $needle, string $haystack ) : string\n {\n if( ! str_contains( $haystack, $needle )) {\n return self::$SP0;\n }\n return substr( $haystack, 0, strpos( $haystack, $needle ));\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Configures the subject mapping.
private function configureSubjectMapping(LoadClassMetadataEventArgs $eventArgs) { $metadata = $eventArgs->getClassMetadata(); $class = $metadata->getName(); // Check class if (!is_subclass_of($class, SubjectInterface::class)) { return; } // Don't add twice if (in_array($class, $this->subjectClassCache)) { return; } // Add mappings $this->addMappings($metadata, $this->getSubjectMappings()); // Cache class $this->subjectClassCache[] = $class; }
[ "abstract public function configureMapping();", "protected function setSubjects() {\n $subj = array();\n foreach ($this->formulas as $formula) {\n $subj[$formula->getSubject()] = 1;\n }\n $this->subjects = array_keys($subj);\n }", "public function setSubject( $subject );", "private function initialConfig() {\n\t\t$this->mailer->FromName = \"Contato\";\n\t\t$this->mailer->From = \"contato@ebanc.com.br\";\n\t\t$this->mailer->Sender = \"contato@ebanc.com.br\";\n\n\t\t//Subject\n\t\t$this->mailer->Subject = $this->getSubject();\n\t}", "public function setMapping(): void {\n // TODO: Implement setMapping() method.\n }", "private function setupMapping()\n {\n $this->mapping = array();\n $fields = array();\n\n $aliases = array_keys($this->getJoinSettings());\n\n foreach ($aliases as $i => $alias) {\n $fields = array_merge($fields, $this->mapAlias($alias));\n }\n\n $this->mapping['fields'] = array_replace_recursive($fields, $this->getCustomMapping());\n $this->mapping['joins'] = $this->getJoinSettings();\n }", "public function setSubjectSessionVariables()\n\t{\n\t\t$all_session_vars = Session::all();\n\n\t\tforeach ($all_session_vars as $key => $value) {\n\t\t\tswitch ($key) {\n\t\t\t\tcase 'dex':\n\t\t\t\t\t$this->subject .= '- ' . $key . ' ' . $value;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'YouTube':\n\t\t\t\t\t$this->subject .= '- ' . $key . ' ' . $value;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'Facebook':\n\t\t\t\t\t$this->subject .= '- ' . $key . ' ' . $value;\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}", "public function setSubject($subject);", "public function setSubject( $subject )\n {\n \n if (! $subject instanceof Subject ) {\n $subject = new Subject($subject);\n }\n \n $this->subject = $subject; \n }", "private function configureSubjectRelativeMapping(LoadClassMetadataEventArgs $eventArgs)\n {\n $metadata = $eventArgs->getClassMetadata();\n $class = $metadata->getName();\n\n // Check class\n if (!is_subclass_of($class, SubjectRelativeInterface::class)) {\n return;\n }\n\n // Don't add twice\n if (in_array($class, $this->subjectRelativeClassCache)) {\n return;\n }\n\n // Add mappings\n $this->addMappings($metadata, $this->getSubjectRelativeMappings());\n\n // Map embedded\n $this\n ->getSubjectIdentityMapper($eventArgs->getEntityManager())\n ->processClassMetadata($metadata, 'subjectIdentity', 'subject_');\n\n // Cache class\n $this->subjectRelativeClassCache[] = $class;\n }", "private function setSubject()\n {\n $this->subject = trans('activation.emails.' . $this->kind . '_subject');\n }", "public function startup() {\n parent::startup();\n\n $this->redirect('Subjects:');\n }", "protected function initDefaultSubject() {\n // This cover the scenario when we directly go to user e.g. ?page=aam&user=38\n // or through AJAX post request with user ID\n $forceUser = AAM_Core_Request::request('user');\n \n // TODO: The aam_list_roles is legacy and can be removed in Oct 2021\n if (!$forceUser && (current_user_can('aam_manage_roles') || current_user_can('aam_list_roles'))) {\n $roles = array_keys(get_editable_roles());\n $this->initRequestedSubject(AAM_Core_Subject_Role::UID, array_shift($roles));\n // TODO: The list_users is legacy and can be removed in Oct 2021\n } elseif (current_user_can('aam_manage_users') || current_user_can('list_users')) {\n $this->initRequestedSubject(\n AAM_Core_Subject_User::UID,\n ($forceUser ? intval($forceUser) : get_current_user_id())\n );\n // TODO: The aam_list_roles is legacy and can be removed in Oct 2021\n } elseif (current_user_can('aam_manage_visitors')) {\n $this->initRequestedSubject(AAM_Core_Subject_Visitor::UID, null);\n } elseif (current_user_can('aam_manage_default')) {\n $this->initRequestedSubject(AAM_Core_Subject_Default::UID, null);\n }\n }", "public function set_info_subject($subject)\n {\n $this->_zpdf->properties['Subject'] = $subject;\n }", "public function getSubjectConfiguration();", "private function _pdfPagePropertiesSubject()\n {\n $confName = $this->_conf[ 'pdf.' ][ 'pageproperties.' ][ 'documentSubject' ];\n $confObj = $this->_conf[ 'pdf.' ][ 'pageproperties.' ][ 'documentSubject.' ];\n $this->_tcpdf->SetSubject( PdfController::_zzCObjGetSingle( $confName, $confObj ) );\n }", "public function setSubject($subject)\r\n {\r\n $this->setAttribute($this->getSubjectAttributeName(), $subject);\r\n }", "public function setSubject()\n {\n if (isset($this->subjectText)) {\n $this->messageObject->setSubject($this->subjectText);\n }\n }", "private function setRequestMailboxConfig() : void {\n $this->requestMailboxConfig = new MailboxConfig(env(\"REQUEST_MAILBOX_IMAP_INBOX\"),\n env(\"REQUEST_MAILBOX_IMAP_ARCHIVE\"));\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Copies item with given key from source array to the destination, if the key exists in the source. If not does nothing.
function copy_array_item_if_exist( &$p_arr_src, &$p_arr_dst, $key ) { if( array_key_exists( $key, $p_arr_src ) ) { $p_arr_dst[$key] = $p_arr_src[$key]; } }
[ "private function copy_array($source = Array(), $map = Array(), $value_key = false) {\n $res = Array();\n foreach ($map as $key => $value) {\n $source_key = ($value_key) ? $value : $key;\n if (array_key_exists($source_key, $source)) {\n $res[$value] = $source[$source_key];\n }\n }\n return $res;\n }", "function TransferHashKeys($source,&$dest)\n{\n //Check if we are simple array\n if (isset($source[0]))\n {\n //If we are simple array, transfer contents by array_push\n //and return\n if (!is_array($dest)) { $dest=array(); }\n\n for ($n=0;$n<count($source);$n++)\n {\n array_push($dest,$source[$n]);\n }\n\n return;\n }\n\n foreach ($source as $key => $value)\n {\n if (is_array($source[ $key ]))\n {\n if (!isset($dest[ $key ]))\n {\n $dest[ $key ]=array();\n }\n\n $this->TransferHashKeys($source[ $key ],$dest[ $key ]);\n }\n else\n {\n $dest[ $key ]=$source[ $key ];\n }\n }\n}", "private function _copySection($source, &$target)\n {\n foreach ($source as $key => $value) {\n\n if (!array_key_exists($key, $target)) $target[$key] = $value;\n }\n }", "public static function array_insert_before_key( $key, $source_array, $insert_array ) {\n\t\tif ( array_key_exists( $key, $source_array ) ) {\n\t\t\t$position = array_search( $key, array_keys( $source_array ) );\n\t\t\t$source_array = array_slice( $source_array, 0, $position, true ) + $insert_array + array_slice( $source_array, $position, null, true );\n\t\t} else {\n\t\t\t// If no key is found, then add it to the end of the array.\n\t\t\t$source_array += $insert_array;\n\t\t}\n\n\t\treturn $source_array;\n\t}", "private function _copySection($source, &$target)\n {\n foreach ($source as $key => $value) {\n if (!array_key_exists($key, $target)) {\n $target[$key] = $value;\n }\n }\n }", "public function sUnionStore($destination, $key);", "public function copyTo(&$array, $index);", "abstract public function delete(array $source_key);", "public static function arraycopy(array &$src, $srcPos, array &$dest, $destPos, $length)\n {\n $srcPos = (int) $srcPos;\n $destPos = (int) $destPos;\n $length = (int) $length;\n array_splice($dest, $destPos, $length, array_slice($src, $srcPos, $length));\n }", "function array_insert(array $array, $before_key, array $array2) {\n if (!\\array_key_exists($before_key, $array))\n \\trigger_error(\"The key '$before_key' does not exist in \\$array.\", \\E_USER_ERROR);\n $new_array = array();\n foreach ($array as $key => $value) {\n if ($key === $before_key) {\n foreach ($array2 as $key2 => $value2) {\n if (!\\array_key_exists($key2, $new_array))\n $new_array[$key2] = $value2;\n }\n $before_key = null;\n }\n if (!\\array_key_exists($key, $new_array))\n $new_array[$key] = $value;\n }\n return $new_array;\n}", "protected function add_key_to_array_if_exists_in_other_array( $key, $terms, $item ) {\n\t\tif ( isset( $item[ $key ] ) ) {\n\t\t\t$terms[] = $item[ $key ];\n\t\t}\n\t\treturn $terms;\n\t}", "public static function arraycopy(&$src, $srcPos, &$dest, $destPos, $length) {\n for ($i = 0; $i < $length; $i++) {\n $dest[$destPos++] = $src[$srcPos++];\n }\n }", "function add_missing($array, $array2, $key){\n foreach($array2 as $item_to_add){\n if(is_in_array($array, function($item) use ($key, $item_to_add){\n $item->$key == $item_to_add->$key;\n }) == -1){\n array_push($array, $item_to_add);\n }\n }\n return $array;\n}", "public function sDiffStore($destination, $key);", "public function copyKeys($source, $target) {\n\t\t$sourcePath = $this->getPathToKeys($source);\n\t\t$targetPath = $this->getPathToKeys($target);\n\n\t\tif ($this->view->file_exists($sourcePath)) {\n\t\t\t$this->keySetPreparation(dirname($targetPath));\n\t\t\t$this->view->copy($sourcePath, $targetPath);\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "function array_insert_before($key, array &$array, $new_key, $new_value) {\n if (array_key_exists($key, $array)) {\n $new = array();\n foreach ($array as $k => $value) {\n if ($k === $key) {\n $new[$new_key] = $new_value;\n }\n $new[$k] = $value;\n }\n return $new;\n }\n return FALSE;\n }", "function array_insert_before($key, array &$array, $new_key, $new_value) {\n\tif (array_key_exists($key, $array)) {\n\t\t$new = array();\n\t\tforeach ($array as $k => $value) {\n\t\t\tif ($k === $key) {\n\t\t\t\t$new[$new_key] = $new_value;\n\t\t\t}\n\t\t\t$new[$k] = $value;\n\t\t}\n\t\treturn $new;\n\t}\n\treturn FALSE;\n}", "public static function insertAt(array &$array, $key, $item): void\n {\n if (is_int($key)) {\n array_splice($array, $key, 0, $item);\n } else {\n $pos = array_search($key, array_keys($array));\n assert($pos !== false);\n $part1 = array_slice($array, 0, $pos);\n $part2 = array_slice($array, $pos);\n assert($part1 !== false);\n assert($part2 !== false);\n $array = array_merge($part1, $item, $part2);\n }\n }", "function zapArrayElement($key, &$array) {\r\n\r\n\t\t$idx = array_search( $key, array_keys($array) );\r\n\r\n\t\tif( $idx === NULL || $idx === False) {\r\n\t\t\treturn False; // Not found, nothing to do\r\n\t\t} else {\r\n\t\t\tarray_splice( $array, $idx, 1);\r\n\t\t\treturn True;\r\n\t\t}\r\n\r\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Change a user status to lock
protected function lockAction() { $this->changeStatusAction ->setAccess($this, Access::CAN_LOCK) ->execute($this, UserEntity::class, UserActionEvent::class, NULL, __METHOD__,[], [], ['status' => 'lock']) ->endAfterExecution(); }
[ "public function lock()\n {\n if (\\Access::active())\n {\n \\Access::user()->fill(['locked' => true])->save();\n }\n }", "function lock() {\n if (!$this->active_object->can_have_comments) {\n $this->httpError(HTTP_ERR_NOT_FOUND, null, true, $this->request->isApiCall());\n } // if\n \n if (!$this->active_object->canChangeLockedState($this->logged_user)) {\n $this->httpError(HTTP_ERR_FORBIDDEN, null, true, $this->request->isApiCall());\n } // if\n \n $this->executeOnActiveObject('lock', array($this->logged_user), \n lang(':type \":name\" has been locked', array('type' => $this->active_object->getVerboseType(), 'name' => $this->active_object->getName())), \n lang('Failed to lock :type \":name\"', array('type' => $this->active_object->getVerboseType(true), 'name' => $this->active_object->getName()))\n );\n }", "public function changeStatus($user_id,$status);", "public function lock($user)\n {\n $this->users->updateById((string) $user->getIdentifier(), [\n $user->getLockedAttributeName() => true,\n $user->getLockExpiresAtAttributeName() => date('Y-m-d H:i:s', ImmutableDateTime::addMinutes(new \\DateTimeImmutable(), static::getLockTimeoutInMinutes())->getTimestamp()),\n $user->getLoginAttemptsAttributeName() => 0,\n ]);\n }", "private function dbLockUser($userid)\t\r\n\t{\r\n\t\tglobal $db;\r\n\t\t$q = \"UPDATE equfw.musers SET status=\".USER_LOCKED.\" where upper(userid)='{$userid}';\";\r\n\t\treturn $db->query($q);\r\n\t}", "public function assignLock( $user, $lockToken );", "public function toggleUserLock ($data) {\n // Confirm the request came from an admin.\n if (!self::isActive()) { return false; }\n // Validate the passed parameters.\n if (!is_object($data)) { return false; }\n if (!property_exists($data, 'username')) { return false; }\n // Toggle the lock and return result.\n return parent::toggleLock($data->username);\n }", "public function unlock()\n\t{\n\t\t$data = array(\n\t\t\t\"locked\"=>0,\n\t\t\t\"locked_at\" => null,\n\t\t\t\"locked_by\" => null,\n\t\t\t\"locked_reason\" => null\n\t\t);\n\t\t$result = $this->user_model->update($this->client_id, $this->input->post(\"user_id\", true), $data);\n\t\t\n\t\t$this->setData($result);\n\t\t$this->render('admin/user/user_list', E_RENDERMODE::JSON);\n\t}", "public function changeuserstatusAction() {\n global $mySession;\n $db = new Db();\n $BcID = $_REQUEST['Id'];\n $status = $_REQUEST['Status'];\n if ($status == '1') {\n $status = '0';\n } else {\n $status = '1';\n }\n $data_update['user_status'] = $status;\n $condition = \"user_id='\" . $BcID . \"'\";\n $db->modify(USERS, $data_update, $condition);\n exit();\n }", "function setPiLockStatus($_PiID,$lockstat){\n\t\t$this->pquery(\"UPDATE TABLE PI SET PendLock= :ls WHERE PiID=:piid\",array('ls'=>$lockstat,'piid'=>$_PiID));\n\t}", "protected function lock() {\n\t\tupdate_option( $this->lock_option_name, '1' );\n\t}", "function unlock() {\n\t\t$sql = \"UPDATE \" . DB_PREFIX . \"users SET locked=0 WHERE steamID=\"\n\t\t\t\t. $this->steamID . \";\";\n\t\t$query = $this->db->query($sql);\n\t\tif ($query === FALSE) {\n\t\t\tdie(\"Error: Unable to unlock user \" . $this-steamID . \". (\" . $this->db->error . \")\");\n\t\t}\n\t\t$oldStatus=$this->locked;\n\t\t$this->getInfo();\n\t\t$newStatus=$this->locked;\n\t\treturn array(\"oldStatus\"=>$oldStatus, \"newStatus\"=>$newStatus);\n\t}", "protected function isUnlockedOrUserCanChangeLockStatus(){\n return !$this->isLocked() || parent::can(PERM_SOCIALQUESTION_UPDATE_LOCKED, $this->getQuestionShell());\n }", "function change_user_status($id) {\n\t\tif($this->aauth->is_banned($id)) {\n\t\t\t$this->aauth->unban_user($id);\n\t\t} else {\n\t\t\t$this->aauth->ban_user($id);\n\t\t}\n\n\t\techo json_encode([\n\t\t\t'status' => true,\n\t\t\t'message' => 'User status successfully!',\n\t\t\t'goto' => base_url('admin/users')\n\t\t]);\n\t}", "function canChangeLockedState($user) {\n return $this->canEdit($user);\n }", "function disable_user($userid = '', $status = '')\r\n {\r\n $this->db->query(\"UPDATE tblUserInfo SET `status`='{$status}' WHERE fk_userid='{$userid}'\");\r\n\r\n }", "function aiowps_set_user_account_status($user_id, $status)\r\n {\r\n global $wpdb, $aio_wp_security;\r\n $res = update_user_meta($user_id, 'aiowps_account_status', $status);\r\n if (!$res){\r\n $aio_wp_security->debug_logger->log_debug(\"aiowps_set_user_account_status: Error updating user meta data: aiowps_account_status\",4);\r\n }\r\n }", "function lock ()\n {\n $id = $this->_id;\n if (!$id)\n\t die_traced ('No session.');\n\n $this->_db->update ($this->_table, 'is_locked=1', \"id=$id\");\n }", "function groupgrade_swap_status($user, $section)\n{\n $userInSection = SectionUsers::where('section_id', '=', $section)\n ->where('user_id', '=', $user)\n ->first();\n\n if (! $userInSection) return drupal_not_found();\n\n $userInSection->su_status = ($userInSection->su_status == 'active') ? 'inactive' : 'active';\n $userInSection->save();\n\n drupal_set_message(sprintf('%s %d %s %s.',\n t('User'),\n $user,\n t('status set to'),\n $userInSection->su_status\n ));\n\n return drupal_goto('admin/class/section/'.$section);\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Return HTML for all form fields present. Uses returnHtmlForElement
public function returnHTML() { $return = ''; foreach ($this->formElements as $id => $element) { $return .= $element->returnHtml( $this->htmlFieldWrapper, $this->htmlLabelWrapper, $this->htmlLabelRequired, $this->htmlErrorWrapper ); } return $return; }
[ "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 }", "public function getFormHtml()\n {\n $html = '';\n\n foreach ($this->fields() as $field) {\n $html .= $field->render();\n\n if ($script = $field->getScript()) {\n $this->scripts[] = $field->getScript();\n\n array_pop(Admin::$script);\n }\n }\n\n return $html;\n }", "private function generateElementHTML()\r\n\t{\r\n\t\t$html = null;\r\n\t\tif ($this->objField->hidden == 1)\r\n\t\t{\r\n\t\t\t$this->objField->input_type = \"hidden\";\r\n\t\t}//end if\r\n\r\n\t\tswitch ($this->objField->input_type)\r\n\t\t{\r\n\t\t\tcase \"text\":\r\n\t\t\tdefault: //catch any undefined types\r\n\t\t\t\t$html = \"<input type=\\\"text\\\" name=\\\"\" . $this->objField->name . \"\\\" id=\\\"\" . $this->objField->name . \"\\\" #required #style #maxlength #class #value/>\";\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"hidden\":\r\n\t\t\t\t$html = \"<input type=\\\"hidden\\\" name=\\\"\" . $this->objField->name . \"\\\" id=\\\"\" . $this->objField->name . \"\\\" #value/>\";\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"radio\":\r\n\t\t\t\tif (is_array($this->objRawFieldData->field_values) || is_object($this->objRawFieldData->field_values))\r\n\t\t\t\t{\r\n\t\t\t\t\tforeach ($this->objRawFieldData->field_values as $value)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$value = str_replace(\"\\r\", \"\", $value);\r\n\t\t\t\t\t\t$html .= \"<input type=\\\"radio\\\" name=\\\"\" . $this->objField->name . \"\\\" value=\\\"$value\\\"/ #class>&nbsp$value&nbsp;\";\r\n\t\t\t\t\t}//end foreach\r\n\t\t\t\t}//end if\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"checkbox\":\r\n\t\t\t\t$html = \"<input type=\\\"checkbox\\\" name=\\\"\" . $this->objField->name . \"\\\" id=\\\"\" . $this->objField->name . \"\\\" value=\\\"1\\\" #required #style #class/>\";\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"select\":\r\n\t\t\t\t$html = \"<select name=\\\"\" . $this->objField->name . \"\\\" id=\\\"\" . $this->objField->name . \"\\\" #required #style #class>\";\r\n\t\t\t\t$html .= \t\"<option value=''>--select--</option>\";\r\n\r\n\t\t\t\tif (is_array($this->objRawFieldData->field_values) || is_object($this->objRawFieldData->field_values))\r\n\t\t\t\t{\r\n\t\t\t\t\tforeach ($this->objRawFieldData->field_values as $value => $text)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$html .= \"<option value=\\\"$value\\\">$text</option>\";\r\n\t\t\t\t\t}//end foreach\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$arr_field_values = explode(\"\\n\", $this->objRawFieldData->field_values);\r\n\t\t\t\t\tif (is_array($arr_field_values))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tforeach ($arr_field_values as $value)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$value = str_replace(\"\\r\", \"\", $value);\r\n\t\t\t\t\t\t\t$html .= \"<option value=\\\"$value\\\">$value</option>\";\r\n\t\t\t\t\t\t}//end foreach\r\n\t\t\t\t\t}//end if\r\n\t\t\t\t}//end if\r\n\r\n\t\t\t\t$html .= \"</select>\";\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"textarea\":\r\n\t\t\t\t$html = \"<textarea name=\\\"\" . $this->objField->name . \"\\\" id=\\\"\" . $this->objField->name . \"\\\" #required #style #maxlength #class>#value</textarea>\";\r\n\t\t\t\tbreak;\r\n\t\t}//end switch\r\n\r\n\t\t//set label\r\n\t\tif (!isset($label))\r\n\t\t{\r\n\t\t\t$label = \"<label class=\\\"form-label\\\" for=\\\"\" . $this->objField->name . \"\\\">\" . $this->objField->label . \"</label>\";\r\n\t\t}//end if\r\n\r\n\t\t//deal with element metadata\r\n\t\tif ($this->objRawFieldData->css_class != \"\")\r\n\t\t{\r\n\t\t\t$html = str_replace(\"#class\", \"class=\\\"\" . $this->objRawFieldData->css_class . \"\\\"\", $html);\r\n\t\t}//end if\r\n\r\n\t\tif ($this->objField->style != \"\")\r\n\t\t{\r\n\t\t\t$html = str_replace(\"#style\", \"style=\\\"\" . $this->objField->style . \"\\\"\", $html);\r\n\t\t}//end if\r\n\r\n\t\tif ($this->objField->required == 1)\r\n\t\t{\r\n\t\t\t$html = str_replace(\"#required\", \"required=\\\"required\\\"\", $html);\r\n\t\t}//end if\r\n\r\n\t\tif ($this->objField->readonly == 1)\r\n\t\t{\r\n\t\t\t$html = str_replace(\"#readonly\", \"readonly=\\\"readonly\\\"\", $html);\r\n\t\t}//end if\r\n\r\n\t\tif ($this->objField->maxlength > 0)\r\n\t\t{\r\n\t\t\t$html = str_replace(\"#maxlength\", \"maxlength=\\\"\" . $this->objField->maxlength . \"\\\"\", $html);\r\n\t\t}//end if\r\n\r\n\t\t//remove any unprocessed tags\r\n\t\t$html = str_replace(array(\"#class\", \"#style\", \"#required\", \"#readonly\", \"#maxlength\"), \"\", $html);\r\n\r\n\t\t//finally, does the element have a predefined value?\r\n\t\tif ($this->element_value != FALSE)\r\n\t\t{\r\n\t\t\t$html = str_replace(\"#value\", \"value=\\\"\" . $this->element_value . \"\\\"\", $html);\r\n\t\t} else {\r\n\t\t\t$html = str_replace(\"#value\", \"\", $html);\r\n\t\t}//end if\r\n\r\n\t\t$this->element_label = $label;\r\n\t\t$this->element_html = $html;\r\n\r\n\t\t//add error messages where set\r\n\t\tif ($this->objElementErrors !== FALSE && is_object($this->objElementErrors))\r\n\t\t{\r\n\t\t\tforeach ($this->objElementErrors as $error)\r\n\t\t\t{\r\n\t\t\t\t$this->element_html .= \"<div class=\\\"form-element-error\\\">$error</div>\";\r\n\t\t\t}//end foreach\r\n\t\t}//end if\r\n\t}", "function get_html(){\n\t\t// Adding id to the form\n\t\t$id = ' id=\"' . $this->id . '\"';\n\t\t\n\t\t// Adding method to the form\n\t\t$method = ' method=\"' . $this->method . '\"';\n\t\t\n\t\t$html = '<form' . $id . $method . ' action=\"' . $this->action . '\" name=' . $this->name . '>';\n\t\t\n\t\t$html = apply_filters( 'tk_form_start_' . $this->id, $html );\n\t\t\n\t\t// Adding elements to form\n\t\tforeach( $this->elements AS $element ){\n\t\t\t$tkdb = new TK_Display();\n\t\t\t$html.= $tkdb->get_html( $element );\n\t\t\tunset( $tkdb );\n\t\t}\n\t\t\n\t\t$html = apply_filters( 'tk_form_end_' . $id, $html );\n\t\t\t\t\n\t\t$html.='</form>';\n\t\t\n\t\treturn $html;\n\t}", "public function render() {\n\t\treturn $this->formElement->render();\n\t}", "private function get_form_elements(){\n\t\treturn $this->fields;\n\t}", "public static function selectedFieldsHTML() {\n return self::fieldsHTML(self::$selected_fields);\n }", "public function getResultHTMLForm() {\n return '';\n }", "public static function getFormElements();", "function getFormInputsHTML() \r\n\t{\r\n\t\t$html = '';\r\n\t\tif($this->listAjax)\r\n\t\t\t$html = '<input type=\"Hidden\" name=\"mode\" value=\"ajax\">';\r\n\t\treturn $html;\r\n\t}", "public function getFormInputs()\n {\n $this->prepareFields();\n\n $html = '';\n\n foreach (array_merge($this->fields, $this->customFields) as $key => $value) {\n $html .= '<input type=\"hidden\" name=\"'.$key.'\" value=\"'.$value.'\">';\n }\n\n return $html;\n }", "protected function form_elements() {\n return array();\n }", "public function render()\n\t{\n\t\t// build the main form tag\n\t\t$html = '<form';\n\t\tforeach(array('name', 'method', 'action', 'enctype', 'class', 'id') as $form_attr)\n\t\t{\n\t\t\tif(!is_null($this->$form_attr) )\n\t\t\t\t$html .= \" $form_attr=\\\"{$this->$form_attr}\\\"\";\n\t\t}\n\t\t$html .= ($this->novalidate)?' novalidate':'';\n\t\t$html .= (!$this->autocomplete)?' autocomplete=\"off\"':'';\n\t\t\n\t\t$html .= '>';\n\t\t\n\t\t// build the form elements\n\t\tforeach($this->elements as $element)\n\t\t\t$html .= $this->render_element($element, (isset($element->labels)?$element->labels:$this->labels), $this->snippets );\n\n\t\t$html .= '</form>';\n\t\t\n\t\treturn $html;\n\t}", "public function getFormHtml()\n {\n\n if (is_object($this->getForm())) {\n $form = $this->getForm();\n $html = '';\n $html .= '<form '.$form->serialize($form->getHtmlAttributes()).'>';\n $html .= '<div>';\n if (strtolower($form->getData('method')) == 'post') {\n $html .= '<input name=\"form_key\" type=\"hidden\" value=\"'.Mage::getSingleton('core/session')->getFormKey().'\" />';\n }\n $html .= '</div>';\n $html .= $this->getForm()->getHtml();\n // option value\n $html .= $this->getChildHtml(\"joy_optionimage_attribute_option_content\");\n\n $html.= '</form>';\n return $html;\n }\n return '';\n }", "public function getFieldControlHtml(): string\n {\n return $this->getFieldControl()['html'] ?? '';\n }", "public function getFieldsHtmlEscaped() {\n // get all fields and html escape them\n $fvals = $this->getFields();\n $out = array();\n foreach ($fvals as $k => $v) {\n $out[$k] = htmlentities($v);\n }\n return $out;\n }", "public function LinkFormHTML()\n {\n return $this->LinkForm()->forTemplate();\n }", "public function generate_html()\n {\n // Prepare the input data\n $input_data = $this->input_data[0];\n \n $parameters = [\n 'label' => $this->label,\n 'field_name' => $this->field_name,\n 'value' => $input_data\n ];\n\n $return = $this->stub->parse_stub('input-text', $parameters).\"\\n\";\n\n return $return;\n }", "abstract function form_elements();" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
TODO: Implement quack() method.
public function quack() { $this->turkey->gobble(); }
[ "public function quack();", "public function performQuack()\n {\n $this->quack_behavior->quacks();\n }", "public function performQuack()\n {\n $this->quackBehavior->quack();\n }", "public function performQuack()\n\t{\n\t\tif ($this->quackBehavior) {\n\t\t\t$this->quackBehavior->quack($this->duckType);\n\t\t}\n\t\telse{\n\n\t\t\t$this->quackBehavior = new CantQuack();\n\t\t\t$this->quackBehavior->quack($this->duckType);\n\t\t}\n\t}", "public function doQuake() {\n return $this->QuackBehaviour->quack();\n }", "public function dequeue () {}", "public function pop();", "public static function pop()\n {\n return <<<'LUA'\n-- Pop the first sportevent off of the queue...\nlocal sportevent = redis.call('lpop', KEYS[1])\nlocal reserved = false\n\nif(sportevent ~= false) then\n -- Increment the attempt count and place sportevent on the reserved queue...\n reserved = cjson.decode(sportevent)\n reserved['attempts'] = reserved['attempts'] + 1\n reserved = cjson.encode(reserved)\n redis.call('zadd', KEYS[2], ARGV[1], reserved)\n redis.call('lpop', KEYS[3])\nend\n\nreturn {sportevent, reserved}\nLUA;\n }", "public function dequeue()\n {\n }", "public function forgetPushed()\n {\n }", "function pop() {\n return array_shift($this->myQueue);\n }", "public function popPop();", "private function s_dequeue()\n {\n $this->size--;\n return $this->dequeue();\n }", "public function ensureEnqueued();", "function queue_peek(&$queue) { \n // Return a copy of the value found in front of queue \n // (at the beginning of the array) \n return $queue[0]; \n}", "public function shift() {\n $this->json->lock();\n $q = $this->getQueue();\n\n foreach($q as $i=>$c) {\n if($c['threshold'] <= time()) {\n array_splice($q, $i, 1);\n $this->json->queue = $q;\n $this->json->release();\n return Command::fromJSON($c['cmd']);\n }\n }\n\n $this->json->release();\n }", "public function pushRear($value) {\n if ($this->length == 10 \n || $this->front == $this->rear) {\n throw new Exception(\"Queue is Full\"); //Exception Handling// \t\n }\n\n if ($this->rear == 10 \n || $this->rear > $this->front) {\n $this->rear = $this->rear - 1;\n $this->dequeArray[$this->rear] = $value;\n $this->length = $this->length + 1;\n echo \"Element Inserted in Deque at Rear\\n\";\n }\n }", "function pop() {\n return array_shift($this->queue);\n }", "private function pop(): void\n {\n \\array_splice($this->stack, $this->last(), 1);\n $this->stackSize--;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Set the action that shall be performed when the annotation loses the input focus.
public function setBlur(\SetaPDF_Core_Document_Action $action) {}
[ "public function addFocusGainedAction(NonKeyAction $a){\n\t\t$this->_on_focus_gained[] = $a;\n\t}", "public function requestFocus(): void;", "public function removeKeyboard()\n {\n }", "public function grabFocus() { }", "public function onFocus()\n /**/\n {\n }", "public function unsetBlur(): void\n {\n unset($this->params[self::PARAM_BLUR]);\n }", "function post_form_autocomplete_off()\n {\n }", "public function unFocus(): BaseComponent\n {\n return $this->setFocus(false);\n }", "public function hideActionButton() {\n\t\t$this->actionButton = [];\n\t}", "protected function dismissal_is_triggered()\n {\n }", "public function setFocus()\n {\n }", "abstract protected function deactivate(Callback $callback): void;", "protected function actionAbortEdit() {\n\t\t$this->actionAbort();\n\t}", "public function resetEventAction($event) {\r\n\t\tunset($this->events[$event]);\r\n\t}", "function preventDefault() { $this->_default = false; }", "abstract public function stopPropagation();", "protected function applyHangmanGameLostEvent()\n {\n $this->players->setCurrentPlayer(null);\n $this->state = self::STATE_OVER;\n }", "public function disableCallback()\n\t{\n\t\t$this->_callback = NULL;\n\t\t$this->_callbackMethod = NULL;\n\t}", "public function preUnactiveActions(): void\n {\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Store the page setup SETUP BIFF record.
function _store_setup() { $record = 0x00A1; // Record identifier $length = 0x0022; // Number of bytes to follow $iPaperSize = $this->_paper_size; // Paper size $iScale = $this->print_scale; // Print scaling factor $iPageStart = 0x01; // Starting page number $iFitWidth = $this->fit_width; // Fit to number of pages wide $iFitHeight = $this->fit_height; // Fit to number of pages high $grbit = 0x00; // Option flags $iRes = 0x0258; // Print resolution $iVRes = 0x0258; // Vertical print resolution $numHdr = $this->_margin_head; // Header Margin $numFtr = $this->_margin_foot; // Footer Margin $iCopies = 0x01; // Number of copies $fLeftToRight = 0x0; // Print over then down $fLandscape = $this->_orientation; // Page orientation $fNoPls = 0x0; // Setup not read from printer $fNoColor = 0x0; // Print black and white $fDraft = 0x0; // Print draft quality $fNotes = 0x0; // Print notes $fNoOrient = 0x0; // Orientation not set $fUsePage = 0x0; // Use custom starting page $grbit = $fLeftToRight; $grbit |= $fLandscape << 1; $grbit |= $fNoPls << 2; $grbit |= $fNoColor << 3; $grbit |= $fDraft << 4; $grbit |= $fNotes << 5; $grbit |= $fNoOrient << 6; $grbit |= $fUsePage << 7; $numHdr = pack("d", $numHdr); $numFtr = pack("d", $numFtr); if ($this->_byte_order) // if it's Big Endian { $numHdr = strrev($numHdr); $numFtr = strrev($numFtr); } $header = pack("vv", $record, $length); $data1 = pack("vvvvvvvv", $iPaperSize, $iScale, $iPageStart, $iFitWidth, $iFitHeight, $grbit, $iRes, $iVRes); $data2 = $numHdr .$numFtr; $data3 = pack("v", $iCopies); $this->prepend($header.$data1.$data2.$data3); }
[ "function GetPageSetupData(){}", "function _storeCodepage()\n {\n $record = 0x0042; // Record identifier\n $length = 0x0002; // Number of bytes to follow\n $cv = $this->_codepage; // The code page\n\n $header = pack('vv', $record, $length);\n $data = pack('v', $cv);\n\n $this->_append($header . $data);\n }", "protected function _storeCodepage()\n {\n $record = 0x0042; // Record identifier\n $length = 0x0002; // Number of bytes to follow\n $cv = $this->_codepage; // The code page\n\n $header = \\pack('vv', $record, $length);\n $data = \\pack('v', $cv);\n\n $this->_append($header . $data);\n }", "private function __writeSetupState()\n {\n $file = 'setup_shell';\n $file = new File(ROOT . DS . APP_DIR .DS. 'Config' .DS. 'Log' .DS. $file);\n $file->write($this->__encodeState(), $mode = 'w', false);\n $file->close();\n }", "protected function setPageInfo() : void {}", "function pagingLogic_pushData(&$record, $page)\n\t{\n\n\t\tfor ($i=1; $i<=atkconfig('num_of_rows'); $i++){\n\t\t\t$stackrec[\"product_id$i\"] = $record[\"product_id$i\"];\n\t\t\t$stackrec[\"fix_productname_$i\"] = $record[\"fix_productname_$i\"];\n\t\t\t$stackrec[\"stock_holder_$i\"] = $record[\"stock_holder_$i\"];\n\t\t\t$stackrec[\"available_holder_$i\"] = $record[\"available_holder_$i\"];\n\t\t\t$stackrec[\"reservation_holder_$i\"] = $record[\"reservation_holder_$i\"];\n\t\t\t$stackrec[\"units_$i\"] = $record[\"units_$i\"];\n\t\t\t$stackrec[\"fix_unitsymbol_$i\"] = $record[\"fix_unitsymbol_$i\"];\n\t\t}\n\n\t\t// serialize and store to dummy attribute\n\t\t$record[\"page_stack_\".$page] = serialize($stackrec);\n\t}", "public function set_capture_data() {\n\n\t\t$this->set_payment_id( $this->get_order()->capture->trans_id );\n\n\t\t$this->path .= '/capture';\n\n\t\t$this->data = array(\n\t\t\t'amount' => $this->get_order()->capture->amount,\n\t\t);\n\t}", "protected function _storeCaptureMode()\n {\n $captureMode = Mage::getStoreConfig('afterpay/afterpay_capture/capture_mode', $this->_order->getStoreId());\n \n $this->_order->setAfterpayCaptureMode($captureMode)->save();\n }", "public function setUpHpsSession()\n {\n $request = $this->getRequest()\n ->addTransaction()\n ->addTxnDetails($this->getOrderNumber(), $this->getAmount(), $this->getCurrency());\n $this->_add3DSecure();\n $request->addCardTxn($this->getAuthMethod(), null, 'hps');\n $this->_addCv2Avs();\n $request->addHpsTxn($this->getPageSetId(),'setup_full', $this->getReturnUrl(), $this->getExpiryUrl(), 'hps');\n\n $this->call($request);\n }", "public function save()\n {\n // Get page info from the database if it exists\n $page = $this->get_page_data_by_url($this->page_data['url']);\n\n $data = array_filter($this->page_data, function($k) {\n return in_array($k, $this->property_list);\n }, ARRAY_FILTER_USE_KEY);\n\n if (is_null($page)) {\n // Insert to database\n $this->db->insert($this->table_name, $data);\n $this->page_data['id'] = $this->db->insert_id();\n } else {\n // Update database\n $this->db->where('id', $page['id']);\n $this->db->update($this->table_name, $data);\n $this->page_data['id'] = $page['id'];\n }\n\n // If the current page is actually the seed then we can assign seed's data to saved page's data\n if ($this->page_data['url'] === $this->seed_data['url']) {\n $this->seed_data = $this->page_data;\n }\n\n return $this;\n }", "public function setupPageData($page_no) \n {\n //NB: gets login page defaults all messages/errors\n $this->data['login'] = $this->user->viewLogin();\n $this->saveData('data');\n }", "function _store_wsbool()\n {\n $record = 0x0081; // Record identifier\n $length = 0x0002; // Bytes to follow\n \n // The only option that is of interest is the flag for fit to page. So we\n // set all the options in one go.\n //\n if ($this->_fit_page) {\n $grbit = 0x05c1;\n }\n else {\n $grbit = 0x04c1;\n }\n \n $header = pack(\"vv\", $record, $length);\n $data = pack(\"v\", $grbit);\n $this->_prepend($header.$data);\n }", "function _store_wsbool() {\n $record = 0x0081; # Record identifier\n $length = 0x0002; # Bytes to follow\n\n // $grbit Option flags\n\n // The only option that is of interest is the flag for fit to page.\n // So we set all the options in one go.\n if ($this->_fit_page) {\n $grbit = 0x05c1;\n } else {\n $grbit = 0x04c1;\n }\n\n $header = pack(\"vv\", $record, $length);\n $data = pack(\"v\", $grbit);\n\n $this->_prepend($header . $data);\n }", "private function save()\n\t{\n\t\t$this->writeAPTProxyConf();\n\t\t$this->writeSquidConf();\n\t\t$this->writeEtcProfiles();\n\t\t$this->writeACNGConf();\n\t}", "public function addMetaDataRecord()\n {\n $lines = $this->getMetaDataRecord();\n $this->addMetaDataToPageHeader($lines);\n }", "public function setup() {\r\n $config = SiteConfig::current_site_config();\r\n\t\t$username = $config->SurveyMonkeyUserName;\t\t\r\n\t\t$password = $config->SurveyMonkeyPassword; // TODO Decryption logic will go here\r\n\r\n\t\t\r\n\t\t$this->totalSteps = 1;\r\n\t}", "protected function savePageState()\n\t{\n\t\tPrado::trace(\"Saving state\",'System.Web.UI.TPage');\n\t\t$state=&$this->saveStateRecursive($this->getEnableViewState());\n\t\t$this->getStatePersister()->save($state);\n\t}", "function payment_account_screen_setup($parameters){\r\n\t\t$identifier = $this->check_parameters($parameters,\"identifier\",-1);\r\n\t\t/**\r\n * get Account setup details\r\n */\r\n\t\t$sql = \"select * \";\r\n\t\t$sql .=\t\"from payment_account_details \";\r\n\t\t$sql .= \" where pad_client = $this->client_identifier\";\r\n\t\t\t\r\n\t\t$propertyValues = Array();\r\n\t\t$uri =\"\";\r\n $result = $this->call_command(\"DB_QUERY\",Array($sql));\r\n while($r = $this->call_command(\"DB_FETCH_ARRAY\",Array($result))){\r\n\t\t\t$identifier \t\t= $r[\"pad_identifier\"];\r\n\t\t\t$uri\t\t \t\t= $r[\"pad_uri\"];\r\n }\r\n $this->call_command(\"DB_FREE\",Array($result));\r\n\t\t/**\r\n *\r\n */\r\n\t\t$sql = \"select * from payment_account_properties where pap_client = $this->client_identifier and pap_identifier = $identifier\";\r\n\t\t$propertyValues = Array();\r\n $result = $this->call_command(\"DB_QUERY\",Array($sql));\r\n while($r = $this->call_command(\"DB_FETCH_ARRAY\",Array($result))){\r\n \t$propertyValues[count($propertyValues)] = Array(\r\n\t\t\t\t\"key\" => $r[\"pap_property\"], \r\n\t\t\t\t\"value\" => $r[\"pap_value\"]\r\n\t\t\t);\r\n }\r\n $this->call_command(\"DB_FREE\",Array($result));\r\n\t\t/**\r\n * display this form\r\n */\r\n\t\t$out =\"<module name=\\\"\".$this->module_name.\"\\\" display=\\\"form\\\">\";\r\n\t\t$out .=\"<form name=\\\"\".$this->module_name.\"_form\\\" label=\\\"\".LOCALE_PAYMENT_SETUP.\"\\\">\";\r\n\t\t$out .=\"\t<input type=\\\"hidden\\\" name=\\\"command\\\" value=\\\"\".$this->module_command.\"SETUP_SAVE\\\"/>\";\r\n\t\t$out .=\"\t<input type=\\\"hidden\\\" name=\\\"identifier\\\" value=\\\"$identifier\\\"/>\";\r\n\t\t$out .=\"\t\t<page_sections>\";\r\n\t\t$out .= \"\t\t<section label='Gateways' redirect='SHOP_CHOOSEPAY'>\";\r\n\t\t$out .= \"\t\t</section>\";\r\n\t\t$out .= \"\t\t<section label='Merchant Account' selected='true'>\";\r\n//\t\t$out .=\"\t\t\t\t<input type=\\\"text\\\" name=\\\"pad_uri\\\" label=\\\"\".LOCALE_PAYMENT_URI.\"\\\" required='YES'><![CDATA[$uri]]></input>\";\r\n\t\t$out .=\"\t\t\t\t<text><![CDATA[<p>Special properties for this Account</p>]]></text>\";\r\n\t\t$max_setup_values\t= count($this->setupProperties);\r\n\t\t$max_prop_values\t= count($propertyValues);\r\n\t\tfor($i=0; $i<$max_setup_values; $i++){\r\n\t\t\t$value=\"\";\r\n\t\t\t\r\n\t\t\tfor($v=0; $v<$max_prop_values; $v++){\r\n\t\t\t\tif ($propertyValues[$v][\"key\"]==$this->setupProperties[$i][0]){\r\n\t\t\t\t\t$value = $propertyValues[$v][\"value\"];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif($this->setupProperties[$i][2]==\"text\"){\r\n\t\t\t\t$out .=\"\t<input type=\\\"text\\\" name=\\\"prop_\".$this->setupProperties[$i][0].\"\\\" label=\\\"\".$this->setupProperties[$i][1].\"\\\"><![CDATA[$value]]></input>\";\r\n\t\t\t}\r\n\t\t\tif($this->setupProperties[$i][2]==\"__CALLBACK__\"){\r\n\t\t\t\tif($value==\"\"){\r\n\t\t\t\t\t$value=\"http://\".$this->parent->domain.$this->parent->base.\"_process.php\";\r\n\t\t\t\t}\r\n\t\t\t\t$out .=\"\t<input type=\\\"text\\\" name=\\\"prop_\".$this->setupProperties[$i][0].\"\\\" label=\\\"\".$this->setupProperties[$i][1].\"\\\"><![CDATA[$value]]></input>\";\r\n\t\t\t}\r\n\t\t\tif($this->setupProperties[$i][2]==\"boolean\"){\r\n\t\t\t\t\r\n\t\t\t\t$out .=\"\t<radio name=\\\"prop_\".$this->setupProperties[$i][0].\"\\\" label=\\\"\".$this->setupProperties[$i][1].\"\\\">\r\n\t\t\t\t\t<option value='No'\";\r\n\t\t\t\t\tif ($value=='No' || $value==''){\r\n\t\t\t\t\t\t$out .= \" selected='true'\";\r\n\t\t\t\t\t}\t\r\n\t\t\t\t\t$out.=\">No</option>\r\n\t\t\t\t\t<option value='Yes'\";\r\n\t\t\t\t\tif ($value=='Yes'){\r\n\t\t\t\t\t\t$out .= \" selected='true'\";\r\n\t\t\t\t\t}\t\r\n\t\t\t\t\t$out.=\">Yes</option>\r\n\t\t\t\t</radio>\";\r\n\t\t\t}\r\n\t\t\tif($this->setupProperties[$i][2]==\"__CURRENCY__\"){\r\n\t\t\t\tif($value==\"\"){\r\n\t\t\t\t\t$value =\"GBP\";\r\n\t\t\t\t}\r\n\t\t\t\t$out .=\"<select name=\\\"prop_\".$this->setupProperties[$i][0].\"\\\" label=\\\"\".$this->setupProperties[$i][1].\"\\\" >\";\r\n\t\t\t\tfor($curr = 0, $curr_max=count($this->currency); $curr<$curr_max; $curr++){\r\n\t\t\t\t\t$out .=\"\t<option value=\\\"\".$this->currency[$curr][0].\"\\\"\";\r\n\t\t\t\t\tif ($value==$this->currency[$curr][0]){\r\n\t\t\t\t\t\t$out.=\" selected='true'\";\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$out .=\"><![CDATA[\".$this->currency[$curr][1].\"]]></option>\";\r\n\t\t\t\t}\r\n\t\t\t\t$out .=\"</select>\";\r\n\t\t\t}\r\n\t\t\tif($this->setupProperties[$i][2]==\"__TEST__\"){\r\n\t\t\t\t$out .=\"<select name=\\\"prop_\".$this->setupProperties[$i][0].\"\\\" label=\\\"\".$this->setupProperties[$i][1].\"\\\" >\";\r\n\t\t\t\t$out .=\"\t<option value=\\\"\\\"><![CDATA[\".LOCALE_NO_TEST_MODE.\"]]></option>\";\t\t\t\t\t\r\n\t\t\t\t$mz= count($this->testModes);\r\n\t\t\t\tfor($z=0;$z<$mz;$z++){\r\n\t\t\t\t\t$out .=\"\t<option value=\\\"\".$this->testModes[$z][0].\"\\\"\";\r\n\t\t\t\t\tif ($value==$this->testModes[$z][0]){\r\n\t\t\t\t\t\t$out.=\" selected='true'\";\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$out .=\"><![CDATA[\".constant($this->testModes[$z][1]).\"]]></option>\";\r\n\t\t\t\t}\r\n\t\t\t\t$out .=\"</select>\";\r\n\t\t\t}\r\n\t\t}\r\n\t\t$out .=\"\t\t</section>\";\r\n\r\n\t\t$out .=\"\t</page_sections>\";\r\n\t\t$out .=\"\t\t\t<input type=\\\"submit\\\" iconify=\\\"SAVE\\\" value=\\\"\".SAVE_DATA.\"\\\"/>\";\r\n\t\t$out .=\"</form>\";\r\n\t\t$this->call_command(\"DB_FREE\",array($result));\r\n\t\t$out .=\"</module>\";\r\n\t\treturn $out;\r\n\t}", "public function save_page_configuration() {\n\n // Save Facebook Page configuration\n (new MidrubBaseUserAppsCollectionChatbotHelpers\\Pages)->save_page_configuration();\n\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This method will be used to set the voting topic into class variable.
public function setVotingTopic($votingTopicVal) { if($votingTopicVal != NULL) { $this->votingTopic = $votingTopicVal; } }
[ "function vote() {\n $this->topic = ORM::factory('topic', $this->input->post('topic_id'));\n if ( ! $this->topic->poll->loaded)\n Event::run('system.404');\n if ( ! A2::instance()->allowed($this->topic->forum, 'view'))\n Event::run('system.403');\n\n if ($this->input->post('choice_id') > 0) {\n $this->topic->poll->vote($this->input->post('choice_id'), $this->user->id);\n message::add(TRUE, 'Your vote has been cast!');\n }\n else {\n message::add(FALSE, 'Please choose an option to cast your vote.');\n }\n url::redirect('forum/topic/'. $this->topic->id);\n }", "public function setTopic($topic){\r\n\t\t$this->_topic = $topic;\r\n\t}", "public function setTopic(string $topic)\n {\n $this->topic = $topic;\n\n \n }", "public function vote(Topic $topic)\n {\n $voteId = Auth::user()->vote->id;\n $voteTime = Carbon::now()->toDateTimeString();\n\n $topic->votes()->toggle([\n $voteId => [\n 'created_at' => $voteTime,\n 'updated_at' => $voteTime,\n ],\n ]);\n }", "public function getVotingTopicId()\r\n\r\n\t{\r\n\r\n\t\treturn $this->votingTopicId;\r\n\r\n \t}", "public function setVote($vote){\n $this->vote = $vote;\n }", "public function setTopic($topic)\n {\n # Strip slashes, decode any html entities, strip any tags, and set the data member.\n $topic = ((empty($topic)) ? '' : strip_tags(html_entity_decode(stripslashes($topic), ENT_COMPAT, 'UTF-8')));\n # Clean it up.\n $topic = trim($topic);\n # Set the data member.\n $this->topic = $topic;\n }", "function set_topic_state( $data )\n\t{\n\t\t$this->topic_state = $data;\n\t}", "public function testSetTopicReturnsSelfReference()\n {\n $this->assertSame($this->class, $this->class->set_topic('data'));\n }", "public function set_topic( $topic ) {\n\t\t$topic = wc_clean( $topic );\n\n\t\tif ( ! wc_is_webhook_valid_topic( $topic ) ) {\n\t\t\t$topic = '';\n\t\t}\n\n\t\t$this->set_prop( 'topic', $topic );\n\t}", "function setWebVoting($vote)\n {\n $this->webvoting = $vote;\n }", "function setVoting( $voting ) {\n $this->voting = $voting;\n $voting = strtoupper( $voting );\n\n if ( $voting == 'OFF' ) {\n $this->allowMinus = false;\n $this->allowPlus = false;\n }\n if ( $voting == 'PLUS' ) {\n $this->allowMinus = false;\n }\n if ( $voting == 'MINUS' ) {\n $this->allowPlus = false;\n }\n }", "function determineTopicClass(&$topic_context)\n{\n\t// Set topic class depending on locked status and number of replies.\n\t$topic_context['class'] = 'normal';\n\tif ($topic_context['is_very_hot'])\n\t{\n\t\t$topic_context['class'] = 'veryhot';\n\t}\n\telseif ($topic_context['is_hot'])\n\t{\n\t\t$topic_context['class'] = 'hot';\n\t}\n\n\t$topic_context['class'] .= !empty($topic_context['is_poll']) ? '_poll' : '_post';\n\n\tif ($topic_context['is_locked'])\n\t{\n\t\t$topic_context['class'] .= '_locked';\n\t}\n\n\tif ($topic_context['is_sticky'])\n\t{\n\t\t$topic_context['class'] .= '_sticky';\n\t}\n}", "public function setTarget(Topic $topic) {\n\t\t$this->target = $topic;\n\t\t$this->lastPost = $topic->getLastPost();\n\t\t$this->lastPostCrdate = $this->lastPost->getTimestamp();\n\t\t$this->subject = $topic->getSubject();\n\t}", "function __construct($vote_id, $election_id) {\n $this->vote_id = $vote_id;\n $this->election_id = $election_id;\n $this->preferences = array();\n }", "public function setTopic(?string $value): void {\n $this->getBackingStore()->set('topic', $value);\n }", "public function setUpVotes($upVotes): void\n {\n $this->upVotes = $upVotes;\n }", "public function vote_poll($tid){\r\n\t\t\r\n\t\t$cid=$this->input->post(\"choice\" );\r\n\t\tif($this->already_voted($tid)){\r\n\t\t\techo \"<script>alert('you have Already voted for this poll....!!!! ');</script>\";\r\n\t\t\t$this->poll_result($tid);\r\n\t\t\t\r\n\t\t}\r\n\t\telse{\r\n\t\t\t$this->load->model('poll_model');\r\n\t\t\t$this->poll_model->add_vote($tid,$cid,$_SERVER['REMOTE_ADDR']);\r\n\t\t\t$this->poll_result($tid);\r\n\t\t}\r\n\t}", "public function getVoting_topics() {\n\t\treturn $this->voting_topics;\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Traverses the $array and replaces known persisted objects with a tuple of type and identifier.
protected function encodeObjectReferences(array &$array): void { assert($this->persistenceManager instanceof PersistenceManagerInterface); foreach ($array as &$value) { if (is_array($value)) { $this->encodeObjectReferences($value); } if (!is_object($value) || ($value instanceof DependencyProxy)) { continue; } $propertyClassName = TypeHandling::getTypeForValue($value); if ($value instanceof \SplObjectStorage) { throw new \RuntimeException('SplObjectStorage in array properties is not supported', 1375196580); } if ($value instanceof Collection) { throw new \RuntimeException('Collection in array properties is not supported', 1375196581); } if ($value instanceof \ArrayObject) { throw new \RuntimeException('ArrayObject in array properties is not supported', 1375196582); } if ($this->persistenceManager->isNewObject($value) === false && ( $this->reflectionService->isClassAnnotatedWith($propertyClassName, Flow\Entity::class) || $this->reflectionService->isClassAnnotatedWith($propertyClassName, Flow\ValueObject::class) || $this->reflectionService->isClassAnnotatedWith($propertyClassName, Entity::class) )) { $value = [ '__flow_object_type' => $propertyClassName, '__identifier' => $this->persistenceManager->getIdentifierByObject($value) ]; } } }
[ "function bsonUnserialize(array $array) {\n $this->__original = $array;\n\n foreach($array as $k => $v) {\n $this->{$k} = $v;\n }\n }", "public static function applySerializeMetadataToArray(array $array, $className, DocumentManager $documentManager) {\n\n $classMetadata = $documentManager->getClassMetadata($className);\n $fieldList = self::fieldListForSerialize($classMetadata);\n $return = array_merge($array, self::serializeClassNameAndDiscriminator($classMetadata));\n\n foreach ($classMetadata->fieldMappings as $field=>$mapping){\n\n if ( ! in_array($field, $fieldList)){\n if (isset($return[$field])){\n unset($return[$field]);\n }\n continue;\n }\n\n if ( isset($mapping['id']) && $mapping['id'] && isset($array['_id'])){\n $return[$field] = $array['_id'];\n unset($return['_id']);\n }\n\n if ( ! isset($return[$field])){\n continue;\n }\n\n switch (true){\n case isset($mapping['embedded']) && $mapping['type'] == 'one':\n $return[$field] = self::applySerializeMetadataToArray(\n $return[$field],\n $mapping['targetDocument'],\n $documentManager\n );\n break;\n case isset($mapping['embedded']) && $mapping['type'] == 'many':\n foreach($return[$field] as $index => $embedArray){\n $return[$field][$index] = self::applySerializeMetadataToArray(\n $embedArray,\n $mapping['targetDocument'],\n $documentManager\n );\n }\n break;\n case isset($mapping['reference']) && $mapping['type'] == 'one':\n if (self::$nestingDepth < self::$maxNestingDepth) {\n self::$nestingDepth++;\n $referenceSerializer = self::getReferenceSerializer($field, $classMetadata);\n $return[$field] = $referenceSerializer::serialize(\n is_array($return[$field]) ? $return[$field]['$id'] : $return[$field],\n $mapping,\n $documentManager\n );\n self::$nestingDepth--;\n }\n break;\n case isset($mapping['reference']) && $mapping['type'] == 'many':\n if (self::$nestingDepth < self::$maxNestingDepth) {\n self::$nestingDepth++;\n $referenceSerializer = self::getReferenceSerializer($field, $classMetadata);\n foreach($return[$field] as $index => $referenceDocument){\n $return[$field][$index] = $referenceSerializer::serialize(\n is_array($referenceDocument) ? $referenceDocument['$id'] : $referenceDocument,\n $mapping,\n $documentManager\n );\n }\n self::$nestingDepth--;\n }\n break;\n case array_key_exists($mapping['type'], self::$typeSerializers):\n $typeSerializer = self::$typeSerializers[$mapping['type']];\n $return[$field] = $typeSerializer::serialize($return[$field]);\n break;\n }\n }\n\n return $return;\n }", "public function parseArray($array)\n {\n //Checks first array against other ones, returns an array of values in first array that are not present in others\n $currentKeys = get_object_vars(($this));\n unset($currentKeys['propTypes']); //Prop types and pkName aren't fields that are set by incoming arrays\n unset($currentKeys['pkName']); //Prop types and pkName aren't fields that are set by incoming arrays\n\n //DONE: Ensure the array is assoc has the correct keys\n //https://www.php.net/manual/en/function.array-diff.php\n $keyDiff = array_diff(array_keys($array), array_keys(get_object_vars($this)));\n\n if(sizeof($keyDiff) > 0) //checks if more than 1 difference exists between incoming array and entity keys\n {\n return -1; //Returns -1 if more than one difference exists\n }\n else\n {\n foreach($array as $field=>$val) //goes through each array property and assigns it to this object\n {\n if(isset($val)) //Only assigns properties that have values, ignores the rest\n {\n $this->$field = $val;\n }\n }\n return $this; //Returns the entity if no differences exist\n }\n }", "public function assignByArray($array) {\n\t\t$result=array();\n\t\tforeach ($array as $fieldId=>$value) {\n\t\t\t$result[self::$FIELD_NAMES[$fieldId]]=$value;\n\t\t}\n\t\t$this->assignByHash($result);\n\t}", "function renumber($array) {\r\n\t\tfor ($i = 0; $i < count($array); $i++) {\r\n\t\t\t$array[$i]->ID = $i + 1;\r\n\t\t}\r\n\t}", "function josh_object_update($array) {\n\tglobal $_josh;\n\tif (empty($array[\"objectKey\"])) return false;\n\t\n\t//get object info\n\t$object = josh_object_info(false, $array[\"objectKey\"]);\n\t\n\t//create new instance\n\t$instanceID = josh_object_instance($object[\"typeID\"], $object[\"id\"], $array);\n\t\n\t//update object with current instance\n\tjosh_db_query(\"UPDATE josh_objects SET currentInstanceID = {$instanceID} WHERE id = \" . $object[\"id\"]);\n\t\n\t//update blog RSS ~ TODO: make RSS generalized to all object types\n\t//it's really a naming question. having the one-word object names will help with this, eg /joshserver/rss/posts.xml, /joshserver/rss/providers.xml\n\tif ($object[\"typeID\"] == 11) josh_xml_rss_generate();\n\t\n\treturn $object[\"typeID\"];\n}", "private function tidyArray($array)\n {\n \tunset($array['created_at']);\n \tunset($array['updated_at']);\n \tunset($array['council_code']);\n \tunset($array['council']);\n \tunset($array['secondary_council_code']);\n \tunset($array['id']);\n\n \treturn $array;\n }", "public function loadFromArray( $array ) /* {{{ */\n\t{\n\t\t$pk = $array[$this->getPkField()];\n\t\t\n\t\tif( empty( $pk ) )\n\t\t{\n\t\t\tthrow new InvalidArgumentException( 'The array must contain the primary key' );\n\t\t}\n\t\t\n\t\tif( $row = $this->getIdentityMap()->get( $pk ) )\n\t\t{\n\t\t\treturn $row;\n\t\t}\n\t\t\n\t\t$row = new $this->rowclass( $this, $array );\n\t\t$this->getIdentityMap()->add( $row );\n\t\t\n\t\treturn $row;\n\t}", "public function replace($array) {\r\n\t\tif ($array instanceof pudlObject) $array = $array->raw();\r\n\t\tif (empty($array) || !pudl_array($array)) return $this;\r\n\t\t$this->__array = array_replace($this->__array, $array);\r\n\t\treturn $this;\r\n\t}", "public function hydrate(array $data, $object);", "private function _setFieldsToUpdateByArray($array)\n {\n\n $this->_fields = '';\n foreach ($array as $f => $v) {\n if ($this->_fields != '') {\n $this->_fields .= ', ';\n }\n $this->_fields .= $f . ' = :' . $f . '';\n $this->_binds[':' . $f] = $v;\n }\n }", "public function toEntity($array)\n {\n $hydrator = new DoctrineHydrator($this->entityManager);\n return $hydrator->hydrate($array, $this->importProcessEntity);\n }", "public function synchronizeWithArray(array $array, $deep = true)\n {\n $refresh = false;\n foreach ($array as $key => $value) {\n if ($key == '_identifier') {\n $refresh = true;\n $this->assignIdentifier($value);\n continue;\n }\n\n if ($deep && $this->getTable()->hasRelation($key)) {\n if ( ! $this->$key) {\n $this->refreshRelated($key);\n }\n\n if (is_array($value)) {\n if (isset($value[0]) && ! is_array($value[0])) {\n $this->unlink($key, array(), false);\n $this->link($key, $value, false);\n } else {\n $this->$key->synchronizeWithArray($value);\n $this->$key = $this->$key;\n }\n }\n } else if ($this->getTable()->hasField($key) || array_key_exists($key, $this->_values)) {\n $this->set($key, $value);\n }\n }\n\n // Eliminate relationships missing in the $array\n foreach ($this->_references as $name => $relation) {\n\t $rel = $this->getTable()->getRelation($name);\n\n if ( ! $rel->isRefClass() && ! isset($array[$name]) && ( ! $rel->isOneToOne() || ! isset($array[$rel->getLocalFieldName()]))) {\n unset($this->$name);\n }\n }\n\n if ($refresh) {\n $this->refresh();\n }\n }", "function make_object_array( $array )\n\t{\n\t\tforeach ( $array as $i => $data )\n\t\t\t$array[ $i ] = make_object( $data );\n\t\treturn $array;\n\t}", "public function hydrate(array $data, object $object);", "function setAllSoft($arraydata) {\r\n\r\n foreach ($arraydata as $k => $v)\r\n if (in_array($k, array_keys($this->properties)))\r\n $this->properties[$k] = $v;\r\n\r\n\r\n\r\n $this->ID = $arraydata[\"ID\"];\r\n $this->_normalize();\r\n }", "public function importFromArray(array $array) {\n $all_ids = [];\n array_walk($array, function ($item, $key) use (&$all_ids) {\n if (isset($item['id'])) {\n $all_ids[$item['id']] = $item['id'];\n }\n });\n\n // Preload all nodes which have the Yext IDs.\n $nodes = YextEntityFactory::instance()->preloadUniqueNodes($this->yextNodeType(), $this->uniqueYextIdFieldName(), $all_ids);\n\n // Walk through all items from yext.\n foreach ($array as $item) {\n // Wrap the item in a YextSourceRecord object for manipulation.\n $source = new YextSourceRecord($item);\n // If a node already exists, use that one; otherwise create a new one.\n // This ensures that we should never have two nodes with the same\n // Yext ID.\n $destination = empty($nodes[$source->getYextId()]) ? $this->getOrCreateUniqueNode($source) : $nodes[$source->getYextId()];\n\n $migrator = new NodeMigrationAtCreation($source, $destination);\n try {\n $result = $migrator->migrate() ? 'migration occurred' : 'migration skipped, probably because update time is identical in source/dest.';\n $this->watchdog('Yext ' . $result . ' for ' . $source->getYextId() . ' to ' . $destination->id());\n $this->incrementSuccess();\n }\n catch (\\Throwable $t) {\n $this->watchdogThrowable($t);\n $this->incrementFailed($item);\n }\n }\n }", "abstract public function fromArray(array $array): BaseEntity;", "public function synchronizeWithArray(array $array)\n {\n foreach ($this as $key => $record) {\n if (isset($array[$key])) {\n $record->synchronizeWithArray($array[$key]);\n unset($array[$key]);\n } else {\n // remove records that don't exist in the array\n $this->remove($key);\n }\n }\n // create new records for each new row in the array\n foreach ($array as $rowKey => $row) {\n $this[$rowKey]->fromArray($row);\n }\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
product info retrive by product id for invoice
public function retrieve_product_data_inv() { $CI =& get_instance(); $product_id = $this->input->post('product_id'); $product_info = $CI->Invoices->get_total_product_invoic($product_id); echo json_encode($product_info); }
[ "public function retrieve_product_data_inv()\n\t{\t\n\t\t$CI =& get_instance();\n\t\t$this->auth->check_admin_auth();\n\t\t$CI->load->model('Invoices');\n\t\t$product_id = $this->input->post('product_id',true);\n\t\t$product_info = $CI->Invoices->get_total_product_invoic($product_id);\n\t\techo json_encode($product_info);\n\t}", "public function retrieve_product_data_inv() {\n $CI = & get_instance();\n $this->auth->check_admin_auth();\n $CI->load->model('Invoices');\n $product_id = $this->input->post('product_id',TRUE);\n\n\n $product_info = $CI->Invoices->get_total_product_invoic($product_id);\n\n echo json_encode($product_info);\n }", "public function retrieve_product_data_inv() {\r\n $CI = & get_instance();\r\n $this->auth->check_admin_auth();\r\n $CI->load->model('Invoices');\r\n $product_id = $this->input->post('product_id');\r\n\r\n\r\n $product_info = $CI->Invoices->get_total_product_invoic($product_id);\r\n\r\n echo json_encode($product_info);\r\n }", "public static function product_detail($pid='')\r\n {\r\n if ($pid=='') {\r\n echo 'not found PID for detail product'; die();\r\n }\r\n $data = array('pid'=>$pid);\r\n return Iziroam_ApiRequestor::get(\r\n Iziroam_Config::getBaseUrl().'api-product/detail',\r\n Iziroam_Config::$secretKey,Iziroam_Config::$mID,$data);\r\n }", "function productDetailsWithId($productID = '') {\n\n $arrClms = array(\n 'pkProductID',\n 'ProductRefNo',\n 'ProductName',\n 'fkShippingID',\n 'fkWholesalerID', 'Quantity', 'QuantityAlert', 'ProductImage'\n );\n $varTable = TABLE_PRODUCT;\n $argWhere = \"pkProductID =\" . $productID;\n $arrRes = $this->select($varTable, $arrClms, $argWhere);\n //pre($arrRes);\n return $arrRes;\n }", "public function getProduct();", "public function details_get($product_id=''){\n if(!empty($product_id)){\n $response = $this->Products_model->get_product_details($product_id) ;\n $this->response($response, 200);\n }else{\n $error = array(\n \"code\"=>'USR_02',\n \"message\"=>'Product ID is empty',\n \"field\"=>\"product_id\",\n \"status\"=>\"500\"\n );\n $this->response($error, 400);\n }\n }", "function getProductDetails(){\n return fetchProductDetails();\n }", "public function find_product($product_id)\n\t{\n\t}", "public function get_product_id()\n {\n }", "public function getProductById($id);", "public function getProductDetails($product_id='')\n {\n \t$this->db->select('p.product_id, p.product_name, p.tbt_cut_points, p.density, p.viscosity, p.user_agreement_terms, p.user_id, p.updated_on, u.username, ar.role_name, dr.reason');\n \t$this->db->from('product as p');\n \t$this->db->join('users as u', 'u.user_id = p.user_id', 'left');\n \t$this->db->join('app_roles as ar', 'ar.role_id = u.auth_level', 'left');\n \t$this->db->join('deals_reasons as dr', 'dr.product_id = p.product_id', 'left');\n\n \tif($product_id)\n \t{\n \t\t$this->db->where('p.product_id', $product_id);\n \t}\n\n \t$results= $this->db->get()->result();\n\t\treturn $results;\n }", "private function showProductsById()\n { \n $productNum1 = $this->productDao->getById(1);\n $productNum9 = $this->productDao->getById(9);\n \n echo PHP_EOL;\n echo 'Product with id 1: ' . PHP_EOL; print_r($productNum1);\n echo 'Product with id 9: ' . PHP_EOL; print_r($productNum9);\n }", "function getProdItemInfo($prodId){\r\n $db = soapangelsConnect();\r\n $sql = 'SELECT * FROM products WHERE prodId = :prodId';\r\n $stmt = $db->prepare($sql);\r\n $stmt->bindValue(':prodId', $prodId, PDO::PARAM_INT);\r\n $stmt->execute();\r\n $prodInfo = $stmt->fetch(PDO::FETCH_ASSOC);\r\n $stmt->closeCursor();\r\n return $prodInfo;\r\n }", "function getProductInfo($pid,$extra_params)\n\t{\n\t\t\n\t\t$productInfo=$this->findProduct(array('id'=>$pid));\n\t\tif($productInfo)\n\t\t{\n\t\t\t$productInfo['ws_rule_number']=1;\n\t\t\t$productInfo['product']=$productInfo;\n\t\t\tif(isset($extra_params['getPriceRange']) && $extra_params['getPriceRange'])\n\t\t\t{\n\t\t\t\t$productInfo['priceRanges']=$this->getPriceRange(array('pid'=>$pid),true);\n\t\t\t}\t\n\t\t\t\n\t\t\tif(isset($extra_params['getImages']) && $extra_params['getImages'])\n\t\t\t{\n\t\t\t\t$productInfo['Images']=$this->getProductImages(array('pid'=>$pid),true);\n\t\t\t}\n\t\t\t\n\t\t\tif(isset($extra_params['getShop']) && $extra_params['getShop'])\n\t\t\t{\n\t\t\t\t$productInfo['shop_info']=$this->shop_model->findShop(array('id'=>$productInfo['sid']));\n\t\t\t}\t\n\t\t\tif(isset($extra_params['getProperties']) && $extra_params['getProperties'])\n\t\t\t{\n\t\t\t\t$properties=$this->getProductProperties(array('pid'=>$pid),true);\n\t\t\t\tif($properties)\n\t\t\t\t{\n\t\t\t\t\tforeach($properties as $property_key=>$property)\n\t\t\t\t\t{\n\t\t\t\t\t\t$property_values=$this->getPropertyValues(array('id'=>$property['id']),true);\n\t\t\t\t\t\t$properties[$property_key]['values']=$property_values;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$productInfo['properties']=$properties;\n\t\t\t}\t\n\t\t\tif(isset($extra_params['getSkus']) && $extra_params['getSkus'])\n\t\t\t{\n\t\t\t\t$product_skus=$this->getProductSKUS(array('pid'=>$pid),true);\n\t\t\t\tif($product_skus)\n\t\t\t\t{\n\t\t\t\t\tforeach($product_skus as $p_sku_key=>$p_sku)\n\t\t\t\t\t{\n\t\t\t\t\t\t$SKU_Properties=$this->getSKUProperties(array('product_sku_id'=>$p_sku['id']),true);\n\t\t\t\t\t\t$product_skus[$p_sku_key]['properties']=$SKU_Properties;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$productInfo['skus']=$product_skus;\n\t\t\t}\n\t\t\t\t\t\t\n\t\t\treturn $productInfo;\n\t\t}else{\n\t\t\treturn null;\n\t\t}\n\t}", "public function getProductById(int $id);", "public function getProductoId(){\n \treturn $this->ProductoId;\n\t}", "function _GetProductPc($db, $inf_invoice_id) {\n\n\t# Get all the products/items in that order so we can divide the payment into the products\n\t# NOTE: The JOIN to inf_products will auto remove all -ve promo amount\n\t$query = \"SELECT io.inf_order_item_id, io.inf_product_id, io.qty, io.ppu AS amt\n\t\t\t\t, p.product_type, p.sa_option, p.product_name, p.default_cp_type\n\t\t\tFROM inf_order_items io\n\t\t\tJOIN inf_products p USING (inf_product_id)\n\t\t\tJOIN inf_invoices i ON i.inf_invoice_id = io.inf_order_id\n\t\t\tWHERE io.inf_order_id = '$inf_invoice_id'\";\n\tif (DEBUG) EchoLn($query); \n\t$result = mysqli_query($db, $query) or die(mysqli_error($db));\n\n\t$res = array();\n\t$invoice_total = 0;\n\t$products = array();\n\twhile ($row = mysqli_fetch_assoc($result)) {\n\t\t$invoice_total += $row['amt'];\n\t\t$products[$row['inf_order_item_id']] = $row['amt'];\n\t\t$res[$row['inf_order_item_id']]['product_type'] = $row['product_type'];\n\t\t$res[$row['inf_order_item_id']]['sa_option'] = $row['sa_option'];\n\t\t$res[$row['inf_order_item_id']]['product_name'] = $row['product_name'];\n\t\t$res[$row['inf_order_item_id']]['default_cp_type'] = $row['default_cp_type'];\n\t}\n\tforeach ($products as $product_type => $amt) {\n\t\t$res[$product_type]['pc'] = floor($amt*100/$invoice_total);\n\t}\n\n\treturn $res;\n}", "function getProductInfo($invId) {\r\n $db = acmeConnect();\r\n $sql = 'SELECT * FROM inventory WHERE invId = :invId';\r\n $stmt = $db->prepare($sql);\r\n $stmt->bindValue(':invId', $invId, PDO::PARAM_INT);\r\n $stmt->execute();\r\n $prodInfo = $stmt->fetch(PDO::FETCH_ASSOC);\r\n $stmt->closeCursor();\r\n return $prodInfo;\r\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This method is used to Count Total Stuff of Category on BrowseCateogyr.php Page
function BllBrowseCategoryStuffTotalRecords($category,$filter="") { $this->objConnection=new MySQLConnection(); $this->objConnection->Open(); $query="SELECT (SELECT count( tblPeopleLike.StuffID)FROM tblPeopleLike WHERE tblPeopleLike.StuffID = tblStuff.ID) AS TotalCount, tblStuff.ID AS StuffID, tblStuff.Title, tblTag.ID AS TagID, tblTag.TagName, (SELECT count( tblStuffComment.StuffID)FROM tblStuffComment WHERE tblStuffComment.StuffID = tblStuff.ID) AS TotalComment, (SELECT DISTINCT tblStuffImages.ImagePath FROM tblStuffImages, tblStuff WHERE tblStuffImages.StuffID = tblPeopleLike.StuffID GROUP BY tblStuffImages.StuffID LIMIT 0 , 1) AS ImagePath FROM tblStuff LEFT OUTER JOIN tblPeopleLike ON tblStuff.ID = tblPeopleLike.StuffID LEFT OUTER JOIN tblTag ON tblStuff.TagID = tblTag.ID LEFT OUTER JOIN tblStuffComment ON tblStuff.ID = tblStuffComment.StuffID LEFT OUTER JOIN tblCategory ON tblStuff.CategoryID = tblCategory.ID INNER JOIN tblStuffImages ON tblStuffImages.StuffID = tblStuff.ID WHERE 1 =1 AND (tblStuff.Status = 'A' Or tblStuff.Status='L') AND tblCategory.Status = 'A' And tblPeopleLike.CategoryID=".$category." Group By tblPeopleLike.StuffID"; if($filter=="created") $query.=" Order by tblPeopleLike.CreatedDate Desc"; else if($filter=="popular") $query.=" Order by TotalCount Desc "; else if($filter=="active discussion") $query.=" Order by TotalComment Desc"; $result=$this->objConnection->SelectQuery($query); $totalrecords=mysql_num_rows($result); $this->objConnection->Close(); return $totalrecords; }
[ "public function numCategoryItems();", "public function getCategoryCount();", "function getCountcats()\n\t{\n\n\t\t$db = JFactory::getDbo();\n\t\t$query = $db->getQuery(true);\n\t\t$query->select(array('*'));\n\t\t$query->from('#__jem_cats_event_relations');\n\t\t$db->setQuery($query);\n\t\t$db->query();\n\n\t\t$total = $db->loadObjectList();\n\n\t\t$count = count($total);\n\n\t\treturn $count;\n\t}", "public function countCategorie(){\n\t\t\t\t\t return count($this->listeCategorie());\n\t\t\t\t\t }", "public function adminCountArticlesCategoriesGrid(){\n\t\t$query = \"SELECT COUNT(id) FROM articles_categories\";\n\t\treturn $this->getField($query);\n\t}", "function osc_priv_count_subcategories() {\n return View::newInstance()->_count('subcategories');\n }", "public function listingCountAction()\n {\n if ($this->Request()->getParam('sSearch')) {\n $result = $this->fetchSearchListing();\n $this->setSearchResultResponse($result);\n\n return;\n }\n\n $categoryId = (int) $this->Request()->getParam('sCategory');\n\n $context = $this->container->get('shopware_storefront.context_service')->getShopContext();\n\n $category = $this->container->get('shopware_storefront.category_gateway')->get($categoryId, $context);\n\n $productStream = $category->getProductStream();\n\n if ($productStream) {\n $result = $this->fetchStreamListing($categoryId, $productStream->getId());\n $this->setSearchResultResponse($result);\n\n return;\n }\n\n $result = $this->fetchCategoryListing();\n $this->setSearchResultResponse($result);\n }", "public function category_count()\r\n\t{\r\n\t$result=$this->db->query(\"select * from \".$this->prefix.\"group_category\");\r\n\treturn count($result);\r\n\t}", "protected function totalCategories()\n {\n return $this->category->where('lang', $this->getLang())->count();\n }", "function affwp_get_add_on_count( $add_on_category = '' ) {\n\t\n\tif ( ! $add_on_category ) {\n\t\treturn;\n\t}\n\n\t$args = array(\n\t\t'type' => 'download',\n\t\t'taxonomy' => 'download_category',\n\t); \n\n\t$categories = get_categories( $args );\n\n\tforeach ( $categories as $category ) {\n\t\tif ( $category->slug == $add_on_category ) {\n\t\t\t$count = $category->count;\n\t\t}\n\t}\n\n\treturn $count;\n}", "function osc_count_subcategories() {\n $category = View::newInstance()->_current('categories');\n if ( $category == '' ) return -1;\n if ( !isset($category['categories']) ) return 0;\n if ( !is_array($category['categories']) ) return 0;\n if ( count($category['categories']) == 0 ) return 0;\n if ( !View::newInstance()->_exists('subcategories') ) {\n View::newInstance()->_exportVariableToView('subcategories', $category['categories']);\n }\n return osc_priv_count_subcategories();\n }", "public function totalcategorycount()\n {\n $objectManager = \\Magento\\Framework\\App\\ObjectManager::getInstance();\n\n $categoryFactory = $objectManager->create('Magento\\Catalog\\Model\\CategoryFactory');\n\n $collection = $categoryFactory->create()->getCollection();\n\n $totals = [\n 'total_categories' => $collection->getSize()\n ];\n\n return json_encode($totals);\n }", "public function purchase_report_category_wise_count() {\n \n }", "function countCommision(){\n\t\t\t$this->db->where('id_main_cat', 2);\n\t\t\t$this->db->from('title_photopost');\n\t\t\treturn $this->db->count_all_results();\n\t\t}", "function get_TotalLinksInCat_cnt($CatID='')\n\t{\n\t\tif(empty($CatID) || ($CatID == \"0\")) { return \"0\"; }\n\t\t$sum = 0;\n\t\t\n\t\t// Sum all subcategories from here\n\n\t\t$sql = \"SELECT * from $this->CAT_TBL where CatParent = $CatID AND course_id=$_SESSION[course_id]\";\n\t\t$conn = $this->CONN;\n\t\t$results = mysql_query($sql,$conn);\n\t\tif( (!$results) or (empty($results)) ) {\n\t\t\tmysql_free_result($results);\n\t\t\treturn ($sum);\n\t\t}\n\n\t\twhile ($row = mysql_fetch_array($results))\n\t\t{\n\t\t\t$id = $row[\"CatID\"];\n\t\t\t$sum = $sum + $this->get_TotalLinksInCat_cnt($id);\n\t\t}\n\n\t\t// Then add this category\n\n\t\t$sum = $sum + $this->get_LinksInCat_cnt($CatID);\n\n\t\treturn ($sum);\n\t}", "function number_category()\n\t{\n\t\t$pdo = PDO2::getInstance();\n\t\t\n\t\t$query=$pdo->prepare(\"SELECT COUNT(*) AS nbr FROM tbl_category\");\n\t\n\t\t$query->execute();\n\t\tif ($result = $query->fetch(PDO::FETCH_ASSOC)) {\n\t\t\t$query->closeCursor();\n\t\t\treturn $result['nbr'];\n\t\t}\n\t\treturn false;\n\t}", "public function getCategoryCount() {\n\t\treturn $this->app->table->category->count(array('select' => 'id', 'conditions' => array('application_id=?',$this->id)));\n\t}", "public function ads_count_category( $category ){\r\n\t\t$this->load->database();\r\n\t\t$query = $this->db->query(\"select count(adid) as counts from advertisements where adstatus='confi' and category ='\".$category.\"'\");\r\n\t\t\r\n\t\tforeach ($query->result() as $row)\r\n\t\t{\t\t\r\n\t\t\treturn $row->counts;\r\n\t\t}\t\t\r\n\t\t\t\t\t\r\n\t}", "function oos_total_products_in_category($category_id)\n{\n\n $products_count = 0;\n\n $dbconn =& oosDBGetConn();\n $oostable =& oosDBGetTables();\n\n $productstable = $oostable['products'];\n $products_to_categoriestable = $oostable['products_to_categories'];\n $products = $dbconn->Execute(\"SELECT COUNT(*) AS total FROM $productstable p, $products_to_categoriestable p2c WHERE p.products_id = p2c.products_id AND p.products_status >= '1' AND p2c.categories_id = '\" . intval($category_id) . \"'\");\n\n $products_count += $products->fields['total'];\n\n return $products_count;\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Save User token by data
function saveToken($tokenData);
[ "public function saveToken($user, $token);", "function saveUserToken(UserAbstract $user);", "public function saveToken(Token $token);", "static function saveToken($data)\n {\n $sms = $data;\n $expire = time() + $data->expires;;\n $sms->expires = Carbon::parse($expire);\n $sms->extra['user'] = $data->user;\n $sms->extra['roles'] = $data->user;\n $sms->extra = json_encode($sms->extra);\n $sms->token = $data->jwt;\n unset($sms->user, $sms->roles, $sms->jwt);\n $sms = (array)$sms;\n return self::create($sms);\n }", "private function _saveToken($token){\n if($this->_user instanceof User){\n $this->_user->setGoogleCalendarToken(!empty($token)?json_encode($token):$token);\n $this->_em->persist($this->_user);\n $this->_em->flush();\n }\n }", "public function storeToken($token);", "public function store(Request $request, Token $token, User $user);", "abstract protected function _save($token);", "public function AddUserToken($data)\n {\n $this->db->query(\"INSERT INTO login_tokens (token,user_id)\n VALUES(:tokeN,:useRiD)\");\n\n /* bind the values before executing */\n $this->db->bind(':tokeN', $data['token']);\n $this->db->bind(':useRiD', $data['user_id']);\n\n\n $this->db->execute();\n }", "private function update_token() {\n $update = array(\n \"token\" => $this->generate_token(),\n \"token_expire\" => date(\"Y-m-d H:i:s\",strtotime(date(\"Y-m-d H:i:s\") . \"+2 days\"))\n );\n $this->init($this->db->update(\"user\", $this->id, $update)[\"result\"]);\n }", "private function saveToken()\n\t{\n\t\t$fd = fopen($this->cacheFolder.\"/token.txt\", 'w');\n\t\tfwrite($fd, $this->token);\n\t\tfclose($fd);\n\t}", "function save_token($formID, $token) {\n $this->formID = $formID;\n $this->token = $token; \n }", "protected function saveDeviceToken()\r\n {\r\n $token_integer = null;\r\n\r\n if(isset($this->auth->params['token'])){\r\n $token_integer = crc32(md5($this->auth->params['token']));\r\n }\r\n\r\n if(!is_null($token_integer)){\r\n\r\n if(DeviceToken::where('user_id',$this->auth->params['authId'])\r\n ->where('device_agent_integer',crc32(md5($_SERVER['HTTP_USER_AGENT'])))->count()==0){\r\n\r\n return DeviceToken::create([\r\n 'user_id' => $this->auth->params['authId'],\r\n 'token' => $this->auth->params['token'],\r\n 'token_integer' => $token_integer,\r\n 'device_agent' => $_SERVER['HTTP_USER_AGENT'],\r\n 'device_agent_integer' => crc32(md5($_SERVER['HTTP_USER_AGENT'])),\r\n 'expire' => $this->auth->getExpire(),\r\n ]);\r\n }\r\n else{\r\n\r\n return DeviceToken::where('user_id',$this->auth->params['authId'])\r\n ->where('device_agent_integer',crc32(md5($_SERVER['HTTP_USER_AGENT'])))\r\n ->update([\r\n 'token' => $this->auth->params['token'],\r\n 'token_integer' => $token_integer\r\n ]);\r\n }\r\n\r\n }\r\n\r\n }", "public function save()\n\t{\n\t\tif ($this->data['id'] == 0)\n\t\t{\n\t\t\t// Set the created time, token, and hash of the user agent\n\t\t\t$this->data['created'] = $this->now;\n\t\t\t$this->data['user_agent'] = sha1(Kohana::$user_agent);\n\t\t}\n\n\t\t// Create a new token each time the token is saved\n\t\t$this->data['token'] = $this->create_token();\n\n\t\treturn parent::save();\n\t}", "public function saveAccessToken($token)\n {\n }", "public function insertToken($token, $user_id) {\n $this->token = $token;\n $this->user_id = $user_id;\n $this->save();\n }", "protected function saveToken($token) {\n if ($this->connector_id === 0) {\n Civi::settings()->set('xero_access_token', $token->jsonSerialize());\n }\n else {\n civicrm_api3('Connector', 'create', ['id' => $this->connector_id, 'field4' => serialize($token->jsonSerialize())]);\n }\n }", "private function setToken($data)\n {\n $data['exp'] = time() + 60 * 60; // Expiration time\n $encoded = JWT::encode($data, env('KEY_TOKEN'));\n return $encoded;\n }", "protected function saveToken($email,$token)\n {\n DB::table(config('voicelib.tables.user_activations'))\n ->insert([\n 'email' => $email,\n 'token' => $token,\n 'created_at' => Carbon::now()\n ]);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Prepare info instance for save
public function prepareSave() { $info = $this->getInfoInstance(); $additional = new stdClass(); $additional->creditCardToken = $info->getCcToken(); $additional->creditCardHolderName = $info->getCcOwner(); $installments = 0; $installmentAmount = 0; $arrayex = explode('-', $info->getCcInstallments()); if (isset($arrayex[0])) { $installments = $arrayex[0]; $installmentAmount = $arrayex[1]; } $additional->installments = $installments; $additional->installmentAmount = $installmentAmount; if($info->getCcCampaignsCode() && $info->getCcCampaignsCode() != '') { $additional->campaignsCode = $info->getCcCampaignsCode(); } if ($info->getCcHolderAnother() && $info->getCcHolderAnother() == 1) { $additional->creditCardHolderAnother = $info->getCcHolderAnother(); $additional->creditCardHolderCpf = $info->getCcHolderCpf(); $additional->creditCardHolderPhone = $info->getCcHolderPhone(); } $serializedValue = json_encode($additional); $info->setAdditionalData($serializedValue); return $this; }
[ "public function prepareSave() {\n $info = $this->getInfoInstance();\n\n if ($info->getCcCvc() && $info->getCcCvc() != '') {\n $additional = new stdClass();\n $additional->creditCardNumber = Mage::helper('core')->encrypt($info->getCcNumber());\n $additional->creditCardHolderName = $info->getCcOwner();\n $additional->creditCardCvc = $info->getCcCvc();\n $additional->creditCardExpiry = $info->getCcExpiry();\n\n\t\t\t$installments = 0;\n\t\t\t$installmentAmount = 0;\n\n\t\t\t$arrayex = explode('-', $info->getCcInstallments());\n\t\t\tif (isset($arrayex[0])) {\n\t\t\t\t$installments = $arrayex[0];\n\t\t\t\t$installmentAmount = $arrayex[1];\n\t\t\t}\n\n\t\t\t$additional->installments = $installments;\n\t\t\t$additional->installmentAmount = $installmentAmount;\n\n if ($info->getCcHolderAnother() && $info->getCcHolderAnother() == 1) {\n $additional->creditCardHolderAnother = $info->getCcHolderAnother();\n $additional->creditCardHolderCpf = $info->getCcHolderCpf();\n $additional->creditCardHolderPhone = $info->getCcHolderPhone();\n $additional->creditCardHolderBirthDate = $info->getCcHolderBirthDate();\n }\n\n $serializedValue = json_encode($additional);\n $info->setAdditionalData($serializedValue);\n }\n\n return $this;\n }", "protected function savePrepare()\n {\n parent::savePrepare();\n if ($this->hasUnsavedChanges()) {\n $responsibleUser = DAuthorisationManager::getResponsibleUser();\n $this->setFieldValue(self::FIELD_LAST_UPDATED_BY, $responsibleUser);\n $this->setFieldValue(self::FIELD_LAST_UPDATED, time());\n $this->setFieldValue(self::FIELD_STRING_VALUE, $this->getStringValue());\n }\n }", "public function prepareSave()\n {\n $info = $this->getInfoInstance();\n if ($this->_canSaveCc) {\n $info->setCcNumberEnc($info->encrypt($info->getCcNumber()));\n }\n $info->setCcNumber(null)\n ->setCcCid(null);\n return $this;\n }", "protected function processSaveData() {}", "public function save_info(){\n $this->is_ajax();\n $n = new info;\n $n->set('info',addslashes($_POST['info']));\n $n->set('client',$_POST['client_id']);\n $n->save();\n $this->end_call();\n }", "private function saveInventory($info)\n {\n $inventory = new Inventory;\n $inventory->inventory = $info['inventory'];\n $inventory->category_id = $info['category_id'];\n $inventory->all_properties = json_encode($info['all_properties']);\n $inventory->save();\n }", "protected function storeInfo() {\n db_merge('rules_web_remote_info')\n ->key(array('name' => $this->name))\n ->fields(array(\n 'info' => serialize($this->info),\n 'token' => $this->token,\n ))\n ->execute();\n }", "private function create_object_info() {\n\t\tif ( ! isset( $this->info ) ) {\n\t\t\trequire_once( SLPPOWER_REL_DIR . 'include/class.admin.info.php' );\n\t\t\t$this->info = new SLPPower_Admin_Info( array( 'addon' => $this->addon ) );\n\t\t}\n\t}", "public function prepareData()\n {\n // Get the payment token\n $this->paymentToken = $this->vaultHandler->getLastSavedCard();\n\n // Get the instant purchase option\n $this->instantPurchaseOption = $this->loadOption();\n\n // Get the shipping and billing data\n if ($this->instantPurchaseOption) {\n $this->shippingAddress = $this->instantPurchaseOption->getShippingAddress();\n $this->billingAddress = $this->instantPurchaseOption->getBillingAddress();\n $this->shippingMethod = $this->instantPurchaseOption->getShippingMethod();\n }\n }", "public static function guardar($info){\n \t$apu = new BibliotecaApus($info['datos']);\n \t$apu->por_utilidad = 0;\n \t$apu->save();\n \tif (isset($info['equipos'])) {\n \t\t$apu->equipos()->attach($apu->formato1Attach($info['equipos']));\n \t}\n \tif (isset($info['materiales'])) {\n \t\t$apu->materiales()->attach($apu->formato2Attach($info['materiales']));\n \t}\n \tif (isset($info['manosObra'])) {\n \t\t$apu->manoDeObra()->attach($apu->formato1Attach($info['manosObra']));\n \t}\n \tif (isset($info['transportes'])) {\n \t\t$apu->transportes()->attach($apu->formato2Attach($info['transportes']));\n \t}\n }", "public function save() {\n $this->loadFields();\n $this->saveObject(__CLASS__);\n }", "public function _prepare(){\t\r\r\n\t\t// init array\r\r\n\t\t$this->options = array();\t\r\r\n\t\t// to be saved\r\r\n\t\t$vars = array('code','name','description','setting');\t\t\r\r\n\t\t// loop\r\r\n\t\tforeach($vars as $var){\r\r\n\t\t\t// set\r\r\n\t\t\t$this->options[$var] = @$this->{$var};\r\r\n\t\t}\r\r\n\t}", "protected function prepareAdditionalData() {}", "public function save() {\n\t\t// If 'data' can not be decoded, it means it has been decoded already\n\t\t// and we should encode it again before saving it.\n\t\tif (isset($this->details['data']) && (is_array($this->details['data']) || json_decode($this->details['data']) === null)) {\n\t\t\t$this->details['data'] = json_encode($this->details['data']);\n\t\t}\n\n\t\t$this->trait_save();\n\t}", "public function save_entry() {\n\t\tif( !$this->id ) {\n\t\t\t$this->campaign_token = api_generate_token();\n\t\t}\n\n\t\t$this->updated_at = date('Y-m-d H:i:s');\n\n\t\tif( !$this->created_at ) {\n\t\t\t$this->created_at = date('Y-m-d H:i:s');\n\t\t}\n\n\n\t\tparent::save_entry();\n\n\t\tif( $this->_temp_file ) {\n\t\t\t$this->_process_file();\n\t\t}\n\n\t\tif( $this->_temp_campaign_responses ) {\n\t\t\t$this->_process_campaign_responses();\n\t\t}\n\t}", "public function prepareDataBeforeSave()\n {\n $coreHelper = Mage::helper('core');\n $emvParams = $this->getData('emv_params');\n if (is_array($emvParams)) {\n $this->setData('emv_params', $coreHelper->jsonEncode($emvParams));\n } else {\n $this->setData('emv_params', null);\n }\n\n $emvContent = $this->getData('emv_content_variables');\n if (is_array($emvContent)) {\n $this->setData('emv_content_variables', $coreHelper->jsonEncode($emvContent));\n } else {\n $this->setData('emv_content_variables', null);\n }\n\n $emvVariables = $this->getData('emv_dyn_variables');\n if (is_array($emvVariables)) {\n $this->setData('emv_dyn_variables', $coreHelper->jsonEncode($emvVariables));\n } else {\n $this->setData('emv_dyn_variables', null);\n }\n\n $email = $this->getData('email');\n if (is_array($email)) {\n $this->setData('email', implode(',', $email));\n }\n\n if ($this->getData('created_at') == null) {\n // created_at is also in gmt date\n $gmtDate = Mage::getModel('core/date')->gmtDate();\n $this->setData('created_at', $gmtDate);\n }\n\n return $this;\n }", "protected function prepare()\n {\n $this->slug = $this->getSubmittedSlug();\n\n if ($this->isNew()) {\n $this->prepForNewEntry();\n } else {\n $this->prepForExistingEntry();\n }\n\n // As part of the prep, we'll apply the date and slug. We'll remove them\n // from the fields array since we don't want it to be in the YAML.\n unset($this->fields['date'], $this->fields['slug']);\n\n $this->fieldset = $this->content->fieldset()->withTaxonomies();\n }", "protected function prepareData()\n {\n \n foreach ($this->data as $key => $value) {\n switch ($key) {\n case 'urlPath':\n $this->urlPath = $value;\n break;\n case 'paramName':\n $this->paramName = $value;\n break;\n default:\n $this->additionalData[$key] = $value;\n break;\n }\n }\n }", "public function save(){\n\n $oArticle = $this->getArticle();\n\n $sArticleTableName = $oArticle->getCoreTableName();\n\n $sSourceFieldNameCustoms = $sArticleTableName . '__' . asign_ycaddfields_db::CUSTOMS;\n $sSourceFieldNameTara = $sArticleTableName . '__' . asign_ycaddfields_db::TARA;\n $sSourceFieldNameOrigin = $sArticleTableName . '__' . asign_ycaddfields_db::ORIGIN;\n\n $sOrderArticleTableName = $this->getCoreTableName();\n\n $sDestFieldNameCustoms = $sOrderArticleTableName . '__' . asign_ycaddfields_db::CUSTOMS;\n $sDestFieldNameTara = $sOrderArticleTableName . '__' . asign_ycaddfields_db::TARA;\n $sDestFieldNameOrigin = $sOrderArticleTableName . '__' . asign_ycaddfields_db::ORIGIN;\n\n $this->$sDestFieldNameCustoms = clone $oArticle->$sSourceFieldNameCustoms;\n $this->$sDestFieldNameTara = clone $oArticle->$sSourceFieldNameTara;\n $this->$sDestFieldNameOrigin = clone $oArticle->$sSourceFieldNameOrigin;\n\n return parent::save();\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets an array of mfFormularioUtilizador objects which contain a foreign key that references this object. If the $criteria is not null, it is used to always fetch the results from the database. Otherwise the results are fetched from the database the first time, then cached. Next time the same method is called without $criteria, the cached collection is returned. If this sfGuardUser is new, it will return an empty collection or the current collection; the criteria is ignored on a new object.
public function getmfFormularioUtilizadors($criteria = null, PropelPDO $con = null) { if(null === $this->collmfFormularioUtilizadors || null !== $criteria) { if ($this->isNew() && null === $this->collmfFormularioUtilizadors) { // return empty collection $this->initmfFormularioUtilizadors(); } else { $collmfFormularioUtilizadors = mfFormularioUtilizadorQuery::create(null, $criteria) ->filterBysfGuardUser($this) ->find($con); if (null !== $criteria) { return $collmfFormularioUtilizadors; } $this->collmfFormularioUtilizadors = $collmfFormularioUtilizadors; } } return $this->collmfFormularioUtilizadors; }
[ "public function getsfGuardRememberKeys($criteria = null, PropelPDO $con = null)\n\t{\n\t\tif ($criteria === null) {\n\t\t\t$criteria = new Criteria(sfGuardUserPeer::DATABASE_NAME);\n\t\t}\n\t\telseif ($criteria instanceof Criteria)\n\t\t{\n\t\t\t$criteria = clone $criteria;\n\t\t}\n\n\t\tif ($this->collsfGuardRememberKeys === null) {\n\t\t\tif ($this->isNew()) {\n\t\t\t $this->collsfGuardRememberKeys = array();\n\t\t\t} else {\n\n\t\t\t\t$criteria->add(sfGuardRememberKeyPeer::USER_ID, $this->id);\n\n\t\t\t\tsfGuardRememberKeyPeer::addSelectColumns($criteria);\n\t\t\t\t$this->collsfGuardRememberKeys = sfGuardRememberKeyPeer::doSelect($criteria, $con);\n\t\t\t}\n\t\t} else {\n\t\t\t// criteria has no effect for a new object\n\t\t\tif (!$this->isNew()) {\n\t\t\t\t// the following code is to determine if a new query is\n\t\t\t\t// called for. If the criteria is the same as the last\n\t\t\t\t// one, just return the collection.\n\n\n\t\t\t\t$criteria->add(sfGuardRememberKeyPeer::USER_ID, $this->id);\n\n\t\t\t\tsfGuardRememberKeyPeer::addSelectColumns($criteria);\n\t\t\t\tif (!isset($this->lastsfGuardRememberKeyCriteria) || !$this->lastsfGuardRememberKeyCriteria->equals($criteria)) {\n\t\t\t\t\t$this->collsfGuardRememberKeys = sfGuardRememberKeyPeer::doSelect($criteria, $con);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$this->lastsfGuardRememberKeyCriteria = $criteria;\n\t\treturn $this->collsfGuardRememberKeys;\n\t}", "public function getUsuarios($criteria = null, PropelPDO $con = null)\n {\n $partial = $this->collUsuariosPartial && !$this->isNew();\n if (null === $this->collUsuarios || null !== $criteria || $partial) {\n if ($this->isNew() && null === $this->collUsuarios) {\n // return empty collection\n $this->initUsuarios();\n } else {\n $collUsuarios = UsuarioQuery::create(null, $criteria)\n ->filterByPessoa($this)\n ->find($con);\n if (null !== $criteria) {\n if (false !== $this->collUsuariosPartial && count($collUsuarios)) {\n $this->initUsuarios(false);\n\n foreach($collUsuarios as $obj) {\n if (false == $this->collUsuarios->contains($obj)) {\n $this->collUsuarios->append($obj);\n }\n }\n\n $this->collUsuariosPartial = true;\n }\n\n $collUsuarios->getInternalIterator()->rewind();\n return $collUsuarios;\n }\n\n if($partial && $this->collUsuarios) {\n foreach($this->collUsuarios as $obj) {\n if($obj->isNew()) {\n $collUsuarios[] = $obj;\n }\n }\n }\n\n $this->collUsuarios = $collUsuarios;\n $this->collUsuariosPartial = false;\n }\n }\n\n return $this->collUsuarios;\n }", "public function getUsuarios($criteria = null, PropelPDO $con = null)\n\t{\n\t\tif ($criteria === null) {\n\t\t\t$criteria = new Criteria(CorredorPeer::DATABASE_NAME);\n\t\t}\n\t\telseif ($criteria instanceof Criteria)\n\t\t{\n\t\t\t$criteria = clone $criteria;\n\t\t}\n\n\t\tif ($this->collUsuarios === null) {\n\t\t\tif ($this->isNew()) {\n\t\t\t $this->collUsuarios = array();\n\t\t\t} else {\n\n\t\t\t\t$criteria->add(UsuarioPeer::ID_CORREDOR, $this->id);\n\n\t\t\t\tUsuarioPeer::addSelectColumns($criteria);\n\t\t\t\t$this->collUsuarios = UsuarioPeer::doSelect($criteria, $con);\n\t\t\t}\n\t\t} else {\n\t\t\t// criteria has no effect for a new object\n\t\t\tif (!$this->isNew()) {\n\t\t\t\t// the following code is to determine if a new query is\n\t\t\t\t// called for. If the criteria is the same as the last\n\t\t\t\t// one, just return the collection.\n\n\n\t\t\t\t$criteria->add(UsuarioPeer::ID_CORREDOR, $this->id);\n\n\t\t\t\tUsuarioPeer::addSelectColumns($criteria);\n\t\t\t\tif (!isset($this->lastUsuarioCriteria) || !$this->lastUsuarioCriteria->equals($criteria)) {\n\t\t\t\t\t$this->collUsuarios = UsuarioPeer::doSelect($criteria, $con);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$this->lastUsuarioCriteria = $criteria;\n\t\treturn $this->collUsuarios;\n\t}", "public function getsfGuardUserPermissions($criteria = null, PropelPDO $con = null)\n\t{\n\t\tif ($criteria === null) {\n\t\t\t$criteria = new Criteria(sfGuardUserPeer::DATABASE_NAME);\n\t\t}\n\t\telseif ($criteria instanceof Criteria)\n\t\t{\n\t\t\t$criteria = clone $criteria;\n\t\t}\n\n\t\tif ($this->collsfGuardUserPermissions === null) {\n\t\t\tif ($this->isNew()) {\n\t\t\t $this->collsfGuardUserPermissions = array();\n\t\t\t} else {\n\n\t\t\t\t$criteria->add(sfGuardUserPermissionPeer::USER_ID, $this->id);\n\n\t\t\t\tsfGuardUserPermissionPeer::addSelectColumns($criteria);\n\t\t\t\t$this->collsfGuardUserPermissions = sfGuardUserPermissionPeer::doSelect($criteria, $con);\n\t\t\t}\n\t\t} else {\n\t\t\t// criteria has no effect for a new object\n\t\t\tif (!$this->isNew()) {\n\t\t\t\t// the following code is to determine if a new query is\n\t\t\t\t// called for. If the criteria is the same as the last\n\t\t\t\t// one, just return the collection.\n\n\n\t\t\t\t$criteria->add(sfGuardUserPermissionPeer::USER_ID, $this->id);\n\n\t\t\t\tsfGuardUserPermissionPeer::addSelectColumns($criteria);\n\t\t\t\tif (!isset($this->lastsfGuardUserPermissionCriteria) || !$this->lastsfGuardUserPermissionCriteria->equals($criteria)) {\n\t\t\t\t\t$this->collsfGuardUserPermissions = sfGuardUserPermissionPeer::doSelect($criteria, $con);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$this->lastsfGuardUserPermissionCriteria = $criteria;\n\t\treturn $this->collsfGuardUserPermissions;\n\t}", "public function getafNotifiedFors($criteria = null, PropelPDO $con = null)\n\t{\n\t\tif ($criteria === null) {\n\t\t\t$criteria = new Criteria(sfGuardUserPeer::DATABASE_NAME);\n\t\t}\n\t\telseif ($criteria instanceof Criteria)\n\t\t{\n\t\t\t$criteria = clone $criteria;\n\t\t}\n\n\t\tif ($this->collafNotifiedFors === null) {\n\t\t\tif ($this->isNew()) {\n\t\t\t $this->collafNotifiedFors = array();\n\t\t\t} else {\n\n\t\t\t\t$criteria->add(afNotifiedForPeer::USER, $this->id);\n\n\t\t\t\tafNotifiedForPeer::addSelectColumns($criteria);\n\t\t\t\t$this->collafNotifiedFors = afNotifiedForPeer::doSelect($criteria, $con);\n\t\t\t}\n\t\t} else {\n\t\t\t// criteria has no effect for a new object\n\t\t\tif (!$this->isNew()) {\n\t\t\t\t// the following code is to determine if a new query is\n\t\t\t\t// called for. If the criteria is the same as the last\n\t\t\t\t// one, just return the collection.\n\n\n\t\t\t\t$criteria->add(afNotifiedForPeer::USER, $this->id);\n\n\t\t\t\tafNotifiedForPeer::addSelectColumns($criteria);\n\t\t\t\tif (!isset($this->lastafNotifiedForCriteria) || !$this->lastafNotifiedForCriteria->equals($criteria)) {\n\t\t\t\t\t$this->collafNotifiedFors = afNotifiedForPeer::doSelect($criteria, $con);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$this->lastafNotifiedForCriteria = $criteria;\n\t\treturn $this->collafNotifiedFors;\n\t}", "public function getParceiroUsuarios($criteria = null, PropelPDO $con = null)\n\t{\n\t\tif ($criteria === null) {\n\t\t\t$criteria = new Criteria(ParceiroPeer::DATABASE_NAME);\n\t\t}\n\t\telseif ($criteria instanceof Criteria)\n\t\t{\n\t\t\t$criteria = clone $criteria;\n\t\t}\n\n\t\tif ($this->collParceiroUsuarios === null) {\n\t\t\tif ($this->isNew()) {\n\t\t\t $this->collParceiroUsuarios = array();\n\t\t\t} else {\n\n\t\t\t\t$criteria->add(ParceiroUsuarioPeer::PARCEIRO_ID, $this->id);\n\n\t\t\t\tParceiroUsuarioPeer::addSelectColumns($criteria);\n\t\t\t\t$this->collParceiroUsuarios = ParceiroUsuarioPeer::doSelect($criteria, $con);\n\t\t\t}\n\t\t} else {\n\t\t\t// criteria has no effect for a new object\n\t\t\tif (!$this->isNew()) {\n\t\t\t\t// the following code is to determine if a new query is\n\t\t\t\t// called for. If the criteria is the same as the last\n\t\t\t\t// one, just return the collection.\n\n\n\t\t\t\t$criteria->add(ParceiroUsuarioPeer::PARCEIRO_ID, $this->id);\n\n\t\t\t\tParceiroUsuarioPeer::addSelectColumns($criteria);\n\t\t\t\tif (!isset($this->lastParceiroUsuarioCriteria) || !$this->lastParceiroUsuarioCriteria->equals($criteria)) {\n\t\t\t\t\t$this->collParceiroUsuarios = ParceiroUsuarioPeer::doSelect($criteria, $con);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$this->lastParceiroUsuarioCriteria = $criteria;\n\t\treturn $this->collParceiroUsuarios;\n\t}", "public function getUsers($criteria = null, PropelPDO $con = null)\n\t{\n\t\tif ($criteria === null) {\n\t\t\t$criteria = new Criteria(EnumItemPeer::DATABASE_NAME);\n\t\t}\n\t\telseif ($criteria instanceof Criteria)\n\t\t{\n\t\t\t$criteria = clone $criteria;\n\t\t}\n\n\t\tif ($this->collUsers === null) {\n\t\t\tif ($this->isNew()) {\n\t\t\t $this->collUsers = array();\n\t\t\t} else {\n\n\t\t\t\t$criteria->add(UserPeer::TYPE_ID, $this->id);\n\n\t\t\t\tUserPeer::addSelectColumns($criteria);\n\t\t\t\t$this->collUsers = UserPeer::doSelect($criteria, $con);\n\t\t\t}\n\t\t} else {\n\t\t\t// criteria has no effect for a new object\n\t\t\tif (!$this->isNew()) {\n\t\t\t\t// the following code is to determine if a new query is\n\t\t\t\t// called for. If the criteria is the same as the last\n\t\t\t\t// one, just return the collection.\n\n\n\t\t\t\t$criteria->add(UserPeer::TYPE_ID, $this->id);\n\n\t\t\t\tUserPeer::addSelectColumns($criteria);\n\t\t\t\tif (!isset($this->lastUserCriteria) || !$this->lastUserCriteria->equals($criteria)) {\n\t\t\t\t\t$this->collUsers = UserPeer::doSelect($criteria, $con);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$this->lastUserCriteria = $criteria;\n\t\treturn $this->collUsers;\n\t}", "public function getEventos($criteria = null, PropelPDO $con = null)\n\t{\n\t\tif ($criteria === null) {\n\t\t\t$criteria = new Criteria(sfGuardUserPeer::DATABASE_NAME);\n\t\t}\n\t\telseif ($criteria instanceof Criteria)\n\t\t{\n\t\t\t$criteria = clone $criteria;\n\t\t}\n\n\t\tif ($this->collEventos === null) {\n\t\t\tif ($this->isNew()) {\n\t\t\t $this->collEventos = array();\n\t\t\t} else {\n\n\t\t\t\t$criteria->add(EventoPeer::USER_ID, $this->id);\n\n\t\t\t\tEventoPeer::addSelectColumns($criteria);\n\t\t\t\t$this->collEventos = EventoPeer::doSelect($criteria, $con);\n\t\t\t}\n\t\t} else {\n\t\t\t// criteria has no effect for a new object\n\t\t\tif (!$this->isNew()) {\n\t\t\t\t// the following code is to determine if a new query is\n\t\t\t\t// called for. If the criteria is the same as the last\n\t\t\t\t// one, just return the collection.\n\n\n\t\t\t\t$criteria->add(EventoPeer::USER_ID, $this->id);\n\n\t\t\t\tEventoPeer::addSelectColumns($criteria);\n\t\t\t\tif (!isset($this->lastEventoCriteria) || !$this->lastEventoCriteria->equals($criteria)) {\n\t\t\t\t\t$this->collEventos = EventoPeer::doSelect($criteria, $con);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$this->lastEventoCriteria = $criteria;\n\t\treturn $this->collEventos;\n\t}", "public function getCiUsuariossRelatedByIdUsuario(Criteria $criteria = null, ConnectionInterface $con = null)\n {\n $partial = $this->collCiUsuariossRelatedByIdUsuarioPartial && !$this->isNew();\n if (null === $this->collCiUsuariossRelatedByIdUsuario || null !== $criteria || $partial) {\n if ($this->isNew() && null === $this->collCiUsuariossRelatedByIdUsuario) {\n // return empty collection\n $this->initCiUsuariossRelatedByIdUsuario();\n } else {\n $collCiUsuariossRelatedByIdUsuario = ChildCiUsuariosQuery::create(null, $criteria)\n ->filterByCiUsuariosRelatedByInvitadoPor($this)\n ->find($con);\n\n if (null !== $criteria) {\n if (false !== $this->collCiUsuariossRelatedByIdUsuarioPartial && count($collCiUsuariossRelatedByIdUsuario)) {\n $this->initCiUsuariossRelatedByIdUsuario(false);\n\n foreach ($collCiUsuariossRelatedByIdUsuario as $obj) {\n if (false == $this->collCiUsuariossRelatedByIdUsuario->contains($obj)) {\n $this->collCiUsuariossRelatedByIdUsuario->append($obj);\n }\n }\n\n $this->collCiUsuariossRelatedByIdUsuarioPartial = true;\n }\n\n return $collCiUsuariossRelatedByIdUsuario;\n }\n\n if ($partial && $this->collCiUsuariossRelatedByIdUsuario) {\n foreach ($this->collCiUsuariossRelatedByIdUsuario as $obj) {\n if ($obj->isNew()) {\n $collCiUsuariossRelatedByIdUsuario[] = $obj;\n }\n }\n }\n\n $this->collCiUsuariossRelatedByIdUsuario = $collCiUsuariossRelatedByIdUsuario;\n $this->collCiUsuariossRelatedByIdUsuarioPartial = false;\n }\n }\n\n return $this->collCiUsuariossRelatedByIdUsuario;\n }", "public function getinboxsRelatedByUserId($criteria = null, PropelPDO $con = null)\n\t{\n\t\tif ($criteria === null) {\n\t\t\t$criteria = new Criteria(sfGuardUserPeer::DATABASE_NAME);\n\t\t}\n\t\telseif ($criteria instanceof Criteria)\n\t\t{\n\t\t\t$criteria = clone $criteria;\n\t\t}\n\n\t\tif ($this->collinboxsRelatedByUserId === null) {\n\t\t\tif ($this->isNew()) {\n\t\t\t $this->collinboxsRelatedByUserId = array();\n\t\t\t} else {\n\n\t\t\t\t$criteria->add(inboxPeer::USER_ID, $this->id);\n\n\t\t\t\tinboxPeer::addSelectColumns($criteria);\n\t\t\t\t$this->collinboxsRelatedByUserId = inboxPeer::doSelect($criteria, $con);\n\t\t\t}\n\t\t} else {\n\t\t\t// criteria has no effect for a new object\n\t\t\tif (!$this->isNew()) {\n\t\t\t\t// the following code is to determine if a new query is\n\t\t\t\t// called for. If the criteria is the same as the last\n\t\t\t\t// one, just return the collection.\n\n\n\t\t\t\t$criteria->add(inboxPeer::USER_ID, $this->id);\n\n\t\t\t\tinboxPeer::addSelectColumns($criteria);\n\t\t\t\tif (!isset($this->lastinboxRelatedByUserIdCriteria) || !$this->lastinboxRelatedByUserIdCriteria->equals($criteria)) {\n\t\t\t\t\t$this->collinboxsRelatedByUserId = inboxPeer::doSelect($criteria, $con);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$this->lastinboxRelatedByUserIdCriteria = $criteria;\n\t\treturn $this->collinboxsRelatedByUserId;\n\t}", "public function getMagasinsFavoriss($criteria = null, PropelPDO $con = null)\n\t{\n\t\tif ($criteria === null) {\n\t\t\t$criteria = new Criteria(UtilisateurPeer::DATABASE_NAME);\n\t\t}\n\t\telseif ($criteria instanceof Criteria)\n\t\t{\n\t\t\t$criteria = clone $criteria;\n\t\t}\n\n\t\tif ($this->collMagasinsFavoriss === null) {\n\t\t\tif ($this->isNew()) {\n\t\t\t $this->collMagasinsFavoriss = array();\n\t\t\t} else {\n\n\t\t\t\t$criteria->add(MagasinsFavorisPeer::ID_UTILISATEUR, $this->id);\n\n\t\t\t\tMagasinsFavorisPeer::addSelectColumns($criteria);\n\t\t\t\t$this->collMagasinsFavoriss = MagasinsFavorisPeer::doSelect($criteria, $con);\n\t\t\t}\n\t\t} else {\n\t\t\t// criteria has no effect for a new object\n\t\t\tif (!$this->isNew()) {\n\t\t\t\t// the following code is to determine if a new query is\n\t\t\t\t// called for. If the criteria is the same as the last\n\t\t\t\t// one, just return the collection.\n\n\n\t\t\t\t$criteria->add(MagasinsFavorisPeer::ID_UTILISATEUR, $this->id);\n\n\t\t\t\tMagasinsFavorisPeer::addSelectColumns($criteria);\n\t\t\t\tif (!isset($this->lastMagasinsFavorisCriteria) || !$this->lastMagasinsFavorisCriteria->equals($criteria)) {\n\t\t\t\t\t$this->collMagasinsFavoriss = MagasinsFavorisPeer::doSelect($criteria, $con);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$this->lastMagasinsFavorisCriteria = $criteria;\n\t\treturn $this->collMagasinsFavoriss;\n\t}", "public function getUsers($criteria = null, PropelPDO $con = null)\n\t{\n\t\tif ($criteria === null) {\n\t\t\t$criteria = new Criteria(EmployeePeer::DATABASE_NAME);\n\t\t}\n\t\telseif ($criteria instanceof Criteria)\n\t\t{\n\t\t\t$criteria = clone $criteria;\n\t\t}\n\n\t\tif ($this->collUsers === null) {\n\t\t\tif ($this->isNew()) {\n\t\t\t $this->collUsers = array();\n\t\t\t} else {\n\n\t\t\t\t$criteria->add(UserPeer::EMPLOYEE_ID, $this->id);\n\n\t\t\t\tUserPeer::addSelectColumns($criteria);\n\t\t\t\t$this->collUsers = UserPeer::doSelect($criteria, $con);\n\t\t\t}\n\t\t} else {\n\t\t\t// criteria has no effect for a new object\n\t\t\tif (!$this->isNew()) {\n\t\t\t\t// the following code is to determine if a new query is\n\t\t\t\t// called for. If the criteria is the same as the last\n\t\t\t\t// one, just return the collection.\n\n\n\t\t\t\t$criteria->add(UserPeer::EMPLOYEE_ID, $this->id);\n\n\t\t\t\tUserPeer::addSelectColumns($criteria);\n\t\t\t\tif (!isset($this->lastUserCriteria) || !$this->lastUserCriteria->equals($criteria)) {\n\t\t\t\t\t$this->collUsers = UserPeer::doSelect($criteria, $con);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$this->lastUserCriteria = $criteria;\n\t\treturn $this->collUsers;\n\t}", "public function getTokenUsuarios($criteria = null, PropelPDO $con = null)\n {\n $partial = $this->collTokenUsuariosPartial && !$this->isNew();\n if (null === $this->collTokenUsuarios || null !== $criteria || $partial) {\n if ($this->isNew() && null === $this->collTokenUsuarios) {\n // return empty collection\n $this->initTokenUsuarios();\n } else {\n $collTokenUsuarios = TokenUsuarioQuery::create(null, $criteria)\n ->filterByUsuario($this)\n ->find($con);\n if (null !== $criteria) {\n if (false !== $this->collTokenUsuariosPartial && count($collTokenUsuarios)) {\n $this->initTokenUsuarios(false);\n\n foreach($collTokenUsuarios as $obj) {\n if (false == $this->collTokenUsuarios->contains($obj)) {\n $this->collTokenUsuarios->append($obj);\n }\n }\n\n $this->collTokenUsuariosPartial = true;\n }\n\n return $collTokenUsuarios;\n }\n\n if($partial && $this->collTokenUsuarios) {\n foreach($this->collTokenUsuarios as $obj) {\n if($obj->isNew()) {\n $collTokenUsuarios[] = $obj;\n }\n }\n }\n\n $this->collTokenUsuarios = $collTokenUsuarios;\n $this->collTokenUsuariosPartial = false;\n }\n }\n\n return $this->collTokenUsuarios;\n }", "public function getUsuarioAmigosRelatedByIdusuario(Criteria $criteria = null, ConnectionInterface $con = null)\n {\n $partial = $this->collUsuarioAmigosRelatedByIdusuarioPartial && !$this->isNew();\n if (null === $this->collUsuarioAmigosRelatedByIdusuario || null !== $criteria || $partial) {\n if ($this->isNew() && null === $this->collUsuarioAmigosRelatedByIdusuario) {\n // return empty collection\n $this->initUsuarioAmigosRelatedByIdusuario();\n } else {\n $collUsuarioAmigosRelatedByIdusuario = ChildUsuarioAmigoQuery::create(null, $criteria)\n ->filterByUsuarioRelatedByIdusuario($this)\n ->find($con);\n\n if (null !== $criteria) {\n if (false !== $this->collUsuarioAmigosRelatedByIdusuarioPartial && count($collUsuarioAmigosRelatedByIdusuario)) {\n $this->initUsuarioAmigosRelatedByIdusuario(false);\n\n foreach ($collUsuarioAmigosRelatedByIdusuario as $obj) {\n if (false == $this->collUsuarioAmigosRelatedByIdusuario->contains($obj)) {\n $this->collUsuarioAmigosRelatedByIdusuario->append($obj);\n }\n }\n\n $this->collUsuarioAmigosRelatedByIdusuarioPartial = true;\n }\n\n return $collUsuarioAmigosRelatedByIdusuario;\n }\n\n if ($partial && $this->collUsuarioAmigosRelatedByIdusuario) {\n foreach ($this->collUsuarioAmigosRelatedByIdusuario as $obj) {\n if ($obj->isNew()) {\n $collUsuarioAmigosRelatedByIdusuario[] = $obj;\n }\n }\n }\n\n $this->collUsuarioAmigosRelatedByIdusuario = $collUsuarioAmigosRelatedByIdusuario;\n $this->collUsuarioAmigosRelatedByIdusuarioPartial = false;\n }\n }\n\n return $this->collUsuarioAmigosRelatedByIdusuario;\n }", "public function getUsers(Criteria $criteria = null, ConnectionInterface $con = null)\n {\n $partial = $this->collUsersPartial && !$this->isNew();\n if (null === $this->collUsers || null !== $criteria || $partial) {\n if ($this->isNew() && null === $this->collUsers) {\n // return empty collection\n $this->initUsers();\n } else {\n $collUsers = ChildUserQuery::create(null, $criteria)\n ->filterByImage($this)\n ->find($con);\n\n if (null !== $criteria) {\n if (false !== $this->collUsersPartial && count($collUsers)) {\n $this->initUsers(false);\n\n foreach ($collUsers as $obj) {\n if (false == $this->collUsers->contains($obj)) {\n $this->collUsers->append($obj);\n }\n }\n\n $this->collUsersPartial = true;\n }\n\n return $collUsers;\n }\n\n if ($partial && $this->collUsers) {\n foreach ($this->collUsers as $obj) {\n if ($obj->isNew()) {\n $collUsers[] = $obj;\n }\n }\n }\n\n $this->collUsers = $collUsers;\n $this->collUsersPartial = false;\n }\n }\n\n return $this->collUsers;\n }", "public function getFriendss($criteria = null, PropelPDO $con = null)\n\t{\n\t\tif ($criteria === null) {\n\t\t\t$criteria = new Criteria(UsersPeer::DATABASE_NAME);\n\t\t}\n\t\telseif ($criteria instanceof Criteria)\n\t\t{\n\t\t\t$criteria = clone $criteria;\n\t\t}\n\n\t\tif ($this->collFriendss === null) {\n\t\t\tif ($this->isNew()) {\n\t\t\t $this->collFriendss = array();\n\t\t\t} else {\n\n\t\t\t\t$criteria->add(FriendsPeer::USE_ID2, $this->use_id2);\n\n\t\t\t\tFriendsPeer::addSelectColumns($criteria);\n\t\t\t\t$this->collFriendss = FriendsPeer::doSelect($criteria, $con);\n\t\t\t}\n\t\t} else {\n\t\t\t// criteria has no effect for a new object\n\t\t\tif (!$this->isNew()) {\n\t\t\t\t// the following code is to determine if a new query is\n\t\t\t\t// called for. If the criteria is the same as the last\n\t\t\t\t// one, just return the collection.\n\n\n\t\t\t\t$criteria->add(FriendsPeer::USE_ID2, $this->use_id2);\n\n\t\t\t\tFriendsPeer::addSelectColumns($criteria);\n\t\t\t\tif (!isset($this->lastFriendsCriteria) || !$this->lastFriendsCriteria->equals($criteria)) {\n\t\t\t\t\t$this->collFriendss = FriendsPeer::doSelect($criteria, $con);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$this->lastFriendsCriteria = $criteria;\n\t\treturn $this->collFriendss;\n\t}", "public function getUserDemoss(Criteria $criteria = null, ConnectionInterface $con = null)\n {\n $partial = $this->collUserDemossPartial && !$this->isNew();\n if (null === $this->collUserDemoss || null !== $criteria || $partial) {\n if ($this->isNew() && null === $this->collUserDemoss) {\n // return empty collection\n $this->initUserDemoss();\n } else {\n $collUserDemoss = ChildUserDemosQuery::create(null, $criteria)\n ->filterByUser($this)\n ->find($con);\n\n if (null !== $criteria) {\n if (false !== $this->collUserDemossPartial && count($collUserDemoss)) {\n $this->initUserDemoss(false);\n\n foreach ($collUserDemoss as $obj) {\n if (false == $this->collUserDemoss->contains($obj)) {\n $this->collUserDemoss->append($obj);\n }\n }\n\n $this->collUserDemossPartial = true;\n }\n\n return $collUserDemoss;\n }\n\n if ($partial && $this->collUserDemoss) {\n foreach ($this->collUserDemoss as $obj) {\n if ($obj->isNew()) {\n $collUserDemoss[] = $obj;\n }\n }\n }\n\n $this->collUserDemoss = $collUserDemoss;\n $this->collUserDemossPartial = false;\n }\n }\n\n return $this->collUserDemoss;\n }", "public function getAccounts($criteria = null, PropelPDO $con = null)\n\t{\n\t\tif ($criteria === null) {\n\t\t\t$criteria = new Criteria(sfGuardUserPeer::DATABASE_NAME);\n\t\t}\n\t\telseif ($criteria instanceof Criteria)\n\t\t{\n\t\t\t$criteria = clone $criteria;\n\t\t}\n\n\t\tif ($this->collAccounts === null) {\n\t\t\tif ($this->isNew()) {\n\t\t\t $this->collAccounts = array();\n\t\t\t} else {\n\n\t\t\t\t$criteria->add(AccountPeer::USER_ID, $this->id);\n\n\t\t\t\tAccountPeer::addSelectColumns($criteria);\n\t\t\t\t$this->collAccounts = AccountPeer::doSelect($criteria, $con);\n\t\t\t}\n\t\t} else {\n\t\t\t// criteria has no effect for a new object\n\t\t\tif (!$this->isNew()) {\n\t\t\t\t// the following code is to determine if a new query is\n\t\t\t\t// called for. If the criteria is the same as the last\n\t\t\t\t// one, just return the collection.\n\n\n\t\t\t\t$criteria->add(AccountPeer::USER_ID, $this->id);\n\n\t\t\t\tAccountPeer::addSelectColumns($criteria);\n\t\t\t\tif (!isset($this->lastAccountCriteria) || !$this->lastAccountCriteria->equals($criteria)) {\n\t\t\t\t\t$this->collAccounts = AccountPeer::doSelect($criteria, $con);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$this->lastAccountCriteria = $criteria;\n\t\treturn $this->collAccounts;\n\t}", "public function getUsuariosRelatedByIdusuario(Criteria $criteria = null, ConnectionInterface $con = null)\n {\n $partial = $this->collUsuariosRelatedByIdusuarioPartial && !$this->isNew();\n if (null === $this->collUsuariosRelatedByIdusuario || null !== $criteria || $partial) {\n if ($this->isNew()) {\n // return empty collection\n if (null === $this->collUsuariosRelatedByIdusuario) {\n $this->initUsuariosRelatedByIdusuario();\n }\n } else {\n\n $query = ChildUsuarioQuery::create(null, $criteria)\n ->filterByUsuarioRelatedByIdamigo($this);\n $collUsuariosRelatedByIdusuario = $query->find($con);\n if (null !== $criteria) {\n return $collUsuariosRelatedByIdusuario;\n }\n\n if ($partial && $this->collUsuariosRelatedByIdusuario) {\n //make sure that already added objects gets added to the list of the database.\n foreach ($this->collUsuariosRelatedByIdusuario as $obj) {\n if (!$collUsuariosRelatedByIdusuario->contains($obj)) {\n $collUsuariosRelatedByIdusuario[] = $obj;\n }\n }\n }\n\n $this->collUsuariosRelatedByIdusuario = $collUsuariosRelatedByIdusuario;\n $this->collUsuariosRelatedByIdusuarioPartial = false;\n }\n }\n\n return $this->collUsuariosRelatedByIdusuario;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ Generate a color chain to print to the console Parameters string $color : forecolor string $background : background color boolean $bold : true to bold the message Return string
public function colorize($color, $background='', $style='0;') { // Format $color = $color?'3'.$color:'37m'; $background = $background ? "\033[4".$background : $background; // Generate formatting return "$background\033[$style$color"; }
[ "public static function sayColor() {\n $args = func_get_args();\n while (count($args)) {\n $color = null;\n $str = array_shift($args);\n if (is_integer($str)) {\n $color = $str;\n if (self::$use_color) {\n print \"\\033[0;${color}m\";\n }\n $str = array_shift($args);\n }\n\n print $str;\n\n if (self::$use_color && !is_null($color)) {\n print \"\\033[0m\";\n }\n }\n }", "function colorize($text, $color, $bold = FALSE)\n{\n\t// Standard CLI colors\n\t$colors = array_flip(array(30 => 'gray', 'red', 'green', 'yellow', 'blue', 'purple', 'cyan', 'white', 'black'));\n\n\t// Escape string with color information\n\treturn\"\\033[\" . ($bold ? '1' : '0') . ';' . $colors[$color] . \"m$text\\033[0m\";\n}", "public function cecho ($text, $forecolor = 'default', $bright = false,\n $backcolor = 'default', $reset = true\n ) {\n $this->debug('cecho('.$message.', '.$forecolor.', '\n .(($bright) ? 'true' : 'false').', '.$backcolor.', '\n .(($reset) ? 'true' : 'false').') called', 1);\n\n // define the default value\n $default = \"\\033[0m\";\n\n // define the color codes\n $colorCodes = array(\n 'black' => 0,\n 'red' => 1,\n 'green' => 2,\n 'yellow' => 3,\n 'blue' => 4,\n 'magenta' => 5,\n 'cyan' => 6,\n 'white' => 7,\n );\n\n\n // if the default foreground and background are used, just display the text\n if ($forecolor == 'default' && $backcolor == 'default') {\n $this->debug('foreground and background colors are default', 2);\n echo $default;\n if ($message <> '') {\n $this->debug('outputting the message', 2);\n echo $message;\n }\n\n } else {\n /* DETERMINE THE COLOR CODES */\n\n // default codes (white on black)\n $foreCode = 37;\n $backCode = 40;\n\n // look up the provided colors to get the codes\n $forecolor = strtolower($forecolor);\n $backcolor = strtolower($backcolor);\n if (isset($forecolor) && array_key_exists($forecolor, $colorCodes)) {\n $foreCode = 30 + ((int) $colorCodes[$forecolor]);\n $this->debug('setting the foreground code to: '.$foreCode, 2);\n }\n if (isset($backcolor) && array_key_exists($backcolor, $colorCodes)) {\n $backCode = 40 + ((int) $colorCodes[$backcolor]);\n $this->debug('setting the background code to: '.$backCode, 2);\n }\n\n\n /* OUTPUT THE COLORED MESSAGE */\n // the color code\n $this->debug('building the escape sequence', 2);\n $escapeSeq = \"\\033[\";\n $escapeSeq .= (($bright) ? '1' : '0');\n $escapeSeq .= (($foreCode <> '') ? ';'.$foreCode : '');\n $escapeSeq .= (($backCode <> '') ? ';'.$backCode : '');\n $escapeSeq .= 'm';\n echo $escapeSeq;\n\n // the message\n $msgLength = strlen($message);\n if ($msgLength > 0\n && strrpos($message, \"\\n\") == $msgLength - 1\n && $backCode <> ''\n && $reset\n ) {\n $this->debug('the message ended with a carriage return and '\n .'the background color is not the default', 2);\n if ($msgLength >= 2) {\n $this->debug('outputting the message, resetting the color, '\n .'then outputing the carriage return', 2);\n echo substr($message, 0, $msgLength - 2);\n echo $default;\n echo \"\\n\";\n }\n } else {\n $this->debug('the message has no carriage return or the '\n .'background color is the default', 2);\n if ($message <> '') {\n $this->debug('outputting the message', 2);\n echo $message;\n }\n\n // reset the colors\n if ($reset) {\n $this->debug('resetting the colors to the default', 2);\n echo $default;\n }\n }\n }\n\n $this->debug('cecho() ended', 1);\n }", "public static function bg_color($color, $string)\n {\n if (!isset(self::$background[$color]))\n {\n throw new Exception('Background color is not defined');\n }\n \n return \"\\033[\" . self::$background[$color] . 'm' . $string . \"\\033[0m\";\n }", "function PCOCLI_ColorTextoConsola($Foreground=\"\",$Background=\"\")\n\t{\n\t\t//Si no se define color usa el estandar de la consola o define predeterminados\n\t\tif ($Foreground==\"\" && $Background==\"\")\n\t\t\t$ColorFinal=\"\\033[0m\";\n\t\telse\n\t\t\t{\n\t\t\t\tif ($Foreground==\"black\") $Foreground=\"30\";\n\t\t\t\tif ($Foreground==\"red\") $Foreground=\"31\";\n\t\t\t\tif ($Foreground==\"green\") $Foreground=\"32\";\n\t\t\t\tif ($Foreground==\"yellow\") $Foreground=\"33\";\n\t\t\t\tif ($Foreground==\"blue\") $Foreground=\"34\";\n\t\t\t\tif ($Foreground==\"magenta\") $Foreground=\"35\";\n\t\t\t\tif ($Foreground==\"cyan\") $Foreground=\"36\";\n\t\t\t\tif ($Foreground==\"white\") $Foreground=\"37\";\n\n\t\t\t\tif ($Background==\"black\") $Background=\";40\";\n\t\t\t\tif ($Background==\"red\") $Background=\";41\";\n\t\t\t\tif ($Background==\"green\") $Background=\";42\";\n\t\t\t\tif ($Background==\"yellow\") $Background=\";43\";\n\t\t\t\tif ($Background==\"blue\") $Background=\";44\";\n\t\t\t\tif ($Background==\"magenta\") $Background=\";45\";\n\t\t\t\tif ($Background==\"cyan\") $Background=\";46\";\n\t\t\t\tif ($Background==\"white\") $Background=\";47\";\n\t\t\t\t$ColorFinal=\"\\033[{$Foreground}{$Background}m\";\n\t\t\t}\n\t\techo \"$ColorFinal\";\n\t}", "function pintaln($str, $color = 'blanco')\n{\n $c = array('verde' => \"\\033[32m\",\n 'verdeclaro' => \"\\033[1;32m\",\n 'rojo' => \"\\033[31m\",\n 'azul' => \"\\033[34m\",\n 'cyan' => \"\\033[36m\",\n 'amarillo' => \"\\033[0;33m\",\n 'gris' => \"\\033[1;30m\",\n 'blanco' => \"\\033[0;37m\",\n 'fin' => \"\\033[0;37m\" );\n // echo \"\\033[35mAviso:\\033[37m \";\n // echo \"\\033[133mDebug:\\033[37m \";\n if (!array_key_exists($color,$c)){\n $color='rojo';\n }\n echo $c[$color] . $str . $c['fin'] . \"\\n\";\n}", "function colorize($str, $color) {\n return \"\\e[1;34m\" . $str . \"\\033[0m\";\n}", "function script_print($message, $color_code) {\n global $args;\n if ($args['color']) {\n echo \"\\033[\" . $color_code . \"m\" . $message . \"\\033[0m\";\n }\n else {\n echo $message;\n }\n}", "function buildColor(int $colorCode): string\n{\n return sprintf(\"\\033[%sm\", $colorCode);\n}", "function color($text, $color) {\n return chr(27).$color.$text.chr(27).COLOR_NORMAL;\n}", "public function testPrintWithColor()\n {\n $this->object->setFormat($this->testLongFormat)->setColor(true);\n $this->object->debug('DEBUG', true);\n $this->object->warn('WARN', true);\n $this->object->error('ERROR', true);\n $this->object->crit('CRIT', true);\n $this->object->info('INFO', true);\n\n $this->assertEquals(\n \"\\033[34mstring(5) \\\"DEBUG\\\"\\n\\033[0m\\n\\033[0mINFO\\033[0m\\n\",\n $GLOBALS['stdout']\n );\n $this->assertEquals(\n \"\\033[33mWARN\\033[0m\\n\\033[31mERROR\\033[0m\\n\\033[31mCRIT\\033[0m\\n\",\n $GLOBALS['stderr']\n );\n }", "public static function colorPrint($color, $text) {\n print $color . $text . self::WHITE . \"\\n\";\n }", "function colorize($text, $status) {\n\t$out = \"\";\n\tswitch($status) {\n\t\tcase \"SUCCESS\":\n\t\t\t$out = \"[42m\"; //Green background\n\t\t\tbreak;\n\t\tcase \"FAILURE\":\n\t\t\t$out = \"[41m\"; //Red background\n\t\t\tbreak;\n\t\tcase \"WARNING\":\n\t\t\t$out = \"[43m\"; //Yellow background\n\t\t\tbreak;\n\t\tcase \"NOTE\":\n\t\t\t$out = \"[44m\"; //Blue background\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tthrow new Exception(\"Invalid status: \" . $status);\n\t}\n\treturn chr(27) . \"$out\" . \"$text\" . chr(27) . \"[0m\";\n}", "function customize_print1() \n { \n echo \"<p style=color:\".$this->font_color.\";>\".$this->string_value.\"</p>\"; \n }", "function cc_print_backgroundcolor_list($text_color){\n\n\t $color_list =array(\n\t \"#FF0000\" => \"Red\",\n\t \"#CC033C\" => \"Crimson\",\n\t \"#FF6F00\" => \"Orange\",\n\t \"#F9F99F\" => \"Golden\",\n\t \"#FFFCCC\" => \"Almond\",\n\t \"#F6F6CC\" => \"Beige\",\n\t \"#209020\" => \"Green\",\n\t \"#209020\" => \"Green\",\n\t \"#c3e44f\" => \"Light Green\",\n\t \"#963939\" => \"Brown\",\n\t \"#00FF00\" => \"Lime\",\n \t \"#99CCFF\" => \"Light Blue\",\n\t \"#000090\" => \"Navy\",\n\t \"#FE00FF\" => \"Indigo\",\n\t \"#F99CF9\" => \"Pink\",\n\t \"#993CF3\" => \"Violet\",\n\t \"#000000\" => \"Black\",\n\t \"#FFFFFF\" => \"White\",\n\t \"#DDDDDD\" => \"Grey\",\n\t \"#666666\" => \"Gray\",\n\t \"#F6F9F9;\" => \"Silver\");\n\n\n\t echo \"\\n\";\n\tforeach($color_list as $key=>$tcolor)\n\t{\n\t\t$check_value = \"\";\n\t\tif ($text_color == $key)\n\t \t\t$check_value = ' SELECTED ';\n\n\t\t$white_text = \"\";\n\t\tif ($key == \"#000000\" OR $key == \"#000090\" OR $key == \"#666666\" OR $key == \"#0000FF\" )\n\t \t\t$white_text = ';color:#FFFFFF ';\n\t\techo '<option value=\"'.$key.'\" style=\"background-color:'.$key. $white_text .'\" '.$check_value .'>'.$tcolor.'</option>';\n\t\techo \"\\n\";\n\t}\n\n}", "function get_bgcolor ($state)\n{\n return ' BGCOLOR=\"'.get_bgcolor_hex($state).'\"';\n}", "function colorToStr(string $color, string $str): string\n{\n return \"<$color>$str</$color>\";\n}", "public function toString($color = null)\n {\n // check for color exists or not\n // If the color exists then start color code\n if (!is_null($color)) {\n echo \"\\033[{$color}m\";\n }\n // Walk over grid and print object type\n for ($i = 0; $i < $this->row; $i += 1) {\n for ($j = 0; $j < $this->column; $j += 1) {\n $object = $this->grid[$i][$j];\n $object = !is_null($object) ? $object : '';\n echo \"{$object} \";\n }\n echo PHP_EOL;\n }\n // check for color exists or not\n // If the color exists then end color code for this print-out\n if (!is_null($color)) {\n echo \"\\033[0m\";\n }\n }", "public function colorize(string $text = '', ?string $color = null, ?string $background = null): string\n {\n if (!$this->colorsSupported || (!$color && !$background)) {\n return $text;\n }\n\n $color = $color ? $this->getColorCode($color) : '';\n $background = $background ? $this->getColorCode($background, $this->backgrounds) : '';\n\n return $color.$background.$text.$this->escapeCharacter.'[0m';\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
agrega un nuevo municipio
public function add(municipioRequest $request){ $municipio=Municipio::create($request->all()); return $municipio; }
[ "private function nuevo_idioma(){\n\n\t\t$cols = array('id','fecha_pedido');\n\t\t$this->where('num_pedido',$this->pedido);\n\t\t$this->where('anuncio',$this->anuncio);\n\t\t$this->where('idioma',$this->idioma);\n\n\t\tif($salida = $this->getOne('traducciones_pedidos')){\n\t\t\t$this->id = $salida['id'];\n\t\t\t$this->buyer = $salida['user'];\n\t\t\t$this->fecha_pedido = $salida['fecha_pedido'];\n\n\t\t\t$cols = array('anuncio' \t=> $this->anuncio,\t\n\t\t\t\t\t\t 'num_pedido' \t=> $this->pedido,\n\t\t\t\t\t\t 'idioma' \t\t=> $this->idioma,\t\n\t\t\t\t\t\t 'titulo' \t \t=> $_POST['titulo'],\n\t\t\t\t\t\t 'descripcion' => $_POST['descripcion'],\n\t\t\t\t\t\t 'fecha_realizacion' => $this->now);\n\t\t\tif($this->Builder->insert('anuncios_idiomas',$cols)){\n\t\t\t\t$this->success = true;\n\t\t\t}\n\t\t}\n\t}", "public function actionCreate()\n {\n $model = new Colonia();\n $data = Municipio::find()->all();\n $municipios = (count($data)==0)? [''=>'']: \\yii\\helpers\\ArrayHelper::map($data, 'municipio_id','municipio_nombre'); \n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->colonia_id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n 'municipios' => $municipios,\n ]);\n }\n }", "function alta_unidad_m(){\n\t\t$u= new Unidad_medida();\n\t\t$u->fecha_alta=date(\"Y-m-d\");\n\t\t$u->estatus_general_id=1;\n\t\t$u->usuario_id=$GLOBALS['usuarioid'];\n\t\t$related = $u->from_array($_POST);\n\n\t\t// save with the related objects\n\t\tif($u->save($related))\n\t\t{\n\t\t\techo \"<html> <script>alert(\\\"Se han registrado los datos de la Unidad de Medida.\\\"); window.location='\".base_url().\"index.php/inicio/acceso/\".$GLOBALS['ruta'].\"/menu';</script></html>\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\tshow_error(\"\".$u->error->string);\n\t\t}\n\t}", "public function actualizarMunicipios() {\n $this->load->model(\"divipola\");\n $iddepto = $this->input->post(\"id\");\n $municipios = $this->divipola->obtenerMunicipios($iddepto);\n echo '<option value=\"-\" selected=\"selected\">Seleccione</option>';\n for ($i = 0; $i < count($municipios); $i++) {\n echo '<option value=\"' . $municipios[$i][\"codigo\"] . '\">' . $municipios[$i][\"nombre\"] . '</option>';\n }\n }", "public function localizarPersona() {\n \n }", "function add_municipio($params)\n {\n\t\t$params['id'] = $this->get_idConsecutivo();\n $this->db->insert('municipio',$params);\n return $this->db->insert_id();\n }", "function evt__agregar()\n\t{\n if($this->s__pantalla=='pant_seleccion'){\n $this->set_pantalla('pant_edicion');\n }\n //si estoy en la pantalla cargo_seleccion y presiono agregar entonces\n if($this->s__pantalla=='pant_cargo_seleccion'){\n $this->dep('datos')->tabla('designacion')->resetear();\n $this->set_pantalla('pant_cargo');\n } \n\t}", "function insertMunicipality() {\n\t\t$result = $this->conn->insertMunicipality ();\n\t\tdie ( \"{success : $result}\" );\n\t}", "public function registrar_vehiculo()\n\t{\n\t\t$marca= $this->input->post('marca');\n\t\t$transmision= $this->input->post('transmision');\n\t\t$modelo= $this->input->post('modelo');\n\t\t$precio= $this->input->post('precio');\n\t\t$descripcion= $this->input->post('descripcion');\n\t\t$vehiculo = array('marca' => $marca, 'transmision' => $transmision,'modelo' => $modelo, 'precio' => $precio, 'descripcion' => $descripcion);\n\t\t \t\n\t\t \t$r=$this->User_model->save_auto($vehiculo);\n\t\t \tif(sizeof($r)>0){\n\t\t \t\t//Ejemplo de como se debe llamar una funcion.\n\t\t \t\t$this->cargarAutosEnVenta();\n\t\t \t}\n\t\t\n\t}", "public function crear(){\n\t\t\t\t\t\t\t\t$caracteristicas_memoria = new caracteristicas_memoria($_POST['data']);\n\t\t\t\t\t\t $caracteristicas_memoriaMapper = new caracteristicas_memoriaMapper();\n\t\t\t\t\t\t var_dump($caracteristicas_memoriaMapper->crearcaracteristicas_memoria($caracteristicas_memoria));\n\t\t\t\t\t\t\t}", "public function newAction()\n {\n $entity = new Incapacidad();\n \n $em = $this->getDoctrine()->getManager();\n $request = $this->getRequest();\n $cadena= $request->get('id');\n $idEntidad = substr($cadena, 1);\n\n if($idEntidad!=0){\n $paciente = $em->getRepository('DGPlusbelleBundle:Paciente')->find($idEntidad);\n $entity->setPaciente($paciente);\n }\n else{\n $paciente = $em->getRepository('DGPlusbelleBundle:Paciente')->findAll();\n }\n \n \n \n $form = $this->createCreateForm($entity);\n return array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n );\n }", "public function municipio()\n {\n return $this->belongsTo('OcorrenciaOnline\\Municipio', 'MUNICIPIO_COD');\n }", "public function agregar () {\n\t\t\tif ($_POST) {\n\t\t\t\t$type = $_POST['tipo'];\n\t\t\t\t$data = [\n\t\t\t\t\t\"name\" => $_POST['nombre'],\n\t\t\t\t\t\"lastName\" => $_POST['apellido'],\n\t\t\t\t\t\"job\" => $_POST['oficio'],\n\t\t\t\t\t\"status\" => 1\n\t\t\t\t];\n\t\t\t\t\n\t\t\t\tif ($type == \"personal\") {\n\t\t\t\t\t$insert = $this->personalModel->save($data);\n\t\t\t\t}else{\n\t\t\t\t\t$insert = $this->medicoModel->save($data);\n\t\t\t\t}\n\n\t\t\t\tif ($insert) {\n\t\t\t\t\t@session_start();\n\n\t\t\t\t\t$description = \"Registro un personal nuevo\";\n\t\t\t\t\t$user = $_SESSION[\"user_id\"];\n\n\t\t\t\t\t$bitacora = [\n\t\t\t\t\t\"description\" => $description,\n\t\t\t\t\t\"user_id\" => $user,\n\t\t\t\t\t];\n\n\n\t\t\t\t\t$save = $this->bitacoraModel->save($bitacora);\n\n\t\t\t\t\tif ($save) {\n\t\t\t\t\t\techo 1;\n\t\t\t\t\t}else\n\t\t\t\t\t\techo 0;\n\n\t\t\t\t}else{\n\t\t\t\t\techo 0;\n\t\t\t\t}\n\n\t\t\t}\n\t\t}", "public function crearSolicitudContrato(Request $request){\n \n $this->validate($request, [\n\t\t\t'latitud_empleador' => 'required',\n 'longitud_empleador' => 'required',\n 'id_usuario_movil' => 'required'\n ]);\n\n \n $id_empleador= Empleador::where('id_usuario_movil',$request->id_usuario_movil)->value('id');\n //dd($id_empleador);\n $solicitud_contrato = new SolicitudContrato;\n $solicitud_contrato->latitud_empleador = $request->latitud_empleador;\n $solicitud_contrato->longitud_empleador = $request->longitud_empleador;\n $solicitud_contrato->fecha=date(\"Y-m-d\");\n $solicitud_contrato->estado_solicitud = \"enespera\";\n $solicitud_contrato->estado = \"1\";\n $solicitud_contrato->id_empleador=$id_empleador;\n $solicitud_contrato->id_servicio=$request->id_servicio;\n $solicitud_contrato->save();\n\n return response()->json(['data' => []]);\n }", "public function crear(){\n\t\t\t\t\t\t\t\t$cargo = new cargo($_POST['data']);\n\t\t\t\t\t\t $cargoMapper = new cargoMapper();\n\t\t\t\t\t\t var_dump($cargoMapper->crearcargo($cargo));\n\t\t\t\t\t\t\t}", "public function crear() {\n $tipo_impresion = new tipo_impresion($_POST['data']);\n $tipo_impresionMapper = new tipo_impresionMapper();\n var_dump($tipo_impresionMapper->creartipo_impresion($tipo_impresion));\n }", "public function createAction(Request $request)\n {\n $entity = new Tutorias();\n $form = $this->createCreateForm($entity);\n $form->handleRequest($request);\n\n $tipo=$form->get(\"tipo\")->getData();\n $descripcion=$form->get(\"descripcion\")->getData();\n $grupo=$form->get(\"grupo\")->getData();\n $consulta_principal=$form->get(\"seguimiento\")->getData();\n\n $em = $this->getDoctrine()->getManager();\n if($consulta_principal){\n $consulta = $em->getRepository('IntranetBundle:Seguimiento')->findOneById($consulta_principal->getId());\n }\n\n if ($form->isValid()) {\n if(!$consulta_principal){\n //Se crea el nuevo seguimiento de la asignación de tutoría.\n $seguimiento = new Seguimiento();\n $seguimiento->setProfesor($entity->getProfesor());\n $seguimiento->setAlumno($entity->getAlumno());\n $seguimiento->setResponsable(null);\n $seguimiento->setAsignatura(null);\n $seguimiento->setGrupo($grupo);\n $seguimiento->setTipo(1);\n $seguimiento->setTipoUser(1);\n $seguimiento->setDescripcion($descripcion);\n $seguimiento->setFecha(new \\DateTime(\"now\"));\n $seguimiento->setFechaActualizada(new \\DateTime(\"now\"));\n $seguimiento->setSeguimiento(null);\n $seguimiento->setRespuesta(0);\n $seguimiento->setFechaTerminada(null);\n \n $em->persist($seguimiento);\n $em->flush();\n\n //Se obtiene el seguimiento creado para añadirselo al registro de tutoría.\n $comentario = $em->getRepository('IntranetBundle:Seguimiento')->findUltimoAvisoTutoria($entity->getProfesor()->getId(), $tipo);\n\n //Se asigna los demás valores de tutorias.\n $entity->setActivo(0);\n $entity->setSeguimiento($comentario);\n\n }else{\n //Se crea el nuevo seguimiento de la asignación de tutoría.\n $seguimiento = new Seguimiento();\n $seguimiento->setProfesor($entity->getProfesor());\n $seguimiento->setAlumno($entity->getAlumno());\n $seguimiento->setResponsable(null);\n $seguimiento->setAsignatura(null);\n $seguimiento->setGrupo($grupo);\n $seguimiento->setTipo(0);\n $seguimiento->setTipoUser(1);\n $seguimiento->setDescripcion($descripcion);\n $seguimiento->setFecha(new \\DateTime(\"now\"));\n $seguimiento->setFechaActualizada(new \\DateTime(\"now\"));\n $seguimiento->setSeguimiento($consulta);\n $seguimiento->setRespuesta(0);\n $seguimiento->setFechaTerminada(null);\n\n $em->persist($seguimiento);\n $em->flush();\n\n //Se modifica la consulta principal para que se muestre actualizada.\n $consulta->setRespuesta(1);\n //$consulta->setFechaActualizada(new \\DateTime(\"now\"));\n $em->persist($consulta);\n $em->flush();\n\n //Se asigna los demás valores de tutorias.\n $entity->setActivo(0);\n $entity->setSeguimiento($consulta);\n }\n\n $em->persist($entity);\n $em->flush();\n\n $ms = $this->get('translator')->trans('Se ha asignado una nueva tutoría pendiente de confirmación.');\n $this->get('session')->getFlashBag()->add('notice',$ms);\n\n return $this->redirect($this->generateUrl('intranet_profesor_tutorias'));\n }\n\n return $this->render('IntranetBundle:Profesor:asignarTutorias.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "function inserirMarca(){\n $banco = abrirBancoMarca();\n //declarando as variáveis usadas na inserção dos dados\n $nomeMarca = $_POST[\"nomeMarca\"];\n //a consulta sql\n $sql = \"INSERT INTO Marcas(nomeMarca) VALUES ('$nomeMarca')\";\n \n //executando a inclusão\n $banco->query($sql);\n //fechando a conexao com o banco\n $banco->close();\n goToConsultaMarca();\n }", "public function admin_nuevo() {\n $this->loadModel('Escuela');\n if ($this->request->is('post')) {\n $this->Departamento->create();\n if ($this->Departamento->save($this->request->data)) {\n $this->success('Se ha agregado la Departamento satifactoriamente.');\n $this->redirect(array('admin' => 1, 'controller' => 'Departamentos', 'action' => 'index'));\n } else {\n $this->warning('Ha ocurrido un problema. Verifica los datos.');\n }\n }\n $this->set('escuelas', $this->Escuela->listEscuelas());\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ Register the 'primary' sidebar.
function my_register_sidebars() { register_sidebar( array( 'id' => 'primary', 'name' => __( 'Primary Sidebar' ), 'description' => __( 'A short description of the sidebar.' ), 'before_widget' => '<div id="%1$s" class="widget %2$s">', 'after_widget' => '</div>', 'before_title' => '<h3 class="widget-title">', 'after_title' => '</h3>', ) ); /* Repeat register_sidebar() code for additional sidebars. */ }
[ "function my_sidebar(){\n register_sidebar(\n array(\n 'id' => 'primary',\n 'names' => ('Primary'),\n 'description' => ('This is the primary sidebar'),\n 'before-widget' => '<div id=\"%1$s\" class=\"widget%2$s\">',\n 'after-widget' => '</div>',\n 'before_title' => '<h3 class=\"widget-title\">',\n 'after_title'=> '</h3>'\n )\n );\n }", "function bbwp_register_sidebars() {\r\n\t\tregister_sidebar(\r\n\t\t\tarray(\r\n\t\t\t\t'id' => 'primary',\r\n\t\t\t\t'name' => __( 'Primary Sidebar' ),\r\n\t\t\t\t'description' => __( 'A short description of the sidebar.' ),\r\n\t\t\t\t'before_widget' => '<div id=\"%1$s\" class=\"widget %2$s\">',\r\n\t\t\t\t'after_widget' => '</div>',\r\n\t\t\t\t'before_title' => '<h3 class=\"widget-title\">',\r\n\t\t\t\t'after_title' => '</h3>',\r\n\t\t\t)\r\n\t\t);\r\n\t\t/* Repeat register_sidebar() code for additional sidebars. */\r\n\t}", "function my_sidebar(){\n register_sidebar(\n array(\n \"name\" => \"Page Side Bar\",\n \"id\" => \"page-sidebar\",\n \"before_title\" => \"<h5 class='widget-title'>\",\n \"after_title\" => \"</h5>\"\n )\n );\n register_sidebar(\n array(\n \"name\" => \"Blog Side Bar\",\n \"id\" => \"blog-sidebar\",\n \"before_title\" => \"<h5 class='widget-title'>\",\n \"after_title\" => \"</h5>\"\n )\n );\n}", "function register_my_sidebar(){\n \n register_sidebar( array(\n\t\t\"name\" => \"Sidebar widget\",\n \"id\" => \"sidebar1\", \n ));\n\n}", "function cpchild_sidebar_init() {\n // Optionally register new sidebars\n // register_sidebar( array(\n // 'name' => 'Footer Top Right',\n // 'description' => 'Footer top right widgets go here',\n // 'id' => 'footer-top-right',\n // 'before_widget' => '',\n // 'after_widget' => '',\n // 'before_title' => '',\n // 'after_title' => '',\n // ) );\n\n // Optionally remove unused positions\n // unregister_sidebar( 'header-top-right' );\n}", "public function register_sidebars () {\n\t\tregister_sidebar ( array(\n\t\t\t'id' => 'op_tool_sidebar',\n\t\t\t'name' => __( 'OP Tool Sidebar', 'bonestheme' ),\n\t\t\t'description' => __( 'The first (primary) sidebar.', 'bonestheme' ),\n\t\t\t'before_widget' => '<div id=\"%1$s\" class=\"widget %2$s\">',\n\t\t\t'after_widget' => '</div>',\n\t\t\t'before_title' => '<h4 class=\"widgettitle\">',\n\t\t\t'after_title' => '</h4>',\n\t\t));\n\t}", "function control_primary_sidebar_display() {\n\t\t\tglobal $ss_settings;\n\n\t\t\t$layout_sidebar_on_front = $ss_settings['layout_sidebar_on_front'];\n\n\t\t\tif ( self::get_layout() == 0 ) {\n\t\t\t\tadd_filter( 'shoestrap_display_primary_sidebar', '__return_false' );\n\t\t\t}\n\n\t\t\tif ( is_front_page() && $layout_sidebar_on_front == 1 && self::get_layout() != 0 ) {\n\t\t\t\tadd_filter( 'shoestrap_display_primary_sidebar', '__return_true' );\n\t\t\t}\n\n\t\t\tif ( ( ! is_front_page() || ( is_front_page() && $layout_sidebar_on_front == 1 ) ) && self::get_layout() != 0 ) {\n\t\t\t\tadd_filter( 'shoestrap_display_primary_sidebar', '__return_true' );\n\t\t\t}\n\t\t}", "function aton_qodef_register_side_area_sidebar() {\n\n\t\tregister_sidebar(array(\n\t\t\t'name' => esc_html__('Side Area', 'aton'),\n\t\t\t'id' => 'sidearea', //TODO Change name of sidebar\n\t\t\t'description' => esc_html__('Side Area', 'aton'),\n\t\t\t'before_widget' => '<div id=\"%1$s\" class=\"widget qodef-sidearea %2$s\">',\n\t\t\t'after_widget' => '</div>',\n\t\t\t'before_title' => '<h4 class=\"qodef-sidearea-widget-title\">',\n\t\t\t'after_title' => '</h4>'\n\t\t));\n\n\t}", "function abo_sidebar(){ \n\n register_sidebar(array(\n \"name\" =>'Main Sidebar',\n \"id\"=> 'main-sidebar',\n \"description\"=> 'This is a sidebar for abo',\n \"class\" => 'main-sidebar',\n \"before_widget\"=>\"<div class='widget-content'>\",\n \"after_widget\"=> \"</div>\",\n \"before_title\"=>\"<h3 class='widget-title'>\",\n \"after_title\"=> \"</h3>\"\n \n ));\n}", "function register_site_sidebar() {\n\tregister_sidebar(array(\n\t\t'name' => 'Sidebar',\n\t\t'before_widget' => '<div class=\"widget\">',\n\t\t'after_widget' => '</div>',\n\t\t'before_title' => '<h3>',\n\t\t'after_title' => '</h3>',\n\t));\n}", "function pexeto_register_sidebar( $sidebar ) {\r\n\t\t$additional_class = isset( $sidebar['class'] )?' '.$sidebar['class']:'';\r\n\r\n\t\t$sidebar_data = array( 'name'=>$sidebar['name'],\r\n\t\t\t'id' => $sidebar['id'],\r\n\t\t\t'before_widget' => '<div class=\"'.$sidebar['location'].'-box %2$s'.$additional_class.'\" id=\"%1$s\">',\r\n\t\t\t'after_widget' => '</div>',\r\n\t\t\t'before_title' => '<h4 class=\"title\">',\r\n\t\t\t'after_title' => '</h4>',\r\n\t\t);\r\n\r\n\t\tregister_sidebar( $sidebar_data );\r\n\t}", "function my_custom_sidebar() {\r\n register_sidebar(\r\n array (\r\n 'name' => __( 'Homeowners Sidebar', 'your-theme-domain' ),\r\n 'id' => 'homeowners-side-bar',\r\n 'description' => __( 'Homeowners Page Sidebar', 'your-theme-domain' ),\r\n 'before_widget' => '<div class=\"widget-content\">',\r\n 'after_widget' => \"</div>\",\r\n 'before_title' => '<h3 class=\"widget-title\">',\r\n 'after_title' => '</h3>',\r\n )\r\n );\r\n\r\n/* Safe Car */\r\n register_sidebar(\r\n array (\r\n 'name' => __( 'Safe Car Sidebar', 'your-theme-domain' ),\r\n 'id' => 'safecar-side-bar',\r\n 'description' => __( 'Safe Car Page Sidebar', 'your-theme-domain' ),\r\n 'before_widget' => '<div class=\"widget-content\">',\r\n 'after_widget' => \"</div>\",\r\n 'before_title' => '<h3 class=\"widget-title\">',\r\n 'after_title' => '</h3>',\r\n )\r\n );\r\n\r\n/* Multi Car */\r\n register_sidebar(\r\n array (\r\n 'name' => __( 'Multi Car Sidebar', 'your-theme-domain' ),\r\n 'id' => 'multicar-side-bar',\r\n 'description' => __( 'Multi Car Page Sidebar', 'your-theme-domain' ),\r\n 'before_widget' => '<div class=\"widget-content\">',\r\n 'after_widget' => \"</div>\",\r\n 'before_title' => '<h3 class=\"widget-title\">',\r\n 'after_title' => '</h3>',\r\n )\r\n );\r\n\r\n/* Legacy */\r\n register_sidebar(\r\n array (\r\n 'name' => __( 'Legacy Sidebar', 'your-theme-domain' ),\r\n 'id' => 'legacy-side-bar',\r\n 'description' => __( 'Legacy Page Sidebar', 'your-theme-domain' ),\r\n 'before_widget' => '<div class=\"widget-content\">',\r\n 'after_widget' => \"</div>\",\r\n 'before_title' => '<h3 class=\"widget-title\">',\r\n 'after_title' => '</h3>',\r\n )\r\n );\r\n\r\n/* Moms */\r\n register_sidebar(\r\n array (\r\n 'name' => __( 'Moms Sidebar', 'your-theme-domain' ),\r\n 'id' => 'moms-side-bar',\r\n 'description' => __( 'Moms Page Sidebar', 'your-theme-domain' ),\r\n 'before_widget' => '<div class=\"widget-content\">',\r\n 'after_widget' => \"</div>\",\r\n 'before_title' => '<h3 class=\"widget-title\">',\r\n 'after_title' => '</h3>',\r\n )\r\n );\r\n}", "function ssBlankThemeRegisterSidebars() {\n //-- left sidebar\n register_sidebar( array(\n 'name' => esc_html__( 'Left Sidebar', $this->ss_bt_text_domain ),\n 'id' => 'ssbt-sidebar-left',\n 'description' => esc_html__( 'Add widgets to the left sidebar.', $this->ss_bt_text_domain ),\n 'before_widget' => '<aside id=\"%1$s\" class=\"widget %2$s\">',\n 'after_widget' => '</aside>',\n 'before_title' => '<h4 class=\"widget-title\">',\n 'after_title' => '</h4>',\n ) );\n\n //-- right sidebar\n register_sidebar( array(\n 'name' => esc_html__( 'Right Sidebar', $this->ss_bt_text_domain ),\n 'id' => 'ssbt-sidebar-right',\n 'description' => esc_html__( 'Add widgets to the right sidebar.', $this->ss_bt_text_domain ),\n 'before_widget' => '<aside id=\"%1$s\" class=\"widget %2$s\">',\n 'after_widget' => '</aside>',\n 'before_title' => '<h4 class=\"widget-title\">',\n 'after_title' => '</h4>',\n ) );\n }", "function chandelier_elated_register_side_area_sidebar() {\r\n\r\n\t\tregister_sidebar(array(\r\n\t\t\t'name' => 'Side Area',\r\n\t\t\t'id' => 'sidearea', //TODO Change name of sidebar\r\n\t\t\t'description' => 'Side Area',\r\n\t\t\t'before_widget' => '<div id=\"%1$s\" class=\"widget eltd-sidearea %2$s\">',\r\n\t\t\t'after_widget' => '</div>',\r\n\t\t\t'before_title' => '<h4 class=\"eltd-sidearea-widget-title\">',\r\n\t\t\t'after_title' => '</h4>'\r\n\t\t));\r\n\r\n\t}", "private function mapSidebars(){\n \n /* register menu package theme*/\n $manager = app()->make(SidebarManager::class);\n $manager->register(CoreSidebar::class);\n View::composer(\n 'theme::layouts.sidebar', CoreSidebarCompose::class\n );\n }", "function fsExtra_widgets_init() {\n\tregister_sidebar( array(\n\t\t'name' => 'Secondary Bar Widget (Upper Left)',\n\t\t'id' => 'secondary_bar_widget',\n\t\t'before_widget' => '<div>',\n\t\t'after_widget' => '</div>',\n\t\t'before_title' => '<h2 class=\"rounded\">',\n\t\t'after_title' => '</h2>',\n\t) );\n}", "private function registerSidebars ()\n {\n require_once THEME_DIR . '/includes/widgets/sidebars.php';\n }", "function pagelines_register_sidebar( $args, $priorty = null ) {\n\n\tregister_sidebar( $args );\n}", "protected function sidebar() {\n\n\t\t\t?>\t\t<div class=\"sidebar\">\n\t\t\t\t\t\t<a href=\"<?php echo $GLOBALS['adminFilePath'] ?>/edit?exhibitions\">exhibitions</a>\n\t\t\t\t\t\t<a href=\"<?php echo $GLOBALS['adminFilePath'] ?>/edit?events\">events</a>\n\t\t\t\t\t\t<a href=\"<?php echo $GLOBALS['adminFilePath'] ?>/edit?static-pages\">static pages</a>\n\t\t\t\t\t</div>\n\t\t\t<?php\n\t\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Operations data preprocessor. Validates and loads operations data.
private function _loadOperationsData(array $operations_data = []) { if ($operations_data) { foreach ($operations_data as $operation_data) { if ($this->_validateOperationData($operation_data)) { $method = $this->_generateOperationMethodName($operation_data['operation_type'], $operation_data['operation_action']); unset($operation_data['operation_type'], $operation_data['operation_action']); $this->addOperation($method, $operation_data); } } } }
[ "protected function loadStoredData() {\n\n $this->ninja_forms_settings = get_option( 'ninja_forms_settings' );\n\n $this->oauth_tokens = get_option( NF_ZohoCRM()->constants->oauth_option_key );\n\n $this->loadCommData();\n\n $this->loadCredentials();\n }", "public function setOperations($ops) {\n if (!is_array($ops)) $ops = explode(',', $ops);\n $this->data['key_ops'] = $ops;\n }", "protected function applyOperations()\n {\n if (!$this->isOperationsApplied) {\n $this->isOperationsApplied = true;\n foreach ($this->getControls() as $control) {\n $this->getDataProvider()->operations()->add($control->getOperation());\n }\n }\n }", "private function determineOperations() {\n\t\t$me = get_class(self::$target);\n\t\t$this->class_name = $me;\n\t\t$ref = new ReflectionClass($me);\n\t\t$this->operations = array();\n\t\tforeach ($ref->getMethods() as $op) {\n\t\t\tif ($op->isPublic() && !$op->isStatic() && !$op->isConstructor() && substr($op->getName(), 0, 1) != '_') {\n\t\t\t\t$this->operations[] = ServiceOperation::create($op->getName(), $this);\n\t\t\t}\n\t\t}\n\t\t$doc = $ref->getDocComment();\n\t\t$doc_bits = explode('*', $doc);\n\t\tforeach ($doc_bits as $bit) {\n\t\t\tif (trim($bit) == '' || trim($bit) == '/') continue;\n\t\t\t$tbit = trim($bit);\n\t\t\tif ($tbit{0} == '@') {\n\t\t\t\tif (($pos = strpos($tbit, ' ')) !== false) {\n\t\t\t\t\t$keyword = substr($tbit, 0, $pos);\n\t\t\t\t\t$value = substr($tbit, $pos+1);\n\t\t\t\t\tif ($keyword == '@author') {\n\t\t\t\t\t\t$this->author = $value;\n\t\t\t\t\t} elseif ($keyword == '@package') {\n\t\t\t\t\t\t$this->package = $value;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif ($this->desc != '') {\n\t\t\t\t\t$this->desc .= \"\\n$tbit\";\n\t\t\t\t} else {\n\t\t\t\t\t$this->desc = $tbit;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function getOperations();", "public function interpret($data){ /* TODO: Build interpret */ }", "public function setDataOperacao($data_operacao) {\n $this->data_operacao = $data_operacao;\n }", "function processData() \n {\n \n // store values in table manager object.\n $moduleID = $this->dataManager->getModuleID();\n $moduleCreator = new ModuleCreator( $moduleID, $this->pathModuleRoot);\n $moduleCreator->createModule();\n \n }", "private function _data_parser() {\n\t\t$this->_set_cal_id();\n\t\t\n\t\tforeach ($this->data as $blockname => $block) {\n\t\t\tif (array_key_exists($blockname,self::$objectTranslation)) {\n\t\t\t\t$this->_store_objects($block,self::$objectTranslation[$blockname]);\n\t\t\t} else {\n\t\t\t\t//STUB\n\t\t\t}\n\t\t}\n }", "private function getCommandData(){ \n if(isset($this->_data['allow']) && $this->_data['allow'] != 'none'){\n if(preg_match('/post/i', $this->_data['allow']) && count($_POST)){\n $this->_command_data = array_merge($this->_command_data, $_POST);\n }\n \n if(preg_match('/get/i', $this->_data['allow']) && count($_GET)){\n $this->_command_data = array_merge($this->_command_data, $_GET);\n }\n \n if(preg_match('/files/i', $this->_data['allow']) && count($_FILES)){\n $this->_command_data['files'] = $_FILES;\n }\n }\n \n return $this->_command_data;\n }", "public function loadData()\r\n\t{\r\n\t}", "public function getOperation($data = [])\n {\n if (!$this->operation) {\n $this->operation = $this->makeOperation($data);\n }\n return $this->operation;\n }", "public function setOperations($var)\n {\n $arr = GPBUtil::checkRepeatedField($var, \\Google\\Protobuf\\Internal\\GPBType::MESSAGE, \\Google\\Identity\\AccessContextManager\\V1\\ServicePerimeterConfig\\ApiOperation::class);\n $this->operations = $arr;\n\n return $this;\n }", "private static function parseOperations($operations)\n {\n $valid_operations = array('resize', 'resizeCrop', 'crop', 'format');\n $operations = explode('|', str_replace(' ', '', $operations));\n $return = array();\n\n foreach ($operations as $operations) {\n $params = explode(',', $operations);\n $function = trim(array_shift($params));\n\n if (!in_array($function, $valid_operations)) {\n throw new ImageException(\"The transform function '{$function}' is not valid\");\n }\n\n $return[] = array(\n 'function' => $function,\n 'params' => $params,\n );\n }\n\n return $return;\n }", "function importData()\n {\n }", "public function creer_definition_action_operation_command_ws() {\n\t\t$this->onDebug ( __METHOD__, 1 );\n\t\t$opcommand = array (\n\t\t\t\t\"opcommand\" => $this->getObjetOpCommand ()\n\t\t\t\t\t->creer_definition_zabbix_operation_command_ws () \n\t\t);\n\t\tif (count ( $this->getObjetOpCommand ()\n\t\t\t->creer_definition_zabbix_operation_command_ws () ) > 0) {\n\t\t\tif (count ( $this->getOpCommandGrp () ) > 0) {\n\t\t\t\t$opcommand [\"opcommand_grp\"] = $this->getOpCommandGrp ();\n\t\t\t} elseif (count ( $this->getOpCommandHst () ) > 0) {\n\t\t\t\t$opcommand [\"opcommand_hst\"] = $this->getOpCommandHst ();\n\t\t\t} else {\n\t\t\t\treturn $this->onError ( \"Il faut un zabbix_action_operation_opcommand_grp ou un zabbix_action_operation_opcommand_hst pour un opcommand\" );\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $opcommand;\n\t}", "function processData() \n {\n\n $this->dataManager->loadFromArray( $this->formValues );\n $this->dataManager->createNewEntry();\n \n }", "protected function LoadData()\n\t{\n\t\t$head = $this->GetProject()->GetHeadCommit();\n\t\t$this->tpl->assign('head', $head);\n\t\tif (!$head)\n\t\t\t$this->tpl->assign('enablesearch', false);\n\n\t\tif (!empty($this->params['graphtype']))\n\t\t\t$this->tpl->assign('graphtype', $this->params['graphtype']);\n\t}", "public function set_data_for_action() {\n $data_pool = array();\n $source_for_action = $this->config['input_sources'][$this->domain_request->requested_action];\n $calcd_data = $this->calculated_data[$this->domain_request->requested_action]\n\t ? $this->calculated_data[$this->domain_request->requested_action]\n\t : array();\n\t$this->logger->debug(__METHOD__.\" \\$calcd_data: [\".print_r($calcd_data,1).\"]\");\n\t// only keys in the data source to only those that appear in the filters\n if($source_for_action==INPUT_GET && isset($this->domain_request->_get[$this->name])) {\n\t $data_pool = array_merge($this->domain_request->_get[$this->name],$calcd_data);\n\t} else if($source_for_action==INPUT_POST && isset($this->domain_request->_post[$this->name])) {\n $data_pool = array_merge($this->domain_request->_post[$this->name],$calcd_data);\n } else {\n $this->logger->warn(__METHOD__.\" Datapool for action [{$this->domain_request->requested_action}] does not exist\");\n }\n\t$this->data[$this->domain_request->requested_action] = $data_pool;\n\t$this->logger->debug(__METHOD__.\" \\$this->data: [\".print_r($this->data,1).\"]\");\n\t// make sure we leave with atleast an empty array\n $this->data[$this->domain_request->requested_action] = $this->data[$this->domain_request->requested_action]==null?array():$this->data[$this->domain_request->requested_action];\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }