query
stringlengths
10
8.11k
document
stringlengths
17
398k
negatives
listlengths
19
20
metadata
dict
Generated from protobuf field string total_share = 33;
public function getTotalShare() { return $this->total_share; }
[ "function bimber_essb_entry_share_count() {\n $counters = bimber_essb_get_sharecount();\n\n $number = isset( $counters['total'] ) ? $counters['total'] : 0;\n\n return $number;\n\n//\treturn bimber_essb_get_post_sharecount();\n}", "public function setTotalShare($var)\n {\n GPBUtil::checkString($...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get the cycleBudgets for the model.
public function cycleBudgets() { return $this->hasMany(CycleBudget::class); }
[ "public function budgets()\n {\n # Defines A One-To-Many Relationship\n return $this->hasMany('App\\Budget');\n }", "public function budgets()\n {\n \treturn $this->hasMany(Budget::class);\n }", "public function getCycles()\n {\n return $this->cycles;\n }", "public fu...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the name of the variable the condition is evaluated for.
public function getVariableName() { return $this->variableName; }
[ "public function getVarName()\n {\n return $this->varName;\n }", "public function getVarName(): string\n {\n return $this->varName;\n }", "public function variableExpression()\n {\n return (string) $this->data->variableExpression;\n }", "public function getVarName() {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Convert all elements to string.
public function __toString() { $return = ''; foreach ($this as $element) { $return .= (string) $element; } return $return; }
[ "protected function to_string($arr){\n\t\t\t\n\t\t}", "public static function convertToString($element) {\n if (is_array($element)) {\n return (string) \\Drupal::service('renderer')->renderPlain($element);\n }\n else {\n return (string) $element;\n }\n }", "private function listToText(arr...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Return the match rules of this league.
public function getMatchRules() { return $this->matchRules; }
[ "public function getMatchingRules()\n {\n return $this->_matchingRules;\n }", "public function getRules();", "public function getRules(): array\n {\n return $this->aRules;\n }", "public function get_all_rules() {\n\t\treturn $this->rules;\n\t}", "public function getContestRules()\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Set option for field, that is not already chained.
public function setOption($field, $option, $value) { if (isset($this -> fields[$field][0]) && $this -> fields[$field][0] == 'chain') { throw new \BadMethodCallException('Method setOption() does not work with chain rules!'); } $this -> fields[$field][1][$option] = $value;...
[ "public function setOption($key, $value = null);", "public function setOption($name, $value);", "public function setOption($key, $value);", "public function setOption($name, $value)\n {\n if ($name == 'cached_entity') {\n $this->setCachedEntity($value);\n } else {\n pare...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
CSS for Block Editor
public function blockEditorStyle() { wp_enqueue_style('td-editor-block-style', get_stylesheet_directory_uri() . td_asset_path('css/gutenberg.css'), [], null, 'screen'); }
[ "function plume_block_editor_styles() {\n\t// Enqueue the editor styles.\n\twp_enqueue_style('plume-block-editor-styles', get_theme_file_uri('/assets/css/editor-style-block.css'), array(), wp_get_theme()->get('Version'), 'all');\n\n\t// Add inline style from the Customizer.\n\t// wp_add_inline_style('plume-block-ed...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Test find By Index
public function testFindByIndex() { $users = User::findByIndex('userAge', 24, 37); $this->assertCount(3, $users); foreach ($users as $user) { $this->assertInstanceOf('sweelix\yii2\nosql\riak\ActiveRecord', $user); } }
[ "public function testIndexOf()\n {\n $this->assertEquals(1, $this->object->indexOf('456'));\n }", "public function testIndexOf() {\n\t\t$array = array(1, 2, 3, 4, 5);\n\t\t$result = _::indexOf($array, 4);\n\t\t$this->assertEquals(3, $result);\n\n\t\t// test not finding an element's index\n\t\t$result...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Update round status after round is cleared
public function clearRound() { $connMgr = new ConnectionManager(); $pdo = $connMgr->getConnection(); $successfulBids = new StudentSectionDAO(); $roundDetails = $this->retrieveRoundDetail(); $round = $roundDetails->getRoundID(); if ($round == 1){ ...
[ "public function saveRound()\n {\n if (in_array(1, $this->values) == false) {\n $this->sumTotal += $this->sumRound;\n $this->initRound();\n }\n }", "private function updateRoundCount() : void\n {\n $this->rounds = $this->matchDays->count();\n }", "public fu...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
try and find a logo (images are in the data directory)
function find_logo($party_name){ $return = false; $logos_dir = dirname(__FILE__) . "/data/party_logos/"; for ($i=1; $i < 4; $i++) { $test_file = $logos_dir . $party_name . '_' . $i . '.gif'; if (file_exists($test_file)){ $return = $test_file; ...
[ "function get_logo() {\n return File::exists('assets/images/logo-user.png')\n ? asset('assets/images/logo-user.png')\n : asset('assets/images/logo-default.png');\n }", "function haLogo()\n {\n if (empty($this->url_logo)) {\n return false;\n }\n\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Remove unused admin bar items
function remove_unused_admin_bar() { global $wp_admin_bar; $wp_admin_bar->remove_menu( 'wp-logo' ); $wp_admin_bar->remove_menu( 'about' ); $wp_admin_bar->remove_menu( 'wporg' ); $wp_admin_bar->remove_menu( 'documentation' ); $wp_admin_bar->remove_menu( 'support-forums' ); $wp_admin_bar->remove_menu( 'feedback' )...
[ "public function remove_admin_bar_items() {\n\t\t\tglobal $wp_admin_bar;\n\n\t\t\tforeach ( $this->admin_bar as $ab_item ) {\n\t\t\t\t$wp_admin_bar->remove_node( $ab_item );\n\t\t\t}\n\n\t\t}", "public function cleanAdminBar()\n\t{\n\t\tglobal $wp_admin_bar;\n\n\t\t$wp_admin_bar->remove_menu('wp-logo'); //...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns an array containing the compiled routing information based off of the provided resource objects. !!! WARNING !!! This will use the cached version of the table if available without checking for updates. It is the end users job to ensure that this cache file is kept updated.
public function getRoutingTable(array $resources) { if (($table = $this->cache->get("router"))) { return $table; } $table = array( "static" => array(), "dynamic" => array() ); foreach ($resources as $resourceName) { $routes = ...
[ "public function buildRoutingTableEntryForResource($resourceName)\n {\n $table = array(\n \"static\" => array(),\n \"dynamic\" => array()\n );\n\n $urlTools = $this->urlTools;\n $reflection = new ReflectionClass($resourceName);\n\n foreach ($reflection->ge...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Stream large object values. NOTE: This feature is currently experimental. Generated from protobuf field .google.cloud.datastream.v1.OracleSourceConfig.StreamLargeObjects stream_large_objects = 102;
public function getStreamLargeObjects() { return $this->readOneof(102); }
[ "public function setStreamLargeObjects($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Cloud\\Datastream\\V1\\OracleSourceConfig\\StreamLargeObjects::class);\n $this->writeOneof(102, $var);\n\n return $this;\n }", "public function getLargeObjects()\n {\n return $this->largeO...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get AvardaCheckOutClient script path for Require.js.
public function getCheckOutClientScriptPath() { return $this->config->getCheckoutJsUrl(); }
[ "public function getClientScriptUrl() : string\n {\n $endpoints = new Endpoints();\n return $endpoints->getClientScriptUrl(PureClarity::getInstance()->getConfig('access_key'));\n }", "static function frontend_script_src() {\n\t\t$scriptDir = basename(dirname(dirname(__DIR__))) . '/javascript';...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets Source Application. Represents information about the application used to generate a change.
public function setSourceApplication(?SourceApplication $sourceApplication): void { $this->sourceApplication = $sourceApplication; }
[ "public function setApplication($value);", "public function setApp(Application $app){\n \t$this->app = $app;\n }", "public function setApplicationSource(string $newApplicationSource) {\n\t\t$newApplicationSource = trim ($newApplicationSource);\n\t\t$newApplicationSource = filter_var($newApplicationSource,...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Step 3 display the extra data in the order admin panel
function sls_display_order_data_in_admin( $order ){ ?> <div class="order_data_column"> <h4><?php _e( 'Extra Details', 'woocommerce' ); ?></h4> <?php echo '<p><strong>' . __( 'Skill Rating: ' ) . ':</strong>' . get_post_meta( $order->id, '_skill_rating', true ) . '</p>'; ech...
[ "function admin_edit_order() {\n\t\t//\n\t}", "function display_fields_for_order_details(){\r\n\r\n\t\t/**\r\n\t\t * Position 1 - Display inside order total after shipping method\r\n\t\t */\r\n\t\tadd_filter( 'woocommerce_get_order_item_totals', [$this, 'display_after_shipping_method'], 10, 2 );\r\n\r\n\t\t/**\r\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
testControlCustomization method Tests the input method and passing custom options.
public function testControlCustomization() { $this->getTableLocator()->get('Contacts', [ 'className' => ContactsTable::class ]); $this->Form->create([], ['context' => ['table' => 'Contacts']]); $result = $this->Form->control('Contact.email', ['id' => 'custom']); $expe...
[ "#[@test]\n public function doOptions() {\n $this->assertHandlerForMethodTriggered('OPTIONS');\n }", "public function testMeOptions()\n {\n\n }", "public function testOptions() {\n $this->executeMethod('OPTIONS', FALSE);\n }", "public function testOptionsMethod()\n {\n $client = $this...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Generate a unique email authentication code.
public function generateUniqueEmailAuthenticationCode() { return $this->generateUnique( 'email_authentication_code' ); }
[ "protected function genAuthCode() {\n return md5(base64_encode(pack('N6', mt_rand(), mt_rand(), mt_rand(), mt_rand(), mt_rand(), uniqid())));\n }", "function randomCode(){\n\t\t$characters = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';\n\t\t$result = '';\n\t\tfor ($i = 0; $i < 40; $i++)\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
handle rec candidate avar file
function handle_rec_candidate_avar_file($id){ if (isset($_FILES['cd_avar']['name']) && $_FILES['cd_avar']['name'] != '') { hooks()->do_action('before_upload_contract_attachment', $id); $path = RECRUITMENT_MODULE_UPLOAD_FOLDER .'/candidate/avartar/'. $id . '/'; // Get the temp file ...
[ "public function RiceviFile($fileSdIAccoglienza);", "function loadfile($handle)\n\t\t{\n\t\tif (isset($this->varkeys[$handle]) and !empty($this->varvals[$handle]))\n\t\t\treturn true;\n\n\t\tif (!isset($this->file[$handle]))\n\t\t\t{\n\t\t\t$this->halt(\"loadfile: $handle is not a valid handle.\");\n\t\t\treturn ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
muestra la lista de rubros
function showRubros() { // obtiene los rubros del modelo $rubros = $this->model1->getAll(); // actualizo la vista $this->view->showRubros($rubros); //var_dump($rubros); //die; }
[ "private function getMagRubs() {\n\t\t\t//PDO\n\t\t\t$query = $this->pdo->prepare(\"SELECT id, titre, titreind, ordre, titreall FROM 2emag_rubriques ORDER BY id ASC\");\n\t\t\t$query->execute();\n\t\t\t//Création array\n\t\t\t$rubriques = array();\n\t\t\t//Boucle\n\t\t\twhile ($data = $query->fetch(PDO::FETCH_ASSOC...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
returns the groupColumn according to name else null
public function getColumnByName($columnName) { $result = null; foreach ($this->_groupColumns as $column) { if ($column->getColumnName() == $columnName) { $result = $column; break; } } return $result; }
[ "public function getDataGroupByName($name) {\n\t\tforeach ($this->datas as $data) {\n\t\t\tif (($data instanceof DataGroup) && $data->getName() == $name) {\n\t\t\t\treturn $data;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}", "public function groupingColumn(){\n return $this->_groupingColumnIndex;\n }", ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Generates a callout panel
public static function callout($content, $htmlOptions = array()) { ArrayHelper::addValue('class', Enum::PANEL_CALLOUT, $htmlOptions); return static::panel($content, $htmlOptions); }
[ "function wpex_footer_callout() {\n\tif ( wpex_has_callout() ) {\n\t\twpex_get_template_part( 'footer_callout' );\n\t}\n}", "function wpcampus_print_2017_callout() {\n\t?>\n\t<div class=\"panel\" style=\"text-align:center;\">\n\t\t<h2>WPCampus 2017 Conference on July 14-15</h2>\n\t\t<p><a href=\"https://2017.wpca...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
For owner to check if all the players have voted
function checkAllVoted($roomId){ $sql = "select count(t.PLAYER) from TEMP_ROOM_" .$roomId. " t where STATUS != 'V' and t.STATUS != 'D';"; $dataProcessor = new DataProcessor(); $res = $dataProcessor -> execute_dql($sql); $count = $res -> fetch_row()[0]; $res -> free(); ret...
[ "function hasVoted() {\n\t\treturn $this->voteHandler->hasVoted();\n\t}", "function has_voted($user){\n\t\treturn in_array($user, get_voted_users()); \n\t}", "public function hasAlreadyVotedById($voterId);", "function canVote() {\n\t\treturn forge_check_perm('tracker', $this->getID(), 'vote');\n\t}", "funct...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Getting a app service provider
public function getAppProvider() { return $this->getProvider(app\Provider::class); }
[ "public function provider(){\n if ( !is_null( $this->provider ) ){\n $classProvider = 'App\\Services\\\\'.$this->provider;\n return new $classProvider( $this->slimApp );\n }\n\n }", "protected function provider()\n {\n if (empty($this->provider)) {\n $th...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ Select2 Kategoria wydatku
public function s2_kategorie_wydatku() { $this->load->model("Wydatki_model", "wyd"); $this->wyd->kategorie_wydatku(); }
[ "public function select2Categories () {\r\n $categories = get_categories( array( 'hide_empty' => 0 ) );\r\n $catCount = 0;\r\n $categoriesData = '';\r\n foreach( $categories as $category ):\r\n $categoriesData[$catCount]['id'] = $category->term_id;\r\n $categoriesData[$catCount]['text'] = $cat...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets Gets Public URL from Crn
public function publicUrlFromCrn($crn) { return $this->urlFromCrn($crn, 'Public'); }
[ "public function cdn_url();", "public function getPublicUri (): string;", "public function getExternalUrl();", "public function getUrl($public_id) \n { \n \\Cloudinary::config(array( \n \"cloud_name\" => $this->cloud_name,\n \"api_key\" => $this->api_key,\n \"api_secret\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Ordena a melhor review do jogo com id $id
public function actionTopreview($id) { $model = new $this->modelClass; $modelReview = new \app\modules\v1\models\Review; $review = $modelReview::find()->where(['Id_jogo' => $id])->orderBy(['Score' => SORT_DESC])->all(); $jogo = $model::find()->where(['Id' => $id])->all(); /* var_...
[ "function theRatingReview( $id )\r\n\t\t{\r\n\t\t\t$STH = $this->DBH->query('SELECT ratingReview from shdw_products WHERE id ='. $id ); \r\n\t\t\t# Get results by row\r\n\t\t\twhile( $row = $STH->fetch() )\r\n\t\t\t\t$this->ratingReview = $row['ratingReview'];\t\r\n\t\t\t\r\n\t\t\treturn $this->ratingReview;\r\n\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Render PHP fatal error admin notice.
private static function render_php_fatal_error_admin_notice( WP_Post $post ) { $error = get_post_meta( $post->ID, self::PHP_FATAL_ERROR_POST_META_KEY, true ); if ( empty( $error ) ) { return; } $error_data = json_decode( $error, true ); if ( ! is_array( $error_data ) || ! isset( $error_data['message'], $er...
[ "public static function fatalError()\n {\n http_response_code(500);\n $error = error_get_last();\n if($error[\"type\"] === E_ERROR)\n {\n extract(array(\n \"title\" => $error[\"message\"],\n \"file\" => $error[\"file\"],\n \"line...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Finds and displays a recette entity.
public function showAction(Recette $recette) { $deleteForm = $this->createDeleteForm($recette); return $this->render('recetteclient/show.html.twig', array( 'recette' => $recette, 'delete_form' => $deleteForm->createView(), )); }
[ "function action_show_entity_detail() {\n $rc = rcmail::get_instance();\n\n /** @var rcmail_output_html $output */\n $output = $rc->output;\n\n $type = $this->getInput(self::INPUT_ENTITY_TYPE, rcube_utils::INPUT_GET);\n\n switch ($type) {\n case self::ENTITY_FILTER:\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get request to fetch the users current signature
public function getSignature(Request $request) { $user = $request->get('auth'); $userdata = UserHelper::getUserDataOrCreate($user->userId); return response()->json( [ 'signature' => $userdata->signature, 'parsedSignature' => $userdata->getParsedSignat...
[ "private function get_signature()\n {\n }", "public function getSignatureStatus(){\n $command = new Command($this->host, self::SIGNATURES_GET,\"GET\", $this->enableCache, $this->cacheLifetime, $this->cacheFolder);\n $command->execute();\n return $command->getData(\"signature\");...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This method is used to retrieve the service validating URL of the CAS server.
public function getServerServiceValidateURL() { phpCAS::traceBegin(); // the URL is build only when needed if(empty($this->server['serviceValidateUrl'])) { $this->server['serviceValidateUrl'] = $this->_getServerBaseURL() . 'validate'; } // $url = $this->_buildQueryUrl($this->server['serviceValidateUrl']...
[ "public function getServerServiceValidateURL()\n {\n phpCAS::traceBegin();\n // the URL is build only when needed\n if ( empty($this->_server['service_validate_url']) ) {\n switch ($this->getServerVersion()) {\n case CAS_VERSION_1_0:\n $this->_server['ser...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Accessor Get the Doctor Name
public function getDoctorNameAttribute() { // return $value; return ['id' => $this->refered_by, 'name' => $this->user->name ?? null]; }
[ "public function getDoctorName(): string;", "public function obtenerDoctor(){\n \t$doctor = (new Doctor)->find($this->doctor_id);\n \treturn $doctor->name;\n\n }", "public function getDoctor() {\n if (isset($this->rSchedule) && isset($this->rSchedule->rDoctor)) {\n return $this->rSche...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Adds the filter links to the view_edit screens to give the user a filter link.
public function add_filter_links() { }
[ "public function add_filter_link(array $views)\n {\n }", "public function add_filter_url_to_filters() {\n\t\tforeach ($this->filters as &$filter) {\n\t\t\tif ($this->type=='list') {\n\t\t\t\t$filter['url'] = $this->reefine->create_url($this->reefine->get_filter_url($this->group_name,$filter['filter_...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
DOWN /editar.php/materials/down Parametros por URL: Identificador del material
public function executeDown() { $material = MaterialPeer::retrieveByPk($this->getRequestParameter('id')); $this->forward404Unless($material); $material->moveDown(); $material->save(); return $this->renderComponent('materials', 'list'); }
[ "public static function editMaterial()\n\t\t{\n\t\t\t$materialID = $_POST['material_id'];\n\n\n\t\t\t//GRAB MATERIAL INFO BASED ON MATERIAL ID LISTED ABOVE\n\t\t\t$stageDBO = DatabaseObjectFactory::build('material');\n\t\t\t$arr = ['material_id', 'name','unit_price','current_price','min_price'];\n\t\t\t$stageDBO->S...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Set the nb h chom part tech.
public function setNbHChomPartTech($nbHChomPartTech) { $this->nbHChomPartTech = $nbHChomPartTech; return $this; }
[ "public function testSetNbHChomPartCp() {\n\n $obj = new Bulletins();\n\n $obj->setNbHChomPartCp(10.092018);\n $this->assertEquals(10.092018, $obj->getNbHChomPartCp());\n }", "public function testSetNbJChomPartCp() {\n\n $obj = new Bulletins();\n\n $obj->setNbJChomPartCp(10.0...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Populate the ranges instance variable with an array, with each element representing one range and consisting of a reference to the range entity, a list of restricted country ids permitted by this range, and the count of free permit numbers remaining within this range
private function populateRanges(array $rangeEntities) { $this->ranges = []; foreach ($rangeEntities as $rangeEntity) { $allocatedPermitsInRange = $this->getRepo('IrhpPermit')->getPermitCountByRange($rangeEntity->getId()); $permitsRemainingInRange = $rangeEntity->getSize() - $...
[ "public function ranges()\n {\n return $this->ranges;\n }", "protected function calculateRanges()\n {\n $this->ranges = array();\n\n foreach ($this->schema->getFields() as $field) {\n $min = INF;\n $max = 0;\n\n foreach ($this->nodes as $node) {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Index Display tree page of all POI's. Accepts an optional ID for highlighting / expanding a given leaf.
public function index($id = null) { return $this->layout('pages.poi.index', array('id' => $id)); }
[ "public function treeAction($id) {\n //Obtain the routes for each document\n $pool = $this->get('sonata.admin.pool');\n $classes = $pool->getAdminClasses();\n $adminClasses = array();\n\n foreach ($classes as $class) {\n $instance = $this->get($class);\n $rou...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Use the query builder and the $joins to get a set of ILMSession based user events
protected function getIlmSessionEventsFor(int $id, DateTime $from, DateTime $to, array $joins): array { $qb = $this->_em->createQueryBuilder(); $what = 'c.id as courseId, s.id AS sessionId, school.id AS schoolId, ilm.id, ilm.dueDate, ' . 's.updatedAt, s.title, st.calendarColor, ' . ...
[ "public function getUserEvents(): ActiveQueryInterface\n {\n return $this->hasMany(UserEvent::class, ['event_id' => 'event_id']);\n }", "public function getUserevents()\n {\n return $this->hasMany(Userevent::className(), ['user_id' => 'id']);\n }", "protected function getOfferingEvents...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ return columns hidden
public function get_hidden_columns(){ return array(); }
[ "public function get_hidden_columns()\n\t{\n\t\t\treturn array();\n\t}", "public function get_hidden_columns(){\n\t\treturn array();\n\t}", "public function get_hidden_columns()\r\n {\r\n return array();\r\n }", "public function get_hidden_columns()\n\t{\n\t\treturn array();\n\t}", "public func...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
constructs a ServerContainer from an array of server variables
public function __construct($arr){ $this->serverVars=$arr; }
[ "public static function create(array $serverProperties);", "public function injectServerVars(array $serverVars)\n {\n $this->serverVars = $serverVars;\n }", "public static function collectServerVariables(array $variables): void\n {\n static::$serverVariables = array_merge(static::$serverV...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Set Ajax form custom map icon via search query.
function gmw_ps_ajaxfmsgl_get_map_icons_via_query( $args, $gmw ) { $icon_query = gmw_ps_gl_get_map_icons_via_query( $gmw ); if ( ! empty( $icon_query ) ) { $args['db_fields'] .= ', ' . $icon_query; } return $args; }
[ "function WPBikeRent_Theme_map_icon(){ \n\t\t$testlogo2 = 'img_map_logo';\n\t\techo $this->WPBikeRent_Theme_image_uploader_field( $testlogo2, get_option('img_map_logo') );\n\t}", "public function search_icon_view() {\n\n\t\t\tget_template_part( 'views/site/search/search-icon' );\n\n\t\t}", "function includeM...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get a stream array of the connected Geospaces based on direction
private function get_connected_geospaces( $dir ) { return $this->get_connected_geospaces_stream( $dir ); }
[ "private function get_connected_geospaces_stream( $dir ) {\n $post_type_name_plural = true;\n $post_type_name_sanitize = true;\n $sanitized_name = $this->get_post_type_name( $post_type_name_plural, $post_type_name_sanitize );\n $connection_type = $sanitized_name . '_to...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets a new explicitText
public function setExplicitText($explicitText) { $this->explicitText = $explicitText; return $this; }
[ "public function setText($text);", "public function setText($text) {\n\t\t$this->text = htmlentities($text);\n\t}", "public function setText($text)\n {\n $this->addText = true;\n $this->text = $text;\n }", "public function set_text( $text ) {\n\t\t$this->text = addslashes( $text ); // is t...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get corresponding divvit tag/tracker url
public function getDivvitUrl($type = '') { if ($type == 'tag') { if (getenv('DIVVIT_TAG_URL') != '') { return getenv('DIVVIT_TAG_URL'); } else { return 'https://tag.divvit.com'; } } else { if (getenv('DIVVIT_TRACKING_URL...
[ "public function getTrackUrl();", "public function get_tracking_url(){\n\t\treturn $this->v_tracking_url;\n\t}", "public function getTrackingTag() {\n if (Mage::helper('peerius_smartrecs')->isTestMode()) {\n return '<script type=\"text/JavaScript\" src=\"//uat.peerius.com/tracker/peerius.page\" charset=...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Bangladesh mobile number validation
function bangladesh_mobile_validation($mobile){ $regex = '/01[^1-4]\d{8}/'; if (preg_match($regex,$mobile)) { return 1; }else { return 0; } }
[ "function checkMobileValidation($mobile){\r\r\n global $mycms,$cfg;\r\r\n if(substr($mobile, 0, 1)=='+'){\r\r\n $mobile = substr($mobile, 3);\r\r\n }\r\r\n //$mobile = $mycommoncms->getFieldValue($mobile);\r\r\n $mobileLen = strlen($mobile);\r\r\n $checkMobile = checkNumberValidation($mobile);\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets the html to display a project's tags
function getTags($project) { $str = ""; if ($project->tags) { $str .= "<br /><h4 style='margin: 0'>Tags: </h4><p>"; $length = count($project->tags); for ($i = 0; $i < $length; $i++) { $tag_name = $project->tags[$i]; //only put comma if ...
[ "function getTags($project) {\n $str = \"\";\n if ($project->tags) {\n $str .= \"<br /><h2 style='margin: 0'>Tags: </h2><p>\";\n $length = count($project->tags);\n for ($i = 0; $i < $length; $i++) {\n $tag_name = $project->tags[$i];\n //on...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Operation salesStagesIdGetWithHttpInfo Spinen&39;s PHP ConnectWise Client for Sales API generated by Swagger Code Generator.
public function salesStagesIdGetWithHttpInfo($id) { // verify the required parameter 'id' is set if ($id === null) { throw new \InvalidArgumentException('Missing the required parameter $id when calling salesStagesIdGet'); } // parse inputs $resourcePath = "/sales/...
[ "public function defStagesGetWithHttpInfo()\n {\n $returnType = '\\Swagger\\Client\\Model\\InlineResponse20078[]';\n $request = $this->defStagesGetRequest();\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Determine if cropping is allowed.
protected function canCrop() { return !empty($this->crop); }
[ "private function isCroppingNeeded()\n {\n if ($this->getRequest()->isCropping() && $this->getRequest()->cropRatio['ratio'] != $this->getSource()->getRatio()) {\n return true;\n } else {\n return false;\n }\n }", "public function isCropped() {\r\n \r\n return (bool) $this->crop;...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets the "AttributeValueList" variable value.
public function setAttributeValueList($value) { return $this->set(self::REQUEST_ATTRIBUTE_VALUE_LIST, $value); }
[ "public function setProductOptionAttributes(array $list)\n {\n $this->optionAttributes = $list;\n }", "public function SetTagAttributeWhitelist ($list)\n\t{\n\t\t$this->_tagAttributeWhitelist = $list;\n\t}", "public function setList($list = array())\n {\n if (!is_array($list)) {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns fields within the given "import data type" by "include type"
public function get_import_fields_for($data_type, $include_type = 'all') { // if not a main key, reject if ( ! in_array($data_type, $this->get_import_data_types())) throw new \Exception(); // if including 'all' be sure to include both "required" and "available" if ($incl...
[ "abstract protected function getIncludeFields();", "function affwp_do_import_fields( $type ) {\n\t$fields = array();\n\n\tswitch( $type ) {\n\t\tcase 'affiliates':\n\t\t\t$fields = affwp_get_affiliate_import_fields();\n\t\t\tbreak;\n\n\t\tcase 'referrals':\n\t\t\t$fields = affwp_get_referral_import_fields();\n\t\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get top rated word translation
public function getTopRatedTranslation($word) { if (($translations = $this->getTranslations($word)) && isset($translations[0]) && isset($translations[0]['value']) ) { return $translations[0]['value']; } return null; }
[ "public function getLatestText2()\n \t{\n \t\t$lastIndex = sizeof($this->statuses) - 2;\n \t\treturn ($this->statuses[$lastIndex]->text);\n \t}", "public function getTranslation();", "private function getMostUsedWords()\n {\n return unserialize(file_get_contents($this->getFilePath('mostUsedWords.txt')...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Determines if a specified user can view a specific issue.
function otherUserCanViewIssue( $user, $issueID ) { $query= "SELECT Level FROM issues WHERE ID = '$issueID'"; $result = mysql_query($query); $value = mysql_fetch_array($result); extract($value); $query2 = "SELECT Creator FROM issues WHERE ID = '$issueID'"; $result2 = mysql_query($query2); $value2 =...
[ "function can_view_issue($issueid,$userid = null) {\n\tif (Permission::is_manager()) {\n\t\treturn TRUE;\n\t}\n\t$user_groups = is_null($userid) ? $_SESSION['groups'] : user_groups($userid);\n\t$groups = issue_groups($issueid);\n\tforeach ($groups as $group) {\n\t\tif (in_array($group['gid'],$user_groups)) {\n\t\t\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Set the value of compatibleChat
public function setCompatibleChat($compatibleChat) { $this->compatibleChat = $compatibleChat; return $this; }
[ "public function setChat(Up_Chat $value)\n {\n return $this->set(self::_CHAT, $value);\n }", "public function setChat($val)\n {\n $this->_propDict[\"chat\"] = $val;\n return $this;\n }", "protected function _set_chat()\n\t{\n\t\tif(empty($this->_user))\n\t\t{\n\t\t\t$chat_vars =...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Update the quantity of subscription
public function quantity(Request $request,$name){ $user=$request->user(); $this->authorize('update', $user); $this->validate($request,[ 'quantity'=>'required|string', ]); $subscription=$user->subscription($name); if(!$subscription){ ret...
[ "public function updateQtyAction()\n {\n try {\n $invoice = $this->_initInvoice(true);\n \t$this->_changeInvoice($invoice);\n\n $this->loadLayout();\n $response = $this->getLayout()->getBlock('order_items')->toHtml();\n } catch (Mage_Core_Exception $e) {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the vCard field name for the given Portable Contacts field/value, or null if there is no corresponding field.
private static function getVcardFieldName($fieldName, $fieldValue) { $vCardFieldName = null; if (isset(self::$_fieldNames[$fieldName])) { $vCardFieldName = self::$_fieldNames[$fieldName]; } else if ($fieldName == 'ims' && isset($fieldValue->type) && isset(self::$_imFieldNamesByType[$fieldValue->type])...
[ "public function field_name($num)\n {\n $this->check_connection();\n\n $info = $this->field_info_by_num($num);\n if (!$info) {\n return null;\n }\n\n return $info[\"name\"] ?? \"\";\n }", "public function get_contact_name(){\n\t\treturn $this->v_contact_name;\n\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
printStyles Compile the head script(js) sources to html `` elements.
public function printHeadScriptSrcs(){ return $this->printScriptsFromSource($this->view['headScriptSrcs']); }
[ "function backend_scripts_print() {\r\n\t\trequire_once( WP_HOME_MNGT_BACKEND_TPL_DIR . 'js/header.js.php' );\r\n\t}", "public function printStyles()\n {\n foreach($this->styles as $css) {\n echo '<link href=\"' . osc_apply_filter('style_url', $css) . '\" rel=\"stylesheet\" type=\"text/css\" ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the tax group from the event.
protected function getTaxGroupFromEvent(ResourceEventInterface $event) { $resource = $event->getResource(); if (!$resource instanceof TaxGroupInterface) { throw new InvalidArgumentException('Expected instance of ' . TaxGroupInterface::class); } return $resource; }
[ "public function getTaxGroup() \n {\n return $this->taxGroup;\n }", "public function getEventGroup()\n {\n return array_get($this->eventDetails(), 'group');\n }", "public function getTaxes() {\n $qu = \"SELECT p.id_tax_rules_group as id_tax, p.name FROM `\" . _DB_PREFIX_ . \"ta...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/Debuelve arreglo asociativo arrayOferta
public function getListaOferta(){ $tbOferta = new TbOferta(); $result = $tbOferta->resultOferta(); $count = 0; while ($arrayOf = pg_fetch_assoc($result)) { $this->arrayOferta[$count]['oferta_codigo'] = $arrayOf['oferta_codigo']; $this->arrayOferta[$count]['empresa_codigo'] = $arrayOf['empresa_codigo...
[ "public function toArray() {}", "private function getArrayCompras(){\n $data = file_get_contents(\"../../../assets/json/purchases-v2.json\");\n return $comprasCliente = json_decode($data, true);\n }", "public function toArray()\n {\n /** @var integer $indice Índice do array para o con...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Display lists from shortcode [mmc_display_lists]
public static function shortcodeDisplayLists($atts, $content = null, $code = '') { if (is_feed()) return ''; self::displayLists(); }
[ "static public function show_list( $atts ) {\n\t\n\t\tself::$listAtts = shortcode_atts( self::$listDefaultAtts, self::fix_bool_atts( $atts ) );\n\t\t\n\t\t$places = self::string_to_array( get_option( 'travelmap_data' ) );\n\t\n\t\t// Filter out only the destinations that are supposed to be shown\n\t\t$places = self...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
===== create function for setting html content type, to be ref'd in the email compilation functions
function set_html_content_type() { return 'text/html'; }
[ "public function set_mail_content_type() {\n return 'text/html';\n }", "function buddyboss_force_html_email( $content_type ) {\n\t$content_type = 'text/html';\n\treturn $content_type;\n}", "function wpmm_change_mail_content_type($content_type) {\r\n\treturn 'text/html';\r\n}", "function swsctp_chang...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
metodo set de la id del poi de la clase diariPoi
function setIdPoi($idPoi) { $this->idPoi = $idPoi; }
[ "function setId_poi($id_poi) {\n $this->id_poi = $id_poi;\n }", "function getIdPoi() {\n return $this->idPoi;\n }", "function setIdPessoa( $idPessoa ) {\n $this->idPessoa = $idPessoa;\n }", "function __construct($idDiario, $idPoi) {\n $this->idDiario = $idDiario;\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Retrieves a server variable by its' key.
public function getServerVariable(string $key): mixed;
[ "public function getServerVariable(string $key): mixed\n {\n return $this->serverVariables[$key];\n }", "public function get($key) {\n\t $keyStr = $this->db->quote($key);\n\t $rows=$this->db->query(\"select varValue from FLX_VARS where sessionID=\\\"$this->sessionID\\\" and varKey=$keyStr\");\n\t ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns an array of CSS URIs.
public function get_css() { // Return all of the CSS URIs in an array return array_keys($this->_css); }
[ "public function getCssUrlArray(): array {\n\t\treturn static::BASE_CSS_URL + [\n\t\t\t\t'?' => $this->_getQuery(),\n\t\t\t];\n\t}", "public function getCss() {\n $arr = [];\n foreach ($this->css as $css) {\n if (preg_match(\"/^([a-z]+\\:)?\\/\\//i\", $css))\n $arr[] = $css;\n else\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Associate the cart item with the given rowId with the given model.
public function associate($rowId, $model) { if ( is_string($model) === true && class_exists($model) === false ) { throw new UnknownModelException("The supplied model {$model} does not exist."); } $cartItem = $this->get($rowId); $cartItem-...
[ "public function associate($rowId, $model)\n {\n if (is_string($model) AND !class_exists($model)) {\n throw new UnknownModelException(\"The supplied model {$model} does not exist.\");\n }\n\n $cartItem = $this->get($rowId);\n\n $cartItem->associate($model);\n\n $cont...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Total time spent on all queries and connections
public function time () { $time = 0; /** * @var DB\_Abstract $c */ foreach ($this->connections[self::CONNECTIONS_MASTER] as $c) { $time += $c->connecting_time() + $c->time(); } foreach ($this->connections[self::CONNECTIONS_MIRROR] as $c) { $time += $c->connecting_time() + $c->time(); } return ...
[ "function time_queries () {\n\t\t$t_count = count( $this->queries_array );\n\t\t$t_total = 0;\n\t\tfor ( $i = 0; $i < $t_count; $i++ ) {\n\t\t\t$t_total += $this->queries_array[$i][1];\n\t\t}\n\t\treturn $t_total;\n\t}", "public static function totalQueryTime()\n\t\t{\n\t\t\treturn self::$totalQueryTime;\n\t\t}",...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Show the application registration form.
public function showRegistrationForm() { // return view('auth.register'); }
[ "public function showRegistrationForm()\n {\n abort_unless(config('access.registration'), 404);\n\n return view('frontend.auth.register');\n }", "public function showRegistrationForm()\n {\n abort_unless(config('access.registration'), 404);\n\n return view('auth.register');\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ Get cource by courseID
function get_cource($courseID) { return $this->db->get_where('cource',array('courseID'=>$courseID))->row_array(); }
[ "function getCourse($id) {\n $st = $this->pdo->prepare('SELECT * FROM courses WHERE id=:id');\n $st->bindParam(':id', $id);\n $st->execute();\n return $st->fetch();\n }", "function get_course($course_id)\n {\n return $this->db->get_where('course',array('course_id'=>$course_id))->row_array()...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Fin de metodo Obtener el ultimo codigo del tipo tratamiento
public function obtenerUltimoCodigoTipoTratamiento() { $resultado = mysqli_query($this->connection, "select max(idTipoTratamiento) as ultimoCodigoTipoTratamiento from tbtipotratamiento "); $ultimoCodigoTipoTratamiento = 0; while ($filaTemporal = mysqli_fetch_array($resultado)) { $u...
[ "public function obtenerUltimoCodigoTipoResiduo(){\n //Insertar provincia se invoca al metodo en datos\n $this->tipoResiduoAccesoDatos->conectar();\n $resultado = $this->tipoResiduoAccesoDatos->obtenerUltimoCodigoTipoResiduo();\n $this->tipoResiduoAccesoDatos->cerrarConexion();\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Adds a commodity to the basket.
public function add(Commodity $commodity, $quantity = 1) { if (!is_numeric($quantity)) { throw new InvalidArgumentException("Quantity must be numerical."); } // The following is a powerful language construct called // "The terninary operator". // Use existing CommodityStore or create a new one with 0 ...
[ "public function add(): void\n {\n $qty = $this->currentQty + (int) $this->qty;\n\n if ($qty < 1) {\n return;\n }\n\n basket()->add($this->productId, $qty);\n $this->qty = 1;\n $this->emit('basketUpdated');\n }", "public function add(): void\n {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns number of days since a given date
function days_since($date) { $ret = 0; $ts1 = strtotime($date); $ts2 = time(); if ($ts1 > $ts2) { list($ts1,$ts2) = array($ts2,$ts1); /* $tmp = $ts1; $ts1 = $ts2; $ts2 = $tmp; */ } $Yd = date('Y',$ts2) - date('Y',$ts1); if ($Yd == 0) ...
[ "private function days_diff_from_now($date)\n {\n $now = time();\n $date_time = strtotime($date);\n $date_diff = $now - $date_time;\n\n return round($date_diff / (60 * 60 * 24));\n }", "public function countDays()\n {\n return intval($this->start_date->diff($this->end_d...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
example usage: $s_ids = implodeIds( array(1, 2, 5) ); return string '|1||2||5|'
function implodeIds($a_ids) { if (!is_array($a_ids) || count($a_ids) == 0) { return ""; } return "|" . join("||", $a_ids) . "|"; }
[ "public function getIdsAsString()\n {\n $array = $this->getIds();\n\n return implode(',', $array);\n }", "protected function buildIdList(array $ids)\n\t{\n\t\tsort($ids);\n\t\treturn implode(',', $ids);\n\t}", "private function _getIdsString()\n {\n $ids_string = \"''\";\n i...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Optional value is zero or positive float.
public static function isOptionalZeroPositiveFloat($value) { /* No additional validations when the value is null. */ if (null === $value) { return true; } return self::isRequiredZeroPositiveFloat($value); }
[ "public function getFloatValue(): ?float;", "function float_or_null($f) {\n return $f === null ? null : (float) $f;\n}", "public function testOptFiniteFloatWithDefault3()\n {\n // When value and default is null an exception must be thrown.\n $this->expectException(InvalidCastException::class);\n Ca...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ count county member in duration of project execution
function count_county_member_in_project($project, $county) { $this->db->where('project', $project); $this->db->where('county', $county); $this->db->where('year', date("Y")-1911); return $this->db->get('member')->num_rows(); }
[ "public function countProjects();", "public function getProjectCollaboratorCount()\n {\n // TODO: Apply functional programming\n\n $counter = 0;\n\n /** @var \\App\\Models\\Translations\\Project $project */\n foreach ($this->projects as $project) {\n $counter += $project-...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Initializes the collPressGroups collection. By default this just sets the collPressGroups collection to an empty array (like clearcollPressGroups()); 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 s...
public function initPressGroups($overrideExisting = true) { if (null !== $this->collPressGroups && !$overrideExisting) { return; } $this->collPressGroups = new PropelObjectCollection(); $this->collPressGroups->setModel('PressGroup'); }
[ "public function initPressGroups()\n {\n $this->collPressGroups = new PropelObjectCollection();\n $this->collPressGroups->setModel('PressGroup');\n }", "public function initGroups()\n {\n $collectionClassName = EventAudienceTableMap::getTableMap()->getCollectionClassName();\n\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Lists the property types for a particular ad type
public function property_types($type) { return $this->daftAPI->property_types([ 'api_key' => $this->api_key, 'ad_type' => $type ]); }
[ "public static function getPropertyTypesList()\n {\n $query = BalooContext::getInstance()->getPDO()->prepare('\n SELECT _PROP.id AS id, _PROP.name AS name, _PROP.format AS format\n FROM '.BalooModel::tableEntityFieldInfo().' AS _PROP\n ');\n $query->execute();\n\n return...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Display page excerpt. Prints the correct excerpt on a per page basis. If on the WooCommerce shop page then the products result count is be displayed instead of the page excerpt. Also, if on a single product then no excerpt will be output.
function tecscan_page_excerpt() { if ( class_exists( 'WooCommerce' ) && is_shop() ) { woocommerce_result_count(); } elseif ( is_home() ) { $id = get_option( 'page_for_posts' ); if ( has_excerpt( $id ) ) { printf( '<p itemprop="description">%s</p>', do_shortcode( get_the_excerpt( $id ) ) ); } } elseif ...
[ "function studio_page_excerpt() {\n\n\tif ( class_exists( 'WooCommerce' ) && is_shop() ) {\n\n\t\twoocommerce_result_count();\n\n\t} elseif ( is_home() ) {\n\n\t\tprintf( '<p itemprop=\"description\">%s</p>', do_shortcode( get_the_excerpt( get_option( 'page_for_posts' ) ) ) );\n\n\t} elseif ( is_search() ) {\n\n\t\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Enabled Grand Total in Place Order Button
protected function _isEnabledGrandTotal() { return Mage::helper('onestepcheckout/config')->showGrandTotal(); }
[ "function qode_startit_get_woocommerce_update_totals_button() {\n\n\t\t$update_totals_button = qode_startit_get_button_html(array(\n\t\t\t'html_type'\t\t=> 'button',\n\t\t\t'text'\t\t\t=> esc_html__( 'Update Totals', 'startit' ),\n\t\t\t'custom_attrs'\t=> array(\n\t\t\t\t'value'\t\t=> 1,\n\t\t\t\t'name'\t\t=> 'calc...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Update a page POST (orchestra)/resources/cello.pages/view/(:id)
public function post_view($id = null) { $input = Input::all(); $slug = ! empty($input['slug']) ? $input['slug'] : ''; $input['slug'] = Str::slug($slug, '-'); $page_id = $id ?: '0'; $rules = array( 'title' => 'required', 'slug' => array( 'required', 'min:2', 'mat...
[ "public function editpage($id) {\n $existing_page = ORM::factory(\"static_page\", $id);\n $view = new Admin_View(\"admin.html\");\n $view->page_title = t(\"Edit page\");\n $view->content = new View(\"admin_pages_new.html\");\n $view->content->form = $this->get_edit_page_form($existing_page);\n pri...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Test 8. PUT request create new object.
public function testPutCreate() { global $testTripId1; $this->assertEquals(0, $this->countTestRows()); $data = array('tripId'=>$testTripId1, 'created'=>'2015-10-01', 'updated'=>'2015-10-02', 'name'=>'Test Trip', 'descrip...
[ "function testPut() {\n\n $request = new HTTP\\Request('PUT', '/file2', [], 'hello');\n\n $response = $this->request($request);\n\n $this->assertEquals(201, $response->getStatus(), 'Incorrect status code received. Full response body:' . $response->getBodyAsString());\n\n $this->assertEqu...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Return the name of the xml root node.
protected function getRootNodeName() { return static::ROOT_NODE; }
[ "protected function getRootNodeName()\n {\n \treturn static::ROOT_NODE;\n }", "public function getRootNodeName() {\n\t\treturn $this->rootNodeName;\n\t}", "protected function get_root_element() {\n\n\t\treturn self::ROOT_XML_ELEMENT;\n\t}", "public function getRootNode()\n {\n return self::...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Operation getStoreItemAsync Get a single store item
public function getStoreItemAsync($id) { return $this->getStoreItemAsyncWithHttpInfo($id)->then(function ($response) { return $response[0]; }); }
[ "public function getStoreAsync($options)\n {\n return $this->getStoreAsyncWithHttpInfo($options)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }", "public function get($id, $storeId = null);", "public func...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Delete a message from a channel. Permissions that may be checked: Channel.PostMessage, Channel.PostMessagesInThreads
public function deleteMessage(array $data): void { $uri = 'chats/messages/delete-message'; $required = [ 'channel' => self::TYPE_STRING, 'id' => self::TYPE_STRING, ]; $this->throwIfInvalid($required, $data); $this->client->post($this->buildUrl($uri), ...
[ "function deleteDirectMessage($message_id) {\n\t\t\t$params['message_id'] = $message_id;\n\t\t\treturn $this->methodCall('/messages/message/'.$message_id.'/delete.json', 'post', $params);\n\t\t}", "public function deleteMessage()\n {\n }", "public function testDeleteMessage()\n {\n $config = new...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Terse exception handler Sends only simplified exception message in plain text
public function handlerTerse($exception) { if (!headers_sent()) { header('HTTP/1.1 500 Internal Server Error', true, 500); header('Content-type: text/plain; charset=UTF-8'); } echo sprintf('Bad Moss: %s ( %s at line:%s )', $exception->getMessage(), $exception->getFile...
[ "public function handlerVerbose(\\Exception $exception)\n {\n if (!headers_sent()) {\n header('HTTP/1.1 500 Internal Server Error', true, 500);\n header('Content-type: text/html; charset=UTF-8');\n }\n\n echo sprintf(\n '<!DOCTYPE html>\n <html>\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Should assert that each top level subdirectory has the current directory instance as parent.
public function testParentSubDirectories() { $subDirectories = [ new Directory('foo'), new Directory('bar') ]; $collection = new DirectoryCollection; foreach ($subDirectories as $directory) { $collection->push($directory); } $dir...
[ "public function testWithParentDirectoryParts()\n {\n self::assertSame('/foo/baz/', UrlPath::parse('/foo/bar/../baz/')->__toString());\n self::assertSame('/baz/', UrlPath::parse('/foo/bar/../../baz/')->__toString());\n self::assertSame('foo/bar/', UrlPath::parse('foo/bar/baz/..')->__toString...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Check vardefs for module
protected function checkVardefs($module, $object, $stock = false, $status = HealthCheckScannerMeta::STUDIO_MB_BWC) { $custom = ''; if ($status == HealthCheckScannerMeta::CUSTOM) { $custom = 'Custom'; } if ($module == 'DynamicFields') { // this one is an odd o...
[ "protected function checkVardefs($module, $object)\n {\n if(empty($GLOBALS['dictionary'][$object]['fields'])) {\n $this->log(\"Failed to load vardefs for $module:$object\");\n return true;\n }\n $status = true;\n $dictionary = array();\n if (is_file('modul...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Save context & attributes to database
protected function save() { if (($id =& $this->id) !== null) throw new SystemException('Cannot save existent context!'); // save to database $id = self::EMPTY_CONTEXT_ID; if ($attributes = $this->attributes) { $snapshot = self::getSnapshot($attributes); $query = array( 'limit' => 1, 'se...
[ "private function __saveAttributes()\n {\n if (empty($this->attributes)) return;\n foreach ($this->attributes as $attr) {\n if (!$attr->getContent()->getId() || $attr->getContent()->getChanged()) {\n\t\t\t\tif (!$attr->getContent()->getProduct_id()) \n\t\t\t\t\t$attr->getContent()->setPr...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns value of 'iMasterCount' property
public function getIMasterCount() { return $this->get(self::IMASTERCOUNT); }
[ "public function getMasterCount(){\r\n $master_counter = 0;\r\n if(!is_null($this->masterd_decks)){\r\n $master_counter = count($this->getMasteredDecks());\r\n }else{\r\n $sql = \"SELECT COUNT(*) FROM \".Master::getDbTableName().\" WHERE member = \".$this->getId();\r\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Constructor Instantiate the internal priority queue
public function __construct() { $this->queue = new PriorityQueue; }
[ "public function __construct()\n {\n $this->queue = new SplPriorityQueue();\n }", "public function __construct() {\n $this->sortingAlgorithm = $this->makeSortingAlgorithm();\n $this->items = [];\n $this->extractFlags = PriorityQueueInterface::EXTRACT_FLAG_DATA;\n $this->it...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
For getting hospital id of the current user Returns hospital id
function get_hospital_id(){ return $_SESSION['hospital_id']; }
[ "public function get_user_hospital_id($user_id){\n\t\tglobal $con;\n\t\t$result=array();\n\t\t$hospital=0;\n\t\t$query=\"SELECT hospital_id FROM system_users WHERE user_id='$user_id' LIMIT 1\";\n\t\t$result=$this->select($con,$query);\n\t\tforeach ($result as $key => $value) {\n\t\t\t$hospital=$value['hospital_id']...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
AIM : To verify restore checkpoints are properly set after a restore
public function test_checkpoint_after_restore() { // EXPECTED RESULT : Restore is successful zbase_setup::reset_servers_and_backupfiles(TEST_HOST_1, TEST_HOST_2); flushctl_commands::set_flushctl_parameters(TEST_HOST_1, "chk_max_items", 100); $this->assertT...
[ "public function test_checkpoint_after_restore() {\n // EXPECTED RESULT : Restore is successful\n zbase_setup::reset_servers_and_backupfiles(TEST_HOST_1, TEST_HOST_2);\n flushctl_commands::set_flushctl_parameters(TEST_HOST_1, \"chk_max_items\", 100);\n $th...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ Get details for this tip
public function getTipDetails() { return new Foursquare_TipDetails_output(Temboo_Results::getSubItemByKey(Temboo_Results::getSubArrayByKey(json_decode($this->get('Response'), true), "response"), "tip")); }
[ "public function getTip() {\n return $this->get(self::TIP);\n }", "public function getTips();", "function InfoTips()\n\t{\n\t\treturn $this->infotips;\n\t}", "public function getTip() {\n\t\treturn new Foursquare_Tip_output(Temboo_Results::getSubItemByKey($this->base, \"tip\"));\n\t}", "public fun...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Example: If $originalqs = array("a" => "A", "b" => "B", "c" => "C"), $indexes_inherited = array("a", "b") and $extra_array = array("d" => "D", "b" => "Z"), then qs_array_prepare($originalqs, $indexes_inherited, $extra_array) would return array("a" => "A", "b" => "Z", "d" => "D").
function qs_array_prepare($originalqs, $indexes_inherited, $extra_array = array()) { $ret = array(); foreach($indexes_inherited as $index) { if (isset($originalqs[$index])) $ret[$index] = $originalqs[$index]; } return $extra_array + $ret; }
[ "protected static function ArrayQueryHelper(&$strOrderBy, $strLimit, &$strLimitPrefix, &$strLimitSuffix, &$strExpandSelect, &$strExpandFrom, $objExpansionMap, &$objDatabase) {\n\t\t\t// Get the Database\n\t\t\t$objDatabase = QApplication::$Database[1];\n\n\t\t\t// Setup OrderBy and Limit Information (if applicable)...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Method that is called after a test was executed. Unsets the http client mock and the test RmvApi instance.
protected function tearDown() { unset($this->httpClientMock); unset($this->rmvApi); }
[ "public function tearDown()\n {\n $this->api = null;\n }", "protected function _after()\n {\n unset($this->api);\n\n // Clear any mocks etc\n Test::clean();\n }", "public function tearDown()\n {\n parent::tearDown();\n $client = ClientBuilder::create($thi...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Vector scaling f w =
public static function scale($f, $v) { if (is_numeric($f) && Math_VectorOp::isVector($v)) { $arr = array(); $n = $v->size(); for ($i = 0; $i < $n; $i++) { $arr[$i] = $v->get($i) * $f; } return new Math_Vector($arr); } else { ...
[ "static function scaleVec(&$v, &$val)\r\n {\r\n return [\r\n $v[0] * $val[0],\r\n $v[1] * $val[1]\r\n ];\r\n }", "public function scale(Vec3 $scale) : void {}", "abstract public function scale($w, $h);", "function block_recblock_scaling_unit_normalization($vector){\n\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Return if Item is Kit
public function is_kit() { return $this->kit == 'Y'; }
[ "public function has_item(){\n $args = func_get_args();\n $counter = $this->get_counter('item_disabled');\n $item = empty($counter) ? $this->get_info('robot_item') : '';\n if (!empty($args[0])){ return $item == $args[0] ? true : false; }\n else { return !empty($item) ? true : fals...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Creates a new FinanceAdvertiserBillTerm model. If creation is successful, the browser will be redirected to the 'view' page.
public function actionCreate() { $model = new FinanceAdvertiserBillTerm(); if ($model->load(Yii::$app->request->post()) && $model->save()) { return $this->redirect(['view', 'id' => $model->bill_id]); } else { return $this->render('create', [ 'model' =...
[ "public function actionCreate()\n {\n $model = new Bill();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ wp_enqueue_style( 'foundation_menu', foundation_get_base_module_url() . '/menu/menu.css', foundation_menu_get_style_deps(), FOUNDATION_VERSION );
function foundation_menu_init() { wp_enqueue_script( 'foundation_menu', foundation_get_base_module_url() . '/menu/menu.js', array( 'jquery' ), FOUNDATION_VERSION, true ); }
[ "function enqueue_foundation() {\n\t// wp_enqueue_style( 'foundation', get_template_directory_uri() . '/css/foundation.min.css' );\n\n\twp_enqueue_style( 'compressed', get_template_directory_uri() . '/css/compressed.css' );\n}", "public function dahz_menu_styles() {\n if( is_customize_preview() ) return;\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
add_theme_location Set another location for themes to be looked in
public function add_theme_location( $location ) { $this->_theme_locations[] = $location; }
[ "public function add_theme_location( $location )\n\t{\n\t\t$this->_theme_locations[] = $location;\n\t}", "function cybershop_elementor_locations( $elementor_theme_manager ) {\n $elementor_theme_manager->register_all_core_location();\n}", "abstract protected function registerThemeLayouts();", "function addL...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This is the function to set the Temp Request Register
public function settmpReg(){ # Register Product ID if($this->isPropertySet("ProTmpID", "V")) $_SESSION['ProTmpID'] = $this->getProperty("ProTmpID"); }
[ "public function setReqRes()\n {\n $this->request = new Request();\n $this->setVars();\n $this->request->setParams($this->vars);\n $this->response = new Response();\n }", "function setReqValue(){\n\t\tif (!$this->hasAttribute('i')){\n\t\t $varname=\"tmodule_\" . $this->name;\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Filter: Set the locale to en_US. Some translated strings in the wcpt plugin are used here for comparison and matching. To ensure that the matching happens correctly, we need need to prevent these strings from being converted to a different locale.
public function set_locale_to_en_US() { return 'en_US'; }
[ "private function set_locale() {\n\n if (function_exists('determine_locale')) {\n $locale = determine_locale();\n } else {\n // @todo Remove when start supporting WP 5.0 or later.\n $locale = is_admin() ? get_user_locale() : get_locale();\n }\n $locale = ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }