query
stringlengths
10
8.11k
document
stringlengths
17
398k
negatives
listlengths
19
20
metadata
dict
Creates a new order from simple data arrays
public function createFromDataArray(array $data, array $items): Order;
[ "public function reorder(array $data);", "private function _setOrderDataArray()\n {\n foreach ($this->orderCollection->getItems() as $order){\n $this->_prepareOrderStatusArray($order);\n $this->_prepareOrderPaymentArray($order);\n\n $this->_prepareOrderTrackingArray($ord...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
$sql = "SELECT vmd_user, vmd_pass FROM users_groups WHERE group_id='". $this>session>userdata('group_id') ."' AND vmd_user!='' and vmd_pass!='' LIMIT 1";
function getVMD() { $sql = 'SELECT vmd_user, vmd_pass FROM users_groups WHERE id = ? AND vmd_user != "" and vmd_pass != "" LIMIT 1'; //$query = $this->db->query($sql); $results = \DB::select($sql, array(\Session::get('group_id'))); //if($query->num_rows() > 0) { if(count($results) > 0) { $row = (array) ...
[ "function get_assessor_by_group()\n { //check User_login and Pass_login in database\n $sql = \"SELECT *\n\t\t\tFROM pefs_database.pef_group_assessor \n WHERE gro_grp_id =? \n\t\t\t\";\n $query = $this->db->query($sql, array($this->gro_grp_id));\n return $query;\n }", "functi...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get the count of daily active users in the reporting period by product.
function getOffice365ActiveUserCounts($period){ return $this->addReportQuery("getOffice365ActiveUserCounts",$period); }
[ "function logUsersPerDay(){\n \n $time = time() - (60 * 60 * 24);\n $dbq = db_query(\"SELECT count(*) as count FROM users WHERE access>='\". $time .\"' AND status='1'\");\n $all = $dbq -> fetchObject();\n \n $this->setAction('users-active', $all -> count);\n }", "public function getActDailyReco...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Stampa la form dei custosm fields di buddypress espandendo la classe walker
function tvox_bd_uplaoder_custom_fields( $item_id ) { // Stampo gli imput fields echo( '<label for="tvox_bd_title">Title</label>' ); echo( '<input type="text" name="tvox_bd_title" class="buddydrive-customs" value="' . esc_attr( get_post_meta( $item_id, 'tvox_bd_title', TRUE ) ) . '" />' ); echo( '<label for="tv...
[ "function gmw_search_form_custom_fields( $gmw ) {\r\n\t\techo gmw_get_search_form_custom_fields( $gmw );\r\n\t}", "public function item_custom_fields_to_form() {\n // 1. special management for fields equipped with \"free\" checkbox\n // nothing to do: they don't exist in this plugin\n\n // 2....
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Return path to a hardcopy of $strFilename located in $strDstFolder filename is crypted, not content
public static function getCryptedCopy($strFilename, $strDstFolder) { $strPath = FileSystem::createCryptedPath( $strFilename, $strDstFolder ); if( FileSystem::fileExists($strPath) == false ) { copy( $strFilename, $strPath ); } return $strPath; }
[ "abstract protected function getDestinationFilePath();", "public function getDestinationFilePath();", "private function getDestinationDir()\n {\n if (empty($this->options->cloneDir)) {\n return trailingslashit(WPStaging::getWPpath() . $this->options->cloneDirectoryName);\n }\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Operation getUnpublishedItemCountAsyncWithHttpInfo Unpublished Item Counts
protected function getUnpublishedItemCountAsyncWithHttpInfo( string $fromDate, ): PromiseInterface { $returnType = '\Walmart\Models\MP\US\Insights\GetUnpublishedItemsCount'; $request = $this->getUnpublishedItemCountRequest($fromDate); $this->writeDebug($request); $this->write...
[ "public function countPublishedItems()\n\t{\n\t\t$total = $this->items()\n\t\t\t->whereEquals('published', self::STATE_PUBLISHED)\n\t\t\t->total();\n\n\t\treturn (int)$total;\n\t}", "public function countUnseenNewsItems(){\n return $this->newsModel->countUnseenNewsItems();\n }", "public function getUnviewed...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
When cloning some Entity that is NOT in detached mode, the cloning will create new Entity with the same properties but without ID. If the ID should be preserved, just invoke >detach on existing attached entity before its cloning. ATTENTION: The mapper of Entity is gonna be removed, so you cannot get reference to anothe...
public function __clone() { if (!$this->row->isDetached()) { $this->row = clone $this->row; $primaryKey = $this->mapper ->getPrimaryKey( $this->getReflection() ->getShortName() ...
[ "public function __clone()\n\t{\n\t\tif($this->isPersisted)\n\t\t{\n\t\t\t$this->isPersisted = false;\n\t\t\t$this->original = [];\n\t\t\t$this->related = [];\n\n\t\t\tunset($this->columns[$this->primaryKey]);\n\t\t}\n\t}", "public function __clone()\n\t\t{\n\t\t\t$aPrimaryKey = $this->oDatabase->GetTableP...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
converts mm to inches
function convert_mm_to_inches($mmsize) { if (strpos($mmsize, "x")!==false) { // separated by x $sizes = explode("x", $mmsize); $sep = 'x'; } elseif (strpos($mmsize, "&")!==false) { // separated by & $sizes = explode("&", $mmsize); $sep = '&'; ...
[ "private function inchesToMm($inches)\n {\n return $inches * 25.4;\n }", "function to_inches($mm,$denom) {\n #\n # Arguments:\n # mm - length in millimeters\n # denom - accuracy in fractions of an inch, e.g. 1/8, 1/16, etc.\n #\n $in_frac = round($mm/25.4*$denom,0,PHP_ROUND_HALF_UP)...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Store a newly created Shippingmethod in storage.
public function store(CreateShippingmethodRequest $request) { $input = $request->all(); $shippingmethod = $this->shippingmethodRepository->create($input); Flash::success('Shippingmethod saved successfully.'); return redirect(route('admin.shippingmethods.index')); }
[ "public function store(CreateShipmentMethodRequest $request)\n {\n $input = $request->all();\n\n $shipmentMethod = $this->shipmentMethodRepository->create($input);\n\n Flash::success('Shipment Method saved successfully.');\n\n return redirect(route('shipmentMethods.index'));\n }", ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets birth year, from the category Naissance en.
static public function get_birth_year ($name, $bypassCache = false) { $ds = new FrWikipediaDataSource($name); $categories = $ds->get_categories($bypassCache); foreach ($categories as $category) { $matches = []; if (preg_match('/Catégorie:Naissance en ([0-9]{4})/', $category, $matches)) { return $matches...
[ "public function getBirthYear();", "function getBirthYear(){\n\t\treturn $this->getBirthDate()->MinDate()->Format('Y');\n\t}", "private function getNIKYear()\n\t{\n\t\treturn intval(substr($this->nik, 10, 2));\n\t}", "public function getDeathYear() {\n\t\treturn $this->getDeathDate()->minimumDate()->format('%...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets a new operatorActionExtension
public function setOperatorActionExtension(\Calcinai\Siri\Objects\Datex\ExtensionType $operatorActionExtension) { $this->operatorActionExtension = $operatorActionExtension; return $this; }
[ "public function setAction(array $action): self;", "public function setCampaignExtensionSettingOperation($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Ads\\GoogleAds\\V8\\Services\\CampaignExtensionSettingOperation::class);\n $this->writeOneof(26, $var);\n\n return $this;\n }", "p...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Load configuration file $filename. It should have $settings variable of type array in it.
static function loadConfig($filename) { $settings = null; include $filename; // config file defines local array $settings if ($settings) { self::importConfig($settings); } }
[ "public static function load_settings_file($filename)\n {\n // Turn on output buffering to prevent accidental output.\n ob_start();\n include($filename);\n ob_get_clean();\n \n // We should now have an array $s with which to merge\n // the current settings.\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Function to find a all Categories for the Speakout feature on a network with topics This function find categories associated for the Speakout Feature on a network with their related topics.
public function getCategorysWithTopics(Doctrine_Query $q = null) { if (is_null($q)) { $q = Doctrine_Query::create() ->from('SpeakoutCategory sc'); } $rootAlias = $q->getRootAlias(); $q->leftJoin($rootAlias . '.SpeakoutTopic st'); return Doctrine_Core::getTable('SpeakoutTopic')...
[ "public function getCategories() {\n\t\t$probableCategories = [];\n\t\tforeach ( $this->features as $feature => $value ) {\n\t\t\tif ( $feature == 'countFace' ) {\n\t\t\t\t$probableCategories[] = 'Category:People';\n\t\t\t} else if ( $feature == 'percentFace' ) {\n\t\t\t\tif ( $value > 60 ) {\n\t\t\t\t\t$probableCa...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Prepares a HTTP Response from an exception.
public function prepareExceptionResponse(\Exception $result) { $serializer = $this->getSerializationHelper()->getExceptionSerializer($this->httpRequest); if (is_null($serializer)) { throw new Exception("No exception serializer found", 0, $result); } $statusCode = 500; if ($result instanceof HttpExcept...
[ "public function prepareExceptionResponse(\\Exception $result);", "protected function prepareResponse($request , Exception $e)\n\t{\n\t\tif ( !$this->isHttpException($e) ) {\n\t\t\treturn $this->toIlluminateResponse($this->convertExceptionToResponse($e) , $e);\n\t\t}\n\n\t\tif ( !$this->isHttpException($e) ) {\n\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Relate selected products to each other.
public function massRelateToEachOtherAction() { $this->_linkProductsToEachOther(self::LINK_TYPE_RELATED, 'Successfully related %d products to each other (%d new links, %d already existed).'); }
[ "function jigoshop_output_related_products() {\n\t\tjigoshop_related_products( 2, 2 );\n\t}", "function _assignProducts() {\n\t\t\t$productIds = array( );\n\t\t\tforeach ($this as $item) {\n\t\t\t\t$productIds[] = $item->getProductId( );\n\t\t\t}\n\n\t\t\t$this->_productIds = array_merge( $this->_productIds, $p...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Process webhook for cancelled payment.
public static function cancel_payment( $data ) { $webhook_data = $data->data; $payment_id = $webhook_data->id; $gateway_debug = 'yes' === WC_Admin_Settings::get_option( 'cko_gateway_responses', 'no' ); // Initialize the Checkout Api. $checkout = new Checkout_SDK(); try { // Check if payment is alre...
[ "private function handle_order_canceled_webhook( $webhook_data ) {\n // Order canceled.\n }", "public function process_webhook_source_canceled( $notification ) {\n\t\t$order = WC_Stripe_Helper::get_order_by_charge_id( $notification->data->object->id );\n\n\t\t// If can't find order by charge ID, try sou...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
validate update profile fields
protected function validateUpdateProfileFor($request){ $rules = [ 'name' => 'required', 'email' => 'required' ]; $this->validate($request,$rules); }
[ "private function checkUpdateUserFields() {\n $this->setRequiredFields(['token', 'updateUser']);\n if (in_array('first_name', $this->_required)) { $this->_val->matches('first_name', '/^[A-Za-z\\'\\.\\-]{2,20}$/i'); }\n if (in_array('last_name', $this->_required)) { $this->_val->matc...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Register an event handler to be called when a given event is received. The $event '' can be specified to register the handler for all events.
public function add_event_handler($event, $callback);
[ "public function registerEvent($event, $handler);", "public function registerEventHandler($event, callable $handler);", "abstract protected function registerEventHandler($event, callable $handler);", "function registerEventHandler( $event, $function ) {\n $this->_events[$event][] = $function;\n }", ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Tells if the current user has a given privilege. If there is a setting in config.php for auth_sp_saml_$configName_entitlement then SAML will determine if the user has this access. Otherwise the array in config.php for $configName will show an explicit list of users who have this access.
public static function isPrivilegeAllowed( $configName ) { $ret = false; if (is_null($configName)) return false; if (self::user()) { // constants $entitlement_attribute = Config::get('auth_sp_saml_entitlement_attribute'); $additional...
[ "public function authIsAdmin() {\n\n global $config;\n\n require_once($config['site_simplesamllocation'].'lib/_autoload.php');\n\n $as = new SimpleSAML_Auth_Simple($config['site_authenticationSource']); \n if($as->isAuthenticated()) {\n $as->requireAuth();\n $attrib...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Set the value for the ChannelName input for this GetChannel Choreo.
public function setChannelName($value) { return $this->set('ChannelName', $value); }
[ "public function setChannelName($var)\n {\n GPBUtil::checkString($var, True);\n $this->channelName = $var;\n\n return $this;\n }", "public function setChannelname($var)\n {\n GPBUtil::checkString($var, True);\n $this->channelname = $var;\n\n return $this;\n }"...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get the size of the longest word on a string
public static function getWordSize(string|Stringable $string): int { $string = (string) $string; $len = 0; foreach (preg_split('#[\h\v]+#', $string) as $word) { if (($wlen = mb_strlen($word)) > $len) { $len = $wlen; } } ...
[ "function findLongestWord($str)\n{\n $str = explode(\" \", $str);\n $res = '';\n foreach($str as $v) {\n if(strlen($res) < strlen($v))\n $res = $v;\n\n }\n return strlen($res);\n}", "function getLongestWord($str) {\n // get array of words\n $str = explode(' ', $str);\n\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get Google Drive instance
public function get_drive_instance() { $instance = new Google_Service_Drive($this->client); return $instance; }
[ "public static function get_drive_client() {\n\t\t$drive_client = self::$drive_client;\n\n\t\tif ( null === $drive_client ) {\n\t\t\t$raw_client = self::get_authorized_raw_client();\n\t\t\t$drive_client = new Drive( $raw_client );\n\t\t\tself::$drive_client = $drive_client;\n\t\t}\n\n\t\treturn $drive...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Create and persist a new DMCA notice.
public function createNotice(Request $request) { $data = session()->get('dmca'); $notice = Notice::open($data)->useTemplate($request->template); $notice = Auth::user()->notices()->save($notice); return $notice; }
[ "private function createNotice(Request $request)\n {\n $data = session()->get('dmca'); \n\n $notice = Notice::open($data)->useTemplate($request->input('template'));\n\n $notice = \\Auth::user()->notices()->save($notice);\n\n return $notice;\n\n }", "public function saving(Notice ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Add 'woocommerceactive' class to the body tag.
function wildkidzz_woocommerce_active_body_class($classes) { $classes[] = 'woocommerce-active'; return $classes; }
[ "function zakra_woocommerce_active_body_class( $classes ) {\r\n\t$classes[] = 'woocommerce-active';\r\n\r\n\treturn $classes;\r\n}", "function shoper_woocommerce_active_body_class( $classes ) {\n\t$classes[] = 'woocommerce-active';\n\n\treturn $classes;\n}", "function parlo_woocommerce_active_body_class( $class...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Show edit sandbox form
function edit(Sandbox $sandbox){ return view('newSandbox')->with('sandbox', $sandbox); }
[ "function showEditForm()\n{\n global $app;\n\n $tpl = new acmsTemplate($this->templatePath . \"edit_form.tpl\");\n $tpl->assign(\"Action\", \"edit\");\n $tpl->assign(\"ChunkID\", $this->ChunkID);\n $tpl->assign(\"ChunkName\", $this->ChunkName);\n $tpl->assign(\"Chunk\", ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This method is called to order the collection It will receive the wrappers and MUST return the wrappers. They are resolved after ordering.
abstract protected function orderCollection(array $wrappers): array;
[ "public function order()\n\t{\n\t}", "public function orderList();", "public function getMigrateOrderCollection()\n {\n $this->ordSer->migrateOrder();\n echo \"*******...Ordered Migration is successful...*********\";\n exit;\n }", "public function stdWrap_orderedStdWrapDataProvider(...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
save the spam setting blacklist and whitelist
public function saveSpam($params) { $dbh = $this->ant->dbh; $userId = $this->user->id; if(!empty($params['blacklist'])) { $sql = "delete from email_settings_spam where user_id='$userId' and value='".$dbh->Escape($params['blacklist'])."'"; $dbh...
[ "public function save() \n {\n Yii::$app->getModule('enterprise')->settings->set('email.whitelist', $this->whitelist);\n return true;\n }", "private function saveBan(){\n $this->tmp_list->writeTmpBanUsers($this->file);\n }", "public function addBlacklist(string $blacklist): void;",...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Count the number of users in a group
abstract public function CountUsersInGroup(int $gid) : int;
[ "public function get_group_count();", "function num_users_group($groupid) {\n global $COURSE, $DB;\n $sql = \"SELECT COUNT(u.id) as users\n FROM {groups} g\n LEFT JOIN {groups_members} gm ON gm.groupid = g.id\n LEFT JOIN {user} u ON gm.userid = u.id\n WHERE g.id =...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
gets the users that inherits a subject. domain is an unreferenced parameter here, may be used in other implementations.
public function getUsers($name, ...$domain);
[ "function users() {\n $ret = array();\n\n foreach($this->domains() as $d=>$domain_object) {\n foreach($domain_object->users() as $user)\n\t$ret[] = \"{$user}@{$d}\";\n }\n\n return $ret;\n }", "function getUsers($domain = null)\n {\n /* Put together the SQL statement. */\n if (i...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Register a new domain name Executes the 'Purchase' command on Enom's servers to register a new domain. Note that this command to not fail, it must meet the following requirements: Your Enom account must have enough credits to cover the order amount. The domain name must be valid and available. Number of years must not ...
function registerDomain($domainName, $numYears, $contacts, $nameServers = null, $regLock = true) { $this->_setCommand('Purchase'); if( !$this->_setParseDomain($domainName) ) { $this->_addError("Invalid domain name $domainName"); return $this->_returnError(); } $this->addParam('Nu...
[ "function registerDomain( $params )\n {\n $domain = $params['sld'] . \".\" . $params['tld'];\n $curl_url = $this->_getURL() . \"domains/\" . urlencode($domain) . \"/create\";\n $curl_params = array();\n\n for ($i = 1; $i <= 6; $i++) {\n if (!empty($params['NS'...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Set the default icon messages will be created with.
public function setDefaultIcon($icon) { $this->icon = $icon; }
[ "public abstract function setIcons();", "private function autoSetIcon(): void\n {\n switch (static::class) {\n case Human::class:\n $this->icon = IconEnum::HUMAN;\n break;\n case Ai::class:\n $this->icon = IconEnum::AI;\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Builds the user password reset link email
function buildPwdResetEmail($user_info, $uniq_hash, $build_html = true, $title = null, $from_address = null) { global $fm_name, $__FM_CONFIG; if ($build_html) { $branding_logo = $GLOBALS['FM_URL'] . str_replace('//', '/', str_replace($GLOBALS['RELPATH'], '', getBrandLogo())); $body = <<<BODY <!DOCTYPE ...
[ "protected function sendPasswordResetEmail() {\r\n $url = 'http://' . $_SERVER['HTTP_HOST'] . '/' . \\App\\Config::SITE_NAME . '/password/reset/' . $this->password_reset_token;\r\n \r\n $text = \"Please click on the following URL to reset your password: $url\";\r\n $html = \"Please click...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Operation kitAssemblyPutEntityAsyncWithHttpInfo Creates a record or updates an existing record.
public function kitAssemblyPutEntityAsyncWithHttpInfo($entity, $select = null, $filter = null, $expand = null, $custom = null) { $returnType = '\Hut6\CranaplusAcumaticaSdk\Model\KitAssemblyModel'; $request = $this->kitAssemblyPutEntityRequest($entity, $select, $filter, $expand, $custom); re...
[ "public function kitAssemblyPutEntityWithHttpInfo($entity, $select = null, $filter = null, $expand = null, $custom = null)\n {\n $returnType = '\\Hut6\\CranaplusAcumaticaSdk\\Model\\KitAssemblyModel';\n $request = $this->kitAssemblyPutEntityRequest($entity, $select, $filter, $expand, $custom);\n\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ getDownvoteLevel() Update the different downvote levels coming from the frontend
function getDownvoteLevel($route, $type, $websocketClientIp = '') { global $clientIp; // take client ip from websocket if(empty($websocketClientIp) === false){ $clientIp = $websocketClientIp; } // initialize database $db = new ClientDB(); $admin = checkAdmin($clientIp); ...
[ "function upgrade_level()\n {\n // get actual points and level of the user (maybe we have to upgrade the level)\n $result = query(\"SELECT points, level FROM \". USERS_TABLE . \" WHERE id = ?\", $_SESSION[\"id\"]);\n if ($result === false or count($result[0]) != 2)\n {\n //...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Display a listing of countries.
public function index() { return $this->view('geography.countries.index')->with('items', Country::all()); }
[ "public function listCountries()\n {\n TheliaApiException::throwApiExceptionFaultUnless(\n $this->api->checkAccess('configuration',1,0),\n TheliaApiException::ERROR,\n TheliaApiException::E_unavailable);\n\n $query = 'SELECT pd.titre, p.id, p.isocode, p....
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Searches what components among self::$COMPATIBLE_COMPONENTS are currently installed. Also checks version numbers to be greater than or equal to the min_version field.
public function getInstalledCompatibleComponents() { $db = JFactory::getDbo(); $query = $db->getQuery(true); $query->select('e.element,e.manifest_cache'); $query->from('#__extensions AS e'); $db->setQuery($query); $options = array(); foreach (self::$COMPATIBLE_COM...
[ "protected function init_components_list() {\n global $DB;\n $this->log('Loading the list of registered components', amos_cli_logger::LEVEL_DEBUG);\n\n list($branchsql, $params) = $DB->get_in_or_equal(array_keys($this->get_versions()), SQL_PARAMS_NAMED);\n\n $sql = \"SELECT DISTINCT bran...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Return the regex to only catch existing resources on the route.
public static function resourceRegex() { return '\b('.implode('|', array_keys(static::RESOURCES)).')\b'; }
[ "public function regexp()\n {\n $regexp_path = '';\n $rawpath = $this->_route->getPath();\n\n $path = $this->compileRegularPath($rawpath);\n $path = $this->compileStrictPathParams($path);\n\n return $this->_addRemoveTrailingSlash($path, $this->_route->hasOptionalParameter());\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Handle the branch "created" event.
public function created(Branch $branch) { // }
[ "public function actionCreate()\n {\n if (Yii::$app->user->can('create-branch')) {\n $model = new Branches();\n\n // Validate with enableAjaxValidation is true in _form\n // Remove this if use 'validationUrl' => Url::toRoute('branches/validation') in _form\n /* i...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the list of limit options that should be applied to imports.
public function get_import_limit_type_options( ) { $options = array( 'range' => __( 'By date range', 'the-events-calendar' ), 'count' => __( 'By number of events', 'the-events-calendar' ), 'no_limit' => __( 'Do not limit (not recommended)', 'the-events-calendar' ), ); /** * Filters the options...
[ "public function getLimitOptions();", "protected function getLimitOptions()\n {\n return $this->limitOptions;\n }", "public function getLimitFields(): array;", "protected function get_import_options() {\n\t\t$options = array(\n\t\t\t'fetch_attachments' => $this->fetch_attachments,\n\t\t\t'default...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Walks down an UpdateItem AST node, thereby generating the appropriate SQL.
function walkUpdateItem($updateItem);
[ "public function walkUpdateItem($updateItem)\n {\n foreach ($this->_walkers as $walker) {\n $walker->walkUpdateItem($updateItem);\n }\n }", "function walkUpdateClause($updateClause);", "public function walkUpdateClause($updateClause);", "function compileUpdate()\n {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets the microphonesAndSpeakers Defines whether builtin microphones or speakers are enabled. Possible values are: notConfigured, enabled, disabled.
public function setMicrophonesAndSpeakers($val) { $this->_propDict["microphonesAndSpeakers"] = $val; return $this; }
[ "public function setMicrophone($on) {\n return $this->client->request(\"mic&on=\" . ($on ? \"1\" : \"0\")) == \"OK\";\n }", "public function setMicrophoneConfiguration(?TeamworkMicrophoneConfiguration $value): void {\n $this->getBackingStore()->set('microphoneConfiguration', $value);\n }", "...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Store a newly created mailbox in storage.
public function store(CreateMailboxRequest $request) { // Mailbox::create($request->all()); return redirect()->route(config('quickadmin.route').'.mailbox.index'); }
[ "public function store(CreateInboxRequest $request)\n\t{\n\t \n\t\tInbox::create($request->all());\n\n\t\treturn redirect()->route(config('quickadmin.route').'.inbox.index');\n\t}", "public function store()\n {\n $this->validate(request(), [\n 'reply_to' => 'required|array|min:1',\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
flushMemory Frees any memory associated with images
private function flushMemory($img, $newImage): void { imagedestroy($newImage); imagedestroy($img); }
[ "public function flushImageArray()\n {\n $this->deleteHasCache(self::CACHE_KEY_IMAGE);\n }", "public function free(){\r\n if($this->srcImage) imagedestroy($this->srcImage);\r\n }", "private function flushImageCache(): void\n {\n $this->imagesCache = null;\n $this->variant...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Clean Yeti Theme Option Defaults Returns an associative array that holds all of the default values for all Theme options.
function cleanyeti_get_option_defaults() { // Get the array that holds all // Theme option parameters $option_parameters = cleanyeti_get_option_parameters(); // Initialize the array to hold // the default values for all // Theme options $option_defaults = array(); // Loop through the option // parameters array...
[ "public static function get_option_defaults() {\r\n\r\n\t\t\t// Get the array that holds all theme \r\n\t\t\t// font option parameters\r\n\t\t\t$tt_font_parameters = self::get_option_parameters();\r\n\r\n\t\t\t// Initialize the array to hold the default \r\n\t\t\t// values for all of the font options\r\n\t\t\t$tt_f...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the value of field complemento
public function getComplemento() { return $this->complemento; }
[ "public function getComplemento()\n {\n return $this->complemento;\n }", "public function getComplement() \n {\n return $this->complement;\n }", "public function getComplement()\r\n {\r\n return $this->complement;\r\n }", "public function getComplement()\n {\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
TODO: Implement getProductDraftApi() method.
public function getProductDraftApi(): ProductDraftApiInterface { }
[ "public function getProductModelDraftApi(): ProductModelDraftApiInterface\n {\n }", "private function getDraftedProduct()\n {\n return $this->session->get('drafted_product', null);\n }", "public function testStoreProductsDraft()\n {\n }", "public function testCreateDrafts()\n {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Check if title has been set
public function hasTitle(): bool;
[ "public function issetTitle() {\r\n\t\treturn $this->title != NULL;\r\n\t}", "function hasTitle()\n {\n return isset($this->_title);\n }", "public function hasTitle() {\n return $this->getTitle() != null;\n }", "protected function set_title()\n {\n }", "public function i...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Check if the given AVS Number is Valid or Not.
public function validate(String $avsNumber, bool $checkStrict = true): bool { $this->avsNumber = $avsNumber; if (! $this->avsNumber) { throw new AvsNumberNotSetException('AVS Number is not set'); } if (! $this->hasValidFormat($checkStrict)) { return false; ...
[ "public function validateVatNumber($vatNumber);", "public function isValid()\n {\n return $this->checkValidity() === self::VALID_VAT_NUMBER;\n }", "public function isValid($number);", "public function testValidationOfValidVATNumber()\n {\n $vatNumber = new VatNumber('');\n\n $thi...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets the audioFormat Name of the audio format (AAC, MP3, etc.).
public function getAudioFormat() { if (array_key_exists("audioFormat", $this->_propDict)) { return $this->_propDict["audioFormat"]; } else { return null; } }
[ "public function getAudioFormat()\n {\n return $this->audio_format;\n }", "public function getDefaultFormatClassName()\n {\n return 'AudioFormat';\n }", "function getFormatFilename()\n\n\t{\n\n\t\tglobal $config;\n\n\t\tglobal $config;\n\n\n\n\t\t$bitrate = $this->bitrate;\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Pluck a certain field out of each object in a list.
public static function pluck($list, $field) { foreach ( $list as $key => $value ) { if (is_object($value)) $list[$key] = $value->$field; else $list[$key] = $value[$field]; } return $list; }
[ "public static function pluckRef(&$list, $field) {\n\n\t\tforeach ( $list as &$value ) {\n\n\t\t\tif (is_object($value))\n\t\t\t\t$value = $value->$field;\n\t\t\telse\n\t\t\t\t$value = $value[$field];\n\t\t}\n\n\t\treturn $list;\n\t}", "function list_pluck($list, $field) {\n\treturn \\Phpf\\Util\\Arr::pluck($list...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get the tax query which was used by the main query.
public static function get_main_tax_query() { $tax_query = isset( self::$video_query->tax_query, self::$video_query->tax_query->queries ) ? self::$video_query->tax_query->queries : array(); return $tax_query; }
[ "public static function get_main_tax_query()\n {\n }", "protected function get_main_tax_query()\n {\n }", "public static function get_main_tax_query() {\n $tax_query = isset( self::$movie_query->tax_query, self::$movie_query->tax_query->queries ) ? self::$movie_query->tax_quer...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Create request for operation 'createAfterSalesServiceWarrantyUsingPOST'
protected function createAfterSalesServiceWarrantyUsingPOSTRequest($warranty_request) { // verify the required parameter 'warranty_request' is set if ($warranty_request === null || (is_array($warranty_request) && count($warranty_request) === 0)) { throw new \InvalidArgumentException( ...
[ "public function create_warranty() {\n\t\t\t$order_id = $_POST['order_id'];\n\t\t\t$type = $_POST['warranty_request_type'];\n\t\t\t$qtys = $_POST['warranty_qty'];\n\t\t\t$idxs = array_keys( $qtys );\n\t\t\t$requests = array();\n\t\t\t$errors = array();\n\n\t\t\t$order = wc_get_order( $orde...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Operation dELETEOrderAmountPromotionRulesOrderAmountPromotionRuleId Delete an order amount promotion rule
public function dELETEOrderAmountPromotionRulesOrderAmountPromotionRuleId($order_amount_promotion_rule_id) { $this->dELETEOrderAmountPromotionRulesOrderAmountPromotionRuleIdWithHttpInfo($order_amount_promotion_rule_id); }
[ "public function testDELETEPromotionRulesPromotionRuleId()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "public function testDeleteExpressionInRule() {\n // Setup a rule with one condition.\n $this->testCreateReactionRule();\n\n $this->clickLink('Dele...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Creates a new frame for this section. Reference to the returned template is retained by the section for compilation.
public function createFrame():HTMLReportTemplate { $template = new HTMLReportTemplate($this->content); $this->frames[] = $template; return $template; }
[ "private function newTemplate() {\n $tmp = \"{# Template new.html.twig for \" . $this->sinPrefijo . \" #}\\n\";\n $tmp .= \"{# -------------------------------------------------------#}\\n\";\n $tmp .= \"{# CREAR UN REGISTRO NUEVO #}\\n\";\n $tmp .= \"{# ---...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
add Format parser to pool
public static function addFormatParserObject(IFormatParserClass $formatParser) { self::$formatParsers[$formatParser->getName()] = [ 'formatName' => $formatParser->getFormatName(), 'parser' => ...
[ "public function getParser($file, $format, $testOption);", "public static function getFormatParsers() {\n return self::$formatParsers;\n }", "public function createParser();", "private function updateParser () {\n if ($this->component) {\n $this->loadParser($this->component->getHtm...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Tests removal of duplicate recipients and replytos.
public function testDuplicateIDNRemoved() { if (!PHPMailer::idnSupported()) { self::markTestSkipped('intl and/or mbstring extensions are not available'); } $this->Mail->clearAllRecipients(); $this->Mail->CharSet = PHPMailer::CHARSET_UTF8; self::assertTrue($this...
[ "private function uniqueRecipients()\n\t{\n\t\t/** @var $search Recipient */\n\t\t$search = Search_Object::create(Recipient::class);\n\t\t$recipients = array_merge(\n\t\t\t[$this->from, $this->reply_to, $this->return_path],\n\t\t\t$this->to, $this->copy_to, $this->blind_copy_to\n\t\t);\n\t\t$already = [];\n\t\tfore...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Find a file in a directory matching a basename and an extension Both basename and extension are ordered arrays, the search starts with the first basename and all possible extensions, and continues then with the next basename. If a caseinsensitive find is requested the file names in the filesystem and the passed strings...
public static function findFile( $basedir, $basenames, $extensions, $caseSensitive = true ) { $searchFilenames = []; foreach ($basenames as $basename) { foreach ($extensions as $ext) { $searchFilenames[] = $basename.$ext; } ...
[ "public function searchFileForString($string);", "function searchFileByExtension($searchDirectory, $searchExtension, $firstMatch = true) {\n\tif (!is_dir($searchDirectory)) return null;\n\n\t$fileList = scandir($searchDirectory);\n\tif (empty($fileList)) return null;\n\n\t$result = array();\n\n\tforeach($fileList...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Deletes the specified database, and all the documents and attachments contained within it. Note: To avoid deleting a database, CouchDB will respond with the HTTP status code 400 when the request URL includes a ?rev= parameter. This suggests that one wants to delete a document but forgot to add the document id to the UR...
public function deleteDatabase($db) { $request = new ArkCouchDBRequest(ArkCouchDBRequest::METHOD_DELETE, "/" . urlencode($db)); $response = $this->callApi($request); return $response; // switch($response->responseHTTPCode()){ // case 201: // return $response-...
[ "public function deleteDocument($rid, $version = null, $database = null);", "public function deleteDatabase($database);", "public function delete(string $database);", "private function delete_db()\n\t{\n\t\tif (count($this->args) < 1)\n\t\t\treturn $this->generateError(404, \"The DELETE method needs a target ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/Funcion para traer el listado de datos de cda_tipo_reporte
protected function listcdatiporeporte(){ $_listcdatiporeporte = CdaTipoReporte::find()->all(); return $_listcdatiporeporte; }
[ "public function getAllReportType()\n {\n // Set result\n $result = array();\n try\n {\n // Get DB Obj\n $dbObj = Thethao_Global::getDB('sport', 'slave');\n\n // Prepare SQL\n $stmt = $dbObj->prepare('CALL sp_sport_getReportType();');\n\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Prints example step on step AFTER event.
private function printStepOnAfterStepEvent(Formatter $formatter, Event $event) { if (!$event instanceof AfterStepTested) { return; } $this->stepPrinter->printStep($formatter, $this->example, $event->getStep(), $event->getTestResult()); $this->stepSetupPrinter->printTeard...
[ "public function afterStep(StepEvent $event) {\n\t\t$this->printStep(\n\t\t\t$event->getStep(), $event->getResult(), $event->getDefinition(), $event->getSnippet(), $event->getException()\n\t\t);\n\t}", "public function afterStep($event)\n {\n if ($this->inBackground && $this->isBackgroundPrinted) {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
WP Super Edit Default User Sets default user settings from most recent TinyMCE scan, sets initial options, and removes unnecessary WordPress options
function wp_super_edit_set_user_default() { global $wp_super_edit, $wp_super_edit_tinymce_default; // Output buffering to get default TinyMCE init - Since it's the core editor we want the DFW(distraction free writing) ob_start(); if ( function_exists( 'wp_editor' ) ) wp_editor( '', 'null', array( 'dfw' => true ...
[ "function hook_twitter_user_settings_alter(&$output) {}", "public function save_defaults() {\n\n $tmp_options = $this->options;\n\n if ( ! empty( $this->pre_fields ) ) {\n foreach ( $this->pre_fields as $field ) {\n if ( ! empty( $field['id'] ) ) {\n $this->options[$field['id'...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Find Proxy for a meeting by Principal (User).
public function findOneByPrincipal(Meeting $meeting, User $principal) { return parent::findOneBy(['meeting' => $meeting, 'principal' => $principal]); }
[ "function targetUser() {\n\t\treturn $this->POD->getPerson(array('id'=>$this->targetUserId));\n\t}", "private function _findUser()\n\t{\n\t\t$id = $this->_getParam('id');\n\t\t$username = $this->_getParam('username');\n\n\t\tif (!empty($id)) {\n\t\t\t$user = Doctrine_Core::getTable('Models_Main_Personnel')->findO...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
deliveryorderAdditionalTextblocks( ) : Write addional text blocks
private function deliveryorderAdditionalTextblocks() { $additionalTextblocks = $this->confPdf[ 'deliveryorder.' ][ 'content.' ][ 'additionaltextblocks.' ]; // LOOP : additional textblocks foreach ( array_keys( ( array ) $additionalTextblocks ) as $key ) { if ( !stristr( $key, '.' ) ) { ...
[ "private function invoiceAdditionalTextblocks()\n {\n $additionalTextblocks = $this->confPdf[ 'invoice.' ][ 'content.' ][ 'additionaltextblocks.' ];\n\n// LOOP : additional textblocks\n foreach ( array_keys( ( array ) $additionalTextblocks ) as $key )\n {\n if ( !stristr( $key, '.' ) )\n {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get the referenced entity controller referenced in the field.
public function fieldReferencedEntityController($fieldName, EntityControllerFactoryInterface $entityControllerFactory, $fieldKey = FieldUtil::KEY_TARGET_ID, $idx = 0, $lang = LANGUAGE_NONE);
[ "public function getController(): ?string {\r\n return $this -> routeEntity -> getController();\r\n }", "public function getIdController()\n {\n return $this->idController;\n }", "public function getIdController()\n {\n return $this->id_controller;\n }", "final public funct...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns list of all categories and teachers used in add and edit course page
public function categories_teachers_Course() { if($this->input->server('REQUEST_METHOD') == "GET") { $categories = $this->Category_model->get_categories(); $teachers = $this->Teacher_model->get_teachers(); if(!$categories || !$teachers) { ...
[ "public function frontpage_combo_list() {\r\n global $CFG;\r\n require_once($CFG->libdir. '/coursecatlib.php');\r\n $chelper = new coursecat_helper();\r\n $chelper->set_subcat_depth($CFG->maxcategorydepth)->\r\n set_categories_display_options(array(\r\n 'limit' ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns whether there are any "to" addresses in this instance
public function hasTos () { return !empty( $this->to ); }
[ "public function hasTo()\n {\n return $this->get(self::TO) !== null;\n }", "public function hasRecipients()\n {\n return count($this->recipients) > 0;\n }", "public function hasRecipients(): bool\n {\n if ($this->recipients and !$this->recipients->isEmpty()) {\n re...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get all questions groups
public function getAllQuestionGroup() { return $this->questionGroup->orderBy('title')->whereNull('parent_id')->with([ 'children' => function ($qyery) { $qyery->orderBy('title'); }, ])->get(); }
[ "function GetAllQuestionGroups()\n {\n return $this->config->question_groups;\n }", "public function retrieveAllGroups();", "public function getAllGroups();", "function getAllExam_Groups() {\n\t\t$SQL=\"SELECT * FROM exam_groups\";\n\t\t$this->db->executeQuery($SQL);\n\n\t\t$result = array();\n\t\t$c...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
grading system by number
function grading($total_number){ if($total_number >= 80){ $grade = array( 'letter_grade' => 'A+', 'grade_point' => '4.00' ); } elseif( $total_number >= 75 && $total_number < 80){ $grade = array( 'letter_grade' => 'A', 'grade_point' => '3.75' ); } elseif( $total_number >= 70 && $t...
[ "function curgrade($id){\n\tinclude_once('../graphing/xmlgrapher_crit.php');\n\tinclude('../../../Submission_p_secure_pages/connect.php');\n\t#include_once('../functions/curfunctions.php');\n\t###\n\t#$dumped = dump(\"module_p\", $id);\n\t### change dump to call only assoc_sens and tested status\n\t#$func = \"SELEC...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Verify the received response.
public function verifyResponse() { $method = $this->getMethod(); $uuid = $this->getUUID(); $signature = $this->getSignature(); $data = $this->getData(); return $this->verifySignedData($method, $uuid, $signature, $data); }
[ "public function checkResponse()\n {\n $this->setUpValidator();\n $this->setUpStorage();\n $this->setUpGenerator();\n $this->sendClientRequest();\n $this->validateResponse();\n }", "private function responseCheck() {\n if ($this->response == null) {\n ret...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Operation getBarcodeRecognizeWithHttpInfo Recognize barcode from a file on server.
public function getBarcodeRecognizeWithHttpInfo(Requests\GetBarcodeRecognizeRequest $request) { $returnType = '\Aspose\BarCode\Model\BarcodeResponseList'; $request = $this->GetBarcodeRecognizeRequest($request); try { $options = $this->_createHttpClientOption(); try {...
[ "public function getBarcodeRecognize(Requests\\GetBarcodeRecognizeRequest $request)\n {\n try {\n list($response) = $this->getBarcodeRecognizeWithHttpInfo($request);\n return $response;\n } catch (RepeatRequestException $e) {\n list($response) = $this->getBarcodeRec...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets the review state for a given item. Will produce errors if the item doesn't match up with the given value.
public function setReviewState($name, $reviewedValue, $isValid) { if (!isset($this->statusData->$name) || $this->statusData->$name->draft != $reviewedValue) { throw new Exception("Cannot set review of '$name' for non-existent draft", E_MALFORMED_REQUEST); } $item = $this->statusData->$name; $item->review...
[ "public function setItemNeedReview(?int $value): void {\n $this->getBackingStore()->set('itemNeedReview', $value);\n }", "public function setStatus( int $value ) : \\Aimeos\\MShop\\Common\\Item\\Iface\n\t{\n\t\treturn $this->set( 'review.status', $value );\n\t}", "public function setReview($value)\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// Back button handler //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// Back button handler submit handler...
function form_reg_user_page_2_back($form, &$form_state) { $form_state['values'] = $form_state['page_values'][1]; $form_state['page_num'] = 1; $form_state['rebuild'] = TRUE; }
[ "public function onBackForm()\n {\n // Load another page\n AdiantiCoreApplication::loadPage('MultiStepMultiFormView', 'onLoadFromSession');\n }", "function back()\r\n\t{\r\n\t\t//leave page\r\n\t\tif ( $this->previousUrl != \"\" ) {\r\n\t\t\t$this->redirect( $this->previousUrl );\r\n\t\t}\r\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
test getting profile skill by profile id
public function testGetProfileSkillByProfileSkillProfileId(): void { // count the number of rows and save it for later $numRows = $this->getConnection()->getRowCount("profileSkill"); // create a new Profile Skill and insert into mySQL $profileSkill = new ProfileSkill($this->profile->getProfileId(), $this->skill...
[ "public function testGetProfileSkillByProfileSkillSkillId(): void {\n\t\t// count the number of rows and save it for later\n\t\t$numRows = $this->getConnection()->getRowCount(\"profileSkill\");\n\t\t// create a new Profile Skill and insert into mySQL\n\t\t$profileSkill = new ProfileSkill($this->profile->getProfileI...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
allow to change row data before rendering
public function changeRowData(&$row){}
[ "public function renderRow(): void\n {\n $this->tRow->set($this->model);\n\n if ($this->useHtmlTags) {\n // prepare row-specific HTML tags\n $htmlTags = [];\n\n foreach ($this->hook(Table\\Column::HOOK_GET_HTML_TAGS, [$this->model]) as $ret) {\n if (i...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Run hourly cron updates
public function runHourlyCronUpdate(CronEvent $event) { $app = $this->app; // Fetch youtube info if ($event->output) { $event->output->writeln("<comment> Checking youtube for updates...</comment>"); } $runner = new Runner($app); $results = $runner->run(); $results->then(null, function ($error) use ...
[ "public function cron()\n\t{\n\t\tif ($this->tank_auth->is_admin())\n\t\t{\n\t\t\t$last_check = get_setting('fs_cron_autoupgrade');\n\n\t\t\t// hourly cron\n\t\t\tif (time() - $last_check > 3600)\n\t\t\t{\n\t\t\t\t// update autoupgrade cron time\n\t\t\t\t$this->db->update('preferences', array('value' => time()), ar...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Substitution should create a new file
public function testSubstituteWithMatchShouldCreateNewFile(): void { $processor = new Processor(self::$defaultOptions); $fileObject = new \SplFileObject('vfs://match.php.dist'); $processor->substitute($fileObject, ['test' => 'works!']); $target = self::$fileSystem->get('/match.php'...
[ "protected function createFile() {}", "public function new_file()\n {\n $input = JFactory::getApplication()->input;\n\n $ecr_project = $input->get('ecr_project');\n\n if($input->get('do_action') == 'new_file')\n {\n $reqPath = $input->getPath('act_path');\n $re...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Fetch via Geofence resource accesses.
public function fetchResourceViaRequest(Geofence $geofence, Resource $resource) { return $geofence->accesses()->with('accessible', 'first_location', 'last_location', 'geofence') ->where('accessible_type', get_class($resource)) ->where('geofence_uuid', $geofence->uuid) ->l...
[ "function getGeometrieById(): Geometrie\n {\n }", "private function fetchGeoCoordinates()\r\n {\r\n $geoCoordinatesNode = $this->findFirstGrandchild('geo', 'geokoordinaten');\r\n $attributes = $this->fetchLowercasedDomAttributes($geoCoordinatesNode);\r\n \r\n if (\r\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets the userDomainNameSource UserDomainname attribute that is picked from AAD and injected into this profile before installing on the device. Possible values are: fullDomainName, netBiosDomainName.
public function getUserDomainNameSource() { if (array_key_exists("userDomainNameSource", $this->_propDict)) { if (is_a($this->_propDict["userDomainNameSource"], "\Beta\Microsoft\Graph\Model\DomainNameSource") || is_null($this->_propDict["userDomainNameSource"])) { return $this->_...
[ "public function get_user_domain();", "public function getUsernameAADSource()\n {\n if (array_key_exists(\"usernameAADSource\", $this->_propDict)) {\n if (is_a($this->_propDict[\"usernameAADSource\"], \"\\Beta\\Microsoft\\Graph\\Model\\UsernameSource\") || is_null($this->_propDict[\"usernameA...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get the tweet record associated with the EntityTweet.
public function tweet() { return $this->belongsTo('BenBjurstrom\CuratorModel\Tweet'); }
[ "protected function getTweet()\n {\n $tweet = $this\n ->getMockBuilder('\\Stocarul\\TwitterBundle\\Model\\Tweet')\n ->disableOriginalConstructor()\n ->getMock()\n ;\n\n return $tweet;\n }", "public function read_tweets()\n\t{\n\t\t\treturn $this->mongo_d...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets the priceType A setting to provide flexibility for the pricing structure of services. Possible values are: undefined, fixedPrice, startingAt, hourly, free, priceVaries, callUs, notSet, unknownFutureValue.
public function setPriceType($val) { $this->_propDict["priceType"] = $val; return $this; }
[ "public function setPricingType(?string $pricingType): void\n {\n $this->pricingType = $pricingType;\n }", "public function setPriceType($priceType)\n {\n $this->priceType = $priceType;\n return $this;\n }", "public function set_price_type($price_type) \n\t{\n\t\t$this->price_ty...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets a an bool option in the arguments, like $option.
private function setArgumentBool($option, $bool) { if ($bool) { $this->add(sprintf('%s%s', $this->executable->getOptionPrefix(), $option)); } return $this; }
[ "protected function setBool(){\n $this->bool = array(\n\t 'true'=>1,\n\t 'false'=>0,\n\t 'yes'=>1,\n\t 'no'=>0,\n\t\t'on'=>1,\n\t\t'off'=>0,\n\t);\n }", "function enabled(string $option, string $shorthand = \"\"): bool\n{\n return in_array(getopt($shorthand, [$option]), [[$option => false], [$shorth...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Tests running multiple coding standards.
public function testMultipleCodingStandards() { $files = array( sprintf('%s/src/file1.php', $this->projectDir), ); $tool = new CodeQualityTool($files, array( 'excludeTests' => true, 'projectDir' => $this->projectDir, 'codingStandard' => array(...
[ "public function testCodingStandardOption()\n {\n $command = $this->getPhpCsExecutable() . ' --extensions=php,inc --standard=myStandard --report=checkstyle ' . getcwd();\n $this->assertEquals(\n $command,\n $this->taskPhpCs(null, 'myStandard')->getCommand()\n );\n }"...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Execute Expression by using this connection.
public function execute(Expression $expr) { // If custom connection is set, execute again using that if ($this->connection && $this->connection !== $this) { return $expr->execute($this->connection); } throw new Exception('Queries cannot be executed through this connectio...
[ "public function execute() {\n\t\tself::_normalizeArgs(func_get_args(), $statement, $args);\n\t\treturn $this->executeWith($statement, $args);\n\t}", "public function execute() {\n\t\t\t$connection = \\Leap\\Core\\DB\\Connection\\Pool::instance()->get_connection($this->data_source);\n\t\t\tif ($this->before !== N...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get the transport object
public function getTransport() { // use cache when we can if ($this->transport) { return $this->transport; } // create a new transport object $this->transport = $this->createTransport(); return $this->transport; }
[ "protected function getTransport()\n {\n return $this->transport;\n }", "public function transport()\n {\n if (!$this->transport) {\n $this->transport = $this->loadTransport();\n }\n\n return $this->transport;\n }", "public function getTransport ()\n {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Register the build command.
protected function registerBuildCommand() { $this->app['command.basset.build'] = $this->app->share(function($app) { $buildPath = $app['path.public'].'/'.$app['config']->get('basset::build_path'); $builder = new FilesystemBuilder($app['files']); $cleaner = new Bu...
[ "public function registerBuildCommand()\r\n\t{\r\n\t\t$this->app['grunt.build'] = $this->app->share(function($app)\r\n\t\t{\r\n\t\t\treturn new GruntBuildCommand();\r\n\t\t});\r\n\t}", "public function registerCompileCommand ()\n {\n $this->app['l4gettext.compile'] = $this->app->share(function($app) {\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the HTTP request body body This method returns a readable stream resource. If the asString parameter is set to true, a string is sent instead.
public function getBody($asString = false) { if (is_null($this->body)) { $this->body = fopen('php://input','r'); } if ($asString) { return stream_get_contents($this->body); } return $this->body; }
[ "public static function getRequestBodyStream() {}", "public function getBodyStream();", "function getBodyAsString() {\n\n $body = $this->getBody();\n if (is_string($body)) {\n return $body;\n }\n if (is_null($body)) {\n return '';\n }\n $contentLen...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Add one row to the selected entity name on data source.
public function addImportedRow(array $data, $entityName = '') { # Format the imported data so it can be adding tho excel sheet row. $this->addRow(['data' => array_values($data)], $entityName); $this->doSave(); return true; }
[ "function addRowName($rowName) {\n $this->_rowNames[] = $rowName;\n }", "function addRow() {\n $rowIdx = count($this->_rows);\n $this->_rows[$rowIdx] = new papaya_pdf_table_row($this);\n $this->_currentRow = &$this->_rows[$rowIdx];\n $this->_currentRow->index = $rowIdx;\n }", "public func...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
returns all bids made by a specific userid for a specific course in a specific round.
public function retrieveBidByUserIDAndCourseAndRound($userid, $course, $round) { $sql = 'select * from bid where userid=:userid and code=:course and round=:round'; $connMgr = new ConnectionManager(); $conn = $connMgr->getConnection(); $stmt = $conn->prepare...
[ "public function retrieveBidsByUser($userid) {\r\n $sql = \"SELECT * FROM bid WHERE userid = :userid\";\r\n \r\n \r\n $connMgr = new ConnectionManager(); \r\n $conn = $connMgr->getConnection();\r\n\r\n $stmt = $conn->prepare($sql);\r\n $stmt->bindParam(':use...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/+ | Funktion: getDeviceDescription | | Erwartet: | | Address ( string ) | | | | Liefert: | | Description_array ( array ) | +
public function getDeviceDescription(string $Address){ if (!$this->GetOnlineState()) return null; $args=array('Address'=>$Address); $filter=array('Description_array'); return self::Call('Control','getDeviceDescription',$args,$filter);; }
[ "public function descriptions()\n {\n return $this->getSNMP()->walk1d( self::OID_IF_DESCRIPTION );\n }", "public function getElectronicDeviceDescription()\n {\n return $this->electronicDeviceDescription;\n }", "public function getDescription(){\n\t\t$this->description .= $this->hardwar...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Return a human readable name of the filetype group.
public function get_group_description($group) { if (get_string_manager()->string_exists('group:'.$group, 'core_mimetypes')) { return get_string('group:'.$group, 'core_mimetypes'); } else { return s($group); } }
[ "public function getFiletypelabel() {\n\t\treturn $this->filetypelabel;\n\t}", "public function getName()\n {\n return $this->group->getName();\n }", "function Name(){\n\t\tif(!$this->title) {\n\t\t\t$fs = $this->FieldSet();\n\t\t\t$compositeTitle = '';\n\t\t\t$count = 0;\n\t\t\tforeach($fs as $sub...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Carga capas para region
public function ajax_capas_region(){ header('Content-type: application/json'); $this->load->library("capa/Capa_region_disponibles"); $params = $this->input->post(null, true); $this->capa_region_disponibles->setRegion($params["id"]); echo json_e...
[ "private function agregar_capacidad (){\r\n $id_sede=toba::memoria()->get_dato_instancia(0);\r\n \r\n //$aulas_con_capacidad=$this->dep('datos')->tabla('aula')->get_aulas_mas_capacidad($id_sede);\r\n $sql=\"SELECT id_aula, capacidad\r\n FROM aula\r\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/Creates the directory and log file for error handling
public function __construct($log){ $directory = "log"; $logFileName = "log.txt"; $this->create_directory($log."/".$directory); // if(!($this->directory_found($log."/".$directory))){ // //$this->create_directory("log"); // } $this->fileName = $logFileName; $this->directoryName = $l...
[ "public function createLogDirectory(): void\n {\n $this->files->ensureDirExists(VALET_HOME_PATH.'/Log', user());\n\n $this->files->touch(VALET_HOME_PATH.'/Log/nginx-error.log');\n }", "public static function createLogs() {\n touch(conf::pathBase() . '/logs/access.log');\n touch(c...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Test case for gETMarketIdAttachments Retrieve the attachments associated to the market.
public function testGETMarketIdAttachments() { // TODO: implement $this->markTestIncomplete('Not implemented'); }
[ "public function testGETInventoryModelIdAttachments()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "public function testGETGiftCardRecipientIdAttachments()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "pu...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Is last rebuild arena date available ?
public function isLastRebuildDateAvailable() { $node = $this->getXml()->getElementsByTagName('RebuiltDate'); if ($node !== null && $node->length) { return strtolower($this->getXml()->getElementsByTagName('RebuiltDate')->item(0)->getAttribute('Available')) == 'true'; } ret...
[ "public function isLastRebuildDateAvailable()\n\t{\n\t\tif(!isset($this->lastRebuildDateAvailable) || $this->lastRebuildDateAvailable === null)\n\t\t{\n\t\t\t$node = $this->getXml()->getElementsByTagName('RebuiltDate');\n\t\t\tif($node !== null && $node->length)\n\t\t\t{\n\t\t\t\t$this->lastRebuildDateAvailable = s...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Creates a new direcciones entity.
public function newAction(Request $request) { $direccione = new direcciones(); $form = $this->createForm('AppBundle\Form\direccionesType', $direccione); $form->handleRequest($request); if ($form->isSubmitted() && $form->isValid()) { $em = $this->getDoctrine()->getManager...
[ "public function createAction()\n {\n\n if (!$this->request->isPost()) {\n return $this->dispatcher->forward(array(\n \"controller\" => \"proveedores_direcciones\",\n \"action\" => \"index\"\n ));\n }\n\n $proveedores_direccione = new Prove...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
displaytype can be edit,display, or displayro bk: NOTE: might be a good idea to create a class to use for the layers
function display($displaytype) { global $SESSION; require_once("{$this->cfg->libdir}/smarty/Smarty.class.php"); // ******************************************************************* // prepare and display the positioning board // ***********************************...
[ "public function getDisplayType()\n {\n return $this->display_type;\n }", "public function setDisplayType($display_type)\n {\n $this->display_type = $display_type;\n }", "function getTypeDisplayList()\n{\n return array('record_type_display', 'parent_type_display', 'record_type_displ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ Identify which meta package is installed
function get_meta_pkg_name() { global $g; /* XXX: Use pkg annotation */ if (is_pkg_installed(g_get('product_name'))) { return g_get('product_name'); } foreach (g_get('alternativemetaports') as $suffix) { if (is_pkg_installed(g_get('product_name') . '-' . $suffix)) { return g_get('product_name') . '-' . $su...
[ "protected function initialPackageMetadata() {\n return [\n \"name\" => \"drupal/core-dev\",\n \"type\" => \"metapackage\",\n \"description\" => \"require-dev dependencies from drupal/drupal; use in addition to drupal/core-recommended to run tests from drupal/core.\",\n \"license\" => \"GPL-2...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
groupPrices Group the prices for each attribute value in an associative array
protected function groupPrices(array $input, array $special, $attr, $attr_price) { $values = array(); foreach($special as $simple) { //Skip empty values if($input[$attr_price][$simple] === '') { if(self::DEBUG) echo 'Skipping empty value: ' . $input[$attr_price][...
[ "private function organizePrices(): void\n {\n $newGroups = [];\n\n foreach($this->groups as $groups) {\n foreach($groups as $group) {\n $newGroups[(int) $group[\"totalPrice\"]] = $group;\n }\n }\n sort($newGroups);\n\n $this->groups = $newG...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns Application Cryptogram. For EMV payments, the cryptogram generated for the payment.
public function getApplicationCryptogram(): ?string { if (count($this->applicationCryptogram) == 0) { return null; } return $this->applicationCryptogram['value']; }
[ "public function generateHash($application)\n {\n $merchantId = Config::get('ingenico.merchantId');\n $txnId = $application->reference_code;\n $amount = $application->approved_loan_emi;\n $itemId = Config::get('ingenico.scheme_code'); //scheme code\n $comAmt = Config::get('inge...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get current ID of shop group if context is CONTEXT_SHOP or CONTEXT_GROUP
public static function getContextShopGroupId($null_value_without_multishop = false){ if ($null_value_without_multishop && !JeproshopShopModelShop::isFeaturePublished()){ return null; } return self::$context_shop_group_id; }
[ "public static function getContextShopGroupId($nullValueWithoutMultiShop = false){\n if ($nullValueWithoutMultiShop && !JeproshopShopModelShop::isFeaturePublished()){\n return null;\n }\n return self::$context_shop_group_id;\n }", "public function getCurrentShopId()\n {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }