query
stringlengths
10
8.11k
document
stringlengths
17
398k
negatives
listlengths
19
20
metadata
dict
Get update metadta endpoint arguments.
private function get_update_metadata_args() { return [ 'rows' => [ 'required' => true, 'description' => esc_html__( 'No meta rows found to update.', 'rank-math' ), 'validate_callback' => [ '\\RankMath\\Rest\\Rest_Helper', 'is_param_empty' ], ], ]; }
[ "function getUpdateParams($request, $response, $args){\r\n\t\treturn $request->getParams();\r\n\t}", "public function getParametersForUpdate();", "private function get_update_metadata_args() {\n\t\treturn [\n\t\t\t'objectType' => [\n\t\t\t\t'type' => 'string',\n\t\t\t\t'required' => true,\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Invokes any cron handlers implementing hook_cron.
protected function invokeCronHandlers() { $module_previous = ''; // If detailed logging isn't enabled, don't log individual execution times. $time_logging_enabled = \Drupal::config('system.cron')->get('logging'); $logger = $time_logging_enabled ? $this->logger : new NullLogger(); // Iterate through the modules calling their cron handlers (if any): $this->moduleHandler->invokeAllWith('cron', function (callable $hook, string $module) use (&$module_previous, $logger) { if (!$module_previous) { $logger->info('Starting execution of @module_cron().', [ '@module' => $module, ]); } else { $logger->info('Starting execution of @module_cron(), execution of @module_previous_cron() took @time.', [ '@module' => $module, '@module_previous' => $module_previous, '@time' => Timer::read('cron_' . $module_previous) . 'ms', ]); } Timer::start('cron_' . $module); // Do not let an exception thrown by one module disturb another. try { $hook(); } catch (\Exception $e) { watchdog_exception('cron', $e); } Timer::stop('cron_' . $module); $module_previous = $module; }); if ($module_previous) { $logger->info('Execution of @module_previous_cron() took @time.', [ '@module_previous' => $module_previous, '@time' => Timer::read('cron_' . $module_previous) . 'ms', ]); } }
[ "public function customRunAllCrons() {\n foreach ($this->moduleHandler->getImplementations('cron') as $module) {\n try {\n $this->moduleHandler->invoke($module, 'cron');\n $this->logger->notice('Ran hook_cron from @name module.', array('@name' => $module));\n } catch (\\Exception $e) {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Test that the 'canonical request' used in the AWS signature algorithm matches the example in
public function testCanonicalRequest() { $this->setupEnv(); $AwsClient = new Idealstack\DynamoDbSessionsDependencyFree\AwsClient([ 'region' => 'us-east-1', 'version' => 'latest', 'service' => 'service', 'credentials' => [ 'key' => 'AKIDEXAMPLE', 'secret' => 'wJalrXUtnFEMI/K7MDENG+bPxRfiCYEXAMPLEKEY' ] ]); $method = new ReflectionMethod('Idealstack\DynamoDbSessionsDependencyFree\AwsClient', 'getCanonicalRequest'); $method->setAccessible(true); $result = $method->invoke( $AwsClient, 'GET', 'https://example.amazonaws.com', [ 'Param2' => 'value2', 'Param1' => 'value1' ], [ 'X-Amz-Date' => '20150830T123600Z' ], '', strtotime('20150830T123600Z') ); $canonical_request_string = "GET / Param1=value1&Param2=value2 host:example.amazonaws.com x-amz-date:20150830T123600Z host;x-amz-date e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"; $canonical_request_string_hash = '816cd5b414d056048ba4f7c5386d6e0533120fb1fcfa93762cf0fc39e2cf19e0'; $this->assertEquals($canonical_request_string, $result['CanonicalRequest']); //Hash it $this->assertEquals( $canonical_request_string_hash, hash('sha256', $result['CanonicalRequest']) ); $this->restoreEnv(); }
[ "public function testGetSignature()\n {\n $valid = 'cJadffbdVWLPv+t7cxlbgAB4HlM=';\n $this->assertEquals($valid, $this->request->getSignature());\n }", "public function testSignatureUisPost()\n {\n }", "public function testSignedRequestParsing()\n {\n $qs = 'SAMLRequest=nVLBa...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
export category tree to dropdown element by groupCat 'member'
function dropdownCategoryMember($id_selected = '') { $cat_all = categoryParentChildTree(0,'member','',''); $export =''; foreach ($cat_all as $items=>$item) { $id = $item['id']; $name = $item['name']; if(!empty($id_selected)) { if ($id == $id_selected) { $export .= '<option value="'.$id.'" selected>'.$name.'</option>'; } else $export .= '<option value="'.$id.'">'.$name.'</option>'; } else { $export .= '<option value="'.$id.'">'.$name.'</option>'; } } return $export; return "<select id=\"category\">$export</select>"; }
[ "private function getDrilldownCatChooser() {\n\t\t$content_item = '';\n\t\t$this->outerArray['###WTDIRECTORY_CAT_TITLE###'] = $this->pi_getLL('wtdirectory_cat_title', 'Search form'); // title\n\t\t$this->outerArray['###WTDIRECTORY_CAT_ACTION###'] = $this->conf['filter.']['cat.']['clearOldFilter'] == 0 ? htmlentitie...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Return product for current item
public function getProductItem() { return $this->getItem()->getProduct(); }
[ "public function getProduct()\r\n {\r\n return Mage::registry('current_product');\r\n }", "public function getProduct()\n {\n return app()->make($this->order_item_type)->find($this->order_item_id);\n }", "public function getProduct()\n {\n return $this->_coreRegistry->registr...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
SendOutputs is similar to the existing sendmany call in Bitcoind, and allows the caller to create a transaction that sends to several outputs at once. This is ideal when wanting to batch create a set of transactions.
public function SendOutputs(\Walletrpc\SendOutputsRequest $argument, $metadata = [], $options = []) { return $this->_simpleRequest('/walletrpc.WalletKit/SendOutputs', $argument, ['\Walletrpc\SendOutputsResponse', 'decode'], $metadata, $options); }
[ "public function sendOutputGroup($outputs)\n {\n $firstOutput;\n $formatted = array();\n foreach($outputs as $output)\n {\n if(empty($firstOutput)) $firstOutput = $output;\n $formatted[] = $this->formatOutput($output, strtolower($output->method) . 'Response', $re...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
The text parsers are defined as plugins.
private function initialise_text_parser() { $plugin_path = $this->system_folder.DS.'plugins'.DS.$this->text_parser.DS; require_once $plugin_path.'plugin.'.$this->text_parser.'.php'; $class = 'Plugin_'.$this->text_parser; $this->parser = new $class; }
[ "public function parse($text)\n {\n }", "abstract public function registerParsers();", "public function getParser($text, $parserId = '');", "abstract protected function parse($text = null);", "public function textParser($text) {\n $text = preg_replace('#\\x{00a0}#iu', '&nbsp;', $text);\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
END FUNCTION added by unixman to extend syntax: ~Subscript~
private function inlineSubscript($Excerpt) { //-- if(!isset($Excerpt['text'][0])) { return; } //end if //-- if($Excerpt['text'][0] === '~' AND $Excerpt['text'][1] !== '~' AND preg_match('/^~(?=\S)(.+?)(?<=\S)~/', $Excerpt['text'], $matches)) { return array( 'extent' => strlen($matches[0]), 'element' => array( 'name' => 'sub', 'text' => $matches[1], 'handler' => 'line', ), ); } //end if //-- }
[ "function sub() {\n\t\t$this->marks[] = [\n\t\t\t'type' => 'subsup',\n\t\t\t'attrs' => [\n\t\t\t\t'type' => 'sub'\n\t\t\t]\n\t\t];\n\t\treturn $this;\n\t}", "static function getSubCommands();", "function WordRightEndExtend(){}", "public function testSuperscript() {\n $this->assertEquals('<sup>Superscr...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ Destroy this object, ensure that the Guzzle client is nulled out
function __destroy() { $this->client = null; }
[ "private static function destroy()\n {\n self::$client = null;\n }", "public function __destruct() {\n\t\t\t$this->service->destroy();\n\t\t}", "public function __destroy()\r\n\t{\r\n\t\tcurl_close($this->curl);\r\n\t}", "public function destroy()\n {\n curl_close($this->curl);\n }",...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Testing _fcpoGetUpdateQuery inserting a new entry
public function test__fcpoGetUpdateQuery_Insert() { $oTestObject = $this->getMock('fcpoerrormapping', array('_fcpoIsValidNewEntry')); $oTestObject->expects($this->any())->method('_fcpoIsValidNewEntry')->will($this->returnValue(true)); $oMockUtilsObject = $this->getMock('oxUtilsObject', array('generateUID')); $oMockUtilsObject->expects($this->any())->method('generateUID')->will($this->returnValue('someId')); $oHelper = $this->getMockBuilder('fcpohelper')->disableOriginalConstructor()->getMock(); $oHelper->expects($this->any())->method('fcpoGetUtilsObject')->will($this->returnValue($oMockUtilsObject)); $this->invokeSetAttribute($oTestObject, '_oFcpoHelper', $oHelper); $sMockMappingId = 'someMapId'; $sMockPaymentId = 'somePaymentId'; $sMockPayoneStatus = 'someStatus'; $sMockFolder = 'someFolder'; $aMockData = array('sPaymentType' => $sMockPaymentId, 'sPayoneStatus' => $sMockPayoneStatus, 'sShopStatus' => $sMockFolder); $sResponse = $sExpect = $oTestObject->_fcpoGetUpdateQuery($sMockMappingId, $aMockData, 'someErrorType'); $this->assertEquals($sExpect, $sResponse); }
[ "public function testTableUpdate()\r\n {\r\n\r\n }", "public function testCreateOrUpdateWithExistingRecord()\n {\n\n // Create item and servers.\n $item = $this->__item();\n $server1 = $this->__server();\n $server2 = $this->__server();\n\n // Create object.\n $ob...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Deletes the named page configuration from the set, calls edit, and returns the calling object. $pcs>deletePageConfiguration( 'XML' )>dump(); Asset Exception
public function deletePageConfiguration( string $name ) : Asset { if( $this->getDefaultConfiguration() == $name ) { throw new \Exception( S_SPAN . "Cannot delete the default configuration." . E_SPAN ); } if( !$this->hasConfiguration( $name ) ) return $this; $id = $this->page_configuration_map[ $name ]->getId(); $service = $this->getService(); $service->delete( $service->createId( c\T::CONFIGURATION, $id ) ); $this->reloadProperty(); $this->processPageConfigurations( $this->getProperty()->pageConfigurations->pageConfiguration ); return $this; }
[ "public function deletePage() {\n\t\t\n\t\t$output = array();\n\t\t$url = Request::post('url');\n\t\t$title = Request::post('title');\n\n\t\t// Validate $_POST.\n\t\tif ($url && ($Page = $this->Automad->getPage($url)) && $url != '/' && $title) {\n\n\t\t\t// Check if the page's directory and parent directory are wir...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Based on restrict posts list hide posts list callback
function sh_set_hide_posts_callback($query) { //check if user not logged in hide selected posts if(!is_user_logged_in()){ //set $query->set('post__not_in', sh_hide_posts_list_callback()); } }
[ "public function hide_post_from_searchengines() {\n\t\t\t$hidden_posts = get_option( 'unlist_posts', array() );\n\n\t\t\tif ( in_array( get_the_ID(), $hidden_posts ) && false !== get_the_ID() ) {\n\t\t\t\twp_no_robots();\n\t\t\t}\n\t\t}", "function mgm_hide_protected($query) {\r\n\tglobal $post;\r\n\t\r\n\t// do ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Set inject if not empty.
public function setInjectIfNotEmpty($injectIfNotEmpty) { $this->injectIfNotEmpty = $injectIfNotEmpty; return $this; }
[ "public function injectIfNotEmpty()\n {\n return $this->injectIfNotEmpty;\n }", "public function shouldInjectIfNotEmpty()\n {\n return $this->injectIfNotEmpty;\n }", "public function setInject($inject) {\n $this->inject = $inject;\n }", "public function setInjectVariationFi...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get rule public descriptions by rule uids
public static function get_public_descriptions($context, $rule_uids) { $descriptions = array(); $rule_uids = (array) $rule_uids; // Check if at least one rule uid is set if (!empty($rule_uids) && is_array($rule_uids)) { // Get rules by uids $rules = RP_WCDPD_Rules::get($context, array('uids' => $rule_uids), true); // Iterate over applicable rules and append their public descriptions foreach ($rules as $rule) { if (isset($rule['public_note']) && !RightPress_Helper::is_empty($rule['public_note'])) { $descriptions /* change code 2018 */ //[$rule['uid']] = $rule['public_note']; } } } return !empty($descriptions) ? $descriptions : null; }
[ "protected function _fetchRules($userId)\n {\n $group = Js_Query::create()\n ->select('gm.group_id')\n ->from('Model_Group_Membership gm')\n ->where('gm.user_id = ?', $userId)\n ->fetchOne(array(), Doctrine::HYDRATE_ARRAY);\n\n $groupId = $group['group_id...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets the current proxy used for requests.
public function getProxy() { return $this->client->getProxy(); }
[ "public static function getProxy() {\r\n\t\treturn self::$proxy;\r\n\t}", "public function getProxy()\n {\n return $this->client->getProxy();\n }", "public function getProxy()\n {\n return $this->_proxy;\n }", "public function getProxy() {\n return $this->proxy;\n }", "function...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ writes out everything that has changed from the previous state to the later one. returns an array that contains only the differences between the passed arrays.
public static function diffarrays($former, $latter){ $one = (array)$former; $two = (array)$latter; $diff = array(); foreach($one as $key => $val1){ if (array_key_exists($key, $two)){ $val2 = $two[$key]; if ($val1 === $val2){ // same value, no diff continue; } if ($val1 === null && $val2 === null){ // discard if both are null continue; } $type1 = gettype($val1); $type2 = gettype($val2); if ($val2 === null){ $diff[$key] = $val1; } else if ($val1 === null){ $diff[$key] = $val2; } else if (is_numeric($val1) && is_numeric($val2)){ $diff[$key] = $val2 - $val1; } else if ($type1 == "boolean" && $type2 == "boolean"){ $diff[$key] = $val2; } else if ($type1 == "string"){ $diff[$key] = (string)$val2; } else if ($type2 == "string"){ $diff[$key] = (string)$val2; } else if (($type1 == "array" || $type1 == "object") && ($type2 == "array" || $type2 == "object")){ $diff[$key] = self::diffarrays($val1, $val2); } else { $diff[$key] = $val2; } } else { // only in first, ignore since diff always only against old state } } foreach($two as $key => $val2){ if (!array_key_exists($key, $one)) { $diff[$key] = $val2; } } return $diff; }
[ "public function testDiff_returnsArray_ifDiffIsUpdate()\n\t{\n\t\t$from = ['foo'];\n\t\t$to = ['bar'];\n\t\t\n\t\t$expected = [['value' => 'foo', 'mask' => -1], ['value' => 'bar', 'mask' => 1]];\n\t\t$actual = Arr::diff($from, $to);\n\t\t\n\t\t$this->assertEquals($expected, $actual);\n\t\t\n\t\treturn;\n\t}", ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
new function to log info message, with variable to hold any user message
function logInfo($message) { logMessage("INFO", $message); }
[ "public function logInfo($message);", "private function info($message){\n $this->printSting(\"0;33m\",$message);\n }", "public function logInfo($message)\n {\n \\log::add(\"mystrom\", \"info\", $message);\n }", "public function info($message)\r\n {\r\n $this->log($message, 1);...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Check for shares having both included and excluded disks set
function shareIncludeExcludeSet() { global $fixPaths, $fixSettings, $autoUpdateOverride, $developerMode, $communityApplicationsInstalled, $dockerRunning, $ignoreList, $shareList; foreach ($shareList as $share) { if ( is_file("/boot/config/shares/$share.cfg") ) { $shareCfg = my_parse_ini_file("/boot/config/shares/$share.cfg"); if ( ($shareCfg['shareInclude'] ?? "") && ($shareCfg['shareExclude'] ?? "") ) { $shareURL = str_replace(" ","+",$share); addWarning("Share <b>$share</b> is set for both included (".$shareCfg['shareInclude'].") and excluded (".$shareCfg['shareExclude'].") disks","While if you're careful this isn't a problem, there is absolutely no reason ever to specify BOTH included and excluded disks. It is far easier and safer to only set either the included list or the excluded list. Fix it here: ".addLinkButton("$share Settings","/Shares/Share?name=$shareURL"),"https://forums.unraid.net/topic/120220-fix-common-problems-more-information/?tab=comments#comment-1098712"); } } } # Check for global share settings having both included and exluded disks set if ( is_file("/boot/config/share.cfg") ) { $shareCfg = my_parse_ini_file("/boot/config/share.cfg"); if ( $shareCfg['shareUserInclude'] && $shareCfg['shareUserExclude'] ) { addWarning("<b>Global Share Settings</b> is set for both included (".$shareCfg['shareUserInclude'].") and excluded (".$shareCfg['shareUserExclude'].") disks","While if you're careful this isn't a problem, there is absolutely no reason ever to specify BOTH included and excluded disks. It is far easier and safer to only set either the included list or the excluded list. Fix it here: ".addLinkButton("Global Share Settings","/Settings/ShareSettings"),"https://forums.unraid.net/topic/120220-fix-common-problems-more-information/?tab=comments#comment-1098712"); } } }
[ "function shareIncludeExcludeSet() {\n global $fixPaths, $fixSettings, $autoUpdateOverride, $developerMode, $communityApplicationsInstalled, $dockerRunning, $ignoreList, $shareList;\n \n foreach ($shareList as $share) {\n if ( is_file(\"/boot/config/shares/$share.cfg\") ) {\n $shareCfg = my_parse_ini_fil...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Initializes the collTigPairss collection. By default this just sets the collTigPairss collection to an empty array (like clearcollTigPairss()); 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 initTigPairss() { $this->collTigPairss = new PropelObjectCollection(); $this->collTigPairss->setModel('TigPairs'); }
[ "public function setPairs($pairs)\n {\n $this->pairs = $pairs;\n }", "public function initCoursess()\n\t{\n\t\t$this->collCoursess = array();\n\t}", "public function setPairs($var)\n {\n $arr = GPBUtil::checkRepeatedField($var, \\Google\\Protobuf\\Internal\\GPBType::MESSAGE, \\Ydb\\ValueP...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns dir of JavaScript files (including Kekule.js and its dependencies).
static public function getScriptDir() { return self::getKekuleDir() . 'jslib/'; }
[ "public static function GetJsSupportFilesRootDir ();", "function get_js_path() {\n\n\n return JS_FOLDER_PATH;\n }", "public function getJavascriptFolders()\n {\n return $this->paths['javascript'];\n }", "public function getJSLangDirectories()\n {\n $sources = $this->getTransif...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
///////////////////////////////////////////////////////////////////////// Create a virtual collection from configuration object $obj add a new OCA\files_irods\iRodsApi\Collection object to array $collection if all requirements are met /////////////////////////////////////////////////////////////////////////
protected function createVirtualCollection(&$collections, $obj) { if(array_key_exists("if_group", $obj)) { if(!array_key_exists($obj['if_group'], $this->roles)) { // group is not allowed return false; } } if(array_key_exists("type", $obj)) { $type = $obj['type']; } else { $type = ''; } if(array_key_exists("path", $obj)) { $path = str_replace (['{ZONE}', '{USER}', '{HOME}'], [$this->params['zone'], $this->params['user'], '/'.$this->params['zone']."/home/".$this->params['user']], $obj['path']); } else { $path = ''; } switch($type) { case 'Collection': $collections[$obj['name']] = new Collection($this, $path); return true; break; case 'FilteredCollection': $collections[$obj['name']] = new FilteredCollection($this, $path, $obj['filter']); return true; break; case 'FilteredHomeCollection': foreach($this->getUsersOfGroup($obj['group']) as $user) { $path = str_replace(["{ZONE}", "{USER}"], [$this->params['zone'], $user], $obj['path']); $name = str_replace("{USER}", $user, $obj['name']); $coll = new FilteredCollection($this, $path, $obj['filter']); if($coll->acl()) { //at least read $collections[$name] = $coll; } } return true; break; default: throw StorageNotAvailableException("invalid type '$type' in configuration ".json_encode($obj)); } }
[ "public function setCollectionObject(&$obj)\n {\n $this->_c = $obj;\n }", "private function createCollection(): void\n\t{\n\t\t$customer = new Customer();\n\n\t\t$application = new Application();\n\t\t$application->setCustomer($customer);\n\n\t\t$applicationVersion = new Application\\Version();\n\t\t...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns a list of all available graph URIs of the store. It can also respect access control, to only returned available graphs in the current context. But that depends on the implementation and can differ.
public function getGraphs() { // if successor is set, ask it first before run the command yourself. if ($this->successor instanceof Store) { return $this->successor->getGraphs(); // dont run command by myself } else { throw new \Exception( 'Addition\Erfurt\QueryCache does not support get available graphs, only by successor.' ); } }
[ "public function getAllUrls()\n {\n $urls = [];\n $stores = $this->storeManager->getStores(false);\n foreach ($stores as $store) {\n $urls[] = $store->getBaseUrl();\n }\n\n return $urls;\n }", "public function getStoreUrls()\n {\n if (is_null($this->_s...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets the individual Elements value based on the Dispatcher
public function setValue(Dispatcher $dispatcher): void{ $this->content = $dispatcher->get($this->name); }
[ "public abstract function setValue(Dispatcher $dispatcher): void;", "protected function setElement() {}", "public function setElement() {}", "public function setDispatcher($value) {\n\t\t\t$this->dispatcher=$value;\n\t\t}", "protected function setElement() {\n\n $this->element = new Input($this->name,$th...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Construct a new counterbased onetime password shared parameters instance.
public function __construct($secret, $counter = null) { if (null === $counter) { $counter = 1; } parent::__construct($secret); $this->counter = $counter; }
[ "public function create()\n {\n return $this->counterRegistry->create();\n }", "public function __construct()\n {\n self::$counter++;\n $this->uid = self::$counter;\n }", "public function build(\n CounterId $anId,\n CounterName $anName,\n CounterValue $aValue,\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the index within this string of the last occurrence of the specified string.
public function lastIndexOf($string, int $offset = 0): int { Assert::typeOf(['string', __CLASS__], $string); $pos = mb_strrpos($this->data, (string) $string, $offset, $this->encoding); return $pos > -1 ? $pos : -1; }
[ "public function lastIndexOf(string $string){\n return strripos($this->string, $string);\n }", "public function getLastIndexOf(string $string){\n return $this->subString(0, $this->lastIndexOf($string));\n }", "function last_index_of($sub_str,$instr) {\n\tif(strstr($instr,$sub_str)!=\"\") {\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets or sets compressionThreshold
public function compressionThreshold($compressionThreshold = null) { if(null === $compressionThreshold) { return $this->property('compressionThreshold'); } return $this->property('compressionThreshold', (int) $compressionThreshold); }
[ "public function getCompressionThreshold()\n {\n return $this->getProperty('compressionThreshold');\n }", "public function getCompressingThreshold(): int\n {\n return 256;\n }", "public function compression() {\n\t\treturn $this->compression;\n\t}", "public function getCompression()\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get the Quality Control object for the Loom resource
public function getQualityControl() { return new QualityControl([ ]); }
[ "public function landscapeQualityModel() { return $this->landscapeQualityModel; }", "public function getQuality();", "public function getQualityId()\n {\n if (array_key_exists(\"qualityId\", $this->_propDict)) {\n return $this->_propDict[\"qualityId\"];\n } else {\n return...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets the public 'TYPO3\CMS\Fluid\ViewHelpers\Link\ActionViewHelper' autowired service.
protected function getActionViewHelperService() { return \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstanceForDi(\TYPO3\CMS\Fluid\ViewHelpers\Link\ActionViewHelper::class); }
[ "protected function getTermLinkIndexingActionService()\n {\n $a = ${($_ = isset($this->services['Yoast\\\\WP\\\\SEO\\\\Builders\\\\Indexable_Link_Builder']) ? $this->services['Yoast\\\\WP\\\\SEO\\\\Builders\\\\Indexable_Link_Builder'] : $this->getIndexableLinkBuilderService()) && false ?: '_'};\n\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Method for adding the profiles count
public function addProfilesCount(): self { $this->addStep('profilesCount'); return $this; }
[ "private function _set_bcs_profile_count() {\n\t\t \t$this->db->where('active','1');\n\t\t \t$this->db->from('bcs_profiles');\n\t\t \t$this->_bcs_profile_count = $this->db->count_all_results();\n\t}", "public function getFeaturedProfilesCount();", "public final function getNumberProfile()\n {\n return...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Publish the filesystem service.
public static function publishFilesystem(Container $container): void { $config = $container->getSingleton(Config::class); $container->setSingleton( Filesystem::class, new \Valkyrja\Filesystem\Managers\Filesystem( $container->getSingleton(Factory::class), $config['filesystem'] ) ); }
[ "private function publishFiles(): void\n {\n $this->progress->setMessage('Publishing files');\n\n $this->callSilent('vendor:publish', ['--tag' => 'directus']);\n }", "public function publish()\n\t{\n\t\tparent::publish();\n\t\t$this->publishImages();\n\t}", "private function publishPackage()...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Extract the HTTP message from a response
public static function extractMessage($response_str) { preg_match("|^HTTP/[\d\.x]+ \d+ ([^\r\n]+)|", $response_str, $m); if (isset($m[1])) { return $m[1]; } else { return false; } }
[ "function get_response() {\n $text = $this->message->text;\n if($text)\n return extract_response($text);\n else\n return '';\n }", "public function getResponseMessage() {\n\t\tif(!empty($this->response->info)) {\n\t\t\treturn $this->response->info;\n\t\t}\n\t}", "pr...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Rolls a license expiration date back when refunding a renewal payment.
function edd_sl_rollback_expiration_on_renewal_refund( $payment ) { $is_renewal = edd_get_payment_meta( $payment->ID, '_edd_sl_is_renewal', true ); if ( ! $is_renewal ) { return; } foreach ( $payment->cart_details as $cart_item ) { if ( is_array( $cart_item['item_number']['options'] ) ) { // See if the `is_renewal` key exists and if the license_id exists, since these were added later, they may not on some legacy payments. if ( array_key_exists( 'is_renewal', $cart_item['item_number']['options'] ) && ! empty( $cart_item['item_number']['options']['license_id'] ) ) { $license = edd_software_licensing()->get_license( (int) $cart_item['item_number']['options']['license_id'] ); if ( false !== $license ) { $license->expiration = strtotime( '-' . $license->license_length(), $license->expiration ); } } } } }
[ "function renewSubscription(&$subscription){\n\t\t$subscriptionTypeDAO =& DAORegistry::getDAO('SubscriptionTypeDAO');\n\t\t$subscriptionType =& $subscriptionTypeDAO->getSubscriptionType($subscription->getTypeId());\n\t\t\n\t\t$duration = $subscriptionType->getDuration();\n\t\t$dateEnd = strtotime($subscription->get...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get configurable options source for original product.
protected function getOriginalProductOptionsSource() { return $this->product->getDataFieldConfig('configurable_options')['source']; }
[ "public function getOptionsSource();", "public function getConfigSource()\n {\n return $this->configSource;\n }", "public function getSourceConfig() {\n if (empty($this->sourceConfig)) {\n $source_config_name = ConfigName::createByFullName($this->definition['source']);\n $this->sourceC...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Function to get store details whose payemnt is released this month
public function getReleasePaymentInfo($storeId = NULL) { $releasedStore = DB::table('store_payment AS SP') ->addSelect('SD.store_name') ->addSelect('SP.fk_order_id AS storeOrderId') ->addSelect('SO.order_id AS orderId') ->addSelect('users.email') ->addSelect(DB::raw('SUM(SP.amount) AS totalPrice')) ->addSelect(DB::raw("DATE_FORMAT(SP.updated_at,'%d %b,%Y') AS date")) ->addSelect(DB::raw("SP.id AS payment_id")) ->addSelect(DB::raw("DATE_FORMAT(SP.updated_at,'%r') AS time")) ->addSelect(DB::raw("MONTH(SP.updated_at) AS month")) ->leftJoin('sub_store_details AS SD', 'SD.fk_users_id', '=', 'SP.fk_store_id') ->leftJoin('sales_order AS SO', 'SO.id_sales_order', '=', 'SP.fk_order_id') ->join('users', 'users.id', '=', 'SP.fk_store_id'); if (NULL != $storeId){ $releasedStore = $releasedStore->addSelect('SP.fk_store_id AS id') ->where('SP.parent_store_id', '=', $storeId) ->groupBy('SP.fk_order_id'); }else{ $releasedStore = $releasedStore ->addSelect('SP.parent_store_id AS id') ->groupBy('SP.parent_store_id'); } $releasedStore = $releasedStore->orderBy('SP.updated_at', 'DESC')->get(); return $releasedStore; }
[ "function getBillingDate();", "function fn_is_store_live()\n{\n $result = 'N';\n $timestamp = Settings::instance()->getSettingDataByName('current_timestamp');\n $install_time = (int) $timestamp['value'];\n $time = strtotime('-30 day');\n\n if ($install_time < $time && db_get_row(\"SELECT order_id F...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Add Id Add card's id to session order variable
public static function addId($id) { $session = Yii::$app->session; if (isset($session['order']) && count($session['order']) != 0) { $order = $session['order']; $order[] = $id; $session['order'] = $order; return $session['order']; } else { $session['order'] = array($id); return "New cart created"; } }
[ "public function updateId() {\n $this->Id = session_id();\n }", "function get_order_id()\n\t{\n\t\t// after that a card has been processed,\n\t\t// sometime it is possible retrieve the order id if assign by the gateway.\n\t\treturn $this->order['o_orderID'];\n\t}", "public function setCartId()...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets ID of this update user.
public function setUserId($id) { $this->user_id = $id; }
[ "public function setId($id)\n {\n $this->_data['ai.user.id'] = $id;\n }", "function setIdUser($value) {\n $this->idUser = $value;\n }", "public function setUserId($id)\n {\n $this->user_id = (integer) $id;\n }", "public function setIdUser($idUser)\n {\n $this->idU...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Tests the `group/[digit]/employees` endpoint.
public function testListGroupsEmployees() : void { $results = self::$client->get(array('a' => 'group/1/employees')); $this->assertNotNull($results[0]); $this->assertEquals('1', $results[0]['empUID']); $this->assertEquals('tester', $results[0]['userName']); $this->assertEquals('tester', $results[0]['lastName']); $this->assertEquals('tester', $results[0]['firstName']); $this->assertEquals('tester', $results[0]['middleName']); $this->assertEquals('tester', $results[0]['phoneticFirstName']); $this->assertEquals('tester', $results[0]['phoneticLastName']); $this->assertEquals('', $results[0]['domain']); $this->assertEquals('0', $results[0]['deleted']); $this->assertEquals('0', $results[0]['lastUpdated']); }
[ "public function testEmployeesEmployeeIDPost()\n {\n }", "public function testFetchAllEmployees()\n {\n $this->withoutExceptionHandling();\n $this->json('GET', route('employee.index'), $this->headers)\n ->assertStatus(200)\n ->assertJsonFragment([\n 'sta...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
If the order cancel or failure by online then delete the wallet amount and history
function after_order_update_wallet_remove($orderid = null, $customerid = null) { $cithis = & get_instance(); $cithis->load->database(); $cithis->load->model('common'); if ((!empty($orderid)) && (!empty($customerid))) { // Wallet functionality $wallet_amount = $cithis->common->getRow('orders', 'wallet_amount', array('order_id' => $orderid, 'customer_id' => $customerid)); if ($wallet_amount->wallet_amount > 0) { $walletaMount = $wallet_amount->wallet_amount; $wallet = $cithis->common->getRow('wallet', 'id,amount', array('customer_id' => $customerid)); if (!empty($wallet)) { $new_amount = $wallet->amount + $wallet_amount->wallet_amount; $yes = $cithis->common->update('wallet', array('amount' => $new_amount), array('customer_id' => $customerid)); if ($yes) { $cithis->common->delbyrefrence('wallet_history', $orderid, 'order_id'); return $new_amount; } return $new_amount; } } else { return FALSE; } } else { return FALSE; } }
[ "function cleanUpPendingOrders() ;", "public function clearorderhistory()\n {\n\n\n //#first : get all the order id related to the customer\n $orders=Order::where('customer_id',$this->isAuthenticated(\"id\"))->get();\n\n //#second : store cancel order ids\n $order_id_for_cancel=arr...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Create subdomain Returns true on success or false on failure.
function addSubdomain($subdomain) { $data['domain'] = $subdomain; $data['rootdomain'] = $this->domain; $response = $this->HTTP->getData('subdomain/doadddomain.html', $data); if(strpos($response, 'added') && !strpos($response, 'Error')) { return true; } return false; }
[ "public function create_subdomain($subDomain,$cPanelUser,$cPanelPass,$rootDomain) {\n \n $buildRequest = \"/frontend/x3/subdomain/doadddomain.html?rootdomain=\" . $rootDomain . \"&domain=\" . $subDomain . \"&dir=public_html/clientdev/production/site2/public/\" . $subDomain;\n \n $openSocket = fsockopen('lo...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Enqueue backbone.js library, required by the Attach to Post display tab
function enqueue_display_tab_js() { wp_enqueue_script('backbone'); // provided by WP $this->object->mark_script('backbone'); // Enqueue the backbone app for the display tab // Get all entities used by the display tab $context = 'attach_to_post'; $gallery_mapper = $this->get_registry()->get_utility('I_Gallery_Mapper', $context); $album_mapper = $this->get_registry()->get_utility('I_Album_Mapper', $context); $image_mapper = $this->get_registry()->get_utility('I_Image_Mapper', $context); $display_type_mapper = $this->get_registry()->get_utility('I_Display_Type_Mapper', $context); $sources = C_Displayed_Gallery_Source_Manager::get_instance(); $settings = C_NextGen_Settings::get_instance(); // Get the nextgen tags global $wpdb; $tags = $wpdb->get_results("SELECT DISTINCT name AS 'id', name FROM {$wpdb->terms}\n WHERE term_id IN (\n SELECT term_id FROM {$wpdb->term_taxonomy}\n WHERE taxonomy = 'ngg_tag'\n )"); $all_tags = new stdClass(); $all_tags->name = "All"; $all_tags->id = "All"; array_unshift($tags, $all_tags); $display_types = array(); $registry = C_Component_Registry::get_instance(); $display_type_mapper->flush_query_cache(); foreach ($display_type_mapper->find_all() as $display_type) { if (isset($display_type->hidden_from_igw) && $display_type->hidden_from_igw || isset($display_type->hidden_from_ui) && $display_type->hidden_from_ui) { continue; } $available = $registry->is_module_loaded($display_type->name); if (!apply_filters('ngg_atp_show_display_type', $available, $display_type)) { continue; } // Some display types were saved with values like "nextgen-gallery-pro/modules/nextgen_pro_imagebrowser/static/preview.jpg" // as the preview_image_relpath property if (strpos($display_type->preview_image_relpath, '#') === FALSE) { $static_path = preg_replace("#^.*static/#", "", $display_type->preview_image_relpath); $module_id = isset($display_type->module_id) ? $display_type->module_id : $display_type->name; if ($module_id == 'photocrati-nextgen_basic_slideshow') { $display_type->module_id = $module_id = 'photocrati-nextgen_basic_gallery'; } $display_type->preview_image_relpath = "{$module_id}#{$static_path}"; $display_type_mapper->save($display_type); $display_type_mapper->flush_query_cache(); } $display_type->preview_image_url = M_Static_Assets::get_static_url($display_type->preview_image_relpath); $display_types[] = $display_type; } usort($display_types, array($this->object, '_display_type_list_sort')); wp_enqueue_script('ngg_display_tab', $this->get_static_url('photocrati-attach_to_post#display_tab.js'), array('jquery', 'backbone', 'photocrati_ajax'), NGG_SCRIPT_VERSION); $this->object->mark_script('ngg_display_tab'); wp_localize_script('ngg_display_tab', 'igw_data', array('displayed_gallery_preview_url' => $settings->gallery_preview_url, 'displayed_gallery' => $this->object->_displayed_gallery->get_entity(), 'sources' => $sources->get_all(), 'gallery_primary_key' => $gallery_mapper->get_primary_key_column(), 'galleries' => $gallery_mapper->find_all(), 'albums' => $album_mapper->find_all(), 'tags' => $tags, 'display_types' => $display_types, 'nonce' => M_Security::create_nonce('nextgen_edit_displayed_gallery'), 'image_primary_key' => $image_mapper->get_primary_key_column(), 'display_type_priority_base' => NGG_DISPLAY_PRIORITY_BASE, 'display_type_priority_step' => NGG_DISPLAY_PRIORITY_STEP, 'shortcode_ref' => isset($_REQUEST['ref']) ? floatval($_REQUEST['ref']) : null, 'shortcode_defaults' => array('order_by' => $settings->galSort, 'order_direction' => $settings->galSortDir, 'returns' => 'included', 'maximum_entity_count' => $settings->maximum_entity_count), 'shortcode_attr_replacements' => array('source' => 'src', 'container_ids' => 'ids', 'display_type' => 'display'), 'i18n' => array('sources' => __('Are you inserting a Gallery (default), an Album, or images based on Tags?', 'nggallery'), 'optional' => __('(optional)', 'nggallery'), 'slug_tooltip' => __('Sets an SEO-friendly name to this gallery for URLs. Currently only in use by the Pro Lightbox', 'nggallery'), 'slug_label' => __('Slug', 'nggallery'), 'no_entities' => __('No entities to display for this source', 'nggallery'), 'exclude_question' => __('Exclude?', 'nggallery'), 'select_gallery' => __('Select a Gallery', 'nggallery'), 'galleries' => __('Select one or more galleries (click in box to see available galleries).', 'nggallery'), 'albums' => __('Select one album (click in box to see available albums).', 'nggallery')))); }
[ "public function register_backbone_javascript() {\n\t\t\t\n\t\t/* backbone js extension */\n\t\twp_enqueue_script( 'belT', plugins_url( '/belt.js' , BB_WP_API_FILE ) , array( 'jquery', 'backbone') );\t\t \t\n\t\twp_localize_script( 'backbone', 'belTExternalVars_' . $this->name , $this->get_js_vars()); \t\t\n\t}"...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets the API Merchant Token
public static function setMerchantToken($merchantToken) { self::$merchantToken = $merchantToken; }
[ "public static function setMerchantToken($merchantToken)\r\n {\r\n self::$merchantToken = $merchantToken;\r\n }", "public function setMerchantToken($merchantId) {\n $this->merchantId = $merchantId;\n }", "public function setMerchantIdentifier();", "private function setToken()\n {\n $r...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Attaches a log writer, and optionally limits the levels of messages that will be written by the writer.
public function attach(Log\Writer $writer, $levels = [], int $min_level = 0): self { if (!is_array($levels)) { $levels = range($min_level, $levels); } $this->_writers[(string)$writer] = [ 'object' => $writer, 'levels' => $levels ]; return $this; }
[ "public function addWriter(\\Naked\\Log\\Writer $writer)\n {}", "public function test_attach_attaches_log_writer_min_max_and_returns_this()\n\t{\n\t\t$logger = new Log;\n\t\t$writer = $this->getMockForAbstractClass('Log_Writer');\n\n\t\t$this->assertSame($logger, $logger->attach($writer, Log::NOTICE, Log::CRIT...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets up the views data in the container.
protected function setupViewsData(ViewsData $views_data) { $container = \Drupal::hasContainer() ? \Drupal::getContainer() : new ContainerBuilder(); $container->set('views.views_data', $views_data); \Drupal::setContainer($container); }
[ "protected function prepareView()\n {\n $this->view->setData( $this->data );\n }", "public function setupContainer() {\n $this->accessPluginManager = $this->getMockBuilder('\\Drupal\\views\\Plugin\\ViewsPluginManager')\n ->disableOriginalConstructor()\n ->getMock();\n $container = new...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Appends to the filter its child filters.
public function append_child_filters(array &$appended = array()) { if (!$this->filters) { return; } $fm = \mod_dataform_filter_manager::instance($this->dataid); $appended[$this->id] = $this->id; foreach ($this->filters as $fid) { if (array_key_exists($fid, $appended)) { continue; } // Get the filter. $filter = $fm->get_filter_by_id($fid); // Append its child filters. $appended[$fid] = $fid; $filter->append_child_filters($appended); // Append to this filter. $this->append(array($filter)); } }
[ "public function addFilter($filter) {\r\n\t\t$this->chain[] = $filter;\r\n\t}", "function _populateSubFilters(&$parentFilter) {\n\t\tif (!is_a($parentFilter, 'CompositeFilter')) {\n\t\t\t// Nothing to do. Only composite filters\n\t\t\t// can have sub-filters.\n\t\t\treturn;\n\t\t}\n\n\t\t// Retrieve the sub-filte...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Determine if the given key and cipher combination is valid.
public static function supported( $key, $cipher ) { $length = mb_strlen( $key, '8bit' ); return ( $cipher === 'AES-128-CBC' && $length === 16 ) || ( $cipher === 'AES-256-CBC' && $length === 32 ); }
[ "public static function supported($key, $cipher)\n {\n $length = mb_strlen($key, '8bit');\n \n return (static::isAesCbc128($cipher) && $length === 16) ||\n (static::isAesCbc256($cipher) && $length === 32);\n }", "public function validKey($key)\n {\n $length = mb_str...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get the default post processor instance.
protected function getDefaultPostProcessor() { return new Processor; }
[ "protected function getDefaultPostProcessor()\n \t{\n \t\treturn new Processor;\n \t}", "protected function getDefaultPostProcessor()\n {\n return new Query\\Processors\\Processor;\n }", "protected function getDefaultPostProcessor()\n {\n return new IfxProcessor;\n }", "protected fun...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Parsing the webservices and return the results
public function getResults() { $all_results = $this->parseWebservices(); $all_results = $this->refactorResults($all_results); $this->saveResults($all_results); return $all_results; }
[ "private function parseWebservices()\n {\n // The Shop Webservice\n $shop_service = new ShopService($this->query);\n $shop_service_products = $shop_service->parseShopService();\n \n // The FlipKart webservice\n $flip_service = new FlipkartService($this-...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get the email address for the specified member id.
function _get_member_email_address($member) { return $this->get_member_row_field($member,'email'); }
[ "protected function _get_member_email_address($member)\n {\n return $this->get_member_row_field($member, 'm_email_address');\n }", "function _get_member_email_address($member)\n\t{\n\t\treturn $this->get_member_row_field($member,'m_email_address');\n\t}", "protected function _get_member_email_addre...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Operation teamBuilderConfigsIdProductSizesNkProductsDeleteWithHttpInfo Deletes all products of this model.
public function teamBuilderConfigsIdProductSizesNkProductsDeleteWithHttpInfo($id, $nk) { // verify the required parameter 'id' is set if ($id === null) { throw new \InvalidArgumentException('Missing the required parameter $id when calling teamBuilderConfigsIdProductSizesNkProductsDelete'); } // verify the required parameter 'nk' is set if ($nk === null) { throw new \InvalidArgumentException('Missing the required parameter $nk when calling teamBuilderConfigsIdProductSizesNkProductsDelete'); } // parse inputs $resourcePath = "/TeamBuilderConfigs/{id}/productSizes/{nk}/products"; $httpBody = ''; $queryParams = array(); $headerParams = array(); $formParams = array(); $_header_accept = $this->apiClient->selectHeaderAccept(array('application/json', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript')); if (!is_null($_header_accept)) { $headerParams['Accept'] = $_header_accept; } $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array('application/json','application/x-www-form-urlencoded','application/xml','text/xml')); // path params if ($id !== null) { $resourcePath = str_replace( "{" . "id" . "}", $this->apiClient->getSerializer()->toPathValue($id), $resourcePath ); } // path params if ($nk !== null) { $resourcePath = str_replace( "{" . "nk" . "}", $this->apiClient->getSerializer()->toPathValue($nk), $resourcePath ); } // default format to json $resourcePath = str_replace("{format}", "json", $resourcePath); // for model (json/xml) if (isset($_tempBody)) { $httpBody = $_tempBody; // $_tempBody is the method argument, if present } elseif (count($formParams) > 0) { $httpBody = $formParams; // for HTTP post (form) } // this endpoint requires API key authentication $apiKey = $this->apiClient->getApiKeyWithPrefix('access_token'); if (strlen($apiKey) !== 0) { $queryParams['access_token'] = $apiKey; } // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( $resourcePath, 'DELETE', $queryParams, $httpBody, $headerParams, null, '/TeamBuilderConfigs/{id}/productSizes/{nk}/products' ); return array(null, $statusCode, $httpHeader); } catch (ApiException $e) { switch ($e->getCode()) { } throw $e; } }
[ "public function teamBuilderConfigsIdProductSizesNkProductsFkDeleteWithHttpInfo($id, $nk, $fk)\n {\n // verify the required parameter 'id' is set\n if ($id === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $id when calling teamBuilderConfigsIdProductSizes...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns tracker hosts array
public function getHosts(){ return $this->trackers; }
[ "protected function getHosts() : array {}", "public function hosts() {\n\t\t$res = $this->zap->request($this->zap->base . 'core/view/hosts/');\n\t\treturn reset($res);\n\t}", "public function hosts() : array {\n }", "public function getHostnames(): array;", "public function findHosts(): array;", "p...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get redactor buttons from system config.
protected function getRedactorButtons($config) { $defaultSettings = [ ['name' => 'Standard', 'settings' => ['buttons' => ['formatting', 'bold', 'italic', 'link', 'unorderedlist', 'orderedlist', 'html']]], ['name' => 'Basic', 'settings' => ['buttons' => ['bold', 'italic']]], ]; $buttons = collect($this->getSourceYaml('settings/system.yaml')['redactor'] ?? $defaultSettings) ->keyBy('name') ->map(function ($preset) { return $preset['settings']['buttons']; }) ->get($config['settings'] ?? 'Standard'); return collect($buttons)->keyBy(function ($value) { return $value; }); }
[ "public function getEnabledButtons()\n {\n return $this->em->getRepository('Entity:Config')->findConfig()->getEnabledButtons();\n }", "public static function getMenuButtons()\n {\n return Context::getByKey('menu_buttons');\n }", "static public function getGlobalButtonsByName()\n {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets the encryption key to use.
public function setEncryptionKey(Key $key);
[ "public function setKey ($key = '')\n {\n $this->_encryption_key = $key;\n }", "function set_key($key = '') {\n\t\t$this->encryption_key = $key;\n\t}", "public function setEncryptionKey(): void\n {\n $encryptionKey = config('multipayment-gateways.flutterwave.encryption_key');\n\n i...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Converts a widget ID into its id_base and number components.
function wp_parse_widget_id($id) { }
[ "function bm_widgetId ($widget) {\n\t\n\tif (!isset ($widget['id'])) {\n\t\t$widget['id'] = $widget['name'];\n\t}\n\n\t$idName = $widget['id'];\n\t$idName = strtolower ($idName);\n\t$idName = str_replace (' ', '-', $idName);\n\n\treturn $idName;\n\t\n}", "function bb_widgetId ($widget) {\n\tif (!isset($widget['id...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns TRUE if an edit form is shown on the page. Used from RequestHandler where a TRUE returnvalue will result in classes etc. being included.
public function isEditFormShown() {}
[ "protected function isEdit()\n {\n\n if ($this->formRequest->is('*/edit')) {\n return true;\n }\n\n return false;\n\n }", "protected function is_edit_page() {\r\n return false;\r\n }", "public function is_edit_page() {\n\t\treturn ( ! empty( $_GET[ Plugin::instanc...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Lists all available search servers.
function drush_search_api_server_list() { /** @var \Drupal\search_api\ServerInterface[] $servers */ $servers = Server::loadMultiple(); if (empty($servers)) { drush_print(dt('There are no servers present.')); return; } $rows[] = [ dt('ID'), dt('Name'), dt('Status'), ]; foreach ($servers as $server) { $rows[] = [ $server->id(), $server->label(), $server->status() ? dt('enabled') : dt('disabled'), ]; } drush_print_table($rows); }
[ "public function list_servers() {\n\t\t\treturn $this->run( 'servers' );\n\t\t}", "public function search()\n {\n switch ($this->server->game->Name) {\n case 'BFHL':\n $game = 'bfh';\n break;\n\n default:\n $game = strtolower($this->serv...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
$terms_arr = explode(' ',$terms); case insensitive in array
function case_in_array($string,$array){ foreach($array as $val){ if(strcasecmp($string, $val) == 0) return true; } return false; }
[ "protected function parseSearchTerms(array $terms)\n {\n $strtolower = function_exists('mb_strtolower') ? 'mb_strtolower' : 'strtolower';\n $checked = [];\n\n $stopwords = $this->getSearchStopwords();\n\n foreach ($terms as $term) {\n // Keep before/after spaces when term i...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
returns the connected property table name.
public function GetPropertyTableNameFrontend() { $sTableName = $this->oDefinition->GetFieldtypeConfigKey('connectedTableName'); if (empty($sTableName)) { if (!empty($this->oDefinition->sqlData['field_default_value'])) { $sTableName = $this->oDefinition->sqlData['field_default_value']; } } if (empty($sTableName)) { $sTableName = $this->name; } return $sTableName; }
[ "public function GetConnectedTableName()\n {\n if (!is_null($this->oTableRow) && array_key_exists($this->getTableFieldName(), $this->oTableRow->sqlData)) {\n $sTableName = $this->oTableRow->sqlData[$this->getTableFieldName()];\n } else {\n $sTableName = '';\n }\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Capture PDO error information
private function getPDOError() { if ($this->dbh->errorCode() != '00000') { $arrayError = $this->dbh->errorInfo(); $this->outputError($arrayError[2]); } }
[ "public function testPDOErrorInfo()\n {\n $this->assertException(PDOException::class, function () {\n Connection::create('foo:bar');\n }, function (PDOException $exception) {\n $this->assertEquals('', $exception->getQuery());\n $this->assertEquals([], $exception->ge...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ this function will follow specific user given params:
public function follow() { }
[ "function followUser($connection, $user_to_follow) {\n\t$follow = $connection->post(\"friendships/create\", [\"user_id\" => $user_to_follow]);\n}", "public function follow($user) {\n\t\t$this->redis()->sAdd(\"graph:user:{$this->id}:following\", $user);\n\t\t$this->redis()->sAdd(\"graph:user:$user:followed_by\", $...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Topic original cluster. Generated from protobuf field string cluster = 2;
public function getCluster() { return $this->cluster; }
[ "public function getAnthosCluster()\n {\n return $this->readOneof(17);\n }", "public function getCluster();", "public function getClusterId()\n {\n return isset($this->cluster_id) ? $this->cluster_id : '';\n }", "public function getOnPremCluster()\n {\n return $this->readOn...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
The status of the campaign. When a new campaign is added, the status defaults to ENABLED. Generated from protobuf field .google.ads.googleads.v14.enums.CampaignStatusEnum.CampaignStatus status = 5;
public function setStatus($var) { GPBUtil::checkEnum($var, \Google\Ads\GoogleAds\V14\Enums\CampaignStatusEnum\CampaignStatus::class); $this->status = $var; return $this; }
[ "public function setStatus($var)\n {\n GPBUtil::checkEnum($var, \\Eolymp\\Judge\\Activity_Status::class);\n $this->status = $var;\n\n return $this;\n }", "function getCampaignStatus() {\r\n $status = '';\r\n if ($this->campaign_id != null) {\r\n $campaign = List...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Check if current user is an editor
public function is_editor() { return current_user_can('editor') || current_user_can('administrator'); }
[ "public function userIsEditor()\n {\n return $this->userHasRole('editor');\n }", "public function isEditor(){\n\t\tif($_SESSION['waf_user']['editor']==1)return true;\n\t\telse return false;\n\t}", "function auth_isEditor(){\n\treturn auth_role('editor');\n}", "function isEditor() {\n\treturn logg...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Search movies on movie title.
public function searchTitleMovies($searchTitle) { $this->db->connect(); $sql = "SELECT * FROM movie WHERE title LIKE ?;"; return $this->db->executeFetchAll($sql, [$searchTitle]); }
[ "public function searchMovie($title): void;", "public function searchByTitle($title)\n {\n $searchUrl = $this->apiUrl.$this->apiKey.\"/search/movie/title/\".$title.\"/fuzzy\";\n $searchResponse = file_get_contents($searchUrl);\n $searchObj = json_decode($searchResponse, true);\n\n r...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
getCurrentImage return the currently loaded image for the image element at index
public function getCurrentImage($index = 0) { $img = $this->webdriver->executeJS("var img=document.querySelectorAll('img')[" . $index . '];return getImageDimensions(img)'); return $img; }
[ "private function currentImage()\n {\n return $this->wrapper->path . $this->current_image;\n }", "public function getimageindex(){}", "public function current(): ImageCandidateInterface\n {\n return $this->imageCandidates[$this->pointer];\n }", "public function getMainImage()\n {\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
The compression types supported by the client. Generated from protobuf field repeated .google.cloud.webrisk.v1beta1.CompressionType supported_compressions = 3;
public function getSupportedCompressions() { return $this->supported_compressions; }
[ "final public static function getSupportedCompression () {}", "protected function getCompressionType()\n {\n return $this->compression_type;\n }", "public static function getSupportedCompressionAlgorithms(): array\n {\n $algos = ['none']; // REQUIRED no compression\n if (fun...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get the intervient indem preca.
public function getIntervientIndemPreca(): ?bool { return $this->intervientIndemPreca; }
[ "public function getIndemCpIntervientBrutAl() {\n return $this->indemCpIntervientBrutAl;\n }", "public function getPrenomIntervenant() {return $this->prenomIntervenant;}", "public function getInterconsulta_a()\r\n\t{\r\n\t\treturn($this->interconsulta_a);\r\n\t}", "public function imc(){\n\t\treturn...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Add a product to the cart and reduce stock level of product without affecting versions of product
function testAddProductToCartReduceStock() { $productA = $this->objFromFixture('Product', 'productA'); $this->assertEquals(4, $productA->StockLevel()->Level); //Stock starts one down because of orderOneItemOne $this->logInAs('admin'); $productA->doPublish(); $this->logOut(); $versions = DB::query('SELECT * FROM "Product_versions" WHERE "RecordID" = ' . $productA->ID); $versionsAfterPublished = array(); foreach ($versions as $versionRow) $versionsAfterPublished[] = $versionRow; $variations = $productA->Variations(); $this->assertEquals(false, $variations->exists()); $this->get(Director::makeRelative($productA->Link())); $this->submitForm('AddToCartForm_AddToCartForm', null, array( 'Quantity' => 1 )); $productA = $this->objFromFixture('Product', 'productA'); $this->assertEquals(3, $productA->StockLevel()->Level); $this->get(Director::makeRelative($productA->Link())); $this->submitForm('AddToCartForm_AddToCartForm', null, array( 'Quantity' => 2 )); $productA = $this->objFromFixture('Product', 'productA'); $this->assertEquals(1, $productA->StockLevel()->Level); //Make sure a new version of the product was NOT created $versions = DB::query('SELECT * FROM "Product_versions" WHERE "RecordID" = ' . $productA->ID); $versionsAfterStockChanges = array(); foreach ($versions as $versionRow) $versionsAfterStockChanges[] = $versionRow; $this->assertTrue($versionsAfterPublished == $versionsAfterStockChanges); }
[ "public function addAction()\n {\n $cart = $this->_getCart();\n $params = $this->getRequest()->getParams();\n\n if($params['isAjax'] == 1){\n $response = array();\n try {\n if (isset($params['qty'])) {\n $filter = new Zend_Filter_Loca...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Method called to associate a LyricTopPopularity object to this object through the LyricTopPopularity foreign key attribute.
public function addLyricTopPopularity(LyricTopPopularity $l) { if ($this->collLyricTopPopularities === null) { $this->initLyricTopPopularities(); $this->collLyricTopPopularitiesPartial = true; } if (!$this->collLyricTopPopularities->contains($l)) { $this->doAddLyricTopPopularity($l); if ($this->lyricTopPopularitiesScheduledForDeletion and $this->lyricTopPopularitiesScheduledForDeletion->contains($l)) { $this->lyricTopPopularitiesScheduledForDeletion->remove($this->lyricTopPopularitiesScheduledForDeletion->search($l)); } } return $this; }
[ "public function setPopularity($v)\n {\n if ($v !== null) {\n $v = (int) $v;\n }\n\n if ($this->popularity !== $v) {\n $this->popularity = $v;\n $this->modifiedColumns[LyricTableMap::COL_POPULARITY] = true;\n }\n\n return $this;\n }", "publ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Publish Files for AvoRed Brand Modules.
public function publishFiles() { $this->publishes([ __DIR__ . '/../resources/views' => base_path('themes/avored/default/views/vendor') ],'avored-module-views'); $this->publishes([ __DIR__ . '/../database/migrations' => database_path('avored-migrations'), ]); }
[ "public function publishFiles() {\n\n $this->publishes([\n __DIR__ . '/../resources/views' => base_path('themes/avored/default/views/vendor')\n ],'avored-module-views');\n\n $this->publishes([\n __DIR__ . '/../database/migrations' => database_path('avored-migrations'),\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Public Static Member Functions Name: get_current_workshops() Desc: Returns the current workshops.
public static function get_current_workshops() { if ( !self::$current_workshops ) { // Get the current workshops. self::$current_workshops = Legato_Resource::order_by( 'time', 'asc' )-> fetch( 'Workshop', array( 'advisor_id' => $GLOBALS['advisor']->get( 'id' ), 'time >' => time() ) ); } // Return the current workshops. return self::$current_workshops; }
[ "protected function getShops()\n {\n $shops = Shop::getShops();\n\n if (Shop::isFeatureActive()) {\n if (0 < $this->shopId) {\n if (isset($shops[$this->shopId])) {\n RetailcrmLogger::writeDebug(\n __METHOD__,\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get an empty closure.
public static function getClosure() { return function() {}; }
[ "public function getClosure(): \\Closure;", "function lempty(): Closure {\n return fn($x) => empty($x);\n}", "public function getClosure()\n {\n }", "public final function getClosure() : \\Closure {\r\n return $this->_closure;\r\n }", "public function getClosure()\n {\n return f...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get the root element. Simple accessor to $rootElement
public function getRootElement() { return $this->rootElement; }
[ "public function getRootElement()\n {\n return $this->rootElement;\n }", "public function getRootElement()\n {\n return $this->document->documentElement;\n }", "function root()\n {\n return new Horde_DOM_Element($this->node->documentElement, $this);\n }", "public functio...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Set the post thumbnail for the specified post Id by getting a thumbnail of the specified asset.
function hewa_admin_set_post_thumbnail( $asset_id, $post_id ) { // Get the post title. $post = get_post( $post_id ); $post_title = $post->post_title; // Get the image from the remote server, then save it locally. $response = hewa_admin_request_still_image( $asset_id, HEWA_STILL_IMAGE_WIDTH, HEWA_STILL_IMAGE_TIMECODE_SECONDS ); $image_name = 'a' . $asset_id . '-w' . HEWA_STILL_IMAGE_WIDTH . '-s' . HEWA_STILL_IMAGE_TIMECODE_SECONDS . '.png'; $image = hewa_admin_save_response_body( $response['body'], $image_name ); // Create an attachment. $attachment = array( 'guid' => $image['guid'], // post_title, post_content (the value for this key should be the empty string), post_status and post_mime_type 'post_title' => $post_title, // Set the title to the post title. 'post_content' => '', 'post_status' => 'inherit', 'post_mime_type' => HEWA_STILL_IMAGE_CONTENT_TYPE ); // Create the attachment in WordPress and generate the related metadata. $attachment_id = wp_insert_attachment( $attachment, $image['path'], $post_id ); $attachment_data = wp_generate_attachment_metadata( $attachment_id, $image['path'] ); wp_update_attachment_metadata( $attachment_id, $attachment_data ); // Set it as the featured image. set_post_thumbnail( $post_id, $attachment_id ); }
[ "public function action_set_thumbnail_id(){\n $attachment_id = (int) services\\Request::req( 'attachment_id', false );\n $post_id = (int) services\\Request::req( 'post_id', false );\n if ($attachment_id != false || $post_id != false) :\n if (!is_int( $post_id )) return false;\n $this->Services->s...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Applies version to the supplied path.
protected function applyVersion($path, $version = null) { $file = $path; // apply the base path if ('/' !== substr($path, 0, 1)) { $file = '/'.$path; } $reved = $this->getRevedFilename($file); $fullpath = $this->rootDir . $file; $fullreved = $this->rootDir . $reved; // $reved or unversioned if (file_exists($fullreved)) { return $reved; // fallback } else { $pattern = preg_replace('/\.([^\.]+$)/', '.*.$1', $fullpath); $regex = preg_replace('/\.([^\.]+$)/', '\.[\d\w]{8}\.$1', $fullpath); $base = str_replace($path, '', $fullpath); foreach (glob($pattern) as $filepath) { if (preg_match('#' . $regex . '#', $filepath)) { $result = str_replace($base, '', $filepath); $this->summary->set($file, $result); return $result; } }; } return $path; }
[ "public function applyVersion($path);", "public function applyVersion($path)\n {\n $reved = $this->getRevedFilename($path);\n\n $absPath = implode(DIRECTORY_SEPARATOR, [$this->rootDir,$path]);\n $absReved = implode(DIRECTORY_SEPARATOR, [$this->rootDir,$reved]);\n\n // $reved or unve...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Players at duplicate ips.
public static function dupedIps() { $host= gethostname(); $server_ip = gethostbyname($host); // Get name, id, and ip from players, grouped by ip matches return query( 'select uname, player_id, days, last_ip from players left join account_players on player_id = _player_id left join accounts on _account_id = account_id where uname is not null and active = 1 and last_ip in (SELECT last_ip FROM accounts WHERE (operational = true and confirmed = 1) and (last_ip != \'\' and last_ip != \'127.0.0.1\' and last_ip != :server_ip) GROUP BY last_ip HAVING count(*) > 1 ORDER BY count(*) DESC limit 30) order by last_ip, days ASC limit 300', [':server_ip'=>$server_ip] ); }
[ "public static function dupedIps(){\n $host= gethostname();\n $server_ip = gethostbyname($host);\n // Get name, id, and ip from players, grouped by ip matches\n return query(\n 'select uname, player_id, days, last_ip from players left join account_players on player_id = _playe...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Test case for postTransaction Submit Tx.
public function testPostTransaction() { }
[ "public function test_postTransaction() {\n\n }", "public function testProjectTransactionPost()\n {\n }", "public function testJournalTransactionPost()\n {\n }", "public function testCreateFundingTransactionUsingPost()\n {\n }", "public function testTransactionPostUnspent()\n {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Handle an exception in a way that results to an error page.
public function showErrorPage(Exception $exception);
[ "protected abstract function renderErrorPage(Request $request, Response $response, HttpException $e);", "public function errorAction()\n\t{\n\t\t// sets the 404 header\n\t\theader(\"HTTP/1.0 404 Not Found\");\n\t\t\n\t\t// sets the error to be rendered in the view\n\t\t$this->view->error = $this->_exception->getM...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns with the URL to edit the Quote
public function generate_editurl(Order $quote) { $url = $this->generate_quotesredirurl(); $url->query->setData(array('action' => 'edit-quote', 'qnbr' => $quote->quotnbr)); return $url->getUrl(); }
[ "public function generate_editURL(Order $quote) {\n\t\t\t$url = new URL(parent::generate_editURL($quote));\n\t\t\t$url->query->set('custID', $this->custID);\n\t\t\treturn $url->getUrl();\n\t\t}", "public function generate_editurl(Order $order);", "public function getEditUrl();", "public function editURL() {\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Operation createCatalogCategoryAsyncWithHttpInfo Create Catalog Category
public function createCatalogCategoryAsyncWithHttpInfo($catalog_category_create_query, $apiKey = null) { $returnType = 'array<string,mixed>'; $request = $this->createCatalogCategoryRequest($catalog_category_create_query, $apiKey); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { $content = json_decode($content); } } $parsed_content = json_decode(json_encode($content), TRUE); if (json_last_error() != JSON_ERROR_NONE) { $parsed_content = $content; } return [ $parsed_content, $response->getStatusCode(), $response->getHeaders() ]; }, function ($exception) { $response = $exception->getResponse(); $statusCode = $response->getStatusCode(); throw new ApiException( sprintf( '[%d] Error connecting to the API (%s)', $statusCode, $exception->getRequest()->getUri() ), $statusCode, $response->getHeaders(), (string) $response->getBody() ); } ); }
[ "public function createCategoryAsyncWithHttpInfo($body = null)\n {\n $returnType = '\\Swagger\\Client\\Model\\Category';\n $request = $this->createCategoryRequest($body);\n\n return $this->client\n ->sendRequestAsync($request, $this->createHttpClientOption())\n ->then(\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets as paymentAlternativeCurrencyCode BBIE Invoice. Payment Alternative_ Currency Code. Code A code signifying the alternative currency used for payment in the Invoice. 0..1 Invoice Payment Alternative Currency Code Code Currency Currency_ Code. Type
public function getPaymentAlternativeCurrencyCode() { return $this->paymentAlternativeCurrencyCode; }
[ "public function getPaymentCurrencyCode()\n {\n return (string) $this->getDataUtils()->invokeGet($this, 'getOrderPayment', 'getCurrency');\n }", "public function getCurrencyCodeType($currency);", "public function getCurrencyCode() { return $this->currencyCode; }", "public function getCurrencyCode...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Shooting power for the ranger.
public function shoot_power() { return 3; }
[ "public function PowerOn()\n\t\t{\n\t\t\t$LW12 = $this->init();\n\t\t\t$LW12->PowerOn();\n\n\t\t\tSetValue($this->GetIDForIdent(\"power\"), $LW12->power);\n\t\t}", "public function turnTurretRight()\n {\n }", "public function set_power()\n {\n $this->battery_power = 100;\n }", "public function ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns an array of parameters to attach to the checkbox tag. Includes whether the checkbox should appear as checked. Will try the callback first, and if not present, will try overridden functions.
public function getCheckboxParams($item) { $aParams = array(); if ($strId = $this->getCheckboxId($item)) { $aParams['id'] = $strId; } if ($this->isChecked($item)) { $aParams['checked'] = 'checked'; } if ($strName = $this->getCheckboxName($item)) { $aParams['name'] = $strName; // name is not used by QCubed } $aParams['value'] = $this->getCheckboxValue($item); // note that value is required for html checkboxes, but is not used by QCubed if ($this->checkParamCallback) { $a = call_user_func($this->checkParamCallback, $item); $aParams = array_merge($aParams, $a); } return $aParams; }
[ "function acf_get_checkbox_input($attrs = array()) {}", "function acf_get_checkbox_input($attrs = array())\n{\n}", "function checkbox( $args = '', $checked = false ) {\n\t\t\t$defaults = array( \n\t\t\t\t'name' => '', \n\t\t\t\t'id' => false,\n\t\t\t\t'class' => false, \n\t\t\t\t'group' => false,\n\t\t\t\t'spec...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
testeSelectPorMaisDeUmParametro ..:: Teste do metodo 'selectFilme' de selecao de um (ou mais) registro(s) na tabela tFilme.xml ::.. Comportamento esperado: Selecao de um ou mais registros que satisfazem as condicoes nos parametros; A selecao por um ou mais parametros (metodo 'selectFilme') retorna um array do tipo SimpleXMLElement.
function testeSelectPorMaisDeUmParametro(){ $oFilme = new lFilme(); $oFilme->createTableFilme(); $oFilme->insertFilmeCompleto("Teste, o Filme parte 1", "Teste de Inserção por Parâmetro.","Ação", "1993", "5", "Armando Barracas", "Antonio Banderas e Gessica Alba"); $oFilme->insertFilmeCompleto("Teste, o Filme parte 2", "Teste de Inserção por Parâmetro.","Suspense", "1994", "5","Armando Barracas", null); /* ..:: Selecao utilizando multiplos campos ::.. */ print_r($oFilme->selectFilme(null,null, "Teste de Inserção por Parâmetro.",null,null, "5", "5", "Armando Barracas")); }
[ "function testeSelectPorUmParametro(){\n $oFilmeSubscriber = new lFilmeSubscriber();\n $oFilmeSubscriber->createTableFilmeSubscriber();\n print_r($oFilmeSubscriber->insertFilmeSubscriberCompleto(\"Template, o Filme\", \"teste.1@email.com\"));\n print_r($oFilmeSubscriber->insertFilmeSubscriberCompleto(\"...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Wrapper method for the permission object's own checkRightLevel method.
function checkRightLevel($rights, $owner_user_id, $owner_group_id) { $level = $this->checkRight($rights); if (is_a($this->_perm, 'LiveUser_Perm_Complex')) { $level = $this->_perm->checkLevel($level, $owner_user_id, $owner_group_id); } return (bool)$level; }
[ "function permissionCheck($priv)\n {\n $authlevels = array('post-only', 'normal', 'tech', 'admin');\n\n // First, get to the requested level in the level stack\n for ($i = 0; $i < count($authlevels); $i++)\n {\n if ($authlevels[$i] == $priv)\n {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ Plugin Name: Supersimple Pinterest Widget Plugin URI: Description: This is a lightweight Wordpress plugin to display your recent Pinterest pins. Version: 0.1 Installation: 1. Copy pinterest_widget.php to your plugins folder, /wpcontent/plugins/ 2. Activate it through the plugin management screen. 3. Go to Themes>Sidebar Widgets and drag and drop the widget to wherever you want to show it. This plugin is heavilyinspired by the Flickr Widget by Donncha O Caoimh
function widget_pinterest($args) { if( file_exists( ABSPATH . WPINC . '/rss.php') ) { require_once(ABSPATH . WPINC . '/rss.php'); } else { require_once(ABSPATH . WPINC . '/rss-functions.php'); } extract($args); $options = get_option('widget_pinterest'); if( $options == false ) { $options[ 'title' ] = 'Pinterest Pins'; $options[ 'items' ] = 3; } $title = empty($options['title']) ? __('My Pinterest Pins') : $options['title']; $items = $options[ 'items' ]; $pinterest_rss_url = empty($options['pinterest_rss_url']) ? __('http://pinterest.com/paulsciarra/feed.rss') : $options['pinterest_rss_url']; if ( empty($items) || $items < 1 || $items > 15 ) $items = 3; $rss = fetch_rss( $pinterest_rss_url ); if( is_array( $rss->items ) ) { $out = ''; $items = array_slice( $rss->items, 0, $items ); while( list( $key, $pin ) = each( $items ) ) { preg_match_all("/<IMG.+?SRC=[\"']([^\"']+)/si",$pin[ 'description' ],$sub,PREG_SET_ORDER); $pin_url = str_replace( "_m.jpg", "_t.jpg", $sub[0][1] ); $out .= "<li><a href='{$pin['link']}'><img alt='".wp_specialchars( $pin[ 'title' ], true )."' title='".wp_specialchars( $pin[ 'title' ], true )."' src='$pin_url' border='0'><h4>".wp_specialchars( $pin[ 'title' ], true )."</h4></a></li>"; } $pinterest_home = $rss->channel[ 'link' ]; $pinterest_more_title = $rss->channel[ 'title' ]; } ?> <?php echo $before_widget; ?> <!-- Start of Pinterest Badge --> <!-- Start Custom CSS for Pinterest Widget --> <style media="screen" type="text/css"> /* Pinterest Plugin */ #pint_badge_uber_wrapper { background-color: #f6f6f6; /* border-top: 2px solid #ececec; border-bottom: 2px solid #ececec;*/ -moz-box-shadow: inset 0px 0px 10px rgba(0,0,0,0.1); -webkit-box-shadow: inset 0px 0px 10px rgba(0,0,0,0.1); box-shadow: inset 0px 0px 10px rgba(0,0,0,0.1); margin-right: -20px; margin-left: -24px; border-right: 4px solid #d89994; overflow: auto; } #pint_badge_uber_wrapper ul, #pint_badge_uber_wrapper ul li{ list-style: none; overflow: auto; margin: 0; padding: 0; } #pint_badge_uber_wrapper ul { clear: both; padding: 7px 5px 7px 20px; position: relative; top: -5px; } #pint_badge_uber_wrapper ul li a h4 { font-size: 11px; margin: 9px 4px 4px; color: #bdbdbd; font-weight: normal; font-style: normal; } #pint_badge_uber_wrapper ul li { float: left; background-color: #ffffff; -moz-box-shadow: 0px 0px 10px rgba(0,0,0,0.1); -webkit-box-shadow: 0px 0px 10px rgba(0,0,0,0.1); box-shadow: 0px 0px 10px rgba(0,0,0,0.1); text-align: center; padding: 15px 10px 10px; margin-right: 18px; margin-bottom: 15px; width: 20%; height: 210px; overflow: hidden; } #pint_badge_uber_wrapper ul li a img { max-height: 150px; max-width: 150px; border: 1px solid #f2f2f2; } #more-pins { display: block; float: left; padding: 10px 7px 10px 19px; color: #a5a5a5; font-size: 15px; } a#more-pins:hover { color: #77afb5; } #more-pins img { margin-bottom: -3px; margin-right: 4px; } #fork { float: right; padding: 4px 9px 4px 21px; background: url(images/fork.png) no-repeat 6px 5px; font-size: 13px; margin-top: 8px; margin-right: 21px; opacity: 0.2; color: #4a4a4a; border-radius: 5px; -moz-border-radius: 5px; -webkit-border-radius: 5px; } a#fork:hover{ float: right; padding: 4px 9px 4px 21px; background: url(images/fork.png) no-repeat 6px -20px #979797; font-size: 13px; margin-top: 8px; margin-right: 21px; opacity: 1; color: #ffffff; border-radius: 5px; -moz-border-radius: 5px; -webkit-border-radius: 5px; } </style> <!-- End Custom CSS for Pinterest Widget --> <div id="pint_badge_uber_wrapper" cellpadding="0" cellspacing="10" border="0"> <a href="https://github.com/Ethanhackett/Beautiful-super-simple-Pinterest-widget" target="_blank" id="fork" title="fork this modified wordpress plugin">Fork</a> <a href="<?php echo strip_tags( $pinterest_home ) ?>" id="more-pins"><img src="<?php bloginfo( 'url' ); ?>/wp-content/plugins/super-simple-pinterest-plugin/pinterest.png" width="78px" height="20px"> View Pins</a> <ul> <?php echo $out ?> </ul> </div> <!-- End of Pinterest Badge --> <?php echo $after_widget; ?> <?php }
[ "function register_MD_Widget_Pinterest() {\n register_widget( 'MD_Widget_Pinterest' );\n}", "public function FPG_widget(){\n //widget setting\n if(is_admin()){\n add_action('admin_print_styles',array($this,'widgetEnqueueAdminStuff'));\n }else{\n add_action('init',arra...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Test adding filters to all subitems
public function testAddFilter() { $filter = new Formagic_Filter_Mock_MockFilter(); $container = $this->_getContainerWithItems(); $container->addFilter($filter); foreach ($container as $item) { $this->assertTrue($item->hasFilter('Mock_MockFilter')); } }
[ "public function test_add_filters() {\n\n\t\t// Check for Divi.\n\t\tLLMS_Blocks_Page_Builders::add_filters();\n\t\t$this->assertFalse( has_filter( 'llms_blocks_is_post_migrated', array( 'LLMS_Blocks_Page_Builders', 'check_for_divi' ) ) );\n\n\t\tdefine( 'ET_BUILDER_VERSION', 1 );\n\t\tLLMS_Blocks_Page_Builders::ad...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Display admin notice for incompatible WP version.
function yks_debug_wp_version_notice(): void { printf( '<div class="error"><p>%s</p></div>', sprintf( /* translators: %1$s is the required WP version, %2$s is the current version */ esc_html__( 'YIKES Debug Matrix requires WordPress version %1$s or above. Your site is using WordPress version %2$s.', 'yikes-debug-matrix' ), esc_html( YIKES_MATRIX_WP ), esc_html( $GLOBALS['wp_version'] ) ) ); }
[ "function version_warning()\r\n\t{\r\n\t\techo '<div class=\"updated fade\"><p><strong>'.__('LiveAdmin requires WordPress version 2.7 or later!', 'liveadmin').'</strong></p></div>';\r\n\t}", "static function notice_min_wp_version() {\n echo '<div class=\"error\"><p>' . sprintf(__('UnderConstruction plugin <b>r...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get Autoloader class instance with initialized to autoload.
function autoloader() { return Autoloader::instance()->initialize(new Autoload()); }
[ "private function getAutoloader()\n\t{\n\t\tif ($this->autoloader === null) {\n\t\t\t$this->autoloader = new Autoloader;\n\t\t}\n\n\t\treturn $this->autoloader;\n\t}", "public static function getLoader()\n {\n if (!self::$autoLoader) {\n self::$autoLoader = include __DIR__ . \"/../vendor/auto...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets a new hasChangeSensitivity Whether change threshold can be specified for updates. Default is true.
public function setHasChangeSensitivity($hasChangeSensitivity) { $this->hasChangeSensitivity = $hasChangeSensitivity; return $this; }
[ "public function getHasChangeSensitivity()\n {\n return $this->hasChangeSensitivity;\n }", "public function setSensitivity($sensitivity)\n {\n $this->sensitivity = $sensitivity;\n return $this;\n }", "public function setSensitivity($val)\n {\n $this->_propDict[\"sensit...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
End time in which this feed item is no longer effective and will stop serving. The time is in the customer's time zone. The format is "YYYYMMDD HH:MM:SS". Examples: "20180305 09:15:00" or "20180201 14:34:30" Generated from protobuf field optional string end_date_time = 27;
public function getEndDateTime() { return isset($this->end_date_time) ? $this->end_date_time : ''; }
[ "function end_time($end_time=null)\n {\n if (isset($end_time)) $this->end_time = $end_time;\n return $this->end_time;\n }", "public function getEndTime()\n {\n $time = $this->eventdatetime->endtime;\n\n if (empty($time)) {\n return $time;\n }\n\n if ($...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Testing of ResponseParser interceptor
public function testResponseParserOnPreParse() { $client = new Client('http://localhost'); $client->setTransport(new Transport()); $client->setIdGenerator(new IdGenerator()); $client->getResponseParser()->onPreParse() ->add(Interceptor::createWith(function (ParserContainer $container) { $response = $container->getValue(); $result = $response['result']; $userMap = ['id', 'email', 'name']; // result is user map if (is_array($result) && 0 === count(array_diff($userMap, array_keys($result)))) { $response['result'] = new User($result['id'], $result['email'], $result['name']); } return new ParserContainer($container->getParser(), $response); })); $user = $client->call('User.getOne', [8]); /** @var User $user */ $this->assertInstanceOf(User::class, $user); $this->assertEquals(8, $user->id); $this->assertEquals('vader@angry.mil', $user->email); $this->assertEquals('vader', $user->name); }
[ "public function test_parseresponse_returns_response_object_on_valid_response(): void\n {\n $tag = TagFactory::createTag('LSUB \"\" \"*\"');\n $actual = ResponseFactory::parseResponse($tag->getPrefix(), sprintf(\"%s OK Lsub completed (0.001 + 0.000 + 0.001 secs).\", $tag->getPrefix()));\n\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
cURL callback method, outputs data as soon as any is received
private function curl_callback($curl_handle, $data) { echo $data; flush(); return strlen($data); }
[ "function callback()\n\t{\n\t\tif($_SERVER['REQUEST_METHOD'] == \"GET\")\n {\n\t\t\t\t$challenge = $_SERVER['QUERY_STRING'];\n\t\t\t\t$get_array = explode(\"&\", $challenge);\n\t\t\t\tfor($i=0;$i<count($get_array);$i++)\n\t\t\t\t{\n\t\t\t\t\t$check = $get_array[$i];\n\t\t\t\t\tif(strstr($check,\"hub.challenge\")...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
If centrallock_on is on, all other electronic devices have to be off
public function setCentrallock_on($loc_activate) { if ($this->centrallock=="yes") { if ($loc_activate=="on") { $this->centrallock_on="on"; } else { $this->centrallock_on="off"; } } else { $this->centrallock_on="not installed"; } }
[ "public function off($sync = true)\n\t{\n\t\tif( $sync )\tsystem('echo standby 0 | /usr/local/bin/cec-client -s -d 1');\n\t\telse system('echo standby 0 | /usr/local/bin/cec-client -s -d 1 > /dev/null 2>&1');\n\t}", "function eis_device_poweroff() {\n\tglobal $eis_conf,$eis_dev_conf,$eis_dev_status,$eis_mysqli;\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Function to get subject list based on program
public function fnListSubject($lintIdprogram){ $lobjDbAdpt = Zend_Db_Table::getDefaultAdapter(); $lstrSelect = $lobjDbAdpt->select() ->from(array('a'=>'tbl_landscapesubject'),array("")) ->joinLeft(array('b'=>'tbl_subjectmaster'), 'b.IdSubject = a.IdSubject' ,array("key"=>"b.IdSubject","value"=>"CONCAT_WS('-',IFNULL(b.SubjectName,''),IFNULL(b.SubCode,''))")) ->where('b.Active = 1') ->where('a.IdProgram = ?',$lintIdprogram ) ->group("a.IdSubject") ->order("b.SubjectName"); $larrResult = $lobjDbAdpt->fetchAll($lstrSelect); return $larrResult; }
[ "function getSubjectList()\n{\n return array(\n 1 => \"MATH\",\n 2 => \"CHEMIST\",\n 3 => \"PHYSIC\",\n 4 => \"BIO\",\n );\n}", "public function subjects($program=null)\n {\n $uri = $this->uri.'subjects';\n $response = $this->getRequest($uri)->getBody()->getC...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Check if url exist
function diy_exist_url($url) { $file_headers = @get_headers($url); if(!$file_headers || $file_headers[0] == 'HTTP/1.1 404 Not Found') { return false; } return true; }
[ "function url_exists($url){ \r\n $url_data = parse_url($url); // scheme, host, port, path, query\r\n if(!fsockopen($url_data['host'], isset($url_data['port']) ? $url_data['port'] : 80)){\r\n $this->set_message('url_exists', 'The URL you entered is not acces...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Inserts or updates a Repository
public function upsertRepository(Repository $entity): void;
[ "public function updateOrInsert();", "abstract function saveRepository($repositoryObject, $update = false);", "public function updateOrInsert(){}", "public function insertRepo($repo = [])\n\t{\n\t\t// Sets INSERT SQL statement with all repository values\n\t\t$sql = \"INSERT INTO {$this->config->table} VALUES(...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ Too Short / Long
function isToo($v,$t='',$min=3,$max=50){ if(strlen($v)<=$min){return showIn($t,'page') . calglb_too_short;} else if(strlen($v)>=$max){return showIn($t,'page') . calglb_too_long;} else{return '';} }
[ "function isToo($v,$t='',$min=3,$max=50){\n\n\tif(strlen($v)<=$min){return showIn($t,'page') . letheglobal_too_short;}\n\telse if(strlen($v)>=$max){return showIn($t,'page') . letheglobal_too_long;}\n\telse{return '';}\n}", "function ssba_shorten($urlLong) {\n\t\n\t\t// get results from bitly and return short url\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns current API URL
public function getApiUrl() { return $this->API_URL; }
[ "private function getApiUrl()\n\t\t{\n\t\t\treturn $this->apiurl;\n\t\t}", "public function getAPIURL() {\n\n\t\t$url = trailingslashit( $this->apiURL );\n\n\t\treturn $url;\n\t}", "public function get_api_url() {\n\t\n\t\treturn apply_filters('keyy_get_api_url', 'https://'.self::API_SERVER.'/v1/');\n\t}", "p...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Set the Altar credits to a custom value Original: and the master sword
public function setAltarCredits(string $string) { $write_string = str_pad(substr($string, 0, 20), 20, ' ', STR_PAD_BOTH); $offset = 0x76C81; foreach ($this->convertCredits($write_string) as $byte) { $this->write($offset++, pack('C', $byte)); } return $this; }
[ "private function modifyLeather()\n {\n $this->randomizeLucky();\n if ($this->isLucky) {\n $this->baseName = sprintf('%s %s', 'Hard', $this->baseName);\n $this->baseShield = $this->baseShield*3;\n }\n }", "public function setAltarCredits(string $string) : self {\n\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Method to get an image filter instance of a specified type.
protected function getFilterInstance($type) { // Sanitize the filter type. $type = strtolower(preg_replace('#[^A-Z0-9_]#i', '', $type)); // Verify that the filter type exists. $className = 'JImageFilter' . ucfirst($type); if (!class_exists($className)) { JLog::add('The ' . ucfirst($type) . ' image filter is not available.', JLog::ERROR); throw new RuntimeException('The ' . ucfirst($type) . ' image filter is not available.'); } // Instantiate the filter object. $instance = new $className($this->handle); // Verify that the filter type is valid. if (!($instance instanceof JImageFilter)) { // @codeCoverageIgnoreStart JLog::add('The ' . ucfirst($type) . ' image filter is not valid.', JLog::ERROR); throw new RuntimeException('The ' . ucfirst($type) . ' image filter is not valid.'); // @codeCoverageIgnoreEnd } return $instance; }
[ "function getFilter ($type) {\n $filters = $this->getFilters();\n return $filters[$type];\n }", "private function findFilter($type)\n {\n // Is this an attribute filter?\n if ($attribute = $this->getAttribute($type)) {\n $type = $attribute->type;\n }\n\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }