query
stringlengths 10
8.11k
| document
stringlengths 17
398k
| negatives
sequencelengths 19
20
| metadata
dict |
---|---|---|---|
Gets the public 'admin.time_slot_open' autowired service. | protected function getAdmin_TimeSlotOpenService()
{
include_once \dirname(__DIR__, 4).'\\vendor\\sonata-project\\admin-bundle\\src\\Admin\\AccessRegistryInterface.php';
include_once \dirname(__DIR__, 4).'\\vendor\\sonata-project\\admin-bundle\\src\\Admin\\FieldDescriptionRegistryInterface.php';
include_once \dirname(__DIR__, 4).'\\vendor\\sonata-project\\admin-bundle\\src\\Admin\\LifecycleHookProviderInterface.php';
include_once \dirname(__DIR__, 4).'\\vendor\\sonata-project\\admin-bundle\\src\\Admin\\MenuBuilderInterface.php';
include_once \dirname(__DIR__, 4).'\\vendor\\sonata-project\\admin-bundle\\src\\Admin\\ParentAdminInterface.php';
include_once \dirname(__DIR__, 4).'\\vendor\\sonata-project\\admin-bundle\\src\\Admin\\UrlGeneratorInterface.php';
include_once \dirname(__DIR__, 4).'\\vendor\\sonata-project\\admin-bundle\\src\\Admin\\AdminInterface.php';
include_once \dirname(__DIR__, 4).'\\vendor\\symfony\\security-acl\\Model\\DomainObjectInterface.php';
include_once \dirname(__DIR__, 4).'\\vendor\\sonata-project\\admin-bundle\\src\\Admin\\AdminTreeInterface.php';
include_once \dirname(__DIR__, 4).'\\vendor\\sonata-project\\admin-bundle\\src\\Admin\\AbstractAdmin.php';
include_once \dirname(__DIR__, 4).'\\src\\Admin\\TimeSlotOpenAdmin.php';
include_once \dirname(__DIR__, 4).'\\vendor\\sonata-project\\admin-bundle\\src\\Security\\Handler\\SecurityHandlerInterface.php';
include_once \dirname(__DIR__, 4).'\\vendor\\sonata-project\\admin-bundle\\src\\Security\\Handler\\NoopSecurityHandler.php';
include_once \dirname(__DIR__, 4).'\\vendor\\sonata-project\\admin-bundle\\src\\Translator\\LabelTranslatorStrategyInterface.php';
include_once \dirname(__DIR__, 4).'\\vendor\\sonata-project\\admin-bundle\\src\\Translator\\NativeLabelTranslatorStrategy.php';
$instance = new \App\Admin\TimeSlotOpenAdmin('admin.time_slot_open', 'App\\Entity\\TimeSlotOpen', 'Sonata\\AdminBundle\\Controller\\CRUDController');
$instance->setManagerType('orm');
$instance->setModelManager(($this->services['sonata.admin.manager.orm'] ?? $this->getSonata_Admin_Manager_OrmService()));
$instance->setFormContractor(($this->privates['sonata.admin.builder.orm_form'] ?? $this->getSonata_Admin_Builder_OrmFormService()));
$instance->setShowBuilder(($this->privates['sonata.admin.builder.orm_show'] ?? $this->getSonata_Admin_Builder_OrmShowService()));
$instance->setListBuilder(($this->privates['sonata.admin.builder.orm_list'] ?? $this->getSonata_Admin_Builder_OrmListService()));
$instance->setDatagridBuilder(($this->privates['sonata.admin.builder.orm_datagrid'] ?? $this->getSonata_Admin_Builder_OrmDatagridService()));
$instance->setTranslator(($this->services['translator'] ?? $this->getTranslatorService()), false);
$instance->setConfigurationPool(($this->services['sonata.admin.pool'] ?? $this->getSonata_Admin_PoolService()));
$instance->setRouteGenerator(($this->services['sonata.admin.route.default_generator'] ?? $this->getSonata_Admin_Route_DefaultGeneratorService()));
$instance->setValidator(($this->services['validator'] ?? $this->getValidatorService()));
$instance->setSecurityHandler(($this->privates['sonata.admin.security.handler.noop'] ?? ($this->privates['sonata.admin.security.handler.noop'] = new \Sonata\AdminBundle\Security\Handler\NoopSecurityHandler())));
$instance->setMenuFactory(($this->services['knp_menu.factory'] ?? $this->getKnpMenu_FactoryService()));
$instance->setRouteBuilder(($this->services['sonata.admin.route.path_info'] ?? $this->getSonata_Admin_Route_PathInfoService()));
$instance->setLabelTranslatorStrategy(($this->services['sonata.admin.label.strategy.native'] ?? ($this->services['sonata.admin.label.strategy.native'] = new \Sonata\AdminBundle\Translator\NativeLabelTranslatorStrategy())));
$instance->setPagerType('default');
$instance->setLabel('Créneau');
$instance->showMosaicButton(true);
$instance->setTemplateRegistry(($this->services['admin.time_slot_open.template_registry'] ?? $this->getAdmin_TimeSlotOpen_TemplateRegistryService()));
$instance->setSecurityInformation([]);
$instance->initialize();
$instance->addExtension(($this->services['sonata.admin.event.extension'] ?? $this->getSonata_Admin_Event_ExtensionService()));
$instance->setFormTheme([0 => '@SonataDoctrineORMAdmin/Form/form_admin_fields.html.twig']);
$instance->setFilterTheme([0 => '@SonataDoctrineORMAdmin/Form/filter_admin_fields.html.twig']);
return $instance;
} | [
"private function getOpeningHoursFactory()\n {\n return $this->openingHoursFactory;\n }",
"public function getCurrentOpenTimeRange()\n {\n /**\n * Get current open time range as TimeRange instance or false if closed.\n *\n * @return \\Spatie\\OpeningHours\\TimeRange|bool\n */\n return function () {\n /** @var Carbon $date */\n $date = isset($this) ? $this : static::now();\n\n return $date->getOpeningHours()->currentOpenRange($date);\n };\n }",
"public function getCurrentOpenTimeRangeStart()\n {\n /**\n * Get current open time range start as Carbon instance or false if closed.\n * /!\\ Important: it returns true if the current day is an holiday unless you set a closure handler for it in\n * the exceptions setting.\n *\n * @return \\Carbon\\Carbon|\\Carbon\\CarbonImmutable|\\Carbon\\CarbonInterface|bool\n */\n return $this->getCalleeAsMethod(static::CURRENT_OPEN_RANGE_START_METHOD);\n }",
"function getOpenHour()\n {\n return (int) $this->_iOpenHour;\n }",
"private function getSpecialOpeningHoursFactory()\n {\n return $this->specialOpeningHoursFactory;\n }",
"public function getOpeningHours()\n {\n return $this->openingHours;\n }",
"public function getOpenSlotCount(){\n return count($this->openSlots);\n }",
"public function getOpeningHours();",
"public function getOpeningHoursToday()\n {\n return OpeningHour::get_today();\n }",
"public function getMinOpenHours() {\n return $this->minOpenHours;\n }",
"protected function getTemplating_Helper_SlotsService()\n {\n return $this->services['templating.helper.slots'] = new \\Symfony\\Component\\Templating\\Helper\\SlotsHelper();\n }",
"public function get_open_slots($event_id);",
"protected function getShippingTimeEstimatorInterfaceService()\n {\n return $this->services['Rialto\\\\Shipping\\\\Method\\\\ShippingTimeEstimator\\\\ShippingTimeEstimatorInterface'] = new \\Rialto\\Shipping\\Method\\ShippingTimeEstimator\\ShippingTimeEstimator();\n }",
"protected function getTimeTrackerService()\n {\n return $this->services['TYPO3\\\\CMS\\\\Core\\\\TimeTracker\\\\TimeTracker'] = \\TYPO3\\CMS\\Core\\ServiceProvider::getTimeTracker($this);\n }",
"public function getOpeningTime();",
"public function getOpeningTime()\n {\n return $this->openingTime;\n }",
"public function getTimesheetService() {\n\n if (is_null($this->timesheetService)) {\n $this->timesheetService = new TimesheetService();\n }\n\n\n\n return $this->timesheetService;\n }",
"public function get_open_until()\n {\n return $this->open_until;\n }",
"public function getOpeningHoursSpecification()\n {\n return $this->openingHoursSpecification;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Debug::log('tank_check_unlocks BEGIN for $parent_id = '.$parent_id.', $unlock = '.$unlock.', $nation = '.$nation.'.', LEVEL_NORMAL); | private function tank_check_unlocks($parent_id, $unlock, $nation)
{
global $mysql;
if (isset($unlock->vehicle))
{
$vars = $unlock->children();
foreach($vars as $key=>$data)
{
if ($key == 'vehicle')
{
if (!is_array($data))
$data = array($data);
foreach($data as $tank)
{
$node = $nation . '-' . $tank;
$cost = @$tank->cost;
// Todo: Migrate to stored procedure
$tank_id = $mysql->query("SELECT wot_tanks_id FROM wot_tanks WHERE name_node = '$node' AND wot_version_id = '$this->versionId'");
$tank_id = $mysql->row($tank_id);
$tank_id = $tank_id['wot_tanks_id'];
if ($tank_id == null)
{
Debug::log('<b>ERROR!</b> Failed to seach child ' . print_r($node, true), LEVEL_ERRORS);
}
else
{
// Todo: Migrate to stored procedure
$mysql->insertOrUpdate('wot_tanks_parents', "wot_tanks_id = {$tank_id} AND parent_id = {$parent_id}", array('wot_tanks_id' => $tank_id, 'parent_id' => $parent_id, 'cost' => $cost));
}
}
}
}
}
//Debug::log('tank_check_unlocks END for $parent_id = '.$parent_id.', $unlock = '.$unlock.', $nation = '.$nation.'.',LEVEL_NORMAL);
} | [
"public function varDumpLockResults();",
"public function listLockUnspent();",
"private function log_unlock($resourcekey) {\n global $DB;\n\n $select = $DB->sql_compare_text('resourcekey') . ' = ' . $DB->sql_compare_text(':resourcekey');\n\n $params = ['resourcekey' => $resourcekey];\n\n $record = $DB->get_record_select('tool_lockstats_locks', $select, $params);\n\n if ($record) {\n $delta = time() - $record->gained;\n\n $record->released = time();\n $record->duration = $delta;\n\n $resourcekeyprepared = $DB->get_manager()->generator->addslashes($resourcekey);\n $sql = \"UPDATE {tool_lockstats_locks}\n SET released = ?\n WHERE resourcekey = '$resourcekeyprepared'\";\n $DB->execute($sql, array($record->released));\n\n // Prevent logging tasks that exist in the blacklist.\n $blacklist = get_config('tool_lockstats', 'blacklist');\n foreach (explode(PHP_EOL, $blacklist) as $item) {\n if ($item == $resourcekey) {\n if ($this->debug) {\n mtrace('tool_lockstats [history blacklist]: ' . $item);\n }\n return false;\n }\n }\n\n $this->update_lock_type($record);\n\n if ($delta > get_config('tool_lockstats', 'threshold')) {\n // The record is duration is higher than the threshold. Create a new record.\n $this->log_history($record);\n } else {\n // Lets update the lock count instead.\n $this->log_update_count($record);\n }\n\n if ($record->type !== LOCKSTAT_SCHEDULED) {\n if ($record->type == LOCKSTAT_ADHOC) {\n $adhocid = explode('_', $resourcekey);\n $faildelay = $DB->get_record('task_adhoc', array('id' => $adhocid[1]), 'faildelay');\n\n if (!$faildelay) {\n $DB->delete_records('tool_lockstats_locks', array('resourcekey' => $record->resourcekey));\n }\n } else {\n $DB->delete_records('tool_lockstats_locks', array('resourcekey' => $record->resourcekey));\n }\n }\n\n }\n }",
"public function checkLevelUp() {\r\n \t\r\n \t$sql = 'SELECT SUM(decks_types.size) FROM decks_master \r\n\t\t\t\tLEFT JOIN decks ON decks_master.deck = decks.id\r\n\t\t\t\tLEFT JOIN decks_types ON decks_types.id = decks.type_id\r\n\t\t\t\tWHERE member = '.$this->getId();\r\n \t$req = $this->db->query($sql);\r\n \t$master_cards_sum = $req->fetchColumn();\r\n \tif(is_null($master_cards_sum)){ $master_cards_sum = 0; }\r\n \t\r\n \t$card_count_with_master = $this->getCardCount() + $master_cards_sum;\r\n $current_level = $this->getLevel('object');\r\n $reached_level = Level::getByCardNumber($card_count_with_master);\r\n //var_dump($reached_level).'<hr>'.var_dump($reached_level);\r\n if(!is_null($reached_level) AND $current_level->getLevel() != $reached_level->getLevel()){\r\n \r\n $next_level = $this->getLevel('object')->next();\r\n \r\n if($next_level instanceof Level){\r\n \r\n $this->setLevel($next_level->getId());\r\n $this->cards = null;\r\n \r\n if($this->update()){\r\n \r\n // Gift for level up\r\n $levelup_bonus = Setting::getByName('master_gift_cards');\r\n if($levelup_bonus instanceof Setting AND $levelup_bonus->getValue() > 0){\r\n $cards = Card::createRandomCards($this, intval($levelup_bonus->getValue()));\r\n $cardnames = $cardnames_msg = '';\r\n foreach($cards as $card){\r\n \t$cardnames_msg.= $card->getName().\", \";\r\n \t$cardnames.= $card->getName().\" (#\".$card->getId().\"), \";\r\n }\r\n $cardnames = substr($cardnames, 0, -2);\r\n Tradelog::addEntry($this, 'level_up_info',$cardnames);\r\n $msg_text = SystemMessageTextHandler::getInstance()->getTextByCode('level_up_info',$this->getLang());\r\n Message::add(null, $this->getId(), $msg_text.$cardnames_msg);\r\n }\r\n \r\n }\r\n }\r\n }\r\n \r\n }",
"function getLockLevel();",
"function AdminLock($postData)\n{\n $data = array();\n\n $id = $postData[\"ID\"];\n\n //determine checked value\n if ($postData[\"checked\"] == \"ON\") $checked = 1;\n else $checked = 0;\n\n //update table\n $query = \"UPDATE Stats SET Admin = $checked WHERE ID = '$id'\";\n \n if (SQLi_NonQuery($query))\n {\n $data[\"status\"] = \"Updated admin lock to \" . $postData[\"checked\"] . \" on \" . $postData[\"ID\"];\n }\n else\n {\n $data[\"status\"] = \"Error: admin lock change failed!\";\n }\n \n return $data;\n}",
"function printlocks($empid)\n{\n\n // Query to check if this person has got any lock on his/her record\n \t$querylock = \"select * from locks where empid='$empid' and active='y'\";\n $resultlock = MYSQL_QUERY($querylock) or die(\"SQL Error Occured : \".mysql_error().':'.$querylock);\n \n // Getting number of rows from Querylock\n $numberlock = MYSQL_NUMROWS($resultlock); \n \n $lockno=0;\n \n \n // Retreiving all locks from system for that user\n while ($lockno<$numberlock)\n {\n \n // Getting data for locks \n $lockid=mysql_result($resultlock,$lockno,\"lockid\");\n $datelock=mysql_result($resultlock,$lockno,\"datelock\");\n $reasonlock=mysql_result($resultlock,$lockno,\"reasonlock\");\n $lockedby=mysql_result($resultlock,$lockno,\"lockedby\");\n $active=mysql_result($resultlock,$lockno,\"active\");\n \n $lockedbyname=getempname($lockedby);\n \t \n $lockno1=$lockno+1;\t\n \t \n // Priting locks for user to check\n echo \"<table width=250 border=1 bordercolorlight=#CCCCCC bordercolordark=#CCCCCC cellpadding=0 cellspacing=0>\";\n echo \"<tr bgcolor=#CC0000>\";\n echo \"<td height=33>\";\n echo \"<div align=center><b><font size=\\\"-1\\\" color=\\\"#FFFFFF\\\"><b>RECORD LOCK $j</font></b></div></td>\";\n echo \"</tr><tr valign=middle>\";\n echo \"<td height=90>\";\n \n echo \"<table width=\\\"90%\\\" border=0 cellspacing=0 cellpadding=0 align=center>\";\n echo \"<tr>\";\n echo \"<td><font color=#000066 size=\\\"-1\\\">$reasonlock</font></td>\";\n echo \"</tr>\";\n echo \"</table>\";\n\n echo \"</td></tr><tr>\";\n echo \"<td height=33><i><font size=-2>Locked by : $lockedbyname<br>Locked on : $datelock</font></i></td>\";\n echo \"</tr></table>\";\n \n \n\n \n\n \t \n // going to next row of locks query\n $lockno++;\n \t \n } // end while ($lockno<$numberlock)\n \n return 1;\n \n}",
"function check_lock()\n\t{\n\t\tlog_write(\"debug\", \"journal_process\", \"Executing check_lock()\");\n\n\n\t\tif ($this->structure[\"id\"])\n\t\t{\n\t\t\t// make sure the user is permitted to adjust the journal entry\n\t\t\tif ($this->structure[\"userid\"] != $_SESSION[\"user\"][\"id\"])\n\t\t\t{\n\t\t\t\tlog_write(\"error\", \"journal_process\", \"You do not have permissions to update this journal entry\");\n\t\t\t\treturn 1;\n\t\t\t}\n\n\t\n\t\t\t// make sure the journal entry is valid and is not locked\n\t\t\tswitch ($this->verify_journalid())\n\t\t\t{\n\t\t\t\tcase 0:\n\t\t\t\t\tlog_write(\"error\", \"journal_process\", \"The requested journal entry is invalid\");\n\t\t\t\t\treturn 1;\n\t\t\t\tbreak;\n\n\t\t\t\tcase 1:\n\t\t\t\t\t// unlocked\n\t\t\t\t\treturn 0;\n\t\t\t\tbreak;\n\n\t\t\t\tcase 2:\n\t\t\t\t\tlog_write(\"error\", \"journal_process\", \"The requested journal entry is now locked, and can not be updated.\");\n\t\t\t\t\treturn 1;\n\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\t\tlog_write(\"error\", \"journal_process\", \"Unexpected error with verify_journalid function.\");\n\t\t\t\t\treturn 1;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// no entry selected, return unlocked\n\t\t\treturn 0;\n\t\t}\n\t}",
"function game_show_by_level($game_user, $text, $level_obtained, $level_needed = 0) {\n if ($level_obtained >= $level_needed) {\n if ($game_user->meta == 'admin') {\n $level_debug = ' (' . $level_obtained . ':' . $level_needed . ')';\n if (substr($text, -4) === '<br>') {\n $text = str_replace('<br>', $level_debug . '<br>', $text);\n }\n else {\n $text .= $level_debug;\n }\n }\n print $text;\n }\n}",
"function _checkLocked()\n {\n \t$locked = FALSE;\n\n \tif ($this->m_node->hasFlag(NF_LOCK))\n {\n \t// We assume that the node is locked, unless proven otherwise\n $locked = TRUE;\n if (is_array($this->m_postvars['atkselector']))\n {\n foreach ($this->m_postvars['atkselector'] as $selector)\n if (!$this->m_node->m_lock->lock($selector, $this->m_node->m_table, $this->m_node->getLockMode())) $locked = FALSE;\n }\n elseif (!$this->m_node->m_lock->lock($this->m_postvars['atkselector'], $this->m_node->m_table, $this->m_node->getLockMode())) $locked = FALSE;\n\n // If the node is locked, we proceed to display the 'locked' page\n if (!$locked)\n {\n $page = &$this->getPage();\n $page->addContent($this->m_node->lockPage());\n return true;\n }\n }\n }",
"public function test_createLock() {\n\n }",
"public function isLocked() {\r\n\t\t\r\n\t\treturn (FALSE);\r\n\t\t\r\n\t\t/*$DB = DBFactory::getInstance('system');\r\n\t\t$sNodeUUID = $this->getUUID();\r\n\t\t$stmtClearLocks = $DB->prepareKnown('sb_system/node/locking/clearLocks');\r\n\t\t$stmtClearLocks->execute();\r\n\t\t$stmtClearLocks->close();\r\n\t\t$stmtCheckLockLocal = $DB->prepareKnown('sb_system/node/locking/clearLocks');\r\n\t\t$stmtCheckLockLocal->bindParam('node_uuid', $sNodeUUID, PDO::PARAM_STR);\r\n\t\t$stmtCheckLockLocal->execute();\r\n\t\tforeach ($stmtCheckLockLocal as $unused) {\r\n\t\t\t*/\r\n\t\t\r\n\t}",
"public function abot_earned_to_exEarned(){\n // echo 'This feature is currently disabled by admin, be patient.';\n // exit;\n $u_id = $this->session->userdata('u_id');\n \n $arr = str_split($u_id); // convert string to an array\n $last_digit = end($arr);\n \n // if($last_digit == 4 || $last_digit == 5){\n // echo \"Lock by admin\";\n // exit;\n // }\n \n // if($this->db->query(\"SELECT * FROM admin_locks WHERE name = ?\", array('abot_lock'))->row()->lock_status == 1){\n // echo \"Lock by admin\";\n // exit;\n // } \n \n if($u_id != ''){\n $abot_earned_transfer_amount = abs($this->getTruncatedValue(doubleval($this->input->post('abot_earned_transfer_amount')), 4));\n if(!empty($abot_earned_transfer_amount) && $abot_earned_transfer_amount > 0){\n $get_earned_from_abot = $this->db->query(\"SELECT earned FROM abot_wallet WHERE user_id = ?\", array($u_id))->row()->earned;\n if($get_earned_from_abot > 0 && $get_earned_from_abot >= $abot_earned_transfer_amount){\n \n $abot_update_amount = $get_earned_from_abot - $abot_earned_transfer_amount;\n $this->db->query(\"UPDATE abot_wallet SET earned = ? WHERE user_id = ?\", array($abot_update_amount, $u_id));\n $exEarned_last = 0;\n if($get_exEarned_active_arb = $this->db->query(\"SELECT activeArb FROM exchange_earned_wallet WHERE user_id = ?\", array($u_id))->row()){\n $exEarned_last = $get_exEarned_active_arb->activeArb;\n $exEarned_update_arb = $get_exEarned_active_arb->activeArb + $abot_earned_transfer_amount;\n $this->db->query(\"UPDATE exchange_earned_wallet SET activeArb = ? WHERE user_id = ?\", array($exEarned_update_arb, $u_id));\n }else{\n $exEarned_update_arb = $abot_earned_transfer_amount;\n $this->db->query(\"INSERT INTO exchange_earned_wallet (user_id, activeArb) VALUES (?,?)\", array($u_id, $exEarned_update_arb));\n }\n \n \n $log1 = $this->db->query(\"INSERT into wallet_logs (user_id, type, value, last_blnc,comment) values (?,?,?,?,?)\", array($u_id,'abotWallet_earned','-'.$abot_earned_transfer_amount, $get_earned_from_abot, \"Transfer aBot Earned ARB to Exchange Earned Wallet\"));\n $log2 = $this->db->query(\"INSERT into wallet_logs (user_id, type, value, last_blnc,comment) values (?,?,?,?,?)\", array($u_id,'exEarnedWallet_ARB',$abot_earned_transfer_amount, $exEarned_last, \"Credit ARB in Exchange Earned Wallet from aBot earned\"));\n \n echo \"true\"; exit;\n \n }else{\n echo \"false\"; exit;\n }\n }else{\n echo 'false'; exit;\n }\n \n }else{\n echo 'false'; exit;\n }\n }",
"function finalPlaceLevel(){\n\t\t\t//\tdefine global variables used in this scope\n\t\t\tglobal $link, $indent, $strWC, $indentCount;\n\t\t\t\n\t\t\t$thisIndent = str_repeat($indent, $indentCount);\n\t\t\t\n\t\t\techo \"<br><br>$thisIndent FUNCTION EXECUTION: finalPlaceLevel\";\n\t\t\t\n\t\t\t//\tplace all fighters in this weight class on level 0\n\t\t\tmysqli_query($link, \"UPDATE rankings SET RLevel=0 WHERE RWeightClass='$strWC'\");\n\t\t\t\n\t\t\t$levelCounter = 0;\n\t\t\t//\tcontinue to loop through levels 0-X until some level (X+1) has no fighters in it\n\t\t\t$levelFighters = mysqli_query($link, \"SELECT RFighter FROM rankings WHERE RWeightClass='$strWC' AND RLevel='$levelCounter'\");\n\t\t\t\n\t\t\twhile($levelFighters->num_rows > 0){\n\t\t\t\techo \"<br>Level = '$levelCounter'\";\n\t\t\t\t\n\t\t\t\t//\tfor every fighter on this level...\n\t\t\t\twhile($F = $levelFighters->fetch_row()[0]){\n\t\t\t\t\techo \"<br>--fighter number '$F': new level = \";\n\t\t\t\t\t\n\t\t\t\t\t// ...find all nets to F\n\t\t\t\t\t$FNets = mysqli_query($link, \"SELECT PNet FROM bnpairs WHERE PBar='$F'\");\n\t\t\t\t\t\n\t\t\t\t\t//\tfor every net N of fighter F...\n\t\t\t\t\twhile($N = $FNets->fetch_row()[0]){\n\t\t\t\t\t\t//\t...check if N is on or above F's current level\n\t\t\t\t\t\tif(getLevel($N) >= getLevel($F)){\n\t\t\t\t\t\t\t//\tif so, place F on the next level up\n\t\t\t\t\t\t\tincrLevel($F);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$newLevel = getLevel($F);\n//\t\t\t\t\techo \"'$newLevel'\";\n\t\t\t\t}\n\t\t\t\t\n//\t\t\t\techo \"<br>\";\n\t\t\t\t\n\t\t\t\t//\tincrement counter and redefine levelFighters\n\t\t\t\t$levelCounter++;\n\t\t\t\t$levelFighters = mysqli_query($link, \"SELECT RFighter FROM rankings WHERE RWeightClass='$strWC' AND RLevel='$levelCounter'\");\n\t\t\t}\n\t\t\t\n\t\t\t//\tlevelCounter now holds the number of levels (including the base, 0) in this weight class\n\t\t\treturn $levelCounter;\n\t\t}",
"public function testIsLocked()\n {\n $this->testLock();\n }",
"public function tree_lock() {\n global $db, $uid;\n\n if (($this->lock_user != false) && ($this->lock_user != $uid)) {\n // Baum ist bereits von einem anderen Benutzer gesperrt\n $lock_stamp = false;\n $this->error = \"ERR_ALREADY_LOCKED\";\n return false;\n } else if (($this->lock_user != false) && ($this->lock_user == $uid)) {\n // Eigene Sperre bereits aktiv\n $this->lock_stamp = time();\n $this->lock_expire = time() + 300;\n $result = $db->querynow(\"UPDATE `lock` SET STAMP_UPDATE='\".date('Y-m-d H:i:s', $this->lock_stamp).\"',\n STAMP_EXPIRE='\".date('Y-m-d H:i:s', $this->lock_expire).\"'\n WHERE FK_USER=\".$uid.\" AND IDENT='\".$this->table.$this->root.\"'\");\n if (!$result['str_error']) {\n $this->lock_user = $uid;\n return true;\n } else {\n $this->error = \"ERR_LOCK_FAILED\";\n $this->lock_stamp = 0;\n $this->lock_expire = 0;\n $this->lock_user = false;\n return false;\n }\n } else {\n // Baum nicht gesperrt, Sperre hinzu\n $this->lock_stamp = time();\n $this->lock_expire = time() + 300;\n $result = $db->querynow(\"INSERT INTO `lock` (FK_USER, IDENT, STAMP_UPDATE, STAMP_EXPIRE) VALUES\n (\".$uid.\",'\".$this->table.$this->root.\"', '\".date('Y-m-d H:i:s', $this->lock_stamp).\"', '\".\n date('Y-m-d H:i:s', $this->lock_expire).\"')\");\n if (!$result['str_error']) {\n $this->lock_user = $uid;\n return true;\n } else {\n $this->error = \"ERR_LOCK_FAILED\";\n $this->lock_user = false;\n return false;\n }\n }\n }",
"public function abot_active_to_stop_abot_wallet_oold(){\n echo 'Lock by admin';\n exit;\n \n $u_id = $this->session->userdata('u_id');\n if(empty($this->db->query(\"SELECT * FROM stop_abot_wallet WHERE user_id = ?\", array($u_id))->result())){\n $this->db->query(\"INSERT INTO stop_abot_wallet (user_id) values ($u_id)\");\n }\n\n \t// for pro plus user request\n \tif(!empty($this->input->post('get_from')) && $this->input->post('get_from') == 'reqfromproplususerstopabot'){\n \t\t$token = hash('sha256', $this->input->post('time_stamp').$this->input->post('u_id'));\n \t\tif($token == $this->input->post('token')){\n \t\t\t$per_age = $this->input->post('active_arb_per');\n \t\t\t$u_id = $this->input->post('u_id');\n \t\t\tif($per_age < 0 || $per_age > 100){\n \t\t\t\techo 'invalid %age'; exit;\n \t\t\t}\n \t\t\tif($user_abot_date = $this->db->query(\"SELECT * FROM abot_wallet WHERE user_id = ?\", array($u_id))->row()){\n \t\t\t\t$_POST['dollar_selected'] = ($user_abot_date->active / 100) * $per_age;\n \t\t\t}else{\n \t\t\t\techo 'no abot record'; exit;\n \t\t\t}\n \t\t}else{\n \t\t\techo 'unknown request';\n \t\t\texit;\n \t\t}\n \t}else{\n \t\t$u_id = $this->session->userdata('u_id');\n \t}\n \n \tif($u_id != ''){\n \t\t// check lock time here \n \t\t$abot_wallet = $this->db->query(\"SELECT * FROM abot_wallet WHERE user_id = ?\", array($u_id))->row();\n \t\tif($abot_wallet->abot_lock_status == 1){\n \t\t\t$now = date('Y-m-d H:i:s');\n \t\t\t$block_days = '+'.$abot_wallet->lock_days.' days';\n \t\t\t$block_time = date('Y-m-d H:i:s', strtotime($block_days, strtotime($abot_wallet->lock_time)));\n \t\t\tif($now < $block_time){\n \t\t\t\techo 'false'; exit;\n \t\t\t}else{\n \t\t\t\t$this->db->query(\"UPDATE abot_wallet SET abot_lock_status = ? WHERE user_id = ?\", array(0, $u_id));\n \t\t\t}\n \t\t}\n \t\t$dollar_selected = doubleval($this->input->post('dollar_selected'));\n \n \t\t$arb_in_usd = $this->calculate_arb_abot_price($dollar_selected, 'out');\n \n \t\tif($arb_in_usd <= 0){\n \t\t\texit;\n \t\t}\n \n \t\t$abot_active_transfer_amount = $dollar_selected / $arb_in_usd;\n \n \t\tif(!empty($dollar_selected) && $dollar_selected > 0 && $abot_active_transfer_amount > 0){\n \t\t\t$get_active_from_abot = $this->db->query(\"SELECT * FROM abot_wallet WHERE user_id = ?\", array($u_id))->row();\n \t\t\tif($get_active_from_abot->active > 0 && $get_active_from_abot->active >= $dollar_selected){\n \t\t\t\t$before_24hour = date(\"Y-m-d H:i:s\", strtotime('-24 hour'));\n \t\t\t\tif($get_active_from_abot->pending_date > $before_24hour){\n \t\t\t\t\techo \"false\"; exit;\n \t\t\t\t}\n \t\t\t\t$abot_update_amount = $get_active_from_abot->active - $dollar_selected;\n \t\t\t\t$now = date('Y-m-d H:i:s');\n \t\t\t\t$this->db->query(\"UPDATE abot_wallet SET active = ?, stop_abot_time = ? WHERE user_id = ?\", array($abot_update_amount, $now, $u_id));\n \n \t\t\t\t$get_stop_active_arb = $this->db->query(\"SELECT activeArb FROM stop_abot_wallet WHERE user_id = ?\", array($u_id))->row()->activeArb;\n \n \t\t\t\t// 0.5 % fee on stop abot\n \t\t\t\t$stopabot_fee = $abot_active_transfer_amount * 0.04;\n \t\t\t\t$abot_arb_afterfee = $abot_active_transfer_amount - $stopabot_fee;\n \n \t\t\t\t$stop_update_arb = $get_stop_active_arb + $abot_arb_afterfee;\n \t\t\t\t$this->db->query(\"UPDATE stop_abot_wallet SET activeArb = ? WHERE user_id = ?\", array($stop_update_arb, $u_id));\n \n \t\t\t\t// stop_abot_data_record\n \t\t\t\t$this->db->query(\"INSERT into stop_abot_data (user_id, comment, wallet, value, price, date_time) values (?,?,?,?,?,?)\", array($u_id, 'stop aBot', 'Earned Wallet', $abot_arb_afterfee, $arb_in_usd, $now));\n \n \t\t\t\t//update admin wallet\n \t\t\t\t$get_admin_wallet = $this->db->query(\"SELECT * FROM admin_wallet WHERE id = 1 LIMIT 1\")->row();\n \t\t\t\t$admin_new_arb = $get_admin_wallet->arb + $stopabot_fee;\n \t\t\t\t$this->db->query(\"UPDATE admin_wallet SET arb = ? WHERE id = ?\", array($admin_new_arb, 1));\n \n \t\t\t\t$log1 = $this->db->query(\"INSERT into wallet_logs (user_id, type, value, last_blnc, comment) values (?,?,?,?,?)\", array($u_id,'abotWallet_active','-'.$dollar_selected, $get_active_from_abot->active, \"Transfer $ from aBot active to Stop aBOT Wallet\"));\n \t\t\t\t$log2 = $this->db->query(\"INSERT into wallet_logs (user_id, type, value, last_blnc, comment) values (?,?,?,?,?)\", array($u_id,'systemWallet_ARB',$abot_active_transfer_amount, $get_stop_active_arb, \"Credit ARB in Stop aBot Wallet\"));\n \t\t\t\t$log3 = $this->db->query(\"INSERT into wallet_logs (user_id, type, value, last_blnc, comment) values (?,?,?,?,?)\", array($u_id,'stop_aBotFee','-'.$stopabot_fee, ($get_stop_active_arb+$abot_active_transfer_amount), \"Fee\"));\n \n \t\t\t\techo \"true\"; exit;\n \n \t\t\t}else{\n \t\t\t\techo \"false\"; exit;\n \t\t\t}\n \t\t}else{\n \t\t\techo 'false'; exit;\n \t\t}\n \t}else{\n \t\techo 'false'; exit;\n \t}\n }",
"function thisIdLocked($id, $locked)\n{\n foreach ($locked as $lockedKey => $lockedValue)\n {\n if ($lockedValue['value'] == $id)\n {\n #echo \"<div class=debug>[thisIdLocked]Match!</div>\";\n return true;\n }\n }\n \n #echo \"<div class=debug>No matches found.</div>\";\n return false;\n}",
"function cm_transactionDeny( $inLogDetails = true ) {\n\n if( $inLogDetails ) {\n // log it\n $postBody = file_get_contents( 'php://input' );\n $getString = $_SERVER[ 'QUERY_STRING' ];\n\n $requestData = $postBody;\n \n if( $getString != \"\" ) {\n\n if( $requestData != \"\" ) {\n $requestData = $getString . \"\\n\" . $requestData;\n }\n else {\n $requestData = $getString;\n }\n }\n\n if( strstr( $requestData, \"card_data\" ) != FALSE ) {\n // don't log card data (not even encrypted card data)\n $requestData = \"[Request contains card data, redacted]\";\n }\n \n \n cm_log( \"Transaction denied with the following get/post data: \".\n \"$requestData\" );\n }\n \n \n \n echo \"DENIED\";\n \n cm_queryDatabase( \"COMMIT;\" );\n cm_queryDatabase( \"SET AUTOCOMMIT=1\" );\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
4. Get hebrew date | public static function get_hebrew_date($date = false)
{
// Default date is now
$date = $date ? $date : time();
$julian = gregoriantojd(
date('m', $date),
date('d', $date),
date('Y', $date)
);
// Check the cache
if (array_key_exists($julian, self::$hebrew_dates_cache)) {
return self::$hebrew_dates_cache[$julian];
}
$hebrew = jdtojewish(
$julian,
true, // We want it in hebrew characters
CAL_JEWISH_ADD_ALAFIM_GERESH + CAL_JEWISH_ADD_GERESHAYIM
);
// Convert to utf-8
$hebrew = iconv('WINDOWS-1255', 'UTF-8', $hebrew);
// Remove the ALAFIM part
$hebrew = preg_replace("/ ה'/", ' ', $hebrew);
// Turn spaces into so that they don't break on a line break
$hebrew = preg_replace('/ /', ' ', $hebrew);
// Cache the date
self::$hebrew_dates_cache[$julian] = $hebrew;
return $hebrew;
} | [
"function russian_date() {\n\t\t$date = explode(\".\", date(\"d.m.Y\"));\n\t\tswitch ($date[1]) {\n\t\tcase 1: $m ='января'; break;\n\t\tcase 2: $m ='февраля'; break;\n\t\tcase 3: $m ='марта'; break;\n\t\tcase 4: $m ='апреля'; break;\n\t\tcase 5: $m ='мая'; break;\n\t\tcase 6: $m ='июня'; break;\n\t\tcase 7: $m ='июля'; break;\n\t\tcase 8: $m ='августа'; break;\n\t\tcase 9: $m ='сентября'; break;\n\t\tcase 10: $m ='октября'; break;\n\t\tcase 11: $m ='ноября'; break;\n\t\tcase 12: $m ='декабря'; break;\n\t}\n\t\techo $date[0].' '.$m.' '.$date[2];\n\t}",
"function russianDate($date)\n{\n $date = explode(\".\", $date);\n switch ($date[1]) {\n case 1:\n $m = 'января';\n break;\n case 2:\n $m = 'февраля';\n break;\n case 3:\n $m = 'марта';\n break;\n case 4:\n $m = 'апреля';\n break;\n case 5:\n $m = 'мая';\n break;\n case 6:\n $m = 'июня';\n break;\n case 7:\n $m = 'июля';\n break;\n case 8:\n $m = 'августа';\n break;\n case 9:\n $m = 'сентября';\n break;\n case 10:\n $m = 'октября';\n break;\n case 11:\n $m = 'ноября';\n break;\n case 12:\n $m = 'декабря';\n break;\n }\n return $date[0] . ' ' . $m; //.' '.$date[2];\n}",
"private function get_date_letter_representative()\n {\n $date = date('d');\n if ($date == 1) {\n return '1';\n }\n if ($date == 2) {\n return '2';\n }\n if ($date == 3) {\n return '3';\n }\n if ($date == 4) {\n return '4';\n }\n if ($date == 5) {\n return '5';\n }\n if ($date == 6) {\n return '6';\n }\n if ($date == 7) {\n return '7';\n }\n if ($date == 8) {\n return '8';\n }\n if ($date == 9) {\n return '9';\n }\n if ($date == 10) {\n return 'A';\n }\n if ($date == 11) {\n return 'B';\n }\n if ($date == 12) {\n return 'C';\n }\n if ($date == 13) {\n return 'D';\n }\n if ($date == 14) {\n return 'E';\n }\n if ($date == 15) {\n return 'F';\n }\n if ($date == 16) {\n return 'G';\n }\n if ($date == 17) {\n return 'H';\n }\n if ($date == 18) {\n return 'I';\n }\n if ($date == 19) {\n return 'J';\n }\n if ($date == 20) {\n return 'K';\n }\n if ($date == 21) {\n return 'L';\n }\n if ($date == 22) {\n return 'M';\n }\n if ($date == 23) {\n return 'N';\n }\n if ($date == 24) {\n return 'O';\n }\n if ($date == 25) {\n return 'P';\n }\n if ($date == 26) {\n return 'Q';\n }\n if ($date == 27) {\n return 'R';\n }\n if ($date == 28) {\n return 'S';\n }\n if ($date == 29) {\n return 'T';\n }\n if ($date == 30) {\n return 'U';\n }\n if ($date == 31) {\n return 'V';\n }\n }",
"public function holidaysHebrew()\n {\n return $this->holidays('hebrew');\n }",
"function ruDate()\n {\n $translate = array(\n \"am\" => \"дп\",\n \"pm\" => \"пп\",\n \"AM\" => \"ДП\",\n \"PM\" => \"ПП\",\n \"Monday\" => \"Понедельник\",\n \"Mon\" => \"Пн\",\n \"Tuesday\" => \"Вторник\",\n \"Tue\" => \"Вт\",\n \"Wednesday\" => \"Среда\",\n \"Wed\" => \"Ср\",\n \"Thursday\" => \"Четверг\",\n \"Thu\" => \"Чт\",\n \"Friday\" => \"Пятница\",\n \"Fri\" => \"Пт\",\n \"Saturday\" => \"Суббота\",\n \"Sat\" => \"Сб\",\n \"Sunday\" => \"Воскресенье\",\n \"Sun\" => \"Вс\",\n \"January\" => \"Января\",\n \"Jan\" => \"Янв\",\n \"February\" => \"Февраля\",\n \"Feb\" => \"Фев\",\n \"March\" => \"Марта\",\n \"Mar\" => \"Мар\",\n \"April\" => \"Апреля\",\n \"Apr\" => \"Апр\",\n \"May\" => \"Мая\",\n \"May\" => \"Мая\",\n \"June\" => \"Июня\",\n \"Jun\" => \"Июн\",\n \"July\" => \"Июля\",\n \"Jul\" => \"Июл\",\n \"August\" => \"Августа\",\n \"Aug\" => \"Авг\",\n \"September\" => \"Сентября\",\n \"Sep\" => \"Сен\",\n \"October\" => \"Октября\",\n \"Oct\" => \"Окт\",\n \"November\" => \"Ноября\",\n \"Nov\" => \"Ноя\",\n \"December\" => \"Декабря\",\n \"Dec\" => \"Дек\",\n \"st\" => \"ое\",\n \"nd\" => \"ое\",\n \"rd\" => \"е\",\n \"th\" => \"ое\"\n );\n // если передали дату, то переводим ее\n if (func_num_args() > 1) {\n $timestamp = func_get_arg(1);\n return strtr(date(func_get_arg(0), $timestamp), $translate);\n } else {\n // иначе текущую дату\n return strtr(date(func_get_arg(0)), $translate);\n }\n }",
"function get_date_in_russian( $timezone_identifier ) {\n $month = [\n [ 'Январь', 'Января' ],\n [ 'Февраль', 'Февраля' ],\n [ 'Март', 'Марта' ],\n [ 'Апрель', 'Апреля' ],\n [ 'Май', 'Мая' ],\n [ 'Июнь', 'Июня' ],\n [ 'Июль', 'Июля' ],\n [ 'Август', 'Августа' ],\n [ 'Сентябрь','Сентября' ],\n [ 'Октябрь', 'Октября' ],\n [ 'Ноябрь', 'Ноября' ],\n [ 'Декабрь', 'Декабря' ],\n ];\n\n $week = [\n 'Понедельник',\n 'Вторник',\n 'Среда',\n 'Четверг',\n 'Пятница',\n 'Субота',\n 'Воскресенье',\n ];\n\n date_default_timezone_set($timezone_identifier);\n $time = localtime(time(), true);\n\n $date = '';\n $date .= $time[ 'tm_mday' ] . ' ' . $month[ $time['tm_mon'] ][1] . ' ' . date('Y') . '.';\n $date .= ' ' . $week[ $time['tm_wday'] ] . '.';\n $date .= ' Время: ' . number_to_word($time[ 'tm_hour' ]) . ' ' . time_units_to_words($time[ 'tm_hour' ]) . ' ' . number_to_word($time[ 'tm_min' ]) . ' ' . time_units_to_words($time[ 'tm_min' ], 'M') . ' ' . number_to_word($time[ 'tm_sec' ]) . ' ' . time_units_to_words($time[ 'tm_sec' ], 'S');\n\n return $date;\n}",
"function foreign_date($date){\n\t \tlist($month, $day, $year) = split(\"-\", $date);\n\t\treturn $month . \"-\" . $day . \"-\" . $year;\n\t}",
"function ukDate()\n {\n $translate = array(\n \"am\" => \"дп\",\n \"pm\" => \"пп\",\n \"AM\" => \"ДП\",\n \"PM\" => \"ПП\",\n \"Monday\" => \"Понеділок\",\n \"Mon\" => \"Пн\",\n \"Tuesday\" => \"Вівторок\",\n \"Tue\" => \"Вт\",\n \"Wednesday\" => \"Середа\",\n \"Wed\" => \"Ср\",\n \"Thursday\" => \"Четвер\",\n \"Thu\" => \"Чт\",\n \"Friday\" => \"П’ятниця\",\n \"Fri\" => \"Пт\",\n \"Saturday\" => \"Субота\",\n \"Sat\" => \"Сб\",\n \"Sunday\" => \"Неділя\",\n \"Sun\" => \"Нд\",\n \"January\" => \"Січень\",\n \"Jan\" => \"Січ\",\n \"February\" => \"Лютий\",\n \"Feb\" => \"Лют\",\n \"March\" => \"Березень\",\n \"Mar\" => \"Бер\",\n \"April\" => \"Квітень\",\n \"Apr\" => \"Кв\",\n \"May\" => \"Травень\",\n \"May\" => \"Тр\",\n \"June\" => \"Червень\",\n \"Jun\" => \"Черв\",\n \"July\" => \"Липень\",\n \"Jul\" => \"Лип\",\n \"August\" => \"Серпень\",\n \"Aug\" => \"Сер\",\n \"September\" => \"Вересень\",\n \"Sep\" => \"Вер\",\n \"October\" => \"Жовтень\",\n \"Oct\" => \"Жовт\",\n \"November\" => \"Листопад\",\n \"Nov\" => \"Лист\",\n \"December\" => \"Грудень\",\n \"Dec\" => \"Гр\",\n \"st\" => \"те\",\n \"nd\" => \"те\",\n \"rd\" => \"е\",\n \"th\" => \"те\"\n );\n // если передали дату, то переводим ее\n if (func_num_args() > 1) {\n $timestamp = func_get_arg(1);\n return strtr(date(func_get_arg(0), $timestamp), $translate);\n } else {\n // иначе текущую дату\n return strtr(date(func_get_arg(0)), $translate);\n }\n }",
"function rfc_date() {\n $tz = date(\"Z\");\n $tzs = ($tz < 0) ? \"-\" : \"+\";\n $tz = abs($tz);\n $tz = $tz/36 + $tz % 3600;\n $date = sprintf(\"%s %s%04d\", date(\"D, j M Y H:i:s\"), $tzs, $tz);\n return $date;\n }",
"public function get_english_date()\n\t{\n\t\t$nepali_date = null;\n\t\t\n\t\tif ($this->input->post('nepali_date')) {\n\t\t\t$nepali_date = $this->input->post('nepali_date');\n\t\t}\n\t\t\n\t\t//HELPER FUNCTION\n\t\tget_english_date($nepali_date);\n\t}",
"function mbDateToLocale($date) {\n\treturn preg_replace(\"/(\\d{4})-(\\d{2})-(\\d{2})/\", '$3/$2/$1', $date);\n}",
"function dateToRussian($date) {\n $month = array(\"Январь\"=>\"Января\", \"Февраль\"=>\"Февраля\", \"Март\"=>\"Марта\", \"Апрель\"=>\"Апреля\", \"Май\"=>\"Мая\", \"Июнь\"=>\"Июня\", \"Июль\"=>\"Июля\", \"Август\"=>\"Августа\", \"Сентябрь\"=>\"Сентября\", \"Октябрь\"=>\"Октября\", \"Ноябрь\"=>\"Ноября\", \"Декабрь\"=>\"Декабря\");\n $days = array(\"monday\"=>\"Понедельник\", \"tuesday\"=>\"Вторник\", \"wednesday\"=>\"Среда\", \"thursday\"=>\"Четверг\", \"friday\"=>\"Пятница\", \"saturday\"=>\"Суббота\", \"sunday\"=>\"Воскресенье\");\n echo str_replace(array_merge(array_keys($month), array_keys($days)), array_merge($month, $days), strtolower($date));\n}",
"function en_date($date_de) {\t\n\treturn date('Y-m-d', strtotime($date_de));\n}",
"function extDate( $date ){\n\t$Amonth = array( 'enero','febrero','marzo','abril','mayo','junio',\n\t\t\t'julio','agosto','setiembre','octubre','noviembre','diciembre');\n\t$month = substr( $date,5,2 )-1;\n\treturn( substr( $date, 8,2) . ' de ' . $Amonth[ $month ] . ' de ' .\n\t\tsubstr( $date, 0,4 ) );\n\t\t\t\n}",
"function persian_strftime_utf($format, $timestamp='') {\n\n if($timestamp==''){\n $timestamp = mktime();\n }\n\n $g_d=date('j', $timestamp);\n $g_m=date('n', $timestamp);\n $g_y=date('Y', $timestamp);\n\n list($jy, $jm, $jd, $j_all_days) = g2p($g_y, $g_m, $g_d);\n\n $j_month_name = array('', 'فروردین', 'اردیبهشت', 'خرداد', 'تیر',\n 'مرداد', 'شهریور', 'مهر', 'آبان', 'آذر', 'دی', 'بهمن', 'اسفند');\n $j_week_name = array('Saturday' => 'شنبه',\n 'Sunday' => 'یک شنبه',\n 'Monday' => 'دوشنبه',\n 'Tuesday' => 'سه شنبه',\n 'Wednesday' => 'چهارشنبه',\n 'Thursday' => 'پنج شنبه',\n 'Friday' => 'جمعه',\n 'Sat' => 'ش',\n 'Sun' => 'ی',\n 'Mon' => 'د',\n 'Tue' => 'س',\n 'Wed' => 'چ',\n 'Thu' => 'پ',\n 'Fri' => 'ج');\n $j_week_number = array('Sat' => '1',\n 'Sun' => '2',\n 'Mon' => '3',\n 'Tue' => '4',\n 'Wed' => '5',\n 'Thu' => '6',\n 'Fri' => '7');\n\n // calculate string\n $output_str='';\n\n for ($i=0; $i<strlen($format); $i++){\n\n if($format[$i]=='%'){\n $i++;\n switch($format[$i]){\n case 'a':\n $output_str.=$j_week_name[date('D', $timestamp)];\n break;\n case 'A':\n $output_str.=$j_week_name[date('l', $timestamp)];\n break;\n case 'b':\n case 'B':\n case 'h':\n $output_str.=$j_month_name[$jm];\n break;\n case 'c':\n $output_str.=persian_strftime_utf('%y/%m/%d %I:%M:%S', $timestamp);\n break;\n case 'C':\n $output_str.=floor($jy/100);\n break;\n case 'd':\n if($jd<10) $output_str.='0'.$jd; else $output_str.=$jd;\n break;\n case 'D':\n $output_str.=$jy.'/'.$jm.'/'.$jd;\n break;\n case 'e':\n if($jd<10) $output_str.=' '.$jd; else $output_str.=$jd;\n break;\n case 'H':\n $output_str.=date('H', $timestamp);\n break;\n case 'I':\n $output_str.=date('h', $timestamp);\n break;\n case 'j':\n $output_str.=sprintf('%03d', $j_all_days);\n break;\n case 'm':\n if($jm<10) $output_str.='0'.$jm; else $output_str.=$jm;\n break;\n case 'M':\n $output_str.=date('i', $timestamp);\n break;\n case 'n':\n $output_str.=\"\\n\";\n break;\n case 'r':\n case 'p':\n if(date('a',$timestamp)=='pm') $output_str.='بعد از ظهر'; else $output_str.='قبل از ظهر';\n break;\n case 'R':\n $output_str.=strftime('%R', $timestamp);\n break;\n case 'S':\n $output_str.=date('s', $timestamp);\n break;\n case 't':\n $output_str.=\"\\t\";\n break;\n case 'U':\n case 'V':\n case 'W':\n $output_str.=sprintf('%02d', floor(($j_all_days+1)/7));\n break;\n case 'u':\n case 'w':\n $output_str.=$j_week_number[date('D', $timestamp)];\n break;\n case 'x':\n $output_str.=persian_strftime_utf('%y/%m/%d', $timestamp);\n break;\n case 'X':\n $output_str.=persian_strftime_utf('%I:%M:%S', $timestamp);\n break;\n case 'g':\n case 'y':\n $output_str.=$jy-(floor($jy/100)*100);\n break;\n case 'G':\n case 'Y':\n $output_str.=$jy;\n break;\n case 'z':\n case 'Z':\n $output_str.=strftime('%z', $timestamp);\n break;\n case '%':\n $output_str.='%';\n break;\n }\n }else{\n $output_str.=$format[$i];\n }\n }\n\n return $output_str;\n}",
"abstract public function calendarLangWrongDateFormat(): string;",
"function Date_bn($thedate) \n{\n\t//echo date(\"d/m/Y - H:i\");\n\t$sections=@explode(\"-\",$thedate);\n\t//print_r($sections);\n\t$parts1=@explode(\"/\",$sections[0]);\n\techo BanglaMonth($parts1[1]).\" \". BanglaNum($parts1[0].\", \".$parts1[2]);\n\tif(trim($sections[2])==\"am\")\n\t\techo \" সকাল \";\n\telseif(trim($sections[2])==\"pm\")\n\t\techo \" বিকাল \";\n\t$parts2=@explode(\":\",$sections[1]);\n\techo \" - \".BanglaNum($parts2[0].\":\".$parts2[1]);\t\n}",
"function aujourdhui($binAAAAMMJJ = true) {\n return $binAAAAMMJJ ? date(\"Y-m-d\") : date(\"d-m-Y\");\n }",
"function CANotAPI_GetReadableDate($date10char)\n\t{\n $result_str = '';\n preg_match_all(\"/^(?<year>\\d{2})(?<month>\\d{2})(?<day>\\d{2})(?<zulu>\\d{4})$/\", $date10char, $data);\n $result_str = '20'.$data['year'][0].'-'.$data['month'][0].'-'.$data['day'][0].' '.$data['zulu'][0].'Z';\n return $result_str;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Show extra notice before gateway description when test mode is enabled. | public function payment_fields() // phpcs:ignore PSR1.Methods.CamelCapsMethodName.NotCamelCaps
{
if ($this->mpay24->isTestModeEnabled()) {
echo '<p>' . \esc_html__('TEST MODE ENABLED', 'bc-woocommerce-mpay24-gateway') . '</p>';
}
parent::payment_fields();
} | [
"function add_testmode_admin_settings_notice () {\n \t$this->form_fields['title']['description'] .= ' <strong>' . __( 'CPS currently in test mode.', 'woothemes' ) . '</strong>';\n }",
"function tbz_wc_paystack_testmode_notice(){\n\n\t$paystack_settings = get_option( 'woocommerce_paystack_settings' );\n\n\t$test_mode \t= isset( $paystack_settings['testmode'] ) ? $paystack_settings['testmode'] : '';\n\n\tif ( 'yes' == $test_mode ) {\n ?>\n\t <div class=\"update-nag\">\n\t Paystack testmode is still enabled, Click <a href=\"<?php echo get_bloginfo('wpurl') ?>/wp-admin/admin.php?page=wc-settings&tab=checkout§ion=paystack\">here</a> to disable it when you want to start accepting live payment on your site.\n\t </div>\n <?php\n\t}\n}",
"public function displayDemoNotice()\n {\n return Mage::getStoreConfig('design/head/demonotice');\n }",
"public function displayDemoNotice()\n {\n return $this->_scopeConfig->getValue(\n 'design/head/demonotice',\n \\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE\n );\n }",
"function payment_fields() {\r\n?>\r\n\t\t<?php if ($this->trx_server == 'sandbox') : ?><p><?php _e('TEST MODE/SANDBOX ENABLED', WC_Paypal_Advanced::TEXT_DOMAIN ); ?></p><?php endif; ?>\r\n\t\t<?php if ($this->description) : ?><p><?php echo wpautop(wptexturize($this->description)); ?></p><?php endif; ?>\r\n<?php\r\n\t}",
"protected function outputIntro()\n {\n $this->printLn(\"Config Validation Mode\", 'notice');\n\n if (true == $this->getConfig()->getIsInDeveloperMode()\n || $this->getConfig()->getIsInDeveloperMode() == OutputInterface::VERBOSITY_VERY_VERBOSE) {\n $this->printLn(\"App is in developer mode, therefore all output will be shown!\", 'warning');\n $this->printLn(\"Verbosity \".$this->_output->getVerbosity(), 'warning');\n }\n }",
"public function should_display_first_time_configuration_notice()\n {\n }",
"public function disabled_message() {\n echo '<!-- ' . Yfp_Ganalytics_Basic_Common::COMMON_PLUGIN_NAME . ' is disabled in the admin panel. -->' . \"\\n\";\n }",
"public function general_settings_section_description() {\n\t\techo '<p>General settings for Koken Sync.</p>';\n\t}",
"public static function should_display_message() {\n\t\treturn false;\n\t}",
"function parser_notice() {\n ?>\n <div class=\"notice notice-warning\">\n <p>\n <?php _e(\n '<strong>Custom Parser</strong> is active, some options/settings may not work. We do <strong>not</strong> recommend using this feature!',\n $this->plugin_name\n ); ?>\n </p>\n </div>\n <?php\n }",
"public static function render_history_debug_enabled() {\n Main::render_radio_buttons(\n 'watsonconv_history_debug_enabled',\n 'no',\n array(\n array(\n 'label' => esc_html__('Yes', self::SLUG),\n 'value' => 'yes'\n ), array(\n 'label' => esc_html__('No', self::SLUG),\n 'value' => 'no'\n )\n )\n );\n ?>\n <p>Extended information includes additional diagnostic information for fine-tuning your bot such as additional recognized intents, Watson Assistant log messages and visited nodes.</p>\n <?php\n }",
"public function showMessage()\n {\n return $this->helperConfig->isEnabled() && $this->helperConfig->showMessage();\n }",
"private function infoDemo() {\n $this->addInfo('Hello World! this is notification from example module');\n }",
"public static function stripe_gateway_notice() {\n\t\tinclude dirname( __FILE__ ) . '/views/notices/html-notice-stripe-gateway.php';\n\t}",
"public function settingsNotice()\n {\n print '<div class=\"notice notice-error\"><p>' . $this->missingSettingsMessage . '</p></div>';\n }",
"protected function showOptionalAdditionalInfo()\n {\n return;\n }",
"public function enableTestMode() {\n $this->testMode = TRUE;\n $this->gatewayUrl = 'https://www.sandbox.paypal.com/cgi-bin/webscr';\n }",
"public function displayDebugInfo()\n {\n if ($this->getStatus()->getCode() == ETL_SUCCESS)\n {\n echo \"Success!\";\n } else {\n switch ($this->getStatus()->getCode())\n {\n case ETL_FAILED:\n echo \"Failed!\" . \"<br />\" . $this->getStatus()->getMessage();\n break;\n default:\n echo \"Failed- Unknown Response Code: \" . $this->getStatus()->getCode() . \"<br />\";\n break;\n }\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
move to next step | public function nextStep() // todo: rename to moveStepForward()
{
$this->step++;
} | [
"public function NextStep () {\n $this->step++;\n }",
"public function next()\n {\n $this->run('step_over -i {id}');\n }",
"public function preNextStep() {}",
"public function goNext(){\n $currentOrder = $this->node_orders;\n $nextNodeOrder = $currentOrder + 1;\n\n $status = 'proceed';\n $maxOrder = $this->flow()->first()->nodes()->count();\n if($nextNodeOrder > $maxOrder){\n $status = 'completed';\n $nextNodeOrder = $maxOrder+1;\n }\n $this->node_orders = $nextNodeOrder;\n $this->status = $status;\n $this->save();\n Log::error($this->errors()->all());\n }",
"function GotoNext()\n {\n $next = Page::NextStep($this->Step());\n Response::Redirect(Path::AddExtension($next, 'php'));\n }",
"private function setStep()\n {\n if ($this->aMoveResult && isset($this->aMoveResult['seq'])) {\n if ($this->aMoveResult['finished'] != true) {\n $_SESSION[$this->LEMsessid]['step'] = $this->aMoveResult['seq'] + 1; // step is index base 1\n $this->aStepInfo = LimeExpressionManager::GetStepIndexInfo($this->aMoveResult['seq']);\n }\n }\n }",
"private function _move_to_next_round(){\n $current_round_index = $this->subj->get_current_round_index();\n $next_round_index = $current_round_index + 1;\n\n $rounds = $this->subj->second_stage_order;\n\n $round = $this->exp->get_phase_one_round_by_id($this->subj->current_round);\n $phase= 2;\n $this->exp->insert_displayed_round_id(($this->subj->round_counter+1), $this->subj->current_round, $this->subj->get_id(), $phase);\n \n // if this is the last round in phase one move to intro phase two\n if($next_round_index == count($rounds)){\n $this->subj->set_current_phase('payoff');\n redirect('subject/payoff');\n }\n\n $this->subj->set_current_round($rounds[$next_round_index]);\n\n $round = $this->exp->get_phase_one_round_by_id($this->subj->current_round);\n $this->subj->increment_round_counter();\n \n redirect('subject/phase_two');\n }",
"function next() {\r\n\t\t$this->sendCommand('next');\r\n\t}",
"public function stepForward()\n\t{\n\t\t// Check available steps.\n\t\t$available = $this->getAvailableForStep($this->stepPosition);\n\t\tif (!empty($available)) {\n\t\t\t// Go to random step.\n\t\t\tshuffle($available);\n\t\t\t$nextSector = $available[0];\n\t\t\t$x = key($nextSector);\n\t\t\t$this->prevPosition = $this->stepPosition;\n\t\t\t$this->stepPosition = [$x => $nextSector[$x]];\n\t\t\tarray_push($this->path, $this->stepPosition);\n\t\t\t// Check if solve the maze.\n\t\t\t$isTheLastOne = $this->checkIfCurrentStepIsTheLast();\n\t\t\tif ($isTheLastOne) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\t// If available steps, go forward.\n\t\t\treturn $this->stepForward();\n\t\t}\n\n\t\treturn false;\n\t}",
"public function next_step()\n {\n $this->m_current_step++;\n\n if (!isset($this->m_steps[$this->m_current_step]))\n {\n return false;\n } // if\n\n return true;\n }",
"function splitPageNext()\n\t{\n\t\tglobal $ilErr;\n\t\t\n\t\tif ($this->pg_obj->getParentType() != \"lm\" &&\n\t\t\t$this->pg_obj->getParentType() != \"dbk\")\n\t\t{\n\t\t\t$ilErr->raiseError(\"Split method called for wrong parent type (\".\n\t\t\t$this->pg_obj->getParentType().\")\", $ilErr->FATAL);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$succ_id = ilLMPageObject::_splitPageNext($this->pg_obj->getId(),\n\t\t\t\t$this->pg_obj->getParentType(), $this->hier_id);\n\t\t\t\n\t\t\t// jump to successor page\n\t\t\tif ($succ_id > 0)\n\t\t\t{\n\t\t\t\t$this->ctrl->setParameterByClass(\"illmpageobjectgui\", \"obj_id\", $succ_id);\n\t\t\t\t$this->ctrl->redirectByClass(\"illmpageobjectgui\", \"edit\");\n\t\t\t}\n\n\t\t}\n\t\t$this->ctrl->returnToParent($this, \"jump\".($this->hier_id - 1));\n\t}",
"public function column_next_steps( $item ) {}",
"protected function step_next_link() {\n\t\t$keys = array_keys( $this->steps );\n\t\t$step = array_search( $this->step, $keys, true ) + 1;\n\n\t\treturn add_query_arg( 'step', $keys[ $step ] );\n\t}",
"public function next()\n {\n $this->mutateBoard();\n }",
"public function column_next_steps($item)\n {\n }",
"public function navigateToNextPage() {\n if ($this->delay > 0)\n sleep($this->delay);\n $this->currentPage++;\n }",
"protected function goToNextFile()\n {\n $this->closeCurrentFile();\n $this->files->next();\n $this->openCurrentFile();\n }",
"function next()\r\n {\r\n\t\tif($this->debug>0){error_log('New LP - In learnpath::next()',0);}\r\n \t$this->last = $this->get_current_item_id();\r\n \t$this->items[$this->last]->save(false,$this->prerequisites_match($this->last));\r\n \t$this->autocomplete_parents($this->last);\r\n \t$new_index = $this->get_next_index();\r\n \tif($this->debug>2){error_log('New LP - New index: '.$new_index,0);}\r\n \t$this->index = $new_index;\r\n \tif($this->debug>2){error_log('New LP - Now having orderedlist['.$new_index.'] = '. $this->ordered_items[$new_index],0);}\r\n \t$this->current = $this->ordered_items[$new_index];\r\n \tif($this->debug>2){error_log('New LP - new item id is '.$this->current.'-'.$this->get_current_item_id(),0);}\r\n }",
"protected function _moveToLatestStep() {\n\t\t$lastStep = $this->_getLastCompletedStep();\n\t\tif($lastStep !== false) {\n\t\t\tforeach($this->_steps as $number => $name) {\n\t\t\t\tunset($this->_steps[$number]);\n\t\t\t\tif($name == $lastStep) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
readReference replaces the old readFlushedSO. It treats where there are references to other objects. Currently it does not resolve the object as this would involve a serious amount of overhead, unless you have a genius idea | function readReference() {
$reference = $this->readInt();
return $this->amf0storedObjects[$reference];
} | [
"private function ReferenceObject()\n\t{\n\t\tif ($this->objectReferenced)\n\t\t\treturn;\n\n\t\tif (!$this->object)\n\t\t\treturn;\n\n\t\tif ($this->type == 'commit') {\n\t\t\t$this->object = $this->object->GetHash();\n\t\t} else if ($this->type == 'tag') {\n\t\t\t$this->object = $this->object->GetName();\n\t\t} else if ($this->type == 'blob') {\n\t\t\t$this->object = $this->object->GetHash();\n\t\t}\n\n\t\t$this->objectReferenced = true;\n\t}",
"public function resolve()\n {\n if (isset($this->object)) {\n return $this->object;\n }\n\n $controller = $this->controller;\n $parent = $controller::read($this->handle);\n $index = $parent->getReferenceIndex();\n\n if (false === isset($index[$this->reference])) {\n throw new Exception(sprintf(\n 'Unknown reference %s.',\n $this->reference\n ));\n }\n\n $value = clone $index[$this->reference];\n\n if (false === ($value instanceof MetadataInterface)) {\n throw new Exception(sprintf(\n 'Type %s cannot be used as a reference as it does not implement MetadataInterface.',\n get_class($value)\n ));\n }\n\n $this->object = $value;\n\n return $value;\n }",
"public function loadRef()\n {\n return $this->loader->load($this->ref);\n }",
"public function readObject()\n {\n if ($this->enableOverride) {\n return $this->readObjectOverride();\n }\n \n // If nested read, passHandle contains handle of enclosing object.\n $outerHandle = $this->passHandle;\n try {\n $obj = $this->readObject0(false);\n $this->handles->markDependency($outerHandle, $this->passHandle);\n $ex = $this->handles->lookupException($this->passHandle);\n if ($ex != null) {\n throw $ex;\n }\n return $obj;\n } finally {\n $this->passHandle = $outerHandle;\n if ($this->closed && $this->depth == 0) {\n $this->clear();\n }\n }\n }",
"public function resolve($reference);",
"public function getIndirectObject() {}",
"protected function ref()\n\t{\n\t\tif ($this->obj[\"oid\"])\n\t\t{ // existing object reference container\n\t\t\treturn new object($this->obj[\"oid\"]);\n\t\t}\n\t\telse\n\t\t{ // new object, find referring container\n\t\t}\n\t}",
"public function getReference()\n {\n }",
"public function getReference() {\n }",
"public function readUnshared()\n {\n // If nested read, passHandle contains handle of enclosing object.\n $outerHandle = $this->passHandle;\n try {\n $obj = $this->readObject0(true);\n $this->handles->markDependency($outerHandle, $this->passHandle);\n $ex = $this->handles->lookupException($this->passHandle);\n if ($ex != null) {\n throw $ex;\n }\n return $obj;\n } finally {\n $this->passHandle = $outerHandle;\n if ($this->closed && $this->depth == 0) {\n $this->clear();\n }\n }\n }",
"public function processSoftReferences() {}",
"#[@test]\n public function derefOfRef() {\n $object= new Object();\n $r= ref($object);\n $this->assertReference($object, deref($r));\n }",
"public function resolveReference($data)\n\t{\n\t\tif (empty($data['$ref']) || empty($data['$id'])) return null;\n\t\tif (is_string($data['$id'])) $data['$id'] = new MongoId($data['$id']);\n\t\t$config = array('collection'=>$data['$ref']);\n\t\t$data = MongoDBRef::get(static::getMongoDB(false), $data);\n\t\tif ($data['_type']) {\n\t\t\t$className = $this->getClassForType($data['_type']);\n\t\t\treturn new $className($data, $config);\n\t\t} else {\n\t\t\treturn new Shanty_Mongo_Document($data, $config);\n\t\t}\n\t}",
"public function testUpdateReference()\n {\n $referenced1 = $this->session->getNode('/tests_general_base/emptyExample');\n $referenced1->addMixin('mix:referenceable');\n $this->session->save();\n\n // Load a referenceable node\n $referenced2 = $this->session->getNode('/tests_general_base/idExample');\n\n // Reference it from another node\n $source_node = $this->session->getNode('/tests_general_base/index.txt/jcr:content');\n\n $source_node->setProperty('reference', $referenced1, \\PHPCR\\PropertyType::WEAKREFERENCE);\n $this->session->save();\n $source_node->setProperty('reference', $referenced2, \\PHPCR\\PropertyType::WEAKREFERENCE);\n $this->session->save();\n $this->assertSame($referenced2, $source_node->getPropertyValue('reference'));\n\n $session = $this->renewSession();\n $referenced2 = $session->getNode('/tests_general_base/idExample');\n $this->assertSame($referenced2, $session->getProperty('/tests_general_base/index.txt/jcr:content/reference')->getValue());\n }",
"public function readObject();",
"private function resolveRef(\\stdClass $schema)\n {\n if (!property_exists($schema, '$ref') || strlen($schema->{'$ref'}) == 0) return $schema;\n $ref = $schema->{'$ref'};\n if ($ref[0] != '#')\n {\n $original = trim(file_get_contents($ref));\n $new = json_decode($original);\n if ($new === null && strtolower($original) != 'null') throw new Core\\Exception($this, 'ERR_VALIDATOR_JSON_12', $ref);\n }\n else\n {\n $ref = explode('/', $ref);\n array_shift($ref);\n $new = $this->rootSchema;\n foreach ($ref as $property) $new = $new->{$property};\n }\n return $new;\n }",
"public function resolveIndirectObject($objectId, $generation = 0, $cache = true) {}",
"private function loadExternalRef($reference)\n {\n list($prefix, $path) = parse_external_ref($reference);\n return $this->loaderManager->getLoader($prefix)->load($path);\n }",
"public function testReferenceOnNewlyReferenceableNode()\n {\n // Load a non-referenceable node and make it referenceable\n $referenced_node = $this->session->getNode('/tests_general_base/emptyExample');\n $referenced_node->addMixin('mix:referenceable');\n\n // Re-read the node to be sure it has a UUID\n $this->saveAndRenewSession();\n $referenced_node = $this->session->getNode('/tests_general_base/emptyExample');\n\n // Reference it from another node\n $source_node = $this->session->getNode('/tests_general_base/index.txt/jcr:content');\n $source_node->setProperty('reference', $referenced_node, \\PHPCR\\PropertyType::WEAKREFERENCE);\n\n $this->session->save();\n\n $this->assertInstanceOf('PHPCR\\NodeInterface', $source_node->getPropertyValue('reference'));\n\n // referrers only required to work once save happened\n $this->assertCount(0, $referenced_node->getReferences());\n $this->assertCount(1, $referenced_node->getWeakReferences());\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns a simple array of term (in numeric form) of all terms after the 'current' term. | public function getFutureTerms()
{
$objs = self::getTerms();
$currTerm = self::getCurrentTerm();
$terms = array();
foreach($objs as $t) {
if($t->term > $currTerm) {
$terms[] = $t->term;
}
}
return $terms;
} | [
"public function getCurrentTerms(): array\n\t{\n\t\treturn $this->_current_terms;\n\t}",
"function walkArithmeticTerm($term);",
"public function subtractTerms($initialTerm, $numTerms)\n {\n $finalTerm = $initialTerm;\n $loops = 0;\n\n while ($numTerms > 0) {\n $finalTerm--;\n if ($finalTerm == 0) {\n $loops++;\n $finalTerm = 4;\n }\n $numTerms--;\n }\n\n return array(\n $finalTerm,\n $loops,\n );\n }",
"public function terms(): array\n {\n return $this->root_group->allTerms();\n }",
"function getNextTerm() {\n\tstatic $terms;\n\t\n\t// Check if the terms have been loaded. If not, load them by \n\t// loading the PHP file with the global $terms array defined.\n\tif (!$terms) {\n\t\t\trequire_once(dirname(__FILE__).\"/banweb_terms.php\");\n\t\t\tif (!$terms) {\n\t\t\t\t\t$terms = array();\n\t\t\t}\n\t}\n\t\n\t// pops the front term off of the list of terms, and returns that term\n\tif (count($terms) > 0) {\n\t\t\t$retval = $terms[0];\n\t\t\t$newterms = array();\n\t\t\tfor ($i = 1; $i < count($terms); $i++) {\n\t\t\t\t\t$newterms[] = $terms[$i];\n\t\t\t}\n\t\t\t$terms = $newterms;\n\t} else {\n\t\t\t$retval = NULL;\n\t}\n\t\n\treturn $retval;\n}",
"public function build_basic_terms_array() {\n $term_values = array();\n $term_identifier = $this->term_identifier;\n\n foreach ($this->elements as $term) {\n $term_values[$term->$term_identifier] = $term->name;\n }\n\n return $term_values;\n }",
"private function getCurrentTerm(){\n // SET THE CURRENT TERM BASED ON TODAY'S DATE\n $month=date(\"n\");\n $day=date(\"j\");\n\n // FIRST 4 MONTHS ARE SPRING TERM\n if ($month <= 4) { $termmonth=1; }\n // SPLIT MAY INTO SPRING AND SUMMER I TERMS\n elseif ($month == 5 && $day <= 15) { $termmonth=1; }\n elseif ($month == 5 && $day > 15) { $termmonth=6; }\n // SPLIT JUNE INTO SUMMER I AND SUMMER II TERMS\n elseif ($month == 6 && $day <= 25) { $termmonth=6; }\n elseif ($month == 6 && $day > 25) { $termmonth=7; }\n // ALL OF JULY IS SUMMER II TERM\n elseif ($month == 7) { $termmonth=7; }\n // REMAINING MONTHS ARE FALL TERM\n else { $termmonth=8; }\n\n return $term=2 . date(\"y\") . $termmonth;\n }",
"function reduce_70_unary_term_8($tokens, &$result) {\n $result = reset($tokens);\n\n $result = new Node('term');\n $result->sub = 'freq';\n $result->value = $tokens[0];\n }",
"function getActiveTerms()\n\t{\n\t\t$data = array();\n\t\t$sql = \"begin :cursorvar := gb_integ_config.f_query_all(p_sqpr_code => :sqpr_code,p_icsn_code => :icsn_code); end;\";\n\t\tif($results = $this->db->ExecuteCursor($sql, 'cursorvar', array('sqpr_code'=>'ELEARNING','icsn_code'=>'ACTIVE_TERM')))\n\t\t{\n\t\t\twhile($row = $results->FetchRow())\n\t\t\t{\n\t\t\t\t$row = PSUTools::cleanKeys('goriccr_','r_',$row);\n\t\t\t\t\n\t\t\t\t$data[] = $row['r_value'];\n\t\t\t}//end while\n\t\t}//end if\n\t\t\n\t\treturn $data;\n\t}",
"protected function _getFolksaurusTermArray()\n {\n $termArray = array(\n 'id' => self::FOO_FOLK_ID,\n 'name' => 'Foo',\n 'scope_note' => 'A term',\n 'broader' => array(),\n 'narrower' => array(),\n 'related' => array(),\n 'used_for' => array(),\n 'use' => array(),\n 'app_id' => $this->_fooTermId,\n 'last_retrieved' => strtotime('0000-00-00 UTC')\n );\n return $termArray;\n }",
"function getActiveTerms()\n\t{\n\t\t$data = array();\n\t\t$sql = \"begin :cursorvar := gb_integ_config.f_query_all(p_sqpr_code => :sqpr_code,p_icsn_code => :icsn_code); end;\";\n\t\tif($results = $this->_ADOdb->ExecuteCursor($sql, 'cursorvar', array('sqpr_code'=>'ELEARNING','icsn_code'=>'ACTIVE_TERM')))\n\t\t{\n\t\t\twhile($row = $results->FetchRow())\n\t\t\t{\n\t\t\t\t$row = PSUTools::cleanKeys('goriccr_','r_',$row);\n\t\t\t\t\n\t\t\t\t$data[] = $row['r_value'];\n\t\t\t}//end while\n\t\t}//end if\n\t\t\n\t\treturn $data;\n\t}",
"public function terms() {\n\t\treturn $this->terms->terms();\n\t}",
"public function terms(){ return $this->nodes; }",
"public function getTermFunction();",
"function return_term_array($search_term)\n {\n $terms=array();\n $prepositions_conjunctions=array(\"in addition to\",\"in front of\",\"rather than\",\"as if\",\"as long as\",\"as though\",\"according to\",\"because of\",\"by way of\",\"in place of\",\"in regard to\",\"in spite of\",\"instead of\",\"on account of\",\"even if\",\"even though\",\"if\",\"if only\",\"in order that\",\"now that\",\"throughout\",\"whenever\",\"when\",\"wherever\",\"although\",\"whereas\",\"where\",\"while\",\"about\",\"above\",\"across\",\"after\",\"against\",\"around\",\"before\",\"behind\",\"below\",\"beneath\",\"besides\",\"beside\",\"between\",\"beyond\",\"by\",\"down\",\"during\",\"except\",\"from\",\"inside\",\"into\",\"like\",\"near\",\"off\",\"outside\",\"over\",\"since\",\"through\",\"till\",\"toward\",\"under\",\"until\",\"upon\",\"with\",\"without\",\"because\",\"before\",\"once\",\"since\",\"than\",\"though\",\"unless\",\"until\",\"and\",\"but\",\"or\",\"yet\",\"that\",\"at\",\"for\",\"nor\",\"in\",\"of\",\"for\",\"to\",\"so\",\"on\",\"up\",\"out\",\"as\");\n $punctuation=array(\",\",\".\",\"/\");\n //sets search temrm to lower case for comparison\n $search_term=strtolower($search_term);\n //converts punctuation that may be used to separate into spaces\n $search_term=str_replace($punctuation,\" \",$search_term);\n //explodes the string into an array, broken on space between terms\n $terms_unstripped=explode(\" \",$search_term);\n //removes prepositions and conjunctions\n $terms=array_diff($terms_unstripped,$prepositions_conjunctions);\n return $terms;\n }",
"function current_symbols(){\n\t\treturn $this->get_symbols( $this->i );\n\t}",
"public function getCurrentTerm() {\n return \\Drupal::routeMatch()->getParameter('taxonomy_term');\n }",
"public function nextTerm();",
"public function get_terms()\n\t{\n\t\treturn $this->terms;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the 'session.storage.native' service. This service is shared. This method always returns the same instance of the service. | protected function getSession_Storage_NativeService()
{
return $this->services['session.storage.native'] = new \Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage(array(), $this->get('session.handler'));
} | [
"protected function getSession_Storage_NativeService()\n {\n return $this->services['session.storage.native'] = new \\Symfony\\Component\\HttpFoundation\\Session\\Storage\\NativeSessionStorage(array(), NULL, $this->get('session.storage.metadata_bag'));\n }",
"protected function getSession_Storage_NativeService()\n {\n return $this->services['session.storage.native'] = new \\Symfony\\Component\\HttpFoundation\\Session\\Storage\\NativeSessionStorage(array('cookie_httponly' => true, 'gc_probability' => 1), NULL, $this->get('session.storage.metadata_bag'));\n }",
"protected function getSession_Storage_NativeService()\n {\n return $this->services['session.storage.native'] = new \\Symfony\\Component\\HttpFoundation\\Session\\Storage\\NativeSessionStorage(array('cookie_httponly' => true, 'gc_probability' => 1), $this->get('session.handler'), $this->get('session.storage.metadata_bag'));\n }",
"protected function getSession_Storage_NativeService()\n {\n return $this->services['session.storage.native'] = new \\Symfony\\Component\\HttpFoundation\\Session\\Storage\\NativeSessionStorage(array('cookie_httponly' => true, 'gc_probability' => 1), ${($_ = isset($this->services['session.handler']) ? $this->services['session.handler'] : $this->get('session.handler')) && false ?: '_'}, ${($_ = isset($this->services['session.storage.metadata_bag']) ? $this->services['session.storage.metadata_bag'] : $this->getSession_Storage_MetadataBagService()) && false ?: '_'});\n }",
"protected function getSession_Storage_NativeService()\n {\n return $this->privates['session.storage.native'] = new \\Symfony\\Component\\HttpFoundation\\Session\\Storage\\NativeSessionStorage($this->parameters['session.storage.options'], NULL, new \\Symfony\\Component\\HttpFoundation\\Session\\Storage\\MetadataBag('_sf2_meta', 0));\n }",
"protected function getSession_Storage_PhpBridgeService()\n {\n return $this->services['session.storage.php_bridge'] = new \\Symfony\\Component\\HttpFoundation\\Session\\Storage\\PhpBridgeSessionStorage(NULL, $this->get('session.storage.metadata_bag'));\n }",
"protected function getSession_Storage_PhpBridgeService()\n {\n return $this->services['session.storage.php_bridge'] = new \\Symfony\\Component\\HttpFoundation\\Session\\Storage\\PhpBridgeSessionStorage($this->get('session.handler'));\n }",
"protected function getSession_Storage_PhpBridgeService()\n {\n return $this->services['session.storage.php_bridge'] = new \\Symfony\\Component\\HttpFoundation\\Session\\Storage\\PhpBridgeSessionStorage(NULL, ${($_ = isset($this->services['session.storage.metadata_bag']) ? $this->services['session.storage.metadata_bag'] : $this->getSession_Storage_MetadataBagService()) && false ?: '_'});\n }",
"protected function getSession_Storage_PhpBridgeService()\n {\n return $this->services['session.storage.php_bridge'] = new \\Symfony\\Component\\HttpFoundation\\Session\\Storage\\PhpBridgeSessionStorage(${($_ = isset($this->services['session.handler']) ? $this->services['session.handler'] : $this->get('session.handler')) && false ?: '_'}, ${($_ = isset($this->services['session.storage.metadata_bag']) ? $this->services['session.storage.metadata_bag'] : $this->getSession_Storage_MetadataBagService()) && false ?: '_'});\n }",
"public function session_storage()\n {\n return Storage::factory('session', $this->url . '/session_storage');\n }",
"protected function getSession_HandlerService()\n {\n return $this->services['session.handler'] = new \\Symfony\\Component\\HttpFoundation\\Session\\Storage\\Handler\\NativeFileSessionHandler('/Users/pete.robinson/Sites/wam/image/tests/SupportFiles/app/../../../tmp/cache/sessions');\n }",
"protected function getSessionService()\n {\n return $this->services['session'] = new \\Symfony\\Component\\HttpFoundation\\Session\\Session(${($_ = isset($this->services['session.storage.native']) ? $this->services['session.storage.native'] : $this->get('session.storage.native')) && false ?: '_'}, new \\Symfony\\Component\\HttpFoundation\\Session\\Attribute\\AttributeBag(), new \\Symfony\\Component\\HttpFoundation\\Session\\Flash\\FlashBag());\n }",
"private function getSessionStorage(): Storage\n {\n /** @var Storage $storage */\n $storage = $this->storage;\n return $storage;\n }",
"private function getStorage()\n {\n if (null === $this->_storage) {\n $this->setStorage(new SKL_Oauth_Storage_Session());\n }\n\n return $this->_storage;\n }",
"public function getSessionStorage()\n {\n if ($this->SessionStorage !== null) {\n return $this->SessionStorage;\n }\n\n $storageClass = \"{$this->storageAdapter}\\\\Session\";\n \n return new $storageClass($this->database);\n }",
"public function getStorage()\n {\n if (!$this->storage) {\n $this->storage = new SessionStorage($this);\n }\n\n return $this->storage;\n }",
"protected function getSession_HandlerService()\n {\n return $this->services['session.handler'] = new \\Symfony\\Component\\HttpFoundation\\Session\\Storage\\Handler\\NativeFileSessionHandler(($this->targetDirs[2].'/../var/sessions/dev'));\n }",
"public function getSessionStorage()\n {\n if (! $this->storage) {\n $this->storage = $this->getServiceLocator()\n ->get('Application\\Event\\MyAuthStorage');\n }\n return $this->storage;\n }",
"protected function getSessionService()\n {\n return $this->services['session'] = new \\Symfony\\Component\\HttpFoundation\\Session\\Session($this->get('session.storage.native'), new \\Symfony\\Component\\HttpFoundation\\Session\\Attribute\\AttributeBag(), new \\Symfony\\Component\\HttpFoundation\\Session\\Flash\\FlashBag());\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/Getters and setters Set one of the amazonrecognised custom HTTP headers. The supplied key is automatically prefixed with 'xamz' | public function setAmzHeader($key, $value) {
$this->amz_headers[self::AMZ_HEADER_PREFIX.$key] = $value;
} | [
"function setRequestHeader($key, $value);",
"function setCustomHeader($name, $value);",
"public static function set_res_header($key, $value) { self::$res_http_headers[$key] = $value; }",
"public static function setTrustedHeaderName($key, $value);",
"abstract public function alterHeaders();",
"public function addHeader($key, $value);",
"protected function setCurlHTTPRequestHeaders() {\n $idxed_headers = array();\n foreach ($this->headers as $name => $value) {\n $idxed_headers[] = \"$name: $value\";\n }\n \n curl_setopt($this->curl, CURLOPT_HTTPHEADER, $idxed_headers);\n }",
"protected function set_headers() {\n\t\t$this->args['headers'] = array(\n\t\t'Authorization' => 'Bearer ' . $this->access_token,\n\t\t'Harvest-Account-Id' => $this->account_id,\n\t\t'User-Agent' => $this->application . ' (' . $this->user_agent . ')',\n\t\t'Content-Type' => 'application/json',\n\t\t);\n\t}",
"function add_header($key, $value) {\n\t\tif (! is_null($value)) {\n\t\t\t$this->headers[$key] = $value;\n\t\t}\n\t}",
"protected function set_headers() {\n // $this->args['headers'] = array(\n // 'Authorization' => 'Bearer ' . $this->api_key,\n // 'Content-Type' => 'application/json'\n // );\n }",
"public function setHeaders() {\n }",
"public function setHeaders()\n {\n }",
"public function testCanSetAnAdditionalRequestHeader() {\n $this->assertSame($this->driver, $this->driver->setRequestHeader('Header', 'value'));\n $url = $this->testUrl . '?headers';\n $response = $this->driver->get($url);\n $headers = unserialize($response->getBody());\n\n $this->assertArrayHasKey('HTTP_HEADER', $headers);\n $this->assertSame('value', $headers['HTTP_HEADER']);\n }",
"public function setHeader($name, $value);",
"public function modifyHeader($key, $value): void\n {\n $this->setNestedProperty(\"header.{$key}\", $value);\n }",
"protected function set_request_headers() {\n\t\t$headers = array();\n\t\tforeach ($this->headers as $key => $value) {\n\t\t\t$headers[] = $key.': '.$value;\n\t\t}\n\t\tcurl_setopt($this->request, CURLOPT_HTTPHEADER, $headers);\n\t}",
"public static function setTrustedHeaderName($key, $value)\n {\n }",
"public function getHeader($key);",
"protected function set_request_headers() {\n $headers = array();\n foreach ($this->headers as $key => $value) {\n $headers[] = $key.': '.$value;\n }\n curl_setopt($this->request, CURLOPT_HTTPHEADER, $headers);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Operation flightBookingConfirmaitonWithHttpInfo confirm flight booking | public function flightBookingConfirmaitonWithHttpInfo($body = null)
{
$returnType = '\Swagger\Client\Model\FlightBookingResponse';
$request = $this->flightBookingConfirmaitonRequest($body);
try {
$options = $this->createHttpClientOption();
try {
$response = $this->client->send($request, $options);
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
$e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
$e->getResponse() ? $e->getResponse()->getBody()->getContents() : null
);
}
$statusCode = $response->getStatusCode();
if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
$request->getUri()
),
$statusCode,
$response->getHeaders(),
$response->getBody()
);
}
$responseBody = $response->getBody();
if ($returnType === '\SplFileObject') {
$content = $responseBody; //stream goes to serializer
} else {
$content = $responseBody->getContents();
if (!in_array($returnType, ['string','integer','bool'])) {
$content = json_decode($content);
}
}
return [
ObjectSerializer::deserialize($content, $returnType, []),
$response->getStatusCode(),
$response->getHeaders()
];
} catch (ApiException $e) {
switch ($e->getCode()) {
case 200:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
'\Swagger\Client\Model\FlightBookingResponse',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
break;
case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
'\Swagger\Client\Model\AlgebratecResponse',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
break;
case 401:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
'\Swagger\Client\Model\AlgebratecResponse',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
break;
}
throw $e;
}
} | [
"public function flightBookingConfirmaiton($body = null)\n {\n list($response) = $this->flightBookingConfirmaitonWithHttpInfo($body);\n return $response;\n }",
"public function flightBookingConfirmaitonAsyncWithHttpInfo($body = null)\n {\n $returnType = '\\Swagger\\Client\\Model\\FlightBookingResponse';\n $request = $this->flightBookingConfirmaitonRequest($body);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"protected function flightOnHoldBookingConfirmationRequest($booking_id)\n {\n // verify the required parameter 'booking_id' is set\n if ($booking_id === null || (is_array($booking_id) && count($booking_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $booking_id when calling flightOnHoldBookingConfirmation'\n );\n }\n\n $resourcePath = '/v1/flight/booking/confirmOnHoldBooking/{bookingId}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($booking_id !== null) {\n $resourcePath = str_replace(\n '{' . 'bookingId' . '}',\n ObjectSerializer::toPathValue($booking_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('X-AUTHORIZATION');\n if ($apiKey !== null) {\n $headers['X-AUTHORIZATION'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"function save_flight_booking_itinerary_details(\r\n\t$app_reference, $segment_indicator, $airline_code, $airline_name, $flight_number, $fare_class, $from_airport_code, $from_airport_name,\r\n\t$to_airport_code, $to_airport_name, $departure_datetime, $arrival_datetime, $status, $operating_carrier, $attributes,\r\n\t$FareRestriction, $FareBasisCode, $FareRuleDetail, $airline_pnr, $cabin_baggage, $checkin_baggage, $is_refundable)\r\n\t{\r\n\t\t$data['app_reference'] = $app_reference;\r\n\t\t$data['segment_indicator'] = $segment_indicator;\r\n\t\t$data['airline_code'] = $airline_code;\r\n\t\t$data['airline_name'] = $airline_name;\r\n\t\t$data['flight_number'] = $flight_number;\r\n\t\t$data['fare_class'] = $fare_class;\r\n\t\t$data['from_airport_code'] = $from_airport_code;\r\n\t\t$data['from_airport_name'] = $from_airport_name;\r\n\t\t$data['to_airport_code'] = $to_airport_code;\r\n\t\t$data['to_airport_name'] = $to_airport_name;\r\n\t\t$data['departure_datetime'] = $departure_datetime;\r\n\t\t$data['arrival_datetime'] = $arrival_datetime;\r\n\t\t$data['status'] = $status;\r\n\t\t$data['operating_carrier'] = $operating_carrier;\r\n\t\t$data['attributes'] = $attributes;\r\n\t\t$data['FareRestriction'] = $FareRestriction;\r\n\t\t$data['FareBasisCode'] = $FareBasisCode;\r\n\t\t$data['FareRuleDetail'] = $FareRuleDetail;\r\n\t\t$data['cabin_baggage'] = $cabin_baggage;\r\n\t\t$data['checkin_baggage'] = $checkin_baggage;\r\n\t\t$data['is_refundable'] = $is_refundable;\r\n\t\t$data['airline_pnr'] = $airline_pnr;\r\n\t\t\r\n\t\t$this->custom_db->insert_record('flight_booking_itinerary_details', $data);\r\n\t}",
"public function bookingConfirmationCustomer($params)\n {\n $this->logger->info(\"send booking confimation to customer\");\n $options['subject'] = \"Your SkedApp booking confirmation\";\n\n $booking = $params['booking'];\n\n $tmp = array(\n 'user' => $booking->getCustomer(),\n 'consultant' => $booking->getConsultant(),\n 'provider' => $booking->getConsultant()->getCompany(),\n 'service' => $booking->getService(),\n 'date' => $booking->getHiddenAppointmentStartTime()->format(\"Y-m-d H:i\"),\n 'company' => $booking->getConsultant()->getCompany()\n );\n\n $emailBodyHtml = $this->template->render(\n 'SkedAppCoreBundle:EmailTemplates:booking.confirmed.customer.html.twig', $tmp\n );\n\n $emailBodyTxt = $this->template->render(\n 'SkedAppCoreBundle:EmailTemplates:booking.confirmed.customer.txt.twig', $tmp\n );\n\n $options['bodyHTML'] = $emailBodyHtml;\n $options['bodyTEXT'] = $emailBodyTxt;\n $options['email'] = $booking->getCustomer()->getEmail();\n $options['fullName'] = $tmp['user']->getFullName();\n\n if ( (isset($params['attachments_data'])) && (count($params['attachments_data']) > 0) )\n $options['attachments_data'] = $params['attachments_data'];\n\n $this->sendMail($options);\n return;\n }",
"public function flightOnHoldBookingConfirmation($booking_id)\n {\n list($response) = $this->flightOnHoldBookingConfirmationWithHttpInfo($booking_id);\n return $response;\n }",
"public function withdrawalRequest() {\n\n $result = array();\n $data = array();\n\n $data['fj_stts'] = 7; // withdrawal requested status\n $fjId = $_POST['fjId'];\n\n // update maijiu status to withdrawal status.\n $ret = $this->fujin->update($data, $fjId);\n\n Common::sendSMS(\"fj_\".$fjId);\n\n if ($ret == true ) {\n // here send sms to xiaoer\n $result['status'] = $ret;\n $result['data'] = 'success';\n }\n else {\n $result['status'] = $ret;\n $result['data'] = 'updating db failed';\n }\n\n echo json_encode($result);\n }",
"public function setApfmctry($v)\n {\n if ($v !== null) {\n $v = (string) $v;\n }\n\n if ($this->apfmctry !== $v) {\n $this->apfmctry = $v;\n $this->modifiedColumns[VendorShipfromTableMap::COL_APFMCTRY] = true;\n }\n\n return $this;\n }",
"public function userConfirmWithdrawalWithHttpInfo($token)\n {\n // verify the required parameter 'token' is set\n if ($token === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $token when calling userConfirmWithdrawal');\n }\n // parse inputs\n $resourcePath = \"/user/confirmWithdrawal\";\n $httpBody = '';\n $queryParams = array();\n $headerParams = array();\n $formParams = array();\n $_header_accept = $this->apiClient->selectHeaderAccept(array('application/json', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript'));\n if (!is_null($_header_accept)) {\n $headerParams['Accept'] = $_header_accept;\n }\n $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array('application/json','application/x-www-form-urlencoded'));\n\n // default format to json\n $resourcePath = str_replace(\"{format}\", \"json\", $resourcePath);\n\n // form params\n if ($token !== null) {\n $formParams['token'] = $this->apiClient->getSerializer()->toFormValue($token);\n }\n \n // for model (json/xml)\n if (isset($_tempBody)) {\n $httpBody = $_tempBody; // $_tempBody is the method argument, if present\n } elseif (count($formParams) > 0) {\n $httpBody = $formParams; // for HTTP post (form)\n }\n // make the API Call\n try {\n list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(\n $resourcePath,\n 'POST',\n $queryParams,\n $httpBody,\n $headerParams,\n '\\Swagger\\Client\\Model\\Transaction',\n '/user/confirmWithdrawal'\n );\n\n return array($this->apiClient->getSerializer()->deserialize($response, '\\Swagger\\Client\\Model\\Transaction', $httpHeader), $statusCode, $httpHeader);\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\\Swagger\\Client\\Model\\Transaction', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n }\n\n throw $e;\n }\n }",
"public function crceTariffActivatePlanWithHttpInfo($customer_account_id, $subscription_id, $tariff_plan_id, $correlation_id = null, $pin = null, $transaction_id = null, $user = null, $opp_id = null, $definition = null)\n {\n // verify the required parameter 'customer_account_id' is set\n if ($customer_account_id === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $customer_account_id when calling crceTariffActivatePlan');\n }\n // verify the required parameter 'subscription_id' is set\n if ($subscription_id === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $subscription_id when calling crceTariffActivatePlan');\n }\n // verify the required parameter 'tariff_plan_id' is set\n if ($tariff_plan_id === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $tariff_plan_id when calling crceTariffActivatePlan');\n }\n // parse inputs\n $resourcePath = \"/customers/{customerAccountId}/subscriptions/{subscriptionId}/availablePlans/{tariffPlanId}/activate\";\n $httpBody = '';\n $queryParams = [];\n $headerParams = [];\n $formParams = [];\n $_header_accept = $this->apiClient->selectHeaderAccept(['application/json']);\n if (!is_null($_header_accept)) {\n $headerParams['Accept'] = $_header_accept;\n }\n $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(['application/json']);\n\n // query params\n if ($opp_id !== null) {\n $queryParams['oppId'] = $this->apiClient->getSerializer()->toQueryValue($opp_id);\n }\n // header params\n if ($correlation_id !== null) {\n $headerParams['correlationId'] = $this->apiClient->getSerializer()->toHeaderValue($correlation_id);\n }\n // header params\n if ($pin !== null) {\n $headerParams['pin'] = $this->apiClient->getSerializer()->toHeaderValue($pin);\n }\n // header params\n if ($transaction_id !== null) {\n $headerParams['transactionId'] = $this->apiClient->getSerializer()->toHeaderValue($transaction_id);\n }\n // header params\n if ($user !== null) {\n $headerParams['user'] = $this->apiClient->getSerializer()->toHeaderValue($user);\n }\n // path params\n if ($customer_account_id !== null) {\n $resourcePath = str_replace(\n \"{\" . \"customerAccountId\" . \"}\",\n $this->apiClient->getSerializer()->toPathValue($customer_account_id),\n $resourcePath\n );\n }\n // path params\n if ($subscription_id !== null) {\n $resourcePath = str_replace(\n \"{\" . \"subscriptionId\" . \"}\",\n $this->apiClient->getSerializer()->toPathValue($subscription_id),\n $resourcePath\n );\n }\n // path params\n if ($tariff_plan_id !== null) {\n $resourcePath = str_replace(\n \"{\" . \"tariffPlanId\" . \"}\",\n $this->apiClient->getSerializer()->toPathValue($tariff_plan_id),\n $resourcePath\n );\n }\n // default format to json\n $resourcePath = str_replace(\"{format}\", \"json\", $resourcePath);\n\n // body params\n $_tempBody = null;\n if (isset($definition)) {\n $_tempBody = $definition;\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n $httpBody = $_tempBody; // $_tempBody is the method argument, if present\n } elseif (count($formParams) > 0) {\n $httpBody = $formParams; // for HTTP post (form)\n }\n // this endpoint requires API key authentication\n $apiKey = $this->apiClient->getApiKeyWithPrefix('accessKey');\n if (strlen($apiKey) !== 0) {\n $headerParams['accessKey'] = $apiKey;\n }\n // make the API Call\n try {\n list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(\n $resourcePath,\n 'POST',\n $queryParams,\n $httpBody,\n $headerParams,\n '\\iNew\\Rest6_1\\Model\\ActivatePlanResponse',\n '/customers/{customerAccountId}/subscriptions/{subscriptionId}/availablePlans/{tariffPlanId}/activate'\n );\n\n return [$this->apiClient->getSerializer()->deserialize($response, '\\iNew\\Rest6_1\\Model\\ActivatePlanResponse', $httpHeader), $statusCode, $httpHeader];\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\\iNew\\Rest6_1\\Model\\ActivatePlanResponse', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n case 400:\n $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\\iNew\\Rest6_1\\Model\\RestError', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n case 500:\n $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\\iNew\\Rest6_1\\Model\\RestError', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n }\n\n throw $e;\n }\n }",
"protected function updateApprovedKpoAndGenerateConfirmationAsCarrierRequest($request = null)\n {\n\n $resourcePath = '/WasteRegister/WasteTransferCard/v1/Kpo/carrier/update/approved/generateconfirmation';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\n if (isset($request)) {\n $_tempBody = $request;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n \n if($headers['Content-Type'] === 'application/json') {\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n // array has no __toString(), so we should encode it manually\n if(is_array($httpBody)) {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));\n }\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'PUT',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function userConfirmWithdrawalWithHttpInfo($token)\n {\n $returnType = '\\Swagger\\Client\\Model\\Transaction';\n $request = $this->userConfirmWithdrawalRequest($token);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Swagger\\Client\\Model\\Transaction',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"protected function flightFareRulesRequest($body = null)\n {\n\n $resourcePath = '/v1/flight/booking/fareRules';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\n if (isset($body)) {\n $_tempBody = $body;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('X-AUTHORIZATION');\n if ($apiKey !== null) {\n $headers['X-AUTHORIZATION'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function crceTariffActivatePlanSubscriptionWithHttpInfo($subscription_id, $tariff_plan_id, $correlation_id = null, $pin = null, $transaction_id = null, $user = null, $opp_id = null, $definition = null)\n {\n // verify the required parameter 'subscription_id' is set\n if ($subscription_id === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $subscription_id when calling crceTariffActivatePlanSubscription');\n }\n // verify the required parameter 'tariff_plan_id' is set\n if ($tariff_plan_id === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $tariff_plan_id when calling crceTariffActivatePlanSubscription');\n }\n // parse inputs\n $resourcePath = \"/subscriptions/{subscriptionId}/availablePlans/{tariffPlanId}/activate\";\n $httpBody = '';\n $queryParams = [];\n $headerParams = [];\n $formParams = [];\n $_header_accept = $this->apiClient->selectHeaderAccept(['application/json']);\n if (!is_null($_header_accept)) {\n $headerParams['Accept'] = $_header_accept;\n }\n $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(['application/json']);\n\n // query params\n if ($opp_id !== null) {\n $queryParams['oppId'] = $this->apiClient->getSerializer()->toQueryValue($opp_id);\n }\n // header params\n if ($correlation_id !== null) {\n $headerParams['correlationId'] = $this->apiClient->getSerializer()->toHeaderValue($correlation_id);\n }\n // header params\n if ($pin !== null) {\n $headerParams['pin'] = $this->apiClient->getSerializer()->toHeaderValue($pin);\n }\n // header params\n if ($transaction_id !== null) {\n $headerParams['transactionId'] = $this->apiClient->getSerializer()->toHeaderValue($transaction_id);\n }\n // header params\n if ($user !== null) {\n $headerParams['user'] = $this->apiClient->getSerializer()->toHeaderValue($user);\n }\n // path params\n if ($subscription_id !== null) {\n $resourcePath = str_replace(\n \"{\" . \"subscriptionId\" . \"}\",\n $this->apiClient->getSerializer()->toPathValue($subscription_id),\n $resourcePath\n );\n }\n // path params\n if ($tariff_plan_id !== null) {\n $resourcePath = str_replace(\n \"{\" . \"tariffPlanId\" . \"}\",\n $this->apiClient->getSerializer()->toPathValue($tariff_plan_id),\n $resourcePath\n );\n }\n // default format to json\n $resourcePath = str_replace(\"{format}\", \"json\", $resourcePath);\n\n // body params\n $_tempBody = null;\n if (isset($definition)) {\n $_tempBody = $definition;\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n $httpBody = $_tempBody; // $_tempBody is the method argument, if present\n } elseif (count($formParams) > 0) {\n $httpBody = $formParams; // for HTTP post (form)\n }\n // this endpoint requires API key authentication\n $apiKey = $this->apiClient->getApiKeyWithPrefix('accessKey');\n if (strlen($apiKey) !== 0) {\n $headerParams['accessKey'] = $apiKey;\n }\n // make the API Call\n try {\n list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(\n $resourcePath,\n 'POST',\n $queryParams,\n $httpBody,\n $headerParams,\n '\\iNew\\Rest6_1\\Model\\ActivatePlanResponse',\n '/subscriptions/{subscriptionId}/availablePlans/{tariffPlanId}/activate'\n );\n\n return [$this->apiClient->getSerializer()->deserialize($response, '\\iNew\\Rest6_1\\Model\\ActivatePlanResponse', $httpHeader), $statusCode, $httpHeader];\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\\iNew\\Rest6_1\\Model\\ActivatePlanResponse', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n case 400:\n $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\\iNew\\Rest6_1\\Model\\RestError', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n case 500:\n $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\\iNew\\Rest6_1\\Model\\RestError', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n }\n\n throw $e;\n }\n }",
"public function confirmBooking()\n {\n // Call booking confirmation node\n $conf = \\tabs\\api\\client\\ApiClient::getApi()->put(\n \"/booking/{$this->getBookingId()}/confirmation\",\n array(\n 'data' => json_encode(array('status' => true))\n )\n );\n\n if ($conf && $conf->status == 200) {\n\n // Set the object confirmation to be true\n $this->setConfirmation(true);\n\n if (property_exists($conf->response, 'wnumber')) {\n $this->setWnumber($conf->response->wnumber);\n }\n\n return true;\n } else {\n throw new \\tabs\\api\\client\\ApiException(\n $conf,\n 'Invalid confirmation request'\n );\n }\n\n return false;\n }",
"public function deployActivateWafFirewallVersionRequest($options)\n {\n // unbox the parameters from the associative array\n $firewall_id = array_key_exists('firewall_id', $options) ? $options['firewall_id'] : null;\n $firewall_version_number = array_key_exists('firewall_version_number', $options) ? $options['firewall_version_number'] : null;\n\n // verify the required parameter 'firewall_id' is set\n if ($firewall_id === null || (is_array($firewall_id) && count($firewall_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $firewall_id when calling deployActivateWafFirewallVersion'\n );\n }\n // verify the required parameter 'firewall_version_number' is set\n if ($firewall_version_number === null || (is_array($firewall_version_number) && count($firewall_version_number) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $firewall_version_number when calling deployActivateWafFirewallVersion'\n );\n }\n\n $resourcePath = '/waf/firewalls/{firewall_id}/versions/{firewall_version_number}/activate';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($firewall_id !== null) {\n $resourcePath = str_replace(\n '{' . 'firewall_id' . '}',\n ObjectSerializer::toPathValue($firewall_id),\n $resourcePath\n );\n }\n // path params\n if ($firewall_version_number !== null) {\n $resourcePath = str_replace(\n '{' . 'firewall_version_number' . '}',\n ObjectSerializer::toPathValue($firewall_version_number),\n $resourcePath\n );\n }\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/vnd.api+json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/vnd.api+json'],\n []\n );\n }\n\n // for model (json/xml)\n if (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\Query::build($formParams);\n }\n }\n\n // this endpoint requires API token authentication\n $apiToken = $this->config->getApiTokenWithPrefix('Fastly-Key');\n if ($apiToken !== null) {\n $headers['Fastly-Key'] = $apiToken;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $operationHosts = [\"https://api.fastly.com\"];\n if ($this->hostIndex < 0 || $this->hostIndex >= sizeof($operationHosts)) {\n throw new \\InvalidArgumentException(\"Invalid index {$this->hostIndex} when selecting the host. Must be less than \".sizeof($operationHosts));\n }\n $operationHost = $operationHosts[$this->hostIndex];\n\n $query = \\GuzzleHttp\\Psr7\\Query::build($queryParams);\n return new Request(\n 'PUT',\n $operationHost . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"function update_passenger_ticket_info($passenger_fk, $TicketId, $TicketNumber, $IssueDate, $Fare, $SegmentAdditionalInfo,\r\n\t$ValidatingAirline, $CorporateCode, $TourCode, $Endorsement, $Remarks, $ServiceFeeDisplayType, $api_passenger_origin){\r\n\t\t\r\n\t\t $data['TicketId'] = $TicketId;\r\n\t\t $data['api_passenger_origin'] = $api_passenger_origin;\r\n\t\t $data['TicketNumber'] = $TicketNumber;\r\n\t\t $data['IssueDate'] = $IssueDate;\r\n\t\t $data['Fare'] = $Fare;\r\n\t\t $data['SegmentAdditionalInfo'] = $SegmentAdditionalInfo;\r\n\t\t $data['ValidatingAirline'] = $ValidatingAirline;\r\n\t\t $data['CorporateCode'] = $CorporateCode;\r\n\t\t $data['TourCode'] = $TourCode;\r\n\t\t $data['Endorsement'] = $Endorsement;\r\n\t\t $data['Remarks'] = $Remarks;\r\n\t\t $data['ServiceFeeDisplayType'] = $ServiceFeeDisplayType;\r\n\t\t $update_condtion['passenger_fk'] = $passenger_fk;\r\n\t\t $this->custom_db->update_record('flight_passenger_ticket_info', $data, $update_condtion);\r\n\t }",
"public function confirmation()\n {\n $this -> transactionType = $this -> response -> TransactionType;\n $this -> transID = $this -> response -> TransID;\n $this -> transTime = $this -> response -> TransTime;\n $this -> transAmount = $this -> response -> TransAmount;\n $this -> businessShortCode = $this -> response -> BusinessShortCode;\n $this -> billRefNumber = $this -> response -> BillRefNumber;\n $this -> invoiceNumber = $this -> response -> InvoiceNumber;\n $this -> orgAccountBalance = $this -> response -> OrgAccountBalance;\n $this -> thirdPartyTransID = $this -> response -> ThirdPartyTransID;\n $this -> phoneNumber = $this -> response -> MSISDN;\n $this -> firstName = $this -> response -> FirstName;\n $this -> middleName = $this -> response -> MiddleName;\n $this -> lastName = $this -> response -> LastName;\n }",
"protected function changeKpoStatusToTransportConfirmationRequest($request = null)\n {\n\n $resourcePath = '/WasteRegister/WasteTransferCard/v1/Kpo/status/transportconfirmation';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\n if (isset($request)) {\n $_tempBody = $request;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n \n if($headers['Content-Type'] === 'application/json') {\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n // array has no __toString(), so we should encode it manually\n if(is_array($httpBody)) {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));\n }\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'PUT',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
A SourceContext referring to a Gerrit project. Generated from protobuf field .google.devtools.source.v1.GerritSourceContext gerrit = 3; | public function getGerrit()
{
return $this->readOneof(3);
} | [
"public function setGerrit($var)\n {\n GPBUtil::checkMessage($var, \\Grafeas\\V1\\GerritSourceContext::class);\n $this->writeOneof(2, $var);\n\n return $this;\n }",
"public function getGerrit()\n {\n return $this->readOneof(2);\n }",
"public function getGcsSource()\n {\n return $this->readOneof(2);\n }",
"public function getGcsSource()\n {\n return $this->readOneof(4);\n }",
"public function setGit($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Cloud\\DevTools\\Source\\V1\\GitSourceContext::class);\n $this->writeOneof(6, $var);\n\n return $this;\n }",
"public function getGcsSource()\n {\n return $this->readOneof(1);\n }",
"public function getExampleGcsSource()\n {\n return $this->readOneof(5);\n }",
"public function getGitSource()\n {\n return $this->readOneof(5);\n }",
"public function getGcsSource()\n {\n return $this->gcs_source;\n }",
"public function setGcsSource($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Cloud\\RecommendationEngine\\V1beta1\\GcsSource::class);\n $this->writeOneof(2, $var);\n\n return $this;\n }",
"public function getRepoSource()\n {\n return $this->readOneof(2);\n }",
"public function getSourceContext()\n {\n return $this->getKey('SourceContext');\n }",
"public function setCloudRepo($var)\n {\n GPBUtil::checkMessage($var, \\Grafeas\\V1\\CloudRepoSourceContext::class);\n $this->writeOneof(1, $var);\n\n return $this;\n }",
"public function getSourceContext()\n {\n return $this->source_context;\n }",
"public function getDialogflowSource()\n {\n return $this->readOneof(3);\n }",
"public function setSourceContext($var)\n {\n GPBUtil::checkMessage($var, SourceContext::class);\n $this->source_context = $var;\n\n return $this;\n }",
"public function getResIDSourceContext()\n {\n return $this->resIDSourceContext;\n }",
"public function setCloudWorkspace($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Cloud\\DevTools\\Source\\V1\\CloudWorkspaceSourceContext::class);\n $this->writeOneof(2, $var);\n\n return $this;\n }",
"public function setSourceProjectId($var)\n {\n GPBUtil::checkString($var, True);\n $this->sourceProjectId = $var;\n\n return $this;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns an array of all registered block types. | function acf_get_block_types() {
return acf_get_store( 'block-types' )->get();
} | [
"public static function get_block_types() {\n return array();\n }",
"public function getAllBlockTypes()\n\t{\n\t\treturn blx()->components->getComponentsByType(ComponentType::Block);\n\t}",
"protected function _getSupportedBlockTypes()\n {\n return array();\n }",
"public function getBlockTypes();",
"public static function find_block_types()\n\t{\n\t\t$blocktypes =& cmsms()->blocktypes;\n\t\t\n\t\t#Load block types\n\t\t$dir = cms_join_path(ROOT_DIR,'lib','classes','blocktypes');\n\t\t$handle=opendir($dir);\n\t\twhile ($file = readdir ($handle)) \n\t\t{\n\t\t $path_parts = pathinfo($file);\n\t\t if ($path_parts['extension'] == 'php')\n\t\t {\n\t\t\t\t$obj = new CmsBlockTypePlaceholder();\n\t\t\t\t$obj->type = str_replace('block.', '', strtolower(basename($file, '.inc.php')));\n\t\t\t\t$obj->filename = cms_join_path($dir, $file);\n\t\t\t\t$obj->loaded = false;\n\t\t\t\t$obj->friendlyname = str_replace('block.', '', basename($file, '.inc.php'));\n\t\t\t\t$blocktypes[str_replace('block.', '', strtolower(basename($file, '.inc.php')))] = $obj;\n\t\t }\n\t\t}\n\t\tclosedir($handle);\n\t\t\n\t\treturn $blocktypes;\n\t}",
"public function getAllTypes(): array\n {\n return $this->types;\n }",
"public function getBlockNames() {\r\n $blks = array();\r\n $ci = & get_instance();\r\n foreach($ci as $_value) {\r\n if(is_object($_value)) {\r\n if(is_a($_value,'Block_abstract')) {\r\n $blks[] = $_value->getName();\r\n }\r\n }\r\n }\r\n return($blks);\r\n }",
"function get_allowed_block_types($block_editor_context)\n {\n }",
"public function getTypes()\n {\n $types = array();\n $defaultTypes = array(\n 'html',\n 'button',\n 'image',\n 'affiliate'\n );\n\n $allowedTypes = str_replace(' ', '', $this->modx->getOption('bendera.allowed_types'));\n if (!empty($allowedTypes)) {\n $allowedTypesArr = explode(',', $allowedTypes);\n\n foreach ($defaultTypes as $key => $type) {\n if (!in_array($type, $allowedTypesArr)) {\n unset($defaultTypes[$key]);\n }\n }\n }\n\n foreach($defaultTypes as $type) {\n $types[] = array(\n $type,\n $this->modx->lexicon('bendera.type.' . $type)\n );\n }\n\n return $types;\n }",
"public static function getAll()\r\n {\r\n return self::$typeRegistry;\r\n }",
"public function getAll() : array\n {\n return $this->types;\n }",
"public function get_types()\n\t{\n\t\t$raw = $this->get_all();\n\t\t$regions = array();\n\n\t\tforeach( $raw as $region ) {\n\t\t\t$regions[$region['id']] = $region['type'];\n\t\t}\n\n\t\treturn $regions;\n\t}",
"public function getThemeBlockClasses()\n {\n return [];\n }",
"public function getBlockDefinitions(): array\n {\n return $this->blockDefinitions;\n }",
"function get_default_block_template_types()\n {\n }",
"public function getTypes()\n {\n $types = [];\n $config = $this->_config->getTypes();\n\n foreach ($config as $type => $node) {\n $typeInstance = $this->_getTypeInstance($type);\n if ($typeInstance instanceof \\Magento\\Framework\\Cache\\Frontend\\Decorator\\TagScope) {\n $typeTags = $typeInstance->getTag();\n } else {\n $typeTags = '';\n }\n $types[$type] = new \\Magento\\Framework\\DataObject(\n [\n 'id' => $type,\n 'cache_type' => $node['label'],\n 'description' => $node['description'],\n 'tags' => $typeTags,\n 'status' => (int)$this->_cacheState->isEnabled($type),\n ]\n );\n }\n return $types;\n }",
"public function getAvailableTypes();",
"public function getRegisteredBlocks()\n\t{\n\t\treturn $this->blocks;\n\t}",
"public static function types()\n {\n return array(\n self::MEAN,\n self::MEDIAN,\n self::MODE,\n self::RANGE\n );\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the TYPO3 version as integer | public static function getVersionAsInteger()
{
if (self::$_version === null) {
self::_determineVersion();
}
return self::$_version;
} | [
"public static function getTypo3IntVersion() {\n // ThEr180213 int_from_ver is deprecated from Typo3 4.6 on. \n if (class_exists('t3lib_utility_VersionNumber')) {\n return t3lib_utility_VersionNumber::convertVersionNumberToInteger(TYPO3_version);\n } else {\n t3lib_div::int_from_ver(TYPO3_version);\n }\n }",
"public static function getTypo3VersionInteger()\n {\n return VersionNumberUtility::convertVersionNumberToInteger(VersionNumberUtility::getNumericTypo3Version());\n }",
"protected static function getCurrentTypo3Version(): int\n {\n return VersionNumberUtility::convertVersionNumberToInteger(VersionNumberUtility::getNumericTypo3Version());\n }",
"public function getTypo3Version()\n {\n $this->init_typo3version();\n return $this->typo3Version;\n }",
"private function init_typo3version()\n {\n // RETURN : typo3Version is set\n if ( $this->typo3Version !== null )\n {\n return $this->typo3Version;\n }\n\n // Set TYPO3 version as integer (sample: 4.7.7 -> 4007007)\n list( $main, $sub, $bugfix ) = explode( '.', TYPO3_version );\n $version = ( ( int ) $main ) * 1000000;\n $version = $version + ( ( int ) $sub ) * 1000;\n $version = $version + ( ( int ) $bugfix ) * 1;\n $this->typo3Version = $version;\n // Set TYPO3 version as integer (sample: 4.7.7 -> 4007007)\n\n if ( $this->typo3Version >= 4005000 )\n {\n return $this->typo3Version;\n }\n\n $prompt = '<h1>ERROR</h1>\n <h2>Unproper TYPO3 version</h2>\n <ul>\n <li>\n TYPO3 version is smaller than 4.5.0\n </li>\n <li>\n constant TYPO3_version: ' . TYPO3_version . '\n </li>\n <li>\n integer $this->typo3Version: ' . ( int ) $this->typo3Version . '\n </li>\n </ul>\n ';\n die( $prompt );\n }",
"function get_version_number() {\n\tglobal $ofy, $versionclass;\n\t$version = $ofy->query($versionclass)->filter('id', '1')->get();\n\tif ($version == null) {\n\t\t$version = new Version('1', '0');\n\t\t$ofy->put($version);\n\t}\n\treturn $version->getVersion();\n}",
"public function getVer()\n {\n $value = $this->get(self::ver);\n return $value === null ? (integer)$value : $value;\n }",
"public function EngineVersionNumber() {\n $version = $this->EngineVersion();\n $start = strpos($version['VERSION'], '.');\n return intval(substr($version['VERSION'], 0, $start));\n }",
"public function getRevisionVersion() : int;",
"public static function getDatabaseVersion()\n {\n $currentTYPO3Version = VersionNumberUtility::convertVersionNumberToInteger(TYPO3_version);\n $version = 'n/a';\n\n if ($currentTYPO3Version <= VersionNumberUtility::convertVersionNumberToInteger('7.0.0')) {\n // TYPO3 < v7\n $version = $GLOBALS['TYPO3_DB']->sql_fetch_assoc(\n $GLOBALS['TYPO3_DB']->sql_query('SELECT @@version')\n )['@@version'];\n } elseif ($currentTYPO3Version <= VersionNumberUtility::convertVersionNumberToInteger('8.0.0')) {\n // TYPO3 < v8\n $version = $GLOBALS['TYPO3_DB']->getServerVersion();\n } else {\n // TYPO3 >= v8\n $connectionPool = GeneralUtility::makeInstance(ConnectionPool::class);\n $connection = $connectionPool->getConnectionByName(\n // We only use the first connection, because we usually don't use more than\n // one database. In the future or when we build a bigger website with more\n // than one database we can update this to a more generic method.\n $connectionPool->getConnectionNames()[0]\n );\n $version = $connection->getServerVersion();\n }\n\n return $version;\n }",
"public function EngineVersionNumber()\n {\n $version = $this->EngineVersion()->Version();\n $parts = explode('.', $version);\n return (int)reset($parts);\n }",
"public function getMinimalTypo3Version();",
"private function get_plugin_version() {\n\t\treturn $this->convert_version_string_to_number( TYPES_VERSION );\n\t}",
"public function toInt() : int {\n return (string) $this->version;\n }",
"function getVersionNumber();",
"private function initTypo3version()\n {\n // RETURN : typo3Version is set\n if ($this->typo3Version !== null)\n {\n return;\n }\n // RETURN : typo3Version is set\n // Set TYPO3 version as integer (sample: 4.7.7 -> 4007007)\n list( $main, $sub, $bugfix ) = explode('.', TYPO3_version);\n $version = ( (int) $main ) * 1000000;\n $version = $version + ( (int) $sub ) * 1000;\n $version = $version + ( (int) $bugfix ) * 1;\n $this->typo3Version = $version;\n // Set TYPO3 version as integer (sample: 4.7.7 -> 4007007)\n//echo __METHOD__ . ' (' . __LINE__ . '): ' . typo3Version . '<br />' . PHP_EOL;\n\n if ($this->typo3Version < 3000000)\n {\n $prompt = '<h1>ERROR</h1>\n <h2>Unproper TYPO3 version</h2>\n <ul>\n <li>\n TYPO3 version is smaller than 3.0.0\n </li>\n <li>\n constant TYPO3_version: ' . TYPO3_version . '\n </li>\n <li>\n integer $this->typo3Version: ' . (int) $this->typo3Version . '\n </li>\n </ul>\n ';\n die($prompt);\n }\n }",
"private function initTypo3version( )\n {\n // RETURN : typo3Version is set\n if( $this->typo3Version !== null )\n {\n return;\n }\n // RETURN : typo3Version is set\n\n // Set TYPO3 version as integer (sample: 4.7.7 -> 4007007)\n list( $main, $sub, $bugfix ) = explode( '.', TYPO3_version );\n $version = ( ( int ) $main ) * 1000000;\n $version = $version + ( ( int ) $sub ) * 1000;\n $version = $version + ( ( int ) $bugfix ) * 1;\n $this->typo3Version = $version;\n // Set TYPO3 version as integer (sample: 4.7.7 -> 4007007)\n//echo __METHOD__ . ' (' . __LINE__ . '): ' . typo3Version . '<br />' . PHP_EOL;\n\n if( $this->typo3Version < 3000000 )\n {\n $prompt = '<h1>ERROR</h1>\n <h2>Unproper TYPO3 version</h2>\n <ul>\n <li>\n TYPO3 version is smaller than 3.0.0\n </li>\n <li>\n constant TYPO3_version: ' . TYPO3_version . '\n </li>\n <li>\n integer $this->typo3Version: ' . ( int ) $this->typo3Version . '\n </li>\n </ul>\n ';\n die ( $prompt );\n }\n }",
"protected function getVersion(): int\n {\n if (array_key_exists($this->name, static::$versions)) {\n return static::$versions[$this->name];\n }\n\n static::$versions[$this->name] = (int) $this->store->get($this->getCacheVersionKey());\n\n return static::$versions[$this->name];\n }",
"private function init_typo3version()\n {\n // #43108, 121212, dwildt, +\n // RETURN : typo3Version is set\n if ( $this->typo3Version !== null )\n {\n return;\n }\n // RETURN : typo3Version is set\n // Set TYPO3 version as integer (sample: 4.7.7 -> 4007007)\n list( $main, $sub, $bugfix ) = explode( '.', TYPO3_version );\n $version = ( ( int ) $main ) * 1000000;\n $version = $version + ( ( int ) $sub ) * 1000;\n $version = $version + ( ( int ) $bugfix ) * 1;\n $this->typo3Version = $version;\n // Set TYPO3 version as integer (sample: 4.7.7 -> 4007007)\n\n if ( $this->typo3Version < 3000000 )\n {\n $prompt = '<h1>ERROR</h1>\n <h2>Unproper TYPO3 version</h2>\n <ul>\n <li>\n TYPO3 version is smaller than 3.0.0\n </li>\n <li>\n constant TYPO3_version: ' . TYPO3_version . '\n </li>\n <li>\n integer $this->typo3Version: ' . ( int ) $this->typo3Version . '\n </li>\n </ul>\n ';\n die( $prompt );\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ ava sama dengan image_post hanya deirektori penyimpanan ke upl/ava | function ava_post(){
$this->_imgdir='ava';
$this->image_post();
} | [
"public function save_post_image($post_id,array $data){\n\n \t\n }",
"function perkecil($imgAsal, $imgTujuan) {\n\t$pcImgAsal \t\t= explode(\"/\", $imgAsal);\n\t$jAr\t\t\t= count($pcImgAsal) - 1;\n\n\t$namaFileAsli\t= $pcImgAsal[$jAr];\n\n\t//identitas file asli\n\t$im_src = imagecreatefromjpeg($imgAsal);\n\t$src_width = imageSX($im_src);\n\t$src_height = imageSY($im_src);\n\n\t//Simpan dalam versi small 110 pixel\n\t//set ukuran gambar hasil perubahan\n\t$dst_width = 110;\n\t$dst_height = ($dst_width/$src_width)*$src_height;\n\n\t//proses perubahan ukuran\n\t$im = imagecreatetruecolor($dst_width,$dst_height);\n\timagecopyresampled($im, $im_src, 0, 0, 0, 0, $dst_width, $dst_height, $src_width, $src_height);\n\n\t//Simpan gambar\n\timagejpeg($im, $imgTujuan.\"_s_\".$namaFileAsli);\n\n\n\timagedestroy($im_src);\n\timagedestroy($im);\n}",
"private function bbImg(){\n\t\tif($this->img === TRUE OR $this->action === NULL){\n\t\t\tif($this->action === 'pre'){\n\t\t\t\t$match = '#\\[img\\](.*?)\\[\\/img\\]#si';\n\t\t\t\t$replace = '[img:'.$this->uid.']$1[/img:'.$this->uid.']';\n\t\t\t\t$this->str = preg_replace($match, $replace, $this->str, $this->imgLimit);\n\t\t\t}\n\n\t\t\tif($this->action === 'post' OR $this->action === NULL){\n\t\t\t\t$match = '#\\[img:'.$this->uid.'\\](.*?)\\[/img:'.$this->uid.'\\]#si';\n\t\t\t\t$replace = '<img src=\"$1\" />';\n\t\t\t\t$this->str = preg_replace($match, $replace, $this->str, $this->imgLimit);\n\t\t\t} \n\t\t}\n\t}",
"private function carga_imagen() {\n }",
"function edit_form_image_editor($post)\n {\n }",
"private function bbImg(){\n if($this->img === TRUE OR $this->action === NULL){\n if($this->action === 'pre'){\n $match = array('#\\[img=(.*?)\\]\\[/img\\]#si',\n \t\t\t '#\\[img\\](.*?)\\[/img\\]#si');\n $replace = array('[img=$1:'.$this->uid.'][/img:'.$this->uid.']',\n \t\t\t\t '[img:'.$this->uid.']$1[/img:'.$this->uid.']');\n $this->str = preg_replace($match, $replace, $this->str, $this->imgLimit);\n }\n\n if($this->action === 'post' OR $this->action === NULL){\n $match = array('#\\[img:'.$this->uid.'\\](.*?)\\[/img:'.$this->uid.'\\]#si',\n \t\t \t '#\\[img=(.*?):'.$this->uid.'\\]\\[/img:'.$this->uid.'\\]#si');\n $replace = '<img src=\"$1\" />';\n $this->str = preg_replace($match, $replace, $this->str, $this->imgLimit);\n } \n\n if($this->action === 'reset'){\n $match = array('#\\[img:'.$this->uid.'\\](.*?)\\[/img:'.$this->uid.'\\]#si',\n \t\t\t '#\\[img=(.*?):'.$this->uid.'\\](.*?)\\[/img:'.$this->uid.'\\]#si');\n \t\t\t \n $replace = array('[img]$1[/img]',\n \t\t\t\t '[img=$1]$2[/img]');\n\n $this->str = preg_replace($match, $replace, $this->str, $this->imgLimit);\n \n $this->str = str_replace('"', '', $this->str);\n } \n }\n }",
"function edit_form_image_editor($post)\n{\n}",
"function parsePost($text){\n $arr = array();\n $ret = array();\n $x= preg_match_all(\"(http://[^/]*indafoto.hu\\/[^\\s]*)\",$text,$arr);\n if($x>0){\n foreach($arr as $item){\n if (strpos($item[0],\"/image/\")){ // NOT RegExp!\n // kep beszurasa\n $ret[]=embedImageURL($item[0]);\n } else {\n if($embedcode=embedFeedURL(getFeedURL($item[0]))){\n $ret[]=$embedcode;\n }\n }\n }\n }\n return $ret;\n}",
"private function makePostWithImage()\n {\n return [\n 'no' => 393603871,\n 'now' => \"10\\/16\\/17(Mon)11:02:39\",\n 'name' => 'Anonymous',\n 'com' => \"<a href=\\\"#p393603295\\\" class=\\\"quotelink\\\">>>393603295<\\/a><br><span class=\\\"quote\\\">>Are we living in the golden age of Metroidvanias?<\\/span><br>Iconiclasts' done and will come out this year, so I'd say so.\",\n 'filename' => '1507649434298',\n 'ext' => '.png',\n 'w' => 925,\n 'h' => 109,\n 'tn_w' => 125,\n 'tn_h' => 14,\n 'tim' => 1508166159763,\n 'time' => 1508166159,\n 'md5' => 'Mae5Zs4ValXpj7Xto1CEyg==',\n 'fsize' => 10200,\n 'resto' => 393603295,\n ];\n }",
"function parse_quickblog_post($path, &$body) {\n global $serendipity;\n\n preg_match('@<!--quickblog:(.+\\|)+(.+)-->@imsU', $body, $target);\n $path = str_replace($target[1], '', $path);\n $body = str_replace($target[1], '', $body);\n\n //check for non-image object\n if (!isset($target) && empty($target)) return $body;\n\n $file = basename($path);\n $dir = dirname($path) . '/';\n\n $t = serendipity_parseFileName($file);\n $f = $t[0];\n $suf = $t[1];\n\n $infile = $dir . $file;\n\n $s9yimgID = (int)$this->getImageIdByUrl($infile);\n\n $outfile = $dir . $f . '.quickblog.' . $suf;\n // check for existing image.quickblog thumb (see change in backend_image_addHotlink) else change to default thumbnail name\n if (!file_exists($outfile)) $outfile = $dir . $f . '.' . $serendipity['thumbSuffix'] . '.' . $suf;\n\n if (function_exists('exif_read_data') && file_exists($infile) && !serendipity_db_bool($this->get_config('force_jhead'))) {\n $exif = @exif_read_data($infile);\n $exif_mode = 'internal';\n } elseif (file_exists($infile)) {\n $exif_mode = 'jhead';\n $exif_raw = explode(\"\\n\", @`jhead $infile`);\n $exif = array();\n\n foreach((array)$exif_raw AS $line) {\n preg_match('@^(.+):(.+)$@U', $line, $data);\n $key = preg_replace('@[^a-z0-9]@i', '_', trim($data[1]));\n if (empty($key)) {\n continue;\n }\n $exif[$key] .= trim($data[2]) . \"\\n\";\n }\n\n if (count($exif) < 1) {\n $exif = false;\n }\n } else {\n $exif = false;\n $exif_mode = 'none';\n }\n\n $http_infile = $this->httpize($infile);\n $http_outfile = $this->httpize($outfile);\n\n // create link targets\n $totarget = str_replace('|', '', $target[1]);\n $linktarget = '';\n switch($totarget) {\n case '_blank':\n $linktarget = ' target=\"_blank\"';\n break;\n case 'js':\n try { list($width, $height, $type, $attr) = getimagesize(\"$infile\"); } catch (Exception $e) { echo ERROR_SOMETHING . ': '.$e->getMessage(); }\n $linktarget = ' onclick=\"F1 = window.open(\\''.$http_infile.'\\',\\'Zoom\\',\\'height='.$height.',width='.$width.',top=\\'+ (screen.height-'.$height.')/2 +\\',left=\\'+ (screen.width-'.$width.')/2 +\\',toolbar=no,menubar=no,location=no,resize=1,resizable=1,scrollbars=yes\\'); return false;\"';\n break;\n case 'plugin':\n $linktarget = ' id=\"s9yisphref'.$s9yimgID.'\" onclick=\"javascript:this.href = this.href + \\'&serendipity[from]=\\' + self.location.href;\"';\n $linkto = $serendipity['serendipityHTTPPath'] . 'serendipity_admin_image_selector.php?serendipity[step]=showItem&serendipity[image]='.$s9yimgID;\n $http_infile = $this->httpize($linkto);\n break;\n }\n\n $quickblog = array(\n 'html5' => ($serendipity['wysiwyg'] || $serendipity['version'][0] > 1) ? true : false,\n 'image' => $http_outfile,\n 'fullimage' => $http_infile,\n 'body' => preg_replace('@(<!--quickblog:.+-->)@imsU', '', $body),\n 'imageid' => $s9yimgID,\n 'target' => $linktarget,\n 'istarget' => $totarget,\n 'exif' => &$exif,\n 'exif_mode' => $exif_mode\n );\n\n if (!is_object($serendipity['smarty'])) {\n serendipity_smarty_init();\n }\n\n $serendipity['smarty']->assign('quickblog', $quickblog);\n\n $content = $this->parseTemplate('quickblog.tpl');\n\n return $content;\n }",
"function mlaf_alt_update() {\n\t$mlaf_post_id = absint ( $_POST['post_id'] );\n\t$mlaf_alt_text = wp_strip_all_tags( $_POST['alt_text'] );\n\n\tif ( !empty( $_POST['alt_text'] ) ) {\n\t\tupdate_post_meta( $mlaf_post_id, '_wp_attachment_image_alt', $mlaf_alt_text );\n\t}\n}",
"public function univeral_upload_thumb(){\n\t\t\n\t\t\n\t}",
"function postaviSliku($slika){\n\t\tglobal $db; global $_M;\n\t\t\n\t\t$fajl_ime = $slika['name'];\n\t\t$fajl_tmp = $slika['tmp_name'];\n\t\t$fajl_tip = $slika['type'];\n\n\t\t$dozvoljena_ekstenzija = 'jpg';\n\n\t\t// Validacija ekstenzije\n\t\t$fajl_ekstenzija = explode('.', $fajl_ime); $fajl_ekstenzija = end($fajl_ekstenzija); $fajl_ekstenzija = strtolower($fajl_ekstenzija);\n\t\tif($fajl_ekstenzija!=$dozvoljena_ekstenzija) die(\".nedozvoljenaEkstenzija\");\n\t\n\t\t// Provjera velicine (Dozvoljena velicina je 2mb)\n\t\t$fajl_velicina = $slika['size'];\n\t\tif($fajl_velicina>2097152) die(\".viseOd2Mb\");\n\n\t\t// Preuzimanje jedinstvene_sifre od korisnika\n\t\t// KOja ce sluziti kao ime slike\n\t\t$sifra = $db->q(\"SELECT jedinstvena_sifra FROM nalog WHERE nid='\".$_M->nid.\"';\");\n\t\t\n\t\t// Lokacija slike\n\t\t$lokacija = '../_fajlovi/_profil/'.$sifra['jedinstvena_sifra'].'.jpg';\n\t\tif(file_exists($lokacija)) unlink($lokacija);\n\n\t\tif(move_uploaded_file($fajl_tmp, $lokacija)) die($sifra['jedinstvena_sifra']);\n\t\telse die(\".greskaPostavljanja\");\n\t}",
"function publish_pano_infocus() {\r\n\r\n\r\n // Create a WP page\r\n global $user_ID, $ngg, $wpdb;\r\n\r\n $post['post_type'] = 'post';\r\n \r\n //content with shortcode for link\r\n $post_content = '[nextgen_portfolio_list pictures=' . intval($_POST['pid']) .' thumb=\"medium\" offset=\"0\" showposts=\"80\" disable=\"map\"]';\r\n $post['post_content'] = $post_content. \"\\r\\n\". $_POST['post_content'];\r\n $post['post_author'] = $user_ID;\r\n $post['post_status'] = isset ( $_POST['publish_state'] ) && $_POST['publish_state'] == 'true' ? 'publish' : 'draft';\r\n $post['post_title'] = $_POST['post_title'];\r\n \r\n // let's get the image data\r\n $picture = nggdb::find_image($_POST['pid']);\r\n\r\n if($picture) {\r\n //tags\r\n $with_tags = (isset ($_POST['with_tags']) && $_POST['with_tags'] == '1') ? true : false;\r\n if ($with_tags) {\r\n\r\n $tags = $picture->get_tags();\r\n $tag_names = '';\r\n foreach ($tags as $tag) {\r\n $tag_names .= ($tag_names=='' ? $tag->name : ', ' . $tag->name);\r\n }\r\n $post['tags_input'] = $tag_names;\r\n }\r\n }\r\n \r\n //Exif Date\r\n $use_exif_date = (isset ($_POST['exif_date']) && $_POST['exif_date'] == '1') ? true : false;\r\n if($picture) {\r\n if($use_exif_date) {\r\n if($picture->imagedate) {\r\n $picturedate = mysql2date('Y-m-d H:i:s', $picture->imagedate);\r\n $post['post_date'] = $picturedate;\r\n //'post_date' => [ Y-m-d H:i:s ]\r\n }\r\n }\r\n }\r\n \r\n //category\r\n $category = (isset ($_POST['category'])) ? $_POST['category'] : '';\r\n $post['post_category'] = $category;\r\n \r\n $post = apply_filters('ngg_add_new_post', $post, $_POST['pid']);\r\n \r\n \r\n $post_id = wp_insert_post ($post);\r\n \r\n if ($post_id != 0) {\r\n //Add infocus theme option\r\n $post_intro_panoramic_html = '[panoramic template=fullwidth id=' . intval($_POST['pid']) .']';\r\n\r\n $mysite_infocus_options_array = array(\r\n '_intro_panoramic_html' => $post_intro_panoramic_html,\r\n '_intro_text' => 'panoramic',\r\n '_disable_post_image' => array('true'),\r\n '_disable_breadcrumbs' => array('true'),\r\n '_layout' => 'full_width'\r\n\r\n );\r\n\r\n # save the meta boxes\r\n foreach ( $mysite_infocus_options_array as $key => $value ) {\r\n\r\n $old = get_post_meta( $post_id, $key, true );\r\n\r\n if ( $value && $value != $old ) {\r\n update_post_meta( $post_id, $key, $value );\r\n } elseif ('' == $value && $old) {\r\n delete_post_meta( $post_id, $key, $old );\r\n }\r\n }\r\n\r\n // Add featured image\r\n $featured = (isset ($_POST['featured_image']) && $_POST['featured_image'] == '1') ? true : false;\r\n if ($featured) {\r\n add_post_meta($post_id, '_thumbnail_id', 'ngg-'.$_POST['pid']);\r\n }\r\n \r\n //Add post_id in panoramic table\r\n $message = '';\r\n \r\n $gid = $picture->galleryid;\r\n \r\n if(nggpano_getImagePanoramicOptions($_POST['pid'])) {\r\n if($wpdb->query(\"UPDATE \".$wpdb->prefix.\"nggpano_panoramic SET post_id = '\".$wpdb->escape($post_id).\"' WHERE pid = '\".$wpdb->escape($_POST['pid']).\"'\") !== false) {\r\n $message = __('New Post published','nggpano');\r\n } else {\r\n $message = ' <strong>' . $image->filename . ' (Error : Error with database)</strong>';\r\n };\r\n }else{\r\n if($wpdb->query(\"INSERT INTO \".$wpdb->prefix.\"nggpano_panoramic (id, pid, gid, post_id) VALUES (null, '\".$wpdb->escape($_POST['pid']).\"', '\".$wpdb->escape($gid).\"', '\".$wpdb->escape($post_id).\"')\") !== false) {\r\n $message = __('New Post published','nggpano');\r\n } else {\r\n $message = ' <strong>' . $image->filename . ' (Error : Error with database)</strong>';\r\n };\r\n }\r\n \r\n //nggGallery::show_message( __('Published a new post','nggallery'). $message );\r\n }\r\n \r\n echo nggpanoAdmin::krpano_image_form($_POST['pid'], $message);\r\n\r\n }",
"function viva($ending,$categ) {\r\nglobal $wpdb, $post, $uploadspath, $cachepath, $rootpath;\r\n$thumbg=get_post_meta($post->ID, \"gabimage\", true);\r\n\r\nif (!$thumbg) {\r\n\r\n\r\n$thumbt=get_post_meta($post->ID, \"thumbnail\", true);\r\n$pID=$post->ID;\r\n$ending = $ending;\r\n$categ=$categ;\r\n\r\nif ($categ==\"\") {\r\n$categories = (array) get_the_category();\r\n$thelist = '';\r\nforeach($categories as $category) {\r\n$thelist = $category->cat_ID;\r\n }\r\n$categ=$thelist;\r\n}\r\n$attachment_id = $wpdb->get_var(\"SELECT guid FROM $wpdb->posts WHERE post_parent = '$pID' AND post_type='attachment' AND (post_mime_type='image/jpeg' OR post_mime_type='image/gif' OR post_mime_type='image/png') ORDER BY post_date ASC LIMIT 1\");\r\n$attachm= split($uploadspath,$attachment_id);\r\n$attachm=$attachm[1];\r\n\r\n$thumbt=split($uploadspath,$thumbt);\r\n$thumbt=$thumbt[1];\r\n\r\n$catcache=\"false\";\r\nif ($thumbt==\"\" AND $attachm==\"\")\r\n{\r\n$filename=$rootpath.'/'.$uploadspath.'/cat'.$categ.'_'.$ending.'.jpg';\r\n$catcache=\"true\";\r\n}\r\n\r\n\r\nif ($thumbt!=\"\" OR $attachm!=\"\" )\r\n{\r\n$filename=$rootpath.'/'.$uploadspath.'/'.$cachepath.'/'.$pID.'_'.$ending.'.jpg';\r\n }\r\n\r\n\r\n\r\n$filepath=split($uploadspath,$filename);\r\n$filepath=$filepath[1];\r\n$filepath=$uploadspath.$filepath;\r\n\r\n\r\n if(!file_exists($filepath)) {\r\n$cached=0;\r\n\r\nif($thumbt ==\"\") {\r\n$thumbt=$attachm; }\r\n\r\n\r\n$attachpath=$uploadspath.$thumbt;\r\n\r\n\r\nif(!file_exists($attachpath))\r\n\t{\r\n$catcache=\"true\";\r\n$catpath=$uploadspath.'/'.$cachepath.'/cat'.$categ.'_'.$ending.'.jpg';\r\n\r\nif(!file_exists($catpath)) {\r\n\r\n}\r\n\r\nelse {\r\n$thesrc=$rootpath.'/'.$uploadspath.'/'.$cachepath.'/cat'.$categ.'_'.$ending.'.jpg';\r\n$cached='1';\r\n}\r\n\r\n}\r\n\r\n\r\nif ($cached!='1'){\r\n$thesrc=\"$rootpath/show_image_$ending.php?filename=$thumbt&cat=$categ&pid=$pID&cache=$catcache\";\r\n}\r\necho $thesrc;\r\n\r\n }\r\n\r\n\r\n\r\nelse {\r\n echo $filename;\r\n}\r\n\r\n} else { echo $thumbg;}\r\n\r\n}",
"public function testPostImagesVariations()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }",
"private function parsePost($post){\n\t\n\t\t//set username (hc svnt dracones)\n\t\t$username = \"atlefren\";\n\t\t\n\t\t//create array of images\n\t\t$images = array();\n\t\tforeach ($post[\"id\"] as $key=>$value) {\n\t\t\t$data = array(\n\t\t\t\t'lat' => $post[\"lat\"][$key], \n\t\t\t\t'lon' => $post[\"lon\"][$key],\n\t\t\t\t'title' => $post[\"title\"][$key], \n\t\t\t\t'filename' => $post[\"filename\"][$key],\n\t\t\t\t'user' => $username, \n\t\t\t\t'season' => $post[\"season\"][$key]\n\t\t\t);\t\n\t\t\tarray_push($images,new GeoRefImage($data));\n\t\t}\n\t\treturn $images;\n\t}",
"public function wp_roni_photo_contest_shortcode( $attr, $content = null ) {\n global $post;\n \n $data = [];\n \n // Checks if there was a POST request\n if( $_POST ) {\n\n if( empty( $_POST['author-name'] ) ) {\n $this->errors[] = 'Pozabili ste vnesti svoje ime!';\n }\n\n if( empty( $_POST['author-email'] ) ) {\n $this->errors[] = 'Pozabili ste vnesti svoj e-mail!';\n } \n\n /* \n * TODO: Email already exists\n * This check is implemented bot not used\n */ \n /*if( emailExists( filter_var( $_POST['author_email'], FILTER_SANITIZE_EMAIL ) ) ) {\n $this->errors[] = 'Ta email je že obstaja';\n }*/\n\n if( $_FILES['file-upload']['error'] == 4 ) {\n $this->errors[] = 'Pozabili ste vstaviti sliko!';\n } \n\n if( $_FILES['file-upload']['size'] > 1000000 ) {\n $this->errors[] = 'Slike je prevelika!. Naložite manjšo sliko! Maksimalno 1MB.';\n }\n\n $image_type = strtolower( substr( strrchr( $_FILES['file-upload']['type'], '/' ), 1 ) );\n\n if( $image_type != 'jpg' && $image_type != 'jpeg' && $image_type != 'png' && $image_type != 'gif' && $image_type != '' ) {\n $this->errors[] = 'Format ' . '.' . $image_type . ' ni podprt. Podprti so samo .jpg, .jpeg, .png in .gif!';\n } \n\n \n if( !empty( $this->errors ) ) {\n $_SESSION['errors'] = $this->errors;\n } else {\n $name = $_POST['author-name'];\n $email = $_POST['author-email'];\n $title = $_POST['image-title'];\n $description = $_POST['image-description'];\n\n $upload = new MediaUpload;\n $file = $upload->saveUpload( $field_name = 'file-upload' );\n\n $original_path = $this->upload_dir['baseurl'] . '/' . _wp_relative_upload_path( $file['file'] );\n \n $resize_image = new ResizeImage( $original_path );\n $resize_image->resizeImage( 350, 350, 'crop' );\n\n $crop_path = 'wp-content/uploads/tekmovanje' . $this->upload_dir['subdir'] . '/' . $file['file_info']['filename'] . '-350x350' . '.' . $file['file_info']['extension'];\n\n $resize_image->saveImage( $crop_path, 100 );\n \n $data['attachment_id'] = $file['attachment_id'];\n $data['title'] = $title;\n $data['description'] = $description;\n $data['attachment_id'] = $file['attachment_id'];\n $data['image_path'] = $original_path;\n $data['image_thumb_path'] = $this->upload_dir['baseurl'] . '/' . _wp_relative_upload_path( $file['file_info']['dirname'] ) . '/' . $file['file_info']['filename'] . '-350x350' . '.' . $file['file_info']['extension'];\n $data['author_name'] = $name;\n $data['author_email'] = $email;\n $data['number_of_votes'] = 0;\n $data['created'] = date('d.m.Y G:i:s');\n\n $save_data = $this->saveToDatabse($data);\n\n # TODO: Database error handler not implemented yet \n\n $_SESSION['success'] = 'Slika je bila uspešno naložena!';\n\n # TOO: Create post for every image upload \n $my_post = array(\n 'post_title' => 'Nov vnos',\n 'post_content' => 'This is my post.',\n 'post_status' => 'publish',\n 'post_author' => 1\n );\n\n //wp_insert_post( $my_post );\n \n } \n }\n\n $images_data = $this->getImages();\n $contest_subtitle = get_option( 'wp_roni_photo_contest_subtitle' );\n $contest_description = get_option( 'wp_roni_photo_contest_description' );\n\n // Get the front end ( form, and images grid )\n ob_start();\n require( 'inc/front-end.php' );\n $content = ob_get_clean();\n\n session_destroy();\n\n return $content;\n }",
"function imageTextLink($p_url,$p_image,$p_text):void\n {\n ?><a href=\"<?=$this->e($p_url)?>\"><img src=\"<?=$this->e($p_image)?>\" /><?=$this->e($p_text)?></a><?php \n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Map array values to a Summoner model | public function mapToSingleModel($values) {
$summoner = new Summoner(
$values["id"],
$values["name"],
$values["profileIconId"],
$values["revisionDate"],
$values["summonerLevel"]
);
return $summoner;
} | [
"public function getSummonerData($id) {\n $returnObject = []; // The object that will be returned to the front end\n $summonerId = $id;\n\n // First, find the summoner data\n try {\n $summoner = (is_numeric($id) ? Summoner::where('accountId', $id)->firstOrFail() : Summoner::where('name', $id)->firstOrFail());\n } catch (ModelNotFoundException $e) {\n $summoner = new Summoner;\n $summoner->assignDataFromAPI($id);\n }\n\n\n $returnObject['summoner'] = $summoner;\n\n $summonerId = $summoner->id;\n $accountId = $summoner->accountId;\n\n // Then get the normal and ranked matchlist for that summoner\n // Normal matchlist first\n $normalParams = [\n 'queue'=> [2,14,400,430],\n 'season'=> [9],\n 'endIndex'=> 20\n ];\n try {\n $matchListAggregate = MatchList::where('summonerId',$accountId)->get();\n if (count($matchListAggregate) == 0) {\n throw new ModelNotFoundException();\n } else {\n $found = false;\n // go through all the matchlists found, then for each matchlist, compare it to the params we were sent\n // if one of the matchlists matches the params sent in, return that, else we have to throw an exception\n foreach($matchListAggregate as $matchListEntry) {\n // if it's the same season, same list type, and less than a day old\n if ($matchListEntry->list_type == 'normal') {\n $matchListObject = $matchListEntry;\n $found = true;\n if (strtotime($matchListObject->updated_at) < (strtotime('-1 day'))) {\n $matches = $this->api->getMatchList($accountId, $normalParams);\n $tempType = gettype($matches);\n if ($tempType == \"object\") {\n $matchListObject->matches = json_encode($matches->matches);\n } else {\n $matchListObject->matches = json_encode($matches['matches']);\n }\n $matchListObject->updated_at = $matchListObject->freshTimestampString();\n $matchListObject->save();\n $this->saveMatchListMatches($this->api, $matchListObject);\n }\n }\n }\n // throw the exception since we couldn't find a matchlist that matches!\n if (!$found) {\n throw new ModelNotFoundException();\n }\n }\n } catch (ModelNotFoundException $e) {\n $matches = $this->api->getMatchList($accountId, $normalParams);\n $matchListObject = new MatchList;\n $matchListObject->summonerId = $accountId;\n $matchListObject->season = '[\"9\"]';\n $matchListObject->list_type = 'normal';\n $matchListObject->matches = json_encode($matches['matches']);\n $matchListObject->save();\n $this->saveMatchListMatches($this->api, $matchListObject);\n }\n\n $definedMatchListObject = $this->getMatchListMatches($matchListObject);\n $this->formatMatchListForDelivery($matchListObject);\n $this->formatDefinedMatchListForDelivery($definedMatchListObject);\n $returnObject['normalDefinedMatchList'] = $definedMatchListObject;\n $returnObject['normalMatchList'] = $matchListObject;\n\n // Ranked matchlist and matches next\n $rankedParams = [\n 'queue' => [410, 420, 440, 6, 41, 42],\n 'season' => [9],\n 'endIndex' => 20\n ];\n try {\n $matchListAggregate = MatchList::where('summonerId',$accountId)->get();\n if (count($matchListAggregate) == 0) {\n throw new ModelNotFoundException();\n } else {\n $found = false;\n // go through all the matchlists found, then for each matchlist, compare it to the params we were sent\n // if one of the matchlists matches the params sent in, return that, else we have to throw an exception\n foreach($matchListAggregate as $matchListEntry) {\n // if it's the same season, same list type, and less than a day old\n if ($matchListEntry->list_type == 'ranked') {\n $matchListObject = $matchListEntry;\n $found = true;\n if (strtotime($matchListObject->updated_at) < (strtotime('-1 day'))) {\n $matches = $this->api->getMatchList($accountId, $rankedParams);\n $tempType = gettype($matches);\n if ($tempType == \"object\") {\n $matchListObject->matches = json_encode($matches->matches);\n } else {\n $matchListObject->matches = json_encode($matches['matches']);\n }\n $matchListObject->updated_at = $matchListObject->freshTimestampString();\n $matchListObject->save();\n $this->saveMatchListMatches($this->api, $matchListObject);\n }\n }\n }\n // throw the exception since we couldn't find a matchlist that matches!\n if (!$found) {\n throw new ModelNotFoundException();\n }\n }\n } catch (ModelNotFoundException $e) {\n $matches = $this->api->getMatchList($accountId, $rankedParams);\n $matchListObject = new MatchList;\n $matchListObject->summonerId = $accountId;\n $matchListObject->season = '[\"9\"]';\n $matchListObject->list_type = 'ranked';\n $matchListObject->matches = json_encode($matches['matches']);\n $matchListObject->save();\n $this->saveMatchListMatches($this->api, $matchListObject);\n }\n\n $definedMatchListObject = $this->getMatchListMatches($matchListObject);\n $this->formatMatchListForDelivery($matchListObject);\n $this->formatDefinedMatchListForDelivery($definedMatchListObject);\n $returnObject['rankedMatchList'] = $matchListObject;\n $returnObject['rankedDefinedMatchList'] = $definedMatchListObject;\n\n $otherParams = [\n 'queue'=> [70, 72, 73, 75, 76, 78, 83, 98, 100, 310, 313, 317, 325, 450, 460, 470, 600, 610, 900, 910, 920, 940, 950, 960, 980, 990, 1000, 1010],\n 'season'=> [9],\n 'endIndex'=> 20\n ];\n try {\n $matchListAggregate = MatchList::where('summonerId',$accountId)->get();\n if (count($matchListAggregate) == 0) {\n throw new ModelNotFoundException();\n } else {\n $found = false;\n // go through all the matchlists found, then for each matchlist, compare it to the params we were sent\n // if one of the matchlists matches the params sent in, return that, else we have to throw an exception\n foreach($matchListAggregate as $matchListEntry) {\n // if it's the same season, same list type, and less than a day old\n if ($matchListEntry->list_type == 'other') {\n $matchListObject = $matchListEntry;\n $found = true;\n if (strtotime($matchListObject->updated_at) < (strtotime('-1 day'))) {\n $matches = $this->api->getMatchList($accountId, $otherParams);\n $tempType = gettype($matches);\n if ($tempType == \"object\") {\n $matchListObject->matches = json_encode($matches->matches);\n } else {\n $matchListObject->matches = json_encode($matches['matches']);\n }\n $matchListObject->updated_at = $matchListObject->freshTimestampString();\n $matchListObject->save();\n $this->saveMatchListMatches($this->api, $matchListObject);\n }\n }\n }\n // throw the exception since we couldn't find a matchlist that matches!\n if (!$found) {\n throw new ModelNotFoundException();\n }\n }\n } catch (ModelNotFoundException $e) {\n $matches = $this->api->getMatchList($accountId, $otherParams);\n $matchListObject = new MatchList;\n $matchListObject->summonerId = $accountId;\n $matchListObject->season = '[\"9\"]';\n $matchListObject->list_type = 'other';\n $matchListObject->matches = json_encode($matches['matches']);\n $matchListObject->save();\n $this->saveMatchListMatches($this->api, $matchListObject);\n }\n\n $definedMatchListObject = $this->getMatchListMatches($matchListObject);\n $this->formatMatchListForDelivery($matchListObject);\n $this->formatDefinedMatchListForDelivery($definedMatchListObject);\n $returnObject['otherMatchList'] = $matchListObject;\n $returnObject['otherDefinedMatchList'] = $definedMatchListObject;\n\n return response()->json(json_encode($returnObject));\n }",
"function summoner_by_id_array($summoner_id, $server){\n\nglobal $riot_api_key;\n$curl = curl_init('https://' . $server . '.api.pvp.net/api/lol/' . $server . '/v2.5/league/by-summoner/' . $summoner_id . '/entry?api_key=' . $riot_api_key);\ncurl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);\n$result = curl_exec($curl);\ncurl_close($curl);\n$decoded_result = json_decode($result, true);\nreturn $decoded_result;\n\n}",
"function findSummoner(){\n\t\t\tfor($y=0;$y<15;$y++){\n\t\t\t\t$game = $this->gameDataArray[$y];\n\t\t\t\tfor($x=0;$x<10;$x++){\n\t\t\t\t\t$accNumber = $game['participantIdentities'][$x]['player']['accountId'];\n\t\t\t\t\tif(strcmp($this->accountNumber,$accNumber) == 0){\n\t\t\t\t\t\t$this->participantId = $x;\n\t\t\t\t\t\t$champId = $game['participants'][$this->participantId]['championId'];\n\t\t\t\t\t\tarray_push($this->participantIdArray,$this->participantId);\n\t\t\t\t\t\tarray_push($this->championIdArray,$champId);\n\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t}",
"public function memberArrayToModels($array)\n {\n $members = array();\n foreach ($array as $data) {\n $member = new Member($data);\n $members[] = $member;\n }\n return $members;\n }",
"public static function set_pet_array() {\n\t\t$petTypeResults = PetData::get_pet_types();\n\t\t\n\t\tforeach($petTypeResults as $PetRow) {\n\t\t\t\n\t\t PetData::$petArray[$PetRow['NameType']] = $PetRow['PId'];\t\n\t\t}\n\t}",
"public function mapArrayDataToModel(array $data = []);",
"private function starMapping(){\n\t\tforeach(YoVideo::getPeople() as $field){\n\n\t\t\t$stars = $this->get($field);\n\t\t\tif(!empty($stars)){\n\t\t\t\t$list = [];\n\t\t\t\tforeach($stars as $e){\n\t\t\t\t\t$list[] = new Star($e);\n\t\t\t\t}\n\t\t\t\t$this->set($field, $list, false);\n\t\t\t}\n\n\t\t}\n\n\t}",
"protected function getSpeakersMapping()\n {\n return [\n 'getTitle' => 'speakers_title_ms',\n 'getGender' => 'speakers_gender_ms',\n 'getOrganization' => 'speakers_organization_ms',\n 'getHomepage' => 'speakers_homepage_ms',\n 'getNotes' => 'speakers_notes_ms',\n 'getAddress' => 'speakers_address_ms',\n 'getPhoneWork' => 'speakers_phone_work_ms',\n 'getPhoneHome' => 'speakers_phone_home_ms',\n 'getPhoneMobile' => 'speakers_phone_mobile_ms',\n 'getFax' => 'speakers_fax_ms',\n 'getEmail' => 'speakers_email_ms',\n ];\n }",
"public function summoner($identifiers, $request = true) {\n if (!$request) {\n if (!is_array($identifiers)) {\n return new Summoner(['id' => $identifiers], $this);\n }\n $summoners = [];\n foreach ($identifiers as $id) {\n $summoner = new Summoner(['id' => $id], $this);\n array_push($summoners, $summoner);\n }\n return $summoners;\n }\n $ids = $identifiers;\n $query = 'summoner/';\n if (is_array($identifiers)) {\n $ids = implode(',', $identifiers);\n if (!array_filter($identifiers, 'is_numeric'))\n $query .= 'by-name/';\n } else {\n if (!is_numeric($ids))\n $query .= 'by-name/';\n }\n\n $array = $this->request($query . rawurlencode($ids), $this->versions['summoner']);\n if ($array != null) {\n if (count($array) > 1) {\n $summoners = [];\n foreach ($array as $info) {\n $summoner = new Summoner($info, $this);\n array_push($summoners, $summoner);\n }\n return $summoners;\n }\n return new Summoner($array[key($array)], $this);\n }\n return null;\n }",
"public function bySummoner($ids)\n {\n return $this->call('team/by-summoner/' . $this->makeList($ids));\n }",
"public static function construct_from_array($data) { \n\n\t\t$artist = new Artist(0); \n\t\tforeach ($data as $key=>$value) { \n\t\t\t$artist->$key = $value; \n\t\t} \n\n\t\t//Ack that this is not a real object from the DB\n\t\t$artist->_fake = true; \n\n\t\treturn $artist;\n\n\t}",
"function createChampion($data)\n {\n //loop trough every set in array\n foreach($data as $key => $val)\n {\n //check if this class has a variable with the same name as the key in the array\n if(property_exists ('champion', $key))\n {\n //if true we set this class variable with that name with the data from the database\n $this->$key = $val;\n }\n }\n }",
"function GetPlayerData() {\n\t\t$sql = \"select a.*, b.username, b.fullname, b.email\n\t\t\tfrom farkle_games_players a, farkle_players b\n\t\t\twhere gameid=$this->gameid and a.playerid=b.playerid\";\n\t\t$pd = db_select_query( $sql, SQL_MULTI_ROW );\n\t\t\n\t\t$theArray = Array();\n\t\tforeach( $pd as $p )\n\t\t{\n\t\t\t$newItem = array( $p['playerid'] => $p );\n\t\t\techo \"<br>\";\n\t\t\tvar_dump($theArray);\n\t\t\tif( empty($theArray) ) \n\t\t\t\t$theArray = $newItem;\n\t\t\telse\n\t\t\t\t$theArray = array_merge( $theArray, (array)$newItem );\n\t\t}\n\t\t$this->players = $theArray;\n\t}",
"public function mapMinigames($playerData)\n {\n $minigamesObj = new Collection();\n $skillsCount = count(config('hiscores.skills'));\n\n for ($i = 0; $i < count(config('hiscores.minigames')); $i++) {\n $minigame = config('hiscores.minigames')[$i];\n\n $minigamesObj[$minigame] = [\n 'rank' => (int) $playerData[$skillsCount + $i][0],\n 'score' => (int) $playerData[$skillsCount + $i][1]\n ];\n }\n\n return $minigamesObj;\n }",
"function actindo_get_salutation_map( )\n{\n $gender = array(\n 'Mr' => 'Herr',\n 'Mrs' => 'Frau',\n 'Ms' => 'Frau',\n 'MR' => 'Herr',\n 'MRS' => 'Frau',\n 'MS' => 'Frau',\n );\n return $gender;\n}",
"function getSummonerByName($name) {\n\t\t\t$url = $GLOBALS['baseurl'].'api/lol/'.$GLOBALS['region'].'/v1.2/summoner/by-name/'.$name;\n\t\t\t$params = '?api_key='.$GLOBALS['key'];\n\t\t\t\n\t\t\treturn json_decode(file_get_contents($url.$params), true);\n\t\t}",
"public function mapToMultipleModels($values) {\n\t\t// TO-DO\n\t}",
"public function getSummonerIds()\n {\n return $this->summonerIds;\n }",
"public static function fromArray(array $beerInfo) {\n\n // get Volume info and build a Volume object\n $volumeInfo = $beerInfo[\"volume\"];\n $volumeObject = Volume::fromArray($volumeInfo);\n\n // get BoilVolume info and build a BoilVolume object\n $boilVolumeInfo = $beerInfo[\"boil_volume\"];\n $boilVolumeObject = BoilVolume::fromArray($boilVolumeInfo);\n\n // get Method info and build a Method object\n $methodInfo = $beerInfo[\"method\"];\n $methodObject = Method::fromArray($methodInfo);\n\n // get Ingredients info and build an Ingredients object\n $ingredientsInfo = $beerInfo[\"ingredients\"];\n $ingredientsObject = Ingredients::fromArray($ingredientsInfo);\n\n // build a new Beer object using the two objects built above,\n // plus other information passed in in the BeerInfo array\n $beer = new Beer(\n $beerInfo[\"id\"],\n $beerInfo[\"name\"],\n $beerInfo[\"tagline\"],\n $beerInfo[\"first_brewed\"],\n $beerInfo[\"description\"],\n $beerInfo[\"image_url\"],\n $beerInfo[\"abv\"],\n $beerInfo[\"ibu\"],\n $beerInfo[\"target_fg\"],\n $beerInfo[\"target_og\"],\n $beerInfo[\"ebc\"],\n $beerInfo[\"srm\"],\n $beerInfo[\"ph\"],\n $beerInfo[\"attenuation_level\"],\n $volumeObject,\n $boilVolumeObject,\n $methodObject,\n $ingredientsObject,\n $beerInfo[\"food_pairing\"],\n $beerInfo[\"brewers_tips\"],\n $beerInfo[\"contributed_by\"]\n );\n\n // return the new Beer object\n return $beer;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Solves captcha (solves math) It is solved in risky way. There is mathematical task in captcha. Used method eval to perform calculation. | private function solveCaptcha($captcha) {
// solved captcha value
$solve = '';
// RISKY PART - to rewrite
eval($text = "\$solve=$captcha;");
return $solve;
} | [
"private function _main_captcha() {\r\n\t\t// First of all we are going to set up an array with the text equivalents of all the numbers we will be using.\r\n\t\t$captcha_number_convert = array(0=>'zero', 1=>'one', 2=>'two', 3=>'three', 4=>'four', 5=>'five', 6=>'six', 7=>'seven', 8=>'eight', 9=>'nine', 10=>'ten');\r\n\t\t// Choose the first number randomly between 6 and 10. This is to stop the answer being negative.\r\n\t\t$captcha_number_first = mt_rand(6, 10);\r\n\t\t// Choose the second number randomly between 0 and 5.\r\n\t\t$captcha_number_second = mt_rand(0, 5);\r\n\t\t// Set up an array with the operators that we want to use. At this stage it is only subtraction and addition.\r\n\t\t$captcha_operator_convert = array(0=> array('op' => '+', 'name' => 'plus'), 1 => array('op' => '-', 'name' => 'minus'));\r\n\t\t// Choose the operator randomly from the array.\r\n\t\t$captcha_operator = $captcha_operator_convert[mt_rand(0, 1)];\r\n\t\t// Get the equation in textual form to show to the user.\r\n\t\t$captcha_return = (mt_rand(0, 1) == 1 ? $captcha_number_convert[$captcha_number_first] : $captcha_number_first) . ' ' . $captcha_operator['name'] . ' ' . (mt_rand(0, 1) == 1 ? $captcha_number_convert[$captcha_number_second] : $captcha_number_second);\r\n\t\t// Evaluate the equation and get the result.\r\n\t\teval('$captcha_result = ' . $captcha_number_first . ' ' . $captcha_operator['op'] . ' ' . $captcha_number_second . ';');\r\n\t\t// Store the result in a session key.\r\n\t\t$this->session->set_userdata('captcha', $captcha_result);\r\n\t\t// Return the question along with a bit of text in front as it will be used in the form itself.\r\n\t\treturn 'What is ' . $captcha_return . '?';\r\n\t}",
"public function createCAPTCHA()\n {\n switch ($this->_severity) {\n case 1:\n list($equation, $phrase) = $this->_createSimpleEquation();\n break;\n case 2:\n list($eq1, $sol1) = $this->_createSimpleEquation();\n list($eq2, $sol2) = $this->_createSimpleEquation();\n $op3 = $this->_operators[mt_rand(0, count($this->_operators) - 1)];\n list(, $phrase) = $this->_solveSimpleEquation($sol1, $sol2, $op3);\n $equation = sprintf($op3, '(' . $eq1 . ')', '(' . $eq2 . ')');\n break;\n default:\n throw new Text_CAPTCHA_Exception(\n 'Equation complexity of ' . $this->_severity . ' not supported'\n );\n }\n $this->setCaptcha($equation);\n $this->setPhrase($phrase);\n }",
"private static function create_equation(){\n\t\t\t$num1 = rand(1, 9);\n\t\t\t$num2 = rand(1, 9);\n\t\t\t$rand_operator_position = rand(0,2);\n\t\t\t$operator = ['+','-','*'] ;\n\t\t\t$rand_operator = $operator[$rand_operator_position];\n\t\t\t$result = self::create_operation($num1,$num2,$rand_operator);\n\t\t\t$math = $num1 . \"$rand_operator\" . $num2 . \"=\";\n\t\t\t// Initializing session variable with above generated sub-string\n\t\t\t$_SESSION[\"captcha_code\"] = $result;\n\t\t\treturn $math;\n\t}",
"function cf_bypass_solve_challenge($content){\r\n\tglobal $url,$url_info;\r\n\tpreg_match('/setTimeout\\(function\\(\\)\\{(.*)\\}, 4000\\);/s', $content, $matches);\r\n\t\r\n\t$main = $matches[1];\r\n\t$lines = explode(';', $main);\r\n\t$p1 = $lines[0];\r\n\t\r\n\t// find the variable name first\r\n\tpreg_match('/, (.*)={\"(.*)\":/', trim($p1), $matches);\r\n\t$variable = $matches[1] . '.' . $matches[2];\r\n\t\r\n\t// find first formula\r\n\tpreg_match('/\":(.*)\\}/', $p1, $matches);\r\n\t\r\n\t$formula1 = $matches[1];\r\n\t\r\n\t$answer = cf_formula_calculate($formula1);\r\n\t\r\n\t$operator = array('-=','*=','+=');\r\n\tforeach($lines as $line){\r\n\t\t$lines = trim($line);\r\n\t\t\r\n\t\tif($line == '' || strpos($line, $variable) === false) continue;\r\n\t\t\r\n\t\tforeach($operator as $op){\r\n\t\t\tif(strpos($line, $variable . $op) !== false){\r\n\t\t\t\t$formula = str_replace($variable . $op, '', $line);\r\n\t\t\t\tswitch($op){\r\n\t\t\t\t\tcase '-=':\r\n\t\t\t\t\t\t$answer -= cf_formula_calculate($formula);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase '*=':\r\n\t\t\t\t\t\t$answer *= cf_formula_calculate($formula);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase '+=':\r\n\t\t\t\t\t\t$answer += cf_formula_calculate($formula);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t// 15 is the domain length of novelplanet.com\t\t\r\n\t//$answer = 15 + round($answer, 10);\r\n\t$answer = strlen($url_info['host']) + round($answer, 10);\r\n\t\r\n\treturn $answer;\r\n}",
"public function solve();",
"public function solve() {\n // delcare a board drawer and a html container (for display)\n\n // the display bit should realy be happening somewhere else...\n // maybe register a drawer with the board or simply keep it independent.\n // it will do for now since I'd like to display game progress easily.\n static $drawer, $html;\n if (!$drawer) {\n $drawer = new BoardDrawer($this->_board);\n $html = $drawer->draw();\n }\n\n // Do the leaset expensinve operations first,\n // until this logic becomes insufficient.\n $opened_new = TRUE;\n while ($opened_new) {\n $tiles = $this->_solveNTN();\n $opened_new = $this->_solveNT0($tiles);\n // uncomment the 'if' lines below to display intermediate steps\n // if ($opened_new) {\n // $html = $drawer->draw();\n // }\n }\n\n // Check if the game is finished and if not, move on to the hardcore stuff.\n if ($this->_board->isGameFinished()) {\n $html = $drawer->draw();\n return $html;\n }\n \n $this->_solveEq(); // hard core stuff.\n\n if ($this->_board->isGameFinished()) {\n $html = $drawer->draw();\n return $html;\n }\n\n // If the game is not finished, rinse and repeat.\n $this->solve();\n //$html = $drawer->draw();\n \n return $html;\n }",
"public abstract function solve();",
"abstract public function solve();",
"public function evaluate();",
"private function _solvePossible(){\n\n// loop for rows\nfor ($i = 0; $i < 9; $i++ ){\n\n// loop for column\nfor ($j = 0; $j < 9; $j++ ){\n\n// if cell ixj is not solved yet\nif ( !$this -> _solvedParts[$i][$j] ){\n\n// solve the cell ixj if possible using probable values\n// calculated\n$this -> _solveIfSolveable ($i, $j);\n}\n}\n}\n}",
"public function registerAnswer() {\n // The eval() function gives us the $answer variable.\n eval(\"\\$answer = \".$this->equation.\";\");\n \n $this->Session->write('MathCaptcha.answer', $answer);\n \n return $answer;\n }",
"abstract public function evaluate();",
"protected function _generateMath() {\n\t\t$n1 = mt_rand(0,10);\n\t\t$n2 = mt_rand(0,10);\n\t\t$humanNbr = array('zero','one','two','three','for','five','six','seven','height','nine','ten');\n\t\t$result = $n1 + $n2;\n\t\t$question = 'How much is ' . $humanNbr[$n1] .' plus ' . $humanNbr[$n2] . '?';\n\n\t\t$captcha = $this->_buildCaptcha(array(\n\t\t\t'question' => $question,\n\t\t\t'result' => $result,\n\t\t\t'type' => Captcha::TYPE_QUESTION\n\t\t));\n\n\t\treturn $captcha;\n\t}",
"private function generateCaptcha()\n\t{\n\t\tlist($a, $b) = array(rand(0, 9), rand(0,9));\n\t\ts::set($this->id.'-captcha-result', $a + $b);\n\t\ts::set($this->id.'-captcha-label',\n\t\t\t$a.' '.l::get('uniform-calc-plus').' '.$b);\n\t}",
"private function prepare_captcha() {\n // Content to be displayed in captcha image\n $display = '';\n // Captcha answer to be stored in SESSION\n $answer = '';\n \n // Create the random math question\n if ($this->type === 'math') {\n $signs = array('+', '-', 'x');\n $result = 0;\n do {\n $sign = $signs[mt_rand(0, 2)];\n $left = mt_rand(1, 10);\n $right = mt_rand(1, 5);\n \n switch($sign) {\n case 'x': \n $result = $left * $right; \n break;\n \n case '-': \n $result = $left - $right; \n break;\n \n default: \n $result = $left + $right; \n break;\n }\n } while ($result <= 0); // no negative #'s or 0\n \n $display = \"$left $sign $right = ?\";\n $answer = (string) $result;\n }\n \n // Create the random text\n if ($this->type === 'text') {\n $pool = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';\n // Generate each random character\n for ($i = 0, $mt_rand_max = strlen($pool) - 1; $i < 5; $i++) {\n $display .= $pool[mt_rand(0, $mt_rand_max)];\n }\n // Answer is the same as the display\n $answer = $display;\n }\n \n // Returns the content and correct answer of the captcha\n return array(\n 'display' => $display,\n 'answer' => $answer\n );\n }",
"function EvaluateExpression($expr) // Recipe 31\n{\n //\n // This recipe accepts a string containing an arithmetic\n // expression and returns the result of evaluating it.\n // Over 20 functions are also supported. The argument\n // required is:\n //\n // $expr: The arithmetic expression\n \n $f1 = array ('abs', 'acos', 'acosh', 'asin', 'asinh',\n 'atan', 'atan2', 'atanh', 'cos', 'cosh',\n 'exp', 'expm1', 'log', 'log10', 'log1p',\n 'pi', 'pow', 'sin', 'sinh', 'sqrt',\n 'tan', 'tanh');\n\n $f2 = array ('!01!', '!02!', '!03!', '!04!', '!05!',\n '!06!', '!07!', '!08!', '!09!', '!10!',\n '!11!', '!12!', '!13!', '!14!', '!15!',\n '!16!', '!17!', '!18!', '!19!', '!20!',\n '!21!', '!22!');\n\n $expr = strtolower($expr);\n $expr = str_replace($f1, $f2, $expr);\n $expr = preg_replace(\"/[^\\d\\+\\*\\/\\-\\.(),! ]/\", '', $expr);\n $expr = str_replace($f2, $f1, $expr);\n\n // Uncomment the line below to see the sanitized expression\n // echo \"$expr<br />\\n\";\n\n return eval(\"return $expr;\");\n}",
"public function solve() {\n\t\t$this->directions = $this->board->getDirections();\n\t\treturn $this->{'findSolution'.(rand(1,2))}(1);\n\t}",
"function code_solver($ivvallist) {\r\n\r\n// unpack the ivs\r\n$FB= $ivvallist[0];\r\n$FC= $ivvallist[1];\r\n$FD= $ivvallist[2];\r\n\r\n// run the solution code\r\n$FRmag= sqrt(((((-10*$FB)/(sqrt(10*10+15*15+30*30)))+((20*$FC)/(sqrt(20*20+25*25+30*30)))+((10*$FD)/(sqrt(10*10+5*5+30*30))))*(((-10*$FB)/(sqrt(10*10+15*15+30*30)))+((20*$FC)/(sqrt(20*20+25*25+30*30)))+((10*$FD)/(sqrt(10*10+5*5+30*30)))))+((((15*$FB)/(sqrt(10*10+15*15+30*30)))+((25*$FC)/(sqrt(20*20+25*25+30*30)))-((5*$FD)/(sqrt(10*10+5*5+30*30))))*(((15*$FB)/(sqrt(10*10+15*15+30*30)))+((25*$FC)/(sqrt(20*20+25*25+30*30)))-((5*$FD)/(sqrt(10*10+5*5+30*30)))))+((((-30*$FB)/(sqrt(10*10+15*15+30*30)))-((30*$FC)/(sqrt(20*20+25*25+30*30)))-((30*$FD)/(sqrt(10*10+5*5+30*30))))*(((-30*$FB)/(sqrt(10*10+15*15+30*30)))-((30*$FC)/(sqrt(20*20+25*25+30*30)))-((30*$FD)/(sqrt(10*10+5*5+30*30))))));\r\n$alphar= acos((((15*$FB)/(sqrt(10*10+15*15+30*30)))+((25*$FC)/(sqrt(20*20+25*25+30*30)))-((5*$FD)/(sqrt(10*10+5*5+30*30))))/$FRmag);\r\n$betar= acos((((-10*$FB)/(sqrt(10*10+15*15+30*30)))+((20*$FC)/(sqrt(20*20+25*25+30*30)))+((10*$FD)/(sqrt(10*10+5*5+30*30))))/$FRmag);\r\n$gammar= acos((((-30*$FB)/(sqrt(10*10+15*15+30*30)))-((30*$FC)/(sqrt(20*20+25*25+30*30)))-((30*$FD)/(sqrt(10*10+5*5+30*30))))/$FRmag);\r\n$alpha= $alphar*180/M_PI;\r\n$beta= $betar*180/M_PI;\r\n$gamma= $gammar*180/M_PI;\r\n\r\n// pack the results\t\r\n$avvallist[0]= $alpha;\r\n$avvallist[1]= $beta;\r\n$avvallist[2]= $gamma;\r\n$avvallist[3]= $FRmag;\r\n \r\n// return to caller\r\nreturn $avvallist;\r\n}",
"public function solve()\n {\n $a = $this->equation->getA();\n $b = $this->equation->getB();\n $c = $this->equation->getC();\n\n if ($this->getBsmfac($a, $b, $c) < 0) {\n $roots = $this->findImaginaryRoots($a, $b, $c);\n } else {\n $roots = $this->findRealRoots($a, $b, $c);\n }\n\n $roots = $this->orderRoots($roots);\n\n $this->saveRootsAsStrings($roots);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Adds a JOIN clause to the query using the CityRelatedByFromCityId relation | public function joinCityRelatedByFromCityId($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('CityRelatedByFromCityId');
// create a ModelJoin object for this join
$join = new ModelJoin();
$join->setJoinType($joinType);
$join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
if ($previousJoin = $this->getPreviousJoin()) {
$join->setPreviousJoin($previousJoin);
}
// add the ModelJoin to the current object
if ($relationAlias) {
$this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
$this->addJoinObject($join, $relationAlias);
} else {
$this->addJoinObject($join, 'CityRelatedByFromCityId');
}
return $this;
} | [
"public function joinEsCitiesRelatedByIdCity1($relationAlias = null, $joinType = Criteria::LEFT_JOIN)\n {\n $tableMap = $this->getTableMap();\n $relationMap = $tableMap->getRelation('EsCitiesRelatedByIdCity1');\n\n // create a ModelJoin object for this join\n $join = new ModelJoin();\n $join->setJoinType($joinType);\n $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);\n if ($previousJoin = $this->getPreviousJoin()) {\n $join->setPreviousJoin($previousJoin);\n }\n\n // add the ModelJoin to the current object\n if ($relationAlias) {\n $this->addAlias($relationAlias, $relationMap->getRightTable()->getName());\n $this->addJoinObject($join, $relationAlias);\n } else {\n $this->addJoinObject($join, 'EsCitiesRelatedByIdCity1');\n }\n\n return $this;\n }",
"public function joinCity($relationAlias = null, $joinType = Criteria::LEFT_JOIN)\n\t{\n\t\t$tableMap = $this->getTableMap();\n\t\t$relationMap = $tableMap->getRelation('City');\n\n\t\t// create a ModelJoin object for this join\n\t\t$join = new ModelJoin();\n\t\t$join->setJoinType($joinType);\n\t\t$join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);\n\t\tif ($previousJoin = $this->getPreviousJoin()) {\n\t\t\t$join->setPreviousJoin($previousJoin);\n\t\t}\n\n\t\t// add the ModelJoin to the current object\n\t\tif($relationAlias) {\n\t\t\t$this->addAlias($relationAlias, $relationMap->getRightTable()->getName());\n\t\t\t$this->addJoinObject($join, $relationAlias);\n\t\t} else {\n\t\t\t$this->addJoinObject($join, 'City');\n\t\t}\n\n\t\treturn $this;\n\t}",
"public function joinFoo()\n {\n $this->db->join($this->M_foo->table, \"{$this->M_foo->table}.{$this->M_foo->primaryKey} = {$this->table}.foo_id\");\n }",
"public function joinCity($relationAlias = null, $joinType = Criteria::LEFT_JOIN)\n {\n $tableMap = $this->getTableMap();\n $relationMap = $tableMap->getRelation('City');\n\n // create a ModelJoin object for this join\n $join = new ModelJoin();\n $join->setJoinType($joinType);\n $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);\n if ($previousJoin = $this->getPreviousJoin()) {\n $join->setPreviousJoin($previousJoin);\n }\n\n // add the ModelJoin to the current object\n if ($relationAlias) {\n $this->addAlias($relationAlias, $relationMap->getRightTable()->getName());\n $this->addJoinObject($join, $relationAlias);\n } else {\n $this->addJoinObject($join, 'City');\n }\n\n return $this;\n }",
"public function joinEsCitiesRelatedByIdRegion($relationAlias = null, $joinType = Criteria::LEFT_JOIN)\n {\n $tableMap = $this->getTableMap();\n $relationMap = $tableMap->getRelation('EsCitiesRelatedByIdRegion');\n\n // create a ModelJoin object for this join\n $join = new ModelJoin();\n $join->setJoinType($joinType);\n $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);\n if ($previousJoin = $this->getPreviousJoin()) {\n $join->setPreviousJoin($previousJoin);\n }\n\n // add the ModelJoin to the current object\n if ($relationAlias) {\n $this->addAlias($relationAlias, $relationMap->getRightTable()->getName());\n $this->addJoinObject($join, $relationAlias);\n } else {\n $this->addJoinObject($join, 'EsCitiesRelatedByIdRegion');\n }\n\n return $this;\n }",
"public function joinCustomers()\n {\n $this->builder->join('customers', 'cus_id', 'book_customer');\n }",
"public function joinCityBuilding($relationAlias = null, $joinType = Criteria::LEFT_JOIN)\n\t{\n\t\t$tableMap = $this->getTableMap();\n\t\t$relationMap = $tableMap->getRelation('CityBuilding');\n\n\t\t// create a ModelJoin object for this join\n\t\t$join = new ModelJoin();\n\t\t$join->setJoinType($joinType);\n\t\t$join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);\n\t\tif ($previousJoin = $this->getPreviousJoin()) {\n\t\t\t$join->setPreviousJoin($previousJoin);\n\t\t}\n\n\t\t// add the ModelJoin to the current object\n\t\tif($relationAlias) {\n\t\t\t$this->addAlias($relationAlias, $relationMap->getRightTable()->getName());\n\t\t\t$this->addJoinObject($join, $relationAlias);\n\t\t} else {\n\t\t\t$this->addJoinObject($join, 'CityBuilding');\n\t\t}\n\n\t\treturn $this;\n\t}",
"private function addJoinsToQuery()\n {\n if (!empty($this->joins)) {\n foreach ($this->joins as $join) {\n $this->query .= \" {$join->type} `{$this->dbName}`.`{$join->tableToJoin}`\";\n \n if (!empty($join->alias)) {\n $this->query .= \" AS {$join->alias}\";\n }\n \n $this->query .= \" ON `{$this->dbName}`.\";\n \n $this->query .= \"`\".(!empty($join->alias) ? $join->alias : $join->tableToJoin).\"`.\";\n \n $this->query .= \"`{$join->tableField}` =\";\n \n $this->query .= \" `{$this->dbName}`.`{$join->parentTable}`.`{$join->parentField}`\";\n if ($join->additionalCondition) {\n $this->query .= \" \".$join->additionalCondition;\n }\n }\n }\n }",
"public function joinZipToCity($relationAlias = null, $joinType = Criteria::INNER_JOIN)\n {\n $tableMap = $this->getTableMap();\n $relationMap = $tableMap->getRelation('ZipToCity');\n\n // create a ModelJoin object for this join\n $join = new ModelJoin();\n $join->setJoinType($joinType);\n $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);\n if ($previousJoin = $this->getPreviousJoin()) {\n $join->setPreviousJoin($previousJoin);\n }\n\n // add the ModelJoin to the current object\n if ($relationAlias) {\n $this->addAlias($relationAlias, $relationMap->getRightTable()->getName());\n $this->addJoinObject($join, $relationAlias);\n } else {\n $this->addJoinObject($join, 'ZipToCity');\n }\n\n return $this;\n }",
"public function join()\n\t{\n\t\t// We do a left outer join here because we're not trying to limit the primary table's results\n\t\t// This function is primarily used when needing to sort by a field in the joined table\n\t\t$this->model->select($this->model->getQualifiedFieldName('*'))\n\t\t ->select($this->related->getQualifiedFieldName('*'))\n\t\t ->join($this->associativeTable,\n\t\t $this->model->getQualifiedFieldName($this->localKey),\n\t\t $this->associativeLocal,\n\t\t 'LEFT OUTER')\n\t\t ->join($this->related->getTableName(),\n\t\t $this->associativeRelated,\n\t\t $this->related->getQualifiedFieldName($this->relatedKey),\n\t\t 'LEFT OUTER');\n\n\t\treturn $this;\n\t}",
"function join_setting(){\n\t\t//$this->db->join('area_city ac' , 'ac.ac_id = member_address.ac_id' , 'left');\n\t}",
"public function addJoin(JoinQueryComponent $component) { $this->joins[] = $component; }",
"private function _applyJoinParams()\n {\n if ($this->join !== null) {\n foreach ($this->join as $join) {\n $this->query->join[] = $join;\n $this->subQuery->join[] = $join;\n }\n }\n }",
"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 }",
"protected abstract function getJoinStatement();",
"private function applyJoins()\n {\n if (isset($this->joins[0])) {\n $this->applyJoin($this->queryBuilder, $this, $this->joins[0]);\n }\n }",
"public function get_join_clause()\n {\n return $this->condition->get_join_clause();\n }",
"abstract function appendJoin(AbstractQuery &$query, $sourceAlias, $targetAlias, $left_join = false);",
"public function joinCustomer()\n {\n $joinTable = $this->getTable('customer_grid_flat');\n $this->getSelect()->join($joinTable.' as cgf', 'main_table.seller_id = cgf.entity_id');\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the policy number | public function setPolicyNumber($policyNumber)
{
$this->policynumber = $policyNumber;
return $this;
} | [
"public function getPolicyNumber()\n {\n return $this->policyNumber;\n }",
"public function setPolicyId($val)\n {\n $this->_propDict[\"policyId\"] = $val;\n return $this;\n }",
"public function getPolicyNumber() {\n\t\t\n\t\treturn $this->_policyNumber;\n\t}",
"public function setPolicyNumber($policyNumber)\n {\n $this->policyNumber = $policyNumber;\n return $this;\n }",
"public function setPolicy($val)\n {\n $this->_propDict[\"policy\"] = $val;\n return $this;\n }",
"public function getPolicyNumber() {\n return $this->_quoteModel->policyNumber;\n }",
"public function setPolicy($policy) {\n\t\t$this->watchPolicy = $policy;\n\t}",
"public function changeQuoteToPolicy($quoteNumber, $policyNumber = null) {\n\n\t\t//Test to see if a test account was used to enter the policy\n\t\t$tester = new Manager_Core_Test();\n\t\tif($tester->isTestPolicy($quoteNumber)) {\n\n\t\t\t//Populate a TestPolicy object into the datasource.\n\t\t\t$testPolicy = new Model_Core_TestPolicy();\n\n\t \t$legacyQuoteDatasource = new Datasource_Insurance_LegacyQuotes();\n\t \t$quote = $legacyQuoteDatasource->getByPolicyNumber($quoteNumber);\n $testPolicy->agentschemeno = $quote->agentSchemeNumber;;\n\n $testPolicy->csuid = 87;\n $testPolicy->isTestPolicy = \"Yes\";\n $testPolicy->policynumber = $quoteNumber;\n\n $testPolicyDatasource = new Datasource_Insurance_Policy_TestPolicy();\n $testPolicyDatasource->insertTestPolicy($testPolicy);\n\t\t}\n\n\t\t// We only have a legacy quote number so we need to find the new quote number\n\t\t$quoteDatasource = new Datasource_Insurance_Quotes();\n\t\t$quoteID = $quoteDatasource->getIDByLegacyID($quoteNumber);\n\n\t\t$changeableArray = array();\n\t\t$changeableArray[] = new Datasource_Insurance_Answers();\n\t\t$changeableArray[] = new Datasource_Insurance_Endorsements();\n\t\t$changeableArray[] = new Datasource_Insurance_AdditionalInformation();\n $changeableArray[] = new Datasource_Insurance_Policy_Term();\n\t\t$changeableArray[] = new Datasource_Core_UnderwritingEmailLog();\n\t\t$changeableArray[] = new Datasource_Core_DirectDebit_Payment();\n\t\t$changeableArray[] = new Datasource_Core_CreditCard_Transaction();\n\t\t$changeableArray[] = new Datasource_Core_CreditCard_Payment();\n\t\t$changeableArray[] = new Datasource_Insurance_Schedules();\n\t\t$changeableArray[] = new Manager_Insurance_LandlordsPlus_Quote($quoteID);\n\n $changeableArray[] = new Datasource_Core_CustomerContactPreferences();\n $changeableArray[] = new Datasource_Insurance_DocumentQueue();\n $changeableArray[] = new Datasource_Insurance_DocumentHistory();\n\n\t\t$changeableArray[] = new Datasource_Insurance_DocumentQueue();\n\t\t$changeableArray[] = new Datasource_Insurance_PolicyNotes();\n\t\t$changeableArray[] = new Datasource_Insurance_Policy_Cover();\n\t\t$changeableArray[] = new Datasource_Insurance_Policy_PolicyTermItemHist();\n\t\t$changeableArray[] = new Datasource_Insurance_LandlordsPlus_Legacy_Sivalue();\n\t\t$changeableArray[] = new Datasource_Insurance_LandlordsPlus_Legacy_PolicyVariables();\n\t\t$changeableArray[] = new Datasource_Insurance_LegacyBankInterest();\n $changeableArray[] = new Datasource_Insurance_IddSupport();\n $changeableArray[] = new Datasource_Insurance_CompletionNotes();\n $changeableArray[] = new Datasource_Insurance_Channel();\n\t\tforeach($changeableArray as $currentChangeable) {\n\t\t\t$currentChangeable->changeQuoteToPolicy($quoteNumber, $policyNumber);\n\t\t}\n\t}",
"public function setCompliancePolicyCount(?int $value): void {\n $this->getBackingStore()->set('compliancePolicyCount', $value);\n }",
"function set_pr_num( ) {\n global $argv;\n // expected usage : \"script.php 1337\" or \"php script.php 1337\"\n // First element of $argv will be the script file itself, second will be the PR number\n\n if( count( $argv ) != 2 or !ctype_digit( $argv[1] )) {\n $this->error_and_die( \"Usage :\\ngit pr [PR number]\\nSee README\" );\n die();\n }\n \n $this->pr = $argv[1];\n \n }",
"public function setPolicy( $policy )\n {\n if ( !is_string( $policy ) || strlen( $policy ) < 1 ) {\n throw new InvalidArgumentException( __METHOD__ . ' expects parameter 1 to be a non-empty string' );\n }\n \n $this->_creationParams[self::PARAM_POLICY] = $policy;\n }",
"public function withInhibitAnyPolicy(int $num): self\n {\n $state = clone $this;\n $state->_inhibitAnyPolicy = $num;\n return $state;\n }",
"public function setProvisioningPolicyId(?string $value): void {\n $this->getBackingStore()->set('provisioningPolicyId', $value);\n }",
"public function changeQuoteToPolicy($quoteNumber, $policyNumber = null) {\n\t\t\n\t//If policyNumber is empty then assume the QHLI should be replaced with PHLI.\n\tif(empty($policyNumber)) {\t\t\n\t\t$policyNumber = preg_replace('/^Q/', 'P', $quoteNumber);\n\t}\n\t\n try {\n $data = array('policynumber' => $policyNumber);\n $where = $this->quoteInto('policynumber = ?', $quoteNumber);\n\t\n return $this->update($data, $where);\n } catch (Exception $e) {\n throw new Zend_Exception('changeQuoteToPolicy - Couldn\\'t conver quote to policy...');\n }\n }",
"public function setPolicyVersion(?string $value): void {\n $this->getBackingStore()->set('policyVersion', $value);\n }",
"public function setProviderNumber($provider)\n {\n // Make sure the provider field is not empty\n if (empty($provider))\n {\n echo \"ERROR: Provider must be provided for this claim.\\n\";\n return;\n }\n\n $this->providerNumber = $provider;\n\t}",
"public function setPriority($number = 0) {\n // TODO: I looked and tested but I can not figure out what these values\n // should be.....\n switch ($number) {\n case 0:\n $priority = 'NORMAL';\n break;\n case -1:\n $priority = 'LOW';\n break;\n case 1:\n $priority = 'HIGH';\n break;\n default:\n $priority = 'NORMAL';\n }\n $this->addHeader('priority', $priority);\n }",
"public function setNum(int $num)\n {\n $this->num = $num;\n }",
"public function setNum(?int $num)\n {\n $this->num = $num;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get method for form. | protected function getFormMethod(){
return $this->_method;
} | [
"public function getFormMethod();",
"public function getMethod()\n\t{\n\t\treturn $this->_formMethod;\n\t}",
"public function get_method() {\n\t\treturn apply_filters('audition_get_form_method', $this->method, $this);\n\t}",
"function GetFormMethod() {\n\t\treturn $this->m_formMethod;\n\t}",
"public function getFormMethod()\n {\n return $this->formMethod;\n }",
"public function getMethod()\n {\n return $this->formOptions['method'];\n }",
"function getFormMethod()\n {\n return '';\n }",
"public function getFormMethod ()\n {\n return 'POST';\n }",
"public function getMethod() {\n\t\treturn strlen($this->getInput()) ? 'POST' : 'GET';\n\t}",
"public static function method(){\n\t\treturn $_SERVER['REQUEST_METHOD'];//this will give us get or post method\n\t}",
"public function getMethod()\n {\n if ($this->content !== null) {\n return 'POST';\n } else {\n return 'GET';\n }\n }",
"public function get_method() {\n\n\t\treturn $this->request_method;\n\t}",
"function cleanFormMethodType( string $v ) : string {\n\t$v = trim( $v );\n\tif (\n\t\t0 == \\strcasecmp( $v, 'GET' )\t|| \n\t\t0 == \\strcasecmp( $v, 'POST' )\n\t) {\n\t\treturn $v;\n\t}\n\t\n\treturn 'get';\n}",
"public function getForm();",
"function form_method($method)\n{\n echo '<input type=\"hidden\" name=\"_method\" value=\"' . $method . '\">';\n}",
"function methodForm($methodForm){\r\n\t\t$this->methodForm = strtoupper($methodForm);\r\n\t\tif (!($methodForm==\"POST\" or $methodForm==\"GET\")) $methodForm=\"GET\";\r\n\t}",
"public function getMethod()\n {\n return !empty($this->method) ? $this->method : 'GET';\n }",
"private static function getMethod()\n {\n return Request::method();\n }",
"public static function cleanFormMethodType( string $v ) : string {\n\t\t$v = \\trim( $v );\n\t\tif (\n\t\t\t0 == \\strcasecmp( $v, 'GET' )\t|| \n\t\t\t0 == \\strcasecmp( $v, 'POST' )\n\t\t) {\n\t\t\treturn $v;\n\t\t}\n\t\t\n\t\treturn 'get';\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Show calendar overview over when comments are made | public function executeCommentsCalendar()
{
$date = $this->getRequestParameter('date');
$date = !$date?date('Y-m-d'):$date;
$c = new commentCalendar('month', $date);
$calendar = $c->getEventCalendar();
$date_array = explode('-', $date);
$this->prev_month = $c->getCalendar()->beginOfPrevMonth($date_array[2],$date_array[1],$date_array[0], '%Y-%m-%d');
$this->next_month = $c->getCalendar()->beginOfNextMonth($date_array[2],$date_array[1],$date_array[0], '%Y-%m-%d');
$this->date = $date;
$this->calendar = $calendar;
} | [
"function printCalendarContents() {\n\t\t$client = $this->businessLogic->client;\n\t $this->putCalendarTitle($client);\n\t $eventsForCalendar = $this->businessLogic->getEventsForCalendar(htmlspecialchars($_GET['showThisCalendar']));\n\t foreach ($eventsForCalendar as $event) {\n\t $this->putEventListElement($event);\n\t }\n\t}",
"public function show_comments()\n\t{\n\t\t$items_per_page = $this->input->get('items_per_page', config::get('pagination.default.items_per_page', '*'));\n\t\t$this->template->content = $this->add_view('extinfo/all_comments');\n\t\t$this->template->js_header = $this->add_view('js_header');\n\t\t$this->template->css_header = $this->add_view('css_header');\n\t\t$this->template->content->host_comments = $this->_comments(true, false, 'host', true, $items_per_page);\n\t\t$this->template->content->service_comments = $this->_comments(true, true, 'service', true, $items_per_page);\n\t\t$this->template->title = $this->translate->_('Monitoring » All comments');\n\t}",
"function DisplayCalendarOfEvents()\r\n\t{\r\n\t\tglobal $_SETTINGS;\r\n\t\techo \"<div id='calendar'></div>\";\t\r\n\t}",
"public function comments()\n {\n $task = $this->getTask();\n $commentSortingDirection = $this->userMetadataCacheDecorator->get(UserMetadataModel::KEY_COMMENT_SORTING_DIRECTION, 'ASC');\n\n $this->response->html($this->template->render('CommentTooltip:board/tooltip_comments', array(\n 'task' => $task,\n 'comments' => $this->commentModel->getAll($task['id'], $commentSortingDirection)\n )));\n }",
"function show_events_cal() {\n global $txtf;\n\n $structure = $this->vars['structure'];\n $content = $this->vars['content'];\n $day = $this->vars['day'];\n $month = $this->vars['month'];\n $year = $this->vars['year'];\n $hour = $this->vars['hour'];\n $minute = $this->vars['minute'];\n\n $sq = new sql;\n\n if ($this->vars[\"structure\"] && !$this->vars[\"content\"]) {\n $this->url_page = $_SERVER['PHP_SELF'] . \"?structure=\".$this->vars[\"structure\"];\n }\n else if ($this->vars[\"structure\"] && $this->vars[\"content\"]) {\n $this->url_page = $_SERVER['PHP_SELF'] . \"?structure=\".$this->vars[\"structure\"].\"&content=\".$this->vars[\"content\"];\n }\n else {\n $this->url_page = \"?\";\n }\n\n if (!$this->url) {\n $this->url = $this->url_page;\n }\n\n if (!ereg(\"\\?\", $this->url)) $this->url .= \"?\";\n if (!ereg(\"\\?\", $this->url_page)) $this->url_page .= \"?\";\n\n\n $month_name = array (\"\", $txtf->display(\"month_1\"), $txtf->display(\"month_2\"), $txtf->display(\"month_3\"), $txtf->display(\"month_4\"), $txtf->display(\"month_5\"), $txtf->display(\"month_6\"), $txtf->display(\"month_7\"), $txtf->display(\"month_8\"), $txtf->display(\"month_9\"), $txtf->display(\"month_10\"), $txtf->display(\"month_11\"), $txtf->display(\"month_12\"));\n $day_name = array($txtf->display(\"day_1\"), $txtf->display(\"day_2\"), $txtf->display(\"day_3\"), $txtf->display(\"day_4\"), $txtf->display(\"day_5\"), $txtf->display(\"day_6\"), $txtf->display(\"day_0\"));\n\n $datime = time();\n\n if(!isset($month) || !is_numeric($month)) {\n $month = date(\"n\", $datime);\n }\n\n if(!isset($year) || !is_numeric($year)) {\n $year = date(\"Y\", $datime);\n }\n\n if ($month == date(\"n\",$datime) && $year == date(\"Y\",$datime)) {\n $today = date(\"j\", $datime);\n }\n\n if(!isset($hour)) $hour = date(\"H\");\n if(!isset($minute)) $minute = date(\"i\");\n\n // ########################################\n\n // instantiate template class\n $tpl = new template;\n $tpl->setCacheLevel($this->cachelevel);\n $tpl->setCacheTtl($this->cachetime);\n $usecache = checkParameters();\n\n $dirname_this = dirname($_SERVER[\"PHP_SELF\"]);\n\n if (substr($dirname_this, -5) == \"admin\" && basename($_SERVER[\"PHP_SELF\"]) != \"index.php\") {\n $template = $this->template;\n }\n else {\n $template = $GLOBALS[\"templates_\".$this->language][$this->tmpl][1] . \"/\" . $this->template;\n }\n\n $tpl->setInstance($_SERVER['PHP_SELF'].\"?language=\".$this->language.\"&module=calendar&day=$day&month=$month&year=$year\");\n $tpl->setTemplateFile($template);\n\n // PAGE CACHED\n if ($tpl->isCached($template) == true && $usecache == true) {\n $GLOBALS[\"caching\"][] = \"calendar\";\n if ($GLOBALS[\"modera_debug\"] == true) {\n return \"<!-- module calendar cached -->\\n\" . $tpl->parse();\n }\n else {\n return $tpl->parse();\n }\n }\n\n $lastmonth = $month - 1;\n $lastyear = $year;\n if ($lastmonth < 1) { $lastmonth = 12; $lastyear = $year - 1; }\n $tpl->addDataItem(\"URL_PREVIOUS\", $this->url . \"&year=$lastyear&month=$lastmonth\");\n\n $nextmonth = $month + 1;\n $nextyear = $year;\n if ($nextmonth > 12) { $nextmonth = 1; $nextyear = $year + 1; }\n $tpl->addDataItem(\"URL_NEXT\", $this->url . \"&year=$nextyear&month=$nextmonth\");\n $tpl->addDataItem(\"CURRENT_MONTH\", $month_name[$month] . \" \" . $year);\n\n $wdays = \"<th class=\\\"static\\\">\" . $txtf->display(\"week_short\") . \"</th>\\n\";\n for ($c = 0; $c < 7; $c++) {\n $wdays .= \"<th>\".substr($day_name[$c],0,1).\"</th>\\n\";\n }\n\n $tpl->addDataItem(\"WEEKDAYS\", $wdays);\n\n // ####\n // Initial empty days\n $c = 1;\n $firstmonday = date(\"w\", mktime(0,0,0,$month, 1, $year));\n if ($firstmonday == 0) $firstmonday = 7;\n $dayz = \"<tr>\\n\";\n // WEEK NUMBER\n if ($c != $firstmonday) {\n $wn = date(\"W\", mktime(0, 0, 0, $month, $c, $year)) + 0;\n $dayz .= \"<td class=\\\"static\\\">\" . $wn . \"</td>\\n\";\n\n while ($firstmonday > $c) {\n $dayz .= \"<td> </td>\\n\";\n $c++;\n }\n }\n // ####\n\n for ($c = 1; $c <= 31; $c++) {\n $wd = date(\"w\", mktime(0, 0, 0, $month, $c, $year));\n if (!$wd) {\n $wd = 7;\n }\n\n // TODAY\n if($c == $today) {\n $daystyle = \"today\";\n }\n elseif($c != $today) {\n $daystyle = \"\";\n }\n if ($wd == 6 || $wd == 7) {\n $daystyle = ($daystyle ? $daystyle . \" \" : \"\") . \"sunday\";\n }\n\n\n // SELECTED DAY\n// if ($c == $day) { $daystyle = \"selected\"; }\n\n if ($wd == 1) { // monday\n $dayz .= \"<tr>\\n\";\n // WEEK NUMBER\n $wn = date(\"W\", mktime(0, 0, 0, $month, $c, $year)) + 0;\n $dayz .= \"<td class=\\\"static\\\">\" . $wn . \"</td>\\n\";\n }\n\n if (checkdate($month, $c, $year)) {\n if (is_array($this->events[$year][$month][$c])) {\n $dayz .= \"<td class=\\\"$daystyle\\\"><a href=\\\"\".$this->url.\"&day=\".$c.\"&month=\".$month.\"&year=\".$year.\"\\\"><b>$c</b></a></td>\\n\";\n }\n else {\n $dayz .= \"<td class=\\\"$daystyle\\\"><a href=\\\"\".$this->url.\"&day=\".$c.\"&month=\".$month.\"&year=\".$year.\"\\\">$c</a></td>\\n\";\n }\n }\n\n if ($wd == 7) { // sunday\n $dayz .= \"</tr>\\n\";\n }\n }\n\n if ($wd < 7) {\n for ($i = $wd; $i <= 7; $i++) {\n $dayz .= \"<td> </td>\\n\";\n }\n $dayz .= \"</tr>\\n\";\n }\n\n $tpl->addDataItem(\"DAYS\", $dayz);\n\n $f_hour = \"\";\n for ($c = 0; $c < 24; $c++) {\n if ($c < 10) $z = \"0\" . $c;\n else { $z = $c; }\n if ($hour == $z) $sel = \"selected\";\n else { $sel = \"\"; }\n $f_hour .= \"<option value=\\\"$z\\\" $sel>$z</option>\\n\";\n }\n $f_minute = \"\";\n for ($c = 0; $c < 60; $c = $c + 5) {\n if ($c < 10) $z = \"0\" . $c;\n else { $z = $c; }\n if ($minute == $z) $sel = \"selected\";\n else { $sel = \"\"; }\n $f_minute .= \"<option value=\\\"$z\\\" $sel>$z</option>\\n\";\n }\n\n // Hours\n $tpl->addDataItem(\"HOURS\", $f_hour);\n // Minutes\n $tpl->addDataItem(\"MINUTES\", $f_minute);\n\n if (!$day) $day = date(\"j\");\n\n $tpl->addDataItem(\"DAY\", $day);\n $tpl->addDataItem(\"MONTH\", $month);\n $tpl->addDataItem(\"YEAR\", $year);\n $tpl->addDataItem(\"HOUR\", $hour);\n $tpl->addDataItem(\"MINUTE\", $minute);\n $tpl->addDataItem(\"FIELD\", $this->field);\n $tpl->addDataItem(\"TYPE\", $_GET[\"type\"]);\n\n // ####\n return $tpl->parse();\n\n }",
"function viewLayoutComments($monograph) {\n\t\tif (HookRegistry::call('SeriesEditorAction::viewLayoutComments', array(&$monograph))) return;\n\n\t\timport('classes.submission.form.comment.LayoutCommentForm');\n\n\t\t$commentForm = new LayoutCommentForm($monograph, Validation::isEditor()?ROLE_ID_EDITOR:ROLE_ID_SERIES_EDITOR);\n\t\t$commentForm->initData();\n\t\t$commentForm->display();\n\t}",
"public function drawCalendar(){\n\t$creator_id = $this->getUserID();\n \t$pageName = \"d3Calendar\";\n\tinclude_once SYSTEM_PATH.'/view/header.tpl';\n include_once SYSTEM_PATH.'/view/d3Calendar.tpl';\n include_once SYSTEM_PATH.'/view/footer.tpl';\n }",
"private function calendar()\n {\n $calendars = array_map(\n function( $item ){ return basename( $item, '.png' ); },\n array_values ( Kohana::list_files( 'images' . DIRECTORY_SEPARATOR . 'calendar', [ DOCROOT ] ) )\n );\n \n $m = date( 'm' );\n $y = date( 'Y' );\n\n $actual = array_search( sprintf( '%d_%s', $y, $m ), $calendars );\n\n $this->_page->content = View::factory( 'front/tplt/front_tplt_calendar',\n [\n 'actual' => $actual,\n 'months' => __( 'months' ),\n 'm' => $m,\n 'y' => $y,\n 'calendars' => $calendars\n ] );\n\n array_push( $this->styles, 'almafont', 'magnific-popup' );\n\n array_push( $this->scripts, 'magnific-popup', 'calendar' );\n }",
"public function addViewCalendar() {\n\t\t\tif ( Tribe__Admin__Helpers::instance()->is_screen( 'edit-' . self::POSTTYPE ) ) {\n\t\t\t\t//Output hidden DIV with Calendar link to be displayed via javascript\n\t\t\t\techo '<div id=\"view-calendar-link-div\" style=\"display:none;\"><a class=\"add-new-h2\" href=\"' . esc_url( $this->getLink() ) . '\">' . esc_html__( 'View Calendar', 'the-events-calendar' ) . '</a></div>';\n\t\t\t}\n\t\t}",
"public function calendar()\n {\n $this->response->html($this->helper->layout->admin('admin/setting/calendar', [\n 'title' => t('Admin').' » '.t('Calendar settings'),\n ]));\n }",
"public function index()\n {\n $this->view('calendar');\n }",
"function wp_dashboard_recent_comments_control() {}",
"function display_calendar ()\n\t\t{\t\n\t\t\tif (!$this->authentication->logged_in (\"admin\"))\n\t\t\t\tredirect(\"admin\");\n\t\t\t\n\t\t\t//calls DML for processing data\n\t\t\tif($_POST)\n\t\t\t\t$this->_dbEventProcessor();\n\t\t\t\n\t\t\t//gets the region and subregion for filter purpose\n\t\t\t$this->_get_regions_subregions();\n\t\t\t\n\t\t\t// gets the calendar (month || year)\n\t\t\tif(isset($_POST['hdnTimeid']) && $_POST['hdnTimeid']!=0)\n\t\t\t\t$time = $_POST['hdnTimeid'];\n\t\t\telse \n\t\t\t\t$time = strtotime('-8 hour');\n\t\t\t\n\t\t\t$this->gen_contents['sec_timing'] = $time;\n\t\t\t\n\t\t\t$_POST['sltSearchRegion'] = '';\n\t\t\t$_POST['sltSearchSubregion'] = '';\n\t\t\t//selected search options are saved to a variable\n\t\t\tif($_POST){\n\t\t\t\t$this->gen_contents['region_search'] \t= $_POST['sltSearchRegion'];\n\t\t\t\t$this->gen_contents['subregion_search'] = $_POST['sltSearchSubregion'];\n\t\t\t}\n\t\t\t\n\t\t\t//helps to change the mode of calendar by choosing the link from subregion list out \n\t\t\tif($this->session->userdata('CLASS')){\n\t\t\t\t$this->gen_contents['class_mode'] \t= 1;\n\t\t\t\t$this->gen_contents['title']\t\t= 'Class Management';\n\t\t\t\t$this->gen_contents['page_title']\t= 'Class Management';\n\t\t\t}\n\t\t\t\t\n\t\t\t// we call _date function to get all the details of calendar n its event\n\t\t\t$this->gen_contents = array_merge($this->gen_contents,$this->_date($time));\n\t\t\t\n\t\t\t//default listing events for the current date\n\t\t\t//'hdnCurrentDate' field stores the date fo today onload\n\t\t\t//once a date is choosen to list the events or for adding the hidden filed will contain that date\n\t\t\t//after traversing the calendar and when returned back to the current month default listing should be provided\n\t\t\tif(isset($_POST['hdnCurrentDate'])){\n\t\t\t\t$this->gen_contents['hdnCurrentDate'] \t= date('Y/m/d',strtotime($_POST['hdnCurrentDate'])); \n\t\t\t\t\n\t\t\t\tif(($this->gen_contents['actual_month_year'] == $this->gen_contents['current_month_year']) && $_POST['hdnCurrentDate'] == ''){\n\t\t\t\t\t$this->gen_contents['hdnCurrentDate'] \t= $this->gen_contents['today'];\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$this->_template('display_calendar',$this->gen_contents);\n\t\t}",
"function disp( ) {\n $date = 1;\n $col = 0;\n \n $id = $this->year\n . ( $this->month < 10 ? ( '0' . $this->month ) : $this->month );\n \n print \"<!-- Calendar for $id -->\\n\\n\";\n \n print \"<div class=\\\"calendar\\\" id=\\\"$id\" . \"\\\">\\n\";\n print \"<table>\\n\";\n print \"<tr class=\\\"head\\\">\\n\";\n print \" <td colspan=\\\"7\\\">\"\n . date( \"F\", mktime( 0, 0, 0, $this->month, 1, $this->year ) )\n . \" \"\n . date( \"Y\", mktime( 0, 0, 0, $this->month, 1, $this->year ) )\n . \"</td>\\n\";\n print \"</tr>\\n\";\n \n print \"<tr class=\\\"cal_row\\\">\\n\";\n for( $col = 0; $col < $this->first_day; $col++ ) {\n print \" <td class=\\\"\" . ( $col == 0 ? \"weekend\" : \"date\" )\n . \"\\\"> </td>\\n\";\n }\n \n while( $date <= $this->num_days ) {\n if( $col % 7 == 0 ) {\n print \"</tr>\\n\\n<tr class=\\\"cal_row\\\">\\n\";\n }\n \n print \" <td id=\\\"$date\\\" \";\n \n if( $this->year == date( \"Y\" ) && $this->month == date( \"m\" ) &&\n $date == date( \"j\" ) && ! isset( $this->attendance ) ) {\n print \"class=\\\"today\\\">\";\n } else if( $col % 7 == 0 || $col % 7 == 6 ) {\n print \"class=\\\"weekend\\\">\";\n } else if( isset( $this->attendance[ $date ] ) &&\n\t\t $this->attendance[ $date ] == 'Present' ) {\n print \"class=\\\"present\\\">\";\n } else if( isset( $this->attendance[ $date ]) &&\n\t\t $this->attendance[ $date ] == 'Absent' ) {\n print \"class=\\\"absent\\\">\";\n } else if( isset( $this->attendance[ $date ]) &&\n\t\t $this->attendance[ $date ] == 'Excused' ) {\n print \"class=\\\"excused\\\">\";\n } else if( isset( $this->holidays[ $date ] ) &&\n\t\t $this->holidays[ $date ] != '' ) {\n print \"class=\\\"holiday\\\" title=\\\"\"\n\t\t . $this->holidays[ $date ][ 'description' ]\n\t\t . '. ';\n\t\tif( $this->holidays[ $date ][ 'day' ] == 1 ) {\n\t\t print 'Day ';\n\t\t if( $this->holidays[ $date ][ 'evening' ] == 1 ) {\n\t\t\tprint 'and evening ';\n\t\t }\n\t\t} else {\n\t\t print 'Evening ';\n\t\t}\n\t\tprint \"classes canceled.\\\">\";\n } else {\n print \"class=\\\"date\\\">\";\n }\n \n if( isset( $this->events[ $date ] ) ) {\n $text = \"\";\n for( $i = 0; $i < count( $this->events[ $date ] ); $i++ ) {\n if( $i > 0 ) {\n $text .= \"; \";\n }\n $text .= $this->events[ $date ][ $i ];\n }\n print \"<a href=\\\"{$this->docroot}/cal_events.php?date={$this->year}-\";\n \n print \"{$this->month}-\";\n \n if( $date < 10 ) {\n print \"0\";\n }\n print \"$date\\\"\\n\";\n print \"title=\\\"$text\\\">$date</a>\";\n } else {\n print \"$date\";\n \n if( isset( $this->attendance ) ) {\n if( isset( $this->attendance[ $date ] ) ) {\n print \"<br />\"\n . substr( $this->attendance[ $date ], 0, 1 );\n }\n }\n \n }\n print \"</td>\\n\";\n $date++;\n $col++;\n }\n\n while( $col % 7 != 0 ) {\n print \" <td class=\\\"\" . ( $col % 7 == 6 ? \"weekend\" : \"date\" )\n . \"\\\"> </td>\\n\";\n $col++;\n }\n \n print \"</tr>\\n</table>\\n</div>\\n\";\n }",
"public function calendar()\n {\n return view('viewers.work-order.calendar', ['workOrder' => $this->entity]);\n }",
"public function indexAction() {\n $date = $this->_getParam('date') ? $this->_getParam('date') : $this->getTimeForForms(); \n $calendar= new Calendar($date); \n $cases = $this->_finds->getFindsByDay();\n $lists = array();\n foreach ($cases as $value) {\n $lists[] = $value['createdOn'];\n }\n $caseslisted = $lists;\n $calendar->highlighted_dates = $caseslisted;\n $calendar->formatted_link_to = $this->view->baseUrl() \n . '/database/search/results/created/%Y-%m-%d';\n print '<div id=\"calendar\">';\n \n for($i=1;$i<=12;$i++){ \n if( $i == $calendar->month ){ \n print($calendar->output_calendar(null,null, 'table table-striped')); \n } else { \n print($calendar->output_calendar($calendar->year, $i, 'table table-striped')); \n } \n } \n print(\"</div>\"); \n }",
"function listAllComments()\n{\n $commentManager = new CommentManager();\n\n $reportedComments = $commentManager->getReportedComments();\n $newComments = $commentManager->getNewComments();\n require('view/backend/commentsView.php');\n}",
"function espresso_eventbrite_display_eventbrite_calendar($atts = ''){\n\tglobal $ee_eb_options, $this_event_id;\n\t\n\tif ( empty($atts) && !empty($this_event_id) ){\n\t\t$event_meta = event_espresso_get_event_meta($this_event_id);\n\t\t$atts['id'] = $event_meta['eventbrite_id'];\n\t}\n\n\t//Load the class files\n\tif(!class_exists('EE_Eventbrite')) { \n\t\trequire_once(\"Eventbrite.php\"); \n\t}\n\t// Initialize the API client\n\t$authentication_tokens = array('app_key' => $ee_eb_options['app_key'],\n\t\t\t\t\t\t\t\t\t 'user_key' => $ee_eb_options['user_key']);\n\t$eb_client = new EE_Eventbrite( $authentication_tokens );\n\t\t\n\t$resp = $eb_client->event_get( array('id' => $atts['id']) );\n\tprint( EE_Eventbrite::calendarWidget($resp->event) );\n}",
"function draw_overview()\n {\n // This shows things under the title of Expiration Settings\n echo \"<p>\";\n _e( 'Indicate whether to process content on expiration, and whether to delete it or make certain changes to it.', 'contentscheduler' );\n echo \"</p>\\n\";\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ $sql="select filing_no from public_servant_partc where ps_first_name ilike '%$name_of_public_servant%' or ps_sur_name ilike '%$name_of_public_servant%' or ps_mid_name ilike '%$name_of_public_servant%' and filing_no!=''"; | function case_search_by_publicservant($name_of_public_servant)
{
$sql="select filing_no from public_servant_partc where (ps_first_name ilike '%$name_of_public_servant%' or ps_sur_name ilike '%$name_of_public_servant%'
or ps_mid_name ilike '%$name_of_public_servant%') and filing_no is not null";
$query = $this->db->query($sql)->result();
return $query;
} | [
"function case_search_by_publicservant_data($name_of_public_servant)\n \t{\n\n \t\t\t/* $sql=\"select filing_no from public_servant_partc where ps_first_name ilike '%$name_of_public_servant%' or ps_sur_name ilike '%$name_of_public_servant%'\n \t\t\t or ps_mid_name ilike '%$name_of_public_servant%' and filing_no!=''\";*/\n\n \t\t\t $sql=\"SELECT psc.filing_no FROM case_detail cd\n \t\t\t inner JOIN public_servant_partc psc ON psc.filing_no = cd.filing_no\n \t\t\t inner JOIN scrutiny s ON s.filing_no = cd.filing_no\n \t\t\t where psc.ps_first_name ilike '%$name_of_public_servant%' or psc.ps_sur_name ilike '%$name_of_public_servant%'\n \t\t\t or psc.ps_mid_name ilike '%$name_of_public_servant%' and cd.filing_no is not null and s.scrutiny_status=TRUE\";\n\n\n\n \t\t\t$query \t= $this->db->query($sql)->result();\n\t\t\treturn $query;\t\n\n\n \t}",
"function bookingkomentar_searchdata( $tbl_bookingkomentar, $cari ){\n\t\t$sql = mysql_query(\"SELECT * FROM $tbl_bookingkomentar WHERE \n\t\t\tjudul LIKE '$cari' OR\n\t\t\tpesan LIKE '$cari' \n\t\t\t\tORDER BY id ASC \n\t\t\"); \n \t\treturn $sql;\n}",
"function bookingstatus_searchdata( $tbl_bookingstatus, $cari ){\n\t\t$sql = mysql_query(\"SELECT * FROM $tbl_bookingstatus WHERE \n\t\t\n\t\t\tkodestatus LIKE '%$cari%' OR,\n\t\t\tname LIKE '%$cari%' OR,\n\t\t\tdescription LIKE '%$cari%' OR,\n\t\t\tnotifikasiemail LIKE '%$cari%'\n\n\t\t\t\tORDER BY id ASC\n\t\t\"); \n \t\treturn $sql;\n}",
"function dbsearch($bname, $zip) {\n if (dbconnect() !== FALSE) {\n $mysql = \"SELECT * FROM Zip WHERE Name = '{$zip}'\" ;\n }\n if (isset($bname)) {\n $term = preg_replace(\"/ /\", \"%\", $bname) ;\n $term = \"%\" . $term . \"%\" ;\n $mysqlstr .= \" AND Name LIKE '{$bname}'\" ;\n }\n if (isset($mysqlstr)) {\n $mysqlstr .= \";\" ;\n }\n return $conn->query($mysqlstr) ;\n}",
"function downloadareakomentar_searchdata( $tbl_downloadareakomentar, $cari ){\n\t\t$sql = mysql_query(\"SELECT * FROM $tbl_downloadareakomentar WHERE \n\t\t\tjudul LIKE '$cari' OR\n\t\t\tpesan LIKE '$cari' \n\t\t\t\tORDER BY id ASC \n\t\t\"); \n \t\treturn $sql;\n}",
"function substringCondition($field, $value)\n {\n if (substr(ltrim(strtoupper($field), ' ('), 0, 7) != \"SELECT \")\n {\n return parent::substringCondition($field, $value);\n }\n \n if($value[0]=='!')\n {\n return \"(SELECT UPPER((\".$field.\")) FROM dual) NOT LIKE '%\".strtoupper(substr($value,1,atk_strlen($value))).\"%'\";\n }\n else\n {\n return \"(SELECT UPPER((\".$field.\")) FROM dual) LIKE '%\".strtoupper($value).\"%'\";\n }\n }",
"function codigoNegocio($idemp)\n{\n\tglobal $con, $dbname;\n\t$cadena = \"\";\n\tif(isset($idemp)&& $idemp!=NULL)\n {\n \t$sql = \"SELECT * FROM `z_sercont` \" . \n \t\"WHERE `idemp` LIKE '{$idemp}' \" . \n \t\"AND `servicio` LIKE 'Codigo Negocio'\";\n\t\t$consulta = mysql_db_query($dbname,$sql,$con);\n\t\tif (mysql_numrows($consulta)>= 0)\n\t\t{\n\t\t\t$resultado = mysql_fetch_array($consulta);\n\t\t\t$cadena .= \"<font size='6'>{$resultado[\"valor\"]}</font>\";\n\t\t}\n\t}\n return $cadena;\n}",
"function search_doctor($first_name, $last_name, $email, $specialty, $contact_no){\n\t\t$query=\"SELECT * FROM doctors where first_name like '%$first_name%' \n\t\tor last_name like '%$last_name%' or email like '%$email%' \n\t\tor specialty like '%$specialty%' or contact_no like '%$contact_no%' \";\n\t\treturn mysqli_query(get_db_connection(), $query);\n\t\t\n\t}",
"function obtenerQueryRazon($razon)\n\t{\n\t\t$razonQuery = \"\";\n\t\tif($razon != 'todo')\n\t\t{\n\t\t\t$razonQuery= \"and `razon_social` LIKE '%\".$razon.\"%'\";\n\t\t}\n\t\treturn $razonQuery; \n\t}",
"function sql_query_faas_profissional($sd24_i_codigo = null, $sd04_i_medico, $sd04_i_unidade, $campos = \"*\",\n $ordem = null, $dbwhere = \"\") {\n $sql = \"select distinct \";\n if($campos != \"*\" ) {\n\n $campos_sql = split(\"#\",$campos);\n $virgula = \"\";\n for($i=0;$i<sizeof($campos_sql);$i++) {\n\n $sql .= $virgula.$campos_sql[$i];\n $virgula = \",\";\n\n }\n\n } else {\n $sql .= $campos;\n }\n $sql .= \" from prontuarios \";\n $sql .= \" inner join unidades on unidades.sd02_i_codigo = prontuarios.sd24_i_unidade\";\n $sql .= \" inner join db_depart on db_depart.coddepto = unidades.sd02_i_codigo\";\n $sql .= \" left join cgs on cgs.z01_i_numcgs = prontuarios.sd24_i_numcgs\";\n $sql .= \" left join cgs_und on cgs_und.z01_i_cgsund = prontuarios.sd24_i_numcgs\";\n $sql .= \" inner join unidademedicos on unidademedicos.sd04_i_unidade = prontuarios.sd24_i_unidade\";\n $sql .= \" inner join medicos on medicos.sd03_i_codigo = unidademedicos.sd04_i_medico\";\n $sql2 = \" where sd04_i_medico = $sd04_i_medico and sd04_i_unidade = $sd04_i_unidade \";\n\n if($sd24_i_codigo != null && trim($sd24_i_codigo) != '') {\n $sql2 .= \"and prontuarios.sd24_i_codigo = $sd24_i_codigo\";\n }\n if($dbwhere != \"\") {\n $sql2 .= \" and $dbwhere\";\n }\n\n //Não pode estar no prontanulado\n $sql2 .= \" and not exists ( select * from prontanulado where prontanulado.sd57_i_prontuario= prontuarios.sd24_i_codigo ) \";\n\n $sql .= $sql2;\n if($ordem != null ){\n $sql .= \" order by \";\n $campos_sql = split(\"#\",$ordem);\n $virgula = \"\";\n for($i=0;$i<sizeof($campos_sql);$i++){\n $sql .= $virgula.$campos_sql[$i];\n $virgula = \",\";\n }\n }\n return $sql;\n }",
"public function lstUniversitySearch(){\r\n\t\t$Sql = \"SELECT\r\n\t\t\t\t\trs_tbl_university.university_id, rs_tbl_university.op, rs_tbl_university.rank, (\";\r\n\t\tif($this->isPropertySet(\"program_name\", \"V\"))\r\n\t\t\t$Sql .= \" + IF(rs_tbl_university.program_name LIKE '%\".$this->getProperty(\"program_name\").\"%',1,0)\";\r\n\t\t\r\n\t\tif($this->isPropertySet(\"mto_uni_start\", \"V\")){\r\n\t\t\t$Sql .= \" + IF(\";\t\r\n\t\t}\r\n\t\t\r\n\t\tif($this->isPropertySet(\"university\", \"V\"))\r\n\t\t\t$Sql .= \"rs_tbl_university.uni_name LIKE '%\".$this->getProperty(\"university\").\"%'\";\r\n\t\t\r\n\t\tif($this->isPropertySet(\"university_1\", \"V\"))\r\n\t\t\t$Sql .= \" OR rs_tbl_university.uni_name LIKE '%\".$this->getProperty(\"university_1\").\"%'\";\r\n\t\t\r\n\t\tif($this->isPropertySet(\"university_2\", \"V\"))\r\n\t\t\t$Sql .= \" OR rs_tbl_university.uni_name LIKE '%\".$this->getProperty(\"university_2\").\"%'\";\r\n\t\t\t\r\n\t\tif($this->isPropertySet(\"university_3\", \"V\"))\r\n\t\t\t$Sql .= \" OR rs_tbl_university.uni_name LIKE '%\".$this->getProperty(\"university_3\").\"%'\";\r\n\t\t\r\n\t\tif($this->isPropertySet(\"university_4\", \"V\"))\r\n\t\t\t$Sql .= \" OR rs_tbl_university.uni_name LIKE '%\".$this->getProperty(\"university_4\").\"%'\";\r\n\t\t\t\r\n\t\tif($this->isPropertySet(\"university_5\", \"V\"))\r\n\t\t\t$Sql .= \" OR rs_tbl_university.uni_name LIKE '%\".$this->getProperty(\"university_5\").\"%'\";\r\n\t\t\t\r\n\t\tif($this->isPropertySet(\"university_6\", \"V\"))\r\n\t\t\t$Sql .= \" OR rs_tbl_university.uni_name LIKE '%\".$this->getProperty(\"university_6\").\"%'\";\r\n\t\t\t\r\n\t\tif($this->isPropertySet(\"university_7\", \"V\"))\r\n\t\t\t$Sql .= \" OR rs_tbl_university.uni_name LIKE '%\".$this->getProperty(\"university_7\").\"%'\";\r\n\t\t\t\r\n\t\tif($this->isPropertySet(\"university_8\", \"V\"))\r\n\t\t\t$Sql .= \" OR rs_tbl_university.uni_name LIKE '%\".$this->getProperty(\"university_8\").\"%'\";\r\n\t\t\t\r\n\t\tif($this->isPropertySet(\"university_9\", \"V\"))\r\n\t\t\t$Sql .= \" OR rs_tbl_university.uni_name LIKE '%\".$this->getProperty(\"university_9\").\"%'\";\r\n\t\t\r\n\t\tif($this->isPropertySet(\"mto_uni_end\", \"V\")){\r\n\t\t\t$Sql .= \",1,0)\";\t\r\n\t\t}\r\n\t\t\r\n\t\tif($this->isPropertySet(\"mto_loc_start\", \"V\")){\r\n\t\t\t$Sql .= \" + IF(\";\t\r\n\t\t}\r\n\t\t\r\n\t\tif($this->isPropertySet(\"location_id\", \"V\"))\r\n\t\t\t$Sql .= \"rs_tbl_university.location_id LIKE '%\".$this->getProperty(\"location_id\").\"%'\";\r\n\t\t\r\n\t\tif($this->isPropertySet(\"location_id_1\", \"V\"))\r\n\t\t\t$Sql .= \" OR rs_tbl_university.location_id LIKE '%\".$this->getProperty(\"location_id_1\").\"%'\";\r\n\t\t\t\r\n\t\tif($this->isPropertySet(\"location_id_2\", \"V\"))\r\n\t\t\t$Sql .= \" OR rs_tbl_university.location_id LIKE '%\".$this->getProperty(\"location_id_2\").\"%'\";\r\n\t\t\r\n\t\tif($this->isPropertySet(\"location_id_3\", \"V\"))\r\n\t\t\t$Sql .= \" OR rs_tbl_university.location_id LIKE '%\".$this->getProperty(\"location_id_3\").\"%'\";\r\n\t\t\t\r\n\t\tif($this->isPropertySet(\"location_id_4\", \"V\"))\r\n\t\t\t$Sql .= \" OR rs_tbl_university.location_id LIKE '%\".$this->getProperty(\"location_id_4\").\"%'\";\r\n\t\t\t\r\n\t\tif($this->isPropertySet(\"location_id_5\", \"V\"))\r\n\t\t\t$Sql .= \" OR rs_tbl_university.location_id LIKE '%\".$this->getProperty(\"location_id_5\").\"%'\";\r\n\t\t\t\r\n\t\tif($this->isPropertySet(\"location_id_6\", \"V\"))\r\n\t\t\t$Sql .= \" OR rs_tbl_university.location_id LIKE '%\".$this->getProperty(\"location_id_6\").\"%'\";\r\n\t\t\t\r\n\t\tif($this->isPropertySet(\"location_id_7\", \"V\"))\r\n\t\t\t$Sql .= \" OR rs_tbl_university.location_id LIKE '%\".$this->getProperty(\"location_id_7\").\"%'\";\r\n\t\t\t\r\n\t\tif($this->isPropertySet(\"location_id_8\", \"V\"))\r\n\t\t\t$Sql .= \" OR rs_tbl_university.location_id LIKE '%\".$this->getProperty(\"location_id_8\").\"%'\";\r\n\t\t\t\r\n\t\tif($this->isPropertySet(\"location_id_9\", \"V\"))\r\n\t\t\t$Sql .= \" OR rs_tbl_university.location_id LIKE '%\".$this->getProperty(\"location_id_9\").\"%'\";\r\n\t\t\r\n\t\tif($this->isPropertySet(\"mto_loc_end\", \"V\")){\r\n\t\t\t$Sql .= \",1,0)\";\t\r\n\t\t}\r\n\t\t\r\n\t\tif($this->isPropertySet(\"mto_studyarea_start\", \"V\")){\r\n\t\t\t$Sql .= \" + IF(\";\t\r\n\t\t}\r\n\t\t\r\n\t\tif($this->isPropertySet(\"study_area\", \"V\"))\r\n\t\t\t$Sql .= \"rs_tbl_study_area.study_area_name LIKE '%%%\".$this->getProperty(\"study_area\").\"%'\";\r\n\t\t\r\n\t\tif($this->isPropertySet(\"study_area_1\", \"V\"))\r\n\t\t\t$Sql .= \" OR rs_tbl_study_area.study_area_name LIKE '%%%\".$this->getProperty(\"study_area_1\").\"%'\";\r\n\t\t\t\r\n\t\tif($this->isPropertySet(\"study_area_2\", \"V\"))\r\n\t\t\t$Sql .= \" OR rs_tbl_study_area.study_area_name LIKE '%%%\".$this->getProperty(\"study_area_2\").\"%'\";\r\n\t\t\r\n\t\tif($this->isPropertySet(\"study_area_3\", \"V\"))\r\n\t\t\t$Sql .= \" OR rs_tbl_study_area.study_area_name LIKE '%%%\".$this->getProperty(\"study_area_3\").\"%'\";\r\n\t\t\t\r\n\t\tif($this->isPropertySet(\"study_area_4\", \"V\"))\r\n\t\t\t$Sql .= \" OR rs_tbl_study_area.study_area_name LIKE '%%%\".$this->getProperty(\"study_area_4\").\"%'\";\r\n\t\t\t\r\n\t\tif($this->isPropertySet(\"study_area_5\", \"V\"))\r\n\t\t\t$Sql .= \" OR rs_tbl_study_area.study_area_name LIKE '%%%\".$this->getProperty(\"study_area_5\").\"%'\";\r\n\t\t\t\r\n\t\tif($this->isPropertySet(\"study_area_6\", \"V\"))\r\n\t\t\t$Sql .= \" OR rs_tbl_study_area.study_area_name LIKE '%%%\".$this->getProperty(\"study_area_6\").\"%'\";\r\n\t\t\t\r\n\t\tif($this->isPropertySet(\"study_area_7\", \"V\"))\r\n\t\t\t$Sql .= \" OR rs_tbl_study_area.study_area_name LIKE '%%%\".$this->getProperty(\"study_area_7\").\"%'\";\r\n\t\t\t\r\n\t\tif($this->isPropertySet(\"study_area_8\", \"V\"))\r\n\t\t\t$Sql .= \" OR rs_tbl_study_area.study_area_name LIKE '%%%\".$this->getProperty(\"study_area_8\").\"%'\";\r\n\t\t\t\r\n\t\tif($this->isPropertySet(\"study_area_9\", \"V\"))\r\n\t\t\t$Sql .= \" OR rs_tbl_study_area.study_area_name LIKE '%%%\".$this->getProperty(\"study_area_9\").\"%'\";\r\n\t\t\r\n\t\tif($this->isPropertySet(\"mto_studyarea_end\", \"V\")){\r\n\t\t\t$Sql .= \",1,0)\";\t\r\n\t\t}\r\n\t\t\r\n\t\tif($this->isPropertySet(\"on_campus\", \"V\"))\r\n\t\t\t$Sql .= \" + IF(rs_tbl_university.on_campus='\".$this->getProperty(\"on_campus\").\"',1,0)\";\r\n\t\t\r\n\t\tif($this->isPropertySet(\"search_uni_text\", \"V\"))\r\n\t\t\t$Sql .= \" + IF(CONCAT(rs_tbl_university.program_name, rs_tbl_university.location_id, rs_tbl_university.program_code, rs_tbl_university.uni_name, rs_tbl_university.subjects_list) LIKE '%\".$this->getProperty(\"search_uni_text\").\"%',1,0)\";\t\r\n\t\t\r\n\t\tif($this->isPropertySet(\"mto_op_start\", \"V\")){\r\n\t\t\t$Sql .= \" + IF(\";\t\r\n\t\t}\r\n\t\t\r\n\t\tif($this->isPropertySet(\"op_start\", \"V\"))\r\n\t\t\t$Sql .= \"rs_tbl_university.op >=\".$this->getProperty(\"op_start\");\r\n\t\t\t$AddOrConditionOP = \" AND \";\r\n\t\t\r\n\t\tif($this->isPropertySet(\"op_end\", \"V\"))\r\n\t\t\t$Sql .= $AddOrConditionOP.\"rs_tbl_university.op <=\".$this->getProperty(\"op_end\");\r\n\t\t\r\n\t\tif($this->isPropertySet(\"mto_op_end\", \"V\")){\r\n\t\t\t$Sql .= \",1,0)\";\t\r\n\t\t}\r\n\t\t\r\n\t\tif($this->isPropertySet(\"mto_rank_start\", \"V\")){\r\n\t\t\t$Sql .= \" + IF(\";\t\r\n\t\t}\r\n\t\t\r\n\t\tif($this->isPropertySet(\"rank_start\", \"V\"))\r\n\t\t\t$Sql .= \"rs_tbl_university.rank >=\".$this->getProperty(\"rank_start\");\r\n\t\t\t$AddOrConditionRank = \" AND \";\r\n\t\t\r\n\t\tif($this->isPropertySet(\"rank_end\", \"V\"))\r\n\t\t\t$Sql .= $AddOrConditionRank.\"rs_tbl_university.rank <=\".$this->getProperty(\"rank_end\").\"\";\r\n\t\t\r\n\t\tif($this->isPropertySet(\"mto_rank_end\", \"V\")){\r\n\t\t\t$Sql .= \",1,0)\";\t\r\n\t\t}\r\n\t\t\r\n\t\tif($this->isPropertySet(\"study_capacity\", \"V\"))\r\n\t\t\t$Sql .= \" + IF(rs_tbl_university.duration LIKE '%\".$this->getProperty(\"study_capacity\").\"%',1,0)\";\t\r\n\t\t\r\n\t\tif($this->isPropertySet(\"study_capacity_2\", \"V\"))\r\n\t\t\t$Sql .= \" + IF(rs_tbl_university.delivery_mode LIKE '%\".$this->getProperty(\"study_capacity_2\").\"%',1,0)\";\t\r\n\t\t\t\r\n\t\tif($this->isPropertySet(\"live_option\", \"V\"))\r\n\t\t\t$Sql .= \" + IF(rs_tbl_university.why_study LIKE '%\".$this->getProperty(\"live_option\").\"%',1,0)\";\t\r\n\t\t\r\n\t\tif($this->isPropertySet(\"campus_id\", \"V\"))\r\n\t\t\t$Sql .= \" + IF(rs_tbl_university.campus_id LIKE '%\".$this->getProperty(\"campus_id\").\"%',1,0)\";\t\r\n\t\t\r\n\t\tif($this->isPropertySet(\"mto_subject_start\", \"V\")){\r\n\t\t\t$Sql .= \" + IF(\";\t\r\n\t\t}\r\n\t\t\r\n\t\tif($this->isPropertySet(\"subject_search\", \"V\"))\r\n\t\t\t$Sql .= \"rs_tbl_university.subjects_list LIKE '%\".$this->getProperty(\"subject_search\").\"%'\";\r\n\t\t\r\n\t\tif($this->isPropertySet(\"subject_search_1\", \"V\"))\r\n\t\t\t$Sql .= \" OR rs_tbl_university.subjects_list LIKE '%\".$this->getProperty(\"subject_search_1\").\"%'\";\r\n\t\t\t\r\n\t\tif($this->isPropertySet(\"subject_search_2\", \"V\"))\r\n\t\t\t$Sql .= \" OR rs_tbl_university.subjects_list LIKE '%\".$this->getProperty(\"subject_search_2\").\"%'\";\r\n\t\t\r\n\t\tif($this->isPropertySet(\"subject_search_3\", \"V\"))\r\n\t\t\t$Sql .= \" OR rs_tbl_university.subjects_list LIKE '%\".$this->getProperty(\"subject_search_3\").\"%'\";\r\n\t\t\t\r\n\t\tif($this->isPropertySet(\"subject_search_4\", \"V\"))\r\n\t\t\t$Sql .= \" OR rs_tbl_university.subjects_list LIKE '%\".$this->getProperty(\"subject_search_4\").\"%'\";\r\n\t\t\t\r\n\t\tif($this->isPropertySet(\"subject_search_5\", \"V\"))\r\n\t\t\t$Sql .= \" OR rs_tbl_university.subjects_list LIKE '%\".$this->getProperty(\"subject_search_5\").\"%'\";\r\n\t\t\t\r\n\t\tif($this->isPropertySet(\"subject_search_6\", \"V\"))\r\n\t\t\t$Sql .= \" OR rs_tbl_university.subjects_list LIKE '%\".$this->getProperty(\"subject_search_6\").\"%'\";\r\n\t\t\t\r\n\t\tif($this->isPropertySet(\"subject_search_7\", \"V\"))\r\n\t\t\t$Sql .= \" OR rs_tbl_university.subjects_list LIKE '%\".$this->getProperty(\"subject_search_7\").\"%'\";\r\n\t\t\t\r\n\t\tif($this->isPropertySet(\"subject_search_8\", \"V\"))\r\n\t\t\t$Sql .= \" OR rs_tbl_university.subjects_list LIKE '%\".$this->getProperty(\"subject_search_8\").\"%'\";\r\n\t\t\t\r\n\t\tif($this->isPropertySet(\"subject_search_9\", \"V\"))\r\n\t\t\t$Sql .= \" OR rs_tbl_university.subjects_list LIKE '%\".$this->getProperty(\"subject_search_9\").\"%'\";\r\n\t\t\r\n\t\tif($this->isPropertySet(\"mto_subject_end\", \"V\")){\r\n\t\t\t$Sql .= \",1,0)\";\t\r\n\t\t}\r\n\t\t\r\n\t\tif($this->isPropertySet(\"totalrows\", \"V\"))\r\n\t\t\t$Sql .= \" )/\".$this->getProperty(\"totalrows\").\"*100 match_percent\";\r\n\t\t\t\r\n\t\t\t\t$Sql .= \" FROM\r\n\t\t\t\t\t\t\t\trs_tbl_university\r\n\t\t\t\t\t\tINNER JOIN rs_tbl_study_area \r\n\t\t\t\t\t\t\tON (rs_tbl_university.study_area_id = rs_tbl_study_area.study_area_id)\r\n\t\t\t\tWHERE\r\n\t\t\t\t\t1=1\";\r\n\t\t\r\n\t\tif($this->isPropertySet(\"mto_uni_start_2\", \"V\")){\r\n\t\t\t$Sql .= \" AND (\";\r\n\t\t}\r\n\t\t\r\n\t\tif($this->isPropertySet(\"university\", \"V\"))\r\n\t\t\t$Sql .= \" rs_tbl_university.uni_name LIKE '%\".$this->getProperty(\"university\").\"%'\";\r\n\t\t\r\n\t\tif($this->isPropertySet(\"university_1\", \"V\"))\r\n\t\t\t$Sql .= \" OR rs_tbl_university.uni_name LIKE '%\".$this->getProperty(\"university_1\").\"%'\";\r\n\t\t\r\n\t\tif($this->isPropertySet(\"university_2\", \"V\"))\r\n\t\t\t$Sql .= \" OR rs_tbl_university.uni_name LIKE '%\".$this->getProperty(\"university_2\").\"%'\";\r\n\t\t\t\r\n\t\tif($this->isPropertySet(\"university_3\", \"V\"))\r\n\t\t\t$Sql .= \" OR rs_tbl_university.uni_name LIKE '%\".$this->getProperty(\"university_3\").\"%'\";\r\n\t\t\t\r\n\t\tif($this->isPropertySet(\"university_4\", \"V\"))\r\n\t\t\t$Sql .= \" OR rs_tbl_university.uni_name LIKE '%\".$this->getProperty(\"university_4\").\"%'\";\r\n\t\t\t\r\n\t\tif($this->isPropertySet(\"university_5\", \"V\"))\r\n\t\t\t$Sql .= \" OR rs_tbl_university.uni_name LIKE '%\".$this->getProperty(\"university_5\").\"%'\";\r\n\t\t\t\r\n\t\tif($this->isPropertySet(\"university_6\", \"V\"))\r\n\t\t\t$Sql .= \" OR rs_tbl_university.uni_name LIKE '%\".$this->getProperty(\"university_6\").\"%'\";\r\n\t\t\t\r\n\t\tif($this->isPropertySet(\"university_7\", \"V\"))\r\n\t\t\t$Sql .= \" OR rs_tbl_university.uni_name LIKE '%\".$this->getProperty(\"university_7\").\"%'\";\r\n\t\t\t\r\n\t\tif($this->isPropertySet(\"university_8\", \"V\"))\r\n\t\t\t$Sql .= \" OR rs_tbl_university.uni_name LIKE '%\".$this->getProperty(\"university_8\").\"%'\";\r\n\t\t\t\r\n\t\tif($this->isPropertySet(\"university_9\", \"V\"))\r\n\t\t\t$Sql .= \" OR rs_tbl_university.uni_name LIKE '%\".$this->getProperty(\"university_9\").\"%'\";\r\n\t\t\r\n\t\tif($this->isPropertySet(\"mto_uni_end_2\", \"V\")){\r\n\t\t\t$Sql .= \" )\";\r\n\t\t}\r\n\t\t\r\n\t\tif($this->isPropertySet(\"mto_loc_start_2\", \"V\")){\r\n\t\t\t$Sql .= \" AND (\";\r\n\t\t}\r\n\t\tif($this->isPropertySet(\"location_id\", \"V\"))\r\n\t\t\t$Sql .= \" rs_tbl_university.location_id LIKE '%\".$this->getProperty(\"location_id\").\"%'\";\r\n\t\t\r\n\t\tif($this->isPropertySet(\"location_id_1\", \"V\"))\r\n\t\t\t$Sql .= \" OR rs_tbl_university.location_id LIKE '%\".$this->getProperty(\"location_id_1\").\"%'\";\r\n\t\t\t\r\n\t\tif($this->isPropertySet(\"location_id_2\", \"V\"))\r\n\t\t\t$Sql .= \" OR rs_tbl_university.location_id LIKE '%\".$this->getProperty(\"location_id_2\").\"%'\";\r\n\t\t\t\r\n\t\tif($this->isPropertySet(\"location_id_3\", \"V\"))\r\n\t\t\t$Sql .= \" OR rs_tbl_university.location_id LIKE '%\".$this->getProperty(\"location_id_3\").\"%'\";\r\n\t\t\t\r\n\t\tif($this->isPropertySet(\"location_id_4\", \"V\"))\r\n\t\t\t$Sql .= \" OR rs_tbl_university.location_id LIKE '%\".$this->getProperty(\"location_id_4\").\"%'\";\r\n\t\t\t\r\n\t\tif($this->isPropertySet(\"location_id_5\", \"V\"))\r\n\t\t\t$Sql .= \" OR rs_tbl_university.location_id LIKE '%\".$this->getProperty(\"location_id_5\").\"%'\";\r\n\t\t\t\r\n\t\tif($this->isPropertySet(\"location_id_6\", \"V\"))\r\n\t\t\t$Sql .= \" OR rs_tbl_university.location_id LIKE '%\".$this->getProperty(\"location_id_6\").\"%'\";\r\n\t\t\t\r\n\t\tif($this->isPropertySet(\"location_id_7\", \"V\"))\r\n\t\t\t$Sql .= \" OR rs_tbl_university.location_id LIKE '%\".$this->getProperty(\"location_id_7\").\"%'\";\r\n\t\t\t\r\n\t\tif($this->isPropertySet(\"location_id_8\", \"V\"))\r\n\t\t\t$Sql .= \" OR rs_tbl_university.location_id LIKE '%\".$this->getProperty(\"location_id_8\").\"%'\";\r\n\t\t\t\r\n\t\tif($this->isPropertySet(\"location_id_9\", \"V\"))\r\n\t\t\t$Sql .= \" OR rs_tbl_university.location_id LIKE '%\".$this->getProperty(\"location_id_9\").\"%'\";\r\n\t\t\r\n\t\tif($this->isPropertySet(\"mto_loc_end_2\", \"V\")){\r\n\t\t\t$Sql .= \" )\";\r\n\t\t}\r\n\t\t\t\t\t\r\n\t\tif($this->isPropertySet(\"program_name\", \"V\"))\r\n\t\t\t$Sql .= \" OR MATCH (rs_tbl_university.program_name) AGAINST ('+\".$this->getProperty(\"program_name\").\"' IN BOOLEAN MODE)\";\r\n\t\t\t\r\n\t\tif($this->isPropertySet(\"mto_studyarea_start\", \"V\")){\r\n\t\t\t$Sql .= \" AND (\";\r\n\t\t}\r\n\t\tif($this->isPropertySet(\"study_area\", \"V\"))\r\n\t\t\t$Sql .= \" rs_tbl_study_area.study_area_name LIKE '%%%\".$this->getProperty(\"study_area\").\"%'\";\r\n\t\t\t//$Sql .= \" MATCH (rs_tbl_study_area.study_area_name) AGAINST ('+\".$this->getProperty(\"study_area\").\"' IN BOOLEAN MODE)\";\r\n\t\t\r\n\t\tif($this->isPropertySet(\"study_area_1\", \"V\"))\r\n\t\t\t$Sql .= \" OR rs_tbl_study_area.study_area_name LIKE '%%%\".$this->getProperty(\"study_area_1\").\"%'\";\r\n\t\t\t//$Sql .= \" OR MATCH (rs_tbl_study_area.study_area_name) AGAINST ('+\".$this->getProperty(\"study_area_1\").\"' IN BOOLEAN MODE)\";\r\n\t\t\t\r\n\t\tif($this->isPropertySet(\"study_area_2\", \"V\"))\r\n\t\t\t$Sql .= \" OR rs_tbl_study_area.study_area_name LIKE '%%%\".$this->getProperty(\"study_area_2\").\"%'\";\r\n\t\t\t//$Sql .= \" OR MATCH (rs_tbl_study_area.study_area_name) AGAINST ('+\".$this->getProperty(\"study_area_2\").\"' IN BOOLEAN MODE)\";\r\n\t\t\t\r\n\t\tif($this->isPropertySet(\"study_area_3\", \"V\"))\r\n\t\t\t$Sql .= \" OR rs_tbl_study_area.study_area_name LIKE '%%%\".$this->getProperty(\"study_area_3\").\"%'\";\r\n\t\t\t//$Sql .= \" OR MATCH (rs_tbl_study_area.study_area_name) AGAINST ('+\".$this->getProperty(\"study_area_3\").\"' IN BOOLEAN MODE)\";\r\n\t\t\t\r\n\t\tif($this->isPropertySet(\"study_area_4\", \"V\"))\r\n\t\t\t$Sql .= \" OR rs_tbl_study_area.study_area_name LIKE '%%%\".$this->getProperty(\"study_area_4\").\"%'\";\r\n\t\t\t//$Sql .= \" OR MATCH (rs_tbl_study_area.study_area_name) AGAINST ('+\".$this->getProperty(\"study_area_4\").\"' IN BOOLEAN MODE)\";\r\n\t\t\t\r\n\t\tif($this->isPropertySet(\"study_area_5\", \"V\"))\r\n\t\t\t$Sql .= \" OR rs_tbl_study_area.study_area_name LIKE '%%%\".$this->getProperty(\"study_area_5\").\"%'\";\r\n\t\t\t//$Sql .= \" OR MATCH (rs_tbl_study_area.study_area_name) AGAINST ('+\".$this->getProperty(\"study_area_5\").\"' IN BOOLEAN MODE)\";\r\n\t\t\t\r\n\t\tif($this->isPropertySet(\"study_area_6\", \"V\"))\r\n\t\t\t$Sql .= \" OR rs_tbl_study_area.study_area_name LIKE '%%%\".$this->getProperty(\"study_area_6\").\"%'\";\r\n\t\t\t//$Sql .= \" OR MATCH (rs_tbl_study_area.study_area_name) AGAINST ('+\".$this->getProperty(\"study_area\").\"' IN BOOLEAN MODE)\";\r\n\t\t\t\r\n\t\tif($this->isPropertySet(\"study_area_7\", \"V\"))\r\n\t\t\t$Sql .= \" OR rs_tbl_study_area.study_area_name LIKE '%%%\".$this->getProperty(\"study_area_7\").\"%'\";\r\n\t\t\t//$Sql .= \" OR MATCH (rs_tbl_study_area.study_area_name) AGAINST ('+\".$this->getProperty(\"study_area_7\").\"' IN BOOLEAN MODE)\";\r\n\t\t\t\r\n\t\tif($this->isPropertySet(\"study_area_8\", \"V\"))\r\n\t\t\t$Sql .= \" OR rs_tbl_study_area.study_area_name LIKE '%%%\".$this->getProperty(\"study_area_8\").\"%'\";\r\n\t\t\t//$Sql .= \" OR MATCH (rs_tbl_study_area.study_area_name) AGAINST ('+\".$this->getProperty(\"study_area_8\").\"' IN BOOLEAN MODE)\";\r\n\t\t\t\r\n\t\tif($this->isPropertySet(\"study_area_9\", \"V\"))\r\n\t\t\t$Sql .= \" OR rs_tbl_study_area.study_area_name LIKE '%%%\".$this->getProperty(\"study_area_9\").\"%'\";\r\n\t\t\t//$Sql .= \" OR MATCH (rs_tbl_study_area.study_area_name) AGAINST ('+\".$this->getProperty(\"study_area_9\").\"' IN BOOLEAN MODE)\";\r\n\t\t\r\n\t\tif($this->isPropertySet(\"mto_studyarea_end\", \"V\")){\r\n\t\t\t$Sql .= \" )\";\r\n\t\t}\r\n\t\t\r\n\t\tif($this->isPropertySet(\"mto_subject_start\", \"V\")){\r\n\t\t\t$Sql .= \" AND (\";\r\n\t\t}\r\n\t\tif($this->isPropertySet(\"subject_search\", \"V\"))\r\n\t\t\t$Sql .= \" rs_tbl_university.subjects_list LIKE '%\".$this->getProperty(\"subject_search\").\"%'\";\r\n\t\t\r\n\t\tif($this->isPropertySet(\"subject_search_1\", \"V\"))\r\n\t\t\t$Sql .= \" OR rs_tbl_university.subjects_list LIKE '%\".$this->getProperty(\"subject_search_1\").\"%'\";\r\n\t\t\t\r\n\t\tif($this->isPropertySet(\"subject_search_2\", \"V\"))\r\n\t\t\t$Sql .= \" OR rs_tbl_university.subjects_list LIKE '%\".$this->getProperty(\"subject_search_2\").\"%'\";\r\n\t\t\t\r\n\t\tif($this->isPropertySet(\"subject_search_3\", \"V\"))\r\n\t\t\t$Sql .= \" OR rs_tbl_university.subjects_list LIKE '%\".$this->getProperty(\"subject_search_3\").\"%'\";\r\n\t\t\t\r\n\t\tif($this->isPropertySet(\"subject_search_4\", \"V\"))\r\n\t\t\t$Sql .= \" OR rs_tbl_university.subjects_list LIKE '%\".$this->getProperty(\"subject_search_4\").\"%'\";\r\n\t\t\t\r\n\t\tif($this->isPropertySet(\"subject_search_5\", \"V\"))\r\n\t\t\t$Sql .= \" OR rs_tbl_university.subjects_list LIKE '%\".$this->getProperty(\"subject_search_5\").\"%'\";\r\n\t\t\t\r\n\t\tif($this->isPropertySet(\"subject_search_6\", \"V\"))\r\n\t\t\t$Sql .= \" OR rs_tbl_university.subjects_list LIKE '%\".$this->getProperty(\"subject_search_6\").\"%'\";\r\n\t\t\t\r\n\t\tif($this->isPropertySet(\"subject_search_7\", \"V\"))\r\n\t\t\t$Sql .= \" OR rs_tbl_university.subjects_list LIKE '%\".$this->getProperty(\"subject_search_7\").\"%'\";\r\n\t\t\t\r\n\t\tif($this->isPropertySet(\"subject_search_8\", \"V\"))\r\n\t\t\t$Sql .= \" OR rs_tbl_university.subjects_list LIKE '%\".$this->getProperty(\"subject_search_8\").\"%'\";\r\n\t\t\t\r\n\t\tif($this->isPropertySet(\"subject_search_9\", \"V\"))\r\n\t\t\t$Sql .= \" OR rs_tbl_university.subjects_list LIKE '%\".$this->getProperty(\"subject_search_9\").\"%'\";\r\n\t\t\r\n\t\tif($this->isPropertySet(\"mto_subject_end\", \"V\")){\r\n\t\t\t$Sql .= \" )\";\r\n\t\t}\r\n\t\t\r\n\t\tif($this->isPropertySet(\"study_capacity\", \"V\"))\r\n\t\t\t$Sql .= \" OR MATCH (rs_tbl_university.duration) AGAINST ('+\".$this->getProperty(\"study_capacity\").\"' IN BOOLEAN MODE)\";\r\n\t\t\r\n\t\tif($this->isPropertySet(\"study_capacity_2\", \"V\"))\r\n\t\t\t//$Sql .= \" OR MATCH (rs_tbl_university.why_study) AGAINST ('+\".$this->getProperty(\"study_capacity_2\").\"' IN BOOLEAN MODE)\";\r\n\t\t\t$Sql .= \" OR MATCH (rs_tbl_university.delivery_mode) AGAINST ('+\".$this->getProperty(\"study_capacity_2\").\"' IN BOOLEAN MODE)\";\r\n\t\t\r\n\t\tif($this->isPropertySet(\"campus_id\", \"V\"))\r\n\t\t\t//$Sql .= \" OR MATCH (rs_tbl_university.why_study) AGAINST ('+\".$this->getProperty(\"study_capacity_2\").\"' IN BOOLEAN MODE)\";\r\n\t\t\t$Sql .= \" AND MATCH (rs_tbl_university.campus_id) AGAINST ('+\".$this->getProperty(\"campus_id\").\"' IN BOOLEAN MODE)\";\r\n\t\t\r\n\t\tif($this->isPropertySet(\"on_campus\", \"V\"))\r\n\t\t\t$Sql .= \" OR rs_tbl_university.on_campus='\".$this->getProperty(\"on_campus\").\"'\";\r\n\t\t\r\n\t\tif($this->isPropertySet(\"search_uni_text\", \"V\"))\r\n\t\t\t$Sql .= \" OR CONCAT(rs_tbl_university.program_name, rs_tbl_university.location_id, rs_tbl_university.program_code, rs_tbl_university.uni_name, rs_tbl_university.subjects_list) LIKE '\".$this->getProperty(\"search_uni_text\").\"%%%'\";\r\n\r\n\t\tif($this->isPropertySet(\"op_start\", \"V\"))\r\n\t\t\t$Sql .= \" AND rs_tbl_university.op >='\".$this->getProperty(\"op_start\").\"'\";\r\n\t\t\r\n\t\tif($this->isPropertySet(\"op_end\", \"V\"))\r\n\t\t\t$Sql .= \" AND rs_tbl_university.op <='\".$this->getProperty(\"op_end\").\"'\";\r\n\t\t\r\n\t\tif($this->isPropertySet(\"rank_start\", \"V\"))\r\n\t\t\t$Sql .= \" AND rs_tbl_university.rank >='\".$this->getProperty(\"rank_start\").\"'\";\r\n\t\t\r\n\t\tif($this->isPropertySet(\"rank_end\", \"V\"))\r\n\t\t\t$Sql .= \" AND rs_tbl_university.rank <='\".$this->getProperty(\"rank_end\").\"'\";\r\n\t\t\t\r\n\t\tif($this->isPropertySet(\"program_level\", \"V\"))\r\n\t\t\t$Sql .= \" AND rs_tbl_university.program_level = '\".$this->getProperty(\"program_level\").\"'\";\r\n\t\t\t\t\t\t\r\n\t\tif($this->isPropertySet(\"GROUPBY\", \"V\"))\r\n\t\t\t$Sql .= \" GROUP BY \" . $this->getProperty(\"GROUPBY\");\r\n\t\t\t\r\n\t\tif($this->isPropertySet(\"ORDERBY\", \"V\"))\r\n\t\t\t$Sql .= \" ORDER BY \" . $this->getProperty(\"ORDERBY\");\r\n\t\t\r\n\t\tif($this->isPropertySet(\"limit\", \"V\"))\r\n\t\t\t$Sql .= $this->appendLimit($this->getProperty(\"limit\"));\r\n\t\t\t\r\n\t\t//echo $Sql;\r\n\t\treturn $this->dbQuery($Sql);\r\n\t}",
"public function lstUniversitySearch_3(){\r\n\t\t$Sql = \"SELECT\r\n\t\t\t\t\tuniversity_id, op, rank, uni_name, (\";\r\n\t\tif($this->isPropertySet(\"program_name\", \"V\"))\r\n\t\t\t$Sql .= \" + IF(program_name LIKE '%\".$this->getProperty(\"program_name\").\"%',1,0)\";\r\n\t\t\r\n\t\tif($this->isPropertySet(\"mto_uni_start\", \"V\")){\r\n\t\t\t$Sql .= \" + IF(\";\t\r\n\t\t}\r\n\t\t\r\n\t\tif($this->isPropertySet(\"university\", \"V\"))\r\n\t\t\t$Sql .= \"uni_name LIKE '%\".$this->getProperty(\"university\").\"%'\";\r\n\t\t\r\n\t\tif($this->isPropertySet(\"university_1\", \"V\"))\r\n\t\t\t$Sql .= \" OR uni_name LIKE '%\".$this->getProperty(\"university_1\").\"%'\";\r\n\t\t\r\n\t\tif($this->isPropertySet(\"university_2\", \"V\"))\r\n\t\t\t$Sql .= \" OR uni_name LIKE '%\".$this->getProperty(\"university_2\").\"%'\";\r\n\t\t\t\r\n\t\tif($this->isPropertySet(\"university_3\", \"V\"))\r\n\t\t\t$Sql .= \" OR uni_name LIKE '%\".$this->getProperty(\"university_3\").\"%'\";\r\n\t\t\r\n\t\tif($this->isPropertySet(\"university_4\", \"V\"))\r\n\t\t\t$Sql .= \" OR uni_name LIKE '%\".$this->getProperty(\"university_4\").\"%'\";\r\n\t\t\t\r\n\t\tif($this->isPropertySet(\"university_5\", \"V\"))\r\n\t\t\t$Sql .= \" OR uni_name LIKE '%\".$this->getProperty(\"university_5\").\"%'\";\r\n\t\t\t\r\n\t\tif($this->isPropertySet(\"university_6\", \"V\"))\r\n\t\t\t$Sql .= \" OR uni_name LIKE '%\".$this->getProperty(\"university_6\").\"%'\";\r\n\t\t\t\r\n\t\tif($this->isPropertySet(\"university_7\", \"V\"))\r\n\t\t\t$Sql .= \" OR uni_name LIKE '%\".$this->getProperty(\"university_7\").\"%'\";\r\n\t\t\t\r\n\t\tif($this->isPropertySet(\"university_8\", \"V\"))\r\n\t\t\t$Sql .= \" OR uni_name LIKE '%\".$this->getProperty(\"university_8\").\"%'\";\r\n\t\t\t\r\n\t\tif($this->isPropertySet(\"university_9\", \"V\"))\r\n\t\t\t$Sql .= \" OR uni_name LIKE '%\".$this->getProperty(\"university_9\").\"%'\";\r\n\t\t\r\n\t\tif($this->isPropertySet(\"mto_uni_end\", \"V\")){\r\n\t\t\t$Sql .= \",1,0)\";\t\r\n\t\t}\r\n\t\t\r\n\t\tif($this->isPropertySet(\"mto_loc_start\", \"V\")){\r\n\t\t\t$Sql .= \" + IF(\";\t\r\n\t\t}\r\n\t\t\r\n\t\tif($this->isPropertySet(\"location_id\", \"V\"))\r\n\t\t\t$Sql .= \"location_id LIKE '%\".$this->getProperty(\"location_id\").\"%'\";\r\n\t\t\r\n\t\tif($this->isPropertySet(\"location_id_1\", \"V\"))\r\n\t\t\t$Sql .= \" OR location_id LIKE '%\".$this->getProperty(\"location_id_1\").\"%'\";\r\n\t\t\t\r\n\t\tif($this->isPropertySet(\"location_id_2\", \"V\"))\r\n\t\t\t$Sql .= \" OR location_id LIKE '%\".$this->getProperty(\"location_id_2\").\"%'\";\r\n\t\t\r\n\t\tif($this->isPropertySet(\"location_id_3\", \"V\"))\r\n\t\t\t$Sql .= \" OR location_id LIKE '%\".$this->getProperty(\"location_id_3\").\"%'\";\r\n\t\t\t\r\n\t\tif($this->isPropertySet(\"location_id_4\", \"V\"))\r\n\t\t\t$Sql .= \" OR location_id LIKE '%\".$this->getProperty(\"location_id_4\").\"%'\";\r\n\t\t\t\r\n\t\tif($this->isPropertySet(\"location_id_5\", \"V\"))\r\n\t\t\t$Sql .= \" OR location_id LIKE '%\".$this->getProperty(\"location_id_5\").\"%'\";\r\n\t\t\t\r\n\t\tif($this->isPropertySet(\"location_id_6\", \"V\"))\r\n\t\t\t$Sql .= \" OR location_id LIKE '%\".$this->getProperty(\"location_id_6\").\"%'\";\r\n\t\t\t\r\n\t\tif($this->isPropertySet(\"location_id_7\", \"V\"))\r\n\t\t\t$Sql .= \" OR location_id LIKE '%\".$this->getProperty(\"location_id_7\").\"%'\";\r\n\t\t\t\r\n\t\tif($this->isPropertySet(\"location_id_8\", \"V\"))\r\n\t\t\t$Sql .= \" OR location_id LIKE '%\".$this->getProperty(\"location_id_8\").\"%'\";\r\n\t\t\t\r\n\t\tif($this->isPropertySet(\"location_id_9\", \"V\"))\r\n\t\t\t$Sql .= \" OR location_id LIKE '%\".$this->getProperty(\"location_id_9\").\"%'\";\r\n\t\t\r\n\t\tif($this->isPropertySet(\"mto_loc_end\", \"V\")){\r\n\t\t\t$Sql .= \",1,0)\";\t\r\n\t\t}\r\n\t\t\r\n\t\t/*if($this->isPropertySet(\"mto_studyarea_start\", \"V\")){\r\n\t\t\t$Sql .= \" + IF(\";\t\r\n\t\t}\r\n\t\t\r\n\t\tif($this->isPropertySet(\"study_area\", \"V\"))\r\n\t\t\t$Sql .= \"rs_tbl_study_area.study_area_name LIKE '%\".$this->getProperty(\"study_area\").\"%'\";\r\n\t\t\r\n\t\tif($this->isPropertySet(\"study_area_1\", \"V\"))\r\n\t\t\t$Sql .= \" OR rs_tbl_study_area.study_area_name LIKE '%\".$this->getProperty(\"study_area_1\").\"%'\";\r\n\t\t\t\r\n\t\tif($this->isPropertySet(\"study_area_2\", \"V\"))\r\n\t\t\t$Sql .= \" OR rs_tbl_study_area.study_area_name LIKE '%\".$this->getProperty(\"study_area_2\").\"%'\";\r\n\t\t\r\n\t\tif($this->isPropertySet(\"study_area_3\", \"V\"))\r\n\t\t\t$Sql .= \" OR rs_tbl_study_area.study_area_name LIKE '%\".$this->getProperty(\"study_area_3\").\"%'\";\r\n\t\t\t\r\n\t\tif($this->isPropertySet(\"study_area_4\", \"V\"))\r\n\t\t\t$Sql .= \" OR rs_tbl_study_area.study_area_name LIKE '%\".$this->getProperty(\"study_area_4\").\"%'\";\r\n\t\t\t\r\n\t\tif($this->isPropertySet(\"study_area_5\", \"V\"))\r\n\t\t\t$Sql .= \" OR rs_tbl_study_area.study_area_name LIKE '%\".$this->getProperty(\"study_area_5\").\"%'\";\r\n\t\t\t\r\n\t\tif($this->isPropertySet(\"study_area_6\", \"V\"))\r\n\t\t\t$Sql .= \" OR rs_tbl_study_area.study_area_name LIKE '%\".$this->getProperty(\"study_area_6\").\"%'\";\r\n\t\t\t\r\n\t\tif($this->isPropertySet(\"study_area_7\", \"V\"))\r\n\t\t\t$Sql .= \" OR rs_tbl_study_area.study_area_name LIKE '%\".$this->getProperty(\"study_area_7\").\"%'\";\r\n\t\t\t\r\n\t\tif($this->isPropertySet(\"study_area_8\", \"V\"))\r\n\t\t\t$Sql .= \" OR rs_tbl_study_area.study_area_name LIKE '%\".$this->getProperty(\"study_area_8\").\"%'\";\r\n\t\t\t\r\n\t\tif($this->isPropertySet(\"study_area_9\", \"V\"))\r\n\t\t\t$Sql .= \" OR rs_tbl_study_area.study_area_name LIKE '%\".$this->getProperty(\"study_area_9\").\"%'\";\r\n\t\t\r\n\t\tif($this->isPropertySet(\"mto_studyarea_end\", \"V\")){\r\n\t\t\t$Sql .= \",1,0)\";\t\r\n\t\t}*/\r\n\t\t\r\n\t\tif($this->isPropertySet(\"on_campus\", \"V\"))\r\n\t\t\t$Sql .= \" + IF(on_campus='\".$this->getProperty(\"on_campus\").\"',1,0)\";\r\n\t\t\r\n\t\tif($this->isPropertySet(\"search_uni_text\", \"V\"))\r\n\t\t\t$Sql .= \" + IF(CONCAT(program_name, location_id, program_code, uni_name, subjects_list) LIKE '%\".$this->getProperty(\"search_uni_text\").\"%',1,0)\";\t\r\n\t\t\r\n\t\tif($this->isPropertySet(\"mto_op_start\", \"V\")){\r\n\t\t\t$Sql .= \" + IF(\";\t\r\n\t\t}\r\n\t\t\r\n\t\tif($this->isPropertySet(\"op_start\", \"V\"))\r\n\t\t\t$Sql .= \"op >=\".$this->getProperty(\"op_start\");\r\n\t\t\t$AddOrConditionOP = \" AND \";\r\n\t\t\r\n\t\tif($this->isPropertySet(\"op_end\", \"V\"))\r\n\t\t\t$Sql .= $AddOrConditionOP.\"op <=\".$this->getProperty(\"op_end\");\r\n\t\t\r\n\t\tif($this->isPropertySet(\"mto_op_end\", \"V\")){\r\n\t\t\t$Sql .= \",1,0)\";\t\r\n\t\t}\r\n\t\t\r\n\t\tif($this->isPropertySet(\"mto_rank_start\", \"V\")){\r\n\t\t\t$Sql .= \" + IF(\";\t\r\n\t\t}\r\n\t\t\r\n\t\tif($this->isPropertySet(\"rank_start\", \"V\"))\r\n\t\t\t$Sql .= \"rank >=\".$this->getProperty(\"rank_start\");\r\n\t\t\t$AddOrConditionRank = \" AND \";\r\n\t\t\r\n\t\tif($this->isPropertySet(\"rank_end\", \"V\"))\r\n\t\t\t$Sql .= $AddOrConditionRank.\"rank <=\".$this->getProperty(\"rank_end\").\"\";\r\n\t\t\r\n\t\tif($this->isPropertySet(\"mto_rank_end\", \"V\")){\r\n\t\t\t$Sql .= \",1,0)\";\t\r\n\t\t}\r\n\t\t\r\n\t\tif($this->isPropertySet(\"study_capacity\", \"V\"))\r\n\t\t\t$Sql .= \" + IF(duration LIKE '%\".$this->getProperty(\"study_capacity\").\"%',1,0)\";\t\r\n\t\t\r\n\t\tif($this->isPropertySet(\"study_capacity_2\", \"V\"))\r\n\t\t\t$Sql .= \" + 1\";\t\r\n\t\t\t\r\n\t\tif($this->isPropertySet(\"live_option\", \"V\"))\r\n\t\t\t$Sql .= \" + IF(why_study LIKE '%\".$this->getProperty(\"live_option\").\"%',1,0)\";\t\r\n\t\t\r\n\t\tif($this->isPropertySet(\"mto_subject_start\", \"V\")){\r\n\t\t\t$Sql .= \" + IF(\";\t\r\n\t\t}\r\n\t\t\r\n\t\tif($this->isPropertySet(\"subject_search\", \"V\"))\r\n\t\t\t$Sql .= \"subjects_list LIKE '%\".$this->getProperty(\"subject_search\").\"%'\";\r\n\t\t\r\n\t\tif($this->isPropertySet(\"subject_search_1\", \"V\"))\r\n\t\t\t$Sql .= \" OR subjects_list LIKE '%\".$this->getProperty(\"subject_search_1\").\"%'\";\r\n\t\t\t\r\n\t\tif($this->isPropertySet(\"subject_search_2\", \"V\"))\r\n\t\t\t$Sql .= \" OR subjects_list LIKE '%\".$this->getProperty(\"subject_search_2\").\"%'\";\r\n\t\t\r\n\t\tif($this->isPropertySet(\"subject_search_3\", \"V\"))\r\n\t\t\t$Sql .= \" OR subjects_list LIKE '%\".$this->getProperty(\"subject_search_3\").\"%'\";\r\n\t\t\t\r\n\t\tif($this->isPropertySet(\"subject_search_4\", \"V\"))\r\n\t\t\t$Sql .= \" OR subjects_list LIKE '%\".$this->getProperty(\"subject_search_4\").\"%'\";\r\n\t\t\t\r\n\t\tif($this->isPropertySet(\"subject_search_5\", \"V\"))\r\n\t\t\t$Sql .= \" OR subjects_list LIKE '%\".$this->getProperty(\"subject_search_5\").\"%'\";\r\n\t\t\t\r\n\t\tif($this->isPropertySet(\"subject_search_6\", \"V\"))\r\n\t\t\t$Sql .= \" OR subjects_list LIKE '%\".$this->getProperty(\"subject_search_6\").\"%'\";\r\n\t\t\t\r\n\t\tif($this->isPropertySet(\"subject_search_7\", \"V\"))\r\n\t\t\t$Sql .= \" OR subjects_list LIKE '%\".$this->getProperty(\"subject_search_7\").\"%'\";\r\n\t\t\t\r\n\t\tif($this->isPropertySet(\"subject_search_8\", \"V\"))\r\n\t\t\t$Sql .= \" OR subjects_list LIKE '%\".$this->getProperty(\"subject_search_8\").\"%'\";\r\n\t\t\t\r\n\t\tif($this->isPropertySet(\"subject_search_9\", \"V\"))\r\n\t\t\t$Sql .= \" OR subjects_list LIKE '%\".$this->getProperty(\"subject_search_9\").\"%'\";\r\n\t\t\r\n\t\tif($this->isPropertySet(\"mto_subject_end\", \"V\")){\r\n\t\t\t$Sql .= \",1,0)\";\t\r\n\t\t}\r\n\t\t\r\n\t\tif($this->isPropertySet(\"totalrows\", \"V\"))\r\n\t\t\t$Sql .= \" )/\".$this->getProperty(\"totalrows\").\"*100 match_percent\";\r\n\t\t\t\r\n\t\t\t\t/*$Sql .= \" FROM\r\n\t\t\t\t\t\t\t\trs_tbl_university\r\n\t\t\t\t\t\tINNER JOIN rs_tbl_study_area \r\n\t\t\t\t\t\t\tON (study_area_id = rs_tbl_study_area.study_area_id)\r\n\t\t\t\tWHERE\r\n\t\t\t\t\t1=1\";*/\r\n\t\t\t\t$Sql .= \" FROM\r\n\t\t\t\t\t\t\t\trs_tbl_university\r\n\t\t\t\tWHERE\r\n\t\t\t\t\t1=1\";\r\n\t\t\r\n\t\tif($this->isPropertySet(\"mto_uni_start_2\", \"V\")){\r\n\t\t\t$Sql .= \" OR (\";\r\n\t\t}\r\n\t\t\r\n\t\tif($this->isPropertySet(\"university\", \"V\"))\r\n\t\t\t$Sql .= \" uni_name LIKE '%\".$this->getProperty(\"university\").\"%'\";\r\n\t\t\r\n\t\tif($this->isPropertySet(\"university_1\", \"V\"))\r\n\t\t\t$Sql .= \" OR uni_name LIKE '%\".$this->getProperty(\"university_1\").\"%'\";\r\n\t\t\r\n\t\tif($this->isPropertySet(\"university_2\", \"V\"))\r\n\t\t\t$Sql .= \" OR uni_name LIKE '%\".$this->getProperty(\"university_2\").\"%'\";\r\n\t\t\t\r\n\t\tif($this->isPropertySet(\"university_3\", \"V\"))\r\n\t\t\t$Sql .= \" OR uni_name LIKE '%\".$this->getProperty(\"university_3\").\"%'\";\r\n\t\t\t\r\n\t\tif($this->isPropertySet(\"university_4\", \"V\"))\r\n\t\t\t$Sql .= \" OR uni_name LIKE '%\".$this->getProperty(\"university_4\").\"%'\";\r\n\t\t\t\r\n\t\tif($this->isPropertySet(\"university_5\", \"V\"))\r\n\t\t\t$Sql .= \" OR uni_name LIKE '%\".$this->getProperty(\"university_5\").\"%'\";\r\n\t\t\t\r\n\t\tif($this->isPropertySet(\"university_6\", \"V\"))\r\n\t\t\t$Sql .= \" OR uni_name LIKE '%\".$this->getProperty(\"university_6\").\"%'\";\r\n\t\t\t\r\n\t\tif($this->isPropertySet(\"university_7\", \"V\"))\r\n\t\t\t$Sql .= \" OR uni_name LIKE '%\".$this->getProperty(\"university_7\").\"%'\";\r\n\t\t\t\r\n\t\tif($this->isPropertySet(\"university_8\", \"V\"))\r\n\t\t\t$Sql .= \" OR uni_name LIKE '%\".$this->getProperty(\"university_8\").\"%'\";\r\n\t\t\t\r\n\t\tif($this->isPropertySet(\"university_9\", \"V\"))\r\n\t\t\t$Sql .= \" OR uni_name LIKE '%\".$this->getProperty(\"university_9\").\"%'\";\r\n\t\t\r\n\t\tif($this->isPropertySet(\"mto_uni_end_2\", \"V\")){\r\n\t\t\t$Sql .= \" )\";\r\n\t\t}\r\n\t\t\r\n\t\tif($this->isPropertySet(\"mto_loc_start_2\", \"V\")){\r\n\t\t\t$Sql .= \" AND (\";\r\n\t\t}\r\n\t\tif($this->isPropertySet(\"location_id\", \"V\"))\r\n\t\t\t$Sql .= \" location_id LIKE '%\".$this->getProperty(\"location_id\").\"%'\";\r\n\t\t\r\n\t\tif($this->isPropertySet(\"location_id_1\", \"V\"))\r\n\t\t\t$Sql .= \" OR location_id LIKE '%\".$this->getProperty(\"location_id_1\").\"%'\";\r\n\t\t\t\r\n\t\tif($this->isPropertySet(\"location_id_2\", \"V\"))\r\n\t\t\t$Sql .= \" OR location_id LIKE '%\".$this->getProperty(\"location_id_2\").\"%'\";\r\n\t\t\t\r\n\t\tif($this->isPropertySet(\"location_id_3\", \"V\"))\r\n\t\t\t$Sql .= \" OR location_id LIKE '%\".$this->getProperty(\"location_id_3\").\"%'\";\r\n\t\t\t\r\n\t\tif($this->isPropertySet(\"location_id_4\", \"V\"))\r\n\t\t\t$Sql .= \" OR location_id LIKE '%\".$this->getProperty(\"location_id_4\").\"%'\";\r\n\t\t\t\r\n\t\tif($this->isPropertySet(\"location_id_5\", \"V\"))\r\n\t\t\t$Sql .= \" OR location_id LIKE '%\".$this->getProperty(\"location_id_5\").\"%'\";\r\n\t\t\t\r\n\t\tif($this->isPropertySet(\"location_id_6\", \"V\"))\r\n\t\t\t$Sql .= \" OR location_id LIKE '%\".$this->getProperty(\"location_id_6\").\"%'\";\r\n\t\t\t\r\n\t\tif($this->isPropertySet(\"location_id_7\", \"V\"))\r\n\t\t\t$Sql .= \" OR location_id LIKE '%\".$this->getProperty(\"location_id_7\").\"%'\";\r\n\t\t\t\r\n\t\tif($this->isPropertySet(\"location_id_8\", \"V\"))\r\n\t\t\t$Sql .= \" OR location_id LIKE '%\".$this->getProperty(\"location_id_8\").\"%'\";\r\n\t\t\t\r\n\t\tif($this->isPropertySet(\"location_id_9\", \"V\"))\r\n\t\t\t$Sql .= \" OR location_id LIKE '%\".$this->getProperty(\"location_id_9\").\"%'\";\r\n\t\t\r\n\t\tif($this->isPropertySet(\"mto_loc_end_2\", \"V\")){\r\n\t\t\t$Sql .= \" )\";\r\n\t\t}\r\n\t\t\t\t\t\r\n\t\tif($this->isPropertySet(\"program_name\", \"V\"))\r\n\t\t\t$Sql .= \" OR MATCH (program_name) AGAINST ('+\".$this->getProperty(\"program_name\").\"' IN BOOLEAN MODE)\";\r\n\t\t\t\r\n\t\t/*if($this->isPropertySet(\"mto_studyarea_start\", \"V\")){\r\n\t\t\t$Sql .= \" AND (\";\r\n\t\t}\r\n\t\tif($this->isPropertySet(\"study_area\", \"V\"))\r\n\t\t\t$Sql .= \" rs_tbl_study_area.study_area_name LIKE '%\".$this->getProperty(\"study_area\").\"%'\";\r\n\t\t\r\n\t\tif($this->isPropertySet(\"study_area_1\", \"V\"))\r\n\t\t\t$Sql .= \" OR rs_tbl_study_area.study_area_name LIKE '%\".$this->getProperty(\"study_area_1\").\"%'\";\r\n\t\t\t\r\n\t\tif($this->isPropertySet(\"study_area_2\", \"V\"))\r\n\t\t\t$Sql .= \" OR rs_tbl_study_area.study_area_name LIKE '%\".$this->getProperty(\"study_area_2\").\"%'\";\r\n\t\t\t\r\n\t\tif($this->isPropertySet(\"study_area_3\", \"V\"))\r\n\t\t\t$Sql .= \" OR rs_tbl_study_area.study_area_name LIKE '%\".$this->getProperty(\"study_area_3\").\"%'\";\r\n\t\t\t\r\n\t\tif($this->isPropertySet(\"study_area_4\", \"V\"))\r\n\t\t\t$Sql .= \" OR rs_tbl_study_area.study_area_name LIKE '%\".$this->getProperty(\"study_area_4\").\"%'\";\r\n\t\t\t\r\n\t\tif($this->isPropertySet(\"study_area_5\", \"V\"))\r\n\t\t\t$Sql .= \" OR rs_tbl_study_area.study_area_name LIKE '%\".$this->getProperty(\"study_area_5\").\"%'\";\r\n\t\t\t\r\n\t\tif($this->isPropertySet(\"study_area_6\", \"V\"))\r\n\t\t\t$Sql .= \" OR rs_tbl_study_area.study_area_name LIKE '%\".$this->getProperty(\"study_area_6\").\"%'\";\r\n\t\t\t\r\n\t\tif($this->isPropertySet(\"study_area_7\", \"V\"))\r\n\t\t\t$Sql .= \" OR rs_tbl_study_area.study_area_name LIKE '%\".$this->getProperty(\"study_area_7\").\"%'\";\r\n\t\t\t\r\n\t\tif($this->isPropertySet(\"study_area_8\", \"V\"))\r\n\t\t\t$Sql .= \" OR rs_tbl_study_area.study_area_name LIKE '%\".$this->getProperty(\"study_area_8\").\"%'\";\r\n\t\t\t\r\n\t\tif($this->isPropertySet(\"study_area_9\", \"V\"))\r\n\t\t\t$Sql .= \" OR rs_tbl_study_area.study_area_name LIKE '%\".$this->getProperty(\"study_area_9\").\"%'\";\r\n\t\t\r\n\t\tif($this->isPropertySet(\"mto_studyarea_end\", \"V\")){\r\n\t\t\t$Sql .= \" )\";\r\n\t\t}*/\r\n\t\t\r\n\t\tif($this->isPropertySet(\"mto_subject_start\", \"V\")){\r\n\t\t\t$Sql .= \" OR (\";\r\n\t\t}\r\n\t\tif($this->isPropertySet(\"subject_search\", \"V\"))\r\n\t\t\t$Sql .= \" subjects_list LIKE '%\".$this->getProperty(\"subject_search\").\"%'\";\r\n\t\t\r\n\t\tif($this->isPropertySet(\"subject_search_1\", \"V\"))\r\n\t\t\t$Sql .= \" OR subjects_list LIKE '%\".$this->getProperty(\"subject_search_1\").\"%'\";\r\n\t\t\t\r\n\t\tif($this->isPropertySet(\"subject_search_2\", \"V\"))\r\n\t\t\t$Sql .= \" OR subjects_list LIKE '%\".$this->getProperty(\"subject_search_2\").\"%'\";\r\n\t\t\t\r\n\t\tif($this->isPropertySet(\"subject_search_3\", \"V\"))\r\n\t\t\t$Sql .= \" OR subjects_list LIKE '%\".$this->getProperty(\"subject_search_3\").\"%'\";\r\n\t\t\t\r\n\t\tif($this->isPropertySet(\"subject_search_4\", \"V\"))\r\n\t\t\t$Sql .= \" OR subjects_list LIKE '%\".$this->getProperty(\"subject_search_4\").\"%'\";\r\n\t\t\t\r\n\t\tif($this->isPropertySet(\"subject_search_5\", \"V\"))\r\n\t\t\t$Sql .= \" OR subjects_list LIKE '%\".$this->getProperty(\"subject_search_5\").\"%'\";\r\n\t\t\t\r\n\t\tif($this->isPropertySet(\"subject_search_6\", \"V\"))\r\n\t\t\t$Sql .= \" OR subjects_list LIKE '%\".$this->getProperty(\"subject_search_6\").\"%'\";\r\n\t\t\t\r\n\t\tif($this->isPropertySet(\"subject_search_7\", \"V\"))\r\n\t\t\t$Sql .= \" OR subjects_list LIKE '%\".$this->getProperty(\"subject_search_7\").\"%'\";\r\n\t\t\t\r\n\t\tif($this->isPropertySet(\"subject_search_8\", \"V\"))\r\n\t\t\t$Sql .= \" OR subjects_list LIKE '%\".$this->getProperty(\"subject_search_8\").\"%'\";\r\n\t\t\t\r\n\t\tif($this->isPropertySet(\"subject_search_9\", \"V\"))\r\n\t\t\t$Sql .= \" OR subjects_list LIKE '%\".$this->getProperty(\"subject_search_9\").\"%'\";\r\n\t\t\r\n\t\tif($this->isPropertySet(\"mto_subject_end\", \"V\")){\r\n\t\t\t$Sql .= \" )\";\r\n\t\t}\r\n\t\t\r\n\t\tif($this->isPropertySet(\"study_capacity\", \"V\"))\r\n\t\t\t$Sql .= \" OR MATCH (duration) AGAINST ('+\".$this->getProperty(\"study_capacity\").\"' IN BOOLEAN MODE)\";\r\n\t\t\r\n\t\tif($this->isPropertySet(\"study_capacity_2\", \"V\"))\r\n\t\t\t$Sql .= \" OR MATCH (why_study) AGAINST ('+\".$this->getProperty(\"study_capacity_2\").\"' IN BOOLEAN MODE)\";\r\n\t\t\r\n\t\tif($this->isPropertySet(\"on_campus\", \"V\"))\r\n\t\t\t$Sql .= \" OR on_campus='\".$this->getProperty(\"on_campus\").\"'\";\r\n\t\t\r\n\t\tif($this->isPropertySet(\"search_uni_text\", \"V\"))\r\n\t\t\t$Sql .= \" OR CONCAT(program_name, location_id, program_code, uni_name, subjects_list) LIKE '\".$this->getProperty(\"search_uni_text\").\"%%%'\";\r\n\r\n\t\tif($this->isPropertySet(\"op_start\", \"V\"))\r\n\t\t\t$Sql .= \" AND op >=\".$this->getProperty(\"op_start\");\r\n\t\t\r\n\t\tif($this->isPropertySet(\"op_end\", \"V\"))\r\n\t\t\t$Sql .= \" AND op <=\".$this->getProperty(\"op_end\");\r\n\t\t\r\n\t\tif($this->isPropertySet(\"rank_start\", \"V\"))\r\n\t\t\t$Sql .= \" AND rank >=\".$this->getProperty(\"rank_start\");\r\n\t\t\r\n\t\tif($this->isPropertySet(\"rank_end\", \"V\"))\r\n\t\t\t$Sql .= \" AND rank <=\".$this->getProperty(\"rank_end\");\r\n\t\t\t\r\n\t\tif($this->isPropertySet(\"program_level\", \"V\"))\r\n\t\t\t$Sql .= \" AND program_level = '\".$this->getProperty(\"program_level\").\"'\";\r\n\t\t\t\t\t\t\r\n\t\tif($this->isPropertySet(\"GROUPBY\", \"V\"))\r\n\t\t\t$Sql .= \" GROUP BY \" . $this->getProperty(\"GROUPBY\");\r\n\t\t\t\r\n\t\tif($this->isPropertySet(\"ORDERBY\", \"V\"))\r\n\t\t\t$Sql .= \" ORDER BY \" . $this->getProperty(\"ORDERBY\");\r\n\t\t\r\n\t\tif($this->isPropertySet(\"limit\", \"V\"))\r\n\t\t\t$Sql .= $this->appendLimit($this->getProperty(\"limit\"));\r\n\t\t\t\r\n\t\t//echo $Sql;\r\n\t\treturn $this->dbQuery($Sql);\r\n\t}",
"function getallsearch($fname, $lname, $email, $phone, $ccdnum)\n\t{\n\t\t\n\t\t$sql = \"SELECT * FROM tbl_memberinfo WHERE substr(AES_DECRYPT(cardnumber, '12345'), -4) = '$ccdnum' AND member_firstname like '%$fname%' AND member_lastname like '%$lname%' AND member_email like '%$email%' AND member_phonenumber like '%$phone%'\";\n\t\t$query = $this->db->query($sql);\n\t\n\t\treturn $query->result();\n\t\t\n\t}",
"function search_student($db) {\r\n\t//print_r($_POST);\r\n\t$qStr = \"SELECT fname, mname, lname, login, bname, floor, number FROM student JOIN room ON student.roomid=room.roomid JOIN building ON room.bname=building.name WHERE (\";\r\n\t$firstAtr = \"\";\r\n\t$atr = \"\";\r\n\t$newGroup = FALSE;\r\n\tforeach($_POST as $key => $atrVal) {\r\n\t\tif(($key == \"fname\" || $key == \"lname\") && $atrVal == \"\") {\r\n\t\t\tcontinue;\r\n\t\t}\r\n\t\t$explodedArray = explode(\"-\", $key);\r\n\t\t$currAtr = $explodedArray[0];\r\n\t\t//print($currAtr);\r\n\t\tif ($currAtr != $atr) {\r\n\t\t\tif ($newGroup == TRUE) {\r\n\t\t\t\t$qStr = rtrim($qStr, \" OR \");\r\n\t\t\t\t$qStr .= \") AND (\";\r\n\t\t\t}\r\n\t\t\t$atr = $currAtr;\r\n\t\t\t$newGroup = TRUE;\r\n\t\t}\r\n\t\tif ($atr == \"name\") {\r\n\t\t\t$qStr .= \"bname='$atrVal' OR \";\r\n\t\t}\r\n\t\telse {\r\n\t\t\t$qStr .= \"$atr='$atrVal' OR \";\r\n\t\t}\r\n\t}\r\n\t$qStr = rtrim($qStr, \" OR\");\r\n\t$qStr .= \");\";\r\n\t//print($qStr);\r\n\t$qRes = $db->query($qStr);\r\n\t$allEmails = \"\";\r\n\t/*\r\n\tprint(\"<a href='mailto:$allEmails'>Email all</a>\");\r\n\t$allEmails .= \"marary01@gettysburg.edu, \";\r\n\t$allEmails .= \"sherwi01@gettysburg.edu, \";\r\n\t$allEmails .= \"abcdfe02@gettysburg.edu\";\r\n\tprint(\"<a href='mailto:$allEmails'>Email all</a>\");\r\n\t*/\r\n\r\n\tif ($qRes != FALSE) {\r\n\t\tif($qRes->rowCount() == 0) {\r\n\t\t\tprint(\"<H3>No results matched your search, try picking fewer options.</H3>\");\r\n\t\t}\r\n\t\telse {\r\n\t\t\tprint(\"<TABLE>\");\r\n\t\t\tprint(\"<TH>First name</TH><TH>Middle name</TH><TH>Last name</TH><TH>Building</TH><TH>Floor</TH><TH>Room Number</TH><TH>Email</TH>\");\r\n\t\t\twhile ($row = $qRes->fetch()) {\r\n\t\t\t\t$fname = $row['fname'];\r\n\t\t\t\t$mname = $row['mname'];\r\n\t\t\t\t$lname = $row['lname'];\r\n\t\t\t\t$bname = $row['bname'];\r\n\t\t\t\t$floor = $row['floor'];\r\n\t\t\t\t$number = $row['number'];\r\n\t\t\t\t$email = $row['login'].\"@gettysburg.edu\";\r\n\t\t\t\t$allEmails .= $email.\";\" ;\r\n\t\t\t\tprint(\"<TR>\");\r\n\t\t\t\tprint(\"<TD>$fname</TD>\");\r\n\t\t\t\tprint(\"<TD>$mname</TD>\");\r\n\t\t\t\tprint(\"<TD>$lname</TD>\");\r\n\t\t\t\tprint(\"<TD>$bname</TD>\");\r\n\t\t\t\tprint(\"<TD>$floor</TD>\");\r\n\t\t\t\tprint(\"<TD>$number</TD>\");\r\n\t\t\t\tprint(\"<TD><a href='mailto:$email'>$email</a></TD>\");\r\n\t\t\t\tprint(\"</TR>\");\r\n\t\t\t}\r\n\t\tprint(\"</TABLE>\");\r\n\t\tprint(\"<br/><a class='email-all button' href='mailto:$allEmails'>Email All</a>\");\r\n\t}\r\n\treturn true;\r\n\t}\r\n\treturn false;\r\n}",
"function searchSQL($fields){\n\t$conn=connectToDB();\n\t\n //\t Parse the SQL query\n $first = true;\n\n $search = 'SELECT businessName, phoneNo, city, type, businessId FROM ((Businesses Natural Join Verified) NATURAL JOIN Addresses)';\n\n\n if($fields[0] != '' OR $fields[1] != 'all' OR $fields[2] != ''){\n $search .= ' WHERE ';\n if($fields[0] != ''){\n $search .= ' lower(:busname) = lower(businessName)';\n $first = false;\n }\n if($fields[1] != 'all'){\n if(!$first){\n $search .= ' AND';\n }\n $search .= ' lower(:busType) = lower(type)';\n $first = false;\n }\n if($fields[2] != ''){\n if(!$first){\n $search .= ' AND';\n }\n $search .= ' lower(:city) = lower(city)';\n $first = false;\n }\n } \n\n $query = oci_parse($conn, $search);\n\n if($fields[0] != ''){\n\t oci_bind_by_name($query,':busname',$fields[0]);\n }\n if($fields[1] != 'all'){\n\t oci_bind_by_name($query,':busType',$fields[1]);\n }\n if($fields[2] != ''){\n\t oci_bind_by_name($query,':city',$fields[2]);\n }\n\n\t// Execute the query\n\toci_execute($query);\n\t// Prepare to display results\n echo \"<br>Business  |   City  |   Type\";\n\twhile (($row = oci_fetch_array($query, OCI_BOTH)) != false) {\n\t // Use the uppercase column names for the associative array indices\n echo \"<br>\".'<a href=\"businessDetails.html?id='.urlencode($row[4]).'\">'.$row[0].\" | \".$row[2].\" | \".$row[3].'</a>';\n }\n\n oci_free_statement($query);\n\toci_close($conn);\n}",
"function selcourt1(){\n\t\t$sql=\"SELECT * FROM gestion WHERE suingdate IS NOT NULL AND judicialdate IS NULL\";\n\t\t$data = $this->selcot($sql);\n\t\treturn $data; \n\t}",
"function buscarAtletaPorPesquisa($pesquisa) {\n $sql = \"select * from aprendizagem.atleta where nome like '%{$pesquisa}%' or conteudo like '%{$pesquisa}%'\";\n\n return pesquisar($sql);\n}",
"function searchProcessedName($partialNameQuery, $actorsOrdirectors)\r\n{\r\n\tif ( $actorsOrdirectors == \"actors\" )\r\n\t{\r\n\t\t$query = \"SELECT DISTINCT d.title, d.barcode, d.sell_price FROM dvd d, actors a, has_stars_of s \".\r\n\t\t\t\"WHERE d.barcode=s.barcode AND s.actor_id=a.actor_id \".\r\n\t\t\t\"AND $partialNameQuery AND active=1\".\r\n\t\t\t\" LIMIT 0,30 \";\r\n\t}else if ( $actorsOrdirectors == \"directors\" )\r\n\t{\r\n\t\t$query = \"SELECT d.title, d.barcode, d.sell_price FROM dvd d, directors t \".\r\n\t\t\t\"WHERE d.director_id=t.director_id \".\r\n\t\t\t\"AND $partialNameQuery AND active=1\".\r\n\t\t\t\" LIMIT 0,30 \";\r\n\t}\r\n\t$results = mysqlQuery($query);\r\n\treturn $results;\r\n}",
"function FullSearch($val){\n\t\t\n\t\t$sql = \"SELECT PGID, PGName, PGUrl, PGImgUrl FROM SearchPG WHERE PGName LIKE :post OR PGKeywords LIKE :post\";\n\t\t$query =$this->PDOConnect->prepare($sql);\n\t\t$query->execute(array('post'=>$val));\n\t\t$searchResult = $query->fetchAll(PDO::FETCH_ASSOC);\n\t\t$this->CompileResults($searchResult);\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Abbreviate a path so it does not exceed a given number of characters. | function abbreviatePath($path, $limit) {
if (strlen($path) <= $limit) {
return $path;
}
$paths = explode('/', $path);
$del = 1;
while (true) {
$middle = intval((count($paths) - $del) / 2);
$tmp = array_merge(array_slice($paths, 0, $middle), [' … '] , array_slice($paths, $middle + $del));
$path = implode('/', $tmp);
if (strlen($path) <= $limit || $del >= count($paths) - 2) {
return $path;
}
$del++;
}
} | [
"static function shortenPathSpace($path, $len){\n\t\treturn we_base_util::shortenPathSpace($path, $len);\n\t}",
"public abstract function prefixLength($path);",
"function adjustLength($string, $max)\r\n\t\t{\r\n\t\t\tif (strlen($string) <=$max)\r\n\t\t\t{\r\n\t\t\t \treturn $string;\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\treturn substr($string, 0, $max) . '..';\r\n\t\t\t}\r\n\t\t}",
"private function shorten_path($path, $file)\n {\n $flen = strlen($file);\n $res = (strlen($path)>64-$flen) ? substr($path, 0, 64-$flen).\"...\" : $path;\n return $res;\n }",
"function url_shorten($url, $length = 35)\n{\n}",
"function shorten_string ($name){\n if (strlen($name) > 24){\n $name = substr($name, 0, 24).'...';\n return $name;\n }\n return $name;\n }",
"function shortenUrl($url) {\n\t$max = 48;\n\n\tif ( strlen($url) < $max ) {\n\t\treturn $url;\n\t}\n\n\t// Strip the querystring.\n\t$iQueryString = strpos($url, \"?\");\n\tif ( $iQueryString ) {\n\t\t$url = substr($url, 0, $iQueryString);\n\t}\n\n\tif ( strlen($url) < $max ) {\n\t\treturn $url;\n\t}\n\n\t$iDoubleSlash = strpos($url, \"//\");\n\t$iFirstSlash = strpos($url, \"/\", $iDoubleSlash+2);\n\t$iLastSlash = strrpos($url, \"/\");\n\n\t$sHostname = substr($url, 0, $iFirstSlash); // does NOT include trailing slash\n\t$sPath = substr($url, $iFirstSlash, $iLastSlash);\n\t$sFilename = substr($url, $iLastSlash);\n\n\t$url = $sHostname . \"/...\" . $sFilename;\n\tif ( strlen($url) < $max ) {\n\t\t// Add as much of the path as possible.\n\t\t$url = str_replace(\"/...\", \"/\" . substr($sPath, 1, $max - strlen($url)) . \"...\", $url);\n\t\treturn $url;\n\t}\n\n\t$url = substr($url, 0, $max-3) . \"...\";\n\n\treturn $url;\n}",
"function shortScrollerName($name, $size){\r\n $new_name = '';\r\n $pieces = str_split($name);\r\n \r\n if (count($pieces) <= $size){\r\n $new_name = $name;\r\n }\r\n else{\r\n for ($i=0; $i<$size-3; $i++){\r\n $new_name .= $pieces[$i];\r\n }\r\n $new_name .= '...';\r\n }\r\n\r\n return $new_name;\r\n }",
"private function shorten($name, $length)\n {\n \n $currentLength = strlen($name);\n \n // Check if any shortening is required\n if ($currentLength <= $length) {\n return $name;\n }\n \n // Split name into fragments\n $name = str_replace('.', '\\\\', $name);\n $name = trim($name, ' \\\\');\n $fragments = explode('\\\\', $name);\n $count = count($fragments);\n \n // If the name splits to only one fragment, then it cannot be shortened\n if ($count == 1) {\n return $name;\n }\n \n foreach ($fragments as $key => &$fragment) {\n \n // Never shorten last fragment\n if ($key == $count - 1) {\n break;\n }\n \n // Check for empty fragments (shouldn't happen but it's possible)\n $fragLen = strlen($fragment);\n if ($fragLen <= 1) {\n continue;\n }\n \n // Shorten fragment to one character and check if total length satisfactory\n $fragment = substr($fragment, 0, 1);\n $currentLength = $currentLength - $fragLen + 1;\n \n if ($currentLength <= $length) {\n break;\n }\n }\n unset($fragment);\n \n return implode('\\\\', $fragments);\n }",
"private function formatPath(string $path): string {\n\t\tif (strlen($path) > 250) {\n\t\t\treturn sha1($path);\n\t\t} else {\n\t\t\treturn $path;\n\t\t}\n\t}",
"public function getMaximumPathLength(): int;",
"function shorten($keep, $short, $max, $min = 9, $char = '…') {\n $max = $max - utf8_strlen($keep);\n if($max < $min) return $keep;\n $len = utf8_strlen($short);\n if($len <= $max) return $keep.$short;\n $half = floor($max / 2);\n return $keep.utf8_substr($short, 0, $half - 1).$char.utf8_substr($short, $len - $half);\n}",
"public function abbrev($length)\n {\n $this->arguments[] = '--abbrev=' . $length;\n return $this;\n }",
"private function restrictToFiftyChar($name)\n {\n if(strlen($name) > 50) {\n return substr($name, 50);\n }\n\n return $name;\n }",
"function text_abschneiden($text, $length = 10) {\n if (mb_strlen($text) > $length)\n return mb_substr($text, 0, $length) . \"...\";\n else\n return $text;\n }",
"function SetMaxLength($len){}",
"function _shortenString($str, $maxLength) {\n if (strlen($str) > $maxLength) {\n return substr($str, 0, $maxLength-3).'...';\n }\n return $str;\n }",
"function FillFolderName($name,$nsize)\n{\n\t$str = \"\";\n\tfor($i=0;$i < $nsize-strlen($name);$i++)\n\t{\n\t\t$str .= \"0\";\n\t}\n\t$str .= $name;\n\treturn $str;\n}",
"public static function shortenFilename($name, $maxLength, $suffixLength = 3) {\n\t\tif (mb_strlen($name) === 0 || $maxLength < 1 || $suffixLength < 0) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$pos = mb_strrpos($name, '.');\n\t\tif ($pos === false || $pos <= $maxLength) return $name;\n\n\t\t$shortname = mb_substr($name, 0, min($maxLength - $suffixLength, $pos));\n\n\t\tif ($maxLength - $suffixLength < $pos) {\n\t\t\tif ($suffixLength > 0) $shortname .= '…';\n\t\t\t$shortname .= mb_substr($name, $pos - $suffixLength, 3);\n\t\t}\n\n\t\t$shortname .= mb_substr($name, $pos);\n\n\t\treturn $shortname;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Is the model ready for auditing? | public function readyForAuditing(): bool
{
// TODO: Implement readyForAuditing() method.
} | [
"public function isAuditable();",
"public function supportsAuditing(): bool;",
"private function isModelLoaded()\n\t{\n\t\treturn count(Doctrine::getLoadedModels()) != 0;\n\t}",
"function isRequireToStoreAudit($obj);",
"public function is_ready_test(){\n\t\tif(!$this->ready){\n\t\t\tELog::warning(\"EModel without table has been used. Please fix this.\");\n\t\t}\n\t\treturn $this->ready;\n\t}",
"public function isPersisted(): bool;",
"public function hasAuditor();",
"public function hasAuditRequest()\n {\n return self::$_auditRequest ? true : false;\n }",
"public function isAuditSuccess();",
"function is_ready(){\n if ($this->ignore_create_table) return TRUE;\n return $this->is_ready;\n }",
"protected function _hasModelChanged(){\n if (!$this->hasDataChanges()) {\n return false;\n }\n\n return $this->_getResource()->hasDataChanged($this);\n }",
"public function isKeepingSnapshots(\\Phalcon\\Mvc\\ModelInterface $model) {}",
"public function needPersist(): bool\n {\n return $this->valid && $this->needCreate;\n }",
"public function checkModel(): bool\n {\n if (is_null($this->profile)) throw new ProfileModelNotDefined();\n else return true;\n }",
"protected function auditEnabled()\n {\n return config('eaaudit.enabled') == true;\n }",
"public function hasCreated()\n {\n return $this->created !== null;\n }",
"protected function isVersioned()\n {\n return Injector::inst()->get($this->owner->modelClass)->hasExtension(Versioned::class);\n }",
"public function hasModelDateTime() {\n\t\treturn ($this->model instanceof ModelDateTime);\n\t}",
"public function trained() : bool\n {\n return isset($this->model);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the file name for this product voucher | public function get_voucher_filename() {
// we want the unadulterated voucher number so as to avoid file name clashes
return apply_filters( 'wc_pdf_product_vouchers_voucher_filename', 'voucher-' . $this->strip_unicode( $this->get_voucher_number() ) . '.pdf', $this );
} | [
"private function ProductFilesFileName() {\n\t\t/* Load some settings */\n\t\t$csvilog = JRequest::getVar('csvilog');\n\t\t$template = JRequest::getVar('template');\n\t\t\n\t\t/* Validate the input */\n\t\t$this->file_name = $this->_importmodel->ValidateCSVInput(\"product_files_file_name\");\n\t\t\n\t\t/* Process the image file */\n\t\tif ($template->thumb_create) {\n\t\t\t$file_details = $this->_importmodel->ProcessImage($this->file_name, $this->file_name, $template->file_location_product_images);\n\t\t}\n\t\telse {\n\t\t\t$file_details = $this->_importmodel->FileDetails($this->file_name, $this->file_name, $template->file_location_product_images);\n\t\t}\n\t\t\n\t\tif ($file_details) {\n\t\t\t$find = array(JPATH_SITE, '\\\\');\n\t\t\t$replace = array('', '/');\n\t\t\t$this->file_exists = true;\n\t\t\t$this->file_name = str_replace($find, $replace, $template->file_location_product_images.'/'.$file_details['clean_file_name_original']);\n\t\t\t$this->file_extension = $file_details['file_extension'];\n\t\t\t$this->file_mimetype = $file_details['file_mimetype'];\n\t\t\t$this->file_is_image = $file_details['file_is_image'];\n\t\t\tif (array_key_exists('file_thumb_name', $file_details)) {\n\t\t\t\t$this->file_image_thumb_width = $file_details['file_thumb_width'];\n\t\t\t\t$this->file_image_thumb_height = $file_details['file_thumb_height'];\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\t$this->file_exists = false;\n\t\t}\n\t}",
"public function get_voucher_path() {\n\t\t// hash the pdfs by the least 3 sig digits of the order id, this will give us no more than 1000 files per directory until we hit 1 million pdfs generated\n\t\treturn str_pad( substr( $this->voucher_number, -3 ), 3, 0, STR_PAD_LEFT );\n\t}",
"private function _filename() {\r\n\t\treturn $this->path . $this->id . '.pdf';\r\n\t}",
"public function getFilename()\n\t{\n\t\t$path = Yii::getAlias($this->component->previewPath);\n\t\treturn $path.'/'.$this->getEncryptName();\n\t}",
"private function getFileName()\n\t{\n\t\treturn $this->file_name;\n\t}",
"function get_download_file_name() {\n\t\t$file_name = $this->release()->slug\n\t\t . '.'\n\t\t . $this->media_location()->media_format()->extension;\n\t\t \n\t\treturn apply_filters( 'podlove_download_file_name', $file_name, $this );\n\t}",
"private function getFileName()\n {\n return $this->file->getBaseName() . '.' . $this->file->getExtension();\n }",
"protected function getDiskName()\n {\n if ($this->filepath !== null) {\n return $this->filepath;\n }\n $ext = strtolower($this->getExtension());\n\n if (empty($attachment->uuid)) {\n $this->uuid = Uuid::uuid4()->toString();\n }\n //il nome è dato dal codice del tipo! \n $codice = $this->attachmenttype_codice;\n if ($this->attachmenttype) \n $codice = $this->attachmenttype->codice; \n\n $name = $codice.'_'.str_replace('.', '', $this->uuid);\n return $this->filepath = $ext !== null ? $name . '.' . $ext : $name;\n }",
"public function getFileName()\r\n {\r\n return $this->name . \".\" . $this->extension;\r\n }",
"public function filename()\n {\n return $this->name_space() . '_' . $this->files_hash() . '.' . $this->_type;\n }",
"public function getDocumentFileName() {\n\t\t//FILENAME FROM STORAGE TABLE\n $tableStorage = Engine_Api::_()->getDbtable('files', 'storage');\n $tableStorageName = $tableStorage->info('name');\n $tableDocumentName = Engine_Api::_()->getDbtable('documents', 'sitepagedocument')->info('name');\n\n $file_name = $tableStorage->select()\n ->setIntegrityCheck(false)\n ->from($tableDocumentName, array(''))\n ->join($tableStorageName, \"$tableStorageName.file_id = $this->filename_id\", array('name'))\n ->where($tableStorageName . '.parent_type = ?', 'sitepagedocument')\n\t\t\t\t\t\t\t\t\t\t->query()\n\t\t\t\t\t\t\t\t\t\t->fetchColumn();\n return $file_name;\n\t}",
"public function getDepotFilenameWithRevision()\n {\n return $this->getDepotFilename() . $this->getRevspec();\n }",
"public function getFilename(){\n\n\t\treturn $this->tempFile;\n\n\t}",
"public function getPurchaseFileSheetName() {\n return $this->purchase_export_sheet_name;\n }",
"public function name()\n {\n if (isset($this->_file['name'])) {\n return $this->_file['name'];\n }\n }",
"public function getFileName()\n {\n $value = $this->get(self::FILENAME);\n return $value === null ? (string)$value : $value;\n }",
"public function filename()\n {\n $processor = Hash::get($this->settings, 'nameCallback', null);\n if (is_callable($processor)) {\n return $processor($this->data, $this->settings, $this->entity);\n }\n\n return $this->data['name'];\n }",
"public function getFileName()\n {\n return basename($this->path);\n }",
"public function getfilename()\n {\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Callback invoked when constructing the form. Should be used to add elements, validators, etc. | public function buildForm(); | [
"public function buildForm()\n {\n $this\n ->add('value', 'text', ['label' => trans('elementForm.value')])\n ->addCollection('location', 'Activity\\TargetLocation', 'target_location', [], trans('elementForm.location'))\n ->addAddMoreButton('add_target_location', 'target_location')\n ->addCollection('dimension', 'Activity\\TargetDimension', 'target_dimension', [], trans('elementForm.dimension'))\n ->addAddMoreButton('add_target_dimension', 'target_dimension')\n ->addComments();\n }",
"public function buildForm()\n {\n $this\n ->addCollection('recipient_region', 'Activity\\RecipientRegion', 'recipient_region')\n ->addAddMoreButton('add_recipient_region', 'recipient_region');\n }",
"public function buildForm()\n {\n $this->addResults();\n }",
"public function buildForm()\n {\n $this->add('capital_spend', 'text', ['label' => trans('elementForm.capital_spend'), 'help_block' => $this->addHelpText('Activity_CapitalSpend-percentage'), 'required' => true]);\n }",
"public function buildForm()\n {\n $this->add('organization_identifier_code', 'text', ['label' => trans('elementForm.organisation_identifier_code')])\n ->add('receiver_activity_id', 'text', ['label' => trans('elementForm.receiver_activity_id')])\n ->addSelect('type', $this->getCodeList('OrganisationType', 'Activity'), trans('elementForm.type'), $this->addHelpText('Activity_ParticipatingOrg-type'))\n ->addNarrative('receiver_org_narrative')\n ->addAddMoreButton('add_receiver_org_narrative', 'receiver_org_narrative');\n }",
"public function buildForm()\n {\n $this\n ->addCollection('contact_info', 'Activity\\ContactInfo', 'contactInfo')\n ->addAddMoreButton('add_contactInfo', 'contactInfo');\n }",
"public function initializeFormElement()\n {\n }",
"public function buildForm()\n {\n $this\n ->addSelect(\n 'organization_role',\n $this->getCodeList('OrganisationRole', 'Activity'),\n trans('elementForm.organisation_role'),\n $this->addHelpText('Activity_ParticipatingOrg-role'),\n null,\n true\n )\n ->add('identifier', 'text', ['label' => trans('elementForm.identifier'), 'help_block' => $this->addHelpText('Activity_ParticipatingOrg-ref')])\n ->addSelect('organization_type', $this->getCodeList('OrganisationType', 'Activity'), trans('elementForm.organisation_type'), $this->addHelpText('Activity_ParticipatingOrg-type'))\n ->add('activity_id', 'text', ['label' => trans('elementForm.activity_id')])\n ->add('crs_channel_code','text',['label' => 'Crs Channel Code'])\n ->addNarrative('narrative', trans('elementForm.organisation_name'))\n ->addAddMoreButton('add', 'narrative')\n ->addRemoveThisButton('remove_narrative');\n }",
"public function buildForm()\n {\n $this\n ->add(\n 'new_organization_group',\n 'collection',\n [\n 'type' => 'form',\n 'options' => [\n 'class' => 'App\\SuperAdmin\\Forms\\OrganizationGroupInformation',\n 'label' => false,\n ]\n ]\n )\n ->add(\n 'group_admin_information',\n 'collection',\n [\n 'type' => 'form',\n 'options' => [\n 'class' => 'App\\SuperAdmin\\Forms\\GroupAdmin',\n 'label' => false,\n ]\n ]\n )\n ->addSaveButton();\n }",
"function &buildForm();",
"public function buildForm()\n {\n $this\n ->add('url', 'text', ['help_block' => $this->addHelpText('Organisation_DocumentLink-url')])\n ->addSelect('format', $this->getCodeList('FileFormat', 'Organization'), trans('elementForm.format'), $this->addHelpText('Organisation_DocumentLink-format'))\n ->addNarrative('narrative')\n ->addAddMoreButton('add_narrative', 'narrative')\n ->addCollection('category', 'Organization\\CategoryCodeForm', 'category', [], trans('elementForm.category'))\n ->addAddMoreButton('add_category', 'category')\n ->addCollection('language', 'Organization\\LanguageCodeForm', 'language', [], trans('elementForm.language'))\n ->addAddMoreButton('add_language', 'language')\n ->addCollection('recipient_country', 'Organization\\RecipientCountryForm', 'recipient_country', [], trans('elementForm.recipient_country'))\n ->addAddMoreButton('add_recipient_country', 'recipient_country')\n ->addRemoveThisButton('remove_document_link');\n }",
"public function buildForm()\n {\n $this\n ->addNarrative('activity_description_narrative')\n ->addAddMoreButton('add', 'activity_description_narrative');\n }",
"public function buildForm()\n {\n $this\n ->addSelect('status', $this->getCodeList('BudgetStatus', 'Activity'), trans('elementForm.status'))\n ->addCollection('recipient_region', 'Organization\\RecipientRegion', 'recipient_region', [], trans('elementForm.recipient_region'))\n ->addCollection('period_start', 'Organization\\PeriodStart', '', [], trans('elementForm.period_start'))\n ->addCollection('period_end', 'Organization\\PeriodEnd', '', [], trans('elementForm.period_end'))\n ->addCollection('value', 'Organization\\ValueForm', '', [], trans('elementForm.value'))\n ->addCollection('budget_line', 'Organization\\BudgetLineForm', 'budget_line', [], trans('elementForm.budget_line'))\n ->addAddMoreButton('add_budget_line', 'budget_line')\n ->addRemoveThisButton('remove_recipient_region_budget');\n }",
"public function init()\n {\n // form should use p4cms-ui styles.\n $this->setAttrib('class', 'p4cms-ui role-form role-add-form');\n\n // set the method for the form to POST\n $this->setMethod('post');\n\n // add a field to collect the role name.\n $this->addElement(\n 'text',\n 'id',\n array(\n 'label' => 'Name',\n 'required' => true,\n 'filters' => array('StringTrim'),\n 'validators' => array('GroupName'),\n 'size' => 30,\n 'order' => 10\n )\n );\n\n // add a field to collect users to assign this role to (doesn't include system user).\n $users = P4Cms_User::fetchAll()->invoke('getId');\n\n $options = count($users) ? array_combine($users, $users) : array();\n $this->addElement(\n 'MultiCheckbox',\n 'users',\n array(\n 'multiOptions' => $options,\n 'label' => 'Users',\n 'order' => 20\n )\n );\n\n // add the submit button\n $this->addElement(\n 'SubmitButton',\n 'save',\n array(\n 'label' => 'Save',\n 'class' => 'preferred',\n 'required' => false,\n 'ignore' => true\n )\n );\n\n // put the button in a fieldset.\n $this->addDisplayGroup(\n array('save'),\n 'buttons',\n array(\n 'class' => 'buttons',\n 'order' => 100\n )\n );\n\n }",
"public function init_form_fields()\n {\n }",
"public function buildForm()\n {\n $this\n ->add(\n 'date',\n 'date',\n ['label' => trans('elementForm.date'), 'help_block' => $this->addHelpText('Activity_ActivityDate-iso_date'), 'required' => true, 'attr' => ['placeholder' => 'YYYY-MM-DD']]\n )\n ->addSelect('type', $this->getCodeList('ActivityDateType', 'Activity'), trans('elementForm.activity_date_type'), $this->addHelpText('Activity_ActivityDate-type'), null, true)\n ->addNarrative('narrative')\n ->addAddMoreButton('add_narrative', 'narrative')\n ->addRemoveThisButton('remove_activity_date');\n }",
"public function _get_form_callback()\n {\n }",
"public function buildForm()\n {\n $this\n ->add('group_name', 'text')\n ->add(\n 'organizations',\n 'choice',\n [\n 'choices' => $this->getOrganizationName(),\n 'attr' => ['style' => 'height:100px'],\n 'multiple' => true\n ]\n )\n ->add(\n 'group_identifier',\n 'text',\n [\n 'attr' => [\n 'id' => 'group_identifier'\n ],\n 'help_block' => [\n 'text' => \"Your group identifier will be used as a prefix for your organisation group. We recommend that you use a short abbreviation that uniquely identifies your organisation group. If your group identifier is 'abc' the username for the group created with this registration will be 'abc_group'.\",\n 'tag' => 'p',\n 'attr' => ['class' => 'help-block']\n ],\n 'label' => 'Group Identifier'\n ]\n );\n }",
"public function buildForm()\n {\n $this\n // ->addSelect('type', $this->getCodeList('DescriptionType', 'Activity'), trans('elementForm.description_type'), $this->addHelpText('Activity_Description-type'), '1', true)\n ->add(\n 'type',\n 'hidden',\n [\n 'value' => '1'\n ]\n )\n ->addGeneralDescription('narrative', trans('elementForm.text'), ['narrative_required' => true])\n ->addAddMoreButton('add_narrative', 'narrative')\n ->addRemoveThisButton('remove_description');\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Validate deleting an event. | public function validateDelete($data)
{
self::$rules = [
'id' => 'required|array',
'id.*' => 'exists:fedEvent,id,run,0',
];
$this->validate($data);
} | [
"public function testDeleteValidEvent(){\n\t\t//count the number of rows and save it for later\n\t\t$numRows = $this->getConnection()->getRowCount(\"event\");\n\t\t//create a new Event and insert it into mySQL\n\t\t$event = new Event(null, $this->truck->getTruckId(), $this->VALID_EVENTEND, $this->VALID_EVENTLOCATION, $this->VALID_EVENTSTART);\n\t\t$event->insert($this->getPDO());\n\n\t\t//deletes the Event from mySQL\n\t\t$this->assertEquals($numRows + 1, $this->getConnection()->getRowCount(\"event\"));\n\t\t$event->delete($this->getPDO());\n\n\t\t//grab the data from mySQL and enforce the Event does not exist\n\t\t$pdoEvent = Event:: getEventByEventId($this->getPDO(), $event->getEventId());\n\t\t$this->assertNull($pdoEvent);\n\t\t$this->assertEquals($numRows, $this->getConnection()->getRowCount(\"event\"));\n\t}",
"public function anEventCanBeSuccessfullyDeleted()\n { \n $user = User::factory()->create();\n\n $this->actingAs($user);\n\n $event = Event::factory()->create();\n\n $response = $this->json('DELETE', \"/events/$event->id\", ['HTTP_X-Requested-With' => 'XMLHttpRequest'])\n ->assertNoContent(204);\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 validateDelete(ValidationHook $hook)\n {\n }",
"public function events_delete(): void\n {\n $response = $this->check_request('Delete event');\n if (!$response) {\n $eventid = input_request('eventid');\n TableEvents::deleteByID($eventid);\n TableParticipants::deleteByEvent($eventid);\n TableRSVPs::deleteByEvent($eventid);\n $this->log_info(\"Delete event $eventid\");\n $response = $this->get_response(false, 'Event deleted');\n }\n exit(json_encode($response));\n }",
"public function testAdminCanDeleteAnEvent()\n {\n $this->assertTrue($this->admin->can('delete', $this->event));\n }",
"public function validateDeleteSegment($segment_id)\n {\n self::$rules = ['id' => 'required|exists:eventSegment'];\n $this->validate(['id' => $segment_id]);\n }",
"public function testDeleteEvent()\n {\n }",
"public function ajax_delete() {\n\t\t$errors = array();\n\t\t$event_id = isset($_POST['event_id']) ? $_POST['event_id'] : null;\n\n\t\t$event = Event::query()\n\t\t\t->where('id', $event_id)\n\t\t\t->first();\n\n\t\tif ($event == null) {\n\t\t\t$errors[0] = $GLOBALS['lang']['error_event_not_found'];\n\t\t\techo json_encode($errors);\n\t\t\texit();\n\t\t}\n\n\t\tif (!$event->creator_id == SessionHelper::get_session_user_id()) {\n\t\t\t$errors[0] = $GLOBALS['lang']['error_not_allowed_to_delete'];\n\t\t\techo json_encode($errors);\n\t\t\texit();\n\t\t}\n\n\t\t$successful = $event->delete();\n\n\t\tif (!$successful) {\n\t\t\t$errors[0] = $GLOBALS['lang']['error_event_could_not_be_deleted'];\n\t\t}\n\n\t\techo json_encode($errors);\n\t}",
"public function deleteAction() {\n $event = $this->_gcal->getEvent($this->_getParam('id'));\n $this->view->id = substr($event->id,strrpos($event->id,'/')+1,26);\n $this->view->title = $event->title;\n if ($this->_request->isPost()) {\n $id = $this->_request->getPost('id');\n $del = $this->_request->getPost('del');\n //Check if delete parameter is set and that the string is correct\n if ($del == 'Yes' && $id == substr($event->id,strrpos($event->id,'/') +1, 26)) {\n $event->delete();\n }\n $this->getFlash()->addMessage('That event has been deleted');\n $this->_redirect('/users/calendar');\n }\n }",
"public function validateDelete(Zikula_ValidationHook $hook)\n {\n // nothing to do here really, just return\n // if however i wanted to check for something, i would do it like the\n // validate_edit function!!! [make sure you check ui_edit and process_edit also]\n\n return;\n }",
"public function validateDelete($params)\n {\n }",
"public function validateDelete(ValidationHook $hook)\n {\n return;\n }",
"public function validate_delete(Zikula_ValidationHook $hook)\n {\n // nothing to do here really, just return\n // if however i wanted to check for something, i would do it like the\n // validate_edit function!!! [make sure you check ui_edit and process_edit also]\n\n return;\n }",
"protected function validateDelete()\n\t{\n\t\tif (!$this->user->hasPermission('modify', 'extension/module/testimonialcrud')) {\n\t\t\t$this->error['warning'] = $this->language->get('error_permission');\n\t\t}\n\t\treturn !$this->error;\n\t}",
"public function validator_delete($id)\n {\n }",
"public function delete(Event $event)\n\t{\n\t\t$event->delete();\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
get popup has accepted by includes excludes and is active | public function getAvailable(){
return Mage::getModel('campaign/popup')->getAvailable();
} | [
"protected function isPopupEnabled()\n {\n return $this->is_popup_enabled;\n }",
"protected function isPopup()\n {\n return $this->convertRequest()->isXmlHttpRequest();\n }",
"public function isPopupOpen()\n {\n return $this->addMethod('isPopupOpen');\n }",
"function existingPopupsCheck() {\n if(isset($popups)){\n foreach($popups as $p){\n $this->addPopup($p[\"type\"], $p[\"content\"]);\n }\n \n return false;\n }\n \n return true;\n}",
"public function getNotificationPopupEnable()\n {\n return $this->_scopeConfig->getValue('notification_popup/general/enable');\n }",
"public function canSeeInPopup($text) {\n return $this->getScenario()->runStep(new \\Codeception\\Step\\ConditionalAssertion('seeInPopup', func_get_args()));\n }",
"public function canShow();",
"public function isOpenByClick() {\n\t\treturn $this->getOpenByClick();\n\t}",
"public function getActiveEditorFlagsExist()\n {\n return UserJobEditorFlag::existsBy($this->id, null, null, array('pending'));\n }",
"function PopupWindow_isClicked(e) {\n\tif (this.divName != null) {\n\t\tif (this.use_layers) {\n\t\t\tvar clickX = e.pageX;\n\t\t\tvar clickY = e.pageY;\n\t\t\tvar t = document.layers[this.divName];\n\t\t\tif ((clickX > t.left) && (clickX < t.left+t.clip.width) && (clickY > t.top) && (clickY < t.top+t.clip.height)) {\n\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\telse { return false; }\n\t\t\t}\n\t\telse if (document.all) { // Need to hard-code this to trap IE for error-handling\n\t\t\tvar t = window.event.srcElement;\n\t\t\twhile (t.parentElement != null) {\n\t\t\t\tif (t.id==this.divName) {\n\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\tt = t.parentElement;\n\t\t\t\t}\n\t\t\treturn false;\n\t\t\t}\n\t\telse if (this.use_gebi && e) {\n\t\t\tvar t = e.originalTarget;\n\t\t\ttry {while (t.parentNode != null) {\n\t\t\t\tif (t.id==this.divName) {\n\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\tt = t.parentNode;\n\t\t\t\t} } catch(g) {}\n\t\t\treturn false;\n\t\t\t}\n\t\treturn false;\n\t\t}\n\treturn false;\n\t}",
"public function popupIsAllowedDisplay($popup)\n {\n switch ($popup['frequently']) {\n case 1:\n return true;\n case 2:\n return $this->popupNotInSession($popup['popup_id']);\n case 3:\n if (!empty($this->getPopupCookie($popup['popup_id']))) {\n return 0;\n }\n return true;\n default:\n return 0;\n }\n return 0;\n }",
"public function getShowInfoWindow()\n {\n return ($this->Content && !$this->HideContent);\n }",
"public function isEmbedOnly()\n {\n return (int) Mage::getStoreConfig('newsletterpopup/popup/enabled') === 2;\n }",
"function is_popup_visible( $id ) {\r\n\t\t$visible = true;\r\n\r\n\t\t// popup is disabled for mobile\r\n\t\tif( themify_popup_check( 'popup_mobile_disable' ) && wp_is_mobile() ) {\r\n\t\t\t$visible = false;\r\n\t\t}\r\n\r\n\t\t// has user seen this popup before?\r\n\t\t/**\r\n\t\t * Migration routine: previsouly used \"show_once\" checkbox is converted to \"limit_count\" (number).\r\n\t\t */\r\n\t\tif ( themify_popup_check( 'popup_show_once' ) ) {\r\n\t\t\tdelete_post_meta( $id, 'popup_show_once' );\r\n\t\t\tadd_post_meta( $id, 'popup_limit_count', 1 );\r\n\t\t}\r\n\t\tif ( themify_popup_check( 'popup_limit_count' ) && isset( $_COOKIE[\"themify-popup-{$id}\"] ) && $_COOKIE[\"themify-popup-{$id}\"] >= themify_popup_get( 'popup_limit_count' ) ) {\r\n\t\t\t$visible = false;\r\n\t\t}\r\n\r\n\t\t// check if popup has a page view limit\r\n\t\tif( $view_count = themify_popup_get( 'popup_page_view', 0 ) ) {\r\n\t\t\tif( ! ( isset( $_COOKIE['themify_popup_page_view'] ) && $_COOKIE['themify_popup_page_view'] >= $view_count ) ) {\r\n\t\t\t\t$visible = false;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif( themify_popup_get( 'popup_show_on_toggle', 'all-pages' ) == 'specific-pages' && themify_popup_check( 'popup_show' ) ) {\r\n\t\t\tif( ! themify_verify_assignments( themify_popup_get( 'popup_show' ) ) ) {\r\n\t\t\t\t$visible = false;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif( ( themify_popup_get( 'popup_show_to' ) == 'guest' && is_user_logged_in() )\r\n\t\t\t|| ( themify_popup_get( 'popup_show_to' ) == 'user' && ! is_user_logged_in() )\r\n\t\t) {\r\n\t\t\t$visible = false;\r\n\t\t}\r\n\r\n\t\treturn $visible;\r\n\t}",
"public function canBeShown()\n {\n if (!is_null($this->_show_window)) {\n return $this->_show_window;\n }\n\n if (!$this->isOutputEnabled('Mage_AdminNotification')) {\n $this->_show_window = false;\n return false;\n }\n\n if (!$this->_isAllowed()) {\n $this->_show_window = false;\n return false;\n }\n \n if(!$this->windowLogsEnabled()) {\n $this->_show_window = false;\n return false;\n }\n\n if (is_null($this->_show_window)) {\n $this->_show_window = $this->isShow();\n }\n return $this->_show_window;\n }",
"public function canDisplayPopin()\n {\n // Is not enabled\n if(!Mage::getStoreConfigFlag($this->_path_active)) {\n return false;\n }\n\n //only in home page and we are not in home page?\n if(Mage::getStoreConfigFlag($this->_path_home_only) && !$this->getIsHomePage()) {\n return false;\n }\n\n //no block configured?\n if(!$this->getBlockToShow()) {\n return false;\n }\n\n // OK: Display popin if not already seen\n $cookieLifetime = Mage::getStoreConfig($this->_path_cookie_lifetime);\n $alreadySeenPopin = Mage::getSingleton('core/cookie')->get($this->_cookie_name);\n if(!$alreadySeenPopin) {\n $cookie = Mage::getSingleton('core/cookie')->setLifetime($cookieLifetime);\n $cookie->set($this->_cookie_name, 1);\n return true;\n }\n\n return false;\n }",
"public function isMessageWindowAvailable()\n {\n $block = $this->getLayout()->getBlock('notification_window');\n if ($block) {\n return $block->canShow();\n }\n return false;\n }",
"public function get_popups() {\n\t\t$data = $this->get_data();\n\t\treturn isset( $data['popups'] ) ? $data['popups'] : array();\n\t}",
"private function has_been_shown( $action ) {\n\t\t$shown_for_features = get_option( self::SHOWN_FOR_ACTIONS_OPTION_NAME, array() );\n\t\t$has_been_shown = in_array( $action, $shown_for_features, true );\n\n\t\treturn $has_been_shown;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
get Settings array by array of keys | function getSettings($keysArr, $db)
{
$outArr=[];
if($db==NULL)
return $outArr;
$where="";
if (isset($keysArr)) {
for ($i=0;$i<count($keysArr);$i++) {
$where.="kee=:kee".$i." OR ";
}
if (count($keysArr)>0) {
$where=" WHERE ".substr($where, 0, -4);
}
}
$sql="SELECT * FROM settings ".$where;
$stmt = $db->prepare($sql);
for ($i=0;$i<count($keysArr);$i++) {
$stmt->bindParam(':kee'.$i, $keysArr[$i]);
}
$stmt->execute();
while ($row = $stmt->fetch(\PDO::FETCH_ASSOC)) {
if ($row['vaa']=='true' || $row['vaa']=='false') {
$outArr[$row['kee']]=$row['vaa']=='true'?true:false;
} else {
$outArr[$row['kee']]=$row['vaa'];
}
}
return $outArr;
} | [
"function get_settings_array(){\n return $this->get_values_array('name', 'value'); \n }",
"abstract protected function _settingsKeys();",
"public function getMultiple($keys);",
"public function getSettings($indexes = []);",
"private function requestedSettings()\n {\n $settings = app('request')->input('settings');\n\n return array_map(function ($label, $value) {\n return [\n 'label' => $label,\n 'value' => $value,\n ];\n }, array_keys($settings), $settings);\n }",
"public static function getAll()\n {\n $array = [];\n $settings = self::all();\n foreach ($settings as $setting) {\n $array[$setting->key] = json_decode($setting->value);\n }\n\n return $array;\n }",
"public function getSettings(string $pattern, array $settings = []): array;",
"public function getMultiple($key);",
"public function all() {\n $rawSettings = parent::all();\n $settings = [];\n foreach ($rawSettings as $setting) {\n $settings[$setting->name] = $setting;\n }\n return $settings;\n }",
"function msettings_read_all()\n\t{\n\t\t$settings = lcrud_read(lconf_get(\"lang\") . \"_settings\");\n\t\tforeach ($settings as $set)\n\t\t{\n\t\t\t$data[$set[\"name\"]] = $set[\"value\"];\n\t\t}\n\t\treturn $data;\n\t}",
"public static function getAvailableSettingsKeys() {\n $settings_keys = [];\n $reflect = new \\ReflectionClass(static::class);\n foreach ($reflect->getConstants() as $key => $value) {\n if (strpos($key, 'SETTINGS_') === 0) {\n $settings_keys[$key] = $value;\n }\n }\n\n return $settings_keys;\n }",
"private function buildArrSettingsIndex() {\n\t\t$this->arrIndex = array();\n\t\tforeach ( $this->arrSettings as $key => $value ) {\n\t\t\tif ( isset( $value['name'] ) ) { $this->arrIndex[ $value['name'] ] = $key; }\n\t\t}\n\t}",
"public function getOptionsKeys(): array;",
"public function getSettings(){\n\t\t$sql=\"SELECT * FROM \".SETTING_TABLE;\n\t\t$result=$this->query($sql);\n\t\t$settings=array();\n\t\tif($result)\n\t\t\twhile($row=$result->fetch_assoc())\n\t\t\t\t$settings[$row['Setting']]=$row['Value'];\n\t\treturn $settings;\n\t}",
"public function geta() {\n\t\t\t$return = Array();\n\t\t\tforeach(func_get_args() as $key) {\n\t\t\t\t$return[] = $this->get($key);\n\t\t\t}\n\t\t\t\n\t\t\treturn $return;\n\t\t}",
"function pivotRepeatingSettings($keys) {\n $config = [];\n foreach ($keys as $key) {\n $config[$key] = $this->getProjectSetting($key);\n }\n\n // Now we have a bunch variables with the same number of repeats. Lets group them:\n\n $map = [];\n $count = count($config[$keys[0]]);\n for ($i = 0; $i < $count; $i++) {\n $c = [];\n foreach ($keys as $key) {\n $c[$key] = $config[$key][$i];\n }\n $map[$i] = $c;\n }\n\n return $map;\n }",
"public function all()\n {\n $rawSettings = parent::all();\n\n $settings = [];\n foreach ($rawSettings as $setting) {\n $settings[$setting->name] = $setting;\n }\n\n return $settings;\n }",
"function get_settings ()\n{\n global $db;\n\n $s = $db->prepare(\"SELECT * FROM `tbl_settings`\");\n if (!$s->execute()) {\n return false;\n }\n $rows = $s->fetchAll();\n\n $data = [];\n foreach ($rows as $row) {\n $data[$row['setting_name']] = $row['setting_value'];\n }\n return $data;\n}",
"private function getSettings(): array\n {\n $unusedSettings = $this->settingService->findUnusedSettings();\n $settings = [];\n\n foreach ($unusedSettings as $setting) {\n $settings[$setting] = $setting;\n }\n\n return $settings;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create true type font test image | protected function createTrueTypeFontTestImage()
{
$parseTimeStart = GeneralUtility::milliseconds();
$image = @imagecreate(200, 50);
imagecolorallocate($image, 255, 255, 55);
$textColor = imagecolorallocate($image, 233, 14, 91);
@imagettftext(
$image,
20 / 96.0 * 72, // As in compensateFontSizeiBasedOnFreetypeDpi
0,
10,
20,
$textColor,
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('install') . 'Resources/Private/Font/vera.ttf',
'Testing true type'
);
$outputFile = PATH_site . 'typo3temp/assets/images/installTool-' . StringUtility::getUniqueId('createTrueTypeFontTestImage') . '.gif';
imagegif($image, $outputFile);
/** @var \TYPO3\CMS\Install\Status\StatusInterface $message */
$message = GeneralUtility::makeInstance(\TYPO3\CMS\Install\Status\InfoStatus::class);
$message->setTitle('True type font');
$message->setMessage(
'If the two images below do not look the same, please check your FreeType 2 module.'
);
$testResults = [];
$testResults['ttf'] = [];
$testResults['ttf']['message'] = $message;
$testResults['ttf']['title'] = '';
$testResults['ttf']['outputFile'] = $outputFile;
$testResults['ttf']['referenceFile'] = $this->imageBasePath . 'TestReference/Font.gif';
$this->view->assign('testResults', $testResults);
return $this->imageTestDoneMessage(GeneralUtility::milliseconds() - $parseTimeStart);
} | [
"protected function createTrueTypeFontTestImage() {}",
"public function fontTest()\n\t{\n global $config;\n\n $images = '';\n $captcha = getInstance()->captcha;\n\n asort($captcha->fonts);\n\n foreach($captcha->fonts as $key => $value)\n {\n \t$captcha->setHeight('50');\n \t$captcha->setFontSize('25');\n \t$captcha->setChar(mb_strlen($captcha->char_pool['random'], $config['charset']));\n \t$captcha->setColor('cyan');\n \t$captcha->setNoiseColor('cyan');\n \t$captcha->setFont($key);\n \t$captcha->create();\n\n \t$images.= '<p>'.$key.'<img src=\"'.$captcha->getImageUrl().'\"></p>';\n }\n\n return $images;\n\t}",
"protected function image_font()\n\t{\n\t\t$font_tmp = imagecreatefrompng($this->font);\n\t\timagefilter($font_tmp, IMG_FILTER_COLORIZE, $this->font_rgba[0], $this->font_rgba[1], $this->font_rgba[2], $this->font_rgba[3]);\n\t\t$this->alpha($font_tmp);\n\t\tif ($this->font_smooth)\n\t\t{\n\t\t\timagefilter($font_tmp, IMG_FILTER_SMOOTH, $this->font_smooth_level);\n\t\t}\n\t\tif ($this->font_gaussian_blur)\n\t\t{\n\t\t\timagefilter($font_tmp, IMG_FILTER_GAUSSIAN_BLUR);\n\t\t}\n\t\t$this->image_font = imagecreatetruecolor($this->font_width, $this->font_height);\n\t\t$background = imagecolorallocatealpha($this->image_font, $this->background_rgba[0], $this->background_rgba[1], $this->background_rgba[2], $this->background_rgba[3]);\n\t\timagefilledrectangle($this->image_font, 0, 0, $this->font_width, $this->font_height, $background);\n\t\t$this->alpha($this->image_font);\n\t\timagecopyresampled($this->image_font, $font_tmp, 0, 0, 0, 0, $this->font_width, $this->font_height, $this->font_png_width, $this->font_png_height);\n\t\timagedestroy($font_tmp);\n\t\treturn true;\t\n\t}",
"protected function makeFontImage()\n {\n $textbox = $this->calculateTextBox();\n $image = imagecreate($textbox['width'], $textbox['height']);\n\n $bgColor = imagecolorallocatealpha($image, $this->bg[0], $this->bg[1], $this->bg[2], $this->bg[3]);\n $fgColor = imagecolorallocatealpha($image, $this->fg[0], $this->fg[1], $this->fg[2], $this->fg[3]);\n\n imagettftext($image, $this->fSize, 0, $textbox['left'], $textbox['top'], $fgColor, $this->fFile, $this->fText);\n\n return $image;\n }",
"function gd_ft_text ($image, $size, $angle, $x, $y, $color, $fontfile, $text, $extrainfo = null )\n{\n return imagefttext($image, $size, $angle, $x, $y, $color, $fontfile, $text, $extrainfo);\n}",
"function imagettftext ($image, $size, $angle, $x, $y, $color, $fontfile, $text) {}",
"function imagefttext($im, $size, $angle, $x, $y, $col, $font_file, $text, $extrainfo = null) {}",
"function imagepstext($image, $text, $font_index, $size, $foreground, $background, $x, $y, $space = null, $tightness = null, $angle = null, $antialias_steps = null) {}",
"function imagepsencodefont($font_index, $encodingfile){}",
"function imagepstext ($image, $text, $font, $size, $foreground, $background, $x, $y, $space = null, $tightness = null, $angle = null, $antialias_steps = null) {}",
"function imagettftext($im, $size, $angle, $x, $y, $col, $font_file, $text) {}",
"function createImage($text,$back_col,$txt_col, $fontSize = 20, $imgWidth = 400, $imgHeight = 400){\r\n\r\n\t\t//This is the path of the font to be given to the text\r\n $font = 'fonts/arial.ttf';\r\n\t list($br, $bg, $bb) = sscanf($back_col, \"#%02x%02x%02x\"); // to convert the hex codes in to rgb format\r\n\t\tlist($tr, $tg, $tb) = sscanf($txt_col, \"#%02x%02x%02x\");\r\n $angle = 0;\r\n //To create a Box For the Image\r\n $this->img = imagecreatetruecolor($imgWidth, $imgHeight);\r\n //Now declaring some Colors\r\n $background = imagecolorallocate($this->img, $br,$bg,$bb); // the color for background of quote\r\n $grey = imagecolorallocate($this->img, 128, 128, 128);\r\n $txtColor = imagecolorallocate($this->img, $tr,$tg,$tb); // the color for the text on the image\r\n imagefilledrectangle($this->img, 0, 0, $imgWidth - 1, $imgHeight - 1, $background);\r\n \r\n //break lines\r\n $splitText = explode ( \" \" , $text ); // Exploding the String on the base of WhiteSpaces\r\n $lines = count($splitText);\r\n // Now individually adding each line to the image\r\n foreach($splitText as $txt){\r\n $textBox = imagettfbbox($fontSize,$angle,$font,$txt); // Give the bounding box of a text using TrueType fonts\r\n $textWidth = abs(max($textBox[2], $textBox[4])); // index 2 and 4 are x coordinates of lower right and upper right corner\r\n $textHeight = abs(max($textBox[5], $textBox[7]));// index 5 and 5 are y coordinates of upper right and upper left corner\r\n $x = (imagesx($this->img) - $textWidth)/2;\r\n $y = ((imagesy($this->img) + $textHeight)/2)-($lines-2)*$textHeight;\r\n $lines = $lines-1;\r\n \r\n //add some shadow to the text\r\n imagettftext($this->img, $fontSize, $angle, $x-1, $y-1, $grey, $font, $txt);\r\n \r\n //add the text\r\n imagettftext($this->img, $fontSize, $angle, $x, $y, $txtColor, $font, $txt);\r\n }\r\n\treturn true;\r\n }",
"function test_with_NoFont(){\n ob_end_clean();\n $img_data = VerifyCode::build();\n /*\n @@ Return :\n array(\n 'code' => 'abcde...123...',\n 'time' => time(),\n 'image'=> array(\n 'format' => 'png', // png/jpg.\n 'data' => 'Image Raw Data.', // image raw data.\n )\n )\n */\n var_dump($img_data);\n $t = time();\n file_put_contents(\"test_with_NoFont_{$t}.png\", $img_data['image']['data']);\n}",
"function create_imagetext(){\n\t\t// Check if the graphic mode is enabled or the GD Library Extension is available\n\t\tif($this->graphic && $this->check_gdlibrary()){\n\t\t\t// Call the function to create the temporary image verfication\n\t\t\t$this->create_image();\n\t\t\t$this->imagetext = \"<img src=\\\"\".$this->tmp_img.\".png\\\" border=\\\"0\\\" alt=\\\"secret code\\\" title=\\\"secret code\\\" />\";\n\t\t\t$this->write_log(\"Starts create IMAGE verification !\");\n\t\t}else{\n\t\t\t// Text mode\n\t\t\t$this->imagetext = \"<div style=\\\"\";\n\t\t\tforeach($this->style as $key => $value){\n\t\t\t\t$this->imagetext .= \"$key:$value; \";\n\t\t\t}\n\t\t\t$this->imagetext .= \"\\\">$this->sess_value</div>\";\n\t\t\t$this->write_log(\"Starts create TEXT verification !\");\n\t\t}\n\t}",
"private function create_image($width, $height, $bg_color, $txt_color, $imagetype, $text ) {\n \t\t\n $text = $text ? $text : $width.'x'.$height;\n $image = ImageCreate($width, $height); \n \n \t$bg_color = ImageColorAllocate($image, base_convert(substr($bg_color, 0, 2), 16, 10), \n \t\t\t\t\t\t\t\t\t\t base_convert(substr($bg_color, 2, 2), 16, 10), \n \t\t\t\t\t\t\t\t\t\t base_convert(substr($bg_color, 4, 2), 16, 10));\n \n \t$txt_color = ImageColorAllocate($image,base_convert(substr($txt_color, 0, 2), 16, 10), \n \t\t\t\t\t\t\t\t\t\t base_convert(substr($txt_color, 2, 2), 16, 10), \n \t\t\t\t\t\t\t\t\t\t base_convert(substr($txt_color, 4, 2), 16, 10));\n \t\t\t\t\t\t\t\t\t\t \n ImageFill($image, 0, 0, $bg_color);\n \n \t$sizeratio = $width < 200 ? ($width < 100 ? 3 : 4 ) : 5;\t\n \t$fontsize = ($width>$height) ? floor($height / $sizeratio) : floor($width / $sizeratio);\n \t\n \t$fontfits = false;\t\n \twhile(!$fontfits) {\n \t$textsize = imagettfbbox($fontsize, 0, $this->font, $text);\n \t\n \t$textwidth = $textsize[2] - $textsize[0];\n \t$textheight = $textsize[3] - $textsize[5];\n \t\n \tif ($textwidth > $width-($width/5) || $textheight > $height-($height/5)) {\n \t$fontsize--;\n \t}\n \telse {\n \t$fontfits = true;\n \t}\n \t}\n \n \t$left = ($width - $textwidth)/2;\n \t$top = ($height - -$textheight)/2;\n \n \timagettftext($image,$fontsize, 0, $left, $top, $txt_color, $this->font, $text); \n \t\n \t$this->output_image($image, $imagetype);\n }",
"function wb_create_font($name, $height, $color = null, $flags = null) {}",
"function imagepsfreefont ($fontindex) {}",
"function\nwidget_fontiles ($image_url, $image_width, $image_height, $text, $file_cols = 16, $file_rows = 16)\n{\n $char_w = $image_width / $file_cols; \n $char_h = $image_height / $file_rows;\n\n $p = '';\n for ($i = 0; $i < strlen ($text); $i++)\n {\n $c = ord ($text[$i]);\n\n $left = $c % $file_cols;\n $left *= $char_w;\n\n $top = (int) ($c / $file_rows);\n $top *= $char_h;\n\n $right = $left + $char_w;\n $bottom = $top + $char_h;\n\n $pos_left = $i * $char_w - $left;\n $pos_top = 0 - $top; \n\n $p .= '<img src=\"'.$image_url.'\" style=\"'\n .'position:absolute;'\n .'clip:rect('.$top.'px,'.$right.'px,'.$bottom.'px,'.$left.'px);'\n .'top:'.$pos_top.'px;left:'.$pos_left.'px;'\n .'width:'.$image_width.';height:'.$image_height.';'\n .'\">'.\"\\n\";\n }\n\n return $p;\n}",
"function imagepsslantfont($font_index, $slant){}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/================== If ligne_mouvement existe ===================== | public function ifLigne_mouvementexiste($id_mouvement){
$sql = "SELECT * FROM ligne_mouvement WHERE id_mouvement='".$id_mouvement."' ";
if($this->db != null)
{
if($this->db->query($sql)->fetch() != null)
{
return true;
}
}
return false;
} | [
"public function estExiste() {\n global $bdd;\n $result1 = $bdd->prepare('select nom_p from professeur where cin_p=:cin');\n $result1->execute(array('cin' => $this->getCin()));\n $don1 = $result1->fetch();\n $result1->closeCursor();\n if (!empty($don1)) {\n $this->fautes.='cin deja utiliser, ';\n return TRUE;\n }\n return FALSE;\n }",
"function libelleExisteMatiere($libelle) {\n // récupération accés base de données\n $bd = getConnexion();\n $rqt = \"SELECT id_matiere, libelle FROM matiere WHERE libelle = :libelle\";\n $stmt = $bd->prepare($rqt);\n // ajout param\n $stmt->bindParam(\":libelle\", $libelle);\n // execution requette\n $stmt->execute();\n\n // récupération resultat\n $listResult = $stmt->fetchAll();\n\n if (count($listResult) == 0) {\n return 0;\n } else {\n return $listResult[0][\"id_matiere\"];\n }\n}",
"function existe_registro_propiedad($valor, $campo) {\n\tglobal $mysqli;\n\t\n\t$sql = \"SELECT id_propiedad\n\t\t\tFROM propiedades\n\t\t\tWHERE \".$campo.\"='\".$valor.\"'\";\n\t$result = $mysqli->query($sql) or die('Error: '.$mysqli->error);\n\t\n\tif ($result->num_rows > 0) {\n\t\treturn true;\n\t} else {\n\t\treturn false;\n\t}\n}",
"function existe_nombre() {\n $this->seek_nombre();\n if ($this->feedback['code'] === '70011')\n return true;\n else return false;\n }",
"function already_exists_ens($login_recherche){\n\ttry{\n\t\t\n\t\t$row = 1;\n\t\tif (($handle = fopen(\"donnees/enseignants.csv\", \"a+\")) !== FALSE) {\n\t\t\twhile (($data = fgetcsv($handle, 1000, \",\")) !== FALSE) {\n\t\t\t\t$row++;\n\t\t\t\tif($data[0]==$login_recherche){\n\t\t\t\t\treturn 1;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tfclose($handle);\n\t\t}\n\t\t\n\t}\n\tcatch(Exception $e){\n\t\treturn \"Erreur\";\n\t}\n}",
"function msgNaoExiste() {\n if ($GLOBALS['pesquisa'] != '' and $GLOBALS['salva'] != -99 and $GLOBALS['resultados']==0 and $GLOBALS['altera'] == '') {\n echo \"<br>Não existe resultados para a pesquisa: <b>\".$GLOBALS['pesquisa'].\"</b> em <b>\";\n if ($GLOBALS['campo_pesquisa'] == 'nome') {\n echo \"nome\";\n }else if ($GLOBALS['campo_pesquisa'] == 'fone') {\n echo \"telefone\";\n }else if ($GLOBALS['campo_pesquisa'] == 'domi') {\n echo \"domínio\";\n }else if ($GLOBALS['campo_pesquisa'] == 'email') {\n echo \"e-mail\";\n }else if ($GLOBALS['campo_pesquisa'] == 'mes') {\n echo \"mês\";\n }else if ($GLOBALS['campo_pesquisa'] == 'data') {\n echo \"data\";\n }\n echo \"</b>!<br><br>\";\n }elseif (($GLOBALS['pesquisa'] == '' or $GLOBALS['pesquisa'] != '' and $GLOBALS['salva'] == -99) and $GLOBALS['resultados']==0 and $GLOBALS['altera'] == '') {\n echo \"<b style='font-size: 20px;'>Nenhum cadastro existente!</b><br>\";\n echo \"Para adicionar um cadastro pressione o botão '<i id='aviso' class='material-icons'>person_add</i>' na barra de navegação.\";\n }\n}",
"function comExiste($nombre) {\r\n\t\tglobal $tsCore, $tsUser;\r\n\t\t$dato = db_exec('fetch_assoc', db_exec(array(__FILE__, __LINE__), 'query', 'SELECT c_id, c_nombre FROM c_comunidades LEFT JOIN u_miembros ON user_id = c_autor WHERE c_nombre_corto = \\''.$tsCore->setSecure($nombre).'\\' '.($tsUser->is_admod == 1 ? '' : 'AND user_activo = \\'1\\' AND user_baneado = \\'0\\' AND c_estado = \\'0\\'').' LIMIT 1'));\r\n\t\tif($dato['c_nombre']) {\r\n\t\t\treturn $dato['c_id'];\r\n\t\t} else {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}",
"function existe_proyecto() {\n\n $this->seek_existe_proyecto();\n if ($this->feedback['code'] === '40011'){\n $this->feedback['ok'] = true;\n $this->feedback['code'] = '20034';\n return true;\n }\n return false;\n }",
"function existe_proyecto() {\n\n $this->seek_existe_proyecto();\n if ($this->feedback['code'] === '40011'){\n $this->feedback['ok'] = true;\n return true;\n }\n return false;\n }",
"public function ifType_mouvementexiste($id_service){\n\t\t\t\t\t$sql = \"SELECT * FROM type_mouvement WHERE id_service='\".$id_service.\"' \";\n\t\t\t\t\tif($this->db != null)\n\t\t\t\t\t {\n\t\t\t\t\t if($this->db->query($sql)->fetch() != null)\n\t\t\t\t\t {\n\t\t\t\t\t return true;\n\t\t\t\t\t }\n\t\t\t\t\t } \n\t\t\t\t\treturn false;\n\t\t\t\t\t }",
"function ExisteModulo($idmodu)\r\n {\r\n return $this->modelmodulos->existeNommodulo($idmodu);\r\n }",
"public function ifType_contratexiste($nom_type_contrat){\n\t\t\t\t\t$sql = \"SELECT * FROM type_contrat WHERE nom_type_contrat='\".$nom_type_contrat.\"' \";\n\t\t\t\t\tif($this->db != null)\n\t\t\t\t\t {\n\t\t\t\t\t if($this->db->query($sql)->fetch() != null)\n\t\t\t\t\t {\n\t\t\t\t\t return true;\n\t\t\t\t\t }\n\t\t\t\t\t } \n\t\t\t\t\treturn false;\n\t\t\t\t\t }",
"function existMco_inventario($INV_ID)\n {\n $sql = \"SELECT * FROM mco_inventario WHERE INV_ID=$INV_ID\";\n $this->consult = $this->connection->Execute($sql);\n if ($this->consult->fields)\n return 1;\n}",
"public function verificaExisteCCmodificard($datos){\n\t\t$existe=0;\n\t\t/*echo \"aquii\";\n\t\t var_dump ($datos);\n\t\techo \"fin datos\";*/\n\t\tif ($datos['C4P43_TIPO_DOC']==5)\n\t\t{\n\t\t\t$existe=0;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$sqlver =\"SELECT * FROM CNPV_PERSONA_HOGAR\n\t\t\t\t\t WHERE C4P43_TIPO_DOC='\".$datos['C4P43_TIPO_DOC'].\"' AND C4P44_NRO_DOC='\".$datos['C4P44_NRO_DOC'].\"' and C4P41_NRO_PER!='\".$datos['id'].\"'\";\n\t\t\t$query = $this->db->query($sqlver);\n\t\t\tif ($query->num_rows() > 0){\n\t\t\t\t$existe=1;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$existe=0;\n\t\t\t}\n\t\t}\n\t\t$this->db->close();\n\t\treturn $existe;\n\t}",
"public function check_numEleveur_exists($numEleveur){\r\n\t\t\t$this->form_validation->set_message('check_numEleveur_exists', 'Un compte avec cet identifiant professionel existe dejà !');\r\n\t\t\tif($this->utilisateurs_model->check_numEleveur_exists($numEleveur)){\r\n\t\t\t\treturn true;\r\n\t\t\t} else {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n }",
"function checkIfFraisExist($conn, $userId, $date)\n{\n $requetePrepare = $conn->prepare(\n 'SELECT fichefrais.idvisiteur, fichefrais.mois '\n . 'FROM fichefrais '\n . 'WHERE fichefrais.idvisiteur = :unIdVisiteur AND fichefrais.mois = :unMois'\n );\n $requetePrepare->bindParam(':unIdVisiteur', $userId, PDO::PARAM_STR);\n $requetePrepare->bindParam(':unMois', $date, PDO::PARAM_STR);\n $requetePrepare->execute();\n $nb_result = $requetePrepare->rowCount();\n if ($nb_result > 0) { \n return true;\n }\n return false;\n}",
"function checarLexicoExistente($projeto, $nome) {\r\n $naoexiste = false;\r\n\r\n $r = bd_connect() or die(\"Erro ao conectar ao SGBD<br>\" . mysql_error() . \"<br>\" . __FILE__ . __LINE__);\r\n $q = \"SELECT * FROM lexico WHERE id_projeto = $projeto AND nome = '$nome' \";\r\n $qr = mysql_query($q) or die(\"Erro ao enviar a query de select no lexico<br>\" . mysql_error() . \"<br>\" . __FILE__ . __LINE__);\r\n $resultArray = mysql_fetch_array($qr);\r\n if ($resultArray == false) {\r\n $naoexiste = true;\r\n }\r\n\r\n $q = \"SELECT * FROM sinonimo WHERE id_projeto = $projeto AND nome = '$nome' \";\r\n $qr = mysql_query($q) or die(\"Erro ao enviar a query de select no lexico<br>\" . mysql_error() . \"<br>\" . __FILE__ . __LINE__);\r\n $resultArray = mysql_fetch_array($qr);\r\n\r\n if ($resultArray != false) {\r\n $naoexiste = false;\r\n }\r\n\r\n return $naoexiste;\r\n}",
"public function ifV_familleexiste($id){\n\t\t\t\t\t$sql = \"SELECT * FROM v_famille WHERE id='\".$id.\"' \";\n\t\t\t\t\tif($this->db != null)\n\t\t\t\t\t {\n\t\t\t\t\t if($this->db->query($sql)->fetch() != null)\n\t\t\t\t\t {\n\t\t\t\t\t return true;\n\t\t\t\t\t }\n\t\t\t\t\t } \n\t\t\t\t\treturn false;\n\t\t\t\t\t }",
"private function _checkOpenMesa(){\n $db = new SuperDataBase();\n $query_abierto = \"Select * from pedido where pkMesa = '\".$_REQUEST[\"mesa\"].\"' AND estado = '0' order by pkPediido DESC LIMIT 1\";\n $r_abierto = $db->executeQuery($query_abierto);\n if($row_a = $db->fecth_array($r_abierto)){\n //Porciacaso mantenemos estado de mesa\n \n $resultado = array();\n $resultado[\"estado\"] = 1;\n $resultado[\"moso\"] = $row_a[\"idUser\"];\n echo json_encode($resultado);\n }else{\n $resultado = array();\n $resultado[\"estado\"] = 0;\n echo json_encode($resultado);\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get an array of Player Versions. | public function get(array $params = [])
{
$this->getLogger()->info('Getting list of Player Versions ');
$entries = [];
$response = $this->doGet('/playersoftware', $params);
foreach ($response as $item) {
$entries[] = clone $this->hydrate($item);
}
return $entries;
} | [
"public function getVersions(): array\n {\n return $this->client->getGameVersions($this->game->getId());\n }",
"public function getVersions();",
"public function getVersions() {\n DB_DAO::connectDatabase();\n $handler = DB_DAO::getDB()->prepare(\"SELECT version, id, isObsolete FROM version ORDER BY version DESC LIMIT 0,100\");\n\n if (!$handler->execute()) {\n DB_DAO::throwDbError($handler->errorInfo());\n }\n $data = array();\n $it = 0;\n while ($row = $handler->fetch(PDO::FETCH_ASSOC)) {\n $data[$it] = new Version($row['id'], $row['version'], $row['isObsolete']);\n $it++;\n }\n return $data;\n }",
"public function getVersions() {}",
"public function getVersions()\n {\n return $this->versions;\n }",
"public function getVersions()\n {\n return $this->getAdapter()->getVersions();\n }",
"public function get_versions()\n {\n $sql = \"SELECT `name`, `version` FROM `versions`;\";\n $query = $this->db->query($sql);\n\n return $query->result();\n }",
"public function getVersions () {\r\n\t$this->ensureLoggedIn();\r\n\r\n\treturn $this->request(array('req' => 'getversions'));\r\n\t}",
"private function getVersions()\n {\n $cachedVersions = $this->getCachedVersions();\n if (!isset($cachedVersions['versions'])) {\n return $this->versions;\n }\n\n return $cachedVersions['versions'];\n }",
"public function get_versions()\n {\n $cards = $this->entityManager->getRepository(Card::class)->findAll();\n\n $versions = [];\n foreach ($cards as $card) {\n $versions[$card->getTitle()][] = $card;\n }\n\n return $versions;\n }",
"public static function get_versions()\n\t{\n\t\t$result = array();\n\n\t\t$modules = Module_Manager::get_modules(false);\n\t\tforeach ($modules as $module)\n\t\t{\n\t\t\t$module_id = $module->get_module_info()->id;\n\t\t\t$version = self::get_db_version($module_id);\n\t\t\t$result[$module_id] = $version;\n\t\t}\n\n\t\treturn $result;\n\t}",
"private function queryVersions()\n {\n static $versions;\n if (is_array($versions)) {\n return $versions;\n }\n\n $this->write('Retrieving WordPress versions info...');\n $content = $this->remoteFilesystem->getContents('wordpress.org', self::RELEASES_URL, false);\n $code = $this->remoteFilesystem->findStatusCode($this->remoteFilesystem->getLastHeaders());\n if ($code !== 200) {\n return [];\n }\n\n $extractVer = function ($package) {\n if (!is_array($package) || empty($package['version'])) {\n return '';\n }\n\n return $this->normalizeVersionWp($package['version']);\n };\n\n try {\n $data = @json_decode($content, true);\n if (!$data || !is_array($data) || empty($data['offers'])) {\n return [];\n }\n\n $parsed = array_unique(array_filter(array_map($extractVer, (array)$data['offers'])));\n $versions = $parsed ? Semver::rsort($parsed) : [];\n\n return $versions;\n } catch (\\Exception $e) {\n return [];\n }\n }",
"protected function getVersions() {\n\t\t$versions = array();\n\t\t$directory = new DirectoryIterator(t3lib_extMgm::extPath('extjs', 'versions'));\n\n\t\tforeach ($directory as $entry) {\n\t\t\tif ($entry->isDir() && !$entry->isDot() && is_numeric(substr($entry->getFilename(), 0, 1))) {\n\t\t\t\t$versions[] = $entry->getFilename();\n\t\t\t}\n\t\t}\n\n\t\tsort($versions);\n\t\treturn $versions;\n\t}",
"public function getAvailableVersions()\n {\n return array($this->getCurrentVersion());\n }",
"private function getTableVersions(){\n\t\t// Needs a new class for default connection\n\t\t$Database = new \\Database();\n\t\t\n\t\t// Grab all table versions\n\t\tif($Database->Q(array(\n\t\t\t'assoc' => array('connection','title'),\n\t\t\t'query' => 'SELECT title,connection,version FROM fks_versions'\n\t\t))) {\n\t\t\treturn $Database->r['rows'];\n\t\t} else {\n\t\t\treturn array();\n\t\t}\n\t}",
"public function versions()\n {\n return $this->morphMany( $this->getVersionClass(), 'versionable');\n }",
"public function getAvailableVersions()\n {\n return $this->available_versions;\n }",
"public function versions()\n\n {\n\n\n try {\n\n $versions = Version::where('content_name', $this->getAttributeValue('name'))->get();\n\n foreach ($versions as $version) {\n\n $version->data = json_decode($version->getAttributeValue('data'), true);\n\n }\n\n return $versions;\n\n } catch (\\Exception $e) {\n\n echo $e; die;\n\n }\n\n\n }",
"public function appVersions()\n {\n if(empty($this->_publicPropertyArray['app_versions']))\n return array();\n else\n return $this->_publicPropertyArray['app_versions'];\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Method to set the value of field range_name | public function setRangeName($range_name)
{
$this->range_name = $range_name;
return $this;
} | [
"public function setRangeName($rangeName) {\n $this->rangeName = $rangeName;\n }",
"function SetRange($range){}",
"public function setRange($range) {\n $this->range = $range;\n }",
"public function setNamedRange($name, $row_from, $column_from, $row_to, $column_to) {\n\t}",
"public function getRangeName()\n {\n return $this->range_name;\n }",
"public function setRangeValue($section, $name, array $range)\n {\n return $this->setValue($section, $name, array_shift($range) . '..' . array_pop($range));\n }",
"public function setRangeValue(string $section, string $name, array $range): self\n {\n return $this->setValue($section, $name, array_shift($range) . '..' . array_pop($range));\n }",
"function SetRange($minVal, $maxVal){}",
"public function setRange($filterName, $from=null, $to=null){\n if(!$this->optionExists('filter')){\n $this->search_options['filter'] = array($filterName=>array());\n }\n if(!isset($this->search_options['filter'][$filterName]))\n {\n $this->search_options['filter'][$filterName] = array();\n }\n if($from)\n {\n $this->search_options['filter'][$filterName]['from'] = $from;\n }\n if($to)\n {\n $this->search_options['filter'][$filterName]['to'] = $from;\n }\n }",
"public static function define_range() {\n\t\t\tif (!isset($_GET['range'])) {\n\t\t\t\tself::$range = 90;\n\t\t\t} else {\n\t\t\t\tself::$range = $_GET['range'];\n\t\t\t}\n\t\t}",
"function SetRange($minValue, $maxValue){}",
"public function setRangeQuery(?CatalogQueryRange $rangeQuery): void\n {\n $this->rangeQuery = $rangeQuery;\n }",
"private function select_range($name, $label, $value, $range, $format = null)\n {\n echo $this->get_select_range($name, $label, $value, $range, $format);\n }",
"public static function setRangeVars($rangeVars){\n\t\tself::$rangeVars=$rangeVars;\n\t}",
"function setIPRange($ipRange) {\n\t\treturn $this->setData('ipRange', $ipRange);\n\t}",
"function setRange($minvalue, $maxvalue)\n {\n $this->m_minvalue = $minvalue;\n $this->m_maxvalue = $maxvalue;\n }",
"public function massChangeRangeAction()\n {\n $range = (int) $this->getRequest()->getParam('ranges');\n $this->_massUpdate('featured_range',$range);\n\n }",
"public function setRangeTypeName($rangeTypeName)\n {\n $this->rangeTypeName = $rangeTypeName;\n return $this;\n }",
"public function range() {\n\t\t$html = $this->initial;\n\t\t$html .= '<input name=\"'.$this->value['id'].'\" type=\"range\" min=\"'.$this->value['min'].'\" max=\"'.$this->value['max'].'\" value=\"';\n\t\tif ($this->meta != \"\")\n\t\t\t$html .= $this->meta;\n\t\t$html .= '\" placeholder=\"'.$this->value['std'].'\" ';\n\t\tif(isset($this->value['required']))\n\t\t\t$html .= 'required data-required=\"true\"';\n\t\t$html .= ' />';\n\t\t$html .= $this->finish;\n\t\techo $html;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns information about the slots (total, used, remaining) | function getSlotsInformation(){
$dbConnection = getDatabaseConnection();
// initialization
$totalSlots = 0;
$usedSlots = 0;
$remainingSlots = 0;
// get total slots
$sql = "SELECT total_slots FROM `foire_vetements_meta`";
$result = null;
if(!$result = $dbConnection->query($sql)){
throw new Exception("There was an error running the query. Error: ".$dbConnection->error);
}
while($row = $result->fetch_assoc()){
$totalSlots = $row['total_slots'];
}
$result->free();
// get used slots (i.e., slots reserved by people who have confirmed and are not on the wait list)
$sql = "SELECT SUM(slots) as 'sum' FROM `foire_vetements` WHERE confirmed = 1 AND on_wait_list = 0 AND validated = 1";
$result = null;
if(!$result = $dbConnection->query($sql)){
throw new Exception("There was an error running the query: ".$dbConnection->error);
}
while($row = $result->fetch_assoc()){
$usedSlots = $row["sum"];
}
$result->free();
// make sure that we define a value
if($usedSlots === null || $usedSlots === ""){
$usedSlots = 0;
}
// calculate the remaining slots
$remainingSlots = $totalSlots - $usedSlots;
// create the return object
$retVal = array(
"totalSlots" => $totalSlots,
"usedSlots" => $usedSlots,
"remainingSlots" => $remainingSlots
);
return $retVal;
} | [
"public function getUsedSlots()\n {\n if (isset(self::$_used['tot'])) {\n return (int)self::$_used['tot'];\n }\n return (int)self::$_used['tot'] = self::getClass('TaskManager')\n ->count(\n array(\n 'stateID' => self::getProgressState(),\n 'storagenodeID' => $this->get('enablednodes'),\n 'typeID' => $this->get('usedtasks'),\n )\n );\n }",
"public function getSlots()\n {\n return $this->slots;\n }",
"public function getTotalSlotMs()\n {\n return $this->total_slot_ms;\n }",
"public function getFreeSlots() {\n\n // Count number of free slots.\n $jobs = $this->getRunningJobs();\n $running = count($jobs);\n $num_slots = $this->max_slots - $running;\n if ($num_slots < 0) {\n $num_slots = 0;\n }\n return $num_slots;\n }",
"static function getAllSlots()\n\t{\n\t\treturn self::$slots;\n\t}",
"public function occupiedSlotsCount()\n {\n return $this->model->where('free', 0)->with('vehicle','vehicle.vehicle_type')->get()->sum('vehicle.vehicle_type.slots');\n }",
"public function getSlotCount()\n {\n return $this->slot_count;\n }",
"public function getQueuedSlots()\n {\n if (isset(self::$_queued['tot'])) {\n return (int)self::$_queued['tot'];\n }\n return (int)self::$_queued['tot'] = self::getClass('TaskManager')\n ->count(\n array(\n 'stateID' => self::getQueuedStates(),\n 'storagenodeID' => $this->get('enablednodes'),\n 'typeID' => $this->get('usedtasks'),\n )\n );\n }",
"public function getSlots() :array\n {\n return $this->slots;\n }",
"public function getBusySlotCount()\n\t{\n\t\treturn self::calculateBusySlots(self::TYPE_NAME);\n\t}",
"public function getSlots()\n {\n return array_keys($this->slot);\n }",
"public function getSpaceInfo()\n {\n $box = $this->_getBox();\n $info = $box->getSpaceUsage();\n $usedSpace = intval($info[\"used\"]);\n $availSpace = intval($info[\"allocation\"][\"allocated\"]);\n\n return [$usedSpace, $availSpace];\n }",
"public function getMaxSlots() {\n return $this->max_slots;\n }",
"public function getSlot();",
"public function getSlot()\n {\n return $this->slot;\n }",
"public function getMaxSlots()\n {\n return $this->max_slots;\n }",
"public function getSlot() {\n return $this->slot;\n }",
"public function getMissingSlots() {\n $required = $this->getRequiredSlots();\n $model = Model::getInstance();\n $doneyet = count($this->getAssignedSlots());\n \n return $required - $doneyet;\n }",
"public function getModulesSlots()\n {\n return $this->getValue('nb_site_modules_slots');\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
wp_get_post_revisions() Returns all revisions of specified post | function wp_get_post_revisions( $post_id = 0, $args = null ) {
if ( !constant('WP_POST_REVISIONS') )
return array();
if ( ( !$post = get_post( $post_id ) ) || empty( $post->ID ) )
return array();
$defaults = array( 'order' => 'DESC', 'orderby' => 'date' );
$args = wp_parse_args( $args, $defaults );
$args = array_merge( $args, array( 'post_parent' => $post->ID, 'post_type' => 'revision', 'post_status' => 'inherit' ) );
if ( !$revisions = get_children( $args ) )
return array();
return $revisions;
} | [
"public static function get_all_revisions() {\n\t\t$post = self::get_post();\n\n\t\tif ( ! $post ) {\n\t\t\treturn array();\n\t\t}\n\n\t\t$revisions = wp_get_post_revisions( $post->ID, array(\n\t\t\t'posts_per_page' => -1,\n\t\t\t'orderby' => 'date',\n\t\t\t'order' => 'DESC',\n\t\t) );\n\n\t\treturn $revisions;\n\t}",
"function tve_get_post_revisions( $post = null ) {\n\n\t$post_id = ( $post instanceof WP_Post ) ? $post->ID : intval( $post );\n\n\t$revisions = wp_get_post_revisions( $post_id );\n\t$return = [];\n\n\tforeach ( $revisions as $revision ) {\n\t\t$modified = strtotime( $revision->post_modified );\n\t\t$modified_gmt = strtotime( $revision->post_modified_gmt );\n\t\t$now_gmt = time();\n\t\t$restore_link = str_replace( '&', '&', wp_nonce_url(\n\t\t\tadd_query_arg(\n\t\t\t\tarray(\n\t\t\t\t\t'revision' => $revision->ID,\n\t\t\t\t\t'action' => 'restore',\n\t\t\t\t),\n\t\t\t\tadmin_url( 'revision.php' )\n\t\t\t),\n\t\t\t\"restore-post_{$revision->ID}\"\n\t\t) );\n\t\t$show_avatars = get_option( 'show_avatars' );\n\t\t$authors[ $revision->post_author ] = array(\n\t\t\t'id' => (int) $revision->post_author,\n\t\t\t'avatar' => $show_avatars ? get_avatar( $revision->post_author, 64 ) : '',\n\t\t\t'name' => get_the_author_meta( 'display_name', $revision->post_author ),\n\t\t);\n\t\t$autosave = (bool) wp_is_post_autosave( $revision );\n\t\t$return[] = array(\n\t\t\t'id' => $revision->ID,\n\t\t\t'title' => get_the_title( $post_id ),\n\t\t\t'author' => $authors[ $revision->post_author ],\n\t\t\t'date' => date_i18n( __( 'M j, Y @ G:i' ), $modified ),\n\t\t\t'dateShort' => date_i18n( _x( 'j M Y,G:i', 'revision date short format' ), $modified ),\n\t\t\t'timeAgo' => sprintf( __( '%s ago', 'thrive-cb' ), human_time_diff( $modified_gmt, $now_gmt ) ),\n\t\t\t'autosave' => $autosave,\n\t\t\t'restoreUrl' => $restore_link,\n\t\t);\n\t}\n\n\treturn $return;\n\n}",
"public function getRevisions()\n {\n return $this->revisions;\n }",
"public function getRevisions();",
"function wp_get_post_revisions_url($post = 0)\n {\n }",
"function admin_action_get_revisions_list() {\r\n\t\tif ( ! isset( $_GET['_wpnonce'] ) || ! wp_verify_nonce( $_GET['_wpnonce'], 'get_revisions_list' ) ) {\r\n\t\t\twp_die(\r\n\t\t\t\t__( 'The supplied nonce is invalid.', 'siteorigin-panels' ),\r\n\t\t\t\t__( 'Invalid nonce.', 'siteorigin-panels' ),\r\n\t\t\t\t403\r\n\t\t\t);\r\n\t\t}\r\n\t\t\r\n\t\t$post_id = filter_input( INPUT_GET, 'postId', FILTER_VALIDATE_INT );\r\n\t\t\r\n\t\t$this->custom_css_revisions_list( $this->theme, $post_id );\r\n\t\t\r\n\t\twp_die();\r\n\t}",
"function wp_list_post_revisions( $post_id = 0, $type = 'all' ) {\n\tif ( ! $post = get_post( $post_id ) )\n\t\treturn;\n\n\t// $args array with (parent, format, right, left, type) deprecated since 3.6\n\tif ( is_array( $type ) ) {\n\t\t$type = ! empty( $type['type'] ) ? $type['type'] : $type;\n\t\t_deprecated_argument( __FUNCTION__, '3.6.0' );\n\t}\n\n\tif ( ! $revisions = wp_get_post_revisions( $post->ID ) )\n\t\treturn;\n\n\t$rows = '';\n\tforeach ( $revisions as $revision ) {\n\t\tif ( ! current_user_can( 'read_post', $revision->ID ) )\n\t\t\tcontinue;\n\n\t\t$is_autosave = wp_is_post_autosave( $revision );\n\t\tif ( ( 'revision' === $type && $is_autosave ) || ( 'autosave' === $type && ! $is_autosave ) )\n\t\t\tcontinue;\n\n\t\t$rows .= \"\\t<li>\" . wp_post_revision_title_expanded( $revision ) . \"</li>\\n\";\n\t}\n\n\techo \"<div class='hide-if-js'><p>\" . __( 'JavaScript must be enabled to use this feature.' ) . \"</p></div>\\n\";\n\n\techo \"<ul class='post-revisions hide-if-no-js'>\\n\";\n\techo $rows;\n\techo \"</ul>\";\n}",
"function wp_get_post_revision(&$post, $output = \\OBJECT, $filter = 'raw')\n {\n }",
"public function allRevisions()\n {\n return $this->hasMany('ArticleRevision', 'article_id');\n }",
"public function revisions()\n {\n return $this->morphMany(Revision::class, 'revisions');\n }",
"public function getRevisions()\n\t{\n\t\treturn $this->revision->history;\n\t}",
"function getAllRevisions($id) {\n $sql = sprintf('SELECT * FROM plugin_phpwiki_attachment_revision'\n .' WHERE attachment_id=%d'\n .' ORDER BY date DESC',\n $id);\n \n return $this->retrieve($sql); \n }",
"public static function clear_post_revisions() {\n\t\treturn self::remove_from_wp_posts('post_type', 'revision');\n\t}",
"public function getRevisions()\n {\n return $this->hasMany(self::className(), ['revision_to' => 'id'])\n ->orderBy('id DESC');\n }",
"function _wp_post_revision_data( $post = array(), $autosave = false ) {\n\tif ( ! is_array( $post ) ) {\n\t\t$post = get_post( $post, ARRAY_A );\n\t}\n\n\t$fields = _wp_post_revision_fields( $post );\n\n\t$revision_data = array();\n\n\tforeach ( array_intersect( array_keys( $post ), array_keys( $fields ) ) as $field ) {\n\t\t$revision_data[ $field ] = $post[ $field ];\n\t}\n\n\t$revision_data['post_parent'] = $post['ID'];\n\t$revision_data['post_status'] = 'inherit';\n\t$revision_data['post_type'] = 'revision';\n\t$revision_data['post_name'] = $autosave ? \"$post[ID]-autosave-v1\" : \"$post[ID]-revision-v1\"; // \"1\" is the revisioning system version\n\t$revision_data['post_date'] = isset( $post['post_modified'] ) ? $post['post_modified'] : '';\n\t$revision_data['post_date_gmt'] = isset( $post['post_modified_gmt'] ) ? $post['post_modified_gmt'] : '';\n\n\treturn $revision_data;\n}",
"function acf_get_post_latest_revision($post_id) {}",
"public function revision()\n {\n return $this->hasMany('LaraPress\\Database\\Post', 'post_parent')->where('post_type', 'revision');\n }",
"function wp_revisions_enabled($post)\n{\n}",
"function wp_revisions_enabled($post)\n {\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Retrieve a member's cba commissions total | public function cbaCommissionTotal($member_id)
{
return $this->getMemberCbaCommissionTotal($member_id);
} | [
"function getMemberCommission(){\n\t\t$total_commission = 0;\n\t\t\n\t\t$re = $this->db->query(\"select commission_monthly_items.commission,order_detais.id,order_detais.itemid,order_detais.itemprice,order_detais.quality from commission_monthly_items join order_detais on order_detais.id = commission_monthly_items.odetail where commission_monthly_items.status = 1 and commission_monthly_items.oid = \".$this->oid);\t\t\n\t\tif ($re->num_rows() > 0){\n\t\t\tforeach($re ->result_array() as $row){\n\t\t\t\t$qty_refund = $this->database->db_result(\"select sum(qty) from odetail_return where odetail = \".$row['id'].\" and status = 1\", 0);\t\n\t\t\t\t$qty_buy = (int)$row['quality'] - $qty_refund;\n\t\t\t\tif($qty_buy < 0) $qty_buy = 0;\n\t\t\t\t$itemprice = round((float)$row[\"itemprice\"]*$qty_buy, 2);\n\t\t\t\t$total_commission += round((float)$row['commission'] * $itemprice / 100, 2);\n\t\t\t}\t\n\t\t}\n\t\t//echo $total_commission.\"<br>\";\n\t\treturn $total_commission;\t\n\t}",
"public function getSalespersonMemberCbaCommissionTotal($member_id, $date = false)\n\t{\n\t\t$query = LedgerDetails::whereIn('account_code', ['4090'])\n\t\t\t->where('member_id', $member_id);\n\t\t\t\n\n\t\tif ($date)\n\t\t\t$query = $query->where('created_at', '<=', $date);\n\t\t\n\t\treturn (int) $query->sum('amount');\t\n\t}",
"public function totalColecao(){\r\n $oRhCargoComissaoBD = new RhCargoComissaoBD();\r\n return $oRhCargoComissaoBD->totalColecao();\r\n }",
"public function creditAvailed(){\n\t\t$memberId = $this->owner->ID;\n\t\treturn DB::query(\"SELECT SUM(Credit) FROM Payment where MemberID = $memberId\")->value();\n\t}",
"public function totalColecao(){\r\n\t\t$oSicasEncaminhamentoBD = new SicasEncaminhamentoBD();\r\n\t\treturn $oSicasEncaminhamentoBD->totalColecao();\r\n\t}",
"public function getTotal_commission()\n {\n return $this->total_commission;\n }",
"function getTotalPurchasesForMemberWithCredits($memberId) {\n\n\t\t$sql =\"SELECT sum(net_total) as total from \" . $this->mTable . \" where member_id = :member_id and used_credits=1\";\n\n\t\t$this->mDb->query($sql);\n\n\t\t$this->mDb->bind(\":member_id\", $memberId);\n\n\t\t$row = $this->mDb->single();\n\t\t\n\t\t$this->mError = $this->mDb->getLastError();\n\t\t\n\t\treturn $row;\n\n\t}",
"public function totalColecao(){\r\n\t\t$oSicasProcedimentoBD = new SicasProcedimentoBD();\r\n\t\treturn $oSicasProcedimentoBD->totalColecao();\r\n\t}",
"public function totalColecao(){\r\n $oSicasEspecialidadeMedicaBD = new SicasEspecialidadeMedicaBD();\r\n return $oSicasEspecialidadeMedicaBD->totalColecao();\r\n }",
"public function totalColecao(){\r\n\t\t$oSicasConsultaMedicaCidBD = new SicasConsultaMedicaCidBD();\r\n\t\treturn $oSicasConsultaMedicaCidBD->totalColecao();\r\n\t}",
"public function getCreditMemosTotal()\n {\n $total = 0;\n $creditMemos = $this->order->getCreditmemosCollection();\n if (!empty($creditMemos)) {\n foreach ($creditMemos as $creditMemo) {\n $total += $creditMemo->getGrandTotal();\n }\n }\n\n return $total;\n }",
"function get_all_my_autocbi_total($id_member){\n if ( !is_numeric($id_member) ) return false;\n\n $id_member = absint($id_member);\n if ( !$id_member ) return false;\n \n $sql = 'SELECT SUM(amount) AS total FROM '.$this->autocbi_fees.' WHERE id_member=?';\n $query = $this->db->query($sql, array($id_member));\n \n if ( !$query || !$query->num_rows() )\n return 0;\n \n return absint($query->row()->total);\n }",
"public function sumOfContribution($member_id){\n\n \t $stmt = $this->conn->prepare(\"SELECT SUM(amount_credited) AS sumOfAmount FROM member_account WHERE member_id = '$member_id'\");\n $stmt->execute();\n $sum = $stmt->fetch(PDO::FETCH_ASSOC);\n return $sum['sumOfAmount'];\n\n }",
"function getCreditosComprometidos(){ return $this->getOEstats()->getTotalCreditosSaldo(); }",
"public function get_totalMonto_conceptos_por_caja(){\n\t\t\t\n\t\t\t$record = $this->find_all_by_sql(\"SELECT SUM(ct.monto_total) AS montoCaja\n\t\t\t FROM caja_tramites ct\n\t\t\t\t\t\t\t\t\t\t\t JOIN caja_conceptos cc ON cc.id = ct.concepto\n\t\t\t\t\t\t\t\t\t\t\t WHERE cc.tipo_tramite = 0\");\n\t\t\t\t\t\t\t\t\t\t\t\t \n\t\t\treturn $record;\t\t\n\t\t}",
"public function getTotalPerCustomer () {\n\t$preValue = $this->preGetValue(\"totalPerCustomer\"); \n\tif($preValue !== null && !\\Pimcore::inAdmin()) { \n\t\treturn $preValue;\n\t}\n\t$data = $this->totalPerCustomer;\n\treturn $data;\n}",
"public function getTotalFreeMembers(){\n \n try {\n $select = $this->select()\n ->from($this,array(\"freetotal\"=>\"COUNT(user_id)\"))\n ->where('customer_status = ?',3)\n ->where('customer_status = ?',2)\n ->where('customer_status = ?',9);\n $result = $this->getAdapter()->fetchRow($select);\n \n \n \n if ($result){\n return $result;\n }\n } catch (Exception $exc) {\n echo $exc->getTraceAsString();\n } \n \n \n \n }",
"public function getTotalCommodityAmount() {\n return $this->totalCommodityAmount;\n }",
"public static function totalBalance()\n\t{\n\t\t$IDuser=Yii::$app->user->getId();\n\t\t//find all where money is transferred\n\t\t$query=AccountBalance::find()\n\t\t->with([\"relationIDauction.relationIDcurrency\"])\n\t\t->where(['money_transferred'=>1, 'IDuser'=>$IDuser])\n\t\t->all();\n\t\t\n\t\t$total=[];\n\t\tforeach($query as $key=>$value)\n\t\t{\n\t\t\t$currency=$value->relationIDauction->relationIDcurrency->currency;\n\t\t\t$price=self::currentBalance($value->IDauction, \"final\");\n\n\t\t\t//if array with specific currency as key is empty, set it to 0;\n\t\t\t//create array for specific currency so you can caluclate price for that currency\n\t\t\tif(empty($total[$currency]))\n\t\t\t\t$total[$currency]=0;\n\t\t\t\t\n\t\t\t$total[$currency]=$total[$currency]+$price;\t\n\t\t}\n\t\t\n\t\tforeach($total as $key=>$value)\n\t\t{\n\t\t\techo '\n\t\t\t\t<div class=\"widget-stats\">\n\t\t\t\t\t<div class=\"wrapper transparent\"> \n\t\t\t\t\t\t<span class=\"item-title\">'.$key.'</span> \n\t\t\t\t\t\t<span class=\"item-count animate-number semi-bold\" data-value=\"'.$value.'\" data-animation-duration=\"700\">'.$value.'</span> \n\t\t\t\t\t</div>\n\t\t\t\t</div>';\n\t\t\t\t\n\t\t}\n\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return an instance of the ClientGrants class. | public function clientGrants() : ClientGrants
{
if (! $this->clientGrants instanceof ClientGrants) {
$this->clientGrants = new ClientGrants($this->apiClient);
}
return $this->clientGrants;
} | [
"public function getGrants();",
"function merchants() {\n \t\tif (is_object($this->_merchantsInst))\n \t\t\treturn $this->_merchantsInst;\n \t\t$this->_loadClass('Merchants');\n \t\t$this->_merchantsInst = new PraizedMerchants($this->_community, $this->_apiKey, $this->_oAuthInst);\n \t\tif ( isset($this->_merchantsInst->errors) )\n \t\t $this->errors = $this->_merchantsInst->errors;\n \t\treturn $this->_merchantsInst;\n \t}",
"private function getClient()\n {\n return app(Environment::class)->tenant()?\n PassportClient::firstWhere('password_client', PassportGrantTypes::PASSWORD_GRANT):\n Client::firstWhere('password_client', PassportGrantTypes::PASSWORD_GRANT);\n }",
"public function getGrants() {\n\t\t\treturn $this->acl['Grants'];\n\t\t}",
"public function getPasswordGrantClient()\n {\n return $this->clients->where('password_client', true)->first();\n }",
"public function areClientsLimitedToGrants()\n {\n return $this->limitClientsToGrants;\n }",
"public static function client()\n {\n return new static::$clientModel;\n }",
"public function createPasswordGrantClient()\n {\n $clients = app()->make(\\Laravel\\Passport\\ClientRepository::class);\n $client = $clients->createPersonalAccessClient(null, 'test-client', 'http://localhost');\n\n $accessClient = new \\Laravel\\Passport\\PersonalAccessClient();\n $accessClient->client_id = $client->id;\n $accessClient->save();\n\n return $accessClient;\n }",
"function getGrants(&$dbHandler)\r\n{\r\n $grants=new stdClass();\r\n $grants->requirement_mgmt=has_rights($dbHandler,\"mgt_modify_req\"); \r\n return $grants;\r\n}",
"public function getMerchants()\n {\n $body = [\n 'referenceNumber' => request()->reference,\n ];\n\n $hash = createHash($this->apiKey, $body);\n\n $endpoint = 'paga-webservices/business-rest/secured/getMerchants';\n\n return $this->setRequestService($hash)\n ->makeHttpRequest('POST', $endpoint, $body);\n }",
"public function getSettings()\n {\n return new ClientSettings($this->settings);\n }",
"public function getAdminClient()\n {\n $systemClientConfig = $this->getSystemConfig()->getClient(true);\n $defaultClientClass = $systemClientConfig->getClass();\n\n if (null === $this->adminClient) {\n $this->adminClient = new $defaultClientClass($this, $systemClientConfig);\n $this->adminClient->start();\n if (null === $this->client) {\n $this->client = $this->adminClient;\n }\n }\n\n return $this->adminClient;\n }",
"public static function getAllGrants()\n {\n $allGrants = array(\n self::GRANT_READ,\n self::GRANT_ADD,\n self::GRANT_EDIT,\n self::GRANT_DELETE,\n EventPersonalGrants::GRANT_PRIVATE,\n self::GRANT_EXPORT,\n self::GRANT_SYNC,\n self::GRANT_ADMIN,\n EventPersonalGrants::GRANT_FREEBUSY,\n self::GRANT_DOWNLOAD,\n self::GRANT_PUBLISH,\n );\n \n return $allGrants;\n }",
"public static function getTenant()\n {\n return Tenant::get();\n }",
"public function testSetGrants()\n {\n $newGrants = new Tinebase_Record_RecordSet('Tinebase_Model_Grants');\n $newGrants->addRecord(\n new Tinebase_Model_Grants(array(\n 'account_id' => Tinebase_Core::getUser()->getId(),\n 'account_type' => 'user',\n Tinebase_Model_Grants::GRANT_READ => true,\n Tinebase_Model_Grants::GRANT_ADD => false,\n Tinebase_Model_Grants::GRANT_EDIT => true,\n Tinebase_Model_Grants::GRANT_DELETE => true,\n Tinebase_Model_Grants::GRANT_ADMIN => true\n ))\n );\n \n // get group and add grants for it\n $lists = Addressbook_Controller_List::getInstance()->search(new Addressbook_Model_ListFilter());\n $groupToAdd = $lists->getFirstRecord();\n $newGrants->addRecord(\n new Tinebase_Model_Grants(array(\n 'account_id' => $groupToAdd->group_id,\n 'account_type' => 'group',\n Tinebase_Model_Grants::GRANT_READ => true,\n Tinebase_Model_Grants::GRANT_ADD => false,\n Tinebase_Model_Grants::GRANT_EDIT => false,\n Tinebase_Model_Grants::GRANT_DELETE => false,\n Tinebase_Model_Grants::GRANT_ADMIN => false\n ))\n );\n \n $grants = $this->_instance->setGrants($this->objects['initialContainer'], $newGrants);\n $this->assertEquals('Tinebase_Record_RecordSet', get_class($grants), 'wrong type');\n $this->assertEquals(2, count($grants));\n\n $grants = $grants->toArray();\n foreach ($grants as $grant) {\n if ($grant['account_id'] === Tinebase_Core::getUser()->getId()) {\n $this->assertTrue($grant[\"readGrant\"], print_r($grant, TRUE));\n $this->assertFalse($grant[\"addGrant\"], print_r($grant, TRUE));\n $this->assertTrue($grant[\"editGrant\"], print_r($grant, TRUE));\n $this->assertTrue($grant[\"deleteGrant\"], print_r($grant, TRUE));\n $this->assertTrue($grant[\"adminGrant\"], print_r($grant, TRUE));\n $this->assertEquals(Tinebase_Acl_Rights::ACCOUNT_TYPE_USER, $grant['account_type']);\n } else {\n $this->assertTrue($grant[\"readGrant\"], print_r($grant, TRUE));\n $this->assertEquals(Tinebase_Acl_Rights::ACCOUNT_TYPE_GROUP, $grant['account_type']);\n }\n }\n }",
"public function get_oauth_client() {\n\t\tif ( ! $this->auth_client instanceof Clients\\OAuth_Client ) {\n\t\t\t$this->auth_client = new Clients\\OAuth_Client( $this->context, $this->options, $this->user_options, $this->credentials );\n\t\t}\n\t\treturn $this->auth_client;\n\t}",
"public function retrieveTenants()\n {\n return $this->start()->uri(\"/api/tenant\")\n ->get()\n ->go();\n }",
"public function get_oauth_client() {\n\t}",
"protected function getAuthClient()\n {\n return new Client(['base_uri' => $this->authEndpoint]);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the value of the 'http_code' piece of info | public function code() {
return $this->info['http_code'];
} | [
"public function getCode()\n {\n return curl_getinfo($this->handler)['http_code'];\n }",
"public function getHTTPCode() {\n\t\treturn $this->code;\n\t}",
"private function code()\n {\n if ($this->curl->http_status_code) {\n return $this->curl->http_status_code;\n } elseif ($this->curl->error_code) {\n return $this->curl->error_code;\n }\n }",
"protected function getCode()\n {\n return $this->request->get('code');\n }",
"private function _extractCode() {\n $this->_code = $this->_curlResult[1]['http_code'];\n }",
"public function getLastHTTPCode()\n {\n if (isset($this->_info['http_code']))\n return ($this->_info['http_code']);\n\n return (0);\n }",
"public final function getResponseCode(): int\n {\n return $this->getAttribute('code');\n }",
"function get_http_response_code()\n\t{\n\t\treturn curl_getinfo($this->ch, CURLINFO_HTTP_CODE);\n\t}",
"public function getResponseCode()\r\n {\r\n return $this->header->get('rcode');\r\n }",
"function getCode() {\n return $this->getParam(CODE);\n }",
"public function get_response_code()\n {\n return $this->response_code;\n }",
"function get_status_code() {\n\n return $http_status_code;\n }",
"public function getLastResponseCode() {\n $last = $this->getLastResponse();\n if (!empty($last['code'])) {\n return $last['code'];\n }\n }",
"public function getResponseCode()\n {\n return $this->get('ResponseCode');\n }",
"public function getAVSResponseCode();",
"public function getHTTPCodeDescription() {\n\t\t$code = $this->HTTPCode;\n\t\tif(empty($code)) {\n\t\t\t// Assume that $code = 0 means there was no response\n\t\t\t$description = _t('BrokenExternalLink.NOTAVAILABLE', 'Server Not Available');\n\t\t} elseif(\n\t\t\t($descriptions = Config::inst()->get('SS_HTTPResponse', 'status_codes'))\n\t\t\t&& isset($descriptions[$code])\n\t\t) {\n\t\t\t$description = $descriptions[$code];\n\t\t} else {\n\t\t\t$description = _t('BrokenExternalLink.UNKNOWNRESPONSE', 'Unknown Response Code');\n\t\t}\n\t\treturn sprintf(\"%d (%s)\", $code, $description);\n\t}",
"public function getResponseCode()\r\n {\r\n return $this->responseCode; \r\n }",
"public function getResponseCode();",
"public function getCode(){\n return $this->getParameter('code');\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function makes the call to the MailChimp API and performs the required action | private function callMailChimp($updateData) {
// It requires a single array to be passed in which contains the details of the required action, list and user data
// The $updateData array is comprised of the following items:
// $updateData["action"] = "addUser" | "deleteUser" | "getUser"
// $updateData["listID"] = the MailChimp List ID to access
// $updateData["emailAddress"] = the user's email address
// $updateData["firstName"] = (Optional) the user's first name, won't be on every list
// Build the curl header authorisation
$header = array();
$header[] = "Content-type: application/json";
$header[] = "Authorization: apikey " . $this->config["mailchimpAPIKey"];
// Let's setup our standard variables which we'll need in the calls
$lowercaseEmail = strtolower($updateData["emailAddress"]);
$userHash = md5($lowercaseEmail);
$apiUrl = "https://us10.api.mailchimp.com/3.0/lists/" . $updateData["listID"] . "/members/";
// WHAT TYPE OF CALL ARE WE DOING?
if ($updateData["action"] == "getUser") {
// We're getting a user so let's add the user's hash to the apiUrl and set the $callType
$apiUrl = $apiUrl . $userHash;
$callType = "GET";
} else if ($updateData["action"] == "addUser") {
// We're adding a new user, so let's add their data into the $newUserDetails array
$newUserDetails = array(
"email_address" => $lowercaseEmail,
"status" => "subscribed"
);
// DO WE HAVE A FIRST NAME FOR THE USER?
if ($updateData["firstName"]) {
// Yes we do, so let's add the first name into the $newUserDetails array
$newUserDetails["merge_fields"]["FNAME"] = $updateData["firstName"];
}
// END IF DO WE HAVE A FIRST NAME FOR THE USER?
// Let's json encode the array for the API POST
$newUserDetails = json_encode($newUserDetails);
// Let's set the $callType
$callType = "POST";
} else if ($updateData["action"] == "deleteUser") {
// We're deleting a user, so let's add the user's hash to the apiUrl and set the $callType
$apiUrl = $apiUrl . $userHash;
$callType = "DELETE";
}
// END IF WHAT TYPE OF CALL ARE WE DOING?
// Build the curl command and set the options
$ch = curl_init($apiUrl);
curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $callType);
// ARE WE DOING A POST AND NEED TO ADD SOME POST FIELDS?
if ($updateData["action"] == "addUser") {
// Yes we are, so let's add the post field with the $newUserDetails array
curl_setopt($ch, CURLOPT_POSTFIELDS, $newUserDetails);
}
// END IF ARE WE DOING A POST AND NEED TO ADD SOME POST FIELDS?
// Run the curl and contact the API
$result = @curl_exec($ch);
// Decode the reply from MailChimp
$reply = json_decode($result, true);
// Return the decoded reply
return $reply;
} | [
"function mailchimpController($key=\"\", $operation=\"\", $user_mail=\"\", $list=\"\",$interest=\"\",$workflowID=\"\",$workflowMailID=\"\"){\r\n\r\n if(!$key){\r\n echo \"<script>console.log('Mailchimp Controller says: Error - There is no API-Key!');</script>\";\r\n return;\r\n }\r\n $api = array(\r\n 'login' => 'apikey',\r\n 'key' => $key,\r\n 'url' => 'https://usXX.api.mailchimp.com/3.0/'\r\n );\r\n\r\n\r\n //Get current user Email from database\r\n global $wpdb;\r\n $user_id = get_current_user_id();\r\n $sql = \"SELECT user_email FROM wp_users WHERE ID = $user_id\";\r\n\r\n if(!$list){\r\n //There is no Argument: Set default 'API' List\r\n $targetList\t= 'lists/<your-debuging-list-id>/';\r\n //echo \"<script>console.log('Mailchimp Controller says: No List selected! Default List: \" . $targetList . \"' );</script>\";\r\n }else{\r\n $targetList = 'lists/' . $list . '/';\r\n }\r\n\r\n if(!$user_mail){\r\n //No mail in argument means, that the user has to add to list\r\n $user_mail = $wpdb->get_var($sql);\r\n }else{\r\n //There is an individual mail adress; Add it to list, if it isn't already there\r\n addUserToList($user_mail, $api, $targetList);\r\n }\r\n\r\n\r\n switch ($operation){\r\n case \"\":\r\n //No argument\r\n echo \"<script>console.log('Mailchimp Controller says: No Operation selected! Argument: \" . $operation . \"' );</script>\";\r\n break;\r\n\r\n case \"addInterest\":\r\n //Add interest to member\r\n addInterest($user_mail, $api, $targetList, $interest);\r\n break;\r\n\r\n case \"markAsVIP\":\r\n //Activate VIP status for user_mail in targetList\r\n markAsVIP($user_mail, $api, $targetList);\r\n break;\r\n\r\n case \"addMemberToQueue\":\r\n if(!$workflowID || !$workflowMailID){\r\n echo \"<script>console.log('Mailchimp Controller says: No automation campaign or mail selected!');</script>\";\r\n break;\r\n }\r\n //Get automation\r\n $targetAutomation = 'automations/'. $workflowID .'/emails/'. $workflowMailID .'/queue';\r\n //Add current user_email to targetAutomation\r\n addMemberToQueue($user_mail, $api, $targetAutomation);\r\n break;\r\n\r\n case \"addUserToList\":\r\n\r\n //Add current user email to targetlist\r\n addUserToList($user_mail, $api, $targetList, 'true', $interest);\r\n break;\r\n\r\n //TODO\r\n // case \"removeFromList\":\r\n // removeMemberFromList($user_mail, $api, $targetList);\r\n // echo \"<script>console.log('Mailchimp Controller says: User removed! Argument: \" . $user_mail . \"' );</script>\";\r\n // break;\r\n //\r\n // case \"removeFromCampaign\":\r\n // //Get automation\r\n // $targetAutomation = 'automations/'. $workflowID .'/emails/'. $workflowMailID .'/queue';\r\n // removeMemberFromCampaign($user_mail, $api, $targetAutomation);\r\n // break;\r\n\r\n case \"printJSON\":\r\n //Print the target as json\r\n printJSON($api, $targetList);\r\n break;\r\n }\r\n\r\n}",
"function subscribeMailChimp(){\r\n $email=$_REQUEST['email'];\r\n $fname=(empty($_REQUEST['fname'])) ? 'NoName' : $_REQUEST['fname'];\r\n $lname=(empty($_REQUEST['lname'])) ? 'NoName' : $_REQUEST['lname'];\r\n\r\n require_once('resources/MailChimp.php');\r\n $MailChimp = new \\Drewm\\MailChimp('e59d7f0961b9e68c0ddfbde95c7b86c4-us2'); // api-key (test:b91f7f5130a784fd2e5992ab24493f2e-us8) //e59d7f0961b9e68c0ddfbde95c7b86c4-us2\r\n $result = $MailChimp->call('lists/subscribe', array(\r\n 'id' => '6f9c424019', // subscribe list id (test:287950c3fb) //6f9c424019\r\n 'email' => array('email'=>$email),\r\n 'merge_vars' => array('FNAME'=>$fname, 'LNAME'=>$lname),\r\n 'double_optin' => false,\r\n 'update_existing' => true,\r\n 'replace_interests' => false,\r\n 'send_welcome' => false,\r\n ));\r\n //print_r($result);\r\n }",
"function mailChimp() {\n\t\tpost_to_mail_chimp($_POST);\n\t\t\n\t\twp_die();\n\t}",
"public function updateMailChimpAPI(){\r\n\r\n\t\t//fetch activity feed list\r\n\t\t$post = $this->input->post(null, true);\r\n\t\t$key = $post['key'];\r\n\r\n\t//\t$key = \"1\";\r\n\r\n\t\t$config = array(\r\n\t\t\t'apikey' => $key, // Insert your api key\r\n\t\t\t'secure' => FALSE // Optional (defaults to FALSE)\r\n\t\t);\r\n\r\n\t\t$this->load->library('MCAPI', $config, 'mail_chimp');\r\n\r\n\t\t$retval = $this->mail_chimp->ping($key);\r\n\r\n\r\n\r\n\t\t$data = array(\r\n 'api_key' => $key\r\n );\r\n\t\t$this->db->where(\"application_id\", 1);\r\n\r\n\t\t// attempt to connect API key\r\n\r\n\t\tif( $this->db->update(\"sc_integrations\", $data) )\r\n\t\t\techo 0;\r\n\t\telse {\r\n\t\t\techo 1;\r\n\t\t\t}\r\n\r\n\t}",
"private function initMailChimpApi()\n {\n $this->mailchimp = new \\VPS\\MailChimp($this->modx->getOption('mailchimpsubscribe.mailchimp_api_key'));\n }",
"function send_campaign($send_campaign_data, $email, $auth, $list_id){\n \n$url = 'https://us20.api.mailchimp.com/3.0/campaigns'; /* This URL is used for creating a new campaign to all users in your list, \ndocumentation: hhttps://developer.mailchimp.com/documentation/mailchimp/reference/campaigns/ */\n \n$jsonString = json_encode($send_campaign_data); // json_encode converts $data to JSON code \n \n$curl = curl_init(); // Initializing cURL session\n \ncurl_setopt_array($curl, array( \n CURLOPT_URL => $url, /* Set CURLOPT_URL option for a cURL transfer and the value is the URL for creating\n a new Mailchimp list */\n CURLOPT_HTTPHEADER =>array('Content-Type: application/json', //Here the value is the JSON application and the authentication for accessing Mailchimp\n 'Authorization: Basic '.$auth),\n CURLOPT_RETURNTRANSFER => true, // It returns the transfer as a string\n CURLOPT_TIMEOUT => 10, // Maximum number of seconds to allow cURL functions to execute, set to 10 \n CURLOPT_POST => true, // Alternative port number to connect to\n CURLOPT_SSL_VERIFYPEER => false, // Verify the peer's SSL certificate\n CURLOPT_POSTFIELDS => $jsonString, // Post our JSON data \n));\n \n$result = curl_exec($curl); // Take URL and pass it to the browser\n \n$info = curl_getinfo($curl); // info about cURL session \n \n$httpCode = curl_getinfo($curl , CURLINFO_HTTP_CODE); //Output HTTP_CODE info\n \ncurl_close($curl); // close cURL resource, and free up system resources\n \nreturn $result; // Return the result \n \n}",
"function subscribeClientsToMailChimpList()\n {\n $retObj = array();\n try {\n\n if ( !empty($_GET['email1']) && !empty($_GET['email2'])\n ) {\n\n $members = array();\n $member1['email'] = array('email' => $_GET['email1']);\n $member1['merge_vars'] = array(\n 'FNAME'=>'gmail', 'LNAME'=>'CC'\n );\n $member2['email'] = array('email' => $_GET['email2']);\n $member2['merge_vars'] = array(\n 'FNAME'=>'gmail', 'LNAME'=>'CC'\n );\n $members[] = $member1;\n $members[] = $member2;\n\n $settings = Common::getSettings();\n $listid = $settings['mailchimp']['list_renewal']['default'];\n\n try {\n $mailchimpObj = new MailChimpManager();\n $response = $mailchimpObj->subscribeMembersToList($listid, $members);\n\n if($response) {\n $retObj = array('subscribed' => true);\n }\n\n\n } catch(Exception $e) {\n $params_email = array('action_date' => date('Y-m-d H:i:s') , 'reason' => 'C'.$e->getMessage());\n Common::sendEmailIfCampaignNotRan($params_email);\n throw new \\Exception($e->getMessage());\n }\n\n } else {\n\n throw new \\Exception('Unsupported Request: missing critical parameter(s).');\n\n }\n\n\n } catch (\\Exception $e) {\n\n Api::invalidResponse(\n $e->getMessage(),\n 400,\n Constants::STATUS_INVALID,\n $e,\n true,\n true\n );\n\n }\n\n return Api::apiResponse($retObj, Constants::STATUS_SUCCESSFUL);\n }",
"public function connectMailChimpApi( MailChimpApiConnectRequest $request , MailChimpService $mailChimpService )\n {\n \t$response = $mailChimpService->connect( $request->all() );\n \t\n \t\n\t\treturn redirect()->back()->withInput()->with( $response['status'] , $response['message'] );\n }",
"protected function connect_api() {\n\t\t$key = edd_get_option('eddmc_api', false);\n\n\t\tif ( $key ) {\n\t\t\t$this->api = new MailChimp( trim( $key ) );\n\n\t\t\tif ( defined('EDD_MC_VERIFY_SSL') && EDD_MC_VERIFY_SSL === false ) {\n\t\t\t\t$this->api->verify_ssl = false;\n\t\t\t}\n\t\t}\n\t}",
"public function send(){\r\n\t\t\ttry{\r\n\t\t\t\t//\tPrepare the xml payload\r\n\t\t\t\t$xml_payload = $this->prepareXmlPayload();\r\n\t\t\t\t//\tCreate a new curlBuddy instance\r\n\t\t\t\t$curl_buddy = new curlBuddy();\r\n\t\t\t\t//\tStart a new curl POST to the API endpoint\r\n\t\t\t\t$post_h = $curl_buddy->newCurl()->post(generalRcConfigs::$endpoint_url);\r\n\t\t\t\t//\tSet the xml payload\r\n\t\t\t\t$post_h->setData($xml_payload);\r\n\t\t\t\t//\tSet the standard Reminder Call HTTP headers\r\n\t\t\t\t$post_h->setHeaders(generalRcConfigs::$standard_curl_headers);\r\n\t\t\t\t//\tSend the POST request and check for errors\r\n\t\t\t\t$post_h->send();\r\n\t\t\t\tif($post_h->hasError()){\r\n\t\t\t\t\tthrow new Exception($post_h->errorMessage(), 1);\r\n\t\t\t\t}else{\r\n\t\t\t\t\t$this->_raw_response = $post_h->response();\r\n\t\t\t\t\t//\tParse the XML response into a PHP array\r\n\t\t\t\t\t$this->_response = $this->xmlToArray($post_h->response());\r\n\t\t\t\t\t//\tCheck for errors\r\n\t\t\t\t\tif(isset($this->_response['errors']['error'])){\r\n\t\t\t\t\t\tif(isset($this->_response['errors']['error']['message'])){\r\n\t\t\t\t\t\t\tthrow new Exception('reminderCallApiClient-Error[' . $this->_response['errors']['error']['@attributes']['code'] . ']: ' . $this->_response['errors']['error']['message'], 1);\r\n\t\t\t\t\t\t}elseif(isset($this->_response['errors']['error'][0]['message'])){\r\n\t\t\t\t\t\t\tthrow new Exception('reminderCallApiClient-Error[' . $this->_response['errors']['error'][0]['@attributes']['code'] . ']: ' . $this->_response['errors']['error'][0]['message'], 1);\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tthrow new Exception('reminderCallApiClient-Error[]: Unknown error.', 1);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\treturn true;\r\n\t\t\t}catch(Exception $e){\r\n\t\t\t\t$this->_error = $e->getMessage();\r\n\t\t\t}\r\n\t\t\treturn false;\r\n\t\t}",
"public function syncMailChimp($key){\r\n\t\r\n\t\t$apikey = $key;\r\n\t\t$this->load->helper('MCAPI_helper');\r\n\t\t$api = new MCAPI($apikey);\r\n\r\n\r\n\t\t$retval = $api->lists();\r\n\r\n\t\t$list_size = $retval['total']; //int\r\n\t\t$list_data = $retval['data']; //array\r\n\r\n\t\t// if the user has no Lists on MailChimp\r\n\t\t// prompt the user to create a List on MailChimp first\r\n\t\tif( $list_size == 0){\r\n\t\t\tnotify_set( array('status'=>'error', 'message'=>' In order to use the MailChimp Integration you must create a List inside of MailChimp.') );\r\n\t\tredirect( 'settings/integrations');\r\n\t\t}\r\n\t\t\t\t\t\r\n\t\t$return = false;\r\n\t\t$count = 0;\r\n\t\t$i = 0;\r\n\r\n\t\t$return = \"<select id='list_$i' name='lists' class='form-control'>\";\r\n\t\tforeach($list_data as $list){\r\n\t\t\t$return .= \"<option value='\" . $list['id'] . \"|\" . $list['name'] . \"'>\" . $list['name'] . \"</option>\";\r\n\t\t}\r\n\t\t$return .= \"</select>\";\r\n\t\r\n\r\n\t\t//set the header of the table and add the body to it\r\n\t\t$return = \"<table class='table table-striped'><thead><tr><th>Select MailChimp List for Synchronization</th></tr></thead><tbody><tr><td>\" . $return . \"</td></tr></tbody></table>\";\r\n\t\t\r\n\t\t$data['mailchimp_selection'] = $return;\r\n\t\t\r\n\t\t$data['mchimp_apikey'] = $apikey;\r\n\t\t\r\n\t\t$this->layout->view('/settings/integrations', $data);\r\n\t\r\n\t\t}",
"function addToMailChimp($email){\r\n\r\n\trequire_once 'inc/mailchimp/MCAPI.class.php';\r\n\t\r\n\t$api = new MCAPI(CONF_MC_APIKEY);\r\n\t\r\n\t$merge_vars = array();\r\n\t\r\n\t$email_type = 'html';\r\n\t\r\n\t$retval = $api->listSubscribe(CONF_MC_LISTID, $email, $merge_vars, $email_type, false);\r\n\t\r\n\tif($api->errorCode){\r\n\t\treturn false;\r\n\t} else {\r\n\t\treturn true;\r\n\t}\r\n}",
"public function ajax_mailchimp_status()\n {\n if (!$this->opt['woochimp_enabled'] || empty($this->opt['woochimp_api_key'])) {\n $message = '<h4><i class=\"fa fa-times\" style=\"font-size: 1.5em; color: red;\"></i> ' . __('Integration not enabled or API key not set', 'woochimp') . '</h4>';\n }\n else if ($account_info = $this->get_mailchimp_account_info()) {\n\n // Check if Ecommerce360 is enabled\n if (isset($account_info['modules']) && is_array($account_info['modules'])) {\n foreach ($account_info['modules'] as $module) {\n if (isset($module['name']) && $module['name'] == 'MailChimp Ecomm 360') {\n $ecomm_enabled = true;\n }\n }\n\n $ecomm_enabled = (isset($ecomm_enabled) && $ecomm_enabled) ? true : false;\n }\n\n $message = '<div style=\"width:400px;float:left;\"><h4><i class=\"fa fa-check\" style=\"font-size: 1.5em; color: green;\"></i> ' . __('Successfully connected to MailChimp', 'woochimp') . '</h4>' .\n '<table class=\"woochimp-account-info\"><tbody><tr>' .\n '<td><strong>' . __('Account name', 'woochimp') . ':</strong></td><td>' . $account_info['username'] . '</td>' .\n '</tr><tr>' .\n '<td><strong>' . __('Industry', 'woochimp') . ':</strong></td><td>' . $account_info['industry'] . '</td>' .\n '</tr><tr>' .\n '<td><strong>' . __('Plan type', 'woochimp') . ':</strong></td><td>' . $account_info['plan_type'] . '</td>' .\n '</tr><tr>' .\n '<td><strong>' . __('Is trial', 'woochimp') . ':</strong></td><td>' . ($account_info['is_trial'] ? __('Yes', 'woochimp') : __('No', 'woochimp')) . '</td>' .\n '</tr><tr>' .\n '<td><strong>' . __('Ecommerce360 enabled', 'woochimp') . ':</strong></td><td>' . (!isset($ecomm_enabled) ? __('Unknown', 'woochimp') : ($ecomm_enabled ? __('Yes', 'woochimp') : __('No', 'woochimp'))) . '</td>' .\n '</tr></tbody></table></div><div style=\"width:100px;float:left;\"><img style=\"width:300px;height:auto;margin-top:60px;\" src=\"'.WOOCHIMP_PLUGIN_URL.'/assets/img/mailchimp_logo.png\" /></div><div style=\"clear:both;\"></div>';\n }\n else {\n $message = '<h4><i class=\"fa fa-times\" style=\"font-size: 1.5em; color: red;\"></i> ' . __('Connection to MailChimp failed.', 'woochimp') . '</h4>';\n $mailchimp_error = $this->test_mailchimp();\n\n if ($mailchimp_error !== true) {\n $message .= '<p><strong>' . __('Reason', 'woochimp') . ':</strong> '. $mailchimp_error .'</p>';\n }\n }\n\n echo json_encode(array('message' => $message));\n die();\n }",
"function subscribe_email($list_id, $data){\n return mailchimp_call(\"lists/\" . $list_id . \"/members\", $data);\n}",
"public function connect() {\r\n\t\t// test connectivity by fetching all lists\r\n\t\t$max_lists = apply_filters('pmpro_addon_mc_api_fetch_list_limit', 15);\r\n\r\n\t\t$url = self::$api_url . \"/lists/?count={$max_lists}\";\r\n\t\t$response = wp_remote_get($url, $this->url_args);\t\t\r\n\t\t$resp_code = wp_remote_retrieve_response_code( $response );\r\n\r\n\t\tif ( is_numeric( $resp_code ) && 200 !== $resp_code ) {\r\n\t\t\tswitch ($resp_code) {\r\n\t\t\t\tcase 401:\r\n\t\t\t\t\t$this->set_error_msg(\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t$response,\r\n\t\t\t\t\t\t\t__('Sorry, but Mailchimp was unable to verify your API key. Mailchimp gave this response: <p><em>%s</em></p> Please try entering your API key again.', 'pmpro-mailchimp')\r\n\t\t\t\t\t);\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tdefault:\r\n\t\t\t\t\t$this->set_error_msg(\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t$response,\r\n\t\t\t\t\t\t\t__('Error while communicating with the Mailchimp servers: <p><em>%s</em></p>', 'pmpro-mailchimp')\r\n\t\t\t\t\t);\r\n\t\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t} else if ( is_numeric( $resp_code ) && 200 == $resp_code ) {\r\n\t\t\t$body = $this->decode_response($response['body']);\r\n\t\t\t$this->all_lists = isset($body->lists) ? $body->lists : array();\r\n\t\t} else {\r\n\t\t\t$this->set_error_msg( $response, __( 'Error while communicating with the Mailchimp servers.', 'pmpro-mailchimp' ) );\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\treturn true;\r\n\t}",
"protected function executeCall()\n\t{\n\t\t$mail\t= $this->getClass( 'Mail' );\n\t\t$date\t= date( 'Y-m-d', ( time() + ( self::NUM_DAYS_BEFORE_MATCH * 24 * 60 * 60 ) ) );\n\n\t\t$match\t= $this->getData( 'MatchModel', 'getMatchByDate', array( 'date' => $date ) );\n\t\tif ( !isset( $match[0] ) )\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\t$match\t\t\t\t\t= array_shift( $match );\n\t\t$match['day_formated']\t= date( 'd/m/Y', strtotime( $match['day'] ) );\n\n\t\t$players\t= $this->getData( 'TeamModel', 'getPlayers', array( 'type' => 'player' ) );\n\t\tforeach( $players as $player )\n\t\t{\n\t\t\t$mail->setReceiver( $player['email'] );\n\t\t}\n\n\t\t$mail->setContentType( 'text/html', 'utf8' );\n\t\t$mail->setFrom( FROM_EMAIL );\n\t\t$mail->setSubject( \"Call {$match['day_formated']}\" );\n\t\t$mail->setBody( $this->composeMailBody( $match ) );\n\t\t$mail->send();\n\t}",
"public function mc_subs_request_handler() {\n // Form input data from user\n $email = isset( $_POST['mc-email'] ) ? sanitize_email( $_POST['mc-email'] ) : '';\n $list_id = isset( $_POST['mc-list'] ) ? sanitize_key( $_POST['mc-list'] ) : '';\n\n // API key and status\n $api_key = ! empty( get_option( 'asd_mailchimp_api_key' ) ) ? get_option( 'asd_mailchimp_api_key' ) : '';\n $status = 'subscribed';\n\n // Nonce verification\n if ( ! isset( $_REQUEST['_mc_email_subs_nonce'] ) || ! wp_verify_nonce( $_POST['_mc_email_subs_nonce'], 'mc-sbuscription-form' ) ) {\n wp_send_json_error( [\n 'message' => __( 'Nonce verification failed', 'asd-subs-form-widget' ),\n ] );\n }\n\n // Email id verification\n if ( empty( $email ) ) {\n wp_send_json_error( [\n 'message' => __( 'Email address can\\'t be empty.', 'asd-subs-form-widget' ),\n ] );\n }\n\n // MailChimp list id verification\n if ( empty( $list_id ) ) {\n wp_send_json_error( [\n 'message' => __( 'Mailchimp list integration error. Please contact with admin.', 'asd-subs-form-widget' ),\n ] );\n }\n\n // Email subscription POST request to MailChimp via helper function\n $mc_subs_stat = asd_mc_api_post_email_subs( $api_key, $list_id, $email, $status );\n\n // Send status for successful subscription\n if ( 'subscribed' === $mc_subs_stat ) {\n wp_send_json_success( [\n 'message' => __( 'Email subscribed successfully.', 'asd-subs-form-widget' ),\n ] );\n }\n\n // Send status in case of existed email\n if ( 400 === $mc_subs_stat ) {\n wp_send_json_error( [\n 'message' => __( 'Email already exitst. Thanks for being with us.', 'asd-subs-form-widget' ),\n ] );\n }\n\n // Send status in case of other type failure\n wp_send_json_error( [\n 'message' => __( 'Request failed', 'asd-subs-form-widget' ),\n ] );\n }",
"public function test_mailchimp($key = null)\n {\n // Try to get key from options if not set\n if ($key == null) {\n $key = $this->opt['chimpy_api_key'];\n }\n\n // Check if api key is set now\n if (empty($key)) {\n return __('No API key provided', 'chimpy');\n }\n\n // Check if curl extension is loaded\n if (!function_exists('curl_exec')) {\n return __('PHP Curl extension not loaded on your server', 'chimpy');\n }\n\n // Load MailChimp Wrapper\n if (!class_exists('Chimpy_Mailchimp')) {\n require_once CHIMPY_PLUGIN_PATH . '/includes/chimpy-mailchimp.class.php';\n }\n\n // Try to initialize MailChimp\n $this->mailchimp = new Chimpy_Mailchimp($key);\n\n if (!$this->mailchimp) {\n return __('Unable to initialize MailChimp class', 'chimpy');\n }\n\n // Ping\n try {\n $results = $this->mailchimp->helper_ping();\n\n if ($results['msg'] == 'Everything\\'s Chimpy!') {\n return true;\n }\n\n throw new Exception($results['msg']); \n }\n catch (Exception $e) {\n return $e->getMessage();\n }\n\n return __('Something went wrong...', 'chimpy');\n }",
"function call_unsub($email)\n{\t\n \n global $table_prefix , $wpdb;\n $opt = maybe_unserialize(get_option('gf_mailchimp_settings'));\n $api_key = $opt['apikey'];\n \n $list = $wpdb->get_results(\"Select * from \".$table_prefix.\"rg_mailchimp\");\n $list_meta = maybe_unserialize($list[0]->meta);\n $list_id = $list_meta['contact_list_id'];\n \n // do not make request when no api key was provided.\n if(!$api_key) { \n return false; \n }\n \n if( strpos( $api_key, '-' ) !== false ) {\n $api_url = 'https://' . substr( $api_key, -3 ) . '.api.mailchimp.com/2.0/lists/unsubscribe.json';\n }else{\n $api_url = 'https://api.mailchimp.com/2.0/lists/unsubscribe.json';\n }\n \n $final_call = array( \n 'timeout' => 20,\n 'headers' => array('Accept-Encoding' => ''),\n 'sslverify' => false,\n 'body' => array( \n 'apikey' => $api_key,\n\t\t\t'id' => $list_id,\n\t\t\t'email' => array( 'email' => $email),\n\t\t\t'delete_member' => true,\n\t\t\t'send_goodbye' => true,\n\t\t\t'send_notify' => true\n\t\t)\n ) ;\n \n $response = wp_remote_post( $api_url,$final_call );\n \n \n // test for wp errors\n if( is_wp_error( $response ) ) {\n // show error message to admins\n $this->show_error( \"HTTP Error: \" . $response->get_error_message() );\n return false;\n }\n\n $body = wp_remote_retrieve_body( $response );\n\n return json_decode( $body );\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set the value of urlPullRequest | public function setUrlPullRequest($urlPullRequest)
{
$this->urlPullRequest = $urlPullRequest;
return $this;
} | [
"public function setRequestUrl($url) {}",
"public function setRequestUrl($url)\n {\n\n }",
"public function setURL($url) {$this->url = $url;}",
"public function setRequestUrl(?string $value): void {\n $this->getBackingStore()->set('requestUrl', $value);\n }",
"public function setUrl($url)\n {\n $this->requestUrl = $url;\n }",
"public function setAPIUrl($url){\n\t\t$this->apiUrl = $url;\n }",
"public function setDownloadUrl($value)\n {\n \t$this->downloadUrl = $value;\n }",
"public function setUrl($url) {}",
"abstract public function setUrl(?string $url);",
"public function setaUrl(){\n\t\t\t$this->url = isset($_GET['url']) ? $_GET['url'] : '';\n\t\t}",
"private function setEndpoint(): void\n {\n // Right trim the last '/' so even if the user sets this in the config we still get the correct url\n $url = rtrim(Config::get('gitlab-merge-requests.gitlab_url'), '/');\n $url .= '/api/';\n $url .= Config::get('gitlab-merge-requests.api_version');\n\n $this->endpoint = $url;\n }",
"private function setUrl()\n {\n curl_setopt($this->curl, CURLOPT_URL, $this->server);\n }",
"function setUrl($apiUrl) {\n $this->apiUrl = $apiUrl;\n }",
"public function setUrl($url) {\n if (!empty($url) && filter_var($url, FILTER_VALIDATE_URL))\n $this->url = $url;\n else\n $this->url = NULL; \n }",
"public function setRepoUrl($repo_url = ''){\n\t\t$this->repo_url = $repo_url;\n\t}",
"protected function _updateUrl(){\n\t\t$this->service_url = $this->url . $this->Method; \n\t}",
"protected function setAPIUrl()\n {\n $this->apiURL = $this->server;\n }",
"private function setReqUrl($reqUrl) {\r\n $this->reqUrl = $reqUrl;\r\n }",
"protected function set_url( string $new_url ) {\n\t\t\t$this->url = $new_url;\n\t\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the shipping amount in base currency. | public function getBaseAmount()
{
return $this->_get(self::KEY_BASE_SHIPPING_AMOUNT);
} | [
"public function getBaseShippingAmount();",
"private function getShippingAmount()\n {\n return $this->_checkoutSession->getLastRealOrder()->getBaseShippingAmount();\n }",
"public function getShippingAmount(){\n return $this->_getData(self::SHIPPING_AMOUNT);\n }",
"public function getShippingAmount();",
"public function shippingAmount() {\n\n\t\t$amount = 0.00;\n\t\tforeach($this->shipping() as $row) {\n\t\t\t$amount += $row->amount;\n\t\t}\n\n\t\treturn $amount;\n\t}",
"public function getBaseShippingDiscountAmount()\n {\n return $this->getData(self::KEY_BASE_SHIPPING_DISCOUNT_AMOUNT);\n }",
"public function getBaseShippingDiscountAmount()\n {\n return $this->baseShippingDiscountAmount;\n }",
"protected function GetShippingCost()\n\t\t{\n\t\t\t$shippingColumn = 'shipping_cost_ex_tax';\n\t\t\tif(getConfig('taxDefaultTaxDisplayOrders') == TAX_PRICES_DISPLAY_INCLUSIVE) {\n\t\t\t\t$shippingColumn = 'shipping_cost_inc_tax';\n\t\t\t}\n\n\t\t\t$amount = 0;\n\t\t\tforeach($this->orderData['orders'] as $order) {\n\t\t\t\t$amount += $order[$shippingColumn];\n\t\t\t}\n\t\t\treturn $amount;\n\t\t}",
"public function getBaseShippingTaxAmount();",
"public function getShippingCostTotal()\n {\n return $this->orderAmount - $this->orderAmountCoupon;\n }",
"public function getShippingDiscountAmount();",
"public function get_cart_shipping_total()\n {\n }",
"public function getShippingTaxAmount();",
"public function getShippingFee()\n {\n $amount = 0;\n $couriers = $this->getShippingFees();\n\n if (count($couriers) > 1)\n {\n // Multiple couriers\n foreach ($couriers as $courier) {\n $amount += @$courier['amount'];\n }\n }\n else $amount = @$couriers[0]['amount'];\n\n return $amount;\n }",
"public function getShippingTaxAmount(){\n return $this->_get(self::SHIPPING_TAX_AMOUNT);\n }",
"public function getShippingPrice()\n {\n return $this->shipping_price;\n }",
"public function getShippingProtectionBaseCurrency(): string\n {\n return $this->getData(self::SHIPPING_PROTECTION_BASE_CURRENCY);\n }",
"public function getPreShippingTotal()\n {\n return Currency::createFromCents($this->getSubtotal()->getCents() + $this->getCouponAmount()->getCents());\n }",
"public function get_shipping_cost()\n {\n return $this->shipping + $this->handling;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get a default "ean13" value, if any is available | public function getDefaultEan13() : ?string
{
return null;
} | [
"public function getDefaultEan13(): string|null\n {\n return null;\n }",
"public function getDefaultEan(): string|null;",
"public function getProductEan13()\n\t{\n\t\treturn $this->product_ean13;\n\t}",
"public function getAccDefaultVal() {\n /**\n * Create the eav attribute for 'airhotels/airhotel'\n */\n $accommodatesAttr = Mage::getModel ( 'eav/config' )->getAttribute ( 'catalog_product', Mage::helper ( 'airhotels/airhotel' )->getaccomodatesType () );\n $accommodateDefault = ( int ) $accommodatesAttr->getDefaultValue ();\n if ($accommodateDefault <= 0) {\n $accommodateDefault = 16;\n }\n /**\n * Return the $accDefault value.\n */\n return $accommodateDefault;\n }",
"public function getDefaultIsbn13() : ?string\n {\n return null;\n }",
"public function get_default_value();",
"public function getEAN()\r\n {\r\n return $this->fields['EAN']['value'];\r\n }",
"public function getProductEAN(): ?string\n {\n return isset($this->ProductEAN) ? $this->ProductEAN : null;\n }",
"function _getDefaultEnrollmentCode()\n{\n\tstatic $enrollment_code = null;\n\n\tif ( ! $enrollment_code )\n\t{\n\t\t$enrollment_code = DBGet( DBQuery( \"SELECT ID\n\t\t\tFROM STUDENT_ENROLLMENT_CODES\n\t\t\tWHERE SYEAR='\" . UserSyear() . \"'\n\t\t\tAND DEFAULT_CODE='Y'\" ) );\n\n\t\t$enrollment_code = $enrollment_code[1]['ID'];\n\t}\n\n\treturn $enrollment_code;\n}",
"public function getDefaultVal(): string\n {\n return $this->defaultText;\n }",
"public function getDefaultValue() {}",
"function get_default_value() {\r\n\t\treturn $this->default_value;\r\n\t}",
"public function getDefaultValue()\n {\n\treturn $this->default;\n }",
"public final function getDefault(){\n\t\treturn $this->default;\n\t}",
"public function getEan() : ?string \n {\n if ( ! $this->hasEan()) {\n $this->setEan($this->getDefaultEan());\n }\n return $this->ean;\n }",
"function get_default_value() {\n\t\t\tif(!$this->config['default_value']) {\n\t\t\t\t$this->config['default_value'] = null; \n\t\t\t}\n\t\t\treturn $this->config['default_value'];\n\t\t}",
"protected function defaultEmail() {\n if (!empty($this->{REDHEN_CONTACT_EMAIL_FIELD})) {\n foreach($this->{REDHEN_CONTACT_EMAIL_FIELD}[LANGUAGE_NONE] as $email) {\n if ($email['default']) {\n return $email['value'];\n }\n }\n }\n return '';\n }",
"public function getDefault(): string|null;",
"public function getDefaultValueString()\n {\n foreach( $this->possible_values as $ps )\n {\n if( $ps->isDefaultValue() )\n return $ps->getValue();\n }\n \n return NULL;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ getListByCon By Auto CodeCreator 20190815 12:07:57 | public static function getListByCon($con_arr, $is_paginate)
{
$infos = new UserLogin();
if (array_key_exists('search_word', $con_arr) && !Utils::isObjNull($con_arr['search_word'])) {
$keyword = $con_arr['search_word'];
$infos = $infos->where(function ($query) use ($keyword) {
$query->where('nick_name', 'like', "%{$keyword}%")
->where('code', 'like', "%{$keyword}%")
->where('phonenum', 'like', "%{$keyword}%");
});
}
if (array_key_exists('ids_arr', $con_arr) && !empty($con_arr['ids_arr'])) {
$infos = $infos->wherein('id', $con_arr['ids_arr']);
}
if (array_key_exists('id', $con_arr) && !Utils::isObjNull($con_arr['id'])) {
$infos = $infos->where('id', '=', $con_arr['id']);
}
if (array_key_exists('user_id', $con_arr) && !Utils::isObjNull($con_arr['user_id'])) {
$infos = $infos->where('user_id', '=', $con_arr['user_id']);
}
if (array_key_exists('token', $con_arr) && !Utils::isObjNull($con_arr['token'])) {
$infos = $infos->where('token', '=', $con_arr['token']);
}
if (array_key_exists('account_type', $con_arr) && !Utils::isObjNull($con_arr['account_type'])) {
$infos = $infos->where('account_type', '=', $con_arr['account_type']);
}
if (array_key_exists('ve_value1', $con_arr) && !Utils::isObjNull($con_arr['ve_value1'])) {
$infos = $infos->where('ve_value1', '=', $con_arr['ve_value1']);
}
if (array_key_exists('ve_value2', $con_arr) && !Utils::isObjNull($con_arr['ve_value2'])) {
$infos = $infos->where('ve_value2', '=', $con_arr['ve_value2']);
}
if (array_key_exists('login_at', $con_arr) && !Utils::isObjNull($con_arr['login_at'])) {
$infos = $infos->where('login_at', '=', $con_arr['login_at']);
}
if (array_key_exists('valid_time', $con_arr) && !Utils::isObjNull($con_arr['valid_time'])) {
$infos = $infos->where('valid_time', '=', $con_arr['valid_time']);
}
if (array_key_exists('seq', $con_arr) && !Utils::isObjNull($con_arr['seq'])) {
$infos = $infos->where('seq', '=', $con_arr['seq']);
}
if (array_key_exists('status', $con_arr) && !Utils::isObjNull($con_arr['status'])) {
$infos = $infos->where('status', '=', $con_arr['status']);
}
if (array_key_exists('created_at', $con_arr) && !Utils::isObjNull($con_arr['created_at'])) {
$infos = $infos->where('created_at', '=', $con_arr['created_at']);
}
if (array_key_exists('updated_at', $con_arr) && !Utils::isObjNull($con_arr['updated_at'])) {
$infos = $infos->where('updated_at', '=', $con_arr['updated_at']);
}
if (array_key_exists('deleted_at', $con_arr) && !Utils::isObjNull($con_arr['deleted_at'])) {
$infos = $infos->where('deleted_at', '=', $con_arr['deleted_at']);
}
//排序设定
if (array_key_exists('orderby', $con_arr) && is_array($con_arr['orderby'])) {
$orderby_arr = $con_arr['orderby'];
//例子,传入数据样式为'status'=>'desc'
if (array_key_exists('status', $orderby_arr) && !Utils::isObjNull($orderby_arr['status'])) {
$infos = $infos->orderby('status', $orderby_arr['status']);
}
}
$infos = $infos->orderby('seq', 'desc')->orderby('id', 'desc');
//分页设定
if ($is_paginate) {
$page_size = Utils::PAGE_SIZE;
//如果con_arr中有page_size信息
if (array_key_exists('page_size', $con_arr) && !Utils::isObjNull($con_arr['page_size'])) {
$page_size = $con_arr['page_size'];
}
$infos = $infos->paginate($page_size);
} else {
$infos = $infos->get();
}
return $infos;
} | [
"function getCondoList() {\n $sql = \"SELECT c.*,\n\t b.building_name\n FROM condo c \n LEFT JOIN condo_building cb \n ON c.id = cb.condo_id\n LEFT JOIN building b \n ON b.id = cb.building_id\n WHERE cb.building_id = ?\";\n return getAll($sql, [getLogin()['bid']]);\n}",
"public function listarContato(){}",
"public static function getCCList(){\n {\n\n $aclist= DB::table('claims')\n ->join('claims_client', 'claims.idclient', '=', 'claims_client.idclient')\n ->join('claims_bag', 'claims.idclaim', '=', 'claims_bag.idclaim')\n ->join('claims_closed', 'claims.idclaim', '=', 'claims_closed.idclaim');\n //->join('claims_close_refund', 'claims.idclaim', '=', 'claims_close_refund.idclaim');\n $aclist->groupBy('claims.claimcode');\n $aclist->orderBy('claims.idclaim', 'desc');\n $aclist = $aclist->get();\n return $aclist;\n }\n }",
"function get_list() {\n\t$query = \"select cc_id, cc_value from \".$this->_db_table;\n\t$cloudconfig_name_array = array();\n\t$cloudconfig_name_array = htvcenter_db_get_result_double ($query);\n\treturn $cloudconfig_name_array;\n}",
"public static function Listar($con=0)\n {\n\n $queri = DB::select('call pListarMedidores(?)', [$con]);\n foreach ($queri as $query) {\n $listado[$query->id] = $query->concatname;\n }\n return $listado;\n }",
"function getAllSBUCodes($connid)\r\n\t{\r\n\t\t$arrRet = array();\r\n\t\t$getSBUCodesQuery = \"SELECT srno, sbu_name FROM sbu_master\";\r\n\t\t$dbquery = new dbquery($getSBUCodesQuery, $connid);\r\n\t\twhile($SBUCodesRow = $dbquery->getrowarray())\r\n\t\t{\r\n\t\t\t$arrRet[$SBUCodesRow[\"srno\"]] = $SBUCodesRow[\"sbu_name\"];\r\n\t\t}\t\r\n\t\treturn $arrRet;\t\t\r\n\t}",
"function getCouponlist($cid, $limit)\n {\n $limit = $limit ? \"LIMIT {$limit}\" : '';\n $varID = \"o.fkCustomerID = '\" . $cid . \"' \";\n $query = \"SELECT o.pkOrderID, ot.Title, ot.Amount, o.TransactionID, o.OrderStatus,o.OrderDateAdded FROM \" . TABLE_ORDER . \" as o INNER JOIN \" . TABLE_ORDER_TOTAL . \" as ot ON o.pkOrderID = ot.fkOrderID WHERE {$varID} AND Code='coupon' ORDER BY pkOrderID desc {$limit}\";\n $arrRes = $this->getArrayResult($query);\n foreach ($arrRes as $key => $val)\n {\n $arrRows = $this->getInvoiceDetails($val['pkOrderID'], $cid);\n $arrRes[$key]['status'] = $this->getOrderStatus($val['OrderStatus']);\n }\n//pre($arrRes);\n return $arrRes;\n }",
"private function carregarListaCid() {\n $this->loadModel('Cid');\n $filtro = new BSFilter();\n $filtro->setTipo('list');\n $filtro->setCamposOrdenadosString('Cid.nome');\n //$cids = $this->Cid->listar($filtro);\n $cids = array();\n $this->set(compact('cids'));\n }",
"function get_list() {\n\t\t$query = \"select ct_id, ct_cr_id from \".$this->_db_table;\n\t\t$cloudtransaction_name_array = array();\n\t\t$cloudtransaction_name_array = htvcenter_db_get_result_double ($query);\n\t\treturn $cloudtransaction_name_array;\n\t}",
"function getListaSelect(){\r\n\t\t$sql = \"SELECT \r\n\t\t\t\t\tidTipoIncidencia AS id, cNombre AS name\r\n\t\t\t\tFROM cTipoIncidencias\";\r\n\t\treturn $this->query($sql);\r\n\t}",
"public function list_curso()\n {\n global $db_class; //variable para hacer las consultas\n\n if (empty($this->id_curso) ) {\n\n //list all cursos\n $sql = \"SELECT * FROM cursos\";\n $r = $db_class->query($sql);\n }else {\n\n // List curso specific\n $sql = \"SELECT * FROM cursos where id_curso = :id_curso\";\n $data = array(':id_curso' => $this->id_curso );\n $r = $db_class->query($sql,$data);\n \n }\n\n unset($sql);\n unset($data);\n // Result: list | null \n return $r;\n }",
"static function getList(){\n $sql = new Sql(\"localhost\", \"dbphp7\", \"root\", \"\");\n return $sql ->select(\"SELECT * FROM tb_usuarios ORDER BY deslogin\");\n }",
"public function listDahdiChannels(){\n\t\t$sql = \"SELECT * FROM dahdichandids ORDER BY channel\";\n\t\t$stmt = $this->database->prepare($sql);\n\t\t$stmt->execute();\n\t\t$results = $stmt->fetchAll(\\PDO::FETCH_ASSOC);\n\t\treturn $results;\n\t}",
"public function list_curso_by_bloque_docente()\n {\n if (self::validate($this->id_user_docente) && self::validate($this->id_bloque)) {\n global $db_class;\n //add params\n $data = array(':id_user_docente' => $this->id_user_docente,':id_bloque' => $this->id_bloque);\n $sql = \"SELECT bcd.id_bloquecursodocente ,c.id_curso,c.name,c.description FROM bloque_curso_docente as bcd inner join cursos as c on c.id_curso = bcd.id_curso where bcd.id_user_docente = :id_user_docente and bcd.id_bloque = :id_bloque\";\n $r = $db_class->query($sql,$data);\n //retornar la lista \n return $r;\n }\n }",
"function rpcRicarica()\n\t\t{\n\t\tif (!empty($this->sql))\n\t\t\t$this->lista = $this->BuildListFromDBQuery();\n\n\t\treturn $this->lista;\n\t\t}",
"public function getAllComunas(){\r\n $this->conexion->conectar();\r\n $consultaComuna = \"SELECT * FROM comuna\";\r\n $query = $this->conexion->ejecutar($consultaComuna);\r\n $comunas = array(); // Lista contenedora de comunas\r\n $i = 0;\r\n while(ocifetch($query)){\r\n $comuna = new Comuna();\r\n $comuna->setIdComuna(ociresult($query, \"ID_COMUNA\"));\r\n $comuna->setNombreComuna(ociresult($query, \"NOMBRE_COMUNA\"));\r\n $comuna->setIdProvincia(ociresult($query, \"ID_PROVINCIA\"));\r\n $comunas[$i] = $comuna;\r\n $i++;\r\n }\r\n $this->cone->desconectar();\r\n return $comunas;\r\n }",
"private function recupererListeCompetiteurs() {\n require_once PATH_MODELS . 'model_class_db.php';\n\n $dbCompetiteur = new ClassDb();\n $strQuery = \"SELECT DISTINCT \n R.rsl_usr_id AS id,\n U.usr_firstname AS firstname,\n U.usr_lastname AS lastname\n FROM \n csg_resultats AS R,\n csg_users AS U\n WHERE\n R.rsl_usr_id = U.usr_login\n ORDER BY\n U.usr_firstname ASC,\n U.usr_lastname ASC\n ;\";\n // echo $strQuery;\n // EXECUTER LA REQUETE AVEC LES PARAMETRES VIA MODEL DB\n $result = $dbCompetiteur->getAllData($strQuery);\n // RECUPERER LE RESULTAT\n return $result;\n $dbCompetiteur = null;\n }",
"public function getListToCome() {\n\t\t$concerts = array();\n\n\t\t$d = date('d');\n\t\t$m = date('m');\n\t\t$y = date('Y');\n\t\t\t\t\n\t\t$sql = $this->db->prepare(\"SELECT * \n\t\t\t\t\t\t\t\t FROM concerts \n\t\t\t\t\t\t\t\t WHERE year = :year AND month = :month AND day >= :day AND status = 'on' \n\t\t\t\t\t\t\t\t UNION\n\t\t\t\t\t\t\t\t SELECT * \n\t\t\t\t\t\t\t\t FROM concerts \n\t\t\t\t\t\t\t\t WHERE year = :year AND month > :month AND status = 'on' \n\t\t\t\t\t\t\t\t UNION\n\t\t\t\t\t\t\t\t SELECT * \n\t\t\t\t\t\t\t\t FROM concerts \n\t\t\t\t\t\t\t\t WHERE year > :year AND status = 'on' \n\t\t\t\t\t\t\t\t ORDER BY year ASC, month ASC, day ASC, time\");\n\t\t$sql->bindValue(':year', $y);\n\t\t$sql->bindValue(':month', $m);\n\t\t$sql->bindValue(':day', $d);\n\t\t$sql->execute();\n\n\t\twhile ($donnees = $sql->fetch(PDO::FETCH_ASSOC)) {\n $concerts[] = new Concert($donnees);\n }\n \n\t\treturn $concerts;\n\n\t}",
"public function listarcodigo(){\n\t\t$stmt = $this->objPDO->prepare(\"SELECT * from sisanatom.codigo_bethesda order by descr_codigo\");\n\t\t$stmt->execute();\n\t\t$cod = $stmt->fetchAll(PDO::FETCH_OBJ);\n\t\treturn $cod;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Unlink an image from a record | public function unlinkAction() {
if($this->_getParam('returnID',false)) {
$this->view->findID = $this->_getParam('secuid');
$this->view->returnID = $this->_getParam('returnID');
if ($this->_request->isPost()) {
$id = (int)$this->_request->getPost('id');
$del = $this->_request->getPost('del');
if ($del == 'Yes' && $id > 0) {
$imageID = $this->_request->getPost('imageID');
$findID = $this->_request->getPost('findID');
$imagedata = $this->_images->fetchRow('imageID = ' . $id);
$imageID = $imagedata['secuid'];
$linked = new FindsImages();
$where = array();
$where[] = $linked->getAdapter()->quoteInto('image_id = ?', $imageID);
$where[] = $linked->getAdapter()->quoteInto('find_id = ?', $findID);
$linked->delete($where);
// $this->_helper->solrUpdater->update('beoimages', $imageID);
$this->_helper->solrUpdater->update('beowulf', $findID);
$this->_flashMessenger->addMessage('Links deleted!');
$this->_redirect('/database/artefacts/record/id/' . $this->_getParam('returnID'));
}
} else {
$id = (int)$this->_request->getParam('id');
if ((int)$id > 0) {
$this->view->slide = $this->_images->fetchRow($this->_images->select()->where('imageID = ?', $id));
$this->view->params = $this->_getAllParams();
}
}
} else {
throw new Pas_Exception_Param($this->_missingParameter);
}
} | [
"function unlink_image_bank($img_id){\t\t\t\t\t\n\t\t$this->Campaign_Model->delete_image_bank(array('img_id'=>$img_id));\t\t\n\t}",
"function deletePicture(){\n\t\t$bdd = $this->databaseConnect();\n\t\t$imgReq = $bdd->prepare('SELECT img_link FROM dishes WHERE id = :id');\n\t\t$imgExec = $imgReq->execute(array('id'=>$_GET['id']));\n\t\t$imgFetch = $imgReq->fetch();\n\t\t$imgLink = $imgFetch[0];\n\t\tunlink($imgLink);\n\t}",
"public function removeImage () {}",
"public function despeckleimage(){}",
"public function removeimage(){}",
"function despeckleImage(){}",
"protected function unlinkOldPicture()\n\t{\n\t\t$customer = $this->repository->byId($this->id);\n\n\t\tif(file_exists($customer->picture))\n\t\t{\n\t\t\tunlink($customer->picture);\n\t\t}\n\t}",
"function deleteImage()\n {\n $this->dbInit();\n\n $this->Database->array_query( $result, \"SELECT ImageID FROM eZLink_Link WHERE ID='$this->ID'\" );\n\n foreach ( $result as $item )\n {\n $image = new eZImage( $item[\"ImageID\"] );\n $image->delete();\n }\n \n $this->Database->query( \"UPDATE eZLink_Link set ImageID='0' WHERE ID='$this->ID'\" );\n }",
"function deleteImage()\n {\n $this->dbInit();\n\n $this->Database->array_query( $result, \"SELECT ImageID FROM eZLink_LinkGroup WHERE ID='$this->ID'\" );\n\n foreach ( $result as $item )\n {\n $image = new eZImage( $item[\"ImageID\"] );\n $image->delete();\n }\n \n $this->Database->query( \"UPDATE eZLink_LinkGroup set ImageID='0' WHERE ID='$this->ID'\" );\n }",
"function removeImage(){}",
"public function remove_image() {\n $ad = $this->ad_protected_for_current_user($this->params['id']);\n $ad->remove_image($this->params['image_id']);\n redirect('/ads/edit', ['notice' => 'Image successfully removed.'], ['id' => $ad->id]);\n }",
"private function unlinkMedia()\n {\n $params = ['displayGroupId' => $this->displayGroupId];\n\n $sql = 'DELETE FROM `lkmediadisplaygroup` WHERE DisplayGroupID = :displayGroupId AND mediaId NOT IN (0';\n\n $i = 0;\n foreach ($this->media as $media) {\n /* @var Media $media */\n $i++;\n $sql .= ',:mediaId' . $i;\n $params['mediaId' . $i] = $media->mediaId;\n }\n\n $sql .= ')';\n\n $this->getStore()->update($sql, $params);\n }",
"public function removeImage() {\n //check if we have an old image\n if ($this->image) {\n //store the old name to delete on the update\n $this->temp = $this->image;\n //delete the current image\n $this->image = NULL;\n }\n }",
"public function deleteImage($field) {\n// foreach($this->fields as $field => $fieldSizes) {\n $this->owner->{$field} = null;\n $filePath = $this->getFilePath();\n $fileName = $this->owner->oldAttributes[$field];\n @unlink($filePath . $fileName);\n foreach($this->fields[$field] as $sizeName => $sizes) {\n if($sizeName != 'saveOriginal') {\n $thumbFileName = preg_replace(\"/(\\.\\S{3,4})$/iu\", \"_$sizeName$1\", $fileName);\n @unlink($filePath . $thumbFileName);\n }\n }\n// }\n }",
"public function unlink();",
"abstract public function removeAssociation( $url );",
"function delete_profile_image($user_ref)\n {\n global $storagedir;\n\n $profile_image_name = sql_value(\"select profile_image value from user where ref = '\" . escape_check($user_ref) . \"'\",\"\");\n \n if ($profile_image_name != \"\")\n {\n $path_to_file = $storagedir . '/user_profiles' . '/' . $profile_image_name;\n\n if (file_exists($path_to_file))\n {\n unlink($path_to_file);\n }\n \n sql_query(\"update user set profile_image = '' where ref = '\" . escape_check($user_ref) . \"'\");\n }\n }",
"public function deleteReferences()\n {\n $keys = array(\"bp_tal_id\",\"design_brief_id\",\"design_brief_references_id\",\"attachment_path\");\n\n $data = check_api_keys($keys,$this->mydata);\n\n $res = $this->model->delete_reference_image($data);\n \n if($res)\n respond_success_to_api(\"success\");\n else\n respond_error_to_api(\"error\", \"try after some time.\"); \n\n }",
"function remove_by_name($image_name) {\n\t\t// remove auth file\n\t\t$rem_image = new image();\n\t\t$rem_image->get_instance_by_name($image_name);\n\t\t$rem_image_id = $rem_image->id;\n\t\t$CMD=\"rm -f $this->_base_dir/openqrm/web/action/image-auth/iauth.$rem_image_id\";\n\t\texec($CMD);\n\t\t// remove from db\n\t\t$db=openqrm_get_db_connection();\n\t\t$rs = $db->Execute(\"delete from $this->_db_table where image_name='$image_name'\");\n\t\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
store all client request printer attributes | protected function c_parsePrinterAttributes() {
//if ($this->clientoutput->status != "successfull-ok")
// return false;
$pr = -1;
for ($i = 0 ; $i < count($this->clientoutput->response) ; $i++) {
if ($this->clientoutput->response[$i]['attributes'] == "printer-attributes")
$pr ++;
$k = -1;
for ($j = 0 ; $j < (count($this->clientoutput->response[$i]) - 1) ; $j ++)
if (!empty($this->clientoutput->response[$i][$j]['name'])) {
$k++;
$l = 0;
$this->parsed[$pr][$k]['range'] = $this->clientoutput->response[$i]['attributes'];
$this->parsed[$pr][$k]['name'] = $this->clientoutput->response[$i][$j]['name'];
$this->parsed[$pr][$k]['type'] = $this->clientoutput->response[$i][$j]['type'];
$this->parsed[$pr][$k][$l] = $this->clientoutput->response[$i][$j]['value'];
} else {
$l ++;
$this->parsed[$pr][$k][$l] = $this->clientoutput->response[$i][$j]['value'];
}
}
//$this->clientoutput->response = array();
$this->client_printer_attributes = new stdClass();
for ($pr_nbr = 0 ; $pr_nbr <= $pr ; $pr_nbr ++) {
$pr_index = "pr_".$pr_nbr;
$this->client_printer_attributes->$pr_index = new stdClass();
for ($i = 0 ; $i < count($this->parsed[$pr_nbr]) ; $i ++) {
$name = $this->parsed[$pr_nbr][$i]['name'];
$php_name = str_replace('-','_',$name);
$type = $this->parsed[$pr_nbr][$i]['type'];
$range = $this->parsed[$pr_nbr][$i]['range'];
$this->client_printer_attributes->$pr_index->$php_name = new stdClass();
$this->client_printer_attributes->$pr_index->$php_name->_type = $type;
$this->client_printer_attributes->$pr_index->$php_name->_range = $range;
for ($j = 0 ; $j < (count($this->parsed[$pr_nbr][$i]) - 3) ; $j ++) {
# This causes incorrect parsing of integer job attributes.
# 2010-08-16
# bpkroth
#$value = self::_interpretAttribute($name,$type,$this->parsed[$job_nbr][$i][$j]);
$value = $this->parsed[$pr_nbr][$i][$j];
$index = '_value'.$j;
$this->client_printer_attributes->$pr_index->$php_name->$index = $value;
}
}
}
$this->parsed = array();
} | [
"protected function read_request_variables()\n {\n $this->set_printer_classname($this->request_param('printer', true));\n $this->set_data($this->request_param('data', true));\n $this->set_tpl($this->request_param('tpl'));\n }",
"protected function setAttributes()\n {\n $inputs = array_merge($_GET,$_POST);\n $request = [];\n\n foreach ($inputs as $key => $value) {\n $request[e($key)] = e($value);\n }\n\n $this->attributes = $request;\n }",
"public function storeProperties() {\n if ( !$this->touched ) return;\n foreach( xattr_list($this->localPath) as $attribute )\n if (!isset($this->dead_props[rawurldecode($attribute)]))\n xattr_remove($this->localPath, $attribute);\n foreach( $this->dead_props as $name => $value )\n xattr_set($this->localPath, rawurlencode($name), $value);\n $this->touched = false;\n}",
"public function write_request_fields_to_log()\n\t{\n\t\t$this->write_array_to_log($_REQUEST);\n\t}",
"protected function storeMargins()\n {\n $margin = $this->getPrintSetup()->getMargin();\n\n $this->appendRecord('LeftMargin', array($margin->getLeft()));\n $this->appendRecord('RightMargin', array($margin->getRight()));\n $this->appendRecord('TopMargin', array($margin->getTop()));\n $this->appendRecord('BottomMargin', array($margin->getBottom()));\n }",
"public function getClientAttributes()\n {\n return $this->clientAttributes;\n }",
"protected function _storePrintHeaders()\n {\n $record = 0x002a; // Record identifier\n $length = 0x0002; // Bytes to follow\n\n $fPrintRwCol = $this->_print_headers; // Boolean flag\n\n $header = \\pack('vv', $record, $length);\n $data = \\pack('v', $fPrintRwCol);\n $this->_prepend($header . $data);\n }",
"function putStandardAttributes()\n {\n global $config, $cpzone;\n\n if (!function_exists(\"getNasIp\")) {\n $ipaddr = \"0.0.0.0\";\n } else {\n $ipaddr = getNasIP();\n }\n // Add support for sending NAS-IP-Address, set this explicitly as an ip_addr\n $this->putAttribute(RADIUS_NAS_IP_ADDRESS, $ipaddr, \"addr\");\n\n // Add support for sending NAS-Identifier\n if (empty($config[\"captiveportal\"][$cpzone][\"radiusnasid\"])) {\n $nasId = php_uname(\"n\");\n } else {\n $nasId = $config[\"captiveportal\"][$cpzone][\"radiusnasid\"];\n }\n $this->putAttribute(RADIUS_NAS_IDENTIFIER, $nasId);\n }",
"public function getAllSettingClientProperties()\n {\n\t$this->setRequestData(self::RESOURCE_SETTING_CLIENTPROPERTIES);\n }",
"function putAuthAttributes()\n {\n if (isset($this->username)) {\n $this->putAttribute(RADIUS_USER_NAME, $this->username);\n }\n $this->putAttribute(RADIUS_ACCT_STATUS_TYPE, $this->status_type);\n //if (isset($this->session_time) && $this->status_type == RADIUS_STOP) {\n if (isset($this->session_time)) {\n $this->putAttribute(RADIUS_ACCT_SESSION_TIME, $this->session_time);\n }\n if (isset($this->authentic)) {\n $this->putAttribute(RADIUS_ACCT_AUTHENTIC, $this->authentic);\n }\n\n $this->putStandardAttributes();\n }",
"public function attributes() {\n\n if ($this->page->request->isPost()) {\n $post = $this->page->request->post;\n $result = $this->model->setAttribute($post);\n $status = $result->success ? '200' : '400';\n \n $data = json_encode($result->data, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES | JSON_NUMERIC_CHECK);\n header('Status: ' . $status);\n header('Content-Type: text/plain; charset=UTF-8');\n header('Content-Length: ' . strlen($data));\n echo $data;\n exit;\n }\n\n $this->page->wear_attributes = $this->model->getAttributes();\n $this->page->registerEarlyLoadJS('wear_attributes.js');\n }",
"public function storeToSession() {\n\n $dataArray = array();\n\n foreach (get_class_vars(get_class($this)) as $propertyName => $propertyValue) {\n $getter = 'get_'.$propertyName;\n $dataArray[$propertyName] = $this->$getter();\n }\n\n tx_pttools_sessionStorageAdapter::getInstance()->store(self::SESSION_KEY_NAME_PAYMENT_REQUEST, $dataArray);\n if (TYPO3_DLOG) t3lib_div::devLog('Stored standardized payment request information into FE browser session key \"'.self::SESSION_KEY_NAME_PAYMENT_REQUEST.'\"', 'pt_tools', 0, $dataArray);\n\n }",
"protected function attributesToLog()\n {\n return [];\n }",
"function putAuthAttributes()\n {\n if (isset($this->username)) {\n $this->putAttribute(RADIUS_USER_NAME, $this->username);\n }\n if (isset($this->response)) {\n $response = pack('C', $this->chapid) . $this->response;\n $this->putAttribute(RADIUS_CHAP_PASSWORD, $response);\n }\n if (isset($this->challenge)) {\n $this->putAttribute(RADIUS_CHAP_CHALLENGE, $this->challenge);\n }\n }",
"function set_all_attributes($var){\n $this->set_name_attributes($var);\n $this->set_description_attributes($var);\n $this->set_image_attributes($var);\n $this->set_url_attributes($var);\n }",
"function capture_request_vars(){\r\n\t\t$this->post = $_POST;\r\n\t\t$this->get = $_GET;\r\n\r\n\t\tif ( function_exists('get_magic_quotes_gpc') && get_magic_quotes_gpc() ) {\r\n\t\t\t$this->post = stripslashes_deep($this->post);\r\n\t\t\t$this->get = stripslashes_deep($this->get);\r\n\t\t}\r\n\t}",
"function getClientInfoProperties(){\r\n\t\tdie('Not implemented');\r\n\t}",
"public function getPrinterInfo()\n {\n echo json_encode(\n array(\n 'file' => $this->obj->get('file'),\n 'port' => $this->obj->get('port'),\n 'model' => $this->obj->get('model'),\n 'ip' => $this->obj->get('ip'),\n 'config' => strtolower($this->obj->get('config')),\n 'configFile' => $this->obj->get('configFile'),\n )\n );\n exit;\n }",
"function _store_setup()\r\n {\r\n $record = 0x00A1; // Record identifier\r\n $length = 0x0022; // Number of bytes to follow\r\n\r\n $iPaperSize = $this->_paper_size; // Paper size\r\n $iScale = $this->print_scale; // Print scaling factor\r\n $iPageStart = 0x01; // Starting page number\r\n $iFitWidth = $this->fit_width; // Fit to number of pages wide\r\n $iFitHeight = $this->fit_height; // Fit to number of pages high\r\n $grbit = 0x00; // Option flags\r\n $iRes = 0x0258; // Print resolution\r\n $iVRes = 0x0258; // Vertical print resolution\r\n $numHdr = $this->_margin_head; // Header Margin\r\n $numFtr = $this->_margin_foot; // Footer Margin\r\n $iCopies = 0x01; // Number of copies\r\n\r\n $fLeftToRight = 0x0; // Print over then down\r\n $fLandscape = $this->_orientation; // Page orientation\r\n $fNoPls = 0x0; // Setup not read from printer\r\n $fNoColor = 0x0; // Print black and white\r\n $fDraft = 0x0; // Print draft quality\r\n $fNotes = 0x0; // Print notes\r\n $fNoOrient = 0x0; // Orientation not set\r\n $fUsePage = 0x0; // Use custom starting page\r\n\r\n $grbit = $fLeftToRight;\r\n $grbit |= $fLandscape << 1;\r\n $grbit |= $fNoPls << 2;\r\n $grbit |= $fNoColor << 3;\r\n $grbit |= $fDraft << 4;\r\n $grbit |= $fNotes << 5;\r\n $grbit |= $fNoOrient << 6;\r\n $grbit |= $fUsePage << 7;\r\n\r\n $numHdr = pack(\"d\", $numHdr);\r\n $numFtr = pack(\"d\", $numFtr);\r\n if ($this->_byte_order) // if it's Big Endian\r\n {\r\n $numHdr = strrev($numHdr);\r\n $numFtr = strrev($numFtr);\r\n }\r\n\r\n $header = pack(\"vv\", $record, $length);\r\n $data1 = pack(\"vvvvvvvv\", $iPaperSize,\r\n $iScale,\r\n $iPageStart,\r\n $iFitWidth,\r\n $iFitHeight,\r\n $grbit,\r\n $iRes,\r\n $iVRes);\r\n $data2 = $numHdr .$numFtr;\r\n $data3 = pack(\"v\", $iCopies);\r\n $this->prepend($header.$data1.$data2.$data3);\r\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Extracts all the hashtags from the tweet. | public function extractHashtags() {
preg_match_all(self::$patterns['valid_hashtag'], $this->tweet, $matches);
return $matches[3];
} | [
"public function extractHashtags($tweet)\n {\n $hashtagsOnly = array();\n $hashtagsWithIndices = $this->extractHashtagsWithIndices($tweet);\n\n foreach ($hashtagsWithIndices as $hashtagWithIndex) {\n $hashtagsOnly[] = $hashtagWithIndex['hashtag'];\n }\n return $hashtagsOnly;\n }",
"public static function hashtags($text) {\n $regex = '/#\\w+/u';\n preg_match_all($regex,$text,$matches);\n return $matches; \n }",
"function get_hashtags($tweet, &$hashTags)\n{\n\terror_reporting(E_ALL & ~E_NOTICE);\n\t$myTweet = $tweet;\n\twhile ( !empty($myTweet) ){\n\t\tpreg_match(\"/#(\\\\w+)/\", $myTweet, $matches);\n\t\tif ( !empty($matches)){\n\t\t\t$key = $matches[0];\n\t\t}else{\n\t\t\t$key = \"\";\n\t\t}\n\t\tif(array_key_exists(strtolower($key), $hashTags)){\n\t\t\t$hashTags[strtolower($key)]++;\t\n\t\t}else{\n\t\t\t$hashTags[strtolower($key)] = 1;\n\t\t}\n\t\t//\tprint_r(error_get_last());\n\t\t\t$myTweet = stristr($myTweet, '#');\n\t\t\t$myTweet = substr($myTweet, 1);\n\t\t\n\t}\n\n}",
"private function ncc_v_twitter_tweets_hashtag_finder($tweet_text)\n {\n $parsed_text = preg_replace('/(^|\\s)#(\\w*[a-zA-Z_]+\\w*)/',\n '\\1<a href=\"http://www.twitter.com/search?q=%23\\2&src=hash\" target=\"_blank\">#\\2</a>',\n $tweet_text);\n\n return $parsed_text;\n\n }",
"function get_hashtags($text) {\n\t$tags = array();\n\tpreg_match_all('/(^|[^\\w])#(\\w*[^\\s\\d!-\\/:-@]+\\w*)/', $text, $tags);\n\treturn $tags[2];\n}",
"function extract_hashtags($text) {\n return array_unique(\n array_map(\n function($el) { return substr($el, 1); },\n array_filter(\n explode(\" \", $text),\n function($c) {\n return $c !== \"\" && $c[0] == \"#\";\n }\n )\n )\n );\n}",
"public function obtainHashtags()\n {\n return $this->sendRequest(\"GET\", \"/hashtags\");\n }",
"public static function getHashtags(string $text): array\n\t{\n\t\t$output = [];\n\n\t\tpreg_match_all('/#(\\\\w+)/', $text, $matches);\n\n\t\tif (count($matches[0])) {\n\t\t\t$offset = 0;\n\t\t\tforeach ($matches[0] AS $hashtag) {\n\t\t\t\t$start = strpos($text, $hashtag, $offset);\n\t\t\t\t$offset = $end = $start + strlen($hashtag);\n\t\t\t\t$output[] = (object)[\n\t\t\t\t\t'hashtag' => $hashtag,\n\t\t\t\t\t'text' => substr($hashtag, 1),\n\t\t\t\t\t'start' => $start,\n\t\t\t\t\t'end' => $end,\n\t\t\t\t];\n\t\t\t}\n\t\t}\n\n\t\treturn $output;\n\t}",
"public function testExtractHashtags()\n {\n self::$container->get(\"generic_api\")->generateTweets(100);\n $tweets = self::$container->get(\"twitter_api\")->getUsersTweets(\"user\", 100);\n $content = self::$container->get(\"twitter_api\")->ExtractHashtags($tweets);\n $counts = array_count_values(str_word_count($content, 1));\n $expectedValues = [\n \"hashtaginall\" => 100,\n \"hashtagt\" => 34,\n \"hashtagf\" => 20,\n \"hashtagtt\" => 10\n ];\n foreach ($counts as $key => $value) {\n $this->assertEquals($expectedValues[$key], $value);\n }\n }",
"function getHashtags($message){\n preg_match_all('/(?:\\s|^)#([A-Za-z_0-9]+)/', $message, $matches);\n if (count($matches[1]) == 0){\n return [];\n }\n $matches = array_unique($matches[1]);\n return $matches;\n}",
"public function getHashtags()\n\t{\n\t\treturn $this->aHashtags;\n\t}",
"public function getHashTags()\n {\n return $this->fields['hashtags'];\n }",
"public function hashtag($tag = \"entrepeneur\") {\n\t\t$tweets = json_decode($this->timeline());\n\t\t$tags = []; $ts = []; $results = [];\n\t\tforeach ($tweets as $t) {\n\t\t\t$path = '1.1/statuses/retweets/'.$t->id.'.json';\n\t\t\t$this->http_code = $this->twitter->request('GET', $this->twitter->url($path), array());\n\t\t\t$arr = json_decode($this->output());\n\t\t\t$ts[$t->id] = $t->text;\n\t\t\tif (sizeof($arr) >= 1 ) {\n\t\t\t\tforeach ($arr as $a) {\n\t\t\t\t\t$hashtags = $a->entities->hashtags;\n\t\t\t\t\tforeach ($hashtags as $h) {\n\t\t\t\t\t\t$tags[$t->id] = $h->text;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tforeach ($tags as $key => $value) {\n\t\t\tif ($tag == $value) {\n\t\t\t\t$results[] = $ts[$key];\n\t\t\t}\n\t\t}\n\t\treturn $results;\n\t}",
"function hashtags($track,$tweet){\n\n $util=New Util();\n\n if($this->hasEntities($tweet,'ht')){\n\n\n foreach($tweet->entities->hashtags as $k => $v){\n $v->text=$util->filterSpecials($v->text);\n\n\n $result=$this->ejecutar(\"select hashtag_user_k,total,date from hashtags_users where track_k='\".$track.\"' and hashtag='\".$v->text.\"' and date='\".date('Y-m-d').\"' and id_str='\".$tweet->user->id_str.\"'\");\n if(mysql_num_rows($result)>0){\n $result=mysql_fetch_object($result);\n $this->ejecutar(\"update hashtags_users set total=\".($result->total+1).\" where hashtag_user_k=\".$result->hashtag_user_k);\n $total_users=0;\n }\n else{\n $this->ejecutar(\"insert into hashtags_users (track_k,id_str,screen_name,hashtag,total,date) values ('\".$track.\"','\".$tweet->user->id_str.\"','\".$tweet->user->screen_name.\"','\".htmlentities($v->text,ENT_QUOTES).\"',1,'\".date('Y-m-d').\"')\");\n $total_users=1;\n }\n\n\n $result=$this->ejecutar(\"select hashtag_k,users,total,date from hashtags where track_k='\".$track.\"' and hashtag='\".$v->text.\"' and date='\".date('Y-m-d').\"'\");\n if(mysql_num_rows($result)>0){\n $result=mysql_fetch_object($result);\n $this->ejecutar(\"update hashtags set total=\".($result->total+1).\",users=\".($result->users + $total_users).\" where hashtag_k=\".$result->hashtag_k);\n }\n else{\n $this->ejecutar(\"insert into hashtags (track_k, hashtag,total,date) values ('\".$track.\"','\".htmlentities($v->text,ENT_QUOTES).\"',1,'\".date('Y-m-d').\"')\");\n }\n }\n }\n\n }",
"public function addLinksToHashtags() {\n return preg_replace_callback(\n self::REGEX_HASHTAG,\n array($this, '_addLinksToHashtags'),\n $this->tweet);\n }",
"function parse_hashtags($text) {\n return implode(\n \" \", \n array_map(\n function($el) {\n if($el !== \"\" && $el[0] == \"#\") {\n $n = substr($el, 1);\n return '<span class=\"pseudo-link\" onclick=\"document.location.href = \\'/hashtag.php?name='.$n.'\\'; return false\">'.$el.'</span>';\n }\n return $el;\n },\n explode(\" \", $text)\n )\n );\n}",
"static function parseHashtags($text,$latestpost) {\n\n //$test = collect($text);\n preg_match_all('/\\#([a-zA-Z0-9\\.\\-\\&]+)/', $text, $matches);\n foreach ($matches[0] as $key => $value) {\n $value = str_replace('#','',$value);\n $tag = Tag::create([\n 'tag' => $value,\n ]);\n $latestpost->tag()->attach($tag);\n // dd($latestpost);\n }\n // foreach ($matches[0] as $value) {\n // $value = str_replace('#','',$value);\n // $tag->post()->attach($value);\n // }\n //dd($matches);\n// return $result;\n\t}",
"public function getHashtags()\n\t{\n\t\t$caseID = preg_replace(\"/[^0-9]/\", \"\", Input::get('caseID'));\n\n\t\t$hashtags = new HashtagsQuery();\n\t\t$hashtags = $hashtags->getCaseTags($caseID);\n\n\t\treturn $hashtags;\n\t}",
"function hashtags_post_typo($flux){\n return nettoyer_raccourcis_hashtags($flux);\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Adds a JOIN clause to the query using the MstWilayah relation | public function joinMstWilayah($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('MstWilayah');
// create a ModelJoin object for this join
$join = new ModelJoin();
$join->setJoinType($joinType);
$join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
if ($previousJoin = $this->getPreviousJoin()) {
$join->setPreviousJoin($previousJoin);
}
// add the ModelJoin to the current object
if ($relationAlias) {
$this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
$this->addJoinObject($join, $relationAlias);
} else {
$this->addJoinObject($join, 'MstWilayah');
}
return $this;
} | [
"protected abstract function getJoinStatement();",
"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 }",
"private function addJoinsToQuery()\n {\n if (!empty($this->joins)) {\n foreach ($this->joins as $join) {\n $this->query .= \" {$join->type} `{$this->dbName}`.`{$join->tableToJoin}`\";\n \n if (!empty($join->alias)) {\n $this->query .= \" AS {$join->alias}\";\n }\n \n $this->query .= \" ON `{$this->dbName}`.\";\n \n $this->query .= \"`\".(!empty($join->alias) ? $join->alias : $join->tableToJoin).\"`.\";\n \n $this->query .= \"`{$join->tableField}` =\";\n \n $this->query .= \" `{$this->dbName}`.`{$join->parentTable}`.`{$join->parentField}`\";\n if ($join->additionalCondition) {\n $this->query .= \" \".$join->additionalCondition;\n }\n }\n }\n }",
"public function InnerJoin()\n\t\t{\n\t\t\treturn $this->AddSubComponent(ExtensionsHandler()->ExtendableObject('\\DaFramework\\Model\\Abstraction\\InnerJoin'));\n\t\t}",
"protected function _buildJoin () {\r\n if (empty ($this->_join))\r\n return;\r\n\r\n foreach ($this->_join as $data) {\r\n list ($joinType, $joinTable, $joinCondition) = $data;\r\n\r\n if (is_object ($joinTable))\r\n $joinStr = $this->_buildPair (\"\", $joinTable);\r\n else\r\n $joinStr = $joinTable;\r\n\r\n $this->_query .= \" \" . $joinType. \" JOIN \" . $joinStr .\" on \" . $joinCondition;\r\n\r\n // Add join and query\r\n if (!empty($this->_joinAnd) && isset($this->_joinAnd[$joinStr])) {\r\n foreach($this->_joinAnd[$joinStr] as $join_and_cond) {\r\n list ($concat, $varName, $operator, $val) = $join_and_cond;\r\n $this->_query .= \" \" . $concat .\" \" . $varName;\r\n $this->conditionToSql($operator, $val);\r\n }\r\n }\r\n }\r\n }",
"function summary_join() {\n $field = $this->handler->table . '.' . $this->handler->field;\n $join = $this->get_join();\n\n // shortcuts\n $options = $this->handler->options;\n $view = &$this->handler->view;\n $query = &$this->handler->query;\n\n if (!empty($options['require_value'])) {\n $join->type = 'INNER';\n }\n\n if (empty($options['add_table']) || empty($view->many_to_one_tables[$field])) {\n return $query->ensure_table($this->handler->table, $this->handler->relationship, $join);\n }\n else {\n if (!empty($view->many_to_one_tables[$field])) {\n foreach ($view->many_to_one_tables[$field] as $value) {\n $join->extra = array(\n array(\n 'field' => $this->handler->real_field,\n 'operator' => '!=',\n 'value' => $value,\n 'numeric' => !empty($this->definition['numeric']),\n ),\n );\n }\n }\n return $this->add_table($join);\n }\n }",
"private function join_associations_table( $join ) {\n\t\t$association_table = $this->get_table_names()->association_table();\n\t\t$posts_table_name = $this->wpdb->posts;\n\t\t$target_element_column = $this->target_role->get_name() . '_id';\n\t\t$for_element_column = $this->target_role->other() . '_id';\n\n\t\t$join .= $this->wpdb->prepare(\n\t\t\t\" LEFT JOIN {$association_table} AS toolset_associations ON ( \n\t\t\t\ttoolset_associations.relationship_id = %d\n\t\t\t\tAND toolset_associations.{$target_element_column} = {$posts_table_name}.ID\n\t\t\t\tAND toolset_associations.{$for_element_column} = %d\n\t\t\t) \",\n\t\t\t$this->relationship->get_row_id(),\n\t\t\t$this->for_element->get_default_language_id()\n\t\t);\n\n\t\treturn $join;\n\t}",
"private function buildJoin()\n {\n if (empty($this->join)) {\n return;\n }\n\n foreach ($this->join as $data) {\n list ($joinType, $joinTable, $joinCondition) = $data;\n\n if (is_object($joinTable)) {\n $joinStr = $this->buildPair(\"\", $joinTable);\n } else {\n $joinStr = $joinTable;\n }\n\n $this->query .= \" \".$joinType.\" JOIN \".$joinStr.\n (false !== stripos($joinCondition, 'using') ? \" \" : \" ON \")\n .$joinCondition;\n }\n }",
"#[@arg]\n public function setJoin() {\n $this->criteria->setFetchmode(Fetchmode::join('Person'));\n }",
"private function sql_join() {\n $sql = '';\n foreach ($this->query['join'] as $value) {\n $sql .= $value['type'] . ' JOIN ' . $value['table'] . ' ON ' . $value['condition'] . ' ';\n }\n return $sql;\n }",
"abstract function appendJoin(AbstractQuery &$query, $sourceAlias, $targetAlias, $left_join = false);",
"public function joinFoo()\n {\n $this->db->join($this->M_foo->table, \"{$this->M_foo->table}.{$this->M_foo->primaryKey} = {$this->table}.foo_id\");\n }",
"function join($column,$filter,$foreign_column, $kind='inner', $filter_in_join=false)\n \t{\n \t\t$this->joins[]=new Join($column,$filter,$foreign_column,$kind, $filter_in_join);\n \t}",
"public function addJoin(JoinQueryComponent $component) { $this->joins[] = $component; }",
"public function add_lang_join($sql)\n {\n // Inject the additional relationship query\n $sql = str_replace('FROM exp_channel_titles', 'FROM exp_channel_titles LEFT JOIN exp_transcribe_entries_languages tel ON tel.entry_id = exp_channel_titles.entry_id', $sql);\n return $sql;\n }",
"public function joinTaliasih()\n \t{\n \t\t$this->db->select('*');\n\t\t$this->db->from('taliasih');\n\t\t$this->db->join('pkwt', 'pkwt.id_karyawan = taliasih.id_karyawan');\n\t\t$query = $this->db->get();\n\t\treturn $query ;\n \t}",
"public function joinFields()\n {\n\t\t$this->getSelect()\n\t\t ->join(\n array('mad' => $this->getTable('magebid/auction_detail')), \n 'mad.magebid_auction_detail_id = main_table.magebid_auction_detail_id')\t\n\t\t ->join(\n array('mat' => $this->getTable('magebid/auction_type')), \n 'mat.magebid_auction_type_id = main_table.magebid_auction_type_id');\t\t\t\t\t\n\t\t//echo $this->getSelect()->__toString();\n }",
"private static function sqlJoining() : string {\n $relations = self::getsRelationsHasOne();\n\n $baseTable = static::tableName();\n $baseProperties = self::getProperties();\n foreach ($baseProperties as &$property) {\n $property = $baseTable . '.' . $property;\n }\n $colsFromBaseTabel = implode(', ', $baseProperties);\n $colsFromJoinedTables = '';\n foreach ($relations as $relation) {\n $modelNamespace = '\\\\' . $relation['model'];\n $modelTableName = $modelNamespace::tableName();\n $modelProperties = $modelNamespace::getProperties();\n foreach ($modelProperties as $key => &$value) {\n $value = $modelTableName . '.' . $value . ' AS ' . $modelTableName . '_' . $value;\n }\n $colsFromJoinedTables .= ', ' . implode(', ', $modelProperties);\n\n }\n $sql = 'SELECT ' . $colsFromBaseTabel . ' ' . $colsFromJoinedTables . ' FROM ' . $baseTable;\n\n foreach ($relations as $relation) {\n $modelNamespace = '\\\\' . $relation['model'];\n $modelTableName = $modelNamespace::tableName();\n $sql .= ' INNER JOIN ' . $modelTableName . ' ON ' . $baseTable . '.' . $relation['column'] . ' = ' . $modelTableName . '.' . $relation['joined-table-column'];\n }\n\n return $sql . ' WHERE ' . $baseTable . '.';\n }",
"public function join()\n\t{\n\t\t// We do a left outer join here because we're not trying to limit the primary table's results\n\t\t// This function is primarily used when needing to sort by a field in the joined table\n\t\t$this->model->select($this->model->getQualifiedFieldName('*'))\n\t\t ->select($this->related->getQualifiedFieldName('*'))\n\t\t ->join($this->associativeTable,\n\t\t $this->model->getQualifiedFieldName($this->localKey),\n\t\t $this->associativeLocal,\n\t\t 'LEFT OUTER')\n\t\t ->join($this->related->getTableName(),\n\t\t $this->associativeRelated,\n\t\t $this->related->getQualifiedFieldName($this->relatedKey),\n\t\t 'LEFT OUTER');\n\n\t\treturn $this;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Renders a single radio button and its label. This is consumed by the createRadioSet() function but may also be called separately to create radio buttons that are not immediately next to each other. | static public function createOneRadioButton( $aWidgetName, $aValue,
$aLabel=null, $isSelected=false, $showLabel=self::ALIGN_LEFT,
$aJavaScript=null )
{
$theHTML = '' ;
$theLabel = ( empty($aLabel) ? $aValue : $aLabel ) ;
if( $showLabel == self::ALIGN_LEFT )
$theHTML .=
self::createRadioButtonLabel($aWidgetName,$aValue,$theLabel) ;
$theHTML .= self::createRadioButtonTag( $aWidgetName, $aValue,
$isSelected, $aJavaScript ) ;
if( $showLabel == self::ALIGN_RIGHT )
$theHTML .=
self::createRadioButtonLabel($aWidgetName,$aValue,$theLabel) ;
return $theHTML ;
} | [
"protected function radioButton( ) {\r\n if( isset( $this->htmlOptions[\"labelOptions\"] ) ) {\r\n $labelOptions = $this->htmlOptions[\"labelOptions\"];\r\n unset( $this->htmlOptions[\"labelOptions\"] );\r\n } else {\r\n $labelOptions = array( );\r\n }\r\n\r\n $label = null;\r\n if( isset( $labelOptions[\"label\"] ) ) {\r\n $label = $labelOptions[\"label\"];\r\n unset( $labelOptions[\"label\"] );\r\n }\r\n if( !isset( $labelOptions[\"for\"] ) ) {\r\n $labelOptions[\"for\"] = CHtml::getIdByName( CHtml::resolveName( $this->model, $this->attribute ) );\r\n }\r\n echo CHtml::openTag( \"label\", $labelOptions );\r\n echo $this->form->radioButton( $this->model, $this->attribute, $this->htmlOptions ).PHP_EOL;\r\n if( $label !== null ) {\r\n if( $label !== false ) {\r\n echo $label;\r\n }\r\n } else {\r\n echo $this->model->getAttributeLabel( $this->attribute );\r\n }\r\n echo $this->getError( ).$this->getHint( );\r\n echo '</label>';\r\n }",
"public function renderRadio()\n {\n if (isset($this->radio)) {\n return $this->radio;\n }\n }",
"public function radio(): string\n {\n return $this->_renderCheckboxOrRadio();\n }",
"protected function setRadio()\n {\n $id = strtolower($this->displayText);\n $checked = $this->selected ? \" checked='checked'\" : \"\";\n $this->radio = \"<input type='radio'{$checked} id='pcnav_{$id}' class='pcnav_button' name='viewtype' value='{$id}' />\n <label class='tooltips' title='$this->imageTitleText' for='pcnav_{$id}'>{$this->displayText}</label>\n <input type='hidden' id='pcnav_url_{$id}' value='{$this->getUrl(null, true)}' />\";\n }",
"private function prepareRadioButtons(){\n\t\t$selectedOption = $this->selectedOptions;\n\t\t$optionsArray = (array)$this->options;\n\t\t$selected = '';\n\t\n\t\tforeach($optionsArray as $option=>$optionText){\n\t\t\tif($selectedOption == $option){ $selected = ' checked '; }\n\t\t\telse{ $selected = ''; }//end if\n\t\t\t\t\n\t\t\techo '<input type = \"radio\" ';\n\t\t\techo ' name = \"'.$this->name.'\" ';\n\t\t\techo (isset($this->settings['id']))? ' id = \"'.$this->settings['id'].'\" ':null;\n\t\t\techo (isset($this->settings['style']))? $this->settings['style']:null;\n\t\t\techo (isset($this->settings['disabled']) && $this->settings['disabled'])? ' disabled=\"disabled\" ':null;\n\t\t\techo ' value = \"'.$option.'\" ';\n\t\t\techo $selected;\n\t\t\techo ' >'.$optionText.'<br>';\n\t\t}//end foreach\n\t}",
"function _renderRadio($element) {\n $messages = $this->getMessagesFor($element->getName());\n $hasMessages = count($messages) > 0 ? TRUE : FALSE;\n\n $divError = $hasMessages ? \"has-error\" : \"\";\n $html = \"<div class=\\\"radio {$divError}\\\">\";\n $html .= \"<label for=\\\"{$element->getName()}\\\">{$this->render($element->getName())} {$element->getLabel()}</label>\";\n if ($hasMessages)\n $html .= \"<span class=\\\"help-block\\\">{$messages[0]}</span>\";\n $html .= \"</div>\";\n return $html;\n }",
"function wh_draw_radio_field_label($name, $id, $label, $label_id = '', $value = '',\n\t\t$checked = false, $parameters = '', $parameters_label = '', $indent = 0, $newline = false) {\n return wh_draw_selection_field_label($name, 'radio', $id, $label, $label_id = '',\n\t\t\t$value, $checked, $parameters, $parameters_label, $indent, $newline);\n }",
"private function radioCustomField(): string\n {\n $value = $this->getValue($this->index);\n foreach($this->options as &$option) {\n if($option['key'] == $value) {\n $option['checked'] = true;\n break;\n }\n }\n\n return Template::build($this->getTemplatePath('radio.html'), [\n 'id' => uniqid(\"{$this->id}-\", true),\n 'name' => $this->id,\n 'label' => $this->label,\n 'options' => $this->options,\n 'index' => isset($this->index) ? $this->index : false\n ]);\n }",
"abstract protected function radioButtonListInline();",
"protected function radioButtonList( ) {\r\n $this->field( $this->form->radioButtonList( $this->model, $this->attribute, $this->data, $this->htmlOptions ) );\r\n }",
"public function radioLabel($attribute,$label,array $options=array(),$formItem='')\n\t{\n\t\treturn '<label'.$this->getHtmlOptions($options).'>'.$formItem.$label.'</label>';\n\t}",
"function radio_tag($name = '', $value = '', $label = '', $options = array()) {\n $option = $this->_process_options($options);\n $data = \"<input type=\\\"radio\\\" name=\\\"$name\\\" value=\\\"$value\\\"$option>\";\n $data.= ($label) ? \"<label for=\\\"$name\\\">$label</label>\" : '';\n return $data;\n }",
"public function showRadio()\n {\n echo <<<'NOW'\n<form action=\"#\" method=\"post\">\n<fieldset>\n<p>\n <label for=\"toujours\">Toujours</label>\n <input id=\"toujours\" type=\"radio\" name=\"RADIO\" value=\"Toujours\" />\n</p>\n<p>\n <label for=\"jamais\">Jamais</label>\n <input id=\"jamais\" type=\"radio\" name=\"RADIO\" value=\"Jamais\" />\n</p>\n<p>\n <label for=\"aucun\">Aucun</label>\n <input id=\"aucun\" type=\"radio\" name=\"RADIO\" value=\"Aucun\" />\n</p>\n</fieldset>\n</form>\nNOW; \n }",
"function radio_button($object_name, $column_name = null, $tag_value, $tag_options = array(), $options = array())\n {\n $options = array_merge(array('tag_value' => $tag_value), $options);\n return $this->_field('radio_button', $object_name, $column_name, $tag_options, $options);\n }",
"static function radio( $element )\n\t\t{\t\n\t\t\t$output = \"\";\n\t\t\t$counter = 1;\n\t\t\tforeach($element['options'] as $key => $radiobutton)\n\t\t\t{\t\n\t\t\t\t$checked = \"\";\n\t\t\t\tif( $element['std'] == $key ) { $checked = 'checked = \"checked\"'; }\n\t\t\t\t\n\t\t\t\t$output .= '<span class=\"avia_radio_wrap\">';\n\t\t\t\t$output .= '<input '.$checked.' type=\"radio\" class=\"radio_'.$key.'\" ';\n\t\t\t\t$output .= 'value=\"'.$key.'\" id=\"'.$element['id'].$counter.'\" name=\"'.$element['id'].'\"/>';\n\t\t\t\t\n\t\t\t\t$output .= '<label for=\"'.$element['id'].$counter.'\"><span class=\"labeltext\">'.$radiobutton.'</span>';\n\t\t\t\tif(!empty($element['images'][$key])) $output .= \"<img class='radio_image' src='\".$element['images'][$key].\"' />\";\n\t\t\t\t$output .= '</label>';\n\t\t\t\t$output .= '</span>';\n\t\t\t\t\n\t\t\t\t$counter++;\n\t\t\t}\t\n\t\t\t\t\n\t\t\treturn $output;\n\t\t}",
"public function testAddRadioButtonWithOneRadioButtonSelected()\n {\n $radioButtonCollection = new RadioButtonCollection('foo');\n $radioButtonCollection->addRadioButton(new RadioButton('', 'None'));\n $radioButtonCollection->addRadioButton(new RadioButton('1', 'One'));\n\n self::assertSame('<input type=\"radio\" name=\"foo\" value=\"\" checked>None<input type=\"radio\" name=\"foo\" value=\"1\">One', $radioButtonCollection->getHtml());\n self::assertSame('<input type=\"radio\" name=\"foo\" value=\"\" checked>None<input type=\"radio\" name=\"foo\" value=\"1\">One', $radioButtonCollection->__toString());\n }",
"function tpl_form_radiobutton($name, $selected, $value = 1, $id = null, $attrib = null) {\n\t$result = \n\t\t'<input type=\"radio\" name=\"'.$name.'\" value=\"'.tpl_attribute($value).\n\t\t'\" id=\"'.tpl_attribute(null!=$id?$id:$name.\"[$value]\").'\"';\n\tif (null != $attrib)\n\t\t$result .= ' '.tpl_html_implode($attrib);\n\tif ($value == $selected)\n\t\t$result .= ' checked=\"checked\"';\n\treturn $result.' />';\n}",
"public function testRenderSimple(): void\n {\n $label = new NestingLabelWidget($this->templates);\n $radio = new RadioWidget($this->templates, $label);\n $data = [\n 'name' => 'Crayons[color]',\n 'label' => null,\n 'options' => ['r' => 'Red', 'b' => 'Black'],\n ];\n $result = $radio->render($data, $this->context);\n $expected = [\n ['label' => ['for' => 'crayons-color-r']],\n ['input' => [\n 'type' => 'radio',\n 'name' => 'Crayons[color]',\n 'value' => 'r',\n 'id' => 'crayons-color-r',\n ]],\n 'Red',\n '/label',\n ['label' => ['for' => 'crayons-color-b']],\n ['input' => [\n 'type' => 'radio',\n 'name' => 'Crayons[color]',\n 'value' => 'b',\n 'id' => 'crayons-color-b',\n ]],\n 'Black',\n '/label',\n ];\n $this->assertHtml($expected, $result);\n\n $data = [\n 'name' => 'Crayons[color]',\n 'options' => new Collection(['r' => 'Red', 'b' => 'Black']),\n ];\n $result = $radio->render($data, $this->context);\n $this->assertHtml($expected, $result);\n }",
"function agc_custom_xprofile_radio_button($html, $option, $field_id, $selected, $index )\n{\n\tglobal $field;\n\t$field_data = bp_get_profile_field_data( array('field' => $field_id, 'user_id' => bp_loggedin_user_id()));\n\t$selected = ( $option->name == $field_data )?' checked=\"checked\"':'';\n\t$required = ($field->is_required)?'required':'';\n\treturn '<label class=\"radio\"><input' . $selected . ' type=\"radio\" class=\"'.$required.'\" name=\"field_' . $field_id . '\" id=\"option_' . $option->id . '\" value=\"' . esc_attr( stripslashes( $option->name ) ) . '\"> ' . esc_attr( stripslashes( $option->name ) ) . '</label>';\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Failure message life time Indicates how long message in ERROR state will stay in table with statuses | private function getErrorMessageLifetime()
{
return 60 * (int)$this->scopeConfig->getValue(
self::XML_PATH_FAILED_MESSAGES_LIFETIME,
\Magento\Store\Model\ScopeInterface::SCOPE_STORE
);
} | [
"public function testJobFailureLogsReason()\n {\n $this->assertRecordsCount(0);\n\n $this->assertEquals(1, $this->dispatcher->dispatch(new Failing()));\n\n $next_in_line = $this->dispatcher->getQueue()->nextInLine();\n\n $this->assertInstanceOf('ActiveCollab\\JobsQueue\\Test\\Jobs\\Failing', $next_in_line);\n $this->assertEquals(1, $next_in_line->getQueueId());\n\n $this->dispatcher->getQueue()->execute($next_in_line);\n\n $this->assertEquals('ActiveCollab\\JobsQueue\\Test\\Jobs\\Failing', $this->last_failed_job);\n $this->assertEquals('Built to fail!', $this->last_failure_message);\n\n $this->assertEquals(0, $this->dispatcher->getQueue()->count());\n $this->assertEquals(1, $this->dispatcher->getQueue()->countFailed());\n\n $this->assertEquals('Built to fail!', $this->connection->executeFirstCell('SELECT `reason` FROM `' . MySqlQueue::FAILED_JOBS_TABLE_NAME . '` WHERE `id` = ?', 1));\n }",
"public function getFailureMessage();",
"public function testContainerFailReasonForStatusTooLong()\r\n {\r\n\r\n $this->container->setReasonForStatus(str_repeat(\"a\",260));\r\n\r\n // Attempt to validate the container\r\n $error = $this->validator->validate($this->container);\r\n\r\n // Assert that there is one error\r\n $this->assertEquals(1, count($error));\r\n }",
"public static function FAIL_MSG()\r\n {\r\n return new EventType(4);\r\n }",
"public function getTimeoutFailureInfo()\n {\n return $this->readOneof(6);\n }",
"public function fail_interval()\n\t{\n\t\treturn $this->fail_interval;\n\t}",
"public function faultyMessages();",
"public function testIsTimeoutReached() {\n $message = $this->_createMessage();\n $this->assertFalse($message->isTimeoutReached());\n // TODO set start time and test true state\n }",
"public function getFailureReason()\n {\n return $this->failure_reason;\n }",
"protected function getTimeError()\n {\n return intval($this->getConfigValue('max_time_error'));\n }",
"public function fail(){\n\t\t$this->_status = self::STATUS_FAILED;\n\t\t$this->update();\n\t}",
"public function get_failed_count();",
"public function getLastErrorMessage() {}",
"public function getFailureMessage()\n {\n return $this->failure_message;\n }",
"public function failed(): self\n {\n return new Status($this->config, $this->failures + 1, time());\n }",
"public function getLastFailedLoginTime();",
"public function failed()\n {\n // Called when the job is failing...\n }",
"public function getPasswordErrorTime()\n {\n return $this->getAttribute('badPasswordTime');\n }",
"public function failureMessage($description);"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get this user's basestation | public function basestation()
{
return $this->hasOne('Basestation');
} | [
"public function getStBaseInfo()\n {\n return $this->get(self::STBASEINFO);\n }",
"public function getUrlBaseUser()\n {\n return $this->url_base_user;\n }",
"public function getBaseSecu() {\n return $this->baseSecu;\n }",
"protected function getAuthBase() {\n $region = $this->client->getClassConfig($this, 'region');\n if ($region == BattleNet_Config::REGION_CN) {\n return self::BATTLENET_URL_BASE_CHINA;\n }\n return str_replace('{region}', $region, self::BATTLENET_URL_BASE);\n }",
"public function baseAccount()\n {\n return $this->account->baseAccount();\n }",
"public function getSalaireBase() {\n return $this->salaireBase;\n }",
"public function getLoginBase()\n\t{\n\t\treturn $this->application->getLoginBase();\n\t}",
"public function getBaseDn()\n {\n return $this->base_dn;\n }",
"public function getBaseDn() {\r\n\t\treturn $this->_config['base_dn'];\r\n\t}",
"function get_base_id()\n\t{\n\t\treturn( $this->base_id );\n\t}",
"public function getBaseDn()\n {\n return $this->properties['baseDn'];\n }",
"public function get_base_path() {\n\t\treturn self::$_base_path;\n\t}",
"public function get_base_uri()\n\t{\n\t\treturn $this->base_url;\n\t}",
"public function getBaseId()\n\t{\n\t\treturn $this->base_id;\n\t}",
"public function get_base_name(){\n return $this->get_info('player_base_name');\n }",
"public static function get_base_path_network() {\n\t\tglobal $wpdb;\n\t\tif ( defined( 'PATH_CURRENT_SITE' ) ) {\n\t\t\treturn PATH_CURRENT_SITE;\n\t\t} else {\n\t\t\treturn $wpdb->get_var( \"SELECT `path` FROM `{$wpdb->prefix}blogs` WHERE `blog_id` = 1\" );\n\t\t}\n\t}",
"public function getBaseId()\n {\n return $this->baseId;\n }",
"public function anyEstablishBase()\n\t{\n\t\t// If you are in a certain proximity to a current base, then\n\t\t// you are re-establishing it, or resetting it's expiration\n\t\t//\n\t\t// Require\n\t\t// - Long/Lat\n\n\t\ttry {\n\t\t\t$base = $this->service->userEstablishesBase();\n\t\t} catch (Exception $e) {\n\t\t\treturn $this->_response_exception($e);\n\t\t}\n\n\t\treturn $this->_response_success($this->_formatBase($base));\n\t}",
"public function findBaseDn() \n {\n $namingContext = $this->getRootDse(array('defaultnamingcontext')); \n return $namingContext[0]['defaultnamingcontext'][0];\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
fungsi getImg:: to get Image by Id_img | public function getImg($id_img){
$query = "SELECT
A.id_img,
A.img_caption,
A.id_member,
A.img_name,
A.img_alt,
A.date_create,
A.last_update,
C.profile_pic,
C.username
FROM me_img AS A
INNER JOIN tbl_member as C
ON A.id_member = C.id_member
WHERE A.id_img = $id_img AND A.active = '1'";
if($id_img == '' || $id_img == NULL){
return false;
}
else{
$get = $this->db->query($query);
$get = $get->result();
if(count($get) > 0 ){
$where = array('id_gallery' => $get[0]->profile_pic);
$getGallery = $this->getAll('tbl_gallery',$where,array('pic','thumb1'));
$get[0]->display_picture = (count($getGallery) > 0 ? $getGallery[0]->pic : '');
}
return $get;
}
} | [
"public function getById($image_id);",
"function get_image($id)\n {\n return $this->db->get_where('image',array('id'=>$id))->row_array();\n }",
"public function findImageById($id);",
"public function image_get($id = 0)\n {\n // Otherwise, a single image will be returned.\n $con = $id ? array('id' => $id) : array();\n // print_r($con);die;\n $images = $this->image->getRows($con);\n\n // Check if the image data exists\n if (!empty($images)) {\n // Set the response and exit\n //OK (200) being the HTTP response code\n $this->response($images, REST_Controller::HTTP_OK);\n } else {\n // Set the response and exit\n //NOT_FOUND (404) being the HTTP response code\n $this->response([\n 'status' => FALSE,\n 'message' => 'No image was found.'\n ], REST_Controller::HTTP_NOT_FOUND);\n }\n }",
"function getUrl($id_img){\n $sentencia = $this->db->prepare(\"SELECT url FROM imagen WHERE id_imagen = ?\");\n $sentencia->execute(array($id_img[0]));\n return $sentencia->fetch(PDO::FETCH_ASSOC);\n }",
"public function getimagebyid($id)\n{\n// return $query;\n}",
"function obtener_imagen_por_id($conexion, $id){\n\t$resultado = $conexion->query(\"SELECT * FROM galeria_img WHERE id = $id LIMIT 1\");\n\t$resultado = $resultado->fetchAll();\n\treturn ($resultado) ? $resultado : false;\n}",
"public function selecionarTodasImg($id){\r\n $resultado = $this->conexao->getConnection()->query(\"SELECT * FROM imagem WHERE ID_usuario=\".$id)\r\n or die ($this->conexao->getConnection()->error);\r\n return $resultado;\r\n }",
"function get_tbl_onfarm_img($id_img)\n {\n return $this->db->get_where('tbl_onfarm_img',array('id_img'=>$id_img))->row_array();\n }",
"static public function getImage($id) {\n return static::findOne(['id' => $id]);\n }",
"function usuario_img_get($id, $tipo = 'imagem'){\n\n $conn = TConnection::open(DB);\n\n $criterio = new TCriteria;\n $criterio->add(new TFilter('id_usuario', '=', $id));\n\n\n\n $sql = new TSqlSelect;\n $sql->setEntity('usuario_imagem');\n $sql->addColumn($tipo);\n if(isset($criterio)){\n $sql->setCriteria($criterio);\n }\n\n $result = $conn->query($sql->getInstruction());\n\n if($result->rowCount()){\n\n $row = $result->fetch(PDO::FETCH_ASSOC);\n extract($row);\n\n return '<img src=\"'.$$tipo.'\">';\n\n }else{\n return false;\n }\n\n}",
"public function getImageId ();",
"function get_image($id = null)\n {\n if ( ! $id ) {\n return;\n }\n return Cache::rememberForever('image-'.$id, function () use ($id) {\n $model = config('medialibrary.media_model');\n return $model::where('id', $id)->first();\t\n });\n }",
"public function getImageByIdKost($id)\n {\n $this->db->where('id_kost', $id);\n return $this->db->get('image')->result_array();\n }",
"public function read_img($id)\n {\n if ($id <= 0) return false;\n\n // Let's start from items\n $query = \"select * from `\".$this->db->dbprefix('shop_images').\"` where publish = 1 and id_item={$this->db->escape($id)};\";\n $sql = $this->db->query($query);\n if ($sql == false) return false;\n\t\treturn $sql->result();\n }",
"function find_img($txt)\n {\n $q = \"SELECT `img` FROM `\".$this->GetShowTable().\"` WHERE cod='\".$txt.\"' AND lang_id='\".$this->lang_id.\"' \";\n $this->db->db_Query($q);\n $row=$this->db->db_FetchAssoc();\n //echo '<br>q='.$q.' this->db->result='.$this->db->result.' row='.$row.' $row->name='.$row->name;\n return $row['img'];\n }",
"public function get($image);",
"public static function FindById($id){\r\n\t\t$query = new Query();\r\n\t\t$query->createSelect(array('*'), 'images', array(), 'id = \"'.$id.'\"');\r\n\t\t$imageArray = $query->execute();\r\n\t\t$image = false;\r\n\t\tif(!empty($imageArray)){\r\n\t\t\t$image = self::CreateObjectFromArray($imageArray);\r\n\t\t}\r\n\t\treturn $image;\r\n\t}",
"public function get_image_by_id($id){\n\t\t\t$sql = \"SELECT * FROM images WHERE id={$id}\";\n\t\t\t$result = $this->mysqli->query($sql);\n\t\t\tif($this->mysqli->error || $this->mysqli->errno){\n\t\t\t\techo \"Error getting gallery image: \" . $this->mysqli->error;\n\t\t\t\treturn false;\n\t\t\t}else{\n\t\t\t\tif($result->num_rows > 0){\n\t\t\t\t\t$row = $result->fetch_assoc();\n\t\t\t\t\treturn $row;\n\t\t\t\t}else{\n\t\t\t\t\t//no rows returned\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Display Matches of Tournament | public static function displayMatches($competition, $echo = true)
{
$html = '<table class="table table-striped table-bordered">
<tbody>';
foreach ($competition->rounds as $round) {
$html .= '<tr>
<td colspan="4"><strong>' . CHtml::encode($round->name) . '</strong> (' . $round->start_datetime . ' to ' . $round->finish_datetime . ')</td>
</tr>';
foreach ($round->ties as $tie) {
switch ($tie->type) {
case 'match':
$home = CHtml::encode($tie->homeClub ? "{$tie->homeClub->club->name} ({$tie->homeClub->club->manager})" : '');
$away = CHtml::encode($tie->awayClub ? "{$tie->awayClub->club->name} ({$tie->awayClub->club->manager})" : '');
if (!$home) {
if ($tie->homeTie->type == 'bye') {
$home = $tie->homeTie->homeClub->club->name;
} else {
$home = "Winner of {$tie->homeTie->name}";
}
}
if (!$away) {
if ($tie->awayTie->type == 'bye') {
$away = $tie->awayTie->homeClub->club->name;
} else {
$away = "Winner of {$tie->awayTie->name}";
}
}
$html .= '<tr>
<td class="span2">' . CHtml::encode($tie->name) . '</td>
<td class="span4">' . $home . '</td>
<td class="span2">vs</td>
<td class="span4">' . $away . '</td>
</tr>';
break;
}
}
}
$html .= '</tbody>
</table>';
if ($echo) {
echo $html;
}
return $html;
} | [
"public function displayMatches()\n {\n echo \"<h1>List of matches found</h1>\";\n print_r($this->matches);\n }",
"private function showGameResult()\n {\n $gameWinningPlayers = [];\n foreach ($this->players as $player) {\n if (count($gameWinningPlayers) === 0) {\n // Initialize with the first player\n $gameWinningPlayers[] = $player;\n\n } else if ($gameWinningPlayers[0]->getScore() < $player->getScore()) {\n // Reset the list of winning players with the current player\n $gameWinningPlayers = [$player];\n\n } elseif ($gameWinningPlayers[0]->getScore() === $player->getScore()) {\n // Add the current player to the list of winning players\n $gameWinningPlayers[] = $player;\n }\n }\n\n echo 'Résultat de la partie : ';\n echo self::playersResultToString($gameWinningPlayers); \n echo \"\\n\";\n }",
"public function index()\n {\n\n $teams = TeamSettings::where('league_id', 1)->get();\n $weeks = Week::all();\n\n $total_weeks = [];\n foreach ($weeks as $week){\n $total_weeks[] = $week->id;\n }\n\n //get exact number of teams in the league\n $total_teams = count($teams);\n\n $teamNamesMap = [];\n foreach ($teams as $team) {\n $teamNamesMap[$team->id] = $team->team_name;\n }\n\n //define total rounds and number of matches per round\n $total_rounds = 5; //(fixed for now)\n $matchesPerRound = $total_teams / 2;\n $rounds = array();\n\n //generate fixtures\n for ($i = 0; $i < $total_rounds; $i++) {\n $rounds[$i] = array();\n }\n\n\n for ($round = 0; $round < $total_rounds; $round++) {\n for ($match = 0; $match < $matchesPerRound; $match++) {\n $home = ($round + $match) % ($total_teams - 1);\n $away = ($total_teams - 1 - $match + $round) % ($total_teams - 1);\n if ($match == 0) {\n $away = $total_teams - 1;\n }\n $rounds[$round][$match] = $teamNamesMap[($home + 1)] .\" vs \" . $teamNamesMap[($away + 1)];\n }\n\n }\n\n\n $smthn = count($rounds);\n\n\n\n return view('matchups', compact('rounds', 'smthn', 'teamNamesMap', 'weeks'));\n }",
"function printMatches() {\n\t\techo '<br><br><h1>Meet '.$this->UserRow1['first_name'].' &\n'.$this->UserRow2['first_name'].'</h1><br>';\n\t\t$matchSet = new profileMatcher($this->UserRow1['user_id'],\n$this->UserRow2['user_id']);\n\t\t$matchSet->doMatch();\n\tforeach (array($this->UserRow1, $this->UserRow2) as $row) {\n\t\t$charities = $matchSet->setCharitySet($row['user_id']); \n\t\t$turnred = $matchSet->getMatchArray();\n\t\t//print_r($charities);\n\t\tif (! empty($charities)) {\n\t\t\techo ' <div class=\"row\">';\n\t\t$url = $this->setGravURL($row);\n\t\techo '\n <div class=\"span6\">\n\t\t\t<img src=\"'.$url.'\"/>\n <div>\n\t\t\t <h2>'.$row['username'].'</h2>';\n\t\tforeach ($charities as $c) {\n\t\t\tif (in_array($c, $turnred)) {\n\t\t\t\techo '<span class=\"label label-important\"><h4> \n'.$c.' </h4></span><br><br>';\n\t\t}\n\t\telse {\n\t\t\t\techo '<span\nclass=\"label\"><h4> '.$c.' </h4></span><br><br>';\n\t\t}\t\t\n}\n\techo '\t\n\t\t</div>\n\t\t</div>';\n\t}\n\t}\n\techo '</div>';\n}",
"public function listMatches()\n {\n $teams = DB::table('matches')\n ->leftJoin('teams as first', 'matches.first_team_id', '=', 'first.id')\n ->leftJoin('teams as second', 'matches.second_team_id', '=', 'second.id')\n ->select([\n 'matches.id',\n 'first.name as first_team',\n 'second.name as second_team'\n ])\n ->paginate(10);\n\n return $teams;\n }",
"public function leagueResults() {\r\n\t\t//set view\r\n\t\t$this->input->set('view', 'leagueresults');\r\n\t\t\r\n\t\t// bind the 'team' model to the view as the default model\r\n\t\t$view = $this->getView('leagueresults', 'raw');\r\n\t\t$view->setModel($this->getModel('team'), true);\r\n\r\n\t\t// set the layout of the view\r\n\t\t$layout = $this->input->get('layout');\r\n\t\t$view->setLayout($layout);\r\n\t\t\r\n\t\t$view->display();\r\n\t}",
"public function actionIndex() {\n $searchModel = new TournamentSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }",
"function nbaleague_get_matches_table($division_id, $season_id, $league_id)\r\n{\r\n $matches = nbaleague_get_matches_from_data(array(\r\n 'league_id' => $league_id,\r\n 'season_id' => $season_id\r\n ));\r\n\r\n $league = nbaleague_get_league_by_id($league_id);\r\n $season = nbaleague_get_season_by_id($season_id);\r\n \r\n if (!$league || !$season) {\r\n drupal_not_found();\r\n drupal_exit();\r\n }\r\n \r\n $header = array(\r\n 'Team',\r\n 'Matches played',\r\n 'Games for',\r\n 'Games Against',\r\n 'Points'\r\n );\r\n\r\n return array(\r\n 'title' => array(\r\n '#type' => 'html_tag',\r\n '#tag' => 'h3',\r\n '#value' => t($league->name->value())\r\n ),\r\n 'intro' => array(\r\n '#type' => 'html_tag',\r\n '#tag' => 'p',\r\n '#value' => t('League table for the ' . $season->name->value() . ' season.')\r\n ),\r\n 'links' => _nbaleague_match_list_links(\r\n $matches,\r\n $division_id,\r\n $season_id,\r\n $league_id,\r\n 'list'\r\n ),\r\n 'matches' => array(\r\n '#markup' => theme_table(\r\n array(\r\n 'header' => $header,\r\n 'rows' => nbaleague_get_league_table_data($matches),\r\n 'attributes' => array(\r\n 'class' => array(\r\n 'c-table',\r\n 'c-table-bordered',\r\n 'c-table-fixed',\r\n 'c-table-striped'\r\n )\r\n ),\r\n 'caption' => '',\r\n 'colgroups' => array(),\r\n 'sticky' => false,\r\n 'empty' => 'No matches found'\r\n )\r\n )\r\n )\r\n );\r\n}",
"public function actionIndex()\n {\n $searchModel = new TournamentSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }",
"function leagueTableDisplay() {\n\tglobal $wpdb;\n\t//Grab all leagues within the DB\n\t$leagueResults = $wpdb->get_results(\"SELECT * FROM wp_term_taxonomy WHERE taxonomy='sp_league'\");\n\tforeach($leagueResults as $result) {\n\t\t//Grab league ID\n\t\t$league_id = $result->term_id;\n\t\t//Grab count of league participation\n\t\t$count = $result->count;\n\t\t//Grab the specific league\n\t\t$league_row = $wpdb->get_row(\"SELECT * FROM wp_terms WHERE term_id='$league_id'\");\n\t\t//If count exceeds participation limit then display that the tournament is full\n\t\tif ($count >= 10) {\n\t\t\techo \"<div class='competiton-card'><p class='leagueName'>\" . $league_row->name . \"</p><p class='count'>\" . $count . \" player(s)</p><p class='fullMessage'>Sorry, tournament is full</p></div>\";\n\t\t} else {\n\t\t\techo \"<div class='competiton-card'><p class='leagueName'>\" . $league_row->name . \"</p><p class='count'>\" . $count . \" player(s)</p><form action='http://staging-switchonsportnewsite.kinsta.cloud/play-now'><input type='submit' value='Join Now' /></form></div>\";\n\t\t}\n\t}\n}",
"public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $realMatches = $em->getRepository('StatsBundle:RealMatch')->findAll();\n\n return $this->render('realmatch/index.html.twig', array(\n 'realMatches' => $realMatches,\n ));\n }",
"public function tournamentList() {\n /** @var Tournament[] $tournaments */\n $tournaments = $this->entityManager->getRepository(\"Entity\\\\Tournament\")->findAll(); // Get all tournament registered\n echo $this->twig->render('admin/lists/tournaments.html.twig', ['tournaments' => $tournaments]);\n }",
"function show( $args, $assoc_args ) {\n $clubId = array_key_exists( 'clubId', $assoc_args ) ? $assoc_args[\"clubId\"] : 0;\n $eventId = array_key_exists( 'eventId', $assoc_args ) ? $assoc_args[\"eventId\"] : 0;\n\n $support = CmdlineSupport::preCondtion();\n if( 0 === $clubId || 0 === $eventId ) {\n list( $clubId, $eventId ) = $support->getEnvError();\n }\n\n $evts = Event::find( array( \"club\" => $clubId ) );\n $found = false;\n $target = null;\n if( count( $evts ) > 0 ) {\n foreach( $evts as $evt ) {\n $target = $support->getEventRecursively( $evt, $eventId );\n if( isset( $target ) ) {\n $found = true;\n break;\n }\n }\n if( $found ) {\n $club = Club::get( $clubId );\n $name = $club->getName();\n $evtName = $target->getName();\n $td = new TournamentDirector( $target );\n $brackets = $td->getBrackets();\n $umpire = $td->getChairUmpire();\n foreach( $brackets as $bracket ) {\n WP_CLI::line( '-');\n WP_CLI::line( sprintf( \"Matches for '%s' at '%s'\", $evtName, $name ) );\n $numRounds = $td->totalRounds();\n WP_CLI::line( sprintf( \"%s Bracket: %d Rounds\", $bracket->getName(), $numRounds ) );\n $matches = $bracket->getMatches();\n $items = array();\n foreach( $matches as $match ) {\n $round = $match->getRoundNumber();\n $mn = $match->getMatchNumber();\n $status = $umpire->matchStatusEx( $match )->toString();\n $score = $umpire->strGetScores( $match );\n $winner = $umpire->matchWinner( $match );\n $winner = is_null( $winner ) ? 'tba': $winner->getName();\n $home = $match->getHomeEntrant();\n $hname = !is_null( $home ) ? sprintf( \"%d %s\", $home->getPosition(), $home->getName() ) : 'tba';\n $hseed = !is_null( $home ) && $home->getSeed() > 0 ? $home->getSeed() : '';\n\n $visitor = $match->getVisitorEntrant();\n $vname = 'tba';\n $vseed = '';\n if( isset( $visitor ) ) {\n $vname = sprintf( \"%d %s\", $visitor->getPosition(), $visitor->getName() );\n $vseed = $visitor->getSeed() > 0 ? $visitor->getSeed() : '';\n }\n\n $cmts = $match->getComments();\n $cmts = isset( $cmts ) ? $cmts : '';\n $items[] = array( \"Round\" => $round\n , \"Match Number\" => $mn\n , \"Status\" => $status\n , \"Score\" => $score\n , \"Home Name\" => $hname\n , \"Home Seed\" => $hseed\n , \"Visitor Name\" => $vname\n , \"Visitor Seed\" => $vseed \n , \"Comments\" => $cmts\n , \"Winner\" => $winner );\n }\n WP_CLI\\Utils\\format_items( 'table', $items, array( 'Round', 'Match Number', 'Status', 'Score', 'Home Name', 'Home Seed', 'Visitor Name', 'Visitor Seed', 'Comments', 'Winner' ) );\n }\n WP_CLI::success(\"Done!\");\n }\n else {\n WP_CLI::warning( \"tennis display tourney show ... could not event with Id '$eventId' for club with Id '$clubId'\" );\n }\n }\n else {\n WP_CLI::warning( \"tennis display tourney show ... could not any events for club with Id '$clubId'\" );\n }\n }",
"function getTournamentMatches($tournament_key,$round_key){\n\t\t$url = 'tournament/' .$tournament_key.'/matches/'.$round_key;\n\t\t$response = $this->getData($url);\n\t\treturn $response;\n\t}",
"public function index()\n {\n $matches = $this->matchService->listMatches();\n\n return view('matches.index', compact('matches'));\n }",
"public function index()\n\t{\n\t\t$matches = Match::all();\n\n\t\treturn View::make('matches.index', compact('matches'));\n\t}",
"function theme_tourney_match_fix($vars) {\n $element = $vars['element'];\n\n // Get the keys of the game form elements in this match render element\n // @see tourney_match_form().\n $children = element_children($element);\n\n // Initialize the header and rows\n $header = array('Team Name');\n $rows = array();\n\n // Loop through all the games that have started.\n for ($gn = 0; $gn < $element['#games']; $gn++) {\n $header[] = \"Game \" . ($gn + 1);\n\n if ($gn < count($children)) {\n // Get the form element for this game number.\n $game = $element[$children[$gn]];\n foreach (element_children($game) as $user) {\n if (!isset($rows[$user])) {\n $rows[$user][] = $game[$user]['#title'];\n }\n // Render the form element as a column in this row of the table.\n $rows[$user][] = drupal_render($game[$user]);\n }\n }\n else {\n foreach ($rows as $id => &$row) {\n $row[] = ' - ';\n }\n }\n }\n\n $header[] = \"Results\";\n foreach ($rows as $id => &$row) {\n $row[] = ' - ';\n }\n\n if (!$rows) return null;\n\n return theme('table', array(\n 'attributes' => array('id' => 'game-list'),\n 'header' => $header,\n 'rows' => $rows,\n ));\n}",
"public function listMatchs()\n {\n $errors = [];\n $success = [];\n\n\n $idUser = $_SESSION['user']['idCompte'];\n\n /** @var $compte Compte */\n $compte = Compte::getById($idUser);\n $animals = $compte->matchedAnimals();\n\n $this->render('memberArea/listMatchs', ['animals' => $animals]);\n }",
"public function doEverything() {\n //create first matches\n $currentMatches = $this->createFirstMatches();\n //put first matches results\n foreach ($currentMatches as $currentMatch) {\n $this->putResults($currentMatch);\n }\n //generate semi finals\n $currentSemiMatches = $this->createSemiFinals($currentMatches);\n //put semi finals results\n foreach ($currentSemiMatches as $currentMatch) {\n $this->putResults($currentMatch);\n }\n //generate finals\n $finals = $this->createFinals($currentSemiMatches);\n //put finals results\n foreach ($finals as $final) {\n $this->putResults($final);\n }\n //get the winner \n if ($finals[0]->getResultOne() < $finals[0]->getResultTwo()) {\n $winner = $this->teamRepository->getTeam('WHERE team_id =' . \n $this->matchRepository->getMatch('WHERE match_id =' . \n $finals[0]->getId())->getTeamTwo())->getName();\n } else {\n $winner = $this->teamRepository->getTeam('WHERE team_id =' . \n $this->matchRepository->getMatch('WHERE match_id =' . \n $finals[0]->getId())->getTeamOne())->getName();\n }\n require_once 'src/View/Match/show.php';\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Suspend customer account customer | public function suspend_customer($user_id,$action){
if($action == "suspend"){
$data = array(
'status' => 0
);
}else if($action == "unsuspend"){
$data = array(
'status' => 1
);
}
$this->db->where('user_id',$user_id);
return $this->db->update('users',$data);
} | [
"public function suspendAction(){\n\n $transactionId = $this->getRequest()->get('id');\n $orderId = $this->getRequest()->get('orderId');\n $suspendDate = $this->getRequest()->getPost('suspendDate');\n\n if (!$transactionId || !$orderId || !$suspendDate) {\n $this->_redirectReferer();\n }\n\n Mage::getModel('wezz_yehhpay/api_transaction')->transactionSuspend($transactionId, $suspendDate, $orderId);\n\n $this->_redirectReferer();\n }",
"public function canCustomerSuspend(){\n\t\treturn (boolean) $this->getSubscription()->getCanCustomerSuspend();\n\t}",
"public function ReactivateCustomerAccount()\n {\n \n # CHECK IF RECORD IS DEACTIVATED\n # ================================================\n $inactive = $this->CheckIfCustomerAccountActive();\n \n \n if ($inactive) {\n \n # DEACTIVATE contacts\n # ================================================\n $result = $this->SQL->UpdateRecord(array(\n 'table' => 'contacts',\n 'key_values' => \"`active`=1\",\n 'where' => \"`wh_id`=$this->wh_id AND `active`=0\",\n ));\n if ($this->Show_Query) echo '<br /><br />' . $this->SQL->Db_Last_Query;\n \n \n # DEACTIVATE contacts_account\n # ================================================\n $result = $this->SQL->UpdateRecord(array(\n 'table' => 'contacts_account',\n 'key_values' => \"`active`=1\",\n 'where' => \"`wh_id`=$this->wh_id AND `active`=0\",\n ));\n if ($this->Show_Query) echo '<br /><br />' . $this->SQL->Db_Last_Query;\n \n \n # DEACTIVATE contacts_billing_storage\n # ================================================\n $result = $this->SQL->UpdateRecord(array(\n 'table' => 'contacts_billing_storage',\n 'key_values' => \"`active`=1\",\n 'where' => \"`wh_id`=$this->wh_id AND `active`=0\",\n ));\n if ($this->Show_Query) echo '<br /><br />' . $this->SQL->Db_Last_Query;\n \n \n # DEACTIVATE customer_profile\n # ================================================\n $result = $this->SQL->UpdateRecord(array(\n 'table' => 'customer_profile',\n 'key_values' => \"`active`=1\",\n 'where' => \"`wh_id`=$this->wh_id AND `active`=0\",\n ));\n if ($this->Show_Query) echo '<br /><br />' . $this->SQL->Db_Last_Query;\n \n } else {\n echo \"<br /><div style='width:400px;'><h1 style='color:#990000'>USER IS CURRENTLY ACTIVE - UNABLE TO DE-ACTIVATE</h1></div>\";\n $result = false;\n }\n \n return $result;\n }",
"public function suspendInstance()\n\t{\n\t\tglobal $DB;\n\n\t\t$this->userdata->status = 0;\n\t\t$DB->update_record('edugamemaker_user_data', $this->userdata);\n\t}",
"public function Unsuspend() {\n $action = 'unsuspendAccount';\n $post = '&username='.$this->details['option1']['value'];\n if($this->Send($action, $post)) {\n $this->addInfo('Account has been unsuspended.');\n return true;\n } else\n return false;\n }",
"public function suspendAccount(Server_Account $a)\n {\n if($a->getReseller()) {\n $this->getLog()->info('Suspending reseller hosting account');\n } else {\n $this->getLog()->info('Suspending shared hosting account');\n }\n\t}",
"public function Unsuspend() {\n return true;\n $action = 'unsuspendAccount';\n $post = '&username='.$this->details['option1']['value'];\n if($this->Send($action, $post)) {\n $this->addInfo('Account has been unsuspended.');\n return true;\n } else\n return false;\n }",
"public function suspend()\n {\n $subscription = $this->asMoipSubscription();\n\n $subscription->suspend();\n\n // If the user was on trial, we will set the grace period to end when the trial\n // would have ended. Otherwise, we'll retrieve the end of the billing period\n // and make that the end of the grace period for this current user.\n if ($this->onTrial()) {\n $this->ends_at = $this->trial_ends_at;\n } elseif(isset($subscription->next_invoice_date) && $subscription->status == 'ACTIVE') {\n $this->ends_at = Carbon::create($subscription->next_invoice_date->year, $subscription->next_invoice_date->month, $subscription->next_invoice_date->day);\n } else {\n $this->ends_at = Carbon::now();\n }\n\n $this->save();\n\n return $this;\n }",
"abstract public function sendSuspendEmail();",
"function unsuspend_plesk_account()\n {\n $id = $this->order_data['plesk_id'];\n $data=<<<EOF\n<packet version=\"1.3.4.0\">\n<client>\n<set>\n<filter>\n<id>$id</id>\n</filter>\n<values>\n<gen_info>\n<status>0</status>\n</gen_info>\n</values>\n</set>\n</client>\n</packet>\nEOF;\n $contents = $this->plesk_request($data);\n $return = $this->anaRes($contents);\n if($this->error)\n {\n $result['response'] = $this->error;\n $result['result'] = 0;\n }\n else\n {\n $result['response'] = \"OK\";\n $result['result'] = 1;\n $this->error = false;\n }\n $this->result = $result;\n return $this->result;\n }",
"public function suspend()\n {\n $subscription = $this->loadSubscription();\n if ($this->isActive()) {\n $subscription->suspend();\n }\n }",
"public function suspendAccount(Server_Account $a)\n {\n $user = $a->getUsername();\n // Prepare POST query\n $postvars = [\n 'returncode' => 'yes',\n 'cmd' => 'v-suspend-user',\n 'arg1' => $a->getUsername(),\n 'arg2' => 'no',\n ];\n // Make request and suspend user\n $result = $this->_makeRequest($postvars);\n // Check if error 6 the account is suspended on server\n if (6 == $result) {\n return true;\n }\n if (0 != $result) {\n throw new Server_Exception('Server Manager Hestia CP Error: Suspend Account Error '.$result.$suspended);\n }\n\n return true;\n }",
"function suspendUser ($user){\n \n Log::info(\"Entering SecurityService.suspendUser() \");\n \n //create connection to database\n $database = new Database();\n $db = $database->getConnection();\n \n // Create a User Data Service with this connection and calls suspendUser method/\n $dbService = new UserDataService($db);\n \n $user->setStatus(\"suspended\");\n $flag = $dbService->updateUser($user);\n \n // close the connection\n $db = null;\n \n // return the finder result\n Log::info(\"Exit UserBusinessService.suspendUser()\");\n return $flag;\n \n }",
"public function inactivate()\n {\n $this->account_status = self::ACC_STATUS_TERMINATED;\n }",
"public function deactivate_post(){\n // the mr to continue with that product for current WCP but won't be an option in the next WCP. This way i won't have to keep a condition here.\n if($this->token_payload[\"own\"] == \"Admin\") {\n $productId = $this->post(ProductDb::$PRO_ID);\n try {\n $this->Product_->deactivateProductId($productId);\n response($this, true, 200, \"Product \" . $productId. \" has been deactivated successfully\");\n } catch (Exception $e) {\n response($this, false, 412, \"\", \"Database Error : Deactivate Product\");\n }\n }else{\n response($this,false,430,\"\",\"You don't have permission for this action\");\n }\n }",
"public function remindActivationKey($customerEmail);",
"private function checkUserSuspend($userId = null){\n\t\t\t\t$this->checkUserId($userId);\n\t\t\t\t$user = $this->Users->find('all',['conditions' => ['Users.id' => $userId]]);\n\t\t\t\t$userData = $user->first();\n\t\t\t\tif($userData->status == 0){\n\t\t\t\t\t $resultJ = json_encode(array('status' => '303' , 'message' => \"Your account has been de-activated by admin/agent.\"));\n\t\t\t\t\t $this->json_response($resultJ); \n\t\t\t\t}\n\t\t}",
"public function deactivate($customer_id);",
"public function deactivateAccount()\n {\n $userId = $this->getId();\n\n $this->setStatus( BeMaverick_User::USER_STATUS_INACTIVE );\n\n $daResponse = BeMaverick_Da_Response::getInstance();\n $daResponse->deactivateUser( $userId );\n\n $daResponseBadge = BeMaverick_Da_ResponseBadge::getInstance();\n $daResponseBadge->deactivateUser( $userId );\n\n $daChallenge = BeMaverick_Da_Challenge::getInstance();\n $daChallenge->deactivateUser( $userId );\n\n $daContent = BeMaverick_Da_Content::getInstance();\n $daContent->deactivateUser( $userId );\n\n $daContentBadge = BeMaverick_Da_ContentBadge::getInstance();\n $daContentBadge->deactivateUser( $userId );\n\n $this->_site->deleteComments( $userId, 'false' );\n\n $this->_site->deleteMentions( $userId, 'false' );\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Load the Translations for this revision Stored in $this>translations | public function load_translations()
{
$this->translations
->configure(ext::TITANIA_TRANSLATION, $this->revision_id)
->load()
;
} | [
"public function loadTranslations() {\n $language = $this->getLanguage();\n $module = $this->getModule();\n \n // load, process translation\n if (file_exists(TRANSLATIONS_DIR . '/' . $language . '/' . $module . '.csv')) {\n $fis = fopen(TRANSLATIONS_DIR . '/' . $language . '/' . $module . '.csv', \"r\");\n while($line = fgetcsv($fis)) {\n $this->translations['untranslated'][] = $line[0];\n $this->translations['translated'][] = $line[1];\n }\n }\n else {\n $this->logMessage('Warning! Translation file '.$language.'/' .$module. '.csv Does not exist!');\n }\n }",
"public function loadAllTranslations();",
"private function loadTranslations()\n {\n $key = $this->getKeyFilters();\n\n $adapter = $this->_translator->getAdapterFor(static::class);\n $options = isset($adapter['options']) ? $adapter['options'] : null;\n $class = $adapter['manager'];\n $this->__translations = $class::retrieve($this, $key, $options);\n }",
"private function getTranslations()\n\t{\n\t\t$this->translations = $this->wpml->getAllTranslations($this->data['post_id']);\n\t}",
"protected function loadTranslations()\n {\n $this->loadTranslationsFrom($this->getTranslationsPath(), $this->package);\n }",
"protected function loadTranslations()\n {\n foreach (app('lit.translator')->getPaths() as $path) {\n foreach (config('lit.translatable.locales') as $locale) {\n $dir = realpath($path.DIRECTORY_SEPARATOR.$locale);\n $this->getTranslationsFromPath($locale, $dir);\n }\n }\n }",
"protected function loadTranslations(): void\n {\n $path = $this->getTranslationsPath();\n\n $this->loadTranslationsFrom($path, $this->getPackageName());\n $this->loadJsonTranslationsFrom($path);\n }",
"protected function loadTranslations()\n {\n if (file_exists($dir = module_path(static::$module, 'lang')))\n $this->loadTranslationsFrom($dir, studlyToSlug(static::$module));\n }",
"protected function load()\n {\n $this->translations = array();\n \n if ($this->language) {\n if ($this->cachepath) {\n if (file_exists($cache = $this->cachepath.'/'.$this->language.'.php')) {\n $this->translations = include($cache);\n }\n } else {\n if (!empty($this->filepaths)) {\n foreach ($this->filepaths as $filepath) {\n $this->loadFilePath($filepath);\n }\n }\n }\n }\n }",
"public function initTranslations();",
"public function add_translations() {}",
"protected function loadTranslations() {\n $i18n = new MooseNewsI18n();\n $i18n->setDomain($this->getPluginName());\n $this->loader->addAction('plugins_loaded', $i18n, 'loadPluginTextdomain');\n }",
"public function getTranslations();",
"private function lang_load() : void\n\t{\n\t\t$lang_file = $this->locales_dir . $this->language . '.txt';\n\t\tif (file_exists($lang_file)) {\n\t\t\t$file = file($lang_file);\n\t\t\tif ($file === false) {\n\t\t\t\tthrow new SmartyException('Could not read language file \"' . $lang_file . '\"');\n\t\t\t}\n\n\t\t\t$translations = [];\n\t\t\tforeach ($file as $row) {\n\t\t\t\t// ignore empty rows and comments\n\t\t\t\tif (self::isLanguageLine($row)) {\n\t\t\t\t\t[$match, $replacement] = explode('=', $row, 2);\n\n\t\t\t\t\t// ignore last character, if it is a line break\n\t\t\t\t\tif (substr($replacement, -1) === \"\\n\") {\n\t\t\t\t\t\t$replacement = substr($replacement, 0, -1);\n\t\t\t\t\t}\n\n\t\t\t\t\t$translations[$match] = $replacement;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$this->translations = $translations;\n\t\t} else {\n\t\t\tthrow new SmartyException('Language file was not found at \"' . $lang_file . '\"');\n\t\t}\n\t}",
"public function load_translations() {\n\t\t$lang_dir = FLEXOPATH . 'lang';\n\t\tload_plugin_textdomain( 'flexo-archives', false, $lang_dir );\n\t}",
"protected function get_translations_from_file()\n {\n }",
"private function loadThemeTranslations()\n {\n // Create a path to the translation path\n $file = sprintf('%s/translations/%s.php', $this->getCurrentThemePath(), $this->appConfig->getLanguage());\n\n // Do load only if present\n if (is_file($file)) {\n $data = include($file);\n\n if (is_array($data)) {\n $this->translator->extend($data);\n } else {\n throw new RuntimeException(sprintf(\n 'Translation file must return an array of translations. Got \"%s\" in %s', gettype($data), $file\n ));\n }\n }\n }",
"public function updateTranslations();",
"private function populateTranslations()\n {\n //translations\n $aRelated = $this->owner->getRelatedRecords();\n if (isset($aRelated[$this->relation]) && $aRelated[$this->relation] != null) {\n if (is_array($aRelated[$this->relation])) {\n foreach ($aRelated[$this->relation] as $model) {\n $this->_models[$model->getAttribute($this->languageField)] = $model;\n }\n } else {\n $model = $aRelated[$this->relation];\n $this->_models[$model->getAttribute($this->languageField)] = $model;\n }\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Test that deleted folder appear only in the trashbin of owner when recipient has a readonly access home storage | public function testDeleteFolderAsReadOnlyRecipient() {
$readOnlyGroups = \OC::$server->getConfig()->getAppValue('core', 'read_only_groups', null);
\OC::$server->getConfig()->setAppValue('core', 'read_only_groups', '["rogroup"]');
$this->userView->mkdir('share');
$this->userView->mkdir('share/folder');
$this->userView->file_put_contents('share/folder/test.txt', 'Yarrr! Content!');
$originalFileId = $this->userView->getFileInfo('share/folder/test.txt')->getId();
$recipientUser = $this->getUniqueId('recipient_');
$recipientUserObject = \OC::$server->getUserManager()->createUser($recipientUser, $recipientUser);
$roGroupObject = \OC::$server->getGroupManager()->createGroup('rogroup');
$roGroupObject->addUser($recipientUserObject);
$node = \OC::$server->getUserFolder($this->user)->get('share');
$share = \OC::$server->getShareManager()->newShare();
$share->setNode($node)
->setShareType(\OCP\Share::SHARE_TYPE_USER)
->setSharedBy($this->user)
->setSharedWith($recipientUser)
->setPermissions(\OCP\Constants::PERMISSION_ALL);
\OC::$server->getShareManager()->createShare($share);
$this->loginAsUser($recipientUser);
// delete as recipient
$recipientView = new View('/' . $recipientUser . '/files');
$recipientView->rmdir('share/folder');
// check if folder is in trashbin for owner
$results = $this->rootView->getDirectoryContent($this->user . '/files_trashbin/files/');
$this->assertCount(1, $results);
$name = $results[0]->getName();
$this->assertEquals('folder', \substr($name, 0, \strrpos($name, '.')));
// check if file is in trashbin for owner and has the same file id
$info = $this->rootView->getFileInfo($this->user . '/files_trashbin/files/' . $name . '/test.txt');
$this->assertNotNull($info);
$this->assertEquals($originalFileId, $info->getId());
// check that folder is NOT in trashbin for recipient
$this->assertFalse($this->rootView->file_exists($recipientUser . '/files_trashbin'));
\OC::$server->getConfig()->setAppValue('core', 'read_only_groups', $readOnlyGroups);
$roGroupObject->delete();
} | [
"public function testTrash() {\n $fileSystem = $this->getSession()->filesystem();\n $items = $fileSystem->listTrash();\n $root = $fileSystem->root();\n\n $level0Folder1 = $root->createFolder($this->level0Folder1Name);\n $this->assertEquals($this->level0Folder1Name, $level0Folder1->getName());\n\n $level1Folder1 = $level0Folder1->createFolder($this->level1Folder1Name);\n $this->assertEquals($this->level1Folder1Name, $level1Folder1->getName());\n\n $localUploadDirectory = dirname(__FILE__) . '/files/upload/';\n $file = $level0Folder1->upload($localUploadDirectory . 'text2', null, Exists::OVERWRITE);\n $this->assertEquals('text2', $file->getName());\n\n $deleted = $level0Folder1->delete(false, true);\n $this->assertTrue($deleted);\n\n $items = $fileSystem->listTrash();\n $this->assertTrue(count($items) > 0);\n foreach($items as $item) {\n if ($item->getType() == \\CloudFS\\Utils\\FileType::FOLDER) {\n $subItems = $item->getList();\n $this->assertTrue(count($subItems) >= 0);\n }\n }\n }",
"public function testDeleteVersionsOfFolderAsRecipient() {\n\t\t$this->markTestSkippedIfStorageHasOwnVersioning();\n\t\t\\OCA\\Files_Versions\\Hooks::connectHooks();\n\n\t\t$this->userView->mkdir('share');\n\t\t$this->userView->mkdir('share/folder');\n\t\t// trigger a version (multiple would not work because of the expire logic)\n\t\t$this->userView->file_put_contents('share/folder/test.txt', 'v1');\n\t\t$this->userView->file_put_contents('share/folder/test.txt', 'v2');\n\n\t\t$results = $this->rootView->getDirectoryContent($this->user . '/files_versions/share/folder/');\n\t\t$this->assertCount(1, $results);\n\n\t\t$recipientUser = $this->getUniqueId('recipient_');\n\t\t\\OC::$server->getUserManager()->createUser($recipientUser, $recipientUser);\n\n\t\t$node = \\OC::$server->getUserFolder($this->user)->get('share');\n\t\t$share = \\OC::$server->getShareManager()->newShare();\n\t\t$share->setNode($node)\n\t\t\t->setShareType(\\OCP\\Share::SHARE_TYPE_USER)\n\t\t\t->setSharedBy($this->user)\n\t\t\t->setSharedWith($recipientUser)\n\t\t\t->setPermissions(\\OCP\\Constants::PERMISSION_ALL);\n\t\t\\OC::$server->getShareManager()->createShare($share);\n\n\t\t$this->loginAsUser($recipientUser);\n\n\t\t// delete as recipient\n\t\t$recipientView = new View('/' . $recipientUser . '/files');\n\t\t$recipientView->rmdir('share/folder');\n\n\t\t// rescan trash storage\n\t\tlist($rootStorage, ) = $this->rootView->resolvePath($this->user . '/files_trashbin');\n\t\t$rootStorage->getScanner()->scan('');\n\n\t\t// check if versions are in trashbin for owner\n\t\t$results = $this->rootView->getDirectoryContent($this->user . '/files_trashbin/versions');\n\t\t$this->assertCount(1, $results);\n\t\t$name = $results[0]->getName();\n\t\t$this->assertEquals('folder.d', \\substr($name, 0, \\strlen('folder.d')));\n\n\t\t// check if file versions are in trashbin for owner\n\t\t$results = $this->rootView->getDirectoryContent($this->user . '/files_trashbin/versions/' . $name . '/');\n\t\t$this->assertCount(1, $results);\n\t\t$name = $results[0]->getName();\n\t\t$this->assertEquals('test.txt.v', \\substr($name, 0, \\strlen('test.txt.v')));\n\n\t\t// check if versions are in trashbin for recipient\n\t\t$results = $this->rootView->getDirectoryContent($recipientUser . '/files_trashbin/versions');\n\t\t$this->assertCount(1, $results);\n\t\t$name = $results[0]->getName();\n\t\t$this->assertEquals('folder.d', \\substr($name, 0, \\strlen('folder.d')));\n\n\t\t// check if file versions are in trashbin for recipient\n\t\t$results = $this->rootView->getDirectoryContent($recipientUser . '/files_trashbin/versions/' . $name . '/');\n\t\t$this->assertCount(1, $results);\n\t\t$name = $results[0]->getName();\n\t\t$this->assertEquals('test.txt.v', \\substr($name, 0, \\strlen('test.txt.v')));\n\n\t\t// versions deleted\n\t\t$results = $this->rootView->getDirectoryContent($recipientUser . '/files_versions/share/folder/');\n\t\t$this->assertCount(0, $results);\n\t}",
"public function allowsDeleteDir();",
"public function testImageFoldersIdFolderMembersDelete()\n {\n\n }",
"public function testDeleteFoldersId()\n {\n }",
"public function testPrivateDesignsDeleteFolder()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }",
"public function testDeleteFolderSuccessTest(){\n $today = date(\"Y-m-d H:i:s\"); \n $user = UserModel::find(6);\n $request = $this->actingAs($user)\n ->delete('admin/document-manager/delete-folder/80', \n [\n \n ]\n );\n \n $request->seeJson([\n 'status' => 1\n ]);\n \n }",
"public function testCrossStorageDeleteFile() {\n\t\t$storage2 = new Temporary([]);\n\t\t\\OC\\Files\\Filesystem::mount($storage2, [], $this->user . '/files/substorage');\n\n\t\t$this->userView->file_put_contents('substorage/subfile.txt', 'foo');\n\t\t$storage2->getScanner()->scan('');\n\t\t$this->assertTrue($storage2->file_exists('subfile.txt'));\n\t\t$this->userView->unlink('substorage/subfile.txt');\n\n\t\t$storage2->getScanner()->scan('');\n\t\t$this->assertFalse($this->userView->getFileInfo('substorage/subfile.txt'));\n\t\t$this->assertFalse($storage2->file_exists('subfile.txt'));\n\n\t\t// check if file is in trashbin\n\t\t$results = $this->rootView->getDirectoryContent($this->user . '/files_trashbin/files');\n\t\t$this->assertCount(1, $results);\n\t\t$name = $results[0]->getName();\n\t\t$this->assertEquals('subfile.txt', \\substr($name, 0, \\strrpos($name, '.')));\n\t}",
"public function testTeamMembersIdDesignFoldersFkDelete()\n {\n\n }",
"public function testDeleteDeckFromFolderThatDoesNotExistForUser() {\n $success = Deck::delete_from_folder($this->deckids[0], 'Food', $this->user1->get_id(), $this->con);\n $this->assertFalse($success);\n }",
"public function testPermissionUpgradeOnUserDeletedGroupShare() {\n\t\t$g = \\OC::$server->getGroupManager()->createGroup('testGroup');\n\t\t$g->addUser(\\OC::$server->getUserManager()->get(self::TEST_FILES_SHARING_API_USER1));\n\t\t$g->addUser(\\OC::$server->getUserManager()->get(self::TEST_FILES_SHARING_API_USER2));\n\t\t$g->addUser(\\OC::$server->getUserManager()->get(self::TEST_FILES_SHARING_API_USER3));\n\n\t\t$connection = \\OC::$server->getDatabaseConnection();\n\n\t\t// Share item with group\n\t\t$fileinfo = $this->view->getFileInfo($this->folder);\n\t\t$share = $this->share(\n\t\t\t\\OCP\\Share::SHARE_TYPE_GROUP,\n\t\t\t$this->folder,\n\t\t\tself::TEST_FILES_SHARING_API_USER1,\n\t\t\t'testGroup',\n\t\t\t\\OCP\\Constants::PERMISSION_READ\n\t\t);\n\n\t\t// Login as user 2 and verify the item exists\n\t\tself::loginHelper(self::TEST_FILES_SHARING_API_USER2);\n\t\t$this->assertTrue(\\OC\\Files\\Filesystem::file_exists($this->folder));\n\t\t$result = $this->shareManager->getShareById($share->getFullId(), self::TEST_FILES_SHARING_API_USER2);\n\t\t$this->assertNotEmpty($result);\n\t\t$this->assertEquals(\\OCP\\Constants::PERMISSION_READ, $result->getPermissions());\n\n\t\t// Delete the share\n\t\t$this->assertTrue(\\OC\\Files\\Filesystem::rmdir($this->folder));\n\t\t$this->assertFalse(\\OC\\Files\\Filesystem::file_exists($this->folder));\n\n\t\t// Verify we do not get a share\n\t\t$result = $this->shareManager->getShareById($share->getFullId(), self::TEST_FILES_SHARING_API_USER2);\n\t\t$this->assertEquals(\\OCP\\Constants::PERMISSION_READ, $result->getPermissions());\n\t\t$this->assertEquals(\\OCP\\Share::STATE_REJECTED, $result->getState());\n\n\t\t// Login as user 1 again and change permissions\n\t\tself::loginHelper(self::TEST_FILES_SHARING_API_USER1);\n\t\t$share->setPermissions(\\OCP\\Constants::PERMISSION_ALL);\n\t\t$share = $this->shareManager->updateShare($share);\n\n\t\t// Login as user 2 and verify\n\t\tself::loginHelper(self::TEST_FILES_SHARING_API_USER2);\n\t\t$this->assertFalse(\\OC\\Files\\Filesystem::file_exists($this->folder));\n\t\t$result = $this->shareManager->getShareById($share->getFullId(), self::TEST_FILES_SHARING_API_USER2);\n\t\t$this->assertEquals(\\OCP\\Constants::PERMISSION_ALL, $result->getPermissions());\n\t\t$this->assertEquals(\\OCP\\Share::STATE_REJECTED, $result->getState());\n\n\t\t$this->shareManager->deleteShare($share);\n\n\t\t//cleanup\n\t\tself::loginHelper(self::TEST_FILES_SHARING_API_USER1);\n\t\t$g = \\OC::$server->getGroupManager()->createGroup('testGroup');\n\t\t$g->removeUser(\\OC::$server->getUserManager()->get(self::TEST_FILES_SHARING_API_USER1));\n\t\t$g->removeUser(\\OC::$server->getUserManager()->get(self::TEST_FILES_SHARING_API_USER2));\n\t\t$g->removeUser(\\OC::$server->getUserManager()->get(self::TEST_FILES_SHARING_API_USER3));\n\t}",
"public function testTemplatesIdPortalFoldersDelete()\n {\n\n }",
"public function testFolder() {\n\t\t$parent =& $this->object->folder();\n\t\t$this->assertInstanceOf('titon\\io\\Folder', $parent);\n\t\t$this->assertEquals(APP_TEMP, $parent->path());\n\t}",
"public function testPrivateImagesDeleteFolder()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }",
"public function testDeleteFolder()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }",
"public function testOnDeletedDirectory() {\n\n $obj = new FileSystemStorageProvider($this->logger, $this->directory);\n\n $this->dir3->setParent($this->dir1); // This directory was moved.\n\n $obj->onDeletedDirectory($this->dir3);\n $this->assertFileNotExists($this->directory . \"/1/3\");\n\n $obj->onDeletedDirectory($this->dir2);\n $this->assertFileNotExists($this->directory . \"/1/2\");\n\n $obj->onDeletedDirectory($this->dir1);\n $this->assertFileNotExists($this->directory . \"/1\");\n }",
"public function testTeamsIdTemplatesNkPortalFoldersRelFkDelete()\n {\n\n }",
"public function testFoldersNewFolder()\n {\n }",
"public function testTeamsIdPortalsNkTemplateFoldersDelete()\n {\n\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Wrapper for Subscribers.GetActive. This method triples as Subscribers.GetUnsubscribed and Subscribers.GetBounced when the very last parameter is overridden. | function subscribersGetActive( $date = 0, $list_id = null, $action = 'Subscribers.GetActive' )
{
if ( !$list_id )
$list_id = $this->list_id;
if ( is_numeric( $date ) )
$date = date( 'Y-m-d H:i:s', $date );
$valid_actions = array( 'Subscribers.GetActive' => '', 'Subscribers.GetUnsubscribed' => '', 'Subscribers.GetBounced' => '' );
if ( !isset( $valid_actions[$action] ) )
$action = 'Subscribers.GetActive';
return $this->makeCall( $action
, array(
'params' => array(
'ListID' => $list_id
, 'Date' => $date
)
)
);
} | [
"public function getActiveSubscription();",
"function getActiveSubscriptions() {\n\n return $this->getSubscriptions('Active');\n\n }",
"public function get_active_subscriptions() {\r\n return $this->get_all_subscriptions( true );\r\n }",
"public function getActive() {\r\n\treturn $this->active;\r\n }",
"public function getActive()\r\n {\r\n return $this->active;\r\n }",
"function getActive() {\n\t\treturn $this->_Active;\n\t}",
"protected function sendToActiveSubscribers()\n {\n $activeSubscribers = Subscribers::where('status', 1);\n\n if (Settings::get('newsletter_subscriber_categories')) {\n $categoryIds = $this->news->categories()->lists('id');\n $activeSubscribers->filterCategories($categoryIds);\n }\n\n $activeSubscribers = $activeSubscribers->get();\n\n $results = true;\n\n foreach ($activeSubscribers as $receiver) {\n $results = $results && $this->send($receiver);\n }\n\n return $results;\n }",
"function ActiveSubscribe($par=\"system\"){\n\tglobal $smarty, $dbconn, $config, $config_admin, $page, $lang;\n\t$active = array();\n\n\t$active = isset($_REQUEST['active']) ? $_REQUEST['active'] : \"\";\n\n\tif((is_array($active) && count($active)==0) || !is_array($active)){\n\t\t$dbconn->Execute(\"update \".SUBSCRIBE_SISTEM_TABLE.\" set status='0'\");\n\t}elseif(is_array($active) && count($active)>0){\n\t\t$strSQL = \"Select id, status from \".SUBSCRIBE_SISTEM_TABLE.\" order by id\";\n\t\t$rs = $dbconn->Execute($strSQL);\n\t\tif($rs->RowCount()>0){\n\t\t\t$i = 0;\n\t\t\twhile(!$rs->EOF){\n\t\t\t\t$row = $rs->GetRowAssoc(false);\n\t\t\t\tif(in_array($row[\"id\"], $active) && $row[\"status\"]==0)\n\t\t\t\t$dbconn->Execute(\"update \".SUBSCRIBE_SISTEM_TABLE.\" set status='1' where id='\".$row[\"id\"].\"'\");\n\t\t\t\telseif(!in_array($row[\"id\"], $active) && $row[\"status\"]==1)\n\t\t\t\t$dbconn->Execute(\"update \".SUBSCRIBE_SISTEM_TABLE.\" set status='0' where id='\".$row[\"id\"].\"'\");\n\t\t\t\t$rs->MoveNext();\n\t\t\t\t$i++;\n\t\t\t}\n\t\t}\n\t}\n\tListSubscribe(); return;\n}",
"public function getActiveDeliveries($active){\n return $this->repository->getActiveDeliveries($active);\n }",
"public function activeAction() {\n\t\t$params = $this->getRequest()->getParams();\n\t\tif (isset($params['c'])) {\n\t\t\t$campaign = $this->_campaignTable->find($params['c'])->current();\n\t\t\tif (isset($params['confirm'])) {\n\t\t\t\tif ($params['confirm'] == 'do') {\n\t\t\t\t\t$webservices = $campaign->findTable_CampaignPublisher();\n\t\t\t\t\tforeach ($webservices as $webservice) {\n\t\t\t\t\t\t$webservice->status = 1;\n\t\t\t\t\t\t$webservice->save();\n\t\t\t\t\t}\n\t\t\t\t\t$campaign->status = 1;\n\t\t\t\t\t$campaign->save();\n\t\t\t\t\t$this->_helper->FlashMessenger->addMessage(\"La campagne '\" . $campaign->name . \"' a bien été activée.\");\n\t\t\t\t\t$this->_redirect($this->_helper->url(null, 'campaign', 'admin'));\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$this->view->campaign = $campaign;\n\t\t\t}\n\t\t} else {\n\t\t\t$this->_redirect($this->_helper->url(null, 'campaign', 'admin'));\n\t\t}\n\t}",
"public function getActive()\n {\n \n while(!$this->ping()) {\n $this->shift();\n }\n return $this->bottom();\n }",
"public function activate()\n {\n $subscription = $this->loadSubscription();\n if ($this->isSuspended()) {\n $subscription->activate();\n }\n }",
"public function active() {\n\t\treturn $this->_database->order_by('priority','asc')->where(['is_active'=>1])->get($this->table)->result();\n\t}",
"public function activeSubscription()\n {\n return $this->subscriptions()->whereNull('cancelled_at')->where('expiration_at', '>', Carbon::now())->where('status', Subscription::STATUS_IN_PROGRESS)->first();\n }",
"function get_active_affiliates() {\n\t$affiliates = new \\Yogasukmap\\AffiliateWPApproval\\Affiliate();\n\n\treturn $affiliates->withStatus( \"active\" )->get();\n}",
"public static function getActiveForThisApp() : Subscription\n {\n return self::getByDefaultCompany(Di::getDefault()->get('userData'));\n }",
"private static function _helper_subscription_activate()\n {\n }",
"public function activeSubscriptionsList()\n {\n return $this->subscriptions()\n ->where('expires_on', '>', Carbon::now())->notCancelled()->get();\n }",
"public function activeAction()\n {\n if ($this->getRequest()->getParam('param')) {\n $this->showThreadAction($this->getRequest()->getParam('param'));\n return;\n }\n $this->_topMenu->selectItem('active');\n\n $mail = $this->_user->getMail();\n $this->view->threads = $mail->getThreadsList(App_Mail_Thread::STATE_ACTIVE);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the value of field man_dem | public function getManDem()
{
return $this->man_dem;
} | [
"public function getManzanaDANE() {\r\n\t\treturn $this->manzanadane;\r\n\t}",
"public function getMandatDureeDucsedi() {\n return $this->mandatDureeDucsedi;\n }",
"public function getDmt_menor()\r\n\t{\r\n\t\treturn($this->dmt_menor);\r\n\t}",
"public function getMandante()\n {\n return $this->mandante;\n }",
"public function getDetalle()\n {\n return $this->detalle;\n }",
"public function getMontantDebut()\n {\n return $this->montantDebut;\n }",
"public function getExamen_medico(){\n return $this->examen_medico;\n }",
"public function getMed()\n\t{\n\t\treturn $this->med;\n\t}",
"public function get_motdepasse()\n {\n return $this->_motdepasse;\n }",
"public function getMandatDureeEditva() {\n return $this->mandatDureeEditva;\n }",
"public function getDesde()\n {\n return $this->desde;\n }",
"public function getValor_moeda()\n {\n return $this->valor_moeda;\n }",
"function getMotd()\n {\n return $this->_motd;\n }",
"public function getEtablissementDemande()\n {\n return $this->etablissement_demande;\n }",
"public function getMaldad()\n {\n return $this->maldad;\n }",
"public function getDesaKelurahan()\n {\n return $this->desa_kelurahan;\n }",
"public function getNiveauDemande()\n {\n return $this->niveau_demande;\n }",
"public function getDetsex(){\n\t\treturn $this->detsex;\n\t}",
"public function getManhasexta()\r\n {\r\n return $this->manhasexta;\r\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the is_applicable flag | public function isApplicable()
{
return $this->is_applicable;
} | [
"public function isApplicable()\n {\n return true;\n }",
"protected function is_applicable() {\n\t\treturn $this->is_notice_dismissed() === false;\n\t}",
"function getIsApply() {\n return $this->isApply;\n }",
"public function setUnapplicable()\n {\n $this->is_applicable = false;\n }",
"public function getApplicableChecker()\n {\n return $this->applicableChecker;\n }",
"public function canApply()\n {\n return $this->type && $this->code && $this->order && $this->list && 0 < count($this->list) && $this->type;\n }",
"public static function isApplicable($input);",
"public function getTaxApplicableOn()\n {\n return $this->tax_applicable_on;\n }",
"public function getSurchargeApplicable()\n {\n return $this->surchargeApplicable;\n }",
"function isApplicable($refObject = null, $eventName='')\n\t{\n\t\t//if you want to decide to trigger app as per event name\n\t\t// then return true from here\n\t\tif($eventName == 'onPayplansControllerCreation'){\n\t\t\treturn true;\n\t\t}\n\n\t\t// make sure to let system handle default behaviour\n\t\treturn parent::isApplicable($refObject,$eventName);\n\t}",
"public function isEligibility() {\n\n\t\treturn $this->eligibility;\n\t}",
"function can_do_default() {\n return has_capability('local/elisprogram:'.$this->type.'_view', $this->get_context());\n }",
"public function isAllowedToReview() {\n return $this->isTranscribeJob() ||\n $this->isConformJob() ||\n $this->isTimingJob() ||\n $this->isStandaloneQa() ||\n $this->isStandaloneAcceptance();\n }",
"public function isApplicableTo(Action $action): bool;",
"public function getSupportsAppless()\n {\n return $this->supports_appless;\n }",
"public function isApplied()\n {\n return $this->applied_at !== NULL;\n }",
"public function getIsAvailableAttribute()\n {\n if($this->designUpdate()->active()->exists()) return false;\n if($this->trade_id) return false;\n if(CharacterTransfer::active()->where('character_id', $this->id)->exists()) return false;\n return true;\n }",
"public function isApplicable(array $bundle_config) : bool;",
"public function hasAudienceTargeting(): bool;"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Disable a users account | function disable_user($email) {
// Build the query
$query = "UPDATE UserAccount SET enabled=0 WHERE email = ?";
// Execute the query
$result = $this->db->query($query, $email);
// Check if the row was affected
if ($this->db->affected_rows() == 1) {
$message = "Success: account disabled.";
} else {
$message = "Error: failed to disable account.";
}
// Return the result message
return $message;
} | [
"public function disable() {\n\t\t$this->out(\"Disabling a user account\");\n\t\t$email = $this->args[0];\n\n\t\t// Find existing user account\n\t\t$found = $this->User->find('first', array(\n\t\t\t'conditions' => array(\n\t\t\t\t'email' => $email\n\t\t\t)\n\t\t));\n\n\t\t// If it does not exist, error out\n\t\tif (empty($found)) {\n\t\t\t$this->error(__(\"Could not find an account with that email address!\"));\n\t\t}\n\n\t\t// Save with updated status\n\t\t$this->User->id = $found['User']['id'];\n\n\t\tif (!$this->User->saveField('is_active', 0)) {\n\t\t\t$this->error(__(\"Failed to disable user '$email'!\"));\n\t\t} else {\n\t\t\t$this->out(__(\"User '$email' disabled.\"));\n\t\t}\n\t}",
"public function disable() {\n $this->changes['useraccountcontrol'] = $this->getData('useraccountcontrol') & ~DirectoryUAC::ADS_UF_ACCOUNT_DISABLE;\n }",
"private function disable_user()\r\n {\r\n $userid = $this->input->post('userid');\r\n $status = $this->input->post('status');\r\n $this->tbinfo->disable_user($userid, $status);\r\n }",
"function disableAccount($accountId)\n\t\t{\n\t\t\tmysql_query(\"UPDATE argus_accounts SET status = 'DISABLED' WHERE account_id = '\".$accountId.\"' AND status = 'ENABLED'\") or die(mysql_error());\n\t\t\t\n\t\t\treturn;\n\t\t}",
"public function deactivateAccount()\n {\n $userId = $this->getId();\n\n $this->setStatus( BeMaverick_User::USER_STATUS_INACTIVE );\n\n $daResponse = BeMaverick_Da_Response::getInstance();\n $daResponse->deactivateUser( $userId );\n\n $daResponseBadge = BeMaverick_Da_ResponseBadge::getInstance();\n $daResponseBadge->deactivateUser( $userId );\n\n $daChallenge = BeMaverick_Da_Challenge::getInstance();\n $daChallenge->deactivateUser( $userId );\n\n $daContent = BeMaverick_Da_Content::getInstance();\n $daContent->deactivateUser( $userId );\n\n $daContentBadge = BeMaverick_Da_ContentBadge::getInstance();\n $daContentBadge->deactivateUser( $userId );\n\n $this->_site->deleteComments( $userId, 'false' );\n\n $this->_site->deleteMentions( $userId, 'false' );\n }",
"public function deactivateUser(){\n\n\t\tglobal $db;\n\t\t\n\t\t$db->SQL = \"UPDATE ebb_users SET active='0' WHERE Username='\".$this->user.\"' LIMIT 1\";\n\t\t$db->query();\n\t}",
"public function disable();",
"function deactivate_user($uid) {\n\tglobal $db;\n\t$array = array(\n\t\t\t\t'User_Status' => '0'\n\t\t\t);\n\t$db->update_record($array,'User_ID',$uid,'USER');\n}",
"function pmDisableUser($userName)\n{ \n $ret = 1;\n //$IP = $_SERVER['HTTP_HOST'];\n $pfServer = new SoapClient('http://' . HostName . '/typo3conf/ext/pm_webservices/serveur.php?wsdl');\n $ret = $pfServer->disableAccount(array('username' => $userName));\n\t\n\n\treturn $ret;\n}",
"public function deactivateaccount() {\r\n try {\r\n // grab the current logged in user\r\n $sessVar = $this->Auth->user();\r\n\r\n // create a data object with the user's info\r\n $data = array('User' => array('id' => $sessVar['id'], 'username' => $sessVar['username'], 'deactive' => 1));\r\n\r\n Configure::write('debug', 0);\r\n $this->autoRender = false;\r\n $this->layout = null;\r\n\r\n // update the user's profile in the db\r\n if ($this->User->save($data)) {\r\n $this->Auth->logout();\r\n echo \"true\";\r\n exit;\r\n } else {\r\n echo \"There was an issue deactivating your account. Please try again, or contact help@theulink.com\";\r\n exit;\r\n }\r\n } catch (Exception $e) {\r\n $this->log(\"{UsersController#deactivateaccount} - An exception was thrown: \" . $e->getMessage());\r\n echo \"There was an issue deactivating your account. Please try again, or contact help@theulink.com\";\r\n exit;\r\n }\r\n }",
"public function actionDisable($id)\n {\n// \t$uesr = $this->findModel($id);\n// \t$user->status = User::STATUS_DELETED;\n// \t$user->save();\n \tUser::updateAll(['status' => User::STATUS_DELETED], ['id' => $id]);\n \n \treturn $this->redirect(['index']);\n }",
"function disable_user($userid = '', $status = '')\r\n {\r\n $this->db->query(\"UPDATE tblUserInfo SET `status`='{$status}' WHERE fk_userid='{$userid}'\");\r\n\r\n }",
"public function deactivateAccount(){\n $userid = $this->input->post('userId');\n $data = $this->dbUpdate('user',array('status'=>0),array('userId'=>$userid));\n if($data){\n return true;\n }else{\n return false;\n }\n \n }",
"public function disable()\n {\n $this->switchActive(false, 'disabling', 'disabled');\n }",
"function os2intra_user_import_disable_users($users_to_disable = NULL) {\n os2intra_user_import_save_log('', 'Start disabling users');\n $user_disable_method = variable_get('os2intra_user_import_user_disable_method', array('termination_date'=>'termination_date'));\n if ($user_disable_method['termination_date']) {\n os2intra_user_import_disable_users_based_on_termination_date();\n }\n if ($user_disable_method['csv_file']) {\n os2intra_user_import_disable_users_based_on_csv_file($users_to_disable);\n }\n os2intra_user_import_save_log('', 'User disabling finished');\n}",
"public function deactivate()\n {\n $this->checkCSRFForm();\n $user = $this->getUser();\n $this->checkCurrentUser($user);\n\n $this->userModel->update(array(\n 'id' => $user['id'],\n 'twofactor_activated' => 0,\n 'twofactor_secret' => '',\n ));\n\n // Allow the user to test or disable the feature\n $this->userSession->disablePostAuthentication();\n\n $this->flash->success(t('User updated successfully.'));\n $this->response->redirect($this->helper->url->to('TwoFactorController', 'index', array('user_id' => $user['id'])), true);\n }",
"abstract public function IsAccountDisabled(int $uid) : bool;",
"function deActivateAccount(){\n\t\t$userID = Auth::getUserID();\n\t\t$this->setStatus($userID,0);\n\t\t$this->logout();\n\t\t$this->send(true);\t\n\t}",
"public function onDisable() {\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Operation portalsChangeStreamPost Create a change stream. | public function portalsChangeStreamPost($options = null)
{
list($response) = $this->portalsChangeStreamPostWithHttpInfo($options);
return $response;
} | [
"public function commentCreateChangeStreamPostCommentsChangeStream($options = null)\n {\n list($response, $statusCode, $httpHeader) = $this->commentCreateChangeStreamPostCommentsChangeStreamWithHttpInfo ($options);\n return $response; \n }",
"public function postCreateChangeStreamPostPostsChangeStream($options = null)\n {\n list($response) = $this->postCreateChangeStreamPostPostsChangeStreamWithHttpInfo($options);\n return $response;\n }",
"public function testPostCreateChangeStreamPostPostsChangeStream()\n {\n\n }",
"public function groupCreateChangeStreamPostGroupsChangeStream($options = null)\n {\n list($response, $statusCode, $httpHeader) = $this->groupCreateChangeStreamPostGroupsChangeStreamWithHttpInfo ($options);\n return $response; \n }",
"public function testWorkflowsChangeStreamPost()\n {\n\n }",
"public function userCreateChangeStreamPostUsersChangeStream($options = null)\n {\n list($response) = $this->userCreateChangeStreamPostUsersChangeStreamWithHttpInfo($options);\n return $response;\n }",
"public function tagsChangeStreamPost($options = null)\n {\n list($response) = $this->tagsChangeStreamPostWithHttpInfo($options);\n return $response;\n }",
"public function portalsChangeStreamPostWithHttpInfo($options = null)\n {\n // parse inputs\n $resourcePath = \"/Portals/change-stream\";\n $httpBody = '';\n $queryParams = array();\n $headerParams = array();\n $formParams = array();\n $_header_accept = $this->apiClient->selectHeaderAccept(array('application/json', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript'));\n if (!is_null($_header_accept)) {\n $headerParams['Accept'] = $_header_accept;\n }\n $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array('application/json','application/x-www-form-urlencoded','application/xml','text/xml'));\n\n // default format to json\n $resourcePath = str_replace(\"{format}\", \"json\", $resourcePath);\n\n // form params\n if ($options !== null) {\n $formParams['options'] = $this->apiClient->getSerializer()->toFormValue($options);\n }\n \n // for model (json/xml)\n if (isset($_tempBody)) {\n $httpBody = $_tempBody; // $_tempBody is the method argument, if present\n } elseif (count($formParams) > 0) {\n $httpBody = $formParams; // for HTTP post (form)\n }\n // this endpoint requires API key authentication\n $apiKey = $this->apiClient->getApiKeyWithPrefix('access_token');\n if (strlen($apiKey) !== 0) {\n $queryParams['access_token'] = $apiKey;\n }\n // make the API Call\n try {\n list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(\n $resourcePath,\n 'POST',\n $queryParams,\n $httpBody,\n $headerParams,\n '\\SplFileObject',\n '/Portals/change-stream'\n );\n\n return array($this->apiClient->getSerializer()->deserialize($response, '\\SplFileObject', $httpHeader), $statusCode, $httpHeader);\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\\SplFileObject', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n }\n\n throw $e;\n }\n }",
"public function testCampaignCreateChangeStreamPostCampaignsChangeStream()\n {\n\n }",
"public function testPostCreateChangeStreamGetPostsChangeStream()\n {\n\n }",
"public function test_fileContainerCreateChangeStreamPostFileContainersChangeStream() {\n\n }",
"public function postCreateChangeStreamPostPostsChangeStreamWithHttpInfo($options = null)\n {\n // parse inputs\n $resourcePath = \"/Posts/change-stream\";\n $httpBody = '';\n $queryParams = array();\n $headerParams = array();\n $formParams = array();\n $_header_accept = $this->apiClient->selectHeaderAccept(array('application/json', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript'));\n if (!is_null($_header_accept)) {\n $headerParams['Accept'] = $_header_accept;\n }\n $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array('application/json','application/x-www-form-urlencoded','application/xml','text/xml'));\n\n // default format to json\n $resourcePath = str_replace(\"{format}\", \"json\", $resourcePath);\n\n // form params\n if ($options !== null) {\n $formParams['options'] = $this->apiClient->getSerializer()->toFormValue($options);\n }\n \n // for model (json/xml)\n if (isset($_tempBody)) {\n $httpBody = $_tempBody; // $_tempBody is the method argument, if present\n } elseif (count($formParams) > 0) {\n $httpBody = $formParams; // for HTTP post (form)\n }\n // make the API Call\n try {\n list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(\n $resourcePath,\n 'POST',\n $queryParams,\n $httpBody,\n $headerParams,\n '\\SplFileObject',\n '/Posts/change-stream'\n );\n\n return array($this->apiClient->getSerializer()->deserialize($response, '\\SplFileObject', $httpHeader), $statusCode, $httpHeader);\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\\SplFileObject', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n }\n\n throw $e;\n }\n }",
"public function test_postCreateChangeStreamGetPostsChangeStream() {\n\n }",
"public function videoCollectionCreateChangeStreamPostVideoCollectionsChangeStream($options = null)\n {\n list($response, $statusCode, $httpHeader) = $this->videoCollectionCreateChangeStreamPostVideoCollectionsChangeStreamWithHttpInfo ($options);\n return $response; \n }",
"public function testDynamicDataChangeStreamPost()\n {\n\n }",
"public function testProfileCreateChangeStreamPostProfilesChangeStream()\n {\n\n }",
"public function testTemplatesChangeStreamPost()\n {\n\n }",
"public function flagCreateChangeStreamPostFlagsChangeStreamWithHttpInfo($options = null)\n {\n // parse inputs\n $resourcePath = \"/Flags/change-stream\";\n $httpBody = '';\n $queryParams = array();\n $headerParams = array();\n $formParams = array();\n $_header_accept = $this->apiClient->selectHeaderAccept(array('application/json', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript'));\n if (!is_null($_header_accept)) {\n $headerParams['Accept'] = $_header_accept;\n }\n $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array('application/json','application/x-www-form-urlencoded','application/xml','text/xml'));\n\n // default format to json\n $resourcePath = str_replace(\"{format}\", \"json\", $resourcePath);\n\n // form params\n if ($options !== null) {\n $formParams['options'] = $this->apiClient->getSerializer()->toFormValue($options);\n }\n \n // for model (json/xml)\n if (isset($_tempBody)) {\n $httpBody = $_tempBody; // $_tempBody is the method argument, if present\n } elseif (count($formParams) > 0) {\n $httpBody = $formParams; // for HTTP post (form)\n }\n // make the API Call\n try {\n list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(\n $resourcePath,\n 'POST',\n $queryParams,\n $httpBody,\n $headerParams,\n '\\SplFileObject',\n '/Flags/change-stream'\n );\n\n return array($this->apiClient->getSerializer()->deserialize($response, '\\SplFileObject', $httpHeader), $statusCode, $httpHeader);\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\\SplFileObject', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n }\n\n throw $e;\n }\n }",
"public function invitationTicketsChangeStreamPost($options = null)\n {\n list($response) = $this->invitationTicketsChangeStreamPostWithHttpInfo($options);\n return $response;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Correct parent items (e.g. Bundle inside Extended Bundle) | public function setCorrectParentItems($observer) {
$items = $observer->getItems();
if($items[0]->getProduct()->getTypeId() == 'extendedbundle') {
foreach($items as $item) {
if($item->getProduct()->getParentProductId()) {
$parentItem = $productIdToItem[$item->getProduct()->getParentProductId()];
$item->setParentItem($parentItem);
}
$productIdToItem[$item->getProductId()] = $item;
}
}
return $this;
} | [
"public function testUpdateBundleItem()\n {\n }",
"public function testCreateBundleItem()\n {\n }",
"protected function catalogueParentObjects(){\n\t\t\t\n\t\t\t$ref = $this->_Parent;\n\t\t\t$classname = strtolower(get_class($ref));\n\t\t\t\n\t\t\tdo{\t\n\t\t\t\t$this->_ParentCatalogue[$classname] = $ref;\n\t\t\t\t$ref = $ref->_Parent;\n\t\t\t\t$lastClassname = $classname;\n\t\t\t\t$classname = strtolower(get_class($ref));\t\n\t\t\t\t\t\t\t\t\n\t\t\t}while($lastClassname != $classname);\n\n\t\t}",
"protected function updateParent()\n {\n $this->each(function ($item) {\n if (method_exists($item, 'parent')) {\n $item->parent($this);\n }\n });\n }",
"public function localizeParentContentWithAllChildren() {}",
"public function enableFixParentPalette()\n {\n if (\\Input::get('bootstrap') === 'parent' && \\Input::get('act') === 'edit') {\n $row = \\ContentModel::findByPk(\\Input::get('id'));\n\n if ($row) {\n $GLOBALS['TL_DCA']['tl_content']['palettes'][$row->type] =\n $GLOBALS['TL_DCA']['tl_content']['palettes']['bootstrap_parent'];\n }\n } elseif (\\Input::get('act') === 'editAll') {\n $wrappers = Bootstrap::getConfigVar('wrappers');\n\n foreach ($wrappers as $wrapper) {\n foreach ($wrapper as $name => $type) {\n if ($name === 'start') {\n continue;\n }\n\n \\MetaPalettes::appendFields('tl_content', $type['name'], 'type', array('bootstrap_parentId'));\n }\n }\n }\n }",
"protected function initializeBundles()\n {\n // init bundles\n $this->bundles = array();\n\n /**\n * @var BundleInterface $bundle\n */\n foreach ($this->registerBundles() as $bundle) {\n $name = $bundle->getName();\n\n $this->bundles[$name] = $bundle;\n $this->bundleMap[$name] = array($bundle);\n }\n\n foreach ($this->bundles as $name => $bundle) {\n while ($parentNames = $bundle->getParent()) {\n if (!is_array($parentNames)) {\n $parentNames = array($parentNames);\n }\n $throwUnknownParentException = false;\n foreach ($parentNames as $parentName) {\n if (!array_key_exists($parentName, $this->bundles)) {\n $throwUnknownParentException = true;\n continue;\n }\n $bundle = $this->bundles[$parentName];\n\n array_push($this->bundleMap[$name], $bundle);\n $throwUnknownParentException = false;\n break;\n }\n\n if ($throwUnknownParentException) {\n throw new \\InvalidArgumentException(sprintf(\n 'Bundle \"%s\" declared his parent as one of \"%s\", which is unknown',\n $name,\n implode(', ', $parentNames)\n ));\n }\n }\n }\n }",
"protected function buildParentReplacements()\n {\n $parentModelClass = $this->parseModel($this->option('parent'));\n if (!$this->files->exists($this->getPath($parentModelClass))) {\n if ($this->confirm(\"A {$parentModelClass} model does not exist. Do you want to generate it?\", true)) {\n $this->call('make:model', ['name' => str_replace($this->rootNamespace(), '', $parentModelClass), '-m' => true, '-f' => true]);\n }\n }\n\n $policyClass = str_replace_first($this->rootNamespace(), $this->rootNamespace().'Policies\\\\', $parentModelClass).'Policy';\n if (!$this->files->exists($this->getPath($policyClass))) {\n if ($this->confirm(\"A {$policyClass} policy does not exist. Do you want to generate it?\", true)) {\n $this->call('make:policy', ['name' => $policyClass, '--model' => class_basename($parentModelClass)]);\n }\n }\n\n return [\n 'ParentDummyFullModelClass' => $parentModelClass,\n 'ParentDummyModelClass' => class_basename($parentModelClass),\n 'ParentDummyModelVariable' => lcfirst(class_basename($parentModelClass)),\n 'parent_dummy_model_variable' => snake_case(class_basename($parentModelClass)),\n 'parent_dummy_model_plural_variable' => str_plural(snake_case(class_basename($parentModelClass))),\n 'ParentDummyTitle' => ucwords(snake_case(class_basename($parentModelClass), ' ')),\n ];\n }",
"public function singleBundleEditWithOverrides() {\n $entityTypeInfo = $this->createEntityType();\n\n $title_overrides = [];\n foreach ($this->getConfigurableBaseFields() as $field) {\n $title_overrides[$field] = $this->randomMachineName(16);\n }\n\n $bundle_info = $this->createEntityBundle($entityTypeInfo['id'], '', $title_overrides);\n\n $new_title_overrides = [];\n foreach ($this->getConfigurableBaseFields() as $field) {\n $new_title_overrides[$field] = $this->randomMachineName(16);\n }\n\n $this->editEntityBundle($entityTypeInfo['id'], $bundle_info['type'], $this->randomMachineName(16), $new_title_overrides);\n }",
"function add_to_flattened( $item, &$flattened, $parent = null ) {\n $item['parent'] = $parent;\n $items_to_search = [\n 'taskgroups',\n 'tasks',\n 'agegroups',\n ];\n foreach ( $items_to_search as $key ) {\n if ( array_key_exists( $key, $item ) ) {\n foreach ( $item[ $key ] as $new_item ) {\n add_to_flattened( $new_item, $flattened, $item['guid'] );\n }\n\n // Collapse sub items to just their guid's\n $item[ $key ] = array_map(function( $item ) {\n return $item['guid'];\n }, $item[ $key ]);\n }\n }\n $flattened[ $item['guid'] ] = $item;\n }",
"function bp_core_reset_subnav_items( $parent_slug ) {\n\tglobal $bp;\n\n\tunset( $bp->bp_options_nav[$parent_slug] );\n}",
"private function _processBundles()\n {\n if($this->cart) {\n foreach ($this->cartProductIndex as $k => $item) {\n $product = Products::find($k);\n if ($product) {\n if ($product->bundle) {\n $this->bundles[$product->bundle][] = $k;\n }\n } else {\n //Error\n }\n }\n\n if (!empty($this->bundles)) {\n $this->cartOptions['bundles'] = false;\n foreach ($this->bundles as $k => $bundle) {\n if (count($bundle) != Products::where('bundle', $k)->count()) {\n foreach ($bundle as $productInBundle) {\n foreach ($this->cartProductIndex[$productInBundle] as $index => $value) {\n $this->cart[$index]->bundlePrice = 0;\n }\n }\n unset($this->bundles[$k]);\n } else {\n foreach ($bundle as $productInBundle) {\n foreach ($this->cartProductIndex[$productInBundle] as $index => $value) {\n $this->cart[$index]->bundlePrice =\n round($this->cart[$index]->price * (1 - \\Config::get('custom.bundles.discount')), 2);\n }\n }\n $this->cartOptions['bundles'] = true;\n }\n }\n }\n }\n }",
"protected function buildParentReplacements()\n {\n $parentModelClass = $this->parseModel($this->option('parent'));\n\n if (!class_exists($parentModelClass)) {\n if ($this->confirm(\"A {$parentModelClass} model does not exist. Do you want to generate it?\", true)) {\n $this->call('xmake:model', ['name' => $parentModelClass]);\n }\n }\n\n return [\n 'ParentDummyFullModelClass' => $parentModelClass,\n 'ParentDummyModelClass' => class_basename($parentModelClass),\n 'ParentDummyModelVariable' => lcfirst(class_basename($parentModelClass)),\n ];\n }",
"function kalervo_add_menu_parent_class( $items ) {\n\n\t$parents = array();\n\n\tforeach ( $items as $item ) {\n\n\t\tif ( $item->menu_item_parent && $item->menu_item_parent > 0 )\n\t\t\t$parents[] = $item->menu_item_parent;\n\t\t\n\t}\n\n\tforeach ( $items as $item ) {\n\n\t\tif ( in_array( $item->ID, $parents ) )\n\t\t\t$item->classes[] = 'menu-item-parent';\n\n\t}\n\n\treturn $items; \n\n}",
"public function setAttributes(): void\n {\n $attributes = [];\n if ($this->getIsChild()\n && $this->parent->getTypeId() === Configurable::TYPE_CODE\n ) {\n /** @var Configurable $productTypeInstance */\n $productTypeInstance = $this->parent->getTypeInstance();\n $parentAttributes = $productTypeInstance->getConfigurableAttributes($this->parent);\n foreach ($parentAttributes as $attribute) {\n /** @var Configurable\\Attribute $attribute */\n $code = $attribute->getProductAttribute()->getAttributeCode();\n $customAttribute = $this->item->getCustomAttribute($code);\n if (!$customAttribute) {\n $error = \"SG: could not locate child (ID: {$this->item->getId()}) attribute code: {$code}\";\n $this->logger->error($error);\n continue;\n }\n $optionId = $customAttribute->getValue();\n $options = $attribute->getOptions();\n $optionLabels = array_filter(\n $options,\n static function ($option) use ($optionId) {\n return $option['value_index'] === $optionId;\n }\n );\n $option = array_pop($optionLabels);\n if (!isset($option['label'])) {\n continue;\n }\n\n $itemAttribute = new Shopgate_Model_Catalog_Attribute();\n $itemAttribute->setGroupUid($attribute->getAttributeId());\n $itemAttribute->setLabel($option['label']);\n $attributes[] = $itemAttribute;\n }\n }\n parent::setAttributes($attributes);\n }",
"function nestedbox_core_entity_info_alter(array &$entity_info) {\n foreach (nestedbox_get_types() as $type => $info) {\n $entity_info['nestedbox']['bundles'][$type] = array(\n 'label' => $info->label,\n 'admin' => array(\n /* @see nestedbox_type_load() */\n 'path' => 'admin/structure/nestedbox-types/manage/%nestedbox_type',\n 'real path' => 'admin/structure/nestedbox-types/manage/' . $type,\n 'bundle argument' => 4,\n 'access arguments' => array('administer nestedbox types'),\n ),\n );\n }\n}",
"function blackoot_add_menu_parent_class( $items ) {\n\t$parents = array();\n\tforeach ( $items as $item ) {\n\t\tif ( $item->menu_item_parent && $item->menu_item_parent > 0 ) {\n\t\t\t$parents[] = $item->menu_item_parent;\n\t\t}\n\t}\n\tforeach ( $items as $item ) {\n\t\tif ( in_array( $item->ID, $parents ) ) {\n\t\t\t$item->classes[] = 'menu-parent-item';\n\t\t}\n\t}\n\treturn $items;\n}",
"public function getParentMeta()\n {\n return [\n 'id' => $this->sample->id,\n 'name'=>$this->sample->title,\n 'parentId' => $this->sample->sampleContainer->id,\n 'parentName'=>$this->sample->sampleContainer->techpack->name\n ];\n }",
"public function backfill_parents() {\r\n global $wpdb;\r\n\r\n // find parents for post orphans\r\n foreach ( $this->post_orphans as $child_id => $parent_id ) {\r\n $local_child_id = $local_parent_id = false;\r\n if ( isset( $this->processed_posts[$child_id] ) )\r\n $local_child_id = $this->processed_posts[$child_id];\r\n if ( isset( $this->processed_posts[$parent_id] ) )\r\n $local_parent_id = $this->processed_posts[$parent_id];\r\n\r\n if ( $local_child_id && $local_parent_id )\r\n $wpdb->update( $wpdb->posts, array( 'post_parent' => $local_parent_id ), array( 'ID' => $local_child_id ), '%d', '%d' );\r\n }\r\n\r\n // all other posts/terms are imported, retry menu items with missing associated object\r\n $missing_menu_items = $this->missing_menu_items;\r\n foreach ( $missing_menu_items as $item )\r\n $this->_process_menu_item( $item );\r\n\r\n // find parents for menu item orphans\r\n foreach ( $this->menu_item_orphans as $child_id => $parent_id ) {\r\n $local_child_id = $local_parent_id = 0;\r\n if ( isset( $this->processed_menu_items[$child_id] ) )\r\n $local_child_id = $this->processed_menu_items[$child_id];\r\n if ( isset( $this->processed_menu_items[$parent_id] ) )\r\n $local_parent_id = $this->processed_menu_items[$parent_id];\r\n\r\n if ( $local_child_id && $local_parent_id )\r\n update_post_meta( $local_child_id, '_menu_item_menu_item_parent', (int) $local_parent_id );\r\n }\r\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Created directory for compile file | protected function _createCompileDir($dir)
{
if(is_dir(self::$smartyOptions['compile_dir'].$dir))
return;
$dirCreate = self::$smartyOptions['compile_dir'];
$dirNew = explode(DIRECTORY_SEPARATOR,$dir);
foreach($dirNew AS $name)
{
$dirCreate.=$name.DIRECTORY_SEPARATOR;
if(is_dir($dirCreate))
continue;
mkdir($dirCreate,$this->chmodDir);
}
} | [
"protected function makeCompileDir()\n {\n $this->makeDirectories(strval($this->configure['compile_dir']), 0775);\n $this->forceCompile = (bool)($this->configure['force_compile'] ?? false);\n }",
"private function makeDirectory(): void\n {\n $this->directory = $this->simulation->fileAbsolutePath('correlations/' . $this->id);\n Utils::createDirectory($this->directory);\n }",
"public function generateFolder(){\n\t\tif ( ! \\File::exists($this->modulePath))\n\t\t{\n\t\t\t\\File::makeDirectory($this->modulePath, 0755);\n\t\t}\n\n\t\t// Create some resource directories\n\t\t//\\File::makeDirectory($this->modulePath . '/Assets', 0755);\n\t\t//\\File::makeDirectory($this->modulePath . '/Config', 0755);\n\t\t\\File::makeDirectory($this->modulePath . '/Controllers', 0755);\n\t\t//\\File::makeDirectory($this->modulePath . '/Lang', 0755);\n\t\t\\File::makeDirectory($this->modulePath . '/Models', 0755);\n\t\t\\File::makeDirectory($this->modulePath . '/Migrations', 0755);\n\t\t\\File::makeDirectory($this->modulePath . '/Views', 0755);\n\t\t\n\t}",
"public function prepareCompiledDir()\n {\n $compiledDir = $this->config->getCompiledDir();\n\n if (! file_exists($compiledDir)) {\n mkdir($compiledDir,$this->defaultCompiledDirMod, true);\n }\n\n if (!is_dir($compiledDir)) {\n throw new RuntimeException(\"The $compiledDir is not a directory.\");\n }\n\n if (!is_writable($compiledDir)) {\n throw new UnwritableFileException(\"The {$compiledDir} is not writable for asset compilation.\");\n }\n\n }",
"private function createCodeBrowserBuildDirectory()\n {\n if ( file_exists( $this->getCodeBrowserBuildDirectory() ) === false )\n {\n mkdir( $this->getCodeBrowserBuildDirectory(), 0755, true );\n }\n }",
"protected function buildFsTree()\n {\n mkdir($this->config_path, 0755, true);\n mkdir($this->compiledViewsPath(), 0755, true);\n }",
"protected function createFolders()\n {\n $compiledPath = $this->config->rootPath() . '/';\n // Loop though and create directories if we need to.\n foreach (explode('/', $this->folderPath) as $folder) {\n $compiledPath .= $folder . '/';\n if (!is_dir($compiledPath)) {\n mkdir($compiledPath);\n }\n }\n }",
"protected function createProjectDirectory()\n {\n $dir = sprintf('/tmp/crowdin/project/%s/', $this->id);\n exec(sprintf('mkdir -p %s', $dir));\n\n return $dir;\n }",
"private function makeModulesFolder()\n {\n $this->generateDirectory(workbench()->config('paths.modules'),\n 'Modules directory created successfully',\n 'Modules directory already exist'\n );\n }",
"function createDirectory();",
"public function makeBaseDirectory()\n {\n $this->path = $this->config->get('tie.root') . '/' . $this->vendor . '/' . $this->package;\n\n $this->makeDir($this->path);\n }",
"private function makeAssetsFolder()\n {\n $this->generateDirectory(workbench()->config('paths.assets'),\n 'Assets directory created successfully',\n 'Assets directory already exist'\n );\n }",
"protected function generateDirectories() \n\t{\n\t\t$directories = [ 'build', 'Components', 'Components/app', 'Components/admin' ];\n\t\n\t\tif ($this->getOption('with-admin')) {\n\t\t\t$directories[] = 'Components/admin';\n\t\t}\n\n\t\t$directories[] = 'Controllers';\n\t\t$directories[] = 'Database';\n\t\t$directories[] = 'Database/Models';\n\t\t$directories[] = 'Database/Migrations';\n\n\t\t$this->makeDirectories($directories);\n\n\t\t$this->comment('[directories] : finished');\n\t}",
"public function makeDirectory()\n\t{\n\t\tAuthBackend::ensureWrite($this->team);\n\n\t\t$input = Input::getInstance();\n\t\t$output = Output::getInstance();\n\n\t\t$path = $input->getInput(\"path\");\n\n\t\t$repo = $this->repository();\n\t\t$success = $repo->gitMKDir($path);\n\n\t\t$paths = array();\n\t\tif ($success)\n\t\t{\n\t\t\t$now = time();\n\t\t\tdo\n\t\t\t{\n\t\t\t\t$placeholder_file = $path . '/.directory';\n\t\t\t\t$paths[] = $placeholder_file;\n\t\t\t\t$success = $repo->touchFile($placeholder_file, $now);\n\t\t\t}\n\t\t\twhile (($path = dirname($path)) != '.');\n\n\t\t\tif ($success)\n\t\t\t{\n\t\t\t\t$output->setOutput('paths', $paths);\n\t\t\t}\n\t\t}\n\t\treturn $success;\n\t}",
"public function gc_files_dir()\n\t{\n\t // functions are in the utils.php file\n\t $this->make_files_dir(); \n\t $this->clean_files_dir();\n\t}",
"public function createDirectories() {\n $directories = array(\n $this->packageDir,\n $this->moduleDir,\n \"{$this->moduleDir}/Block\",\n \"{$this->moduleDir}/controllers\",\n \"{$this->moduleDir}/etc\",\n \"{$this->moduleDir}/Helper\",\n \"{$this->moduleDir}/Model\",\n \"{$this->moduleDir}/sql\",\n );\n //make the directories \n foreach ($directories as $d) {\n $this->makeDirIfNotExist($d);\n }\n }",
"public function buildProject()\n {\n $this->filesystem->mkdir(array(\n $this->getRootDir(),\n $this->getCacheDir(),\n $this->getLogDir(),\n $this->getWebDir(),\n $this->getWebDir().'/uploads',\n ));\n\n $this->filesystem->touch(array(\n $this->getWebDir().'/'.$this->getIndexFile(),\n $this->getWebDir().'/class.php',\n $this->getWebDir().'/phpinfo.php',\n $this->getWebDir().'/authors.txt',\n $this->getWebDir().'/uploads/picture.png',\n ));\n }",
"function ac_create_cover_templates_dir() {\n $output = TRUE;\n if (!file_exists(COVER_FILE_DIR)) {\n $output = drupal_mkdir(COVER_FILE_DIR);\n }\n\n return $output;\n}",
"protected function createServiceDir()\n {\n if (!$this->files->isDirectory(dirname($this->getPath()))) {\n $this->files->makeDirectory(dirname($this->getPath()), 0777, true, true);\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Adds the built object to the parent if there is any, and return the parent | public function addToParent()
{
$this->builder->addRelationshipsCollection(
$this->factory->createRelationshipsCollection(
$this->relationships
)
);
} | [
"public function GetParentObj();",
"public function getParentObject()\n {\n return $this->_parentObject;\n }",
"public function createParent() {\n\t\tif($this->competition_type == self::TYPE_SEASON)\n\t\t\treturn null;\n\t\t\n\t\t//1. Create parent competition & link this one to it\n $model = Competition::getNew($this->parentType());\n\t\t$model->copyAttributes($this);\n\t\tforeach([\n 'name',\n\t\t\t'rule_id',\n\t\t] as $attribute)\n\t\t\t$model->$attribute = $this->$attribute;\n\t\t$model->status = Competition::STATUS_OPEN;\n\t\tif($model->save()) {\n\t\t\t$model->refresh();\n\n\t\t\t$this->parent_id = $model->id;\n\t\t\t$this->save();\n\n\t\t\t//2. Add registration to parent competition\n\t\t\tforeach($this->getRegistrations()->each() as $registration) {\n\t\t\t\t$model->register($registration->golfer, true);\n\t\t\t}\n\t\t} else {\n\t\t\tYii::trace(print_r($model->errors, true) , 'Competition::createParent');\t\t\n\t\t}\n return $model;\n\t}",
"public function setParent($parentObject) {}",
"function &parent()\n {\n if ( $this->State_ == \"Dirty\" )\n $this->get( $this->ID );\n\n $ret = false;\n\n if ( $this->ParentID != 0 )\n $ret = new eZForumMessage( $this->ParentID );\n \n return $ret;\n }",
"public function &_get_parent()\n\t{\n\t\treturn $this->parent;\n\t}",
"public function moveToNewParent();",
"public function getParentBackedUp();",
"public function parent() {\n\t\treturn $this->parent;\n\t}",
"public function getParent() {\n $class = static::extendsFrom();\n return $this->hasOne($class::className(), [$this->parentPrimaryKey() => $this->parentAttribute()]);\n }",
"function load_parent($with_keywords = null)\n {\n \t$parent = new Item_Model($this->parent_id, $with_keywords);\n \t\n \treturn $parent;\n }",
"public function setParentIfAvailable();",
"protected function prepareParentXMLElement()\n {\n $document = new \\DOMDocument();\n $parent = new \\DOMElement('class');\n $document->appendChild($parent);\n\n return $parent;\n }",
"public function getParentContentObject() {}",
"function parent(){\r\n\t\treturn rsgGalleryManager::get( $this->parent );\r\n\t}",
"public function getParentKeepingChildren()\n {\n return $this->parent;\n }",
"public function outerObject()\n\t{\n\t\treturn $this;\n\t}",
"function addParent(T_Template_File $parent)\n {\n if (!$this->isParent($parent)) {\n $this->_parents[] = $parent;\n }\n return $this;\n }",
"protected function updateParent()\n {\n $this->each(function ($item) {\n if (method_exists($item, 'parent')) {\n $item->parent($this);\n }\n });\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Reset the basket session | public function resetBasketSession()
{
// Clear basket session
$this->container->get('session')->set('basket', false);
// Initialise the basket session
$this->initialiseBasketSession();
return true;
} | [
"function reset_basket() {\n\t\t\n\t\tif ( isset( $_GET['rbsworldpay_redirect_reset'] ) ) {\n\t\t\t$_SESSION['wpsc_cart'] = null;\n\t\t\t$GLOBALS['wpsc_cart'] = new wpsc_cart;\n\t\t}\n\t\t\n\t}",
"function emptyBasket()\n {\n \tsession_start();\n \tunset($_SESSION['items']);\n }",
"public function reset() {\n\t\t$this->cart['PRODUCTS'] = array();\n\t\t$this->cart['ADDRESS'] = array();\n\t\t$this->cart['GRAND_TOTAL'] = 0.00;\n\t\t$this->cart['FROM_OFFER'] = NULL;\n\t\t$this->_updateSession();\n\t}",
"function resetCart() {\n sessionSave('cart', serialize(new Cart()), true);\n}",
"public function emptyBasket()\n {\n $this->session->unset_userdata('basket');\n\n // Reaffichage du panier\n redirect('Basket/viewBasket');\n }",
"private function clearBasket()\n {\n $this->oldbasket = $this->basket->sGetBasket();\n $this->basket->clearBasket();\n }",
"public function reset() {\n $this->papaya()->session->setValue($this->_sessionIdentifier, NULL);\n }",
"public function resetCheckout() {\n unset($_SESSION['checkout']);\n }",
"public function reset() {\n if ($this->_active) {\n $_SESSION = array();\n }\n }",
"public function reset()\n {\n unset($_SESSION['aesKey']);\n $this->createSessionKeys(); \n }",
"private function resetBasket()\n {\n foreach ($this->oldbasket['content'] as $item) {\n $this->basket->sAddArticle($item['ordernumber'], $item['quantity']);\n }\n }",
"public function resetSession()\n {\n $_SESSION = [];\n $_SESSION['active'] = false;\n }",
"public function restoreCart()\n {\n /** @var Mage_Checkout_Model_Session $session */\n $session = Mage::getModel('checkout/session');\n $oldQuoteId = Mage::getModel('checkout/session')->getOldQuoteId();\n $session->setQuoteId($oldQuoteId);\n $session->setIsActive(1);\n Mage::getModel('checkout/session')->setOldQuoteId(null);\n }",
"public function emptyCart()\n {\n $this->session->clear();\n }",
"public function reset()\n {\n $this->session->forget('mathcaptcha.first');\n $this->session->forget('mathcaptcha.second');\n $this->session->forget('mathcaptcha.operand');\n }",
"public function resetSession() {\n Yii::$app->session->regenerateID();\n }",
"public function resetAll()\n\t{\n\t\tif(isset($_SESSION['token'])) unset($_SESSION['token']);\n\t}",
"protected function reset_session()\n\t{\n\t\tif($_SESSION['style_edit_mode'] !== 'edit')\n\t\t{\n\t\t\txtc_session_destroy();\n\t\t}\n\n\t\tunset($_SESSION['customer_id']);\n\t\tunset($_SESSION['customer_default_address_id']);\n\t\tunset($_SESSION['customer_first_name']);\n\t\tunset($_SESSION['customer_country_id']);\n\t\tunset($_SESSION['customer_zone_id']);\n\t\tunset($_SESSION['comments']);\n\t\tunset($_SESSION['user_info']);\n\t\tunset($_SESSION['customers_status']);\n\t\tunset($_SESSION['selected_box']);\n\t\tunset($_SESSION['shipping']);\n\t\tunset($_SESSION['payment']);\n\t\tunset($_SESSION['ccard']);\n\n\t\t// GV Code Start\n\t\tunset($_SESSION['gv_id']);\n\t\tunset($_SESSION['cc_id']);\n\t\t// GV Code End\n\n\t\t$_SESSION['cart']->reset();\n\n\t\t// write customers status guest in session again\n\t\trequire(DIR_WS_INCLUDES . 'write_customers_status.php');\n\t}",
"public function reset()\n {\n $this->session->forget('math-captcha.first');\n $this->session->forget('math-captcha.second');\n $this->session->forget('math-captcha.operand');\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set the cadence in lap | public function setCadence($val)
{
$this->cadence = $val;
return $this;
} | [
"public function setCama(){\n $this->cama = \"Sim\";\n }",
"public function getCadence()\n {\n return $this->cadence;\n }",
"public function ligar()\n {\n $this->ligado = true;\n }",
"public function usingCompanyCar()\r\n {\r\n if ($this->usingCar) {\r\n\r\n $this->salary = $this->salary - static::$carLeasePrice;\r\n\r\n }\r\n\r\n }",
"public function setLatLon()\n\t{\n\t\t$query = 'listZipCodeList='.$this->zipcode;\n\t\t\n\t\t$url = $this->baseURL.'?'.$query;\n\t\t\n\t\t$xml = self::retrieveXML($url);\n\t\t\n\t\t$points = preg_split('[,]', $xml->latLonList);\n\t\t\t\t\t\n\t\t$this->lat = $points[0];\n\t\t$this->lon = $points[1];\t\t\n\t}",
"public function cool()\n {\n $this->temperature = self::TEMP_COLD;\n }",
"public function setCltmoral($cltmoral)\n {\n $this->cltmoral = $cltmoral;\n\n\n }",
"public function setTrailLatitude(float $newTrailLatitude) : void {\n//\t\t//verify that trail latitude is valid and secure\n//\t\t$newTrailLatitude = trim($newTrailLatitude);\n//\t\t$newTrailLatitude = filter_var($newTrailLatitude, FILTER_SANITIZE_NUMBER_FLOAT);\n\n\t\tif(floatval($newTrailLatitude) < -90) {\n\t\t\tthrow(new \\RangeException(\"trail latitude is not between -90 and 90\"));\n\t\t}\n\t\tif(floatval($newTrailLatitude) > 90) {\n\t\t\tthrow(new \\RangeException(\"trail latitude is not between -90 and 90\"));\n\t\t}\n\n\t\t//store the latitude data\n\t\t$this->trailLatitude = $newTrailLatitude;\n\t}",
"public function setArea()\n {\n $this->area = pi() * pow($this->radius, 2);\n }",
"function setLoanAmount($loanAmount){\n $this->loanAmount = $loanAmount; \n }",
"function set_pantone_pc($pantone_name)\n {\n $this->pantone_pc = $pantone_name;\n $this->cmyk['c'] = $this->pantone_pallete_pc[$pantone_name]['c'];\n $this->cmyk['m'] = $this->pantone_pallete_pc[$pantone_name]['m'];\n $this->cmyk['y'] = $this->pantone_pallete_pc[$pantone_name]['y'];\n $this->cmyk['b'] = $this->pantone_pallete_pc[$pantone_name]['b'];\n\n $this->convert_cmyk_to_rgb();\n $this->convert_rgb_to_hex();\n }",
"function setlatitud($value)\n {\n $this->latitud = ($value == '') ?\n DB_DataObject_Cast::sql('NULL') : $value;\n }",
"public function setLC($lc)\n\t{\n\t\t$this->lc = $lc==null?\"en\":urlencode($lc);\n\t}",
"function set_pantone($pantone_name){\r\n\t\t$this->pantone=$pantone_name;\r\n\t\t$this->cmyk['c']=$this->pantone_pallete[$pantone_name]['c'];\r\n\t\t$this->cmyk['m']=$this->pantone_pallete[$pantone_name]['m'];\r\n\t\t$this->cmyk['y']=$this->pantone_pallete[$pantone_name]['y'];\r\n\t\t$this->cmyk['b']=$this->pantone_pallete[$pantone_name]['b'];\r\n\t\t\r\n\t\t$this->convert_cmyk_to_rgb();\r\n\t\t$this->convert_rgb_to_hex();\t\t\r\n\t}",
"function setLSCCode($code)\n {\n $this->__lsccode = $code ;\n }",
"function setMarca($Marca) {\r\n $this->Marca = $Marca;\r\n }",
"public function set_cidade(Cidade $object)\n {\n $this->cidade = $object;\n $this->cidade_id = $object->id;\n }",
"public function setLatLong()\n {\n $state = model('state');\n $state_id = (int)user()->preference('state_id') ?? user()->city ?? null;\n if (in_array($state_id, $state->pluck('id')->toArray())) {\n $state = $state->where('id', $state_id)->first();\n $this->latitude = $state->latitude;\n $this->longitude = $state->longitude;\n $this->state_id = $state_id;\n } else {\n $state = model('state')->where('id', 81)->first();\n $this->latitude = $state->latitude;\n $this->longitude = $state->longitude;\n $this->state_id = $state->id;\n user()->setPreference('state_id', $state->id);\n }\n }",
"public function setLongitud($longitud){\n $this->longitud = $longitud;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Validate if the $object can be added | protected function validateAdd($object): void
{
if (!$this->validate($object)) {
throw new InvalidItemTypeException;
}
} | [
"public function validate_object() {\n return true;\n }",
"public function canValidate($object);",
"public function isObjectTypeValid($object)\n\t{\n\t\treturn true;\n\t}",
"public function canHaveObject(): bool\n {\n return self::canHaveObjectFor($this->name);\n }",
"public function validate($object)\r\n\t{\r\n\t\t\r\n\t}",
"public abstract function add($object);",
"public function supportsObject($object);",
"public function validate($object): bool;",
"public function checkSubExtObj()\n {\n if (is_object($this->extObj)) {\n $this->extObj->checkExtObj();\n }\n }",
"public function add($object);",
"private function _addIfValidName($name, $obj)\n\t{\n\t\tif(!in_array($name, $this->_names))\n\t\t{\n\t\t\t$this->_names[] = $name;\n\t\t\t$this->_objects[] = $obj;\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tthrow new FormFieldsException('error, name already exists');\n\t\t}\n\t}",
"public function allowAdd() {\n\n return true;\n }",
"abstract protected function guardObjectType($object);",
"public function canValidate($object) {\n\t\treturn ($object instanceof \\Evoweb\\StoreFinder\\Domain\\Model\\Constraint);\n\t}",
"private function isValid() : bool {\n\t\t$stdClass = $this->stdClass;\n\n\t\tif( ! isset( $stdClass->name ) || ! is_string( $stdClass->name ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif( ! isset( $stdClass->rating ) || ! is_int( $stdClass->rating ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif( ! isset( $stdClass->genres ) || ! is_array( $stdClass->genres ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif( ! isset( $stdClass->showings ) || ! is_array( $stdClass->showings ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}",
"public function ensureValidated(RequestObjectInterface $object): void;",
"function ExtensionSanityCheck($object)\r\n {\r\n }",
"private function isObjectInsertable()\n {\n return (!$this->_isObjectLoadedFromDB() && $this->_isObjectHaveNewFieldValue());\n }",
"private function validateInited(){\r\n\t\t\r\n\t\tif(empty($this->objectClass))\r\n\t\t\tUniteFunctionsUC::throwError(\"The object class should be inited\");\r\n\t\t\r\n\t\tUniteFunctionsUC::validateNotEmpty($this->dbTable, \"DB Table\");\r\n\t\tUniteFunctionsUC::validateNotEmpty($this->urlListBase, \"Url List Base\");\r\n\t\tUniteFunctionsUC::validateNotEmpty($this->viewObject, \"Single object view\");\r\n\t\tUniteFunctionsUC::validateNotEmpty($this->viewObjectPreview, \"Single Object Preview View\");\r\n\t\tUniteFunctionsUC::validateNotEmpty($this->actionDelete, \"Action Delete\");\r\n\t\t\r\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
set setTieUpSource attribute of SourceTracking class | function setTieUpSource($tieUpSource)
{
$this->tieUpSource=$tieUpSource;
} | [
"public function setSource($source);",
"function set_source($source) {\n if (is_object($source)) {\n $this->source = $source;\n $this->source_id = $source->get_id();\n }\n else {\n $this->source_id = $source;\n unset($this->source);\n }\n }",
"public function causedAt($source){\n $this->source = $source;\n }",
"protected function setApiSourceInfo() {\n $this->apiSourceInfo = pathinfo($this->api['source']);\n }",
"public function setIsSource(bool $isSource): void\n {\n $this->isSource = $isSource;\n }",
"protected function setSource($source)\n\t{\n\t\t$this->source = $source;\n\t\t$this->migrations = unserialize(file_get_contents($this->source));\n\t\tif (!is_array($this->migrations)) {\n\t\t\t$this->migrations = array();\n\t\t}\n\t}",
"public function setSourceName($value);",
"public function setSource($path)\n {\n $this->_source = $path;\n }",
"public function setSource($source)\n {\n if (in_array($source, OpenID_Discover::$discoveryOrder)) {\n $this->source = $source;\n }\n }",
"public function source($source)\n {\n $this->file = $source;\n }",
"public function setSource($source)\n {\n $this->connection = static::getConnection($source);\n\n if (\n $source instanceof Model\n && $source->persistence\n && ($source->persistence instanceof Persistence\\SQL)\n ) {\n $this->setModel($source);\n }\n }",
"public function setSource($source)\n {\n $this->connection = static::getConnection($source);\n\n if (\n $source instanceof Model\n && $source->persistence\n && ($source->persistence instanceof Persistence\\Sql)\n ) {\n $this->setModel($source);\n }\n }",
"public function setSource(string $value);",
"public function updateSource()\n {\n $source = array(\n \"value\" => $this->value,\n \"tags\" => $this->tags,\n \"type\" => $this->type,\n \"body\" => $this->body,\n );\n\n $this->source = Yaml::dump($source, 100, 2);\n }",
"public function setSources($theSources)\n {\n $this->mySourcesFilesetId = $theSources;\n }",
"public function set_source_class($class = 'SimplePie_Source')\n {\n }",
"public function setSource(?OrderSource $source): void\n {\n $this->source = $source;\n }",
"protected function setSourcesAttributes()\n {\n $sources = [];\n\n if (isset($this->data['sources'])) {\n foreach ($this->data['sources'] as $source) {\n $mediaQuery = $source['mediaQuery'];\n $image = $source['image'];\n\n if (config('twill-image.webp_support')) {\n $sources[] = $this->buildSourceObject(\n $image['srcSetWebp'],\n $image['aspectRatio'],\n $this->mimeType(\"webp\"),\n $mediaQuery\n );\n }\n\n $sources[] = $this->buildSourceObject(\n $image['srcSet'],\n $image['aspectRatio'],\n $this->mimeType($image['extension']),\n $mediaQuery\n );\n }\n }\n\n $image = $this->data['image'];\n\n if (config('twill-image.webp_support')) {\n $sources[] = $this->buildSourceObject(\n $image['srcSetWebp'],\n $image['aspectRatio'],\n $this->mimeType(\"webp\"),\n );\n }\n\n $sources[] = $this->buildSourceObject(\n $image['srcSet'],\n $image['aspectRatio'],\n $this->mimeType($image['extension'])\n );\n\n $this->sources = $sources;\n }",
"protected function setUtmSource() {\n\t\t$utm_source = $this->getVal( 'utm_source' );\n\t\t$utm_source_id = $this->getVal( 'utm_source_id' );\n\n\t\tif ( $this->getVal( 'payment_method' ) ) {\n\t\t\t$method_object = PaymentMethod::newFromCompoundName(\n\t\t\t\t$this->gateway,\n\t\t\t\t$this->getVal( 'payment_method' ),\n\t\t\t\t$this->getVal( 'payment_submethod' ),\n\t\t\t\t$this->getVal( 'recurring' )\n\t\t\t);\n\t\t\t$utm_payment_method_family = $method_object->getUtmSourceName();\n\t\t} else {\n\t\t\t$utm_payment_method_family = '';\n\t\t}\n\n\t\t$recurring_str = var_export( $this->getVal( 'recurring' ), true );\n\t\t$this->logger->debug( __FUNCTION__ . \": Payment method is {$this->getVal( 'payment_method' )}, recurring = {$recurring_str}, utm_source = {$utm_payment_method_family}\" );\n\n\t\t// split the utm_source into its parts for easier manipulation\n\t\t$source_parts = explode( \".\", $utm_source );\n\n\t\t// If we don't have the banner or any utm_source, set it to the empty string.\n\t\tif ( empty( $source_parts[0] ) ) {\n\t\t\t$source_parts[0] = '';\n\t\t}\n\n\t\t// If the utm_source_id is set, include that in the landing page\n\t\t// portion of the string.\n\t\tif ( $utm_source_id ) {\n\t\t\t$source_parts[1] = $utm_payment_method_family . $utm_source_id;\n\t\t} else {\n\t\t\tif ( empty( $source_parts[1] ) ) {\n\t\t\t\t$source_parts[1] = '';\n\t\t\t}\n\t\t}\n\n\t\t$source_parts[2] = $utm_payment_method_family;\n\t\tif ( empty( $source_parts[2] ) ) {\n\t\t\t$source_parts[2] = '';\n\t\t}\n\n\t\t// reconstruct, and set the value.\n\t\t$utm_source = implode( \".\", $source_parts );\n\t\t$this->setVal( 'utm_source', $utm_source );\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Serialize a request message. | public function serializeRequest(Request $request); | [
"public function serialize(Message $message);",
"public function getRawRequestMessage()\n {\n }",
"public function serializeRequest(Request $request): string;",
"function serialize(RequestInterface $request);",
"public static function serializeMessage($message)\n {\n return json_encode($message);\n }",
"public function __toString() {\n $request = $this->method . ' ' . $this->path . ' ' . $this->protocol . \"\\r\\n\";\n\n foreach ($this->headers as $header) {\n $request .= (string) $header . \"\\r\\n\";\n }\n\n if ($this->getBody()) {\n $request .= \"\\r\\n\" . $this->getBody() . \"\\r\\n\";\n }\n\n return $request;\n }",
"public function serialize() {}",
"public function setSerializedRequest($value)\n {\n return $this->set(self::SERIALIZED_REQUEST, $value);\n }",
"public function toMessage()\n {\n return new Message(array(\n $this->requestId,\n $this->action,\n ));\n }",
"public function toProtobufRequest()\n {\n $request = new \\POGOProtos\\Networking\\Requests\\Request();\n $request->setRequestType($this->getType());\n\n if (($message = $this->getMessage()) !== null) {\n $request->setRequestMessage($message->toStream());\n }\n\n return $request;\n }",
"public function __toString()\n {\n $request = sprintf(\"%s %s HTTP/1.1\\r\\n\", $this->getMethod(), $this->getUriWithPort());\n $request .= $this->getHeadersAsString();\n $request .= $this->getBody();\n\n return trim($request);\n }",
"public function serialize($input) : string;",
"protected function GenerateRequestInfoMessage() {\n return 'email=' . $this->GetEmail() . ' service=' . $this->GetServiceName()\n . ' method=' . $this->GetLastMethodName() . ' responseTime='\n . $this->GetLastResponseTime() . ' requestId='\n . $this->GetLastRequestId() . ' server=' . $this->GetServer()\n . ' isFault=' . $this->IsFault() . ' faultMessage='\n . $this->GetLastFaultMessage();\n }",
"public function __toString(): string\n {\n $request = sprintf(\n \"%s %s HTTP/%s\\r\\n\",\n $this->getMethod(),\n $this->getRequestTarget(),\n $this->getProtocolVersion()\n );\n\n foreach (array_keys($this->headers) as $header) {\n if (strtolower($header) === 'cookie') {\n $cookie = implode('; ', $this->getHeader('Cookie'));\n $request .= sprintf(\n \"%s: %s\\r\\n\",\n $header,\n $cookie\n );\n } else {\n $request .= sprintf(\n \"%s: %s\\r\\n\",\n $header,\n $this->getHeaderLine($header)\n );\n }\n }\n\n return sprintf(\n \"%s\\r\\n%s\",\n $request,\n $this->getBody()\n );\n }",
"public function serialize();",
"public function testEncodeMessage(): void\n {\n $serializer = new CommerceToolsSerializer();\n\n $order = new OrderCreatedMessage();\n $order->setId('FOOBAR');\n\n $envelope = new Envelope($order);\n $encodedEnvelope = $serializer->encode($envelope);\n\n static::assertEquals([\n 'X-CommerceTools-Message' => OrderCreatedMessage::class\n ], $encodedEnvelope['headers']);\n static::assertEquals(json_encode($order), $encodedEnvelope['body']);\n }",
"public function serialize ()\n {\n return serialize (array\n (\n $this -> m_sCommand,\n $this -> m_mCode,\n $this -> m_sPermission,\n $this -> m_aNetworks,\n $this -> m_aChannels,\n $this -> m_aStatistics\n ));\n }",
"public function getRequestSerializer()\n {\n return $this->serializer;\n }",
"public function getMessageParamsAsJson() : String\n\t\t{\n\t\t\treturn json_encode($this->messageParams);\n\t\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function to start the simulator iterating over the nodes in the graph | function startSim ($con, $exec_iterator, $exec_count) {
addToLog (";--------------------------------\n; SIMULATOR PHASE $exec_iterator/$exec_count\n;--------------------------------");
print_r ("On phase $exec_iterator/$exec_count\n");
consumerPhase ($con);
//economicPhase ($con, $nodes);
addToLog ("\n\n\n\n\n\n\n\n\n\n\n");
} | [
"private function getIterationNodes(): void\n {\n $iterationPart = $this->getIterationPart();\n\n $this->createIterationNodeMapper($iterationPart);\n }",
"public function printNodes() {\n for ($i = 0; $i < $this->length; $i++) {\n echo $this->nodeArr[$i]->id.\" \";\n echo $this->nodeArr[$i]->path.\" \";\n echo $this->nodeArr[$i]->active.\"\\n\";\n }\n $this->printNumCycles();\n }",
"public function startThinking() {\n\t\t$this->log->debug('startThinking start - timestamp = '.DateUtil::getCurrentDateTimeUTC()->getTimestamp());\n\t\t$this->log->debug('startThinking environment = '.json_encode($this->environment));\n\t\t$this->setupConnection('neo4j');\n\t\t$this->run = new Run();\n\t\t$this->run->setConnection($this->connection);\n\t\t$this->run->initializeNew();\n\t\t$this->run->insert();\n\t\t$this->thoughtCounter = 0;\n\t\t$this->start();\n\t\t$this->thoughtCounter++;\n\t\twhile ($this->environment->isActive() && $this->thoughtCounter < self::MAX_THOUGHT_COUNTER) {\n\t\t\t$this->log->debug('call think');\n\t\t\t$this->think();\n\t\t\t$this->thoughtCounter++;\n\t\t}\n\t\t$this->run->markCompleted();\n\t\t$this->environment->linkRunToObject($this->run);\n\t\t$this->log->debug('startThinking done - timestamp = '.DateUtil::getCurrentDateTimeUTC()->getTimestamp());\n\t}",
"public function display ($nodes)\n {\n if (sizeof ($nodes))\n {\n if (isset ($this->env->profiler)) $this->env->profiler->start ('ui');\n \n if (isset ($this->decorator))\n {\n $this->decorator->pre_iterate ();\n }\n \n $this->_depth = 0;\n $this->_stack = array ();\n $this->start ();\n $this->iterate_nodes ($nodes);\n $this->finish ();\n \n if (isset ($this->decorator))\n {\n $this->decorator->post_iterate ();\n }\n \n if (isset ($this->env->profiler)) $this->env->profiler->stop ('ui');\n }\n }",
"public function print_graph () {\n\n\n //if ( empty($_SERVER['argv']) ) {\n echo '<strong>Graph</strong><br />';\n echo '<table border=\"1\" cellpadding=\"4\" width=\"100%\">';\n if (! empty($this->nodenames) ) {\n echo '<tr>';\n echo '<td> </td>';\n for ($n = 0; $n < $this->nodes; $n++) {\n echo '<td width=\"15\" align=\"center\"><strong>' .\n $this->nodenames[$n] .\n '</strong></td>';\n }\n }\n echo '</tr>';\n for ($i = 0; $i < $this->nodes; $i++) {\n echo '<tr>';\n if (! empty($this->nodenames) ) {\n echo '<td width=\"15\" align=\"center\"><strong>' .\n $this->nodenames[$i] .\n '</strong></td>';\n }\n for ($j = 0; $j < $this->nodes; $j++) {\n echo '<td width=\"15\" align=\"center\">' .\n $this->weights[$i][$j] . '</td>';\n } \n echo '</tr>';\n }\n echo '</table><br />';\n\n // } else {\n\n //}\n }",
"public function run() {\n\t\t$this->iterate($this->path);\n\n\t}",
"public function train()\n {\n // $this->algortihm->train();\n }",
"public function startIterator(NodeIterator $iterator) {\n $this->doPreVisit();\n foreach($iterator as $oid => $currentObject) {\n $currentObject->acceptVisitor($this);\n }\n $this->doPostVisit();\n }",
"public function createAllGraphs()\n {\n $db = new DB($this->logLevel, $this->entityManager);\n $nodes = $db->getNodes();\n foreach ($nodes as $node) {\n $this->createGraph($node->getNodeId());\n }\n }",
"private function _forkNodes(){\n for($x=0; $x<$this->config['server']['fork_nodes']; $x++){\n $pid = pcntl_fork();\n if ($pid == -1){\n die('could not fork');\n }\n elseif ($pid) {\n $this->_registerNode($pid);\n } else {\n new PHPi_node($this->config['server']['socket_path'], $this->routes);\n exit();\n }\n }\n }",
"abstract protected function setGraph();",
"public function visit()\n {\n $this->visited = true;\n }",
"public function startMining();",
"public function nodeseris(){\n\t\t\t$myTimeNow =(int)date('d');\n\t\t\t//echo($myTimeNow % 6);die;\n\t\t\tswitch ($myTimeNow % 6) {\n\t\t\t\tcase 4:\n\t\t\t\t\t$this->nodes = array(\n\t\t\t\t\t\t\"http://gsnd0001-tavrij01.rhcloud.com/\",\n\t\t\t\t\t\t\"http://gsnd0002-tavrij01.rhcloud.com/\",\n\t\t\t\t\t\t\"https://gsnd001.herokuapp.com/\",\n\t\t\t\t\t\t\"https://gsnd002.herokuapp.com/\",\n\t\t\t\t\t\t\"https://gsnd003.herokuapp.com/\",\n\t\t\t\t\t\t\"https://gsnd004.herokuapp.com/\",\n\t\t\t\t\t\t\"https://gsnd005.herokuapp.com/\"\n\t\t\t\t\t);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 5:\n\t\t\t\t\t$this->nodes = array(\n\t\t\t\t\t\t\"http://gsnd0001-tavrij01.rhcloud.com/\",\n\t\t\t\t\t\t\"http://gsnd0002-tavrij01.rhcloud.com/\",\n\t\t\t\t\t\t\"https://gsnd006.herokuapp.com/\",\n\t\t\t\t\t\t\"https://gsnd007.herokuapp.com/\",\n\t\t\t\t\t\t\"https://gsnd008.herokuapp.com/\",\n\t\t\t\t\t\t\"https://gsnd009.herokuapp.com/\",\n\t\t\t\t\t\t\"https://gsnd010.herokuapp.com/\"\n\t\t\t\t\t);\t\t\t\t\tbreak;\n\t\t\t\tcase 0:\n\t\t\t\t\t$this->nodes = array(\n\t\t\t\t\t\t\"http://gsnd0001-tavrij01.rhcloud.com/\",\n\t\t\t\t\t\t\"http://gsnd0002-tavrij01.rhcloud.com/\",\n\t\t\t\t\t\t\"https://gsnd011.herokuapp.com/\",\n\t\t\t\t\t\t\"https://gsnd012.herokuapp.com/\",\n\t\t\t\t\t\t\"https://gsnd013.herokuapp.com/\",\n\t\t\t\t\t\t\"https://gsnd014.herokuapp.com/\",\n\t\t\t\t\t\t\"https://gsnd015.herokuapp.com/\"\n\t\t\t\t\t);\t\t\t\t\tbreak;\n\t\t\t\tcase 1:\n\t\t\t\t\t$this->nodes = array(\n\t\t\t\t\t\t\"http://gsnd0001-tavrij01.rhcloud.com/\",\n\t\t\t\t\t\t\"http://gsnd0002-tavrij01.rhcloud.com/\",\n\t\t\t\t\t\t\"https://gsnd016.herokuapp.com/\",\n\t\t\t\t\t\t\"https://gsnd017.herokuapp.com/\",\n\t\t\t\t\t\t\"https://gsnd018.herokuapp.com/\",\n\t\t\t\t\t\t\"https://gsnd019.herokuapp.com/\",\n\t\t\t\t\t\t\"https://gsnd020.herokuapp.com/\"\n\t\t\t\t\t);\t\t\t\t\tbreak;\n\t\t\t\tcase 2:\n\t\t\t\t\t$this->nodes = array(\n\t\t\t\t\t\t\"http://gsnd0001-tavrij01.rhcloud.com/\",\n\t\t\t\t\t\t\"http://gsnd0002-tavrij01.rhcloud.com/\",\n\t\t\t\t\t\t\"https://gsnd021.herokuapp.com/\",\n\t\t\t\t\t\t\"https://gsnd022.herokuapp.com/\",\n\t\t\t\t\t\t\"https://gsnd023.herokuapp.com/\",\n\t\t\t\t\t\t\"https://gsnd024.herokuapp.com/\",\n\t\t\t\t\t\t\"https://gsnd025.herokuapp.com/\"\n\t\t\t\t\t);\t\t\t\t\tbreak;\n\t\t\t\tcase 3:\n\t\t\t\t\t$this->nodes = array(\n\t\t\t\t\t\t\"http://gsnd0001-tavrij01.rhcloud.com/\",\n\t\t\t\t\t\t\"http://gsnd0002-tavrij01.rhcloud.com/\",\n\t\t\t\t\t\t\"https://gsnd026.herokuapp.com/\",\n\t\t\t\t\t\t\"https://gsnd027.herokuapp.com/\",\n\t\t\t\t\t\t\"https://gsnd028.herokuapp.com/\",\n\t\t\t\t\t\t\"https://gsnd029.herokuapp.com/\",\n\t\t\t\t\t\t\"https://gsnd030.herokuapp.com/\"\n\t\t\t\t\t);\t\t\t\t\tbreak;\n\t\t\t}\n\t}",
"function start() {\n\t# Global Variables\n\tglobal $world, $size, $rand_sample, $rand_alpha;\n\t\n\t# CInitialize the World 2D array with cells that are randomly dead or alive\n\tfor ($x = 0; $x < $size; $x++) {\n\t\tfor ($y = 0; $y < $size; $y++) {\n\t\t\t$world[$x][$y] = (rand(0,$rand_sample) > $rand_alpha)? 1 : 0;\n\t\t}\n\t}\n}",
"function traverse(array $nodes);",
"function go(){\n\t\tglobal $kind;\n\t\n\t\tif($kind>=0&&$kind<=2){\n\t\t\t\tdiagram_role($kind);\t\t\n\t\t}else if($kind>2&&$kind<6){\n\t\t\t\tdiagram_program($kind);\t\t\t\t\n\t\t}else if($kind>=6&&$kind<8){\n\t\t\t\tdiagram_commits($kind);\n\t\t}else if($kind>=8&&$kind<9){\n\t\t\t\tdiagram_git($kind);\n\t\t}else if($kind>=9&&$kind<11){\n\t\t\t\tdiagram_itemized($kind);\n\t\t}else if($kind>=11&&$kind<12){\n\t\t\t\tdiagram_loc($kind);\n\t\t}else if($kind>=12&&$kind<14){\n\t\t\t\tdiagram_locY($kind);\n\t\t}\n}",
"public function makeGraph() {\n\t$parents = $this->getNodesFromFilename();\n\t$root = $parents[0];\n\t$this->run = end($parents); // This is 'main()'\n\t\n\t$lblFunction = $this->_getLabel('Function');\n\t$lblClass = $this->_getLabel('Class');\n\t$lblMethod = $this->_getLabel('Method');\n\t$lblNative = $this->_getLabel('NativeFunction');\n\n\tforeach ($this->_raw as $caller => $stats) {\n\t $objPC = $objPM = $objCC = $objCM = null;\n\t $parsed = $this->_parseCaller($caller);\n\t list($pClass, $pMethod, $cClass, $cMethod) = $parsed;\n\t // Splits the strings on '==>', then each half again on '::'\n\t // [null] main()==>process_login_form()\n\t // [null] process_login_form()==>User::login()\n\t // User::login()==>crypto::hashPassword()\n\t // User::login()==>mysql::query()\n\t \n\t echo \"[{$pClass}]==>[{$pMethod}]==>[{$cClass}]==>[{$cMethod}]\\n\";\n\t \n\t if ($cMethod == 'main()') {\n\t\t// Actually, I think we want main()'s inclusive stats.\n\t\t// Currently, they're not being gathered\n\t\tcontinue;\n\t }\n\t // There should ALWAYS be a child method.\n\t if (!$cMethod) continue; \n\n\t // If the child has a class: add it to it's class,\n\t // then pass the class object as the new chaining point.\n\t // (cmethod)\n\t // (cclass)-[HAS_METHOD]->(cmethod)\n\n\t if ($cClass) {\n\t\t$tmpCM = $this->_makeNode($cMethod, 'Method', $stats);\n\t\t$tmpCC = $this->_makeNode($cClass, 'Class');\n\t\t$this->attach($tmpCC, $tmpCM, 'HAS_METHOD');\n\t\t$objCM = $tmpCC;\n\t } else {\n\t\t// If there's no child class, this is probably a function\n\t\t$objCM = $this->_makeNode($cMethod, 'Function', $stats);\n\t }\n\t \n\t if ($pMethod == 'main()') {\n\t\t// If the parent method is 'main()', attach this \n\t\t// call to the run, since it's happening in the\n\t\t// main routine\n\t\t$this->attach($this->run, $objCM, 'CALLS');\n\t } else {\n\t\tif ($pClass) {\n\t\t // If the parent belongs to a class, add it here.\n\t\t // Attach to child method (or $tmpCC disguised as $objCM)\n\t\t $objPM = $this->_makeNode($pMethod, 'Method');\n\t\t $this->attach($objPM, $objCM, 'CALLS');\n\t\t} else {\n\t\t $objPM = $this->_makeNode($pMethod, 'Function');\n\t\t}\n\t }\n\t \n\t if ($pClass) {\n\t\t$objPC = $this->_makeNode($pClass, 'Class');\n\t\t$this->attach($objPC, $objPM, 'HAS_METHOD');\n\t\t$objPM = $objPC;\n\t }\n\n\t if ($pMethod != 'main()') {\n\t\t$this->attach($this->run, $objPM, 'CALLS');\n\t }\n\t}\n }",
"protected function run()\n {\n self::beginIteration();\n while (self::valid()) {\n self::next();\n }\n self::endIteration();\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Method used to remove all issues associated with a specific list of projects. | function removeByProjects($ids)
{
$items = @implode(", ", Misc::escapeInteger($ids));
$stmt = "SELECT
iss_id
FROM
" . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "issue
WHERE
iss_prj_id IN ($items)";
$res = DB_Helper::getInstance()->getCol($stmt);
if (PEAR::isError($res)) {
Error_Handler::logError(array($res->getMessage(), $res->getDebugInfo()), __FILE__, __LINE__);
return false;
}
if (count($res) > 0) {
self::deleteAssociations($res);
Attachment::removeByIssues($res);
SCM::removeByIssues($res);
Impact_Analysis::removeByIssues($res);
self::deleteUserAssociations($res);
Note::removeByIssues($res);
Time_Tracking::removeByIssues($res);
Notification::removeByIssues($res);
Custom_Field::removeByIssues($res);
Phone_Support::removeByIssues($res);
History::removeByIssues($res);
// now really delete the issues
$items = implode(", ", $res);
$stmt = "DELETE FROM
" . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "issue
WHERE
iss_id IN ($items)";
DB_Helper::getInstance()->query($stmt);
}
return true;
} | [
"public function deleteAllIssuesAndResolutionsOfProject()\n {\n //all right (by default)\n $done = true;\n\n /* @var $issues Issues[] */\n /* @var $resolutions Resolutions[] */\n\n //get all issues of this project\n $issues = Issues::model()->findAllByAttributes(array('project_id' => $this->id));\n\n //for every issue\n foreach($issues as $issue)\n {\n //get all resolutions of current issue\n $resolutions = Resolutions::model()->findAllByAttributes(array('issue_id' => $issue->id));\n\n //delete every resolution\n foreach($resolutions as $resolution)\n {\n $done = $done && $resolution->delete();\n }\n\n //delete current issue\n $done = $done && $issue->delete();\n }\n\n //return status\n return $done;\n }",
"public function deleteIssuesInProject($projectIdentifier) \n {\n $issueApi = $this->client->api('issue');\n /* @var $issueApi \\Redmine\\Api\\Issue */\n while (true) {\n $issues = $issueApi->all(array('project_id' => $projectIdentifier, 'limit' => 100, 'status_id' => '*'));\n $this->assertExpected($issues, array(), sprintf('I Expected an Array, \"%s\" given.', print_r($issues, true)));\n if (0 === $issues['total_count']) {\n break;\n }\n $this->deleteIssueList($issues, $issueApi);\n }\n }",
"public function fn_remove() {\r\n\t\tif( !empty( $this->project_id ) ) {\r\n\t\t\tif( count( $this->images ) > 0 )\r\n\t\t\t\tforeach( $this->images as $image )\r\n\t\t\t\t\t$image->fn_remove();\r\n\t\t\t$sql = \"DELETE from project WHERE project_id = {$this->project_id}\";\r\n\t\t\t$statement = db::getInstance()->prepare( $sql );\r\n\t\t\tif( $statement->execute() && strncmp( $statement->errorCode(), '00', 2 ) == 0 )\r\n\t\t\t\treturn;\r\n\t\t\tthrow new Exception( __METHOD__ . ': ' . sprintf( ERR::ERR_PROJECT_NOT_REMOVED_DESC, $this->project_id ) );\r\n\t\t}\r\n\t\tthrow new Exception( __METHOD__ . ': ' . ERR::ERR_PROJECT_NOT_INITIALIZED_DESC );\r\n\t}",
"public function deleteProjects()\n\t{\n\n\t\t// Récupération de tous les projets (bdd)\n\n\n\t\t// Suppression de tous les projets \n\t\t\t// Boucle\n\t\t\t\t// (API)\n\n\n\t\t\t\t// (bdd)\n\n\t}",
"public static function removeByProjects($prj_ids)\n {\n $items = @implode(\", \", Misc::escapeInteger($prj_ids));\n $sql = \"DELETE FROM\n \" . APP_DEFAULT_DB . \".\" . APP_TABLE_PREFIX . \"project_severity\n WHERE\n sev_prj_id IN ($items)\";\n $res = DB_Helper::getInstance()->query($sql);\n if (PEAR::isError($res)) {\n Error_Handler::logError(array($res->getMessage(), $res->getDebugInfo()), __FILE__, __LINE__);\n return false;\n } else {\n return true;\n }\n }",
"function removeByIssues($ids)\n {\n $items = implode(\", \", Misc::escapeInteger($ids));\n $stmt = \"DELETE FROM\n \" . APP_DEFAULT_DB . \".\" . APP_TABLE_PREFIX . \"issue_requirement\n WHERE\n isr_iss_id IN ($items)\";\n $res = DB_Helper::getInstance()->query($stmt);\n if (PEAR::isError($res)) {\n Error_Handler::logError(array($res->getMessage(), $res->getDebugInfo()), __FILE__, __LINE__);\n return false;\n } else {\n return true;\n }\n }",
"function version_remove_all( $p_project_id ) {\n\t$c_project_id = (int)$p_project_id;\n\n\t# remove all references to versions from version, fixed in version and target version.\n\tdb_param_push();\n\t$t_query = 'UPDATE {bug}\n\t\t\t\t SET version=\\'\\', fixed_in_version=\\'\\', target_version=\\'\\'\n\t\t\t\t WHERE project_id=' . db_param();\n\tdb_query( $t_query, array( $c_project_id ) );\n\n\t# remove the actual versions associated with the project.\n\tdb_param_push();\n\t$t_query = 'DELETE FROM {project_version} WHERE project_id=' . db_param();\n\tdb_query( $t_query, array( $c_project_id ) );\n\n\treturn true;\n}",
"public function clearTeamProjects()\n\t{\n\t\t$this->collTeamProjects = null; // important to set this to NULL since that means it is uninitialized\n\t}",
"public function reset(Project $project, array $containers = []);",
"function project_del($origin = NULL, $project = NULL, $erase = TRUE, $purge = TRUE) {\n // The parameters should not be both NULL.\n if ($origin === NULL and $project === NULL) return;\n\n // Get an array of matching projects.\n $get_pguid = btr::db_select('btr_projects', 'p')->fields('p', array('pguid'));\n if ($origin != NULL) $get_pguid->condition('origin', $origin);\n if ($project != NULL) $get_pguid->condition('project', $project);\n $pguid_list = $get_pguid->execute()->fetchCol();\n if (empty($pguid_list)) return;\n\n // Get an array of templates related to the projects.\n $potid_list = btr::db_query(\n 'SELECT potid FROM {btr_templates} t\n LEFT JOIN {btr_projects} p ON (t.pguid = p.pguid)\n WHERE p.pguid IN (:pguid_list)',\n array(\n ':pguid_list' => $pguid_list,\n ))\n ->fetchCol();\n\n // Erase the data of each template.\n foreach ($potid_list as $potid) {\n _delete_template($potid);\n }\n\n // Delete the diffs and snapshots of each project.\n if ($erase) {\n foreach ($pguid_list as $pguid) {\n btr::db_delete('btr_diffs')->condition('pguid', $pguid)->execute();\n btr::db_delete('btr_snapshots')->condition('pguid', $pguid)->execute();\n }\n }\n\n if ($purge) {\n // Delete any dangling strings.\n btr::string_cleanup();\n\n // Unsubscribe any subscribed users.\n _unsubscribe_users($pguid_list);\n }\n\n // Delete user roles for these projects.\n btr::db_delete('btr_user_project_roles')\n ->condition('pguid', $pguid_list, 'IN')\n ->execute();\n\n // Delete the projects themselves.\n btr::db_delete('btr_projects')\n ->condition('pguid', $pguid_list, 'IN')\n ->execute();\n}",
"public function removeAllProjects() {\n\t\t$this->projects = new Tx_Extbase_Persistence_ObjectStorage();\n\t}",
"function removeByIssues($ids)\n {\n $items = implode(\", \", Misc::escapeInteger($ids));\n $stmt = \"DELETE FROM\n \" . APP_DEFAULT_DB . \".\" . APP_TABLE_PREFIX . \"issue_checkin\n WHERE\n isc_iss_id IN ($items)\";\n $res = DB_Helper::getInstance()->query($stmt);\n if (PEAR::isError($res)) {\n Error_Handler::logError(array($res->getMessage(), $res->getDebugInfo()), __FILE__, __LINE__);\n return false;\n }\n\n return true;\n }",
"function bulkDelete($projects_list = '')\n {\n\n //profiling::\n $this->debug_methods_trail[] = __function__;\n\n //declare\n $conditional_sql = '';\n\n //flow control\n $next = true;\n\n //sanity check - ensure we have a valid projects_list, with only numeric id's\n $lists = explode(',', $projects_list);\n for ($i = 0; $i < count($lists); $i++) {\n if (! is_numeric(trim($lists[$i]))) {\n //log error\n log_message('error', '[FILE: ' . __file__ . '] [FUNCTION: ' . __function__ . '] [LINE: ' . __line__ . \"] [MESSAGE: Bulk Deleting project members, for projects($clients_projects) failed. Invalid projects list]\");\n //exit\n return false;\n }\n }\n\n //----------sql & benchmarking start----------\n $this->benchmark->mark('code_start');\n\n //_____SQL QUERY_______\n if ($next) {\n $query = $this->db->query(\"DELETE FROM project_members\n WHERE project_members_project_id IN($projects_list)\");\n }\n $results = $this->db->affected_rows(); //affected rows\n\n //----------benchmarking end------------------\n $this->benchmark->mark('code_end');\n $execution_time = $this->benchmark->elapsed_time('code_start', 'code_end');\n\n //debugging data\n $this->__debugging(__line__, __function__, $execution_time, __class__, $results);\n //----------sql & benchmarking end----------\n\n //---return\n if (is_numeric($results)) {\n return true;\n } else {\n return false;\n }\n }",
"function project_remove_all_users( $p_project_id ) {\r\n\t\t$t_project_user_list_table = config_get( 'mantis_project_user_list_table' );\r\n\r\n\t\t$c_project_id\t= db_prepare_int( $p_project_id );\r\n\r\n\t\t$query = \"DELETE FROM $t_project_user_list_table\r\n\t\t\t\tWHERE project_id='$c_project_id'\";\r\n\r\n\t\tdb_query( $query );\r\n\r\n\t\t# db_query errors on failure so:\r\n\t\treturn true;\r\n\t}",
"public function DeleteProjects() \r\n\t{\r\n\t\t// Get timestamp of PROJECT_DELETE_DAY_LAG days ago\r\n\t\t$thirtyDaysAgo = date(\"Y-m-d H:i:s\", mktime(date(\"H\"),date(\"i\"),date(\"s\"),date(\"m\"),date(\"d\")-PROJECT_DELETE_DAY_LAG,date(\"Y\")));\r\n\t\t// Get all projects scheduled for deletion\r\n\t\t$sql = \"select project_id from redcap_projects where date_deleted is not null \r\n\t\t\t\tand date_deleted != '0000-00-00 00:00:00' and date_deleted <= '$thirtyDaysAgo'\";\r\n\t\t$q = db_query($sql);\r\n\t\t$numProjDeleted = db_num_rows($q);\r\n\t\twhile ($row = db_fetch_assoc($q)) \r\n\t\t{\r\n\t\t\t// Permanently delete the project from all db tables right now (as opposed to flagging it for deletion later)\r\n\t\t\tdeleteProjectNow($row['project_id']);\r\n\t\t}\r\n\t\tdb_free_result($q);\r\n\t\t// Set cron job message\r\n\t\tif ($numProjDeleted > 0) {\r\n\t\t\t$GLOBALS['redcapCronJobReturnMsg'] = \"$numProjDeleted projects were deleted\";\r\n\t\t}\r\n\t}",
"function bulkDelete($projects_list = '')\n {\n\n //profiling::\n $this->debug_methods_trail[] = __function__;\n\n //declare\n $conditional_sql = '';\n\n //flow control\n $next = true;\n\n //sanity check - ensure we have a valid projects_list, with only numeric id's\n $lists = explode(',', $projects_list);\n for ($i = 0; $i < count($lists); $i++) {\n if (! is_numeric(trim($lists[$i]))) {\n //log error\n log_message('error', '[FILE: ' . __file__ . '] [FUNCTION: ' . __function__ . '] [LINE: ' . __line__ . \"] [MESSAGE: Bulk Deleting invoices, for projects($clients_projects) failed. Invalid projects list]\");\n //exit\n return false;\n }\n }\n\n //----------sql & benchmarking start----------\n $this->benchmark->mark('code_start');\n\n //_____SQL QUERY_______\n if ($next) {\n $query = $this->db->query(\"DELETE FROM invoices\n WHERE invoices_project_id IN($projects_list)\");\n }\n $results = $this->db->affected_rows(); //affected rows\n\n //----------benchmarking end------------------\n $this->benchmark->mark('code_end');\n $execution_time = $this->benchmark->elapsed_time('code_start', 'code_end');\n\n //debugging data\n $this->__debugging(__line__, __function__, $execution_time, __class__, $results);\n //----------sql & benchmarking end----------\n\n //---return\n if (is_numeric($results)) {\n return true;\n } else {\n return false;\n }\n }",
"function removeByIssues($ids)\n {\n $ids = Misc::escapeInteger($ids);\n $items = @implode(\", \", $ids);\n $stmt = \"SELECT\n iat_id\n FROM\n \" . APP_DEFAULT_DB . \".\" . APP_TABLE_PREFIX . \"issue_attachment\n WHERE\n iat_iss_id IN ($items)\";\n $res = DB_Helper::getInstance()->getCol($stmt);\n if (PEAR::isError($res)) {\n Error_Handler::logError(array($res->getMessage(), $res->getDebugInfo()), __FILE__, __LINE__);\n return false;\n }\n\n foreach ($res as $id) {\n self::remove($id);\n }\n return true;\n }",
"public function removeIssuesForFiles(array $files) : void\n {\n $file_set = \\array_flip($files);\n foreach ($this->issues as $key => $issue) {\n if (\\array_key_exists($issue->getFile(), $file_set)) {\n unset($this->issues[$key]);\n }\n }\n }",
"private function deleteProjects($num)\n {\n $entries = Project::all();\n $toDelete = min($num, count($entries));\n\n for ($i = 0; $i < $toDelete; $i++) {\n $entries[$i]->delete();\n }\n $this->line('Deleted ' . $toDelete . ' projects.');\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/! Locks a table | function lock( $table )
{
$this->query( "LOCK TABLES $table WRITE" );
} | [
"function dbLockTable($table)\r\n {\r\n if ($this->isVerbose()) {\r\n $this->_errorlog(\"\\n*** Inside database->dbLockTable ***\");\r\n }\r\n\r\n $sql = \"LOCK TABLES $table WRITE\";\r\n\r\n $this->dbQuery($sql);\r\n\r\n if ($this->isVerbose()) {\r\n $this->_errorlog(\"\\n*** Leaving database->dbLockTable ***\");\r\n }\r\n }",
"function db_write_lock($table);",
"function lock( $table )\r\n {\r\n $this->query( \"LOCK TABLE $table IN SHARE MODE\" );\r\n }",
"public function lockThisTable()\n {\n self::lockTable($this->tableName());\n }",
"function lockEx($table){\n $result = $this->lock($table, $this->LOCK_EX);\n return $result;\n }",
"public function lockTable($tableName);",
"public abstract function lockTable($tableName);",
"public function lockTable($table){\r\n\t\treturn $this->db_query(\"LOCK TABLE \" . $table . \" WRITE\");\r\n\t}",
"function locktable($table,$mode=\"write\")\n {\n $table = str_replace(\"ALTPREFIX\",$this->altprefix,$table);\n $table = str_replace(\"PREFIX\",$this->tableprefix,$table);\n $result = $this->lock($table,$mode);\n return($result);\n }",
"function lock($selector, $table, $mode=self::EXCLUSIVE)\n {}",
"function db_lock($tables) {\n global $dbc;\n return mysql_query(\"LOCK TABLES {$tables}\",$dbc);\n}",
"function lock ()\n {\n $id = $this->_id;\n if (!$id)\n\t die_traced ('No session.');\n\n $this->_db->update ($this->_table, 'is_locked=1', \"id=$id\");\n }",
"function lock($table, $mode=\"write\") {\r\n \r\n if (!$this->connect()) {\r\n return 0; /* we already complained in connect() about that. */\r\n };\r\n\r\n $getsql = sprintf(\"INSERT into %s (%s, %s) VALUES ('%s', 0)\",\r\n $this->Lock_Table,\r\n $this->Lock_Name_Col,\r\n $this->Lock_ID_Col,\r\n strtolower($table).\"_p_lock\");\r\n $delsql = sprintf(\"DELETE FROM %s where %s='%s' AND %s=0\",\r\n $this->Lock_Table,\r\n $this->Lock_Name_Col,\r\n strtolower($table).\"_p_lock\",\r\n $this->Lock_ID_Col);\r\n $selsql = sprintf(\"SELECT * FROM %s where %s='%s' AND %s=0\",\r\n $this->Lock_Table,\r\n $this->Lock_Name_Col,\r\n strtolower($table).\"_p_lock\",\r\n $this->Lock_ID_Col);\r\n $timeout = $this->getmicrotime() + $this->Lock_Timeout;\r\n $got_lock = 0;\r\n $override = $this->Lock_Override;\r\n while (!$got_lock) {\r\n $got_lock = @odbc_exec($this->Link_ID, $getsql);\r\n if ($this->Debug && !$got_lock) {\r\n echo \"missed lock... looping\\n\";\r\n flush();\r\n }\r\n $currtime = $this->getmicrotime();\r\n if (!$got_lock) {\r\n if ($timeout < $currtime) {\r\n if (!$override) {\r\n # try to select existing lock\r\n if (!@odbc_exec($this->Link_ID, $selsql)) {\r\n # lock select failed. Either the table does not exist or the lock was\r\n # released just this instant. Try to get a lock to see which...\r\n $got_lock = @odbc_exec($this->Link_ID, $getsql);\r\n if (!$got_lock) {\r\n $this->halt(\"Lock select failed. Does the table $this->Lock_Table exist?\");\r\n }\r\n return $got_lock;\r\n }\r\n $this->halt(\"lock() failed.\");\r\n return 0;\r\n } else {\r\n # delete existing lock\r\n if ($this->Debug) {\r\n echo \"overriding lock\\n\";\r\n }\r\n\r\n if (!@odbc_exec($this->Link_ID, $delsql)) {\r\n # lock override failed. Either the table does not exist or the lock was\r\n # released just this instant. Try to get a lock to see which...\r\n $got_lock = @odbc_exec($this->Link_ID, $getsql);\r\n if (!$got_lock) {\r\n $this->halt(\"Lock override failed. Does the table $this->Lock_Table exist?\");\r\n }\r\n return $got_lock;\r\n } else {\r\n # just deleted the lock so try to get it straight away\r\n $got_lock = @odbc_exec($this->Link_ID, $getsql);\r\n $timeout = $currtime + $this->Lock_Timeout; # reset the timer\r\n $override = 0; # override once only\r\n # fall through to wait loop\r\n }\r\n }\r\n }\r\n }\r\n \r\n if (!$got_lock) {\r\n $waittime = $currtime + 0.5;\r\n while ($waittime > $this->getmicrotime()) {\r\n ;\r\n }\r\n }\r\n }\r\n if ($this->Debug && !$got_lock) {\r\n echo \"missed lock... bug!\\n\";\r\n } else {\r\n echo \"got lock\\n\";\r\n flush();\r\n }\r\n return $got_lock;\r\n }",
"function lockSh($table){\n $result = $this->lock($table, $this->LOCK_SH);\n return $result;\n }",
"function sqlLock($table, $type=\"WRITE\"){\nglobal $_shibahug__conn;\n\n//sets uppercase and checks that the type is valid\n$type = strtoupper($type);\nif ($type !== \"READ\" && $type !== \"WRITE\") throw new Exception('Invalid lock type. Received: '.$type);\n\n$sql = \"LOCK TABLES \";\n\n//both checks if the $table variable is valid and constructs appropiate query\nswitch (gettype($table)) {\ncase 'string':\n$sql .= $table;\nbreak;\n\ncase 'array':\n$sql .= implode(\", \", $table);\nbreak;\n\ndefault:\nthrow new Exception('Invalid $table var type');\nbreak;\n}\n\n$sql .= \" \".$type;\n$_shibahug__conn->query($sql);\n}",
"public function lock() {\n $this->locked = TRUE;\n $this->_allow_locked_save = TRUE;\n $this->save();\n }",
"public function locked();",
"public function lock();",
"private function _lockTables()\n {\n $lockSql = \"LOCK TABLES\n `\" . $this->getTable() . \"` AS t1 WRITE,\n `\" . $this->getTable() . \"` AS t2 WRITE,\n `\" . $this->getTable() . \"` AS t3 WRITE,\n `\" . $this->getTable() . \"` WRITE\";\n\n return $this->_pdoInstance->exec($lockSql);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates a new DoSRule in this store. It will be placed at the end of the list. | public function newDoSRule($name, $inPost = false)
{
$rule = new DoSRule($this);
$xmlElement = DH::importXmlStringOrDie($this->owner->xmlroot->ownerDocument, DoSRule::$templatexml);
$rule->load_from_domxml($xmlElement);
$rule->owner = null;
$rule->setName($name);
$this->addRule($rule, $inPost);
return $rule;
} | [
"protected function createRule()\n\t{\n\t\t$rule = $this->container->make('Boyhagemann\\Matcher\\Rule');\n\t\t$this->rules[] = $rule;\n\n\t\treturn $rule;\n\t}",
"public static function createFromArray($rrule, $startDate = null, $endDate = null, $timezone = null)\n {\n $rule = new static($rrule, $startDate, $endDate, $timezone);\n\n return $rule;\n }",
"protected function createRule()\n {\n foreach ($this->rules as $controller => $rule) {\n foreach ($rule as $singleRule) {\n if (is_array($singleRule)) {\n $option = [\n 'controllers' => [ $controller ],\n 'class' => 'yii\\filters\\AccessRule',\n ];\n $this->ruleList[] = Yii::createObject(array_merge($option, $singleRule));\n }\n }\n }\n }",
"public static function createFromString($rrule, $startDate = null, $endDate = null, $timezone = null)\n {\n $rule = new static($rrule, $startDate, $endDate, $timezone);\n\n return $rule;\n }",
"function _add_rule( $oRule )\n\t{\n\t\t$this->_aoRules[] = $oRule;\n\t}",
"public static function createRules(): AbstractRules\n {\n return new Rules;\n }",
"public function actionAddRule()\n {\n $request = Yii::$app->request;\n $model = new Rule(null);\n\n if ($model->load($request->post()) && $model->save()) {\n Yii::$app->getSession()->setFlash('success', Yii::t('roles', 'Rule has been created'));\n return $this->redirect(Url::toRoute(['rule/index']));\n } else {\n return $this->render('addRule', [\n 'model' => $model,\n ]);\n }\n }",
"public function newRuleCreateStruct(): RuleCreateStruct;",
"public function addRRule($rrule)\n\t{\n\t\tif ( is_string($rrule) || is_array($rrule) ) {\n\t\t\t$rrule = new RRule($rrule);\n\t\t}\n\t\telseif ( ! $rrule instanceof RRuleInterface ) {\n\t\t\tthrow new \\InvalidArgumentException('The rule must be a string, an array, or implement RRuleInterface');\n\t\t}\n\n\t\t// cloning because I want to iterate it without being disturbed\n\t\t$this->rrules[] = clone $rrule;\n\n\t\t$this->clearCache();\n\n\t\treturn $this;\n\t}",
"public function store(StoreRulesRequest $request)\n {\n if (! Gate::allows('rule_create')) {\n return abort(401);\n }\n $rule = Rule::create($request->all());\n\n\n\n return redirect()->route('admin.rules.index');\n }",
"public function addDNSRules()\n {\n $this->checkServer();\n\n $rules = $this->callApi('get', '/server/'.$this->server.'/firewall_rule')['data']->firewall_rules->firewall_rule;\n\n $toDelete = [];\n\n foreach ($rules as $rule) {\n if ($rule->source_address_start == '94.237.127.9' || $rule->source_address_start == '94.237.40.9'\n || $rule->source_address_start == '2a04:3540:53::1' || $rule->source_address_start == '2a04:3544:53::1') {\n $toDelete[] = $rule->position;\n }\n }\n\n rsort($toDelete);\n foreach ($toDelete as $pos) {\n $response = $this->callApi('delete', '/server/'.$this->server.'/firewall_rule/'.$pos);\n }\n\n $protocols = ['tcp', 'udp'];\n foreach ($protocols as $protocol) {\n $body = [\n 'firewall_rule' => [\n 'protocol' => $protocol,\n 'direction' => 'in',\n 'action' => 'accept',\n 'family' => 'IPv4',\n 'source_port_start' => 53,\n 'source_port_end' => 53,\n 'source_address_start' => '94.237.127.9',\n 'source_address_end' => '94.237.127.9',\n 'comment' => 'Automatic rule',\n ],\n ];\n $response = $this->callApi('post', '/server/'.$this->server.'/firewall_rule', $body);\n $body['firewall_rule']['source_address_start'] = $body['firewall_rule']['source_address_end'] = '94.237.40.9';\n $response = $this->callApi('post', '/server/'.$this->server.'/firewall_rule', $body);\n $body['firewall_rule']['family'] = 'IPv6';\n $body['firewall_rule']['source_address_start'] = $body['firewall_rule']['source_address_end'] = '2a04:3540:53::1';\n $response = $this->callApi('post', '/server/'.$this->server.'/firewall_rule', $body);\n $body['firewall_rule']['source_address_start'] = $body['firewall_rule']['source_address_end'] = '2a04:3544:53::1';\n $response = $this->callApi('post', '/server/'.$this->server.'/firewall_rule', $body);\n }\n\n return $response;\n }",
"public function addRule(Rule $rule): Manager\n {\n $this->rules[] = $rule;\n return $this;\n }",
"public function addRule() : self\n {\n\n // Try to create LogicItem out of this params.\n try {\n $logicItem = Rule::factoryWrapped(...func_get_args());\n } catch (Throwable $thr) {\n throw new RelationFailedToCreateRule([ $this->getName(), get_class($this) ]);\n }\n\n $this->addLogic($logicItem);\n\n return $this;\n }",
"public function getRuleObject()\n {\n if (is_null($this->ruleObject)) {\n $this->ruleObject = new RuleObject();\n $this->ruleObject->setExpression($this->expression);\n $this->ruleObject->setJson($this->json);\n }\n return $this->ruleObject;\n }",
"public function add($rule)\n {\n $this->_rules[] = $rule;\n }",
"public function add(FilterRule $filterRule)\n {\n if (!$this->contains($filterRule)) {\n $this->rules[] = $filterRule;\n }\n return $this;\n }",
"public function addRuleAction()\n {\n $result = array(\"result\" => \"failed\");\n if ($this->request->isPost() && $this->request->hasPost(\"rule\")) {\n $result = array(\"result\" => \"failed\", \"validations\" => array());\n $mdlWebFilter = new WebFilter();\n $node = $mdlWebFilter->rules->rule->Add();\n $node->setNodes($this->request->getPost(\"rule\"));\n $node->origin = \"webfilter\"; // set origin to this component - webfilter are manually created rules.\n $valMsgs = $mdlWebFilter->performValidation();\n\n foreach ($valMsgs as $field => $msg) {\n $fieldnm = str_replace($node->__reference, \"rule\", $msg->getField());\n $result[\"validations\"][$fieldnm] = $msg->getMessage();\n }\n\n if (count($result['validations']) == 0) {\n // save config if validated correctly\n $mdlWebFilter->serializeToConfig();\n Config::getInstance()->save();\n $result = array(\"result\" => \"saved\");\n }\n return $result;\n }\n return $result;\n }",
"public function addRule(\\PricePolicyRule\\Rule $rule) {\n $this->rules[] = $rule;\n }",
"public function add(Rule $rule)\n {\n $this->rules[] = $rule;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This catch the notification of the 'example.pubsub.time_event' | function time_event($params)
{
echo "New timestamp received: ";
var_dump($params);
} | [
"public function onTime()\n {\n }",
"public function onTimeReply()\n {\n }",
"public function onCertainTime(int $timeUnit, int $time)\n {\n }",
"public function setEventTime(string $time) : self;",
"function aerospace_event_time($id)\n {\n if ('events' === get_post_type()) {\n $time = get_post_meta($id, '_events_time', true);\n\n if ('' !== $time) {\n printf('<div class=\"entry-time\"><span class=\"meta-label\">' . esc_html('Time', 'aerospace') . '</span>%1$s</div>', $time); // WPCS: XSS OK.\n }\n }\n }",
"private function installTimeMessage()\n {\n // time message binding\n $this->bindInterceptor(\n $this->matcher->subclassesOf('Demo\\Sandbox\\Resource\\App\\First\\Greeting\\Aop'),\n $this->matcher->any(),\n [$this->requestInjection('Demo\\Sandbox\\Interceptor\\TimeMessage')]\n );\n }",
"public function notification_message_time_update()\n {\n echo $this->Home_model->notification_message_time_update_model();\n }",
"public function _ticket_time()\n\t{\n\t\t$swift = email::connect();\n\t\t$message = new Swift_Message('Time Added On Ticket #'.Event::$data->ticket->id,\n\t\t View::factory('emails/ticket_time')->set(array('time' => Event::$data)),\n\t\t 'text/html');\n\t\t$recipients = new Swift_RecipientList();\n\n\t\t$role = Auto_Modeler_ORM::factory('email_role')->fetch_where(array('user_id' => Event::$data->user_id));\n\t\tif (count($role) AND $role->current()->ticket_time)\n\t\t{\n\t\t\t$user = Auto_Modeler_ORM::factory('user', Event::$data->ticket->user_id);\n\t\t\t$recipients->addTo($user->email, $user->first_name.' '.$user->last_name);\n\t\t}\n\n\t\t$role = Auto_Modeler_ORM::factory('email_role')->fetch_where(array('user_id' => Event::$data->created_by));\n\t\tif (count($role) AND $role->current()->ticket_time)\n\t\t{\n\t\t\t$user = Auto_Modeler_ORM::factory('user', Event::$data->ticket->created_by);\n\t\t\t$recipients->addTo($user->email, $user->first_name.' '.$user->last_name);\n\t\t}\n\n\t\ttry\n\t\t{\n\t\t\t$swift->send($message, $recipients, $_SESSION['auth_user']->email);\n\t\t}\n\t\tcatch (Swift_ConnectionException $e)\n\t\t{\n\t\t\tthrow new Kohana_User_Exception('swift.general_error', $e->getMessage());\n\t\t}\n\t}",
"public function event() {\n\t\t/**\n\t\t * Fires before cron event.\n\t\t *\n\t\t * @since 1.0\n\t\t */\n\t\tdo_action( 'ptq_before_event' );\n\n\t\t// Get current action name\n\t\t$current_hook = current_filter();\n\n\t\t// Get current post type by subtracting 'ptq_event_'\n\t\t$post_type = substr( $current_hook, 10 );\n\n\t\t// If post type exists, publish queued post\n\t\tif ( post_type_exists( $post_type ) ) {\n\t\t\t$this->maybe_publish( $post_type );\n\t\t}\n\n\t\t/**\n\t\t * Fires after cron event.\n\t\t *\n\t\t * @since 1.0\n\t\t */\n\t\tdo_action( 'ptq_after_event' );\n\t}",
"function api_newTimeEntry(){\n\t$db=Database::getDB();\n\t$empty=$db->putEmptyTime();\n\tif($empty){\n\t\ttpr_asyncOK(['id'=>$empty['time_id']]);\n\t}else{\n\t\ttpr_asyncError('Database error occurred while logging time.');\n\t}\n}",
"public function handle_notifications()\n {\n }",
"public function broadcastEventReceived($sender,$param);",
"protected function updateLastNotificationTime()\n {\n $this->last_notification = time();\n }",
"private function notification(){\n\t\n\t}",
"function onTimeStep();",
"function mytime()\n {\n \t\n \t/*\n \t\tthe form is using the term id so getting the term object to put the term\n \t\tinfo into the database\n \t*/\n \t$project_info = taxonomy_term_load($_POST['project_id']);\n \t\n \t/* clean the user input */\n \t$user_task = check_plain($_POST['user_task']);\n \t\n \t/* clean user input */\n \t$project_hours = check_plain($_POST['hours_used']);\n \t\n \t/* clean user input */\n \t$event_date = check_plain($_POST['event_date']);\n \t \t\n \t\n \t/* add record to user database */\n \tglobal $user;\n \t \t\n \t$event = db_insert('timetracker_project_events') \n\t\t\t\t->fields(array(\n\t\t\t\t 'user_id' => $user->uid,\n\t\t\t\t 'project_id' => $project_info->tid,\n\t\t\t\t 'project_name' => $project_info->name,\n\t\t\t\t 'project_user_task' => $user_task,\n\t\t\t\t 'event_date' => $event_date,\n\t\t\t\t 'project_hours' => $project_hours,\n\t\t\t\t 'created' => date(\"Y-m-d H:i:s\"),\n\t\t\t\t 'changed' => date(\"Y-m-d H:i:s\")\n\t\t\t\t))\n\t\t\t\t->execute();\n\t\t\t\t\n\t\t/* inform the user */\n\t\t//drupal_set_message(t( 'Confirming ') . $project_hours . t(' task hours added to ') . $project_info->name . t(' for ') . $event_date );\n\t\t\n\t\t/* show the updated report */\n\t\tprint $event_date.'}{'. self::dailyreport(TRUE, $event_date);\n \t \t\n }",
"abstract protected function handle_notification($p_notification);",
"function single_event_hentry_time($the_time, $d, $post){\n if ( class_exists( 'Tribe__Events__Main' ) ) {\n $post_type = get_post_type($post);\n if ($post_type == Tribe__Events__Main::POSTTYPE){\n $the_time = tribe_get_start_date( $post, false, $d );\n }\n }\n return $the_time;\n }",
"public function handleHourlyTimerCallback() {\n\t\t$this->checkShutdown();\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ goto Smart meter App /html/body/approot/apppartnerdetail/div/main/div/div/div[2]/div/div/div[3]/div[2]/a /html/body/approot/appstart/div/appstartpageloggedin/main/div/div[2]/div[1]/apprecentlyused/div/div/div/div[1]/div[2]/ul/li[1]/ul/li/a | private function clickSMLinkIf()
{
$xpath1='/html/body/app-root/app-partner-detail/div/main/div/div/div[2]/div/div/div[3]/div[2]/a';
$xpath2='/html/body/app-root/app-start/div/app-startpage-loggedin/main/div/div[2]/div[1]/app-recently-used/div/div/div/div[1]/div[2]/ul/li[1]/ul/li/a';
$status=$this->pressButtonIf($xpath1);
if ($status===false) // alternativen Link probieren, Web Layout wurde gestrafft
{
$status=$this->pressButtonIf($xpath2); // das dauert aber jetzt zum Laden
}
return ($status);
} | [
"function apps_app_details_page($server_name, $app_name) {\n apps_include('manifest');\n $apps = apps_apps($server_name , array('machine_name' => $app_name)) ;\n $apps[$app_name]['#theme'] = 'apps_app_page';\n return $apps[$app_name];\n}",
"function goToKostenLink()\n {\n $xpath='//*[@id=\"site-wrapper\"]/header/ul[2]/li[6]/ul/li[3]/a';\n $url = 'https://www.drei.at/selfcare/restricted/prepareCoCo.do';\n $status= $this->pressButtonIf($xpath); // erst den Button für den Link drücken. Wenn nicht erfolgreich\n if ($status===false) return($this->updateUrl($url)); // dann den dahinterliegenden link aufrufen\n return ($status); \n }",
"function GenStartURL($data,$item)\n {\n $args=$this->CGI_URI2Hash();\n \n unset($args[ \"ModuleName\" ]); \n $args[ \"Action\" ]=$data;\n $args[ \"Unit\" ]=$item[ \"ID\" ];\n \n $server=$item[ \"SystemURL\" ];\n \n return\n $server.\n \"?\".\n $this->CGI_Hash2URI($args).\n \"\";\n }",
"public function getDefaultPage($app) {\n if($defaultPage = $this->_helper()->getAppConfig($app, 'default_page')){\n return $this->getUrl($defaultPage);\n }\n $appkey = str_replace('magestore_', '', strtolower($app));\n $menuPath = $appkey;\n if($appkey == 'webpos')\n $menuPath = 'sales/children/webpos';\n $menu = Mage::getSingleton('admin/config')->getAdminhtmlConfig()->getNode('menu/' . $menuPath . '/children');\n if ($menu) {\n foreach ($menu->children() as $menuItem) {\n return $this->getUrl($menuItem->action);\n }\n }\n }",
"function ju_current_url():string {return ju_url_o()->getCurrentUrl();}",
"function wpop_mobile_to_regular_link() {\n \n}",
"function page_visit() {\r\n\t\t$this->online_users->get_info()['useronline'][\"$_SERVER[REMOTE_ADDR]\"]['uri'];\r\n\t}",
"public function goPodium()\n {\n return Yii::$app->getResponse()->redirect([self::ROUTE_DEFAULT]);\n }",
"Function TW_MOBILEAPP_REDIRECT() {\n\t$redirectURL = $AndroidAPP = $iOSAPP = '';\n\tif (parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH) === '/mobileapp-redirect'){\n\t\t\n\t\tswitch(strtoupper($_GET[\"app\"])){\n\t\t\tcase 'CHINESELEARNINFO':\n\t\t\t\t$AndroidAPP = 'ChineseLearnInfo';\n\t\t\t\t$WEBURI = 'app-chinese-learn-info/';\n\t\t\t\tbreak;\n\t\t\tcase 'FIMEXPRODUCTCATEGORY':\n\t\t\t\t$iOSAPP = 'fimex-product-category/id1084698788';\n\t\t\t\t$AndroidAPP = 'FIMEX.ProductCategory';\n\t\t\t\t$WEBURI = 'app-fimex-product-category/';\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t}\n\t\t\n\t\t// Include and instantiate the class.\n\t\trequire_once 'Mobile_Detect.php';\n\t\t$detect = new Mobile_Detect;\n\t\t\n\t\t// Check for a specific platform with the help of the magic methods:\n\t\tif ($_GET[\"app\"] <> ''){\n\t\t\tif( $detect->isiOS() ){\n\t\t\t\t$redirectURL='https://geo.itunes.apple.com/app/' . $iOSAPP;\n\t\t\t}else if ($detect->isAndroidOS()){\n\t\t\t\t$redirectURL='market://details?id=com.twoudia.' . $AndroidAPP;\n\t\t\t}else {\n\t\t\t\t$redirectURL='https://www.twoudia.com/activities/' . $WEBURI;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif($redirectURL == ''){return null;}else{\n\t\t\theader('Location: ' . $redirectURL, false, 302);\n\t\t\tdie();\n\t\t}\n\t}\n}",
"public function redirectToAppAction() {\n $appUrl = $this->getRequest()->getParams()[\"app\"];\n\n $returnUrl = urlencode(Mage::helper(\"adminhtml\")->getUrl(\"adminhtml/webhooks/allow\"));\n $registerAppUrl = urlencode(Mage::getUrl('webhooks/app/register'));\n\n $session = Mage::getSingleton(\"core/session\", array(\"name\"=>\"frontend\"));\n $session->setData(\"appUrl\", $appUrl);\n\n $this->_redirectUrl(\"$appUrl?magento[return_url]=$returnUrl&magento[register_app_url]=$registerAppUrl\");\n }",
"function SERVICE_RETURN_PLAYER_HREF_wmmobile(){\n\t\treturn ' target=\"embeddedPlayer\" onclick=\"openMediaPlayer(this.href, 300, 150); return false;\"';\n\t}",
"function parse_owner_page($url){\n\n\n\n\n\n\n\n\n\n\n}",
"public function clicklink1()\n {\n $I = $this;\n $I->amOnPage(FirstPage::$URL);\n $I->waitForElementVisible(FirstPage::$link1, 5 );//$link1 is xpath of\"email me a login link\" hyperlink\n $I->click(FirstPage::$link1);\n\n }",
"public function topFreeAppsAction() {\n\n //Validate Heder params\n $headersParams = $this->validateHeaderParams();\n\n $userAgent = $headersParams['userAgent'];\n $chapId = $headersParams['chapId'];\n\n //Get the parameters \n $category = trim($this->_getParam('category', null));\n\n //Detect the device id from thd db according to the given user agent\n $deviceId = $this->deviceAction($userAgent);\n\n //Check if the device was detected or not, if not retrun a message as below\n if ($deviceId === null || empty($deviceId)) \n { \n $this->__echoError(\"2000\", \"Device not found\", self::BAD_REQUEST_CODE);\n } \n else \n { //Get Featured Apps based on Chap and the Device\n \n $ApiModel = new Nexva_Api_NexApi();\n\n $apiCall = true;\n\n //Featured apps for banners\n $freeApps = $ApiModel->freeAppsAction($chapId, 15, $deviceId, $apiCall, $category);\n\n //change the thumbnail path\n if (count($freeApps) > 0) \n {\n $apps = str_replace('\\/', '/', json_encode($freeApps));\n $this->loggerInstance->log('Response ::' . $apps,Zend_Log::INFO);\n echo $apps; \n } \n else \n {\n $this->__echoError(\"3000\", \"Data Not found\", self::BAD_REQUEST_CODE); \n }\n }\n }",
"public function clicklink4()\n {\n $I = $this;\n $I->amOnPage(FirstPage::$URL);\n $I->waitForElementVisible(FirstPage::$link4, 5);//$link4 is xpath of\"Back to WordPress.com\" hyperlink\n $I->click(FirstPage::$link4);\n\n }",
"function get_modulos_app($vals) {\n\t\textract($vals);\n\t\treturn \"<a href=../modulos/index.php?contenido={$record['app_id']}><i class='fa fa-search text-bg text-danger'></i></a>\";\n}",
"private function ___goToVendor() {\n \n $_sURL = AmazonAutoLinks_Registry::PLUGIN_URI;\n $_oOption = AmazonAutoLinks_Option::getInstance();\n $_isAffiliateID = $_oOption->get( 'miunosoft_affiliate', 'affiliate_id' );\n if ( strlen( $_isAffiliateID ) ) {\n $_sURL = add_query_arg(\n array(\n 'ref' => $_isAffiliateID,\n ),\n AmazonAutoLinks_Registry::STORE_URI_PRO\n );\n }\n \n exit( wp_redirect( $_sURL ) );\n }",
"function scrap_page_next($url)\n {\n $page = curl_get_file($url);\n $regex = '@(?s)<h2.*?Add to Compare@';\n preg_match_all($regex,$page,$match);\n if($match == null)\n echo \"No match found!!\";\n else\n {\n foreach($match[0] as $m)\n scrap($m);\n }\n \n //To find next url\n $regex = '@<link\\s*rel=\"next\"\\s*href=\"(.*)?\"@';\n preg_match($regex,$page,$u);\n if($u == null)\n return null;\n else \n return $u[1]; \n }",
"public function getHomeXpath()\n {\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Clean a schema of any arg_options. | protected function clean_schema( $schema ) {
if ( is_array( $schema ) ) {
foreach ( $schema as $key => $value ) {
if ( is_array( $value ) ) {
unset( $value['arg_options'] );
$schema[ $key ] = $this->clean_schema( $value );
}
}
}
return $schema;
} | [
"private static function cleanup_options() {\n\t\tforeach ( self::$options as $option ) {\n\t\t\tdelete_option( $option );\n\t\t}\n\t}",
"private function clean()\n {\n foreach (['label', 'jquery', 'helper', 'states', 'selectOptions', 'livewire', 'options', 'checked', 'after'] as $val) {\n // is array value\n if (($key = array_search($val, $this->options, true)) !== false) {\n // Don't unset IDs\n if ($key !== 'id') {\n unset($this->options[$key]);\n }\n }\n\n // is array key\n unset($this->options[$val]);\n }\n\n if ($this->type === 'select') {\n unset($this->options['value']);\n }\n }",
"public function dropSchema();",
"private function normalize(&$options = null): void\n {\n }",
"protected static function clean_data() {\n\n\t\tdelete_option( 'better_yourls' );\n\t\tdelete_metadata( 'post', null, '_better_yourls_short_link', null, true );\n\n\t}",
"public function dropSchema()\n {\n return $this->alter('{\"drop_all\": true}');\n }",
"protected function _removeOptions()\r\n {\r\n \\delete_option('eawp_path');\r\n \\delete_option('eawp_url');\r\n }",
"public function revert_schema();",
"public static function clear_schema() {\n\t\t\tself::$type_registry = null;\n\t\t\tself::$schema = null;\n\t\t}",
"protected function resetAttributes()\n {\n foreach ($this->options as $op=>$junk) {\n if (preg_match('#Destination.AttributeList#', $op)) {\n unset($this->options[$op]);\n }\n }\n }",
"public function destroySchema()\n {\n\n }",
"public function unset_options() {\n\t\t\tdelete_option( $this->get_prefix() );\n\t\t}",
"public function clearOptions() {\n $this->options = array();\n }",
"final public function rebuildSchema()\n\t\t{\n\t\t\t$this->schema = $this->buildSchema();\n\t\t}",
"public function clearOptions()\n {\n $this->_options = array();\n }",
"function remove_option_whitelist($del_options, $options = '')\n {\n }",
"public static function clearArgs()\n {\n self::$_args = array();\n }",
"public function resetArguments()\n {\n $this->prefix = null;\n $this->middleware = null;\n }",
"function pvw_options_reset() {\n\t\t\n\t\t$delete = delete_option('pvw_'.NAP_PVW_PLUGIN_SHORTCODE.'_options');\n\t\tself::pvw_options_setup();\n\t\t\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function Messages, Parameter list: $key="",$skey="Name" Dynamic read of module Messages. | function Messages($key="",$skey="Name")
{
if (empty($this->Messages))
{
$this->MyMod_Language_Read();
}
if (!empty($key))
{
if (!empty($this->Messages[ $key ]))
{
return $this->GetRealNameKey($this->Messages[ $key ],$skey);
}
return $key;
}
return $this->Messages;
} | [
"function Language_Message($key,$subkey=\"Name\")\n {\n $message=$this->MyLanguage_GetMessage($key,$subkey);\n \n if ($subkey==\"Name\")\n {\n $title=$this->MyLanguage_GetMessage($key,\"Title\",\"\",FALSE);\n if (!empty($title))\n {\n $message=$this->Span($message,array(\"TITLE\" => $title));\n }\n }\n\n return $message;\n }",
"function get_message($key = '')\r\n{\r\n\t$message = array(\r\n\t\t\t\t\t\t'save_success' \t\t\t\t\t=> t('Information has been saved.'),\r\n\t\t\t \t\t'save_failed' \t\t\t\t\t=> t('Failed to save your information.'),\r\n\t\t\t\t\t\t'del_success' \t\t\t\t\t=> t('Information has been removed.'),\r\n\t\t\t\t\t\t'del_failed' \t\t\t\t\t=> t('Information has failed to removed.'),\r\n 'no_result' => t('No information found.'),\r\n 'login_greet' => t('Please login with your Username and Password.'),\r\n 'forgot_greet' => t('Please provide email to receive new password.'),\r\n 'confirmation' => t('Are you sure to delete this'),\r\n 'restore_confirm' => t('Are you sure you want to restore access to default'),\r\n 'approve_confirmation' => t('Are you sure you want to approve this business'),\r\n 'apply_approve_confirmation' => t('Are you sure you want to apply for approval of this business'),\r\n\t\t\t\t\t\t'doc_uploaded' \t\t\t\t => t('A new document has been uploaded successfully. Once you will press the \"save changes\" button, then it will be saved permanently.'),\r\n 'usr_typ_emt' => t('The user must have at least one user role assigned.'),\r\n 'ofc_num_er' => t('Please provide office#.'),\r\n 'dup_rc_rm' => t('Duplicate record discarded.'),\r\n 'country_state' => t('Please select Country and State/Province first.'),\r\n 'county_exist' => t('The county already exists. Please select this county.'),\r\n 'biz_img_uploaded' => t('A new image has been uploaded successfully. Once you will press the \"save changes\" button, then it will be saved permanently.'),\r\n 'biz_doc_uploaded' => t('A new doc has been uploaded successfully. Once you will press the \"save changes\" button, then it will be saved permanently.'),\r\n 'applied_for_approved' => t('Business has been sent successfully for approval.'),\r\n 'business_approved' => t('Business has been approved successfully.'),\r\n\t\t\t\t\t\t'unable_to_apply' => t('Unable to sent business for approval. Please try again later.'),\r\n 'first_name' => t('Please provide first name.'),\r\n 'last_name' => t('Please provide last name.'),\r\n 'email' => t('Please provide valid email.'),\r\n 'zipcode' => t('Please provide zip/postal code.'),\r\n 'password' => t('Please provide password.'),\r\n 'con_pass' => t('Password and confirm password must be same.'),\r\n 'buyer_alreay_added' => t('Buyer already tagged with this business.'),\r\n 'select_buyer' => t('Please select buyer to add him/her with this business.'),\r\n 'contact_save_success' => t('Information has been send successfully.'),\r\n 'buyer_reg_success' => t('Registration has been successful. Please check your email for login details and registration confirmation email.'),\r\n 'buyer_login_failed' => t('Login failed. Please check your username or password.'),\r\n 'username_not_exist' => t('Sorry! Username does not found.'),\r\n 'password_reset' => t('Password has been reset successfully and sent to #EMAIL#'),\r\n 'comment_sent' => t('Your comment/question has been sent successfully.'),\r\n 'verified' => t('Congratulations! You have successfully verified your email address. Please login to continue.'),\r\n 'verification_failed' => t('Sorry verification failed. Please try latter. Contact us if any problem persist.'),\r\n 'loggedin' => t('Please loggedin first.'),\r\n 'biz_exist' => t('Business already saved to your saved business list.'),\r\n\t\t\t\t\t);\r\n\t\t\t\t\t\r\n\treturn $key == '' ? $message : $message[$key];\r\n}",
"public function getMessages(string $key = 'message'): array;",
"public function getMessage($key) {\n\t\tif(isset($this->msg[$key]))\n\t\t\treturn $this->msg[$key];\n\t}",
"abstract public function defineMessages();",
"public function getMessageKey() {}",
"public function getMessages();",
"public function messages($name=null);",
"public function getMessages()\n {\n }",
"function _add_msg() {\n\t$this->_output['language'] = $GLOBALS['conf']['LANGUAGE'];\n\t$sel_lang = isset($this->_input['lang_code']) ? $this->_input['lang_code'] : $GLOBALS['conf']['LANGUAGE']['English'];\n\t$this->_output['sel_lang'] = $sel_lang;\n\tif (!$this->_input['chk']) {\n\t $this->_output['tpl'] = 'admin/setting/add_msg_main';\n\t} else {\n\t $cond = \"key_name = '\" . strtoupper($this->_input['key_name']) . \"' AND lang_code ='\" . $sel_lang . \"'\";\n\t $sql = get_search_sql(\"message\", $cond);\n\t $res = mysql_fetch_assoc(mysql_query($sql));\n\t $this->_output['row'] = $res;\n\t $this->_output['tpl'] = 'admin/setting/add_msg_new';\n\t}\n }",
"static function getMessages(){\n if(key_exists(MESSAGES, $_REQUEST)){\n return $_REQUEST[MESSAGES];\n }else{\n return array();\n }\n }",
"public function getMessages() {\n $parameters = StatusAPI::getParameters();\n if ($_GET['action'] == 'messages') {\n $db = new \\Status\\DB\\Messages();\n if (isset($parameters['field']['q']) || isset($parameters['field']['id'])) {//show a only array messages ID \n if(isset($parameters['field']['id'])){ \n if(is_numeric($parameters['field']['id'])){\n $response = $db->getMessageID($parameters['field']['id']);\n }else{\n StatusAPI::response(422, \"error\", \"The id value is incorrect\");\n exit;\n }\n }else{ \n $response = $db->getMessage($parameters);\n }\n print_r(json_encode($response));\n } else { //show a array with all messages \n if(isset($_GET['id'])){\n if(is_numeric($_GET['id'])){ \n $response = $db->getMessageID($_GET['id']);\n }else{\n StatusAPI::response(422, \"error\", \"The id value is incorrect\"); \n exit;\n }\n }else{ \n $response = $db->getAllMessages();\n }\n print_r(json_encode($response));\n }\n } else {\n StatusAPI::response(400,\"error\", \"Bad request\");\n }\n }",
"public function testGetMessageFromKey()\n {\n $storage = ['slimFlash' => [ 'Test' => ['Test', 'Test2']]];\n $flash = new Messages($storage);\n\n $this->assertEquals(['Test', 'Test2'], $flash->getMessage('Test'));\n }",
"public function getMessages(?string $key = null) : array\n {\n if ($key !== null) {\n return $this->flextype['flash']->getMessage($key);\n }\n\n return $this->flextype['flash']->getMessages();\n }",
"function Messages_init()\n{\n // Get datbase setup - note that both pnDBGetConn() and pnDBGetTables()\n // return arrays but we handle them differently. For pnDBGetConn()\n // we currently just want the first item, which is the official\n // database handle. For pnDBGetTables() we want to keep the entire\n // tables array together for easy reference later on\n $dbconn =& pnDBGetConn(true);\n $pntable =& pnDBGetTables();\n\n // Create a new data dictionary object\n $dict = NewDataDictionary($dbconn);\n\n // Define any table specific options\n\t$taboptarray =& pnDBGetTableOptions();\n\n // It's good practice to name the table and column definitions you\n // are getting - $table and $column don't cut it in more complex\n // modules\n $messagestable = &$pntable['priv_msgs'];\n $messagescolumn = &$pntable['priv_msgs_column'];\n\n // Create the table - the formatting here is not mandatory, but it does\n // make the SQL statement relatively easy to read. Also, separating out\n // the SQL statement from the Execute() command allows for simpler\n // debug operation if it is ever needed\n $sql = \"\n pn_msg_id int(11) NOTNULL AUTO PRIMARY,\n pn_msg_image C(100) NOTNULL DEFAULT '',\n pn_subject C(100) NOT NULL DEFAULT '',\n pn_from_userid int(11) NOTNULL DEFAULT '0',\n pn_to_userid int(11) NOTNULL DEFAULT '0',\n pn_msg_time C(20) DEFAULT '',\n pn_msg_text X DEFAULT '',\n pn_read_msg int(4) NOTNULL\n \";\n\n // create the data dictionaries SQL array\n\t// This array contains all the ncessary information to execute some sql \n\t// on any of the supported dbms platforms\n $sqlarray = $dict->CreateTableSQL($messagestable, $sql, $taboptarray);\n\n // Execute the sql that has been created\n $result = $dict->ExecuteSQLArray($sqlarray, false);\n\n // Check for an error with the database code, and if so set an\n // appropriate error message and return\n\tif ($result == 0) {\n pnSessionSetVar('errormsg', _CREATETABLEFAILED);\n return false;\n }\n\n\t// activate the bbsmile hook for this module if the module is present\n\tif (pnModAvailable('pn_bbsmile')) {\n\t\tpnModAPIFunc('Modules', 'admin', 'enablehooks', \n\t\t array('callermodname' => 'Messages', \n\t\t\t\t 'hookmodname' => 'pn_bbsmile'));\n\t}\n\tif (pnModAvailable('pn_bbcode')) {\n\t\tpnModAPIFunc('Modules', 'admin', 'enablehooks', \n\t\t array('callermodname' => 'Messages', \n\t\t\t\t 'hookmodname' => 'pn_bbcode'));\n\t}\n // Initialisation successful\n return true;\n}",
"public function messages()\n {\n }",
"public function getMessages($key = null)\n {\n if (null !== $key) {\n return $this->flash->getMessage($key);\n }\n\n return $this->flash->getMessages();\n }",
"protected abstract function getBaseMessage($locale, $key);",
"public function getServiceMessages(){\n if (!$this->GetOnlineState()) return null;\n $filter=array('Result_array');\n return self::Call('Control','getServiceMessages',null,$filter);;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Define if current model has difference between original and result data | public function hasDifference() {return !!$this->_calculateDifference();} | [
"protected function _calculateDifference()\n {\n if (is_null($this->_difference)) {\n $updatedParams = $newParams = $sameParams = $difference = array();\n $newOriginalData = $origData = $this->getOriginalData();\n $newResultData = $resultData = $this->getResultData();\n\n if (!is_array($origData)) {\n $origData = array();\n }\n if (!is_array($resultData)) {\n $resultData = array();\n }\n\n if (!$origData && $resultData) {\n $newOriginalData = array('__was_created' => true);\n $difference = $resultData;\n }\n elseif ($origData && !$resultData) {\n $newResultData = array('__was_deleted' => true);\n $difference = $origData;\n }\n elseif ($origData && $resultData) {\n $newParams = array_diff_key($resultData, $origData);\n $sameParams = array_intersect_key($origData, $resultData);\n foreach ($sameParams as $key => $value) {\n if ($origData[$key] != $resultData[$key]) {\n $updatedParams[$key] = $resultData[$key];\n }\n }\n $newOriginalData = array_intersect_key($origData, $updatedParams);\n $difference = $newResultData = array_merge($updatedParams, $newParams);\n if ($difference && !$updatedParams) {\n $newOriginalData = array('__no_changes' => true);\n }\n }\n\n $this->setOriginalData($newOriginalData);\n $this->setResultData($newResultData);\n\n $this->_difference = $difference;\n }\n return $this->_difference;\n }",
"private function calcutateDiff () {\n $this->getUpater()->clearDiff();\n $sucess = true;\n foreach ($this->clones as $clone) {\n #$sucess = $sucess && $this->validateOrigin( $clone );\n if ($this->getDiff( $clone )) {\n $sucess = $sucess && $this->validateOrigin( $clone );\n }\n }\n return $sucess;\n }",
"protected function _hasModelChanged(){\n if (!$this->hasDataChanges()) {\n return false;\n }\n\n return $this->_getResource()->hasDataChanged($this);\n }",
"public function hasChanged() {\n return !!DiffArray::diffAssocRecursive($this->original, $this->data);\n }",
"private function determineDiff()\n {\n // Determine what we're working with\n $attributes = ( ! count($this->getOriginal())) ? $this->getAttributes() : $this->getOriginal();\n $new = ( ! count($this->getOriginal()));\n\n // Compare each attribute\n foreach ($attributes as $key => $value)\n {\n // Skip vocal internal keys or ignored keys\n if ($key == '_hydratedByVocal' || $key == '_validatedByVocal' || in_array($key, $this->diffIgnore)) continue;\n\n if ($new) $this->diff[$key] = array('new' => $value);\n else if ($value != $this->$key)\n {\n $this->diff[$key] = array(\n 'original' => $value,\n 'updated' => $this->$key\n );\n }\n }\n }",
"public function checkDiff()\n {\n return $this->mutation->checkDiff();\n }",
"public function isAltered() {\n\t\treturn $this->value !== $this->original;\n\t}",
"public function isDirty()\n {\n return !($this->attributes === $this->original);\n }",
"public function hasOriginal()\n {\n return $this->resource->hasOriginal();\n }",
"public function hasNotTransformed(): bool;",
"public function hasOldInput();",
"protected function calculate_changed() {\n $this->changed = sizeof($this->new_data) > 0 || $this->changed_children_count > 0;\n }",
"public function hasDataChanges () {\n return !!$this->dataDirty;\n }",
"public function determineCopyEstimates()\n {\n return (($this->monthYear == date(\"Y-m-1\", time())) || ($this->monthYear == date(\"Y-m-1\", strtotime('last month')) && date('d') < 3));\n }",
"function predictedCorrectDifference($prediction) {\n if (is_null($prediction->match->score_home) && is_null($prediction->match->score_away)) {\n return FALSE;\n }\n\n $predicted_difference = $prediction->score_home - $prediction->score_away;\n $match_difference = $prediction->match->score_home - $prediction->match->score_away;\n\n // print_r($predicted_difference .\" | \". $match_difference);\n\n if ($predicted_difference == $match_difference) {\n // print_r(\" - 3\\n\");\n return TRUE;\n }\n\n // print_r(\"\\n\");\n return FALSE;\n}",
"protected function _revisionedDataWasModified()\n {\n $attributes = $this->_config->getPageRevisionControledAttributes();\n foreach ($attributes as $attr) {\n $value = $this->getData($attr);\n if ($this->getOrigData($attr) !== $value) {\n if ($this->getOrigData($attr) === NULL && $value === '' || $value === NULL) {\n continue;\n }\n return true;\n }\n }\n return false;\n }",
"function compare_result($result, $expected) {\n\tfor($i=0; $i<count($expected); ++$i) {\n\t\t$ok = false;\n\t\tforeach(array_keys($result) as $k) {\n\t\t\tif($result[$k] == $expected[$i]) {\n\t\t\t\t$ok = true;\n\t\t\t\tunset($result[$k]);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif($ok == false) {\n\t\t\techo \"Expected to find model \" . var_export($expected[$i], true) . \"\\n\";\n\t\t\treturn false;\n\t\t}\n\t}\n\n\treturn empty($result);\n}",
"function changed()\n {\n return($this->needInsert ||\n (is_array($this->changed) && count($this->changed) > 0));\n }",
"public function isSameScoreDifference() {\n \n if (false === isset($this->intRealHomeScore) || false === isset($this->intBetHomeScore)) {\n throw new \\BadMethodCallException(\"Real and bet results must be set\");\n }\n \n return $this->intRealHomeScore - $this->intRealAwayScore === $this->intBetHomeScore - $this->intBetAwayScore;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Checks if post is listing | public static function is_post_listing( $id ) {
$listing = self::get_listing( $id );
return ! empty ( $listing );
} | [
"public function isPostspage() {\n $target = $this->target();\n return $target && $target->id == Config::meta('posts_page');\n }",
"public function isPostsArchivePage() {\n if(is_admin() && isset($_GET['post'])) {\n if ((int)$_GET['post'] == get_option('page_for_posts')) {\n return true;\n }\n }\n return false;\n }",
"public function isPost()\n {\n return $this->type === 'post';\n }",
"function snax_is_post_a_list( $post_id = 0 ) {\n\t$format = snax_get_post_format( $post_id );\n\n\treturn in_array( $format, array( 'list', 'ranked_list', 'classic_list' ) );\n}",
"public function is_allowed_post() {\n global $typenow;\n return in_array($typenow, array('post', 'page'));\n }",
"private static function is_viewing_liveblog_post() {\n\t\treturn (bool) ( is_single() && self::is_liveblog_post() );\n\t}",
"private function requested_post_is_valid() {\n\t\treturn ( get_post_type( (int) $_GET['post_id'] ) === $this->post_type && get_post_status( (int) $_GET['post_id'] ) === 'publish' );\n\t}",
"public function isListingItem()\n {\n return false;\n }",
"protected function is_list_page() {\n\t\treturn false;\n\t}",
"function snax_is_post_open_list( $post_id = 0 ) {\n\t$post = get_post( $post_id );\n\n\t$is_list \t\t= snax_is_format( 'list', $post );\n\t$is_open_list\t= 'none' !== get_post_meta( $post->ID, '_snax_post_submission', true );\n\n\treturn $is_list && $is_open_list;\n}",
"function is_post_status_viewable($post_status)\n {\n }",
"public function is_static_posts_page()\n {\n }",
"protected function is_list_page() {\r\n return false;\r\n }",
"public function isSlidesFromPosts(){\r\n\t\t$this->validateInited();\r\n\t\t$sourceType = $this->getParam(\"source_type\",\"gallery\");\r\n\t\tif($sourceType == \"posts\" || $sourceType == \"specific_posts\")\r\n\t\t\treturn(true);\r\n\t\t\r\n\t\treturn(false);\r\n\t}",
"function cgit_seo_is_post() {\n return is_single() || is_page();\n}",
"public function isAdminPage()\n\t{\n\t\tif ( isset( $_GET['post'] ) ) {\t\n\t\t\t$postId = (int) $_GET['post'];\n\t\t\t$post = get_post( $postId );\n\t\t\t$postType = $post->post_type;\t\t\t\t\n\t\t} elseif ( isset($_GET['post_type']) ) {\t\n\t\t\t$postType = $_GET['post_type'];\t\n\t\t} else {\n\t\t\t$postType = false;\n\t\t}\n\t\t\t\n\t\treturn ( $postType && $this->postTypeStr === $postType );\n\t}",
"public function isSlidesFromPosts(){\n\t\treturn $this->is_posts();\n\t}",
"function book_has_post() {\r\n\tglobal $book;\r\n\t\r\n\treturn ( $book->post > 0 );\r\n}",
"protected function isPostListQuery( \\WP_Query $query ) {\n return (\n is_admin() &&\n $query->is_main_query() &&\n $query->get( 'post_type' ) === static::SLUG\n );\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get JS for tr | function __get_js_tr($ident) {
$script = array();
if(isset($this->handler_tr) && is_array($this->handler_tr)) {
foreach($this->handler_tr as $k => $v) {
$script[]= ' '.$k.'="'.$v.'(this, \''.$ident.'\')"';
}
}
return join(' ', $script);
} | [
"public function getRowClickCallback()\n {\n $chooserJsObject = $this->getId();\n $js = '\n function (grid, event) {\n var trElement = Event.findElement(event, \"tr\");\n var blockId = trElement.down(\"td\").innerHTML.replace(/^\\s+|\\s+$/g,\"\");\n var blockTitle = trElement.down(\"td\").next().innerHTML; '\n . $chooserJsObject . '.setElementValue(blockId); '\n . $chooserJsObject . '.setElementLabel(blockTitle); '\n . $chooserJsObject . '.close();\n }';\n return $js;\n }",
"public function getRowClickCallback()\n {\n $chooserJsObject = $this->getId();\n $js = '\n function (grid, event) {\n var trElement = Event.findElement(event, \"tr\");\n var blockId = trElement.down(\"td\").innerHTML.replace(/^\\s+|\\s+$/g,\"\");\n var blockTitle = trElement.down(\"td\").next().innerHTML;\n ' .\n $chooserJsObject .\n '.setElementValue(blockId);\n ' .\n $chooserJsObject .\n '.setElementLabel(blockTitle);\n ' .\n $chooserJsObject .\n '.close();\n }\n ';\n return $js;\n }",
"function get_js() {\n\t$_str = '';\n\t\t$id_1 = '';\n\t\t$id_2 = '';\n\t\tif($this->identifier !== '') {\n\t\t\t$id_1 = 'try { document.getElementById(arg).checked = true; } catch(e) {}';\n\t\t\t$id_2 = 'try { document.getElementById(arg).checked = false; } catch(e) {}';\n\t\t}\n\t\t$_str .= \"\\n\";\n\t\t$_str .= '<script type=\"text/javascript\">'.\"\\n\";\n\t\t$_str .= 'function tr_hover(element) {'.\"\\n\";\n\t\t$_str .= '\tx = element.className.match(/tr_hover/g);'.\"\\n\";\n\t\t$_str .= '\tif(x == null) {\telement.className = element.className + \" tr_hover\"; }'.\"\\n\";\n\t\t$_str .= '\telse { element.className = element.className.replace(/ tr_hover/g, \"\");\t}'.\"\\n\";\n\t\t$_str .= '}'.\"\\n\";\n\t\t$_str .= 'function tr_click(element, arg) {'.\"\\n\";\n\t\t$_str .= '\tx = element.className.match(/tr_click/g);'.\"\\n\";\n\t\t$_str .= '\tif(x == null) {\telement.className = element.className + \" tr_click\";'; \n\t\t$_str .= '\t'.$id_1.' }'.\"\\n\";\n\t\t$_str .= '\telse { element.className = element.className.replace(/ tr_click/g, \"\");';\t\n\t\t$_str .= '\t'.$id_2.' }'.\"\\n\";\n\t\t$_str .= '}'.\"\\n\";\n\t\t$_str .= '</script>'.\"\\n\";\n\treturn $_str;\n\t}",
"public function getJsRenderer() {\t\n\t\t$html = $this->html;\t\n\t\tpreg_match_all('/{\\w*}/', $html, $res);\t\t\n\t\tif (!empty($res)) {\n\t\t\t$matches = $res[0];\n\t\t\t$replaceStr = \"\";\n\t\t\tforeach ($matches as $key => $value) {\n\t\t\t\t$replaceStr .= '.replace(\"'.$value.'\", row.'.str_replace(array('{','}'), array('',''), $value).')';\n\t\t\t}\n\t\t} \t\t\n\t\treturn 'function(row) { return '.json_encode($html).$replaceStr.' }';\t\n\t\t\n\t}",
"public function getRowClickCallback()\n {\n $chooserJsObject = $this->getId();\n $js = '\n function (grid, event) {\n var trElement = Event.findElement(event, \"tr\");\n var lookbookName = trElement.down(\"td\").next().innerHTML;\n var lookbookId = trElement.down(\"td\").innerHTML.replace(/^\\s+|\\s+$/g,\"\");\n ' .\n $chooserJsObject .\n '.setElementValue(lookbookId);\n ' .\n $chooserJsObject .\n '.setElementLabel(lookbookName);\n ' .\n $chooserJsObject .\n '.close();\n }\n ';\n return $js;\n }",
"public function jsRow(): JsExpressionable\n {\n return $this->table->jsRow();\n }",
"public function print_js_template_row()\n {\n }",
"public function js_code()\n {\n if (count($this->page_items) == 0)\n return '';\n\n $js_code = $this->_js_code_listo().\"\\n\";\n $js_code .= $this->_js_code_tablesorter().\"\\n\";\n\n return '$(function() {\n '.$js_code.'\n });';\n }",
"public function testRenderTableJavascript()\n {\n $renderer = $this->getRenderer();\n\n $html = $renderer->renderTable($this->view, 'javascript');\n\n $this->assertEquals('<script></script>', $html);\n }",
"final public function getJsPart(){\n $validators = array();\n foreach($this->validators as $validator) $validators[] = $validator->toJsonData();\n $output = '<script type=\"text/javascript\">';\n $output .= '(function(){var field = $(\"#'.$this->attr->get(\"id\").'\"); if(!field.data(\"formtablefield\")) new FormTableField(field, '.json_encode($validators).')})();';\n $output .= '</script>';\n return $output;\n }",
"public function getJavaScript();",
"private function appendJS()\n {\n\t $sortPersist = '';\n\t $applyFilter = '';\n\t if($this->filter == TRUE)\n\t\t {\n\t\t\t$applyFilter = $this->appendFilter();\n\t\t }\n\t if($this->num_rows > 2)\n\t\t {\n\t\t\t$sortPersist = ',\\'sortPersist\\'';\n\t\t }\n\t if(isset($this->editLinkOffset))\n\t\t {\n\t\t\tarray_push($this->disabled,$this->editLinkOffset);\n\t\t }\n\t $disabledSortColumns = '';\n\n\t if(count($this->disabled) > 0)\n\t\t {\n\t\t\tforeach($this->disabled as $disabled)\n\t\t\t {\n\t\t\t\t $disabledSortColumns .= $disabled.': {sorter: false},';\n\t\t\t }\n\t\t\t$disabledSortColumns = \t\t\t ',headers: {\n \t\t\t\t\t '.substr($disabledSortColumns, 0, -1).'\n \t\t\t\t\t\t\t } ';\n\t\t }\n\n\t $retVal = ' <script type=\"text/javascript\">//<![CDATA[\n \n $(document).ready(function() \n\t\t\t\t\t { \n' . $this->THClass . '\n\t $(\"#'.$this->table_id.'\").tablesorter({ \n\t\t\t\t\t\t widthFixed: false,\n\t\t\t\t\t\t sortLocaleCompare: true,\n\t\t\t\t\t\t\t widgets: [\\'zebra\\''.$sortPersist.']\n\t\t\t\t\t\t\t '.$disabledSortColumns.' \n\n\t\t\t }); \n\t' . $applyFilter . '\n\t } );\n\t//]]>\n\t</script>';\t\t\n\n\n\t return $retVal; \n }",
"public function getJavascriptCode() {}",
"function GetTableRowStyle() {\r\n return \"style='font-size: 12; border-style: solid dotted; border-width: thin; border-color: #808080; padding:0;'\";\r\n}",
"public function getRowClickCallback()\n {\n $js = \" \n function (grid, event) {\n var trElement = Event.findElement(event, 'tr');\n var isInput = Event.element(event).tagName == 'INPUT';\n var input = $('\".$this->getInput().\"');\n if (trElement) {\n var checkbox = Element.select(trElement, 'input');\n $$(\\\"#\".$this->getId().\" input[type=checkbox][class=checkbox]\\\").each(function(e){\n if (e.name != \\\"check_all\\\"){\n if (e.checked && e != checkbox[0]){\n e.checked = '';\n }\n }\n });\n if (checkbox[0]) {\n var checked = isInput ? checkbox[0].checked : !checkbox[0].checked;\n if(checked){\n input.value = checkbox[0].value;\n }else{\n var vl = checkbox[0].value;\n if(input.value.search(vl) == 0){\n if(input.value == vl) input.value = '';\n input.value = input.value.replace(vl+', ','');\n }else{\n input.value = input.value.replace(', '+ vl,'');\n }\n }\n checkbox[0].checked = checked;\n grid.reloadParams['selected[]'] = input.value.split( ', ');\n }\n }\n }\n \";\n return $js;\n }",
"protected static function getJavaScriptHeader()\n {\n $javaScript = [];\n\n $javaScript[] = '';\n $javaScript[] = ' ' . self::getJavaScript('documentChanged');\n $javaScript[] = ' function submitIfChanged(x) {';\n $javaScript[] = ' if (document.changed) {';\n $javaScript[] = ' if (confirm(\"' . FlashMessages::translate('warning.save') . '\"))\t{';\n $javaScript[] = ' update(x);';\n $javaScript[] = ' document.getElementById(\\'id_\\' + x).submit();';\n $javaScript[] = ' return false;';\n $javaScript[] = ' }';\n $javaScript[] = ' return true;';\n $javaScript[] = ' }';\n $javaScript[] = ' return true;';\n $javaScript[] = ' }';\n $javaScript[] = ' function update(x) {';\n $javaScript[] = ' ' . self::getJavaScript('selectAll');\n $javaScript[] = ' return true;';\n $javaScript[] = ' }';\n\n return implode(chr(10), $javaScript);\n }",
"public function tableHtmlValue() {\n /**\n * Html Table Value\n */\n $tableHtmlValue = '';\n return $tableHtmlValue . \"<table border = '1' cellspacing = '0' bordercolor='blue' cellpadding ='2' class='calend'>\n <tr class='weekDays'>\n <th><font size = '2' face = 'tahoma'>Sun</font></th>\n <th><font size = '2' face = 'tahoma'>Mon</font></th>\n <th><font size = '2' face = 'tahoma'>Tue</font></th>\n <th><font size = '2' face = 'tahoma'>Wed</font></th>\n <th><font size = '2' face = 'tahoma'>Thu</font></th>\n <th><font size = '2' face = 'tahoma'>Fri</font></th>\n <th><font size = '2' face = 'tahoma'>Sat</font></th>\n </tr> \";\n }",
"function getRowHtml()\r\n\t{\r\n\t // Failsafe if i18n is not loaded\r\n\t if(! function_exists('__'))\r\n\t Misc::use_helper('I18N');\r\n\r\n\t if ($this->showGeenResultaten && ($this->rowCount == 0)) {\r\n\t\t $html = \" <td colspan='$this->colCount'>\" . __('Geen resultaten') . \"</td>\\n\";\r\n\t\t}\r\n\t\telse $html = $this->rowDataHtml;\r\n\r\n\t\treturn $html;\r\n\t}",
"public function getScript(){\n $script = '';\n foreach($this->rows() as $row=>$x){\n $script.=$this->{$row}->getScript().PHP_EOL;\n }\n\n return $script;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/////////////////////////////////// boolean validateStrDate ($str) Only numeric values /////////////////////////////////// INPUT: 1. $str = String to validation /////////////////////////////////// OUTPUT: TRUE = Valid FALSE = Invalid /////////////////////////////////// | public function validateStrDate($str)
{
return preg_match('/^[0-9-\.\/]+$/', $str, $result);
} | [
"public function valid_date($str) {\n\t\t$d = DateTime::createFromFormat($this->DATE_FORMAT, $str);\n\t\t\n\t\treturn $d && $d->format($this->DATE_FORMAT) == $str;\n\t}",
"function chkdate($str)\n {\n // Requires PHP 5.2\n if(function_exists('date_parse'))\n {\n $info = date_parse($str);\n if($info !== false && $info['error_count'] == 0)\n {\n if(checkdate($info['month'], $info['day'], $info['year']))\n return true;\n }\n\n return false;\n }\n\n // Else, for PHP < 5.2\n return strtotime($str);\n }",
"function check_date($string) {\n if (preg_match('@[0-9]{2} [0-9]{2} [0-9]{4}@', $string)) {\n $date_parts = explode(\" \", $string);\n $day = $date_parts[0]; $month = $date_parts[1]; $year = $date_parts[2];\n if (checkdate($month, $day, $year))\n return true;\n }\n return false;\n }",
"function valid_textdate($str,$params= '')\n {\n if($params == '')\n {\n // default setting\n $divider = '-';\n $yearpart = 0;\n $monthpart = 1;\n $daypart = 2;\n }\n else\n {\n $explode = explode(',',$params);\n $divider = $explode[0];\n $yearpart = $explode[1];\n $monthpart = $explode[2];\n $daypart = $explode[3];\n }\n $explode2 = explode($divider,$str);\n if(count($explode2) != 3)\n {\n return false;\n }\n $year = $explode2[$yearpart];\n $month = $explode2[$monthpart];\n $day = $explode2[$daypart];\n if(check_date($month,$day,$str))\n {\n return true;\n }\n return false;\n }",
"public function validateNumeric($str){\n\t\n\t\t#Level 1 - see if anything is there.\n\t\tif(!empty($str)){\n\t\t #Level 2 - See if the variable is a number.\n\t\t\tif(is_numeric($str)){\n\t\t\t return (true);\n\t\t\t}else{\n\t\t\t return (false);\n\t\t\t}#END L2.\n\t\t}else{\n\t\t\treturn (false);\n\t\t}#END L1.\n\t}",
"function dateValide($strDate) {\n if ((preg_match(\"/\\d{2}-\\d{2}-\\d{4}/\", $strDate) == 1) ||\n (preg_match(\"/\\d{4}-\\d{2}-\\d{2}/\", $strDate) == 1)) {\n $intJ = null;\n $intM = null;\n $intA = null;\n $intJS = null;\n extraitJSJJMMAAAAv2($intJS, $intJ, $intM, $intA, $strDate);\n $result = checkdate($intM, $intJ, $intA);\n } else {\n $result = false;\n }\n\n return $result;\n }",
"function isValidDate($dateString){\r\n\t// Create a date object\r\n\t$date = date_create($dateString);\r\n\t// Check for creation errors (or warnings)\r\n\t$aErrors = date_get_last_errors();\r\n\t// If there are none, it's a valid date\r\n\treturn $aErrors[\"warning_count\"] == 0 && $aErrors[\"error_count\"] == 0;\r\n}",
"function validateGrad($str){\n if (isNumeric($str)) {\n return ((int)$str < date(\"Y\") + 10 && (int)$str >= date(\"Y\"));\n }\n return false;\n}",
"function valid_datetime($str)\n\t{\n\t\t$CI =& get_instance();\n\t\t$CI->form_validation->set_message('valid_datetime', 'The %s field must be entered in YYYY-MM-DD HH:MM:SS format.');\n\n\t\tif ( preg_match(\"/^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2}) ([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2})/\", $str, $matches) ) \n\t\t{\n\t\t\t$yyyy = $matches[1]; // first element of the array is year\n\t\t\t$mm = $matches[2]; // second element is month\n\t\t\t$dd = $matches[3]; // third element is days\n\t\t\t$h = $matches[4];\t\t\t\t\t // fourth element is hour\n\t\t\t$m = $matches[5];\t\t\t\t\t // fifth element is minutes\n\t\t\t$s = $matches[6];\t\t\t\t\t // sixth element is seconds\n\n\t\t\treturn ( checkdate($mm, $dd, $yyyy) && $h<24 && $m<60 && $s<60 );\n\t\t} \n\t\telse \n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\t}",
"public function isStringDate($string) {\n\n if (isset($string)) {\n $string = trim($string);\n $time = strtotime($string);\n if(is_int($time)) {\n return $time;\n } else {\n return false;\n }\n }\n return false;\n }",
"function validateDCI($str){\n if((strlen($str)>10) || (strlen($str)<4) || (!ctype_digit($str)) )\n return false;\n else\n return true;\n}",
"function check_date($date) {\n if(strlen($date) == 10) {\n $pattern = '/\\.|\\/|-/i'; // . or / or -\n preg_match($pattern, $date, $char);\n \n $array = preg_split($pattern, $date, -1, PREG_SPLIT_NO_EMPTY);\n \n if(strlen($array[2]) == 4) {\n // dd.mm.yyyy || dd-mm-yyyy\n if($char[0] == \".\"|| $char[0] == \"-\") {\n $month = $array[1];\n $day = $array[0];\n $year = $array[2];\n }\n // mm/dd/yyyy # Common U.S. writing\n if($char[0] == \"/\") {\n $month = $array[0];\n $day = $array[1];\n $year = $array[2];\n }\n }\n // yyyy-mm-dd # iso 8601\n if(strlen($array[0]) == 4 && $char[0] == \"-\") {\n $month = $array[1];\n $day = $array[2];\n $year = $array[0];\n }\n if(checkdate($month, $day, $year)) { //Validate Gregorian date\n return TRUE;\n \n } else {\n return FALSE;\n }\n }else {\n return FALSE; // more or less 10 chars\n }\n}",
"static public function isDate($string)\n {\n if (!$string) {\n return false;\n }\n\n if (preg_match('/^[\\d]{4}-[\\d]{2}-[\\d]{2}$/', $string)) {\n return true;\n }\n\n if (preg_match('/^[\\d]{4}-[\\d]{2}-[\\d]{2} [\\d]{2}:[\\d]{2}$/', $string)) {\n return true;\n }\n\n if (preg_match('/^[\\d]{4}-[\\d]{2}-[\\d]{2} [\\d]{2}:[\\d]{2}:[\\d]{2}$/', $string)) {\n return true;\n }\n\n return false;\n }",
"function is_date_valid($date)\n{\n $is_date_valid = false;\n\n if (strtotime($date)) {\n list($day, $month, $year) = explode('.', $date);\n $is_date_valid = checkdate($month, $day, $year);\n }\n\n return $is_date_valid;\n}",
"function is_valid_date($value, $format = 'dd.mm.yyyy'){\n if(strlen($value) >= 6 && strlen($format) == 10){\n\n // find separator. Remove all other characters from $format\n $separator_only = str_replace(array('m','d','y'),'', $format);\n $separator = $separator_only[0]; // separator is first character\n\n if($separator && strlen($separator_only) == 2){\n // make regex\n $regexp = str_replace('mm', '(0?[1-9]|1[0-2])', $format);\n $regexp = str_replace('dd', '(0?[1-9]|[1-2][0-9]|3[0-1])', $regexp);\n $regexp = str_replace('yyyy', '(19|20)?[0-9][0-9]', $regexp);\n $regexp = str_replace($separator, \"\\\\\" . $separator, $regexp);\n if($regexp != $value && preg_match('/'.$regexp.'\\z/', $value)){\n\n // check date\n $arr=explode($separator,$value);\n $day=$arr[0];\n $month=$arr[1];\n $year=$arr[2];\n if(@checkdate($month, $day, $year))\n return true;\n }\n }\n }\n return false;\n}",
"function year_validation($str) {\n // $str will be field value which post. will get auto and pass to function.\n $current_year = strtotime($str);\n $timestamp = strtotime('-18 years');\n\n if ($current_year > $timestamp) {\n $this->form_validation->set_message(\"year_validation\", $this->lang->line('invalid_dob'));\n return FALSE;\n } else {\n return TRUE;\n }\n }",
"function validateDate($date) {\n if ($date == '') {\n return true;\n }\n return preg_match('/^(0[1-9]|[12][0-9]|3[01])\\.(0[1-9]|1[012])\\.(19|20)\\d\\d$/', $date);\n}",
"public static function validateDate($input)\r\n\t{\r\n\t\treturn preg_match('/\\d{2}-\\d{2}-\\d{4}/', $input) && (strlen($input) == 10);\r\n\t}",
"function valid_date_mm_dd_yyyy($date=NULL){\n\tif(preg_match(\"~^\\d{1,2}([/.-])\\d{1,2}\\\\1\\d{4}$~\", $date)==1){\n\t\tlist($m,$d,$y)=explode(\"/\",$date);\n\t\treturn checkdate($m,$d,$y);\n\t}\n\treturn FALSE;\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Add test specific data to LMS internal grading hints | protected function add_tests_to_lms_grading_hints(SimpleXmlWriter $xw, $formdata) {
if (!isset($formdata->testid)) {
return;
}
$count = count($formdata->testid);
for ($index = 0; $index < $count; $index++) {
$id = $formdata->testid[$index];
if ($id !== '' && $this->is_test_set($formdata, $index)) {
$xw->startElement('test-ref');
$xw->create_attribute('ref', $formdata->testid[$index]);
if (array_key_exists($index, $formdata->testweight)) {
$xw->create_attribute('weight', $formdata->testweight[$index]);
} else {
$xw->create_attribute('weight', '-1');
}
$xw->create_childelement_with_text('title', $formdata->testtitle[$index]);
$xw->create_childelement_with_text('description', $formdata->testdescription[$index]);
$xw->create_childelement_with_text('test-type', $formdata->testtype[$index]);
$xw->endElement(); // End tag test-ref.
}
}
} | [
"public function extract_formdata_from_gradinghints($question, $mform) {\n $question->testtitle = array();\n $question->testdescription = array();\n $question->testtype = array();\n $question->testweight = array();\n $question->testid = array();\n\n if (empty($question->gradinghints)) {\n // Nothing to be done.\n return;\n }\n\n $xmldoc = new DOMDocument;\n\n if (!$xmldoc->loadXML($question->gradinghints)) {\n // Fatal error: grading hints cannot be loaded!\n debugging('gradinghints are not valid XML');\n debugging($question->gradinghints);\n return;\n }\n\n $xpath = new DOMXPath($xmldoc);\n $xpathresult = $xpath->query('//grading-hints/root/test-ref');\n $key = 0;\n if ($xpathresult->length == 0) {\n // No debug message. This situation can occur when input is not validated successfully.\n // debugging('no tests in gradinghints found ' . $question->gradinghints);\n return;\n }\n\n // Preset compile and checkstyle checkboxes as not checked.\n $question->compile = 0;\n $question->checkstyle = 0;\n\n foreach ($xpathresult as $testgrading) {\n $ref = $testgrading->getAttribute('ref');\n $weight = $testgrading->getAttribute('weight');\n $titles = $xpath->query('title', $testgrading);\n if ($titles->length > 0) {\n $title = $titles->item(0)->textContent;\n } else {\n $title = 'Title ' . $ref;\n }\n $descriptions = $xpath->query('description', $testgrading);\n if ($descriptions->length > 0) {\n $description = $descriptions->item(0)->textContent;\n } else {\n $description = '';\n }\n $testtypes = $xpath->query('test-type', $testgrading);\n if ($testtypes->length > 0) {\n $testtype = $testtypes->item(0)->textContent;\n } else {\n $testtype = '';\n }\n\n /*\n // from edit_numerical_form\n // See comment in the parent method about this hack:\n // Evil hack alert. Formslib can store defaults in two ways for\n // repeat elements:\n // ->_defaultValues['fraction[0]'] and\n // ->_defaultValues['fraction'][0].\n // The $repeatedoptions['fraction']['default'] = 0 bit above means\n // that ->_defaultValues['fraction[0]'] has already been set, but we\n // are using object notation here, so we will be setting\n // ->_defaultValues['fraction'][0]. That does not work, so we have\n // to unset ->_defaultValues['fraction[0]'].\n unset($this->_form->_defaultValues[\"testtitle[{$key}]\"]);\n */\n unset($mform->_defaultValues[\"testtitle[{$key}]\"]);\n unset($mform->_defaultValues[\"testid[{$key}]\"]);\n unset($mform->_defaultValues[\"testweight[{$key}]\"]);\n unset($mform->_defaultValues[\"testdescription[{$key}]\"]);\n unset($mform->_defaultValues[\"testtype[{$key}]\"]);\n if (!$this->set_formdata_from_gradinghints($question, $ref, $weight)) {\n $question->testid[] = $ref;\n $question->testtitle[] = $title;\n $question->testdescription[] = $description;\n $question->testtype[] = $testtype;\n $question->testweight[] = $weight;\n }\n $key++;\n }\n }",
"public function create_lms_grading_hints($formdata) {\n\n if (!empty($formdata->gradinghints)) {\n return $formdata->gradinghints;\n }\n $xw = new SimpleXmlWriter();\n $xw->openMemory();\n\n $xw->setIndent(1);\n $xw->setIndentString(' ');\n\n $xw->startDocument('1.0', 'UTF-8');\n\n $xw->startElement('grading-hints');\n $xw->startElement('root');\n $xw->create_attribute('function', 'sum');\n $this->add_tests_to_lms_grading_hints($xw, $formdata);\n $xw->endElement(); // End tag root.\n $xw->endElement(); // End tag grading-hints.\n\n $xw->endDocument();\n $gradinghints = $xw->outputMemory();\n\n return $gradinghints;\n }",
"public function test_get_test_form_data(): void {\n global $DB;\n $this->resetAfterTest(true);\n\n // Fetch generators.\n $generator = \\testing_util::get_data_generator();\n $guidegenerator = $generator->get_plugin_generator('gradingform_guide');\n\n // Create items required for testing.\n $course = $generator->create_course();\n $module = $generator->create_module('assign', ['course' => $course]);\n $user = $generator->create_user();\n $context = context_module::instance($module->cmid);\n\n $this->setUser($user);\n $controller = $guidegenerator->get_test_guide($context, 'assign', 'submissions');\n\n // Unit under test.\n $result = $guidegenerator->get_test_form_data(\n $controller,\n 1839,\n 10, 'Propper good speling',\n 0, 'ASCII art is not a picture'\n );\n\n $this->assertIsArray($result);\n $this->assertEquals(1839, $result['itemid']);\n $this->assertIsArray($result['criteria']);\n $this->assertCount(2, $result['criteria']);\n\n $spelling = $guidegenerator->get_criterion_for_values($controller, 'Spelling mistakes');\n $this->assertIsArray($result['criteria'][$spelling->id]);\n $this->assertEquals(10, $result['criteria'][$spelling->id]['score']);\n $this->assertEquals('Propper good speling', $result['criteria'][$spelling->id]['remark']);\n\n $pictures = $guidegenerator->get_criterion_for_values($controller, 'Pictures');\n $this->assertIsArray($result['criteria'][$pictures->id]);\n $this->assertEquals(0, $result['criteria'][$pictures->id]['score']);\n $this->assertEquals('ASCII art is not a picture', $result['criteria'][$pictures->id]['remark']);\n }",
"function PopulateTestInfo(&$test) {\n $ret = array();\n $copy = function($key) use ($test, &$ret) {\n if (isset($test[$key]))\n $ret[$key] = $test[$key];\n };\n $keys = array('url', 'runs', 'fvonly', 'web10', 'ignoreSSL', 'video', 'label',\n 'priority', 'block', 'location', 'browser', 'connectivity', 'bwIn', 'bwOut',\n 'latency', 'plr', 'tcpdump', 'timeline', 'trace', 'bodies', 'netlog',\n 'standards', 'noscript', 'pngss', 'iq', 'bodies', 'keepua', 'benchmark',\n 'mobile', 'tsview_id', 'addCmdLine');\n foreach ($keys as $key)\n $copy($key);\n $ret['scripted'] = isset($test['script']) && strlen($test['script']) ? 1 : 0;\n return $ret;\n}",
"public function addUsage()\n {\n if (!$this->blockUsage) {\n \\PhpTestBed\\Repository::getInstance()\n ->addUsedArray($this->getVarName(), $this->getKeys(), $this->getResult());\n }\n }",
"public function test_format_feedback_with_grade() {\n $this->resetAfterTest();\n $dg = $this->getDataGenerator();\n $c1 = $dg->create_course();\n $u1 = $dg->create_user();\n $gi1a = new grade_item($dg->create_grade_item(['courseid' => $c1->id]), false);\n $gi1a->update_final_grade($u1->id, 1, 'test');\n $contextid = $gi1a->get_context()->id;\n $gradeid = $gi1a->id;\n\n $tests = [\n 'Has server based image (HTML)' => [\n '<p>See this reference: <img src=\"@@PLUGINFILE@@/test.img\"></p>',\n FORMAT_HTML,\n \"See this reference: \"\n ],\n 'Has server based image and more (HTML)' => [\n '<p>See <img src=\"@@PLUGINFILE@@/test.img\"> for <em>reference</em></p>',\n FORMAT_HTML,\n \"See for reference\"\n ],\n 'Has server based video and more (HTML)' => [\n '<p>See <video src=\"@@PLUGINFILE@@/test.img\">video of a duck</video> for <em>reference</em></p>',\n FORMAT_HTML,\n 'See video of a duck for reference'\n ],\n 'Has server based video with text and more (HTML)' => [\n '<p>See <video src=\"@@PLUGINFILE@@/test.img\">@@PLUGINFILE@@/test.img</video> for <em>reference</em></p>',\n FORMAT_HTML,\n \"See https://www.example.com/moodle/pluginfile.php/$contextid/grade/feedback/$gradeid/test.img for reference\"\n ],\n 'Multiple videos (HTML)' => [\n '<p>See <video src=\"@@PLUGINFILE@@/test.img\">video of a duck</video> and '.\n '<video src=\"http://example.com/myimage.jpg\">video of a cat</video> for <em>reference</em></p>',\n FORMAT_HTML,\n 'See video of a duck and video of a cat for reference'\n ],\n ];\n\n $feedback = $this->getMockForAbstractClass(\n \\grade_export::class,\n [],\n '',\n false\n );\n\n foreach ($tests as $key => $testdetails) {\n $expected = $testdetails[2];\n $input = $testdetails[0];\n $inputformat = $testdetails[1];\n\n $this->assertEquals(\n $expected,\n $feedback->format_feedback((object) [\n 'feedback' => $input,\n 'feedbackformat' => $inputformat,\n ], $gi1a),\n $key\n );\n }\n }",
"public function setGradeTest($grade)\n\t{\n\t\tarray_push($this->grades, intval($grade));\n\t}",
"public function add_tests( $tests ) {\n\n\t\t$tests['direct']['monsterinsights_auth'] = array(\n\t\t\t'label' => __( 'MonsterInsights Authentication', 'google-analytics-for-wordpress' ),\n\t\t\t'test' => array( $this, 'test_check_authentication' ),\n\t\t);\n\n\t\t$tests['direct']['monsterinsights_automatic_updates'] = array(\n\t\t\t'label' => __( 'MonsterInsights Automatic Updates', 'google-analytics-for-wordpress' ),\n\t\t\t'test' => array( $this, 'test_check_autoupdates' ),\n\t\t);\n\n\t\tif ( $this->is_ecommerce() ) {\n\t\t\t$tests['direct']['monsterinsights_ecommerce'] = array(\n\t\t\t\t'label' => __( 'MonsterInsights eCommerce', 'google-analytics-for-wordpress' ),\n\t\t\t\t'test' => array( $this, 'test_check_ecommerce' ),\n\t\t\t);\n\t\t}\n\n\t\tif ( $this->uses_amp() ) {\n\t\t\t$tests['direct']['monsterinsights_amp'] = array(\n\t\t\t\t'label' => __( 'MonsterInsights AMP', 'google-analytics-for-wordpress' ),\n\t\t\t\t'test' => array( $this, 'test_check_amp' ),\n\t\t\t);\n\t\t}\n\n\t\tif ( $this->uses_fbia() ) {\n\t\t\t$tests['direct']['monsterinsights_fbia'] = array(\n\t\t\t\t'label' => __( 'MonsterInsights FBIA', 'google-analytics-for-wordpress' ),\n\t\t\t\t'test' => array( $this, 'test_check_fbia' ),\n\t\t\t);\n\t\t}\n\n\t\t$tests['async']['monsterinsights_connection'] = array(\n\t\t\t'label' => __( 'MonsterInsights Connection', 'google-analytics-for-wordpress' ),\n\t\t\t'test' => 'monsterinsights_test_connection',\n\t\t);\n\n\t\tif ( $this->is_tracking() ) {\n\t\t\t$tests['async']['monsterinsights_tracking_code'] = array(\n\t\t\t\t'label' => __( 'MonsterInsights Tracking Code', 'ga-premium' ),\n\t\t\t\t'test' => 'monsterinsights_test_tracking_code',\n\t\t\t);\n\t\t}\n\n\t\treturn $tests;\n\t}",
"function local_fitcheck_calc_grade($test, $data) {\n if ($data == 'null') {\n return 'null';\n }\n $maxminrange = $test->maxresult - $test->minresult;\n if ($test->method != 2) {\n if ($test->minmax) {\n $calcresult = (($maxminrange - ($data - $test->minresult)) / $maxminrange) * 5 + 1;\n } else {\n $calcresult = (($data - $test->minresult) / $maxminrange) * 5 + 1;\n }\n } else {\n if ($test->minmax) {\n $calcresult = (($maxminrange - ((0 - $test->maxresult) + $data)) / $maxminrange) * 5 + 1;\n } else {\n $calcresult = (((0 - $test->minresult) + $data) / $maxminrange) * 5 + 1;\n }\n }\n if ($calcresult > 6) {\n $calcresult = 6;\n } else if ($calcresult < 1) {\n $calcresult = 1;\n }\n return round($calcresult, 2);\n}",
"public function test_methodlockslearningobjectivegradesduringupdateforspecificuserid() {\n global $DB;\n\n $this->load_csv_data();\n\n // Create enrolment.\n $this->make_course_enrollable();\n enrol_try_internal_enrol(2, 100, 1);\n enrol_try_internal_enrol(2, 101, 1);\n\n // Create LO and Moodle grade.\n $itemid = $this->create_grade_item();\n $this->create_grade_grade($itemid, 100, 75, 100, 1);\n $this->create_grade_grade($itemid, 101, 75, 100, 1);\n $this->create_course_completion('manualitem', 50);\n\n // Enrol in PM class.\n $studentgrade = new \\student_grade(array(\n 'userid' => 103,\n 'classid' => 100,\n 'completionid' => 1,\n 'grade' => 75,\n 'locked' => 0,\n 'timegraded' => 1\n ));\n $studentgrade->save();\n $studentgrade = new \\student_grade(array(\n 'userid' => 104,\n 'classid' => 100,\n 'completionid' => 1,\n 'grade' => 75,\n 'locked' => 0,\n 'timegraded' => 1\n ));\n $studentgrade->save();\n\n // Validate setup.\n $this->assert_num_student_grades(2);\n $count = $DB->count_records(\\student_grade::TABLE, array('locked' => 1));\n $this->assertEquals(0, $count);\n $this->assert_student_grade_exists(100, 103, 1, null, 0);\n\n // Update Moodle info.\n $DB->execute(\"UPDATE {grade_grades} SET finalgrade = 80, timemodified = 2\");\n\n // Run and validate.\n $sync = new \\local_elisprogram\\moodle\\synchronize;\n $sync->synchronize_moodle_class_grades(100);\n $this->assert_num_student_grades(2);\n $count = $DB->count_records(\\student_grade::TABLE, array('locked' => 1));\n $this->assertEquals(1, $count);\n $this->assert_student_grade_exists(100, 103, 1, null, 1);\n }",
"public function test_get_user_grade() {\n global $DB;\n\n // Add grades for the user.\n $newgrade = [\n 'lessonid' => $this->lesson->id,\n 'userid' => $this->student->id,\n 'grade' => 50,\n 'late' => 0,\n 'completed' => time(),\n ];\n $DB->insert_record('lesson_grades', (object) $newgrade);\n\n $newgrade = [\n 'lessonid' => $this->lesson->id,\n 'userid' => $this->student->id,\n 'grade' => 100,\n 'late' => 0,\n 'completed' => time(),\n ];\n $DB->insert_record('lesson_grades', (object) $newgrade);\n\n $this->setUser($this->student);\n\n // Test lesson without multiple attemps. The first result must be returned.\n $result = mod_lesson_external::get_user_grade($this->lesson->id);\n $result = external_api::clean_returnvalue(mod_lesson_external::get_user_grade_returns(), $result);\n $this->assertCount(0, $result['warnings']);\n $this->assertEquals(50, $result['grade']);\n $this->assertEquals('50.00', $result['formattedgrade']);\n\n // With retakes. By default average.\n $DB->set_field('lesson', 'retake', 1, array('id' => $this->lesson->id));\n $result = mod_lesson_external::get_user_grade($this->lesson->id, $this->student->id);\n $result = external_api::clean_returnvalue(mod_lesson_external::get_user_grade_returns(), $result);\n $this->assertCount(0, $result['warnings']);\n $this->assertEquals(75, $result['grade']);\n $this->assertEquals('75.00', $result['formattedgrade']);\n\n // With retakes. With max grade setting.\n $DB->set_field('lesson', 'usemaxgrade', 1, array('id' => $this->lesson->id));\n $result = mod_lesson_external::get_user_grade($this->lesson->id, $this->student->id);\n $result = external_api::clean_returnvalue(mod_lesson_external::get_user_grade_returns(), $result);\n $this->assertCount(0, $result['warnings']);\n $this->assertEquals(100, $result['grade']);\n $this->assertEquals('100.00', $result['formattedgrade']);\n\n // Test as teacher we get the same result.\n $this->setUser($this->teacher);\n $result = mod_lesson_external::get_user_grade($this->lesson->id, $this->student->id);\n $result = external_api::clean_returnvalue(mod_lesson_external::get_user_grade_returns(), $result);\n $this->assertCount(0, $result['warnings']);\n $this->assertEquals(100, $result['grade']);\n $this->assertEquals('100.00', $result['formattedgrade']);\n\n // Test exception. As student try to retrieve grades from teacher.\n $this->setUser($this->student);\n $this->expectException('moodle_exception');\n $result = mod_lesson_external::get_user_grade($this->lesson->id, $this->teacher->id);\n }",
"public function test_core_target_course_gradetopass_analysable() {\n global $DB;\n\n $this->resetAfterTest(true);\n $now = time();\n\n $dg = $this->getDataGenerator();\n\n // Course without grade to pass set.\n $course1 = $dg->create_course(array('startdate' => $now - WEEKSECS, 'enddate' => $now - DAYSECS));\n $student1 = $dg->create_user();\n $studentrole = $DB->get_record('role', array('shortname' => 'student'));\n $dg->enrol_user($student1->id, $course1->id, $studentrole->id);\n\n $analysable = new \\core_analytics\\course($course1);\n $target = new \\core_course\\analytics\\target\\course_gradetopass();\n $this->assertEquals(get_string('gradetopassnotset', 'course'), $target->is_valid_analysable($analysable));\n\n // Set grade to pass.\n $courseitem = grade_item::fetch_course_item($course1->id);\n $courseitem->gradepass = 50;\n $DB->update_record('grade_items', $courseitem);\n // Since the grade to pass value is cached in the target, a new one it is instanciated.\n $target = new \\core_course\\analytics\\target\\course_gradetopass();\n $this->assertTrue($target->is_valid_analysable($analysable));\n\n }",
"public function testAddAsArray()\n {\n $grade = new File_Therion_Grade('UISv1_3', array('title' => 'Rough magnetic/analogue survey'));\n $grade->setDefinition('length', new File_Therion_Unit(0.25, 'metres'));\n \n $grade->setDefinition(array('bearing', 'gradient'), new File_Therion_Unit(15.0, 'degrees'));\n \n $grade->setDefinition(array(\n \"x\" => new File_Therion_Unit(1.25, \"m\"),\n \"y\" => new File_Therion_Unit(1.25, \"m\"),\n \"z\" => new File_Therion_Unit(1.25, \"m\"),\n ));\n \n }",
"function rank_math_register_seo_analysis_basic_tests( $tests ) {\n\t$new_tests['site_description'] = [\n\t\t'title' => esc_html__( 'Site Tagline', 'rank-math' ),\n\t\t/* translators: link to general setting screen */\n\t\t'description' => sprintf( esc_html__( 'Your theme may display the Site Tagline, and it can also be used in SEO titles & descriptions. Set it to something unique. You can change it by navigating to <a href=\"%s\">Settings > General</a>.', 'rank-math' ), admin_url( 'options-general.php' ) ),\n\t\t'how_to_fix' => '<p>' . esc_html__( 'Most WordPress themes place your site\\'s tagline in a prominent position (inside header tags near the top of the page). Using the right tagline can give your site an SEO boost.', 'rank-math' ) . '</p>' .\n\t\t\t'<p>' . esc_html__( 'Unfortunately, the standard WordPress tagline is \"Just Another WordPress site.\" That\\'s pretty sloppy looking, and it does nothing for your SEO. In fact, it\\'s actually a security risk - it makes it easy for hackers with a WordPress exploit to locate your site with an automated search.', 'rank-math' ) . '</p>' .\n\t\t\t/* translators: link to general setting screen */\n\t\t\t'<p>' . sprintf( wp_kses_post( __( 'Changing your tagline is very easy. Just head on over to <a target=\"_blank\" href=\"%1$s\">Settings - General</a> in WordPress\\'s admin menu (on the left), or click on the link in this sentence.', 'rank-math' ) ), esc_url( admin_url( 'options-general.php' ) ) ) . '</p>' .\n\t\t\t'<p>' . esc_html__( 'The tagline is the second option. Choose a tagline that summarizes your site in a few words. The tagline is also a good place to use your main keyword.', 'rank-math' ) . '</p>',\n\t];\n\n\t$new_tests['blog_public'] = [\n\t\t'title' => esc_html__( 'Blog Public', 'rank-math' ),\n\t\t/* translators: link to general setting screen */\n\t\t'description' => esc_html__( 'Your site may not be visible to search engine.', 'rank-math' ),\n\t\t'how_to_fix' => '<p>' .\n\t\t\tsprintf(\n\t\t\t\t/* translators: %1$s link to the reading settings, %2$s closing tag for the link */\n\t\t\t\tesc_html__( 'You must %1$sgo to your Reading Settings%2$s and uncheck the box for Search Engine Visibility.', 'rank-math' ),\n\t\t\t\t'<a href=\"' . esc_url( admin_url( 'options-reading.php' ) ) . '\">',\n\t\t\t\t'</a>'\n\t\t\t) .\n\t\t'</p>',\n\t];\n\n\t$new_tests['permalink_structure'] = [\n\t\t'title' => esc_html__( 'Permalink Structure', 'rank-math' ),\n\t\t/* translators: link to permalink setting screen */\n\t\t'description' => sprintf( __( 'For the best SEO results, use a custom permalink structure, preferably one that includes the post title (<code>%%postname%%</code>). You can change it by navigating to <a href=\"%s\">Settings > Permalinks</a>', 'rank-math' ), admin_url( 'options-permalink.php' ) ),\n\t\t'how_to_fix' => '<p>' . esc_html__( 'The standard permalink structure is pretty ugly - WordPress generates offputting URLs like: http://www.yoursite.com/?p=99', 'rank-math' ) . '</p>' .\n\t\t\t'<p>' . esc_html__( 'It\\'s not very kind on the eyes, and it does nothing for your site\\'s SEO. In fact, it can hurt it - Google\\'s bot is quite cautious about crawling pages that look auto-generated.', 'rank-math' ) . '</p>' .\n\t\t\t/* translators: link to permalink setting screen */\n\t\t\t'<p>' . sprintf( wp_kses_post( __( 'Fortunately, it\\'s very easy to fix. Just hop on over to <a target=\"_blank\" href=\"%1$s\">Settings - Permalinks</a>. Then chose the \"Post Name\" option.', 'rank-math' ) ), esc_url( admin_url( 'options-permalink.php' ) ) ) . '</p>' .\n\t\t\t'<p>' . esc_html__( 'This option will replace the \"?p=99\" part of the URL with the post\\'s title, like this: http://www.yoursite.com/my-amazing-post-title/', 'rank-math' ) . '</p>' .\n\t\t\t'<p>' . esc_html__( 'This looks nice for readers - and it gets your keywords into the URL (keywords in the URL is a ranking factor).', 'rank-math' ) . '</p>',\n\t];\n\n\t$new_tests['focus_keywords'] = [\n\t\t'title' => esc_html__( 'Focus Keywords', 'rank-math' ),\n\t\t'description' => esc_html__( 'Setting focus keywords for your posts allows Rank Math to analyse the content.', 'rank-math' ),\n\t\t'how_to_fix' => '<p>' . esc_html__( 'Rank Math allows you to set a focus keyword for every post and page you write - the option is in the \"Meta Box\", which appears under the text editor in the screen where you write and edit content.', 'rank-math' ) . '</p>' .\n\t\t\t'<p>' . esc_html__( 'Rank Math uses these focus keywords to analyze your on-page content. It can tell if you\\'ve done a good job of optimizing your text to rank for these keywords.', 'rank-math' ) . '</p>' .\n\t\t\t'<p>' . esc_html__( 'Of course, if you don\\'t give Rank Math a focus keyword to work with, it can\\'t give you any useful feedback.', 'rank-math' ) . '</p>' .\n\t\t\t'<p>' . esc_html__( 'Fixing this issue is easy - just edit the post, and set a Focus Keyword. Then follow Rank Math\\'s analysis to improve your rankings.', 'rank-math' ) . '</p>',\n\t];\n\n\t$new_tests['post_titles'] = [\n\t\t'title' => esc_html__( 'Post Titles Missing Focus Keywords', 'rank-math' ),\n\t\t'description' => esc_html__( 'Make sure the focus keywords you set for the posts appear in their titles.', 'rank-math' ),\n\t\t'how_to_fix' => '<p>' . esc_html__( 'HTML Page Titles play a large role in Google\\'s ranking algorithm. When you add a Focus Keyword to a post or page, Rank Math will check to see that you used the keyword in the title. If it finds any posts or pages that are missing the keyword in the title, it will tell you here.', 'rank-math' ) . '</p>' .\n\t\t\t'<p>' . esc_html__( 'Fixing the issue is simple - just edit the post/page and add the focus keyword(s) to the title.', 'rank-math' ) . '</p>',\n\t];\n\n\tforeach ( $new_tests as $key => $test ) {\n\t\t$test['category'] = 'basic';\n\t\t$test['callback'] = 'rank_math_analyze_' . $key;\n\t\t$tests[ $key ] = $test;\n\t}\n\n\treturn $tests;\n}",
"public function extra_question_fields() {\r\n // Retrieve parent extra fields from shortanswer, like case sensivity and other fields from shortanswer.\r\n //$result = array_diff(parent::extra_question_fields(), array('answers'));// We unset answers fields, because we do not need them\r\n $result = parent::extra_question_fields();\r\n // Replace shortanswer table with our table\r\n $result[0]= 'qtype_correctwriting';\r\n // Language, which will be used for analysis\r\n $result[] = 'langid';\r\n // Penalty for absent lexeme mistake\r\n foreach($this->analyzers() as $value) {\r\n $classname = 'qtype_correctwriting_' . $value;\r\n /** @var qtype_correctwriting_abstract_analyzer $analyzer */\r\n $analyzer = new $classname();\r\n $fields = $analyzer->extra_question_fields();\r\n if (count($fields)) {\r\n foreach($fields as $field) {\r\n $result[] = $field;\r\n }\r\n }\r\n }\r\n // Minimal grade for answer to be approximately matched with student response\r\n $result[] = 'hintgradeborder';\r\n // Maximum fraction of mistakes to length of teacher answer in lexemes\r\n $result[] = 'maxmistakepercentage';\r\n //Penalty for \"what is\" hint.\r\n $result[] = 'whatishintpenalty';\r\n //Penalty for \"where\" text hint.\r\n $result[] = 'wheretxthintpenalty';\r\n //Absent token hints penalty factor\r\n $result[] = 'absenthintpenaltyfactor';\r\n //Penalty for \"where\" picture hint.\r\n $result[] = 'wherepichintpenalty';\r\n\r\n //Is enabled fields\r\n $result[] = 'islexicalanalyzerenabled';\r\n $result[] = 'isenumanalyzerenabled';\r\n $result[] = 'issequenceanalyzerenabled';\r\n $result[] = 'issyntaxanalyzerenabled';\r\n\r\n //Penalty for \"how to fix pic\" picture hint.\r\n $result[] = 'howtofixpichintpenalty';\r\n\r\n\r\n return $result;\r\n }",
"public function applyTestInfo()\n {\n // default is clearing\n $this->clearTestInfo();\n }",
"public function addTest($test)\n {\n $this->tally++;\n $this->tests[$test->getType()][$test->getHash()] = $test;\n }",
"function _addMetadataFields()\r\n {\r\n $factory = \\NDB_Factory::singleton();\r\n $config = $factory->config();\r\n $dateOptions = array(\r\n 'language' => 'en',\r\n 'format' => 'YMd',\r\n 'minYear' => $config->getSetting('startYear'),\r\n 'maxYear' => $config->getSetting('endYear'),\r\n 'addEmptyOption' => true,\r\n 'emptyOptionValue' => null,\r\n );\r\n $this->dateOptions = $dateOptions;\r\n $this->addBasicDate('Date_taken', 'Date of Administration', $dateOptions);\r\n //if (strrpos($this->testName, '_proband') === false) {\r\n // $this->addScoreColumn(\r\n // 'Candidate_Age',\r\n // 'Candidate Age (Months)',\r\n // 'Please enter date of administration and press Save'\r\n // );\r\n // $this->addScoreColumn(\r\n // 'Window_Difference',\r\n // 'Window Difference (+/- Days)',\r\n // 'Please enter date of administration and press Save'\r\n // );\r\n //}\r\n $examiners = $this->_getExaminerNames();\r\n $this->addSelect('Examiner', 'Examiner', $examiners);\r\n $this->addRule(\r\n 'Date_taken',\r\n 'Date of Administration is required',\r\n 'required'\r\n );\r\n $this->addRule('Examiner', 'Examiner is required', 'required');\r\n \r\n }",
"function _addMetadataFields()\n {\n $factory = \\NDB_Factory::singleton();\n $config = $factory->config();\n $dateOptions = array(\n 'language' => 'en',\n 'format' => 'YMd',\n 'minYear' => $config->getSetting('startYear'),\n 'maxYear' => $config->getSetting('endYear'),\n 'addEmptyOption' => true,\n 'emptyOptionValue' => null,\n );\n $this->dateOptions = $dateOptions;\n $this->addBasicDate('Date_taken', $this->indent.'Date of Administration', $dateOptions);\n //if (strrpos($this->testName, '_proband') === false) {\n // $this->addScoreColumn(\n // 'Candidate_Age',\n // 'Candidate Age (Months)',\n // 'Please enter date of administration and press Save'\n // );\n // $this->addScoreColumn(\n // 'Window_Difference',\n // 'Window Difference (+/- Days)',\n // 'Please enter date of administration and press Save'\n // );\n //}\n $examiners = $this->_getExaminerNames();\n $this->addSelect('Examiner', $this->indent.'Examiner', $examiners);\n $this->addRule(\n 'Date_taken',\n 'Date of Administration is required',\n 'required'\n );\n $this->addRule('Examiner', 'Examiner is required', 'required');\n \n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Add Multiple Item to Cart | public function addItemsToCartNewAction()
{
$decoded = $this->get('webservice.helper')->processRequest($this->getRequest());
$user = array_key_exists('auth_token', $decoded) ? $this->get('webservice.helper')->findUserByAuthToken($decoded['auth_token']) : null;
if ($user) {
$items = isset($decoded["items"]) ? $decoded["items"] : "0";
if ($items != 0) {
//$this->container->get('cart.helper.cart')->removeUserCart($user);
foreach ($items as $detail) {
/*Remove From Wish list*/
$this->container->get('cart.helper.wishlist')->removeWishlistByItem($user, $detail["item_id"]);
$this->container->get('cart.helper.cart')->fillCartforService($detail["item_id"], $user, $detail["quantity"]);
}
$resp = 'Items has been added to Cart Successfully';
$res = $this->get('webservice.helper')->response_array(true, $resp);
} else {
$res = $this->get('webservice.helper')->response_array(false, 'Array Item not found');
}
} else {
$res = $this->get('webservice.helper')->response_array(false, 'User not authenticated.');
}
return new Response($res);
} | [
"public function addItems()\n {\n $code = $this->getCode();\n\n $items = $this->getItems();\n\n $add = array();\n if ($items) {\n $datetime = date('Y-m-d H:i:s');\n foreach ($items as $item) {\n $add[] = array(\n 'code' => $code,\n 'contact_id' => $this->getContact()->getId(),\n 'product_id' => $item['product_id'],\n 'sku_id' => $item['sku_id'],\n 'create_datetime' => $datetime,\n 'quantity' => $item['quantity'],\n 'type' => $item['type'],\n 'service_id' => $item['service_id'],\n 'service_variant_id' => $item['service_variant_id'],\n 'parent_id' => $item['parent_id'],\n );\n }\n (new shopQuickorderPluginCartItemsModel())->multipleInsert($add);\n }\n }",
"private function addToCart() {\n\t}",
"public function addMany(CartItem ...$items)\n {\n foreach ($items as $item) {\n $this->add($item);\n }\n }",
"public function addAllToCart() {\n $idShoppingList = Tools::getValue('id_shopping_list');\n $shoppingListObj = ShoppingListObject::loadByIdAndCustomer($idShoppingList, $this->context->cookie->id_customer);\n $products = $shoppingListObj->getAllProducts();\n \n foreach($products as $product) {\n $this->updateProductInCart($idShoppingList, $product['id_product'], $product['id_product_attribute']);\n }\n\n $this->indexShoppingListProduct($idShoppingList);\n }",
"public function addItem($id,$phone)\n{\n\n//$price = (int)str_replace(\"$\",\"\",$phone->price);//converts the price value back to string.\n //$quantity= $phone->id;\n\t$price = $phone->price; \n\t$name = $phone->name;\n\t$image = $phone->image;\n //$num = $phone->id;\n\n//First check if the phone is in the previous cart or not\n if(array_key_exists($id,$this->items))\n {\n //$productToAdd = $this->items[$id];\n $productToAdd = $items[$id]; //added\n $productToAdd['num']++;\n }\n else //if it is the first time the user is adding the item to the cart\n {\n $productToAdd = ['num' => 1, 'price'=>$price, 'name'=>$name,'image'=>$image]; \n }\n $this->items[$id] = $productToAdd;\n $this->totalQuantity++;\n $this->totalPrice = $this->totalPrice + $price;\n}",
"public function addItems($items);",
"public function addItem(Cart $cart, CartItem $item);",
"public function addCartItem()\r\n\t\t{\r\n\t\t\tif(isset($_GET['pid'])) {\r\n\t\t\t\r\n\t\t\t\t$product_id = $_GET['pid'];\r\n\t\t\t\t\r\n\t\t\t\t//check that product ID is valid number\r\n\t\t\t\tif(!is_numeric($product_id)) {\r\n\t\t\t\t\techo \"Invalid product ID\";\r\n\t\t\t\t\tdie();\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t$productData = $this->store_m->getSingleProduct($product_id);\r\n\t\t\t\t\r\n\t\t\t\t$data = array(\r\n\t\t\t\t\t'id' => $product_id,\r\n\t\t\t\t\t'qty' => '1',\r\n\t\t\t\t\t'price' => $productData['0']['price'],\r\n\t\t\t\t\t'name' => $productData['0']['name'],\r\n\t\t\t\t\t'options' => array('sku' => $productData['0']['code'], 'photo' => $productData['0']['photo'])\r\n\t\t\t\t);\r\n\t\t\t\t\r\n\t\t\t\t$this->cart->insert($data);\r\n\t\t\t\tredirect('store', 'refresh');\r\n\t\t\t\t\r\n\t\t\t} else {\r\n\t\t\t\techo \"No Product Found.\";\r\n\t\t\t\tdie();\r\n\t\t\t}\r\n\t\t}",
"function addItemsToBasket2($item,$item2,$item3) {\n\n\n }",
"public function addAction()\n {\n $cart = $this->_getCart();\n $params = $this->getRequest()->getParams();\n\n try {\n\n foreach($params['products'] as $_child){\n\n // get required params to add in cart\n $_child['uenc'] = $params['uenc'];\n\n if (isset($_child['qty'])) {\n $filter = new Zend_Filter_LocalizedToNormalized(\n array('locale' => Mage::app()->getLocale()->getLocaleCode())\n );\n $_child['qty'] = $filter->filter($_child['qty']);\n }\n\n if(!array_key_exists('qty', $_child) || $_child['qty'] == 0){\n continue; // check qty\n }\n\n $product = $this->_initProduct($_child['product']);\n\n /**\n * Check product availability\n */\n if (!$product) {\n $this->_goBack();\n return;\n }\n\n $related = $this->getRequest()->getParam('related_product');\n\n $cart->addProduct($product, $_child);\n if (!empty($related)) {\n $cart->addProductsByIds(explode(',', $related));\n }\n }\n\n $cart->save();\n\n $this->_getSession()->setCartWasUpdated(true);\n\n /**\n * @todo remove wishlist observer processAddToCart\n */\n Mage::dispatchEvent('checkout_cart_add_product_complete',\n array('product' => $product, 'request' => $this->getRequest(), 'response' => $this->getResponse())\n );\n\n if (!$this->_getSession()->getNoCartRedirect(true)) {\n if (!$cart->getQuote()->getHasError()){\n $message = $this->__('%s was added to your shopping cart.', Mage::helper('core')->escapeHtml($product->getName()));\n $this->_getSession()->addSuccess($message);\n }\n $this->_goBack();\n }\n } catch (Mage_Core_Exception $e) {\n if ($this->_getSession()->getUseNotice(true)) {\n $this->_getSession()->addNotice(Mage::helper('core')->escapeHtml($e->getMessage()));\n } else {\n $messages = array_unique(explode(\"\\n\", $e->getMessage()));\n foreach ($messages as $message) {\n $this->_getSession()->addError(Mage::helper('core')->escapeHtml($message));\n }\n }\n\n $url = $this->_getSession()->getRedirectUrl(true);\n if ($url) {\n $this->getResponse()->setRedirect($url);\n } else {\n $this->_redirectReferer(Mage::helper('checkout/cart')->getCartUrl());\n }\n } catch (Exception $e) {\n $this->_getSession()->addException($e, $this->__('Cannot add the item to shopping cart.'));\n Mage::logException($e);\n $this->_goBack();\n }\n }",
"public function testsItemsAreAddedCorrectlyIntoGivenCart()\n {\n $payload = [\n 'product_id' => 3,\n 'quantity' => 5\n ];\n\n $this->json('POST', '/api/carts/1/items', $payload)\n ->assertStatus(201)\n ->assertJson(['cart_id' => 1, 'product_id' => 3, 'quantity' => 5]);\n }",
"function addItems();",
"public function batchAddItems($items);",
"function loop_add_to_cart() {\n\n\t\tif ( $this->disable_tracking( $this->ga_event_tracking_enabled ) ) return;\n\n\t\t$parameters = array();\n\t\t// Add single quotes to allow jQuery to be substituted into _trackEvent parameters\n\t\t$parameters['category'] = \"'\" . __( 'Products', 'carton' ) . \"'\";\n\t\t$parameters['action'] \t= \"'\" . __( 'Add to Cart', 'carton' ) . \"'\";\n\t\t$parameters['label'] \t= \"($(this).data('product_sku')) ? ('SKU: ' + $(this).data('product_sku')) : ('#' + $(this).data('product_id'))\"; // Product SKU or ID\n\n\t\t$this->event_tracking_code( $parameters, '.add_to_cart_button:not(.product_type_variable, .product_type_grouped)' );\n\t}",
"public function addToCart(): void\n {\n //añadimos un Item con la cantidad indicada al Carrito\n Cart::add($this->oferta->id, $this->product->name, $this->oferta->getRawOriginal('offer_prize'), $this->quantity);\n //emite al nav-cart el dato para que lo actualize\n $this->emitTo('nav-cart', 'refresh');\n }",
"public function createCartItem();",
"public function add()\n\t{\n\t\t$product = ORM::factory('product', $this->input->post('product_id'));\n\t\t$quantity = $this->input->post('quantity', 1);\n\t\t$variant = ORM::factory('variant', $this->input->post('variant_id'));\n\t\t\n\t\t$this->cart->add_product($product, $variant, $quantity);\n\t\t\n\t\turl::redirect('cart');\n\t}",
"public function addItem($item){\n if(!is_array($item) || count($item)<4) return false;\n\n // find out if there is an identical item which we just update the quantity for\n $found = false;\n foreach($this->items as $k=>$v){\n if($v['id']==$item['id']){\n // bingo! we already have this item in our cart\n $this->items[$k]['qty'] += (int) $item['qty'];\n if($this->items[$k]['qty']<0) $this->items[$k]['qty'] = 0;\n $this->items[$k]['total_price'] = (float) $this->items[$k]['price'] * $this->items[$k]['qty'];\n $found = true;\n };\n };\n if(!$found){\n // we add the item to the cart\n $item['total_price'] = $item['price'] * $item['qty'];\n $this->items[] = $item;\n };\n }",
"public function add( $item_id, $quantity = 1, array $data = NULL );"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Updates the personal reference table. | public function updatePersonalReferenceQuery($reference){
$date = date("Y-m-d G:i:s");
$query = 'UPDATE personal_refernce SET
date_modified = "'.$date.'",
company_id = '.$reference->company_id.',
name_full = "'.$reference->name_full.'",
phone_home = "'.$reference->phone_home.'",
relationship = "'.$reference->relationship.'",
verified = "'.$reference->verified.'",
ok_to_contact = "'.$reference->ok_to_contact.'",
modifying_agent_id = '.$reference->modifying_agent_id.'
WHERE personal_refernce_id ='.$reference->personal_refernce_id.';';
$result = $this->db->query($query);
return($result->rowCount());
} | [
"public function testUpdateReferral()\n {\n }",
"public function update($directReferences);",
"public function updateReferenceID( $referenceID );",
"public function testUpdateLinkedAccount()\n {\n\n }",
"public function updateReferenceFields()\n {\n if (isset($this->data['referencesMany']['categories'])) {\n $group = $this->data['referencesMany']['categories'];\n $add = $group->getAdd();\n $remove = $group->getRemove();\n if ($add || $remove) {\n $ids = array();\n foreach ($group->all() as $document) {\n $ids[] = $document->getId();\n }\n $this->setCategories_reference_field($ids ? array_values($ids) : null);\n }\n }\n if (isset($this->data['embeddedsOne']['source'])) {\n $this->data['embeddedsOne']['source']->updateReferenceFields();\n }\n }",
"public function update_personal_information()\n {\n $this->User_functions_model->update_personal_information_model();\n }",
"function Update_Referrals_Wallet($user_auth_id,$referral_total)\n\t{\n\t\t\tglobal $db;\n\t\t\t$sql=\"UPDATE \".MEMBER_MASTER\n\t\t\t\t.\" SET \"\n\t\t\t\t.\" referrals_earned = '\".$referral_total.\"' \"\n\t\t\t\t.\" WHERE user_auth_id ='\".$user_auth_id.\"'\"; \n\t\t\treturn($db->query($sql));\n\t}",
"public function canEditSingleModelRefUsesRefTable()\n {\n //$this->app->dbBuilder->reset();\n\n // Setup\n $users = $this->app->tests->users;\n\n // Create user \n $user = new \\Models\\Tests\\User('Bob');\n $users->save($user);\n\n // Check that user has no existing model relationship\n $this->assertEquals($user->mother, NULL);\n\n // Set and create reference\n $mother = new \\Models\\Tests\\User('Janice');\n $user->mother = $mother;\n $users->save($user);\n\n // Check that dad was set to current User\n $this->assertEquals(get_class($mother), get_class($user->mother));\n \n // Pull user fresh from DB just to make sure changes were saved on DB.\n $this->assertEquals(get_class($mother), get_class($users->find($user->id)->mother));\n }",
"function updateref($ref)\n {\n //UPDATE `user` SET `statusd`=1 WHERE username = 'agung1';\n // $ref = $this->db->query(\"SELECT ref FROM `user` WHERE `user` = '$user'\");\n // return $ref;\n\n $query = $this->db->query(\"UPDATE `user` SET `saldo`= `saldo` + 25000,`point`=`point`+1 WHERE kode_ref = '$ref'\");\n return $query;\n }",
"public function testUpdatePerson()\n {\n }",
"public function touch()\n {\n $key = $this->getRelated ()->getKeyName ();\n $columns = $this->getRelatedFreshUpdate ();\n $ids = $this->getRelatedIds ();\n if ( count ( $ids ) > 0 ) {\n $this->getRelated ()->newQuery ()->whereIn ( $key, $ids )->update ( $columns );\n }\n }",
"public function testUpdateAchBankLinkUsingPut()\n {\n }",
"public function testUpdateReference()\n {\n $referenced1 = $this->session->getNode('/tests_general_base/emptyExample');\n $referenced1->addMixin('mix:referenceable');\n $this->session->save();\n\n // Load a referenceable node\n $referenced2 = $this->session->getNode('/tests_general_base/idExample');\n\n // Reference it from another node\n $source_node = $this->session->getNode('/tests_general_base/index.txt/jcr:content');\n\n $source_node->setProperty('reference', $referenced1, \\PHPCR\\PropertyType::WEAKREFERENCE);\n $this->session->save();\n $source_node->setProperty('reference', $referenced2, \\PHPCR\\PropertyType::WEAKREFERENCE);\n $this->session->save();\n $this->assertSame($referenced2, $source_node->getPropertyValue('reference'));\n\n $session = $this->renewSession();\n $referenced2 = $session->getNode('/tests_general_base/idExample');\n $this->assertSame($referenced2, $session->getProperty('/tests_general_base/index.txt/jcr:content/reference')->getValue());\n }",
"public function testUpdateIsNew()\r\n\t{\r\n\t\t$foreignKey = new ForeignKey();\r\n\t\t$foreignKey->TABLE_SCHEMA = 'tabletest';\r\n\t\t$foreignKey->TABLE_NAME = 'product';\r\n\t\t$foreignKey->COLUMN_NAME = 'fk';\r\n\r\n\t\t$foreignKey->setReferences('tabletest.product_order.no');\r\n\t\t$foreignKey->update();\r\n\t}",
"public function api_editReferral()\n {\n $fileUploaded = array();\n $fileName = '';\n $errMsg = $this->checkApiHeaderInfo();\n\t\t$error = !empty($errMsg) ? 1 : 0;\n if ($error == 0) {\n $userId = $this->loggedInUserId;\n $referralId = $this->Encryption->decode($this->jsonDecodedRequestedData->referralId);\n $this->ReceivedReferral->id = $referralId;\n if ($this->ReceivedReferral->save($this->jsonDecodedRequestedData)) {\n $this->set(array(\n 'code' => Configure::read('RESPONSE_SUCCESS'),\n 'message' => 'Referral has been updated successfully',\n '_serialize' => array('code', 'message')\n ));\n }\n } else {\n $this->errorMessageApi($errMsg);\n }\n }",
"public function payToReferrals()\n {\n// $this->owner->balance = 2000;\n /* TODO #PS: save referal logic behavior */\n $paimentAmountOnSignUp = $this->owner->getSetting('pay_on_signup_amount');\n $this->owner->balance = (int) $paimentAmountOnSignUp;\n $payToAdminDefaultAmount = (int) $this->owner->getSetting('pay_to_administration_amount');\n $adminId = (int) $this->owner->getSetting('admin_payment_receiver_id', null);\n if ($this->owner->referral > 0) {\n $transaction = yii::$app->db->beginTransaction();\n $this->owner->transferMoneyToUser($adminId, $payToAdminDefaultAmount, false);\n $this->payToMyReferral($this->owner, $this->owner->referral, ($paimentAmountOnSignUp - $payToAdminDefaultAmount), $adminId);\n if (is_array($this->usersersThatHavePaid) && count($this->usersersThatHavePaid) > 0) {\n $setPaid = User::updateAll(['paid_to_referrals' => User::PAID_TO_REFERRALS], ['in', 'id', $this->usersersThatHavePaid]);\n $transaction->commit();\n }\n } else {\n $this->owner->transferMoneyToUser($adminId, $paimentAmountOnSignUp);\n }\n }",
"public function testUpdateMentionAccro()\n {\n }",
"public function testUpdateLink()\n {\n }",
"public function testUpdateExistingPersonRelationship()\n {\n $person = Person::where('name', '=', 'Martin Luther King Jr.')->firstOrFail();\n $id = PersonRelationship::where('person1_id',$person->id)->firstOrFail()->id;\n $relationship = Relationship::firstOrCreate(['title' => 'Husband/Wife']);\n $this->put('/api/v1/person_relationship/'.$id, ['relationship_id' => $relationship->id], ['HTTP_X-Requested-With' => 'XMLHttpRequest'])\n ->assertJson([\n 'person1_id' => $person->id,\n 'relationship_id' => $relationship->id\n ]);\n $this->assertDatabaseHas('person_relationships', ['person1_id' => $person->id, 'relationship_id' => $relationship->id]);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns all change requests for a specific surfer, whose id is given. For each change request type available only the last one is used. | function getChangeRequests($surferId) {
$sql = "SELECT surferchangerequest_data, surferchangerequest_type
FROM %s
WHERE surferchangerequest_surferid='%s'
ORDER BY surferchangerequest_time DESC";
$params = array($this->tableChangeRequests, $surferId);
$result = array();
if ($res = $this->databaseQueryFmt($sql, $params)) {
while ($row = $res->fetchRow(DB_FETCHMODE_ASSOC)) {
if (!isset($result[ $row['surferchangerequest_type' ]])) {
$result[ $row['surferchangerequest_type'] ] = $row['surferchangerequest_data'];
}
}
return $result;
}
return FALSE;
} | [
"public function getChangesByID($id)\n {\n return $this\n ->where('id_item', $id)\n ->get();\n }",
"function _getContactRequests($surferId) {\n if ($surferId == '') {\n $surferId = $this->surfer;\n }\n $sql = \"SELECT surfercontact_requestor,\n surfercontact_requested,\n surfercontact_status\n FROM %s\n WHERE (surfercontact_requestor = '%s'\n OR surfercontact_requested = '%s')\n AND surfercontact_status = %d\";\n $sqlParams = array($this->tableContacts, $surferId, $surferId,\n SURFERCONTACT_STATUS_PENDING\n );\n $contactRequests = array();\n if ($res = $this->databaseQueryFmt($sql, $sqlParams)) {\n while ($row = $res->fetchRow(DB_FETCHMODE_ASSOC)) {\n if ($row['surfercontact_requestor'] == $surferId) {\n $contactRequests[] = $row['surfercontact_requested'];\n } else {\n $contactRequests[] = $row['surfercontact_requestor'];\n }\n }\n }\n return $contactRequests;\n }",
"public function getChangeRequests($sclerk)\n {\n $requests = $this->Form_data_model->get_Change_Requests($sclerk);\n if($requests){ return $requests; }\n\n }",
"public function getRequestsById( $id) {\n $sql = \"SELECT * from friend_requests\n WHERE id = :id\";\n $stm = $this->db->prepare($sql);\n $stm->setFetchMode(\\PDO::FETCH_ASSOC);\n $stm->bindParam(':id', $id);\n $stm->execute();\n return $stm->fetch();\n }",
"public function listsChangereasonByIdget($changereason_id)\r\n {\r\n $response = ChangeReason::findOrFail($changereason_id);\r\n return response()->json($response, 200);\r\n }",
"public function list_sync_requests() {\n\t\t$stmt = $this->database->prepare(\"SELECT * FROM sync_request WHERE server_id = ?\");\n\t\t$stmt->bind_param('d', $this->id);\n\t\t$stmt->execute();\n\t\t$result = $stmt->get_result();\n\t\t$reqs = array();\n\t\twhile($row = $result->fetch_assoc()) {\n\t\t\t$reqs[] = new SyncRequest($row['id'], $row);\n\t\t}\n\t\treturn $reqs;\n\t}",
"public function readChangeset($id)\n\t{\n\t\t// Set the API base\n\t\t$base = 'changeset/' . $id;\n\n\t\t// Build the request path.\n\t\t$path = $this->getOption('api.url') . $base;\n\n\t\t// Send the request.\n\t\t$xml_string = $this->sendRequest($path);\n\n\t\treturn $xml_string->changeset;\n\t}",
"public function getActionPlanchanges($risk_id) \n\t{\n\t\t$sql = \"SELECT a.*,c.id AS id_ap,\n DATE_FORMAT(a.due_date, '%d-%m-%Y') AS due_date,\n DATE_FORMAT(a.due_date, '%d-%m-%Y') AS due_date_v,\n b.division_name AS division_v\n FROM t_risk_action_plan_change a\n JOIN m_division b ON a.division = b.division_id\n LEFT JOIN m_action_plan c ON a.`ap_code` = c.id AND a.`division` = c.`division`\n where a.risk_id = ? and switch_flag='P' \";\n\t\t$par = array('uid' => $risk_id);\n\t\t\n\t\t$query = $this->db->query($sql, $par);\n\t\t$res = array();\n\t\tforeach($query->result_array() as $row) {\n\t\t\t$res[] = $row;\n\t\t}\n\t\t\n\t\treturn $res;\n\t}",
"function get_comments( $id ) {\n\t\ttry {\n\t\t\t$response = $this->api( 'ticket.changeLog', [ $id ] );\n\t\t} catch( \\Exception $e ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tforeach ( $response as $i => $c ) {\n\t\t\t$response[ $i ] = [\n\t\t\t\t'time' => $c[0],\n\t\t\t\t'author' => $c[1],\n\t\t\t\t'field' => $c[2],\n\t\t\t\t'oldvalue' => $c[3],\n\t\t\t\t'newvalue' => $c[4],\n\t\t\t\t'permanent' => $c[5],\n\t\t\t];\n\t\t}\n\n\t\treturn $response;\n\t}",
"public function getRequestsForScenario($scenarioId) {\r\n $select = $this->getDatabase()->select()\r\n ->from($this->getTableName())\r\n ->where('scenarioId = ?', $scenarioId);\r\n\r\n $data = $select->fetchAll();\r\n $result = array();\r\n\r\n foreach ($data as $request) {\r\n $request['id'] = (int)$request['id'];\r\n $request['scenarioId'] = (int)$request['scenarioId'];\r\n $request['toMeasure'] = $request['toMeasure'] === '1' ? true : false;\r\n\r\n $result[$request['id']] = new Entity\\Request($request);\r\n }\r\n\r\n return $result;\r\n }",
"public static function getAllByIdRecette($id)\r\n {\r\n $db = BDD::getInstance();\r\n\r\n $liste = array();\r\n $sql = 'SELECT fk_type_id FROM recette_type WHERE fk_recette_id=?';\r\n\r\n $sth = $db->prepare($sql);\r\n $sth->execute(array($id));\r\n $rows = $sth->fetchAll(PDO::FETCH_ASSOC);\r\n foreach ($rows as $row) {\r\n $liste[] = new Type($row['fk_type_id']);\r\n }\r\n return $liste;\r\n }",
"public function get_tv_changes($id = FALSE)\n {\n if($id)\n {\n return $this->make_call('tv/'.$id.'/changes');\n }\n else\n {\n $page = 1;\n $result = array();\n do\n {\n $params = array(\n 'page' => $page\n );\n $r = $this->make_call('tv/changes', $params);\n \n $total_pages = $r['total_pages'];\n $r = $r['results'];\n \n $result = array_merge($result, $r);\n \n $page++;\n }\n while($page <= $total_pages);\n \n return $result;\n }\n }",
"public function list_sync_requests() {\n\t\t$stmt = $this->database->prepare(\"SELECT * FROM sync_request WHERE server_id = ? ORDER BY account_name\");\n\t\t$stmt->bind_param('d', $this->id);\n\t\t$stmt->execute();\n\t\t$result = $stmt->get_result();\n\t\t$reqs = array();\n\t\twhile($row = $result->fetch_assoc()) {\n\t\t\t$reqs[] = new SyncRequest($row['id'], $row);\n\t\t}\n\t\treturn $reqs;\n\t}",
"public function getRequests()\n {\n return $this->hasMany(Request::className(), ['users_id' => 'id']);\n }",
"function getClientRequests($id) {\n /* $sql = \"SELECT r.id_requests,rq.bg_colour as bgcolour,rq.id_categories as reqcateid,rq.class_categories as reqclass ,rq.name_categories as reqcate, t.name as marla, r.date_requests as reqdate, r.exdate_requests as dateexp ,r.updated_date as updateddate,r.status_requests as reqstatus,r.progress_requests as progst, os.name_subcategories as subcate, ct.name_categories as maincate,ci.name as cityname,s.name as societyname\n FROM requests r join office_clients c join office_subcategories os join office_categories ct join office_types t\n join cities ci join societies s join req_categories rq\n where r.fk_office_clients = c.id_clients and ct.id_categories = os.fk_office_categories\n and t.id = c.fk_office_types and ci.id = c.fk_cities and s.id = c.fk_societies and rq.id_categories = r.fk_reqcategories\n and c.id_clients = '$id'\"; */\n\n $sql = \"select * ,rq.bg_colour as bgcolour,rq.id_categories as reqcateid,rq.class_categories as reqclass ,rq.name_categories as reqcate,r.date_requests as reqdate, r.exdate_requests as dateexp ,r.updated_date as updateddate,r.status_requests as reqstatus,r.progress_requests as progst\nFROM requests r join office_clients c join req_categories rq\nWHERE r.fk_reqcategories = rq.id_categories and r.fk_office_clients = c.id_clients and fk_office_clients = '$id'\";\n $records = $query = $this->db->query($sql)->result_array();\n return $records;\n }",
"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 change']);\r\n }else{\r\n return response('Oops, seems like something went wrong while trying to update reason');\r\n }\r\n }",
"public function getRequests();",
"public function get_user_submitted_requests($person_id) {\n\t\t\t$this->db->select(\"*\");\n\t\t\t$this->db->from(\"requests\");\n\t\t\t$this->db->join(\"rooms\", \"requests.room_id = rooms.room_id\");\n\t\t\t$this->db->join(\"sections\", \"requests.section_id = sections.section_id\");\n\t\t\t$this->db->join(\"course\", \"requests.course_id = course.course_id\");\n\t\t\t$this->db->join(\"status\", \"requests.status_id = status.status_id\");\n\t\t\t$this->db->where(\"requests.person_id = \", $person_id);\n\t\t\t$q = $this->db->get();\n\t\t\treturn $q->result();\n\t\t}",
"public function getAllRequest()\n {\n $this->db->order_by(\"req_status\", \"ASC\");\n $this->db->order_by(\"created_at\", \"DESC\");\n return $this->db->get('request');\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Tags for this post | public function tags()
{
$new = $this->postterms->filter(function($term)
{
return $term->termtaxonomy->taxonomy == 'post_tag';
});
return $new->map(function($term)
{
return $term->termtaxonomy->term;
});
} | [
"public function tags()\n {\n parent::setCustomClassAndTable(\"Tag\", \"post_tags\");\n // Get all tags relating to the selected post from the pivot table\n $postTags = parent::findAllByKey([\"post_id\" => $this->id]);\n $tags = array();\n foreach ($postTags as $tag) {\n // Get the title of the selected tag from the database\n $tag->title = Tag::find([\"id\" => $tag->tag_id])->title;\n array_push($tags, $tag);\n }\n return $tags;\n }",
"function cyberchimps_post_tags() {\n\t\tglobal $post;\n\n\t\tif ( is_single() ) {\n\t\t\t$show = ( cyberchimps_get_option( 'single_post_byline_tags', 1 ) ) ? cyberchimps_get_option( 'single_post_byline_tags', 1 ) : false;\n\t\t} elseif ( is_archive() ) {\n\t\t\t$show = ( cyberchimps_get_option( 'archive_post_byline_tags', 1 ) ) ? cyberchimps_get_option( 'archive_post_byline_tags', 1 ) : false;\n\t\t} else {\n\t\t\t$show = ( cyberchimps_get_option( 'post_byline_tags', 1 ) ) ? cyberchimps_get_option( 'post_byline_tags', 1 ) : false;\n\t\t}\n\t\tif ( $show ) :\n\t\t\t$tags_list = get_the_tag_list( '', ', ' );\n\t\t\tif ( $tags_list ) :\n\t\t\t\t$tags = sprintf( __( 'Tags: %s', 'cyberchimps_core' ), $tags_list );\n\t\t\t\t?>\n\t\t\t\t<span class=\"taglinks\">\n\t\t\t\t<?php echo apply_filters( 'cyberchimps_post_tags', $tags ); ?>\n\t\t\t</span>\n\t\t\t\t<span class=\"sep\"> <?php echo apply_filters( 'cyberchimps_entry_meta_sep', '|' ); ?> </span>\n\t\t\t\t<?php\n\t\t\tendif; // End if $tags_list\n\t\tendif;\n\t}",
"public function getTags();",
"function amply_post_tags() {\n\t// Only show tags on post types that have categories.\n\tif ( 'post' === get_post_type() ) {\n\t\t/* translators: used between list items, there is a space after the comma */\n\t\t$tags_list = get_the_tag_list( '', esc_html_x( ', ', 'list item separator', 'amply' ) );\n\t\tif ( $tags_list ) {\n\t\t\t/* translators: 1: list of tags. */\n\t\t\tprintf( '<span class=\"tags-links\">' . esc_html__( 'Tagged %1$s', 'amply' ) . ' </span>', $tags_list ); // WPCS: XSS OK.\n\t\t}\n\t}\n}",
"public function tags($args = [ ])\n {\n\n return wp_get_post_tags($this->ID, $args);\n\n }",
"function tag()\n\t{\n\t\t$data = array();\n\t\t//$tag_name = str_replace(\"-\",\" \",$this->uri->segment(3));\n\t\t$tag_name = $this->uri->segment(3);\n\t\t\n\t\t$data['tag_name'] = $tag_name;\n\t\t$data['posts'] = $this->postmodel->getTagRelatedPost($tag_name);\n\t\t\n\t\t$data['categories'] = $this->commonmodel->getRecords('category');\n\t\t$data['post_capsule_list'] = '';\n\t\t$data['sidebar'] = $this->load->view('includes/sidebar', $data, true);\n\t\t\n\t\t$this->load->view('includes/header');\n\t\t$this->load->view('post/tagpost-list',$data);\n\t\t$this->load->view('includes/footer');\n\t}",
"function getTags() {\n\n parent::getTags();\n\n $tags = [\n 'satisfactionsmiley.smileys' => __(\"Affichage notation avec les smileys\", \"satisfactionsmiley\"),\n ];\n\n foreach ($tags as $tag => $label) {\n $this->addTagToList([\n 'tag' => $tag,\n 'label' => $label,\n 'value' => true,\n 'events' => NotificationTarget::TAG_FOR_ALL_EVENTS\n ]);\n }\n\n asort($this->tag_descriptions);\n }",
"public function tags()\n {\n return $this->hasMany('App\\Posts\\PostTag', 'post', 'id');\n }",
"function oublog_get_post_tags($post,$includespaces=false) {\n global $CFG;\n\n // Work out tags from existing data if possible (to save adding a query)\n if(isset($post->tags)) {\n $taglist=oublog_clarify_tags($post->tags);\n } else {\n // Tags aren't in post so use database query\n $rs=get_recordset_sql(\"\nSELECT\n t.tag\nFROM\n {$CFG->prefix}oublog_taginstances ti\n INNER JOIN {$CFG->prefix}oublog_tags t ON ti.tagid = t.id\nWHERE\n ti.postid={$post->id}\");\n $taglist=array();\n while($rec=rs_fetch_next_record($rs)) {\n $taglist[]=$rec->tag;\n }\n }\n if($includespaces) {\n foreach($taglist as $ix=>$tag) {\n // Make the spaces in tags back into spaces so they're searchable (sigh)\n $taglist[$ix]=str_replace('_',' ',$tag);\n }\n }\n\n return $taglist;\n}",
"public function postTags(): HasMany\n {\n return $this->hasMany(PostTag::class, 'tag_id');\n }",
"function hw_get_post_tags( $args = array() ) {\n\t$args = array_merge(\n\t\t[\n\t\t\t'after' => '',\n\t\t\t'before' => __( 'Tagged With: ', 'roots' ),\n\t\t\t'sep' => ', ',\n\t\t],\n\t\t$args\n\t);\n\n\t$tags = get_the_tag_list( $args['before'], trim( $args['sep'] ) . ' ', $args['after'] );\n\t//* Do nothing if no tags\n\tif ( ! $tags ) return '';\n\n\treturn '<span class=\"tags\">' . $tags . '</span>';\n}",
"public static function tags()\n\t{\n\t\tif (empty($_POST))\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\t$widgets_params = utils::$config['widgets_params'];\n\n\t\t// Titre.\n\t\tif (isset($_POST['title']))\n\t\t{\n\t\t\tutils::setLocaleText($_POST['title'], $widgets_params['tags']['title'], 128);\n\t\t}\n\n\t\t// Nombre maximum de tags.\n\t\tif (isset($_POST['max_tags']) && preg_match('`^\\d{1,2}$`', $_POST['max_tags'])\n\t\t&& $_POST['max_tags'] != $widgets_params['tags']['params']['max_tags'])\n\t\t{\n\t\t\t$widgets_params['tags']['params']['max_tags'] = $_POST['max_tags'];\n\t\t}\n\n\t\tself::_updateWidget($widgets_params);\n\t}",
"protected function getTags() {\n\t\treturn array(\n\t\t\t\"Title\",\n\t\t\t\"Body\",\n\t\t\t\"ThemeVersion\"\n\t\t);\n\t}",
"function _parse_tags(){\n // Define the new tag model\n $Tag =& new Tag;\n // split all the tags on a space into an array\n $tag_list = explode(\" \", $this->data['Post']['tags']);\n $tags = array(); // New tag array to store tag id and names from db\n foreach($tag_list as $t) {\n //the tag already exists\n if ($tag = $Tag->findByName($t)) {\n //add the join table relationship to the Tag model to connect it to the post \n $tags[] = array_merge($tag['Tag'], array('PostsTag' => array('id' => '', 'post_id' => $this->id, 'tag_id' => $tag['Tag']['id'])));\n } else {\n //create a new tag\n $Tag->save(array('id' => '', 'name' => $t));\n //get the id of the recently created tag\n $tag_id = $Tag->getLastInsertID();\n //add the join table relationship to the Tag model to connect it to the post\n $tags[] = array('id' => $tag_id, 'name' => $t, 'PostsTag' => array('id' => '', 'post_id' => $this->id, 'tag_id' => $tag_id));\n }\n //just to be safe\n unset($tag);\n }\n // add all of the tags into the post's tag container\n $this->data['Tag'] = $tags;\n }",
"public function get_tags() {\n\t\t$tags = array(\n\t\t\t'download' => array(\n\t\t\t\t'tag' => strtolower( edd_get_label_singular() ),\n\t\t\t\t'description' => __( 'Name of the download the review was posted on', 'edd-reviews' ),\n\t\t\t\t'function' => 'download_tag',\n\t\t\t\t'discount' => true,\n\t\t\t),\n\t\t\t'direct_link' => array(\n\t\t\t\t'tag' => 'direct_link',\n\t\t\t\t'description' => __( 'Direct link to the review', 'edd-reviews' ),\n\t\t\t\t'function' => 'direct_link_tag'\n\t\t\t),\n\t\t\t'author' => array(\n\t\t\t\t'tag' => 'author',\n\t\t\t\t'description' => __( 'The review author', 'edd-reviews' ),\n\t\t\t\t'function' => 'author_tag',\n\t\t\t\t'discount' => true,\n\t\t\t),\n\t\t\t'email' => array(\n\t\t\t\t'tag' => 'email',\n\t\t\t\t'description' => __( \"The reviewer's email\", 'edd-reviews' ),\n\t\t\t\t'function' => 'email_tag',\n\t\t\t\t'discount' => true,\n\t\t\t),\n\t\t\t'url' => array(\n\t\t\t\t'tag' => 'url',\n\t\t\t\t'description' => __( \"The reviewer's URL\", 'edd-reviews' ),\n\t\t\t\t'function' => 'url_tag',\n\t\t\t\t'discount' => true,\n\t\t\t),\n\t\t\t'rating' => array(\n\t\t\t\t'tag' => 'rating',\n\t\t\t\t'description' => __( 'The rating given by the reviewer', 'edd-reviews' ),\n\t\t\t\t'function' => 'rating_tag',\n\t\t\t\t'discount' => true,\n\t\t\t),\n\t\t\t'title' => array(\n\t\t\t\t'tag' => 'title',\n\t\t\t\t'description' => __( 'The title of the review', 'edd-reviews' ),\n\t\t\t\t'function' => 'title_tag',\n\t\t\t\t'discount' => true,\n\t\t\t),\n\t\t\t'review' => array(\n\t\t\t\t'tag' => 'review',\n\t\t\t\t'description' => __( 'The content of the review', 'edd-reviews' ),\n\t\t\t\t'function' => 'review_tag',\n\t\t\t\t'discount' => true,\n\t\t\t),\n\t\t\t'item_as_described' => array(\n\t\t\t\t'tag' => 'item_as_described',\n\t\t\t\t'description' => __( 'If the item was as described or not', 'edd-reviews' ),\n\t\t\t\t'function' => 'item_as_described_tag',\n\t\t\t\t'fes' => true,\n\t\t\t),\n\t\t\t'feedback' => array(\n\t\t\t\t'tag' => 'feedback',\n\t\t\t\t'description' => __( 'The content of the feedback', 'edd-reviews' ),\n\t\t\t\t'function' => 'review_tag',\n\t\t\t\t'fes' => true,\n\t\t\t),\n\t\t\t'reviewer_discount_code' => array(\n\t\t\t\t'tag' => 'reviewer_discount_code',\n\t\t\t\t'description' => __( 'Discount code for the reviewer', 'edd-reviews' ),\n\t\t\t\t'function' => 'discount_tag',\n\t\t\t\t'discount' => true,\n\t\t\t)\n\t\t);\n\n\t\t$this->tags = $tags;\n\n\t\treturn apply_filters( 'edd_reviews_email_tags', $tags );\n\t}",
"public function attachTagsFromRequest(Post $post, Request $request);",
"public function handleTags(Request $request, Post $post){\n\n /**\n * Once the post has been saved, we deal with the tag logic.\n * Grab the tag or tags from the field, sync them with the post\n */\n $keys = collect(explode(',', $request->input('tags')))\n ->map(function($item) { \n return trim($item); \n }) // remove spaces around names\n ->filter() // remove empty names\n ->map(fn ($name) => Tag::firstOrCreate(['name' => $name])->getKey());\n\n $post->tags()->sync($keys);\n }",
"public function tags()\n {\n return ['instagram', 'social_data', 'id:' . $this->talent->id, 'handle:' . $this->talent->username];\n }",
"function prism_postfooter_posttags() {\n\n\t if ( is_single() && !is_object_in_taxonomy( get_post_type(), 'category' ) ) {\n\t $tagtext = __('This entry is tagged', 'prism') . ' ';\n\t $posttags = get_the_tag_list(\"<span class=\\\"tag-links\\\"> $tagtext \",', ','</span>. ');\n\t } elseif ( is_single() ) {\n\t \t$tagtext = __('and tagged', 'prism') . ' ';\n\t $posttags = get_the_tag_list(\"<span class=\\\"tag-links\\\"> $tagtext \",', ','</span>. ');\n\t } elseif ( is_tag() && $tag_ur_it = prism_tag_ur_it(', ') ) { /* Returns tags other than the one queried */\n\t $posttags = '<span class=\"tag-links\">' . __('Also tagged', 'prism') . ' ' . $tag_ur_it . '</span>' . \"\\n\\n\\t\\t\\t\\t\\t\\t\" . '<span class=\"meta-sep meta-sep-comments-link\">|</span> ';\n\t } else {\n\t $tagtext = __('Tagged', 'prism') . ' ';\n\t $posttags = get_the_tag_list(\"<span class=\\\"tag-links\\\"> $tagtext \",', ','</span>' . \"\\n\\n\\t\\t\\t\\t\\t\\t\" . '<span class=\"meta-sep meta-sep-comments-link\">|</span> ');\n\t }\n\t return apply_filters('prism_postfooter_posttags',$posttags); \n\t\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Test of XML extraction with element, which is empty. | public function testProcessXMLEmptyElement()
{
$object = new XMLExtractor($this->xpath, $this->simpleTransformations);
$object->setSource(self::EMPTY_ELEMENT_SOURCE);
$readArray = $object->readSource();
$this->assertEquals($this->emptyElementExpectedReadArray, $readArray, 'Reading of XML source was not correct!');
} | [
"private function _isEmpty(){\n if($this->xml == ''){\n return true;\n }\n return false;\n }",
"public function testParseEmpty()\n {\n $xmlParser = new XmlParser();\n $this->assertEquals(false, $xmlParser->parse(''));\n }",
"public function testNoChildren()\n {\n $dom = new DOMDocument;\n $dom->loadXML('<test>text</test>');\n $root = $dom->documentElement;\n $ret = XML::getChildAt($root, 4);\n PHPUnit_Framework_Assert::assertNull($ret);\n\n }",
"function xml_is_defective() {\n\t\t// which means parse error.\n\t\treturn $this->xml === FALSE;\n\t}",
"function is_blank_node() {}",
"public function isEmpty()\n {\n return $this->originalDocBlock === '';\n }",
"public function parseNonEmptyArrayValueWithNoDomAttrInstance()\n {\n $this->assertEquals('', $this->xslAbstractCallback->parseValue(array(new stdClass())));\n }",
"public function testQueryOneNone(): void\n {\n $node = $this->element->queryOne('./boo');\n $this->assertNull($node);\n }",
"public function testEmptyNode()\n {\n $config = array (\n 'init_node' => 'extractor',\n 'nodes' => array (\n 'extractor' => array (\n 'class' => 'extractor',\n 'type' => 'csv',\n 'output' => array ('empty_node'),\n 'file' => realpath(dirname(__FILE__)).'/csv/aisasia_miles.csv',\n 'skip_lines' => 1,\n 'header_line' => 0\n ),\n 'empty_node' => array (\n 'class' => '',\n 'type' => '',\n 'output' => array ('loader'),\n 'fields' => ''\n ),\n 'loader' => array (\n 'class' => 'loader',\n 'type' => 'debug'\n )\n )\n );\n\n $etl = \\Giift\\Etl\\Chain::forge($config);\n\n $extractor = $etl->getNode('extractor');\n $this->assertNotEmpty($extractor);\n $extractor_output = $extractor->getOutputs();\n foreach ($extractor_output as $output) {\n $this->assertEquals('Etl\\Transformer_Get_location', get_class($output));\n }\n\n $etl->run();\n\n $rs = $etl->getNode('loader')->getResult();\n\n $this->assertNotNull($rs);\n $this->assertEmpty($rs);\n }",
"public function testEmptyContent()\n\t{\n\t\t$this->assertSame('', static::$parserClean\n\t\t\t->setContent('')\n\t\t\t->parse()\n\t\t\t->getContent(), 'Clean instance: empty content should return empty result');\n\t}",
"public function isElementWithoutContent()\n {\n return $this instanceof DOMElement &&\n mb_strlen(preg_replace(NodeUtility::$regexps['onlyWhitespace'], '', $this->textContent)) === 0 &&\n ($this->childNodes->length === 0 ||\n $this->childNodes->length === $this->getElementsByTagName('br')->length + $this->getElementsByTagName('hr')->length\n /*\n * Special PHP DOMDocument case: We also need to count how many DOMText we have inside the node.\n * If there's an empty tag with an space inside and a BR (for example \"<p> <br/></p>) counting only BRs and\n * HRs will will say that the example has 2 nodes, instead of one. This happens because in DOMDocument,\n * DOMTexts are also nodes (which doesn't happen in JS). So we need to also count how many DOMText we\n * are dealing with (And at this point we know they are empty or are just whitespace, because of the\n * mb_strlen in this chain of checks).\n */\n + count(array_filter(iterator_to_array($this->childNodes), function ($child) {\n return $child instanceof DOMText;\n }))\n\n );\n }",
"public function testIsEmptyResult()\n {\n $this->assertFalse($this->fixture->isEmptyResult());\n }",
"public function testEmptyFeed() {\n $this->parser->parse($this->feed, new RawFetcherResult(''), $this->state);\n }",
"public function is_empty() {\n if ($this->isempty === null) {\n $this->isempty = true;\n if (!$this->fileinfo->is_empty_area()) {\n // even if is_empty_area() returns false, element still may be empty\n $children = $this->get_children();\n if (!empty($children)) {\n // 1. Let's look at already retrieved children\n foreach ($children as $childnode) {\n if ($childnode->isempty === false) {\n // we already calculated isempty for a child, and it is not empty\n $this->isempty = false;\n break;\n }\n }\n if ($this->isempty) {\n // 2. now we know that this directory contains children that are either empty or we don't know\n foreach ($children as $childnode) {\n if (!$childnode->is_empty()) {\n $this->isempty = false;\n break;\n }\n }\n }\n }\n }\n }\n return $this->isempty;\n }",
"public function testEmptyXMLString()\n {\n $xml = '';\n $simpleXml = simplexml_load_string($xml);\n $this->fixture->registerTiVoNamespace($simpleXml);\n }",
"public function isEmpty() {\n\t\treturn empty($this->content);\n\t}",
"abstract protected function _getEmpty();",
"public function theXmlElementShouldExist($element)\n {\n $elements = $this->xpath($element);\n\n if ($elements->length == 0) {\n throw new \\Exception(sprintf(\"The element '%s' does not exist.\", $element));\n }\n\n return $elements;\n }",
"public function testXmlExistsNoFile()\n {\n FileSystem::clearDirectory(DAL::getOvenPath());\n $ret = DALbaker::queryXmlExists('TestSystem', 'TestQuery');\n PHPUnit_Framework_Assert::assertFalse($ret);\n\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Scan the ./definitions directory for definition files. | function definitions(?string $dir = null): \Generator
{
$dir ?? $dir = dirname(__DIR__) . '/definitions';
$files = array_diff(scandir($dir), ['..', '.']);
foreach ($files as $file) {
if (! str_ends_with($file, '.php')) {
continue;
}
$basename = str_replace('.php', '', $file);
yield $basename => "{$dir}/{$file}";
}
} | [
"function fontDescScan() {\r\n global $symbols;\r\n $path = LIBRARY_PATH . \"/font-desc/\";\r\n $files = scandir($path);\r\n\r\n foreach($files as $file) {\r\n if(strstr($file, \".php\") !== false && is_file($path . \"/{$file}\")) {\r\n include_once $path . \"/{$file}\";\r\n }\r\n }\r\n}",
"public static function get_defs() {\n\t\t$available_defs = array();\n\t\t\n\t\t$upload_dir = wp_upload_dir();\n\t\tif (isset($upload_dir['error']) && !empty($upload_dir['error'])) {\n\t\t\tCCTM::$errors['json_decode_error'] = __('WordPress issued the following error: ', CCTM_TXTDOMAIN) .$upload_dir['error'];\t\n\t\t\treturn $available_defs;\n\t\t}\n\t\t\t\t\n\t\t$dir = $upload_dir['basedir'] .'/'.CCTM::base_storage_dir . '/' . CCTM::def_dir .'/';\n\t\t\n\t\tif ($handle = opendir($dir)) {\n\t\t\twhile (false !== ($file = readdir($handle))) {\n\t\t\t\t// Some files look like \"your_def.cctm (1).json\"\n\t\t\t\tif ( !preg_match('/^\\./', $file) && preg_match('/.json$/i', $file) ) {\n\t\t\t\t\t$available_defs[] = $file;\n\t\t\t\t}\n\t\t\t}\n\t\t\tclosedir($handle);\n\t\t}\n\n\t\treturn $available_defs;\n\t}",
"public function scan_files(){\r\n $locations = $this->file_local_places();\r\n foreach($locations as $location){\r\n $this->scan_files_by_location( $location );\r\n }\r\n }",
"public function scan()\n {\n foreach ($this->zipFiles as $zipFile) {\n $zip = new ZipFile($zipFile);\n foreach ($zip->statAll() as $stat) {\n ['name' => $name, 'directory' => $directory] = $stat;\n\n if (!$directory && str::endsWith($name, '.php')) {\n $name = str::sub($name, 0, str::length($name) - 4);\n $name = str::replace($name, '/', '\\\\');\n\n if ($this->isComponent($name)) {\n $this->load($name);\n }\n }\n }\n }\n\n foreach ($this->classPaths as $path) {\n $path = fs::normalize(fs::abs($path));\n\n fs::scan($path, [\n 'extensions' => ['php'],\n 'callback' => function ($file) use ($path) {\n $name = fs::pathNoExt($file);\n $name = str::sub($name, str::length($path));\n $name = str::replace($name, '/', '\\\\');\n\n if ($name[0] === '\\\\') {\n $name = str::sub($name, 1);\n }\n\n if ($this->isComponent($name)) {\n $this->load($name);\n }\n }\n ]);\n }\n }",
"private function injectFiles(): void\n {\n foreach (config('openapi.scan_paths') as $path) {\n $sourceFiles = $this->finder->files()->name('*.php')->in($path);\n\n foreach ($sourceFiles as $file) {\n include_once $file->getPathname();\n }\n }\n }",
"protected function findConfig() {\n $projectRoot = getcwd();\n $projectRoot = realpath($projectRoot);\n $this->writeln(\"Scanning for .uml-generator-php.yml\");\n while ($projectRoot !== '/') {\n $this->writeln(\" scanning dir: \" . $projectRoot);\n if (file_exists($projectRoot . '/.uml-generator-php.yml')) {\n break;\n }\n else {\n $projectRoot = realpath($projectRoot . '/..');\n }\n }\n if ($projectRoot == '/') {\n $this->writeln('<error>.uml-generator-php.yml not found.</error> Please run : cp ' . realpath(__DIR__ . '/../../uml-generator-php.yml.dist') . ' ' . getcwd() . '/.uml-generator-php.yml');\n $this->setProjectRoot(NULL);\n return;\n }\n $this->setProjectRoot($projectRoot);\n\n }",
"public function scan()\n\t{\n\t\t// Get the modules directory paths\n\t\t$modulesPaths = $this->app['config']->get('modules::path');\n\t\tif ( ! is_array($modulesPaths)) $modulesPaths = array($modulesPaths);\n\n\t\t// Now prepare an array with all directories\n\t\t$paths = array();\n\t\tforeach ($modulesPaths as $modulesPath) $paths[$modulesPath] = $this->app['files']->directories(base_path($modulesPath));\n\n\t\tif ($paths)\n\t\t{\n\t\t\tforeach ($paths as $path => $directories)\n\t\t\t{\n\t\t\t\tif ($directories)\n\t\t\t\t{\n\t\t\t\t\tforeach ($directories as $directory)\n\t\t\t\t\t{\n\t\t\t\t\t\t// Check if dir contains a module definition file\n\t\t\t\t\t\tif ($this->app['files']->exists($directory . '/module.json'))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$name = pathinfo($directory, PATHINFO_BASENAME);\n\t\t\t\t\t\t\t$this->modules[$name] = new Module($name, $directory, null, $this->app, $path);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Save the manifest file\n\t\t\t$this->saveManifest();\n\t\t}\n\n\t\treturn $this->modules;\n\t}",
"protected function getFiles()\r\n {\r\n $this->finder = ( new Finder )->in( $this->appPath . 'dev/' )->files();\r\n\r\n foreach ( ReservedWords::get() as $invalidName ) {\r\n $this->finder->name( $invalidName . '.php' );\r\n }\r\n }",
"public function definitions()\n\t{\n\t\t$this->authorize('index', SiteDefinition::class);\n\t\t$path = sprintf('%s/%s/', Config::get('app.definitions_path'), SiteDefinition::$defDir);\n\t\t$sites = glob($path . '*/v*/definition.json');\n\t\t$path_length = strlen($path);\n\t\tforeach($sites as &$site){\n\t\t\t$site = preg_replace('/\\/(v[0-9]+)\\/definition\\.json$/', '-$1', substr($site, $path_length));\n\t\t}\n\t\t$site_definitions = $this->getSiteDefinitions($sites);\n\t\treturn response()->json([ 'data' => $site_definitions ]);\n\t}",
"public function determineModuleDefinitions() \n {\n // get a list of the files\n $files = array();\n\n // this assumes the usual naming conventions for folders\n if ($others = glob(sfConfig::get('sf_apps_dir') . \"/*/modules/*/config/module.yml\")) \n {\n $files = array_merge($files, $others);\n }\n \n if ($others = glob(sfConfig::get('sf_plugins_dir').'/*/modules/*/config/module.yml')) \n {\n $files = array_merge($files, $others);\n }\n\n $moduleDefinitions = array();\n \n foreach ($files as $file) \n {\n try \n {\n // extract module name from file\n $matches = array();\n $match = preg_match('~([^/]+)/config/module\\.yml~', $file, $matches);\n \n if (!$match) \n {\n continue;\n }\n \n $moduleName = $matches[1];\n\n // load module.yml\n $config = sfYamlConfigHandler::parseYaml($file);\n $config = sfYamlConfigHandler::flattenConfigurationWithEnvironment($config);\n\n // look for our module definition in there\n if (!@$config['site']['module_definition']) \n {\n // no module definition here\n continue;\n }\n \n if (!$this->checkModuleDefinition($config['site']['module_definition'])) \n {\n // no module definition here\n continue;\n }\n \n $moduleDefinitions[$moduleName] = $config['site']['module_definition'];\n } \n catch (Exception $e) \n {\n // do nothing if we fail\n }\n }\n \n return $moduleDefinitions;\n }",
"function scanLib() {\n\t\t_log(\"Scanning library: \".$this->exh->getLibPath());\n\t\t$this->scanPath($this->exh->getLibPath()); // Will recurse\n\t}",
"protected function scanEvents()\n {\n if (empty($this->scanEvents))\n {\n return;\n }\n\n $scanner = new EventScanner($this->scanEvents);\n\n file_put_contents(\n $this->finder->getScannedEventsPath(), '<?php ' . $scanner->getEventDefinitions()\n );\n }",
"private function copyDefinitionFiles()\n {\n $pathToDefinitionFiles = realpath(__DIR__ . DIRECTORY_SEPARATOR . \"..\" . DIRECTORY_SEPARATOR . \"dist\" . DIRECTORY_SEPARATOR . \"definitionFiles\" . DIRECTORY_SEPARATOR . $this->getVersion());\n $definitionFiles = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($pathToDefinitionFiles, RecursiveDirectoryIterator::SKIP_DOTS), RecursiveIteratorIterator::CHILD_FIRST);\n\n copy_files($definitionFiles, $pathToDefinitionFiles, $this->getSource() . DIRECTORY_SEPARATOR . self::DIRECTORY_FOR_DEFINITION_FILES);\n }",
"private function fetchFromDirectory(array &$definitions, string $namespace, string $dir) {\n $iterator = new \\RecursiveIteratorIterator(\n new \\RecursiveDirectoryIterator($dir, \\RecursiveDirectoryIterator::SKIP_DOTS)\n );\n foreach ($iterator as $fileinfo) {\n if ($fileinfo->getExtension() == 'php') {\n $this->fetchFromFile($definitions, $namespace, $fileinfo, $iterator);\n }\n }\n }",
"public function findSchemaFiles() {\n $return = [];\n $directory = new RecursiveDirectoryIterator('modules');\n $flattened = new RecursiveIteratorIterator($directory);\n $files = new RegexIterator($flattened, '/schema.xml$/');\n\n foreach ($files as $file) {\n $relative_path = str_replace(DRUPAL_ROOT . '/', '', $file->getRealPath());\n $return[$relative_path] = $relative_path;\n }\n return $return;\n }",
"public function test_scan_files()\n {\n $content = array('.gitignore','.htaccess','index.php','README');\n $object = Directory::factory(ROOT);\n $res = $object->scan(Directory::SORT_ASC, Directory::SCAN_FILES);\n \n $this->assertEquals(count($content), count($res));\n foreach($res as $path=>$dir){\n $this->assertTrue(in_array($dir->get_base_name(), $content));\n $this->assertInstanceOf('\\Kaili\\File', $dir);\n }\n }",
"public function scan()\n {\n if (file_exists(PLUGINS_DIR)) {\n $loader = new ClassLoader();\n $loader->addPsr4('Kanboard\\Plugin\\\\', PLUGINS_DIR);\n $loader->register();\n\n $dir = new DirectoryIterator(PLUGINS_DIR);\n\n foreach ($dir as $fileInfo) {\n if ($fileInfo->isDir() && substr($fileInfo->getFilename(), 0, 1) !== '.') {\n $pluginName = $fileInfo->getFilename();\n $this->loadSchema($pluginName);\n $this->initializePlugin($pluginName, $this->loadPlugin($pluginName));\n }\n }\n }\n }",
"private function scanDir(){\n $dir = scandir($this->dir);\n if(!empty($dir)){\n foreach($dir as $source){\n //make sure we don't use it\n if(strpos( $source, \"id_\") !== false){\n continue;\n }\n // make sure it's fb2\n if( pathinfo($source, PATHINFO_EXTENSION) != \"fb2\" ){\n die(\"File $source has extension \".pathinfo($source, PATHINFO_EXTENSION).\" instead of fb2\");\n }\n\n }\n }\n }",
"private function scan() {\n\n\t\t$done = '';\n\n\t\t/**\n\t\t * Outer loop (parent theme dir -> child theme dir)\n\t\t */\n\t\tforeach ( $this -> directories as $path ) {\n\n\t\t\t/**\n\t\t\t * Outer loop will be end in first loop, if TEMPLATEPATH equals STYLESHEETPATH\n\t\t\t */\n\t\t\tif ( $path === $done ) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tif ( !is_readable( $path ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Files & dires in domains directory\n\t\t\t */\n\t\t\t$dir = new \\DirectoryIterator( $path );\n\n\t\t\t/**\n\t\t\t * Inner loop\n\t\t\t */\n\t\t\tforeach ( $dir as $fileinfo ) {\n\n\t\t\t\tif ( $fileinfo -> isDot() || !$fileinfo -> isDir() ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t/**\n\t\t\t\t * Directory's name will be used as domain name\n\t\t\t\t */\n\t\t\t\t$domain = $fileinfo -> getFilename();\n\n\t\t\t\t/**\n\t\t\t\t * Refuse registering, if the domain set as excepted domain\n\t\t\t\t */\n\t\t\t\tif ( in_array( $domain, self::$_excepted ) ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t/**\n\t\t\t\t * クラスのオートローダーとヘルパー関数が定義されたファイル (functions.php)\n\t\t\t\t * - テーマディレクトリーループ (*1)で 2巡目のみを対象。(子テーマ )\n\t\t\t\t * - 親テーマディレクトリーよりも前にしたいため、array_unshiftで配列の先頭に追加する。\n\t\t\t\t */\n\t\t\t\tif ( isset( $this -> classloaders[$domain] ) ) {\n\t\t\t\t\tarray_unshift( $this -> classloaders[$domain], $path );\n\t\t\t\t\tif ( $functions_path = self::returnReadableFilePath( $fileinfo, 'functions.php' ) ) {\n\t\t\t\t\t\tarray_unshift( $this -> functions_files, $functions_path );\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t/**\n\t\t\t\t * properties.phpのヘッダーコメントを読み込み\n\t\t\t\t * ファイルが無ければ continue\n\t\t\t\t *\n\t\t\t\t * @see http://dogmap.jp/2014/09/10/post-3109/\n\t\t\t\t */\n\t\t\t\tif ( !$property_file = self::returnReadableFilePath( $fileinfo, 'properties.php' ) ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t$property = array_filter( get_file_data( $property_file, self::$property_data ) );\n\n\t\t\t\t// 親テーマの場合はそのまま代入、子テーマの場合 (すでに $domainsに要素がある場合)はマージする。\n\t\t\t\tif ( !array_key_exists( $domain, $this -> domains ) ) {\n\t\t\t\t\t$this -> domains[$domain] = $property;\n\t\t\t\t} else {\n\t\t\t\t\tarray_merge( $this -> domains[$domain], $property );\n\t\t\t\t}\n\n\t\t\t\t/**\n\t\t\t\t * クラスのオートローダーとヘルパー関数が定義されたファイル (functions.php)\n\t\t\t\t * - テーマディレクトリーループ (*1)で 1巡目のみを対象。(親テーマ )\n\t\t\t\t */\n\t\t\t\tif ( !isset( $this -> classloaders[$domain] ) ) {\n\t\t\t\t\t$this -> classloaders[$domain][] = $path;\n\t\t\t\t\tif ( $functions_path = self::returnReadableFilePath( $fileinfo, 'functions.php' ) ) {\n\t\t\t\t\t\tarray_unshift( $this -> functions_files, $functions_path );\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}\n\t\t\t$done = $path;\n\t\t}\n\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
FUNCTION NAME: RedirectTo PARAMETER: (string) pageNameWithoutExtension RETURN: None PURPOSE: If user tries to open about_me.php directly, then redirect to and open as otherwise continue. NOTE: There is an another function with same name in common_tools.php, but its functionality is different from that one. This function is only optimized for this page. | function RedirectTo()
{
$uri = rtrim(dirname($_SERVER['PHP_SELF']), '/\\');
$uriInfo = explode("?_", $_SERVER['REQUEST_URI']);
if (count($uriInfo) <= 1)
{
/* Redirect to a different page in the current directory that was requested */
$host = $_SERVER['HTTP_HOST'];
$uri = rtrim(dirname($_SERVER['PHP_SELF']), '/\\');
$extra = 'index.php#?section=configure';
header("Location: http://$host$uri/$extra");
exit;
}
} | [
"function RedirectTo($pageNameWithoutExtension)\n {\n $uri = rtrim(dirname($_SERVER['PHP_SELF']), '/\\\\');\n\n if ($_SERVER['REQUEST_URI'] === ($uri . \"/\" . $pageNameWithoutExtension . \".php\"))\n {\n /* Redirect to a different page in the current directory that was requested */\n $host = $_SERVER['HTTP_HOST'];\n $uri = rtrim(dirname($_SERVER['PHP_SELF']), '/\\\\');\n $extra = 'index.php#?section=' . $pageNameWithoutExtension;\n header(\"Location: http://$host$uri/$extra\");\n exit;\n }\n }",
"private function redirect_to_about() {\n\t\twp_safe_redirect( admin_url( 'index.php?page=pronamic-pay-about' ) );\n\n\t\texit;\n\t}",
"public function redirect_about_page()\r\n {\r\n if ( !current_user_can('manage_options') )\r\n return;\r\n\r\n if ( !get_transient('totalpoll_about_page_activated') )\r\n return;\r\n\r\n delete_transient('totalpoll_about_page_activated');\r\n wp_safe_redirect(admin_url('edit.php?post_type=poll&page=tp-about'));\r\n exit;\r\n }",
"function redirectTo($page) {\n header(\"Location: \" . $page);\n exit;\n }",
"function redirectToModule( $name )\r\n\t{\r\n\t\t$url = generer_url_ecrire('phpmv',\"mod=\".$name,true);\r\n\t\t\t\t\r\n\t\tif(Request::getCurrentCompleteUrl() != $url)\r\n\t\t{\r\n\t\t\t@header(\"Location: $url\");\r\n\t\t\techo \"<a href='$url'>$url</a>\";\r\n\t\t\texit;\r\n\t\t}\r\n\t}",
"protected function RedirectToCallingPage()\n {\n $aParameters = array();\n $aIncludeParams = TdbShop::GetURLPageStateParameters();\n $oGlobal = TGlobal::instance();\n foreach ($aIncludeParams as $sKeyName) {\n if ($oGlobal->UserDataExists($sKeyName)) {\n $aParameters[$sKeyName] = $oGlobal->GetUserData($sKeyName);\n }\n }\n $sURL = $this->getActivePageService()->getActivePage()->GetRealURLPlain($aParameters);\n $this->getRedirect()->redirect($sURL);\n }",
"public function redirectPageContent()\n {\n }",
"public function redirectToInternalPage() {\n // Fake a TS FE Controller to use typolink url\n GeneralUtility::makeInstance(\n 'ROQUIN\\\\RoqRedirect\\\\Utility\\\\FakeTypoScriptFrontendController'\n );\n\n // Create a typolink url\n $url = $GLOBALS['TSFE']->cObj->typoLink_URL(\n array(\n 'parameter' => (int)$this->getRedirectTo(),\n 'additionalParams' => '&L=' . $this->getLanguageUid()\n )\n );\n\n // Add additional data to the typolink url for linking inside a html page\n if ($this->getAdditionalUrl()) {\n $url .= $this->getAdditionalUrl();\n }\n\n // Do the actual redirect\n Http::redirect($url, $this->getHttpCode());\n }",
"function wikiplugin_redirect_help() {\n return tra(\"Redirects you to another wiki page\").\":<br />~np~{REDIRECT(page=pagename [,url=http://foobar])/}~/np~\";\n}",
"function page_redirect($url)\n\t\t{\n\t\t\tprint \"<script>\";\n\t\t\tprint \" self.location='$url'\"; // Comment this line if you don't want to redirect\n\t\t\tprint \"</script>\";\n\t\t}",
"protected function redirect_to_main_page()\n\t{\n\t\t$host = $_SERVER['HTTP_HOST'];\n\t\t$uri = rtrim(dirname($_SERVER['PHP_SELF']), '/\\\\');\n\t\t$page = 'alumni.php'; \n\t\theader(\"Location: http://$host$uri/$page\");\n\t}",
"public function redirect()\n\t{\n\t\t$url = Piwik_Common::getRequestVar('url', '', 'string', $_GET);\n\n\t\t// validate referrer\n\t\t$referrer = Piwik_Url::getReferer();\n\t\tif(!empty($referrer) && !Piwik_Url::isLocalUrl($referrer))\n\t\t{\n\t\t\tdie('Invalid Referer detected - check that your browser sends the Referer header. <br/>The link you would have been redirected to is: '.$url);\n\t\t\texit;\n\t\t}\n\n\t\t// mask visits to *.piwik.org\n\t\tif(self::isPiwikUrl($url))\n\t\t{\n\t\t\techo\n'<html><head>\n<meta http-equiv=\"refresh\" content=\"0;url=' . $url . '\" />\n</head></html>';\n\t\t}\n\t\texit;\n\t}",
"static public function redirectToLandingPage() {\n\t\tglobal $wgOut, $wgServer;\t\t\n\t\t$defaultUrl = self::getDefaultUrl();\t\t\n\t\t$wgOut->redirect( $wgServer . $defaultUrl ); \t\t\n\t}",
"function kateryna_template_pages() {\n\n if ( is_page( 'about' ) && ! is_user_logged_in()) {\n wp_redirect( home_url( '/sample-page/') );\n die;\n //if the user is not logged in and lands on the about page, send them on the sample page\n }\n\n if ( is_page( 'sample-page') && is_user_logged_in()) {\n wp_redirect( home_url( '/about/') );\n die;\n }\n\n //if the user is logged in and lands on the sample page, then send them to the about page;\n}",
"function redirectToPlugin() {\n $c = new RequestHelp($this);\n $um = UserManager::instance();\n $user = $um->getCurrentUser();\n $ignoreLabs = $this->getProperty('ignore_labs');\n if ($user->isLoggedIn() && ($ignoreLabs || $user->useLabFeatures())) {\n $c->redirect($this->getPluginPath().'/');\n exit();\n }\n }",
"function redirect() {\n\n\t\tglobal $current_user;\n\n\t\tif(!is_admin() && is_page()){\n\t\t global $post;\n\t\t if('profile' == $post->post_name)\n\t\t return;\n }\n\n\t\tif ( is_admin() ) {\n\t\t\t$screen = get_current_screen();\n\t\t\tif ( 'profile' == $screen->base )\n\t\t\t\treturn;\n\t\t\tif ( 'plugins' == $screen->base )\n\t\t\t\treturn;\n\t\t}\n\n\t\tif ( ! is_user_logged_in() )\n\t\t\treturn;\n\n\t\twp_get_current_user();\n\n\t\tif ( get_user_meta( $current_user->ID, 'force-password-change', true ) ) {\n\t\t\t//wp_redirect( admin_url( 'profile.php' ) );\n wp_safe_redirect( home_url('profile') );\n\t\t\texit; // never forget this after wp_redirect!\n\t\t}\n\n\t}",
"public function redirectMainPage()\r\n {\r\n $this->redirect( $this->createUrl('/') );\r\n exit;\r\n }",
"function wppb_add_content_before_custom_redirects_info(){\r\n\t?>\r\n\t<p><?php _e('These redirects happen after a successful action, like registration or after a successful login.', 'profile-builder'); ?></p>\r\n\t<hr/>\r\n\t<h4><?php _e(\"Which redirect happens depends on the following priority:\", 'profile-builder'); ?></h4>\r\n\t<ol>\r\n\t\t<li><?php _e(\"Multiple Registration and Edit Profile form settings Redirects\", 'profile-builder'); ?></li>\r\n\t\t<li><?php _e(\"Individual User Redirects\", 'profile-builder'); ?></li>\r\n\t\t<li><?php _e(\"User Role based Redirects\", 'profile-builder'); ?></li>\r\n\t\t<li><?php _e(\"Global Redirects\", 'profile-builder'); ?></li>\r\n\t\t<li><?php _e(\"Individual redirects defined in shortcodes; <strong><em>redirect_priority=\\\"top\\\"</em></strong> parameter can be added in any shortcode, then that shortcode redirect will have priority over all other redirects.\", 'profile-builder'); ?></li>\r\n\t</ol>\r\n\t<hr/>\r\n\t<h4><?php _e(\"Redirect Default WordPress forms and pages\", 'profile-builder'); ?></h4>\r\n\t<p><?php _e(\"With these you can redirect various WordPress forms and pages to pages created with profile builder.\", 'profile-builder'); ?></>\r\n\t<hr/>\r\n\t<h4><?php _e(\"Available tags for dynamic URLs\", 'profile-builder'); ?></h4>\r\n\t<p><?php _e(\"You use the following tags in your URLs to redirect users to various pages.\", 'profile-builder'); ?></p>\r\n\t<ol>\r\n\t\t<li><strong>{{homeurl}}</strong> - <?php _e(\"generates a url of the current website homepage.\", 'profile-builder'); ?></li>\r\n\t\t<li><strong>{{siteurl}}</strong> - <?php _e(\"in WordPress the <a target='_blank' href='https://codex.wordpress.org/Function_Reference/site_url'>site url</a> can be different then the home url\", 'profile-builder'); ?></li>\r\n\t\t<li><strong>{{user_id}}</strong> - <?php _e(\"the ID of the user\", 'profile-builder'); ?></li>\r\n\t\t<li><strong>{{user_nicename}}</strong> - <?php _e(\"the URL sanitized version of the username, the user nicename can be safely used in URLs since it can't contain special characters or spaces.\", 'profile-builder'); ?></li>\r\n\t\t<li><strong>{{http_referer}}</strong> - <?php _e(\"the URL of the previously visited page\", 'profile-builder'); ?></li>\r\n\t</ol>\r\n\r\n<?php\r\n}",
"public function redirected() {\n\t\t$base_url = HOSTNAME_REDIRECT.'/go';\n\t\t$base_url.= '/'.$this->request->query['prid'].'-'.$this->request->query['pk'];\n\t\t$this->redirect($base_url.'/?pid='.$this->request->query['pid'].'&uid='.$this->request->query['uid']);\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Data Provider for getAbsolutePathOfRelativeReferencedFileOrPathResolvesFileCorrectly | public function getAbsolutePathOfRelativeReferencedFileOrPathResolvesFileCorrectlyDataProvider()
{
return [
'basic' => [
'/abc/def/one.txt',
'../two.txt',
'/abc/two.txt'
],
'same folder' => [
'/abc/one.txt',
'./two.txt',
'/abc/two.txt'
],
'preserve relative path if path goes above start path' => [
'abc/one.txt',
'../../two.txt',
'../two.txt'
],
'preserve absolute path even if path goes above start path' => [
'/abc/one.txt',
'../../two.txt',
'/two.txt',
],
'base folder with same folder path' => [
'/abc/',
'./two.txt',
'/abc/two.txt'
],
'base folder with parent folder path' => [
'/abc/bar/',
'../foo.txt',
'/abc/foo.txt'
],
];
} | [
"public function getAbsolutePathOfRelativeReferencedFileOrPathResolvesFileCorrectlyDataProvider() {}",
"public function resolvedPath();",
"public function toRelative(): RelativePathInterface;",
"public function getAbsolutePath() {}",
"protected abstract function getAbsolutePath(): string;",
"public function getAbsolutePath();",
"public function getFileAbsolutePath($file);",
"public function getCanonicalPathCorrectlyCleansPathDataProvider() {}",
"private function getAbsoluteInternalPath()\n {\n if (file_exists($this->src)) {\n return $this->src;\n }\n\n $file = WEB_ROOT.str_replace(DIR, '', $this->src);\n\n if (file_exists($file)) {\n return $file;\n }\n\n return $this->src;\n }",
"public function getFullPath(): string;",
"function FindAbsoluteValidPath($file){}",
"public function getAbsolutePath(File $file);",
"public function getAbsolutePath(string $path): string;",
"public function getFileUrlResolver() {\n\t\treturn $this->urlResolver;\n\t}",
"private function realpath(string $file_path): ?string\n {\n $current_template = $this->current();\n $current_directory = dirname($current_template); \n\n return realpath(\"$current_directory/$file_path\") ?: null;\n }",
"public function testResolvePathWithAbsolutePath()\n {\n\n // mock the filesystem\n $mockFilesystem = $this->getMockBuilder('TechDivision\\Import\\Adapter\\FilesystemAdapterInterface')\n ->setMethods(get_class_methods('TechDivision\\Import\\Adapter\\FilesystemAdapterInterface'))\n ->getMock();\n $mockFilesystem->expects($this->exactly(2))\n ->method('isDir')\n ->withConsecutive(\n array($path0 = '/var/www/html/test.txt'),\n array($path1 = getcwd() . DIRECTORY_SEPARATOR . ltrim($path0, '/'))\n )\n ->willReturnOnConsecutiveCalls(false, true);\n\n // set the mock filesystem\n $this->filesystemTrait->setFilesystemAdapter($mockFilesystem);\n\n // query whether or not the path will be resolved\n $this->assertSame($path1, $this->filesystemTrait->resolvePath($path0));\n }",
"final public function getRelativeFilePath()\n {\n return $this->file->getRelativeFilePath();\n }",
"public function getCurrentFullPath() {}",
"function OpenXML_GetAbsolutePath($RelativePath, $RelativeTo) {\r\n\t\t\r\n\t\t// May be reltaive to the root\r\n\t\tif (substr($RelativePath, 0, 1) == '/') {\r\n\t\t\treturn substr($RelativePath, 1);\r\n\t\t}\r\n\r\n\t\t$rp = explode('/', $RelativePath);\r\n\t\t$rt = explode('/', $RelativeTo);\r\n\t\t\r\n\t\t// Get off the file name;\r\n\t\tarray_pop($rt);\r\n\t\t\r\n\t\twhile ($rp[0] == '..') {\r\n\t\t\tarray_pop($rt);\r\n\t\t\tarray_shift($rp);\r\n\t\t}\r\n\t\t\r\n\t\twhile ($rp[0] == '.') {\r\n\t\t\tarray_shift($rp);\r\n\t\t}\r\n\t\t\r\n\t\t$path = array_merge($rt, $rp);\r\n\t\t$path = implode('/', $path);\r\n\t\t\r\n\t\treturn $path;\r\n\t\t\r\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get characteristic of paragraph. | function getCharacteristic()
{
if (is_object($this->par_node))
{
return $this->par_node->get_attribute("Characteristic");
}
} | [
"public function getParagraph()\n {\n return $this->paragraph;\n }",
"private function getParagraph() {\n if (empty($this->paragraphs)) {\n // Get X random paragraphs for Bacon ipsum.\n for ($i = 0; $i <= self::BACON_COUNT; $i++) {\n $request = $this->httpClient->get(self::BACON_IPSUM_CONTENT_SERVICE);\n $this->paragraphs[] = (string) $request->getBody();\n }\n }\n\n return (string) $this->paragraphs[rand(1, self::BACON_COUNT)];\n }",
"public function getApellido_benef()\r\n\t{\r\n\t\treturn($this->apellido_benef);\r\n\t}",
"public function getMissionPr()\n {\n\n return $this->mission_pr;\n }",
"public function partOfSpeech()\n {\n return $this->partOfSpeech;\n }",
"public function getContent_paragraph()\n {\n return $this->content_paragraph;\n }",
"public function getParagraph(): ParagraphInterface {\n return $this->variables['paragraph'];\n }",
"public function getPr()\n {\n return $this->get(self::PR);\n }",
"public function getCharacteristics()\n {\n return isset($this->Characteristics) ? $this->Characteristics : null;\n }",
"public function getChCharacteristic()\n {\n return $this->hasOne(Characteristics::class, ['id' => 'ch_characteristic_id']);\n }",
"public function _get_worm_and_intestinal_parasite_caution() {\n\t\treturn $this->_worm_and_intestinal_parasite_caution;\n\t}",
"public function getDescriptionProduit()\r\n {\r\n return $this->descriptionProduit;\r\n }",
"public function readWordParagraph() {\n \n if($this->xmlReader->nodeType == XMLReader::ELEMENT && $this->xmlReader->name == 'w:p') {\n $this->xmlValue[++$this->i]['content'] = trim($this->xmlReader->readString());\n }\n\n foreach($this->pPrNodes as $node => $element) {\n\n foreach($element as $attribute => $value) {\n \n if($this->xmlReader->nodeType == XMLReader::ELEMENT && $this->xmlReader->name == $node) {\n\n ($this->xmlReader->getAttribute($attribute) != null) ? $this->xmlValue[$this->i][trim($node, 'w:')][$value] = $this->xmlReader->getAttribute($attribute) : '';\n }\n }\n }\n }",
"public function getApplicableProductCharacteristic()\n {\n return $this->applicableProductCharacteristic;\n }",
"public static function paragraph()\n {\n for ($sentence_count = mt_rand(1, 4); $sentence_count; --$sentence_count)\n $paragraph[] = self::sentence();\n\n return implode($paragraph, ' ');\n }",
"function getApellidoP() {\r\n return $this->ApellidoP;\r\n }",
"public function getProDescripcion()\n\t{\n\t\treturn $this->pro_descripcion;\n\t}",
"public function getPrivacy()\n {\n return $this->getField('privacy');\n }",
"public function getPr()\n {\n return isset($this->pr) ? $this->pr : 0;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets query for [[TaskChats]]. | public function getTaskChats()
{
return $this->hasMany(TaskChat::className(), ['employer_id' => 'id']);
} | [
"public function getTaskChats()\n {\n return $this->hasMany(TaskChat::class, ['user_id' => 'id']);\n }",
"public function getChats()\n {\n return $this->run('getChats');\n }",
"protected function getChats()\n {\n return $this->collection->find(array('active' => true));\n }",
"public function getChats(){\n return $this->getConversationMessages()->getChats();\n }",
"public function getChats()\n {\n return $this->hasMany(Chats::className(), ['sender_id' => 'id']);\n }",
"public function getUserChats()\n {\n $chats = $this->chats->getUserChats();\n return ['data' => ChatResource::collection($chats)];\n }",
"function getActiveChats(){\n\t\t$query = $this->sql->Select(\"chats\", array(\"status\"=>1));\n\t\tif(is_array($query)){\n\t\t\tif($this->functions->countDim($query)==1)\n\t\t\t\treturn array($query);\n\t\t\telseif($this->functions->countDim($query)>1)\n\t\t\treturn $query;\n\t\t} return false;\n\t}",
"function getAllChats() {\n $user = auth()->user();\n if($user->role == 'admin')\n $chats = Chats::all();\n else\n $chats = Chats::where('user_id','=',$user->id)->get();\n \n return $chats;\n }",
"public function chats()\n {\n return $this->hasMany('Chat');\n }",
"public function invokeSearchChats() {\t\t$this->invoke(\"SEARCH CHATS\");\n\t}",
"public function chats()\n {\n return $this->hasMany('Ora\\Chat\\Chats\\ChatModel', 'user_id');\n }",
"public function chats()\n {\n return $this->hasMany('App\\Models\\Chatlog');\n }",
"public function viewChats()\n {\n return $this->morphToMany(Chat::class, 'viewable')->withTimestamps();\n }",
"public function getMyActiveChats()\n\t{\n\t\t$userName = $this->Session->read('UserData.userName');\n\n\t\t//get the user course name.\n\t\t$userCourse = $this->Session->read('UserData.usersCourses');\n\t\t$user_course_section = $userCourse[0];\n\t\t//get Course and section name\n\t\t$course_info = $this->getCourseNameOfUser($user_course_section);\n\t\t\n\t\t$course_name = $course_info->course_name;\n\t\t$course_section = $course_info->section_name;\n\t\t\n\t\t//finding the current setting of the admin(in section/all section)\n\t\t$db_setting = $this->__getDbSetting($user_course_section);\n\n\t\t// for all-section setting\n\t\tif ($db_setting == 2) {\n\t\t\t//get active chats\n\t\t\t$myChats = $this->Chat->find('all',array(\n\t\t\t\t\t'conditions'=>array(\"OR\"=>\n\t\t\t\t\t\t\tarray(\"Chat.chat_to\"=>$userName,\n\t\t\t\t\t\t\t\t\t'Chat.chat_from'=>$userName\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t'Chat.status'=>2,\n\t\t\t\t\t\t\tarray('OR'=>\n\t\t\t\t\t\t\t\t\tarray('Chat.from_course_section LIKE '=>$course_name.\"%\",\n\t\t\t\t\t\t\t\t\t\t\t'Chat.to_course_section LIKE '=>$course_name.\"%\")\n\t\t\t\t\t\t\t)\n\t\t\t\t\t)\n\n\t\t\t));\n\n\t\t\t//get active chats\n\t\t\t$adminChats = $this->Chat->find('all',array(\n\t\t\t\t\t'conditions'=>array(\"OR\"=>\n\t\t\t\t\t\t\tarray('Chat.chat_from'=>$userName),\n\t\t\t\t\t\t\t'Chat.status'=>array(1,0),\n\t\t\t\t\t\t\tarray('OR'=>\n\t\t\t\t\t\t\t\t\tarray('Chat.from_course_section LIKE '=>$course_name.\"%\",\n\t\t\t\t\t\t\t\t\t\t\t'Chat.to_course_section LIKE '=>$course_name.\"%\")\n\t\t\t\t\t\t\t))\n\t\t\t));\n\t\t}\n\t\t//end of if\n\t\t//for in-section setting\n\t\tif($db_setting == 1) {\n\t\t\t//get active chats\n\t\t\t$myChats = $this->Chat->find('all',array(\n\t\t\t\t\t'conditions'=>array(\"OR\"=>\n\t\t\t\t\t\t\tarray(\"Chat.chat_to\"=>$userName,'Chat.chat_from'=>$userName),\n\t\t\t\t\t\t\t'Chat.status'=>2,\n\t\t\t\t\t\t\t'Chat.from_course_section'=>$user_course_section,\n\t\t\t\t\t\t\t'Chat.to_course_section'=>$user_course_section\n\t\t\t\t\t)\n\t\t\t\t\t//'group' => array('Chat.room_name')\n\t\t\t));\n\n\t\t\t//get active chats\n\t\t\t$adminChats = $this->Chat->find('all',array(\n\t\t\t\t\t'conditions'=>array(\"OR\"=>\n\t\t\t\t\t\t\tarray('Chat.chat_from'=>$userName),\n\t\t\t\t\t\t\t'Chat.status'=>array(1,0),\n\t\t\t\t\t\t\t'Chat.from_course_section'=>$user_course_section,\n\t\t\t\t\t\t\t'Chat.to_course_section'=>$user_course_section\n\t\t\t\t\t)\n\t\t\t));\n\t\t}\n\t\t//end of if\n\t\t$allChats = array_merge($myChats,$adminChats);\n \n\t //die;\n\n\t\t// Obtain a list of columns\n foreach ($allChats as $key => $row) {\n $room[$key] = $row['Chat']['room_name'];\n //$id[$key] = $row['Chat']['id'];\n }\n\n // Sort the data with mid descending\n // Add $data as the last parameter, to sort by the common key\n array_multisort($room, SORT_STRING, $allChats);\n // pr($allChats);\n\t//die;\n\t\treturn $allChats;\n\t}",
"public function createdChats()\n {\n return $this->hasMany(Chat::class, 'sender_id');\n }",
"public function chats()\n {\n return $this->hasMany(Chat::class);\n }",
"public function getReceivedChats()\n {\n return $this->hasMany(Chat::className(), ['receptor_id' => 'id']);\n }",
"public function getTasksChatCustomer()\n {\n return $this->hasMany(TasksChat::className(), ['customer_id' => 'id']);\n }",
"public function getChat(Request $request)\n {\n\t\tValidator::make($request->all(), [\n\t\t\t'id' => ['required', 'exists:users,id']\n\t\t])->validate();\n\n\t\t$channel = $this->getChannelName($request->user()->id, $request->id);\n\t\t$chats = $request->user()->Chat($request->id);\n\n\t\treturn response(['chats' => $chats, 'channel' => $channel]);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Add new order and status or rename if exists. | protected function addNewOrderStateAndStatus()
{
/** @var \Magento\Sales\Model\ResourceModel\Order\Status $statusResource */
$statusResource = $this->statusResourceFactory->create();
/** @var \Magento\Sales\Model\Order\Status $status */
$status = $this->statusFactory->create();
$status->setData([
'status' => self::ORDER_STATUS_CUSTOM_CODE,
'label' => self::ORDER_STATUS_CUSTOM_LABEL,
]);
try { //if the status with the code does not exist it creates a new one, otherwise it changes the status label
$statusResource->save($status);
} catch (\Exception $exception) {
return;
}
$status->assignState(self::ORDER_STATE_CUSTOM_CODE, true, true);
} | [
"function pizza_orders_change_status() {\n\n\t$order_id = $_POST['order_id'];\t\n\t$new_status = $_POST['status'];\n\n\t$order = wc_get_order( $order_id );\n\t$order->update_status($new_status);\n\t\n\t$args = array(\n\t\t'order_status' => $new_status,\n\t\t'checkout' => 1\n\t);\n\t$id = pizza_pos_save_orders( $_POST['PID'], $args );\n\n\twp_send_json(array(\n\t\t'response' => \"#{$order_id} status was changed.\"\t\t\n\t));\n\twp_die();\n}",
"protected function _addOrderStatus()\n\t{\n\t\t$orderStatuses = $this->responseXml->addChild('order_statuses');\n\n\t\t$query = '\n\t\t\t\tSELECT \n\t\t\t\t\torders_status_id,\n\t\t\t\t\tlanguage_id,\n\t\t\t\t\torders_status_name\n\t\t\t\tFROM ' . TABLE_ORDERS_STATUS. '\n\t\t\t\tORDER BY\n\t\t\t\t\torders_status_id, language_id';\n\t\t$result = xtc_db_query($query);\n\t\t$orderStatusId = '';\n\n\t\twhile($resultArray = xtc_db_fetch_array($result))\n\t\t{\n\t\t\tif($resultArray['orders_status_id'] != $orderStatusId)\n\t\t\t{\n\t\t\t\t$orderStatus = $orderStatuses->addChild('order_status');\n\t\t\t\t$orderStatus->addChild('orders_status_id', $resultArray['orders_status_id']);\n\t\t\t}\n\t\t\t$name = $orderStatus->addChild('name', $this->wrapValue($resultArray['orders_status_name']));\n\t\t\t$name->addAttribute('language_id', $resultArray['language_id']);\n\t\t\t$name->addAttribute('language_iso', $this->languageArray[$resultArray['language_id']]['iso']);\n\n\t\t\t$orderStatusId = $resultArray['orders_status_id'];\n\t\t}\n\t}",
"function commerce_order_rules_update_status($order, $name) {\n commerce_order_status_update($order, $name);\n}",
"public static function mark_order_status()\n {\n }",
"function import_orders_set_status( $oID, $status, $comments, $notify_customer, $notify_comments=0 )\n{\n\n $ord = new order( $oID, -1 );\n $ord->setPosition( 'admin' );\n $ord->url_data['get_data'] = TRUE;\n $o = $ord->_get( $oID );\n if( !is_array($o->data[0]) )\n return array( 'ok'=>FALSE, 'errno'=>ENOENT );\n\n $res = $ord->_updateOrderStatus( $status, $comments, $notify_customer ? 'true' : 'false', $notify_comments ? 'true' : 'false' );\n// var_dump( $res );\n// if( !$res )\n// return array( 'ok'=>FALSE, 'errno'=>EIO );\n\n return array( 'ok'=>TRUE );\n}",
"function uc_order_action_update_status($order, $status) {\n if (uc_order_update_status($order->order_id, $status)) {\n $order->order_status = $status;\n }\n}",
"public function updateOrder()\n\t{\n\t\t// Get the new status\n\t\t$status = request('status');\n\n\t\t// Call correct function for updating the status\n\t\tif($status == 'processing')\n\t\t{\n\t\t\t$return = $this->setOrderStatusProcessing();\n\t\t}\n\t\telseif($status == 'complete')\n\t\t{\n\t\t\t$return = $this->setOrderStatusComplete();\n\t\t}\n\t\telseif($status == 'cancel')\n\t\t{\n\t\t\t$return = $this->setOrderStatusCanceled();\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn $this->json(array('status'=>'failed','reason'=>'Invalid status'));\n\t\t}\n\n\t\t// Return result in JSON format\n\t\tif($return == true) {\n\t\t\treturn $this->json(array('status'=>'success'));\n\t\t} else {\n\t\t\treturn $this->json(array('status'=>'failed','reason'=>'Failed to update status'));\n\t\t}\n\t}",
"private function SaveNewOrder()\n\t\t{\n\t\t\tif(!$GLOBALS['ISC_CLASS_ADMIN_AUTH']->HasPermission(AUTH_Add_Orders)) {\n\t\t\t\t$GLOBALS['ISC_CLASS_ADMIN_ENGINE']->DoHomePage(GetLang('Unauthorized'), MSG_ERROR);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t$message = '';\n\t\t\tif(!$this->ValidateOrder($_POST, $message)) {\n\t\t\t\tFlashMessage($message, MSG_ERROR);\n\t\t\t\t$this->AddOrder();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t$orderId = $this->CommitOrder($_POST);\n\t\t\tif(!$orderId) {\n\t\t\t\t$error = $GLOBALS['ISC_CLASS_DB']->GetErrorMsg();\n\t\t\t\tFlashMessage(GetLang('ProblemSavingOrder').$error, MSG_ERROR);\n\t\t\t\t$this->AddOrder();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// Log this action\n\t\t\t\t$GLOBALS['ISC_CLASS_LOG']->LogAdminAction($orderId);\n\t\t\t\tif(isset($_REQUEST['addAnother'])) {\n\t\t\t\t\t$location = 'index.php?ToDo=addOrder';\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$location = 'index.php?ToDo=viewOrders';\n\t\t\t\t}\n\t\t\t\tFlashMessage(sprintf(GetLang('OrderCreated'), $orderId, $orderId), MSG_SUCCESS, $location);\n\t\t\t}\n\t\t}",
"function saveOrderStatus($order)\n {\n $request = $this->request;\n $payment = $order->getPayment();\n $originalTid = trim($payment->getLastTransId());\n // save paid transaction id\n $transaction = Mage::getModel('sales/order_payment')->getCollection()\n ->addFieldToFilter('last_trans_id', $originalTid)\n ->addFieldToSelect('entity_id');\n foreach ($transaction as $transactionId) {\n $entitiyId = $transactionId->getEntityId();\n }\n Mage::getModel('sales/order_payment')->load($entitiyId)\n ->setLastTransId(trim($request['tid']))\n ->save();\n // change the order status\n $orderStatus = $this->getOrderStatus($order);\n $orderState = Mage_Sales_Model_Order::STATE_PROCESSING; //processing: ok; complete: not ok -> would cause the error msg: 'Der Bestellzustand \"complete\" darf nicht manuell gesetzt werden'\n $order->setState($orderState, true, 'Novalnet callback set state ' . $orderState . ' for Order-ID = ' . $this->orderNo);\n $order->addStatusToHistory($orderStatus, 'Novalnet callback added order status ' . $orderStatus); // this line must be located after $order->setState()\n $order->save();\n // change invoice status to paid\n $invoice = $order->getInvoiceCollection()->getFirstItem();\n $invoice->setState(Mage_Sales_Model_Order_Invoice::STATE_PAID);\n $invoice->save();\n }",
"public function updateOrderStatus($orderId, $statusId);",
"public function onOrderUpdate(OrderEvent $event) {\n $order = $event->getOrder();\n $original_order = $order->original;\n foreach ($order->getItems() as $item) {\n if (!$original_order->hasItem($item)) {\n if ($order && !in_array($order->getState()->value, ['draft', 'canceled'])) {\n $entity = $item->getPurchasedEntity();\n $service = $this->stockServiceManager->getService($entity);\n $checker = $service->getStockChecker();\n // If always in stock then no need to create a transaction.\n if ($checker->getIsAlwaysInStock($entity)) {\n return;\n }\n $location = $this->stockServiceManager->getPrimaryTransactionLocation($entity, $item->getQuantity());\n $amount = -1 * $item->getQuantity();\n $metadata = [\n 'related_oid' => $order->id(),\n 'related_uid' => $order->getCustomerId(),\n 'data' => ['message' => 'order item added'],\n ];\n $service->getStockUpdater()->createTransaction($entity, $location->getId(), '', $amount, NULL, StockTransactionsInterface::STOCK_SALE, $metadata);\n }\n }\n }\n }",
"public function setOrderStatus($order, $status)\n\t{\n\t\t//Check current order status. Do not continue if it is the same\n\t\tif ($order->getStatus() === $status)\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\t//Find state based on status\n\t\t$status_details = Mage::getModel('sales/order_status')\n\t\t\t\t\t\t\t\t->getCollection()\n\t\t\t\t\t\t\t\t->joinStates()\n\t\t\t\t\t\t\t\t->addFieldToFilter('main_table.status', $status)\n\t\t\t\t\t\t\t\t->getFirstItem();\n\n\t\t//Update order's status. Magento does have a separate function for completed or closed\n\t\tswitch ($status_details['state'])\n\t\t{\n\t\t\t//Order is cancelled\n\t\t\tcase 'cancelled':\n\t\t\t\tif (!$order->canCancel())\n\t\t\t\t{\n\t\t\t\t\tthrow new Exception('Order cannot be cancelled');\n\t\t\t\t}\n\n\t\t\t\t$order->cancel();\n\n\t\t\t\tbreak;\n\n\t\t\t//Order is complete\n\t\t\tcase 'complete':\n\n\t\t\t\t//Disable order observer. Wrong order status is sent to bridge when payment is not captured yet\n\t\t\t\tMage::register('netmatter_bridge_disable_order_observer', 1);\n\n\t\t\t\t//Check if order can be invoiced\n\t\t\t\tif ($order->canInvoice())\n\t\t\t\t{\n\t\t\t\t\t//Create invoice\n\t\t\t\t\t$invoice = Mage::getModel('sales/service_order', $order)->prepareInvoice();\n\n\t\t\t\t\t$invoice->setRequestedCaptureCase(Mage_Sales_Model_Order_Invoice::CAPTURE_ONLINE);\n\t\t\t\t\t$invoice->register();\n\n\t\t\t\t\t//Save\n\t\t\t\t\t$transaction = Mage::getModel('core/resource_transaction')\n\t\t\t\t\t\t\t\t\t\t->addObject($invoice)\n\t\t\t\t\t\t\t\t\t\t->addObject($invoice->getOrder());\n\t\t\t\t\t$transaction->save();\n\t\t\t\t}\n\n\t\t\t\t//Set again state/status manually\n\t\t\t\t$order->setData('state', 'complete');\n\t\t\t\t$order->setStatus($status);\n\t\t\t\t$history = $order->addStatusHistoryComment('', false);\n\t\t\t\t$history->setIsCustomerNotified(true);\n\n\t\t\t\t//Re-enable\n\t\t\t\tMage::register('netmatter_disable_order_observer', 0);\n\n\t\t\t\t//Trigger order to be resend\n\t\t\t\tMage::helper('bridge/data')->sendOrder($order);\n\n\t\t\t\tbreak;\n\n\t\t\t//Order is closed. Not supported [Closed orders are orders that have had a credit memo assigned to it and the customer has been refunded for their order]\n\t\t\tcase 'closed':\n\n\t\t\t\tbreak;\n\n\t\t\t//Any other status\n\t\t\tdefault:\n\n\t\t\t\t$order->setState($status_details['state'], $status);\n\n\t\t\t\tbreak;\n\t\t}\n\n\t\t//Save order\n\t\t$order->save();\n\t}",
"private static function set_details_status( WC_Order $order, Order_Details $order_details ) {\n\t\t$status = $order->get_meta( Order_Meta_Keys::SHIPMENT_STATUS );\n\t\t$status_time = $order->get_meta( Order_Meta_Keys::SHIPMENT_STATUS_TIME );\n\n\t\t$task_id = $order->get_meta( Order_Meta_Keys::SEND_DRAFT_TASK_ID );\n\t\tif ( $task_id && ! $order_details->get_reference() && $order_details->is_packlink_order() ) {\n\t\t\t$order_details->set_creating( true );\n\t\t\t/**\n\t\t\t * Queue service.\n\t\t\t *\n\t\t\t * @var QueueService $service\n\t\t\t */\n\t\t\t$service = ServiceRegister::getService( QueueService::CLASS_NAME );\n\t\t\t$queue_item = $service->find( $task_id );\n\t\t\tif ( $queue_item && QueueItem::FAILED === $queue_item->getStatus() ) {\n\t\t\t\t$status = $queue_item->getStatus();\n\t\t\t\t$status_time = $queue_item->getLastUpdateTimestamp();\n\t\t\t\t$order_details->set_message( $queue_item->getFailureDescription() );\n\t\t\t\t$order_details->set_creating( false );\n\t\t\t}\n\t\t}\n\n\t\t$order_details->set_status( $status ?: ShipmentStatus::STATUS_PENDING );\n\t\t$order_details->set_status_time( $status_time ? date( get_option( 'links_updated_date_format' ), $status_time ) : '' );\n\t}",
"public function add( $order )\n {\n // Check the order is exist already\n $query = parent::getList('order_name = \\'' . $order->name . '\\'' );\n if( $query->num_rows() > 0 ) {\n $customer_name = '';\n if( isset( $order->customer)) $customer_name = $order->customer->first_name . ' ' . $order->customer->last_name;\n\n $country = '';\n if( isset($order->shipping_address->country_code)) $country = $order->shipping_address->country_code;\n\n // Get the number of map products\n foreach( $order->line_items as $line_item )\n {\n // Insert data\n $data = array(\n 'order_id' => $line_item->id,\n 'customer_name' => $customer_name,\n 'email' => $order->email,\n 'product_name' => $line_item->name,\n 'order_name' => $order->name,\n 'created_at' => str_replace('T', ' ', $order->created_at) ,\n 'amount' => $line_item->price,\n 'country' => $country,\n 'num_products' => $line_item->quantity,\n 'fulfillment_status' => empty($line_item->fulfillment_status) ? '' : $line_item->fulfillment_status,\n 'data' => base64_encode( json_encode( $line_item ) ),\n 'financial_status' => empty($order->financial_status) ? '' : $order->financial_status,\n 'sku' => $line_item->sku,\n 'exported_status' => 0\n );\n \n $query = parent::getList('order_id = \\'' . $line_item->id . '\\'' );\n if($query->num_rows() == 0){\n parent::add( $data );\n }\n else\n {\n $old_array = $query->result();\n $old_order = $old_array[0];\n $id = $old_order->id;\n parent::update( $id, $data );\n }\n }\n\n return true;\n }\n else{\n $customer_name = '';\n if( isset( $order->customer)) $customer_name = $order->customer->first_name . ' ' . $order->customer->last_name;\n\n $country = '';\n if( isset($order->shipping_address->country_code)) $country = $order->shipping_address->country_code;\n\n // Get the number of map products\n foreach( $order->line_items as $line_item )\n {\n // Insert data\n $data = array(\n 'order_id' => $line_item->id,\n 'customer_name' => $customer_name,\n 'email' => $order->email,\n 'product_name' => $line_item->name,\n 'order_name' => $order->name,\n 'created_at' => str_replace('T', ' ', $order->created_at) ,\n 'amount' => $line_item->price,\n 'country' => $country,\n 'num_products' => $line_item->quantity,\n 'fulfillment_status' => empty($line_item->fulfillment_status) ? '' : $line_item->fulfillment_status,\n 'data' => base64_encode( json_encode( $line_item ) ),\n 'financial_status' => empty($order->financial_status) ? '' : $order->financial_status,\n 'sku' => $line_item->sku,\n 'exported_status' => 0\n );\n \n $query = parent::getList('order_id = \\'' . $line_item->id . '\\'' );\n if($query->num_rows() == 0){\n parent::add( $data );\n }\n }\n\n return true;\n }\n }",
"public function testShipOrderStatusPreserve()\n {\n $incrementId = '100000001';\n $orderStatus = 'example';\n\n /** @var Order $existingOrder */\n $order = $this->getOrder($incrementId);\n $this->assertEquals($orderStatus, $order->getStatus());\n\n $requestData = [\n 'orderId' => $order->getId(),\n ];\n /** @var OrderItemInterface $item */\n foreach ($order->getAllItems() as $item) {\n $requestData['items'][] = [\n 'order_item_id' => $item->getItemId(),\n 'qty' => $item->getQtyOrdered(),\n ];\n }\n\n $shipmentId = $this->_webApiCall($this->getServiceInfo($order), $requestData);\n $this->assertNotEmpty($shipmentId);\n $actualOrder = $this->getOrder($order->getIncrementId());\n\n $this->assertEquals(\n $order->getStatus(),\n $actualOrder->getStatus(),\n 'Failed asserting that Order status wasn\\'t changed'\n );\n }",
"function wmp_on_order_status_change( $order_id, $old_status, $new_status ) {\r\n global $wpdb;\r\n\r\n \r\n $wpdb->update( $wpdb->prefix . 'wmp_orders',\r\n array( 'order_status' => $new_status ),\r\n array( 'order_id' => $order_id ),\r\n array( '%s' ),\r\n array( '%d' )\r\n );\r\n\r\n // if any child orders found, change the orders as well\r\n $sub_orders = get_children( array( 'post_parent' => $order_id, 'post_type' => 'shop_order' ) );\r\n if ( $sub_orders ) {\r\n foreach ($sub_orders as $order_post) {\r\n $order = new WC_Order( $order_post->ID );\r\n $order->update_status( $new_status );\r\n }\r\n }\r\n}",
"function musth_restws_change_order_status($order, $new_status) {\n\n if ($new_status == 'checkout_complete') {\n\n // The following check is needed to see if the order can change status to\n // checkout_complete\n if (!commerce_checkout_complete_access($order)) {\n // We can't change status\n // Actually we shouldn't have any problem because the check is based on\n // the status itself, but you never know, there could me more requirements to meet\n\n watchdog('musth_restws', 'W3E078 The given order cant access checkout completion (!o) ',\n array('!o' => print_r($order, true)),\n WATCHDOG_ERROR);\n\n return FALSE;\n }\n\n }\n\n // What about the commerce api commerce_checkout_order_can_checkout? Why don't we use it?\n // We don't because it checks if an order has at least one line item\n // We trust Angular with this check\n\n // Just in case, let's refresh the order before changing status\n if ($order->status == 'cart')\n commerce_cart_order_refresh($order);\n\n // We are skipping the save because the order will be saved later\n commerce_order_status_update($order, $new_status, TRUE);\n\n if ($new_status == 'checkout_complete') {\n // Staring the process that will complete the order checkout and put it in\n // the 'pending' status\n // The checkout completion rules will run\n commerce_checkout_complete($order);\n }\n\n return TRUE;\n}",
"public function updateOrderStatus()\n {\n # code...\n }",
"public function testUpdateAnOrder()\n {\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets a new descricaoDbCr | public function setDescricaoDbCr($descricaoDbCr)
{
$this->descricaoDbCr = $descricaoDbCr;
return $this;
} | [
"function setDescricao( $descricao ) {\n // seta o valor de: descricao\n $this->descricao = $descricao;\n }",
"function setDescricao( $descricao ) {\n $this->descricao = $descricao;\n }",
"public function setDescricao($v)\n\t{\n\t\tif ($v !== null) {\n\t\t\t$v = (string) $v;\n\t\t}\n\n\t\tif ($this->descricao !== $v) {\n\t\t\t$this->descricao = $v;\n\t\t\t$this->modifiedColumns[] = BoletoPeer::DESCRICAO;\n\t\t}\n\n\t\treturn $this;\n\t}",
"function set_descripcion($descripcion) {\n $this->descripcion = $descripcion;\n }",
"function SetDescription($desc){}",
"function setDescrizione($descrizione) {\r\n $this->descrizione = $descrizione;\r\n }",
"public function CDBalumno(){\n\t\t$this->ini();\n\t}",
"function createDatabaseObject() {\r\n\t\t$this->db = t3lib_div::makeInstance('tx_rscomments_database');\r\n\t\t$this->db->init($this->config);\r\n\t}",
"function __construct($aIdDescrHab,$oBD){\r\n\t\tinclude $this->sRessourcesFile;\r\n\t\t$this->sSql=$aSql[$oBD->sgbd]['habit_descr'];\r\n\t\t$this->sSql=str_replace('$sIdPev',$aIdDescrHab['id_pev'],$this->sSql);\r\n\t\t$this->sSql=str_replace('$sDnudes',$aIdDescrHab['dnudes'],$this->sSql);\r\n\t\t$oPDOresult=$oBD->execute($this->sSql);\r\n\t\tif($oBD->enErreur()){\r\n\t\t\t$this->sStatus=1;\r\n\t\t\t$this->sMessage=$oBD->getBDMessage();\r\n\t\t}else{\r\n\t\t\t$this->aFields=$oBD->ligneSuivante($oPDOresult);\r\n\t\t\t$this->sStatus=0;\r\n\t\t}\r\n\t}",
"public function setDescricao($v)\n\t{\n\t\tif ($v !== null) {\n\t\t\t$v = (string) $v;\n\t\t}\n\n\t\tif ($this->descricao !== $v) {\n\t\t\t$this->descricao = $v;\n\t\t\t$this->modifiedColumns[] = TbinstexternaPeer::DESCRICAO;\n\t\t}\n\n\t\treturn $this;\n\t}",
"private function writeDescricao() {\r\n\t\t\r\n\t\t$tabRelatorio = new RelatorioFinal();\r\n\t\t$this->relatorio = $tabRelatorio->fetchRow('id='.$this->projeto->idRelatorioFinal);\r\n\t\t$tabParceiro = new Parceiro();\r\n\t\t$parceiros = $tabParceiro->fetchParceirosByProjeto($this->projeto->id);\r\n\r\n\t\t$this->SetFont('vera', 'B', 11);\r\n\t\t$position = $this->increasePosition();\r\n\t\t$this->Cell(self::BLOCK_SIZE, 5, $position . '. DESCRIÇÃO', 'LTR', 1);\r\n\t\t$this->Cell(self::BLOCK_SIZE, 4, '', 'LR', 1);\r\n\t\t$this->SetFont('vera','B', 10);\r\n\t\t$this->Cell(self::BLOCK_SIZE, 5, 'Articulação com o ensino', 'LTR', 1);\r\n\t\t$this->SetFont('vera','',10);\r\n\t\t$this->Cell(self::BLOCK_SIZE, 5, 'Disciplinas: '.$this->relatorio->disciplinas,'LR',1);\r\n\t\t$this->Cell(self::BLOCK_SIZE, 5, 'Estágio: '.$this->relatorio->estagio,'LR',1);\r\n\t\t$this->Cell(self::BLOCK_SIZE,5,'Crédito (flexibilização curricular): '.$this->relatorio->creditos,'LR',1);\r\n\t\t$this->SetFont('vera','B', 10);\r\n\t\t$this->Cell(self::BLOCK_SIZE, 5, 'Articulação com a pesquisa', 'LTR', 1);\r\n\t\t$this->SetFont('vera','',10);\r\n\t\t$this->Cell(self::BLOCK_SIZE,5,'Projeto: '.$this->relatorio->projeto,'LR',1);\r\n\t\t$this->SetFont('vera','B', 10);\r\n\t\t$this->Cell(self::BLOCK_SIZE, 5, 'Total de pessoas da equipe de trabalho envolvidas na execução', 'LTR', 1);\r\n\t\t$this->SetFont('vera','',10);\r\n\t\t$this->Cell(self::BLOCK_SIZE,5,'Docentes: '.$this->relatorio->docentesEnvolvidos,'LR',1);\r\n\t\t$this->SetFont('vera','B', 10);\r\n\t\t$this->Cell(self::BLOCK_SIZE,5,'Alunos da Graduação','LTR',1);\r\n\t\t$this->SetFont('vera','', 10);\r\n\t\t$this->Cell(self::BLOCK_SIZE,5,'Bolsistas: '.$this->relatorio->alunosGraduacaoBolsistasEnvolvidos,'LR',1);\r\n\t\t$this->Cell(self::BLOCK_SIZE,5,'Não - Bolsistas: '.$this->relatorio->alunosGraduacaoNaoBolsistasEnvolvidos,'LBR',1);\r\n\t\t$this->Cell(self::BLOCK_SIZE,5,'Alunos Pós-Graduação: '.$this->relatorio->alunosPosGraduacaoEnvolvidos,'LR',1);\r\n\t\t$this->Cell(self::BLOCK_SIZE,5,'Técnicos Administrativos: '.$this->relatorio->tecnicosAdministrativosEnvolvidos,'LR',1);\r\n\t\t$this->Cell(self::BLOCK_SIZE,5,'De outras IES ou orgãos: '.$this->relatorio->pessoasOutrasIESEnvolvidas,'LR',1);\r\n\t\t$this->Cell(self::BLOCK_SIZE,5,'Da comunidade externa: '.$this->relatorio->pessoasComunidadeEnvolvidas,'LR',1);\r\n\t\t$this->Cell(self::BLOCK_SIZE,5,'Público atingido: '.$this->relatorio->publicoAtingido,'LR',1);\r\n\t\t$this->SetFont('vera','B', 10);\r\n\t\tif(count($parceiros) > 0){\r\n\t\t$this->Cell(self::BLOCK_SIZE,5,'Ariculação Externa (Parceiros Externos)','LTR',1);\r\n\t\t$this->SetFont('vera','', 10);\r\n\t\t\t\r\n\t\t\tforeach ($parceiros as $parceiro) {\r\n\t\t\t\t$this->Cell(self::BLOCK_SIZE,5,$parceiro->nomeInstituicao,'LR',1);\r\n\t\t\t}\r\n\t\t}\r\n\t\t$this->Cell(self::BLOCK_SIZE,5,'Número de atendimentos por semana','LTR',1);\r\n\t\t$this->SetFont('vera','', 10);\r\n\t\t$this->Cell(self::BLOCK_SIZE,5,'Individuais: '.$this->relatorio->atendimentosSemanaisIndividuais,'LR',1);\r\n\t\t$this->Cell(self::BLOCK_SIZE,5,'Grupo: '.$this->relatorio->atendimentosSemanaisGrupo,'LR',1);\r\n\t\t$this->Cell(self::BLOCK_SIZE, 4, '', 'LBR', 1);\r\n\t\t$this->SetY($this->GetY() + 4);\r\n\t\t$this->AddPage();\r\n\t\t$position = $this->increasePosition();\r\n\t\t$this->SetFont('vera', 'B', 11);\r\n\t\t$this->Cell(self::BLOCK_SIZE, 5, $position . '. MONITORAMENTO DA PRODUÇÃO', 'LTR', 1);\r\n\t\t$this->Cell(self::BLOCK_SIZE, 4, '', 'LR', 1);\r\n\t\t$this->SetFont('vera', 11);\r\n\t\t$this->Cell((self::BLOCK_SIZE/3),5,'Livro: '.$this->relatorio->producaoLivros,'LTRB',0);\r\n\t\t$this->Cell((self::BLOCK_SIZE/3),5,'Comunicação: '.$this->relatorio->producaoComunicacao,'LTRB',0);\r\n\t\t$this->Cell((self::BLOCK_SIZE/3),5,'Programa de Rádio: '.$this->relatorio->producaoProgramasRadio,'LTRB',1);\r\n\t\t$this->Cell((self::BLOCK_SIZE/3),5,'Capítulo de Livro: '.$this->relatorio->producaoCapitulosLivros,'LTRB',0);\r\n\t\t$this->Cell((self::BLOCK_SIZE/3),5,'Relatório Técnico: '.$this->relatorio->producaoRelatoriosTecnicos,'LTRB',0);\r\n\t\t$this->Cell((self::BLOCK_SIZE/3),5,'Programas de TV: '.$this->relatorio->producaoProgramasTV,'LTRB',1);\r\n\t\t$this->Cell((self::BLOCK_SIZE/3),5,'Anais: '.$this->relatorio->producaoAnais,'LTRB',0);\r\n\t\t$this->Cell((self::BLOCK_SIZE/3),5,'Produto Audiovisual - Filme: '.$this->relatorio->producaoAudiovisualFilme,'LTRB',0);\r\n\t\t$this->Cell((self::BLOCK_SIZE/3),5,'Aplicativo para computador: '.$this->relatorio->producaoAplicativosComputador,'LTRB',1);\r\n\t\t$this->Cell((self::BLOCK_SIZE/3),5,'Manual: '.$this->relatorio->producaoManuais,'LTRB',0);\r\n\t\t$this->Cell((self::BLOCK_SIZE/3),5,'Produto Audiovisual - Vídeo: '.$this->relatorio->producaoAudiovisualVideos,'LTRB',0);\r\n\t\t$this->Cell((self::BLOCK_SIZE/3),5,'Jogo Educativo: '.$this->relatorio->producaoJogosEducativos,'LTRB',1);\r\n\t\t$this->Cell((self::BLOCK_SIZE/3),5,'Jornal: '.$this->relatorio->producaoJornais,'LTRB',0);\r\n\t\t$this->Cell((self::BLOCK_SIZE/3),5,'Produto Audiovisual - CD: '.$this->relatorio->producaoAudiovisualCDs,'LTRB',0);\r\n\t\t$this->Cell((self::BLOCK_SIZE/3),5,'Produto Artístico: '.$this->relatorio->producaoProdutosArtisticos,'LTRB',1);\r\n\t\t$this->Cell((self::BLOCK_SIZE/3),5,'Revista: '.$this->relatorio->producaoRevistas,'LTRB',0);\r\n\t\t$this->Cell((self::BLOCK_SIZE/3),5,'Produto Audiovisual - DVD: '.$this->relatorio->producaoAudiovisualDVDs,'LTRB',0);\r\n\t\t$this->Cell((self::BLOCK_SIZE/3),5,'Artigo: '.$this->relatorio->producaoArtigos,'LTRB',1);\r\n\t\t$this->Cell((self::BLOCK_SIZE/3),5,'Produto Audiovisual - Outros: '.$this->relatorio->producaoAudiovisualOutros,'LTRB',0);\r\n\t\t$this->Cell((self::BLOCK_SIZE/3),5,'Outros: '.$this->relatorio->producaoOutros,'LTB',0);\r\n\t\t$this->Cell((self::BLOCK_SIZE/3),5,$this->relatorio->producaoOutrosTexto,'LTRB',1);\r\n\t\t$this->Cell(self::BLOCK_SIZE,5,'Detalhamento da Produção: ','LTR',1);\r\n\t\t$this->SetFont('vera','',11);\r\n\t\t$this->MultiCell(self::BLOCK_SIZE,1,$this->relatorio->producaoDetalhamento,'LRB','L');\r\n\t\t$this->SetFont('vera','B',11);\r\n\t\t$this->Cell(self::BLOCK_SIZE,5,\"Relatório Final: \",'LR',1);\r\n\t\t$this->SetFont('vera','',11);\r\n\t\t$this->MultiCell(self::BLOCK_SIZE,1,$this->relatorio->relatorioFinal,'LRB','L');\r\n\t\t$this->Cell(self::BLOCK_SIZE, 6, '', '', 1);\r\n\t\r\n\t}",
"public function setDescription($newDesc) {\n\n $this->description = $newDesc;\n\n return $this;\n }",
"private function writeDescricao() {\r\n\t\t$this->SetFont('vera', 'B', 11);\r\n\t\t$position = $this->increasePosition();\r\n\t\t$this->Cell(self::BLOCK_SIZE, 5, $position . '. DESCRIÇÃO', 'LTR', 1);\r\n\t\t$this->Cell(self::BLOCK_SIZE, 4, '', 'LR', 1);\r\n\t\t$this->writeInnerBlock('FUNDAMENTAÇÃO TEÓRICA', $this->projeto->fundamento);\r\n\t\t$this->writeInnerBlock('OBJETIVOS', $this->projeto->objetivos);\r\n\t\t$this->writeInnerBlock('METODOLOGIA', $this->projeto->metodologia);\r\n\t\t$this->writeInnerBlock('PÚBLICO ALVO', $this->projeto->publicoAlvo);\r\n\t\t$this->writeInnerBlock('EXPECTATIVA DE ATENDIMENTOS', $this->projeto->pessoasAtendidas);\r\n\t\t$this->writeInnerBlock('RESUMO', $this->projeto->resumo);\r\n\t\t$this->writeInnerBlock('BOLSAS PRETENDIDAS', $this->projeto->bolsasPretendidas);\r\n\t\t$this->writeInnerBlock('JUSTIFICATIVA PARA BOLSAS', $this->projeto->bolsasJustificativa);\r\n\t\t$this->Cell(self::BLOCK_SIZE, 4, '', 'LBR', 1);\r\n\t\t$this->SetY($this->GetY() + 4);\r\n\t}",
"public function __construct() {\n //richiama il costruttore della classe FDatabase\n parent::__construct();\n // imposto il nome della tabella\n $this->_nomeTabella = \"esame\";\n $this->_nomeColonnaPKTabella = \"IDEsame\";\n $this->_attributiTabella = \"IDEsame, NomeEsame, Descrizione, Prezzo, \" .\n \"Durata, MedicoEsame, NumPrestazioniSimultanee, \" .\n \"NomeCategoria, PartitaIVAClinica, Eliminato\";\n }",
"public function addDescription()\n {\n $this->addElement($this->getTextElement('descricao', 'Descrição', false));\n }",
"public function set_dataset_descr($descr)\n {\n $this->current_base->descr = $descr;\n }",
"public function __construct() \n {\n //richiama il costruttore della classe FDatabase\n parent::__construct();\n // imposto il nome della tabella\n $this->_nomeTabella = \"clinica\";\n $this->_nomeColonnaPKTabella = \"PartitaIVA\";\n $this->_attributiTabella = $this->_attributiTabella . \"; PartitaIVA, NomeClinica, Titolare, Via, \" \n . \"NumCivico, CAP, Localita, Provincia, Regione, Username, Telefono, \"\n . \"CapitaleSociale, WorkingPlan, Validato\"; \n }",
"function getDatosDesc_enc()\n {\n $nom_tabla = $this->getNomTabla();\n $oDatosCampo = new core\\DatosCampo(array('nom_tabla' => $nom_tabla, 'nom_camp' => 'desc_enc'));\n $oDatosCampo->setEtiqueta(_(\"desc_enc\"));\n return $oDatosCampo;\n }",
"private function createCrud($nome_da_tabela,$pacote){\n\t\t\t$this->CriarEstrutura($pacote,$nome_da_tabela);\n\t\t\t$this->init();\n\t\t\t\n\t\t\t// CONSULTA E EXCLUSAO:\n\t\t\t$arq = $this->LerArq($this->caminho . \"consultar_excluir.phtml\");\n\t\t\tfor($i = 0; $i < count($arq); $i++) {\n\t\t\t\t$arq[$i] = str_replace(\"clientes\", $nome_da_tabela, $arq[$i]);\n\t\t\t}\n\t\t\t$path = FW_PATH_SERV . FW_RAIZ . \"app/packages/\" . $pacote . \"/views/\" ;\n\t\t\t$name = $path . $nome_da_tabela . \"/consultar_excluir.phtml\";\n\t\t\t$this->CriarArq($name,$arq);\n\t\t\t\n\t\t\t// INCLUSAO E ALTERAÇÃO\n\t\t\t$arq = $this->LerArq($this->caminho . \"incluir_alterar.phtml\");\n\t\t\t$path = FW_PATH_SERV . FW_RAIZ . \"app/packages/\" . $pacote . \"/views/\" ;\n\t\t\t$name = $path . $nome_da_tabela . \"/incluir_alterar.phtml\";\n\t\t\t$this->CriarArq($name,$arq);\n\t\t\t\n\t\t\t// CABCAMPO.PHP - CABEÇALHOS E CAMPOS DA TABELA\n\t\t\t$rf = new InfoBDLib(); \n\t\t\t$campos = $rf->retorna_info_CP(FW_BANCO,$nome_da_tabela);\t//\tRetorna todos os campos da tabela\n\t\t\t\n\t\t\t$rotCamp = \"$\". \"FW_campos = array(\";\n\t\t\tfor ($ct=0;$ct< count($campos); $ct++) {\n\t\t\t\tif (count($campos) != ($ct+1)) {\n\t\t\t\t\t$rotCamp = $rotCamp . '\"' . strtoupper($campos[$ct][0]) . '\"' . \" => \" . '\"' . $campos[$ct][0] . '\"' . \",\" . \"\\n\";\n\t\t\t\t} else {\n\t\t\t\t\t$rotCamp = $rotCamp . '\"' . strtoupper($campos[$ct][0]) . '\"' . \" => \" . '\"' . $campos[$ct][0] . '\"'. \"\\n\";\n\t\t\t\t}\t\t\t\t\n\t\t\t}\n\t\t\t\t$rotCamp = $rotCamp . \");\";\n\t\t\t\n\t\t\t$arq = $this->LerArq($this->caminho . \"cabCampo.php\");\n\t\t\tfor($i = 0; $i < count($arq); $i++) {\n\t\t\t\t$arq[$i] = str_replace(\"$\".\"FW_campos = array();\", $rotCamp, $arq[$i]);\t\n\t\t\t}\n\t\t\t$path = FW_PATH_SERV . FW_RAIZ . \"app/packages/\" . $pacote . \"/views/\" ;\n\t\t\t$name = $path . $nome_da_tabela . \"/blocks/cabCampo.php\";\n\t\t\t$this->CriarArq($name,$arq);\n\t\t\t\n\t\t\t// Deixando só os três primeiros campos de $rotCamp\n\t\t\t\n\t\t\twhile (true) {\n\t\t\t\tif (count($campos) > 3) {\n\t\t\t\t\tarray_pop($campos);\n\t\t\t\t}\n\t\t\t\tif (count($campos) <= 3) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$rotCamp = \"$\". \"FW_campos = array(\";\n\t\t\tfor ($ct=0;$ct< count($campos); $ct++) {\n\t\t\t\tif (count($campos) != ($ct+1)) {\n\t\t\t\t\t$rotCamp = $rotCamp . '\"' . strtoupper($campos[$ct][0]) . '\"' . \" => \" . '\"' . $campos[$ct][0] . '\"' . \",\" . \"\\n\";\n\t\t\t\t} else {\n\t\t\t\t\t$rotCamp = $rotCamp . '\"' . strtoupper($campos[$ct][0]) . '\"' . \" => \" . '\"' . $campos[$ct][0] . '\"'. \"\\n\";\n\t\t\t\t}\t\t\t\t\n\t\t\t}\n\t\t\t\t$rotCamp = $rotCamp . \");\";\n\t\t\t$rotCamp = str_replace(\"FW_campos\",\"FW_cab\",$rotCamp);\n\t\t\t\n\t\t\t// index.phtml CRIANDO A PAGINA PRINCIPAL DO CADASTRO\n\t\t\t$arq = $this->LerArq($this->caminho . \"index.phtml\");\n\t\t\tfor($i = 0; $i < count($arq); $i++) {\n\t\t\t\t$arq[$i] = str_replace(\"$\".\"FW_cab = array();\", $rotCamp, $arq[$i]);\t\n\t\t\t\t$arq[$i] = str_replace(\"FW_tabela = 'clientes';\", \"FW_tabela = '\". $nome_da_tabela.\"';\", $arq[$i]);\n\t\t\t}\n\t\t\t$path = FW_PATH_SERV . FW_RAIZ . \"app/packages/\" . $pacote . \"/views/\" ;\n\t\t\t$name = $path . $nome_da_tabela . \"/index.phtml\";\n\t\t\t$this->CriarArq($name,$arq);\n\t\t\n\t\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Is the Product Thumbnail enabled for the Request Email | public function showProductThumbnailRequest()
{
return $this->scopeConfig->getValue(
self::XML_PATH_SHOW_THUMB_NAIL_REQUEST,
\Magento\Store\Model\ScopeInterface::SCOPE_STORE
);
} | [
"public function isShowProductImage()\n {\n return $this->scopeConfig->isSetFlag(\n 'magepow_ajaxcart/success_popup/product_image',\n \\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE\n );\n }",
"function showImageProduct()\n {\n if ($this->getStoreConfig('onestepcheckout/addfield/showimageproduct')) {\n return true;\n }\n\n return false;\n }",
"public function hasThumbnail()\n {\n return $this->isImage();\n }",
"public function isProductImages()\n {\n return (bool)$this->scopeConfig->getValue(\n self::XML_PATH_PRODUCT_IMAGES_INCLUDE,\n ScopeInterface::SCOPE_STORE,\n $this->storeId\n );\n }",
"public function hasThumbnail();",
"public function hasThumbnail()\n {\n return true;\n }",
"public function getHasThumbnail()\n\t{\n\t\treturn $this->has_thumbnail;\n\t}",
"public function supportsThumbnails()\n {\n return in_array($this->getType(),\n sfConfig::get('app_lyMediaManager_create_thumbnails_for', array(\n 'image/jpeg',\n 'image/pjpeg',\n 'image/png',\n 'image/x-png',\n 'image/gif'\n )));\n }",
"public function isAllowedPosting()\r\n {\r\n return Mage::getStoreConfig('productrewiewspicture_options/review_pictures/enable_pictures');\r\n }",
"public function getExpressPicturesRequired()\n {\n return $this->expressPicturesRequired;\n }",
"function supportsThumbnail() {\n \n $thumbnail_extensions = array('jpg', 'jpeg', 'png', 'gif', 'bmp');\n if( ($this->getFileType() == 'image') && in_array($this->getExtension(), $thumbnail_extensions)) {\n \n return true;\n \n }\n \n return false;\n \n }",
"public function showProductThumbnailProposal()\n {\n return $this->scopeConfig->getValue(\n self::XML_PATH_SHOW_THUMB_NAIL_PROPOSAL,\n \\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE\n );\n }",
"public function isShowImage()\n\t{\n\t\treturn $this->_configScopeConfigInterface->getValue('brands/general/show_image');\n\t\t//return $this->getCfg('general/show_image');\n\t}",
"public function getHasImage();",
"public function getHasImage(){\n\t\tforeach ($this->getAttributes() as $attribute){\n\t\t\tif ($attribute->getType() == 'image'){\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}",
"public function hasThumbnail()\n {\n return ! is_null($this->thumbnail);\n }",
"public function hasThumbnail()\n {\n return (bool) $this->album['thumb'];\n }",
"public function shouldMemberSeeProtectedPhoto()\n {\n switch ($this->attributes['status']) {\n case 'active':\n case 'payment-warning':\n case 'honorary':\n return true;\n default:\n return false;\n }\n }",
"public function isAttachedToProduct()\n {\n return $this->attach === self::ATTACH_TO_PRODUCT;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the all of the dates of this gradeable | public function setDates(array $dates, bool $grade_inquiry_modified = false) {
// Wrangle the input so we have a fully populated array of \DateTime's (or nulls)
$dates = $this->parseDates($dates);
// Asserts that this date information is valid
$this->assertDates($dates);
// Coerce any dates that have database constraints, but
// aren't relevant to the current gradeable configuration
$dates = $this->coerceDates($dates, $grade_inquiry_modified);
// Manually set each property (instead of iterating over self::date_properties) so the user
// can't set dates irrelevant to the gradeable settings
$this->ta_view_start_date = $dates['ta_view_start_date'];
$this->grade_start_date = $dates['grade_start_date'];
$this->grade_due_date = $dates['grade_due_date'];
$this->grade_released_date = $dates['grade_released_date'];
if ($this->type === GradeableType::ELECTRONIC_FILE) {
// Set team lock date even if not team assignment because it is NOT NULL in the db
$this->team_lock_date = $dates['team_lock_date'];
$this->submission_open_date = $dates['submission_open_date'];
$this->submission_due_date = $dates['submission_due_date'];
$this->late_days = $dates['late_days'];
$this->grade_inquiry_start_date = $dates['grade_inquiry_start_date'];
$this->grade_inquiry_due_date = $dates['grade_inquiry_due_date'];
}
$this->modified = true;
} | [
"protected function setDates()\n {\n parent::setDates();\n // modify endDate to selected month range after the graph is already built\n $this->endDate = clone $this->requestedDate;\n $this->endDate\n ->modify(\"first day of this month\")\n ->modify(\"+\" . $this->blockVars['pcbeventsrange'] . \" months\");\n }",
"public function setDates($dates)\n {\n }",
"public function onDatesSet(): void\n {\n }",
"protected function setDueDates() {\n }",
"private function setDates()\n\t{\n\t\t// process\n\t\tBackendAnalyticsHelper::setDates();\n\n\t\t// get timestamps from session and set\n\t\t$this->startTimestamp = SpoonSession::get('analytics_start_timestamp');\n\t\t$this->endTimestamp = SpoonSession::get('analytics_end_timestamp');\n\t}",
"private function set_date()\r\n\t{\r\n\t\tif ($this->month > 12)\r\n\t\t{\r\n\t\t\t$this->month=1;\r\n\t\t\t$this->year++;\r\n\t\t}\r\n\r\n\t\tif ($this->month < 1)\r\n\t\t{\r\n\t\t\t$this->month=12;\r\n\t\t\t$this->year--;\r\n\t\t}\r\n\r\n\t\tif ($this->year > 2037) $this->year = 2037;\r\n\t\tif ($this->year < 1971) $this->year = 1971;\r\n\t}",
"protected function setDates()\n\t{\n\t\t$this->today = date(\"Y-m-d\", strtotime(\"today\"));\n $this->thisWeek = date(\"W\", strtotime(\"this week\"));\n $this->nextTwoWeeks = date(\"U\", strtotime(\"+2 weeks 11:59pm\"));\n\t}",
"function setDate($date)\r\n {\r\n $this->_date = $date;\r\n }",
"public function setDate($date)\n {\n }",
"protected function setSalesDate()\n {\n $this->salesDate = date(\n 'Y-m-d', \n mktime(\n 0, \n 0, \n 0, \n $this->month,\n $this->day, \n $this->year\n )\n );\n }",
"public function setDate(){\r\n\t\t$this->rules['date'] = true;\r\n\t\treturn $this;\r\n\t}",
"public function addAllDateFields()\n {\n $this->addAllFieldsByType(DBDate::class);\n }",
"public function setDates($dates)\n {\n $this->dates = $dates;\n return $this;\n }",
"protected function setSortedDates() {\n $dates = $this->getValue('date');\n if (!is_array($dates)) {\n //$dates should always be an array, so this should always be FALSE, but check just in case\n if ($dates)\n $dates = array($dates);\n else\n $dates = array();\n }\n // Do some basic text cleanup first. These versions of the date strings will \n // also be our fallback, if we cannot parse any dates.\n $strdates = array();\n foreach ($dates as $d) {\n ##$d = preg_replace('#[\\[\\(<\\n].*$#', '', $d));\n // Compress all whitespace to single spaces only\n $d = trim(preg_replace('#[\\n\\s]+#', ' ', $d), \". \\t\\n\\r\\0\\x0B\");\n // There may be multiple dates, if so, split them out\n if (preg_match_all('#(?:Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\\S*(?: \\w+)? (?:[0-9]+,? )+(?:and )?[1-2][0-9]{3}#i', $d, $matches)) {\n $ds = array_map(array($this, 'cleanDateString'), $matches[0]);\n } else if (preg_match_all('#[0-9]+ (?:Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\\S*,? [1-2][0-9]{3}#i', $d, $matches)) {\n $ds = array_map(array($this, 'cleanDateString'), $matches[0]);\n } else if (preg_match_all('#[0-9]{1,2}[/-][0-9]{1,2}[/-][0-9]{1,4]#', $d, $matches)) {\n $ds = array_map(array($this, 'cleanDateString'), $matches[0]);\n } else {\n $ds = array($this->cleanDateString($d));\n }\n $strdates = array_merge($strdates, $ds);;\n }\n\n // Fancy new PHP DateTime object is broken, doesn't do comparisons and doesn't work\n // with partial dates (i.e. Year and Month but no Day), so we build our own \n // assoc array of date_parse arrays with YYYYMMDD as key that we can sort.\n $dates = array();\n foreach ($strdates as $d) {\n if ($a = date_parse($d)) {\n // Year only and Year+Month only, the Year is misidentified as the time\n if ($a['hour'] and !$a['year'])\n $a['year'] = $a['hour'] * 100 + $a['minute'];\n // Require that things be sane, for instance \"April 15, 16, 1908\" makes year=2016\n if ($a['year'] < date(\"Y\")) {\n // Format date string\n if (!$a['year'])\n $dates[] = $d; // Got nothing, just use string we started with\n else {\n $d = array('year' => $a['year'], 'month' => $a['month'], 'day' => $a['day']);\n if ($d['month'] and $d['day'])\n $dates[sprintf(\"%d%02d%02d\", $d['year'], $d['month'], $d['day'])] = $d;\n else if ($d['month'])\n $dates[sprintf(\"%d%02d00\", $d['year'], $d['month'])] = $d;\n else\n $dates[sprintf(\"%d0000\", $d['year'])] = $d;\n }\n } else {\n $dates[] = $d; // Got nothing, just use string we started with\n }\n } else {\n $dates[] = $d; // Got nothing, just use string we started with\n }\n }\n // Sort by key YYYYMMDD in reverse order so newest date is first\n krsort($dates);\n\n $this->dates = array_values($dates);\n }",
"function setDate( $value )\r\n {\r\n $this->Date = $value;\r\n }",
"public function setStartDate($date = '1/1/1900');",
"public function onDatesUnSet(): void\n {\n }",
"public function setEnabledDates($dates)\n {\n if (!is_array($dates)) {\n $dates = (array) $dates;\n }\n\n $this->option_enabled_dates = $dates;\n $this->set_options['enablede_dates'] = 'enabledDates';\n\n return $this;\n }",
"public function setDateFields()\n {\n if(isset($this->columnList['DateAdded'])) {\n if(!empty($this->DateAdded)) {\n $this->DateAdded = $this->DateAdded;\n } else {\n\n /**\n * @todo swap this out into the connection to let the connected server determine timezone settings\n **/\n $Date = new \\DateTime(\"now\",new \\DateTimeZone(self::DB_TIMEZONE));\n $this->DateAdded = $Date->format(self::SHORTDATE);\n }\n }\n if(isset($this->columnList['DateTimeAdded'])) {\n if(!empty($this->DateTimeAdded)) {\n $this->DateTimeAdded = $this->DateTimeAdded;\n } else {\n $Date = new \\DateTime(\"now\",new \\DateTimeZone(self::DB_TIMEZONE));\n $this->DateTimeAdded = $Date->format(self::ISO_DATETIME);\n }\n }\n\n $this->updateLastUpdated();\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get instance of Conversation for a given JID | static function get( XMPPJID $fromJID, XMPPJID $toJID, StorageHandler $storageHandler )
{
$instance = $storageHandler->get( Conversation::getKeyName( $fromJID, $toJID ) );
if ( false === ( $instance instanceof Conversation ) )
{
$instance = new Conversation( $fromJID, $toJID, $storageHandler );
}
return $instance;
} | [
"public function byId($id)\n {\n return Conversation::find($id);\n }",
"public function findConversation($id);",
"public function getConversation()\n {\n return $this->get(self::CONVERSATION);\n }",
"public function getConversation()\n {\n return $this->conversation;\n }",
"public static function get_by_id($conversation_id, $user_id = null) {\n global $dbh, $CURRENT_USER;\n \n if ($user_id === null && $CURRENT_USER) {\n $user_id = $CURRENT_USER->id;\n }\n \n $query = \"\n SELECT 1 FROM `conversations` AS c\n JOIN `conversation_members` AS m\n ON m.`conversation_id` = c.`conversation_id`\n WHERE c.`conversation_id` = :conversation_id\n AND m.`user_id` = :user_id\";\n $sth = $dbh->prepare($query);\n $sth->bindValue('conversation_id', $conversation_id);\n $sth->bindValue('user_id', $user_id);\n $sth->execute();\n if ($sth->fetchColumn()) {\n return new Conversation($conversation_id);\n }\n return null;\n }",
"public function getIdConversation()\n {\n return $this->id_conversation;\n }",
"public function current_conversation() {\n\t\t$current_event = CafeEvent::current($this->dbh);\n\t\t$round = $current_event->current_round();\n\t\t$sth = $this->dbh->prepare('select UserConversation.ConversationID from UserConversation inner join Conversation on Conversation.ConversationID = UserConversation.ConversationID where UserConversation.UserID = ? and Conversation.RoundID = ?');\n\t\t$sth->execute([$this->id, $round->id]);\n\t\t$row = $sth->fetch();\n\t\tif($row)\n\t\t\treturn new CafeConversation($this->dbh, $row['ConversationID']);\n\n\t\treturn NULL;\n\t}",
"protected function _findConv($conversation_id) {\n\t\t$mongo = Registry::get(\"MongoDB\");\n\t\t$conv = $mongo->conversation;\n\t\t$record = $conv->findOne(array('_id' => $conversation_id));\n\t\tif (!isset($record)) {\n\t\t\tself::redirect(\"/404\");\n\t\t} else {\n\t\t\t$data = array(\n\t\t\t\t'id' => $record['_id']->{'$id'},\n\t\t\t\t'title' => $record['title'],\n\t\t\t\t'identifier' => $record['identifier'],\n\t\t\t\t'user_id' => $record['user_id'],\n\t\t\t\t'created' => date('Y-m-d H:i:s', $record['created']->sec)\n\t\t\t);\n\t\t\t$record = $data;\n\t\t}\n\t\treturn $record;\n\t}",
"private function conversationByID($id) {\n $row = $this->conversationModel->getID($id, DATASET_TYPE_ARRAY);\n if (!$row) {\n throw new NotFoundException('Conversation');\n }\n\n return $row;\n }",
"public function getConversationId()\n {\n return $this->conversationId;\n }",
"public function get($id)\n {\n try {\n $conversation = $this->conversation\n ->where('id', $id)\n ->with([\n 'messages' => function ($query) {\n $query->orderBy('created_at', 'DESC');\n },\n 'messages.sender'])\n ->with(['userOne', 'userTwo', 'latestMessage.sender'])\n ->firstOrFail();\n return $conversation;\n } catch (ModelNotFoundException $e) {\n return false;\n }\n }",
"public function getConversationId()\n {\n return $this->get(self::CONVERSATION_ID);\n }",
"public function getConversation($name = '') {\n /**\n * If Conversation name is empty or not defined return False\n */\n if (empty($name)) {\n return false;\n }\n /**\n * Conversation in cache TRUE or FALSE\n */\n $cCache = false;\n $cache = $this->modx->getCacheManager();\n // Create a key by conversation name\n if (!$keyConversation = $this->conversationHash($name)) {\n return false;\n }\n // If there is a cache, set the flag to TRUE ConversationCache, otherwise FALSE\n if ($this->mtCache && $cache) {\n if ($theme = $this->modx->cacheManager->get($keyConversation, array(\n xPDO::OPT_CACHE_KEY => 'modxtalks/conversation'))\n ) {\n $cCache = true;\n $conversation = $this->modx->newObject('modxTalksConversation', $theme);\n $conversation->set('id', $theme['id']);\n } else {\n $cCache = false;\n }\n }\n\n // If the flag is in ConversationCache FALSE - get data from database\n if ($cCache === false) {\n // If the key is not section, create a new\n if (!$conversation = $this->modx->getObject('modxTalksConversation', array('conversation' => $name))) {\n $conversation = $this->modx->newObject('modxTalksConversation', array('conversation' => $name));\n $properties = array(\n 'total' => 0,\n 'deleted' => 0,\n 'unconfirmed' => 0,\n );\n $conversation->setProperties($properties, 'comments', false);\n $conversation->setSingleProperty($this->modx->resource->id);\n $conversation->set('rid', $this->modx->resource->id);\n $conversation->save();\n }\n\n // Put to the cache\n if ($this->mtCache && $cache)\n $this->modx->cacheManager->set($keyConversation, $conversation, 0, array(\n xPDO::OPT_CACHE_KEY => 'modxtalks/conversation'\n ));\n }\n\n return $conversation;\n }",
"function get_message_by_id($id) {\n\t\t$this->connect();\n\n\t\t$prepare_stmt = $this->connection->prepare(\"SELECT * FROM message WHERE id = ?\");\n\t\t$prepare_stmt->bind_param('i', $id);\n\t\t$prepare_stmt->execute();\n\n\t\t$result = $prepare_stmt->get_result();\n\t\t\n\t\t$row = $result->fetch_assoc();\n\n\t\trequire_once($_SERVER['DOCUMENT_ROOT'].\"/model/message_model.php\");\n\t\t$msg_model = new MessageModel($row['text'], $row['date'], $row['time_to_live'], $row['id']);\n\t\t$prepare_stmt->close();\n\t\treturn $msg_model;\n\t\t\n\t}",
"public function getMessageById($id)\n {\n foreach ($this->messages as $message) {\n if ($id == $message->getId()) {\n return $message;\n }\n }\n\n }",
"static function getInstanceByID($inMessageID) {\n\t\treturn self::getInstance()->getMessageByID($inMessageID);\n\t}",
"public function getConversationID(): string\n {\n return $this->conversation_id;\n }",
"public static function find($id)\n {\n return Channel::find($id);\n }",
"public function getChat()\n {\n return $this->hasOne(Chat::class, ['id' => 'chat_id'])\n ->private()\n ->viaTable(ChatMember::tableName(), ['user_id' => 'id']);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Copie des fichiers de configuration | protected function copyConfigFiles()
{
$aFiles = $this->getConfigFiles();
foreach ($aFiles as $aFile)
{
$this->checklist->addItem(
'config_file_'.$aFile['basename'],
copy(
$this->root().'/_install/'.$aFile['filename'],
OKT_CONFIG_PATH.'/'.$aFile['filename']
),
'Copy config file '.$aFile['filename'],
'Cannot copy config file '.$aFile['filename']
);
}
} | [
"private function copyConfigFile()\n {\n $path = $this->getConfigPath();\n\n // if generatords config already exist\n if ($this->files->exists($path) && $this->option('force') === false) {\n $this->error(\"{$path} already exists! Run 'generate:publish-stubs --force' to override the config file.\");\n die;\n }\n\n File::copy(__DIR__ . '/../config/config.php', $path);\n }",
"private function copyConfig()\n {\n // copy config\n $this->filesystem->copy($this->basePath . \"config/config.php\", config_path('titan.php'));\n $this->line(\"Config Copied: \" . config_path('titan.php'));\n }",
"protected function setConfigsPathAndFiles() \r\n {\r\n $config_dir = (isset($this->configs[\"configs\"][\"configDir\"])) ? $this->configs[\"configs\"][\"configDir\"] : \"\";\r\n $this->defineTheConfigDirectory($config_dir);\r\n $config_file = (isset($this->configs[\"configs\"][\"configFile\"])) ? $this->configs[\"configs\"][\"configFile\"] : \"\";\r\n $this->defineTheConfigFile($config_file);\r\n \r\n }",
"public function compileConfigFiles(): void\n {\n if (null !== $this->files)\n {\n $this->msg('Files', self::MSG_HEAD);\n\n foreach ($this->files as $arrFile)\n {\n $filename = StringUtil::standardize($arrFile['name']);\n $content = $this->getFileContent($arrFile['path']);\n\n $this->msg('Compile file: ' . $arrFile['path']);\n\n // Add default import path\n $this->importPaths[] = $this->rootDir . '/' . \\dirname($arrFile['path']);\n\n // Compile content and save file\n $this->saveFile($this->compile($content)->getCss(), $filename);\n }\n }\n }",
"public function appendConfigurationFiles(): array;",
"private function updateConfig()\n {\n $stub = $this->stub.'/config';\n $path = config_path();\n (new Filesystem)->copyDirectory($stub, $path);\n }",
"abstract public function getConfigFiles(array $config);",
"public function copy_config()\n\t{\n\t\t$source_path = $this->install_path().'../config/'.$this->module.'.php';\n\t\t$dest_path = APPPATH.'config/'.$this->module.'.php';\n\n\t\tif (file_exists($source_path) AND !file_exists($dest_path))\n\t\t{\n\t\t\t$results = copy($source_path, $dest_path);\n\n\t\t\tif (!$results)\n\t\t\t{\n\t\t\t\t$this->_add_error(lang('error_could_not_create_file', $dest_path));\n\t\t\t}\n\t\t}\n\t}",
"private function loadConfigurationFromFiles()\n {\n $configDirPath = getcwd().DIRECTORY_SEPARATOR.'config';\n\n foreach (scandir($configDirPath) as $directoryItem) {\n $directoryItemFullPath = $configDirPath.DIRECTORY_SEPARATOR.$directoryItem;\n\n if (is_file($directoryItemFullPath) && pathinfo($directoryItem, PATHINFO_EXTENSION) === 'php') {\n $fileName = pathinfo($directoryItem, PATHINFO_FILENAME);\n\n $this->configurations[$fileName] = require $directoryItemFullPath;\n }\n }\n }",
"protected function addMiscFilesToFileStorage(): void\n {\n // src/Resources/config/*.yml yaml config files\n $arrFiles = ['listener.tpl.yml', 'parameters.tpl.yml', 'services.tpl.yml'];\n\n if ($this->model->addCustomRoute) {\n $arrFiles[] = 'routes.tpl.yml';\n }\n\n foreach ($arrFiles as $file) {\n $source = sprintf('%s/src/Resources/config/%s', $this->skeletonPath, $file);\n $target = sprintf('%s/vendor/%s/%s/src/Resources/config/%s', $this->projectDir, $this->model->vendorname, $this->model->repositoryname, str_replace('tpl.', '', $file));\n $this->fileStorage->addFile($source, $target)->replaceTags($this->tagStorage);\n\n // Validate config files\n try {\n $arrYaml = Yaml::parse($this->fileStorage->getContent());\n\n if ('listener.tpl.yml' === $file || 'services.tpl.yml' === $file) {\n if (!\\array_key_exists('services', $arrYaml)) {\n throw new ParseException('Key \"services\" not found. Please check the indents.');\n }\n }\n\n if ('parameters.tpl.yml' === $file) {\n if (!\\array_key_exists('parameters', $arrYaml)) {\n throw new ParseException('Key \"parameters\" not found. Please check the indents.');\n }\n }\n } catch (ParseException $exception) {\n throw new ParseException(sprintf('Unable to parse the YAML string in %s: %s', $target, $exception->getMessage()));\n }\n }\n\n // src/Resource/contao/config/config.php\n $source = sprintf('%s/src/Resources/contao/config/config.tpl.php', $this->skeletonPath);\n $target = sprintf('%s/vendor/%s/%s/src/Resources/contao/config/config.php', $this->projectDir, $this->model->vendorname, $this->model->repositoryname);\n $this->fileStorage->addFile($source, $target);\n\n // Add logo\n $source = sprintf('%s/src/Resources/public/logo.png', $this->skeletonPath);\n $target = sprintf('%s/vendor/%s/%s/src/Resources/public/logo.png', $this->projectDir, $this->model->vendorname, $this->model->repositoryname);\n $this->fileStorage->addFile($source, $target);\n\n // Readme.md\n $source = sprintf('%s/README.tpl.md', $this->skeletonPath);\n $target = sprintf('%s/vendor/%s/%s/README.md', $this->projectDir, $this->model->vendorname, $this->model->repositoryname);\n $this->fileStorage->addFile($source, $target);\n\n // .gitattributes\n $source = sprintf('%s/.gitattributes.tpl.txt', $this->skeletonPath);\n $target = sprintf('%s/vendor/%s/%s/.gitattributes', $this->projectDir, $this->model->vendorname, $this->model->repositoryname);\n $this->fileStorage->addFile($source, $target);\n }",
"function do_makeconfig()\n {\n ob_start(); @include SCRIBE_PATH . '/include/misc.defaultconfig.php';\n $contents = ob_get_clean();\n $output_fname = getcwd() . DS . 'sourcescribe.conf';\n if (is_file($output_fname))\n { return ScStatus::error(\"A configuration file already exists!\"); }\n \n file_put_contents($output_fname, $contents);\n }",
"private function delete_config_files() {\n\t\t$this->delete( $this->config_path );\n\t}",
"public function loadConfig()\n {\n \t$files = [];\n $configPath = $this->app->configPath();\n $itr = new RecursiveIteratorIterator(new RecursiveDirectoryIterator(\n $configPath, RecursiveDirectoryIterator::SKIP_DOTS\n ));\n\n foreach($itr as $file) {\n if (pathinfo($file, PATHINFO_EXTENSION) == \"php\" && $file->getFileName() != 'app.php') {\n $fileRealPath = $file->getRealPath();\n $directory = $this->getDirectory($file, $configPath);\n $this->app->config->set($directory.basename($fileRealPath, '.php'), include $fileRealPath);\n }\n }\n }",
"protected function configurePaths()\n {\n $yaml = str_replace(\n '- map: ~/Projects', '- map: \"'.str_replace('\\\\', '/', $this->basePathMachine).'\"', $this->getGestaoFile()\n );\n\n $yaml = str_replace(\n 'to: /home/projects/code', 'to: \"/home/vagrant/'.$this->basePathMachine.'\"', $yaml\n );\n\n file_put_contents($this->basePathMachine.'/Gestao.yaml', $yaml);\n }",
"protected function loadConfigurations()\n {\n\n $files = feather_dir_files(static::$configPath);\n\n foreach ($files as $file) {\n\n if (is_file(static::$configPath . \"/$file\") && stripos($file, '.php') === strlen($file) - 4) {\n $filename = substr($file, 0, strripos($file, '.php'));\n static::$config[strtolower($filename)] = include static::$configPath . '/' . $file;\n }\n }\n }",
"private function configFile(): void {\n // Check file exists //\n if (File::exists(config_path($this->ref_name))) {\n // Delete file //\n if (File::delete(config_path($this->ref_name))) {\n $this->comment(\"Config: {$this->ref_name} removed\");\n } else {\n $this->warn(\"Could not remove {$this->ref_name} config\");\n }\n }\n }",
"private function loadConfigurationFiles()\n {\n $finder = new Finder();\n\n $iterator = $finder\n ->files()\n ->name('*.yml')\n ->in(CONFIG_DIR);\n\n $config = array();\n\n foreach ($iterator as $file) {\n $content = file_get_contents($file->getRealPath());\n\n if (!empty($content)) {\n $array = Yaml::parse($content);\n $config[$file->getBasename('.'.$file->getExtension())] = $array;\n }\n }\n\n $this['config'] = $config;\n }",
"protected function afterInstall()\n {\n $configSourceFile = __DIR__ . DIRECTORY_SEPARATOR . 'config.example.php';\n $configTargetFile = \\Craft::$app->getConfig()->configDir . DIRECTORY_SEPARATOR . $this->handle . '.php';\n\n if (!file_exists($configTargetFile)) {\n copy($configSourceFile, $configTargetFile);\n }\n }",
"protected function setConfigsToRepair()\n {\n // Look for custom configs to update, for example:\n // custom/modules/Connectors/connectors/sources/ext/rest/twitter/config.php\n $this->configsToRepair = glob('custom/modules/Connectors/connectors/sources/ext/*/*/config.php');\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sends a seller a notice that one of his items on auction has been sold | function noticeItemSold($bid) {
// subject of email
$subject = AUCTION_NOTICE_ITEM_SOLD . ' "[notice_item_name]"';
// email message body
$message = "<p>" . AUCTION_GREETING . " [notice_fullname]</p><p>" .
AUCTION_NOTICE_ITEM_SOLD . " \"<a href=\"" . COMPANY_URL . "items.php?itemID={$bid->itemID}\">[notice_item_name]</a>\".</p>";
return $this->noticePrivateMailer($bid, $subject, $message);
} | [
"public function sellItem($seller){\r\n\t}",
"public function soldNotif($accountID, $listingName, $listingID, $buyerUsername)\n \t\t{\n \t\t\t$username = self::getUsername($accountID);\n\n \t\t\t$subject = \"Listing: $listingID has been sold\";\n\t\t\t$message = \"Hello $username,\\n\" .\n\t\t\t\t\t \"$buyerUsername has purchased $listingName.\";\n\n\t\t\tself::addNotification($subject, $message, $accountID);\n \t\t}",
"public function sellItem()\n {\n }",
"public function notifySeller($auction, $options = array()){\n\t\t$seller = $this->Auction->Seller->find('first', array('conditions' => array('Seller.id' => $auction['Auction']['seller_id'])));\n\t\t$this->__sendMail($seller['Seller']['email'], 'Webpages.Auctioneer Expired Auction', $auction);\n\t}",
"public function buy()\r\n\t {\r\n\t $this->notifyObserver('purchased');\r\n\t }",
"public static function notifySellerSubmitQuote()\n {\n }",
"public function republishNotSoldItems() {\n $myNotSoldItems = $this->doGetMyNotSoldItems();\n\n $responses = array();\n\n if ($myNotSoldItems['notSoldItemsList']) {\n foreach ($myNotSoldItems['notSoldItemsList'] as $item) {\n $startDate = new DateTime();\n $endDate = new DateTime();\n\n $startDate->setTimestamp((int)$item['itemStartTime']);\n $endDate->setTimestamp((int)$item['itemEndTime']);\n\n $auctionDuration = $endDate->diff($startDate);\n\n $response = $this->doSellSomeAgain(array(\n 'itemId' => $item['itemId'],\n 'duration' => $auctionDuration->days,\n 'sellStartingTime' => 0,\n 'sellOption' => 1\n ));\n\n array_push($responses, $response);\n }\n\n return $responses;\n }\n else {\n return 'List of not sold items is empty right now. Skipping.';\n }\n }",
"public function afterBuy()\n {\n\n }",
"protected function cmd_shop_sell ($args, $player) {\r\n $orig_args = $args;\r\n $cmd_word = 'shop sell';\r\n $response = array();\r\n\r\n // Show the list of items you own and their worth if sold.\r\n if (empty($args) || empty($args[0])) {\r\n $response[] = 'To sell an item, type: `shop sell [ITEM NAME]` (example: `shop sell Iron Ore`)';\r\n $response[] = '';\r\n $response[] = '*Items for sale*:';\r\n $response[] = $this->show_guild_inventory($player, false, true);\r\n $this->respond($response);\r\n return FALSE;\r\n }\r\n\r\n // Check the last argument for the confirmation code.\r\n $confirmation = false;\r\n if (!empty($args) && strpos($args[count($args)-1], 'CONFIRM') === 0) {\r\n $confirmation = array_pop($args);\r\n }\r\n\r\n // Get the item name.\r\n $item_name = implode(' ', $args);\r\n $item = Item::load(array('gid' => $player->gid, 'name' => $item_name), true);\r\n if (empty($item)) {\r\n $response[] = 'You do not own an item named \"'.$item_name.'\".';\r\n $response[] = $this->get_typed($cmd_word, $orig_args);\r\n $this->respond($response);\r\n return FALSE;\r\n }\r\n\r\n // Check if the item has a value.\r\n $value = $item->get_sell_value();\r\n if ($value <= 0) {\r\n $this->respond($item->get_display_name().\" has no sell value and thus cannot be sold.\");\r\n return FALSE;\r\n }\r\n\r\n // Check for a valid confirmation code.\r\n if (!empty($confirmation) && $confirmation != 'CONFIRM') {\r\n $response[] = 'The confirmation code \"'.$confirmation.'\" is invalid. The code should be: `CONFIRM`.';\r\n $response[] = '';\r\n // Re-display the confirmation text.\r\n $confirmation = false;\r\n }\r\n\r\n // Display the confirmation message and code.\r\n if (empty($confirmation)) {\r\n $response[] = \"Are you sure you want to _sell_ your \".$item->get_display_name().\"?\";\r\n $response[] = '';\r\n $response[] = $this->show_item_information($item, false, true);\r\n $response[] = '';\r\n $response[] = $this->get_confirm($cmd_word, $orig_args);\r\n $this->respond($response);\r\n return FALSE;\r\n }\r\n\r\n // Sell the item.\r\n $player->gold += $value;\r\n $success = $player->save();\r\n if ($success === false) {\r\n $this->respond('There was a problem saving your Guild information after selling your item. Please talk to Paul.');\r\n return FALSE;\r\n }\r\n\r\n // Receive the item.\r\n $success = $player->remove_item($item);\r\n if ($success === false) {\r\n $this->respond('There was a problem removing the item you sold. Please talk to Paul.');\r\n return FALSE;\r\n }\r\n \r\n $this->respond(\"You sold your \".$item->get_display_name().\" for \".Display::get_currency($value).\".\");\r\n }",
"function cmdeals_low_stock_notification( $deal ) {\n\t$_deals = new cmdeals_deals($deal);\n\n\t$subject = '[' . get_bloginfo('name') . '] ' . __('Deal low in stock', 'cmdeals');\n\t\n\t$message = cmdeals_mail_template( \n\t\t__('Deal low in stock', 'cmdeals'),\n\t\t'#' . $_deals->id .' '. $_deals->get_title() .' ' . __('is low in stock.', 'cmdeals') .\n '[<a href=\"'.get_edit_post_link( $_deals->id ).'\" target=\"_blank\">'.__('Edit here', 'cmdeals').'</a>]'\n\t);\n\n\t// Send the mail\n\tcmdeals_mail( get_option('cmdeals_stock_email_recipient'), $subject, $message );\n}",
"public function afterSell()\n {\n\n }",
"public static function sell_item($itemId) {\n\n // 1. Validate the input\n $itemId = floor(htmlentities($itemId));\n if(!is_numeric($itemId) ||\n !is_numeric(Request::post('quantity')) ||\n Request::post('quantity') < 0 ||\n $itemId < 1 ||\n $itemId > 6)\n { Redirect::to('game/'); die(); }\n\n // 2. Check what goods the user wants to sell and get their local prices\n switch($itemId) {\n case 1:\n $item_id = 'product_1';\n $item_price = Session::get('price_product_1');\n break;\n case 2:\n $item_id = 'product_2';\n $item_price = Session::get('price_product_2');\n break;\n case 3:\n $item_id = 'product_3';\n $item_price = Session::get('price_product_3');\n break;\n case 4:\n $item_id = 'product_4';\n $item_price = Session::get('price_product_4');\n break;\n case 5:\n $item_id = 'product_5';\n $item_price = Session::get('price_product_5');\n break;\n case 6:\n $item_id = 'product_6';\n $item_price = Session::get('price_product_6');\n break;\n }\n\n // 3. Check if the user actually has enough merchandise for sale\n if(Session::get('coat_'.strtolower($item_id)) < Request::post('quantity')) {\n Session::add('feedback_negative', 'YOU DON\\'T HAVE THAT MANY, DUDE !');\n Redirect::to('game/');\n return false;\n }\n\n // 4. Remove goods from the coat\n Session::set('coat_'.strtolower($item_id), Session::get('coat_'.strtolower($item_id)) - Request::post('quantity'));\n\n // 5. Add space to the coat\n Session::set('hold', Session::get('hold') + Request::post('quantity'));\n\n // 6. Give the cash from the sale to the user\n Session::set('cash', Session::get('cash') + Request::post('quantity') * $item_price);\n }",
"public static function notifyPrivateSellerEdit()\n {\n }",
"public function testUpdateItemBuyer()\n {\n }",
"function render_give_item($username, $target, $item){\n\t$article = get_indefinite_article($item);\n addItem($target,$item,1);\n $give_msg = \"You have been given $article $item by $username.\";\n sendMessage($username,$target,$give_msg);\n return \"$target will receive your $item.<br>\\n\";\n}",
"public function buyAuction($auction_id){\n $auction = Auction::find($auction_id);\n $auction->status = \"sold\";\n $auction->save();\n return view('auctions.thankYou', [ 'auction' => Auction::find($auction_id) ]);\n }",
"public function giveUserItem(int $userId, int $shopItemId);",
"public function sellRequest()\n {\n $this->emit('sellRequest', auth()->id(), $this->resourceId);\n }",
"private function EmailUser(){\n //notifying them of the sale completion.\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the URL class instance. | public function getUrlInstance()
{
return $this->url;
} | [
"public function getExactUrlClass() {\n return $this->exact_url_class;\n }",
"public function getUrlInstance() {\n\t\t$this->UrlInstance();\n\t\treturn $this->thumbor_url;\n\t}",
"protected function getClassUrl() {\n try {\n $url = $this->getUrl('api.class');\n } catch (RouterException $e) {\n $url = null;\n }\n\n return $url;\n }",
"public function createUrl() {\r\n $className = 'PSeo_Sitemap_Url_' . $this->_className;\r\n $url = new $className;\r\n return $url;\r\n }",
"function ju_url_o() {return ju_o(IUrl::class);}",
"public static function getCurrentURLInstance() {\n return new URLHelper (URLHelper::$testURL == null ? $_SERVER ['REQUEST_URI'] : URLHelper::$testURL);\n }",
"public function getInstanceUrl();",
"protected function _getUrlModelClass()\n {\n return 'factfinder/url';\n }",
"public function getUrl() {\n return Url::fromUri($this->uri, (array) $this->options);\n }",
"public static function getForRequest() {\n \t\tif( empty( self::$_request_url ) ) {\n \t\t\t$url = $_SERVER['REQUEST_URI'];\n \t\t\tif( empty( $url ) )\n \t\t\t\t$url = $_SERVER['PHP_SELF'];\n \t\t\t\t\n \t\t\tself::$_request_url = new self( $url );\n \t\t\tself::$_request_url->defineConstants();\n \t\t}\n \t\t\n \t\treturn self::$_request_url;\n \t}",
"public static function get_url_factory() : url_factory {\n return new url_factory(\n self::get_legacy_data_mapper_factory()\n );\n }",
"function get_url() {\r\n\t\tforeach (bjoerne_get_url_resolvers() as $resolver) {\r\n\t\t\t$result = $resolver->get_url($this);\r\n\t\t\tif (null != $result) {\r\n\t\t\t\treturn $result;\r\n\t\t\t}\r\n\t\t}\r\n\t\t$resolver = bjoerne_get_default_url_resolver();\r\n\t\treturn $resolver->get_url($this);\r\n\t}",
"protected abstract function classUri($class);",
"protected static function getClassDirUrlEx()\n {\n return self::doGetClassDirUrl(\\get_called_class());\n }",
"private function uriFor(XPClass $class) {\n try {\n $Urimethod= $class->getClassLoader()->getClass()->getMethod('classURI');\n $Urimethod->setAccessible(TRUE);\n return $Urimethod->invoke($class->getClassLoader(), $class->getName());\n } catch (Exception $ignored) {\n return $class->getClassName();\n }\n }",
"public function _getUrlHelper()\n {\n if(!$this->_urlHelper) {\n $this->_urlHelper = new Zend_View_Helper_Url();\n }\n \n return $this->_urlHelper;\n }",
"public function getInstanceUrl()\n {\n return $this->instanceUrl;\n }",
"public static function getCurrent(): URL {\n if (self::$currUrl === null) {\n $url = new static(static::getCurrentURL());\n\n self::$currUrl = $url;\n }\n return clone self::$currUrl;\n }",
"public function getUrlManager()\n {\n return $this->get('urlManager');\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
setStatusId Forceably set the ticket status ID to the received status ID. No checks are made. Use ::setStatus() to change the ticket status XXX: Use ::setStatus to change the status. This can be used as a fallback if the logic in ::setStatus fails. | function setStatusId($id) {
$this->status_id = $id;
return $this->save();
} | [
"public function setStatusId($statusId)\n\t{\n\t\t$this->statusId = $statusId;\n\t}",
"public function setStatusId($v)\n {\n if ($v !== null) {\n $v = (int) $v;\n }\n\n if ($this->status_id !== $v) {\n $this->status_id = $v;\n $this->modifiedColumns[] = MumTableMap::STATUS_ID;\n }\n\n if ($this->aStatus !== null && $this->aStatus->getId() !== $v) {\n $this->aStatus = null;\n }\n\n\n return $this;\n }",
"public function set_ticket_status() {\n \n // Changes the ticket's status\n (new MidrubBaseAdminCollectionSupportHelpers\\Tickets)->set_ticket_status();\n \n }",
"public function setStatus(TicketStatus $status)\n {\n $this->status = $status;\n }",
"function set_status() {\n\t\tif ( ($employee = $this->EE->axapta->employee()) && ($this->conn = $this->EE->axapta->axapta_connection()) ) {\n\t\t\tif( is_numeric($id = $this->EE->input->GET('id')) ) {\n\t\t\t\t$status = $this->EE->input->GET('status');\n\n\t\t\t\t$data = array('status' \t=> $status);\n\n\t\t\t\t$this->EE->db->where('id', $id);\n\t\t\t\t$this->EE->db->update('wr_reports', $data);\n\t\t\t} else {\n\t\t\t\tshow_error('Invalid ID given.');\n\t\t\t}\n\t\t}\n\t}",
"function set_ticket_status($ticket_id, $comment_id){\n\n\t\tglobal $wptickets;\n\n\t\t$config = get_option('support_system_config');\t// load config\n\t\t$comment = get_comment($comment_id);\t\t\t// load comment details\n\n\t\t// on internal note dont mark as responded\n\t\tif( !in_array( get_comment_meta( $comment_id, '_comment_access',true), array('public', 'private') ) ){\n\t\t\treturn;\n\t\t}\n\n\t\tif($comment->user_id == 0){\n\t\t\t\n\t\t\t// public author\n\t\t\twp_set_object_terms( $ticket_id, $config['ticket_reply_status'], 'status');\n\n\t\t}else{\n\n\t\t\t$ticket = $wptickets->tickets->get_ticket($ticket_id);\n\t\t\tif( $comment->user_id == intval( get_post_meta( $ticket_id, '_ticket_author', true ) ) ){\n\t\t\t\t\n\t\t\t\t// author\n\t\t\t\twp_set_object_terms( $ticket_id, $config['ticket_reply_status'], 'status');\n\t\t\t\t\n\t\t\t}else{\n\n\t\t\t\t// admin\n\t\t\t\twp_set_object_terms( $ticket_id, $config['ticket_responded_status'], 'status');\n\t\t\t}\n\t\t}\n\t}",
"public function setStatusId($v)\n\t{\n\r\n\t\t// Since the native PHP type for this column is integer,\r\n\t\t// we will cast the input value to an int (if it is not).\r\n\t\tif ($v !== null && !is_int($v) && is_numeric($v)) {\r\n\t\t\t$v = (int) $v;\r\n\t\t}\r\n\n\t\tif ($this->status_id !== $v || $v === 0) {\n\t\t\t$this->status_id = $v;\n\t\t\t$this->modifiedColumns[] = MmPeer::STATUS_ID;\n\t\t}\n\n\t}",
"public function set_contract_status_updates_contract_status_with_passed_status_id()\n {\n $this->assertEquals(\n self::$contract->set_contract_status(self::$contract, $status_id = 2),\n self::$contract->update(['contract_status_id' => $status_id])\n );\n }",
"function updateStatus($id, $statusId)\r\n\t{\n\t\t\r\n\t}",
"public function setStatusByID($invoice_id, $status_id) {\n\t\t$sql = \"UPDATE tickets set status=? WHERE id=?\";\n\t\tif($stmt = parent::get('db')->mysqli()->prepare($sql)){\n\t\t\t$stmt->bind_param('ii', $status_id, $invoice_id);\n\t\t\t$stmt->execute();\n\t\t\t$stmt->store_result();\n\t\t\tif($stmt->affected_rows > 0){\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}",
"public function setStatus($id, $status){\n\t\t$sql = \"update core_projects set status=? where id=?\";\n\t\t$this->runRequest($sql, array($status, $id));\n\t}",
"public function setStatus($id, $status)\n {\n $gift = GiftModel::find($id);\n $gift->status = $status;\n return $gift->save();\n }",
"public function setStatus($status)\n\t{\n\t\tparent::setStatus($status);\n\n\t\tif ($status == OperationIncident::STATUS_SOLVED || $status == OperationIncident::STATUS_CLOSED) {\n\t\t\t// incident has been resolved\n\t\t\t$this->setTimeToResolve(0);\n\t\t}\n\t}",
"public function _setStatus($status)\n {\n $this->status = $status;\n }",
"public function _setStatus($status) {\n\t\t$this->_status = $status;\n\t}",
"public function updateStatus($id,$status)\r\n {\r\n Outlet::model()->updateByPk((int)$id, array('status' => $status));\r\n\r\n }",
"public function setStatus($status)\r\n {\r\n if (!isset($status)) {\r\n DUP_Log::Error(\"Package SetStatus did not receive a proper code.\");\r\n }\r\n $this->Status = $status;\r\n $this->update();\r\n }",
"public static function set_booking_status( $booking_id, $status ) {\n\n global $wpdb;\n\n $booking_data = $wpdb -> get_row( 'SELECT * FROM `' . $wpdb->prefix . 'bookings_calendar` WHERE `id`=' . esc_sql( $booking_id ), 'ARRAY_A' );\n if(!$booking_data){\n return;\n }\n\n $user_id = $booking_data['bookings_author']; \n $owner_id = $booking_data['owner_id'];\n $current_user_id = get_current_user_id();\n\n // get information about users\n $user_info = get_userdata( $user_id );\n \n $owner_info = get_userdata( $owner_id );\n $comment = json_decode($booking_data['comment']);\n\n // only one time clicking blocking\n if ( $booking_data['status'] == $status ) return;\n \n\n switch ( $status ) \n {\n\n // this is status when listing waiting for approval by owner\n case 'waiting' :\n\n $update_values['status'] = 'waiting';\n\n // mail for user\n $mail_to_user_args = array(\n 'email' => $user_info->user_email,\n 'booking' => $booking_data,\n );\n do_action('listeo_mail_to_user_waiting_approval',$mail_to_user_args);\n // wp_mail( $user_info->user_email, __( 'Welcome traveler', 'listeo_core' ), __( 'Your reservation waiting for be approved by owner!', 'listeo_core' ) );\n \n // mail for owner\n $mail_to_owner_args = array(\n 'email' => $owner_info->user_email,\n 'booking' => $booking_data,\n );\n \n do_action('listeo_mail_to_owner_new_reservation',$mail_to_owner_args);\n // wp_mail( $owner_info->user_email, __( 'Welcome owner', 'listeo_core' ), __( 'In your panel waiting new reservation to be accepted!', 'listeo_core' ) );\n\n break;\n\n // this is status when listing is confirmed by owner and waiting to payment\n case 'confirmed' :\n\n // get woocommerce product id\n $product_id = get_post_meta( $booking_data['listing_id'], 'product_id', true);\n\n // calculate when listing will be expired when will bo not pays\n $expired_after = get_post_meta( $booking_data['listing_id'], '_expired_after', true);\n if(empty($expired_after)) {\n $expired_after = 48;\n }\n if(!empty($expired_after) && $expired_after > 0){\n $expiring_date = date( \"Y-m-d H:i:s\", strtotime('+'.$expired_after.' hours') ); \n }\n \n\n //\n $instant_booking = get_post_meta( $booking_data['listing_id'], '_instant_booking', true);\n\n if($instant_booking) {\n\n $mail_to_user_args = array(\n 'email' => $user_info->user_email,\n 'booking' => $booking_data,\n ); \n do_action('listeo_mail_to_user_instant_approval',$mail_to_user_args);\n // wp_mail( $user_info->user_email, __( 'Welcome traveler', 'listeo_core' ), __( 'Your reservation waiting for be approved by owner!', 'listeo_core' ) );\n \n // mail for owner\n $mail_to_owner_args = array(\n 'email' => $owner_info->user_email,\n 'booking' => $booking_data,\n );\n \n do_action('listeo_mail_to_owner_new_intant_reservation',$mail_to_owner_args);\n\n }\n \n\n // for free listings\n if ( $booking_data['price'] == 0 )\n {\n\n // mail for user\n //wp_mail( $user_info->user_email, __( 'Welcome traveler', 'listeo_core' ), __( 'Your is paid!', 'listeo_core' ) );\n $mail_args = array(\n 'email' => $user_info->user_email,\n 'booking' => $booking_data,\n );\n do_action('listeo_mail_to_user_free_confirmed',$mail_args);\n\n $update_values['status'] = 'paid';\n $update_values['expiring'] = '';\n\n break;\n \n }\n\n $first_name = (isset($comment->first_name) && !empty($comment->first_name)) ? $comment->first_name : get_user_meta( $user_id, \"billing_first_name\", true) ;\n \n $last_name = (isset($comment->last_name) && !empty($comment->last_name)) ? $comment->last_name : get_user_meta( $user_id, \"billing_last_name\", true) ;\n \n $phone = (isset($comment->phone) && !empty($comment->phone)) ? $comment->phone : get_user_meta( $user_id, \"billing_phone\", true) ;\n \n $email = (isset($comment->email) && !empty($comment->email)) ? $comment->email : get_user_meta( $user_id, \"user_email\", true) ;\n \n $billing_address_1 = (isset($comment->billing_address_1) && !empty($comment->billing_address_1)) ? $comment->billing_address_1 : '';\n \n $billing_city = (isset($comment->billing_city) && !empty($comment->billing_city)) ? $comment->billing_city : '';\n \n $billing_postcode = (isset($comment->billing_postcode) && !empty($comment->billing_postcode)) ? $comment->billing_postcode : '';\n \n $billing_country = (isset($comment->billing_country) && !empty($comment->billing_country)) ? $comment->billing_country : '';\n\n $address = array(\n 'first_name' => $first_name,\n 'last_name' => $last_name,\n 'address_1' => $billing_address_1,\n //billing_address_2\n 'city' => $billing_city,\n //'billing_state'\n 'postcode' => $billing_postcode,\n 'country' => $billing_country,\n \n );\n\n // creating woocommerce order\n $order = wc_create_order();\n \n $args['totals']['subtotal'] = $booking_data['price'];\n $args['totals']['total'] = $booking_data['price'];\n $comment = json_decode($booking_data['comment']);\n \n $order->add_product( wc_get_product( $product_id ), 1, $args );\n $order->set_address( $address, 'billing' );\n $order->set_address( $address, 'shipping' );\n $order->set_customer_id($user_id);\n $order->set_billing_email( $email );\n if(isset($expiring_date)){\n $order->set_date_paid( strtotime( $expiring_date ) ); \n }\n \n \n\n\n $payment_url = $order->get_checkout_payment_url();\n \n \n \n $order->calculate_totals();\n $order->save();\n \n $order->update_meta_data('booking_id', $booking_id);\n $order->update_meta_data('owner_id', $owner_id);\n $order->update_meta_data('listing_id', $booking_data['listing_id']);\n if(isset($comment->service)){\n \n $order->update_meta_data('listeo_services', $comment->service);\n }\n\n $order->save_meta_data();\n\n $update_values['status'] = 'confirmed';\n if(isset($expiring_date)){\n $update_values['expiring'] = $expiring_date;\n }\n $update_values['order_id'] = $order->get_order_number();\n \n \n // mail for user\n //wp_mail( $user_info->user_email, __( 'Welcome traveler', 'listeo_core' ), sprintf( __( 'Your reservation waiting for payment! Please do it before %s hours. Here is link: %s', 'listeo_core' ), $expired_after, $payment_url ) );\n $mail_args = array(\n 'email' => $user_info->user_email,\n 'booking' => $booking_data,\n 'expiration' => $expiring_date,\n 'payment_url' => $payment_url\n );\n \n do_action('listeo_mail_to_user_pay',$mail_args);\n \n \n break;\n\n // this is status when listing is confirmed by owner and already paid\n case 'paid' :\n\n // mail for owner\n //wp_mail( $owner_info->user_email, __( 'Welcome owner', 'listeo_core' ), __( 'Your client paid!', 'listeo_core' ) );\n $mail_to_owner_args = array(\n 'email' => $owner_info->user_email,\n 'booking' => $booking_data,\n );\n do_action('listeo_mail_to_owner_paid',$mail_to_owner_args);\n // mail for user\n // wp_mail( $user_info->user_email, __( 'Welcome traveler', 'listeo_core' ), __( 'Your is paid!', 'listeo_core' ) );\n\n $update_values['status'] = 'paid';\n $update_values['expiring'] = ''; \n \n\n break;\n\n // this is status when listing is confirmed by owner and already paid\n case 'cancelled' :\n\n // mail for user\n //wp_mail( $user_info->user_email, __( 'Welcome traveler', 'listeo_core' ), __( 'Your reservation was cancelled by owner', 'listeo_core' ) );\n $mail_to_user_args = array(\n 'email' => $user_info->user_email,\n 'booking' => $booking_data,\n );\n do_action('listeo_mail_to_user_canceled',$mail_to_user_args);\n // delete order if exist\n if ( $booking_data['order_id'] )\n {\n $order = wc_get_order( $booking_data['order_id'] );\n $order->update_status( 'cancelled', __( 'Order is cancelled.', 'listeo_core' ) );\n }\n $comment = json_decode($booking_data['comment']);\n $tickets_from_order = $comment->tickets;\n \n $sold_tickets = (int) get_post_meta( $booking_data['listing_id'],\"_event_tickets_sold\",true); \n \n update_post_meta( $booking_data['listing_id'],\"_event_tickets_sold\",$sold_tickets-$tickets_from_order); \n\n $update_values['status'] = 'cancelled';\n $update_values['expiring'] = ''; \n\n break;\n // this is status when listing is confirmed by owner and already paid\n case 'deleted' :\n\n \n if ( $booking_data['order_id'] )\n {\n $order = wc_get_order( $booking_data['order_id'] );\n //$order->update_status( 'cancelled', __( 'Order is cancelled.', 'listeo_core' ) );\n }\n \n return $wpdb -> delete( $wpdb->prefix . 'bookings_calendar', array( 'id' => $booking_id ) );\n\n break;\n }\n \n return $wpdb -> update( $wpdb->prefix . 'bookings_calendar', $update_values, array( 'id' => $booking_id ) );\n\n }",
"public function setStatus(Status $status);"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Handle pingbacks. This is an XMLRPC service. | public function pingbackAction() {
$this->getResponse()->addHeader(new baxe_Header_ContentType(
baxe_Header_ContentType::XML, baxe_Header_ContentType::CHARSET_UTF8
));
// TODO - log all xmlrpc input to a file
$logger = new baxe_Logger(baxe_Logger_File::getInstance($this->app));
$logger->info();
$xml = trim(file_get_contents('php://input'));
return new baxe_Response_Content_String($r);
} | [
"private function onPing()\n {\n $this->send($this->replyEvent());\n }",
"public function removePingbackXmlrpc($action)\n {\n if ($action === 'pingback.ping') {\n wp_die('Pingbacks are not supported', 'Not Allowed!', ['response' => 403]);\n }\n }",
"public function process(): void\n\t{\n\t\t$options = [\n\t\t\t'output_type' => 'xml',\n\t\t\t'verbosity' => 'pretty',\n\t\t\t'escaping' => ['markup'],\n\t\t\t'version' => 'xmlrpc',\n\t\t\t'encoding' => 'utf-8',\n\t\t];\n\n\t\t$response = xmlrpc_server_call_method($this->server, file_get_contents('php://input'), null, $options);\n\t\theader('Content-Type: text/xml; charset=\"utf-8\"');\n\t\techo $response;\n\t}",
"public function ProcessGatewayPing()\n\t{\n\t\tif(!isset($_REQUEST['payment_reference'])) {\n\t\t\texit;\n\t\t}\n\n\t\tif(!isset($_REQUEST['bank_reference'])) {\n\t\t\texit;\n\t\t}\n\n\t\t$sessionToken = explode('_', $_REQUEST['payment_reference'], 2);\n\n\t\t$this->SetOrderData(LoadPendingOrdersByToken($_REQUEST['payment_reference']));\n\n\t\t$orders = $this->GetOrders();\n\t\tlist(,$order) = each($orders);\n\n\t\t$serverIPs = explode(\"\\n\", trim($this->GetValue('serverips')));\n\t\tif(!empty($serverIPs)) {\n\t\t\t$serverIPs = array_map(\"trim\", $serverIPs);\n\t\t\tif (!in_array($_SERVER['REMOTE_ADDR'], $serverIPs)) {\n\t\t\t\t$GLOBALS['ISC_CLASS_LOG']->LogSystemError(array('payment', $this->GetName()), sprintf(GetLang('NabErrorInvalidIPResponse', array('ipAddress' => $_SERVER['REMOTE_ADDR']))));\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\t$amount = number_format($this->GetGatewayAmount(), 2, '.', '');\n\n\t\tif($amount == 0) {\n\t\t\texit;\n\t\t}\n\n\t\t$transaction = GetClass('ISC_TRANSACTION');\n\n\t\t$previousTransaction = $transaction->LoadByTransactionId($_REQUEST['payment_number'], $this->GetId());\n\n\t\tif(is_array($previousTransaction) && $previousTransaction['transactionid']) {\n\t\t\t$GLOBALS['ISC_CLASS_LOG']->LogSystemError(array('payment', $this->GetName()), sprintf(GetLang('NabTransactionAlreadyProcessed'), $_REQUEST['payment_date']));\n\t\t\treturn false;\n\t\t}\n\n\t\t// Check to see if it is approved\n\t\tif(!$this->isApproved($_REQUEST['bank_reference'])) {\n\t\t\t// Not approved\n\t\t\t$errorMsg = $this->getErrorMessage($_REQUEST['bank_reference']);\n\t\t\t$GLOBALS['ISC_CLASS_LOG']->LogSystemError(array('payment', $this->GetName()), GetLang('NabErrorInvalid'), $errorMsg);\n\t\t\treturn false;\n\t\t}\n\n\t\t// Need to finish the processing of the pingback\n\t\t$newTransaction = array(\n\t\t\t'providerid' => $this->GetId(),\n\t\t\t'transactiondate' => $_REQUEST['payment_date'],\n\t\t\t'transactionid' => $_REQUEST['payment_number'],\n\t\t\t'orderid' => array_keys($this->GetOrders()),\n\t\t\t'message' => 'Completed',\n\t\t\t'status' => '',\n\t\t\t'amount' => $_REQUEST['payment_amount'],\n\t\t\t'extrainfo' => array()\n\t\t);\n\n\t\t$newTransaction['status'] = TRANS_STATUS_COMPLETED;\n\t\t$newOrderStatus = ORDER_STATUS_AWAITING_FULFILLMENT;\n\n\t\t$transactionId = $transaction->Create($newTransaction);\n\n\t\tforeach($this->GetOrders() as $orderId => $order) {\n\t\t\t$status = $newOrderStatus;\n\t\t\t// If it's a digital order & awaiting fulfillment, automatically complete it\n\t\t\tif($order['ordisdigital'] && $status == ORDER_STATUS_AWAITING_FULFILLMENT) {\n\t\t\t\t$status = ORDER_STATUS_COMPLETED;\n\t\t\t}\n\t\t\tUpdateOrderStatus($orderId, $status);\n\t\t}\n\n\t\t$updatedOrder = array(\n\t\t\t'ordpayproviderid' => $_REQUEST['payment_number'],\n\t\t\t'ordpaymentstatus' => 'captured',\n\t\t);\n\n\t\t$this->UpdateOrders($updatedOrder);\n\n\t\t// This was a successful order\n\t\t$oldStatus = GetOrderStatusById($this->GetOrderStatus());\n\n\t\tif(!$oldStatus) {\n\t\t\t$oldStatus = 'Incomplete';\n\t\t}\n\n\t\t$newStatus = GetOrderStatusById($newOrderStatus);\n\t\t$extra = sprintf(GetLang('NabSuccessDetails'), implode(', ', array_keys($this->GetOrders())), $amount, $_REQUEST['bank_reference'], 'Captured', $newStatus, $oldStatus);\n\t\t$GLOBALS['ISC_CLASS_LOG']->LogSystemSuccess(array('payment', $this->GetName()), GetLang('NabSuccess'), $extra);\n\t\treturn true;\n\t}",
"function wc_admin_handle_linkbacks($post_id) {\n\n global $WCDATA, $WC;\n\n $post = wc_db_get_post($post_id);\n $post_url = wc_get_url(\"post\", array($post_id, $post[\"uri\"]));\n\n\n // handle pingbacks/trackbacks\n if(preg_match_all('!href=\\s*\"(.+?)\"|href=\\s*\\'(.+?)\\'|href=\\s*([^ >]+)!si', $post[\"body\"], $match)){\n\n $urls = array_unique(array_merge($match[1], $match[2], $match[3]));\n\n foreach($urls as $url){\n\n if(empty($url)) continue;\n\n $data = wc_admin_get_url($url, \"HEAD\");\n\n if(strpos($data, \"X-Pingback\")){\n preg_match('!X-Pingback: (.+?)\\s!', $data, $match);\n $pingback_url = $match[1];\n }\n\n if(empty($pingback_url)){\n $data = @file_get_contents($url);\n if(preg_match('!<link.+?rel=\"pingback\".*>!si', $data, $match)){\n if(preg_match('!href=\"(.+?)\"|href=\\'(.+?)\\'|href=([^ >]+)!', $match[0], $match)){\n $pingback_url = max($match[1], $match[2], $match[3]);\n }\n } elseif(preg_match('!<rdf:Description.+?trackback:ping=[\\'\"](.+?)[\\'\"]!si', $data, $match)){\n $trackback_url = $match[1];\n }\n }\n\n if(!empty($pingback_url)){\n\n // do pingback\n $data ='<?xml version=\"1.0\"?>';\n $data.='<methodCall>';\n $data.='<methodName>pingback.ping</methodName>';\n $data.='<params>';\n $data.='<param><value><string>'.str_replace(\"&\", \"&\", $post_url).'</string></value></param>';\n $data.='<param><value><string>'.str_replace(\"&\", \"&\", $url).'</string></value></param>';\n $data.='</params></methodCall>';\n\n wc_admin_get_url($pingback_url, \"POST\", $data);\n\n } elseif(!empty($trackback_url)) {\n\n // do trackback\n $data = \"url=\".urlencode($post_url);\n $data.= \"&title=\".urlencode($post[\"title\"]);\n $data.= \"&blog_name=\".urlencode($WC[\"default_title\"]);\n\n wc_admin_get_url($trackback_url, \"POST\", $data);\n\n }\n\n }\n\n }\n\n}",
"function report_pingback_failure () {\nprint '<?xml version=\"1.0\"?>' . \"\\n\";\nprint <<<FAILURE\n<methodResponse>\n <fault>\n <value><i4>0</i4></value>\n </fault>\n</methodResponse>\nFAILURE;\n}",
"public function pingback_ping(/**\n * Fires after a post pingback has been sent.\n *\n * @since 0.71\n *\n * @param int $comment_ID Comment ID.\n */\n$args) {}",
"public function ping(): void\n {\n $this->internal->ping();\n }",
"private function handleGithubPings()\n {\n if (Request::isGithubPing()) {\n echo 'Ping received!';\n exit;\n }\n }",
"function sendPingbacks ($type, $id)\n{\n global $_CONF, $LANG_TRB;\n\n $retval = '';\n\n list($url, $text) = PLG_getItemInfo($type, $id, 'url,description');\n\n // extract all links from the text\n preg_match_all (\"/<a[^>]*href=[\\\"']([^\\\"']*)[\\\"'][^>]*>(.*?)<\\/a>/i\", $text,\n $matches);\n $numlinks = count ($matches[0]);\n if ($numlinks > 0) {\n $links = array ();\n for ($i = 0; $i < $numlinks; $i++) {\n if (!isset ($links[$matches[1][$i]])) {\n $links[$matches[1][$i]] = $matches[2][$i];\n }\n }\n\n $template = new Template ($_CONF['path_layout'] . 'admin/trackback');\n $template->set_file (array ('list' => 'pingbacklist.thtml',\n 'item' => 'pingbackitem.thtml'));\n $template->set_var('xhtml', XHTML);\n $template->set_var('site_url', $_CONF['site_url']);\n $template->set_var('site_admin_url', $_CONF['site_admin_url']);\n $template->set_var('layout_url', $_CONF['layout_url']);\n $template->set_var('lang_resend', $LANG_TRB['resend']);\n $template->set_var('lang_results', $LANG_TRB['pingback_results']);\n\n $counter = 1;\n foreach ($links as $URLtoPing => $linktext) {\n $result = PNB_sendPingback ($url, $URLtoPing);\n $resend = '';\n if (empty ($result)) {\n $result = '<b>' . $LANG_TRB['pingback_success'] . '</b>';\n } else if ($result != $LANG_TRB['no_pingback_url']) {\n $result = '<span class=\"warningsmall\">' . $result . '</span>';\n // TBD: $resend = '...';\n }\n $parts = parse_url ($URLtoPing);\n\n $template->set_var('url_to_ping', $URLtoPing);\n $template->set_var('link_text', $linktext);\n $template->set_var('host_name', $parts['host']);\n $template->set_var('pingback_result', $result);\n $template->set_var('resend', $resend);\n $template->set_var('alternate_row',\n ($counter % 2) == 0 ? 'row-even' : 'row-odd');\n $template->set_var('cssid', ($i % 2) + 1);\n $template->parse ('pingback_results', 'item', true);\n $counter++;\n }\n $template->parse ('output', 'list');\n $retval .= $template->finish ($template->get_var ('output'));\n\n } else {\n $retval = '<p>' . $LANG_TRB['no_links_pingback'] . '</p>';\n }\n\n return $retval;\n}",
"public function ping();",
"#[Route('/xmlrpc', name: 'xml_rpc', methods: ['POST'])]\n public function serve(): Response\n {\n $xmlrpcResponse = $this->server->service(null, true);\n $response = new Response($xmlrpcResponse, 200, ['Content-Type' => 'text/xml']);\n // there should be no need to disable response caching since this is only accessed via POST\n return $response;\n }",
"private function doUpdatePing(): void\n {\n\n $pkt = MineceitUtil::constructCustomPkt([\"GetPing\", $this->getName()]);\n RequestPool::addRequest(Request::TYPE_PING, $this, $pkt->buffer, function ($data, $uuid) {\n if (($player = MineceitUtil::getPlayerFromUUID($uuid)) != null && $player instanceof MineceitPlayer) {\n $player->completePingUpdate($data['ping']);\n }\n });\n $this->dataPacket($pkt);\n }",
"function catch_xmlrpc_post( $callname ) {\r\n\t\t$this->xmlrpc_post = true;\r\n\t}",
"public function ping() {\n\n $args = $this->args;\n $args[ \"method\" ] = __FUNCTION__;\n\n $res = $this->call($args);\n if ($res)\n return $res[ \"result\" ];\n }",
"function add_ping($post_id, $uri)\n{\n}",
"public function test_ping_unreachable() {\n\n\n\t\t$webhook = LLMS_REST_API()->webhooks()->create( array(\n\t\t\t'delivery_url' => 'https://fake.tld',\n\t\t\t'topic' => 'course.created',\n\t\t) );\n\n\t\tremove_filter( 'llms_rest_webhook_pre_ping', '__return_true' );\n\n\t\t$ret = $webhook->ping();\n\t\t$this->assertIsWPError( $ret );\n\t\t$this->assertWPErrorCodeEquals( 'llms_rest_webhook_ping_unreachable', $ret );\n\n\t}",
"function pingResponse() : void\n{\n echo 'pong';\n}",
"public function rpcHookPointsHandler($hook, $server, $notify);"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.