query
stringlengths
10
8.11k
document
stringlengths
17
398k
negatives
listlengths
19
20
metadata
dict
Reload the redirection information from the session
function reloadSessionState() { @$state =& $_SESSION[$this->xoBundleIdentifier]; if ( $state ) { if ( @$state['tmpDisallowRedirections'] ) { $this->enableRedirections = false; } if ( !empty( $state['redirect_info'] ) ) { foreach ( $state['redirect_info'] as $k => $v ) { $_SERVER[ 'REDI...
[ "public function reload()\n\t{\n\t\t$this->redirect($this->getRequest()->getRequestUri());\n\t}", "public static function restore(){\n\t\tif($_SESSION['saved_url']){\n\t\t\t$url = $_SESSION['saved_url'];\n\n\t\t\tunset($_SESSION['saved_url']);\n\n\t\t\tself::redirect($url);\n\t\t}\n\t}", "public function reload...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Removes an item from the list by identifier. This method removes all the items that were found with the given id. Please note that if no id is provided on the item it won't have any effect at all!
public function removeItem($id) { $this->items = $this->items->reject(function ($item) use (&$id) { if (isset($item['id']) && $item['id'] === $id) { return true; } return false; }); }
[ "public function removeItem($id) {\r\n unset($this->items[$id]);\r\n return $this->saveBasket();\r\n }", "public function removeItem($id){\n $this->totalQty -= $this->items[$id]['qty'];\n $this->totalPrice -= $this->items[$id]['price'];\n\n unset($this->items[$id]);\n }", ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Siawood_Products_Plugin constructor. It defines related constant, include autoloader class, register activation hook, deactivation hook and uninstall hook and call Core class to run dependencies for plugin
public function __construct() { /*Define Autoloader class for plugin*/ $autoloader_path = 'includes/class-autoloader.php'; /** * Include autoloader class to load all of classes inside this plugin */ require_once trailingslashit( plugin_dir_path( __FILE__ ) ) . $autoloader_path; /*Define required constan...
[ "public function __construct() {\n\t\t/*Define Autoloader class for plugin*/\n\t\t$autoloader_path = 'includes/class-autoloader.php';\n\t\t/**\n\t\t * Include autoloader class to load all of classes inside this plugin\n\t\t */\n\t\trequire_once trailingslashit( plugin_dir_path( __FILE__ ) ) . $autoloader_path;\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Create request for operation 'getIntegrationsActionDraftTemplate'
protected function getIntegrationsActionDraftTemplateRequest($actionId, $fileName) { // verify the required parameter 'actionId' is set if ($actionId === null || (is_array($actionId) && count($actionId) === 0)) { throw new \InvalidArgumentException( 'Missing the required ...
[ "protected function retrieveTemplate2Request()\n {\n\n $resourcePath = '/accountnumberformats/template';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\n\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get the key for the first settings tab in the collection.
public static function firstSettingsTabKey() { return static::settingsTabs()->tabs[0]->key; }
[ "public function get_settings_key() {\n\n return $this->settings_key;\n }", "public function first_key()\r\n {\r\n reset($this->collection);\r\n return key($this->collection);\r\n }", "public function firstKey()\n {\n return array_key_first($this->items);\n }", "publ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
The standard error if not empty, else the standard output
public function getStdErrOrOut() : string { return empty($this->std_err) ? $this->std_out : $this->std_err; }
[ "public function getErrorOutput();", "public function clearErrorOutput();", "public function stdErr($text) {\n\t\tfwrite(STDERR, $text.PHP_EOL);\n\t}", "public function getStdErr(): string\n {\n return $this->cmdResult->getStdErr();\n }", "public function testSendToStdErr()\n\t{\n\t\t$result = ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Recupera el atributo df_nacimiento de PersonaGlobal
function getF_nacimiento() { if (!isset($this->df_nacimiento) && !$this->bLoaded) { $this->DBCarregar(); } if (empty($this->df_nacimiento)) { return new web\NullDateTimeLocal(); } $oConverter = new core\ConverterDate('date', $this->df_nacimiento); ...
[ "public function getFechaNacimientoPersona(){\n return $this->fechaNacimientoPersona;\n }", "public function getLocalidad_nac()\r\n\t{\r\n\t\treturn($this->localidad_nac);\r\n\t}", "public function getNacimiento()\r\n {\r\n return $this->nacimiento;\r\n }", "public function getFecha_nacimie...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Operation updateNetworkWirelessSsidDeviceTypeGroupPoliciesAsync Update the device type group policies for the SSID
public function updateNetworkWirelessSsidDeviceTypeGroupPoliciesAsync($network_id, $number, $update_network_wireless_ssid_device_type_group_policies = null) { return $this->updateNetworkWirelessSsidDeviceTypeGroupPoliciesAsyncWithHttpInfo($network_id, $number, $update_network_wireless_ssid_device_type_group...
[ "public function testUpdateNetworkWirelessSsidDeviceTypeGroupPolicies()\n {\n }", "public function updateNetworkWirelessSsidDeviceTypeGroupPolicies($network_id, $number, $update_network_wireless_ssid_device_type_group_policies = null)\n {\n list($response) = $this->updateNetworkWirelessSsidDeviceT...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Optional. Specification of the discovery feature applied to data in this zone. Generated from protobuf field .google.cloud.dataplex.v1.Zone.DiscoverySpec discovery_spec = 103 [(.google.api.field_behavior) = OPTIONAL];
public function setDiscoverySpec($var) { GPBUtil::checkMessage($var, \Google\Cloud\Dataplex\V1\Zone\DiscoverySpec::class); $this->discovery_spec = $var; return $this; }
[ "public function setDiscoverySpec($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Cloud\\Dataplex\\V1\\Asset\\DiscoverySpec::class);\n $this->discovery_spec = $var;\n\n return $this;\n }", "public function setDiscovery($var)\n {\n GPBUtil::checkMessage($var, \\Grafeas\\V1\\D...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Creates a form to create a AsignacionesCV entity.
private function createCreateForm($id,AsignacionesCV $entity) { $form = $this->createForm(new AsignacionesCVType($id), $entity, array( 'action' => $this->generateUrl('asignacionescv_create',array('id' => $id)), 'method' => 'POST', )); $form->add('submit', 'submit', ...
[ "private function createCreateForm(Cv $entity)\n {\n $form = $this->createForm(new CvType(), $entity, array(\n 'action' => $this->generateUrl('cv_create'),\n 'method' => 'POST',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Create'));\n\n return $for...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Unset url to allow local environment to receive callback for development testing
final private function unbindLocalUrl() { if (!app()->runningInConsole()) { $baseUrl = request()->getBaseUrl(); } $root = $baseUrl ?? config('app.url'); if (app()->environment() === "local") { URL::forceRootUrl($root); } }
[ "public static function unsetTestURL() {\n URLHelper::$testURL = null;\n }", "private function cleanUrl(): void\n {\n $this->url = array_filter($this->url);\n if (isset($this->url[1]) && strlen($this->url[1])) {\n $this->module = $this->url[1];\n unset($this->url[1...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Nombre funcion:getMensaje Proposito:devuelve el mensaje que puede ser visto por el usuario Fecha creacion:12/05/2009
function getMensaje(){ return $this->mensaje; }
[ "function enviarMensaje($datos = array(), $id_usuario_destinatario) {\n global $textos, $sql, $sesion_usuarioSesion;\n\n $usuario = new Contacto();\n $destino = \"/ajax\".$usuario->urlBase.\"/sendMessage\";\n\n if (empty($datos)) {\n \n $nombre = $sql->obtenerValor(\"lista_usuarios\", \"n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Test edit tag for user.
public function testEditTagUser(): void { // given $expectedStatusCode = 302; $user = $this->createUser([User::ROLE_USER]); $this->logIn($user); $expectedTag = new Tag(); $expectedTag->setName('Test Tag'); $tagRepository = self::$container->get(TagRepository:...
[ "public function testUserEditWithUser() {\n // Request in GET&POST and expect 403\n $this->checkResponseStatusCode(\n '/users/1/edit',\n ['GET', 'POST'],\n 403,\n $this->createRoleUserClient()\n );\n }", "public function testEditUser()\n {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Append the method info array to controller
private function appendMethod($controller, $method) { $this->needsUpdate = true; $lang_data = ['controller' => $controller, 'method' => $method]; $this->permissions[$controller]['methods'][$method] = [ 'name' => Lang::get('laravel-permy::defaults.method.name', $lang_data), ...
[ "private function setControllerMethod()\r\n {\r\n if(!$this->route) return;\r\n\r\n $currentRoute = $this->routes[$this->routeKey];\r\n\r\n $methods = isset($currentRoute['methods']) ? $currentRoute['methods'] : array();\r\n\r\n if(!$methods) return;\r\n\r\n foreach($methods AS $requestType =>...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ This method displays patient note and prescription for the certain appointment. param: appointId = appointment unique id.
function appointmentNote($appointId) { $appointment = ChcAppointment::find($appointId); $patient = ChcPatient::find($appointment->patient_id); $appointmentNote = ChcAppointmentDetail::getAppointmentNote($appointId, $appointment->patient_id); return view('appointment-details\appointment-notes', ['appoi...
[ "public function patientAppointmentAction() {\n\t\n\t\t$this->view->headTitle('Patient Appointments');\n $usersNs = new zend_Session_Namespace(\"members\");\n $Patient = new Application_Model_Patient();\n $docPatient = $Patient->fetchRow(\"user_id='{$usersNs->userId}'\");\n $Appointment ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/! \static Creates a new RSS Import \param User ID \return the new RSS Import object
static function create( $userID = false, $language ) { if ( $userID === false ) { $user = eZUser::currentUser(); $userID = $user->attribute( "contentobject_id" ); } $dateTime = time(); $row = array( 'id' => null, 'name'...
[ "static function create( $user_id, $language )\r\n {\r\n $config = eZINI::instance( 'site.ini' );\r\n $dateTime = time();\r\n $row = array( 'id' => null,\r\n 'node_id', '',\r\n 'title' => ezi18n( 'kernel/classes', 'New RSS Export' ),\r\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sign in form component factory.
protected function createComponentSignInForm() { $form = new Form; $form->addText('email', 'email') ->setRequired('Zadejte prosím Váš e-mail.') ->setAttribute('placeholder', 'e-mail'); $form->addPassword('password', 'heslo') ->setRequired('Zadejte prosím Vaše heslo.') ...
[ "protected function createComponentSignInForm()\r\n\t{\r\n\t\t$form = new Form;\r\n\t\t$form->addText('username', '')\r\n\t\t\t->setRequired('Prosím, zadejte název uživatele.')\r\n\t\t\t->setAttribute('placeholder', 'Uživatel');\t\r\n\r\n\t\t$form->addPassword('password', '')\r\n\t\t\t->setRequired('Prosím zadejte ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Check if post process has been set
public function hasPostProcess() { return !is_null($this->postProcess); }
[ "public function hasDefaultPostProcess()\n {\n return !is_null($this->getDefaultPostProcess());\n }", "protected function isPostRequestCompulsoryForProcessStep()\n {\n return true;\n }", "protected function checkPostbackFlag(): bool\n {\n return Request::method() === 'POST' &...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Return merchant acquirer certificate
public function getAcquirerCertificate() { return $this->acquirerCertificate; }
[ "abstract public function getConsumerCertificate();", "public function get_certificate() {\n return self::extract_key($this->get_certificate_file());\n }", "public function getCertificate(): string\n {\n switch ($this->ctxMode) {\n case self::MODE_TEST:\n return $this->ce...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Reject the specified company document in storage.
public function reject($cid, $id) { $company = Company::findOrFail($cid); $ss = CompanyDocSubcontractorStatement::findOrFail($id); // Check authorisation and throw 404 if not //if (!Auth::user()->allowed2("sig.company.doc", $doc)) // return view('errors/404'); $s...
[ "public function rejectResource()\n {\n # code...\n }", "public function reject($cid, $id)\n {\n $company = Company::findOrFail($cid);\n $ptc = CompanyDocPeriodTrade::findOrFail($id);\n\n // Check authorisation and throw 404 if not\n //if (!Auth::user()->allowed2(\"sig....
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets the lastMessagePreview Preview of the last message sent in the chat. Null if no messages have been sent in the chat. Currently, only the list chats operation supports this property.
public function getLastMessagePreview() { if (array_key_exists("lastMessagePreview", $this->_propDict)) { if (is_a($this->_propDict["lastMessagePreview"], "\Beta\Microsoft\Graph\Model\ChatMessageInfo") || is_null($this->_propDict["lastMessagePreview"])) { return $this->_propDict[...
[ "public function lastMessage()\n {\n $messages = $this->messages();\n\n if (! count($messages)) {\n return null;\n }\n\n // API returns messages from newest to oldest so last message is the\n // first one of the list\n return $messages[0];\n }", "public f...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Operation getLootboxManagersWithHttpInfo Get lootbox managers
public function getLootboxManagersWithHttpInfo($x_game_key, string $contentType = self::contentTypes['getLootboxManagers'][0]) { $request = $this->getLootboxManagersRequest($x_game_key, $contentType); try { $options = $this->createHttpClientOption(); try { $r...
[ "public function getManagers();", "public function getManagersList(): array\n {\n $managers = Manager::with('details')->get();\n\n $all = [];\n\n foreach ($managers as $manager) {\n /** @var Manager $manager */\n /** @var ManagerDetails $details */\n $detai...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the background as it is currently stored (currently anyway only for completeness. not used for further processing)
function get_background_attachment() { return $this->_props["background_attachment"]; }
[ "public function getBackground()\n\t{\n\t\treturn $this->background; \n\n\t}", "public function getNewBackground()\n\t{\n\t\treturn $this->newBackground; \n\n\t}", "public function getBackground()\n {\n return $this->background;\n }", "public function get_background()\r\n\t{\r\n\t\treturn $this...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Dispatch the next job on the chain.
public function dispatchNextJobInChain() { if (! empty($this->chained)) { dispatch(tap(unserialize(array_shift($this->chained)), function ($next) { $next->chained = $this->chained; $next->onConnection($next->connection ?: $this->chainConnection); ...
[ "public function dispatchNextJobInChain()\n {\n $me = $this;\n if (! empty($this->chained)) {\n dispatch(tap(unserialize(array_shift($this->chained)), function ($next) use($me) {\n $next->chained = $me->chained;\n }));\n }\n }", "public function disp...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the grouped config parameters.
public function getGroupedConfigParameters() { $configParameters = $this->config->getConfigParameters(); $groupedConfigParameters = []; $postTypes = $this->getPostTypes(); foreach ($postTypes as $postType => $postTypeObject) { if ($postType === ObjectHandler::ATTACHMENT...
[ "public function getGroupConfig()\n {\n return $this->group_config;\n }", "public function getGroups()\n {\n return $this->config['groups'];\n }", "public function getParamgroups()\n {\n if (empty($this->paramgroups)) {\n $this->paramgroups = $this->container->get(...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
A mechanism family's name can only be changed in the draft state once sandboxed, it is permanently set
static function change_name($family, $name, $shortname) { // get mechanism family if(!$mfam = MongoLib::findOne_editable('mechanism_families', $family)) return ErrorLib::set_error("That mechanism family was not found"); // check mfam.square if($mfam['square'] != 'draft') return ErrorLib::...
[ "public function unsetFamilyName(): void\n {\n $this->familyName = [];\n }", "public function setFamily(string $family);", "public function setFamilyName($value)\n {\n $this->familyName = $value;\n }", "public function setFamilyName($newFamilyName)\n\t{\n\t\tif (is_string($newFamilyN...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Combines this map with the supplied map The values in the supplied map will take precedence if this map and the supplied map have duplicate keys.
function merge(IMap $map);
[ "public function putAll(\\blaze\\collections\\Map $map) {\n $newMap = new \\blaze\\collections\\map\\HashMap();\n\n foreach ($map as $key => $value) {\n $newMap->put($this->key . '.' . self::getCheckedKey($key), $value);\n }\n\n return $this->cache->putAll($newMap);\n }", ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get all the boards for the category sorted by position.
public function sortedBoards() { return $this->boards()->orderBy('position'); }
[ "public function get_all_boards() {\n\t\tglobal $core;\n\t\t$query = $this->core->db->make_query(\"boards,categories\");\n\t\t$query->add_condition_direct(\"`boards`.`category_id` = `categories`.`category_id`\");\n\t\t$query->set_order(\"board_order ASC\");\n\t\t$result = $query->execute();\n\t\treturn $result;\n\t...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Displays a filtered and sorted list of Listings based on the given Condition model
public function viewAll($conditions) { $listings = new Listing(); # ************************************************** # **********SEARCH BY SELECTING A CATEGORY********** # ************************************************** if(isset($conditions->category)) { $listings = $listings->where('Category_Id', ...
[ "public function listings() {\r\n $data = $this->model->getData();\r\n $this->template->data = $data;\r\n $this->set('general/list');\r\n }", "public function buildListings();", "function listing($filters);", "function bindingListingByFilter()\n {\n $searchType = $this->input...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get the altered migration plugin.
public function getMigration();
[ "public function getOriginalMigration();", "public function getMigration() {\n return $this->migration;\n }", "public function getMigration(): Migration\n {\n return $this->migration;\n }", "protected function get_plugin() {\n\n\t\treturn $this->plugin;\n\t}", "public function getMigration(...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Renew frontend server node information if it is outdated or it does not exist.
public function process() { $oNodesManager = $this->_getServerNodesManager(); $sServerNodeId = $this->_getUtilsServer()->getServerNodeId(); $oNode = $oNodesManager->getServer($sServerNodeId); $oNodeChecker = $this->_getServerNodeChecker(); if (!$oNodeChecker->check($oNode)) ...
[ "public function testUpdateNode()\n {\n $this->markTestIncomplete('We need a way to reliably create a node first.');\n }", "function brp_ws_client_node_type_update($info) {\n if (!empty($info->old_type) && $info->old_type != $info->type) {\n variable_set('brp_ws_client_node_connection_' . $info->...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
function getZoneCountry This function is used to remove the zone. Database Tables used in this function are : tbl_country
function getZoneCountry() { $varQuery = "SELECT zone,group_concat(' ',name) as Countries FROM " . TABLE_COUNTRY . " WHERE status='1' AND zone!='' GROUP BY(zone) ASC"; $arrRes = $this->getArrayResult($varQuery); //pre($arrRes); return $arrRes; }
[ "function znGetZones( $countryID = null )\n{\n if ( $countryID == null )\n $q=db_query(\"select zoneID, zone_name, \".\n \" zone_code, countryID from \".ZONES_TABLE.\" \".\n \" order by zone_name\" );\n else\n $q=db_query(\"se...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Fetch all currency entities
public function fetchAll() { return $this->prepareResults($this->currencyMapper->fetchAll()); }
[ "function findAll() {\n return Currencies::find(array(\n 'order' => 'name',\n ));\n }", "abstract public function retrieveCurrencies();", "public static function Retrieve_all(){\n $currencies= \\App\\currencies::all();\n return $currencies;\n }", "public function findAll() {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets the public 'manager' shared service.
protected function getManagerService() { $a = ($this->services['connection'] ?? $this->getConnectionService()); if (isset($this->services['manager'])) { return $this->services['manager']; } return $this->services['manager'] = new \stdClass($a); }
[ "public function getSharedManager()\n {\n return $this->sharedManager;\n }", "public function getManager()\n {\n return Manager::getInstance();\n }", "public static function getServiceManager()\n {\n // return service manager instance\n return static::$serviceManager;\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Called when a test raises warnings.
public function testWarning(TestWarning $warning) { $t= $this->addTestCase($warning, 'errors'); $t->addChild(new Node('error', $this->messageFor($warning), array( 'message' => 'Non-clear error stack', 'type' => 'warnings' ))); }
[ "public function testWarning(TestWarning $warning);", "public function testWarning(\\unittest\\TestWarning $warning) {\n // Empty\n }", "public function testWarning(\\unittest\\TestWarning $warning) {\n $this->writeFailure($warning);\n $this->stats['warned']++;\n }", "public function testWarning() ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Update Warmup process on completion.
private function set_warmup_status_completed() { $this->set_warmup_status_finish_time(); $this->set_warmup_force_optimization(); }
[ "private function respawn()\n {\n // create new event at the end of the queue\n Mage::getModel('marketingsoftware/queue')\n ->setObject($this->currentStatus)\n ->setAction('file_sync')\n ->save();\n }", "public function provision()\n {\n ProvisionWebS...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Set the content with the layout applied
public function setPostLayoutContent($content);
[ "public function layout() {}", "public function getContentLayoutView();", "public function initLayout();", "protected function setupLayout(){\n\t\t\tif (!is_null($this->layout)){\n\t\t\t\t$this->layout = View::make($this->layout);\n\t\t\t}\n\t\t}", "public function testSetLayout()\n\t{\n\t\t// Remove the fo...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the date of death
public function getDateOfDeath(): ?Date { return $this->dod; }
[ "function getDeathDate()\n {\n $evDeath = $this->getDeathEvent();\n if ($evDeath)\n return $evDeath->getDate($this->dprivlim);\n else\n return '';\n }", "public function getDeathday()\n {\n return $this->deathday;\n }", "public function getDea...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Public Methods ========================================================================= Set our $plugin static property to this class so that it can be accessed via CraftStatus::$plugin Called after the plugin class is instantiated; do any onetime initialization here such as hooks and events. If you have a '/vendor/au...
public function init() { parent::init(); self::$plugin = $this; $this->_registerLogger(); $this->_redirectAfterInstall(); $this->_registerEvents(); }
[ "static\tpublic \tfunction\tinit() {\n\t\t\t/**\n\t\t\t * Implement any processes that need to happen before the plugin is instantiated. \n\t\t\t */\n\t\t\t\n\t\t\t//Instantiate the plugin and return it. \n\t\t\treturn new self();\n\t\t}", "public function init()\n {\n parent::init();\n self::$pl...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
name CFDiskIO::getBelongingRaidDev($dev) description Searches for the RAID device, a physical partition belongs to, if it is part of a RAID. parameter dev: The physical partition (e.g. /dev/hda4) that belongs to a RAID. returns The RAID device (e.g. /dev/md0) the physical partition belongs to or false, if no belonging ...
protected function getBelongingRaidDev($dev) { for ($vDisk = 0; $vDisk < $this->getDiskAmount(); $vDisk++) { foreach ($this->getRaidDevsBuildingDisk($vDisk) as $raidDev) if ($dev == $raidDev) return($this->getDiskDev($vDisk)); } return(false); }
[ "public function fdiskGetEntry(&$dev, &$mountpoint, &$parameter)\n\t{\n\t\t$cur = HELPER_each($this->fstab);\n\n\t\t// Is the array pointer at the end of the array?\n\t\tif ($cur === false)\n\t\t{\n\t\t\treset($this->fstab);\n\t\t\treturn(false);\n\t\t}\n\n\t\t// Write the current array variables to the parameter p...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Grabs uri segment, it not defined returns an array of the request uri segment controller/action/params
public function segments($segment = null) // 0 = first segment { $uri = $_SERVER['REQUEST_URI']; $uri = $this->split_segments($uri, true); //I don't use empty() because I want to check //if were actually returning the whole array if(is_null($segment)) { return $uri; } if(isset($uri[$segment])...
[ "protected function parseSegments()\n {\n return explode(\"/\",$_SERVER[\"REQUEST_URI\"]);\n \n\n }", "protected function getSegments()\n {\n $driver = $this->ci->uri->segment(3);\n $action = $this->ci->uri->segment(4);\n\n return [$driver, $action];\n }", "protec...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets an array of Tbaluno objects which contain a foreign key that references this object. If this collection has already been initialized with an identical Criteria, it returns the collection. Otherwise if this Tbcursoversao has previously been saved, it will retrieve related Tbalunos from storage. If this Tbcursoversa...
public function getTbalunos($criteria = null, PropelPDO $con = null) { if ($criteria === null) { $criteria = new Criteria(TbcursoversaoPeer::DATABASE_NAME); } elseif ($criteria instanceof Criteria) { $criteria = clone $criteria; } if ($this->collTbalunos === null) { if ($this->isNew()) { $t...
[ "public function getTbvagass($criteria = null, PropelPDO $con = null)\n\t{\n\t\tif ($criteria === null) {\n\t\t\t$criteria = new Criteria(TbcursoversaoPeer::DATABASE_NAME);\n\t\t}\n\t\telseif ($criteria instanceof Criteria)\n\t\t{\n\t\t\t$criteria = clone $criteria;\n\t\t}\n\n\t\tif ($this->collTbvagass === null) {...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Updates row cell in worksheet table and handles errors
public static function update_row_cell() { $cell = request::postArray(); $validation_result = self::validate_cell_data($cell); if ($validation_result) { return 'error : validation'; } else { $cell_data = []; $keys = array_keys($cell); $k...
[ "public function updateRow($row);", "abstract protected function _validateRowForUpdate(array $rowData, $rowNumber);", "function updateWorksheetRow($id, $row, $service, $config)\n{\n\t// set target spreadsheet and worksheet\n\t$ssKey = $config['ssid'];\n\t$wsKey = $config['wsid'];\n\n\ttry {\n\t\t// get the row ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Set the value of setecperfilcodigo
public function setSetecperfilcodigo($setecperfilcodigo) { $this->setecperfilcodigo = $setecperfilcodigo; return $this; }
[ "public function setImgPerfil($valor){\n\t\t\t$this->imgPerfil = $valor;\n\t\t}", "public function getSetecperfilnombre()\n {\n return $this->setecperfilnombre;\n }", "public function setSetecperfilnombre($setecperfilnombre)\n {\n $this->setecperfilnombre = $setecperfilnombre;\n\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns Payments Methods. Since they are inside an array, we can use the standard arrayiterator.
public function getIterator() { return new \ArrayIterator($this->payment_methods); }
[ "public static function getPaymentMethods(): array;", "public function getPaymentMethods()\n {\n /** @var oxPayment $oxPayment */\n $oxPayment = oxNew('oxPayment');\n $sql = \"SELECT `OXID` FROM {$oxPayment->getViewName()} WHERE {$oxPayment->getSqlActiveSnippet()}\";\n $method...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Marks debugging forms as have been processed
private function _setHasProcessedDebuggingForms($hasProcessed) { $this->_hasProcessedDebuggingForms = $hasProcessed; }
[ "protected function postProcessForm()\n\t{\n\t}", "public function done(){\n\t\tif($_POST['formname'] == $this->formname){\n\t\t\t$this->handle_posting();\n\t\t}\n\t}", "public function markAsProcessed() {\n\t\t$this->setData('processed', 1);\n\t\t$this->save();\n\t}", "public function setProcessed()\r\n {\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Validate starting and ending position
private function validateStartEnd($start,$end) { $_startEnd = array(); if(preg_match('/[0-9]/', $start)) { $_startEnd[0] = (int)$start; } elseif('#' === $start) { $_startEnd[0] = '#'; } else { throw ...
[ "public function valid() : bool\n {\n return $this->position >= $this->start && $this->position <= $this->end;\n }", "function isValidRange($begin, $end) {\n if ($end < $begin) {\n return FALSE;\n } else if ($end < 0 || $begin < 0) {\n return FALSE;\n } else {\n return T...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns a new ChildCustomerShiptoQuery object.
public static function create($modelAlias = null, Criteria $criteria = null) { if ($criteria instanceof ChildCustomerShiptoQuery) { return $criteria; } $query = new ChildCustomerShiptoQuery(); if (null !== $modelAlias) { $query->setModelAlias($modelAlias); ...
[ "public function all_child_customers()\n\t{\n\t\t$this->db->where('customer_status = 1 AND customer_parent != 0');\n\t\t$this->db->order_by('customer_name');\n\t\t$query = $this->db->get('customer');\n\t\t\n\t\treturn $query;\n\t}", "public function buildCustomerEntity()\n {\n return new Customer(\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
GrantAccess RevoGrantke access for this user to a particular area and possibly subarea. If the area is not specified, nothing is granted. If an area is specified but no subarea is specified, the whole section of permissions is granted. If an area and subarea are specified, that specific permission is granted. Example G...
function GrantAccess($area=null, $subarea=null) { return; if (is_null($area)) { return false; } $permission_types = $this->getPermissionTypes(); $area = strtolower($area); // if it's not a base permission, check it's an addon permission. if (!in_array($area, array_keys($permission_types)))...
[ "function HasAccess($area = null, $subarea = null, $id = 0)\n\t{\n\t $id = (int) $id;\n\t\t\n\t\tif (!gz0pen($area, $subarea, $id, $this->userid)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (is_null($area)) {\n\t\t\treturn false;\n\t\t}\n\n\t\t/**\n\t\t* If the area is the xmlapi, regardless of whether the user is ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Testing references to other documents
public function testReferences() { $contents = file_get_contents($this->targetFile('introduction.html')); $this->assertContains('<a href="index.html#toc">Index, paragraph toc</a>', $contents); $this->assertContains('<a href="index.html">Index</a>', $contents); $this->assertContains(...
[ "public function testSimilarDocuments() {\n\t\t$this->checkSimDocs();\n\t}", "public function testMergeDocumentDocx()\n {\n }", "public function testMultipleDocumentsOfTheSameType()\n {\n $document1 = Shopware_Components_Document::initDocument(\n 15,\n 1,\n [\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Return the value of an attribute from the result of an LDAP search, converted to the current charset.
function get_ldap_attribute($search_result, $attribute) { if (isset($search_result[0][$attribute][0])) { return iconv("UTF-8", $GLOBALS['charset'], $search_result[0][$attribute][0]); } else { return ''; } }
[ "function get_ldap_attribute($search_result, $attribute) {\n if (isset($search_result[0][$attribute][0])) {\n return iconv('UTF-8', $GLOBALS['charset'], $search_result[0][$attribute][0]);\n } else {\n return '';\n }\n}", "public function getLdapAttributeSingleValue($ldapResult, $attribute)\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Devolvemos las noticias destacadas
public function get_noticias_destacadas() { return $this->noticiasRepo->get_noticias_destacadas(); }
[ "function notifications_notifications_destinataires($flux) {\n\tstatic $sent = array();\n\t$quoi = $flux['args']['quoi'];\n\t$options = $flux['args']['options'];\n\n\t// proposition d'article prevenir les admins restreints\n\tif ($quoi=='instituerarticle' AND $GLOBALS['notifications']['prevenir_admins_restreints']\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Translates the response code into a more meaningful description. Response code descriptions are taken directly from the Payfort documentation.
function getResponseCodeDescription($responseCode) { switch ($responseCode) { case "0" : $result = "Invalid or incomplete"; break; case "1" : $result = "Cancelled by customer"; break; case "2" : $result = "Authorisation declined"; ...
[ "public static function getResponseCodeDescription($code)\n {\n \t$responseCode\t= DefaultConstant::getResponseCode();\n \t\n \treturn $responseCode[$code];\n }", "public function getHTTPCodeDescription() {\n\t\t$code = $this->HTTPCode;\n\t\tif(empty($code)) {\n\t\t\t// Assume that $code = 0 means ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Remove arquivo de Lock.
public function removerArquivoLock() { unlink($this->sCaminhoArquivoLock); }
[ "public function removeLockFile() {\n\t\tunlink($this->__lockFile);\n\t}", "private function deleteLockFile()\n {\n $this->stdout(\"* Delete the install lock file.\\n\", Console::FG_GREEN);\n $this->getInstaller()->unLock();\n }", "function clearFileLock()\n{\n ftruncate($GLOBALS['lock_fi...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Lists all WallPost entities on user wall.
public function indexAction() { $securityContext = $this->container->get('security.context'); if($securityContext->isGranted('ROLE_USER')){ $user = $securityContext->getToken()->getUser(); $em = $this->getDoctrine()->getManager(); $yourPosts = array(); ...
[ "public function display_wall_posts()\n {\n \n }", "public function getWalls(){\n\t\treturn $this->get(\"/wall\");\n\t}", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $currentUser = $this->get('security.token_storage')->getToken()->getUser();\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Build a Subscriber Entity Object and filled it with data
public function buildSubscriberObjFillData($subscriber_info_data, $aggregation=FALSE){ return $this->entityBuilder->buildEntity($subscriber_info_data, $aggregation); }
[ "public function setSubscriberData(Mage_Newsletter_Model_Subscriber $subscriber)\n {\n $this->object = $subscriber;\n $this->storeId = $this->object->getStoreId();\n $this->websiteId = Mage::app()->getStore($this->storeId)->getWebsite()->getId();\n foreach ($this->getMappingHash() as ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
The default variables within the Media: ThePlatform namespace.
function media_theplatform_mpx_variable_default($name = NULL) { static $defaults; if (!isset($defaults)) { $defaults = array( 'account_pid' => NULL, 'account_id' => NULL, 'cron_players' => 1, 'cron_videos' => 1, 'date_idletimeout' => NULL, 'default_player_fid' => NULL, ...
[ "public function init_base_variables() {\n\t\t$this->plugin_url = $this->plugin_info->get_plugin_url();\n\n\t\t$this->plugin_path = $this->plugin_info->get_plugin_dir();\n\t\t$this->template_path = $this->plugin_info->get_text_domain();\n\n\t\t$this->plugin_namespace = $this->plugin_info->get_text_domain();\n\t\t...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
function to call detail view in suggested jobs page
public function viewJobPost($id){ $isAdmin = $this->isAdminLogin(); $pageName = "ViewJob"; $result = SuggestedJobs::loadById($id); $job = $this->getAllCols($result); include_once SYSTEM_PATH.'/view/header.tpl'; include_once SYSTEM_PATH.'/view/viewJob.tpl'; include_once S...
[ "public function jobsdetails()\n\t{\n\t\t$this->load->view('header');\n\t\t$this->load->view('jobsdetails');\n\t\t$this->load->view('footer');\n\t}", "public function detailsAction()\n {\n $request = $this->getRequest();\n if ($request->getParam('jid') === null) {\n // show error messa...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Override defaultActions() to remove summary actions.
protected function defaultActions($which = NULL) { if ($which) { if (in_array($which, ['ignore', 'not found', 'empty', 'default'])) { return parent::defaultActions($which); } return; } $actions = parent::defaultActions(); unset($actions['summary asc']); unset($actions['summ...
[ "protected function defaultActions($which = NULL) {\n if ($which) {\n if (in_array($which, ['ignore', 'not found', 'empty', 'default'])) {\n return parent::defaultActions($which);\n }\n return;\n }\n $actions = parent::defaultActions();\n unset($actions['summary asc']);\n unset(...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Operation essExpenseUploadAttachment Upload Attachment to Expense Request
public function essExpenseUploadAttachment($expense_request_id, $file_name, $employee_id, string $contentType = self::contentTypes['essExpenseUploadAttachment'][0]) { list($response) = $this->essExpenseUploadAttachmentWithHttpInfo($expense_request_id, $file_name, $employee_id, $contentType); return ...
[ "public function upload_attachment(){\n\n\t\t$file_name_with_full_path = '/home/neosoft/Desktop/VS doc/download.jpeg';\n\n\t\t$request_url = 'http://localhost:3000/rest/api/content/7406823/child/attachment';\n\t\t\n\t\tif (function_exists('curl_file_create')) { \n\t\t $cFile = curl_file_create($file_name_with_full...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Retrieve an array of form details, containing "id" & "name" & "shortcode"
public static function get_all_form_details() { global $wpdb; $table_name = $wpdb->base_prefix . "posts"; $query = "SELECT id, post_title FROM $table_name WHERE post_type='usp_form'"; $results = $wpdb->get_results($query, ARRAY_A); $formDetails = []; foreach ($results as $result) { $formDetails[] = [ ...
[ "public function get_form_field_details($formname) {\n\n $Fields = array(); // default to a blank array in case something goes wrong\n\n $col_list = $this->get_column_list('form_fields');\n\n //\n // Get all of the fields for the form\n //\n\n $FieldsQ = $this->database-...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
check whether a user is allowed to access a resource or not
public function isUserAllowedToAccessResource($resource){ return Model::isUserAllowedToAccessResource($resource); }
[ "public function doesHaveResourceAccess(){\n \t\t\n \t\t$resourceRequest = jan_generateResourceRequest();\n\n\t\t$this->generateAccessibleResources();\n \t\t\n \t\t//Find the resource\n \t\tif(isset($this->resources[$resourceRequest->fullResource]) === false){\n \t\t\t$this->error = 'USER '.__LINE__.': User is not ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Test case for getContactsForUser .
public function testGetContactsForUser() { }
[ "function getUserContacts()\r\n\t{\r\n\t}", "function getUserContacts()\r\n\t{\r\n\t\tHybrid_Logger::info( \"Enter [{$this->providerId}]::getUserContacts()\" );\r\n\t}", "function invit0r_get_contacts($from, $to)\r\n{\r\n\tglobal $invit0r_user;\r\n\r\n\treturn $invit0r_user -> getContacts($from, $to);\r\n}", ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the security state
public function getSecureState() { return $this->_secureState; }
[ "public function getSecurityStatus()\n {\n return $this->security_status;\n }", "public function getState()\n {\n return $this->authorizationCode->getState();\n }", "public function getSecurity() {\n return $this->security;\n }", "public function getUserState(){\n re...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
.accountgroup.v1.LookupRequest.Presence foursquare = 2;
public function setFoursquare($var) { GPBUtil::checkEnum($var, \Accountgroup\V1\LookupRequest_Presence::class); $this->foursquare = $var; }
[ "public function getPresence(string $user): UserResponse;", "public function setFacebook($var)\n {\n GPBUtil::checkEnum($var, \\Accountgroup\\V1\\LookupRequest_Presence::class);\n $this->facebook = $var;\n }", "function fn_settings_variants_addons_rus_online_cash_register_statuses_paid()\n{\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Attempt to determine the vocabulary for which the field is configured.
protected function getVocab() { if (!empty($this->fieldInfo['settings']['allowed_values'][0]['vocabulary'])) { return $this->fieldInfo['settings']['allowed_values'][0]['vocabulary']; } }
[ "public function vocabulary() {\n // Legacy handling for old feeds importers.\n if (is_numeric($this->config['vocabulary'])) {\n $vocabularies = taxonomy_get_vocabularies();\n return isset($vocabularies[$this->config['vocabulary']]) ? $vocabularies[$this->config['vocabulary']] : NULL;\n }\n el...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get a job data item, or the specified default if it is not yet set
public function jobdata_get($key, $default = null) { if (empty($this->jobdata)) { $this->jobdata = empty($this->nonce) ? array() : get_site_option('updraft_jobdata_'.$this->nonce, array()); if (!is_array($this->jobdata)) return $default; } return isset($this->jobdata[$key]) ? $this->jobdata[$key] : $default...
[ "public function getJobDefaultValue() {\n //initialize dummy value.. no content header.pure html \n $sql = null;\n $jobId = null;\n if ($this->getVendor() == self::MYSQL) {\n $sql = \" \n SELECT `jobId`\n FROM \t`job`\n WHERE `isActi...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Appends value to '_hire_hero' list
public function appendHireHero($value) { return $this->append(self::_HIRE_HERO, $value); }
[ "public function appendNewHeroes(Down_Hero $value)\n {\n return $this->append(self::_NEW_HEROES, $value);\n }", "public function appendHeroes(Down_Hero $value)\n {\n return $this->append(self::_HEROES, $value);\n }", "public function appendHero(\\PB_Hero $value)\n {\n return ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
test grabbing a Trail by TrailCondition that does not exist
public function testGetInvalidTrailByTrailCondition() { //grab a TrailCondition that does not exist $trail = Trail::getTrailByTrailCondition($this->getPDO(), "<script></script>"); $this->assertNull($trail); }
[ "public\n\t\tfunction testGetInvalidTrailByTrailSubmissionType() {\n\t\t\t//grab a TrailSubmissionType that does not exist\n\t\t\t$trail = Trail::getTrailByTrailSubmissionType($this->getPDO(), \"null\");\n\t\t\t$this->assertNull($trail);\n\t\t}", "public function testGetInvalidAllTrails() {\n\t\t//grab a TrailAcc...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Loads the chart data according to the supplied criteria or all the data if null is passed.
public function load(IChartCriteria $criteria = null) : IChartDataTable;
[ "public function loadData()\n\t{\n\t\t$sql = $this->ChartSql;\n\t\t$cnn = Conn($this->Table->Dbid);\n\t\t$rscht = $cnn->Execute($sql);\n\t\twhile ($rscht && !$rscht->EOF) {\n\t\t\t$temp = [];\n\t\t\tfor ($i = 0; $i < $rscht->FieldCount(); $i++)\n\t\t\t\t$temp[$i] = $rscht->fields[$i];\n\t\t\t$this->Data[] = $temp;\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets the deserialized response object (during deserialization)
public function setResponseObject($obj) { $this->responseObject = $obj; }
[ "public function setResponseObject($obj)\n\t{\n\t\t$this->responseObject = $obj;\n\t}", "public function setResponseObject($obj)\n {\n $this->responseObject = $obj;\n }", "protected function setResponse($obj_response)\n {\n $this->obj_response = $obj_response;\n }", "public function ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Displays a form to create a new cheque entity.
public function newAction() { $entity = new cheque(); $form = $this->createCreateForm($entity); return $this->render('contabilidadBundle:cheque:new.html.twig', array( 'entity' => $entity, 'form' => $form->createView(), )); }
[ "public function actionCreate()\n\t{\n\t\t$model = new CHEF_MODEL();\n\n\t\tif ($model->load(Yii::$app->request->post()) && $model->save()) {\n\t\t\treturn $this->redirect(['view', 'id' => $model->CHEF_ID]);\n\t\t}\n\n\t\treturn $this->render('create', [\n\t\t\t'model' => $model,\n\t\t]);\n\t}", "public function ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Test the convert method with abbreviations.
public function testConvertWithAbbreviations() { $unit = Converter::from(0.10, 'm')->to('cm'); $this->assertInstanceOf(Centimeter::class, $unit); $this->assertEquals(10, $unit->value()); }
[ "public function testToWithAbbreviations()\n {\n $value = (new Centigram(1))->to('mg');\n\n $this->assertInstanceOf(Milligram::class, $value);\n $this->assertEquals(10, $value->value());\n $this->assertEquals('10 mg', (string) $value);\n }", "public function testIsAbbreviations(s...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Compile the "limit" portions of the query.
protected function compileLimit(Builder $query, $limit) { return 'limit '.(int) $limit; }
[ "private function builtLimit(){\n\n\t\tif ( $this->_limit ){\n\t\t\t$sql = \"LIMIT {$this->_limit} \";\n\t\t\t$this->_sql .= $sql;\n\t\t}\n\t}", "protected function _compileLimitSQLStatement()\n\t{\n\t\tif ( $this->_limit AND $this->_is_grouped === FALSE )\n\t\t{\n\t\t\tif ( $this->_offset )\n\t\t\t{\n\t\t\t\tret...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get an address by phone number.
public function getAddressByPhone($phone);
[ "public function FlexiAddressPhone(){\n $address = $this->FlexiAddress();\n return ($address->exists()) ? $address->PhoneNumbers()->first() : null;\n }", "public function getPhoneByPhone($phone)\n {\n return $this->call('getPhoneFromAddressBook', [\n 'phone' => $phone\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Update the specified Bpnt in storage.
public function update($id, UpdateBpntRequest $request) { $bpnt = $this->bpntRepository->find($id); if (empty($bpnt)) { Flash::error('Bpnt not found'); return redirect(route('bpnts.index')); } $input = $request->except('foto_rumah'); if($req...
[ "public function updated(Bid $bid)\n {\n //\n }", "public function testUpdateBrokerageBankLinkUsingPut()\n {\n }", "function updatePoint(PointEntity $newPoint)\r\n {\r\n }", "public function updated(Point $point)\n {\n //\n }", "public function testUpdateAchBankLinkUsin...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns an OperationalDaysInterface that describe the OperationalDays for the implementing entity between the dates provided.
public function getOperationalDays(DateTimeInterface $obj_until, DateTimeInterface $obj_since = null);
[ "public function listDays()\n {\n $results = $this->holidayDayRepository->listDays();\n\n return $this->transform($results, $this->holidayHourTransformer);\n }", "public function createIntervalDay(): DateContainerInterface\n {\n return $this->createFromFormat('Y-m-d');\n }", "pu...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Used to generate links for old posts
public function generate_past_post_links() { // get all the posts, as wordpress does not currently support the use is null on the meta query $options = get_field('fpt_bitly_show_on', 'options'); $args = array( 'post_type' => $options, 'meta_key' => 'fpt_bitlylink',...
[ "function recent_post_links(){\r\n\t\r\n\tglobal $gcdb,$db_query;\r\n\t$cuurent_post_date = the_post_date(false);\r\n\t\r\n\tif(!is_x()){\r\n \tif(isset($db_query->query_vars['tagid'])) {\r\n \t\t$tag_id = $gcdb->escape($db_query->query_vars['tagid']);\r\n \t\t\r\n \t\t$request_prv = \"SELECT a.ID, a.po...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Whether the current host is the SSO host.
public function is_sso_host() { return $this->sso_host === $this->host; }
[ "public function isFromServer()\n {\n $username = $this->getHostmask()->getUsername();\n return empty($username);\n }", "public function isHost()\n {\n return $this->hasRole('host');\n }", "public function isHostBackend()\n {\n $backendUrl = $this->configInterface->get...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get the type evt.
public function getTypeEvt() { return $this->typeEvt; }
[ "public function getType()\n {\n return $this->event_type;\n }", "public function getEventType()\n\t\t{\n\t\t\treturn $this->event_type;\n\t\t}", "public function getEventType()\n {\n return $this->event_type;\n }", "public function getEventType()\n {\n return self::TYPE;\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
add or remove products to tmp session
function __pringoo_add_to_cart_session($pid , $flag = true) { if(session_status() == PHP_SESSION_NONE) {session_start();} $stoken = wp_get_session_token(); if(!isset($_SESSION[$stoken]["products"])) { $_SESSION[$stoken]["products"] = []; } $shop_term_id = pringoo_get_shop_by_producs($pid); if($shop_term...
[ "function lb_add_product_data_to_session() {\n\tif ( ! isset( $_GET['add_to_cart'] ) ) {\n\t\treturn;\n\t}\n\n\t$product_id = esc_html( $_GET['add_to_cart'] );\n\t$flag = false;\n\n\tif ( isset( $_SESSION['cart'] ) ) {\n\t\tforeach ( $_SESSION['cart'] as $key => $product ) {\n\t\t\tif ( $product_id === $produ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get image resample quality
public function getImageResampleQuality() { return $this->imageResampleQuality; }
[ "private function getConfigImageQuality()\n {\n return Hash::get($this->settings, 'image.quality', 100);\n }", "function get_resize_quality(){\n\t\t$quality = get_option('rbu_resize_quality');\n\t\t\n\t\t//return quality or default setting \n\t\tif ($quality > 0 && $quality < 101){\n\t\t\treturn $qua...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Processes and returns encoded image as HEIC string
protected function processHeic() { throw new NotSupportedException( "HEIC format is not supported by Gd Driver." ); }
[ "protected function processHeic()\n {\n if ( ! \\Imagick::queryFormats('HEIC')) {\n throw new NotSupportedException(\n \"HEIC format is not supported by Imagick installation.\"\n );\n }\n\n $format = 'heic';\n $compression = \\Imagick::COMPRESSION_...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ Add Vendor manager
function __addVmanager($vmgr) { $this->loadModel('VendorManagers'); $manager = $this->VendorManagers->newEntity($vmgr); if($this->VendorManagers->save($manager)) { return true; } return false; }
[ "private function addVendors() {\n\t\n\t\t$database = new Database();\n\n\t\tforeach($this->aryData as $record) {\n\t\t\t\t\t\n\t\t\t$database->query(\n\t\t\t\t'INSERT IGNORE INTO vendors (`code`) VALUES (:code)'\n\t\t\t);\n\t\t\t\t\n\t\t\t$database->bind(':code', $record{'Vendor'});\n\n\t\t\t$database->execute();...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
get the tool tip text from the tab
function getToolTipText() { return $this->_tooltiptext; }
[ "function getTabTooltipText($a_tab_id)\n\t{\n\t\tglobal $lng;\n\t\t\n\t\tinclude_once(\"./Services/Help/classes/class.ilHelp.php\");\n\t\tif ($this->screen_id_component != \"\")\n\t\t{\n\t\t\treturn ilHelp::getTooltipPresentationText($this->screen_id_component.\"_\".$a_tab_id);\n\t\t\t//return $lng->txt(\"help_tt_\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets a doccomment for the current node.
public function setDocComment($docComment) { $this->docComment = $docComment; }
[ "public function setDocComment(Comment\\Doc $docComment);", "private function _setDocComment( $docComment )\n {\n if ( trim( $docComment ) === '' )\n {\n $this->_docComment = false;\n }\n else\n {\n $this->_docComment = $docComment;\n }\n }", ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Test that only the servers a logged in user is assigned to are returned by the API endpoint. Obviously there are cases such as being an administrator or being a subuser, but for this test we just want to test a basic scenario and pretend subusers do not exist at all.
public function testOnlyLoggedInUsersServersAreReturned() { /** @var \Pterodactyl\Models\User[] $users */ $users = factory(User::class)->times(3)->create(); /** @var \Pterodactyl\Models\Server[] $servers */ $servers = [ $this->createServerModel(['user_id' => $users[0]->i...
[ "function test_an_authenticated_user_can_see_only_own_servers()\n {\n $user = $this->signInAPI();\n $servers = $this->createServer([\n 'user_id' => $user->id,\n ], 2);\n\n $serversForeign = $this->createServer([], 2);\n\n $response = $this->getJson(api_route('servers...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
add a path for modelAddon loading
static public function addModelAddonPath($path){ self::addPath($path,'(?:_m|M)odelAddon(?:Interface)?'); }
[ "function getAddonPath()\n\t{\n\t\t//assert(isset($this->addonData['addon_key']));\n\t\treturn PEAR_ROOT_PATH . PEAR_SYSTEM_SOURCES . PEAR_ADDONS_DIRECTORY . $this->addonData['addon_key'] . '/';\n\t}", "public function initPaths()\n {\n $this->setMigrationsPath($this->getAddonUpgradePath() . '/migration...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
get resource class name depending on the provided resource returns NULL if no resource can be created with the given resource
public static function getResourceClass($resource) { $type = gettype($resource); // ARRAY if($type === "array") { return __NAMESPACE__ . '\ArrayResource'; } // STRING / FILE PATH types if($type === "string") { // FILES if(is_fil...
[ "public function getResourceClass(): string\n {\n if (!$this->_resourceClass) {\n $default = Resource::class;\n $self = static::class;\n $parts = explode('\\\\', $self);\n\n if ($self === self::class || count($parts) < 3) {\n return $this->_resour...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Lists all Profit models.
public function actionIndex() { $searchModel = new ProfitSearch(); $dataProvider = $searchModel->search(Yii::$app->request->queryParams); return $this->render('index', [ 'searchModel' => $searchModel, 'dataProvider' => $dataProvider, ]); }
[ "static function getAllProduit() {\n $rep = Model::$pdo->query('SELECT *\n\t\t\t\t\t\t\t\tFROM PRODUIT');\n $rep->setFetchMode(PDO::FETCH_CLASS, 'ModelProduit');\n $ans = $rep->fetchAll();\n return $ans;\n }", "public function produtos()\n {\n return Produto::All();\n }...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the annotation objects associated to $annotationName in an array.
public function getAnnotations($annotationName);
[ "public function findAnnotations($annotationName) {\n $output = [];\n if (array_key_exists($annotationName, $this->data['class'])) {\n $output[] = $this->data['class'][$annotationName];\n }\n foreach ($this->data['properties'] as $property) {\n if (array_key_exists(...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Filter the query on the montacargas_marca column Example usage: $query>filterByMontacargasMarca('fooValue'); // WHERE montacargas_marca = 'fooValue' $query>filterByMontacargasMarca('%fooValue%'); // WHERE montacargas_marca LIKE '%fooValue%'
public function filterByMontacargasMarca($montacargasMarca = null, $comparison = null) { if (null === $comparison) { if (is_array($montacargasMarca)) { $comparison = Criteria::IN; } elseif (preg_match('/[\%\*]/', $montacargasMarca)) { $montacargasMarca...
[ "public function setMontacargasMarca($v)\n {\n if ($v !== null) {\n $v = (string) $v;\n }\n\n if ($this->montacargas_marca !== $v) {\n $this->montacargas_marca = $v;\n $this->modifiedColumns[] = MontacargasPeer::MONTACARGAS_MARCA;\n }\n\n\n retu...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Return acl resource name if defined
public function getAclResource() { if (!empty($this->definition['acl_resource'])) { return $this->definition['acl_resource']; } return false; }
[ "protected function getAclTemplate() : string\n {\n return static::TEMPLATE_ACL_SOURCE;\n }", "public function testAclResourceName()\n {\n $this->specify(\n 'Acl\\Resource by name does not exist in the acl',\n function () {\n\n $acl = new PhTAclM...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Function which creates tagcloud with tags differing in size
public static function tagcloud($size) { // get random tags with high tfidf importance $limit = $size; $tagset = DB::select() ->from("tags") ->where(DB::expr("length(content)"), ">", 4) ->where("occurrences", ">", 2) ->where("importance", ">", 0.141430140) ->order_by(DB::expr("RAND()")) ->limit($limit...
[ "function wct_generate_tag_cloud( $number = 10, $args = array() ) {\n\t$r = array( 'number' => $number, 'orderby' => 'count', 'order' => 'DESC' );\n\n\t$tags = get_terms( wct_get_tag(), apply_filters( 'wct_generate_tag_cloud_args', $r ) );\n\n\tif ( empty( $tags ) ) {\n\t\treturn;\n\t}\n\n\tforeach ( $tags as $key ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Method to get a project object by name.
public function getProject($name) { try { // Attempt to get the project data object by the name or "unix name" in GForge speak. $project = $this->client->getProjectByUnixName($this->sessionhash, $name); return $project; } catch (SoapFault $e) { throw new RuntimeException('Unable to get project '...
[ "public function project($name)\n\t{\n\t\tforeach ($this->projects() as $project)\n\t\t{\n\t\t\tif ($project['name'] == $name)\n\t\t\t{\n\t\t\t\treturn $project;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "static function getProjectByName( $projectname ) {\n\t\t$project = new OpenStackNovaProject( $projectname );\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Submit handler for the unpublish changeset form.
function cps_changeset_unpublish_changeset_form_submit($form, &$form_state) { // We have to tell batch where to include this file. $batch = array( 'operations' => array( array('cps_changeset_publish_batch_lock', array()), array('cps_changeset_unpublish_batch_variables', array($form_state['entity'], ...
[ "function unpublish()\n {\n $detail = JRequest::get('POST');\n $model = $this->getModel('category');\n $model->changeStatus($detail);\n $this->setRedirect('index.php?option=' . JRequest::getVar('option') . '&layout=category');\n }", "function unpublish()\r\n\t{\r\n\t\t$cid \t= JR...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
function to link tags to a specific journal entry
function link_tags($entry_id, $tags) { include('connection.php'); // first delete existing links try { $sql = 'DELETE FROM entries_tags WHERE entry_id = ?'; $results = $db->prepare($sql); $results->bindValue(1, $entry_id, PDO::PARAM_INT); $results->execute(); } catch(Exception $ex) { echo ...
[ "public function linkTag($tag)\n\t{\n\t\tif (empty($tag))\n\t\t\treturn false;\n\n\t\t$tagInstance = Tag::findByName($tag);\n\t\tif (is_null($tagInstance))\n\t\t\t$tagInstance = Tag::createNew($tag);\n\n\t\t$connection = \\Yii::$app->db;\n\t\t$connection->createCommand()->insert('note_tag', array(\n\t\t\t'note_id' ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
setOedhpricovrd() Set the value of [oedhpickflag] column.
public function setOedhpickflag($v) { if ($v !== null) { $v = (string) $v; } if ($this->oedhpickflag !== $v) { $this->oedhpickflag = $v; $this->modifiedColumns[SalesHistoryDetailTableMap::COL_OEDHPICKFLAG] = true; } return $this; }
[ "public function setOedtpickflag($v)\n {\n if ($v !== null) {\n $v = (string) $v;\n }\n\n if ($this->oedtpickflag !== $v) {\n $this->oedtpickflag = $v;\n $this->modifiedColumns[SalesOrderDetailTableMap::COL_OEDTPICKFLAG] = true;\n }\n\n return $...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
$driveService = new Google_Service_Drive($client); $parentFolderId = getApplicationFolder($driveService); printf($parentFolderId); createApplicantFolder($driveService, $parentFolderId, "Mihir");
function createApplicantFolder($driveService, $parentFolderId, $studentName) { //create applicant folder on google drive $folderMetadata = new Google_Service_Drive_DriveFile(array( 'name' => $studentName, 'mimeType' => 'application/vnd.google-apps.folder', 'parents' => array($parentFolde...
[ "function send_google_drive($id,$fileno,$filename){\n\t\t\tglobal $wpdb;\n\t\t\trequire(ABSPATH.'/wp-content/themes/enemat/googledrives/vendor/autoload.php');\n\t\t\t$client = getClient();\n\t\t\t$service = new Google_Service_Drive($client);\n\t\t\t$results = $service->files->listFiles();\n\t\t\t$parentfolders = ge...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Display all of the user's trades.
public function index() { $trades = auth()->user()->trades; return view('trades.index')->with('trades', $trades); }
[ "public function getAllUserTrains() {\n $stmt = $this->conn->prepare(\"SELECT * FROM trains\");\n $stmt->execute();\n $trains = $stmt->get_result();\n $stmt->close();\n return $trains;\n }", "private function get_trades() {\n $trade_dao = new TradeDAO();\n $this...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }