query
stringlengths 10
8.11k
| document
stringlengths 17
398k
| negatives
sequencelengths 19
20
| metadata
dict |
---|---|---|---|
Test case for listSourceAssociations List source associations. | public function testListSourceAssociations()
{
} | [
"public function testListTargetAssociations()\n {\n }",
"public function testListSources()\n {\n }",
"public function testV1SourceListGet()\n {\n }",
"protected function initSourceList()\n\t{\n\t\tif ($this->sourceList !== null)\n\t\t{\n\t\t\treturn;\n\t\t}\n\t\t$this->sourceList = [];\n\n\t\t$event = new Main\\Event(\n\t\t\t'landing',\n\t\t\t$this->config['SOURCE_EVENT_ID'],\n\t\t\t[\n\t\t\t\t'SELECTOR' => $this,\n\t\t\t\t'RESTRICTIONS' => $this->restrictions // TODO: remove this key after stable socialnetwork update\n\t\t\t]\n\t\t);\n\t\t$event->send();\n\t\t$resultList = $event->getResults();\n\t\tif (!empty($resultList))\n\t\t{\n\t\t\tforeach ($resultList as $eventResult)\n\t\t\t{\n\t\t\t\tif ($eventResult->getType() != Main\\EventResult::SUCCESS)\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t$module = (string)$eventResult->getModuleId();\n\t\t\t\t$list = $eventResult->getParameters();\n\t\t\t\tif (empty($list) || !is_array($list))\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tforeach ($list as $row)\n\t\t\t\t{\n\t\t\t\t\t$source = $this->prepareSourceParameters(\n\t\t\t\t\t\t$module,\n\t\t\t\t\t\t$row\n\t\t\t\t\t);\n\t\t\t\t\tif (empty($source))\n\t\t\t\t\t{\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\t$this->sourceList[$source['INDEX']] = $source;\n\t\t\t\t}\n\t\t\t}\n\t\t\tunset($source, $row, $list, $module);\n\t\t\tunset($eventResult, $resultList);\n\n\t\t\tif (!empty($this->sourceList))\n\t\t\t{\n\t\t\t\tMain\\Type\\Collection::sortByColumn(\n\t\t\t\t\t$this->sourceList,\n\t\t\t\t\t['TYPE' => SORT_ASC, 'TITLE' => SORT_ASC],\n\t\t\t\t\t'',\n\t\t\t\t\tnull,\n\t\t\t\t\ttrue\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\tunset($event);\n\t}",
"public function lead_source_list()\n\t{\n\t\t$data['lead_sources'] = $this->Lead_model->lead_source_list();\n\t\t$this->load->view('lead/lead_source_list', $data);\n\t}",
"public function testSourceObject()\r\n {\r\n $source = \\tabs\\api\\core\\Source::factory(\r\n 'GAD',\r\n 'Google',\r\n 'Internet'\r\n );\r\n $this->assertEquals('GAD', $source->getCode());\r\n $this->assertEquals('Google', $source->getDescription());\r\n $this->assertEquals('Internet', $source->getCategory());\r\n }",
"public function getSourcesList()\n {\n return $this->sources_list;\n }",
"public function sourceIds(): \\Traversable;",
"private function getSourceItemList()\n {\n /** @var SearchCriteriaBuilder $searchCriteria */\n $searchCriteriaBuilder = $this->searchCriteriaBuilderFactory->create();\n\n $searchCriteriaBuilder->addFilter(\n SourceItemInterface::SKU,\n 'example_simple_for_source_item'\n );\n\n $searchCriteriaBuilder->addFilter(\n SourceItemInterface::SOURCE_CODE,\n $this->defaultSourceProvider->getCode()\n );\n\n /** @var SearchCriteria $searchCriteria */\n $searchCriteria = $searchCriteriaBuilder->create();\n\n return $this->sourceItemRepository->getList($searchCriteria);\n }",
"public function listSources() {\n\t\t\treturn array('listSources');\n\t\t}",
"protected function _getSources() {\n\t\treturn ConnectionManager::sourceList();\n\t}",
"public function getAssignedSources(): array\n {\n $skus = $this->bulkSessionProductsStorage->getProductsSkus();\n $sourceCodes = $this->getSourceCodesBySkus->execute($skus);\n\n $searchCriteria = $this->searchCriteriaBuilder\n ->addFilter(\n SourceItemInterface::SOURCE_CODE,\n $sourceCodes,\n 'in'\n )\n ->create();\n\n return $this->sourceRepository->getList($searchCriteria)->getItems();\n }",
"function _deriveSources() {\n\t\t$models = Configure::listObjects('model');\n\t\tforeach ($models as $model) {\n\t\t\tClassRegistry::init(array(\n\t\t\t\t'class' => $model,\n\t\t\t\t'table' => false\n\t\t\t));\n\t\t}\n\t\tApp::import('Core', 'ConnectionManager');\n\t\t$sources = ConnectionManager::sourceList();\n\t\t$configSources = array_keys((get_class_vars('DATABASE_CONFIG')));\n\t\tforeach ($configSources as $source) {\n\t\t\tif (strpos($source, 'test') === 0) {\n\t\t\t\tcontinue;\n\t\t\t} elseif (in_array($source, $sources)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$sources[] = $source;\n\t\t}\n\t\treturn $sources;\n\t}",
"public function testRetrieveEventsCollectionFromSource()\n {\n // given\n $builder = self::getServiceContainer()->get(SourceBuilder::class);\n $source = $builder->build(TestSource::class); // stub class unit\\Stub\\TestSource\n\n // when\n $eventsCollection = $source->getEvents();\n $iterator = $eventsCollection->getIterator();\n\n // then\n $this->assertCount(2, $eventsCollection->toArray());\n $this->assertEquals(2, $eventsCollection->count());\n $this->assertEquals(2, $iterator->count());\n\n // test expected event property values\n $event = $iterator->current();\n $this->assertEquals($event->getId(), 123);\n $this->assertEquals($event->getTitle(), 'long event title', 'Cannot read event property \"title\".');\n $this->assertEquals($event->getTitleShort(), 'short title', 'Cannot read event property \"titleShort\".');\n $this->assertEquals($event->getDescription(), 'this is the first event added to the calendar events source', 'Cannot read event property \"description\".');\n $this->assertEquals($event->isAllDayEvent(), true, 'Event should be an allday event.');\n $this->assertEquals($event->getStart()->format('dmY'), '03112017', 'Event has unexpected start date.');\n $this->assertEquals($event->getEnd()->format('dmY'), '05112017', 'Event has unexpected end date.');\n\n $event2 = $iterator->offsetGet(456);\n $this->assertEquals($event2->getId(), 456);\n }",
"private function loadSources() {\n $sources = array();\n $statement = \"SELECT sources.field_fact_source_title AS title,\n sources.field_fact_source_url AS url\n FROM node node\n INNER JOIN field_revision_field_fact_source sources ON node.nid = sources.entity_id\n WHERE node.type = 'fact'\n AND sources.revision_id = node.vid\n AND node.nid = \" . $this->guid;\n $query = $this->connection->execute($statement);\n while ($row = $query->fetch(PDO::FETCH_ASSOC)) {\n $sources[] = $row;\n }\n $this->sources = $sources;\n }",
"public function getConfiguredSources($client, $avatar_id = NULL) {\n\t\t$sources = array ();\n\t\t$params = array ();\n\t\tif ($avatar_id != NULL) {\n\t\t\t$params [\"avatarId\"] = $avatar_id;\n\t\t}\n\t\t\n\t\t$data = $this->service->get ( \"{$client}{$this::$SERVICE_CONFIGURED_SOURCES}\", array (\n\t\t\t\t\"email\" => $this->super_user \n\t\t), $params );\n\t\tif ($data->status->code == 200 && ! empty ( $data->sources )) {\n\t\t\tforeach ( $data->sources as $source ) {\n\t\t\t\t$sources [$source->id] = isset ( $source->name ) ? $source->name : \"\";\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $sources;\n\t}",
"public function getRelatedSources($persons=array()) {\r\n\t\t\t\t\r\n\t\t// initialize source array\r\n\t\t$relatedSources = array();\r\n\t\t\r\n\t\tif (count($persons) > 0) {\r\n\t\t\t\r\n\t\t\t// walk through the array and collect all related source uids\r\n\t\t\tforeach ($persons as $person) {\r\n\t\t\t\t\r\n\t\t\t\t// join query on the MM table\r\n\t\t\t\t$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(\r\n\t\t\t\t\t'tx_hisodat_sources.uid',\r\n\t\t\t\t\t'tx_hisodat_persons,tx_hisodat_mm_src_pers,tx_hisodat_sources',\r\n\t\t\t\t\t'tx_hisodat_persons.name LIKE '.$GLOBALS['TYPO3_DB']->fullQuoteStr($person, 'tx_hisodat_persons').'\r\n\t\t\t\t\tAND tx_hisodat_sources.uid = tx_hisodat_mm_src_pers.uid_src\r\n\t\t\t\t\tAND tx_hisodat_persons.uid = tx_hisodat_mm_src_pers.uid_pers',\r\n\t\t\t\t\t'',\r\n\t\t\t\t\t'tx_hisodat_sources.uid',\r\n\t\t\t\t\t''\r\n\t\t\t\t);\r\n\t\t\t\t\r\n\t\t\t\tif ($GLOBALS['TYPO3_DB']->sql_num_rows($res) > 0) {\t\t\t\t\r\n\t\t\t\t\t// write the related uids into a csv list\t\t\t\t\r\n\t\t\t\t\twhile ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {\r\n\t\t\t\t\t\t$relatedSources[$person] .= $row['uid'].',';\r\n\t\t\t\t\t}\r\n\t\t\t\t\t// trim last comma\r\n\t\t\t\t\t$relatedSources[$person] = substr($relatedSources[$person], 0, -1);\r\n\t\t\t\t\t// free memory\t\t\t\r\n\t\t\t\t\t$GLOBALS['TYPO3_DB']->sql_free_result($res);\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$relatedSources[$person] = '';\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $relatedSources;\t\r\n\t}",
"public function sources() {\n if (!is_admin()) {\n access_denied('Leads Sources');\n }\n $data['sources'] = $this->leads_model->get_source();\n $data['title'] = 'Leads sources';\n $this->load->view('admin/leads/manage_sources', $data);\n }",
"public function getExternalSources();"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Change the adapter plugin manager | public static function setAdapterPluginManager(AdapterPluginManager $adapters)
{
static::$adapters = $adapters;
} | [
"public static function resetAdapterPluginManager()\n {\n static::$adapters = null;\n }",
"protected function _setAclAdapter() {\n\t\tlist($plugin, $name) = pluginSplit(Configure::read('Visualisation.Acl.classname'));\n\t\t$this->Acl->adapter($name);\n\t}",
"public static function pluginManager() {\n return self::$_PluginManager; //self::Factory(self::AliasPluginManager);\n }",
"private function _setPluginComponents(): void\n {\n $this->setComponents([\n 'api' => Api::class,\n ]);\n }",
"function setAdapter($name, $adapter = null)\r\r\n\t{\r\r\n\t\t// Check if valid extension type\r\r\n\t\tif( $name == 'plugin' || $name == 'language' || $name == 'extension' ){\r\r\n\t\t\tif (!is_object($adapter))\r\r\n\t\t\t{\t\t\t\r\r\n\t\t\t\t// Try to load the adapter object\r\r\n\t\t\t\trequire_once(dirname(__FILE__).DS.'adapters'.DS.strtolower($name).'.php');\r\r\n\t\t\t\t$class = 'JCEInstaller'.ucfirst($name);\r\r\n\t\t\t\tif (!class_exists($class)) {\r\r\n\t\t\t\t\treturn false;\r\r\n\t\t\t\t}\r\r\n\t\t\t\t$adapter = new $class($this);\r\r\n\t\t\t\t$adapter->parent =& $this;\r\r\n\t\t\t}\r\r\n\t\t\t$this->_adapters[$name] =& $adapter;\r\r\n\t\t\treturn true;\r\r\n\t\t}else{\r\r\n\t\t\t$this->abort(JText::_('Incorrect version!'));\r\r\n\t\t}\r\r\n\t}",
"private function setWidgetManager()\n {\n $this->widgetManager = $this->container->get('pi_app_admin.manager.widget');\n }",
"public function setInstance()\n {\n foreach (array_keys($this->plugins) as $plugin) {\n $this->plugins[$plugin]->setInstance($this);\n }\n }",
"function setPlugin($plugin) {\n\t\t$this->_plugin = $plugin;\n\t}",
"abstract public function register_plugin();",
"protected function get_plugin_manager() {\n return core_plugin_manager::instance();\n }",
"public static function setPluginManager(FilterPluginManager $manager = NULL) {\n // Don't share by default to allow different arguments on subsequent calls\n if ($manager instanceof FilterPluginManager) {\n $manager->setShareByDefault(FALSE);\n }\n static::$plugins = $manager;\n }",
"public function setAdapter($name, &$adapter = null,$options = array())\n\t{\n\t\t// Check if valid extension type\n\t\tif( $name == 'plugin' || $name == 'language' || $name == 'skin' || $name== 'backup'){\n\t\t\tif (!is_object($adapter))\n\t\t\t{\t\t\t\n\t\t\t\t// Try to load the adapter object\n\t\t\t\trequire_once(dirname(__FILE__).DS. '..'.DS.'restorers'.DS.strtolower($name).'.php');\n\t\t\t\t$class = 'JCKRestorer'.ucfirst($name);\n\t\t\t\tif (!class_exists($class)) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\t$adapter = new $class($this);\n\t\t\t\t$adapter->parent =& $this;\n\t\t\t}\n\t\t\t$this->_adapters[$name] = $adapter;\n\t\t\treturn true;\n\t\t}else{\n\t\t\t$this->abort(JText::_('Incorrect version!'));\n\t\t}\n\t}",
"private function upgrade_plugin()\n {\n }",
"function setAdapter($name, $adapter = null)\n\t{\n\t\tif (!is_object($adapter))\n\t\t{\n\t\t\t// Try to load the adapter object\n\t\t\trequire_once(dirname(__FILE__).DS.'adapters'.DS.strtolower($name).'.php');\n\t\t\t$class = 'JInstaller'.ucfirst($name);\n\t\t\tif (!class_exists($class)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t$adapter = new $class($this);\n\t\t\t$adapter->parent =& $this;\n\t\t}\n\t\t$this->_adapters[$name] =& $adapter;\n\t\treturn true;\n\t}",
"function _register_adapters()\n\t{\n\t\t// Provides factory methods for creating display type and displayed gallery instances\n\t\t$this->get_registry()->add_adapter(\n\t\t\t'I_Component_Factory', 'A_Gallery_Display_Factory'\n\t\t);\n\n if (is_admin()) {\n $this->get_registry()->add_adapter(\n 'I_Page_Manager',\n 'A_Display_Settings_Page'\n );\n\n $this->get_registry()->add_adapter(\n 'I_NextGen_Admin_Page',\n 'A_Display_Settings_Controller',\n NGG_DISPLAY_SETTINGS_SLUG\n );\n }\n\n // Frontend-only components\n if (!is_admin() && apply_filters('ngg_load_frontend_logic', TRUE, $this->module_id))\n {\n $this->get_registry()->add_adapter('I_MVC_View', 'A_Gallery_Display_View');\n $this->get_registry()->add_adapter('I_MVC_View', 'A_Displayed_Gallery_Trigger_Element');\n $this->get_registry()->add_adapter('I_Display_Type_Controller', 'A_Displayed_Gallery_Trigger_Resources');\n }\n\t}",
"function din_plugin_manager() {\n\n\tif ( ! is_admin() ) {\n\t\treturn;\n\t}\n\n\t/**\n\t * Include plugin manager class.\n\t *\n\t * No other includes are needed. The DisabilityIN_Custom_Theme_Plugin_Manager\n\t * class will handle including any other files needed.\n\t *\n\t * If you want to move the \"plugin-manager\" directory to\n\t * a different location within your theme, that's totally\n\t * fine; just make sure you adjust this include path to\n\t * the plugin manager class accordingly.\n\t */\n\trequire_once( get_parent_theme_file_path( '/plugin-manager/class-disabilityin-custom-theme-plugin-manager.php' ) );\n\n\t/*\n\t * Setup suggested plugins.\n\t *\n\t * It's a good idea to have a filter applied to this so your\n\t * loyal users running child themes have a way to easily modify\n\t * which plugins show as suggested for the site they're setting\n\t * up for a client.\n\t */\n\t$plugins = apply_filters( 'din_plugins', array(\n\t\tarray(\n\t\t\t'name' => 'WP Accessibility',\n\t\t\t'slug' => 'wp-accessibility',\n\t\t\t'version' => '1.6+',\n\t\t),\n\t\tarray(\n\t\t\t'name' => 'Yoast SEO',\n\t\t\t'slug' => 'wordpress-seo',\n\t\t\t'version' => '7.9+',\n\t\t),\n\t\tarray(\n\t\t\t'name'\t\t=> 'Widget CSS Classes',\n\t\t\t'slug'\t\t=> 'widget-css-classes',\n\t\t\t'version' => '1.5+',\n\t\t),\n\t\tarray(\n\t\t\t'name' => 'Classic Editor',\n\t\t\t'slug' => 'classic-editor',\n\t\t\t'version' => '0.5+',\n\t\t),\n\t\tarray(\n\t\t\t'name' => 'Jetpack by WordPress.com',\n\t\t\t'slug' => 'jetpack',\n\t\t\t'version' => '6.6.1+',\n\t\t),\n\t\tarray(\n\t\t\t'name' => 'Contact Form 7',\n\t\t\t'slug' => 'contact-form-7',\n\t\t\t'version' => '5.0.5+',\n\t\t),\n\t\tarray (\n\t\t\t'name'\t\t=> 'Contact Form 7 Accessible Defaults',\n\t\t\t'slug'\t\t=> 'contact-form-7-accessible-defaults',\n\t\t\t'version'\t=> '1.1.4+'\n\t\t),\n\t\tarray(\n\t\t\t'name' => 'Simple Social Icons',\n\t\t\t'slug' => 'simple-social-icons',\n\t\t\t'version' => '3.0.0+',\n\t\t),\n\t\tarray(\n\t\t\t'name' => 'Easy Theme and Plugin Upgrades',\n\t\t\t'slug' => 'easy-theme-and-plugin-upgrades',\n\t\t\t'version' => '2.0.1+',\n\t\t),\n\t\tarray(\n\t\t\t'name' => 'Gallery Custom Links',\n\t\t\t'slug' => 'gallery-custom-links',\n\t\t\t'version' => '1.0.2+',\n\t\t),\n\t));\n\n\t/*\n\t * Setup optional arguments for plugin manager interface.\n\t *\n\t * See the set_args() method of the DisabilityIN_Custom_Theme_Plugin_Manager\n\t * class for full documentation on what you can pass in here.\n\t */\n\t$args = array(\n\t\t'page_title' => __( 'Suggested Plugins', 'din' ),\n\t\t'menu_slug' => 'din-suggested-plugins',\n\t);\n\n\t/*\n\t * Create plugin manager object, passing in the suggested\n\t * plugins and optional arguments.\n\t */\n\t$manager = new \\DisabilityIN_Custom_Theme_Plugin_Manager( $plugins, $args );\n\n}",
"public function getPluginManager()\n {\n return new PluginManager();\n }",
"public function configureObjectManager()\n {\n $frameworkSetup = $this->configurationManager->getConfiguration(\\TYPO3\\CMS\\Extbase\\Configuration\\ConfigurationManagerInterface::CONFIGURATION_TYPE_FRAMEWORK);\n if (!is_array($frameworkSetup['objects'])) {\n return;\n }\n $objectContainer = \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::makeInstance(\\TYPO3\\CMS\\Extbase\\Object\\Container\\Container::class);\n foreach ($frameworkSetup['objects'] as $classNameWithDot => $classConfiguration) {\n if (isset($classConfiguration['className'])) {\n $originalClassName = rtrim($classNameWithDot, '.');\n $objectContainer->registerImplementation($originalClassName, $classConfiguration['className']);\n }\n }\n }",
"function setPlugin( PluginInterface $plugin ) {\n\t\t$this->plugin = $plugin;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the excluding VAT total. | public function getExcludingVatTotal(): ?float; | [
"public function getTotalWithVatExcluded()\n {\n $value = $this->get(self::TOTALWITHVATEXCLUDED);\n return $value === null ? (string)$value : $value;\n }",
"public function getSubtotalWithVatExcluded()\n {\n $value = $this->get(self::SUBTOTALWITHVATEXCLUDED);\n return $value === null ? (string)$value : $value;\n }",
"public function get_total_VAT()\n\t{\n\t\treturn $this->get_total_price() - $this->get_total_price(FALSE);\n\t}",
"public function setExcludingVatTotal(?float $excludingVatTotal);",
"public static function priceNoVat()\n {\n $vat = self::getVat();\n $total = self::totalPrice();\n\n return round(($total / (1 + $vat)), 2);\n }",
"public function get_price_withoutvat() {\n return $this->get_count() * $this->price;\n }",
"public function totalVat() {\n return $this->totalPrice() * env('VAT_PERCENTAGE');\n }",
"public function getVatAmount()\n {\n return bcsub($this->getTotal(true), $this->getTotal(false));\n }",
"public function getVatTotal()\n {\n return $this->vatTotal;\n }",
"public function getVatAmount()\n\t{\n\t\treturn $this->vat_amount;\n\t}",
"public function getVatAmount()\n {\n return $this->getData('vatAmount');\n }",
"public function getTotalVat()\r\n {\r\n return $this->totalVat;\r\n }",
"public function getTotalVat()\n {\n $value = $this->get(self::TOTALVAT);\n return $value === null ? (string)$value : $value;\n }",
"public function vatItems()\n {\n $totalVAT = 0;\n\n $productIDs = [];\n $cartProducts = [];\n foreach($this->content() as $row) {\n $productIDs[] = $row->id;\n $cartProducts[$row->id] = ['subtotal' => $row->subtotal];\n }\n\n $products = Product::with(['tax_class' => function($query) {\n $query->select('id', 'tax_rate');\n }])->select('id', 'tax_class_id')->whereIn('id', $productIDs)->get();\n\n foreach($products as $p) {\n $net = $cartProducts[$p->id]['subtotal'] / ((100 + $p->tax_class->tax_rate) / 100);\n $vat = $cartProducts[$p->id]['subtotal'] - $net;\n $totalVAT += round($vat, 2);\n }\n\n $coupon = Checkout::getCoupon();\n\n if($coupon != null && $coupon->percentageDiscount != null) {\n $totalVAT = round($totalVAT * ($coupon->percentageDiscount / 100), 2);\n } elseif($coupon != null && $coupon->flatDiscount != null) {\n $overallPercentageVat = $totalVAT / $this->total();\n $totalVAT = round(($this->total() - $this->couponDeduction()) * $overallPercentageVat, 2);\n }\n\n return $totalVAT;\n }",
"public function getTotal($vat = false);",
"public function getTotalNonVat()\n {\n if (\\array_key_exists(Tokens::T_TOTAL_NON_IVA, $this->properties)) {\n return (float) $this->properties[Tokens::T_TOTAL_NON_IVA];\n }\n return null;\n }",
"public function getInvoiceFeeExcludeTax()\n {\n return $this->getTotal()->getAddress()->getInvoiceFeeExcludedVat();\n }",
"public function unitAmountExcludingTax()\n {\n return $this->formatAmount($this->item->unit_amount_excluding_tax ?? 0);\n }",
"public function setExcludingVatPrice(?float $excludingVatPrice);"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get Package's Short name | public function shortName()
{
return __('app_manager.shortName');
} | [
"public function getpackagename(){}",
"public function getpackagename()\n {\n }",
"public function getShortName(){\n\t\treturn $this->_appInfo->getAppShortName();\n\t}",
"public function getPackagedName()\n {\n return Generator::getPackageName() . $this->getContextualPart() . ucfirst(self::uniqueName($this->getCleanName(), $this->getContextualPart()));\n }",
"public function get_package_name()\n {\n return $this->_package_name;\n }",
"public function getShortName(): string\n {\n if (empty($this->shortName)) {\n $name = strtolower($this->getName());\n $replaced = preg_replace('|bundle$|', '', $name);\n\n $this->shortName = trim($replaced);\n }\n\n return $this->shortName;\n }",
"public function get_package_name(){\n\t\treturn $this->v_package_name;\n\t}",
"public function get_package_name()\n {\n clearos_profile(__METHOD__, __LINE__);\n\n return $this->pkgname;\n }",
"public function getShortname()\n {\n\n return $this->shortname;\n }",
"public function getShortName()\n {\n return $this->short_name;\n }",
"public function getShortName()\n {\n return $this->shortName;\n }",
"public function getName()\n {\n return $this->pkg->name;\n }",
"public function getPluginShortName(): string;",
"public function getFriendlyName(): string\n {\n $extra = $this->getPackage()->getExtra();\n $regularName = str_replace(['component-', 'module-'], '', $this->getPackageName());\n\n return (string) Arr::get($extra, 'friendly-name', $regularName);\n }",
"public function getShortName()\n {\n $value = $this->get(self::SHORT_NAME);\n return $value === null ? (string)$value : $value;\n }",
"public function getShortCode();",
"public function getPackagedName()\n {\n return WsdlToPhpGenerator::getPackageName() . $this->getContextualPart() . ucfirst(self::uniqueName($this->getCleanName(),$this->getContextualPart()));\n }",
"public function name()\n {\n return isset($this->packageJson->name) ? $this->packageJson->name : null;\n }",
"public function getShortName()\n {\n // If installed in the root directory we need to infer from composer\n if ($this->path === $this->basePath && $this->composerData) {\n // Sometimes we customise installer name\n if (isset($this->composerData['extra']['installer-name'])) {\n return $this->composerData['extra']['installer-name'];\n }\n\n // Strip from full composer name\n $composerName = $this->getComposerName();\n if ($composerName) {\n list(, $name) = explode('/', $composerName ?? '');\n return $name;\n }\n }\n\n // Base name of directory\n return basename($this->path ?? '');\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the public 'api_platform.action.placeholder' shared service. | protected function getApiPlatform_Action_PlaceholderService()
{
include_once \dirname(__DIR__, 4).'/vendor/api-platform/core/src/Action/PlaceholderAction.php';
return $this->services['api_platform.action.placeholder'] = new \ApiPlatform\Core\Action\PlaceholderAction();
} | [
"protected function getApiPlatform_Action_NotFoundService()\n {\n include_once \\dirname(__DIR__, 4).'/vendor/api-platform/core/src/Action/NotFoundAction.php';\n\n return $this->services['api_platform.action.not_found'] = new \\ApiPlatform\\Core\\Action\\NotFoundAction();\n }",
"protected function getAjaxWidgetContextHolderService()\n {\n return $this->services['TYPO3\\\\CMS\\\\Fluid\\\\Core\\\\Widget\\\\AjaxWidgetContextHolder'] = \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::makeInstanceForDi(\\TYPO3\\CMS\\Fluid\\Core\\Widget\\AjaxWidgetContextHolder::class);\n }",
"protected function getActionObjectProviderService()\n {\n return $this->services['action_object_provider'] = new \\Civi\\Api4\\Provider\\ActionObjectProvider();\n }",
"public function getActionFactory(){\n return $this->actionFactory;\n }",
"public function getPlaceholder()\n {\n return $this->_placeholder;\n }",
"public function getPlaceHolder(){\n\t\treturn ValueUtils::val($this->placeHolder);\n\t}",
"public function getPlaceholder(): string\n {\n return $this->placeholder;\n }",
"public function getPlaceholder() {\n if ($this->_placeholder) {\n return $this->_placeholder;\n }\n\n $this->_placeholder = '<!-- SPLOT_ASSETS_MODULE_PLACEHOLDER_'. StringUtils::random() .'_'. md5(Debugger::getClass($this) . StringUtils::random() . time()) .' -->';\n return $this->_placeholder;\n }",
"public function getPlaceholder()\n {\n return $this->placeholder;\n }",
"static function get_action_parameter()\r\n {\r\n return self :: PARAM_EXTERNAL_REPOSITORY_MANAGER_ACTION;\r\n }",
"static function get_action_parameter()\r\n {\r\n return self :: PARAM_BUILDER_ACTION;\r\n }",
"protected function getApiService()\n {\n return craft()->appleNews_api;\n }",
"protected function getActionProviderService()\n {\n return $this->services['App\\\\Backend\\\\ImportProduct\\\\Business\\\\Model\\\\ActionProvider'] = new \\App\\Backend\\ImportProduct\\Business\\Model\\ActionProvider(($this->services['App\\\\Backend\\\\ImportProduct\\\\Business\\\\Model\\\\Update\\\\ProductCategory'] ?? $this->getProductCategoryService()), ($this->services['App\\\\Backend\\\\ImportProduct\\\\Business\\\\Model\\\\Update\\\\ProductInformation'] ?? $this->getProductInformationService()), ($this->services['App\\\\Backend\\\\ImportProduct\\\\Business\\\\Model\\\\Update\\\\ProductAttribute'] ?? $this->getProductAttributeService()));\n }",
"protected function getTemplating_Helper_ActionsService()\n {\n return $this->services['templating.helper.actions'] = new \\Symfony\\Bundle\\FrameworkBundle\\Templating\\Helper\\ActionsHelper($this->get('http_kernel'));\n }",
"protected function getAction_AuthService()\n {\n return $this->services['action.auth'] = new \\SRC\\Action\\Auth($this->get('service.auth'));\n }",
"public function getPlaceholder()\n {\n return $this->getProperty('placeholder');\n }",
"protected function getTemplating_Helper_ActionsService()\n {\n return $this->services['templating.helper.actions'] = new \\Symfony\\Bundle\\FrameworkBundle\\Templating\\Helper\\ActionsHelper($this->get('fragment.handler'));\n }",
"protected function getSylius_Fixture_ExampleFactory_PromotionActionService()\n {\n return $this->services['sylius.fixture.example_factory.promotion_action'] = new \\Sylius\\Bundle\\CoreBundle\\Fixture\\Factory\\PromotionActionExampleFactory(${($_ = isset($this->services['sylius.factory.promotion_action']) ? $this->services['sylius.factory.promotion_action'] : $this->get('sylius.factory.promotion_action')) && false ?: '_'});\n }",
"protected function getPlugin_Manager_ActionService()\n {\n return $this->services['plugin.manager.action'] = new \\Drupal\\Core\\Action\\ActionManager($this->get('container.namespaces'), $this->get('cache.discovery'), $this->get('module_handler'));\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check whether a task number is valid $mustExist is not set (default), only the format is checked. If $mustExist is set, also a database request will check if this task exists | public static function isTaskNumber($fullTaskNumber, $mustExist = false) {
$valid = false;
// Check for point (.)
if( self::isTaskNumberFormat($fullTaskNumber) ) {
// Split into project / task number
$parts = TodoyuArray::intExplode('.', $fullTaskNumber, true, true);
// If 2 valid integers found
if( sizeof($parts) === 2 ) {
// Database check required?
if( $mustExist ) {
// Get task ID for validation
$idTask = self::getTaskIDByTaskNumber($fullTaskNumber);
if( $idTask !== 0 ) {
$valid = true;
}
} else {
// If no db check required, set valid
$valid = true;
}
}
}
return $valid;
} | [
"public function doesExist(){ return $this->APICall( '', \"Could not test for existence for job \" . $this->description() ); }",
"public function check_on_entry_exists()\n {\n //check if the last entry type of this record has the same type as the type of the sent entry\n $this->prevent_same_entry_type();\n\n //prevent incomming entry time to be equal to the current last entry time of the task\n $last_entry = $this->lastEntry;\n if(!date_greater_than($this->request->entry_time, $last_entry->entry_time)) {\n $this->build_error([\n 'message' => \"Please the time of this entry must be greater than the \".\n \"previous entry time({$last_entry->entry_time})\"\n ]);\n }\n\n //check first if the task has ended in case user want to : pause or resume\n if (in_array($this->request->entry_type,['resume','pause'])) {\n if ($last_entry->entry_type == 'end') {\n $this->build_error([\n 'message' => 'You can no longer '.strtoupper($this->request->entry_type).'. '.\n 'this task has been ended'\n ]);\n }\n }\n \n }",
"function validateTaskId()\n {\n $taskId = (int) isset($_REQUEST['task_id']) ? $_REQUEST['task_id'] : null;\n if ($taskId <= 0 || $taskId > TASK_ID_RANGE) { return ERROR_INVALID_TASL_ID; }\n return $taskId;\n }",
"private function checkIsExists(): bool\n {\n $id = $this->readImproved([\n 'what' => [$this->table. '.id'],\n 'where' => [\n $this->table. '.listId' => $this->listId,\n $this->table. '.campaignId' => $this->campaignId,\n ]\n ]);\n\n return !is_null($id);\n }",
"private function checkIsExists(): bool\n {\n $where = [\n $this->table. '.vendorId' => $this->vendorId,\n $this->table. '.campaign' => $this->campaign,\n ];\n\n if (!is_null($this->id)) {\n $where[$this->table. '.id !='] = $this->id;\n }\n\n $id = $this->readImproved([\n 'what' => [$this->table. '.id'],\n 'where' => $where\n ]);\n\n return !is_null($id);\n }",
"public function isExists(): bool\n {\n return is_int($this->_jobId) && $this->_jobId > 0;\n }",
"public function testViewATaskThatExistsInTheStorage()\n {\n $data = factory(\\App\\Task::class)->create();\n\n $response = $this->get(\"{$this->TASKS_API_ENDPOINT}/{$data->id}\");\n $response->assertStatus(200)\n ->assertJson($data->toArray());\n }",
"private function _existsTask($name)\n\t{\n\t\tif(isset($this->_tasks[$name]))\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}",
"public function ensureTaskExists () {\n if (!$this->doesTaskExist()) {\n throw new \\InvalidArgumentException(\"Task doesn't exist: $this->task\");\n }\n }",
"function is_valid_new_user_task( $username, $task_id )\n{\n\t$valid_ids = false;\n\t\n\t$both_values_in_db = in_username_table( $username ) && in_task_table( $task_id );\n\t\n\tif( $both_values_in_db )\n\t{\n\t\tif( !exists_logs( $username, $task_id ) )\n\t\t{\n\t\t\t// only accept this username / task_id if no logs already exist for them\n\t\t\t$valid_ids = true;\n\t\t}\n\t}\n\t\n\treturn $valid_ids;\n}",
"abstract protected function checkIfInstanceOf($task);",
"static function timerExists($task = 'default') {\n\t\treturn (isset(self::$starttime[$task]));\n\t}",
"public function testRetrieveOneTask()\n {\n //Create task in database\n $task = $this->createAndPersistTask();\n\n $this->json('GET', $this->uri.$task->id)\n ->seeJsonStructure(\n ['id', 'name', 'done', 'priority', 'created_at', 'updated_at'])\n//TODO Needs Transformers to work: convert string to booelan and string to integer\n ->seeJsonContains([\n 'name' => $task->name,\n 'done' => $task->done,\n 'priority' => $task->priority,\n 'created_at' => $task->created_at,\n 'updated_at' => $task->updated_at,\n ]);\n }",
"function creationTask($oui, $nmTsk, $dbt, $f, $desc)\n\t{\t\t\t\n\t\t// We check taht the used entered the right parameters\n\t\tif (isset($nmTsk) && isset($dbt) && isset($f) && isset($desc))\n\t\t{\n\t\t\t // If yes, we recover those variables\n\t\t\t $id=$_SESSION['id'];\n\t\t\t \t\t \n\t\t $nomTask=str_replace(\"::;;::\",\"_\",$nmTsk);\t\t \n\t\t $desc1=str_replace(\"::;;::\",\"_\",$desc);\n\t\t $description=str_replace(\"\\n\",\"\",$desc1);\n\t\t \n\t\t $pattern=\"[^0-9]\";\n\t\t $fin=preg_replace($pattern,\" / / \",$f);\n\t\t $debut=preg_replace($pattern,\" / / \",$dbt);\n\t\t list($day, $month, $year) = split('[/.-]', $debut);\n\t\t list($dayf, $monthf, $yearf) = split('[/.-]', $fin);\n\t\t \n\t\t $debutok=checkdate($month, $day, $year);\n\t\t $finok=checkdate($monthf, $dayf, $yearf);\n\t\t \n\t\t /*All these tests are here the be sure the user will enter correct start and stop dates\n\t\t A user won't be able to enter de date which is older that the current date or a start date\n\t\t which is older than the stop date*/\n\t\t \n\t\t if(!$debutok || !$finok)\n\t\t\t\t\techo(\"Erreur dans la saisie des dates\");\n\t\t\t\t\telse {\n\t\t\t\t\tif(!$nomTask)\n\t\t\t\t\t\techo(\"Erreur, saisissez un nom de tache\");\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tif($year>$yearf)\n\t\t\t\t\t\t\t\techo(\"Erreur, l'annee de fin est anterieure a l'annee de debut\");\n\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\tif($year==$yearf && $month>$monthf)\n\t\t\t\t\t\t\t\t\t\techo(\"Erreur, le mois de fin est anterieur au mois de debut\");\n\t\t\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t\t\tif($month==$monthf && $day>$dayf)\n\t\t\t\t\t\t\t\t\t\t\t\techo(\"Erreur, le jour de fin est anterieur au jour de debut\");\n\t\t\t\t\t\t\t\t\t\t\t else {\n\t\t\t\t\t\t\t\t\t\t\t\t\tif($oui[0]<0){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif($year<date('Y',time()))\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\techo(\"Erreur, mauvaise annee saisie\");\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif($year==date('Y',time()) && $month<date('m',time()))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\techo(\"Erreur, mauvais mois saisi\");\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif($month==date('m',time()) && $day<date('d',time()))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\techo(\"Mauvais jour saisi\");\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$idTask = rand(0, 1000000);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//We concatenate\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$champs=$idTask . \"::;;::\" . $id . \"::;;::\" . $nomTask . \"::;;::\" . $debut . \"::;;::\" . $fin . \"::;;::\" . $description . \"\\n\";\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//We put it in the right format\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$fin=$yearf.$monthf.$dayf;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//We write it in the file\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tinsertionFichier($fin, $champs, \"task.txt\");\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\theader(\"Location:nouvelleTache.php\");\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$champs=$oui[0] . \"::;;::\" . $oui[1] . \"::;;::\" . $nomTask . \"::;;::\" . $debut . \"::;;::\" . $fin . \"::;;::\" . $description . \"\\n\";\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$fin=$yearf.$monthf.$dayf;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tinsertionFichier($fin, $champs, \"task.txt\");\n\t\t\t\t\t\t\t\t\t\t\t\t\t\theader('Location:modifierTache.php?action=modif&value='.$oui[0]);\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\techo(\"Erreur lors de la recuperration des variables de session\");\n\t\t}\t\n\t}",
"function is_task_id($task_id) {\n return preg_match('/^'.IA_RE_TASK_ID.'$/xi', $task_id) &&\n strlen($task_id) < 64;\n}",
"function checkExists($pid, &$token, &$tstamp, $email){\n\tinclude \"apiconstants.php\";\n\n\t// Check the life of the token and renew if necessary.\n\t$token = getToken($token, $tstamp);\n\n\t// Get Checkouts from API\n\t$getPatronURL = $apiurl.\"patrons/{$pid}\";\n\n\t$ch = curl_init($getPatronURL);\n\tcurl_setopt_array($ch,array(\n\t\t\tCURLOPT_HTTPGET => TRUE,\n\t\t\tCURLOPT_RETURNTRANSFER => TRUE,\n\t\t\tCURLOPT_HTTPHEADER => array(\n\t\t\t\t\t'Host: '.$hosturl,\n\t\t\t\t\t'Authorization: Bearer '.$token,\n\t\t\t\t\t'User-Agent: '.$appname,\n\t\t\t\t\t'X-Forwarded-For: '.$webserver\n\t\t\t)\n\t));\n\n\t$response = curl_exec($ch);\n\n\tif($response === FALSE){\n\t\techo date(\"Y-m-d H:i:s\").\" \".curl_error($ch).\"\\n\";\n\t\treturn false;\n\t}\n\n\t$data = json_decode($response, true);\n\tif(is_null($data)){\n\t\techo date(\"Y-m-d H:i:s\").\" Response is null.\\n\";\n\t\treturn false;\n\t}\n\t\n\t// Parse response - echoed for debugging\n\tif(curl_getinfo($ch,CURLINFO_HTTP_CODE) == 404){\n\t\t// Set isActive to -1\n\t\tinclude \"connect.php\";\n\n\t\t// Set isActive to -1 for current patron id\n\t\t$query = \"UPDATE autorenew.patrons SET isActive = -1 WHERE recordnum={$pid} > 0\";\n\t\t$query = $mysqli->real_escape_string($query);\n\t\t$result = $mysqli->query($query);\n\t\treturn false;\n\t}\n\telse\n\t{\n\t\treturn true;\n\t}\n}",
"function checkRequestIfExist($requestID) {\n\t\t$sqlQuery = \"SELECT COUNT(request_id) AS request_count\n FROM request_t\n WHERE request_id = $requestID\";\n\t\t$requestCount = sqlExcuteScaler($sqlQuery);\n\t\tif((int)$requestCount >= 1){\n\t\t\treturn true;\n\t\t}\n\t\telse{\n\t\t\treturn false; \n\t\t}\n\t}",
"private function _checkId($id) {\n\t\tif(!id) {\n\t\t\tthrow new NotFoundException(__('Invalid task.'));\n\t\t}\n\t\t\n\t\t$task = $this->Task->findById($id);\n\t\tif(!$task) {\n\t\t\tthrow new NotFoundException(__('Invalid task'));\n\t\t}\n\t}",
"public function api_call_task_test() {\n $task = required_param('taskname', PARAM_TEXT);\n\n $cron = new cron();\n if (is_callable(array($cron, $task))) {\n $cron->$task();\n } else {\n echo 'NOT_EXISTS';\n }\n die();\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get title for domainselector menu | private function _getDomainselectorTitle()
{
if ($this
->_getDomainselectorService()
->getSelected() === null
) {
$text = 'nav.topmenu.nodomain';
} else {
$text = $this
->_getDomainselectorService()
->getSelected()
->getDomain();
}
return $text;
} | [
"public function getMenuTitle();",
"protected static function menuTitle() {\n\t\treturn self::pw('pages')->get('pw_template=iio')->parent()->title;\n\t}",
"public function getMenuTitle(): mixed\n {\n return $this->getField('Title');\n }",
"public function MenuTitle() {\n\t\treturn $this->Name();\n\t}",
"public function getMenuTitle()\r\n {\r\n return $this->menuTitle;\r\n }",
"public function MenuTitle(){\r\n\t\treturn $this->Name;\r\n\t}",
"public function getTitle()\n {\n \tif ($this->getMenu()) {\n\t \treturn $this->getMenu()->getName();\n \t}\n\n \treturn '';\n }",
"public function title()\n {\n if ($this->title === null) {\n $ident = $this->ident();\n $metadata = $this->adminSecondaryMenu();\n\n $this->title = '';\n\n if (isset($metadata[$ident]['title'])) {\n $this->setTitle($metadata[$ident]['title']);\n }\n }\n\n return $this->title;\n }",
"public function title()\n {\n if ($this->title === null) {\n $ident = $this->ident();\n $metadata = $this->adminSidemenu();\n\n $this->title = '';\n\n if (isset($metadata[$ident]['title'])) {\n $this->setTitle($metadata[$ident]['title']);\n }\n }\n\n return $this->title;\n }",
"public function get_title()\n {\n if ($this->debug > 0) { error_log('In scorm::get_title() method', 0); }\n $title = '';\n if (isset($this->manifest['organizations']['default'])) {\n $title = $this->organizations[$this->manifest['organizations']['default']]->get_name();\n } elseif (count($this->organizations)==1) {\n // This will only get one title but so we don't need to know the index.\n foreach($this->organizations as $id => $value) {\n $title = $this->organizations[$id]->get_name();\n break;\n }\n }\n return $title;\n }",
"public function getTitle() {\n $config = \\Drupal::config('sitemap.settings');\n return $config->get('page_title');\n }",
"public function getTitleinmenu() {\n\t\t\t\tif ($this->isRoot()) return \"Base\";\n\t\t\t\telse return parent::getTitleinmenu();\n\t\t}",
"protected function getMenuTitle(): string\n\t{\n\t\treturn \\esc_html__('%menu_title%', 'eightshift-libs');\n\t}",
"public function namespaceToMenuTitle(){\n\n return apply_filters( $this->filter_prefix . '_menu_title', $this->namespaceToString(), $this->namespace );\n\n }",
"function hypha_getTitle() {\n\t\tglobal $hyphaXml;\n\t\treturn getInnerHtml($hyphaXml->getElementsByTagName('title')->Item(0));\n\t}",
"public function getTitle() {\n\t\treturn Template::getSiteTitle();\n\t}",
"public function getTitle() {\n\t\t$title = $this->title;\n\t\tif (!$title) {\n\t\t\tglobal $CONFIG;\n\t\t\t$title = $CONFIG->widgets->handlers[$this->handler]->name;\n\t\t}\n\t\treturn $title;\n\t}",
"public function siteTitle() {\r\n return $this->_siteTitle;\r\n }",
"public function showSiteName();"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns shipping address search layout config. | private function getAddressSearchLayoutConfig(): array
{
return [
'children' => [
'addressDefault' => [
'component' => 'Magento_CheckoutAddressSearchGiftRegistry/js/view/shipping-address/default'
],
'selectShippingAddressModal' => [
'children' => [
'searchShippingAddress' => [
'component' =>
'Magento_CheckoutAddressSearch/js/view/shipping-address/ui-select'
]
]
]
]
];
} | [
"public function getShippingAddressConfig()\n {\n return json_decode($this->scopeConfig->getValue(\n self::SHIPPING_ADDRESS_GRID,\n \\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE\n ));\n }",
"public function getAddressLayout()\n {\n return self::ADDRESS_LAYOUT;\n }",
"private function getRecipientAddressLayoutConfig(): array\n {\n return [\n 'children' => [\n 'recipientAddress' => [\n 'component' =>\n 'Magento_CheckoutAddressSearchGiftRegistry/js/view/shipping-address/recipientAddress',\n 'displayArea' => 'before-form'\n ]\n ]\n ];\n }",
"function getShippingAddress() {\n\n $address_array = $this->getField('addressbook');\n\n foreach ( $address_array as $address ) {\n\n if ( $address->getField('defaultShipping') == \"true\" ) {\n\n return $address;\n\n }\n\n }\n\n }",
"public function getConfig()\n {\n return $this->_addressConfig;\n }",
"public function getCheckoutAddressSetting()\n {\n if ($this->getStoreConfig('simiconnector/hideaddress/hideaddress_enable') != '1') {\n return null;\n }\n\n $addresss = ['company', 'street', 'country_id', 'region_id', 'city', 'zipcode',\n 'telephone', 'fax', 'prefix', 'suffix', 'dob', 'gender', 'taxvat'];\n\n foreach ($addresss as $address) {\n $path = \"simiconnector/hideaddress/\" . $address;\n $value = $this->getStoreConfig($path);\n if (!$value || $value == null || !isset($value)) {\n $value = 3;\n }\n\n $address .= '_show';\n if ($value == 1) {\n $data[$address] = \"req\";\n } elseif ($value == 2) {\n $data[$address] = \"opt\";\n } elseif ($value == 3) {\n $data[$address] = \"\";\n }\n }\n\n // address default value\n $address_default = ['street', 'country_id', 'region_id', 'city', 'zipcode', 'telephone'];\n foreach ($address_default as $address_key) {\n $path = \"simiconnector/hideaddress/\" . $address_key . \"_default\";\n $value = $this->getStoreConfig($path);\n $data[$address_key . '_default'] = $value;\n }\n\n //sample add custom address fields\n $data['custom_fields'] = [];\n /*\n //text field\n $data['custom_fields'][] = ['code' => 'text_field_sample',\n 'title' => 'Text Field',\n 'type' => 'text',\n 'position' => '7',\n ];\n //number field\n $data['custom_fields'][] = ['code' => 'number_field_sample',\n 'title' => 'Number Field',\n 'type' => 'number',\n 'position' => '8',\n ];\n //single choice Option\n $data['custom_fields'][] = ['code' => 'single_option_sample',\n 'title' => 'Sample Field Single Option',\n 'type' => 'single_option',\n 'option_array' => ['Option Single 1', 'Option Single 2', 'Option Single 3'],\n 'position' => '9',\n ];\n //multi choice Option\n $data['custom_fields'][] = ['code' => 'multi_option_sample',\n 'title' => 'Sample Field Multi Option',\n 'type' => 'multi_option',\n 'option_array' => ['Option Multi 1', 'Option Multi 2'\n , 'Option Multi 3', 'Option Multi 4', 'Option Multi 5'],\n 'separated_by' => '%',\n 'position' => '10',\n ];\n */\n return $data;\n }",
"public function getShippingAddress();",
"private function getBillingAddressConfig()\n {\n if ($billingAddress = $this->helper->getBillingAddressConfig()) {\n return $billingAddress;\n }\n\n return $this->helper->getDefaultAddressConfig();\n }",
"public function defaultSearchAddress() {\n $SearchAddress = array(\n 'Street' => '', // Street name\n 'HouseNo' => '', // House number\n 'ZipCode' => '', // Zip code of a city\n 'City' => '', // City name\n 'Country' => '', // Possible Values: Alpha3, Alpha2, ISO3166, Country name\n // Example: DEU, DE, 276, Deutschland\n );\n\n return $SearchAddress;\n }",
"function envira_get_layout_config( $layout ) {\n\n\t$layouts = envira_get_layouts();\n\n\treturn $layouts[ $layout ]['config'];\n}",
"public function getShippingAddress()\n {\n return $this->getAddress('shipping');\n }",
"public function shippingAddress()\r\n\t{\r\n\t\t$details = $this->details();\r\n\t\treturn $details->address . ' ' . $details->addressb . ', ' . $details->city;\r\n\t}",
"public function getShippingAddressIndicator()\n {\n return $this->getParameter('shippingAddressIndicator');\n }",
"public function getCheckoutAddressSetting() \n {\n if (!Mage::getStoreConfig('simiconnector/hideaddress/hideaddress_enable'))\n return NULL;\n $addresss = array('company', 'street', 'country_id', 'region_id', 'city', 'zipcode',\n 'telephone', 'fax', 'prefix', 'suffix', 'dob', 'gender', 'taxvat');\n foreach ($addresss as $address) {\n $path = \"simiconnector/hideaddress/\" . $address;\n $value = Mage::getStoreConfig($path);\n if (!$value || $value == null || !isset($value))\n $value = 3;\n $address.='_show';\n if ($value == 1)\n $data[$address] = \"req\";\n else if ($value == 2)\n $data[$address] = \"opt\";\n else if ($value == 3)\n $data[$address] = \"\";\n }\n\n /*\n //sample add custom address fields\n $data['custom_fields'] = array();\n //text field\n $data['custom_fields'][] = array('code' => 'text_field_sample',\n 'title' => 'Text Field',\n 'type' => 'text',\n 'required' => 'opt',\n 'position' => '7',\n );\n //number field\n $data['custom_fields'][] = array('code' => 'number_field_sample',\n 'title' => 'Number Field',\n 'type' => 'number',\n 'required' => 'req',\n 'position' => '8',\n );\n //single choice Option\n $data['custom_fields'][] = array('code' => 'single_option_sample',\n 'title' => 'Sample Field Single Option',\n 'type' => 'single_option',\n 'required' => '',\n 'option_array' => array('Option Single 1', 'Option Single 2', 'Option Single 3'),\n 'position' => '9',\n );\n //multi choice Option\n $data['custom_fields'][] = array('code' => 'multi_option_sample',\n 'title' => 'Sample Field Multi Option',\n 'type' => 'multi_option',\n 'required' => 'opt',\n 'option_array' => array('Option Multi 1', 'Option Multi 2', 'Option Multi 3', 'Option Multi 4', 'Option Multi 5'),\n 'separated_by' => '%',\n 'position' => '10',\n );\n */\n return $data;\n }",
"public function shipping_option()\n\t{\n\t\treturn $this->shipping_info('shipping_option');\n\t}",
"public function getShippingAddressOptions(AbstractAddress $address): AddressOptionModel;",
"public static function shippingStreetAddress()\n {\n return new TextNode('shipping_street_address');\n }",
"public function getShipmentAddress() {\n if(is_null($this->_shipmentAddress) && $this->getId()) {\n $shipmentAddress = Mage::getModel('synergeticagency_gls/shipment_address')->loadByGlsShipmentId($this->getId());\n if($shipmentAddress && $shipmentAddress->getId()) {\n $this->_shipmentAddress = $shipmentAddress;\n }\n }\n return $this->_shipmentAddress;\n }",
"public function shippingAddress()\n {\n return $this->hasOne(CartAddress::class, 'cart_id')->whereType('shipping');\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Checks an array for HumanName::is_suffix($piece) | private function are_suffixes($pieces) {
foreach ($pieces as $piece) {
if (!$this->is_suffix($piece)) {
return false;
}
}
return true;
} | [
"public function suffix($s = '') {\n\t\t$info = $this->isVariation(parent::get('basename')); \n\t\tif(strlen($s)) {\n\t\t\treturn $info ? in_array($s, $info['suffix']) : false;\n\t\t} else {\n\t\t\treturn $info ? $info['suffix'] : array();\n\t\t}\n\t}",
"public function hasSuffix()\r\n {\r\n return is_int($this->suffix);\r\n }",
"public function hasSuffix() {\n return $this->suffix != null;\n }",
"public function testSuffix() {\n\t\t\t$result = suffix( '11_4' );\n\t\t\t$expected = 4;\n\t\t\t$this->assertEqual( $result, $expected, var_export( $result, true ) );\n\n\t\t\t$result = suffix( '11_4.2', '.' );\n\t\t\t$expected = 2;\n\t\t\t$this->assertEqual( $result, $expected, var_export( $result, true ) );\n\n\t\t\t$result = suffix( '11+4', '+' );\n\t\t\t$expected = '4';\n\t\t\t$this->assertEqual( $result, $expected, var_export( $result, true ) );\n\n\t\t\t$result = suffix( '12+-+5', '+-+' );\n\t\t\t$expected = '5';\n\t\t\t$this->assertEqual( $result, $expected, var_export( $result, true ) );\n\t\t}",
"function str_has_suffix(string $haystack, string $needle): bool {\n return mb_strpos($haystack, $needle) === mb_strlen($haystack) - mb_strlen($needle);\n }",
"public static function isValidSuffix($suffix)\n {\n return in_array($suffix, self::$validSuffix, true);\n }",
"public function hasSuffix(): bool\n {\n return false !== strpos($this->getVersion(), '-');\n }",
"function endsWith(string $suffix)\n {\n if (!$suffix) return false;\n $suffix_len = (strlen($suffix) * -1);\n if (substr($this->str,$suffix_len) == $suffix) return true;\n return false;\n }",
"public function getSuffix();",
"public static function assertStringEndsNotWith($suffix, $string, $message = '') {}",
"function zuhaus_mikado_filter_suffix( $value, $suffix ) {\n\t\tif ( $value !== '' && zuhaus_mikado_string_ends_with( $value, $suffix ) ) {\n\t\t\t$value = substr( $value, 0, strpos( $value, $suffix ) );\n\t\t}\n\t\t\n\t\treturn $value;\n\t}",
"public function getSuffix() {}",
"public function endsWith($suffix)\n {\n $suffix = $this->toValue($suffix);\n $expectedPosition = mb_strlen($this->value) - mb_strlen($suffix);\n return mb_strrpos($this->value, $suffix) === $expectedPosition;\n }",
"public function endsWithMatches()\n {\n $nonSuffix = null;\n $this->assertTrue(S::endsWith('bah', 'h', $nonSuffix));\n $this->assertSame('ba', $nonSuffix);\n }",
"public static function endsWith($value, $suffix)\n {\n return ($suffix == substr($value, -strlen($suffix))) ? true : false;\n }",
"public static function assertStringEndsWith(string $suffix, string $string, string $message = ''): \\void {}",
"function ends_with($str, $suffix)\n{\n return substr($str, strlen($str) - strlen($suffix)) == $suffix;\n}",
"public function testEndsWithReturnsFalseIfTheStringDoesNotContainTheSuffix()\n {\n $result = StringUtil::endsWith('this is a test string', 'demo');\n $this->assertFalse($result);\n }",
"public function setSuffix(string $suffix);"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set the consumer key | protected function setConsumerKey($key ) {
$this->consumerKey = $key;
} | [
"public function setConsumerKey($consumer_key);",
"public function setConsumerKey($value)\n {\n return $this->set('ConsumerKey', $value);\n }",
"public function setConsumerKey($consumerKey) {\n $this->_consumerKey = (string) $consumerKey;\n return $this;\n }",
"public static function setConsumerKey($key, $secret)\n {\n self::$_oauth_consumer_key = $key;\n self::$_oauth_consumer_secret = $secret;\n }",
"private function _setConsumerToken()\n {\n // Url encode the consumer_key and consumer_secret in accordance with RFC 1738\n $encoded_consumer_key = urlencode($this->_consumer_key);\n $encoded_consumer_secret = urlencode($this->_consumer_secret);\n\n $this->_consumer_token = base64_encode($encoded_consumer_key .':'. $encoded_consumer_secret);\n }",
"public function getConsumerKey();",
"public function setKey($key)\n {\n $this->clientKey = $key;\n }",
"public function getConsumerKey()\r\n {\r\n return $this->_consumerKey;\r\n }",
"public function setConsumerSecret($consumer_secret);",
"public function setProviderKey($providerKey) {}",
"function SetKey($strKey) {\n $this->merchantInfo->enckey = $strKey;\n }",
"public function set_key($key) {\r\n\t\t$this->encryption_key = $key;\r\n\t}",
"public function getConsumerKey(): string\n {\n return $this->consumerKey;\n }",
"public function set_key($key)\n {\n $this->_key = $_key;\n }",
"public function setAuthKey();",
"public function SetKey($key = ''){\n \tself::$userKey = $key;\n }",
"public function setKey (string $key) : void;",
"public function setServiceKey($key);",
"public function setApplicationKey($key)\r\n {\r\n $this->application_key = $key;\r\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set number of neigbours | public function setNeighbours($value)
{
$this->neighbours = $value;
} | [
"public function setInputNeurons( $count ) {\n\t\t$this->neuronCount = $count;\n\t}",
"public function setIters($n) {\n $this->iters = $n;\n }",
"public function setNetworkCount() {\n\t\t// Count attached nodes for this network\n\t\tforeach ($this -> getNetworks() as $network_id => $network) {\n\t\t\t$i = 0;\n\t\t\tforeach ($this -> getNodes() as $node) {\n\t\t\t\tforeach ($node -> getEthernets() as $interface) {\n\t\t\t\t\tif ($interface -> getNetworkId() === $network_id) {\n\t\t\t\t\t\t$i++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t$network -> setCount($i);\n\t\t}\n\t}",
"function setNumberOfRelaySwimmers($cnt)\n {\n $this->_number_of_relay_swimmers = $cnt ;\n }",
"public function setcount()\n\t\t{\n\t\t\t$this->count = $this->count + 1;\n\t\t}",
"function setNrOfUnmeasuredInnerRings($value)\n\t{\n\t\t$this->nrOfUnmeasuredInnerRings = $value;\n\t}",
"public function setNb($nb)\n\t{\n\t\t$this->nb = $nb;\n\t}",
"function setPlayCount($n) {\n\t\t\tglobal $sql_type,$sql_pw,$sql_usr,$sql_socket,$sql_db;\n\t\t\t\n\t\t\tif (!(is_int($n) || is_numeric($n))) {\n\t\t\t\treturn false;\n\t\t\t}\n $path = jz_db_escape($this->getPath(\"String\"));\n jz_db_simple_query(\"UPDATE jz_nodes SET playcount = $n WHERE path = '$path'\");\n\t\t}",
"protected function setNbSeats(int $nbSeats): void{\n $this->nbSeats = $nbSeats;\n }",
"function setNumberOfPages(){\n $this->pages = ceil($this->getTotal()/$this->getPerPage());\n }",
"function setImageCount($value)\n \t{\n \t\t$this->_imageCount = intval($value);\n \t}",
"public function setSearchNdots(int $ndots): void {}",
"public function setN($value)\n {\n return $this->set(self::N, $value);\n }",
"function setDownloadCount($n) {\n\t\t\tglobal $sql_type,$sql_pw,$sql_usr,$sql_socket,$sql_db;\n\t\t\t\n\t\t\tif (!(is_int($n) || is_numeric($n))) {\n\t\t\t\treturn false;\n\t\t\t}\n $path = jz_db_escape($this->getPath(\"String\"));\n jz_db_simple_query(\"UPDATE jz_nodes SET dlcount = $n WHERE path = '$path'\");\n\t\t}",
"public abstract function setNumberOfPointsToDeterminClusters($numberOfPoints);",
"public function setDetectionCount(?int $value): void {\n $this->getBackingStore()->set('detectionCount', $value);\n }",
"public function testSetNbSeances() {\n\n $obj = new ActionsCoManif();\n\n $obj->setNbSeances(10);\n $this->assertEquals(10, $obj->getNbSeances());\n }",
"public function setColorCount(int $number): void {\n $this->colorCount = $number;\n }",
"public function set_num_links($num_links)\n\t{\n\t\t$this->_num_links = intval($num_links);\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Assert that the given text is present within the selector. | public function assertSeeIn( $selector, $text ) {
$full_selector = $this->resolver->format( $selector );
$element = $this->resolver->findOrFail( $selector );
PHPUnit::assertTrue(
Str::contains( $element->getText(), $text ),
"Did not see expected text [{$text}] within element [{$full_selector}]."
);
return $this;
} | [
"public function assertElementContainsText($selector, $text)\n {\n $this->browse(function (Browser $browser) use ($selector, $text) {\n $browser->assertSeeIn($selector, $text);\n });\n }",
"public function elementHavingSelectorLocatorShouldHavePartialTextAs($selector, $locator, $text)\n {\n // TODO: Implement this step\n throw new PendingException();\n }",
"public function elementHavingSelectorLocatorShouldHaveTextAs($selector, $locator, $text)\n {\n $this->convertSelectorAndLocator($selector, $locator);\n $this->assertSession()->elementTextEquals($selector, $locator, $text);\n }",
"public function assertPageContainsText($text)\n {\n $found = false;\n $this->getClient()->getCrawler()->filter('*')->each(function($element) use ($text, &$found) {\n if(strpos($element->text(), $text) !== false) {\n $found = true;\n return false;\n }\n return true;\n });\n\n if(!$found) {\n throw new AssertionFailedError(sprintf('%s not found in any node', $text));\n }\n }",
"public function assertElementContains(string $selector, string $text, ?int $nthMatch = null)\n {\n $elements = $this->crawler()->filter($selector);\n $matched = false;\n $pattern = $this->getEscapedPattern($text);\n\n if (!is_null($nthMatch)) {\n $elements = $elements->eq($nthMatch - 1);\n }\n\n foreach ($elements as $element) {\n $element = new Crawler($element);\n if (preg_match(\"/$pattern/i\", $element->html())) {\n $matched = true;\n break;\n }\n }\n\n PHPUnit::assertTrue(\n $matched,\n 'Unable to find element of selector: ' . PHP_EOL . PHP_EOL .\n ($nthMatch ? (\"at position {$nthMatch}\" . PHP_EOL . PHP_EOL) : '') .\n \"[{$selector}]\" . PHP_EOL . PHP_EOL .\n 'containing text' . PHP_EOL . PHP_EOL .\n \"[{$text}]\" . PHP_EOL . PHP_EOL .\n 'within' . PHP_EOL . PHP_EOL .\n \"[{$this->getContent()}].\"\n );\n\n return $this;\n }",
"public function assertElementContainsText($element, $text)\n {\n $this->assertSession()->elementTextContains('css', $element, $this->fixStepArgument($text));\n }",
"public function testContains()\n {\n $this->assertFalse(StringHelper::contains($this->text,'Test'));\n $this->assertFalse(StringHelper::contains($this->text,''));\n $this->assertTrue(StringHelper::contains($this->text,'as survived not only f'));\n $this->assertFalse(StringHelper::contains($this->text,array()));\n $this->assertFalse(StringHelper::contains($this->text,array('-','+','=')));\n $this->assertTrue(StringHelper::contains($this->text,array('versions','essentially','...')));\n }",
"public function assertPageContainsText($text)\n {\n expect($this->getCurrentPage())->toHaveContent($text);\n }",
"public function assertSeeAnythingIn( $selector ) {\n\t\t$full_selector = $this->resolver->format( $selector );\n\n\t\t$element = $this->resolver->findOrFail( $selector );\n\n\t\tPHPUnit::assertTrue(\n\t\t\t$element->getText() !== '',\n\t\t\t\"Saw unexpected text [''] within element [{$full_selector}].\"\n\t\t);\n\n\t\treturn $this;\n\t}",
"function z_is_exist_with_inner_text($text,$exactly)\n\t{\n\t\tif ($this->call(\"$this->prefix.IsExistsWithInnerText?text=\".urlencode($text).\"&exactly=\".urlencode($exactly))==\"true\")\n\t\t\treturn true;\n\t\telse\n\t\t\treturn false;\n\t}",
"public function assertPageContainsText($text) {\n\t\t$this->assertSession()->pageTextContains($this->_fixStepArgument($text));\n\t}",
"public function assertSeeAnythingIn($selector)\n {\n $fullSelector = $this->resolver->format($selector);\n\n $element = $this->resolver->findOrFail($selector);\n\n PHPUnit::assertTrue(\n $element->getText() !== '',\n \"Saw unexpected text [''] within element [{$fullSelector}].\"\n );\n\n return $this;\n }",
"public function assertPageContainsText($text)\n {\n $this->assertSession()->pageTextContains($this->fixStepArgument($text));\n }",
"public function assertElementContainsText($element, $text, $message='') {\r\n\t\t$this->getHelperAssert()->assertElementContainsText($element, $text, $message);\r\n\t}",
"public function assertPageContainsText($text)\n {\n $this->browse(function (Browser $browser) use ($text) {\n $browser->assertSee($text);\n });\n }",
"public function waitForTextIn( $selector, $text, $seconds = null ) {\n\t\t$message = 'Waited %s seconds for text \"' . $text . '\" in selector ' . $selector;\n\n\t\treturn $this->waitUsing(\n\t\t\t$seconds,\n\t\t\t100,\n\t\t\tfunction () use ( $selector, $text ) {\n\t\t\t\treturn $this->assertSeeIn( $selector, $text );\n\t\t\t},\n\t\t\t$message\n\t\t);\n\t}",
"public function elementHavingSelectorLocatorShouldNotHaveTextAs($selector, $locator, $text)\n {\n $this->convertSelectorAndLocator($selector, $locator);\n $this->assertSession()->elementTextNotEquals($selector, $locator, $text);\n }",
"public function selectByPartialText($text)\n\t{\n\t\t$options = $this->_element->findElements(By::xPath(\".//option[contains(text(), '\" . $text . \"')]\"));\n\n\t\t$matched = false;\n\t\tforeach($options as $option)\n\t\t{\n\t\t\tif(!$option->isSelected())\n\t\t\t{\n\t\t\t\t$option->click();\n\t\t\t}\n\n\t\t\t$matched = true;\n\t\t}\n\n\t\tif (!$matched)\n\t\t{\n\t\t\tthrow new \\Exception(\"Cannot locate option in select element with text: \" . $text);\n\t\t}\n\t}",
"public function theElementShouldExist($selector) {\n $this->assertSession()->elementExists('css', $selector);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check if any of the UriContexts in the stack contain the given auto route. | public function containsAutoRoute(AutoRouteInterface $autoRoute)
{
foreach ($this->uriContexts as $uriContext) {
if ($autoRoute === $uriContext->getAutoRoute()) {
return true;
}
}
return false;
} | [
"public function hasCurrentRoute();",
"public function areRoutesDefined(): bool;",
"abstract public function hasRoutes();",
"public function hasRoute(): bool;",
"protected function routeExists()\n {\n return $this->route !== null;\n }",
"public function routeExist()\n {\n return (bool) count($this->routes);\n }",
"public function hasRoutes ()\n {\n return (count($this->routes) > 0);\n }",
"public function hasRoutes()\r\n {\r\n return count($this->routes) > 0;\r\n }",
"public function isRouteActive(): bool;",
"public static function hasRoute(): bool\n {\n return self::$route != null;\n }",
"public function hasRoute()\n {\n return !empty($this->route);\n }",
"public function has ( $route ) : bool;",
"public function has(string $route): bool;",
"public function isRoute($routes);",
"protected function isActiveByRoutesParts()\r\n {\r\n if (!$this->routes_parts) return false;\r\n\r\n $route_name = request()->route()->getName();\r\n\r\n foreach ($this->routes_parts as $group) {\r\n\r\n if (strpos($route_name, $group) !== false) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n }",
"public function isUsed()\n {\n return isset($this->route);\n }",
"function if_route($routeNames)\n {\n return app('active')->checkRoute($routeNames);\n }",
"final public function isRouteCatchAll():bool\n {\n $route = $this->route();\n $catchAll = $route::getConfig('catchAll') ?? false;\n $routeSegment = $this->routeSegment();\n return $catchAll === true && !empty($routeSegment);\n }",
"public function hasRoutes()\r\n {\r\n return count($this->routes) ? true : false;\r\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get stylesheets to include in editmode Strings will be directly included, RouteReferenceInterface objects are used to generate an URL through the router. | function getEditmodeCssPaths() ; | [
"public function getStyleSheetURL();",
"protected function getStylesheet() : string {}",
"public function getStyleSheet();",
"public function getStylesheets();",
"private function loadResources()\n {\n $resources = '<link rel=\"stylesheet\" type=\"text/css\" href=\"' .\n '/typo3conf/ext/frontend_editing/Resources/Public/Css/Main.css\" />';\n $resources .= '<link rel=\"stylesheet\" type=\"text/css\" href=\"' .\n '/typo3conf/ext/frontend_editing/Resources/Public/Javascript/toastr/build/toastr.min.css\" />';\n $resources .= '<link rel=\"stylesheet\" type=\"text/css\" href=\"' .\n '/typo3conf/ext/frontend_editing/Resources/Public/Javascript/alertify.js/src/css/alertify.css\" />';\n $resources .= '<link rel=\"stylesheet\" type=\"text/css\" href=\"' .\n '/typo3conf/ext/frontend_editing/Resources/Public/Javascript/lity/dist/lity.min.css\" />';\n $resources .= '<script src=\"typo3/sysext/core/Resources/Public/JavaScript/Contrib/jquery/jquery-' .\n PageRenderer::JQUERY_VERSION_LATEST . '.min.js\" type=\"text/javascript\"></script>';\n $resources .= '<script type=\"text/javascript\" src=\"' .\n '/typo3conf/ext/frontend_editing/Resources/Public/Javascript/ckeditor/ckeditor.js\"></script>';\n $resources .= '<script type=\"text/javascript\" src=\"' .\n '/typo3conf/ext/frontend_editing/Resources/Public/Javascript/ckeditor/adapters/jquery.js\"></script>';\n $resources .= '<script type=\"text/javascript\" src=\"' .\n '/typo3conf/ext/frontend_editing/Resources/Public/Javascript/toastr/build/toastr.min.js\"></script>';\n $resources .= '<script type=\"text/javascript\" src=\"' .\n '/typo3conf/ext/frontend_editing/Resources/Public/Javascript/immutable/dist/immutable.min.js\"></script>';\n $resources .= '<script type=\"text/javascript\" src=\"' .\n '/typo3conf/ext/frontend_editing/Resources/Public/Javascript/lity/dist/lity.min.js\"></script>';\n\n return $resources;\n }",
"private function _addCss() {\r\n JHtml::styleSheet( Sh404sefHelperGeneral::getComponentUrl() . '/assets/css/editurl.css');\r\n }",
"public function get_stylesheet_urls() {\n global $CFG;\n\n // We need to tell the CSS that is being included (for example the standard\n // theme CSS) which theme it is being included for. Prepare the necessary param.\n $param = '?for=' . $this->name;\n\n // Stylesheets, in order (standard, parent, this - some of which may be the same).\n $stylesheets = array();\n if ($this->name != 'standard' && $this->standardsheets) {\n $stylesheets[] = $CFG->httpsthemewww . '/standard/styles.php' . $param;\n }\n if (!empty($this->parent)) {\n $stylesheets[] = $CFG->httpsthemewww . '/' . $this->parent . '/styles.php' . $param;\n }\n $stylesheets[] = $CFG->httpsthemewww . '/' . $this->name . '/styles.php' . $param;\n\n // Additional styles for right-to-left languages, if applicable.\n if (right_to_left()) {\n $stylesheets[] = $CFG->httpsthemewww . '/standard/rtl.css';\n\n if (!empty($this->parent) && file_exists($CFG->themedir . '/' . $this->parent . '/rtl.css')) {\n $stylesheets[] = $CFG->httpsthemewww . '/' . $this->parent . '/rtl.css';\n }\n\n if (file_exists($this->dir . '/rtl.css')) {\n $stylesheets[] = $CFG->httpsthemewww . '/' . $this->name . '/rtl.css';\n }\n }\n\n // If the theme wants pluginsheets, get them included in the first (most\n // general) stylesheet we are including. That is, process them with the\n // standard CSS if we are using that, else with the parent CSS, else with\n // our own CSS.\n if (!empty($this->pluginsheets)) {\n $stylesheets[0] .= '&pluginsheets=1';\n }\n\n return $stylesheets;\n }",
"public function renderStylesheets() { }",
"function presscore_get_admin_dynamic_stylesheets_list() {\n\t\treturn array(\n\t\t\t'the7-admin-custom' => array(\n\t\t\t\t'src' => 'admin-custom.less',\n\t\t\t),\n\t\t);\n\t}",
"public function edit_css()\n {\n $file = $this->file;\n\n if (get_option('editarea') == '1') {\n attach_to_screen_footer(make_string_tempcode('\n <script language=\"javascript\" src=\"' . get_base_url() . '/data/editarea/edit_area_full.js\"></script>\n <script>// <![CDATA[\n editAreaLoader.init({\n id : \"css\"\n ,syntax: \"css\"\n ,start_highlight: true\n ,language: \"' . (file_exists(get_file_base() . '/data/editarea/langs/' . strtolower(user_lang())) ? strtolower(user_lang()) : 'en') . '\"\n ,allow_resize: true\n ,toolbar: \"search, go_to_line, fullscreen, |, undo, redo, |, select_font,|, reset_highlight, word_wrap\"\n });\n //]]></script>')); // XHTMLXHTML\n }\n\n require_javascript('ajax');\n\n $theme = get_param_string('theme', '');\n if ($theme == '') {\n return $this->choose_theme($this->title);\n }\n\n $url = build_url(array('page' => '_SELF', 'type' => '_edit_css', 'file' => $file), '_SELF');\n\n $path = get_custom_file_base() . '/themes/' . filter_naughty($theme) . '/css_custom/' . $file;\n if (!file_exists($path)) {\n $path = get_custom_file_base() . '/themes/' . filter_naughty($theme) . '/css/' . $file;\n }\n if (!file_exists($path)) {\n $path = get_custom_file_base() . '/themes/default/css_custom/' . $file;\n }\n if (!file_exists($path)) {\n $path = get_file_base() . '/themes/default/css/' . $file;\n }\n if (file_exists($path)) {\n $css = unixify_line_format(cms_file_get_contents_safe($path));\n } else {\n $css = '';\n }\n\n if (addon_installed('actionlog')) {\n require_code('revisions_engine_files');\n $revision_engine = new RevisionEngineFiles();\n $revision_loaded = mixed();\n $revisions = $revision_engine->ui_revision_undoer('themes/' . $theme . '/css_custom', basename($file, '.css'), 'css', 'EDIT_CSS', $css, $revision_loaded);\n } else {\n $revisions = new Tempcode();\n }\n\n $old_contents = @file_get_contents(get_file_base() . '/themes/default/css/' . $file);\n if ($old_contents === false) {\n $old_contents = '';\n }\n\n require_code('form_templates');\n check_suhosin_request_size(strlen($css));\n\n set_short_title($file);\n\n $entries = new Tempcode();\n\n $advanced_mode = get_param_integer('advanced_mode', 0);\n if ($advanced_mode == 1) {\n require_javascript('theme_colours');\n\n global $CSS_MATCHES;\n $CSS_MATCHES = array();\n $css = preg_replace_callback('#\\#[\\da-f][\\da-f][\\da-f][\\da-f][\\da-f][\\da-f]#i', 'css_preg', $css);\n\n foreach ($CSS_MATCHES as $id => $color) {\n $pos = strpos($css, '<color-' . $id . '>');\n $section_start = $pos;\n do {\n $section_start = strrpos(substr($css, 0, $section_start), '{');\n if ($section_start === false || $section_start < 5) {\n break;\n }\n } while (($css[$section_start - 2] == '*') || ($css[$section_start - 1] != ' '));\n $section_line_start = strrpos(substr($css, 0, $section_start), \"\\n\");\n $line_start = strrpos(substr($css, 0, $pos), \"\\n\");\n $context1 = substr($css, $section_line_start, $section_start - $section_line_start);\n $context2 = substr($css, $line_start, $pos - $line_start);\n $context = $context1 . '=>' . trim($context2);\n $entries->attach(do_template('THEME_COLOUR_CHOOSER', array('_GUID' => 'a42ef9daa06a95f5bb9d715aab1bd887', 'COLOR' => $color, 'NAME' => 'c' . strval($id), 'CONTEXT' => trim($context))));\n }\n }\n\n $switch_string = ($advanced_mode == 1) ? do_lang_tempcode('SWITCH_TO_SIMPLE_MODE') : do_lang_tempcode('SWITCH_TO_ADVANCED_MODE');\n $switch_icon = ($advanced_mode == 1) ? 'buttons__simple' : 'buttons__advanced';\n $switch_url = build_url(array('page' => '_SELF', 'type' => 'edit_css', 'file' => $file, 'theme' => $theme, 'advanced_mode' => 1 - $advanced_mode), '_SELF');\n\n require_code('form_templates');\n list($warning_details, $ping_url) = handle_conflict_resolution($file);\n\n return do_template('THEME_EDIT_CSS_SCREEN', array(\n '_GUID' => '3e34b2f44d7a73202f1bb475fd4ac593',\n 'PING_URL' => $ping_url,\n 'OLD_CONTENTS' => $old_contents,\n 'WARNING_DETAILS' => $warning_details,\n 'REVISIONS' => $revisions,\n 'SWITCH_ICON' => $switch_icon,\n 'SWITCH_STRING' => $switch_string,\n 'SWITCH_URL' => $switch_url,\n 'TITLE' => $this->title,\n 'THEME' => $theme,\n 'CSS' => $css,\n 'URL' => $url,\n 'FILE' => $file,\n 'ENTRIES' => $entries,\n ));\n }",
"public function getOptimizedStylesheetUrls() {\n\n\t\t$urls = $this->getStyleSheetUrls();\n\n\t\t$useMinifiedCss = CbSettings::getInstance()->get('use_minified_css');\n\t\t$baseUrlAssets = KenedoPlatform::p()->getUrlAssets();\n\t\t$baseDirAssets = KenedoPlatform::p()->getDirAssets();\n\t\t$baseUrlAssetsCustom = KenedoPlatform::p()->getUrlCustomizationAssets();\n\t\t$baseDirAssetsCustom = KenedoPlatform::p()->getDirCustomizationAssets();\n\n\t\t$useCacheBusting = CbSettings::getInstance()->get('use_assets_cache_buster');\n\t\t$cacheBusterQs = 'version='.ConfigboxViewHelper::getCacheBusterValue();\n\n\t\tforeach ($urls as &$url) {\n\n\t\t\tif ($useMinifiedCss) {\n\n\t\t\t\t// See if there is a min.css file, if so use it instead\n\t\t\t\tif (strpos($url, $baseUrlAssets) === 0) {\n\t\t\t\t\t$pathDir = str_replace($baseUrlAssets, $baseDirAssets, $url);\n\t\t\t\t\t$pathDirMin = str_replace('.css', '.min.css', $pathDir);\n\t\t\t\t\tif (is_file($pathDirMin)) {\n\t\t\t\t\t\t$url = str_replace($baseDirAssets, $baseUrlAssets, $pathDirMin);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Same for customization assets\n\t\t\t\tif (strpos($url, $baseUrlAssetsCustom) === 0) {\n\t\t\t\t\t$pathDir = str_replace($baseUrlAssetsCustom, $baseDirAssetsCustom, $url);\n\t\t\t\t\t$pathDirMin = str_replace('.css', '.min.css', $pathDir);\n\t\t\t\t\tif (is_file($pathDirMin)) {\n\t\t\t\t\t\t$url = str_replace($baseDirAssetsCustom, $baseUrlAssetsCustom, $pathDirMin);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif ($useCacheBusting) {\n\t\t\t\t$url .= ((strpos($url, '?') === false) ? '?':'&') . $cacheBusterQs;\n\t\t\t}\n\n\t\t}\n\n\t\treturn $urls;\n\n\t}",
"function get_admin_css()\n\t{\n\t\t$csslinks = \"\";\n\t\tforeach($this->_admin_css as $css)\n\t\t{\n\t\t\tforeach($this->_hierarchy_theme_abs as $key => $value)\n\t\t\t{\n\t\t\t\tif(file_exists($value.'/'.$this->_default[\"asset\"][\"admin\"].\"css/\".$css))\n\t\t\t\t{\n\t\t\t\t\t$csslinks .= '<link href=\"'.$this->_cdn_url.$this->_hierarchy_theme_rel[$key].'/'.$this->_default[\"asset\"][\"admin\"].'css/'.$css.'\" rel=\"stylesheet\"/>';\n\t\t\t\t\tbreak; \n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tforeach($this->_admin_embd_css as $key => $value)\n\t\t{\n\t\t\t$csslinks .= preg_match($this->_style_pattern, $value) ? $value : '<style type=\"text/css\" id=\"'.$key.'\">'.$value.'</style>';\n\t\t}\n\t\techo $csslinks;\n\t}",
"protected function renderStylesheets()\n {\n $output = '';\n foreach ($this->stylesheets as $id => $stylesheet) {\n $output .= '<link rel=\"stylesheet\"';\n $output .= ' id=\"' . $id . '\"';\n $output .= ' href=\"' . $stylesheet['url'] . '\"';\n $output .= ' type=\"text/css\"';\n $output .= ' media=\"' . $stylesheet['media'] . '\"';\n $output .= '/>' . \"\\n\";\n }\n\n return $output;\n }",
"function getStyleSheetLink() {\n\tglobal $GALLERY_EMBEDDED_INSIDE;\n\tglobal $GALLERY_OK;\n\n\tstatic $styleSheetSet;\n\n\t$styleSheetLinks = '';\n\n\tif(! $styleSheetSet) {\n\t\tif (isset($GALLERY_OK) && $GALLERY_OK == false) {\n\t\t\t$styleSheetLinks = _getStyleSheetLink(\"config\");\n\t\t}\n\t\telse {\n\t\t\t$styleSheetLinks = _getStyleSheetLink(\"base\");\n\n\t\t\tif ($GALLERY_EMBEDDED_INSIDE) {\n\t\t\t\t$styleSheetLinks .= _getStyleSheetLink(\"embedded_style\");\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$styleSheetLinks .= _getStyleSheetLink(\"screen\");\n\t\t\t}\n\t\t}\n\n\t\t$styleSheetSet = true;\n\t}\n\n\treturn $styleSheetLinks;\n}",
"public function getCssSources(){ }",
"protected function setStylesheets () {\n\t\treturn $this->set('stylesheets', $this->filterPageFiles('stylesheets'));\n\t}",
"function get_stylesheets()\n{\n $response = sfContext::getInstance()->getResponse();\n sfConfig::set('symfony.asset.stylesheets_included', true);\n\n $html = '';\n foreach ($response->getStylesheets() as $file => $options)\n {\n $html .= stylesheet_tag($file, $options);\n }\n\n return $html;\n}",
"private function compileStylesheets() {\n return $this->compileAsset(\n \"stylesheet\",\n \"css\",\n \"//link[@rel='stylesheet'][@data-compile='true']\",\n \"href\",\n Symphony::Configuration()->get('styles_path', 'asset_compiler'),\n \"latest_style\",\n array($this, 'stripCSSWhitespace')\n );\n }",
"public function getCss()\n {\n app(AssetsContract::class)->getCss();\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Attach template_group filters on import only | public function before_import(){
add_filter( 'jci/importer/get_groups', array($this, 'get_importer_groups'));
add_filter( 'jci/template/get_groups', array($this, 'get_template_groups'));
} | [
"function _add_template_loader_filters()\n {\n }",
"function tve_compat_re_add_template_include_filters() {\n\tif ( ! function_exists( 'is_plugin_active' ) ) {\n\t\tinclude_once( ABSPATH . 'wp-admin/includes/plugin.php' );\n\t}\n\n\tif ( is_plugin_active( 'maintenance/maintenance.php' ) ) {\n\t\tglobal $mtnc;\n\t\tif ( ! empty( $mtnc ) ) {\n\t\t\tadd_action( 'template_include', array( $mtnc, 'mtnc_template_include' ), 999999 );\n\t\t}\n\t}\n}",
"private function assign_template_filters() {\n\t\tif ( ! empty( $this->templates['single'] ) ) {\n\t\t\tadd_filter( 'single_template', [ $this, 'single_template' ] );\n\t\t}\n\t\tif ( ! empty( $this->templates['archive'] ) ) {\n\t\t\tadd_filter( 'archive_template', [ $this, 'archive_template' ] );\n\t\t}\n/* TODO: Test this construct\n\t\tforeach( $this->templates as $key => $template ) {\n\t\t\tif ( in_array( $key, [ 'folders' ] ) ) {\n\t\t\t\t// TODO: this needs to be handled\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tadd_filter(\n\t\t\t\t\"{$key}_template\",\n\t\t\t\tfunction( $mytemplate ) use ( $key ) { // FIXME: does it need to use $this?\n\t\t\t\t\tglobal $post;\n\t\t\t\t\tif ( $post->post_type === $this->type ) {\n\t\t\t\t\t\t$mytemplate = $this->templates[ $key ];\n\t\t\t\t\t}\n\t\t\t\t\treturn $mytemplate;\n\t\t\t\t}\n\t\t\t);\n\t\t} //*/\n\t}",
"public static function add_amp_template_filters() {\n\t\tforeach ( self::$template_types as $template_type ) {\n\t\t\t// See get_query_template().\n\t\t\t$template_type = preg_replace( '|[^a-z0-9-]+|', '', $template_type );\n\n\t\t\tadd_filter( \"{$template_type}_template_hierarchy\", [ __CLASS__, 'filter_amp_template_hierarchy' ] );\n\t\t}\n\t}",
"function acf_prepare_field_group_for_import($field_group)\n{\n}",
"public function setup_plugin_with_filter_data() {\n\t\tif ( ! ( is_admin() || ( defined( 'WP_CLI' ) && WP_CLI ) ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Get info of import data files and filter it.\n\t\t$this->import_files = Helpers::validate_import_file_info( apply_filters( 'pt-ocdi/import_files', array() ) );\n\n\t\t/**\n\t\t * Register all default actions (before content import, widget, customizer import and other actions)\n\t\t * to the 'before_content_import_execution' and the 'pt-ocdi/after_content_import_execution' action hook.\n\t\t */\n\t\t$import_actions = new ImportActions();\n\t\t$import_actions->register_hooks();\n\n\t\t// Importer options array.\n\t\t$importer_options = apply_filters( 'pt-ocdi/importer_options', array(\n\t\t\t'fetch_attachments' => true,\n\t\t) );\n\n\t\t// Logger options for the logger used in the importer.\n\t\t$logger_options = apply_filters( 'pt-ocdi/logger_options', array(\n\t\t\t'logger_min_level' => 'warning',\n\t\t) );\n\n\t\t// Configure logger instance and set it to the importer.\n\t\t$logger = new Logger();\n\t\t$logger->min_level = $logger_options['logger_min_level'];\n\n\t\t// Create importer instance with proper parameters.\n\t\t$this->importer = new Importer( $importer_options, $logger );\n\t}",
"public static function loadFilters() {\n\t\t\n\t\t// load defaults\n\t\t$filterDir = Config::getOption(\"sourceDir\").DIRECTORY_SEPARATOR.\"_twig-components/filters\";\n\t\t$filterExt = Config::getOption(\"twigFilterExt\");\n\t\t$filterExt = $filterExt ? $filterExt : \"filter.php\";\n\t\t\n\t\tif (is_dir($filterDir)) {\n\t\t\t\n\t\t\t// loop through the filter dir...\n\t\t\t$finder = new Finder();\n\t\t\t$finder->files()->name(\"*\\.\".$filterExt)->in($filterDir);\n\t\t\t$finder->sortByName();\n\t\t\tforeach ($finder as $file) {\n\t\t\t\t\n\t\t\t\t// see if the file should be ignored or not\n\t\t\t\t$baseName = $file->getBasename();\n\t\t\t\tif ($baseName[0] != \"_\") {\n\t\t\t\t\t\n\t\t\t\t\tinclude($file->getPathname());\n\t\t\t\t\t\n\t\t\t\t\t// $filter should be defined in the included file\n\t\t\t\t\tif (isset($filter)) {\n\t\t\t\t\t\tself::$instance->addFilter($filter);\n\t\t\t\t\t\tunset($filter);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t}",
"function gutenberg_global_styles_force_filtered_html_on_import_filter( $arg ) {\n\t// force_filtered_html_on_import is true we need to init the global styles kses filters.\n\tif ( $arg ) {\n\t\tgutenberg_global_styles_kses_init_filters();\n\t}\n\treturn $arg;\n}",
"private function before_content_import() {\r\n\r\n\t\tadd_filter( 'wxr_importer.pre_process.user', [ $this, 'skip_authors' ], 10, 2 );\r\n\t\tadd_action( 'wxr_importer.processed.post', [ $this, 'add_fusion_demo_import_meta' ], 10, 5 );\r\n\t\tadd_filter( 'import_post_meta_key', [ $this, 'skip_old_menu_meta' ], 10, 3 );\r\n\t\tadd_filter( 'wxr_importer.pre_process.post', [ $this, 'trim_post_content' ], 10, 4 );\r\n\r\n\t\tif ( ! $this->import_all ) {\r\n\r\n\t\t\tif ( ! empty( $this->import_content_types ) ) {\r\n\r\n\t\t\t\tforeach ( $this->import_content_types as $content_type ) {\r\n\r\n\t\t\t\t\tif ( method_exists( $this, 'allow_import_' . $content_type ) ) {\r\n\t\t\t\t\t\tcall_user_func( [ $this, 'allow_import_' . $content_type ] );\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tadd_filter( 'wxr_importer.pre_process.post', [ $this, 'skip_not_allowed_post_types' ], 10, 4 );\r\n\t\t\tadd_filter( 'wxr_importer.pre_process.term', [ $this, 'skip_not_allowed_taxonomies' ], 10, 2 );\r\n\t\t} else {\r\n\t\t\t// Slides are imported separately, not from avada.xml file.\r\n\t\t\tadd_filter( 'wxr_importer.pre_process.post', [ $this, 'skip_slide_post_type' ], 10, 4 );\r\n\t\t\tadd_filter( 'wxr_importer.pre_process.term', [ $this, 'skip_slide_taxonomy' ], 10, 2 );\r\n\t\t}\r\n\r\n\t\tif ( $this->import_all || in_array( 'avada_layout', $this->import_content_types ) ) {\r\n\r\n\t\t\t// Make global layout backup, since they are part of 'content' stage need to be handled separately.\r\n\t\t\t$this->content_tracker->set_avada_layout();\r\n\t\t\tadd_filter( 'wxr_importer.pre_process.post', [ $this, 'add_slashes_to_layout_content' ], 8, 4 );\r\n\t\t\tadd_filter( 'wxr_importer.pre_process.post', [ $this, 'import_global_avada_layout' ], 9, 4 );\r\n\t\t}\r\n\t}",
"public function addTemplateFilter($template)\n {\n $this->addFilter('templateID', $template);\n }",
"function acf_prepare_field_group_for_import( $field_group ) {\n\treturn acf_prepare_internal_post_type_for_import( $field_group, 'acf-field-group' );\n}",
"public function pushEnabledTemplatesToView()\n {\n $this->view->templates = R::find('template', ' enabled = 1 ORDER BY name');\n }",
"protected function bindCompatFilters()\n {\n $sage = $this->app['sage'];\n\n add_filter('body_class', $sage->filter('body_class'), 10);\n add_action('the_post', $sage->filter('the_post'), 10);\n add_filter('template_include', $sage->filter('template_include'), 100);\n add_filter('theme_templates', $sage->filter('theme_templates'), 100, 4);\n add_filter('script_loader_tag', $sage->filter('script_loader_tag'), 100, 3);\n\n add_filters([\n 'index_template_hierarchy',\n '404_template_hierarchy',\n 'archive_template_hierarchy',\n 'author_template_hierarchy',\n 'category_template_hierarchy',\n 'tag_template_hierarchy',\n 'taxonomy_template_hierarchy',\n 'date_template_hierarchy',\n 'home_template_hierarchy',\n 'frontpage_template_hierarchy',\n 'page_template_hierarchy',\n 'paged_template_hierarchy',\n 'search_template_hierarchy',\n 'single_template_hierarchy',\n 'singular_template_hierarchy',\n 'attachment_template_hierarchy',\n 'privacypolicy_template_hierarchy',\n 'embed_template_hierarchy',\n ], $sage->filter('template_hierarchy'), 10);\n }",
"protected function register_filters() {}",
"public function setup_filters() {\n\n\t\t// Add a /dashboard/ rewrite rule (so no fake 'page' required)\n\t\tadd_filter( 'template_include', array( $this, 'template_include__add_section_components_rewrite_rule' ), 100 );\n\n\t\tadd_filter( 'query_vars', array( $this, 'query_vars__add_section_components_rewrite_rule' ) );\n\n\t}",
"function add_to_twig( $twig ) {\n\t\t//$twig->addExtension( new Twig_Extension_StringLoader() );\n\t\t//$twig->addFilter( 'myfoo', new Twig_Filter_Function( 'myfoo' ) );\n\t\t//return $twig;\n\t}",
"function acf_import_field_group( $field_group ) {\n}",
"private function enableAppTwigExtensions(){\n $this->addLimpidExtensions();\n $this->addExternalExtensions();\n }",
"public function beforeImport();"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
If provided, get the source from this location in Cloud Storage. Generated from protobuf field .google.devtools.cloudbuild.v1.StorageSource storage_source = 2; | public function getStorageSource()
{
return $this->readOneof(2);
} | [
"public function getStorageSrc() {\n return $this->get(self::STORAGE_SRC);\n }",
"public function setSourceStorage(StorageInterface $storage);",
"public function setResolvedStorageSource($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Cloud\\Functions\\V2\\StorageSource::class);\n $this->resolved_storage_source = $var;\n\n return $this;\n }",
"public function getGcsSource()\n {\n return $this->gcs_source;\n }",
"public function setStorageSourceManifest($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Cloud\\Build\\V1\\StorageSourceManifest::class);\n $this->writeOneof(8, $var);\n\n return $this;\n }",
"public function getPrivateSourceStorage() {\n return $this->getSourceStorage();\n }",
"public function getStorageLocation()\n {\n return $this->storageLocation;\n }",
"function getStorage() {\n\t\treturn $this->getData('storage');\n\t}",
"public function getStorage() {}",
"public function getStorageClient();",
"protected function createSourceFieldStorage() {\n return $this->entityTypeManager\n ->getStorage('field_storage_config')\n ->create([\n 'entity_type' => 'media',\n 'field_name' => $this->getSourceFieldName(),\n 'type' => reset($this->pluginDefinition['allowed_field_types']),\n ]);\n }",
"public function getStorage(): string\n {\n return $this->request->get('storage') ?? 'uploads';\n }",
"public function getStorage();",
"protected function getSourceFieldStorage() {\n // Nothing to do if no source field is configured yet.\n $field = $this->configuration['source_field'];\n if ($field) {\n // Even if we do know the name of the source field, there's no\n // guarantee that it exists.\n $fields = $this->entityFieldManager->getFieldStorageDefinitions('hub_reference');\n return isset($fields[$field]) ? $fields[$field] : NULL;\n }\n return NULL;\n }",
"public function getStorageLocation()\n {\n if ($this->storageLocation === null) {\n $file = $this->getAddNewVersionTo();\n if ($file !== null) {\n $this->storageLocation = $this->getFileStorageLocation($file);\n } else {\n $this->storageLocation = $this->getFolderStorageLocation($this->getImportToFolder());\n }\n }\n\n return $this->storageLocation;\n }",
"public function getStorage() {\r\n if (!isset($this->_storage)) {\r\n // get format\r\n $info = pathinfo($this->path);\r\n $format = 'config';\r\n if ($info['extension'] == 'json') {\r\n $format = 'json';\r\n } elseif ($info['extension'] == 'php') {\r\n $format = 'php';\r\n }\r\n // get location\r\n $location = dirname($this->path);\r\n // use StorageFile\r\n $this->_storage = new StorageFile(new Settings(array('location' => $location, 'format' => $format)));\r\n }\r\n return $this->_storage;\r\n }",
"public function getStorageService();",
"public function storagePath()\n {\n return $this->paths->get('storage');\n }",
"public function getStorageName()\n {\n return $this->storage_name;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the class name of the given class. If no class is given, the class will drawn by get_called_class(). If the given class has an hook proxy the function will return the proxy class. | public static function getClassName($class = null)
{
if (empty($class)) {
$class = get_called_class();
}
if (is_object($class)) {
$class = get_class($class);
} elseif (!class_exists($class)) {
throw new Enlight_Exception('Class ' . $class . ' does not exist and could not be loaded');
}
if (in_array('Enlight_Hook', class_implements($class))) {
$class = Shopware()->Hooks()->getProxy($class);
}
return $class;
} | [
"private function get_class_name() {\n\t\t\treturn !is_null($this->class_name) ? $this->class_name : get_class($this);\n\t\t}",
"public static function getClassName($class){\n return get_class($class) ? get_class($class) : 'Unknown';\n }",
"function _getFullClassName($class)\n {\n if (!empty($this->_options['use_language'])) {\n $theClass = $this->_language . '-' . $class;\n } else {\n $theClass = $class;\n }\n return $theClass;\n }",
"public function ___getRealClassName();",
"protected function getClassName() {\n $splitedName = explode(\"\\\\\", get_class($this));\n return strtolower($splitedName[count($splitedName) - 1]);\n }",
"private function getRealClass(string $class): string\n {\n if ($this->proxyClassNameResolver === null) {\n $this->createDefaultProxyClassNameResolver();\n }\n\n assert($this->proxyClassNameResolver !== null);\n\n return $this->proxyClassNameResolver->resolveClassName($class);\n }",
"public static function getProxiedClass(): string\n {\n return get_class(static::getProxiedInstance());\n }",
"public function get_class_name()\n {\n return $this->className;\n }",
"public function class_name() {\n\n\t\treturn strtolower( get_class( $this ) );\n\t}",
"public function getClassName() {\r\n\t\treturn $this->class_name;\r\n\t}",
"public function getClassName() {\n return $this->class_name;\n }",
"public function getClassName();",
"public static function getProxiedClass(): string\n {\n return get_class(static::proxy());\n }",
"public function getRealClassName($className);",
"public function getSimpleClassName($class = null);",
"public function getClass($class)\n\t{\n\t\tif (class_exists($class, true))\n\t\t{\n\t\t\treturn $class;\n\t\t}\n\t\t\n\t\t$fullname = $this->_prefix . ucfirst($class);\n\t\t\n\t\tif (class_exists($fullname, true))\n\t\t{\n\t\t\treturn $fullname;\n\t\t}\n\t\t\n\t\treturn null;\n\t}",
"final protected function get_called_class()\n\t{\n\t\t$backtrace = debug_backtrace();\n \treturn get_class($backtrace[2]['object']);\n\t}",
"public function getClassName()\n {\n return get_class( $this->getServiceObject() );\n }",
"final protected function get_called_class()\r\n\t{\r\n\t\t$backtrace = debug_backtrace();\r\n\t\treturn get_class($backtrace[2]['object']);\r\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Update the inventory levels for a product that has options | private function UpdatePerOptionInventoryLevels()
{
if(!gzte11(ISC_MEDIUMPRINT)) {
echo 0;
exit;
}
if(isset($_REQUEST['i'])) {
$inventory_data = $_REQUEST['i'];
$inventory_levels = array();
$queries = array();
$done = array();
$total_stock_units = 0;
$total_low_units = 0;
$product_id = 0;
parse_str($inventory_data, $inv_array);
// Execute all of the queries in a transaction
$GLOBALS['ISC_CLASS_DB']->Query("start transaction");
foreach($inv_array as $k=>$v) {
$tmp = explode("_", $k);
$id = (int)$tmp[count($tmp)-1];
$inventory_levels[$id] = array();
if(!in_array($id, $done)) {
$product_id = (int)$tmp[count($tmp)-2];
$current = (int)$inv_array["stock_level_" . $product_id . "_" . $id];
$low = (int)$inv_array["stock_level_notify_" . $product_id . "_" . $id];
$updatedLevels = array(
"vcstock" => $current,
"vclowstock" => $low
);
$GLOBALS['ISC_CLASS_DB']->UpdateQuery("product_variation_combinations", $updatedLevels, "combinationid='".$GLOBALS['ISC_CLASS_DB']->Quote((int)$id)."'");
// Increment the number of total units in stock
$total_stock_units += $current;
$total_low_units += $low;
// Mark this particular product option as done
array_push($done, $id);
}
}
// Log this action
$GLOBALS['ISC_CLASS_LOG']->LogAdminAction($product_id, $product_id, $total_stock_units, $total_low_units);
// Finally we need to update the prodcurrentinv field in the products table
$updatedProduct = array(
"prodcurrentinv" => $total_stock_units
);
$GLOBALS['ISC_CLASS_DB']->UpdateQuery("products", $updatedProduct, "productid='".$GLOBALS['ISC_CLASS_DB']->Quote($product_id)."'");
$err = $GLOBALS['ISC_CLASS_DB']->GetErrorMsg();
if($err == "") {
// No error, commit the transaction
$GLOBALS['ISC_CLASS_DB']->Query("commit");
echo "1";
} else {
// Something went wrong, rollback
$GLOBALS['ISC_CLASS_DB']->Query("rollback");
echo "0";
}
}
} | [
"private function updateOptions()\n {\n $scrappageCollection = Mage::getModel('scrappagescheme/scrap')->getCollection()\n ->addFieldToFilter('scrap_status', 0)\n ->addFieldToFilter('percentage', array('gt' => 0))\n ->setOrder('scrap_id', 'asc');\n\n Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);\n $successCount = $failedCount = $errorCount = 1;\n\n if (count($scrappageCollection)) {\n foreach ($scrappageCollection as $data) {\n $product = Mage::getModel('catalog/product')->getCollection()\n ->addAttributeToSelect('*')\n ->addAttributeToFilter('price', array('gt' => 0))\n ->addAttributeToFilter('sku', array('eq' => $data['sku']))->getFirstItem();\n\n if ($product->getName()) {\n\n $optionInstance = $product->getOptionInstance()->unsetOptions();\n $product->setHasOptions(1);\n\n $option = $this->getProductOption($data['percentage']);\n\n if (isset($option['is_require']) && ($option['is_require'] == 1)) {\n $product->setRequiredOptions(1);\n }\n $product->setPay4leterEnable(360);\n $product->setPay4leterPlans(407);\n\n $optionInstance->addOption($option);\n $optionInstance->setProduct($product);\n try {\n\n $product->save();\n\n Mage::getModel('scrappagescheme/scrap')->load($data['scrap_id'])->setStatus(1)->save();\n\n // Success\n Mage::log('Name :' . $product->getName(), null, 'MarchScrappageSuccessProducts.log', true);\n Mage::log('Sku :' . $product->getSku(), null, 'MarchScrappageSuccessProducts.log', true);\n Mage::log('Price :' . $product->getPrice(), null, 'MarchScrappageSuccessProducts.log', true);\n Mage::log('Count :' . $successCount++, null, 'MarchScrappageSuccessProducts.log', true);\n Mage::log('-----------------------------', null, 'MarchScrappageSuccessProducts.log', true);\n\n } catch (Exception $e) {\n\n // Error\n Mage::log($product->getId(), null, 'MarchScrappageErrorProducts.log', true);\n Mage::log($data['sku'] . ' ::' . $data['sku'], null, 'MarchScrappageErrorProducts.log', true);\n Mage::log($errorCount++, null, 'MarchScrappageSuccessProducts.log', true);\n Mage::log('-----------------------------', null, 'MarchScrappageErrorProducts.log', true);\n\n }\n\n } else {\n // Failed\n Mage::log('Name :' . $data['name'], null, 'MarchScrappageFailedProducts.log', true);\n Mage::log('Sku :' . $data['sku'], null, 'MarchScrappageFailedProducts.log', true);\n Mage::log('Count :' . $failedCount++, null, 'MarchScrappageFailedProducts.log', true);\n Mage::log('-----------------------------', null, 'MarchScrappageFailedProducts.log', true);\n }\n\n Mage::log('Name :' . $data['name'], null, 'MarchScrappageRunProductList.log', true);\n Mage::log('Sku :' . $data['sku'], null, 'MarchScrappageRunProductList.log', true);\n Mage::log('-----------------------------', null, 'MarchScrappageRunProductList.log', true);\n }\n } else {\n Mage::log('=============END===============', null, 'MarchScrappageCompleted.log', true);\n }\n }",
"function fn_product_variations_apply_options_rules_post(&$product)\n{\n $product['options_update'] = true;\n}",
"public function updateItemOptionsAction()\n {\n $cart = $this->_getCart();\n $id = (int) $this->getRequest()->getParam('id');\n \n $params = $this->getRequest()->getParams();\t\t\n if (!isset($params['options'])) {\n $params['options'] = array();\n }\n \n try {\n\t\t\t$quoteItem = $cart->getQuote()->getItemById($id);\n if (!$quoteItem) {\n Mage::throwException($this->__('Quote item is not found.'));\n }\n \n\t\t\t$product = Mage::getModel('catalog/product')->load($quoteItem->getProductId()); \n\t\t\t$productType = $product->getTypeId();\n\t\t\t$flag = 0;\n\t\t\tif(($productType == Mage_Catalog_Model_Product_Type::TYPE_SIMPLE || $productType == Mage_Catalog_Model_Product_Type::TYPE_CONFIGURABLE) && ($product->getCarebyzinc() == 1)) {\n\t\t\t\t$qty = 1;\n\t\t\t\t$flag = 1;\n\t\t\t} \n \n if($product->getId() == Mage::getStoreConfig('carebyzinc/general/warranty_product')){\n\t\t\t\t$flag = 0;\t\n\t\t\t\tif($qty >1){\n\t\t\t\t\t$params['qty'] = 1;\n\t\t\t\t\t$qty = 1;\n\t\t\t\t}\n\t\t\t}\n \n if (isset($params['qty'])) {\n\t\t\t\tif($flag) {\n\t\t\t\t\t$qty = $params['qty'];\n\t\t\t\t\tif($qty > 1)\n\t\t\t\t\t\t$params['qty'] = 1;\n\t\t\t\t}\n $filter = new Zend_Filter_LocalizedToNormalized(\n array('locale' => Mage::app()->getLocale()->getLocaleCode())\n );\n $params['qty'] = $filter->filter($params['qty']);\n } \n\t\t\t\n $item = $cart->updateItem($id, new Varien_Object($params));\n \n if($flag) { \n\t\t\t\tif($qty >1) {\n\t\t\t\t\t$quote = Mage::getSingleton('checkout/session')->getQuote();\n\t\t\t\t\tfor($i=0; $i<($qty-1); $i++) {\t\t\t\t\t\t\n\t\t\t\t\t\t$result = $quote->addProduct($product, $item->getBuyRequest());\n\t\t\t\t\t\t$result = ($result->getParentItem() ? $result->getParentItem() : $result);\n $quote->save();\n\t\t\t\t\t}\n\t\t\t\t}\t \n\t\t\t}\n\t\t\t\n if (is_string($item)) {\n Mage::throwException($item);\n }\n if ($item->getHasError()) {\n Mage::throwException($item->getMessage());\n }\n\n $related = $this->getRequest()->getParam('related_product');\n if (!empty($related)) {\n $cart->addProductsByIds(explode(',', $related));\n }\n\n $cart->save();\n\n $this->_getSession()->setCartWasUpdated(true);\n\n Mage::dispatchEvent('checkout_cart_update_item_complete',\n array('item' => $item, 'request' => $this->getRequest(), 'response' => $this->getResponse())\n );\n if (!$this->_getSession()->getNoCartRedirect(true)) {\n if (!$cart->getQuote()->getHasError()) {\n $message = $this->__('%s was updated in your shopping cart.', Mage::helper('core')->escapeHtml($item->getProduct()->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($e->getMessage());\n } else {\n $messages = array_unique(explode(\"\\n\", $e->getMessage()));\n foreach ($messages as $message) {\n $this->_getSession()->addError($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 update the item.'));\n Mage::logException($e);\n $this->_goBack();\n }\n $this->_redirect('*/*');\n }",
"private function update_level($options){\n $models = new Models('levels');\n $where = array(\n 'id' => $options['id']\n );\n $value = array(\n 'enabled' => $options['enabled']\n );\n $models->update($where, $value);\n }",
"public static function update_packages_from_level(array $form_values, $product_id) {\n settype($product_id, 'int');\n $db = Agel_Db_Table::getDefaultAdapter();\n $kit_levels = new upgrades_from($product_id);\n $db->query(DELETE_UPGRADES_BY_PRODUCT_ID_SQL, array('product_id' => $product_id));\n if (isset($form_values['discounted_upgrade_level']['none'])) {\n $db->query(CREATE_UPGRADE_SQL, array( 'current_level' => 'NULL',\n 'upgrade_product_id' => $product_id,\n 'discounted' => '1'));\n unset($form_values['discounted_upgrade_level']);\n }\n if (isset($form_values['non_discounted_upgrade_level']['none'])) {\n $db->query(CREATE_UPGRADE_SQL, array( 'current_level' => 'NULL',\n 'upgrade_product_id' => $product_id,\n 'discounted' => '0'));\n unset($form_values['non_discounted_upgrade_level']);\n }\n\t\n\tif (isset($form_values['discounted_upgrade_level']['zero'])) {\n\t $form_values['discounted_upgrade_level']['0'] = '1';\n\t}\n\tif (isset($form_values['non_discounted_upgrade_level']['zero'])) {\n\t $form_values['non_discounted_upgrade_level']['0'] = '1';\n\t}\n\n foreach ($kit_levels->records as $kitLevel) {\n if (isset($form_values['discounted_upgrade_level'][$kitLevel['sequence']])) {\n $db->query(CREATE_UPGRADE_SQL, array( 'current_level' => $kitLevel['sequence'],\n 'upgrade_product_id' => $product_id,\n 'discounted' => '1'));\n }\n\n if (isset($form_values['non_discounted_upgrade_level'][$kitLevel['sequence']])) {\n $db->query(CREATE_UPGRADE_SQL, array( 'current_level' => $kitLevel['sequence'],\n 'upgrade_product_id' => $product_id,\n 'discounted' => '0'));\n }\n }\n\n return $this;\n }",
"public static function updateInventory(){\n $arrCart = Products_Controller::getCartFromSession();\n if(!empty($arrCart)){\n foreach($arrCart as $key => $strValue){\n $intAvailableProducts = (int) Products_Controller::getAvailableProducts($key);\n $intUpdatedProducts = $intAvailableProducts - $strValue;\n update_post_meta($key ,'_meta_information_points_qty', (int) $intUpdatedProducts);\n }\n }\n }",
"function fn_product_variations_apply_options_rules_post(&$product)\n{\n if ($product['product_type'] === ProductManager::PRODUCT_TYPE_CONFIGURABLE) {\n $product['options_update'] = true;\n }\n}",
"public function testUpdateProductsVariation()\n {\n }",
"public function syncInventoryPriority()\n {\n \n // get the items simply by time stamp of today\n $daysback_options = explode (',',$this->option('sync_inventory_warhsname'))[3] ;\n $daysback = intval(!empty($daysback_options) ? $daysback_options : 10); // change days back to get inventory of prev days\n $stamp = mktime(1 - ($daysback*24), 0, 0);\n $bod = date(DATE_ATOM,$stamp);\n $url_addition = '(WARHSTRANSDATE ge '.$bod. ' or PURTRANSDATE ge '.$bod .' or SALETRANSDATE ge '.$bod.')';\n if($this->option('variation_field')) {\n // $url_addition .= ' and ' . $this->option( 'variation_field' ) . ' eq \\'\\' ';\n }\n $response = $this->makeRequest('GET', 'LOGPART?$select=PARTNAME&$filter= '.urlencode($url_addition).' &$expand=LOGCOUNTERS_SUBFORM,PARTBALANCE_SUBFORM', [], $this->option('log_inventory_priority', false));\n\n // check response status\n if ($response['status']) {\n\n $data = json_decode($response['body_raw'], true);\n\n foreach($data['value'] as $item) {\n\n // if product exsits, update\n\n $option_filed = explode (',',$this->option('sync_inventory_warhsname'))[2] ;\n $field = (!empty($option_filed) ? $option_filed : 'PARTNAME');\n $args = array(\n 'post_type' => array('product', 'product_variation'),\n 'meta_query'\t=>\tarray(\n array(\n 'key' => '_sku',\n 'value'\t=> $item[$field]\n )\n )\n );\n $my_query = new \\WP_Query( $args );\n if ( $my_query->have_posts() ) {\n while ( $my_query->have_posts() ) {\n $my_query->the_post();\n $product_id = get_the_ID();\n\n\n }\n }else{\n $product_id = 0;\n }\n\n //if ($id = wc_get_product_id_by_sku($item['PARTNAME'])) {\n if(!$product_id == 0){\n // update_post_meta($product_id, '_sku', $item['PARTNAME']);\n // get the stock by part availability\n $stock = $item['LOGCOUNTERS_SUBFORM'][0]['DIFF'];\n\n // get the stock by specific warehouse\n $wh_name = explode (',',$this->option('sync_inventory_warhsname'))[0];\n $foo =$this->option('sync_inventory_warhsname');\n $foo2 = explode (',',$this->option('sync_inventory_warhsname'))[1];\n $is_deduct_order = explode (',',$this->option('sync_inventory_warhsname'))[1] == 'ORDER';\n $orders = $item['LOGCOUNTERS_SUBFORM'][0]['ORDERS'];\n foreach($item['PARTBALANCE_SUBFORM'] as $wh_stock){\n if($wh_stock['WARHSNAME'] == $wh_name) {\n $stock = $wh_stock['TBALANCE'] > 0 ? $wh_stock['TBALANCE'] : 0; // stock\n if ($is_deduct_order) {\n $stock = $wh_stock['TBALANCE'] - $orders > 0 ? $wh_stock['TBALANCE'] - $orders : 0; // stock - orders\n }\n }\n }\n $statuses = explode (',',$this->option('sync_inventory_warhsname'))[4];\n if(!empty($statuses)){\n $stock -= $this->get_items_total_by_status($product_id);\n $item['order_status_qty'] = $this->get_items_total_by_status($product_id);\n }\n $item['stock'] = $stock;\n $item = apply_filters('simply_sync_inventory_priority',$item);\n $stock = $item['stock'];\n update_post_meta($product_id, '_stock', $stock);\n // set stock status\n if (intval($stock) > 0) {\n // update_post_meta($product_id, '_stock_status', 'instock');\n $stock_status = 'instock';\n } else {\n // update_post_meta($product_id, '_stock_status', 'outofstock');\n $stock_status = 'outofstock';\n }\n $variation = wc_get_product($product_id);\n // $variation->set_stock_status($stock_status);\n $variation->save();\n }\n }\n // add timestamp\n $this->updateOption('inventory_priority_update', time());\n } else {\n /**\n * t149\n */\n $this->sendEmailError(\n $this->option('email_error_sync_inventory_priority'),\n 'Error Sync Inventory Priority',\n $response['body']\n );\n }\n }",
"public function updateItemOptionsAction()\n {\n $cart = $this->_getCart();\n $id = (int) $this->getRequest()->getParam('id');\n $params = $this->getRequest()->getParams();\n\n if (!isset($params['options'])) {\n $params['options'] = array();\n }\n try {\n if (isset($params['qty'])) {\n $filter = new Zend_Filter_LocalizedToNormalized(\n array('locale' => Mage::app()->getLocale()->getLocaleCode())\n );\n $params['qty'] = $filter->filter($params['qty']);\n }\n\n $quoteItem = $cart->getQuote()->getItemById($id);\n if (!$quoteItem) {\n Mage::throwException($this->__('Quote item is not found.'));\n }\n\n $item = $cart->updateItem($id, new Varien_Object($params));\n if (is_string($item)) {\n Mage::throwException($item);\n }\n if ($item->getHasError()) {\n Mage::throwException($item->getMessage());\n }\n\n $related = $this->getRequest()->getParam('related_product');\n if (!empty($related)) {\n $cart->addProductsByIds(explode(',', $related));\n }\n\n $cart->save();\n\n $this->_getSession()->setCartWasUpdated(true);\n\n Mage::dispatchEvent('checkout_cart_update_item_complete',\n array('item' => $item, 'request' => $this->getRequest(), 'response' => $this->getResponse())\n );\n if (!$this->_getSession()->getNoCartRedirect(true)) {\n if (!$cart->getQuote()->getHasError()) {\n $result['message'] = $this->__('%s was updated in your shopping cart.', Mage::helper('core')->escapeHtml($item->getProduct()->getName()));\n }\n\n }\n } catch (Mage_Core_Exception $e) {\n if ($this->_getSession()->getUseNotice(true)) {\n $result['message'] = $e->getMessage();\n } else {\n $messages = array_unique(explode(\"\\n\", $e->getMessage()));\n foreach ($messages as $message) {\n $result['message'] = $message;\n }\n }\n } catch (Exception $e) {\n $result['message'] = $this->__('Cannot update the item.');\n }\n $result['update'] = 1;\n $this->getResponse()->setBody(Zend_Json::encode($result));\n }",
"function commerce_product_post_update_6() {\n $entity_type_manager = \\Drupal::entityTypeManager();\n /** @var \\Drupal\\commerce_product\\Entity\\ProductTypeInterface[] $product_types */\n $product_types = $entity_type_manager->getStorage('commerce_product_type')->loadMultiple();\n /** @var \\Drupal\\user\\RoleInterface[] $roles */\n $roles = $entity_type_manager->getStorage('user_role')->loadMultiple();\n\n foreach ($roles as $role) {\n foreach ($product_types as $product_type) {\n // If the role had any update permission, grant the manage permission.\n if (\n $role->hasPermission(\"update any {$product_type->id()} commerce_product\") ||\n $role->hasPermission(\"update own {$product_type->id()} commerce_product\")\n ) {\n $role->grantPermission(\"manage {$product_type->getVariationTypeId()} commerce_product_variation\");\n }\n }\n $role->save();\n }\n}",
"public function onAfterWrite() {\n parent::onAfterWrite();\n $item = $this->Item();\n $variation = $this->Object();\n\t if ($variation && $variation->exists() && $variation instanceof Variation) {\n\t $item->updateStockLevels();\n\t }\n\t}",
"public function setProductVariants($productId, $data)\r\n {\r\n $varValues = $attribValues = array();\r\n\r\n $db = JFactory::getDbo();\r\n $query = $db->getQuery(true);\r\n\r\n // First deletes all the previous variants linked to the product.\r\n $query->delete('#__ketshop_product_variant')\r\n\t ->where('prod_id='.(int)$productId);\r\n $db->setQuery($query);\r\n $db->execute();\r\n\r\n // Same for the previous attributes linked to the variants.\r\n $query->clear();\r\n $query->delete('#__ketshop_var_attrib')\r\n\t ->where('prod_id='.(int)$productId);\r\n $db->setQuery($query);\r\n $db->execute();\r\n\r\n $query->clear();\r\n $query->select('t.rate')\r\n\t ->from('#__ketshop_tax AS t')\r\n\t ->join('INNER', '#__ketshop_product AS p ON p.id='.(int)$productId.' AND p.tax_id=t.id');\r\n $db->setQuery($query);\r\n $taxRate = $db->loadResult();\r\n\r\n foreach($data as $key => $value) {\r\n if(preg_match('#^variant_id_nb_([0-9]+)$#', $key, $matches)) {\r\n\t$varNb = $matches[1];\r\n\t$varId = $data['variant_id_nb_'.$varNb];\r\n\r\n\t$published = 0;\r\n\t// N.B: Checkbox variable is not passed through POST when unchecked.\r\n\t// The basic variant (ie: the first on the list) cannot be unpublished.\r\n\tif(isset($data['variant_published_'.$varNb]) || $data['variant_ordering_'.$varNb] == 1) {\r\n\t $published = 1;\r\n\t}\r\n\r\n\tif($data['jform']['type'] == 'bundle') {\r\n\t // Relies on the bundle functions to set the stock and availability_delay values.\r\n\t $data['variant_stock_'.$varNb] = $this->getBundleStock($productId);\r\n\t $data['variant_availability_delay_'.$varNb] = $this->getBundleDelay($productId);\r\n\t // stock_subtract field is disabled for bundle and thus its value is not sent through the form. \r\n\t $stockSubtract = $this->getReadOnlyYesNoValues($productId, 'stock_subtract');\r\n\t}\r\n\t// normal\r\n\telse {\r\n\t $stockSubtract = $data['variant_stock_subtract_'.$varNb];\r\n\t}\r\n\r\n\tif(!(int)$stockSubtract) {\r\n\t // Stock is infinite. Replaces the infinite sign '∞' with zero.\r\n\t $data['variant_stock_'.$varNb] = 0;\r\n\t}\r\n\r\n\t$data['variant_price_with_tax_'.$varNb] = UtilityHelper::getPriceWithTax($data['variant_base_price_'.$varNb], $taxRate);\r\n\r\n\t// Stores variant values to insert.\r\n\t$varValues[] = (int)$productId.','.(int)$varId.','.$db->Quote($data['variant_name_'.$varNb]).\r\n ','.(int)$data['variant_stock_'.$varNb].\r\n\t\t\t','.UtilityHelper::floatFormat($data['variant_base_price_'.$varNb]).\r\n\t\t\t','.UtilityHelper::floatFormat($data['variant_price_with_tax_'.$varNb]).\r\n\t\t\t','.$db->Quote($data['variant_code_'.$varNb]).','.(int)$published.\r\n\t\t\t','.(int)$data['variant_availability_delay_'.$varNb].\r\n\t\t\t','.(int)$stockSubtract.\r\n\t\t\t','.(int)$data['variant_allow_order_'.$varNb].\r\n\t\t\t','.(int)$data['variant_min_stock_threshold_'.$varNb].\r\n\t\t\t','.(int)$data['variant_max_stock_threshold_'.$varNb].\r\n\t\t\t','.(int)$data['variant_min_quantity_'.$varNb].\r\n\t\t\t','.(int)$data['variant_max_quantity_'.$varNb].\r\n\t\t\t','.UtilityHelper::floatFormat($data['variant_weight_'.$varNb]).\r\n\t\t\t','.UtilityHelper::floatFormat($data['variant_length_'.$varNb]).\r\n\t\t\t','.UtilityHelper::floatFormat($data['variant_width_'.$varNb]).\r\n\t\t\t','.UtilityHelper::floatFormat($data['variant_height_'.$varNb]).\r\n\t\t\t','.(int)$data['variant_ordering_'.$varNb].\r\n\t\t\t// Resets the stock_locked flag.\r\n\t\t\t',0';\r\n\r\n\t// Now searches for the attributes linked to this variant.\r\n\tforeach($data as $k => $val) {\r\n\t if(preg_match('#^variant_attribute_value_([0-9]+)_'.$varNb.'$#', $k, $matches)) {\r\n\t $attribId = $matches[1];\r\n\r\n\t // Checks for empty field. \r\n\t if(!empty($data['variant_attribute_value_'.$attribId.'_'.$varNb])) {\r\n\t $value = $data['variant_attribute_value_'.$attribId.'_'.$varNb];\r\n\r\n\t // Checks for multiselect.\r\n\t if(is_array($value)) {\r\n\t\t$value = json_encode($value);\r\n\t }\r\n\r\n\t // Stores the variant attribute values to insert.\r\n\t $attribValues[] = (int)$productId.','.(int)$varId.','.(int)$attribId.','.$db->Quote($value);\r\n\t }\r\n\t }\r\n\t}\r\n }\r\n }\r\n\r\n if(!empty($varValues)) {\r\n // Inserts a new row for each variant linked to the product.\r\n $columns = array('prod_id', 'var_id', 'name', 'stock', 'base_price', 'price_with_tax', 'code', \r\n\t\t 'published', 'availability_delay', 'stock_subtract', 'allow_order', 'min_stock_threshold', \r\n\t\t 'max_stock_threshold', 'min_quantity', 'max_quantity', 'weight', 'length', 'width',\r\n\t\t 'height', 'ordering', 'stock_locked');\r\n $query->clear();\r\n $query->insert('#__ketshop_product_variant')\r\n\t ->columns($columns)\r\n\t ->values($varValues);\r\n $db->setQuery($query);\r\n $db->execute();\r\n\r\n if(!empty($attribValues)) {\r\n\t// Inserts a new row for each attribute linked to the product variants.\r\n\t$columns = array('prod_id', 'var_id', 'attrib_id', 'option_value');\r\n\t$query->clear();\r\n\t$query->insert('#__ketshop_var_attrib')\r\n\t ->columns($columns)\r\n\t ->values($attribValues);\r\n\t$db->setQuery($query);\r\n\t$db->execute();\r\n }\r\n }\r\n\r\n // Updates the number of variants.\r\n $query->clear();\r\n $query->update('#__ketshop_product')\r\n\t ->set('nb_variants='.(int)count($varValues))\r\n\t ->where('id='.(int)$productId);\r\n $db->setQuery($query);\r\n $db->execute();\r\n }",
"public function updateInventory(): bool {\n if(!$this->inventory_loaded) {\n $this->system->error(\"Called update without fetching inventory!\");\n return false;\n }\n\n $player_jutsu = [];\n $player_items = [];\n\n $jutsu_count = 0;\n $item_count = 0;\n\n if(!empty($this->jutsu)) {\n foreach($this->jutsu as $jutsu) {\n $player_jutsu[$jutsu_count] = [\n 'jutsu_id' => $jutsu->id,\n 'level' => $jutsu->level,\n 'exp' => $jutsu->exp,\n ];\n $jutsu_count++;\n }\n }\n\n if($this->jutsu_scrolls && !empty($this->jutsu_scrolls)) {\n foreach($this->jutsu_scrolls as $jutsu_scroll) {\n $player_jutsu[$jutsu_count] = [\n 'jutsu_id' => $jutsu_scroll->id,\n 'level' => $jutsu_scroll->level,\n 'exp' => $jutsu_scroll->exp,\n ];\n $jutsu_count++;\n }\n }\n\n if($this->items && !empty($this->items)) {\n foreach($this->items as $item) {\n $player_items[$item_count] = [\n 'item_id' => $item['item_id'],\n 'quantity' => $item['quantity'],\n ];\n $item_count++;\n }\n }\n\n $player_jutsu_json = json_encode($player_jutsu);\n $player_items_json = json_encode($player_items);\n $player_equipped_jutsu_json = json_encode($this->equipped_jutsu);\n $player_equipped_items_json = json_encode($this->equipped_items);\n\n $this->system->query(\"UPDATE `user_inventory` SET\n\t\t\t`jutsu` = '{$player_jutsu_json}',\n\t\t\t`items` = '{$player_items_json}',\n\t\t\t`equipped_jutsu` = '{$player_equipped_jutsu_json}',\n\t\t\t`equipped_items` = '{$player_equipped_items_json}'\n\t\t\tWHERE `user_id` = '{$this->user_id}' LIMIT 1\"\n );\n\n $bloodline_jutsu = [];\n if($this->bloodline_id && !empty($this->bloodline->jutsu)) {\n $jutsu_count = 0;\n foreach($this->bloodline->jutsu as $jutsu) {\n if($jutsu->rank > $this->rank) {\n continue;\n }\n $bloodline_jutsu[$jutsu_count]['jutsu_id'] = $jutsu->id;\n $bloodline_jutsu[$jutsu_count]['level'] = $jutsu->level;\n $bloodline_jutsu[$jutsu_count]['exp'] = $jutsu->exp;\n $jutsu_count++;\n }\n\n $bloodline_jutsu_json = json_encode($bloodline_jutsu);\n\n $this->system->query(\"UPDATE `user_bloodlines` SET `jutsu` = '{$bloodline_jutsu_json}'\n\t\t\t\tWHERE `user_id` = '{$this->user_id}' LIMIT 1\"\n );\n }\n\n return true;\n }",
"public static function update_all_inventory() {\n\n\t\t$query_args = array(\n\t\t\t'fields' => 'ids',\n\t\t\t'post_type' => 'product',\n\t\t\t'nopaging' => true,\n\t\t\t'meta_key' => '_wc_shipwire_manage_stock',\n\t\t\t'meta_value' => 'yes',\n\t\t);\n\n\t\t// get the SKUs for product managed by shipwire\n\t\t$query = new WP_Query( $query_args );\n\n\t\tif ( $query->post_count ) {\n\n\t\t\t$success = self::update_inventory( $query->posts );\n\n\t\t\tif ( $success ) {\n\n\t\t\t\twc_shipwire()->log_update( sprintf( _n( 'Updated inventory for %d product.', 'Updated inventory for %d products.', $query->post_count, 'woocommerce-shipwire' ), $query->post_count ) );\n\n\t\t\t\tdo_action( 'wc_shipwire_all_inventory_updated', $query->posts );\n\t\t\t}\n\t\t}\n\n\t\treturn $query->post_count;\n\t}",
"public function testUpdateBundleProductWithOptions(): void\n {\n // Add the fixture bundle product to the fixture customer's wishlist\n $wishlist = $this->addBundleProductToWishlist(\n 'bundle-product-dropdown-options',\n 'simple-1'\n );\n $wishlistId = (int) $wishlist['addProductsToWishlist']['wishlist']['id'];\n $wishlistItemId = (int) $wishlist['addProductsToWishlist']['wishlist']['items_v2']['items'][0]['id'];\n $previousItemsCount = $wishlist['addProductsToWishlist']['wishlist']['items_count'];\n\n // Set the new values to update the wishlist item with\n $newQuantity = 5;\n $newDescription = 'This is a test.';\n $newBundleOptionUid = $this->getBundleProductOptionUid(\n 'bundle-product-dropdown-options',\n 'simple2'\n );\n\n // Update the newly added wishlist item as the fixture customer\n $query = $this->getUpdateQuery(\n $wishlistItemId,\n $newQuantity,\n $newDescription,\n $newBundleOptionUid,\n $wishlistId\n );\n $response = $this->graphQlMutation($query, [], '', $this->getHeaderMap());\n\n // Assert that the response has the expected base properties\n self::assertArrayHasKey('updateProductsInWishlist', $response);\n self::assertArrayHasKey('wishlist', $response['updateProductsInWishlist']);\n\n // Assert that the wishlist item count is unchanged\n $responseWishlist = $response['updateProductsInWishlist']['wishlist'];\n self::assertEquals($previousItemsCount, $responseWishlist['items_count']);\n\n // Assert that the wishlist item quantity and description are updated\n $responseWishlistItem = $responseWishlist['items_v2']['items'][0];\n self::assertEquals($newQuantity, $responseWishlistItem['quantity']);\n self::assertEquals($newDescription, $responseWishlistItem['description']);\n\n // Assert that the bundle option for this wishlist item is accurate\n self::assertNotEmpty($responseWishlistItem['bundle_options']);\n $responseBundleOption = $responseWishlistItem['bundle_options'][0];\n self::assertEquals('Dropdown Options', $responseBundleOption['label']);\n self::assertEquals(Select::NAME, $responseBundleOption['type']);\n\n // Assert that the selected value for this bundle option is updated\n self::assertNotEmpty($responseBundleOption['values']);\n $responseOptionSelection = $responseBundleOption['values'][0];\n self::assertEquals($newBundleOptionUid, $responseOptionSelection['uid']);\n self::assertEquals('Simple Product2', $responseOptionSelection['label']);\n self::assertEquals(1, $responseOptionSelection['quantity']);\n self::assertEquals(10, $responseOptionSelection['price']);\n }",
"private function updateProductVariants($params)\n {\n if ($params['variants']) {\n foreach ($params['variants'] as $productParams) {\n $product = Product::find($productParams['id']);\n $product->update($productParams);\n\n $product->status = $params['status'];\n $product->save();\n\n ProductInventory::updateOrCreate(['product_id' => $product->id], ['qty' => $productParams['qty']]);\n }\n }\n }",
"public function updateProductOptionCacheAction()\n {\n /** @var EntityManager $em */\n $em = $this->getServiceLocator()->get('entity_manager');\n\n /** @var MongoDBClient $mongoClient */\n $mongoClient = $this->getServiceLocator()->get('mongo_db');\n $collection = $mongoClient->newjennysplace->product_options_cache;\n\n $connection = $em->getConnection();\n $products = $connection->fetchAll(\"SELECT DISTINCT product_id FROM skus WHERE is_default = 0\");\n foreach($products as $product)\n {\n $id = intval($product['product_id']);\n $product_obj = $em->getReference('Library\\Model\\Product\\Product', $id);\n $product_options_document = new \\StdClass();\n $options = $em->getRepository('Library\\Model\\Product\\Option')->findByProduct($id);\n $option_value_map = [];\n\n if (count($options) > 0)\n {\n $skus = $product_obj->getSkus();\n\n foreach ($options as $option)\n {\n if (!isset($option_value_map[$option->getId()]))\n {\n $option_value_map[$option->getId()] = [];\n }\n\n // Go through each sku and get the available values\n foreach ($skus as $sku)\n {\n $sku_option_option_values = $sku->getSkuOptionOptionValues()->toArray();\n if (count($sku_option_option_values) > 0)\n {\n foreach ($sku_option_option_values as $sku_option_option_value)\n {\n $sku_option = $sku_option_option_value->getOptionOptionValue()->getOption();\n $sku_option_value = $sku_option_option_value->getOptionOptionValue()->getOptionValue();\n\n // If there is a match, add this to the table\n if ($option->getId() == $sku_option->getId())\n {\n $option_value_map[$option->getId()][$option->getId()] = $option;\n $option_value_map[$option->getId()]['values'][$sku_option_value->getId()] = $sku_option_value;\n }\n }\n }\n }\n }\n\n $product_options_document->product_id = $id;\n $product_options_document->name = $product_obj->getName();\n $product_options_document->product_code = $product_obj->getProductCode();\n $product_options_document->options = [];\n\n foreach($option_value_map as $key => $value)\n {\n $option = $value[$key];\n $option_values = $value['values'];\n $product_options_document->options[$option->getId()] = [];\n foreach($option_values as $option_value)\n {\n $product_options_document->options[$option->getId()][] = ['id' => $option_value->getId(), 'option_name' => $option->getName(), 'name' => $option_value->getName()];\n }\n\n $result = $collection->findOne(['product_id' => $id]);\n if (empty($result))\n {\n // Create a new document\n $collection->insertOne($product_options_document);\n echo \"Adding product \" . $id . \" option cache\\n\";\n }\n else\n {\n // Update document\n $collection->replaceOne(['product_id' => $id], $product_options_document);\n echo \"Updating product \" . $id . \" option cache\\n\";\n }\n }\n }\n }\n\n echo \"Complete!\\n\";\n exit(0);\n }",
"public function test_if_product_inventory_has_correct_format()\n {\n $this->product->setInventory([\n \"variations\" => true,\n \"stock\" => [\n \"42-B\" => true,\n \"42-W\" => false,\n \"43-B\" => true,\n \"43-W\" => true\n ]\n ]);\n\n $this->assertEquals($this->product->getInventory(), [\n \"variations\" => true,\n \"stock\" => [\n \"42-B\" => true,\n \"42-W\" => false,\n \"43-B\" => true,\n \"43-W\" => true\n ]\n ]);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
consume() without timeout should never time out. | public function testConsumeWithoutTimeoutShouldNeverFail()
{
$rate = new Rate(0.1, Rate::YEAR);
$bucket = new TokenBucket(1, $rate, new SingleProcessStorage());
$bucket->bootstrap(0);
$consumer = new BlockingConsumer($bucket);
$consumer->consume(1);
$this->addToAssertionCount(1);
} | [
"public function testConsumeShouldNotFailBeforeTimeout()\n {\n $rate = new Rate(10, Rate::SECOND);\n $bucket = new TokenBucket(10, $rate, new SingleProcessStorage());\n $bucket->bootstrap(0);\n $consumer = new BlockingConsumer($bucket, 1);\n \n $consumer->consume(10);\n $this->addToAssertionCount(1);\n }",
"public function consume() {\n\t\t\t$this->connect();\n\n\t\t\twhile ($this->channel->is_consuming()) {\n\t\t\t\t$this->channel->wait();\n\t\t\t}\n\n\t\t\t$this->channel->close();\n\t\t\t$this->connection->close();\n\t\t}",
"public function consume()\n {\n $this->consumed = true;\n }",
"public function runConsume()\n {\n $kafkaConsumer = $this->getRdKafkaConsumer();\n\n while (true) {\n $kafkaMessage = $kafkaConsumer->consume($this->getConsumerConfig()->getTimeoutMs());\n $this->consume($kafkaMessage);\n }\n }",
"public function consume();",
"public function throwExceptionOnConsumerTimeoutExceed(): void\n {\n $this->throwConsumerTimeoutExceededException = true;\n }",
"public function testConsumeCancel()\n {\n $channel = $this->_getCommonChannelMock();\n\n $queue = new Rabbit_Queue(\n $channel, self::QUEUE_NAME, $this->_getCommonFlagsMock()\n );\n\n /**\n * This could be improved, since the null value comes from an private\n * variable that is initialized when consume() is called, its value\n * should change. But testing that would require more effort than the\n * what I'm willing to put in this. This is okay for now.\n **/\n $channel->shouldReceive('basic_cancel')->with(null)->once();\n\n $queue->consume_cancel();\n }",
"private function stopConsuming()\n {\n if ($this->consumerTag) {\n try {\n $this->channel->basic_cancel($this->consumerTag);\n } catch(\\Exception $e) {\n }\n\n $this->consumerTag = '';\n }\n }",
"public function consume($tokens)\n {\n $timedOut = is_null($this->timeout) ? null : (microtime(true) + $this->timeout);\n while (!$this->bucket->consume($tokens, $seconds)) {\n self::throwTimeoutIfExceeded($timedOut);\n $seconds = self::keepSecondsWithinTimeout($seconds, $timedOut);\n\n // avoid an overflow before converting $seconds into microseconds.\n if ($seconds > 1) {\n // leave more than one second to avoid sleeping the minimum of one millisecond.\n $sleepSeconds = ((int) $seconds) - 1;\n\n sleep($sleepSeconds);\n $seconds -= $sleepSeconds;\n }\n\n // sleep at least 1 millisecond.\n usleep(max(1000, (int) ($seconds * 1000000)));\n }\n }",
"public function consume($queue, array $options = []);",
"public function testConsumerIsStoppable()\n {\n /** @var AbstractAsyncConsumer|MockObject $consumer */\n $consumer = $this->getMockForAbstractClass(AbstractAsyncConsumer::class);\n $consumer->expects($this->once())\n ->method('waitNoBlock')\n ->willReturnCallback(function () use ($consumer) {\n //Stop consumer after \"waiting\" for one message.\n $consumer->stop();\n });\n\n $consumer->consume($this->createMock(EndpointInterface::class));\n }",
"public function testConsumingMessages(): void\n {\n $this->queue->expects($this->exactly(4))\n ->method('get')\n ->willReturnOnConsecutiveCalls('foo', 'bar', 'baz', false);\n\n $consumer = new Consumer($this->queue, $this->loop, 1.0);\n $consumer->on('consume', $this);\n $consumer();\n\n $this->assertSame(3, $this->counter);\n }",
"public function waitAndTake(?int $timeout = null): ?Message;",
"function bdequeue($timeout) {\n\t\t$start = microtime(true);\n\n\t\twhile(true) {\n\t\t\t$data = $this->dequeue();\n\t\t\tif($data !== null) return $data;\n\t\t\t\t\n\t\t\tusleep($this->poll_frequency);\n\t\t\tif($timeout && (microtime(true) > $start + $timeout)) return null;\n\t\t}\n\t}",
"private function consumeCallResultQueue()\n {\n if ($this->channel && $this->callResultQueue) {\n $this->channel->basic_consume(\n $this->callResultQueue,\n '',\n false,\n false,\n false,\n false,\n [$this, 'onResponse']\n );\n }\n }",
"public function consume($queue, $callback)\n {\n $this->connect();\n $this->channel->basic_consume($queue, '', false, false, false, false, $callback);\n\n while (count($this->channel->callbacks)) {\n $this->channel->wait();\n }\n $this->disconnect();\n }",
"public function testConsumeInsufficientDontRemoveTokens()\n {\n $rate = new Rate(1, Rate::SECOND);\n $bucket = new TokenBucket(10, $rate, new SingleProcessStorage());\n $bucket->bootstrap(1);\n\n $this->assertFalse($bucket->consume(2, $seconds));\n $this->assertEquals(1, $seconds);\n\n $this->assertFalse($bucket->consume(2, $seconds));\n $this->assertEquals(1, $seconds);\n\n $this->assertTrue($bucket->consume(1));\n }",
"private function wait1()\n {\n try {\n $this->channel->wait(null, false, $this->options['timeout']);\n } catch (AMQPTimeoutException $e) {\n if ($this->consumed) {\n \\call_user_func($this->options['cleanUp']);\n $this->consumed = false;\n }\n\n $this->channel->wait(null, false, 0);\n }\n }",
"public function testConsumeFailInactive()\n {\n $scope = uniqid('scope_');\n $ownerType = uniqid('owner_');\n $ownerId = rand(1, 10000);\n\n $token = $this->tokenService->generate(\n $scope,\n $ownerType,\n $ownerId\n );\n\n $this->tokenService->invalidateToken($token);\n\n $this->tokenService->consume(\n $token->getHash(),\n $token->getScope(),\n $token->getOwnerType(),\n $token->getOwnerId()\n );\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Updates the request time. | protected function updateRequestTime()
{
$this->requestTimestamp = microtime(true);
} | [
"private function updateTime()\n {\n // Date string generation is (relatively) expensive. Since we only need HTTP\n // dates at a granularity of one second we're better off to generate this\n // information once per second and cache it.\n $this->currentTime = \\time();\n $this->currentHttpDate = \\gmdate(\"D, d M Y H:i:s\", $this->currentTime) . \" GMT\";\n\n foreach ($this->callbacks as $callback) {\n $callback($this->currentTime, $this->currentHttpDate);\n }\n }",
"protected function setTimeCheck() {\r\n\t\t$this->set('timecheck', $this->requesttime-$this->time);\r\n\t}",
"public function time(){\n\t\treturn $this->requestTime;\n\t}",
"public function getRequestTime()\n {\n return $this->request_time;\n }",
"public function updateTime(){\r\n\t\t$date = new DateTime();\r\n\t\t$this->_lastUpdate = date_timestamp_get($date);\t\t\r\n\t}",
"public static function getRequestTime()\n {\n return number_format(microtime(true) - $_SERVER['REQUEST_TIME'], 6);\n }",
"public function useServerTime()\n {\n $request = $this->httpRequest(\"v3/time\");\n if (isset($request['serverTime'])) {\n $this->info['timeOffset'] = $request['serverTime'] - (microtime(true) * 1000);\n }\n }",
"public function useServerTime()\n {\n $request = $this->httpRequest(\"v1/time\");\n if (isset($request['serverTime'])) {\n $this->info['timeOffset'] = $request['serverTime'] - (microtime(true) * 1000);\n }\n }",
"public function getRequestTime(): float;",
"public function setServerTime()\n {\n $server_time = $this->getTime();\n $this->time_offset = $server_time - (microtime(true)*1000);\n }",
"public function updateTimeProperties() : void\n {\n $now = new DateTime('now');\n $this->setUpdateDate($now);\n if ( $this->getCreateDate() == null ) {\n $this->setCreateDate($now);\n }\n }",
"protected function getRequestTime() {\n $request = $this->getRequest();\n return $request[\"REQUEST_TIME\"];\n }",
"public function getRequestTime(): \\DateTime;",
"public function update_time(){\n\t\t$this->Register->id = $this->Session->read('USER.Register.id');\n\t\t$this->Register->saveField('test_time', date('H:i:s'));\n\t}",
"public function updateNewTimeClient() {\n\t\treturn $this->Db->query(\"UPDATE `yp_sessions` \n\t\t\tSET `last_time` = {$this->Request->time} \n\t\t\tWHERE `hash` = '{$this->_thisClientHash()}'\");\n\t}",
"public static function timeSinceStartOfRequest()\n\t{\n\t\treturn self::secondsToTimeString(microtime(TRUE) - self::$requestTime);\n\t}",
"public static function set() {\n if ( session_status() != PHP_SESSION_NONE ) {\n $_SESSION[ 'API_REQUEST_TIMESTAMP' ] = time();\n }\n }",
"public function setTimeModified()\r\n {\r\n $this->updated_at = new \\DateTime();\r\n }",
"protected function setTime()\n {\n if ($this->time === null) $this->time = time();\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the name of the profile class associated with a user class | protected function computeProfileClassName($type)
{
$type = preg_replace('/^sfEasyAuth/', '', $type);
return ($type) ?
sfConfig::get('app_sf_easy_auth_profile_prefix') . ucfirst($type) . 'Profile' : '';
} | [
"public function getProfileClass(): string {\n $main_module = $this->xot->main_module;\n $class = 'Modules\\\\'.$main_module.'\\Models\\Profile';\n\n return $class;\n }",
"function get_user_class_name($class) {\n\tglobal $REL_LANG;\n\tswitch ($class) {\n\t\tcase UC_USER: return $REL_LANG->_('User');\n\n\t\tcase UC_POWER_USER: return $REL_LANG->_('Power user');\n\n\t\tcase UC_VIP: return $REL_LANG->_('VIP');\n\n\t\tcase UC_UPLOADER: return $REL_LANG->_('Releaser');\n\n\t\tcase UC_MODERATOR: return $REL_LANG->_('Moderator');\n\n\t\tcase UC_ADMINISTRATOR: return $REL_LANG->_('Administrator');\n\n\t\tcase UC_SYSOP: return $REL_LANG->_('Owner');\n\n\t\tcase UC_GUEST: return $REL_LANG->_('Guest');\n\t}\n\treturn \"\";\n}",
"public function getUserClass();",
"protected function getUserClassAsString(): string\n {\n return $this->config->getOption('laravel.user', 'App\\\\User');\n }",
"public function profileName();",
"public function getProfilePeerClassName()\n {\n\n $profileClass = sfConfig::get('app_sf_guard_plugin_profile_class', 'sfGuardUserProfile');\n if (!class_exists($profileClass))\n {\n throw new sfException(sprintf('The user profile class \"%s\" does not exist.', $profileClass));\n }\n $profilePeerClass = $profileClass.'Peer';\n // to avoid php segmentation fault\n class_exists($profilePeerClass);\n\n return $profilePeerClass;\n }",
"function get_the_hrb_user_class( $class, $user = '' ) {\n\t$user = get_the_hrb_userdata( $user );\n\n\treturn apply_filters( 'hrb_user_class', (array) $class, $user );\n}",
"public function getClass($user);",
"public function getUserProfileName(): string {\n\t\treturn ($this->userProfileName);\n\t}",
"public static function data_class_class_name()\n {\n return User::class_name();\n }",
"public function getProfileName()\n {\n return $this->profileName;\n }",
"public function getProfileName() {\n\t\treturn($this->profileName);\n\t}",
"public function getUserTypeName(){\n return $this->userType ? $this->userType->user_type_name : '- no user type-';\n }",
"public function getProfileType()\n {\n return $this->profileType;\n }",
"public function getProfileType() {\n return $this->profileType;\n }",
"public function getProfile()\n {\n return $this->getValue(self::PROFILE);\n }",
"public function getProfileType()\n {\n if (array_key_exists(\"profileType\", $this->_propDict)) {\n return $this->_propDict[\"profileType\"];\n } else {\n return null;\n }\n }",
"public function getProfileName(): string {\n\t\treturn ($this->profileName);\n\t}",
"function hrb_user_class( $class, $user = '' ) {\n\t// separates classes with a single space\n\techo 'class=\"' . esc_attr( join( ' ', get_the_hrb_user_class( $class, $user ) ) ) . '\"';\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Save Employees by Ajax | public function saveEmployees(){
if ($this->input->post()) {
$post = $this->input->post();
if(isset($post['employee']) && count($post['employee'])>0){
foreach($post['employee'] as $key=>$employee){
$pin = $post['pin'][$key];
$puk = $post['puk'][$key];
$data = array('employee'=>$employee,'pin'=>$pin,'puk'=>$puk);
$this->Assignmentproduct_model->update($data, $key);
}
echo json_encode(array('response'=>'success','message'=>sprintf(lang('updated_successfully'),lang('page_assignment_employee'))));
}
}
else{
echo json_encode(array('response'=>'error','message'=>$response));
}
exit;
} | [
"function ajax_employee()\n {\n $page_data['employee'] = $this->Crud_model->show_employee($_POST['id']);\n $this->load->view('template/view_employee', $page_data);\n \n if(isset($_POST['submit'])){\n $fname = $this->test_input($_POST['fname']);\n $lname = $this->test_input($_POST['lname']);\n $oname = $this->test_input($_POST['oname']);\n $address1 = $this->test_input($_POST['address1']);\n $address2 = $this->test_input($_POST['address2']);\n $city = $this->test_input($_POST['city']);\n $state = $this->test_input($_POST['state']);\n $zip_code = $this->test_input($_POST['zip']);\n $sos = $this->test_input($_POST['sos']);\n $dob = $this->test_input($_POST['dob']);\n $status = $this->test_input($_POST['status']);\n $hour_rate = $this->test_input($_POST['hour_rate']);\n $salary = $this->test_input($_POST['salary']);\n $start_date = $this->test_input($_POST['start_date']);\n \n $personal_info = array(\n \"other_name\" => $oname,\n \"address1\" => $address1,\n \"address2\" => $address2,\n \"city\" => $city,\n \"state\" => $state,\n \"zip_code\" => $zip_code\n );\n $json_personal_info = json_encode($personal_info);\n $employee_data = array(\n \"Firstname\" => $fname,\n \"Lastname\" => $lname,\n \"SSN\" => $sos,\n \"DOB\" => $dob,\n \"Status\" => $status,\n \"Hour_rate\" => $hour_rate,\n \"Salary\" => $salary,\n \"Start_date\" => $start_date,\n \"Personal_info\" => $json_personal_info\n );\n $query =$this->Crud_model->update_employee($employee_data, $_POST['id']);\n header('LOCATION: http://52.40.215.168/Simple-Paycheck-Service/Paycheckservice/index.php/App_Controller/view_all_employee');\n }\n }",
"public function ajaxEmpIntAdd() {\n //debug($this->request->data);\n\n $this->layout = null;\n $this->autoRender = false;\n // $this->Session->write(\"data\", $this->request->data);\n App::uses('UsersController', 'Controller');\n $user = new UsersController();\n $user->ajaxAdd(\"EmpresaInternacional\", $this->request->data[\"User\"], $this->request->data[\"EmpresaInternacional\"], \"empint\");\n }",
"public function saveAction()\n {\n\n if (!$this->request->isPost()) {\n return $this->dispatcher->forward(array(\n \"controller\" => \"employees\",\n \"action\" => \"index\"\n ));\n }\n\n $id = $this->request->getPost(\"id\");\n\n $employee = Employees::findFirstByid($id);\n if (!$employee) {\n $this->flash->error(\"An employee does not exist \" . $id);\n return $this->dispatcher->forward(array(\n \"controller\" => \"employees\",\n \"action\" => \"index\"\n ));\n }\n\n $employee->id = $this->request->getPost(\"id\");\n $employee->username = $this->request->getPost(\"username\");\n if($employee->password != $this->request->getPost(\"password\")) {\n $employee->password = $this->security->hash($this->request->getPost(\"password\"));\n }\n $employee->roleId = $this->request->getPost(\"role_id\");\n $employee->fullname = $this->request->getPost(\"fullname\");\n $employee->job = $this->request->getPost(\"job\");\n $employee->contacts = $this->request->getPost(\"contacts\");\n $employee->moreInfo = $this->request->getPost(\"more_info\");\n $employee->worksSince = $this->request->getPost(\"works_since\");\n\n if (!$employee->save()) {\n\n foreach ($employee->getMessages() as $message) {\n $this->flash->error($message);\n }\n\n return $this->dispatcher->forward(array(\n \"controller\" => \"employees\",\n \"action\" => \"edit\",\n \"params\" => array($employee->id)\n ));\n }\n\n $this->flash->success(\"The Employee's info was updated successfully\");\n return $this->dispatcher->forward(array(\n \"controller\" => \"employees\",\n \"action\" => \"index\"\n ));\n\n }",
"public function add_post(){\r\n $response = $this->EmployeeM->add_employee(\r\n $this->post('name'),\r\n $this->post('address'),\r\n $this->post('phone'),\r\n $this->post('position')\r\n );\r\n $this->response($response);\r\n }",
"public function saveAnEmploye() \n {\n\n }",
"public function add_employee()\n\t{\n\t\t$data['title']= 'New Employee';\n\t\t//get data from table tbl_employee\n\t\t$data['pageSource']= 'add';\n\t\t\t//Get all aCtIvE Responsibility from tbl_responsibility \n\t\t$fetchedReponsibilityData=$this->empModel->getAllResponsibility();\n\t\t$data['reponsibilityData']=$fetchedReponsibilityData;\n\t\t\n\t\t//Get all aCtIvE Away Message from tbl_away_message \n\t\t$fetchedAwayMessageData=$this->empModel->getAllAwayMessage();\n\t\t$data['awayMessageData']=$fetchedAwayMessageData;\n\t\t\n\t\t//Get all aCtIvE Job Title from tbl_jobtitle \n\t\t$fetchedJobTitleData=$this->empModel->getAllJobTitle();\n\t\t$data['jobTitleData']=$fetchedJobTitleData;\n\t\t\n\t\t\t\n\t\t//Get all aCtIvE Call Back Msg from tbl_callback_message \n\t\t$fetchedCallBackMsgData=$this->empModel->getAllCallBackMsg();\n\t\t$data['callBackMsgData']=$fetchedCallBackMsgData;\n\t\t\n\t\t$this->load->helper('form');\n\t\t$this->load->view('templates/admin_header',$data);\n\t\t$this->load->view('templates/navigation',$data);\n\t\t$this->load->view('templates/employee',$data);\n\t\t$this->load->view('templates/admin_footer',$data);\n\n\t}",
"public function updateEmployesAction()\n {\n\n $dataRequest = $this->request->getJsonPost();\n\n $dateTime = new \\DateTime();\n\n $fields = array(\n \"id\"\n );\n\n $optional = array(\n \"name\",\n \"document\",\n \"phone\",\n \"email\",\n \"address\",\n \"type_employee\",\n \"image\"\n );\n\n if ($this->_checkFields($dataRequest, $fields, $optional)) {\n\n try {\n\n $employes = Employes::findFirst(array(\n \"conditions\" => \"id = ?1\",\n \"bind\" => array(1 => $dataRequest->id)\n ));\n\n if (isset($dataRequest->name))\n $employes->name = $dataRequest->name;\n\n if (isset($dataRequest->document))\n $employes->document = $dataRequest->document;\n\n if (isset($dataRequest->phone))\n $employes->phone = $dataRequest->phone;\n\n if (isset($dataRequest->email))\n $employes->email = $dataRequest->email;\n\n if (isset($dataRequest->address))\n $employes->address = $dataRequest->address;\n\n if (isset($dataRequest->type_employee))\n $employes->type_employee = $dataRequest->type_employee;\n\n if (isset($dataRequest->image))\n $employes->image = $dataRequest->image;\n\n\n $employes->updated_at = $dateTime->format('Y-m-d H:i:s');\n\n if ($employes->save()){\n $this->setJsonResponse(ControllerBase::SUCCESS, ControllerBase::SUCCESS_MESSAGE, array(\n \"return\" => true,\n \"message\" => \"update\",\n \"status\" => ControllerBase::SUCCESS\n ));\n\n } else {\n\n $this->setJsonResponse(ControllerBase::FAILED, ControllerBase::SUCCESS_MESSAGE, array(\n \"return\" => false,\n \"message\" => EmployesConstants::EMPLOYES_UPDATE_FAILURE,\n \"status\" => ControllerBase::FAILED\n ));\n }\n \n } catch (Exception $e) {\n $this->logError($e, $dataRequest);\n }\n \n }\n }",
"public function editEntitlements() {\n if ($this->auth->isAllowed('entitleddays_user') == FALSE) {\n $this->output->set_header(\"HTTP/1.1 403 Forbidden\");\n } else {\n $employees = $this->input->post('employees', TRUE);\n $startdate = $this->input->post('startdate', TRUE);\n $enddate = $this->input->post('enddate', TRUE);\n $days = $this->input->post('days', TRUE);\n $type = $this->input->post('type', TRUE);\n $description = sanitize($this->input->post('description', TRUE));\n if (isset($startdate) && isset($enddate) && isset($days) && isset($type) && isset($employees)) {\n $this->load->model('entitleddays_model');\n $objectEmployees = json_decode($employees);\n foreach ($objectEmployees->employeeIds as $user_id) {\n $id = $this->entitleddays_model->addEntitledDaysToEmployee((int) $user_id, $startdate, $enddate, $days, $type, $description);\n echo $id . ',';\n }\n } else {\n $this->output->set_header(\"HTTP/1.1 422 Unprocessable entity\");\n }\n }\n }",
"public function storeNewEmployee()\n {\n $values = DatabaseHelpers::dbAddAudit(request()->all());\n $values['gender'] = Person::getGender($values['gender']);\n $values['title'] = Person::getTitle($values['title']);\n $person = Person::create($values);\n\n $employee_values['person_id'] = $person->id;\n $employee_values['employee_status_id'] = $values['employee_status_id'];\n $employee_values['employee_classification_id'] = $values['employee_classification_id'];\n $employee_values['start_date'] = $values['start_date'];\n $employee_values['end_date'] = $values['end_date'];\n\n $values = DatabaseHelpers::dbAddAudit($employee_values);\n $employee = Employee::create($values);\n\n ViewHelpers::flash($employee, 'employee');\n\n if ($employee) {\n $employee->searchable();\n\n return redirect()->to('employee/'.$employee->uuid.'/profile');\n }\n\n return redirect()->back()->withInput();\n }",
"public function createPostAjax(): void\n\t{\n\t\tif ($request = $this->input->request('model')) {\n\t\t\tif ($id = $this->{$this->controller_model}->insert($request)) {\n\t\t\t\t$this->restful->model('id', $id);\n\t\t\t} else {\n\t\t\t\tif (!$this->errors->has_error()) {\n\t\t\t\t\t$this->errors->add('Error on Insert.');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$this->send(201, 406);\n\t}",
"public function addEmployee()\n {\n $employees = [\n ['name' => 'khan', 'email' => 'khan@gmai.com', 'phone' => '123456789', 'salary' => '400000', 'department' => 'Accounting'],\n\n ['name' => 'inam', 'email' => 'inam@gmai.com', 'phone' => '1234556789', 'salary' => '500000', 'department' => 'marketing'],\n\n ['name' => 'umar', 'email' => 'umar@gmai.com', 'phone' => '12345678916', 'salary' => '600000', 'department' => 'programming'],\n\n ['name' => 'waqas', 'email' => 'waqas@gmai.com', 'phone' => '12347756789', 'salary' => '700000', 'department' => 'Mobile apps'],\n\n ['name' => 'latif', 'email' => 'latif@gmai.com', 'phone' => '1234567654689', 'salary' => '800000', 'department' => 'developer'],\n ];\n Employee::insert($employees);\n return 'record has been inserted successfully!';\n }",
"public function editEntity() {\n header(\"Content-Type: application/json\");\n if ($this->auth->isAllowed('list_employees') == FALSE) {\n $this->output->set_header(\"HTTP/1.1 403 Forbidden\");\n } else {\n $entityId = $this->input->post('entity', TRUE);\n $employees = $this->input->post('employees', TRUE);\n $objectEmployees = json_decode($employees);\n $this->load->model('users_model');\n $result = $this->users_model->updateEntityForUserList($entityId, $objectEmployees);\n echo $result;\n }\n }",
"public function createNewEmployee()\n\t{\n\t\t$rest_json\t=\tfile_get_contents(\"php://input\");\n $postData\t=\tjson_decode($rest_json, true);\n\t\t\n if(!empty($postData))\n\t\t{\n\t\t\t$userType \t = $this->common->getUserTypeByDesignationRef($postData['designation']);\n\t\t\t$userDetail['id'] \t\t\t= isset( $postData['id'] ) ? $postData['id'] : '';\n\t\t\t$userDetail['userType']\t\t= $userType;\n\t\t\t$userDetail['emailId']\t\t= $postData['emailId'];\n\t\t\t\n\t\t\t$userDetail['createdDate'] = $postData['createdDate'];\n\t\t\t$userDetail['status'] \t\t= $postData['status'];\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t$userProfile['firstName'] \t\t= $postData['firstName'];\n\t\t\t$userProfile['lastName'] \t\t= $postData['lastName'];\n\t\t\t$userProfile['mobile'] \t\t\t= $postData['mobile'];\n\t\t\t$userProfile['department'] \t\t= $postData['department'];\n\t\t\t$userProfile['designation'] \t= $postData['designation'];\n\t\t\tif( $userDetail['id'] <= 0 )\n\t\t\t{\n\t\t\t\t$password\t \t\t\t= str_pad(mt_rand(111111, 999999), 6, '0', STR_PAD_LEFT);\n\t\t\t\t$salt\t\t\t\t\t= \tmcrypt_create_iv(22, MCRYPT_DEV_URANDOM);\n\t\t\t\t$salt \t\t\t\t\t= \tbase64_encode($salt);\n\t\t\t\t$salt \t\t\t\t\t= \tstr_replace('+', '.', $salt);\n\t\t\t\t$hash \t\t\t\t\t= \tcrypt($password, '$2y$10$'.$salt.'$');\n\t\t\t\t$userDetail['password']\t=\t$hash;\n\t\t\t}\n\t\t\t$output \t\t\t\t= $this->common->createEmployee($userDetail,$userProfile);\n\t\t\tif($output == 0)\n\t\t\t{\n\t\t\t\t$result[\"error\"] \t= 'Data not insert.Please fill detail properly.';\n\t\t\t}\n\t\t\tif($output == 1)\n\t\t\t{\n\t\t\t\t$emailTemplate = $this->common->getEmailTemplate(3);\n\t\t\t\t$variables = array\n\t\t\t\t\t(\n\t\t\t\t\t\t'receiver_name' \t=> ucfirst($userProfile['firstName']).' '.ucfirst($userProfile['lastName']),\n\t\t\t\t\t\t'email'\t\t\t\t=> $userDetail['emailId'],\n\t\t\t\t\t\t'password'\t\t\t=> $userDetail['password'],\n\t\t\t\t\t\t'to'\t\t\t\t=> $userDetail['emailId'],\n\t\t\t\t\t);\n\t\t\t\t$this->common->sendEmail($variables,$emailTemplate);\n\t\t\t\t$result[\"success\"] \t= 'Employee created successfully.';\n\t\t\t}\n\t\t\tif($output == 2)\n\t\t\t{\n\t\t\t\t$result[\"error\"] \t= 'Email already exist.';\n\t\t\t}\n\t\t\tif($output == 3)\n\t\t\t{\n\t\t\t\t$result[\"success\"] \t= 'Employee updated successfully.';\n\t\t\t}\n\t\t\theader('Content-Type: application/json');\n\t\t\techo json_encode($result);exit;\n\t\t}\n\t}",
"public function ajax_guardar_empresaAction(Request $request)\n {\n $id = (false);\n $id_cont = $request->get('id_cont');\n $id_empre = $request->get('id_empre');\n $valid = false;\n if( $request->getMethod() == 'POST' )\n {\n $em = $this->getDoctrine()->getManager();\n\n $Fkcontacto = $em->getRepository('AdminBundle:Contacto')->findOneBy(array('id' => $id_cont));\n $Fkempresa = $em->getRepository('AdminBundle:Empresa')->findOneBy(array('id' => $id_empre));\n\n if( !$cli_empre = $em->getRepository('AdminBundle:ContacEmpre')->findOneBy(array( 'fkContacto' => $id_cont,'fkEmpresa'=>$id_empre )) )\n {\n $cli_empre = new ContacEmpre();\n $cli_empre->setFkContacto($Fkcontacto);\n $cli_empre->setFkEmpresa($Fkempresa);\n $em->persist($cli_empre);\n $em->flush();\n $valid = true;\n }\n }\n \n $response = new JsonResponse();\n $response->setData(array('valid'=>$valid,'cli_empre' => $cli_empre->getId()));\n return $response;\n }",
"public function hire_employee()\n {\n if (Authenticate::is_player()) {\n if (isset($_POST['token']) && Authenticate::is_valid_token($_POST['token'])) {\n $this->model_employee = Employee::getInstance();\n\n /*\n * populate employee hiring data.\n * invoke method to save employee to game data.\n * reload player employee after hiring.\n * convert to json format and binding these data.\n */\n $employee = $_POST['employee_id'];\n $salary = $_POST['employee_salary'];\n\n $result = $this->model_employee->hire_employee($employee, $salary);\n\n $employee = $this->model_employee->get_player_employee();\n\n $binding = array\n (\n \"result_var\" => \"session_ready\",\n \"status_var\" => $result,\n \"employee_var\" => json_encode($employee, JSON_PRETTY_PRINT)\n );\n\n binding_data($binding);\n } else {\n transport(\"error404\");\n }\n } else {\n $binding = array(\"result_var\" => \"no_session\");\n binding_data($binding);\n }\n }",
"private function setEmployee($data)\n {\n \t$validator = Validator::make($data, [\n\t\t\t\t\t\t'emp_id' => 'required|unique:employee',\n\t\t\t\t\t\t'emp_name' => 'required',\n\t\t\t \t'ip_address' => 'required|ip|unique:employee'\n\t\t\t \t]);\n\n \tif ($validator->fails()) {\n \t\t$this->sendResponse($validator->messages()->toJson(), 400);\n \t\texit;\n \t}\n\n\t\t$this->sendResponse($this->employeeModel->createEmployee($data), 200);\n }",
"public function saveAction()\n\t{\n\t\t/* Use same name in databse */\n\t\t$a_Params = $this->params->requests->getParams();\n\t\tif ( $this->params->requests->isAjax())\n\t\t{\n\t\t\t$service = $this->services->System->Object->Save($a_Params);\n\t\t\techo $service->getMessage();\n\t\t}\n\n\t\t/* We process in ajax, no need to render view and layout */\n\t\t$this->setHtmlRender(false);\n\t\t$this->setLayoutRender(false);\n\t}",
"private function CRUDExecuterEmployeeAdd() {\n\t\tif ((isset($_POST['email']) && !empty($_POST['email'])) && (isset($_POST['firstName']) && ($_POST['firstName'] === '0' || !empty($_POST['firstName']))) && (isset($_POST['lastName']) && ($_POST['lastName'] === '0' || !empty($_POST['lastName'])))) {\n\t\t\t$email = htmlspecialchars($_POST['email']);\n\t\t\t$firstName = htmlspecialchars($_POST['firstName']);\n\t\t\t$lastName = htmlspecialchars($_POST['lastName']);\n\n\t\t\tif (filter_var($email, FILTER_VALIDATE_EMAIL)) {\n\t\t\t\tif (!$this->_employeeManager->getOneEmployee($email)) {\n\t\t\t\t\t$this->_employeeManager->insertOneEmployee(array('email' => $email, 'firstName' => $firstName, 'lastName' => $lastName));\n\n\t\t\t\t\t$this->_informationMessageCreate = 'The new employee has been correctly created';\n\t\t\t\t} else {\n\t\t\t\t\t$this->_errorMessageCreate = 'This email is already in use';\n\t\t\t\t\t$this->CRUDRouter('employees');\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$this->_errorMessageCreate = 'Please enter a valid email';\n\t\t\t\t$this->CRUDRouter('employees');\n\t\t\t}\n\t\t} else {\n\t\t\t$this->_errorMessageCreate = 'Please fill in all fields';\n\t\t\t$this->CRUDRouter('employees');\n\t\t}\n\t}",
"public function addentitleddaysemployee($id) {\n if (!$this->server->verifyResourceRequest(OAuth2\\Request::createFromGlobals())) {\n $this->server->getResponse()->send();\n } else {\n $this->load->model('entitleddays_model');\n $startdate = $this->input->post('startdate');\n $enddate = $this->input->post('enddate');\n $days = $this->input->post('days');\n $type = $this->input->post('type');\n $description = $this->input->post('description');\n $result = $this->entitleddays_model->addEntitledDaysToEmployee($id, $startdate, $enddate, $days, $type, $description);\n if (empty($result)) {\n $this->output->set_header(\"HTTP/1.1 422 Unprocessable entity\");\n } else {\n echo json_encode($result);\n }\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
TODO: Implement deleteChefEquipe() method. | public function deleteChefEquipe($id)
{
$ChefEquipe = self::$idaoImpChefEquipe->findById(self::CLASSNAMECHEFEQUIPE, $id);
if ($ChefEquipe->getAdresse())
self::$adresseImpMetier->deleteAdresse($ChefEquipe->getAdresse()->getId());
if ($ChefEquipe->getImage())
self::$imageImpMetier->deleteImage($ChefEquipe->getImage()->getId());
self::$idaoImpChefEquipe->delete($ChefEquipe);
} | [
"public function setChefEquipe(?string $chefEquipe): Chantiers {\n $this->chefEquipe = $chefEquipe;\n return $this;\n }",
"public function UpdateChefEquipe($data)\n {\n\n\n if (isset($data['adresse']))\n $data['adresse'] = self::$adresseImpMetier->updateAdresse($data['adresse']);\n\n if (isset($data['image']))\n $data['image'] = self::$imageImpMetier->updateImage($data['image']);\n\n\n $chefEquipe = self::$idaoImpChefEquipe->findById(self::CLASSNAMECHEFEQUIPE, $data['id']);\n return self::$idaoImpChefEquipe->UpdateChefEquipe($chefEquipe, $data);\n\n }",
"public function deleteEquipe($id){\n\t\t\t\t\t$sql = \"DELETE FROM equipe WHERE equipe.id = \".$id.\"\";\n\t\t\t\t\t if($this->db != null)\n\t\t\t\t\t {\n\t\t\t\t\t return $this->db->exec($sql);\n\t\t\t\t\t }else{\n\t\t\t\t\t return null;\n\t\t\t\t\t }\n\t\t\t\t\t }",
"public function delete()\n {\n $this->forge->deleteRecipe($this->id);\n }",
"public function UpdateChefEquipe($chefEquipe, $data)\n {\n\n $chefEquipe->setEmail($data['email']);\n $chefEquipe->setPlainPassword($data['password']);\n $chefEquipe->setNom($data['nom']);\n $chefEquipe->setPrenom($data['prenom']);\n if (isset($data['image']))\n $chefEquipe->setImage($data['image']);\n if (isset($data['imageCover']))\n $chefEquipe->setImageCover($data['imageCover']);\n $chefEquipe->setUsername($data['username']);\n $chefEquipe->setSexe($data['sexe']);\n $chefEquipe->setAboutme($data['aboutme']);\n //$chefEquipe->setSkills();\n $chefEquipe->setNumtel($data['numtel']);\n if (isset($data['adresse']))\n $chefEquipe->setAdresse($data['adresse']);\n\n\n try {\n\n\n $chefEquipe = static::$documentManager->merge($chefEquipe);\n static::$documentManager->flush();\n\n } catch (Exception $e) {\n echo 'Exception reçue : ', $e->getMessage(), \"\\n\";\n }\n return $chefEquipe;\n }",
"public function getChefEquipe(): ?string {\n return $this->chefEquipe;\n }",
"public function getIdChef()\n {\n return $this->id_chef;\n }",
"public function setChefEquipe(?string $chefEquipe): AffectationsCharge {\n $this->chefEquipe = $chefEquipe;\n return $this;\n }",
"abstract protected function delete_pickup_data();",
"public function changeEtatChefEquipe($data)\n {\n $etat = self::$etatImpMetier->getEtatByNum($data['etat']['num']);\n $chefEquipe = self::$idaoImpChefEquipe->findById(self::CLASSNAMECHEFEQUIPE, $data['id']);\n return self::$idaoImpChefEquipe->changeEtatDocument($chefEquipe, $etat);\n\n }",
"function delSamFabric($fid)\r\n\t{\r\n\t\t\r\n\t\t//delete from product\r\n\t\t$delete1 = \"DELETE FROM sample_fabric WHERE fabric_id='$fid'\";\r\n\t\t\r\n\t\t//execute quary\r\n\t\t$query1\t= mysql_query($delete1);\r\n\t\t\r\n\t}",
"public function testDeleteDismantleReusableEquipmentAndParts()\n {\n }",
"public function deleteChosenElective($elective){\n\t\t\t$database = new DataBase();\n\t\t\t$sql = \"DELETE FROM `chElectives` WHERE name='$elective'\";\n\t\t\t$query = $database->executeQuery($sql, 'Failed find user');\n\t\t}",
"public function getIdChef()\n {\n return $this->idChef;\n }",
"public function delete($lunch) { ; }",
"public function delete($tipo_equipo);",
"public function testDossierItemsDelete()\n {\n }",
"public function testDeleteEI() {\r\n $electronicItemTDG = new ElectronicItemTDG;\r\n\r\n $eIData = new \\stdClass();\r\n $eIData->id = 1;\r\n $eIData->serialNumber = \"ABC123\";\r\n $eIData->ElectronicSpecification_id = 2;\r\n $eI = new ElectronicItem($eIData);\r\n\r\n $electronicItemTDG->delete($eI);\r\n\r\n $this->assertDatabaseMissing('ElectronicItem', [\r\n 'id' => 1,\r\n 'serialNumber' => 'ABC123',\r\n ]);\r\n }",
"public function removeAction()\n {\n if (!$this->getRequest()->isXmlHttpRequest()) {\n $this->getResponse()->setBody($this->_getHelper()->__('Invalid request!'));\n }\n\n try {\n /** @var $voucher Innobyte_EmagMarketplace_Model_Resource_Sales_Quote_Voucher_Collection */\n $collection = Mage::getResourceModel('innobyte_emag_marketplace/sales_quote_voucher_collection');\n $collection\n ->addFieldToFilter('entity_id', $this->getRequest()->getParam('quote_id'))\n ->addFieldToFilter('emag_voucher_id', $this->getRequest()->getParam('voucher_id'));\n\n /** @var $voucher Innobyte_EmagMarketplace_Model_Sales_Quote_Voucher */\n $voucher = $collection->getFirstItem();\n\n if ($collection->getSize()) {\n $voucher->delete();\n $this->getResponse()->setBody(\n $this->_getHelper()->__(\n 'eMAG Voucher successfully deleted!'\n )\n );\n }\n } catch (Exception $e) {\n $this->getResponse()->setBody(\n $this->_getHelper()->__(\n 'There was an error while removing voucher. Please try again!'\n )\n );\n Mage::log($e->getMessage());\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Stores a new translated fragment | public function store (Request $request)
{
$data = $request->validate([
'key' => 'required|string',
'value' => 'required|string',
'language_id' => 'required|string'
]);
$fragment = Fragment::create($data);
return Response::redirect('trans.index')
->with(compact('fragment'))
->send();
} | [
"public function store(CreateTexteSiteLangueRequest $request)\n {\n if (auth()->user() && !auth()->user()->isAdmin()) {\n return redirect(route('home-user'));\n }\n\n $input = $request->all();\n\n $texteSiteLangue = $this->texteSiteLangueRepository->create($input);\n\n Flash::success('Texte Site Langue saved successfully.');\n\n return redirect(route('texteSiteLangues.index'));\n }",
"protected function persistTranslations()\n\t{\n\t\tTranslation::patchTranslationsForModel($this, $this->getActiveLanguage(), $this->translatedAttributes);\n\t}",
"public function editTranslation()\n\t{\n\t\t// Get Hash of the translation\n\t\t$string = $this->get('PARAMS.hash');\n $lang = $this->get('PARAMS.lang');\n\n\t\t// Load it from database\n\t\t$translation = new \\model\\translations;\n\t\t$translation->load( array('string = :string AND language = :lang', \n array(':string' => $string, ':lang' => $lang)));\n\n\t\t// Change the attributes\n $translation->hash = $translation->hash ? $translation->hash : \\controller\\helper::randStr();\n $translation->string = $string;\n\t\t$translation->translation = trim($this->get('POST.translation'));\n\t\t$translation->language = $lang;\n\n\t\t// Save it!\n\t\t$translation->save();\n\t}",
"public function saveTranslation()\r\n {\r\n $post = Yii::$app->request->post();\r\n if(isset($post['Translation'])) {\r\n /** @var ActiveRecord $owner */\r\n $owner = $this->owner;\r\n $fields = $this->getTranslationFields();\r\n $modelId = $this->returnModelId();\r\n foreach($fields as $field) {\r\n $attributeName = $field->attribute;\r\n if(isset($post['Translation'][$modelId][$attributeName])) {\r\n foreach($post['Translation'][$modelId][$attributeName] as $lang => $array) {\r\n if(isset($array['translation'])) {\r\n $field->value = $array['translation'];\r\n $field->model = new Translation;\r\n $field->attributeExpression = \"[$modelId][$attributeName][$lang]translation\";\r\n if($field->validate()){\r\n Translation::commit($modelId, $owner->id, $attributeName, $lang, $field->value);\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }",
"function block_custom_block_translate_submit($form, &$form_state) {\n $langcode = NULL;\n $delta = $form_state['values']['delta'];\n if (isset($form_state['values']['langcode'])) {\n $langcode = $form_state['values']['langcode'];\n }\n block_custom_block_save($form_state['values'], $form_state['values']['delta'], $langcode);\n backdrop_set_message(t('The block translation has been saved.'));\n $form_state['redirect'] = 'admin/structure/block/manage/' . $delta . '/translation';\n}",
"public function afterStore($data){\n \n $data['info_translation'] = JRequest::getVar( 'info_translation', '', 'POST', 'STRING', JREQUEST_ALLOWRAW );\n \n if(isset($data['info_translation']) && $data['info_translation'] != ''){\n $fields = array();\n $fields['body'] = trim($data['info_translation']);\n CrBcHelpers::storeTranslation($fields, $data[$this->identity_column], 'plugin_payment_rave');\n }\n }",
"public function saveinnlang(){\n $this->_iEditLang = oxRegistry::getConfig()->getRequestParameter('new_lang');\n $this->save();\n }",
"abstract protected function saveTranslation($category, $name, $language, $content);",
"public function persist() {\n parent :: persist();\n EfrontSearch :: removeText('news', $this -> news['id'], 'data');\n EfrontSearch :: insertText($this -> news['data'], $this -> news['id'], \"news\", \"data\");\n EfrontSearch :: removeText('news', $this -> news['id'], 'title');\n EfrontSearch :: insertText($this -> news['title'], $this -> news['id'], \"news\", \"title\");\n }",
"function locale_translate_edit_form_submit($form, &$form_state) {\n $lid = $form_state['values']['lid'];\n foreach ($form_state['values']['translations'] as $key => $value) {\n $translation = db_query(\"SELECT translation FROM {locales_target} WHERE lid = :lid AND language = :language\", array(':lid' => $lid, ':language' => $key))->fetchField();\n if (!empty($value)) {\n // Only update or insert if we have a value to use.\n if (!empty($translation)) {\n db_update('locales_target')\n ->fields(array(\n 'translation' => $value,\n ))\n ->condition('lid', $lid)\n ->condition('language', $key)\n ->execute();\n }\n else {\n db_insert('locales_target')\n ->fields(array(\n 'lid' => $lid,\n 'translation' => $value,\n 'language' => $key,\n ))\n ->execute();\n }\n }\n elseif (!empty($translation)) {\n // Empty translation entered: remove existing entry from database.\n db_delete('locales_target')\n ->condition('lid', $lid)\n ->condition('language', $key)\n ->execute();\n }\n\n // Force JavaScript translation file recreation for this language.\n _locale_invalidate_js($key);\n }\n\n drupal_set_message(t('The string has been saved.'));\n\n // Clear locale cache.\n _locale_invalidate_js();\n cache_clear_all('locale:', 'cache', TRUE);\n\n $form_state['redirect'] = 'admin/config/regional/translate/translate';\n return;\n}",
"function enregistrerPassage(){\n $this->vue->titre='';\n $this->informations();\n $tablePassages=new Zoraux_Modeles_Passage();\n if(empty($_GET['id'])){\n //Si l'id est vide, c'est un nouveau passage\n $passage=$tablePassages->newPassage();\n }else{\n //Si l'id n'est pas vide, il s'agit d'une edition de passage\n $passage=$tablePassages->get($_GET['id']);\n }\n $passage->date=$_POST['date'];\n $passage->heurePassage=$_POST['heurePassage'];\n $passage->epreuve_id=$_POST['epreuve_id'];\n $passage->eleve_id=$_POST['eleve_id'];\n $passage->jury_id=$_POST['jury_id'];\n $passage->salle_id=$_POST['salle_id'];\n $passage->enregistrer();\n }",
"static public function saveLangTrans($lang) {\n $className = 'LangTrans';\n $object = new $className;\n $object->createTable();\n $dataUrl = DATA_FILE.$className.'.json';\n if (!file_exists($dataUrl)) {\n $dataUrl = DATA_LOCAL_FILE.$className.'.json';\n }\n if (file_exists($dataUrl)) {\n $items = json_decode(file_get_contents($dataUrl), true);\n $itemTranslation = 'translation_'.$lang;\n foreach ($items as $item) {\n if (isset($item[$itemTranslation])) {\n $query = 'UPDATE '.Db::prefixTable('LangTrans').'\n SET '.$itemTranslation.'=\"'.$item[$itemTranslation].'\"\n WHERE code=\"'.$item['code'].'\"';\n Db::execute($query);\n }\n }\n }\n }",
"protected function save() {\r\n $this->template->save($this->word->getPath().$this->word->getFilename());\r\n }",
"public function save()\n\t{\n\t\treturn Message::saveMessageTranslation([\t\t\t\n\t\t\t'id' => $this->id, \n\t\t\t'language' => $this->language,\n\t\t\t'translation' => $this->translation\n\t\t]);\n\t}",
"public function storeContent()\n {\n }",
"function savePosition()\t{\n\t\tif ($this->FE_USER->user) {\n\t\t\t$this->FE_USER->uc['tt_news'][$this->treeName] = serialize($this->stored);\n\t\t\t$this->FE_USER->writeUC();\n\t\t} else {\n\t\t\tsetcookie($this->treeName, serialize($this->stored));\n\t\t}\n\t}",
"private function SaveNew()\n {\n $treeBuilder = new TreeBuilder(new PageTreeProvider($this->site));\n $treeBuilder->Insert($this->page, $this->parent, $this->previous);\n }",
"function createtranslation($data, $form, $edit) {\n\t\t\tif($this->currentRecord->hasExtension('Translatable')) {\n\t\t\t$langCode = Convert::raw2sql($_REQUEST['newlang']);\n\t\n\t\t\tTranslatable::set_current_locale($langCode);\n\t\t\t$translatedRecord = $this->currentRecord->createTranslation($langCode);\n\t\n\t\t\t$this->currentRecord = $translatedRecord;\n\t\t\t\n\t\t\t// TODO Return current language as GET parameter\n\t\t\treturn $this->edit(null);\n\t\t}\n\t}",
"public function updateTranslations();"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Method to get the bookends | public function getBookends()
{
return $this->bookends;
} | [
"public function get_bookings() {\n\t\treturn $this->bookings;\n\t}",
"public function getBooks(){\n\t\treturn $this->bookbeatjson->getBooks();\n\t}",
"public function getBookings()\n {\n return $this->hasMany(Bookings::className(), ['rideId' => 'rideId']);\n }",
"public function getBooksOnShelf()\n {\n //\n }",
"public function currentDayBookings(){\n\n return $this->where('start_date', date('Y-m-d'))->get();\n\n }",
"public function getEndings();",
"public function getBookingevents()\n {\n return $this->bookingevents;\n }",
"function get_bookings(){\n\t\t$bookings = array();\n\t\tforeach( $this->get_event()->get_bookings()->bookings as $EM_Booking ){\n\t\t\tforeach($EM_Booking->get_tickets_bookings()->tickets_bookings as $EM_Ticket_Booking){\n\t\t\t\tif( $EM_Ticket_Booking->ticket_id == $this->ticket_id ){\n\t\t\t\t\t$bookings[$EM_Booking->booking_id] = $EM_Booking;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$this->bookings = new EM_Bookings($bookings);\n\t\treturn $this->bookings;\n\t}",
"public function getItemBookedOutDates() {\n\t\t\n\t\t$Params = $this->getURLParams();\n\t\t\n\t\t// Instigate a new object\n\t\t$itemDatesBookedOutOn = new item_booking();\n\t\t\n $itemDatesBookedOutOn = item_Booking::get()->filter(array(\n\t\t\t\t'ItemID' => $Params['ID'],\n\t\t\t\t'itemReturned' => 'false'\n\t\t));\t\t\t\t\n\n\t\treturn $itemDatesBookedOutOn;\n\t}",
"public function getLendBooks()\n {\n $sql = \"SELECT book.title, \n\t member.firstname, \n\t member.lastname\n FROM loan INNER JOIN book ON loan.book_id = book.id\n\t INNER JOIN member ON loan.member_id = member.id\n WHERE book.loan_status = 1\";\n\n return $this->makeStatement($sql);\n }",
"public function getOrdersBooks()\n\t{\n\t\treturn $this->ordersBooks;\n\t}",
"public function getBookings()\n {\n return $this->hasMany(Booking::className(), ['flight_id' => 'id']);\n }",
"public function getHotelBookings(): HotelBookings\n {\n return $this->hotelBookings;\n }",
"public function getBookings()\n {\n\n $from = Util::getLatestRequestTime('booking');\n $to = Util::getNowTime();\n\n $client = new Client([\n 'base_uri' => $this->baseUrl,\n 'timeout' => $this->timeout\n ]);\n\n $url = $this->apiURL . 'bookings?from=' . $from . '&to=' . $to . '&with_items=true';\n\n $response = $client->request('GET', $url, [\n 'headers' => [\n 'Authorization' => $this->apiKey\n ]\n ]);\n\n $this->saveRequestTime($this->apiKey, 'booking');\n \n Booking::saveNewBookings($response->getBody());\n BookingItem::saveItems($response->getBody());\n }",
"public function getBookings() {\n $this->db->query(\"SELECT b.id AS b_id, \n booking_reference AS b_ref, \n booking_date AS b_date, \n c.first_name AS f_name, \n c.last_name AS s_name, \n c.address AS address, \n c.twitter_alias as twitter\n FROM bookings AS b\n LEFT JOIN customers AS c \n ON b.customerID = c.id\n \");\n\n return $this->db->getMultipleObjects();\n }",
"public function GetCurrent_ClosedBookingsAction(){\n\t\t$KeyArr=array(\"HRID\",\"UserID\");\n\t\t$this->mparams=$this->ValidateInputs($this->mparams, $KeyArr);\n\t\t//TODO:should we put a limit to number of enteries to return, just to make it fast...\n\t\t $cbentry = new CurrentBookingEntry($this->mparams['HRID'],$this->mparams['UserID'],$this->mparams[DBV_DBOO]);\n\t\t \n\t\treturn $cbentry->GetCurrentClosedBookings();\n\t}",
"public static function find_books_by_date_range($start, $end)\n {\n $books = new Books();\n $BooksbyDate = array();\n try {\n $stmt = $books->range($start, $end, 'StartDate');\n while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) {\n extract($row);\n\n $p = (object) array(\n \"BookID\" => (int) $BookID,\n \"StartDate\" => $StartDate,\n \"StartAt\" => (int) $StartAt,\n \"CustomerID\" => (int) $CustomerID,\n \"ServiceID\" => (int) $ServiceID,\n \"Durtion\" => (int) $Durtion,\n \"ServiceTypeID\" => (int) $ServiceTypeID,\n \"Notes\" => $Notes,\n );\n\n array_push($BooksbyDate, $p);\n }\n if (count($BooksbyDate) == 0)\n throw new Exception(\"Book not found\", 404);\n $hii = range($start, $end);\n BookingService::array_sort_by_column($BooksbyDate, 'StartDate');\n return $BooksbyDate;\n } catch (Exception $e) {\n throw $e;\n }\n }",
"protected function loadCloseoutList()\n {\n return $this->conference\n ->completed()\n ->with($this->relations)\n ->byBrand( $this->getActiveBrands() )\n ->orderBy('start_date')->get();\n }",
"public function get_booklist()\n {\n $mybooks = new BooksParse(\"bookdata/\".$this->username.\".xml\");\n return $mybooks->display_books(3);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the value of field goods_pay_price | public function getGoodsPayPrice()
{
return $this->goods_pay_price;
} | [
"public function getGoodsPrice()\n {\n return $this->goods_price;\n }",
"public function getPgoodsPrice()\n {\n return $this->pgoods_price;\n }",
"function getPrice(){\n $this->checkProcess();\n return $this->data['price'];\n }",
"public function getPrice()\n {\n return parent::getValue('price');\n }",
"public function getPrice() {\n return $this->_getField(\"price\", 0, 2);\n }",
"public function getPaymentPrice() {\r\n\r\n\t\tself::errorReset();\r\n\t\t$this->reload();\r\n\t\treturn $this->paymentPrice;\r\n\t}",
"public function getPrice()\n {\n return ($this->payment_sum+$this->payment_discount);\n }",
"public function getBuyboxPrice()\n {\n return $this->_fields['BuyboxPrice']['FieldValue'];\n }",
"public function getPrice() {\n\t\treturn get_post_meta($this->post->ID,\"price\",TRUE);\n\t}",
"public function getValue()\n {\n return $this->price;\n }",
"public function getItemPrice() \n {\n return $this->_fields['ItemPrice']['FieldValue'];\n }",
"public function getGoodsMarketprice()\n {\n return $this->goods_marketprice;\n }",
"public function getGoods_selling_price()\r\n {\r\n \t return $this->_goods_selling_price;\r\n }",
"function osc_item_price() {\n if(osc_item_field(\"i_price\")=='') return null;\n else return (float) osc_item_field(\"i_price\");\n }",
"public function getBuyablePrice()\n {\n return $this->attributes['price'];\n }",
"public function getBuyPrice() {\n return $this->buyPrice;\n }",
"public function getMemberGoodsPrice()\n {\n return $this->member_goods_price;\n }",
"public function getFieldPriceSell()\n {\n return $this->fieldPriceSell;\n }",
"function getProdPrice(){\r\n\t\t\t\treturn $this->ProdPrice;\r\n\t\t\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Try to find entity class in possible NS | private function findEntityWholeName($className, $entity)
{
$existingClass = NULL;
// try to locate class in this namespace
if (!class_exists($className)) {
// try to find in namespace of entity
$reflection = new ClassType($entity);
$existingClass = $reflection->getNamespaceName() . "\\" . $className;
// try to locate in parents namespace (recursive)
if (!class_exists($existingClass)) {
$parentClass = $reflection->getParentClass();
while ($parentClass !== NULL) {
$existingClass = $reflection->getParentClass()->getNamespaceName() . "\\" . $className;
// not found try to find in parent namespace
if (!class_exists($existingClass)) {
$rc = new ClassType($parentClass);
$parentClass = $rc->getParentClass();
$existingClass = NULL;
} else {
$parentClass = NULL;
}
}
}
}
else {
$existingClass = $className;
}
return $existingClass;
} | [
"function getEntityClass();",
"function entity_toolbox_get_entity_class_info($entity_type = NULL, $class = NULL) {\n\n}",
"abstract public function getEntityNamespace();",
"public function detectEntityTypes();",
"public function getUserEntityClass();",
"private static function getClassEntityType() {\n $classes = class_parents(get_called_class());\n if (sizeof($classes) >= 2) {\n // If there are at least 2 parent classes, such as Entity and Node.\n $classnames = array_values($classes);\n $classname = $classnames[sizeof($classes) - 2];\n $class = new \\ReflectionClass($classname);\n $entity_type = Utils::makeSnakeCase(\n $class->getShortName()\n );\n\n return $entity_type;\n }\n elseif (sizeof($classes) == 1) {\n // If an entity such as User is calling the class directly, then entity type will be User itself.\n $classname = get_called_class();\n $class = new \\ReflectionClass($classname);\n $entity_type = Utils::makeSnakeCase(\n $class->getShortName()\n );\n\n return $entity_type;\n }\n else {\n return FALSE;\n }\n }",
"private function resolveEntityClassName($bundle_key) {\n $entity_info = $this->entityInfo;\n $bundle_info = $entity_info['bundles'][$bundle_key];\n if (isset($bundle_info['entity class'])) {\n return $bundle_info['entity class'];\n }\n elseif (isset($entity_info['entity class'])) {\n return $entity_info['entity class'];\n }\n return NULL;\n }",
"protected abstract function EntityType();",
"public static function getEntityNamespace(): string\n {\n return isset(static::$entityNamespace) ? static::$entityNamespace : get_called_class();\n }",
"public static function getEntityNamespace()\n {\n return isset(static::$entityNamespace) ? static::$entityNamespace : get_called_class();\n }",
"public function getEntityClass()\n {\n if (!$this->entityClass) {\n $default = Document::class;\n $self = static::class;\n $parts = explode('\\\\', $self);\n\n if ($self === self::class || count($parts) < 3) {\n return $this->entityClass = $default;\n }\n\n $alias = Inflector::singularize(substr(array_pop($parts), 0, -5));\n $name = implode('\\\\', array_slice($parts, 0, -1)) . '\\Document\\\\' . $alias;\n if (!class_exists($name)) {\n return $this->entityClass = $default;\n }\n\n $class = App::className($name, 'Model/Document');\n $this->entityClass = $class;\n }\n\n return $this->entityClass;\n }",
"private static function getInstanceByNameSpace($class)\n {\n foreach (self::$emMapping['byNameSpace'] as $nameSpace => $em) {\n if (strpos($class, $nameSpace) === 0) {\n return $em;\n }\n }\n\n return null;\n }",
"public static function getEntityName()\n {\n return __CLASS__;\n }",
"abstract public function getSearchClass();",
"abstract protected function getEntityNameSingular();",
"public function testEntityClassExist()\n {\n $this->assertInstanceOf(TreeFactory::class, new TreeFactory());\n }",
"protected function getEntityClass(): string\n {\n return $this->entityClass;\n }",
"private function findObjectLang($entity) {\n $conf = $this->createParamObjectLang($entity);\n return $this->findObjectLangConf($conf);\n }",
"public function check($entityClass);"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates a simple alphanumeric Hash which is prepended with a encoded database prefix. | public function createDbHash($db) : string
{
return $this->getDbCode($db).'-'. Str::random(config('ninja.key_length'));
} | [
"public static function create_hash($prefix='')\n\t{\n\t\t$hash = $prefix.md5(microtime(true).rand(0,100000));\n\t\treturn $hash;\n\t}",
"protected function generateHash():string \n\t{\n return sprintf('$%s$%02d$%s$', $this->prefix, $this->cust, $this->generateSalt());\n\t}",
"public function createBase32Key()\n {\n $alphabet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567';\n $key = '';\n for ($i = 0; $i < 16; $i++) {\n $offset = rand(0, strlen($alphabet) - 1);\n $key .= $alphabet[$offset];\n }\n return $key;\n }",
"private function _generatePrefix()\n {\n $str = null;\n $range = range('a', 'z');\n for($i = 0; $i != 4; $i++) {\n $c = rand(0, 23);\n $str .= $range[$c];\n }\n\n if (array_key_exists($str, $this->_prefix)) {\n $str = $this->_generatePrefix();\n } else {\n $this->_prefix[$str] = $str;\n }\n\n return $str;\n }",
"public function testCreateReturnPrefixedHash() {\n\n\t\t$key = new HashKey(Hash::ALGO_ADLER32, 'prefix-');\n\t\t$key->set('A value');\n\n\t\t$this->assertSame('prefix-' . hash('adler32', 'A value'), $key->create());\n\t}",
"public static function generateHash() {\n $characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';\n return self::generateSecurityString($characters, 10);\n }",
"protected function createHash() {\n\t\t\n\t\treturn str_replace('.', '', (string)microtime(true));\n\t}",
"function __generateHash()\n\t{\n\t\t$string = '';\n\n\t\t$arg = func_get_args();\n\n\t\tfor ($i=0, $c=count($arg); $i<$c; $i++)\n\t\t\t$string .= (string) $arg[$i];\n\n\t\t$string .= $this->encryptionKey;\n\t\treturn strtoupper(md5($string));\n\t}",
"protected function createHash()\n {\n return md5(uniqid('order', microtime()));\n }",
"function generate_prefix($oid){\n\t\t$params = JComponentHelper::getParams( 'com_ewallet' );\n\t\t/*##############################################################*/\n\t\t// Lets make a random char for this order\n\t\t//take order prefix set by admin\n\t\t$order_prefix=(string)$params->get('order_prefix');\n\t\t$order_prefix=substr($order_prefix,0,5);//string length should not be more than 5\n\t\t//take separator set by admin\n\t\t$separator=(string)$params->get('separator');\n\t\t$prefix=$order_prefix.$separator;\n\t\t//check if we have to add random number to order id\n\t\t$use_random_orderid=(int)$params->get('random_orderid');\n\t\tif($use_random_orderid)\n\t\t{\n\t\t\t$random_numer=$this->_random(5);\n\t\t\t$prefix.=$random_numer.$separator;\n\t\t\t//this length shud be such that it matches the column lenth of primary key\n\t\t\t//it is used to add pading\n\t\t\t$len=(23-5-2-5);//order_id_column_field_length - prefix_length - no_of_underscores - length_of_random number\n\t\t}else{\n\t\t\t//this length shud be such that it matches the column lenth of primary key\n\t\t\t//it is used to add pading\n\t\t\t$len=(23-5-2);//order_id_column_field_length - prefix_length - no_of_underscores\n\t\t}\n\t\t/*##############################################################*/\n\n\t\t$maxlen=23-strlen($prefix)-strlen($oid);\n\t\t$padding_count=(int)$params->get('padding_count');\n\t\t//use padding length set by admin only if it is les than allowed(calculate) length\n\t\tif($padding_count>$maxlen){\n\t\t\t$padding_count=$maxlen;\n\t\t}\n\t\t$append='';\n\t\tif(strlen((string)$oid)<=$len)\n\t\t{\n\t\t\tfor($z=0;$z<$padding_count;$z++){\n\t\t\t\t$append.='0';\n\t\t\t}\n\t\t\t//$append=$append.$oid;\n\t\t}\n\t\t$prefix .= $append;\n\n\treturn $prefix;\n\t}",
"private function generateHash(){\n\t$charset='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';\n\t$str = '';\n\t$length = 255;\n\t\t$count = strlen($charset);\n\t\twhile ($length--) {\n\t\t\t$str .= $charset[mt_rand(0, $count-1)];\n\t\t}\n\t$hash = $str;\n\t\n\treturn $hash;\n\t//END OF GENERATE HASH\n\t}",
"function make_id(){\r\n\t\t// creer un hash\r\n\t\t$hash = $this->champ . $this->table . $this->sql;\r\n\t\t$this->_id = substr(md5($hash),0,6);\r\n\t}",
"private static function makeReceiptId($prefix = '')\n {\n return $prefix . uniqid();\n }",
"public function makeHash() {\n return md5(SALT . $this->getId() . SALT);\n }",
"public function generateCacheKey()\n {\n $name = $this->connection->getName();\n return hash('sha256', $name.$this->query->toSql().serialize($this->query->getBindings()));\n }",
"public function getPrefixedHashIdAttribute()\n {\n return 'product-' . $this->getHashIdAttribute();\n }",
"public static function createName() {\n if (function_exists('random_bytes')) {\n $hex = bin2hex(random_bytes(16));\n return base_convert($hex, 16, 36);\n }\n elseif (function_exists('openssl_random_pseudo_bytes')) {\n $hex = bin2hex(openssl_random_pseudo_bytes(16));\n return base_convert($hex, 16, 36);\n }\n else {\n $pow16 = pow(2, 16);\n $buf = '';\n for ($i = 0; $i < 8; $i++) {\n $buf .= '-' . mt_rand(0, $pow16);\n }\n return base_convert(md5($buf), 16, 36);\n }\n }",
"protected function _create_salt()\n\t{\n\t\t$this->CI->load->helper('string');\n\t\treturn sha1(random_string('alnum', 32));\n\t}",
"public static function createHash($string) {\n\t\tif (!empty($GLOBALS['TYPO3_CONF_VARS']['SYS']['encryptionKey'])) {\n\t\t\t$hash = GeneralUtility::shortMD5($string . $GLOBALS['TYPO3_CONF_VARS']['SYS']['encryptionKey']);\n\t\t} else {\n\t\t\t$hash = GeneralUtility::shortMD5($string);\n\t\t}\n\t\treturn $hash;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set the value of estudiantesNumeroIdentificacion | public function setEstudiantesNumeroIdentificacion($estudiantesNumeroIdentificacion)
{
$this->estudiantesNumeroIdentificacion = $estudiantesNumeroIdentificacion;
return $this;
} | [
"public function getEstudiantesNumeroIdentificacion()\n {\n return $this->estudiantesNumeroIdentificacion;\n }",
"public function setEstudiantesNumeroIdentificacion($estudiantesNumeroIdentificacion)\n\t{\n\t\t$this->estudiantesNumeroIdentificacion = $estudiantesNumeroIdentificacion;\n\n\t\treturn $this;\n\t}",
"function setNum_asistentes($inum_asistentes = '')\n {\n $this->inum_asistentes = $inum_asistentes;\n }",
"public function testSetNumeroAttestation() {\n\n $obj = new LignesIjss();\n\n $obj->setNumeroAttestation(\"numeroAttestation\");\n $this->assertEquals(\"numeroAttestation\", $obj->getNumeroAttestation());\n }",
"public function setNumero($numero){\n $this->numero=$numero;\n }",
"public function testSetNumero() {\n\n $obj = new Collaborateurs();\n\n $obj->setNumero(\"numero\");\n $this->assertEquals(\"numero\", $obj->getNumero());\n }",
"public function testSetNumeroAttestation() {\n\n $obj = new AttestationAt();\n\n $obj->setNumeroAttestation(\"numeroAttestation\");\n $this->assertEquals(\"numeroAttestation\", $obj->getNumeroAttestation());\n }",
"public function setNumero($numero)\n {\n $this->numero = $numero;\n }",
"public function testSetNumero() {\n\n $obj = new EmpDadsuGene();\n\n $obj->setNumero(\"numero\");\n $this->assertEquals(\"numero\", $obj->getNumero());\n }",
"public function setNumero($numero)\n\t{\n\t\t$numero = $numero + 0;\n\n\t\tif (is_int ($numero))\n\t\t{\n\t\t\t$this->numero = $numero;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tthrow new Exception ($numero . 'El dato debe ser un numero entero.');\n\t\t}\n\t}",
"public function setNumeroService(?int $numeroService) \r\n {\r\n $this->numeroService = $numeroService;\r\n }",
"public function testSetNumero() {\n\n $obj = new EmpDadsuRectif();\n\n $obj->setNumero(\"numero\");\n $this->assertEquals(\"numero\", $obj->getNumero());\n }",
"public function testSetNumeroCasPartSecu() {\n\n $obj = new Employes();\n\n $obj->setNumeroCasPartSecu(10);\n $this->assertEquals(10, $obj->getNumeroCasPartSecu());\n }",
"public function testSetNumeroCompte() {\n\n $obj = new EcrituresEco();\n\n $obj->setNumeroCompte(\"numeroCompte\");\n $this->assertEquals(\"numeroCompte\", $obj->getNumeroCompte());\n }",
"private function setNumeroOferta(Oferta $entity) {\n $em = $this->getDoctrine()->getManager();\n $procPrincAnt = $em->getRepository('CostoServicioBundle:Proceso')->findProcesoPrincipalOferta($entity->getId());\n $principal = $entity->getProcesoPrincipal();\n\n // busco si tiene un proceso principal asignado anteriormente\n // si es el mismo proceso no deberia cambiar el numero\n if (empty($procPrincAnt) || (isset($procPrincAnt[0]) && $principal != $procPrincAnt[0])) {\n $lastNum = $em->getRepository('CostoOfertaBundle:Oferta')->findLastNumOfertaDelProc($principal->getNumero());\n $counter = $lastNum ? substr($lastNum[0]['numero'], -3) : 0;\n $entity->setNumero(\"CUB-OF-\" . $principal->getNumero() . \"-\" . date(\"Y\") . \"-\" . sprintf('%03d', ++$counter));\n }\n }",
"public function testSetNumeroDevis() {\n\n $obj = new DevisCommercialEntetes();\n\n $obj->setNumeroDevis(\"numeroDevis\");\n $this->assertEquals(\"numeroDevis\", $obj->getNumeroDevis());\n }",
"public function testSetNumeroEmploye() {\n\n $obj = new AbsencesExcelHisto();\n\n $obj->setNumeroEmploye(\"numeroEmploye\");\n $this->assertEquals(\"numeroEmploye\", $obj->getNumeroEmploye());\n }",
"public function testSetNumeroInsee() {\n\n $obj = new Employes();\n\n $obj->setNumeroInsee(\"numeroInsee\");\n $this->assertEquals(\"numeroInsee\", $obj->getNumeroInsee());\n }",
"public function testSetNumeroPj() {\n\n $obj = new DevisCommercialEntetes();\n\n $obj->setNumeroPj(10);\n $this->assertEquals(10, $obj->getNumeroPj());\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Generates an identicon for the specified hash. | public function generate(
\Jdenticon\Rendering\RendererInterface $renderer,
\Jdenticon\Rendering\Rectangle $rect,
\Jdenticon\IdenticonStyle $style,
$hash)
{
$hue = self::getHue($hash);
$colorTheme = new ColorTheme($hue, $style);
$this->renderBackground($renderer, $rect, $style, $colorTheme, $hash);
$this->renderForeground($renderer, $rect, $style, $colorTheme, $hash);
} | [
"protected function createIdenticon($username) {\n // lets create Identicon\n\n // lets create time for name purpose\n $name = time();\n\n $img = new \\Jdenticon\\Identicon();\n $img->setValue($username);\n $img->setSize(150);\n \n $folderdir = 'img/user/'.$username.'_'.$name.'/profile/';\n File::makeDirectory($folderdir, 0777, true);\n\n /**\n * we need to Turn on output buffering coz there's no way we can get the image\n * then Clean (erase) the output buffer and turn off output buffering\n */\n ob_start();\n $photo = $img->displayImage('png');\n $binary = $img->getImageData('png');\n $identicon = ob_get_contents();\n ob_end_clean();\n\n // name of the temporary profile image\n $filename = $username.'_'.$name.'.png';\n\n return array(\n 'url' => 'no',\n 'folder' => $folderdir,\n 'filename' => $filename,\n 'identicon' => $identicon\n );\n }",
"public function key($hash);",
"private static function makeIdenticon($org_name){\n $icon = new \\Jdenticon\\Identicon(array(\n 'size' => 200,\n 'value' => $org_name\n ));\n $img_name = str_random(12).\".png\";\n Storage::disk($_ENV['FILESYSTEM_DRIVER'])->put(\"avatars/\".$img_name, file_get_contents($icon->getImageDataUri('png')) );\n return Storage::url(\"avatars/$img_name\");\n }",
"private function generateHashedID()\n {\n $this->propHashedId = hash_id($this->propId, $this->propOptions->toArray());\n }",
"public function generateTestIdenticons()\n {\n require_once __DIR__.'/vendor/autoload.php';\n $basePath = __DIR__.'/tests/_data/page_fixtures/valid_pages/';\n\n $files = [\n 'root_file1.png',\n 'root_file2.png',\n '01.yaml_only/file1.png',\n '01.yaml_only/file2.png',\n '01.yaml_only/file3.png',\n '04.with_children/_child1/child_file1.png',\n '04.with_children/_child1/child_file2.png',\n '04.with_children/_child1/child_file3.png',\n '04.with_children/_child1/child_file4.png',\n '04.with_children/03.empty/child_file5.png',\n '04.with_children/03.empty/child_file6.png',\n '04.with_children/03.empty/sub/dir/child_file7.png',\n '04.with_children/03.empty/sub/dir/child_file8.png',\n 'images/header/top-header.png',\n 'images/footer/footer.png',\n 'images/file1.png',\n 'images/person_a.png',\n 'images/person_b.png',\n 'images/person_c.png',\n 'images/gallery/fancy_picture_01.png',\n 'images/gallery/fancy_picture_02.png',\n 'images/gallery/fancy_picture_03.png',\n 'images/gallery/fancy_picture_20.png',\n 'images/gallery/fancy_picture_21.png',\n ];\n\n $identicon = new Identicon();\n $fs = new Filesystem();\n\n foreach ($files as $file) {\n $path = $basePath.$file;\n $dir = dirname($path);\n if (!is_dir($dir)) {\n $fs->mkdir($dir);\n }\n\n echo \"$path\\n\";\n $data = $identicon->getImageData($file, 64);\n file_put_contents($path, $data);\n }\n }",
"public function generateHash($id);",
"private static function getIdByNameAndHash(string $oriName, $hash) {\n $stmt = self::$pdoDB->prepare('SELECT id FROM ThashedImages WHERE oriName=:oriName AND hash=:hash');\n $stmt->execute(array(':oriName' => $oriName,':hash' => $hash));\n return $stmt->fetchColumn();\n }",
"private function generateImageIdentifier($data) {\n return md5($data);\n }",
"function make_id(){\r\n\t\t// creer un hash\r\n\t\t$hash = $this->champ . $this->table . $this->sql;\r\n\t\t$this->_id = substr(md5($hash),0,6);\r\n\t}",
"public abstract function getBlockIdByHash(string $hash): int;",
"protected function _generateTaskHash($hash, $taskId) {\n\t\treturn MD5($hash . $taskId . APP_KEY);\n\t}",
"function id_gen($str=''){\n\t$pats = array('/','+');\n\t$subs = array('_','-');\n\treturn str_replace($pats,$subs,substr(base64_encode(md5($str,true)),0,22));\n}",
"public function confirmIdentity($hash)\n {\n global $notification;\n\n $confirm = $this->_prefs->getValue('confirm_email');\n if (empty($confirm)) {\n $notification->push(Horde_Core_Translation::t(\"There are no email addresses to confirm.\"), 'horde.message');\n return;\n }\n\n $confirm = @unserialize($confirm);\n if (empty($confirm)) {\n $notification->push(Horde_Core_Translation::t(\"There are no email addresses to confirm.\"), 'horde.message');\n return;\n } elseif (!isset($confirm[$hash])) {\n $notifcation->push(Horde_Core_Translation::t(\"Email addresses to confirm not found.\"), 'horde.message');\n return;\n }\n\n $identity = $confirm[$hash];\n $id = array_search($identity['id'], $this->getAll($this->_prefnames['id']));\n if ($id === false) {\n /* Adding a new identity. */\n $verified = array();\n foreach ($identity as $key => $value) {\n if (!$this->_prefs->isLocked($key)) {\n $verified[$key] = $value;\n }\n }\n $this->add($verified);\n } else {\n /* Updating an existing identity. */\n foreach ($identity as $key => $value) {\n $this->setValue($key, $value, $id);\n }\n }\n $this->save();\n unset($confirm[$hash]);\n $this->_prefs->setValue('confirm_email', serialize($confirm));\n\n $notification->push(sprintf(Horde_Core_Translation::t(\"The email address %s has been added to your identities. You can close this window now.\"), $verified[$this->_prefnames['from_addr']]), 'horde.success');\n }",
"protected function generateId()\n {\n return md5($this->ix . $this->className . $this->discountType . $this->combinable);\n }",
"public function getIconIdentifier() : string {}",
"public function getIconID()\n {\n if (empty($this->id)) {\n $this->id = md5($this->icon);\n }\n\n $sIconID = 'icon_'.$this->id;\n\n return $sIconID;\n }",
"public static function getIconFromHash($hash = null, $captcha_id = null) {\n\n // Check if the hash and captcha id are set\n if(!empty($hash) && (isset($captcha_id) && $captcha_id > -1)) {\n\n // Set the captcha id property\n self::$captcha_id = $captcha_id;\n\n // If the session is not loaded yet, load it.\n if(!isset(self::$session)) {\n self::$session = new CaptchaSession(self::$captcha_id);\n }\n\n // Check the amount of times an icon has been requested\n if(self::$session->icon_requests >= 5) {\n header('HTTP/1.1 403 Forbidden');\n exit;\n }\n\n // Update the request counter\n self::$session->icon_requests += 1;\n self::$session->save();\n\n // Check if the hash is present in the session data\n if(in_array($hash, self::$session->hashes[2])) {\n $icons_path = $_SESSION['icon_captcha']['icon_path']; // Icons folder path\n\n $icon_file = $icons_path . ((substr($icons_path, -1) === '/') ? '' : '/') . self::$session->theme . '/icon-' .\n ((self::getCorrectIconHash() === $hash) ? self::$session->hashes[0] : self::$session->hashes[1]) . '.png';\n\n // Check if the icon exists\n if (is_file($icon_file)) {\n\n // Check if noise is enabled or not.\n $add_noise = (isset($_SESSION['icon_captcha']['icon_noise'])\n && $_SESSION['icon_captcha']['icon_noise']);\n\n // If noise is enabled, add the random pixel noise.\n if($add_noise) {\n $icon = imagecreatefrompng($icon_file);\n $noise_color = imagecolorallocatealpha($icon, 0, 0, 0, 126);\n\n // Add some random pixels to the icon\n for ($i = 0; $i < 5; $i++) {\n $randX = ($i < 3) ? mt_rand(0, 2) : mt_rand(28, 30);\n $randY = ($i < 3) ? mt_rand(0, 15) : mt_rand(16, 30);\n\n imagesetpixel($icon, $randX, $randY, $noise_color);\n }\n }\n\n // Set the content type header to the PNG MIME-type.\n header('Content-type: image/png');\n\n // Disable caching of the icon, even though the images might\n // be 'random' due to the added pixels.\n header('Expires: 0');\n header('Cache-Control: no-cache, no-store, must-revalidate');\n header('Cache-Control: post-check=0, pre-check=0', false);\n header('Pragma: no-cache');\n\n // Show the image and exit the code\n if($add_noise && isset($icon)) {\n imagepng($icon);\n imagedestroy($icon);\n } else {\n readfile($icon_file);\n }\n\n exit;\n }\n }\n }\n }",
"private function getPNGPath($hash)\n {\n return $this->getCacheFilePath($hash, 'png');\n }",
"public function hash()\n {\n $exps = $this->expression;\n $keys = implode('-', array_keys($this->info));\n $vals = implode('-', array_values($this->info));\n\n return md5(preg_replace('/\\?P<\\w+>/', '<G>', $exps . $keys . $vals));\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
get all departments with employers | public static function getAllDepartments()
{
return self::with('employerDepartments')->get();
} | [
"public function getEmployers()\n {\n return $this->hasMany(Employer::className(), ['id' => 'employer_id'])->viaTable('employers_lnk_departments', ['department_id' => 'id']);\n }",
"public function getEmployeeDepartments()\n {\n return $this->hasMany(EmployeeDepartment::className(), ['department_id' => 'id']);\n }",
"public function getDepartmentsWithWealthyEmployees(): array;",
"public function getDepartmentEmployees()\n {\n return $this->hasMany(DepartmentEmployee::className(), ['department_id' => 'id']);\n }",
"public function consultAllDepartments() {\n\n $departments = new Departments();\n return $departments->allDepartments();\n }",
"public function getEmployers()\n {\n return $this->hasMany(TblEmployer::className(), ['id' => 'employer_id'])->viaTable('tbl_ticket_employees', ['ticket_id' => 'id']);\n }",
"public function getDepartmentEmployees()\n {\n return $this->hasMany(DepartmentEmployee::className(), ['employee_id' => 'id']);\n }",
"public function getAllOfficeEmployers()\n { \n $employers = $this->officeEmployer::where('is_deleted',0)->get(); \n return $employers;\n }",
"private function get_employers() {\n $employer_dao = new EmployerDAO();\n $this->employers = $employer_dao->getEmployers();\n }",
"public function getDepartmentList()\n {\n return $this->departmentRepository->findAll();\n\n }",
"public function getEmployments()\n {\n return $this->hasMany(Employment::className(), ['user_id' => 'id']);\n }",
"public function getEmployees() {\n\n /* Fetch all included employee IDs */\n $employeeIDs = $this->getIncludedEmployeeIDs();\n\n\n /* Set orWhereIn variables */\n array_push($this->whereIn, [\n 'column' => 'employee_id',\n 'array' => $employeeIDs\n ]);\n }",
"public function getAllDepartments()\n {\n $query = 'SELECT * FROM ' . $this->tableName;\n return $this->getAll($query);\n }",
"public function getEmployees() {\n return $this->getCurrent()\n ->findDependentRowset('Yourdelivery_Model_DbTable_Customer_Company');\n }",
"public function getEmployerUsers()\n {\n return $this->hasMany(EmployerUsers::className(), ['specialization' => 'id']);\n }",
"public function departments()\n {\n return $this->belongsToMany('App\\Department', 'emp_dep_positions', 'employee_id', 'department_id');\n }",
"public function query_all_department()\n\t{\n\t\t$result = $this->db\n\t\t\t->select('*')\n\t\t\t->from('cm_departments')\n\t\t\t->get()->result();\n\n\t\treturn $result;\n\t}",
"function getdeptlist()\r\n\t{\r\n\t\t$sql = 'select deptname, empname from dept, emp where emp.desig_id = 2 AND emp.dept_id = dept.id';\r\n\t\t$query = $this->db->query($sql);\r\n\t\t$result = $query->result();\r\n\t\treturn $result;\r\n\t}",
"function getDepartments() {\n\n if(!$this->departments) {\n $sql='SELECT dept_id FROM '.GROUP_DEPT_TABLE\n .' WHERE group_id='.db_input($this->getId());\n if(($res=db_query($sql)) && db_num_rows($res)) {\n while(list($id)=db_fetch_row($res))\n $this->departments[]= $id;\n }\n }\n\n return $this->departments;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create request for operation 'getMetrics' | public function getMetricsRequest($page = 0, $count = 50)
{
if ($page !== null && $page < 0) {
throw new \InvalidArgumentException('invalid value for "$page" when calling MetricsApi.getMetrics, must be bigger than or equal to 0.');
}
if ($count !== null && $count > 100) {
throw new \InvalidArgumentException('invalid value for "$count" when calling MetricsApi.getMetrics, must be smaller than or equal to 100.');
}
if ($count !== null && $count < 1) {
throw new \InvalidArgumentException('invalid value for "$count" when calling MetricsApi.getMetrics, must be bigger than or equal to 1.');
}
$resourcePath = '/v1/metrics';
$formParams = [];
$queryParams = [];
$headerParams = [];
$httpBody = '';
$multipart = false;
// query params
if ($page !== null) {
if('form' === 'form' && is_array($page)) {
foreach($page as $key => $value) {
$queryParams[$key] = $value;
}
}
else {
$queryParams['page'] = $page;
}
}
// query params
if ($count !== null) {
if('form' === 'form' && is_array($count)) {
foreach($count as $key => $value) {
$queryParams[$key] = $value;
}
}
else {
$queryParams['count'] = $count;
}
}
if ($multipart) {
$headers = $this->headerSelector->selectHeadersForMultipart(
['application/json']
);
} else {
$headers = $this->headerSelector->selectHeaders(
['application/json'],
[]
);
}
// for model (json/xml)
if (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
$formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
foreach ($formParamValueItems as $formParamValueItem) {
$multipartContents[] = [
'name' => $formParamName,
'contents' => $formParamValueItem
];
}
}
// for HTTP post (form)
$httpBody = new MultipartStream($multipartContents);
} elseif ($headers['Content-Type'] === 'application/json') {
$httpBody = \GuzzleHttp\json_encode($formParams);
} else {
// for HTTP post (form)
$httpBody = \GuzzleHttp\Psr7\Query::build($formParams);
}
}
// this endpoint requires API key authentication
$apiKey = $this->config->getApiKeyWithPrefix('api_key');
if ($apiKey !== null) {
$queryParams['api_key'] = $apiKey;
}
$defaultHeaders = [];
if ($this->config->getUserAgent()) {
$defaultHeaders['User-Agent'] = $this->config->getUserAgent();
}
$headers = array_merge(
$defaultHeaders,
$headerParams,
$headers
);
$query = \GuzzleHttp\Psr7\Query::build($queryParams);
return new Request(
'GET',
$this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
} | [
"protected function restSystemCloudMetricsGetRequest()\n {\n\n $resourcePath = '/rest/system/cloud/metrics';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['*/*']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['*/*'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (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\\build_query($formParams);\n }\n }\n\n // this endpoint requires OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\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 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function getMetricsRequest($metrics_name, $start_date = null, $end_date = null)\n {\n // verify the required parameter 'metrics_name' is set\n if ($metrics_name === null || (is_array($metrics_name) && count($metrics_name) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $metrics_name when calling getMetrics'\n );\n }\n\n $resourcePath = '/metrics/{metrics-name}/sum';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if ($start_date !== null) {\n if('form' === 'form' && is_array($start_date)) {\n foreach($start_date as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['startDate'] = $start_date;\n }\n }\n // query params\n if ($end_date !== null) {\n if('form' === 'form' && is_array($end_date)) {\n foreach($end_date as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['endDate'] = $end_date;\n }\n }\n\n\n // path params\n if ($metrics_name !== null) {\n $resourcePath = str_replace(\n '{' . 'metrics-name' . '}',\n ObjectSerializer::toPathValue($metrics_name),\n $resourcePath\n );\n }\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 []\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\\build_query($formParams);\n }\n }\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 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function get_metrics()\n {\n //print_r($_GET);\n\n $client = (new Http())->getClient();\n\n $metrics = new Metrics($client);\n\n $this->metricsParam = $this->getMetricsArguments($_GET);\n $this->metricsParam['sub_account_id'] = $this->db['sub_account_id'];\n\n $result = $metrics->get($this->metricsParam);\n\n wp_send_json_success($result);\n }",
"public function apiMetrics()\n {\n return $this->httpGet('/admin/apiMetrics');\n }",
"public function fetchMetrics();",
"protected function getAllStatisticsUsingGetRequest()\n {\n\n $resourcePath = '/nucleus/v1/resource/statistic';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/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 \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 OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\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 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function getMetrics();",
"public function getServerMetrics()\n {\n $url = UrlHelper::appendParamsUrl(Urls::URL_ADMIN_METRICS, []);\n $response = $this->getConnection()->get($url);\n\n $metrics = [];\n\n foreach (explode(\"\\n\", $response->getBody()) as $line) {\n if (trim($line) == \"\") {\n continue;\n }\n\n if ($line[0] == \"#\") {\n // type or help\n if (!preg_match(\"/^#\\s*([^\\s]+)\\s+([^\\s]+)\\s+(.*)$/\", $line, $matches)) {\n throw new ClientException('Invalid metrics API output line: \"' . $line. '\"');\n }\n\n $metric = $matches[2];\n if (!isset($metrics[$metric])) {\n $metrics[$metric] = [\"name\" => $metric];\n }\n\n $metrics[$metric][strtolower($matches[1])] = $matches[3];\n } else {\n // metric value\n if (!preg_match(\"/^([^\\s\\{]+)(\\{.*?\\})?\\s*(.+)$\\s*$/\", $line, $matches)) {\n throw new ClientException('Invalid metrics API output line: \"' . $line. '\"');\n }\n\n $metric = $matches[1];\n $sub = null;\n if (preg_match(\"/_(sum|count|bucket)$/\", $metric, $sub)) {\n // sum, count, buckets\n $metric = substr($metric, 0, -1 - strlen($sub[1]));\n }\n \n if (!isset($metrics[$metric])) {\n $metrics[$metric] = [];\n }\n\n $le = null;\n // labels\n if ($matches[2] != \"\") {\n $labels = substr($matches[2], 1, strlen($matches[2]) - 2);\n if ($labels != \"\") {\n foreach (explode(\",\", $labels) as $label) {\n $parts = explode(\"=\", $label);\n $key = trim($parts[0]);\n $value = trim($parts[1], \" \\\"\");\n if (!isset($metrics[$metric][\"labels\"])) {\n $metrics[$metric][\"labels\"] = []; \n }\n if ($key != \"le\") {\n $metrics[$metric][\"labels\"][$key] = $value;\n } else {\n $le = $value;\n }\n }\n }\n }\n \n // cast to number\n $value = $matches[3];\n \n if ($sub == null) {\n // counter\n $metrics[$metric][\"value\"] = $value;\n } else if ($sub[1] == \"bucket\") {\n // bucket value\n if (!isset($metrics[$metric][\"buckets\"])) {\n $metrics[$metric][\"buckets\"] = [];\n }\n $metrics[$metric][\"buckets\"][$le] = $value;\n } else {\n // sum, count\n $metrics[$metric][$sub[1]] = $value;\n }\n }\n }\n\n return $metrics;\n }",
"public function listMonitoringDimensionsRequest()\n {\n\n $resourcePath = '/data/v1/monitoring/dimensions';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\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 []\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\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\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\n // MUX: adds support for array params.\n // TODO: future upstream?\n $query = ObjectSerializer::buildBetterQuery($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"protected function unitsOfMeasureRequest()\n {\n\n $resourcePath = '/v2/dataelements/unitsofmeasure';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\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 // \\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('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 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function index(MetricRequest $request)\n {\n return $request->availableMetrics();\n }",
"protected function getPartnerPerformanceRequest(): Request\n {\n $contentType = self::contentTypes['getPartnerPerformance'];\n\n $resourcePath = '/v3/report/payment/performance';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n $method = 'GET';\n\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n $contentType,\n $multipart\n );\n\n $defaultHeaders = parent::getDefaultHeaders();\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\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 } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {\n # if Content-Type contains \"application/json\", json_encode the form parameters\n $httpBody = \\GuzzleHttp\\Utils::jsonEncode($formParams);\n } else {\n // for HTTP post (form)\n $httpBody = ObjectSerializer::buildQuery($formParams);\n }\n }\n\n $query = ObjectSerializer::buildQuery($queryParams);\n $requestInfo = [\n 'path' => $resourcePath,\n 'method' => $method,\n 'timestamp' => $defaultHeaders['WM_SEC.TIMESTAMP'],\n 'query' => $query,\n ];\n\n // this endpoint requires Bearer authentication (access token)\n $token = $this->config->getAccessToken();\n if ($token) {\n $headers['WM_SEC.ACCESS_TOKEN'] = $token->accessToken;\n }\n\n $operationHost = $this->config->getHost();\n return new Request(\n $method,\n $operationHost . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"protected function searchMetricsRequest($body)\n {\n // verify the required parameter 'body' is set\n if ($body === null || (is_array($body) && count($body) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $body when calling searchMetrics'\n );\n }\n\n $resourcePath = '/api/metrics.json';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\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 ['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 if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\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\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 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function action_getEventMetrics(){\n $eventId = Request::get('eventId','',AnalyticsModule::PARAMS_LOCATION);\n $metrics = AnalyticsAggregator::getMetricsByEventId($eventId);\n return array(\"Metrics\"=>DataObject::objectListToArrayList($metrics));\n }",
"public function retrieveReactorMetrics()\n {\n return $this->start()->uri(\"/api/reactor/metrics\")\n ->get()\n ->go();\n }",
"public function getHistogram(ContextInterface $ctx, GetHistogramRequest $request): GetHistogramResponse;",
"protected function getUsageRequest()\n {\n\n $resourcePath = '/usage';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\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 // \\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('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 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function getProjectMetricsRequest($projectId, $eventType, $resolution, $from, $to)\n {\n // verify the required parameter 'projectId' is set\n if ($projectId === null || (is_array($projectId) && count($projectId) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $projectId when calling getProjectMetrics'\n );\n }\n // verify the required parameter 'eventType' is set\n if ($eventType === null || (is_array($eventType) && count($eventType) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $eventType when calling getProjectMetrics'\n );\n }\n // verify the required parameter 'resolution' is set\n if ($resolution === null || (is_array($resolution) && count($resolution) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $resolution when calling getProjectMetrics'\n );\n }\n if (!preg_match(\"/^[0-9]+(ns|us|ms|s|m|h)$/\", $resolution)) {\n throw new \\InvalidArgumentException(\"invalid value for \\\"resolution\\\" when calling ProjectApi.getProjectMetrics, must conform to the pattern /^[0-9]+(ns|us|ms|s|m|h)$/.\");\n }\n\n // verify the required parameter 'from' is set\n if ($from === null || (is_array($from) && count($from) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $from when calling getProjectMetrics'\n );\n }\n // verify the required parameter 'to' is set\n if ($to === null || (is_array($to) && count($to) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $to when calling getProjectMetrics'\n );\n }\n\n $resourcePath = '/projects/{project_id}/metrics';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if ($eventType !== null) {\n if('form' === 'form' && is_array($eventType)) {\n foreach($eventType as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['event_type'] = $eventType;\n }\n }\n // query params\n if ($resolution !== null) {\n if('form' === 'form' && is_array($resolution)) {\n foreach($resolution as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['resolution'] = $resolution;\n }\n }\n // query params\n if ($from !== null) {\n if('form' === 'form' && is_array($from)) {\n foreach($from as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['from'] = $from;\n }\n }\n // query params\n if ($to !== null) {\n if('form' === 'form' && is_array($to)) {\n foreach($to as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['to'] = $to;\n }\n }\n\n\n // path params\n if ($projectId !== null) {\n $resourcePath = str_replace(\n '{' . 'project_id' . '}',\n ObjectSerializer::toPathValue($projectId),\n $resourcePath\n );\n }\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 []\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 Bearer authentication (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\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\\Query::build($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"function createExamplePutRequest()\n{\n\treturn new Request(\n\t\t'put',\n\t\t'user/measures',\n\t\t['Content-Type' => 'application/json'],\n\t\t'[{\"id\": \"bodyHeight\", \"value\": 200}]'\n\t);\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Record user visit. Updates database with user's IP address and date of last visit. | private function recordUserVisit($id)
{
$last_ip = $this->getIp();
$last_dt = date('Y-m-d H:i:s');
$query = $this->dbh->prepare('UPDATE users SET last_ip = ?, last_dt = ? WHERE id = ?');
$query->execute(array($last_ip, $last_dt, $id));
} | [
"public function setLastVisit() {\n\t\t\tglobal $db;\n\n\t\t\t$db->query(\"\n\t\t\t\tUPDATE \".TABLE_USERS.\"\n\t\t\t\tSET user_ip = ?,\n\t\t\t\t\tuser_lastvisited = ?\n\t\t\t\tWHERE user_id = ?\n\t\t\t\", array($_SERVER['REMOTE_ADDR'], time(), $this->user->getID()));\n\t\t}",
"private function lastVisit()\n {\n $lastVisit = User::model()->notsafe()->findByPk(Yii::app()->user->id);\n $lastVisit->lastvisit_at = time();\n $lastVisit->save();\n }",
"function log_visit()\n\t{\t\t\n\t\t$d = mysql_query(\"select * from logs.users where ip = '{$this->ip}'\", $this->link);\n\t\t\n\t\tif (mysql_num_rows($d) == 0)\n\t\t{\n\t\t\tmysql_query(\"replace into logs.users values ('{$this->ip}', 1, 0)\", $this->link);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$r = mysql_fetch_row($d);\n\t\t\tmysql_query(\"replace into logs.users values ('{$this->ip}', {$r[1]}+1, {$r[2]})\", $this->link);\n\t\t}\n\t\tmysql_query(\"insert into logs.visits values ('{$this->ip}', now())\", $this->link);\n\t}",
"function update_visit($user) {\n\tglobal $dbh;\n\t$time_now = date('Y-m-d G:i:s');\n\t$user_id = $user->id;\n\t$query = \"UPDATE visitors SET visited_at = ? WHERE id = ?\";\n\t$query = $dbh->prepare($query);\n\treturn $query->execute(array($time_now, $user_id));\n}",
"protected function updateVisit()\r\n\t{\r\n\t\t// Don't update if main admin is logged in as current (non main admin) user\r\n\t\tif(!$this->getParentId())\r\n\t\t{\r\n\t\t\t$sql = e107::getDb();\r\n\t\t\t$this->set('last_ip', $this->get('user_ip'));\r\n\t\t\t$current_ip = e107::getIPHandler()->getIP(FALSE);\r\n\t\t\t$update_ip = $this->get('user_ip' != $current_ip ? \", user_ip = '\".$current_ip.\"'\" : \"\");\r\n\t\t\t$this->set('user_ip', $current_ip);\r\n\t\t\tif($this->get('user_currentvisit') + 3600 < time() || !$this->get('user_lastvisit'))\r\n\t\t\t{\r\n\t\t\t\t$this->set('user_lastvisit', (integer) $this->get('user_currentvisit'));\r\n\t\t\t\t$this->set('user_currentvisit', time());\r\n\t\t\t\t$sql->db_Update('user', \"user_visits = user_visits + 1, user_lastvisit = \".$this->get('user_lastvisit').\", user_currentvisit = \".$this->get('user_currentvisit').\"{$update_ip} WHERE user_id='\".$this->getId().\"' \");\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t$this->set('user_currentvisit', time());\r\n\t\t\t\t$sql->db_Update('user', \"user_currentvisit = \".$this->get('user_currentvisit').\"{$update_ip} WHERE user_id='\".$this->getId().\"' \");\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"public static function save () {\n\n\t\t$request = Request::load();\n\n\t\t$visit = Model::get( array (\n\t\t\t'visitor_ip' => $request->ip_address,\n\t\t\t'user_agent' => $request->user_agent\n\t\t), true);\n\n\t\tif ( empty( $visit ) ) {\n\t\t\treturn Model::insert( (object) array (\n\t\t\t\t'visitor_ip' => $request->ip_address,\n\t\t\t\t'user_agent' => $request->user_agent,\n\t\t\t\t'visits' => 1\n\t\t\t));\n\t\t} else {\n\t\t\treturn $visit->save( array ( 'visits' => ($visit->visits + 1 ) ) );\n\t\t}\n\t}",
"public static function UpdateLastActivity()\n {\n if (!self::$user) {\n return;\n }\n\n $q = DB()->prepare(\"\n\t\t\tUPDATE \" . setting('db_prefix') . \"users\n\n\t\t\tSET\n\t\t\tlast_activity=?,\n\t\t\tlast_ip=?\n\n\t\t\tWHERE\n\t\t\tuid=?\n\t\t\t;\n\t\t\");\n\n $q->execute([\n time(),\n $_SERVER['REMOTE_ADDR'],\n self::$user->uid\n ]);\n }",
"private function recordProfileVisit(){\n\n \tif($this->get_request_method() != \"POST\"){\n \t\t\t$this->response('',406);\n \t\t}\n $r = json_decode(file_get_contents(\"php://input\"),true);\n\n\n $db = new DbHandler();\n\t $session = $db->getSession();\n $uid = $r['uid'] = $session['uid'];\n $time = $r['time'] = time();\n $r['type'] = 2; // 2 is visited\n\n $intrest_uid = $r['intrest_uid'];\n $ctime = $time-20000;\n\n $isUserExists = $db->getOneRecord(\"SELECT time from user_intrests WHERE uid = $uid and intrest_uid = $intrest_uid and type=2 and time > $ctime\");\n if(!$isUserExists){\n $tabble_name = \"user_intrests\";\n $column_names = array('uid', 'type', 'intrest_uid', 'time');\n $result = $db->insertIntoTable($r, $column_names, $tabble_name);\n if ($result != NULL) {\n $response[\"status\"] = \"success\";\n $response[\"message\"] = \"User visited logged successfully\";\n\n $this->response($this->json($response), 200); // send user details\n } else {\n $response[\"status\"] = \"error\";\n $response[\"message\"] = \"Failed to create User visit log. Please try again\";\n $this->response($this->json($response), 200); // send user details\n }\n\n }\n\n\n\n }",
"public function updateLastVist()\n {\n $data = new \\DateTime;\n $this->lastvisit_at = $data->format('Y-m-d H:i:s');\n $this->save();\n }",
"function _update_visit_user()\n {\n $this->haltIfLackingPermission('manage_vusers');\n list($sessionid, $personid) = explode('-', $this->arg('SHPKEY'));\n\n $chk = $this->db->pq(\"SELECT personid, sessionid FROM session_has_person WHERE sessionid=:1 AND personid=:2\", array($sessionid, $personid));\n if (!sizeof($chk))\n $this->_error('The specified user is not registered on that visit');\n\n $fields = array('ROLE', 'REMOTE');\n foreach ($fields as $f) {\n if ($this->has_arg($f)) {\n $this->db->pq(\"UPDATE session_has_person set $f=:1 where sessionid=:2 and personid=:3\", array($this->arg($f), $sessionid, $personid));\n $this->_output(array($f => $this->arg($f)));\n }\n }\n }",
"public function updateUserLastAccess()\n {\n $user = Doctrine::getTable('User')->find($this->getUserId());\n if ($user)\n {\n // not using the date formatter because this method can be called before the formatter exists\n $user->setLastAccessAt(date('Y-m-d H:i:s'));\n $user->save();\n }\n }",
"public function saveVisit($ip, $user_agent, $request)\n {\n $browser = explode(' ', $user_agent);\n $this->browser = isset($browser[10]) ? $browser[10] : '';\n $os = explode('(', $user_agent);\n $os = isset($os[1]) ? $os[1] : '';\n $os = explode(';', $os);\n $this->os = isset($os[0]) ? $os[0] : '';\n $this->ip = $ip;\n $this->user_agent = $user_agent;\n if (!$this->isSameVisit($request)) {\n $this->save();\n }\n }",
"function wps_user_visit_callback(){\n\n global $wpdb,$table_prefix;\n\n $user_ip = ip2long($_SERVER['REMOTE_ADDR']);\n $date = date('Y-m-d H:i:s');\n\n # check submit from user visits ==> result: Null or id user\n $is_user_visit_site_today = $wpdb->get_var(\"SELECT id \n FROM {$table_prefix}wps_user_visits\n WHERE ip = {$user_ip} AND \n DATE(date) = DATE('{$date}') \n LIMIT 1\");\n # submit user in db wp_wps_user_visits \n if (intval($is_user_visit_site_today)==0) {\n # add row in db\n $wpdb->insert($table_prefix.'wps_user_visits',array(\n 'ip' => $user_ip,\n 'date' => $date\n ),array(\n '%d',\n '%s'\n ));\n }\n\n # total_visits from wp_wps_visits\n $today_visit_exist = $wpdb->get_var(\"SELECT id\n FROM {$table_prefix}wps_visits\n WHERE date = DATE('{$date}')\");\n \n if ($today_visit_exist) {\n # update\n $wpdb->query(\"UPDATE {$table_prefix}wps_visits \n SET total_visits = total_visits + 1 \n WHERE id ={$today_visit_exist} \");\n if ($is_user_visit_site_today == 0) {\n $wpdb->query(\"UPDATE {$table_prefix}wps_visits \n SET unique_visits = unique_visits + 1 \n WHERE id ={$today_visit_exist} \");\n }\n } else {\n # add\n $wpdb->insert($table_prefix.'wps_visits', array(\n 'total_visits' => 1,\n 'unique_visits' => 1,\n 'date' => date('Y-m-d')\n ),array(\n '%d',\n '%d',\n '%s'\n ));\n\n }\n\n var_dump($today_visit_exist);\n var_dump($is_user_visit_site_today);\n var_dump($_SERVER['REMOTE_ADDR']);\n \n}",
"function _add_visit_user()\n {\n $this->haltIfLackingPermission('manage_vusers');\n\n if (!$this->has_arg('PERSONID'))\n $this->_error('No person specified');\n if (!$this->has_arg('SESSIONID'))\n $this->_error('No visit specified');\n\n $user = $this->db->pq(\"SELECT personid FROM person where personid=:1\", array($this->arg('PERSONID')));\n if (!sizeof($user))\n $this->_error('The specified person doesnt exist');\n\n $visit = $this->db->pq(\"SELECT sessionid FROM blsession WHERE sessionid=:1\", array($this->arg('SESSIONID')));\n if (!sizeof($user))\n $this->_error('The specified visit doesnt exist');\n\n $chk = $this->db->pq(\"SELECT shp.role\n FROM session_has_person shp \n WHERE sessionid=:1 and personid=:2\", array($this->arg('SESSIONID'), $this->arg('PERSONID')));\n\n if (sizeof($chk)) {\n $this->_error('That user is already registered on the specified visit');\n }\n\n $role = $this->has_arg(\"ROLE\") ? $this->arg(\"ROLE\") : 'Team Member';\n $remote = $this->has_arg(\"REMOTE\") ? $this->arg(\"REMOTE\") : 0;\n\n $this->db->pq(\"INSERT INTO session_has_person (sessionid, personid, role, remote) \n VALUES (:1, :2, :3, :4)\", array($this->arg(\"SESSIONID\"), $this->arg(\"PERSONID\"), $role, $remote));\n\n $this->_output(array(\n 'SHPKEY' => $this->arg(\"SESSIONID\") . '-' . $this->arg(\"PERSONID\"),\n ));\n }",
"public function touchLastLogin()\n {\n $this->last_login_at = now();\n $this->last_seen_at = now();\n $this->save();\n }",
"public function addVisit(){\n global $db;\n $this->visits++;\n $sql=\"Update BUS_link set visits = ? where id = ?\";\n $stmt=$db->prepare($sql);\n $v=$this->visits;\n $i=$this->id;\n $stmt->bind_param(\"ii\",$v,$i);\n $ok=$stmt->execute();\n $stmt->close(); \n return $ok;\n }",
"public function _initSaveLastVisitTimestamp()\n\t{\n\t\tif (PHP_SAPI == 'cli' ||\n\t\t\tpreg_match('/^\\/mobile(\\/|$)/', $_SERVER['REQUEST_URI']))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t$auth = Zend_Auth::getInstance()->getIdentity();\n\n\t\tif (empty($auth['login_id']))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t(new Application_Model_Loginstatus)->update([\n\t\t\t'visit_time' => new Zend_Db_Expr('NOW()')\n\t\t], 'id=' . $auth['login_id']);\n\t}",
"public function touchLastSeen()\n {\n if ($this->last_seen_at == null || $this->last_seen_at->diffInMinutes() > self::$lastSeenInterval || $this->last_seen_at < $this->last_login_at) {\n $this->last_seen_at = now();\n $this->save();\n }\n }",
"protected function saveVisitorInformation()\n\t{\n\t\tPiwik_PostEvent('Tracker.saveVisitorInformation', $this->visitorInfo);\n\n\t\t$serverTime \t= $this->getCurrentTimestamp();\n\n\t\t$this->visitorInfo['location_continent'] = Piwik_Common::getContinent( $this->visitorInfo['location_country'] );\n\t\t$this->visitorInfo['location_browser_lang'] = substr($this->visitorInfo['location_browser_lang'], 0, 20);\n\t\t$this->visitorInfo['referer_name'] = substr($this->visitorInfo['referer_name'], 0, 70);\n\t\t$this->visitorInfo['referer_keyword'] = substr($this->visitorInfo['referer_keyword'], 0, 255);\n\t\t$this->visitorInfo['config_resolution'] = substr($this->visitorInfo['config_resolution'], 0, 9);\n\n\t\t$fields = implode(\", \", array_keys($this->visitorInfo));\n\t\t$values = substr(str_repeat( \"?,\",count($this->visitorInfo)),0,-1);\n\n\t\tprintDebug($this->visitorInfo);\n\t\tPiwik_Tracker::getDatabase()->query( \"INSERT INTO \".Piwik_Common::prefixTable('log_visit').\n\t\t\t\t\t\t\" ($fields) VALUES ($values)\", array_values($this->visitorInfo));\n\n\t\t$idVisit = Piwik_Tracker::getDatabase()->lastInsertId();\n\n\t\t$this->visitorInfo['idvisit'] = $idVisit;\n\t\t$this->visitorInfo['visit_first_action_time'] = $serverTime;\n\t\t$this->visitorInfo['visit_last_action_time'] = $serverTime;\n\n\t\tPiwik_PostEvent('Tracker.saveVisitorInformation.end', $this->visitorInfo);\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Checks whether the given IP is a localhost/loopback IP Matches 127.0.0.0/8, equivalent IPv4mapped IPv6address and IPv6 loopback address. | public static function isIpLocal($ip)
{
return (strpos($ip, '127.') === 0 || strpos($ip, '::ffff:127.') === 0 || $ip === '::1');
} | [
"public function isLocalIPAddress()\n {\n if (strpos($this->get(), '127.0.') === 0) {\n return true;\n }\n\n return (!filter_var($this->get(), \\FILTER_VALIDATE_IP, \\FILTER_FLAG_NO_PRIV_RANGE | \\FILTER_FLAG_NO_RES_RANGE));\n }",
"public function checkIP() {\n $allowed = array(\"208.75.29.80\", \"67.216.96.44\", \"::1\", \"66.214.185.128\", \"206.207.159.28\", \"10.240.0.40\");\n if (in_array($_SERVER['REMOTE_ADDR'], $allowed)) {\n return true;\n } else {\n return false;\n }\n }",
"public static function isLocalIP()\n {\n $serverIP = $_SERVER['SERVER_ADDR'];\n if ($serverIP == '127.0.0.1') return true;\n return !filter_var($serverIP, FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE);\n }",
"private function isLoopback(): bool\n {\n if ($this->isIPv6) {\n return $this->compact()->address == '::1';\n }\n\n return (ip2long($this->address) & 0xff000000) == 0x7f000000;\n }",
"private static function isPublic6( $ip ) {\n static $privateRanges = false;\n if ( !$privateRanges ) {\n $privateRanges = array(\n array( 'fc00::', 'fdff:ffff:ffff:ffff:ffff:ffff:ffff:ffff' ), # RFC 4193 (local)\n array( '0:0:0:0:0:0:0:1', '0:0:0:0:0:0:0:1' ), # loopback\n );\n }\n $n = self::toHex( $ip );\n foreach ( $privateRanges as $r ) {\n $start = self::toHex( $r[0] );\n $end = self::toHex( $r[1] );\n if ( $n >= $start && $n <= $end ) {\n return false;\n }\n }\n return true;\n }",
"public function testIp()\n\t{\n\t\t$this->assertTrue(Validate::ip('192.168.0.1'));\n\n\t\t$this->assertFalse(Validate::ip('256.256.256.256'));\n\n\t\t$this->assertTrue(Validate::ip('684D:1111:222:3333:4444:5555:6:77', 'ipv6'));\n\n\t\t$this->assertFalse(Validate::ip('192.168.0.1', 'ipv6'));\n\n\t\t$this->assertFalse(Validate::ip('684D:1111:222:3333:4444:5555:6:77', 'ipv4'));\n\t}",
"public function isLoopback() {\n return $this->addr >> 8 == 0x7F0000;\n }",
"public function isLoopback() {\n return \"\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x01\" == $this->addr;\n }",
"public function isIp(): bool;",
"function validate_ip($ip) {\n if (strtolower($ip) === 'unknown')\n return false;\n\n // generate ipv4 network address\n $ip = ip2long($ip);\n\n // if the ip is set and not equivalent to 255.255.255.255\n if ($ip !== false && $ip !== -1) {\n // make sure to get unsigned long representation of ip\n // due to discrepancies between 32 and 64 bit OSes and\n // signed numbers (ints default to signed in PHP)\n $ip = sprintf('%u', $ip);\n // do private network range checking\n if ($ip >= 0 && $ip <= 50331647) return false;\n if ($ip >= 167772160 && $ip <= 184549375) return false;\n if ($ip >= 2130706432 && $ip <= 2147483647) return false;\n if ($ip >= 2851995648 && $ip <= 2852061183) return false;\n if ($ip >= 2886729728 && $ip <= 2887778303) return false;\n if ($ip >= 3221225984 && $ip <= 3221226239) return false;\n if ($ip >= 3232235520 && $ip <= 3232301055) return false;\n if ($ip >= 4294967040) return false;\n }\n return true;\n}",
"public static function isLocalAccess() {\r\n $my_ips = array(\r\n '188.254.173.58', // J\r\n '192.241.136.146', // js\r\n '192.241.147.53', // zeus\r\n );\r\n\r\n return empty($_SERVER['REMOTE_ADDR'])\r\n || preg_match('#^(127\\.0\\.0\\.1|192\\.168\\.[0-2]\\.)#si', $_SERVER['REMOTE_ADDR'])\r\n || in_array($_SERVER['REMOTE_ADDR'], $my_ips);\r\n }",
"function isIP($sIP = '') {\n\t\tif ($sIP && '' != trim($sIP)) {\n\t\t\tif (preg_match('/^(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:[.](?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}$/', $sIP)) return true;\n\t\t} // not null, false or MT\n\n\t\treturn false;\n\t}",
"function isys_glob_is_valid_ip6($p_ip)\n{\n if (preg_match('/^[A-F0-9]{0,5}:[A-F0-9:]{1,39}$/i', $p_ip))\n {\n\n $l_p = explode(':::', $p_ip);\n if (count($l_p) > 1)\n {\n return false;\n }\n\n $l_p = explode('::', $p_ip);\n if (count($l_p) > 2)\n {\n return false;\n }\n\n $l_p = explode(':', $p_ip);\n\n if (count($l_p) > 8)\n {\n return false;\n }\n\n foreach ($l_p as $l_checkPart)\n {\n if (strlen($l_checkPart) > 4)\n {\n return false;\n }\n }\n\n return true;\n }\n\n return false;\n}",
"public function isInLocalIpRange();",
"public function testIsInNetmaskWithBitsInIP()\n {\n $testip = \"FE80:FFFF:0:FFFF:129:144:52:38/16\";\n $testprefix = \"FE80::\";\n $is = $this->ip->isInNetmask($testip, $testprefix);\n $this->assertTrue($is);\n }",
"public function ip(string $value): bool\n {\n return filter_var($value, FILTER_VALIDATE_IP) !== false;\n }",
"function is_localhost()\n{\n return Request::instance()->ip() === '::1';\n}",
"public static function ip($input): bool\n\t{\n\t\t$input = \\is_array($input) ? $input : [$input];\n\t\t$result = true;\n\t\tforeach ($input as $ipAddress) {\n\t\t\tif (false === filter_var($ipAddress, FILTER_VALIDATE_IP)) {\n\t\t\t\t$result = false;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn $result;\n\t}",
"function is_a_ip($ipdir){\r\n\tif (preg_match('^(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:[.](?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}$^',$ipdir)){\r\n\t\treturn true;\r\n\t}\r\n\telse return false;\r\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns absolute file path to pdf file. | public function getPdfFile()
{
$pdf = $this->getPdfPath();
if (!$this->filesystem->exists($pdf)) {
throw new \Robinson\Frontend\Model\Exception(sprintf('Pdf does not exist at location: "%s"', $pdf));
}
return $pdf;
} | [
"protected function getPdfPath()\n {\n $baseDir = $this->baseDir . '/' . $this->package->getPackageId();\n return $baseDir . '/' . $this->package->getPdf();\n }",
"function pdf_path($file = NULL, $module = NULL, $absolute = NULL)\n{\n\t$CI = _get_assets();\n\treturn $CI->asset->pdf_path($file, $module, $absolute);\n}",
"public function getPdfFilePath()\n {\n return $this->invoicePdfFilePath;\n }",
"public function get_pdf_invoice_path()\n {\n $full_path = rand(0, 1);\n $client_id = rand(1, 100);\n $contract_id = rand(1, 100);\n $filename = str_random(20);\n $this->assertInternalType('string', self::$parse->get_pdf_invoice_path($full_path, $client_id, $contract_id, $filename));\n }",
"public function getPdfFilePath()\r\n {\r\n return $this->generatedPdfFilePath;\r\n }",
"public function getPdfUrlPath()\n {\n return $this->invoicePdfUrlPath;\n }",
"public function getAbsoluteFilePath()\n {\n $storage = Yii::$app->storage;\n return $storage->getAbsolutePath($this->file);\n }",
"static function getUrl_For_FilePDF($report) {\n $pdfFile = '/files/mPDF/' . $report . '.pdf';\n // Получим URL сохраненного файла PDF\n $urlFilePDF = self::getUserUploadUrl() . $pdfFile;\n return $urlFilePDF;\n }",
"abstract protected function getPDFURL();",
"public function getPdfPath()\n {\n if(!isset($this->_pdfPath))\n $this->setPdfPath('application.runtime.pdf');\n\n if(!is_dir($this->_pdfPath))\n mkdir($this->_pdfPath,0777,true);\n\n return $this->_pdfPath;\n }",
"public function pdfImage(): string\n {\n $product_image = $this->isMainImage();\n\n return $product_image\n ? public_path('/storage/'.$product_image->path)\n : public_path('/'.$this->demoImagePath());\n }",
"public function getPdfUrl()\n {\n return isset($this->pdf_url) ? $this->pdf_url : null;\n }",
"public static function getPdfFile($item)\n {\n $topParentItem = OaipmhHarvesterPlugin::getTopParentItem($item);\n if (!AdditionalResource::itemHasPdfFile($topParentItem)) return false;\n return ADDITIONAL_RESOURCES_UPLOADS_URL.'/pdf_'.$topParentItem->id.'.pdf';\n }",
"public function getAbsoluteFilePath()\n {\n return $this->filePath;\n }",
"public function getFileAbsolutePath($file);",
"public function getPdfFilename() {\n\t\t$baseName = sprintf('%s-%s', $this->URLSegment, $this->ID);\n\n\t\t$folderPath = Config::inst()->get('BasePage', 'generated_pdf_path');\n\t\tif($folderPath[0] != '/') $folderPath = BASE_PATH . '/' . $folderPath;\n\n\t\treturn sprintf('%s/%s.pdf', $folderPath, $baseName);\n\t}",
"abstract public function get_fulltext_pdf_path( $post_id );",
"public function get_pdf_contract_path()\n {\n $full_path = rand(0, 1);\n $client_id = rand(1, 100);\n $contract_id = rand(1, 100);\n $filename = str_random(20);\n $this->assertInternalType('string', self::$parse->get_pdf_contract_path($full_path, $client_id, $contract_id, $filename));\n }",
"public function getPdfUrl()\n {\n $url = get_post_meta($this->id, 'sb-pdf-url', true);\n\n if (!empty($url)) {\n return $url;\n }\n\n return false;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns an instance of SplFileInfo, but first the run method should be executed | public function getFile()
{
if (!$this->file instanceof SplFileInfo) {
throw new \BadMethodCallException('To use this method please execute the method run() first');
}
return $this->file;
} | [
"public function getSplFileInfo() {\n\t\treturn new SplFileInfo($this->getTempPath());\n\t}",
"protected function createSplFileInfo(): SplFileInfo\n {\n if (null !== $this->splFileInfo && $this->path === $this->splFileInfo->getRealPath()) {\n return $this->splFileInfo;\n }\n $this->splFileInfo = new SplFileInfo($this->path);\n\n return $this->splFileInfo;\n }",
"public function current(): SplFileInfo\n {\n // the logic here avoids redoing the same work in all iterations\n\n if (!isset($this->subPath)) {\n $this->subPath = $this->getSubPath();\n }\n $subPathname = $this->subPath;\n if ('' !== $subPathname) {\n $subPathname .= $this->directorySeparator;\n }\n $subPathname .= $this->getFilename();\n\n if ('/' !== $basePath = $this->rootPath) {\n $basePath .= $this->directorySeparator;\n }\n\n return new SplFileInfo($basePath.$subPathname, $this->subPath, $subPathname);\n }",
"public function fileInfo()\n {\n return new SplFileInfo($this->_realPath);\n }",
"protected function _createFileInfo()\r\n {\r\n return new Akt_Filesystem_Iterator_SplFileInfo(\r\n $this->getPathname(), $this->getSubPathname()\r\n ); \r\n }",
"public function getMetadata(): SplFileInfo {\n return new SplFileInfo( $this->path );\n }",
"public function makeInstance($filePath)\n\t{\n\t\treturn new SplFileInfo($filePath);\n\t}",
"protected function getEmptyFileInfo() : \\SplFileInfo\n {\n return new \\SplFileInfo(static::EMPTY_FILE_NAME);\n }",
"public function getFileInfo($class = null): \\SplFileInfo\n {\n $this->setInfoClass($class ?? FileInfo::class);\n\n return parent::getFileInfo();\n }",
"public function current()\n\t{\n\t\t$name = $this->getPathname();\n\n\t\t$endletters = DIRECTORY_SEPARATOR . '.';\n\n\t\tif (substr($name, -2) == $endletters)\n\t\t{\n\t\t\t$name = substr($name, 0, -2);\n\t\t}\n\n\t\t$file = new \\SplFileInfo($name);\n\n\t\treturn $file;\n\t}",
"public function __call($method, array $args) {\n if (!isset($this->splFileInfo)) {\n $this->splFileInfo = new \\SplFileInfo($this->root . '/' . $this->pathname);\n }\n return call_user_func_array([$this->splFileInfo, $method], $args);\n }",
"function getFirstFile()\r\n {\n if ($this->_artwork->getReaktorFile())\n {\n return new artworkFile($this->_artwork->getReaktorFile(), $this);\n }\n else\n {\n return $this->resetFirstFile();\n }\n }",
"private function extractSplFileObject(\\SplFileInfo $object): \\SplFileObject\n {\n if ($object instanceof \\SplFileObject) {\n return $object;\n }\n\n return $object->openFile();\n }",
"public function testGetFileObject(\\SplFileInfo $fileInfo) : void\n {\n $instance = $this->getEmptyInstance();\n $reflexProperty = $this->getFileInfoReflection();\n $reflexProperty->setValue($instance, $fileInfo);\n\n $reflexMethod = new \\ReflectionMethod(sprintf('%s::%s', FileInfoStreamAdapter::class, 'getFileObject'));\n $reflexMethod->setAccessible(true);\n\n $reflexObject = new \\ReflectionProperty(FileInfoStreamAdapter::class, 'fileObject');\n $reflexObject->setAccessible(true);\n\n $fileObject = $fileInfo->openFile();\n $reflexObject->setValue($instance, $fileObject);\n\n $this->assertSame(\n $fileObject,\n $reflexMethod->invoke($instance),\n sprintf(\n 'The \"%s\" getFileObject method is expected to return the fileObject instance',\n FileInfoStreamAdapter::class\n )\n );\n\n $instance = $this->getEmptyInstance();\n $this->assertNull(\n $reflexMethod->invoke($instance),\n sprintf(\n 'The \"%s\" getFileObject method is expected to return null if no fileObject',\n FileInfoStreamAdapter::class\n )\n );\n\n return;\n }",
"protected function getFile()\n {\n $file = new SplFileObject($this->reflection->getFileName());\n\n $file->seek($this->reflection->getStartLine() - 1);\n\n return $file;\n }",
"public function getInfo(string $filename): SplFileInfo {\n return new SplFileInfo($filename);\n }",
"public function getFileInfo()\n {\n return $this->fileInfo;\n }",
"public function current()\n\t{\n\t\t$file = new Source(parent::current()->getPathName());\n\t\t\n\t\t$extension = $file->getExtension();\n\t\tif(isset($this->scannersByExtensions[$extension])){\n\t\t\tforeach($this->scannersByExtensions[$extension] as $scannerSuffix){\n $scannerClass = \"\\\\Zf2TranslationScanner\\\\File\\\\Source\\\\Scanner\\\\\".ucfirst($scannerSuffix);\n\t\t\t\t$file->addScanner(new $scannerClass());\n\t\t\t}\n\t\t}\n\t\treturn $file;\n\t}",
"public function prepareFile()\n {\n $file = $this->moveFileToTempDirectory();\n\n return $this->executeFileEvents($file);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create a new JsonType from an array of data | public static function createFromArray($name, array $data = [])
{
$type = parent::createFromArray($name, $data);
\assert($type instanceof self);
$type->json = $data;
return $type;
} | [
"public function fromArray(array $data);",
"public static function createFromArray($name, array $data = [])\n {\n /** @var ArrayType $type */\n $type = parent::createFromArray($name, $data);\n $pos = strpos($type->getType(), '[]');\n if ($pos !== false) {\n $type->setItems(substr($type->getType(), 0, $pos));\n }\n $type->setType('array');\n\n foreach ($data as $key => $value) {\n switch ($key) {\n case 'uniqueItems':\n $type->setUniqueItems($value);\n break;\n case 'items':\n $type->setItems($value);\n break;\n case 'minItems':\n $type->setMinItems($value);\n break;\n case 'maxItems':\n $type->setMaxItems($value);\n break;\n }\n }\n\n return $type;\n }",
"public static function fromArray($array): AbstractInputType;",
"public static function makeFromArray(array $data)\r\n {\r\n }",
"public static function fromArray($array);",
"public static function fromArray(array $data){\n $spl = new static();\n foreach ($data as $item) {\n if(!is_object($item)){\n throw new \\InvalidArgumentException(sprintf(\"Wrong array item at index '%s', object expected, '%s' given \",key($data), gettype($item)));\n }\n $spl->attach($item);\n }\n return $spl;\n\n }",
"public static function create(array $data) : Serializable;",
"public function dataFromArray(array $data);",
"public function createFromArray(array $data): ModelInterface;",
"abstract public function fromArray(array $array): BaseEntity;",
"public static function fromArray(array $schema): self;",
"abstract public function fromArray(array $model);",
"public static function to_object($array)\n {\n return json_decode(json_encode($array));\n }",
"public static function buildFromJsonArray($jsonArray) {\n \n if (empty($jsonArray['items']) || !is_array($jsonArray['items'])) {\n throw new \\InvalidArgumentException(\"json array argument must be an array with items index\");\n }\n \n $order = new Order();\n\n foreach ($jsonArray['items'] as $item) {\n\n $product = new Product();\n $product->initialize($item);\n\n $orderItem = new OrderItem();\n $orderItem->setProductAndQuantity($product, $item['quantity']);\n\n $order->addOrderItem($orderItem);\n }\n\n return $order;\n }",
"public function deserialize(array $data)\n {\n list($class, $result) = $data;\n\n $uow = $this->em->getUnitOfWork();\n return $uow->createEntity($class, $result);\n }",
"public static function initializeWithRawData($data)\n {\n $item = new CustomField();\n \n foreach ($data as $key => $value) {\n switch ($key) {\n case 'id':\n $item->setId($value);\n break;\n case 'name':\n $item->setName($value);\n break;\n case 'for':\n $item->setFor($value);\n break;\n case 'type':\n $item->setType($value);\n break;\n case 'group':\n $item->setGroup($value);\n break;\n default:\n // ignore empty values\n if ($value === '') {\n continue;\n }\n }\n }\n return $item;\n }",
"public final function initFromArray( array $data )\n {\n\n $this->Label = isset( $data[ 'Label' ] ) ? $data[ 'Label' ] : null;\n $this->Title = isset( $data[ 'Title' ] ) ? $data[ 'Title' ] : null;\n $this->ObjectName = isset( $data[ 'Object-Name' ] )\n ? $data[ 'Object-Name' ]\n : ( isset( $data[ 'Object Name' ] )\n ? $data[ 'Object Name' ]\n : null );\n\n }",
"public static function toObject(array $array);",
"public static function buildFromArray(array $array, string $package, string $packageDir) : AssetOperation\n {\n if (!isset($array['value'])) {\n throw new JsonException(sprintf('Missing \"value\" key in discovery.json from package %s', $package));\n }\n $value = $array['value'];\n unset($array['value']);\n\n if (isset($array['priority'])) {\n $priority = $array['priority'];\n unset($array['priority']);\n } else {\n $priority = 0.0;\n }\n\n if (isset($array['metadata'])) {\n $metadata = $array['metadata'];\n unset($array['metadata']);\n } else {\n $metadata = [];\n }\n \n if (isset($array['action'])) {\n $action = $array['action'];\n unset($array['action']);\n } else {\n $action = self::ADD;\n }\n\n if (!empty($array)) {\n throw new JsonException(sprintf('Unexpected key(s) in discovery.json from package %s: \"%s\"', $package, implode(', ', array_keys($array))));\n }\n\n return new self($action, new Asset($value, $package, $packageDir, $priority, $metadata));\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set stores user Entity | public function setUser(UserEntity $user) : void
{
$this->user = $user;
} | [
"public function set()\n\t{\n\t\t$this->created_at = date(TIMESTAMP_FORMAT);\n $user = new SessionUser();\n\t\t$this->created_by = $user->getID();\t\t\n\t}",
"private function _setIdentity(){\n $this->_setUserData($this->getClassUser()->getIdentity());\n }",
"function setUser( $user )\n {\n if ( $this->State_ == \"Dirty\" )\n $this->get( $this->ID );\n\n if ( get_class( $user ) == \"ezuser\" )\n {\n $this->UserID = $user->id();\n }\n }",
"function setUser( $value )\n {\n if ( $this->State_ == \"Dirty\" )\n $this->get();\n $this->User = $value;\n }",
"function setUser( $user )\r\n {\r\n if ( is_a( $user, \"eZUser\" ) )\r\n {\r\n $userID = $user->id();\r\n\r\n $this->UserID = $userID;\r\n }\r\n }",
"public function setUser($value)\r\n\t{\r\n\t\t$this->_user = $value;\r\n\t}",
"public function setUserId($value);",
"public function testSetUser()\n\t{\n\t\t$this->object->setUser('root');\n\n\t\t$this->assertThat(\n\t\t\t$this->object->getUser(),\n\t\t\t$this->equalTo('root')\n\t\t);\n\t}",
"public function setUser($value)\n\t{\n\t\t$this->user = $value;\n\t}",
"protected function storeUser()\n {\n $this->repo->store($this->user);\n $this->flush();\n }",
"protected abstract function setEntity(): void;",
"public function set_user_data() {\n\t\tglobal $current_user;\n\n\t\t$this->current_user = $current_user;\n\n\t\t$this->debug();\n\t}",
"function set_user($user)\r\n {\r\n $this->set_default_property(self :: PROPERTY_USER, $user);\r\n }",
"public function setSiteUser(?SharePointIdentity $value): void {\n $this->getBackingStore()->set('siteUser', $value);\n }",
"public function setCurrentUser()\n {\n $session = $this->di->get(\"session\");\n\n if ($session->get(\"loggedin\")) {\n $user = new \\Nihl\\User\\User();\n $user->setDb($this->di->get(\"dbqb\"));\n\n $user->find(\"username\", $session->get(\"loggedin\"));\n\n $this->currentUser = $user;\n }\n }",
"public function setEntity($entity){ }",
"public function setExistingUser(Entity\\User $user)\n {\n $this->existing_user = $user;\n }",
"public function setUser($user)\n {\n $this->storage()->write($user);\n }",
"public function setAuthenticatedUser($user);"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set/overwrites the index key Converts $name with type casting (string) | public function set_field_name_for_file($name = '') {
$this->index_key = (!empty($name) ) ? (string) $name : '';
return $this->index_key;
} | [
"public function setIndexName($name)\n {\n $this->indexSettings['index'] = $name;\n }",
"public function set_name($newName, $index)\n {\n\t\tif(is_int($index) && $index >= 0 && $index < sizeof($this->name)){\n\t\t\t$this->name[$index] = $newName;\n\t\t}\n\t\telse{\n\t\t\techo \"<div> parameter index value shall be an integer [0, \". sizeof($this->name) . \"[</div>\" ;\n\t\t}\n }",
"public function setIndexName($indexName);",
"public function indexPut($indexName, $key, $rid);",
"private function addSettingToIndex( $name ) {\n\t\t$this->arrIndex[ $name ] = count( $this->arrSettings ) -1;\n\t}",
"function setIndexName($indexName){\n $this->indexName = $indexName;\n }",
"public function changeKeyNames(){\n\n $this->finalArr = array_map(function($arr) {\n\n return array(\n 'id' => $arr[0],\n 'weight' => $arr[1],\n 'value' => $arr[2],\n 'W/V' => $arr[3]\n );\n }, $this->finalArr);\n\n }",
"protected function setCanonicalIndex(): void\n {\n $got = $this->redisConn->hget($this->index, IndexInterface::STRUCTURE);\n $data = (null === $got) ? [] : $this->unser($got);\n if (empty($data)) { // just fill-in new index data\n $data[$this->index] = [\n IndexInterface::ALIASES => [],\n ];\n $this->setMappings($data);\n $this->redisConn->hset($this->index, IndexInterface::STRUCTURE, $this->ser($data));\n } else if (empty($this->indexType) === false\n && empty($data[$this->index][IndexInterface::MAPPINGS][$this->indexType])\n ) {// check for type and update if there is no alike\n $this->setMappings($data);\n $this->redisConn->hset($this->index, IndexInterface::STRUCTURE, $this->ser($data));\n } else { // setting new fields with whitespace type by default\n $this->setMappings($data, true);\n if (true === $this->isNewField) {\n $this->redisConn->hset($this->index, IndexInterface::STRUCTURE, $this->ser($data));\n }\n }\n }",
"function _key($name = '')\n {\n }",
"public function renameIndex($index, $newname){}",
"function set_selectname($keyname, $new_name) {\n if($new_name) $this->current_names[$keyname] = $new_name;\n }",
"public function LSet($key, $index, $value);",
"private function rewrite_key()\n {\n $this->_query = preg_replace_callback('/,\\\\s*(KEY|INDEX)\\\\s*(\\\\w+)?\\\\s*(\\(.+\\))/im', [$this, '_rewrite_key'],\n $this->_query);\n }",
"public function setSingleValueIndex($key, $value);",
"public function setIndexKey($field)\n\t{\n\t\tif (!isset($this->headers[$field])) {\n\t\t\tthrow new Exception('\"' . $field . '\" column not found.');\n\t\t}\n\n\t\tif ($this->headers[$field] != self::TYPE_INT) {\n\t\t\tthrow new Exception('\"' . $field . '\" column is not a type of interger.');\n\t\t}\n\n\t\t$this->indexKey = $field;\n\t}",
"function setKey($keyname = '', $value = '')\n {\n // Only the create and write functions should set the lastChange value.\n if ($keyname != 'lastChange') {\n if (array_key_exists($keyname, $this->arrDBItems) or $keyname == $this->strDBKeyCol) {\n if ($value != '' && $this->$keyname != $value) {\n $this->$keyname = $value;\n $this->arrChanges[$keyname] = true;\n }\n }\n }\n }",
"function __set($name, $value) {\n $this->nmap[$name]=$value;\n }",
"protected function resolveIndexNames($index, $name)\n {\n $index->name = str_replace('`', '', $name);\n }",
"public function createIndexName() {\n $url = $this->serverUrl . $this->documentIndex;\n $ch = curl_init();\n curl_setopt($ch,CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT');\n $result = curl_exec($ch);\n return $result;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the objects array | public function setObjects(array $objects): void
{
$this->objects = $objects;
$this->objects[ObjectManagerInterface::class]['i'] = $this;
$this->objects[get_class($this)]['i'] = $this;
} | [
"public function setObjects(?array $objects): void\n {\n $this->objects = $objects;\n }",
"public function limpaArrayIdsObjetosManipulados()\n {\n \t// limpando o array de ids de objetos manipulados\n \t$this->_arrayObjetosManipulados = array();\n }",
"private function instantiate(){\n\t\t$this->valor = new ArrayObject();\n\t\t$this->motivo = new ArrayObject();\n\t}",
"private function set_objects() {\r\n\t\t$this->ajax \t= new ShipArea_Ajax();\r\n\t\t$this->public \t= new ShipArea_Public();\r\n\r\n\t\tif( is_admin() ) {\r\n\t\t\t$this->license \t\t= new ShipArea_License();\r\n\t\t\t$this->admin \t\t= new ShipArea_Admin();\r\n\t\t\t$this->settings \t= new ShipArea_Settings();\r\n\t\t}\r\n\t}",
"protected function setData(array $data){\n foreach ($data as $key => $value){\n if (array_key_exists($key,get_object_vars($this)))\n $this->$key = $value;\n else\n $this->props[$key]=$value;\n }\n }",
"public function setArray( $array );",
"public function setCreatedObjects(?array $value): void {\n $this->getBackingStore()->set('createdObjects', $value);\n }",
"function set(array $array) {\n\n foreach ($array as $propertyToSet => $value) {\n $this->$propertyToSet =$value;\n \n }\n }",
"private function setFieldArrays()\n {\n $this->foreignKey->fields = (array) $this->foreignKey->fields;\n $this->foreignKey->reference->fields = (array) $this->foreignKey->reference->fields;\n }",
"function setValues($arrCats) {\n //Set values for the properties for a Cat object\n $this->id = $arrCats['cat_id'];\n $this->name = $arrCats['name'];\n $this->color = $arrCats['color'];\n $this->type = $arrCats['type'];\n $this->price = $arrCats['price'];\n $this->status = $arrCats['status'];\n }",
"function setAllSoft($arraydata) {\r\n\r\n foreach ($arraydata as $k => $v)\r\n if (in_array($k, array_keys($this->properties)))\r\n $this->properties[$k] = $v;\r\n\r\n\r\n\r\n $this->ID = $arraydata[\"ID\"];\r\n $this->_normalize();\r\n }",
"function setAllSoft($arraydata) {\r\n \r\n foreach ($arraydata as $k=>$v) \r\n if (in_array($k,array_keys($this->properties)))\r\n $this->properties[$k]=$v;\r\n \r\n \r\n \r\n $this->ID=$arraydata[\"ID\"];\r\n $this->_normalize();\r\n \r\n \r\n \r\n \r\n }",
"function set(array $array){\n foreach($this as $atributo => $valor){\n if(isset($array[$atributo])){\n $this->$atributo = $array[$atributo];\n }\n }\n }",
"protected function setProperties()\n {\n foreach ($this->data as $key => $value) {\n $this->$key = $value;\n }\n }",
"public function setValues();",
"public function testConstructorBulkSetItems(): void\n {\n $secondPermittedClassObject = TestHelpers::newEmptyClassObject();\n\n $array = [\n 'a' => $this->permittedClassObject,\n 'b' => $secondPermittedClassObject\n ];\n\n $extendsTypedArray = $this->newExtendingClassObject($this->permittedClass, $array);\n\n $this::assertSame(\n $array,\n $extendsTypedArray->getItems()\n );\n }",
"function setData($items) {\r\r\n $this->_items = $items;\r\r\n }",
"function SetObjects () {\n // might get slow if the number objects reaches the billions.\n // by then, you'll learn to use ORDER BY `oid` DESC LIMIT 10000.\n $type = $this->type;\n if ($type >= 0) {\n if ($type == ALL_OBJECTS) {\n return array_keys ((array) $this->db->objects);\n } else {\n\t\t\t\t\t$buffer = array ();\n foreach ((array) $this->db->objects as $oid => $object) {\n\t\t\t\t\t\tif ($object['type'] == $type) {\n\t\t\t\t\t\t\t$buffer[] = $oid;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\treturn $buffer;\n\t\t\t\t}\n } else {\n die (\"Cannot get objects because of invalid type.\");\n return array (); // die (\"Invalid type\");\n }\n }",
"function set_items() { \n\n\t\t$this->items = $this->get_items();\n\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Retrieve if quiet zones are draw or not | public function getWithQuietZones()
{
return $this->_withQuietZones;
} | [
"public function hasZone(): bool;",
"public function forLimitedZone()\n {\n return $this->shippingZones->isNotEmpty();\n }",
"public function checkZone() {\n $stateWsId = array();\n \n foreach (Mage::getModel('autelcorto/zone')->getCollection() as $z) {\n \n foreach (explode(',', $z->getStateList()) as $state) {\n $stateWsId[$state][$z->getWebsiteId()] = $z->getDescription();\n } \n \n }\n \n $errorMsg = \"\";\n \n foreach ($stateWsId as $k=>$v) {\n \n if (sizeof($v) > 1) {\n $country = Mage::getModel('directory/country')->Load($k);\n $errorMsg .= $country->getName() . \" presente in:<br>\";\n foreach ($v as $ws => $zd) {\n $errorMsg .= \" \";\n $errorMsg .= MAge::getModel('core/website')->Load($ws)->getName() . \" (Zona . \" . $zd . \")<br>\";\n }\n }\n \n }\n \n if ($errorMsg != \"\") {\n Mage::getSingleton('adminhtml/session')->addError($errorMsg);\n }\n \n return $errorMsg == \"\";\n }",
"private function isZoneEnabled()\n {\n return !$this->enableConfigFlag || $this->scopeConfig->getValue($this->enableConfigFlag);\n }",
"public function getQuietZone() {\r\n return $this->quietZone;\r\n }",
"public function getQuietZone()\n {\n return $this->quietZone;\n }",
"public function hasZone(): bool\n {\n return $this->loadMissing('zone')->relationLoaded('zone');\n }",
"public function getCustomerZoneWarning()\n {\n return \\XLite\\Core\\Auth::getInstance()->isClosedStorefront() ? 'maintenance_mode' : null;\n }",
"function _isZoneActive($aZone)\n{\n return true; // for now, all zones are active.\n}",
"private function checkForDrawings(): bool\n { $found = false;\n foreach ($this->spreadsheet->getAllSheets() as $sheet) {\n if (count($sheet->getDrawingCollection()) > 0) {\n $found = true;\n\n break;\n }\n }\n\n return $found;\n }",
"public function getCrossBorderTradeNorthAmericaEnabled()\n {\n return $this->crossBorderTradeNorthAmericaEnabled;\n }",
"public function hasZoneIdentifier(): bool;",
"public function isJustgdprcfied()\n\t{\n\t\treturn $this->justgdprcfied;\n\t}",
"function isBorderPainted()\r\n {\r\n return $this->_paintBorder;\r\n }",
"function dnssec_is_zone_secured($domain_name) {\n $call_result = call_dnssec('show-zone', $domain_name);\n $output = $call_result[0];\n $return_code = $call_result[1];\n\n if ($return_code != 0) {\n error(ERR_EXEC_PDNSSEC_SHOW_ZONE);\n return false;\n }\n\n return (count($output) == 0 ? false : true);\n}",
"function shouldDisplayFogNotice() {\n\t\t$visibility = getVisibility();\n\t\tpreg_match('/(<|>)(\\d+)(k?m)/', $visibility, $matches);\n\t\t$visibility_dist = $matches[2];\n\t\tif ($matches[1] != \"<\")\n\t\t\treturn false;\n\t\tif ($matches[3] == \"km\")\n\t\t\t$visibility_dist *= 1000;\n\t\treturn ($visibility_dist < 150 ? 0 : 0);\n\t}",
"public function isAreasMarked()\n {\n return count($this->getProviderCoveredAreas()->where(['IS NOT', 'type', NULL])->all()) > 0;\n }",
"public function isSetPoints()\n {\n return !is_null($this->_fields['Points']['FieldValue']);\n }",
"public function zone()\r\n {\r\n return $this->liste(\"COBAS=1 Or HorsCOBAS=1\");\r\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get user update stream | public function getUpdateStream($params)
{
$updates = array();
// Create a new chat server for this user
$chatSvr = new AntChat($this->ant->dbh, $this->user);
// TODO: notices
// TODO: presence - a user logs on or off
// Run the loop checking for updates until we have something to return
$passes = 0; // We return every 20 seconds
while(count($updates) == 0 && $passes<20)
{
// First check for new chats
$newChats = $chatSvr->getNewMessages();
if (count($newChats))
{
foreach ($newChats as $newChatFrom)
{
$updates[] = array(
"type" => "chat",
"data" => array(
"friendName" => $newChatFrom,
),
);
}
}
// For testing we may bust out of the loop
if (isset($params['forceReturn']))
break;
else
{
$passes++;
sleep(1);
}
}
return $this->sendOutput($updates);
} | [
"function getUserRealTimeStream() {\n\t\treturn $this->httpGet($this->_baseUrl.'posts/stream/global');\n\t\t//return $this->httpGet($this->_baseUrl.'streams/user');\n\n\t}",
"function actionstream_poll() {\n\t$users = get_users_of_blog();\n\n\tforeach($users as $user) {\n\t\t$actionstream = get_usermeta($user->ID, 'actionstream');\n\t\tif (!is_array($actionstream) || empty($actionstream)) { continue; }\n\t\t$actionstream = new ActionStream($actionstream, $user->ID);\n\t\t$actionstream->update();\n\t}\n\n}",
"public function getUserUpdate()\n {\n return $this->user_update;\n }",
"function getUserActivity( $stream ) \n\t{\n\t\t$userId = $this->getCurrentUserId();\n\n\t\t$parameters = array();\n\t\t$parameters['format']\t= 'json';\n\t\t$parameters['count']\t= 'max';\n\t\t\n\t\t$response = $this->api->get('user/' . $userId . '/updates', $parameters);\n\n\t\tif( ! $response->updates || $this->api->http_code != 200 )\n\t\t{\n\t\t\tthrow new Exception( 'User activity request failed! ' . $this->providerId . ' returned an error: ' . $this->errorMessageByStatus( $this->api->http_code ) );\n\t\t}\n\n\t\t$activities = array();\n\n\t\tforeach( $response->updates as $item ){\n\t\t\t$ua = new Hybrid_User_Activity();\n\n\t\t\t$ua->id = (property_exists($item,'collectionID'))?$item->collectionID:\"\";\n\t\t\t$ua->date = (property_exists($item,'lastUpdated'))?$item->lastUpdated:\"\";\n\t\t\t$ua->text = (property_exists($item,'loc_longForm'))?$item->loc_longForm:\"\";\n\n\t\t\t$ua->user->identifier = (property_exists($item,'profile_guid'))?$item->profile_guid:\"\";\n\t\t\t$ua->user->displayName = (property_exists($item,'profile_nickname'))?$item->profile_nickname:\"\";\n\t\t\t$ua->user->profileURL = (property_exists($item,'profile_profileUrl'))?$item->profile_profileUrl:\"\";\n\t\t\t$ua->user->photoURL = (property_exists($item,'profile_displayImage'))?$item->profile_displayImage:\"\"; \n\n\t\t\t$activities[] = $ua;\n\t\t}\n\n\t\tif( $stream == \"me\" ){\n\t\t\t$userId = $this->getCurrentUserId();\n\t\t\t$my_activities = array();\n\n\t\t\tforeach( $activities as $a ){\n\t\t\t\tif( $a->user->identifier == $userId ){\n\t\t\t\t\t$my_activities[] = $a;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn $my_activities;\n\t\t}\n\n\t\treturn $activities;\n\t}",
"public function getUserActivity($stream);",
"public function getUserUpdated()\n {\n return $this->user_updated;\n }",
"function getUserActivity( $stream )\n {\n $userId = $this->getCurrentUserId();\n\n $parameters = array();\n $parameters['format']\t= 'json';\n $parameters['count']\t= 'max';\n\n $response = $this->api->get('user/' . $userId . '/updates', $parameters);\n\n if( ! $response->updates || $this->api->http_code != 200 )\n {\n throw new Exception( 'User activity request failed! ' . $this->providerId . ' returned an error: ' . $this->errorMessageByStatus( $this->api->http_code ) );\n }\n\n $activities = array();\n\n foreach( $response->updates as $item ){\n $ua = new Hybrid_User_Activity();\n\n $ua->id = (property_exists($item,'collectionID'))?$item->collectionID:\"\";\n $ua->date = (property_exists($item,'lastUpdated'))?$item->lastUpdated:\"\";\n $ua->text = (property_exists($item,'loc_longForm'))?$item->loc_longForm:\"\";\n\n $ua->user->identifier = (property_exists($item,'profile_guid'))?$item->profile_guid:\"\";\n $ua->user->displayName = (property_exists($item,'profile_nickname'))?$item->profile_nickname:\"\";\n $ua->user->profileURL = (property_exists($item,'profile_profileUrl'))?$item->profile_profileUrl:\"\";\n $ua->user->photoURL = (property_exists($item,'profile_displayImage'))?$item->profile_displayImage:\"\";\n\n $activities[] = $ua;\n }\n\n if( $stream == \"me\" ){\n $userId = $this->getCurrentUserId();\n $my_activities = array();\n\n foreach( $activities as $a ){\n if( $a->user->identifier == $userId ){\n $my_activities[] = $a;\n }\n }\n\n return $my_activities;\n }\n\n return $activities;\n }",
"function terminus_api_site_uptream_updates_get($site_uuid) {\n $realm = 'site';\n $uuid = $site_uuid;\n $path = 'code-upstream-updates';\n $method = 'GET';\n\n return terminus_request($realm, $uuid, $path, $method);\n}",
"public function getUpdater()\n {\n $user = User::where('id', $this->newest_update_user_id)->first();\n return $user;\n }",
"function getUsersRealTimeStream($user_ids=null) {\n\n\t\t$str = json_encode($user_ids);\n\t\treturn $this->httpGet($this->_baseUrl.'streams/app?user_ids='.$str);\n\n\t}",
"public function stream()\n\t{\n\t\t$id = $this->input->getInt('id', 0);\n\n\t\tif ($id == 0)\n\t\t{\n\t\t\t// Do we have a menu item parameter?\n\t\t\t/** @var \\JApplicationSite $app */\n\t\t\t$app = JFactory::getApplication();\n\t\t\t$params = $app->getParams('com_ars');\n\t\t\t$id = $params->get('streamid', 0);\n\n\t\t\t// Define the Id for caching as if it were received as a safeuri param\n\t\t\tJFactory::getApplication()->input->set('id', $id);\n\t\t}\n\n\t\t/** @var UpdateModel $model */\n\t\t$model = $this->getModel();\n\t\t$view = $this->getView();\n\t\t$view->items = $model->getItems($id);\n\t\t$view->published = $model->getPublished($id);\n\n\t\t$registeredURLParams = array(\n\t\t\t'option' => 'CMD',\n\t\t\t'view' => 'CMD',\n\t\t\t'task' => 'CMD',\n\t\t\t'format' => 'CMD',\n\t\t\t'layout' => 'CMD',\n\t\t\t'id' => 'INT',\n\t\t\t'dlid' => 'STRING',\n\t\t);\n\n\t\t$this->display(true, $registeredURLParams);\n\t}",
"function getUpdateUser()\n {\n return $this->_updateuser;\n }",
"function fnGetLinkedInUserProfileUpdates()\n {\n $strAccess_token = $_SESSION['_oauth_token'];\n $intUserId = \"USER ID\";\n\n if ($intUserId > 0) {\n\n $intStart = 0;\n $intCount = 10;\n $intPage = 1;\n if ($intPage) {\n $intStart = ($intPage - 1) * 10;\n }\n $ObjLinkedin = new LinkedInOAuth2($strAccess_token);\n\n try {\n $arrUserProfileUpdates = $ObjLinkedin->getUserStatuses($intUserId, true, $intStart, $intCount);\n } catch (Exception $e) {\n\n }\n }\n }",
"public function getUpdateUser()\n {\n return $this->updateuser;\n }",
"public function getEntryStream();",
"public function testUpdateStream()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }",
"function _getUpdateINIfopen()\n\t{\n\t $options = array( 'http' => array(\n\t 'max_redirects' => 2, // stop after 2 redirects\n\t 'timeout' => 5, // timeout on response\n\t ) );\n\t $context = stream_context_create( $options );\n\t\treturn @file_get_contents($this->_update_url, false, $context);\n\t}",
"public function getUpdateInfo()\n {\n return $this->update_info;\n }",
"public function getUpdates(){\n\t\treturn $this->send( 'getUpdates' );\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Executes this Choreo. Execution object provides access to results appropriate for this GetWalkingDirections Choreo. | public function execute($inputs = array(), $async = false, $store_results = true)
{
return new Google_Directions_GetWalkingDirections_Execution($this->session, $this, $inputs, $async, $store_results);
} | [
"public function directions()\n\t{\n\t\t//ensure there is at least two waypoints\n\t\tif(empty($this->waypoints[0]) && !empty($this->waypoints[1]))\n\t\t{\n\t\t\tdie(\"You need at least two \");\n\t\t}\n\t\t\n\t\t//perform the request\n\t\t$this->_mode = 'directions';\n\t\t$this->_response = $this->_request();\n\t\t\n\t\t//make sure there is a valid response\n\t\tif(empty($this->_response))\n\t\t{\n\t\t\tdie(\"Did not receive a response from mapquest\");\t\t\n\t\t}\t\t\n\t\t\n\t\t//return the directions\n\t\treturn $this->_response();\n\t\t\n\t}",
"public function execute($inputs = array(), $async = false, $store_results = true)\n {\n return new Google_Directions_GetDrivingDirections_Execution($this->session, $this, $inputs, $async, $store_results);\n }",
"public function getDirections(){}",
"public function getDirections()\n {\n return $this->directions;\n }",
"public function getDirections()\n {\n return $this->hasMany(Direction::className(), ['level_id' => 'id']);\n }",
"public function GetDrivingDistance(){\n $this->apiUrl = \"https://maps.googleapis.com/maps/api/distancematrix/json?origins=\".$this->origin_latitude.\",\".$this->origin_longitude.\"&destinations=\".$this->destinantion_latitude.\",\".$this->destination_longitude.\"&key=\".$this->apiKey;\n $json = file_get_contents($this->apiUrl);\n\n $details = json_decode($json, TRUE);\n \n echo \"<pre>\"; print_r($details); echo \"</pre>\";\n \n }",
"public function setDirections(array $directions)\n {\n $this->directions = $directions;\n return $this;\n }",
"public function execute($inputs = array(), $async = false, $store_results = true)\n {\n return new Google_DistanceMatrix_WalkingDistanceMatrix_Execution($this->session, $this, $inputs, $async, $store_results);\n }",
"public function route()\n {\n $args = func_get_args();\n\n if (isset($args[0]) && ($args[0] instanceof DirectionsRequest)) {\n $directionsRequest = $args[0];\n } elseif ((isset($args[0]) && is_string($args[0])) && (isset($args[1]) && is_string($args[1]))) {\n $directionsRequest = new DirectionsRequest();\n\n $directionsRequest->setOrigin($args[0]);\n $directionsRequest->setDestination($args[1]);\n } else {\n throw DirectionsException::invalidDirectionsRequestParameters();\n }\n\n if (!$directionsRequest->isValid()) {\n throw DirectionsException::invalidDirectionsRequest();\n }\n\n $response = $this->send($this->generateUrl($directionsRequest));\n $directionsResponse = $this->buildDirectionsResponse($this->parse($response->getBody()));\n\n return $directionsResponse;\n }",
"public function getMoveByCoordinates(Game $game, Coordinates $direction);",
"function getTour( $origin, $destination,$waypoints, $mode = 'driving' ) {\n\t\t$googleMapsApiUrl = 'http://maps.googleapis.com/maps/api/directions/json'.\n\t\t\t\t\t\t\t'?origin='.$origin.\n\t\t\t\t\t\t\t'&destination='.$destination.\n\t\t\t\t\t\t\t'&waypoints=optimize:true|'.$waypoints.\n\t\t\t\t\t\t\t'&mode='.$mode ;\n\t\t//die( $googleMapsApiUrl ) ;\n\t\t$stuff = file_get_contents( $googleMapsApiUrl ) ;\n\t\tprint( json_encode( $stuff ) ) ;\n\t}",
"public function moves()\n {\n // Only handle gets\n if ($this->method != 'GET') {\n return self::NOT_GET_RESPONSE;\n }\n $movesData = $this->getJsonFromFile(self::MOVES_FILENAME);\n return $this->getBasicNamedStructure($movesData);\n }",
"public function setJourneyDirection($value = NULL)\n\t{\n\t\tif (NULL !== $value) {\n\t\t $this->journeyDirection = $value;\n\t\t}\n\t\treturn $this;\n\t}",
"public function direction(array $options)\n {\n $direction = DirectionAction::make($options);\n // $direction = (new DirectionAction())\n // ->setOrigin($origin)\n // ->setDestination($destination)\n // ->setTravelmode($travelmode);\n\n return (new OriginalMapsUrl($direction))->getUrl();\n }",
"public function doMove($direction){\n //Retrieve the fighter\n \n App::uses('CakeSession', 'Model/Datasource');\n $idFighterSelected=CakeSession::read('User.fighter');\n $myFighter=$this->findById($idFighterSelected);\n $errorMessage=\"\";\n /**\n * Change coo of the fighter according to direction and arena limit\n */\n if(strcmp($direction,\"east\")==0){\n if($myFighter[\"Fighter\"][\"coordinate_x\"]<14){\n $myFighter[\"Fighter\"][\"coordinate_x\"]++;\n }else{\n $errorMessage+=\"Arena limits reach\\n\";\n }\n }else if(strcmp($direction,\"west\")==0){\n if($myFighter[\"Fighter\"][\"coordinate_x\"]>0){\n $myFighter[\"Fighter\"][\"coordinate_x\"]--;\n }else{\n $errorMessage+=\"Arena limits reach\\n\";\n }\n }else if(strcmp($direction,\"north\")==0){\n if($myFighter[\"Fighter\"][\"coordinate_y\"]<9){\n $myFighter[\"Fighter\"][\"coordinate_y\"]++;\n }else{\n $errorMessage+=\"Arena limits reach\\n\";\n }\n }else if(strcmp($direction,\"south\")==0){\n if($myFighter[\"Fighter\"][\"coordinate_y\"]>0){\n $myFighter[\"Fighter\"][\"coordinate_y\"]--;\n }else{\n $errorMessage+=\"Arena limits reach\\n\";\n }\n }else{\n $errorMessage+=\"Invalid direction\\n\";\n }\n if(!empty($errorMessage)){\n debug($errorMessage);\n }\n $this->save($myFighter);\n //debug($this->findById($fighterId));\n}",
"public static function isWalking() {\r\n return self::$state_walking;\r\n }",
"public function directionTo(Coordinates $coordinates): Direction;",
"public function getRecipeDirections() {\n\t\treturn $this->recipeDirections;\n\t}",
"function showDirections() {\n\t\t$smallConf = $this->conf['directions.'];\n\n\t\t$subpartArray = array();\n\t\t$markerArray = $this->helperGetLLMarkers(array(), $smallConf['LL'], 'directions');\n\n\t\t// query\n\t\t$table = $this->config['tables'];\n\t\t$field = '*';\n\t\t$where = $this->helperGetAvailableRecords($this->config['categories']);\n\t\t$orderBy = $smallConf['orderBy'];\n\t\t$limit = $smallConf['limit'];\n\t\t$res = $this->generic->exec_SELECTquery($field, $table, $where, '', $orderBy, $limit);\n\n\t\t// if just 1 result, render a different subpart\n\t\tif (count($res) == 1) {\n\t\t\t$suffix = '_SINGLE';\n\t\t\t$subpartArray['###HIDE_MULTISELECTION###'] = '';\n\t\t} else {\n\t\t\t$suffix = '';\n\t\t\t$subpartArray['###HIDE_SINGLESELECTION###'] = '';\n\t\t}\n\n\t\t$template['list'] = $this->cObj2->getSubpart($this->templateCode, '###TEMPLATE_DIRECTIONS###');\n\t\t$template['item'] = $this->cObj2->getSubpart($template['list'], '###SINGLE' . $suffix . '###');\n\n\t\t$content_item = '';\n\t\twhile ($row=array_shift($res)) {\n\t\t\t$markerArray = $this->getMarker($row, 'directions.');\n\t\t\t$content_item .= $this->cObj->substituteMarkerArrayCached($template['item'], $markerArray, array(), $wrappedSubpartArray);\n\t\t}\n\n\t\t$subpartArray['###CONTENT' . $suffix . '###'] = $content_item;\n\n\t\t$markerArray['###DEFAULT_COUNTRY###'] = $this->config['defaultCountry'];\n\n\t\t$content = $this->cObj2->substituteMarkerArrayCached($template['list'], $markerArray, $subpartArray);\n\t\treturn $content;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ / functions / Function that will create the json string using all the no2 files | function createJSONString($time, $date) {
#json creation
$rows = array();
$table = array();
$table["cols"] = array(
array("label" => "location", "type" => "string"),
array("label" => "NO2", "type" => "number")
);
foreach ($GLOBALS["no2Files"] as $file) {
$temp = createJSONStringSingleFile($file, $time, $date);
if ($temp != NULL) {
$rows = array_merge($rows, $temp);
// $rows[] = $temp;
}
}
$table["rows"] = $rows;
$tableJSON = json_encode($table);
return $tableJSON; //return the string
} | [
"public function generate_json();",
"public function generateJSON(){\n\t\theader('Content-Type: application/json');\n\t\theader('Content-Disposition: attachment; filename=\"'.$this->fullName().'.json\"');\n\n\t\t// If you wish to allow cross-domain AJAX requests, uncomment the following line:\n\t\t// header('Access-Control-Allow-Origin: *');\n\n\t\techo json_encode($this->info);\n\t}",
"private function create_json() {\n\t\t$packages = $this->list_directory( $this->packages_dir );\n\t\t$arr = [];\n\n\t\tforeach ( $packages as $package ) {\n\t\t\tforeach ( $this->translations as $translation ) {\n\t\t\t\tif ( false !== stripos( $package, $translation ) ) {\n\t\t\t\t\t$locale = ltrim( strrchr( $translation, '-' ), '-' );\n\t\t\t\t\t$arr[ $locale ]['slug'] = stristr( $translation, strrchr( $translation, '-' ), true );\n\t\t\t\t\t$arr[ $locale ]['language'] = $locale;\n\t\t\t\t\t$arr[ $locale ]['updated'] = $this->get_po_revision( \"$translation.po\" );\n\t\t\t\t\t$arr[ $locale ]['package'] = '/packages/' . $package;\n\t\t\t\t\t$arr[ $locale ]['autoupdate'] = '1';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfile_put_contents( $this->root_dir . '/language-pack.json', json_encode( $arr ) );\n\t\tprintf( \"\\n<br>\" . 'language-pack.json created.' . \"\\n\" );\n\t}",
"public function make_json_file()\n\t{\n\t\t$json_file = fopen('recipes.json', 'w');\n\t\tfwrite($json_file, $this->json_result);\n\t\tfclose($json_file);\t\n\t}",
"protected function generateJson(){\n\n $sourceMap = array();\n $mappings = $this->generateMappings();\n\n // File version (always the first entry in the object) and must be a positive integer.\n $sourceMap['version'] = self::VERSION;\n\n\n // An optional name of the generated code that this source map is associated with.\n $file = $this->getOption('sourceMapFilename');\n if( $file ){\n $sourceMap['file'] = $file;\n }\n\n\n // An optional source root, useful for relocating source files on a server or removing repeated values in the 'sources' entry.\tThis value is prepended to the individual entries in the 'source' field.\n $root = $this->getOption('sourceRoot');\n if( $root ){\n $sourceMap['sourceRoot'] = $root;\n }\n\n\n // A list of original sources used by the 'mappings' entry.\n $sourceMap['sources'] = array();\n foreach($this->sources as $source_uri => $source_filename){\n $sourceMap['sources'][] = $this->normalizeFilename($source_filename);\n }\n\n\n // A list of symbol names used by the 'mappings' entry.\n $sourceMap['names'] = array();\n\n // A string with the encoded mapping data.\n $sourceMap['mappings'] = $mappings;\n\n if( $this->getOption('outputSourceFiles') ){\n // An optional list of source content, useful when the 'source' can't be hosted.\n // The contents are listed in the same order as the sources above.\n // 'null' may be used if some original sources should be retrieved by name.\n $sourceMap['sourcesContent'] = $this->getSourcesContent();\n }\n\n // less.js compat fixes\n if( count($sourceMap['sources']) && empty($sourceMap['sourceRoot']) ){\n unset($sourceMap['sourceRoot']);\n }\n\n return json_encode($sourceMap);\n }",
"function createJSON($id,$data){\n\t\t\t$id=iconv(\"gb2312\",\"utf-8\",$id); \n\t\t\t$json_string = json_encode($data);\n\t\t\tfile_put_contents($id.\".json\",$json_string);\n\t\t\t\n\t\t}",
"function buildJSON() {\n $database = $this->climate->arguments->get('database');\n if (FALSE == in_array($database, $this->dbNames)) {\n if ($database == NULL) {\n echo \"Missing database name.\\nType 'mysql2json --help' for more options.\\n\";\n }else{\n echo \"Unknown database: $database\\n\";\n }\n exit();\n }\n\n // Define the creation for databases and tables\n $this->getTables();\n $this->connectToDB($database);\n $objDB = new stdClass();\n $objDB->name = $database;\n $r = $this->db->query(\"SHOW CREATE DATABASE $database;\");\n if ($r->num_rows > 0) {\n $row = $r->fetch_assoc();\n $objDB->create = $row[\"Create Database\"];\n }\n $objDB->tables = [];\n foreach($this->tables as $name) {\n $r = $this->db->query(\"SHOW CREATE TABLE $name;\");\n if ($r->num_rows > 0) {\n $row = $r->fetch_assoc();\n $table = new stdClass();\n $table->name = $name;\n\n // Strict mode compatibility \n $sql = $row[\"Create Table\"];\n $sql = str_replace(\"NOT NULL DEFAULT '0000-00-00 00:00:00'\",\"NOT NULL DEFAULT '1000-01-01 00:00:00'\", $sql);\n $table->create = $sql;\n $table->columns = [];\n $table->data = [];\n array_push($objDB->tables, $table);\n }\n }\n\n // Get column details for the given tables\n $mapString = [\"char\",\"varchar\",\"tinytext\",\"text\",\"mediumtext\",\"longtext\",\"binary\",\n \"varbinary\",\"date\",\"datetime\",\"timestamp\",\"time\",\"year\"];\n $mapNumber = [\"bit\",\"tinyint\",\"smallint\",\"mediumint\",\"int\",\"integer\",\"bigint\",\n \"decimal\",\"dec\",\"fixed\",\"float\",\"double\",\"real\"];\n $mapBoolean = [\"bool\", \"boolean\"];\n for ($i = 0; $i < count($objDB->tables); $i++) {\n $name = $objDB->tables[$i]->name;\n $r = $this->db->query(\"SHOW COLUMNS FROM $name;\");\n if ($r->num_rows > 0) {\n while($row = $r->fetch_assoc()) {\n $column = new stdClass();\n $column->name = $row[\"Field\"];\n $type = new steveorevo\\GString($row[\"Type\"]);\n $type = $type->getLeftMost(\"(\")->__toString();\n $column->mysql_type = $type;\n if (FALSE !== in_array($type, $mapString)) {\n $type = \"string\";\n }else{\n if (FALSE !== in_array($type, $mapNumber)) {\n $type = \"number\";\n }else{\n if (FALSE !== in_array($type, $mapBoolean)) {\n $type = \"boolean\";\n }else{\n $type = NULL;\n }\n }\n }\n $column->json_type = $type;\n array_push($objDB->tables[$i]->columns, $column);\n }\n }\n }\n\n // Dump data for the given tables\n for ($i = 0; $i < count($objDB->tables); $i++) {\n $name = $objDB->tables[$i]->name;\n $columns = &$objDB->tables[$i]->columns;\n $r = $this->db->query(\"SELECT * FROM $name;\");\n if ($r->num_rows > 0) {\n while($row = $r->fetch_assoc()) {\n \n // Check for exclude transients flag\n $skip = false;\n if ($this->climate->arguments->defined('exclude')) {\n if (array_key_exists('option_name', $row)) {\n if (false !== strpos($row['option_name'], '_transient_')) {\n $skip = true;\n }\n }\n }\n \n // Skip transients\n if (false == $skip) {\n\n // Check serialized data, update column data-type to object\n foreach($columns as &$col) {\n if ($this->is_serialized($row[$col->name])) {\n $col->json_type = 'object';\n $row[$col->name] = (object) unserialize($this->fix_serialized($row[$col->name]));\n }\n }\n array_push($objDB->tables[$i]->data, $row);\n }\n }\n }\n $r->free_result();\n if (! $this->climate->arguments->defined('quiet')) {\n echo \"Exported table: \" . $name . \"\\n\";\n }\n }\n $this->db->close();\n $output = $this->climate->arguments->get('output');\n if ('' == $output) {\n $output = getcwd() . \"/\" . $database . \".json\";\n }\n file_put_contents($output, json_encode($objDB, JSON_PRETTY_PRINT));\n if (! $this->climate->arguments->defined('quiet')) {\n echo \"File export complete: $output\\n\";\n }\n exit();\n }",
"function generate_json()\n\t{\n $network_count = get_network_count();\n $networks = get_networks();\n\n $json_obj[\"counter\"] = $network_count;\n $json_obj[\"networks\"] = $networks;\n echo \"var data = \".json_encode($json_obj);\n }",
"public function genreateJSON(){\n\n\t//get those time-ponits.\n\t$dataset = $this->Timepoints();\n\n\t$date_array = $this->getTimePointsArray($dataset);\n\n\t$timeline_json_array=array(\n\n\t\t'timeline'=>array(\n\t\t\t'headline'=>$this->Headline,\n\t\t\t \"type\"=>\"default\",\n\t\t\t \"text\"=>$this->Tagline,\n\t\t\t 'date'=>$date_array \n\t\t\t)\n\n\t\t);\n\t\n\treturn json_encode($timeline_json_array);\n\t}",
"public function create_json_per_kecamatan() {\n foreach( $this->list_kecamatan as $kecamatan => $kecamatan_id ) {\n $data_kecamatan = $this->process_per_kecamatan($kecamatan_id);\n $file_create = fopen('json/'. $kecamatan .'.json', 'w');\n fwrite($file_create, json_encode( $data_kecamatan ) ); \n fclose($file_create);\n }\n }",
"protected function createJSONFile()\n {\n $fp = fopen($this->getFontFileLocation().'/fonts.json', 'w');\n fwrite($fp, json_encode($this->orderedList));\n return fclose($fp);\n }",
"protected function buildProfileJSON()\n {\n return file_get_contents(__DIR__.'/demoprofile.json');\n }",
"public function toSimpleJSON();",
"private function writeJson(): void\n {\n $str = '<?php\n\nreturn ' . var_export($this->modulesStatuses, true) .';\n\n';\n $this->files->put($this->statusesFile, $str);\n }",
"function getListJsonString() {\n $arr=array();\n foreach ($this->list as $object)\n {\n $vars = $object->getObjectVars();\n $objEditorial=$object->getObjectEditorial()->getObjectVars();\n \n $vars['objectEditorial']=$objEditorial; \n array_push($arr, $vars);\n }\n return json_encode($arr);\n }",
"function crearArchivoJson($code){\n // $arr_materias = array('nombre'=> 'Jose', 'edad'=> '20', 'genero'=> 'masculino',\n //'email'=> 'correodejose@dominio.com', 'localidad'=> 'Madrid', 'telefono'=> '91000000');\n $arr_materias=crearMateriaDefecto();\n //Creamos el JSON\n $ruta =\"archivosJson/\";\n $json_string = json_encode($arr_materias);\n $file =$ruta.$code.\".json\";\n file_put_contents($file, $json_string);\n }",
"public function createJSON( ){\n \n /* create the file that will hold the game states */\n $file_location = $this->gameFile( );\n \n /* array of vals for the tiles */\n $tile_values = Game::$tile_values;\n \n /* initialize the tiles array */\n $tiles = array( );\n for( $i = 0; $i < 37; $i++ ){\n if( $i == 18 ) { continue; }\n $value = ( $i > 18 ) ? $i : $i + 1;\n $tiles[ $i ] = array( \"id\" => $i, \"state\" => 0, \"value\" => $tile_values[$value] );\n }\n \n $file_contents = array( \n \"state\" => 0,\n \"flag\" => rand( 0, 100000 ),\n \"tiles\" => $tiles, \n \"turn\" => 1,\n \"challenger\" => $this->challenger_id \n );\n \n File::put( $file_location, json_encode( $file_contents ) );\n }",
"function i18n_update_json() {\n global $PATH_PRIVATE, $languages, $datadir;\n\n // get template from source code\n $files = glob('*.php');\n $tlc = Translations::fromPhpCodeFile($files);\n $tlc->toPoFile(\"$datadir/source.po\");\n\n // export to csv for automatic translation via Bing/Google\n $tlc->toCsvFile(\"$datadir/source.csv\");\n\n // write json for each defined language\n foreach($languages as $lang) {\n $sfile = \"$datadir/source.po\";\n $tlc = Translations::fromPoFile($sfile);\n\n $file = \"$datadir/\" . $lang->id . '.po';\n if (is_file($file)) {\n $tlx = Translations::fromPoFile($file);\n $tlc->mergeWith($tlx, Merge::REFERENCES_THEIRS);\n unlink($file);\n }\n\n $file = \"$datadir/i18n/\" . $lang->id . '.json';\n if (is_file($file)) {\n $tlx = Translations::fromJsonFile($file);\n $tlc->mergeWith($tlx, Merge::REFERENCES_OURS);\n }\n $tlc->toJsonFile($file);\n // generate po files for re-viewing\n $file2 = \"$datadir/i18n/\" . $lang->id . '.po';\n $tlc->toPoFile($file2);\n }\n}",
"function get_json() {\n $init = 0;\n $json = \"[\";\n foreach ($this->table->data as $row) {\n $i = 0;\n if ($init++) {\n $json .= \",\\n\";\n }\n $json .= '{';\n foreach (array_keys($this->columns) as $key) {\n if ($i) {\n $json .= ', ';\n }\n $json .= \"{$key}: \";\n $val = $row[$i];\n if (is_array($val)) {\n $json .= json_encode($val);\n } else if (strpos($key, 'date') !== false) {\n $json .= '\"'.($val ? '<!-- '.$val.' -->'.userdate($val, get_string('pm_date_format', 'local_elisprogram')) : '<!-- 0 -->-').'\"';\n } else {\n $str = str_replace(\"\\n\", '', $val);\n $json .= '\"'.addslashes($str).'\"';\n }\n $i++;\n }\n $json .= \"}\";\n }\n $json .= \"\\n]\";\n return $json; // OLD: return json_encode($this->table->data);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set the value of apellido1_empleado | public function setApellido1_empleado($apellido1_empleado)
{
$this->apellido1_empleado = $apellido1_empleado;
return $this;
} | [
"public function setEmpleado_idempleado($empleado_idempleado){\n $this->empleado_idempleado = $empleado_idempleado;\n }",
"public function setApellido($apellido){ $this->apellido = $apellido;}",
"function setEmpleado_id($empleado_id) {\r\n\t\t$this->empleado_id = $empleado_id;\r\n }",
"public function setEmpleado_idemp($empleado_idemp){\n $this->empleado_idemp = $empleado_idemp;\n }",
"public function setApellido($apellido){\n\t\t$this->apellido = $apellido;\n\t}",
"public function setApellidos($apellidos){\n $this->apellidos = $apellidos;\n }",
"function setApellidoP($ApellidoP) {\r\n $this->ApellidoP = $ApellidoP;\r\n }",
"public function setApellido($apellido)\r\n\t{\r\n\t\t$this->apellido = $apellido;\r\n\t}",
"public function SetData_alberturaConta($valor){\n\t\t $this->data_emissao= $valor;\n\t }",
"public function setEmpresa( Empresa $oEmpresa) {\n $this->oEmpresa = $oEmpresa;\n }",
"public function setEmp_correo($emp_correo){\n $this->emp_correo = $emp_correo;\n }",
"function asignar_mesa($objeto) {\n\t\t$sql = \"UPDATE \n\t\t\t\t\tcom_mesas\n\t\t\t\tSET \n\t\t\t\t\tidempleado = \" . $objeto['empleado'] . \"\n\t\t\t\tWHERE \n\t\t\t\t\tid_mesa=\" . $objeto['mesa'];\n\t\t// return $sql;\n\t\t$result = $this -> query($sql);\n\n\t\treturn $result;\n\t}",
"public function getempleado()\r\n {\r\n return $this->empleado;\r\n }",
"public function setEmployee($value)\n {\n $this->employee = $value;\n }",
"public function setAreaEmpleado($areaEmpleado){\n $this->areaEmpleado = $areaEmpleado;\n }",
"public function setEmpresa(string $empresa)\n {\n $this->empresa = $empresa;\n\n return $this;\n }",
"public function setNom_empleado($nom_empleado)\n {\n $this->nom_empleado = $nom_empleado;\n\n return $this;\n }",
"public function setIdEmpresa_p($idEmpresa_p){\n $this->idEmpresa_p = $idEmpresa_p;\n }",
"public function alteraContatoempresa()\n {\n // recebe dados do formulario\n $post = DadosFormulario::formularioCadastroContatoempresa(NULL, 2);\n // valida dados do formulario\n $oValidador = new ValidadorFormulario();\n if (!$oValidador->validaFormularioCadastroContatoempresa($post, 2)) {\n $this->msg = $oValidador->msg;\n return false;\n }\n // cria variaveis para validacao com as chaves do array\n foreach ($post as $i => $v) $$i = $v;\n // cria objeto para grava-lo no BD\n $oEmpresa = new Empresa($idEmpresa);\n $oContatoempresa = new Contatoempresa($idContatoEmpresa, $oEmpresa, $contato, $funcao, $email, $telefone, $dataHoraAlteracao, $usuarioAlteracao);\n $oContatoempresaBD = new ContatoempresaBD();\n if (!$oContatoempresaBD->alterar($oContatoempresa)) {\n $this->msg = $oContatoempresaBD->msg;\n return false;\n }\n return $idContatoEmpresa;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
findProspectOrCreateByProspectAndDomain : retrieve prospect with prospect and domain of create if not exits | public function findProspectOrCreateByProspectAndDomain($prospect, $domain)
{
$prospects = $this->getProspectMapper()->findBy(array('prospect' => $prospect, 'domain' => $domain));
if (!empty($prospects)) {
$prospectEntity = $prospects[0];
} else {
// Pas de prospect : alors on en crée un
$prospectEntity = new ProspectEntity();
$prospectEntity->setDomain($domain)
->setProspect($prospect);
$prospectEntity = $this->getProspectMapper()->insert($prospectEntity);
}
return $prospectEntity;
} | [
"function createProspect($email_address, $values) {\r\n $url = '/do/create/email/' . $email_address;\r\n $result = $this->_pardot_request($url,'prospect',$values);\r\n $root_attributes = $result->attributes();\r\n if($root_attributes['stat'] == 'fail') {\r\n $this->_log('could not create account with email '. $email_address);\n return null;\n }\r\n return $result->prospect;\r\n }",
"private function createProspect(Request $request) {\n \n $prospect = Prospect::where('email', $request->email)->first();\n if(empty($prospect)) {\n $prospect = new Prospect();\n }\n \n $prospect->name = $request->name;\n $prospect->email = $request->email;\n $prospect->phone = $request->phone;\n $prospect->birthday = Carbon::createFromFormat('d/m/Y', $request->birthday);\n $prospect->calculateTotalScore();\n \n return $prospect;\n \n }",
"public static function create_new($prospect_info) {\n\t\t$new_id = db::insert(\"contracts.prospects\", array(\n\t\t\t'name' => $prospect_info['prospect_name'],\n\t\t\t'company' => $prospect_info['prospect_company'],\n\t\t\t'email' => $prospect_info['prospect_email'],\n\t\t\t'url' => $prospect_info['prospect_url']\n\t\t));\n\t\treturn $new_id;\n\t}",
"public static function findOrCreate($data)\n{\n //Check if the existing \n $model = (bool) static::findOrFail($data['student_id']);\n\n $data['user_id'] = \\Sentry::getUser()->id;\n\n return $model ? : static::create($data);\n}",
"public function createPartidaPresupuesto(){\n $ejercicio= SigiFacturacion::find()->select(['max(ejercicio)'])->scalar();\n if($ejercicio){\n \n }else{\n $ejercicio=date('Y');\n }\n $atributes=[\n 'edificio_id'=>$this->edificio_id,\n 'cargosedificio_id'=>$this->id,\n 'codigo'=>'', \n 'descripcion'=>$this->cargo->descargo,\n 'activo'=>'1',\n 'ejercicio'=>$ejercicio, \n 'mensual'=>$this->monto\n ];\n \n $d=SigiBasePresupuesto::firstOrCreateStatic($atributes,\n SigiBasePresupuesto::SCENARIO_REGULAR,\n ['edificio_id'=>$this->edificio_id, 'ejercicio'=>$ejercicio, \n 'cargosedificio_id'=>$this->id,]);\n yii::error($d);\n }",
"function first_or_create_profesor($row)\n {\n try {\n $profesor = Profesor::create([\n 'codigo' => $row->codigo,\n 'nombre' => $row->nombre,\n 'departamento' => $row->departamento,\n 'cargo' => $row->cargo,\n 'especialidad' => $row->especialidad\n ]);\n return $profesor;\n } catch (Illuminate\\Database\\QueryException $e) {\n return Profesor::where([\n ['codigo', '=', $row->codigo]\n ]);\n }\n }",
"public function save_prospect(Request $req)\n {\n $user = User::find($req->user_id);\n $office = Office::where('id', $req->office_id)->where('status', 1)->first();//Office available\n $state = State::find($req->state_id);\n\n if (! $office ) { return response(['msg' => 'Esta oficina no se encuentra disponible, seleccione otra', 'status' => 'error', 'refresh' => 'none'], 400); }\n if (! $state ) { return response(['msg' => 'ID de estado inválido, trate nuevamente', 'status' => 'error', 'refresh' => 'none'], 404); }\n\n $prospect = New Application;\n\n if ( $user ) {//Comes from a registered user\n $prospect->user_id = $user->id;\n } else {\n $prospect->fullname = $req->fullname;\n $prospect->email = $req->email;\n $prospect->phone = $req->phone;\n $prospect->rfc = strtoupper($req->rfc);\n $prospect->address = $req->address;\n $prospect->business_activity = $req->business_activity;\n $prospect->identification_type = $req->identification_type;\n $prospect->identification_num = $req->identification_num;\n }\n\n $prospect->office_id = $office->id;\n\n $prospect->taken_by = auth()->check() ? auth()->user()->id : null;\n\n $prospect->save();\n $prospect->sendHistoryTemplate()->save(new SendHistoryTemplate);\n\n #Details\n $detail = New ApplicationDetail;\n\n $detail->application_id = $prospect->id;\n $detail->state_id = $state->id;\n $detail->badget = $req->badget;\n $detail->num_people = $req->num_people;\n $detail->office_type_id = $office->type->id;\n\n $detail->save();\n\n $params = array();\n $params['subject'] = \"¡Nuevo prospecto registrado!\";\n $params['title'] = \"Nuevo prospecto\";\n $params['content'] = $req->fullname.\" ha enviado sus datos de contacto para contratar una oficina, por favor, ingrese al módulo de prospectos para más información.\";\n $params['email'] = \"info@fastoffice.mx\";\n $params['cc'] = \"ventas@fastoffice.mx\";\n $params['view'] = 'mails.general';\n\n $this->mail($params);\n\n return response(['msg' => 'Prospecto registrado correctamente', 'status' => 'success', 'code' => 1, 'url' => url('crm/prospectos')], 200);\n }",
"public function firstOrCreate(array $data)\n {\n $record = $this->firstOrNew($data);\n\n if ( ! $record->id):\n $record->save();\n endif;\n\n return $record;\n }",
"function createRecord(){\r\n\r\n $query_fqdn = \"\r\n SELECT\r\n d.id AS id,\r\n d.fqdn AS fqdn\r\n FROM\r\n \" . $this->referencing_table_name . \" AS d\r\n WHERE\r\n d.fqdn = '\" . $this->fqdn . \"'\r\n ORDER BY\r\n d.id DESC\r\n \";\r\n \r\n $stmt_domain = $this->conn->prepare($query_fqdn);\r\n $stmt_domain->execute();\r\n\r\n // If there isn't already in domain table given FDQN then insert it, otherwise get ID for DNS record insert\r\n if ($stmt_domain->rowCount() == 0){\r\n // query to insert record\r\n $query_insert = \"INSERT INTO \" . $this->referencing_table_name . \" SET fqdn=:fqdn\";\r\n \r\n // prepare query\r\n $stmt_insert = $this->conn->prepare($query_insert);\r\n \r\n // sanitize\r\n $this->fqdn=htmlspecialchars(strip_tags($this->fqdn));\r\n \r\n // bind values\r\n $stmt_insert->bindParam(\":fqdn\", $this->fqdn);\r\n \r\n // execute query\r\n $stmt_insert->execute();\r\n\r\n // set last inserted ID into domain for DNS record\r\n $this->domain = $this->conn->lastInsertId();\r\n }\r\n // I ALSO NEED TO IMPLEMENRT CASE WHERE FQDN ALREADY EXIST IN domain TABLE (id from SELECT previous SELECT ), BC 25.10.2021.\r\n\r\n\r\n /* DNS record */\r\n // query to insert DNS record\r\n $query = \"\r\n INSERT INTO \" . $this->table_name . \"\r\n SET type=:type, domain=:domain, name=:name, val=:val, ttl=:ttl\r\n \";\r\n \r\n // prepare query\r\n $stmt = $this->conn->prepare($query);\r\n \r\n // sanitize\r\n $this->type=htmlspecialchars(strip_tags($this->type));\r\n $this->name=htmlspecialchars(strip_tags($this->name));\r\n $this->val=htmlspecialchars(strip_tags($this->val));\r\n $this->ttl=htmlspecialchars(strip_tags($this->ttl));\r\n \r\n // bind values\r\n $stmt->bindParam(\":type\", $this->type);\r\n $stmt->bindParam(\":domain\", $this->domain); // domain doesnt come from GET directly, but ID from domain table\r\n $stmt->bindParam(\":name\", $this->name);\r\n $stmt->bindParam(\":val\", $this->val);\r\n $stmt->bindParam(\":ttl\", $this->ttl);\r\n \r\n // execute query\r\n if($stmt->execute()){\r\n return true;\r\n }\r\n \r\n return false;\r\n }",
"public function buscarProspect($email=null){\n try{\n $conexaoDB = $this->conectarBanco(); // recebe um objeto de conexão.\n }catch(\\Exception $e){\n die($e->getMessage());\n }\n $prospects = array();\n\n if($email === null){\n $sqlBusca = $conexaoDB->prepare(\"select id, nome, cpf, email, telefone, whatsapp, rua, numero, facebook, bairro, cidade, estado, cep \n from prospect\");// proteje contra sql injection.\n $sqlBusca->execute();// executa o banco.\n }else{\n $sqlBusca = $conexaoDB->prepare(\"select id, nome, cpf, email, telefone, whatsapp, rua, numero, facebook, bairro, cidade, estado, cep \n from prospect \n where\n email = ?\");// proteje contra sql injection.\n $sqlBusca->bind_param(\"s\", $email);\n $sqlBusca->execute();// executa o banco.\n }\n \n $resultado = $sqlBusca->get_result(); // recebe o resultado do banco de dados.\n\n if($resultado->num_rows !== 0){ // se o resultado for diferente de 0 os atributos não serão null.\n while($linha = $resultado->fetch_assoc()){ // as variáveis receberão um array com as informações.\n $prospect = new Prospect();\n $prospect->addProspecto($linha['id'], $linha['nome'], $linha['cpf'], $linha['email'],\n $linha['telefone'], $linha['whatsapp'], $linha['rua'], $linha['numero'], \n $linha['facebook'],$linha['bairro'], $linha['cidade'], $linha['estado'],$linha['cep']);\n $prospects[] = $prospect;\n }\n }\n \n $sqlBusca->close(); // fecha o sql.\n $conexaoDB->close(); // fecha a conexão.\n return $prospects; \n }",
"protected function createDomain() {\n\t\t\t$data = $this->getContextKey('data');\n\t\t\tif (!isset($data['data']) || !is_array($data['data'])) {\n\t\t\t\t$this->getContextKey('response')->sendError('No data provided for create.');\n\t\t\t}\n\n\t\t\tif ($this->checkUserHasRecordRegex()) {\n\t\t\t\t$this->getContextKey('response')->sendError('This session is not permitted to create domains.');\n\t\t\t}\n\n\t\t\t$domain = new Domain($this->getContextKey('user')->getDB());\n\t\t\tif (isset($data['data']['owner']) && $this->canSetOwner()) {\n\t\t\t\tif (!empty($data['data']['owner'])) {\n\t\t\t\t\t$newOwner = User::loadFromEmail($this->getContextKey('db'), $data['data']['owner']);\n\n\t\t\t\t\tif ($newOwner === FALSE) {\n\t\t\t\t\t\t$this->getContextKey('response')->sendError('Invalid owner specified: ' . $data['data']['owner']);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$domain->setAccess($newOwner->getID(), 'Owner');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$domain->setAccess($this->getContextKey('user')->getID(), 'Owner');\n\t\t\t}\n\n\t\t\tif (isset($data['data']['domain'])) {\n\t\t\t\tif (!Domain::validDomainName($data['data']['domain']) || isPublicSuffix($data['data']['domain']) || !hasValidPublicSuffix($data['data']['domain'])) {\n\t\t\t\t\t$this->getContextKey('response')->sendError('Invalid domain: ' . $data['data']['domain']);\n\t\t\t\t}\n\n\t\t\t\tif (!$this->isAdminMethod()) {\n\t\t\t\t\tforeach (BlockRegex::find($this->getContextKey('db'), ['domain_name' => 'true']) as $br) {\n\t\t\t\t\t\tif ($br->matches($data['data']['domain'])) {\n\t\t\t\t\t\t\t$this->getContextKey('response')->sendError('This domain name has been blocked from being added.');\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$domain->setDomain($data['data']['domain']);\n\t\t\t} else {\n\t\t\t\t$this->getContextKey('response')->sendError('No domain name provided for create.');\n\t\t\t}\n\n\t\t\t$parent = $domain->findParent();\n\t\t\tif ($parent !== FALSE) {\n\t\t\t\t$this->checkAccess($parent, ['owner']);\n\t\t\t}\n\n\t\t\treturn $this->updateDomain($domain, true);\n\t\t}",
"public function save_new_prospect() {\n\n\t\t$prospect = $this->loadModel('Client');\n\t\t$schedule = $this->loadModel('Schedule');\n\t\t$location = $this->getLocation();\n\n\t\tif (input()->first_name != null) {\n\t\t\t$prospect->first_name = input()->first_name;\n\t\t}\n\n\t\tif (input()->last_name != null) {\n\t\t\t$prospect->last_name = input()->last_name;\n\t\t}\n\t\n\t\tif (input()->email != null) {\n\t\t\t$prospect->email = input()->email;\n\t\t}\n\n\t\tif (input()->phone != null) {\n\t\t\t$prospect->phone = input()->phone;\n\t\t}\n\n\t\tif (input()->timeframe != null) {\n\t\t\t$schedule->timeframe = input()->timeframe;\n\t\t}\n\n\t\tif (input()->referral_source != null) {\n\t\t\t$prospect->referral_source = input()->referral_source;\n\t\t}\n\t\t\n\t\t$feedback = array();\n\n\t\t// save contact and prospect\n\t\tif ($prospect->save()) {\n\t\t\tforeach(input()->contact as $c) {\n\t\t\t\t$contact_link = $this->loadModel('ContactLink');\n\t\t\t\t$contact_link->contact = $c['id'];\n\t\t\t\t$contact_link->client = $prospect->id;\n\t\t\t\t$contact_link->contact_type = $c['contact_type'];\n\n\t\t\t\tif (isset ($c['poa'])) {\n\t\t\t\t\t$contact_link->poa = 1;\n\t\t\t\t}\n\n\t\t\t\tif (isset ($c['primary_contact'])) {\n\t\t\t\t\t$contact_link->primary_contact = 1;\n\t\t\t\t}\n\n\t\t\t\t$contact_link->save();\n\t\t\t}\t\n\n\t\t\t$schedule->client = $prospect->id;\n\t\t\t// set location\n\t\t\t$schedule->location = $location->id;\n\t\t\t// set first contact date\n\t\t\t$schedule->datetime_first_contact = mysql_date();\n\t\t\t$schedule->timeframe = input()->timeframe;\t\n\t\t\t// set the status as a new lead\n\t\t\t$schedule->status = 1;\t\n\n\t\t\tif ($schedule->save()) {\n\t\t\t\tsession()->setFlash(\"{$prospect->first_name} {$prospect->last_name} was added as a new prospect.\", 'success');\n\t\t\t\t$this->redirect(SITE_URL . '/?module=Admissions&page=admissions');\n\t\t\t} else {\n\t\t\t\t$feedback[] = \"We were not able to save the new prospect. Please try again.\";\n\t\t\t}\n\t\t} else {\n\t\t\t$feedback[] = \"We were not able to save the new prospect. Please try again.\";\n\t\t}\n\t\t\n\t\tsession()->setFlash($feedback, 'danger');\n\t\t$this->redirect(SITE_URL . '/?module=Admissions&page=admissions');\n\n\t}",
"public function testFindOrCreate()\n\t{\n\t\tR::nuke();\n\t\t$book = R::findOrCreate( 'book', array( 'title' => 'my book', 'price' => 50 ) );\n\t\tasrt( ( $book instanceof OODBBean ), TRUE );\n\t\t$id = $book->id;\n\t\t$book = R::findOrCreate( 'book', array( 'title' => 'my book', 'price' => 50 ) );\n\t\tasrt( $book->id, $id );\n\t\tasrt( $book->title, 'my book' );\n\t\tasrt( (int) $book->price, 50 );\n\t}",
"public function first_or_create() {\n\t\t$args = func_get_args();\n\t\t$data = (object) $this->_query_builder($args ? array('where' => $args) : null)->get();\n\t\tif (empty($data)) {\n\t\t\t$insert_ok = $this->_query_builder($args ? array('where' => $args) : null)->insert();\n\t\t\t$insert_id = $insert_ok ? $this->_db->insert_id() : 0;\n\t\t\tif ($insert_id) {\n\t\t\t\t$data = $this->find($insert_id);\n\t\t\t}\n\t\t}\n\t\treturn $data;\n\t}",
"public function testDomainCreateDuplicateValues()\n {\n $mg = $this->getMailgunClient();\n\n $mg->domains()->create(\n self::$domainName, // domain name\n 'exampleOrgSmtpPassword12', // smtp password\n 'tag', // default spam action\n false // wildcard domain?\n );\n }",
"public function findAllAsSalespersons() {\r\r\n\r\r\n $result = array();\r\r\n $query = '\r\r\n SELECT DISTINCT(p.id_participant), p.civility_participant, p.surname_participant, p.name_participant, p.email_participant, p.date_deletion_participant\r\r\n FROM participant p \r\r\n INNER JOIN assignment_participant_enterprise ape ON ape.PARTICIPANT_id_participant = p.id_participant \r\r\n INNER JOIN enterprise e ON e.id_enterprise = ape.ENTERPRISE_id_enterprise \r\r\n INNER JOIN profile pr ON pr.id_profile = e.PROFILE_id_profile \r\r\n WHERE pr.id_profile = 1 AND p.date_deletion_participant IS NULL';\r\r\n\r\r\n try {\r\r\n $this->pdo->beginTransaction(); // Start transaction\r\r\n $qresult = $this->pdo->prepare($query); \r\r\n $qresult->execute();\r\r\n $this->pdo->commit(); // If all goes well the transaction is validated\r\r\n\r\r\n while( $row = $qresult->fetch() ) {\r\r\n list ( $idParticipant, $civility, $surname, $name, $email, $dateDeletion ) = $row; // Like that $idParticipant = $row['id_participant'] etc.\r\r\n $newParticipant = new Participant($civility, $surname, $name, $email, $dateDeletion, $idParticipant);\r\r\n $result[] = $newParticipant; // Adds new Participant to array\r\r\n }\r\r\n\r\r\n // $this->pdo = NULL;\r\r\n return $result;\r\r\n }\r\r\n catch(Exception $e) // In case of error\r\r\n {\r\r\n // The transaction is cancelled\r\r\n $this->pdo->rollback();\r\r\n\r\r\n // An error message is displayed\r\r\n print 'Tout ne s\\'est pas bien passé, voir les erreurs ci-dessous<br />';\r\r\n print 'Erreur : '.$e->getMessage().'<br />';\r\r\n print 'N° : '.$e->getCode();\r\r\n\r\r\n // Execution of the code is stopped\r\r\n die();\r\r\n }\r\r\n }",
"private function recordExistCreate($field, $value) {\n //Hent udvalgt i db\n $account = $this->getAccountmapper()->findOneBy(array($field => $value));\n $exists = true;\n if ($account === NULL) {\n $exists = false;\n } \n return $exists;\n }",
"public function testCrearProspecto()\n {\n // Parameters for the API call\n $body = TestHelper::getJsonMapper()->mapClass(json_decode(\n \"{\\r\\n \\\"token\\\": \\\"6be7212a-a769-40e4-9c6b-283aa06a3127\\\",\\r\\n \\\"idIntegracion\\\": 21,\\r\\n \\\"idOri\" .\n \"gen\\\": 83,\\r\\n \\\"idMarca\\\": 6,\\r\\n \\\"idModelo\\\": 133,\\r\\n \\\"idSucursal\\\": 24,\\r\\n \\\"idDivision\\\"\" .\n \": 3,\\r\\n \\\"nombre\\\": \\\"David Martinez\\\",\\r\\n \\\"email\\\": \\\"david.martinez@amotorchile.cl\\\",\\r\\n \\\"\" .\n \"fono\\\": \\\"951253162\\\",\\r\\n \\\"comentario\\\": \\\"test de integracion desde Avender\\\"\\r\\n}\"),\n 'SGIAvenderLib\\\\Models\\\\CrearProspectoRequest'\n );\n\n // Set callback and perform API call\n self::$controller->setHttpCallBack($this->httpResponse);\n try {\n self::$controller->crearProspecto($body);\n } catch (APIException $e) {\n }\n\n // Test response code\n $this->assertEquals(\n 200,\n $this->httpResponse->getResponse()->getStatusCode(),\n \"Status is not 200\"\n );\n }",
"public function createOrUpdateShipperConsignee($data)\n {\n $dataShip = array();\n $dataCons = array();\n /*ids de shipper y consignee*/\n $shipper_id = $data['shipper_id'];\n $consig_id = $data['consignee_id'];\n\n if ($data['shipper_id'] == '') {\n //DATOS SHIPPER\n try {\n $firstNamesFull = '';\n $lastNamesFull = '';\n $arrayNamesFull = $this->getNamesAndFullNames($data['nombreR']);\n $firstNames = $arrayNamesFull[0];\n $lastName = $arrayNamesFull[1];\n $dataShip = array(\n 'agencia_id' => $data['agencia_id'],\n 'localizacion_id' => $data['localizacion_id'],\n 'direccion' => $data['direccionR'],\n 'telefono' => $data['telR'],\n 'correo' => $data['emailR'],\n 'zip' => $data['zipR'],\n );\n /*verifico si existen dos nombres o solo uno para registrar*/\n if (count($firstNames) != 0) {\n if (count($firstNames) != 1) {\n if ($firstNames[1] != '') {\n $dataShip['primer_nombre'] = strtoupper($firstNames[0]);\n $dataShip['segundo_nombre'] = strtoupper($firstNames[1]);\n $firstNamesFull .= $firstNames[0] . ' ' . $firstNames[1];\n } else {\n $dataShip['primer_nombre'] = strtoupper($firstNames[0]);\n $dataShip['segundo_nombre'] = '';\n $firstNamesFull .= $firstNames[0];\n }\n } else {\n $dataShip['primer_nombre'] = $firstNames[0];\n $dataShip['segundo_nombre'] = '';\n $firstNamesFull .= $firstNames[0];\n }\n }\n /*verifico si existen dos apellidos o solo uno para registrar*/\n if (count($lastName) != 0) {\n if (count($lastName) != 1) {\n if ($lastName[0] != '') {\n $dataShip['primer_apellido'] = strtoupper($lastName[0]);\n $dataShip['segundo_apellido'] = strtoupper($lastName[1]);\n $lastNamesFull .= $lastName[0] . ' ' . $lastName[1];\n } else {\n $dataShip['primer_apellido'] = strtoupper($lastName[1]);\n $dataShip['segundo_apellido'] = '';\n $lastNamesFull .= $lastName[0];\n }\n } else {\n $dataShip['primer_apellido'] = strtoupper($lastName[0]);\n $dataShip['segundo_apellido'] = '';\n $lastNamesFull .= $lastName[0];\n }\n }\n\n $dataShip['nombre_full'] = strtoupper($firstNamesFull . ' ' . $lastNamesFull);\n $dataShip['nombre_old'] = strtoupper($firstNamesFull . ' ' . $lastNamesFull);\n\n $dataS = (new Shipper)->fill($dataShip);\n $dataS->created_at = date('Y-m-d H:i:s');\n $dataS->save();\n $shipper_id = $dataS->id;\n } catch (Exception $e) {\n echo 'Error: <pre>';\n print_r($e);\n echo '</pre>';\n }\n } else {\n\n if ($shipper_id != '' and isset($data['opEditarShip'])) {\n $dataU = Shipper::findOrFail($shipper_id);\n $dataU->agencia_id = $data['agencia_id'];\n $dataU->localizacion_id = $data['localizacion_id'];\n $dataU->direccion = $data['direccionR'];\n $dataU->telefono = $data['telR'];\n $dataU->correo = $data['emailR'];\n $dataU->zip = $data['zipR'];\n\n $firstNamesFull = '';\n $lastNamesFull = '';\n $arrayNamesFull = $this->getNamesAndFullNames($data['nombreR']);\n $firstNames = $arrayNamesFull[0];\n $lastName = $arrayNamesFull[1];\n\n /*verifico si existen dos nombres o solo uno para registrar*/\n if (count($firstNames) != 0) {\n if (count($firstNames) != 1) {\n if ($firstNames[1] != '') {\n $dataU->primer_nombre = strtoupper($firstNames[0]);\n $dataU->segundo_nombre = strtoupper($firstNames[1]);\n $firstNamesFull .= $firstNames[0] . ' ' . $firstNames[1];\n } else {\n $dataU->primer_nombre = strtoupper($firstNames[0]);\n $dataU->segundo_nombre = '';\n $firstNamesFull .= $firstNames[0];\n }\n } else {\n $dataU->primer_nombre = strtoupper($firstNames[0]);\n $dataU->segundo_nombre = '';\n $firstNamesFull .= $firstNames[0];\n }\n }\n /*verifico si existen dos apellidos o solo uno para registrar*/\n if (count($lastName) != 0) {\n if (count($lastName) != 1) {\n if ($lastName[0] != '') {\n $dataU->primer_apellido = strtoupper($lastName[0]);\n $dataU->segundo_apellido = strtoupper($lastName[1]);\n $lastNamesFull .= $lastName[0] . ' ' . $lastName[1];\n } else {\n $dataU->primer_apellido = strtoupper($lastName[1]);\n $dataU->segundo_apellido = '';\n $lastNamesFull .= $lastName[0];\n }\n } else {\n $dataU->primer_apellido = strtoupper($lastName[0]);\n $dataU->segundo_apellido = '';\n $lastNamesFull .= $lastName[0];\n }\n }\n\n $dataU->nombre_full = strtoupper($firstNamesFull . ' ' . $lastNamesFull);\n $dataU->nombre_old = strtoupper($firstNamesFull . ' ' . $lastNamesFull);\n\n $dataU->save();\n }\n }\n\n if ($data['consignee_id'] == '') {\n //DATOS CONSIGNEE\n try {\n $firstNamesFull = '';\n $lastNamesFull = '';\n $arrayNamesFull = $this->getNamesAndFullNames($data['nombreD']);\n $firstNames = $arrayNamesFull[0];\n $lastName = $arrayNamesFull[1];\n $dataCons = array(\n 'agencia_id' => $data['agencia_id'],\n 'localizacion_id' => $data['localizacion_id_c'],\n 'direccion' => $data['direccionD'],\n 'telefono' => $data['telD'],\n 'correo' => $data['emailD'],\n 'zip' => $data['zipD'],\n 'po_box' => $data['poBoxD'],\n );\n /*verifico si existen dos nombres o solo uno para registrar*/\n if (count($firstNames) != 0) {\n if (count($firstNames) != 1) {\n if ($firstNames[1] != '') {\n $dataCons['primer_nombre'] = strtoupper($firstNames[0]);\n $dataCons['segundo_nombre'] = strtoupper($firstNames[1]);\n $firstNamesFull .= $firstNames[0] . ' ' . $firstNames[1];\n } else {\n $dataCons['primer_nombre'] = strtoupper($firstNames[0]);\n $dataCons['segundo_nombre'] = '';\n $firstNamesFull .= $firstNames[0];\n }\n } else {\n $dataCons['primer_nombre'] = strtoupper($firstNames[0]);\n $dataCons['segundo_nombre'] = '';\n $firstNamesFull .= $firstNames[0];\n }\n }\n /*verifico si existen dos apellidos o solo uno para registrar*/\n if (count($lastName) != 0) {\n if (count($lastName) != 1) {\n if ($lastName[0] != '') {\n $dataCons['primer_apellido'] = strtoupper($lastName[0]);\n $dataCons['segundo_apellido'] = strtoupper($lastName[1]);\n $lastNamesFull .= $lastName[0] . ' ' . $lastName[1];\n } else {\n $dataCons['primer_apellido'] = strtoupper($lastName[1]);\n $dataCons['segundo_apellido'] = '';\n $lastNamesFull .= $lastName[0];\n }\n } else {\n $dataCons['primer_apellido'] = strtoupper($lastName[0]);\n $dataCons['segundo_apellido'] = '';\n $lastNamesFull .= $lastName[0];\n }\n }\n\n $dataCons['nombre_full'] = strtoupper($firstNamesFull . ' ' . $lastNamesFull);\n $dataCons['nombre_old'] = strtoupper($firstNamesFull . ' ' . $lastNamesFull);\n\n\n $dataC = (new Consignee)->fill($dataCons);\n $dataC->created_at = date('Y-m-d H:i:s');\n $dataC->save();\n $consig_id = $dataC->id;\n\n /* CREACION DEL PO_BOX */\n $prefijo = DB::table('consignee as a')\n ->join('localizacion as b', 'a.localizacion_id', 'b.id')\n ->join('deptos as c', 'b.deptos_id', 'c.id')\n ->join('pais as d', 'c.pais_id', 'd.id')\n ->select('b.prefijo', 'd.iso2')\n ->where([\n ['a.deleted_at', null],\n ['a.id', $consig_id],\n ])\n ->first();\n $pref = '';\n $prefijo_pobox = Agencia::select('prefijo_pobox')->where('id', Auth::user()->agencia_id)->first();\n if($prefijo_pobox->prefijo_pobox == null){\n $pref = Auth::user()->agencia_id;\n }else{\n $pref = $prefijo_pobox->prefijo_pobox;\n }\n \n $po_box = $pref . '-' . $consig_id;\n // Consignee::where('id', $consig_id)->update(['po_box' => $prefijo->iso2 . '' . $po_box]);\n Consignee::where('id', $consig_id)->update(['po_box' => $po_box]);\n\n } catch (Exception $e) {\n echo 'Error: <pre>';\n print_r($e);\n echo '<pre>';\n }\n } else {\n if ($consig_id != '' and isset($data['opEditarCons'])) {\n $dataU = Consignee::findOrFail($consig_id);\n $dataU->agencia_id = $data['agencia_id'];\n $dataU->localizacion_id = $data['localizacion_id_c'];\n $dataU->direccion = $data['direccionD'];\n $dataU->telefono = $data['telD'];\n $dataU->correo = $data['emailD'];\n $dataU->zip = $data['zipD'];\n $dataU->po_box = $data['poBoxD'];\n\n $firstNamesFull = '';\n $lastNamesFull = '';\n $arrayNamesFull = $this->getNamesAndFullNames($data['nombreD']);\n $firstNames = $arrayNamesFull[0];\n $lastName = $arrayNamesFull[1];\n\n /*verifico si existen dos nombres o solo uno para registrar*/\n if (count($firstNames) != 0) {\n if (count($firstNames) != 1) {\n if ($firstNames[1] != '') {\n $dataU->primer_nombre = strtoupper($firstNames[0]);\n $dataU->segundo_nombre = strtoupper($firstNames[1]);\n $firstNamesFull .= $firstNames[0] . ' ' . $firstNames[1];\n } else {\n $dataU->primer_nombre = strtoupper($firstNames[0]);\n $dataU->segundo_nombre = '';\n $firstNamesFull .= $firstNames[0];\n }\n } else {\n $dataU->primer_nombre = strtoupper($firstNames[0]);\n $dataU->segundo_nombre = '';\n $firstNamesFull .= $firstNames[0];\n }\n }\n /*verifico si existen dos apellidos o solo uno para registrar*/\n if (count($lastName) != 0) {\n if (count($lastName) != 1) {\n if ($lastName[0] != '') {\n $dataU->primer_apellido = strtoupper($lastName[0]);\n $dataU->segundo_apellido = strtoupper($lastName[1]);\n $lastNamesFull .= $lastName[0] . ' ' . $lastName[1];\n } else {\n $dataU->primer_apellido = strtoupper($lastName[1]);\n $dataU->segundo_apellido = '';\n $lastNamesFull .= $lastName[0];\n }\n } else {\n $dataU->primer_apellido = strtoupper($lastName[0]);\n $dataU->segundo_apellido = '';\n $lastNamesFull .= $lastName[0];\n }\n }\n\n $dataU->nombre_full = strtoupper($firstNamesFull . ' ' . $lastNamesFull);\n\n $dataU->save();\n }\n }\n /*VALIDO SI EXISTE EN LA TABLA PIBOT 'shipper_consignee' LA RELACION, SI NO EXISTE LA CREAMOS*/\n $this->validateRelationShipperConsignee($shipper_id, $consig_id);\n\n /*fin del registro del shipper y consignee*/\n $ids = array(\n 'shipper_id' => $shipper_id,\n 'consig_id' => $consig_id,\n );\n return $ids;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets all recipients (backend user ids). | public function getAllRecipients() {} | [
"public function get_recipients() {\n\t\treturn $this->recipients;\n\t}",
"public function get_recipients() {\n\t\tglobal $wpdb, $bp;\n\n\t\t$recipients = array();\n\t\t$results = $wpdb->get_results( $wpdb->prepare( \"SELECT * FROM {$bp->messages->table_name_recipients} WHERE thread_id = %d\", $this->thread_id ) );\n\n\t\tforeach ( (array) $results as $recipient )\n\t\t\t$recipients[$recipient->user_id] = $recipient;\n\n\t\treturn $recipients;\n\t}",
"public function getAllRecipientAddresses()\r\n {\r\n return $this->all_recipients;\r\n }",
"public function getRecipients(): array {\n\t\tif (empty($this->recipients)) {\n\t\t\treturn [];\n\t\t}\n\t\t\n\t\t$recipients = (array) $this->recipients;\n\t\t/* @var $batch \\ElggBatch */\n\t\t$batch = elgg_get_entities([\n\t\t\t'type' => 'user',\n\t\t\t'limit' => false,\n\t\t\t'guids' => $recipients,\n\t\t\t'relationship' => 'member',\n\t\t\t'relationship_guid' => $this->container_guid,\n\t\t\t'inverse_relationship' => true,\n\t\t\t'batch' => true,\n\t\t]);\n\t\t\n\t\t$formatted_recipients = [];\n\t\t/* @var $user \\ElggUser */\n\t\tforeach ($batch as $user) {\n\t\t\t$formatted_recipients[$user->guid] = ['email'];\n\t\t}\n\t\t\n\t\treturn $formatted_recipients;\n\t}",
"public function getRecipients()\n {\n return $this->recipients;\n }",
"public function getRecipients() : array\n {\n return $this->recipients;\n }",
"public function getRecipientIds();",
"public function recipients()\n {\n return DB::table('alias_request_recipients')\n ->where('request_id', '=', $this->id)\n ->get();\n }",
"public function getRecipients()\n {\n $q = $this->getEntityManager()->createQueryBuilder()\n ->select('e.recipient as address')\n ->from($this->getEntityName(), 'e')\n ->distinct()\n ->orderBy('e.recipient ', 'asc')\n ->getQuery();\n $result = $this->processEmailLists($q->execute());\n\n return $result;\n }",
"function get_recipients()\n\t{\n\t\treturn (empty($this->_rcpt_to) ? array() : $this->_rcpt_to);\n\t}",
"public function recipients(): Collection\n {\n return DB::table('alias_recipients')\n ->where('alias_id', '=', $this->id)\n ->get();\n }",
"function getAllEmails() {\n\n if (!isset($this->fields['id'])) {\n return [];\n }\n return UserEmail::getAllForUser($this->fields['id']);\n }",
"public function getAllRecipientAddresses()\n {\n }",
"public function getRecipients(array $criteria = array())\n {\n # GET /accounts/{accountId}/envelopes/{envelopeId}/recipients\n }",
"public function getToAddresses()\n {\n return $this->recipients->getTo();\n }",
"public function getAllRecipientsForChat() : array {\n $query = \"SELECT c.name, u.id FROM companies \n c JOIN users u ON c.user_id = u.id \n UNION SELECT t.first_name, u.id \n FROM teachers t JOIN users u ON t.user_id = u.id\";\n $pdostm = $this->db->prepare($query);\n $pdostm->setFetchMode(PDO::FETCH_OBJ);\n $pdostm->execute();\n\n $recipientsDB = $pdostm->fetchAll(PDO::FETCH_OBJ);\n // var_dump($recipientsDB);\n $recipients = array();\n\n foreach ($recipientsDB as $r)\n {\n $recipient = new ChatMember();\n\n $recipient->setUserId($r->id);\n $recipient->setName($r->name);\n\n array_push($recipients,$recipient);\n\n }\n return $recipients;\n\n }",
"function getAllEmailRecipients() {\n $headers = self::getEmailHeaderArray();\n $recipients = array();\n if (!$headers)\n return $recipients;\n\n foreach (array('To', 'Cc') as $H) {\n if (!isset($headers[$H]))\n continue;\n\n if (!($all = Mail_Parse::parseAddressList($headers[$H])))\n continue;\n\n $recipients = array_merge($recipients, $all);\n }\n return $recipients;\n }",
"private function getRecipients()\n\t{\n\t\t$i = 0;\n\t\tif(is_null($this->recipients)){\n\t\t\t$this->error('INVALID_RECIPIENTS');\n\t\t\treturn false;\n\t\t}\n\t\tforeach($this->recipients as $recipient){\n\t\t\t$array['L_EMAIL'.$i] = $recipient['email'];\n\t\t\t$array['L_AMT'.$i] = $recipient['amt'];\n\t\t\t$i++;\n\t\t}\n\t\t$this->recipients = null;\n\t\treturn $array;\n\t}",
"public function findRecipientsAsArray()\n {\n $q = new Doctrine_Query;\n\n $q\n ->select('DISTINCT u.display_name, u.email')\n ->from('UllUser u, u.UllCourseBooking b')\n ->where('b.is_active = ?', true)\n ->addWhere('b.ull_course_id = ?', $this->id)\n ->orderBy('u.last_name_first')\n ; \n \n $q->setHydrationMode(DOCTRINE::HYDRATE_NONE);\n \n $results = $q->execute();\n \n $return = array();\n \n foreach($results as $result)\n {\n $email = $result[1];\n $name = $result[0];\n \n if ($email)\n {\n $return[$email] = $name;\n }\n }\n \n return $return;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This is the most basic test, to assert that the Writer class is autoloaded correctly by Composer. | public function testWriterConstructs() {
$writer = new Writer();
$this->assertInstanceOf("k3rn3l3rr0r\DXF\Writer", $writer);
} | [
"public function testExecutionBasicClass() : void\n {\n $cw = $this->getClassWriter();\n\n $this->assertExecutionResult(['Hello world!'], $cw);\n }",
"private function loadWriter(): void\r\n {\r\n $this->writerInstance = WriterFactory::from($this->format);\r\n $this->bootWriter($this->writerInstance);\r\n }",
"public function testDumpAutoload()\n {\n $this->assertEquals('composer dump-autoload ', $this->executableWithoutPHAR->dumpAutoload());\n $this->assertEquals(\n '\"' . PHP_BINARY . '\" composer.phar dump-autoload ',\n $this->executableWithPHAR->dumpAutoload()\n );\n }",
"public function testOutputFactory()\n {\n $outputFactory = OutputFactory::loadOutput($this->twitchChannel);\n self::assertEquals('Martin1982\\LiveBroadcastBundle\\Streams\\Output\\Twitch', get_class($outputFactory));\n }",
"public function test_autoload_class() {\n\t\t$this->assertFalse(\n\t\t\tclass_exists( __NAMESPACE__ . '\\Autoloaded\\Autoloaded_Class' ),\n\t\t);\n\n\t\t$this->assert_true_after_registering_autoloader(\n\t\t\t'class_exists',\n\t\t\t[ __NAMESPACE__ . '\\Autoloaded\\Autoloaded_Class' ]\n\t\t);\n\t}",
"public function testLoadsClassIfNoNamespaceIsRegistered() {\n\n\t\t$this->autoLoader = new ClassAutoloader();\n\t\t$this->autoLoader->register();\n\n\t\t$this->assertTrue(class_exists('com\\mohiva\\test\\resources\\common\\io\\ClassWithoutRegisteredNamespaces', true));\n\t}",
"public function testUtilXml() {\n $this->assertTrue(class_exists('\\PHPUnit_Util_XML'));\n }",
"public function test_autoload_interface() {\n\t\t$this->assert_true_after_registering_autoloader(\n\t\t\t'interface_exists',\n\t\t\t[ __NAMESPACE__ . '\\Autoloaded\\Autoloaded_Interface' ]\n\t\t);\n\t}",
"public function testUtilTest() {\n $this->assertTrue(class_exists('\\PHPUnit_Util_Test'));\n }",
"public function testLibIsLoaded() {\n\t\t$this->assertTrue(class_exists('ChartDataManipulation'));\n\t}",
"public function test_do_not_parse_comments_to_classnames_wp_dependency_installer()\n {\n\n $composerJsonString = <<<'EOD'\n{\n\t\"name\": \"brianhenryie/mozart-issue-86-2\",\n\t\"require\": {\n\t\t\"afragen/wp-dependency-installer\": \"3.1\"\n\t},\n\t\"extra\": {\n\t\t\"strauss\": {\n\t\t\t\"namespace_prefix\": \"BrianHenryIE\\\\Strauss\\\\\",\n\t\t\t\"classmap_prefix\": \"BrianHenryIE_Strauss_\"\n\t\t}\n\t}\n}\nEOD;\n\n file_put_contents($this->testsWorkingDir . 'composer.json', $composerJsonString);\n\n chdir($this->testsWorkingDir);\n\n exec('composer install');\n\n $inputInterfaceMock = $this->createMock(InputInterface::class);\n $outputInterfaceMock = $this->createMock(OutputInterface::class);\n\n $mozartCompose = new Compose();\n\n $result = $mozartCompose->run($inputInterfaceMock, $outputInterfaceMock);\n\n $php_string = file_get_contents($this->testsWorkingDir .'vendor-prefixed/afragen/wp-dependency-installer/wp-dependency-installer.php');\n\n // Confirm problem is gone.\n $this->assertStringNotContainsString('Path BrianHenryIE_Strauss_to plugin or theme', $php_string, 'Text in comment still prefixed.');\n\n // Confirm solution is correct.\n $this->assertStringContainsString('BrianHenryIE_Strauss_WP_Dependency_Installer', $php_string, 'Class name not properly prefixed.');\n }",
"public function testMockJorge() {\n # Startup messages (all verbosities):\n $startup = [\n [LogLevel::NOTICE, 'Project root: {%root}'],\n [LogLevel::DEBUG, '{composer} Executable is \"{%executable}\"'],\n ['NULL', 'Can’t read config file {%filename}'],\n [LogLevel::DEBUG, '{git} Executable is \"{%executable}\"'],\n [LogLevel::NOTICE, '{git} $ {%command}'],\n [LogLevel::DEBUG, '{lando} Executable is \"{%executable}\"'],\n ['NULL', 'Can’t read config file {%filename}'],\n ];\n $this->verifyMessages($startup, $this->jorge->messages);\n $this->jorge->messages = [];\n\n # From __construct():\n $this->assertInstanceOf(MockJorge::class, $this->jorge);\n $output = $this->jorge->getOutput();\n $this->assertInstanceOf(MockConsoleOutput::class, $output);\n $this->assertTrue($output->isDecorated());\n $this->assertSame(OutputInterface::VERBOSITY_NORMAL, $output->getVerbosity());\n $this->assertSame(0, $_ENV['SHELL_VERBOSITY']);\n\n # From configure():\n $this->assertSame('Jorge', $this->jorge->getName());\n $this->assertRegExp('/\\d\\.\\d\\.\\d/', $this->jorge->getVersion());\n $this->assertSame(realpath($this->tempDir->path()), $this->jorge->getPath());\n $this->assertSame([], $this->jorge->getConfig());\n\n # Verify that MockJorge’s log() works as expected:\n $logLevels = [\n LogLevel::EMERGENCY,\n LogLevel::ALERT,\n LogLevel::CRITICAL,\n LogLevel::ERROR,\n LogLevel::WARNING,\n LogLevel::NOTICE,\n LogLevel::INFO,\n LogLevel::DEBUG,\n ];\n $expect = [];\n foreach ($logLevels as $level) {\n $text = $this->makeRandomString();\n $expect[] = [$level, $text, []];\n $this->jorge->log($level, $text);\n }\n $this->verifyMessages($expect, $this->jorge->messages, TRUE);\n $this->jorge->messages = [];\n\n # Verify that writeln works as expected:\n $text = $this->makeRandomString();\n $this->jorge->getOutput()->writeln($text);\n $this->verifyMessages([['writeln', $text]], $this->jorge->messages);\n }",
"public function setUp()\n {\n $this->file = tmpfile();\n fwrite($this->file, <<<EOL\n<?php\n\nnamespace Foo\\Bar;\n\nclass Foo {}\nclass Bar {}\n\nnamespace Baz;\n\nclass Boo {}\n\nEOL\n );\n }",
"public function test_wep_plugin_class_exists() {\n $this->assertTrue(class_exists('Wep_Plugin'));\n }",
"public function testLoadsValidClass()\n\t{\n\t\t$autoloader = new Autoloader;\n\t\t$output = $autoloader->autoloadClass($this->className);\n\n\t\t$this->assertTrue($output);\n\t}",
"function testAutoload_mapsConsistency()\n {\n $name = $this->_rndName();\n $path = $this->_writeClassFile($name, '.class.php');\n\n lmb_require($path);\n $_ENV = array();\n lmb_require($path);\n lmb_autoload($name);\n $this->assertTrue(class_exists($name));\n }",
"public function testInstantinationUsingProducer()\n {\n /** @var Writer $special_writer */\n $special_writer = $this->pool->produce(\n Writer::class,\n [\n 'name' => 'Special Writer',\n 'birthday' => '2013-10-02',\n ]\n );\n\n $this->assertInstanceOf(Writer::class, $special_writer);\n $this->assertTrue($special_writer->is_special);\n }",
"public function testGetComposer()\n {\n $controller = $this\n ->getMockBuilder(AbstractController::class)\n ->setMethods(null)\n ->getMockForAbstractClass();\n\n $home = $this->getMock(HomePathDeterminator::class, ['homeDir']);\n $home->method('homeDir')->willReturn($this->getTempDir());\n\n $this->createFixture('composer.json', '{}');\n\n $container = new Container();\n $container->set('tenside.home', $home);\n\n /** @var AbstractController $controller */\n $controller->setContainer($container);\n\n $this->assertInstanceOf(Composer::class, $controller->getComposer());\n }",
"public function testImplements(): void\n {\n $template = new OutputBufferTemplate(__DIR__ . '/test_ok.phtml');\n $this->assertInstanceOf(TemplateInterface::class, $template);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Unsets the publisher property. | public function withoutPublisher(); | [
"public function unpublish()\n\t{\n\t\tparent::unpublish();\n\t}",
"public function unPublish()\n {\n $this->published = false;\n }",
"public function clearPublishers()\n {\n foreach ($this->publishers as $publisher) {\n $this->removePublisher($publisher);\n }\n }",
"public function unSubscribe()\n {\n }",
"public function clearUnPublishJob()\n {\n // Cancel any in-progress unpublish job\n $job = $this->owner->UnPublishJob();\n if ($job && $job->exists()) {\n $job->delete();\n }\n $this->owner->UnPublishJobID = 0;\n }",
"public function onAfterUnpublish()\n {\n if ($this->owner->indexEnabled()) {\n $this->removeFromAlgolia();\n }\n }",
"function set_publisher($publisher)\r\n {\r\n $this->set_default_property(self :: PROPERTY_PUBLISHER, $publisher);\r\n }",
"public function unsubscribed(): void;",
"public function unSubscribe(string $type, SubscriberInterface $subscriber): void;",
"public function reset(): void\n {\n $this->subscribers = [];\n }",
"function unpublish()\n\t{\n\t\t//parent::unpublish();\n\t\tself::changestate(0); // Go through custom unpublish to clean FLEXIcontent category cache\n\t}",
"public function unset()\n {\n unset($this->value);\n }",
"protected function unpublish($key)\n {\n unset($this->data['global'][$key]);\n }",
"public function unpublish()\n {\n return $this->update([\n 'status' => false,\n 'published' => null\n ]);\n }",
"public function clearPubprops()\n {\n $this->collPubprops = null; // important to set this to null since that means it is uninitialized\n $this->collPubpropsPartial = null;\n\n return $this;\n }",
"public function unSubscribeNewsletter() {\n\t\t\n $subscription = $this->newsletterRecord();\n if ($subscription) $subscription->unsubscribe();\n\t\n }",
"public function clearPublishJob()\n {\n $job = $this->owner->PublishJob();\n if ($job && $job->exists()) {\n $job->delete();\n }\n $this->owner->PublishJobID = 0;\n }",
"public function unpublishResource(Resource $resource);",
"public function removeFromPublication()\n {\n $this->publishedAt = null;\n $this->updatedAt = new DateTimeImmutable();\n\n $this->raise(new Events\\PostRemovedFromPublishedList([\n 'author' => $this->author, 'title' => $this->title, 'removed_at' => new DateTimeImmutable(),\n ]));\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Deletes all recipes by performing an HTTP POST to the batch URI. | function batchDelete() {
$ch = curl_init(); /* Create a CURL handle. */
global $developerKey, $itemsFeedURL;
/* Set cURL options. */
curl_setopt($ch, CURLOPT_URL, $itemsFeedURL . "/batch");
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FAILONERROR, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Authorization: AuthSub token="' . $_POST['token'] . '"',
'X-Google-Key: key=' . $developerKey,
'Content-Type: application/atom+xml'
));
curl_setopt($ch, CURLOPT_POSTFIELDS, buildBatchXML());
$result = curl_exec($ch); /* Execute the HTTP request. */
curl_close($ch); /* Close the cURL handle. */
return $result;
} | [
"function batchDelete() {\r\n $client = Zend_Gdata_AuthSub::getHttpClient($_POST['token']);\r\n $gdata = new Zend_Gdata_Gbase($client);\r\n \r\n $response = $gdata->post(buildBatchXML(), ITEMS_FEED_URI . '/batch');\r\n \r\n return $response;\r\n}",
"public static function batchDelete() {\n $result = lC_Weight_classes_Admin::batchDelete($_GET['batch']);\n if (isset($result['namesString']) && $result['namesString'] != null) {\n } else {\n $result['rpcStatus'] = RPC_STATUS_SUCCESS;\n }\n\n echo json_encode($result);\n }",
"public function batchDeleteAction()\n {\n throw new ApiException\\BatchInterfaceNotImplementedException('Batch operations not implemented by this resource');\n }",
"public function deleteAll();",
"public static function batchDeleteEntries() {\n $result = array();\n $deleted = lC_Manufacturers_Admin::batchDelete($_GET['batch']);\n if ($deleted) {\n $result['rpcStatus'] = RPC_STATUS_SUCCESS;\n }\n\n echo json_encode($result);\n }",
"public static function batchDelete() {\n $result = lC_Image_groups_Admin::batchDelete($_GET['batch']);\n if (isset($result['namesString']) && $result['namesString'] != null) {\n } else {\n $result['rpcStatus'] = RPC_STATUS_SUCCESS;\n }\n\n echo json_encode($result);\n }",
"public function actionDeleteall()\n {\n $ids = explode( '|', Yii::$app->request->get('ids') );\n if (is_array( $ids )) {\n foreach ( $ids as $id ) {\n $this->findModel($id)->delete();\n }\n }\n \n return $this->redirect(['index']);\n }",
"abstract public function deleteAll();",
"public static function batchDelete() {\n $result = lC_Product_variants_Admin::batchDelete($_GET['batch']);\n if (isset($result['namesString']) && $result['namesString'] != null) {\n } else {\n $result['rpcStatus'] = RPC_STATUS_SUCCESS;\n }\n\n echo json_encode($result);\n }",
"public static function batchDeleteEntries() {\n global $_module;\n\n $result = lC_Product_variants_Admin::batchDeleteEntries($_GET['batch'], $_GET[$_module]);\n if (isset($result['namesString']) && $result['namesString'] != null) {\n } else {\n $result['rpcStatus'] = RPC_STATUS_SUCCESS;\n }\n\n echo json_encode($result);\n }",
"public function deleteAll()\n {\n $this->_preDeleteAll();\n foreach ($this->_data as $key => $val) {\n $this->deleteOne($key);\n }\n $this->_postDeleteAll();\n }",
"public static function batchDeleteEntries() {\n $result = array();\n $deleted = lC_Newsletters_Admin::batchDelete($_GET['batch']);\n if ($deleted) {\n $result['rpcStatus'] = RPC_STATUS_SUCCESS;\n }\n\n echo json_encode($result);\n }",
"public function deleteAll() {\n $sql = \"DELETE FROM \" . $this->tableName;\n $this->runRequest($sql);\n }",
"public function multiDeleteAction() {\n\n if ($this->getRequest()->isPost()) {\n $values = $this->getRequest()->getPost();\n foreach ($values as $key => $value) {\n if ($key == 'delete_' . $value) {\n //DELETE DOCUMENTS FROM DATABASE AND SCRIBD\n Engine_Api::_()->getItem('sitereview_review', (int) $value)->delete();\n }\n }\n }\n return $this->_helper->redirector->gotoRoute(array('controller' => 'review', 'action' => 'manage'));\n }",
"public function deleteBatch($batch) {\n return $this->db_delete()\n ->condition('sqid', array_keys($this->get_items()))\n ->execute(); \n }",
"public function delete()\n {\n $this->forge->deleteRecipe($this->id);\n }",
"public function delete_batch()\n\t {\n\t\t \n\t\t \t$ids\t= ee()->input->post('delete');\n\t\t \n\t\t \t$delete_options\t= ee()->db->where_in('entry_id',$ids)->delete(ee()->shared->index_table);\n\t\t \t//$delete_idices\t\t= ee()->db->where_in('entry_id',$ids)->delete(ee()->shared->index_table);\n\t\t \n\t\t return TRUE;\n\t }",
"public function deleteAllPostData() {\n\n }",
"public static function delete_batch() {\n\t\twc_admin_record_tracks_event( 'delete_import_data_job_start', array( 'type' => static::$name ) );\n\n\t\t$batch_size = static::get_batch_size( 'delete' );\n\t\tstatic::delete( $batch_size );\n\n\t\tReportsCache::invalidate();\n\n\t\twc_admin_record_tracks_event( 'delete_import_data_job_complete', array( 'type' => static::$name ) );\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Replace reply link class in comment form | function replace_reply_link_class( $class ){
$class = str_replace( "class='comment-reply-link", "class='comment-reply-link btn btn-default btn-sm", $class );
return $class;
} | [
"function shoestrap_replace_reply_link_class( $class ) {\n $class = str_replace( \"class='comment-reply-link\", \"class='comment-reply-link btn btn-primary btn-small\", $class );\n return $class;\n}",
"public static function comment_reply_link () : void\n {\n add_filter(\"comment_reply_link\", function ($class){\n $class = str_replace(\"class='comment-reply-link\", 'class=\"comment-reply-link reply\"', $class);\n\n return $class;\n });\n\n add_filter(\"comment_reply_link_args\", function ($args){\n $args[\"reply_text\"] = '<i class=\"material-icons\">reply</i>' . __(\"Reply\", \"ahana\");\n\n return $args;\n });\n }",
"static function bootstrap_reply_link_class( $class ) {\n\t\t$class = str_replace( \"class='comment-reply-link\", \"class='comment-reply-link btn btn-primary btn-sm\", $class );\n\t\treturn $class;\n\t}",
"function magaz_replace_cancel_reply_link_class( $cancel_comment_reply_link, $post = null ) {\n $new = str_replace( '<a', '<a class=\"button outline tiny\"', $cancel_comment_reply_link );\n return $new;\n }",
"function bbp_reply_class($reply_id = 0, $classes = array())\n{\n}",
"function register_block_core_comment_reply_link() {\n\tregister_block_type_from_metadata(\n\t\t__DIR__ . '/comment-reply-link',\n\t\tarray(\n\t\t\t'render_callback' => 'render_block_core_comment_reply_link',\n\t\t)\n\t);\n}",
"function render_block_core_comment_reply_link($attributes, $content, $block)\n {\n }",
"function hybrid_comment_reply_link_shortcode( $attr ) {\n\n\tif ( !get_option( 'thread_comments' ) || 'comment' !== get_comment_type() )\n\t\treturn '';\n\n\t$defaults = array(\n\t\t'reply_text' => __( 'Reply', 'hybrid-core' ),\n\t\t'login_text' => __( 'Log in to reply.', 'hybrid-core' ),\n\t\t'depth' => intval( $GLOBALS['comment_depth'] ),\n\t\t'max_depth' => get_option( 'thread_comments_depth' ),\n\t\t'before' => '',\n\t\t'after' => ''\n\t);\n\t$attr = shortcode_atts( $defaults, $attr, 'comment-reply-link' );\n\n\treturn get_comment_reply_link( $attr );\n}",
"function sunix_comment_reply_link($link, $args, $comment, $post){\n\tif ( get_option( 'comment_registration' ) && ! is_user_logged_in() ) {\n\t\t$link = sprintf( '<a rel=\"nofollow\" class=\"comment-reply-login\" href=\"%s\"><span class=\"fa fa-reply\"></span> %s</a>',\n\t\t\tesc_url( wp_login_url( get_permalink() ) ),\n\t\t\t$args['login_text']\n\t\t);\n\t} else {\n\t\t$onclick = sprintf( 'return addComment.moveForm( \"%1$s-%2$s\", \"%2$s\", \"%3$s\", \"%4$s\" )',\n\t\t\t$args['add_below'], $comment->comment_ID, $args['respond_id'], $post->ID\n\t\t);\n\n\t\t$link = sprintf( \"<a rel='nofollow' class='comment-reply-link' href='%s' onclick='%s' aria-label='%s'>%s</a>\",\n\t\t\tesc_url( add_query_arg( 'replytocom', $comment->comment_ID, get_permalink( $post->ID ) ) ) . \"#\" . $args['respond_id'],\n\t\t\t$onclick,\n\t\t\tesc_attr( sprintf( $args['reply_to_text'], $comment->comment_author ) ),\n\t\t\t$args['reply_text']\n\t\t);\n\t}\n\t\n\t$link = $args['before'] . $link . $args['after'];\n\treturn $link;\n}",
"function mrc_get_comment_reply_link($args = array(), $comment = null, $post = null) {\r\n global $user_ID;\r\n\r\n $defaults = array('add_below' => 'comment', 'respond_id' => 'respond', 'reply_text' => __('Reply'),\r\n 'login_text' => __('Log in to Reply'), 'depth' => 0, 'before' => '', 'after' => '');\r\n\r\n $args = wp_parse_args($args, $defaults);\r\n\r\n if ( 0 == $args['depth'] || $args['max_depth'] <= $args['depth'] )\r\n return;\r\n\r\n extract($args, EXTR_SKIP);\r\n\r\n $comment = get_comment($comment);\r\n if ( empty($post) )\r\n $post = $comment->comment_post_ID;\r\n $post = get_post($post);\r\n\r\n if ( !comments_open($post->ID) )\r\n return false;\r\n\r\n $link = '';\r\n\r\n if ( get_option('comment_registration') && !$user_ID )\r\n {\r\n //No hay accion aca solo logeado puedes responder\r\n }\r\n\r\n else\r\n {\r\n $link = \"<a class='comment-reply-link' href='\" . esc_url( add_query_arg( 'replytocom', $comment->comment_ID ) ) . \"#\" . $respond_id . \"' onclick='return addComment.moveForm(\\\"$add_below-$comment->comment_ID\\\", \\\"$comment->comment_ID\\\", \\\"$respond_id\\\", \\\"$post->ID\\\")'>$reply_text</a>\";\r\n }\r\n return apply_filters('comment_reply_link', $link , $args, $comment, $post);\r\n}",
"function showReplyLink()\n {\n $this->out->elementStart('li', 'reply');\n \t$this->out->elementStart('a', array('href' => common_path('notice/replyat/' . $this->profile->uname),\n \t\t\t\t\t'nid' => $this->notice->id,\n 'title' => '回复'));\n \t$this->out->text('回复');\n \t$this->out->elementEnd('a'); \t\t\n \t$this->out->elementEnd('li');\n }",
"function get_cancel_comment_reply_link_telerikacademy( $prev_link = '', $link = '', $text = '' ) {\n\t$style = isset($_GET['replytocom']) ? '' : ' style=\"display:none;\"';\t\n\treturn '<a rel=\"nofollow\" id=\"cancel-comment-reply-link\" \n\t\tclass=\"command-button\" href=\"' . $link . '\"' . $style . '>' . $text . '</a>';\n}",
"public function update_reply() {\n\n // Update reply\n (new MidrubBaseUserAppsCollectionChatbotHelpers\\Replies)->update_reply();\n\n }",
"public function remove_reply_to_com( $link ) {\n\t\treturn preg_replace( '`href=([\"\\'])(?:.*(?:\\?|&|&)replytocom=(\\d+)#respond)`', 'href=$1#comment-$2', $link );\n\t}",
"function netfunktheme_commenter_link() {\n\n\t$commenter = get_comment_author_link();\n\n\tif ( preg_match( '/<a[^>]* class=[^>]+>/', $commenter ) ) {\n\t\t$commenter = preg_replace( '/(<a[^>]* class=[\\'\"]?)/', '\\\\1url ' , $commenter );\n\t} \n\telse {\n\t\t$commenter = preg_replace( '/(<a )/', '\\\\1class=\"url \"' , $commenter );\n\t}\n\t\n\t$avatar_email = get_comment_author_email();\n\t$avatar = str_replace( \"class='avatar\", \"class='photo avatar\", get_avatar( $avatar_email, 80 ) );\n\techo $avatar . ' <span class=\"fn n\">' . $commenter . '</span>';\n}",
"function themethreads_comment_reply_link( $args = array() ) {\n\techo themethreads_get_comment_reply_link( $args );\n}",
"public function testLinkReply() {\n $this->enableModules(['field']);\n $this->installSchema('comment', ['comment_entity_statistics']);\n $this->installConfig(['field']);\n\n $field_storage_comment = FieldStorageConfig::create([\n 'field_name' => 'comment',\n 'type' => 'comment',\n 'entity_type' => 'entity_test',\n ]);\n $field_storage_comment->save();\n // Create a comment field which allows threading.\n $field_comment = FieldConfig::create([\n 'field_name' => 'comment',\n 'entity_type' => 'entity_test',\n 'bundle' => 'entity_test',\n 'settings' => [\n 'default_mode' => CommentManagerInterface::COMMENT_MODE_THREADED,\n ],\n ]);\n $field_comment->save();\n\n $host = EntityTest::create(['name' => $this->randomString()]);\n $host->save();\n // Attach an unapproved comment to the test entity.\n $comment = $this->commentStorage->create([\n 'uid' => $this->adminUser->id(),\n 'entity_type' => 'entity_test',\n 'entity_id' => $host->id(),\n 'comment_type' => 'entity_test',\n 'field_name' => $field_storage_comment->getName(),\n 'status' => 0,\n ]);\n $comment->save();\n\n $view = Views::getView('test_comment');\n $view->setDisplay();\n\n $view->displayHandlers->get('default')->overrideOption('fields', [\n 'replyto_comment' => [\n 'table' => 'comment',\n 'field' => 'replyto_comment',\n 'id' => 'replyto_comment',\n 'plugin_id' => 'comment_link_reply',\n 'entity_type' => 'comment',\n ],\n ]);\n $view->save();\n\n /** @var \\Drupal\\Core\\Session\\AccountSwitcherInterface $account_switcher */\n $account_switcher = \\Drupal::service('account_switcher');\n $account_switcher->switchTo($this->adminUser);\n $view->preview();\n\n // Check if I can see the reply link on an unapproved comment.\n $replyto_comment = $view->style_plugin->getField(0, 'replyto_comment');\n $this->assertEmpty((string) $replyto_comment, \"I can't reply to an unapproved comment.\");\n\n // Approve the comment.\n $comment->setPublished();\n $comment->save();\n $view = Views::getView('test_comment');\n $view->preview();\n\n // Check if I can see the reply link on an approved comment.\n $replyto_comment = $view->style_plugin->getField(0, 'replyto_comment');\n $url = Url::fromRoute('comment.reply', [\n 'entity_type' => 'entity_test',\n 'entity' => $host->id(),\n 'field_name' => 'comment',\n 'pid' => $comment->id(),\n ]);\n $this->assertEquals((string) $replyto_comment, Link::fromTextAndUrl('Reply', $url)->toString(), 'Found the comment reply link as an admin user.');\n\n // Check if I can see the reply link as an anonymous user.\n $account_switcher->switchTo(new AnonymousUserSession());\n $view = Views::getView('test_comment');\n $view->preview();\n $replyto_comment = $view->style_plugin->getField(0, 'replyto_comment');\n $this->assertEmpty((string) $replyto_comment, \"Didn't find the comment reply link as an anonymous user.\");\n }",
"public function replyLink()\n {\n return \"<a class=\\\"at\\\" href=\\\"\" . $this->author->profileLink() . \"\\\">@\" . $this->author->name .\"</a>\";\n }",
"function blogfused_get_cancel_comment_reply_link($text = '') {\n\tif ( empty($text) )\n\t\t$text = __('Click here to cancel reply.');\n\n\t$style = isset($_GET['replytocom']) ? '' : ' style=\"display:none;\"';\n\t$link = esc_html( remove_query_arg('replytocom') ) . '#respond';\n\treturn apply_filters('cancel_comment_reply_link', '<a rel=\"nofollow\" class=\"btn btn-mini btn-inverse\" id=\"cancel-comment-reply-link\" href=\"' . $link . '\"' . $style . '>' . $text . '</a>', $link, $text);\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
CacheURI stores the page on cache so that ngix can serv it directly | public function cacheURI($page, $timeout) {
$timeout = ($timeout > 1) ? $timeout : 3600;
$key = 'sq:'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
/**
* check in a near feature for memcached_gzip_flag
*/
return $this->_cache()->compress(0)->set($key, $page, $timeout);
} | [
"function cache( &$content ) {\n\t\t$path = strtok( $_SERVER['REQUEST_URI'], '?' );\n\t\t$cache_file_dir = rtrim( $this->cache_dir . $path, '/' );\n\t\t$cache_file = $cache_file_dir . DIRECTORY_SEPARATOR . 'index.html' ;\n\t\tif ( !file_exists( $cache_file ) || isset( $_GET['flush_cache'] ) ) {\n\t\t\t$content_tag = '<!-- Content served from static cache at ' . $path . '-->' ;\n\t\t\t@mkdir( $cache_file_dir, 0755, true );\n\t\t\t$result = file_put_contents($cache_file, $content . $content_tag);\n\t\t}\n\t}",
"protected function caching_page( $cache_time = 10080 ){\n \t$this->output->cache($cache_time);\n }",
"function cache_this_page () {\n\t\tglobal $debug;\n\t\t# Check to see if the customer is logged in and whether the page cache is enabled\t\t\n\t\tif ($this->is_guest && ENABLE_PAGE_CACHE =='true') {\n\t\t\t# Add to the debug array\n\t\t\t$this->debug_output['is_guest_check'] = 'customer_id not set - cache_this_page()';\n\t\t\t# Check to see if the file exists and it is not expired\n\t\t\tif ( $this->cache_file_exists && !$this->cache_file_is_expired ) {\n\t\t\t\t# Good...it does exist and is not expired\n\t\t\t\t$this->debug_output['file_exists_and_is_not_expired'] = 'file exists and is not expired';\n\t\t\t\t# Now let's see if they have cookie support enabled\n\t\t\t\tif ( !tep_not_null($this->customer_sid) ) {\n\t\t\t\t\t# They have cookies enabled...let's remove the osCsid from the URL's since it is being pulled from cookie\n\t\t\t\t\techo str_replace(array(\"<%CART_CACHE%>\", \"?<osCsid>\", \"&<osCsid>\"), array($this->customer_cart, $this->customer_sid, $this->customer_sid), file_get_contents($this->cache_file) );\n\t\t\t\t} else {\n\t\t\t\t\t# No cookies enabled so let's append the osCsid to every URL\n\t\t\t\t\techo str_replace(array(\"<%CART_CACHE%>\", \"<osCsid>\"), array($this->customer_cart, $this->customer_sid), file_get_contents($this->cache_file) );\t\t\t\t\n\t\t\t\t} \t\t\t\n\t\t\t\t$this->debug();\n\t\t\t\tinclude (DIR_WS_INCLUDES . 'counter.php');\n\t\t\t\tinclude_once (DIR_WS_INCLUDES . 'application_bottom.php');\n\t\t\t\texit();\n\t\t\t} # END file exists and is not expired\n\t\t\t\n\t\t\t# Does the file exist or is it expired?\t\t\t\n\t\t\tif ( !$this->cache_file_exists || $this->cache_file_is_expired ) {\n\t\t\t\t# Either it does not exist or is expired. Let's start the cache\n\t\t\t\t# Add the info to the debug array\n\t\t\t\t$this->debug_output['no_file_or_expired'] = 'file does not exist or is expired'; \n\t\t\t\t# Set the flag to write the cache file\n\t\t\t\t$this->write_cache_file = true;\n\t\t\t\t# We'll need to output the buffer as well\n\t\t\t\t$this->output_ob = true;\n\t\t\t\t# Start the output buffer\n\t\t\t\tob_start();\n\t\t\t\t# Add the info to the debug array\n\t\t\t\t$this->debug_output['ob_started'] = 'ob started @ '. time();\n\t\t\t} # END is file does not exist or is expired\t\t\t\n\t\t} # END if $this->is_guest\t\t\n\t}",
"protected function serveFromCache()\n {\n $this->functionLib->load('cache', 'serveFromCache', __FILE__, __LINE__);\n\n //Serve the page from the cache if it's available in the database\n serveFromCache();\n }",
"public static function render_cache($uri){\r\n\t\t\t$uri = md5($uri);\r\n\t\t\t$directory = TMP_PATH . DS . 'cache';\r\n\r\n\t\t\tif(file_exists($directory . DS . $uri) && Config::read('Template.enable_caching') === true){\r\n\t\t\t\t// Cache file exists, make sure it hasn't timed out.\r\n\t\t\t\tif($contents = file_get_contents($directory . DS . $uri)){\r\n\t\t\t\t\tpreg_match(\"#\\@CACHE_TIMEOUT\\:(\\d+)\\:CACHE\\_URI\\:(.*?)\\>\\>\\>#\", $contents, $matches);\r\n\r\n\t\t\t\t\tif(empty($matches) || !isset($matches[1])){\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif(time() >= $matches[1]){\r\n\t\t\t\t\t\t// Cache has expired. Delete and request new.\r\n\t\t\t\t\t\t@unlink($directory . $uri);\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t// Grab the stored URI.\r\n\t\t\t\t\t$uri = $matches[2];\r\n\r\n\t\t\t\t\t// Send the cached copy to the render method.\r\n\t\t\t\t\tTemplate::render(str_replace($matches[0], '', $contents));\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t// Something happened. No cache then.\r\n\t\t\treturn false;\r\n\t\t}",
"public function RetrieveFromCache($url);",
"public function cache(){\n\t\tif(!$this->settings[\"cache\"]){\n\t\t\t\n\t\t\t$this->clearCache();\n\t\t\t\n\t\t}\t\n\t\t\n\t\t//handle actual caching\n\t\tif($this->settings[\"super_cache\"] && $this->area != \"admin\"){\n\t\t\t\n\t\t\t$this->CMS->cache_dir = \"system/lib/php/smarty/page_cache\";\n\t\t\t\n\t\t\t$cached = $this->CMS->is_cached(\"main.tpl\",$this->pageUrl);\n\t\t\t\n\t\t\tif($cached){\n\t\t\t\t$this->CMS->display(\"main.tpl\",$this->pageUrl);\n\t\t\t\texit;\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t}",
"public function setUseCacheHash() : UriBuilder {}",
"function just_cache_home_page()\r\n{\r\n $blog_url = get_bloginfo('url') . '?page=1';\r\n $blog_home = ABSPATH;\r\n $html = file_get_contents($blog_url);\r\n $file = $blog_home . 'index.cache.html';\r\n file_put_contents($file, $html);\r\n}",
"public function servePage() {\n if (!$this->isEnabled()) {\n return;\n }\n\n Varien_Profiler::start('Brim_PageCache::servepage');\n\n self::$_start_time = microtime(true);\n\n //\n $cache = Mage::app()->getCache();\n $id = $this->generateFPCId();\n\n try {\n // Process Action Events\n $this->processFPCActions();\n\n $response = Mage::app()->getResponse();\n\n // Check for cached page\n $this->debug('Checking page cache with Id : ' . $id);\n //if (false && ($cachedData = $cache->load($id))) {\n if (empty($_REQUEST['FORCE_MISS']) && ($cachedData = $cache->load($id))) {\n $cachedStorage = unserialize($cachedData);\n if ($cachedStorage instanceof Brim_PageCache_Model_Storage) {\n\n /**\n * @var $cachedResponse Zend_Controller_Response_Http\n */\n $cachedResponse = $cachedStorage->getResponse();\n\n // Check page conditions\n if ($this->passesConditions($cachedStorage[self::RESPONSE_HEADER_CONDITIONS])) {\n\n $this->debug('Serving cached page.');\n\n $response->setHeader(self::RESPONSE_HEADER, self::CACHE_HIT);\n\n if (Mage::getStoreConfig(Brim_PageCache_Model_Config::XML_PATH_DEBUG_RESPONSE)) {\n $response->setHeader(\n self::RESPONSE_HEADER_EXPIRES_DATE,\n $cachedStorage[self::RESPONSE_HEADER_EXPIRES_DATE]\n );\n $response->setHeader(\n self::RESPONSE_HEADER_EXPIRES,\n $cachedStorage[self::RESPONSE_HEADER_EXPIRES]\n );\n $response->setHeader(\n self::RESPONSE_HEADER_CONDITIONS,\n $cachedStorage[self::RESPONSE_HEADER_CONDITIONS]\n );\n $response->setHeader(\n self::RESPONSE_HEADER_STORE,\n $cachedStorage[self::RESPONSE_HEADER_STORE]\n );\n $response->setHeader(\n self::RESPONSE_HEADER_ORIG_TIME,\n $cachedStorage[self::RESPONSE_HEADER_ORIG_TIME]\n );\n }\n\n // Apply cached response status header to current response\n foreach ($cachedResponse->getHeaders() as $header) {\n if (strcasecmp($header['name'], 'status') === 0) {\n $response->setHeader($header['name'], $header['value']);\n if (($responseCode = (int) $header['value']) > 0) {\n // response code must be parsed from the status header as the cached header\n // stores a 200 in http_response_code even when the page was a 404\n $response->setHttpResponseCode($responseCode);\n }\n } else if (strcasecmp($header['name'], 'location') === 0) {\n $response->setHeader($header['name'], $header['value']);\n }\n }\n\n // apply dynamic block updates\n $body = $cachedResponse->getBody();\n\n // Matches and updates block as needed.\n if (Mage::getStoreConfig(Brim_PageCache_Model_Config::XML_PATH_ENABLE_BLOCK_UPDATES)) {\n\n Varien_Profiler::start('Brim_PageCache::blockupdate');\n\n if (($_blockUpdateData = $cachedStorage->getBlockUpdateData()) != null) {\n $this->setBlockUpdateData($_blockUpdateData);\n }\n\n $newBody = preg_replace_callback(\n '/\\<!\\-\\- BRIM_FPC ([\\w\\d\\=\\+\\.\\_\\-]*) ([\\w\\d\\=\\+]*) \\-\\-\\>(.*)\\<!\\-\\- \\/BRIM_FPC \\1 \\-\\-\\>/si',\n 'Brim_PageCache_Model_Engine::applyDynamicBlockUpdates',\n $body\n );\n\n // Double check the new proccessed body content to ensure no fatal errors occurred in applyDynamicBlockUpdates\n if ($newBody !== null) { $body = $newBody; }\n\n Varien_Profiler::stop('Brim_PageCache::blockupdate');\n }\n\n $response->setBody($body);\n $response->sendResponse();\n\n // Dispatch post dispatch event which is used for\n // logging requests, visitors etc.\n try {\n $mockControllerAction = new Varien_Object(array(\n 'request' => Mage::app()->getRequest()\n ));\n Mage::dispatchEvent(\n 'controller_action_postdispatch',\n array('controller_action' => $mockControllerAction)\n );\n } catch(Exception $postEventException) {\n Mage::logException($postEventException);\n }\n\n Varien_Profiler::stop('Brim_PageCache::servepage');\n\n exit;\n } else {\n // failed conditions\n $response->setHeader(\n self::RESPONSE_HEADER_MISS,\n $this->_failed_conditions\n );\n }\n } else {\n $response->setHeader(\n self::RESPONSE_HEADER_MISS,\n 'invalid_object'\n );\n }\n }\n } catch (Exception $e) {\n Mage::logException($e);\n }\n\n $response = Mage::app()->getResponse();\n $response->setHeader(self::RESPONSE_HEADER, self::CACHE_MISS);\n\n Varien_Profiler::stop('Brim_PageCache::servepage');\n }",
"function nocacheUrl($url)\n {\n static $rand_num;\n\n require_once 'Horde/Browser.php';\n $browser = &Browser::singleton();\n\n /* We may need to set a dummy parameter 'nocache' since some\n * browsers do not always honor the 'no-cache' header. */\n if ($browser->hasQuirk('cache_same_url')) {\n if (!isset($rand_num)) {\n $rand_num = base_convert(microtime(), 10, 36);\n }\n return Util::addParameter($url, 'nocache', $rand_num);\n } else {\n return $url;\n }\n }",
"public function cache_path() {\r\n e_developer::assert($this->cache_dir,\"Cache directory is blank\");\r\n\r\n return $this->cache_dir.'/'.sha1($this->url);;\r\n }",
"public function configureCacheFrontEnd();",
"function page_cache_fastpath() {\n $page = mycache_fetch($base_root . request_uri(), 'cache_page');\n if (!empty($page)) {\n drupal_page_header();\n print $page;\n return TRUE;\n }\n}",
"function page_get_cache() {\n global $user, $base_root;\n\n $cache = NULL;\n\n if (!$user->uid && $_SERVER['REQUEST_METHOD'] == 'GET' && count(drupal_set_message()) == 0) {\n $cache = cache_get($base_root . request_uri());\n\n if (empty($cache)) {\n ob_start();\n }\n }\n\n return $cache;\n}",
"function elgg_get_simplecache_url($view, $subview = '') {\n\treturn _elgg_services()->simpleCache->getUrl($view, $subview);\n}",
"function getUrlContents($url) {\r\n $result = NULL;\r\n if ( !isset($_GET['nocache'])) {\r\n $result = read_from_cache($url, get_option(\"cache_time\"));\r\n }\r\n if(! $result) {\r\n $ch = curl_init( $url );\r\n curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 );\r\n curl_setopt( $ch, CURLOPT_POST, 1 );\r\n $result = @curl_exec( $ch );\r\n write_to_cache($result, $url);\r\n }\r\n return $result;\r\n}",
"private function getImageFromCache() {\r\n \r\n // get from cache\r\n if(file_exists(\"{$this->root}/{$this->cacheDir}/{$this->hashedFilename}\")) {\r\n header(\"Location: {$this->webRoot}/{$this->cacheDir}/{$this->hashedFilename}\");\r\n exit();\r\n \r\n //get from external URL\r\n } else {\r\n $this->getImageFromURL(); \r\n }\r\n \r\n return;\r\n }",
"public function setToCache();"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ Send Memo as mail to employees | function sendmail($id)
{
$get_memo_members = $this->Memo_model->get_all_memo_employees_emails($id);
$get_memo = $this->Memo_model->get_memo($id);
$employee="";
foreach($get_memo_members as $member)
{
if($member['email']!="")
$employee .= $member['email'].",";
}
$emp = rtrim($employee, ",");
$get_memo["description"];
$this->email->to("'".$emp."'");
$this->email->subject('Krisp interior: Memo');
$this->email->message($get_memo["description"]);
$this->email->send();
$this->session->set_flashdata('message','Mails sent successfully to Employees');
redirect('Memo/index');
} | [
"private static function send_mail_to_admin() {\n self::$mail->ClearAddresses();\n self::$mail->addAddress(\"registrazioni@retisenzafrontiere.org\", \"Reti Senza Frontiere\");\n\n self::$mail->Subject = \"Registrazione dal sito\";\n // Body text\n $content = \"Ciao,\\n\" . self::$personal_data[\"name\"] . \" \" . self::$personal_data[\"last_name\"] . \" ha appena fatto una registrazione dal sito.\\n\";\n if(self::$extra[\"net_membership_requested\"] == \"on\") {\n $content .= \"L'utente ha richiesto inoltre di entrare a far parte della Rete dell'Associazione.\\n\";\n }\n $content .= \"Controllate che il bonifico venga effettuato...\\n\\n\";\n $content .= \"\\n--=\\n\\nIl sito di Reti Senza Frontiere\";\n\n self::$mail->Body = $content;\n if(!self::$mail->send()) {\n // print 'Message could not be sent.';\n // print 'Mailer Error: ' . self::$mail->ErrorInfo;\n } else {\n // print 'Message has been sent';\n }\n }",
"public function sendEmailNotificationToAdmin()\n {\n $employeeRepo = new EmployeeRepository(new Employee);\n $employee = $employeeRepo->findEmployeeById(1);\n\n Mail::to($employee)\n ->send(new sendEmailNotificationToAdminMailable($this->findOrderById($this->model->id)));\n }",
"public function sendEmailToEmployer($data)\n {\n Mail::queue(new SendContactMailable($data));\n }",
"private function sendEmails()\r\n {\r\n $user_body = \"Hi,<br>A new comment was added to the following article:\\n\";\r\n $user_body .= '<a href=\"http://'.$this->config->getModuleVar('common', 'site_url').'/id_article/'.$this->viewVar['article']['id_article'].'\">'.$this->viewVar['article']['title'].\"</a>\\n\";\r\n\r\n $_tmp_error = array();\r\n $user_text_body = strip_tags($user_body);\r\n\r\n $this->model->action( 'common', 'mailSendTo',\r\n array('charset' => $this->viewVar['charset'],\r\n 'bodyHtml' => & $user_body,\r\n 'bodyText' => & $user_text_body,\r\n 'to' => array(array('email' => 'opublisher@gmail.com',\r\n 'name' => 'Armand Turpel')),\r\n 'subject' => \"Open Publisher Blog Entry\",\r\n 'fromEmail' => 'opublisher@gmail.com',\r\n 'fromName' => 'opublisher@gmail.com',\r\n 'error' => & $_tmp_error\r\n ));\r\n\r\n }",
"private function send_email_to_hr_manager()\n {\n Mail::to( $this->user_type_email('hr_manager') )->send( new SendEmailToHrManager() );\n }",
"public function mail()\n {\n $crud = new grocery_CRUD();\n $crud->set_table('mail');\n $output = $crud->render();\n\n $this->output($output);\n }",
"public function send() {\n $to = Yii::app()->params['adminEmail'];\n $subject = $this->subject;\n $message = $this->body;\n @mail($to, $subject, $message);\n }",
"public function send_mail_finance($emp_no){\n\t\t// get the auth from finance department\t\t\t\t\n\t\t\t$approval_data = $this->FinExpense->Home->find('all', array('fields' => array('email_address', 'first_name', 'last_name'), 'conditions'=> array('Home.hr_department_id' => '4', 'Home.status' => '1'), 'group' => array('Home.id')));\t\n\t\t\t\t\t\n\t\t\tif($this->request->data['FinExpense']['is_draft'] == 'N'){\n\t\t\t\t// when finance users available\n\t\t\t\tif(!empty($approval_data)){\n\t\t\t\t\t// get project and company\n\t\t\t\t\t$project_data = $this->FinExpense->TskProject->findById($this->request->data['FinExpense']['tsk_projects_id'], array('fields' => 'project_name'));\n\t\t\t\t\t$company_data = $this->FinExpense->TskCustomer->findById($this->request->data['FinExpense']['tsk_company_id'], array('fields' => 'company_name'));\t\t\t\t\t\n\t\t\t\t\t// iterate the fin. users\n\t\t\t\t\t\n\t\t\t\t\tforeach($approval_data as $fin_data){ \n\t\t\t\t\t\t$vars = array('from_name' => ucfirst($this->Session->read('USER.Login.first_name')).' '.ucfirst($this->Session->read('USER.Login.last_name')),'name' => $fin_data['Home']['first_name'].' '.$fin_data['Home']['last_name'], 'project' => $project_data['TskProject']['project_name'], 'company' => $company_data['TskCustomer']['company_name'], 'amt' => $this->tot_amount, 'exp_no' => $emp_no);\n\t\t\t\t\t\t// notify superiors\t\t\t\t\t\t\n\t\t\t\t\t\tif(!$this->send_email('My PDCA - '.ucfirst($this->Session->read('USER.Login.first_name')).' '.ucfirst($this->Session->read('USER.Login.last_name')).' submitted expense request!', 'expense_creation', 'noreply@mypdca.in', $fin_data['Home']['email_address'],$vars)){\t\n\t\t\t\t\t\t\t// show the msg.\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$this->Session->setFlash('<button type=\"button\" class=\"close\" data-dismiss=\"alert\">×</button>Problem in sending the mail...', 'default', array('class' => 'alert alert-error'));\t\t\t\t\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\t\t$this->Session->setFlash('<button type=\"button\" class=\"close\" data-dismiss=\"alert\">×</button>You have no superior to approve your request', 'default', array('class' => 'alert alert-info'));\n\t\t\t\t}\n\t\t\t}\n\t}",
"public function actionMail()\r\n {\r\n \\Yii::$app->mailer->compose()\r\n ->setFrom([\\Yii::$app->params['supportEmail'] => 'Orion test mail'])\r\n ->setTo('efisio.bova@gmail.com')\r\n ->setSubject('Verifica fnzionamento mail')\r\n ->setTextBody('Plain text content')\r\n ->setHtmlBody('<b>HTML content</b>')\r\n ->send();\r\n\r\n return $this->actionLog();\r\n }",
"abstract protected function _sendmail();",
"public function sendReportToMemberCare();",
"private function EmailUser(){\n //notifying them of the sale completion.\n }",
"public function guiMail()\n {\n $getContent = $this->Email->findById(3);\n $getContent['Email']['content'];\n $name = 'Name Company';\n $newContent = str_replace('#USER_NAME#', $name, $getContent['Email']['content']);\n $this->send_email('thanhle111@gmail.com', 'thanhle1286@gmail.com', 'Test Mail', $newContent);\n die;\n }",
"public function email()\n\t{\n\t\t// Load the Email library\n\t\t$this->load->library('email');\n\t\t\n\t\t// Get all the emails we want to send to.\n\t\t$emails = $this->admin_model->addresses();\n\n\t\t// Loop the emails\n\t\tforeach($emails as $email)\n\t\t{\n\t\t\t$this->email->clear(); // Since we are looping, we'll just clear the fields each time.\n\n\t\t\t$this->email->to($email['email']);\n\t\t\t$this->email->from('admin@vinticuffs.com','TaskManager Staff');\n\t\t\t$this->email->subject($this->input->post('subject'));\n\t\t\t$this->email->message($this->input->post('body'));\n\n\t\t\t// Away you go!\n\t\t\t$this->email->send();\n\t\t}\n\t\tredirect('admin/newsletter','refresh');\n\t}",
"public function test_send_email_to_personal()\n\t{\n\t\t//TODO: write later\t\n\t}",
"public function actionEmail()\n {\n $item = $this->model->getItem($this->model->getSavedVariable('last_stored_visit'));\n $body = $this->getVsisitEmailBody($item);\n $subject = '!MPROVE - Performance Dialog Observations - ' . $item->name . ' / ' . date('d M Y', $item->date_added);\n $this->sendItemEmail($body, $subject);\n }",
"public function emailMeAction() {\r\n\r\n //DEFAULT LAYOUT\r\n $this->_helper->layout->setLayout('default-simple');\r\n\r\n //GET VIEWER DETAIL\r\n $viewer = Engine_Api::_()->user()->getViewer();\r\n $viewr_id = $viewer->getIdentity();\r\n\r\n //GET STORE ID AND STORE OBJECT\r\n $this->view->store_id = $store_id = $this->_getParam('store_id', $this->_getParam('id', null));\r\n $sitestore = Engine_Api::_()->getItem('sitestore_store', $store_id);\r\n if (empty($sitestore))\r\n return $this->_forwardCustom('notfound', 'error', 'core');\r\n \r\n //AUTHORIZATION CHECK FOR TELL A FRIEND\r\n $isManageAdmin = Engine_Api::_()->sitestore()->isManageAdmin($sitestore, 'tfriend');\r\n if (empty($isManageAdmin)) {\r\n return $this->_forwardCustom('requireauth', 'error', 'core');\r\n }\r\n\r\n //FORM GENERATION\r\n $this->view->form = $form = new Sitestore_Form_EmailMe();\r\n\r\n if (!empty($viewr_id)) {\r\n $value['sender_email'] = $viewer->email;\r\n $value['sender_name'] = $viewer->displayname;\r\n $form->populate($value);\r\n }\r\n\r\n if ($this->getRequest()->isPost() && $form->isValid($this->getRequest()->getPost())) {\r\n\r\n $values = $form->getValues();\r\n\r\n //EDPLODES EMAIL IDS\r\n $reciver_ids = $sitestore->email; //explode(',', $values['sitestore_reciver_emails']);\r\n $values['sitestore_sender_email'] = $sitestore->email;\r\n if (!empty($values['sitestore_send_me'])) {\r\n $reciver_ids = $values['sitestore_sender_email'];\r\n }\r\n $sender_email = $values['sitestore_sender_email'];\r\n\r\n //CHECK VALID EMAIL ID FORMITE\r\n $validator = new Zend_Validate_EmailAddress();\r\n $validator->getHostnameValidator()->setValidateTld(false);\r\n\r\n if (!$validator->isValid($sender_email)) {\r\n $form->addError(Zend_Registry::get('Zend_Translate')->_('Invalid sender email address value'));\r\n return;\r\n }\r\n// foreach ($reciver_ids as $reciver_id) {\r\n// $reciver_id = trim($reciver_id, ' ');\r\n// if (!$validator->isValid($reciver_id)) {\r\n// $form->addError(Zend_Registry::get('Zend_Translate')->_('Please enter correct email address of the receiver(s).'));\r\n// return;\r\n// }\r\n// }\r\n $sender = $values['sitestore_sender_name'];\r\n $message = $values['sitestore_message'];\r\n $heading = ucfirst($sitestore->getTitle());\r\n Engine_Api::_()->getApi('mail', 'core')->sendSystem($reciver_ids, 'SITESTORE_EMAILME_EMAIL', array(\r\n 'host' => $_SERVER['HTTP_HOST'],\r\n 'sender_name' => $sender,\r\n 'store_title' => $heading,\r\n 'message' => '<div>' . $message . '</div>',\r\n 'object_link' => 'http://' . $_SERVER['HTTP_HOST'] . Engine_Api::_()->sitestore()->getHref($sitestore->store_id, $sitestore->owner_id, $sitestore->getSlug()),\r\n 'sender_email' => $sender_email,\r\n 'queue' => true\r\n ));\r\n\r\n $this->_forwardCustom('success', 'utility', 'core', array(\r\n 'smoothboxClose' => true,\r\n 'parentRefresh' => false,\r\n 'format' => 'smoothbox',\r\n 'messages' => array(Zend_Registry::get('Zend_Translate')->_('Your message to store owner has been sent successfully.'))\r\n ));\r\n }\r\n }",
"public function sendEmailNotificationToAdmin() {\n $employeeRepo = new EmployeeRepository(new Employee);\n $employee = $employeeRepo->findEmployeeById(1);\n\n return true;\n\n Mail::to($employee)\n ->send(new sendEmailNotificationToAdminMailable($this->findOrderById($this->model->id)));\n }",
"public function sendMail() {\n\t\t//get the job id\n\t\t$jobid = Input::get('jobid');\n\n\t\t//get the data off the commentor\n\t\t$commentor = Auth::user()->PK_userId;\n\t\t$commentorName = Auth::user()->name;\n\n\t\t//get the job and his owner\n\t\t$job = Job::find($jobid);\n\t\t$user = User::find($job->FK_userId);\n\t\t\n\t\t//store the user info in varibales\n\t\t$name = $user->name;\n\t\t$email = $user->email;\n\n\t\t//get the comment\n\t\t$comment = Input::get('comment');\n\n\t\t//set the data to use in the email ready\n\t\t$data = array(\n\t\t\t'name' \t\t\t\t=> $name,\n\t\t\t'email'\t\t\t\t=> $email,\n\t\t\t'commentorName'\t\t=> $commentorName,\n\t\t\t'comment' \t\t\t=> $comment,\n\t\t\t'jobid'\t\t\t\t=> $jobid\n\t\t);\n\t\t\t\n\t\t//send the owner off the job to notify him there is a new comment on his job\n\t\tMail::send('emails.comment', $data , function($message) use($email, $name) {\n\t\t\t$message->to($email, $name)->subject('You got a new comment on youre job'); \n\t\t});\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the customer return URL on canceled payment | public function getCustomerCancelUrl() {
return $this->_customerCancelUrl;
} | [
"public function getPaymentCancelUrl()\n {\n if (static::EC_TYPE_MARK == \\XLite\\Core\\Session::getInstance()->ec_type) {\n $url = $this->getReturnURL(null, true, true);\n\n } else {\n $url = \\XLite::getInstance()->getShopURL(\n \\XLite\\Core\\Converter::buildURL('checkout', 'express_checkout_return', ['cancel' => 1]),\n \\XLite\\Core\\Config::getInstance()->Security->customer_security\n );\n }\n\n if (\\XLite\\Core\\Request::getInstance()->cancelUrl) {\n $url .= '&cancelUrl=' . urlencode(\\XLite\\Core\\Request::getInstance()->cancelUrl);\n }\n\n return $url;\n }",
"abstract protected function _getCancelReturnUrl();",
"public function getCancelUrl() {\n return $this->getReturnUrl();\n }",
"public function getReturnUrlCancel()\n {\n return $this->returnUrlCancel;\n }",
"public function getPayPalCancelURL()\n {\n }",
"function get_cancel_url() {\n\t\t$order = get_order();\n\t\treturn ( $order ) ? get_post_meta( $order->get_id(), 'cancel_url', true ) : '';\n\t}",
"protected function getReturnUrl(): string\n {\n return $this->urlGenerator->generate(\n 'payment_done',\n [],\n UrlGeneratorInterface::ABSOLUTE_URL\n );\n }",
"protected function get_return_url() {\n $location = add_query_arg( array(\n 'sessionid' => $this->purchase_log->get( 'sessionid' ),\n 'payment_gateway' => 'paypal-express-checkout',\n 'payment_gateway_callback' => 'confirm_transaction',\n ),\n get_option( 'transact_url' )\n );\n return apply_filters( 'wpsc_paypal_express_checkout_return_url', $location, $this );\n }",
"public static function getCanceledUrl()\n {\n return self::get('canceled_url');\n }",
"public function get_cancel_url() {\n\t\treturn $this->get_field( Pronamic_Pay_Gateways_Ogone_Parameters::CANCEL_URL );\n\t}",
"protected function getReturnUrl()\n {\n }",
"function get_cancel_order_url() {\n\t\tglobal $cmdeals;\n\t\treturn $cmdeals->nonce_url( 'cancel_order', add_query_arg('cancel_order', 'true', add_query_arg('order', $this->order_key, add_query_arg('order_id', $this->id, trailingslashit( home_url() )))));\n\t}",
"public function get_return_url() {\n\t\t$url = add_query_arg(\n\t\t\tarray(\n\t\t\t\t'payment' => $this->id,\n\t\t\t\t'key' => $this->key,\n\t\t\t),\n\t\t\thome_url( '/' )\n\t\t);\n\n\t\treturn $url;\n\t}",
"public function getCustomerUrl()\n {\n return Mage::helper('postfinancecheckout_payment')->getBaseGatewayUrl() . '/s/' .\n $this->getTransactionInfo()->getSpaceId() . '/payment/customer/transaction/view/' .\n $this->getTransactionInfo()->getTransactionId();\n }",
"public function get_cancel_url()\n {\n return $this->cancel_url;\n }",
"protected function _getCancelUrl()\n {\n return $this->getUrl('*/*/cancel', array('agreement' => $this->_getBillingAgreement()->getAgreementId()));\n }",
"public function getReturnUrl()\n {\n return $this->_urlBuilder->getUrl('dilmah_payments/globalPay/return');\n }",
"function the_order_cancel_url( $order_id = null ) {\n\techo get_the_order_cancel_url( $order_id );\n}",
"public function getCancelUrl(): string\n {\n return $this->_urlBuilder->getUrl('monei/order/cancel');\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Submit handler to update changed profile field weights and categories. | function profile_admin_overview_submit($form, &$form_state) {
foreach (element_children($form_state['values']) as $fid) {
if (is_numeric($fid)) {
$weight = $form_state['values'][$fid]['weight'];
$category = $form_state['values'][$fid]['category'];
if ($weight != $form[$fid]['weight']['#default_value'] || $category != $form[$fid]['category']['#default_value']) {
db_update('profile_field')
->fields(array(
'weight' => $weight,
'category' => $category,
))
->condition('fid', $fid)
->execute();
}
}
}
drupal_set_message(t('Profile fields have been updated.'));
cache_clear_all();
menu_rebuild();
} | [
"public function onMemberProfileUpdate()\n {\n // Save custom fields and contact data\n $this->saveCustomFieldData();\n $this->saveContactData();\n $this->saveUserLogins();\n // If configured, override user email with main contact\n if (isset($this->configuration['mainContactMap'])) {\n $this->syncMainContactEmail();\n }\n // If configured, merge a specified custom field into the display_name\n if (isset($this->configuration['misc']['syncDisplayNameField'])) {\n $this->syncDisplayName();\n }\n\n // At last, make sure to flush user cache, as we may do database edits\n clean_user_cache($this->editedUserId);\n }",
"private function userProfileUpdate(){\n }",
"public function updateProfile() {\n \n $this->User_model->updateProfile();\n }",
"public function updated(Profile $profile)\n {\n //\n }",
"public function testUpdateProfile()\n {\n }",
"protected function _postUpdate()\n {\n \t$pinTable = new \\Pin\\Pin();\n \t$userTable = new \\User\\User();\n \t$wishlistTable = new \\Wishlist\\Wishlist();\n \tif(array_key_exists('category_id', $this->_modifiedFields)) {\n \t\t$pinTable->update(array('category_id' => $this->category_id), array(\n \t\t\t'wishlist_id = ?' => $this->id\t\t\n \t\t));\n \t}\n \t\n \t$userTable->updateInfo($this->user_id);\n \t$wishlistTable->updateInfo($this->id);\n }",
"public function handleSubmitChanges() {\n //get data\n $id = $_REQUEST['id'];\n $columnId = $_REQUEST['columnId'];\n \n //program type\n if ($columnId == 11) {\n $newValue = $_REQUEST['value'];\n \n $numberOfReferrers = $this->db_users->getNumberOfUsersReferrers(intval($id));\n $referralBonus = $numberOfReferrers * $this->referralBonusValuePerItem;\n if (($referralBonus - $newValue) > 0) {\n $this->db_users->updateUsersUsedReferralBonus(intval($id), $newValue);\n }\n } \n \n if (!$this->isAjax()) {\n $this->redirect('this');\n } else { \n $this->terminate(); \n $this->invalidateControl('jEditable');\n } \n }",
"function processTeacherUpdate()\n {\n updateTeacherProfile();\n }",
"public function updated(profile $profile)\n {\n //\n }",
"protected function postUpdate() {}",
"function profile_update() {\n\t\t\t$current_user = wp_get_current_user();\n\t\t\tif ( ! $current_user->ID ) {\n\t\t\t\tthrow new Exception( 'Janrain Capture: Must be logged in to update profile' );\n\t\t\t}\n\t\t\t$user_id = $current_user->ID;\n\t\t\t$api = new JanrainCaptureApi();\n\t\t\t$user_entity = $api->load_user_entity();\n\t\t\tif ( is_array( $user_entity ) ) {\n\t\t\t\tif ( ! $api->update_user_meta( $user_id ) ) {\n\t\t\t\t\tthrow new Exception( 'Janrain Capture: Failed to update user meta' );\n\t\t\t\t}\n\t\t\t\t$user_entity = $user_entity['result'];\n\t\t\t\tdo_action( self::$name . '_user_entity_loaded', $user_entity );\n\t\t\t\tif ( ! $this->update_user_data( $user_id, $user_entity ) ) {\n\t\t\t\t\tthrow new Exception( 'Janrain Capture: Failed to update user data' );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tthrow new Exception( 'Janrain Capture: Could not retrieve user entity' );\n\t\t\t}\n\t\t\techo '1';\n\t\t\tdie();\n\t\t}",
"public function update_profile($profile_data) \r\n\t{\r\n\t\t$id = $profile_data[0]['value'];\r\n\t\t$completed = 0;\r\n\t\t\r\n\t\t$update_data = array();\r\n\r\n\t\tforeach ($profile_data as $key => $value)\r\n\t\t{\r\n\t\t\tif ($value['name'] == 'username') continue;\r\n\r\n\t\t\t// passing in serialized form data. so the field names need to be converted to db values in some cases\r\n\t\t\tif ($value['name'] == 'category')\r\n\t\t\t{\r\n\t\t\t\t$update_data['category_id'] = $value['value'];\r\n\t\t\t}\r\n\t\t\telse if ($value['name'] == 'family')\r\n\t\t\t{\r\n\t\t\t\t$update_data['family_id'] = $value['value'];\r\n\t\t\t}\r\n\t\t\telse if ($value['name'] == 'eco_system')\r\n\t\t\t{\r\n\t\t\t\t$update_data['eco_system_id'] = $value['value'];\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tif ($value['value'] == 'on')\r\n\t\t\t\t{\r\n\t\t\t\t\t$value['value'] = 1;\r\n\t\t\t\t\tif ($value['name'] == 'completed') $completed = 1;\r\n\t\t\t\t}\r\n\t\t\t\telse if ($value['value'] == 'off') $value['value'] = 0;\r\n\t\t\t\t$update_data[$value['name']] = $value['value'];\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (!isset($update_data['swim_region_bottom']))\r\n\t\t{\r\n\t\t\t$update_data['swim_region_bottom'] = 0;\r\n\t\t}\r\n\r\n\t\tif (!isset($update_data['swim_region_middle']))\r\n\t\t{\r\n\t\t\t$update_data['swim_region_middle'] = 0;\r\n\t\t}\r\n\r\n\t\tif (!isset($update_data['swim_region_top']))\r\n\t\t{\r\n\t\t\t$update_data['swim_region_top'] = 0;\r\n\t\t}\r\n\r\n\t\t$this->db->where('id', $id);\r\n\t\t$this->db->update('profiles_fish', $update_data);\r\n\t\t\r\n\t\t// log the profile update\r\n\t\tif ($this->db->affected_rows())\r\n\t\t{\r\n\t\t\t$this->track_update($id, $completed);\r\n\t\t}\r\n\t}",
"function on_profile_update($member = array())\r\n\t{\r\n\t\tglobal $std, $ibforums;\r\n\r\n\t\t//---- START\r\n\r\n\t\t//---- END\r\n\t}",
"function dogfuelMassUpdate(){\n $currentUser = $this->Session->read('userID');\n\tif($currentUser != null){\n $this->set('currentUser', $currentUser);\n\t\t\n $this->loadModel('DogfuelRule');\n \t\n //on submit\n if (!empty($this->request->data)){\n $walk = $this->request->data['DogfuelRule']['walk'];\n $play = $this->request->data['DogfuelRule']['play'];\n $rows = $this->DogfuelRule->doMassUpdate($walk, $play);\n \n if($rows > 0){\n $this->set('notification', 'Dog fuel rules successfully updated.');\n $this->redirect(array('action' => 'dogfuelView'));\n } else {\n $this->set('error', 'Unable to update the dogfuel rules - please try again.');\n }\n }\n\t} else {\n $this->requireLogin(\"/Configurations/dogfuelView\");\n\t}\n }",
"function opensanmateo_sitecrawler_admin_form_submit($form, &$form_state) {\n // Because the form elements were keyed with the item ids from the database,\n // this can simply iterate through the submitted values.\n foreach ($form_state['values']['crawlers'] as $id => $item) {\n db_query(\n \"UPDATE {opensanmateo_sitecrawler_sites} SET weight = :weight WHERE id = :id\",\n array(':weight' => $item['weight'], ':id' => $id)\n );\n }\n}",
"function update() {\n\t\tif ( $this->getUser()->isModified() ) {\n\t\t\ttry {\n\t\t\t\t$res = $this->getUser()->save();\n\t\t\t\tif ( $res ) {\n\t\t\t\t\t$this->setMessage('Profile updated successfully');\n\t\t\t\t\t$this->setUpdated(true);\n\t\t\t\t} else {\n\t\t\t\t\t$this->setMessage('Profile update failed');\n\t\t\t\t}\n\t\t\t} catch ( Exception $e ) {\n\t\t\t\t$this->setMessage('Profile update failed: '.$e->getMessage());\n\t\t\t}\n\t\t} else {\n\t\t\t$this->setMessage('No updates to make to profile');\n\t\t\t$this->setUpdated(0);\n\t\t}\n\t}",
"function update() \n {\n if(strtolower($this->name) == @$_POST['post_type']) \n {\n //set custom fields with posted value\n HTTP::setPostVars($this->Fields());\n \n $id = $_POST['post_ID'];\n \n $this->save($id);\n }\n }",
"public function updateProfile()\n {\n $currentUser = (new MemberUser())->getLoggedIn();\n\n $inputs = (new Request('POST'))->getInputs();\n\n if ($currentUser instanceof MemberUser) {\n $output = (new MemberUserMapper())->updateById($currentUser->getId(), $inputs);\n\n echo $output->toJSON();\n }\n }",
"public function update() {\n\t\t\n\t\tif ( ($this->user_id == 0) || ($this->package_id == 0) ) { return false; }\n\t\t\n\t\t$rate_action = get_query_var( 'rate', '');\n\t\t\n\t\tswitch ( $rate_action ) {\n\t\t\tcase 'coolfoto':\n\t\t\t\t$this->add_rating('coolfoto');\n\t\t\t\tbreak;\n\t\t\tcase 'no_coolfoto':\n\t\t\t\t$this->remove_rating('coolfoto');\n\t\t\t\tbreak;\n\t\t\tcase 'goodwork':\n\t\t\t\t$this->add_rating('goodwork');\n\t\t\t\tbreak;\n\t\t\tcase 'no_goodwork':\n\t\t\t\t$this->remove_rating('goodwork');\n\t\t\t\tbreak;\n\t\t\tcase 'nicetext':\n\t\t\t\t$this->add_rating('nicetext');\n\t\t\t\tbreak;\n\t\t\tcase 'no_nicetext':\n\t\t\t\t$this->remove_rating('nicetext');\n\t\t\t\tbreak;\n\t\t\tcase 'mething':\n\t\t\t\t$this->add_rating('mething');\n\t\t\t\tbreak;\n\t\t\tcase 'no_mething':\n\t\t\t\t$this->remove_rating('mething');\n\t\t\t\tbreak;\n\t\t}\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Modified genesis_get_custom_field() to accept arrays in custom fields These functions can be used to easily and efficiently pull data from a post/page custom field. Returns FALSE if field is blank or not set. | function gg_get_custom_field($field, $single = false) {
global $id, $post;
if ( null === $id && null === $post ) {
return false;
}
$post_id = null === $id ? $post->ID : $id;
$custom_field = get_post_meta( $post_id, $field, $single );
if ( ( $custom_field ) && ( !is_array($custom_field) ) ) {
/** sanitize and return the value of the custom field */
return stripslashes( wp_kses_decode_entities( $custom_field ) );
}
elseif ( ( $custom_field ) && ( is_array($custom_field) ) ) {
foreach ( $custom_field as $key => $value ) {
$custom_field[$key] = stripslashes( wp_kses_decode_entities( $value ) );
}
return $custom_field;
}
else {
/** return false if custom field is empty */
return false;
}
} | [
"function has_acf_field( $field ) {\r\n\r\n $term = get_queried_object();\r\n\r\n $id = isset( $term->taxonomy )\r\n ? $term->term_id\r\n : get_the_ID();\r\n\r\n $value = get_post_meta( $id, $field );\r\n\r\n if ( is_array( $value ) )\r\n $value = array_filter( $value );\r\n\r\n\t\tif ( isset( $value ) && ! empty( $value ) )\r\n\t\t\treturn true;\r\n\r\n return false;\r\n\t}",
"function gpc_isset_custom_field( $p_var_name, $p_custom_field_type ) {\n\t$t_field_name = 'custom_field_' . $p_var_name;\n\n\tswitch ($p_custom_field_type ) {\n\t\tcase CUSTOM_FIELD_TYPE_DATE:\n\t\t\t// date field is three dropdowns that default to 0\n\t\t\t// Dropdowns are always present, so check if they are set\n\t\t\treturn gpc_isset( $t_field_name . '_day' ) &&\n\t\t\t\tgpc_get_int( $t_field_name . '_day', 0 ) != 0 &&\n\t\t\t\tgpc_isset( $t_field_name . '_month' ) &&\n\t\t\t\tgpc_get_int( $t_field_name . '_month', 0 ) != 0 &&\n\t\t\t\tgpc_isset( $t_field_name . '_year' ) &&\n\t\t\t\tgpc_get_int( $t_field_name . '_year', 0 ) != 0 ;\n\t\tcase CUSTOM_FIELD_TYPE_STRING:\n\t\tcase CUSTOM_FIELD_TYPE_NUMERIC:\n\t\tcase CUSTOM_FIELD_TYPE_FLOAT:\n\t\tcase CUSTOM_FIELD_TYPE_ENUM:\n\t\tcase CUSTOM_FIELD_TYPE_EMAIL:\n\t\t\treturn gpc_isset( $t_field_name ) && !is_blank( gpc_get_string( $t_field_name ) );\n\t\tdefault:\n\t\t\treturn gpc_isset( $t_field_name );\n\t}\n}",
"function etheme_get_query_custom_field($field){\n $page = get_query_var('et_page-id');\n $page_id = ( isset( $page['id'] ) ) ? $page['id'] : false;\n\n if ( $page_id ) {\n $field = etheme_get_custom_field($field, $page_id);\n }else{\n $field = false;\n }\n\n return $field;\n}",
"function etheme_get_query_custom_field($field){\n\t$page = get_query_var('et_page-id', array( 'id' => 0, 'type' => 'page' ));\n\t$page_id = ( isset( $page['id'] ) ) ? $page['id'] : false;\n\n\tif ( $page_id ) {\n\t\t$field = etheme_get_custom_field($field, $page_id);\n\t}else{\n\t\t$field = false;\n\t}\n\n\treturn $field;\n}",
"function acf_get_valid_field( $field = \\false ) {\n}",
"private function determine_field_value($_meta, $_id = 0) {\r\n\t $mval = false;\r\n\t /**\r\n\t * We are assuming that here the user will use whatever the Admin Fields that is placed for the product page\r\n\t * not on the Product Taxonomies page or Admin Fields for variable sections. because it doesn't make any sense.\r\n\t * and if they do then we have a problem here\r\n\t */\r\n\t if (metadata_exists(\"post\", $_id, \"wccaf_\". $_meta[\"name\"])) {\r\n\t $mval = get_post_meta($_id, \"wccaf_\". $_meta[\"name\"], true);\r\n\t /* Incase of checkbox - the values has to be deserialzed as Array */\r\n\t if ($_meta[\"type\"] == \"checkbox\") {\r\n\t $mval = explode(',', $mval);\r\n\t }\r\n\t } else {\r\n\t /* This will make sure the following section fill with default value instead */\r\n\t $mval = false;\r\n\t }\r\n\t /* We can trust this since we never use boolean value for any meta\r\n\t * instead we use 'yes' or 'no' values */\r\n\t if (!$mval) {\r\n\t /* Value is not there - probably this field is not yet saved */\r\n\t if ($_meta[\"type\"] == \"checkbox\") {\r\n\t $d_choices = array();\r\n\t if ($_meta[\"default_value\"] != \"\") {\r\n\t $choices = explode(\";\", $_meta[\"default_value\"]);\r\n\t if (is_array($choices)) {\r\n\t foreach ($choices as $choice) {\r\n\t $d_value = explode(\"|\", $choice);\r\n\t $d_choices[] = $d_value[0];\r\n\t }\r\n\t }\r\n\t }\r\n\t $mval = $d_choices;\r\n\t } else if ($_meta[\"type\"] == \"radio\" || $_meta[\"type\"] == \"select\") {\r\n\t $mval = \"\";\r\n\t if ($_meta[\"default_value\"] != \"\") {\r\n\t $d_value = explode(\"|\", $_meta[\"default_value\"]);\r\n\t $mval = $d_value[0];\r\n\t }\r\n\t } else {\r\n\t /* For rest of the fields - no problem */\r\n\t $mval = isset($_meta[\"default_value\"]) ? $_meta[\"default_value\"] : \"\";\r\n\t }\r\n\t }\r\n\t return $mval;\r\n\t}",
"function get_alps_field( $field, $id = NULL ) {\n global $post;\n if ( empty( $id ) ) {\n $id = get_queried_object_id();\n }\n $cf = get_option( 'alps_cf_converted' );\n if ( !empty( $cf ) ) {\n $field_data = carbon_get_post_meta( $id, $field );\n if ( !empty( $field_data ) ) {\n if ( is_array( $field_data ) ) {\n if ( count( $field_data ) === 1 ) {\n return $field_data[0];\n } else {\n // RETURN COMPLETE ARRAY\n return $field_data;\n }\n }\n }\n else {\n return $field_data;\n }\n } else { // PIKLIST\n return get_post_meta( $id, $field, true );\n }\n}",
"private function _load_custom_fields()\n {\n if (!$this->use_custom_fields) {\n return false;\n }\n \n $fields = $this->CI->db\n ->select('name, value')\n ->get_where('users_meta', array('users_meta.user_id'=>$this->get_id()))\n ->result();\n \n $custom_data = array();\n \n foreach ($fields as $field) {\n $custom_data[$field->name] = $field->value;\n }\n \n $this->custom_data = $custom_data;\n }",
"function\n\tHasData($field)\n\t{\n\t\treturn (isset($this->_fields[0]->{$field})\n\t\t\t&& $this->_fields[0]->{$field} != \"\");\n\t}",
"public function validate_custom_meta( $field ) {\r\n\r\n\t\t/*\r\n\t\t * Number of keys is limited to 50.\r\n\t\t * Interface should control this, validating just in case.\r\n\t\t * Key names have maximum length of 40 characters.\r\n\t\t */\r\n\r\n\t\t// Get metadata from posted settings.\r\n\t\tif ( $this->_has_settings_renderer ) {\r\n\t\t\t$settings = $this->get_settings_renderer()->get_posted_values();\r\n\t\t} else {\r\n\t\t\t$settings = $this->get_posted_settings();\r\n\t\t}\r\n\r\n\t\t$meta_data = ! empty( $settings['metaData'] ) ? $settings['metaData'] : '' ;\r\n\r\n\t\t// If metadata is not defined, return.\r\n\t\tif ( empty( $meta_data ) ) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// Get number of metadata items.\r\n\t\t$meta_count = count( $meta_data );\r\n\r\n\t\t// If there are more than 50 metadata keys, set field error.\r\n\t\tif ( $meta_count > 50 ) {\r\n\t\t\t$meta_count_error = array( esc_html__( 'You may only have 50 custom keys.' ), 'gravityformsstripe' );\r\n\t\t\t$this->set_field_error( $meta_count_error );\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t$custom_meta_field = array( 'name' => 'metaData' );\r\n\t\t// Loop through metadata and check the key name length (custom_key).\r\n\t\tforeach ( $meta_data as $meta ) {\r\n\t\t\tif ( empty( $meta['custom_key'] ) && ! empty( $meta['value'] ) ) {\r\n\t\t\t\t$this->set_field_error( $custom_meta_field, esc_html__( \"A field has been mapped to a custom key without a name. Please enter a name for the custom key, remove the metadata item, or return the corresponding drop down to 'Select a Field'.\", 'gravityformsstripe' ) );\r\n\t\t\t\tbreak;\r\n\t\t\t} else if ( strlen( $meta['custom_key'] ) > 40 ) {\r\n\t\t\t\t$this->set_field_error( $custom_meta_field, sprintf( esc_html__( 'The name of custom key %s is too long. Please shorten this to 40 characters or less.', 'gravityformsstripe' ), $meta['custom_key'] ) );\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t}",
"public function has_custom_fields() {\n\n\t\tif ( ! empty( $this->custom_fields ) ) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}",
"function acf_get_valid_field( $field = false ) {\n\t\n\t// $field must be an array\n\tif( !is_array($field) ) $field = array();\n\t\n\t\n\t// bail ealry if already valid\n\tif( !empty($field['_valid']) ) return $field;\n\t\n\t\n\t// defaults\n\t$field = wp_parse_args($field, array(\n\t\t'ID'\t\t\t\t=> 0,\n\t\t'key'\t\t\t\t=> '',\n\t\t'label'\t\t\t\t=> '',\n\t\t'name'\t\t\t\t=> '',\n\t\t'prefix'\t\t\t=> '',\n\t\t'type'\t\t\t\t=> 'text',\n\t\t'value'\t\t\t\t=> null,\n\t\t'menu_order'\t\t=> 0,\n\t\t'instructions'\t\t=> '',\n\t\t'required'\t\t\t=> 0,\n\t\t'id'\t\t\t\t=> '',\n\t\t'class'\t\t\t\t=> '',\n\t\t'conditional_logic'\t=> 0,\n\t\t'parent'\t\t\t=> 0,\n\t\t'wrapper'\t\t\t=> array(),\n\t\t'_name'\t\t\t\t=> '',\n\t\t'_prepare'\t\t\t=> 0,\n\t\t'_valid'\t\t\t=> 0,\n\t));\n\t\n\t$field['wrapper'] = wp_parse_args($field['wrapper'], array(\n\t\t'width'\t\t\t\t=> '',\n\t\t'class'\t\t\t\t=> '',\n\t\t'id'\t\t\t\t=> ''\n\t));\n\t\n\t\n\t// _name\n\t$field['_name'] = $field['name'];\n\t\n\t\n\t// field is now valid\n\t$field['_valid'] = 1;\n\t\n\t\n\t// field specific defaults\n\t$field = apply_filters( \"acf/validate_field\", $field );\n\t$field = apply_filters( \"acf/validate_field/type={$field['type']}\", $field );\n\t\n\t\n\t// translate\n\t$field = acf_translate_field( $field );\n\t\n\t\n\t// return\n\treturn $field;\n\t\n}",
"public function isCustomFields()\n\t\t{\n\t\t\treturn count($this->_custom_fields) ? true : false;\n\t\t}",
"function cw_tool_get_value_in_an_object_or_array_field_collection_field($field_collection_item, $field_name) {\n if (isset($field_collection_item['value'])) {\n $field_collection = entity_load_single('field_collection_item', $field_collection_item['value']);\n if (isset($field_collection->{$field_name}[LANGUAGE_NONE][0])) {\n return $field_collection->{$field_name}[LANGUAGE_NONE][0];\n }\n }\n elseif (isset($field_collection_item[$field_name][LANGUAGE_NONE][0])) {\n return $field_collection_item[$field_name][LANGUAGE_NONE][0];\n }\n\n return NULL;\n}",
"function acf_validate_field($field = array())\n{\n}",
"public function getCustomFields() { return $this->data['customFields']; }",
"function types_get_field_meta_value( $field, $post_id = null, $raw = false ) {\n return wpcf_api_field_meta_value( $field, $post_id, $raw );\n}",
"public function getCustomTipField(): ?bool\n {\n if (count($this->customTipField) == 0) {\n return null;\n }\n return $this->customTipField['value'];\n }",
"function get_sub_field( $field_name ) {\n\n // no field?\n if( empty($GLOBALS['acf_field']) )\n {\n return false;\n }\n\n\n // vars\n $row = end( $GLOBALS['acf_field'] );\n\n\n // return value\n if( isset($row['value'][ $row['i'] ][ $field_name ]) )\n {\n return $row['value'][ $row['i'] ][ $field_name ];\n }\n\n\n // return false\n return false;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Stores a version of a resource in the change stream. | protected function storeVersion(PuliResource $resource)
{
if (null !== $this->changeStream) {
$this->changeStream->append($resource);
}
} | [
"protected function _StoreVersion()\r\n {\r\n $this->cacheHandler->set($this->getTagName(),$this->version);\r\n }",
"public function store(int $version)\n {\n $this->filesystem->put($this->filename, $version);\n }",
"public function saveTransactionResource($resource)\n\t{\n\t\t$path = $this->getTransactionResourcePath($resource->getHash());\n\t\t$this->filesystem()->put($path, serialize($resource));\n\t}",
"public function updateStream($resource);",
"public function publishPersistentResource(\\TYPO3\\Flow\\Resource\\Resource $resource);",
"public function save($resource);",
"public function storeVersion(): void\n {\n try {\n $this->cache->setItem('browscap.version', $this->iniVersion, false);\n } catch (InvalidArgumentException $e) {\n $this->logger->error(new \\InvalidArgumentException('an error occured while writing the data version into the cache', 0, $e));\n }\n }",
"function createNewVersion() {\n\t\t$this->obj->setVersion($this->obj->getVersion() + 1);\n\t\tilHistory::_createEntry($this->obj->getId(), \"replace\",\n\t\t\t$this->obj->getFileName().\",\".$this->obj->getVersion());\n\t}",
"public function save($resource) {\n $stmt = $this->db->prepare(\"INSERT INTO resource (id, name, description, quantity, type)\n values (0,?,?,?,?)\");\n $stmt->execute(array($resource->getName(),$resource->getDescription(),$resource->getQuantity(),\n $resource->getType()));\n }",
"public function setVersion($version) {}",
"public function save($resource, $destination);",
"public function updated(Resource $resource)\n {\n //\n }",
"function setcommittedversion($parameter){}",
"function setVersion($version);",
"public function updateResourceIndex(&$resource) {\n if ($this->connector != null) {\n \n // STEP 1: Update or insert this identity as a node:\n $this->logger->addDebug(\"Updating/Inserting Node into Neo4J database\"); \n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} }) SET a.title = {title}, a.version = {version}, a.href = {href}\n return a;\", \n [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n );\n\n // Check to see if anything was added\n $records = $result->getRecords(); \n if (empty($records)) {\n // Must create this record instead\n $result = $this->connector->run(\"CREATE (n:Resource) SET n += {infos};\", \n [\n \"infos\" => [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n ]\n );\n }\n } \n }",
"public function updateResourceIndex(&$resource) {\n if ($this->connector != null) {\n\n // STEP 1: Update or insert this resource as a node:\n $this->logger->addDebug(\"Updating/Inserting Node into Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} }) SET a.title = {title}, a.version = {version}, a.href = {href}\n return a;\",\n [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n );\n\n // Check to see if anything was added\n $records = $result->getRecords();\n if (empty($records)) {\n // Must create this record instead\n $result = $this->connector->run(\"CREATE (n:Resource) SET n += {infos};\",\n [\n \"infos\" => [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n ]\n );\n }\n\n // STEP 2: Update or insert the resource's link to holding repository\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} })-[r:HIRELATION]->()\n return r;\",\n [\n 'id' => $resource->getID(),\n ]\n );\n $records = $result->getRecords();\n if (!empty($records)) {\n // delete the one there so that we can add the correct one (just in case)\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}})-[r:HIRELATION]->() delete r;\",\n [\n 'id' => $resource->getID()\n ]\n );\n\n }\n\n // If resource has a repository, then add a link\n if ($resource->getRepository() != null && $resource->getRepository()->getID() != null) {\n $this->connector->run(\"MATCH (a:Identity {id: {id1} }) MATCH (b:Resource {id: {id2} }) CREATE (b)-[r:HIRELATION]->(a);\",\n [\n 'id1' => (string) $resource->getRepository()->getID(),\n 'id2' => $resource->getID()\n ]);\n }\n }\n }",
"public function updateStream($path, $resource, array $config = []);",
"public function publishPersistentResource(\\F3\\FLOW3\\Resource\\Resource $resource, $title = '');",
"protected function incrementVersion(): void\n {\n $version = $this->getVersion() + 1;\n\n $this->store->put($this->getCacheVersionKey(), $version, $this->lifetime);\n\n static::$versions[$this->name] = $version;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Processing the cloning action. | public function action_cloning(): void {
$redirect_url = admin_url( 'edit.php?post_type=' . learndash_get_post_type_slug( $this->get_cloning_object() ) );
// request validation.
if ( ! isset( $_GET['object_id'] ) || ! isset( $_GET['nonce'] ) ) {
Learndash_Admin_Action_Scheduler::add_admin_notice( __( 'Invalid request.', 'learndash' ), 'error', 0, $redirect_url );
}
// nonce validation.
$object_id = absint( sanitize_text_field( wp_unslash( $_GET['object_id'] ) ) );
if ( ! wp_verify_nonce( sanitize_text_field( wp_unslash( $_GET['nonce'] ) ), $this->get_cloning_action_name() . $object_id ) ) {
Learndash_Admin_Action_Scheduler::add_admin_notice( __( 'Request expired. Please try it again.', 'learndash' ), 'error', $object_id, $redirect_url );
}
// object validation.
$object = ! empty( $object_id ) ? get_post( $object_id ) : false;
if ( empty( $object ) || learndash_get_post_type_slug( $this->get_cloning_object() ) !== $object->post_type ) {
// translators: placeholder: object name.
Learndash_Admin_Action_Scheduler::add_admin_notice( sprintf( __( 'Invalid LearnDash %s.', 'learndash' ), $this->get_cloning_object() ), 'error', $object_id, $redirect_url );
}
// check if we should run the cloning now.
if ( $this->run_clone_immediately( $object ) ) {
$this->cloning_task( $object->ID, get_current_user_id() );
} else {
// enqueue the cloning task.
Learndash_Admin_Action_Scheduler::add_admin_notice(
sprintf(
// translators: placeholder: current object link, new object name.
__( 'The cloning of %1$s into %2$s is scheduled. Please refresh this page to see the progress.', 'learndash' ),
'<a href="' . get_edit_post_link( $object ) . '">' . esc_html( $object->post_title ) . '</a>',
'<b>' . esc_html( $this->get_default_copy_name( $object ) ) . '</b>'
),
'info',
$object_id
);
$this->cloning_scheduler->enqueue_task(
$this->get_cloning_task_name(),
array(
'object_id' => $object->ID,
'user_id' => get_current_user_id(),
),
$object->ID,
sprintf(
// translators: placeholder: current object link, new object name.
__( 'The cloning of %1$s into %2$s is in the processing queue. Please refresh this page to see the progress.', 'learndash' ),
'<a href="' . get_edit_post_link( $object ) . '">' . esc_html( $object->post_title ) . '</a>',
'<b>' . esc_html( $this->get_default_copy_name( $object ) ) . '</b>'
),
sprintf(
// translators: placeholder: current object link, new object name.
__( 'The cloning of %1$s into %2$s is running. Please refresh this page to see the progress.', 'learndash' ),
'<a href="' . get_edit_post_link( $object ) . '">' . esc_html( $object->post_title ) . '</a>',
'<b>' . esc_html( $this->get_default_copy_name( $object ) ) . '</b>'
)
);
}
// redirect to listing page.
learndash_safe_redirect( $redirect_url );
} | [
"protected function afterClone()\n {\n }",
"public function __clone() {\n\t\t_doing_it_wrong( __FUNCTION__, __( 'Cheatin’ huh?', 'edupress' ), '1.0' );\n\t}",
"private function __clone() {\n // do nothing here\n }",
"public function __clone() {\n trigger_error('Clone is not allowed.', E_USER_ERROR);\n }",
"public function __clone() {\n $this->log('Clone is not allowed.');\n }",
"abstract public function processClones(CodeCloneMap $clones);",
"public function __clone(){\n self::$instance->errors[] = 'Clone is not allowed.'.E_USER_ERROR;\n }",
"public function __clone()\n {\n $this->_customActions = array();\n }",
"public function ajax_start_clone() {\n\n\t\t$this->url = '';\n\t\t$cloning = new \\WPStaging\\Backend\\Modules\\Jobs\\Cloning();\n\n\t\tif ( ! $cloning->save() ) {\n\t\t\treturn;\n\t\t}\n\n\t\tob_start();\n\t\tif ( file_exists( WPSTG_PLUGIN_DIR . 'app/Backend/views/clone/ajax/start.php' ) ) {\n\t\t\trequire_once WPSTG_PLUGIN_DIR . 'app/Backend/views/clone/ajax/start.php';\n\t\t} elseif ( file_exists( WPSTG_PLUGIN_DIR . 'Backend/views/clone/ajax/start.php' ) ) {\n\t\t\trequire_once WPSTG_PLUGIN_DIR . 'Backend/views/clone/ajax/start.php';\n\t\t}\n\t\t$result = ob_get_clean();\n\t\treturn $result;\n\t}",
"public function __clone()\n {\n trigger_error('Clone is not allowed.', E_USER_WARNING);\n }",
"public function __clone()\n {\n trigger_error(\"Can't be cloned\", E_USER_ERROR);\n }",
"private function executeClone(){\n\t\tshell_exec(\n\t\t\t'git clone ' . escapeshellarg($this->sGitUrl) . ' '\n\t\t\t. escapeshellarg($this->getModuleFolderPath())\n\t\t);\n\t}",
"function __clone() {\n\t\t$children = $this->getChildren();\n\n\t\tparent::__clone();\n\n\t\t$body = $this->getBody();\n\t\t$this->assign('INFO_BODY', clone $body);\n\t\t\n\t\t// Clone must be written to db ahead of children to satisfy \n\t\t// their parent_node_id foreign key\n\t\t$this->save();\n\t\t\n\t\tforeach ($children as $child) {\n\t\t\t$child = $child->copy();\n\t\t\t$child->setParent($this);\n\t\t\t$child->save();\n\t\t}\n\t}",
"public function __clone() {\r\n\t\t\t// Cloning instances of the class is forbidden\r\n\t\t\t_doing_it_wrong( __FUNCTION__, esc_html__( 'Cheatin’ huh?', 'saaspik-addons' ), '1.0.0' );\r\n\t\t}",
"public function __clone()\r\n {\r\n trigger_error('La clonación de este objeto no está permitida', E_USER_ERROR);\r\n \r\n }",
"public function ajaxEditCloneData()\n {\n if (!$this->isAuthenticated()) {\n return;\n }\n\n $listOfClones = get_option(\"wpstg_existing_clones_beta\", []);\n if (isset($_POST[\"clone\"]) && array_key_exists($_POST[\"clone\"], $listOfClones)) {\n $clone = $listOfClones[$_POST[\"clone\"]];\n require_once \"{$this->path}Pro/views/edit-clone-data.php\";\n } else {\n echo __(\"Unknown error. Please reload the page and try again\", \"wp-staging\");\n }\n\n wp_die();\n }",
"public function __clone()\n {\n \n trigger_error('La clonación de este objeto no está permitida', E_USER_ERROR);\n \n }",
"public function __clone(){\n trigger_error('La clonación de este objeto no está permitida', E_USER_ERROR);\n }",
"public function __clone()\n {\n trigger_error('La clonación de este objeto no está permitida', E_USER_ERROR);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function to check variables against filters. If filter is passed and fails validation, will return default value. | protected function checkParam($data, $filter, $default = null, $raiseExceptionOnNull = true, $filterOptions = null, $keyName = null) {
if ($filterOptions === null) {
$data = filter_var($data, $filter);
} else {
array_unshift($filterOptions, $data, $filter);
$data = call_user_func_array('filter_var', $filterOptions);
}
if ((($filter != FILTER_VALIDATE_BOOLEAN && $data === false) || ($filter == FILTER_VALIDATE_BOOLEAN && $data === null)) && $default === null && $raiseExceptionOnNull) {
if ($keyName != null) {
$errorMessage = 'Requested variable "' . $keyName . '" failed validation';
} else {
$errorMessage = 'Checked variable failed validation';
}
throw new Exception($errorMessage);
CE_Lib::log(3, $errorMessage);
} else if ($data === false) {
$data = $default;
}
return $data;
} | [
"public function filter_var($variable, $filter = FILTER_DEFAULT, $options = array())\r\n {\r\n $success = true;\r\n $result = null;\r\n\r\n if (isset($options['acc_vals']) && in_array($variable, $options['acc_vals'])) {\r\n return $variable;\r\n }\r\n\r\n if ($filter === FILTER_VALIDATE_BOOLEAN) {\r\n $options['flags'] = FILTER_NULL_ON_FAILURE;\r\n\r\n $result = filter_var($variable, $filter, $options);\r\n\r\n if (is_null($result)) {\r\n $success = false;\r\n }\r\n } else {\r\n $result = filter_var($variable, $filter, $options);\r\n\r\n if ($result === false) {\r\n $success = false;\r\n }\r\n }\r\n\r\n if (!$success) {\r\n $key = isset($options['valkey']) ? $options['valkey'] : '';\r\n\r\n if (isset($options['errmsg'])) {\r\n $msg = sprintf($options['errmsg'], $variable);\r\n } else {\r\n $msg = sprintf('%1$s isn\\'t a valid value', $variable);\r\n }\r\n\r\n $this->addError($key, $msg);\r\n }\r\n\r\n return $result;\r\n }",
"function applyFilters() {\n\n $vName = $this->varName;\n $data = $this->inVarH->getPOST($vName);\n\n // only run filter if this field is required OR data isn't blank\n if ((($this->required)||($data != ''))||($this->forceFilter))\n return $this->inputEntity->applyFilters();\n }",
"function filter_var ($variable, $filter = null, $options = null) {}",
"function pn_requestFilter( $inRequestVariable, $inRegex, $inDefault = \"\" ) {\n if( ! isset( $_REQUEST[ $inRequestVariable ] ) ) {\n return $inDefault;\n }\n\n return pn_filter( $_REQUEST[ $inRequestVariable ], $inRegex, $inDefault );\n }",
"function filter($var,$type='string',$options=array())\n\t{\n\t\t//This function is not finished! Do not use!\n\t\t$result = false;\n\t\t//get variable name and value\n\t\t$args = func_get_args();\n\t\t$names =array_keys($args);\n\t\t$name = $names[0];\n\t\t$value = $args[$name];\n\t\tswitch($type){\n\t\t\tcase 'bool':\n\t\t\t\t$result = (bool) $var;\n\t\t\t\tbreak;\n\t\t\tcase 'int':\n\t\t\t\t$result = (int) $var;\n\t\t\t\tbreak;\n\t\t\tcase 'float':\n\t\t\t\t$result = (float) $var;\n\t\t\t\tbreak;\n\t\t\tcase 'string':\n\t\t\t\t\n\t\t\t\tbreak;\n\t\t\tcase 'array':\n\t\t\t\t//an array variable shouldn't be given to the filter\n\t\t\t\treturn false;\n\t\t\tdefault:\n\t\t\t\treturn false;\n\t\t}\n\t\tif(!empty($option['save'])){\n\t\t\t$this->clean[$name]=$result;\n\t\t}\n\t\treturn $result;\n\t}",
"function validateFilter($filter)\n {\n // Get the field that it applies to\n // $relation holds the tablename and $field holds the field\n list($relation, $field) = explode('.', $filter);\n\n // if the filter includes a tablename\n if ($field != \"\")\n {\n // check if the filter table is the same as the nodes table\n if (strtolower(trim($relation)) !== strtolower($this->m_table)) return \"\";\n\n // go on to check the field\n $relation = $field;\n }\n\n // All standard SQL operators\n $sqloperators = array('=','<>','>','<','>=','<=','BETWEEN','LIKE','IN');\n\n // Check the filter for every operator\n foreach ($sqloperators as $sqloperator)\n {\n // split the fieldname from the fieldvalue\n list($relation_new, $dummy) = explode($sqloperator, $relation);\n\n // check if the fieldname is in the attriblist\n \tif (in_array(trim($relation_new), array_keys($this->m_attribList))) return $filter;\n }\n return \"\";\n }",
"private function validateProjectFilter(HTTPRequest $request) {\n $validFilter = new Valid_String('project_filter');\n $filter = null;\n if ($request->valid($validFilter)) {\n $filter = $request->get('project_filter');\n }\n return $filter;\n }",
"function filter_ensure_valid_filter( $p_filter_arr ) {\n\t\tif ( !isset( $p_filter_arr['_version'] ) ) {\n\t\t\t$p_filter_arr['_version'] = config_get( 'cookie_version' );\n\t\t}\n\t\tif ( !isset( $p_filter_arr['_view_type'] ) ) {\n\t\t\t$p_filter_arr['_view_type'] = gpc_get_string( 'view_type', 'simple' );\n\t\t}\n\t\tif ( !isset( $p_filter_arr['per_page'] ) ) {\n\t\t\t$p_filter_arr['per_page'] = gpc_get_int( 'per_page', config_get( 'default_limit_view' ) );\n\t\t}\n\t\tif ( !isset( $p_filter_arr['highlight_changed'] ) ) {\n\t\t\t$p_filter_arr['highlight_changed'] = config_get( 'default_show_changed' );\n\t\t}\n\t\tif ( !isset( $p_filter_arr['sort'] ) ) {\n\t\t\t$p_filter_arr['sort'] = \"last_updated\";\n\t\t}\n\t\tif ( !isset( $p_filter_arr['dir'] ) ) {\n\t\t\t$p_filter_arr['dir'] = \"DESC\";\n\t\t}\n\t\tif ( !isset( $p_filter_arr['start_month'] ) ) {\n\t\t\t$p_filter_arr['start_month'] = gpc_get_string( 'start_month', date( 'm' ) );\n\t\t}\n\t\tif ( !isset( $p_filter_arr['start_day'] ) ) {\n\t\t\t$p_filter_arr['start_day'] = gpc_get_string( 'start_day', 1 );\n\t\t}\n\t\tif ( !isset( $p_filter_arr['start_year'] ) ) {\n\t\t\t$p_filter_arr['start_year'] = gpc_get_string( 'start_year', date( 'Y' ) );\n\t\t}\n\t\tif ( !isset( $p_filter_arr['end_month'] ) ) {\n\t\t\t$p_filter_arr['end_month'] = gpc_get_string( 'end_month', date( 'm' ) );\n\t\t}\n\t\tif ( !isset( $p_filter_arr['end_day'] ) ) {\n\t\t\t$p_filter_arr['end_day'] = gpc_get_string( 'end_day', date( 'd' ) );\n\t\t}\n\t\tif ( !isset( $p_filter_arr['end_year'] ) ) {\n\t\t\t$p_filter_arr['end_year'] = gpc_get_string( 'end_year', date( 'Y' ) );\n\t\t}\n\t\tif ( !isset( $p_filter_arr['search'] ) ) {\n\t\t\t$p_filter_arr['search'] = '';\n\t\t}\n\t\tif ( !isset( $p_filter_arr['and_not_assigned'] ) ) {\n\t\t\t$p_filter_arr['and_not_assigned'] = gpc_get_bool( 'and_not_assigned' );\n\t\t}\n\t\tif ( !isset( $p_filter_arr['do_filter_by_date'] ) ) {\n\t\t\t$p_filter_arr['do_filter_by_date'] = gpc_get_bool( 'do_filter_by_date' );\n\t\t}\n\t\tif ( !isset( $p_filter_arr['view_state'] ) ) {\n\t\t\t$p_filter_arr['view_state'] = gpc_get_int( 'view_state', '' );\n\t\t}\n\n\t\t$t_custom_fields \t\t= custom_field_get_ids();\n\t\t$f_custom_fields_data \t= array();\n\t\tif ( is_array( $t_custom_fields ) && ( sizeof( $t_custom_fields ) > 0 ) ) {\n\t\t\tforeach( $t_custom_fields as $t_cfid ) {\n\t\t\t\tif ( is_array( gpc_get( 'custom_field_' . $t_cfid, null ) ) ) {\n\t\t\t\t\t$f_custom_fields_data[$t_cfid] = gpc_get_string_array( 'custom_field_' . $t_cfid, 'any' );\n\t\t\t\t} else {\n\t\t\t\t\t$f_custom_fields_data[$t_cfid] = gpc_get_string( 'custom_field_' . $t_cfid, 'any' );\n\t\t\t\t\t$f_custom_fields_data[$t_cfid] = array( $f_custom_fields_data[$t_cfid] );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$t_multi_select_list = array( 'show_category' => 'string',\n\t\t\t\t\t\t\t\t\t 'show_severity' => 'int',\n\t\t\t\t\t\t\t\t\t 'show_status' => 'int',\n\t\t\t\t\t\t\t\t\t 'reporter_id' => 'int',\n\t\t\t\t\t\t\t\t\t 'handler_id' => 'string',\n\t\t\t\t\t\t\t\t\t 'show_resolution' => 'int',\n\t\t\t\t\t\t\t\t\t 'show_priority' => 'int',\n\t\t\t\t\t\t\t\t\t 'show_build' => 'string',\n\t\t\t\t\t\t\t\t\t 'show_version' => 'string',\n\t\t\t\t\t\t\t\t\t 'hide_status' => 'int',\n\t\t\t\t\t\t\t\t\t 'fixed_in_version' => 'string',\n\t\t\t\t\t\t\t\t\t 'user_monitor' => 'int' );\n\t\tforeach( $t_multi_select_list as $t_multi_field_name => $t_multi_field_type ) {\n\t\t\tif ( !isset( $p_filter_arr[$t_multi_field_name] ) ) {\n\t\t\t\tif ( 'hide_status' == $t_multi_field_name ) {\n\t\t\t\t\t$p_filter_arr[$t_multi_field_name] = array( config_get( 'hide_status_default' ) );\n\t\t\t\t} else if ( 'custom_fields' == $t_multi_field_name ) {\n\t\t\t\t\t$p_filter_arr[$t_multi_field_name] = array( $f_custom_fields_data );\n\t\t\t\t} else {\n\t\t\t\t\t$p_filter_arr[$t_multi_field_name] = array( \"any\" );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif ( !is_array( $p_filter_arr[$t_multi_field_name] ) ) {\n\t\t\t\t\t$p_filter_arr[$t_multi_field_name] = array( $p_filter_arr[$t_multi_field_name] );\n\t\t\t\t}\n\t\t\t\t$t_checked_array = array();\n\t\t\t\tforeach ( $p_filter_arr[$t_multi_field_name] as $t_filter_value ) {\n\t\t\t\t\tif ( 'string' == $t_multi_field_type ) {\n\t\t\t\t\t\t$t_checked_array[] = db_prepare_string( $t_filter_value );\n\t\t\t\t\t} else if ( 'int' == $t_multi_field_type ) {\n\t\t\t\t\t\t$t_checked_array[] = db_prepare_int( $t_filter_value );\n\t\t\t\t\t} else if ( 'array' == $t_multi_field_type ) {\n\t\t\t\t\t\t$t_checked_array[] = $t_filter_value;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$p_filter_arr[$t_multi_field_name] = $t_checked_array;\n\t\t\t}\n\t\t}\n\n\t\tif ( is_array( $t_custom_fields ) && ( sizeof( $t_custom_fields ) > 0 ) ) {\n\t\t\tforeach( $t_custom_fields as $t_cfid ) {\n\t\t\t\tif ( !isset( $p_filter_arr['custom_fields'][$t_cfid] ) ) {\n\t\t\t\t\t$p_filter_arr['custom_fields'][$t_cfid] = array( \"any\" );\n\t\t\t\t} else {\n\t\t\t\t\tif ( !is_array( $p_filter_arr['custom_fields'][$t_cfid] ) ) {\n\t\t\t\t\t\t$p_filter_arr['custom_fields'][$t_cfid] = array( $p_filter_arr['custom_fields'][$t_cfid] );\n\t\t\t\t\t}\n\t\t\t\t\t$t_checked_array = array();\n\t\t\t\t\tforeach ( $p_filter_arr['custom_fields'][$t_cfid] as $t_filter_value ) {\n\t\t\t\t\t\t$t_checked_array[] = db_prepare_string( $t_filter_value );\n\t\t\t\t\t}\n\t\t\t\t\t$p_filter_arr['custom_fields'][$t_cfid] = $t_checked_array;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t# all of our filter values are now guaranteed to be there, and correct.\n\n\t\treturn $p_filter_arr;\n\t}",
"function filterRequest($_param, $_request, $_filter = null){\n \t// If temp filter is empty use objects\n \tif (empty($_filter)){\n \t\t$_filter = $this->_filter;\n \t}\n \t// If object filter is empty use none\n \tif (empty($_filter)){\n \t\t$return = $this->_clean(filter_input($_request, $_param));\n \t}\n \telse{\n \t\t$return = $this->_clean(filter_input($_request, $_param, $_filter));\n \t}\n \treturn $return;\n }",
"function emailValide($email){\r\n if (filter_var($email,filter_validate_email)){\r\n echo\"L'adresse email '$email' est valide.\";\r\n } else{\r\n echo \"L'adresse email '$email' est invalide.\"; \r\n }\r\n}",
"function validateAdult ($age){\n $options = [\"options\" => [\"min_range\" => 18, \"max_range\" => 124]];\n if (filter_var($age, FILTER_VALIDATE_INT, $options)) {\n echo(\"You are ${age} years old.\");\n } else {\n echo(\"That is not a valid age.\");\n }\n}",
"function getDefaultFilterVal()\r\n\t{\r\n\t\t$tableModel =& $this->getTableModel();\r\n\t\t$aFilter \t\t=& $tableModel->getFilterArray();\r\n\t\t$elName \t\t= $this->getFilterFullName( false, true, false );\r\n\t\t$data = JRequest::get('request');\r\n\t\t$groupModel =& $this->_group;\r\n\t\t$group =& $groupModel->_group;\r\n\t\t$params =& $this->getParams();\r\n\t\t$element =& $this->getElement();\r\n\r\n\t\tif ($group->is_join) {\r\n\t\t\tif (array_key_exists( 'join', $data ) && array_key_exists( $group->join_id, $data['join'] )) {\r\n\t\t\t\t$data = $data['join'][$group->join_id];\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t$default \t\t= \"\";\r\n\t\tif (array_key_exists( $elName, $data )) {\r\n\t\t\tif (is_array( $data[$elName] )) {\r\n\t\t\t\t$default = $data[$elName]['value'];\r\n\t\t\t}\r\n\t\t}\r\n\t\tif ($default == '') {\r\n\t\t\tif (isset( $aFilter )) {\r\n\t\t\t\tif (isset($aFilter[$elName] )) {\r\n\t\t\t\t\tif (is_array( $aFilter[$elName] )) {\r\n\t\t\t\t\t\tif (array_key_exists( 'filterVal', $aFilter[$elName] )) {\r\n\t\t\t\t\t\t\t$default = $aFilter[$elName]['filterVal'];\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t$default = $aFilter[$elName]['value'];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t//print_r($aFilter[$elName]);\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$k = $params->get('join_db_name'). \".\" . $params->get('join_val_column');\r\n\t\t\t\t\tif (@isset($aFilter[$key] )) {\r\n\t\t\t\t\t\t$default = $aFilter[$k]['filterVal'];;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t$testKey = '';\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $default;\r\n\t}",
"public function checkFilters(): void\n {\n foreach ($this->filters() as $filter => $_default) {\n if (! isset($this->filters[$filter]) || $this->filters[$filter] === '') {\n $this->filters[$filter] = null;\n }\n }\n }",
"public function get_default_filter() {\n\n\t\t$filters = $this->get_filter_links();\n\n\t\t$option_values = $this->get_screen_options();\n\n\t\t// If the filter is not available for the form then use 'all'\n\t\t$selected_filter = 'all';\n\t\tforeach ( $filters as $filter ) {\n\t\t\tif ( $option_values['default_filter'] == $filter['id'] ) {\n\t\t\t\t$selected_filter = $option_values['default_filter'];\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\treturn $selected_filter;\n\t}",
"function validateAdult ($age){\n $options = [\"options\" => [\"min_range\" => 18, \"max_range\" => 124]]; \n if (filter_var($age, FILTER_VALIDATE_INT, $options)) {\n echo(\"You are ${age} years old.\");\n } else {\n echo(\"That is not a valid age.\");\n }\n}",
"private function preProcessFiltering()\n {\n $filter_by_array = $this->getArrayKeysExist($_GET, $this->columnNames);\n if (!empty($filter_by_array)) {\n if (!isset($this->filter_by)) {\n $this->filter_by = $filter_by_array[0];\n }\n\n if (isset($_GET[$this->filter_by]) && $_GET[$this->filter_by] != \"\") {\n if (!isset($this->filter_by_value)) {\n $this->filter_by_value = $_GET[$this->filter_by];\n }\n } else {\n return $this->notFoundResponseWithMessage(\"No value for $this->filter_by\");\n }\n }\n }",
"public function getFilterValue();",
"public function testValidInputIsFiltered()\n {\n global $_GET;\n global $_POST;\n global $_REQUEST;\n global $_FILES;\n global $_SERVER;\n\n $validEmail = 'woo@test.com';\n\n // create and register a Filter instance\n $filter = new Filter();\n $filter->add('testVal','email');\n\n $input = new Input($filter);\n $input->set('get','testVal',$validEmail);\n\n $result = $input->get('testVal');\n $this->assertEquals($result,$validEmail);\n }",
"function news_requestFilter( $inRequestVariable, $inRegex, $inDefault = \"\" ) {\n if( ! isset( $_REQUEST[ $inRequestVariable ] ) ) {\n return $inDefault;\n }\n \n $numMatches = preg_match( $inRegex,\n $_REQUEST[ $inRequestVariable ], $matches );\n\n if( $numMatches != 1 ) {\n return $inDefault;\n }\n \n return $matches[0];\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Instantiates a new UserExperienceAnalyticsWorkFromAnywhereModelPerformanceItemRequestBuilderGetRequestConfiguration and sets the default values. | public function __construct(?array $headers = null, ?array $options = null, ?UserExperienceAnalyticsWorkFromAnywhereModelPerformanceItemRequestBuilderGetQueryParameters $queryParameters = null) {
parent::__construct($headers ?? [], $options ?? []);
$this->queryParameters = $queryParameters;
} | [
"public function userExperienceAnalyticsAppHealthDeviceModelPerformance(): UserExperienceAnalyticsAppHealthDeviceModelPerformanceRequestBuilder {\n return new UserExperienceAnalyticsAppHealthDeviceModelPerformanceRequestBuilder($this->pathParameters, $this->requestAdapter);\n }",
"public static function createQueryParameters(?array $expand = null, ?array $select = null): UserExperienceAnalyticsWorkFromAnywhereModelPerformanceItemRequestBuilderGetQueryParameters {\n return new UserExperienceAnalyticsWorkFromAnywhereModelPerformanceItemRequestBuilderGetQueryParameters($expand, $select);\n }",
"public function userExperienceAnalyticsAppHealthDevicePerformance(): UserExperienceAnalyticsAppHealthDevicePerformanceRequestBuilder {\n return new UserExperienceAnalyticsAppHealthDevicePerformanceRequestBuilder($this->pathParameters, $this->requestAdapter);\n }",
"public function userExperienceAnalyticsBatteryHealthAppImpact(): UserExperienceAnalyticsBatteryHealthAppImpactRequestBuilder {\n return new UserExperienceAnalyticsBatteryHealthAppImpactRequestBuilder($this->pathParameters, $this->requestAdapter);\n }",
"public function userExperienceAnalyticsImpactingProcess(): UserExperienceAnalyticsImpactingProcessRequestBuilder {\n return new UserExperienceAnalyticsImpactingProcessRequestBuilder($this->pathParameters, $this->requestAdapter);\n }",
"public function userExperienceAnalyticsBatteryHealthOsPerformance(): UserExperienceAnalyticsBatteryHealthOsPerformanceRequestBuilder {\n return new UserExperienceAnalyticsBatteryHealthOsPerformanceRequestBuilder($this->pathParameters, $this->requestAdapter);\n }",
"public function userExperienceAnalyticsModelScores(): UserExperienceAnalyticsModelScoresRequestBuilder {\n return new UserExperienceAnalyticsModelScoresRequestBuilder($this->pathParameters, $this->requestAdapter);\n }",
"public function userExperienceAnalyticsBatteryHealthDevicePerformance(): UserExperienceAnalyticsBatteryHealthDevicePerformanceRequestBuilder {\n return new UserExperienceAnalyticsBatteryHealthDevicePerformanceRequestBuilder($this->pathParameters, $this->requestAdapter);\n }",
"public function userExperienceAnalyticsDeviceStartupProcesses(): UserExperienceAnalyticsDeviceStartupProcessesRequestBuilder {\n return new UserExperienceAnalyticsDeviceStartupProcessesRequestBuilder($this->pathParameters, $this->requestAdapter);\n }",
"private static function InitMutateRequestObject() {\n $campaign = new Campaign();\n $campaign->id = -1;\n $campaign->name = 'Test campaign&<>\"\\'';\n $campaign->advertisingChannelType = 'SEARCH';\n $campaign->status = 'ENABLED';\n $campaignOperation = new CampaignOperation();\n $campaignOperation->operand = $campaign;\n $campaignOperation->operator = 'ADD';\n $operations[] = $campaignOperation;\n\n $adGroup = new AdGroup();\n $adGroup->id = -2;\n $adGroup->campaignId = -1;\n $adGroup->name = 'Test ad group';\n $adGroupOperation = new AdGroupOperation();\n $adGroupOperation->operand = $adGroup;\n $adGroupOperation->operator = 'ADD';\n $operations[] = $adGroupOperation;\n\n self::$MUTATE_REQUEST_OBJECT = new BatchJobOpsMutate();\n self::$MUTATE_REQUEST_OBJECT->operations = $operations;\n }",
"public function userExperienceAnalyticsDeviceScores(): UserExperienceAnalyticsDeviceScoresRequestBuilder {\n return new UserExperienceAnalyticsDeviceScoresRequestBuilder($this->pathParameters, $this->requestAdapter);\n }",
"public static function createDefault() {\n JuspayEnvironment::init ();\n return new RequestOptions ();\n }",
"public function deviceAppPerformances(): DeviceAppPerformancesRequestBuilder {\n return new DeviceAppPerformancesRequestBuilder($this->pathParameters, $this->requestAdapter);\n }",
"public function userExperienceAnalyticsAppHealthOverview(): UserExperienceAnalyticsAppHealthOverviewRequestBuilder {\n return new UserExperienceAnalyticsAppHealthOverviewRequestBuilder($this->pathParameters, $this->requestAdapter);\n }",
"public function userExperienceAnalyticsDeviceStartupHistory(): UserExperienceAnalyticsDeviceStartupHistoryRequestBuilder {\n return new UserExperienceAnalyticsDeviceStartupHistoryRequestBuilder($this->pathParameters, $this->requestAdapter);\n }",
"public function userExperienceAnalyticsBatteryHealthRuntimeDetails(): UserExperienceAnalyticsBatteryHealthRuntimeDetailsRequestBuilder {\n return new UserExperienceAnalyticsBatteryHealthRuntimeDetailsRequestBuilder($this->pathParameters, $this->requestAdapter);\n }",
"public function userExperienceAnalyticsDeviceScopes(): UserExperienceAnalyticsDeviceScopesRequestBuilder {\n return new UserExperienceAnalyticsDeviceScopesRequestBuilder($this->pathParameters, $this->requestAdapter);\n }",
"protected function getPartnerPerformanceRequest(): Request\n {\n $contentType = self::contentTypes['getPartnerPerformance'];\n\n $resourcePath = '/v3/report/payment/performance';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n $method = 'GET';\n\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n $contentType,\n $multipart\n );\n\n $defaultHeaders = parent::getDefaultHeaders();\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\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 } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {\n # if Content-Type contains \"application/json\", json_encode the form parameters\n $httpBody = \\GuzzleHttp\\Utils::jsonEncode($formParams);\n } else {\n // for HTTP post (form)\n $httpBody = ObjectSerializer::buildQuery($formParams);\n }\n }\n\n $query = ObjectSerializer::buildQuery($queryParams);\n $requestInfo = [\n 'path' => $resourcePath,\n 'method' => $method,\n 'timestamp' => $defaultHeaders['WM_SEC.TIMESTAMP'],\n 'query' => $query,\n ];\n\n // this endpoint requires Bearer authentication (access token)\n $token = $this->config->getAccessToken();\n if ($token) {\n $headers['WM_SEC.ACCESS_TOKEN'] = $token->accessToken;\n }\n\n $operationHost = $this->config->getHost();\n return new Request(\n $method,\n $operationHost . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"protected function initializeRequestBuilder() {\n\t\t$this->requestBuilder = $this->objectManager->get('Sto\\\\Mediaoembed\\\\Request\\\\RequestBuilder');\n\t\t$this->requestBuilder->setConfiguration($this->configuration);\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Adds the abbreviation to arguments list | public static function addAbbrevsArgs( $args, $shortcodeAtts ) {
if ( !empty( $shortcodeAtts[ 'search_term' ] ) ) {
$metaQueryArgs = array(
array(
'relation' => 'OR',
array(
'key' => 'cmtt_abbreviation',
),
array(
'key' => 'cmtt_abbreviation',
'compare' => 'NOT EXISTS'
)
)
);
if ( isset( $args[ 'meta_query' ] ) ) {
$args[ 'meta_query' ][] = $metaQueryArgs;
} else {
$args[ 'meta_query' ] = $metaQueryArgs;
}
}
return $args;
} | [
"function setAbbreviatedArgName($abbv) {\r\n $this->_abbv = $abbv;\r\n }",
"public function addArguments($arguments);",
"public function addArgs(array $args);",
"public function addAria()\n {\n $this->addTo('aria', func_get_args());\n }",
"public function addArguments($arguments) {\n $this->arguments = array_merge ( $this->arguments, $arguments );\n }",
"private function addToArg($str){\n\t\t$this->_args[$this->countArgs() - 1] .= $str;\n\t}",
"public function addArgument($argument);",
"abstract function argsRegister();",
"private function getAbbreviationSuggestions(array $abbrevs): string\n {\n return ' '.implode(\"\\n \", $abbrevs);\n }",
"private function _add() {\r\n$arguments = func_get_args();\r\n$this->_patterns[] = $arguments;\r\n}",
"protected function _defineArguments()\n {\n $this->_climate->arguments->add([\n 'imagedir' => [\n 'prefix' => 'i',\n 'longPrefix' => 'imagedir',\n 'description' => 'Image directory',\n 'required' => true,\n ],\n ]);\n }",
"public function create_arguments() {\n\t\t$this->create_labels_argument();\n\n\t\t$this->arguments = array(\n\t\t\t'labels' => $this->label_arguments,\n\t\t\t'public' => true,\n\t\t\t'hierarchical' => false,\n\t\t\t'show_ui' => true,\n\t\t\t'show_in_nav_menus' => true,\n\t\t\t'supports' => array( 'title', 'editor', 'excerpt', 'thumbnail', 'author' ),\n\t\t\t'has_archive' => true,\n\t\t\t'rewrite' => true,\n\t\t\t'query_var' => true,\n\t\t\t'menu_position' => null,\n\t\t\t'menu_icon' => 'dashicons-admin-users',\n\t\t\t'show_in_rest' => true,\n\t\t\t'rest_base' => 'person',\n\t\t\t'rest_controller_class' => 'WP_REST_Posts_Controller',\n\t\t);\n\n\t}",
"public function incubate(string $alias, ... $parameters);",
"public function withArguments(...$arguments) {}",
"public function addArguments(nbArgumentSet $arguments)\n {\n $this->arguments->mergeArguments($arguments);\n }",
"private function ___setASINArguments() {\n if ( ! isset( $this->_aArguments[ 'asin' ] ) ) {\n return;\n }\n $_aASINs = $this->getStringIntoArray( $this->_aArguments[ 'asin' ], ',' );\n $this->_aArguments[ 'ItemId' ] = implode( ',', $_aASINs );\n $this->_aArguments[ 'Operation' ] = 'ItemLookup';\n $this->_aArguments[ '_allowed_ASINs' ] = $_aASINs;\n $this->_aArguments[ 'unit_type' ] = 'item_lookup';\n }",
"public function addTitle($full, $abbreviation) {\n $this->title[$full] = $abbreviation;\n }",
"private function getAbbreviationSuggestions($abbrevs)\n {\n return sprintf('%s, %s%s', $abbrevs[0], $abbrevs[1], count($abbrevs) > 2 ? sprintf(' and %d more', count($abbrevs) - 2) : '');\n }",
"public function setArgs(string $args);"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ Disapprove the vendor based product_id Give the reason for disapprove vendors | public function disapprove($product_id='')
{
$reasonData = array(
'product_id' => $product_id,
'reason' => $this->input->post('reason')
);
$reasonInsert = $this->mcommon->common_insert('deals_reasons', $reasonData);
$productUpdate = $this->mcommon->common_edit('product', array('approved_status' => '2'), array('product_id' => $product_id));
if($reasonInsert || $productUpdate)
{
//Log for Disapproved vendor
$productname = $this->mcommon->specific_row_value('product',array('product_id' => $product_id),'product_name');
$user_id = $this->mcommon->specific_row_value('product',array('product_id' => $product_id),'user_id');
$username = $this->mcommon->specific_row_value('users',array('user_id' => $user_id),'username');
$app_activityArr = array(
'log_timestamp' => date('Y-m-d H:i:s'),
'activity_id' => 7,
'log_activity' => $productname." ".$this->lang->line('ven_dis_appr_by')." ".$this->input->post('reason'),
'log_activity_link' => uri_string(),
'user_id' => $user_id
);
$this->mcommon->common_insert('activity_logs', $app_activityArr);
$this->session->set_flashdata('msg', 'Deal Disapproved Successfully');
$this->session->set_flashdata('alertType', 'success');
redirect(base_url('new_deals/add'));
}
} | [
"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 setVendorDisapproved($v_id){\n $this->db->where('v_id',$v_id);\n $this->db->update('vendor_details',['status'=>'disapproved']);\n }",
"public function approve($product_id='')\n {\n $where_array = array('product_id' => $product_id);\n //To be edit approved status as 1\n $productUpdate = $this->mcommon->common_edit('product', array('approved_status' => '1'), $where_array); \n \n if($productUpdate)\n {\n //Log Approved vendor\n $productname = $this->mcommon->specific_row_value('product',array('product_id' => $product_id),'product_name');\n $user_id = $this->mcommon->specific_row_value('product',array('product_id' => $product_id),'user_id');\n $username = $this->mcommon->specific_row_value('users',array('user_id' => $user_id), 'username');\n $app_activityArr = array(\n 'log_timestamp' => date('Y-m-d H:i:s'),\n 'activity_id' => 6,\n 'log_activity' => $username.\" \".$this->lang->line('deal_your').\" \".$productname.\" \".$this->lang->line('ven_appr_by'),\n 'log_activity_link' => uri_string(),\n 'user_id' => $user_id\n );\n $this->mcommon->common_insert('activity_logs', $app_activityArr);\n\n //Send Push Notification with reasons\n $this->prefs->userNotify($user_id, '3', array('username' => $username));\n\n //Log for Disapproved vendor push notification\n $notifyArr = array(\n 'log_timestamp' => date('Y-m-d H:i:s'),\n 'activity_id' => 8,\n 'log_activity' => $this->lang->line('ven_push_nofify').\" \".$username,\n 'log_activity_link' => uri_string(),\n 'user_id' => $user_id\n );\n $this->mcommon->common_insert('activity_logs', $notifyArr);\n\n $this->session->set_flashdata('msg', 'Deal Approved Successfully');\n $this->session->set_flashdata('alertType', 'success');\n redirect(base_url('new_deals/add'));\n }\n }",
"public function banVendorProduct($id)\n {\n $getUpdatedUserProduct = Product::where('id', $id)->update([\n 'is_approved' => 3\n ]);\n return redirect()->back();\n }",
"public function massDisableAction()\n {\n \t$inline = $this->getRequest()->getParam('inline',0);\n \t$vendorIds = $this->getRequest()->getParam('vendor_id');\n \t$shop_disable = $this->getRequest()->getParam('shop_disable','');\n \tif($inline) {\n \t\t$vendorIds = array($vendorIds);\n \t}\n \tif(!is_array($vendorIds)) {\n \t\t$this->_getSession()->addError($this->__('Please select vendor(s)'));\n \t} else {\n \t\ttry {\n \t\t\t$model = Mage::getModel('csmarketplace/vshop');\n \t\t\t$change = $model->saveShopStatus($vendorIds,$shop_disable);\n \t\t\t$this->_getSession()->addSuccess(\n \t\t\t\t\t$this->__('Total of %d shop(s) have been updated.',$change)\n \t\t\t);\n \n \t\t}catch (Mage_Core_Model_Exception $e) {\n \t\t\t$this->_getSession()->addError($e->getMessage());\n \t\t} catch (Mage_Core_Exception $e) {\n \t\t\t$this->_getSession()->addError($e->getMessage());\n \t\t} catch (Exception $e) {\n \t\t\t$this->_getSession()->addException($e, $this->__($e->getMessage().' An error occurred while updating the vendor(s) status.'));\n \t\t}\n \t}\n \n \t$this->_redirect('*/*/index',array('_secure'=>true));\n \n }",
"public function reject_prod($prod_id){\n $table_name = \"product\";\n $where = array('prod_id' => $prod_id );\n $this->load->model('admin/Product_model');\n $data['status'] = $this->Product_model->reject_prod($where);\n view_loader($data,'admin/home');\n }",
"public function revokeProduct()\n\t{\n\t\tSession::forget('messages');\n\t\t$productID = Request::input('username');\n\t\tLog::info($productID);\n\t\t$validator = Validator::make(\n\t\t\tarray('productID' => $productID),\n\t\t\tarray('productID' => 'exists:products'\n\t\t\t\t )\n\t\t\t);\n\t\tif($validator->fails())\n\t\t{\n\t\t\tSession::put('messages',\"SUCH A PRODUCT DOESN'T EXIST\");\n\t\t\treturn View::make('admins.deprecate');\n\t\t}\n\t\tif($validator->passes())\n\t\t{\n\t\t\t$productStatus = DB::table('products')->where('productID', $productID)->pluck('Deprecated');\n\t\t\tif($productStatus == 0)\n\t\t\t{\n\t\t\t\tSession::put('messages',\"THIS PRODUCT IS ALREADY IN USE\");\n\t\t\t\treturn View::make('admins.deprecate');\n\t\t\t}\n\t\t\tDB::table('products')\n\t\t\t ->where('productID', $productID)\n\t\t\t ->update(['Deprecated' => 0, 'DeprecateEnd' => date('Y-m-d')]);\n\t\t\tSession::put('messages',\"PRODUCT HAS BEEN REVOKED\");\n\t\t\treturn View::make('admins.deprecate');\n\t\t}\n\t}",
"public function discontinueProduct($productId) {\t\t\n\t\t//Create path: GET https://platformapi.blueknow.com/catalog/discontinue/{bknumber}/{productId}\n\t\t$path = self::DISCONTINUED_PATH . \"/\". $this->_bkNumber . \"/\" . $productId;\n\t\t//Try the request\n\t\ttry {\n\t\t\t// Get request\n\t\t\t$response = $this->restGet($path);\t\t\t\n\t // Connection exception\n\t\t} catch (Zend_Http_Client_Adapter_Exception $e) {\n\t\t\tMage::log(\"Client exception \" . $e, null, \"blueknowPlatformAPI.log\");\n\t // General exceptions\n\t\t} catch (Exception $e) {\n\t \tMage::log(\"General exception \" . $e, null, \"blueknowPlatformAPI.log\");\t\n\t\t}\n\t}",
"function dokan_product_import_vendor_association( $product_obj ) {\r\n \tglobal $WCFM, $WCFMu, $WCMp;\r\n \t\r\n \t$new_product_id = $product_obj->get_id();\r\n \t\r\n\t\t// Admin Message for Pending Review\r\n\t\tif( !current_user_can( 'publish_products' ) || !apply_filters( 'wcfm_is_allow_publish_products', true ) ) {\r\n\t\t\t$update_product = array(\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'ID' => $new_product_id,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'post_status' => 'pending',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'post_type' => 'product',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t);\r\n \t\twp_update_post( $update_product, true );\r\n\t\t\t$WCFM->wcfm_notification->wcfm_admin_notification_product_review( $this->vendor_id, $new_product_id );\r\n\t\t}\r\n }",
"public function massVendorIdAction()\n {\n $orderIds = $this->getRequest()->getParam('order');\n if (!is_array($orderIds)) {\n Mage::getSingleton('adminhtml/session')->addError(\n Mage::helper('xcentia_vendors')->__('Please select orders.')\n );\n } else {\n try {\n foreach ($orderIds as $orderId) {\n $order = Mage::getSingleton('xcentia_vendors/order')->load($orderId)\n ->setVendorId($this->getRequest()->getParam('flag_vendor_id'))\n ->setIsMassupdate(true)\n ->save();\n }\n $this->_getSession()->addSuccess(\n $this->__('Total of %d orders were successfully updated.', count($orderIds))\n );\n } catch (Mage_Core_Exception $e) {\n Mage::getSingleton('adminhtml/session')->addError($e->getMessage());\n } catch (Exception $e) {\n Mage::getSingleton('adminhtml/session')->addError(\n Mage::helper('xcentia_vendors')->__('There was an error updating orders.')\n );\n Mage::logException($e);\n }\n }\n $this->_redirect('*/*/index');\n }",
"public function discontinueDeletedProduct(Varien_Event_Observer $observer) {\n\t\t//Retrieve products from event\n\t\t$productId = $observer->getEvent()->getProduct()->getId();\n\t\t//Discontinue\n\t\t$this->_discontinue($productId);\n\t}",
"protected function disableProduct() : void\n {\n $product = $this->productRepository->get(self::SKU, true);\n $product->setStatus(Status::STATUS_DISABLED);\n $this->productRepository->save($product);\n }",
"public function disapproveCompanyAction() {\n $id = $this->_request->getParam(\"id\", 0);\n $company = $this->getService(\"company\")->getTable()->findOneById($id);\n\n if (!$company || $company->status != Companies_Model_Company::STATUS_TAKEN) {\n $this->_redirectNotFoundPage();\n }\n\n $this->getService(\"company\")->disapprove($company);\n $this->_redirectToRequestPage();\n }",
"public function disableProduct($id)\r\n {\r\n }",
"function removeProductFromBlocked($id){\n $product = Product::find($id);\n $product->status = '2';\n $result = $product->save();\n if($result){\n session()->flash('notify_success', Lang::get('notify_admin.success_8'));\n return redirect('blockedProducts');\n }else{\n session()->flash('notify_danger', Lang::get('notify_admin.connection_error'));\n return redirect('blockedProducts');\n }\n }",
"public function unapprove()\n {\n return $this->update(['approved' => false]);\n }",
"function disableproduct($id)\n{\n\t\tglobal $con;\n\t\t\n\t\t$disable_product = $con->query(\"update product set status = '0' where id = '$id'\");\n\t\tif(!$disable_product)\n\t\t{\n\t\t\techo\"could not disable product\";\n\t\t\t\n\t\t}\n}",
"function _approveNewVendor(){\n \n $this->ci->load->library('form_validation');\n $person_id = $this->ci->session->userdata('user_id');\n \n $this->resetResponse();\n\n $this->ci->form_validation->set_rules('personId', 'Vendor Person Id', 'trim|required|xss_clean|encode_php_tags|integer', array('required' => 'You must provide a %s.'));\n\n if ($this->ci->form_validation->run() == FALSE) { \n $this->_status = false;\n $this->_message = $this->ci->lang->line('person_id_missing');\n return $this->getResponse();\n } else {\n\n $personId = $this->ci->input->post('personId', true);\n $result = $this->model->get_tb('mm_person', 'person_id', array('person_id' => $personId))->result();\n if (count($result) > 0) {\n $this->model->update_tb('mm_person', array('person_id' => $personId), array('person_status'=>1));\n \n if( $this->model->getAffectedRowCount() > 0 ) {\n $this->_status = true;\n $this->_message = $this->ci->lang->line('vendor_approved'); \n }\n } else {\n $this->_status = FALSE;\n $this->_message = $this->ci->lang->line('invalid_data'); \n \n }\n\n return $this->getResponse();\n }\n \n }",
"public function approvalPostAction() {\n\t\tif(Mage::app()->getRequest()->getParam('is_vendor')==1){\n\t\t\t$venderData = Mage::app()->getRequest()->getParam('vendor');\n\t\t\t$customerData = $this->_getSession()->getCustomer();\n\t\t\t\n\t\t\ttry {\n\t\t\t\t$vendor = Mage::getModel('csmarketplace/vendor')\n\t\t\t\t\t\t ->setCustomer($customerData)\n\t\t\t\t\t\t ->register($venderData);\n\t\t\t\t\n\t\t\t//Code to Generate Member ID For Every Vendor Registration.\n\t\t\t\t$prefix = Mage::getStoreConfig('ced_csmarketplace/general/prefixmemberid_active');\n\t\t\t\t$entityTypeId = Mage::getModel('eav/entity')->setType('csmarketplace_vendor')->getTypeId();\n\t\t\t\t$member_lastid_model = Mage::getModel('eav/entity_store')->loadByEntityStore($entityTypeId, 0);\n\t\t\t\t$member_lastid = $member_lastid_model->getIncrementLastId();\n\t\t\t\t$member_lastid++;\n \t\t\t$mid = $prefix.$member_lastid;\n \t\t\t$vendor['member_id'] = $mid;\n\t\t\t\tif(!$vendor->getErrors()) {\n\t\t\t\t\t$vendor->save();\n\t\t\t\t\tif($vendor->getStatus() == Ced_CsMarketplace_Model_Vendor::VENDOR_NEW_STATUS) {\n\t\t\t\t\t\t\n\t\t\t\t\t\t$this->_getSession()->addSuccess(Mage::helper('csmarketplace')->__('Your vendor application has been Pending.'));\n\t\t\t\t\t} else if ($vendor->getStatus() == Ced_CsMarketplace_Model_Vendor::VENDOR_APPROVED_STATUS) {\n\t\t\t\t\t\t\n\t\t\t\t\t\t$this->_getSession()->addSuccess(Mage::helper('csmarketplace')->__('Your vendor application has been Approved.'));\n\t\t\t\t\t}\n\t\t\t\t} elseif ($vendor->getErrors()) {\n\t\t\t\t\t\n\t\t\t\t\tforeach ($vendor->getErrors() as $error) {\n\t\t\t\t\t\t$this->_getSession()->addError($error);\n\t\t\t\t\t}\n\t\t\t\t\t$this->_getSession()->setFormData($venderData);\n\t\t\t\t} else {\n\t\t\t\t\t$this->_getSession()->addError(Mage::helper('csmarketplace')->__('Your vendor application has been denied'));\n\t\t\t\t}\n\t\t\t\t\n\t\t\t} catch (Exception $e) {\n\t\t\t\t$this->_getSession()->addError($e->getMessage());\n\t\t\t}\n\t\t}\n\t\t$this->_redirect('*/vendor/approval');\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
get schema paths from config. | public function getSchemaPaths()
{
return isset($this['schema']['paths'])
? $this['schema']['paths'] : null;
} | [
"static public function getSchemaFilePaths(){\n \n $schema_files = \\Altumo\\Utils\\Finder::type('file')\n ->name( '*schema.xml' )\n ->in( __DIR__ . '/../../../../config/', __DIR__ . '/../../config/' );\n \n \n return $schema_files;\n }",
"public function getSchemaSearchPaths()\n {\n $params = $this->_conn->getParams();\n $schema = explode(',', $this->_conn->fetchColumn('SHOW search_path'));\n\n if (isset($params['user'])) {\n $schema = str_replace('\"$user\"', $params['user'], $schema);\n }\n\n return array_map('trim', $schema);\n }",
"protected static function getConfigSchemas() {\n return array ();\n }",
"public function retriveDoctrineSchemas()\n {\n $schemas = array(sfConfig::get('sf_config_dir').'/doctrine');\n $dir = sfConfig::get('sf_plugins_dir');\n $ignores = array('.channels','.registry');\n $finder = sfFinder::type('directory')->maxdepth(0)->sort_by_name()->ignore_version_control()->discard($ignores)->prune($ignores) ;\n foreach ($finder->in($dir) as $path)\n {\n if (is_file($path.'/config/doctrine/schema.yml'))\n {\n $schemas[] = $path.'/config/doctrine' ;\n }\n }\n return $schemas;\n }",
"protected function get_schema_config() : array\n {\n }",
"protected function getSchemaDir()\n {\n return __DIR__ . '/../Schemas';\n }",
"public function schemaPath(): string\n {\n return 'example.graphqls';\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 getConfiguredPaths()\n {\n $settings = $this->configurationProvider->getSettings();\n if (isset($settings['paths']) && is_array($settings['paths'])) {\n return $settings['paths'];\n }\n\n return isset($settings['paths.']) ? $settings['paths.'] : array();\n }",
"protected function schemaDirectory()\n {\n return config(\"smooth.schema_path\", $this->laravel->databasePath() .\n DIRECTORY_SEPARATOR . Constants::SMOOTH_SCHEMA_FOLDER . DIRECTORY_SEPARATOR);\n }",
"public function getConfiguredPaths()\n {\n return $this->paths;\n }",
"public function configPaths()\n {\n return [\n 'abilities' => dirname(__DIR__, 3) . '/config/abilities.php',\n 'docks.' . self::class => dirname(__DIR__, 3) . '/config/docks/commodities.php',\n ];\n }",
"protected function getSchemaFiles()\n {\n return Collection::make($this->schemaDirectory())->flatMap(function ($path) {\n return $this->files->glob($path.'*Schema.php*');\n })->filter()->sortBy(function ($file) {\n return $this->getSchemaName($file);\n })->values()->all();\n }",
"public function getSchemaPath()\n {\n return realpath(__DIR__ . '/../../inventory.schema.json');\n }",
"function splits_paths($config) {\n if (!isset($config['splits']))\n return [];\n return array_keys($config['splits']);\n}",
"public function getMigrationPaths();",
"private function _schemaPath(): string {\n\t\t$all_searches = [];\n\t\t$class_object = $this->class_object;\n\t\tforeach ($this->application->classes->hierarchy($class_object, Class_Base::class) as $class_name) {\n\t\t\t$searches = [];\n\t\t\t$schema_path = $this->application->autoloader->search($class_name, [\n\t\t\t\t'sql',\n\t\t\t], $searches);\n\t\t\tif ($schema_path) {\n\t\t\t\treturn $schema_path;\n\t\t\t}\n\t\t\t$all_searches = array_merge($all_searches, $searches);\n\t\t}\n\t\t$schema_path = $this->application->autoloader->search($class_object->class, [\n\t\t\t'sql',\n\t\t], $searches);\n\t\tif ($schema_path) {\n\t\t\treturn $schema_path;\n\t\t}\n\t\t$all_searches = array_merge($all_searches, $searches);\n\t\t$this->searched = $all_searches;\n\t\treturn '';\n\t}",
"public function getSchema()\n {\n return realpath(__DIR__ . '/../../etc/table.xsd');\n }",
"public function paths(): array\n {\n return Arr::get($this->config, 'paths');\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Special validator Undefined value validator. Undefined values are controlled by VALIDATE_FLAG_UNDEFINED / VALIDATE_FLAG_UNDEFINED_TO_DEFAULT flags. All validators may have undefined flags to control undefined values. Supported Flags: N/A Supported Options: "default" Default value. Default value is subject to be validated also. | private function validateUndefined(&$inputs, $defined, $param, $id, $flags, $options, $func_opts)
{
// This function may modify $inputs to handle "undefined" (not existing) input
assert(is_array($inputs));
assert(is_bool($defined)); // defined/undefined indicator
assert(is_string($param) || is_int($param));
assert(is_int($flags));
assert(is_array($options));
assert(is_int($func_opts) && (!($func_opts & VALIDATE_OPT_UPPER)));
if (!$defined) { // false === undefined value
if ($flags & VALIDATE_FLAG_UNDEFINED_TO_DEFAULT) {
assert(isset($options['default']));
$inputs[$param] = $options['default'];
return true; // OK
} elseif ($flags & VALIDATE_FLAG_UNDEFINED) {
return false; // 1:Ignore
}
$this->internalError(
[
'message' => 'Undefined parameter: Required parameter is not defined.',
'value' => null
],
[$id, $flags, $options],
$func_opts
);
return false; // 2:Error - undefined not allowed
}
return true; // OK
} | [
"public function testDefaultRequiredValueWithBlankRequest()\n {\n $field = $this->getField('string_field');\n $field->setRequired(true);\n $field->setDefault(1);\n\n $_POST = [\n $field->name => '',\n ];\n\n $this->assertFalse($field->isValid());\n\n throw $field->getError();\n }",
"public function testGetdefaultvalueReturnsFalseIfNonDefined(): void\n {\n $cli = new Cli();\n\n /*\n * Setup the rules of engagement\n */\n $cli->arguments->add(\n [\n 'targetpath' => [\n 'prefix' => 't',\n 'longPrefix' => 'targetpath',\n 'description' => 'Path',\n ],\n ]\n );\n $cli->arguments->parse();\n\n $actual = $cli->arguments->getDefaultValue('targetpath');\n $this->assertFalse($actual);\n }",
"public function getDefaultValue();",
"public function isDefaultValueAvailable();",
"public function getDefaultValue() {}",
"public function testValueIsSet()\n {\n $valid = new \\Pv\\Validate\\None(null);\n $valid->setValue('test');\n\n $this->assertEquals('test', $valid->getValue());\n }",
"public function hasDefaultValue();",
"public function testDefaultValueWithBlankRequest()\n {\n $field = $this->getField('int_field');\n $field->setDefault(1);\n\n $_POST = [\n $field->name => '',\n ];\n\n $this->assertTrue($field->isValid());\n $this->assertNull($field->value);\n }",
"private function checkOptional()\n {\n if (empty($this->exception->getErrors())) {\n $has_default_value = $this->parameter->isDefaultValueAvailable();\n\n if ($this->optional) {\n if (!$has_default_value) {\n $this->exception->addError('The @argument of the @function must be optional.');\n }\n } else {\n if ($has_default_value) {\n $this->exception->addError('The @argument of the @function must not be optional.');\n }\n }\n }\n }",
"public function test_equals_returns_false_when_optional_and_input_null() {\n\t\t$optional = true;\n\t\t$params = ['must_equal_this'];\n\n\t\t$result = self::$validator->validate( null, $optional, $params );\n\t\t$this->assertTrue( $result );\n\t}",
"public static function validateDefaultValue()\n {\n return array(\n new Main\\Entity\\Validator\\Length(null, 255),\n );\n }",
"public function get_default_value();",
"public function test_required_returns_false_when_input_is_empty() {\n\t\t$required = new Required( new RespectValidator() );\n\t\t$result = $required->validate('');\n\t\t$this->assertFalse( $result );\n\t}",
"public function testDefaultValues() {\n\t\t$this->assertSame(false, $this->Condition->mustSendInQuery());\n\t\t$this->assertSame(false, $this->Condition->mustSendInBody());\n\t\t$this->assertSame(true, $this->Condition->mustSendInAny());\n\t\t$this->assertSame(false, $this->Condition->mustSendInVirtual());\n\t\t$this->assertSame(HttpSourceCondition::TYPE_STRING, $this->Condition->type());\n\t\t$this->assertSame(true, $this->Condition->null());\n\t\t$this->assertSame(null, $this->Condition->length());\n\t\t$this->assertSame(null, $this->Condition->key());\n\t\t$this->assertSame(null, $this->Condition->defaults());\n\t\t$this->assertSame(false, $this->Condition->extract());\n\t\t$this->assertSame(null, $this->Condition->mapToName());\n\t\tlist($callback, $mapToName) = $this->Condition->map();\n\t\t$this->assertSame(1, $callback(1));\n\t\t$this->assertSame(null, $mapToName);\n\t}",
"public function getValidOptionOrDefault($key, $defaultOption);",
"public function testDefaultValueWithBlankRequest()\n {\n $field = $this->getField('string_field');\n $field->setDefault(1);\n\n $_POST = [\n $field->name => '',\n ];\n\n $this->assertTrue($field->isValid());\n $this->assertNull($field->value);\n }",
"public function optional()\n {\n $this->required = false;\n }",
"public function optional();",
"public static function is_valid_default_value($value)\n {\n return is_scalar($value) || is_array($value) || is_null($value);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Operation editDocumentDocxDeleteTableRowRangeWithHttpInfo Deletes a range of multiple table rows in an existing table in a Word DOCX document | public function editDocumentDocxDeleteTableRowRangeWithHttpInfo($req_config)
{
$returnType = '\Swagger\Client\Model\DeleteDocxTableRowRangeResponse';
$request = $this->editDocumentDocxDeleteTableRowRangeRequest($req_config);
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 ($returnType !== 'string') {
$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\DeleteDocxTableRowRangeResponse',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
break;
}
throw $e;
}
} | [
"public function testEditDocumentDocxDeleteTableRowRange()\n {\n }",
"public function editDocumentDocxDeleteTableRow($req_config)\n {\n list($response) = $this->editDocumentDocxDeleteTableRowWithHttpInfo($req_config);\n return $response;\n }",
"public function editDocumentDocxDeleteTableRowWithHttpInfo($req_config)\n {\n $returnType = '\\Swagger\\Client\\Model\\DeleteDocxTableRowResponse';\n $request = $this->editDocumentDocxDeleteTableRowRequest($req_config);\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\\DeleteDocxTableRowResponse',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function editDocumentDocxDeleteTableRowRangeAsync($req_config)\n {\n return $this->editDocumentDocxDeleteTableRowRangeAsyncWithHttpInfo($req_config)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"protected function editDocumentDocxDeleteTableRowRequest($req_config)\n {\n // verify the required parameter 'req_config' is set\n if ($req_config === null || (is_array($req_config) && count($req_config) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $req_config when calling editDocumentDocxDeleteTableRow'\n );\n }\n\n $resourcePath = '/convert/edit/docx/delete-table-row';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\n if (isset($req_config)) {\n $_tempBody = $req_config;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json', 'text/json', 'application/xml', 'text/xml']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json', 'text/json', 'application/xml', 'text/xml'],\n ['application/json', 'text/json', 'application/xml', 'text/xml', 'application/x-www-form-urlencoded']\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\\Query::build($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Apikey');\n if ($apiKey !== null) {\n $headers['Apikey'] = $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\\Query::build($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function editDocumentDocxDeleteTableRowAsync($req_config)\n {\n return $this->editDocumentDocxDeleteTableRowAsyncWithHttpInfo($req_config)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function testEditDocumentDocxDeleteTableRow()\n {\n }",
"private function removeRangeAsyncWithHttpInfo(Requests\\removeRangeRequest $request) \n {\n $returnType = '\\Aspose\\Words\\Model\\DocumentResponse';\n $request = $request->createRequest($this->config);\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' || $returnType === 'FILES_COLLECTION') {\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 if ($this->config->getDebug()) {\n $this->_writeResponseLog($response->getStatusCode(), $response->getHeaders(), ObjectSerializer::deserialize($content, $returnType, $response->getHeaders()));\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, $response->getHeaders()),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) { \n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n\n if ($exception instanceof RepeatRequestException) {\n $this->_requestToken();\n throw new RepeatRequestException(\"Request must be retried\", 401, null, null);\n }\n\n throw new ApiException(\n sprintf('[%d] Error connecting to the API (%s)', $statusCode, $exception->getRequest()->getUri()), $statusCode, $response->getHeaders(), $response->getBody()\n );\n }\n );\n }",
"protected function editDocumentDocxGetTableRowRequest($req_config)\n {\n // verify the required parameter 'req_config' is set\n if ($req_config === null || (is_array($req_config) && count($req_config) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $req_config when calling editDocumentDocxGetTableRow'\n );\n }\n\n $resourcePath = '/convert/edit/docx/get-table-row';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\n if (isset($req_config)) {\n $_tempBody = $req_config;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json', 'text/json', 'application/xml', 'text/xml']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json', 'text/json', 'application/xml', 'text/xml'],\n ['application/json', 'text/json', 'application/xml', 'text/xml', 'application/x-www-form-urlencoded']\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\\Query::build($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Apikey');\n if ($apiKey !== null) {\n $headers['Apikey'] = $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\\Query::build($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function delrange($range) {\n $this->initialize(\"del\", $range);\n }",
"protected function editDocumentDocxInsertTableRowRequest($req_config)\n {\n // verify the required parameter 'req_config' is set\n if ($req_config === null || (is_array($req_config) && count($req_config) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $req_config when calling editDocumentDocxInsertTableRow'\n );\n }\n\n $resourcePath = '/convert/edit/docx/insert-table-row';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\n if (isset($req_config)) {\n $_tempBody = $req_config;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json', 'text/json', 'application/xml', 'text/xml']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json', 'text/json', 'application/xml', 'text/xml'],\n ['application/json', 'text/json', 'application/xml', 'text/xml', 'application/x-www-form-urlencoded']\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\\Query::build($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Apikey');\n if ($apiKey !== null) {\n $headers['Apikey'] = $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\\Query::build($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function editDocumentDocxDeletePagesAsyncWithHttpInfo($req_config)\n {\n $returnType = 'string';\n $request = $this->editDocumentDocxDeletePagesRequest($req_config);\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 }",
"public function editDocumentDocxUpdateTableRowAsyncWithHttpInfo($req_config)\n {\n $returnType = '\\Swagger\\Client\\Model\\UpdateDocxTableRowResponse';\n $request = $this->editDocumentDocxUpdateTableRowRequest($req_config);\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 }",
"public function editDocumentXlsxDeleteWorksheetWithHttpInfo($req_config)\n {\n $returnType = 'string';\n $request = $this->editDocumentXlsxDeleteWorksheetRequest($req_config);\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 'string',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function editDocumentXlsxGetRowsAndCellsAsyncWithHttpInfo($input)\n {\n $returnType = '\\Swagger\\Client\\Model\\GetXlsxRowsAndCellsResponse';\n $request = $this->editDocumentXlsxGetRowsAndCellsRequest($input);\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 }",
"public function editDocumentDocxUpdateTableRow($req_config)\n {\n list($response) = $this->editDocumentDocxUpdateTableRowWithHttpInfo($req_config);\n return $response;\n }",
"public function purgeDraftTableRowWithHttpInfo($table_id_or_name, $row_id)\n {\n $request = $this->purgeDraftTableRowRequest($table_id_or_name, $row_id);\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 (int) $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n } catch (ConnectException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n (int) $e->getCode(),\n null,\n 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 (string) $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n (string) $response->getBody()\n );\n }\n\n return [null, $statusCode, $response->getHeaders()];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n default:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\HubSpot\\Client\\Cms\\Hubdb\\Model\\Error',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function testDeleteDocument()\n {\n $this->client = static::makeclientWithLogin();\n $route = $this->getUrl('api_apiv1_document_deletedocument');\n $this->client->request('DELETE', $route, [], [], $this->mandatoryHeaders, '{\"ifpId\": 5}');\n $response = $this->client->getResponse();\n $this->assertEquals(204, $response->getStatusCode());\n }",
"public function editDocumentDocxRemoveHeadersAndFootersWithHttpInfo($req_config)\n {\n $returnType = '\\Swagger\\Client\\Model\\RemoveDocxHeadersAndFootersResponse';\n $request = $this->editDocumentDocxRemoveHeadersAndFootersRequest($req_config);\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\\RemoveDocxHeadersAndFootersResponse',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Handle the database "restored" event. | public function restored(Database $database)
{
//
} | [
"public function doRestore()\r\n {\r\n try {\r\n $this->restoreTables($this->tables);\r\n } catch (Exception $e) {\r\n $this->logResult(\"Failure : \" . $e->getMessage());\r\n }\r\n }",
"public function restored(Event $event)\n {\n //\n }",
"function post_restoreItem() {\n }",
"private function restore()\n\t{\n\t\t// get the db module - not needed but will prevent restore for\n\t\t// suites that don't use Db\n\t try {\n\t $this->_db = $this->getModule('Db');\n\t } catch (\\Exception $e) {\n\t return;\n\t }\n\n\t\t$this->writeln('Laxative: Restoring your database from backup...');\n\n\t\t// use pg_restore to restore from our binary backup\n\t\t$command = sprintf('pg_restore -h %s -U %s -d %s -c %s',\n\t\t\t$this->_host,\n\t\t\t'postgres',\n\t\t\t$this->_database,\n\t\t\t$this->_backupPath);\n\n\t\texec($command);\n\n\t\t$this->writeln('Done.');\n\t}",
"protected function afterRestore() {}",
"protected function beforeRestore() {}",
"public function restored(Employee $employee)\n {\n event(new EmployeeUpdated($employee, \"restore\"));\n }",
"protected static function registerRestoredHandler()\n {\n static::restored(function ($model) {\n foreach ($model->deletesWith() as $relation) {\n if ($model->{$relation}()->getMacro('onlyTrashed')) {\n $model->{$relation}()->onlyTrashed()->get()->each(function ($related) {\n $related->restore();\n });\n }\n }\n });\n }",
"public function restored(Incidente $incidente)\n {\n //\n }",
"public function restore() {\n\t\t$file = $this->jsondb_dir.$this->jsondb_active.'.json';\n\t\t$backup = file_get_contents($this->jsondb_dir.$this->jsondb_default.'.json');\n\t\tfile_put_contents($file, $backup);\n\t\t$this->log('(restore) SUCCESS: Database restored to default');\n\t\treturn;\n\t}",
"function db_alt_tabellen_restore()\n\t{\n\t\t$this->db_alt_tabellen = $_SESSION['update']['db_alt_tabellen'];\n\t}",
"public function restored(DatabaseFile $databaseFile)\n {\n //\n }",
"public function restored(Recordable $model): void\n {\n Accountant::record($model, 'restored');\n\n // Once the event terminates, the state is reverted\n static::$restoring = false;\n }",
"private function databaseRestore()\n {\n $userName = self::$config['database']['user'];\n $password = self::$config['database']['password'] ?? '';\n $dbName = self::$config['database']['name'];\n $dbSource = self::$config['database']['source'];\n\n $command = \"mysql -u \" . $userName . \" \";\n if ($password) {\n $command .= \"-p\" . $password . ' ';\n }\n $command .= $dbName . ' < ' . $dbSource;\n shell_exec($command);\n }",
"public function restore()\r\n {\r\n $handlerFunctionName = 'restore_'.$this->handlerType.'_handler';\r\n $handlerFunctionName();\r\n }",
"function restoreEvent($eventId)\n {\n // restore the event\n mysql_query(\"UPDATE argus_events SET status = 'SAVED' where event_id = '\".$eventId.\"' AND status = 'DELETED'\") or die(mysql_error());\n \n return;\n }",
"public function resetDBToOriginal(){\n\t\t// Restore the database to its original settings\n\t\t$sql = 'gabriel_db.sql';\n\t\t$mysql = '/usr/local/bin/mysql';\n\t\t$host = 'localhost';\n\t\t$login = '';\n\t\t$password = '';\n\t\t$output = null;\n\t\t\n\t\tif(isset($_POST['restore']) || isset($_GET['restore'])) {\n\t\t $cmd = \"$mysql -h{$host} -u{$login} -p{$password} < $sql\";\n\t\t exec($cmd);\n\t\t $output = \"<p>Database has been reset via command<br/><code>{$cmd}</code></p>\";\n\t\t}\n\t}",
"public function restored(Transaction $transaction)\n {\n //\n }",
"private function localRestore()\n\t{\n\t\t$this->writeln('Laxative: Restoring local database from base...');\n\n\t\t$this->_db->_reconfigure(array('populate' => true));\n\t\t$this->_db->_initialize();\n\n\t\t$this->writeln('Done.');\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets a Geometry object that represents the Point set intersection of Geometry object with $other Geometry object. | public function intersection(Geometry $geometry, Geometry $other): Geometry; | [
"public function intersection(Geometry $geometry) : Geometry\n {\n return GeometryEngineRegistry::get()->intersection($this, $geometry);\n }",
"public function intersects(Geometry $geometry, Geometry $other): bool;",
"public function within(Geometry $geometry, Geometry $other): bool;",
"public function intersect(BaseSet $otherSet)\n {\n $intersection = new IntersectionSet($this->redis);\n $intersection->addSet($this, $otherSet);\n return $intersection;\n }",
"function &first_unckd_intersect () \n { \n $v =& $this->first; \n do // Do-While \n { // Not yet reached end of the polygon \n $v =& $v->Next(); // AND the vertex if NOT an intersection \n } // OR it IS an intersection, but has been checked already \n while($v->id() != $this->first->id() && ( !$v->isIntersect() || ( $v->isIntersect() && $v->isChecked() ) ) ); \n return $v; \n }",
"public function symDifference(Geometry $geometry, Geometry $other): Geometry;",
"public function getIntersection()\n\t{\n\n\t\treturn $this->intersection;\n\t}",
"public function geoWithin(Geometry $geometry)\n {\n $this->expr->geoWithin($geometry);\n return $this;\n }",
"public function intersection(Interval $other): self\n {\n return new self(\\max($this->start, $other->start), \\min($this->stop, $other->stop));\n }",
"public function overlaps(Geometry $geometry, Geometry $other): bool;",
"public function within($geometry);",
"public function locateBetween(Geometry $geometry, float $mStart, float $mEnd): Geometry;",
"public function intersection($expression) {\n $toJoin = new MathInterval($expression);\n \n // Handle float values.\n $this->allowFloat = $this->allowFloat || $toJoin->allowFloats();\n\n // Handle empty intervals.\n // Intersection with an empty interval is always empty.\n if ($toJoin->isEmpty()) {\n return $this->setEmpty();\n }\n elseif ($this->isEmpty()) {\n return $this;\n }\n\n // No empty intervals. Intersect.\n // Check if $this contains $toJoin;\n if ($this->getLowerBound() < $toJoin->getLowerBound() && $this->getUpperBound() > $toJoin->getUpperBound()) {\n // Copy $toJoin.\n $this->lBoundIn = $toJoin->includeLowerBound();\n $this->lBound = $toJoin->getLowerBound();\n $this->uBound = $toJoin->getUpperBound();\n $this->uBoundIn = $toJoin->includeUpperBound();\n // Allowing floats depends on both intervals. Do not copy this property.\n // $this->allowFloat = $toJoin->allowFloats();\n $this->emptyInterval = $toJoin->isEmpty();\n return $this;\n }\n // Check if $toJoin contains $this;\n elseif ($this->getLowerBound() > $toJoin->getLowerBound() && $this->getUpperBound() < $toJoin->getUpperBound()) {\n return $this;\n }\n \n // Find out which interval comes first.\n if ($this->getLowerBound() <= $toJoin->getLowerBound() && $this->getUpperBound() <= $toJoin->getUpperBound()) {\n $first = $this;\n $second = $toJoin;\n }\n else {\n $first = $toJoin;\n $second = $this;\n }\n \n // Case:\n // __________ _________\n // | |\n //------------------------\n if ($first->getUpperBound() < $second->getLowerBound()) {\n // No intersection.\n return $this->setEmpty();\n }\n // Case: (the upper and lower are the same.)\n // ___________________\n // |\n //------------------------\n elseif ($first->getUpperBound() == $second->getLowerBound()) {\n // The only possible option here is an interval with only one value allowed\n // like [1,1] but for that both bounds need to be included.\n if ($first->includeUpperBound() && $second->includeLowerBound()) {\n $this->lBoundIn = TRUE;\n $this->lBound = $first->getUpperBound();\n $this->uBound = $first->getUpperBound();\n $this->uBoundIn = TRUE;\n return $this;\n }\n else {\n // No intersection.\n return $this->setEmpty();\n }\n }\n // Case: (Intervals overlap. Account for inclusions.)\n // _____________\n // |____________| --> $second\n // | | --> $first\n //------------------------\n elseif ($first->getLowerBound() == $second->getLowerBound() && $first->getUpperBound() == $second->getUpperBound()) {\n // Values are the same. Set only inclusions.\n $this->lBoundIn = $first->includeLowerBound() && $second->includeLowerBound();\n $this->uBoundIn = $first->includeUpperBound() && $second->includeUpperBound();\n return $this;\n }\n // Case: (Intervals overlap on lower.)\n // __________________\n // |_____________ | --> $second\n // | | --> $first\n //------------------------\n elseif ($first->getLowerBound() == $second->getLowerBound() && $first->getUpperBound() < $second->getUpperBound()) {\n // Values are the same. Set only inclusions.\n $this->lBoundIn = $first->includeLowerBound() && $second->includeLowerBound();\n $this->lBound = $first->getLowerBound();\n $this->uBound = $first->getUpperBound();\n $this->uBoundIn = $first->includeUpperBound();\n return $this;\n }\n // Case: (Intervals overlap on upper.)\n // __________________\n // | _____________| --> $first\n // | | --> $second\n //------------------------\n elseif ($first->getLowerBound() < $second->getLowerBound() && $first->getUpperBound() == $second->getUpperBound()) {\n // Values are the same. Set only inclusions.\n $this->lBoundIn = $second->includeLowerBound();\n $this->lBound = $second->getLowerBound();\n $this->uBound = $second->getUpperBound();\n $this->uBoundIn = $first->includeUpperBound() && $second->includeUpperBound();\n return $this;\n }\n // Having excluded all other cases the remaining one is:\n // ____________\n // ______|_______ | --> $second\n // | --> $first\n //------------------------\n // The upper bound belongs to $first and\n // the lower bound belongs to $second.\n else {\n $this->lBoundIn = $second->includeLowerBound();\n $this->lBound = $second->getLowerBound();\n $this->uBound = $first->getUpperBound();\n $this->uBoundIn = $first->includeUpperBound();\n return $this;\n }\n }",
"public function disjoint(Geometry $geometry, Geometry $other): bool;",
"public function intersect($otherRect) {}",
"function intersection($other) {\n $cc = dict();\n foreach($this->_dct as $k => $v)\n $cc[$k] = 1;\n foreach(func_get_args() as $xs) {\n foreach(iter($xs) as $x)\n if(isset($cc[$x]))\n $cc[$x] += 1;\n }\n $a = array();\n $n = func_num_args() + 1;\n foreach($cc as $k => $c)\n if($c === $n)\n $a []= $k;\n return set($a);\n }",
"private function intersectsGeometry(GeometryInterface $geometry1, GeometryInterface $geometry2): bool\n {\n if ($geometry1 instanceof Coordinate && $geometry2 instanceof Coordinate) {\n return $geometry1->hasSameLocation($geometry2);\n }\n\n if ($geometry1 instanceof Coordinate || $geometry2 instanceof Coordinate) {\n throw new InvalidGeometryException('Only can check point intersections for polygons', 7311194789);\n }\n\n if (($geometry1 instanceof Polygon) && $geometry1->containsGeometry($geometry2)) {\n return true;\n }\n\n if (($geometry2 instanceof Polygon) && $geometry2->containsGeometry($geometry1)) {\n return true;\n }\n\n /** @var Line|Polyline|Polygon $geometry1 */\n foreach ($geometry1->getSegments() as $segment) {\n /** @var Line|Polyline|Polygon $geometry2 */\n foreach ($geometry2->getSegments() as $otherSegment) {\n if ($segment->intersectsLine($otherSegment)) {\n return true;\n }\n }\n }\n\n return false;\n }",
"public static function fromGeometry(Geometry\\GeometryInterface $geometry)\n {\n if ('Point' === $geometry->getGeometryType()) {\n return new self(\n new LatLng($geometry->getY(), $geometry->getX()),\n new LatLng($geometry->getY(), $geometry->getX())\n );\n } else {\n $bounds = null;\n foreach ($geometry->all() as $component) {\n if (null === $bounds) {\n $bounds = self::fromGeometry($component);\n } else {\n $bounds->extendByBounds(self::fromGeometry($component));\n }\n }\n\n return $bounds;\n }\n }",
"public function convexHull() : Geometry\n {\n return GeometryEngineRegistry::get()->convexHull($this);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Generated from protobuf field .io.token.proto.common.tsp.bankconfig.BankConfig.CzechPsd2Standard czech_psd2_standard = 7; | public function getCzechPsd2Standard()
{
return $this->readOneof(7);
} | [
"public function getBudapestPsd2Standard()\n {\n return $this->readOneof(8);\n }",
"public function getStetPsd2Standard()\n {\n return $this->readOneof(5);\n }",
"public function setStetPsd2Standard($var)\n {\n GPBUtil::checkMessage($var, \\Io\\Token\\Proto\\Common\\Tsp\\Bankconfig\\BankConfig_StetPsd2Standard::class);\n $this->writeOneof(5, $var);\n\n return $this;\n }",
"public function getNextGenPsd2Standard()\n {\n return $this->readOneof(2);\n }",
"public function setNextGenPsd2Standard($var)\n {\n GPBUtil::checkMessage($var, \\Io\\Token\\Proto\\Common\\Tsp\\Bankconfig\\BankConfig_NextGenPsd2Standard::class);\n $this->writeOneof(2, $var);\n\n return $this;\n }",
"public function getOehddiscpct2()\n {\n return $this->oehddiscpct2;\n }",
"public function getBrutCaisse2() {\n return $this->brutCaisse2;\n }",
"public function getCumBrutCaisse2() {\n return $this->cumBrutCaisse2;\n }",
"private function getStandard() {\n\n $standard = $this->getConfig('standard');\n if (!$standard) {\n $standard == self::DEFAULT_STANDARD;\n }\n\n exec(sprintf('%s -i', $this->getPHPCSExecutablePath()), $output);\n $standardsInstalled = explode(' ', str_replace(array('The installed coding standards are ', ','), '', $output[0]));\n if (!in_array($standard, $standardsInstalled)) {\n $standard = $standardsInstalled[0];\n }\n\n return $standard;\n }",
"public function getSommesPeriodeDeb2() {\n return $this->sommesPeriodeDeb2;\n }",
"public function getCumPlafondSs2() {\n return $this->cumPlafondSs2;\n }",
"public function getSpCode2()\n {\n return $this->sp_code2;\n }",
"public function getCvssV2()\n {\n return $this->cvss_v2;\n }",
"public function getC3n2()\n {\n return $this->c3n2;\n }",
"public function getSizeTwoCd()\n {\n return $this->size_two_cd;\n }",
"public function getPlafond1Caisse2() {\n return $this->plafond1Caisse2;\n }",
"public function getplafondSs2() {\n return $this->plafondSs2;\n }",
"public function getCountryIso2()\n {\n return $this->getCountry() ? $this->getCountry()->getIso2Code() : '';\n }",
"public function getSecondCurrency()\n {\n return $this->secondCurrency;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set the value of DateRun / date_run. | public function setDateRun($value)
{
$this->validateDate('DateRun', $value);
if ($this->data['date_run'] === $value) {
return;
}
$this->data['date_run'] = $value;
$this->setModified('date_run');
} | [
"function setDate( $value )\r\n {\r\n $this->Date = $value;\r\n }",
"function setDate( $value )\n {\n if ( $this->State_ == \"Dirty\" )\n $this->get( $this->ID );\n $this->Date = $value;\n }",
"public function setRunDateTime(?DateTime $value): void {\n $this->getBackingStore()->set('runDateTime', $value);\n }",
"function setDate( $value )\r\n {\r\n $this->SentDate = $value;\r\n }",
"public function setRunDate(DateTime $runDate): self\n {\n $this->runDate = $runDate;\n return $this;\n }",
"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 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 setValutaDate($valutaDate) {\n\t\t$this->valutaDate = $valutaDate;\n\t\t\n\t\t$this->doUpdate(\"SET valuta_date = '\" . $valutaDate->getDate() . \"'\");\n\t}",
"public function setRushDateAttribute($value): void\n {\n $this->attributes['rush_date'] = date_is_valid($value)\n ? date('Y-m-d H:i:s', strtotime($value))\n : null;\n }",
"public function set_date()\n {\n $this->getProject();\n $values = $this->request->getJson();\n\n $result = $this->taskModel->update([\n 'id' => $values['id'],\n 'date_started' => strtotime($values['start']),\n 'date_due' => strtotime($values['end']),\n ]);\n\n if (!$result) {\n $this->response->json(['message' => 'Unable to save task'], 400);\n } else {\n $this->response->json(['message' => 'OK'], 201);\n }\n }",
"function setDate($value = '') {\n $this->date = ($value == '' ? DateManager::get_Date() : DateManager::format_Date($value));\n }",
"function setDate($date)\r\n {\r\n $this->_date = $date;\r\n }",
"function setDay($value) {\n $this->day = (integer) $value;\n $this->setTimestampFromAttributes();\n }",
"function setDay( $value )\r\n {\r\n $this->Day = $value;\r\n setType( $this->Day, \"integer\" );\r\n }",
"public function setDate($date)\n {\n }",
"public static function setRateRun(Db $db, $date, $id) {\n if ( strtotime($date) && $id ) {\n $db->query('UPDATE properties SET rate_run=\"' . $date . '\" WHERE id=\"' . $id. '\"');\n }\n }",
"public function setDate($year, $month, $day);",
"public function setPostDate($value){\n\t\t\t$this->date_created = $value;\n\t\t}",
"function set_call_date($call_date) {\n $this->call_date = $call_date;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Display HTML. Render HTML of current track. This function should display input field. | public function display_track_html( self $track, $post_id, $data, $valid ); | [
"public function render_content()\n\t\t{ ?>\n\t\t\t<label><p style=\"margin-bottom:0;\">\n <span class=\"customize-control-title\" style=\"margin:0;display:inline-block;\"><?php echo esc_html( $this->label ); ?>\n </span>\n <span class=\"value\">\n <input name=\"<?php echo esc_attr( $this->id ); ?>\" type=\"text\" <?php $this->link(); ?> value=\"<?php echo esc_attr( $this->value() );?>\" class=\"slider-input\" />\n <span class=\"px\">px</span>\n </span></p></label> <?php // WPCS: XSS ok. ?>\n\t\t\t<div class=\"slider\"></div>\n\t\t<?php\n\t\t}",
"public function render_content() {\r\n\t\t\t?>\r\n\t\t\t<label>\r\n\t\t\t\t<span class=\"customize-control-title\"><?php echo esc_html( $this->label); ?></span>\r\n\t\t\t\t<span class=\"description customize-control-description\"><?php echo esc_html( $this->description); ?></span>\r\n\t\t\t\t<input class=\"custorange\" type=\"range\" id=\"input-<?php echo esc_html( $this->id ); ?>\" <?php $this->link(); ?> value=\"<?php echo esc_html( $this->value() ); ?>\" <?php $this->input_attrs(); ?> onmousemove=\"if(this.focus){this.nextElementSibling.innerHTML=this.value;}\" ontouchmove=\"if(this.focus){this.nextElementSibling.innerHTML=this.value;}\">\r\n\t\t\t\t<span class=\"range-value\"><?php echo esc_html( $this->value() ); ?></span>\r\n\t\t\t</label>\r\n\t\t\t<?php\t\r\n\t\t}",
"public function render_content() {\n?>\n\t\t\t<label>\n <p style=\"margin-bottom:0;\">\n <span class=\"customize-control-title\" style=\"margin:0;display:inline-block;\"><?php echo esc_html( $this->label ); ?></span>\n <span class=\"value\">\n <input name=\"<?php echo esc_attr( $this->id ); ?>\" type=\"text\" <?php $this->link(); ?> value=\"<?php echo esc_attr( $this->value() ); ?>\" class=\"slider-input\" />\n </span>\n </p>\n </label>\n\t\t\t<div class=\"slider\"></div>\n\t\t<?php\n\t\t}",
"protected function showHtml()\n {\n }",
"protected function uploadHTML() {\n echo $this->uploadHTML;\n }",
"public function render_content() {\n\t\techo '<label>';\n\n\t\t\tif ( isset( $this->label ) && '' !== $this->label ) {\n\t\t\t\techo '<span class=\"zeen-control-subtitle\">' . sanitize_text_field( $this->label ) . '</span>';\n\t\t\t}\n\t\t\tif ( isset( $this->description ) && '' !== $this->description ) {\n\t\t\t\techo '<span class=\"description zeen-control-description\">' . sanitize_text_field( $this->description ) . '</span>';\n\t\t\t}\n\n\t\techo '</label>';\n\t}",
"function render()\n {\n print($this->html->renderTag());\n }",
"public function displayHtml() : void {\n\t\techo $this->substitute($this->currTemplate);\n\t}",
"public function printContent()\n {\n\n $this->form->render($this->renderer);\n\n echo $this->renderer;\n\n }",
"public function display()\r\n {\r\n $length = $this->getMetadata('@length', 'max', 255);\r\n\r\n echo '<input type=\"text\" name=\"' . get_class($this->object) . '[' . $this->property . ']\"'\r\n . ' maxlength=\"' . $length . '\" value=\"' . htmlspecialchars($this->value) . '\"/>';\r\n }",
"function display()\n {\n if ($this->label != \"\") print \"<label style='display: inline-block;width: 8em; margin:5px; margin-right: 1em'>$this->label</label> \\n\";\n if($this->type == \"textarea\") {\n print \"<textarea name='$this->name' placeholder='$this->placeholder'>$this->value</textarea><br> \\n\";\n }else{\n print \"<input type='$this->type' name='$this->name' value='$this->value' \n placeholder='$this->placeholder' $this->required><br> \\n\";\n }\n }",
"public function display()\n \t{\n \t\techo $this->render();\n \t}",
"public function renderSnippetHtml()\n {\n return $this->renderHtml($this->snippet());\n }",
"protected function renderInput()\n {\n if ($this->hasModel()) {\n $input = Html::activeTextArea($this->model, $this->attribute, $this->options);\n } else {\n $input = Html::textArea($this->name, $this->value, $this->options);\n }\n Html::addCssClass($this->previewOptions, 'hidden');\n $preview = Html::tag('div', '', $this->previewOptions);\n return $input . \"\\n\" . $preview;\n }",
"function RenderField($class, $id, $caption, $value, $exact=false)\n{\n echo '<div id=\"' . $id . '_block\" class=\"' . $class . '_block\">';\n echo '<div id=\"' . $id . '_label\" class=\"' . $class . '_label\">' . $caption . '</div>' . \"\\n\";\n echo '<div id=\"' . $id . '_value\" class=\"' . $class . '_value\">' ;\n if($exact) echo '<pre>' . $value . '</pre></div>' . \"\\n\";\n else echo $value . '</div>' . \"\\n\";\n echo '</div>' . \"\\n\";\n}",
"public function render_content() {\n\t\t// We do this to allow the upload control to specify certain labels\n\t\t$l10n = json_encode( $this->l10n );\n\n\t\t// Control title\n\t\tprintf(\n\t\t\t'<span class=\"customize-control-title\" data-l10n=\"%s\" data-mime=\"%s\">%s</span>',\n\t\t\tesc_attr( $l10n ),\n\t\t\tesc_attr( $this->mime_type ),\n\t\t\tesc_html( $this->label )\n\t\t);\n\n\t\t// Control description\n\t\tif ( ! empty( $this->description ) ) : ?>\n\t\t\t<span class=\"description customize-control-description\"><?php echo $this->description; ?></span>\n\t\t<?php endif; ?>\n\n\t\t<div class=\"current\"></div>\n\t\t<div class=\"actions\"></div>\n\t\t<?php\n\t}",
"public function display()\n {\n echo $this->get_content();\n }",
"protected function render()\n {\n $options = $this->getOptions();\n \n $content = $options['html'] ? $this->getText() : htmlentities($this->getText());\n $html = '<a' . $this->renderAttrs() . '>' . $content . '</a>';\n \n if ($options['container']) {\n $id_attr = $this->getAttr('id') ? ' id=\"' . $this->getAttr('id') . '-container\"' : '';\n $html = \"<div{$id_attr} class=\\\"control-container\\\">\\n{$html}\\n</div>\";\n }\n \n return $html;\n }",
"public function saveHTML()\n\t\t{\n\t\t\t$control = '<' . $this->tag;\n\t\t\tif ($this->name) {\n\t\t\t\t$control .= ' name=\"' . $this->name . '\"';\n\t\t\t}\n\n\t\t\tif ($this->id) {\n\t\t\t\t$control .= ' id=\"' . $this->id . '\"';\n\t\t\t}\n\n\t\t\tif (\\count($this->attribute)) {\n\t\t\t\tforeach ($this->attribute as $attr => $value) {\n\t\t\t\t\t$control .= ' ' . $attr;\n\t\t\t\t\tif (null !== $value) {\n\t\t\t\t\t\t$control .= '=\"' . $this->getHTMLValue($value) . '\"';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (\\count($this->dataset)) {\n\t\t\t\tforeach ($this->dataset as $name => $value) {\n\t\t\t\t\t$control .= ' data-' . $name . '=\"' . $this->getHTMLValue($value) . '\"';\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (\\count($this->className)) {\n\t\t\t\t$control .= ' class=\"' . implode(' ', $this->className) . '\"';\n\t\t\t}\n\n\t\t\tif (null !== $this->value) {\n\t\t\t\t$control .= ' value=\"' . $this->getHTMLValue($this->value) . '\"';\n\t\t\t}\n\n\t\t\tif (!$this->isVoid) {\n\t\t\t\t$control .= '>' . $this->text . '</' . $this->tag . '>';\n\t\t\t} else {\n\t\t\t\t$control .= ' />';\n\t\t\t}\n\n\t\t\treturn $control;\n\t\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set the status to terminate and exit the app | private function terminate(): void
{
$this->status = Status::APP_TERMINATE;
if ($this->stdin == null) {
exit(0);
}
} | [
"public function terminate()\n {\n $this->app->terminate();\n }",
"protected function onTerminate($exitCode) {}",
"public function terminate($status = null): void\n {\n exit($status);\n }",
"public function terminate()\n {\n $this->fireAppCallbacks($this->terminatingCallbacks);\n }",
"public static function stop(): void {\n self::$status = AppStatusEnum::STOPPED();\n\n self::$logger->notice(\"Application stopped.\");\n }",
"public function terminate()\n {\n }",
"public static function doExit($status = 0)\n {\n exit($status);\n }",
"final protected function _exit()\n {\n $this->abort();\n exit();\n }",
"abstract public function onExited($status);",
"function stop()\n {\n $this->cli->quietly('launchctl unload '.$this->daemonPath);\n }",
"public function terminateWithStatus($status)\n {\n app(HorizonCommandQueue::class)->push(\n $this->options->name, Terminate::class, ['status' => $status]\n );\n }",
"public function terminate()\n {\n if (function_exists('posix_kill')) {\n posix_kill($this->pid, 15);\n } elseif (PHP_OS === 'WINNT') {\n exec('taskkill /PID '.escapeshellarg($this->pid));\n } else {\n exec('kill -15 '.escapeshellarg($this->pid));\n }\n }",
"protected function terminate(): void {\n http_response_code(404);\n die($this->error_message);\n }",
"final public function abort() {\n exit();\n }",
"public function setTerminated()\n {\n $this->setState(\"TERMINATED\");\n }",
"public function quit()\r\n {\r\n $this['events']->fire('app.quitting', [$this]);\r\n }",
"protected function endProcess() {\n $this->statusHandler->SetStatus(StatusHandler::STOPPED, FALSE);\n $this->statusHandler->logStatus('ok', 'The @drush-cmd daemon has stopped.');\n }",
"protected function _terminate()\n {\n $this->_log(__METHOD__, 'running the termination routine', Parsonline_Network_SSH2::LOG_DEBUG);\n try {\n $this->execute('exit');\n } catch(Exception $exp) {\n }\n }",
"protected function shutdown()\n\t{\n\t\tif ($this->isChild) {\n\t\t\t$this->debug(self::D_INFO . 'Child exit');\n\t\t\t$this->cleanup();\n\n\t\t\tclass_exists('Aza\\Kernel\\Core', false)\n\t\t\t\t\t&& Core::stopApplication(true);\n\n\t\t\texit;\n\t\t}\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This method returns the value associated with the given name if it is still fresh, otherwise it will return null. You can set a minimum freshness time. | public function getIfFresh( $name, $freshness = 0 ) {
$freshness = $this->getTimeout( $freshness );
$info = $this->getInfo( $name );
if ( $info && $info['mtime'] >= $freshness ) {
return $this->get( $name );
} else {
return null;
}
} | [
"public function get( $fresh = false ) {\n\n\t\t\t// Check transient, will return false if expired\n\t\t\t// If expired, get_transient() will delete the transient\n\t\t\tif ( $fresh || false === ( $value = get_transient( $this->name ) ) ) {\n\t\t\t\t$this->set_transient();\n\t\t\t\t$value = $this->value;\n\t\t\t}\n\n\t\t\t// Return value\n\t\t\treturn $value;\n\n\t\t}",
"public function getFresh()\n {\n return $this->get(self::_FRESH);\n }",
"function mem2_get($name) {\n $name = mem2_key_name($name);\n $v = mem_get($name);\n if ($v == false) return false;\n // Check if expired\n if ( (time() - $v[0]) > $v[1] ) {\n // Make as non-expired and return false to make the current caller to regenerate\n $v[0] = time();\n $v[1] = 60;\n mem_set($name, $v, 120);\n return false;\n }\n return $v[2];\n}",
"private function getObject($name){\n return $this->cache->get($name);\n }",
"public function fresh(string $key)\n {\n return $this->forget($key)->get($key);\n }",
"public function read_cached_attribute($name) {\n if ( is_null($this->cached_attributes) && (!isset($this->cached_attributes[$name])) )\n return null;\n return $this->cached_attributes[$name];\n }",
"function getItem($name){\n\t\t$i = cacheItem::getInstance($name);\n\t\tif(empty($i->cacheTime) && empty($i->content) ){\n\t\t\t$datas = $this->db->select_row(self::$tableName,'*',array('WHERE name=?',$name));\n\t\t\tif( false !== $datas)\n\t\t\t\t$i->setDatas($datas);\n\t\t}\n\t\treturn $i;\n\t}",
"function select_random_value_by_name($name)\n\t{\n\t\treturn $this->select_random_by_name($name,-1);\n\t}",
"public function __get($name) {\n\t\t// if we don't have getter for this property we can run final getter implemented\n\t\t// in this class, or we will return nothing\n\t\tif(!method_exists($this, '__get_'.$name)) {\n\t\t\tif (!method_exists($this, '__get_final')) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn $this->__get_final($name);\n\t\t}\n\n\t\t// save cache options\n\t\t$classname = get_called_class();\n\t\t$cacheable = $classname::$cacheable;\n\t\t$cachehard = $classname::$cachehard;\n\n\t\t// this variable is not cacheable, return it right now\n\t\tif(!isset($cacheable[$name])) {\n\t\t\treturn call_user_func(array($this,'__get_'.$name));\n\t\t}\n\n\t\t// if this is a short caching, dump it and return variable\n\t\tif( $cacheable[$name] == 0 ) {\n\t\t\treturn ( $this->{$name} = call_user_func(array($this, '__get_'.$name)) );\n\t\t}\n\n\t\t$long_cache_id = $this->object_id().\".cached.\".$name;\n\t\t// looks like we want have long cache, return it\n\t\tif(isset(D::$cache->{$long_cache_id})) {\n\t\t\treturn ( $this->{$name} = D::$cache->{$long_cache_id} );\n\t\t}\n\n\t\t// check if we have hard cache\n\t\tif(isset($cachehard[$name])) {\n\t\t\t$hard_cache_id = $this->object_id().\".hrdata.\".$name;\n\t\t\t$lock_code = '__lock_'.$long_cache_id;\n\t\t\t$hard_cache_lock = \"__hardlock_\".$long_cache_id;\n\n\t\t\t// looks like somebody is building cache, but we have old hard cache, return it\n\t\t\tif(isset(D::$cache->{$hard_cache_lock}) && isset(D::$cache->{$hard_cache_id})) {\n\t\t\t\treturn ( $this->{$name} = D::$cache->{$hard_cache_id} );\n\t\t\t}\n\n\t\t\tD::$cache->set($hard_cache_lock, $lock_code, $cacheable[$name] );\n\t\t\t// если результат запроса не получен из кэша тяжелых элементов\n\t\t\t$this->{$name} = call_user_func(array($this, '__get_'.$name));\n\t\t\tD::$cache->set($hard_cache_id, $this->{$name}, $cacheable[$name] * 100);\n\n\t\t} else {\n\t\t\t$this->{$name} = call_user_func(array($this, '__get_'.$name));\n\t\t}\n\n\t\tD::$cache->set($long_cache_id, $this->{$name}, $cacheable[$name]);\n\t\treturn $this->{$name};\n\t}",
"public function isFresh()\n {\n return $this->fresh;\n }",
"public static function getLatest(string $name): ?Item\n {\n return self::where([\"name\" => $name])\n ->orderBy(\"created_at\", \"desc\")\n ->first()\n ;\n }",
"public function get()\n {\n $this->value = get_transient($this->name);\n\n return $this->value;\n }",
"public function __get($name) {\n if (is_null($this->local)) {\n $this->local = new Chronos;\n }\n return $this->local->$name;\n }",
"public function getVolatileData($name) {\n\t\treturn array_key_exists($name, $this->volatile) ? $this->volatile[$name] : null;\n\t}",
"public function GetSetting($name)\r\n\t\t{\r\n\t\t\tif (!$this->SettingsCache[$name])\r\n\t\t\t{\r\n\t\t\t\t$this->SettingsCache[$name] = $this->DB->GetOne(\"SELECT `value` FROM `farm_instance_settings` WHERE `farm_instanceid`=? AND `name` = ?\",\r\n\t\t\t\tarray(\r\n\t\t\t\t\t$this->ID,\r\n\t\t\t\t\t$name\r\n\t\t\t\t));\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\treturn $this->SettingsCache[$name];\r\n\t\t}",
"protected function get_is_fresh(): bool\n\t{\n\t\treturn $this->ttl > 0;\n\t}",
"public function value_get($name) {\n if(!$this->value_exists($name)) return FALSE;\n\n return $this->_values[$name];\n }",
"public static function forge($name = 'default') {\n\t\tif(isset(static::$_instances[$name])) {\n\t\t\t\\Error::notice('OpenGraph with this name exists already, cannot be overwritten.');\n\t\t\treturn static::$_instances[$name];\n\t\t}\n\t\tstatic::$_instances[$name] = new PropertyHolder($name);\n\n\t\tif ($name == 'default')\n\t\t\tstatic::$_instance = static::$_instances[$name];\n\n\t\treturn static::$_instances[$name];\n\t}",
"public function fresh()\n {\n return $this->api->request($this->request::find($this->getKey()));\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Ensures that itemLookup() works as expected | public function testItemLookup()
{
$item = $this->_amazon->itemLookup('B0015T963C');
$this->assertTrue($item instanceof Zend_Service_Amazon_Item);
} | [
"public function getLookupItems();",
"public function lookupItem($item_id);",
"public function testLookupEntries()\n {\n }",
"public function testItemLookupExceptionAsinInvalid()\n {\n try {\n $this->_amazon->itemLookup('oops');\n $this->fail('Expected Zend_Service_Exception not thrown');\n } catch (Zend_Service_Exception $e) {\n $this->assertStringContainsString('not a valid value for ItemId', $e->getMessage());\n }\n }",
"public function testBuildLookup()\n\t{\n\t\t$this->assertEquals(array(\n\t\t\t'*' => array(\n\t\t\t\t'featured' => '47',\n\t\t\t\t'categories' => array(14 => '48'),\n\t\t\t\t'category' => array (20 => '49'),\n\t\t\t\t'article' => array(1 => '52')),\n\t\t\t), $this->object->get('lookup')\n\t\t);\n\n\t\t$this->object->runBuildLookUp('en-GB');\n\t\t$this->assertEquals(array(\n\t\t\t'*' => array(\n\t\t\t\t'featured' => '47',\n\t\t\t\t'categories' => array(14 => '48'),\n\t\t\t\t'category' => array (20 => '49'),\n\t\t\t\t'article' => array(1 => '52')),\n\t\t\t'en-GB' => array(\n\t\t\t\t'featured' => '51',\n\t\t\t\t'categories' => array(14 => '50'),\n\t\t\t\t'category' => array (20 => '49'),\n\t\t\t\t'article' => array(1 => '52')),\n\t\t\t), $this->object->get('lookup')\n\t\t);\n\t}",
"public function getLookupResult();",
"public function testFindByItemWhenRecordExists()\n {\n\n // Create item and object.\n $item = $this->__item();\n $object = $this->__object($item);\n\n // Retrieve.\n $retrievedObject = $this->objectsTable->findByItem($item);\n $this->assertEquals($retrievedObject->id, $object->id);\n\n }",
"public function getLookups()\n {\n }",
"function lookUpItem($exact_ndc,$ndc,$name){\n\t\t$items = [];\n\t\t$looked_up_by_name = false;\n\t\tif(strlen($exact_ndc) > 0){//For states where exact ndc is required, need to look up only by NDC, if not found it may be a drug to add, but only if it has full set of new rows\n\t\t\t//search using exact ndc\n\t\t\t$items = item::search(['upc' => $exact_ndc]); //switched to use find so its as broad a search as allowed in the UI searchbar\n\t\t} else {\n\t\t\tif(strlen($ndc) > 0){ //if not required, use the regular ndc field, which for coleman is going to match, for everyone else, it may or may not match\n\t\t\t\t$items = item::search(['upc' => $ndc]);\n\t\t\t}\n\n\t\t\tif(count($items) == 0){ //look up by name\n\t\t\t\t$query = \"SELECT item.*, item.id as item_id, item.name as item_name, item.description as item_description\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tFROM item\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tUSE INDEX (name_fulltext)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tWHERE `item`.`archived` = 0\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tAND `name` LIKE \".$this->db->escape(str_replace(\" \",\"%\",$name)).\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \" ORDER BY item.updated DESC\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tLIMIT 1\";\n\t\t\t\t$temp_items = $this->db->query($query);\n\t\t\t\t$looked_up_by_name = true;\n\t\t\t\tif(count($temp_items->result()) > 0){\n\t\t\t\t\t$items[] = $temp_items->result()[0];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t//If the NDC has mutiple matches in our DB then something is wrong!\n\t\t//try to do a name match\n\t\tif ((count($items) > 1) AND (!$looked_up_by_name))\n\t\t{\n\t\t\t//For colorado exact ndc's, if we've got multiple matches, do a name match\n\t\t\t$name_trim = explode(\" \",$name)[0];\n\n\t\t\t$name_match = false;\n\t\t\tforeach($items as $item) {\n\t\t\t\tif((strlen($exact_ndc) > 0) AND (strpos($item->name,$name_trim) !== false)){\n\t\t\t\t\t$items = array();\n\t\t\t\t\t$items[] = $item; //so items will be back to one length\n\t\t\t\t\t$name_match = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $items;\n\n\t}",
"abstract protected function doGetItemData();",
"function load_look_up_b( $look_up_item )\t\n\t{\n\t\tswitch ( $look_up_item ) {\n\t\tcase \"ad_titel\":\n\t\t\t$tbl = \"AD_TITEL\";\n\t\t\t$field = \"AD_TITEL_ID\";\n\t\t\tbreak;\n\n\t\tcase \"iv_eigentuemer\":\n\t\t\t$tbl = \"IV_EIGENTUEMER\";\n\t\t\t$field = \"IV_EIG_ID\";\n\t\t\tbreak;\n\n\t\tcase \"iv_kategorie\":\n\t\t\t$tbl = \"IV_KATEGORIE\";\n\t\t\t$field = \"IV_KAT_ID\";\n\t\t\tbreak;\n\n\t\tcase \"sg_genre\":\n\t\t\t$tbl = \"SG_GENRE\";\n\t\t\t$field = \"SG_GENRE_ID\";\n\t\t\tbreak;\n\n\t\tcase \"sg_sprache\":\n\t\t\t$tbl = \"SG_SPEECH\";\n\t\t\t$field = \"SG_SPEECH_ID\";\n\t\t\tbreak;\t\t\t\t\t\t\n\t\t\t//endswitch;\n\t\t}\t\n\t\treturn array($tbl, $field);\n\t}",
"public function testItemLookupExceptionSearchIndex()\n {\n try {\n $this->_amazon->itemLookup('oops', ['SearchIndex' => 'Books']);\n $this->fail('Expected Zend_Service_Exception not thrown');\n } catch (Zend_Service_Exception $e) {\n $this->assertStringContainsString('restricted parameter combination', $e->getMessage());\n }\n }",
"function ciniki_courses_sapos_cartItemLookup($ciniki, $tnid, $customer, $args) {\n\n if( !isset($args['object']) || $args['object'] == '' \n || !isset($args['object_id']) || $args['object_id'] == '' ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.courses.51', 'msg'=>'No course specified.'));\n }\n\n //\n // Lookup the requested course offering if specified along with a price_id\n //\n if( $args['object'] == 'ciniki.courses.offering' && isset($args['price_id']) && $args['price_id'] > 0 ) {\n $strsql = \"SELECT ciniki_course_offerings.id AS offering_id, \"\n . \"ciniki_course_offerings.code AS code, \"\n . \"ciniki_courses.code AS course_code, \"\n . \"CONCAT_WS(' - ', ciniki_courses.name, ciniki_course_offerings.name) AS description, \"\n . \"ciniki_course_offerings.reg_flags, \"\n . \"ciniki_course_offerings.num_seats, \"\n . \"ciniki_course_offerings.form_id, \"\n . \"ciniki_course_offering_prices.id AS price_id, \"\n . \"ciniki_course_offering_prices.name AS price_name, \"\n . \"ciniki_course_offering_prices.available_to, \"\n . \"ciniki_course_offering_prices.unit_amount, \"\n . \"ciniki_course_offering_prices.unit_discount_amount, \"\n . \"ciniki_course_offering_prices.unit_discount_percentage, \"\n . \"ciniki_course_offering_prices.taxtype_id, \"\n . \"ciniki_course_offering_prices.webflags \"\n . \"FROM ciniki_course_offering_prices \"\n . \"INNER JOIN ciniki_course_offerings ON (\"\n . \"ciniki_course_offering_prices.offering_id = ciniki_course_offerings.id \"\n . \"AND ciniki_course_offerings.tnid = '\" . ciniki_core_dbQuote($ciniki, $tnid) . \"' \"\n . \"AND ciniki_course_offerings.id = '\" . ciniki_core_dbQuote($ciniki, $args['object_id']) . \"' \"\n . \") \"\n . \"INNER JOIN ciniki_courses ON (\"\n . \"ciniki_course_offerings.course_id = ciniki_courses.id \"\n . \"AND ciniki_courses.tnid = '\" . ciniki_core_dbQuote($ciniki, $tnid) . \"' \"\n . \") \"\n . \"WHERE ciniki_course_offering_prices.tnid = '\" . ciniki_core_dbQuote($ciniki, $tnid) . \"' \"\n . \"AND ciniki_course_offering_prices.id = '\" . ciniki_core_dbQuote($ciniki, $args['price_id']) . \"' \"\n . \"\";\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbHashQueryIDTree');\n $rc = ciniki_core_dbHashQueryIDTree($ciniki, $strsql, 'ciniki.courses', array(\n array('container'=>'offerings', 'fname'=>'offering_id',\n 'fields'=>array('offering_id', 'price_id', 'price_name', 'code', 'course_code', \n 'offering_id', 'description', 'reg_flags', 'num_seats', 'form_id',\n 'available_to', 'unit_amount', 'unit_discount_amount', 'unit_discount_percentage', 'taxtype_id', 'webflags',\n )),\n ));\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n if( !isset($rc['offerings']) || count($rc['offerings']) < 1 ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.courses.52', 'msg'=>'No course found.')); \n }\n $item = array_pop($rc['offerings']);\n// if( $item['offering_code'] != '' ) {\n// $item['description'] = $item['offering_code'] . ' - ' . $item['description'];\n// } elseif( $item['code'] != '' ) {\n// $item['description'] = $item['code'] . ' - ' . $item['description'];\n// }\n if( isset($item['price_name']) && $item['price_name'] != '' ) {\n $item['description'] .= ' - ' . $item['price_name'];\n }\n\n //\n // Check the available_to is correct for the specified customer\n //\n if( ($item['available_to']|0xF0) > 0 ) {\n if( ($item['available_to']&$customer['price_flags']) == 0 ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.courses.53', 'msg'=>\"I'm sorry, but this course is not available to you.\"));\n }\n }\n\n $item['flags'] = 0x28;\n if( ($item['webflags']&0x40) == 0x40 ) {\n $item['flags'] |= 0x40; // Shipped item eg: course kit pickup\n }\n \n //\n // Check the number of seats remaining\n //\n $item['tickets_sold'] = 0;\n $strsql = \"SELECT 'num_seats', SUM(num_seats) AS num_seats \"\n . \"FROM ciniki_course_offering_registrations \"\n . \"WHERE tnid = '\" . ciniki_core_dbQuote($ciniki, $tnid) . \"' \"\n . \"AND ciniki_course_offering_registrations.offering_id = '\" . ciniki_core_dbQuote($ciniki, $item['offering_id']) . \"' \"\n . \"\";\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbCount');\n $rc = ciniki_core_dbCount($ciniki, $strsql, 'ciniki.courses', 'num');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n if( isset($rc['num']['num_seats']) ) {\n $item['tickets_sold'] = $rc['num']['num_seats'];\n }\n $item['units_available'] = $item['num_seats'] - $item['tickets_sold'];\n $item['limited_units'] = 'yes';\n\n return array('stat'=>'ok', 'item'=>$item);\n }\n\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.courses.54', 'msg'=>'No course specified.'));\n}",
"public function testPickUpItemByAlias(){\n $item = new \\LinkedWorldsCore\\Item('Key of Gondor', 'The key belonging to the King of Gondor.');\n $item->addAlias('key');\n $this->playerOne->getCurrentRoom()->addItem($item);\n $this->playerOne->takeItem('key');\n\n $this->assertTrue($this->playerOne->hasItem('Key of Gondor'));\n $this->assertTrue($this->playerOne->hasItem('key'));\n }",
"abstract protected function matchesSafely($item);",
"public function testGetItemRefs()\n {\n\n }",
"public function tryLoad(&$result, $item, $environment = false);",
"function itemLookup($ASIN){\n\n\t\t\t$Timestamp = urlencode(gmdate(\"Y-m-d\\TH:i:s\\Z\", time()));\n\n\t\t\t// construct request URL for making the AWS request\n\t\t\t$prepend = \"GET\\nwebservices.amazon.com\\n/onca/xml\\n\";\n\n\t\t\t$prependUrl = \"http://webservices.amazon.com/onca/xml?\";\n\t\t\t\n\t\t\t$url = 'AWSAccessKeyId=' . $this->public_key .\n\t\t\t\t\t'&AssociateTag=' . $this->associate_tag .\n\t\t\t\t\t'&ItemId=' . $ASIN .\n\t\t\t\t\t'&Operation=' . $this->operation .\n\t\t\t\t\t'&ResponseGroup=' . $this->response_group .\n\t\t\t\t\t'&Service=' . $this->service .\n\t\t\t\t\t'&Timestamp=' . $Timestamp .\n\t\t\t\t\t'&Version=' . $this->version;\n\n\t\t\t$Signature = urlencode(base64_encode(hash_hmac('SHA256', $prepend . $url, $this->secret_key, True)));\n\n\t\t\t$requestUrl = $prependUrl . $url . '&Signature=' . $Signature;\n\n\t\t\t// Send the request to AWS\n\t\t\t$response = file_get_contents($requestUrl);\n\t\t\t$parsedXml = simplexml_load_string($response);\n\n\t\t\t// Process the response\n\t\t\t$dom = new DOMDocument;\n\t\t\t$dom -> loadXml($response);\n\n\t\t\t// Get the count of items retrieved from the request to check if lookup was successful\n\t\t\t$retrievedItems = $dom -> getElementsByTagName('Item')->length;\n\n\t\t\tif($retrievedItems!=0){\n\n\t\t\t\t// Get all the parameters from XML response\n\t\t\t\t$asin = $parsedXml -> Items -> Item -> ASIN;\n\t\t\t\t$title = $parsedXml -> Items -> Item -> ItemAttributes -> Title;\n\t\t\t\t$mpn = $parsedXml -> Items -> Item -> ItemAttributes -> MPN;\n\t\t\t\t$price = $parsedXml -> Items -> Item -> ItemAttributes -> ListPrice -> FormattedPrice;\n\n\t\t\t\t// Construct HTML response and send back to the static HTMl page to load the response\n\t\t\t\treturn '<td id=\"fetched_asin\">'.\n\t\t\t\t\t\t$asin.'</td><td id=\"fetched_title\">'.\n\t\t\t\t\t\t$title.'</td><td id=\"fetched_mpn\">'.\n\t\t\t\t\t\t$mpn.'</td><td id=\"fetched_price\">'.\n\t\t\t\t\t\t$price.'</td>';\n\t\t\t}else {\n\t\t\t\treturn '';\n\t\t\t}\n\t\t}",
"public function testGetNotExistingItem()\n {\n $item = $this->pool->getItem('key');\n\n $this->assertInstanceOf(Item::class, $item);\n $this->assertNull($item->get());\n $this->assertFalse($item->isHit());\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the total signup fee for all subscriptions in an order. Similar to WC_Subscription::get_sign_up_fee() except that it sums the signup fees for all subscriptions purchased in an order. | public static function get_sign_up_fee( $order, $product_id = '' ) {
$sign_up_fee = 0;
foreach ( wcs_get_subscriptions_for_order( $order, array( 'order_type' => 'parent' ) ) as $subscription ) {
if ( empty( $product_id ) ) {
$sign_up_fee += $subscription->get_sign_up_fee();
} else {
// We only want sign-up fees for certain product
$order_item = self::get_item_by_product_id( $order, $product_id );
foreach ( $subscription->get_items() as $line_item ) {
if ( $line_item['product_id'] == $product_id || $line_item['variation_id'] == $product_id ) {
$sign_up_fee += $subscription->get_items_sign_up_fee( $line_item );
}
}
}
}
return apply_filters( 'woocommerce_subscriptions_sign_up_fee', $sign_up_fee, $order, $product_id );
} | [
"public function get_sign_up_fee() {\n\t\treturn WC_Subscriptions_Product::get_sign_up_fee( $this );\n\t}",
"protected function calculate_fee_totals() {\n\t\t$this->get_fees_from_cart();\n\n\t\t$this->set_total( 'fees_total', array_sum( wp_list_pluck( $this->fees, 'total' ) ) );\n\t\t$this->set_total( 'fees_total_tax', array_sum( wp_list_pluck( $this->fees, 'total_tax' ) ) );\n\n\t\t$this->cart->fees_api()->set_fees( wp_list_pluck( $this->fees, 'object' ) );\n\t\t$this->cart->set_fee_total( wc_remove_number_precision_deep( array_sum( wp_list_pluck( $this->fees, 'total' ) ) ) );\n\t\t$this->cart->set_fee_tax( wc_remove_number_precision_deep( array_sum( wp_list_pluck( $this->fees, 'total_tax' ) ) ) );\n\t\t$this->cart->set_fee_taxes( wc_remove_number_precision_deep( $this->combine_item_taxes( wp_list_pluck( $this->fees, 'taxes' ) ) ) );\n\t}",
"public function tm_subscriptions_product_sign_up_fee( $subscription_sign_up_fee = \"\", $product = \"\" ) {\r\n\t\t$options_fee = 0;\r\n\t\tif ( WC()->cart ){\r\n\t\t\t$cart_contents = WC()->cart->cart_contents;\r\n\t\t\tif ( $cart_contents && ! is_product() && WC()->cart ) {\r\n\t\t\t\t//$cart_contents = WC()->cart->get_cart(); // not working for various setup combinations like when bundles is installed\r\n\t\t\t\tforeach ( $cart_contents as $cart_key => $cart_item ) {\r\n\t\t\t\t\tforeach ( $cart_item as $key => $data ) {\r\n\t\t\t\t\t\tif ( $key == \"tmsubscriptionfee\" ) {\r\n\t\t\t\t\t\t\t$options_fee = $data;\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\t$subscription_sign_up_fee += $options_fee;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn $subscription_sign_up_fee;\r\n\t}",
"public function total() \n {\n // TODO\n // Add the tax to total.\n\n $contents = $this->contents();\n\n return $contents->sum('subtotal') + $this->shop->delivery_fee;\n }",
"public function get_fee_total() {\n\t\treturn apply_filters( 'woocommerce_cart_' . __FUNCTION__, $this->get_totals_var( 'fee_total' ) );\n\t}",
"public function getOrderTaxTotal() { \n \n $orderTaxTotal = 0;\n \n foreach ($this->deliveryCollObj as $delObj) { \n // float operations may lead to precision problems (see www.php.net/float), using bcmath instead: this requires PHP to be configured with '--enable-bcmath'\n $orderTaxTotal = bcadd($orderTaxTotal, $delObj->getDeliveryTaxTotal(), 4);\n // original calculation: $orderTaxTotal += $delObj->getDeliveryTaxTotal();\n }\n \n // round return sum to 2 decimal digits \n $orderTaxTotalRounded = round((double)$orderTaxTotal, 2);\n \n return $orderTaxTotalRounded;\n \n }",
"public static function get_sign_up_fee( $product ) {\n\t\treturn apply_filters( 'woocommerce_subscriptions_product_sign_up_fee', self::get_meta_data( $product, 'subscription_sign_up_fee', 0, 'use_default_value' ), self::maybe_get_product_instance( $product ) );\n\t}",
"public function get_sign_up_fee_including_tax( $qty = 1 ) {\n\t\twcs_deprecated_function( __METHOD__, '2.2.0', 'wcs_get_price_including_tax( $product, array( \"qty\" => $qty, \"price\" => WC_Subscriptions_Product::get_sign_up_fee( $product ) ) )' );\n\t\treturn wcs_get_price_including_tax( $this, array( 'qty' => $qty, 'price' => WC_Subscriptions_Product::get_sign_up_fee( $this ) ) );\n\t}",
"public static function get_non_subscription_total( $order ) {\n\n\t\tif ( ! is_object( $order ) ) {\n\t\t\t$order = new WC_Order( $order );\n\t\t}\n\n\t\t$non_subscription_total = 0;\n\n\t\tforeach ( $order->get_items() as $order_item ) {\n\t\t\tif ( ! self::is_item_subscription( $order, $order_item ) ) {\n\t\t\t\t$non_subscription_total += $order_item['line_total'];\n\t\t\t}\n\t\t}\n\n\t\treturn apply_filters( 'woocommerce_subscriptions_order_non_subscription_total', $non_subscription_total, $order );\n\t}",
"protected function calculate_fee_totals()\n {\n }",
"public function calculate_order_total(){\r\n $this->order_total = 0;\r\n foreach($this->items as $item){\r\n $this->order_total += $this->getItemSubTotal($item);\r\n }\r\n $this->sales_tax_amount = ($this->order_total * $this->sales_tax);\r\n return $this->order_total + $this->sales_tax_amount;\r\n }",
"public function getTotalItemsDeliveryFee()\n {\n return $this->totalItemsDeliveryFee;\n }",
"public function get_total_shipping_refunded()\n {\n }",
"public function total()\n {\n $total = $this->subTotal();\n foreach ($this->coupons() as $coupon) $total = $coupon->applyTo($total);\n return $total;\n }",
"public function woocommerce_cart_totals_after_order_total() {\n\t\tif ( class_exists( 'WC_Subscriptions_Cart' )\n\t\t&& WC_Subscriptions_Cart::cart_contains_subscription()\n\t\t) {\n\t\t\treturn;\n\t\t}\n\n\t\t?>\n\t\t<tr>\n\t\t\t<th></th>\n\t\t\t<td>\n\t\t<?php\n\t\tif ( $this->get_gateway()->cart_ala ) {\n\t\t\t$this->render_affirm_monthly_payment_messaging(\n\t\t\t\tfloatval( WC()->cart->total ) * 100,\n\t\t\t\t'cart'\n\t\t\t);\n\t\t}\n\t\t?>\n\t\t\t</td>\n\t\t</tr>\n\t\t<?php\n\t}",
"public function calculateForwarderTotal(SupplierOrderInterface $order): float;",
"function gdcwc_woocommerce_checkout_subscription_created( $subscription, $order, $recurring_cart ) {\n\t// check order products (line items) for meta\n\t$items = $order->get_items();\n\n\t// TODO: figure out if multiple products have post trial fee.\n\tforeach ( $items as $item ) {\n\t\t$product_id = $item->get_product_id();\n\t\t$product = wc_get_product( $product_id );\n\n\t\tif ( 'subscription' === $product->get_type() ) {\n\t\t\t// Simple Subscriptions\n\t\t\t$post_trial_fee = get_post_meta( $product->get_id(), '_subscription_post_trial_fee', true );\n\t\t\tif ( '' !== $post_trial_fee ) {\n\t\t\t\t// add to subscription\n\t\t\t\tupdate_post_meta( $subscription->get_id(), '_subscription_post_trial_fee', $post_trial_fee );\n\t\t\t}\n\t\t} elseif ( 'variable-subscription' === $product->get_type() ) {\n\t\t\t// Variable Subscripion\n\t\t\t$variable_post_trial_fee = get_post_meta( $product_id, '_variable_subscription_post_trial_fee', true );\n\t\t\tif ( is_array( $variable_post_trial_fee ) ) {\n\t\t\t\t// get variation_id from order\n\t\t\t\tif ( isset( $variable_post_trial_fee[ $item->get_variation_id() ] ) ) {\n\t\t\t\t\t// add to subscription\n\t\t\t\t\tupdate_post_meta( $subscription->get_id(), '_subscription_post_trial_fee', $variable_post_trial_fee[ $item->get_variation_id() ] );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}",
"public function getTotalsForDisplay()\n {\n /**\n * @var \\Magento\\Sales\\Model\\Order\\Invoice $source\n */\n $source = $this->getSource();\n $storeId = $source->getStoreId();\n $feeDetails = $source->getMageworxFeeDetails();\n if ($feeDetails && $this->feeHelper->expandFeeDetailsInPdf($storeId)) {\n // Fees totals grouped by type\n $feesAsArray = $this->feeHelper->unserializeValue($feeDetails);\n $totals = $this->getGroupedFeeTotals($feesAsArray);\n } else {\n // Just one total\n $totals = $this->getRegularFeesTotal();\n }\n\n return $totals;\n }",
"public function getGrandTotal(): float\n {\n return (float) $this->quote->getGrandTotal();\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the real class name of a class name that could be a proxy. | public static function getRealClass($className)
{
$pos = strrpos($className, '\\' . Proxy::MARKER . '\\');
if ($pos === false) {
/** @psalm-var class-string<T> */
return $className;
}
return substr($className, $pos + Proxy::MARKER_LENGTH + 2);
} | [
"public function getProxyClassName() {\n return $this->proxyClassName;\n }",
"public static function getProxiedClass(): string\n {\n return get_class(static::proxy());\n }",
"public function getProxyClass()\n {\n return $this->getClassName() . '_Proxy' . filectime($this->getFileName());\n }",
"public static function getProxiedClass(): string\n {\n return get_class(static::getProxiedInstance());\n }",
"function getProxyClass()\n {\n return 'neo4jProxy' . str_replace('\\\\', '_', $this->className);\n }",
"private function getRealClass(string $class): string\n {\n if ($this->proxyClassNameResolver === null) {\n $this->createDefaultProxyClassNameResolver();\n }\n\n assert($this->proxyClassNameResolver !== null);\n\n return $this->proxyClassNameResolver->resolveClassName($class);\n }",
"public function ___getRealClassName();",
"public function getRealClassName($className);",
"public static function buildProxyClassName($class_name) {\n $match = [];\n preg_match('/([a-zA-Z0-9_]+\\\\\\\\[a-zA-Z0-9_]+)\\\\\\\\(.+)/', $class_name, $match);\n $root_namespace = $match[1];\n $rest_fqcn = $match[2];\n $proxy_class_name = $root_namespace . '\\\\ProxyClass\\\\' . $rest_fqcn;\n\n return $proxy_class_name;\n }",
"public function getProxyFileName()\n {\n return str_replace('_', '/', $this->getProxyClass()) . '.php';\n }",
"public function getProxyName();",
"protected function getClassName() {\n $splitedName = explode(\"\\\\\", get_class($this));\n return strtolower($splitedName[count($splitedName) - 1]);\n }",
"protected static function popsProxyClass()\n {\n return 'Eloquent\\Liberator\\Liberator';\n }",
"protected static function proxyClassClass()\n {\n return 'Eloquent\\Liberator\\LiberatorClass';\n }",
"public function getClassName(): string\n {\n return $this->reflectedObject->getName();\n }",
"public function getClassName();",
"private function get_class_name() {\n\t\t\treturn !is_null($this->class_name) ? $this->class_name : get_class($this);\n\t\t}",
"function getProxyClassCode() {\n\t\t$r = rand();\n\t\treturn $this->_getProxyClassCode($r);\n\t}",
"public function getClassName()\n {\n return get_class( $this->getServiceObject() );\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the deviceNameTemplate property value. The template used to name the AutoPilot Device. This can be a custom text and can also contain either the serial number of the device, or a randomly generated number. The total length of the text generated by the template can be no more than 15 characters. | public function getDeviceNameTemplate(): ?string {
$val = $this->getBackingStore()->get('deviceNameTemplate');
if (is_null($val) || is_string($val)) {
return $val;
}
throw new \UnexpectedValueException("Invalid type found in backing store for 'deviceNameTemplate'");
} | [
"public function getDeviceNameTemplate()\n {\n if (array_key_exists(\"deviceNameTemplate\", $this->_propDict)) {\n return $this->_propDict[\"deviceNameTemplate\"];\n } else {\n return null;\n }\n }",
"public function getDeviceName()\n {\n return isset($this->device_name) ? $this->device_name : '';\n }",
"protected function getTemplateName() {\n\t\t\t\t$templateName = $this->templateName;\n\t\t\t\t\n\t\t\t\tif($templatePrefix = $this->templatePrefix())\n\t\t\t\t\t\t$templateName = $this->joinPrefix($templateName, $templatePrefix);\n\t\t\t\t\n\t\t\t\tif($templateSuffix = $this->templateSuffix())\n\t\t\t\t\t\t$templateName = $this->joinSuffix($templateName, $templateSuffix);\n\t\t\t\t\n\t\t\t\treturn $templateName;\n\t\t}",
"protected function get_template_name() : string {\n\t\t\treturn $this->template_name;\n\t\t}",
"public function getTemplate() {\n\t\t$this->_check_init();\n\t\tif(strlen($this->product->products_template) > 3) {\n\t\t\t// customized name\n\t\t\t$name = $this->product->products_template;\n\t\t} else {\n\t\t\t// default name\n\t\t\t$name = $this->product->products_name . '.indd';\n\t\t}\n\t\tif(CPOD_TYPE != 'live') {\n\t\t\t// check in beta folder\n\t\t\tif(file_exists(DESIGNMERGE_TEMPLATE . 'beta/' . $name)) {\n\t\t\t\t$name = 'beta/'.$name;\n\t\t\t}\n\t\t}\n\t\treturn $name;\n\t}",
"public function getTemplateName(): string\n {\n return $this->templateName;\n }",
"function getTemplateName() {\n\t\t$templateName = '';\n\t\t$templateFile = $this->ffData['templateFile'];\n\t\t\n\t\tif($templateFile == 'default') {\n\t\t\t$templateFile = $this->conf['defaultTemplateFileName'];\n\t\t} \n\t\t\n\t\t//cutting off the file extension\n\t\t$templateName = substr($templateFile, 0, strrpos($templateFile, '.'));\n\t\t\n\t\treturn $templateName;\n\t}",
"public function templateName() {\n return $this->templateName;\n }",
"protected function getTemplate()\n {\n // If not specified, default to the registered name of the prop\n $template = empty($this->template) ? $this->name : $this->template;\n return $template;\n }",
"public function getTemplateName() {\n return $this->template_name;\n }",
"public function getTemplateDisplayName()\n {\n return $this->template_display_name;\n }",
"public function getDeviceName()\n {\n return $this->getHelper()->device();\n }",
"public function getTemplateName() {\r\n\t\treturn $this->templateName;\r\n\t}",
"public function getDeviceName() {\n return $this->devicesManager->getDevice();\n }",
"public function template() {\n return $this->name;\n }",
"public function getDeviceDisplayName()\n {\n if (array_key_exists(\"deviceDisplayName\", $this->_propDict)) {\n return $this->_propDict[\"deviceDisplayName\"];\n } else {\n return null;\n }\n }",
"public function get_tmpl_name() {\n\t\t\treturn $this->tmpl_name;\n\t\t}",
"public static function getDefaultTemplateName()\n {\n return self::getStringBaseValue('template');\n }",
"public function generateName()\n {\n $hash = Str::random();\n return \"template-$hash\";\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Save the video frames | function saveWPTVideoFrames($id, $videoFramesNode) {
global $wptResultsDir;
$pathName = $wptResultsDir . $id;
if(!is_dir($pathName)) {
mkdir($pathName, 0, true);
}
foreach ($videoFramesNode->frame as $frame) {
$image = $frame->image;
$item = file_get_contents($image);
$fileName = basename($image);
$fh = fopen($pathName . "/" . $fileName, "w+");
if(fwrite($fh, $item) === false) {
// TODO: handle error
}
fclose($fh);
}
} | [
"public function saveVideo(): string\n {\n $ffmpeg = FFMpeg::create();\n dd($ffmpeg);\n $ffmpeg->open($this->file)->save($this->format, $this->path . $this->fileName . self::WEBM);\n\n return $this->fileName . self::WEBM;\n }",
"function movEncode()\n\t{\n\t\t$cmd = $this->ffmpeg.\" -i '\".$this->src.\"' -y -pix_fmt yuv420p -b:v \".$this->vb.\" -ar 44100 -b:a \".$this->ab.\" -s \".$this->size.\" '\".$this->dst.\"'\";\n\t\t//system($cmd.\" 2>\".$this->tracelog);\n\t\tsystem($cmd );\n\t}",
"private function generateVideoFile()\n {\n if (count($this->frames) == 0)\n {\n throw new \\Exception(\"No frames in frames folder found.\");\n }\n\n if ($this->hasSound == true)\n {\n $audioListFilePath = $this->generateAudioFiles();\n\n // Create single sound from sound frames\n $this->ffmpegHelper->addOption(\"-f concat\");\n $this->ffmpegHelper->addOption(\"-safe 0\");\n $this->ffmpegHelper->addOption(\"-i \\\"\" . $audioListFilePath . \"\\\"\");\n }\n\n echo \"\\nGenerating video file ...\";\n\n // Create video from image frames\n $this->ffmpegHelper->addOption(\"-framerate \" . $this->fps);\n\n // Input images\n $this->ffmpegHelper->addOption(\"-i \\\"\" . $this->baseOutputDirectory . \"/tmp/Frames/%d.png\\\"\");\n $this->ffmpegHelper->addOption(\"-pix_fmt yuv420p\");\n $this->ffmpegHelper->addOption(\"-vcodec mpeg4\");\n\n if (stristr(PHP_OS, \"linux\"))\n {\n // This option is necessary to avoid an error on Linux\n $this->ffmpegHelper->addOption(\"-strict -2\");\n }\n\n $fileName = \"Game_\" . $this->getNewGameId(\"Video\") . \".mp4\";\n\n // Save video in output folder\n $this->ffmpegHelper->executeCommand( $this->baseOutputDirectory . \"/Video/\" . $fileName);\n\n echo \"\\nVideo creation complete!\\n\\n\";\n }",
"public function onWriteVideo(VideoEvent $event)\n {\n $this->save($event->getVideo());\n }",
"public function saveMeta()\n {\n $video = $this->video\n ->getStreams()\n ->videos()\n ->first();\n\n $this->record->update([\n 'duration' => $video->get('duration'),\n 'width' => $video->get('width'),\n 'height' => $video->get('height'),\n 'frame_rate' => (int) str_before($video->get('avg_frame_rate'), '/') / 1000,\n ]);\n }",
"private function saveAndConvert($video, $name)\n {\n Storage::disk('public')->put('videos/'.$name.'.mp4', file_get_contents($video->getRealPath()));\n\n FFMPEG::convert()\n ->input($video->getRealPath())\n ->output(storage_path('app/public/videos/').$name.'.webm')\n ->overwrite(true)\n ->go();\n }",
"public function save()\n {\n $this->getHolder()->setImageCompressionQuality($this->getQuality());\n\n return $this->getHolder()->writeImage($this->getFilename());\n }",
"public function save()\n\t{\n\t\tset_time_limit(0);\n\t\tTwitchHelper::log(TwitchHelper::LOG_INFO, \"Save {$this->basename}\");\n\n\t\tforeach ($this->associatedFiles as $file) {\n\t\t\tif (file_exists($this->directory . DIRECTORY_SEPARATOR . $file)) {\n\t\t\t\tTwitchHelper::log(TwitchHelper::LOG_DEBUG, \"Save {$file}\");\n\t\t\t\trename($this->directory . DIRECTORY_SEPARATOR . $file, TwitchHelper::$public_folder . DIRECTORY_SEPARATOR . \"saved_vods\" . DIRECTORY_SEPARATOR . $file);\n\t\t\t}\n\t\t}\n\t}",
"public function testVideo(){\n// 'ffprobe.binaries' => 'D:/documents/laravel/FFmpeg/bin/ffprobe.exe', // the path to the FFProbe binary\n $ffmpeg = FFMpeg::create([\n 'ffmpeg.binaries' => '/usr/bin/ffmpeg', // the path to the FFMpeg binary\n 'ffprobe.binaries' => '/usr/bin/ffprobe', // the path to the FFProbe binary\n 'timeout' => 240, // the timeout for the underlying process\n 'ffmpeg.threads' => 12, // The number of threads that FFMpeg should use\n ]);\n $ffmpeg->getFFMpegDriver()->listen(new \\Alchemy\\BinaryDriver\\Listeners\\DebugListener());\n $ffmpeg->getFFMpegDriver()->on('debug', function ($message) {\n echo $message.\"<br>\";\n });\n//\n// $video = $ffmpeg->open(base_path() . '/public/test/mov.mov');\n//// $video\n//// ->filters()\n//// ->resize(new Dimension(320, 240))\n//// ->synchronize();\n//\n//\n//\n// $dimension = new \\FFMpeg\\Coordinate\\Dimension(480, 320);\n// $mode = \\FFMpeg\\Filters\\Video\\ResizeFilter::RESIZEMODE_INSET;\n// $useStandards = true;\n//\n//\n// Log::info('before synchronize ----------------------');\n// $video\n// ->filters()\n// ->resize($dimension, $mode, $useStandards)\n// ->synchronize();\n//\n// $video\n// ->frame(TimeCode::fromSeconds(10))\n// ->save(base_path() .'/public/test/frame.jpg');\n//\n//\n// $video\n// ->save(new CustomVideo(), base_path() .'/public/test/export-x264.mp4');\n//// ->save(new \\FFMpeg\\Format\\Video\\WMV(), base_path() .'/public/test/export-wmv.wmv')\n//// ->save(new \\FFMpeg\\Format\\Video\\WebM(), base_path() .'/public/test/export-webm.webm');\n\n\n// $process = new Process('D:/documents/laravel/ffmpeg/bin/ffmpeg.exe -i '.base_path() . '/public/test/mov.mov'.' '.base_path() .'/public/test/export-x264.mp4'.' -hide_banner');\n //$process = new Process('D:/documents/laravel/ffmpeg/bin/ffmpeg.exe -i '.base_path() . '/public/test/mov.mov'.' -vf scale=480:320 -f mp4 -vcodec libx264 -preset fast -acodec aac '.base_path() .'/public/test/export-x264.mp4'.' -hide_banner');\n// $process = new Process('D:/documents/laravel/ffmpeg/bin/ffmpeg.exe -i '.base_path() . '/public/test/mov.mov'.' -vf scale=480:320,setdar=16:9 -f mp4 -vcodec libx264 -preset fast -acodec aac '.base_path() .'/public/test/export-x264.mp4'.' -hide_banner');\n\n\n set_time_limit(0);\n\n// $filename = 'export-x264_mov_480_90_final.mp4';\n $filename = 'mov.mov';\n\n $video = $ffmpeg->open(base_path() . '/public/uploads/challenge/c7e66dda83ee39f40435efabc2aa1c1a.MOV');\n// $video = $ffmpeg->open(base_path() . '/public/test/'.$filename);\n\n\n\n $dimension = new \\FFMpeg\\Coordinate\\Dimension(480,320);\n $mode = \\FFMpeg\\Filters\\Video\\ResizeFilter::RESIZEMODE_INSET;\n $useStandards = true;\n\n $format = new CustomVideo();\n $start = microtime(true);\n Log::info('before synchronize ----------------------');\n //->resize($dimension, $mode, $useStandards)\n\n// $videostream = $ffmpeg->getFFProbe()\n// ->streams(base_path() . '/public/test/'.$filename)\n// ->videos()\n// ->first();\n\n $encode = true;\n// echo '<br>-----has tags:'.$videostream->has('tags');\n// if ($videostream->has('tags')) {\n// $tags = $videostream->get('tags');\n// if (isset($tags['rotate'])) {\n// $rotate = $tags['rotate'];\n// $rotate = 90;\n// $video\n// ->filters()\n// ->resize($dimension, $mode, true);\n// $video->addFilter(new CustomFilterRotate(\"-metadata:s:v:0\",$rotate));\n//\n//\n// $encode = false;\n// }\n//\n// }\n\n\n// $video\n// ->filters()\n// ->resize($dimension, $mode, true);\n// ->rotate(\\FFMpeg\\Filters\\Video\\RotateFilter::ROTATE_270);\n\n\n $format->on('progress', function ($video, $format, $percentage) {\n echo \"$percentage % transcoded<<br>\";\n });\n $video->save($format, base_path() . '/public/uploads/challenge/rex2.mp4');\n// $video = $ffmpeg->open(base_path() . '/public/test/tmp1.mp4');\n// $rotate = 90;\n// $video->addFilter(new CustomFilterRotate(\"-metadata:s:v:0\",$rotate));\n// $video->save($format, base_path() . '/public/test/after_1_tmp.mp4');\n\n// if($encode){\n// $video\n// ->filters()\n// ->resize($dimension, $mode, false)\n// ->addMetadata([\"title\" => \"Some Title\", \"track\" => 1]);\n// ;\n// }\n//-metadata:s:v:0 rotate=90\n\n\n\n\n// rotate : 90\n// $name = 'export-x264_mov_480_9_1.mp4';\n// $video->save($format, base_path() . '/public/test/'.$name);\n//\n// $video = $ffmpeg->open(base_path() . '/public/test/'.$name);\n// $video\n// ->filters()\n//// ->rotate(\\FFMpeg\\Filters\\Video\\RotateFilter::ROTATE_270)\n// ->resize($dimension, $mode, $useStandards)\n//\n// ->synchronize();\n\n// $video->save($format, base_path() . '/public/test/export-x264_mov_480_7_final.mp4');\n $time_elapsed_secs = microtime(true) - $start;\n echo 'took:' . $time_elapsed_secs . ' seconds ---------------------';\n\n// $process = new Process('D:/documents/laravel/ffmpeg/bin/ffmpeg.exe -i '.base_path() . '/public/test/mov.mov'.' -vf scale=\"480:-1\" -f mp4 -vcodec libx264 -preset fast -acodec aac '.base_path() .'/public/test/export-x264.mp4'.' -hide_banner');\n//\n//\n// try {\n// $start = microtime(true);\n// $process->mustRun();\n// $time_elapsed_secs = microtime(true) - $start;\n// echo 'took:' . $time_elapsed_secs . ' seconds ---------------------';\n// echo $process->getOutput();\n// } catch (ProcessFailedException $e) {\n// echo \"falhou-----------------------\";\n// echo $e->getMessage();\n// }\n\n\n return \"deu\";\n }",
"public function save()\r\n {\r\n $this->saveToFile($this->_params, $this->paramsFile);\r\n }",
"public function ch_video_pembahasan($UUID)\n{\n $oldImgPembahasan = $this->Mbanksoal->get_oldimg_pembahasan($UUID);\n // echo \"video pembahasan\";\n $configvideo['upload_path'] = './assets/video/videoPembahasan';\n $configvideo['allowed_types'] = 'mp4|swf';\n $configvideo['max_size'] = 90000;\n $this->load->library('upload', $configvideo);\n $this->upload->initialize($configvideo);\n // pengecekan upload\n if (!$this->upload->do_upload('video')) {\n // jika upload video gagal\n $error = array('error' => $this->upload->display_errors());\n\n} else {\n // jika uplod video berhasil jalankan fungsi penyimpanan data video ke db\n //di komen dulu karena sedang dalam perbaikan\n\n $file_data = $this->upload->data();\n $file_name = $file_data['file_name'];\n $data['UUID']=$UUID;\n $data['dataSoal']= array(\n 'video_pembahasan' => $file_name,\n 'pembahasan'=>'');\n\n $this->Mbanksoal->ch_soal($data);\n}\n}",
"public function webvideo()\n\t{\n\t\ttry {\n\t\t set_time_limit(0);\n\t\t ini_set('memory_limit', '256M');\n\t\t} catch (\\Exception $e) {\n\t\t // Nothing!\n\t\t}\n\t\t\n\t\t// Get params:\n\t\t$video_path = \\Cli::option('file', null);\n\t\tif ($video_path === null) return;\n\t\t\n\t\t// We need the log package loaded for Monolog\n\t\t$doc_root = realpath(APPPATH.'../../public').'/';\n\t\t$config = \\Config::get('cmf.ffmpeg');\n\t\t$logger = new \\Monolog\\Logger('WebVideoConverter');\n\t\t$logger->pushHandler(new \\Monolog\\Handler\\RotatingFileHandler(APPPATH.'logs/ffmpeg.log'));\n\t\t\n\t\t// Get path info about the video\n\t\t$video_path = $doc_root.$video_path;\n\t\t$video_id = md5($video_path);\n\t\t$path_info = pathinfo($video_path);\n\t\t$converted_dir = $path_info['dirname'].'/converted';\n\t\t$progress_file = $video_path.'.progress';\n\t\ttouch($progress_file);\n\t\tif (!is_dir($converted_dir)) $made_dir = @mkdir($converted_dir, 0775, true);\n\n\t\t// Set up the FFMpeg instances\n\t\t$ffprobe = new \\FFMpeg\\FFProbe($config['ffprobe_binary'], $logger);\n\t\t$ffmpeg = new \\FFMpeg\\FFMpeg($config['ffmpeg_binary'], $logger);\n\t\t$ffmpeg->setProber($ffprobe);\n\n\t\t// Probe the video for info\n\t\t$format_info = json_decode($ffprobe->probeFormat($video_path));\n\t\t$video_streams = json_decode($ffprobe->probeStreams($video_path));\n\t\t$video_info = null;\n\t\tforeach ($video_streams as $num => $stream) {\n\t\t if ($stream->codec_type == 'video') {\n\t\t $video_info = $stream;\n\t\t break;\n\t\t }\n\t\t}\n\n\t\t// Serve up an error if we can't find a video stream\n\t\tif ($video_info === null) {\n\t\t return;\n\t\t}\n\n\t\t// Determine the frame rate\n\t\tif (isset($video_info->r_frame_rate)) {\n\t\t $video_framerate = strval($video_info->r_frame_rate);\n\t\t $parts = explode('/', $video_framerate);\n\t\t $video_framerate = round(intval($parts[0]) / intval($parts[1]));\n\t\t} else {\n\t\t $video_framerate = intval($config['default_framerate']);\n\t\t}\n\t\t\n\t\t// Get the size\n\t\t$video_width = intval(isset($video_info->width) ? $video_info->width : $config['default_size']['width']);\n\t\t$video_height = intval(isset($video_info->height) ? $video_info->height : $config['default_size']['height']);\n\t\t$video_kilobitrate = round(($video_width * $video_height) * .0019);\n\t\t$video_duration = floatval($format_info->duration);\n\t\t$still_frame_pos = $video_duration * 0.1;\n\t\tif (isset($format_info->bit_rate) && round($format_info->bit_rate / 1024) < $video_kilobitrate) $video_kilobitrate = round($format_info->bit_rate / 1024);\n\t\t\n\t\t// Set up the helper that outputs conversion progress\n\t\t$progressHelper = new \\FFMpeg\\Helper\\VideoProgressHelper(function($percent, $remaining, $rate) use($progress_file) {\n\t\t\t$data = array( 'percent' => $percent, 'remaining' => $remaining, 'rate' => $rate );\n\t\t\tfile_put_contents($progress_file, json_encode($data));\n\t\t});\n\t\t\n\t\t// Finally, convert to each format:\n\t\t$webMFormat = new \\FFMpeg\\Format\\Video\\WebM();\n\t\t$webMFormat->setDimensions($video_width, $video_height)\n\t\t->setFrameRate($video_framerate)\n\t\t->setKiloBitrate($video_kilobitrate)\n\t\t->setGopSize(25);\n\t\t\n\t\t$x264Format = new \\FFMpeg\\Format\\Video\\X264();\n\t\t$x264Format->setDimensions($video_width, $video_height)\n\t\t->setFrameRate($video_framerate)\n\t\t->setKiloBitrate($video_kilobitrate)\n\t\t->setGopSize(25);\n\t\t\n\t\t$ffmpeg->open($video_path)\n\t\t->attachHelper($progressHelper)\n\t\t->encode($webMFormat, $converted_dir.'/'.$path_info['filename'].'.webm')\n\t\t->encode($x264Format, $converted_dir.'/'.$path_info['filename'].'.mp4')\n\t\t->extractImage($still_frame_pos, $path_info['dirname'].'/'.$path_info['basename'].'.jpg')\n\t\t->close();\n\t\t\n\t\t// Delete the progress file to show that the process is complete\n\t\tunlink($progress_file);\n\t\t\n\t}",
"function saveImage(){\n $srcs = $this->srcs; \n $count2 = count($srcs);\n for($r=0;$r<= $count2-1;$r++ ){\n echo $srcs[$r];\n $ch = curl_init($srcs[$r]);\n $fp = fopen($this->saveFolder . $r .\".\" . $this->imageTypes[$r], 'wb');\n curl_setopt($ch, CURLOPT_FILE, $fp);\n curl_setopt($ch, CURLOPT_HEADER, 0);\n curl_exec($ch);\n curl_close($ch);\n fclose($fp);\n }\n\n }",
"public function save($save_path)\n {\n $save_path = parent::save($save_path);\n \n// build the gifsicle process\n $gifsicle_process = new ProcessBuilder('gifsicle', $this->_config);\n \n// add in all the frames\n foreach ($this->_frames as $path)\n {\n $gifsicle_process->add($path);\n }\n \n// set the looping count\n if($this->_loop_count === AnimatedGif::UNLIMITED_LOOPS)\n {\n $gifsicle_process->add('-l');\n }\n else\n {\n $gifsicle_process->add('-l')->add($this->_loop_count);\n }\n \n// set the frame duration\n //$gifsicle_process->add('-d')->add($frame_delay*1000);\n\n// add the output path\n $gifsicle_process->add('-o')->add($save_path);\n \n// execute the process.\n $exec = $gifsicle_process->getExecBuffer();\n $exec->setBlocking(true)\n ->execute();\n \n $this->__destruct();\n\n// check for any gifsicle errors\n if($exec->hasError() === true)\n {\n throw new AnimatedGifException('AnimatedGif save using `gifsicle` save \"'.$save_path.'\" failed. Any additional gifsicle message follows: \n'.$exec->getBuffer());\n }\n \n return new Image($save_path, $this->_config);\n }",
"private function codecVideo($path)\n {\n $ffmpeg = FFMpeg::create([\n 'ffmpeg.binaries' => env('FFMPG'),\n 'ffprobe.binaries' => env('FFPROBE'),\n 'timeout' => 9800, // The timeout for the underlying process\n 'ffmpeg.threads' => 1\n ]);\n Log::info('starting open video');\n\n $videoCodec = $ffmpeg->open(public_path($path));\n $format = new X264();\n $format->setAudioCodec('libmp3lame');\n Log::info('coding audio');\n $codecName =\"export_\".str_random(20).\".mp4\";\n $newVideoPath = public_path(\"uploads/targets/$codecName\");\n $videoCodec->save($format,$newVideoPath);\n Log::info('video coding finish');\n\n return $codecName;\n }",
"public\n function saveImage(){\n $srcs = $this->srcs; \n $count2 = count($srcs);\n for($r=0;$r<= $count2-1;$r++ ){\n echo $srcs[$r];\n $ch = curl_init($srcs[$r]);\n $fp = fopen($this->saveFolder . $r .\".\" . $this->imageTypes[$r], 'wb');\n curl_setopt($ch, CURLOPT_FILE, $fp);\n curl_setopt($ch, CURLOPT_HEADER, 0);\n curl_exec($ch);\n curl_close($ch);\n fclose($fp);\n }\n }",
"public function gifUploadPost(){\n request()->validate([\n\n 'image' => 'required|image|mimes:gif,svg,webp|max:2048', \n\n ]);\n /* request()->validate([\n 'image' => 'dimensions:min_width=1920,min_height=1080', ///checking the size of gif return true is file size is valid\n ]);*/\n $imageName = time().'.'.request()->image->getClientOriginalExtension();\n $arr = explode(\".\", $imageName);\n $last = $arr[0];\n \n request()->image->move(public_path('images'), $imageName); \n $videoFile = \"images/\".$imageName;\n $output = \"images/\".$last.'.mp4';\n $cmd = \"ffmpeg -i $videoFile -ss 00:00:0.0 -t 10 -an $output\";\n\n exec($cmd,$output,$exit_status); //Convert the gif to video\n\n $ffmpeg_path = '/usr/bin/ffmpeg'; // ffmpeg image converion package installed here through composer using command sudo apt-get update then sudo apt-get install ffmpeg\n $vid = '/opt/lampp/htdocs/test/public/images/'.$last.'.mp4'; //full path where my converted video is stored\n if ($exit_status === 0) { // returns 0 if the shell scripts executes correctly\n if(file_exists($vid)) {\n $finfo = finfo_open(FILEINFO_MIME_TYPE);\n $mime_type = finfo_file($finfo, $vid);\n finfo_close($finfo);\n if (preg_match('/video\\/*/', $mime_type)) {\n $command = $ffmpeg_path . ' -i ' . $vid . ' -vstats 2>&1';\n $output = shell_exec($command);\n $regex_sizes = \"/Video: ([^,]*), ([^,]*), ([0-9]{1,4})x([0-9]{1,4})/\";\n if (preg_match($regex_sizes, $output, $regs)) {\n $codec = $regs [1] ? $regs [1] : null;\n $width = $regs [3] ? $regs [3] : null;\n $height = $regs [4] ? $regs [4] : null;\n }\n $regex_duration = \"/Duration: ([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}).([0-9]{1,2})/\";\n if (preg_match($regex_duration, $output, $regs)) {\n $hours = $regs [1] ? $regs [1] : null;\n $mins = $regs [2] ? $regs [2] : null;\n $secs = $regs [3] ? $regs [3] : null;\n $ms = $regs [4] ? $regs [4] : null;\n }\n //Below are the details required from the converted gif.\n $arr = array('codec' => $codec,\n 'width' => $width,\n 'height' => $height,\n 'hours' => $hours,\n 'mins' => $mins,\n 'secs' => $secs,\n 'ms' => $ms\n );\n File::delete($videoFile);\n return back()\n\n ->with('success','You have successfully upload gif.Your Converted video length is '.$hours.':'.$mins.':'.$secs);\n\n //->with('image',$imageName); \n\n } else {\n \n dd('error','File is not a video.');\n }\n }else{\n \n dd('error','File is not a video.');\n }\n }else{\n dd('There is some problem in conversion of gif to video');\n }\n\n \n\n /* return back()\n\n ->with('success','You have successfully upload gif.')\n\n ->with('image',$imageName);*/\n \n }",
"public function saveImage()\n {\n $imageType = $this->bitmapFormat->getFormatFromMimeType($this->getMimeType(), BitmapFormat::FORMAT_PNG);\n $imageOptions = $this->bitmapFormat->getFormatImagineSaveOptions($imageType);\n if ($imageType === BitmapFormat::FORMAT_GIF && $this->image->layers()->count() > 1) {\n $imageOptions['animated'] = true;\n }\n $this->image->save($this->getLocalFilename(), $imageOptions);\n }",
"public function convertVideo($extension, $path, $local_path, $upload_session, $new_file_name, $handbrake_path, $full_video_path, $ffmpeg_path)\n {\n if ($extension != 'mp4') {\n // $log = '2>&1 | tee -a conversion.log 2>/dev/null >/dev/null &';\n\n $converted_video = $path.'/'.$local_path.$upload_session.'/'.$new_file_name.'.'.$extension.'.mp4';\n $cmd_convert = \"$handbrake_path -i $full_video_path -o $converted_video -m -e x264 -E copy -O\";\n\n // echo 'cmd is '.$cmd_convert;\n //shell_exec($cmd_convert.' '.$log);\n shell_exec($cmd_convert);\n \\File::delete(public_path('uploads/content/media/'.$upload_session.'/'.$new_file_name.'.'.$extension));\n } elseif ($extension == 'mp4') {\n // add wo, meaning \"with optimization\" for web display\n $converted_video = $path.'/'.$local_path.$upload_session.'/'.$new_file_name.'wo.mp4';\n $parameters = '-movflags faststart -acodec copy -vcodec copy';\n $cmd_optimize_mp4 = \"$ffmpeg_path -y -i $full_video_path $parameters $converted_video\";\n\n shell_exec($cmd_optimize_mp4);\n\n // delete original unoptimized mp4\n // then rename the optimized file to the original title\n unlink($full_video_path);\n\n $from = $path.'/'.$local_path.$upload_session.'/'.$new_file_name.'wo.mp4';\n $to = $path.'/'.$local_path.$upload_session.'/'.$new_file_name.'.mp4';\n\n rename($from, $to);\n } else {\n // any other uncommon video\n $converted_video = $path.'/'.$local_path.$upload_session.'/'.$new_file_name.'.'.$extension.'.mp4';\n $parameters = '-m -e x264 -E copy -O';\n $cmd_convert = \"$handbrake_path -i $full_video_path -o $converted_video $parameters\";\n\n shell_exec($cmd_convert.' 2>&1 | tee -a conversion.log 2>/dev/null >/dev/null &');\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Add a raw WHERE clause to the query. The clause should contain question mark placeholders, which will be bound to the parameters supplied in the second argument. | public function where_raw($clause, $parameters=array()) {
return $this->_add_where($clause, $parameters);
} | [
"public function where_raw( $clause, $parameters = [] ) {\n\t\treturn $this->_add_where( $clause, $parameters );\n\t}",
"public function where_raw($clause, $parameters = [])\n {\n }",
"public function where() {\r\n\t\t$args = func_get_args();\r\n\t\t$expr = array_shift($args);\r\n\t\tarray_push($this->_wheres, '(' . $this->_parameterize($expr, $args) . ')');\r\n\t\t$this->_dirty = true;\r\n\t}",
"public function whereRaw($condition);",
"private function applyWhereClauses() {\n if (!count($this->whereClauses)) {\n return;\n }\n\n $whereStrings = [];\n foreach ($this->whereClauses as $clause) {\n $placeholder = is_null($clause[2]) ? 'null' : '?';\n $whereStrings[] = \"$this->table.$clause[0] $clause[1] $placeholder\";\n if (!is_null($clause[2])) {\n $this->bindingParams[] = $clause[2];\n }\n }\n\n $this->query .= ' where '.implode(' and ', $whereStrings);\n }",
"public function where_raw($clause) {\n return $this->_add_where($clause);\n }",
"protected function getGeneralWhereClause() {}",
"public function where($condition, $value = null, $append = false, $clause = \"WHERE\");",
"public function raw_where_sql( $sql ) {\n\t\t$this->raw_where_sql[] = $sql;\n\t}",
"public function sqlWhereQuery()\r\n {\r\n if (count($this->where) === 0) {\r\n return static::raw(\"1\");\r\n }\r\n\r\n return static::raw(implode(\" \", array_fill(0, count($this->where), \"?\")), $this->where);\r\n }",
"private function build_where_sql() {\n\n // if we used a custom where clause, we do not need to build it\n if ($this->used_custom_where || count($this->where_parameters) < 1) {\n return;\n }\n\n $sql = \"WHERE \\n\";\n\n for ($i=0; $i < count($this->where_parameters); $i++) { \n $parameter = $this->where_parameters[$i];\n\n if ($i == 0) {\n $sql .= \"\\t\";\n } else {\n $sql .= \"\\tAND \";\n }\n \n $name = $parameter->name;\n $type = $parameter->type;\n $value = $this->model_object->$name;\n\n if (is_array($value)) {\n\n if (\\PDope\\Utilities:: is_special_type($type)) {\n throw new \\Exception(\"PDopeStatement build_where_sql(), array, does not support special type [{$type}]\");\n }\n\n $sql .= \"(\".\\PDope\\Utilities:: escape_mysql_identifier($name).\" IN (\";\n\n for ($j=0; $j < count($value); $j++) { \n if ($j > 0) {\n $sql .= \", \";\n }\n\n $token = \"{$name}_{$j}\";\n $token = \\PDope\\Utilities:: format_token($token);\n\n $sql .= $token;\n }\n\n $sql .= \"))\";\n } else {\n if (\\PDope\\Utilities:: is_special_type($type)) {\n $token = \\PDope\\Utilities:: translate_special_token($name, $type); \n $sql .= \"(\".\\PDope\\Utilities:: escape_mysql_identifier($name).\" = $token) \\n\"; \n } else {\n $token = \\PDope\\Utilities:: format_token($name);\n $sql .= \"(\".\\PDope\\Utilities:: escape_mysql_identifier($name).\" = $token) \\n\";\n }\n }\n\n }\n $this->sql_where .= $sql;\n\n // $this->log_debug(\"build_where_sql() built \\n$sql\");\n }",
"protected function getWhereSql()\n {\n if (empty($this->conditions)) {\n return '';\n }\n $parts = [];\n foreach ($this->conditions as $condition) {\n $parts[] = $condition->toString();\n $this->parameters = array_merge($this->parameters, $condition->getParameters());\n }\n return ' WHERE ' . implode(' AND ', $parts);\n }",
"public function where() {\r\n\t\t\t$this->where = func_get_args();\r\n\t\t}",
"protected function pushWhere()\n {\n if( empty($this->where) ) {\n return;\n }\n\n $this->parts[] = 'WHERE';\n foreach( $this->where as $w ) {\n $where = $w[0];\n $value = isset($w[1]) ? $w[1] : null;\n $type = isset($w[2]) ? $w[2] : null;\n if( $where instanceof Expression ) {\n $this->parts[] = (string) $where;\n } else if( count($w) == 3 ) {\n $this->parts[] = $this->quoteIdentifierIfNotExpression($where);\n $this->parts[] = $type;\n $tmp = '';\n foreach( $value as $val ) {\n $tmp .= '?, ';\n $this->params[] = $val;\n }\n $this->parts[] = '(' . substr($tmp, 0, -2) . ')';\n } else if( false !== strpos($where, '?') ) {\n $this->parts[] = $where; //$this->quoteIdentifierIfNotExpression($where);\n $this->params[] = $value;\n } else {\n $this->parts[] = $this->quoteIdentifierIfNotExpression($where);\n $this->parts[] = '=';\n if( $value instanceof Expression ) {\n $this->parts[] = (string) $value;\n } else {\n $this->parts[] = '?';\n $this->params[] = $value;\n }\n }\n $this->parts[] = '&&';\n }\n array_pop($this->parts);\n }",
"protected function _prepareWhere()\n\t{\n\t\tif ($this->_where) {\n\t\t\t$where = $this->_where->prepare($this, 'where', array(), $this->_sql, $this->_resultHandler);\n\t\t\tif ($where->hasValue()) {\n\t\t\t\t$this->_sql->addCondition($where->sql());\n\t\t\t}\n\t\t}\n\t}",
"protected function getWhereClause() {\r\n\t\tif (!empty($this->whereSql)) {\r\n\t\t\treturn ' WHERE (' . implode(') AND (',$this->whereSql) . ')';\r\n\t\t} else {\r\n\t\t\treturn '';\r\n\t\t}\r\n\t}",
"private function _buildWhere() {\r\n\t\t\tif ( $this->_where ) { // we have where clauses to add\r\n\t\t\t\t// add where\r\n\t\t\t\t$this->_sql .= ' WHERE';\r\n\r\n\t\t\t\tforeach ( $this->_where as $where ) { // loop over where array\r\n\t\t\t\t\t// variable name\r\n\t\t\t\t\t$columnVariableName = ':' . str_replace( '.', '', $where['column'] );\r\n\r\n\t\t\t\t\t// add where column/value to sql statement\r\n\t\t\t\t\t$this->_sql .= ' ' . $where['type'] . ' ' . $where['column'] . ' = ' . $columnVariableName;\r\n\r\n\t\t\t\t\t// map where vars to values to be used on execution\r\n\t\t\t\t\t$this->_executeParams[$columnVariableName] = $where['value'];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}",
"function where($where, $bound = null)\n\t{\n\t\tif (is_string($where))\n\t\t{\n\t\t\treturn $this->addFilter($where, $bound);\n\t\t} else {\n\t\t\tassert(is_array($where));\n\t\t\treturn $this->addFilters($where);\n\t\t}\n\t}",
"public function extra_where() {\r\n $where = & func_get_args();\r\n\r\n $this->_extra_where = count($where) == 1 ? $where[0] : array($where[0] => $where[1]);\r\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Converts an external key to a meaning ID for a taxon. | private static function key_to_meaning($key, $list, $readAuth) {
$fetchOpts = array(
'table' => 'taxa_taxon_list',
'extraParams' => $readAuth + array(
'view' => 'detail',
'external_key' => $key,
'taxon_list_id' => $list,
'preferred' => 't'
)
);
$prefRecords = data_entry_helper::get_population_data($fetchOpts);
// We might have multiple records back, e.g. if there are several photos, but we should have a unique meaning id.
$meaningId=0;
foreach($prefRecords as $prefRecord) {
if ($meaningId!=0 && $meaningId!=$prefRecord['taxon_meaning_id'])
// bomb out, as we don't know which taxon to display
return lang::get("The taxon identifier cannot be used to identify a unique taxon.");
$meaningId = $prefRecord['taxon_meaning_id'];
}
if ($meaningId==0)
return lang::get("The taxon identified by the taxon identifier cannot be found.");
return $meaningId;
} | [
"public function canonicalize($tax_number);",
"public function getTaxRateKey();",
"public function getKey(): string {\n return $this->taxKey;\n }",
"public function convertStorageToEntityKey(string $key): string;",
"public function getTaxID();",
"public function private_to_id($key);",
"public function getNcbiTaxonId()\n {\n return $this->ncbi_taxon_id;\n }",
"function meta_key( string $key, string $type ) {\n\n\t$prefixes = [\n\t\t'post_type' => get_post_type_meta_prefix(),\n\t\t'taxonomy' => get_taxonomy_meta_prefix()\n\t];\n\n\t$prefix = $prefixes[ $type ];\n\t$key = preg_replace( '/^' . preg_quote( $prefix, '/' ) . '/', '', $key );\n\treturn $prefix . $key;\n}",
"function _lookupId($a_key)\n\t{\n\t\tglobal $ilDB;\n\n\t\t$q = \"SELECT obj_id FROM object_data \".\n\t\t\" WHERE type = \".$ilDB->quote(\"lng\", \"text\").\n\t\t\" AND title = \".$ilDB->quote($a_key, \"text\");\n\t\t$set = $ilDB->query($q);\n\t\t$row = $ilDB->fetchAssoc($set);\n\t\treturn $row['obj_id'];\n\t}",
"function getMtnId()\n {\n list($type, $keyName, $keyData) = $this->parseContent();\n if ($type != 'mtn')\n throw new Exception('key is not a monotone public key');\n return sha1($keyName.\":\".$keyData);\n }",
"static function _lookupId($a_key)\n\t{\n\t\tglobal $ilDB;\n\n\t\t$q = \"SELECT obj_id FROM object_data \".\n\t\t\" WHERE type = \".$ilDB->quote(\"lng\", \"text\").\n\t\t\" AND title = \".$ilDB->quote($a_key, \"text\");\n\t\t$set = $ilDB->query($q);\n\t\t$row = $ilDB->fetchAssoc($set);\n\t\treturn $row['obj_id'];\n\t}",
"function Type2LatexKey($item)\n {\n $type2key=array\n (\n 1 => \"Certificates_Latex\",\n 2 => \"Certificates_Participant_Latex\",\n 10 => \"Certificates_Honouration_Latex\",\n );\n \n $key=\"\";\n if (isset($type2key[ $item[ \"Type\" ] ])) { $key=$type2key[ $item[ \"Type\" ] ]; }\n\n if ($item[ \"Type\" ]==2)\n {\n if ($item[ \"Participant_Hash\" ][ \"Honouration\" ]>1)\n {\n $key=$type2key[ 10 ];\n }\n }\n\n return $key;\n }",
"public function convertEntityToStorageKey(string $key): string;",
"private static function maybe_convert_entry_key_to_id( $key ) {\n\t\tif ( is_numeric( $key ) ) {\n\t\t\treturn $key;\n\t\t}\n\n\t\treturn FrmEntry::get_id_by_key( $key );\n\t}",
"public function generateInstratoKey()\n {\n $value = $this->getMeta()->get('instrato');\n $value->setValue(User::randomString(25));\n Write::set($value);\n }",
"function getTaxonCode($taxonName)\r\n{\r\n global $logger;\r\n \r\n $apiQuery = 'https://taxonomy.api.macaulaylibrary.org/v1/taxonomy?key=PUB5447877383&q=' . urlencode($taxonName);\r\n $logger->notice(\"Web API request: \" . $apiQuery);\r\n \r\n $result = file_get_contents($apiQuery);\r\n if ($result !== FALSE) {\r\n $json = json_decode($result, true);\r\n if ($json != null)\r\n return $json[0]['code'];\r\n }\r\n return null;\r\n}",
"public function getExternalId();",
"public function convertEntityToStorageKey($key);",
"abstract protected function _normalizeKey($key);"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Used as a callback for the preg_replace in mentions_rewrite() | function mentions_preg_callback($matches) {
$source = $matches[0];
$preceding_char = $matches[1];
$mention = $matches[2];
$username = $matches[3];
if (empty($username)) {
return $source;
}
$user = get_user_by_username($username);
// Catch the trailing period when used as punctuation and not a username.
$period = '';
if (!$user && substr($username, -1) == '.') {
$user = get_user_by_username(rtrim($username, '.'));
$period = '.';
}
if (!$user) {
return $source;
}
if (elgg_get_plugin_setting('named_links', 'mentions', true)) {
$label = $user->getDisplayName();
} else {
$label = $mention;
}
$icon = '';
if (elgg_get_plugin_setting('fancy_links', 'mentions')) {
$icon = elgg_view('output/img', array(
'src' => $user->getIconURL('topbar'),
'class' => 'pas mentions-user-icon'
));
}
$replacement = elgg_view('output/url', array(
'href' => $user->getURL(),
'text' => $icon . $label,
'class' => 'mentions-user-link',
));
return $preceding_char . $replacement . $period;
} | [
"function preg_replace_callback($pattern,$callback,$subject,$limit=NULL)\n{\n\treturn '';\n}",
"function process(&$matches)\n {\n // when prefixed with !, it's explicitly not a wiki link.\n // return everything as it was.\n if ($matches[2][0] == '!') {\n return $matches[1] . substr($matches[2], 1) . $matches[3];\n }\n\n // set the options\n $options = array(\n 'page' => $matches[2],\n 'text' => $matches[2] . $matches[3],\n 'anchor' => $matches[3]\n );\n\n // create and return the replacement token and preceding text\n return $matches[1] . $this->addToken($options);\n }",
"function mentions_rewrite_river_message($hook, $type, $view_vars, $params) {\n\n\t$message = elgg_extract('message', $view_vars);\n\tif (!$message) {\n\t\treturn;\n\t}\n\n\t$regexp = mentions_get_regex();\n\t$view_vars['message'] = preg_replace_callback($regexp, 'mentions_preg_callback', $message);\n\n\treturn $view_vars;\n}",
"function content_twitter_mention($content) {\n\treturn preg_replace('/([^a-zA-Z0-9-_&])@([0-9a-zA-Z_]+)/', \"$1<a href=\\\"http://twitter.com/$2\\\" target=\\\"_blank\\\" rel=\\\"nofollow\\\">@$2</a>\", $content);\n}",
"function parse()\n {\n $this->wiki->source = preg_replace_callback(\n $this->regex,\n array(&$this, 'process'),\n $this->wiki->source\n );\n }",
"abstract public function replace($callback);",
"public function addRewritetags() {\n\t\tadd_rewrite_tag('%photo_selection%', '([^&]+)');\n\t\tadd_rewrite_tag('%photo_selection_access_token%', '([^&]+)');\n\t}",
"function eregi_replace ($pattern, $replacement, $string) {}",
"function handle_rewrites() {\n \tadd_rewrite_tag('%me%', 'true');\t\n\t}",
"public function contentStrReplace() {}",
"function replace_remix_tags($matches) {\n\t\t\t$action = $matches[1];\n\t\t\tglobal $wp_query, $paged, $WP_Query, $post;\n\t\t\t//Build the query\n\t\t\t$temp = $wp_query;\n\t\t\t$this->qa = array();\n\t\t\t$matches[2] = str_replace(\"&\", '&' ,$matches[2]);\n\t\t\tparse_str($matches[2], $this->qa);\n\t\t\t$content = '';\n\t\t\t$file = $this->templatepath . \"/editor/templates/\" . $action . \".php\";\n\t\t\tswitch($matches[1]) {\n\t\t\t\tcase \"cat\":\n\t\t\t\tbreak;\n\t\t\t\tcase \"link\":\n\t\t\t\tbreak;\n\t\t\t\tcase \"subpage5author\":\n\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\t$wp_query= null;\n\t\t\t\t\tadd_filter('post_limits', array(&$this, 'post_limit'));\n\t\t\t\t\tif (array_key_exists(\"offset\", $this->qa)) \n\t\t\t\t\t$this->offset = $this->qa['offset'];\n\t\t\t\t\t$wp_query = new WP_Query();\n\t\t\t\t\t$wp_query->query($this->qa);\n\t\t\t\t\tremove_filter('post_limits', array(&$this, 'post_limit'));\n\t\t\t}\n\t\t\tif (is_file($file)) \n\t\t\t\tinclude($file);\n\t\t\t$wp_query = $temp;\n\t\t\treturn $content;\n\t\t}",
"function grokHttpReplace($matches){\r\n\tglobal $myproxy, $sub_req_url;\r\n\t\r\n\treturn grokReplace($matches[0], $matches[1]);\r\n}",
"function mention_filter_callback($match)\n{\n\tglobal $db, $mybb, $cache;\n\tstatic $name_cache;\n\t$name_parts = array();\n\t$shift_count = 0;\n\n\t$cache_changed = false;\n\n\t// cache names to reduce queries\n\tif(!isset($name_cache) || empty($name_cache))\n\t{\n\t\t$wildcard_plugins = $cache->read('wildcard_plugins');\n\t\t$name_cache = $wildcard_plugins['mentionme']['namecache'];\n\t}\n\n\t// if the user entered the mention in quotes then it will be returned in $match[1],\n\t// if not it will be returned in $match[2]\n\tarray_shift($match);\n\twhile(strlen(trim($match[0])) == 0 && !empty($match))\n\t{\n\t\tarray_shift($match);\n\t\t++$shift_count;\n\t}\n\n\t// save the original name\n\t$orig_name = $match[0];\n\t$match[0] = trim(strtolower($match[0]));\n\n\t// if the name is already in the cache . . .\n\tif(isset($name_cache[$match[0]]))\n\t{\n\t\t$left_over = substr($orig_name, strlen($match[0]));\n\t\treturn mention_build($name_cache[$match[0]]) . $left_over;\n\t}\n\n\t// if the array was shifted then no quotes were used\n\tif($shift_count)\n\t{\n\t\t// no padding necessary\n\t\t$shift_pad = 0;\n\n\t\t// split the string into an array of words\n\t\t$name_parts = explode(' ', $match[0]);\n\n\t\t// add the first part\n\t\t$username_lower = $name_parts[0];\n\n\t\t// if the name part we have is shorter than the minimum user name length (set in ACP) we need to loop through all the name parts and keep adding them until we at least reach the minimum length\n\t\twhile(strlen($username_lower) < $mybb->settings['minnamelength'] && !empty($name_parts))\n\t\t{\n\t\t\t// discard the first part (we have it stored)\n\t\t\tarray_shift($name_parts);\n\t\t\tif(strlen($name_parts[0]) == 0)\n\t\t\t{\n\t\t\t\t// no more parts?\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t// if there is another part add it\n\t\t\t$username_lower .= ' ' . $name_parts[0];\n\t\t}\n\n\t\tif(strlen($username_lower) < $mybb->settings['minnamelength'])\n\t\t{\n\t\t\treturn $orig_name;\n\t\t}\n\t}\n\telse\n\t{\n\t\t// @ and two double quotes\n\t\t$shift_pad = 3;\n\n\t\t// grab the entire match\n\t\t$username_lower = $match[0];\n\t}\n\n\t// if the name is already in the cache . . .\n\tif(isset($name_cache[$username_lower]))\n\t{\n\t\t// . . . simply return it and save the query\n\t\t// restore any surrounding characters from the original match\n\t\treturn mention_build($name_cache[$username_lower]) . substr($orig_name, strlen($username_lower) + $shift_pad);\n\t}\n\telse\n\t{\n\t\t// lookup the user name\n\t\t$user = mention_try_name($username_lower);\n\n\t\t// if the user name exists . . .\n\t\tif($user['uid'] != 0)\n\t\t{\n\t\t\t$cache_changed = true;\n\n\t\t\t// preserve any surrounding chars\n\t\t\t$left_over = substr($orig_name, strlen($user['username']) + $shift_pad);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// if no match and advanced matching is enabled . . .\n\t\t\tif($mybb->settings['mention_advanced_matching'])\n\t\t\t{\n\t\t\t\t// we've already checked the first part, discard it\n\t\t\t\tarray_shift($name_parts);\n\n\t\t\t\t// if there are more parts and quotes weren't used\n\t\t\t\tif(!empty($name_parts) && $shift_pad != 3 && strlen($name_parts[0]) > 0)\n\t\t\t\t{\n\t\t\t\t\t// start with the first part . . .\n\t\t\t\t\t$try_this = $username_lower;\n\n\t\t\t\t\t$all_good = false;\n\n\t\t\t\t\t// . . . loop through each part and try them in serial\n\t\t\t\t\tforeach($name_parts as $val)\n\t\t\t\t\t{\n\t\t\t\t\t\t// add the next part\n\t\t\t\t\t\t$try_this .= ' ' . $val;\n\n\t\t\t\t\t\t// check the cache for a match to save a query\n\t\t\t\t\t\tif(isset($name_cache[$try_this]))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// preserve any surrounding chars from the original match\n\t\t\t\t\t\t\t$left_over = substr($orig_name, strlen($try_this) + $shift_pad);\n\t\t\t\t\t\t\treturn mention_build($name_cache[$try_this]) . $left_over;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// check the db\n\t\t\t\t\t\t$user = mention_try_name($try_this);\n\n\t\t\t\t\t\t// if there is a match . . .\n\t\t\t\t\t\tif((int) $user['uid'] > 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// cache the user name HTML\n\t\t\t\t\t\t\t$username_lower = strtolower($user['username']);\n\n\t\t\t\t\t\t\t// preserve any surrounding chars from the original match\n\t\t\t\t\t\t\t$left_over = substr($orig_name, strlen($user['username']) + $shift_pad);\n\n\t\t\t\t\t\t\t// and gtfo\n\t\t\t\t\t\t\t$all_good = true;\n\t\t\t\t\t\t\t$cache_changed = true;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif(!$all_good)\n\t\t\t\t\t{\n\t\t\t\t\t\t// still no matches?\n\t\t\t\t\t\treturn \"@{$orig_name}\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t// nothing else to try\n\t\t\t\t\treturn \"@{$orig_name}\";\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// no match found and advanced matching is disabled\n\t\t\t\treturn \"@{$orig_name}\";\n\t\t\t}\n\t\t}\n\n\t\t// store the mention\n\t\t$name_cache[$username_lower] = $user;\n\n\t\t// if we had to query for this user's info then update the cache\n\t\tif($cache_changed)\n\t\t{\n\t\t\t$wildcard_plugins = $cache->read('wildcard_plugins');\n\t\t\t$wildcard_plugins['mentionme']['namecache'] = $name_cache;\n\t\t\t$cache->update('wildcard_plugins', $wildcard_plugins);\n\t\t}\n\n\t\t// and return the mention\n\t\treturn mention_build($user) . $left_over;\n\t}\n}",
"function preg_replace_callback ($pattern, $callback, $subject, $limit = null, &$count = null) {}",
"function replace_mentioned_users($content, $mentions){\n //Loop through mentions\n foreach($mentions as $mention){\n //Replace mentioned user id with username\n $content = str_replace(\"<@{$mention['id']}>\", '<a href=\"\">@'.$mention['username'].'</a>', $content);\n $content = str_replace(\"<@!{$mention['id']}>\", '<a href=\"\">@'.$mention['username'].'</a>', $content);\n }\n \n //Return back content with all replacements\n return $content;\n }",
"function apply_mentions($message, $attr)\n{\n if ($attr && is_array($attr))\n {\n $mentions = get_mentions($message);\n\n foreach ($mentions as $mention)\n {\n if ($mention['type'] == 'user')\n {\n $user_details = $attr['user'][$mention['id']];\n $name = $user_details['fullname'];\n if (!$name)\n $name = $user_details['username'];\n\n $user_details['name'] = $name;\n\n\n $syntax = $mention['syntax'];\n $html = get_mentioned_html($user_details);\n //Replacing name\n $message = str_replace($syntax, $html, $message);\n }\n }\n }\n\n return $message;\n}",
"function sf_rel_nofollow($postcontent)\n{\n\t$postcontent = preg_replace_callback('|<a (.+?)>|i', 'sf_rel_nofollow_callback', $postcontent);\n\treturn $postcontent;\n}",
"function replace_twitter_link($text) {\n\t$tmp = $text;\n\t$tmp = preg_replace('/https:\\/\\/www.twitter(.+?)[\\s]/i', 'View the picture on our website. ',$tmp);\n\t$tmp = preg_replace('/https:\\/\\/twitter(.+?)[\\s]/i', 'View the picture on our website. ',$tmp);\n\treturn $tmp;\n}",
"public function add_rewrite_tags() {\n\t\tadd_rewrite_tag( '%' . $this->user_rid . '%', '([^/]+)' );\n\t\tadd_rewrite_tag( '%' . $this->user_comments_rid . '%', '([1]{1,})' );\n\t\tadd_rewrite_tag( '%' . $this->user_rates_rid . '%', '([1]{1,})' );\n\t\tadd_rewrite_tag( '%' . $this->user_to_rate_rid . '%', '([1]{1,})' );\n\t\tadd_rewrite_tag( '%' . $this->user_talks_rid . '%', '([1]{1,})' );\n\t\tadd_rewrite_tag( '%' . $this->cpage_rid . '%', '([^/]+)' );\n\t\tadd_rewrite_tag( '%' . $this->action_rid . '%', '([^/]+)' );\n\t\tadd_rewrite_tag( '%' . $this->search_rid . '%', '([^/]+)' );\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Inverts the color of an image (white to black, black to white etc) | public function invertColors(): ImageBase {
imagefilter($this->resource, IMG_FILTER_NEGATE);
return $this;
} | [
"function ImageColorInvert(\\raylib\\Image &$image): void { }",
"public function makeInverted()\n {\n return $this->cloneColor()->invert();\n }",
"public static function addInvertFilter($image) {\n include(\"cache_invert.php\");\n global $cacheInvert;\n $width = imagesx($image);\n $height = imagesy($image);\n\n for($x=0; $x<$width; $x++)\n {\n for($y=0; $y<$height; $y++)\n {\n $oldCol = self::getColorArray($image,$x,$y);\n $newColor = $cacheInvert[$oldCol[0]]; //self::getInvertColor($oldCol);\n if($newColor == null) {\n throw new Exception(\"Color cache not found\");\n }\n imagesetpixel($image, $x, $y, self::getColRef($image,$newColor));\n }\n }\n }",
"protected function dither()\n {\n if ( ! imageistruecolor($this->image)) {\n imagepalettetotruecolor($this->image);\n }\n\n imagefilter($this->image, IMG_FILTER_GRAYSCALE);\n imagetruecolortopalette($this->image, true, 2);\n }",
"function invertBits();",
"public function resetColor();",
"function remove_white_edges($img)\n{\n $width = imagesx($img);\n $height = imagesy($img);\n\n // From top\n $remove_from_top = 0;\n for ($y = 0; $y < $height; $y++) {\n for ($x = 0; $x < $width; $x++) {\n $_color = imagecolorat($img, $x, $y);\n if ($_color != 0) {\n break 2;\n }\n }\n $remove_from_top++;\n }\n\n // From bottom\n $remove_from_bottom = 0;\n for ($y = $height - 1; $y >= 0; $y--) {\n for ($x = 0; $x < $width; $x++) {\n $color = imagecolorsforindex($img, imagecolorat($img, $x, $y));\n if (($color['red'] != 0 || $color['green'] != 0 || $color['blue'] != 0) && ($color['alpha'] != 127)) {\n break 2;\n }\n }\n $remove_from_bottom++;\n }\n\n // From left\n $remove_from_left = 0;\n for ($x = 0; $x < $width; $x++) {\n for ($y = 0; $y < $height; $y++) {\n $color = imagecolorsforindex($img, imagecolorat($img, $x, $y));\n if (($color['red'] != 0 || $color['green'] != 0 || $color['blue'] != 0) && ($color['alpha'] != 127)) {\n break 2;\n }\n }\n $remove_from_left++;\n }\n\n // From right\n $remove_from_right = 0;\n for ($x = $width - 1; $x >= 0; $x--) {\n for ($y = 0; $y < $height; $y++) {\n $color = imagecolorsforindex($img, imagecolorat($img, $x, $y));\n if (($color['red'] != 0 || $color['green'] != 0 || $color['blue'] != 0) && ($color['alpha'] != 127)) {\n break 2;\n }\n }\n $remove_from_right++;\n }\n\n // Any changes?\n if ($remove_from_top + $remove_from_bottom + $remove_from_left + $remove_from_right == 0 || $remove_from_left == $width || $remove_from_top == $height) {\n return $img;\n }\n\n // Do trimming...\n\n $target_width = $width - $remove_from_left - $remove_from_right;\n $target_height = $height - $remove_from_top - $remove_from_bottom;\n\n $imgdest = imagecreatetruecolor($target_width, $target_height);\n imagealphablending($imgdest, false);\n if (function_exists('imagesavealpha')) {\n imagesavealpha($imgdest, true);\n }\n\n if (imagecopyresampled($imgdest, $img, 0, 0, $remove_from_left, $remove_from_top, $target_width, $target_height, $target_width, $target_height)) {\n imagedestroy($img);\n $img = $imgdest;\n }\n\n return $img;\n}",
"function clear()\n{\n\tglobal $image;\n\t\n\tforeach($image as $i => $line){\n\t\tforeach($line as $j => $color){\n\t\t\tset_pixel_color($j+1, $i+1);\n\t\t}\n\t}\n\n}",
"function monochrome()\n {\n imagefilter($this->img, IMG_FILTER_GRAYSCALE);\n imagefilter($this->img, IMG_FILTER_CONTRAST, -255);\n }",
"function invertColors(){\n\t\t$cmd = $this->getBinary('convert');\n\t\t$cmd .= ' ' . $this->getSource() ;\n\t\t$cmd .= ' -negate ';\n\t\t$cmd .= ' ' . $this->getDestination() ;\n\t\t\n\t\t$this->execute($cmd);\n\t\t$this->setSource($this->getDestination());\n\t\t$this->setHistory($this->getDestination());\n \treturn $this ;\n\t}",
"public function toBlackAndWhite() : BlackAndWhiteRasterImage;",
"function darker_negative ($image)\n {\n \n list ($target_file, $width, $height, $image_matrix,$imageFileType) = imagespec ($image); \n \n \n $new_image_matrix = HALFDARKER_HALFNEGATIVE($image_matrix,$width,$height);\n outputimage($new_image_matrix, $imageFileType); \n }",
"public function negateImage ($gray, $channel = Imagick::CHANNEL_ALL) {}",
"private function color_inverse($color){\n $color = str_replace('#', '', $color);\n if (strlen($color) != 6){ return '000000'; }\n $rgb = '';\n for ($x=0;$x<3;$x++){\n $c = 255 - hexdec(substr($color,(2*$x),2));\n $c = ($c < 0) ? 0 : dechex($c);\n $rgb .= (strlen($c) < 2) ? '0'.$c : $c;\n }\n return '#'.$rgb;\n }",
"protected function fillWhiteToImage()\n {\n $this->ImagickD->Imagick->setImageBackgroundColor('white');\n $this->ImagickD->Imagick->setImageAlphaChannel(\\Imagick::ALPHACHANNEL_REMOVE);\n $this->ImagickD->Imagick = $this->ImagickD->Imagick->mergeImageLayers(\\Imagick::LAYERMETHOD_FLATTEN);\n }",
"function MakeTransparent($image)\n {\n if ($this->transparent)\n {\n ImageColorTransparent($image, $this->allocatedcolor);\n }\n }",
"public function resetGrayFill() {\n content->append(\"0 g\")->append_i($separator);\n }",
"function test_to_truecolor($image)\r\n{\r\n if (imageistruecolor($image)) {\r\n return $image;\r\n } else {\r\n $width = imagesx($image);\r\n $height = imagesy($image);\r\n $result = imagecreatetruecolor($width, $height);\r\n imagecopy($result, $image, 0,0, 0,0, $width, $height);\r\n return $result;\r\n }\r\n}",
"function gd_color_transparent ($image, $color = null)\n{\n return imagecolortransparent($image, $color);\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get fake data of Proveedor | public function fakeProveedorData($proveedorFields = [])
{
$fake = Faker::create();
return array_merge([
'marca' => $fake->word,
'serie' => $fake->randomDigitNotNull,
'pais' => $fake->word
], $proveedorFields);
} | [
"public function getProveedor()\n {\n return $this->hasOne(Proveedores::className(), ['Id' => 'proveedor_id']);\n }",
"public function getCorreoProveedor(){\n return $this->correoProveedor;\n }",
"protected function getSupplierData()\n {\n $result['model'] = 'Proveedor';\n $result['icon'] = 'fas fa-users';\n $result['group'] = 'suppliers';\n $result['values'] = [\n ['name' => 'total', 'sql' => 'count(*)', 'type' => 'int'],\n ['name' => 'is-creditor', 'sql' => 'SUM(CASE WHEN acreedor THEN 1 ELSE 0 END)', 'type' => 'int'],\n ['name' => 'suspended', 'sql' => 'SUM(CASE WHEN debaja THEN 1 ELSE 0 END)', 'type' => 'int'],\n ];\n\n return $result;\n }",
"function get_proveedor($idproveedor)\n {\n return $this->db->get_where('proveedores',array('idproveedor'=>$idproveedor))->row_array();\n }",
"public function getProveedores() {\n $database = new database();\n $db = $database->getConnection();\n $query = $db->prepare('SELECT p.* FROM proveedor as p');\n $query->execute();\n if ($query->rowCount() > 0) {\n $query->setFetchMode(PDO::FETCH_OBJ);\n return $query->fetchAll();\n } else {\n return false;\n }\n }",
"public static function GetProveedores(){\n $objArray = Archivos::ExtraerMatizArchCsv(ProveedorDb::$fileUrlTxt); \n $listaProveedores = array(); \n \n for($i =0; $i<count($objArray); $i++){ \n $proveedor = new Proveedor($objArray[$i], $objArray[$i][\"urlImagen\"]); \n $listaProveedores[] = $proveedor; \n }\n \n return $listaProveedores;\n }",
"public function getDireccionProveedor(){\n return $this->direccionProveedor;\n }",
"function obtenerProveedores(){\n \t$db = obtenerBaseDeDatos();\n \t$sentencia = $db->query(\"SELECT * FROM empresas\");\n \treturn $sentencia->fetchAll();\n }",
"public function getIdproveedor()\n {\n\n return $this->idproveedor;\n }",
"public function getIdProveedor()\n {\n return $this->ID_PROVEEDOR;\n }",
"public function proveedor()\n {\n return $this->hasOne('App\\Proveedor', 'PRO_RUN', 'PRO_PROVEEDOR');\n }",
"public function getIdProveedores(){\n return $this->idProveedores;\n }",
"public function obteterDatos($id_Proveedor){\n\t\t\techo '---'.$id_Proveedor.'---';\n\t\t\t$conexion = $this->conn;\n\t\t\t$sth = $conexion->prepare('SELECT id_Proveedor, nombre_proveedor as nombre, fecha_registro ,prop.tipo_procedencia , rfc, telefono , email , direccion , tipop.tipo , nickname , password , url_image from '.$this->nombreTabla.' proveedor , procendias_proveedor prop, tipos tipop where estado = 1 and proveedor.id_tipo_procedencia= prop.id_tipo_procedencia and proveedor.id_tipo = tipop.id_tipo and id_Proveedor = :id_Proveedor', array(PDO::ATTR_CURSOR => PDO::CURSOR_FWDONLY));\t\n\t\t\t$sth->bindParam(':id_Proveedor', $id_Proveedor, PDO::PARAM_INT );\n\t\t\t$sth->execute();\n\t\t\t$row = $sth->fetch(PDO::FETCH_ASSOC);\n\t\t\treturn $row;\n\t\t}",
"public function obtenerProvincia(){\r\n return $this->provincia;\r\n }",
"public function ObtenerProductoXProveedor($idProducto,$idProveedor)\r\n {\r\n return ProductoPorProveedor::where('Producto_id','=',$idProducto)->where('Proveedor_id','=',$idProveedor)->get()->first();\r\n }",
"public function insert($proveedor);",
"function get_all_listaproveedor()\n {\n return $this->db->get('proveedor')->result_array();\n }",
"function get_po_proveedor($idPog)\n {\n return $this->db->get_where('po_proveedor',array('idPog'=>$idPog))->row_array();\n }",
"public function ServiceGetWithPrestamosAndLetras()\n {\n $data = \\Input::all();\n\n $proveedor = $this->proveedorRep->getProveedorByDNI($data['dni']);\n\n $proveedor = $this->proveedorRep->getProveedorByPrestamos($proveedor->id);\n\n\n return \\Response::json($proveedor);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Disables authorization for the current test | protected function disableAuthorization() {
$this->accessDecisionManager->setOverrideDecision(TRUE);
} | [
"public function testDeny() {\n\t\t$object = new TestTinyAuthorize($this->collection, [\n\t\t]);\n\n\t\t// All tests performed against this action\n\t\t$this->request = $this->request->withParam('action', 'foo');\n\n\t\t// Test standard controller\n\t\t$this->request = $this->request->withParam('controller', 'Blogs');\n\n\t\t$user = ['role_id' => ROLE_MODERATOR];\n\t\t$res = $object->authorize($user, $this->request);\n\t\t$this->assertTrue($res);\n\n\t\t$user = ['role_id' => ROLE_USER];\n\t\t$res = $object->authorize($user, $this->request);\n\t\t$this->assertFalse($res);\n\t}",
"public function skipsAuthorization()\n {\n return true;\n }",
"public function testDontIgnoreAuthorization()\n {\n $controller = $this->_buildController();\n $event = new Event('testing');\n $controller->beforeFilter($event);\n\n $this->assertFalse($controller->getRequest()->getAttribute('authorization')->authorizationChecked());\n }",
"public function testNotAdmin()\n {\n $user = factory('App\\User')->make();\n\n $this->authTests($user, $this->UNAUTHORISED_ACCESS);\n }",
"public function skipsAuthorization(): bool\n {\n return true;\n }",
"public function testCanDoActionWithoutLogin()\n {\n $this->assertFalse($this->authorize->can('see users'));\n }",
"public function skipsAuthorization(): bool\n {\n return Gate::allows('skips-authorization', $this);\n }",
"public function testIsDeniedWithoutRolesAndResource(): void {\r\n $this -> assertTrue($this -> acl -> isDenied('administrator', 'blog.edit'));\r\n }",
"function assertAccessDeny()\n {\n $this->response->assertStatus(403);\n }",
"public function dontSeeAuthentication(): void {\n $this->getScenario()->runStep(new \\Codeception\\Step\\Action('dontSeeAuthentication', func_get_args()));\n }",
"public function denyAccess()\n {\n $this->_aclPlugin->denyAccess();\n }",
"public function testCanDoActionWithNotExistentPermission()\n {\n $this->assertFalse($this->authorize->can('Not Existent Permission'));\n }",
"private function disableAuth()\n {\n Shopware()->Plugins()->Backend()->Auth()->setNoAuth(true);\n Shopware()->Plugins()->Backend()->Auth()->setNoAcl(true);\n }",
"function testAllowDenyAll() {\n\t\t$this->Controller->Auth->initialize($this->Controller);\n\n\t\t$this->Controller->Auth->allow('*');\n\t\t$this->Controller->Auth->deny('add', 'camelcase');\n\n\t\t$this->Controller->params['action'] = 'delete';\n\t\t$this->assertTrue($this->Controller->Auth->startup($this->Controller));\n\n\t\t$this->Controller->params['action'] = 'add';\n\t\t$this->assertFalse($this->Controller->Auth->startup($this->Controller));\n\n\t\t$this->Controller->params['action'] = 'Add';\n\t\t$this->assertFalse($this->Controller->Auth->startup($this->Controller));\n\n\t\t$this->Controller->params['action'] = 'camelCase';\n\t\t$this->assertFalse($this->Controller->Auth->startup($this->Controller));\n\n\t\t$this->Controller->Auth->allow('*');\n\t\t$this->Controller->Auth->deny(array('add', 'camelcase'));\n\n\t\t$this->Controller->params['action'] = 'camelCase';\n\t\t$this->assertFalse($this->Controller->Auth->startup($this->Controller));\n\t}",
"public function testSendNotSendAbility()\n {\n $user = UserModel::factory()->create();\n\n $response = $this\n ->actingAs($user, 'api')\n ->json('POST', '/api/v2/feeds', []);\n\n $response->assertStatus(403);\n }",
"public function test_anonymous_option_off_guest_user()\n {\n setting()->set('anonymous_urls', 0);\n\n $data = [\n 'url' => 'https://google.com',\n 'customUrl' => '',\n ];\n\n $this->post('/url', $data)\n ->assertStatus(403);\n }",
"public function testDenyUserToUnlikeARecipeWithoutPermission()\n {\n $recipe = Recipe::factory()->create();\n \n $response = $this->actingAs($this->user)->get(route('recipes.unlike', $recipe));\n\n $response->assertForbidden();\n }",
"public function unblockAccess();",
"abstract public function deny();"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create request for operation 'getSmtpTemplate' | protected function getSmtpTemplateRequest($templateId)
{
// verify the required parameter 'templateId' is set
if ($templateId === null || (is_array($templateId) && count($templateId) === 0)) {
throw new \InvalidArgumentException(
'Missing the required parameter $templateId when calling getSmtpTemplate'
);
}
$resourcePath = '/smtp/templates/{templateId}';
$formParams = [];
$queryParams = [];
$headerParams = [];
$httpBody = '';
$multipart = false;
// path params
if ($templateId !== null) {
$resourcePath = str_replace(
'{' . 'templateId' . '}',
ObjectSerializer::toPathValue($templateId),
$resourcePath
);
}
// body params
$_tempBody = null;
if ($multipart) {
$headers = $this->headerSelector->selectHeadersForMultipart(
['application/json']
);
} else {
$headers = $this->headerSelector->selectHeaders(
['application/json'],
['application/json']
);
}
// for model (json/xml)
if (isset($_tempBody)) {
// $_tempBody is the method argument, if present
$httpBody = $_tempBody;
if($headers['Content-Type'] === 'application/json') {
// \stdClass has no __toString(), so we should encode it manually
if ($httpBody instanceof \stdClass) {
$httpBody = \GuzzleHttp\json_encode($httpBody);
}
// array has no __toString(), so we should encode it manually
if(is_array($httpBody)) {
$httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
}
}
} elseif (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
$multipartContents[] = [
'name' => $formParamName,
'contents' => $formParamValue
];
}
// for HTTP post (form)
$httpBody = new MultipartStream($multipartContents);
} elseif ($headers['Content-Type'] === 'application/json') {
$httpBody = \GuzzleHttp\json_encode($formParams);
} else {
// for HTTP post (form)
$httpBody = \GuzzleHttp\Psr7\Query::build($formParams);
}
}
// this endpoint requires API key authentication
$apiKey = $this->config->getApiKeyWithPrefix('api-key');
if ($apiKey !== null) {
$headers['api-key'] = $apiKey;
}
// this endpoint requires API key authentication
$apiKey = $this->config->getApiKeyWithPrefix('partner-key');
if ($apiKey !== null) {
$headers['partner-key'] = $apiKey;
}
$defaultHeaders = [];
if ($this->config->getUserAgent()) {
$defaultHeaders['User-Agent'] = $this->config->getUserAgent();
}
$headers = array_merge(
$defaultHeaders,
$headerParams,
$headers
);
$query = \GuzzleHttp\Psr7\Query::build($queryParams);
return new Request(
'GET',
$this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
} | [
"protected function leadsEmailsTemplatesGetRequest()\n {\n\n $resourcePath = '/leads/emails/templates';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/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-API-KEY');\n if ($apiKey !== null) {\n $headers['X-API-KEY'] = $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 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function createRequestForGetTemplates(): RequestInterface\n {\n return $this->createRequest('GET', sprintf('/%1$s/templates', $this->getOptions()->getAccountId()), null, [], [], []);\n }",
"protected function retrieveTemplate2Request()\n {\n\n $resourcePath = '/accountnumberformats/template';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/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 HTTP basic authentication\n if ($this->config->getUsername() !== null || $this->config->getPassword() !== null) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('fineract-platform-tenantid');\n if ($apiKey !== null) {\n $headers['fineract-platform-tenantid'] = $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 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"protected function retrieveTemplate20Request()\n {\n\n $resourcePath = '/taxes/component/template';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/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 HTTP basic authentication\n if ($this->config->getUsername() !== null || $this->config->getPassword() !== null) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('fineract-platform-tenantid');\n if ($apiKey !== null) {\n $headers['fineract-platform-tenantid'] = $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 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"protected function getTemplatesRequest()\n {\n\n $resourcePath = '/templates';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\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 Bearer (JWT) authentication (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\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 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"protected function getTemplatesRequest()\n {\n\n $resourcePath = '/templates';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\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-Auth-Key');\n if ($apiKey !== null) {\n $headers['X-Auth-Key'] = $apiKey;\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('X-Auth-Key');\n if ($apiKey !== null) {\n $queryParams['X-Auth-Key'] = $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 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"protected function template1Request()\n {\n\n $resourcePath = '/email/campaign/template';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/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 HTTP basic authentication\n if ($this->config->getUsername() !== null || $this->config->getPassword() !== null) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('fineract-platform-tenantid');\n if ($apiKey !== null) {\n $headers['fineract-platform-tenantid'] = $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 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"protected function listPushTemplatesRequest()\n {\n\n $resourcePath = '/v2/push/templates';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/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('ApiKey');\n if ($apiKey !== null) {\n $headers['ApiKey'] = $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 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"protected function createObjectTemplateRequest($template = null)\n {\n\n $resourcePath = '/objects/templates';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\n if (isset($template)) {\n $_tempBody = $template;\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 $httpBody = $_tempBody; // $_tempBody is the method argument, if present\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 $httpBody = new MultipartStream($multipartContents); // for HTTP post (form)\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams); // for HTTP post (form)\n }\n }\n\n // this endpoint requires OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n // this endpoint requires OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n $url = $this->config->getHost() . $resourcePath . ($query ? '?' . $query : '');\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 return new Request(\n 'POST',\n $url,\n $headers,\n $httpBody\n );\n }",
"protected function leadsSmsTemplatesGetRequest()\n {\n\n $resourcePath = '/leads/sms/templates';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/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-API-KEY');\n if ($apiKey !== null) {\n $headers['X-API-KEY'] = $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 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"protected function createAchievementTemplateRequest($template = null)\n {\n\n $resourcePath = '/achievements/templates';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\n if (isset($template)) {\n $_tempBody = $template;\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 $httpBody = $_tempBody; // $_tempBody is the method argument, if present\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 $httpBody = new MultipartStream($multipartContents); // for HTTP post (form)\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams); // for HTTP post (form)\n }\n }\n\n // this endpoint requires OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n // this endpoint requires OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n $url = $this->config->getHost() . $resourcePath . ($query ? '?' . $query : '');\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 return new Request(\n 'POST',\n $url,\n $headers,\n $httpBody\n );\n }",
"public function createRequestForCreateTemplate(Template $template): RequestInterface\n {\n return $this->createRequest('POST', sprintf('/%1$s/templates', $this->getOptions()->getAccountId()), $template, [], [], []);\n }",
"protected function getMessageTemplateRequest($id)\n {\n // verify the required parameter 'id' is set\n if ($id === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $id when calling getMessageTemplate');\n }\n\n $resourcePath = '/messaging/templates/{id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($id !== null) {\n $resourcePath = str_replace('{' . 'id' . '}', ObjectSerializer::toPathValue($id), $resourcePath);\n }\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 []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n $httpBody = $_tempBody; // $_tempBody is the method argument, if present\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 $httpBody = new MultipartStream($multipartContents); // for HTTP post (form)\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams); // for HTTP post (form)\n }\n }\n\n // this endpoint requires OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n // this endpoint requires OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n $url = $this->config->getHost() . $resourcePath . ($query ? '?' . $query : '');\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 return new Request(\n 'GET',\n $url,\n $headers,\n $httpBody\n );\n }",
"public function getEmailTemplate() {\n }",
"function get_template($template_name) {\n $access = ClassRegistry::init('EmailTemplate');\n $clientData = $access->find('first', array(\n 'joins' => array(\n array(\n 'table' => 'email_lists',\n 'alias' => 'EmailList',\n 'type' => 'INNER',\n 'conditions' => array(\n 'EmailList.id = EmailTemplate.email_for'\n )\n )\n ),\n 'conditions' => array(\n 'EmailList.id' => $template_name),\n 'fields' => array('EmailTemplate.subject', 'EmailTemplate.header_msg', 'EmailTemplate.content', 'EmailTemplate.sms_body')\n ));\n return $clientData['EmailTemplate'];\n }",
"public function getEmailTemplate($type, $default) {\n\n \t\t//parse inputs\n \t\t$resourcePath = \"/config/email/template/{type}?default={default}\";\n \t\t$resourcePath = str_replace(\"{format}\", \"json\", $resourcePath);\n \t\t$method = \"GET\";\n $queryParams = array();\n $headerParams = array();\n $headerParams['Accept'] = 'application/json';\n $headerParams['Content-Type'] = 'application/json';\n\n if($type != null) {\n \t\t\t$resourcePath = str_replace(\"{\" . \"type\" . \"}\",\n \t\t\t $this->apiClient->toPathValue($type), $resourcePath);\n \t\t}\n \t\tif($default != null) {\n \t\t\t$resourcePath = str_replace(\"{\" . \"default\" . \"}\",\n \t\t\t $this->apiClient->toPathValue($default), $resourcePath);\n \t\t}\n \t\t//make the API Call\n if (! isset($body)) {\n $body = null;\n }\n \t\t$response = $this->apiClient->callAPI($resourcePath, $method,\n \t\t $queryParams, $body,\n \t\t $headerParams);\n\n\n if(! $response){\n return null;\n }\n\n \t\t$responseObject = $this->apiClient->deserialize($response,\n \t\t 'object');\n \t\treturn $responseObject;\n\n }",
"protected function retrieveOneTemplateRequest($resourceId)\n {\n // verify the required parameter 'resourceId' is set\n if ($resourceId === null || (is_array($resourceId) && count($resourceId) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $resourceId when calling retrieveOneTemplate'\n );\n }\n\n $resourcePath = '/email/campaign/template/{resourceId}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($resourceId !== null) {\n $resourcePath = str_replace(\n '{' . 'resourceId' . '}',\n ObjectSerializer::toPathValue($resourceId),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/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 HTTP basic authentication\n if ($this->config->getUsername() !== null || $this->config->getPassword() !== null) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('fineract-platform-tenantid');\n if ($apiKey !== null) {\n $headers['fineract-platform-tenantid'] = $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 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"protected function getShippingTemplateRequest($id)\n {\n // verify the required parameter 'id' is set\n if ($id === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $id when calling getShippingTemplate');\n }\n\n $resourcePath = '/store/shipping/templates/{id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($id !== null) {\n $resourcePath = str_replace('{' . 'id' . '}', ObjectSerializer::toPathValue($id), $resourcePath);\n }\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 []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n $httpBody = $_tempBody; // $_tempBody is the method argument, if present\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 $httpBody = new MultipartStream($multipartContents); // for HTTP post (form)\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams); // for HTTP post (form)\n }\n }\n\n // this endpoint requires OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n // this endpoint requires OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n $url = $this->config->getHost() . $resourcePath . ($query ? '?' . $query : '');\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 return new Request(\n 'GET',\n $url,\n $headers,\n $httpBody\n );\n }",
"protected function createAlertTemplateRequest($body = null)\n {\n\n $resourcePath = '/v2/alert/template';\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 ['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 // \\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('ApiKey');\n if ($apiKey !== null) {\n $headers['ApiKey'] = $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 }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Test case for updateWarehouse Update a warehouse | public function test_updateWarehouse() {
} | [
"public function test_updateWarehouseCustomFields() {\n\n }",
"public function test_ShouldStoreWarehouse()\n {\n $response = $this->storeWarehouse();\n $response->assertStatus(201)\n ->assertJson([\n 'status' => 'success',\n 'http_status_code' => 201,\n ])\n ->assertJsonStructure([\n 'status',\n 'http_status_code',\n 'warehouse_id',\n ]);\n $obj = json_decode( $response->content() );\n\n // Assert wh warehouse\n $this->assertDatabaseHas('wh_warehouse', [\n 'id' => $obj->warehouse_id,\n 'g_branch_office_id' => $this->tempJson['g_branch_office_id'],\n 'wh_warehouse_type_id' => $this->tempJson['wh_warehouse_type_id'],\n 'name' => $this->tempJson['name'],\n 'description' => $this->tempJson['description'],\n 'address' => $this->tempJson['address'],\n 'is_waste_warehouse' => $this->tempJson['is_waste_warehouse'],\n 'flag_delete' => false\n ]);\n return $obj->warehouse_id;\n }",
"public function testInventoryBudgetPATCHRequestInventoryIDBudgetsLogicalWarehouseIDUpdate()\n {\n }",
"public function test_ShouldThrowException_IfWarehouseTypeDoesntExists()\n {\n $response = $this->updateWarehouseType(-1);\n $this->assertError($response, 500);\n }",
"public function updateWarehouseList()\n {\n $result = file_get_contents(self::PILIBABA_WAREHOUSE_LIST_URL);\n if (empty($result)) return;\n $array = json_decode($result, true);\n $warehouseList = array();\n foreach ($array as $key => $value) {\n $warehouseList[] = array(\n 'id' => $value['id'],\n 'name' => $value['country'].' '.$value['state'].' warehouse',\n 'active' => 0,\n 'receiverFirstName' => $value['firstName'],\n 'receiverLastName' => $value['lastName'],\n 'receiverPhone' => $value['tel'],\n 'street' => $value['address'],\n 'addressLine1' => '',\n 'addressLine2' => '',\n 'city' => $value['city'],\n 'zipCode' => $value['zipcode'],\n 'state' => $value['state'],\n 'country' => $value['country'],\n 'countryIsoCode' => $value['iso2CountryCode'],\n 'company' => '',\n );\n }\n $sql = \"truncate table `pilipay_warehouses`\";\n Shopware()->Db()->query($sql);\n $fieldsList = array_keys($warehouseList[0]);\n $fields = implode(', ', array_map(function($s){ return '`'.$s.'`';}, $fieldsList));\n $values = implode(', ', array_map(function($warehouse) use ($fieldsList){\n return \"(\" . implode(\", \", array_map(function($field) use ($warehouse){\n return \"'\".strtr($warehouse[$field], array(\"\\\\\" => \"\\\\\\\\\", \"'\" => \"\\\\'\")).\"'\";\n }, $fieldsList)) . \")\";\n }, $warehouseList));\n\n $sql = sprintf(\"INSERT INTO `pilipay_warehouses` ( %s ) VALUES %s\", $fields, $values);\n Shopware()->Db()->query($sql);\n }",
"public function updateWarehouseProcessFinal($request_params, $warehouse) {\n\n if(!empty($request_params['image'])){\n $warehouse->image = $request_params['image'] ;\n }\n\n $warehouse->en_title = !empty($request_params['en_title']) ? $request_params['en_title'] : $warehouse->en_title;\n $warehouse->ar_title = !empty($request_params['ar_title']) ? $request_params['ar_title'] : $warehouse->ar_title;\n $warehouse->country = !empty($request_params['country']) ? $request_params['country'] : $warehouse->country;\n $warehouse->city = !empty($request_params['city']) ? $request_params['city'] : $warehouse->city;\n $warehouse->phone = $request_params['phone'];\n $warehouse->address = $request_params['address'];\n $warehouse->zip_code = $request_params['zip_code'];\n $warehouse->state = $request_params['state'];\n $warehouse->lng = $request_params['lng'];\n $warehouse->lat = $request_params['lat'];\n $warehouse->slug = $this->prepareSlug($warehouse->en_title);\n\n if ($warehouse->save()) {\n return redirect()->route('getWarehouses')->with('success_message', 'Warehouse data is updated successfully');\n } else {\n return redirect()->back()->with('error_message', 'Internal server error occured');\n }\n }",
"public function update_goods_receipt_warehouse($data)\n {\n\n \t$this->db->where('name',$data['input_name']);\n \t$this->db->update(db_prefix() . 'options', [\n \t\t'value' => $data['input_name_status'],\n \t]);\n \tif ($this->db->affected_rows() > 0) {\n \t\treturn true;\n \t}else{\n \t\treturn false;\n \t}\n }",
"public function testCanEditWarehouses()\n {\n $this->_authorization->expects($this->exactly(1))\n ->method('isAllowed')\n ->with($this->equalTo('EWD_Stock::warehouse_save'))\n ->will($this->returnValue(true));\n \n $this->_buttonList->expects($this->atLeastOnce())\n ->method('add')\n ->withConsecutive(\n array($this->equalTo('back')),\n array($this->equalTo('reset')),\n array($this->equalTo('save')),\n array($this->equalTo('saveandcontinue'))\n );\n \n $this->_buttonList->expects($this->atLeastOnce())\n ->method('remove')\n ->withConsecutive(\n array($this->equalTo('delete')),\n array($this->equalTo('save'))\n );\n \n $this->_buttonList->expects($this->atLeastOnce())\n ->method('update')\n ->with(\n $this->equalTo('save'), \n $this->equalTo('label'),\n $this->equalTo(__('Save Warehouse'))\n );\n \n $this->_block = $this->_objectManager->getObject('\\EWD\\Stock\\Block\\Adminhtml\\Warehouse\\Edit', [\n 'context' => $this->_context,\n 'registry' => $this->_registry\n ]);\n \n $className = '\\EWD\\Stock\\Block\\Adminhtml\\Warehouse\\Edit';\n $objectId = new \\ReflectionProperty($className, '_objectId');\n $blockGroup = new \\ReflectionProperty($className, '_blockGroup');\n $controller = new \\ReflectionProperty($className, '_controller');\n \n $objectId->setAccessible(true);\n $blockGroup->setAccessible(true);\n $controller->setAccessible(true);\n \n $this->assertEquals($objectId->getValue($this->_block), 'warehouse_id');\n $this->assertEquals($blockGroup->getValue($this->_block), 'EWD_Stock');\n $this->assertEquals($controller->getValue($this->_block), 'adminhtml_warehouse');\n }",
"public function actionWarehouseAdminSave()\n {\n $request = Yii::$app->request->post();\n $infoWarehouse = '';\n\n if($request){\n $infoWarehouse = Warehouse::find()\n ->where(['_id'=>new ObjectID($request['id'])])\n ->one();\n\n $userId = [];\n if(!empty($request['idUsers'])){\n foreach($request['idUsers'] as $item){\n $userId[] = $item;\n }\n }\n $infoWarehouse->idUsers = $userId;\n\n\n $infoWarehouse->headUser = ($request['headUser'] !== 'placeh' ? new ObjectID($request['headUser']) : '');\n\n $infoWarehouse->responsible = ($request['responsible'] !== 'placeh' ? new ObjectID($request['responsible']) : '');\n\n\n if($infoWarehouse->save()){\n $error = [\n 'typeAlert' => 'success',\n 'message' => 'Сохранения применились.',\n ];\n\n } else {\n $error = [\n 'typeAlert' => 'danger',\n 'message' => 'Сохранения не применились, что то пошло не так!!!',\n ];\n }\n\n\n } else {\n $error = [\n 'typeAlert' => 'danger',\n 'message' => 'Сохранения не применились, что то пошло не так!!!',\n ];\n }\n\n return $this->renderPartial('_update-users-warehouse',[\n 'language' => Yii::$app->language,\n 'infoWarehouse' => $infoWarehouse,\n 'error' => $error\n ]);\n }",
"public function testCreateUpdateProduct()\n {\n }",
"public function updateWarehouseRequest($warehouse_id, $update_warehouse_request_body)\n {\n // verify the required parameter 'warehouse_id' is set\n if ($warehouse_id === null || (is_array($warehouse_id) && count($warehouse_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $warehouse_id when calling updateWarehouse'\n );\n }\n if (strlen($warehouse_id) > 25) {\n throw new \\InvalidArgumentException('invalid length for \"$warehouse_id\" when calling WarehousesApi.updateWarehouse, must be smaller than or equal to 25.');\n }\n if (strlen($warehouse_id) < 1) {\n throw new \\InvalidArgumentException('invalid length for \"$warehouse_id\" when calling WarehousesApi.updateWarehouse, must be bigger than or equal to 1.');\n }\n if (!preg_match(\"/^se(-[a-z0-9]+)+$/\", $warehouse_id)) {\n throw new \\InvalidArgumentException(\"invalid value for \\\"warehouse_id\\\" when calling WarehousesApi.updateWarehouse, must conform to the pattern /^se(-[a-z0-9]+)+$/.\");\n }\n\n // verify the required parameter 'update_warehouse_request_body' is set\n if ($update_warehouse_request_body === null || (is_array($update_warehouse_request_body) && count($update_warehouse_request_body) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $update_warehouse_request_body when calling updateWarehouse'\n );\n }\n\n $resourcePath = '/v1/warehouses/{warehouse_id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($warehouse_id !== null) {\n $resourcePath = str_replace(\n '{' . 'warehouse_id' . '}',\n ObjectSerializer::toPathValue($warehouse_id),\n $resourcePath\n );\n }\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['text/plain', 'application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['text/plain', 'application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($update_warehouse_request_body)) {\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($update_warehouse_request_body));\n } else {\n $httpBody = $update_warehouse_request_body;\n }\n } elseif (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 key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('API-Key');\n if ($apiKey !== null) {\n $headers['API-Key'] = $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\\Query::build($queryParams);\n return new Request(\n 'PUT',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function processWarehouses()\n {\n }",
"public function testUpdateProductionLot()\n {\n }",
"public function transferProductsToDefaultWarehouse();",
"public function makeWarehouseSecondary(){\r\n\r\n\t\t\t$data = $this->db->select('*')\r\n\t\t\t\t\t ->from('Pwarehouse')\r\n\t\t\t\t\t ->where('delete_status',0)\r\n\t\t\t\t\t ->get()\r\n\t\t\t\t\t ->result();\r\n\t\t\tif($data != null){\r\n\t\t\t\t$secondary_warehouse_sql = \"update Pwarehouse set primary_Pwarehouse = 0\";\r\n\t\t\t\t$this->db->query($secondary_warehouse_sql,array($this->getCurrentPrimaryWarehouse()));\r\n\t\t\t}\r\n\r\n\r\n\t}",
"public function testApplyOrderWarehouseFulfillmentPlan()\n {\n }",
"public function testUpdateSupplierProduct()\n {\n }",
"public function updateWarehouse($id, $request)\n {\n $data = self::show($id);\n\n if($request->hasFile('logo')){\n\n $oldLogo = $data['logo'];\n $fileName = parent::updateLogo($request, $oldLogo);\n\n } else {\n\n $fileName = $data['logo'];\n\n }\n\n $data = [\n 'title' => $request->title,\n 'email' => $request->email,\n 'logo' => $fileName,\n 'website' => $request->website\n ];\n\n $item = Warehouses::findOrFail($id);\n $item->update($data);\n\n return;\n }",
"public function testUpdateProduct()\n {\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Generate state token for Stripe Connect auth request | public static function generateStateToken() {
$user = (elgg_is_logged_in()) ? elgg_get_logged_in_user_entity() : elgg_get_site_entity();
return md5(get_site_secret() . $user->name . $user->guid);
} | [
"public function generateToken()\n {\n }",
"public function createToken();",
"private function buildToken() {\n\n // Generate random seed value.\n $seed = microtime(TRUE) . rand();\n\n // Assemble prehash data.\n $prehash = $this->configuration['source_key'] . $seed . trim($this->configuration['pin']);\n\n // Hash the data.\n $hash = sha1($prehash);\n\n // Assemble ueSecurityToken as an array.\n $token = [\n 'SourceKey' => $this->configuration['source_key'],\n 'PinHash' => [\n 'Type' => 'sha1',\n 'Seed' => $seed,\n 'HashValue' => $hash,\n ],\n 'ClientIP' => \\Drupal::request()->getClientIp(),\n ];\n\n return $token;\n }",
"public function fetchRequestToken();",
"public function getPaymentToken();",
"public function create_token (){\n $token = md5($this->password.$this->date);\n $this->set_token($token);\n return $token;\n }",
"protected function establishCSRFTokenState()\n {\n return md5(uniqid(mt_rand(), true));\n }",
"public function getToken()\n {\n $params[\"amount\"] = $this->getAmount();\n $params[\"invoiceNumber\"] = $this->getInvoiceNumber();\n $params[\"invoiceDate\"] = $this->getInvoiceDate();\n $params['action'] = $this->getAction();\n $params['merchantCode'] = $this->getMerchantId();\n $params['terminalCode'] = $this->getTerminalId();\n $params['redirectAddress'] = $this->getRedirectUrl();\n $params['timeStamp'] = date(\"Y/m/d H:i:s\");\n if ($this->getMobile()) {\n $params['mobile'] = $this->getMobile();\n }\n if ($this->getEmail()) {\n $params['email'] = $this->getEmail();\n }\n \n if ($this->multiPaymentMode) { \n if ($this->getMerchantName() !== null) {\n $params['MerchantName'] = $this->getMerchantName();\n }\n $params['MultiPaymentData'] = base64_encode($this->generatePayment());\n }\n\n $sign = $this->sign(json_encode($params));\n $this->token = $this->api->send(static::URL_GET_TOKEN, RequestBuilder::POST, [\"Sign\" => $sign], $params, true, $this->safeMode);\n return $this->token;\n }",
"public function generateToken() {\n // Create or overwrite the csrf entry in the seesion\n $_SESSION['csrf'] = array();\n $_SESSION['csrf']['time'] = time();\n $_SESSION['csrf']['salt'] = $this->randomString(32);\n $_SESSION['csrf']['sessid'] = session_id();\n $_SESSION['csrf']['ip'] = $_SERVER['REMOTE_ADDR'];\n // Generate the SHA1 hash\n $hash = $this->calculateHash();\n // Generate and return the token\n return base64_encode($hash);\n }",
"public function create_payment_token() {\n $storage_safe_token = wc_clean( $_POST['trxservices_token'] );\n $card_type = wc_clean( $_POST['trxservices_card_type'] );\n $last_four = wc_clean( $_POST['trxservices_last_four'] );\n $expiry_month = wc_clean( $_POST['trxservices_expiry_month'] );\n $expiry_year = wc_clean( $_POST['trxservices_expiry_year'] );\n\n $token = new WC_Payment_Token_CC();\n $token->set_token( $storage_safe_token );\n $token->set_card_type( $card_type );\n $token->set_last4( $last_four );\n $token->set_expiry_month( $expiry_month );\n $token->set_expiry_year( $expiry_year );\n $token->set_user_id( get_current_user_id() );\n $result = $token->save();\n if ($result) {\n $message = 'Payment token ID %s created for StorageSafe token %s.';\n $this->log( sprintf( __( $message, 'woocommerce-trxservices' ), $result, $storage_safe_token ) );\n }\n return $result;\n }",
"public function getBillingToken();",
"public function tokenAction() {\n // This generates a token and stores it in the session\n $token = $this->oauth->generateStateToken();\n\n $array = array(\n 'token' => $token\n );\n $json = new JsonModel($array);\n return $json;\n }",
"public function requestToken();",
"public function generateSignupRequestToken()\n {\n $this->signup_request_token = Yii::$app->security->generateRandomString() . '_' . time();\n }",
"private function generateToken()\n {\n if ($this->get('__token') != null) {\n // Store old token in session\n $this->set('__previous_token', $this->get('__token'));\n }\n\n // Generate new token\n $this->set('__token', hash('sha256', uniqid(mt_rand(), true)));\n }",
"function generate_ppec_paypal_checkout_token() {\n\t\t$this->load_gateway( 'ppec_paypal' )->generate_express_checkout_token();\n\t}",
"public function purchaseStoredToken();",
"protected function generateRequestToken()\n {\n return uniqid();\n }",
"public function getCustomerToken();"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the Document as a DOMDocument. | public function toDomDocument() : DOMDocument
{
$document = new DOMDocument();
$document->appendChild($this->toDomElement($document));
return $document;
} | [
"public function getDOMDocument(): \\DOMDocument\n {\n return $this->document;\n }",
"private static function createDomDocument()\n {\n $document = new \\DOMDocument('1.0', 'utf-8');\n $document->preserveWhiteSpace = false;\n $document->formatOutput = true;\n\n return $document;\n }",
"private static function createDomDocument()\n {\n $document = new DOMDocument('1.0', 'utf-8');\n $document->preserveWhiteSpace = false;\n $document->formatOutput = true;\n\n return $document;\n }",
"public function newDOMDocument()\r\n\t{\r\n\t\t$doc = new DOMDocument();\r\n\t\t$doc->formatOutput = true;\r\n\t\t$doc->encoding='UTF-8';\r\n\t\treturn $doc;\r\n\t}",
"protected function getDomDocument()\n {\n return new \\DomDocument();\n }",
"public function getDOMDocument()\n {\n return $this->dom;\n }",
"public function retrieveDocument(): DOMDocument\n {\n return clone $this->dom();\n }",
"public function getDocument(): DOMDocument\n {\n return clone $this->document;\n }",
"public function getDom()\r\n {\r\n if (null == $this->dom) {\r\n $this->dom = $this->loadDocument();\r\n }\r\n\r\n return $this->dom;\r\n }",
"protected function getDoc(): DOMDocument\n {\n return $this->node instanceof DOMDocument\n ? $this->node\n : $this->node->ownerDocument;\n }",
"public function getDomTree() {\n $doc= new DOMDocument($this->version, $this->getEncoding());\n \n if ($this->root) {\n $doc->appendChild($this->root->getDomNode($doc));\n }\n \n return $doc;\n }",
"protected function getDOMDocument()\n {\n $source = new DOMDocument();\n $source->loadHTMLFile($this->path);\n\n return $this->selector\n ? $this->fragment($source, $this->selector)\n : $source;\n }",
"public function getDomDocument()\n {\n return $this->document;\n }",
"private function getDomDoc(){\n\t\t\t\n\t\t\t//LOGIC\n\t\t\t\n\t\t\t// if not exist yet, create the domdoc\n\t\t\tif ( is_null($this->domdoc) ){\n\t\t\t\t$this->domdoc = new DOMDocument();\n\t\t\t\t@$this->domdoc->loadHTMLFile($this->url);\n\t\t\t} \n\t\t\t\n\t\t\treturn $this->domdoc;\n\t\t}",
"public function parseDocument() : \\DOMDocument\n {\n $pattern ='/(x|ht)ml(?:.*;charset=(\\S+))?/i';\n $contentType = $this->response->getHeader('Content-Type');\n $isDocument = (preg_match($pattern, $contentType, $matches) === 1);\n $charset = (isset($matches[2]) ? $matches[2] : 'UTF-8');\n\n $useInternalErrors = libxml_use_internal_errors(true);\n\n if (version_compare(PHP_VERSION, '8.0.0') < 0) {\n $disableEntityLoader = libxml_disable_entity_loader(true);\n }\n\n $document = new \\DOMDocument('1.0', $charset);\n $document->validateOnParse = true;\n\n if ($isDocument) {\n $isXml = (strtolower($matches[1]) === 'x');\n\n if ($isXml) {\n $document->loadXML($this->getText());\n } else {\n $document->loadHTML($this->getText());\n }\n }\n\n libxml_use_internal_errors($useInternalErrors);\n\n if (version_compare(PHP_VERSION, '8.0.0') < 0) {\n libxml_disable_entity_loader($disableEntityLoader);\n }\n\n return $document;\n }",
"protected function getResponseDomDocument()\n {\n $document = new DOMDocument('1.0', 'utf-8');\n $document->loadXML($this->client->__getLastResponse());\n\n return $document;\n }",
"public function getDOM() {\n $document = new DOMDocument();\n $document->loadXML($this->loadSubtitleContent());\n return $document;\n }",
"public abstract function toDomElement(DOMDocument $document): DOMElement;",
"protected function getDom()\n {\n if (! isset($this->dom)) {\n $dom = new DOMDocument();\n if (is_null($this->getResults())) {\n throw new \\RuntimeException('There doesnt appear to be any results to load');\n }\n // suppress warning but throw Exception\n if (! @$dom->loadXML($this->getResults())) {\n throw new \\RuntimeException('Could not load results into DOMDocument');\n }\n $this->dom = $dom;\n }\n return $this->dom;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
diagnose(int $t, float $m) Checks paramaters to make sure they're ok Possible responses: "All OK" "Temperature out of range" "Moisture out of range" "Temperature and moisture (m) out of range)" | public function diagnose($t,$m){
$msg = '';
$roundTemp = round($t) . "℃";
if(!$this->isTempWithinRange($t)){
$msg .= "Temperature out of range";
}
if(!$this->isMoistureWithinRange($m)){
if(!empty($msg)){
$msg = "Temperature and moisture out of range";
}else{
$msg .= "Moisture out of range";
}
}
if(empty($msg)){
$msg = "All OK";
}
return $msg;
} | [
"function valid_times($t_conn_res){\n\n // array that will be returned by this function\n $action_res = array('errors' => array());\n \n // check if mintime and maxtime are set in the request\n if (isset($_POST['mintime']) && isset($_POST['maxtime'])) {\n $mintime = $_POST['mintime']; // save mintime in variable\n $maxtime = $_POST['maxtime']; // save maxtime in variable\n\n // check if mintime and maxtime are numeric\n if (is_numeric($mintime) && is_numeric($maxtime)){\n $mintime = intval($mintime); // be sure that $mintime is integer\n $maxtime = intval($maxtime); // be sure that $maxtime is integer\n\n if ($mintime > $maxtime){\n // invalid data: $maxtime should be greater than $mintime\n array_push($action_res['errors'], array(\"id\" => 810,\n \"htmlcode\" => 422,\n \"message\" => \"'from' date should come before the 'to' date\"));\n }\n elseif ($mintime === $maxtime && $mintime === 0){\n // valid data: both are 0, show all the data\n $action_res = set_times($t_conn_res, $mintime, $maxtime);\n }\n elseif ($mintime < $maxtime){\n // valid data: $maxtime is greater than $mintime\n $action_res = set_times($t_conn_res, $mintime, $maxtime);\n }\n else{\n // invalid data: $mintime is equal to $maxtime\n // but they are not equal to 0\n array_push($action_res['errors'], array(\"id\" => 811,\n \"htmlcode\" => 422,\n \"message\" => \"'from' date should be different to the 'to' date (or both zero)\"));\n }\n }\n else{\n // $mintime and $maxtime are not numeric\n array_push($action_res['errors'], array(\"id\" => 812,\n \"htmlcode\" => 422,\n \"message\" => \"'from' date and/or 'to' date should be numeric\"));\n }\n }\n else{\n // mintime and/or maxtime are/is not set in the request \n array_push($action_res['errors'], array(\"id\" => 813,\n \"htmlcode\" => 400,\n \"message\" => \"'mintime' and/or 'maxtime' are/is not set in the request\"));\n }\n\n return $action_res;\n}",
"public function testFraudCheckInvalidThreshold(): void\n {\n $response = $this->call(\n 'POST',\n 'api/fraudcheck',\n [\n \"threshold\" => \"invalid\",\n \"applications\" => [\n \"7a81b904f63762f00d53c4d79825420efd00f5f9, 2019-01-29T13:12:11, 100.00\"\n ]\n ]\n );\n\n $response->assertStatus(400);\n $this->assertEquals('\"threshold must exist and be numeric\"', $response->getContent());\n }",
"private function checkAnomaly()\n {\n $options = static::listTopics();\n $message = null;\n foreach ($options as $topic => $option){\n $payload = $this->getCacheMqtt($topic);\n if (!empty($payload) && $option['type'] === 'sensor' &&\n ((isset($option['condition']['min']) && $option['condition']['min'] > $payload) ||\n (isset($option['condition']['max']) && $option['condition']['max'] < $payload))\n ) {\n $message .= $option['message']($payload) . PHP_EOL;\n }\n }\n if($message !== null){\n $this->mailing($message, $options);\n }\n\n }",
"public function testAtmSimulatorForHundredAmt()\n {\n $amountRequested = 100;\n $numberOfNotes = 100;\n $simulator = new AtmSimulator();\n //test for requested amount 0\n $output = $simulator->atmSimulatorFn($amountRequested,$numberOfNotes);\n $message =\"Number of 20 notes given:5 available: 95<br/>\";\n $this->assertEqual($message,$output);\n\n }",
"public function testCheckDistanceBetweenMammasAndTei()\n {\n $mamasPizzaCoordinates = new Distance(41.082279, 23.543239);\n\n $distance = $mamasPizzaCoordinates->calculateDistanceInMeters(41.074879, 23.553681);\n $this->assertTrue($distance <= 1250);\n $this->assertTrue($distance >= 1190);\n\n }",
"public function test_alarm_is_set_to_false_with_no_min_and_max()\n {\n $this->model->min_threshold = NULL;\n $this->model->state = 75.0;\n\n $this->assertFalse($this->model->alarm());\n }",
"public function testInvalidFloorType()\n {\n $this->expectException(InvalidArgumentException::class);\n $robotTimeService = new RobotTime();\n\n $this->assertFalse($robotTimeService->getTimeRequireToCleanOneSqMeter('abc'));\n }",
"public function testGetTemperatureRequest()\n {\n $this->get('plant/1/temperature');\n $this->assertResponseStatus(200);\n }",
"private function checkUnitOutputWattage(int $wattage, int $warningWattage, int $maxWattage) :void\r\n {\r\n switch (true)\r\n {\r\n case $wattage < $warningWattage:\r\n echo \"{$wattage}W|'Watt'={$wattage};$warningWattage;$maxWattage;0;10000\";\r\n exit(self::STATE_OK);\r\n\r\n case $wattage < $maxWattage:\r\n echo \"{$wattage}W|'Watt'={$wattage};$warningWattage;$maxWattage;0;10000\";\r\n exit(self::STATE_WARNING);\r\n\r\n case $wattage >= $maxWattage:\r\n echo \"{$wattage}W|'Watt'={$wattage};$warningWattage;$maxWattage;0;10000\";\r\n exit(self::STATE_CRITICAL);\r\n\r\n default:\r\n echo \"0W|'Watt'={$wattage};$warningWattage;$maxWattage;0;10000\";\r\n exit(self::STATE_UNKNOWN);\r\n }\r\n }",
"function check_temp($temperature){\n\tif($temperature < 18 || $temperature > 27){\n\t\treturn '<td class =\"fail_color\">'.sprintf(\"%01.2f\",$temperature).'</td>';\n\t} else {\n\t\treturn '<td class =\"ok_color\">'.sprintf(\"%01.2f\",$temperature).'</td>';\n\t}\n }",
"public function testErrorMonthly()\n {\n InfluxDb::writePoints([new Point(\n 'errors',\n 0.64, \n [\n 'device' => 'abc0',\n 'type' => 2,\n 'display_type' => 'Generic Error'\n ], \n [\n 'power' => 20\n ],\n 1435255849\n )]);\n\n $response = $this->json('GET', '/api/error/monthly')\n ->assertStatus(200);\n\n $this->assertNotEmpty(array_get($response->json(), 'data', []));\n }",
"public function testAssertIntRangeVarInMinMaxRange(): void\n\t{\n\t\t// ensure main variable is an integer\n\t\t$this->expectException(\\InvalidArgumentException::class);\n\t\tValidator::assertIntRange(__FUNCTION__, 100, 300, 500);\n\t}",
"public function testCheckTime() {\n $f1 = array();\n $f2 = array();\n $f3 = array();\n $f4 = array();\n \n $f1['depart_time'] = \"8:00\";\n $f1['arrive_time'] = \"10:00\";\n \n $f2['depart_time'] = \"9:00\";\n $f2['arrive_time'] = \"11:00\";\n \n $f3['depart_time'] = \"10:29\";\n $f3['arrive_time'] = \"11:40\";\n \n $f4['depart_time'] = \"13:00\";\n $f4['arrive_time'] = \"15:00\";\n \n //Connection leaves after initial, and there is 30 mins in between\n $this->assertTrue($this->CI->flightModel->checkTime($f1, $f4)); \n //Connection leaves before initial arrives\n $this->assertFalse($this->CI->flightModel->checkTime($f1, $f2));\n //There is only 29 minutes between flights\n $this->assertFalse($this->CI->flightModel->checkTime($f1, $f3));\n //Initial flight departs after connection arrives\n $this->assertFalse($this->CI->flightModel->checkTime($f4, $f2));\n }",
"public function testAtmSimulatorForZeroAmt()\n {\n $amountRequested = 0;\n $numberOfNotes = 100;\n $simulator = new AtmSimulator();\n //test for requested amount 0\n $output = $simulator->atmSimulatorFn($amountRequested,$numberOfNotes);\n $message =\"Please enter an amount more than 0<br/>\";\n $this->assertEqual($message,$output);\n }",
"public function testGetTemperatureRequestWithValidPlant()\n {\n $this->get('plant/null/temperature');\n $this->assertResponseStatus(200);\n }",
"public function testGetAllDataByFormatM()\n {\n $this->user = $this->user->find($this->app_id);\n $api = new \\App\\Services\\Api('3RkTSJ', 'KjdTEANlw6YPxKIPORINgmMKzQBTJtDt', $this->user);\n if($api->authenticate()){\n $data = $api->getStationDataByFormat(\"m\", \"temperature\");\n $result = $data['data'][0];\n $this->assertEquals($result->temperature, 27.21625);\n $this->assertEquals($result->date, \"04-22\");\n }\n }",
"public function checkTowerUnits()\n {\n $response = array();\n $managerial_units = $this->input->post('managerial_units');\n if (!empty($managerial_units)) {\n if ($this->form_validation->run('tower_units') !== FALSE) {\n $response['status'] = 'success';\n }\n else\n {\n $response['status'] = 'danger';\n $response['message'] = validation_errors();\n }\n }\n else // in case of there is no managerial units in tower\n {\n $response['status'] = 'success';\n }\n \n echo json_encode($response);\n }",
"function check_unit($data = array()){\n $unit_import = isset($data['usp_unit_import'])? intval($data['usp_unit_import']) : 0;\n $unit = isset($data['usp_unit'])? intval($data['usp_unit']) : 0;\n $specifi = isset($data['usp_specifi'])? intval($data['usp_specifi']) : 1;\n \n if($unit > 0 && $unit_import == 0) return 0;\n if($unit == 0) return 0;\n if($unit_import == 0 && $unit == 0) return 0;\n if($unit_import == 0) return 0;\n if($unit_import == $unit && $specifi > 1) return 0;\n \n return 1;\n}",
"public function testInferringSystemHeight_200cm_2m_0cm() {\n SetupTestData::resetCampaign('UTC00');\n\n $cid = SetupTestData::$cids['UTC00'];\n $campaign = $this->modelCampaign->get($cid, MYSQL_ASSOC);\n SetupTestData::addCampaignField('UTC00', Model_CampaignField::FIELD_TYPE_HEIGHT_CENTIMETERS, 'height_centimeters');\n\n $pid = SetupTestData::$pids['C00-P01'];\n SingletonRegistry::getModelPartnerField()->deleteForPartner($pid);\n SingletonRegistry::getModelPartnerField()->insert(array('partner_id' => $pid, 'name' => 'height_meters', 'value' => '[:height_meters:]'));\n SingletonRegistry::getModelPartnerField()->insert(array('partner_id' => $pid, 'name' => 'height_centimeters', 'value' => '[:height_centimeters:]'));\n \n\n SetupTestData::setCampaignDelivery('UTC00', array('C00-P01'));\n\n try {\n $engine = $this->newEngineSubmission(array('email' => 'loiphamle@gmail.com', 'height_centimeters' => '200'), \n $this->cbGatherData, Engine::ACTION_SENT_VALS);\n $engine->processIncomingFormSubmission($campaign);\n } catch (ERedirectException $e) {\n $deliveryValues = array(\n \"height_meters\" => \"2\",\n \"height_centimeters\" => \"\"\n );\n $this->assertEqual($this->gathered[0], $deliveryValues);\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check that htaccess file is properly created (thumb > granted). | public function testHtaccessCreationGranted(): void
{
$domain = 'whatever.io';
$this->assertFalse(CacheManager::isCacheValid('nope', $domain, CacheManager::TYPE_THUMB));
$this->assertFileEquals(__DIR__ . '/../resources/htaccess_granted', self::$cache . '/thumb/.htaccess');
} | [
"public function testHtaccessInvalidCreationGranted(): void\n {\n $domain = 'whatever.io';\n ConfigManager::addFile(__DIR__ . '/../resources/settings-apache-ko.json');\n $this->assertFalse(CacheManager::isCacheValid('nope', $domain, CacheManager::TYPE_THUMB));\n $this->assertFileEquals(__DIR__ . '/../resources/htaccess_granted', self::$cache . '/thumb/.htaccess');\n }",
"function htaccess_write_check() {\r\n\t\tif (!is_writable(get_home_path() . '.htaccess')) {\r\n\t\t\tif (current_user_can('manage_options')) {\r\n\t\t\t\tadd_action('admin_notices', array(&$this, 'htaccess_writable_error'));\r\n\t\t\t}\r\n\t\t};\r\n\t}",
"public static function check_htaccess() {\n\t\tif ( \\wfUtils::isNginx() ) {\n\t\t\treturn array( 'nginx' => 1 );\n\t\t}\n\t\t$file = \\wfCache::getHtaccessPath();\n\t\tif ( ! $file ) {\n\t\t\treturn array( 'err' => 'We could not find your .htaccess file to modify it.' );\n\t\t}\n\t\t$fh = fopen( $file, 'r+' );\n\t\tif ( ! $fh ) {\n\t\t\t$err = error_get_last();\n\t\t\treturn array( 'err' => 'We found your .htaccess file but could not open it for writing: ' . $err['message'] );\n\t\t}\n\t\treturn array( 'ok' => 1 );\n\t}",
"function ya_htaccess_writable() {\n\tif (!is_writable(get_home_path() . '.htaccess')) {\n\t\tif (current_user_can('administrator')) {\n\t\t\tadd_action('admin_notices', create_function('', \"echo '<div class=\\\"error\\\"><p>\" . sprintf(__('Please make sure your <a href=\"%s\">.htaccess</a> file is writable ', 'yatheme'), admin_url('options-permalink.php')) . \"</p></div>';\"));\n\t\t}\n\t}\n}",
"function htaccess( $_, $assoc ) {\n\n\t\t//Check Network\n\t\t$network = Core::is_multisite();\n\n\t\t//Check Custom directory\n\t\t$dirs = array();\n\t\tforeach ( array( 'wp_content', 'plugins', 'uploads', 'themes' ) as $dir ) {\n\t\t\tif ( isset( $assoc[ $dir ] ) ) {\n\t\t\t\t$dirs[ $dir ] = $assoc[ $dir ];\n\t\t\t}\n\t\t}\n\n\t\t//Create file\n\t\tPermalink::create_permalink_file( $network['network'], $network['subdomain'], $dirs );\n\n\t\t//Success\n\t\tCLI::success( CLI::_e( 'package', 'created_file', array( \"[file]\" => $network['mod_rewrite_file'] ) ) );\n\t}",
"function htaccess($_, $assoc)\n {\n //Check Network\n $network = Core::is_multisite();\n\n //Check Custom directory\n $dirs = array();\n foreach (array('wp_content', 'plugins', 'uploads', 'themes') as $dir) {\n if (isset($assoc[$dir])) {\n $dirs[$dir] = $assoc[$dir];\n }\n }\n\n //Create file\n Permalink::create_permalink_file($network['network'], $network['subdomain'], $dirs);\n\n //Success\n \\WP_CLI_Helper::success(Package::_e('package', 'created_file', array(\"[file]\" => $network['mod_rewrite_file'])));\n }",
"function test_secured($path)\n {\n // Returns 2 if 'path' is .htaccess protected, but the .htaccess file was not generated by htpasstool\n $secured = 0;\n if (file_exists(\"$path/\" . HTACCESS) && is_file(\"$path/\" . HTACCESS))\n {\n // we deliberately don't check for the presence of a HTPASSWD file here!\n $htaccess = @file_get_contents(\"$path/\" . HTACCESS);\n if (preg_match(\"/^ *require valid-user/m\",$htaccess)) $secured = 1; # This check is fairly basic...\n # we did not make this htaccess file!\n if (!preg_match(\"/^# htpasstool v\\d.\\d protected/\",$htaccess)) $secured = 2;\n }\n return $secured;\n }",
"static function htaccess_works() {\n $success_url = url::file(\"var/security_test/success\");\n\n @mkdir(VARPATH . \"security_test\");\n try {\n if ($fp = @fopen(VARPATH . \"security_test/.htaccess\", \"w+\")) {\n fwrite($fp, \"Options +FollowSymLinks\\n\");\n fwrite($fp, \"RewriteEngine On\\n\");\n fwrite($fp, \"RewriteRule verify $success_url [L]\\n\");\n fclose($fp);\n }\n\n if ($fp = @fopen(VARPATH . \"security_test/success\", \"w+\")) {\n fwrite($fp, \"success\");\n fclose($fp);\n }\n\n // Proxy our authorization headers so that if the entire Gallery is covered by Basic Auth\n // this callback will still work.\n $headers = array();\n if (function_exists(\"apache_request_headers\")) {\n $arh = apache_request_headers();\n if (!empty($arh[\"Authorization\"])) {\n $headers[\"Authorization\"] = $arh[\"Authorization\"];\n }\n }\n list ($status, $headers, $body) =\n remote::do_request(url::abs_file(\"var/security_test/verify\"), \"GET\", $headers);\n $works = ($status == \"HTTP/1.1 200 OK\") && ($body == \"success\");\n } catch (Exception $e) {\n @dir::unlink(VARPATH . \"security_test\");\n throw $e;\n }\n @dir::unlink(VARPATH . \"security_test\");\n\n return $works;\n }",
"private function createHtaccessFiles()\n {\n $dir = $this->getGalleryDir();\n $this->fileHandler->createFileProtection($dir, Image::OBJECT_TYPE);\n }",
"public function htaccess_notice() {\n\t\t$value = $this->get_setting( 'enable_basic_authentication', 'no' );\n\t\t$htaccess_file = $this->base_path . '.htaccess';\n\n\t\tif ( 'yes' === $value && ! file_exists( $htaccess_file ) ) {\n\t\t\t?>\n\t\t\t<div class=\"error\">\n\t\t\t\t<p>\n\t\t\t\t\t<?php _e( \"Warning: .htaccess doesn't exist. Your SatisPress packages are public.\", 'satispress' ); ?>\n\t\t\t\t</p>\n\t\t\t</div>\n\t\t\t<?php\n\t\t}\n\t}",
"private function createHtaccess():void\n {\n //Add apache security configurations.\n $fp = fopen($this->projectDir.'/.htaccess', 'a+');\n if ($fp) {\n fwrite($fp, $this->htaccessConfig());\n }\n fclose($fp);\n }",
"public function make_htaccess ($full_path) //$full_path = full path to cache directory with trailing slash\n\t{\n\t\tif ($full_path == SQLITE_DIR && $this->get_permissions(SQLITE_DIR) == '0777') return;\n\n\t\tif (defined('USE_HTACCESS') && USE_HTACCESS == FALSE) return;\n\t\n\t\tif (!file_exists($full_path . \".htaccess\") && is_writable($full_path))\n\t\t{\n\t\t\t$h = fopen ($full_path . \".htaccess\", 'wb');\n\t\t\t$text = \"# Prevent access from outside web root\n\torder deny, allow\n\tdeny from all\";\n\t\t\tfwrite($h, $text);\n\t\t\tfclose ($h);\n\t\t}\n\n\t}",
"function cyz_create_htaccess(){\n // Get htaccess dynamic content\n $htaccess_content = cyz_get_htaccess_content();\n\n /** Directory where apache htaccess resides */\n $apache_dir = '/';\n\n /** Directory where apache htaccess Filename */\n $apache_filename = '.htaccess';\n\n /** File Operator Object */\n $file_worker = new cyz_file_op();\n\n /** Check write permission */\n $is_dir_writeable = $file_worker->writeable($apache_dir);\n\n /** Check if directory is writeable */\n if(!$is_dir_writeable['status']) return [\n 'status' => false,\n 'description' => 'Application directory not writable.'\n ];\n \n /** Create new/update htaccess file */\n $htaccess_updated = $file_worker->update_file(\n $apache_dir.$apache_filename,\n $htaccess_content\n );\n\n /** Htaccess file has been updated */\n if($htaccess_updated['status']) return [\n 'status' => true,\n 'description' => ''\n ];\n\n /** Error updating Htaccess file */\n else return [\n 'status' => false,\n 'description' => 'Please delete old .htaccess file.'\n ];\n}",
"private static function publicHtaccess()\n\t{\n\t\t$file = self::$public_path . '/.htaccess';\n\n\t\tif (file_exists($file)) {\n\t\t\t$content = file_get_contents($file);\n\n\t\t\t$regex = '/<IfModule mod_negotiation\\.c>(.|\\n)*?<\\/IfModule>/';\n\t\t\t$content = preg_replace($regex, '', $content);\n\n\t\t\tfile_put_contents($file, $content);\n\t\t\tchmod($file, 0644);\n\t\t}\n\t}",
"public function createHtaccessFile()\r\n\t{\r\n\r\n\t\t// Determine the URL for the rewrite.\r\n\t\t$urlManager=Yii::app()->getUrlManager();\r\n\t\tif($urlManager->getUrlFormat()===CUrlManager::PATH_FORMAT)\r\n\t\t{\r\n\t\t\t$targetUrl='';\r\n\r\n\t\t\t// Append the script name if necessary.\r\n\t\t\tif($urlManager->showScriptName===true)\r\n\t\t\t\t$targetUrl.='index.php/';\r\n\r\n\t\t\t$targetUrl.='image/default/create?id=$2&version=$1';\r\n\t\t}\r\n\t\telse\r\n\t\t\t$targetUrl='index.php?r=image/default/create&id=$2&version=$1';\r\n\r\n\t\t// Read the template file.\r\n\t\tif(($htaccess=file_get_contents(dirname(__FILE__).'/../files/htaccess'))===false)\r\n\t\t\tthrow new CException(Img::t('error','Failed to create the access file! Template could not be read.'));\r\n\r\n\t\t// Replace the placeholders in the template file.\r\n\t\t$htaccess=strtr($htaccess,array(\r\n\t\t\t'{baseUrl}'=>Yii::app()->getRequest()->getBaseUrl().'/',\r\n\t\t\t'{sourceUrl}'=>'^versions/([^/]+)/[^\\-\\d]*\\-?(\\d+)\\.(gif|jpg|png)$',\r\n\t\t\t'{targetUrl}'=>$targetUrl,\r\n\t\t));\r\n\r\n\t\t// Create the .htaccess file.\r\n\t\tif((file_put_contents($this->_basePath.$this->_imagePath.$this->_module->accessFileName,$htaccess))===false)\r\n\t\t\tthrow new CException(Img::t('error','Failed to create the access file! File could not be created.'));\r\n\t}",
"public function testHtaccessInvalidCreationDenied(): void\n {\n $domain = 'whatever.io';\n ConfigManager::addFile(__DIR__ . '/../resources/settings-apache-ko.json');\n $this->assertFalse(CacheManager::isCacheValid('nope', $domain, CacheManager::TYPE_FINDER));\n $this->assertFileEquals(__DIR__ . '/../resources/htaccess_denied', self::$cache . '/finder/.htaccess');\n }",
"function update_htaccess(): void {\n $config = Config::current();\n\n if (file_exists(MAIN_DIR.DIR.\".htaccess\")) {\n $set = htaccess_conf();\n\n if ($set === false)\n alert(__(\"Failed to write file to disk.\"));\n }\n }",
"public function checkHtaccessFile() {\n\t\t\n\t\t$requiredVersion = ProcessWire::htaccessVersion;\n\t\t$htaccessFile = $this->wire('config')->paths->root . '.htaccess';\n\t\t\n\t\tif(is_readable($htaccessFile)) {\n\t\t\t$data = file_get_contents($htaccessFile);\n\t\t\tif(!preg_match('/@(?:htaccess|index)Version\\s+(\\d+)\\b/', $data, $matches) || ((int) $matches[1]) < $requiredVersion || $this->testAll) {\n\t\t\t\tif($this->showNotices) {\n\t\t\t\t\t$foundVersion = isset($matches[1]) ? (int) $matches[1] : '?';\n\t\t\t\t\t$warning = sprintf(\n\t\t\t\t\t\t$this->_('Please note that your root %s file is not up-to-date with this ProcessWire version, please update it when possible.'),\n\t\t\t\t\t\t$this->location('.htaccess')\n\t\t\t\t\t);\n\t\t\t\t\t$details = $this->small(\n\t\t\t\t\t\t$this->versionsLabel($requiredVersion, $foundVersion) . ' ' . \n\t\t\t\t\t\t$this->_('To suppress this warning, replace or add the following in the top of your existing .htaccess file:') . \n\t\t\t\t\t\t$this->code(\"# @htaccessVersion $requiredVersion\")\n\t\t\t\t\t);\n\t\t\t\t\t$this->warning(\"$warning$details\", Notice::log | Notice::allowMarkup);\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t}\n\t\t} else {\n\t\t\t// if .htaccess not present then this is likely an IIS or other not-offically supported server software\n\t\t\t// if($this->showNotices) $this->warning($this->fileNotFoundLabel($htaccessFile));\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\treturn true;\n\t}",
"function do_htaccess()\n\t{\n\t\t//-----------------------------------------\n\t\t// INIT\n\t\t//-----------------------------------------\n\n\t\t$name = '.htaccess';\n\t\t$msg = array();\n\t\t$dirs = array( ROOT_PATH . 'cache',\n\t\t\t\t\t ROOT_PATH . 'skin_acp',\n\t\t\t\t\t ROOT_PATH . 'style_avatars',\n\t\t\t\t\t ROOT_PATH . 'style_emoticons',\n\t\t\t\t\t ROOT_PATH . 'style_images',\n\t\t\t\t\t ROOT_PATH . 'style_captcha',\n\t\t\t\t\t ROOT_PATH . 'uploads' );\n\n\t\t$towrite = <<<EOF\n#<ipb-protection>\n<Files ~ \"^.*\\.(php|cgi|pl|php3|php4|php5|php6|phtml|shtml)\">\n Order allow,deny\n Deny from all\n</Files>\n#</ipb-protection>\nEOF;\n\n\t\t//-----------------------------------------\n\t\t// Do it!\n\t\t//-----------------------------------------\n\n\t\tforeach( $dirs as $directory )\n\t\t{\n\t\t\tif ( $FH = @fopen( $directory . '/'. $name, 'w' ) )\n\t\t\t{\n\t\t\t\tfwrite( $FH, $towrite );\n\t\t\t\tfclose( $FH );\n\n\t\t\t\t$msg[] = \"Запись «.htaccess» в директорию $directory...\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$msg[] = \"Невозможно произвести запись в $directory...\";\n\t\t\t}\n\t\t}\n\n\t\t//-----------------------------------------\n\t\t// Done...\n\t\t//-----------------------------------------\n\n\t\t$this->ipsclass->main_msg = implode( \"<br />\", $msg );\n\t\t$this->security_overview();\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Checks to see if the specified module is a flexible field | public static function isFlexible($module_key){
$module_key = self::sanitizeModuleKey($module_key);
$type = self::$modules[$module_key]['field_type'];
return $type === 'flexField' || $type === 'block';
} | [
"function FLO_has_flexible_content_field( $flex_field = '' ) {\n global $post;\n\n if ( class_exists( 'acf' ) && is_string( $flex_field ) ) :\n $group = get_field_object( $flex_field );\n\n if ( $group && $group['type'] == 'flexible_content' && count( $group['value'] ) > 0 ) :\n return true;\n endif; // End if $group\n\n endif; // End ACF class check\n\n return false;\n}",
"public function hasFieldInfo($field_name);",
"public function isFlexibleFieldsRegister()\n {\n return $this->name === static::REGISTER;\n }",
"function is_field_type($name)\n {\n }",
"public function hasField();",
"private function is_extended_field( $p_field_name ) {\n\t\tswitch( $p_field_name ) {\n\t\t\tcase 'description':\n\t\t\tcase 'steps_to_reproduce':\n\t\t\tcase 'additional_information':\n\t\t\t\treturn true;\n\t\t\tdefault:\n\t\t\t\treturn false;\n\t\t}\n\t}",
"abstract public function isFieldValid(Field $field);",
"function acf_is_field( $field = \\false, $id = '' ) {\n}",
"public function isFlexForm(): bool\n {\n return $this->field->getForm() instanceof Flex;\n }",
"protected function isField($field)\n {\n return $field instanceof Field;\n }",
"function is_field_type( $name ) {\n\t\t\treturn isset( $this->types[ $name ] );\n\t\t}",
"protected function fieldInModule($module, $field) {\r\n\t\tif (key_exists($field, $this->config[$module]['fields']))\r\n\t\t\treturn true;\r\n\t\t//return false;\r\n\t\tthrow new Exception('Nonexistent field in filter, select or update clause', ord('F'));\r\n\t}",
"public function has_fields() {\n\t\treturn ( wponion_is_array( $this->fields ) && ! empty( $this->fields ) );\n\t}",
"function acf_is_field_type($name = '')\n{\n}",
"public function hasField($name);",
"public function isField(string $field_name): bool\n {\n return isset($this->Fields[$field_name]) && is_object($this->Fields[$field_name]);\n }",
"function acf_get_valid_field( $field = \\false ) {\n}",
"function _mymodule_er_field_validate($element, &$form_state, $form) {\n\n if ($element['#entity_type'] == 'node' && $element['#bundle'] == 'toolkit' && $element['#field_name'] == 'field_modules') {\n $valid = TRUE;\n $invalid_modules = [];\n\n // Is the Modules form field populated on the Toolkit edit form?\n if (isset($form_state['values']['field_modules']) && !empty($form_state['values']['field_modules'])) {\n\n // What modules are already included in this Toolkit?\n try {\n $node_wrapper = entity_metadata_wrapper('node', $element['#entity']);\n $toolkit_modules = $node_wrapper->field_modules->value();\n }\n catch (EntityMetadataWrapperException $e) {\n watchdog(__FUNCTION__, 'Node wrapper error: %t', array('%t' => $e->getMessage()));\n }\n\n $toolkit_target_ids = [];\n foreach ($toolkit_modules as $module) {\n $toolkit_target_ids[$module->nid] = $module->title;\n }\n\n // What modules are currently populated in the Toolkit edit form?\n foreach ($form_state['values']['field_modules']['und'] as $form_module_key => $form_module) {\n if (($form_module_key === 0) || ($form_module_key != 'add_more')) {\n $target_id_raw = $form_module['target_id'];\n\n // We only want the target_id number, not other strings.\n $target_id = preg_replace('/[^0-9]/', '', $target_id_raw);\n\n // Is this module new to this toolkit?\n if (!array_key_exists($target_id, $toolkit_target_ids)) {\n\n // Is the new module already in use with other toolkits?\n if (mymodule_module_in_use($target_id)) {\n $valid = FALSE;\n $invalid_modules[$target_id] = $target_id_raw;\n }\n }\n }\n }\n }\n // Set the error on the form element.\n if (!$valid) {\n $display_modules = '';\n foreach ($invalid_modules as $module_key => $module_value) {\n $display_modules .= $module_value . ' ';\n }\n form_error($form[$element['#field_name']], t('Selected modules are already in use on another Toolkit: %display_modules', array('%display_modules' => $display_modules)));\n }\n }\n}",
"function _fieldframe_installed()\n\t{\n\t global $DB;\n\n\t $db_fieldframe = $DB->query(\"SHOW TABLES LIKE 'exp_ff_fieldtypes'\");\n\t\treturn ($db_fieldframe->num_rows == 1);\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get creation date of last loaded data. \param string $type Name of the cache to use \param string $key Key associated to the data \return int Unix timestamp | public function getCreationTime(string $type, string $key)
{
return filemtime($this->getFullPath($type, $key));
} | [
"public function getDateHits($date, $type) {\n if ($cache = $this->cacheManager->getCache($this->getSuffix($date, $type))) {\n return $cache;\n }\n }",
"public function getStoreTime($key)\n {\n if ($this->doHas($key) == true) {\n return filemtime($this->getCacheFileName($key));\n }\n \n return 0;\n }",
"function getLastCacheEntryByType($guid, $type) {\n if ($guid != '' && $type != '') {\n $condition = $this->databaseGetSQLCondition(\n array('entry_cache_guid' => $guid, 'entry_cache_type' => $type)\n );\n $sql = \"SELECT MAX(entry_cache_to)\n FROM %s\n WHERE $condition\n \";\n $params = array($this->tableStatisticEntriesCache);\n if ($res = $this->databaseQueryFmt($sql, $params)) {\n return $res->fetchField();\n }\n }\n return FALSE;\n }",
"function getCacheStart()\n {\n if (isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) && !$this->isPost()) {\n return strtotime(current($array = explode(';', \n $_SERVER['HTTP_IF_MODIFIED_SINCE'])));\n }\n return time();\n }",
"public function get_date() {\n\t\treturn filemtime(sprintf('%s/fields.json', $this->path));\n\t}",
"function getCacheTime() {\n\t\t// Since it's not really cached, we'll consider it to have been cached just now.\n\t\treturn time();\n\t}",
"public function getCacheTime();",
"public function getTimestamp($key) {\n\t\treturn \\filemtime($this->_getPath($key));\n\t}",
"public function getCache($type) {\n $data = NULL;\n $cid = $type;\n\n // Get the cached data.\n if ($cached = $this->cache->get($cid)) {\n return $cached->data;\n }\n\n $this\n ->setType($type)\n ->setFormat('xml')\n ->setMethod('get');\n\n $data = $this->execute();\n\n $this->setCache($cid, $data);\n\n return $data;\n }",
"public function get_timestamp($key) {}",
"public function getTimestamp($key) {\n\t\treturn \\filemtime ( $this->_getPath ( $key ) );\n\t}",
"function last_modified()\r\n\t{\r\n\t\t$file = $this->get_cache_file_name();\r\n\t\tif (file_exists($file))\r\n\t\t\treturn filemtime($file);\r\n\t\telse\r\n\t\t\treturn time();\r\n\t}",
"public function getCacheType()\n {\n return $this->type;\n }",
"public function getCacheLifeTime();",
"public function getDataFileCreationDate() {\n $this->dataLoaded();\n return $this->data->getCreationDate();\n }",
"public function getTimestamp(int $timestampType = FilesystemItemInterface::TIMESTAMP_MODIFICATION): int;",
"public function getDataCreationTimestamp() {\n if (!$this->dataIsLoaded) {\n $this->__loadTreeFromFile();\n }\n return $this->tree['$']['Utc'];\n }",
"public function getCachingTime();",
"public function getTimestamp(string $key): int;"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The boundary in the conversation where the annotation ends, inclusive. Generated from protobuf field .google.cloud.contactcenterinsights.v1.AnnotationBoundary annotation_end_boundary = 5; | public function getAnnotationEndBoundary()
{
return $this->annotation_end_boundary;
} | [
"public function setAnnotationEndBoundary($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Cloud\\ContactCenterInsights\\V1\\AnnotationBoundary::class);\n $this->annotation_end_boundary = $var;\n\n return $this;\n }",
"public function setEndBoundary($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Cloud\\ContactCenterInsights\\V1\\AnnotationBoundary::class);\n $this->end_boundary = $var;\n\n return $this;\n }",
"function getBoundaryEnd($boundary) {\n return '--'.$boundary.'--'.$this->ln;\n }",
"function EndBoundary($boundary) {\n return $this->LE . '--' . $boundary . '--' . $this->LE;\n }",
"public function getEndBoundary() {\r\n\t\trequire_once('Appointment.class.php');\r\n\t\t$ap = new Appointment();\r\n\t\t$lst = $ap->getList('', $this->db->formatQuery('WHERE t.party = %i AND t.region = %i', $this->party, $this->region), 'ORDER BY t.time_end DESC', 'LIMIT 1');\r\n\t\treturn count($lst)? reset(explode(' ', reset($lst)->time_end)): null;\r\n\t}",
"public function getAnnotationStartBoundary()\n {\n return $this->annotation_start_boundary;\n }",
"private function EndBoundary($boundary) {\n\t return $this->LE . '--' . $boundary . '--' . $this->LE;\n\t}",
"protected function endBoundary($boundary)\n {\n return $this->LE . '--' . $boundary . '--' . $this->LE;\n }",
"public function getEnd(): BoundaryAbstract\n {\n return $this->end;\n }",
"public function getBoundary()\n {\n return $this->boundary;\n }",
"public function boundary()\n {\n return $this->boundary;\n }",
"public function getBoundary()\n {\n return $this->_boundary;\n }",
"public function isEndIncluded(): bool\n {\n return ']' === $this->boundaryType[1];\n }",
"public function getBoundary () {\n\t\tif (is_null($this->boundary)) {\n\t\t\t$this->boundary = new MimeMailBoundary();\n\t\t}\n\t\treturn $this->boundary;\n\t}",
"public function boundary() {\n if ($this->isEmpty()) return new LineString();\n\n if ($this->geos()) {\n return $this->geos()->boundary();\n }\n\n $components_boundaries = array();\n foreach ($this->components as $component) {\n $components_boundaries[] = $component->boundary();\n }\n return geoPHP::geometryReduce($components_boundaries);\n }",
"public function getRangeEnd()\n {\n return $this->range_end;\n }",
"public function getBoundary(): string\n\t{\n\t\treturn $this->boundary;\n\t}",
"public function getEndInteraction()\n {\n return $this->readOneof(4);\n }",
"public function getBoundary()\n {\n return $this->_boundary;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This method returns a selectorbox with months. | function getMonthSelectorBox() {
list($firstYear, $lastYear) = $this->getFirstAndLastYearOfStatistics();
$optionMonth = array();
$optionMonth[] = '<option value="">[ Select Month ]</option>';
if($firstYear != 0 AND $lastYear != 0) {
$optionMonth[] = '<option value="ALL">ALL</option>';
for($a = 1; $a <= 12; $a++) {
$optionMonth[] = '<option value="'.$a.'">'.$a.'</option>';
}
}
$selectorMonth = '<select name="feuserls_monthselection">'.implode('',$optionMonth).'</select>';
return $selectorMonth;
} | [
"public function get_month_choices() {}",
"public function selectMonth()\n\t{\n\t\t$options = array();\n\t\t$options[] = JHtml::_('select.option', 0, '--');\n\n\t\tfor ($i = 1; $i <= 12; $i++)\n\t\t{\n\t\t\t$m = sprintf('%02u', $i);\n\t\t\t$options[] = JHtml::_('select.option', $m, $m);\n\t\t}\n\n\t\treturn JHtml::_('select.genericlist', $options, 'EWAY_CARDEXPIRYMONTH', 'class=\"input-small\"', 'value', 'text', '', 'EWAY_CARDEXPIRYMONTH');\n\t}",
"public function selectMonth()\n {\n $html = \"<select id='month' onchange='\".$this->getGetJsClause2( 'this.value', 0 ).\"'>\";\n for ($i=1;$i<13;$i++){\n $html .= \"<option name='{$i}' value='{$i}'\";\n if ($this->month==$i) $html.=\" selected \";\n $html .= \">\".$this->months[$i].\"</option>\";\n }\n $html .= \"</select>\";\n return $html;\n }",
"function selectMonth($name, $selected = null, $options = [], $format = '%B')\n{\n $months = [];\n foreach (range(1, 12) as $month) {\n $months[$month] = strftime($format, mktime(0, 0, 0, $month, 1));\n }\n return $this->select($name, $months, $selected, $options);\n}",
"function getMonths() {\n $thisMonths = '';\n for($i = 1; $i <= 12; $i++) {\n $monthName = getMonthName($i, \"F\");\n $thisMonths = $thisMonths. \"<option value='$i'>$monthName</option>\";\n }\n return $thisMonths;\n }",
"public function getMonths();",
"function getAllMonths($selected = '') {\r\n $options = '';\r\n for ($i = 1; $i <= 12; $i++) {\r\n $value = ($i < 01) ? '0' . $i : $i;\r\n $selectedOpt = ($value == $selected) ? 'selected' : '';\r\n $options .= '<option value=\"' . $value . '\" ' . $selectedOpt . ' >' . date(\"F\", mktime(0, 0, 0, $i + 1, 0, 0)) . '</option>';\r\n }\r\n return $options;\r\n}",
"public function getCcMonths()\n {\n $months = $this->getData('cc_months');\n \n if (is_null($months))\n {\n \t$months = array();\n \t$monthList = $this->_getConfig()->getMonths();\n \t\n \t$months[0] = $this->__('Month');\n \t\tfor ($nCount = 1; $nCount <= sizeof($monthList); $nCount++)\n {\n \t$value = $nCount;\n \tif($value < 10)\n \t{\n \t\t$value = '0'.$value;\n \t}\n \t$months[$value] = $monthList[$nCount];\n }\n \t\n $this->setData('cc_months', $months);\n }\n \n return $months;\n }",
"function monthsList()\r\n {\r\n $condition = ' and Day(AddDate) = Day(CURDATE())-1\r\n and Month(AddDate) = Month(CURDATE())\r\n and Year(AddDate) = Year(CURDATE()) ';\r\n return $this->clientsList($condition);\r\n }",
"public function get_by_months();",
"function getMonth($selMonth=\"\"){\n\t\t$strMonths = \"\";\n\t\t$strMonths = \"<option value=''>00</option>\";\n\t\tfor($ind=1;$ind<=12;$ind++){\n\t\t\tif($ind == $selMonth)\n\t\t\t\t$strSel = \"selected\";\n\t\t\telse\n\t\t\t\t$strSel = \"\";\n\t\t\t\t\n\t\t\t$strMonths.=\"<option value=\".$ind.\" $strSel>\".(strlen($ind)==1?\"0\".$ind:$ind).\"</option>\";\n\t\t}\n\t\t\n\t\treturn $strMonths;\n\t}",
"public static function expiryMonths(){\n\t\t\t$months = array_combine(range(1,12),range(1,12));\n\t\t\treturn (array('' => 'Month') + $months);\n\t\t}",
"private function displayMonthDropDown() {\n $startMth = 1;\n $endMth = 12;\n echo '<select name=\"expMonth\" style=\"border-color:#FDEEF4\">';\n for ($startMth; $startMth <= $endMth; $startMth++) {\n if ($startMth == 1)\n echo '<option value=\"'.$startMth.'\" selected=\"selected\">'.$startMth.'</option>';\n else \n echo '<option value=\"'.$startMth.'\">'.$startMth.'</option>';\n }\n echo '</select>';\n }",
"function select_month_tag($name, $value = null, $options = array(), $html_options = array())\n{\n if ($value === null)\n {\n $value = date('n');\n }\n\n $options = _parse_attributes($options);\n\n $select_options = array();\n _convert_include_custom_for_select($options, $select_options);\n\n if (_get_option($options, 'use_month_numbers'))\n {\n for ($k = 1; $k < 13; $k++) \n {\n $select_options[$k] = str_pad($k, 2, '0', STR_PAD_LEFT);\n }\n }\n else\n {\n $culture = _get_option($options, 'culture', sfContext::getInstance()->getUser()->getCulture());\n $I18n_arr = _get_I18n_date_locales($culture);\n\n if (_get_option($options, 'use_short_month'))\n {\n $month_names = $I18n_arr['dateFormatInfo']->getAbbreviatedMonthNames();\n }\n else\n {\n $month_names = $I18n_arr['dateFormatInfo']->getMonthNames();\n }\n\n $add_month_numbers = _get_option($options, 'add_month_numbers');\n foreach ($month_names as $k => $v) \n {\n $select_options[$k + 1] = $add_month_numbers ? ($k + 1).' - '.$v : $v;\n }\n }\n\n return select_tag($name, options_for_select($select_options, $value), $html_options);\n}",
"function getMonthsDropDown($selMon=\"\"){\n\t\t\n\t\t$monthNum = ($selMon!=\"\")?$selMon:date(\"m\");\n\t\t\n\t\t$montharray = array (\n\n '01' => 'January',\n\n '02' => 'February',\n\n '03' => 'March',\n\n '04' => 'April',\n\n '05' => 'May',\n\n '06' => 'June',\n\n '07' => 'July',\n\n '08' => 'August',\n\n '09' => 'September',\n\n '10' => 'October',\n\n '11' => 'November',\n\n '12' => 'December' );\n\n\t\n\t$data = \"\";\n\tforeach($montharray as $key => $val){\n\n\t\t$data .= \"<option value=\".$key.\" \".chk_or_sel($key,$monthNum,'selected').\">\".$val.\"</option>\";\n\n\t}\n\treturn $data;\n\t}",
"private function getMonthChoices()\n {\n $monthChoices = array();\n\n foreach (range(1, 12) as $month) {\n $monthChoices[$month] = str_pad($month, 2, 0, STR_PAD_LEFT);\n }\n\n return $monthChoices;\n }",
"function &_getMonths()\n {\n for ( $x = 1; $x < 13; $x++ )\n {\n $val[] = date( \"m\", mktime ( 0,0,0,$x,1,0 ) );\n $values[] = strftime ( \"%B\", mktime ( 0,0,0,$x,1,0 ) );\n }\n $return_array = array( $values, $val );\n return $return_array;\n }",
"public function getMonth()\n {\n return new Month($this);\n }",
"function wpop_months_options() {\n $options = array();\n for ( $i = 1; $i <= 12; $i++ ) {\n $options[$i] = strftime( '%B', mktime( 0, 0, 0, $i, 1, 1970 ) );\n }\n\n return $options;\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check whether an annotation exists | public function hasAnnotation($name, $key= null): bool {
$details= XPClass::detailsForField($this->_reflect->getDeclaringClass(), $this->_reflect->getName());
if ($key) {
$a= $details[DETAIL_ANNOTATIONS][$name] ?? null;
return is_array($a) && array_key_exists($key, $a);
} else {
return array_key_exists($name, $details[DETAIL_ANNOTATIONS] ?? []);
}
} | [
"public function hasAnnotation($annotation);",
"public function hasAnnotationElement(): bool;",
"public function hasAnnotation($annotationName);",
"public function hasAnnotations();",
"public function hasAnnotation() {\n\t\tif (func_num_args() == 0) {\n\t\t\treturn count($this->_annotations) > 0;\n\t\t}\n\n\t\t$args = func_get_args();\n\t\t$annos =& $this->_annotations;\n\t\twhile (count($args) > 0) {\n\t\t\t$anno = strtolower(array_shift($args));\n\t\t\tif (isset($annos[$anno])) {\n\t\t\t\t$annos =& $annos[$anno];\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}",
"public function isAnnotation();",
"public function has_annotation($obj, $annotation);",
"public function hasAnnotations() {\n $n= '$'.$this->_reflect->getName();\n if (\n !($details= XPClass::detailsForMethod($this->_details[0], $this->_details[1])) || \n !isset($details[DETAIL_TARGET_ANNO][$n])\n ) { // Unknown or unparseable\n return FALSE;\n }\n return $details ? !empty($details[DETAIL_TARGET_ANNO][$n]) : FALSE;\n }",
"public function hasAnnotation($key)\n {\n return array_key_exists($key, $this->getAnnotations());\n }",
"public function hasAnnotations() {\n $details= XPClass::detailsForMethod($this->_reflect->getDeclaringClass(), $this->_details[1]);\n return !empty($details[DETAIL_TARGET_ANNO]['$'.$this->_reflect->getName()] ?? []);\n }",
"public function hasAnnotations()\n {\n return !empty($this->annotations);\n }",
"protected function wantsSpecificAnnotation()\n {\n return ! is_null($this->annotationName);\n }",
"public function valid()\n {\n return isset($this->_annotations[$this->_position]);\n }",
"#[\\ReturnTypeWillChange]\n\tpublic function offsetExists($offset) {\n\t\treturn isset($this->_annotations[strtolower($offset)]);\n\t}",
"function annotationCheck (&$token, &$context_name) {\n \tif ('@' == $this->_prev_token && ($this->_isBase($context_name) || $token == 'interface')) {\n \t\t$this->_state = 'annotation';\n \t} elseif ($this->_state == 'annotation') {\n \t\t$context_name .= '/annotation';\n \t$this->_annotationNames[] = $token;\n \t$this->_state = null;\n } elseif (in_array($token, $this->_annotationNames) && $this->_language == $context_name) {\n // Detected use of annotation name we have already detected\n $context_name .= '/annotation';\n \t}\n\n }",
"public function hasAnnotate($controller)\n\t{\n\t\treturn array_key_exists($controller, $this->annotated_controllers);\n\t}",
"private function isAnnotation(string $line): bool\r\n {\r\n return (preg_match('/^\\h*(@|}\\)|\\+\\h*\")/', $line) === 1);\r\n }",
"public function hasMetadata();",
"public function hasAnnotation($annotationName) {\r\n\t\t$this->analyzeComment();\r\n\t\t\r\n\t\treturn $this->docComment->getAnnotationsCount($annotationName);\r\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
All the published pages for this site. | public function publishedPages()
{
return $this->pages(Page::STATE_PUBLISHED);
} | [
"private function getPages()\n\t{\n\t\tself::$pages = $this->getAllTree(array('id', 'url', 'path', 'publish'));\n\t}",
"public function get_all_pages() {\r\n\t\tMainWP_Child_Posts::get_instance()->get_all_pages();\r\n\t}",
"protected function getAllPages()\n\t{\n\t\tif ( $this->_pagesBySlug === null )\n\t\t{\n\t\t\t$this->_pagesBySlug = ContentPage::getDb()->cache(function(){\n\t\t\t\treturn ContentPage::find()\n\t\t\t\t\t->select(['id', 'slug', 'is_main', 'parent_id', 'type', 'content_template_id'])\n\t\t\t\t\t->asArray()\n\t\t\t\t\t->andWhere([\n\t\t\t\t\t\t'active'=>1,\n\t\t\t\t\t\t'type'=>[ContentPage::TYPE_TEXT, ContentPage::TYPE_INTERNAL_LINK],\n\t\t\t\t\t])\n\t\t\t\t\t->indexBy('slug')\n\t\t\t\t\t->all();\n\t\t\t}, ContentModule::CACHE_TIME, new TagDependency(['tags'=>ContentModule::CACHE_TAG]));\n\t\t}\n\n\t\treturn $this->_pagesBySlug;\n\t}",
"public function fetchPublishedPages()\n {\n $results = $this->fetchAllAsArray(\n array(\n 'where' => array(\n 'status = ? AND content_type = ?' => array(1, 2)\n ),\n 'order' => array (\n 'id DESC'\n ),\n 'paging' => $this->posts_per_page,\n 'page' => 1,\n 'eager' => array(\n 'comments' => array(\n 'eager' => array(\n 'commentinfo'\n )\n ),\n 'tags',\n 'postinfo',\n 'users',\n ),\n )\n );\n Foresmo::dateFilter($results);\n Foresmo::sanitize($results);\n return $results;\n }",
"public function has_published_pages()\n {\n }",
"function getPagesPublishedTo()\n {\n $pages = [];\n foreach($this['meta']['issue']['hotspots'] as $hotspot) {\n $pages[$hotspot['page']['slug']] = $hotspot['page'];\n }\n return $pages;\n }",
"public function has_published_pages() {}",
"public function getAllPages() {\r\n return array();\r\n }",
"public function getPages()\n {\n return $this->getProject()->getPages();\n }",
"public function getPages();",
"private function publishNewPages(){\n \n // Publish each one\n \n }",
"public function getAllPublished();",
"public function get_all()\n {\n $all = array();\n\n foreach (array(PUBLISHER_STATUS_OPEN, PUBLISHER_STATUS_DRAFT) as $status)\n {\n foreach(ee()->publisher_model->languages as $lang_id => $data)\n {\n $all[$status][$lang_id] = ee()->publisher_site_pages->get($lang_id, FALSE, $status, TRUE);\n }\n }\n\n return $all;\n }",
"public function getAllPages()\n {\n return Util::getPages(array('Key', 'Path'), array('Status' => 'active'), null, array('Key', 'Path'));\n }",
"public function pages(){\n return $this->html()->body()->pages();\n }",
"public function getAllPublished()\n {\n return $this->cache->rememberForever('articles.published', function () {\n return $this->repository->getAllPublished();\n });\n }",
"public function admin_allPages() {\n $this->layout = 'admin';\n $this->set('PAGE_TITLE', 'Admin: CMS Pages');\n /*$pages = $this->CmsPage->find('all', array('fields' => array('CmsPage.id', 'CmsPage.title', 'CmsPage.status', 'CmsPage.created'))); //pr($pages);die;\n $this->set('pages_data', $pages);*/\n \n $this->Paginator->settings = array('limit' => 10,'fields' => array('CmsPage.id', 'CmsPage.title', 'CmsPage.status', 'CmsPage.created'),'conditions' => array('CmsPage.language' => 'EN'));\n\t\t$pages = $this->Paginator->paginate('CmsPage');\n\t\t$this->set('pages_data', $pages);\n \n }",
"public function getAllPages(): array;",
"static function _getPages(){\n $last2days = date('Y-m-d H:i:s', strtotime('-2 days'));\n \n $pages = SPage::get([\n 'updated >= :updated',\n 'bind' => [\n 'updated' => $last2days\n ]\n ], true);\n \n if(!$pages)\n return false;\n \n return \\Formatter::formatMany('static-page', $pages, false, ['user']);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Public function testFakeFieldsInContentTypesDoesNotExist(). Verify if a wrong field is not currently associated in every node type, registered in the system. | public function testFakeFieldsInContentTypesDoesNotExist() {
$content_types = array_keys($this->contentTypes['test']);
foreach ($content_types as $type) {
$field = uniqid('field_', TRUE);
try {
$this->assertArrayNotHasKey(
$field,
$this->contentTypes['system'][$type]['fields'],
"Failed asserting that {$type}:{$field} field does not exist."
);
}
catch (Exception $e) {
$this->handleAssertException($e);
}
}
// Verify if all fields in content types passed the test.
$this->checkAllAssertionsPassedWholeTest();
} | [
"public function testFakeNodeTypeDoesNotExist() {\n $type = uniqid('type_', TRUE);\n $this->assertArrayNotHasKey(\n $type,\n $this->contentTypes['system'],\n \"Failed asserting that node type '{$type}' does not exist.\"\n );\n }",
"public function testFieldMissingType() {\n $this->expectException(PluginNotFoundException::class);\n $this->expectExceptionMessage(\"Unable to determine class for field type 'foo_field' found in the 'field.field.entity_test_mulrev.entity_test_mulrev.{$this->fieldName}' configuration\");\n $entity = EntityTestMulRev::create([\n 'name' => $this->randomString(),\n 'field_test_item' => $this->randomString(),\n $this->fieldName => $this->randomString(),\n ]);\n $entity->save();\n // Hack the field to use a non-existent field type.\n $this->config('field.field.entity_test_mulrev.entity_test_mulrev.' . $this->fieldName)->set('field_type', 'foo_field')->save();\n \\Drupal::service('entity_field.manager')->clearCachedFieldDefinitions();\n EntityTestMulRev::load($entity->id());\n }",
"public function testMigrateFieldIntoUnknownNodeType() {\n $this->sourceDatabase->delete('node_type')\n ->condition('type', 'test_planet')\n ->execute();\n // The field migrations use the migration plugin to ensure that the node\n // types exist, so this should produce no failures...\n $this->migrateFields();\n\n // ...and the field instances should not have been migrated.\n $this->assertNull(FieldConfig::load('node.test_planet.field_multivalue'));\n $this->assertNull(FieldConfig::load('node.test_planet.field_test_text_single_checkbox'));\n }",
"public function testContentFieldNotFound(){\n $this->dispatch('/contenttypefields/edit/id/9999999999999999999999/content-type/1');\n $this->assertRedirectTo('/contenttypes');\n }",
"public function testInvalidFields() {\n // Unknown plugin.\n $bundle = $this->bundles[0];\n try {\n Og::CreateField('undefined_field_name', 'node', $bundle);\n $this->fail('Undefined field name was attached');\n }\n catch (\\Exception $e) {\n }\n\n // Field that can be attached only to a certain entity type, being attached\n // to another one.\n try {\n Og::CreateField('entity_restricted', 'user', 'user');\n $this->fail('Field was attached to a prohibited entity type.');\n }\n catch (\\Exception $e) {\n }\n }",
"public function testAllFieldsLabelsInContentTypesAreNotInorrect() {\n $content_types = array_keys($this->contentTypes['test']);\n foreach ($content_types as $type) {\n $fields = array_keys($this->contentTypes['test'][$type]['fields']);\n foreach ($fields as $field) {\n $label = uniqid('label_', TRUE);\n try {\n $this->assertNotEquals(\n $label,\n $this->contentTypes['system'][$type]['fields'][$field]['label'],\n \"Failed asserting that {$type}:{$field} label value is not wrong.\"\n );\n }\n catch (Exception $e) {\n $this->handleAssertException($e);\n }\n }\n }\n // Verify if all field labels in content types passed the test.\n $this->checkAllAssertionsPassedWholeTest();\n }",
"public function testNonExistantFieldIsNeverRegistered()\n {\n $oTest = new _oxBase();\n $oTest->modifyCacheKey(\"nonExistantFieldTest\", true);\n $oTest->enableLazyLoading();\n $this->cleanTmpDir();\n $oTest->init('oxarticles');\n //trying to access the field\n $sTestValue = $oTest->oxarticles__oxnonexistantfield;\n\n //checking, should NOT be cached\n $sCacheKey = 'fieldnames_oxarticles_nonExistantFieldTest';\n $aFieldNames = oxRegistry::getUtils()->fromFileCache($sCacheKey);\n\n $this->assertFalse(isset($aFieldNames['nonexistantfield']));\n }",
"public function testAllFieldsRequiredValuesInContentTypesAreNotIncorrect() {\n $content_types = array_keys($this->contentTypes['test']);\n foreach ($content_types as $type) {\n $fields = array_keys($this->contentTypes['test'][$type]['fields']);\n foreach ($fields as $field) {\n $required = rand();\n try {\n $this->assertNotEquals(\n $required,\n $this->contentTypes['system'][$type]['fields'][$field]['required'],\n \"Failed asserting {$type}:{$field} required value is not wrong.\"\n );\n }\n catch (Exception $e) {\n $this->handleAssertException($e);\n }\n }\n }\n // Verify if all fields required value in content types passed the test.\n $this->checkAllAssertionsPassedWholeTest();\n }",
"public function testNameTakenOnFieldInContentType(){\n \n $this->request->setMethod('POST')\n ->setPost(array('name' => 'TestContentTypeFieldTwo',\n 'format' => 'text',\n 'content_type' => '1'));\n \n // Make sure we are in the right place and have the right things on screen\n $this->dispatch('/contenttypefields/add/content-type/1');\n $this->assertAction('add');\n \n // Assert that we are redirected to the data type fields manage screen\n $this->assertRedirectTo('/contenttypefields/index/id/1');\n \n /*\n * Get the items from this content type to make sure there are not\n * now teo with the same name\n */\n $contentFields = $this->_contentTypeFieldsModel->getContentFieldsForContentType(1);\n $duplicateFound = false;\n $namesFound = array();\n foreach($contentFields as $field){\n if (in_array($field->name, $namesFound)){\n $duplicateFound = true;\n break;\n }\n $namesFound[] = $field->name;\n }\n \n $this->assertFalse($duplicateFound, 'Duplicate name of field found for one content type!');\n }",
"public function testValidateFieldBadContentType()\n {\n $this->utility->impersonate('editor');\n\n list($type, $entry) = $this->_createTestTypeAndEntry();\n\n $this->getRequest()->setParam('contentType', 'doesnotexist');\n $this->getRequest()->setParam('field', 'fieldName');\n $this->dispatch('/content/validate-field');\n $this->assertModule('error');\n $this->assertController('index');\n $this->assertAction('error');\n\n $responseBody = $this->getResponse()->getBody();\n $this->assertRegexp('/Cannot fetch record \\'doesnotexist\\'. Record does not exist./', $responseBody);\n }",
"public function testAllFieldsLabelsInContentTypesAreCorrect() {\n $content_types = array_keys($this->contentTypes['test']);\n foreach ($content_types as $type) {\n $fields = array_keys($this->contentTypes['test'][$type]['fields']);\n foreach ($fields as $field) {\n $label = $this->contentTypes['test'][$type]['fields'][$field]['label'];\n try {\n $this->assertEquals(\n $label,\n $this->contentTypes['system'][$type]['fields'][$field]['label'],\n \"Failed asserting that {$type}:{$field} label is correct.\"\n );\n }\n catch (Exception $e) {\n $this->handleAssertException($e);\n }\n }\n }\n // Verify if all field labels in content types passed the test.\n $this->checkAllAssertionsPassedWholeTest();\n }",
"public function testGetAllFields() {\n $field_discovery_test = new FieldDiscoveryTestClass($this->fieldPluginManager, $this->migrationPluginManager, $this->logger);\n $actual_fields = $field_discovery_test->getAllFields('7');\n $this->assertSame(['comment', 'node', 'user', 'taxonomy_term'], array_keys($actual_fields));\n $this->assertArrayHasKey('test_vocabulary', $actual_fields['taxonomy_term']);\n $this->assertArrayHasKey('user', $actual_fields['user']);\n $this->assertArrayHasKey('test_content_type', $actual_fields['node']);\n $this->assertCount(8, $actual_fields['node']);\n $this->assertCount(8, $actual_fields['comment']);\n $this->assertCount(23, $actual_fields['node']['test_content_type']);\n foreach ($actual_fields as $entity_type_id => $bundles) {\n foreach ($bundles as $bundle => $fields) {\n foreach ($fields as $field_name => $field_info) {\n $this->assertArrayHasKey('field_definition', $field_info);\n $this->assertEquals($entity_type_id, $field_info['entity_type']);\n $this->assertEquals($bundle, $field_info['bundle']);\n }\n }\n }\n }",
"public function testGetAllFields() {\n $field_discovery_test = new FieldDiscoveryTestClass($this->fieldPluginManager, $this->migrationPluginManager, $this->logger);\n $actual_fields = $field_discovery_test->getAllFields('6');\n $actual_node_types = array_keys($actual_fields['node']);\n sort($actual_node_types);\n $this->assertSame(['node'], array_keys($actual_fields));\n $this->assertSame(['employee', 'page', 'story', 'test_page', 'test_planet'], $actual_node_types);\n $this->assertCount(25, $actual_fields['node']['story']);\n foreach ($actual_fields['node'] as $bundle => $fields) {\n foreach ($fields as $field_name => $field_info) {\n $this->assertArrayHasKey('type', $field_info);\n $this->assertCount(22, $field_info);\n $this->assertEquals($bundle, $field_info['type_name']);\n }\n }\n }",
"public function testFieldInstances() {\n $this->assertEntity('comment.comment_node_page.comment_body', 'Comment', 'text_long', TRUE, FALSE);\n $this->assertEntity('node.page.body', 'Body', 'text_with_summary', FALSE, FALSE);\n $this->assertEntity('comment.comment_node_article.comment_body', 'Comment', 'text_long', TRUE, FALSE);\n $this->assertEntity('node.article.body', 'Body', 'text_with_summary', FALSE, TRUE);\n $this->assertEntity('node.article.field_tags', 'Tags', 'entity_reference', FALSE, TRUE);\n $this->assertEntity('node.article.field_image', 'Image', 'image', FALSE, TRUE);\n $this->assertEntity('comment.comment_node_blog.comment_body', 'Comment', 'text_long', TRUE, FALSE);\n $this->assertEntity('node.blog.body', 'Body', 'text_with_summary', FALSE, TRUE);\n $this->assertEntity('comment.comment_node_book.comment_body', 'Comment', 'text_long', TRUE, FALSE);\n $this->assertEntity('node.book.body', 'Body', 'text_with_summary', FALSE, FALSE);\n $this->assertEntity('node.forum.taxonomy_forums', 'Forums', 'entity_reference', TRUE, FALSE);\n $this->assertEntity('comment.comment_node_forum.comment_body', 'Comment', 'text_long', TRUE, FALSE);\n $this->assertEntity('node.forum.body', 'Body', 'text_with_summary', FALSE, FALSE);\n $this->assertEntity('comment.comment_node_test_content_type.comment_body', 'Comment', 'text_long', TRUE, FALSE);\n $this->assertEntity('node.test_content_type.field_boolean', 'Boolean', 'boolean', FALSE, FALSE);\n $this->assertEntity('node.test_content_type.field_email', 'Email', 'email', FALSE, FALSE);\n $this->assertEntity('node.test_content_type.field_phone', 'Phone', 'telephone', TRUE, FALSE);\n $this->assertEntity('node.test_content_type.field_date', 'Date', 'datetime', FALSE, FALSE);\n $this->assertEntity('node.test_content_type.field_date_with_end_time', 'Date With End Time', 'datetime', FALSE, FALSE);\n $this->assertEntity('node.test_content_type.field_file', 'File', 'file', FALSE, FALSE);\n $this->assertEntity('node.test_content_type.field_float', 'Float', 'float', FALSE, FALSE);\n $this->assertEntity('node.test_content_type.field_images', 'Images', 'image', TRUE, FALSE);\n $this->assertEntity('node.test_content_type.field_integer', 'Integer', 'integer', TRUE, FALSE);\n $this->assertEntity('node.test_content_type.field_link', 'Link', 'link', FALSE, FALSE);\n $this->assertEntity('node.test_content_type.field_text_list', 'Text List', 'list_string', FALSE, FALSE);\n $this->assertEntity('node.test_content_type.field_integer_list', 'Integer List', 'list_integer', FALSE, FALSE);\n $this->assertEntity('node.test_content_type.field_long_text', 'Long text', 'text_with_summary', FALSE, FALSE);\n $this->assertEntity('node.test_content_type.field_term_reference', 'Term Reference', 'entity_reference', FALSE, FALSE);\n $this->assertEntity('node.test_content_type.field_text', 'Text', 'text', FALSE, FALSE);\n $this->assertEntity('comment.comment_node_test_content_type.field_integer', 'Integer', 'integer', FALSE, FALSE);\n $this->assertEntity('user.user.field_file', 'File', 'file', FALSE, FALSE);\n\n\n $this->assertLinkFields('node.test_content_type.field_link', DRUPAL_OPTIONAL);\n $this->assertLinkFields('node.article.field_link', DRUPAL_DISABLED);\n $this->assertLinkFields('node.blog.field_link', DRUPAL_REQUIRED);\n }",
"public function testFieldWithoutTemplate() {\n $article = $this->container->get('entity_type.manager')->getStorage('node')\n ->create([\n 'type' => 'article',\n 'title' => 'Article N°2',\n ]);\n $article->save();\n $this->testFieldSaved();\n\n $this->debugOn();\n\n // Access the node canonical page.\n $this->drupalGet('node/' . $article->id());\n $this->assertSession()->statusCodeEquals(200);\n\n $output = $this->getSession()->getPage();\n\n // Asserts the debug mode of twig is enabled.\n $this->assertTrue(strpos($output->getContent(), '<!-- THEME HOOK: \\'node\\' -->') !== FALSE);\n\n // Asserts that Page Template Whisperer based suggestions are not present.\n $this->assertTrue(strpos($output->getContent(), '* page--node--1--googlemap.html.twig') === FALSE);\n $this->assertTrue(strpos($output->getContent(), '* page--node--googlemap.html.twig') === FALSE);\n\n // Asserts that Entity Template Whisperer based suggestions are not present.\n $this->assertTrue(strpos($output->getContent(), '* node--article--googlemap.html.twig') === FALSE);\n $this->assertTrue(strpos($output->getContent(), '* node--1--article--googlemap.html.twig') === FALSE);\n $this->assertTrue(strpos($output->getContent(), '* node--article--full--googlemap.html.twig') === FALSE);\n $this->assertTrue(strpos($output->getContent(), '* node--1--article--full--googlemap.html.twig') === FALSE);\n }",
"public function testGetBaseFieldDefinitions() {\n $field_definition = $this->setUpEntityWithFieldDefinition();\n\n $expected = ['id' => $field_definition];\n $this->assertSame($expected, $this->entityFieldManager->getBaseFieldDefinitions('test_entity_type'));\n }",
"public function testAllContentTypesNamesAreNotIncorrect() {\n $content_types = array_keys($this->contentTypes['test']);\n foreach ($content_types as $type) {\n $name = $this->contentTypes['test'][$type]['name'] . uniqid('_', TRUE);\n try {\n $this->assertNotEquals(\n $name,\n $this->contentTypes['system'][$type]['name'],\n \"Failed asserting that {$type} name is not wrong.\"\n );\n }\n catch (Exception $e) {\n $this->handleAssertException($e);\n }\n }\n // Verify if all content types name passed the test.\n $this->checkAllAssertionsPassedWholeTest();\n }",
"public function testNonInitializedFields() {\n // Create a test field.\n $this->fieldUIAddNewField('admin/structure/types/manage/' . $this->type, 'test', 'Test');\n\n // Check that the field appears as 'hidden' on the 'Manage display' page\n // for the 'teaser' mode.\n $this->drupalGet('admin/structure/types/manage/' . $this->type . '/display/teaser');\n $this->assertSession()->fieldValueEquals('fields[field_test][region]', 'hidden');\n }",
"public function testGetBaseFieldDefinitions() {\n $this->entityFieldManager->getBaseFieldDefinitions('node')->shouldBeCalled()->willReturn([]);\n $this->assertEquals([], $this->entityManager->getBaseFieldDefinitions('node'));\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets a new consumptionReport ASBIE Energy Water Supply. Consumption Report An amount of energy or water consumed. 0..n Energy Water Supply Consumption Report Consumption Report Consumption Report | public function setConsumptionReport(array $consumptionReport)
{
$this->consumptionReport = $consumptionReport;
return $this;
} | [
"public function getConsumptionReport()\n {\n return $this->consumptionReport;\n }",
"public function setReport($val)\n {\n $this->_propDict[\"report\"] = $val;\n return $this;\n }",
"function setReport(&$oRpt_) {\n\t\t\t$this->_oReport =& $oRpt_;\n\t\t}",
"public function setReport($report = []) {\n $report += [\n 'additions' => 0,\n 'updates' => 0,\n 'deletes' => 0,\n 'skips' => 0,\n 'strings' => [],\n ];\n $this->report = $report;\n }",
"public function setReport(Report $report)\n {\n $this->report = $report;\n }",
"public function setAttendeeReport($val)\n {\n $this->_propDict[\"attendeeReport\"] = $val;\n return $this;\n }",
"public function setReport(array $report = []) {\n $report += [\n 'twig' => 0,\n 'php' => 0,\n 'yaml' => 0,\n 'strings' => [],\n ];\n $this->report = $report;\n }",
"public function getReport()\n {\n if (isset($this->centrifuge) && $this->centrifuge) {\n $this->report->setCentrifuge($this->centrifuge);\n }\n\n return $this->report;\n }",
"public function updateReport()\n {\n $this->data['current_report'] = $this->xhprof->getReport();\n }",
"public function setObjReport($dataReport)\n { \n $this->dataReport = $dataReport;\n $this->spreadsheet = new Spreadsheet(); \n }",
"public function promoProductionReport()\n {\n /**\n * Set the range for yesterday\n */\n $this->setYesterday();\n \n /**\n * Formate the date for yesterday, email only\n */\n $this->setSalesDate();\n \n /**\n * Prepare the from day with time\n */\n $this->fromDate = $this->convertToUTC ( 0, 0, 0 );\n \n /**\n * Prepare the to (end) day with time\n */\n $this->toDate = $this->convertToUTC ( 23, 59, 59 );\n\n /**\n * Get the sales order collection \n */\n $this->setSalesOrderCollection();\n \n /**\n * Prepare the array that has all the info to return\n */\n $this->constructReturnArray();\n \n /**\n * Parepare the text to send to email\n */\n $this->constructReturnText();\n \n /**\n * Send out the email \n */\n $this->sendReportEmail();\n \n }",
"function set_report() {\n\t\tif( is_numeric($this->EE->input->POST('id')) ) {\n\t\t\t$id = $this->EE->input->POST('id');\n\t\t\t// $callback = $this->EE->input->POST('callback');\n\t\t\t$customer_reference = $this->EE->input->POST('customer_reference');\n\t\t\t$rtd_reference = $this->EE->input->POST('rtd_reference');\n\t\t\t$work_location_name = $this->EE->input->POST('work_location_name');\n\t\t\t$contact_person = $this->EE->input->POST('contact_person');\n\n\t\t\t$data = array(\n\t\t\t\t'customer_reference' \t=> $customer_reference,\n\t\t\t\t'rtd_reference' \t\t=> $rtd_reference,\n\t\t\t\t'work_location_name'\t=> $work_location_name,\n\t\t\t\t'contact_person' \t\t=> $contact_person\n\t\t\t);\n\n\t\t\t$this->EE->db->where('id', $id);\n\t\t\t$this->EE->db->update('wr_reports', $data);\n\t\t} else {\n\t\t\tshow_error('Invalid id given.');\n\t\t}\n\t}",
"#[@arg]\n public function setReportFile($reportFile) {\n $this->reportFile= $reportFile;\n }",
"public function setReportPageSize($reportPageSize){\n\t\t$this->reportPageSize = $reportPageSize;\n\t}",
"public function setReport(Report $report)\n {\n $this->report = $report;\n return $this;\n }",
"public function storeReport()\n {\n Utils::log(LOG_DEBUG, \"Storing report to the DB\", __FILE__, __LINE__);\n\n $this->_report->setProcessedOn(time());\n\n $this->_report = $this->getPakiti()->getManager(\"ReportsManager\")->createReport($this->_report, $this->_host);\n }",
"protected function getReport()\n {\n return $this->report;\n }",
"public function StartReport(){\n $this->AliasNbPages();\n $this->AddPage();\n $this->SetAutoPageBreak(true, 11);\n $this->SetTextColor(0);\n }",
"function create_reporting_block($reporting_block)\r\n {\r\n return $this->create($reporting_block);\r\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return the most recent four published listings. | public function recentPublishedListings(int $count=4)
{
return CraftRex::getInstance()->RexListingService->findRecent(true, $count);
} | [
"function get_four_latest_posts() {\n\t\t$result = array();\n\t\t$args = array('showposts' => 4, 'post_type' => 'post');\n\t\tquery_posts($args);\n\t\twhile (have_posts()) {\n\t\t\tthe_post();\t\n\t\t\t$result[] = get_the_ID();\n\t\t}\n\t\twp_reset_query();\n\t\treturn $result;\n\t}",
"public function getRecentPosts()\n\t{\n\t\t$sql = \"SELECT * FROM posts WHERE published = 1 ORDER BY created_at DESC LIMIT 4\";\n\t\treturn $this->findAll($sql, 'obj');\n\t}",
"function getFiveLatestPublishedPostIds(){\n\tglobal $conn;\n\t\n\t$sql =\"SELECT post_id FROM `posts` WHERE published =1 ORDER BY created_at DESC LIMIT 5\";\n\t$result = mysqli_query($conn, $sql);\n\tif($result){\n\t\t$published_post_id = mysqli_fetch_all($result, MYSQLI_ASSOC);\n\t\treturn $published_post_id;\n\t}else{\n\t\treturn null;\n\t}\t\n}",
"public function getPublishedPosts()\n\t{\n\t\t$sql = \"SELECT * FROM posts WHERE published = 1 ORDER BY created_at DESC LIMIT 6\";\n\t\treturn $this->findAll($sql, 'obj');\n\t}",
"function openskydora_get_most_viewed_items($count, $weeks_ago=7, $exclude=NULL) {\n\n $records = openskydora_get_most_viewed($count+20, $weeks_ago, $exclude);\n $item_records = array(); // No collections\n \n // filter out collection citation model\n foreach ($records as $pid=>$data) {\n $data->obj = islandora_object_load($pid);\n if (in_array('islandora:collectionCModel',$data->obj->models)) {\n // dsm ('collection! '. $pid);\n } else {\n $item_records[$pid] = $data;\n }\n }\n return array_slice($item_records, 0, $count, TRUE);\n}",
"public function getFiveLatestRecords();",
"public function getLastPublished();",
"function getLatestReleaseList()\r\n{\r\n $link = \"https://www.mangaupdates.com/releases.html\";\r\n $regex = '/<div class=.col-6 pbreak.*href=.https:\\/\\/www.mangaupdates.com\\/series.html\\?id=(.*)..ti.*Info.>(.*)<\\/a.*\\n.*c.(.*)<.*\\n.*href=.https:\\/\\/www.mangaupdates.com\\/groups.html\\?id=(.*)..ti.*Info.>(.*)<\\/a.*/m';\r\n\r\n return getList($link, $regex, 5);\r\n}",
"public function getRecentPlans($limit = 3);",
"public function findLatest($count = 6)\n {\n return $this\n ->createQueryBuilder('article')\n ->orderBy('article.publicationDate', 'desc')\n ->where('article.publicationStatus = :published')\n ->andWhere('article.publicationDate <= :now')\n ->setParameter('published', Article::PUBLICATION_STATUS_PUBLISHED)\n ->setParameter('now', new DateTime())\n ->setMaxResults($count)\n ->getQuery()\n ->getResult();\n }",
"public function findFeaturedListings(): Collection\n {\n return Listing::query()\n ->where('is_featured', 1)\n ->inRandomOrder()\n ->limit(8)\n ->get();\n }",
"function get_products_recent(){\n $recent = array();\n $all = get_products_all();\n $totalProducts = count($all); \n $position = 0; \n foreach ($all as $product) { \n $position++;\n if($position <= $totalProducts-4){ continue;}\n $recent[] = $product;\n }\n return $recent;\n }",
"public function getLastFiveRecordingsAttribute(): Collection\n {\n return $this->recordings()->orderBy('created_at', 'DESC')->limit(5)->get();\n }",
"public function latestStories()\n {\n return Story::latest()->with('author')->paginate(config('backstory.stories_per_page', 10));\n }",
"public function latest() {\n $posts = $this->paginate('Post', array('published' => true));\n if ($this->request->is('requested')) {\n return $posts;\n }\n }",
"function fetchLatestFiveArticles() {\n\t\treturn $this->fetchAllArticles ( \"latest_articles_view\" );\n\t}",
"private function getNewest($count = 5) {\n return Posts::where('status', 'public')->orderBy('id', 'desc')->take($count)->get();\n }",
"function getLatestPosts($count = -1) {\n $query = new WP_Query([\n 'post_type' => 'post',\n 'posts_per_page' => $count\n ]);\n\n return $query->get_posts();\n}",
"public function getLatestPosts()\n {\n $stmt = $this->pdo->prepare(\"SELECT * FROM posts ORDER BY posts_id DESC LIMIT 1,4\");\n $stmt->execute();\n $rows = $stmt->fetchAll();\n return $rows;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Validate if a permission exists If the groupId is provided, the method will only return TRUE if the permission exists in that group. | public function exists($permissionId, $groupId = NULL) {
if (isset(self::$_permissions[$permissionId])) {
if ($groupId > 0) {
return $this->inGroup($permissionId, $groupId);
}
return TRUE;
}
return FALSE;
} | [
"public function group_has_permission($group_id, $permission = '')\n {\n $g = new Group($group_id);\n \n // If we aren't checking a specific permission, auto check for the win!\n if ($permission == '')\n $permission = trim($this->ci->uri->uri_string(), '/');\n \n if ( $g->exists() )\n {\n \t$by_type = is_int($permission)? 'id':'permission';\n \t$g->permission->where($by_type,$permission)->get();\n \tif($g->permission->exists())\n \t{\n \t\treturn TRUE;\n \t}\n \telse{\n \t\treturn FALSE;\n \t} \n }\n else\n {\n return false;\n }\n }",
"public function permissionExists($permissionName);",
"public function hasGroup(Group $group): bool;",
"private function _has_perms() {\n\t\t$args = func_get_args();\n\t\t$group = array_shift($args);\n\t\t$ret = false;\n\n\t\t$this->EE->db->select('group_id');\n\t\t$this->EE->db->from('member_groups');\n\t\t$this->EE->db->where('group_id', $group);\n\t\tforeach ($args as $v) {\n\t\t\t$this->EE->db->where($v, 'y');\n\t\t}\n\n\t\treturn $this->EE->db->get()->num_rows();\n\t}",
"public function hasPermission(int $roleId, $permission): bool;",
"public function hasPermission($userId, $name, $groupId = null)\n {\n // Make sure $userId is set.\n if ($userId === false || $userId == null) {\n return false;\n }\n\n $user = $this->users->find($userId);\n\n // Check if has individual permissions first:\n if ($this->hasPermissionFromIndividual($user, $name, $groupId)) {\n return true;\n }\n\n // If no matching individual permission was found, then check permissions\n // inherited from Roles.\n else if ($this->hasPermissionFromRole($user, $name, $groupId)) {\n return true;\n }\n\n // If no matching permission was found by this point, then no permission exists.\n return false;\n }",
"public function hasPermission($permission);",
"public static function groupHasPermission($grouplist, $perm) {\n \n if (!is_array($grouplist) || count($grouplist) == 0) {\n return false;\n }\n\n foreach ($grouplist as $group) {\n # Check zero (NO_ADMIN_ACCESS === 0)\n if ($group->permissions === NO_ADMIN_ACCESS) continue;\n\n # One of the group has full admin access\n if ((float)$group->permissions === (float)FULL_ADMIN) {\n return true;\n }\n\n # Check individually\n if (self::check_permission($group->permissions, $perm) == true) {\n return true;\n }\n }\n\n return false;\n }",
"public function memberGroupHasAccess($group)\n\t{\n\t\tif ($group instanceOf MemberGroup)\n\t\t{\n\t\t\t$group_id = $group->group_id;\n\t\t}\n\t\telseif(is_numeric($group))\n\t\t{\n\t\t\t$group_id = (int) $group;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tthrow new \\InvalidArgumentException('memberGroupHasAccess expects an number or an instance of MemberGroup.');\n\t\t}\n\n\t\t// 2 = Banned\n\t\t// 3 = Guests\n\t\t// 4 = Pending\n\t\t$hardcoded_disallowed_groups = array('2', '3', '4');\n\n\t\t// If the user is a Super Admin, return true\n\t\tif ($group_id == 1)\n\t\t{\n\t\t\treturn TRUE;\n\t\t}\n\n\t\tif (in_array($group_id, $hardcoded_disallowed_groups))\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\n\t\tif (in_array($group_id, $this->getNoAccess()->pluck('group_id')))\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\n\t\treturn TRUE;\n\n\t}",
"public static function check($group, $priv)\r\n {\r\n if(!static::enabled($priv)) return false;\r\n $stmt = \\APLib\\DB::prepare(\"SELECT COUNT(*) AS c FROM groups_privs WHERE name = ? AND priv_name = ?\");\r\n $stmt->bind_param('ss', $group, $priv);\r\n $stmt->execute();\r\n $stmt->store_result();\r\n $stmt->bind_result($count);\r\n $stmt->fetch();\r\n return ($count > 0);\r\n }",
"function hasPermissionId($permissionId){\r\n\t\tif($this->permissions != \"\"){\r\n\t\t\tforeach($this->permissions as $permission){\r\n\t\t\t\tif($permission->id == $permissionId){\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn false;\r\n\t}",
"public function ruleGroupExists(UuidInterface $ruleGroupId, ?int $status = null): bool;",
"public function hasPermission(int $permission, int $permissions): bool;",
"public function canAddToGroup(Group $group): bool;",
"function permissionNameExists($permission)\r\n{\r\n\t$query = UcPermissionsQuery::create()->filterByName($permission)->limit(1)->find();\r\n\treturn(count($query) > 0);\r\n}",
"public function permission_exists($member_id, $group_id, $resource, $action = 'read')\r\n\t{\r\n\t\t//member or group permission check?\r\n\t\tif(is_numeric($member_id))\r\n\t\t{\r\n\t\t\t$where_caluse = \"WHERE member_id = {$member_id}\";\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$where_clause = \"WHERE group_id = {$group_id}\";\r\n\t\t}\r\n\r\n\t\t//nullify string case\r\n\t\t$resource = strtolower($resource);\r\n\r\n\t\treturn $this->db->query(\"SELECT count(*) FROM {$this->table}.permissions {$where_clause} AND LOWER(resource) = '{$resource}' AND action = '{$action}'\")->fetchColumn();\r\n\t}",
"public function exists($group, $namespace = null);",
"protected function isValidGroupId( $groupId )\n {\n $groups = $this->getServerGroups();\n\n if ( array_key_exists( $groupId, $groups ) )\n {\n return true;\n }\n\n return false;\n }",
"public function hasPermission($id);"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Historic rankings for a given keyword in organic search results. | public function ResearchOrganicGetListRankingsKeywordHistoric($countrycode, $date, $keyword, $limit = "", $offset = "")
{
return $this->run('ResearchOrganicGetListRankingsKeywordHistoric', get_defined_vars(), 'GET');
} | [
"public function update_keyword_rankings()\r\n {\r\n foreach ($this->keywords as $keyword) {\r\n $keyword->update_rankings();\r\n }\r\n }",
"public function getUrlRankByKeyword($keyword, $url, $searchEngine = 'google', $callback = null, $geolocId = null, $location = 13, $maxPage = null);",
"function get_work_keyword_rank($opt=array())\r\n {\r\n $lineCount = 40;\r\n $output = array('data'=>array());\r\n\r\n $i = 1;\r\n\r\n //work category\r\n $sql = \"SELECT category, count, all_count from (\";\r\n\r\n $this->load->config('keyword', TRUE);\r\n $keyword_list = $this->config->item('keyword', 'keyword');\r\n foreach ($keyword_list as $key => $keyword) { \r\n $sql .= \"(SELECT '\".$keyword.\"' as category, count(work_id) as count from works where keywords like '%\".$key.\"%')\";\r\n\r\n if($i == count($keyword_list)){\r\n $i = 1;\r\n }\r\n else {\r\n $i++;\r\n $sql .= \" UNION ALL \";\r\n }\r\n }\r\n $sql .= \") categories join (select count(work_id) as all_count from works ) w order by count desc limit 0, ?\";\r\n\r\n $query = $this->db->query($sql, array($lineCount));\r\n foreach ($query->result() as $row)\r\n {\r\n $output['data'][$i] = array('name'=>$row->category, 'count'=>$row->count, 'percent'=>round($row->count*100/$row->all_count,2).\"%\");\r\n $i++;\r\n }\r\n\r\n return $output;\r\n }",
"public function getRankingByCompany();",
"function AdvancedRelevanceRanking()\n\t{\n\t\tglobal $ALL_REQUEST;\n\t\t$Terms1 = $ALL_REQUEST['SearchWord1'];\n $Terms2 = $ALL_REQUEST['SearchWord2'];\n $Terms3 = $ALL_REQUEST['SearchWord3'];\n $QueryItems1 = $ALL_REQUEST[$ALL_REQUEST['QueryOption1']];\n $QueryItems2 = $ALL_REQUEST[$ALL_REQUEST['QueryOption2']];\n $QueryItems3 = $ALL_REQUEST[$ALL_REQUEST['QueryOption3']];\n\t\t$Filter1 = $ALL_REQUEST['filter1'];\n\t\t$Filter2 = $ALL_REQUEST['filter2'];\n\t\t\n\t\t$BYear = $ALL_REQUEST['BeginYear'];\n $EYear = $ALL_REQUEST['EndYear'];\n $BMonth = $ALL_REQUEST[$ALL_REQUEST['BeginMonth']];\n $EMonth = $ALL_REQUEST[$ALL_REQUEST['EndMonth']];\n $BDay = $ALL_REQUEST['BeginDay'];\n $EDay = $ALL_REQUEST['EndDay'];\n\n\n\t\n\t\t$RelRank = \"\";\n\t\t\n\t\t$Terms1 = str_replace(\"\\'\", \"\\\\\\'\", $Terms1);\n\t\t$Terms2 = str_replace(\"\\'\", \"\\\\\\'\", $Terms2);\n\t\t$Terms3 = str_replace(\"\\'\", \"\\\\\\'\", $Terms3);\n\t\n\t\tif ($Terms1 != \"\")\n\t\t{\n\t\t\t$RelRank = \"(count(words($QueryItems1) WHERE \" . $QueryItems1 . \" IN ['\" . $Terms1 . \"'])\";\n\t\t}\n\t\tif ($Filter1 != \"NOT\")\n\t\t{\n\t\t\tif ($Terms2 != \"\")\n\t\t\t{\n\t\t\t\tif ($RelRank != \"\")\n\t\t\t\t{\t$RelRank .= \") + \";}\n\t\t\t\t$RelRank .= \"(count(words($QueryItems2) WHERE \" . $QueryItems2 . \" IN ['\" . $Terms2 . \"'])\";\n\t\t\t}\n\t\t}\n\t\tif ($Filter2 != \"NOT\")\n\t\t{\n\t\t\tif ($Terms3 != \"\")\n\t\t\t{\n\t\t \tif ($RelRank != \"\")\n\t\t\t\t{ $RelRank .= \") + \";}\n\t\t\t\t$RelRank .= \"(count(words($QueryItems3) WHERE \" . $QueryItems3 . \" IN ['\" . $Terms3 . \"'])\";\n\t\t\t}\n\t\t}\n\t\tif ($RelRank != \"\")\n\t\t{\n\t\t\t$RelRank = \", (\" . $RelRank . \")) as rank \";\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$RelRank = \", (0 as rank)\";\n\t\t}\n\t\t\n\t\treturn ($RelRank);\n\t\t\n\t\n\t}",
"public function getSiteRankings()\n {\n if (!empty($this->_keyword_array) && !empty($this->_multiple_run_cache))\n {\n return $this->_return_multiple_keywords();\n }\n else\n {\n return $this->_return_single_keyword();\n }\n }",
"public function load_all_rank() {\n\t\t#$this->autoRender = false;\n\t\t$message = array();\n\t\t#Configure::write('debug', 0);\n\t\tset_time_limit(0);\n\t\t$this -> Keyword -> recursive = -1;\n\n\t\t// Filter keyword\n\t\t$conds = array();\n\t\t$conds['Keyword.Enabled'] = 1;\n\t\t$conds['Keyword.nocontract'] = 0;\n\t\t$conds['Keyword.rankend'] = 0;\n\n\t\t$keywords = $this -> Keyword -> find('all', array('conditions' => $conds));\n\n\t\tforeach ($keywords as $keyword) {\n\t\t\tsleep(4);\n\t\t\tif ($keyword != false) {\n\t\t\t\tif ($keyword['Keyword']['Strict'] == 1) {\n\t\t\t\t\t$domain = $this -> Rank -> remainUrl($keyword['Keyword']['Url']);\n\t\t\t\t} else {\n\t\t\t\t\t$domain = $this -> Rank -> remainDomain($keyword['Keyword']['Url']);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$engine = $keyword['Keyword']['Engine'];\n\n\t\t\tif ($engine == 3) {\n\t\t\t\t$rank = $this -> Rank -> keyWordRank('google_jp', $domain, $keyword['Keyword']['Keyword']) . '/' . $this -> Rank -> keyWordRank('yahoo_jp', $domain, $keyword['Keyword']['Keyword']);\n\t\t\t} elseif ($engine == 6) {\n\t\t\t\t$rank = $this -> Rank -> keyWordRank('google_en', $domain, $keyword['Keyword']['Keyword']) . '/' . $this -> Rank -> keyWordRank('yahoo_en', $domain, $keyword['Keyword']['Keyword']);\n\t\t\t} elseif ($engine == 7) { // mobile search engine\n\t\t\t\t$rank = $this -> RankMobile -> keywordRankYahooMobile($domain, $keyword['Keyword']['Keyword']);\n\t\t\t} elseif ($engine == 8) {\n\t\t\t\t$rank = $this -> RankMobile -> keywordRankGoogleMobile($domain, $keyword['Keyword']['Keyword']);\n\t\t\t} else { // end\n\t\t\t\t$engine_list = $this -> Rank -> getEngineList();\n\t\t\t\t$rank = $this -> Rank -> keyWordRank($engine_list[$engine]['Name'], $domain, $keyword['Keyword']['Keyword']);\n\t\t\t}\n\n\t\t\t// delete Rankhistory current date\n\t\t\t$this -> Keyword -> Rankhistory -> deleteAll(array('Rankhistory.KeyID' => $keyword['Keyword']['ID'], 'Rankhistory.RankDate' => date('Ymd')));\n\t\t\t\n\t\t\t// insert Rankhistory current date\n\t\t\t$rankhistory['Rankhistory']['KeyID'] = $keyword['Keyword']['ID'];\n\t\t\t$rankhistory['Rankhistory']['Url'] = $domain;\n\t\t\t$rankhistory['Rankhistory']['Rank'] = $rank;\n\t\t\t$rankhistory['Rankhistory']['RankDate'] = date('Ymd');\n\t\t\t\n\t\t\t// check color and arrow\n\t\t\t$check_params = array();\n\t\t\t$rankDate = date('Ymd', strtotime(date('Y-m-d') . '-1 day'));\n\t\t\t$data_rankhistory = Cache::read($keyword['Keyword']['ID'] . '_' . $rankDate, 'Rankhistory');\n\t\t\t\n\t\t\t// no cache\n\t\t\tif (!$data_rankhistory) {\n\t\t\t\t$data_rankhistory = $this -> Keyword -> Rankhistory -> find('first', array('fields' => array('Rankhistory.Rank'), 'conditions' => array('Rankhistory.KeyID' => $keyword['Keyword']['ID'], 'Rankhistory.RankDate' => $rankDate)));\n\t\t\t\tCache::write($keyword['Keyword']['ID'] . '_' . $rankDate, $rankhistory, 'Rankhistory');\n\t\t\t}\n\t\t\t\n\t\t\t// already cache\n\t\t\tif (isset($data_rankhistory['Rankhistory']['Rank']) && strpos($data_rankhistory['Rankhistory']['Rank'], '/')) {\n\t\t\t\t$rank_old = explode('/', $data_rankhistory['Rankhistory']['Rank']);\n\t\t\t} else {\n\t\t\t\t$rank_old[0] = 0;\n\t\t\t\t$rank_old[1] = 0;\n\t\t\t}\n\t\t\t// check rank is not empty and has a slash\n\t\t\tif (!empty($rank) && strpos($rank, '/')) {\n\t\t\t\t$rank_new = explode('/', $rank);\n\t\t\t} else {\n\t\t\t\t$rank_new[0] = 0;\n\t\t\t\t$rank_new[1] = 0;\n\t\t\t}\n\n\t\t\t// color\n\t\t\tif ($rank_new[0] >= 1 && $rank_new[0] <= 10 || $rank_new[1] >= 1 && $rank_new[1] <= 10) {\n\t\t\t\t$check_params['color'] = '#E4EDF9';\n\t\t\t} else if ($rank_new[0] >= 11 && $rank_new[0] <= 20 || $rank_new[1] >= 11 && $rank_new[1] <= 20) {\n\t\t\t\t$check_params['color'] = '#FAFAD2';\n\t\t\t} else if ($rank_old[0] >= 1 && $rank_old[0] <= 10 && $rank_new[0] > 10 || $rank_old[1] >= 1 && $rank_old[1] <= 10 && $rank_new[1] > 10) {\n\t\t\t\t$check_params['color'] = '#FFBFBF';\n\t\t\t} else {\n\t\t\t\t$check_params['color'] = '';\n\t\t\t}\n\n\t\t\t// arrow\n\t\t\tif ($rank_new[0] > $rank_old[0] || $rank_new[1] > $rank_old[1]) {\n\t\t\t\t$check_params['arrow'] = '<span class=\"red-arrow\">↓</span>';\n\t\t\t} else if ($rank_new[0] < $rank_old[0] || $rank_new[1] < $rank_old[1]) {\n\t\t\t\t$check_params['arrow'] = '<span class=\"blue-arrow\">↑</span>';\n\t\t\t} else {\n\t\t\t\t$check_params['arrow'] = '';\n\t\t\t}\n\n\t\t\t$rankhistory['Rankhistory']['params'] = json_encode($check_params);\n\t\t\t$this -> Keyword -> Rankhistory -> create();\n\t\t\t$this -> Keyword -> Rankhistory -> save($rankhistory);\n\t\t\t// Old code rewrite\n\t\t\t$duration = $this -> Keyword -> Duration -> find('first', array('fields' => array('Duration.StartDate'), 'conditions' => array('Duration.KeyID' => $keyword['Keyword']['ID'], 'Duration.Flag' => 2), 'order' => 'Duration.ID'));\n\t\t\t//\n\t\t\tif ($duration == false) {\n\t\t\t\tif (strpos($rank, '/') !== false) {\n\t\t\t\t\t$ranks = explode('/', $rank);\n\t\t\t\t\t$google_rank = $ranks[0];\n\t\t\t\t\t$yahoo_rank = $ranks[1];\n\t\t\t\t}\n\n\t\t\t\tif (($google_rank > 0 && $google_rank <= 10) || ($yahoo_rank > 0 && $yahoo_rank <= 10) || ($rank > 0 && $rank <= 10)) {\n\t\t\t\t\t$durations['Duration']['KeyID'] = $keyword['Keyword']['ID'];\n\t\t\t\t\t$durations['Duration']['StartDate'] = date('Ymd');\n\t\t\t\t\t$durations['Duration']['EndDate'] = 0;\n\t\t\t\t\t$durations['Duration']['Flag'] = 2;\n\t\t\t\t\t$this -> Keyword -> Duration -> create();\n\t\t\t\t\t$this -> Keyword -> Duration -> save($durations);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$message[] = $keyword['Keyword']['ID'];\n\t\t}\n\t\techo implode(', ', $message);\n\t\t$this -> redirect($this -> referer());\n\t}",
"function _sortResultsByRank($searchString, $advSearch, $results, $nbrs) {\n $rkFields = array();\n if ($this->asCfg->cfg['rank']) {\n $searchString = strtolower($searchString);\n\n $rkParam = explode(',', $this->asCfg->cfg['rank']);\n foreach ($rkParam as $rk) {\n $rankParam = explode(':', $rk);\n $name = $rankParam[0];\n $weight = (isset($rankParam[1]) ? $rankParam[1] : 1);\n $rkFields[] = array('name' => $name, 'weight' => $weight);\n }\n\n for ($i = 0;$i < $nbrs;$i++) {\n $results[$i]['rank'] = 0;\n foreach ($rkFields as $rf) {\n $results[$i]['rank']+= $this->_getRank($searchString, $advSearch, $results[$i][$rf['name']], $rf['weight']);\n }\n }\n if ($nbrs >1) {\n\n $i = 0;\n foreach ($results as $key => $row) {\n $category[$key] = $row['category'];\n $rank[$key] = $row['rank'];\n $ascOrder[$key] = $i++;\n }\n array_multisort($category, SORT_ASC, $rank, SORT_DESC, $ascOrder, SORT_ASC, $results);\n }\n }\n return $results;\n }",
"function get_user_keyword_rank($opt=array())\r\n {\r\n $lineCount = 40;\r\n $output = array('data'=>array());\r\n\r\n $i = 1;\r\n //user category\r\n $sql = \"SELECT category, count, all_count from (\";\r\n\r\n $this->load->config('keyword', TRUE);\r\n $keyword_list = $this->config->item('keyword', 'keyword');\r\n foreach ($keyword_list as $key => $keyword) { \r\n $sql .= \"(SELECT '\".$keyword.\"' as category, count(id) as count from user_profiles where keywords like '%\".$key.\"%')\";\r\n\r\n if($i == count($keyword_list)){\r\n $i = 1;\r\n }\r\n else {\r\n $i++;\r\n $sql .= \" UNION ALL \";\r\n }\r\n }\r\n $sql .= \") categories join (select count(id) as all_count from users ) w order by count desc limit 0, ?\";\r\n\r\n $query = $this->db->query($sql, array($lineCount));\r\n foreach ($query->result() as $row)\r\n {\r\n $output['data'][$i] = array('name'=>$row->category, 'count'=>$row->count, 'percent'=>round($row->count*100/$row->all_count,2).\"%\");\r\n $i++;\r\n }\r\n\r\n return $output;\r\n }",
"public function add_test_rank() {\n $start_date = strtotime('-2 year');\n $end_date = strtotime('today');\n\n $keywords = Keyword::inst()->get_user_keywords($this->c_user->id, $this->profile->id);\n\n for($i = $start_date; $i <= $end_date; $i += 86400) {\n\n foreach($keywords as $keyword) {\n $kr = Keyword_rank::inst()->where(array('keyword_id' => $keyword->id, 'date' => date('Y-m-d', $i)))->get(1);\n $kr->rank = rand(1, 100);\n $kr->keyword_id = $keyword->id;\n $kr->date = date('Y-m-d', $i);\n $kr->save();\n }\n\n }\n\n }",
"public function sentence_ranker($string) {\n $overall_keyword = $this->stopWords($string);\n $sentences = $this->sentence_split($string);\n $overall_keywords = $this->uni_keyword($overall_keyword); //count overall paragraph keyword values\n// $pos_array = array('CD' => 1, 'JJ' => 5, 'NN' => 10, 'NNS' => 10, 'RB' => 5, 'VB' => 7, 'VBG' => 8, 'VBN' => 7, 'VBP' => 6); //parts of speech rank array.\n arsort($overall_keywords); //sort array\n $i = 0; //initialize array key\n $keyword_sen = array(); //initialize array\n foreach ($sentences as $k => $sentence) {\n $keyword = $this->uni_keyword($this->stopWords($sentence)); //count sentence keyword value.\n // var_dump($keyword);\n arsort($keyword); //sort array\n // $rank = ($k) == 0 ? //check for first sentence.\n // 1000 : //set rank for first sentance as 10.\n // ($k) == (count($sentence)-1) ?\n // -1000 :\n // 0; //else set value to 0.\n if($k == 0){\n $rank = 10000;\n }elseif ($k == (count($sentences)-1) && str_word_count($sentence) < 4) {\n $rank = -1000;\n } else {\n $rank = 0;\n }\n foreach ($overall_keywords as $key => $value) {\n if (array_key_exists($key, $keyword)) {\n if (array_key_exists($keyword[$key]['tag'], $this->pos_array)) {//tag\n $rank = $rank + ($value['rank'] * $keyword[$key]['rank'] * $this->pos_array[$keyword[$key]['tag']]);\n } else {\n $rank = $rank + ($value['rank'] * $keyword[$key]['rank']);\n }\n }\n }\n $keyword_sen[$i]['sentence'] = $sentence;\n $keyword_sen[$i]['rank'] = $rank;\n //$keyword_sen[$i]['keyword'] = $keyword; //uncomment if sentance keyword rank required.\n// $keyword_sen[$i]['wordcount'] = str_word_count($sentence); // uncomment if sentance word count required.\n $i++; //array key incrementer.\n }\n //Potential tags based ranking starts\n $potential_tags = $this->potential_tags($string);\n $sent_rank = array();\n foreach ($keyword_sen as $key => $sen_let){\n foreach ($potential_tags as $pt) {\n if (strpos($sen_let['sentence'], $pt) !== false) {\n $sent_rank[$key]['sentence'] = $sen_let['sentence'];\n $sent_rank[$key]['rank'] = $sen_let['rank'] * 10;\n //$sent_rank[$key]['keyword'] = $sen_let['keyword']; //uncomment if sentance keyword rank required.\n// $sent_rank[$key]['wordcount'] = $sen_let['wordcount']; // uncomment if sentance word count required.\n }else{\n $sent_rank[$key] = $sen_let;\n }\n }\n }\n return $sent_rank;\n }",
"function WarclipRelevanceRanking()\n\t{\n\t\tglobal $ALL_REQUEST;\n\n\t\t$Terms = $ALL_REQUEST['SearchWord'];\n\t\t$QueryItems = $ALL_REQUEST[$ALL_REQUEST['QueryOption']];\n\t\t$Words = $ALL_REQUEST['QueryWord'];\n\t\t\t\n\t\t$Terms = str_replace(\"\\'\", \"\\\\\\'\", $Terms);\n\n\t\t$counter = 1;\n\t\t$rank = \"\";\n\t\t\t\t\t\t\n\t\tif ($Words == 'all' && $Terms != '')\n {\n $IndTerms = split (' ', $Terms);\n foreach($IndTerms as $RankTerm)\n {\n if ($counter == 1)\n\t\t\t\t{ $rank = $rank . \",\"; }\n\t\t\t\telse\n { $rank = $rank . \" + \";}\n\t\t\t\t\n $rank = $rank . \"(count(words($QueryItems) WHERE $QueryItems IN ['$RankTerm']))\";\n $counter ++;\n }\n $rank = $rank . \" AS rank \";\n }\t\n\t\telseif ($Words == 'exact' && $Terms != '')\n {\n\t\t\t$rank = \",count(words($QueryItems) WHERE $QueryItems IN ['\" . '\"' . $Terms \n\t\t\t\t. '\"' . \"']) AS rank \";\n }\t\n\t\telseif ($Words == 'any' && $Terms != '')\n {\n\t\t\t$rank = \",count(words($QueryItems) WHERE $QueryItems IN [\";\n $IndTerms = split (' ', $Terms);\n foreach($IndTerms as $RankTerm)\n {\n if ($counter != 1)\n { $rank = $rank . \" | \";}\n $rank = $rank . \"'$RankTerm'\";\n $counter ++;\n }\n $rank = $rank . \"]) AS rank \";\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$rank = \", 0 as rank\";\n\t\t}\n\t\treturn($rank);\n\n\t}",
"function GetRank($url, $query, $maxresults = 30)\n\t{\n\t\t$current_page = 0;\n\t\t$result_counter = 0;\n\t\t$page_size = 10;\n\t\t\n\t\t$rank = new SearchRank();\n\t\t\n\t\t$rank->Query = $query;\n\t\t\n\t\twhile ($rank->Position == 0 && $result_counter <= $maxresults)\n\t\t{\n\t\t\t$current_page++;\n\t\t\t\n\t\t\t$result = $this->DoSearch($query,$result_counter,$page_size);\n\n\t\t\t// only loop through as many results as we have\n\t\t\tif ($result->estimatedTotalResultsCount < $maxresults)\n\t\t\t{\n\t\t\t\t$maxresults = $result->estimatedTotalResultsCount;\n\t\t\t}\n\t\t\t\n\t\t\tif ($current_page == 1 && $result->estimatedTotalResultsCount > 0)\n\t\t\t{\n\t\t\t\t$rank->EstimatedResults = $result->estimatedTotalResultsCount;\n\t\t\t\t$rank->TopRankedUrl = $result->resultElements[0]->URL;\n\t\t\t\t$rank->TopRankedSnippet = $result->resultElements[0]->snippet;\n\t\t\t\t$rank->TopRankedTitle = $result->resultElements[0]->title;\n\t\t\t}\n\n\t\t\t$cp_rank = $this->GetPositionOnPage($url,$result);\n\t\t\t\n\t\t\tif ($cp_rank->Position)\n\t\t\t{\n\t\t\t\t// we found a match\n\t\t\t\t$rank->Page = $current_page;\n\t\t\t\t$rank->Position = $cp_rank->Position * $current_page;\n\t\t\t\t$rank->Title = $cp_rank->Title;\n\t\t\t\t$rank->Snippet = $cp_rank->Snippet;\n\t\t\t\t$rank->Url = $cp_rank->Url;\n\t\t\t}\n\t\t\t\n\t\t\t$result_counter += $page_size;\n\t\t\t$result = null;\n\t\t}\n\t\t\n\t\treturn $rank;\n\t}",
"public function getRanking()\n {\n }",
"function get10Articles(string $keyword);",
"public function load_rank_one() {\n\t\t$this -> autoRender = false;\n\t\tConfigure::write('debug', 0);\n\t\tset_time_limit(0);\n\t\t$this -> Keyword -> recursive = -1;\n\t\t$keyword = $this -> Keyword -> find('first', array('conditions' => array('Keyword.Enabled' => 1, 'Keyword.ID' => $this -> request -> data['keyID'])));\n\n\t\tif ($keyword != false) {\n\t\t\tif ($keyword['Keyword']['Strict'] == 1) {\n\t\t\t\t$domain = $this -> Rank -> remainUrl($keyword['Keyword']['Url']);\n\t\t\t} else {\n\t\t\t\t$domain = $this -> Rank -> remainDomain($keyword['Keyword']['Url']);\n\t\t\t}\n\t\t}\n\n\t\t$engine = $keyword['Keyword']['Engine'];\n\n\t\tif ($engine == 3) {\n\t\t\t$rank = $this -> Rank -> keyWordRank('google_jp', $domain, $keyword['Keyword']['Keyword'], $keyword['Keyword']['Strict'], $keyword['Keyword']['g_local']) \n\t\t\t.'/' \n\t\t\t. $this -> Rank -> keyWordRank('yahoo_jp', $domain, $keyword['Keyword']['Keyword'], $keyword['Keyword']['Strict'], $keyword['Keyword']['g_local']);\n\t\t} elseif ($engine == 1) {\n\t\t\t$rank = $this -> Rank -> keyWordRank('google_jp', $domain, $keyword['Keyword']['Keyword'], $keyword['Keyword']['Strict'], $keyword['Keyword']['g_local']);\n\t\t} elseif ($engine == 2) {\n\t\t\t$rank = $this -> Rank -> keyWordRank('yahoo_jp', $domain, $keyword['Keyword']['Keyword'], $keyword['Keyword']['Strict'], $keyword['Keyword']['g_local']);\n\t\t} else { // end\n\t\t\t$engine_list = Configure::read('ENGINES');\n\t\t\t$rank = $this -> Rank -> keyWordRank($engine_list[$engine]['Name'], $domain, $keyword['Keyword']['Keyword'], $keyword['Keyword']['Strict'], $keyword['Keyword']['g_local']);\n\t\t}\n\n\t\t// delete Rankhistory current date\n\t\t$this -> Keyword -> Rankhistory -> deleteAll(array('Rankhistory.KeyID' => $keyword['Keyword']['ID'], 'Rankhistory.RankDate' => date('Ymd')));\n\n\t\t// insert Rankhistory current date\n\t\t$rankhistory['Rankhistory']['KeyID'] = $keyword['Keyword']['ID'];\n\t\t$rankhistory['Rankhistory']['Url'] = $domain;\n\t\t$rankhistory['Rankhistory']['Rank'] = $rank;\n\t\t$rankhistory['Rankhistory']['RankDate'] = date('Ymd');\n\n\t\t// check color and arrow\n\t\t$check_params = array();\n\t\t$rankDate = date('Ymd', strtotime(date('Y-m-d') . '-1 day'));\n\t\t$data_rankhistory = Cache::read($keyword['Keyword']['ID'] . '_' . $rankDate, 'Rankhistory');\n\n\t\t$this -> loadModel('Rankhistory');\n\t\tif (!$data_rankhistory) {\n\t\t\t$data_rankhistory = $this -> Rankhistory -> find('first', array('fields' => array('Rankhistory.Rank'), 'conditions' => array('Rankhistory.KeyID' => $keyword['Keyword']['ID'], 'Rankhistory.RankDate' => $rankDate)));\n\t\t\tCache::write($keyword['Keyword']['ID'] . '_' . $rankDate, $rankhistory, 'Rankhistory');\n\t\t}\n\n\t\tif (isset($data_rankhistory['Rankhistory']['Rank']) && strpos($data_rankhistory['Rankhistory']['Rank'], '/')) {\n\t\t\t$rank_old = explode('/', $data_rankhistory['Rankhistory']['Rank']);\n\t\t} elseif (isset($data_rankhistory['Rankhistory']['Rank']) && !strpos($data_rankhistory['Rankhistory']['Rank'], '/')) {\n\t\t\t$rank_old[0] = $data_rankhistory['Rankhistory']['Rank'];\n\t\t\t$rank_old[1] = $data_rankhistory['Rankhistory']['Rank'];\n\t\t} else {\n\t\t\t$rank_old[0] = 0;\n\t\t\t$rank_old[1] = 0;\n\t\t}\n\n\t\tif ($engine == 1) {\n\t\t\t$rank = $rank . '/' . $rank;\n\t\t}\n\n\t\tif ($engine == 2) {\n\t\t\t$rank = $rank . '/' . $rank;\n\t\t}\n\n\t\tif (!empty($rank) && strpos($rank, '/')) {\n\t\t\t$rank_new = explode('/', $rank);\n\t\t} else {\n\t\t\t$rank_new[0] = 0;\n\t\t\t$rank_new[1] = 0;\n\t\t}\n\n\t\t// color\n\t\tif ($rank_new[0] >= 1 && $rank_new[0] <= 10 || $rank_new[1] >= 1 && $rank_new[1] <= 10) {\n\t\t\t$check_params['color'] = '#E4EDF9';\n\t\t} else if ($rank_old[0] >= 1 && $rank_old[0] <= 10 && $rank_new[0] > 10 || $rank_old[1] >= 1 && $rank_old[1] <= 10 && $rank_new[1] > 10) {\n\t\t\t$check_params['color'] = '#FFBFBF';\n\t\t} else if ($rank_new[0] > 10 && $rank_new[0] <= 20 || $rank_new[1] > 10 && $rank_new[1] <= 20) {\n\t\t\t$check_params['color'] = '#FAFAD2';\n\t\t} else {\n\t\t\t$check_params['color'] = '';\n\t\t}\n\n\t\t// arrow\n\t\tif (($rank_new[0] > $rank_old[0] && $rank_old[0] !=0) || ($rank_new[1] > $rank_old[1] && $rank_old[1] !=0) || ($rank_new[0] == 0 && $rank_old[0] != 0) || ($rank_new[1] == 0 && $rank_old[1] != 0)) {\n\t\t\t$check_params['arrow'] = '<span class=\"red-arrow\">↓</span>';\n\t\t} else if (($rank_new[0] < $rank_old[0]) || ($rank_new[1] < $rank_old[1]) || ($rank_old[0] == 0 && $rank_new[0] != 0)) {\n\t\t\t$check_params['arrow'] = '<span class=\"blue-arrow\">↑</span>';\n\t\t} else {\n\t\t\t$check_params['arrow'] = '';\n\t\t}\n\n\t\t$rankhistory['Rankhistory']['params'] = json_encode($check_params);\n\t\t$this -> Keyword -> Rankhistory -> create();\n\t\t$this -> Keyword -> Rankhistory -> save($rankhistory);\n\n\t\t$duration = $this -> Keyword -> Duration -> find('first', array('fields' => array('Duration.StartDate'), 'conditions' => array('Duration.KeyID' => $keyword['Keyword']['ID'], 'Duration.Flag' => 2), 'order' => 'Duration.ID'));\n\n\t\tif ($duration == false) {\n\t\t\tif (strpos($rank, '/') !== false) {\n\t\t\t\t$ranks = explode('/', $rank);\n\t\t\t\t$google_rank = $ranks[0];\n\t\t\t\t$yahoo_rank = $ranks[1];\n\t\t\t}\n\n\t\t\tif (($google_rank > 0 && $google_rank <= 10) || ($yahoo_rank > 0 && $yahoo_rank <= 10) || ($rank > 0 && $rank <= 10)) {\n\t\t\t\t$durations['Duration']['KeyID'] = $keyword['Keyword']['ID'];\n\t\t\t\t$durations['Duration']['StartDate'] = date('Ymd');\n\t\t\t\t$durations['Duration']['EndDate'] = 0;\n\t\t\t\t$durations['Duration']['Flag'] = 2;\n\t\t\t\t$this -> Keyword -> Duration -> create();\n\t\t\t\t$this -> Keyword -> Duration -> save($durations);\n\t\t\t}\n\t\t\tsleep(1);\n\t\t}\n\t\t$this->Security->SystemLog(array('Load Rank One', $data_rankhistory['Rankhistory']['Rank'], $rankhistory['Rankhistory']['Rank'], $this->Session->read('Auth.User.user.email'), $this->here));\n\t}",
"abstract protected function getRankingName();",
"function GetPositionOnPage($url, &$result) \n\t{\n\t\t$rank = new SearchRank();\n\t\t$counter = 0;\n\t\t\n\t\tforeach ($result->resultElements as $element) \n\t\t{\n\t\t\t$counter++;\n\t\t\t//print \"<div>$url :: $counter = \".$element->URL.\"</div>\";\n\t\t\t$normalizedurl = str_replace(\"/\",\"\\\\/\", $url);\n\t\t\t\n\t\t\tif ($rank->Position == 0 && preg_match(\"/$normalizedurl/i\", $element->URL)) \n\t\t\t{\n\t\t\t\t$rank->Position = (int)$counter;\n\t\t\t\t$rank->Title = $element->title;\n\t\t\t\t$rank->Snippet = $element->snippet;\n\t\t\t\t$rank->Url = $element->URL;\n\t\t\t}\n\t\t}\n\n\t\treturn $rank;\n\t}",
"function updateRanks($pdo, $kw, $asin) {\n $isFound = false;\n // If $kw has any spaces, change them to + for insertion into URL\n $kw = str_replace(' ', '+', $kw);\n $kwrank = 0;\n $pageNum = 1;\n\n // Query exact long title of $asin from db and assign to $sellerListingTitle\n $sql = \"SELECT prod_title FROM asins WHERE asin='$asin'\";\n $sellerListingTitle = $pdo->query($sql)->fetch(PDO::FETCH_ASSOC)['prod_title'];\n\n while (!$isFound) {\n $products = getProductsOnPage($pageNum, $kw);\n $x = findOnPage($products, $sellerListingTitle);\n if ($pageNum == 10) {\n $kwrank = 180;\n break;\n }\n // If product was found, then $kwrank = $x[1];\n if ($x[0] == true) {\n $kwrank = $x[1];\n $isFound = true;\n break;\n }\n // If product wasn't found on this page\n else {\n $pageNum++;\n }\n }\n\n // Change kw back to spaces\n $kwSpaces = str_replace('+', ' ', $kw);\n\n // Figure out what kw_id for current keyword is\n $sql = \"SELECT kw_id FROM keywords WHERE keyword='$kwSpaces'\";\n $kw_id = $pdo->query($sql)->fetch(PDO::FETCH_ASSOC)['kw_id'];\n\n if ($pageNum >= 10) {\n // Before returning rank, insert rank into 'oldranks'\n $sql = \"INSERT INTO oldranks (page, rank, kw_id) VALUES (:pageNum, :kwrank, :kw_id)\";\n $stmt = $pdo->prepare($sql);\n $stmt->execute(array(\n ':pageNum' => $pageNum,\n ':kwrank' => $kwrank,\n ':kw_id' => $kw_id\n ));\n return ['10+', '>240'];\n } else {\n // Before returning rank, insert rank into 'oldranks'\n $sql = \"INSERT INTO oldranks (page, rank, kw_id) VALUES (:pageNum, :kwrank, :kw_id)\";\n $stmt = $pdo->prepare($sql);\n $stmt->execute(array(\n ':pageNum' => $pageNum,\n ':kwrank' => $kwrank,\n ':kw_id' => $kw_id\n ));\n return [$pageNum, $kwrank];\n }\n}"
] | {
"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.