query
stringlengths 10
8.11k
| document
stringlengths 17
398k
| negatives
sequencelengths 19
20
| metadata
dict |
---|---|---|---|
Reload the redirection information from the session | function reloadSessionState() {
@$state =& $_SESSION[$this->xoBundleIdentifier];
if ( $state ) {
if ( @$state['tmpDisallowRedirections'] ) {
$this->enableRedirections = false;
}
if ( !empty( $state['redirect_info'] ) ) {
foreach ( $state['redirect_info'] as $k => $v ) {
$_SERVER[ 'REDIRECT_' . $k ] = $v;
}
unset( $state['redirect_info'] );
$this->redirectMessage = $_SERVER['REDIRECT_ERROR_NOTES'];
}
}
} | [
"public function reload()\n\t{\n\t\t$this->redirect($this->getRequest()->getRequestUri());\n\t}",
"public static function restore(){\n\t\tif($_SESSION['saved_url']){\n\t\t\t$url = $_SESSION['saved_url'];\n\n\t\t\tunset($_SESSION['saved_url']);\n\n\t\t\tself::redirect($url);\n\t\t}\n\t}",
"public function reload() {\n $this->init();\n redirect('./');\n }",
"public static function reload()\n\t{\n\t\t$strLocation = \\Environment::get('url') . \\Environment::get('requestUri');\n\n\t\t// Ajax request\n\t\tif (\\Environment::get('isAjaxRequest'))\n\t\t{\n\t\t\techo $strLocation;\n\t\t\texit;\n\t\t}\n\n\t\tif (headers_sent())\n\t\t{\n\t\t\texit;\n\t\t}\n\n\t\theader('Location: ' . $strLocation);\n\t\texit;\n\t}",
"private static function reload()\n\t{\n\t\theader(\"Location: {$_SERVER['REQUEST_SCHEME']}://{$_SERVER['SERVER_NAME']}/\");\n\t\texit();\n\t}",
"public function refreshSession() {\n\t\tif(!is_null($this->userData)) {\n\t\t\t$_SESSION[\"userData\"] = $this->userData;\n\t\t}\n\t}",
"protected function prepareRedirect() {\n \\CodingMs\\Ftm\\Utility\\Console::log('BaseController->prepareRedirect()');\n \n // Nachrichten merken\n $this->session['flashMessages'] = $this->messages;\n \n // Vor dem Redirect noch schnell die Logs&Nachrichten in der Session merken\n // $sessionHandler = \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::makeInstance('CodingMs\\Ftm\\Domain\\Session\\SessionHandler');\n // $session = $sessionHandler->restoreFromSession();\n $this->session['consoleRows'] = \\CodingMs\\Ftm\\Utility\\Console::getAndClearConsoleRows();\n $this->sessionHandler->writeToSession($this->session);\n \n }",
"function ReloadPage()\n\t{\n\t\theader(\"Location: \" . explode(\"?\", $_SERVER[REQUEST_URI])[0], true, 302);\n\t}",
"private function maybeSaveHttpRefererInSession(): void\n {\n if ($this->http_request->server->has('HTTP_REFERER')) {\n $this->session->set('shop_back_url', $this->http_request->server->get('HTTP_REFERER'));\n }\n }",
"public function recreateSession ()\n\t{\n\t\t$_SESSION['loggedIn'] = false;\n\t}",
"private function redir($redir)\n {\n if (isset($_SESSION['user'])) {\n Debugger::getBar()->addPanel(new \\GodsDev\\MyCMS\\Tracy\\BarPanelTemplate('User: ' . $_SESSION['user'], $_SESSION));\n }\n $sqlStatementsArray = $this->MyCMS->dbms->getStatementsArray();\n if (!empty($sqlStatementsArray)) {\n Debugger::getBar()->addPanel(new \\GodsDev\\MyCMS\\Tracy\\BarPanelTemplate('SQL: ' . count($sqlStatementsArray), $sqlStatementsArray));\n }\n $this->MyCMS->logger->info(\"Redir to {$redir} with SESSION[language]={$_SESSION['language']}\");\n header(\"Location: {$redir}\", true, 301); // For SEO 301 is much better than 303\n header('Connection: close');\n die('<script type=\"text/javascript\">window.location=' . json_encode($redir) . \";</script>\\n\"\n . '<a href=' . urlencode($redir) . '>→</a>'\n );\n }",
"public function saveReferer()\n {\n $_SESSION[static::ORIGIN_URL] = $_SERVER[static::ORIGIN_URL];\n\n }",
"public function refresh()\n {\n $this->set('refresh', time() + self::REFRESH);\n $this->set('expires', time() + self::EXPIRES);\n\n session_regenerate_id();\n }",
"public static function rememberRequestedPage(): void\n\t{\n\t\t$_SESSION['return_to'] = $_SERVER['REQUEST_URI'];\n\t}",
"public function reSession()\n\t{\n\t\tcurl_close($this->ch);\n\t\t$this->init($this->proxies, '', $this->cookiesfile, $this->auto_proxy, $this->throw_proxy_error);\t\t\n\t}",
"public function resetSessionPostLoginUrl()\n {\n $this->session->remove(static::POSTLOGIN_SESSION_KEY);\n }",
"private function _Set_object_for_session_expired(){\n $this->_response_data[\"result\"] = FALSE;\n $this->_response_data[\"redirectUrl\"] = \"./?sess_expired=true\";\n }",
"public static function saveRequest() {\r\n\t\t// save the current url into the session\r\n\t\t$url = Zend_Controller_Front::getInstance()->getRequest()->getRequestUri(); // or $_SERVER['REQUEST_URI'];\r\n\t\t$session = new Zend_Session_Namespace('Petolio_Redirect');\r\n\t\t$session->redirect = $url;\r\n\t}",
"public function redirected() {\n\t\t$base_url = HOSTNAME_REDIRECT.'/go';\n\t\t$base_url.= '/'.$this->request->query['prid'].'-'.$this->request->query['pk'];\n\t\t$this->redirect($base_url.'/?pid='.$this->request->query['pid'].'&uid='.$this->request->query['uid']);\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Removes an item from the list by identifier. This method removes all the items that were found with the given id. Please note that if no id is provided on the item it won't have any effect at all! | public function removeItem($id)
{
$this->items = $this->items->reject(function ($item) use (&$id) {
if (isset($item['id']) && $item['id'] === $id) {
return true;
}
return false;
});
} | [
"public function removeItem($id) {\r\n unset($this->items[$id]);\r\n return $this->saveBasket();\r\n }",
"public function removeItem($id){\n $this->totalQty -= $this->items[$id]['qty'];\n $this->totalPrice -= $this->items[$id]['price'];\n\n unset($this->items[$id]);\n }",
"function removeItem($id) {\n\t\tglobal $dbConn;\n\t\t$this->loadItems();\n\t\t$id = intval($id); //Remove zerofill\n\t\tif (isset($this->items[$id])) {\n\t\t\tunset($this->items[$id]);\n\t\t\t$this->change = true;\n\t\t\treturn $dbConn->query('DELETE FROM `basket_items` WHERE item_id=' . $id . ' AND basket_id=' . $this->id . ' LIMIT 1');\n\t\t}\n\t}",
"public function removeById($id);",
"public function removeitem($item);",
"public function removeItem($a_id)\r\n\t{\r\n\t\tforeach(array_keys($this->items) as $item_id)\r\n\t\t{\r\n\t\t\tif(array_pop(explode(self::UNIQUE_SEPARATOR, $item_id)) == $a_id)\r\n\t\t\t{\r\n\t\t\t\tunset($this->items[$item_id]);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tforeach($this->block_items as $block_id => $items)\r\n\t\t{\r\n\t\t\tforeach($items as $idx => $item_id)\r\n\t\t\t{\r\n\t\t\t\tif(array_pop(explode(self::UNIQUE_SEPARATOR, $item_id)) == $a_id)\r\n\t\t\t\t{\t\t\r\n\t\t\t\t\tunset($this->block_items[$block_id][$idx]);\r\n\t\t\t\t\tif(!sizeof($this->block_items[$block_id]))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tunset($this->block_items[$block_id]);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"public function delete() {\r\n\tunset(Item::$rawItems[$this->idItem]);\r\n}",
"public function delete() {\r\n\t\tunset(Item::$rawItems[$this->idItem]);\r\n\t}",
"public function remove($id);",
"public function remove($item);",
"public function remove( $item );",
"public function removeOnId($id)\n {\n }",
"public function removeById($id)\n {\n }",
"public function getRemoveitem($identifier) {\n //get reference to item object\n $item = Cart::item($identifier);\n //delete it\n $item->remove();\n //go back to the cart\n return Redirect::to('store/cart');\n }",
"function removeByID($itemID) {\n\t if(!is_numeric($itemID)) throw new InvalidArgumentException(\"ManyManyList::removeById() expecting an ID\");\n\n\t\t$query = new SQLQuery(\"*\", array(\"\\\"$this->joinTable\\\"\"));\n\t\t$query->delete = true;\n\t\t\n\t\tif($filter = $this->foreignIDFilter()) {\n\t\t\t$query->where($filter);\n\t\t} else {\n\t\t\tuser_error(\"Can't call ManyManyList::remove() until a foreign ID is set\", E_USER_WARNING);\n\t\t}\n\t\t\n\t\t$query->where(\"\\\"$this->localKey\\\" = {$itemID}\");\n\t\t$query->execute();\n\t}",
"public function deleteById($item_id);",
"public function removeItem($item)\n {\n $nb_index_id = nb_getMixedValue($item, $this->index_field);\n if ((is_numeric($nb_index_id) || nb_isValidGUID($nb_index_id)) && $this->containsKey($nb_index_id)) {\n unset($this->list[$nb_index_id]);\n $this->removeItemIndex($item);\n }\n }",
"public function remove ($id) {\n\t\tunset($this->_map[$id]);\n\t}",
"function removeId($id)\n {\n if ($sz = func_num_args()) {\n for ($i = 0; $i < $sz && sizeof($this->mIds); $i++) {\n $ids = func_get_arg($i);\n if (FALSE === is_array($ids)) {\n if (dp_strlen($ids) && isset($this->mIds[$ids])) {\n unset($this->mIds[$ids]);\n }\n } else {\n foreach ($ids as $id) {\n if (dp_strlen($id) && isset($this->mIds[$id])) {\n unset($this->mIds[$id]);\n }\n }\n }\n }\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Siawood_Products_Plugin constructor. It defines related constant, include autoloader class, register activation hook, deactivation hook and uninstall hook and call Core class to run dependencies for plugin | public function __construct() {
/*Define Autoloader class for plugin*/
$autoloader_path = 'includes/class-autoloader.php';
/**
* Include autoloader class to load all of classes inside this plugin
*/
require_once trailingslashit( plugin_dir_path( __FILE__ ) ) . $autoloader_path;
/*Define required constant for plugin*/
Constant::define_constant();
/**
* Register activation hook.
* Register activation hook for this plugin by invoking activate
* in Siawood_Products_Plugin class.
*
* @param string $file path to the plugin file.
* @param callback $function The function to be run when the plugin is activated.
*/
register_activation_hook(
__FILE__,
function () {
$this->activate(
new Activator( intval( get_option( 'last_plugin_name_dbs_version' ) ) )
);
}
);
/**
* Register deactivation hook.
* Register deactivation hook for this plugin by invoking deactivate
* in Siawood_Products_Plugin class.
*
* @param string $file path to the plugin file.
* @param callback $function The function to be run when the plugin is deactivated.
*/
register_deactivation_hook(
__FILE__,
function () {
$this->deactivate(
new Deactivator()
);
}
);
/**
* Register uninstall hook.
* Register uninstall hook for this plugin by invoking uninstall
* in Siawood_Products_Plugin class.
*
* @param string $file path to the plugin file.
* @param callback $function The function to be run when the plugin is uninstalled.
*/
register_uninstall_hook(
__FILE__,
array( 'Siawood_Products_Plugin', 'uninstall' )
);
} | [
"public function __construct() {\n\t\t/*Define Autoloader class for plugin*/\n\t\t$autoloader_path = 'includes/class-autoloader.php';\n\t\t/**\n\t\t * Include autoloader class to load all of classes inside this plugin\n\t\t */\n\t\trequire_once trailingslashit( plugin_dir_path( __FILE__ ) ) . $autoloader_path;\n\n\t\t/*Define required constant for plugin*/\n\t\tConstant::define_constant();\n\n\t\t/**\n\t\t * Register activation hook.\n\t\t * Register activation hook for this plugin by invoking activate\n\t\t * in Restaurant_Booking_Plugin class.\n\t\t *\n\t\t * @param string $file path to the plugin file.\n\t\t * @param callback $function The function to be run when the plugin is activated.\n\t\t */\n\t\tregister_activation_hook(\n\t\t\t__FILE__,\n\t\t\tfunction () {\n\t\t\t\t$this->activate(\n\t\t\t\t\tnew Activator()\n\t\t\t\t);\n\t\t\t}\n\t\t);\n\t\t/**\n\t\t * Register deactivation hook.\n\t\t * Register deactivation hook for this plugin by invoking deactivate\n\t\t * in Restaurant_Booking_Plugin class.\n\t\t *\n\t\t * @param string $file path to the plugin file.\n\t\t * @param callback $function The function to be run when the plugin is deactivated.\n\t\t */\n\t\tregister_deactivation_hook(\n\t\t\t__FILE__,\n\t\t\tfunction () {\n\t\t\t\t$this->deactivate(\n\t\t\t\t\tnew Deactivator()\n\t\t\t\t);\n\t\t\t}\n\t\t);\n\t\t/**\n\t\t * Register uninstall hook.\n\t\t * Register uninstall hook for this plugin by invoking uninstall\n\t\t * in Restaurant_Booking_Plugin class.\n\t\t *\n\t\t * @param string $file path to the plugin file.\n\t\t * @param callback $function The function to be run when the plugin is uninstalled.\n\t\t */\n\t\tregister_uninstall_hook(\n\t\t\t__FILE__,\n\t\t\tarray( 'Restaurant_Booking_Plugin', 'uninstall' )\n\t\t);\n\t}",
"public function __construct() {\n\n // Define all constant\n $this->define_constant();\n\n //includes file\n $this->includes();\n\n // init actions and filter\n $this->init_filters();\n $this->init_actions();\n\n // initialize classes\n $this->init_classes();\n\n do_action( 'starter_plugin_loaded', $this );\n }",
"public function __construct() {\n \t$this->_plugins = array();\n \t$this->_pluginsDir = $this->_getPluginsPath();\n \t$this->_registerPlugins();\n }",
"public function __construct() {\r\n\t\t\t$this->addons_includes();\r\n\t\t\t$this->init_hooks();\r\n\t\t\tdo_action( 'saaspik_addons_loaded' );\r\n\t\t\t\r\n\t\t}",
"function __construct(){\n\t\tif( file_exists( THEME_BASE .'/template_helpers/plugins/config.php' ) ) {\n\n\t\t\t// Include required files\n\t\t\t$this->includes();\n\n\t\t\t// Init the addons pages\n\t\t\tadd_action( 'tgmpa_register', array( &$this, 'init_plugin_installer' ) );\n\t\t\t//add_action( 'admin_menu', array( &$this, 'zn_remove_tgm_install_menu_item'), 9999 );\n\n\t\t\tnew ZnAddons();\n\n\t\t}\n\t}",
"static\tpublic \tfunction\tinit() {\n\t\t\t/**\n\t\t\t * Implement any processes that need to happen before the plugin is instantiated. \n\t\t\t */\n\t\t\t\n\t\t\t//Instantiate the plugin and return it. \n\t\t\treturn new self();\n\t\t}",
"public function __construct() {\n\n $this->plugin_slug = 'online-magazine';\n $this->version = '1.0.0';\n\n $this->load_dependencies();\n $this->define_admin_hooks();\n $this->define_public_hooks();\n\n }",
"public function __construct() {\n\n\t\t\tself::include_plugin_files();\n\t\t}",
"public function __construct()\r\n {\r\n parent::__construct();\r\n\r\n // load the OpenTBS plugin\r\n $this->Plugin(TBS_INSTALL, OPENTBS_PLUGIN);\r\n }",
"private function plugin_loader(){\n include dirname( __FILE__ ) . '/class-autoloader.php';\n ClassAutoloader::run();\n PluginLoader::get_instance( $this );\n }",
"public function __construct() {\n\t\t$this->defined();\n\t\t$this->includes();\n\n\t\t$this->CORE = THF_CCAPTCHA_PS_Core::init();\n\t\t$this->SHORTCODES = THF_CCAPTCHA_PS_Shortcodes::init();\n\n\t\tif ( is_admin() ) {\n\t\t\t$this->ADMIN = THF_CCAPTCHA_PS_Admin::init();\n\t\t}\n\n\t\t$this->load_hooks();\n\n\t\tadd_action( 'init', array( $this, 'localization_setup' ) );\n\t}",
"public function __construct()\r\n\t\t{\r\n\r\n\t\t\t$this->plugin = VIRAQUIZ_PLUGIN;\r\n\r\n\t\t}",
"public function init() {\n\t\tif ( ! $this->has_rights() ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Load core plugin.php if not exists\n\t\tif ( ! function_exists( 'is_plugin_active' ) ) {\n\t\t\tinclude_once ABSPATH . 'wp-admin/includes/plugin.php';\n\t\t}\n\n\t\t// Apply filters to extends the $this->plugins property\n\t\t$this->plugins = apply_filters( 'yoast_plugin_toggler_extend', $this->plugins );\n\n\t\t// First check if both versions of plugin do exist\n\t\t$this->check_plugin_versions_available();\n\n\t\t// Check which version is active\n\t\t$this->check_which_is_active();\n\n\t\t// Adding the hooks\n\t\t$this->add_hooks();\n\t}",
"public function init()\n {\n parent::init();\n self::$plugin = $this;\n\n // Do something after we're installed\n Event::on(\n Plugins::class,\n Plugins::EVENT_AFTER_INSTALL_PLUGIN,\n function (PluginEvent $event) {\n if ($event->plugin === $this) {\n // We were just installed\n $this->createFields();\n }\n }\n );\n\n Event::on(\n Plugins::class,\n Plugins::EVENT_AFTER_UNINSTALL_PLUGIN,\n function (PluginEvent $event) {\n if ( $event->plugin === $this ) {\n // We are uninstalled\n $this->removeFields();\n }\n }\n );\n\n Event::on(Gateways::class, Gateways::EVENT_REGISTER_GATEWAY_TYPES, function(RegisterComponentTypesEvent $event) {\n $event->types[] = TwoGateway::class;\n });\n\n Event::on(\n UrlManager::class,\n UrlManager::EVENT_REGISTER_SITE_URL_RULES,\n function (RegisterUrlRulesEvent $event) {\n $event->rules['commerce-two/return/'] = 'commerce-two/checkout';\n $event->rules['commerce-two/company-search/'] = 'commerce-two/checkout/company-search';\n $event->rules['commerce-two/company-address/'] = 'commerce-two/checkout/company-address';\n $event->rules['commerce-two/company-check/'] = 'commerce-two/checkout/is-company-allowed-for-payment';\n $event->rules['commerce-two/set-company/'] = 'commerce-two/checkout/set-company-on-cart';\n $event->rules['commerce-two/set-customer-addresses/'] = 'commerce-two/checkout/set-customer-addresses';\n }\n );\n\n\n Event::on(\n CraftVariable::class,\n CraftVariable::EVENT_INIT,\n function(Event $event) {\n $variable = $event->sender;\n $variable->set('twoPayment', CommerceTwoVariable::class);\n }\n );\n\n /**\n * Logging in Craft involves using one of the following methods:\n *\n * Craft::trace(): record a message to trace how a piece of code runs. This is mainly for development use.\n * Craft::info(): record a message that conveys some useful information.\n * Craft::warning(): record a warning message that indicates something unexpected has happened.\n * Craft::error(): record a fatal error that should be investigated as soon as possible.\n *\n * Unless `devMode` is on, only Craft::warning() & Craft::error() will log to `craft/storage/logs/web.log`\n *\n * It's recommended that you pass in the magic constant `__METHOD__` as the second parameter, which sets\n * the category to the method (prefixed with the fully qualified class name) where the constant appears.\n *\n * To enable the Yii debug toolbar, go to your user account in the AdminCP and check the\n * [] Show the debug toolbar on the front end & [] Show the debug toolbar on the Control Panel\n *\n * http://www.yiiframework.com/doc-2.0/guide-runtime-logging.html\n */\n Craft::info(\n Craft::t(\n 'commerce-two',\n '{name} plugin loaded',\n ['name' => $this->name]\n ),\n __METHOD__\n );\n\n }",
"public function init()\n {\n parent::init();\n self::$plugin = $this;\n\n $this->_registerLogger();\n $this->_redirectAfterInstall();\n $this->_registerEvents();\n\n }",
"public function __construct()\r\n {\r\n $this->pluginLoader = new Zend_Loader_PluginLoader();\r\n }",
"public function __construct() {\n\n\t\t$this->plugin_name = 'wp-primary-category';\n\t\t$this->version = '1.0.0';\n\t\t$this->option_name = 'wp_primary_category_';\n\n\t\t$this->load_dependencies();\n\t\t$this->set_locale();\n\t\t$this->enqueue_assets();\n\t\t$this->render_ui();\n\n\t}",
"public function init()\n {\n parent::init();\n self::$plugin = $this;\n\n // Register our fields\n Event::on(\n Fields::className(),\n Fields::EVENT_REGISTER_FIELD_TYPES,\n function (RegisterComponentTypesEvent $event) {\n $event->types[] = StarsField::class;\n $event->types[] = ColoursField::class;\n $event->types[] = TextSizeField::class;\n $event->types[] = ButtonsField::class;\n $event->types[] = WidthField::class;\n $event->types[] = TriggersField::class;\n }\n );\n\n // Do something after we're installed\n Event::on(\n Plugins::className(),\n Plugins::EVENT_AFTER_INSTALL_PLUGIN,\n function (PluginEvent $event) {\n if ($event->plugin === $this) {\n // We were just installed\n }\n }\n );\n\n/**\n * Logging in Craft involves using one of the following methods:\n *\n * Craft::trace(): record a message to trace how a piece of code runs. This is mainly for development use.\n * Craft::info(): record a message that conveys some useful information.\n * Craft::warning(): record a warning message that indicates something unexpected has happened.\n * Craft::error(): record a fatal error that should be investigated as soon as possible.\n *\n * Unless `devMode` is on, only Craft::warning() & Craft::error() will log to `craft/storage/logs/web.log`\n *\n * It's recommended that you pass in the magic constant `__METHOD__` as the second parameter, which sets\n * the category to the method (prefixed with the fully qualified class name) where the constant appears.\n *\n * To enable the Yii debug toolbar, go to your user account in the AdminCP and check the\n * [] Show the debug toolbar on the front end & [] Show the debug toolbar on the Control Panel\n *\n * http://www.yiiframework.com/doc-2.0/guide-runtime-logging.html\n */\n Craft::info(Craft::t('buttonbox', '{name} plugin loaded', ['name' => $this->name]), __METHOD__);\n }",
"public function __construct ()\n {\n $this->pluginLoader = new Zend_Loader_PluginLoader();\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create request for operation 'getIntegrationsActionDraftTemplate' | protected function getIntegrationsActionDraftTemplateRequest($actionId, $fileName)
{
// verify the required parameter 'actionId' is set
if ($actionId === null || (is_array($actionId) && count($actionId) === 0)) {
throw new \InvalidArgumentException(
'Missing the required parameter $actionId when calling getIntegrationsActionDraftTemplate'
);
}
// verify the required parameter 'fileName' is set
if ($fileName === null || (is_array($fileName) && count($fileName) === 0)) {
throw new \InvalidArgumentException(
'Missing the required parameter $fileName when calling getIntegrationsActionDraftTemplate'
);
}
$resourcePath = '/api/v2/integrations/actions/{actionId}/draft/templates/{fileName}';
$formParams = [];
$queryParams = [];
$headerParams = [];
$httpBody = '';
$multipart = false;
// path params
if ($actionId !== null) {
$resourcePath = str_replace(
'{' . 'actionId' . '}',
ObjectSerializer::toPathValue($actionId),
$resourcePath
);
}
// path params
if ($fileName !== null) {
$resourcePath = str_replace(
'{' . 'fileName' . '}',
ObjectSerializer::toPathValue($fileName),
$resourcePath
);
}
// body params
$_tempBody = null;
if ($multipart) {
$headers = $this->headerSelector->selectHeadersForMultipart(
['text/plain']
);
} else {
$headers = $this->headerSelector->selectHeaders(
['text/plain'],
['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\build_query($formParams);
}
}
// this endpoint requires OAuth (access token)
if ($this->config->getAccessToken() !== null) {
$headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
}
$defaultHeaders = [];
if ($this->config->getUserAgent()) {
$defaultHeaders['User-Agent'] = $this->config->getUserAgent();
}
$headers = array_merge(
$defaultHeaders,
$headerParams,
$headers
);
$query = \GuzzleHttp\Psr7\build_query($queryParams);
return new Request(
'GET',
$this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
} | [
"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 getIntegrationsActionTemplateRequest($actionId, $fileName)\n {\n // verify the required parameter 'actionId' is set\n if ($actionId === null || (is_array($actionId) && count($actionId) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $actionId when calling getIntegrationsActionTemplate'\n );\n }\n // verify the required parameter 'fileName' is set\n if ($fileName === null || (is_array($fileName) && count($fileName) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $fileName when calling getIntegrationsActionTemplate'\n );\n }\n\n $resourcePath = '/api/v2/integrations/actions/{actionId}/templates/{fileName}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($actionId !== null) {\n $resourcePath = str_replace(\n '{' . 'actionId' . '}',\n ObjectSerializer::toPathValue($actionId),\n $resourcePath\n );\n }\n // path params\n if ($fileName !== null) {\n $resourcePath = str_replace(\n '{' . 'fileName' . '}',\n ObjectSerializer::toPathValue($fileName),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['text/plain']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['text/plain'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n \n if($headers['Content-Type'] === 'application/json') {\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n // array has no __toString(), so we should encode it manually\n if(is_array($httpBody)) {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));\n }\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires 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 testGetIntegrationsActionDraftTemplate()\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 deleteIntegrationsActionDraftRequest($actionId)\n {\n // verify the required parameter 'actionId' is set\n if ($actionId === null || (is_array($actionId) && count($actionId) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $actionId when calling deleteIntegrationsActionDraft'\n );\n }\n\n $resourcePath = '/api/v2/integrations/actions/{actionId}/draft';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($actionId !== null) {\n $resourcePath = str_replace(\n '{' . 'actionId' . '}',\n ObjectSerializer::toPathValue($actionId),\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 ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n \n if($headers['Content-Type'] === 'application/json') {\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n // array has no __toString(), so we should encode it manually\n if(is_array($httpBody)) {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));\n }\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires 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 'DELETE',\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 }",
"public function createRequestForGetTemplates(): RequestInterface\n {\n return $this->createRequest('GET', sprintf('/%1$s/templates', $this->getOptions()->getAccountId()), null, [], [], []);\n }",
"protected function postIntegrationsActionsDraftsRequest($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 postIntegrationsActionsDrafts'\n );\n }\n\n $resourcePath = '/api/v2/integrations/actions/drafts';\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 \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 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"protected function postIntegrationsActionDraftRequest($actionId)\n {\n // verify the required parameter 'actionId' is set\n if ($actionId === null || (is_array($actionId) && count($actionId) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $actionId when calling postIntegrationsActionDraft'\n );\n }\n\n $resourcePath = '/api/v2/integrations/actions/{actionId}/draft';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($actionId !== null) {\n $resourcePath = str_replace(\n '{' . 'actionId' . '}',\n ObjectSerializer::toPathValue($actionId),\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 ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n \n if($headers['Content-Type'] === 'application/json') {\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n // array has no __toString(), so we should encode it manually\n if(is_array($httpBody)) {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));\n }\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires 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 'POST',\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 }",
"public function getIntegrationsActionDraftTemplateWithHttpInfo($actionId, $fileName)\n {\n $returnType = 'string';\n $request = $this->getIntegrationsActionDraftTemplateRequest($actionId, $fileName);\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 case 400:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\PureCloudPlatform\\Client\\V2\\Model\\ErrorBody',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 401:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\PureCloudPlatform\\Client\\V2\\Model\\ErrorBody',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 403:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\PureCloudPlatform\\Client\\V2\\Model\\ErrorBody',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 404:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\PureCloudPlatform\\Client\\V2\\Model\\ErrorBody',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 413:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\PureCloudPlatform\\Client\\V2\\Model\\ErrorBody',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 415:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\PureCloudPlatform\\Client\\V2\\Model\\ErrorBody',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 429:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\PureCloudPlatform\\Client\\V2\\Model\\ErrorBody',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 500:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\PureCloudPlatform\\Client\\V2\\Model\\ErrorBody',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 503:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\PureCloudPlatform\\Client\\V2\\Model\\ErrorBody',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 504:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\PureCloudPlatform\\Client\\V2\\Model\\ErrorBody',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\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 }",
"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 voucherDraftsV2GetRequest()\n {\n\n $resourcePath = '/v2/voucherdrafts';\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', 'text/json', 'application/xml', 'text/xml']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json', 'text/json', 'application/xml', 'text/xml'],\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\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 createRequestForCreateTemplate(Template $template): RequestInterface\n {\n return $this->createRequest('POST', sprintf('/%1$s/templates', $this->getOptions()->getAccountId()), $template, [], [], []);\n }",
"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 retrieveMessageTemplatePreview($request)\n {\n return $this->start()->uri(\"/api/message/template/preview\")\n ->bodyHandler(new JSONBodyHandler($request))\n ->post()\n ->go();\n }",
"protected function getRecommendedTemplatesRequest()\n {\n\n $resourcePath = '/api/v1/template/recommended';\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 Bearer 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 }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the key for the first settings tab in the collection. | public static function firstSettingsTabKey()
{
return static::settingsTabs()->tabs[0]->key;
} | [
"public function get_settings_key() {\n\n return $this->settings_key;\n }",
"public function first_key()\r\n {\r\n reset($this->collection);\r\n return key($this->collection);\r\n }",
"public function firstKey()\n {\n return array_key_first($this->items);\n }",
"public function get_option_key() {\n return $this->plugin_id . $this->id . '_settings';\n }",
"public static function getFirstConfigKey()\n {\n return key(DB::$db_config);\n }",
"public function firstItem()\n {\n return $this->firstKey;\n }",
"public function get_setting_key(){\n\t\treturn $this->v_setting_key;\n\t}",
"public function key(){\n return $this->keys[$this->currentIndex];\n }",
"protected function getPreferenceKey()\n {\n $controller = (property_exists($this, 'controller') && $this->controller)\n ? $this->controller\n : $this;\n\n $uniqueId = (method_exists($this, 'getId')) ? $this->getId() : $controller->getId();\n\n // Removes Class name and \"Controllers\" directory\n $rootNamespace = Str::getClassId(Str::getClassNamespace(Str::getClassNamespace($controller)));\n\n // The controller action is intentionally omitted, preferences should be shared for all actions\n return $rootNamespace . '::' . strtolower(class_basename($controller)) . '.' . strtolower($uniqueId);\n }",
"public function getKey()\n {\n return Config::getKey(get_class($this->config));\n }",
"public function getSettingId()\n {\n if (array_key_exists(\"settingId\", $this->_propDict)) {\n return $this->_propDict[\"settingId\"];\n } else {\n return null;\n }\n }",
"public function key(): string\n {\n return (string)$this->subKeyNames[$this->pointer];\n }",
"public function getKey(){\n return $this->_section->key;\n }",
"public function key()\n {\n $current = $this->current();\n\n return is_null($current) ? null : $current->getKey();\n }",
"public static function get_tab()\n {\n $structure = RP_WCDPD_Settings::get_structure();\n\n // Check if we know tab identifier\n if (isset($_GET['tab']) && isset($structure[$_GET['tab']])) {\n return $_GET['tab'];\n }\n else {\n $array_keys = array_keys($structure);\n return array_shift($array_keys);\n }\n }",
"public function key () {\n\t\treturn $this->currentKey;\n\t}",
"public function key()\n {\n $key = current($this->pages);\n\n return $key === false ? null : $key;\n }",
"public function key(): mixed\n {\n return $this->allIteratorKeys[$this->currentIteratorKey] ?? null;\n }",
"public function key()\n {\n $this->exceptionIfEmpty();\n return $this->current->getIndex();\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The standard error if not empty, else the standard output | public function getStdErrOrOut() : string {
return empty($this->std_err) ? $this->std_out : $this->std_err;
} | [
"public function getErrorOutput();",
"public function clearErrorOutput();",
"public function stdErr($text) {\n\t\tfwrite(STDERR, $text.PHP_EOL);\n\t}",
"public function getStdErr(): string\n {\n return $this->cmdResult->getStdErr();\n }",
"public function testSendToStdErr()\n\t{\n\t\t$result = $this->error->sendToStdError();\n\t\t$this->assertTrue($result);\n\t\t$display = ini_get('display_errors');\n\t\t$this->assertEquals('stderr', $display);\n\t\t$this->assertEquals($display, $this->error->get());\n\t}",
"function util_cli_error($text, $errorcode=1) {\n fwrite(STDERR, $text);\n fwrite(STDERR, \"\\n\");\n die($errorcode);\n}",
"public function getErrorOutput()\n {\n return $this->pipes !== null ? stream_get_contents($this->pipes[2]) : false;\n }",
"public function addErr(string $output): void\n {\n $this->stdErr .= $output;\n }",
"protected function outErr($content)\n {\n $this->outOut($content);\n }",
"public function writeErrLine($text='') {\r\n $this->writeLine($text);\r\n }",
"public function sendError($output = -1) {\n if($this->isDebugging()) {\n echo 'Error: '. $output;\n }\n die;\n }",
"public function outputFriendlyError() {\n\t\tob_end_clean();\n\t\tview('errors/generic');\n\t\texit;\n\t}",
"public function errorOutput()\n {\n return $this->process->getErrorOutput();\n }",
"public function outputError() {\n\t\ttry {\n\t\t\t$this->response->sendError();\n\t\t} catch (\\Exception $exception) {\n\t\t\terror_log('Uncaught exception during error shutdown: ' . $exception->getMessage());\n\t\t\texit;\n\t\t}\n\t}",
"protected function error($message)\n {\n $this->output->writeln(\"<error>{$message}</error>\");\n }",
"public function writeErrLine($text='') {\r\n if (defined('STDERR') AND is_resource(STDERR)) {\r\n fwrite(STDERR, $this->getLine($text));\r\n } else {\r\n echo $this->getLine($text);\r\n }\r\n }",
"public function thereShouldBeNoOutput()\n {\n if ($this->getOutput() != \"\") {\n throw new \\Exception('Output has been detected: '.$this->getOutput());\n }\n }",
"public function error($string)\n {\n $this->output->writeln(\"<error>$string</error>\");\n }",
"public function updateErrors()\n\t\t{\n\t\t\tif(isset($this->pipes[self::STDERR]) and is_resource($this->pipes[self::STDERR]))\n\t\t\t{\n\t\t\t\t$this->result->write(self::STDERR, stream_get_contents($this->pipes[self::STDERR]));\n\t\t\t}\n\t\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Recupera el atributo df_nacimiento de PersonaGlobal | function getF_nacimiento()
{
if (!isset($this->df_nacimiento) && !$this->bLoaded) {
$this->DBCarregar();
}
if (empty($this->df_nacimiento)) {
return new web\NullDateTimeLocal();
}
$oConverter = new core\ConverterDate('date', $this->df_nacimiento);
return $oConverter->fromPg();
} | [
"public function getFechaNacimientoPersona(){\n return $this->fechaNacimientoPersona;\n }",
"public function getLocalidad_nac()\r\n\t{\r\n\t\treturn($this->localidad_nac);\r\n\t}",
"public function getNacimiento()\r\n {\r\n return $this->nacimiento;\r\n }",
"public function getFecha_nacimiento()\n {\n return $this->fecha_nacimiento;\n }",
"public function getFechaNacimiento()\n {\n return $this->fecha_nacimiento;\n }",
"public function getAgenciaCobradoraDac();",
"public function getDataNascimento() {\n return $this->dtNascimento;\n }",
"public function getDataOcorrencia() {\n\n return $this->dtOcorrencia;\n }",
"public function getFecha_nac()\r\n\t{\r\n\t\treturn($this->fecha_nac);\r\n\t}",
"public function getDataNascimento(){\n return $this->data_nascimento;\n }",
"public function getPersona_idpersona(){\n return $this->persona_idpersona;\n }",
"function dadosAtributo($iatributo_codigo){\n $sCampos=\" la25_i_codigo as codigo,\n la25_c_descr as nome,\n la25_c_estrutural as estrutural,\n la25_c_tipo as tipo,\n la25_i_nivel as nivel \";\n $sSql = cl_lab_atributo::sql_query($iatributo_codigo,$sCampos);\n $rResult = cl_lab_atributo::sql_record($sSql);\n if ($rResult != false) {\n \n \t$aResultado = db_utils::getColectionByRecord($rResult);\n \t$oResultado = new StdClass;\n $oResultado->codigo=$aResultado[0]->codigo;\n $oResultado->nome=$aResultado[0]->nome;\n $oResultado->estrutural=$aResultado[0]->estrutural;\n $oResultado->tipo=$aResultado[0]->tipo;\n $oResultado->nivel=$aResultado[0]->nivel;\n return $oResultado;\n \n }else{\n return false;\n }\n }",
"function dadosAtributo( $iatributo_codigo ) {\n\n $sCampos = \"la25_i_codigo as codigo, la25_c_descr as nome, la25_c_estrutural as estrutural, la25_c_tipo as tipo\";\n $sCampos .= \", la25_i_nivel as nivel \";\n $sSql = cl_lab_atributo::sql_query( $iatributo_codigo, $sCampos );\n $rResult = cl_lab_atributo::sql_record( $sSql );\n\n if( $rResult != false ) {\n\n \t$aResultado = db_utils::getCollectionByRecord($rResult);\n \t$oResultado = new StdClass;\n $oResultado->codigo = $aResultado[0]->codigo;\n $oResultado->nome = $aResultado[0]->nome;\n $oResultado->estrutural = $aResultado[0]->estrutural;\n $oResultado->tipo = $aResultado[0]->tipo;\n $oResultado->nivel = $aResultado[0]->nivel;\n\n return $oResultado;\n } else {\n return false;\n }\n }",
"public function getDataNascimento()\n {\n return $this->data_nascimento;\n }",
"public function getFecha_de_nacimiento()\n {\n return $this->fecha_de_nacimiento;\n }",
"public function getDataNascimento()\n {\n return $this->dataNascimento;\n }",
"public function getAgenciaCobradoraDac()\n {\n return $this->agencia_cobradora_dac;\n }",
"public function getDataNascimento()\n {\n return $this->DataNascimento;\n }",
"function grabarAtributo($atributo, $documento) {\n parent::ConnectionOpen(\"pnsMantenimientoDocumento\", \"dbweb\");\n parent::SetParameterSP(\"$1\", '06');\n parent::SetParameterSP(\"$2\", $documento);\n parent::SetParameterSP(\"$3\", $atributo);\n parent::SetParameterSP(\"$4\", '');\n parent::SetParameterSP(\"$5\", '');\n $resultado = parent::executeSPArrayX();\n return $resultado;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Operation updateNetworkWirelessSsidDeviceTypeGroupPoliciesAsync Update the device type group policies for the SSID | public function updateNetworkWirelessSsidDeviceTypeGroupPoliciesAsync($network_id, $number, $update_network_wireless_ssid_device_type_group_policies = null)
{
return $this->updateNetworkWirelessSsidDeviceTypeGroupPoliciesAsyncWithHttpInfo($network_id, $number, $update_network_wireless_ssid_device_type_group_policies)
->then(
function ($response) {
return $response[0];
}
);
} | [
"public function testUpdateNetworkWirelessSsidDeviceTypeGroupPolicies()\n {\n }",
"public function updateNetworkWirelessSsidDeviceTypeGroupPolicies($network_id, $number, $update_network_wireless_ssid_device_type_group_policies = null)\n {\n list($response) = $this->updateNetworkWirelessSsidDeviceTypeGroupPoliciesWithHttpInfo($network_id, $number, $update_network_wireless_ssid_device_type_group_policies);\n return $response;\n }",
"protected function updateNetworkWirelessSsidDeviceTypeGroupPoliciesRequest($network_id, $number, $update_network_wireless_ssid_device_type_group_policies = null)\n {\n // verify the required parameter 'network_id' is set\n if ($network_id === null || (is_array($network_id) && count($network_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $network_id when calling updateNetworkWirelessSsidDeviceTypeGroupPolicies'\n );\n }\n // verify the required parameter 'number' is set\n if ($number === null || (is_array($number) && count($number) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $number when calling updateNetworkWirelessSsidDeviceTypeGroupPolicies'\n );\n }\n\n $resourcePath = '/networks/{networkId}/wireless/ssids/{number}/deviceTypeGroupPolicies';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($network_id !== null) {\n $resourcePath = str_replace(\n '{' . 'networkId' . '}',\n ObjectSerializer::toPathValue($network_id),\n $resourcePath\n );\n }\n // path params\n if ($number !== null) {\n $resourcePath = str_replace(\n '{' . 'number' . '}',\n ObjectSerializer::toPathValue($number),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n if (isset($update_network_wireless_ssid_device_type_group_policies)) {\n $_tempBody = $update_network_wireless_ssid_device_type_group_policies;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n \n if($headers['Content-Type'] === 'application/json') {\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n // array has no __toString(), so we should encode it manually\n if(is_array($httpBody)) {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));\n }\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('X-Cisco-Meraki-API-Key');\n if ($apiKey !== null) {\n $headers['X-Cisco-Meraki-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 'PUT',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function updateNetworkWirelessSsidDeviceTypeGroupPoliciesAsyncWithHttpInfo($network_id, $number, $update_network_wireless_ssid_device_type_group_policies = null)\n {\n $returnType = 'object';\n $request = $this->updateNetworkWirelessSsidDeviceTypeGroupPoliciesRequest($network_id, $number, $update_network_wireless_ssid_device_type_group_policies);\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 updateNetworkWirelessSsidDeviceTypeGroupPoliciesWithHttpInfo($network_id, $number, $update_network_wireless_ssid_device_type_group_policies = null)\n {\n $returnType = 'object';\n $request = $this->updateNetworkWirelessSsidDeviceTypeGroupPoliciesRequest($network_id, $number, $update_network_wireless_ssid_device_type_group_policies);\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 'object',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function getNetworkWirelessSsidDeviceTypeGroupPolicies($network_id, $number)\n {\n list($response) = $this->getNetworkWirelessSsidDeviceTypeGroupPoliciesWithHttpInfo($network_id, $number);\n return $response;\n }",
"public function updatePolicies(string $sec, string $ptype, array $oldRules, array $newRules): void;",
"protected function getNetworkWirelessSsidDeviceTypeGroupPoliciesRequest($network_id, $number)\n {\n // verify the required parameter 'network_id' is set\n if ($network_id === null || (is_array($network_id) && count($network_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $network_id when calling getNetworkWirelessSsidDeviceTypeGroupPolicies'\n );\n }\n // verify the required parameter 'number' is set\n if ($number === null || (is_array($number) && count($number) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $number when calling getNetworkWirelessSsidDeviceTypeGroupPolicies'\n );\n }\n\n $resourcePath = '/networks/{networkId}/wireless/ssids/{number}/deviceTypeGroupPolicies';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($network_id !== null) {\n $resourcePath = str_replace(\n '{' . 'networkId' . '}',\n ObjectSerializer::toPathValue($network_id),\n $resourcePath\n );\n }\n // path params\n if ($number !== null) {\n $resourcePath = str_replace(\n '{' . 'number' . '}',\n ObjectSerializer::toPathValue($number),\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 ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n \n if($headers['Content-Type'] === 'application/json') {\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n // array has no __toString(), so we should encode it manually\n if(is_array($httpBody)) {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));\n }\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('X-Cisco-Meraki-API-Key');\n if ($apiKey !== null) {\n $headers['X-Cisco-Meraki-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 updateDeviceControlPoliciesAsync($body)\n {\n return $this->updateDeviceControlPoliciesAsyncWithHttpInfo($body)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function updateNetworkWirelessSsidTrafficShapingRulesAsync($network_id, $number, $update_network_wireless_ssid_traffic_shaping_rules = null)\n {\n return $this->updateNetworkWirelessSsidTrafficShapingRulesAsyncWithHttpInfo($network_id, $number, $update_network_wireless_ssid_traffic_shaping_rules)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function setPolicyType(?GroupPolicyType $value): void {\n $this->getBackingStore()->set('policyType', $value);\n }",
"private function saveWMTSEnabledLayers($data) {\n $arrEnabled = (isset($_POST['enabled'])) ? $_POST['enabled'] : Array();\n $policyID = $data['id'];\n $db = $this->getDbo();\n\n foreach ($arrEnabled as $physicalServiceID => $arrValues) {\n $query = $db->getQuery(true);\n $query->select('id');\n $query->from('#__sdi_physicalservice_policy');\n $query->where('physicalservice_id = ' . (int) $physicalServiceID);\n $query->where('policy_id = ' . (int) $policyID);\n\n $db->setQuery($query);\n\n try {\n $db->execute();\n $physicalservice_policy_id = $db->loadResult();\n } catch (JDatabaseException $e) {\n $je = new JException($e->getMessage());\n $this->setError($je);\n return false;\n }\n\n //disable all layers (only checked layer will be added)\n $query = $db->getQuery(true);\n $query->update('#__sdi_wmtslayer_policy')->set('enabled = 0')->where('physicalservicepolicy_id = ' . (int) $physicalservice_policy_id);\n $db->setQuery($query);\n\n try {\n $db->execute();\n } catch (JDatabaseException $e) {\n $je = new JException($e->getMessage());\n $this->setError($je);\n return false;\n }\n foreach ($arrValues as $layerID => $value) {\n $query = $db->getQuery(true);\n $query->select('p.id');\n $query->from('#__sdi_wmtslayer_policy p');\n $query->innerJoin('#__sdi_physicalservice_policy psp ON psp.id = p.physicalservicepolicy_id');\n $query->where('psp.physicalservice_id = ' . $physicalServiceID);\n $query->where('psp.policy_id = ' . $policyID);\n $query->where('p.identifier = ' . $query->quote($layerID));\n\n $db->setQuery($query);\n\n try {\n $db->execute();\n $num_result = $db->getNumRows();\n $wmtslayerpolicy_id = $db->loadResult();\n } catch (JDatabaseException $e) {\n $je = new JException($e->getMessage());\n $this->setError($je);\n return false;\n }\n\n if (0 == $num_result) {\n //create Wmts Layer Policy if don't exist\n $query = $db->getQuery(true);\n $columns = array('identifier', 'enabled', 'physicalservicepolicy_id');\n $values = array($query->quote($layerID), 1, $physicalservice_policy_id);\n $query->insert('#__sdi_wmtslayer_policy')\n ->columns($query->quoteName($columns))\n ->values(implode(',', $values));\n } else {\n $query = $db->getQuery(true);\n $query->update('#__sdi_wmtslayer_policy')\n ->set('enabled = 1')\n ->where(Array('id = ' . (int) $wmtslayerpolicy_id,\n ));\n }\n\n $db->setQuery($query);\n\n try {\n $db->execute();\n } catch (JDatabaseException $e) {\n $je = new JException($e->getMessage());\n $this->setError($je);\n return false;\n }\n }\n }\n return true;\n }",
"public function setMdmWindowsInformationProtectionPolicies(?array $value): void {\n $this->getBackingStore()->set('mdmWindowsInformationProtectionPolicies', $value);\n }",
"public function updatePolicies(string $sec, string $ptype, array $oldRules, array $newRules): void\n {\n $this->connection->getPdo()->beginTransaction();\n try {\n foreach ($oldRules as $i => $oldRule) {\n $this->updatePolicy($sec, $ptype, $oldRule, $newRules[$i]);\n }\n $this->connection->getPdo()->commit();\n } catch (Throwable $e) {\n $this->connection->getPdo()->rollback();\n throw $e;\n }\n }",
"public function updateFilteredPolicies(string $sec, string $ptype, array $newPolicies, int $fieldIndex, string ...$fieldValues): array\n {\n throw new NotImplementedException('not implemented');\n }",
"public function setWdacSupplementalPolicies(?array $value): void {\n $this->getBackingStore()->set('wdacSupplementalPolicies', $value);\n }",
"public function updatePolicies(string $sec, string $ptype, array $oldRules, array $newRules): void\n {\n $transaction = $this->casbinRule->getDb()->beginTransaction();\n try {\n foreach ($oldRules as $i => $oldRule) {\n $this->updatePolicy($sec, $ptype, $oldRule, $newRules[$i]);\n }\n $transaction->commit();\n } catch (\\Exception $e) {\n $transaction->rollBack();\n throw $e;\n }\n }",
"public function updateNetworkWirelessSsidIdentityPskAsync($network_id, $number, $identity_psk_id, $update_network_wireless_ssid_identity_psk = null)\n {\n return $this->updateNetworkWirelessSsidIdentityPskAsyncWithHttpInfo($network_id, $number, $identity_psk_id, $update_network_wireless_ssid_identity_psk)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function handle_update_options_request() {\n\t\t$option_group = filter_input( INPUT_POST, 'network_option_group', FILTER_SANITIZE_STRING );\n\n\t\t$this->verify_request( \"{$option_group}-network-options\" );\n\n\t\t$whitelist_options = Yoast_Network_Settings_API::get()->get_whitelist_options( $option_group );\n\n\t\tif ( empty( $whitelist_options ) ) {\n\t\t\tadd_settings_error( $option_group, 'settings_updated', __( 'You are not allowed to modify unregistered network settings.', 'wordpress-seo' ), 'error' );\n\n\t\t\t$this->terminate_request();\n\t\t\treturn;\n\t\t}\n\n\t\tforeach ( $whitelist_options as $option_name ) {\n\t\t\t$value = null;\n\t\t\tif ( isset( $_POST[ $option_name ] ) ) { // WPCS: CSRF ok.\n\t\t\t\t$value = sanitize_text_field( wp_unslash( $_POST[ $option_name ] ) ); // WPCS: CSRF ok.\n\t\t\t}\n\n\t\t\tWPSEO_Options::update_site_option( $option_name, $value );\n\t\t}\n\n\t\t$settings_errors = get_settings_errors();\n\t\tif ( empty( $settings_errors ) ) {\n\t\t\tadd_settings_error( $option_group, 'settings_updated', __( 'Settings Updated.', 'wordpress-seo' ), 'updated' );\n\t\t}\n\n\t\t$this->terminate_request();\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Optional. Specification of the discovery feature applied to data in this zone. Generated from protobuf field .google.cloud.dataplex.v1.Zone.DiscoverySpec discovery_spec = 103 [(.google.api.field_behavior) = OPTIONAL]; | public function setDiscoverySpec($var)
{
GPBUtil::checkMessage($var, \Google\Cloud\Dataplex\V1\Zone\DiscoverySpec::class);
$this->discovery_spec = $var;
return $this;
} | [
"public function setDiscoverySpec($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Cloud\\Dataplex\\V1\\Asset\\DiscoverySpec::class);\n $this->discovery_spec = $var;\n\n return $this;\n }",
"public function setDiscovery($var)\n {\n GPBUtil::checkMessage($var, \\Grafeas\\V1\\DiscoveryOccurrence::class);\n $this->writeOneof(13, $var);\n\n return $this;\n }",
"public function getDiscovery()\n {\n return $this->readOneof(15);\n }",
"public function setDiscoveryEndpoint($var)\n {\n GPBUtil::checkString($var, True);\n $this->discovery_endpoint = $var;\n\n return $this;\n }",
"public function getDiscoveryComment();",
"public function getDiscovery() {\n return $this->config->get('discovery');\n }",
"public function discovery()\n {\n return $this->discovery;\n }",
"public function addDiscoveryInfo($discoveryData);",
"public function setAllowDiscovery($var)\n {\n GPBUtil::checkBool($var);\n $this->allow_discovery = $var;\n\n return $this;\n }",
"public function setResourceSpec($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Cloud\\Dataplex\\V1\\Zone\\ResourceSpec::class);\n $this->resource_spec = $var;\n\n return $this;\n }",
"public function getDiscovery() {\n if( !$this->discovery ) {\n $response = $this->getFS('/.well-known/app-meta');\n $this->discovery = $response->getLinks();\n \n // If we're using the mock api, update the discovery links\n // so that they have the correct domain\n if( $this->reference == 'mock-api' ) {\n foreach($this->discovery as $rel => $link) {\n if($link->getTemplate()) {\n $this->discovery[$rel]->setTemplate(str_replace('https://familysearch.org', $this->baseUrl, $link->getTemplate()));\n }\n if($link->getHref()) {\n $this->discovery[$rel]->setHref(str_replace('https://familysearch.org', $this->baseUrl, $link->getHref()));\n }\n }\n }\n } \n return $this->discovery;\n }",
"public function setDiscovery(DiscoveryInterface $discovery) {\n $this->discovery = $discovery;\n }",
"public function getAllowDiscovery()\n {\n return $this->allow_discovery;\n }",
"public function setDiscoveryStatus($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Cloud\\Dataplex\\V1\\Asset\\DiscoveryStatus::class);\n $this->discovery_status = $var;\n\n return $this;\n }",
"public function setDiscovered($var)\n {\n GPBUtil::checkMessage($var, \\Grafeas\\V1beta1\\Discovery\\Discovered::class);\n $this->discovered = $var;\n\n return $this;\n }",
"public function getFirewallIPSecExemptionsAllowRouterDiscovery()\n {\n if (array_key_exists(\"firewallIPSecExemptionsAllowRouterDiscovery\", $this->_propDict)) {\n return $this->_propDict[\"firewallIPSecExemptionsAllowRouterDiscovery\"];\n } else {\n return null;\n }\n }",
"public function setAssetDiscoveryConfig($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Cloud\\SecurityCenter\\V1p1beta1\\OrganizationSettings\\AssetDiscoveryConfig::class);\n $this->asset_discovery_config = $var;\n\n return $this;\n }",
"public function storeDiscovery(ResourceDiscoveryInterface $discovery, array $options = array());",
"public function getDiscoveryService()\n {\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates a form to create a AsignacionesCV entity. | private function createCreateForm($id,AsignacionesCV $entity)
{
$form = $this->createForm(new AsignacionesCVType($id), $entity, array(
'action' => $this->generateUrl('asignacionescv_create',array('id' => $id)),
'method' => 'POST',
));
$form->add('submit', 'submit',
array('label' => 'GUARDAR',
'attr' => array('class' => 'btn btn-default')
));
return $form;
} | [
"private function createCreateForm(Cv $entity)\n {\n $form = $this->createForm(new CvType(), $entity, array(\n 'action' => $this->generateUrl('cv_create'),\n 'method' => 'POST',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Create'));\n\n return $form;\n }",
"public function create()\n {\n return view('estado_civils.create');\n }",
"private function createCreateForm(Cidades $entity)\n {\n $form = $this->createForm(new CidadesType(), $entity, array(\n 'action' => $this->generateUrl('cidades_create'),\n 'method' => 'POST',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Create'));\n\n return $form;\n }",
"private function createCreateForm(Cidade $entity)\n {\n\n $translated = $this->get('translator')->transChoice('txt.gravar',0,array(),'messagesCommonBundle');\n\n $form = $this->createForm(new CidadeType(), $entity, array(\n 'action' => $this->generateUrl('cidade_create'),\n 'method' => 'POST',\n ));\n\n $form->add('submit', 'submit', array('label' => $translated, 'attr' => array('class' => 'btn btn-primary btn-lg')));\n\n return $form;\n }",
"private function createCreateForm(AdmFechasCitas $entity)\r\n {\r\n $form = $this->createForm(new AdmFechasCitasType(), $entity, array(\r\n 'action' => $this->generateUrl('nocitafecha_create'),\r\n 'method' => 'POST',\r\n ));\r\n\r\n $form->add('submit', 'submit', array('label' => 'Agregar','attr'=>array('class'=>'btn btn-success btn-sm')));\r\n\r\n return $form;\r\n }",
"public function newAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $cintaVG = $em->getRepository('VideotecaBundle:CintasVirgenes')->find($id);\n $entity = new AsignacionesCV();\n $form = $this->createCreateForm($id,$entity);\n\n return $this->render('VideotecaBundle:AsignacionesCV:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'cintaVG' => $cintaVG,\n 'id' => $id\n ));\n }",
"private function createCreateForm(Casa $entity)\n {\n $form = $this->createForm(new CasaType(), $entity, array(\n 'action' => $this->generateUrl('casa_create'),\n 'method' => 'POST',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Create'));\n\n return $form;\n }",
"private function createCreateForm(Avisos $entity)\n {\n $form = $this->createForm(new AvisosType(), $entity, array(\n 'action' => $this->generateUrl('avisos_create'),\n 'method' => 'POST',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Crear nuevo aviso'));\n\n return $form;\n }",
"private function createCreateForm(Carrera $entity)\n {\n $form = $this->createForm(new CarreraType(), $entity, array(\n 'action' => $this->generateUrl('aulas_carrera_create'),\n 'method' => 'POST',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Crear','attr'=>array('class'=>'btn btn-default botonTabla')));\n $form->add('button', 'submit', array('label' => 'Volver a la lista','attr'=>array('formaction'=>'../carrera','formnovalidate'=>'formnovalidate','class'=>'btn btn-default botonTabla')));\n\n \n return $form;\n }",
"private function createCreateForm(Covoiturage $entity)\n {\n $form = $this->createForm(new CovoiturageType(), $entity, array(\n 'action' => $this->generateUrl('covoiturage_validate_first_step'),\n 'method' => 'POST',\n ));\n\n $form->add('continuer', 'submit', array('label' => 'Prochaine étape'));\n\n\n return $form;\n }",
"private function createCreateForm(CDeudas $entity) {\n $form = $this->createForm(new CDeudasType(), $entity, array(\n 'action' => $this->generateUrl('cdeudas_create'),\n 'method' => 'POST',\n ));\n\n //$form->add('submit', 'submit', array('label' => 'Create'));\n\n return $form;\n }",
"public function newAction()\n {\n $entity = new Asignaciones();\n $form = $this->createForm(new AsignacionesType(), $entity);\n\n return $this->render('TransporteBundle:Asignaciones:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }",
"private function createCreateForm(Cita $entity)\n {\n \n $form = $this->createForm(new CitaType(), $entity, array(\n 'action' => $this->generateUrl('recepcion_cita_create'),\n 'method' => 'POST',\n ));\n\n $form->add('submit', 'submit', array('label' => 'CREAR', 'attr' => array('class' => 'round button blue text-upper small-button')));\n\n return $form;\n }",
"private function createCreateForm(Caisse $entity)\n {\n $form = $this->createForm(new CaisseType(), $entity, array(\n 'action' => $this->generateUrl('com_caisse_create'),\n 'method' => 'POST',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Ajouter'));\n\n return $form;\n }",
"private function createCreateForm(Vacantes $entity)\n {\n $form = $this->createForm(new VacantesType('new',0), $entity, array(\n 'action' => $this->generateUrl('vacantes_create'),\n 'method' => 'POST',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Create'));\n\n return $form;\n }",
"public function createAction() {\n if (FALSE === $this->get('security.context')->isGranted('ROLE_NOTACTIVE')) {\n $this->getRequest()->getSession()->set('redirectUrl', $this->getRequest()->getRequestUri());\n return $this->redirect($this->generateUrl('login'));\n }\n //get the user object\n $user = $this->get('security.context')->getToken()->getUser();\n $entity = new CV();\n $entity->setUser($user);\n $request = $this->getRequest();\n $form = $this->createForm(new CVType(), $entity);\n $form->bindRequest($request);\n if ($form->isValid()) {\n $em = $this->getDoctrine()->getEntityManager();\n if(count($user->getCvs()) === 0){\n $entity->setIsActive(true);\n }\n $em->persist($entity);\n $em->flush();\n $request->getSession()->set('cvCreate', TRUE);\n //check if user have social acounts\n $userSocialAccounts = $user->getSocialAccounts();\n $container = $this->container;\n if ($userSocialAccounts) {\n $status = 'I just created my resume on InternJump, boy was it easy!';\n $link = $this->generateUrl('site_fb_homepage', array(), true);\n\n // check if have facebook\n if ($userSocialAccounts->isFacebookLinked()) {\n FacebookController::postOnUserWallAndFeedAction($userSocialAccounts->getFacebookId(), $userSocialAccounts->getAccessToken(), $status, null, null, $link, NULL);\n }\n\n // check if have twitter\n if ($userSocialAccounts->isTwitterLinked()) {\n TwitterController::twitt($status . ' ' . $link, $container->getParameter('consumer_key'), $container->getParameter('consumer_secret'), $userSocialAccounts->getOauthToken(), $userSocialAccounts->getOauthTokenSecret());\n }\n\n // check if have linkedin\n if ($userSocialAccounts->isLinkedInLinked()) {\n LinkedinController::linkedInShare($container->getParameter('linkedin_api_key'), $container->getParameter('linkedin_secret_key'), $userSocialAccounts->getLinkedinOauthToken(), $userSocialAccounts->getLinkedinOauthTokenSecret(), $status, $status, $status, $link, NULL);\n }\n }\n return $this->redirect($this->generateUrl('cv_skills', array('id' => $entity->getId())));\n }\n return $this->render('ObjectsInternJumpBundle:CV:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n\n ));\n }",
"public function newAction()\n {\n //Session\n $session = $this->getRequest()->getSession();\n \n //Seguridad\n $securityContext = $this->get('security.context');\n \n $em = $this->getDoctrine()->getManager(\"ms_haberes_web\");\n \n $entity = new Vacantes();\n $form = $this->createCreateForm($entity);\n\n return array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n );\n }",
"public function create()\n {\n return view('asistencias.create');\n }",
"private function createCreateForm(Academico $entity)\n {\n $securityContext = $this->container->get('security.context');\n\n $form = $this->createForm(new AcademicoType($securityContext), $entity, array(\n 'action' => $this->generateUrl('academico_create'),\n 'method' => 'POST',\n ));\n\n //$form->add('submit', 'submit', array('label' => 'Create'));\n\n return $form;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Unset url to allow local environment to receive callback for development testing | final private function unbindLocalUrl()
{
if (!app()->runningInConsole()) {
$baseUrl = request()->getBaseUrl();
}
$root = $baseUrl ?? config('app.url');
if (app()->environment() === "local") {
URL::forceRootUrl($root);
}
} | [
"public static function unsetTestURL() {\n URLHelper::$testURL = null;\n }",
"private function cleanUrl(): void\n {\n $this->url = array_filter($this->url);\n if (isset($this->url[1]) && strlen($this->url[1])) {\n $this->module = $this->url[1];\n unset($this->url[1]);\n }\n\n if (isset($this->url[2]) && strlen($this->url[2])) {\n $this->controller = $this->url[2];\n unset($this->url[2]);\n }\n\n if (isset($this->url[3]) && strlen($this->url[3])) {\n $this->action = $this->url[3];\n unset($this->url[3]);\n }\n }",
"public function removeURL() {\n if ( !empty($this->url) )\n unset($this->url);\n}",
"public function testDefaultCallbackUrl()\n {\n $httpClient = $this->_getHttpClientMock(null);\n\n $client = new Client($httpClient, '4pik3y');\n\n $this->assertEquals(null, $client->getCallbackUrl());\n }",
"public function testRpcChangeUrlInPreRequestProcess() {\n $this->changeUrlInPreRequestProcess($this->httpProvider, $this->rpcProvider);\n }",
"public function onRequestUrl( &$url )\n {\n $this->debug_info['onRequestUrl'] = 'url = ' . var_export( $url, TRUE );\n }",
"public function testNoMatchingURL() {\n\t\t$dispatcher = new SendgridWebhookDispatcher;\n\t\t$request = $this->getMock('CakeRequest', array('is'));\n\t\t$response = new CakeResponse;\n\n\t\t$request->expects($this->any())->method('is')->with('post')->will($this->returnValue(true));\n\t\t$request->url = 'other/thing';\n\t\t$event = new CakeEvent('Dispatcher.beforeDispatch', $this, compact('request', 'response'));\n\t\t$this->assertNull($dispatcher->beforeDispatch($event));\n\t\t$this->assertFalse($event->isStopped());\n\t}",
"protected function initCurrentUrl() {}",
"public function test_app_url_already_set_does_nothing(): void\n {\n // means we're in a build hook.\n\n putenv('PLATFORM_APPLICATION_NAME=test');\n putenv('PLATFORM_ENVIRONMENT=test');\n putenv('PLATFORM_PROJECT_ENTROPY=test');\n putenv('APP_URL=current');\n\n mapPlatformShEnvironment();\n\n $this->assertEquals('current', getenv('APP_URL'));\n }",
"public function removeUrl(): string;",
"public function onRequestUrl(&$url)\n\t{\n\t\t// cache some values\n\t\t$this->requestUrl = $url;\n\t}",
"private function set_url_complete() {\n $this->url = (\n isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on'\n ? \"https\"\n : \"http\"\n ) . \"://{$_SERVER['HTTP_HOST']}{$_SERVER['REQUEST_URI']}\";\n }",
"public function setRequestUrl($url) {}",
"public function testRejectAutomatchUrlUsingGET()\n {\n }",
"function setSyncUrl()\n {\n }",
"public function testPromoteAutomatchUrlUsingGET()\n {\n }",
"protected function setFallbackURL()\n {\n $this->setLocalPSLName($this->url);\n if (null === $this->url) {\n $this->url = file_exists(__DIR__ . $this->localPSL) ? $this->localPSL : $this->sourceURL;\n }\n }",
"public function testDemoteAutomatchUrlUsingGET()\n {\n }",
"public function testSettingValidCallbackUrl()\n {\n $httpClient = $this->_getHttpClientMock(null);\n\n $client = new Client($httpClient, '4pik3y');\n\n $this->assertEquals(null, $client->getCallbackUrl());\n\n $client->setCallbackUrl('http://www.mydomain.com/mypath');\n\n $this->assertEquals('http://www.mydomain.com/mypath', $client->getCallbackUrl());\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Nombre funcion:getMensaje Proposito:devuelve el mensaje que puede ser visto por el usuario Fecha creacion:12/05/2009 | function getMensaje(){
return $this->mensaje;
} | [
"function enviarMensaje($datos = array(), $id_usuario_destinatario) {\n global $textos, $sql, $sesion_usuarioSesion;\n\n $usuario = new Contacto();\n $destino = \"/ajax\".$usuario->urlBase.\"/sendMessage\";\n\n if (empty($datos)) {\n \n $nombre = $sql->obtenerValor(\"lista_usuarios\", \"nombre\", \"id = '\".$id_usuario_destinatario.\"'\"); \n \n $sobre = HTML::contenedor(\"\", \"fondoSobre\", \"fondoSobre\");\n \n $codigo = HTML::campoOculto(\"procesar\", \"true\");\n $codigo .= HTML::parrafo($textos->id(\"CONTACTO\"), \"negrilla margenSuperior\");\n $codigo .= HTML::campoTexto(\"\", 50, 255, $nombre, \"\", \"\", array(\"readOnly\" => \"true\"));\n $codigo .= HTML::campoOculto(\"datos[id_usuario_destinatario]\", $id_usuario_destinatario);\n $codigo .= HTML::parrafo($textos->id(\"TITULO\"), \"negrilla margenSuperior\");\n $codigo .= HTML::campoTexto(\"datos[titulo]\", 50, 255);\n $codigo .= HTML::parrafo($textos->id(\"CONTENIDO\"), \"negrilla margenSuperior\");\n $codigo .= HTML::areaTexto(\"datos[contenido]\", 10, 60, \"\", \"\", \"txtAreaLimitado511\");\n $codigo .= HTML::parrafo($textos->id(\"MAXIMO_TEXTO_511\"), \"maximoTexto\", \"maximoTexto\");\n $codigo .= HTML::parrafo(HTML::boton(\"chequeo\", $textos->id(\"ACEPTAR\"), \"botonOk\", \"botonOk\"), \"margenSuperior\");\n $codigo .= HTML::parrafo($sobre.\"<br>\");\n $codigo .= HTML::parrafo($textos->id(\"REGISTRO_AGREGADO\"), \"textoExitoso\", \"textoExitoso\"); \n $codigo = HTML::forma($destino, $codigo);\n\n $respuesta[\"generar\"] = true;\n $respuesta[\"codigo\"] = $codigo;\n $respuesta[\"destino\"] = \"#cuadroDialogo\";\n $respuesta[\"titulo\"] = HTML::contenedor(HTML::frase(HTML::parrafo($textos->id(\"ENVIAR_MENSAJE\"), \"letraNegra negrilla\"), \"bloqueTitulo-IS\"), \"encabezadoBloque-IS\");\n $respuesta[\"ancho\"] = 430;\n $respuesta[\"alto\"] = 450;\n\n } else {\n $respuesta[\"error\"] = true;\n\n if (empty($datos[\"id_usuario_destinatario\"])) {\n $respuesta[\"mensaje\"] = $textos->id(\"ERROR_FALTA_CONTACTO\");\n\n } elseif (empty($datos[\"titulo\"])) {\n $respuesta[\"mensaje\"] = $textos->id(\"ERROR_FALTA_TITULO\");\n\n } elseif (empty($datos[\"contenido\"])) {\n $respuesta[\"mensaje\"] = $textos->id(\"ERROR_FALTA_CONTENIDO\");\n\n } else {\n \n $datos[\"id_usuario_remitente\"] = $sesion_usuarioSesion->id;\n $datos[\"titulo\"] = strip_tags($datos[\"titulo\"]);\n $datos[\"contenido\"] = strip_tags($datos[\"contenido\"]);\n $datos[\"fecha\"] = date(\"Y-m-d G:i:s\");\n $datos[\"leido\"] = 0;\n\n $mensaje = $sql->insertar(\"mensajes\", $datos);\n\n if ($mensaje) {\n $respuesta[\"error\"] = false;\n $respuesta[\"accion\"] = \"insertar\";\n $respuesta[\"insertarAjax\"] = true;\n\n } else {\n $respuesta[\"mensaje\"] = $textos->id(\"ERROR_DESCONOCIDO\");\n }\n \n }\n }\n\n Servidor::enviarJSON($respuesta);\n}",
"public function obtener_fecha_editar_mensaje()\n {\n \t$consulta=$this->db->query(\"SELECT modificado FROM mensajes WHERE post = '{$this->idp}' AND usuario = '\".$_SESSION['uid'].\"' ORDER BY creacion DESC LIMIT 1;\");\n \twhile($filas=$consulta->fetch_assoc()){$this->fecha=$filas;}\n \treturn $this->fecha;\n }",
"function informar_msg($mensaje, $nivel=null)\n\t{\n\t\ttoba::notificacion()->agregar($mensaje,$nivel);\t\n\t}",
"public function getMensaje()\n {\n return $this->Mensaje;\n }",
"public function getMensaje()\n {\n return $this->mensaje;\n }",
"public function responder_mensaje()\n {\n \t$stmt = $this->db->prepare(\"INSERT INTO mensajes (usuario, mensaje, post, modificado) VALUES ('{$this->uid}',?,'{$this->idp}', NULL);\");\n \t$stmt -> bind_param('s', $this->mensaje); \n \t$stmt -> execute();\n \t$result = $stmt->get_result();\n \tif ($this->db->error){return \"$sql<br>{$this->db->error}\";}\n \telse {return false;}\n }",
"function getmessage() {\r\n\t\t}",
"function getMessage($id_destinatario){\n\t\t\trequire_once('dbm.php');\n\t\t\t$data = new DataBase();\n\t\t\t$data->open();\n\t\t\t$query = \"SELECT mensaje, id_remitente FROM inbox WHERE id_destinatario = $id_destinatario\";\n\t\t\t$result = mysqli_query($data->get_connect(), $query);\n\t\t\t$data->close();\n\t\t\t$data_message = array();\n\t\t\twhile($row = mysqli_fetch_array($result)){\n\t\t\t\t$data_message[] = $row;\n\t\t\t}\n\t\t\treturn $data_message;\n\t\t}",
"function enviarNuevo(){\n\t\t$o_bd = new bd($_SESSION['servidorBD'], $_SESSION['usuarioBD'], $_SESSION['pwdBD'], $_SESSION['nombreBD']);\n\t\t$o_bd->m_seleBD('ppw');\n\n\t\t// obtener el id del usuario que envia el mensaje\n\t\t$query = \"select id from usuario where usr='\". $_SESSION['usr'] .\"'\";\n\t\t$o_bd->m_consulta($query);\n\t\t$registro = mysql_fetch_array($o_bd->a_resuConsulta);\n\t\t$idUsrOr = $registro['id'];\n\n\t\t// obtener el id del usuario que recibira el mensaje\n\t\t$query = \"select id from usuario where usr='\". $_REQUEST['usr'] .\"'\";\n\t\t$o_bd->m_consulta($query);\n\t\t$registro = mysql_fetch_array($o_bd->a_resuConsulta);\n\t\t$idUsrTg = $registro['id'];\n\n\t\t// Consulta final para enviar el mensaje\n\t\t$query = \"insert into Mensaje(id_usrOr, id_usrTg, id_tipoInfo, msj) values (\".$idUsrOr.\",\". $idUsrTg. \",\". $_REQUEST['tipo'] .\",'\". $_REQUEST['msj'] .\"')\";\n\t\t$o_bd->m_consulta($query);\n\t\tif($oBD->a_bandError){\n\t\t\techo \"<center><error>Error \" . $oBD->a_mensError .\"</error></center>\";\n\t\t\techo \"<a href='mensajes.php'>Regresar</a>\";\n\t\t}\n\t\telse\n\t\t\theader(\"location: mensajes.php\");\n\n\t}",
"function capturarMensaje($idPersona){\n\t\t$db = obtenerBaseDeDatos();\n\t\t$sentencia = $db->prepare(\"SELECT id FROM mensajes WHERE id_persona = ? ORDER BY fecha DESC LIMIT 1\");\n\t\t$sentencia->execute([$idPersona]);\n\t\treturn $sentencia->fetchObject()->id;\n\t}",
"function getMensajesNoContactos($idUsuario){\r\n // creo el objeto de base de datos\r\n $sql = new DataBase();\r\n //Selecciono las industrias\r\n $query = \"SELECT mensajes.idmensajes, mensajes.descripcionMensaje, usuarios.nombreEmpresa, usuarios.direccionLogo FROM mensajes, usuarios WHERE mensajes.usuarios_idusuarios = '$idUsuario' AND mensajes.usuarios_idusuarios = usuarios.idusuarios GROUP BY idmensajes ORDER BY idmensajes DESC;\";\r\n // ejecuto la consultta\r\n $result = $sql->check($query);\r\n return $result;\r\n }",
"public function getMessageString();",
"public function getmensajeoperacion(){\n\t\treturn $this->mensajeoperacion ;\n\t}",
"function guardarMensaje($cadena) {\n //$this->CADENA_MESSAGE .= $cadena.\"<br>\";\n }",
"function messagerie_texte_nouveaux_messages($nombre){\n\tif ($nombre=='') return '';\n\t$nombre = intval($nombre);\n\tif ($nombre==1)\n\t\treturn _T('messagerie:texte_un_nouveau_message',array('nb'=>$nombre));\n\telse\n\t\treturn _T('messagerie:texte_des_nouveaux_messages',array('nb'=>$nombre));\n}",
"public function mensagemAlteracao() {\n\n return 'Registro Alterado com sucesso!';\n }",
"public function nuevoMensaje($id_persona, $tabla){\n $sql_sacar_nuevos_mensajes = \"SELECT * FROM \".$tabla.\" WHERE para = '$id_persona' AND est_entregado = 0\";\n \n $resultado = mysql_query($sql_sacar_nuevos_mensajes) or die (\"No pudo traer los nuevos mensajes recibidos...: \" . mysql_error());\n return $resultado;\n }",
"public function mostraUltimaMensagem()\n { \n $arMsgSessao = $_SESSION['msg'];\n $stUltimaMensagem = $arMsgSessao[count($arMsgSessao)-1];\n return $stUltimaMensagem;\n }",
"function messaggioErrore()\n\t\t{\n\t\treturn $this->connessioneDB->messaggioErrore();\n\t\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Test edit tag for user. | public function testEditTagUser(): void
{
// given
$expectedStatusCode = 302;
$user = $this->createUser([User::ROLE_USER]);
$this->logIn($user);
$expectedTag = new Tag();
$expectedTag->setName('Test Tag');
$tagRepository = self::$container->get(TagRepository::class);
$tagRepository->save($expectedTag);
// when
$this->httpClient->request('GET', '/tag/'.$expectedTag->getId().'/edit');
$resultStatusCode = $this->httpClient->getResponse()->getStatusCode();
// then
$this->assertEquals($expectedStatusCode, $resultStatusCode);
} | [
"public function testUserEditWithUser() {\n // Request in GET&POST and expect 403\n $this->checkResponseStatusCode(\n '/users/1/edit',\n ['GET', 'POST'],\n 403,\n $this->createRoleUserClient()\n );\n }",
"public function testEditUser()\n {\n factory(User::class, 4)->create();\n $user = User::find(4);\n $this->browse(function (Browser $browser) use ($user) {\n $browser->visit('/admin/user')\n ->press('#table-contain tbody tr:nth-child(2) td:nth-child(8) a')\n ->assertPathIs('/admin/user/'.$user->id.'/edit')\n ->assertSee('Update user');\n });\n }",
"public function testOpenEditForm(): void\n {\n $userId = 3;\n\n $this->setPreventCommits();\n\n $authCookie = $this->getModeratorOAuthCookie();\n\n $response = $this->get(self::RESOURCES_URL . '/' . $userId, [], [], $authCookie);\n\n $this->assertEquals(200, $response->getStatusCode());\n $this->assertNotContains('Create', (string)$response->getBody());\n $this->assertContains('Update', (string)$response->getBody());\n $this->assertContains('Delete', (string)$response->getBody());\n }",
"public function testEditUsersPageAccessForUser()\n {\n $response = $this->get('/edit-users');\n $response->assertStatus(Response::HTTP_FORBIDDEN);\n }",
"public function testGetEditTags()\n {\n $oUbase = new oxubase();\n $this->assertNull( $oUbase->getEditTags() );\n }",
"public function testEndPointEditUser()\n {\n $response = $this->get('/api/users/1/edit');\n $response->assertStatus(200);\n }",
"public function testLoginUserCanViewEditItself()\n {\n $subject = new User();\n $subject->setEmail('bill@gmail.com');\n\n $loggedInUser = new User();\n $loggedInUser->setEmail('bill@gmail.com');\n $this->setObjectId($loggedInUser, 15);\n $this->setObjectId($subject, 15);\n\n $token = \\Mockery::mock(TokenInterface::class);\n $token->shouldReceive('getUser')->andReturn($loggedInUser);\n\n\n Assert::assertEquals(VoterInterface::ACCESS_GRANTED, $this->userVoter->vote($token, $subject, [UserVoter::USER_CAN_VIEW_EDIT]));\n }",
"function bbp_is_single_user_edit()\n{\n}",
"public function testEdit()\n {\n /** @var Crawler $crawler */\n $crawler = $this->getClient()->request('GET', sprintf('/user/%d/edit', $this->getTestUser()->getId()));\n /** @var Form $form */\n $form = $crawler->selectButton('Сохранить')->form();\n // remove nested delete form\n $form->remove('form');\n $form->remove('_method');\n $this->getClient()->submit($form);\n $this->assertTrue($this->getClient()->getResponse()->isRedirection());\n }",
"public function testEditUser()\n {\n $client = self::createClient();\n $user = $this->createUser(\n 'yet_anotherUser@example.com',\n 'foo',\n '042515183',\n '80.00',\n 'https://imapictureofnothing.com',\n 'testme',\n 'now', ['ROLE_USER', 'ROLE_ADMIN']);\n $client->request('PUT', '/users/'.$user->getId(), [\n 'headers' => [\n 'Content-Type' => 'application/json',\n ], 'json' => [\n 'firstName' => 'Im a new name!'\n ]\n ]);\n $this->assertResponseStatusCodeSame(200);\n }",
"public function testTagSubmission()\n {\n $user = factory(User::class)->create(['rank' => UserRankEnum::Editor]);\n\n $this\n ->actingAs($user)\n ->visit('/editor/tags')\n ->type('newtag', 'tag')\n ->press('Add')\n ->see('newtag')\n ->see('Delete');\n }",
"public function testAdminUserCanEditViewAnotherUser()\n {\n $subject = new User();\n\n $loggedInUser = new User();\n $loggedInUser\n ->setRoles(['ROLE_ADMIN']);\n\n $this->setObjectId($loggedInUser, 15);\n $this->setObjectId($subject, 33);\n\n $token = \\Mockery::mock(TokenInterface::class);\n $token->shouldReceive('getUser')->andReturn($loggedInUser);\n\n\n Assert::assertEquals(VoterInterface::ACCESS_GRANTED, $this->userVoter->vote($token, $subject, [UserVoter::USER_CAN_VIEW_EDIT]));\n\n }",
"public function userEdit(){}",
"public function testPathToEditUser(): void\n {\n $this->logIn('admin');\n\n $crawler = $this->client->request('GET', '/users');\n\n $link = $crawler->filter('.edit-user-link')->eq(0)->link();\n $crawler = $this->client->click($link);\n\n $this->assertSame(' To Do List - Modifier un utilisateur', $crawler->filter('title')->text());\n }",
"public function testEditPage(){\n $user = User::whereRoleIs('top-manager')->first();\n $this->be($user);\n $template = TeamTemplate::first();\n\n $this->get('/team/template/'.$template->name.'/edit')\n ->assertStatus(200);\n }",
"public function testAccessingAdminTagEditPageWithoutBeingAuthenticated()\n {\n $experience = factory(Experience::class)->create();\n $response = $this->get(route('admin.experience.edit', [$experience]));\n $response->assertStatus(302);\n }",
"public function testEditInventoryPageAccessForUser()\n {\n $response = $this->get('/edit-inventory');\n $response->assertStatus(Response::HTTP_FORBIDDEN);\n }",
"public function edit(User $user, Event $event){\n $event->loadMissing('group');\n return $this->isEventCreator($user,$event) || ($event->group && $user->can('manageEvents', $event->group));\n }",
"public function testGetEditUserPath()\n {\n $response = $this->get('/users/' . $this->user->id . '/edit');\n\n $response->assertStatus(200)\n ->assertViewIs('users.edit');\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Append the method info array to controller | private function appendMethod($controller, $method)
{
$this->needsUpdate = true;
$lang_data = ['controller' => $controller, 'method' => $method];
$this->permissions[$controller]['methods'][$method] = [
'name' => Lang::get('laravel-permy::defaults.method.name', $lang_data),
'desc' => Lang::get('laravel-permy::defaults.method.desc', $lang_data),
];
} | [
"private function setControllerMethod()\r\n {\r\n if(!$this->route) return;\r\n\r\n $currentRoute = $this->routes[$this->routeKey];\r\n\r\n $methods = isset($currentRoute['methods']) ? $currentRoute['methods'] : array();\r\n\r\n if(!$methods) return;\r\n\r\n foreach($methods AS $requestType => $requestMethods)\r\n {\r\n foreach($requestMethods AS $method)\r\n {\r\n if(is_array($method))\r\n {\r\n if($this->route[0] == $method[0])\r\n {\r\n $this->method = array_shift($this->route);\r\n\r\n $this->numOfArgs--;\r\n\r\n $this->expectedArgs = $method[1];\r\n\r\n if(strtoupper($requestType) == 'POST')\r\n {\r\n $this->requestShouldBePost = true;\r\n }\r\n break;\r\n }\r\n }\r\n else\r\n {\r\n if($this->route[0] == $method)\r\n {\r\n $this->method = array_shift($this->route);\r\n\r\n $this->numOfArgs--;\r\n\r\n if(strtoupper($requestType) == 'POST')\r\n {\r\n $this->requestShouldBePost = true;\r\n }\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n }",
"public function methodsAction() {\n $this->view->methods = $this->getDiscoMethods()->getDiscMethodsList();\n }",
"private function _loadControllerMethods()\n\t\t{\n\t\t\t$lenght = count($this->_url);\n\t\t\tif ($lenght > 1) {\n\t\t\t\tif (!method_exists($this->_controller, $this->_url[1])) {\n\t\t\t\t\t$this->_loadNotFound();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tswitch ($lenght) {\n\t\t\t\tcase 5:\n\t\t\t\t\t$this->_controller->{$this->_url[1]}($this->_url[2],$this->_url[3],$this->_url[4],$this->_url[5]);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 4:\n\t\t\t\t\t$this->_controller->{$this->_url[1]}($this->_url[2],$this->_url[3],$this->_url[4]);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 3:\n\t\t\t\t\t$this->_controller->{$this->_url[1]}($this->_url[2],$this->_url[3]);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 2:\n\t\t\t\t\t$this->_controller->{$this->_url[1]}($this->_url[2]);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\t$this->_controller->index();\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}",
"protected function enrichData()\n {\n $action = null;\n\n //Compute component controller namespace (studly case!).\n $namespace = config(\"flame.groups.{$this->hint}.namespace\").\n '\\\\'.\n str_replace('.', '\\\\', $this->intermediatePath).\n '\\\\Controllers\\\\'.\n studly_case(last(explode('.', $this->name))).\n 'Controller';\n\n // Identify controller action: current action or 'default'.\n if (@method_exists($namespace, $this->action)) {\n $action = $this->action;\n } elseif (@method_exists($namespace, 'default')) {\n $action = 'default';\n }\n\n if (is_null($action)) {\n return;\n }\n\n // Obtain route parameters.\n $router = app()->make('router');\n $arguments = $router->getCurrentRoute()->parameters;\n\n // In case the action is update or store, we need to pass the request.\n if ($action == 'update' || $action == 'store') {\n $arguments['request'] = request();\n }\n\n // Verify if there are extra parameters in the method that need dependency injection.\n $ref = new \\ReflectionMethod($namespace, $action);\n\n $extraArguments = [];\n if (count($ref->getParameters()) > 0) {\n foreach ($ref->getParameters() as $data) {\n if (! is_null($data->getType())) {\n // Extract both Class and variable from the namedType object ($data)\n $parameter = $data->getName();\n $class = $data->getType()->getName();\n\n /**\n * Elaborate an implicit binding.\n * In case the $class is instance of Model, then retrieve the model instance.\n * Difference is, in case it doesn't exist it will throw an error.\n */\n if (is_subclass_of($class, 'Illuminate\\Database\\Eloquent\\Model')) {\n // A Model class is present. Let's cross check the parameter\n // with the route bindings.\n $routeParameters = $router->getCurrentRoute()->parameters;\n\n if (array_key_exists($parameter, $routeParameters)) {\n /**\n * We do have a route parameter that is equal to our\n * controller function parameter. Time to obtain the model\n * instance!\n * 1. Get route parameter value (our model route key value).\n * 2. Get route key name from the model.\n * 3. Query the DB to get the Model with that key name.\n */\n $modelValue = $routeParameters[$parameter];\n\n /*\n * In case the parent controller in the flame already uses implicit\n * route binding, then the parameters that arrive to the twinkle will\n * already be model objects and not string values. Let's check that...\n */\n if (is_object($modelValue) && is_subclass_of($modelValue, 'Illuminate\\Database\\Eloquent\\Model')) {\n $extraArguments[$parameter] = $modelValue;\n } else {\n $routeKey = (new $class)->getRouteKeyName();\n $modelInstance = $class::where($routeKey, $modelValue)->firstOrFail();\n $extraArguments[$parameter] = $modelInstance;\n }\n }\n } else {\n $extraArguments[$parameter] = app()->make($class);\n }\n }\n }\n }\n\n // Obtain response.\n $response = app()->call(\"{$namespace}@{$action}\", array_merge($arguments, $extraArguments));\n\n // Compute response to be arrayable.\n $response = ! is_array($response) ? [$response] : $response;\n\n // Merge response with the current data.\n $this->data = array_merge_recursive((array) $this->data, $response);\n }",
"protected function getAdditionalMethods()\n {\n return array(self::NEW_METHOD, self::BLOCK_REQUEST_METHOD);\n }",
"function __construct($method, $info = array()) {\n $this->method = $method;\n foreach ($info as $key => $value) {\n $this->$key = $value;\n }\n $this->info = $info;\n }",
"public function __construct() {\n foreach($this->requestMethods as $method) {\n $this->{strtolower($method)} = array();\n }\n }",
"public function setMethod()\n {\n $this->method = strtolower($this->method) . \"Method\";\n\n if (!method_exists($this->controller, $this->method)) {\n $this->method = self::DEFAULT_METHOD;\n }\n }",
"public function classActionDataProvider(): array\n {\n $testData = [];\n\n foreach ([\n 'GET',\n 'POST'\n ] as $requestMethod) {\n $testData[] = [\n $requestMethod,\n '/a1/',\n 'action #1'\n ];\n\n $testData[] = [\n $requestMethod,\n '/a2/',\n 'action #2'\n ];\n\n $testData[] = [\n $requestMethod,\n '/double-word/',\n 'action double word'\n ];\n }\n\n return $testData;\n }",
"private function getControllerMethodNames($method, $pathArgs) {\n $method = strtolower($method);\n $result = [];\n\n if (isset($pathArgs[0])) {\n $name = lcfirst($this->filterName($pathArgs[0], count($pathArgs) === 1));\n $result[] = [\"{$method}_{$name}\", 0];\n\n if ($method === 'get') {\n $result[] = [\"index_{$name}\", 0];\n }\n }\n if (isset($pathArgs[1])) {\n $name = lcfirst($this->filterName($pathArgs[1], count($pathArgs) === 2));\n $result[] = [\"{$method}_{$name}\", 1];\n\n if ($method === 'get') {\n $result[] = [\"index_{$name}\", 1];\n }\n }\n\n $result[] = [$method, null];\n\n if ($method === 'get') {\n $result[] = ['index', null];\n } elseif ($method === \"patch\" && empty($pathArgs)) {\n /**\n * Kludge to allow patch requests to a resource's index. Necessary because current dispatching cannot\n * differentiate between an index or resource-specific reqeust by the method name, only its parameters.\n */\n $result[] = ['patch_index', null];\n } elseif ($method === 'post' && !empty($pathArgs)) {\n // This is a bit of a kludge to allow POST to be used against the usual PATCH method to allow for\n // multipart/form-data on PATCH (edit) endpoints.\n $result[] = ['patch', null];\n }\n\n return $result;\n }",
"private function _innerGenerateAvailableActions()\n {\n $methods = [];\n\n //External actions\n foreach ($this->actions() as $name => $action) {\n $reflection = new \\ReflectionMethod($action, 'run');\n if ($reflection->isPublic()) {\n $info = $this->_examineMethod($reflection);\n if ($info['api']) {\n $methods[$name] = $info;\n }\n }\n }\n\n //Inline actions\n $reflection = new \\ReflectionClass($this);\n foreach ($reflection->getMethods() as $method) {\n if ($method->isPublic() and 0 === strpos($method->getName(), 'action')) {\n $info = $this->_examineMethod($method);\n if ($info['api']) {\n $name = Tools::toCommaCase(substr($method->getName(), 6));\n $methods[$name] = $info;\n }\n }\n }\n\n ksort($methods);\n\n $result['methods'] = $methods;\n\n $reflection = new \\ReflectionClass($this);\n $result['name'] = $reflection->getName();\n $result['shortname'] = strtr($reflection->getShortName(), ['Controller' => '']);\n $result['namespace'] = $reflection->getNamespaceName();\n $result['filename'] = $reflection->getFileName();\n $result['url'] = $this->getUniqueId();\n $comment = $reflection->getDocComment();\n $comment = strtr($comment, [\"\\r\\n\" => \"\\n\", \"\\r\" => \"\\n\"]);\n $comment = preg_replace('/^\\s*\\**(\\s*?$|\\s*)/m', '', $comment);\n\n //Description\n if (preg_match('/^\\/\\*+\\s*([^@]*?)\\n@/', $comment, $matches)) {\n $result['description'] = trim($matches[1]);\n } else {\n $result['description'] = false;\n }\n\n //Properties\n foreach ($reflection->getProperties() as $prop) {\n if (($prop->isPublic() or $prop->isStatic()) and (strpos($prop->class, 'yii\\\\') === false)) {\n $comment = $prop->getDocComment();\n $comment = strtr($comment, [\"\\r\\n\" => \"\\n\", \"\\r\" => \"\\n\"]);\n $comment = preg_replace('/^\\s*\\**(\\s*?$|\\s*)/m', '', $comment);\n\n //Var\n if (preg_match('/^@var\\s+([\\w.\\\\\\]+(\\[\\s*\\])?)\\s*?(\\S.*)$/im', $comment, $matches)) {\n $type = preg_replace('/\\\\\\\\+/', '\\\\', $matches[1]);\n $result['properties'][$prop->getName()]['type'] = $type;\n $result['properties'][$prop->getName()]['description'] = $matches[3];\n if (!$prop->isStatic()) {\n $result['properties'][$prop->getName()]['value'] = $prop->getValue($this);\n }\n }\n }\n }\n\n ksort($result['properties']);\n\n //Constants\n $result['constants'] = $reflection->getConstants();\n\n return $result;\n }",
"private function _callControllerMethod()\r\n {\r\n \r\n \r\n $length = count($this->_url);\r\n if($length > 1)\r\n {\r\n if(!method_exists($this->_controller, $this->_url[1]))\r\n {\r\n $this->_error();\r\n }\r\n }\r\n switch ($length) {\r\n case 5:\r\n //controller->method(param1,param2,param3)\r\n $this->_controller->{$this->_url[1]}($this->_url[2],$this->_url[3],$this->_url[4]);\r\n break;\r\n case 4:\r\n //controller->method(param1,param2)\r\n $this->_controller->{$this->_url[1]}($this->_url[2],$this->_url[3]);\r\n\r\n break;\r\n case 3:\r\n //controller->method(param1)\r\n $this->_controller->{$this->_url[1]}($this->_url[2]);\r\n\r\n break;\r\n case 2:\r\n\r\n //controller->method(param1,param2,param3)\r\n $this->_controller->{$this->_url[1]}();\r\n break;\r\n \r\n default:\r\n $this->_controller->index();\r\n break;\r\n }\r\n\r\n }",
"public function shipping_methodsAction() {\r\n $method = $_SERVER['REQUEST_METHOD'];\r\n if (!$this->_getHelper()->_checkIsRequestValid($this->getRequest())) {\r\n return;\r\n }\r\n $cart = Mage::getSingleton('checkout/cart');\r\n $address = $cart->getQuote()->getShippingAddress();\r\n if ($address->getQuoteId() && $address->getFirstname()) {\r\n $jsonMethods = $this->_getHelper()->getShippingMethods($address, $cart->getQuote());\r\n } else {\r\n $jsonMethods = $this->_getHelper()->getAllShippingMethods();\r\n }\r\n\r\n Mage::dispatchEvent(\r\n 'highstreet_hsapi_checkoutV3_shipping_methods_after', array(\r\n 'shipping_methods' => &$jsonMethods,\r\n 'quote' => $this->_getOnepage()->getQuote(),\r\n 'request' => $this->getRequest()\r\n )\r\n );\r\n $this->_getHelper()->_JSONencodeAndRespond($jsonMethods, \"200 OK\");\r\n return;\r\n }",
"public function getHttpMethods(){ }",
"public function callControllerMethods() {\n $this->oController = new $this->mvc['CONTROLLERCLASSNAME'];\n\n # DEFAULT METHOD\n $bControllerMethodCalled = false;\n if ($this->mvc['VIEW'] != $this->settings['mvc']['defaults']['view']) {\n // ATTEMPT TO CALL CUSTOM VIEW METHOD e.g. function view(){}\n if (is_callable(array($this->oController, $this->mvc['VIEW']))) {\n $this->oController->{$this->mvc['VIEW']}($this->mvc['ACTION']);\n $bControllerMethodCalled = true;\n }\n }\n if (!$bControllerMethodCalled) { // CALL DEFAULT METHOD\n $this->oController->{$this->settings['mvc']['defaults']['view']}($this->mvc['ACTION']);\n }\n\n # EXTENDED METHOD e.g. editExt() for edit()\n $extMethod = $this->mvc['VIEW'] . 'Ext';\n\n if (is_callable(array($this->oController, $extMethod))) {\n $this->oController->{$extMethod}($this->mvc['ACTION']);\n }\n }",
"public function addMethod(string ...$methods) : RouteInterface;",
"protected function initializeActionMethodArguments() {}",
"private function _method_to_load() {\n\n //if(count($this->_url) > 3) {\n // $this->_error();\n //}\n\n if(isset($this->_url[1]) && method_exists($this->controller, $this->_url[1])) {\n $method = strtolower($this->_url[1]);\n\n if(isset($this->_url[2]) && !empty($this->_url[2])) {\n $param = $this->_url[2];\n $this->controller->$method($param);\n } else {\n $this->controller->$method();\n }\n\n } elseif(empty($this->_url[1])) {\n $this->controller->index();\n\n } else {\n $this->_error();\n }\n }",
"public function httpMethodDataprovider()\n {\n return [\n ['head'],\n ['get'],\n ['post'],\n ['put'],\n ['delete'],\n ['options'],\n ['patch']\n ];\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ This method displays patient note and prescription for the certain appointment. param: appointId = appointment unique id. | function appointmentNote($appointId)
{
$appointment = ChcAppointment::find($appointId);
$patient = ChcPatient::find($appointment->patient_id);
$appointmentNote = ChcAppointmentDetail::getAppointmentNote($appointId, $appointment->patient_id);
return view('appointment-details\appointment-notes', ['appointmentNotes' => $appointmentNote, 'patient' => $patient]);
} | [
"public function patientAppointmentAction() {\n\t\n\t\t$this->view->headTitle('Patient Appointments');\n $usersNs = new zend_Session_Namespace(\"members\");\n $Patient = new Application_Model_Patient();\n $docPatient = $Patient->fetchRow(\"user_id='{$usersNs->userId}'\");\n $Appointment = new Application_Model_Appointment();\n\n\t\t$upcomingWhere = \"deleted!=1 AND user_id={$usersNs->userId} AND DATEDIFF(NOW(),appointment_date)<=0 AND approve!=2\";\n $pastWhere = \"deleted!=1 AND user_id={$usersNs->userId} AND DATEDIFF(NOW(),appointment_date)>0 AND approve!=2\";\t\t\n\t\t$cancellWhere = \"deleted!=1 AND user_id={$usersNs->userId} AND approve=2\";\n \n $this->view->upcomingObject = $Appointment->fetchAll($upcomingWhere, \"appointment_date ASC\");\n $this->view->pastObject = $Appointment->fetchAll($pastWhere, \"appointment_date DESC\");\n\t\t$this->view->cancelObjects = $Appointment->fetchAll($cancellWhere, \"appointment_date DESC\");\n\n\t\t$this->view->Patient = $docPatient;\n\t\t\n\t\t$settings = new Admin_Model_GlobalSettings();\n\t\t$this->view->dateFormat = $settings->settingValue('date_format');\n\t\t\n }",
"public function read_appointments($p_patient_id) {\n\t\t$p_patient_id = intval(xss_clean($p_patient_id));\n\t\t\n\t\tif ($this->input->method(TRUE) === \"GET\") {\n\t\t\t$this->output->set_output(json_encode($this->Main_model->get_patient_appointments($p_patient_id)));\n\t\t} else if ($this->input->method(TRUE) === \"POST\") {\n\t\t\t$data_in = get_input();\n\t\t\tif (array_key_exists(\"date\", $data_in)) {\n\t\t\t\t$date = $data_in[\"date\"];\n\t\t\t\tif (! validate_date($date, \"Y-m-d\")) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t$this->output->set_output(json_encode($this->Main_model->get_patient_appointments_by_date($p_patient_id, $date)));\n\t\t\t} else if (array_key_exists(\"speciality_id\", $data_in)) {\n\t\t\t\t$speciality_id = intval(xss_clean($data_in[\"speciality_id\"]));\n\t\t\t\t$this->output->set_output(json_encode($this->Main_model->get_patient_appointments_by_speciality($p_patient_id, $speciality_id)));\n\t\t\t}\n\t\t}\n\t}",
"function getPatientNote($appointmentRecord)\n{\n // only show dentist note, viewing details like crown and carries requires clicking edit\n // then viewing notes edit page with all data filled in\n if (!isset($appointmentRecord['ProgressNotes'])) {\n return null;\n }\n $progressNotes = $appointmentRecord['ProgressNotes'];\n if (!is_array($progressNotes)) {\n return null;\n }\n\n $date = getDefaultDate();\n if (isset($appointmentRecord['AppointmentDate'])) {\n if (dateIsCorrupted($appointmentRecord['AppointmentDate'])) {\n $appointmentRecord['AppointmentDate'] = $date; // set to default\n } else { // otherwise\n $date = $appointmentRecord['AppointmentDate'];\n }\n }\n // set supported date format for date input(yyyy-mm-dd)\n $appointmentRecord['AppointmentDate'] = getNiceDate($date, 'Y-m-d');\n\n // set value for date column to format Dec 31, 2021\n $date = getNiceDate($date);\n $appointmentRecord['Date'] = $date;\n $appointmentRecord['ProgressNotes'] = $progressNotes;\n $appointmentRecord['Note'] = isset($progressNotes['Note']) ? $progressNotes['Note'] : 'edit to add notes';\n return $appointmentRecord;\n /* use commented array if keys in appointment record are not similar to keys required\n by calling method\n * [\n 'PatientName' => $appointmentRecord['PatientName'],\n 'DentistName' => $appointmentRecord['DentistName'],\n 'PatientNo' => $appointmentRecord['PatientNo'],\n 'FileNumber' => $appointmentRecord['FileNumber'],\n 'DOB' => $appointmentRecord['DOB'],\n 'Date' => $date,\n 'Note' => $progressNotes['Note'],\n 'AppointmentDate' => $appointmentRecord['AppointmentDate'],\n 'FirebaseId' => $appointmentRecord['FirebaseId'],\n 'ProgressNotes' => $progressNotes,\n ]*/\n}",
"public function detail(Appointment $appointment)\r\n {\r\n return view('chuckcms-module-booker::backend.appointments.detail', compact('appointments'));\r\n }",
"public function postServiceAppoint()\n {\n $clinics = Clinic::getActive()->get();\n $appoints = AppointType::getActive()->get();\n $providers = Provider::getActive()->get(['id', 'fname', 'lname']);\n\n return View::make('pages.services.appointment')\n ->with('clinics', $clinics)\n ->with('appoints', $appoints)\n ->with('providers', $providers);\n }",
"function gen_apmt_calendar($PID) {\n\n $conn = sql_connect();\n $sql_apmt = mysqli_query($conn, \"SELECT * FROM Appointments WHERE Patient_ID=\".$PID.\";\") or die(mysqli_error($conn));\n\n if(mysqli_num_rows($sql_apmt) == 0) {\n echo \"No appointments found\";\n return;\n }\n\n echo \"<table><tr><th> Appointment ID </th><th> Doctor </th><th> Patient </th><th> Clinic </th><th> Appointment Time </th><th>Action</th></tr>\";\n\n while($apmt = mysqli_fetch_assoc($sql_apmt)) {\n \n $sql_patient = mysqli_query($conn, \"SELECT * FROM Patients WHERE PID=\".$apmt['Patient_ID'].\";\");\n $patient = mysqli_fetch_assoc($sql_patient);\n\n $sql_doc = mysqli_query($conn, \"SELECT * FROM Doctors WHERE NPI=\".$apmt['Doctor_ID'].\";\");\n $doc = mysqli_fetch_assoc($sql_doc);\n\n $sql_clinic = mysqli_query($conn, \"SELECT * FROM Clinics WHERE Clinic_ID=\".$apmt['Clinic_ID'].\";\");\n $clinic = mysqli_fetch_assoc($sql_clinic);\n\n echo \"<tr><td>\".$apmt['Appt_ID'].\"</td><td>\".$doc['Name'].\" (\".$doc['NPI'].\")</td><td>\".$patient['Last_Name'].\", \".$patient['First_Name'].\" (\".$patient['PID'].\") </td><td>\".$clinic['Clinic_name'].\"</td><td>\".$apmt['Appointment_time'].\"</td>\";\n\n echo \"<td><form action='patient_delete_appointment.php' method='POST'><input type='hidden' name='Appt_ID' value=\".$apmt['Appt_ID'].\"><input type='submit' value='Delete Appt' onclick='return confirm_delete()'></form></td></tr>\";\n\n }\n\n echo \"</table>\";\n\n }",
"public function view_appointment()\n {\n\t\t$appointment = \\App\\Appointment::with('user')->get();\n\t\treturn view('appointment.appointmentview', compact ('appointment'));\n }",
"public function appointment() {\n $this->layout = \"\";\n $clinic = $this->Api->submit_cURL(json_encode($_POST), Buzzy_Name . '/api/appointment.json');\n $likecl = json_decode($clinic);\n if ($likecl->appointment->success == 1) {\n $data = array(\n 'success' => 1,\n 'data' => $likecl->appointment->data\n );\n } else {\n $data = array(\n 'success' => 0,\n 'data' => 'Bad Request'\n );\n }\n echo json_encode($data);\n die();\n }",
"public function admittedpatients()\n {\n $user=auth()->user();\n $doctor=Doctor::find($user->foreign_id);\n\n $admittedpatients=Admittedpatient::where('doc_id',$doctor->doc_id)->get();\n\n foreach($admittedpatients as $ap)\n $ap->patient;\n \n $data=array(\n 'admittedpatients'=>$admittedpatients,\n 'doctor'=>$doctor\n \n ); \n\n \n return view('pages.admittedpatients')->with($data);\n }",
"public function getAppointment($appointmentId){\n return $this->appointmentModel->getAppointment($appointmentId);\n }",
"public static function NoShowAppointment($clinicdata){\r\n\t\t\t\t$allInputs = Input::all();\r\n\t\t\t\tStringHelper::Set_Default_Timezone();\r\n\t\t\t\t$currentDate = date('d-m-Y');\r\n\t\t\t\t\r\n\t\t\t\t$findClinicDetails = Clinic_Library::FindClinicDetails($clinicdata->Ref_ID);\r\n\t\t\t\t$findUserAppointment = General_Library::FindUserAppointment($allInputs['appointment_id']);\r\n\t\t\t\tif($findClinicDetails && $findUserAppointment){\r\n\t\t\t\t\t$bookArray['Active'] = 1;\r\n\t\t\t\t\t$bookArray['Status'] = 4;\r\n\t\t\t\t\t\r\n\t\t\t\t\t$updateAppointment = General_Library::UpdateAppointment($bookArray,$findUserAppointment->UserAppoinmentID);\r\n\t\t\t\t\tif($updateAppointment){\r\n\t\t\t\t\t\t$findClinicProcedure = General_Library::FindClinicProcedure($findUserAppointment->ProcedureID);\r\n\t\t\t\t\t\tif($findClinicProcedure){\r\n\t\t\t\t\t\t\t$procedurename = $findClinicProcedure->Name;\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t$procedurename = null;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t$findUserDetails = Auth_Library::FindUserDetails($findUserAppointment->UserID);\r\n\t\t\t\t\t\t$findDoctorDetails = Doctor_Library::FindDoctorDetails($findUserAppointment->DoctorID);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t//Send SMS\r\n\t\t\t\t\t\tif(StringHelper::Deployment()==1){\r\n\t\t\t\t\t\t\t// $smsMessage = \"Hello \".$findUserDetails->Name.\", thank you for using medicloud, it was a pleasure serving you. We hope that the medicloud booking service was seamless, please feel free to get in touch with us on www.medicloud.sg and share your experience.\";\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t$smsMessage = \"Hello \".$findUserDetails->Name.\", we are sorry that you had missed your appointment with \".$findDoctorDetails->Name.\" at \".$findClinicDetails->Name.\", \".$findClinicDetails->Address.\", Ph:\".$findClinicDetails->Phone.\".Please feel free to get in touch with us on happiness@mednefits.com and let us know if we can be of any assistance.\";\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t$sendSMS = StringHelper::SendOTPSMS($findUserDetails->PhoneNo,$smsMessage);\r\n\t\t\t\t\t\t\t$saveSMS = StringHelper::saveSMSMLogs($clinicdata->Ref_ID, $findUserDetails->Name, $findUserDetails->PhoneCode, $findUserDetails->PhoneNo, $smsMessage);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t//Email to User\r\n\t\t\t\t\t\t$formatDate = date('l, j F Y',$findUserAppointment->BookDate);\r\n\t\t\t\t\t\t$emailDdata['bookingid'] = $findUserAppointment->UserAppoinmentID;\r\n\t\t\t\t\t\t$emailDdata['remarks'] = $findUserAppointment->Remarks;\r\n\t\t\t\t\t\t$emailDdata['bookingTime'] = date('h:i A',$findUserAppointment->StartTime).' - '.date('h:i A',$findUserAppointment->EndTime);\r\n\t\t\t\t\t\t$emailDdata['bookingNo'] = 0;\r\n\t\t\t\t\t\t$emailDdata['bookingDate'] = $formatDate;\r\n\t\t\t\t\t\t$emailDdata['doctorName'] = $findDoctorDetails->Name;\r\n\t\t\t\t\t\t$emailDdata['doctorSpeciality'] = $findDoctorDetails->Specialty;\r\n\t\t\t\t\t\t$emailDdata['clinicName'] = $findClinicDetails->Name;\r\n\t\t\t\t\t\t$emailDdata['clinicAddress'] = $findClinicDetails->Address;\r\n\t\t\t\t\t\t$emailDdata['clinicProcedure'] = $procedurename;\r\n\t\t\t\t\t\t$emailDdata['emailName']= $findUserDetails->Name;\r\n\t\t\t\t\t\t$emailDdata['emailPage']= 'email-templates.booking-conclude';\r\n\t\t\t\t\t\t$emailDdata['emailTo']= $findUserDetails->Email;\r\n\t\t\t\t\t\t$emailDdata['emailSubject'] = 'Your booking is No Showed!';\r\n\t\t\t\t\t\t// EmailHelper::sendEmail($emailDdata);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\treturn 1;\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\treturn 0;\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\treturn 0;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}",
"public function ShowPatienthistoryAppointmentById($id)\n {\n $masterdb = $this->db->database;\n $Appointmentbookingpatientid=Appointmentbooking_model::where('appointment_details.id','=',$id)->get(['patients_id']);\n $patientid=$Appointmentbookingpatientid[0]['patients_id'];\n \n die();\n echo json_encode(array('success'=>true,'patientdata'=>$patientdata,'patientdocument'=>$patientdocument));\n }",
"public function getPatientAppointmentInfo($patient_id, $appointment_id = null) {\n\n // retrieve the appointments\n $this->db->select('A.appointment_id, P.clinic_id, A.patient_id, P.umr_no, A.doctor_id, Doc.first_name as doctor_first_name, Doc.last_name as doctor_last_name, Dep.department_name, A.appointment_type, A.appointment_date, A.appointment_time_slot, A.priority, A.description, A.payment_status as appointment_payment_status, A.status as appointment_status, P.title, P.first_name, P.last_name, P.gender, P.date_of_birth, P.age, P.occupation, P.mobile, P.alternate_mobile, P.email_id, P.address_line, P.district_id, P.payment_status as registration_payment_status, D.district_name, P.state_id, S.state_name, P.pincode, P.photo, P.qrcode, P.preferred_language, P.allergy');\n $this->db->from('appointments A');\n $this->db->join('patients P','P.patient_id = A.patient_id');\n $this->db->join('doctors Doc','A.doctor_id = Doc.doctor_id');\n $this->db->join('department Dep','Doc.department_id = Dep.department_id');\n $this->db->join('districts D','P.district_id = D.district_id','left');\n $this->db->join('states S','P.state_id = S.state_id','left');\n $this->db->where('A.patient_id =',$patient_id);\n // $this->db->where_not_in('A.status',$status);\n \n // If the appointment Id is specified\n if($appointment_id) \n $this->db->where('A.appointment_id =',$appointment_id);\n\n return $this->db->get()->result();\n }",
"function clinic_report($patientId = null, $projectId, $apptId = null, \n $apptIdPrev = null){\n// $this->log(\"clinic_report($patientId, $apptId, $apptIdPrev); \" /**. Debugger::trace()*/, LOG_DEBUG);\n\n //Configure::write('debug', 0);\n\n if ($patientId != null){\n if ($patientId != ''){\n// $this->log(\"clinic_report, patientId not null, = $patientId\", LOG_DEBUG);\n $this->Session->write('patientBeingViewedByOther', $patientId);\n $sessions = \n $this->SurveySession->getReportableSessionsForApptAndApptPrevious(\n $patientId, $projectId, \n $apptId, $apptIdPrev);\n $this->Session->write('sessionArrayForPrintout', $sessions);\n $this->redirect(\"/medical_records/clinic_report\");\n }\n }\n\n $sessions = $this->Session->read('sessionArrayForPrintout');\n // artifact of session read - need to look at first element\n $sessions = $sessions[0];\n \n //$this->log('clinic_report, just read sessions = ' . print_r($sessions, true), LOG_DEBUG);\n \n $patientId = $sessions[0]['SurveySession']['patient_id'];\n\n $this->layout = 'clinic_report';\n\n # TODO: it would be nice if we just kept the patientId in the url\n # so that bookmarks, etc. would work across sessions\n if ($patientId == null){\n $patientId = $this->Session->read('patientBeingViewedByOther');\n }\n\t $this->patient = $this->Patient->findById($patientId);\n //$this->DhairLogging->logArrayContents($this->patient, \"patient\");\n\n $this->set('patient', $this->patient);\n\n $this->Session->write('patientBeingViewedByOther', $patientId);\n\n $this->scales =\n $this->Scale->sAndSubscalesForProject(\n $projectId, false);\n $this->set(\"scales\", $this->scales);\n //$this->log(\"just set scales : \" . print_r($this->scales, true), LOG_DEBUG);\n\n \n // holds scales and subscales indexed by ID's\n $sAndSubsIndexByIdWScores = array();\n \n // unlike the proper subscale data, these will be\n // organized primarily by session\n for($i = 0; $i < count($sessions); $i++) {\n \n $sessionId = $sessions[$i]['SurveySession']['id']; \n\n //The following shouldnt do any TZ conversion\n $sessions[$i]['SurveySession']['lastAnswerDT'] = \n date(self::DATE_FORMAT,\n strtotime(\n $this->SurveySession->lastAnswerDT($sessionId)\n ));\n //only report these if session is \"stage 2\" finalized\n if ($sessions[$i]['SurveySession']['finished'] == 1){\n $sessions[$i]['SurveySession']['priority_subscales'] = array();\n $priority_options =\n $this->Answer->forSessionAndQuestion(\n $sessions[$i]['SurveySession']['id'], \n RANKING_Q);\n\n $sessions[$i]['SurveySession']['open_text'] = \n $this->Answer->analysisValueForSessionAndQuestion(\n $sessions[$i]['SurveySession']['id'], OPEN_TEXT_Q); \n }\n $apptIdToReport = $sessions[$i]['SurveySession']['appointment_id']; \n }// for($i = 0; $i < count($sessions); $i++) {\n //$this->log('sessions to report, in controller just before set-ting for view : ' . print_r($sessions, true), LOG_DEBUG); \n $this->set('sessions', $sessions);\n \n // the data will have been sorted by session mod date ASC;\n // the first session's data will be listed first, as\n // sessions are not modifiable after a subsequent one has been\n // created.\n for($i = 0; $i < count($this->scales); $i++) {\n $scale =& $this->scales[$i];\n \n if (isset($scale)){\n //$this->log(\"scale : \" . print_r($scale, true), LOG_DEBUG);\n $scaleId = $scale['Scale']['id'];\n //$this->log(\"scale is $scaleId is set\", LOG_DEBUG);\n $sAndSubsIndexByIdWScores[$scaleId] = array();\n\n foreach ($scale['Subscale'] as $subscale) {\n //$this->log(\"scale $scaleId has subscale \" . $subscale['id'], LOG_DEBUG);\n $sAndSubsIndexByIdWScores[$scaleId][$subscale['id']] = array();\n foreach ($sessions as $session){\n $sessionSubscales = \n $this->SessionSubscale->reportablesForSubscaleAndPatient(\n $subscale['id'],\n $this->patient['Patient']['id'], \n array(0=>$session['SurveySession']['id']));\n //$this->log(\"sessionSubscales: \" . print_r($sessionSubscales, true), LOG_DEBUG);\n $apptIdToReport = $session['SurveySession']['appointment_id']; \n $subWScore =& \n $sAndSubsIndexByIdWScores[$scaleId][$subscale['id']];\n if ((sizeof($sessionSubscales) > 0) &&\n (!is_null(\n $sessionSubscales[0]['SessionSubscale']['value']))){\n\n // note: data_to_report is a percentage\n $subWScore[\"data_to_report_\" . $apptIdToReport] =\n //combined = (value - base)/range\n ($sessionSubscales[0]['SessionSubscale']['value']\n - $subscale['base']) / $subscale['range'];\n\n if ($sessionSubscales[0]['SessionSubscale']['value']\n >= $subscale['critical']){\n $subWScore[\"critical_\" . $apptIdToReport] = true; \n }\n else {\n $subWScore[\"critical_\" . $apptIdToReport] = false; \n }\n }\n else {\n $subWScore[\"data_to_report_\" . $apptIdToReport] = null;\n if ($subscale['id'] == PHQ9_SUBSCALE){\n //PHQ9 if answered <= 6 PHQ9 qs, will end up here\n // (subscale.combination is mean_or_third_null)\n //if selected option index for q43 or q44 is > 2\n // PHQ9 considered incomplete, but high on key qs\n $phq9_incompl_but_high = $this->SessionItem->find(\n \"count\",\n array(\n \"conditions\" => array(\n 'SessionItem.survey_session_id' =>\n $session['SurveySession']['id'],\n 'SessionItem.item_id' => \n array(PHQ9_LITTLE_INTEREST_ITEM, \n PHQ9_FEELING_DOWN_ITEM),\n // SessionItem.value always a 1-based index\n 'SessionItem.value >' => 2)));\n if ($phq9_incompl_but_high > 0){\n $subWScore[\"incomplete_but_high_\" . $apptIdToReport] = true;\n }\n }\n elseif($subscale['id'] == PROMIS_FATIGUE_SUBSCALE){\n //PROMIS if skipped any q's, will end up here\n // (subscale.combination is sum_or_any_null)\n //if selected option index for any of these q's is > 3 \n // PROMIS considered incomplete, but high on some q(s)\n $promis_incompl_but_high = $this->SessionItem->find(\n \"count\",\n array(\n \"conditions\" => array(\n 'SessionItem.survey_session_id' =>\n $session['SurveySession']['id'],\n 'SessionItem.item_id' => \n array(PROMIS_FEEL_FATIGUED_ITEM,\n PROMIS_HOW_FATIGUED_ITEM,\n PROMIS_FATIGUE_RUN_DOWN_ITEM,\n PROMIS_FATIGUE_TROUBLE_STARTING_ITEM),\n // SessionItem.value always a 1-based index\n 'SessionItem.value >' => 3)));\n if ($promis_incompl_but_high > 0){\n $subWScore[\"incomplete_but_high_\" . $apptIdToReport] = true;\n }\n }\n }\n if ($subscale['id'] == PHQ9_SUBSCALE){\n $phq9_alert = $this->SessionItem->find(\n \"count\",\n array(\n \"conditions\" => array(\n 'SessionItem.survey_session_id' =>\n $session['SurveySession']['id'],\n 'SessionItem.item_id' => \n PHQ9_ALERT_ITEM,\n // SessionItem.value always a 1-based index\n 'SessionItem.value >' => 1))); \n if ($phq9_alert > 0){\n $subWScore[\"red_alert_\" . $apptIdToReport] = true; \n }\n }\n }// foreach ($sessions as $session){\n }// foreach ($scale['Subscale'] as $subscale) {\n }// if (isset($scale)){\n }// for($i = 0; $i < count($this->scales); $i++) {\n\n //$this->log(\"sAndSubsIndexByIdWScores \" . print_r($sAndSubsIndexByIdWScores, true), LOG_DEBUG);\n $this->set(\"sAndSubsIndexByIdWScores\", $sAndSubsIndexByIdWScores);\n \n $this->render(CProUtils::getInstanceSpecificViewName(\n $this->name,\n $this->request->action\n ));\n }",
"public function newappointment(){\n $appointments_table = TableRegistry::get('Appointments');\n $users_table = TableRegistry::get('Users');\n $appointment = $appointments_table->newEntity();\n if ($this->request->is('post')) {\n $appointment_time = $this->request->getData('appointment_time');\n $appointment_date = $this->request->getData('appointment_date');\n $time = $appointment_date.' '.$appointment_time;\n $appointment = $appointments_table->patchEntity($appointment, $this->request->getData());\n $appointment->appointment_date = date('Y-m-d H:i A', strtotime($time));\n $appointment->user_id = $this->Auth->user('id');\n if ( $appointments_table->save($appointment)) {\n //log what just happened\n $userscontroller = new UsersController();\n $ip = $userscontroller->get_client_ip();\n $userscontroller->makeLog('Scheduled Appointment', $this->Auth->user('id'), 'Doctor scheduled an appointment', $ip, 'Add');\n $this->Flash->success(__('The appointment has been saved.'));\n\n return $this->redirect(['action' => 'viewappointments']);\n }\n $this->Flash->error(__('The appointment could not be saved. Please, try again.'));\n }\n $doctors = $users_table->find('list', ['limit' => 200])->where(['role_id'=>2]);\n $patients = $appointments_table->Patients->find('list', ['limit' => 200]);\n $this->set(compact('appointment', 'doctors', 'patients'));\n \n \n $this->viewBuilder()->setLayout('backend');\n }",
"public function publishAppointment($id){ \n $appointment = Appointment::find($id);\n $appointment->showable=true;\n $appointment->save();\n\n return redirect('/homesession');\n }",
"public static function listApplicantNotes($applicantId)\n {\n self::validateConfig();\n $client = new Client(['base_uri' => self::$url]);\n $request = $client->request(\"GET\", \"applicants/$applicantId/notes\",[\n 'headers' => [\n 'api_token' => self::$apiKey,\n ],\n ]);\n return $request->getBody()->getContents();\n }",
"public function confirm($id = null)\n {\n $this->autoRender = false;\n\n $tablename = TableRegistry::get(\"Appointments\");\n \n $query = $tablename->query();\n $result = $query->update()\n ->set(['status' => 1])\n ->where(['id' => $id])\n ->execute();\n \n // Fetch appointment is update or not \n $appoint = $tablename->get($id); \n\n if ($appoint->status == 1) {\n\n // Send Email Notification When Doctor confirm Patient Appointment \n $email = new Email('default');\n \n $email->from(['test2@teknomines.com' => 'support@appointment.com'])\n ->to('bharat.tecknomines@gmail.com')\n ->subject('Confirm Appointment')\n ->send('Appointment is confirmed by doctor');\n\n $this->Flash->success(__('Appointment confirm successfully'));\n \n return $this->redirect(['action'=>'index']);\n\n } else {\n\n $this->Flash->error(__('Something went wrong'));\n \n return $this->redirect(['action'=>'index']);\n \n }\n }",
"public function fetchAppointmentById($id);"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/! \static Creates a new RSS Import \param User ID \return the new RSS Import object | static function create( $userID = false, $language )
{
if ( $userID === false )
{
$user = eZUser::currentUser();
$userID = $user->attribute( "contentobject_id" );
}
$dateTime = time();
$row = array( 'id' => null,
'name' => ezi18n( 'kernel/rss', 'New RSS Import' ),
'modifier_id' => $userID,
'modified' => $dateTime,
'creator_id' => $userID,
'created' => $dateTime,
'object_owner_id' => $userID,
'url' => '',
'status' => 0,
'destination_node_id' => 0,
'class_id' => 0,
'class_title' => '',
'class_url' => '',
'class_description' => '',
'active' => 1,
'language' => $language);
return new eZRSS2Import( $row );
} | [
"static function create( $user_id, $language )\r\n {\r\n $config = eZINI::instance( 'site.ini' );\r\n $dateTime = time();\r\n $row = array( 'id' => null,\r\n 'node_id', '',\r\n 'title' => ezi18n( 'kernel/classes', 'New RSS Export' ),\r\n 'site_access' => '',\r\n 'modifier_id' => $user_id,\r\n 'modified' => $dateTime,\r\n 'creator_id' => $user_id,\r\n 'created' => $dateTime,\r\n 'status' => 0,\r\n 'url' => 'http://'. $config->variable( 'SiteSettings', 'SiteURL' ),\r\n 'description' => '',\r\n 'image_id' => 0,\r\n 'active' => 1,\r\n 'access_url' => '' ,\r\n \r\n \t\t\t\t'language' => $language);\r\n \r\n return new eZRSS2Export( $row );\r\n }",
"function asv_rss_importer_create() \r\n{\r\n\tglobal $txpcfg;\r\n\t\r\n\t$asv_rss_importer_url = gps('asv_rss_importer_url');\r\n\t\r\n\t//check to see if there really is a url\r\n\tif($asv_rss_importer_url)\r\n\t{\r\n\t\t//now let's see if this points to a real feed\r\n\t\t$contents = asv_rss_importer_verifyfeed($asv_rss_importer_url, $txpcfg['txpath'].'/lib/simplepie.inc');\r\n\t\t\r\n\t\tif($contents)\r\n\t\t{\r\n\t\t\textract($contents);\r\n\t\t\t\r\n\t\t\tsafe_insert('asv_tumblelog_feeds', \r\n\t\t\t\t\"Feed = '$asv_rss_importer_url',\r\n\t\t\t\t Title = '\".doSlash($title).\"',\r\n\t\t\t\t Image = '$logo'\r\n\t\t\t\");\r\n\t\t\r\n\t\t\t//return the ID\r\n\t\t\treturn mysql_insert_id();\t\t\t\r\n\t\t}\r\n\t}\r\n\t\r\n\t//it wasn't a legit call to create so return null\r\n\treturn null;\r\n}",
"function importRSSItem( $item, $rssImport, $cli, $channel )\r\n{\r\n global $isQuiet;\r\n $rssImportID = $rssImport->attribute( 'id' );\r\n $rssOwnerID = $rssImport->attribute( 'object_owner_id' ); // Get owner user id\r\n $parentContentObjectTreeNode = eZContentObjectTreeNode::fetch( $rssImport->attribute( 'destination_node_id' ) ); // Get parent treenode object\r\n\r\n if ( $parentContentObjectTreeNode == null )\r\n {\r\n if ( !$isQuiet )\r\n {\r\n $cli->output( 'RSS2Import '.$rssImport->attribute( 'name' ).': Destination tree node seems to be unavailable' );\r\n }\r\n return 0;\r\n }\r\n\r\n $parentContentObject = $parentContentObjectTreeNode->attribute( 'object' ); // Get parent content object\r\n $titleElement = $item->getElementsByTagName( 'title' )->item( 0 );\r\n $title = is_object( $titleElement ) ? $titleElement->textContent : '';\r\n\r\n // Test for link or guid as unique identifier\r\n $link = $item->getElementsByTagName( 'link' )->item( 0 );\r\n $guid = $item->getElementsByTagName( 'guid' )->item( 0 );\r\n if ( $link->textContent )\r\n {\r\n $md5Sum = md5( $link->textContent );\r\n }\r\n elseif ( $guid->textContent )\r\n {\r\n $md5Sum = md5( $guid->textContent );\r\n }\r\n else\r\n {\r\n if ( !$isQuiet )\r\n {\r\n $cli->output( 'RSS2Import '.$rssImport->attribute( 'name' ).': Item has no unique identifier. RSS guid or link missing.' );\r\n }\r\n return 0;\r\n }\r\n\r\n // Try to fetch RSS2Import object with md5 sum matching link.\r\n $existingObject = eZPersistentObject::fetchObject( eZContentObject::definition(), null,\r\n array( 'remote_id' => 'RSS2Import_'.$rssImportID.'_'.$md5Sum ) );\r\n\r\n // if object exists, continue to next import item\r\n if ( $existingObject != null )\r\n {\r\n if ( !$isQuiet )\r\n {\r\n $cli->output( 'RSSImport '.$rssImport->attribute( 'name' ).': Object ( ' . $existingObject->attribute( 'id' ) . ' ) with URL: '.$linkURL.' already exists' );\r\n }\r\n unset( $existingObject ); // delete object to preserve memory\r\n return 0;\r\n }\r\n\r\n // Fetch class, and create ezcontentobject from it.\r\n $contentClass = eZContentClass::fetch( $rssImport->attribute( 'class_id' ) );\r\n\r\n // Instantiate the object with user $rssOwnerID and use section id from parent. And store it.\r\n $contentObject = $contentClass->instantiate( $rssOwnerID, $parentContentObject->attribute( 'section_id' ), false, $rssImport->attribute('language') );\r\n\r\n $db = eZDB::instance();\r\n $db->begin();\r\n $contentObject->store();\r\n $contentObjectID = $contentObject->attribute( 'id' );\r\n\r\n // Create node assignment\r\n $nodeAssignment = eZNodeAssignment::create( array( 'contentobject_id' => $contentObjectID,\r\n 'contentobject_version' => $contentObject->attribute( 'current_version' ),\r\n 'is_main' => 1,\r\n 'parent_node' => $parentContentObjectTreeNode->attribute( 'node_id' ) ) );\r\n $nodeAssignment->store();\r\n\r\n $version = $contentObject->version( 1 );\r\n $version->setAttribute( 'status', eZContentObjectVersion::STATUS_DRAFT );\r\n $version->store();\r\n\r\n // Get object attributes, and set their values and store them.\r\n $dataMap = $contentObject->dataMap();\r\n $importDescription = $rssImport->importDescription();\r\n\r\n // Set content object attribute values.\r\n $classAttributeList = $contentClass->fetchAttributes();\r\n foreach( $classAttributeList as $classAttribute )\r\n {\r\n $classAttributeID = $classAttribute->attribute( 'id' );\r\n if ( isset( $importDescription['class_attributes'][$classAttributeID] ) )\r\n {\r\n if ( $importDescription['class_attributes'][$classAttributeID] == '-1' )\r\n {\r\n continue;\r\n }\r\n\r\n $importDescriptionArray = explode( ' - ', $importDescription['class_attributes'][$classAttributeID] );\r\n if ( count( $importDescriptionArray ) < 1 )\r\n {\r\n $cli->output( 'RSSImport '.$rssImport->attribute( 'name' ).': Invalid import definition. Please redit.' );\r\n break;\r\n }\r\n\r\n $elementType = $importDescriptionArray[0];\r\n array_shift( $importDescriptionArray );\r\n switch( $elementType )\r\n {\r\n case 'item':\r\n {\r\n setObjectAttributeValue( $dataMap[$classAttribute->attribute( 'identifier' )],\r\n recursiveFindRSSElementValue( $importDescriptionArray,\r\n $item ) );\r\n } break;\r\n\r\n case 'channel':\r\n {\r\n setObjectAttributeValue( $dataMap[$classAttribute->attribute( 'identifier' )],\r\n recursiveFindRSSElementValue( $importDescriptionArray,\r\n $channel ) );\r\n } break;\r\n }\r\n }\r\n }\r\n\r\n $contentObject->setAttribute( 'remote_id', 'RSS2Import_'.$rssImportID.'_'. $md5Sum );\r\n $contentObject->store();\r\n $db->commit();\r\n\r\n // Publish new object. The user id is sent to make sure any workflow\r\n // requiring the user id has access to it.\r\n $operationResult = eZOperationHandler::execute( 'content', 'publish', array( 'object_id' => $contentObject->attribute( 'id' ),\r\n 'version' => 1,\r\n 'user_id' => $rssOwnerID ) );\r\n\r\n if ( !isset( $operationResult['status'] ) || $operationResult['status'] != eZModuleOperationInfo::STATUS_CONTINUE )\r\n {\r\n if ( isset( $operationResult['result'] ) && isset( $operationResult['result']['content'] ) )\r\n $failReason = $operationResult['result']['content'];\r\n else\r\n $failReason = \"unknown error\";\r\n $cli->error( \"Publishing failed: $failReason\" );\r\n unset( $failReason );\r\n }\r\n\r\n $db->begin();\r\n unset( $contentObject );\r\n unset( $version );\r\n $contentObject = eZContentObject::fetch( $contentObjectID );\r\n $version = $contentObject->attribute( 'current' );\r\n // Set object Attributes like modified and published timestamps\r\n $objectAttributeDescription = $importDescription['object_attributes'];\r\n foreach( $objectAttributeDescription as $identifier => $objectAttributeDefinition )\r\n {\r\n if ( $objectAttributeDefinition == '-1' )\r\n {\r\n continue;\r\n }\r\n\r\n $importDescriptionArray = explode( ' - ', $objectAttributeDefinition );\r\n\r\n $elementType = $importDescriptionArray[0];\r\n array_shift( $importDescriptionArray );\r\n switch( $elementType )\r\n {\r\n default:\r\n case 'item':\r\n {\r\n $domNode = $item;\r\n } break;\r\n\r\n case 'channel':\r\n {\r\n $domNode = $channel;\r\n } break;\r\n }\r\n\r\n switch( $identifier )\r\n {\r\n case 'modified':\r\n {\r\n $dateTime = recursiveFindRSSElementValue( $importDescriptionArray,\r\n $domNode );\r\n if ( !$dateTime )\r\n {\r\n break;\r\n }\r\n $contentObject->setAttribute( $identifier, strtotime( $dateTime ) );\r\n $version->setAttribute( $identifier, strtotime( $dateTime ) );\r\n } break;\r\n\r\n case 'published':\r\n {\r\n $dateTime = recursiveFindRSSElementValue( $importDescriptionArray,\r\n $domNode );\r\n if ( !$dateTime )\r\n {\r\n break;\r\n }\r\n $contentObject->setAttribute( $identifier, strtotime( $dateTime ) );\r\n $version->setAttribute( 'created', strtotime( $dateTime ) );\r\n } break;\r\n }\r\n }\r\n $version->store();\r\n $contentObject->store();\r\n $db->commit();\r\n\r\n if ( !$isQuiet )\r\n {\r\n $cli->output( 'RSS2Import '.$rssImport->attribute( 'name' ).': Object created; ' . $title );\r\n }\r\n\r\n return 1;\r\n}",
"function fromUser()\r\n {\r\n return new eZUser( $this->FromUserID );\r\n }",
"function MakeUserPhotosRSS( $userid ) {\r\n }",
"function user()\r\n {\r\n if ( $this->UserID != 0 )\r\n {\r\n $ret = new eZUser( $this->UserID );\r\n }\r\n\r\n return $ret;\r\n }",
"public static function getInstanceByUser($inUser) {\n\t\t/**\n\t\t * No instance, create one\n\t\t */\n\t\t$oObject = new mofilmCommsEmail();\n\t\t$oObject->setUserID($inUser);\n\t\t$oObject->load();\n\n\t\treturn $oObject;\n\t}",
"public function setImportUser($var)\n {\n GPBUtil::checkString($var, True);\n $this->import_user = $var;\n\n return $this;\n }",
"function rssimport_import_item($item, $rssimport) { \n switch ($rssimport->import_into) {\n case \"blog\":\n $history = rssimport_blog_import($item, $rssimport);\n break;\n\t\tcase \"pages\":\n\t\t\t$history = rssimport_page_import($item, $rssimport);\n\t\t\tbreak;\n\t\tcase \"bookmarks\":\n\t\t\t$history = rssimport_bookmarks_import($item, $rssimport);\n\t\t\tbreak;\n\t\tdefault:\t// when in doubt, send to a blog\n\t\t\t$history = rssimport_blog_import($item, $rssimport);\n\t\t\tbreak;\n\t}\n \n return $history;\n}",
"public function createNewItem() {\n $Item = new FeedItem($this->version);\n return $Item;\n }",
"public static function getInstance($inID) {\n\t\t/**\n\t\t * Check for an existing instance\n\t\t */\n\t\tif ( isset(self::$_Instances[$inID]) ) {\n\t\t\treturn self::$_Instances[$inID];\n\t\t}\n\t\t\n\t\t/**\n\t\t * No instance, create one\n\t\t */\n\t\t$oObject = new mofilmUserDownload();\n\t\t$oObject->setID($inID);\n\t\tif ( $oObject->load() ) {\n\t\t\tself::$_Instances[$inID] = $oObject;\n\t\t\treturn $oObject;\n\t\t}\n\t\treturn $oObject;\n\t}",
"public static function load($UserID) {\n if (is_numeric($UserID)) {\n $sql = \"SELECT * FROM r_streckeUser\n INNER JOIN strecke\n ON r_streckeUser.strecke_ID = strecke.ID\n WHERE user_ID = '$UserID'\n ORDER BY datum DESC;\";\n\n $dbConnector = DbConnector::getInstance();\n $result = $dbConnector->execute_sql($sql);\n\n if (mysql_num_rows($result) > 0) {// wenn mehr als 0 eintraege\n $streckeliste = new StreckeListe;\n\n while ($row = mysql_fetch_array($result)) { //sequentielles durchgehen der zeilen\n $strecke = Strecke::parse_result_as_objekt($row);\n $streckeliste->append_strecke($strecke);\n }\n return $streckeliste;\n } else {\n throw new FFSException(ExceptionText::streckeListe_no_strecke());\n }\n } else {\n throw new FFSException(ExceptionText::user_ID_not_numeric());\n }\n }",
"public function createFeedItem() {\n\t\t$body = file_get_contents('php://input');\n\t\t$feedItem = FeedItem::createModelFromJson($body);\n\t\t$service = new ActivityStreamService($this->contextUser, $this->repository);\n\t\t$feedItem = $service->createFeedItem($feedItem);\n\t\treturn $feedItem;\n\t\t\n\t}",
"public function new_item(){\n\t\treturn new Rss2_item();\n\t}",
"public function importRssAction()\n {\n try {\n $entityManager = $this->getServiceLocator()->get('doctrine.entitymanager.orm_default');\n\n $page = $this->getRequest()->getParams()['page'];\n $file = __DIR__ . '/../../../../../data/RSS/' . $page . '.rss';\n\n if (!file_exists($file)) {\n die('file not found');\n throw new \\Exception(\"File $file not found\");\n }\n\n $rss = Feed::loadRssFile(\"file://$file\");\n\n foreach ($rss->item as $rssItem) {\n $identifier = substr($rssItem->guid, 28);\n $item = $entityManager->getRepository('Db\\Entity\\Item')->findOneBy(array(\n 'guid' => $identifier,\n ));\n\n if ($item) continue;\n\n $category = $entityManager->getRepository('Db\\Entity\\Category')->findOneBy(array(\n 'name' => $rssItem->category\n ));\n\n if (!$category) {\n $category = new CategoryEntity;\n $category->setName($rssItem->category);\n $entityManager->persist($category);\n }\n\n $item = new ItemEntity;\n $item->setGuid(substr($rssItem->guid, 28));\n $item->setTitle($rssItem->title);\n $item->setDescription($rssItem->description);\n $item->setLink($rssItem->link);\n $item->setCategory($category);\n $pubDate = date_create_from_format('D, d M Y H:i:s O', $rssItem->pubDate);\n if ($pubDate instanceof \\DateTime) {\n $item->setPubDate($pubDate);\n }\n\n $http = new Client();\n $request = new Request();\n\n $identifier = substr($rssItem->guid, 28);\n $request->setUri(\"http://www.archive.org/services/find_file.php?file=$identifier\");\n $request->setMethod(Request::METHOD_GET);\n\n try {\n $response = $http->dispatch($request);\n $dir = substr($http->getUri()->getQuery(), 4);\n $url = 'https://' . $http->getUri()->getHost() . $dir;\n $item->setUrl($url);\n } catch (\\Exception $e) {\n# Instead of logging misses run\n# error_log(\"$identifier\\n\", 3, __DIR__ . '/../../../../../data/Log/find-file-fail.log');\n }\n\n $entityManager->persist($item);\n\n // Import Keywords\n $node = \"media:keywords\";\n if ($rssItem->$node) {\n foreach (explode(',', $rssItem->$node) as $rssKeyword) {\n $keyword = $entityManager->getRepository('Db\\Entity\\Keyword')->findOneBy(array(\n 'name' => trim($rssKeyword)\n ));\n\n if (!$keyword) {\n $keyword = new KeywordEntity;\n $keyword->setName(trim($rssKeyword));\n $entityManager->persist($keyword);\n }\n\n $itemToKeyword = new ItemToKeywordEntity;\n $itemToKeyword->setItem($item);\n $itemToKeyword->setKeyword($keyword);\n $entityManager->persist($itemToKeyword);\n }\n }\n\n // Import Enclosures\n foreach ($rssItem->enclosure as $rssEnclosure) {\n $enclosure = new EnclosureEntity;\n foreach($rssEnclosure->attributes() as $name => $value) {\n switch($name) {\n case 'url':\n $enclosure->setUrl($value);\n break;\n case 'length':\n $enclosure->setLength($value);\n break;\n case 'type':\n $enclosureType = $entityManager->getRepository('Db\\Entity\\EnclosureType')->findOneBy(array(\n 'name' => $value\n ));\n if (!$enclosureType) {\n $enclosureType = new EnclosureTypeEntity();\n $enclosureType->setName($value);\n $entityManager->persist($enclosureType);\n }\n\n $enclosure->setEnclosureType($enclosureType);\n break;\n default:\n break;\n }\n\n $enclosure->setItem($item);\n $entityManager->persist($enclosure);\n\n }\n }\n\n $entityManager->flush();\n echo $rssItem->title . \"\\n\";\n }\n\n } catch (\\Exception $e) {\n die($e->getMessage());\n }\n\n return \"\\nFinished $file\\n\";\n\n }",
"function &user()\r\n {\r\n if ( $this->UserID != 0 )\r\n {\r\n $ret = new eZUser( $this->UserID );\r\n }\r\n\r\n return $ret;\r\n }",
"public static function load($UserID) {\n if (is_numeric($UserID)) {\n $sql = \"SELECT * FROM r_einsatzUser\n INNER JOIN einsatz\n ON r_einsatzUser.einsatz_ID = einsatz.ID\n WHERE user_ID = '$UserID'\n ORDER BY datum DESC;\";\n\n $dbConnector = DbConnector::getInstance();\n $result = $dbConnector->execute_sql($sql);\n\n if (mysql_num_rows($result) > 0) {// wenn mehr als 0 eintraege\n $einsatzliste = new EinsatzListe;\n\n while ($row = mysql_fetch_array($result)) { //sequentielles durchgehen der zeilen\n $einsatzliste->append_einsatz(\n Einsatz::parse_result_as_objekt($row));\n }\n return $einsatzliste;\n } else {\n throw new FFSException(ExceptionText::einsatzListe_no_einsatz());\n }\n } else {\n throw new FFSException(ExceptionText::user_ID_not_numeric());\n }\n }",
"public function import_external_rss_feed() {\n\t\t// @todo add nonces, add user caps check, validate inputs\n\n\t\tupdate_option( 'ssp_rss_import', 0 );\n\n\t\t$ssp_external_rss = get_option( 'ssp_external_rss', '' );\n\t\tif ( empty( $ssp_external_rss ) ) {\n\t\t\t$response = array(\n\t\t\t\t'status' => 'error',\n\t\t\t\t'message' => 'No feed to process',\n\t\t\t);\n\t\t\twp_send_json( $response );\n\n\t\t\treturn;\n\t\t}\n\n\t\t$rss_importer = new Rss_Importer( $ssp_external_rss );\n\t\t$response = $rss_importer->import_rss_feed();\n\n\t\twp_send_json( $response );\n\t}",
"private function getSimpleXML($user) {\n\t\t$feed = 'http://picasaweb.google.com/data/feed/api/user/' . $user . '?v=2';\n\t\treturn simplexml_load_file($feed);\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sign in form component factory. | protected function createComponentSignInForm()
{
$form = new Form;
$form->addText('email', 'email')
->setRequired('Zadejte prosím Váš e-mail.')
->setAttribute('placeholder', 'e-mail');
$form->addPassword('password', 'heslo')
->setRequired('Zadejte prosím Vaše heslo.')
->setAttribute('placeholder', 'heslo');
//$form->addCheckbox('remember', 'Remember me on this computer');
$form->addSubmit('login', 'PŘIHLÁSIT SE');
$form->onSuccess[] = callback($this, 'signInFormSubmitted');
return $form;
} | [
"protected function createComponentSignInForm()\r\n\t{\r\n\t\t$form = new Form;\r\n\t\t$form->addText('username', '')\r\n\t\t\t->setRequired('Prosím, zadejte název uživatele.')\r\n\t\t\t->setAttribute('placeholder', 'Uživatel');\t\r\n\r\n\t\t$form->addPassword('password', '')\r\n\t\t\t->setRequired('Prosím zadejte heslo.')\r\n\t\t\t->setAttribute('placeholder', 'Heslo');\t\r\n\r\n\t\t$form->addSubmit('send', 'Login');\r\n\r\n\t\t$form->onSuccess[] = callback($this, 'signInFormSubmitted');\r\n\t\treturn $form;\r\n\t}",
"public function GetSignInForm ();",
"protected function createComponentSignInForm()\r\n\t{\r\n\t\t$form = new NAppForm;\r\n\t\t$form->addText('username', 'Username:')\r\n\t\t\t->setRequired('Please provide a username.');\r\n\r\n\t\t$form->addPassword('password', 'Password:')\r\n\t\t\t->setRequired('Please provide a password.');\r\n\r\n\t\t$form->addCheckbox('remember', 'Remember me on this computer');\r\n\r\n\t\t$form->addSubmit('send', 'Sign in');\r\n\r\n\t\t$form->onSuccess[] = callback($this, 'signInFormSubmitted');\r\n\t\treturn $form;\r\n\t}",
"public function GetSignInForm () {\n\t\tif ($this->signInForm !== NULL) return $this->signInForm;\n\t\t$routerClass = $this->application->GetRouterClass();\n\t\t$router = $routerClass::GetInstance();\n\t\t$route = $this->getInitializedRoute('SignIn')->SetRouter($router);\n\t\t$method = $route->GetMethod();\n\t\t$appCtrl = $this->application->GetController();\n\t\t$formClassType = new \\ReflectionClass($this->signInFormClass);\n\t\t$this->signInForm = $formClassType->newInstanceArgs([$appCtrl]);\n\t\t$this->signInForm\n\t\t\t->AddCssClasses(str_replace('_', ' ', $this->signInForm->GetId()))\n\t\t\t->SetMethod($method !== NULL ? $method : \\MvcCore\\IRequest::METHOD_POST)\n\t\t\t->SetAction($router->UrlByRoute($route))\n\t\t\t->SetSuccessUrl($this->signedInUrl)\n\t\t\t->SetErrorUrl($this->signErrorUrl);\n\t\tif ($this->translator)\n\t\t\t$this->signInForm->SetTranslator($this->translator);\n\t\t$this->signInForm->Init();\n\t\treturn $this->signInForm;\n\t}",
"protected function createComponentLoginForm()\n\t{\n\t\treturn new LoginForm;\n\t}",
"public function getLoginForm();",
"public function GetSignInFormClass ();",
"public function signInForm()\n {\n // render the template\n return View::make('user.signin');\n }",
"protected function createComponentSignInForm($name)\n\t{\n\t\t$form = new \\CoreModule\\Forms\\LoginForm;\n\t\treturn $form;\n\t}",
"private function createLoginForm(){\t\t\n\t\t$form = $this->di->form->create([], [ \n 'email' => [ \n \t'class'\t\t => 'form-control',\n 'type' => 'email', \n 'label' => 'E-post', \n 'validation' => ['not_empty', 'email_adress'] \n ], \n 'password' => [ \n \t'class'\t\t => 'form-control',\n 'type' => 'password', \n 'label' => 'Lösenord' \n ], \n 'submit' => [ \n 'type' => 'submit', \n 'value' => 'Logga in', \n 'class'\t\t => 'btn btn-primary pull-left',\n 'callback' => function ($form) { \n return true; \n } \n ] \n ]); \n\t\treturn $form;\n\t}",
"protected function getAuthenticationForm()\n {\n return $this->app['form.factory']->createBuilder('form')\n ->add('framework_uid', 'text')\n ->getForm();\n }",
"public function getFormLoginPage();",
"public function login_form() {\n $form_elements = array();\n $form_elements[] = $this->form_elements->set_attributes(\"email\");\n $form_elements[] = $this->form_elements->set_attributes(\"password\");\n $form_elements[] = $this->form_elements->set_attributes(\"checkbox\");\n $form_elements[] = $this->form_elements->set_attributes(\"submit\");\n $form = new Form($form_elements, './user-login', \"login-form\", array(\"email\", \"password\"));\n return $form->form_maker();\n }",
"public function loginForm()\n {\n return UsernameOrEmailLoginForm::create(\n $this,\n get_class($this->authenticator),\n 'LoginForm'\n );\n }",
"public function createComponentLoginsForm() {\n $form=new Form();\n $form->addSelect('allow_local','Allow local user accounts:',[1=>'yes'])\n ->setAttribute('readonly')\n ->setAttribute('class','withSpace')\n ->setDisabled(true);\n $allowFacebook=$form->addSelect('allow_facebook','Allow Facebook login:',[0=>'no',1=>'yes']);\n $allowFacebook->addCondition(Form::EQUAL,1)\n ->toggle('facebookAppId',true)\n ->toggle('facebookAppSecret',true);\n $form->addText('facebookAppId','Facebook App ID:')\n ->setOption('id','facebookAppId')\n ->addConditionOn($allowFacebook,Form::EQUAL,1)\n ->setRequired('You have to input Facebook App ID!');\n $form->addText('facebookAppSecret','Facebook Secret Key:',null,32)\n ->setAttribute('class','withSpace')\n ->setOption('id','facebookAppSecret')\n ->addConditionOn($allowFacebook,Form::EQUAL,1)\n ->setRequired('You have to input Facebook Secret Key!')\n ->addRule(Form::LENGTH,'Secret Key length has to be %s chars.',32);\n\n $allowGoogle=$form->addSelect('allow_google','Allow Google login:',[0=>'no',1=>'yes']);\n $allowGoogle->addCondition(Form::EQUAL,1)\n ->toggle('googleClientId',true)\n ->toggle('googleClientSecret',true);\n $form->addText('googleClientId','Google Client ID:')\n ->setOption('id','googleClientId')\n ->addConditionOn($allowGoogle,Form::EQUAL,1)\n ->setRequired('You have to input Google Client ID!');\n $form->addText('googleClientSecret','Google Secret Key:',null,24)\n ->setOption('id','googleClientSecret')\n ->addConditionOn($allowGoogle,Form::EQUAL,1)\n ->setRequired('You have to input Google Secret Key!')\n ->addRule(Form::LENGTH,'Secret Key length has to be %s chars.',24);;\n\n $form->addSubmit('submit','Save & continue...')\n ->onClick[]=function(SubmitButton $submitButton){\n $values=$submitButton->form->getValues(true);\n $configManager=$this->createConfigManager();\n if ($values['allow_facebook']==1){\n $configManager->data['facebook']=[\n 'appId'=>$values['facebookAppId'],\n 'appSecret'=>$values['facebookAppSecret']\n ];\n }else{\n $configManager->data['facebook']=[\n 'appId'=>'',\n 'appSecret'=>'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'\n ];\n }\n if ($values['allow_google']==1){\n $configManager->data['google']=[\n 'clientId'=>$values['googleClientId'],\n 'clientSecret'=>$values['googleClientSecret']\n ];\n }else{\n $configManager->data['google']=[\n 'clientId'=>'',\n 'clientSecret'=>'xxxxxxxxxxxxxxxxxxxxxxxx'\n ];\n }\n $configManager->saveConfig();\n $this->redirect($this->getNextStep('logins'));\n };\n return $form;\n }",
"protected function createComponentLoginForm(): Form\n {\n $form = new Form($this, 'loginForm');\n $form->addText('id', _('Login or e-mail'))\n ->addRule(\\Nette\\Forms\\Form::FILLED, _('Insert login or email address.'))\n ->getControlPrototype()->addAttributes(\n [\n 'class' => 'top form-control',\n 'autofocus' => true,\n 'placeholder' => _('Login or e-mail'),\n 'autocomplete' => 'username',\n ]\n );\n $form->addPassword('password', _('Password'))\n ->addRule(\\Nette\\Forms\\Form::FILLED, _('Type password.'))->getControlPrototype()->addAttributes(\n [\n 'class' => 'bottom mb-3 form-control',\n 'placeholder' => _('Password'),\n 'autocomplete' => 'current-password',\n ]\n );\n $form->addSubmit('send', _('Log in'));\n $form->addProtection(_('The form has expired. Please send it again.'));\n $form->onSuccess[] = fn(\\Nette\\Forms\\Form $form) => $this->loginFormSubmitted($form);\n\n return $form;\n }",
"public function getSignIn()\n {\n return View::make('admin.users.eactivities.sign_in');\n }",
"public function signInFormSubmitted(Form $form)\r\n\t{\r\n\t\ttry {\r\n\t\t\t$values = $form->getValues();\r\n\t\t//\tif ($values->remember) {\r\n\t\t//\t\t$this->getUser()->setExpiration('+ 14 days', FALSE);\r\n\t\t//\t} else {\r\n\t\t\t\t$this->getUser()->setExpiration('+ 60 minutes', TRUE);\r\n\t\t//\t}\r\n\t\t\t$this->getUser()->login($values->email, $values->password);\r\n\t\t\t \r\n\r\n\t\t} catch (\\Nette\\Security\\AuthenticationException $e) {\r\n\t\t\t$this->flashMessage($e->getMessage(),'error');\r\n\t\t}\r\n $this->redirect('Mapa:');\r\n\t}",
"public function login()\n {\n static $obj;\n if ( (object) $obj === $obj ):\n return $obj;\n else:\n $obj = new Login( __CLASS__ );\n $_settings = bcFormControl::getSettings();\n bc::publisher()->addHeadIncludes( $this->template_path . $_settings['TEMPLATE'] . DIRECTORY_SEPARATOR . 'css' . DIRECTORY_SEPARATOR . 'UiWizard' . DIRECTORY_SEPARATOR . 'Login' . DIRECTORY_SEPARATOR . 'login.css', 'css' );\n bc::publisher()->addHeadIncludes( $this->template_path . $_settings['TEMPLATE'] . DIRECTORY_SEPARATOR . 'js' . DIRECTORY_SEPARATOR . 'UiWizard' . DIRECTORY_SEPARATOR . 'Login' . DIRECTORY_SEPARATOR . 'login.js', 'js' );\n return $obj;\n endif;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check if post process has been set | public function hasPostProcess()
{
return !is_null($this->postProcess);
} | [
"public function hasDefaultPostProcess()\n {\n return !is_null($this->getDefaultPostProcess());\n }",
"protected function isPostRequestCompulsoryForProcessStep()\n {\n return true;\n }",
"protected function checkPostbackFlag(): bool\n {\n return Request::method() === 'POST' && post('postback');\n }",
"function bbp_is_post_request()\n{\n}",
"protected function postProcess(): void\n {\n // nothing\n }",
"public function postProcess() {}",
"public function hasPostRequirements($process)\n\t\t{\n\n\t\t\tif ($this->hasProcessClass($process) == false)\n\t\t\t{\n\n\t\t\t\tthrow new \\Error();\n\t\t\t}\n\n\t\t\t$class = $this->findProcessClass($process);\n\n\t\t\tif (isset($class->configuration()['postrequirements']) == false)\n\t\t\t{\n\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tif (empty($class->configuration()['postrequirements']))\n\t\t\t{\n\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}",
"public function postProcess()\n {\n }",
"public function is_post_request()\n {\n return $this->get_request_type() === \"post\";\n }",
"protected function isThereIsPostAction()\n {\n if( isset($_POST['postAction']) ) return true;\n\n return false;\n }",
"public function getDefaultPostProcess()\n {\n return null;\n }",
"public function isPostBack() {\n return $_SERVER['REQUEST_METHOD'] == $this->getMethod();\n }",
"public function hasPostbackId()\n {\n return $this->hasData(self::POSTBACK_ID_KEY);\n }",
"public function is_save_postback() {\r\n\t\treturn ! rgempty( 'gform-settings-save' );\r\n\t}",
"public function isPostBack()\n {\n $requestMode = Application::instance()->context()->requestMode();\n return ($requestMode == Context::REQUEST_MODE_QCUBED_SERVER || $requestMode == Context::REQUEST_MODE_QCUBED_AJAX);\n }",
"public function has_post() {\n\t\treturn $this->post != null;\n\t}",
"public function isPost()\n {\n return $this->isPost;\n }",
"private function _isCallbackModeUsingPost()\n {\n return $this->_callback_mode_using_post;\n }",
"public function hasProcess()\n {\n return $this->process !== null;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return merchant acquirer certificate | public function getAcquirerCertificate()
{
return $this->acquirerCertificate;
} | [
"abstract public function getConsumerCertificate();",
"public function get_certificate() {\n return self::extract_key($this->get_certificate_file());\n }",
"public function getCertificate(): string\n {\n switch ($this->ctxMode) {\n case self::MODE_TEST:\n return $this->certificateTest;\n case self::MODE_PROD:\n return $this->certificateProd;\n }\n\n return '';\n }",
"public function getCertificate(){\n return \\LightSaml\\Credential\\X509Certificate::fromFile('cert/saml_test_certificate.crt');\n }",
"protected function retrieveCertificate()\n {\n return $this->downloadCertificateFromAmazon();\n }",
"public function get_cert_path() {\n\n\t\treturn get_option( 'sv_wc_apple_pay_cert_path' );\n\t}",
"public function getFallbackAcquirerCertificate()\n {\n return $this->fallbackAcquirerCertificate;\n }",
"public function getCertificatePassphrase();",
"public function getCertPassPhrase() : string;",
"public function getAcceptanceCertificateXmlForSellerResource() : string\n {\n return $this->getHost() . static::RESOURCE_GENERATE_ACCEPTANCE_CERTIFICATE_XML_FOR_SELLER;\n }",
"public function certificate() {\n return self::query($this->client, [$this->id, self::CERTIFICATE]);\n }",
"public function getSigningCertificate(): string\n {\n return $this->signingCert;\n }",
"public function getCertificate()\n {\n return $this->certificate;\n }",
"public function getCertificate()\n {\n return $this->_pathToCertificate;\n }",
"function GetMerchantKey() {\n /*\n * +++ CHANGE ME +++\n * Please set the return value to your Google Checkout merchant key.\n *\n * WARNING: You need to modify this function to securely fetch and return \n * your merchant key from a location that cannot be reached through \n * a web browser. For example, the function could extract the \n * merchant key from a database or secure config file.\n * This change is mandatory or this code will not work.\n */\n\n return \"hZTtCFv5bQTrpZf1DFGWvg\";\n}",
"public function certificado();",
"public function getCert()\n {\n return $this->certificado;\n }",
"public function getApnsCertificate()\n {\n return $this->apnsCertificate;\n }",
"function wpec_get_certificate() {\n\tglobal $post;\n\n\tif( ! isset( $_REQUEST['certificate'] ) || ! isset( $_REQUEST['purchase_id'] ) )\n\t\treturn;\n\n\t$purchase_id = (int) $_REQUEST['purchase_id'];\n\t\n\t$redemption = wpec_dd_redemption_code( $_REQUEST['purchase_id'] );\n\t\n\t$plugin_dir = WP_PLUGIN_DIR . '/' . str_replace( basename( __FILE__ ),\"\",plugin_basename( __FILE__ ) );\n\t\t\t\t\t\n\t\t\t\t$url = add_query_arg( array( 'certificate' => 1, 'purchase_id' => $purchase_id ), home_url() );\n\t\t\t\t\t\n\t// Print to HTML or PDF\n\tif( ! isset( $_REQUEST['pdf'] ) ) :\n\t\t// Print HTML certificate...\n\t\twpec_redemption_certificate( $purchase_id );\n\telse :\n\t\t\t\t\t\t\t\t\t// Load dompdf library\n\t\t\t\t\t\t\t\t\trequire_once( $plugin_dir . \"dompdf/dompdf_config.inc.php\" );\n\t\t\t\t\t\t\t\t\t$html = wp_remote_get( $url );\n\t\t\t\t\t\t\t\t\t$html = $html['body'];\n\t\t\t\t\t\t\t\t\t// Print PDF certificate.\n\t\t$dompdf = new DOMPDF();\n\t\t$dompdf->load_html( $html );\n\t\t$dompdf->render();\n\t\t$dompdf->stream( $redemption . \".pdf\" );\n\tendif;\n\t\n\tdie();\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Reject the specified company document in storage. | public function reject($cid, $id)
{
$company = Company::findOrFail($cid);
$ss = CompanyDocSubcontractorStatement::findOrFail($id);
// Check authorisation and throw 404 if not
//if (!Auth::user()->allowed2("sig.company.doc", $doc))
// return view('errors/404');
$ss->status = 3;
$ss->reject = request('reject');
$ss->closeToDo();
$ss->emailReject();
$ss->save();
Toastr::success("Contract rejected");
return redirect("/company/$company->id/doc/period-trade-contract/$ss->id");
} | [
"public function rejectResource()\n {\n # code...\n }",
"public function reject($cid, $id)\n {\n $company = Company::findOrFail($cid);\n $ptc = CompanyDocPeriodTrade::findOrFail($id);\n\n // Check authorisation and throw 404 if not\n //if (!Auth::user()->allowed2(\"sig.company.doc\", $doc))\n // return view('errors/404');\n\n $ptc->status = 3;\n $ptc->reject = request('reject');\n $ptc->closeToDo();\n $ptc->emailReject();\n $ptc->save();\n Toastr::success(\"Contract rejected\");\n\n return redirect(\"/company/$company->id/doc/period-trade-contract/$ptc->id\");\n }",
"public function emailReject()\n {\n $email_to = [env('EMAIL_DEV')];\n $email_user = (Auth::check() && validEmail(Auth::user()->email)) ? Auth::user()->email : '';\n\n if (\\App::environment('prod')) {\n // Send to User who uploaded doc & Company senior users\n $email_created = (validEmail($this->createdBy->email)) ? [$this->createdBy->email] : [];\n $email_seniors = []; //$this->company->seniorUsersEmail();\n $email_to = array_unique(array_merge($email_created, $email_seniors), SORT_REGULAR);\n }\n\n if ($email_to && $email_user)\n Mail::to($email_to)->cc([$email_user])->send(new \\App\\Mail\\Company\\CompanyDocRejected($this));\n elseif ($email_to)\n Mail::to($email_to)->send(new \\App\\Mail\\Company\\CompanyDocRejected($this));\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 deny()\n {\n $app = Application::getFacadeApplication();\n $this->fvIsApproved = false;\n $this->save();\n $fve = new FileVersionEvent($this);\n $app->make(EventDispatcher::class)->dispatch('on_file_version_deny', $fve);\n $app->make('cache/request')->delete('file/version/approved/' . $this->getFileID());\n }",
"public function cancelCompanyDeletion(): void\n {\n $this->dispatch('close-modal', id: 'confirmingCompanyDeletion');\n }",
"public function rejectRequest($id , Request $request){\n $document = Document::findOrFail($id);\n $document->stock_edit_request_approve = 2;\n $document->stock_edit_request_approve_date = Verta::now();\n $document->stock_edit_request_reject_remarks = $request->remarks;\n $document->save();\n\n createLog('documents',$id,'رد درخواست تصحیح جابجایی سند');\n\n Session::flash('success','درخواست موفقانه ثبت گردید!!!');\n return Redirect()->route('stock_edit_requests');\n }",
"public function disapprove(Companies_Model_Company $company) {\n $post = Zend_Controller_Front::getInstance()->getRequest()->getPost();\n\n if (empty($post) || !$this->isValidCsrfToken($post)) {\n self::addProcessingInfo(\"Error disapproving company, please contact the administrator or try again.\");\n return;\n }\n\n try {\n $company->status = Companies_Model_Company::STATUS_UNOWNED;\n $company->save();\n\n $users = $company->Users;\n\n foreach ($users as $user) {\n $user->status = Users_Model_User::STATUS_DELETED;\n $user->save();\n }\n\n Main_Service_Models::addProcessingInfo(\n \"Company disapproved.\",\n Main_Service_Models::PROCESSING_INFO_SUCCESS_TYPE\n );\n } catch (Exception $e) {\n self::getLogger()->log($e->getMessage());\n self::addProcessingInfo(\"Error disapproving company, please contact the administrator or try again.\");\n }\n }",
"public function deny()\n {\n $app = Facade::getFacadeApplication();\n $db = $app->make('database')->connection();\n $cvID = $this->cvID;\n $cID = $this->cID;\n\n // first we update a collection updated record\n $dh = $app->make('helper/date');\n $db->executeQuery('update Collections set cDateModified = ? where cID = ?', array(\n $dh->getOverridableNow(),\n $cID,\n ));\n\n // first we remove approval for all versions of this collection\n $v = array(\n $cID,\n );\n $q = \"update CollectionVersions set cvIsApproved = 0 where cID = ?\";\n $db->executeQuery($q, $v);\n\n // now we deny our version\n $v2 = array(\n $cID,\n $cvID,\n );\n $q2 = \"update CollectionVersions set cvIsApproved = 0, cvApproverUID = 0 where cID = ? and cvID = ?\";\n $db->executeQuery($q2, $v2);\n $this->refreshCache();\n }",
"public function rejectTrackingChanges()\n {\n //build URI to merge Docs\n $strURI = Product::$baseProductUri . '/words/' . $this->getFileName() . '/revisions/rejectAll';\n\n AsposeApp::getLogger()->info('WordsDocument rejectTrackingChanges call will be made', array(\n 'call-uri' => $strURI,\n ));\n \n //sign URI\n $signedURI = Utils::sign($strURI);\n\n $responseStream = Utils::processCommand($signedURI, 'POST', '', '');\n\n $json = json_decode($responseStream);\n\n if ($json->Code == 200) {\n return true;\n }\n \n AsposeApp::getLogger()->warning('Error occured, http 200 code was not found.', array(\n 'json-code' => $json->Code,\n ));\n return false;\n }",
"public function forceDeleted(Company $company)\n {\n //\n }",
"public function claim(Request $request, Company $company)\n {\n $claim = new Claim;\n //if he user requested claim\n //if the user already have a company\n //if the user already the owner of the company\n //if the company already a verified company\n if($company->requested_claim(auth()->id(), $company->id) || $company->has_company() == true || $company->is_owner(auth()->id())) {\n return redirect(route('front.company.all'));\n }else {\n\n $this->validate($request, [\n 'role' => 'required|string|max:255'\n ]);\n\n $claim->user_id = auth()->id();\n $claim->company_id = $company->id;\n $claim->role = $request['role'];\n $claim->comments = $request['comments'];\n\n if($request->hasFile('document')) {\n\n $file = $request->file('document');\n $files = [];\n foreach($file as $f) {\n $filename = time() . '-' . str_slug($f->getClientOriginalName()) . '.' . $f->getClientOriginalExtension();\n //store in the storage folder\n $f->storeAs('/', $filename, 'company_files');\n $files[] = $filename;\n\n }\n $claim->document = implode(',', $files);\n\n }\n\n $claim->save();\n\n session()->flash('success', 'تم ارسال طلبك بنجاح.');\n \n Mail::to('info@masharee3.com')->send(new ClaimNotification($company));\n\n $do = new ProjectFunctions;\n $do->email_log($claim->user_id, $claim->user->email);\n\n return redirect(route('front.company.claim-thanks', $company->slug));\n }\n }",
"public function forceDeleted(contactCompany $contactCompany)\n {\n //\n }",
"public function postCancel(Document $document, Request $request): Response\n {\n $this->validate($request, Cancel::getValidationRules());\n\n $meta = $request->get('meta');\n\n $transaction = $document->cancel((int)$meta['cancel_fiscal']);\n\n return response($transaction->jsonSerialize());\n }",
"public function reject()\n {\n if ($this->withdrawal->status == Withdrawal::STATUS_CREATED) {\n // update withdrawal model\n $this->withdrawal->status = Withdrawal::STATUS_REJECTED;\n $this->withdrawal->save();\n // create a credit transaction on user account to return funds\n $accountService = new AccountService($this->withdrawal->account);\n $accountService->transaction($this->withdrawal, $this->withdrawal->amount);\n }\n }",
"public function unlinkCompanyAttachmentFile(Model $company, $document_id)\n {\n if (count($company->documents()->where('document_id', $document_id)->first())){\n /*Detach attachment from dir*/\n $file_path = $company->companyAttachmentFile($document_id);\n if (file_exists($file_path)) {\n unlink($file_path);\n }\n }\n }",
"public function deleted(Company $company)\n {\n //\n }",
"public function deleted(Company $company)\n {\n //\n }",
"public function reject()\n {\n if ($this->isRejectable()) {\n $this->setStatus(self::STATUS_UNSUBMITTED);\n } else {\n throw new \\Exception('Can only reject a submitted DIF');\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the lastMessagePreview Preview of the last message sent in the chat. Null if no messages have been sent in the chat. Currently, only the list chats operation supports this property. | public function getLastMessagePreview()
{
if (array_key_exists("lastMessagePreview", $this->_propDict)) {
if (is_a($this->_propDict["lastMessagePreview"], "\Beta\Microsoft\Graph\Model\ChatMessageInfo") || is_null($this->_propDict["lastMessagePreview"])) {
return $this->_propDict["lastMessagePreview"];
} else {
$this->_propDict["lastMessagePreview"] = new ChatMessageInfo($this->_propDict["lastMessagePreview"]);
return $this->_propDict["lastMessagePreview"];
}
}
return null;
} | [
"public function lastMessage()\n {\n $messages = $this->messages();\n\n if (! count($messages)) {\n return null;\n }\n\n // API returns messages from newest to oldest so last message is the\n // first one of the list\n return $messages[0];\n }",
"public function getLastMessage() {\n return $this->messages[count($this->messages)-1];\n // return array_pop($this->messages);\n }",
"public function getLastMessage()\n {\n return $this->lastMessage? : $this->getTemporaryData('last_message');\n }",
"public function lastMessage()\n {\n return $this->hasOne(Message::class)->latest();\n }",
"public function getLastMessage()\r\n {\r\n return $this->lastMessage;\r\n }",
"public function chat()\n {\n return $this->message()->chat ?? null;\n }",
"public function getMessagePreview() {\n\t\t$messageList = new SimplifiedViewableConversationMessageList();\n\t\t\n\t\t$messageList->getConditionBuilder()->add(\"conversation_message.messageID = ?\", array($this->conversation->firstMessageID));\n\t\t$messageList->readObjects();\n\t\t$messages = $messageList->getObjects();\n\t\t\n\t\tWCF::getTPL()->assign(array(\n\t\t\t'message' => reset($messages)\n\t\t));\n\t\treturn array(\n\t\t\t'template' => WCF::getTPL()->fetch('conversationMessagePreview')\n\t\t);\n\t}",
"public function get_message_preview()\n {\n return Text::limit_chars($this->message, 128, '...', TRUE);\n }",
"public function getLastMessage() {\n\t\treturn $this->lastMessage;\n\t}",
"public function getLastMessage()\n {\n return $this->msg;\n }",
"public function getLatestMessage()\n {\n return $this->latest_message;\n }",
"function getLastMessage()\n {\n $db = Controller::getDB();\n $sql = \"SELECT id FROM messages WHERE conversations_id = \" . (int)$this->id . \" ORDER BY date_created DESC LIMIT 1\";\n \n if (!$result = $db->query($sql)) {\n return false;\n }\n \n if ($result->num_rows == 0) {\n return false;\n }\n \n $result = $result->fetch_assoc();\n \n return \\UNL\\VisitorChat\\Message\\Record::getByID($result['id']);\n }",
"public function last_message()\n {\n return $this->hasOne(Message::class)\n ->orderBy($this->tablePrefix.'messages.id', 'desc')\n ->with('participation');\n }",
"public function last_message()\n {\n return $this->hasOne(Message::class)->orderBy('mc_messages.id', 'desc')->with('sender');\n }",
"public function get_last_message ()\n {\n return $this->last_message;\n }",
"protected function lastMessage()\n {\n $messages = $this->messages();\n\n $last = array_shift($messages);\n\n return $this->emailFromId($last['id']);\n }",
"public function getChatMessagesWithLastMessage() {\n $currentUser = $this->getAuthenticatedUser();\n $chats = Chat::getFromUserWithLastMessages($currentUser);\n return parent::response([\n 'success' => true,\n 'chats' => $chats\n ]);\n }",
"public function mostRecent() {\n\t\treturn $this->_message->top();\n\t}",
"public function getLastAddedMessage()\n {\n return $this->_lastAddedMessage;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Operation getLootboxManagersWithHttpInfo Get lootbox managers | public function getLootboxManagersWithHttpInfo($x_game_key, string $contentType = self::contentTypes['getLootboxManagers'][0])
{
$request = $this->getLootboxManagersRequest($x_game_key, $contentType);
try {
$options = $this->createHttpClientOption();
try {
$response = $this->client->send($request, $options);
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
(int) $e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
$e->getResponse() ? (string) $e->getResponse()->getBody() : null
);
} catch (ConnectException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
(int) $e->getCode(),
null,
null
);
}
$statusCode = $response->getStatusCode();
if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
(string) $request->getUri()
),
$statusCode,
$response->getHeaders(),
(string) $response->getBody()
);
}
switch($statusCode) {
case 200:
if ('\MetaFab\Model\GetLootboxManagers200ResponseInner[]' === '\SplFileObject') {
$content = $response->getBody(); //stream goes to serializer
} else {
$content = (string) $response->getBody();
if ('\MetaFab\Model\GetLootboxManagers200ResponseInner[]' !== 'string') {
$content = json_decode($content);
}
}
return [
ObjectSerializer::deserialize($content, '\MetaFab\Model\GetLootboxManagers200ResponseInner[]', []),
$response->getStatusCode(),
$response->getHeaders()
];
case 400:
if ('string' === '\SplFileObject') {
$content = $response->getBody(); //stream goes to serializer
} else {
$content = (string) $response->getBody();
if ('string' !== 'string') {
$content = json_decode($content);
}
}
return [
ObjectSerializer::deserialize($content, 'string', []),
$response->getStatusCode(),
$response->getHeaders()
];
}
$returnType = '\MetaFab\Model\GetLootboxManagers200ResponseInner[]';
if ($returnType === '\SplFileObject') {
$content = $response->getBody(); //stream goes to serializer
} else {
$content = (string) $response->getBody();
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(),
'\MetaFab\Model\GetLootboxManagers200ResponseInner[]',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
break;
case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
'string',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
break;
}
throw $e;
}
} | [
"public function getManagers();",
"public function getManagersList(): array\n {\n $managers = Manager::with('details')->get();\n\n $all = [];\n\n foreach ($managers as $manager) {\n /** @var Manager $manager */\n /** @var ManagerDetails $details */\n $details = $manager->details;\n $name = $details ? $details->fullName() : $manager->getAttribute('email');\n $displayName = $details ? $details->displayName() : '';\n\n $all[] = [\n 'id' => $manager->getAttribute('id'),\n 'caption' => $name . ($displayName ? ' \"' . $displayName . '\"' : ''),\n ];\n }\n\n return $all;\n }",
"public function getManagers(): array;",
"private function getLeagueManagers() {\n\t\t$stmt = Database::$conn->prepare($this->query_league_managers);\n\n\t\t$stmt->bindParam(':id', $this->data['id']);\n\n\t\tif ($stmt->execute()) {\n\t\t\t$this->return_data['league_managers'] = $stmt->fetchAll(PDO::FETCH_ASSOC);\n\t\t}\n\t\telse {\n\t\t\t$this->success = false;\n\t\t}\n\t}",
"public function createLootboxManagerWithHttpInfo($x_authorization, $x_wallet_decrypt_key, $create_lootbox_manager_request, string $contentType = self::contentTypes['createLootboxManager'][0])\n {\n $request = $this->createLootboxManagerRequest($x_authorization, $x_wallet_decrypt_key, $create_lootbox_manager_request, $contentType);\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 switch($statusCode) {\n case 200:\n if ('\\MetaFab\\Model\\CreateLootboxManager200Response' === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n if ('\\MetaFab\\Model\\CreateLootboxManager200Response' !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\MetaFab\\Model\\CreateLootboxManager200Response', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n case 400:\n if ('string' === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n if ('string' !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, 'string', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n case 401:\n if ('string' === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n if ('string' !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, 'string', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\MetaFab\\Model\\CreateLootboxManager200Response';\n if ($returnType === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\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 '\\MetaFab\\Model\\CreateLootboxManager200Response',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 400:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n 'string',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 401:\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 getLootboxManagerLootboxesAsyncWithHttpInfo($lootbox_manager_id, string $contentType = self::contentTypes['getLootboxManagerLootboxes'][0])\n {\n $returnType = '\\MetaFab\\Model\\LootboxManagerLootbox[]';\n $request = $this->getLootboxManagerLootboxesRequest($lootbox_manager_id, $contentType);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n if ($returnType === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\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 (string) $response->getBody()\n );\n }\n );\n }",
"public function getManagers(): array {\n\t\treturn (array) elgg_get_entities([\n\t\t\t'type' => 'user',\n\t\t\t'relationship' => self::MANAGER_RELATIONSHIP,\n\t\t\t'relationship_guid' => $this->guid,\n\t\t\t'inverse_relationship' => true,\n\t\t\t'callback' => function($row) {\n\t\t\t\treturn $row->guid;\n\t\t\t},\n\t\t]);\n\t}",
"public function managerList() \n { \n $manager = User::role(\"User\")->get();\n return response([ 'data' => ToArray::collection($manager), 'message' => 'Users list retrieved successfully'], $this->successStatus);\n }",
"public function evaluationSkillv1evaluationsmanagerWithHttpInfo()\n {\n // parse inputs\n $resourcePath = \"/skill/v1/evaluations/manager\";\n $httpBody = '';\n $queryParams = [];\n $headerParams = [];\n $formParams = [];\n $_header_accept = $this->apiClient->selectHeaderAccept([]);\n if (!is_null($_header_accept)) {\n $headerParams['Accept'] = $_header_accept;\n }\n $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType([]);\n\n // default format to json\n $resourcePath = str_replace(\"{format}\", \"json\", $resourcePath);\n\n \n // for model (json/xml)\n if (isset($_tempBody)) {\n $httpBody = $_tempBody; // $_tempBody is the method argument, if present\n } elseif (count($formParams) > 0) {\n $httpBody = $formParams; // for HTTP post (form)\n }\n // this endpoint requires OAuth (access token)\n if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) {\n $headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken();\n }\n // make the API Call\n try {\n list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(\n $resourcePath,\n 'GET',\n $queryParams,\n $httpBody,\n $headerParams,\n '\\Swagger\\Client\\Model\\SkillEvaluationGetManagerSummaryResponse',\n '/skill/v1/evaluations/manager'\n );\n\n return [$this->apiClient->getSerializer()->deserialize($response, '\\Swagger\\Client\\Model\\SkillEvaluationGetManagerSummaryResponse', $httpHeader), $statusCode, $httpHeader];\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\\Swagger\\Client\\Model\\SkillEvaluationGetManagerSummaryResponse', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n }\n\n throw $e;\n }\n }",
"protected function managers() {\n\t\treturn $this->managers;\n\t}",
"function getManagers(){\r\n\t\t\t$managers = $this->Manager->find(\r\n\t\t\t\t'list',\r\n\t\t\t\tarray(\r\n\t\t\t\t\t'fields' => array(\r\n\t\t\t\t\t\t'Manager.id',\r\n\t\t\t\t\t\t'Manager.username'\r\n\t\t\t\t\t),\r\n\t\t\t\t\t'conditions' => array(\r\n\t\t\t\t\t\t'Manager.group_id' => $this->managerGroups\r\n\t\t\t\t\t)\r\n\t\t\t\t)\r\n\t\t\t);\r\n\r\n\t\t\treturn $managers;\r\n\t\t}",
"public static function listManagers()\n\t{\n\t\t$strDealerTable\t\t= self::getDataSourceObjectName();\n\t\t$strDealerIdField\t= self::getDataSourceIdName();\n\t\t$arrProps\t\t\t= self::getPropertyDataSourceMappings();\n\t\t\n\t\treturn self::getFor(\"$strDealerIdField IN (SELECT DISTINCT {$arrProps['upLineId']} FROM $strDealerTable WHERE {$arrProps['upLineId']} IS NOT NULL)\", TRUE, \"{$arrProps['username']} ASC\");\n\t}",
"public function index(Request $request)\n {\n $this->packagerRepository->pushCriteria(new RequestCriteria($request));\n $this->packagerRepository->pushCriteria(new LimitOffsetCriteria($request));\n $packagers = $this->packagerRepository->all();\n\n return $this->sendResponse($packagers->toArray(), 'Packagers retrieved successfully');\n }",
"public function getMangaRandomWithHttpInfo()\n {\n $request = $this->getMangaRandomRequest();\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() !== null ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() !== null ? (string) $e->getResponse()->getBody() : 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 if ($statusCode === 200) {\n if ('\\Mapsred\\MangadexSDK\\Model\\MangaResponse' === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n }\n return [\n ObjectSerializer::deserialize($content, '\\Mapsred\\MangadexSDK\\Model\\MangaResponse', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\Mapsred\\MangadexSDK\\Model\\MangaResponse';\n if ($returnType === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n if ($e->getCode() === 200) {\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Mapsred\\MangadexSDK\\Model\\MangaResponse',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n }\n throw $e;\n }\n }",
"public function getSupportedManagers()\n {\n return $this->supportedManagers;\n }",
"public function openLootboxManagerLootboxAsyncWithHttpInfo($lootbox_manager_id, $lootbox_manager_lootbox_id, $x_authorization, $x_wallet_decrypt_key, string $contentType = self::contentTypes['openLootboxManagerLootbox'][0])\n {\n $returnType = '\\MetaFab\\Model\\TransactionModel[]';\n $request = $this->openLootboxManagerLootboxRequest($lootbox_manager_id, $lootbox_manager_lootbox_id, $x_authorization, $x_wallet_decrypt_key, $contentType);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n if ($returnType === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\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 (string) $response->getBody()\n );\n }\n );\n }",
"public function searchMenuItemsWithHttpInfo($query, $min_calories = null, $max_calories = null, $min_carbs = null, $max_carbs = null, $min_protein = null, $max_protein = null, $min_fat = null, $max_fat = null, $offset = null, $number = null)\n {\n $request = $this->searchMenuItemsRequest($query, $min_calories, $max_calories, $min_carbs, $max_carbs, $min_protein, $max_protein, $min_fat, $max_fat, $offset, $number);\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 switch($statusCode) {\n case 200:\n if ('object' === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n }\n\n return [\n ObjectSerializer::deserialize($content, 'object', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = 'object';\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\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 'object',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function testGetLootboxManagerLootbox()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }",
"public function testCreateLootboxManager()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the background as it is currently stored (currently anyway only for completeness. not used for further processing) | function get_background_attachment()
{
return $this->_props["background_attachment"];
} | [
"public function getBackground()\n\t{\n\t\treturn $this->background; \n\n\t}",
"public function getNewBackground()\n\t{\n\t\treturn $this->newBackground; \n\n\t}",
"public function getBackground()\n {\n return $this->background;\n }",
"public function get_background()\r\n\t{\r\n\t\treturn $this->get_attr('background');\r\n\t}",
"function readBackgroundRepeat() {return $this->_backgroundrepeat;}",
"function readBackgroundPosition() {return $this->_backgroundposition;}",
"function GetBackgroundColour(){}",
"public function getBg() {\n return $this->get(self::BG);\n }",
"public static function retrieveBackgrounds() {\n\t\t$data = File::find('all',array('conditions' => array('_id' => 'background'), 'fields' => array('_id' => 1)));\n\t\treturn $data->data();\n\t}",
"public function getIsBackground()\n {\n return $this->isBackground;\n }",
"public function getBackgrounds()\n {\n return $this->_backgrounds;\n }",
"public function get_background_image() {\n return $this->background_image;\n }",
"function get_background_image() {}",
"public function getBackgroundImage()\n {\n return Mage::getStoreConfig(self::XML_PATH_BACKGROUND_IMAGE);\n }",
"public static function getBackground()\n {\n $background = self::getConfig()->get('steempi', 'background');\n\n if (empty($background)) {\n $background = '/app/images/backgrounds/default-06.jpg';\n }\n\n $realPath = self::getRootPath().$background;\n\n if (!file_exists($realPath)) {\n $background = '/app/images/backgrounds/default-06.jpg';\n }\n\n return $background;\n }",
"public function get_background_default_values() {\r\n return $this->bg_default_values;\r\n }",
"public function getBgLoop()\n {\n return $this->BgLoop;\n }",
"public function getCurrentBackgroundColor() {\n return $currentBackgroundColor;\n }",
"public function getimagebackgroundcolor(){}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Dispatch the next job on the chain. | public function dispatchNextJobInChain()
{
if (! empty($this->chained)) {
dispatch(tap(unserialize(array_shift($this->chained)), function ($next) {
$next->chained = $this->chained;
$next->onConnection($next->connection ?: $this->chainConnection);
$next->onQueue($next->queue ?: $this->chainQueue);
$next->sharedData($this->sharedData);
$next->chainConnection = $this->chainConnection;
$next->chainQueue = $this->chainQueue;
}));
}
} | [
"public function dispatchNextJobInChain()\n {\n $me = $this;\n if (! empty($this->chained)) {\n dispatch(tap(unserialize(array_shift($this->chained)), function ($next) use($me) {\n $next->chained = $me->chained;\n }));\n }\n }",
"public function dispatch_queue() {\n\t\tif ( ! empty( $this->data ) ) {\n\t\t\t$this->save()->dispatch();\n\t\t}\n\t}",
"public function getNextJob();",
"public function runNextJob()\n {\n $job = $this->getNextJob();\n\n if ( false === $job ) {\n $this->sendOutput(\"No jobs in queue\");\n return;\n }\n\n $this->sendOutput(\"Running next job in queue\");\n\n try {\n $job = $this->extractJobInfo($job);\n\n $this->dispatcher->fireListener(\n $job['event_name'],\n $job['listener'],\n $job['payload'],\n $job['attempts']\n );\n } catch (EventListenerDidNotRun $e) {\n $this->jobFailed($job, $e);\n } catch (EventListenerNotCallable $e) {\n $this->jobFailed($job, $e);\n }\n }",
"public function startNextJobHardcore()\n {\n // Call startNextJob to see if it can start the next job for us\n if ($this->startNextJob())\n return; // If it started the next job then YAY we don't have to do shit\n\n // Didn't start the next job? Let's try to find the next one if there is any\n $nextJob = self::where(\"city_id\", $this->city_id)\n ->where(\"status\", \"queued\")\n ->first();\n\n if ($nextJob == null)\n return; // No jobs are queued\n\n // If we found a queued job, then let's start it\n $this->start($nextJob);\n }",
"public function next(): void\n {\n next($this->payload);\n }",
"protected function dispatch() {\n\t\t\tif ( $this->is_http_worker_disabled() ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( ! $this->dispatched ) {\n\t\t\t\t$this->async_request();\n\t\t\t}\n\n\t\t\t$this->dispatched = true;\n\t\t}",
"public function next()\n {\n next($this->payload);\n }",
"public function execute() {\n //the request map that maps the request queue to request curl handles\n $requests_map = array();\n $multi_handle = curl_multi_init();\n $num_outstanding = 0;\n //start processing the initial request queue\n $num_initial_requests = min($this->_maxConcurrent, count($this->requests));\n for($i = 0; $i < $num_initial_requests; $i++) {\n $this->initRequest($i, $multi_handle, $requests_map);\n $num_outstanding++;\n }\n do{\n do{\n $mh_status = curl_multi_exec($multi_handle, $active);\n } while($mh_status == CURLM_CALL_MULTI_PERFORM);\n if($mh_status != CURLM_OK) {\n break;\n }\n //a request is just completed, find out which one\n while($completed = curl_multi_info_read($multi_handle)) {\n $this->processRequest($completed, $multi_handle, $requests_map);\n $num_outstanding--;\n //try to add/start a new requests to the request queue\n while(\n $num_outstanding < $this->_maxConcurrent && //under the limit\n $i < count($this->requests) && isset($this->requests[$i]) // requests left\n ) {\n $this->initRequest($i, $multi_handle, $requests_map);\n $num_outstanding++;\n $i++;\n }\n }\n usleep(15); //save CPU cycles, prevent continuous checking\n } while ($active || count($requests_map)); //End do-while\n $this->reset();\n curl_multi_close($multi_handle);\n }",
"public function dispatchJobs()\n {\n while (true) {\n foreach ($this->queuedJobs as $aJob) {\n $workerName = $aJob[0];\n $jobData = $aJob[1];\n\n // Skip over jobs we are not listening to\n if (!isset($this->listeners[$workerName])) {\n continue;\n }\n\n // Construct job wrapper\n $job = new Job();\n $job->setWorkload($jobData);\n\n // Send job to the worker\n $worker = $this->listeners[$workerName];\n $worker->work($job);\n return true;\n }\n }\n }",
"private function dispatch(): void\n {\n if ($this->isRunning) return;\n\n $this->isRunning = true;\n\n while (!$this->queue->isEmpty())\n {\n $event = $this->queue->dequeue();\n\n if (isset($this->listeners[$event]))\n {\n foreach ($this->listeners[$event] as $callable)\n {\n call_user_func($callable);\n }\n }\n }\n\n $this->isRunning = false;\n }",
"public function work() {\n $this->model = ModelManager::getInstance()->getModel(QueueModel::NAME);\n\n do {\n $data = $this->model->popJobFromQueue($this->name);\n if ($data) {\n echo $this->name . ': Invoking job #' . $data->id . ' ... ';\n $dateReschedule = $this->invokeJob($data);\n\n if ($dateReschedule == -1) {\n echo \"error\\n\";\n } else {\n echo \"done\\n\";\n\n if (is_numeric($dateReschedule) && $dateReschedule > time()) {\n echo $this->name . ': Rescheduling job #' . $data->id . ' from ' . date('Y-m-d H:i:s', $dateReschedule) . \"\\n\";\n $queueModel->pushJobToQueue($data->job, $dateReschedule);\n }\n }\n } elseif (!$this->sleepTime) {\n echo $this->name . \": Nothing to be done and no sleep time. Exiting ...\\n\";\n break;\n }\n\n if ($this->sleepTime) {\n echo $this->name . ': Sleeping ' . $this->sleepTime . \" second(s)...\\n\";\n sleep($this->sleepTime);\n }\n } while (true);\n }",
"final public function callNext()\n {\n $nextMiddleware = $this->next;\n\n if (!$nextMiddleware) {\n return;\n }\n\n $nextMiddleware->call();\n }",
"public function process()\n {\n foreach ($this->jobs as $id => $job) {\n // get the job name\n $name = ucfirst($job['type']);\n // process the job\n $this->{\"process{$name}\"}($job);\n // remove it from the processing queue\n unset($this->jobs[$id]);\n }\n }",
"public static function process() {\n\t\t\tif ( ($job = self::_next_job()) !== false ) {\n\t\t\t\tself::_run_task($job);\n\t\t\t}\n\t\t}",
"public function execute ()\n\t{\n\n\t\t// skip to the next filter\n\t\t$this->index++;\n\n\t\tif ($this->index < count($this->chain))\n\t\t{\n\n\t\t\t// execute the next filter\n\t\t\t$this->chain[$this->index]->execute($this);\n\n\t\t}\n\n\t}",
"function dispatch_tinker($job)\n {\n return app(\\Illuminate\\Contracts\\Bus\\Dispatcher::class)->dispatch($job);\n }",
"function postSyncJob(){\n// $url = 'fetchMProductInfo';\n// $json = [\n// \"async\" => true,\n// \"url\" => route('product_price_collect', ['product_id'=>$this->id]),\n// \"urls\" => \\GuzzleHttp\\json_decode($this->trace_urls,true)\n// ];\n// Log::info('Enqueue job for product '.$this->id);\n// Log::info($json);\n// $client = self::getClient();\n// $response = $client->request('POST', $url, compact('json'));\n// return self::processResult($response);\n $urls = \\GuzzleHttp\\json_decode($this->trace_urls,true);\n\n foreach ($urls as $url){\n FetchPriceJob::dispatch($url, $this);\n }\n }",
"public function handle()\n {\n // Do your queued job\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the grouped config parameters. | public function getGroupedConfigParameters()
{
$configParameters = $this->config->getConfigParameters();
$groupedConfigParameters = [];
$postTypes = $this->getPostTypes();
foreach ($postTypes as $postType => $postTypeObject) {
if ($postType === ObjectHandler::ATTACHMENT_OBJECT_TYPE) {
continue;
}
$groupedConfigParameters[$postType] = [
$configParameters["hide_{$postType}"],
$configParameters["hide_{$postType}_title"],
$configParameters["{$postType}_title"],
$configParameters["{$postType}_content"],
$configParameters["hide_{$postType}_comment"],
$configParameters["{$postType}_comment_content"],
$configParameters["{$postType}_comments_locked"]
];
if ($postType === 'post') {
$groupedConfigParameters[$postType][] = $configParameters["show_{$postType}_content_before_more"];
}
}
$taxonomies = $this->getTaxonomies();
foreach ($taxonomies as $taxonomy => $taxonomyObject) {
if ($taxonomy === ObjectHandler::POST_FORMAT_TYPE) {
continue;
}
$groupedConfigParameters[$taxonomy][] = $configParameters["hide_empty_{$taxonomy}"];
}
$groupedConfigParameters['file'] = [
$configParameters['lock_file'],
$configParameters['download_type'],
$configParameters['lock_file_types'],
$configParameters['file_pass_type']
];
$groupedConfigParameters['author'] = [
$configParameters['authors_has_access_to_own'],
$configParameters['authors_can_add_posts_to_groups'],
$configParameters['full_access_role'],
];
$groupedConfigParameters['other'] = [
$configParameters['lock_recursive'],
$configParameters['protect_feed'],
$configParameters['show_assigned_groups'],
$configParameters['redirect'],
$configParameters['blog_admin_hint'],
$configParameters['blog_admin_hint_text'],
];
return $groupedConfigParameters;
} | [
"public function getGroupConfig()\n {\n return $this->group_config;\n }",
"public function getGroups()\n {\n return $this->config['groups'];\n }",
"public function getParamgroups()\n {\n if (empty($this->paramgroups)) {\n $this->paramgroups = $this->container->get('doctrine')->getManager()\n ->getRepository('JCSGYKAdminBundle:Paramgroup')\n ->getAll($this->getCompanyId());\n }\n\n return $this->paramgroups;\n }",
"public function getConfigurationGroups()\n {\n return $this->configurationGroups;\n }",
"private function getRouteGroupParams()\n {\n return [\n 'namespace' => $this->getNamespaceControllers(),\n ];\n }",
"public function getAppPageGroupConfig(){\r\n\t\treturn Mage::getConfig()->getNode('global/app_page_groups')->asArray();\r\n\t}",
"public static function get_allowed_settings_by_group()\n {\n }",
"public function getNodeGroupConfig()\n {\n return $this->node_group_config;\n }",
"public function config_group($group = 'default')\n\t{\n\t\t// Load the pagination config file\n\t\t$config_file = Kohana::config('charts');\n\t\t\n\t\t// Initialize the $config array\n\t\t$config['group'] = (string) $group;\n\n\t\t// Recursively load requested config groups\n\t\twhile (isset($config['group']) AND isset($config_file->$config['group']))\n\t\t{\n\t\t\t// Temporarily store config group name\n\t\t\t$group = $config['group'];\n\t\t\tunset($config['group']);\n\n\t\t\t// Add config group values, not overwriting existing keys\n\t\t\t$config += $config_file->$group;\n\t\t}\n\n\t\t// Get rid of possible stray config group names\n\t\tunset($config['group']);\n\n\t\t// Return the merged config group settings\n\t\treturn $config;\n\t}",
"function GetAllQuestionGroups()\n {\n return $this->config->question_groups;\n }",
"public function configGroup($group = 'default')\r\n {\r\n // Load the pagination config file\r\n $fileConfig = Config::load('pagination.php');\r\n\r\n // Initialize the $config array\r\n $config['group'] = (string) $group;\r\n\r\n // Recursively load requested config groups\r\n while (isset($config['group']) && isset($fileConfig->$config['group']))\r\n {\r\n // Temporarily store config group name\r\n $group = $config['group'];\r\n unset($config['group']);\r\n\r\n // Add config group values, not overwriting existing keys\r\n $config += $fileConfig->$group;\r\n }\r\n\r\n // Get rid of possible stray config group names\r\n unset($config['group']);\r\n\r\n // Return the merged config group settings\r\n return $config;\r\n }",
"function allConfig( $group = null )\n\t{\n\t\t$where = !empty( $group )? array( 'Group_ID' => $group ) : \"*\";\n\t\t$output = $this -> fetch( array( 'Key', 'Default' ), $where, null, null, 'config' );\n\t\t\n\t\tif ( empty($GLOBALS['config']) )\n\t\t{\n\t\t\tforeach ($output as $key => $value)\n\t\t\t{\n\t\t\t\t$configs[$output[$key]['Key']] = $output[$key]['Default'];\n\t\t\t}\n\t\t\t\n\t\t\t$GLOBALS['config'] = $configs;\n\t\t\t\n\t\t\treturn $configs;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn $GLOBALS['config'];\n\t\t}\n\t}",
"public function config_group($group = 'default')\n {\n // Load the pagination config file\n //$config_file = Kohana::config('pagination');\n\n // Initialize the $config array\n $config['group'] = (string) $group;\n\n // Recursively load requested config groups\n while (isset($config['group']) AND isset($config_file->$config['group']))\n {\n // Temporarily store config group name\n $group = $config['group'];\n unset($config['group']);\n\n // Add config group values, not overwriting existing keys\n $config += $config_file->$group;\n }\n\n // Get rid of possible stray config group names\n unset($config['group']);\n\n // Return the merged config group settings\n return $config;\n }",
"public function getAdminGroups()\n {\n return $this->container->getParameter('adminproject.admin.configuration.groups');\n }",
"public function getGroupsParam()\n {\n $this->mGroups = $this->removeEmpty($this->mGroups);\n return \"groups=\\\"\".implode(\",\", $this->mGroups).\"\\\"\";\n }",
"public function getManagedGroupConfig()\n {\n return $this->managed_group_config;\n }",
"public function getConfig() : array\n {\n return $this->section->getConfig('fieldSubsets.' . $this->type);\n }",
"public function get_all_groups_settings() {\r\n\r\n $groups = $this->get_all_groups();\r\n $group_settings = array();\r\n\r\n foreach ($groups as $key => $atts) {\r\n $group_settings[$key] = $this->get_group_settings($key);\r\n }\r\n\r\n return $group_settings;\r\n }",
"function getParamsConf()\n {\n return array();\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
A mechanism family's name can only be changed in the draft state once sandboxed, it is permanently set | static function change_name($family, $name, $shortname)
{
// get mechanism family
if(!$mfam = MongoLib::findOne_editable('mechanism_families', $family))
return ErrorLib::set_error("That mechanism family was not found");
// check mfam.square
if($mfam['square'] != 'draft')
return ErrorLib::set_error("That mechanism family has been published and can not be edited");
// check for name uniqueness
if(MongoLib::check('mechanism_families', array('name' => $name)))
return ErrorLib::set_error("That mechanism family name is taken");
// check shortname
$shortname = substr($shortname, 0, 20);
if(!$shortname || !is_string($shortname))
return ErrorLib::set_error("A valid shortname is required");
// THINK: maybe prevent pmech's name from changing unless the protocol is changing...?
// all clear!
// add transaction to history
History::add('mechanism_families', $mfam['_id'], array('action' => 'change_name', 'was' => $mfam['name']));
// update score type
$this_ref = array('mechanism_families', $mfam['_id']);
$filter['thing'] = $this_ref;
$st_update['shortname'] = $shortname;
MongoLib::set('score_types', $filter, $st_update);
// update the mechanism family
$update['name'] = $name;
return MongoLib::set('mechanism_families', $mfam['_id'], $update);
} | [
"public function unsetFamilyName(): void\n {\n $this->familyName = [];\n }",
"public function setFamily(string $family);",
"public function setFamilyName($value)\n {\n $this->familyName = $value;\n }",
"public function setFamilyName($newFamilyName)\n\t{\n\t\tif (is_string($newFamilyName))\n\t\t{\n\t\t\t$query = \"UPDATE \" . self::TABLENAME . \" SET familyName = $1 WHERE id = \" . $this->sqlId . \";\";\n\t\t\t$params[] = $newFamilyName;\n\t\t\t$result = Database::currentDB()->executeQuery($query, $params);\n\n\t\t\tif ($result)\n\t\t\t{\n\t\t\t\t$this->familyName = $newFamilyName;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tDatabase::currentDB()->showError(\"ligne n° \" . __LINE__ . \" Classe: \" . __CLASS__);\n\t\t\t}\n\t\t}\n\t}",
"public function setFamilyName(?string $familyName): void\n {\n $this->familyName = $familyName;\n }",
"public function setGiftcardRecipientName($value);",
"public function setName($name) {\n if ($name != $this->name) {\n // Save the old key so we can delete it later\n $this->old_key = $this->key;\n \n $this->key = self::getMemberKey($name);\n $this->name = $name;\n \n unset(self::$members[$this->old_key]);\n self::$members[$this->key] = $this;\n }\n }",
"public function getFamilyName(): string;",
"function swsctp_change_default_email_change_from_name($fromname) {\n $name_new = get_option( 'swsint-default-name' );\n if ( $name_new != \"\" ) {\n return $name_new;\n } else {\n return $fromname;\n }\n}",
"public function getFamilyName(): string\n {\n return $this->getUserDataString('family_name');\n }",
"public function setForename($forename)\n {\n $this->forename = $forename;\n }",
"public function testFamily()\n {\n $Name = new Name();\n \n $value = 'Berger-Payment';\n $Name->set('family',$value);\n \n $this->assertEquals($value, $Name->getFamily());\n }",
"public function setNameOfRecipient($nameOfRecipient){\r\n\t\t$this->nameOfRecipient = $nameOfRecipient;\r\n\t}",
"public function setRelyingPartyName(?string $value): void {\n $this->getBackingStore()->set('relyingPartyName', $value);\n }",
"function setName($newName){\n $this->name = \"Glittery \" . $newName;\n }",
"public function setAppPackageFamilyName(?string $value): void {\n $this->getBackingStore()->set('appPackageFamilyName', $value);\n }",
"function fwe_team_member_set_surname($post_id) {\n if (wp_is_post_revision($post_id)) return;\n if (!array_key_exists('post_type', $_POST)) return;\n if ($_POST['post_type'] !== 'team_member') return;\n\n $surname = get_post_meta($post_id, 'surname', true);\n\n if (!$surname) {\n $surname = fwe_get_surname($_POST['post_title']);\n update_post_meta($post_id, 'surname', $surname);\n }\n}",
"public function changeMessage()\n\t{\n\t\t\n\t}",
"function setName($new_name)\n {\n\n $this->name = $new_name ;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Combines this map with the supplied map The values in the supplied map will take precedence if this map and the supplied map have duplicate keys. | function merge(IMap $map); | [
"public function putAll(\\blaze\\collections\\Map $map) {\n $newMap = new \\blaze\\collections\\map\\HashMap();\n\n foreach ($map as $key => $value) {\n $newMap->put($this->key . '.' . self::getCheckedKey($key), $value);\n }\n\n return $this->cache->putAll($newMap);\n }",
"public function merge( IMap $map )\n {\n return $this->_delegate->merge($map);\n }",
"public function union(iterable $map): Map\n {\n return $this->withOperation(function () use ($map) {\n $map = Map::fromIterable($map)->toArray();\n $x = $this->toArray();\n\n yield from $x;\n\n foreach ($map as $key => $value) {\n if (!array_key_exists($key, $x)) {\n yield $key => $value;\n }\n }\n });\n }",
"public function merge($map, $recursive= FALSE) {\n if ($map instanceof Hashmap) {\n $h= $map->_hash;\n } else if (is_array($map)) {\n $h= $map;\n } else {\n throw new IllegalArgumentException('map is neither an array nor a Hashmap');\n }\n \n if ($recursive) {\n $this->_hash= array_merge_recursive($h, $this->_hash);\n } else {\n $this->_hash= array_merge($h, $this->_hash);\n }\n }",
"function merge_maps($map1, $map2)\n{\n}",
"public function putAll(MapInterface $map);",
"public function populate($map) {\n /* Set all properties from the map. We do array_keys + get_object_vars so that we aren't assigning the values to an\n * unused iterator variable (e.g. foreach($this as $key => $value) where $value is never used). */\n foreach (array_keys(get_object_vars($this)) as $key) {\n if (isset($map[$key])) {\n $this->$key = $map[$key];\n }\n }\n\n return $this;\n }",
"public function putAll(MapInterface $map): void;",
"public function setHashMap( $map );",
"public function putAll(Mappable $map);",
"public static function mapsWith(array $map)\n {\n return self::tuples($map)->fmap(function ($vals) use ($map) {\n return array_combine(array_keys($map), $vals);\n });\n }",
"function assoc(array $map, $key, $val, $kvals = null)\n{\n $arg_list = func_get_args();\n array_shift($arg_list);\n $chunked = array_chunk($arg_list, 2);\n\n foreach ($chunked as $pair) {\n $pair[1] = isset($pair[1]) ? $pair[1] : null; // for unbalanced case\n $append[$pair[0]] = $pair[1];\n }\n\n return array_merge($map, $append);\n}",
"public function testMerge()\r\n\t{\r\n // initialize a new HashMap\r\n $map = new TechDivision_Collections_HashMap();\r\n\t\t// initialize a new hash map and add some elements\r\n\t\t$mergeMap = new TechDivision_Collections_HashMap();\r\n\t\t$mergeMap->add(1, \"test_merge_1\");\r\n\t\t$mergeMap->add(3, \"test_merge_3\");\r\n\t\t// add some elements to the original hash map\r\n\t\t$map->add(1, \"test_original_1\");\r\n\t\t$map->add(2, \"test_original_2\");\r\n\t\t// merge the original map with the new one\r\n $map->merge($mergeMap);\r\n\t\t// check the merge result\r\n\t\t$this->assertEquals(3, $map->size());\r\n\t\t$this->assertEquals(\"test_original_1\", $map->get(1));\r\n }",
"protected function setAdditionalMapOptions(array &$map, array $options) {\n $default_settings = $this::getDefaultSettings();\n\n // Add additional settings to the Map, with fallback on the\n // hook_leaflet_map_info ones.\n $map['settings']['map_position_force'] = isset($options['map_position']['force']) ? $options['map_position']['force'] : $default_settings['map_position']['force'];\n $map['settings']['zoom'] = isset($options['map_position']['zoom']) ? (int) $options['map_position']['zoom'] : $default_settings['map_position']['force'];\n $map['settings']['minZoom'] = isset($options['map_position']['minZoom']) ? (int) $options['map_position']['minZoom'] : (isset($map['settings']['minZoom']) ? $map['settings']['minZoom'] : $default_settings['settings']['minZoom']);\n $map['settings']['maxZoom'] = isset($options['map_position']['maxZoom']) ? (int) $options['map_position']['maxZoom'] : (isset($map['settings']['maxZoom']) ? $map['settings']['maxZoom'] : $default_settings['settings']['maxZoom']);\n $map['settings']['center'] = (isset($options['map_position']['center']['lat']) && isset($options['map_position']['center']['lon'])) ? [\n 'lat' => floatval($options['map_position']['center']['lat']),\n 'lon' => floatval($options['map_position']['center']['lon']),\n ] : $default_settings['map_position']['center'];\n $map['settings']['scrollWheelZoom'] = $options['disable_wheel'] ? !(bool) $options['disable_wheel'] : (isset($map['settings']['scrollWheelZoom']) ? $map['settings']['scrollWheelZoom'] : TRUE);\n $map['settings']['path'] = isset($options['path']) && !empty($options['path']) ? $options['path'] : (isset($map['path']) ? Json::encode($map['path']) : Json::encode($default_settings['path']));\n $map['settings']['leaflet_markercluster'] = isset($options['leaflet_markercluster']) ? $options['leaflet_markercluster'] : NULL;\n $map['settings']['fullscreen_control'] = isset($options['fullscreen_control']) ? $options['fullscreen_control'] : $default_settings['fullscreen_control'];\n $map['settings']['reset_map'] = isset($options['reset_map']) ? $options['reset_map'] : $default_settings['reset_map'];\n }",
"public function merge(...$values);",
"function merge_with(&$other) {\n\t\tforeach ( $other->entries as $entry ) {\n\t\t\t$this->entries [$entry->key ()] = $entry;\n\t\t}\n\t}",
"public function applyUpdatesOnMap($map) {\n\t\tif($map === null || !is_array($map)){\n\t\t\t$map = array();\n\t\t}\n\t\tforeach ($this->updates as $update) {\n\t\t\t$map = self::replaceRecursive($map, $update);\n\t\t}\n\t\treturn $map;\n\t}",
"public function testConvertMapWithMixKey()\n {\n $serializer = new Gson3;\n $intType = $this->getintType();\n\n $converted = $serializer->convertMap([\"string1\" => \"test\", 2 => \"test2\"]);\n $this->assertEquals([\n \"@type\" => \"g:Map\",\n \"@value\" => [\n \"string1\", \"test\",\n [\"@type\" => $intType, \"@value\" => 2], \"test2\",\n ],\n ], $converted, \"Incorrect GS3 conversion for Map with mixed keys\");\n }",
"public function buildMap() {}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get all the boards for the category sorted by position. | public function sortedBoards()
{
return $this->boards()->orderBy('position');
} | [
"public function get_all_boards() {\n\t\tglobal $core;\n\t\t$query = $this->core->db->make_query(\"boards,categories\");\n\t\t$query->add_condition_direct(\"`boards`.`category_id` = `categories`.`category_id`\");\n\t\t$query->set_order(\"board_order ASC\");\n\t\t$result = $query->execute();\n\t\treturn $result;\n\t}",
"private function getBoards()\n\t{\n\t\tglobal $context;\n\n\t\trequire_once(SUBSDIR . '/Boards.subs.php');\n\t\t$context += getBoardList(array('not_redirection' => true));\n\t\t$num_boards = countBoards(null, array('include_redirects' => false));\n\n\t\t$context['topicprefix']['boards'] = empty($context['topicprefix']['boards']) ? array() : $context['topicprefix']['boards'];\n\t\t$context['boards_check_all'] = count($context['topicprefix']['boards']) == $num_boards;\n\n\t\t$context['boards_in_category'] = array();\n\t\tforeach ($context['categories'] as $cat => &$category)\n\t\t{\n\t\t\t$context['boards_in_category'][$cat] = count($category['boards']);\n\t\t\t$category['child_ids'] = array_keys($category['boards']);\n\n\t\t\tforeach ($category['boards'] as &$board)\n\t\t\t{\n\t\t\t\t$board['selected'] = in_array($board['id'], $context['topicprefix']['boards']);\n\t\t\t}\n\t\t}\n\t}",
"public final function grabBoards()\n {\n global $db;\n \n $result = $db->query('\n SELECT cat_id, name\n FROM {db_prefix}categories\n ORDER BY cat_order ASC');\n \n $categories = array();\n while ($row = $db->fetch_assoc($result))\n {\n $categories[$row['cat_id']] = array(\n \t'id' => $row['cat_id'],\n 'name' => $row['name'],\n 'boards' => array()\n );\n }\n \n $db->free_result($result);\n \n // And for the boards.\n $result = $db->query('\n SELECT board_id, name, description, num_posts, num_topics, category_id, board_order, permissions, last_post\n FROM {db_prefix}boards\n ORDER BY board_order ASC');\n \n $boards = array();\n while ($row = $db->fetch_assoc($result))\n {\n if (!isset($categories[$row['category_id']]))\n continue;\n \n $this->boards[$row['board_id']] = $row;\n \n // If we don't have permissions to view this board, skip it.\n if (!$this->checkBoardPermissions($row['board_id']))\n {\n \tunset($this->boards[$row['board_id']]);\n \tcontinue;\n }\n\t\t\t\n\t\t\t// If there is a last post, grab it.\n\t\t\t$data = $this->grabBoardLastPost($row['last_post'], $row['board_id']);\n \n $categories[$row['category_id']]['boards'][$row['board_order']] = $row;\n\t\t\t$categories[$row['category_id']]['boards'][$row['board_order']]['last_post'] = $data;\n }\n \n $db->free_result($result);\n \n $this->categories = array_filter($categories);\n \n return true;\n }",
"function boardsByCategory( $cID )\r\n { \r\n $return = array();\r\n \r\n $sql = 'SELECT b.b_id AS B_ID, b.b_title AS B_TITLE, b.b_description AS B_DESCRIPTION, UNIX_TIMESTAMP(b.b_dateCreated) AS B_DATECREATED, b.b_u_id AS B_UID, b.b_bp_id AS B_BPID, b.b_active AS B_ACTIVE'\r\n . ' FROM board AS b'\r\n . \" WHERE b.b_bc_id = '\" . $cID . \"'\"\r\n . \" AND b.b_visible = 'Y'\"\r\n . ' ORDER BY b.b_order';\r\n \r\n $result = $this->dbh->query_all($sql);\r\n \r\n $return = $result;\r\n \r\n return $return;\r\n }",
"public function getBoards()\n {\n $boardsItem = $this->cache->getItem('forumBoards');\n\n if (!$boardsItem->isHit()) {\n $tmpBoards = $this->connection->fetchAll('\n SELECT\n *,\n (SELECT forum_entries.date FROM forum_entries WHERE boardID = forum_board.id ORDER BY id DESC LIMIT 1) AS latestDate,\n (SELECT forum_thread.threadName FROM forum_thread WHERE forum_thread.id = (SELECT forum_entries.threadID FROM forum_entries WHERE boardID= forum_board.id ORDER BY id DESC LIMIT 1)) AS latestThreadName,\n (SELECT users.Username FROM users WHERE id = (SELECT forum_entries.userID FROM forum_entries WHERE boardID= forum_board.ID ORDER BY id DESC LIMIT 1)) AS latestUser,\n (SELECT users.Avatar FROM users WHERE id = (SELECT forum_entries.userID FROM forum_entries WHERE boardID= forum_board.ID ORDER BY id DESC LIMIT 1)) AS latestUserAvatar,\n (SELECT forum_entries.threadID FROM forum_entries WHERE boardID= forum_board.id ORDER BY id DESC LIMIT 1) AS latestLink\n FROM forum_board\n ');\n\n foreach ($tmpBoards as &$board2) {\n $board2['entries'] = $this->connection->fetchColumn('SELECT COUNT(*) FROM forum_entries WHERE boardID = ?', [$board2['id']]);\n $board2['threadCount'] = $this->connection->fetchColumn('SELECT COUNT(*) FROM forum_thread WHERE boardID = ?', [$board2['id']]);\n $board2['link'] = $this->rewriteManager->getRewriteByParams(['boardID' => $board2['id']])['link'];\n if (!empty($board2['latestLink'])) {\n $board2['latestLink'] = $this->rewriteManager->getRewriteByParams(['threadID' => $board2['latestLink']])['link'];\n }\n }\n $newArray = [];\n\n foreach ($tmpBoards as $board) {\n $newArray[$board['id']] = $board;\n }\n $tmpBoards = $newArray;\n unset($newArray);\n\n $boards = [];\n\n foreach ($tmpBoards as $tmpBoard) {\n if (empty($tmpBoard['boardSub'])) {\n $tmpBoard['subs'] = $this->getBoard($tmpBoards, $tmpBoard['id']);\n $boards[] = $tmpBoard;\n }\n }\n\n $boardsItem->set($boards);\n $this->cache->save($boardsItem);\n\n return $boards;\n }\n\n return $boardsItem->get();\n }",
"public function getBoardList(){\n\t\n \tglobal $db, $lang, $style, $timeFormat, $gmt, $groupPolicy, $logged_user;\n\t \n\t #category sql.\n\t\t$db->SQL = \"select id, Board from ebb_boards where type='1' ORDER BY B_Order\";\n\t\t$categoryQuery = $db->query();\n\t\t\n\t\t#TO-DO: add permission check to category.\n\n\t\twhile ($cat = mysql_fetch_assoc($categoryQuery)) {\n\t\t\n\t\t\t#call category template file.\n\t\t\t$tpl = new templateEngine($style, \"index_category\");\n \t\t\t\n\t\t\t#setup tag code.\n\t\t\t$tpl->parseTags(array(\n\t\t\t \"CAT-NAME\" => \"$cat[Board]\",\n\t\t\t \"LANG-BOARD\" => \"$lang[boards]\",\n\t\t\t \"LANG-TOPIC\" => \"$lang[topics]\",\n\t\t\t \"LANG-POST\" => \"$lang[posts]\",\n\t\t\t \"LANG-LASTPOSTDATE\" => \"$lang[lastposteddate]\"));\n\t\t\techo $tpl->outputHtml();\n \n\t\t #START BOARD\n\t\t\t#SQL for board query.\n\t\t $db->SQL = \"SELECT id, Board, Description, last_update, Posted_User, Post_Link FROM ebb_boards WHERE type='2' and Category='$cat[id]' ORDER BY B_Order\";\n\t\t\t$boardQuery = $db->query();\n\n\t\t\twhile ($board = mysql_fetch_assoc ($boardQuery)){\n\n\t\t\t\t#call board list template file.\n\t $tpl = new templateEngine($style, \"index_board\");\n\n\t\t\t\t#Topic count.\n\t\t\t\t$db->SQL = \"select tid from ebb_topics WHERE bid='$board[id]'\";\n\t\t\t\t$topicNum = number_format($db->affectedRows());\n\n\t\t\t\t#Reply count.\n\t\t\t\t$db->SQL = \"select pid from ebb_posts WHERE bid='$board[id]'\";\n\t\t\t\t$postNum = number_format($db->affectedRows());\n\n\t\t\t\t#get sub-boards.\n\t\t\t\t$subBoard = $this->getSubBoard($board['id']);\n\n\t\t\t\t#get last post details.\n\t\t\t\tif (empty($board['last_update'])){\n\t\t\t\t\t$boardDate = $lang['noposts'];\n\t\t\t\t\t$lastPostLink = \"\";\n\t\t\t\t}else{\n\t\t\t\t\t$boardDate = formatTime($timeFormat, $board['last_update'], $gmt);\n\t\t\t\t\t$lastPostLink = '<a href=\"viewtopic.php?'.$board['Post_Link'].'\">'.$lang['Postedby'].'</a>: '.$board['Posted_User'];\n\t\t\t\t}\n\n\t\t\t\t#get read status on board.\n\t\t\t\t#TO-DO: make this a decision block.\n\t\t\t\t$readCt = readBoardStat($board['id'], $logged_user);\n\t\t\t\tif (($readCt == 1) OR (empty($board['last_update']))){\n\t\t\t\t\t$icon = '<img src=\"'.$tpl->displayPath($style).'images/old.gif\" alt=\"'.$lang['oldpost'].'\" title=\"'.$lang['oldpost'].'\" />';\n\t\t\t\t}else{\n\t\t\t\t\t$icon = '<img src=\"'.$tpl->displayPath($style).'images/new.gif\" alt=\"'.$lang['newpost'].'\" title=\"'.$lang['newpost'].'\" />';\n\t\t\t\t}\n\n\t\t\t\t#get permission rules.\n\t\t\t\t$db->SQL = \"select B_Read from ebb_board_access WHERE B_id='$board[id]'\";\n\t\t\t\t$boardRule = $db->fetchResults();\n\n\t\t\t\t#see if user can view the board.\n\t\t\t\tif($groupPolicy->validateAccess(0, $boardRule['B_Read']) == true){\n\n\t\t\t\t\t#setup tag code.\n\t $tpl->parseTags(array(\n\t\t\t\t\t \"POSTICON\" => \"$icon\",\n\t\t\t\t\t \"BOARDID\" => \"$board[id]\",\n\t\t\t\t\t \"BOARDNAME\" => \"$board[Board]\",\n\t\t\t\t\t \"LANG-RSS\" => \"$lang[viewfeed]\",\n\t\t\t\t\t \"BOARDDESCRIPTION\" => \"$board[Description]\",\n\t\t\t\t\t \"SUBBOARDS\" => \"$subBoard\",\n\t\t\t\t\t \"TOPICCOUNT\" => \"$topicNum\",\n\t\t\t\t\t \"POSTCOUNT\" => \"$postNum\",\n\t\t\t\t\t \"POSTDATE\" => \"$boardDate\",\n\t\t\t\t\t \"POSTLINK\" => \"$lastPostLink\"));\n\t\t\t\t\t#setup output variable.\n\t\t\t\t\techo $tpl->outputHtml();\n\n\t\t\t\t}\n\t\t\t}\n\t\t\t#END BOARD\n\n\t\t\t#call board list footer template file.\n\t\t\t$tpl = new templateEngine($style, \"index_footer\");\n\t\t\techo $tpl->outputHtml();\n\t\t}\n\t}",
"public function boards() {\n return $this->entityManager->getRepository(Board::class);\n }",
"public function get_boards(){\n $boards = $this->_pinterest->users->getMeBoards(array(\"limit\" => 100));\n return $boards;\n }",
"public function getBoardsList()\n\t{\n\t\treturn $this->request->queryResource( '/v6/topic_boards/' );\n\t}",
"private function getList()\n\t{\n\t\t// Get the correct billboards collection to display from the parameters\n\t\t$collection = (int) $this->params->get('collection', 1);\n\n\t\t// Grab all the buildboards associated with the selected collection\n\t\t// Make sure we only grab published billboards\n\t\t$rows = Billboard::whereEquals('published', 1)\n\t\t ->whereEquals('collection_id', $collection)\n\t\t ->order('ordering', 'asc')\n\t\t ->rows();\n\n\t\treturn $rows;\n\t}",
"public static function getBoards()\n\t{\n\t\treturn static::filterByType('archive', false);\n\t}",
"public function getUserBoards()\n {\n $request = new Request('GET', 'me/boards/');\n\n return $this->fetchMultipleBoards($request);\n }",
"private function getBoardList() {\r\n\t\t$sql = \"SELECT Board_Name as board \";\r\n\t\t$sql .= \"FROM v_rpt_ServiceBoard \";\r\n\t\t$sql .= \"WHERE Inactive_Flag = 0 \";\r\n\t\t$sql .= \"AND BusGroup NOT LIKE 'Admin' \";\r\n\t\t$sql .= \"AND Board_Name NOT LIKE '%Archive%' \";\r\n\t\t$sql .= \"AND Board_Name NOT LIKE 'Maintenance' \";\r\n\t\t$sql .= \"AND BusGroup NOT LIKE 'Sales' \";\r\n\t\t$sql .= \"ORDER BY Board_Name \";\r\n\t\t$result = sqlsrv_query($this->conn, $sql) or die ('Error in SQL: ' . $sql);\r\n\r\n\t\t$i = 0;\r\n\t\twhile($row = sqlsrv_fetch_array($result)) {\r\n\t\t\t$r[$i]['board'] = $row['board'];\r\n\t\t\t$i++;\r\n\t\t}\r\n\r\n\t\treturn($r);\r\n\t}",
"public static function allCategoriesSorted()\n\t{\n\t\t$categoryRows = Category::model() -> findAll();\n\t\t$topCategories = array(); // pairs of (categ points, categ)\n\t\tforeach ($categoryRows as $record) {\n\t\t\tarray_push($topCategories, array($record -> cat_points, $record -> cat_name));\n\t\t}\n\t\trsort($topCategories);\n\t\treturn $topCategories;\n\t}",
"public function getCategories()\n {\n return $this->findBy([], [ 'title' => 'ASC' ]);\n }",
"public function get_list_of_boards()\n\t{\n\t\t$boards = json_decode(file_get_contents($this->json_folder_path . 'boards.json'));\n\n\t\t// Convert to array one liner way\n\t\t$boards = json_decode(json_encode($boards), true);\n\n\t\t// Return boards\n\t\treturn $boards['boards'];\n\t}",
"public static function fetchList(xPDO &$modx,$ignoreBoards = true) {\n $c = array(\n 'ignore_boards' => $ignoreBoards,\n );\n $cacheKey = 'discuss/board/user/'.$modx->discuss->user->get('id').'/select-options-'.md5(serialize($c));\n $boards = $modx->cacheManager->get($cacheKey);\n if (empty($boards)) {\n $c = $modx->newQuery('disBoard');\n $c->innerJoin('disBoardClosure','Descendants');\n $c->leftJoin('disBoardUserGroup','UserGroups');\n $c->innerJoin('disCategory','Category');\n $groups = $modx->discuss->user->getUserGroups();\n if (!$modx->discuss->user->isAdmin()) {\n if (!empty($groups)) {\n /* restrict boards by user group if applicable */\n $g = array(\n 'UserGroups.usergroup:IN' => $groups,\n );\n $g['OR:UserGroups.usergroup:IS'] = null;\n $where[] = $g;\n $c->andCondition($where,null,2);\n } else {\n $c->where(array(\n 'UserGroups.usergroup:IS' => null,\n ));\n }\n }\n if ($modx->discuss->user->isLoggedIn && $ignoreBoards) {\n $ignoreBoards = $modx->discuss->user->get('ignore_boards');\n if (!empty($ignoreBoards)) {\n $c->where(array(\n 'id:NOT IN' => explode(',',$ignoreBoards),\n ));\n }\n }\n $c->select($modx->getSelectColumns('disBoard','disBoard'));\n $c->select(array(\n 'Descendants.depth AS depth',\n 'Category.name AS category_name',\n ));\n $c->where(array('Descendants.ancestor' => 0));\n $c->sortby('Category.rank','ASC');\n $c->sortby('disBoard.map','ASC');\n $c->groupby('disBoard.id');\n $boardObjects = $modx->getCollection('disBoard',$c);\n /** @var disBoard $board */\n foreach ($boardObjects as $board) {\n $boards[] = $board->toArray('', false, true);\n }\n if (!empty($boards)) {\n $modx->cacheManager->set($cacheKey,$boards,$modx->getOption('discuss.cache_time',null,3600));\n }\n }\n return $boards;\n\n }",
"public function getList() {\n\t\t$boards = $this->board->findAllForUser();\n\t\tLog::info('getList');\n\t\tLog::info($boards);\n\t\treturn $this->view('board.list', ['boardList' => $boards]);\n\t\t\n\t}",
"protected function readBoards() {\n\t\t$this->boards = WCF::getCache()->get('board', 'boards');\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Displays a filtered and sorted list of Listings based on the given Condition model | public function viewAll($conditions)
{
$listings = new Listing();
# **************************************************
# **********SEARCH BY SELECTING A CATEGORY**********
# **************************************************
if(isset($conditions->category))
{
$listings = $listings->where('Category_Id', $conditions->category);
}
# *************************************************
# **********SEARCH THROUGH THE SEARCH BAR**********
# *************************************************
if(isset($conditions->search))
{
$listings = $listings->where(
function($query) use ($conditions) {
$query->whereRaw('LOWER(Title) LIKE LOWER(?)', ["%$conditions->search%"])
->orwhereRaw('LOWER(Description) LIKE LOWER(?)', ["%$conditions->search%"]);
}
);
}
# *****************************************
# **********FILTER SEARCH RESULTS**********
# *****************************************
if(isset($conditions->seller))
{
$account = Account::whereRaw('LOWER(Username) = LOWER(?)', [$conditions->seller])->first();
$accountID = is_null($account) ? 0 : $account->Account_Id;
$listings = $listings->where('Seller', $accountID);
}
if(isset($conditions->priceLow))
{
$listings = $listings->where('Price', '>=', $conditions->priceLow);
}
if(isset($conditions->priceHigh))
{
$listings = $listings->where('Price', '<=', $conditions->priceHigh);
}
if(isset($conditions->stock))
{
$listings = $listings->where('Stock', '>=', $conditions->stock);
}
if(isset($conditions->rating))
{
$listings = $listings->where('Rating', '>=', $conditions->rating);
}
# *************************************************
# **********SORT SEARCH RESULTS********************
# *************************************************
if(isset($conditions->sort))
{
$orderbycol = split(' ',$conditions->sort)[0];
$order = split(' ', $conditions->sort)[1];
$listings = $listings->orderby($orderbycol, $order);
}
else
{
$listings = $listings->orderby('Date', 'DESC');
}
self::view('listing/listingPreviews', ['listings' => $listings->get()]);
} | [
"public function listings() {\r\n $data = $this->model->getData();\r\n $this->template->data = $data;\r\n $this->set('general/list');\r\n }",
"public function buildListings();",
"function listing($filters);",
"function bindingListingByFilter()\n {\n $searchType = $this->input->post('searchStatus');\n $searchName = $this->input->post('searchName');\n $searchState = $this->input->post('searchState');\n $this->session->set_userdata('binding_infos', array(\n 'searchType'=>$searchType,\n 'searchName'=>$searchName,\n 'searchStatus'=>$searchState,\n ));\n $this->bindingCollectListing($searchType, $searchName, $searchState);\n }",
"function home_filter()\n\t{\n\t\t$data = filter_forwarded_data($this);\n\t\tif($data['t'] == 'best_evaluated_bidders') $data['listtype'] = 'best_bidders';\n\t\t\n\t\t$this->load->view($this->get_section_folder($data['t']).'/list_filter', $data);\n\t}",
"function ShowFilterList() {}",
"public function getStudentStatus_list($condition=''){\n return $this->getModel(\"studentstatus\",\"StudentStatus_list\",$condition);\n }",
"public function displaySearch()\n\t{\n\t\t$conditions = new Conditions(self::searchFormHandler());\n\t\tself::view('listing/listingSearch', [\n\t\t\t'category' => $conditions->category,\n\t\t\t'search' => $conditions->search,\n\t\t\t'seller' => $conditions->seller]);\n\t}",
"public function getCustomListingCondition()\n {\n }",
"public function actionLists() {\n $filter = new X2List('search');\n $criteria = new CDbCriteria();\n $criteria->addCondition('modelName = \"Contacts\"');\n $criteria->addCondition('type=\"static\" OR type=\"dynamic\"');\n if (!Yii::app()->params->isAdmin) {\n $condition = 'visibility=\"1\" OR assignedTo=\"Anyone\" OR \n assignedTo=\"' . Yii::app()->user->getName() . '\"';\n /* x2temp */\n $groupLinks = Yii::app()->db->createCommand()\n ->select('groupId')\n ->from('x2_group_to_user')\n ->where('userId=' . Yii::app()->user->getId())->queryColumn();\n if (!empty($groupLinks))\n $condition .= ' OR assignedTo IN (' . implode(',', $groupLinks) . ')';\n\n $condition .= 'OR (visibility=2 AND assignedTo IN\n (SELECT username FROM x2_group_to_user WHERE groupId IN\n (SELECT groupId \n FROM x2_group_to_user \n WHERE userId=' . Yii::app()->user->getId() . ')\n )\n )';\n $criteria->addCondition($condition);\n }\n\n $perPage = Profile::getResultsPerPage();\n\n //$criteria->offset = isset($_GET['page']) ? $_GET['page'] * $perPage - 3 : -3;\n //$criteria->limit = $perPage;\n $criteria->order = 'createDate DESC';\n $filter->compareAttributes($criteria);\n\n $contactLists = X2Model::model('X2List')->findAll($criteria);\n\n $totalContacts = X2Model::model('Contacts')->count();\n $totalMyContacts = X2Model::model('Contacts')->count('assignedTo=\"' . Yii::app()->user->getName() . '\"');\n $totalNewContacts = X2Model::model('Contacts')->count('assignedTo=\"' . Yii::app()->user->getName() . '\" AND createDate >= ' . mktime(0, 0, 0));\n\n $allContacts = new X2List;\n $allContacts->attributes = array(\n 'id' => 'all',\n 'name' => Yii::t('contacts', 'All {module}', array('{module}' => Modules::displayName())),\n 'description' => '',\n 'type' => 'dynamic',\n 'visibility' => 1,\n 'count' => $totalContacts,\n 'createDate' => 0,\n 'lastUpdated' => 0,\n );\n $newContacts = new X2List;\n $newContacts->attributes = array(\n 'id' => 'new',\n 'assignedTo' => Yii::app()->user->getName(),\n 'name' => Yii::t('contacts', 'New {module}', array('{module}' => Modules::displayName())),\n 'description' => '',\n 'type' => 'dynamic',\n 'visibility' => 1,\n 'count' => $totalNewContacts,\n 'createDate' => 0,\n 'lastUpdated' => 0,\n );\n $myContacts = new X2List;\n $myContacts->attributes = array(\n 'id' => 'my',\n 'assignedTo' => Yii::app()->user->getName(),\n 'name' => Yii::t('contacts', 'My {module}', array('{module}' => Modules::displayName())),\n 'description' => '',\n 'type' => 'dynamic',\n 'visibility' => 1,\n 'count' => $totalMyContacts,\n 'createDate' => 0,\n 'lastUpdated' => 0,\n );\n $contactListData = array(\n $allContacts,\n $myContacts,\n $newContacts,\n );\n\n $filteredPseudoLists = $filter->filter($contactListData);\n $lists = array_merge($filteredPseudoLists, $contactLists);\n $dataProvider = new CArrayDataProvider($lists, array(\n 'pagination' => array('pageSize' => $perPage),\n 'sort' => array(\n 'attributes' => array(\n 'name' => array(\n 'asc' => 'name asc, id desc',\n 'desc' => 'name desc, id desc',\n ),\n // secondary order is needed to fix https://github.com/yiisoft/yii/issues/2082\n 'type' => array(\n 'asc' => 'type asc, id desc',\n 'desc' => 'type desc, id desc',\n ),\n// 'count' => array (\n// 'asc' => 'count asc, id desc',\n// 'desc' => 'count desc, id desc',\n// ),\n 'assignedTo' => array(\n 'asc' => 'assignedTo asc, id desc',\n 'desc' => 'assignedTo desc, id desc',\n ),\n )),\n 'totalItemCount' => count($contactLists) + 3,\n ));\n\n $this->render('listIndex', array(\n 'contactLists' => $dataProvider,\n 'filter' => $filter,\n ));\n }",
"protected function queryListings()\n {\n // Get entity manager\n $em = EntityManagerSingleton::getInstance();\n\n $qb = $em->createQueryBuilder();\n $qb->select('e')->from($this->entity_info['entity'], 'e');\n $qb->orderBy('e.sort_order', 'DESC');\n $qb->setFirstResult(($this->page_id - 1) * $this->max_row_view)->setMaxResults($this->max_row_view);\n $this->list_results = $qb->getQuery()->getResult();\n }",
"function condition_listbox($selected_condition) {\n\t\tglobal $conditions;\n\t\t$out = _(\"The condition for the following rules is:\").\n\t\t\t$this->generic_listbox('condition', $conditions, $selected_condition);\n\t\treturn $out;\n\t}",
"protected function queryListings()\n {\n // Get entity manager\n $em = EntityManagerSingleton::getInstance();\n\n $qb = $em->createQueryBuilder();\n $qb->select('e')->from($this->entity_info['entity'], 'e');\n $qb->addOrderBy('e.date_created', 'DESC');\n $qb->setFirstResult(($this->page_id - 1) * $this->max_row_view)->setMaxResults($this->max_row_view);\n $this->list_results = $qb->getQuery()->getResult();\n }",
"function theme_gallery_category_condition_list($variables) {\n\t$conditions = $variables['conditions'];\n\t$category = $variables['category'];\n\n\t$conds = _gallery_category_conditions();\n\n\t$header = array(\n\t\t\tt('Name'),\n\t\t\tt('Column'),\n\t\t\tt('Value'),\n\t\t\tarray(\n\t\t\t\t\t'data' => t('Operations'),\n\t\t\t\t\t'colspan' => 2\n\t\t\t)\n\t);\n\t$rows = array();\n\tforeach ($conditions as $condition) {\n\t\t$cond = $conds[$condition['condition']];\n\t\tif (isset($cond['columns']) && is_array($cond['columns'])\n\t\t\t\t&& is_array($cond['columns'][$condition['columnname']])) {\n\t\t\t$options = _gallery_column_options(\n\t\t\t\tarray('columns' => array($condition['columnname'] => $cond['columns'][$condition['columnname']])));\n\t\t\t$condition['value'] = $options[$cond['columns'][$condition['columnname']][0]][$condition['columnname']\n\t\t\t\t\t. '___' . $condition['value']];\n\t\t\t$condition['columnname'] = $cond['columns'][$condition['columnname']][0];\n\t\t}\n\t\t$row = array();\n\t\t$row[] = l(\n\t\t\t$condition['name'],\n\t\t\t'admin/config/media/gallery/categories/'\n\t\t\t\t\t. $condition['gallery_category_id'] . '/conditions/edit/'\n\t\t\t\t\t. $condition['id']);\n\t\t$row[] = l(\n\t\t\t$condition['columnname'],\n\t\t\t'admin/config/media/gallery/categories/'\n\t\t\t\t\t. $condition['gallery_category_id'] . '/conditions/edit/'\n\t\t\t\t\t. $condition['id']);\n\t\t$row[] = l(\n\t\t\t$condition['value'],\n\t\t\t'admin/config/media/gallery/categories/'\n\t\t\t\t\t. $condition['gallery_category_id'] . '/conditions/edit/'\n\t\t\t\t\t. $condition['id']);\n\t\t$row[] = array_key_exists('columns', $cond) ? l(\n\t\t\t\t\tt('edit'),\n\t\t\t\t\t'admin/config/media/gallery/categories/'\n\t\t\t\t\t\t\t. $condition['gallery_category_id'] . '/conditions/edit/'\n\t\t\t\t\t\t\t. $condition['id']) : '';\n\t\t$row[] = l(\n\t\t\tt('delete'),\n\t\t\t'admin/config/media/gallery/categories/'\n\t\t\t\t\t. $condition['gallery_category_id'] . '/conditions/delete/'\n\t\t\t\t\t. $condition['id']);\n\t\t$rows[] = $row;\n\t}\n\n\tif (empty($rows)) {\n\t\t$rows[] = array(\n\t\t\t\tarray(\n\t\t\t\t\t\t'colspan' => 6,\n\t\t\t\t\t\t'data' => t(\n\t\t\t\t\t\t\t'There are currently no conditions for this category.')\n\t\t\t\t)\n\t\t);\n\t}\n\n\t$options = '';\n\tforeach ($conds as $value => $cond)\n\t\t$options .= '<option value=\"' . $value . '\">' . $cond['name']\n\t\t\t\t. '</option>';\n\t$add_form = '<form action=\"'\n\t\t\t. url(\n\t\t\t\t'admin/config/media/gallery/categories/' . $category['id']\n\t\t\t\t\t\t. '/conditions/add') . '\" method=\"post\">'\n\t\t\t. '<select name=\"condition\" size=\"1\">' . $options . '</select>'\n\t\t\t. '<input type=\"submit\" value=\"' . t('Create condition')\n\t\t\t. '\" name=\"submit\" />' . '</form>';\n\treturn $add_form\n\t\t\t. theme(\n\t\t\t\t'table',\n\t\t\t\tarray('header' => $header,\n\t\t\t\t\t\t'rows' => $rows\n\t\t\t\t));\n}",
"protected function listing() {\n\t\t$n = 30; // Number of news per page\n\t\t\n\t\t// Sorting criterias given by URL\n\t\t$args = WRoute::getArgs();\n\t\t$criterias = array_shift($args);\n\t\tif ($criterias == 'listing') {\n\t\t\t$criterias = array_shift($args);\n\t\t}\n\t\t$count = sscanf(str_replace('-', ' ', $criterias), '%s %s %d', $sortBy, $sens, $page);\n\t\tif (!isset($this->model->news_data_model['toDB'][$sortBy])) {\n\t\t\t$sortBy = 'news_date';\n\t\t}\n\t\tif (empty($page) || $page <= 0) {\n\t\t\t$page = 1;\n\t\t}\n\t\t\n\t\t// AdminStyle Helper\n\t\t$orderingFields = array('news_id', 'news_title', 'news_author', 'news_date', 'news_views');\n\t\t$adminStyle = WHelper::load('SortingHelper', array($orderingFields, 'news_date', 'DESC'));\n\t\t$sorting = $adminStyle->findSorting($sortBy, $sens);\n\t\t\n\t\t// Get data\n\t\t$news = $this->model->getNewsList(($page-1)*$n, $n, $sorting[0], $sorting[1] == 'ASC');\n\t\t$total = $this->model->countNews();\n\t\t\n\t\t// Pagination\n\t\t$pagination = WHelper::load('pagination', array($total, $n, $page, '/admin/news/'.$sorting[0].'-'.$sorting[1].'-%d/'));\n\t\t\n\t\t$this->view->news_listing($news, $adminStyle, $pagination);\n\t}",
"public function getCriteriaListAction()\n {\n $competenceList = $this->competenceRepository->findBy([\n 'isApplicable' => 1\n ]);\n $this->listViewFactory->setViewFactory(CompetenceViewFactory::class);\n return $this->viewHandler->handle(View::create($this->listViewFactory->create($competenceList)));\n }",
"protected function display_filter_by_status() {\n\t\t$this->status_counts = $this->store->action_counts();\n\t\tparent::display_filter_by_status();\n\t}",
"public function actionLists() {\n $filter = new Services('search');\n $criteria = new CDbCriteria();\n $criteria->addCondition('modelName = \"Services\"');\n $criteria->addCondition('type=\"static\" OR type=\"dynamic\"');\n if (!Yii::app()->params->isAdmin) {\n $condition = 'visibility=\"1\" OR assignedTo=\"Anyone\" OR \n assignedTo=\"' . Yii::app()->user->getName() . '\"';\n /* x2temp */\n $groupLinks = Yii::app()->db->createCommand()\n ->select('groupId')\n ->from('x2_group_to_user')\n ->where('userId=' . Yii::app()->user->getId())->queryColumn();\n if (!empty($groupLinks))\n $condition .= ' OR assignedTo IN (' . implode(',', $groupLinks) . ')';\n\n $condition .= 'OR (visibility=2 AND assignedTo IN\n (SELECT username FROM x2_group_to_user WHERE groupId IN\n (SELECT groupId \n FROM x2_group_to_user \n WHERE userId=' . Yii::app()->user->getId() . ')\n )\n )';\n $criteria->addCondition($condition);\n }\n\n $perPage = Profile::getResultsPerPage();\n\n //$criteria->offset = isset($_GET['page']) ? $_GET['page'] * $perPage - 3 : -3;\n //$criteria->limit = $perPage;\n $criteria->order = 'createDate DESC';\n $filter->compareAttributes($criteria);\n\n $contactLists = X2Model::model('Services')->findAll($criteria);\n\n $totalContacts = X2Model::model('X2Leads')->count();\n $totalMyContacts = X2Model::model('X2Leads')->count('assignedTo=\"' . Yii::app()->user->getName() . '\"');\n $totalNewContacts = X2Model::model('X2Leads')->count('assignedTo=\"' . Yii::app()->user->getName() . '\" AND createDate >= ' . mktime(0, 0, 0));\n\n $allContacts = new Services;\n $allContacts->attributes = array(\n 'id' => 'all',\n 'name' => Yii::t('contacts', 'All {module}', array('{module}' => Modules::displayName())),\n 'description' => '',\n 'type' => 'dynamic',\n 'visibility' => 1,\n 'count' => $totalContacts,\n 'createDate' => 0,\n 'lastUpdated' => 0,\n );\n $newContacts = new Services;\n $newContacts->attributes = array(\n 'id' => 'new',\n 'assignedTo' => Yii::app()->user->getName(),\n 'name' => Yii::t('contacts', 'New {module}', array('{module}' => Modules::displayName())),\n 'description' => '',\n 'type' => 'dynamic',\n 'visibility' => 1,\n 'count' => $totalNewContacts,\n 'createDate' => 0,\n 'lastUpdated' => 0,\n );\n $myContacts = new Services;\n $myContacts->attributes = array(\n 'id' => 'my',\n 'assignedTo' => Yii::app()->user->getName(),\n 'name' => Yii::t('contacts', 'My {module}', array('{module}' => Modules::displayName())),\n 'description' => '',\n 'type' => 'dynamic',\n 'visibility' => 1,\n 'count' => $totalMyContacts,\n 'createDate' => 0,\n 'lastUpdated' => 0,\n );\n $contactListData = array(\n $allContacts,\n $myContacts,\n $newContacts,\n );\n\n $filteredPseudoLists = $filter->filter($contactListData);\n $lists = array_merge($filteredPseudoLists, $contactLists);\n $dataProvider = new CArrayDataProvider($lists, array(\n 'pagination' => array('pageSize' => $perPage),\n 'sort' => array(\n 'attributes' => array(\n 'name' => array(\n 'asc' => 'name asc, id desc',\n 'desc' => 'name desc, id desc',\n ),\n // secondary order is needed to fix https://github.com/yiisoft/yii/issues/2082\n 'type' => array(\n 'asc' => 'type asc, id desc',\n 'desc' => 'type desc, id desc',\n ),\n// 'count' => array (\n// 'asc' => 'count asc, id desc',\n// 'desc' => 'count desc, id desc',\n// ),\n 'assignedTo' => array(\n 'asc' => 'assignedTo asc, id desc',\n 'desc' => 'assignedTo desc, id desc',\n ),\n )),\n 'totalItemCount' => count($contactLists) + 3,\n ));\n\n $this->render('listIndex', array(\n 'contactLists' => $dataProvider,\n 'filter' => $filter,\n ));\n }",
"public function actionLists() {\n $filter = new X2List('search');\n $criteria = new CDbCriteria();\n $criteria->addCondition('modelName = \"Accounts\"');\n $criteria->addCondition('type=\"static\" OR type=\"dynamic\"');\n if (!Yii::app()->params->isAdmin) {\n $condition = 'visibility=\"1\" OR assignedTo=\"Anyone\" OR \n assignedTo=\"' . Yii::app()->user->getName() . '\"';\n /* x2temp */\n $groupLinks = Yii::app()->db->createCommand()\n ->select('groupId')\n ->from('x2_group_to_user')\n ->where('userId=' . Yii::app()->user->getId())->queryColumn();\n if (!empty($groupLinks))\n $condition .= ' OR assignedTo IN (' . implode(',', $groupLinks) . ')';\n\n $condition .= 'OR (visibility=2 AND assignedTo IN\n (SELECT username FROM x2_group_to_user WHERE groupId IN\n (SELECT groupId \n FROM x2_group_to_user \n WHERE userId=' . Yii::app()->user->getId() . ')\n )\n )';\n $criteria->addCondition($condition);\n }\n\n $perPage = Profile::getResultsPerPage();\n\n //$criteria->offset = isset($_GET['page']) ? $_GET['page'] * $perPage - 3 : -3;\n //$criteria->limit = $perPage;\n $criteria->order = 'createDate DESC';\n $filter->compareAttributes($criteria);\n\n $contactLists = X2Model::model('X2List')->findAll($criteria);\n\n $totalContacts = X2Model::model('Accounts')->count();\n $totalMyContacts = X2Model::model('Accounts')->count('assignedTo=\"' . Yii::app()->user->getName() . '\"');\n $totalNewContacts = X2Model::model('Accounts')->count('assignedTo=\"' . Yii::app()->user->getName() . '\" AND createDate >= ' . mktime(0, 0, 0));\n\n $allContacts = new X2List;\n $allContacts->attributes = array(\n 'id' => 'all',\n 'name' => Yii::t('accounts', 'All {module}', array('{module}' => Modules::displayName())),\n 'description' => '',\n 'type' => 'dynamic',\n 'visibility' => 1,\n 'count' => $totalContacts,\n 'createDate' => 0,\n 'lastUpdated' => 0,\n );\n $newContacts = new X2List;\n $newContacts->attributes = array(\n 'id' => 'new',\n 'assignedTo' => Yii::app()->user->getName(),\n 'name' => Yii::t('accounts', 'New {module}', array('{module}' => Modules::displayName())),\n 'description' => '',\n 'type' => 'dynamic',\n 'visibility' => 1,\n 'count' => $totalNewContacts,\n 'createDate' => 0,\n 'lastUpdated' => 0,\n );\n $myContacts = new X2List;\n $myContacts->attributes = array(\n 'id' => 'my',\n 'assignedTo' => Yii::app()->user->getName(),\n 'name' => Yii::t('accounts', 'My {module}', array('{module}' => Modules::displayName())),\n 'description' => '',\n 'type' => 'dynamic',\n 'visibility' => 1,\n 'count' => $totalMyContacts,\n 'createDate' => 0,\n 'lastUpdated' => 0,\n );\n $contactListData = array(\n $allContacts,\n $myContacts,\n $newContacts,\n );\n\n $filteredPseudoLists = $filter->filter($contactListData);\n $lists = array_merge($filteredPseudoLists, $contactLists);\n $dataProvider = new CArrayDataProvider($lists, array(\n 'pagination' => array('pageSize' => $perPage),\n 'sort' => array(\n 'attributes' => array(\n 'name' => array(\n 'asc' => 'name asc, id desc',\n 'desc' => 'name desc, id desc',\n ),\n // secondary order is needed to fix https://github.com/yiisoft/yii/issues/2082\n 'type' => array(\n 'asc' => 'type asc, id desc',\n 'desc' => 'type desc, id desc',\n ),\n// 'count' => array (\n// 'asc' => 'count asc, id desc',\n// 'desc' => 'count desc, id desc',\n// ),\n 'assignedTo' => array(\n 'asc' => 'assignedTo asc, id desc',\n 'desc' => 'assignedTo desc, id desc',\n ),\n )),\n 'totalItemCount' => count($contactLists) + 3,\n ));\n\n $this->render('listIndex', array(\n 'contactLists' => $dataProvider,\n 'filter' => $filter,\n ));\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the altered migration plugin. | public function getMigration(); | [
"public function getOriginalMigration();",
"public function getMigration() {\n return $this->migration;\n }",
"public function getMigration(): Migration\n {\n return $this->migration;\n }",
"protected function get_plugin() {\n\n\t\treturn $this->plugin;\n\t}",
"public function getMigration(): MigrationInterface\n {\n return $this->migration;\n }",
"protected function migrationEntityHelper() {\n /** @var \\Drupal\\migrate_plus\\Entity\\MigrationInterface $migration */\n $migration = $this->entity;\n\n return $this->migrationEntityHelperManager->get($migration);\n }",
"public function getMigrator()\n {\n return $this->migrator;\n }",
"public function get_plugin() {\n\t\t\treturn $this->plugin;\n\t\t}",
"public static function getMigrator()\n {\n return static::$migrator;\n }",
"public function getPlugin()\n {\n return $this->plugin;\n }",
"public function plugin(): Plugin\n {\n return $this->plugin;\n }",
"static function &migration() {\n return self::getDelegate('migration');\n }",
"private static function getMigration($migration_id) {\n /** @var \\Drupal\\migrate\\Plugin\\MigrationPluginManager */\n $migrationManager = \\Drupal::service('plugin.manager.migration');\n\n return $migrationManager->createInstance($migration_id);\n }",
"protected function getMigrationExecutable() {\n if (NULL == $this->migrateExecutable) {\n $migration = $this->pluginManager->createInstance('dcx_migration');\n $this->migrateExecutable = new DcxMigrateExecutable($migration, $this->eventDispatcher);\n }\n\n return $this->migrateExecutable;\n }",
"public function getPlugin()\n {\n $rtn = $this->data['plugin'];\n\n return $rtn;\n }",
"public function getPluginDefinition() {\n return $this->pluginDefinition;\n }",
"protected function getMigrator(): MigrationManager\n {\n if ($this->_migrator === null) {\n switch ($this->type) {\n case MigrationManager::TYPE_APP:\n $this->_migrator = Craft::$app->getMigrator();\n break;\n case MigrationManager::TYPE_CONTENT:\n $this->_migrator = Craft::$app->getContentMigrator();\n break;\n case MigrationManager::TYPE_PLUGIN:\n $this->_migrator = $this->plugin->getMigrator();\n break;\n }\n }\n\n return $this->_migrator;\n }",
"public function getPlugin();",
"public function get_plugin() {\n\n\t\treturn $this->get_gateway()->get_plugin();\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Renew frontend server node information if it is outdated or it does not exist. | public function process()
{
$oNodesManager = $this->_getServerNodesManager();
$sServerNodeId = $this->_getUtilsServer()->getServerNodeId();
$oNode = $oNodesManager->getServer($sServerNodeId);
$oNodeChecker = $this->_getServerNodeChecker();
if (!$oNodeChecker->check($oNode)) {
$this->_updateNodeInformation($oNode);
$oNodesManager->saveServer($oNode);
}
} | [
"public function testUpdateNode()\n {\n $this->markTestIncomplete('We need a way to reliably create a node first.');\n }",
"function brp_ws_client_node_type_update($info) {\n if (!empty($info->old_type) && $info->old_type != $info->type) {\n variable_set('brp_ws_client_node_connection_' . $info->type, variable_get('brp_ws_client_node_connection_' . $info->old_type, ''));\n variable_del('brp_ws_client_node_connection_' . $info->old_type);\n }\n}",
"function updateMgmtnode($data) {\n\t$ownerid = getUserlistID($data[\"owner\"]);\n\t$data['installpath'] = mysql_escape_string($data['installpath']);\n\t$data['keys'] = mysql_escape_string($data['keys']);\n\t$data['imagelibuser'] = mysql_escape_string($data['imagelibuser']);\n\tif($data['imagelibuser'] != 'NULL')\n\t\t$data['imagelibuser'] = \"'{$data['imagelibuser']}'\";\n\t$data['imagelibkey'] = mysql_escape_string($data['imagelibkey']);\n\tif($data['imagelibkey'] != 'NULL')\n\t\t$data['imagelibkey'] = \"'{$data['imagelibkey']}'\";\n\tif($data['imagelibenable'] != 1)\n\t\t$data['imagelibenable'] = 0;\n\tif($data['keys'] == '')\n\t\t$data['keys'] = 'NULL';\n\telse\n\t\t$data['keys'] = \"'{$data['keys']}'\";\n\t$query = \"UPDATE managementnode \"\n\t . \"SET hostname = '{$data[\"hostname\"]}', \"\n\t . \"IPaddress = '{$data[\"IPaddress\"]}', \"\n\t . \"ownerid = $ownerid, \"\n\t . \"stateid = {$data[\"stateid\"]}, \"\n\t . \"predictivemoduleid = {$data[\"premoduleid\"]}, \"\n\t . \"checkininterval = {$data[\"checkininterval\"]}, \"\n\t . \"installpath = '{$data[\"installpath\"]}', \"\n\t . \"`keys` = {$data[\"keys\"]}, \"\n\t . \"sshport = {$data[\"sshport\"]}, \"\n\t . \"imagelibenable = {$data[\"imagelibenable\"]}, \"\n\t . \"imagelibgroupid = {$data[\"imagelibgroupid\"]}, \"\n\t . \"imagelibuser = {$data[\"imagelibuser\"]}, \"\n\t . \"imagelibkey = {$data[\"imagelibkey\"]} \"\n\t . \"WHERE id = \" . $data[\"mgmtnodeid\"];\n\t$qh = doQuery($query, 101);\n\treturn mysql_affected_rows($GLOBALS[\"mysql_link_vcl\"]);\n}",
"public function update()\n {\n $this->storage->deleteNode($this->id);\n $this->save();\n }",
"public function update()\n {\n $this->updateNodeData();\n\n // execute the main action of this controller\n $this->perform();\n }",
"public function updateVarnish()\n {\n // Add urls to refresh in Varnish\n $varnishObj = new \\KC\\Repository\\Varnish();\n $varnishObj->addUrl(rtrim(HTTP_PATH_FRONTEND, '/'));\n # make markplaatfeed url's get refreashed only in case of kortingscode\n if (LOCALE == '') {\n $varnishObj->addUrl(HTTP_PATH_FRONTEND . 'marktplaatsfeed');\n $varnishObj->addUrl(HTTP_PATH_FRONTEND . 'marktplaatsmobilefeed');\n }\n }",
"public function sitetreeChanged() \n {\n $this->clearManagedAppRoutingCache();\n $this->clearCrossAppCache();\n }",
"protected function recreateVirtualServer()\n\t{\n\t\t// Recreate deployments file\n\t\t$this->app['files']->put($this->deploymentsFile, json_encode(array(\n\t\t\t'foo' => 'bar',\n\t\t\t'current_release' => array('production' => 20000000000000),\n\t\t\t'directory_separator' => '/',\n\t\t\t'is_setup' => true,\n\t\t\t'webuser' => array('username' => 'www-data','group' => 'www-data'),\n\t\t\t'line_endings' => \"\\n\",\n\t\t)));\n\n\t\t$rootPath = $this->server.'/../../..';\n\n\t\t// Recreate altered local server\n\t\t$this->app['files']->deleteDirectory($rootPath.'/storage');\n\t\t$this->app['files']->deleteDirectory($this->server.'/logs');\n\t\t$folders = array('current', 'shared', 'releases','releases/10000000000000', 'releases/15000000000000', 'releases/20000000000000');\n\t\tforeach ($folders as $folder) {\n\t\t\t$folder = $this->server.'/'.$folder;\n\n\t\t\t$this->app['files']->deleteDirectory($folder);\n\t\t\t$this->app['files']->delete($folder);\n\t\t\t$this->app['files']->makeDirectory($folder, 0777, true);\n\t\t\tfile_put_contents($folder.'/.gitkeep', '');\n\t\t}\n\t\tfile_put_contents($this->server.'/state.json', json_encode(array(\n\t\t\t'10000000000000' => true,\n\t\t\t'15000000000000' => false,\n\t\t\t'20000000000000' => true,\n\t\t)));\n\n\t\t// Delete rocketeer config\n\t\t$binary = $rootPath.'/.rocketeer';\n\t\t$this->app['files']->deleteDirectory($binary);\n\t}",
"public function renew(){ }",
"protected function recreateVirtualServer()\n\t{\n\t\t// Recreate deployments file\n\t\t$this->app['files']->put($this->deploymentsFile, json_encode(array(\n\t\t\t\"foo\" => \"bar\",\n\t\t\t\"current_release\" => 20000000000000,\n\t\t\t\"directory_separator\" => \"/\",\n\t\t\t\"is_setup\" => true,\n\t\t\t\"apache\" => array(\"username\" => \"www-datda\",\"group\" => \"www-datda\"),\n\t\t\t\"line_endings\" => \"\\n\",\n\t\t)));\n\n\t\t// Recreate altered local server\n\t\t$this->app['files']->deleteDirectory(__DIR__.'/../storage');\n\t\t$folders = array('current', 'shared', 'releases', 'releases/10000000000000', 'releases/20000000000000');\n\t\tforeach ($folders as $folder) {\n\t\t\t$folder = $this->server.'/'.$folder;\n\n\t\t\t$this->app['files']->deleteDirectory($folder);\n\t\t\t$this->app['files']->delete($folder);\n\t\t\t$this->app['files']->makeDirectory($folder, 0777, true);\n\t\t\tfile_put_contents($folder.'/.gitkeep', '');\n\t\t}\n\n\t\t// Delete rocketeer binary\n\t\t$binary = __DIR__.'/../rocketeer.php';\n\t\t$this->app['files']->delete($binary);\n\t}",
"abstract protected function update(Node $node);",
"public function testUpdateNodeUsingPut()\n {\n }",
"public function reload_node_list () {\n\t\t$node_list = $this->get(\"/nodes\");\n\t\tif (count($node_list) > 0) {\n\t\t\t$nodes_array = array();\n\t\t\tforeach ($node_list as $node) {\n\t\t\t\t$nodes_array[] = $node['node'];\n\t\t\t}\n\t\t\t$this->cluster_node_list = $nodes_array;\n\t\t\treturn true;\n\t\t} else {\n\t\t\terror_log(\" Empty list of nodes returned in this cluster.\");\n\t\t\treturn false;\n\t\t}\n\t}",
"public function testUpdateNetworkAppliancePort()\n {\n }",
"function upgrade_network() {}",
"public function updateCache()\n\t{\n\t\t$refresh = $this->refreshCache;\n\t\t$this->refreshCache = false;\n\t\t\\Yii::$app->cache->set($this->cacheKey, serialize($this->getInstalledPackages()));\n\t\t$this->refreshCache = $refresh;\n\t}",
"private function registerCacheUpdate()\n\n {\n\n $this->cacheService->getPageIdStack()->push(\n\n $this->getFrontendController()->id\n\n );\n\n }",
"function drush_aegir_update_provision_update_drupal() {\n drush_errors_on();\n provision_backend_invoke(d()->name, 'pm-update');\n drush_log(dt('Drush pm-update task completed'));\n}",
"function is_resourcespace_upgrade_available()\n {\n $cvn_cache = get_sysvar('centralised_version_number');\n $last_cvn_update = get_sysvar('last_cvn_update');\n\n $centralised_version_number = $cvn_cache;\n debug(\"RS_UPGRADE_AVAILABLE: cvn_cache = {$cvn_cache}\");\n debug(\"RS_UPGRADE_AVAILABLE: last_cvn_update = $last_cvn_update\");\n if($last_cvn_update !== false)\n {\n $cvn_cache_interval = DateTime::createFromFormat('Y-m-d H:i:s', $last_cvn_update)->diff(new DateTime());\n\n if($cvn_cache_interval->days >= 1)\n {\n $centralised_version_number = false;\n }\n }\n\n if($centralised_version_number === false)\n {\n $default_socket_timeout_cache = ini_get('default_socket_timeout');\n ini_set('default_socket_timeout',5); //Set timeout to 5 seconds incase server cannot access resourcespace.com\n $centralised_version_number = @file_get_contents('https://www.resourcespace.com/current_release.txt');\n ini_set('default_socket_timeout',$default_socket_timeout_cache);\n debug(\"RS_UPGRADE_AVAILABLE: centralised_version_number = $centralised_version_number\");\n if($centralised_version_number === false)\n {\n debug(\"RS_UPGRADE_AVAILABLE: unable to get centralised_version_number from https://www.resourcespace.com/current_release.txt\");\n set_sysvar('last_cvn_update', date('Y-m-d H:i:s'));\n return false; \n }\n\n set_sysvar('centralised_version_number', $centralised_version_number);\n set_sysvar('last_cvn_update', date('Y-m-d H:i:s'));\n }\n\n $get_version_details = function($version)\n {\n $version_data = explode('.', $version);\n\n if(empty($version_data))\n {\n return array();\n }\n\n $return = array(\n 'major' => isset($version_data[0]) ? (int) $version_data[0] : 0,\n 'minor' => isset($version_data[1]) ? (int) $version_data[1] : 0,\n 'revision' => isset($version_data[2]) ? (int) $version_data[2] : 0,\n );\n\n if($return['major'] == 0)\n {\n return array();\n }\n\n return $return;\n };\n\n $product_version = trim(str_replace('SVN', '', $GLOBALS['productversion']));\n $product_version_data = $get_version_details($product_version);\n\n $cvn_data = $get_version_details($centralised_version_number);\n\n debug(\"RS_UPGRADE_AVAILABLE: product_version = $product_version\");\n debug(\"RS_UPGRADE_AVAILABLE: centralised_version_number = $centralised_version_number\");\n\n if(empty($product_version_data) || empty($cvn_data))\n {\n return false;\n }\n\n if($product_version_data['major'] != $cvn_data['major'] && $product_version_data['major'] < $cvn_data['major'])\n {\n return true;\n }\n else if(\n $product_version_data['major'] == $cvn_data['major']\n && $product_version_data['minor'] != $cvn_data['minor']\n && $product_version_data['minor'] < $cvn_data['minor'])\n {\n return true;\n }\n else if(\n $product_version_data['major'] < $cvn_data['major']\n && $product_version_data['minor'] != $cvn_data['minor']\n && $product_version_data['minor'] < $cvn_data['minor'])\n {\n return true;\n }\n\n return false;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function getZoneCountry This function is used to remove the zone. Database Tables used in this function are : tbl_country | function getZoneCountry() {
$varQuery = "SELECT zone,group_concat(' ',name) as Countries FROM " . TABLE_COUNTRY . " WHERE status='1' AND zone!='' GROUP BY(zone) ASC";
$arrRes = $this->getArrayResult($varQuery);
//pre($arrRes);
return $arrRes;
} | [
"function znGetZones( $countryID = null )\n{\n if ( $countryID == null )\n $q=db_query(\"select zoneID, zone_name, \".\n \" zone_code, countryID from \".ZONES_TABLE.\" \".\n \" order by zone_name\" );\n else\n $q=db_query(\"select zoneID, zone_name, \".\n \" zone_code, countryID from \".ZONES_TABLE.\" \".\n \" where countryID=\".(int)$countryID.\" order by zone_name\" );\n $data=array();\n while( $r=db_fetch_row($q) ) $data[]=$r;\n return $data;\n}",
"function tep_get_zone_code($country_id, $zone_id, $default_zone) {\n $zone_query = tep_db_query(\"select zone_code from \" . TABLE_ZONES . \" where zone_country_id = '\" . (int)$country_id . \"' and zone_id = '\" . (int)$zone_id . \"'\");\n if (tep_db_num_rows($zone_query)) {\n $zone = tep_db_fetch_array($zone_query);\n return $zone['zone_code'];\n } else {\n return $default_zone;\n }\n}",
"function tep_get_zone_id($country_id, $zone_name) {\n $zone_id_query = tep_db_query(\"select * from \" . TABLE_ZONES . \" where zone_country_id = '\" . $country_id . \"' and zone_name = '\" . $zone_name . \"'\");\n if (!tep_db_num_rows($zone_id_query)) {\n return 0;\n }\n else {\n $zone_id_row = tep_db_fetch_array($zone_id_query);\n return $zone_id_row['zone_id'];\n }\n }",
"public static function deleteCountry() {\n $result = array();\n $deleted = lC_Countries_Admin::delete($_GET['cid']);\n if ($deleted) {\n $result['rpcStatus'] = RPC_STATUS_SUCCESS;\n }\n\n echo json_encode($result);\n }",
"function tep_get_country_zones($country_id) {\n $zones_array = array();\n $zones_query = tep_db_query(\"select zone_id, zone_name from \" . TABLE_ZONES . \" where zone_country_id = '\" . (int)$country_id . \"' order by zone_name\");\n while ($zones = tep_db_fetch_array($zones_query)) {\n $zones_array[] = array('id' => $zones['zone_id'],\n 'text' => $zones['zone_name']);\n }\n\n return $zones_array;\n}",
"function twe_get_country_zones($country_id) {\n global $db;\n $zones_array = array();\n $zones = $db->Execute(\"select zone_id, zone_name from \" . TABLE_ZONES . \" where zone_country_id = '\" . $country_id . \"' order by zone_name\");\n while (!$zones->EOF) {\n $zones_array[] = array('id' => $zones->fields['zone_id'],\n 'text' => $zones->fields['zone_name']);\n\t$zones->MoveNext();\t\t\t\t\t\t \n }\n\n return $zones_array;\n }",
"function tep_get_zone_code($country_id, $zone_id, $default_zone) {\n $zone_query = tep_db_query(\"select zone_code from \" . TABLE_ZONES . \" where zone_country_id = '\" . (int)$country_id . \"' and zone_id = '\" . (int)$zone_id . \"'\");\n if (tep_db_num_rows($zone_query)) {\n $zone = tep_db_fetch_array($zone_query);\n return $zone['zone_code'];\n } else {\n return $default_zone;\n }\n }",
"private function _table_country_zone()\n\t{\n\n\t\tif(!$this->db->table_exists('country_zone'))\n\t\t{ \n\t\t\t$this->dbforge->add_field(array(\n\t\t\t\t'country_zone_id' => array(\n\t\t\t\t\t'type' => 'int', \n\t\t\t\t\t'constraint' => 9, \n\t\t\t\t\t'unsigned' => true,\n\t\t\t\t\t'auto_increment' => true\n\t\t\t\t),\n\t\t\t\t'country_id' => array(\n\t\t\t\t\t'type' => 'int', \n\t\t\t\t\t'constraint' => 9,\n\t\t\t\t\t'unsigned' => true, \n\t\t\t\t\t'null' => false\n\t\t\t\t),\n\t\t\t\t'code' => array(\n\t\t\t\t\t'type' => 'varchar', \n\t\t\t\t\t'constraint' => 32, \n\t\t\t\t\t'null' => true\n\t\t\t\t),\n\t\t\t\t'name' => array(\n\t\t\t\t\t'type' => 'varchar', \n\t\t\t\t\t'constraint' => 128, \n\t\t\t\t\t'null' => false\n\t\t\t\t),\n\t\t\t\t'status' => array(\n\t\t\t\t\t'type' => 'int', \n\t\t\t\t\t'constraint' => 1, \n\t\t\t\t\t'null' => false,\n\t\t\t\t\t'default' => 1\n\t\t\t\t)\n\t\t\t));\n\n\t\t\t$this->dbforge->add_key('country_zone_id', true);\n\t\t\t$this->dbforge->create_table('country_zone');\n\n\t\t\t// Seed\n\n\t\t\t$records = $this->load->view('templates/country_zones.txt', array(), true);\n\t\t\t$records = explode(\"\\n\", $records);\n\n\t\t\tforeach($records as $r)\n\t\t\t{\n\t\t\t\t$r = explode('|', $r);\n\n\t\t\t\t$insert = array(\n\t\t\t\t\t'country_zone_id'=>$r[0], \n\t\t\t\t\t'country_id' => $r[1],\n\t\t\t\t\t'code' => $r[2],\n\t\t\t\t\t'name' => $r[3],\n\t\t\t\t\t'status' => $r[4]\n\t\t\t\t);\n\n\t\t\t\t// Run this one one at a time, since the list is probably too large for a batch\n\t\t\t\t$this->db->insert('country_zone', $insert);\n\t\t\t}\n\n\t\t}\n\t}",
"function tep_get_country_zones($country_id) {\n $zones_array = array();\n $zones_query = tep_db_query(\"select zone_id, zone_name from \" . TABLE_ZONES . \" where zone_country_id = '\" . (int)$country_id . \"' order by zone_name\");\n while ($zones = tep_db_fetch_array($zones_query)) {\n $zones_array[] = array('id' => $zones['zone_id'],\n 'text' => $zones['zone_name']);\n }\n\n return $zones_array;\n }",
"public function GetZone($zone, $country_id)\r\n {\r\n $query = $this->db->query(\"SELECT DISTINCT * FROM \" . DB_PREFIX . \"zone WHERE name = '\" . $this->db->escape($zone). \"' AND country_id = '\" . (int)($country_id). \"'\");\r\n foreach ($query->rows as $result)\r\n {\r\n return $result['zone_id'];\r\n }\r\n }",
"function delete_country($id)\n {\n return $this->db->delete('countries',array('id'=>$id));\n }",
"function tep_get_zone_code($country, $zone, $def_state) {\n\n $state_prov_query = tep_db_query(\"select zone_code from \" . TABLE_ZONES . \" where zone_country_id = '\" . (int)$country . \"' and zone_id = '\" . (int)$zone . \"'\");\n\n if (!tep_db_num_rows($state_prov_query)) {\n $state_prov_code = $def_state;\n }\n else {\n $state_prov_values = tep_db_fetch_array($state_prov_query);\n $state_prov_code = $state_prov_values['zone_code'];\n }\n \n return $state_prov_code;\n }",
"public function getCountry() {}",
"function tep_get_zone_name($country_id, $zone_id, $default_zone) {\n\t$zone_query = tep_db_query(\"select zone_name from \" . TABLE_ZONES . \" where zone_country_id = '\" . (int)$country_id . \"' and zone_id = '\" . (int)$zone_id . \"'\");\n\tif (tep_db_num_rows($zone_query)) {\n\t\t$zone = tep_db_fetch_array($zone_query);\n\t\treturn $zone['zone_name'];\n\t} else {\n\t\treturn $default_zone;\n\t}\n}",
"function zen_get_country_zones($country_id) {\n global $db;\n $zones_array = array();\n $zones = $db->Execute(\"select zone_id, zone_name\n from \" . TABLE_ZONES . \"\n where zone_country_id = '\" . (int)$country_id . \"'\n order by zone_name\");\n while (!$zones->EOF) {\n $zones_array[] = array('id' => $zones->fields['zone_id'],\n 'text' => $zones->fields['zone_name']);\n $zones->MoveNext();\n }\n\n return $zones_array;\n }",
"public function getCountryId();",
"public function country();",
"function getZones()\r\n\t{\r\n\t\tTienda::load( 'TiendaSelect', 'library.select' );\r\n\t\t$html = '';\r\n\t\t$text = '';\r\n\t\t\t\r\n\t\t$country_id = $this->input->getInt('country_id');\r\n\t\t$prefix = $this->input->getCmd('prefix');\r\n\t\t\r\n\t\tif (empty($country_id))\r\n\t\t{\r\n\t\t $html = JText::_('COM_TIENDA_SELECT_COUNTRY');\r\n\t\t}\r\n \t\telse\r\n\t\t{\r\n\t\t $html = TiendaSelect::zone( '', $prefix.'zone_id', $country_id );\r\n\t\t}\r\n\t\t\t\r\n\t\t$response = array();\r\n\t\t$response['msg'] = $html . \" *\";\r\n\t\t$response['error'] = '';\r\n\r\n\t\t// encode and echo (need to echo to send back to browser)\r\n\t\techo ( json_encode($response) );\r\n\r\n\t\treturn;\r\n\t}",
"function tep_get_zone_code($country, $zone, $def_state) {\n\n\t$ResultSet = Doctrine_Manager::getInstance()\n\t\t->getCurrentConnection()\n\t\t->fetchArray(\"select zone_code from zones where zone_country_id = '\" . (int)$country . \"' and zone_id = '\" . (int)$zone . \"'\");\n\n\tif (sizeof($ResultSet) <= 0) {\n\t\t$state_prov_code = $def_state;\n\t}\n\telse {\n\t\t$state_prov_code = $ResultSet[0]['zone_code'];\n\t}\n\n\treturn $state_prov_code;\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Fetch all currency entities | public function fetchAll()
{
return $this->prepareResults($this->currencyMapper->fetchAll());
} | [
"function findAll() {\n return Currencies::find(array(\n 'order' => 'name',\n ));\n }",
"abstract public function retrieveCurrencies();",
"public static function Retrieve_all(){\n $currencies= \\App\\currencies::all();\n return $currencies;\n }",
"public function findAll() {\n $sql = \"select * from t_currency order by curr_label\";\n $result = $this->getDb()->fetchAll($sql);\n\n // Convert query result to an array of domain objects\n $currencys = array();\n foreach ($result as $row) {\n $currencyId = $row['curr_id'];\n $currencys[$currencyId] = $this->buildDomainObject($row);\n }\n return $currencys;\n }",
"public function getAll()\n {\n return Money::get();\n }",
"public static function getAll(){\r\n $SQL = 'SELECT * FROM cash ORDER BY cash_id;';\r\n $prep= Database::getInstance()->prepare($SQL);\r\n $prep->execute();\r\n return $prep->fetchAll(PDO::FETCH_OBJ);\r\n }",
"public function getCurrencyList();",
"public static function retrieveAll () {\n return self::retrieve()\n ->setRowClass('Model_Entity')\n ->fetchAll();\n }",
"public function getCurrencies(): iterable;",
"public function actionListAllCurrenciesAndExchanges(){\n \n $criteria = new CDbCriteria();\n $criteria->select = '*';\n //$criteria->condition='domain_id=:id';\n //$criteria->params = array(':id'=>$domainid);\n $currency= CurrencyExchange::model()->findAll($criteria);\n \n if($currency===null) {\n http_response_code(404);\n $data['error'] ='No record found';\n echo CJSON::encode($data);\n } else {\n header('Content-Type: application/json');\n echo CJSON::encode(array(\n \"success\" => mysql_errno() == 0,\n \"currency\" => $currency\n \n \n \n \n ));\n \n }\n \n }",
"public function listAllCurrencies()\n {\n $request = new ListAllCurrenciesRequest();\n return $this->send($request);\n }",
"public function getCurrencies(){\n $this->currencies = Currency::all();\n return $this->currencies;\n }",
"public function getCurrencies();",
"public function getAll(): PriceListCollectionTransfer;",
"function cryptocurrencies_get()\n {\n $where = $this->sql->getWhere($this->get('id'), $this->get('symbol'));\n\n $sql = array(\n 'table' => 'monnaie_crypto',\n 'where' => $where\n );\n\n $data = $this->sql->getCache('cryptoAll', $sql);\n\n // Bypass du cache si recherche d'une cryptocurrencie particulière\n $currencies = ($where) ? $this->sql->getBDD($sql) : $data;\n \n if ($this->api->getEtat() == 0) {\n if ($currencies)\n $this->set_response(uniformisationReponse(true, $currencies), REST_Controller::HTTP_OK);\n else \n $this->set_response(uniformisationReponse(false, null, 'Check your request'), REST_Controller::HTTP_NOT_FOUND);\n }\n\n return;\n \n }",
"public function getAll() \n {\n $charges = $this->em->getRepository('ApiPaymentBundle:Charge')\n ->findAll();\n \n $allCharge = [];\n if(count($charges) > 0) {\n foreach($charges as $charge) {\n $data = [\n 'id' => $charge->getId(),\n 'amount' => $charge->getAmount() + $charge->getFee(),\n 'payment_id' => $charge->getPayments()->getId()\n ];\n $allCharge[] = new ChargeModel($data);\n }\n }\n return $allCharge;\n }",
"public function convertAll()\n {\n return $this->em->getRepository($this->entityName)->findAll();\n }",
"public function fetchList()\n {\n return ArrayUtils::arrayList($this->currencyMapper->fetchAll(), 'code', 'value');\n }",
"public function fetchAll()\n\t{\n\t\t// chamando método pai\n\t\treturn $this->fetchListAbstrato($this->_arrayMapper, 'Basico_Model_CvcCvc');\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the public 'manager' shared service. | protected function getManagerService()
{
$a = ($this->services['connection'] ?? $this->getConnectionService());
if (isset($this->services['manager'])) {
return $this->services['manager'];
}
return $this->services['manager'] = new \stdClass($a);
} | [
"public function getSharedManager()\n {\n return $this->sharedManager;\n }",
"public function getManager()\n {\n return Manager::getInstance();\n }",
"public static function getServiceManager()\n {\n // return service manager instance\n return static::$serviceManager;\n }",
"public function getServiceManager ()\n {\n \treturn $this->serviceManager;\n }",
"public function get_service_manager() {\n return $this->_service_manager;\n }",
"public function getManager()\n {\n return Yii::app()->getComponent($this->managerID);\n }",
"function analogue()\n {\n return Manager::getInstance();\n }",
"private function getManager()\n {\n return $this->getDocker()->getContainerManager();\n }",
"private function getManager()\n {\n return self::getDocker();\n }",
"protected function getModule_ManagerService()\n {\n return $this->services['module.manager'] = new \\phpbb\\module\\module_manager($this->get('cache.driver'), $this->get('dbal.conn'), $this->get('ext.manager'), 'phpbb_modules', './../', 'php');\n }",
"public function manager()\n {\n return $this->project->manager;\n }",
"protected function getManager()\n {\n return $this->get('app.unavailability.manager');\n }",
"protected function getManager()\n {\n return $this->objectManager;\n }",
"protected function getSecurity_Authentication_ManagerService()\n {\n $this->privates['security.authentication.manager'] = $instance = new \\Symfony\\Component\\Security\\Core\\Authentication\\AuthenticationProviderManager(new RewindableGenerator(function () {\n yield 0 => ($this->privates['security.authentication.provider.guard.main'] ?? $this->load('getSecurity_Authentication_Provider_Guard_MainService'));\n yield 1 => ($this->privates['security.authentication.provider.anonymous.main'] ?? ($this->privates['security.authentication.provider.anonymous.main'] = new \\Symfony\\Component\\Security\\Core\\Authentication\\Provider\\AnonymousAuthenticationProvider($this->getParameter('container.build_hash'))));\n }, 2), true);\n\n $instance->setEventDispatcher(($this->services['event_dispatcher'] ?? $this->getEventDispatcherService()));\n\n return $instance;\n }",
"protected function getSettingsManager(): Manager\n {\n return $this->app->make(Manager::class);\n }",
"protected function getSecurity_Authentication_ManagerService()\n {\n $this->privates['security.authentication.manager'] = $instance = new \\Symfony\\Component\\Security\\Core\\Authentication\\AuthenticationProviderManager(new RewindableGenerator(function () {\n yield 0 => ($this->privates['security.authentication.provider.dao.main'] ?? $this->load('getSecurity_Authentication_Provider_Dao_MainService'));\n yield 1 => ($this->privates['security.authentication.provider.anonymous.main'] ?? ($this->privates['security.authentication.provider.anonymous.main'] = new \\Symfony\\Component\\Security\\Core\\Authentication\\Provider\\AnonymousAuthenticationProvider($this->getParameter('container.build_hash'))));\n }, 2), true);\n\n $instance->setEventDispatcher(($this->services['event_dispatcher'] ?? $this->getEventDispatcherService()));\n\n return $instance;\n }",
"protected function getObjectManagerService()\n {\n return $this->services['Doctrine\\\\Common\\\\Persistence\\\\ObjectManager'] = new \\Rialto\\Database\\Orm\\ErpDbManager(${($_ = isset($this->services['doctrine.orm.default_entity_manager']) ? $this->services['doctrine.orm.default_entity_manager'] : $this->getDoctrine_Orm_DefaultEntityManagerService()) && false ?: '_'});\n }",
"public function getAccountServiceManager()\n {\n return $this['service_managers_account'];\n }",
"public function getManager()\n {\n if ($this->manager === null) {\n $this->manager = Shopware()->Models();\n }\n\n return $this->manager;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Called when a test raises warnings. | public function testWarning(TestWarning $warning) {
$t= $this->addTestCase($warning, 'errors');
$t->addChild(new Node('error', $this->messageFor($warning), array(
'message' => 'Non-clear error stack',
'type' => 'warnings'
)));
} | [
"public function testWarning(TestWarning $warning);",
"public function testWarning(\\unittest\\TestWarning $warning) {\n // Empty\n }",
"public function testWarning(\\unittest\\TestWarning $warning) {\n $this->writeFailure($warning);\n $this->stats['warned']++;\n }",
"public function testWarning() {\n\t\t$test = new Warning( 'runTest' );\n\t\t$test->run( $this->result );\n\n\t\t$this->assertSame( 1, $this->listener->startTestCount, 'test start count failed' );\n\t\t$this->assertSame( 1, $this->listener->warningCount, 'warning count failed' );\n\t\t$this->assertSame( 1, $this->listener->endTestCount, 'test end count failed' );\n\t}",
"public function testWarning(\\unittest\\TestWarning $warning) {\n $this->status= false;\n $this->stats['warned']++;\n $this->writeFailure($warning);\n }",
"public function testWarning() {\n $this->expectException(Warning::class);\n trigger_error('Test warning', E_USER_WARNING);\n }",
"public function testRunnerWarningTriggered(TestRunnerWarningTriggered $event): void\n {\n if (! str_starts_with($event->message(), 'No tests found in class')) {\n $this->style->writeWarning($event->message());\n }\n }",
"public function testTriggerWarningEnabled(): void\n {\n $error = $this->captureError(E_ALL, function (): void {\n triggerWarning('This will be gone one day');\n $this->assertTrue(true);\n });\n $this->assertMatchesRegularExpression('/This will be gone one day - (.*?)[\\/\\\\\\]FunctionsGlobalTest.php, line\\: \\d+/', $error->getMessage());\n }",
"public function testDeprecationWarningLevelDisabled(): void\n {\n $this->expectNotToPerformAssertions();\n\n $this->withErrorReporting(E_ALL ^ E_USER_DEPRECATED, function (): void {\n deprecationWarning('This is leaving');\n });\n }",
"public static function warningHandler()\n {\n }",
"protected function setWarningsExist() : void {}",
"static function run_tests_warning() {\r\n $tests = get_option(WF_SN_OPTIONS_KEY);\r\n\r\n if (self::is_plugin_page() && !$tests['last_run']) {\r\n echo '<div id=\"message\" class=\"error\"><p>Security Ninja <strong>tests were never run.</strong> Click \"Run tests\" to run them now and analyze your site for security vulnerabilities.</p></div>';\r\n } elseif (self::is_plugin_page() && (current_time('timestamp') - 30*24*60*60) > $tests['last_run']) {\r\n echo '<div id=\"message\" class=\"error\"><p>Security Ninja <strong>tests were not run for more than 30 days.</strong> It\\'s advisable to run them once in a while. Click \"Run tests\" to run them now and analyze your site for security vulnerabilities.</p></div>';\r\n }\r\n }",
"public function testWarning()\n {\n $response = $this->call('GET', '/addwarnings');\n\n $this->assertEquals(200, $response->status());\n }",
"public function checkWarnings() { }",
"protected function setWarningsExist() {}",
"public function setWarnings($warnings = []);",
"public function testWarning()\n\t{\n\t\t$handler = new Handler(new Memory);\n\t\t$handler->warning('Lorem ipsum dol.');\n\n\t\t$m = $handler->messages();\n\t\t$message = array_pop($m);\n\n\t\t$this->assertTrue(is_array($message), 'Individual messages should be of type array');\n\t\t$this->assertEquals($message['type'], 'warning');\n\t}",
"public function testDeprecationWarning(): void\n {\n $current = error_reporting(E_ALL & ~E_USER_DEPRECATED);\n deprecationWarning('This method is deprecated');\n error_reporting($current);\n\n $this->expectDeprecation();\n $this->expectExceptionMessageMatches('/^This method is deprecated/');\n $this->expectExceptionMessageMatches('/You can disable deprecation warnings by setting `error_reporting\\(\\)` to `E_ALL & ~E_USER_DEPRECATED`\\.$/');\n deprecationWarning('This method is deprecated');\n }",
"public function testWarning(): void\n {\n $this->expectException(ErrorException::class);\n $this->expectExceptionCode(E_WARNING);\n $this->expectExceptionMessageMatches('/fopen/');\n $this->expectExceptionMessageMatches(sprintf('!%s!', preg_quote(__DIR__.'/not-found.txt')));\n fopen(__DIR__.'/not-found.txt', 'r');\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Update Warmup process on completion. | private function set_warmup_status_completed() {
$this->set_warmup_status_finish_time();
$this->set_warmup_force_optimization();
} | [
"private function respawn()\n {\n // create new event at the end of the queue\n Mage::getModel('marketingsoftware/queue')\n ->setObject($this->currentStatus)\n ->setAction('file_sync')\n ->save();\n }",
"public function provision()\n {\n ProvisionWebServer::dispatch($this);\n\n $this->update(['provisioning_job_dispatched_at' => Carbon::now()]);\n }",
"public function run()\n {\n $this->app->inline('Self-update running..');\n system('composer -vvv global require aws-upload/aws-upload');\n $this->app->inline(\"Self-update completed\");\n\n if (OhMyZsh::isPluginActive()) {\n system('aws-upload autocomplete');\n }\n\n return Status::SUCCESS;\n }",
"function drush_aegir_update_provision_update_drupal() {\n drush_errors_on();\n provision_backend_invoke(d()->name, 'pm-update');\n drush_log(dt('Drush pm-update task completed'));\n}",
"protected function optimizeNewMedia()\n {\n // Submit background process to continue to run after this request returns\n $script = ROOT_DIR . 'vendor/pitoncms/engine/cli/cli.php';\n exec(\"php $script optimizeMedia > /dev/null &\");\n }",
"public function finishUpdate()\n {\n // TODO to do some things\n\n // ...\n $this->info('脚本执行 [完成]');\n }",
"public function provision()\n {\n ProvisionDatabase::dispatch($this);\n\n $this->update(['provisioning_job_dispatched_at' => Carbon::now()]);\n }",
"public function fullProcess() {\n try {\n $this->process();\n } catch (\\Exception $e) {\n $this->handleException($e);\n }\n }",
"public function finishProcess()\n {\n $this->processFinished = true;\n }",
"function pm_update_complete($project, $version_control) {\n drush_print(dt('Project !project was updated successfully. Installed version is now !version.', array('!project' => $project['name'], '!version' => $project['candidate_version'])));\n drush_command_invoke_all('pm_post_update', $project['name'], $project['releases'][$project['candidate_version']]);\n $version_control->post_update($project);\n}",
"public function process()\n {\n $job = $this->getNext();\n\n $status = $job->run();\n\n //Set the new status on the job's dataset\n $job->getData()->setStatus($status);\n\n $this->update($job);\n }",
"public function execute() {\n if ($this->update_null_forum_post_counts()) {\n \\core\\task\\manager::queue_adhoc_task(new refresh_forum_post_counts());\n }\n }",
"protected function updateAfterInstall() {}",
"public function update_warmup_status_while_has_items() {\n\t\tif ( $this->is_warmup_finished() || ! $this->is_scanner_fetching_finished() ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$items = $this->resources_query->get_waiting_prewarmup_items();\n\n\t\tif ( empty( $items ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$request = $this->handle_post(\n\t\t\t[\n\t\t\t\t'body' => [\n\t\t\t\t\t'urls' => $this->prepare_resources_array( $items ),\n\t\t\t\t],\n\t\t\t]\n\t\t);\n\n\t\tif ( ! $request ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$this->update_from_response();\n\t}",
"public function monitor()\n {\n foreach ($this->processes as $key => $process) {\n $process->updateStatus();\n if (!$process->isRunning())\n {\n $this->closedProcesses[] = $process;\n if ($this->restartMode) {\n $this->restartProcess($process);\n } else {\n $this->closeProcess($process);\n unset($this->processes[$key]);\n }\n }\n }\n }",
"function perform_update() {\n $this->echo(\"Component:\", $this->component);\n $this->echo(\"New version:\", $this->new_version);\n $this->get_plugin_info();\n if ( $this->plugin_info ) {\n if ( $this->banner_low ) {\n $this->get_banner_low();\n } else {\n $this->download_assets();\n }\n\n $this->download_plugin_version();\n $this->update_installed_plugin();\n $this->update_oik_plugin();\n } else {\n $this->echo( \"Error:\",\"Not found.\" );\n }\n\n\t}",
"protected function refreshStatus():void {\n\t\t$running = $this->status[\"running\"] ?? null;\n\t\tif($running || empty($this->status)) {\n\t\t\tif(is_resource($this->process)) {\n\t\t\t\t$this->status = proc_get_status($this->process);\n\t\t\t}\n\t\t}\n\t}",
"public function update()\n {\n $this->isUpdate = true;\n $this->install();\n }",
"private function set_warmup_status_finish_time() {\n\t\t$prewarmup_stats = $this->options_api->get( 'prewarmup_stats', [] );\n\n\t\tif ( ! empty( $prewarmup_stats['warmup_status_finish_time'] ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$prewarmup_stats['warmup_status_finish_time'] = time();\n\t\t$this->options_api->set( 'prewarmup_stats', $prewarmup_stats );\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set the content with the layout applied | public function setPostLayoutContent($content); | [
"public function layout() {}",
"public function getContentLayoutView();",
"public function initLayout();",
"protected function setupLayout(){\n\t\t\tif (!is_null($this->layout)){\n\t\t\t\t$this->layout = View::make($this->layout);\n\t\t\t}\n\t\t}",
"public function testSetLayout()\n\t{\n\t\t// Remove the following lines when you implement this test.\n\t\t$this->markTestIncomplete(\n\t\t\t'This test has not been implemented yet.'\n\t\t);\n\t}",
"protected function setupLayout() {\n\t\tif (!is_null($this->layout)) {\n\t\t\t$this->layout = View::make($this->layout);\n\t\t}\n\t}",
"public function setLayout() {\n $this->layout()->setTemplate('social/layout');\n }",
"protected function setupLayout()\n\t{\n\t\tif (! is_null($this->layout))\n\t\t{\n\t\t\t$this->layout = View::make($this->layout);\n\t\t}\n\t}",
"protected function setupLayout()\n\t{\n\t\tif ( ! is_null($this->layout))\n\t\t{\n\t\t\t$this->layout = View::make($this->layout);\n\n $identity = Auth::user()->identity;\n\n $sety = SetType::all();\n $si = 0;\n $setar=array();\n $title='';\n $this->layout->title='';\n $this->layout->content='';\n foreach($sety as $setyop){\n $setar[$si]['id'] = $setyop->id;\n $setar[$si]['name'] = $setyop->type_name;\n $si++;\n }\n if($identity === 1){\n $this->layout->nav = View::make('_layouts.headnav');\n $this->layout->nav->yy=Auth::user()->name;\n\n $this->layout->nav->type = $setar;\n }else{\n $this->layout->nav = View::make('_layouts.headnav2');\n $this->layout->nav->yy=Auth::user()->name;\n\n }\n\n\n\t\t}\n\t}",
"protected function setupLayout()\n\t{\n\n\t\t// Set Layout\n\t\tif (!is_null($this->layout))\n\t\t{\n\t\t\t$this->layout = View::make($this->layout);\n\t\t}\n\n\t}",
"public function renderLayout();",
"public function set_content_view($view)\n {\n if($this->request->is_ajax()) \n {\n $this->layout = $view;\n }\n else \n {\n $this->layout->content = $view;\n }\n }",
"protected function setupLayout()\n\t{\n\t\tif ( ! is_null($this->layout))\n\t\t{\n\t\t\t$this->layout = View::make($this->layout);\n\t\t}\n\n $this->setUp();\n\t}",
"protected function setupLayout()\n\t{\n\t\tif ( ! is_null($this->layout))\n\t\t{\n\t\t\t$this->layout = $this->view->make($this->layout);\n\t\t}\n\t}",
"public function setLayout($value);",
"protected function setupLayout()\n {\n if ( ! is_null($this->layout))\n {\n $this->layout = View::make($this->layout);\n $this->layout->with('controller',$this);\n }\n\n\n }",
"function setLayout($value) {\n $this->layout = $value;\n }",
"private function renderLayout() {\n\t\t$this->moveToFragment(\"layout\");\n\n\t\tinclude(__DIR__.\"/../view/layouts/\".$this->layout.\".php\");\n\n\t\tob_flush();\n\t}",
"protected function _prepareLayout()\n {\n parent::_prepareLayout();\n\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the date of death | public function getDateOfDeath(): ?Date {
return $this->dod;
} | [
"function getDeathDate()\n {\n $evDeath = $this->getDeathEvent();\n if ($evDeath)\n return $evDeath->getDate($this->dprivlim);\n else\n return '';\n }",
"public function getDeathday()\n {\n return $this->deathday;\n }",
"public function getDeathMessage(){\n\t\treturn $this->message_death;\n\t}",
"public function getDate_de_naissance()\n {\n return $this->date_de_naissance;\n }",
"public function getDeathYear() {\n\t\treturn $this->getDeathDate()->minimumDate()->format('%Y');\n\t}",
"public function getDateOfEmission(){\n\t\treturn $this->dateOfEmission;\n\t}",
"public function getDateDePublication()\n {\n return $this->dateDePublication;\n }",
"public function getDateDebut();",
"function death($reason)\n {\n $this->dead = $reason; // Toggle dead to true so that the species can be removed from the habitat's species array\n \n // log the death\n $cause = array(HEAT => 'HEAT', COLD => 'COLD', THIRST => 'THIRST', STARVATION => 'STARVATION', OLD_AGE => 'OLD_AGE');\n log::record('1 ' . $this->name . ' died of ' . $cause[$reason] . ' at ' . $this->get_age_in_years() . ' years of age.', 3);\n }",
"public function getDateDeboc()\n {\n return $this->dateDeboc;\n }",
"public function getDatedue()\n {\n return $this->datedue;\n }",
"function getDeathEvent($create = false)\n {\n global $debug;\n global $warn;\n\n // ensure that the events table is initialized\n if (is_null($this->pevents))\n {\n $events = $this->getEvents();\n }\n $event = $this->deathEvent;\n if (is_null($event))\n { // not initialized\n $eventd = $this['deathd'];\n if ($eventd == '')\n $eventsd = 99999998;\n else\n $eventsd = $this['deathsd'];\n if ($create ||\n $eventd != '' ||\n $this['idlrdeath'] > 1 ||\n $this['idardeath'] > 1 ||\n $this['deathnote'] != '')\n { // create death event from Person\n $trow = array('idir' => $this,\n 'idtype' => Event::IDTYPE_INDIV,\n 'idet' => Event::ET_DEATH,\n 'eventd' => $eventd,\n 'eventsd' => $eventsd,\n 'idlrevent' => $this['idlrdeath'],\n 'idar' => $this['idardeath'],\n 'desc' => $this['deathnote'],\n 'description' => $this['deathcause'],\n 'preferred' => 1,\n 'order' => (1 << 15) - 3);\n $event = new Event($trow);\n $this->deathEvent = $event;\n $this->pevents['death'] = $event;\n } // create death event from Person\n else\n $event = null;\n } // not initialized\n return $event;\n }",
"public function getDate_debut()\n {\n return $this->date_debut;\n }",
"function getBirthDate()\n {\n $evBirth = $this->getBirthEvent();\n if ($evBirth)\n return $evBirth->getDate($this->bprivlim);\n else\n return '';\n }",
"public function getDateDebut()\n {\n return $this->dateDebut;\n }",
"public function getNumberOfDeaths()\n {\n return $this->numberOfDeaths;\n }",
"public function getDateDebut()\n {\n return $this->_dateDebut;\n }",
"public function getDateReception()\n {\n return $this->dateReception;\n }",
"public function getDateDeclenchement() {\n return $this->dateDeclenchement;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Public Methods ========================================================================= Set our $plugin static property to this class so that it can be accessed via CraftStatus::$plugin Called after the plugin class is instantiated; do any onetime initialization here such as hooks and events. If you have a '/vendor/autoload.php' file, it will be loaded for you automatically; you do not need to load it in your init() method. | public function init()
{
parent::init();
self::$plugin = $this;
$this->_registerLogger();
$this->_redirectAfterInstall();
$this->_registerEvents();
} | [
"static\tpublic \tfunction\tinit() {\n\t\t\t/**\n\t\t\t * Implement any processes that need to happen before the plugin is instantiated. \n\t\t\t */\n\t\t\t\n\t\t\t//Instantiate the plugin and return it. \n\t\t\treturn new self();\n\t\t}",
"public function init()\n {\n parent::init();\n self::$plugin = $this;\n\n // Add in our Twig extensions\n Craft::$app->view->registerTwigExtension(new VideoUtilsTwigExtension());\n\n // Do something after we're installed\n Event::on(\n Plugins::class,\n Plugins::EVENT_AFTER_INSTALL_PLUGIN,\n function (PluginEvent $event) {\n if ($event->plugin === $this) {\n // We were just installed\n }\n }\n );\n\n Craft::info(\n Craft::t(\n 'video-utils',\n '{name} plugin loaded',\n ['name' => $this->name]\n ),\n __METHOD__\n );\n }",
"public function init()\n {\n parent::init();\n self::$plugin = $this;\n\n Craft::setAlias('@qiniu', $this->getBasePath());\n\n // Register volume types\n Event::on(Volumes::class, Volumes::EVENT_REGISTER_VOLUME_TYPES, function (RegisterComponentTypesEvent $e) {\n $e->types[] = QiniuVolume::class;\n });\n\n Craft::info(\n Craft::t(\n 'qiniu',\n '{name} plugin loaded',\n ['name' => $this->name]\n ),\n __METHOD__\n );\n }",
"public function init()\n {\n parent::init();\n\n self::$plugin = $this;\n\n // Register our site routes\n Event::on(\n UrlManager::class,\n UrlManager::EVENT_REGISTER_SITE_URL_RULES,\n function (RegisterUrlRulesEvent $event) {\n $event->rules['hasura/auth'] = 'hasura/auth';\n $event->rules['hasura/webhook'] = 'hasura/webhook';\n }\n );\n\n Craft::info(\n Craft::t(\n 'hasura',\n '{name} plugin loaded',\n ['name' => $this->name]\n ),\n __METHOD__\n );\n }",
"public function init()\n {\n parent::init();\n self::$plugin = $this;\n\n // Register our elements\n Event::on(\n Elements::class,\n Elements::EVENT_REGISTER_ELEMENT_TYPES,\n function (RegisterComponentTypesEvent $event) {\n $event->types[] = ConditionsElement::class;\n }\n );\n\n // Do something after we're installed\n Event::on(\n Plugins::class,\n Plugins::EVENT_AFTER_INSTALL_PLUGIN,\n function (PluginEvent $event) {\n if ($event->plugin === $this) {\n // We were just installed\n }\n }\n );\n\n/**\n * Logging in Craft involves using one of the following methods:\n *\n * Craft::trace(): record a message to trace how a piece of code runs. This is mainly for development use.\n * Craft::info(): record a message that conveys some useful information.\n * Craft::warning(): record a warning message that indicates something unexpected has happened.\n * Craft::error(): record a fatal error that should be investigated as soon as possible.\n *\n * Unless `devMode` is on, only Craft::warning() & Craft::error() will log to `craft/storage/logs/web.log`\n *\n * It's recommended that you pass in the magic constant `__METHOD__` as the second parameter, which sets\n * the category to the method (prefixed with the fully qualified class name) where the constant appears.\n *\n * To enable the Yii debug toolbar, go to your user account in the AdminCP and check the\n * [] Show the debug toolbar on the front end & [] Show the debug toolbar on the Control Panel\n *\n * http://www.yiiframework.com/doc-2.0/guide-runtime-logging.html\n */\n Craft::info(\n Craft::t(\n 'conditions',\n '{name} plugin loaded',\n ['name' => $this->name]\n ),\n __METHOD__\n );\n if(Craft::$app->getRequest()->getIsCpRequest()) {\n if (Craft::$app->getRequest()->getIsAjax()) {\n $this->ProcessAfterLoad();\n } else {\n\n $this->includeAssets();\n Craft::$app->view->registerJs('if (window.Craft && window.Craft.ConditionsPlugin) {\n Craft.ConditionsPlugin.init('.$this->jsonToJs().');\n }');\n Event::on(Fields::class, Fields::EVENT_BEFORE_SAVE_FIELD_LAYOUT, function(Event $event) {\n $this->onSaveConditionalLayout($event);\n });\n }\n }\n }",
"public function init_plugin() {\n $this->includes();\n $this->init_hooks();\n }",
"public function init_plugin() {\r\n $this->includes();\r\n $this->init_hooks();\r\n }",
"protected static function init_plugin() {\n\t\t// Plugin updates.\n\t\tif (\\BLOBCOMMON_MUST_USE) {\n\t\t\t// Must-Use doesn't have normal version management, but we\n\t\t\t// can add filters for Musty in case someone's using that.\n\t\t\t\\add_filter(\n\t\t\t\t'musty_download_version_blob-common/index.php',\n\t\t\t\tarray(static::class, 'musty_download_version')\n\t\t\t);\n\t\t\t\\add_filter(\n\t\t\t\t'musty_download_uri_blob-common/index.php',\n\t\t\t\tarray(static::class, 'musty_download_uri')\n\t\t\t);\n\t\t}\n\t\telse {\n\t\t\t// Normal plugins are... more normal.\n\t\t\t\\add_filter(\n\t\t\t\t'transient_update_plugins',\n\t\t\t\tarray(static::class, 'update_plugins')\n\t\t\t);\n\t\t\t\\add_filter(\n\t\t\t\t'site_transient_update_plugins',\n\t\t\t\tarray(static::class, 'update_plugins')\n\t\t\t);\n\t\t}\n\t}",
"public function init()\n {\n parent::init();\n self::$plugin = $this;\n\n if (Craft::$app->request->getIsSiteRequest()) {\n Craft::$app->view->registerTwigExtension(new VatCheckerTwigExtension());\n }\n\n Event::on(\n Fields::class,\n Fields::EVENT_REGISTER_FIELD_TYPES,\n function (RegisterComponentTypesEvent $event) {\n $event->types[] = VatField::class;\n }\n );\n\n Event::on(\n Plugins::class,\n Plugins::EVENT_AFTER_INSTALL_PLUGIN,\n function (PluginEvent $event) {\n if ($event->plugin === $this) {\n // We were just installed\n }\n }\n );\n\n Craft::info(\n Craft::t(\n 'vat-checker',\n '{name} plugin loaded',\n ['name' => $this->name]\n ),\n __METHOD__\n );\n }",
"public function init_plugin()\n {\n $this->includes();\n $this->init_hooks();\n }",
"public function init()\n {\n parent::init();\n self::$plugin = $this;\n\n // Setup global plugin event handlers\n $this->registerEventHandlers();\n\n Craft::info(\n Craft::t(\n 'craft-commerce-pricing-matrix',\n '{name} plugin loaded',\n ['name' => $this->name]\n ),\n __METHOD__\n );\n }",
"public function init()\n {\n parent::init();\n self::$plugin = $this;\n\n $config = Craft::$app->getConfig()->getGeneral();\n if (!$config->allowAdminChanges) {\n // Do nothing if admin changes aren't allowed\n return;\n }\n\n $request = Craft::$app->getRequest();\n if (!$request->getIsCpRequest() || $request->getIsConsoleRequest()) {\n // Also do nothing if this is a console or site request\n return;\n }\n\n // Handler: EVENT_AFTER_LOAD_PLUGINS\n Event::on(\n Plugins::class,\n Plugins::EVENT_AFTER_LOAD_PLUGINS,\n function () {\n $this->doIt();\n }\n );\n\n Craft::info(\n Craft::t(\n 'cp-field-inspect',\n '{name} plugin loaded',\n ['name' => $this->name]\n ),\n __METHOD__\n );\n }",
"public function init()\n {\n parent::init();\n self::$plugin = $this;\n\n // Register our fields\n Event::on(\n Fields::className(),\n Fields::EVENT_REGISTER_FIELD_TYPES,\n function (RegisterComponentTypesEvent $event) {\n $event->types[] = StarsField::class;\n $event->types[] = ColoursField::class;\n $event->types[] = TextSizeField::class;\n $event->types[] = ButtonsField::class;\n $event->types[] = WidthField::class;\n $event->types[] = TriggersField::class;\n }\n );\n\n // Do something after we're installed\n Event::on(\n Plugins::className(),\n Plugins::EVENT_AFTER_INSTALL_PLUGIN,\n function (PluginEvent $event) {\n if ($event->plugin === $this) {\n // We were just installed\n }\n }\n );\n\n/**\n * Logging in Craft involves using one of the following methods:\n *\n * Craft::trace(): record a message to trace how a piece of code runs. This is mainly for development use.\n * Craft::info(): record a message that conveys some useful information.\n * Craft::warning(): record a warning message that indicates something unexpected has happened.\n * Craft::error(): record a fatal error that should be investigated as soon as possible.\n *\n * Unless `devMode` is on, only Craft::warning() & Craft::error() will log to `craft/storage/logs/web.log`\n *\n * It's recommended that you pass in the magic constant `__METHOD__` as the second parameter, which sets\n * the category to the method (prefixed with the fully qualified class name) where the constant appears.\n *\n * To enable the Yii debug toolbar, go to your user account in the AdminCP and check the\n * [] Show the debug toolbar on the front end & [] Show the debug toolbar on the Control Panel\n *\n * http://www.yiiframework.com/doc-2.0/guide-runtime-logging.html\n */\n Craft::info(Craft::t('buttonbox', '{name} plugin loaded', ['name' => $this->name]), __METHOD__);\n }",
"public function init()\n {\n parent::init();\n self::$plugin = $this;\n\n // Add in our Twig extensions\n Craft::$app->view->registerTwigExtension(new BitsTwigExtension());\n\n // Register our variables\n Event::on(\n CraftVariable::class,\n CraftVariable::EVENT_INIT,\n function (Event $event) {\n /** @var CraftVariable $variable */\n $variable = $event->sender;\n $variable->set('bits', BitsVariable::class);\n }\n );\n\n // Logging\n Craft::info(\n Craft::t(\n 'bits',\n '{name} plugin loaded',\n ['name' => $this->name]\n ),\n __METHOD__\n );\n }",
"public function init_plugin() {\n\t\t\n\t\t//Init vars\n\t\t$options \t\t= self::$class_config;\n\t\t\n\t\tif( !empty($options) && is_admin() ) {\n\t\t\n\t\t\t//Confirm we are on an active admin view\n\t\t\tif( $this->is_active_view() ) {\n\t\t\n\t\t\t\t//Set plugin admin actions\n\t\t\t\t$this->set_admin_actions();\n\t\t\t\t\n\t\t\t\t//Enqueue admin scripts\n\t\t\t\tadd_action( 'admin_enqueue_scripts', array($this, 'enqueue_admin_scripts') );\n\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}",
"public function init()\n {\n $this->require_plugin('libkolab');\n\n $this->rc = rcube::get_instance();\n\n // proceed initialization in startup hook\n $this->add_hook('startup', array($this, 'startup'));\n }",
"public function __construct() {\n\t\t/*Define Autoloader class for plugin*/\n\t\t$autoloader_path = 'includes/class-autoloader.php';\n\t\t/**\n\t\t * Include autoloader class to load all of classes inside this plugin\n\t\t */\n\t\trequire_once trailingslashit( plugin_dir_path( __FILE__ ) ) . $autoloader_path;\n\n\t\t/*Define required constant for plugin*/\n\t\tConstant::define_constant();\n\n\t\t/**\n\t\t * Register activation hook.\n\t\t * Register activation hook for this plugin by invoking activate\n\t\t * in Restaurant_Booking_Plugin class.\n\t\t *\n\t\t * @param string $file path to the plugin file.\n\t\t * @param callback $function The function to be run when the plugin is activated.\n\t\t */\n\t\tregister_activation_hook(\n\t\t\t__FILE__,\n\t\t\tfunction () {\n\t\t\t\t$this->activate(\n\t\t\t\t\tnew Activator()\n\t\t\t\t);\n\t\t\t}\n\t\t);\n\t\t/**\n\t\t * Register deactivation hook.\n\t\t * Register deactivation hook for this plugin by invoking deactivate\n\t\t * in Restaurant_Booking_Plugin class.\n\t\t *\n\t\t * @param string $file path to the plugin file.\n\t\t * @param callback $function The function to be run when the plugin is deactivated.\n\t\t */\n\t\tregister_deactivation_hook(\n\t\t\t__FILE__,\n\t\t\tfunction () {\n\t\t\t\t$this->deactivate(\n\t\t\t\t\tnew Deactivator()\n\t\t\t\t);\n\t\t\t}\n\t\t);\n\t\t/**\n\t\t * Register uninstall hook.\n\t\t * Register uninstall hook for this plugin by invoking uninstall\n\t\t * in Restaurant_Booking_Plugin class.\n\t\t *\n\t\t * @param string $file path to the plugin file.\n\t\t * @param callback $function The function to be run when the plugin is uninstalled.\n\t\t */\n\t\tregister_uninstall_hook(\n\t\t\t__FILE__,\n\t\t\tarray( 'Restaurant_Booking_Plugin', 'uninstall' )\n\t\t);\n\t}",
"function init() {\n\n\t// Load plugin text domain.\n\tload_plugin_textdomain(\n\t\t'dashboard-summary',\n\t\tfalse,\n\t\tdirname( DS_BASENAME ) . '/languages'\n\t);\n\n\t// If this is in the must-use plugins directory.\n\tload_muplugin_textdomain(\n\t\t'dashboard-summary',\n\t\tdirname( DS_BASENAME ) . '/languages'\n\t);\n\n\t/**\n\t * Class autoloader\n\t *\n\t * The autoloader registers plugin classes for later use,\n\t * such as running new instances below.\n\t */\n\trequire_once DS_PATH . 'includes/autoloader.php';\n\n\t// Settings and core methods.\n\tnew Classes\\Settings;\n\tnew Classes\\Summary;\n\tnew Classes\\User_Options;\n\n\t// Add settings link to plugin row.\n\tadd_filter( 'plugin_action_links_' . DS_BASENAME, [ __NAMESPACE__ . '\\Classes\\Settings', 'settings_link' ], 99 );\n\tadd_filter( 'network_admin_plugin_action_links_' . DS_BASENAME, [ __NAMESPACE__ . '\\Classes\\Settings', 'settings_link' ], 99 );\n}",
"public function init()\n {\n parent::init();\n self::$plugin = $this;\n\n // Do something after we're installed\n Event::on(\n Plugins::class,\n Plugins::EVENT_AFTER_INSTALL_PLUGIN,\n function (PluginEvent $event) {\n if ($event->plugin === $this) {\n // We were just installed\n $this->createFields();\n }\n }\n );\n\n Event::on(\n Plugins::class,\n Plugins::EVENT_AFTER_UNINSTALL_PLUGIN,\n function (PluginEvent $event) {\n if ( $event->plugin === $this ) {\n // We are uninstalled\n $this->removeFields();\n }\n }\n );\n\n Event::on(Gateways::class, Gateways::EVENT_REGISTER_GATEWAY_TYPES, function(RegisterComponentTypesEvent $event) {\n $event->types[] = TwoGateway::class;\n });\n\n Event::on(\n UrlManager::class,\n UrlManager::EVENT_REGISTER_SITE_URL_RULES,\n function (RegisterUrlRulesEvent $event) {\n $event->rules['commerce-two/return/'] = 'commerce-two/checkout';\n $event->rules['commerce-two/company-search/'] = 'commerce-two/checkout/company-search';\n $event->rules['commerce-two/company-address/'] = 'commerce-two/checkout/company-address';\n $event->rules['commerce-two/company-check/'] = 'commerce-two/checkout/is-company-allowed-for-payment';\n $event->rules['commerce-two/set-company/'] = 'commerce-two/checkout/set-company-on-cart';\n $event->rules['commerce-two/set-customer-addresses/'] = 'commerce-two/checkout/set-customer-addresses';\n }\n );\n\n\n Event::on(\n CraftVariable::class,\n CraftVariable::EVENT_INIT,\n function(Event $event) {\n $variable = $event->sender;\n $variable->set('twoPayment', CommerceTwoVariable::class);\n }\n );\n\n /**\n * Logging in Craft involves using one of the following methods:\n *\n * Craft::trace(): record a message to trace how a piece of code runs. This is mainly for development use.\n * Craft::info(): record a message that conveys some useful information.\n * Craft::warning(): record a warning message that indicates something unexpected has happened.\n * Craft::error(): record a fatal error that should be investigated as soon as possible.\n *\n * Unless `devMode` is on, only Craft::warning() & Craft::error() will log to `craft/storage/logs/web.log`\n *\n * It's recommended that you pass in the magic constant `__METHOD__` as the second parameter, which sets\n * the category to the method (prefixed with the fully qualified class name) where the constant appears.\n *\n * To enable the Yii debug toolbar, go to your user account in the AdminCP and check the\n * [] Show the debug toolbar on the front end & [] Show the debug toolbar on the Control Panel\n *\n * http://www.yiiframework.com/doc-2.0/guide-runtime-logging.html\n */\n Craft::info(\n Craft::t(\n 'commerce-two',\n '{name} plugin loaded',\n ['name' => $this->name]\n ),\n __METHOD__\n );\n\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
name CFDiskIO::getBelongingRaidDev($dev) description Searches for the RAID device, a physical partition belongs to, if it is part of a RAID. parameter dev: The physical partition (e.g. /dev/hda4) that belongs to a RAID. returns The RAID device (e.g. /dev/md0) the physical partition belongs to or false, if no belonging RAID was found. | protected function getBelongingRaidDev($dev)
{
for ($vDisk = 0; $vDisk < $this->getDiskAmount(); $vDisk++)
{
foreach ($this->getRaidDevsBuildingDisk($vDisk) as $raidDev)
if ($dev == $raidDev)
return($this->getDiskDev($vDisk));
}
return(false);
} | [
"public function fdiskGetEntry(&$dev, &$mountpoint, &$parameter)\n\t{\n\t\t$cur = HELPER_each($this->fstab);\n\n\t\t// Is the array pointer at the end of the array?\n\t\tif ($cur === false)\n\t\t{\n\t\t\treset($this->fstab);\n\t\t\treturn(false);\n\t\t}\n\n\t\t// Write the current array variables to the parameter pointer\n\t\t$dev = $cur['value']['dev'];\n\t\t$mountpoint = $cur['value']['mnt'];\n\t\t$parameter = $cur['value']['param'];\n\n\t\t// Another entry could be fetched\n\t\treturn(true);\n\t}",
"function FDISK_findFstabMountPointByDev($fstabA, $dev)\n{\n\tif (!is_array($fstabA) || !isset($fstabA['fstab_amount']))\n\t\treturn(false);\n\n\tfor ($i = 0; $i < $fstabA['fstab_amount']; $i++)\n\t\tif ($fstabA[\"fstab_dev$i\"] == $dev)\n\t\t\treturn($fstabA[\"fstab_mnt$i\"]);\n\treturn(false);\n}",
"function FDISK_devNrExists($param, $vDev, $devNr)\n{\n\tfor ( $vPart = 0; $vPart < $param[\"dev$vDev\".\"_partamount\"]; $vPart++)\n\t\t{\n\t\t\tif ($devNr == $param[\"dev$vDev\".\"part$vPart\".\"_nr\"])\n\t\t\t\treturn(true);\n\t\t};\n\n\treturn(false);\n}",
"public function getIsAccessoryOrSparePartFor();",
"public function is_software_raid_device($device)\n {\n clearos_profile(__METHOD__, __LINE__);\n\n $raid = $this->get_software_raid_devices();\n\n if (array_key_exists($device, $raid))\n return TRUE;\n\n return FALSE;\n }",
"function FDISK_getvPart($param, $vDev, $devNr)\n{\n\tfor ($vPart = 0; $vPart < $param[\"dev$vDev\".\"_partamount\"]; $vPart++)\n\t\t{\n\t\t\tif ($param[\"dev$vDev\".\"part$vPart\".\"_nr\"] == $devNr)\n\t\t\t\treturn($vPart);\n\t\t}\n\n\treturn(-1);\n}",
"final public function is_software_raid_device($device)\n {\n clearos_profile(__METHOD__, __LINE__);\n\n $raid = $this->get_software_raid_devices();\n if (array_key_exists($device, $raid)) return TRUE;\n return FALSE;\n }",
"public function getRaid() : Raid {\n return $this->raid;\n }",
"protected function isDiskOrPartLockedByRaid($vDisk, $vPart)\n\t{\n\t\tif (false === $vDisk)\n\t\t{\n\t\t\tdebug_print_backtrace();\n\t\t\treturn(false);\n\t\t}\n\n\t\tif (false === $vPart)\n\t\t\treturn(isset($this->wantedPartitioning[$vDisk]['raidLvmLock']) && (1 == $this->wantedPartitioning[$vDisk]['raidLvmLock']));\n\t\telse\n\t\t\treturn(isset($this->wantedPartitioning[$vDisk][$vPart]['raidLvmLock']) && (1 == $this->wantedPartitioning[$vDisk][$vPart]['raidLvmLock']));\n\t}",
"public function getIsAccessoryOrSparePartFor() {\n\t\treturn $this->isAccessoryOrSparePartFor;\n\t}",
"function get_hraid_disks_list() {\n $kerneldisks = explode(\" \", trim(preg_replace(\"/kern.disks: /\", \"\", exec(\"/sbin/sysctl kern.disks\"))));\n \n /* Recupere la liste des disques ATA et SCSI */\n $diskdetected = array_merge((array)get_ata_disks_list(),(array)get_scsi_disks_list());\n \n /* Recupere le dmesg */\n exec(\"/sbin/dmesg\",$rawdmesg);\n \n foreach ($kerneldisks as $diskname) {\n $allready=1;\n \n // Check of this entry is IDE or SCSI (allready detected)\n foreach ($diskdetected as $diskfoundk => $diskfoundv) {\n if (strcasecmp($diskfoundk,$diskname) == 0) {\n $allready = 0;\n }\n }\n\n if ($allready) {\n /* If not an IDE and SCSI disk */\n $disklist[$diskname]=array();\n $disklist[$diskname]['name']=$diskname;\n $disklist[$diskname]['fullname']= \"/dev/\" . $diskname;\n\n $disklist[$diskname]['type'] = \"RAID\";\n\n /* Looking for the disk size in the dmesg */\n foreach ($rawdmesg as $dmesgline) {\n /* Separe la ligne par les espace */\n $dmesgtab = explode(\" \", $dmesgline);\n $dmesgtab[0] = rtrim($dmesgtab[0],\":\");\n // si la ligne commence par le nom du disque: attention il y a 2 lignes\n if ($dmesgtab[0]!=\"\" &&(strcasecmp($dmesgtab[0],$diskname) == 0)) {\n // the first line as this example \"aacd0: <RAID 5> on aac0\"\n if (strcasecmp(substr($dmesgtab[1], 0, 1),\"<\") == 0) {\n /* Match the description witch is include between < and > */\n preg_match(\"/.*\\<([^>]*)>.*/\",$dmesgline,$match);\n $disklist[$diskname]['desc'] = $match[1];\n } else{\n // si c'est la deuxieme ligne, elle ressemble a \"aacd0: 138850MB (284365824 sectors)\"\n $disklist[$diskname]['size'] = $dmesgtab[1];\n } // end if\n } // end if\n } // end foreach\n } // end if\n } // end foreach\n\n return $disklist;\n}",
"private function getvrDevNrByrDev($vrDisk, $dev)\n\t{\n\t\tforeach ($this->getRaidDevsBuildingDisk($vrDisk) as $rDevNr => $rDev)\n\t\t{\n\t\t\tif ($rDev == $dev)\n\t\t\t\treturn($rDevNr);\n\t\t}\n\n\t\treturn(false);\n\t}",
"protected function getRaidDevsBuildingDisk($vrDisk)\n\t{\n\t\treturn($this->fdiskGetProperty(@$this->wantedPartitioning[$vrDisk]['raidDrive'], \"\", array()));\n\t}",
"public function get_device( $id ) {\n\t\tforeach ( $this->devices as $device ) {\n\t\t\tif ( $device['id'] == $id ) {\n\t\t\t\treturn $device;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}",
"private function getSubBreeds($breed = null)\n {\n $allBreeds = $this->getAllBreeds();\n\n foreach ($allBreeds as $master => $sub) {\n if (strtolower($breed) == $master) {\n return $sub;\n }\n }\n\n return false;\n }",
"public function findAndSetEFIBootPartDev()\n\t{\n\t\t// Run thru the disks and partitions\n\t\tfor ($vDisk = 0; $vDisk < $this->getDiskAmount(); $vDisk++)\n\t\t\tfor ($vPart = 0; $vPart < $this->getPartAmount($vDisk); $vPart++)\n\t\t\t{\n\t\t\t\t// Check, if the current partitions has a vfat filesystem\n\t\t\t\tif ($this->getPartitionFileSystem($vDisk, $vPart, 'xxx') == 'fat32')\n\t\t\t\t{\n\t\t\t\t\t$this->setEFIBootPartDev($this->getPartitionDev($vDisk, $vPart, ''));\n\t\t\t\t\treturn(true);\n\t\t\t\t}\n\t\t\t}\n\t\treturn(false);\n\t}",
"function _is_mounted($device)\n{\n $mount_point = NULL;\n if (!($fh = fopen(ETC_MTAB, 'r')))\n return FALSE;\n\n while (!feof($fh)) {\n $buffer = chop(fgets($fh, 4096));\n if (!strlen($buffer)) break;\n list($name, $mount_point) = explode( ' ', $buffer);\n if ($name == $device) {\n fclose($fh);\n return TRUE;\n }\n }\n\n $mount_point = NULL;\n\n fclose($fh);\n return FALSE;\n}",
"public function mythicRaidLeaderboard(string $raid = 'uldir', string $faction = 'alliance')\n {\n return $this->createRequest('GET', '/data/wow/leaderboard/hall-of-fame/' . $raid . '/' . $faction);\n }",
"public function hasDrive();"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Grabs uri segment, it not defined returns an array of the request uri segment controller/action/params | public function segments($segment = null) // 0 = first segment
{
$uri = $_SERVER['REQUEST_URI'];
$uri = $this->split_segments($uri, true);
//I don't use empty() because I want to check
//if were actually returning the whole array
if(is_null($segment)) {
return $uri;
}
if(isset($uri[$segment])) {
return $uri[$segment];
}
return array();
} | [
"protected function parseSegments()\n {\n return explode(\"/\",$_SERVER[\"REQUEST_URI\"]);\n \n\n }",
"protected function getSegments()\n {\n $driver = $this->ci->uri->segment(3);\n $action = $this->ci->uri->segment(4);\n\n return [$driver, $action];\n }",
"protected function list_segments()\n\t{\n\t\t$base_length = strlen($_SERVER['PHP_SELF']) - 9;\t// Get the length of the uri (e.g. /feather/public)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// We subtract 9 as that's the length of 'index.php'\n\t\t$request = $_SERVER['REQUEST_URI'];\n\t\t$segment_string = substr($request, $base_length);\t// Get the main segments\n\n\t\tif ($segment_string)\n\t\t\treturn explode('/', $segment_string);\n\t\telse\n\t\t\treturn array();\n\t}",
"public function segments()\n {\n $segments = explode('/', $this->server('REQUEST_URI'));\n return array_values(array_filter($segments, function ($v) {\n \tif (strstr($v, '?')) {\n \t\t$explode = explode('?', $v);\n \t\treturn $explode[0] !== '';\n \t} else {\n \t\treturn $v !== '';\n \t}\n })); \n }",
"function explodeUri($segment = true)\n{\n $uri = explode('/', uri());\n $uri = array_filter($uri); // Filter Empty Array\n $uri = array_values($uri); // Reorder Array Index\n\n // return only URI segment if defined\n if ($segment !== true) return $uri[$segment] ?? false;\n\n return $uri;\n}",
"function urlsegment($seg){\n\n $url_comp = explode('/', request_path());\n\n return $url_comp[$seg];\n}",
"function get_url_segment($s = 0)\n{\n global $request_uri;\n\n $here = explode('/', $request_uri);\n\n if (isset($here[$s]))\n return $here[$s];\n\n return '';\n}",
"protected function segment_uri($uri)\n\t{\n\t\t$result = array();\n\n\t\tforeach (explode(\"/\", preg_replace(\"|/*(.+?)/*$|\", \"\\\\1\", $uri)) as $segment)\n\t\t{\n\t\t\t$segment = trim($segment);\n\t\t\tif ($segment != '')\n\t\t\t\t$result[] = $segment;\n\t\t}\n\n\t\treturn $result;\n\t}",
"protected function getRequestURI() {\n $request_params = explode(\"/\", $_SERVER['REQUEST_URI']);\n $params = array();\n foreach ($request_params AS $rp) {\n if (preg_match(\"/^([a-zA-Z0-9-_]+)$/\", $rp)) {\n array_push($params, $rp);\n }\n }\n return $params;\n }",
"function build_segments(){\n\t$url = isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI']: '';\n\t$url = explode(\"/\",$url);\n\n\tforeach($url as $k => $v){\n\t\tif(empty($v)){\n\t\t\tunset($url[$k]);\n\t\t}\n\t}\n\n\treturn array_values($url);\n}",
"private function getParametersInUri()\n {\n $url = $this->request->getUri();\n\n $parts = array_map(function ($part) { return ':' . $part; }, explode(\"/:\", $url));\n\n unset($parts[0]); //remove the base uri\n\n return array_map(function ($part) { return $this->stripTrailingPart($part); }, $parts);\n }",
"public static function getRouteParts() {\n return $routeParts = explode('/', Yii::app()->controller->getRoute());\n }",
"function _core_ParseActionURL() {\n\t// If PATH_INFO is set, then Apache figured out our parts for us //\n\tif ( isset($_SERVER['PATH_INFO']) ) {\n\t\t$ret = ltrim(rtrim(filter_var($_SERVER['PATH_INFO'],FILTER_SANITIZE_URL),'/'),'/');\n\t\tif ( empty($ret) )\n\t\t\treturn [];\n\t\telse\n\t\t\treturn array_values(array_filter(explode('/',$ret),function ($val) {\n\t\t\t\treturn !(empty($val) || ($val[0] === '.'));\n\t\t\t}));\n\t}\n\n\t// If not, we have to extract them from the REQUEST_URI //\n\t// Logic borrowed from here: https://coderwall.com/p/gdam2w/get-request-path-in-php-for-routing\n\t$request_uri = explode('/', trim(filter_var($_SERVER['REQUEST_URI'],FILTER_SANITIZE_URL), '/'));\n $script_name = explode('/', trim(filter_var($_SERVER['SCRIPT_NAME'],FILTER_SANITIZE_URL), '/'));\n $parts = array_diff_assoc($request_uri, $script_name);\n if (empty($parts)) {\n return [];\n }\n\t$path = implode('/', $parts);\n\tif (($position = strpos($path, '?')) !== FALSE) {\n\t $path = substr($path, 0, $position);\n\t}\n\t$ret = ltrim(rtrim($path,'/'),'/');\n\tif ( empty($ret) ) {\n\t\treturn [];\n\t}\n\telse {\n\t\treturn array_values(array_filter(explode('/',$ret),function ($val) {\n\t\t\treturn !(empty($val) || ($val[0] === '.'));\n\t\t}));\n\t}\n}",
"function GETSEGMENT($segment){\n\t\treturn \\Request::segment($segment);\n\t}",
"public static function parseUri() {\n $args = explode(\"/\", trim($_SERVER['REQUEST_URI'], \"/\"));\n\n //Is there index.php in uri?\n $key = array_search(\"index.php\", $args);\n //If there is, dont parse that and preceding uri to get\n //Could happen is mod_rewrite is disabled\n if($key !== false)\n $args = array_slice($args, $key+1);\n\n //Parse it\n array_walk($args, function($v, $k) {\n $_GET[$k] = $v;\n });\n }",
"public static function uriComponents() {\n $uri = trim(parse_url($_SERVER[\"REQUEST_URI\"], PHP_URL_PATH), \"/\");\n \n if (!$res = explode('/', $uri, 3)) {\n $res = [];\n }\n return $res;\n }",
"private function getUri(){\n $uri = $this->request->getUri();\n \n //Separar uri do prefixo\n $xUri = strlen($this->prefix) ? explode($this->prefix,$uri) : [$uri];\n \n return end($xUri);\n }",
"public function get_request_uri_array() {\n\t\t$base_url = $this->get_request_uri();\n\t\t$request_uri_array = array();\n\t\t$array = explode('/', $base_url);\n\t\tforeach( $array as $route ) {\n\t\t\tif(trim($route) != '')\n\t\t\t\tarray_push($request_uri_array, $route);\n\t\t}\n\t\treturn $request_uri_array;\n\t}",
"protected function get_request_uri_array() {\n\t\t$base_url = $this->get_request_uri();\n\t\t$request_uri_array = array();\n\t\t$array = explode('/', $base_url);\n\t\tforeach( $array as $route ) {\n\t\t\tif(trim($route) != '')\n\t\t\t\tarray_push($request_uri_array, $route);\n\t\t}\n\t\treturn $request_uri_array;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets an array of Tbaluno objects which contain a foreign key that references this object. If this collection has already been initialized with an identical Criteria, it returns the collection. Otherwise if this Tbcursoversao has previously been saved, it will retrieve related Tbalunos from storage. If this Tbcursoversao is new, it will return an empty collection or the current collection, the criteria is ignored on a new object. | public function getTbalunos($criteria = null, PropelPDO $con = null)
{
if ($criteria === null) {
$criteria = new Criteria(TbcursoversaoPeer::DATABASE_NAME);
}
elseif ($criteria instanceof Criteria)
{
$criteria = clone $criteria;
}
if ($this->collTbalunos === null) {
if ($this->isNew()) {
$this->collTbalunos = array();
} else {
$criteria->add(TbalunoPeer::ID_VERSAO_CURSO, $this->id_versao_curso);
TbalunoPeer::addSelectColumns($criteria);
$this->collTbalunos = TbalunoPeer::doSelect($criteria, $con);
}
} else {
// criteria has no effect for a new object
if (!$this->isNew()) {
// the following code is to determine if a new query is
// called for. If the criteria is the same as the last
// one, just return the collection.
$criteria->add(TbalunoPeer::ID_VERSAO_CURSO, $this->id_versao_curso);
TbalunoPeer::addSelectColumns($criteria);
if (!isset($this->lastTbalunoCriteria) || !$this->lastTbalunoCriteria->equals($criteria)) {
$this->collTbalunos = TbalunoPeer::doSelect($criteria, $con);
}
}
}
$this->lastTbalunoCriteria = $criteria;
return $this->collTbalunos;
} | [
"public function getTbvagass($criteria = null, PropelPDO $con = null)\n\t{\n\t\tif ($criteria === null) {\n\t\t\t$criteria = new Criteria(TbcursoversaoPeer::DATABASE_NAME);\n\t\t}\n\t\telseif ($criteria instanceof Criteria)\n\t\t{\n\t\t\t$criteria = clone $criteria;\n\t\t}\n\n\t\tif ($this->collTbvagass === null) {\n\t\t\tif ($this->isNew()) {\n\t\t\t $this->collTbvagass = array();\n\t\t\t} else {\n\n\t\t\t\t$criteria->add(TbvagasPeer::ID_VERSAO_CURSO, $this->id_versao_curso);\n\n\t\t\t\tTbvagasPeer::addSelectColumns($criteria);\n\t\t\t\t$this->collTbvagass = TbvagasPeer::doSelect($criteria, $con);\n\t\t\t}\n\t\t} else {\n\t\t\t// criteria has no effect for a new object\n\t\t\tif (!$this->isNew()) {\n\t\t\t\t// the following code is to determine if a new query is\n\t\t\t\t// called for. If the criteria is the same as the last\n\t\t\t\t// one, just return the collection.\n\n\n\t\t\t\t$criteria->add(TbvagasPeer::ID_VERSAO_CURSO, $this->id_versao_curso);\n\n\t\t\t\tTbvagasPeer::addSelectColumns($criteria);\n\t\t\t\tif (!isset($this->lastTbvagasCriteria) || !$this->lastTbvagasCriteria->equals($criteria)) {\n\t\t\t\t\t$this->collTbvagass = TbvagasPeer::doSelect($criteria, $con);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$this->lastTbvagasCriteria = $criteria;\n\t\treturn $this->collTbvagass;\n\t}",
"public function getBoletos($criteria = null, PropelPDO $con = null)\n\t{\n\t\tif ($criteria === null) {\n\t\t\t$criteria = new Criteria(UsuarioPeer::DATABASE_NAME);\n\t\t}\n\t\telseif ($criteria instanceof Criteria)\n\t\t{\n\t\t\t$criteria = clone $criteria;\n\t\t}\n\n\t\tif ($this->collBoletos === null) {\n\t\t\tif ($this->isNew()) {\n\t\t\t $this->collBoletos = array();\n\t\t\t} else {\n\n\t\t\t\t$criteria->add(BoletoPeer::USUARIO_ID, $this->id);\n\n\t\t\t\tBoletoPeer::addSelectColumns($criteria);\n\t\t\t\t$this->collBoletos = BoletoPeer::doSelect($criteria, $con);\n\t\t\t}\n\t\t} else {\n\t\t\t// criteria has no effect for a new object\n\t\t\tif (!$this->isNew()) {\n\t\t\t\t// the following code is to determine if a new query is\n\t\t\t\t// called for. If the criteria is the same as the last\n\t\t\t\t// one, just return the collection.\n\n\n\t\t\t\t$criteria->add(BoletoPeer::USUARIO_ID, $this->id);\n\n\t\t\t\tBoletoPeer::addSelectColumns($criteria);\n\t\t\t\tif (!isset($this->lastBoletoCriteria) || !$this->lastBoletoCriteria->equals($criteria)) {\n\t\t\t\t\t$this->collBoletos = BoletoPeer::doSelect($criteria, $con);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$this->lastBoletoCriteria = $criteria;\n\t\treturn $this->collBoletos;\n\t}",
"public function getContasRecebers($criteria = null, PropelPDO $con = null)\n\t{\n\t\tif ($criteria === null) {\n\t\t\t$criteria = new Criteria(PedidoPeer::DATABASE_NAME);\n\t\t}\n\t\telseif ($criteria instanceof Criteria)\n\t\t{\n\t\t\t$criteria = clone $criteria;\n\t\t}\n\n\t\tif ($this->collContasRecebers === null) {\n\t\t\tif ($this->isNew()) {\n\t\t\t $this->collContasRecebers = array();\n\t\t\t} else {\n\n\t\t\t\t$criteria->add(ContasReceberPeer::PEDIDO_ID, $this->id);\n\n\t\t\t\tContasReceberPeer::addSelectColumns($criteria);\n\t\t\t\t$this->collContasRecebers = ContasReceberPeer::doSelect($criteria, $con);\n\t\t\t}\n\t\t} else {\n\t\t\t// criteria has no effect for a new object\n\t\t\tif (!$this->isNew()) {\n\t\t\t\t// the following code is to determine if a new query is\n\t\t\t\t// called for. If the criteria is the same as the last\n\t\t\t\t// one, just return the collection.\n\n\n\t\t\t\t$criteria->add(ContasReceberPeer::PEDIDO_ID, $this->id);\n\n\t\t\t\tContasReceberPeer::addSelectColumns($criteria);\n\t\t\t\tif (!isset($this->lastContasReceberCriteria) || !$this->lastContasReceberCriteria->equals($criteria)) {\n\t\t\t\t\t$this->collContasRecebers = ContasReceberPeer::doSelect($criteria, $con);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$this->lastContasReceberCriteria = $criteria;\n\t\treturn $this->collContasRecebers;\n\t}",
"public function getHbfSesionessRelatedByIdAsociado(Criteria $criteria = null, ConnectionInterface $con = null)\n {\n $partial = $this->collHbfSesionessRelatedByIdAsociadoPartial && !$this->isNew();\n if (null === $this->collHbfSesionessRelatedByIdAsociado || null !== $criteria || $partial) {\n if ($this->isNew() && null === $this->collHbfSesionessRelatedByIdAsociado) {\n // return empty collection\n $this->initHbfSesionessRelatedByIdAsociado();\n } else {\n $collHbfSesionessRelatedByIdAsociado = ChildHbfSesionesQuery::create(null, $criteria)\n ->filterByCiUsuariosRelatedByIdAsociado($this)\n ->find($con);\n\n if (null !== $criteria) {\n if (false !== $this->collHbfSesionessRelatedByIdAsociadoPartial && count($collHbfSesionessRelatedByIdAsociado)) {\n $this->initHbfSesionessRelatedByIdAsociado(false);\n\n foreach ($collHbfSesionessRelatedByIdAsociado as $obj) {\n if (false == $this->collHbfSesionessRelatedByIdAsociado->contains($obj)) {\n $this->collHbfSesionessRelatedByIdAsociado->append($obj);\n }\n }\n\n $this->collHbfSesionessRelatedByIdAsociadoPartial = true;\n }\n\n return $collHbfSesionessRelatedByIdAsociado;\n }\n\n if ($partial && $this->collHbfSesionessRelatedByIdAsociado) {\n foreach ($this->collHbfSesionessRelatedByIdAsociado as $obj) {\n if ($obj->isNew()) {\n $collHbfSesionessRelatedByIdAsociado[] = $obj;\n }\n }\n }\n\n $this->collHbfSesionessRelatedByIdAsociado = $collHbfSesionessRelatedByIdAsociado;\n $this->collHbfSesionessRelatedByIdAsociadoPartial = false;\n }\n }\n\n return $this->collHbfSesionessRelatedByIdAsociado;\n }",
"public function getTbalunosRelatedByIdTrabalho($criteria = null, PropelPDO $con = null)\n\t{\n\t\tif ($criteria === null) {\n\t\t\t$criteria = new Criteria(TbinstexternaPeer::DATABASE_NAME);\n\t\t}\n\t\telseif ($criteria instanceof Criteria)\n\t\t{\n\t\t\t$criteria = clone $criteria;\n\t\t}\n\n\t\tif ($this->collTbalunosRelatedByIdTrabalho === null) {\n\t\t\tif ($this->isNew()) {\n\t\t\t $this->collTbalunosRelatedByIdTrabalho = array();\n\t\t\t} else {\n\n\t\t\t\t$criteria->add(TbalunoPeer::ID_TRABALHO, $this->id_inst_externa);\n\n\t\t\t\tTbalunoPeer::addSelectColumns($criteria);\n\t\t\t\t$this->collTbalunosRelatedByIdTrabalho = TbalunoPeer::doSelect($criteria, $con);\n\t\t\t}\n\t\t} else {\n\t\t\t// criteria has no effect for a new object\n\t\t\tif (!$this->isNew()) {\n\t\t\t\t// the following code is to determine if a new query is\n\t\t\t\t// called for. If the criteria is the same as the last\n\t\t\t\t// one, just return the collection.\n\n\n\t\t\t\t$criteria->add(TbalunoPeer::ID_TRABALHO, $this->id_inst_externa);\n\n\t\t\t\tTbalunoPeer::addSelectColumns($criteria);\n\t\t\t\tif (!isset($this->lastTbalunoRelatedByIdTrabalhoCriteria) || !$this->lastTbalunoRelatedByIdTrabalhoCriteria->equals($criteria)) {\n\t\t\t\t\t$this->collTbalunosRelatedByIdTrabalho = TbalunoPeer::doSelect($criteria, $con);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$this->lastTbalunoRelatedByIdTrabalhoCriteria = $criteria;\n\t\treturn $this->collTbalunosRelatedByIdTrabalho;\n\t}",
"public function getCandidatos($criteria = null, PropelPDO $con = null)\n {\n $partial = $this->collCandidatosPartial && !$this->isNew();\n if (null === $this->collCandidatos || null !== $criteria || $partial) {\n if ($this->isNew() && null === $this->collCandidatos) {\n // return empty collection\n $this->initCandidatos();\n } else {\n $collCandidatos = CandidatoQuery::create(null, $criteria)\n ->filterByUsuario($this)\n ->find($con);\n if (null !== $criteria) {\n if (false !== $this->collCandidatosPartial && count($collCandidatos)) {\n $this->initCandidatos(false);\n\n foreach ($collCandidatos as $obj) {\n if (false == $this->collCandidatos->contains($obj)) {\n $this->collCandidatos->append($obj);\n }\n }\n\n $this->collCandidatosPartial = true;\n }\n\n $collCandidatos->getInternalIterator()->rewind();\n\n return $collCandidatos;\n }\n\n if ($partial && $this->collCandidatos) {\n foreach ($this->collCandidatos as $obj) {\n if ($obj->isNew()) {\n $collCandidatos[] = $obj;\n }\n }\n }\n\n $this->collCandidatos = $collCandidatos;\n $this->collCandidatosPartial = false;\n }\n }\n\n return $this->collCandidatos;\n }",
"public function getContratos($criteria = null, PropelPDO $con = null)\n\t{\n\t\tif(null === $this->collContratos || null !== $criteria) {\n\t\t\tif ($this->isNew() && null === $this->collContratos) {\n\t\t\t\t// return empty collection\n\t\t\t\t$this->initContratos();\n\t\t\t} else {\n\t\t\t\t$collContratos = ContratoQuery::create(null, $criteria)\n\t\t\t\t\t->filterByAdvogado($this)\n\t\t\t\t\t->find($con);\n\t\t\t\tif (null !== $criteria) {\n\t\t\t\t\treturn $collContratos;\n\t\t\t\t}\n\t\t\t\t$this->collContratos = $collContratos;\n\t\t\t}\n\t\t}\n\t\treturn $this->collContratos;\n\t}",
"public function getTbhistoricos($criteria = null, PropelPDO $con = null)\n\t{\n\t\tif ($criteria === null) {\n\t\t\t$criteria = new Criteria(TbperiodoPeer::DATABASE_NAME);\n\t\t}\n\t\telseif ($criteria instanceof Criteria)\n\t\t{\n\t\t\t$criteria = clone $criteria;\n\t\t}\n\n\t\tif ($this->collTbhistoricos === null) {\n\t\t\tif ($this->isNew()) {\n\t\t\t $this->collTbhistoricos = array();\n\t\t\t} else {\n\n\t\t\t\t$criteria->add(TbhistoricoPeer::ID_PERIODO, $this->id_periodo);\n\n\t\t\t\tTbhistoricoPeer::addSelectColumns($criteria);\n\t\t\t\t$this->collTbhistoricos = TbhistoricoPeer::doSelect($criteria, $con);\n\t\t\t}\n\t\t} else {\n\t\t\t// criteria has no effect for a new object\n\t\t\tif (!$this->isNew()) {\n\t\t\t\t// the following code is to determine if a new query is\n\t\t\t\t// called for. If the criteria is the same as the last\n\t\t\t\t// one, just return the collection.\n\n\n\t\t\t\t$criteria->add(TbhistoricoPeer::ID_PERIODO, $this->id_periodo);\n\n\t\t\t\tTbhistoricoPeer::addSelectColumns($criteria);\n\t\t\t\tif (!isset($this->lastTbhistoricoCriteria) || !$this->lastTbhistoricoCriteria->equals($criteria)) {\n\t\t\t\t\t$this->collTbhistoricos = TbhistoricoPeer::doSelect($criteria, $con);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$this->lastTbhistoricoCriteria = $criteria;\n\t\treturn $this->collTbhistoricos;\n\t}",
"public function getTbfilacalouross($criteria = null, PropelPDO $con = null)\n\t{\n\t\tif ($criteria === null) {\n\t\t\t$criteria = new Criteria(TbofertaPeer::DATABASE_NAME);\n\t\t}\n\t\telseif ($criteria instanceof Criteria)\n\t\t{\n\t\t\t$criteria = clone $criteria;\n\t\t}\n\n\t\tif ($this->collTbfilacalouross === null) {\n\t\t\tif ($this->isNew()) {\n\t\t\t $this->collTbfilacalouross = array();\n\t\t\t} else {\n\n\t\t\t\t$criteria->add(TbfilacalourosPeer::ID_OFERTA, $this->id_oferta);\n\n\t\t\t\tTbfilacalourosPeer::addSelectColumns($criteria);\n\t\t\t\t$this->collTbfilacalouross = TbfilacalourosPeer::doSelect($criteria, $con);\n\t\t\t}\n\t\t} else {\n\t\t\t// criteria has no effect for a new object\n\t\t\tif (!$this->isNew()) {\n\t\t\t\t// the following code is to determine if a new query is\n\t\t\t\t// called for. If the criteria is the same as the last\n\t\t\t\t// one, just return the collection.\n\n\n\t\t\t\t$criteria->add(TbfilacalourosPeer::ID_OFERTA, $this->id_oferta);\n\n\t\t\t\tTbfilacalourosPeer::addSelectColumns($criteria);\n\t\t\t\tif (!isset($this->lastTbfilacalourosCriteria) || !$this->lastTbfilacalourosCriteria->equals($criteria)) {\n\t\t\t\t\t$this->collTbfilacalouross = TbfilacalourosPeer::doSelect($criteria, $con);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$this->lastTbfilacalourosCriteria = $criteria;\n\t\treturn $this->collTbfilacalouross;\n\t}",
"public function getContadorDetalhars($criteria = null, PropelPDO $con = null)\n\t{\n\t\tif ($criteria === null) {\n\t\t\t$criteria = new Criteria(UsuarioPeer::DATABASE_NAME);\n\t\t}\n\t\telseif ($criteria instanceof Criteria)\n\t\t{\n\t\t\t$criteria = clone $criteria;\n\t\t}\n\n\t\tif ($this->collContadorDetalhars === null) {\n\t\t\tif ($this->isNew()) {\n\t\t\t $this->collContadorDetalhars = array();\n\t\t\t} else {\n\n\t\t\t\t$criteria->add(ContadorDetalharPeer::USUARIO_ID, $this->id);\n\n\t\t\t\tContadorDetalharPeer::addSelectColumns($criteria);\n\t\t\t\t$this->collContadorDetalhars = ContadorDetalharPeer::doSelect($criteria, $con);\n\t\t\t}\n\t\t} else {\n\t\t\t// criteria has no effect for a new object\n\t\t\tif (!$this->isNew()) {\n\t\t\t\t// the following code is to determine if a new query is\n\t\t\t\t// called for. If the criteria is the same as the last\n\t\t\t\t// one, just return the collection.\n\n\n\t\t\t\t$criteria->add(ContadorDetalharPeer::USUARIO_ID, $this->id);\n\n\t\t\t\tContadorDetalharPeer::addSelectColumns($criteria);\n\t\t\t\tif (!isset($this->lastContadorDetalharCriteria) || !$this->lastContadorDetalharCriteria->equals($criteria)) {\n\t\t\t\t\t$this->collContadorDetalhars = ContadorDetalharPeer::doSelect($criteria, $con);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$this->lastContadorDetalharCriteria = $criteria;\n\t\treturn $this->collContadorDetalhars;\n\t}",
"public function getFkComprasObjeto()\n {\n return $this->fkComprasObjeto;\n }",
"public function getHbfVentassRelatedByIdCliente(Criteria $criteria = null, ConnectionInterface $con = null)\n {\n $partial = $this->collHbfVentassRelatedByIdClientePartial && !$this->isNew();\n if (null === $this->collHbfVentassRelatedByIdCliente || null !== $criteria || $partial) {\n if ($this->isNew() && null === $this->collHbfVentassRelatedByIdCliente) {\n // return empty collection\n $this->initHbfVentassRelatedByIdCliente();\n } else {\n $collHbfVentassRelatedByIdCliente = ChildHbfVentasQuery::create(null, $criteria)\n ->filterByCiUsuariosRelatedByIdCliente($this)\n ->find($con);\n\n if (null !== $criteria) {\n if (false !== $this->collHbfVentassRelatedByIdClientePartial && count($collHbfVentassRelatedByIdCliente)) {\n $this->initHbfVentassRelatedByIdCliente(false);\n\n foreach ($collHbfVentassRelatedByIdCliente as $obj) {\n if (false == $this->collHbfVentassRelatedByIdCliente->contains($obj)) {\n $this->collHbfVentassRelatedByIdCliente->append($obj);\n }\n }\n\n $this->collHbfVentassRelatedByIdClientePartial = true;\n }\n\n return $collHbfVentassRelatedByIdCliente;\n }\n\n if ($partial && $this->collHbfVentassRelatedByIdCliente) {\n foreach ($this->collHbfVentassRelatedByIdCliente as $obj) {\n if ($obj->isNew()) {\n $collHbfVentassRelatedByIdCliente[] = $obj;\n }\n }\n }\n\n $this->collHbfVentassRelatedByIdCliente = $collHbfVentassRelatedByIdCliente;\n $this->collHbfVentassRelatedByIdClientePartial = false;\n }\n }\n\n return $this->collHbfVentassRelatedByIdCliente;\n }",
"public function getTbcoordenadorcursos($criteria = null, PropelPDO $con = null)\n\t{\n\t\tif ($criteria === null) {\n\t\t\t$criteria = new Criteria(TbcursoversaoPeer::DATABASE_NAME);\n\t\t}\n\t\telseif ($criteria instanceof Criteria)\n\t\t{\n\t\t\t$criteria = clone $criteria;\n\t\t}\n\n\t\tif ($this->collTbcoordenadorcursos === null) {\n\t\t\tif ($this->isNew()) {\n\t\t\t $this->collTbcoordenadorcursos = array();\n\t\t\t} else {\n\n\t\t\t\t$criteria->add(TbcoordenadorcursoPeer::ID_VERSAO_CURSO, $this->id_versao_curso);\n\n\t\t\t\tTbcoordenadorcursoPeer::addSelectColumns($criteria);\n\t\t\t\t$this->collTbcoordenadorcursos = TbcoordenadorcursoPeer::doSelect($criteria, $con);\n\t\t\t}\n\t\t} else {\n\t\t\t// criteria has no effect for a new object\n\t\t\tif (!$this->isNew()) {\n\t\t\t\t// the following code is to determine if a new query is\n\t\t\t\t// called for. If the criteria is the same as the last\n\t\t\t\t// one, just return the collection.\n\n\n\t\t\t\t$criteria->add(TbcoordenadorcursoPeer::ID_VERSAO_CURSO, $this->id_versao_curso);\n\n\t\t\t\tTbcoordenadorcursoPeer::addSelectColumns($criteria);\n\t\t\t\tif (!isset($this->lastTbcoordenadorcursoCriteria) || !$this->lastTbcoordenadorcursoCriteria->equals($criteria)) {\n\t\t\t\t\t$this->collTbcoordenadorcursos = TbcoordenadorcursoPeer::doSelect($criteria, $con);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$this->lastTbcoordenadorcursoCriteria = $criteria;\n\t\treturn $this->collTbcoordenadorcursos;\n\t}",
"public function getContadorDetalhars($criteria = null, PropelPDO $con = null)\n\t{\n\t\tif ($criteria === null) {\n\t\t\t$criteria = new Criteria(ContadorPeer::DATABASE_NAME);\n\t\t}\n\t\telseif ($criteria instanceof Criteria)\n\t\t{\n\t\t\t$criteria = clone $criteria;\n\t\t}\n\n\t\tif ($this->collContadorDetalhars === null) {\n\t\t\tif ($this->isNew()) {\n\t\t\t $this->collContadorDetalhars = array();\n\t\t\t} else {\n\n\t\t\t\t$criteria->add(ContadorDetalharPeer::CONTADOR_ID, $this->id);\n\n\t\t\t\tContadorDetalharPeer::addSelectColumns($criteria);\n\t\t\t\t$this->collContadorDetalhars = ContadorDetalharPeer::doSelect($criteria, $con);\n\t\t\t}\n\t\t} else {\n\t\t\t// criteria has no effect for a new object\n\t\t\tif (!$this->isNew()) {\n\t\t\t\t// the following code is to determine if a new query is\n\t\t\t\t// called for. If the criteria is the same as the last\n\t\t\t\t// one, just return the collection.\n\n\n\t\t\t\t$criteria->add(ContadorDetalharPeer::CONTADOR_ID, $this->id);\n\n\t\t\t\tContadorDetalharPeer::addSelectColumns($criteria);\n\t\t\t\tif (!isset($this->lastContadorDetalharCriteria) || !$this->lastContadorDetalharCriteria->equals($criteria)) {\n\t\t\t\t\t$this->collContadorDetalhars = ContadorDetalharPeer::doSelect($criteria, $con);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$this->lastContadorDetalharCriteria = $criteria;\n\t\treturn $this->collContadorDetalhars;\n\t}",
"public function getTransferenciasRelatedByIdempleadocreador($criteria = null, PropelPDO $con = null)\n {\n $partial = $this->collTransferenciasRelatedByIdempleadocreadorPartial && !$this->isNew();\n if (null === $this->collTransferenciasRelatedByIdempleadocreador || null !== $criteria || $partial) {\n if ($this->isNew() && null === $this->collTransferenciasRelatedByIdempleadocreador) {\n // return empty collection\n $this->initTransferenciasRelatedByIdempleadocreador();\n } else {\n $collTransferenciasRelatedByIdempleadocreador = TransferenciaQuery::create(null, $criteria)\n ->filterByEmpleadoRelatedByIdempleadocreador($this)\n ->find($con);\n if (null !== $criteria) {\n if (false !== $this->collTransferenciasRelatedByIdempleadocreadorPartial && count($collTransferenciasRelatedByIdempleadocreador)) {\n $this->initTransferenciasRelatedByIdempleadocreador(false);\n\n foreach ($collTransferenciasRelatedByIdempleadocreador as $obj) {\n if (false == $this->collTransferenciasRelatedByIdempleadocreador->contains($obj)) {\n $this->collTransferenciasRelatedByIdempleadocreador->append($obj);\n }\n }\n\n $this->collTransferenciasRelatedByIdempleadocreadorPartial = true;\n }\n\n $collTransferenciasRelatedByIdempleadocreador->getInternalIterator()->rewind();\n\n return $collTransferenciasRelatedByIdempleadocreador;\n }\n\n if ($partial && $this->collTransferenciasRelatedByIdempleadocreador) {\n foreach ($this->collTransferenciasRelatedByIdempleadocreador as $obj) {\n if ($obj->isNew()) {\n $collTransferenciasRelatedByIdempleadocreador[] = $obj;\n }\n }\n }\n\n $this->collTransferenciasRelatedByIdempleadocreador = $collTransferenciasRelatedByIdempleadocreador;\n $this->collTransferenciasRelatedByIdempleadocreadorPartial = false;\n }\n }\n\n return $this->collTransferenciasRelatedByIdempleadocreador;\n }",
"public function getFkPessoalCboCargos()\n {\n return $this->fkPessoalCboCargos;\n }",
"public function getTransferenciadetalles($criteria = null, PropelPDO $con = null)\n {\n $partial = $this->collTransferenciadetallesPartial && !$this->isNew();\n if (null === $this->collTransferenciadetalles || null !== $criteria || $partial) {\n if ($this->isNew() && null === $this->collTransferenciadetalles) {\n // return empty collection\n $this->initTransferenciadetalles();\n } else {\n $collTransferenciadetalles = TransferenciadetalleQuery::create(null, $criteria)\n ->filterByProductovariante($this)\n ->find($con);\n if (null !== $criteria) {\n if (false !== $this->collTransferenciadetallesPartial && count($collTransferenciadetalles)) {\n $this->initTransferenciadetalles(false);\n\n foreach ($collTransferenciadetalles as $obj) {\n if (false == $this->collTransferenciadetalles->contains($obj)) {\n $this->collTransferenciadetalles->append($obj);\n }\n }\n\n $this->collTransferenciadetallesPartial = true;\n }\n\n $collTransferenciadetalles->getInternalIterator()->rewind();\n\n return $collTransferenciadetalles;\n }\n\n if ($partial && $this->collTransferenciadetalles) {\n foreach ($this->collTransferenciadetalles as $obj) {\n if ($obj->isNew()) {\n $collTransferenciadetalles[] = $obj;\n }\n }\n }\n\n $this->collTransferenciadetalles = $collTransferenciadetalles;\n $this->collTransferenciadetallesPartial = false;\n }\n }\n\n return $this->collTransferenciadetalles;\n }",
"public function getVentas($criteria = null, PropelPDO $con = null)\n {\n $partial = $this->collVentasPartial && !$this->isNew();\n if (null === $this->collVentas || null !== $criteria || $partial) {\n if ($this->isNew() && null === $this->collVentas) {\n // return empty collection\n $this->initVentas();\n } else {\n $collVentas = VentaQuery::create(null, $criteria)\n ->filterBySucursal($this)\n ->find($con);\n if (null !== $criteria) {\n if (false !== $this->collVentasPartial && count($collVentas)) {\n $this->initVentas(false);\n\n foreach ($collVentas as $obj) {\n if (false == $this->collVentas->contains($obj)) {\n $this->collVentas->append($obj);\n }\n }\n\n $this->collVentasPartial = true;\n }\n\n $collVentas->getInternalIterator()->rewind();\n\n return $collVentas;\n }\n\n if ($partial && $this->collVentas) {\n foreach ($this->collVentas as $obj) {\n if ($obj->isNew()) {\n $collVentas[] = $obj;\n }\n }\n }\n\n $this->collVentas = $collVentas;\n $this->collVentasPartial = false;\n }\n }\n\n return $this->collVentas;\n }",
"public function getHbfTurnossRelatedByIdAsociado(Criteria $criteria = null, ConnectionInterface $con = null)\n {\n $partial = $this->collHbfTurnossRelatedByIdAsociadoPartial && !$this->isNew();\n if (null === $this->collHbfTurnossRelatedByIdAsociado || null !== $criteria || $partial) {\n if ($this->isNew() && null === $this->collHbfTurnossRelatedByIdAsociado) {\n // return empty collection\n $this->initHbfTurnossRelatedByIdAsociado();\n } else {\n $collHbfTurnossRelatedByIdAsociado = ChildHbfTurnosQuery::create(null, $criteria)\n ->filterByCiUsuariosRelatedByIdAsociado($this)\n ->find($con);\n\n if (null !== $criteria) {\n if (false !== $this->collHbfTurnossRelatedByIdAsociadoPartial && count($collHbfTurnossRelatedByIdAsociado)) {\n $this->initHbfTurnossRelatedByIdAsociado(false);\n\n foreach ($collHbfTurnossRelatedByIdAsociado as $obj) {\n if (false == $this->collHbfTurnossRelatedByIdAsociado->contains($obj)) {\n $this->collHbfTurnossRelatedByIdAsociado->append($obj);\n }\n }\n\n $this->collHbfTurnossRelatedByIdAsociadoPartial = true;\n }\n\n return $collHbfTurnossRelatedByIdAsociado;\n }\n\n if ($partial && $this->collHbfTurnossRelatedByIdAsociado) {\n foreach ($this->collHbfTurnossRelatedByIdAsociado as $obj) {\n if ($obj->isNew()) {\n $collHbfTurnossRelatedByIdAsociado[] = $obj;\n }\n }\n }\n\n $this->collHbfTurnossRelatedByIdAsociado = $collHbfTurnossRelatedByIdAsociado;\n $this->collHbfTurnossRelatedByIdAsociadoPartial = false;\n }\n }\n\n return $this->collHbfTurnossRelatedByIdAsociado;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Updates row cell in worksheet table and handles errors | public static function update_row_cell() {
$cell = request::postArray();
$validation_result = self::validate_cell_data($cell);
if ($validation_result) {
return 'error : validation';
} else {
$cell_data = [];
$keys = array_keys($cell);
$key = $keys[1];
$cell_data['cell_id'] = intval($cell['work_id']);
$cell_data['cell_name'] = $key;
$cell_data['cell_value'] = $cell[$key];
return self::update_cell($cell_data) ? 'success' : 'error : update';
}
} | [
"public function updateRow($row);",
"abstract protected function _validateRowForUpdate(array $rowData, $rowNumber);",
"function updateWorksheetRow($id, $row, $service, $config)\n{\n\t// set target spreadsheet and worksheet\n\t$ssKey = $config['ssid'];\n\t$wsKey = $config['wsid'];\n\n\ttry {\n\t\t// get the row matching query\n\t\t$query = new Zend_Gdata_Spreadsheets_ListQuery();\n\t\t$query->setSpreadsheetKey($ssKey);\n\t\t$query->setWorksheetId($wsKey);\n\t\t$listFeed = $service->getListFeed($query);\n\n\t\t$listEntry = $listFeed->offsetGet($id);\n\t\t$service->updateRow($listEntry, $row);\n\t}\n\tcatch (Exception $e) {\n\t\tdie('ERROR: ' . $e->getMessage());\n\t}\n}",
"public function testPostUpdateWorksheetRow()\n {\n $remoteFolder = \"TestData/In\";\n\n $localName = \"Book1.xlsx\";\n $remoteName = \"Book1.xlsx\";\n\n CellsApiTestBase::ready( $this->instance,$localName ,$remoteFolder . \"/\" . $remoteName , \"\");\n \n $request = new PostUpdateWorksheetRowRequest();\n $request->setName( $remoteName);\n $request->setSheetName( \"Sheet1\");\n $request->setRowIndex( 0);\n $request->setHeight( 10.8);\n $request->setCount( 9);\n $request->setFolder( $remoteFolder);\n $request->setStorageName( \"\");\n $this->instance->postUpdateWorksheetRow($request);\n }",
"public function updated(Row $row)\n {\n //\n }",
"public abstract function putRow( $row );",
"function update() {\n try {\n self::connectSpreadsheet();\n\n if (!$this->spreadsheet_entry) {\n $this->load($this->email);\n }\n\n // Create the row content.\n $row = array(\n 'email' => (string) $this->email,\n 'firstname' => (string) $this->firstname,\n 'lastname' => (string) $this->lastname,\n 'coming' => (string) $this->coming,\n 'friend' => (string) $this->friend,\n 'message' => (string) $this->message,\n );\n\n $this->spreadsheet_entry->update($row);\n }\n catch (Exception $e) {\n error_log($this->errorMessage($e));\n return false;\n }\n }",
"function editRow($table_name, $key_column_name, $key_value, $row)\n {\n foreach($row as $column_name=>$column_value)\n {\n $this->editValue(\n $table_name,\n $key_column_name,\n $key_value,\n $column_name,\n $column_value);\n }\n }",
"public function testEditDocumentDocxUpdateTableCell()\n {\n }",
"public function addRow(Worksheet $worksheet, $row);",
"public function testUpdateInvoiceWorksheet()\n {\n }",
"public function writeRow(Worksheet $worksheet, ...$data): void {\n for ($i = 0; $i < count($data); $i++) {\n $worksheet->setCellValueByColumnAndRow(\n $i + 1, $this->worksheetRow[$worksheet->getTitle()], $data[$i]\n );\n }\n\n // Increase row number\n $this->worksheetRow[$worksheet->getTitle()]++;\n }",
"public function update($key, $row);",
"function SetRow($row){}",
"public function update(array $row);",
"public function changeRowData(&$row){}",
"public function addRow(Worksheet $worksheet, Row $row);",
"public function gridSheetHandleNewRow(array &$row) {\n $this->owner->update(\n $this->getUpdateColumns($this->owner->class, $row)\n );\n }",
"public function UpdateExcel(){\n\t\trequire_once(APPPATH.'third_party/PHPExcel_1.8.0_doc/Classes/PHPExcel.php');\n\n\t\t$objPHPExcel= PHPExcel_IOFactory::load('./database_excel/ListCarrefour.xls');\n\t\t$sheet=$objPHPExcel->getSheet(0);\n\t\t\n\t\t$selected_row=$_POST['edit-row'];\n\t\t$row=$selected_row+1;\n\t\t// INSERT NEW ROW\n\t\t$sheet->insertNewRowBefore($row+1, 1);\n\t\t\n\t\t// REMOVE separator FROM POST\n\t\t$newprice=$_POST['edit-newprice'];\n\t\t$newprice = str_replace('.','',$newprice);\n\n\t\t// ISI ROW\n\t\t$sheet->SetCellValue('B'.$row, $_POST['edit-barcode']);\n\t\t$sheet->SetCellValue('C'.$row, $_POST['edit-namabarang']);\n\t\t$sheet->SetCellValue('D'.$row, $_POST['edit-kodebarang']);\n\t\t$sheet->SetCellValue('E'.$row, $_POST['edit-namabarangdrp']);\n\t\t$sheet->SetCellValue('F'.$row, $newprice);\n\t\t//$sheet->SetCellValue('F'.$row, $_POST['edit-newprice']);\n\n\t\t// DELETE OLD ROW\n\t\t$sheet->removeRow($row+1);\n\t\t$objWriter = new PHPExcel_Writer_Excel5($objPHPExcel);\n\t\t$objWriter->save('./database_excel/ListCarrefour.xls');\n\t\t// LOAD ADMIN PAGE\n\t\techo (\"<SCRIPT LANGUAGE='JavaScript'>\n window.alert('Succesfully Updated')\n window.location.href='admin';\n </SCRIPT>\");\n\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set the value of setecperfilcodigo | public function setSetecperfilcodigo($setecperfilcodigo)
{
$this->setecperfilcodigo = $setecperfilcodigo;
return $this;
} | [
"public function setImgPerfil($valor){\n\t\t\t$this->imgPerfil = $valor;\n\t\t}",
"public function getSetecperfilnombre()\n {\n return $this->setecperfilnombre;\n }",
"public function setSetecperfilnombre($setecperfilnombre)\n {\n $this->setecperfilnombre = $setecperfilnombre;\n\n return $this;\n }",
"public function setSetecperfilfecha($setecperfilfecha)\n {\n $this->setecperfilfecha = $setecperfilfecha;\n\n return $this;\n }",
"function set_codOficina( $codOficina ) {\n // sets the value of codOficina\n $this->codOficina = $codOficina;\n }",
"public function setProyecto($proyecto){\n $this->proyecto = $proyecto;\n }",
"public function setcompartido($compartido) {\n\t\t$this->compartido = $compartido;\n\t}",
"public function getSetecperfilfecha()\n {\n return $this->setecperfilfecha;\n }",
"public function setCodi($codi){\n $this->codi = $codi;\n }",
"function setDataEncerramento( $dataEncerramento ) {\n $this->dataEncerramento = $dataEncerramento;\n }",
"function setCuerpoPerfil($titulo)\n\t{\t\n\t\t$this->cuerpo = new cuerpo;\n\t\t$this->cuerpo->setPerfil($titulo);\n\t}",
"function setSorpresa($_caja){\r\n $this->sorpresa=$_caja;\r\n }",
"public function setFecini($fecini){\n\t\t$this->fecini = $fecini;\n\t}",
"public function editPerfil(){\n\t\t$this->set('menuActivo', 'inicio');\n\t}",
"public function setSetecperfiluser($setecperfiluser)\n {\n $this->setecperfiluser = $setecperfiluser;\n\n return $this;\n }",
"public function setPosteo()\r\n {\r\n $query = \"SELECT USUARIO_ID, TITULO, CONTENIDO FROM POSTEOS WHERE POSTEO_ID = :posteo_id\";\r\n $stmt = DBConnection::getStatement($query);\r\n $stmt->execute(['posteo_id' => $this->posteo_id]);\r\n if ($datos = $stmt->fetch(\\PDO::FETCH_ASSOC)) {\r\n $this->usuario_id = $datos['USUARIO_ID'];\r\n $this->titulo = $datos['TITULO'];\r\n $this->contenido = $datos['CONTENIDO'];\r\n\r\n };\r\n }",
"function setAgregarUnPais(){\n\t\t$this->comienza_con++;\n\t}",
"function setSumarPais(){\n\t\t$this->cantidad_paises++;\n\t}",
"public function testSetCodeEtatContratPrud() {\n\n $obj = new EmpDadsuParam();\n\n $obj->setCodeEtatContratPrud(\"codeEtatContratPrud\");\n $this->assertEquals(\"codeEtatContratPrud\", $obj->getCodeEtatContratPrud());\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns Payments Methods. Since they are inside an array, we can use the standard arrayiterator. | public function getIterator()
{
return new \ArrayIterator($this->payment_methods);
} | [
"public static function getPaymentMethods(): array;",
"public function getPaymentMethods()\n {\n /** @var oxPayment $oxPayment */\n $oxPayment = oxNew('oxPayment');\n $sql = \"SELECT `OXID` FROM {$oxPayment->getViewName()} WHERE {$oxPayment->getSqlActiveSnippet()}\";\n $methods = marm_shopgate::dbGetAll($sql);\n\n $result = array();\n foreach ($methods as $oxidMethod) {\n $result[] = array(\n 'id' => $oxidMethod['OXID'],\n );\n }\n\n return $result;\n }",
"private function getPaymentMethods()\n\t{\n\t\t$db = JFactory::getDBO();\n\t\t$query = $db->getQuery(true)\n\t\t ->select('virtuemart_paymentmethod_id, payment_element, payment_params')\n\t\t ->from('#__virtuemart_paymentmethods')\n\t\t ->where('published = 1');\n\t\t$db->setQuery($query);\n\t\t$methods = $db->loadObjectList();\n\t\t\n\t\tif(empty($methods))\n\t\t{\n\t\t\t$methods = array();\n\t\t}\n\t\t\n\t\treturn $methods;\n\t}",
"abstract public function getPayments();",
"public function getPayMethods()\n\t\t{\n\t\t\t$result = (bool)$this->objFactory->getObjValidatorUser()\n\t\t\t\t->isValidUser();\n\n\t\t\t$nextPage = 'Echo';\n\n\t\t\tif(true === $result)\n\t\t\t{\n\t\t\t\t$nextPage = 'PayMethodList';\n\t\t\t}\n\n\t\t\t$this->objFactory->getObjDataContainer()->\n\t\t\t\tsetParams(['nextPage' => $nextPage, 'result' => $result]);\n\t\t}",
"public function grabPaymentMethods()\r\n {\r\n if( ! isset($this->_module['apitoken']) ) $this->_module['apitoken'] = '';\r\n if( ! isset($this->_module['service_id']) ) $this->_module['service_id'] = '';\r\n \r\n if(isset($apitoken)) $this->_module['apitoken'];\r\n \r\n \r\n $objServiceApi = new Pay_Api_Getservice();\r\n $objServiceApi->setApiToken( $this->_module['apitoken'] );\r\n $objServiceApi->setServiceId( $this->_module['service_id']);\r\n\r\n $arrServiceResult = $objServiceApi->doRequest();\r\n \r\n //cleanup result for export to smarty\r\n $strBasePath = $arrServiceResult['service']['basePath'];\r\n $arrPaymentOptions = array();\r\n foreach($arrServiceResult['paymentOptions'] as $paymentOption)\r\n {\r\n $tmpPaymentOption = array();\r\n $tmpPaymentOption['id'] = $paymentOption['id'];\r\n $tmpPaymentOption['name'] = $paymentOption['visibleName'];\r\n $tmpPaymentOption['image'] = $strBasePath . $paymentOption['path'] . $paymentOption['img'];\r\n\r\n if(isset($_POST['optionId']) && $paymentOption['id'] === $_POST['optionId'])\r\n {\r\n $tmpPaymentOption['checked'] = ' checked=\"checked\"';\r\n $GLOBALS['smarty']->assign('optionId', (int) $paymentOption['id']); \r\n }\r\n\r\n $arrPaymentOptions[$tmpPaymentOption['id']] = $tmpPaymentOption;\r\n }\r\n\r\n return Pay_Helper::sortPaymentOptions($arrPaymentOptions);\r\n }",
"public function getAvailablePaymentMethods() {\r\n\t\t\r\n\t//TODO - Insert your code here\r\n\t}",
"public function getAllPayements(): array\n {\n }",
"public function getPayments();",
"public static function getPaymentMethodList(){\n $droptions = PaymentMethod::find()->asArray()->all();\n return Arrayhelper::map($droptions, 'value', 'type');\n }",
"public function getPayMethod();",
"public function getAllPayments()\n {\n return $this->payment->getPaymentMethods();\n }",
"public function getPaymentMethods()\n {\n $paymentMethods = DB::select(\"\n SELECT *\n FROM auction_payment_methods\n RIGHT JOIN payment_methods\n ON auction_payment_methods.payment_id = payment_methods.id\n WHERE auction_payment_methods.auction_id = :id\",\n [\n \"id\" => $this->id\n ]);\n return $paymentMethods;\n }",
"public function getPaymentMethodsByName()\r\n {\r\n $methods = [];\r\n if ($this->_payment) {\r\n foreach ($this->_payment as $key => $method) {\r\n if (strpos($key, 'cmpayments') !== false && array_key_exists('cmname', $method)) {\r\n $method['config_path'] = 'payment/' . $key;\r\n $method['key'] = $key;\r\n $methods[$method['cmname']] = $method;\r\n }\r\n }\r\n }\r\n\r\n return $methods;\r\n }",
"public function readPaymentMethods()\n {\n return PaymentMethod::all(['id', 'name']);\n }",
"public function getPaymentMethods()\n {\n return $this->app['db.utils']->getSetValues(self::$table_name, 'payment_methods');\n }",
"public function methods()\n {\n $methods = TransactionMethod::all();\n return TransactionMethodResource::collection($methods);\n }",
"public function getVisiblePaymentMethods()\n {\n $result = array();\n\n foreach ($this->getActivePaymentTransactions() as $t) {\n if ($t->getPaymentMethod()) {\n $result[] = $t->getPaymentMethod();\n }\n }\n\n if (0 === count($result) && 0 < count($this->getPaymentTransactions())) {\n $method = $this->getPaymentTransactions()->last()->getPaymentMethod();\n if ($method) {\n $result[] = $method;\n }\n }\n\n return $result;\n }",
"public function getMethods()\n {\n switch ($this->id) {\n case 1:\n return [GatewayType::CREDIT_CARD => ['refund' => true, 'token_billing' => true]];//Authorize.net\n break;\n case 15:\n return [GatewayType::PAYPAL => ['refund' => true, 'token_billing' => false]]; //Paypal\n break;\n case 20:\n case 56:\n return [GatewayType::CREDIT_CARD => ['refund' => true, 'token_billing' => true],\n GatewayType::BANK_TRANSFER => ['refund' => true, 'token_billing' => true, 'webhooks' => ['source.chargeable']],\n GatewayType::ALIPAY => ['refund' => false, 'token_billing' => false],\n GatewayType::APPLE_PAY => ['refund' => false, 'token_billing' => false],\n GatewayType::SOFORT => ['refund' => true, 'token_billing' => true, 'webhooks' => ['source.chargeable']]]; //Stripe\n break;\n case 39:\n return [GatewayType::CREDIT_CARD => ['refund' => true, 'token_billing' => true]]; //Checkout\n break;\n case 50:\n return [\n GatewayType::CREDIT_CARD => ['refund' => true, 'token_billing' => true],\n GatewayType::PAYPAL => ['refund' => true, 'token_billing' => true]\n ];\n break;\n default:\n return [];\n break;\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Marks debugging forms as have been processed | private function _setHasProcessedDebuggingForms($hasProcessed)
{
$this->_hasProcessedDebuggingForms = $hasProcessed;
} | [
"protected function postProcessForm()\n\t{\n\t}",
"public function done(){\n\t\tif($_POST['formname'] == $this->formname){\n\t\t\t$this->handle_posting();\n\t\t}\n\t}",
"public function markAsProcessed() {\n\t\t$this->setData('processed', 1);\n\t\t$this->save();\n\t}",
"public function setProcessed()\r\n {\r\n $this->processed = true;\r\n }",
"abstract protected function processForm();",
"function hook_pmfe_edit_form() {\r\n\t\tif(is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF'][$this->extKey][$this->mode]['form'])) { // Adds hook for processing\r\n\t\t\tforeach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF'][$this->extKey][$this->mode]['form'] as $_classRef) {\r\n\t\t\t\t$_procObj = &t3lib_div::getUserObj($_classRef);\r\n\t\t\t\t$_procObj->pmfe_edit_form($this->conf, $this->piVars, $this); // Get new marker Array from other extensions\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"public static function maybe_process_form() {\r\n\t\tif ( isset( $_POST['gform_send_resume_link'] ) ) {\r\n\t\t\trequire_once( GFCommon::get_base_path() . '/form_display.php' );\r\n\t\t\tGFFormDisplay::process_send_resume_link();\r\n\t\t} elseif ( isset( $_POST['gform_submit'] ) ) {\r\n\t\t\trequire_once( GFCommon::get_base_path() . '/form_display.php' );\r\n\t\t\t$form_id = GFFormDisplay::is_submit_form_id_valid();\r\n\r\n\t\t\tif ( $form_id ) {\r\n\t\t\t\tGFFormDisplay::process_form( $form_id );\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"public static function setVisitorProcessed() {\n\t\t$_SESSION[_visitor_processed] = true;\n\t}",
"public static function flushMacros()\n {\n \\Collective\\Html\\FormBuilder::flushMacros();\n }",
"function processEvents(&$form) {\n\t\treturn false;\n\t}",
"abstract function process_form();",
"public function formShow()\n {\n $this->fieldFormCss = null;\n }",
"public function onSubmit()\n {\n /* Loop through all vars and check if there's anything to do on\n * submit. */\n $variables = $this->getVariables();\n foreach ($variables as $var) {\n $var->type->onSubmit($var, $this->_vars);\n /* If changes to var being tracked don't register the form as\n * submitted if old value and new value differ. */\n if ($var->getOption('trackchange')) {\n $varname = $var->getVarName();\n if (!is_null($this->_vars->get('formname')) &&\n $this->_vars->get($varname) != $this->_vars->get('__old_' . $varname)) {\n $this->_submitted = false;\n }\n }\n }\n }",
"public function onBeforePreprocessForm(FOFForm &$form, &$data)\n\t{\n\t}",
"function om_show_om_showreport_form_submit($form, &$form_state) {\n $form_state['rebuild'] = TRUE;\n}",
"private static function add_to_forms_loaded_vars() {\n\t\tglobal $frm_vars;\n\t\t$frm_vars['forms_loaded'][] = true;\n\t}",
"protected function skipForeignFormProcessing() {}",
"function flag_export_form_submit($form, &$form_state) {\n $form_state['rebuild'] = TRUE;\n}",
"public function postProcess()\n {\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Validate starting and ending position | private function validateStartEnd($start,$end)
{
$_startEnd = array();
if(preg_match('/[0-9]/', $start))
{
$_startEnd[0] = (int)$start;
}
elseif('#' === $start)
{
$_startEnd[0] = '#';
}
else
{
throw new InvalidMARCspecException(
InvalidMARCspecException::PR.
InvalidMARCspecException::PR7,
$start
);
}
if(preg_match('/[0-9#]/', $end))
{
if('#' === $end)
{
$_startEnd[1] = '#';
}
elseif(preg_match('/[0-9]/', $end))
{
$_startEnd[1] = (int)$end;
if($_startEnd[1] < $_startEnd[0])
{
throw new InvalidMARCspecException(
InvalidMARCspecException::PR.
InvalidMARCspecException::PR8,
$start.'-'.$end
);
}
}
else
{
throw new InvalidMARCspecException(
InvalidMARCspecException::PR.
InvalidMARCspecException::PR8,
$start.'-'.$end
);
}
}
else
{
$_startEnd[1] = null;
}
return $_startEnd;
} | [
"public function valid() : bool\n {\n return $this->position >= $this->start && $this->position <= $this->end;\n }",
"function isValidRange($begin, $end) {\n if ($end < $begin) {\n return FALSE;\n } else if ($end < 0 || $begin < 0) {\n return FALSE;\n } else {\n return TRUE;\n }\n}",
"public function check_valid(){ \n\t\tif(!empty($this->data['Event']['end'])){\n\t\t\t$start = explode(' ', $this->data['Event']['start']);\n\t\t\t$end = explode(' ', $this->data['Event']['end']);\n\t\t\t$from = strtotime($this->format_date_save($start[0]));\n\t\t\t$to = strtotime($this->format_date_save($end[0]));\t\n\t\t\tif($from > $to){\n\t\t\t\treturn false;\n\t\t\t}else{\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}else{\n\t\t\treturn true;\n\t\t}\n\t\t\n\t}",
"function inRange($position, $starting_point, $ending_point) {\n if ($position >= $starting_point && $position <= $ending_point) {\n return true;\n }\n return false;\n}",
"abstract protected function validSquares($start, $end);",
"function chkStartEndDiff($start, $end, $startName, $endName){\n\t\t$res = array(\n\t\t\t'valid' => FALSE,\n\t\t\t'data' => \"\"\n\t\t);\n\n\t\tif($start > $end){\n\t\t\t$diff = ($start - $end) + 1;\n\t\t} else {\n\t\t\t$diff = ($end - $start) + 1;\n\t\t}\n\n\t\tif(abs($diff) > MAX_DIFFERENCE){\n\t\t\t$res['valid'] = FALSE;\n\t\t\t$res['data'] = 'The table you are trying to create is too large! The range between ' . \n $startName . ' and ' . $endName . ' is ' . abs($diff) .\n ' The maximum difference is ' . MAX_DIFFERENCE;\n\t\t\treturn $res;\n\t\t} else {\n\t\t\t$res['valid'] = TRUE;\n\t\t\treturn $res;\n\t\t}\n\t}",
"private function validateRangeNumbers($initial, $final){\n\t\tif($initial >= $final)\n\t\t\tthrow new ValidateException('Número inicial debe ser menor al número final.',\n\t\t\t\t\t'initial_number');\n\t}",
"public function valid() {\n return $this->_position !== null && $this->_position >= 0 && $this->_position < $this->count();\n }",
"public function testFindAllBetweenReturnsIndexesInAscendingOrderIfStartIsLessThanEnd()\n {\n $analyzer = $this->create(array('1', '2', '3', '2', '1'));\n $tokens = $analyzer->findAllBetween('2', 0, 4);\n $this->assertInternalType('array', $tokens);\n $last = -1;\n foreach ($tokens as $index) {\n $this->assertGreaterThan($last, $index);\n $last = $index;\n }\n }",
"public function testIncorrectRanges()\n {\n $rangeService = new RangeService($this->pdo);\n\n $exceptionRaised = false;\n try {\n $rangeService->createRange(0, -100);\n } catch (Exception $exception) {\n $exceptionRaised = true;\n }\n $this->assertTrue($exceptionRaised, 'Created range with max_value more than min_value');\n }",
"public function is_null(){\n if (!$this -> is_valid()) return true;\n if ( $this -> start == $this -> end) return true;\n return false;\n }",
"public function testFindBetweenThrowsExceptionIfInvalidEndIndexIsProvided()\n {\n $this->setExpectedException('InvalidArgumentException');\n $analyzer = $this->create(array('1', '2', '3'));\n $analyzer->findBetween('5', 0, 42);\n }",
"function test_valid_date() {\n\n return (!empty($this->fields[\"begin\"])\n && !empty($this->fields[\"end\"])\n && (strtotime($this->fields[\"begin\"]) < strtotime($this->fields[\"end\"])));\n }",
"public function testFindAllBetweenThrowsExceptionIfInvalidEndIndexIsProvided()\n {\n $this->setExpectedException('InvalidArgumentException');\n $analyzer = $this->create(array('1', '2', '3', '4', '5'));\n $analyzer->findAllBetween('3', 0, 5);\n }",
"public abstract function is_valid_offset($offset);",
"public function validateTaskStartEnd()\n {\n /* check if Task End Date empty */\n if (empty($this->data[\"taskEnd\"])) {\n /* storing error message */\n $this->dataErrsMsg['taskEndErr'] = \"End Date is required.\";\n /* make allValidated attribute to false in order to stop further code process */\n $this->allValidated = false;\n }\n /* calling test_input in order to remove white spaces etc and saving data back to data attribute */\n $this->data['taskEnd'] = $this->test_input($this->data[\"taskEnd\"]);\n }",
"public function testInvalidRangeNonInclusive(): void\n {\n $leftResult = $this->createMock(ResultInterface::class);\n $leftResult\n ->expects($this->once())\n ->method('isValid')\n ->willReturn(true);\n\n $leftValidator = $this->createMock(ValidatorInterface::class);\n $leftValidator\n ->expects($this->once())\n ->method('validate')\n ->with(10)\n ->willReturn($leftResult);\n\n $rightResult = $this->createMock(ResultInterface::class);\n $rightResult\n ->expects($this->once())\n ->method('isValid')\n ->willReturn(true);\n\n $rightValidator = $this->createMock(ValidatorInterface::class);\n $rightValidator\n ->expects($this->once())\n ->method('validate')\n ->with(10)\n ->willReturn($rightResult);\n\n /**\n * @var ValidatorInterface $leftValidator\n * @var ValidatorInterface $rightValidator\n */\n $validator = new RangeValidator($leftValidator, $rightValidator, inclusive: false);\n\n $result = $validator->validate(\n (object)[\n 'left' => 10,\n 'right' => 10,\n ]\n );\n\n $this->assertFalse($result->isValid());\n }",
"function has_valid_position($value){\n if($value > 0 && $value < 100){\n return true;\n }\n }",
"public function validateEntries() \n {\n //verify if first entry is a START entry\n $this->firstItemIsStartEntry();\n\n //Detect the right order of entries\n $this->detectRightEntryOrder();\n\n //check if last entry is pause or end when the record is not current\n $this->obligePauseWhenNotCurrent();\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns a new ChildCustomerShiptoQuery object. | public static function create($modelAlias = null, Criteria $criteria = null)
{
if ($criteria instanceof ChildCustomerShiptoQuery) {
return $criteria;
}
$query = new ChildCustomerShiptoQuery();
if (null !== $modelAlias) {
$query->setModelAlias($modelAlias);
}
if ($criteria instanceof Criteria) {
$query->mergeWith($criteria);
}
return $query;
} | [
"public function all_child_customers()\n\t{\n\t\t$this->db->where('customer_status = 1 AND customer_parent != 0');\n\t\t$this->db->order_by('customer_name');\n\t\t$query = $this->db->get('customer');\n\t\t\n\t\treturn $query;\n\t}",
"public function buildCustomerEntity()\n {\n return new Customer(\n $this->id,\n $this->name,\n $this->buildAddressCollection()\n );\n }",
"public function filterByCustomerId($customerId)\n {\n $this->addFieldToFilter('customer_id', $customerId);\n return $this;\n }",
"public function getCustomers() {\r\n $sqlQuery = \"SELECT * FROM customer\";\r\n \r\n $statement = $this->connection->prepare($sqlQuery);\r\n $status = $statement->execute();\r\n \r\n if (!$status) {\r\n die(\"Could not retrieve customers\");\r\n }\r\n \r\n return $statement;\r\n }",
"public function sub_query() {\r\n\t\t\treturn new self;\r\n }",
"protected function _construct(){\n\t\t$this->setType('customer');\n\t\t$this->setConnection('customer_read', 'customer_write');\n\t\treturn parent::_construct();\n\t}",
"public function setCustomerShipto(ChildCustomerShipto $v = null)\n {\n if ($v === null) {\n $this->setArcucustid('');\n } else {\n $this->setArcucustid($v->getArcucustid());\n }\n\n if ($v === null) {\n $this->setArstshipid('');\n } else {\n $this->setArstshipid($v->getArstshipid());\n }\n\n $this->aCustomerShipto = $v;\n\n // Add binding for other direction of this n:n relationship.\n // If this object has already been added to the ChildCustomerShipto object, it will not be re-added.\n if ($v !== null) {\n $v->addInvTransferOrder($this);\n }\n\n\n return $this;\n }",
"public function add_customer(): object\n {\n $this->start_node( $this->get_prospect(), 'customer' );\n\n return $this;\n }",
"public static function create($modelAlias = null, Criteria $criteria = null)\n {\n if ($criteria instanceof ChildCustomerQuery) {\n return $criteria;\n }\n $query = new ChildCustomerQuery();\n if (null !== $modelAlias) {\n $query->setModelAlias($modelAlias);\n }\n if ($criteria instanceof Criteria) {\n $query->mergeWith($criteria);\n }\n\n return $query;\n }",
"public static function init(): self\n {\n return new self(new SearchOrdersCustomerFilter());\n }",
"public function setCustomerShipto(ChildCustomerShipto $v = null)\n {\n if ($v === null) {\n $this->setArcucustid(NULL);\n } else {\n $this->setArcucustid($v->getArcucustid());\n }\n\n if ($v === null) {\n $this->setArstshipid(NULL);\n } else {\n $this->setArstshipid($v->getArstshipid());\n }\n\n $this->aCustomerShipto = $v;\n\n // Add binding for other direction of this n:n relationship.\n // If this object has already been added to the ChildCustomerShipto object, it will not be re-added.\n if ($v !== null) {\n $v->addBooking($this);\n }\n\n\n return $this;\n }",
"public function newQuery()\n\t{\n\t\treturn new Sqloo_Query( $this );\n\t}",
"public function addCustomerIdFilter($customerId){\n $this->addFieldToFilter('customer_id', $customerId);\n\n return $this;\n }",
"public function filterCustomerHistory($custID) {\n\t\t$q = SalesHistoryQuery::create();\n\t\t$q->filterByCustid($custID);\n\t\t$q->select(SalesHistory::aliasproperty('ordernumber'));\n\t\t$ordn = $q->find()->toArray();\n\n\t\t$this->ordernumber($ordn);\n\t\t$this->query->sortBy('oedhyear', 'DESC');\n\t\treturn $this;\n\t}",
"public function getCustomerDetailQueryBuilder($customerId)\n {\n // Sub query to select the canceledOrderAmount. This can't be done with another join condition\n $subQueryBuilder = $this->getEntityManager()->createQueryBuilder();\n $subQueryBuilder->select('SUM(canceledOrders.invoiceAmount)')\n ->from(Customer::class, 'customer2')\n ->leftJoin('customer2.orders', 'canceledOrders', \\Doctrine\\ORM\\Query\\Expr\\Join::WITH, 'canceledOrders.cleared = 16')\n ->where('customer2.id = :customerId');\n\n $builder = $this->getEntityManager()->createQueryBuilder();\n $builder->select([\n 'customer',\n 'IDENTITY(customer.defaultBillingAddress) as default_billing_address_id',\n 'IDENTITY(customer.defaultShippingAddress) as default_shipping_address_id',\n 'billing',\n 'shipping',\n 'paymentData',\n 'locale.language',\n 'shop.name as shopName',\n $builder->expr()->count('doneOrders.id') . ' as orderCount',\n 'SUM(doneOrders.invoiceAmount) as amount',\n '(' . $subQueryBuilder->getDQL() . ') as canceledOrderAmount',\n ]);\n // Join s_orders second time to display the count of canceled orders and the count and total amount of done orders\n $builder->from($this->getEntityName(), 'customer')\n ->leftJoin('customer.defaultBillingAddress', 'billing')\n ->leftJoin('customer.defaultShippingAddress', 'shipping')\n ->leftJoin('customer.shop', 'shop')\n ->leftJoin('customer.languageSubShop', 'subShop')\n ->leftJoin('subShop.locale', 'locale')\n ->leftJoin('customer.paymentData', 'paymentData', \\Doctrine\\ORM\\Query\\Expr\\Join::WITH, 'paymentData.paymentMean = customer.paymentId')\n ->leftJoin('customer.orders', 'doneOrders', \\Doctrine\\ORM\\Query\\Expr\\Join::WITH, 'doneOrders.status <> -1 AND doneOrders.status <> 4')\n ->where('customer.id = :customerId')\n ->setParameter('customerId', $customerId);\n\n $builder->groupBy('customer.id');\n\n return $builder;\n }",
"public function getCustomerShiptos(Criteria $criteria = null, ConnectionInterface $con = null)\n {\n $partial = $this->collCustomerShiptosPartial && !$this->isNew();\n if (null === $this->collCustomerShiptos || null !== $criteria || $partial) {\n if ($this->isNew() && null === $this->collCustomerShiptos) {\n // return empty collection\n $this->initCustomerShiptos();\n } else {\n $collCustomerShiptos = ChildCustomerShiptoQuery::create(null, $criteria)\n ->filterByCustomer($this)\n ->find($con);\n\n if (null !== $criteria) {\n if (false !== $this->collCustomerShiptosPartial && count($collCustomerShiptos)) {\n $this->initCustomerShiptos(false);\n\n foreach ($collCustomerShiptos as $obj) {\n if (false == $this->collCustomerShiptos->contains($obj)) {\n $this->collCustomerShiptos->append($obj);\n }\n }\n\n $this->collCustomerShiptosPartial = true;\n }\n\n return $collCustomerShiptos;\n }\n\n if ($partial && $this->collCustomerShiptos) {\n foreach ($this->collCustomerShiptos as $obj) {\n if ($obj->isNew()) {\n $collCustomerShiptos[] = $obj;\n }\n }\n }\n\n $this->collCustomerShiptos = $collCustomerShiptos;\n $this->collCustomerShiptosPartial = false;\n }\n }\n\n return $this->collCustomerShiptos;\n }",
"public function getChild($id){\r\n\t\t$c = new Query($id);\r\n\t\treturn $c;\r\n\t}",
"public function subQuery()\n {\n $subQuery = clone $this;\n $subQuery->builderCache = new Query\\BuilderCache();\n\n $subQuery->isSubQuery = true;\n\n return $subQuery;\n }",
"private function getChildBrokerCustomer()\r\n {\r\n if ($this->auth->hasIdentity()) {\r\n\r\n $em = $this->entityManager;\r\n\r\n $data = $em->getRepository('Customer\\Entity\\Customer')->findAllChildBrokerCustomer($this->centralBrokerId);\r\n return $data;\r\n }\r\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
GrantAccess RevoGrantke access for this user to a particular area and possibly subarea. If the area is not specified, nothing is granted. If an area is specified but no subarea is specified, the whole section of permissions is granted. If an area and subarea are specified, that specific permission is granted. Example GrantAccess('Newsletters'); Will grant all access to newsletters (creating, editing, deleting, sending and so on). Example GrantAccess('Lists', 'Create'); Will grant all access to creating new mailing lists only. | function GrantAccess($area=null, $subarea=null)
{
return;
if (is_null($area)) {
return false;
}
$permission_types = $this->getPermissionTypes();
$area = strtolower($area);
// if it's not a base permission, check it's an addon permission.
if (!in_array($area, array_keys($permission_types))) {
// there are no addon permissions? bail out.
if (!isset($permission_types['addon_permissions'])) {
return false;
}
if (!isset($permission_types['addon_permissions'][$area])) {
return false;
}
}
if (is_null($subarea)) {
$subarea = $permission_types[$area];
}
if (!is_array($subarea)) {
$subarea = array($subarea);
}
if (!in_array($area, array_keys($this->permissions))) {
$this->permissions[$area] = array();
}
foreach ($subarea as $p => $sub) {
if (!in_array($sub, $this->permissions[$area])) {
array_push($this->permissions[$area], $sub);
}
}
return true;
} | [
"function HasAccess($area = null, $subarea = null, $id = 0)\n\t{\n\t $id = (int) $id;\n\t\t\n\t\tif (!gz0pen($area, $subarea, $id, $this->userid)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (is_null($area)) {\n\t\t\treturn false;\n\t\t}\n\n\t\t/**\n\t\t* If the area is the xmlapi, regardless of whether the user is an admin or not see if they have a token set.\n\t\t* This is an extra safe-guard so an admin user can disable the xmlapi altogether and not have any 'backdoor' sort of access.\n\t\t*/\n\t\tif ($area == 'xmlapi') {\n\t\t\tif ($this->xmlapi && $this->xmltoken != null) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\t\n\t\t\treturn false;\n\t\t}\n\n\t\tif ($this->isAdmin()) {\n\t\t\treturn true;\n\t\t}\n\n\t\t$area = strtolower($area);\n\n\t\tif ($area == 'lists') {\n\t\t\tif ($this->isListAdmin()) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\tif ($area == 'segments') {\n\t\t\tif ($this->isSegmentAdmin()) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tif ($this->getSegmentAdminType() == 'a') {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\tif ($area == 'users') {\n\t\t\tif ($this->isUserAdmin()) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\tif ($area == 'templates') {\n\t\t\tif ($this->isTemplateAdmin()) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\tif (empty($this->group->permissions)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (!in_array($area, array_keys($this->group->permissions))) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// if we're checking just a parent (eg lists) - since we are this far \n\t\t// (it checks we have access to something) - then we'll be fine.\n\t\tif (is_null($subarea)) {\n\t\t\treturn true;\n\t\t}\n\n\t\t$subarea = strtolower($subarea);\n\n\t\t/**\n\t\t * If you can manage an area, you can edit the area too.\n\t\t * \n\t\t * This excludes \"Subscribers\" where there is a special permission \n\t\t * called manage that is used to give \"view\" access to users\n\t\t */\n\t\tif ($area != 'subscribers' && $subarea == 'manage') {\n\t\t\t$subarea = 'edit';\n\t\t}\n\n\t\tif ($subarea == 'copy') {\n\t\t\t$subarea = 'create';\n\t\t}\n\n /**\n * As Dynamic Content only has one general permission across the \n * application. We put this condition to filter it.\n */\n\t\tif ($area == 'dynamiccontenttags') {\n\t\t\t$subarea = 'general';\n\t\t}\n\n\t\tif (in_array($subarea, $this->group->permissions[$area])) {\n\t\t\tif ($id <= 0) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\t// if we're checking a specific item, do it here.\n\t\t\tif ($area == 'templates' || $area == 'lists' || $area == 'segments') {\n\t\t\t\tif (in_array($id, $this->group->access[$area])) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif ($area == 'templates') {\n\t\t\t\t\tif ($this->templateadmintype == 'a') {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif ($area == 'lists') {\n\t\t\t\t\tif ($this->listadmintype == 'a') {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// since we're checking a specific item, if they don't have access to it already, they don't have access to it\n\t\t\t\t// so deny access.\n\t\t\t\treturn false;\n\t\t\t} else {\n\t\t\t\t// if we happen to pass in an id for something other than templates or lists, then return true.\n\t\t\t\t// we've already checked they have access to the area with the in_array check above.\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn false;\n\t}",
"public function setRestrictAccess($access);",
"function HasAccess($area=null, $subarea=null, $id=0)\n\t{\n\t\t$id = (int)$id;\n\n\t\tif (is_null($area)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif ($this->Admin()) {\n\t\t\treturn true;\n\t\t}\n\n\t\t$area = strtolower($area);\n\n\t\tif ($area == 'lists') {\n\t\t\tif ($this->ListAdmin()) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\tif (empty($this->permissions)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (!in_array($area, array_keys($this->permissions))) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// if we're checking just a parent (eg lists) - since we are this far (it checks we have access to something) - then we'll be fine.\n\t\tif (is_null($subarea)) {\n\t\t\treturn true;\n\t\t}\n\n\t\t$subarea = strtolower($subarea);\n\n\t\t// if you can manage an area, you can edit the area too.\n\t\tif ($subarea == 'manage') {\n\t\t\t$subarea = 'edit';\n\t\t}\n\n\t\tif ($subarea == 'copy') {\n\t\t\t$subarea = 'create';\n\t\t}\n\n\t\tif (in_array($subarea, $this->permissions[$area])) {\n\t\t\tif ($id <= 0) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\t// if we're checking a specific item, do it here.\n\t\t\tif ($area == 'templates' || $area == 'lists') {\n\t\t\t\tif (in_array($id, $this->access[$area])) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\tif ($area == 'templates') {\n\t\t\t\t\tif ($this->templateadmintype == 'a') {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif ($area == 'lists') {\n\t\t\t\t\tif ($this->listadmintype == 'a') {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t\treturn false;\n\t}",
"function grant($user_id, $access, $allow='1')\n {\n if (empty( $user_id ) || empty( $access )) {\n return false;\n }\n $query=\"INSERT INTO `acl`VALUES(null,:user_id,:name,:allow,:created);\";\n $result = db::insert( $query, array(\n 'user_id' => $user_id,\n 'name' => $access,\n 'allow' => $allow,\n 'created' => $_SERVER[ 'REQUEST_DATETIME' ]\n ), 'id' );\n return !empty( $result );\n }",
"public function grantAccess(Employee $employee);",
"public function admin_add_access() {\n\t\tif ($this->request->data) {\n\t\t\tif ($user = $this->Access->add($this->request->data['Access'])) {\n\t\t\t\t$this->Session->setFlash(sprintf(__d('forum', 'Access has been granted to %s.'), '<strong>' . $user['User'][$this->config['userMap']['username']] . '</strong>'));\n\t\t\t\t$this->redirect(array('controller' => 'staff', 'action' => 'index', 'admin' => true));\n\t\t\t}\n\t\t}\n\n\t\t$this->ForumToolbar->pageTitle(__d('forum', 'Add Access'));\n\t\t$this->set('method', 'add');\n\t\t$this->set('levels', $this->Access->AccessLevel->getHigherLevels());\n\t\t$this->render('admin_form_access');\n\t}",
"function facebook_hook_profile_areas($profile_areas)\r\n{\r\n\tglobal $scripturl, $txt, $context;\r\n\r\n\t$profile_areas['edit_profile']['areas']['facebook'] = array(\r\n\t\t'label' => $txt['facebook'],\r\n\t\t'enabled' => facebook_enabled() && $context['user']['is_owner'],\r\n\t\t'function' => 'Facebook_profile',\r\n\t\t'permission' => array(\r\n\t\t\t'own' => array('profile_extra_own'),\r\n\t\t\t'any' => array('profile_extra_any'),\r\n\t\t),\r\n\t);\r\n}",
"function check_access($area) {\n\t$access_granted = 0;\n\t\n\t$list = explode(',', $_SESSION['access_level']);\n\tforeach($list as $allowed) {\n\t\tif($area == $allowed) $access_granted = 1;\n\t}\n\t\n\t//Allow access for username 'coh' ONLY if logged in through the mobile portal (tools.siskiyourappellers.com/m)\n\t//if(($_SESSION['mobile'] != 1) && ($_SESSION['username'] == 'coh')) $access_granted = 0;\n\t\n\treturn $access_granted;\n}",
"function kleo_check_access($area, $restrict_options=null)\n{\n global $current_user;\n\t\n if (!$restrict_options) {\n $restrict_options = kleo_memberships();\n }\n\t\n\tif (pmpro_url(\"levels\")) {\n\t\t$default_redirect = pmpro_url(\"levels\");\n\t}\n\telse {\n\t\t$default_redirect = bp_get_signup_page();\n\t}\n\t$default_redirect = apply_filters('kleo_pmpro_url_redirect', $default_redirect);\n\t\n\t//no restriction\n if ($restrict_options[$area]['type'] == 0) \n {\n\t\treturn;\n\t}\n\t\n //restrict all members -> go to home url\n if ($restrict_options[$area]['type'] == 1) \n {\n\t\twp_redirect(apply_filters('kleo_pmpro_home_redirect',home_url()));\n\t\texit;\n }\n\n //is a member\n if (isset($current_user->membership_level) && $current_user->membership_level->ID) {\n\n //if restrict my level\n if ($restrict_options[$area]['type'] == 2 && is_array($restrict_options[$area]['levels']) && !empty($restrict_options[$area]['levels']) && pmpro_hasMembershipLevel($restrict_options[$area]['levels']) )\n {\n wp_redirect($default_redirect);\n exit;\n }\n \n //logged in but not a member\n } else if (is_user_logged_in()) {\n if ($restrict_options[$area]['type'] == 2 && isset($restrict_options[$area]['not_member']) && $restrict_options[$area]['not_member'] == 1)\n {\n wp_redirect($default_redirect);\n exit;\n }\n }\n //not logged in\n else {\n if ($restrict_options[$area]['type'] == 2 && isset($restrict_options[$area]['guest']) && $restrict_options[$area]['guest'] == 1)\n {\n wp_redirect($default_redirect);\n exit;\n }\n }\n}",
"public function grantAccess($permission, $entity, $user = null) {\n $this->aclManager->addObjectPermission(\n $entity,\n constant('LOCKSSOMatic\\UserBundle\\Security\\Acl\\Permission\\MaskBuilder::MASK_'.$permission),\n $user\n );\n }",
"public function addGrants($_containerId, $_accountType, $_accountId, array $_grants, $_ignoreAcl = FALSE)\n {\n $containerId = Tinebase_Model_Container::convertContainerId($_containerId);\n \n if($_ignoreAcl !== TRUE and !$this->hasGrant(Core::getUser(), $_containerId, Tinebase_Model_Grants::GRANT_ADMIN)) {\n throw new Tinebase_Exception_AccessDenied('Permission to manage grants on container denied.');\n }\n \n switch($_accountType) {\n case Tinebase_Acl_Rights::ACCOUNT_TYPE_USER:\n $accountId = ModelUser::convertUserIdToInt($_accountId);\n break;\n case Tinebase_Acl_Rights::ACCOUNT_TYPE_GROUP:\n $accountId = ModelGroup::convertGroupIdToInt($_accountId);\n break;\n case Tinebase_Acl_Rights::ACCOUNT_TYPE_ANYONE:\n $accountId = '0';\n break;\n case Tinebase_Acl_Rights::ACCOUNT_TYPE_ROLE:\n $accountId = Tinebase_Model_Role::convertRoleIdToInt($_accountId);\n break;\n default:\n throw new InvalidArgument('invalid $_accountType');\n break;\n }\n \n $containerGrants = $this->getGrantsOfContainer($containerId, TRUE);\n $containerGrants->addIndices(array('account_type', 'account_id'));\n $existingGrants = $containerGrants->filter('account_type', $_accountType)->filter('account_id', $accountId)\n ->getFirstRecord();\n \n foreach($_grants as $grant) {\n if ($existingGrants === NULL || ! $existingGrants->{$grant}) {\n $data = array(\n 'id' => Tinebase_Record_Abstract::generateUID(),\n 'container_id' => $containerId,\n 'account_type' => $_accountType,\n 'account_id' => $accountId,\n 'account_grant' => $grant\n );\n $this->_getContainerAclTable()->insert($data);\n }\n }\n\n $newGrants = $this->getGrantsOfContainer($containerId, true);\n $this->_writeModLog(\n new Tinebase_Model_Container(array('id' => $containerId, 'account_grants' => $newGrants), true),\n new Tinebase_Model_Container(array('id' => $containerId, 'account_grants' => $containerGrants), true)\n );\n\n $this->_setRecordMetaDataAndUpdate($containerId, 'update');\n \n return true;\n }",
"protected function _assignAccess() {\n $rol = \\KBackend\\Model\\Role::_find_first($this->_auth->get('role_id'));\n //establecemos los recursos permitidos para el rol\n $recursos = $rol->getRecursos();\n $urls = array();\n foreach ($recursos as $e) {\n $url = !empty($e->module) ? \"$e->module/\" : '';\n $url .= !empty($e->controller)? \"$e->controller/\":'*/';\n $url .=!empty($e->action) ? \"$e->action\" : '*';\n $urls[] = $url;\n }\n //damos permiso al rol de acceder al arreglo de recursos\n $this->_acl->allow($rol->id, $urls);\n $this->_acl->user($this->_auth->get('id'), array($rol->id));\n }",
"public function setResourceTypeAccess($var)\n {\n GPBUtil::checkMessage($var, \\Io\\Token\\Proto\\Common\\Consent\\CreateConsent_ResourceTypeAccess::class);\n $this->writeOneof(3, $var);\n\n return $this;\n }",
"public function addScopeAccess($scopeAccess) {\n $this->scopeAccesses[$scopeAccess->getScope()] = $scopeAccess;\n }",
"public function setArea(int $area);",
"public function setGroupsByContextAccess(array $groupsByContextAccess);",
"function changeAccessPerNode($access = TRUE) {\n $access_permissions = array(\n 'per_node' => $access,\n );\n $this->changeAccessContentType($access_permissions);\n }",
"public function allow() {\n // create a new ruleset with full access\n $this->_allow(\n $this->getResource(), \n $this->getRole(), \n $this->getPrivileges(), \n $this->getAssertion()\n );\n }",
"function access() {\n return user_access('administer comments');\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Testing references to other documents | public function testReferences()
{
$contents = file_get_contents($this->targetFile('introduction.html'));
$this->assertContains('<a href="index.html#toc">Index, paragraph toc</a>', $contents);
$this->assertContains('<a href="index.html">Index</a>', $contents);
$this->assertContains('<a href="index.html">Summary</a>', $contents);
$contents = file_get_contents($this->targetFile('subdir/test.html'));
$this->assertContains('"../index.html"', $contents);
} | [
"public function testSimilarDocuments() {\n\t\t$this->checkSimDocs();\n\t}",
"public function testMergeDocumentDocx()\n {\n }",
"public function testMultipleDocumentsOfTheSameType()\n {\n $document1 = Shopware_Components_Document::initDocument(\n 15,\n 1,\n [\n '_renderer' => 'pdf',\n '_preview' => false,\n '_allowMultipleDocuments' => true,\n ]\n );\n $document1->render();\n\n $document2 = Shopware_Components_Document::initDocument(\n 15,\n 1,\n [\n '_renderer' => 'pdf',\n '_preview' => false,\n '_allowMultipleDocuments' => true,\n ]\n );\n $document2->render();\n\n $documents = Shopware()->Container()->get('models')->getRepository(Document::class)\n ->findBy([\n 'typeId' => 1,\n 'orderId' => 15,\n ]);\n static::assertCount(2, $documents);\n\n // Revert changes of this test\n foreach ($documents as $document) {\n Shopware()->Container()->get('models')->remove($document);\n }\n Shopware()->Container()->get('models')->flush();\n }",
"public function testCompareDocument()\n {\n $remoteFolder = self::$baseRemoteFolderPath . \"/DocumentActions/CompareDocument\";\n $localFolder = \"DocumentActions/CompareDocument\";\n $localName1 = \"compareTestDoc1.doc\";\n $localName2 = \"compareTestDoc2.doc\";\n $remoteName1 = \"TestCompareDocument1.doc\";\n $remoteName2 = \"TestCompareDocument2.doc\";\n\n $this->uploadFile(\n realpath(__DIR__ . '/../../..') . \"/TestData/\" . $localFolder . \"/\" . $localName1,\n $remoteFolder . \"/\" . $remoteName1\n );\n $this->uploadFile(\n realpath(__DIR__ . '/../../..') . \"/TestData/\" . $localFolder . \"/\" . $localName2,\n $remoteFolder . \"/\" . $remoteName2\n );\n\n $requestCompareData = new CompareData(array(\n \"author\" => \"author\",\n \"comparing_with_document\" => $remoteFolder . \"/\" . $remoteName2,\n \"date_time\" => new \\DateTime(\"2015-10-26T00:00:00.0000000Z\"),\n ));\n $request = new CompareDocumentRequest(\n $remoteName1,\n $requestCompareData,\n $remoteFolder,\n NULL,\n NULL,\n NULL,\n NULL,\n self::$baseTestOutPath . \"/TestCompareDocumentOut.doc\",\n NULL\n );\n\n $result = $this->words->compareDocument($request);\n Assert::assertTrue(json_decode($result, true) !== NULL);\n Assert::assertNotNull($result->getDocument());\n Assert::assertEquals(\"TestCompareDocumentOut.doc\", $result->getDocument()->getFileName());\n }",
"public function testPostItemRelationshipsRef()\n {\n\n }",
"public function testMultipleReferenceRetrieval()\n {\n try {\n list($users, $questions, $answers) = $this->getRepositories();\n \n // multiple results (automatic references)\n $allAnswers = $answers->fetchReferences(true, true)->getAllSoft();\n foreach ($allAnswers as $answer) {\n if (!is_null($answer->question)) {\n $this->assertInstanceOf(Question::class, $answer->question);\n }\n $this->assertInstanceOf(User::class, $answer->user);\n $question = $questions->findSoft(null, $answer->questionId);\n $this->assertEquals($question, $answer->question);\n $this->assertEquals($users->find(null, $answer->userId), $answer->user);\n }\n \n // multiple results (named references)\n $allAnswers = $answers->fetchReferences(['user', 'question'], true)->getAllSoft();\n foreach ($allAnswers as $answer) {\n if (!is_null($answer->question)) {\n $this->assertInstanceOf(Question::class, $answer->question);\n }\n $this->assertInstanceOf(User::class, $answer->user);\n $question = $questions->findSoft(null, $answer->questionId);\n $this->assertEquals($question, $answer->question);\n $this->assertEquals($users->find(null, $answer->userId), $answer->user);\n }\n \n // multiple results (named references, with condition and ordering)\n $allAnswers = $answers->fetchReferences(['question', 'user'], true)->getAllSoft('userId = ?', [3], ['order' => 'questionId ASC']);\n $this->assertEquals(3, $allAnswers[1]->id);\n foreach ($allAnswers as $answer) {\n if (!is_null($answer->question)) {\n $this->assertInstanceOf(Question::class, $answer->question);\n }\n $this->assertInstanceOf(User::class, $answer->user);\n $question = $questions->findSoft(null, $answer->questionId);\n $this->assertEquals($question, $answer->question);\n $this->assertEquals($users->find(null, $answer->userId), $answer->user);\n }\n \n // multiple results (named single reference)\n $allAnswers = $answers->fetchReferences(['question'], true)->getAllSoft();\n foreach ($allAnswers as $answer) {\n if (!is_null($answer->question)) {\n $this->assertInstanceOf(Question::class, $answer->question);\n }\n $question = $questions->findSoft(null, $answer->questionId);\n $this->assertEquals($question, $answer->question);\n $exception = null;\n try {\n $user = $answer->user;\n } catch (\\Exception $ex) {\n $exception = $ex;\n }\n $this->assertInstanceOf(RepositoryException::class, $exception);\n }\n } finally {\n // clean up references to release database lock\n $users->setManager(null);\n $answers->setManager(null);\n $questions->setManager(null);\n if (!is_null($answer->question)) {\n $answer->question->setManager(null);\n }\n $answer->setManager(null);\n if ($question) {\n $question->setManager(null);\n }\n }\n }",
"public function testSelfReferential()\n\t{\n\t\t$page = R::dispense( 'page' )->setAttr( 'title', 'a' );\n\t\t$page->sharedPage[] = R::dispense( 'page' )->setAttr( 'title', 'b' );\n\t\tR::store( $page );\n\t\t$page = $page->fresh();\n\t\t$page = reset( $page->sharedPage );\n\t\tasrt( $page->title, 'b' );\n\t\t$tables = array_flip( R::inspect() );\n\t\tasrt( isset( $tables['page_page'] ), true );\n\t\t$columns = R::inspect( 'page_page' );\n\t\tasrt( isset( $columns['page2_id'] ), true );\n\t}",
"public function testSelfReferential()\n\t{\n\t\t$page = R::dispense('page')->setAttr( 'title', 'a' );\n\t\t$page->sharedPage[] = R::dispense( 'page' )->setAttr( 'title', 'b' );\n\t\tR::store( $page );\n\t\t$page = $page->fresh();\n\t\t$page = reset( $page->sharedPage );\n\t\tasrt( $page->title, 'b' );\n\t\t$tables = array_flip( R::inspect() );\n\t\tasrt( isset( $tables['page_page'] ), true );\n\t\t$columns = R::inspect( 'page_page' );\n\t\tasrt( isset( $columns['page2_id'] ), true );\n\t}",
"public function testGetDocumentOfLibraryDocument()\n {\n }",
"public function testDocumentsCanWrite()\n {\n }",
"public function testGetAllDocumentsOfAgreement()\n {\n }",
"public function testDataReferences() {\n $language_reference_definition = DataReferenceDefinition::create('language');\n $this->assertInstanceOf(DataReferenceDefinitionInterface::class, $language_reference_definition);\n\n // Test retrieving metadata about the referenced data.\n $this->assertEquals('language', $language_reference_definition->getTargetDefinition()->getDataType());\n\n // Test using the definition factory.\n $language_reference_definition2 = $this->typedDataManager->createDataDefinition('language_reference');\n $this->assertInstanceOf(DataReferenceDefinitionInterface::class, $language_reference_definition2);\n $this->assertEquals(serialize($language_reference_definition2), serialize($language_reference_definition));\n }",
"public function testGetMultiDocumentTransactionById()\n {\n }",
"public function testGetReferences()\n {\n $organization = $this->expectGetOrganization();\n $organization->expects($this->once())\n ->method('getReferences')\n ->with()\n ->willReturn($this->org_data);\n\n $out = $this->model->getReferences();\n $this->assertEquals(array_merge([$this->model->id,], $this->org_data), $out);\n }",
"public function isEqualTo(IDocument $other);",
"public function testMultipleDocumentsOfTheSameTypeNegative()\n {\n $document1 = Shopware_Components_Document::initDocument(\n 15,\n 1,\n [\n '_renderer' => 'pdf',\n '_preview' => false,\n '_allowMultipleDocuments' => false,\n ]\n );\n $document1->render();\n\n $document2 = Shopware_Components_Document::initDocument(\n 15,\n 1,\n [\n '_renderer' => 'pdf',\n '_preview' => false,\n '_allowMultipleDocuments' => false,\n ]\n );\n $document2->render();\n\n $documents = Shopware()->Container()->get('models')->getRepository(Document::class)\n ->findBy([\n 'typeId' => 1,\n 'orderId' => 15,\n ]);\n static::assertCount(1, $documents);\n\n // Revert changes of this test\n foreach ($documents as $document) {\n Shopware()->Container()->get('models')->remove($document);\n }\n Shopware()->Container()->get('models')->flush();\n }",
"public function testVersioning()\n\t{\n\t\t$document = R::dispense( 'document' );\n\n\t\t$page = R::dispense( 'page' );\n\n\t\t$document->title = 'test';\n\n\t\t$page->content = 'lorem ipsum';\n\n\t\t$user = R::dispense( 'user' );\n\n\t\t$user->name = 'Leo';\n\n\t\t$document->sharedUser[] = $user;\n\t\t$document->ownPage[] = $page;\n\n\t\t$document->starship_id = 3;\n\t\t$document->planet = R::dispense( 'planet' );\n\n\t\tR::store( $document );\n\n\t\t$duplicate = R::dup( $document );\n\n\t\tR::store( $duplicate );\n\n\t\t$duplicate = R::dup( $document );\n\n\t\tR::store( $duplicate );\n\n\t\tasrt( R::count( 'planet' ), 1 );\n\t\tasrt( R::count( 'user' ), 1 );\n\t\tasrt( R::count( 'document' ), 3 );\n\t\tasrt( R::count( 'page' ), 3 );\n\t\tasrt( R::count( 'spaceship' ), 0 );\n\t}",
"public function testReadPublicDocument()\n {\n }",
"public function testMergeDocumentTxt()\n {\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return the value of an attribute from the result of an LDAP search, converted to the current charset. | function get_ldap_attribute($search_result, $attribute)
{
if (isset($search_result[0][$attribute][0])) {
return iconv("UTF-8", $GLOBALS['charset'], $search_result[0][$attribute][0]);
} else {
return '';
}
} | [
"function get_ldap_attribute($search_result, $attribute) {\n if (isset($search_result[0][$attribute][0])) {\n return iconv('UTF-8', $GLOBALS['charset'], $search_result[0][$attribute][0]);\n } else {\n return '';\n }\n}",
"public function getLdapAttributeSingleValue($ldapResult, $attribute)\n {\n $attributeValues = $this->getLdapAttribute($ldapResult, $attribute);\n if (count($attributeValues) === 1) {\n return $attributeValues[0];\n }\n return '';\n }",
"public function getAttributeToLdap($attribute)\n {\n return $this->hasAttribute($attribute) ? $this->lcAttributeNameMap[strtolower($attribute)] : $attribute;\n }",
"public function getLdapAttribute($ldapResult, $attribute)\n {\n if ($ldapResult['count'] > 0) {\n $entry = $ldapResult[0];\n return $this->getEntryLdapAttribute($entry, $attribute);\n }\n return array();\n }",
"function ldapspecialchars($string) {\n return Arcanum_Ldap::specialchars($string);\n}",
"protected function getCurrentLdapAttributeValue($attribute)\n {\n if (!$this->getDn() || !$this->getLdapConnection()) {\n throw new AttributeConverterException(sprintf('Unable to query for the current \"%s\" attribute.', $attribute));\n }\n\n $query = new LdapQueryBuilder($this->getLdapConnection());\n try {\n return $query->select($attribute)\n ->where($query->filter()->present('objectClass'))\n ->setBaseDn($this->getDn())\n ->setScopeBase()\n ->getLdapQuery()\n ->getSingleScalarOrNullResult();\n } catch (EmptyResultException $e) {\n throw new AttributeConverterException(sprintf('Unable to find LDAP object: %s', $this->getDn()));\n }\n }",
"function get_attribute($attribute)\n {\n #$attribute = strtoupper($attribute);\n $attributes = $this->xml_value_[0][\"attributes\"];\n return $attributes[$attribute];\n }",
"public function getLdapAttribute($attribute)\n\t{\n\t\t$attribute = strtolower(trim($attribute));\n\n\t\tif(is_array($this->_attributes) and array_key_exists($attribute, $this->_attributes))\n\t\t{\n\t\t\treturn $this->_attributes[$attribute];\n\t\t}\n\t\telse\n\t\t\treturn null;\n\t}",
"private function get_attribute($attr)\n\t{\n\t\t$attributes = $this->saml->getAttributes();\n\t\treturn $attributes[$attr][0];\n\t}",
"function get_valeur_attribut($attribut) {\r\n\r\n\t\t$sql=\"SELECT $attribut\r\n\t\t\t\t FROM les_usagers \r\n\t\t\t\t WHERE id_usager = '$this->id_usager' \";\t \t\t \r\n\r\n\t\t$result = $this->bdd->executer($sql);\r\n\r\n\t\tif ($ligne = mysql_fetch_assoc($result)) {\r\n\r\n\t\t\treturn $ligne[$attribut];\r\n\r\n\t\t}\r\n\t\telse return \"\";\r\n\t\t\t\r\n\t}",
"public function next_attribute() {\n $this->attr = ldap_next_attribute($this->connect, $this->entry_identifier);\n return $this->attr; // string\n }",
"private function build_attribute_db_collation(): object {\n $attributename = $this->get_attribute_by_name('DB Collation');\n $datasourcedomain = $this->get_data_source('Database Collation Details');\n\n $attribute = (object)[\n 'objectTypeAttributeId' => $attributename->id,\n \"objectAttributeValues\" => [\n (object)[\n \"value\" => $datasourcedomain->data->dbcollation,\n ],\n ],\n ];\n\n return $attribute;\n }",
"public function get_attribute($attribute)\n\t{\n\t\t#$attribute = strtoupper($attribute);\n\t\t$attributes = $this->xml_value_[0][\"attributes\"];\n\t\treturn $attributes[$attribute];\n \t}",
"public function fromLdap()\n {\n $entry = $this->convert($this->entry, false);\n\n foreach ($entry as $attribute => $value) {\n if ($this->schema->isMultivaluedAttribute($attribute) && !is_array($value)) {\n $entry[$attribute] = [$value];\n }\n }\n\n return $entry;\n }",
"public function getUserAttributeFromGroupMembershipEntryAttribute(): ?string;",
"function ldap_next_attribute($ldap, $entry): string\n{\n error_clear_last();\n $safeResult = \\ldap_next_attribute($ldap, $entry);\n if ($safeResult === false) {\n throw LdapException::createFromPhpError();\n }\n return $safeResult;\n}",
"protected function get_encodeable_value() {\n return isset($this->parameters['ENCODING']) ?\n $this->value : parent::escaped_text($this->value);\n }",
"function eF_getLdapValues($filter, $attributes)\n{\n $basedn = $GLOBALS['configuration']['ldap_basedn']; //The base DN is needed to perform searches\n $ds = eF_ldapConnect();\n $sr = ldap_search($ds, $basedn, $filter, $attributes);\n $result = ldap_get_entries($ds, $sr);\n return $result;\n}",
"function get_attribute_value( $_attribute ) {\n \n if ( !isset( $_attribute ) || empty( $_attribute ) )\n return null;\n else {\n $regex = \"/$_attribute\\s*=\\s*\\\"\\s*(\\S*)\\s*\\\"/i\";\n\n $has_auth_param = preg_match( $regex, $this->shortcode_str, $matches );\n if ( isset( $matches[1] ) )\n return $matches[1];\n else\n return null;\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Devolvemos las noticias destacadas | public function get_noticias_destacadas()
{
return $this->noticiasRepo->get_noticias_destacadas();
} | [
"function notifications_notifications_destinataires($flux) {\n\tstatic $sent = array();\n\t$quoi = $flux['args']['quoi'];\n\t$options = $flux['args']['options'];\n\n\t// proposition d'article prevenir les admins restreints\n\tif ($quoi=='instituerarticle' AND $GLOBALS['notifications']['prevenir_admins_restreints']\n\t\tAND $options['statut'] == 'prop' AND $options['statut_ancien'] != 'publie' // ligne a commenter si vous voulez prevenir de la publication\n\t\t){ \n\t\n\t\t$id_article = $flux['args']['id']; \n\t\tinclude_spip('base/abstract_sql'); \n\t\t$t = sql_fetsel(\"id_rubrique\", \"spip_articles\", \"id_article=\".intval($id_article));\n\t\t$id_rubrique=$t['id_rubrique'];\n\t\t \n\twhile ($id_rubrique) { \n\t\t$hierarchie[]=$id_rubrique;\n\t\t$res = sql_fetsel(\"id_parent\", \"spip_rubriques\", \"id_rubrique=\".intval($id_rubrique));\n\t\tif (!$res){ // rubrique inexistante\n\t\t\t$id_rubrique = 0;\n\t\t\tbreak;\n\t\t} \n\t\t$id_parent = $res['id_parent']; \n\t\t$id_rubrique = $id_parent;\n\t}\n\tspip_log(\"Prop article > admin restreint de \".join(',', $hierarchie),'notifications');\n \n\t\t//les admins de la rub et de ses parents \n\t\t$result_email = sql_select(\"auteurs.email,auteurs.id_auteur,lien.id_rubrique\", \"spip_auteurs AS auteurs, spip_auteurs_rubriques AS lien\", \"lien.id_rubrique IN (\" . join(',', $hierarchie) . \") AND auteurs.id_auteur=lien.id_auteur AND auteurs.statut='0minirezo'\");\n\n\t\twhile ($qui = sql_fetch($result_email)) {\n\t\t\tspip_log($options['statut'].\" article > admin restreint \".$qui['id_auteur'].\" de la rubrique\".$qui['id_rubrique'].\" prevenu\",'notifications');\n\t\t\t$flux['data'][] = $qui['email'];\n\t\t}\n\n\t}\n\t\n\t// publication d'article : prevenir les auteurs\n\tif ($quoi=='instituerarticle'\n\t AND $GLOBALS['notifications']['prevenir_auteurs_articles']){\n\t\t$id_article = $flux['args']['id'];\n\t\t \n\n\t\tinclude_spip('base/abstract_sql');\n\n\t\t// Qui va-t-on prevenir en plus ?\n\t\t$result_email = sql_select(\"auteurs.email\", \"spip_auteurs AS auteurs, spip_auteurs_articles AS lien\", \"lien.id_article=\".intval($id_article).\" AND auteurs.id_auteur=lien.id_auteur\");\n\n\t\twhile ($qui = sql_fetch($result_email)) {\n\t\t\t$flux['data'][] = $qui['email'];\n\t\t}\n\n\t}\n\n\t// forum valide ou prive : prevenir les autres contributeurs du thread\n\tif (($quoi=='forumprive' AND $GLOBALS['notifications']['thread_forum_prive'])\n\t\tOR ($quoi=='forumvalide' AND $GLOBALS['notifications']['thread_forum'])\n\t ){\n\n\t\t$id_forum = $flux['args']['id'];\n\t\t\n\t\tif ($t = $options['forum']\n\t\t\tOR $t = sql_fetsel(\"*\", \"spip_forum\", \"id_forum=\".intval($id_forum))){\n\n\t\t\t// Tous les participants a ce *thread*\n\t\t\t// TODO: proposer une case a cocher ou un lien dans le message\n\t\t\t// pour se retirer d'un troll (hack: replacer @ par % dans l'email)\n\t\t\t$s = sql_select(\"DISTINCT(email_auteur)\",\"spip_forum\",\"id_thread=\".intval($t['id_thread']).\" AND email_auteur != ''\");\n\t\t\twhile ($r = sql_fetch($s))\n\t\t\t\t$flux['data'][] = $r['email_auteur'];\n\n\t\t\t/*\n\t\t\t// 3. Tous les auteurs des messages qui precedent (desactive egalement)\n\t\t\t// (possibilite exclusive de la possibilite precedente)\n\t\t\t// TODO: est-ce utile, par rapport au thread ?\n\t\t\telse if (defined('_SUIVI_FORUMS_REPONSES')\n\t\t\tAND _SUIVI_FORUMS_REPONSES) {\n\t\t\t\t$id_parent = $id_forum;\n\t\t\t\twhile ($r = spip_fetch_array(spip_query(\"SELECT email_auteur, id_parent FROM spip_forum WHERE id_forum=$id_parent AND statut='publie'\"))) {\n\t\t\t\t\t$tous[] = $r['email_auteur'];\n\t\t\t\t\t$id_parent = $r['id_parent'];\n\t\t\t\t}\n\t\t\t}\n\t\t\t*/\n\t\t}\n\t}\n\n\t// Les moderateurs de forums public\n\tif ($quoi=='forumposte' AND $GLOBALS['notifications']['moderateurs_forum']){\n\t\tforeach (explode(',', $GLOBALS['notifications']['moderateurs_forum']) as $m) {\n\t\t\t$flux['data'][] = $m;\n\t\t}\n\t}\n\t\n\t// noter les envois de ce forum pour ne pas doublonner\n\tif (in_array($quoi,array('forumposte','forumvalide','forumprive'))\n\t\tAND $id = $flux['args']['id']){\n\t\tif (isset($sent[$id])){\n\t\t\t$flux['data'] = array_diff($flux['data'],$sent[$id]);\n\t\t} else {\n\t\t\t$sent[$id] = array();\n\t\t}\n\t\t$sent[$id] = array_merge($sent[$id],$flux['data']);\n\t}\n\n\treturn $flux;\n}",
"private function processarNotificacoes() {\n\n /**\n * Objeto assunto e mensagem padrao\n */\n $oMensageriaAcordo = new MensageriaAcordo();\n\n /**\n * Define o sistema para mensageria, pelo nome do municipio\n * - db_config.munic\n */\n $oInstituicao = new Instituicao();\n $oPrefeitura = @$oInstituicao->getDadosPrefeitura();\n $sSistema = 'e-cidade.' . strtolower($oPrefeitura->getMunicipio());\n\n foreach ($this->aAcordos as $oAcordo) {\n\n $aVariaveisAcordo = array(\n '[numero]' => $oAcordo->getNumeroAcordo(),\n '[ano]' => $oAcordo->getAno(),\n '[data_inicial]' => $oAcordo->getDataInicial(),\n '[data_final]' => $oAcordo->getDataFinal(),\n );\n\n $sAssuntoAcordo = strtr($oMensageriaAcordo->getAssunto(), $aVariaveisAcordo);\n $sMensagemAcordo = strtr($oMensageriaAcordo->getMensagem(), $aVariaveisAcordo);\n $oDBDateAtual = new DBDate(date('Y-m-d'));\n $iDiasVencimento = DBDate::calculaIntervaloEntreDatas(new DBDate($oAcordo->getDataFinal()), $oDBDateAtual, 'd');\n $aDestinatarios = array();\n $aUsuarioNotificado = array();\n\n foreach ($this->aCodigoMensageriaAcordoUsuario as $iCodigoMensageriaAcordoUsuario) {\n\n $oMensageriaAcordoUsuario = MensageriaAcordoUsuarioRepository::getPorCodigo($iCodigoMensageriaAcordoUsuario);\n $oUsuarioSistema = $oMensageriaAcordoUsuario->getUsuario();\n\n /**\n * Dias para vencer maior que os dias configurados\n */\n if ($iDiasVencimento > $oMensageriaAcordoUsuario->getDias() ) {\n continue;\n }\n\n /**\n * Verifica se o usuario tem permisao no departamento do acordo\n */\n if (!empty($this->aCodigoDepartamentoUsuario[$oAcordo->getDepartamento()])) {\n\n $iUsuario = $oUsuarioSistema->getCodigo();\n if (!in_array($iUsuario, $this->aCodigoDepartamentoUsuario[$oAcordo->getDepartamento()])) {\n continue;\n }\n }\n\n /**\n * Salva acordo como ja notificado para usuario e dia\n * mensageriaacordoprocessados\n */\n $this->salvarAcordoProcessado($iCodigoMensageriaAcordoUsuario, $oAcordo->getCodigo()); \n \n /**\n * Usuario ja notificado com dia menor que o atual \n */\n if (in_array($oUsuarioSistema->getCodigo(), $aUsuarioNotificado)) {\n continue;\n }\n\n $aDestinatarios[] = array('sLogin' => $oUsuarioSistema->getLogin(), 'sSistema' => $sSistema);\n $aUsuarioNotificado[] = $oUsuarioSistema->getCodigo();\n }\n\n /**\n * Acordo sem usuarios para notificar\n */\n if (empty($aDestinatarios)) {\n continue;\n }\n\n $sAssunto = str_replace('[dias]', $iDiasVencimento, $sAssuntoAcordo);\n $sMensagem = str_replace('[dias]', $iDiasVencimento, $sMensagemAcordo);\n $this->enviarNotificacao($sAssunto, $sMensagem, $sSistema, $aDestinatarios); \n }\n \n return true;\n }",
"public function eliminarNotas() {\n foreach ($this->notas as $nota) {\n $nota->delete();\n }\n }",
"function organizarNotasPorEstudiante(){\n\t\tforeach($this->notasPerdidas as $clave=>$valor){\n\t\t\t$this->registroNotasPerdidasPorEstudiante[$valor['COD_ESTUDIANTE']][$valor['COD_ASIGNATURA']][$valor['ANIOPERIODO']][]=$valor['NOTA'];\n\t\t}\n\t}",
"public function getDestAsientos()\n {\n return $this->destAsientos;\n }",
"public function listarNotas(){\n\t\tif(self::logeado()){\n\t\t\t\t//se tratan las notas que he creado\n\t\t\t\t$listaCreadas=$this->NotaMapper->listNote();\n\t\t\t\tif ($listaCreadas == NULL) {\n\t\t\t\t\t$this->view->setVariable(\"creates\",\"You haven't posted any notes\");//se muestra que no hay notas publicadas\n\t\t\t\t}else{\n\t\t\t\t\t$this->view->setVariable(\"creates\",\"\");//no se muestra ningun mensaje\n\t\t\t\t\t$this->view->setVariable(\"currentuser\", $_SESSION[\"currentuser\"]);\n\t\t\t\t\t$this->view->setVariable(\"listaCreadas\", $listaCreadas);\n\t\t\t\t}\n\t\t\t\t//se tratan las notas que un usuario me ha compartido\n\t\t\t\t$usuarioMapper = new UsuarioMapper();\n\t\t\t\t$listaCompartidas=$this->NotaMapper->listShare($usuarioMapper->getIdByAlias($_SESSION[\"currentuser\"]));\n\t\t\t\tif ($listaCompartidas == NULL) {\n\t\t\t\t\t$this->view->setVariable(\"share\",\"You haven't posted any notes\");//se muestra que no hay notas publicadas\n\t\t\t\t}else{\n\t\t\t\t\t$this->view->setVariable(\"compartidas\",\"\");//no se muestra ningun mensaje\n\t\t\t\t\t$this->view->setVariable(\"listaCompartidas\", $listaCompartidas);\n\t\t\t\t}\n\t\t\t\t$this->view->render(\"notes\", \"listarNotas\");\n\t\t}\n\t}",
"public function publicacionesDestacadas(){\n return $this->publicaciones()->where('destacada', '=', '1')->orderBy('codigo_publicacion', 'desc');;\n }",
"function desconsilia_Movnulosbancos($ids,$idmov){\n\t$this->borraidsBancos($ids);\n\t$sql = $this->query(\"update bco_saldo_bancario set idDocumentos='', conciliadoBancos=0 where id=\".$idmov.\";\");\n}",
"private function processarNotificacoes() {\n\n /**\n * Objeto assunto e mensagem padrao\n */\n $oMensageriaLicenca = new MensageriaLicenca();\n\n /**\n * Define o sistema para mensageria, pelo nome do municipio\n * - db_config.munic\n */\n $oInstituicao = new Instituicao();\n $oPrefeitura = @$oInstituicao->getDadosPrefeitura();\n $sSistema = 'e-cidade.' . strtolower($oPrefeitura->getMunicipio());\n\n foreach ($this->aLicencas as $oLicenca) {\n\n $iCodigoLicencaEmpreendimento = $oLicenca->getSequencial();\n\n if ($oLicenca->getParecerTecnico()->getTipoLicenca()->getSequencial() != 3) {\n\n $iCodigoLicencaEmpreendimento = $oLicenca->getParecerTecnico()->getCodigoLicencaAnterior();\n if (is_null($iCodigoLicencaEmpreendimento)) {\n $iCodigoLicencaEmpreendimento = $oLicenca->getSequencial();\n }\n }\n\n $oDataVencimento = new DBDate( $oLicenca->getParecerTecnico()->getDataVencimento() );\n\n $aVariaveisLicenca = array(\n\n '[nome_emp]' => $oLicenca->getParecerTecnico()->getEmpreendimento()->getNome(),\n '[codigo_emp]' => $oLicenca->getParecerTecnico()->getEmpreendimento()->getSequencial(),\n '[numero]' => $iCodigoLicencaEmpreendimento,\n '[tipo]' => $oLicenca->getParecerTecnico()->getTipoLicenca()->getDescricao(),\n '[data]' => $oDataVencimento->getDate( DBDate::DATA_PTBR ),\n '[processo]' => $oLicenca->getParecerTecnico()->getProtProcesso()\n );\n\n\n $sAssuntoLicenca = strtr($oMensageriaLicenca->getAssunto(), $aVariaveisLicenca);\n $sMensagemLicenca = strtr($oMensageriaLicenca->getMensagem(), $aVariaveisLicenca);\n $oDBDateAtual = new DBDate(date('Y-m-d'));\n $iDiasVencimento = DBDate::calculaIntervaloEntreDatas(new DBDate($oLicenca->getParecerTecnico()->getDataVencimento()), $oDBDateAtual, 'd');\n $aDestinatarios = array();\n $aUsuarioNotificado = array();\n\n foreach ($this->aCodigoMensageriaLicencaUsuario as $iCodigoMensageriaLicencaUsuario) {\n\n $oMensageriaLicencaUsuario = MensageriaLicencaUsuarioRepository::getPorCodigo($iCodigoMensageriaLicencaUsuario);\n $oUsuarioSistema = $oMensageriaLicencaUsuario->getUsuario();\n\n /**\n * Dias para vencer maior que os dias configurados\n */\n if ($iDiasVencimento > $oMensageriaLicencaUsuario->getDias() ) {\n continue;\n }\n\n /**\n * Salva acordo como ja notificado para usuario e dia\n * mensagerialicencaprocessados\n */\n $this->salvarLicencaProcessado($iCodigoMensageriaLicencaUsuario, $oLicenca->getSequencial());\n\n /**\n * Usuario ja notificado com dia menor que o atual\n */\n if (in_array($oUsuarioSistema->getCodigo(), $aUsuarioNotificado)) {\n continue;\n }\n\n $aDestinatarios[] = array('sLogin' => $oUsuarioSistema->getLogin(), 'sSistema' => $sSistema);\n $aUsuarioNotificado[] = $oUsuarioSistema->getCodigo();\n }\n\n /**\n * Licenca sem usuarios para notificar\n */\n if (empty($aDestinatarios)) {\n continue;\n }\n\n $sAssunto = str_replace('[dias]', $iDiasVencimento, $sAssuntoLicenca);\n $sMensagem = str_replace('[dias]', $iDiasVencimento, $sMensagemLicenca);\n $this->enviarNotificacao($sAssunto, $sMensagem, $sSistema, $aDestinatarios);\n }\n\n return true;\n }",
"private function generaNotificaciones(){\n\t\t//obtenemos el nombre del alumno\n\t\t$al = new Alumno();\n\t\t$alumno = $al -> getAlumno($this->getIdAlumno());\n\t\t$nombreAlumno = ($alumno->getNombre()).\" \".($alumno->getApaterno()).\" \".($alumno.getAmaterno());\n\t\t//obtenemos todos los usuarios de STC:\n\t\t$this -> conectar();\n\t\t$query = \"SELECT id FROM SECRETARIA_TECNICA;\";\n\t\t$result = $this -> consulta($query);\n\t\t$this -> desconectar();\n\t\t//para cada uno generamos una notificación\n\t\twhile ($row = mysqli_fetch_assoc($result)) {\n\t\t\t$id_destinatario = $row['id'];\n\t\t\t$tipo_destinatario = \"STC\";\n\t\t\t$id_remitente = $this -> getIdAlumno();\n\t\t\t$tipo_remitente = \"ALUMNO\";\n\t\t\t$estado = \"sin revisar\";\n\t\t\t$tipo = \"actualización SRO\";\n\t\t\t$mensaje = $nombreAlumno.\" ha actualizado su Solicitud de Registro de Opción\";\n\t\t\t$notificacion = new Notificacion($id_destinatario,$tipo_destinatario,$id_remitente,$tipo_remitente,$estado,$tipo,$mensaje);\n\t\t\t$notificacion -> creaNotificacion();\n\t\t}\n\t\treturn true;\n\t}",
"function abonnements_optimiser_base_disparus($flux){\n\n\t//Offres d'abonnement à la poubelle\n\tsql_delete(\"spip_abonnements_offres\", \"statut='poubelle' AND maj < \".$flux['args']['date']);\n\n\t//Supprimer les abonnements lies à une offre d'abonnement inexistante\n\t$res = sql_select(\"DISTINCT abonnements.id_abonnements_offre\",\"spip_abonnements AS abonnements\n\t\t\t\t\t\tLEFT JOIN spip_abonnements_offres AS offres\n\t\t\t\t\t\tON abonnements.id_abonnements_offre=offres.id_abonnements_offre\",\"offres.id_abonnements_offre IS NULL\");\n\twhile ($row = sql_fetch($res))\n\t\tsql_delete(\"spip_abonnements\", \"id_abonnements_offre=\".$row['id_abonnements_offre']);\n\n\t//Abonnements à la poubelle\n\tsql_delete(\"spip_abonnements\", \"statut='poubelle' AND maj < \".$flux['args']['date']);\n\n\tinclude_spip('action/editer_liens');\n\t$flux['data'] += objet_optimiser_liens(array('abonnement'=>'*'),'*');\n\treturn $flux;\n}",
"public function publicaciones_no_vistas(){\n $codigo_suscripcion = $this->codigo_suscripcion;\n\n // obtener todas las publicaciones\n $publicaciones = $this->asignatura->publicaciones;\n\n // definir un arreglo para las publicaciones que no han sido vistas\n $publicacionesNoVistas = array();\n\n // recorrer la lista\n foreach($publicaciones as $publicacion){\n // obtener el estado de la Publicacion para esta Suscripcion\n $estadoSuscripcion = EstadoPublicacion::where('codigo_suscripcion', '=', $codigo_suscripcion)->where('codigo_publicacion', '=', $publicacion->codigo_publicacion)->first();\n // si no ha sido vista, agregar al arreglo\n if($estadoSuscripcion==null){\n array_push($publicacionesNoVistas, $publicacion);\n }\n }\n\n // retornar las publicaciones no vistas (de mas nuevas a mas antiguas)\n return array_reverse($publicacionesNoVistas);\n }",
"public function saveunsubscribers();",
"private function putDeputados()\n {\n \t$data = 'http://dadosabertos.almg.gov.br/ws/deputados/em_exercicio?formato=json';\n $data = json_decode(file_get_contents($data));\n $listOfDeputados = array();\n foreach($data as $deputados)//eliminar o objeto list\n {\n foreach($deputados as $deputado)//iterar na lista de deputados\n {\n $dt = [\n 'idDeputado' => $deputado->id,\n 'partido' => $deputado->partido,\n 'nome' => $deputado->nome\n ];\n $listOfDeputados[] = $deputado->id;\n Deputado::create($dt);\n }\n } \n\n $this->putVerbasIdenizatorias($listOfDeputados);\n }",
"function getDatosDetalladoDisponibilidad() {\n\t\t\n\t\t/* LISTA DE OBJETIVOS DEL GRAFICO */\n\t\tforeach (Utiles::getElementsByArrayTagName($this->dom, array(\"detalles\", \"detalle\")) as $detalle_obj) {\n\t\t\t$objetivo = & $this->__objetivos[$detalle_obj->getAttribute('objetivo_id')];\n\t\t\t\n\t\t\t/* LISTA DE MONITORES DEL OBJETIVO */\n\t\t\tforeach (Utiles::getElementsByArrayTagName($detalle_obj, array(\"detalles\", \"detalle\")) as $detalle_mon) {\n\t\t\t\tif (isset($this->__monitores[$detalle_mon->getAttribute('nodo_id')])) {\n\t\t\t\t\n\t\t\t\t$monitor = clone $this->__monitores[$detalle_mon->getAttribute('nodo_id')];\n\t\t\t\t\n\t\t\t\t/* LISTA DE PASOS DEL OBJETIVO POR MONITOR */\n\t\t\t\tforeach (Utiles::getElementsByArrayTagName($detalle_mon, array(\"detalles\", \"detalle\")) as $detalle_pas) {\n\t\t\t\t\tif (isset($objetivo->__pasos[$detalle_pas->getAttribute('paso_orden')])) {\n\t\t\t\t\t\t$paso = clone $objetivo->__pasos[$detalle_pas->getAttribute('paso_orden')];\n\t\t\t\t\t\t\n\t\t\t\t\t\t/* LISTA DE PORCENTAJES DE EVENTOS DEL PASO */\n\t\t\t\t\t\tforeach (Utiles::getElementsByArrayTagName($detalle_pas, array(\"estadisticas\", \"estadistica\")) as $dato_pas) {\n\t\t\t\t\t\t\t$this->tiene_datos = true;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif (isset($this->__eventos[$dato_pas->getAttribute('evento_id')])) {\n\t\t\t\t\t\t\t$evento = clone $this->__eventos[$dato_pas->getAttribute('evento_id')];\n\t\t\t\t\t\t\t$evento->porcentaje = $dato_pas->getAttribute('porcentaje');\n\t\t\t\t\t\t\t$evento->duracion = $dato_pas->getAttribute('duracion');\n\t\t\t\t\t\t\t$paso->__eventos[$evento->orden] = $evento;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tksort($paso->__eventos);\n\t\t\t\t\t\t$monitor->__pasos[] = $paso;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$objetivo->__monitores[$monitor->monitor_id] = $monitor;\n\t\t\t\t\n\t\t\t\t}\t\t\t\t\n\t\t\t}\n\t\t}\n\t}",
"function noizetier_obtenir_infos_noisettes_direct() {\n\t$liste_noisettes = array();\n\n\t$match = '[^-]*[.]html$';\n\t$liste = find_all_in_path('noisettes/', $match);\n\n\tif (count($liste)) {\n\t\tforeach ($liste as $squelette => $chemin) {\n\t\t\t$noisette = preg_replace(',[.]html$,i', '', $squelette);\n\t\t\t$dossier = str_replace($squelette, '', $chemin);\n\t\t\t// On ne garde que les squelettes ayant un fichier YAML de config\n\t\t\tif (file_exists(\"$dossier$noisette.yaml\")\n\t\t\t\tand ($infos_noisette = noizetier_charger_infos_noisette_yaml($dossier.$noisette))\n\t\t\t) {\n\t\t\t\t$liste_noisettes[$noisette] = $infos_noisette;\n\t\t\t}\n\t\t}\n\t}\n\n\t// supprimer de la liste les noisettes necessitant un plugin qui n'est pas actif.\n\t// On s'arrête au premier inactif.\n\tforeach ($liste_noisettes as $noisette => $infos_noisette) {\n\t\tif (!empty($infos_noisette['necessite'])) {\n\t\t\tforeach ($infos_noisette['necessite'] as $plugin) {\n\t\t\t\tif (!defined('_DIR_PLUGIN_'.strtoupper($plugin))) {\n\t\t\t\t\tunset($liste_noisettes[$noisette]);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn $liste_noisettes;\n}",
"public function clearNoticias()\n\t{\n\t\t$this->collNoticias = null; // important to set this to NULL since that means it is uninitialized\n\t}",
"function modification_droits(){\n\n//changer les capabilities du role administrator que nous utilisons pour\n//avoir acces au CPT News\n$role_administrateur = get_role( 'administrator' );\n$capabilities_admin = array(\n 'edit_new',\n 'read_new',\n 'delete_new',\n 'edit_news',\n 'edit_others_news',\n 'read_others_news',\n 'publish_news',\n 'publish_pages_news',\n 'read_private_news',\n 'create_private_news',\n 'edit_published_news',\n 'delete_published_news',\n 'delete_others_news',\n 'edit_private_news',\n 'delete_private_news',\n);\n//on parcours le tableau de capabilities que nous avons fixé\n//et on ajoute avec add_cap chaque capability pour avoir la possibilité d'ajouter\n//dans CPT News un post\nforeach( $capabilities_admin as $capabilitie_admin ) {\n\t$role_administrateur->add_cap( $capabilitie_admin );\n}\n\n}",
"function nettoyer_ante_jointures($mots_preced, $mots_base) {\n\tforeach($mots_base as $m) {\n\t\tif($mots_preced[$m]!=0) {\n\t\t\t# erase - articles\n\t\t\t$qa = sql_delete(\"spip_mots_articles\",\"id_mot=\"._q($mots_preced[$m]));\n\t\t\t# erase - posts\n\t\t\t// c: 6/12/8 select ???\n\t\t\t$qf = sql_select(\"id_forum\",\"spip_mots_forum\",\"id_mot=\"._q($mots_preced[$m]));\n\t\t}\n\t}\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Translates the response code into a more meaningful description. Response code descriptions are taken directly from the Payfort documentation. | function getResponseCodeDescription($responseCode) {
switch ($responseCode) {
case "0" : $result = "Invalid or incomplete";
break;
case "1" : $result = "Cancelled by customer";
break;
case "2" : $result = "Authorisation declined";
break;
case "5" : $result = "Authorised";
break;
case "9" : $result = "Payment requested";
break;
default : $result = "Response Unknown";
}
return $result;
} | [
"public static function getResponseCodeDescription($code)\n {\n \t$responseCode\t= DefaultConstant::getResponseCode();\n \t\n \treturn $responseCode[$code];\n }",
"public function getHTTPCodeDescription() {\n\t\t$code = $this->HTTPCode;\n\t\tif(empty($code)) {\n\t\t\t// Assume that $code = 0 means there was no response\n\t\t\t$description = _t('BrokenExternalLink.NOTAVAILABLE', 'Server Not Available');\n\t\t} elseif(\n\t\t\t($descriptions = Config::inst()->get('SS_HTTPResponse', 'status_codes'))\n\t\t\t&& isset($descriptions[$code])\n\t\t) {\n\t\t\t$description = $descriptions[$code];\n\t\t} else {\n\t\t\t$description = _t('BrokenExternalLink.UNKNOWNRESPONSE', 'Unknown Response Code');\n\t\t}\n\t\treturn sprintf(\"%d (%s)\", $code, $description);\n\t}",
"private function lookupResponseCode($code = null)\n {\n $responseCodes = array(\n '200' => '200: OK.',\n '201' => '201: The request has been accepted for processing, but the processing has not been completed.',\n '203' => '203: The server successfully processed the request, but is returning information that may be from another source.',\n '204' => '204: The server successfully processed the request, but is not returning any content.',\n '205' => '205: The server successfully processed the request, but is not returning any content. Requires the requester to reset the document view.',\n '206' => '206: The server is delivering only part of the resource due to a range header sent by the client.',\n '207' => '207: The message body that follows is an XML message and can contain a number of separate response codes.',\n '208' => '208: The members of a DAV binding have already been enumerated in a previous reply to this request, and are not being included again.',\n '226' => '226: The server has fulfilled a GET request for the resource, and the response is a representation of the result of one or more instance-manipulations applied to the current instance.',\n '300' => '300: Indicates multiple options for the resource that the client may follow.',\n '301' => '301: This and all future requests should be directed to the given URI.',\n '302' => '302: Required the client to perform a temporary redirect',\n '303' => '303: The response to the request can be found under another URI using a GET method.',\n '304' => '304: Indicates that the resource has not been modified since the version specified by the request headers If-Modified-Since or If-Match.',\n '305' => '305: The requested resource is only available through a proxy, whose address is provided in the response.',\n '307' => '307: The request should be repeated with another URI',\n '308' => '308: The request, and all future requests should be repeated using another URI.',\n '400' => '400: The request cannot be fulfilled due to bad syntax.',\n '401' => '401: Authentication faild.',\n '403' => '403: The request was a valid request, but the server is refusing to respond to it.',\n '404' => '404: The requested resource could not be found but may be available again in the future.',\n '405' => '405: A request was made of a resource using a request method not supported by that resource.',\n '406' => '406: The requested resource is only capable of generating content not acceptable according to the Accept headers sent in the request',\n '407' => '407: The client must first authenticate itself with the proxy.',\n '408' => '408: The server timed out waiting for the request.',\n '409' => '409: Indicates that the request could not be processed because of conflict in the request, such as an edit conflict in the case of multiple updates.',\n '410' => '410: Indicates that the resource requested is no longer available and will not be available again.',\n '411' => '411: The request did not specify the length of its content, which is required by the requested resource.',\n '412' => '412: The server does not meet one of the preconditions that the requester put on the request.',\n '413' => '413: The request is larger than the server is willing or able to process.',\n '414' => '414: The URI provided was too long for the server to process',\n '415' => '415: The request entity has a media type which the server or resource does not support.',\n '416' => '416: The client has asked for a portion of the file, but the server cannot supply that portion.',\n '417' => '417: The server cannot meet the requirements of the Expect request-header field.',\n '419' => '419: Authentication Timeout denotes that previously valid authentication has expired.',\n '422' => '422: The request was well-formed but was unable to be followed due to semantic errors',\n '423' => '423: The resource that is being accessed is locked.',\n '424' => '424: The request failed due to failure of a previous request',\n '426' => '426: The client should switch to a different protocol such as TLS/1.0',\n '428' => '428: The origin server requires the request to be conditional.',\n '429' => '429: The user has sent too many requests in a given amount of time.',\n '431' => '431: The server is unwilling to process the request because either an individual header field, or all the header fields collectively, are too large.',\n '440' => '440: Your session has expired.',\n '444' => '444: The server did not return any information to the client and close the connection.',\n '449' => '449: The request should be retried after performing the appropriate action.',\n '450' => '450: Windows Parental Controls are turned on and are blocking access to the given webpage.',\n '451' => '451: If there either is a more efficient server to use or the server cannot access the users\\' mailbox.',\n '500' => '500: Internal Server Error.',\n '501' => '501: The server either does not recognize the request method, or it lacks the ability to fulfill the request.',\n '502' => '502: The server was acting as a gateway or proxy and received an invalid response from the upstream server.',\n '503' => '503: The server is currently unavailable.',\n '504' => '504: The server was acting as a gateway or proxy and did not receive a timely response from the upstream server.',\n '505' => '505: The server does not support the HTTP protocol version used in the request.',\n '507' => '507: The server is unable to store the representation needed to complete the request.',\n '508' => '508: The server detected an infinite loop while processing the request.',\n '509' => '509: Bandwidth Limit Exceeded.',\n '510' => '510: Further extensions to the request are required for the server to fulfill it.',\n '511' => '511: The client needs to authenticate to gain network access.',\n '598' => '598: The network read timeout behind the proxy to a client in front of the proxy.',\n '599' => '599: Network connect timeout behind the proxy to a client in front of the proxy.',\n );\n\n if (!empty($responseCodes[$code])) {\n return $responseCodes[$code];\n }\n\n return false;\n }",
"public function getApiStatusCodeDescription($code) {\n if (isset(self::$status_code_descriptions[$code])) {\n return self::$status_code_descriptions[$code];\n }\n\n return \"Unknown\";\n }",
"function _uc_parsian_error_translate($code) {\n switch ($code) {\n case 20:\n case 22:\n return t('@code - Invalid PIN or IP.', array(\n '@code' => $code,\n ));\n\n case 30:\n return t('@code - The operation has been done previously.', array(\n '@code' => $code,\n ));\n\n case 34:\n return t('@code - Invalid transaction number.', array(\n '@code' => $code,\n ));\n\n default:\n return t('@code - Unknown status code. Refer to your technical documentation or contact Parsian bank support.', array(\n '@code' => $code,\n ));\n }\n}",
"function response_code_string($code = 200) {\n\t\t$codes = array (\n\t\t 100 => \"Continue\",\n\t\t 101 => \"Switching Protocols\",\n\t\t 200 => \"OK\",\n\t\t 201 => \"Created\",\n\t\t 202 => \"Accepted\",\n\t\t 203 => \"Non-Authoritative Information\",\n\t\t 204 => \"No Content\",\n\t\t 205 => \"Reset Content\",\n\t\t 206 => \"Partial Content\",\n\t\t 300 => \"Multiple Choices\",\n\t\t 301 => \"Moved Permanently\",\n\t\t 302 => \"Found\",\n\t\t 303 => \"See Other\",\n\t\t 304 => \"Not Modified\",\n\t\t 305 => \"Use Proxy\",\n\t\t 307 => \"Temporary Redirect\",\n\t\t 400 => \"Bad Request\",\n\t\t 401 => \"Unauthorized\",\n\t\t 402 => \"Payment Required\",\n\t\t 403 => \"Forbidden\",\n\t\t 404 => \"Not Found\",\n\t\t 405 => \"Method Not Allowed\",\n\t\t 406 => \"Not Acceptable\",\n\t\t 407 => \"Proxy Authentication Required\",\n\t\t 408 => \"Request Time-out\",\n\t\t 409 => \"Conflict\",\n\t\t 410 => \"Gone\",\n\t\t 411 => \"Length Required\",\n\t\t 412 => \"Precondition Failed\",\n\t\t 413 => \"Request Entity Too Large\",\n\t\t 414 => \"Request-URI Too Large\",\n\t\t 415 => \"Unsupported Media Type\",\n\t\t 416 => \"Requested range not satisfiable\",\n\t\t 417 => \"Expectation Failed\",\n\t\t 500 => \"Internal Server Error\",\n\t\t 501 => \"Not Implemented\",\n\t\t 502 => \"Bad Gateway\",\n\t\t 503 => \"Service Unavailable\",\n\t\t 504 => \"Gateway Time-out\"\n\t\t);\n\n if (isset($codes[$code])) {\n \treturn $code.' '.$codes[$code];\n\n } else {\n \treturn false;\n\n }\n\n\t}",
"public function getDeclineMessage(string $responseCode)\n {\n switch ($responseCode) {\n case '02':\n case '03':\n case '04':\n case '05':\n case '41':\n case '43':\n case '44':\n case '51':\n case '56':\n case '61':\n case '62':\n case '62':\n case '63':\n case '65':\n case '78':\n return 'The card was declined.';\n case '06':\n case '07':\n case '12':\n case '15':\n case '19':\n case '52':\n case '53':\n case '57':\n case '58':\n case '76':\n case '77':\n case '96':\n case 'EC':\n return 'An error occured while processing the card.';\n case '13':\n return 'Must be greater than or equal 0.';\n case '14':\n return 'The card number is incorrect.';\n case '54':\n return 'The card has expired.';\n case '55':\n return 'The pin is invalid.';\n case '75':\n return 'Maximum number of pin retries exceeded.';\n case '80':\n return 'Card expiration date is invalid.';\n case '86':\n return 'Can\\'t verify card pin number.';\n case '91':\n return 'The card issuer timed-out.';\n case 'EB':\n case 'N7':\n return 'The card\\'s security code is incorrect.';\n case 'FR':\n return 'Possible fraud detected.';\n default:\n return 'An error occurred while processing the card.';\n }\n }",
"public function getVerboseResponseStatus()\n\t{\n\t\t$code = (isset($this->raw['response']['statusCode'])) ? $this->raw['response']['statusCode'] : 200;\n\n\t\tswitch( $code ) \n\t\t{\n case 100: \n \t$text = 'Continue';\n break;\n case 101: \n \t$text = 'Switching Protocols';\n break;\n case 200: \n \t$text = 'OK';\n break;\n case 201: \n \t$text = 'Created';\n break;\n case 202: \n \t$text = 'Accepted';\n break;\n case 203: \n \t$text = 'Non-Authoritative Information';\n break;\n case 204: \n \t$text = 'No Content';\n break;\n case 205: \n \t$text = 'Reset Content';\n break;\n case 206: \n \t$text = 'Partial Content';\n break;\n case 300: \n \t$text = 'Multiple Choices';\n break;\n case 301: \n \t$text = 'Moved Permanently';\n break;\n case 302: \n \t$text = 'Moved Temporarily';\n break;\n case 303: \n \t$text = 'See Other';\n break;\n case 304: \n \t$text = 'Not Modified';\n break;\n case 305:\n \t$text = 'Use Proxy';\n break;\n case 400: \n \t$text = 'Bad Request';\n break;\n case 401: \n \t$text = 'Unauthorized';\n break;\n case 402: \n \t$text = 'Payment Required';\n break;\n case 403: \n \t$text = 'Forbidden';\n break;\n case 404: \n \t$text = 'Not Found';\n break;\n case 405: \n \t$text = 'Method Not Allowed';\n break;\n case 406: \n \t$text = 'Not Acceptable';\n break;\n case 407: \n \t$text = 'Proxy Authentication Required';\n break;\n case 408: \n \t$text = 'Request Time-out';\n break;\n case 409: \n \t$text = 'Conflict';\n break;\n case 410: \n \t$text = 'Gone';\n break;\n case 411: \n \t$text = 'Length Required';\n break;\n case 412: \n \t$text = 'Precondition Failed';\n break;\n case 413: \n \t$text = 'Request Entity Too Large';\n break;\n case 414:\n \t$text = 'Request-URI Too Large';\n break;\n case 415: \n \t$text = 'Unsupported Media Type';\n break;\n case 500: \n \t$text = 'Internal Server Error';\n break;\n case 501: \n \t$text = 'Not Implemented';\n break;\n case 502: \n \t$text = 'Bad Gateway';\n break;\n case 503: \n \t$text = 'Service Unavailable';\n break;\n case 504: \n \t$text = 'Gateway Time-out';\n break;\n case 505: \n \t$text = 'HTTP Version not supported';\n break;\n default:\n $text = 'Unknown Status';\n break;\n }\n\n return $code.' - '.$text;\n\t}",
"protected function getHTTPResponceTextByCode($code) {\n $text = '';\n switch ($code) {\n case 100: $text = 'Continue'; break;\n case 101: $text = 'Switching Protocols'; break;\n case 200: $text = 'OK'; break;\n case 201: $text = 'Created'; break;\n case 202: $text = 'Accepted'; break;\n case 203: $text = 'Non-Authoritative Information'; break;\n case 204: $text = 'No Content'; break;\n case 205: $text = 'Reset Content'; break;\n case 206: $text = 'Partial Content'; break;\n case 300: $text = 'Multiple Choices'; break;\n case 301: $text = 'Moved Permanently'; break;\n case 302: $text = 'Moved Temporarily'; break;\n case 303: $text = 'See Other'; break;\n case 304: $text = 'Not Modified'; break;\n case 305: $text = 'Use Proxy'; break;\n case 400: $text = 'Bad Request'; break;\n case 401: $text = 'Unauthorized'; break;\n case 402: $text = 'Payment Required'; break;\n case 403: $text = 'Forbidden'; break;\n case 404: $text = 'Not Found'; break;\n case 405: $text = 'Method Not Allowed'; break;\n case 406: $text = 'Not Acceptable'; break;\n case 407: $text = 'Proxy Authentication Required'; break;\n case 408: $text = 'Request Time-out'; break;\n case 409: $text = 'Conflict'; break;\n case 410: $text = 'Gone'; break;\n case 411: $text = 'Length Required'; break;\n case 412: $text = 'Precondition Failed'; break;\n case 413: $text = 'Request Entity Too Large'; break;\n case 414: $text = 'Request-URI Too Large'; break;\n case 415: $text = 'Unsupported Media Type'; break;\n case 500: $text = 'Internal Server Error'; break;\n case 501: $text = 'Not Implemented'; break;\n case 502: $text = 'Bad Gateway'; break;\n case 503: $text = 'Service Unavailable'; break;\n case 504: $text = 'Gateway Time-out'; break;\n case 505: $text = 'HTTP Version not supported'; break;\n default: break;\n }\n return $text;\n }",
"public function getHttpCodeDescription(int $code): string\n {\n if (true === isset($this->codes[$code])) {\n return sprintf('%d (%s)', $code, $this->codes[$code]);\n } else {\n return sprintf('%d (Undefined code)', $code);\n }\n }",
"function getIssuerResponseDescription($acqResponseCode) \n {\n switch ($acqResponseCode) {\n case \"00\" : $result = \"Approved\"; break;\n case \"01\" : $result = \"Refer to Card Issuer\"; break;\n case \"02\" : $result = \"Refer to Card Issuer\"; break;\n case \"03\" : $result = \"Invalid Merchant\"; break;\n case \"04\" : $result = \"Pick Up Card\"; break;\n case \"05\" : $result = \"Do Not Honor\"; break;\n case \"07\" : $result = \"Pick Up Card\"; break;\n case \"12\" : $result = \"Invalid Transaction\"; break;\n case \"14\" : $result = \"Invalid Card Number (No such Number)\"; break;\n case \"15\" : $result = \"No Such Issuer\"; break;\n case \"33\" : $result = \"Expired Card\"; break;\n case \"34\" : $result = \"Suspected Fraud\"; break;\n case \"36\" : $result = \"Restricted Card\"; break;\n case \"39\" : $result = \"No Credit Account\"; break;\n case \"41\" : $result = \"Card Reported Lost\"; break;\n case \"43\" : $result = \"Stolen Card\"; break;\n case \"51\" : $result = \"Insufficient Funds\"; break;\n case \"54\" : $result = \"Expired Card\"; break;\n case \"57\" : $result = \"Transaction Not Permitted\"; break;\n case \"59\" : $result = \"Suspected Fraud\"; break;\n case \"62\" : $result = \"Restricted Card\"; break;\n case \"65\" : $result = \"Exceeds withdrawal frequency limit\"; break;\n case \"91\" : $result = \"Cannot Contact Issuer\"; break;\n\n default : $result = \"Unable to be determined\"; \n }\n return $result;\n }",
"public function getAVSResponseCode();",
"public function displayResponseCode($response): int\n {\n // Verify that the API returned a 200 http code\n if (in_array($response->code, VALID_CODES, true)) {\n // Format some nice JSON\n $json = json_encode((object)['code' => $response->code], JSON_PRETTY_PRINT);\n // Print the json\n $this->info($json);\n return 0;\n } else {\n // Throw an exception if we did not get 200 back\n // display the http code with the message from the API.\n $json = json_encode((object)['code' => $response->code], JSON_PRETTY_PRINT);\n $this->error($json);\n return intval($response->code);\n }\n }",
"public static function explainReasonCode($code)\n {\n switch ($code) {\n case 'chargeback':\n return Mage::helper('payment')->__('Chargeback by customer.');\n case 'guarantee':\n return Mage::helper('payment')->__('Customer triggered a money-back guarantee.');\n case 'buyer-complaint':\n return Mage::helper('payment')->__('Customer complaint.');\n case 'refund':\n return Mage::helper('payment')->__('Refund issued by merchant.');\n case 'adjustment_reversal':\n return Mage::helper('payment')->__('Reversal of an adjustment.');\n case 'chargeback_reimbursement':\n return Mage::helper('payment')->__('Reimbursement for a chargeback.');\n case 'chargeback_settlement':\n return Mage::helper('payment')->__('Settlement of a chargeback.');\n case 'none': // break is intentionally omitted\n case 'other':\n default:\n return Mage::helper('payment')->__('Unknown reason. Please contact Viva customer service.');\n }\n }",
"public function getResponseStatusDesc() {\n\t\t$desc = array(\"100\"=>\"Continue\", \"101\"=>\"Switching Protocols\", \"200\"=>\"OK\", \"201\"=>\"Created\", \"202\"=>\"Accepted\", \"203\"=>\"Non-Authoritative Information\", \"204\"=>\"No Content\", \"205\"=>\"Reset Content\", \"206\"=>\"Partial Content\", \"300\"=>\"Multiple Choices\", \"301\"=>\"Moved Permanently\", \"302\"=>\"Found\", \"303\"=>\"See Other\", \"304\"=>\"Not Modified\", \"305\"=>\"Use Proxy\", \"307\"=>\"Temporary Redirect\", \"400\"=>\"Bad Request\", \"401\"=>\"Unauthorized\", \"402\"=>\"Payment Required\", \"403\"=>\"Forbidden\", \"404\"=>\"Not Found\", \"405\"=>\"Method Not Allowed\", \"406\"=>\"Not Acceptable\", \"407\"=>\"Proxy Authentication Required\", \"408\"=>\"Request Timeout\", \"409\"=>\"Conflict\", \"410\"=>\"Gone\", \"411\"=>\"Length Required\", \"412\"=>\"Precondition Failed\", \"413\"=>\"Request Entity Too Large\", \"414\"=>\"Request-URI Too Long\", \"415\"=>\"Unsupported Media Type\", \"416\"=>\"Requested Range Not Satisfiable\", \"417\"=>\"Expectation Failed\", \"500\"=>\"Internal Server Error\", \"501\"=>\"Not Implemented\", \"502\"=>\"Bad Gateway\", \"503\"=>\"Service Unavailable\", \"504\"=>\"Gateway Timeout\", \"505\"=>\"HTTP Version Not Supported\");\n\t\treturn isset($desc[$this->statuscode]) ? $desc[$this->statuscode] : null;\n\n\t}",
"static public function getDescription($in_code) {\r\n switch ($in_code) {\r\n case self::HTTP_CONTINUE: { return \"See [RFC7231, Section 6.2.1]\"; }\r\n case self::HTTP_SWITCHING_PROTOCOLS: { return \"See [RFC7231, Section 6.2.2]\"; }\r\n case self::HTTP_PROCESSING: { return \"See [RFC2518]\"; }\r\n case self::HTTP_EARLY_HINTS: { return \"See [RFC8297]\"; }\r\n case self::HTTP_OK: { return \"See [RFC7231, Section 6.3.1]\"; }\r\n case self::HTTP_CREATED: { return \"See [RFC7231, Section 6.3.2]\"; }\r\n case self::HTTP_ACCEPTED: { return \"See [RFC7231, Section 6.3.3]\"; }\r\n case self::HTTP_NON_AUTHORITATIVE_INFORMATION: { return \"See [RFC7231, Section 6.3.4]\"; }\r\n case self::HTTP_NO_CONTENT: { return \"See [RFC7231, Section 6.3.5]\"; }\r\n case self::HTTP_RESET_CONTENT: { return \"See [RFC7231, Section 6.3.6]\"; }\r\n case self::HTTP_PARTIAL_CONTENT: { return \"See [RFC7233, Section 4.1]\"; }\r\n case self::HTTP_MULTI_STATUS: { return \"See [RFC4918]\"; }\r\n case self::HTTP_ALREADY_REPORTED: { return \"See [RFC5842]\"; }\r\n case self::HTTP_IM_USED: { return \"See [RFC3229]\"; }\r\n case self::HTTP_MULTIPLE_CHOICES: { return \"See [RFC7231, Section 6.4.1]\"; }\r\n case self::HTTP_MOVED_PERMANENTLY: { return \"See [RFC7231, Section 6.4.2]\"; }\r\n case self::HTTP_FOUND: { return \"See [RFC7231, Section 6.4.3]\"; }\r\n case self::HTTP_SEE_OTHER: { return \"See [RFC7231, Section 6.4.4]\"; }\r\n case self::HTTP_NOT_MODIFIED: { return \"See [RFC7232, Section 4.1]\"; }\r\n case self::HTTP_USE_PROXY: { return \"See [RFC7231, Section 6.4.5]\"; }\r\n case self::HTTP_UNUSED: { return \"See [RFC7231, Section 6.4.6]\"; }\r\n case self::HTTP_TEMPORARY_REDIRECT: { return \"See [RFC7231, Section 6.4.7]\"; }\r\n case self::HTTP_PERMANENT_REDIRECT: { return \"See [RFC7538]\"; }\r\n case self::HTTP_BAD_REQUEST: { return \"See [RFC7231, Section 6.5.1]\"; }\r\n case self::HTTP_UNAUTHORIZED: { return \"See [RFC7235, Section 3.1]\"; }\r\n case self::HTTP_PAYMENT_REQUIRED: { return \"See [RFC7231, Section 6.5.2]\"; }\r\n case self::HTTP_FORBIDDEN: { return \"See [RFC7231, Section 6.5.3]\"; }\r\n case self::HTTP_NOT_FOUND: { return \"See [RFC7231, Section 6.5.4]\"; }\r\n case self::HTTP_METHOD_NOT_ALLOWED: { return \"See [RFC7231, Section 6.5.5]\"; }\r\n case self::HTTP_NOT_ACCEPTABLE: { return \"See [RFC7231, Section 6.5.6]\"; }\r\n case self::HTTP_PROXY_AUTHENTICATION_REQUIRED: { return \"See [RFC7235, Section 3.2]\"; }\r\n case self::HTTP_REQUEST_TIMEOUT: { return \"See [RFC7231, Section 6.5.7]\"; }\r\n case self::HTTP_CONFLICT: { return \"See [RFC7231, Section 6.5.8]\"; }\r\n case self::HTTP_GONE: { return \"See [RFC7231, Section 6.5.9]\"; }\r\n case self::HTTP_LENGTH_REQUIRED: { return \"See [RFC7231, Section 6.5.10]\"; }\r\n case self::HTTP_PRECONDITION_FAILED: { return \"See [RFC7232, Section 4.2][RFC8144, Section 3.2]\"; }\r\n case self::HTTP_PAYLOAD_TOO_LARGE: { return \"See [RFC7231, Section 6.5.11]\"; }\r\n case self::HTTP_URI_TOO_LONG: { return \"See [RFC7231, Section 6.5.12]\"; }\r\n case self::HTTP_UNSUPPORTED_MEDIA_TYPE: { return \"See [RFC7231, Section 6.5.13][RFC7694, Section 3]\"; }\r\n case self::HTTP_RANGE_NOT_SATISFIABLE: { return \"See [RFC7233, Section 4.4]\"; }\r\n case self::HTTP_EXPECTATION_FAILED: { return \"See [RFC7231, Section 6.5.14]\"; }\r\n case self::HTTP_MISDIRECTED_REQUEST: { return \"See [RFC7540, Section 9.1.2]\"; }\r\n case self::HTTP_UNPROCESSABLE_ENTITY: { return \"See [RFC4918]\"; }\r\n case self::HTTP_LOCKED: { return \"See [RFC4918]\"; }\r\n case self::HTTP_FAILED_DEPENDENCY: { return \"See [RFC4918]\"; }\r\n case self::HTTP_TOO_EARLY: { return \"See [RFC8470]\"; }\r\n case self::HTTP_UPGRADE_REQUIRED: { return \"See [RFC7231, Section 6.5.15]\"; }\r\n case self::HTTP_PRECONDITION_REQUIRED: { return \"See [RFC6585]\"; }\r\n case self::HTTP_TOO_MANY_REQUESTS: { return \"See [RFC6585]\"; }\r\n case self::HTTP_REQUEST_HEADER_FIELDS_TOO_LARGE: { return \"See [RFC6585]\"; }\r\n case self::HTTP_UNAVAILABLE_FOR_LEGAL_REASONS: { return \"See [RFC7725]\"; }\r\n case self::HTTP_INTERNAL_SERVER_ERROR: { return \"See [RFC7231, Section 6.6.1]\"; }\r\n case self::HTTP_NOT_IMPLEMENTED: { return \"See [RFC7231, Section 6.6.2]\"; }\r\n case self::HTTP_BAD_GATEWAY: { return \"See [RFC7231, Section 6.6.3]\"; }\r\n case self::HTTP_SERVICE_UNAVAILABLE: { return \"See [RFC7231, Section 6.6.4]\"; }\r\n case self::HTTP_GATEWAY_TIMEOUT: { return \"See [RFC7231, Section 6.6.5]\"; }\r\n case self::HTTP_HTTP_VERSION_NOT_SUPPORTED: { return \"See [RFC7231, Section 6.6.6]\"; }\r\n case self::HTTP_VARIANT_ALSO_NEGOTIATES: { return \"See [RFC2295]\"; }\r\n case self::HTTP_INSUFFICIENT_STORAGE: { return \"See [RFC4918]\"; }\r\n case self::HTTP_LOOP_DETECTED: { return \"See [RFC5842]\"; }\r\n case self::HTTP_NOT_EXTENDED: { return \"See [RFC2774]\"; }\r\n case self::HTTP_NETWORK_AUTHENTICATION_REQUIRED: { return \"See [RFC6585]\"; }\r\n }\r\n return \"There is no description for this HTTP status code. See https://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml\";\r\n }",
"function getCardCodeResponseText ( $cvs_code ) {\n // if ($this->debug) echo \"CVS Code: $cvs_code\\n\";\n\n switch( $cvs_code ) {\n case \"M\":\n return \"Match\";\n break;\n case \"N\":\n return \"No Match\";\n break;\n case \"P\":\n return \"Not Processed\";\n break;\n case \"S\":\n return \"Should Have Been Present\";\n break;\n case \"U\":\n return \"Issuer Unable To Process Request\";\n break;\n }\n }",
"private function getResponseReason($code) {\r\n $status = array( \r\n 200 => 'OK',\r\n 404 => 'Not Found', \r\n 405 => 'Method Not Allowed',\r\n 500 => 'Internal Server Error',\r\n ); \r\n return ($status[$code])?$status[$code]:$status[500]; \r\n }",
"protected function serializeResponseCodes()\n {\n $template = '<ResponseCode>%s</ResponseCode>'\n\t . '<AuthorizationResponseCode>%s</AuthorizationResponseCode>'\n . '<BankAuthorizationCode>%s</BankAuthorizationCode>'\n . '<CVV2ResponseCode>%s</CVV2ResponseCode>'\n . '<AVSResponseCode>%s</AVSResponseCode>';\n return sprintf(\n $template,\n\t $this->xmlEncode($this->getRiskResponseCode()),\n $this->xmlEncode($this->getAuthorizationResponseCode()),\n $this->xmlEncode($this->getBankAuthorizationCode()),\n $this->xmlEncode($this->getCVV2ResponseCode()),\n $this->xmlEncode($this->getAVSResponseCode())\n );\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Remove arquivo de Lock. | public function removerArquivoLock() {
unlink($this->sCaminhoArquivoLock);
} | [
"public function removeLockFile() {\n\t\tunlink($this->__lockFile);\n\t}",
"private function deleteLockFile()\n {\n $this->stdout(\"* Delete the install lock file.\\n\", Console::FG_GREEN);\n $this->getInstaller()->unLock();\n }",
"function clearFileLock()\n{\n ftruncate($GLOBALS['lock_file'], 0);\n flock($GLOBALS['lock_file'], LOCK_UN);\n}",
"private function processUnlock()\n {\n $lockfile = $this->lockFileStr();\n unlink($lockfile);\n }",
"function removeLockFile($file=null){\n $lockFile = ($file!='') ? $file : LOCKFILE;\n if(file_exists($lockFile))\n unlink($lockFile);\n}",
"function clear() {\n\t\tflock($this->fp, LOCK_EX) or die('Failed to get lock');\n\t\tftruncate($this->fp, 0);\n\t\tflock($this->fp, LOCK_UN);\n\t}",
"protected function releaseLock()\n {\n clearstatcache();\n if(file_exists($this->temp_file) && !filesize($this->temp_file))\n unlink($this->temp_file);\n \n // this releases the lock implicitly\n if($this->file_handle)\n fclose($this->file_handle);\n }",
"private static function realUnlock()\n {\n clearstatcache();\n if (file_exists(self::$lockFilePath) && trim(file_get_contents(self::$lockFilePath)) == getmypid()) {\n @unlink(self::$lockFilePath);\n }\n }",
"static function delete ($lock)\n\t\t{\n\t\t$lockfile = config ('path.storage') . '/locks/' . $lock . '.lock';\n\n\t\tif (unlink ($lockfile) === false)\n\t\t\t{\n\t\t\tthrow new error (\"Unable to delete lock file: {$lockfile}\");\n\t\t\t}\n\t\t\n\t\tlog::debug (\"Deleted the lock file named '{$lock}'\");\n\t\t}",
"public function removeLock($uri);",
"protected function removeMutex()\n {\n if ($this->description) {\n @unlink($this->mutexPath());\n }\n }",
"public function unlock()\n\t{\n\t\tif (file_exists(PHPFOX_DIR_CACHE . 'cache.lock'))\n\t\t{\n\t\t\tunlink(PHPFOX_DIR_CACHE . 'cache.lock');\n\t\t}\n\t}",
"public function close() {\r\n\t\t@fclose($this->file);\r\n\t\tif(is_file($this->lockfile)) { unlink($this->lockfile); }\r\n\t}",
"public function removeFile();",
"protected function freeExclusiveLock()\n {\n if ($this->exclusiveLockFile)\n {\n fsOverseerTools::freeExclusiveLock($this->exclusiveLockFile);\n }\n }",
"public function del() {\n sem_acquire($this->__mutex); //block until released\n @shm_remove_var($this->__shm, $this->__key);\n sem_release($this->__mutex); //release mutex\n }",
"function unlockCacheObject ()\n {\n return unlink($this->cacheObjectId.'.lock');\n }",
"public static function deleteTaskLocks() {\n $tasks_lock_dir = APPPATH . 'tmp' . DS;\n $dh = opendir($tasks_lock_dir);\n while (false !== ($filename = readdir($dh))) {\n $is_task_temp_file = is_file($tasks_lock_dir . $filename) && \\Lib\\Str::startsWith($filename, 'tasks_');\n if (!$is_task_temp_file) {\n continue;\n }\n @unlink($tasks_lock_dir . $filename);\n }\n }",
"public function unlock(): void\n {\n if (null !== $this->lockFileNames) {\n foreach ($this->lockFileNames as $lockFileName) {\n $this->fileLockManager->releaseLock($lockFileName);\n }\n $this->lockFileNames = null;\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Lists all WallPost entities on user wall. | public function indexAction()
{
$securityContext = $this->container->get('security.context');
if($securityContext->isGranted('ROLE_USER')){
$user = $securityContext->getToken()->getUser();
$em = $this->getDoctrine()->getManager();
$yourPosts = array();
$allPosts = array();
$wall = $user->getWall();
$repo = $em->getRepository('BloggerWallBundle:WallPost');
$yourPosts = $repo->findBy(
array('wall' => $wall,
'user' => $user),
array('date' => 'DESC')
);
$allPosts = $repo->findBy(
array('wall' => $wall),
array('date' => 'DESC')
);
foreach ($allPosts as $post) {
$post->form = $this->createDeleteForm($post)->createView();
}
return $this->render('wallpost/index.html.twig', array(
'wall_name' => 'Your wall',
'id' => $wall->getId(),
'all_posts' => $allPosts,
'your_posts' => $yourPosts
));
} else {
throw new AccessDeniedException();
}
} | [
"public function display_wall_posts()\n {\n \n }",
"public function getWalls(){\n\t\treturn $this->get(\"/wall\");\n\t}",
"public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $currentUser = $this->get('security.token_storage')->getToken()->getUser();\n $walls = $em->getRepository('WallBundle:wall')->findBy(array('user' => $currentUser->getId()));\n\n return $this->render('wall/index.html.twig', array(\n 'walls' => $walls,\n ));\n }",
"public function getWall()\n {\n return $this->hasMany('Apps\\ActiveRecord\\WallPost', 'target_id');\n }",
"function getAndStoreWallPosts($howManyWeeksBack, $facebook, $db) {\n // Get userId.\n $userId = $facebook->getUser();\n\n // set the wall posts as present in the database.\n $hashedUserId = hash('sha512', $userId);\n setWallPostsAsPresent($hashedUserId, $db);\n\n // get earliest date to start from\n $earliestDate = strtotime('-'. $howManyWeeksBack .' week', time());\n \n try {\n // Get all the posts.\n $posts = array();\n \n $postsFinished = 0;\n $offset = 0;\n $timeToStepFrom = time();\n\n // Get all the threads from the inbox\n while (!$postsFinished) {\n $fql = 'SELECT type, post_id, actor_id, tagged_ids, share_count, like_info, is_hidden, is_published, comment_info, attribution, attachment, created_time\n from stream where source_id=me() and created_time < ' . $timeToStepFrom . '\n LIMIT 10000';\n $ret_obj = $facebook->api(array(\n 'method' => 'fql.query',\n 'query' => $fql,\n ));\n\n usleep(2.0 * 1000000); // sleep for two seconds.\n\n // go through each post and return\n $lastTime;\n\n // go through each returned item in the stream and check if it is a post.\n foreach ($ret_obj as $index => $post) {\n if ($post['created_time'] < $earliestDate) {\n $postsFinished = 1;\n break;\n }\n else if ($post['type'] == 46 || $post['type'] == 247 || $post['type'] == 128 || $post['type'] == 56 || $post['type'] == 308) {\n // post types: 46 - status, 247 - picture post, 128 - video posted, 56 - post on wall from other user, 308 - post in group.\n $posts[] = $post;\n }\n\n // keep track of the last time in the stream.\n $lastTime = $post['created_time'];\n }\n\n $timeToStepFrom = $lastTime;\n }\n\n // now that we have posts, store them.\n foreach ($posts as $index => $post) {\n $stmt = $db->prepare(\"INSERT INTO facebook_wall_posts (type, post_id, created_time, like_count, attribution, comment_count, is_hidden, is_published, has_attachment)\n VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)\");\n $postType = $post['type'];\n $postId = hash('sha512', $post['post_id']);\n $createdTime = $post['created_time'];\n $likeCount = $post['like_info']['like_count'];\n $attribution = \"\";\n if ($post['attribution'] != null) {\n $attribution = hash('sha512', $post['attribution']);\n }\n $commentCount = $post['comment_info']['comment_count'];\n // whether the post is hidden.\n $isHidden = 0;\n if ($post['is_hidden'] != null) {\n $isHidden = 1;\n }\n // whether the post is published.\n $isPublished = 0;\n if ($post['is_published'] != null) {\n $isPublished = 1;\n }\n $hasAttachment = 1;\n // get whether or not the post has an attachment.\n if (empty($post['attachment'])) {\n $hasAttachment = 0;\n }\n\n // bind each param, and perform the insert.\n $stmt->bind_param('issisiiii', $postType, $postId, $createdTime, $likeCount, $attribution, $commentCount, $isHidden, $isPublished, $hasAttachment);\n if (!$stmt->execute()) {\n echo '<br />Statement failed :(<br />';\n }\n $stmt->close();\n }\n }\n catch (FacebookApiException $e) {\n error_log($e);\n print_r($e);\n }\n}",
"public function posts() {\n\t\tif (!$this->user->loggedIn) {\n\t\t\tself::redirect_to('user#login');\n\t\t}\n\n\t\t$status = isset($this->params[0]) ? $this->params[0] : false;\n\n\t\t$posts = Post::find_all_by('author', $this->user->get('id'), 'DESC');\n\n\t\t$view = new View('user#posts', 'My Posts');\n\t\t$view->set('user', $this->user);\n\t\t$view->set('status', $status);\n\t\t$view->set('posts', $posts);\n\t\t$view->render();\n\t}",
"public function walls()\n {\n return $this->belongsToMany(Wall::class);\n }",
"public function cms_get_user_posts()\n\t{\n\t\treturn $this->posts->find_all();\n\t}",
"public function getAllPosts();",
"public function show(Request $request, $id)\n\t{\n\t\t$wall = Wall::findOrFail($id);\n\n\t\t//404 als wall verwijderd is\n\t\tif ($wall->deleted_at != null)\n\t\t{\n\t\t\tabort(404);\n\t\t}\n\n\t\t//als er een einddatum is ingesteld en verstreken --> 404\n\t\tif ($wall->open_until != null)\n\t\t{\n\t\t\tif ($wall->open_until < date('Y-m-d H:i:s'))\n\t\t\t{\n\t\t\t\tabort(404);\n\t\t\t}\n\t\t}\n\n\t\t//Check of de wall in walls_list session variable zit\n\t\tif($wall->password != null){\n\t\t\tif ($wall->id != session('wall_id')){\n\t\t\t\treturn redirect()->action('WallController@index')->with(\"error\", \"You must provide a password before you can access this wall.\");\n\t\t\t}\n\t\t}\n\n\t\tif ($wall != null)\n\t\t{\n\t\t\t//Check for tweets\n\t\t\t//if ($wall->hashtag != null){\n\t\t\t//\tTwitterHelper::checkForTweets($wall->hashtag, $id);\n\t\t\t//}\n\n\t\t\t$posts = $this->getMessagesPollsChronologically($id);\n\t\t\t//$posts = $this->getMessagesPollsSortedOnVotes($id);\n\n\t\t\t//BEGIN CODE FOR PAGINATION\n\t\t\t//Source: https://laracasts.com/discuss/channels/laravel/laravel-pagination-not-working-with-array-instead-of-collection\n\n\t\t\t$page = Input::get('page', 1); // Get the current page or default to 1, this is what you miss!\n\t\t\t$perPage = 10;\n\t\t\t$offset = ($page * $perPage) - $perPage;\n\n\t\t\t$request = new Request();\n\n\t\t\t$posts = new LengthAwarePaginator(array_slice($posts, $offset, $perPage, true), count($posts), $perPage, $page, ['path' => $request->url(), 'query' => $request->query()]);\n\n\t\t\t//END CODE FOR Pagination\n\n\t\t\treturn view('wall.show')->with('posts', $posts)->with('wall', $wall);\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn redirect()->action('WallController@index')->with(\"error\", \"No password was provided.\");\n\t\t}\n\t}",
"public function listAction()\n {\n $limit = isset($_GET['limit']) ? (int)$_GET['limit'] : PostDB::LIMIT;\n $offset = isset($_GET['offset']) ? (int)$_GET['offset'] : 0;\n\n return $this->render([\n 'posts' => $this->model->fetchList($limit, $offset),\n 'limit' => $limit,\n 'offset' => $offset,\n 'totalPosts' => $this->model->count(),\n 'alert' => $this->getAlerts(['post_created', 'post_deleted', 'post_updated'])\n ]);\n }",
"public function actionIndex()\n {\n $searchModel = new WallpapersSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }",
"public function index()\n {\n\n $connects = Connect::connections();\n\n if ($connects->isEmpty()) {\n return new MomentCollection(request()->user()->posts->where('type', 'Moment'));\n }\n\n return new MomentCollection(\n Post::where('type', 'Moment')->whereIn('user_id', [$connects->pluck('user_id'), $connects->pluck('connect_id')])\n ->get()\n );\n\n }",
"public function listAction()\n {\n $postManager = new PostManager();\n $posts = $postManager->getAllPosts();\n $this->render('Post/list.html.twig', ['posts' => $posts]);\n }",
"public function show_all()\n {\n //get the repository of Post entity\n $repository = $this->getDoctrine()->getRepository(Post::class);\n\n $all_post = $repository->findAll();\n\n $user = $this->getUser();\n\n return $this->render(\"Blog\\all_post.html.twig\", ['all' => $all_post,'user' => $user]);\n }",
"function getWallPost($aEvent){\r\n $languages = $this->getAlertLanguages('wall');\r\n $sTextAction = _t($languages[$aEvent['action']]);\r\n $sTextWallObject = 'test wall object';\r\n // check for the ownership\r\n if (!($aProfile = getProfileInfo($aEvent['owner_id']))){\r\n return '';\r\n }\r\n // check for the correct data entry\r\n if (!($aDataEntry = $this->_oDb->getEntryByIdAndOwner ($aEvent['object_id'], $aEvent['owner_id'], 0))){\r\n return '';\r\n }\r\n $sCss = ''; \r\n if($aEvent['js_mode']){\r\n $sCss = $this->_oTemplate->addCss('wall_post.css', true);\r\n }else{\r\n $this->_oTemplate->addCss('wall_post.css');\r\n }\r\n $aVars = array(\r\n 'cpt_user_name' => $aProfile['NickName'],\r\n 'cpt_action' => $sTextAction,\r\n 'cpt_object' => $sTextWallObject,\r\n 'cpt_item_url' => BX_DOL_URL_ROOT . $this->_oConfig->getBaseUri() . 'view/' . $aDataEntry[$this->_oDb->_sFieldUri],\r\n 'post_id' => $aEvent['id'],\r\n );\r\n return array(\r\n 'title' => $aProfile['username'] . ' ' . $sTextAction . ' ' . $sTextWallObject,\r\n 'description' => 'test description', // $aDataEntry[$this->_oDb->_sFieldDesc],\r\n 'content' => $sCss . $this->_oTemplate->parseHtmlByName('wall_post', $aVars)\r\n );\r\n }",
"public function get_user_posts() {\n\n // Verify if access token is valid\n $user_id = rest_verify_token(array('user_posts'));\n \n // Get page's input\n $page = $this->CI->input->get('page', TRUE);\n \n // Get limit's input\n $limit = $this->CI->input->get('limit', TRUE);\n \n // Verify if limit exists\n if ( $limit && $limit < 101 ) {\n \n $display_limit = $limit;\n \n } else {\n \n $display_limit = 10;\n \n }\n \n // Verify if page exists exists\n if ( !is_numeric($page) || !$page ) {\n $page = 0;\n } else {\n $page--;\n }\n\n // Get total posts\n $total = $this->CI->posts_model->get_posts($user_id, '', '', '');\n\n // Get posts by page\n $get_posts = $this->CI->posts_model->get_posts($user_id, ($page * $display_limit), $display_limit, '');\n \n // Verify if posts exists\n if ( $get_posts ) {\n \n $all_posts = array();\n \n foreach ( $get_posts as $post ) {\n \n if ( get_user_option('settings_display_groups') && $post->status != '1' ) {\n\n if ( is_numeric( $post->category ) ) {\n\n // Load the lists model\n $this->CI->load->ext_model( MIDRUB_BASE_USER_APPS_POSTS . 'models/', 'Lists_model', 'lists_model' );\n\n // Get social networks\n $group_metas = $this->CI->lists_model->get_lists_meta( $post->user_id, $post->category );\n\n $networks = array();\n\n if ( $group_metas ) {\n\n foreach ( $group_metas as $meta ) {\n\n $array_meta = (array)$meta;\n $array_meta['status'] = '0';\n $array_meta['network_status'] = '';\n $networks[] = $array_meta;\n\n }\n\n }\n\n } else {\n\n $networks = array();\n\n }\n\n } else {\n\n // Get social networks\n $networks = $this->CI->posts_model->all_social_networks_by_post_id( $post->user_id, $post->post_id );\n\n }\n\n $profiles = array();\n\n $networks_icon = array();\n\n if ( $networks ) {\n\n foreach ( $networks as $network ) {\n\n if ( in_array( $network['network_name'], $networks_icon ) ) {\n\n $profiles[] = array(\n 'network_id' => $network['network_id'],\n 'net_id' => $network['net_id'],\n 'user_name' => $network['user_name'],\n 'status' => $network['status'],\n 'network_status' => $network['network_status'],\n 'icon' => $networks_icon[$network['network_name']],\n 'network_slug' => $network['network_name'], \n 'network_name' => ucwords( str_replace('_', ' ', $network['network_name']) )\n );\n\n } else {\n\n $network_icon = (new MidrubBaseUserAppsCollectionPostsHelpers\\Accounts)->get_network_icon($network['network_name']);\n\n if ( $network_icon ) {\n\n $profiles[] = array(\n 'network_id' => $network['network_id'],\n 'net_id' => $network['net_id'],\n 'user_name' => $network['user_name'],\n 'status' => $network['status'],\n 'network_status' => $network['network_status'],\n 'icon' => $network_icon,\n 'network_slug' => $network['network_name'], \n 'network_name' => ucwords( str_replace('_', ' ', $network['network_name']) )\n );\n\n $networks_icon[$network['network_name']] = $network_icon;\n\n }\n\n }\n\n }\n\n }\n\n // Get image\n $img = unserialize($post->img);\n\n // Get video\n $video = unserialize($post->video);\n\n // Verify if image exists\n if ( $img ) {\n $images = get_post_media_array($post->user_id, $img );\n if ($images) {\n $img = $images;\n }\n }\n\n // Verify if video exists\n if ( $video ) {\n $videos = get_post_media_array($post->user_id, $video );\n if ($videos) {\n $video = $videos;\n }\n }\n\n $time = $post->sent_time;\n\n if ( $post->status < 1 ) {\n $time = $this->CI->lang->line('draft_post');\n }\n \n // Set post's content\n $all_posts[] = array(\n 'post_id' => $post->post_id,\n 'title' => htmlspecialchars_decode($post->title),\n 'body' => htmlspecialchars_decode($post->body),\n 'sent_time' => $post->sent_time,\n 'datetime' => $time,\n 'time' => time(),\n 'url' => $post->url,\n 'img' => $img,\n 'video' => $video,\n 'status' => $post->status,\n 'profiles' => $profiles,\n 'delete_post' => $this->CI->lang->line('delete_post')\n );\n \n }\n \n $data = array(\n 'success' => TRUE,\n 'posts' => $all_posts,\n 'total' => $total,\n 'page' => ($page + 1)\n );\n\n echo json_encode($data);\n \n } else {\n \n $data = array(\n 'success' => FALSE,\n 'message' => $this->CI->lang->line('no_posts_found')\n );\n\n echo json_encode($data); \n \n }\n \n }",
"public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n $user = $this->getUser();\n\n $fbPosts = $em->getRepository('AppBundle:FbPost')->findBy(['user' => $user]);\n\n return $this->render('fbpost/index.html.twig', array(\n 'fbPosts' => $fbPosts,\n ));\n }",
"public function findAllPosts();"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Build a Subscriber Entity Object and filled it with data | public function buildSubscriberObjFillData($subscriber_info_data, $aggregation=FALSE){
return $this->entityBuilder->buildEntity($subscriber_info_data, $aggregation);
} | [
"public function setSubscriberData(Mage_Newsletter_Model_Subscriber $subscriber)\n {\n $this->object = $subscriber;\n $this->storeId = $this->object->getStoreId();\n $this->websiteId = Mage::app()->getStore($this->storeId)->getWebsite()->getId();\n foreach ($this->getMappingHash() as $key => $field) {\n //Call user function based on the attribute mapped.\n $function = 'get';\n $exploded = explode('_', $key);\n foreach ($exploded as $one) {\n $function .= ucfirst($one);\n }\n\n try {\n //@codingStandardsIgnoreStart\n $value = call_user_func(array('self', $function));\n //@codingStandardsIgnoreEnd\n $this->objectData[$key] = $value;\n } catch (Exception $e) {\n Mage::logException($e);\n }\n }\n }",
"protected function _createSubscriber()\n {\n return $this->subscriberFactory->create();\n }",
"public function getSubscriberModel();",
"function subscriber() {\n\t\treturn array(\n\t\t\t'id' => null,\n\t\t\t'email' => null,\n\t\t\t'touched' => null,\n\t\t\t'registered' => null,\n\t\t\t'flag' => null,\n\t\t\t'ip' => null,\n\t\t\t'status' => null,\n\t\t\t'data' => array()\n\t\t);\n\t}",
"public function subscriberHandler(Varien_Event_Observer $observer)\n {\n if(!Mage::helper('sailthruemail')->isEnabled()) {\n return;\n }\n\n $subscriber = $observer->getEvent()->getSubscriber();\n\n $data = array('id' => $subscriber->getSubscriberEmail(),\n 'key' => 'email',\n 'keys' => array('email' => $subscriber->getSubscriberEmail()),\n 'keysconflict' => 'merge',\n 'lists' => array(Mage::helper('sailthruemail')->getNewsletterList() => 1), //this should be improved. Check to see if list is set. Allow multiple lists.\n 'vars' => array('subscriberId' => $subscriber->getSubscriberId(),\n 'status' => $subscriber->getSubscriberStatus(),\n 'Website' => Mage::app()->getStore()->getWebsiteId(),\n 'Store' => Mage::app()->getStore()->getName(),\n 'Store Code' => Mage::app()->getStore()->getCode(),\n 'Store Id' => Mage::app()->getStore()->getId(),\n 'fullName' => $subscriber->getSubscriberFullName(),\n ),\n 'fields' => array('keys' => 1),\n //Hacky way to prevent user from getting campaigns if they are not subscribed\n //An example is when a user has to confirm email before before getting newsletters.\n 'optout_email' => ($subscriber->getSubscriberStatus() != 1) ? 'blast' : 'none',\n );\n\n //Make Email API call to sailthru to add subscriber\n try {\n $sailthru = $this->_getSailthruClient();\n $response = $sailthru->apiPost('user', $data);\n if (Mage::helper('sailthruemail')->isDebugEnabled()) {\n Mage::log($data);\n }\n $sailthru_hid = $response['keys']['cookie'];\n $cookie = Mage::getSingleton('core/cookie')->set('sailthru_hid', $sailthru_hid);\n }catch(Exception $e) {\n Mage::logException($e);\n }\n\n return $this;\n\n }",
"protected function _subscribe() {\n\t\t$this->_transport->register('execute:before', function (&$args) {\n\t\t\tif(!empty($this->_people_id)) {\n\t\t\t\t$args['people_id'] = $this->_people_id;\n\t\t\t} else if (!empty($this->_visitor_id)) {\n\t\t\t\t$args['people_id'] = $this->_visitor_id;\n\t\t\t} else {\n\t\t\t\t$args['permanent_id'] = $this->_permanent_id;\n\t\t\t}\n\t\t});\n\n\t\t$this->_transport->register('execute:after', function ($args) {\n\t\t\tif(!empty($args['people_id'])) {\n\n\t\t\t\t$this->_people_id = $args['people_id'];\n\n\t\t\t\t$this->_type = 'people';\n\n\t\t\t} else if(!empty($args['visitor_id'])) {\n\n\t\t\t\t$this->_visitor_id = $args['visitor_id'];\n\n\t\t\t}\n\n\t\t\tif(!empty($args['people'])) {\n\t\t\t\t$this->_people = $args['people'];\n\t\t\t}\n\t\t});\n\t}",
"public function build()\n {\n return new EntityDataObject(\n $this->name,\n $this->type,\n $this->data,\n $this->linkedEntities,\n null,\n $this->vars\n );\n }",
"public function testCreateSubscriber()\n {\n // Get auth token\n $token = $this->authenticate();\n\n // Create Subscriber data\n $data = [\n 'email' => $this->faker->unique()->safeEmail,\n 'firstname' => $this->faker->name,\n 'lastname' => $this->faker->name,\n 'state' => 'active'\n ];\n\n // Send Subscriber store\n $response = $this->withHeaders([\n 'Authorization' => 'Bearer '. $token,\n ])->json('POST', route('subscribers.store'), $data);\n\n // test successful response\n $response->assertStatus(200);\n }",
"private function setSubscriber()\n {\n $subscriberId = 1;\n $this->problemModel->setSubscriberId($subscriberId);\n $this->subscriberFactoryMock->expects($this->once())\n ->method('create')\n ->willReturn($this->subscriberMock);\n $this->subscriberMock->expects($this->once())\n ->method('load')\n ->with($subscriberId)\n ->willReturnSelf();\n }",
"public function get_subscriber();",
"public function __construct()\n {\n $this->emittedInvoices = new ArrayCollection();\n $this->receivedInvoices = new ArrayCollection();\n }",
"public function parse(\\SimpleXMLElement $xml)\n {\n return new SubscriberData(\n intval($xml->Id),\n strval($xml->Firstname),\n strval($xml->Lastname),\n strval($xml->Ip),\n strval($xml->Vendor),\n $this->getProperties($xml)\n );\n }",
"public function loadSubscriberBillrun($subscriber) {\n\n\t\t$billrun = Billrun_Factory::db()->billrunCollection();\n\t\t$resource = $billrun->query()\n\t\t\t//->exists(\"subscriber.{$subscriber['id']}\")\n\t\t\t->equals('aid', $subscriber->aid)\n\t\t\t->equals('stamp', $this->getStamp());\n\n\t\tif ($resource && $resource->count()) {\n\t\t\tforeach ($resource as $entity) {\n\t\t\t\tbreak;\n\t\t\t} // @todo make this in more appropriate way\n\t\t\treturn $entity;\n\t\t}\n\n\t\t$values = array(\n\t\t\t'stamp' => $this->stamp,\n\t\t\t'aid' => $subscriber->aid,\n\t\t\t'subscribers' => array($subscriber->id => array('cost' => array())),\n\t\t\t'cost' => array(),\n\t\t\t'source' => 'ilds',\n\t\t);\n\n\t\treturn new Mongodloid_Entity($values, $billrun);\n\t}",
"public function subscribe($Model, $data) {\n\t\t\n\t\tif (is_array($data)) {\n\t\t\tif (!empty($data[0]['Subscriber'])) {\n\t\t\t\t// handle multiple subscribers\n\t\t\t\tfor ($i = 1; $i <= count($data); $i++) {\n\t\t\t\t\t$subscriber['Subscriber']['user_id'];\n\t\t\t\t\t$subscriber['Subscriber']['email'];\n\t\t\t\t\t// something like : $this->subscribe($Model, $subscriber); // a call to itself for the save\n\t\t\t\t}\n\t\t\t\tdebug($subscriber);\n\t\t\t\tdebug('handle many subscribers at once here');\n\t\t\t\t// something like $this->subscribe($Model, $)\n\t\t\t\tbreak;\n\t\t\t} else {\n\t\t\t\t// handle a single subscriber \n\t\t\t\t$email = !empty($subscriber['Subscriber']['email']) ? $subscriber['Subscriber']['email'] : $this->Subscriber->User->field('email', array('User.id' => $data['Subscriber']['user_id']));\n\t\t\t\t$userId = $data['Subscriber']['user_id'];\n\t\t\t\t$subscriber['Subscriber']['email'] = !empty($email) ? $email : null;\n\t\t\t\t$modelName = !empty($data['Subscriber']['model']) ? $data['Subscriber']['model'] : $this->modelName;\n\t\t\t\t$foreignKey = $data['Subscriber']['foreign_key'] ? $data['Subscriber']['foreign_key'] : $Model->data[$this->modelName][$this->foreignKey];\n\t\t\t}\n\t\t} else {\n\t\t\t// just a single user id coming in\n\t\t\t$userId = $data;\n\t\t\t$email = $this->Subscriber->User->field('email', array('User.id' => $userId));\n\t\t\t$modelName = $this->modelName;\n\t\t\t$foreignKey = $Model->data[$this->modelName][$this->foreignKey];\n\t\t}\n\t\t\n\t\t// finalize the data before saving\n\t\t$subscriber['Subscriber']['user_id'] = $userId;\n\t\t$subscriber['Subscriber']['email'] = !empty($email) ? $email : null;\n\t\t$subscriber['Subscriber']['model'] = $modelName;\n\t\t$subscriber['Subscriber']['foreign_key'] = $foreignKey;\n\t\t$subscriber['Subscriber']['is_active'] = 1;\n\t\t\n\t\tif ($this->Subscriber->save($subscriber)) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n \t}",
"function _recast_subscription_api_create($data) {\r\n global $base_url;\r\n //the return for this callback will be the actual uuid of the created subscription\r\n //technically this should be done in a location header as well.\r\n \r\n //so we have to validate that the incoming data\r\n //has all of the right keys\r\n //if not, we return a proper error code.\r\n //services_error('Missing recast subscription attribute ....', 406);\r\n $required_keys = array(\r\n 'analysis-uuid',\r\n 'username',\r\n 'subscription-type', // provider|observer\r\n //RK -- removed the ability to mark this as authoritative for phase 1\r\n //'authoritative', //0|1\r\n 'requirements', //text\r\n 'notifications' //all or some of recast_requests|recast_responses|new_subscribers\r\n );\r\n\r\n foreach($required_keys as $key) {\r\n if(!array_key_exists($key, $data)) {\r\n return services_error('Missing recast subscription attribute ' . $key, 406);\r\n }\r\n }\r\n \r\n //now lets get the userID from the username\r\n $user = user_load_by_name($data['username']);\r\n if($user === FALSE) {\r\n return services_error('Incorrect user for recast subscription', 406);\r\n }\r\n \r\n if(intval($data['authoritative']) != 0 && intval($data['authoritative']) != 1) {\r\n return services_error('Athoritative value must be 1 or 0.', 406);\r\n }\r\n \r\n //now check for the uuid -- it should match and get the NID\r\n $query = new EntityFieldQuery();\r\n $entity = $query\r\n ->entityCondition('entity_type', 'node', '=')\r\n ->entityCondition('bundle', 'analysis')\r\n ->propertyCondition('status', 1) \r\n ->propertyCondition('uuid', $data['analysis-uuid']) \r\n ->execute();\r\n \r\n if(count($entity) != 1) {\r\n return services_error('Invalid analysis UUID', 406);\r\n }\r\n \r\n //now check if they've already subscribed\r\n $query = new EntityFieldQuery();\r\n $analysis_entity = $query\r\n ->entityCondition('entity_type', 'node', '=')\r\n ->entityCondition('bundle', 'subscription')\r\n ->propertyCondition('status', 1, '=')\r\n ->propertyCondition('uid', $user->uid, '=')\r\n ->fieldCondition('field_subscription_analysis', 'target_id', intval(current($entity['node'])->nid), '=', 0)\r\n ->execute();\r\n \r\n if(count($analysis_entity['node']) > 0) {\r\n return services_error('You have already subscribed to this analysis.', 406);\r\n }\r\n\r\n //lets load the analysis node for use later\r\n $nid = current($entity['node']);\r\n $nid = $nid->nid;\r\n $analyis_node = node_load($nid);\r\n $lang = ($analyis_node->language == '') ? 'und' : $analyis_node->language;\r\n \r\n $node = new StdClass();\r\n $node->language = LANGUAGE_NONE;\r\n $node->type = 'subscription';\r\n $node->title = 'Subscription';\r\n $node->status = 1;\r\n $node->uid = $user->uid;\r\n $node->field_recast_audience[$node->language][0]['value'] = $data['audience'];\r\n $node->field_subscription_analysis[$node->language][0]['target_id'] = intval(current($entity['node'])->nid); \r\n\r\n //RK -- need to create a delta here\r\n $note = explode(\",\", $data['notifications']);\r\n foreach($note as $s) {\r\n $node->field_subscription_notifications[$node->language][]['value'] = $s;\r\n }\r\n $node->field_subscription_type[$node->language][0]['value'] = $data['subscription-type'];\r\n //RK -- removed the ability to mark this as authoritative for phase 1\r\n //$node->field_subscription_authoritative[$node->language][0]['value'] = intval($data['authoritative']);\r\n $node->field_subscription_requirements[$node->language][0]['value'] = $data['requirements'];\r\n node_save($node);\r\n \r\n //now send out the email notifying people that this is a new subscription\r\n $values['sender'] = $user;\r\n $values['sender']->name = $user->name;\r\n $values['sender']->mail = $user->mail;\r\n $values['subject'] = \"New Analysis Subscription\";\r\n $values['node'] = $analyis_node;\r\n $values['linked-url'] = l($analyis_node->title,\"node/{$analyis_node->nid}\");\r\n $values['subscriber_type'] = $data['subscription-type'];\r\n drupal_mail('recast', 'new_subscriber', $user, language_default(), $values);\r\n \r\n drupal_add_http_header('URI', $base_url . '/api/recast-subscription/' . $node->uuid);\r\n return $node->uuid;\r\n }",
"protected function getOroDataaudit_Listener_EntitySubscriberService()\n {\n return $this->services['oro_dataaudit.listener.entity_subscriber'] = new \\Oro\\Bundle\\DataAuditBundle\\EventListener\\EntitySubscriber($this->get('oro_dataaudit.loggable.loggable_manager'), new \\Oro\\Bundle\\DataAuditBundle\\Metadata\\ExtendMetadataFactory(new \\Oro\\Bundle\\DataAuditBundle\\Metadata\\Driver\\AnnotationDriver($this->get('annotation_reader'))));\n }",
"public static function createFromRequest(Request $request)\n {\n $subscriber = new Subscriber();\n\n return $subscriber\n ->setEmail($request->request->get('email'))\n ->addParams($request->request->get('params'))\n ->setLocale($request->request->get('locale'))\n ->setList($request->request->get('list'))\n ;\n }",
"public function create() {\n $entity = new stdClass();\n $entity->tid = 0; // Transaction-ID\n $entity->rid = 0; // Recipient-ID\n $entity->sid = 0; // Sender-ID\n $entity->iid = 0; // Initiator-ID\n $entity->amount = 0; // Amount... d'uh\n $entity->tstamp = 0; // Timestamp \n $entity->txt = null; // Transaction-Text\n $entity->ttype = 0; // Transaction-Type (taxonomy reference)\n $entity->signature = null; // The transaction-checksum\n $entity->balance = 0; // The recipient's balance after a successful transaction\n\n $entity->counter = TRUE; // Whether we need a counter-transaction (false = adjustment)\n $entity->signature_ok = FALSE; // I'm not a very trusting soul...\n return $entity;\n }",
"public function __construct(\n \\DMK\\Mkpostman\\Domain\\Model\\SubscriberModel $subscriber = null\n ) {\n $this->subscriber = $subscriber;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The default variables within the Media: ThePlatform namespace. | function media_theplatform_mpx_variable_default($name = NULL) {
static $defaults;
if (!isset($defaults)) {
$defaults = array(
'account_pid' => NULL,
'account_id' => NULL,
'cron_players' => 1,
'cron_videos' => 1,
'date_idletimeout' => NULL,
'default_player_fid' => NULL,
'import_account' => NULL,
'last_notification' => NULL,
'password' => NULL,
'token' => NULL,
'username' => NULL,
);
}
if (!isset($name)) {
return $defaults;
}
if (isset($defaults[$name])) {
return $defaults[$name];
}
} | [
"public function init_base_variables() {\n\t\t$this->plugin_url = $this->plugin_info->get_plugin_url();\n\n\t\t$this->plugin_path = $this->plugin_info->get_plugin_dir();\n\t\t$this->template_path = $this->plugin_info->get_text_domain();\n\n\t\t$this->plugin_namespace = $this->plugin_info->get_text_domain();\n\t\t$this->template_path = $this->plugin_info->get_text_domain();\n\n\n\t}",
"private function setPlatform() {\n\t\t$this->platform = $this->path[1];\n\t}",
"public function default_media_setting() {\n update_option('image_default_align', 'center');\n update_option('image_default_link_type', 'none');\n update_option('image_default_size', 'large');\n }",
"public function getPlatform()\n {\n }",
"public function defaultMediaSetting()\n {\n update_option('image_default_align', 'center');\n update_option('image_default_link_type', 'none');\n update_option('image_default_size', 'full');\n }",
"protected function _containerDefaultVariables()\n {\n $this->method = NULL;\n $this->redirect = NULL;\n $this->restore = NULL;\n $this->cache = NULL;\n $this->nocache = NULL;\n $this->csrf = NULL;\n $this->ajax = NULL;\n $this->curl = NULL;\n $this->restful = NULL;\n }",
"public static function getDefaultSetup(){\n return array(\n 'command' => false,\n 'view' => false,\n 'model' => false,\n 'validate' => false,\n 'response_type' => self::DEFAULT_RESPONSE_TYPE,\n 'request_type' => false,\n 'allow' => self::DEFAULT_ALLOWANCE,\n 'rules' => self::DEFAULT_RULES,\n\t\t\t'ignored'\t\t => false\n );\n }",
"abstract protected function _defaultProperties();",
"protected function _load_default_request_fields()\n {\n clearos_profile(__METHOD__, __LINE__);\n\n $suva = new Suva();\n $this->hostkey = $suva->get_hostkey();\n\n $os = new OS();\n $this->os_name = $os->get_name();\n $this->os_version = $os->get_version();\n\n $product = new Product();\n $this->vendor = $product->get_vendor();\n \n $language= new Locale();\n $this->langcode = $language->get_language_code();\n }",
"function get_config() {\n\tglobal $hm_platform;\n\n\t$defaults = array(\n\t\t's3-uploads' => true,\n\t\t'aws-ses-wp-mail' => true,\n\t\t'tachyon' => true,\n\t\t'cavalcade' => true,\n\t\t'batcache' => true,\n\t\t'memcached' => true,\n\t\t'ludicrousdb' => true,\n\t);\n\treturn array_merge( $defaults, $hm_platform ? $hm_platform : array() );\n}",
"public function getDefaultProperties(){}",
"public static function defineVariables()\n {\n $ClientIP = Client::getClientIP();\n if($ClientIP == \"::1\")\n {\n $ClientIP = \"127.0.0.1\";\n }\n\n define(\"CLIENT_REMOTE_HOST\", $ClientIP);\n define(\"CLIENT_USER_AGENT\", Client::getUserAgentRaw());\n\n try\n {\n $UserAgentParsed = Utilities::parse_user_agent(CLIENT_USER_AGENT);\n }\n catch(Exception $exception)\n {\n $UserAgentParsed = array();\n }\n\n if($UserAgentParsed['platform'])\n {\n define(\"CLIENT_PLATFORM\", $UserAgentParsed['platform']);\n }\n else\n {\n define(\"CLIENT_PLATFORM\", 'Unknown');\n }\n\n if($UserAgentParsed['browser'])\n {\n define(\"CLIENT_BROWSER\", $UserAgentParsed['browser']);\n }\n else\n {\n define(\"CLIENT_BROWSER\", 'Unknown');\n }\n\n if($UserAgentParsed['version'])\n {\n define(\"CLIENT_VERSION\", $UserAgentParsed['version']);\n }\n else\n {\n define(\"CLIENT_VERSION\", 'Unknown');\n }\n\n $ServerInformation = file_get_contents(__DIR__ . DIRECTORY_SEPARATOR . 'dynamicalweb.json');\n $ServerInformation = json_decode($ServerInformation, true);\n\n define(\"DYNAMICAL_WEB_AUTHOR\", $ServerInformation['AUTHOR']);\n define(\"DYNAMICAL_WEB_COMPANY\", $ServerInformation['COMPANY']);\n define(\"DYNAMICAL_WEB_VERSION\", $ServerInformation['VERSION']);\n }",
"private function setDefaultData() : void {\n $this->_defaultData = [\n 'template_dir' => $this->_model->getTemplateDir(),\n 'image_url' => self::$config->get('url') . '/public/views/' . self::$config->get('theme') . '/images',\n 'stylesheet_url' => self::$config->get('url') . '/public/views/' . self::$config->get('theme') . '/css',\n 'base_url' => self::$config->get('url'),\n 'script_url' => self::$config->get('url') . '/public/scripts',\n 'node_url' => self::$config->get('url') . '/node_modules',\n 'page_title' => $this->_model->getPageTitle(),\n 'is_logged_in' => self::$auth->isLoggedIn(),\n 'on_login_page' => Registry::retrieve('route')->getRouteInfo()['module_name'] == 'login'\n ];\n }",
"function load_defaults()\n {\n $this->css=array(\n \"{$this->gentelella['vendors']}bootstrap/dist/css/bootstrap.min.css\",\n \"{$this->gentelella['vendors']}font-awesome/css/font-awesome.min.css\",\n \"{$this->gentelella['vendors']}nprogress/nprogress.css\",\n \"{$this->gentelella['build']}css/custom.min.css\"\n );\n\n $this->js=array(\n \"{$this->gentelella['vendors']}jquery/dist/jquery.min.js\",\n \"{$this->gentelella['vendors']}bootstrap/dist/js/bootstrap.min.js\",\n \"{$this->gentelella['vendors']}fastclick/lib/fastclick.js\",\n \"{$this->gentelella['vendors']}nprogress/nprogress.js\",\n \"{$this->gentelella['build']}js/custom.min.js\"\n );\n\n $this->project_name = $this->config->item('project_name');\n }",
"function default_setting(){\r\r\n\t\t// return\r\r\n\t\treturn array();\r\r\n\t}",
"private function setDefaultVariables()\n {\n //set default params\n $this->curAction=\"\";\n $this->isRSYA=false;\n $this->arBaseParams=array();\n $this->isManualStrategy=true;\n $this->issetBannersCnt=0;\n \n $this->arSendBannerGroups=array();\n $this->arCreatedBannerGroupIDs=array();\n $this->arSendBanners=array();\n $this->arSendPhrases=array();\n \n $this->newVCardId=0;\n }",
"function lingotek_set_defaults() {\n LingotekLog::trace(__METHOD__);\n $defaults = array(\n 'lingotek_advanced_parsing' => TRUE\n );\n\n // Check if vars are set. If so, use what is already set. If not, set them using the defaults provided above.\n foreach ($defaults as $k => $default_value) {\n variable_set($k, variable_get($k, $default_value));\n }\n\n lingotek_set_default_advanced_xml();\n}",
"public function getPlatform();",
"protected function set_defaults() {\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function to call detail view in suggested jobs page | public function viewJobPost($id){
$isAdmin = $this->isAdminLogin();
$pageName = "ViewJob";
$result = SuggestedJobs::loadById($id);
$job = $this->getAllCols($result);
include_once SYSTEM_PATH.'/view/header.tpl';
include_once SYSTEM_PATH.'/view/viewJob.tpl';
include_once SYSTEM_PATH.'/view/footer.tpl';
} | [
"public function jobsdetails()\n\t{\n\t\t$this->load->view('header');\n\t\t$this->load->view('jobsdetails');\n\t\t$this->load->view('footer');\n\t}",
"public function detailsAction()\n {\n $request = $this->getRequest();\n if ($request->getParam('jid') === null) {\n // show error message?\n $this->forward('index');\n return;\n }\n\n $bj = new Bigace_Jobs();\n $job = $bj->get($request->getParam('jid'));\n\n if ($job === null) {\n // show error message?\n $this->forward('index');\n return;\n }\n\n $bjt = new Bigace_Jobs_Type();\n $type = $bjt->get($job['job_type']);\n\n $this->view->JOB = $this->getPreparedJob($job);\n $this->view->TYPE = array(\n 'id' => $type['id'],\n 'title' => $type['title'],\n 'url' => LinkHelper::url('jobs/list/jid/'.$type['id'].'/'.urlencode($type['title']))\n );\n $this->view->BACK_URL = LinkHelper::url(\n 'jobs/list/jid/'.$type['id'].'/'.urlencode($type['title'])\n );\n $this->applyContent();\n }",
"public function view( $jobId = '' ) {\n\n $this->data['meta_title'] = lang( 'job_name' );\n $this->data['page_title'] = lang( 'job_view_title' );\n $this->data['breadcrumb_items'] = array('<a href=\"' . ROOT_RELATIVE_PATH . 'job\">' . lang('system_menu_jobs') . \"</a>\", lang('job_view_title'));\n \n\n $this->data['pageCustomJS'] = $this->load->view( 'job/_job-custom-js', '', true );\n $this->data['pageVendorCss'] = $this->load->view( 'job/_job-vendor-css', '', true );\n $this->data['pageVendorJS'] = $this->load->view( 'job/_job-vendor-js', '', true );\n $this->data['pageCustomCss'] = $this->load->view( 'job/_job-custom-css', '', true);\n // Get the job details\n $this->data['jobDetails'] = $this->job_model->get_job_details( $jobId );\n\n if( $this->data['settings']->hasCadastral == 0 ) {\n\n $this->data['cadastralPanelHidden'] = 'hidden';\n $this->data['cadastralButtonHidden'] = 'hidden';\n\n } else {\n // Check if cadastral details are attached to this job\n if ( $this->data['jobDetails']->cadastralId == NULL ) {\n // Hide cadastral panel and display button to add them\n $this->data['cadastralPanelHidden'] = 'hidden';\n $this->data['cadastralButtonHidden'] = '';\n } else {\n // Show the cadastral details\n $this->data['cadastralPanelHidden'] = '';\n $this->data['cadastralButtonHidden'] = 'hidden';\n }\n \n }\n\n \n\n // Get query array of object with customer details list\n $this->data['customer'] = $this->customer_model->get();\n \n // Get query array of object with job type list\n $this->data['jobType'] = $this->job_type_model->get();\n\n // Get query object with department items\n $this->data['department'] = $this->department_model->get();\n\n // Get query object with user items\n $this->data['user'] = $this->user_model->get_user_list();\n // Create html select option structure starts here\n $this->data['option'] = \"[\";\n $last = $this->data['user']->num_rows();\n $counter = 1;\n\n // Loop user result data\n foreach ( $this->data['user']->result() as $row ) {\n // check if last row\n if( $counter == $last ) {\n $this->data['option'] .= '{\"'.$row->userId.'\":\"'.$row->name.'\"}';\n } else {\n $this->data['option'] .= '{\"'.$row->userId.'\":\"'.$row->name.'\"},';\n }\n $counter++;\n }\n $this->data['option'] .=\"]\";\n // Create html select option structure ends here\n\n // Valid id then pass to string jobId\n $this->data['jobId'] = $jobId;\n\n // Get query array of object with council details list\n $this->data['council'] = $this->council_model->get();\n\n // Get query array of object with checklist list\n $this->data['checklist'] = $this->checklist_model->get();\n \n // Get query object with job checklist items\n $this->data['job_checklist'] = $this->job_checklist_model->get_job_checklist_details( $jobId );\n\n // Get query object with job checklist items\n $this->data['job_checklist'] = $this->job_checklist_model->get_job_checklist_details( $jobId );\n\n // hide checklist panel on the job view page if there are no checklist\n $this->data['countList'] = $this->data['job_checklist']->num_rows();\n\n if ( count( $this->data['checklist'] ) == 0 ) {\n $this->data['checklistButtonHidden'] = 'hidden';\n $this->data['checklistPanelHidden'] = 'hidden';\n } else {\n if ( $this->data['countList'] == 0 ) {\n $this->data['checklistPanelHidden'] = 'hidden';\n $this->data['checklistButtonHidden'] = '';\n } else {\n $this->data['checklistPanelHidden'] = '';\n $this->data['checklistButtonHidden'] = 'hidden';\n }\n }\n\n \n\n $this->load->view( '_template/header', $this->data );\n $this->load->view( '_template/page-header' );\n $this->load->view( 'job/view', $this->data);\n $this->load->view( 'job/_job-add-checklist-modal' );\n $this->load->view( 'job/_job-add-cadastral-modal' );\n $this->load->view( 'job/_job-add-modal' );\n $this->load->view( '_template/sidebar-right' );\n $this->load->view( '_template/footer' );\n }",
"public function preferredJobs(){\n // echo 'Page under construction.';\n $pageName = \"preferredJobs\";\n $resultList = $this->getJobsList(); \n include_once SYSTEM_PATH.'/view/header.tpl';\n include_once SYSTEM_PATH.'/view/preferredJobs.tpl';\n include_once SYSTEM_PATH.'/view/footer.tpl';\n }",
"public function view($jobnum)\n {\n $data['title'] = 'Job #'.$jobnum;\n \n $data['job'] = $this->jobs_model->get_jobs($jobnum); \n $data['location']= $this->jobs_model->get_location_byid(ucfirst($data['job']['location']))['name'];\n $data['occupation']= $this->jobs_model->get_occupation_byid(ucfirst($data['job']['occupation']))['name'];\n\n \n $this->load->view('templates/header');\n $this->load->view('jobs/view',$data);\n $this->load->view('templates/footer');\n }",
"public function index(){\n\t\t$model = D('job');\n\t\t$output['list_job'] = $model->select();\n\t\t$this->output = $output;\n\t\t$this->display();\n\t\t// add job by verification\n\t\t\n }",
"public function view(Job $job);",
"public function personaldetailAction ()\n\t{}",
"public function detailAction() \n {\n $objTranslate = Zend_Registry::get ( PS_App_Zend_Translate ); \n $objError = new Zend_Session_Namespace ( PS_App_Error );\n $objSess = new Zend_Session_Namespace ( PS_App_Auth );\n $objRequest = $this->getRequest ();\n $this->view->siteTitle = $objTranslate->translate ( 'contractor - contract detail' );\n \n $objModel = new Models_Contract();\n $arrData = $objModel->fetchEntry($objRequest->id);\n //_pr($arrData ,1);\n \n $jobStatus = array('1'=>'active','2'=>'paused','3'=>'closed');\n $jobStatusAlert = array('1'=>'success','2'=>'warning','3'=>'danger');\n \n $jobType = array('1'=>'fixed cost job' ,'2'=>'hourly job');\n \n\t\t$this->view->message = $objError->message;\n $this->view->messageType = $objError->messageType;\n\t\t$objError->message = \"\";\n $objError->messageType = '';\n $this->view->arrData = $arrData;\n $this->view->jobStatus = $jobStatus;\n $this->view->jobStatusAlert = $jobStatusAlert;\n $this->view->jobType = $jobType;\n }",
"private function load_jobseeker_job_list() {\n\t\t\n\t\t$page = 'job_list_j_page';\n\n\t\t$this->check_page_files('/views/pages/' . $page . '.php');\n\n\t\t$data['page_title'] = \"Job Application List\";\n\t\t\n\t\t$email = $this->auth->get_info()->email;\n\t\t$data['job_list'] = $this->jobs_model->get_job_list_applicant( $email )->result();\n\t\t\n\t\t$this->load_view($data, $page);\n\t}",
"public function listings() {\n $company = Wpjb_Model_Company::current();\n \n if(!get_current_user_id()) {\n return $this->_loginForm(wpjb_link_to(\"employer_panel\"));\n }\n \n if(!$this->_hasAccess(\"manage_jobs\")) {\n return $this->flash();\n }\n \n if(is_null($company)) {\n $m = __('Please complete your <a href=\"%s\">Employer Profile</a> and then get back to this page.', \"wpjobboard\");\n $this->addError(sprintf($m, wpjb_link_to(\"employer_edit\")));\n return $this->flash();\n }\n \n $request = Daq_Request::getInstance();\n $browse = $request->get(\"filter\");\n switch($browse) {\n case \"pending\": $filter = \"awaiting\"; break;\n case \"expired\": $filter = \"expired\"; break;\n case \"filled\" : $filter = \"filled\"; break;\n default: \n $filter = \"active\";\n $browse = \"active\";\n }\n \n wp_enqueue_script( \"wpjb-manage\" );\n \n $this->view = new stdClass();\n $this->view->browse = $browse;\n\n $page = $request->getParam(\"page\", $request->getParam(\"pg\", 1));\n $count = 20;\n $emp = Wpjb_Model_Company::current();\n $total = new stdClass();\n \n $hide_filled = wpjb_conf(\"front_hide_filled\", false);\n \n $total->active = wpjb_find_jobs(array(\n \"filter\" => \"active\",\n \"employer_id\" => $emp->id,\n \"hide_filled\" => $hide_filled,\n \"count_only\" => true,\n ));\n \n $total->expired = wpjb_find_jobs(array(\n \"filter\" => \"expired\",\n \"employer_id\" => $emp->id,\n \"hide_filled\" => $hide_filled,\n \"count_only\" => true\n ));\n \n $total->pending = wpjb_find_jobs(array(\n \"filter\" => \"awaiting\",\n \"employer_id\" => $emp->id,\n \"hide_filled\" => false,\n \"count_only\" => true\n ));\n \n $total->filled = wpjb_find_jobs(array(\n \"filter\" => \"filled\",\n \"employer_id\" => $emp->id,\n \"hide_filled\" => false,\n \"count_only\" => true\n ));\n\n\n $result = wpjb_find_jobs(array(\n \"filter\" => $filter,\n \"employer_id\" => $emp->id,\n \"hide_filled\" => $hide_filled,\n \"page\" => $page,\n \"count\" => $count\n ));\n\n $this->view->total = $total;\n $this->view->result = $result;\n $this->view->jobList = $result->job;\n \n $param = array(\n \"filter\" => $filter,\n \"page\" => $page,\n \"count\" => $count\n );\n \n $this->view->param = $param;\n $this->view->url = wpjb_link_to(\"employer_panel\");\n $this->view->breadcrumbs = array(\n array(\"title\"=>__(\"Home\", \"wpjobboard\"), \"url\"=>wpjb_link_to(\"employer_home\"), \"glyph\"=>\"wpjb-icon-home\"),\n array(\"title\"=>__(\"Listings\", \"wpjobboard\"), \"url\"=>wpjb_link_to(\"employer_panel\"), \"glyph\"=>$this->glyph()),\n );\n\n return $this->render(\"job-board\", \"company-panel\");\n }",
"public function job_list_page_content() {\n\t\t$single_job_page_slug = get_option( Page_Manager::SINGLE_JOB_PAGE_SLUG_KEY );\n\t\t$search_string = empty( $_GET['search'] ) ? '' : $_GET['search'];\n\t\t$page = empty( $_GET['a09_page'] ) ? 1 : (int) $_GET['a09_page'];\n\t\t$queryString = \"?page=\" . $page;\n\t\t$queryString .= ( ! empty( $search_string ) ) ? \"&description=$search_string\" : \"\";\n\t\t$jobs = wp_remote_get( self::baseUrl . \".json$queryString\", array( 'timeout' => 100 ) );\n\t\t$msg = '';\n\t\tif ( is_wp_error( $jobs ) ) {\n\t\t\t$msg = $jobs->get_error_message();\n\t\t} else if ( wp_remote_retrieve_response_code( $jobs ) != 200 ) {\n\t\t\t$msg = wp_remote_retrieve_response_message( $jobs );\n\t\t}\n\t\tif ( ! empty( $msg ) ) {\n\t\t\treturn \"<div class='wrap'>Something went wrong in remote request. $msg</div>\";\n\t\t}\n\t\t$jobs = wp_remote_retrieve_body( $jobs );\n\t\t$jobs = json_decode( $jobs );\n\t\tob_start();\n\t\t?>\n <div class=\"wrap\">\n <div style=\"text-align: right; margin: 10px;\">\n <form action=\"\" method=\"get\">\n <input required type=\"text\" name=\"search\" placeholder=\"Search\"\n value=\"<?php echo $search_string ?>\"/>\n <button type=\"submit\">Search</button>\n </form>\n </div>\n\t\t\t<?php\n\t\t\tif ( empty( $jobs ) ) {\n\t\t\t\techo '<h2>No Jobs Found</h2>';\n\t\t\t} else {\n\t\t\t\tforeach ( $jobs as $job ) {\n\t\t\t\t\t$href = \"/$single_job_page_slug?a09_jfg_job_id={$job->id}\";\n\t\t\t\t\t?>\n <div style=\"display:flex; border: black 1px solid; background-color: #dfdfdf; margin: 10px; padding: 5px; border-radius: 5px\">\n <div style=\"width: 75%\">\n <p><a href=\"<?php echo $href ?>\"><?php echo $job->title ?></a></p>\n <p><?php echo $job->type ?> job</p>\n <p>Location: <?php echo $job->location ?></p>\n <p>Posted at: <?php echo date_format( date_create( $job->created_at ), \"d M, Y\" ) ?></p>\n </div>\n <div style=\"width: 25%;margin: auto 0;\">\n <a href=\"<?php echo $job->company_url ?>\">\n <img style=\" width: 100%;\"\n src=\"<?php echo $job->company_logo ?>\"\n alt=\"<?php echo $job->company ?>\"/>\n </a>\n </div>\n </div>\n\t\t\t\t\t<?php\n\t\t\t\t}\n\t\t\t}\n\t\t\t$page ++;\n\t\t\t$nextPageUrl = get_option( Page_Manager::JOB_LIST_PAGE_SLUG_KEY );\n\t\t\t$nextPageUrl .= \"?a09_page=$page\";\n\t\t\tif ( ! empty( $search_string ) ) {\n\t\t\t\t$nextPageUrl .= \"&search=$search_string\";\n\t\t\t}\n\t\t\tif ( count( $jobs ) == 50 ) {\n\t\t\t\techo \"<a href='/$nextPageUrl'>More</a>\";\n\t\t\t}\n\t\t\t?>\n </div>\n\t\t<?php\n\t\treturn ob_get_clean();\n\t}",
"function lists()\n\t{\n\t\t$data = filter_forwarded_data($this);\n\t\t\n\t\t#If the user is logged in or attempting to access the full job report, check their access\n\t\tif($this->native_session->get('__user_id') || !empty($data['action']))\n\t\t{\n\t\t\t$instructions['action'] = array('view'=>'view_relevant_jobs', 'report'=>'view_job_applications','apply'=>'apply_for_job','saved'=>'view_my_saved_jobs','status'=>'view_job_application_status');\n\t\t\tcheck_access($this, get_access_code($data, $instructions));\n\t\t}\n\t\t#Fetch the saved job ids if this is the viewed list\n\t\tif(!empty($data['action']) && $data['action'] == 'view') $data['saved_jobs'] = $this->_job->get_saved_jobs();\n\t\t\n\t\tif(empty($data['action'])) $data['action'] = 'view';\n\t\t$data['list'] = $this->_job->get_list(array('action'=>$data['action']));\n\t\t\n\t\tif(!empty($data['action']) && $data['action'] == 'apply') $data['msg'] = \"Search the jobs below to select which one to apply for.\";\n\t\t\n\t\t$viewToLoad = $this->native_session->get('__user_id')? 'job/list_jobs': 'home';\n\t\t$this->load->view($viewToLoad, $data); \n\t}",
"public function detailAction() {\n\n //GET THE LIST ITEM\n $this->view->listDetail = Engine_Api::_()->getItem('list_listing',(int) $this->_getParam('id'));\n }",
"function job_info($user_id) {\n $this->only_admin_or_own($user_id);\n\n $options = array(\"id\" => $user_id);\n $user_info = $this->Users_model->get_details($options)->row();\n\n $view_data['user_id'] = $user_id;\n $view_data['job_info'] = $this->Users_model->get_job_info($user_id);\n $view_data['job_info']->job_title = $user_info->job_title;\n $this->load->view(\"team_members/job_info\", $view_data);\n }",
"public function index()\n\t{\n\t\t//Data Job Categoru Perusahaan\n\t\t$job_category = array(\n\t\t\t\t\t\t\t 'jc-1'=>'Software Engineering',\n 'jc-2'=>'Data Science',\n 'jc-3'=>'Design',\n 'jc-4'=>'Operations',\n 'jc-5'=>'Marketing',\n 'jc-6'=>'Product Management',\n 'jc-7'=>'Bussiness Development',\n 'jc-8'=>'Engineering',\n 'jc-9'=>'Management',\n 'jc-10'=>'Finance',\n 'jc-11'=>'Human Resource',\n 'jc-12'=>'Media & Communication',\n 'jc-13'=>'Consulting',\n 'jc-14'=>'Other'\n );\n\t\t$data['job_category']= $job_category;\n\n\t\t$this->load->view('skin/front_end/header_company_page_topbar');\n\t\t$this->load->view('content_front_end/job_list_page_talent_view', $data);\n\t\t$this->load->view('skin/front_end/footer_company_page');\n\t}",
"public function add_jobs_page()\n\t{\n\t\t// check user's auth\n\t\t$id_company = $this->session->userdata('id_company');\n\t\tif ($id_company == \"\") {\n\t\t\tredirect( site_url('AccountCompany') );\n\t\t}\n\n\t\t$data['active'] = 2;\n\n\t\t$this->load->model('account/UserModel');\n\t\t$data['lokasiProvinsi'] = $this->UserModel->lokasi_provinsi_job();\n\n\t\t// get job category list\n\t\t$data['job_category'] = $this->get_job_category_list();\n\t\t// get job type list\n\t\t$data['job_type'] \t = $this->get_job_type_list();\n\n\t\t$this->load->view('skin/front_end/header_company_page_topbar');\n\t\t$this->load->view('skin/front_end/navbar_company_page', $data);\n\t\t$this->load->view('content_front_end/company_add_jobs_page', $data);\n\t\t$this->load->view('skin/front_end/footer_company_page');\n\n\t}",
"function content_of_job_history_page() {\n $s = new LHJobHistory();\n $s->doView();\n echo $s->toHtml();\n }",
"public function index()\n\t{\n\t\t$this->detail();\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Override defaultActions() to remove summary actions. | protected function defaultActions($which = NULL) {
if ($which) {
if (in_array($which, ['ignore', 'not found', 'empty', 'default'])) {
return parent::defaultActions($which);
}
return;
}
$actions = parent::defaultActions();
unset($actions['summary asc']);
unset($actions['summary desc']);
unset($actions['summary asc by count']);
unset($actions['summary desc by count']);
return $actions;
} | [
"protected function defaultActions($which = NULL) {\n if ($which) {\n if (in_array($which, ['ignore', 'not found', 'empty', 'default'])) {\n return parent::defaultActions($which);\n }\n return;\n }\n $actions = parent::defaultActions();\n unset($actions['summary asc']);\n unset($actions['summary desc']);\n return $actions;\n }",
"public function restoreDefaultDashboardActions() {\n $this->run('restoreDefaultDashboardActions', array());\n }",
"public function removeAllActions();",
"function audition_remove_default_actions_and_filters() {\n\n\tif (! audition_is_action()) {\n\t\treturn;\n\t}\n\n\t// Remove actions\n\tremove_action('wp_head', 'feed_links', 2);\n\tremove_action('wp_head', 'feed_links_extra', 3);\n\tremove_action('wp_head', 'rsd_link', 10);\n\tremove_action('wp_head', 'wlwmanifest_link', 10);\n\tremove_action('wp_head', 'parent_post_rel_link', 10);\n\tremove_action('wp_head', 'start_post_rel_link', 10);\n\tremove_action('wp_head', 'adjacent_posts_rel_link_wp_head', 10);\n\tremove_action('wp_head', 'rel_canonical', 10);\n\n\t// Remove filters\n\tremove_filter('template_redirect', 'redirect_canonical');\n}",
"public function ClearActions() {\t\t\r\n\t\t$this->actions = array_slice($this->actions, 0, 0); \r\n\t}",
"public function getDefaultActions()\n {\n return $this->m_defaultActions;\n }",
"public function getDefaultActions()\n\t{\n\t\treturn $this->defaultActions;\n\t}",
"public function customActions()\n\t{\n\t\treturn array();\n\t}",
"protected function prependDefaultActions()\n {\n foreach ($this->actions as $action => $enable) {\n if (! $enable) {\n continue;\n }\n\n array_push($this->default, $this->{'render'.ucfirst($action)}());\n }\n }",
"protected function appendDefaultAction()\n {\n $this->add($this->makeBatchDelete(), '_delete_');\n }",
"protected function remove_all_meta_actions() {\n\t\t$this->remove_add_meta_action();\n\n\t\tremove_filter( \"update_{$this->meta_type}_metadata\", array( $this, 'update_metadata' ), 999, 5 );\n\t\tremove_action( \"update_{$this->meta_type}_meta\", array( $this, 'update_meta' ), 10, 4 );\n\n\t\tremove_action( \"delete_{$this->meta_type}_meta\", array( $this, 'store_metas_to_sync' ), 10, 2 );\n\t\tremove_action( \"deleted_{$this->meta_type}_meta\", array( $this, 'delete_meta' ), 10, 4 );\n\t}",
"public static function getDefaultActions() {\r\n\t\treturn array('CREATE_HelpDesk_FROM', 'UPDATE_HelpDesk_SUBJECT', 'LINK_Contacts_FROM', 'LINK_Contacts_TO', 'LINK_Accounts_FROM', 'LINK_Accounts_TO');\r\n\t}",
"protected function addActions() {\n\n\t\t}",
"public static function clear_saved_actions() {\n\n\t\tdelete_option( 'extendable-aggregator-queued-actions-' . static::$name );\n\t}",
"public function getAdditionalActions() {}",
"function get_default_action()\r\n {\r\n return self :: DEFAULT_ACTION;\r\n }",
"public function clearActions()\n {\n $this->actions = new Collection();\n\n return $this;\n }",
"function remove_quick_edit( $actions ) {\n\t\tunset($actions['inline hide-if-no-js']);\n\t\treturn $actions;\n\t}",
"public function setDefaultActions($actions)\n {\n $this->m_defaultActions = $actions;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Operation essExpenseUploadAttachment Upload Attachment to Expense Request | public function essExpenseUploadAttachment($expense_request_id, $file_name, $employee_id, string $contentType = self::contentTypes['essExpenseUploadAttachment'][0])
{
list($response) = $this->essExpenseUploadAttachmentWithHttpInfo($expense_request_id, $file_name, $employee_id, $contentType);
return $response;
} | [
"public function upload_attachment(){\n\n\t\t$file_name_with_full_path = '/home/neosoft/Desktop/VS doc/download.jpeg';\n\n\t\t$request_url = 'http://localhost:3000/rest/api/content/7406823/child/attachment';\n\t\t\n\t\tif (function_exists('curl_file_create')) { \n\t\t $cFile = curl_file_create($file_name_with_full_path);\n\t\t} else { \n\t\t $cFile = '@' . realpath($file_name_with_full_path);\n\t\t}\n\n\t\t$post = array('id'=>'7406823','comment' => 'abc','file' =>$cFile);\n\n\t \t$ch = curl_init();\n\t \tcurl_setopt($ch, CURLOPT_URL, $request_url);\n\t curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); \n\t curl_setopt($ch, CURLOPT_POST, 1);\n\t curl_setopt($ch, CURLOPT_POSTFIELDS, $post); \n\t curl_setopt($ch, CURLOPT_USERPWD, \"admin\" . \":\" . \"Abc@1234\");\n\n\t \t$headers = array();\n\t\t$headers[] = \"X-Atlassian-Token: no-check\";\n\t\tcurl_setopt($ch, CURLOPT_HTTPHEADER, $headers);\n\n\t $result = curl_exec($ch);\n\t $info = curl_getinfo($ch);\n\t curl_close ($ch);\n }",
"public function addAttachment()\n {\n global $injector, $notification;\n\n $result = new stdClass;\n $result->action = 'addAttachment';\n if (isset($this->vars->file_id)) {\n $result->file_id = $this->vars->file_id;\n }\n $result->success = 0;\n\n /* A max POST size failure will result in ALL HTTP parameters being\n * empty. Catch that here. */\n if (!isset($this->vars->composeCache)) {\n $notification->push(_(\"Your attachment was not uploaded. Most likely, the file exceeded the maximum size allowed by the server configuration.\"), 'horde.warning');\n } else {\n $imp_compose = $injector->getInstance('IMP_Factory_Compose')->create($this->vars->composeCache);\n\n if ($imp_compose->canUploadAttachment()) {\n try {\n foreach ($imp_compose->addAttachmentFromUpload('file_upload') as $val) {\n if ($val instanceof IMP_Compose_Exception) {\n $notification->push($val, 'horde.error');\n } else {\n $result->success = 1;\n\n /* This currently only occurs when\n * pasting/dropping image into HTML editor. */\n if ($this->vars->img_data) {\n $result->img = new stdClass;\n $result->img->src = strval($val->viewUrl()->setRaw(true));\n\n $temp1 = new DOMDocument();\n $temp2 = $temp1->createElement('span');\n $imp_compose->addRelatedAttachment($val, $temp2, 'src');\n $result->img->related = array(\n $imp_compose::RELATED_ATTR,\n $temp2->getAttribute($imp_compose::RELATED_ATTR)\n );\n } else {\n $this->_base->queue->attachment($val);\n $notification->push(sprintf(_(\"Added \\\"%s\\\" as an attachment.\"), $val->getPart()->getName()), 'horde.success');\n }\n }\n }\n\n $this->_base->queue->compose($imp_compose);\n } catch (IMP_Compose_Exception $e) {\n $notification->push($e, 'horde.error');\n }\n } else {\n $notification->push(_(\"Uploading attachments has been disabled on this server.\"), 'horde.error');\n }\n }\n\n return $this->vars->json_return\n ? $result\n : new Horde_Core_Ajax_Response_HordeCore_JsonHtml($result);\n }",
"public function UploadAsset($attachment) {\n $this->Send($attachment, 'message_attachments');\n }",
"public function expensesIdAttachmentPost($authorization, $id, $file = null)\n {\n list($response) = $this->expensesIdAttachmentPostWithHttpInfo($authorization, $id, $file);\n return $response;\n }",
"public function saveAttachment()\r\n\t{\r\n\t\t$query = \"INSERT INTO attachments (filename, mimetype, filesize, post_id) VALUES (:filename, :mimetype, :filesize, :post_id)\";\r\n\t\t\r\n\t\t$params[0] = $this->filename;\r\n\t\t$params[1] = $this->mimetype;\r\n\t\t$params[2] = $this->filesize;\r\n\t\t$params[3] = $this->post_id;\r\n\t\t\r\n\t\t$paramNames[0] = \":filename\";\r\n\t\t$paramNames[1] = \":mimetype\";\r\n\t\t$paramNames[2] = \":filesize\";\r\n\t\t$paramNames[3] = \":post_id\";\r\n\t\t\r\n\t\t$this->dbaccess->prepared_insert_query($query, $params, $paramNames);\r\n\t}",
"public function store(Attachment $attachment, UploadedFile $file);",
"public function testUploadAttachmentBytes()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }",
"public function uploadF24AttachmentRequest($company_id, $filename = null, $attachment = null, string $contentType = self::contentTypes['uploadF24Attachment'][0])\n {\n\n // verify the required parameter 'company_id' is set\n if ($company_id === null || (is_array($company_id) && count($company_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $company_id when calling uploadF24Attachment'\n );\n }\n\n\n\n\n $resourcePath = '/c/{company_id}/taxes/attachment';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($company_id !== null) {\n $resourcePath = str_replace(\n '{' . 'company_id' . '}',\n ObjectSerializer::toPathValue($company_id),\n $resourcePath\n );\n }\n\n // form params\n if ($filename !== null) {\n $formParams['filename'] = ObjectSerializer::toFormValue($filename);\n }\n // form params\n if ($attachment !== null) {\n $multipart = true;\n $formParams['attachment'] = [];\n $paramFiles = is_array($attachment) ? $attachment : [$attachment];\n foreach ($paramFiles as $paramFile) {\n $formParams['attachment'][] = \\GuzzleHttp\\Psr7\\Utils::tryFopen(\n ObjectSerializer::toFormValue($paramFile),\n 'rb'\n );\n }\n }\n\n $headers = $this->headerSelector->selectHeaders(\n ['application/json', ],\n $contentType,\n $multipart\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 (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 // this endpoint requires OAuth (access token)\n if (!empty($this->config->getAccessToken())) {\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 $operationHost = $this->config->getHost();\n $query = ObjectSerializer::buildQuery($queryParams);\n return new Request(\n 'POST',\n $operationHost . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function addAttachment($attachment)\n {\n }",
"public function executeFileAddAndEdit()\r\n {\r\n // Load attachment with or without id depending on method\r\n $a = $this->wsObject->method == 'PUT' ? new Attachment((int) $this->wsObject->urlSegment[1]) : new Attachment();\r\n \r\n // Check form data\r\n if (isset($_FILES['file']) && is_uploaded_file($_FILES['file']['tmp_name'])) {\r\n \r\n // Ensure file is within allowed size limit\r\n if ($_FILES['file']['size'] > (Configuration::get('PS_ATTACHMENT_MAXIMUM_SIZE') * 1024 * 1024)) {\r\n $this->wsObject->errors[] = sprintf($this->l('The file is too large. Maximum size allowed is: %1$d kB. The file you are trying to upload is %2$d kB.'), (Configuration::get('PS_ATTACHMENT_MAXIMUM_SIZE') * 1024), number_format(($_FILES['file']['size'] / 1024), 2, '.', ''));\r\n } else {\r\n // Assign unique id\r\n do {\r\n $uniqid = sha1(microtime());\r\n } while (file_exists(_PS_DOWNLOAD_DIR_ . $uniqid));\r\n \r\n $a->file_name = $_FILES['file']['name'];\r\n $a->file = $uniqid;\r\n $a->mime = $_FILES['file']['type'];\r\n $a->name[Configuration::get('PS_LANG_DEFAULT')] = $_POST['name'];\r\n \r\n // Move file to download dir\r\n if (! move_uploaded_file($_FILES['file']['tmp_name'], _PS_DOWNLOAD_DIR_ . $uniqid)) {\r\n $this->wsObject->errors[] = $this->l('Failed to copy the file.');\r\n unlink(_PS_DOWNLOAD_DIR_ . $a->file);\r\n $a->delete();\r\n } else {\r\n // Create/update attachment\r\n if ($a->id) {\r\n $a->update();\r\n } else {\r\n $a->add();\r\n }\r\n // Remember affected entity\r\n $this->attachment_id = $a->id;\r\n }\r\n \r\n // Delete temp file\r\n @unlink($_FILES['file']['tmp_name']);\r\n }\r\n }\r\n }",
"public function expenseRequestUploadAttachment($expense_request_id, $business_id, $employee_id, string $contentType = self::contentTypes['expenseRequestUploadAttachment'][0])\n {\n list($response) = $this->expenseRequestUploadAttachmentWithHttpInfo($expense_request_id, $business_id, $employee_id, $contentType);\n return $response;\n }",
"public function addAttachment() {\n try {\n if (!($this->attachment instanceof Base_Model_ObtorLib_App_Core_Qualification_Entity_Attachment)) {\n throw new Base_Model_ObtorLib_App_Core_Qualification_Exception(\" Attachment Entity not initialized\");\n } else {\n $data = array(\n 'attachment_title' => $this->attachment->getAttachmentTitle(),\n 'attachment_description' => $this->attachment->getAttachmentDescription(),\n 'doc_path' => $this->attachment->getDocPath(),\n 'rel_id' => $this->attachment->getRelId(),\n 'rel_object' => $this->attachment->getRelObject());\n \n $last_inserted_id = $this->insert($data);\n return $last_inserted_id;\n }\n } catch (Exception $ex) {\n throw new Base_Model_ObtorLib_App_Core_Qualification_Exception($ex);\n }\n }",
"public function managerEmployeeExpenseUploadAttachment($employee_id, $expense_request_id, $file_name, $business_id, string $contentType = self::contentTypes['managerEmployeeExpenseUploadAttachment'][0])\n {\n list($response) = $this->managerEmployeeExpenseUploadAttachmentWithHttpInfo($employee_id, $expense_request_id, $file_name, $business_id, $contentType);\n return $response;\n }",
"function createAttachment($targetIssueKey, $attachmentFile, $credentials)\n{\n $url = \"https://pantheon.atlassian.net/rest/api/2/issue/\" . $targetIssueKey . \"/attachments\";\n\n $data = array('file' => \"@$attachmentFile\");\n $headers = array(\n 'X-Atlassian-Token: nocheck'\n );\n\n $curl = curl_init();\n curl_setopt($curl, CURLOPT_USERPWD, $credentials);\n curl_setopt($curl, CURLOPT_URL, $url);\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1);\n curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0);\n curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 0);\n curl_setopt($curl, CURLOPT_VERBOSE, 1);\n curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);\n curl_setopt($curl, CURLOPT_POSTFIELDS, $data);\n\n $result_file_upload = curl_exec($curl);\n $ch_error = curl_error($curl);\n\n if ($ch_error) {\n echo \"cURL Error: $ch_error\";\n } else {\n echo \"<br>Attachment posted<br>\";\n echo $result_file_upload;\n }\n\n curl_close($curl);\n\n return $result_file_upload;\n}",
"protected function addAttachment( $attachment ){\n\t}",
"public static function addAttachment($object, $filename, $attachment,\n $contentType) {\n $attached = new Priloha();\n $headersBackup = $object->defaultHttpHeaders;\n $codeBackup = $object->lastResponseCode;\n $responseBackup = $object->lastCurlResponse;\n $object->postFields = $attachment;\n $object->defaultHttpHeaders['Content-Type'] = $contentType;\n $url = $object->getAbraFlexiURL() . '/prilohy/new/' . $filename;\n $response = $object->performRequest($url, 'PUT');\n $object->defaultHttpHeaders = $headersBackup;\n $attached->setMyKey($response[0]['id']);\n $attached->lastResponseCode = $object->lastResponseCode;\n $attached->lastCurlResponse = $object->lastCurlResponse;\n $object->lastResponseCode = $codeBackup;\n $object->lastCurlResponse = $responseBackup;\n return $attached;\n }",
"public function uploadAttachmentFile(TestCase $case, string $name, int $uploadedTo = 0): TestResponse\n {\n $file = $this->uploadedTextFile($name);\n\n return $case->call('POST', '/attachments/upload', ['uploaded_to' => $uploadedTo], [], ['file' => $file], []);\n }",
"public function attach() {\n // Attachments can be attached only to page. So ensure we are in page context.\n $this->ensurePageContext();\n\n $be = $this->getBackend();\n\n // Attachments can be attached only if user has specific privilege to attach attachments.\n if (!$this->Acl->attachment_write) {\n throw new \\view\\AccessDenided();\n }\n\n // When the form has been posted, process the uploaded file.\n if ($_SERVER[\"REQUEST_METHOD\"] == \"POST\") {\n // Only if we have uploaded file.\n if (isset($_FILES[\"file\"]) && $_FILES[\"file\"][\"error\"] == UPLOAD_ERR_OK\n && is_uploaded_file($_FILES[\"file\"][\"tmp_name\"])) {\n\n // Move uploaded file to safe temporary location where we can open handle to it. In certain PHP setups,\n // PHP does not need to have access to the uploaded file itself, so the only safe thing to do with\n // that file is to use the move_uploaded_file function. After we move it to safe location (temp dir\n // in our case), we can do anything we want with the file, and later store it in it's final destination.\n $nm = tempnam(sys_get_temp_dir(), \"wikiupload\");\n if (move_uploaded_file($_FILES[\"file\"][\"tmp_name\"], $nm)) {\n // Create Attachment entry for the file.\n $at = new \\models\\Attachment();\n $at->setName($_POST[\"name\"]);\n $at->setRevision(1);\n $at->setBytes(filesize($nm));\n $at->setUserId(\\lib\\CurrentUser::ID());\n $at->setRelatedPageId($this->relatedPage->getId());\n\n // Guess the file type using libguess. It needs file name to examine file data\n // (and extract metadata, if available), and file name when the guess is done by file extension.\n $guess = \\lib\\libguess\\Guess::guessType($nm, $_FILES[\"file\"][\"name\"]);\n\n // Set the file type in attachment entry.\n switch ($guess->getClass()) {\n case FileType::CLASS_IMAGE:\n $at->setTypeString(\"image\");\n $at->setWidth($guess->getWidth());\n $at->setHeight($guess->getHeight());\n break;\n\n case FileType::CLASS_VIDEO:\n $at->setTypeString(\"video\");\n break;\n\n case FileType::CLASS_AUDIO:\n $at->setTypeString(\"audio\");\n break;\n\n case FileType::CLASS_TEXT:\n $at->setTypeString(\"text\");\n break;\n\n case FileType::CLASS_BINARY:\n $at->setTypeString(\"binary\");\n break;\n }\n\n $at->setMeta(\\models\\Attachment::META_CONTENT_TYPE, $guess->getMime());\n\n $be = $this->getBackend()->getAttachmentsModule();\n\n $dt = \\Config::Get(\"__Storage\");\n if (!is_null($dt)) {\n // First, we need to store the attachment entry to get attachment ID and revision number\n // from backend.\n $be->store($at);\n\n // When we have attachment ID and revision number, we can store the file to it's final location\n // on the file system.\n $dt->store($nm, $at, \\storage\\DataStore::ORIGINAL_FILE);\n\n foreach ((array)explode(\",\", \\Config::Get(\"Attachments.Previews.\".$at->getTypeString())) as $subId) {\n $subId = trim($subId);\n if (empty($subId)) {\n continue;\n }\n\n try {\n // Try to create the attachment by fetching it from storage backend.\n $dt->load($at, $subId);\n } catch (\\Exception $e) {\n // Ignore errors here.\n }\n }\n } else {\n \\view\\Messages::Add(\n \"StorageBackend not configured. Unable to store attachment.\",\n \\view\\Message::Error);\n }\n }\n\n if (file_exists($nm)) {\n unlink($nm);\n }\n }\n\n // In any case, when we are in the POST handler, redirect back to prevent double posting.\n $this->template->redirect($this->template->getSelf());\n } else {\n // In case of GET request (we are ignoring other methods than GET and POST here and defaulting\n // all to GET if no POST has been issued), display the attach form.\n $this->template->addNavigation(\"Attach file\", $this->template->getSelf());\n\n $child = new \\view\\Template(\"attachments/attach.php\");\n $maxSize = self::maxUploadSize();\n $child->addVariable(\"UploadMaxBytes\", $maxSize);\n $child->addVariable(\"UploadMaxSize\", \\lib\\humanSize($maxSize));\n $this->template->setChild($child);\n }\n }",
"function handle_ticket_attachments($ticketid, $index_name = 'file', $form_activity = false)\n{\n if (isset($_FILES[$index_name]) && empty($_FILES[$index_name]['name']) && $form_activity) {\n return;\n }\n\n if (isset($_FILES[$index_name]) && _perfex_upload_error($_FILES[$index_name]['error'])) {\n header('HTTP/1.0 400 Bad error');\n echo _perfex_upload_error($_FILES[$index_name]['error']);\n die;\n }\n\n $CI =& get_instance();\n if (isset($_FILES[$index_name]['name']) && $_FILES[$index_name]['name'] != '') {\n do_action('before_upload_ticket_attachment', $ticketid);\n $path = get_upload_path_by_type('ticket') . $ticketid . '/';\n // Get the temp file path\n $tmpFilePath = $_FILES[$index_name]['tmp_name'];\n // Make sure we have a filepath\n if (!empty($tmpFilePath) && $tmpFilePath != '') {\n if (!_upload_extension_allowed($_FILES[$index_name][\"name\"])) {\n return false;\n }\n\n _maybe_create_upload_path($path);\n\n $filename = unique_filename($path, $_FILES[$index_name][\"name\"]);\n $newFilePath = $path . $filename;\n // Upload the file into the company uploads dir\n if (move_uploaded_file($tmpFilePath, $newFilePath)) {\n $CI =& get_instance();\n $CI->load->model('Ticket_model');\n $data = array();\n $data[] = array(\n 'file_name' => $filename,\n 'filetype' => $_FILES[$index_name][\"type\"],\n );\n $CI->Ticket_model->add_attachment_to_database($ticketid, $data, false, $form_activity);\n\n return true;\n }\n }\n }\n\n return false;\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Retrieve an array of form details, containing "id" & "name" & "shortcode" | public static function get_all_form_details() {
global $wpdb;
$table_name = $wpdb->base_prefix . "posts";
$query = "SELECT id, post_title FROM $table_name WHERE post_type='usp_form'";
$results = $wpdb->get_results($query, ARRAY_A);
$formDetails = [];
foreach ($results as $result) {
$formDetails[] = [
"id" => $result['id'],
"name" => $result['post_title'],
"shortcode" => "[subscribe_pro form={$result['id']}]"
];
}
return $formDetails;
} | [
"public function get_form_field_details($formname) {\n\n $Fields = array(); // default to a blank array in case something goes wrong\n\n $col_list = $this->get_column_list('form_fields');\n\n //\n // Get all of the fields for the form\n //\n\n $FieldsQ = $this->database->prepare('SELECT ' . $col_list . ' FROM `form_fields` ' .\n \"WHERE `form` = '$formname' \" .\n \"ORDER BY `sequence`\");\n $FieldsQ->execute();\n $FieldsD = $FieldsQ->fetchAll(PDO::FETCH_ASSOC);\n\n foreach ($FieldsD as $FieldsQ) {\n\n $Fields[] = $FieldsQ; // stash a row of data\n\n } // end of for loop through all of the data\n\n return $Fields;\n\n }",
"static function GetFormDetails($content, $form_name = null, $field_name = null)\r\n\t\t{\r\n\t\t\tif (!$content) return;\r\n\t\t\t\r\n\t\t\t$chunks = preg_split(\"/<form\\b/msi\", $content);\r\n\t\t\tfor($i = 1; $i < count($chunks); $i++)\r\n\t\t\t{\r\n\t\t\t\t$chunk = $chunks[$i];\r\n\t\t\t\t$lines = explode(\"\\n\", $chunk);\r\n\t\t\t\t$form = array();\r\n\t\t\t\tpreg_match_all(\"/(name|action|method)\\s*\\=\\s*(\\'|\\\")(.*?)\\\\2/msi\", $lines[0], $matches, PREG_SET_ORDER);\r\n\t\t\t\t\r\n\t\t\t\tforeach($matches as $match)\r\n\t\t\t\t{\r\n\t\t\t\t\t$form[strtolower($match[1])] = $match[3];\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif ($form_name && $form_name != $form['name'])\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t\t\r\n\t\t\t\tpreg_match_all(\"/<input[^>]+>/msi\", $chunk, $matches, PREG_SET_ORDER);\r\n\r\n\t\t\t\tfor($k = 0; $k < count($matches); $k++)\r\n\t\t\t\t{\r\n\t\t\t\t\tpreg_match_all(\"/(type|name|value|checked)\\s*\\=\\s*(\\'|\\\")(.*?)\\\\2/i\", $matches[$k][0], $inputfields, PREG_SET_ORDER);\r\n\t\t\t\t\t\r\n\t\t\t\t\t$field = array();\r\n\t\t\t\t\tforeach($inputfields as $inputfield)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$field[strtolower($inputfield[1])] = $inputfield[3];\t\t\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tif (!$field['name'] || (in_array($field['type'], array('checkbox', 'radio')) && !$field['checked']))\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t$form['elements'][$field['name']] = $field['value'];\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif ($field_name && !$form['elements'][$field_name])\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t\r\n\t\t\t\treturn $form;\r\n\t\t\t}\r\n\t\t}",
"function formlistforms () {\n\tif ($GLOBALS['claims_debug']) {\n\t\t$table = \"claimstest\";\n\t} else {\n\t\t$table = \"claims\";\n\t}\n\t$query = \"SELECT `name` FROM `\".$table.\"`\";\n\t$result = mysql_query($query);\n\tcheckDBError();\n\tif (!mysql_num_rows($result)) {\n\t\treturn array();\n\t} else {\n\t\twhile ($row = mysql_fetch_array($result, MYSQL_ASSOC)) \n\t\t\t$record[] = $row['name'];\n\t\treturn $record;\n\t}\n}",
"function populate_form_array()\n\t\t{\n\t\t\t$arr = array(\n\t\t\t\t\t\t\t'clinic_name'\t\t=> 'clinic_name',\n\t\t\t\t\t\t\t'name_first' \t\t\t=> 'name_first',\n\t\t\t\t\t\t\t'name_last' \t\t\t=> 'name_last',\n\t\t\t\t\t\t\t'email' \t\t\t=> 'email',\n\t\t\t\t\t\t\t'practitiner_type' \t=> 'practitiner_type',\n\t\t\t\t\t\t\t'clinic_zip' \t\t=> 'clinic_zip' \n\t\t\t\t\t\t);\n\t\t\treturn $arr;\t\t\t\n\t\t}",
"function get_form_metas($form_id) {\n\t$form_id \t= input_check($form_id);\n\t$args \t\t= _args_helper(input_check($args), 'where');\n\t$where \t\t= $args['where'];\n\n\n\t$where['form_id'] = $form_id;\n\tif($q_select = db()->query(\"SELECT * FROM \".dbname('form_meta').\" \".sql_where_string($where).\" \")) {\n\t\tif($q_select->num_rows) {\n\t\t\t$return = array();\n\t\t\twhile($list = $q_select->fetch_object()) {\n\t\t\t\tif(empty($list->taxonomy)) {\n\t\t\t\t\t$return[$list->name] = $list;\n\t\t\t\t} else {\n\t\t\t\t\t$return[$list->taxonomy][$list->name] = $list;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\treturn $return;\n\t\t} else { return false; }\n\t} else { add_mysqli_error_log(__FUNCTION__); }\n}",
"function grav_get_forms(){\n\t$forms = RGFormsModel::get_forms( null, 'title' );\n\t$form_list = array();\n\tforeach($forms as $form){\n\t\t$form_list[$form->id] = $form->title;\n\t}\n\treturn $form_list;\n}",
"public static function get_forms_list() {\n\t\t$list = array();\n\t\t$forms = \\GFAPI::get_forms();\n\t\tforeach ( $forms as $form ) {\n\t\t\t$list[ $form['id'] ] = $form['title'];\n\t\t}\n\n\t\treturn $list;\n\t}",
"public function get_info_fields() {\n\t\t$fields = [];\n\t\t$preview = $this->get_preview_options();\n\n\t\tif ( empty( $preview['info_fields'] ) ) {\n\t\t\treturn $fields;\n\t\t}\n\n\t\tforeach ( (array) $preview['info_fields'] as $field ) {\n if ( empty( $field['icon'] ) ) {\n $field['icon'] = '';\n }\n\n if ( ! $this->has_field( $field['show_field'] ) ) {\n \tcontinue;\n }\n\n $field_value = apply_filters( 'case27\\listing\\preview\\info_field\\\\' . $field['show_field'], $this->get_field( $field['show_field'] ), $field, $this );\n\t\t\tif ( is_array( $field_value ) ) {\n $field_value = join( ', ', $field_value );\n }\n // Escape square brackets so any shortcode added by the listing owner won't be run.\n $field_value = str_replace( [ \"[\" , \"]\" ] , [ \"[\" , \"]\" ] , $field_value );\n\n\t\t\t$GLOBALS['c27_active_shortcode_content'] = $field_value;\n $field_content = str_replace( '[[field]]', $field_value, do_shortcode( $field['label'] ) );\n\n if ( ! strlen( $field_content ) ) {\n \tcontinue;\n }\n\n \t$fields[] = [\n \t\t'icon' => $field['icon'],\n \t\t'field' => $field,\n \t\t'content' => $field_content,\n \t];\n\t\t}\n\n\t\treturn $fields;\n\t}",
"function hook_ablecore_form_info()\n{\n\t$forms = array();\n\t$forms['test_form_id'] = new FormClass();\n\treturn $forms;\n}",
"public function ajax_getforms() {\n\t\t$args = array(\n\t\t\t'post_type' => 'mf_form',\n\t\t\t'meta_query' => array(\n\t\t\t\t'relation' => 'OR',\n\t\t\t\tarray(\n\t\t\t\t\t'key' => 'mf_gigya_id',\n\t\t\t\t\t'value' => sanitize_text_field( $_POST['uid'] )\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'key' => 'mf_additional_user',\n\t\t\t\t\t'value' => sanitize_text_field( $_POST['e'] )\n\t\t\t\t)\n\t\t\t)\n\t\t);\n\n\t\t$q = new WP_Query( $args );\n\t\t$f = array( \n\t\t\t'exhibit' => array(),\n\t\t\t'presenter' => array(),\n\t\t\t'performer' => array()\n\t\t);\n\n\t\tforeach ( $q->posts as $p ) {\n\t\t\t$d = json_decode( str_replace( \"\\'\", \"'\", $p->post_content ) );\n\t\t\t$p->data = $d;\n\t\t\t$f[$d->form_type][$p->ID] = $p;\n\t\t}\n\n\t\tdie( json_encode( array( 'status'=>'OK', 'forms' => $f ) ) );\n\t}",
"public function getFormFields() {\r\n return $this->dbConn->queryAssoc(\"SELECT `form_fields`.`id`, `form_fields`.`name` FROM `form_fields` WHERE `form_id` = \".intval($this->id).\" ORDER BY `id` ASC\");\r\n }",
"public function metaform() {\n\t\t$form = array();\n\t\t$data = $this->getData();\n\n\t\t$capture = '';\n\t\tif (\n\t\t\t$this->pubkey\n\t\t\t|| ! Toolset_Utils::is_real_admin()\n\t\t) {\n\t\t\t$capture = '<div id=\"recaptcha_' . esc_attr( $data['id'] ) . '\" class=\"g-recaptcha\" data-sitekey=\"' . esc_attr( $this->pubkey ) . '\"></div><div class=\"recaptcha_error\" style=\"color:#aa0000;display:none;\">' . __( 'Please validate reCAPTCHA', 'wpv-views' ) . '</div>';\n\t\t}\n\n\t\t$form[] = array(\n\t\t\t'#type' => 'textfield',\n\t\t\t'#title' => '',\n\t\t\t'#name' => '_recaptcha',\n\t\t\t'#value' => '',\n\t\t\t'#attributes' => array( 'style' => 'display:none;' ),\n\t\t\t'#before' => $capture,\n\t\t);\n\n\t\treturn $form;\n\t}",
"public function get_form_fields($form_id)\n {\n }",
"private function get_form_elements(){\n\t\treturn $this->fields;\n\t}",
"function form_info() {\n $info = $this->get_type();\n // Get fields formatted as array of items\n $fields = $this->get_fields();\n if (!empty($info['name'])) {\n // This subscription type already has a name\n $value = $info['name'];\n }\n elseif (empty($fields)) {\n // No name, maybe no fields it should be enough with the title\n $value = '';\n }\n elseif (count($fields) == 1) {\n // If the field is unique, we don't need a table nor a name for it\n $value = $this->format_fields(self::FORMAT_HTML | self::FORMAT_INLINE);\n }\n else {\n // Multiple fields, format as a table\n $value = $this->format_fields(self::FORMAT_TABLE);\n }\n // Build a form field with all these values\n $field = array(\n '#type' => 'item',\n '#title' => t('@type subscription', array('@type' => $this->get_type('title'))),\n '#value' => $value,\n );\n if (!empty($info['description'])) {\n $field['#description'] = $info['description'];\n }\n return $field;\n }",
"public function get_encoded_form_array(){\n\t\treturn array('form_id'=>$this->_form_array['form_id'], 'form_structure'=>json_encode($this->_form_array['form_structure']));\n\t}",
"public function createFormElement() : array {\n $info = $this->info;\n $return = [\n '#title' => $info['name'],\n '#type' => $info['type'],\n '#required' => $info['required'],\n '#default_value' => '',\n '#title_display' => 'invisible',\n ];\n\n $extra_info = unserialize($info['extra']);\n\n if (isset($info['#states']['visible'])) {\n $return['#states']['visible'] = $info['#states']['visible'];\n }\n\n if (isset($extra_info['webform_conditional_field_value']) && !empty($extra_info['webform_conditional_field_value'])) {\n $conditional_value = $extra_info['webform_conditional_field_value'];\n }\n if (isset($extra_info['webform_conditional_operator']) && !empty($extra_info['webform_conditional_operator'])) {\n $conditional_operator = $extra_info['webform_conditional_operator'];\n }\n if (isset($extra_info['webform_conditional_cid']) && !empty($extra_info['webform_conditional_cid'])) {\n $conditional_cid = $extra_info['webform_conditional_cid'];\n }\n if (isset($extra_info['items']) && !empty($extra_info['items'])) {\n $options = explode(PHP_EOL, $extra_info['items']);\n $arrLength = count($options);\n $option_array = array();\n foreach ($options as $key => $option) {\n $key_value = explode('|', $option);\n $option_array[$key_value[0]] = $key_value[1];\n if ($arrLength == 1) {\n $checkbox_label = $key_value[1];\n }\n }\n }\n\n if (!empty($info['value']) && $info['type'] != 'processed_text') {\n $info['value'] = str_replace(\"%first_name\", \"[current-user:field_first_name]\", $info['value']);\n $info['value'] = str_replace(\"%last_name\", \"[current-user:field_last_name]\", $info['value']);\n $info['value'] = str_replace(\"%phone\", \"[current-user:field_user_phone]\", $info['value']);\n $info['value'] = str_replace(\"%country\", \"[current-user:field_user_country]\", $info['value']);\n $info['value'] = str_replace(\"%organization\", \"[current-user:field_user_organization]\", $info['value']);\n $info['value'] = str_replace(\"%designation\", \"[current-user:field_user_designation]\", $info['value']);\n $return['#default_value'] = $info['value'];\n }\n switch ($info['type']) {\n case 'email':\n $return['#default_value'] = '[current-user:mail]';\n $return['#placeholder'] = $info['name'] . '*';\n break;\n case 'textfield':\n if ($info['required'] == '1') {\n $return['#placeholder'] = $info['name'] . '*';\n }\n else {\n $return['#placeholder'] = $info['name'];\n }\n break;\n case 'select':\n $return['#empty_option'] = $info['name'];\n break;\n case 'processed_text':\n $return['#format'] = 'full_html';\n $return['#text'] = $info['value'];\n break;\n case 'checkboxes':\n $return['#options'] = $option_array;\n $return['#description'] = $info['name'];\n $return['#description_display'] = 'invisible';\n unset($return['#title_display']);\n break;\n case 'checkbox':\n $return['#description'] = $info['name'] = $checkbox_label;\n $return['#description_display'] = 'invisible';\n $return['#title_display'] = 'after';\n break;\n case 'radios':\n $return['#description'] = $info['name'];\n $return['#description_display'] = 'invisible';\n $return['#options'] = $option_array;\n $return['#title_display'] = 'before';\n break;\n }\n\n switch ($info['form_key']) {\n case 'utm_campaign':\n $return['#default_value'] = '[current-page:query:utm_campaign:clear]';\n break;\n case 'utm_content':\n $return['#default_value'] = '[current-page:query:utm_content:clear]';\n break;\n case 'utm_medium':\n $return['#default_value'] = '[current-page:query:utm_medium:clear]';\n break;\n case 'utm_source':\n $return['#default_value'] = '[current-page:query:utm_source:clear]';\n break;\n case 'utm_term':\n $return['#default_value'] = '7010B000000sC3p';\n break;\n case 'privacy_policy':\n $return['#required_error'] = 'Privacy policy field is required.';\n break;\n case 'actions':\n if (!empty($info['value'])) {\n $return['#submit__label'] = $info['value'];\n break;\n }\n case 'add_to_schedule':\n $return['#title_display'] = 'none';\n $return['#trim'] = true;\n $return['#sanitize'] = true;\n $return['#download'] = true;\n $return['#url'] = '[webform_submission:add-to-schedule]';\n break;\n }\n\n\n $this->extraInfo($return);\n\n if ($info['form_key'] == 'gdpr_country') {\n $return['#options'] = 'country_codes';\n }\n if ($info['form_key'] == 'designation' || $info['form_key'] == 'job_title') {\n $return['#options'] = 'designation';\n }\n\n return $return;\n }",
"public function get_encoded_form_array(){\n\t\treturn array('form_id'=>$this->_form_array['form_id'],'form_structure'=>json_encode($this->_form_array['form_structure']));\n\t}",
"public function getForm();"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
check whether a user is allowed to access a resource or not | public function isUserAllowedToAccessResource($resource){
return Model::isUserAllowedToAccessResource($resource);
} | [
"public function doesHaveResourceAccess(){\n \t\t\n \t\t$resourceRequest = jan_generateResourceRequest();\n\n\t\t$this->generateAccessibleResources();\n \t\t\n \t\t//Find the resource\n \t\tif(isset($this->resources[$resourceRequest->fullResource]) === false){\n \t\t\t$this->error = 'USER '.__LINE__.': User is not permitted to access resource or the requested resource does not exist. '.$resourceRequest->fullResource;\n \t\t\treturn false;\n \t\t}\n \t\t\n \t\t//If a user key exists check it against the current user\n \t\tif(isset($resourceRequest->keys['user'])){\n \t\t\t\n \t\t\t//Make sure a user is logged in.\n \t\t\tif($this->loggedIn === false){\n \t\t\t\t$this->error = 'USER '.__LINE__.': Logged in user is required.';\n \t\t\t\treturn false;\n \t\t\t}\n \t\t\t\n \t\t\tif($this->userId != $resourceRequest->keys['user']){\n \t\t\t\t$this->error = 'USER '.__LINE__.': Attempting to accesss another users data.';\n \t\t\t\treturn false;\n \t\t\t}\n \t\t\t\n \t\t}\n \t\t\n \t\t//Find the method\n\n \t\t$availableMethods = explode(',', $this->resources[$resourceRequest->fullResource]);\n\n \t\tif(in_array(strtolower($resourceRequest->method), $availableMethods) === false){\n \t\t\t$this->error = 'USER '.__LINE__.': Requested method is not permitted. '.$temp;\n \t\t\treturn false;\n \t\t}\n \t\t\n \t\treturn true;\n \t\t\n \t}",
"function isAllowed($user, $resource = IAuthorizator::ALL, $privilege = IAuthorizator::ALL, $id);",
"function _hasAccess()\r\n {\r\n // create user object\r\n $user =& User::singleton();\r\n\r\n $timePoint =& TimePoint::singleton($_REQUEST['sessionID']);\r\n $candID = $timePoint->getCandID();\r\n\r\n $candidate =& Candidate::singleton($candID);\r\n\r\n // check user permissions\r\n return ($user->hasPermission('access_all_profiles') || $user->getData('CenterID') == $candidate->getData('CenterID') || $user->getData('CenterID') == $timePoint->getData('CenterID'));\r\n }",
"function _hasAccess()\n {\n // create user object\n $user =& User::singleton();\n\n $timePoint =& TimePoint::singleton($_REQUEST['sessionID']);\n $candID = $timePoint->getCandID();\n\n $candidate =& Candidate::singleton($candID);\n\n // check user permissions\n return ($user->hasPermission('access_all_profiles') || $user->getData('CenterID') == $candidate->getData('CenterID') || $user->getData('CenterID') == $timePoint->getData('CenterID'));\n }",
"public function authorize()\n {\n if ($this->isUserAdmin()) {\n return true;\n }\n\n return $this->isUserOwner($this->resourcesData);\n }",
"private function checkIfAllowed()\n {\n if (!in_array($this->getUser()->getRole->name, ['automatedTask', 'admin'])) {\n abort(403, 'You are not allowed to access this area of the application');\n }\n }",
"function checkAccess () {\n if ($this->userid && $GLOBALS[\"user_show\"] == true) return true;\n else { return false; }\n }",
"public function authorize()\n {\n return $this->user() != null;\n }",
"public function isGranted($user, $action, ResourceReference $resource);",
"public function user_has_access() {\n\t\treturn current_user_can( 'pvm_edit_projects' );\n\t}",
"protected function _isAllowed()\n {\n return $this->_authorization->isAllowed('Smile_Retailer::manage');\n }",
"public function mayAccess(): bool\n\t{\n\t\t// If role filtering is not set up then allow through\n\t\tif (! function_exists('has_permission'))\n\t\t{\n\t\t\treturn true;\n\t\t}\n\n\t\t// Anyone can run user actions\n\t\tif (empty($this->attributes['role']) || $this->attributes['role'] === 'user')\n\t\t{\n\t\t\treturn true;\n\t\t}\n\n\t\t// Otherwise check for Action role permission\n\t\treturn has_permission($this->attributes['role']);\n\t}",
"public function has_access() {\n\t\t// Public access endpoints\n\t\tif ( in_array( $this->route, array_keys( self::$public_access ) ) && in_array( $this->action, self::$public_access[ $this->route ] )) \n\t\t{\n\t\t\treturn true;\n\t\t}\n\n\t\t// Check if the user needs is logged in\n\t\tif ( is_null( $this->session->userdata('zoo_user') ) )\n\t\t{\n\t\t\t$this->return = self::NEED_LOGIN;\n\t\t\treturn false;\n\t\t}\n\n\t\t// Check if the user's status requires a special routing redirection\n\t\t$user = $this->session->userdata('zoo_user');\n\t\t$this->load->model('users_model');\n\t\t$this->users_model->user_id = $user['user_id'];\n\t\tif ( ! self::$user = $this->users_model->get_active() )\n\t\t{\n\t\t\t$this->return = self::NEED_LOGIN;\n\t\t\treturn false;\n\t\t}\n\n\t\tself::$logged = true;\n\t\t\n\t\tif ( self::$user->status == self::PENDING && $this->allowed_route() )\n\t\t{\n\t\t\t$this->return = self::NEED_VERIFY;\n\t\t\treturn false;\n\t\t}\n\n\t\t// Check if the user's group is allowed to perform the requested CRUD operation on the requested endpoint\n\t\t$valid \t= false;\n\n\t\tif ( in_array( $this->route, array_keys( self::$permissions[ self::$user->role ] ) ) && in_array( $this->action, self::$permissions[ self::$user->role ][ $this->route ] ) )\n\t\t{\n\t\t\t// Valid group access permission and CRUD operation for the requested endpoint\n\t\t\t$valid = true;\n\t\t}\n\n\t\tif ( ! $valid )\n\t\t{\n\t\t\t$this->return = self::NOT_AUTHORIZED;\n\t\t\treturn false;\n\t\t}\n\n\t\treturn $valid;\n\t}",
"abstract public function isAuthorized();",
"function checkAccessRight(){\r\n \t$res = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('*',$this->personTable,'feuser_id='.intval($GLOBALS['TSFE']->fe_user->user['uid']));\r\n \tif($res[0]['publadmin'] || $this->person['feuser_id']==intval($GLOBALS['TSFE']->fe_user->user['uid'])){\r\n \t\treturn true;\r\n \t}else{\r\n \t\treturn false;\r\n \t}\r\n }",
"public function authorize(): bool\n {\n return $this->user()->can('view-allocations', $this->getModel(Server::class));\n }",
"public function authorize()\n {\n return $this->user() !== null;\n }",
"protected function _isAllowed()\n {\n return $this->_authorization->isAllowed('Rapidmage_Firewall::manage_ip');\n }",
"public function can($user, $action, $resource);"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Test case for getContactsForUser . | public function testGetContactsForUser()
{
} | [
"function getUserContacts()\r\n\t{\r\n\t}",
"function getUserContacts()\r\n\t{\r\n\t\tHybrid_Logger::info( \"Enter [{$this->providerId}]::getUserContacts()\" );\r\n\t}",
"function invit0r_get_contacts($from, $to)\r\n{\r\n\tglobal $invit0r_user;\r\n\r\n\treturn $invit0r_user -> getContacts($from, $to);\r\n}",
"public function getContacts();",
"function getUserContacts()\r\n\t{\r\n\t\treturn false;\r\n \t}",
"public function test_can_list_own_contacts(): void\n {\n $user = User::factory()\n ->has(Contact::factory()->count(5))\n ->create();\n\n $contact = $user->contacts()->orderBy('id')->first();\n\n Sanctum::actingAs($user);\n\n $response = $this->get('/api/contact');\n\n $response->assertStatus(200)\n ->assertJson(static function (AssertableJson $json) use ($contact) {\n $json\n ->has('data', 5)\n ->has('data.0', function (AssertableJson $json) use ($contact) {\n $json->whereAll([\n 'id' => $contact['id'],\n 'firstName' => $contact['first_name'],\n 'lastName' => $contact['last_name'],\n 'email' => $contact['email'],\n 'phoneHome' => $contact['phone_home'],\n 'phoneMobile' => $contact['phone_mobile']\n ]);\n })\n ->has('links', function (AssertableJson $json) {\n $json->hasAll([\n 'first', 'last', 'prev', 'next'\n ]);\n })\n ->has('meta', function (AssertableJson $json) {\n $json->hasAll([\n 'current_page', 'from', 'last_page', 'links', 'path', 'per_page', 'to', 'total'\n ]);\n })\n ->etc();\n });\n }",
"function getUserContacts()\n\t{ \n\t\t// refresh tokens if needed \n\t\t$this->refreshToken(); \n\n\t\tif( ! isset( $this->config['contacts_param'] ) ){\n\t\t\t$this->config['contacts_param'] = array( \"max-results\" => 500 );\n\t\t}\n\n\t\t$response = $this->api->api( \"https://www.google.com/m8/feeds/contacts/default/full?\" \n\t\t\t\t\t\t\t. http_build_query( array_merge( array('alt' => 'json'), $this->config['contacts_param'] ) ) ); \n\n\t\tif( ! $response ){\n\t\t\treturn ARRAY();\n\t\t}\n \n\t\t$contacts = ARRAY(); \n\n\t\tforeach( $response->feed->entry as $idx => $entry ){\n\t\t\t$uc = new Hybrid_User_Contact();\n\n\t\t\t$uc->email = isset($entry->{'gd$email'}[0]->address) ? (string) $entry->{'gd$email'}[0]->address : ''; \n\t\t\t$uc->displayName = isset($entry->title->{'$t'}) ? (string) $entry->title->{'$t'} : ''; \n\t\t\t$uc->identifier = $uc->email;\n\n\t\t\t$contacts[] = $uc;\n\t\t} \n\n\t\treturn $contacts;\n \t}",
"function getUserContacts() {\n // refresh tokens if needed \n $this->refreshToken();\n\n $contacts = array();\n $key_temp = 0;\n if (!isset($this->config['contacts_param'])) {\n $this->config['contacts_param'] = array(\"max-results\" => 500);\n }\n\n // Google Gmail and Android contacts\n if (strpos($this->scope, '/m8/feeds/') !== false) {\n\n $response = $this->api->api(\"https://www.google.com/m8/feeds/contacts/default/full?\"\n . http_build_query(array_merge(array('alt' => 'json', 'v' => '3.0'), $this->config['contacts_param'])));\n\n if (!$response) {\n return ARRAY();\n }\n\n if (isset($response->feed->entry)) {\n foreach ($response->feed->entry as $idx => $entry) {\n if (isset($entry->{'gd$email'}[0]->address) && !empty($entry->{'gd$email'}[0]->address)) {\n $contacts[$key_temp]['email'] = isset($entry->{'gd$email'}[0]->address) ? (string) $entry->{'gd$email'}[0]->address : '';\n $contacts[$key_temp]['name'] = isset($entry->title->{'$t'}) && !empty($entry->title->{'$t'}) ? (string) $entry->title->{'$t'} : $contacts[$key_temp]['email'];\n $contacts[$key_temp]['identifier'] = ($contacts[$key_temp]['email'] != '') ? $contacts[$key_temp]['email'] : '';\n $contacts[$key_temp]['description'] = '';\n if (property_exists($entry, 'link')) {\n /**\n * sign links with access_token\n */\n if (is_array($entry->link)) {\n foreach ($entry->link as $l) {\n if (property_exists($l, 'gd$etag') && $l->type == \"image/*\") {\n $contacts[$key_temp]['picture'] = $this->addUrlParam($l->href, array('access_token' => $this->api->access_token));\n } else if ($l->type == \"self\") {\n $contacts[$key_temp]['profileURL'] = $this->addUrlParam($l->href, array('access_token' => $this->api->access_token));\n }\n }\n }\n } else {\n $contacts[$key_temp]['profileURL'] = '';\n }\n if (property_exists($response, 'website')) {\n if (is_array($response->website)) {\n foreach ($response->website as $w) {\n if ($w->primary == true)\n $contacts[$key_temp]['webSiteURL'] = $w->value;\n }\n } else {\n $contacts[$key_temp]['webSiteURL'] = $response->website->value;\n }\n } else {\n $contacts[$key_temp]['webSiteURL'] = '';\n }\n\n $key_temp++;\n }\n }\n }\n }\n\n // Google social contacts\n /*\n if (strpos($this->scope, '/auth/plus.login') !== false) {\n\n $response = $this->api->api(\"https://www.googleapis.com/plus/v1/people/me/people/visible?\"\n . http_build_query($this->config['contacts_param']));\n\n if (!$response) {\n return ARRAY();\n }\n\n foreach ($response->items as $idx => $item) {\n $contacts[$key_temp]['email'] = (property_exists($item, 'email')) ? $item->email : '';\n $contacts[$key_temp]['displayName'] = (property_exists($item, 'displayName')) ? $item->displayName : '';\n $contacts[$key_temp]['identifier'] = (property_exists($item, 'id')) ? $item->id : '';\n\n $contacts[$key_temp]['description'] = (property_exists($item, 'objectType')) ? $item->objectType : '';\n $contacts[$key_temp]['photoURL'] = (property_exists($item, 'image')) ? ((property_exists($item->image, 'url')) ? $item->image->url : '') : '';\n $contacts[$key_temp]['profileURL'] = (property_exists($item, 'url')) ? $item->url : '';\n $contacts[$key_temp]['webSiteURL'] = '';\n\n $key_temp++;\n }\n }\n * \n */\n\n return $contacts;\n }",
"public function testGetExternalcontactsContacts()\n {\n }",
"public function getContacts() {\n $contacts = $this->contactsManager->search('', ['GEO','ADR'], ['types'=>false]);\n $addressBooks = $this->contactsManager->getUserAddressBooks();\n $result = [];\n $userid = trim($this->userId);\n foreach ($contacts as $c) {\n $addressBookUri = $addressBooks[$c['addressbook-key']]->getUri();\n $uid = trim($c['UID']);\n // we don't give users, just contacts\n if (strcmp($c['URI'], 'Database:'.$c['UID'].'.vcf') !== 0 and\n strcmp($uid, $userid) !== 0\n ) {\n // if the contact has a geo attibute use it\n if (key_exists('GEO', $c)) {\n $geo = $c['GEO'];\n if (strlen($geo) > 1) {\n array_push($result, [\n 'FN'=>$c['FN'] ?? $this->N2FN($c['N']) ?? '???',\n 'URI'=>$c['URI'],\n 'UID'=>$c['UID'],\n 'ADR'=>'',\n 'ADRTYPE'=>'',\n 'HAS_PHOTO'=>(isset($c['PHOTO']) and $c['PHOTO'] !== null),\n 'BOOKID'=>$c['addressbook-key'],\n 'BOOKURI'=>$addressBookUri,\n 'GEO'=>$geo,\n 'GROUPS'=>$c['CATEGORIES'] ?? null\n ]);\n }\n }\n // anyway try to get it from the address\n $card = $this->cdBackend->getContact($c['addressbook-key'], $c['URI']);\n if ($card) {\n $vcard = Reader::read($card['carddata']);\n if (isset($vcard->ADR) and count($vcard->ADR) > 0) {\n foreach ($vcard->ADR as $adr) {\n $geo = $this->addressService->addressToGeo($adr->getValue(), $c['URI']);\n //var_dump($adr->parameters()['TYPE']->getValue());\n $adrtype = '';\n if (isset($adr->parameters()['TYPE'])) {\n $adrtype = $adr->parameters()['TYPE']->getValue();\n }\n if (strlen($geo) > 1) {\n array_push($result, [\n 'FN'=>$c['FN'] ?? $this->N2FN($c['N']) ?? '???',\n 'URI'=>$c['URI'],\n 'UID'=>$c['UID'],\n 'ADR'=>$adr->getValue(),\n 'ADRTYPE'=>$adrtype,\n 'HAS_PHOTO'=>(isset($c['PHOTO']) and $c['PHOTO'] !== null),\n 'BOOKID'=>$c['addressbook-key'],\n 'BOOKURI'=>$addressBookUri,\n 'GEO'=>$geo,\n 'GROUPS'=>$c['CATEGORIES'] ?? null\n ]);\n }\n }\n }\n }\n }\n }\n return new DataResponse($result);\n }",
"public function testGetContacts()\n {\n $settingsDir = TEST_ROOT .'/settings/';\n include $settingsDir.'settings1.php';\n\n $settings = new OneLogin_Saml2_Settings($settingsInfo);\n\n $contacts = $settings->getContacts();\n $this->assertNotEmpty($contacts);\n $this->assertEquals('technical_name', $contacts['technical']['givenName']);\n $this->assertEquals('technical@example.com', $contacts['technical']['emailAddress']);\n $this->assertEquals('support_name', $contacts['support']['givenName']);\n $this->assertEquals('support@example.com', $contacts['support']['emailAddress']);\n }",
"public function getContacts()\n {\n $response = $this->call('GET', '/contacts?pageSize=10&page=1');\n\n $this->assertEquals(200, $response->status());\n\n $response->assertJsonStructure([\n 'contacts',\n 'customAttributes'\n ]);\n \n }",
"function getContactsManager();",
"public function test_count_contacts() {\n $user1 = self::getDataGenerator()->create_user();\n $user2 = self::getDataGenerator()->create_user();\n $user3 = self::getDataGenerator()->create_user();\n\n $this->assertEquals(0, \\core_message\\api::count_contacts($user1->id));\n\n \\core_message\\api::create_contact_request($user1->id, $user2->id);\n\n // Still zero until the request is confirmed.\n $this->assertEquals(0, \\core_message\\api::count_contacts($user1->id));\n\n \\core_message\\api::confirm_contact_request($user1->id, $user2->id);\n\n $this->assertEquals(1, \\core_message\\api::count_contacts($user1->id));\n\n \\core_message\\api::create_contact_request($user3->id, $user1->id);\n\n // Still one until the request is confirmed.\n $this->assertEquals(1, \\core_message\\api::count_contacts($user1->id));\n\n \\core_message\\api::confirm_contact_request($user3->id, $user1->id);\n\n $this->assertEquals(2, \\core_message\\api::count_contacts($user1->id));\n }",
"public function testActivityTaskTaskIdContactsGet()\n {\n }",
"public function testGetExternalcontactsOrganizationContacts()\n {\n }",
"public function testAntBackendGetContacts()\r\n\t{\r\n $contact = new SyncContact();\r\n $contact->firstname = \"first_name\";\r\n $contact->lastname = \"last_name\";\r\n $cid = $this->backend->saveContact(\"\", $contact);\r\n \r\n $contacts = $this->backend->GetMessageList(\"contacts_root\");\r\n $this->assertTrue(count($contacts) > 0);\r\n \r\n // Cleanup\r\n $obj = new CAntObject($this->dbh, \"contact_personal\", $cid, $this->user);\r\n $obj->removeHard();\r\n\t}",
"public function auth_user_can_call_contacts_page_and_see_this_page() {\n $this->actingAs($this->user);\n\n $this->call('get', '/contacts');\n $this->assertResponseStatus(200);\n $this->seePageIs('/contacts');\n }",
"public function testGetGDPRContacts()\n {\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the security state | public function getSecureState() {
return $this->_secureState;
} | [
"public function getSecurityStatus()\n {\n return $this->security_status;\n }",
"public function getState()\n {\n return $this->authorizationCode->getState();\n }",
"public function getSecurity() {\n return $this->security;\n }",
"public function getUserState(){\n return($this->userState);\n }",
"public function getUserState() {\n\t\treturn $this->userState;\n\t}",
"public function getAccessState()\n {\n return $this->access_state;\n }",
"public function getUserState() {\n\t\treturn ($this->userState);\n\t}",
"public function getSecurity()\n\t{\n\t\treturn $this->get('security');\n\t}",
"public function getState() {\n return $this->data['resource_state'];\n }",
"public function getState3DSecure(){\n\t\treturn $this->state3DSecure;\n\t}",
"public function getInsuredstate()\n\t{\n\t\treturn $this->insuredstate;\n\t}",
"public function get_security_code() {\n\t\treturn $this->security_code;\n\t}",
"public function getState()\n {\n return $this->conn->call( new XmlRpc( 'supervisor.getState' ) )->getData();\n }",
"static function security () {\r\n\t\treturn CloudNCo::security ();\r\n\t}",
"public function state()\n {\n return $this->_state;\n }",
"public function getEnableUserState();",
"public function getstate() {\n /**\n * Returning the resource Model for 'state'\n */\n return Mage::getResourceModel ( 'eav/entity_attribute' )->getIdByCode ( 'catalog_product', 'state' );\n }",
"public function get_3dSecureStatus()\n {\n return $this->_3dSecureStatus;\n }",
"protected function getAuthState()\n {\n return $this->authState;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
.accountgroup.v1.LookupRequest.Presence foursquare = 2; | public function setFoursquare($var)
{
GPBUtil::checkEnum($var, \Accountgroup\V1\LookupRequest_Presence::class);
$this->foursquare = $var;
} | [
"public function getPresence(string $user): UserResponse;",
"public function setFacebook($var)\n {\n GPBUtil::checkEnum($var, \\Accountgroup\\V1\\LookupRequest_Presence::class);\n $this->facebook = $var;\n }",
"function fn_settings_variants_addons_rus_online_cash_register_statuses_paid()\n{\n return fn_get_simple_statuses(STATUSES_ORDER);\n}",
"function sb_slack_presence($agent_id = false, $list = false) {\n $online_users = [];\n $token = sb_get_setting('slack-token');\n if (!empty($token)) {\n $slack_agents = sb_get_setting('slack-agents');\n if ($agent_id === false && !$list) {\n $slack_users = sb_slack_get_users();\n $slack_agents = [];\n for ($i = 0; $i < count($slack_users); $i++) {\n $slack_agents[$slack_users[$i]['id']] = false;\n }\n }\n if ($slack_agents != false && !is_string($slack_agents)) {\n foreach ($slack_agents as $slack_id => $id) {\n if ($id == $agent_id || ($list && !empty($id))) {\n $response = json_decode(sb_download('https://slack.com/api/users.getPresence?token=' . $token . '&user=' . $slack_id), true);\n $response = (isset($response['ok']) && sb_isset($response, 'presence') == 'active') || sb_isset($response, 'online');\n if ($list) {\n if ($response) {\n array_push($online_users, $id);\n }\n } else if ($agent_id !== false || $response) {\n return $response ? 'online' : 'offline';\n }\n }\n }\n }\n }\n return $list ? $online_users : 'offline';\n}",
"public function ApiGetIndividual() {\r\n /* The API call will return an object with the following properties:\r\n * scoutid will match existing\r\n * firstname should match existing\r\n * lastname should match existing\r\n * photo_guid used somehow to construct the URL of a photo for this scout. Not used at present.\r\n * email1, 2, 3 & 4 appear to be always the empty string.\r\n * phone1, 2, 3 & 4 appear to be always the empty string.\r\n * address & address2 appear to be always the empty string\r\n * dob date of birth in form 'YYYY-MM-YY'. Not used at present.\r\n * started date joined scouting movement, in form 'YYYY-MM-DD'. Not used at present.\r\n * joining_in_yrs seems to be zero even for people who have been a member for several years (and\r\n * have the joining in badges showing in OSM).\r\n * parents, notes, medical, religion, school, ethnicity, subs, custom1, custom2, custom3, custom4,\r\n * custom5, custom6, custom7, custom8, custom9 all appear to be always the empty string.\r\n * created_date date and time this record was created, in the form 'YYYY-MM-DD HH:MI:SS'.\r\n * last_accessed date and time this record was last access, in the form 'YYYY-MM-DD HH:MI:SS'. It\r\n * is not quite clear what constitutes 'access'. Not used at present.\r\n * patrolid the id of the patrol in which this scout is a member. Patrols\r\n * are specific to a section, except ids '-2' and '-3' which are\r\n * is the leaders and young leaders patrols in all sections.\r\n * patrolleader small integer indicating role in patrol: 0=>member, 1=>second; 2=>sixer. Not used\r\n * at present.\r\n * startedsection date joined this section, in form 'YYYY-MM-DD'.\r\n * enddate date left this section, in form 'YYYY-MM-DD', or null if this isn't yet known.\r\n * age narrative string such as '10 years and 5 months'. This is the age at the time of the\r\n * query, not at the time of any event or term.\r\n * age_simple as age, but in shorter form such as '10 / 05'.\r\n * sectionid the id of the section to which this record relates. Should be the same as the id of\r\n * the related section object.\r\n * active meaning not quite certain. A value of true may indicate the scout is still (at the\r\n * time of enquiry) a member is this section, or perhaps in any section.\r\n * meetings a number which may be a count of total meetings attended. This property is absent if\r\n * the enquiry did not include a term.\r\n */\r\n if (!$this->apiGotIndividual) {\r\n $this->apiGotIndividual = true;\r\n $apiData = $this->osm->PostAPI( \"ext/members/contact/?action=getIndividual&context=members\" .\r\n \"§ionid={$this->section->id}&scoutid={$this->id}&termid=0\" );\r\n if ($apiData->ok) {\r\n $apiData = $apiData->data;\r\n assert( $this->id == $apiData->scoutid );\r\n $this->dob = date_create( $apiData->dob );\r\n $this->firstName = $apiData->firstname;\r\n $this->lastName = $apiData->lastname;\r\n $this->patrol = $this->section->Patrol( $apiData->patrolid );\r\n $this->patrolLevel = intval( $apiData->patrolleader );\r\n $this->dateJoinedMovement = date_create( $apiData->started );\r\n $this->dateStartedSection = date_create( $apiData->startedsection );\r\n $this->dateLeftSection = $apiData->enddate === null ? null :\r\n date_create( $apiData->enddate );\r\n } }\r\n }",
"function fs_getVenuesSearch($ll, $limit = 5) {\n\tglobal $foursquare;\n\t$request = $foursquare->GetPrivate(\n\t\t\t\t\t\"venues/search\", \n\t\t\t\t\tarray(\n\t\t\t\t\t\t'limit' => $limit, \n\t\t\t\t\t\t'll' => $ll, \n\t\t\t\t\t\t'v' => FOURSQUARE_API_VERSION\n\t\t\t\t\t)\n\t);\n\t$details = json_decode($request, false);\n\tif (fs_hasErrors($details->meta)) return false;\n\treturn $details->response->venues;\n}",
"function &getPresenceInformation($sipId, $password)\n {\n // refer to wsdl for more info\n $sipId = new SOAP_Value('sipId', '{urn:AGProjects:SoapSIMPLEProxy}SipId', $sipId);\n $result = $this->call('getPresenceInformation',\n $v = array('sipId' => $sipId, 'password' => $password),\n array('namespace' => 'urn:AGProjects:SoapSIMPLEProxy:Presence',\n 'soapaction' => '',\n 'style' => 'rpc',\n 'use' => 'encoded'));\n return $result;\n }",
"public function getFoursquareVenue()\n\t{\n\t\t$lat = Input::get('lat');\n\t\t$long = Input::get('long');\n\n\t\t// Create a Guzzle Client\n\t\t$client = new GuzzleHttp\\Client();\n\n\t\t// Create a request with basic Auth\n\t\t$request = $client->get('https://api.foursquare.com/v2/venues/search',[\n 'query' => [\n 'll' => $lat.','.$long,\n 'client_id' => getenv('FOURSQUARE_CLIENT_ID'),\n 'client_secret' => getenv('FOURSQUARE_CLIENT_SECRET'),\n 'v' => '20140806',\n 'categoryId' => implode(',',$this->fs_category_id),\n 'radius' => '400'\n ]\n ]);\n\t\t$body = $request->getBody();\n $response = Response::make($body, 200);\n $response->header('Content-Type', 'application/json');\n return $response;\n\t}",
"function foursquare_api_venuehistory($hook, $entity_type, $returnvalue, $params) {\n\n\telgg_load_library('EpiCurl');\n\telgg_load_library('EpiFoursquare');\n\n\t/*static $plugins;\n\tif (!$plugins) {\n\t\t$plugins = elgg_trigger_plugin_hook('plugin_list', 'foursquare_service', NULL, array());\n\t}\n\n\t// ensure valid plugin\n\tif (!in_array($params['plugin'], $plugins)) {\n\t\treturn NULL;\n\t}*/\n\n\t// check admin settings\n\t$consumer_key = elgg_get_plugin_setting('consumer_key', 'foursquare_api');\n\t$consumer_secret = elgg_get_plugin_setting('consumer_secret', 'foursquare_api');\n\tif (!($consumer_key && $consumer_secret)) {\n\t\treturn NULL;\n\t}\n\n\t// check user settings\n\t$user_id = $params['user'];\n\t$foursquare_id = elgg_get_plugin_user_setting('access_key', $user_id, 'foursquare_api');\n\t$access_token = elgg_get_plugin_user_setting('access_secret', $user_id, 'foursquare_api');\n\tif (!($foursquare_id && $access_token)) {\n\t\treturn NULL;\n\t}\n\n // create an array for additional parameters\n\t$params = array(\n\t'beforeTimestamp' => $params['beforeTimestamp'],\n 'afterTimestamp' => $params['afterTimestamp'],\n );\n\n\t// pull venuehistory\n\t// venuehistory endpoint at the time of writing this code allowed only self to be used.userId in place of self not allowed\n\t$api = new EpiFoursquare($consumer_key, $consumer_secret, $access_token);\n\t$response = $api->get(\"/users/self/venuehistory\",$params);\n\n\treturn $response;\n}",
"public function myfriends(){\n\t\t$url = 'http://local.kizzangchef.com/api/playerinvite/myfriends/10/0';\n\t\t$token = null;\t\t\n\t\t$method = 'get';\n\t\t$api_key = $this->getKey();\n\t\t$params = array();\n\t\t$response = $this->doCurl($url, $params, $api_key, $token, $method);\n\t\tvar_dump($response);\n\t\texit;\n\t}",
"function findfriends_bytwitter($q = null) {\n\n\t $params = array_filter(compact('q'));\n\t \n\t\t$url = \"http://api.foursquare.com/v1/findfriends/bytwitter\";\n\t\treturn $this->__process($this->Http->get($url, $params, $this->__getAuthHeader()));\n\t\t\n\t}",
"public static function getPresenceVerifier() {\n \n }",
"function gigya_get_friends_info($gigya_uid, $params = array()) {\n if (empty($gigya_uid)) {\n return FALSE;\n }\n\n $params += array(\n 'uid' => $gigya_uid,\n );\n\n return _gigya_api('getFriendsInfo', $params);\n}",
"function searchUser($artist, $connection) {\r\t$results = $connection->get(\"users/search\", array(\"q\" => $artist, \"count\" => \"20\"));\r\t$verifiedFound = false;\r\tfor ($i = 0; $i < count($results); $i++) {\r\t\t$verified = $results[$i]->verified;\r\t\tif ($verified == 1) {\r\t\t\t$accountName = $results[$i]->name;\r\t\t\t$verifiedFound = true;\r\t\t\tbreak;\r\t\t}\r\t}\r\tif ($verifiedFound == true) {\r\t\tparseData($accountName, $connection, 0);\r\t} else {\r\t\t$output = \"<br>Failure<br>\";\r\t\techo $output;\r\t}\r}",
"public function Get_Service_TeamMembers();",
"function gigya_get_friends($account) {\n $title = isset($account->title) ? $account->title : $account->name;\n drupal_set_title(check_plain($title));\n\n module_load_include('inc', 'gigya');\n $site_friends = array();\n $this_gigya_user = new GigyaUser($account->uid);\n if ($friends = $this_gigya_user->getFriends(array('siteUsersOnly' => TRUE))) {\n if (!empty($friends['friends'])) {\n foreach ($friends['friends'] as $friend) {\n if ($friend['isSiteUser']) {\n $site_friends[] = $friend;\n }\n }\n }\n }\n return theme('gigya_friends', array('friends' => $site_friends));\n}",
"function summonerInfo (){\nglobal $region, $summonerName, $riotapikey, $summonerID, $accountID, $summonerIcon, $summonerLvl;\n$accountInfoURL = \"https://\". $region .\".api.riotgames.com/lol/summoner/v3/summoners/by-name/\". $summonerName .\"?api_key=\" . $riotapikey;\n$accountInfoResult = file_get_contents($accountInfoURL);\n$accountInfoResult = json_decode($accountInfoResult, true);\n$summonerID = $accountInfoResult[\"id\"];\n$accountID = $accountInfoResult[\"accountId\"];\n$summonerIcon = $accountInfoResult[\"profileIconId\"];\n$summonerLvl = $accountInfoResult[\"summonerLevel\"];\n}",
"function getForceAndNhood($lat, $lng) {\n\t// My unique username and password, woo! The API requires this on every query.\n\t$userpass = POLICE_API_KEY;\n\t$url = \"http://policeapi2.rkh.co.uk/api/locate-neighbourhood?q=$lat,$lng\";\n\n\t$curl = curl_init();\n\n\t// Gotta put dat password in.\n\tcurl_setopt($curl, CURLOPT_USERPWD, $userpass);\n\tcurl_setopt($curl, CURLOPT_URL, $url);\n\t\n\t// Without this, we just get \"1\" or similar.\n\tcurl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE);\n\n\t$data = curl_exec($curl);\n\n\tcurl_close($curl);\n\n\t// The API returns JSON, and json_decode produces an interesting mix of objects and arrays.\n\t$dataObj = json_decode($data);\n\t\n\treturn $dataObj;\n\t}",
"public function getPresence()\n {\n if ($this->client == null) {\n return null;\n }\n\n return $this->client->apiCall('users.getPresence', [\n 'user' => $this->getId(),\n ])->then(function (Payload $response) {\n return $response['presence'];\n });\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Attempt to determine the vocabulary for which the field is configured. | protected function getVocab() {
if (!empty($this->fieldInfo['settings']['allowed_values'][0]['vocabulary'])) {
return $this->fieldInfo['settings']['allowed_values'][0]['vocabulary'];
}
} | [
"public function vocabulary() {\n // Legacy handling for old feeds importers.\n if (is_numeric($this->config['vocabulary'])) {\n $vocabularies = taxonomy_get_vocabularies();\n return isset($vocabularies[$this->config['vocabulary']]) ? $vocabularies[$this->config['vocabulary']] : NULL;\n }\n else {\n if ($vocabulary = taxonomy_vocabulary_machine_name_load($this->config['vocabulary'])) {\n return $vocabulary;\n }\n else {\n $vocabularies = taxonomy_get_vocabularies();\n foreach ($vocabularies as $vocabulary) {\n if ($vocabulary->module == $this->config['vocabulary']) {\n return $vocabulary;\n }\n }\n }\n }\n }",
"public function vocabulary() {\n if ($vocabulary = taxonomy_vocabulary_machine_name_load($this->bundle())) {\n return $vocabulary;\n }\n throw new Exception(t('No vocabulary defined for Taxonomy Term processor.'));\n }",
"function _entity_translation_taxonomy_reference_get_vocabulary($field) {\n $vocabulary = NULL;\n if (!empty($field['settings']['allowed_values'])) {\n $vids = array();\n $vocabularies = taxonomy_vocabulary_get_names();\n foreach ($field['settings']['allowed_values'] as $tree) {\n $vids[] = $vocabularies[$tree['vocabulary']]->vid;\n }\n $vocabulary = taxonomy_vocabulary_load(reset($vids));\n }\n return $vocabulary;\n}",
"public function testVocabularyField() {\n // Test that the field exists.\n $field_storage_id = 'node.field_tags';\n /** @var \\Drupal\\field\\FieldStorageConfigInterface $field_storage */\n $field_storage = FieldStorageConfig::load($field_storage_id);\n $this->assertSame($field_storage_id, $field_storage->id());\n\n $settings = $field_storage->getSettings();\n $this->assertSame('taxonomy_term', $settings['target_type'], \"Target type is correct.\");\n $this->assertSame(1, $field_storage->getCardinality(), \"Field cardinality in 1.\");\n\n $this->assertSame([['node', 'field_tags']], $this->getMigration('d6_vocabulary_field')->getIdMap()->lookupDestinationIds([4]), \"Test IdMap\");\n\n // Tests that a vocabulary named like a D8 base field will be migrated and\n // prefixed with 'field_' to avoid conflicts.\n $field_type = FieldStorageConfig::load('node.field_type');\n $this->assertInstanceOf(FieldStorageConfig::class, $field_type);\n }",
"function oa_core_taxonomy_vocabulary($machine_name) {\n // EntityFieldQuery is not subject to the\n // og_vocab_query_taxonomy_vocabulary_load_multiple_alter() function\n $efq = new EntityFieldQuery();\n $result = $efq->entityCondition('entity_type', 'taxonomy_vocabulary')\n ->propertyCondition('machine_name', $machine_name)\n ->execute();\n return !empty($result['taxonomy_vocabulary']) ? current($result['taxonomy_vocabulary']) : NULL;\n}",
"function _npbs_api_taxonomy_vocabulary_retrieve($vocabulary_machine_name){\n $voc = taxonomy_vocabulary_machine_name_load($vocabulary_machine_name);\n check_enabled('taxonomy_vocabulary');\n module_load_include('inc', 'npbs_api', 'resources/fields_resources');\n unset($voc->rdf_mapping);\n return $voc;\n}",
"protected function getForumVocabulary() {\n $vid = $this->configFactory->get('forum.settings')->get('vocabulary');\n return $this->entityTypeManager->getStorage('taxonomy_vocabulary')->load($vid);\n }",
"public function getVocabularyId()\n {\n return $this->vocabulary_id;\n }",
"public function vocabulary(){\n\t\t$array_terms = $this->all_terms_traindata();\n\t\t$vocabulary = array_unique($array_terms);\n\t\t$array_vocabulary = array();\n\t\tforeach ($vocabulary as $unique_term) {\n\t\t\tarray_push($array_vocabulary,$unique_term);\n\t\t}\n\t\treturn $array_vocabulary;\n\t}",
"function taxonomy_get_vocabulary($vid)\n{\n return taxonomy_vocabulary_repository()->find($vid);\n}",
"function dynamic_term_pages_get_enabled_vocabularies() {\n return variable_get('dynamic_term_pages_enabled_vocabularies', array());\n}",
"public function vocabulary()\n {\n return $this->belongsTo(Vocabulary::class, 'vocabulary_id');\n }",
"function ucm_get_vocabularies() {\r\n\t$vocab = taxonomy_get_vocabularies();\r\n if(is_array($vocab)) {\r\n \tforeach($vocab as $key => $val) {\r\n \t if($vocab[$key]->vid) {\r\n $vid = $vocab[$key]->vid;\r\n $output[$vid]= $vocab[$key]->name;\r\n\t }\r\n }\r\n return $output;\r\n } else {\r\n return FALSE;\r\n }\r\n}",
"public function getVocabularyWord()\n {\n return $this->hasOne(VocabularyWord::class, ['id' => 'vocabulary_word_id']);\n }",
"function taxonomy_form_vocabulary($form, &$form_state, $edit = array()) {\n // During initial form build, add the entity to the form state for use\n // during form building and processing. During a rebuild, use what is in the\n // form state.\n if (!isset($form_state['vocabulary'])) {\n $vocabulary = is_object($edit) ? $edit : (object) $edit;\n $defaults = array(\n 'name' => '',\n 'machine_name' => '',\n 'description' => '',\n 'hierarchy' => 0,\n 'weight' => 0,\n );\n foreach ($defaults as $key => $value) {\n if (!isset($vocabulary->$key)) {\n $vocabulary->$key = $value;\n }\n }\n $form_state['vocabulary'] = $vocabulary;\n }\n else {\n $vocabulary = $form_state['vocabulary'];\n }\n\n // @todo Legacy support. Modules are encouraged to access the entity using\n // $form_state. Remove in Drupal 8.\n $form['#vocabulary'] = $form_state['vocabulary'];\n\n // Check whether we need a deletion confirmation form.\n if (isset($form_state['confirm_delete']) && isset($form_state['values']['vid'])) {\n return taxonomy_vocabulary_confirm_delete($form, $form_state, $form_state['values']['vid']);\n }\n $form['name'] = array(\n '#type' => 'textfield',\n '#title' => t('Name'),\n '#default_value' => $vocabulary->name,\n '#maxlength' => 255,\n '#required' => TRUE,\n );\n $form['machine_name'] = array(\n '#type' => 'machine_name',\n '#default_value' => $vocabulary->machine_name,\n '#maxlength' => 255,\n '#machine_name' => array(\n 'exists' => 'taxonomy_vocabulary_machine_name_load',\n ),\n );\n $form['old_machine_name'] = array(\n '#type' => 'value',\n '#value' => $vocabulary->machine_name,\n );\n $form['description'] = array(\n '#type' => 'textfield',\n '#title' => t('Description'),\n '#default_value' => $vocabulary->description,\n );\n // Set the hierarchy to \"multiple parents\" by default. This simplifies the\n // vocabulary form and standardizes the term form.\n $form['hierarchy'] = array(\n '#type' => 'value',\n '#value' => '0',\n );\n\n $form['actions'] = array('#type' => 'actions');\n $form['actions']['submit'] = array('#type' => 'submit', '#value' => t('Save'));\n if (isset($vocabulary->vid)) {\n $form['actions']['delete'] = array('#type' => 'submit', '#value' => t('Delete'));\n $form['vid'] = array('#type' => 'value', '#value' => $vocabulary->vid);\n $form['module'] = array('#type' => 'value', '#value' => $vocabulary->module);\n }\n $form['#validate'][] = 'taxonomy_form_vocabulary_validate';\n\n return $form;\n}",
"function punbb2drupal_forum_vocab_id() {\n static $vid;\n \n if (!$vid) {\n $vid = db_result(db_query(\"SELECT vid FROM {vocabulary} WHERE module = 'forum'\"));\n }\n\n return $vid;\n}",
"protected function createVocabulary() {\n // Create a vocabulary.\n $vocabulary = Vocabulary::create(array(\n 'name' => $this->randomMachineName(),\n 'description' => $this->randomMachineName(),\n 'vid' => Unicode::strtolower($this->randomMachineName()),\n 'langcode' => LanguageInterface::LANGCODE_NOT_SPECIFIED,\n ));\n $vocabulary->save();\n return $vocabulary;\n }",
"function musth_amf_service_get_ape_name_for_a_vocabulary($vid) {\n\n $full_flash_settings = musth_amf_service_full_flash_settings();\n\n $vocabulary_info = $full_flash_settings['vocabulary_info'];\n\n if (!isset($vocabulary_info[$vid])) {\n // Invalid vocabulary id\n\n watchdog('musth_amf_service', 'W3E019 Invalid vid in get_ape_name_for_a_vocabulary (!v)',\n array('!v' => print_r($vid, true)),\n WATCHDOG_ERROR);\n\n return FALSE;\n }\n\n return $vocabulary_info[$vid]['ape_name'];\n}",
"function itis_term_fields_per_vocabulary(){\n return array(\n array(\n 'field_config' => array(\n 'active' => '1',\n 'cardinality' => '1',\n 'deleted' => '0',\n 'entity_types' => array(),\n 'field_name' => 'field_aan',\n 'foreign keys' => array(\n 'tid' => array(\n 'columns' => array(\n 'tid' => 'tid'\n ),\n 'table' => 'taxonomy_term_data'\n )\n ),\n 'indexes' => array(\n 'tid' => array(\n 0 => 'tid'\n )\n ),\n 'module' => 'taxonomy',\n 'settings' => array(\n 'allowed_values' => array(\n 0 => array(\n 'parent' => '0',\n 'vocabulary' => 'tags'\n )\n )\n ),\n 'translatable' => '1',\n 'type' => 'taxonomy_term_reference'\n ),\n 'field_instance' => array(\n 'bundle' => 'tags',\n 'default_value' => NULL,\n 'deleted' => '0',\n 'description' => t('The scientific name of the valid or accepted taxon identified as the currently accepted name used for a given invalid or not accepted name. Each name that is in synonymy (junior synonyms, obsolete combinations, etc.) must be connected to one accepted or valid name.'),\n 'display' => array(\n 'default' => array(\n 'label' => 'inline',\n 'module' => 'taxonomy',\n 'settings' => array(),\n 'type' => 'hidden',\n 'weight' => -10\n )\n ),\n 'entity_type' => 'taxonomy_term',\n 'field_name' => 'field_aan',\n 'label' => 'Associated accepted name',\n 'required' => 0,\n 'settings' => array(\n 'user_register_form' => FALSE\n ),\n 'widget' => array(\n 'active' => 0,\n 'module' => 'taxonomy',\n 'settings' => array(\n 'autocomplete_path' => 'taxonomy/autocomplete'\n ),\n 'type' => 'taxonomy_autocomplete',\n 'weight' => '11'\n )\n )\n )\n );\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get a job data item, or the specified default if it is not yet set | public function jobdata_get($key, $default = null) {
if (empty($this->jobdata)) {
$this->jobdata = empty($this->nonce) ? array() : get_site_option('updraft_jobdata_'.$this->nonce, array());
if (!is_array($this->jobdata)) return $default;
}
return isset($this->jobdata[$key]) ? $this->jobdata[$key] : $default;
} | [
"public function getJobDefaultValue() {\n //initialize dummy value.. no content header.pure html \n $sql = null;\n $jobId = null;\n if ($this->getVendor() == self::MYSQL) {\n $sql = \" \n SELECT `jobId`\n FROM \t`job`\n WHERE `isActive` = 1\n AND `companyId` = '\" . $this->getCompanyId() . \"'\n AND \t `isDefault` =\t 1\n LIMIT 1\";\n } else if ($this->getVendor() == self::MSSQL) {\n $sql = \" \n SELECT TOP 1 [jobId],\n FROM [job]\n WHERE [isActive] = 1\n AND [companyId] = '\" . $this->getCompanyId() . \"'\n AND \t [isDefault] = 1\";\n } else if ($this->getVendor() == self::ORACLE) {\n $sql = \" \n SELECT JOBID AS \\\"jobId\\\",\n FROM JOB \n WHERE ISACTIVE = 1\n AND COMPANYID = '\" . $this->getCompanyId() . \"'\n AND \t ISDEFAULT\t =\t 1\n AND \t\t ROWNUM\t =\t 1\";\n } else {\n header('Content-Type:application/json; charset=utf-8');\n echo json_encode(array(\"success\" => false, \"message\" => $this->t['databaseNotFoundMessageLabel']));\n exit();\n }\n try {\n $result = $this->q->fast($sql);\n } catch (\\Exception $e) {\n echo json_encode(array(\"success\" => false, \"message\" => $e->getMessage()));\n exit();\n }\n if ($result) {\n $row = $this->q->fetchArray($result);\n $jobId = $row['jobId'];\n }\n return $jobId;\n }",
"protected function getItemOrDefault($name, $itemName, $default = null) {\n return isset($this->data[$name][$itemName]) ? $this->data[$name][$itemName] : $default;\n }",
"protected function getDataItem($name, $default = null)\n {\n $data = $this->getData();\n return isset($this->data[$name]) ? $this->data[$name] : $default;\n }",
"public static function get($item, $default = '', $postfirst=true, $lock = 'no'){\n\t\tif($postfirst && $lock != 'get' || $lock == 'post'){\n\t\t\tif(isset($_POST[$item])) return $_POST[$item];\n\t\t\telseif($lock=='no' && isset($_GET[$item])) return $_GET[$item];\n\t\t} elseif(!$postfirst && $lock != 'post' || $lock == 'get') {\n\t\t\tif(isset($_GET[$item])) return $_GET[$item];\n\t\t\telseif($lock=='no' && isset($_POST[$item])) return $_POST[$item];\n\t\t}\n\t\treturn $default;\n\t}",
"public static function get($item, $field_name, $default = null){\r\n\t\tif ( isset($item[$field_name]) ){\r\n\t\t\treturn $item[$field_name];\r\n\t\t} else {\r\n\t\t\tif ( isset($item['defaults'], $item['defaults'][$field_name]) ){\r\n\t\t\t\treturn $item['defaults'][$field_name];\r\n\t\t\t} else {\r\n\t\t\t\treturn $default;\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"public function getOrElse($default)\n {\n if ($this->isDefined()) {\n return $this->get();\n }\n return $default;\n }",
"public function getOrDefault($key, $default);",
"static function read($key, $default = null) {\n if (self::exists($key)) {\n $result = self::first(array('conditions' => array('key' => $key)));\n return $result['value'];\n } else {\n return $default;\n }\n }",
"public function getResource($default = null)\n {\n $body = (array) $this->getParsedBody();\n\n return $body[\"data\"] ?? $default;\n }",
"public function getOrElse($default);",
"public function get(?string $key = null, $default = null);",
"function get_or_default($arr, $key, $default) {\r\n\tif(isset($arr[$key])) {\r\n\t\treturn $arr[$key];\r\n\t} else {\r\n\t\treturn $default;\r\n\t}\r\n}",
"function get_value_or_default($value,$default='')\n{\n\treturn (!empty($value)) ? $default : $value;\n}",
"public static function get($item, $default = null)\n {\n self::ensureRegistryPresence();\n\n return self::$registry->get($item, $default);\n }",
"public function getValue($key, $default = null)\n {\n if (is_array($this->kwargs) && isset($this->kwargs[$key])) {\n return $this->kwargs[$key];\n }\n return $default; // @codeCoverageIgnore\n }",
"function getItem($key, $array, $default=null) {\n\t\tif (array_key_exists($key, $array)) {\n\t\t\treturn $array[$key];\n\t\t} else {\n\t\t\tif (func_num_args() === 3) {\n\t\t\t\treturn $default;\n\t\t\t} else {\n\t\t\t\tdie('<b>getItem Error:</b> Unable to find key <b>'.$key.'</b> in the array '.print_r($array, true));\n\t\t\t}\n\t\t}\n\t}",
"public function getSummaryItem($key, $default = false) {\n\t\t$this->_fetchSummaryItems();\n\t\tif (isset($this->_summary[$key])) {\n\t\t\treturn $this->_summary[$key];\n\t\t}\n\t\treturn $default;\n\t}",
"public function get_default_value();",
"public function orElse($default) {\n return $this->present ? $this->value : $default;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Appends value to '_hire_hero' list | public function appendHireHero($value)
{
return $this->append(self::_HIRE_HERO, $value);
} | [
"public function appendNewHeroes(Down_Hero $value)\n {\n return $this->append(self::_NEW_HEROES, $value);\n }",
"public function appendHeroes(Down_Hero $value)\n {\n return $this->append(self::_HEROES, $value);\n }",
"public function appendHero(\\PB_Hero $value)\n {\n return $this->append(self::HERO, $value);\n }",
"public function appendHeroes($value)\n {\n return $this->append(self::_HEROES, $value);\n }",
"public function appendOppoHeroes(Bcdown_Hero $value)\n {\n return $this->append(self::_OPPO_HEROES, $value);\n }",
"public function appendStHeroIdList($value)\n {\n return $this->append(self::STHEROIDLIST, $value);\n }",
"public function appendSelfHeroes(Bcdown_Hero $value)\n {\n return $this->append(self::_SELF_HEROES, $value);\n }",
"public function appendOppoHeroes(Msg_Hero $value)\r\n {\r\n return $this->append(self::_OPPO_HEROES, $value);\r\n }",
"public function appendHeroes(Down_TbcSelfHero $value)\n {\n return $this->append(self::_HEROES, $value);\n }",
"public function setAddHire(Up_GuildAddHire $value)\n {\n return $this->set(self::_ADD_HIRE, $value);\n }",
"public function appendSelfHeroes(Down_Hero $value)\n {\n return $this->append(self::_SELF_HEROES, $value);\n }",
"public function setHireHero(Down_GuildHireHero $value)\n {\n return $this->set(self::_HIRE_HERO, $value);\n }",
"public function appendHp($value)\n {\n return $this->append(self::_HP, $value);\n }",
"public function appendSelfHeroes(Msg_Hero $value)\r\n {\r\n return $this->append(self::_SELF_HEROES, $value);\r\n }",
"public function appendHeroSkills($value)\n {\n return $this->append(self::HERO_SKILLS, $value);\n }",
"public function appendStMetalPurpleHeroRecord($value)\n {\n return $this->append(self::STMETALPURPLEHERORECORD, $value);\n }",
"public function appendReleaseHeroes($value)\n {\n return $this->append(self::_RELEASE_HEROES, $value);\n }",
"public function appendHireUids($value)\n {\n return $this->append(self::_HIRE_UIDS, $value);\n }",
"public function add_hero_fields() {\n\t\tacf_add_local_field_group( array(\n\t\t\t'key' => 'home_hero',\n\t\t\t'title' => __( 'Hero', 'elemarjr' ),\n\t\t\t'hide_on_screen' => array( 'the_content' ),\n\t\t\t'fields' => array(\n\t\t\t\tarray(\n\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t'key' => 'hero_title',\n\t\t\t\t\t'name' => 'hero_title',\n\t\t\t\t\t'label' => __( 'Title', 'elemarjr' ),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'type' => 'wysiwyg',\n\t\t\t\t\t'key' => 'hero_text',\n\t\t\t\t\t'name' => 'hero_text',\n\t\t\t\t\t'label' => __( 'Text', 'elemarjr' ),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t'key' => 'hero_button_label',\n\t\t\t\t\t'name' => 'hero_button_label',\n\t\t\t\t\t'label' => __( 'Button Label', 'elemarjr' ),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'type' => 'url',\n\t\t\t\t\t'key' => 'hero_button_url',\n\t\t\t\t\t'name' => 'hero_button_url',\n\t\t\t\t\t'label' => __( 'Button URL', 'elemarjr' ),\n\t\t\t\t),\n\t\t\t),\n\t\t\t'location' => $this->location,\n\t\t) );\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
test grabbing a Trail by TrailCondition that does not exist | public function testGetInvalidTrailByTrailCondition() {
//grab a TrailCondition that does not exist
$trail = Trail::getTrailByTrailCondition($this->getPDO(), "<script></script>");
$this->assertNull($trail);
} | [
"public\n\t\tfunction testGetInvalidTrailByTrailSubmissionType() {\n\t\t\t//grab a TrailSubmissionType that does not exist\n\t\t\t$trail = Trail::getTrailByTrailSubmissionType($this->getPDO(), \"null\");\n\t\t\t$this->assertNull($trail);\n\t\t}",
"public function testGetInvalidAllTrails() {\n\t\t//grab a TrailAccessibility that does not exist\n\t\t$trail = Trail::getAllTrails($this->getPDO(), \"<script></script>\");\n\t\t$this->assertNull($trail);\n\t}",
"public function testGetInvalidTrailName() : void {\n\t\t//grab a trail by a name that doesn't exist\n\t\t$trail = Trail::getTrailByTrailName($this->getPDO(), \"A Goofy Trail\");\n\t\t$this->assertCount(0, $trail);\n\t}",
"public function testGetInvalidTrailByDistance() : void {\n\t\t// grab a trail by distance that does not exist\n\t\t$trail = Trail::getTrailByDistance($this->getPDO(), 35.0855, -106.6491, 100);\n\t\t$this->assertCount(0, $trail);\n\t}",
"public function testGetInvalidTrailRelationshipByTrailId() {\n\t\t//grab a trailId that exceeds the maximum allowable trailId\n\t\t$trailRelationship = TrailRelationship::getTrailRelationshipByTrailId($this->getPDO(), TrailQuailTest::INVALID_KEY);\n\t\t$this->assertNull($trailRelationship);\n\t}",
"public function testGetInvalidTrailByTrailId() : void {\n\t\t// grab a trail id that exceeds the maximum allowable trail id\n\t\t$trail = Trail::getTrailByTrailId($this->getPDO(), generateUuidV4());\n\t\t$this->assertNull($trail);\n\t}",
"public function testGetInvalidTrailRelationshipBySegmentIdAndTrailId() {\n\t\t//grab a segmentId that exceeds the maximum allowable segmentId\n\t\t$trailRelationship = TrailRelationship::getTrailRelationshipBySegmentIdAndTrailId($this->getPDO(), TrailQuailTest::INVALID_KEY, TrailQuailTest::INVALID_KEY);\n\t\t$this->assertNull($trailRelationship);\n\t}",
"function testGetDepartingTrainsNotExistingStation() {\n\t\t$result = $this->travlr->get_departing_trains( 'Not a real city' );\n\t\t$this->assertTrue( is_object( $result ) );\n\t\t$this->assertEquals( $result->get_error_message(), 'Cant find station' );\n\t}",
"public function testGetValidTrailByTrailTraffic() {\n\t\t\t//count the number of rows and save it for later\n\t\t\t$numRows = $this->getConnection()->getRowCount(\"trail\");\n\n\t\t\t//create a new trail and insert it into mySQL\n\t\t\t$trail = new Trail(null, $this->user->getUserId(), $this->VALID_BROWSER, $this->VALID_CREATEDATE, $this->VALID_IPADDRESS, $this->VALID_SUBMITTRAILID,\n\t\t\t\t\t$this->VALID_TRAILAMENITIES, $this->VALID_TRAILCONDITIION, $this->VALID_TRAILDESCRIPTION, $this->VALID_TRAILDIFFICULTY,\n\t\t\t\t\t$this->VALID_TRAILDISTANCE, $this->VALID_TRAILNAME, $this->VALID_TRAILSUBMISSIONTYPE, $this->VALID_TRAILTERRAIN, $this->VALID_TRAILTRAFFIC,\n\t\t\t\t\t$this->VALID_TRAILUSE, $this->VALID_TRAILUUID);\n\n\t\t\t$trail->insert($this->getPDO());\n\n\t\t\t//grab the data from mySQL and enforce the fields match our expectations\n\t\t\t$pdoTrails = Trail::getTrailByTrailTraffic($this->getPDO(), $trail->getTrailTraffic());\n\t\t\tforeach($pdoTrails as $pdoTrail) {\n\t\t\t\t$this->assertSame($numRows + 1, $this->getConnection()->getRowCount(\"trail\"));\n\t\t\t\t$this->assertLessThan($pdoTrail->getTrailId(),0);\n\t\t\t\t$this->assertSame($pdoTrail->getUserId(), $this->user->getUserId());\n\t\t\t\t$this->assertSame($pdoTrail->getBrowser(), $this->VALID_BROWSER);\n\t\t\t\t$this->assertEquals($pdoTrail->getCreateDate(), $this->VALID_CREATEDATE);\n\t\t\t\t$this->assertSame($pdoTrail->getIpAddress(), $this->VALID_IPADDRESS);\n\t\t\t\t$this->assertSame($pdoTrail->getSubmitTrailId(), $this->VALID_SUBMITTRAILID);\n\t\t\t\t$this->assertSame($pdoTrail->getTrailAmenities(), $this->VALID_TRAILAMENITIES);\n\t\t\t\t$this->assertSame($pdoTrail->getTrailCondition(), $this->VALID_TRAILCONDITIION);\n\t\t\t\t$this->assertSame($pdoTrail->getTrailDescription(), $this->VALID_TRAILDESCRIPTION);\n\t\t\t\t$this->assertSame($pdoTrail->getTrailDifficulty(), $this->VALID_TRAILDIFFICULTY);\n\t\t\t\t$this->assertSame($pdoTrail->getTrailDistance(), $this->VALID_TRAILDISTANCE);\n\t\t\t\t$this->assertSame($pdoTrail->getTrailName(), $this->VALID_TRAILNAME);\n\t\t\t\t$this->assertSame($pdoTrail->getTrailDescription(), $this->VALID_TRAILDESCRIPTION);\n\t\t\t\t$this->assertSame($pdoTrail->getTrailSubmissionType(), $this->VALID_TRAILSUBMISSIONTYPE);\n\t\t\t\t$this->assertSame($pdoTrail->getTrailTerrain(), $this->VALID_TRAILTERRAIN);\n\t\t\t\t$this->assertSame($pdoTrail->getTrailTraffic(), $this->VALID_TRAILTRAFFIC);\n\t\t\t\t$this->assertSame($pdoTrail->getTrailUse(), $this->VALID_TRAILUSE);\n\t\t\t\t$this->assertSame($this->longUuidToShortUuid($pdoTrail->getTrailUuId()), $this->VALID_TRAILUUID);\n\t\t\t}\n\t\t}",
"public function testGetInvalidTrailRelationshipBySegmentType() {\n\t\t//grab a segmentType that exceeds the maximum allowable segmentType\n\t\t$trailRelationship = TrailRelationship::getTrailRelationshipBySegmentType($this->getPDO(), \"Q\");\n\t\t$this->assertNull($trailRelationship);\n\t}",
"public function PIDupinRootlineConditionDoesNotMatchPageIdNotInRootline() {}",
"public function PIDinRootlineConditionDoesNotMatchPageIdNotInRootline() {}",
"public function testInsertInvalidTrail() {\n\t\t//create a profile with a non null trailId and break the system\n\t\t$trail = new Trail(TrailQuailTest::INVALID_KEY, $this->VALID_SUBMITTRAILID, $this->user->getUserId(), $this->VALID_BROWSER, $this->VALID_CREATEDATE, $this->VALID_IPADDRESS,\n\t\t\t\t$this->VALID_TRAILAMENITIES, $this->VALID_TRAILCONDITIION, $this->VALID_TRAILDESCRIPTION, $this->VALID_TRAILDIFFICULTY,\n\t\t\t\t$this->VALID_TRAILDISTANCE, $this->VALID_TRAILSUBMISSIONTYPE, $this->VALID_TRAILNAME,\n\t\t\t\t$this->VALID_TRAILTERRAIN, $this->VALID_TRAILTRAFFIC, $this->VALID_TRAILUSE, $this->VALID_TRAILUUID);\n\t\t$trail->insert($this->getPDO());\n\t}",
"public function testNoContextCondition() {\n // Setup a rule with one condition.\n $this->testCreateReactionRule();\n\n $this->clickLink('Add condition');\n // The rules_test_true condition does not define context in its annotation.\n $this->fillField('Condition', 'rules_test_true');\n $this->pressButton('Continue');\n // Pressing 'Save' will generate an exception and the test will fail if\n // Rules does not support conditions without a context.\n // Exception: Warning: Invalid argument supplied for foreach().\n $this->pressButton('Save');\n }",
"public function testFacilityDoesntExist()\n {\n $this->browse(function (Browser $browser){\n $browser->visit('http://storageseeker/facility/666666666')\n ->click('.phpdebugbar-close-btn')\n ->assertSee('Facility with ID: 666666666 not found')\n ;\n });\n $this->closeAll();\n }",
"public function skipCriteria( $status = TRUE );",
"#[@test]\n public function nonExistantAttribute() {\n $this->assertEquals(null, $this->entry->getAttribute('@@NON-EXISTANT@@'));\n }",
"public function PIDupinRootlineConditionDoesNotMatchLastPageIdInRootline() {}",
"public function testGetConditionsForNotReadable() {\n\t\t$permissions = [\n\t\t\t'content_readable' => false,\n\t\t];\n\t\t$result = $this->BlogEntry->getConditions(1, $permissions);\n\t\t$this->assertEquals(['BlogEntry.id' => 0], $result);\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Loads the chart data according to the supplied criteria or all the data if null is passed. | public function load(IChartCriteria $criteria = null) : IChartDataTable; | [
"public function loadData()\n\t{\n\t\t$sql = $this->ChartSql;\n\t\t$cnn = Conn($this->Table->Dbid);\n\t\t$rscht = $cnn->Execute($sql);\n\t\twhile ($rscht && !$rscht->EOF) {\n\t\t\t$temp = [];\n\t\t\tfor ($i = 0; $i < $rscht->FieldCount(); $i++)\n\t\t\t\t$temp[$i] = $rscht->fields[$i];\n\t\t\t$this->Data[] = $temp;\n\t\t\t$rscht->MoveNext();\n\t\t}\n\t\tif ($rscht) $rscht->Close();\n\t}",
"public function loadExtraPostData($criterion){\n \n $subCriteria = array();\n $observations = array();\n \n // Criteria-only conversion chart\n if (isset($criterion['chart']))\n {\n foreach($criterion['chart'] as $awardID => $points)\n {\n $this->setAttribute(\"conversion_chart_{$awardID}\", (int)$points);\n }\n }\n \n \n // Now the sub criteria\n if (isset($criterion['subcriteria']))\n {\n foreach($criterion['subcriteria'] as $subDNum => $sub)\n {\n \n $id = (isset($sub['id'])) ? $sub['id'] : false;\n $subObj = new \\GT\\Criteria\\NumericCriterion($id);\n $subObj->setQualStructureID($this->qualStructureID);\n $subObj->setType($this->type);\n $subObj->setName($sub['name']);\n $subObj->setSubCritType(\"Criterion\");\n $subObj->setDynamicNumber( floatval($this->dynamicNumber . '.' . $subDNum) );\n $subObj->setGradingStructureID($this->gradingStructureID);\n if (isset($sub['points'])){\n $subObj->setAttribute(\"maxpoints\", $sub['points']);\n }\n $subObj->setAttribute(\"gradingtype\", \"NORMAL\");\n $this->addChild($subObj, true);\n \n $subCriteria[$subDNum] = $subObj;\n \n }\n }\n \n // Now the observations\n if (isset($criterion['observation']))\n {\n foreach($criterion['observation'] as $obNum => $observation)\n {\n \n $id = (isset($observation['id'])) ? $observation['id'] : false;\n $subObj = new \\GT\\Criteria\\NumericCriterion($id);\n $subObj->setQualStructureID($this->qualStructureID);\n $subObj->setType($this->type);\n $subObj->setName($observation['name']);\n $subObj->setSubCritType(\"Range\");\n $subObj->setDynamicNumber( floatval($this->dynamicNumber . '.' . $obNum) );\n $subObj->setGradingStructureID($this->gradingStructureID);\n $subObj->setAttribute(\"gradingtype\", \"NORMAL\");\n \n // Chart\n if (isset($criterion['charts'][$obNum])){\n foreach($criterion['charts'][$obNum] as $awardID => $points)\n {\n $subObj->setAttribute(\"conversion_chart_{$awardID}\", (int)$points);\n }\n }\n \n $this->addChild($subObj, true);\n \n $observations[$obNum] = $subObj;\n \n }\n }\n \n if (isset($criterion['points']))\n {\n foreach($criterion['points'] as $link => $points)\n {\n \n $link = explode(\"|\", $link);\n $subCritNum = $link[0];\n $obNum = $link[1];\n \n $this->pointLinks[] = array(\n 'Criterion' => $subCriteria[$subCritNum],\n 'Range' => $observations[$obNum],\n 'Points' => $points\n );\n \n }\n }\n \n \n }",
"public function prepareData() {\n $this->criteria = new Criteria();\n\n foreach($this->options as $key=>$value) {\n switch($key) {\n case 'join': $this->criteria->setJoin($value);\n break;\n case 'condition': $this->criteria->setCondition($this->addConstant($value));\n break;\n case 'order': $this->criteria->setOrder($value);\n break;\n case 'limit': $this->criteria->setLimit($value);\n break;\n case 'params':\n $value = json_decode($value);\n\n foreach($value as $name => $param) {\n $this->criteria->addParam($name, $param);\n }\n break;\n }\n }\n }",
"protected function loadData()\n {\n $this->data = $this->mapper->fetchObjects($this->query);\n }",
"public function loadAll(array $criteria = [], array $orderBy = [], $limit = null, $offset = null);",
"public function loadAll($conditions);",
"public function getChartData() {\r\r\n\t\t$date = $this->date;\r\r\n\t\t$time = strtotime($date);\r\r\n\t\t$month = date('m', $time);\r\r\n\t\t$year = date('Y', $time);\r\r\n\t\t$day = date('d', $time);\r\r\n\t\t\r\r\n\t\t$data = [];\r\r\n\t\t$data['name'] = $this->getInsuranceName($this->type);\r\r\n\r\r\n\t\t$total = [];\r\r\n\t\t$total['name'] = 'Total';\r\r\n\r\r\n\t\t$temp_fields_data = [];\r\r\n\t\t$status_name = \"LOB\";\r\r\n\t\t$fields = $this->getFieldsByAlias($status_name);\r\r\n\t\t\r\r\n\t\t// Per Insurance Month Pie Chart\r\r\n\t\t$falias_month['data'] = $this->getFieldsDataByAlias($status_name);\r\r\n\t\t$falias_month['date'] = date('M, Y', strtotime($this->date));\r\r\n\r\r\n\t\t// Per Insurance Year line chart & total combine line chart\r\r\n\t\t$falias_year = [];\r\r\n\t\t$field_titles = [];\r\r\n\t\t$months = [];\r\r\n\t\tfor ($i=0; $i < 12; $i++) { \r\r\n\t\t\t$mon = $month - $i;\r\r\n\t\t\tif ($mon > 0) {\r\r\n\t\t\t\t$date = date('Y-m-d',strtotime($year.'-'.$mon.'-'.$day));\r\r\n\t\t\t} else {\r\r\n\t\t\t\t$mon = 12;\r\r\n\t\t\t\t$month = $month + 12;\r\r\n\t\t\t\t$year = $year - 1;\r\r\n\t\t\t\t$date = date('Y-m-d',strtotime($year.'-'.$mon.'-'.$day));\r\r\n\t\t\t}\r\r\n\t\t\t$data['data'][] = $this->getCountPatients($date, false);\r\r\n\t\t\t$total['data'][] = $this->getCountPatients($date, true);\r\r\n\t\t\tforeach ($fields as $key => $field) {\r\r\n\t\t\t\t$falias_year[$key]['data'][] = $this->getCountByFieldName($field['value'], $date);\r\r\n\t\t\t\t$falias_year[$key]['title'] = $field['value'];\r\r\n\t\t\t}\r\r\n\t\t\t$months[] = date('M, Y', strtotime($date));\r\r\n\t\t}\r\r\n\t\tforeach ($falias_year as $key => $falias) {\r\r\n\t\t\t$falias_year[$key]['data'] = array_reverse($falias['data']);\r\r\n\t\t}\r\r\n\t\t$this->month = array_reverse($months);\r\r\n\t\t$data['data'] = array_reverse($data['data']);\r\r\n\t\t$total['data'] = array_reverse($total['data']);\r\r\n\t\treturn array('data' => $data, 'total' => $total, 'falias_month' => $falias_month, 'falias_year' => $falias_year, 'status_name' => $status_name);\r\r\n\t}",
"public function getChartData() {\n\t\t$json = array();\n\n\t\t$labels = $datasets = $xAxes = $yAxes = array();\n\n\t\tif (isset($this->request->get['type'])) {\n\t\t\tswitch ((string)$this->request->get['type']) {\n\t\t\t\tcase \"sales_analytics\":\n\t\t\t\t\t$chart_data = $this->MsLoader->MsReport->getSalesAnalytics(array(\n\t\t\t\t\t\t'date_start' => isset($this->request->get['date_start']) ? $this->request->get['date_start'] : false,\n\t\t\t\t\t\t'date_end' => isset($this->request->get['date_end']) ? $this->request->get['date_end'] : false,\n\t\t\t\t\t\t'metric' => isset($this->request->get['metric']) ? $this->request->get['metric'] : false\n\t\t\t\t\t));\n\n\t\t\t\t\t$total_orders = $gross_sales = array();\n\t\t\t\t\t$tooltip_data_total_orders = $tooltip_data_gross_sales = array();\n\t\t\t\t\t$max_total_orders = $max_gross_sales = 0;\n\n\t\t\t\t\tforeach ($chart_data as $data) {\n\t\t\t\t\t\tif ($data['total'] > $max_total_orders) $max_total_orders = $data['total'];\n\t\t\t\t\t\tif ($data['gross_total'] > $max_gross_sales) $max_gross_sales = $data['gross_total'];\n\n\t\t\t\t\t\t$labels[] = $data['date'];\n\t\t\t\t\t\t$total_orders[] = $data['total'];\n\t\t\t\t\t\t$gross_sales[] = !is_null($data['gross_total']) ? $this->currency->format($data['gross_total'], $this->config->get('config_currency'), '', false) : NULL;\n\n\t\t\t\t\t\t$tooltip_data_total_orders[] = $this->language->get('ms_dashboard_total_orders') . \": \" . end($total_orders);\n\t\t\t\t\t\t$tooltip_data_gross_sales[] = $this->language->get('ms_dashboard_gross_sales') . \": \" . $this->currency->format(end($gross_sales), $this->config->get('config_currency'));\n\t\t\t\t\t}\n\n\t\t\t\t\t$step_gross_sales = pow(10, $this->MsLoader->MsHelper->getNumberOfSignificantDigits($max_gross_sales) - 1);\n\t\t\t\t\t$step_total_orders = pow(10, $this->MsLoader->MsHelper->getNumberOfSignificantDigits($max_total_orders) - 1);\n\n\t\t\t\t\t$max_gross_rescaled = $this->MsLoader->MsHelper->ceiling($max_gross_sales, $step_gross_sales);\n\t\t\t\t\t$max_total_rescaled = $this->MsLoader->MsHelper->ceiling($max_total_orders, $step_total_orders);\n\n\t\t\t\t\t$datasets = array(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'fill' => false,\n\t\t\t\t\t\t\t'label' => $this->language->get('ms_dashboard_gross_sales'),\n\t\t\t\t\t\t\t'yAxisID' => 'gross',\n\t\t\t\t\t\t\t'borderColor' => '#77c2d8',\n\t\t\t\t\t\t\t'data' => $gross_sales,\n\t\t\t\t\t\t\t'tooltip_data' => $tooltip_data_gross_sales\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'fill' => false,\n\t\t\t\t\t\t\t'label' => $this->language->get('ms_dashboard_total_orders'),\n\t\t\t\t\t\t\t'yAxisID' => 'total',\n\t\t\t\t\t\t\t'borderColor' => '#ffb15e',\n\t\t\t\t\t\t\t'data' => $total_orders,\n\t\t\t\t\t\t\t'tooltip_data' => $tooltip_data_total_orders\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\n\t\t\t\t\t$yAxes = array(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'id' => 'gross',\n\t\t\t\t\t\t\t'type' => 'linear',\n\t\t\t\t\t\t\t'position' => 'left',\n\t\t\t\t\t\t\t'ticks' => array(\n\t\t\t\t\t\t\t\t'min' => 0,\n\t\t\t\t\t\t\t\t'max' => $max_gross_rescaled,\n\t\t\t\t\t\t\t\t'stepSize' => $step_gross_sales,\n\t\t\t\t\t\t\t\t'data_formatted' => $this->_formatCurrencyTicks(0, $max_gross_rescaled, $step_gross_sales)\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'id' => 'total',\n\t\t\t\t\t\t\t'type' => 'linear',\n\t\t\t\t\t\t\t'position' => 'right',\n\t\t\t\t\t\t\t'gridLines' => array(\n\t\t\t\t\t\t\t\t'display' => false\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t'ticks' => array(\n\t\t\t\t\t\t\t\t'min' => 0,\n\t\t\t\t\t\t\t\t'max' => $max_total_rescaled,\n\t\t\t\t\t\t\t\t'stepSize' => $step_total_orders\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\n\t\t\t\t\t$xAxes = array(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'gridLines' => array(\n\t\t\t\t\t\t\t\t'display' => false\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\n\t\t\t\t\t$type = 'line';\n\n\t\t\t\t\t$no_results_error = $this->language->get('ms_dashboard_sales_analytics_no_results');\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase \"top_countries\":\n\t\t\t\t\t$chart_data = $this->MsLoader->MsReport->getTopCountriesAnalytics(array(\n\t\t\t\t\t\t'date_start' => isset($this->request->get['date_start']) ? $this->request->get['date_start'] : false,\n\t\t\t\t\t\t'date_end' => isset($this->request->get['date_end']) ? $this->request->get['date_end'] : false,\n\t\t\t\t\t));\n\n\t\t\t\t\tlist($type, $labels, $datasets, $xAxes, $yAxes, $no_results_error) = $this->prepareHorizontalBarChartData($this->request->get['type'], $chart_data);\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase \"top_sellers\":\n\t\t\t\t\t$chart_data = $this->MsLoader->MsReport->getTopSellersAnalytics(array(\n\t\t\t\t\t\t'date_start' => isset($this->request->get['date_start']) ? $this->request->get['date_start'] : false,\n\t\t\t\t\t\t'date_end' => isset($this->request->get['date_end']) ? $this->request->get['date_end'] : false,\n\t\t\t\t\t));\n\n\t\t\t\t\tlist($type, $labels, $datasets, $xAxes, $yAxes, $no_results_error) = $this->prepareHorizontalBarChartData($this->request->get['type'], $chart_data);\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase \"top_customers\":\n\t\t\t\t\t$chart_data = $this->MsLoader->MsReport->getTopCustomersAnalytics(array(\n\t\t\t\t\t\t'date_start' => isset($this->request->get['date_start']) ? $this->request->get['date_start'] : false,\n\t\t\t\t\t\t'date_end' => isset($this->request->get['date_end']) ? $this->request->get['date_end'] : false,\n\t\t\t\t\t));\n\n\t\t\t\t\tlist($type, $labels, $datasets, $xAxes, $yAxes, $no_results_error) = $this->prepareHorizontalBarChartData($this->request->get['type'], $chart_data);\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase \"top_products\":\n\t\t\t\t\t$chart_data = $this->MsLoader->MsReport->getTopProductsAnalytics(array(\n\t\t\t\t\t\t'date_start' => isset($this->request->get['date_start']) ? $this->request->get['date_start'] : false,\n\t\t\t\t\t\t'date_end' => isset($this->request->get['date_end']) ? $this->request->get['date_end'] : false,\n\t\t\t\t\t));\n\n\t\t\t\t\tlist($type, $labels, $datasets, $xAxes, $yAxes, $no_results_error) = $this->prepareHorizontalBarChartData($this->request->get['type'], $chart_data);\n\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t$json['chart_data'] = array(\n\t\t\t'common' => array(\n\t\t\t\t'currency_symbol_left' => $this->currency->getSymbolLeft($this->config->get('config_currency')),\n\t\t\t\t'currency_symbol_right' => $this->currency->getSymbolRight($this->config->get('config_currency')),\n\t\t\t\t'no_results_error' => isset($no_results_error) ? $no_results_error : $this->language->get('text_no_results')\n\t\t\t),\n\n\t\t\t'type' => $type,\n\t\t\t'labels' => $labels,\n\t\t\t'datasets' => $datasets,\n\t\t\t'xAxes' => $xAxes,\n\t\t\t'yAxes' => $yAxes\n\t\t);\n\n\t\t$this->response->addHeader('Content-Type: application/json');\n\t\t$this->response->setOutput(json_encode($json));\n\t}",
"public function loadData();",
"private function getAttributePieChartData($divName,$clientID,$sqlstartDate,$sqlendDate) \n{\n\n $chartArray=array();\n $sqlsel='';\n \n \tif($divName == \"graphattr2\")\n\t \t{\n \t$sqlsel = \"select t.description, count(g.country_id) as total_count from track_gdb g \";\n\t\t\t\t$sqlsel .= \"join \".$_SESSION['thisDbname'].\".inventory_wine i on g.country_id = i.id join \".$_SESSION['thisDbname'].\".tag_wine t on i.tag_id = t.id \";\n\t\t\t\t$sqlsel .= \"where client_id = '\".$clientID.\"' && g.country_id is not null && g.category_id=1 && g.created_at between '\".$sqlstartDate.\"' and '\".$sqlendDate.\"' group by g.country_id\";\n\t \t}\n\t \telse if($divName == \"graphattr3\")\n\t \t{\n\t \t\t$sqlsel = \"select t.description, count(g.region_id) as total_count from track_gdb g \";\n\t\t\t\t$sqlsel .= \"join \".$_SESSION['thisDbname'].\".inventory_wine i on g.region_id = i.id join \".$_SESSION['thisDbname'].\".tag_wine t on i.tag_id = t.id \";\n\t\t\t\t$sqlsel .= \"where client_id = '\".$clientID.\"' && g.region_id is not null && g.category_id=1 && g.created_at between '\".$sqlstartDate.\"' and '\".$sqlendDate.\"' group by g.region_id\";\n\t \t}\n\t \telse if($divName == \"graphattr4\")\n\t \t{\n\t \t\t$sqlsel = \"select t.description, count(g.appellation_id) as total_count from track_gdb g \";\n\t\t\t\t$sqlsel .= \"join \".$_SESSION['thisDbname'].\".inventory_wine i on g.appellation_id = i.id join \".$_SESSION['thisDbname'].\".tag_wine t on i.tag_id = t.id \";\n\t\t\t\t$sqlsel .= \"where client_id = '\".$clientID.\"' && g.appellation_id is not null && g.category_id=1 && g.created_at between '\".$sqlstartDate.\"' and '\".$sqlendDate.\"' group by g.appellation_id\";\n\t \t}\n\t \telse if($divName == \"graphattr5\")\n\t \t{\n\t \t\t$sqlsel = \"select t.description, count(g.producer_id) as total_count from track_gdb g \";\n\t\t\t\t$sqlsel .= \"join \".$_SESSION['thisDbname'].\".inventory_wine i on g.producer_id = i.id join \".$_SESSION['thisDbname'].\".tag_wine t on i.tag_id = t.id \";\n\t\t\t\t$sqlsel .= \"where client_id = '\".$clientID.\"' && g.producer_id is not null && g.category_id=1 && g.created_at between '\".$sqlstartDate.\"' and '\".$sqlendDate.\"' group by g.producer_id\";\t\n\t \t}\n\t \telse if($divName == \"graphattr6\")\n\t \t{\n\t \t\t$sqlsel = \"select t.description, count(g.grape_id) as total_count from track_gdb g \";\n\t\t\t\t$sqlsel .= \"join \".$_SESSION['thisDbname'].\".inventory_wine i on g.grape_id = i.id join \".$_SESSION['thisDbname'].\".tag_wine t on i.tag_id = t.id \";\n\t\t\t\t$sqlsel .= \"where client_id = '\".$clientID.\"' && g.grape_id is not null && g.category_id=1 && g.created_at between '\".$sqlstartDate.\"' and '\".$sqlendDate.\"' group by g.grape_id\";\n\t \t}\n\t \telse if($divName == \"graphattr7\")\n\t \t{\n\t \t //ANALYTICSSC-24 JL - add category_id=1 to select. This attribute graph/pie chart is only for wines.\n\t \t\t$sqlsel = \"select t.description, count(g.type_id) as total_count from track_gdb g \";\n\t\t\t\t$sqlsel .= \"join \".$_SESSION['thisDbname'].\".inventory_wine i on g.type_id = i.id join \".$_SESSION['thisDbname'].\".tag_wine t on i.tag_id = t.id \";\n\t\t\t\t$sqlsel .= \"where client_id = '\".$clientID.\"' && g.type_id is not null && g.category_id=1 && g.created_at between '\".$sqlstartDate.\"' and '\".$sqlendDate.\"' group by g.type_id\";\n\t \t}\n\t \t\n\t \tif ($sqlsel != '') {\n $returnArray=DBUtilities::getTableData($sqlsel,false,true);\t \n \n if (count($returnArray) > 0) {\n foreach ($returnArray As $rowIndex => $rowValue) {\n\t\t\t $row=$returnArray[$rowIndex];\n $country = $row[\"description\"];\n $totcount = $row[\"total_count\"];\n $chartArray[$country] = $totcount;\n }\n }\n }\n \n\n return $chartArray;\n\n\n}",
"public function getChartData() {\n\t\t$json = array();\n\n\t\t$labels = $datasets = $xAxes = $yAxes = array();\n\n\t\tif (isset($this->request->get['type'])) {\n\t\t\tswitch ((string)$this->request->get['type']) {\n\t\t\t\tcase \"sales_analytics\":\n\t\t\t\t\t$chart_data = $this->MsLoader->MsReport->getSalesAnalytics(array(\n\t\t\t\t\t\t'date_start' => isset($this->request->get['date_start']) ? $this->request->get['date_start'] : false,\n\t\t\t\t\t\t'date_end' => isset($this->request->get['date_end']) ? $this->request->get['date_end'] : false,\n\t\t\t\t\t\t'metric' => isset($this->request->get['metric']) ? $this->request->get['metric'] : false,\n\t\t\t\t\t\t'seller_id' => $this->customer->getId()\n\t\t\t\t\t));\n\n\t\t\t\t\t$type = 'line';\n\n\t\t\t\t\t$total_orders = $gross_sales = array();\n\t\t\t\t\t$tooltip_data_total_orders = $tooltip_data_gross_sales = array();\n\t\t\t\t\t$max_total_orders = $max_gross_sales = 0;\n\n\t\t\t\t\tforeach ($chart_data as $data) {\n\t\t\t\t\t\tif ($data['total'] > $max_total_orders) $max_total_orders = $data['total'];\n\t\t\t\t\t\tif ($data['gross_total'] > $max_gross_sales) $max_gross_sales = $data['gross_total'];\n\n\t\t\t\t\t\t$labels[] = $data['date'];\n\t\t\t\t\t\t$total_orders[] = $data['total'];\n\t\t\t\t\t\t$gross_sales[] = !is_null($data['gross_total']) ? $this->currency->format($data['gross_total'], $this->config->get('config_currency'), '', false) : NULL;\n\n\t\t\t\t\t\t$tooltip_data_total_orders[] = $this->language->get('ms_account_dashboard_total_orders') . \": \" . end($total_orders);\n\t\t\t\t\t\t$tooltip_data_gross_sales[] = $this->language->get('ms_account_dashboard_gross_sales') . \": \" . $this->currency->format(end($gross_sales), $this->config->get('config_currency'));\n\t\t\t\t\t}\n\n\t\t\t\t\t$step_gross_sales = pow(10, $this->MsLoader->MsHelper->getNumberOfSignificantDigits($max_gross_sales) - 1);\n\t\t\t\t\t$step_total_orders = pow(10, $this->MsLoader->MsHelper->getNumberOfSignificantDigits($max_total_orders) - 1);\n\n\t\t\t\t\t$max_gross_rescaled = $this->MsLoader->MsHelper->ceiling($max_gross_sales, $step_gross_sales);\n\t\t\t\t\t$max_total_rescaled = $this->MsLoader->MsHelper->ceiling($max_total_orders, $step_total_orders);\n\n\t\t\t\t\t$datasets = array(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'fill' => false,\n\t\t\t\t\t\t\t'label' => $this->language->get('ms_account_dashboard_gross_sales'),\n\t\t\t\t\t\t\t'yAxisID' => 'gross',\n\t\t\t\t\t\t\t'borderColor' => '#77C2D8',\n\t\t\t\t\t\t\t'data' => $gross_sales,\n\t\t\t\t\t\t\t'tooltip_data' => $tooltip_data_gross_sales\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'fill' => false,\n\t\t\t\t\t\t\t'label' => $this->language->get('ms_account_dashboard_total_orders'),\n\t\t\t\t\t\t\t'yAxisID' => 'total',\n\t\t\t\t\t\t\t'borderColor' => '#FFB15E',\n\t\t\t\t\t\t\t'data' => $total_orders,\n\t\t\t\t\t\t\t'tooltip_data' => $tooltip_data_total_orders\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\n\t\t\t\t\t$yAxes = array(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'id' => 'gross',\n\t\t\t\t\t\t\t'type' => 'linear',\n\t\t\t\t\t\t\t'position' => 'left',\n\t\t\t\t\t\t\t'ticks' => array(\n\t\t\t\t\t\t\t\t'min' => 0,\n\t\t\t\t\t\t\t\t'max' => $max_gross_rescaled,\n\t\t\t\t\t\t\t\t'stepSize' => $step_gross_sales,\n\t\t\t\t\t\t\t\t'data_formatted' => $this->_formatCurrencyTicks(0, $max_gross_rescaled, $step_gross_sales)\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'id' => 'total',\n\t\t\t\t\t\t\t'type' => 'linear',\n\t\t\t\t\t\t\t'position' => 'right',\n\t\t\t\t\t\t\t'gridLines' => array(\n\t\t\t\t\t\t\t\t'display' => false\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t'ticks' => array(\n\t\t\t\t\t\t\t\t'min' => 0,\n\t\t\t\t\t\t\t\t'max' => $max_total_rescaled,\n\t\t\t\t\t\t\t\t'stepSize' => $step_total_orders\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\n\t\t\t\t\t$xAxes = array(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'gridLines' => array(\n\t\t\t\t\t\t\t\t'display' => false\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\n\t\t\t\t\t$no_results_error = $this->language->get('ms_account_dashboard_no_results_not_enough_data');\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase \"top_products_views\":\n\t\t\t\t\t$chart_data = $this->MsLoader->MsReport->getTopProductsByViewsAnalytics(array(\n\t\t\t\t\t\t'date_start' => isset($this->request->get['date_start']) ? $this->request->get['date_start'] : false,\n\t\t\t\t\t\t'date_end' => isset($this->request->get['date_end']) ? $this->request->get['date_end'] : false,\n\t\t\t\t\t\t'seller_id' => $this->customer->getId()\n\t\t\t\t\t));\n\n\t\t\t\t\t$type = 'horizontalBar';\n\n\t\t\t\t\t$total_views = $tooltip_data = array();\n\t\t\t\t\t$max_total_views = 0;\n\n\t\t\t\t\tif (!empty($chart_data)) {\n\t\t\t\t\t\tforeach ($chart_data as $data) {\n\t\t\t\t\t\t\tif ($data['total_views'] > $max_total_views) $max_total_views = $data['total_views'];\n\n\t\t\t\t\t\t\t$labels[] = $data['name'];\n\t\t\t\t\t\t\t$total_views[] = $data['total_views'];\n\t\t\t\t\t\t\t$tooltip_data[] = $this->language->get('ms_account_dashboard_column_total_views') . \": \" . $data['total_views'];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t$step_total_views = pow(10, $this->MsLoader->MsHelper->getNumberOfSignificantDigits($max_total_views) - 1);\n\t\t\t\t\t$max = $this->MsLoader->MsHelper->ceiling($max_total_views, $step_total_views);\n\n\t\t\t\t\t$datasets = array(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'label' => $this->language->get('ms_account_dashboard_column_total_views'),\n\t\t\t\t\t\t\t'backgroundColor' => '#F0D578',\n\t\t\t\t\t\t\t'data' => $total_views,\n\t\t\t\t\t\t\t'tooltip_data' => $tooltip_data\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\n\t\t\t\t\t$xAxes = array(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'gridLines' => array(\n\t\t\t\t\t\t\t\t'display' => false\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t'ticks' => array(\n\t\t\t\t\t\t\t\t'min' => 0,\n\t\t\t\t\t\t\t\t'max' => $max,\n\t\t\t\t\t\t\t\t'stepSize' => $step_total_views\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t'display' => false\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\n\t\t\t\t\t$yAxes = array(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'gridLines' => array(\n\t\t\t\t\t\t\t\t'drawBorder' => false,\n\t\t\t\t\t\t\t\t'display' => false\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t'afterFit' => array(\n\t\t\t\t\t\t\t\t'label_width' => 110\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\n\t\t\t\t\t$no_results_error = $this->language->get('ms_account_dashboard_no_results_no_data');\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase \"top_products_sales\":\n\t\t\t\t\t$chart_data = $this->MsLoader->MsReport->getTopProductsAnalytics(array(\n\t\t\t\t\t\t'date_start' => isset($this->request->get['date_start']) ? $this->request->get['date_start'] : false,\n\t\t\t\t\t\t'date_end' => isset($this->request->get['date_end']) ? $this->request->get['date_end'] : false,\n\t\t\t\t\t\t'seller_id' => $this->customer->getId()\n\t\t\t\t\t));\n\n\t\t\t\t\t$type = 'horizontalBar';\n\n\t\t\t\t\t$gross_sales = $tooltip_data = $data_formatted = array();\n\t\t\t\t\t$max_gross_sales = 0;\n\n\t\t\t\t\tif (!empty($chart_data)) {\n\t\t\t\t\t\tforeach ($chart_data as $data) {\n\t\t\t\t\t\t\tif ($data['gross_total'] > $max_gross_sales) $max_gross_sales = $data['gross_total'];\n\n\t\t\t\t\t\t\t$labels[] = $data['name'];\n\t\t\t\t\t\t\t$gross_sales[] = $this->currency->format($data['gross_total'], $this->config->get('config_currency'), '', false);\n\t\t\t\t\t\t\t$data_formatted[] = $this->currency->format($data['gross_total'], $this->config->get('config_currency'));\n\t\t\t\t\t\t\t$tooltip_data[] = $this->language->get('ms_account_dashboard_gross_sales') . \": \" . $this->currency->format($data['gross_total'], $this->config->get('config_currency'));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t$step_gross_sales = pow(10, $this->MsLoader->MsHelper->getNumberOfSignificantDigits($max_gross_sales) - 1);\n\t\t\t\t\t$max = $this->MsLoader->MsHelper->ceiling($max_gross_sales, $step_gross_sales);\n\n\t\t\t\t\t$datasets = array(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'label' => $this->language->get('ms_account_dashboard_column_gross'),\n\t\t\t\t\t\t\t'backgroundColor' => '#76BC5E',\n\t\t\t\t\t\t\t'data' => $gross_sales,\n\t\t\t\t\t\t\t'data_formatted' => $data_formatted,\n\t\t\t\t\t\t\t'tooltip_data' => $tooltip_data\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\n\t\t\t\t\t$xAxes = array(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'gridLines' => array(\n\t\t\t\t\t\t\t\t'display' => false\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t'ticks' => array(\n\t\t\t\t\t\t\t\t'min' => 0,\n\t\t\t\t\t\t\t\t'max' => $max,\n\t\t\t\t\t\t\t\t'stepSize' => $step_gross_sales\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t'display' => false\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\n\t\t\t\t\t$yAxes = array(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'gridLines' => array(\n\t\t\t\t\t\t\t\t'drawBorder' => false,\n\t\t\t\t\t\t\t\t'display' => false\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t'afterFit' => array(\n\t\t\t\t\t\t\t\t'label_width' => 110\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\n\t\t\t\t\t$no_results_error = $this->language->get('ms_account_dashboard_no_results_no_data');\n\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t$json['chart_data'] = array(\n\t\t\t'common' => array(\n\t\t\t\t'currency_symbol_left' => $this->currency->getSymbolLeft($this->config->get('config_currency')),\n\t\t\t\t'currency_symbol_right' => $this->currency->getSymbolRight($this->config->get('config_currency')),\n\t\t\t\t'no_results_error' => isset($no_results_error) ? $no_results_error : $this->language->get('ms_account_dashboard_no_results_no_data')\n\t\t\t),\n\n\t\t\t'type' => $type,\n\t\t\t'labels' => $labels,\n\t\t\t'datasets' => $datasets,\n\t\t\t'xAxes' => $xAxes,\n\t\t\t'yAxes' => $yAxes\n\t\t);\n\n\t\t$this->response->addHeader('Content-Type: application/json');\n\t\t$this->response->setOutput(json_encode($json));\n\t}",
"function loadSeriesData( $seriesKey='' ) \n {\n // if no series key is given, then all data will be loaded.\n // might not be what you want ...\n $whereClause = '';\n if ($seriesKey != '' ) {\n \n $whereClause = ' series_key=\"'.$seriesKey.'\" ';\n }\n \n // compile proper SQL statement for loading this series...\n $sql = 'SELECT DISTINCT series_key FROM ';\n $sql .= SITE_DB_NAME.'.'.XMLObject_MultilingualManager::DB_TABLE_SERIES;\n \n if ( $whereClause != '') {\n $sql .= ' WHERE '.$whereClause;\n }\n\n // run the query \n $this->db->runSQL( $sql );\n\n // for each series returned\n while( $row = $this->db->retrieveRow() ) {\n\n // create new instance of series\n $seriesList = new XMLObject_Multilingual_Series($row['series_key']);\n \n // add to this object's XML data\n $this->addXmlObject( $seriesList );\n }\n \n \n }",
"abstract protected function loadData(DataTable_Request $request);",
"function _getDataSet($plot_number)\r\n{\t\r\n\t$query = $this->chart_data->plot_array[$plot_number]['query'];\r\n \t$this->datasets[$plot_number]['num_rows'] = 0;\r\n \t$this->datasets[$plot_number]['num_columns'] = 0;\r\n \t\r\n \tif (!isset($this->chart_data->plot_array[$plot_number]['legend']))\r\n \t\t$this->chart_data->plot_array[$plot_number]['legend'] = LEGEND_NONE;\r\n \t\t\r\n \t$this->datasets[$plot_number]['legend'] = $this->_resolveQuery($this->chart_data->plot_array[$plot_number]['legend']);\r\n if (!isset($this->chart_data->plot_array[$plot_number]['style']))\r\n $this->chart_data->plot_array[$plot_number]['style'] = 0;\r\n $this->datasets[$plot_number]['style'] = $this->chart_data->plot_array[$plot_number]['style'];\r\n \t\r\n\tif ($query == '')\r\n\t\treturn true;\r\n\r\n\t$this->_resolveSpecialVariable($query);\r\n\r\n// if we are allowed to run multiple queries, see if that's what we have here\r\n// if this is a multiple query, execute all but the last query,\r\n// then set the last query to be the one that retrieves the data\r\n\r\n if ($this->multiquery)\r\n {\r\n $queries = $this->db->splitSql($query);\r\n $num_queries = count($queries);\r\n $this->_trace(\"Multiple query is enabled, plot query has $num_queries queries: \".print_r($queries, true) );\r\n if ($num_queries > 1)\r\n {\r\n for ($i=0; $i < $num_queries; $i++)\r\n {\r\n $result = $this->_execute($queries[$i]);\r\n if ($result !== true)\r\n $this->_warning(JText::_('COM_PLOTALOT_PLOT').' '.($plot_number + 1).' '.JText::_('COM_PLOTALOT_QUERY').' '.($i + 1).': '.$this->ladb_error_text);\r\n }\r\n $query = $queries[$num_queries - 1]; // set the last query to be the one that retrieves the data\r\n }\r\n }\r\n\r\n// only allow queries beginning with \"select\" or \"(select\" unless component parameter \"selectonly\" is false\r\n\r\n\tif ( ((strncasecmp($query,\"select\",6) != 0) and (strncasecmp($query,\"(select\",7) != 0)) )\r\n\t\t{\t\t\t\t\t\t\t\t\t\t// it's not a select query\r\n\t\tif ($this->select_only)\t\t\t\t\t// .. is it allowed?\r\n\t\t\t{\r\n\t\t\t$this->_error(JText::sprintf('COM_PLOTALOT_ERROR_QUERY_CHECK', ($plot_number + 1)));\r\n\t\t\treturn false;\r\n\t\t\t}\r\n $this->_trace(\"Non-select query is enabled\");\r\n\t $result = $this->_execute($query); // execute a non-select query\r\n\t if ($result === true) // and store the number of rows affected\r\n\t \t{\r\n\t \t$this->datasets[$plot_number]['num_rows'] = 1;\r\n\t \t$this->datasets[$plot_number]['num_columns'] = 1;\r\n\t \t$this->datasets[$plot_number]['column_names'][0] = 'rows_affected';\r\n\t \t$this->datasets[$plot_number]['data'][0][0] = $this->rows_affected;\r\n\t\t }\r\n\t else\r\n\t \t$this->_warning(JText::_('COM_PLOTALOT_PLOT').' '.($plot_number + 1).': '.$this->ladb_error_text);\r\n\t return true;\r\n\t\t}\r\n \r\n// it's a select query so run it\r\n\t\t\t\r\n $result_set = $this->_loadAssocList($query);\r\n if ($result_set === false)\r\n \t{\r\n \t$this->_error(JText::sprintf('COM_PLOTALOT_ERROR_QUERY_FAIL', ($plot_number + 1)).\": \".$this->ladb_error_text);\r\n \treturn false;\r\n \t}\r\n \t\r\n\t$num_rows = count($result_set);\r\n\tif ($num_rows == 0)\r\n\t\t$num_columns = 0;\r\n\telse\r\n\t\t$num_columns = count($result_set[0]);\t\r\n\r\n if ($num_rows == 0)\r\n \t{\r\n \t$this->_warning(JText::_('COM_PLOTALOT_PLOT').' '.($plot_number + 1).': '.JText::_('COM_PLOTALOT_ERROR_NO_ROWS'));\r\n \t$this->_trace(\"\\nPlot $plot_number returned no rows\");\r\n \treturn true;\r\n \t}\r\n\r\n// get the column names and whether they are string or numeric\r\n// if the first value retrieved for a column is a null, the column will be treated as string\r\n\r\n\t$this->datasets[$plot_number]['num_columns'] = $num_columns;\r\n\r\n\tforeach ($result_set[0] as $key => $value)\r\n\t\t{\r\n\t\t$column_name = $key;\r\n\t\t$this->datasets[$plot_number]['column_names'][] = $this->_escape_string($column_name);\r\n\t\tif (is_numeric($value))\r\n\t\t\t{\r\n\t\t\t$this->datasets[$plot_number]['column_types'][] = 'numeric';\r\n\t\t\t$this->datasets[$plot_number]['numeric'][] = true; \r\n\t\t\t}\r\n\t\telse\r\n\t\t\t{\r\n\t\t\t$this->datasets[$plot_number]['column_types'][] = 'string';\r\n\t\t\t$this->datasets[$plot_number]['numeric'][] = false;\r\n\t\t\t}\r\n\t\t}\r\n\r\n// save the data rows to the datasets array\r\n// for charts there is no point keeping more than one row for every two pixels ($this->chart_data->x_size)\r\n// (even this usually gives far higher resolution than old Plotalot)\r\n// for tables, the user can specify the maximum number of rows ($this->chart_data->y_labels)\r\n\r\n\tif ($this->chart_data->chart_type >= CHART_TYPE_LINE)\r\n\t\t{\r\n\t\tif ($this->chart_data->x_size <= 0)\t\t\t// size zero means the chart is responsive and could be any size\r\n\t\t\t$x_size = 1600;\t\t\t\t\t\t\t// so assume an arbitrary screen size\r\n\t\telse\r\n\t\t\t$x_size = $this->chart_data->x_size;\r\n\t\t$skip_factor = intval(ceil($num_rows / ($x_size / 2)));\r\n\t\tif ($skip_factor <= 0)\r\n\t\t\t$skip_factor = 1;\t\t\t// don't skip any\r\n\t\t$this->_trace(\"Plot $plot_number returned $num_rows rows. X-size: \".$this->chart_data->x_size.\". Skip factor: $skip_factor\");\r\n\t\t}\r\n\telse\r\n\t\t{\r\n\t\tif ($this->chart_data->y_labels == -1)\t// max rows of -1 means don't skip any (3.04.03)\r\n\t\t\t$skip_factor = 1;\t\t\t\t\t// don't skip any\r\n\t\telse\r\n\t\t\t{\r\n\t\t\tif ($this->chart_data->y_labels <= 0)\t// protect against divide by zero\r\n\t\t\t\t$this->chart_data->y_labels = 1;\r\n\t\t\t$skip_factor = intval(ceil($num_rows / $this->chart_data->y_labels));\r\n\t\t\tif ($skip_factor <= 0)\r\n\t\t\t\t$skip_factor = 1;\t\t\t// don't skip any\r\n\t\t\t}\r\n\t\t$this->_trace(\"Query returned $num_rows rows. Max-rows: \".$this->chart_data->y_labels.\". Skip factor: $skip_factor\");\r\n\t\t}\r\n\r\n for ($row=0; $row < $num_rows; $row += $skip_factor)\r\n \t$this->datasets[$plot_number]['data'][] = array_values((array) $result_set[$row]);\r\n\r\n $num_rows = count($this->datasets[$plot_number]['data']);\r\n $this->datasets[$plot_number]['num_rows'] = $num_rows;\r\n\t\r\n// fix any nulls\r\n\r\n\tfor ($r=0; $r < $num_rows; $r++)\r\n\t\tfor ($c=0; $c < $num_columns; $c++)\r\n\t\t\tif ($this->datasets[$plot_number]['numeric'][$c])\r\n\t\t\t\t{\r\n\t\t\t\tif ((is_null($this->datasets[$plot_number]['data'][$r][$c])) and ($this->fixnulls))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t$this->datasets[$plot_number]['data'][$r][$c] = 0;\r\n\t\t\t\t\tif (!$this->nulls_defaulted)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t$this->nulls_defaulted = true;\r\n\t\t\t\t\t\t$this->_warning(JText::_('COM_PLOTALOT_WARNING_NULLS_DEFAULTED'));\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\telse\r\n\t\t\t\t{\r\n\t\t\t\tif ((is_null($this->datasets[$plot_number]['data'][$r][$c])) and ($this->fixnulls))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t$this->datasets[$plot_number]['data'][$r][$c] = 'Null';\r\n\t\t\t\t\tif (!$this->nulls_defaulted)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t$this->nulls_defaulted = true;\r\n\t\t\t\t\t\t$this->_warning(JText::_('COM_PLOTALOT_WARNING_NULLS_DEFAULTED'));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\r\n// if trace is on, save all the data to the trace file\r\n\r\n\tif ($this->trace != 0)\r\n\t\t{\r\n\t\t$str = \"\\nPlot $plot_number returned \".$num_rows.\" rows with \".$num_columns.\" columns: \";\r\n\t\t$comma = '';\r\n\t\tfor ($c=0; $c < $num_columns; $c++)\r\n\t\t\t{\r\n\t\t\t$str .= $comma.$this->datasets[$plot_number]['column_names'][$c].\r\n\t\t\t\t\" [\".$this->datasets[$plot_number]['column_types'][$c].\"]\" ;\r\n\t\t\t$comma = ', ';\r\n\t\t\t}\r\n\t\t$this->_trace($str);\r\n\t\tif ($num_rows == 0)\r\n\t\t\treturn true;\r\n\t\t$trace_columns = $num_columns;\r\n\t\tif ($trace_columns > 5)\r\n\t\t\t{\r\n\t\t\t$trace_columns = 5;\r\n\t\t\t$this->_trace(\"We have $num_columns columns but only show $trace_columns here in the trace\");\r\n\t\t\t}\r\n\t\t$str = '';\r\n\t\tfor ($i=0; $i < $trace_columns; $i++)\r\n\t\t\t$str .= \"\\t\".$this->datasets[$plot_number]['column_names'][$i];\r\n\t\t$this->_trace($str);\r\n\t for ($r=0; $r < $num_rows; $r++)\r\n\t \t{\r\n\t\t\t$str = '';\r\n\t\t\tfor ($col=0; $col < $trace_columns; $col++)\r\n\t\t\t\t$str .= \"\\t\".$this->datasets[$plot_number]['data'][$r][$col];\r\n\t\t\t$this->_trace($str);\r\n\t\t\t}\r\n\t\t$this->_trace(\"\");\r\n\t\t}\r\n\treturn true;\r\n}",
"public function LoadHouseholdDatasetData()\n\t{\n\t\t$this->loadDatasetData( self::kDDICT_HOUSEHOLD_ID );\t\t\t\t\t\t// ==>\n\n\t}",
"public function get_data_expenses_chart($data_filter){\n $where = $this->get_where_report_period();\n\n $account_type_details = $this->get_account_type_details();\n $data_report = [];\n $data_total = [];\n $data_accounts = [];\n \n foreach ($account_type_details as $key => $value) {\n if($value['account_type_id'] == 13){\n $data_accounts['cost_of_sales'][] = $value;\n }\n\n if($value['account_type_id'] == 14){\n $data_accounts['expenses'][] = $value;\n }\n\n if($value['account_type_id'] == 15){\n $data_accounts['other_expenses'][] = $value;\n }\n }\n $total = 0;\n\n if($where != ''){\n $this->db->select('*, IF('.db_prefix().'acc_accounts.id = 16, (SELECT (sum(credit) - sum(debit)) as balance FROM '.db_prefix().'acc_account_history where (account = 16 or (account = '. get_option('acc_expense_payment_account') .' and rel_type = \"expense\")) and '.$where.'), (SELECT (sum(credit) - sum(debit)) as balance FROM '.db_prefix().'acc_account_history where account = '.db_prefix().'acc_accounts.id and '.$where.')) as amount');\n\n }else{\n $this->db->select('*, IF('.db_prefix().'acc_accounts.id = 16, (SELECT (sum(credit) - sum(debit)) as balance FROM '.db_prefix().'acc_account_history where (account = 16 or (account = '. get_option('acc_expense_payment_account') .' and rel_type = \"expense\")) and account = '.db_prefix().'acc_accounts.id), (SELECT (sum(credit) - sum(debit)) as balance FROM '.db_prefix().'acc_account_history where account = '.db_prefix().'acc_accounts.id)) as amount');\n }\n\n $this->db->where('(account_type_id = 13 or account_type_id = 14 or account_type_id = 15)');\n $this->db->where('active', 1);\n\n $this->db->order_by('amount', 'desc');\n $accounts = $this->db->get(db_prefix().'acc_accounts')->result_array();\n foreach ($accounts as $k => $val) {\n if($k > 2){\n $total += $val['amount'];\n }else{\n $name = $val['name'] != '' ? $val['name'] : _l($val['key_name']);\n $data_return[] = ['name' => $name, 'y' => floatval($val['amount'])];\n }\n }\n\n $data_return[] = ['name' => _l('everything_else'), 'y' => floatval($total)];\n\n return $data_return;\n }",
"private function addCriteria()\n {\n $this->data->each(function ($criteria) {\n $type = key($criteria);\n $meta = (new DbMetaRepository())->getMetaById($criteria[$type]['meta_id']);\n $this->model = (new Criteria($type, $this->model, $criteria[$type], $meta->attribute))->getCriteria();\n });\n\n\n }",
"public function data_fetch() {\n\t\tif ( $this->analytics_connected ) {\n\t\t\t$this->check_for_missing_dates( 'analytics' );\n\t\t}\n\n\t\tif ( $this->exist_adsense_table ) {\n\t\t\t$this->check_for_missing_dates( 'adsense' );\n\t\t}\n\t}",
"private function getDataForChart()\n\t{\n\t\t$listCurrency = $this->Currency->find('all');\n\t\t// Run loop to save data to an array\n\t\tforeach ($listCurrency as $item) {\n\t\t\tif ($item->name == 'Gold SJC (9999)') {\n\t\t\t\t$this->dataGold[] = ['y' => (float)$item->sell, 'x' => strtotime($item->created_date) * 1000];\n\t\t\t}\n\t\t\tif ($item->name == '1 Bitcoin (BTC)') {\n\t\t\t\t$this->dataBitcoin[] = ['y' => (float)$item->sell, 'x' => strtotime($item->created_date) * 1000];\n\t\t\t}\n\t\t\tif ($item->name == 'EURO') {\n\t\t\t\t$this->dataCurrency['euro'][] = ['y' => (float)$item->sell, 'x' => strtotime($item->created_date) * 1000];\n\t\t\t}\n\t\t\tif ($item->name == 'BRITISH POUND') {\n\t\t\t\t$this->dataCurrency['gbp'][] = ['y' => (float)$item->sell, 'x' => strtotime($item->created_date) * 1000];\n\t\t\t}\n\t\t\tif ($item->name == 'JAPANESE YEN') {\n\t\t\t\t$this->dataCurrency['yen'][] = ['y' => (float)$item->sell, 'x' => strtotime($item->created_date) * 1000];\n\t\t\t}\n\t\t\tif ($item->name == 'US DOLLAR') {\n\t\t\t\t$this->dataCurrency['usd'][] = ['y' => (float)$item->sell, 'x' => strtotime($item->created_date) * 1000];\n\t\t\t}\n\t\t}\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the deserialized response object (during deserialization) | public function setResponseObject($obj) {
$this->responseObject = $obj;
} | [
"public function setResponseObject($obj)\n\t{\n\t\t$this->responseObject = $obj;\n\t}",
"public function setResponseObject($obj)\n {\n $this->responseObject = $obj;\n }",
"protected function setResponse($obj_response)\n {\n $this->obj_response = $obj_response;\n }",
"public function setResponse() {\n }",
"function setResponse($response)\n {\n $this->_response = $response;\n }",
"public function setResponse(Response $response) {\n $this->response = $response;\n }",
"public function setData($response){\n $this->_data=$response;\n if(isset($response->edgeDefinitions)) $this->_edgeDefinitions=$response->edgeDefinitions;\n if(isset($response->orphanCollections)) $this->_orphanCollections=$response->orphanCollections;\n if(isset($response->_key)) $this->graph_key=$response->_key;\n if(isset($response->_rev)) $this->rev=$response->_rev;\n }",
"public function setResponse($response)\n {\n if ($response instanceof Zend_Http_Response) {\n $response = $response->asString();\n }\n\n $this->responses = (array)$response;\n $this->responseIndex = 0;\n }",
"public function setData () {\n try {\n\n $this->data = false;\n\n $data = json_decode($this->response->getBody(), true);\n\n if (isset($data['error'])) {\n $this->reasonPhrase = isset($data['message']) ? $data['message'] : $data['error'];\n $this->response = $this->response->withStatus(400, $this->reasonPhrase);\n } elseif ($data && in_array($this->response->getStatusCode(), [200, 201])) {\n $this->data = $data;\n }\n } catch (\\Exception $e) {\n $this->reasonPhrase = $e->getMessage();\n $this->data = false;\n }\n\t}",
"public function setParsedData(Response $value) {\n $this->parsedData = $value;\n }",
"function setResponse() {\n }",
"public function unbox()\n {\n APIHelper::deserialize(self::getResponseBody(), $this, false, false);\n }",
"public function setResponse($response)\n {\n $class = \"ECash_DataX_Responses_\".$response;\n $this->response = new $class();\n }",
"public function setResponse(\\Zend\\Http\\Response $response)\n {\n $this->response = $response;\n }",
"protected function fromResponse( phpillowResponse $response )\n {\n // Set all document property values from response, if available in the\n // response.\n //\n // Also fill a revision object with the set attributes, so that the\n // current revision is also available in history, and it is stored,\n // when the object is modified and stored again.\n $revision = new StdClass();\n $revision->_date = time();\n foreach ( $this->properties as $property => $v )\n {\n if ( isset( $response->$property ) )\n {\n $this->storage->$property = $response->$property;\n $revision->$property = $response->$property;\n }\n }\n\n // Set special properties from response object\n $this->storage->_rev = $response->_rev;\n $this->storage->_id = $response->_id;\n\n // Set attachments array, if the response object contains attachments.\n if ( isset( $response->_attachments ) )\n {\n $this->storage->_attachments = $response->_attachments;\n }\n\n // Check if the source document already contains a revision history and\n // store it in this case in the document object, if the object should\n // be versioned at all.\n if ( $this->versioned )\n {\n if ( isset( $response->revisions ) )\n {\n $this->storage->revisions = $response->revisions;\n }\n\n // Add current revision to revision history\n $this->storage->revisions[] = (array) $revision;\n }\n\n // Document freshly loaded, so it is not modified, and not a new\n // document...\n $this->modified = false;\n $this->newDocument = false;\n }",
"public function setResponse(Response $request);",
"function setResponse($inResponse) {\n\t\tif ( $this->_Response !== $inResponse ) {\n\t\t\t$this->_Response = $inResponse;\n\t\t\t$this->setModified();\n\t\t}\n\t\treturn $this;\n\t}",
"public function setRawResponse($response) {\n $this->response = $response;\n return $this;\n }",
"public function setResponse(ResponseInterface $response);"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Displays a form to create a new cheque entity. | public function newAction()
{
$entity = new cheque();
$form = $this->createCreateForm($entity);
return $this->render('contabilidadBundle:cheque:new.html.twig', array(
'entity' => $entity,
'form' => $form->createView(),
));
} | [
"public function actionCreate()\n\t{\n\t\t$model = new CHEF_MODEL();\n\n\t\tif ($model->load(Yii::$app->request->post()) && $model->save()) {\n\t\t\treturn $this->redirect(['view', 'id' => $model->CHEF_ID]);\n\t\t}\n\n\t\treturn $this->render('create', [\n\t\t\t'model' => $model,\n\t\t]);\n\t}",
"public function actionCreate()\n {\n $model = new Cheques();\n\t\t\n\t\t$cajasModel = new Cajas();\n $cajas = $cajasModel->find()->all();\n\t\t\n\t\t$bancosModel = new Bancos();\n $bancos = $bancosModel->find()->all();\n\t\t\n\t\t$proveedoresModel = new Proveedores();\n $proveedores = $proveedoresModel->find()->all();\n\t\t\n\t\t$clientesModel = new Clientes();\n $clientes = $clientesModel->find()->all();\t\n\n\t\t$model->fecha = $model->formattedFecha;\t\t\t\n\t\t$model->fecha_venc = $model->formattedFechaVenc;\t\t\t\n\t\t$model->fecha_cobro = $model->formattedFechaCobro;\t\n\t\t\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['index']);\n } else {\n return $this->render('create', [\n 'model' => $model,\n\t\t\t\t'cajas' => $cajas,\n\t\t\t\t'bancos' => $bancos,\n\t\t\t\t'proveedores' => $proveedores,\n\t\t\t\t'clientes' => $clientes,\n\t\t\t]);\n }\n }",
"public function newAction()\n {\n $entity = new Faq();\n $form = $this->createCreateForm($entity);\n\n return $this->render('StalkAdminBundle:Faq:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }",
"public function createAction()\r\n\t{\r\n\t\t$entity = new Contenu();\r\n\t\t$request = $this->getRequest();\r\n\t\t$form = $this->createForm(new ContenuType(), $entity);\r\n\t\t$form->bindRequest($request);\r\n\r\n\t\tif ($form->isValid()) {\r\n\t\t\t$em = $this->getDoctrine()->getEntityManager();\r\n\t\t\t$em->persist($entity);\r\n\t\t\t$em->flush();\r\n\r\n\t\t\treturn $this->redirect($this->generateUrl('contenu_show', array('id' => $entity->getId())));\r\n\r\n\t\t}\r\n\r\n\t\treturn $this->render('ExodPortfolioBundle:Contenu:new.html.twig', array(\r\n\t\t\t\t'entity' => $entity,\r\n\t\t\t\t'form' => $form->createView()\r\n\t\t));\r\n\t}",
"public function newAction() {\r\n\t\t$entity = new ActionCyclique();\r\n\t\t$entity->setAction(new Action());\r\n\t\t$form = $this->createCreateForm($entity, 'ActionCyclique');\r\n\t\treturn array('entity' => $entity, 'form' => $form->createView());\r\n\t}",
"public function newAction()\n {\n $entity = new Cosecha();\n $form = $this->createCreateForm($entity);\n\n return $this->render('UpaoFundoBundle:Cosecha:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }",
"public function createAction()\n {\n $entity = new Question();\n $request = $this->getRequest();\n $form = $this->createForm(new QuestionType(), $entity);\n $form->handleRequest($request);\n\n if ($form->isValid()) {\n $em = $this->getDoctrine()->getManager();\n $em->persist($entity);\n $em->flush();\n\n return $this->redirect($this->generateUrl('question_show', array('id' => $entity->getId())));\n }\n\n return $this->render(\n 'UJMExoBundle:Question:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView()\n )\n );\n }",
"public function newAction()\n {\n $entity = new Factura();\n $request = $this->getRequest();\n\t\n $form = $this->createForm(new FacturaType(), $entity);\n $form->bind($request);\n \n if ($form->isValid()) {\n \t$em = $this->getDoctrine()->getManager();\n \t//$cliente = $entity->getCliente();\n \t//$entity->setFormapagoFactura($cliente->getFormapagoCliente());\n \t\n \t$em->persist($entity);\n\t \treturn $this->render('PBVentasBundle:Factura:new.html.twig', array(\n\t \t\t\t'entity' => $entity,\n\t \t\t\t'formstep' => 2,\n\t \t\t\t'form' => $form->createView(),\n\t \t));\n }\n return $this->render('PBVentasBundle:Factura:new.html.twig', array(\n \t\t'entity' => $entity,\n \t\t'formstep' => 1,\n \t\t'form' => $form->createView(),\n ));\n }",
"public function newAction()\n {\n $entity = new Equipement();\n $EquipementType = new EquipementType();\n $EquipementType->setUser($this->get('security.context')->getToken()->getUser());\n $form = $this->createForm($EquipementType, $entity);\n\n return $this->render('chevChevalBundle:Equipement:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }",
"public function newAction()\n {\n $entity = new Ejercicios();\n $form = $this->createCreateForm($entity);\n\n return $this->render('::/Admin/Ejercicios/new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }",
"public function newAction()\n {\n $entity = new Quiz();\n $form = $this->createCreateForm($entity);\n \n return $this->render('MoocQuizBundle:Quiz:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }",
"public function createAction()\n {\n $entity = new Critere();\n $request = $this->getRequest();\n $form = $this->createForm(new CritereType(), $entity);\n $form->bindRequest($request);\n\n if ($form->isValid()) {\n $em = $this->getDoctrine()->getEntityManager();\n $em->persist($entity);\n $em->flush();\n\n return $this->redirect($this->generateUrl('critere_show', array('id' => $entity->getId())));\n \n }\n\n return $this->render('ProjetCoursBundle:Critere:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView()\n ));\n }",
"public function createAction()\r\n {\r\n \tif(AccueilController::verifUserAdmin($this->getRequest()->getSession(), 'questionnaireeleve')) return $this->redirect($this->generateUrl('EDiffAdminBundle_accueil', array()));\r\n \t\r\n $entity = new QuestionnaireEleve();\r\n $request = $this->getRequest();\r\n $form = $this->createForm(new QuestionnaireEleveType(), $entity);\r\n $form->bindRequest($request);\r\n\r\n if ($form->isValid()) {\r\n $em = $this->getDoctrine()->getEntityManager();\r\n $em->persist($entity);\r\n $em->flush();\r\n\r\n return $this->redirect($this->generateUrl('questionnaireeleve_show', array('id' => $entity->getId())));\r\n \r\n }\r\n\r\n return $this->render('EDiffAdminBundle:QuestionnaireEleve:new.html.twig', array(\r\n 'entity' => $entity,\r\n 'form' => $form->createView()\r\n ));\r\n }",
"public function newAction()\r\n\t{\r\n\t\t$entity = new Contenu();\r\n\t\t$form = $this->createForm(new ContenuType(), $entity);\r\n\r\n\t\treturn $this->render('ExodPortfolioBundle:Contenu:new.html.twig', array(\r\n\t\t\t\t'entity' => $entity,\r\n\t\t\t\t'form' => $form->createView()\r\n\t\t));\r\n\t}",
"public function actionCreate()\n {\n $model = new ComprobanteEgresoTipo();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['index']);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }",
"public function createAction()\n {\n $entity = new quickbutton();\n $request = $this->getRequest();\n $form = $this->createForm(new quickbuttonType(), $entity);\n $form->bindRequest($request);\n\n if ($form->isValid()) {\n $em = $this->getDoctrine()->getEntityManager();\n $em->persist($entity);\n $em->flush();\n\n // return $this->redirect($this->generateUrl('cashbox_quickbutton_show', array('id' => $entity->getId())));\n \n }\n\n return $this->redirect($request->server->get('HTTP_REFERER'));\n\n }",
"public function actionCreate() {\n $model = new Quest();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function prenewAction()\n {\n $entity = new Factura();\n $hoy = new \\DateTime();\n $entity->setFecha($hoy);\n $entity->setFechacobro($hoy);\n $form = $this->createForm(new FacturaType(), $entity);\n\n return $this->render('PBVentasBundle:Factura:new.html.twig', array(\n 'entity' => $entity,\n \t'formstep' => 1,\n 'form' => $form->createView(),\n ));\n }",
"public function actionCreate()\n {\n $model = new QueStructure();\n $groupDataProvider=$this->getGroupDataProvider();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n\n return $this->redirect(['view', 'id' => (string)$model->_id]);\n }\n\n return $this->render('create', [\n 'model' => $model,'dataProvider'=>$groupDataProvider\n ]);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Test the convert method with abbreviations. | public function testConvertWithAbbreviations()
{
$unit = Converter::from(0.10, 'm')->to('cm');
$this->assertInstanceOf(Centimeter::class, $unit);
$this->assertEquals(10, $unit->value());
} | [
"public function testToWithAbbreviations()\n {\n $value = (new Centigram(1))->to('mg');\n\n $this->assertInstanceOf(Milligram::class, $value);\n $this->assertEquals(10, $value->value());\n $this->assertEquals('10 mg', (string) $value);\n }",
"public function testIsAbbreviations(string $input, bool $output): void\n {\n self::assertEquals($output, Argument::isAbbreviations($input));\n }",
"public function testIsAbbreviation(string $input, bool $output): void\n {\n self::assertEquals($output, Argument::isAbbreviation($input));\n }",
"function testConvertSpecifiers() {\n\t\tApp::build ( array (\n\t\t\t\t'locales' => array (\n\t\t\t\t\t\tTEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'locale' . DS \n\t\t\t\t) \n\t\t), true );\n\t\tConfigure::write ( 'Config.language', 'time_test' );\n\t\t$time = strtotime ( 'Thu Jan 14 11:43:39 2010' );\n\t\t\n\t\t$result = $this->Time->convertSpecifiers ( '%a', $time );\n\t\t$expected = 'jue';\n\t\t$this->assertEqual ( $result, $expected );\n\t\t\n\t\t$result = $this->Time->convertSpecifiers ( '%A', $time );\n\t\t$expected = 'jueves';\n\t\t$this->assertEqual ( $result, $expected );\n\t\t\n\t\t$result = $this->Time->convertSpecifiers ( '%c', $time );\n\t\t$expected = 'jue %d ene %Y %H:%M:%S %Z';\n\t\t$this->assertEqual ( $result, $expected );\n\t\t\n\t\t$result = $this->Time->convertSpecifiers ( '%C', $time );\n\t\t$expected = '20';\n\t\t$this->assertEqual ( $result, $expected );\n\t\t\n\t\t$result = $this->Time->convertSpecifiers ( '%D', $time );\n\t\t$expected = '%m/%d/%y';\n\t\t$this->assertEqual ( $result, $expected );\n\t\t\n\t\t$result = $this->Time->convertSpecifiers ( '%b', $time );\n\t\t$expected = 'ene';\n\t\t$this->assertEqual ( $result, $expected );\n\t\t\n\t\t$result = $this->Time->convertSpecifiers ( '%h', $time );\n\t\t$expected = 'ene';\n\t\t$this->assertEqual ( $result, $expected );\n\t\t\n\t\t$result = $this->Time->convertSpecifiers ( '%B', $time );\n\t\t$expected = 'enero';\n\t\t$this->assertEqual ( $result, $expected );\n\t\t\n\t\t$result = $this->Time->convertSpecifiers ( '%n', $time );\n\t\t$expected = \"\\n\";\n\t\t$this->assertEqual ( $result, $expected );\n\t\t\n\t\t$result = $this->Time->convertSpecifiers ( '%n', $time );\n\t\t$expected = \"\\n\";\n\t\t$this->assertEqual ( $result, $expected );\n\t\t\n\t\t$result = $this->Time->convertSpecifiers ( '%p', $time );\n\t\t$expected = 'AM';\n\t\t$this->assertEqual ( $result, $expected );\n\t\t\n\t\t$result = $this->Time->convertSpecifiers ( '%P', $time );\n\t\t$expected = 'am';\n\t\t$this->assertEqual ( $result, $expected );\n\t\t\n\t\t$result = $this->Time->convertSpecifiers ( '%r', $time );\n\t\t$expected = '%I:%M:%S AM';\n\t\t$this->assertEqual ( $result, $expected );\n\t\t\n\t\t$result = $this->Time->convertSpecifiers ( '%R', $time );\n\t\t$expected = '11:43';\n\t\t$this->assertEqual ( $result, $expected );\n\t\t\n\t\t$result = $this->Time->convertSpecifiers ( '%t', $time );\n\t\t$expected = \"\\t\";\n\t\t$this->assertEqual ( $result, $expected );\n\t\t\n\t\t$result = $this->Time->convertSpecifiers ( '%T', $time );\n\t\t$expected = '%H:%M:%S';\n\t\t$this->assertEqual ( $result, $expected );\n\t\t\n\t\t$result = $this->Time->convertSpecifiers ( '%u', $time );\n\t\t$expected = 4;\n\t\t$this->assertEqual ( $result, $expected );\n\t\t\n\t\t$result = $this->Time->convertSpecifiers ( '%x', $time );\n\t\t$expected = '%d/%m/%y';\n\t\t$this->assertEqual ( $result, $expected );\n\t\t\n\t\t$result = $this->Time->convertSpecifiers ( '%X', $time );\n\t\t$expected = '%H:%M:%S';\n\t\t$this->assertEqual ( $result, $expected );\n\t}",
"public function testChangePascalCaseToHumanFormat()\n {\n $this->assertEquals('Final Result', Strings::pascalCaseToHuman('FinalResult'));\n $this->assertEquals('Final Result', Strings::pascalCaseToHuman('Final Result'));\n }",
"public function testConvertAustrianAddress()\n {\n $this->address->setCountryId('AT');\n\n $request = new Netresearch_Buergel_Model_Validation_Solvency_Request($this->address);\n $request->setConfig($this->config);\n $this->assertEquals(\n array(\n 'VORNAME' => 'Joachim',\n 'NAME1' => 'Schmidt',\n 'STRASSE' => 'Bei der Schmiede',\n 'HAUS_NR' => '5',\n 'ORT' => 'Hamburg',\n 'PLZ' => '21109',\n 'STAAT' => '040'\n ),\n $request->convertAddress($this->address)\n );\n }",
"public function testDecamelize(): void {\n $tests = [\n 'simpleTest' => 'simple_test',\n 'easy' => 'easy',\n 'HTML' => 'html',\n 'simpleXML' => 'simple_xml',\n 'PDFLoad' => 'pdf_load',\n 'startMIDDLELast' => 'start_middle_last',\n 'AString' => 'a_string',\n 'Some4Numbers234' => 'some4_numbers234',\n 'TEST123String' => 'test123_string',\n 'hello_world' => 'hello_world',\n 'hello___world' => 'hello___world',\n '_hello_world_' => '_hello_world_',\n 'HelloWorld' => 'hello_world',\n 'helloWorldFoo' => 'hello_world_foo',\n 'hello_World' => 'hello_world',\n 'hello-world' => 'hello-world',\n 'myHTMLFiLe' => 'my_html_fi_le',\n 'aBaBaB' => 'a_ba_ba_b',\n 'BaBaBa' => 'ba_ba_ba',\n 'libC' => 'lib_c',\n ];\n\n foreach ($tests as $test => $result) {\n $output = StringUtil::decamelize($test);\n $this->assertEquals($result, $output);\n }\n }",
"public function testRuleToValidationStringConversion()\n {\n $this->assertEquals('postal_code:ES', (string)PostalCode::forCountry('ES'));\n $this->assertEquals('postal_code:AF,GH', (string)PostalCode::forCountry('AF')->andCountry('GH'));\n }",
"public function testUpperCaseWords() {\n $config = [\n ConvertCase::SETTING_OPERATION => 'ucwords',\n ];\n $plugin = new ConvertCase($config, 'convert_case', []);\n $this->assertEquals('Foo Bar', $plugin->tamper('foo bar'));\n }",
"public function testTransliterate() {\n $this->assertEquals('Ingles', Inflector::transliterate('Inglés'));\n $this->assertEquals('Uber', Inflector::transliterate('Über'));\n }",
"function test_uppercase_capital_letter_after_underscore_multibyte () {\n\t\t$this->assertTrue(to_camelcase('politische_ökonomie') === 'politischeÖkonomie');\n\t}",
"public function testAcronymWithCapitalizedOutputAndLowercaseIgnored()\n {\n $str = new Str($this->testString);\n $result = $str->acronym(true, true);\n $this->assertTrue($result->value === 'TS');\n }",
"public function test_title_case_method()\n {\n $list_of_parameters = array(\n array(\n 'before' => 'one',\n 'after' => 'One',\n ),\n array(\n 'before' => 'one thousand',\n 'after' => 'One thousand',\n ),\n array(\n 'before' => '1 thousand',\n 'after' => '1 thousand',\n ),\n );\n\n foreach ($list_of_parameters as $item)\n {\n $result = Format::title_case($item['before']);\n\n $this->assertEquals($item['after'], $result);\n }\n }",
"public function testToCamelCaseSuccess() {\n\t\t$myClass = new StringFormatter();\n\t\t$result = $myClass->toCamelCase(\"my\", \"method\");\n\t\t$this->assertEquals($result, \"myMethod\");\n\t}",
"public function testConvert()\r\n\t{\r\n\t\t// Create a new lead\r\n\t\t$lead = CAntObject::factory($this->dbh, \"lead\", null, $this->user);\r\n\t\t$lead->setValue(\"first_name\", \"Test\");\r\n\t\t$lead->setValue(\"last_name\", \"Convert\");\r\n\t\t$lead->setValue(\"company\", \"Convert Corp\");\r\n\t\t$lead->setValue(\"notes\", \"Enter some sales notes here\");\r\n\t\t$lid = $lead->save();\r\n\r\n\t\t// Convert the lead and allow it to create organization, person, and opportunity automatically\r\n\t\t$lead->convert();\r\n\t\t$custId = $lead->getValue(\"converted_customer_id\");\r\n\t\t$this->assertTrue(strlen($custId)>0);\r\n\t\t$cust = CAntObject::factory($this->dbh, \"customer\", $custId, $this->user);\r\n\r\n\t\t$orgId = $cust->getValue(\"primary_account\");\r\n\t\t$this->assertTrue(strlen($orgId)>0);\r\n\t\t$org = CAntObject::factory($this->dbh, \"customer\", $orgId, $this->user);\r\n\r\n\t\t$oppId = $lead->getValue(\"converted_opportunity_id\");\r\n\t\t$this->assertTrue(strlen($oppId)>0);\r\n\t\t$opp = CAntObject::factory($this->dbh, \"opportunity\", $oppId, $this->user);\r\n\r\n\t\t// Test converted flag\r\n\t\t$this->assertEquals($lead->getValue(\"f_converted\"), 't');\r\n\r\n\t\t// Cleanup\r\n\t\t$opp->removeHard();\r\n\t\t$cust->removeHard();\r\n\t\t$org->removeHard();\r\n\t\t$lead->removeHard();\r\n\t}",
"abstract protected function doActualConvert();",
"public function testToUpperCase() {\n\t\t$str = \\Scrivo\\Str::create(\"nä-a€cD-ëf\")->toUpperCase();\n\t\t$this->assertTrue($str->equals(new \\Scrivo\\Str(\"NÄ-A€CD-ËF\")));\n\t}",
"public function testCapitalizeAlternateSuccess()\n {\n $result = $this->stringProcessor->capitalizeAlternate(\"hello world\");\n $this->assertEquals(\"hElLo wOrLd\", $result);\n }",
"public function testReverse()\n {\n // Start of user code Converter.testreverse\n $converter = new StringConverter(); \n $this->assertEquals('foo!!', $converter->reverse('foo!!'));\n // End of user code\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Compile the "limit" portions of the query. | protected function compileLimit(Builder $query, $limit)
{
return 'limit '.(int) $limit;
} | [
"private function builtLimit(){\n\n\t\tif ( $this->_limit ){\n\t\t\t$sql = \"LIMIT {$this->_limit} \";\n\t\t\t$this->_sql .= $sql;\n\t\t}\n\t}",
"protected function _compileLimitSQLStatement()\n\t{\n\t\tif ( $this->_limit AND $this->_is_grouped === FALSE )\n\t\t{\n\t\t\tif ( $this->_offset )\n\t\t\t{\n\t\t\t\treturn sprintf( static::$sqlStatements[ 'LIMIT_OFFSET' ], $this->_limit, $this->_offset );\n\t\t\t}\n\n\t\t\treturn sprintf( static::$sqlStatements[ 'LIMIT' ], $this->_limit );\n\t\t}\n\t}",
"protected function compileLimit(&$sql)\n {\n if($this->limit) {\n $sql[] = 'LIMIT ' . $this->limit;\n }\n }",
"protected function compileLimit(Builder $query, $limit) {\n\t\treturn 'limit '.(int) $limit;\n\t}",
"function applyLimit(&$sql, $limit, $offset);",
"protected function compileLimit(Builder $query, int $limit)\n {\n return 'limit ' . (int)$limit;\n }",
"function applyLimit(& $sql, $limit, $offset);",
"protected function compileLimit(Builder $query, $limit)\n {\n // Limit queries are not supported by db2\n return '';\n }",
"public function applyLimit(&$sql, $offset, $limit);",
"public function buildLimitPart()\n {\n if ($this->pagerCollection->isEnabled()) {\n $pagerOffset = $this->pagerCollection->getItemOffset();\n $pagerLimit = (int)$this->pagerCollection->getItemsPerPage();\n $this->listQueryParts['FIRSTRESULT'] .= $pagerOffset > 0 ? $pagerOffset . ',' : '';\n $this->listQueryParts['MAXRESULT'] .= $pagerLimit > 0 ? $pagerLimit : '';\n }\n }",
"protected function _applyLimitToQuery() {\n\t\t$this->query()->limit($this->_pageLimit);\n\t}",
"function q_limit($query, $limit, $off=0)\n{\n\treturn $query .' LIMIT '. $limit .' OFFSET '. $off;\n}",
"public function read_limit() {\n\t\t\t$query = 'SELECT \n\t\t\t\tq.id as id, \n\t\t\t\tq.quote as quote, \n\t \t\t\tq.authorID as author_id,\n\t \t\t\tq.categoryID as category_id,\n\t \t\t\tc.category as category,\n\t \t\t\ta.author as author\n\t \t\tFROM\n\t \t\t\tquotes q\n\t \t\tLEFT JOIN\n\t \t\t\tcategories c ON q.categoryID = c.id\n\t \t\tLEFT JOIN\n\t \t\t\tauthors a ON q.authorID = a.id\n\t\t\tORDER BY\n\t\t\t\tq.id ASC\n\t\t\tLIMIT ';\n\n\t\t//Issues using Limit with a dynamic parameter. Work around of concat the amount to the end of the query string.\n\t\t\t$query = $query . $this->limit;\n\n\t\t//Prepare Statement\n\t\t$statement = $this->db->prepare($query);\n\n\t\t//Execute statement\n\t\t$statement->execute();\n\n\t\treturn $statement;\n\t\t}",
"public function limitClause(){\n try {\n // Sparql10.g:169:3: ( LIMIT INTEGER ) \n // Sparql10.g:170:3: LIMIT INTEGER \n {\n $this->match($this->input,$this->getToken('LIMIT'),self::$FOLLOW_LIMIT_in_limitClause612); \n $this->match($this->input,$this->getToken('INTEGER'),self::$FOLLOW_INTEGER_in_limitClause614); \n\n }\n\n }\n catch (RecognitionException $re) {\n $this->reportError($re);\n $this->recover($this->input,$re);\n }\n catch(Exception $e) {\n throw $e;\n }\n \n return ;\n }",
"protected function buildSqlLimit(epQueryNode &$node) {\n \n $sql = 'LIMIT ';\n\n // grab the start\n $start = $this->buildSql($node->getChild('start'));\n\n // get length if exists\n if ($length_node = & $node->getChild('length')) {\n $sql .= $this->buildSql($length_node);\n\n $sql .= ' OFFSET ' . $start;\n\n } else {\n\n $sql .= $start;\n }\n \n return $sql;\n }",
"private function setLimitClause() {\n\t\t//$this->sLimitClause = \"LIMIT \".$this->sRangeStart.\", \".$this->sRange;\n\t\t$this->sLimitClause = \"LIMIT :range_start, :range\";\n\t}",
"public function buildLimit()\n\t{\n\t\t$string = 'LIMIT ';\n\t\t$string .= ((!empty($this->start)) ? (int)$this->start . ',' : '');\n\t\t$string .= ((!empty($this->limit)) ? (int)$this->limit : '18446744073709551615');\n\n\t\treturn $string;\n\t}",
"public function limit($sqlQuery, $number);",
"public function limit($limit) {\n $this->queryFragments[] = new LimitFragment($limit);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get an address by phone number. | public function getAddressByPhone($phone); | [
"public function FlexiAddressPhone(){\n $address = $this->FlexiAddress();\n return ($address->exists()) ? $address->PhoneNumbers()->first() : null;\n }",
"public function getPhoneByPhone($phone)\n {\n return $this->call('getPhoneFromAddressBook', [\n 'phone' => $phone\n ]);\n }",
"function findContactByPhoneNo($phoneNumber)\n {\n $contact = false;\n $phoneNumber = str_replace(\"+\", \"\", $phoneNumber);\n $roql_result_set = Connect\\ROQL::query(\"SELECT ID,Name.First,Name.Last FROM Contact C where Phones.PhoneList.RawNumber='\" . $phoneNumber . \"' LIMIT 1\");\n \n while ($roql_result = $roql_result_set->next()) {\n if ($row = $roql_result->next()) {\n $contact = Connect\\Contact::fetch($row[ID]);\n }\n }\n \n return $contact;\n }",
"function getPhoneNumber( $number = 0 )\r\n\t\t{\r\n\t\t\t# Unserialized and decode email array from database\r\n\t\t\t$phone = unserialize( urldecode( $this->phone ) );\r\n\t\t\treturn $phone[ $number ];\r\n\t\t\t\r\n\t\t}",
"public function getStreetNumber();",
"public function getAddress()\n\t{\n\t\treturn Address::getById($this->address);\n\t}",
"public function recipientSearchPhone($phone) {\n return $this->call(\"recipients/phone/{$phone}\");\n }",
"public function getStreetAddress();",
"public function getBillingPhone();",
"function getCustomerByPhone($phone_number) {\n\t\t$DB = LMSDB::getInstance();\n\n\t\t$customer = $DB->GetRow('SELECT\n\t\t\t\t\t\t\t\t\t\t\t\tva.id as voipaccountid, va.phone, va.balance, t.id as tariffid\n\t\t\t\t\t\t\t\t\t\t\t FROM\n\t\t\t\t\t\t\t\t\t\t\t\tvoipaccounts va left join assignments a on va.ownerid = a.customerid left join tariffs t on t.id = a.tariffid\n\t\t\t\t\t\t\t\t\t\t\t WHERE\n\t\t\t\t\t\t\t\t\t\t\t\tva.phone ?LIKE? ? and\n\t\t\t\t\t\t\t\t\t\t\t\tt.type = ?', array($phone_number, TARIFF_PHONE));\n\n\t\tif (!$customer)\n\t\t\tdie('Caller number phone \"' . $phone_number . '\" not found.' . PHP_EOL);\n\n\t\treturn $customer;\n\t}",
"public function getPhoneNumber()\n {\n return $this->getIfSet('number', $this->data->phone);\n }",
"function contact ($phone_number, $ucid, array $other = []) {\n return $this->get(sprintf(self::PHONEID_CONTACT_RESOURCE, $phone_number), array_merge($other, [\n \"ucid\" => $ucid\n ]));\n }",
"public function getAddress($address_id) {\n return $this->request(\n \"GET\",\n \"/users/{$this->user_id}/addresses/{$address_id}\",\n \"UserAddress\"\n )\n ->first();\n }",
"public function find_by_phone($number) {\n $user = $this->with('profile')->where('profile.phone', $number)->find();\n if ($user->loaded) {\n return $user;\n }\n return FALSE;\n }",
"function getCustomerByPhone($phone_number) {\n\t\t$DB = LMSDB::getInstance();\n\n\t\t$customer = $DB->GetRow('SELECT\n\t\t\t\t\t\t\t\t\tva.id as voipaccountid, va.phone, va.balance, t.id as tariffid, va.flags\n\t\t\t\t\t\t\t\t FROM\n\t\t\t\t\t\t\t\t\tvoipaccounts va\n\t\t\t\t\t\t\t\t\tleft join assignments a on va.ownerid = a.customerid\n\t\t\t\t\t\t\t\t\tleft join tariffs t on t.id = a.tariffid\n\t\t\t\t\t\t\t\t WHERE\n\t\t\t\t\t\t\t\t\tva.phone ?LIKE? ? and\n\t\t\t\t\t\t\t\t\tt.type = ?', array($phone_number, TARIFF_PHONE));\n\n\t\treturn (!$customer) ? NULL : $customer;\n\t}",
"public function getAddressNumber()\n {\n\n return $this->address_number;\n }",
"public function findAddress($street, $type, $hNumber)\n\t{\n\t\t$type = $type? $type : 'փողոց';\n\t\t$hNumber = $hNumber? $hNumber : 0;\n\t\t$street = $this->produceUrlParameter($street);\n\t\t$hNumber = $this->produceUrlParameter($hNumber);\n\t\treturn $this->getContent($this->geoDomain . 'api/param/addresses/' . $street . '/' . $type . '/' . $hNumber);\n\t}",
"function get_simple_address_by_address( $address ) {\n\tglobal $wpdb;\n\t$value = $wpdb->get_results( 'SELECT * FROM ' . $wpdb->prefix . 'simple_address WHERE simple_address=\"' . $address . '\"' );\n\n\treturn ! empty( $value ) ? $value[0] : null;\n}",
"public function getPinByNumber($number);"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Update the specified Bpnt in storage. | public function update($id, UpdateBpntRequest $request)
{
$bpnt = $this->bpntRepository->find($id);
if (empty($bpnt)) {
Flash::error('Bpnt not found');
return redirect(route('bpnts.index'));
}
$input = $request->except('foto_rumah');
if($request->has('foto_rumah')){
$foto = $request->file('foto_rumah');
$filename = $bpnt->name.'_'.$bpnt->id.'.'.$foto->getClientOriginalExtension();
$saveFoto = $request->foto_rumah->storeAs('/public/foto_rumah',$filename,'local');
$bpnt->foto_rumah= "storage".substr($saveFoto, strpos($saveFoto, '/'));
$bpnt->save();
}
$bpnt = $this->bpntRepository->update($input, $id);
Flash::success('Bpnt updated successfully.');
return redirect(route('bpnts.index'));
} | [
"public function updated(Bid $bid)\n {\n //\n }",
"public function testUpdateBrokerageBankLinkUsingPut()\n {\n }",
"function updatePoint(PointEntity $newPoint)\r\n {\r\n }",
"public function updated(Point $point)\n {\n //\n }",
"public function testUpdateAchBankLinkUsingPut()\n {\n }",
"protected function update(){\r\n\t\tBranchDAM::update($this);\r\n\t}",
"public function updated(BorrowedBook $borrowedBook)\n {\n //\n }",
"public function testUpdateExternalShipment()\n {\n }",
"public function testUpdateAllocationUsingPut()\n {\n }",
"public function testUpdateAccountingBill()\n {\n }",
"public function update() {\n\t\tOrderPerson::$rawOrderPersons[$this->idOrderPerson]['address'] = $this->address;\n\t\tOrderPerson::$rawOrderPersons[$this->idOrderPerson]['email'] = $this->email;\n\t\tOrderPerson::$rawOrderPersons[$this->idOrderPerson]['firstName'] = $this->firstName;\n\t\tOrderPerson::$rawOrderPersons[$this->idOrderPerson]['lastName'] = $this->lastName;\n\t}",
"public function updateBucket(Bucket $bucket);",
"public function updateToDb()\n\t{\n\t\t$saved_db = DbUtil::switchToLabConfigRevamp();\n\t\t$query_string =\n\t\t\t\"UPDATE measure SET name='$this->name', range='$this->range', unit='$this->unit' \".\n\t\t\t\"WHERE measure_id=$this->measureId\";\n\t\tquery_blind($query_string);\n\t\tDbUtil::switchRestore($saved_db);\n\t}",
"public function update()\n {\n $this->storage->deleteNode($this->id);\n $this->save();\n }",
"public function testUpdateLocation()\n {\n\n }",
"private function updateStock()\n {\n //On boucle dans le panier pour recuperer le produit qui est dans le panier\n foreach (Cart::content() as $item) {\n\n //On recupere l'id du produit dans le panier\n $produit = Produit::find($item->model->id);\n\n //On retire le nombre de la quantité qu'on as selectionner\n $produit->update([\n\n //on prend la qtité en BD on le soustrais par la qtité selectionné dans le panier\n 'quantite' => $produit->quantite - $item->qty\n\n ]);\n }\n }",
"public function testUpdateNodeUsingPut()\n {\n }",
"public function updating()\n {\n }",
"public function updated(BountyClaim $bountyClaim)\n {\n //\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns an OperationalDaysInterface that describe the OperationalDays for the implementing entity between the dates provided. | public function getOperationalDays(DateTimeInterface $obj_until, DateTimeInterface $obj_since = null); | [
"public function listDays()\n {\n $results = $this->holidayDayRepository->listDays();\n\n return $this->transform($results, $this->holidayHourTransformer);\n }",
"public function createIntervalDay(): DateContainerInterface\n {\n return $this->createFromFormat('Y-m-d');\n }",
"public static function getDays();",
"public function days()\n {\n return new Iterator\\Days($this->start, $this->end);\n }",
"public function calculateBusinessDays()\n {\n return $this->calculateDays(request('start_date'), request('end_date'));\n }",
"public function getVacationDays(): int;",
"public function calculateDays()\n {\n if (!($this->start_time instanceof Carbon)) {\n $this->start_time = Carbon::parse($this->start_time);\n }\n if (!($this->end_time instanceof Carbon)) {\n $this->end_time = Carbon::parse($this->end_time);\n }\n\n // Walk through the PTO requested\n // Check for Holidays and weekends\n $current_day = Carbon::parse($this->start_time);\n $this->days = 0;\n while ($current_day->timestamp <= $this->end_time->timestamp) {\n if (!$current_day->isWeekend() && !Holiday::isHoliday($current_day)) {\n $this->days += 1;\n }\n $current_day->addDay();\n }\n\n // Handle special cases\n if ($this->days <= 1) {\n if ($this->is_half_day) {\n $this->days = .5;\n } else {\n $this->days = 1;\n }\n }\n\n return $this;\n }",
"public function estimatedDays();",
"private function getVacationState(): VacationDaysStateInterface\n {\n // Check if the employee has special contract vacation\n if ($this->employee->getSpecialContractVacationDays()) {\n return new SpecialContractVacationState();\n }\n\n // Check if the employee's aga is over the starting age of getting bonus\n if ($this->employee->calculateAge($this->year) >= EmployeeBaseAware::START_GETTING_BONUS_AGE) {\n return new OverAgeVacationState();\n }\n\n return new BasicVacationState();\n }",
"public function getDays()\r\n\t{\r\n\t\tif ( null === $this->arrDays ) {\r\n\t\t\t$objFirstDate = clone $this->getFirstDay();\r\n\t\t\t$cache = Warecorp_Cache::getFileCache();\r\n\t\t\t$cahceKey = 'Warecorp_ICal_Calendar_Week__getDays_'.$objFirstDate->toString('yyyyMMdd');\r\n\t\t\tif ( !$arrDays = $cache->load($cahceKey) ) {\r\n\t\t\t\t$arrDays = array();\r\n\t\t\t\twhile ( $objFirstDate->isEarlier($this->getLastDay()) || $objFirstDate->equals($this->getLastDay()) ) {\r\n\t\t\t\t\t$arrDays[] = new Warecorp_ICal_Calendar_Day($objFirstDate);\r\n\t\t\t\t\t$objFirstDate->add(1, Zend_Date::DAY);\r\n\t\t\t\t}\r\n\t\t\t\t$cache->save($arrDays, $cahceKey, array(), Warecorp_Cache::LIFETIME_10DAYS);\t\t\t\t\r\n\t\t\t}\r\n\t\t\t$this->arrDays = $arrDays;\t\t\t\r\n\t\t}\r\n\t\treturn $this->arrDays;\r\n\t}",
"public function getDifferenceInDays();",
"public function workDays()\n {\n return $this->type->work_days;\n }",
"public function getRestockableInDays();",
"public function getManDays(): ManDays;",
"public function officeDays(): Collection\n {\n return $this->doctor->business_days->map(function($day){\n return $day->iso;\n });\n }",
"public function calculateDays(): int\n {\n $result = 0;\n $start = intval($this->_datefrom->getTimestamp());\n $end = intval($this->_dateto->getTimestamp());\n $diffinsecs = 0;\n if ($end > $start) {\n $diffinsecs = $end-$start;\n } else {\n $diffinsecs = $start-$end;\n }\n if (!empty($this->_restype)) {\n return intval($this::convertResult($diffinsecs));\n } else {\n return intval($diffinsecs/CmpDateConfig::SECSINDAY);\n }\n }",
"public function getDays(): array\n {\n return $this->days;\n }",
"protected function calculateBaseVacationDays(): int\n {\n return $this->baseVacationDaysStrategy->getBaseVacationDays($this->employee, $this->year);\n }",
"public function saveDays(Client $client, $start_date, $end_date)\n {\n $em = $this->container->get('doctrine')->getManager();\n $user = $this->ds->getUser();\n $company_id = $this->ds->getCompanyId();\n $orders_repo = $this->container->get('doctrine')->getRepository('JCSGYKAdminBundle:ClientOrder');\n $catering = $client->getCatering();\n\n // list of days: key is ISO date format, when food was ordered, value is 1 or 0\n // based on order template\n $days = $this->getMonthlySubs($catering, $start_date, $end_date);\n\n // find the already created open records for this time period\n $orders = $orders_repo->getOrdersForPeriod($client->getId(), $start_date, $end_date);\n\n foreach ($days as $ISO_date => $sub) {\n $date = new \\DateTime($ISO_date);\n $status = $catering->getStatus($date);\n\n // only deal with orders, and if that day is not closed\n if ($sub != 1 || Catering::CLOSED == $status) {\n continue;\n }\n\n // check if we have any records for that day\n if (!empty($orders[$ISO_date])) {\n $order = $orders[$ISO_date];\n\n if ($order->getClosed() == false // make sure, that we only modify open records!\n && $order->getCancel() == false // and we also skip records, that are already cancelled\n && Catering::ACTIVE == $status // and we only do anything if that day is active\n ) {\n $order->setOrder(true);\n }\n }\n // or if no record exists, we create a new one\n else {\n // no record for this day, lets create one!\n $order = (new ClientOrder())\n ->setCompanyId($company_id)\n ->setClient($client)\n ->setDate($date)\n ->setCreator($user)\n ->setMenu($catering->getMenu())\n ;\n\n if (Catering::ACTIVE == $status) {\n $order->setOrder(true);\n $order->setCancel(false);\n $order->setClosed(false);\n } elseif (Catering::PAUSED == $status) {\n // for paused days we set a cancelled record\n $order->setOrder(false);\n $order->setCancel(true);\n $order->setClosed(false);\n }\n\n $em->persist($order);\n }\n }\n\n $em->flush();\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Used to generate links for old posts | public function generate_past_post_links()
{
// get all the posts, as wordpress does not currently support the use is null on the meta query
$options = get_field('fpt_bitly_show_on', 'options');
$args = array(
'post_type' => $options,
'meta_key' => 'fpt_bitlylink',
'order_by' => 'meta_value',
'order' => 'DESC',
'numberposts' => -1,
'meta_key' => '',
);
$past_posts = get_posts($args);
foreach ($past_posts as $p) {
if (!get_post_meta($p->ID, 'fpt_bitlylink', true)) {
$url = get_permalink($p->ID);
$shortlink = $this->shorten_link($url);
$this->update_bitly_shortlink($shortlink, $p->ID);
continue;
}
}
} | [
"function recent_post_links(){\r\n\t\r\n\tglobal $gcdb,$db_query;\r\n\t$cuurent_post_date = the_post_date(false);\r\n\t\r\n\tif(!is_x()){\r\n \tif(isset($db_query->query_vars['tagid'])) {\r\n \t\t$tag_id = $gcdb->escape($db_query->query_vars['tagid']);\r\n \t\t\r\n \t\t$request_prv = \"SELECT a.ID, a.post_title FROM $gcdb->posts a,$gcdb->post2tag b\";\r\n \t\t$request_prv .= \" WHERE a.post_date < '\".$cuurent_post_date;\r\n \t\t$request_prv .= \"' AND post_status = 'publish'\";\r\n \t\t$request_prv .= \" AND ping_status = 'open'\";\r\n \t\t$request_prv .= \" AND b.tag_id = \".$tag_id;\r\n \t\t$request_prv .= \" AND a.ID = b.post_id\";\r\n \t\tif(!user_is_auth())\r\n \t\t{\r\n \t\t $request_prv .= \" AND show_in_home = 'yes'\";\r\n \t\t}\r\n \t\t$request_prv .= \" ORDER BY a.post_date DESC,a.ID DESC\";\r\n \t\t$request_prv .= \" LIMIT \".get_option('prev_links');\r\n \t\t$prv_posts = $gcdb->get_results($request_prv);\r\n \t\t\r\n \t\t$prv_posts_num = count($prv_posts);\r\n \t\t\r\n \t\tif($prv_posts_num==0)\r\n \t\t{\r\n \t\t\treturn \"\";\r\n \t\t}\r\n \t\t\r\n \t\telse{\r\n \t\t\tif(is_home()||is_page()) {\r\n \t\t\t for ($i=0;$i<$prv_posts_num;$i++) { \r\n \t\t\t $prv_post = $prv_posts[$i];\t \r\n \t\t\t\t echo(\"««« <a href='\".get_permalink($prv_post->ID,$tag_id).\"' title='click to view previous blog'>$prv_post->post_title</a><br/><br/>\");\r\n \t\t\t }\r\n \t\t\t}\r\n \t\t}\r\n \t}\r\n \t\r\n \telse {\r\n \t\t$request_prv = \"SELECT ID, post_title FROM $gcdb->posts\";\r\n \t\t$request_prv .= \" WHERE post_date < '\".$cuurent_post_date;\r\n \t\t$request_prv .= \"' AND post_status = 'publish'\";\r\n \t\t$request_prv .= \" AND ping_status = 'open'\";\r\n \t\tif(!user_is_auth())\r\n \t\t{\r\n \t\t $request_prv .= \" AND show_in_home = 'yes'\";\r\n \t\t}\r\n \t\t$request_prv .= \" ORDER BY post_date DESC\";\r\n \t\t$request_prv .= \" LIMIT \".get_option('prev_links');\r\n \t\r\n \t\t$prv_posts = $gcdb->get_results($request_prv);\r\n \t\t\r\n \t\t$prv_posts_num = count($prv_posts);\r\n \t\t\r\n \t\tif($prv_posts_num==0)\r\n \t\t{\r\n \t\t\treturn \"\";\r\n \t\t}\r\n \t\t\r\n \t\telse{\r\n \t\t\tif(is_home()||is_page()) {\r\n \t\t\t for ($i=0;$i<$prv_posts_num;$i++) { \r\n \t\t\t $prv_post = $prv_posts[$i];\r\n \t\t\t\t echo(\"««« <a href='\".get_permalink($prv_post->ID).\"' title='click to view previous blog'>$prv_post->post_title</a><br/><br/>\");\r\n \t\t\t }\r\n \t\t\t}\r\n \t\t}\r\n \t}\r\n }\r\n}",
"public function index_post_links()\n {\n }",
"static function previous_post_link( $args = array() ){\r\n\r\n $args = wp_parse_args( $args, array(\r\n 'format' => '%link »',\r\n 'link' => '%title',\r\n 'random-adjust' => false,\r\n 'in-same-term' => false,\r\n 'taxonomy' => 'category',\r\n 'exclude-terms' => '',\r\n ));\r\n\r\n $previous_post = get_previous_post_link( $args['format'], $args['link'], $args['in-same-term'], $args['exclude-terms'], $args['taxonomy'] );\r\n\r\n // If there is next post\r\n if( $previous_post != '' ){\r\n echo $previous_post;\r\n return '';\r\n }\r\n\r\n // There is no prev post. a random post should be shown\r\n $next_post = get_adjacent_post( $args['in-same-term'], $args['exclude-terms'], false, $args['taxonomy'] );\r\n\r\n $excluded_posts = array();\r\n\r\n // exclude prev post\r\n if( $next_post ){\r\n $excluded_posts[] = $next_post->ID;\r\n }\r\n\r\n // exclude current post\r\n $excluded_posts[] = get_the_ID();\r\n\r\n $random_query = new WP_Query(\r\n array(\r\n 'orderby' => 'rand',\r\n 'posts_per_page' => '1',\r\n 'post__not_in' => $excluded_posts,\r\n 'post_type' => get_post_type(),\r\n )\r\n );\r\n\r\n // No another post!\r\n if( $random_query->post_count == 0 )\r\n return '';\r\n\r\n $title = $random_query->post->post_title;\r\n\r\n if( empty( $random_query->post->post_title ) )\r\n $title = __( 'Previous Post', 'better-studio' );\r\n\r\n $title = apply_filters( 'the_title', $title, $random_query->post->ID );\r\n\r\n $date = mysql2date( get_option( 'date_format' ), $random_query->post->post_date );\r\n $rel = 'prev';\r\n\r\n $string = '<a href=\"' . get_permalink( $random_query->post ) . '\" rel=\"'.$rel.'\">';\r\n $inlink = str_replace( '%title', $title, $args['link'] );\r\n $inlink = str_replace( '%date', $date, $inlink );\r\n $inlink = $string . $inlink . '</a>';\r\n\r\n echo str_replace( '%link', $inlink, $args['format'] );\r\n\r\n }",
"public function show_more_posts_link()\n {\n }",
"public function page_for_posts_url()\n {\n }",
"function no_more_jumping($post) {\n\treturn '<a href=\"'.get_permalink($post->ID).'\" class=\"read-more\">'.'Continue Reading'.'</a>';\n}",
"function no_more_jumping($post) {\n\treturn '<a href=\"'.get_permalink($post->ID).'\" class=\"read-more\">'.'»'.'</a>';\n}",
"function elder_linkable_date(){\n global $year, $currentmonth;\n\n printf('<a href=\"%1$s\" title=\"View posts from %2$s %3$s\">',\n get_month_link($year, $currentmonth),\n get_the_date('F'),\n get_the_date('Y')\n );\n echo get_the_date('F').' '.get_the_date('j');\n echo '</a>, ';\n printf('<a href=\"%1$s\" title=\"View posts from %2$s\">',\n get_year_link($year),\n get_the_date('Y')\n );\n echo get_the_date('Y');\n echo '</a>';\n}",
"function mushon_previous_post_link_args() {\n\t$args = array ('format' => '%link',\n\t\t\t\t\t\t\t\t 'link' => '<span><strong>Prev</strong></span><span class=\"meta-nav\"><strong>ious Post:</strong><br> %title</span>',\n\t\t\t\t\t\t\t\t 'in_same_cat' => FALSE,\n\t\t\t\t\t\t\t\t 'excluded_categories' => '');\n\treturn $args;\n}",
"function UnbMakePostLink($post, $page = 0, $customtag = false)\r\n{\r\n\tglobal $UNB, $UNB_T;\r\n\r\n\tif (is_int($post))\r\n\t{\r\n\t\t$postid = $post;\r\n\t\t$threadid = 0;\r\n\t\t$date = 0;\r\n\t}\r\n\telseif (is_array($post))\r\n\t{\r\n\t\t$postid = intval($post['ID']);\r\n\t\t$threadid = intval($post['Thread']);\r\n\t\t$date = intval($post['Date']);\r\n\t}\r\n\telseif (is_object($post))\r\n\t{\r\n\t\t$postid = $post->GetID();\r\n\t\t$threadid = $post->GetThread();\r\n\t\t$date = $post->GetDate();\r\n\t}\r\n\telse\r\n\t{\r\n\t\t// neither int nor array nor object given\r\n\t\treturn false;\r\n\t}\r\n\r\n\tif ($customtag === false)\r\n\t{\r\n\t\t$out = '<a href=\"' .\r\n\t\t\tUnbLink(\r\n\t\t\t\t'@thread',\r\n\t\t\t\tarray(\r\n\t\t\t\t\t'postid' => $postid),\r\n\t\t\t\ttrue) .\r\n\t\t\t'\">';\r\n\t\t$out .= '<img ' . $UNB['Image']['goto_post'] . ' title=\"' . $UNB_T['goto post'] . '\" /></a>';\r\n\t}\r\n\telse if ($customtag === true)\r\n\t{\r\n\t\t$out = '<a href=\"' .\r\n\t\t\tUnbLink(\r\n\t\t\t\t'@thread',\r\n\t\t\t\tarray(\r\n\t\t\t\t\t'postid' => $postid),\r\n\t\t\t\ttrue) .\r\n\t\t\t'\">';\r\n\t}\r\n\telse if ($customtag === 2)\r\n\t{\r\n\t\t$out = UnbLink(\r\n\t\t\t\t'@thread',\r\n\t\t\tarray(\r\n\t\t\t\t'postid' => $postid),\r\n\t\t\ttrue);\r\n\t}\r\n\telse if ($customtag === 3)\r\n\t{\r\n\t\t$out = TrailingSlash(rc('home_url')) . UnbLink(\r\n\t\t\t\t'@thread',\r\n\t\t\tarray(\r\n\t\t\t\t'postid' => $postid),\r\n\t\t\tfalse,\r\n\t\t\t/*sid*/ false);\r\n\t}\r\n\telse\r\n\t{\r\n\t\t$out = '';\r\n\t}\r\n\r\n\treturn $out;\r\n}",
"function updateLinks($old, $new) {\n\t\tif(class_exists('Subsite')) Subsite::disable_subsite_filter(true);\n\t\n\t\t$pages = $this->owner->BackLinkTracking();\n\n\t\t$summary = \"\";\n\t\tif($pages) {\n\t\t\tforeach($pages as $page) $page->rewriteFileURL($old,$new);\n\t\t}\n\t\t\n\t\tif(class_exists('Subsite')) Subsite::disable_subsite_filter(false);\n\t}",
"public function makeLinks() {\r\n $this->url = new Url(sprintf(\"/f-p%d.htm#%d\", $this->id, $this->id));\r\n $this->url->single = sprintf(\"/forums?mode=post.single&id=%d\", $this->id);\r\n $this->url->report = sprintf(\"/f-report-%d.htm\", $this->id);\r\n $this->url->reply = sprintf(\"/f-po-quote-%d.htm\", $this->id);\r\n $this->url->delete = sprintf(\"/f-po-delete-%d.htm\", $this->id);\r\n $this->url->edit = sprintf(\"/f-po-editpost-%d.htm\", $this->id);\r\n $this->url->replypm = sprintf(\"/messages/new/from/%d/\", $this->id);\r\n $this->url->iplookup = sprintf(\"/moderators?mode=ip.lookup&ip=%s\", $this->ip);\r\n $this->url->herring = sprintf(\"/f-herring-p-%d.htm\", $this->id);\r\n \r\n if ($this->thread->forum->id == 71) {\r\n $this->url->developers = sprintf(\"/%s/d/%s/%s\", \"developers\", $this->thread->url_slug, $this->url_slug);\r\n }\r\n \r\n return $this;\r\n }",
"public function getLastPageLink()\n {\n $posts = $this->getPosts();\n $pages = ceil(count($posts) / POSTS_PER_PAGE);\n\n $params = array(\n 'name' => Utils::cleanStringForUrl($this->getTitle()),\n 'id' => $this->id,\n 'page' => $pages,\n );\n $link = Globals::getRouter()->assemble($params, $this->_route, true);\n return $link;\n }",
"function no_more_jumping($post) {\n\t\treturn '<a href=\"'.get_permalink($post->ID).'\" class=\"read-more\">'.' Continue Reading »'.'</a>';\n\t}",
"function no_more_jumping($post) {\n\t\treturn ' <a href=\"'.get_permalink($post->ID).'\" class=\"read-more\">'.'Continue Reading'.'</a>';\n\t}",
"public function getRssByNewPosts()\n {\n $posts = PostService::filterRssPosts(PostService::WALL_ALL);\n\n $fileName = 'new_posts.rss';\n $this->createFileRssFeed($posts, $fileName);\n return Redirect::to(self::FOLDER_RSS . $fileName);\n }",
"public function getNewPostUrl()\n {\n return $this->_getUrl('customer/cc/newPost');\n }",
"public static function gen_day_archive_links() {\n\t\t\t$blog_view = self::get_blog_view_vars();\n\t\t\t$day_posts = self::count_post_by_date( date( \"Y-m-d\" ) );\n\t\t\t$day_pages = ceil( $day_posts / $blog_view[ 'posts_per_page' ] );\n\n\t\t\t//Day Posts\n\t\t\t$normal_link = self::get_link_rule_arr( get_day_link( date( 'Y' ), date( 'm' ), date( 'd' ) ), null );\n\t\t\t$url_array[ 'normal_link' ][ ] = $normal_link;\n\n\t\t\tif ( $day_pages > 1 ) {\n\t\t\t\t$paginated_link = self::get_link_rule_arr( self::get_date_archive_pagination( 'day', 2 ), null );\n\t\t\t\t$url_array[ 'paginated_link' ][ ] = $paginated_link;\n\n\t\t\t\t$pagination_exceed = self::get_link_rule_arr( self::get_date_archive_pagination( 'day', $day_pages + 7 ), null );\n\t\t\t\t$url_array[ 'pagination_exceed' ][ ] = $pagination_exceed;\n\t\t\t}\n\t\t\tself::update_url_array( 'day_archive', $url_array );\n\t\t}",
"public function update_permalinks() {\n\t\tglobal $wp_rewrite;\n\t\t$wp_rewrite->set_permalink_structure('/%year%/%monthnum%/%day%/%postname%/');\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Whether the current host is the SSO host. | public function is_sso_host() {
return $this->sso_host === $this->host;
} | [
"public function isFromServer()\n {\n $username = $this->getHostmask()->getUsername();\n return empty($username);\n }",
"public function isHost()\n {\n return $this->hasRole('host');\n }",
"public function isHostBackend()\n {\n $backendUrl = $this->configInterface->getValue(Store::XML_PATH_UNSECURE_BASE_URL, ScopeInterface::SCOPE_STORE);\n $backendHost = parse_url(trim($backendUrl), PHP_URL_HOST);\n $host = isset($_SERVER['SERVER_NAME']) ? $_SERVER['SERVER_NAME'] : '';\n return (strcasecmp($backendHost, $host) === 0);\n }",
"public function SSOSupport()\n {\n $implements = class_implements($this->auth_service);\n return isset($implements['Foundry\\Core\\Auth\\AuthServiceSSO']);\n }",
"public function isCorporateSite()\n {\n $request = $this->container->get('request_stack')->getCurrentRequest();\n $host = $request->server->get('HTTP_HOST', '');\n \n $isCorporate = ((substr($host, 0, 9) == 'corporate') || $request->attributes->get('isRestCorporate') == 'true');\n \n return $isCorporate;\n }",
"public function isSSOEnabled() {\n return self::getIni()->variable( $this->getServiceProvider(), 'SSO' ) == 'enabled';\n }",
"function isHost(){\n $ci=CI::get_instance();\n if(checkSession()){\n return strtolower($ci->session->userdata('user_data')['user_role_name'])=='host'?true :false;\n }\n return false;\n}",
"public function isHost(): bool\n {\n return $this->isClass && $this->name === 'host';\n }",
"public function is_auth() \n\t{\n\t\treturn (bool)$this->SESS->get('client', $this->auth_sess_key);\n\t}",
"public function isFromUser()\n {\n $username = $this->getHostmask()->getUsername();\n return !empty($username);\n }",
"public function isFromUser()\n\t{\n\t\t$username = $this->getHostmask()->getUsername();\n\t\treturn !empty($username);\n\t}",
"public static function is_sso_referer()\n\t{\n\t\t//if(isset($_SERVER['HTTP_REFERER']))\n\t\t//\treturn self::$ssoHost == sf\\get_url_host($_SERVER['HTTP_REFERER']);\n\t\tif(sf\\getGPC('from', 'g') == 'sso')\n\t\t\treturn true;\n\t\treturn false;\n\t}",
"protected function _isExternalAuth() {\n\t\t$isExternalAuth = false;\n\t\tif ($this->Setting->getConfig('ExternalAuth')) {\n\t\t\t$isExternalAuth = $this->UserInfo->isExternalAuth();\n\t\t}\n\n\t\treturn $isExternalAuth;\n\t}",
"public static function is_envato_hosted_site() {\n\t\treturn defined( 'ENVATO_HOSTED_SITE' );\n\t}",
"function isSystem(): bool {\n $host = request()->getHost();\n if($host === env('APP_BASE_URL')){\n return true;\n }\n\n return false;\n }",
"public function hasHost()\n {\n return isset($this->host);\n }",
"public function checkHost() {\n\n\t\t\t//Get the host\n\t\t\t$host = $_SERVER['HTTP_HOST'];\n\n\t\t\t//Verify if host is permited or no\n\t\t\treturn in_array($host, $this->hosts ) ? true : false;\n\n\t\t}",
"public function isExternalAuth() {\n\t\t$remoteUser = env('REMOTE_USER');\n\t\tif (empty($remoteUser)) {\n\t\t\t$remoteUser = env('REDIRECT_REMOTE_USER');\n\t\t}\n\n\t\t$result = !empty($remoteUser);\n\n\t\treturn $result;\n\t}",
"public static function isSecure() {\n if (isset($_SERVER['X_PAPAYA_HTTPS'])) {\n $header = $_SERVER['X_PAPAYA_HTTPS'];\n } elseif (isset($_SERVER['HTTP_X_PAPAYA_HTTPS'])) {\n $header = $_SERVER['HTTP_X_PAPAYA_HTTPS'];\n } else {\n $header = NULL;\n }\n if (isset($header) &&\n defined('PAPAYA_HEADER_HTTPS_TOKEN') &&\n strlen(PAPAYA_HEADER_HTTPS_TOKEN) == 32 &&\n $header == PAPAYA_HEADER_HTTPS_TOKEN) {\n return TRUE;\n }\n return (isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) === 'on');\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the type evt. | public function getTypeEvt() {
return $this->typeEvt;
} | [
"public function getType()\n {\n return $this->event_type;\n }",
"public function getEventType()\n\t\t{\n\t\t\treturn $this->event_type;\n\t\t}",
"public function getEventType()\n {\n return $this->event_type;\n }",
"public function getEventType()\n {\n return self::TYPE;\n }",
"public function getEventType(): string\n {\n return $this->input('event-type');\n }",
"public function getEventType(){\n return $this->eventType;\n }",
"function getType() \n {\n $class = strtolower(get_class($this));\n $parts = explode(\"event\",$class);\n if (count($parts) < 2) {\n return null;\n }\n $type = array_pop($parts);\n $name = implode(\"event\",$parts);\n return ucfirst($type); \n }",
"public function get_event_type()\n\t{\n\t\t$type = DB::get_value( 'SELECT type FROM {log_types} WHERE id=' . $this->type_id );\n\t\treturn $type ? $type : _t( 'Unknown' );\n\t}",
"public function getEventType() {\n $ret = '';\n switch($this->type) {\n case Event::TYPE_EVENT:\n $ret = 'Event';\n break;\n case Event::TYPE_FLAGSHIP:\n $ret = 'Flagship';\n break;\n case Event::TYPE_WORKSHOP:\n $ret = 'Workshop';\n break;\n case Event::TYPE_CELEBRITY_APPEARANCE:\n $ret = 'Celebrity Appearance';\n break;\n case Event::TYPE_GUEST_LECTURE:\n $ret = 'Guest Lecture';\n break;\n }\n\n return $ret;\n }",
"function get_event_type_id(){\n\t\treturn $this->event_type_id;\n\t}",
"public function type() {\n return eventsign_type_load($this->type);\n }",
"public function getClickType()\n {\n return $this->click_type;\n }",
"public function getEventType()\n {\n return $this->readOneof(2);\n }",
"function eventType($type = null) {\n\t$types = [\n\t\tEVENT_TYPE_ITEM_NOTSUPPORTED => _('Item in \"not supported\" state'),\n\t\tEVENT_TYPE_LLDRULE_NOTSUPPORTED => _('Low-level discovery rule in \"not supported\" state'),\n\t\tEVENT_TYPE_TRIGGER_UNKNOWN => _('Trigger in \"unknown\" state')\n\t];\n\n\tif (is_null($type)) {\n\t\treturn $types;\n\t}\n\n\treturn $types[$type];\n}",
"public function getTrackingEventType()\n\t\t{\n\t\t\treturn $this->tracking_event_type;\n\t\t}",
"public function get_event_type_label()\n {\n\n // Get event type\n if ($event_type = $this->get_event_type()) {\n\n // Get all event types\n $event_types = $this->get_controller()->get_event_types();\n\n // Check if event type is defined\n if (isset($event_types[$event_type])) {\n\n // Return label\n return $event_types[$event_type]['label'];\n }\n }\n\n // Event type not set\n return null;\n }",
"public function get_trigger_type() {\n\t\t\treturn $this->trigger_type;\n\t\t}",
"function getType(): string\n {\n return $this->actionType;\n }",
"public function getListenerType();"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
add or remove products to tmp session | function __pringoo_add_to_cart_session($pid , $flag = true) {
if(session_status() == PHP_SESSION_NONE) {session_start();}
$stoken = wp_get_session_token();
if(!isset($_SESSION[$stoken]["products"])) {
$_SESSION[$stoken]["products"] = [];
}
$shop_term_id = pringoo_get_shop_by_producs($pid);
if($shop_term_id == null) {return false;}
if($flag == true) {
$_SESSION[$stoken]["products_all"][$pid] = $pid;
$_SESSION[$stoken]["products"][$shop_term_id][$pid] = $pid;
}
else {
unset($_SESSION[$stoken]["products_all"][$pid]);
unset($_SESSION[$stoken]["products"][$shop_term_id][$pid]);
}
} | [
"function lb_add_product_data_to_session() {\n\tif ( ! isset( $_GET['add_to_cart'] ) ) {\n\t\treturn;\n\t}\n\n\t$product_id = esc_html( $_GET['add_to_cart'] );\n\t$flag = false;\n\n\tif ( isset( $_SESSION['cart'] ) ) {\n\t\tforeach ( $_SESSION['cart'] as $key => $product ) {\n\t\t\tif ( $product_id === $product['product_id'] ) {\n\t\t\t\t$_SESSION['cart'][ $key ]['product_count'] += 1;\n\t\t\t\t$flag = true;\n\t\t\t}\n\t\t}\n\t}\n\n\tif ( ! $flag ) {\n\t\t$add_product = array(\n\t\t\t'product_id' => $product_id,\n\t\t\t'product_count' => 1,\n\t\t);\n\n\t\t$_SESSION['cart'][] = $add_product;\n\t}\n\n\tif ( 'single_product' === $_GET['action'] ) {\n\t\tlb_redirect( '?action=' . esc_html( $_GET['action'] ) . '&id=' . esc_html( $_GET['id'] ) );\n\t} else {\n\t\tlb_redirect( '?action=' . esc_html( $_GET['action'] ) );\n\t}\n}",
"private function saveProducts() {\n Cache::forever('products', $this->products);\n }",
"public function settmpReg(){\n\t\t\n\t\t# Register Product ID\n\t\tif($this->isPropertySet(\"ProTmpID\", \"V\"))\n\t\t\t$_SESSION['ProTmpID'] \t\t= $this->getProperty(\"ProTmpID\");\n\t}",
"function addProduct($product_id, $qt) {\n $old_qt = 0;\n if (array_key_exists($product_id, $this->products)) {\n $old_qt = $this->products[$product_id];\n }\n $this->products[$product_id] = $old_qt + $qt;\n $_SESSION['products'] = $this->products;\n }",
"public function removeFromSession() {\n $_SESSION['__shop']['cart'] = 0;\n }",
"function add($product) {\n\t\t// load the cart\n\t\t$cart = session('cart');\n\t\t\n\t\t// append the new product to it\n\t\t$cart[] = $product;\n\t\t\n\t\t// save again\n\t\tsession('cart', $cart);\n\t\t\n\t\t// back to the products\n\t\tredirect('/products');\n\t\t\n\t}",
"private function addProductToCart()\r\n {\r\n $session = JFactory::getSession();\r\n if (!$this->params->get('force_add',0) && $session->get('VMautoadded')) return true; // check so that this product gets added only once per session if \"force_add\" is not set\r\n \r\n JRequest::setVar('quantity', array('1') );\r\n $cart = VirtueMartCart::getCart();\r\n $cart->add(array($this->params->get('product_id',0)));\r\n \r\n $session->set('VMautoadded', true); // set the session so that this product gets added only once per session\n }",
"public function increaseProductInShoppingCart(){\n $id = $this->request->GET(\"id\");\n\n if($this->shoppingCart != \"\"){\n if($this->shoppingCart->checkProductInShoppingCart($id)){\n $this->shoppingCart->increaseAmountOfProduct($id);\n $this->request->setSESSION(\"shoppingCart\", serialize($this->shoppingCart));\n }\n }\n header(\"Location: http://Localhost/WebundMultimedia/shoppingcart\");\n die();\n }",
"public function storeInSession()\n\t{\n\t\t$this->session->put(self::SHOPPING_CART, $this->storedItems);\n\t}",
"public function checkTempCart()\n {\n if (Auth::guard('client')->check()) {\n // check 'temp' cart\n if (Cart::instance('temp')->count()) {\n foreach (Cart::instance('temp')->content() as $row) {\n Cart::instance('shopping')->add($row->id, $row->name, $row->qty, $row->price, [\n 'image' => $row->options->image,\n 'list_price' => $row->options->list_price,\n 'discount' => $row->options->discount\n // 'stock' => $row->options->stock\n ]);\n }\n Cart::instance('temp')->destroy();\n }\n }\n }",
"function remove_product($product_id)\r\n{\r\n\t$product_id = intval($product_id);\r\n\t$max = count($_SESSION['cart']);\r\n\t\r\n\tfor($i = 0; $i < $max; $i++)\r\n\t{\r\n\t\tif($product_id == $_SESSION['cart'][$i]['productid']); //this might ng to be product_id\r\n\t\t{\r\n\t\t\tunset($_SESSION['cart'][$i]);\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\t$_SESSION['cart'] = array_values($_SESSION['cart']);\r\n\t\r\n}",
"public function removeCartFromSession() {\n\t\t$session = JFactory::getSession();\n\t\t$session->set('vmcart', 0, 'vm');\n\t}",
"public function addToCartSession($product_id){\n\n // multi quantity of ids exists within this session key.\n Session::push('cart_product_ids', $product_id);\n\n }",
"private function removeProducts()\n {\n $model = Mage::getModel('ovs_magefaker/remove');\n\n $startTime = new DateTime('NOW');\n $remove = $model->removeProducts();\n $endTime = new DateTime('NOW');\n\n if ($remove) {\n Mage::getSingleton('adminhtml/session')->addSuccess(\n $this->__('Products removed')\n .' - '.$this->getElapsedTime($startTime, $endTime)\n );\n } else {\n Mage::getSingleton('adminhtml/session')->addError(\n $this->__('An error occurred while removing products')\n .' - '.$this->getElapsedTime($startTime, $endTime)\n );\n }\n }",
"protected function storeWishlist(): void\n {\n $this->wishlistProducts = array_values(array_unique($this->wishlistProducts)); //re-index array\n session(['wishlist' => $this->wishlistProducts]);\n if (auth::check()) {\n Auth::user()->wishlist()->updateOrCreate(['user_id' => Auth::id()], ['data' => $this->wishlistProducts]);\n }\n }",
"public function hookactionCartSave()\n {\n if (!isset($this->context->cart)) {\n return;\n }\n\n if (!Tools::getIsset('id_product')) {\n return;\n }\n\n $cart = array(\n 'controller' => Tools::getValue('controller'),\n 'addAction' => Tools::getValue('add') ? 'add' : '',\n 'removeAction' => Tools::getValue('delete') ? 'delete' : '',\n 'extraAction' => Tools::getValue('op'),\n 'qty' => (int)Tools::getValue('qty', 1)\n );\n\n $cart_products = $this->context->cart->getProducts();\n if (isset($cart_products) && count($cart_products)) {\n foreach ($cart_products as $cart_product) {\n if ($cart_product['id_product'] == Tools::getValue('id_product')) {\n $add_product = $cart_product;\n }\n }\n }\n\n if ($cart['removeAction'] == 'delete') {\n $add_product_object = new Product((int)Tools::getValue('id_product'), true, (int)Configuration::get('PS_LANG_DEFAULT'));\n if (Validate::isLoadedObject($add_product_object)) {\n $add_product['name'] = $add_product_object->name;\n $add_product['manufacturer_name'] = $add_product_object->manufacturer_name;\n $add_product['category'] = $add_product_object->category;\n $add_product['reference'] = $add_product_object->reference;\n $add_product['link_rewrite'] = $add_product_object->link_rewrite;\n $add_product['link'] = $add_product_object->link_rewrite;\n $add_product['price'] = $add_product_object->price;\n $add_product['ean13'] = $add_product_object->ean13;\n $add_product['id_product'] = Tools::getValue('id_product');\n $add_product['id_category_default'] = $add_product_object->id_category_default;\n $add_product['out_of_stock'] = $add_product_object->out_of_stock;\n $add_product['minimal_quantity'] = 1;\n $add_product['unit_price_ratio'] = 0;\n $add_product = Product::getProductProperties((int)Configuration::get('PS_LANG_DEFAULT'), $add_product);\n }\n }\n\n if (isset($add_product) && !in_array((int)Tools::getValue('id_product'), self::$products)) {\n self::$products[] = (int)Tools::getValue('id_product');\n $ga_products = $this->wrapProduct($add_product, $cart, 0, true);\n\n if (array_key_exists('id_product_attribute', $ga_products) && $ga_products['id_product_attribute'] != '' && $ga_products['id_product_attribute'] != 0) {\n $id_product = $ga_products['id_product_attribute'];\n } else {\n $id_product = Tools::getValue('id_product');\n }\n\n $gacart = $this->_manageData(\"\", \"R\");\n\n if ($cart['removeAction'] == 'delete') {\n $ga_products['quantity'] = -1;\n } elseif ($cart['extraAction'] == 'down') {\n if (array_key_exists($id_product, $gacart)) {\n $ga_products['quantity'] = $gacart[$id_product]['quantity'] - $cart['qty'];\n } else {\n $ga_products['quantity'] = $cart['qty'] * -1;\n }\n } elseif (Tools::getValue('step') <= 0) { // Sometimes cartsave is called in checkout\n if (array_key_exists($id_product, $gacart)) {\n $ga_products['quantity'] = $gacart[$id_product]['quantity'] + $cart['qty'];\n }\n }\n\n $gacart[$id_product] = $ga_products;\n $this->_manageData($gacart, 'W');\n }\n }",
"function removeFromShoppingCartSession()\n\t{\n\t\t$art_object_id = $this->input->post('id');\n\t\t\n\t\t//RELEASE THE ARTOBJECT LOCK\n\t\t$locked = $this->sales_model->update_lock_artObject($art_object_id,0);\n\t\t\n\t\t//run through the shoppingcart items and set the quantity to 0\n\t\t$response = 0;\n\t\t\n\t\t\n\t\tif($locked)\n\t\t{\n\t\t\tforeach ($this->cart->contents() as $item)\r\n\t\t\t{\r\n\t\t\t\tif($item['id'] == $art_object_id)\r\n\t\t\t\t{\r\n\t\t\t\t\t$data = array(\r\n\t\t\t\t\t\t\t'rowid' => $item['rowid'],\r\n\t\t\t\t\t\t\t'qty' => 0\r\n\t\t\t\t\t);\r\n\t\t\t\t\t$this->cart->update($data);\r\n\t\t\t\t\t$response = 1;\r\n\t\t\t\t}\r\n\t\t\t}\t\n\t\t}\n\t\t\n\t\techo $response;\n\t}",
"function mergeSessionWithCartDatabase()\n\t{\n\t\n\n\t\tif(isset($_SESSION['mycart']))\n\t\t{\n\t\t\n\t\t\t$product_array=$_SESSION['mycart'];\n\t\t\t$default=new Core_CAddCart();\n\t\t\t$cartid=$default->getCartIdOfUser();\n\t\t\tif ($cartid==0 || $cartid=='')\n\t\t\t{\n\t\t\t\t$sql =\"insert into shopping_cart_table (user_id , cart_date) values ('\". $_SESSION['user_id'].\"','\".date('Y-m-d').\"')\";\n\t\t\t\t$query = new Bin_Query();\n\t\t\t\t$query->updateQuery($sql);\n\t\t\t}\n\t\t\t$cartid=$default->getCartIdOfUser();\n\t\t\t\n\t\t\t$cartchecksql=\"SELECT product_id FROM shopping_cart_products_table WHERE cart_id =\".$cartid;\n\t\t\t$cartchechqry=new Bin_Query();\n\t\t\tif ($cartchechqry->executeQuery($cartchecksql))\n\t\t\t{\n\t\t\t\tforeach ($cartchechqry->records as $records)\n\t\t\t\t\t$cartproducts[]=$records['product_id'];\n\t\t\t}\n\t\t\telse\n\t\t\t\t$cartproducts=array();\n\t\t\n\t\t\tforeach ($_SESSION['mycart'] as $key=>$val)\n\t\t\t{\t\t\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t$sql='select soh from product_inventory_table where product_id='.$val['product_id'];\n\t\t\t\t$query = new Bin_Query();\n\t\n\t\t\t\t$query->executeQuery($sql);\t\t\n\t\t\t\t$soh=$query->records[0]['soh'];\n\t\t\t\t\n\t\t\t\tif($val['qty']<=$soh)\n\t\t\t\t{\n\t\t\t\t\t\n\t\t\t\t\t$sql_shipping='select shipping_cost from products_table where product_id='.$val['product_id'];\n\t\t\t\t\t$query_shipping = new Bin_Query();\n\t\t\n\t\t\t\t\t$query_shipping->executeQuery($sql_shipping);\t\t\n\t\t\t\t\t$shipmentcost=$query_shipping->records[0]['shipping_cost'];\n\t\t\t\t\t$shippingcost=$val['qty'][$i]*$shipmentcost;\n\t\t\t\t\t$date=date('Y-m-d');\n\t\t\t\t\t$default_cls=new Core_CAddCart();\n\t\t\t\t\t$msrp=$default_cls->getMsrpByQuantity($val['product_id'],$val['qty']);\n\t\t\t\t\t\n\t\t\t\t\tif ($msrp=='' || $msrp==0) \n\t\t\t\t\t{\n\t\t\t\t\t\t$msrp_sql=\"SELECT msrp FROM products_table WHERE product_id=\".$val['product_id'];\n\t\t\t\t\t\t$msrp_query=new Bin_Query();\n\t\t\t\t\t\t$msrp_query->executeQuery($msrp_sql);\n\t\t\t\t\t\t$msrp=$msrp_query->records[0][msrp];\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$defobjj=new Core_CAddCart();\n\t\t\t\t\t$groupdiscount=$defobjj->getUserGroupDiscount();\n\t\t\t\t\t$msrp=$msrp-($msrp*($groupdiscount/100));\n\n\t\t\t\t\tif(in_array($val['product_id'],$cartproducts))\n\t\t\t\t\t{\n\t\t\t\t\t\t$sql = \"UPDATE shopping_cart_products_table SET product_qty=\".$val['qty'].\",product_unit_price=\".$msrp.\" where product_id=\".$val['product_id'].\" and cart_id=\".$cartid;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$sql = \"INSERT INTO shopping_cart_products_table (cart_id,product_id,product_qty,date_added,product_unit_price,shipping_cost) VALUES (\".$cartid.\",\".$val['product_id'].\",\".$val['qty'].\",'\".$date.\"',\".$msrp.\",\".$shippingcost.\")\";\n\t\t\t\t\t}\n\t\t\t\t\t$query = new Bin_Query();\n\t\t\t\n\t\t\t\t\t$query->executeQuery($sql);\n\t\t\t\t}\n\t\t\t}\n\t\t\t$_SESSION['mycart']='';\n\t\t\tunset($_SESSION['mycart']);\n\t\t}\n\t\n\t}",
"private function putInSession()\n {\n if ($this->cart && $this->cart->exists) {\n session([$this->sessionKey => $this->cart->getKey()]);\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get image resample quality | public function getImageResampleQuality()
{
return $this->imageResampleQuality;
} | [
"private function getConfigImageQuality()\n {\n return Hash::get($this->settings, 'image.quality', 100);\n }",
"function get_resize_quality(){\n\t\t$quality = get_option('rbu_resize_quality');\n\t\t\n\t\t//return quality or default setting \n\t\tif ($quality > 0 && $quality < 101){\n\t\t\treturn $quality;\n\t\t}else{\n\t\t\treturn 80;\n\t\t}\n\t}",
"public function jpeg_quality( $q ) {\n return $q;\n }",
"function get_resize_quality(){\n $quality = get_option('cmk_resize_quality');\n \n //return quality or default setting \n if ($quality > 0 && $quality < 101){\n return $quality;\n }else{\n return 80;\n }\n }",
"public function getPhotoQuality()\n\t{\n\t\treturn $this->photo_quality;\n\t}",
"public function getSaveQualityImage() : int\n {\n return $this->saveQualityImage;\n }",
"public function getBetterQuality()\n {\n $quality = 0;\n $better = 0;\n\n foreach ($this->image as $index => $image) {\n $q = $image->getImageDepth() + ($image->getImageWidth() * $image->getImageHeight());\n\n if ($q > $quality) {\n $quality = $q;\n $better = $index;\n }\n }\n\n $this->image->setIteratorIndex($better);\n\n $better = new Image(new ImagickLib($this->image));\n $better->format('png');\n\n return $better;\n }",
"public function getQualityJpg()\n {\n $quality = (int)$this->getQuality();\n if ($quality < 0 || $quality > 100) {\n $quality = 100;\n }\n return $quality;\n }",
"public function getQuality()\n {\n return $this->quality;\n }",
"public function getQuality()\n\t{\n\t\treturn $this->quality;\n\t}",
"public function getQuality() {\n return $this->quality;\n }",
"public function getCompressionQuality () {}",
"public function getQualityPng()\n {\n //convert 0-100 to 0-10\n $compression = (int)floor((100 - (int)$this->getQualityJpg()) / 10);\n //convert 0-10 to 0-9\n if ($compression == 10) {\n $compression = 9;\n }\n return $compression;\n }",
"public function quality() {\n\t\t$megapixel = $this->megapixel();\n\n\t\t/* Normalized between 1 and 5 where min = 0.5 and max = 10 */\n\t\t$megapixelMax = 10;\n\t\t$megapixelMin = 0.5;\n\t\t$qualityMax = 5;\n\t\t$qualityMin = 1;\n\n\t\tif ($megapixel > $megapixelMax) {\n\t\t\t$quality = $qualityMax;\n\t\t} elseif ($megapixel < $megapixelMin) {\n\t\t\t$quality = $qualityMin;\n\t\t} else {\n\t\t\t$quality =\n\t\t\t\t(($megapixel - $megapixelMin) / ($megapixelMax - $megapixelMin))\n\t\t\t\t* ($qualityMax - $qualityMin)\n\t\t\t\t+ $qualityMin;\n\t\t}\n\t\treturn (integer) round($quality);\n\t}",
"public function getQuality()\n {\n return $this->Quality;\n }",
"function get_preview_quality($size)\n {\n global $imagemagick_quality,$preview_quality_unique;\n $preview_quality=$imagemagick_quality; // default\n if($preview_quality_unique)\n {\n debug(\"convert: select quality value from preview_size where id='$size'\");\n $quality_val=sql_value(\"select quality value from preview_size where id='{$size}'\",'');\n if($quality_val!='')\n {\n $preview_quality=$quality_val;\n }\n }\n debug(\"convert: preview quality for $size=$preview_quality\");\n return $preview_quality;\n }",
"public function getCompressionQuality() {\n\t}",
"public function setImageCompressionQuality ($quality) {}",
"public function setOptimizedImageQuality($quality);"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Processes and returns encoded image as HEIC string | protected function processHeic()
{
throw new NotSupportedException(
"HEIC format is not supported by Gd Driver."
);
} | [
"protected function processHeic()\n {\n if ( ! \\Imagick::queryFormats('HEIC')) {\n throw new NotSupportedException(\n \"HEIC format is not supported by Imagick installation.\"\n );\n }\n\n $format = 'heic';\n $compression = \\Imagick::COMPRESSION_UNDEFINED;\n\n $imagick = $this->image->getCore();\n $imagick->setFormat($format);\n $imagick->setImageFormat($format);\n $imagick->setCompression($compression);\n $imagick->setImageCompression($compression);\n $imagick->setCompressionQuality($this->quality);\n $imagick->setImageCompressionQuality($this->quality);\n\n return $imagick->getImagesBlob();\n }",
"public function imageToASCII($image){\n $image = 'image.jpg'; \n // Supports http if allow_url_fopen is enabled \n $image = file_get_contents($image); \n $img = imagecreatefromstring($image); \n\n $width = imagesx($img); \n $height = imagesy($img); \n\n for($h=0;$h<$height;$h++){ \n for($w=0;$w<=$width;$w++){ \n $rgb = imagecolorat($img, $w, $h); \n $a = ($rgb >> 24) & 0xFF; \n $r = ($rgb >> 16) & 0xFF; \n $g = ($rgb >> 8) & 0xFF; \n $b = $rgb & 0xFF; \n $a = abs(($a / 127) - 1); \n if($w == $width){ \n echo '<br>'; \n }else{ \n echo '<span style=\"color:rgba('.$r.','.$g.','.$b.','.$a.');\">#</span>'; \n } \n } \n } \n }",
"protected function processHeic()\n {\n return $this->encoder->processHeic();\n }",
"function asciiart($filename) {\n $result = '';\n list($width, $height) = getimagesize($filename);\n $image = imagecreatefrompng($filename);\n // $image = imagecreatefromjpeg($filename);\n\n // Reads the origonal colors pixel by pixel\n // y compensates a little because ascii is not square.\n for ($y=0;$y < $height;$y+=3) {\n for ($x=0;$x < $width;$x+=2) {\n $result .= findchar($x,$y,$image);\n }\n $result .= \"\\n\";\n } \n\n return $result;\n}",
"protected function processIco()\n {\n $format = 'ico';\n $compression = \\Imagick::COMPRESSION_UNDEFINED;\n\n $imagick = $this->image->getCore();\n $imagick->setFormat($format);\n $imagick->setImageFormat($format);\n $imagick->setCompression($compression);\n $imagick->setImageCompression($compression);\n\n $this->image->mime = image_type_to_mime_type(IMAGETYPE_ICO);\n\n return $imagick->getImagesBlob();\n }",
"public function enhanceImage () {}",
"public function getImageAvgHex($image): string;",
"function convert() {\n $fetcher = new Fetcher($this->path);\n $mime = $fetcher->getMimeType();\n //if image is of type svg, we don't want to base64 it because it will often not work and it is larger\n if (strpos($mime, 'svg') !== false) {\n $content = explode(PHP_EOL, $fetcher->getFileData());\n $output = array();\n\n foreach($content as $line) {\n //we dont want to keep <?xml and <!DOCTYPE values from SVG\n if (strpos($line, '<?') === false && strpos($line, '<!') === false) {\n $output[] = str_replace('\"', '\\'', $line);\n }\n }\n\n return 'data:'.$mime.';utf-8,'.implode('', $output);\n }\n\n return 'data:'.$mime.';base64,'.base64_encode($fetcher->getFileData());\n }",
"public function getChallengeImage()\n {\n $output = $this->getRequest('identification/bankid/mobile/image');\n\n return (string)$output;\n }",
"public function getImageAsString(): string\n\t{\n\t\tob_start();\n\t\t$this->show(true);\n\t\t$data = ob_get_contents();\n\t\tob_end_clean();\n\n\t\treturn $data;\n\t}",
"protected function processImage() {}",
"function getImgIPTCHeader( $IPTCTagValues) {\n $imgIPTCHeader = '';\n \n if ( is_array( $IPTCTagValues) && !empty( $IPTCTagValues)) {\n\n // Convert special characters in values to HTML entities\n foreach ( $IPTCTagValues as $key => $value) {\n $IPTCTagValues[$key] = htmlspecialchars( $value, ENT_QUOTES);\n }\n \n // Create IPTC header from recieved info\n $imgIPTCHeader = '8BIM#1028=\"IPTC\"'.\"\\n\";\n $imgIPTCHeader .= '2#5#Image Name=\"'.$IPTCTagValues['object_name'].'\"'.\"\\n\";\n $imgIPTCHeader .= '2#7#Edit Status=\"'.$IPTCTagValues['edit_status'].'\"'.\"\\n\";\n $imgIPTCHeader .= '2#10#Priority=\"'.$IPTCTagValues['priority'].'\"'.\"\\n\";\n $imgIPTCHeader .= '2#15#Category=\"'.$IPTCTagValues['category'].'\"'.\"\\n\";\n $imgIPTCHeader .= '2#20#Supplemental Category=\"'.$IPTCTagValues['supplementary_category'].'\"'.\"\\n\";\n $imgIPTCHeader .= '2#22#Fixture Identifier=\"'.$IPTCTagValues['fixture_identifier'].'\"'.\"\\n\";\n $imgIPTCHeader .= '2#25#Keyword=\"'.$IPTCTagValues['keywords'].'\"'.\"\\n\";\n $imgIPTCHeader .= '2#30#Release Date=\"'.$IPTCTagValues['release_date'].'\"'.\"\\n\";\n $imgIPTCHeader .= '2#35#Release Time=\"'.$IPTCTagValues['release_time'].'\"'.\"\\n\";\n $imgIPTCHeader .= '2#40#Special Instructions=\"'.$IPTCTagValues['special_instructions'].'\"'.\"\\n\";\n $imgIPTCHeader .= '2#45#Reference Service=\"'.$IPTCTagValues['reference_service'].'\"'.\"\\n\";\n $imgIPTCHeader .= '2#47#Reference Date=\"'.$IPTCTagValues['reference_date'].'\"'.\"\\n\";\n $imgIPTCHeader .= '2#50#Reference Number=\"'.$IPTCTagValues['reference_number'].'\"'.\"\\n\";\n $imgIPTCHeader .= '2#55#Created Date=\"'.$IPTCTagValues['created_date'].'\"'.\"\\n\";\n $imgIPTCHeader .= '2#64=\"'.$IPTCTagValues['originating_program'].'\"'.\"\\n\";\n $imgIPTCHeader .= '2#70#Program Version=\"'.$IPTCTagValues['program_version'].'\"'.\"\\n\";\n $imgIPTCHeader .= '2#75#Object Cycle=\"'.$IPTCTagValues['object_cycle'].'\"'.\"\\n\";\n $imgIPTCHeader .= '2#80#Byline=\"'.$IPTCTagValues['byline'].'\"\\n';\n $imgIPTCHeader .= '2#85#Byline Title=\"'.$IPTCTagValues['byline_title'].'\"'.\"\\n\";\n $imgIPTCHeader .= '2#90#City=\"'.$IPTCTagValues['city'].'\"'.\"\\n\";\n $imgIPTCHeader .= '2#95#Province State=\"'.$IPTCTagValues['province_state'].'\"'.\"\\n\";\n $imgIPTCHeader .= '2#100#Country Code=\"'.$IPTCTagValues['country_code'].'\"'.\"\\n\";\n $imgIPTCHeader .= '2#101#Country=\"'.$IPTCTagValues['country'].'\"'.\"\\n\";\n $imgIPTCHeader .= '2#103#Original Transmission Reference=\"'.$IPTCTagValues['original_transmission_reference'].'\"'.\"\\n\";\n $imgIPTCHeader .= '2#105#Headline=\"'.$IPTCTagValues['headline'].'\"'.\"\\n\";\n $imgIPTCHeader .= '2#110#Credit=\"'.$IPTCTagValues['credit'].'\"'.\"\\n\";\n $imgIPTCHeader .= '2#115#Source=\"'.$IPTCTagValues['source'].'\"'.\"\\n\";\n $imgIPTCHeader .= '2#116#Copyright String=\"'.$IPTCTagValues['copyright_string'].'\"'.\"\\n\";\n $imgIPTCHeader .= '2#120#Caption=\"'.$IPTCTagValues['caption'].'\"'.\"\\n\";\n $imgIPTCHeader .= '2#121#Image Orientation=\"'.$IPTCTagValues['local_caption'].'\"'.\"\\n\";\n }\n \n return $imgIPTCHeader;\n }",
"public function convertImage()\n {\n // section 10-5-1-60-5ce3491f:15700383283:-8000:0000000000000BA5 begin\n // section 10-5-1-60-5ce3491f:15700383283:-8000:0000000000000BA5 end\n }",
"public function getBlob(): string\n {\n ob_start();\n imagejpeg($this->_image);\n $result = ob_get_contents();\n ob_end_clean();\n\n return $result;\n }",
"private function get_type_img()\n {\n $this->multi_byte_string_to_array();\n foreach($this->strings as $char)\n {\n $this->init_img();\n $this->create_img($char);\n }\n }",
"function GetImageContents() {\nif (strlen($this->InternalImage) == 0) {\n$this->ProcessImage();\n}\n//return the contents of the variable.\nreturn $this->InternalImage;\n}",
"abstract protected function processJpeg();",
"function img_encode($path) {\n $type = pathinfo($path, PATHINFO_EXTENSION);\n $data = file_get_contents($path);\n return \"data:image/{$type};base64,\" . base64_encode($data);\n }",
"protected function renderImageImagick($code)\n\t{\n\t\t$backColor=$this->transparent ? new ImagickPixel('transparent') : new ImagickPixel(sprintf('#%06x',$this->backColor));\n\t\t$foreColor=new ImagickPixel(sprintf('#%06x',$this->foreColor));\n\n\t\t$image=new Imagick();\n\t\t$image->newImage($this->width,$this->height,$backColor);\n\n\t\tif($this->fontFile===null)\n\t\t\t$this->fontFile=dirname(__FILE__).DIRECTORY_SEPARATOR.'SpicyRice.ttf';\n\n\t\t$draw=new ImagickDraw();\n\t\t$draw->setFont($this->fontFile);\n\t\t$draw->setFontSize(30);\n\t\t$fontMetrics=$image->queryFontMetrics($draw,$code);\n\n\t\t$length=strlen($code);\n\t\t$w=(int)($fontMetrics['textWidth'])-8+$this->offset*($length-1);\n\t\t$h=(int)($fontMetrics['textHeight'])-8;\n\t\t$scale=min(($this->width-$this->padding*2)/$w,($this->height-$this->padding*2)/$h);\n\t\t$x=10;\n\t\t$y=round($this->height*27/40);\n\t\tfor($i=0; $i<$length; ++$i)\n\t\t{\n\t\t\t$draw=new ImagickDraw();\n\t\t\t$draw->setFont($this->fontFile);\n\t\t\t$draw->setFontSize((int)(rand(26,32)*$scale*0.8));\n\t\t\t$draw->setFillColor($foreColor);\n\t\t\t$image->annotateImage($draw,$x,$y,rand(-10,10),$code[$i]);\n\t\t\t$fontMetrics=$image->queryFontMetrics($draw,$code[$i]);\n\t\t\t$x+=(int)($fontMetrics['textWidth'])+$this->offset;\n\t\t}\n\n\t\theader('Pragma: public');\n\t\theader('Expires: 0');\n\t\theader('Cache-Control: must-revalidate, post-check=0, pre-check=0');\n\t\theader('Content-Transfer-Encoding: binary');\n\t\theader(\"Content-Type: image/png\");\n\t\t$image->setImageFormat('png');\n\t\techo $image->getImageBlob();\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ Add Vendor manager | function __addVmanager($vmgr) {
$this->loadModel('VendorManagers');
$manager = $this->VendorManagers->newEntity($vmgr);
if($this->VendorManagers->save($manager)) {
return true;
}
return false;
} | [
"private function addVendors() {\n\t\n\t\t$database = new Database();\n\n\t\tforeach($this->aryData as $record) {\n\t\t\t\t\t\n\t\t\t$database->query(\n\t\t\t\t'INSERT IGNORE INTO vendors (`code`) VALUES (:code)'\n\t\t\t);\n\t\t\t\t\n\t\t\t$database->bind(':code', $record{'Vendor'});\n\n\t\t\t$database->execute();\n\t\t}\n\t\techo \"<p>Vendors added for store.</p>\";\n\t}",
"function lVendor() {\n\tif ($this->_userDetails->user_is_vendor) {\n\n\t $currencymodel = VmModel::getModel('currency', 'VirtuemartModel');\n\t $currencies = $currencymodel->getCurrencies();\n\t $this->assignRef('currencies', $currencies);\n\n\t if (!$this->_orderList) {\n\t\t\t$this->lOrderlist();\n\t }\n\n\t $vendorModel = VmModel::getModel('vendor');\n\n\t if (Vmconfig::get('multix', 'none') === 'none') {\n\t\t$vendorModel->setId(1);\n\t } else {\n\t\t$vendorModel->setId($this->_userDetails->virtuemart_vendor_id);\n\t }\n\t $vendor = $vendorModel->getVendor();\n\t $vendorModel->addImages($vendor);\n\t $this->assignRef('vendor', $vendor);\n\t}\n }",
"public function addVendor(Vendor $vendor): void\n {\n $this->vendors[] = $vendor;\n }",
"public function setVendor(): void;",
"public function add() {\n $this->load->view('add_vendor');\n }",
"function addVendor( $orderItem )\r\n { \r\n // if this product is from a vendor other than store owner, track it\r\n if (!empty($orderItem->vendor_id) && empty($this->_vendors[$orderItem->vendor_id]))\r\n {\r\n $orderVendor = JTable::getInstance('OrderVendors', 'TiendaTable');\r\n $orderVendor->vendor_id = $orderItem->vendor_id;\r\n $this->_vendors[$orderItem->vendor_id] = $orderVendor;\r\n }\r\n \r\n if (!empty($this->_vendors[$orderItem->vendor_id]))\r\n {\r\n // TODO update the order vendor's totals?\r\n // or just wait until the calculateTotals() method is executed?\r\n }\r\n }",
"public function testAddVendor()\n {\n }",
"public function testCreateVendor()\n {\n }",
"protected function _pushVendors()\n\t{\n\t\t$this->log(\"\\t* Pushing Customer Groups/Vendors from Flex to the Sales Portal...\");\n\n\t\t$dsSalesPortal\t= Data_Source::get('sales');\n\t\t$dacFlex\t\t= DataAccess::getDataAccess();\n\n\t\t// Start a transaction for the Sales Portal\n\t\t$dsSalesPortal->beginTransaction();\n\n\t\ttry\n\t\t{\n\t\t\t$this->log(\"\\t\\t* Retrieving list of Flex Customer Groups...\");\n\n\t\t\t// Get list of Customer Groups from Flex\n\t\t\t$arrCustomerGroups\t= Customer_Group::getAll();\n\t\t\tforeach ($arrCustomerGroups as $objCustomerGroup)\n\t\t\t{\n\t\t\t\t$this->log(\"\\t\\t\\t+ Id #{$objCustomerGroup->id} ({$objCustomerGroup->internalName})...\");\n\n\t\t\t\t$strCoolingOffPeriod = ($objCustomerGroup->coolingOffPeriod !== NULL)? $objCustomerGroup->coolingOffPeriod : \"NULL\";\n\n\t\t\t\t// Does this Customer Group exist in the Sales Portal?\n\t\t\t\t$resVendors\t= $dsSalesPortal->query(\"SELECT id FROM vendor WHERE id = {$objCustomerGroup->id}\", Array('integer'));\n\t\t\t\tif (MDB2::isError($resVendors))\n\t\t\t\t{\n\t\t\t\t\tthrow new Exception($resVendors->getMessage().\" :: \".$resVendors->getUserInfo());\n\t\t\t\t}\n\t\t\t\telseif (!($arrVendor = $resVendors->fetchRow(MDB2_FETCHMODE_ASSOC)))\n\t\t\t\t{\n\t\t\t\t\t$this->log(\"\\t\\t\\t+ Does not exist, adding...\");\n\n\t\t\t\t\t// No -- add it\n\t\t\t\t\t$resVendorInsert\t= $dsSalesPortal->query(\"INSERT INTO vendor (id, name, description, cooling_off_period) VALUES ({$objCustomerGroup->id}, '{$objCustomerGroup->internalName}', '{$objCustomerGroup->externalName}', $strCoolingOffPeriod);\");\n\t\t\t\t\tif (MDB2::isError($resVendorInsert))\n\t\t\t\t\t{\n\t\t\t\t\t\tthrow new Exception($resVendorInsert->getMessage().\" :: \".$resVendorInsert->getUserInfo());\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$this->log(\"\\t\\t\\t+ Already exists, updating...\");\n\n\t\t\t\t\t// Yes -- update it\n\t\t\t\t\t$resVendorUpdate\t= $dsSalesPortal->query(\"UPDATE vendor SET id = {$objCustomerGroup->id}, name = '{$objCustomerGroup->internalName}', description = '{$objCustomerGroup->externalName}', cooling_off_period = $strCoolingOffPeriod WHERE id = {$objCustomerGroup->id};\");\n\t\t\t\t\tif (MDB2::isError($resVendorUpdate))\n\t\t\t\t\t{\n\t\t\t\t\t\tthrow new Exception($resVendorUpdate->getMessage().\" :: \".$resVendorUpdate->getUserInfo());\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// All seems to have worked fine -- Commit the Transaction\n\t\t\t$dsSalesPortal->commit();\n\t\t}\n\t\tcatch (Exception $eException)\n\t\t{\n\t\t\t// Rollback the Transaction & passthru the Exception\n\t\t\t$dsSalesPortal->rollback();\n\t\t\tthrow $eException;\n\t\t}\n\t}",
"public function add(ManagerInterface $manager);",
"protected function initVendorSpecificInfo(){}",
"public function UpdateVendors()\n\t{\n\t\t$data = array();\n\t\t$query = \"\n\t\t\tSELECT vendorid, vendorname, vendorfriendlyname, vendorshipping\n\t\t\tFROM [|PREFIX|]vendors\n\t\t\";\n\t\t$result = $GLOBALS['ISC_CLASS_DB']->Query($query);\n\t\twhile($vendor = $GLOBALS['ISC_CLASS_DB']->Fetch($result)) {\n\t\t\t$data[$vendor['vendorid']] = $vendor;\n\t\t}\n\n\t\treturn $this->Save('Vendors', $data);\n\t}",
"public function actionCreate() {\n $model = new Vendor();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n\n // cek session dari halaman yg mana transaksi-masuk edit\n if (Url::previous('tm-edit')) {\n $var = Url::previous('tm-edit');\n Yii::$app->session->remove('tm-edit');\n Yii::$app->getSession()->setFlash(\n 'success', 'Berhasil menambahkan Vendor : <b>' . $model->nama\n );\n return $this->redirect($var);\n } else if (Url::previous('tm-create')) {\n $var = Url::previous('tm-create');\n Yii::$app->session->remove('tm-create');\n Yii::$app->getSession()->setFlash(\n 'success', 'Berhasil menambahkan Vendor : <b>' . $model->nama\n );\n return $this->redirect($var);\n }\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }",
"public function addVendorExtra($resultArray){\n if(! $this->db->insert(\"vendor_additional_details\",$resultArray)){\n return 0;\n }\n else {\n return 1;\n }\n }",
"private function createVendorsModel(array $vendors): void\n {\n foreach ($vendors as $vendor) {\n $vendorDetails = $this->splitIntoVendorsAndFoodItems($vendor);\n $oVendor = new Vendor(...$this->splitVendor($vendorDetails[0]));\n foreach (array_slice($vendorDetails, 1) as $foodItem) {\n $foodItemFormatted = $this->splitFoodItem($foodItem);\n $oFoodItem = new FoodItem(...$foodItemFormatted);\n $oVendor->addFoodItem($oFoodItem);\n }\n $this->mVendors->addVendor($oVendor);\n }\n }",
"public function addDevice(){\n }",
"public function add_variation_vendor_bulk_edit() {\n\t\tif ( ! WC_Product_Vendors_Utils::is_vendor() && current_user_can( 'manage_vendors' ) ) {\n\t?>\n\t\t\t<optgroup label=\"<?php esc_attr_e( 'Vendor', 'woocommerce-product-vendors' ); ?>\">\n\t\t\t\t<option value=\"variable_vendor_commission\"><?php esc_html_e( 'Commission', 'woocommerce-product-vendors' ); ?></option>\n\t\t\t\t<option value=\"variable_pass_shipping_tax\"><?php esc_html_e( 'Toggle Pass shipping/tax', 'woocommerce-product-vendors' ); ?></option>\n\t\t\t</optgroup>\n\t<?php\n\t\t}\n\t}",
"public function createAction()\n {\n if (!$this->request->isPost()) {\n $this->dispatcher->forward([\n 'controller' => \"vendor\",\n 'action' => 'index'\n ]);\n\n return;\n }\n\n $vendor = new Vendor();\n $vendor->Listid = $this->request->getPost(\"ListID\");\n $vendor->Timecreated = $this->request->getPost(\"TimeCreated\");\n $vendor->Timemodified = $this->request->getPost(\"TimeModified\");\n $vendor->Editsequence = $this->request->getPost(\"EditSequence\");\n $vendor->Name = $this->request->getPost(\"Name\");\n $vendor->Isactive = $this->request->getPost(\"IsActive\");\n $vendor->Classref_listid = $this->request->getPost(\"ClassRef_ListID\");\n $vendor->Classref_fullname = $this->request->getPost(\"ClassRef_FullName\");\n $vendor->Companyname = $this->request->getPost(\"CompanyName\");\n $vendor->Salutation = $this->request->getPost(\"Salutation\");\n $vendor->Firstname = $this->request->getPost(\"FirstName\");\n $vendor->Middlename = $this->request->getPost(\"MiddleName\");\n $vendor->Lastname = $this->request->getPost(\"LastName\");\n $vendor->Jobtitle = $this->request->getPost(\"JobTitle\");\n $vendor->Suffix = $this->request->getPost(\"Suffix\");\n $vendor->Vendoraddress_addr1 = $this->request->getPost(\"VendorAddress_Addr1\");\n $vendor->Vendoraddress_addr2 = $this->request->getPost(\"VendorAddress_Addr2\");\n $vendor->Vendoraddress_addr3 = $this->request->getPost(\"VendorAddress_Addr3\");\n $vendor->Vendoraddress_addr4 = $this->request->getPost(\"VendorAddress_Addr4\");\n $vendor->Vendoraddress_addr5 = $this->request->getPost(\"VendorAddress_Addr5\");\n $vendor->Vendoraddress_city = $this->request->getPost(\"VendorAddress_City\");\n $vendor->Vendoraddress_state = $this->request->getPost(\"VendorAddress_State\");\n $vendor->Vendoraddress_postalcode = $this->request->getPost(\"VendorAddress_PostalCode\");\n $vendor->Vendoraddress_country = $this->request->getPost(\"VendorAddress_Country\");\n $vendor->Vendoraddress_note = $this->request->getPost(\"VendorAddress_Note\");\n $vendor->Shipaddress_addr1 = $this->request->getPost(\"ShipAddress_Addr1\");\n $vendor->Shipaddress_addr2 = $this->request->getPost(\"ShipAddress_Addr2\");\n $vendor->Shipaddress_addr3 = $this->request->getPost(\"ShipAddress_Addr3\");\n $vendor->Shipaddress_addr4 = $this->request->getPost(\"ShipAddress_Addr4\");\n $vendor->Shipaddress_addr5 = $this->request->getPost(\"ShipAddress_Addr5\");\n $vendor->Shipaddress_city = $this->request->getPost(\"ShipAddress_City\");\n $vendor->Shipaddress_state = $this->request->getPost(\"ShipAddress_State\");\n $vendor->Shipaddress_postalcode = $this->request->getPost(\"ShipAddress_PostalCode\");\n $vendor->Shipaddress_country = $this->request->getPost(\"ShipAddress_Country\");\n $vendor->Shipaddress_note = $this->request->getPost(\"ShipAddress_Note\");\n $vendor->Phone = $this->request->getPost(\"Phone\");\n $vendor->Mobile = $this->request->getPost(\"Mobile\");\n $vendor->Pager = $this->request->getPost(\"Pager\");\n $vendor->Altphone = $this->request->getPost(\"AltPhone\");\n $vendor->Fax = $this->request->getPost(\"Fax\");\n $vendor->Email = $this->request->getPost(\"Email\");\n $vendor->Cc = $this->request->getPost(\"Cc\");\n $vendor->Contact = $this->request->getPost(\"Contact\");\n $vendor->Altcontact = $this->request->getPost(\"AltContact\");\n $vendor->Nameoncheck = $this->request->getPost(\"NameOnCheck\");\n $vendor->Notes = $this->request->getPost(\"Notes\");\n $vendor->Accountnumber = $this->request->getPost(\"AccountNumber\");\n $vendor->Vendortyperef_listid = $this->request->getPost(\"VendorTypeRef_ListID\");\n $vendor->Vendortyperef_fullname = $this->request->getPost(\"VendorTypeRef_FullName\");\n $vendor->Termsref_listid = $this->request->getPost(\"TermsRef_ListID\");\n $vendor->Termsref_fullname = $this->request->getPost(\"TermsRef_FullName\");\n $vendor->Creditlimit = $this->request->getPost(\"CreditLimit\");\n $vendor->Vendortaxident = $this->request->getPost(\"VendorTaxIdent\");\n $vendor->Isvendoreligiblefor1099 = $this->request->getPost(\"IsVendorEligibleFor1099\");\n $vendor->Balance = $this->request->getPost(\"Balance\");\n $vendor->Currencyref_listid = $this->request->getPost(\"CurrencyRef_ListID\");\n $vendor->Currencyref_fullname = $this->request->getPost(\"CurrencyRef_FullName\");\n $vendor->Billingrateref_listid = $this->request->getPost(\"BillingRateRef_ListID\");\n $vendor->Billingrateref_fullname = $this->request->getPost(\"BillingRateRef_FullName\");\n $vendor->Salestaxcoderef_listid = $this->request->getPost(\"SalesTaxCodeRef_ListID\");\n $vendor->Salestaxcoderef_fullname = $this->request->getPost(\"SalesTaxCodeRef_FullName\");\n $vendor->Salestaxcountry = $this->request->getPost(\"SalesTaxCountry\");\n $vendor->Issalestaxagency = $this->request->getPost(\"IsSalesTaxAgency\");\n $vendor->Salestaxreturnref_listid = $this->request->getPost(\"SalesTaxReturnRef_ListID\");\n $vendor->Salestaxreturnref_fullname = $this->request->getPost(\"SalesTaxReturnRef_FullName\");\n $vendor->Taxregistrationnumber = $this->request->getPost(\"TaxRegistrationNumber\");\n $vendor->Reportingperiod = $this->request->getPost(\"ReportingPeriod\");\n $vendor->Istaxtrackedonpurchases = $this->request->getPost(\"IsTaxTrackedOnPurchases\");\n $vendor->Taxonpurchasesaccountref_listid = $this->request->getPost(\"TaxOnPurchasesAccountRef_ListID\");\n $vendor->Taxonpurchasesaccountref_fullname = $this->request->getPost(\"TaxOnPurchasesAccountRef_FullName\");\n $vendor->Istaxtrackedonsales = $this->request->getPost(\"IsTaxTrackedOnSales\");\n $vendor->Taxonsalesaccountref_listid = $this->request->getPost(\"TaxOnSalesAccountRef_ListID\");\n $vendor->Taxonsalesaccountref_fullname = $this->request->getPost(\"TaxOnSalesAccountRef_FullName\");\n $vendor->Istaxontax = $this->request->getPost(\"IsTaxOnTax\");\n $vendor->Prefillaccountref_listid = $this->request->getPost(\"PrefillAccountRef_ListID\");\n $vendor->Prefillaccountref_fullname = $this->request->getPost(\"PrefillAccountRef_FullName\");\n $vendor->Customfield1 = $this->request->getPost(\"CustomField1\");\n $vendor->Customfield2 = $this->request->getPost(\"CustomField2\");\n $vendor->Customfield3 = $this->request->getPost(\"CustomField3\");\n $vendor->Customfield4 = $this->request->getPost(\"CustomField4\");\n $vendor->Customfield5 = $this->request->getPost(\"CustomField5\");\n $vendor->Customfield6 = $this->request->getPost(\"CustomField6\");\n $vendor->Customfield7 = $this->request->getPost(\"CustomField7\");\n $vendor->Customfield8 = $this->request->getPost(\"CustomField8\");\n $vendor->Customfield9 = $this->request->getPost(\"CustomField9\");\n $vendor->Customfield10 = $this->request->getPost(\"CustomField10\");\n $vendor->Customfield11 = $this->request->getPost(\"CustomField11\");\n $vendor->Customfield12 = $this->request->getPost(\"CustomField12\");\n $vendor->Customfield13 = $this->request->getPost(\"CustomField13\");\n $vendor->Customfield14 = $this->request->getPost(\"CustomField14\");\n $vendor->Customfield15 = $this->request->getPost(\"CustomField15\");\n $vendor->Status = $this->request->getPost(\"Status\");\n \n\n if (!$vendor->save()) {\n foreach ($vendor->getMessages() as $message) {\n $this->flash->error($message);\n }\n\n $this->dispatcher->forward([\n 'controller' => \"vendor\",\n 'action' => 'new'\n ]);\n\n return;\n }\n\n $this->flash->success(\"vendor was created successfully\");\n\n $this->dispatcher->forward([\n 'controller' => \"vendor\",\n 'action' => 'index'\n ]);\n }",
"function suppliesnetwork_install($db)\n{\n global $vendor_product_fields;\n\n require_once 'catalogconfig-common.php';\n require_once '../admin/office-common.php';\n\n if (! add_catalog_fields($db,'products','specs',$vendor_product_fields))\n return;\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
get the tool tip text from the tab | function getToolTipText() {
return $this->_tooltiptext;
} | [
"function getTabTooltipText($a_tab_id)\n\t{\n\t\tglobal $lng;\n\t\t\n\t\tinclude_once(\"./Services/Help/classes/class.ilHelp.php\");\n\t\tif ($this->screen_id_component != \"\")\n\t\t{\n\t\t\treturn ilHelp::getTooltipPresentationText($this->screen_id_component.\"_\".$a_tab_id);\n\t\t\t//return $lng->txt(\"help_tt_\".$this->screen_id_component.\"_\".$a_tab_id);\n\t\t}\n\t\treturn \"\";\n\t}",
"public function getTabLabel();",
"public function getTabLabel()\n {\n return Mage::helper('easytemplate')->__('EasyTemplate');\n }",
"public function getTabTitle()\n {\n return Mage::helper('temando')->__('Rule Information');\n }",
"public function getTip() {\n return $this->get(self::TIP);\n }",
"public function getTabLabel()\n {\n return Mage::helper('lavi_news')->__('News Info');\n }",
"public function getQTip() {}",
"public function getTabLabel()\n {\n return __('Click and Reserve');\n }",
"public function getTabLabel()\n {\n return __(self::TAB_LABEL);\n }",
"public function getTabLabel()\n {\n return Mage::helper('magify_bannermanager')->__('Template');\n }",
"public function getTooltip()\n\t{\n\t\treturn $this->tooltip; \n\n\t}",
"public function getTabLabel()\n {\n return __('Slider Information');\n }",
"function activeTabLabel()\n {\n if (!$this->activeTab) return NULL;\n return $this->activeTab->label();\n }",
"public function getTooltip()\n {\n return $this->_tooltip;\n }",
"public function getTabLabel()\n {\n return __('Dynamic Block Properties');\n }",
"public function getTabTitle()\n {\n return __('Attributes mapping - TAB');\n }",
"public function getTooltip()\n {\n if (array_key_exists(\"tooltip\", $this->_propDict)) {\n return $this->_propDict[\"tooltip\"];\n } else {\n return null;\n }\n }",
"public function getTabTitle()\n {\n return __(self::REPRESENTATIVE_LABEL);\n }",
"function getTipView() {\n if ($this->tip) {\n return '<div class=\"darkfont\">' . $this->tip . '</div>';\n }\n else\n return '';\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets a doccomment for the current node. | public function setDocComment($docComment) {
$this->docComment = $docComment;
} | [
"public function setDocComment(Comment\\Doc $docComment);",
"private function _setDocComment( $docComment )\n {\n if ( trim( $docComment ) === '' )\n {\n $this->_docComment = false;\n }\n else\n {\n $this->_docComment = $docComment;\n }\n }",
"public function setDocComment(\\PHPParser_Node $node, $comment)\n {\n if (!$comment) {\n return $node;\n }\n\n $doc = $node->getDocComment();\n $comments = $node->getAttribute('comments');\n\n if ($doc) {\n unset($comments[ count($comments) - 1]);\n }\n\n $comments[] = new \\PHPParser_Comment_Doc($comment);\n $node->setAttribute('comments', array_values($comments));\n\n return $node;\n }",
"Public Function setComment($comment) { $this->comment = $comment; }",
"function setComment($comment = \"\")\n\t{\n\t\t$this->comment = $comment;\n\t}",
"function setComment( $value )\r\n {\r\n $this->Comment = $value;\r\n }",
"function setComment( $value )\r\n {\r\n $this->Comment = $value;\r\n }",
"public function setComment($comment);",
"public function setComment($comment) {\n $this->comment = $comment;\n }",
"public function setComment($comment)\n {\n $thisCVID = $this->getVersionID();\n $comment = ($comment != null) ? $comment : \"Version {$thisCVID}\";\n $v = array(\n $comment,\n $thisCVID,\n $this->cID,\n );\n $app = Facade::getFacadeApplication();\n $db = $app->make('database')->connection();\n $q = \"update CollectionVersions set cvComments = ? where cvID = ? and cID = ?\";\n $db->executeQuery($q, $v);\n $this->cvComments = $comment;\n }",
"public function setAppDocComment ($v)\n {\n // Since the native PHP type for this column is string,\n // we will cast the input to a string (if it is not).\n if ( $v !== null && !is_string ($v) )\n {\n $v = (string) $v;\n }\n\n if ( $this->app_doc_comment !== $v )\n {\n $this->app_doc_comment = $v;\n }\n }",
"public function setComment( $comment )\n {\n $this->properties[\"comment\"] = $comment;\n $this->properties[\"commentLength\"] = strlen( $comment );\n }",
"protected function setDocBlock (string $docblock): void {\n if (strlen($docblock = trim($docblock))) {\n // strip leading * if it doesn't start on the initial line.\n $docblock = preg_replace('/^\\*\\h*/', '', $docblock);\n // straighten up to 2 spaces of indentation\n $docblock = preg_replace('/^\\h*\\*\\h{0,2}/m', ' * ', $docblock);\n $docblock = \"/**\\n * {$docblock}\\n */\";\n $this->docblock = $docblock;\n }\n }",
"public static function setComment($index_or_filename, $comment = null)\n {\n self::instance()->setComment($index_or_filename, $comment);\n }",
"function _set_comment() {\n if (!$this->arg('id')) $this->_error('No data collection id specified');\n if (!$this->arg('value')) $this->_error('No comment specified');\n \n $com = $this->db->pq('SELECT comments from ispyb4a_db.datacollection WHERE datacollectionid=:1', array($this->arg('id')));\n \n if (!sizeof($com)) $this->_error('No such data collection');\n \n $this->db->pq(\"UPDATE ispyb4a_db.datacollection set comments=:1 where datacollectionid=:2\", array($this->arg('value'), $this->arg('id')));\n \n print $this->arg('value');\n }",
"public function getDocComment()\n {\n return $this->docComment;\n }",
"public function setCommentText($value)\n {\n $this->commentText=$value;\n }",
"private function comments(): void\n {\n if ($this->operation->getSummary() == null && !empty($this->doc->getSummary())) {\n $this->operation->setSummary($this->doc->getSummary());\n }\n if ($this->operation->getDescription() == null && !empty($this->doc->getDescription()->render())) {\n $this->operation->setDescription($this->doc->getDescription()->render());\n }\n\n if ($this->doc->hasTag('deprecated')) {\n $this->operation->setDeprecated(true);\n }\n\n $this->addExternalDocumentation();\n }",
"public function setDocBlock($docBlock)\n {\n $this->docBlock = $docBlock;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Test that only the servers a logged in user is assigned to are returned by the API endpoint. Obviously there are cases such as being an administrator or being a subuser, but for this test we just want to test a basic scenario and pretend subusers do not exist at all. | public function testOnlyLoggedInUsersServersAreReturned()
{
/** @var \Pterodactyl\Models\User[] $users */
$users = factory(User::class)->times(3)->create();
/** @var \Pterodactyl\Models\Server[] $servers */
$servers = [
$this->createServerModel(['user_id' => $users[0]->id]),
$this->createServerModel(['user_id' => $users[1]->id]),
$this->createServerModel(['user_id' => $users[2]->id]),
];
$response = $this->actingAs($users[0])->getJson('/api/client');
$response->assertOk();
$response->assertJsonPath('object', 'list');
$response->assertJsonPath('data.0.object', Server::RESOURCE_NAME);
$response->assertJsonPath('data.0.attributes.identifier', $servers[0]->uuidShort);
$response->assertJsonPath('data.0.attributes.server_owner', true);
$response->assertJsonPath('meta.pagination.total', 1);
$response->assertJsonPath('meta.pagination.per_page', 50);
} | [
"function test_an_authenticated_user_can_see_only_own_servers()\n {\n $user = $this->signInAPI();\n $servers = $this->createServer([\n 'user_id' => $user->id,\n ], 2);\n\n $serversForeign = $this->createServer([], 2);\n\n $response = $this->getJson(api_route('servers'));\n $response->assertOk();\n\n $response->assertJson([\n 'data' => $servers->only('id')->toArray(),\n ]);\n\n $response->assertJsonMissing([\n 'data' => $serversForeign->only('id')->toArray(),\n ]);\n }",
"public function testOnlyAdminLevelServersAreReturned()\n {\n /** @var \\Pterodactyl\\Models\\User[] $users */\n $users = factory(User::class)->times(4)->create();\n $users[0]->update(['root_admin' => true]);\n\n $servers = [\n $this->createServerModel(['user_id' => $users[0]->id]),\n $this->createServerModel(['user_id' => $users[1]->id]),\n $this->createServerModel(['user_id' => $users[2]->id]),\n $this->createServerModel(['user_id' => $users[3]->id]),\n ];\n\n Subuser::query()->create([\n 'user_id' => $users[0]->id,\n 'server_id' => $servers[1]->id,\n 'permissions' => [Permission::ACTION_WEBSOCKET_CONNECT],\n ]);\n\n // Only servers 2 & 3 (0 indexed) should be returned by the API at this point. The user making\n // the request is the owner of server 0, and a subuser of server 1 so they should be exluded.\n $response = $this->actingAs($users[0])->getJson('/api/client?type=admin');\n\n $response->assertOk();\n $response->assertJsonCount(2, 'data');\n\n $response->assertJsonPath('data.0.attributes.server_owner', false);\n $response->assertJsonPath('data.0.attributes.identifier', $servers[2]->uuidShort);\n $response->assertJsonPath('data.1.attributes.server_owner', false);\n $response->assertJsonPath('data.1.attributes.identifier', $servers[3]->uuidShort);\n }",
"public function testOnlyAdminLevelServersAreReturned()\n {\n /** @var \\Pterodactyl\\Models\\User[] $users */\n $users = User::factory()->times(4)->create();\n $users[0]->update(['root_admin' => true]);\n\n $servers = [\n $this->createServerModel(['user_id' => $users[0]->id]),\n $this->createServerModel(['user_id' => $users[1]->id]),\n $this->createServerModel(['user_id' => $users[2]->id]),\n $this->createServerModel(['user_id' => $users[3]->id]),\n ];\n\n Subuser::query()->create([\n 'user_id' => $users[0]->id,\n 'server_id' => $servers[1]->id,\n 'permissions' => [Permission::ACTION_WEBSOCKET_CONNECT],\n ]);\n\n // Only servers 2 & 3 (0 indexed) should be returned by the API at this point. The user making\n // the request is the owner of server 0, and a subuser of server 1 so they should be exluded.\n $response = $this->actingAs($users[0])->getJson('/api/client?type=admin');\n\n $response->assertOk();\n $response->assertJsonCount(2, 'data');\n\n $response->assertJsonPath('data.0.attributes.server_owner', false);\n $response->assertJsonPath('data.0.attributes.identifier', $servers[2]->uuidShort);\n $response->assertJsonPath('data.1.attributes.server_owner', false);\n $response->assertJsonPath('data.1.attributes.identifier', $servers[3]->uuidShort);\n }",
"public function testAllServersAreReturnedToAdmin()\n {\n /** @var \\Pterodactyl\\Models\\User[] $users */\n $users = User::factory()->times(4)->create();\n $users[0]->update(['root_admin' => true]);\n\n $servers = [\n $this->createServerModel(['user_id' => $users[0]->id]),\n $this->createServerModel(['user_id' => $users[1]->id]),\n $this->createServerModel(['user_id' => $users[2]->id]),\n $this->createServerModel(['user_id' => $users[3]->id]),\n ];\n\n Subuser::query()->create([\n 'user_id' => $users[0]->id,\n 'server_id' => $servers[1]->id,\n 'permissions' => [Permission::ACTION_WEBSOCKET_CONNECT],\n ]);\n\n // All servers should be returned.\n $response = $this->actingAs($users[0])->getJson('/api/client?type=admin-all');\n\n $response->assertOk();\n $response->assertJsonCount(4, 'data');\n }",
"public function guest_users_cannot_see_his_servers()\n {\n $response = $this->json('GET', '/api/v1/user/servers');\n $response->assertStatus(401);\n }",
"public function an_user_can_see_his_own_servers()\n {\n $user = factory(User::class)->create();\n\n factory(Server::class)->create([\n 'user_id' => $user->id,\n 'forge_id' => 1\n ]);\n\n factory(Server::class)->create([\n 'user_id' => $user->id,\n 'forge_id' => 2\n ]);\n\n factory(Server::class)->create([\n 'user_id' => $user->id,\n 'forge_id' => 3\n ]);\n\n\n $this->actingAs($user, 'api');\n\n $response = $this->json('GET', 'api/v1/users/' . $user->id . '/servers');\n $this->assertEquals(count(json_decode($response->getContent())), 3);\n $response->assertSuccessful();\n $response->assertJsonStructure([[\n 'id',\n 'name',\n 'forge_id',\n 'user_id',\n 'state',\n 'created_at',\n 'updated_at',\n ]]);\n }",
"public function testFilterIncludeAllServersWhenAdministrator()\n {\n /** @var \\Pterodactyl\\Models\\User[] $users */\n $users = factory(User::class)->times(3)->create();\n $users[0]->root_admin = true;\n\n $servers = [\n $this->createServerModel(['user_id' => $users[0]->id]),\n $this->createServerModel(['user_id' => $users[1]->id]),\n $this->createServerModel(['user_id' => $users[2]->id]),\n ];\n\n $response = $this->actingAs($users[0])->getJson('/api/client?filter=all');\n\n $response->assertOk();\n $response->assertJsonCount(3, 'data');\n\n for ($i = 0; $i < 3; $i++) {\n $response->assertJsonPath(\"data.{$i}.attributes.server_owner\", $i === 0);\n $response->assertJsonPath(\"data.{$i}.attributes.identifier\", $servers[$i]->uuidShort);\n }\n }",
"public function user_cannot_see_sites_if_no_servers_are_assigned()\n {\n $user = factory(User::class)->create();\n $this->actingAs($user, 'api');\n\n $response = $this->json('GET', '/api/v1/user/sites/15789');\n $response->assertStatus(403);\n }",
"public function user_cannot_see_sites_on_no_valid_servers()\n {\n $user = factory(User::class)->create();\n\n $server = factory(Server::class)->create([\n 'user_id' => $user->id,\n 'forge_id' => 15689,\n ]);\n\n $this->actingAs($user, 'api');\n\n\n $response = $this->json('GET', '/api/v1/user/sites/' . $server->forge_id);\n $response->assertStatus(403);\n }",
"function test_an_authenticated_user_can_create_server()\n {\n $user = $this->signInAPI();\n\n $response = $this->postJson(api_route('server.store'), [\n 'name' => 'Server name',\n 'ip' => '127.0.0.1',\n 'ssh_port' => 22,\n 'sudo_password' => $password = Str::random(),\n 'meta' => [],\n 'php_version' => '72',\n 'database_type' => 'mysql',\n ]);\n\n $response->assertStatus(201);\n\n $server = $user->servers()->first();\n\n $this->assertEquals('Server name', $server->name);\n $this->assertEquals('127.0.0.1', $server->ip);\n $this->assertEquals('22', $server->ssh_port);\n $this->assertEquals($password, $server->sudo_password);\n $this->assertEquals('72', $server->php_version);\n $this->assertEquals('mysql', $server->database_type);\n }",
"public function a_manager_user_can_propose_to_assign_any_user_a_server()\n {\n // Prepare\n $user = factory(User::class)->create();\n $user->assignRole('manage-forge');\n $otherUser = factory(User::class)->create();\n $this->actingAs($user, 'api');\n\n $forge_id = random_forge_server()->id;\n //Execute\n $response = $this->json('POST', 'api/v1/users/' . $otherUser->id . '/servers', [\n 'server_id' => $forge_id\n ]);\n\n $response->assertSuccessful();\n $response->assertJson([\n 'forge_id' => $forge_id,\n 'user_id' => $otherUser->id,\n 'state' => 'pending'\n ]);\n\n $this->assertDatabaseHas('servers', [\n 'forge_id' => $forge_id,\n 'user_id' => $otherUser->id,\n 'state' => 'pending'\n ]);\n }",
"public function test_unauthenticated_users_cannot_read_other_users()\n {\n $user = User::generate();\n\n $this->getUsersJsonEndpoint($this->generateAuthHeaders())\n ->assertStatus(401)\n ->assertDontSee($user->slug);\n }",
"public function testUserCannotAccessResourceBelongingToOtherServers(string $method)\n {\n // Generic subuser, the specific resource we're trying to access.\n /** @var \\Pterodactyl\\Models\\User $internal */\n $internal = User::factory()->create();\n\n // The API $user is the owner of $server1.\n [$user, $server1] = $this->generateTestAccount();\n // Will be a subuser of $server2.\n $server2 = $this->createServerModel();\n // And as no access to $server3.\n $server3 = $this->createServerModel();\n\n // Set the API $user as a subuser of server 2, but with no permissions\n // to do anything with the subusers for that server.\n Subuser::factory()->create(['server_id' => $server2->id, 'user_id' => $user->id]);\n\n Subuser::factory()->create(['server_id' => $server1->id, 'user_id' => $internal->id]);\n Subuser::factory()->create(['server_id' => $server2->id, 'user_id' => $internal->id]);\n Subuser::factory()->create(['server_id' => $server3->id, 'user_id' => $internal->id]);\n\n $this->instance(DaemonServerRepository::class, $mock = Mockery::mock(DaemonServerRepository::class));\n if ($method === 'DELETE') {\n $mock->expects('setServer->revokeUserJTI')->with($internal->id)->andReturnUndefined();\n }\n\n // This route is acceptable since they're accessing a subuser on their own server.\n $this->actingAs($user)->json($method, $this->link($server1, '/users/' . $internal->uuid))->assertStatus($method === 'POST' ? 422 : ($method === 'DELETE' ? 204 : 200));\n\n // This route can be revealed since the subuser belongs to the correct server, but\n // errors out with a 403 since $user does not have the right permissions for this.\n $this->actingAs($user)->json($method, $this->link($server2, '/users/' . $internal->uuid))->assertForbidden();\n $this->actingAs($user)->json($method, $this->link($server3, '/users/' . $internal->uuid))->assertNotFound();\n }",
"public function testCanShowAllUsersWhenAdminUser(){\n $this->actingAs(User::findOrFail(1))->get(USERS_ROUTE)\n ->seeStatusCode(self::HTTP_OK)\n ->seeJsonStructure([\n 'data' => [\n '*' => [\n 'email',\n 'id'\n ]\n ]\n ]);\n }",
"public function testPrivs()\n {\n return true; ///< Every client sees only it's own information\n }",
"public function testUserIsDeletedIfNoServersAreAttachedToAccount()\n {\n $this->serverRepository->shouldReceive('setColumns')->with('id')->once()->andReturnSelf()\n ->shouldReceive('findCountWhere')->with([['owner_id', '=', $this->user->id]])->once()->andReturn(0);\n $this->repository->shouldReceive('delete')->with($this->user->id)->once()->andReturn(1);\n\n $this->assertEquals(1, $this->service->handle($this->user->id));\n }",
"public function testFetchUsersWithoutToken()\n {\n \t$this->json('GET', '/api/user')\n \t->assertStatus(401);\n }",
"public function testServeUsers()\n {\n }",
"public function testApiGetUsers()\n {\n $settingManagement = new SettingsManager();\n $token = $settingManagement->getAzureADAPItoken();\n $this->testImportDataUserIntoMasterDB();\n\n $response = $this\n ->withHeaders([\n 'Authorization' => 'Bearer '.$token,\n ])\n ->get('api/Users?filter=userName eq \"test@gmail.com\"');\n\n $response->assertStatus(200);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
add a path for modelAddon loading | static public function addModelAddonPath($path){
self::addPath($path,'(?:_m|M)odelAddon(?:Interface)?');
} | [
"function getAddonPath()\n\t{\n\t\t//assert(isset($this->addonData['addon_key']));\n\t\treturn PEAR_ROOT_PATH . PEAR_SYSTEM_SOURCES . PEAR_ADDONS_DIRECTORY . $this->addonData['addon_key'] . '/';\n\t}",
"public function initPaths()\n {\n $this->setMigrationsPath($this->getAddonUpgradePath() . '/migrations');\n $this->setValidatorsPath($this->getAddonUpgradePath() . '/validators');\n $this->setExtraPath($this->getAddonUpgradePath() . '/extra/extra.php');\n $this->setExtraFilesPath($this->getAddonUpgradePath() . '/extra_files');\n $this->setScriptsPath($this->getAddonUpgradePath() . '/scripts');\n }",
"private function _getModelPath()\n {\n return APPPATH.'models';\n }",
"function addLocations(){\n $l = $this->api->locate('addons', __NAMESPACE__, 'location');\n\t\t$addon = $this->api->locate('addons', __NAMESPACE__);\n $this->api->pathfinder->addLocation($addon, array(\n \t'template' => 'templates',\n //'css' => 'templates/css',\n 'js' => 'js',\n ))->setParent($l);\n\t}",
"public function appendLoadPath($path)\n\t{\n\t\t$this->_fs->appendPath($path);\n\t}",
"public function addLoadPath($path)\n {\n $this->loadPaths[] = $path;\n }",
"public function addPath($path);",
"public function setupAssetPaths()\n {\n $addons = array( /*'Block', 'Extension', 'FieldType', */\n 'Module', /*'Tag', */\n 'Theme'\n );\n\n foreach ($addons as $addon) {\n $manager = '\\\\' . $addon;\n\n foreach ($manager::getAll()->active() as $addon) {\n \\Assets::addPaths($addon->loaderNamespace, $addon->path);\n }\n }\n }",
"protected function language_loader_addon()\n { \n \n $controller_name=strtolower($this->uri->segment(1));\n $path_without_filename=\"application/modules/\".$controller_name.\"/language/\".$this->language.\"/\";\n if(file_exists($path_without_filename.$controller_name.\"_lang.php\"))\n {\n $filename=$controller_name;\n $this->lang->load($filename,$this->language,FALSE,TRUE,$path_without_filename);\n }\n\n }",
"function prepend_resource_dir($path,$url,$append_nc=true,$ext=false)\n{\n $url = buildQuery($url);\n if( !$ext ) $ext = RESOURCE_EXTENSIONS;\n if( !isset($GLOBALS['CONFIG']['resources']) )\n $GLOBALS['CONFIG']['resources'] = [];\n array_unshift($GLOBALS['CONFIG']['resources'],compact('ext','path','url','append_nc'));\n}",
"protected function getModelsPath()\n\t{\n\t\treturn Framework::fw()->buildPath( '__base' );\n\t}",
"public function addPath(string $path);",
"public function setModelpath($path){\n\t\t$this->_modelPath = trim($path, '/');\n\n\t}",
"public static function set_paths(){\n if(!isset(self::$config['modules_path']))\n return;\n self::add_modules_path(self::$config['modules_path']);\n }",
"static protected function getModelSupportFilePath()\n\t{\n\t\t$args = func_get_args();\n\t\t$config = Config::getInstance();\n\t\t$path = $config['path']['mainclasses'] . 'modelSupport';\n\t\tarray_unshift($args, $path);\n\t\treturn self::getModelFilePath($args);\n\t}",
"function __buildModelPaths($modelPaths) {\r\n\t\t$_this =& Configure::getInstance();\r\n\t\t$_this->modelPaths[] = MODELS;\r\n\t\tif (isset($modelPaths)) {\r\n\t\t\tforeach($modelPaths as $value) {\r\n\t\t\t\t$_this->modelPaths[] = $value;\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"function __buildModelPaths($modelPaths)\n {\n $_this =& Configure::getInstance();\n $_this->modelPaths[] = MODELS;\n if(isset($modelPaths))\n {\n foreach ($modelPaths as $value)\n {\n $this->modelPaths[] = $value;\n }\n }\n }",
"public function getExtJsPath() {}",
"public function addImportPath(string $path);"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
get resource class name depending on the provided resource returns NULL if no resource can be created with the given resource | public static function getResourceClass($resource)
{
$type = gettype($resource);
// ARRAY
if($type === "array") {
return __NAMESPACE__ . '\ArrayResource';
}
// STRING / FILE PATH types
if($type === "string") {
// FILES
if(is_file($resource)) {
$extension = pathinfo($resource, PATHINFO_EXTENSION);
switch ($extension) {
case "csv":
return __NAMESPACE__ . '\CsvResource';
case "json":
return __NAMESPACE__ . '\JsonResource';
case "xml":
return __NAMESPACE__ . '\XMLResource';
case "edi":
return __NAMESPACE__ . '\EdiResource';
default:
return null;
}
}
// CASUAL STRINGS
// JsonResource
if((substr($resource, 0, 1) === '{' || substr($resource, 0, 1) === '[')) {
json_decode($resource);
if(json_last_error() == JSON_ERROR_NONE) {
return __NAMESPACE__ . '\JsonResource';
}
}
// EdiResource
if(substr($resource, 0, 9) == "UNA:+.? '") {
return __NAMESPACE__ . '\EdiResource';
}
// XMLResource
if(substr($resource, 0, 5) == "<?xml") {
libxml_use_internal_errors(true);
$readString = simplexml_load_string($resource);
libxml_use_internal_errors(false);
if($readString !== false) {
return __NAMESPACE__ . '\XMLResource';
}
}
}
// OBJECT
if($type === "object") {
// XMLResource
if($resource instanceof \SimpleXMLElement) {
return __NAMESPACE__ . '\XMLResource';
}
// ObjectResource
return __NAMESPACE__ . '\ObjectResource';
}
return NULL;
} | [
"public function getResourceClass(): string\n {\n if (!$this->_resourceClass) {\n $default = Resource::class;\n $self = static::class;\n $parts = explode('\\\\', $self);\n\n if ($self === self::class || count($parts) < 3) {\n return $this->_resourceClass = $default;\n }\n\n $alias = Inflector::singularize(substr(array_pop($parts), 0, -8));\n /** @psalm-var class-string<\\Muffin\\Webservice\\Model\\Resource> */\n $name = implode('\\\\', array_slice($parts, 0, -1)) . '\\Resource\\\\' . $alias;\n if (!class_exists($name)) {\n return $this->_resourceClass = $default;\n }\n\n return $this->_resourceClass = $name;\n }\n\n return $this->_resourceClass;\n }",
"public function resolveResourceClass(): string\n {\n $resourceClassName = $this->getResourceClassesNamespace().class_basename($this->resourceModelClass).'Resource';\n\n if (class_exists($resourceClassName)) {\n return $resourceClassName;\n }\n\n return Resource::class;\n }",
"public function getResourceClassName()\n {\n return $this->resourceClassName;\n }",
"function getResourceType($resource) {\n switch($resource) {\n case \"minibusjbx\":\n case \"minibusjha\":\n case \"minibuslle\":\n case \"minibusyhj\":\n case \"testvehicle\":\n return \"vehicle\";\n break;\n case \"ipadtrolleyblack\":\n case \"ipadtrolleygrey\":\n case \"laptoptrolley\":\n case \"slt_grouptherapy\":\n case \"slt_individualtherapy\":\n case \"slt_signalong\":\n case \"testresource\":\n return \"period\";\n break;\n default:\n return \"time\";\n break;\n } // switch\n }",
"protected function getResourceClass(): string\n {\n return __MODEL__Resource::class;\n }",
"abstract public function getValidationResourceClass();",
"private function shortName($resourceOrResourceClass): string\n {\n if (is_string($resourceOrResourceClass)) {\n $refl = new ReflectionClass($resourceOrResourceClass);\n\n return $refl->getShortName();\n }\n\n return $this->shortName(get_class($resourceOrResourceClass));\n }",
"public static function infer($resource): ?string\n {\n $ext = self::getExtension($resource);\n if ($ext === \"\") {\n self::fail(\"No file type extension on $resource\");\n }\n\n if ($ext === 'js') {\n return \"script\";\n }\n\n if ($ext === 'css') {\n return \"style\";\n }\n\n if (in_array($ext, self::IMAGE_TYPES)) {\n return \"image\";\n }\n\n if (in_array($ext, self::FONT_TYPES)) {\n return \"font\";\n }\n\n return self::fail(\"Unable to determine type for $resource\");\n }",
"public function getResourceClass()\n {\n return $this->resourceClass;\n }",
"protected function resource_name() {\n return phpActiveResourceBase::pluralize( strtolower( get_class( $this ) ) );\n }",
"protected function guessType($resource)\n {\n if (Str::contains($resource, '.css')) {\n return 'style';\n }\n\n if (Str::contains($resource, '.js')) {\n return 'script';\n }\n\n return 'image';\n }",
"public function resourceClass()\n {\n return $this->getAdapter('resource_classes')\n ->getRepresentation($this->resource->getResourceClass());\n }",
"private function getResourceName()\n\t{\n\n\t\t/**\n\t\t * namespace avec nom de la classe\n\t\t */\n\t\t$namespacedClassName = get_class($this);\n\n /**\n * Nom de la classe sans namespace\n */\n $className = join('', array_slice(explode('\\\\', $namespacedClassName), -1));\n\n /**\n * Transformer en minuscule et espacer d'underscore\n * @example Ticket => ticket\n * \tMyClass => my_class\n */\n $underscored = strtolower(preg_replace('/(?<!^)([A-Z])/', '_$1', $className));\n\n /**\n * Ajout de \"s\" a la fin pour avoir une ressource valide\n */\n $resourceName = $underscored . \"s\";\n\n /**\n * @example return tickets\n */\n return $resourceName;\n\n\t}",
"protected function resourceName()\n {\n if (is_null($this->resource)) {\n $this->resource = str_singular($this->resolveResourcesName());\n }\n\n return $this->resource;\n }",
"public function getResourceTypeName() {\n return $this->resourceTypeName;\n }",
"protected function getResourceNameFromClass()\r\n {\r\n $namespacedClassName = get_class($this);\r\n $resourceName = join('', array_slice(explode('\\\\', $namespacedClassName), -1));\r\n \r\n\t // This converts the resource name from camel case to underscore case.\r\n // e.g. MyClass => my_class\r\n $dashed = strtolower(preg_replace('/(?<!^)([A-Z])/', '-$1', $resourceName));\r\n \r\n\t\treturn strtolower($dashed);\r\n\t}",
"private function generateResourceName($resource)\n {\n if (false === $this->pluralize) {\n return $resource;\n }\n\n return $this->inflector->pluralize($resource);\n }",
"public function getResourceType();",
"public function getClassResource()\r\n\t{\r\n\t\treturn $this->_resource;\r\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Lists all Profit models. | public function actionIndex()
{
$searchModel = new ProfitSearch();
$dataProvider = $searchModel->search(Yii::$app->request->queryParams);
return $this->render('index', [
'searchModel' => $searchModel,
'dataProvider' => $dataProvider,
]);
} | [
"static function getAllProduit() {\n $rep = Model::$pdo->query('SELECT *\n\t\t\t\t\t\t\t\tFROM PRODUIT');\n $rep->setFetchMode(PDO::FETCH_CLASS, 'ModelProduit');\n $ans = $rep->fetchAll();\n return $ans;\n }",
"public function produtos()\n {\n return Produto::All();\n }",
"public function all() {\n return $this->app->entityManager->getRepository($this->model_name)->findAll();\n }",
"public function actionIndex() {\n $searchModel = new ProdukSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }",
"function _listAll()\n {\n $this->_getTables();\n $this->out('');\n $this->out('Possible Models based on your current database:');\n $this->hr();\n $this->_modelNames = array();\n $i=1;\n foreach ($this->__tables as $table) {\n $this->_modelNames[] = $this->_modelName($table);\n $this->out($i++ . \". \" . $this->_modelName($table));\n }\n }",
"public function getModels();",
"public function actionIndex()\n {\n $searchModel = new ListProdukRestockSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }",
"public function getAllModels(){\n if($this->getRequestType() !== \"GET\") {\n $this->requestError(405);\n }\n $autoModel = AutoModels::model()->findAll();\n\n $this->sendResponse([\"success\" => 1, \"data\" => $autoModel]);\n exit();\n }",
"public static function readAll()\n {\n if (isset($_SESSION['login'])) {\n if (isset($_GET['p'])) {\n $p = intval($_GET['p']);\n if ($p > ModelProjet::getNbP()) $p = ModelProjet::getNbP();\n if ($p <= 0) $p = 1;\n } else $p = 1;\n $max = ModelProjet::getNbP();\n $tab = ModelProjet::selectByPage($p);\n $tabTheme = ModelTheme::selectAll();\n $tabEntite = ModelEntite::selectAll();\n $statuts = array('Accepté', 'Refusé', 'Déposé', 'En cours de montage');\n $view = 'list';\n $pagetitle = \"Projets\";\n require_once File::build_path(array('view', 'view.php'));\n } else ControllerUser::connect();\n }",
"public function all()\n {\n return $this->work_experience->all();\n }",
"public function professoresAll()\n {\n return response()->json(Professor::all());\n }",
"public function actionIndex()\n {\n $searchModel = new ProProductSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }",
"public function getAllModel()\n {\n $this->_setQueryModel();\n return $this->getQuery();\n }",
"public function actionIndex()\n {\n $searchModel = new IsaSeguimientoProcesoBuscar();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\t\t$dataProvider->query->andWhere( \"estado=1\" ); \n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }",
"function GetAllModels()\n\t{\n\t}",
"public function getModels()\n\t{\n\t\t$Model = new Product_Model();\n\t\treturn $Model->findList( array( 'ProductId = '.$this->Id ), 'Position asc' );\n\t}",
"public function getAllProfessionnels () {\n return Professionnel::where('user_id', auth()->user()->id)->orderBy('created_at', 'desc')->get();\n }",
"public function actionIndex()\n {\n $searchModel = new KeahlianProyekSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }",
"public function get_models(){\n\t\techo $this->manufacturer_model->getModelsData();\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the annotation objects associated to $annotationName in an array. | public function getAnnotations($annotationName); | [
"public function findAnnotations($annotationName) {\n $output = [];\n if (array_key_exists($annotationName, $this->data['class'])) {\n $output[] = $this->data['class'][$annotationName];\n }\n foreach ($this->data['properties'] as $property) {\n if (array_key_exists($annotationName, $property)) {\n $output[] = $property[$annotationName];\n }\n }\n foreach ($this->data['methods'] as $method) {\n if (array_key_exists($annotationName, $method)) {\n $output[] = $method[$annotationName];\n }\n }\n return $output;\n }",
"public function getAnnotations($annotation_name = null);",
"public function getAnnotations($annotationName) {\r\n\t\t$this->analyzeComment();\r\n\t\t\r\n\t\treturn $this->docComment->getAnnotations($annotationName);\r\n\t}",
"public function getAll($name)\n {\n if (is_string($name) === false) {\n throw new Exception('Invalid parameter type.');\n }\n\n if (is_array($this->_annotations) === true) {\n $found = array();\n\n foreach ($this->_annotations as $annotation) {\n $annotationName = $annotation->getName();\n if ($name == $annotationName) {\n $found[] = $annotation;\n }\n }\n }\n\n return $found;\n }",
"private function getAnnotations($reflector, $annotationName = null)\n\t{\n\t\t$results = [];\n\n\t\tif ($reflector instanceof ReflectionClass)\n\t\t{\n\t\t\t$results = $this->annotationReader->getClassAnnotations($reflector);\n\t\t}\n\t\telseif ($reflector instanceof ReflectionMethod)\n\t\t{\n\t\t\t$results = $this->annotationReader->getMethodAnnotations($reflector);\n\t\t}\n\t\telseif ($reflector instanceof ReflectionProperty)\n\t\t{\n\t\t\t$results = $this->annotationReader->getPropertyAnnotations($reflector);\n\t\t}\n\n\t\tif ($annotationName !== null)\n\t\t{\n\t\t\t$results = array_filter($results, function($item) use ($annotationName) {\n\t\t\t\treturn get_class($item) === $annotationName\n\t\t\t\t|| in_array($annotationName, class_parents($item));\n\t\t\t});\n\t\t}\n\n\t\treturn $results;\n\t}",
"function get_annotations(string $from, string $annotationName): array\n {\n preg_match_all('#@(.*?)\\n#s', $from, $annotations);\n\n $foundAnnotations = [];\n foreach (reset($annotations) as $annotation) {\n if (Str::startsWith($annotation, $annotationName)) {\n $foundAnnotations[] = trim(Str::replaceFirst($annotationName, '', $annotation));\n }\n }\n\n return $foundAnnotations;\n }",
"public function getAnnotations( $name = '' ) {\n if ( $name == '' ) {\n return $this->docParser->getAnnotations();\n }\n else {\n return $this->docParser->getAnnotationsByName($name);\n }\n }",
"public function findAnnotatedServiceIds($name)\n {\n $annotations = array();\n foreach ($this->getDefinitions() as $id => $definition) {\n if ($definition->getAnnotation($name)) {\n $annotations[$id] = $definition->getAnnotation($name);\n }\n }\n\n return $annotations;\n }",
"public function getAnnotation($annotation_name)\n\t{\n\t\treturn $this->getCachedAnnotation($annotation_name, false);\n\t}",
"public function getAnnotation($name);",
"public function findAnnotatedServiceIds($name)\n {\n static $annotations = array (\n);\n\n return isset($annotations[$name]) ? $annotations[$name] : array();\n }",
"public function all()\n {\n $all = [];\n foreach ($this as $annotation) {\n $all[] = $annotation;\n }\n\n return $all;\n }",
"public function asArray() {\n\t\tif (func_num_args() === 0) {\n\t\t\treturn $this->_annotations;\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$val = array();\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t$val = $annos[$anno];\n\t\t\t$annos =& $annos[$anno];\n\t\t}\n\n\t\tif (!is_array($val)) {\n\t\t\t$val = array($val);\n\t\t} else {\n\t\t\t// Check if array is associative\n\t\t\t$isAssoc = (bool) count(array_filter(array_keys($val), 'is_string'));\n\t\t\tif ($isAssoc) {\n\t\t\t\t$val = array($val);\n\t\t\t}\n\t\t}\n\t\treturn $val;\n\t}",
"public function listAnnotation($annotation);",
"public function getAnnotation(string $annotationName): ?object;",
"public function toArray(): array\n {\n return $this->annotations;\n }",
"protected function getAttrMarkers($name) {\r\n\t\t$markerArray = array();\r\n\t\t$tagArr = $this->getAttributeKeys();\r\n\r\n\t\tforeach ($tagArr as $tag) {\r\n\t\t\t$usedTag = strtoupper($tag);\r\n\t\t\t$marker = '###' . $name . '_ATTR_' . $usedTag . '###';\r\n\t\t\t$markerArray[$marker] = $this->getAttribute($tag);\r\n\t\t}\r\n\t\treturn $markerArray;\r\n\t}",
"public function getAnnotationClassNames ();",
"protected function aggregateLastByName(array $annotations) {\n\t\t\t$ret = [];\n\n\t\t\tforeach($annotations as $curr) {\n\t\t\t\t$ret[$curr->getAnnotationType()] = $curr;\n\t\t\t}\n\n\t\t\treturn $ret;\n\t\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Filter the query on the montacargas_marca column Example usage: $query>filterByMontacargasMarca('fooValue'); // WHERE montacargas_marca = 'fooValue' $query>filterByMontacargasMarca('%fooValue%'); // WHERE montacargas_marca LIKE '%fooValue%' | public function filterByMontacargasMarca($montacargasMarca = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($montacargasMarca)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $montacargasMarca)) {
$montacargasMarca = str_replace('*', '%', $montacargasMarca);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(MontacargasPeer::MONTACARGAS_MARCA, $montacargasMarca, $comparison);
} | [
"public function setMontacargasMarca($v)\n {\n if ($v !== null) {\n $v = (string) $v;\n }\n\n if ($this->montacargas_marca !== $v) {\n $this->montacargas_marca = $v;\n $this->modifiedColumns[] = MontacargasPeer::MONTACARGAS_MARCA;\n }\n\n\n return $this;\n }",
"public function filterByMatricula($matricula = null, $comparison = null)\n {\n if (null === $comparison) {\n if (is_array($matricula)) {\n $comparison = Criteria::IN;\n } elseif (preg_match('/[\\%\\*]/', $matricula)) {\n $matricula = str_replace('*', '%', $matricula);\n $comparison = Criteria::LIKE;\n }\n }\n\n return $this->addUsingAlias(AbogadoPeer::MATRICULA, $matricula, $comparison);\n }",
"public function filterByIdmarca($idmarca = null, $comparison = null)\n {\n if (is_array($idmarca)) {\n $useMinMax = false;\n if (isset($idmarca['min'])) {\n $this->addUsingAlias(ProductoPeer::IDMARCA, $idmarca['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($idmarca['max'])) {\n $this->addUsingAlias(ProductoPeer::IDMARCA, $idmarca['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(ProductoPeer::IDMARCA, $idmarca, $comparison);\n }",
"public function filterByMontacargas($montacargas, $comparison = null)\n {\n if ($montacargas instanceof Montacargas) {\n return $this\n ->addUsingAlias(SucursalPeer::IDSUCURSAL, $montacargas->getIdsucursal(), $comparison);\n } elseif ($montacargas instanceof PropelObjectCollection) {\n return $this\n ->useMontacargasQuery()\n ->filterByPrimaryKeys($montacargas->getPrimaryKeys())\n ->endUse();\n } else {\n throw new PropelException('filterByMontacargas() only accepts arguments of type Montacargas or PropelCollection');\n }\n }",
"public function filterByIdmarca($idmarca = null, $comparison = null)\n {\n if (is_array($idmarca)) {\n $useMinMax = false;\n if (isset($idmarca['min'])) {\n $this->addUsingAlias(PromociondetallePeer::IDMARCA, $idmarca['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($idmarca['max'])) {\n $this->addUsingAlias(PromociondetallePeer::IDMARCA, $idmarca['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(PromociondetallePeer::IDMARCA, $idmarca, $comparison);\n }",
"public function filterByIdmarca($idmarca = null, $comparison = null)\n {\n if (is_array($idmarca)) {\n $useMinMax = false;\n if (isset($idmarca['min'])) {\n $this->addUsingAlias(ProveedormarcaPeer::IDMARCA, $idmarca['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($idmarca['max'])) {\n $this->addUsingAlias(ProveedormarcaPeer::IDMARCA, $idmarca['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(ProveedormarcaPeer::IDMARCA, $idmarca, $comparison);\n }",
"public function filterByNotificaMarca($notificaMarca = null, $comparison = null)\n {\n if (is_string($notificaMarca)) {\n $notifica_marca = in_array(strtolower($notificaMarca), array('false', 'off', '-', 'no', 'n', '0', '')) ? false : true;\n }\n\n return $this->addUsingAlias(ParametroPeer::NOTIFICA_MARCA, $notificaMarca, $comparison);\n }",
"public function getMarcoMuestral(){\n\t\t$query = \"SELECT * FROM prop_marco_muestral\";\n\t\treturn $this->adoDbFab->GetAll($query);\n\t}",
"public function filterByMontacargasT($montacargasT = null, $comparison = null)\n {\n if (null === $comparison) {\n if (is_array($montacargasT)) {\n $comparison = Criteria::IN;\n } elseif (preg_match('/[\\%\\*]/', $montacargasT)) {\n $montacargasT = str_replace('*', '%', $montacargasT);\n $comparison = Criteria::LIKE;\n }\n }\n\n return $this->addUsingAlias(MontacargasPeer::MONTACARGAS_T, $montacargasT, $comparison);\n }",
"public function filterByIdmontacargas($idmontacargas = null, $comparison = null)\n {\n if (is_array($idmontacargas)) {\n $useMinMax = false;\n if (isset($idmontacargas['min'])) {\n $this->addUsingAlias(MontacargasBateriasPeer::IDMONTACARGAS, $idmontacargas['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($idmontacargas['max'])) {\n $this->addUsingAlias(MontacargasBateriasPeer::IDMONTACARGAS, $idmontacargas['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(MontacargasBateriasPeer::IDMONTACARGAS, $idmontacargas, $comparison);\n }",
"public function filterByMontacargasK($montacargasK = null, $comparison = null)\n {\n if (null === $comparison) {\n if (is_array($montacargasK)) {\n $comparison = Criteria::IN;\n } elseif (preg_match('/[\\%\\*]/', $montacargasK)) {\n $montacargasK = str_replace('*', '%', $montacargasK);\n $comparison = Criteria::LIKE;\n }\n }\n\n return $this->addUsingAlias(MontacargasPeer::MONTACARGAS_K, $montacargasK, $comparison);\n }",
"public function filterByMatricula($matricula = null, $comparison = null)\n {\n if (is_array($matricula)) {\n $useMinMax = false;\n if (isset($matricula['min'])) {\n $this->addUsingAlias(TbalunoImportPeer::MATRICULA, $matricula['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($matricula['max'])) {\n $this->addUsingAlias(TbalunoImportPeer::MATRICULA, $matricula['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(TbalunoImportPeer::MATRICULA, $matricula, $comparison);\n }",
"public function filterByMontacargas($montacargas, $comparison = null)\n {\n if ($montacargas instanceof Montacargas) {\n return $this\n ->addUsingAlias(MontacargasBateriasPeer::IDMONTACARGAS, $montacargas->getIdmontacargas(), $comparison);\n } elseif ($montacargas instanceof PropelObjectCollection) {\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n\n return $this\n ->addUsingAlias(MontacargasBateriasPeer::IDMONTACARGAS, $montacargas->toKeyValue('PrimaryKey', 'Idmontacargas'), $comparison);\n } else {\n throw new PropelException('filterByMontacargas() only accepts arguments of type Montacargas or PropelCollection');\n }\n }",
"public function setMarca($marca){\n\n $this->marca = $marca;\n }",
"public function setMarca($Marca) {\n $this->Marca = $Marca;\n }",
"public function setMarca($marca)\n {\n $this->marca = $marca;\n }",
"public function filterByMatricula($matricula = null, $comparison = null)\n {\n if (null === $comparison) {\n if (is_array($matricula)) {\n $comparison = Criteria::IN;\n } elseif (preg_match('/[\\%\\*]/', $matricula)) {\n $matricula = str_replace('*', '%', $matricula);\n $comparison = Criteria::LIKE;\n }\n }\n\n return $this->addUsingAlias(UsuarioPeer::MATRICULA, $matricula, $comparison);\n }",
"public function filterByMontacargasBaja($montacargasBaja = null, $comparison = null)\n {\n if (is_array($montacargasBaja)) {\n $useMinMax = false;\n if (isset($montacargasBaja['min'])) {\n $this->addUsingAlias(MontacargasPeer::MONTACARGAS_BAJA, $montacargasBaja['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($montacargasBaja['max'])) {\n $this->addUsingAlias(MontacargasPeer::MONTACARGAS_BAJA, $montacargasBaja['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(MontacargasPeer::MONTACARGAS_BAJA, $montacargasBaja, $comparison);\n }",
"public function setBateriasMarca($v)\n {\n if ($v !== null) {\n $v = (string) $v;\n }\n\n if ($this->baterias_marca !== $v) {\n $this->baterias_marca = $v;\n $this->modifiedColumns[] = BateriasPeer::BATERIAS_MARCA;\n }\n\n\n return $this;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return acl resource name if defined | public function getAclResource()
{
if (!empty($this->definition['acl_resource'])) {
return $this->definition['acl_resource'];
}
return false;
} | [
"protected function getAclTemplate() : string\n {\n return static::TEMPLATE_ACL_SOURCE;\n }",
"public function testAclResourceName()\n {\n $this->specify(\n 'Acl\\Resource by name does not exist in the acl',\n function () {\n\n $acl = new PhTAclMem();\n $aclResource = new PhTAclResource('Customers', 'Customer management');\n\n $acl->addResource($aclResource, 'search');\n\n $actual = $acl->isResource('Customers');\n\n expect($actual)->true();\n }\n );\n }",
"public function testAclResourceName()\n {\n $this->specify(\n 'Acl\\Resource by name does not exist in the acl',\n function () {\n $acl = new Memory();\n $aclResource = new Resource('Customers', 'Customer management');\n\n $acl->addResource($aclResource, 'search');\n\n $actual = $acl->isResource('Customers');\n\n expect($actual)->true();\n }\n );\n }",
"public function getAclRole()\n {\n return 'U'.$this->getUserId();\n }",
"public function getAccessName();",
"public function get_resource_name()\n\t{\n\t\tif (empty($this->resource_name))\n\t\t{\n\t\t\t$this->resource_name = Rest_Route::parse($this);\n\t\t}\n\t\treturn $this->resource_name;\n\t}",
"protected function getResourceName()\n {\n $name = ucwords($this->argument('resource'));\n\n if ($this->namespaceByResource) {\n return str_plural($name);\n }\n\n return $name;\n }",
"public function getResourceName(): string\n {\n return static::INDEX['name'];\n }",
"protected function _getResourceName () {\n\t\t\t$resource = $this->getRequest ()->getControllerName ();\n\t\t\t$resource = preg_replace ( \"/^cloudflare_/\", \"\", $resource );\n\t\t\t$resource = str_replace ( \"api_\", \"\", $resource );\n\t\t\t$resource = str_replace ( \"_\", \"/\", $resource );\n\t\t\t$resource = preg_replace ( \"/([A-Z])/\", '_$1', $resource );\n\t\t\treturn strtolower ( $resource );\n\t\t}",
"public function getAclDetails($name)\n {\n return $this->aclExists($name) ? $this->getParameter(\"acl $name\") : null;\n }",
"public function getAuthorityName();",
"function getAclParam()\n\t{\n\t\treturn '';\n\t}",
"public function getPermissionName();",
"static public function getClassName()\r\n\t{\r\n\t\treturn O_Registry::get( \"app/classnames/acl_role\" );\r\n\t}",
"public function getResourceName()\n {\n return $this->resource_name;\n }",
"abstract protected function getAcl();",
"protected function getAclParam()\n\t{\n\t\treturn 'access';\n\t}",
"public function getAclNames()\n\t{\n\t\treturn array( \"ownCompany\", \"ownConsultant\", \"analyst\", \"allConsultants\", \"allMembers\", \"moreMembers\" );\n\t}",
"protected function getLongLivedAclName() {\n return $this->getStandardAclName() . '_longlived';\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function which creates tagcloud with tags differing in size | public static function tagcloud($size) {
// get random tags with high tfidf importance
$limit = $size;
$tagset = DB::select()
->from("tags")
->where(DB::expr("length(content)"), ">", 4)
->where("occurrences", ">", 2)
->where("importance", ">", 0.141430140)
->order_by(DB::expr("RAND()"))
->limit($limit)
->execute();
// convert to array
$tags = array();
foreach($tagset as $key => $tag) {
$content = preg_replace('/(^\-)|(\-$)/','',$tag['content']);
$tags[$tag['importance']] = array(
'original' => $tag['content'],
'content' => strtolower(Translator::translate(
'tag',
$tag['id'],
'tag',
$tag['content']
))
);
}
// sort by importance and add fontsize
ksort($tags);
$i = 0;
foreach($tags as $key=>&$tag) {
$tag['fontsize'] = 12+$i;
$i+=1;
}
// sort alphabetically
asort($tags);
return $tags;
} | [
"function wct_generate_tag_cloud( $number = 10, $args = array() ) {\n\t$r = array( 'number' => $number, 'orderby' => 'count', 'order' => 'DESC' );\n\n\t$tags = get_terms( wct_get_tag(), apply_filters( 'wct_generate_tag_cloud_args', $r ) );\n\n\tif ( empty( $tags ) ) {\n\t\treturn;\n\t}\n\n\tforeach ( $tags as $key => $tag ) {\n\t\t$tags[ $key ]->link = '#';\n\t\t$tags[ $key ]->id = $tag->term_id;\n\t}\n\n\t$args = wp_parse_args( $args,\n\t\twct_tag_cloud_args( array( 'taxonomy' => wct_get_tag() ) )\n\t);\n\n\t$retarray = array(\n\t\t'number' => count( $tags ),\n\t\t'tagcloud' => wp_generate_tag_cloud( $tags, $args )\n\t);\n\n\treturn apply_filters( 'wct_generate_tag_cloud', $retarray );\n}",
"private function _getTagCloud()\n {\n //global $interface;\n global $configArray;\n\n $tags = new Tags();\n\n // Specify different font sizes in descending order here\n $fontSizes = array(5, 4, 3, 2, 1);\n $nFonts = count($fontSizes);\n\n // no of different tags to display\n $RecLimit = 50;\n\n // Query to retrieve tags and their counts\n $query = 'SELECT \"tags\".\"tag\", COUNT(\"tag\") as cnt ' .\n 'FROM \"tags\", \"resource_tags\" ' .\n 'WHERE \"tags\".\"id\" = \"resource_tags\".\"tag_id\" ' .\n 'GROUP BY \"tags\".\"tag\" ORDER BY cnt DESC, \"tag\" ' .\n \"LIMIT {$RecLimit}\";\n\n $tags->query($query);\n $actualRecs = $tags->N;\n\n // Create data array as\n // key = tag_name and value = tag_count\n //from the results returned by query\n $data = array();\n if ($actualRecs) {\n while ($tags->fetch()) {\n $data[\"$tags->tag\"] = $tags->cnt;\n }\n } else {\n return;\n }\n $temp = $data;\n // sort array in alphabetical\n // order of its keys\n uksort($data, \"strnatcasecmp\");\n\n // Create arry which contains only\n // count of all tags\n $onlyCnt = array();\n foreach ($temp as $item) {\n $onlyCnt[] = $item;\n }\n // create array which will contain only\n // uniqe tag counts\n $DistinctValues = array($onlyCnt[0]);\n for ($i = 1; $i < count($onlyCnt); $i++) {\n if ($onlyCnt[$i] != $onlyCnt[$i - 1]) {\n $DistinctValues[] = $onlyCnt[$i];\n }\n }\n\n $cntDistinct = count($DistinctValues);\n\n // set step which will\n // decide when to change font size\n $step = 1;\n $mod = 0;\n if ($cntDistinct > $nFonts) {\n $step = (int)($cntDistinct / $nFonts);\n $mod = $cntDistinct % $nFonts;\n }\n\n $distinctToFont = array();\n $fontIndex = 0;\n $stepCnt = 0;\n for ($i = 0; $i < $cntDistinct; $i++) {\n $distinctToFont[\"{$DistinctValues[$i]}\"] = $fontSizes[$fontIndex];\n $stepCnt++;\n if ($mod && (($nFonts - ($fontIndex + 1)) == $mod)) {\n $step++;\n $fontIndex++;\n $stepCnt = 0;\n }\n if ($stepCnt == $step) {\n $fontIndex++;\n $stepCnt = 0;\n }\n }\n\n foreach ($data as $key => $value) {\n $data[$key] = $distinctToFont[\"$value\"];\n }\n\n return $data;\n }",
"function ciniki_web_processTagCloud($ciniki, $settings, $base_url, $tags) {\n\n $min = 0;\n $max = 1;\n // Find the minimum and maximum\n foreach($tags as $tag) {\n if( $min == 0 ) { $min = $tag['num_tags']; }\n elseif( $tag['num_tags'] < $min ) { $min = $tag['num_tags']; }\n if( $tag['num_tags'] > $max ) { $max = $tag['num_tags']; }\n }\n \n $fmax = 9;\n $fmin = 0;\n $tag_content = '';\n $size = 0;\n foreach($tags as $tag) {\n if( $max > $fmax ) {\n $fontsize = round(($fmax * ($tag['num_tags']-$min))/($max-$min));\n } else {\n $fontsize = $tag['num_tags'];\n }\n if( !isset($tag['permalink']) || $tag['permalink'] == '' ) {\n $tag['permalink'] = rawurlencode($tag['name']);\n }\n $tag_content .= \"<span class='size-$fontsize'><a href='$base_url/\" . $tag['permalink'] . \"'>\" \n . $tag['name'] . \"</a></span> \";\n $size += strlen($tag['name']);\n }\n\n $cloud_size = 'word-cloud-medium';\n if( $size > 150 ) {\n $cloud_size = 'word-cloud-large';\n }\n $content = \"<div class='word-cloud-wrap'>\";\n $content .= \"<div class='word-cloud $cloud_size'>\";\n $content .= $tag_content;\n $content .= \"</div>\";\n $content .= \"</div>\";\n\n return array('stat'=>'ok', 'content'=>$content);\n}",
"public function generateTagCloud($table, $count_tags = 15,$min_font_size = 10,$max_font_size = 18)\n\t{\n\t $table = $this->db->escape_str($table);\n\t\t$count_tags = intval($count_tags);\n\t \n\t $font_sizes = range($min_font_size,$max_font_size);\n\t\t$tag_cloud = \"\";\n\n\t\t$arr = $result = $this->db->query(\"SELECT *, COUNT(*) AS amount FROM `{$this->c_table}` WHERE `table` = '{$table}' GROUP BY tag ORDER BY RAND() LIMIT $count_tags\")->result_array();\n\n\t\tuasort($result,\"sorttags\");\n\n\t\t$first = reset($result);\n\t\t$min_val = $first['amount'];\n\t\t$result = array_reverse($result);\n\t\t$last = reset($result);\n\t\t$max_val = $last['amount'];\n\n\t\t$i=0;\n\t\tforeach ($arr as $key=>$val)\n\t\t{\n\t\t\t$i++;\n\t\t\t\n\t\t\t//Calc tags' font sizes\n\t\t\tif( $val['amount']==$min_val ) $arr[$key]['font_size'] = $min_font_size;\n\t\t\telseif( $val['amount']==$max_val ) $arr[$key]['font_size'] = $max_font_size;\n\t\t\telse \n\t\t\t{\n\t\t\t\t$d = intval(round($last['amount']/$val['amount']));\n\t\t\t\t$s = intval(round(($max_font_size-$min_font_size)/$d));\n\t\t\t\t$arr[$key]['font_size'] = min($font_sizes[$s],$max_font_size);\n\t\t\t}\n\n\t\t\t//build tag cloud\n\t\t\t$tag = $val['tag'];\n\t\t\t$font_size = $arr[$key]['font_size'];\n\t\t\t\n\t\t\tif($i%2) $class =\"odd\";\n\t\t\telse $class = \"\";\n\t\t\t\n\t\t\t$tag_cloud .= anchor($this->CI->_getBaseURL().$table.'/tag/'.urlencode($tag),$tag,\" style='font-size:{$font_size}px;' class='{$class}'\").\" \";\n\t\t}\n\n\t\treturn $tag_cloud;\n\t}",
"function tag_cloud()\n{\n\t$max=-1;\n\t$min=100000;\n\n\t$conn=db_connect();\n\t//vriskoyme tin syxnotita emfanisis kathe selidodeikti\n\t$result=mysql_query(\"SELECT tag,count(tag) FROM tags GROUP BY tag\");\n\tmysql_close();\n\t\n\n\tif(!$result)\n\t{\n\t\tthrow new Exception('Συνέβει κάποιο σφάλμα κατά την προσπέλαση των σελιδοδεικτών');\n\t}\n\t\n\tif(mysql_num_rows($result)>0)\n\t{\n\t\t$num_result=mysql_num_rows($result);\n\t\t\n\t\t//echo $num_result;\n\t\t//echo '<br/>';\n\t\t\n\t\tfor($i=0; $i<$num_result; $i++)\n\t\t{\n\t\t\t$row=mysql_fetch_row($result);\n\t\t\t\n\t\t\t//euresi megistis timis\n\t\t\tif($max<$row[1])\n\t\t\t{\n\t\t\t\t$max=$row[1];\n\t\t\t}\n\t\t\t//euresi elaxistis timis\n\t\t\tif($min>$row[1])\n\t\t\t{\n\t\t\t\t$min=$row[1];\n\t\t\t}\n\t\t\t\n\t\t\t$terms[]=array('term'=>$row[0], 'counter'=>$row[1]);\n\t\t}\n\t\t\n\t\t//shuffle($terms);\n\n\t\techo \"<div id=\\\"tagcloud\\\">\\n\";\n\t\tforeach($terms as $term)\n\t\t{\n\t\t\t$percent=floor(($term['counter']/$max)*100);\n\t\t\n\t\t\tif($percent<20)\n\t\t\t{\n\t\t\t\t$class='smallest';\n\t\t\t}\n\t\t\telseif($percent>=20 and $percent<40)\n\t\t\t{\n\t\t\t\t$class='small';\n\t\t\t}\n\t\t\telseif($percent>=40 and $percent<60)\n\t\t\t{\n\t\t\t\t$class='large';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$class='largest';\n\t\t\t}\n\t\t\t\n\t\t\t$element=urlencode($term['term']);\n\t\t\t//echo $term;\n\t\t\techo \"<span class=\\\"$class\\\"><a href='tag_cloud.php?var=$element'>\".$term['term'].\"</a></span>\\n\";\n\t\t\t//echo '<br/>';\n\t\t}\n\t\techo \"</div>\";\n\t}\n}",
"public function generateTagCloud()\n {\n if ($this->tagCloud !== false) {\n return $this->tagCloud;\n }\n\n $this->tagCloud = $this->factory->buildTagCloud();\n\n $tags = $this->tagDataProvider->provideData();\n foreach ($tags as $tag => $source) {\n $tagObject = $this->factory->buildTag(\n $tag,\n count($source),\n $this->getPermalink($tag)\n );\n\n\n $this->tagCloud->addTag($tagObject);\n }\n\n $this->applyStrategies($this->tagCloud);\n\n return $this->tagCloud;\n }",
"function getCloud($data = array(), $minFontSize = 12, $maxFontSize = 30)\n{\n $minimumCount = min( array_values( $data ) );\n $maximumCount = max( array_values( $data ) );\n $spread = $maximumCount - $minimumCount;\n $cloudHTML = '';\n $cloudTags = array();\n $spread == 0 && $spread = 1;\n foreach( $data as $tag => $count )\n {\n $size = $minFontSize + ( $count - $minimumCount )\n * ( $maxFontSize - $minFontSize ) / $spread;\n $cloudTags[] = '<a style=\"font-size: ' . floor( $size ) . 'px'\n . '\" class=\"tag_cloud\" href=\"http://www.google.com/search?q='\n . $tag\n . '\" title=\"\\'' . $tag . '\\' returned a count of ' . $count\n . '\">'\n . htmlspecialchars( stripslashes( $tag ) ) . '</a>';\n }\n return join( \"\\n\", $cloudTags ) . \"\\n\";\n}",
"public function tag_cloud_html($num_tags = 100, $min_font_size = 10, $max_font_size = 20, $font_units = 'px', $span_class = 'cloud_tag', $tag_page_url = '/tag/', $user_id = NULL, $offset = 0) \n\t{\n\t\t$tag_list = $this->tag_cloud_tags($num_tags, $user_id, $offset);\n\n\t\tif (count($tag_list)) \n\t\t{\n\t\t\t// Get the maximum qty of tagged objects in the set\n\t\t\t$max_qty = max(array_values($tag_list));\n\t\t\t\n\t\t\t// Get the min qty of tagged objects in the set\n\t\t\t$min_qty = min(array_values($tag_list));\n\t\t}\n\t\telse \n\t\t{\n\t\t\treturn '';\n\t\t}\n\n\t\t// For ever additional tagged object from min to max, we add\n\t\t// $step to the font size.\n\t\t$spread = $max_qty - $min_qty;\n\t\t\n\t\tif ($spread == 0) \n\t\t{\n\t\t\t// Divide by zero\n\t\t\t$spread = 1;\n\t\t}\n\t\t\n\t\t$step = ($max_font_size - $min_font_size) / ($spread);\n\n\t\t// Since the original tag_list is alphabetically ordered,\n\t\t// we can now create the tag cloud by just putting a span\n\t\t// on each element, multiplying the diff between min and qty\n\t\t// by $step.\n\t\t$cloud_html = '';\n\t\t$cloud_spans = array();\n\t\t\n\t\tforeach ($tag_list as $tag => $qty) \n\t\t{\n\t\t\t$size = $min_font_size + ($qty - $min_qty) * $step;\n\t\t\t$cloud_span[] = '<span class=\"' . $span_class . '\" style=\"font-size: '. $size . $font_units . '; line-height: '. $size . $font_units . '\"><a href=\"'.$tag_page_url . $tag . '\">' . $tag . '</a></span>';\n\n\t\t}\n\t\t\n\t\t$cloud_html = join(\"\\n \", $cloud_span);\n\n\t\treturn $cloud_html;\n\t}",
"public function getTagCloud()\n {\n $cacheKey = 'tag-cloud.cache';\n $tagCloud = $this->utils->cacheGet($cacheKey);\n\n if (null === $tagCloud) {\n $max = 0;\n $tags = [];\n\n foreach ($this->data['tags'] as $key => $items) {\n $tags[$key] = count($items);\n $max = ($max > count($items)) ? $max : count($items);\n }\n\n foreach ($tags as $key => $count) {\n $percent = floor(($count / $max) * 100);\n if ($percent < 20) {\n $class = 'x-small';\n } elseif ($this->utils->between($percent, 21, 40)) {\n $class = 'small';\n } elseif ($this->utils->between($percent, 41, 60)) {\n $class = 'medium';\n } elseif ($this->utils->between($percent, 61, 80)) {\n $class = 'large';\n } else {\n $class = 'larger';\n }\n $tags[$key] = $class;\n }\n\n $tagCloud = $this->utils->shuffle($tags);\n\n $this->cache->save($cacheKey, $tagCloud);\n }\n\n return $tagCloud;\n }",
"function nggTagCloud($args ='', $template = '') {\r\n global $nggRewrite;\r\n\r\n // $_GET from wp_query\r\n $tag = get_query_var('gallerytag');\r\n $pageid = get_query_var('pageid');\r\n \r\n // look for gallerytag variable \r\n if ( $pageid == get_the_ID() || !is_home() ) {\r\n if (!empty( $tag )) {\r\n \r\n $slug = esc_attr( $tag );\r\n $out = nggShowGalleryTags( $slug );\r\n return $out;\r\n } \r\n }\r\n \r\n $defaults = array(\r\n 'smallest' => 8, 'largest' => 22, 'unit' => 'pt', 'number' => 45,\r\n 'format' => 'flat', 'orderby' => 'name', 'order' => 'ASC',\r\n 'exclude' => '', 'include' => '', 'link' => 'view', 'taxonomy' => 'ngg_tag'\r\n );\r\n $args = wp_parse_args( $args, $defaults );\r\n\r\n $tags = get_terms( $args['taxonomy'], array_merge( $args, array( 'orderby' => 'count', 'order' => 'DESC' ) ) ); // Always query top tags\r\n\r\n foreach ($tags as $key => $tag ) {\r\n\r\n $tags[ $key ]->link = $nggRewrite->get_permalink(array ('gallerytag' => $tag->slug));\r\n $tags[ $key ]->id = $tag->term_id;\r\n }\r\n \r\n $out = '<div class=\"ngg-tagcloud\">' . wp_generate_tag_cloud( $tags, $args ) . '</div>';\r\n \r\n return $out;\r\n}",
"function delicious_tagcloud () {\r\n\r\n // Fetch the username, password and API URL from WordPress options.\r\n\r\n $username = get_option( 'di_delicious_username' );\r\n $password = get_option( 'di_delicious_password' );\r\n $tag_url = get_option( 'di_delicious_tag_url' );\r\n $timeout = get_option( 'di_timeout' );\r\n \r\n if ( ! $username || ! $password )\r\n return;\r\n\r\n // Get the tag information from del.icio.us.\r\n\r\n $xml = xml_cache( $tag_url, $username, $password, $timeout );\r\n\r\n // Get them into an array.\r\n\r\n $tags = array();\r\n $min = 1000000; // Bit of an assumption but, hey, whatever.\r\n $max = 0;\r\n \r\n foreach ( $xml as $element ) {\r\n\r\n if ( $element['tag'] == 'tag' ) {\r\n \r\n $tag = $element['attributes']['tag'];\r\n $count = $element['attributes']['count'];\r\n\r\n if ( $count < $min ) $min = $count;\r\n if ( $count > $max ) $max = $count;\r\n\r\n $tags[$tag] = $count;\r\n }\r\n } \r\n\r\n // Work out the ratio of font sizes.\r\n\r\n $scope = $max - $min;\r\n\r\n // Print out the del.icio.us tags as links.\r\n\r\n echo \"<div class=\\\"tagcloud\\\">\\n\";\r\n\r\n foreach ( $tags as $tag => $count ) {\r\n\r\n $font_size = (( $count - $min ) * 100 / $scope ) + 100;\r\n \r\n echo \"<a href=\\\"http://del.icio.us/$username/$tag\\\"\";\r\n echo \" style=\\\"font-size: $font_size%;\\\">$tag</a>\\n\";\r\n }\r\n\r\n echo \"</div>\\n\";\r\n}",
"function matteringpress_widget_tag_cloud_args( $args ) {\n\t$args['largest'] = 1;\n\t$args['smallest'] = 1;\n\t$args['unit'] = 'em';\n\t$args['format'] = 'list'; \n\n\treturn $args;\n}",
"function myfunc_filter_tag_cloud($args) {\n /*$args['smallest'] = 18;\n $args['largest'] = 32;\n $args['unit'] = 'px';*/\n $args['separator']= ', ';\n return $args;\n}",
"function recesswp_widget_tag_cloud_args($args)\n{\n $args['largest'] = 1;\n $args['smallest'] = 1;\n $args['unit'] = 'em';\n return $args;\n}",
"public function tagcloud() {\n\n \\Gino\\Loader::import('class', '\\Gino\\GTag');\n \t\n $this->_registry->addCss($this->_class_www.\"/blog_\".$this->_instance_name.\".css\");\n\n $tags_freq = \\Gino\\GTag::getTagsHistogram();\n \n\t\t$items = array();\n $max_f = 0;\n foreach($tags_freq as $tid=>$f) {\n \n \t$items[] = array(\n \"name\"=>\\Gino\\htmlChars($tid),\n \"url\"=>$this->link($this->_instance_name, 'archive', array('id'=>$tid)),\n \"f\"=>$f\n );\n $max_f = max($f, $max_f);\n }\n\n $view = new View($this->_view_dir);\n $view->setViewTpl('cloud_'.$this->_instance_name);\n \n $dict = array(\n 'instance_name' => $this->_instance_name,\n \t'items' => $items, \n \t'max_f' => $max_f\n );\n \n return $view->render($dict);\n }",
"function oublog_get_tag_cloud($baseurl, $oublog, $groupid, $cm, $oubloginstanceid, $individualid, $tagorder,\n $masterblog = null, $limit = null) {\n global $PAGE;\n $cloud = '';\n $currenttag = $PAGE->url->get_param('tag');\n $currentfiltertag = '';\n $urlparts= array();\n\n $baseurl = oublog_replace_url_param($baseurl, 'tag');\n $baseurl = oublog_replace_url_param($baseurl, 'taglimit');\n\n if (!$tags = oublog_get_tags($oublog, $groupid, $cm, $oubloginstanceid, $individualid, $tagorder, $masterblog, $limit)) {\n return [$cloud, $currentfiltertag];\n }\n\n $cloud .= html_writer::start_tag('div', array('class' => 'oublog-tag-items'));\n foreach ($tags as $tag) {\n if ($limit == -1) {\n $cloud .= '<a href=\"'.$baseurl.'&tag='.urlencode($tag->tag).\n '&taglimit='. urlencode($limit) . '\" class=\"oublog-tag-cloud-'.\n $tag->weight.'\"><span class=\"oublog-tagname\">'.strtr(($tag->tag), array(' '=>' ')).\n '</span><span class=\"oublog-tagcount\">('.$tag->count.')</span></a> ';\n } else {\n $cloud .= '<a href=\"'.$baseurl.'&tag='.urlencode($tag->tag).'\" class=\"oublog-tag-cloud-'.\n $tag->weight.'\"><span class=\"oublog-tagname\">'.strtr(($tag->tag), array(' '=>' ')).\n '</span><span class=\"oublog-tagcount\">('.$tag->count.')</span></a> ';\n }\n\n if (!is_null($currenttag) && $tag->tag == $currenttag) {\n $currentfiltertag = $tag;\n }\n }\n if (count($tags) >= OUBLOG_TAGS_SHOW && $limit != -1) {\n $showmore = get_string('tagshowmore', 'oublog');\n $cloud .= '<a href=\"'. $baseurl . '&taglimit=-1\" class=\"mod-oublog-tags-show-more\">' . $showmore . '</a>';\n }\n if ($limit == -1) {\n $showless = get_string('tagshowless', 'oublog');\n $cloud .= '<a href=\"'. $baseurl . '&taglimit=' . OUBLOG_TAGS_SHOW . '\" class=\"mod-oublog-tags-show-less\">' . $showless . '</a>';\n }\n $cloud .= html_writer::end_tag('div');\n\n return [$cloud, $currentfiltertag];\n}",
"function erric_widget_custom_tag_cloud($args) {\n\t// Control number of tags to be displayed - 0 no tags\n\t$args['number'] = 25;\n\n\t// Outputs our edited widget\n\treturn $args;\n}",
"function display_tagcloud($threshold = 1, $limit = 10, $metadata_name = \"\", $entity_type = \"object\", $entity_subtype = \"\", $owner_guid = \"\", $site_guid = -1) {\n\t\t\n\t\treturn elgg_view(\"output/tagcloud\",array('value' => get_tags($threshold, $limit, $metadata_name, $entity_type, $entity_subtype, $owner_guid, $site_guid),'object' => $entity_type, 'subtype' => $entity_subtype));\n\t\t\n\t}",
"function display_tagcloud($threshold = 1, $limit = 10, $metadata_name = \"\", $entity_type = \"object\",\n$entity_subtype = \"\", $owner_guid = \"\", $site_guid = -1, $start_ts = \"\", $end_ts = \"\") {\n\n\telgg_deprecated_notice('display_tagcloud() was deprecated by elgg_view_tagcloud()!', 1.8);\n\n\t$tags = get_tags($threshold, $limit, $metadata_name, $entity_type,\n\t\t$entity_subtype, $owner_guid, $site_guid, $start_ts, $end_ts);\n\n\treturn elgg_view('output/tagcloud', array(\n\t\t'value' => $tags,\n\t\t'type' => $entity_type,\n\t\t'subtype' => $entity_subtype,\n\t));\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Method to get a project object by name. | public function getProject($name)
{
try
{
// Attempt to get the project data object by the name or "unix name" in GForge speak.
$project = $this->client->getProjectByUnixName($this->sessionhash, $name);
return $project;
}
catch (SoapFault $e)
{
throw new RuntimeException('Unable to get project ' . $name . ': ' . $e->faultstring);
}
} | [
"public function project($name)\n\t{\n\t\tforeach ($this->projects() as $project)\n\t\t{\n\t\t\tif ($project['name'] == $name)\n\t\t\t{\n\t\t\t\treturn $project;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}",
"static function getProjectByName( $projectname ) {\n\t\t$project = new OpenStackNovaProject( $projectname );\n\t\tif ( $project->projectInfo ) {\n\t\t\treturn $project;\n\t\t} else {\n\t\t\treturn null;\n\t\t}\n\t}",
"protected function getProject()\r\n {\r\n $projectManager = $this->getService('cerad.project.repository');\r\n $projectParams = $this->getService('cerad_tourn.project');\r\n $projectEntity = $projectManager->findOneBy(array('hash' => $projectParams->getKey()));\r\n return $projectEntity;\r\n }",
"function just_get_project_from_request()\n{\n if (!isset($_REQUEST['project'])) {\n json_error_response(['error' => 'Valid project required']);\n return null;\n }\n $projectname = $_REQUEST['project'];\n $projectid = get_project_id($projectname);\n $service = ServiceContainer::getInstance();\n $Project = $service->get(Project::class);\n $Project->Id = $projectid;\n if (!$Project->Exists()) {\n json_error_response(['error' => 'Project does not exist']);\n return null;\n }\n return $Project;\n}",
"public static function getProject($id)\r\n\t\t{\r\n\t\t\tnew ClientDB();\r\n\t\t\t$sql = \"SELECT projectID, title, description, status, clientID FROM Project WHERE projectID = :id\";\r\n\t\t\t$params = array(':id' => array($id => PDO::PARAM_INT));\r\n\t\t\t$result = parent::get($sql, $params);\r\n\t\t\t$result = $result[0];\r\n\r\n\t\t\t$client = ClientDB::getClient($result['clientID']);\r\n\r\n\t\t\t$project = new Project($result['title'], $result['description'], $result['status'], $client);\r\n\r\n\t\t\treturn $project;\r\n\t\t}",
"public function getProject()\n\t{\n\t\t$key = $this->getProjectId();\n\n\t\tif(empty($key))\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\t\treturn \\b8\\Store\\Factory::getStore('Project')->getById($key);\n\t}",
"public static function getById($id)\n {\n $sql = \"SELECT * FROM projects WHERE id = \".$id;\n $project = self::model()->findBySql($sql);\n\n return $project;\n }",
"public static final function getRegisteredProject($project_name) {\r\n if (isset(self::$REGISTERED_PRROJECT_INSTANCES[$project_name])) {\r\n return self::$REGISTERED_PRROJECT_INSTANCES[$project_name];\r\n } else {\r\n throw new ProjectNotFoundException(sprintf(\"The project \\\"%s\\\" NOT registered.\", $project_name));\r\n }\r\n }",
"function project()\n {\n if (empty(Input::get('projectToken', ''))) {\n return null;\n }\n $projectRepository = app()->make(Knoters\\Repositories\\ProjectRepository::class);\n\n return $projectRepository->findBy(['uuid' => Input::get('projectToken')]);\n }",
"public function getProject() {\n\t\t$query = '/project';\n\t\t$items = $this->xpath->query($query);\n\t\treturn new Loader_Project($items->item(0), $this->xpath, dirname($this->filePath));\n\t}",
"public function get($id) {\n $sql =<<<SQL\nSELECT * from $this->tableName\nwhere id = ?\nSQL;\n $pdo = $this->pdo();\n $statement = $pdo->prepare($sql);\n $statement->execute(array($id));\n if($statement->rowCount() === 0) {\n return null;\n }\n\n return new Project($statement->fetch(PDO::FETCH_ASSOC));\n }",
"protected function getRequestedProject()\n {\n $id = $this->getEvent()->getRouteMatch()->getParam('project');\n $p4Admin = $this->getServiceLocator()->get('p4_admin');\n\n // attempt to retrieve the specified project\n // translate invalid/missing id's into a 404\n try {\n return Project::fetch($id, $p4Admin);\n } catch (NotFoundException $e) {\n } catch (\\InvalidArgumentException $e) {\n }\n\n $this->getResponse()->setStatusCode(404);\n return false;\n }",
"public function project(): object;",
"public function getRecord($proj_name) {\n\t\ttry {\n\t\t\t$connection = new Mongo(\"localhost\");\n\t\t\t$collection = $connection->test->stem1;\n\n\t\t\t$obj = $collection->findOne(array('project' => $proj_name) );\n\t\t\treturn $obj;\n\n\t\t\t$connection->close();\n\t\t}\n\t\tcatch (MongoConnectionException $e) {\n\t\t\tdie('Error connecting to MongoDB server');\n\t\t} catch (MongoException $e) {\n\t\t\tdie('Error: ' . $e->getMessage());\n\t\t}\n\t}",
"public static function getProject($pid) {\n $db = DB::getInstance();\n $q = \"SELECT * FROM Project WHERE pid=:p;\";\n $entries = array(\":p\" => $pid);\n $results = $db->runSelect($q, $entries);\n $tags = self::getProjectTags($pid);\n if ($results) {\n $row = $results[0]; //only one project with given pid\n $project = new Project(\n $row['pid'],\n $row['username'],\n $row['pname'],\n $row['description'],\n $row['post_time'],\n $row['proj_completed'],\n $row['completion_time'],\n $row['minfunds'],\n $row['maxfunds'],\n $row['camp_end_time'],\n $row['camp_finished'],\n $row['camp_success'],\n $tags\n );\n return $project;\n } else {\n return null;\n }\n }",
"function hpwallart_get_project_by_id($id) {\r\n $query = db_query('SELECT * FROM {hpwallart_projects} WHERE id = :id', array(':id' => $id));\r\n $result = $query->fetchObject();\r\n return new HPWallArtProject($result);\r\n}",
"public function getProject($id){\n $project = $this->getDoctrine()\n ->getRepository('AdminBundle:Project')\n ->find($id);\n\n if (!$project) {\n throw $this->createNotFoundException(\n 'No Project found !!!'\n );\n }\n else{\n return $project;\n }\n }",
"function getProject() {\n\t\t// Pokud byl predtim promo naassignovanej projekt\n\t\tif(is_object($this->data->project) || $this->data->project === null) return $this->data->project;\n\t\t\n\t\tif(($cached = $this->fieldCache(\"project\")) !== null) return $cached;\n\t\t\n\t\t$value = $this->context->repository->findAll('vManager\\Modules\\Tickets\\Project')\n\t\t\t->where('[revision] > 0 AND [projectId] = %i', $this->data->project)->fetch();\n\t\t\n\t\tif(!$value) return null;\t\t\n\t\treturn $this->fieldCache(\"project\", $value);\n\t}",
"public function getProject($id);"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Submit handler for the unpublish changeset form. | function cps_changeset_unpublish_changeset_form_submit($form, &$form_state) {
// We have to tell batch where to include this file.
$batch = array(
'operations' => array(
array('cps_changeset_publish_batch_lock', array()),
array('cps_changeset_unpublish_batch_variables', array($form_state['entity'], $form_state['previous'])),
array('cps_changeset_unpublish_batch_entity', array()),
),
'finished' => 'cps_changeset_unpublish_batch_finished',
'title' => t('Reverting %changeset', array('%changeset' => $form_state['entity']->name)),
'file' => drupal_get_path('module', 'cps') . '/includes/forms.inc',
);
drupal_alter('cps_unpublish_changeset_batch', $batch, $form_state);
batch_set($batch);
$form_state['redirect'] = $form_state['entity']->uri();
} | [
"function unpublish()\n {\n $detail = JRequest::get('POST');\n $model = $this->getModel('category');\n $model->changeStatus($detail);\n $this->setRedirect('index.php?option=' . JRequest::getVar('option') . '&layout=category');\n }",
"function unpublish()\r\n\t{\r\n\t\t$cid \t= JRequest::getVar( 'cid', array(0), 'post', 'array' );\r\n\r\n\t\tif (!is_array( $cid ) || count( $cid ) < 1) {\r\n\t\t\tJError::raiseError(500, JText::_( 'Select an item to unpublish' ) );\r\n\t\t}\r\n\r\n\t\t$model = $this->getModel('venues');\r\n\t\tif(!$model->publish($cid, 0)) {\r\n\t\t\techo \"<script> alert('\".$model->getError().\"'); window.history.go(-1); </script>\\n\";\r\n\t\t}\r\n\r\n\t\t$total = count( $cid );\r\n\t\t$msg \t= $total.' '.JText::_('VENUE UNPUBLISHED');\r\n\r\n\t\t$this->setRedirect( 'index.php?option=com_eventlist&view=venues', $msg );\r\n\t}",
"function unpublish()\n\t{\n\t\t// Check for request forgeries\n\t\tJRequest::checkToken() or jexit( 'Invalid Token' );\n\t\t\n\t\t$cid \t= JRequest::getVar( 'cid', array(0), 'post', 'array' );\n\n\t\tif (!is_array( $cid ) || count( $cid ) < 1) {\n\t\t\t$msg = '';\n\t\t\tJError::raiseWarning(500, JText::_( 'SELECT ITEM UNPUBLISH' ) );\n\t\t} else {\n\n\t\t\t$model = $this->getModel('categories');\n\n\t\t\tif(!$model->publish($cid, 0)) {\n\t\t\t\tJError::raiseError(500, $model->getError());\n\t\t\t}\n\n\t\t\t$msg \t= JText::_( 'CATEGORY UNPUBLISHED');\n\t\t\n\t\t\t$cache = &JFactory::getCache('com_quickfaq');\n\t\t\t$cache->clean();\n\t\t}\n\t\t\n\t\t$this->setRedirect( 'index.php?option=com_quickfaq&view=categories', $msg );\n\t}",
"function cps_review_unpublish_page(CPSReview $entity) {\n $form_state = array(\n 'entity' => $entity,\n ) + form_state_defaults();\n\n form_load_include($form_state, 'inc', 'cps_review', 'includes/forms');\n $output = drupal_build_form('cps_review_unpublish_form', $form_state);\n return $output;\n}",
"public function unpublish()\n {\n return $this->update([\n 'status' => false,\n 'published' => null\n ]);\n }",
"public function unpublish()\n\t{\n\t\tparent::unpublish();\n\t}",
"public function handleUnpublishPostRequest() : ApiResponse\n {\n $postId = $this->requestStack->getCurrentRequest()->request\n ->getInt(RequestFieldsBag::UNPUBLISH_POST_ID_FIELD);\n\n $apiResponse = new ApiResponse();\n\n if (\\is_numeric($postId)) {\n $foundPostsResponse = $this->postTypeRepository\n ->execSearch(['query' => ['match' => ['id' => $postId]]]);\n $totalPosts = $foundPostsResponse['hits']['total'] ?? null;\n\n if ($totalPosts > 0) {\n $foundPosts = $foundPostsResponse['hits']['hits'] ?? [];\n\n foreach ($foundPosts as $foundPost) {\n $this->postTypeRepository->execUpdate([\n 'id' => $foundPost['_id'],\n 'body' => ['doc' => ['isDeleted' => true]]\n ]);\n }\n\n return $apiResponse;\n }\n\n return $apiResponse->setContent(sprintf(MessageBag::NO_POSTS_FOUNT_TO_UNPUBLISH, $postId));\n }\n\n return $apiResponse\n ->setContent(MessageBag::POST_ID_NOT_RECEIVED)\n ->setStatusCode(Response::HTTP_BAD_REQUEST);\n }",
"public function unPublish()\n {\n $this->published = false;\n }",
"public function onAfterUnpublish()\n {\n foreach ($this->owner->Fields() as $field) {\n $field->deleteFromStage(Versioned::LIVE);\n }\n }",
"public function doUnpublish()\n {\n if ($this->canDeleteFromLive()) {\n $this->extend('onBeforeUnpublish');\n\n $origStage = Versioned::current_stage();\n Versioned::reading_stage('Live');\n\n // This way our ID won't be unset\n $clone = clone $this;\n $clone->delete();\n\n Versioned::reading_stage($origStage);\n\n return \"{$this->Title} unpublished successfully\";\n }\n\n return \"Failed to unpublish {$this->i18n_singular_name()} \";\n }",
"public function unpublish()\n {\n if($this->userHasPrivilege('publish'))\n {\n $this['status'] = 'draft';\n $this->save();\n }\n }",
"function UnpublishPost()\n\t{\n\t\t$b = $this->GetBlog();\n\t\t$p = PostData::Load( $this->args->post );\n\t\tif (!$p || $p->GetAuthor() != $b->GetAuthor()) {\n\t\t\t$this->html = \"Invalid post ID\";\n\t\t\treturn;\n\t\t}\n\t\tif ($this->method != \"POST\") {\n\t\t\t$this->html = \"Invalid method\";\n\t\t\treturn;\n\t\t}\n\t\tCache::remove( \"full_post_\" . $p->id );\n\t\t$p->SetState( \"draft\" );\n\t\t$p->Save();\n\t\t$l = LinkData::Load( $p->GetLinkId() );\n\t\tif ($l) {\n\t\t\t$l->SetType( \"draft\" );\n\t\t\t$l->Save();\n\t\t}\n\t}",
"public function unpublishTask()\n\t{\n\t\t$this->stateTask(0);\n\t}",
"public function onAfterPublish()\n {\n // store IDs of fields we've published\n $seenIDs = [];\n foreach ($this->owner->Fields() as $field) {\n // store any IDs of fields we publish so we don't unpublish them\n $seenIDs[] = $field->ID;\n $field->publishRecursive();\n $field->destroy();\n }\n\n // fetch any orphaned live records\n $live = Versioned::get_by_stage(EditableFormField::class, Versioned::LIVE)\n ->filter([\n 'ParentID' => $this->owner->ID,\n 'ParentClass' => get_class($this->owner),\n ]);\n\n if (!empty($seenIDs)) {\n $live = $live->exclude([\n 'ID' => $seenIDs,\n ]);\n }\n\n // delete orphaned records\n foreach ($live as $field) {\n $field->deleteFromStage(Versioned::LIVE);\n $field->destroy();\n }\n }",
"function trigger_unassign_submit($form, &$form_state) {\n if ($form_state['values']['confirm'] == 1) {\n $aid = actions_function_lookup($form_state['values']['aid']);\n db_delete('trigger_assignments')\n ->condition('hook', $form_state['values']['hook'])\n ->condition('aid', $aid)\n ->execute();\n $actions = actions_get_all_actions();\n \\Drupal::logger('actions')->notice('Action %action has been unassigned.', array('%action' => $actions[$aid]['label']));\n drupal_set_message(t('Action %action has been unassigned.', array('%action' => $actions[$aid]['label'])));\n $form_state['redirect'] = 'admin/structure/trigger/' . $form_state['values']['module'];\n }\n else {\n drupal_goto('admin/structure/trigger');\n }\n}",
"function remove_iwacontact_submission_publish() {\n\tremove_meta_box( 'submitdiv', 'iwacontactsubmission', 'side' ); \n}",
"public function actionUnpublishItems()\n {\n $civ = CatalogItemVariant::find()\n ->where(['published' => 0])\n ->asArray()\n ->all();\n\n if (!empty($civ)) {\n foreach ($civ as $ci) {\n $oCi = CatalogItem::findOne(['id' => $ci['product_id'], 'published' => 1]);\n if (!empty($oCi)) {\n $oCi->published = 0;\n $oCi->save();\n echo 'Unpublished catalog item id: ' . $ci['product_id'] . PHP_EOL;\n }\n }\n \n }\n }",
"function cps_changeset_publish_changeset_form($form, &$form_state) {\n $form['warning'] = array(\n '#markup' => '<div class=\"publish-warning\">' . t('Are you sure you want to publish this? This action cannot be undone!') . '</div>',\n );\n\n $form['actions']['publish'] = array(\n '#type' => 'submit',\n '#value' => t('Publish'),\n );\n\n $form['actions']['cancel'] = array(\n '#type' => 'submit',\n '#value' => t('Cancel'),\n '#limit_validation_errors' => array(),\n '#submit' => array('cps_changeset_publish_changeset_form_cancel'),\n );\n\n return $form;\n}",
"public static function remove_publish_meta_box() {\n\t\tremove_meta_box( 'submitdiv', self::POST_TYPE_SLUG, 'side' );\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function to link tags to a specific journal entry | function link_tags($entry_id, $tags) {
include('connection.php');
// first delete existing links
try {
$sql = 'DELETE FROM entries_tags WHERE entry_id = ?';
$results = $db->prepare($sql);
$results->bindValue(1, $entry_id, PDO::PARAM_INT);
$results->execute();
} catch(Exception $ex) {
echo $ex->get_message();
}
try {
foreach ($tags as $tag) {
$sql = 'INSERT INTO entries_tags("entry_id", "tag_id") VALUES(?, ?)';
$results = $db->prepare($sql);
$results->bindValue(1, $entry_id, PDO::PARAM_INT);
$results->bindValue(2, $tag, PDO::PARAM_INT);
$results->execute();
}
} catch (Exception $ex) {
echo $ex->get_message();
}
return true;
} | [
"public function linkTag($tag)\n\t{\n\t\tif (empty($tag))\n\t\t\treturn false;\n\n\t\t$tagInstance = Tag::findByName($tag);\n\t\tif (is_null($tagInstance))\n\t\t\t$tagInstance = Tag::createNew($tag);\n\n\t\t$connection = \\Yii::$app->db;\n\t\t$connection->createCommand()->insert('note_tag', array(\n\t\t\t'note_id' \t=> $this->id, \n\t\t\t'tag_id' \t=> $tagInstance->id\n\t\t))->execute();\n\t}",
"function get_tag_link($tag)\n {\n }",
"function linkTags($tags)\n{\n\t$tags = explode(\", \", $tags);\n\tforeach ($tags as $k => $tag) $tags[$k] = \"<a href='\" . makeLink(\"search\", \"?q2=tag:$tag\") . \"'>$tag</a>\";\n\treturn implode(\", \", $tags);\n}",
"function addTagToEntryList($id_list, $tag_text){\n\t\t$id_tag = $this->getTagId($tag_text);\n\t\tif (!$id_tag){\n\t\t\t$this->createTag($tag_text);\n\t\t\t$id_tag = $this->getTagId($tag_text);\n\t\t}\n\t\t$this->attachTagToEntryList($id_list, $id_tag);\n\t}",
"public function tag($tag)\n\t{\n\t\t$article_ids = $this->daptags->get_article_ids_by_tag(urldecode($tag));\n\t\t$data['articles'] = $this->article_m->get_many($article_ids);\n\t\t$this->load->view('tags_articles_by_tags', $data);\n\t}",
"function ozh_ta_linkify_local( &$tag, $key, $nofollow ) {\r\n\t$tag = '<a href=\"'.ozh_ta_get_tag_link( $tag ).'\">#'.$tag.'</a>';\r\n}",
"public function addTag();",
"public function tag() {\n require_once($_SERVER['DOCUMENT_ROOT'].'/Flint/model/project.php');\n $tag_name = $_GET['tag'];\n $tag_name = htmlspecialchars($tag_name, ENT_QUOTES, 'UTF-8');\n //log tag view\n require_once($_SERVER['DOCUMENT_ROOT'].'/Flint/model/view_log.php');\n ViewLog::logTagView($_SESSION['username'], $tag_name);\n //get projects matching that tag\n $projects = Project::getProjectsByTagName($tag_name);\n require_once($_SERVER['DOCUMENT_ROOT'].'/Flint/view/pages/tag_view.php');\n }",
"function add_tags($tags, $entry_id) {\n include('connection.php');\n\n $tags_arr = array_map(function($t) {return trim($t);}, explode(',', $tags));\n //Get all the tags in the tags table\n $tags_list = get_tags();\n //Get all the tags associated with the entry\n $entry_tags = array_map(function($t) { return $t['name'];}, get_tags_per_entry($entry_id));\n\n foreach ($tags_arr as $tag) {\n //Check if $tag is already in the tags table\n if (!in_array($tag, $tags_list)) {\n //if not, add the tag to the tags table\n $tag_id = add_single_tag($tag);\n } else {\n //otherwise get the id of the tag\n $tag_id = get_tag_id($tag)['id']; \n }\n\n //Check if $tag is already associated to the entry\n if (!in_array($tag, $entry_tags)) {\n //if not, add the entry id and the tag id to the enries_tags table\n try {\n $result = $db->prepare('INSERT INTO entries_tags (entries_id, tags_id) VALUES (?, ?)');\n $result->bindValue(1, $entry_id, PDO::PARAM_INT);\n $result->bindValue(2, $tag_id, PDO::PARAM_INT);\n $result->execute();\n } catch (Exception $e) {\n $e->getMessage();\n }\n }\n }\n\n foreach ($entry_tags as $tag1) {\n //Check if the user removes a tag for the selected entry\n if (!in_array($tag1, $tags_arr)) {\n //if so get the tag id\n $tag_id = get_tag_id($tag1)['id'];\n //and remove all rows with the current $entry_id and $tag_id\n $result1 = delete_entry_tag($entry_id, $tag_id);\n }\n }\n\n return true;\n}",
"function get_entries_by_tag($tag_id) {\n include('dbconnect.php');\n \n $sql = 'SELECT * FROM entries\n INNER JOIN entries_tags_link\n ON entries.id = entries_tags_link.entry_id\n WHERE entries_tags_link.tag_id = ? ORDER BY date DESC'; \n try {\n $results = $db->prepare($sql);\n $results->bindValue(1,$tag_id,PDO::PARAM_INT);\n $results->execute();\n return $results->fetchAll(PDO::FETCH_ASSOC);\n } catch (Exception $e) {\n echo $e->getMessage();\n return false;\n } \n}",
"public function tag()\n\t{\n\t\t$_slug = preg_replace( '#' . app_setting( 'url', 'shop' ) . 'tag/?#', '', uri_string() );\n\n\t\tif ( $_slug ) :\n\n\t\t\t$this->_tag_single( $_slug );\n\n\t\telse :\n\n\t\t\t$this->_tag_index();\n\n\t\tendif;\n\t}",
"private function manage_tags($tags,$post_id){\n foreach($tags as $tag){\n $tag = Tag::get_by_id($tag);\n $tag->link_tag($post_id); \n }\n \n }",
"public function linkToTags($quoteID, $tags) {\n // Create an array of tags and trim any extra spaces out\n $tagArray = explode(',',$tags);\n\n // Do an upsert to make sure all tags actually exist in the lookup table\n $quoteTags = new Datasource_Cms_HeaderQuote_Tags();\n $quoteTags->upsert($tagArray);\n\n // Delete current tag links for this testimonial\n $this->clearLinksToTags($quoteID);\n\n $quoteTagMap = new Datasource_Cms_HeaderQuote_TagMap();\n // Now loop through and link the testimonial to the tag\n\n foreach ($tagArray as $tag) {\n $tagID = $quoteTags->getId($tag);\n $quoteTagMap->addMap($quoteID, $tagID);\n }\n }",
"public function tag()\n\t{\n\t\t$crud = $this->generate_crud('blog_tags');\n\t\t$this->mPageTitle = 'Blog Tags';\n\t\t$this->render_crud();\n\t}",
"function attach_tags($tags_ary, $resource_id)\n\t{\n\t\tforeach ($tags_ary as $key => $val)\n\t\t{\n\t\t\t# Remove any white space from the tag, and if that leaves an\n\t\t\t# empty element (eg if user's typed ;;, or ; ; or similar)\n\t\t\t# then remove it from the array \n\t\t\t$val = trim($val);\n\t\t\tif (empty($val))\n\t\t\t\t{ unset($tags_ary[$key]); }\n\t\t\t# Now check if the tag already exists in the KEYWORD table, and if not add it\n\t\t\t$q = $this -> ResourceDB_model -> get_tag_id($val); \n\t\t\t# If it's not there add it to the KEYWORD table and get the new ID\n\t\t\tif ($q -> num_rows() == 0)\n\t\t\t{\n\t\t\t\t# Get ID of inserted tag\n\t\t\t\t$tag_id = $this -> Edit_model -> add_tag($val);\n\t\t\t}\n\t\t\t# If tag's already in KEYWORD, just get its ID\n\t\t\telse\n\t\t\t{\n\t\t\t\t# Get ID of existing tag\n\t\t\t\t$tag_id = $q -> row() -> id;\t\n\t\t\t}\n\t\t\t# Now put the tag ID in to the junction table with the resource ID\n\t\t\t# The model function checks if tag already attached\n\t\t\t$this -> Edit_model -> attach_tag($resource_id, $tag_id);\n\t\t}\t\t\n\t\t\n\t}",
"function deleteTagLinks($entry, $tags){\n\t\t\n\t\t$sql = \"DELETE entry2tag \n\t\t\t\tFROM entry2tag, tags \n\t\t\t\tWHERE id_entry = :id_entry\n\t\t\t\tAND tags.tag_text = :tag_text\n\t\t\t\tAND entry2tag.id_tag = tags.id_tag\";\n\t\ttry{\n\t\t\t$query = $this->db->prepare($sql);\n\t\t\tforeach ($tags as $tag){\n\t\t\t\t$query->execute(array(':id_entry' => $entry->getId(),\n\t\t\t\t\t\t\t\t\t ':tag_text' => $tag->getTagText()));\n\t\t\t}\t\t\t\t\t\t \n\t\t}catch (PDOException $e) {\n\t\t\treturn $e->getMessage();\n\t\t}\t\t\t\n\t}",
"public function addLink($bucket, $key, $tag)\n {\n return '</buckets/' . $bucket . '/keys/' . $key . '>; riaktag=\"' . $tag . '\"';\n }",
"function add_tag($ContactId, $TagId) {\r\n }",
"function entry_tags($between=', ',$before='',$after='',$extra=false) {\r\n\t$tags = get_entry_tags();\r\n\tif($extra) {\r\n\t\tparse_str($extra,$args);\r\n\t}\r\n\tif(!empty($tags[0])) {\r\n\t\tforeach($tags as $tag) {\r\n\t\t\tif($args['admin'] == \"true\")\r\n\t\t\t\t$start_link = \"<a href=\\\"tags.php?req=edit&id=\".$tag['ID'].\"\\\">\";\r\n\t\t\telse {\r\n\t\t\t\tif(defined('BJ_REWRITE'))\r\n\t\t\t\t\t$start_link = \"<a href=\\\"\".get_siteinfo('siteurl').\"tag/\".$tag['shortname'].\"\\\">\";\r\n\t\t\t\telse\r\n\t\t\t\t\t$start_link = \"<a href=\\\"\".get_siteinfo('siteurl').\"index.php?load=tag/\".$tag['shortname'].\"\\\">\";\r\n\t\t\t}\r\n\t\t\t$text .= $before.$start_link.$tag['name'].\"</a>\".$after.$between;\r\n\t\t}\r\n\t\techo preg_replace('{'.$between.'$}', '', $text);\r\n\t}\r\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
setOedhpricovrd() Set the value of [oedhpickflag] column. | public function setOedhpickflag($v)
{
if ($v !== null) {
$v = (string) $v;
}
if ($this->oedhpickflag !== $v) {
$this->oedhpickflag = $v;
$this->modifiedColumns[SalesHistoryDetailTableMap::COL_OEDHPICKFLAG] = true;
}
return $this;
} | [
"public function setOedtpickflag($v)\n {\n if ($v !== null) {\n $v = (string) $v;\n }\n\n if ($this->oedtpickflag !== $v) {\n $this->oedtpickflag = $v;\n $this->modifiedColumns[SalesOrderDetailTableMap::COL_OEDTPICKFLAG] = true;\n }\n\n return $this;\n }",
"public function getOedtpickflag()\n {\n return $this->oedtpickflag;\n }",
"public function setOn($flag = true);",
"public function setOedtkitflag($v)\n {\n if ($v !== null) {\n $v = (string) $v;\n }\n\n if ($this->oedtkitflag !== $v) {\n $this->oedtkitflag = $v;\n $this->modifiedColumns[SoDetailTableMap::COL_OEDTKITFLAG] = true;\n }\n\n return $this;\n }",
"public function getOedhkitflag()\n {\n return $this->oedhkitflag;\n }",
"public function setFlag( $flag );",
"public function getOehderflag()\n {\n return $this->oehderflag;\n }",
"public static function setEpisodicMode($project,$value = true){\n if (!$project->getIsEpisodic())\n return false;\n Yii::app()->user->setState('episodic_mode_'.$project->id, $value);\n }",
"public function testSetOrphelin() {\n\n $obj = new Employes();\n\n $obj->setOrphelin(true);\n $this->assertEquals(true, $obj->getOrphelin());\n }",
"public function getOedterflag()\n {\n return $this->oedterflag;\n }",
"public function dm_set_flag($flag, $value)\n\t{\n\t\t$this->dm_flags[$flag] = $value;\n\t}",
"function fdf_set_flags($fdfdoc, $fieldname, $whichflags, $newflags) {}",
"public function setFlag() {\n $this->attributes['test_flag'] = TRUE;\n }",
"public function setOedtcorepric($v)\n {\n if ($v !== null) {\n $v = (string) $v;\n }\n\n if ($this->oedtcorepric !== $v) {\n $this->oedtcorepric = $v;\n $this->modifiedColumns[SoDetailTableMap::COL_OEDTCOREPRIC] = true;\n }\n\n return $this;\n }",
"public function setOedtshipflag($v)\n {\n if ($v !== null) {\n $v = (string) $v;\n }\n\n if ($this->oedtshipflag !== $v) {\n $this->oedtshipflag = $v;\n $this->modifiedColumns[SoDetailTableMap::COL_OEDTSHIPFLAG] = true;\n }\n\n return $this;\n }",
"function setEditData($flag=TRUE) {\n if($flag)\n $this->_editData = 1;\n else\n $this->_editData = 0;\n }",
"public function setOverwrite($on = true)\n\t{\n\t\t$this->overwriteValue = (bool) $on;\n\t}",
"public function setOedhcorepric($v)\n {\n if ($v !== null) {\n $v = (string) $v;\n }\n\n if ($this->oedhcorepric !== $v) {\n $this->oedhcorepric = $v;\n $this->modifiedColumns[SalesHistoryDetailTableMap::COL_OEDHCOREPRIC] = true;\n }\n\n return $this;\n }",
"function ChangeFlag($flag, $set){}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
$driveService = new Google_Service_Drive($client); $parentFolderId = getApplicationFolder($driveService); printf($parentFolderId); createApplicantFolder($driveService, $parentFolderId, "Mihir"); | function createApplicantFolder($driveService, $parentFolderId, $studentName)
{
//create applicant folder on google drive
$folderMetadata = new Google_Service_Drive_DriveFile(array(
'name' => $studentName,
'mimeType' => 'application/vnd.google-apps.folder',
'parents' => array($parentFolderId)));
$folder = $driveService->files->create($folderMetadata, array(
'mimeType' => 'application/vnd.google-apps.folder',
'uploadType' => 'multipart',
'fields' => 'id'));
//upload resume to cPanel
$targetCpanelfolder = "resumes/";
$targetCpanelfolder = $targetCpanelfolder . basename( $_FILES['file']['name']) ;
$ok = 1;
$file_type=$_FILES['file']['type'];
if ($file_type=="application/pdf")
{
if(move_uploaded_file($_FILES['file']['tmp_name'], $targetCpanelfolder))
{
echo "The file ". basename( $_FILES['file']['name']). " is uploaded";
}
else
{
echo "Problem uploading file";
}
}
else
{
echo "You may only upload PDFs.<br>";
}
//upload resume to google drive
$fileMetadata = new Google_Service_Drive_DriveFile(array(
'name' => 'resume.pdf',
'parents' => array($folder->id)
));
$content = file_get_contents('resume/'.basename( $_FILES['file']['name']));
$file = $driveService->files->insert($fileMetadata, array(
'data' => $content,
'mimeType' => 'application/pdf',
'uploadType' => 'multipart',
'fields' => 'id'));
echo "Uploaded!";
} | [
"function send_google_drive($id,$fileno,$filename){\n\t\t\tglobal $wpdb;\n\t\t\trequire(ABSPATH.'/wp-content/themes/enemat/googledrives/vendor/autoload.php');\n\t\t\t$client = getClient();\n\t\t\t$service = new Google_Service_Drive($client);\n\t\t\t$results = $service->files->listFiles();\n\t\t\t$parentfolders = get_option(\"parentfolders\");\n\t\t\t\t$crmfolders = get_option(\"crmfolders\");\n\t\t\ttry{\n\t\t\t\t$service = new Google_Service_Drive($client);\n\t\t\t\t//===Root Folder's Sub Folder======//\n\t\t\t\t$results = $service->files->listFiles(\n\t\t\t\t\t['q' => \"name = '$parentfolders' and mimeType = 'application/vnd.google-apps.folder'\"] // Get only folder with name equal $parentfolders value\n\t\t\t\t);\n\t\t\t\t$parents = \"\";\n\t\t\t\tforeach ($results->getFiles() as $item) {\n\t\t\t\t\tif ($item['name'] == $parentfolders) {\n\t\t\t\t\t\t\t$parents = $item['id'];\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t $optParams = array(\n\t\t\t\t\t'pageSize' => 10,\n\t\t\t\t\t'fields' => \"nextPageToken, files(contentHints/thumbnail,fileExtension,iconLink,id,name,size,thumbnailLink,webContentLink,webViewLink,mimeType,parents)\",\n\t\t\t\t\t'q' => \"'\".$parents.\"' in parents\"\n\t\t\t\t);\n\t\t\t $results = $service->files->listFiles($optParams);\n\t\t\t $parentsarray = array();\n\t\t\t foreach ($results->getFiles() as $item) {\n\t\t\t\t\t$parentsarray[$item['name']] = $item->getId();\t\t \n\t\t\t }\n\t\t\t $parentid = $parentsarray[$crmfolders];\n\t\t\t//===Root Folder's Sub Folder======//\n\t\t\t//===Sub Folder's Folders======//\n\t\t\t$optParams1 = array(\n\t\t\t\t'pageSize' => 10,\n\t\t\t\t'fields' => \"nextPageToken, files(contentHints/thumbnail,fileExtension,iconLink,id,name,size,thumbnailLink,webContentLink,webViewLink,mimeType,parents)\",\n\t\t\t\t'q' => \"'\".$parentid.\"' in parents\"\n\t\t\t);\n\t\t\t$results = $service->files->listFiles($optParams1);\n\t\t\t//===Sub Folder's Folders======//\t\n\t\t\t//==========CREATE FOLDER====//\n\t\t\t$childid = \"\";\n\t\t\tforeach ($results->getFiles() as $item) {\n\t\t\t\tif ($item['name'] == $fileno) {\n\t\t\t\t\t$childid = $item['id'];\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t}\n\t\t\tif(empty($childid)){\n\t\t\t\t$fileMetadata = new Google_Service_Drive_DriveFile(array(\n\t\t\t\t\t\t\t\t\t'name' => $fileno,\n\t\t\t\t\t\t\t\t\t'parents'=>array($parentid),\n\t\t\t\t\t\t\t\t\t'mimeType' => 'application/vnd.google-apps.folder'));\n\t\t\t\t\t\t\t\t\t$file = $service->files->create($fileMetadata, array(\n\t\t\t\t\t\t\t\t\t'fields' => 'id'));\n\t\t\t\t $folderId = $file->id;\n\t\t\t }else{\n\t\t\t\t$folderId = $childid;\n\t\t\t }\n\t\t\t $newPermission = new Google_Service_Drive_Permission();\n\t\t\t $newPermission->setType('anyone');\n\t\t\t $newPermission->setRole('reader');\n\t\t\t $service->permissions->create($folderId, $newPermission);\n\t\t\t if(!empty($filename)){\n\t\t\t\ttry{\n\t\t\t\t\t$fileMetadata = new Google_Service_Drive_DriveFile(array(\n\t\t\t\t\t\t\t\t'name' => \"OFFRE DE PRIME - \".$fileno.\"\",\n\t\t\t\t\t\t\t\t'parents' => array($folderId)\n\t\t\t\t\t\t\t));\n\t\t\t\t\t$content = file_get_contents($filename);\n\t\t\t\t\t$files = $service->files->create($fileMetadata, array(\n\t\t\t\t\t\t\t\t\t'data' => $content,\n\t\t\t\t\t\t\t\t\t'uploadType' => 'resumable',\n\t\t\t\t\t\t\t\t\t'fields' => 'id'));\t\n\t\t\t\t\t$fileids = $files->id; \n\t\t\t\t\t$newPermission = new Google_Service_Drive_Permission();\n\t\t\t\t\t$newPermission->setType('anyone');\n\t\t\t\t\t$newPermission->setRole('reader');\n\t\t\t\t\t$service->permissions->create($fileids, $newPermission);\n\t\t\t\t}catch (Google_ServiceException $e) {\n\t\t\t\t $file_save = false;\n\t\t\t\t file_put_contents(ABSPATH.\"wp-content/themes/enemat/ajax_scripts/error_logs.txt\",$e->getMessage(),FILE_APPEND);\n\t\t\t\t}catch (Google_IOException $e) {\n\t\t\t\t $file_save = false;\n\t\t\t\t file_put_contents(ABSPATH.\"wp-content/themes/enemat/ajax_scripts/error_logs.txt\",$e->getMessage(),FILE_APPEND);\n\t\t\t\t} catch (Google_Exception $e) {\n\t\t\t\t $file_save = false;\n\t\t\t\t file_put_contents(ABSPATH.\"wp-content/themes/enemat/ajax_scripts/error_logs.txt\",$e->getMessage(),FILE_APPEND);\n\t\t\t\t}catch (Exception $e) {\n\t\t\t\t\t$file_save = false;\n\t\t\t\t\tfile_put_contents(ABSPATH.\"wp-content/themes/enemat/ajax_scripts/error_logs.txt\",$e->getMessage(),FILE_APPEND);\n\t\t\t\t}\t\n\t\t\t}\n\t\t\t$driveurls = \"https://drive.google.com/open?id=\".$fileids.\"\";\n\t\t\t}catch (Google_ServiceException $e) {\n\t\t\t\t $file_save = false;\n\t\t\t\t file_put_contents(ABSPATH.\"wp-content/themes/enemat/ajax_scripts/error_logs.txt\",$e->getMessage(),FILE_APPEND);\n\t\t\t\t}catch (Google_IOException $e) {\n\t\t\t\t $file_save = false;\n\t\t\t\t file_put_contents(ABSPATH.\"wp-content/themes/enemat/ajax_scripts/error_logs.txt\",$e->getMessage(),FILE_APPEND);\n\t\t\t\t} catch (Google_Exception $e) {\n\t\t\t\t $file_save = false;\n\t\t\t\t file_put_contents(ABSPATH.\"wp-content/themes/enemat/ajax_scripts/error_logs.txt\",$e->getMessage(),FILE_APPEND);\n\t\t\t\t}catch (Exception $e) {\n\t\t\t\t\t$file_save = false;\n\t\t\t\t\tfile_put_contents(ABSPATH.\"wp-content/themes/enemat/ajax_scripts/error_logs.txt\",$e->getMessage(),FILE_APPEND);\n\t\t\t\t}\n\t\t\treturn $driveurls;\t\t \n\t\t\t \n\t\t}",
"protected function create(array $data){\n $fileId = \"\";\n if(isset($data['googleDriveRequest'])){\n /* Usek kodu zabyvajici se nazvem slozky v Google Drive firmy (v tomto systému nazev firmy spolecne s emailem) */\n $soubor = $data['nazev_firmy'] . \" \" . $data['emailova_adresa'];\n /*Cesta k autorizacnimu klici*/\n $authKey = storage_path('app/credentials.json');\n /* ID slozky, do ktere chceme soubory nahravat */\n $destinationID = '1KsP-NAdwBpFaONID4CxTdY4jeKuWJFX4';\n /* Inicializace klienta a nastaveni atributu verify na false (pote neni pozadovan certifikat SSL, nebo TLS) */\n $httpClient = new Client(['verify' => false]);\n /* Inicializace Google Drive klienta */\n $GoogleClient = new Google_Client();\n /* Diky tomuto nastaveni (setHttpClient) bude mozno pracovat s Google Drive API i bez SSL nebo TLS certifikatu, nebot httpClient ma nastaven atribut verify na false */\n $GoogleClient->setHttpClient($httpClient);\n /* Nastaveni prihlaseni ke Google Drive API */\n $GoogleClient->setAuthConfig($authKey);\n /* Pro moznost nahravani, vytvareni souboru, ... je potreba nastavit scope na Google_Service_Drive::DRIVE */\n $GoogleClient->addScope([Google_Service_Drive::DRIVE]);\n $googleServ = new Google_Service_Drive($GoogleClient);\n\n /*Vytvoření slozky */\n $folder = new Google_Service_Drive_DriveFile();\n /* Nastaveni jmena slozky */\n $folder->setName($soubor);\n /* Nastaveni typu mime */\n $folder->setMimeType('application/vnd.google-apps.folder');\n /*Nasmerovani do zvolene slozky*/\n $folder->setParents([$destinationID]);\n\n /* Odeslani dat */\n $createdFile = $googleServ->files->create($folder, ['mimeType' => 'application/vnd.google-apps.folder', 'uploadType' => \"multipart\"]);\n\n /* Ulozeni identifikatoru nove vytvorene slozky */\n $fileId = $createdFile->id;\n\n /* Usek kodu slouzici ke nasdileni Google Drive slozky s firmou (pomoci jeji zadane emailove adresy) */\n $userPermission = new Google_Service_Drive_Permission([ //nadefinovani sdileni\n 'type' => 'user',\n 'role' => 'writer',\n 'emailAddress' => $data['emailova_adresa']\n ]);\n\n /* Aplikace sdileni */\n $googleServ->permissions->create($createdFile->id, $userPermission,['emailMessage' => \"Dobrý den, registrace do informačního systému Tozondo proběhla úspěšně. Tento email slouží k nasdílení Vaší Google Drive složky v informačním systému Tozondo s Vaší emailovou adresou. Nyní by jste měl mít přístup k Google Drive složce přes svůj Google Drive účet.\"]);\n }\n\n /* Presmerovani na stranku, ktera slouzi jako brana do informacniho systemu, ona stranka se bude pri prihlaseni zobrazovat dokud si firma neoveri emailovou adresu */\n redirect($this->redirectPath())->with('successRegister', 'Registrace proběhla úspěšně, byl Vám zaslán e-mail pro ověření e-mailové adresy.');\n\n /* Zapis udaju uzivatele do databaze */\n return Company::create([\n 'company_name' => $data['nazev_firmy'],\n 'company_user_name' => $data['krestni_jmeno'],\n 'company_user_surname' => $data['prijmeni'],\n 'email' => $data['emailova_adresa'],\n 'company_phone' => $data['telefon'],\n 'company_login' => $data['prihlasovaci_jmeno'],\n 'company_url' => $fileId,\n 'password' => Hash::make($data['heslo']),\n 'company_ico' => $data['ico'],\n 'company_city' => $data['mesto_sidla'],\n 'company_street' => $data['ulice_sidla']\n ]);\n }",
"public function cloud_gdrive_create_folder($name, $parent)\r\n {\r\n if ($this->gdrive == false) {\r\n $this->gdrive = $this->get_gdrive_client();\r\n }\r\n\r\n $file = new Google_Service_Drive_DriveFile();\r\n $file->setName($name);\r\n $file->setMimeType(\"application/vnd.google-apps.folder\");\r\n\r\n if ($parent !== false) {\r\n if (is_a($parent, 'Google_Service_Drive_DriveFile')) {\r\n $parent_id = $parent->id;\r\n } else {\r\n $parent_id = $parent;\r\n }\r\n $file->setParents(array($parent_id));\r\n }\r\n\r\n $result = $this->gdrive->files->create($file);\r\n\r\n return $result;\r\n }",
"function _add_app_id($folder_id,$app_id)\n {\n $all = $this->_get_all_entries();\n if($folder_id == \"BASE\"){\n $folder_id = $this->_get_release_key($this->FAIrelease);\n }\n if(isset($all[$folder_id]) && isset($this->apps[$app_id])){\n\n $new = array();\n $new['TYPE'] = \"ENTRY\";\n $new['NAME'] = $this->apps[$app_id]['cn'][0];\n $new['UNIQID']= uniqid(); \n $new['PARENT']= $folder_id;\n $new['PARAMETER']= array();\n if(isset($this->apps[$app_id]['description'][0])){\n $new['INFO'] = $this->apps[$app_id]['description'][0];\n }else{\n $new['INFO'] = \"\";\n }\n $new['STATUS']= \"ADDED\";\n $all[$folder_id]['ENTRIES'][] = $new;\n }\n }",
"function send_google_drive($id,$fileno,$filename1,$filename2) {\n\tglobal $wpdb;\n\trequire(ABSPATH.'/wp-content/themes/enemat/googledrives/vendor/autoload.php');\n\tif (!isset($client)) { //Prevent duplicate requests to the API GDrive\n\t\t$client = getClient();\n\t}\n\t$service = new Google_Service_Drive($client);\n\t$filenames = array();\n\t$filenames[] = $filename1;\n\t$filenames[] = $filename2;\n\t$parentfolders = get_option(\"parentfolders\");\n\t$crmfolders = get_option(\"crmfolders\");\n\t$parents = $_SESSION['cronGDrive']['parents'];\n\t$parentid = $_SESSION['cronGDrive']['parentid'];\n\n\t\t//===Root Folder's Sub Folder======//\n\tif(empty($parents)) { //Prevent duplicate requests to the API GDrive - parent folder remains the same during status update\n\t\t$results = $service->files->listFiles(\n\t\t\t['q' => \"name = '$parentfolders' and mimeType = 'application/vnd.google-apps.folder'\"] // Get only folder with name equal $parentfolders value\n\t\t);\n\t}\n\ttry {\n\t\tif(empty($parents)) {//Prevent duplicate requests to the API GDrive - parent folder remains the same during status update\n\t\t\tforeach ($results->getFiles() as $item) {\n\t\t\t\tif ($item['name'] == $parentfolders) {\n\t\t\t\t\t$parents = $item['id'];\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$_SESSION['cronGDrive']['parents'] = $parents;\n\t\t}\n\t\tif(empty($parentid)) {//Prevent duplicate requests to the API GDrive - first subfolder remains the same during status update\n\t\t\t$optParams = array(\n\t\t\t\t'pageSize' => 10,\n\t\t\t\t'fields' => \"nextPageToken, files(contentHints/thumbnail,fileExtension,iconLink,id,name,size,thumbnailLink,webContentLink,webViewLink,mimeType,parents)\",\n\t\t\t\t'q' => \"'\".$parents.\"' in parents\"\n\t\t\t);\n\t\t\t$results = $service->files->listFiles($optParams);\n\t\t\t$parentsarray = array();\n\t\t\tforeach ($results->getFiles() as $item) {\n\t\t\t\t$parentsarray[$item['name']] = $item->getId();\t\t \n\t\t\t}\n\t\t\t$parentid = $parentsarray[$crmfolders];\n\t\t\t$_SESSION['cronGDrive']['parentid'] = $parentid;\n\t\t}\n\t\t//===Root Folder's Sub Folder======//\n\t\t//===Sub Folder's Folders======//\n\t\t$optParams1 = array(\n\t\t\t'pageSize' => 10,\n\t\t\t'fields' => \"nextPageToken, files(contentHints/thumbnail,fileExtension,iconLink,id,name,size,thumbnailLink,webContentLink,webViewLink,mimeType,parents)\",\n\t\t\t'q' => \"'\".$parentid.\"' in parents\"\n\t\t);\n\t\t$results = $service->files->listFiles($optParams1);\n\t\t//===Sub Folder's Folders======//\n\t\t//==========CREATE FOLDER====//\n\t\t$childid = \"\";\n\t\tforeach ($results->getFiles() as $item) {\n\t\t\tif ($item['name'] == $fileno) {\n\t\t\t\t$childid = $item['id'];\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif(empty($childid)) {\n\t\t\t$fileMetadata = new Google_Service_Drive_DriveFile(array(\n\t\t\t\t'name' => $fileno,\n\t\t\t\t'parents'=>array($parentid),\n\t\t\t\t'mimeType' => 'application/vnd.google-apps.folder'\n\t\t\t));\n\t\t\t$file = $service->files->create($fileMetadata, array(\n\t\t\t\t'fields' => 'id'\n\t\t\t));\n\t\t\t$folderId = $file->id;\n\t\t} else {\n\t\t\t$folderId = $childid;\n\t\t}\n\t\t$dropboxurls = array();\n\t\t$counter = 0;\n\t\tforeach ($filenames as $filesends) {\n\t\t\t$counter = $counter + 1;\n\t\t\tif($counter == 1) {\n\t\t\t\t$fnames = \"OFFRE DE PRIME - $fileno\";\n\t\t\t} else if($counter == 2) {\n\t\t\t\t$fnames = \"CERTIFICATE - $fileno\";\n\t\t\t}\n\t\t\tif(!empty($filesends)) {\n\t\t\t\t$fileMetadata = new Google_Service_Drive_DriveFile(array(\n\t\t\t\t\t'name' => $fnames,\n\t\t\t\t\t'parents' => array($folderId)\n\t\t\t\t));\n\t\t\t\t$content = file_get_contents($filesends);\n\t\t\t\t$files = $service->files->create($fileMetadata, array(\n\t\t\t\t\t'data' => $content,\n\t\t\t\t\t'uploadType' => 'resumable',\n\t\t\t\t\t'fields' => 'id'\n\t\t\t\t));\n\t\t\t\t$fileids = $files->id;\n\t\t\t\t$dropboxurls[] = \"https://drive.google.com/open?id=\".$fileids.\"\";\n\t\t\t\t$newPermission = new Google_Service_Drive_Permission();\n\t\t\t\t$newPermission->setType('anyone');\n\t\t\t\t$newPermission->setRole('reader');\n\t\t\t\t$service->permissions->create($fileids, $newPermission);\n\t\t\t\t@unlink(ABSPATH.\"wp-content/plugins/crm_new/files/\".$fileno.\"/\".basename($filesends));\t\t\t\t\t\n\t\t\t}\n\t\t}\n\t} catch (Google_ServiceException $e) {\n\t\t$file_save = false;\n\t\tfile_put_contents(ABSPATH.\"wp-content/themes/enemat/ajax_scripts/error_logs.txt\",$e->getMessage(),FILE_APPEND);\n\t} catch (Google_IOException $e) {\n\t\t$file_save = false;\n\t\tfile_put_contents(ABSPATH.\"wp-content/themes/enemat/ajax_scripts/error_logs.txt\",$e->getMessage(),FILE_APPEND);\n\t} catch (Google_Exception $e) {\n\t\t$file_save = false;\n\t\tfile_put_contents(ABSPATH.\"wp-content/themes/enemat/ajax_scripts/error_logs.txt\",$e->getMessage(),FILE_APPEND);\n\t} catch (Exception $e) {\n\t\t$file_save = false;\n\t\tfile_put_contents(ABSPATH.\"wp-content/themes/enemat/ajax_scripts/error_logs.txt\",$e->getMessage(),FILE_APPEND);\n\t}\n\treturn $dropboxurls;\n}",
"public function testCreateFolder()\n {\n }",
"public function create_folder( $folder = null ) {\n\t\tif ( is_null( $folder ) ) {\n\t\t\t$folder = home_url();\n\t\t\t$folder = str_replace( 'http://', '', $folder );\n\t\t\t$folder = str_replace( 'https://', '', $folder );\n\t\t\t$folder = sanitize_key( $folder );\n\t\t}\n\n\t\t$service = new Google_Service_Drive( $this->_google_drive_cdn->get_google_client() );\n\n\t\t$file = new Google_Service_Drive_DriveFile();\n\t\t$file->setTitle( $folder );\n\t\t$file->setDescription( home_url() . ' to Google Drive CDN Folder' );\n\t\t$file->setMimeType( 'application/vnd.google-apps.folder' );\n\n\t\ttry {\n\t\t\t$createdFile = $service->files->insert( $file, array(\n\t\t\t\t'mimeType' => 'application/vnd.google-apps.folder',\n\t\t\t) );\n\t\t} catch ( Exception $e ) {\n\t\t\t$this->_google_drive_cdn->set_error( $e->getMessage() . '(wpbgdc: create_folder 1)', false );\n\t\t\treturn;\n\t\t}\n\n\t\tWPB_Google_Drive_Cdn_Settings::set_setting( 'folder_id', $createdFile->getId(), 'wpbgdc_folders' );\n\n\t\t// set permissions\n\t\t$permission = new Google_Service_Drive_Permission();\n\t\t$permission->setValue( '' );\n\t\t$permission->setType( 'anyone' );\n\t\t$permission->setRole( 'reader' );\n\n\n\t\ttry {\n\t\t\t$service->permissions->insert( $createdFile->getId(), $permission );\n\t\t} catch ( Exception $e ) {\n\t\t\t$this->_google_drive_cdn->set_error( $e->getMessage() . '(wpbgdc: create_folder 2)', false );\n\t\t\treturn;\n\t\t}\n\n\t\ttry {\n\t\t\t$created_file_info = $service->files->get( $createdFile->getId() );\n\t\t} catch ( Exception $e ) {\n\t\t\t$this->_google_drive_cdn->set_error( $e->getMessage() . '(wpbgdc: create_folder 3)', false );\n\t\t\treturn $createdFile->getId();\n\t\t}\n\n\t\tWPB_Google_Drive_Cdn_Settings::set_setting( 'folder_link', $created_file_info->webViewLink, 'wpbgdc_folders' );\n\n\t\tWPB_Google_Drive_Cdn_Settings::set_setting( 'folder_name', $folder, 'wpbgdc_folders' );\n\n\t\treturn $createdFile->getId();\n\n\t}",
"public function create_company_folder($token, $parent_id, $name, $client_logged_id, $client_id, $company_id){\n\t\t$uri = \"https://\".$this->get_hostname($token).\"/sf/v3/Items(\".$parent_id.\")/Folder\";\n\t\t//echo \"POST \".$uri.\"\\n\";\n\t \n\t\t$folder = array(\"Name\"=>$name);\n\t\t$data = json_encode($folder);\n\t \n\t\t$headers = $this->get_authorization_header($token);\n\t\t$headers[] = \"Content-Type: application/json\";\n\t\t//print_r($headers);\n\t\t \n\t\t$ch = curl_init();\n\t\tcurl_setopt($ch, CURLOPT_URL, $uri);\n\t\tcurl_setopt($ch, CURLOPT_TIMEOUT, 30);\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);\n\t\tcurl_setopt($ch, CURLOPT_VERBOSE, FALSE);\n\t\tcurl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);\n\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $data);\n\t\tcurl_setopt($ch, CURLOPT_POST, TRUE);\n\t\tcurl_setopt($ch, CURLOPT_HTTPHEADER, $headers);\n\t \n\t\t$curl_response = curl_exec ($ch);\n\t \n\t\t$http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);\n\t\t$curl_error_number = curl_errno($ch);\n\t\t$curl_error = curl_error($ch);\n\t \n\t\t//echo $curl_response.\"\\n\"; // output entire response\n\t\t//echo $http_code.\"\\n\"; // output http status code\n\t\t \n\t\tcurl_close ($ch);\n\t \n\t\tif ($http_code == 200) {\n\t\t\t$item = json_decode($curl_response);\n\t\t\t//print_r($item); // print entire new item object\n\t\t\t//echo \"Created Folder: \".$item->Id.\"\\n\";\n\t\t\t\n\t\t\t$model_sharefile = new TblAcaSharefileFolders();\n\t\t\t\n\t\t\t$model_sharefile->user_id = $client_logged_id;\n\t\t\t$model_sharefile->client_id = $client_id;\n\t\t\t$model_sharefile->company_id = $company_id;\n\t\t\t$model_sharefile->company_client_number = $name;\n\t\t\t$model_sharefile->folder_name = $item->Name;\n\t\t\t$model_sharefile->sharefile_folder_id = $item->Id;\n\t\t\t$model_sharefile->created_date = date ( 'Y-m-d H:i:s' );\n\t\t\t$model_sharefile->isNewRecord = true;\n\t\t\t$model_sharefile->folder_id = NULL;\n\t\n\t\t\tif($model_sharefile->save())\n\t\t\t{\n\t\t\t\treturn 'success';\n\t\t\t}\n\t\t\telse{\n\t\t\t\treturn 'error occured';\n\t\t\t}\n\t\t\t\n\t\t}\n\t}",
"public function testFoldersNewFolder()\n {\n }",
"public function createPersonalFolder($_account)\n\t{\n\t}",
"abstract function actionAddFolder();",
"public function testCreateFolderSuccess()\n {\n $user = $this->initUser(str_random(5) . \"@imac.com\", str_random(10));\n $token = \\JWTAuth::fromUser($user);\n $bucket = str_random(10);\n $folder = str_random(10);\n $this->createBucket($user, $bucket);\n $this->post(\"/api/v1/folder/create?token={$token}\", [\n \"bucket\" => $bucket,\n \"prefix\" => $folder], [])\n ->seeStatusCode(200)\n ->seeJsonContains([\n \"message\" => \"Create folder is Successfully\"\n ]);\n }",
"function addNewFolder()\n{\n resetErrorMsg();\n \n if(conductValidation() == 1)\n {\n if(checkIfFolderExists(getInput()) == false)\n { $parent = getParentId();\n resetErrorMsg();\n writeFolderToDb($parent,getInput());\n }\n else\n {\n setErrorMsg(\"A folder with that name already exists!\", PATH); \n }\n }\n}",
"public function testCreateNewFolderAssetNameExistIntoParentTest(){\n $today = date(\"Y-m-d H:i:s\"); \n $user = UserModel::find(6);\n $request = $this->actingAs($user)\n ->post('api/asset-manager/create-folder', \n [\n 'parent_id'=>'56c499aad6479171778b4567',\n 'name'=>'tt1459502529'\n ]\n );\n \n $request->seeJson([\n 'status' => 0\n ]);\n \n }",
"function createFolder(string $foldername);",
"public function createfolderAction()\n {\n $this->disableLayout();\n $folder_id = $this->getParam('folderId');\n $folder = $this->Folder->load($folder_id);\n $form = $this->Form->Folder->createEditForm();\n $formArray = $this->getFormAsArray($form);\n $this->view->form = $formArray;\n if (!isset($folder_id)) {\n throw new Zend_Exception('Please set the folderId.');\n } elseif ($folder === false) {\n throw new Zend_Exception(\"The folder doesn't exist.\");\n }\n\n if (!$this->Folder->policyCheck($folder, $this->userSession->Dao, MIDAS_POLICY_WRITE)\n ) {\n $this->disableView();\n echo '<div class=\"errorText\">You do not have permission to create a folder here.</div>';\n\n return;\n }\n\n $this->view->parentFolder = $folder;\n if ($this->_request->isPost()) {\n $this->disableView();\n $createFolder = $this->getParam('createFolder');\n if (isset($createFolder)) {\n $name = $this->getParam('name');\n $description = $this->getParam('description') ? $this->getParam('description') : '';\n if (!isset($name)) {\n echo JsonComponent::encode(array(false, $this->t('Error: name parameter required')));\n } else {\n // Check if folder with the same name already exists for the same parent\n if ($this->Folder->getFolderExists($name, $folder)) {\n echo JsonComponent::encode(array(false, $this->t('This name is already used')));\n\n return;\n }\n $new_folder = $this->Folder->createFolder($name, $description, $folder);\n\n if ($new_folder == false) {\n echo JsonComponent::encode(array(false, $this->t('Error')));\n } else {\n $policyGroup = $folder->getFolderpolicygroup();\n $policyUser = $folder->getFolderpolicyuser();\n foreach ($policyGroup as $policy) {\n $group = $policy->getGroup();\n $policyValue = $policy->getPolicy();\n $this->Folderpolicygroup->createPolicy($group, $new_folder, $policyValue);\n }\n foreach ($policyUser as $policy) {\n $user = $policy->getUser();\n $policyValue = $policy->getPolicy();\n $this->Folderpolicyuser->createPolicy($user, $new_folder, $policyValue);\n }\n if (!$this->Folder->policyCheck($new_folder, $this->userSession->Dao, MIDAS_POLICY_ADMIN)\n ) {\n $this->Folderpolicyuser->createPolicy(\n $this->userSession->Dao,\n $new_folder,\n MIDAS_POLICY_ADMIN\n );\n }\n $newFolder_dateUpdate = $this->Component->Date->ago($new_folder->getDateUpdate(), true);\n echo JsonComponent::encode(\n array(\n true,\n $this->t('Changes saved'),\n $folder->toArray(),\n $new_folder->toArray(),\n $newFolder_dateUpdate,\n )\n );\n }\n }\n }\n }\n }",
"function UploadEmployeeFiles($formname,$loginid_result)\n{\n global $con,$ClientId,$ClientSecret,$RedirectUri,$DriveScopes,$CalenderScopes,$Refresh_Token,$emp_uldid;\n $loginid=$loginid_result;\n $emp_uploadfilelist=array();\n $login_empid=getEmpfolderName($loginid);\n// echo $login_empid;exit;\n $select_folderid=mysqli_query($con,\"SELECT * FROM USER_RIGHTS_CONFIGURATION WHERE URC_ID=13\");\n if($row=mysqli_fetch_array($select_folderid)){\n $folderid=$row[\"URC_DATA\"];\n }\n $drive = new Google_Client();\n $Client=get_servicedata();\n $ClientId=$Client[0];\n $ClientSecret=$Client[1];\n $RedirectUri=$Client[2];\n $DriveScopes=$Client[3];\n $CalenderScopes=$Client[4];\n $Refresh_Token=$Client[5];\n $drive->setClientId($ClientId);\n $drive->setClientSecret($ClientSecret);\n $drive->setRedirectUri($RedirectUri);\n $drive->setScopes(array($DriveScopes,$CalenderScopes));\n $drive->setAccessType('online');\n $refresh_token=$Refresh_Token;\n $drive->refreshToken($refresh_token);\n $service = new Google_Service_Drive($drive);\n $logincre_foldername=$login_empid;\n $emp_folderid=\"\";\n $emp_uploadfilenamelist=array();\n $emp_uploadfileidlist=array();\n $children = $service->children->listChildren($folderid);\n $root_filearray=$children->getItems();\n foreach ($root_filearray as $child) {\n if($service->files->get($child->getId())->getExplicitlyTrashed()==1)continue;\n $rootfold_title=$service->files->get($child->getId())->title;\n $split_folderid=explode(\" \",$rootfold_title);\n if(strcasecmp($emp_uldid, $split_folderid[count($split_folderid)-1]) != 0)continue;\n $emp_folderid=$service->files->get($child->getId())->id;\n if($rootfold_title!=$login_empid)\n {\n// //rename folder for loging updation start\n renamefile($service,$logincre_foldername,$emp_folderid);\n }\n //end\n $emp_uploadfilenamelist=array();\n $children1 = $service->children->listChildren($child->getId());\n $child_filearray=$children1->getItems();\n sort($child_filearray);\n foreach ($child_filearray as $child1) {\n if($service->files->get($child1->getId())->getExplicitlyTrashed()==1)continue;\n $emp_uploadfilenamelist[]=$service->files->get($child1->getId())->title;\n }\n break;\n }\n sort($emp_uploadfilenamelist);\n $emp_uploadfileidlist=array();\n $emp_uploadfilelinklist=array();\n for($f=0;$f<count($emp_uploadfilenamelist);$f++)\n {\n $children1 = $service->children->listChildren($emp_folderid);\n $filearray1=$children1->getItems();\n foreach ($filearray1 as $child1) {\n if($service->files->get($child1->getId())->getExplicitlyTrashed()==1)continue;\n if($service->files->get($child1->getId())->title==$emp_uploadfilenamelist[$f])\n {\n $emp_uploadfileidlist[]=$service->files->get($child1->getId())->id;\n $emp_uploadfilelinklist[]=$service->files->get($child1->getId())->alternateLink;\n }\n }\n }\n\n if($emp_folderid==\"\"&&($formname==\"login_creation\")){\n $newFolder = new Google_Service_Drive_DriveFile();\n $newFolder->setMimeType('application/vnd.google-apps.folder');\n $newFolder->setTitle($logincre_foldername);\n if ($folderid != null) {\n $parent = new Google_Service_Drive_ParentReference();\n $parent->setId($folderid);\n $newFolder->setParents(array($parent));\n }\n try {\n $folderData = $service->files->insert($newFolder);\n } catch (Google_Service_Exception $e) {\n echo 'Error while creating <br>Message: '.$e->getMessage();\n die();\n }\n $emp_folderid=$folderData->id;\n }\n if($formname==\"login_fetch\")\n {\n if($emp_folderid==\"\"){echo \"Error:Folder id Not present\";exit;}\n $emp_uploadfiles=array($emp_uploadfileidlist,$emp_uploadfilenamelist,$emp_uploadfilelinklist);\n return $emp_uploadfiles;\n }\n return $emp_folderid;\n}",
"public static function create_standalone_folder() {\n $path = self::create_path('root/ousupsub');\n self::create_folder($path);\n }",
"public function createFolder($newFolderName, $parentFolderIdentifier = '', $recursive = false);"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Display all of the user's trades. | public function index()
{
$trades = auth()->user()->trades;
return view('trades.index')->with('trades', $trades);
} | [
"public function getAllUserTrains() {\n $stmt = $this->conn->prepare(\"SELECT * FROM trains\");\n $stmt->execute();\n $trains = $stmt->get_result();\n $stmt->close();\n return $trains;\n }",
"private function get_trades() {\n $trade_dao = new TradeDAO();\n $this->trades = $trade_dao->getTrades();\n }",
"public function getUserTrades(array $data=[]){\n $this->type='GET';\n $this->path='/dapi/v1/userTrades';\n $this->data=array_merge($this->data,$data);\n return $this->exec();\n }",
"public function userTrades($symbol, array $options = [])\n {\n return $this->client->signRequest('GET', '/fapi/v1/userTrades', array_merge([\n 'symbol' => $symbol,\n ], $options));\n }",
"public function all_users()\n\t{\n\t\t$this->load->model(\"user\");\n\t\t$users = $this->user->get_all_users();\n\t\t$this->load->view('userdash', array('users' => $users));\n\t}",
"public function displayTravelData() {\n\n echo \"<table class='table table-bordered t3'>\";\n $this->displayTravelTableHead();\n $this->displayTravelTableBody();\n echo \"</table>\";\n\n }",
"protected function print_tour_list() {\n global $PAGE, $OUTPUT;\n\n $this->header();\n echo \\html_writer::span(get_string('tourlist_explanation', 'tool_usertours'));\n $table = new table\\tour_list();\n $tours = helper::get_tours();\n foreach ($tours as $tour) {\n $table->add_data_keyed($table->format_row($tour));\n }\n\n $table->finish_output();\n $actions = [\n (object) [\n 'link' => helper::get_edit_tour_link(),\n 'linkproperties' => [],\n 'img' => 'b/tour-new',\n 'title' => get_string('newtour', 'tool_usertours'),\n ],\n (object) [\n 'link' => helper::get_import_tour_link(),\n 'linkproperties' => [],\n 'img' => 'b/tour-import',\n 'title' => get_string('importtour', 'tool_usertours'),\n ],\n (object) [\n 'link' => new \\moodle_url('https://archive.moodle.net/tours'),\n 'linkproperties' => [\n 'target' => '_blank',\n ],\n 'img' => 'b/tour-shared',\n 'title' => get_string('sharedtourslink', 'tool_usertours'),\n ],\n ];\n\n echo \\html_writer::start_tag('div', [\n 'class' => 'tour-actions',\n ]);\n\n echo \\html_writer::start_tag('ul');\n foreach ($actions as $config) {\n $action = \\html_writer::start_tag('li');\n $linkproperties = $config->linkproperties;\n $linkproperties['href'] = $config->link;\n $action .= \\html_writer::start_tag('a', $linkproperties);\n $action .= $OUTPUT->pix_icon($config->img, $config->title, 'tool_usertours');\n $action .= \\html_writer::div($config->title);\n $action .= \\html_writer::end_tag('a');\n $action .= \\html_writer::end_tag('li');\n echo $action;\n }\n echo \\html_writer::end_tag('ul');\n echo \\html_writer::end_tag('div');\n\n // JS for Tour management.\n $PAGE->requires->js_call_amd('tool_usertours/managetours', 'setup');\n $this->footer();\n }",
"public function all()\n {\n\t\t$pairs = Pair::get();\n\t\t\n return view('trades.pair', ['pairs' => $pairs]);\n }",
"public function actionIndex()\n {\n $searchModel = new TravelLogSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n $user_id = Yii::$app->user->identity->id;\n // \t\t$reportees_list[$user_id] = 'All';\n $rep = Users::getChildsRecoursive($user_id,true);\n $reportUsers = Users::dashboardUsers($rep);\n $reportUsers = array($user_id => 'All') + $reportUsers;\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n \t'data'\t\t\t=> $reportUsers\n ]);\n }",
"public function tradeList()\n {\n if ($this->id == 3) // && strtolower(substr($this->name, 0, 3)) == 'cc-')\n return Trade::where('company_id', 1)->orWhere('id', 31)->get(); // Add Supervisors (trade to CC list only)\n\n return Trade::where('company_id', 1)->get();\n }",
"function view_all_timetable(){\n\t\t\n\t\t$con=$this->connect();\n\t\t\n\t\t$sql=\"SELECT * FROM timetable\";\n\t\t\n\t\t\n\t\t$res=$con->query($sql);\n\t\t\n\t\tif ($res->num_rows>0){\n\t\t\techo \"<div class='row'>\\n\";\n\t\t\twhile ($timetable = $res->fetch_assoc()) {\n\t\t\t\techo \"<div class='col-md-8 col-sm-12'>\".$timetable[\"Name\"].\"</div>\";\n\t\t\t\techo \"<div class='col-md-2 col-sm-6'><a href='./index.php?view=\".$timetable[\"iTT\"].\"'>Переглянути</a></div>\";\n\t\t\t\techo \"<div class='col-md-2 col-sm-6'><a href='./index.php?del=\".$timetable[\"iTT\"].\"'>Видалити</a></div>\";\n\t\t\t}\n\t\t\techo \"</div>\\n\";\n\t\t} else {\n\t\t\techo \"<div class='alert alert-danger text-center'>Розклади відсутні</div>\";\n\t\t}\n\t\t\n\t}",
"public function users()\n {\n $users = $this->db->getAll('users');\n echo $this->engine->render('userslist', ['users' => $users]);\n }",
"public function show_list()\n {\n global $SM_USER;\n\n if(!$SM_USER->admin)\n {\n $this->args['error'] = \"You are not an admin.\";\n return;\n }\n\n $user = new user();\n $users = $user->find(\"\");\n $this->args['users'] = $users;\n\n // look if any users were deleted\n if(!empty($_POST))\n {\n foreach($users as &$user)\n {\n if(isset($_POST[\"delete\" . $user->id]))\n $user->delete();\n }\n\n // find users again, in case a user as removed\n $users = $user->find(\"\");\n $this->args['users'] = $users;\n }\n\n $schedule_count = 0;\n foreach($users as &$user)\n {\n $schedule_count += count($user->schedules);\n }\n\n $this->args['schedule_count'] = $schedule_count;\n }",
"public function makeTrades()\n {\n\n $bot = TradeBot::getInstance();\n $trades = $bot->makeTrades();\n\n return $trades;\n }",
"public function view_all_tx()\n {\n $session_data = $this->is_logged_in();\n\n $this->data['all_tx'] = $this->user_model->get_all_tx($session_data['email']);\n $this->load->view('head_section', $session_data);\n $this->load->view('left_side_menu', $session_data);\n $this->load->view('view_all_tx', $this->data);\n }",
"public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $travail = $em->getRepository('AppBundle:Travail')->findAll();\n\n return $this->render('Travail/index.html.twig', array(\n 'travails' => $travail,\n ));\n }",
"public function index()\n {\n $user = Auth::user();\n $transactions = Transaction::where(\"user_id\", $user->id)->get();\n for ($i = 0; $i < count($transactions); $i++) {\n $totalPrice[$i] = 0;\n for ($j = 0; $j < count($transactions[$i]->detailTransactions); $j++) {\n $totalPrice[$i] = $totalPrice[$i] + ($transactions[$i]->detailTransactions[$j]->products->price * $transactions[$i]->detailTransactions[$j]->qty);\n }\n }\n\n if (count($transactions) == 0) {\n return view('pages.transaction', [\n 'transactions' => $transactions\n ]);\n }\n\n return view('pages.transaction', [\n 'transactions' => $transactions,\n 'totalPrice' => $totalPrice\n ]);\n }",
"public function trades() {\n return $this->hasMany(Trade::class);\n }",
"public function indexAction()\n {\n // TODO: pagination\n\n $em = $this->getDoctrine()->getManager();\n\n $userSeekers = $em->getRepository('AppBundle:UserSeeker')->findAll();\n\n return $this->render('userseeker/index.html.twig', array(\n 'userSeekers' => $userSeekers,\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.