query
stringlengths
10
8.11k
document
stringlengths
17
398k
negatives
listlengths
19
20
metadata
dict
Updates the given BlogEntry object
public function updateAction(BlogEntry $blogEntry) { $this->blogEntryRepository->update($blogEntry); $this->flashMessageContainer->add('Updated the blog.'); $this->redirect('index'); }
[ "public abstract function modifyBlogEntry(BlogEntry $blogEntry);", "public function update(Entry $entry);", "private function updateBlogEntry() {\n\n if (isset($_POST['submit']) && 'Save' == trim($_POST['submit'])) {\n\n // @todo security.\n\n // Get the blog title from the post variables.\n i...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets the value of BackupVolumes.
public function getBackupVolumes(): array { return $this->backupVolumes; }
[ "public function getVolumes()\n {\n return $this->volumes;\n }", "public function getVolumes()\n {\n return $this->apiCall('get', '/volumes', [], ['auto-fill' => true]);\n }", "public function getVolumeBackup()\n {\n return $this->volume_backup;\n }", "public function vo...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Compare gears core and current core
private function check_core($version){ return version_compare($version,COGEAR,'<='); }
[ "function _maybe_update_core()\n {\n }", "public static function get_current_core_hashes() {\n\t\treturn self::get_core_hashes( $GLOBALS['wp_version'], get_locale() );\n\t}", "function _maybe_update_core()\n{\n}", "public function compareUpdates($a, $b) {\n if ($a->part() == $b->part()) {\n if (...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Translates a commaseperated string of skill IDs to a comma (plus space) seperated skill name string.
function skillsTrans($str) { $trans = array_map(create_function('$s', 'global $skillididx; return $skillididx[$s];'), is_array($str) ? $str : explode(',', $str)); return is_array($str) ? $trans : implode(', ', $trans); }
[ "function generateSkillsString(\n\t$userid, $rotaid, $skillid\n){\n\treturn implode(\n\t\t'-',\n\t\tarray(\n\t\t\t$userid, \n\t\t\t$skillid\n\t\t)\n\t);\n}", "public static function GetSkillsByJobString($jobId) {\n\t\t\t\n\t\t\t$skills = \\Classes\\Skill::GetSkillsByJob($jobId);\n\t\t\t\n\t\t\t$skillsList = Array...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
fix some mangled hublocs from a bug long ago
function update_r1097() { $r = q("select hubloc_id, hubloc_addr from hubloc where hubloc_addr like '%%/%%'"); if($r) { foreach($r as $rr) { q("update hubloc set hubloc_addr = '%s' where hubloc_id = %d limit 1", dbesc(substr($rr['hubloc_addr'],0,strpos($rr['hubloc_addr'],'/'))), intval($rr['hubloc_id']) ...
[ "function fixPathway(){\n\t\treturn 'Warning: fixPathway depreciated';\n\t\t/*\n\t\t$pathway =& bfDocument::getPathWay();\n\n\t\t$arr = array();\n\t\tforeach ($pathway->_pathway as $link){\n\t\tif (substr($link->name,0,2) != 'bf') $arr[] = $link;\n\t\t}\n\t\t$pathway->_pathway =& $arr;\n\t\t*/\n\t}", "public func...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the conjunction of this && value.
public function andAlso($value) { return self::get($this->value && self::primitive($value)); }
[ "function and_ () {\n $this->where_ .= ' AND ';\n $this->conjunked = true;\n return $this;\n }", "public function metaQueryRelation_AND(){\n return $this->metaQueryRelation('AND');\n }", "public function isConjunction()\n {\n return in_array($this->getWord(), ['and', 'or']);\n }...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
How many alerts are queued?
public function count() { return \count($this->alerts); }
[ "public function queueCount();", "public function queueCount()\n {\n return $this->mockHandler->count();\n }", "public function count() {\n return count($this->queues);\n }", "public function count() {\n return count($this->queue);\n }", "public static function get_active_al...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Creates inner join. If right column is null it tries to join table on same column name as in left table.
public function innerJoin($table, $leftColumn, $rightColumn = null) { return $this->addJoin($table, $leftColumn, $rightColumn); }
[ "private function join()\n {\n $a = $this->prefix($this->pk(), $this->table());\n $b = $this->prefix($this->pk(), $this->ee_table);\n\n ee()->db->join($this->ee_table, $a . ' = ' . $b, 'inner');\n }", "public function InnerJoin()\n\t\t{\n\t\t\treturn $this->AddSubComponent(ExtensionsHan...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Tests that routes are rebuilt during install and uninstall of modules.
public function testRouteRebuild() { // Remove the routing table manually to ensure it can be created lazily // properly. Database::getConnection()->schema()->dropTable('router'); $this->container->get('module_installer')->install(['router_test']); $route = $this->container->get('router.route_provi...
[ "public function testAppsAppRoutesRoutePatch()\n {\n }", "public function testOnAlterRoutesWithNonAdminRoutes() {\n $event = $this->getMockBuilder('Drupal\\Core\\Routing\\RouteBuildEvent')\n ->disableOriginalConstructor()\n ->getMock();\n $route_collection = new RouteCollection();\n $rout...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns current controller name
public function getControllerName() { return AppHelper::getControllerName(); }
[ "public static function controllerName()\n {\n return self::$currentMvc->controllerName();\n }", "public static function getControllerName()\r\n\t{\r\n\t return self::$controller_name;\r\n\t}", "protected function getControllerName()\n {\n return strtolower($this->controllerContext->...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Output only. The lifecycle state of the folder. Updates to the lifecycle_state must be performed via [DeleteFolder] and [UndeleteFolder]. Generated from protobuf field .google.cloud.resourcemanager.v2.Folder.LifecycleState lifecycle_state = 4;
public function setLifecycleState($var) { GPBUtil::checkEnum($var, \Google\Cloud\ResourceManager\V2\Folder_LifecycleState::class); $this->lifecycle_state = $var; return $this; }
[ "public function setLifecycle($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Storage\\V2\\Bucket\\Lifecycle::class);\n $this->lifecycle = $var;\n\n return $this;\n }", "public function setLifecycleState($var)\n {\n GPBUtil::checkEnum($var, \\Google\\Cloud\\Dialogflow\\V2\\C...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
TODO: Implement orHavin() method.
public function orHavin() { }
[ "public function orFilterHavin()\n {\n }", "public function or()\n\t{\n\t}", "public function orWhere();", "public function _or() {\n \treturn $this->_binOp('or');\n }", "public abstract function or(Result $r): Result;", "public function db_or()\n {\n return db_or();\n }", "abstract...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
admin_delete() allows an admin to delete a Location url: /admin/Locations/delete/1
function admin_delete($id = null) { // if the id is null if (!$id) { // set flash message $this->Session->setFlash('Invalid id for Location', 'flash_bad'); // redirect $this->redirect(array('action'=>'index')); } // set the id of the location $this->Location->id = $id; // try to ch...
[ "function delete_location() {\n\t $this->slplus->currentLocation->set_PropertiesViaDB( $this->slplus->ajax->query_params['location_id'] );\n\n\t $status = $this->slplus->currentLocation->delete();\n\t if ( is_int( $status ) ) {\n\t\t $count = $status;\n\t\t $status = 'ok';\n\t } else {\n\t ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Fields for creating new questions are added to the quiz_questions_form
function _quiz_add_fields_for_creating_questions(&$form, &$types, &$quiz) { // Display links to create other questions. $form['additional_questions'] = array( '#type' => 'fieldset', '#title' => t('Create new question'), '#collapsible' => TRUE, '#collapsed' => TRUE, ); $url_query = drupal_get_de...
[ "public function addQuestionAndAnswers () {\n global $tpl, $ilTabs;\n $ilTabs->activateTab(\"editQuiz\");\n $this->initAddQuestionAndAnswersForm();\n }", "public function initAddQuestionAndAnswersForm () {\n global $tpl, $ilCtrl;\n\n $my_tpl = new ilTemplate(\"tpl.question_an...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets the usedLicenseCount The number of VPP licenses in use.
public function setUsedLicenseCount($val) { $this->_propDict["usedLicenseCount"] = $val; return $this; }
[ "public function setUsedLicenseCount($val)\n {\n $this->_propDict[\"usedLicenseCount\"] = intval($val);\n return $this;\n }", "public function setUsedLicenseCount(?int $value): void {\n $this->getBackingStore()->set('usedLicenseCount', $value);\n }", "public function setTotalLicens...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets the public 'sylius.fixture.example_factory.shipping_category' shared service.
protected function getSylius_Fixture_ExampleFactory_ShippingCategoryService() { return $this->services['sylius.fixture.example_factory.shipping_category'] = new \Sylius\Bundle\CoreBundle\Fixture\Factory\ShippingCategoryExampleFactory(${($_ = isset($this->services['sylius.factory.shipping_category']) ? $this...
[ "protected function getSylius_Controller_ShippingCategoryService()\n {\n $this->services['sylius.controller.shipping_category'] = $instance = new \\Sylius\\Bundle\\ResourceBundle\\Controller\\ResourceController($this->get('sylius.controller.configuration_factory')->createConfiguration('sylius', 'shipping_...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Flush the received requests from the server
public function flush() { $this->client->delete('guzzle-server/requests')->send(); }
[ "public static function flush()\n {\n self::send('DELETE', '/guzzle-server/requests');\n }", "public function flush()\n {\n $this->send();\n $this->clear();\n }", "public function flush()\n {\n if ($this->isFlushed === false) {\n // send response headers\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Operation listsChangereasonChangereasonIdGet Fetch Change Reason specified by changereasonId.
public function listsChangereasonByIdget($changereason_id) { $response = ChangeReason::findOrFail($changereason_id); return response()->json($response, 200); }
[ "public function listsChangereasonput($changereason_id)\r\n {\r\n $input = Request::all();\r\n $reason = ChangeReason::findOrFail($changereason_id);\r\n $reason->update([ 'name' => $input['name'] ]);\r\n if($reason->save()){\r\n return response()->json(['msg' => 'Updated ch...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Set cookie file for current request
function setCookieFile( $path ) { //Create directory if not exists $dir = dirname($path); if( !file_exists( $dir ) ) { mkdir( $dir, 0755, true ); } $this->_cookie_file_path = $path; $this->setOptions(array( CURLOPT_COOKIEFILE => $path, CURLOPT_COOKIEJAR => $path )); r...
[ "public function setCookiesFile( $file ) {\n\t\tcurl_setopt( $this->curl, CURLOPT_COOKIEFILE, $file );\n\t\tcurl_setopt( $this->curl, CURLOPT_COOKIEJAR, $file );\n\t}", "public function setCookieFile($file = \"\")\n {\n $this->cookieFile = $file;\n return $this;\n }", "public function setCoo...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Regex callback for wp_kses_decode_entities()
function _wp_kses_decode_entities_chr( $match ) { return chr( $match[ 1 ] ); }
[ "function _wp_kses_decode_entities_chr($matches)\n {\n }", "function _wp_kses_decode_entities_chr( $match ) {\n return chr( $match[1] );\n}", "function cmail_xss_entity_decode_callback($matches)\n{ \n return chr(hexdec($matches[1]));\n}", "function wp_kses_decode_entities($string) {\n\t$string = pre...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ Read all product based on product ids included in the $ids variable
public function readByIds($ids) { // str_repeat repeating ? how much gets id and then subtraction -1. $ids_arr = str_repeat('?,', count($ids) - 1) . '?'; // query to select products $query = <<<SQL SELECT id, name, price, img_url FROM . $this->table_name . WHERE id IN ({$ids_arr}) ORDER BY n...
[ "public function readByIds($ids){\r\n \r\n\t $ids_arr = str_repeat('?,', count($ids) - 1) . '?';\r\n\t \r\n\t // query to select products\r\n\t $query = \"SELECT id, name, price FROM \" . $this->table_name . \" WHERE id IN ({$ids_arr}) ORDER BY name\";\r\n\t $stmt = $this->conn->prepare($query);\r\n\t ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
echo 'A venda do produto '. $produto .' na data '. $data .' com a quantidade de '. $quantidade .' possui um valor cada de '. $valorTotal;
public function exibirVenda() { return 'A venda do produto '. $this->produto .' na data '. $this->data .' com a quantidade de '. $this->quantidade .' possui um valor cada de '. $this->valorTotal; }
[ "function valorTotalVenda($idvenda, $frete, $porConta, $idtipoprofissional){\n $SqlValor = \"SELECT valor FROM t_valor_profissional WHERE idtipoprofissional = $idtipoprofissional\";\n $resultValor = parent::Execute($SqlValor);\n $rsValor = parent::ArrayData($resultValor);\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
normal: test nested transactions
public function test1() { try { $this->db->beginTransaction(); $this->db->beginTransaction(); $this->db->commit(); $this->db->beginTransaction(); $this->db->commit(); $this->db->commit(); } catch ( ezcDbTransacti...
[ "public function testTransactionNested() {\n\t\t$conn = $this->getMock('MockPDO');\n\t\t$db = new DboTestSource();\n\t\t$db->setConnection($conn);\n\t\t$db->useNestedTransactions = true;\n\t\t$db->nestedSupport = true;\n\n\t\t$conn->expects($this->at(0))->method('beginTransaction')->will($this->returnValue(true));\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
If field 'row_display_name' is added to a layout, it will be used to rename the row to a more userfriendly name
function my_acf_flexible_content_layout_title( $title, $field, $layout, $i ) { // Remove layout title from text // Load text sub field if ($field = get_sub_field('row_display_name')) { $text = get_sub_field('row_type'); if ($text['value'] == 'standard') { $text = 'Standard Row'; } elseif ($text['value'] ==...
[ "abstract protected function define_row_submitter_title();", "public function alterDisplay(&$rows) {\n $entryFound = FALSE;\n\n foreach ($rows as $rowNum => $row) {\n // make count columns point to detail report\n // convert sort name to links\n if (array_key_exists('civicrm_contact_sort_name...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Export the supplied personal data for all review activities in contextlist
public static function export_user_data(approved_contextlist $contextlist) { global $DB; if (!$contextlist->count()) { return; } $user = $contextlist->get_user(); list($contextsql, $contextparams) = $DB->get_in_or_equal($contextlist->get_contextids(), SQL_PARAMS_NAM...
[ "public static function export_user_data(approved_contextlist $contextlist);", "public static function export_user_data(approved_contextlist $contextlist) {\n global $DB;\n\n if (!count($contextlist)) {\n return;\n }\n\n $syscontextapproved = false;\n\n foreach ($cont...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets a collection of ChildMemberRespone objects related by a onetomany relationship to the current object. It will also schedule objects for deletion based on a diff between old objects (aka persisted) and new objects from the given Propel collection.
public function setMemberRespones(Collection $memberRespones, ConnectionInterface $con = null) { /** @var ChildMemberRespone[] $memberResponesToDelete */ $memberResponesToDelete = $this->getMemberRespones(new Criteria(), $con)->diff($memberRespones); $this->memberResponesScheduledForDeleti...
[ "public function touchOwners()\n {\n foreach ($this->getTouchedRelations() as $relation) {\n $this->$relation()->touch();\n\n if ($this->$relation instanceof self) {\n $this->$relation->fireModelEvent('saved', false);\n\n $this->$relation->touchOwners();...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Disable a module from its slug.
public function disable($slug) { return response()->json([$slug => Module::disable($slug)]); }
[ "public function disable(Module $module);", "protected function disable_module()\n {\n global $moduleList;\n foreach ($this->modulesInPackage as $module) {\n unset($moduleList[array_search($module, $moduleList)]);\n }\n }", "function variable_module_disable($module) {\n}", ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Filter the query on the id_product column Example usage: $query>filterByIdProduct(1234); // WHERE id_product = 1234 $query>filterByIdProduct(array(12, 34)); // WHERE id_product IN (12, 34) $query>filterByIdProduct(array('min' => 12)); // WHERE id_product >= 12 $query>filterByIdProduct(array('max' => 12)); // WHERE id_p...
public function filterByIdProduct($idProduct = null, $comparison = null) { if (is_array($idProduct)) { $useMinMax = false; if (isset($idProduct['min'])) { $this->addUsingAlias(ReviewPeer::ID_PRODUCT, $idProduct['min'], Criteria::GREATER_EQUAL); $useMin...
[ "public function filterByIdProduct($idProduct = null, $comparison = null)\n\t{\n\t\tif (is_array($idProduct)) {\n\t\t\t$useMinMax = false;\n\t\t\tif (isset($idProduct['min'])) {\n\t\t\t\t$this->addUsingAlias(Oops_Db_ProductAttributePeer::ID_PRODUCT, $idProduct['min'], Criteria::GREATER_EQUAL);\n\t\t\t\t$useMinMax =...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Affiche la table Contact Person
public function showContactPersonsTable() { $stmt = $this->connect()->query("SELECT * FROM contact_person"); echo "<h3>Contact Person Table</h3>"; echo "<table><tr><td>" . "phone_number" . "</td><td>" . "email" . "</td></tr>"; while ($row = $stmt->fetch()) { echo "<tr><td>" . $row['phone_number'] . "</t...
[ "public function countPersonContacts()\n {\n\n $db = $this->getDb();\n \n $sql = <<<SQL\nSELECT\n count(contact.rowid) as number\nFROM\n core_contact_r contact\nJOIN core_person_r person\n ON contact.id_person = person.rowid\nWHERE person.type = 1;\n \nSQL;\n \n return $db->select(...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the list of schemas.
public function getSchemas(): array { return $this->schemas; }
[ "public function getSchemaList()\n {\n $sql = \"SELECT nspname FROM pg_catalog.pg_namespace WHERE nspname !~ '^pg_'\";\n $result_handler = pg_query($this->connection->getHandler(), $sql);\n $schemas = array();\n\n while ($schema = pg_fetch_assoc($result_handler))\n {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets new milliseconds for the date object Example: setMilliSecond(550, 2) > equals +5 Sec +50 MilliSec
public function setMilliSecond($milli = null, $precision = null) { if ($milli === null) { list($milli, $time) = explode(" ", microtime()); $milli = intval($milli); $precision = 6; } else if (!is_numeric($milli)) { #require_once 'Zend/Date/Exception.php...
[ "public function setMilliSecond($milli = null, $precision = null);", "public function setMilliSecond($milli = null, $precision = null)\n {\n if ($milli === null) {\n [$milli, $time] = explode(\" \", microtime());\n $milli = (int)$milli;\n $precision = 6;\n } else ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Hook to product actions
public function hookProductActions() { return $this->hookProductFooter(); }
[ "public function getProductAction();", "public function hookActionProductDelete()\n {\n\n }", "public function hookActionOrderDetail()\n {\n\n }", "public function restore_woocommerce_product_shop_actions() {\n add_action( 'woocommerce_before_shop_loop_item_title', 'woocommerce_show_pro...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets the notApplicableCount Number of not applicable devices
public function getNotApplicableCount() { if (array_key_exists("notApplicableCount", $this->_propDict)) { return $this->_propDict["notApplicableCount"]; } else { return null; } }
[ "public function getNotApplicableDeviceCount()\n {\n if (array_key_exists(\"notApplicableDeviceCount\", $this->_propDict)) {\n return $this->_propDict[\"notApplicableDeviceCount\"];\n } else {\n return null;\n }\n }", "public function getNotApplicableUserCount()\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the authorsrc for this event.
public function getAuthorsrc() { return $this->authorsrc; }
[ "public function getSourceAuthor() {\n\t\treturn $this->sourceAuthor;\n\t}", "public function getAuthorEmail()\n {\n if ($this->getCollectorId())\n {\n return $this->getCollector()->getEmail();\n }\n else\n {\n return parent::getAuthorEmail();\n }\n }", "public function getAuthor()...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Operation getConversationsCobrowsesessionParticipantWrapup Get the wrapup for this conversation participant.
public function getConversationsCobrowsesessionParticipantWrapup($conversationId, $participantId, $provisional = 'false') { list($response) = $this->getConversationsCobrowsesessionParticipantWrapupWithHttpInfo($conversationId, $participantId, $provisional); return $response; }
[ "public function getConversationsChatParticipantWrapupcodes($conversationId, $participantId)\n {\n list($response) = $this->getConversationsChatParticipantWrapupcodesWithHttpInfo($conversationId, $participantId);\n return $response;\n }", "public function getConversationsCobrowsesessionPartici...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ Method: finalize Finalizes the page request. This includes saving all necessary variables to the session.
public function finalize() { $_SESSION['user_'.Dispatcher::inst()->activeSite['publicdir']] = $this->user; MessageQueue::serialize(); Session::write_close(); // Write session before headering. }
[ "public function finalize() {\n\t\t$presenter = $this->getPresenter();\n\t\t$this->saveSession();\n\t\t$presenter->redirect('this');\t\n\t}", "public function FinalizeRequest()\n {\n $this->AttachHeaders();\n $this->AttachCookies();\n $this->AttachPostParameters();\n }", "public funct...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get the regime agricole.
public function getRegimeAgricole() { return $this->regimeAgricole; }
[ "public function getTvaRegime() {\n return $this->tvaRegime;\n }", "public function getUserregtime()\n {\n return $this->userregtime;\n }", "public function getCodeRegimeTva() {\n return $this->codeRegimeTva;\n }", "protected function getRegio()\n {\n return $this->r...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the number of related CostDoc objects.
public function countCostDocs(Criteria $criteria = null, $distinct = false, PropelPDO $con = null) { $partial = $this->collCostDocsPartial && !$this->isNew(); if (null === $this->collCostDocs || null !== $criteria || $partial) { if ($this->isNew() && null === $this->collCostDocs) { ...
[ "public function getChildDocumentsCount() {}", "public function getTotalDocs()\n {\n $labelMapper = $this->db->mapper('Documer\\Entity\\Label');\n\n return count($labelMapper->all());\n }", "public function getReferenceCount() {}", "public function count_references()\n {\n return...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Test Getting the id of the aligned TextSegment
public function testGetTextSegmentId() { $this->assertEquals(2, $this->alignment->getTextSegmentId()); }
[ "public function testGetTextSegment()\n {\n $this->assertEquals($this->alignment->getTextSegmentId(), $this->alignment->getTextSegment()->getId());\n }", "public function getTextSegment()\n {\n return $this->text_segment;\n }", "function getAlignedTextSegFromMediaSeg(MediaFileSegmentIn...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Show the form for editing a coffee resource.
public function edit(Coffee $coffee) { return view('admin.coffees.edit', compact('coffee')); }
[ "public function edit_form()\n {\n return View::make(\"app.edit\");\n }", "public static function edit_form()\n {\n $user = Users::findOne($_SESSION['user']);\n\n View::make('user/edit.html', array('user' => $user));\n }", "public function edit_item()\n {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This condition is relevant only for versioned objects. An object version satisfies this condition only if these many days have been passed since it became noncurrent. The value of the field must be a nonnegative integer. If it's zero, the object version will become eligible for Lifecycle action as soon as it becomes no...
public function getDaysSinceNoncurrentTime() { return isset($this->days_since_noncurrent_time) ? $this->days_since_noncurrent_time : 0; }
[ "public function testIsNewerThanFalse() {\n\t\t\t$time = time();\n\t\t\t$lastRefresh = date('Y-m-d H:i:s', $time - 10);\n\t\t\t$userData = ['id' => 1, 'last_refresh' => $lastRefresh];\n\t\t\t$this->CurrentUser->setSettings($userData);\n\n\t\t\t$this->assertFalse($this->LastRefresh->isNewerThan($time));\n\t\t\t$this...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Set the live mode. Defined as true if live keys were used in the request. Defined as false if test keys were used in the request.
private function setLiveMode($liveMode) { $this->liveMode = $liveMode; }
[ "public function isLive()\n {\n return config('przelewy24.mode', 'sandbox') === 'live';\n }", "public function isLiveMode()\n {\n return $this->getConfigFlag('live_mode');\n }", "public function getLiveMode() {\n return $this->liveMode;\n }", "public function isLive()\n {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
filters a FileList by the uID of the approving User.
public function filterByApproverUID($uID) { $this->filter('fv.fvApproverUID', $uID); }
[ "public function filterByApproverUserID($uID)\n {\n /** @var Concrete\\Core\\File\\FileList $instance */\n return $instance->filterByApproverUserID($uID);\n }", "public function filterByAuthorUserID($uID)\n {\n /** @var Concrete\\Core\\File\\FileList $instance...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Handle the venda "deleted" event.
public function deleted(Venda $venda) { // }
[ "public function deleted()\n {\n // do something after delete\n }", "public function deleted(Event $event)\n {\n //\n }", "public\n function deleted(Event $event)\n {\n //\n }", "abstract public function handleDelete($event);", "public function forceDeleted(Venda $v...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Rotates the stream file if due
private function rotateStreamFile() { // Close the stream fclose($this->statusStream); // Create queue file with timestamp so they're both unique and naturally ordered $queueFile = $this->queueDir . '/' . self::QUEUE_FILE_PREFIX . '.' . date('Ymd-His') . '.queue'; // Do the rotate rename($this->stream...
[ "private function rotateStreamFile() {\n // Close the stream\n fclose($this->statusStream);\n\n // Create queue file with timestamp so they're both unique and naturally ordered\n $queueFile = $this->queueDir . '/' . self::QUEUE_FILE_PREFIX . '.' . date('Ymd-His') . '.queue';\n\n /...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets the filledAttendeesCount property value. The current number of customers in the appointment.
public function setFilledAttendeesCount(?int $value): void { $this->getBackingStore()->set('filledAttendeesCount', $value); }
[ "public function numberOfAttendees(): int\n {\n return $this->attendees()->count();\n }", "public function setMaximumAttendeesCount($val)\n {\n $this->_propDict[\"maximumAttendeesCount\"] = intval($val);\n return $this;\n }", "public function setContactCount($value)\n {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
test grabbing a Comment by profile id
public function testGetValidCommentByProfileId() : void { //count the number of rows and save it for later $numRows = $this->getConnection()->getRowCount("comment"); //create a new Comment and insert it into mySQL $commentId = generateUuidV4(); $comment = new Comment($commentId, $this->art->getArtId(), $this...
[ "public function testGetValidCommentByProfileId() : void {\n\n\t\t// count the number of rows and save it for later\n\t\t$numRows = $this->getConnection()->getRowCount(\"comment\");\n\n\t\t//creating Uuid\n\t\t$commentId = generateUuidV4();\n\n\t\t// create a new Comment and insert to into mySQL\n\t\t$comment = new...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns a total expence based on $report
static function getExpense( $report = null ) { switch ( gettype( $report ) ) { case 'NULL': $report = finance_api::getPeriod(); case 'object': $report = finance_api::getReport( $report ); case 'array': } $total = 0; foreach ( $report as $item ) { if ( $item->amount < 0 ) { $total += $ite...
[ "function getTotalofReports(){\r\n $books = getReportofTotal();\r\n $totalIncome = 0;\r\n\r\n for($ctr = 0; $ctr < count($books); $ctr++){\r\n $totalIncome += $books[$ctr][2];\r\n }\r\n\r\n return $totalIncome;\r\n }", "public function retrieveTotalReport()\n {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Incrememts patch level of software
public static function incrementPatchLevel() { self::$patch_level++; }
[ "public final function getBuild()\r\n {\r\n /**\r\n * DO NOT FORGET !!! to update GEMS__PATCH_LEVELS:\r\n *\r\n * For new installations the initial patch level should\r\n * be THIS LEVEL plus one.\r\n *\r\n * This means that future patches for will be loaded...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get the selected mailbox
public function getSelectedMailbox() { return $this->selectedMailbox; }
[ "public function getMailbox()\n {\n return $this->mailbox;\n }", "function get_mailbox() {\r\n global $cache_nonexistantoptions;\r\n\r\n $mailbox = get_settings('imap_authentication_mailbox');\r\n if (! $mailbox or $cache_nonexistantoptions['imap_authentication_mailbo...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Should create a meta tag with client hints
public function test_cl_client_hints_meta_tag() { $doc = new DOMDocument(); $doc->loadHTML(cl_client_hints_meta_tag()); $tags = $doc->getElementsByTagName('meta'); $this->assertEquals($tags->length, 1); $this->assertEquals($tags->item(0)->getAttribute('content'), 'DPR, Viewpo...
[ "abstract function setExtraMetaTags();", "public function metaTag(): string\n {\n return '<meta name=\"robots\" content=\"'.($this->shouldIndex() ? 'index, follow' : 'noindex, nofollow').'\">';\n }", "private function setMetaTags()\n\t{\n\t\t//http://www.jeevansathi.com/<bride>-<mother-tongue>-<rel...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Busca un objeto Monitor en la base de datos.
public function select($monitor){ $id=$monitor->getId(); try { $sql= "SELECT `id`, `marca`, `modelo`, `serial`, `pulgadas`, `observacion`, `estado`, `cargo_id`" ."FROM `monitor`" ."WHERE `id`='$id'"; $data = $this->ejecutarConsulta($sql); for ($i=0; $i < co...
[ "private function createMonitor()\n {\n $servico = factory(Modulos\\Integracao\\Models\\Servico::class)->create([\n 'ser_nome' => \"Monitor\",\n 'ser_slug' => \"get_tutor_online_time\"\n ]);\n\n $ambienteServico = factory(\\Modulos\\Integracao\\Models\\AmbienteServico::...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Deletes all resources that has this one as parent.
public function deleteChildren() { static::deleteAll(['parent' => $this->id]); }
[ "public function unset_on_parent() {\n\t\t$this->parent->delete_by_key( $this->key );\n\t}", "public function delete() {\n\t\tif(!$this->hasChildren())\n\t\t\tparent::delete();\n\t}", "public function deleteAllResources() {\n\t\t$this->resources = array();\n\t}", "private function deleteChildren()\n {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets the iterator classname for the ArrayObject.
public function getIteratorClass () {}
[ "public function getIteratorClass(): string {\n throw new \\Exception('This ' . __CLASS__ . ' does not support this action but it must implement it, because it is extending \\ArrayObject.');\n }", "public function getIteratorName() {\n return null;\n }", "protected function getClassName(): string\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get animal food ration
public function getFoodRation(): Food { return $this->foodRation; }
[ "public function getFood()\n {\n return $this->food;\n }", "private function respirate($animal){\r\n\t\techo $animal->breathe().\"<br/>\";\r\n\t }", "public function makeFood(): Food{\n $asianFood = new AsianFood;\n return $asianFood->getDescription();\n }", "public function foodN...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns a datatable describing how much space is taken up by each numeric archive table.
public function getMetricDataSummary() { Piwik::checkUserHasSuperUserAccess(); return $this->getTablesSummary($this->metadataProvider->getAllNumericArchiveStatus()); }
[ "function diskUsageTable ($c,$table) {\n$extension = array(\"_retention\", \"_hour\", \"_day\", \"_uniq\", \"_path\", \"_referrer\", \"_keyword\", \"_browser\", \"_os\", \"_country\", \"_host\", \"_acces\", \"_pages\", \"_iplist\");\n$table_size = 0;\nforeach ($extension as $ext) {\n\t$thetable = \"$table$ext\";\n\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Return Renderimages of a given member.
function get_RenderImages($class_id=-1, $race_id=-1, $member_name='', $member_xml=false,$realm='') { global $db, $eqdkp, $user, $conf_plus,$eqdkp_root_path; $ret_val = false ; $img_folder = $eqdkp_root_path.'games/'.$eqdkp->config['default_game']."/3dmodel/" ; if ( (($race_id == -1) or ($class_id == -1)) a...
[ "private function _getImages(&$members) {\n \t$images = array();\n \t$i = 0;\n\n $jinput = JFactory::getApplication()->input;\n \t$itemId = $jinput->getInt('Itemid', 0);\n \t\n \t//Get images\n \tforeach($members as $member)\n \t{\n if($member->url_photo != \"\")\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get the color of the pixel on position $x,$y from the image $file
public function GetPixelColor($file, $x, $y) { // Get extension $extension = end(explode(".", $file)); // Get image source $this->Load($file); $image = $this->GetResource(); // Get pixel color $rgb = imagecolorat($image, $x, $y); $r = ($rgb >> 16) & 0xFF; $g = ($rgb >> 8) & 0xFF; $b = $rgb...
[ "public function getImagePixelColor ($x, $y) {}", "function get_color($x, $y)\n{\n\tglobal $image;\n\t\n\treturn $image[$y-1][$x-1];\n}", "public function getPixelColorIndex($x, $y){\n\t\t$x = abs($x); $y = abs($y);\n\t\t// If it's a gif, return each\n\t\tif(is_array($this->gif_sources)){\n\t\t\t$ret = array();...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get the zone ID.
public function getZoneId(): string { return $this->zoneId; }
[ "public function getZoneId()\n {\n return $this->zone_id;\n }", "public function getZoneId() : string\n {\n return $this->zoneId;\n }", "public function getIdZone() {\n return intval($this->idZone);\n }", "function getZoneId() {\t\n\n\t\t// Get service object\n\t\t$service ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Perform SkipJacks RuleA function. Split the data into 4 parts, 2 bytes each: W0, W1, W2, W3.
private function ruleA(&$bytes, $key, $i) { $w = str_split($bytes, 2); if($this->operation() == parent::ENCRYPT) { /* * Set the W3 as the old W2 * Set the W2 as the old W1 * Set the W1 as the G(W0) * Set the W0 as the W1 xor W4 xor i */ $w[4] = $w[3]; $w[3] = $w[2]; $w[2] = $w[1...
[ "private static function step4()\n {\n if (self::$k < 1) { return; }\n switch (self::$buffer[self::$k - 1]) {\n case 'a':\n if (self::ends(\"al\")) { break; }\n return;\n case 'c':\n if (self::ends(\"ance\")) { break; }\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get stories from a task
public function getStoriesForTask($task_gid, $params = array(), $options = array()) { $path = "/tasks/{task_gid}/stories"; $path = str_replace("{task_gid}", $task_gid, $path); return $this->client->getCollection($path, $params, $options); }
[ "public function get_stories() {\n \n /* this is NOT the way to this, this is just simulating pulling all the\n stories from the database. This is where you normally write your db query*/\n\n // put all stories in a single array to fake getting them from a database\n $stories = [$th...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
check if application charge is accepted
public function checkApplicationCharge() { Log::debug('ShopifyApi.checkApplicationCharge'); $status = 'do not know'; $activated_on = null; $shopId = $this->shopifyHelper->getShopId('ShopifyApi.checkApplicationCharge'); $appChargeDB = ApplicationCharge::whereRaw('shop_id = ?',...
[ "public function isAgbAccepted() {\n\t\t$this->getAgbAccepted();\n\t}", "private function _checkRatePAY()\n {\n return $this->_checkCurrency() && $this->_checkCountry() && !$this->_checkDenied() && $this->_checkAge();\n }", "function check_autopay_capable()\n\t{\n\t\tlog_write(\"debug\", \"invoice_...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Set the value of paymentEngine
public function setPaymentEngine($paymentEngine) { $this->paymentEngine = $paymentEngine; return $this; }
[ "private function set_payment_data()\n {\n $this->payment_data = [\n \"paymentType\" => $this->order->get_payment_method(),\n \"priceCOD\" => 0.0,\n ];\n }", "public function setPaymentMethod($value) \n {\n $this->_fields['PaymentMethod']['FieldValue'] = $value;...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get all EventGuestLists by homeowner id filter by event end date
public function getNotificationsEventGuestList($homeOwnerId);
[ "public function load_team_events()\n {\n $where_statement =\n \"WHERE owner_id=?ORDER BY start_datetime ASC\";\n return $this->list_load( $where_statement );\n }", "function getEventList(&$calendar, $start_date, $end_date, $info = '') {\n\tglobal $adb, $current_user, $mod_strings, $app_strings,...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Close select one within many If optional arguments $first and $last are specified, numeric options are automatically created and appended for each possibility. You may still wish to create one "none selected" option with an empty value if you'd like before calling this.
public function endSelectOne($first, $last) { $out = ''; if (is_numeric($first) && is_numeric($last) ) { $last = min($last, $first + 500); for ($i=$first; $i <= $last; $i++) { $out .= "\t<option value=\"{$i}\">{$i}\n"; }; ...
[ "private function SelectClose( $tag )\r\n\t{\r\n\t\t$this->appendHTML( \" </select>\" );\r\n\t\t$this->appendBreak( $tag );\r\n\t}", "function __create_select_range($min, $max, $name, $by = 1, $add_blank = false, $select = \"\", $ignore_auto_select = false, $tags = \"\", $substitutions_array = false)\n{\n\te...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets the name of the default primary column.
protected function get_default_primary_column_name() { }
[ "protected function get_primary_column_name()\n {\n }", "protected function get_primary_column_name() {\n\t\treturn 'ID';\n\t}", "public function defaultColumn()\n {\n return $this->fk ?: snake_case(last(explode('\\\\', get_class($this))));\n }", "private function getTablePrimaryCol...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Prepare transaction request acl post
protected function _prepareAclPost(){ $acl = array(); $acl['post']['PaReq'] = $this->_response->getPareq(); $acl['action'] = $this->_response->getUrl(); $acl['post']['MD'] = $this->_createMd(); $acl['post']['TermUrl'] = $this->getCallbackUrl(); mage::getSingleto...
[ "abstract protected function _buildPostAuthorizationRequest(Request $request);", "public function postGenerateTransaction()\n\t{\n\t\t//if($this->_isValidRequest())\n\t\t//{\n\t\t\t$params = array(\n\t\t\t\t\t'first_name' => Input::get('first_name'),\n\t\t\t 'last_name' => Input::get('last_name'),\n\t\t\t ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
TODO: Implement updateCategory() method
public function updateCategory(Category $category) { }
[ "public function updateCategory()\n {\n $categoryXml = $this->getXmlCategory($this->_category->getId());\n $categoryXml->getElementsByTagName('parent_id')->item(0)->nodeValue = $this->_category->getParentId();\n $categoryXml->getElementsByTagName('name')->item(0)->nodeValue = $this->_categor...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Test setting a maximum ABV that is too large (greater than 100).
public function testSettingAMaximumAbvThatIsTooHigh() { $punkApi = new PunkAPI(); $this->expectException(InvalidArgumentException::class); $punkApi->setAbvUpperBound(107); }
[ "function _checkMaxLimt()\r\n {\r\n if ($this->data[$this->name]['max_limit'] >= $this->data[$this->name]['min_limit']) {\r\n return true;\r\n }\r\n return false;\r\n }", "public function testRangeCheckInclusivityOnMaximumLimit() {\n $Check = new FireCheck\\Range(0, 14...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Create the rss feed for the 10 most recent headlines
public function executeHeadlineFeed() { //get the 10 most recent headlines based off created_at date $c = new Criteria(); $c->addDescendingOrderByColumn(HeadlinePeer::CREATED_AT); $c->setLimit('10'); $headlines = HeadlinePeer::doSelect($c); //set up the rss feed $feed = new sfAtom1Feed(); $feed->set...
[ "function rssHeadlines()\n{\n global $app, $INCLUDE_DIR, $ACMSCfg;\n\n // Get load the RSS generator class\n //require_once($INCLUDE_DIR . \"xmlwriterclass.php\");\n //require_once($INCLUDE_DIR . \"rss_writer_class.php\");\n require_once(\"feedcreator.class.php\");\n\n $pubCount = 0; // How ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/Lista Professor para o select
public function databaseAltTurmaListProfessor() { /*Instancia o objeto de acesso ao banco*/ $objDataBase = new conexao(); $conect = $objDataBase->bd(); $query = "SELECT uf.id, u.nome FROM usuario u"; $query .= " JOIN usuario_funcao uf ON u.id = uf.usuarioid"; $query .= " JOIN fun...
[ "function profsList(){\n\t\t\n\t\t//Call Connection function\n\t\t$conn = manageExamApplication::dbConn();\n\t\t\n\t\t//Fetch all records from user table\n\t\t$query = $conn->prepare(\"SELECT id,prenom FROM user\"); \n\t\t$query->execute();\n\t\t\n\t\t//Intialize variable\n\t\t$profs = '';\n\t\t\n\t\t\n\t\t//Execut...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Position the 'cursor' at a given Y
public function setCursorY($y) { // Don't use SetY(): // - This also resets fpdf->x !!! // - fpdf->SetY moves the cursor from the bottom for negative values // $this->fpdf->SetY($this->fpdf->tMargin + $this->parseGlobalValue_v($y)); $this->fpdf->y = $this->fpdf->tMargin + $...
[ "public function moveCursorTo(int $x, int $y)\n {\n $this->cursorX = $x;\n $this->cursorY = $y;\n\n $this->cursor->moveTo($x, $y);\n }", "private function moveCursor($x = null, $y = null)\n {\n $y = ($y ?? $this->y) + $this->yLimit;\n $x = ($x ?? $this->x) + $this->xLim...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This function print for selector clock size list
function print_thesize_list($size){ $size_list = array("50","75","100","150","180","200","250","300"); echo "\n"; foreach($size_list as $isize) { $check_value = ""; if ($isize == $size) $check_value = ' SELECTED '; echo '<option value="'.$isize.'" '.$check_value .'>'.$isize.'</option>'; echo "\n"; ...
[ "function print_thelength_list($size){\n\t $size_list = array(\"short\",\"continent\",\"long\");\n\n\t echo \"\\n\";\n\tforeach($size_list as $isize)\n\t{\n\t\t$check_value = \"\";\n\t\tif ($isize == $size)\n\t \t\t$check_value = ' SELECTED ';\n\t\techo '<option value=\"'.$isize.'\" '.$check_value .'>'.$isize.'</...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Return the os param as an integer.
public static function getOsAsInteger() { if (self::isAndroid()) { return ANDROID_OS; } if (self::isIos()) { return IOS_OS; } return OTHER_OS; }
[ "public function getOSID()\n {\n return $this->_intOSID;\n }", "public function getAppOSId()\n {\n return $this->getValue('nb_app_os_id');\n }", "public function toInt() : int {\n return (string) $this->version;\n }", "function request_as_integer($params = 0)\n{\n\tif (requ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Add initial CMS Areas
protected function addCmsAreas(): self { $sDefaultAreaData = json_encode([ [ 'slug' => 'html', 'data' => [ 'body' => implode(PHP_EOL, [ '<p style="padding: 2rem; border:1px solid #ccc; background: #eee;">', ...
[ "private function InitAreas()\n {\n $sql = Access::SqlBuilder();\n $tbl = Area::Schema()->Table();\n $where = $sql->Equals($tbl->Field('Layout'), $sql->Value($this->layout->GetID()))\n ->And_($sql->IsNull($tbl->Field('Previous')));\n $area = Area::Schema()->First($where...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Creates a new set with the given enumeration objects or values removed
public function withoutIterable(iterable $enumerators): self { $clone = clone $this; foreach ($enumerators as $enumerator) { $clone->{$this->fnDoUnsetBit}(($this->enumeration)::get($enumerator)->getOrdinal()); } return $clone; }
[ "public function removeSets();", "public function toSet();", "public function testEnumerationSetDelete()\r\n {\r\n\r\n }", "public function uniqueSet();", "public function removeFromSet($fieldName, array $values);", "public function filterNotNull(): Set;", "public function to_set() {\n retu...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
SQLite Snippets Escape the characters in text that could break the PHP
function api_sqlite_escape($text){ $ret = str_replace("'","''",$text); return $ret; }
[ "function getEscaped( $text )\n\t{\n\t\treturn sqlite_escape_string($text);\n\t}", "function _sql_escape() { }", "function bb2_db_escape($string) {\n\treturn $string;\n#\treturn $GLOBALS['lbdata']->Quote($string);\n}", "function db_driver_escape($data)\n{\n global $_db;\n\n if ($_db['resource'][$_db['ta...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns a valid post_id string for a given term and taxonomy. No longer needed since WP introduced the termmeta table in WP 4.4.
function acf_get_term_post_id( $taxonomy, $term_id ) { _deprecated_function( __FUNCTION__, '5.9.2', 'string format term_%d' ); return 'term_' . $term_id; }
[ "function acf_get_term_post_id( $taxonomy, $term_id ) {\n}", "public function termId() { return $this->post->term_id; }", "function the_term_id($term) {\n echo get_term_id($term);\n }", "protected function get_posted_term_id( $taxonomy ) {\n\t\treturn \\filter_input( \\INPUT_POST, WPSEO_Meta::$fo...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ Return array of game info
public function get_game_info_array() { return $this->GAME_INFO; }
[ "public function getInfo() {\n $conn = new DB();\n $infos = [];\n $req = $conn->connect()->prepare(\"SELECT * FROM infogame\");\n $req->execute();\n $data = $req->fetchAll();\n foreach($data as $data_info) {\n $infos[] = new infogame($data_info['dev'], $data_info...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Create request for operation 'weatherPostalCodeGet'
protected function weatherPostalCodeGetRequest($postal_code) { // verify the required parameter 'postal_code' is set if ($postal_code === null) { throw new \InvalidArgumentException( 'Missing the required parameter $postal_code when calling weatherPostalCodeGet' ...
[ "public function v1AddressZipCodeRequest($zip_code)\n {\n // verify the required parameter 'zip_code' is set\n if ($zip_code === null || (is_array($zip_code) && count($zip_code) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $zip_code w...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets the public 'TYPO3\CMS\T3editor\Registry\AddonRegistry' shared autowired service.
protected function getAddonRegistryService() { return $this->services['TYPO3\\CMS\\T3editor\\Registry\\AddonRegistry'] = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstanceForDi(\TYPO3\CMS\T3editor\Registry\AddonRegistry::class); }
[ "protected function getRegistryService()\n {\n return $this->services['TYPO3\\\\CMS\\\\Core\\\\Registry'] = \\TYPO3\\CMS\\Core\\ServiceProvider::getRegistry($this);\n }", "protected function getAddon()\n {\n return $this->addon;\n }", "protected function getEmConfUtilityService()\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ dunghd 19/03/2012 Unit test function searchBusinessNearByLocation
public function test_search_business_nearyby_location() { // Search keyword $keyword = 'hotel'; $location = 'Sydney, NSW'; $search = new SearchModel; $result = $search->searchBusinessNearByLocation($keyword,$location); // log to file $xml = new Array2xml('results','business'); $xml->createNode( $r...
[ "public function testLocationsGeoSearch()\n {\n }", "public function testLocationsSearch()\n {\n }", "function testNearbysearch() {\n //$this->markTestSkipped();\n $response = helper::jsonDecode($this->_rest->get($this->_restaurants_search_uri, array('location' => '-33.8670522,151.1957...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Executes this Choreo. Execution object provides access to results appropriate for this ListAudits Choreo.
public function execute($inputs = array(), $async = false, $store_results = true) { return new Zendesk_TicketAudits_ListAudits_Execution($this->session, $this, $inputs, $async, $store_results); }
[ "public function getAudits()\n {\n return $this->audits;\n }", "public function getAudits() {\n $user = $this->auth->user();\n\n if(!$user) {\n return CustomResponsesHandler::response([\n \"code\" => 401,\n \"message\" => \"Permisos denegados par...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Prints the current page name as a CSSsafe string
function the_page_id() { echo Utils::cssSafe(Filter::get(current_page(), 'name')); }
[ "function CurrentPageName() {\n\treturn GetPageName(ScriptName());\n}", "function curPageName() {\n\treturn substr($_SERVER[\"SCRIPT_NAME\"], strrpos($_SERVER[\"SCRIPT_NAME\"], \"/\") + 1);\n}", "function current_page_name() {\r\n return basename($_SERVER['SCRIPT_FILENAME']);\r\n }", "functi...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Build an IP detector instance from the configured settings.
public static function build() { $proxy = ITSEC_Modules::get_setting( 'global', 'proxy' ); return self::build_for_type( $proxy ); }
[ "public static function build($name)\n {\n if (self::ipLookupEnabled()) {\n $customProviders = config('tracker.lookup.custom_providers');\n\n if ($customProviders && array_key_exists($name, $customProviders)) {\n\n // Use of a custom IP address lookup provider\n\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns all messages containing the specified search string, most recent first
public function searchMessages($string) { $query = $this->db->query("SELECT user_username, text, posted_at FROM Messages WHERE text LIKE '%$string%' ORDER BY posted...
[ "public function searchMessages($string) {\n return $this->db->select('*')\n ->from('Messages')\n ->like('text', $string)\n ->order_by('posted_at', 'DESC')\n ->get()\n ->result_array();\n }", "public function ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Create a tournament in the database
protected function createTournament(\AcceptanceTester $I, $attributes = []) { $faker = \Faker\Factory::create(); $tournamentName = implode('-', $faker->words()); $tournamentTitle = Strings::formatForTitle(implode('_', $faker->words())); $open = Carbon::now()->subDay(1)->toDateTimeStr...
[ "public function actionCreate()\n {\n $model = new Tournament();\n\n if ($model->load(Yii::$app->request->post()) && $model->createNewTournament()) {\n\n return $this->redirect(['view', 'id' => $model->id_t]);\n }\n\n return $this->render('create', [\n 'model' =>...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
display the sponsorship page
public function sponsorship(){ return view('pages.sponsorship'); }
[ "function _show_sponsors() {\n\t// Loading the DAO class\n\t$dao = new SponsorDAO();\n\t\n\tif ( Input::get('remove') ) {\n\t\t$dao->remove( $dao->get( Input::get('remove') ) );\n\t\t$message = __('A sponsor was removed!', 'wp-sfw-plugin');\n\t}\n\t\n\t$acive_sponsors\t\t= $dao->getAll( 'name', false, false, 'activ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Payout Swift Settings Post
public function payout_swift_settings_post() { if ($this->earnings_admin_model->update_swift_payout_settings()) { $this->session->set_flashdata('msg_swift', 1); $this->session->set_flashdata('success', trans("msg_updated")); } else { $this->session->set_flashdata(...
[ "public function payout_paypal_settings_post()\n {\n if ($this->earnings_admin_model->update_paypal_payout_settings()) {\n $this->session->set_flashdata('msg_paypal', 1);\n $this->session->set_flashdata('success', trans(\"msg_updated\"));\n } else {\n $this->session...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Create a new virtual empty archive, the name will be the default name when the archive is flushed.
function CreateNew($ArchName='new.zip') { if (!isset($this->Meth8Ok)) $this->__construct(); // for PHP 4 compatibility $this->Close(); // note that $this->ArchHnd is set to false here $this->Error = false; $this->ArchFile = $ArchName; $this->ArchIsNew = true; $bin = 'PK'.chr(05).chr(06).str_repeat(ch...
[ "function createArchive() {\n\t\t$this->editArchive();\n\t}", "function CreateNew($ArchName='new.zip') {\n\t\tif (!isset($this->Meth8Ok)) $this->__construct(); // for PHP 4 compatibility\n\t\t$this->Close(); // note that $this->ArchHnd is set to false here\n\t\t$this->Error = false;\n\t\t$this->ArchFile = $ArchN...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Set the time format Sets the time / date format for asn1map().
function setTimeFormat($format) { $this->format = $format; }
[ "public function set_time_format($in) {\n\t\t$this->time_format = $in;\n\t}", "function setTimeFormat($fmt)\n {\n $this->__time_format = $fmt ;\n }", "public function setTimeFormatISO8601(): void {\n $this->timeFieldFormat = 'Y-m-d\\TH:i:s.uP';\n }", "function pkTimeFormat($time = 0, $t...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Metodo para eliminar un preDetalle
function deletePreDetalle(){ $sql='DELETE FROM prepedidos WHERE IdCliente = ?'; $params=array($this->cliente); return Database::executeRow($sql, $params); }
[ "function deletePreDetalle2()\n {\n $sql='DELETE FROM predetalle WHERE idPreDetalle = ?';\n $params=array($this->idPre);\n return Database::executeRow($sql, $params);\n }", "function deletePreDetalle(){\n $sql='DELETE FROM predetalle WHERE idCliente = ?';\n $params=array($...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
checks if the object has the given attribute
private function has_attribute($attribute){ //this fetchs all the variables(attributes)of the object [private or public] $object_vars= $this->attributes(); //checks if the attribute is part of the object_vars return array_key_exists($attribute, $object_vars); }
[ "private function has_attribute($attribute){\n $object_vars=$this->attributes();\n return array_key_exists($attribute,$object_vars);\n }", "public function hasAttr($attr) {\n return $this->$attr;\n }", "public function attributeExists($attribute);", "public function isProperty($attribute);", ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
get the topic_ids of all childs of the passed topic including itself
static function getChildTopicIds($topic_id) { $constraints = ForumPPEntry::getConstraints($topic_id); $stmt = DBManager::get()->prepare("SELECT topic_id FROM forumpp_entries WHERE lft >= ? AND rgt <= ?"); $stmt->execute(array($constraints['lft'], $constraints['rgt'])); ...
[ "public function getTopicIds() {\n\t\t$ids = array();\n\t\t$topics = $this->getTopics();\n\t\tforeach ($topics as $topic) {\n\t\t\t$ids[] = $topic->getId();\n\t\t}\n\t\treturn $ids;\n\t}", "public function get_children_topics($id_parent = NULL)\n { \n //@todo VERSION WITH ORM\n \n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Handle the Admin "restored" event.
public function restored(Admin $admin) { // }
[ "function post_restoreItem() {\n }", "protected function afterRestore() {}", "protected function beforeRestore() {}", "public function restored(Employee $employee)\n {\n event(new EmployeeUpdated($employee, \"restore\"));\n }", "public function restored(Event $event)\n {\n //\n }...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get all festival types
public static function getAllFestivalTypes() { $database = DatabaseFactory::getFactory()->getConnection(); $sql = "SELECT * FROM fest_type"; $query = $database->query($sql); // fetchAll() is the PDO method that gets all result rows return $query->fetchAll(); }
[ "public function types()\n {\n return $this->all('rdf:type');\n }", "public function getTypes()\n {\n }", "public function getAllMealTypes()\n {\n return MealFoodType::all();\n }", "public function getAllTypes(): array\n {\n return $this->types;\n }", "public function ge...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the content of the member variable foods.
public function getFoodsData() { return $this->foods; }
[ "public function getFood()\n {\n return $this->food;\n }", "public function getListFood(){\r\n\t\treturn MongoDatabase::getAllDataFrom(\"MonAn\");\t\t\r\n\t}", "public function foodName()\n {\n return static::randomElement(static::$foodNames);\n }", "public static function listAller...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets value of 'has_order' property
public function setHasOrder($value) { return $this->set(self::has_order, $value); }
[ "function setOrder($order) \n\t{\n $this->order = $order;\n }", "public function setOrder($order);", "public function setOrder()\n {\n $this->setOrderValue();\n }", "public function setOrdered( $ordered ) {\n\t\t$this->ordered = $ordered;\n\t}", "public function setOrder(?Order $order): voi...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns a list of batches
public function getBatches(){ return $this->get("/batch"); }
[ "public function getBatches()\n {\n $batches = $this->db->query(\"SELECT * FROM batch\")->fetchAll();\n return $batches;\n }", "public static function getBatchs(){\n $batchs;\n \n // List of batchs created manually, this would come from db\n for($i=1;$i<=5;$i++){\n $batch=new ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the value of field command_type
public function getCommandType() { return $this->command_type; }
[ "public function getCmdType();", "public function getCommandType()\n {\n return $this->commandType;\n }", "public function messageType(): string\n {\n return DomainMessage::TYPE_COMMAND;\n }", "protected function getCommandAndType($value, Command $command)\r\n\t{\r\n\t\t$key = $comma...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }